Builds / 1.15.80
Update 1.15.80
Compared with 1.15.40 · published Thu, 15 Oct 2026 00:00:41 GMT · live channel
Highlights
- Friends are here: a new Friends window with friend codes, requests, blocking, and an online list, opened from the right-side menu.
- Profile customization: pick a Showcase face and frame per race. Frames raise your Castle and hero levels, and your face now shows in rankings and PvP.
- Guild War Season 3 rules: Tribe Territory, Fatigue and Blessing Card, with new tribe-themed battle maps.
New content
- Friends: new Friends window with these features. It unlocks at Max Wave 50 and appears to need a Friends button in the right-side menu (
FriendManager,RightMenu,FriendService). - Friend list with online status, "Hunted together", and Remove Friend.
- Requests that expire after a set number of days.
- Add Friend with an 8-digit friend code, with a Paste option and a "New Code" option that makes the old code stop working.
- Block and Unblock, with a Blocked list.
- Customize Profile: opened with the "Customize" button in Profile (
ProfilePopup,ProfileDecoManager). - Choose a face from heroes you own, or the default race face.
- Choose a frame.
- Set one race's face as your Showcase.
- Changes apply once you save.
- Profile Frames raise your Castle and all heroes' levels. This applies to normal battles only.
- Each frame has an Own bonus (just for having it) and an Equip bonus (when worn on the current race's slot).
- Wave frames unlock as your highest wave reaches 1,000 / 2,000 / 5,000 / 7,000 / 10,000 / 20,000 / 30,000 / 50,000 / 70,000.
- Gift Frames (Silver, Copper, Red, Green, Blue, Purple) are free. You get them for your first friend, for first opening Customize Profile, and for your first rebirth as each race.
- Server Tournament and Guild War Season frames arrive by mail and are given once per rank.
- A frame guide explains how the bonuses stack (
ProfileFrameGuidePopup). - Auto Rebirth adds two checkboxes to the Rebirth window: Auto Rebirth and "500 Gems (Medal x 2)" (
GameOverPopup). - A 15-second countdown starts after your Castle is destroyed.
- It unlocks at Max Wave 1,000 and one prior rebirth.
- The countdown pauses while another window is open.
- If Gems run short, it does a normal Rebirth and says so on the result screen.
- Guild War Season 3 rules (
GuildWarGuidePopup,GuildWarBattleController): - Tribe Territory: the 16 outer castles form four zones, each assigned a tribe per stage. Capturing castles lowers that tribe's legion levels in the enemy guild's castles.
- Fatigue: each successful defense lowers that defender's legion level, and it resets every stage.
- Blessing Card: one tribe is blessed each stage and gains levels when attacking and defending.
- The guide also adds a line on how long a defender stays protected, and a note that level adjustments are fixed when an attack starts.
- New tribe-themed battle maps, and new board graphics for zones and castles.
- Guild Shop: now sells pet shards, with a daily purchase limit shown on the button. Raid Coins can be a cost (
GuildShopItemRenderer,GuildShopSubView). - New pets: Flutter, Tusky, Drumbo, Guardion, Champy and Shellfort (new
UI_PETicons and names). - Hero auto-upgrade toggle in the Hero menu, unlocked at Max Wave 1,000 (
HeroAutoController,HeroSubMenu). It appears to spend up to half your gold every few seconds, leveling your team's heroes as evenly as it can.
Changes
- Rankings, the ranking podium, PvP rankings and PvP opponents now show players' Showcase face and frame (
RankingPopup,PodiumColumn,PVPBattleSubView). - Profile window redesigned (
ProfilePopup,TribeBanner): - New layout with your face and frame at the top.
- Rows with icons, and tap-to-expand help.
- Larger race banner.
- Castle auto-upgrade now splits gold across upgrades with a fairer plan instead of buying one upgrade at a time (
CastleAutoController). - Medal-buy window now shows the Medals used (
HeroMassiveBuyResultPopup). The mass-buy button also checks you have enough Medals and shows the required amount if not (HeroHireSubMenu). - Blessing of Abundance text reworded: it now says Medal acquisition increases in your next Rebirth, and the bonus doesn't count toward Soul Rest.
- Fire Spirit orbs now look like comets with a trail. The orbs and their explosions are smaller, and orbs fly back into the caster (
FireOrb1,FireSpirit1). - Skill damage now scales by distance beyond your record wave, with a steeper ramp past wave 12,000 (
ActiveSkillDamageHelper). - "Hide My Team Formation" and the hidden-team message now use the standard text keys (
RankingUserTeamPopup).
Fixes
- Pop-ups that close when you tap outside no longer close from the same tap that opened them (
BasePopup). - Fixed the Rebirth screen's layout and its checkbox hit areas (
GameOverPopup). - Fixed the pet favorite icon showing on pets where it shouldn't (
PetDetailPopup). - Fixed the mail list title overlapping the date (
MailItemRenderer). - Mail with profile frames now refreshes your frames and shows a message telling you if the frame is new or a duplicate (
MailPopup,MailDetailPopup). - The game now notices when a new build is live and shows an update prompt instead of failing on a missing file (
SystemErrorPopup). - Language packs can now load from a CDN, with the local copy as a fallback (
LanguageManager).
Technical
- The client is now split into lazy-loaded chunks (Fishing, Mini Ascent, Friends, Guild War popups, vendor libraries). Chunk files and
./relative paths replace the old bundled imports. - The old fishing topdown assets were removed, and the Guild War atlas was rebuilt with new tribe board art.
- The
ProfileDecosprite sheet is now loaded at startup. The Guild War board backgrounds for each tribe load on demand. - Obfuscated short names were reshuffled across most classes by the new build.
- Added
FriendService,ProfileDecoServiceand their URL endpoints. - The version is now 1.15.80.
AI summary (claude-sonnet-5-5) written from the diffs below. Check the evidence before quoting it.
Text changes 186
| Key | Text | |
|---|---|---|
| GAME_1933 | + | Medals Used |
| GAME_1934 | + | Auto Rebirth |
| GAME_1935 | + | With Auto Rebirth on, you will automatically Rebirth ## sec after your Castle is destroyed. |
| GAME_1936 | + | 1. When your Castle is destroyed, the remaining time is shown in the Rebirth window. |
| GAME_1937 | + | 2. If you press a button yourself during the countdown, that action is used. Turn off Auto Rebirth to stop it. |
| GAME_1938 | + | 3. If 500 Gems (Medal x 2) is also checked, 500 Gems are used to earn double Medals. If you don’t have enough Gems, a normal Rebirth is performed. |
| GAME_1939 | + | 4. You will Rebirth with the team selected in Rewards (Current Team / Rebirth Team). |
| GAME_1940 | + | 5. The countdown pauses while another window is open. |
| GAME_1941 | + | Friends |
| GAME_1942 | + | Requests |
| GAME_1943 | + | Add Friend |
| GAME_1944 | + | Online |
| GAME_1945 | + | Hunted together |
| GAME_1946 | + | Remove Friend |
| GAME_1947 | + | Block |
| GAME_1948 | + | Blocked ({0}) |
| GAME_1949 | + | Unblock |
| GAME_1950 | + | My Code |
| GAME_1951 | + | Share this code with your friends |
| GAME_1952 | + | New Code |
| GAME_1953 | + | Request with a friend code |
| GAME_1954 | + | Send Request |
| GAME_1955 | + | Your friend list is full |
| GAME_1956 | + | Requests {0}/{1} |
| GAME_1957 | + | Requests expire after {0} days |
| GAME_1958 | + | {0}d left |
| GAME_1959 | + | {0} online |
| GAME_1960 | + | No friends yet |
| GAME_1961 | + | Swap codes in [Add Friend] |
| GAME_1962 | + | No requests |
| GAME_1963 | + | Share your code and requests will show up here |
| GAME_1964 | + | Remove {0} from your friends? |
| GAME_1965 | + | Block {0}? They'll be removed from your friends and can't send you requests |
| GAME_1966 | + | Get a new code? Your current code will stop working |
| GAME_1967 | + | Request sent |
| GAME_1968 | + | That's your own code |
| GAME_1969 | + | Already friends |
| GAME_1970 | + | Please check the friend code |
| GAME_1971 | + | You're now friends with {0} |
| GAME_1972 | + | Request declined |
| GAME_1973 | + | Removed from friends |
| GAME_1974 | + | Blocked |
| GAME_1975 | + | Unblocked |
| GAME_1976 | + | Code copied |
| GAME_1977 | + | Got a new code |
| GAME_1978 | + | Request already sent |
| GAME_1979 | + | You've blocked this player. Unblock them to send a request |
| GAME_1980 | + | Their friend list is full |
| GAME_1981 | + | They have too many pending requests |
| GAME_1982 | + | This request has expired |
| GAME_1983 | + | No blocked players |
| GAME_1984 | + | Can't send you requests |
| GAME_1985 | + | Please try again in a moment |
| GAME_1986 | + | Paste |
| GAME_1987 | + | Press and hold the code boxes to paste |
| GAME_1988 | + | No 8-digit code found in the copied text |
| GAME_1989 | + | From Season 3, the Tribe Territory, Fatigue and Blessing Card rules are added. |
| GAME_1990 | + | A defender who defends successfully is protected for {0} minutes. |
| GAME_1991 | + | Level adjustments are fixed at the moment the attack starts and do not change during battle. |
| GAME_1992 | + | Tribe Territory |
| GAME_1993 | + | The 16 castles other than the main castle (S) are divided into four zones. Each stage, each zone is assigned one tribe (Human, Elf, Undead, Orc), the same for both guilds. |
| GAME_1994 | + | Each time you capture a castle in a zone, the level of that zone's tribe legions (heroes and soldiers) in all of the enemy guild's castles drops by {0}. Capturing a whole zone gives −{1}. |
| GAME_1995 | + | Empty castles that are captured automatically also count as captured. |
| GAME_1996 | + | When the stage changes, tribes are assigned anew and the map changes too. |
| GAME_1997 | + | Fatigue |
| GAME_1998 | + | Each successful defense lowers that defender's legion (heroes and soldiers) level by {0}. |
| GAME_1999 | + | Fatigue resets every stage. |
| GAME_2000 | + | The more times a defender holds, the weaker they get, so even strong defenders can be broken by attacking again and again. |
| GAME_2001 | + | Blessing Card |
| GAME_2002 | + | Each stage, one tribe is blessed. It is the same for both guilds. |
| GAME_2003 | + | Legions of the blessed tribe gain {0} levels (heroes and soldiers) both when attacking and when defending. |
| GAME_2004 | + | Match your attack and defense legions to each stage's blessed tribe for an edge. |
| GAME_2005 | + | Blessing |
| GAME_2006 | + | Stage {0} Blessing · Attack with {1} legions: legion (hero & soldier) level +{2} |
| GAME_2007 | + | On capture, all enemies |
| GAME_2008 | + | Applied |
| GAME_2009 | + | Capture Effect |
| GAME_2010 | + | All enemies |
| GAME_2011 | + | Stage {0} opens |
| GAME_2012 | + | Final stage |
| GAME_2013 | + | {0} Land |
| GAME_2014 | + | Enemy {0} legions |
| GAME_2015 | + | Our {0} legions |
| GAME_2016 | + | You've taken {0} of the 4 enemy castles in this land. |
| GAME_2017 | + | Each one you take lowers the {0} legions (heroes and soldiers) in all enemy castles by {1} level. |
| GAME_2018 | + | Take all 4 for −{1} levels! If strong {0} defenders block you, aim for this land first. |
| GAME_2019 | + | The enemy has taken {0} of our 4 castles in this land. |
| GAME_2020 | + | Each one we lose lowers the {0} legions (heroes and soldiers) in all our castles by {1} level. |
| GAME_2021 | + | When the stage changes, the land's tribe changes and the count starts over. |
| GAME_2022 | + | Hold the castles in this land to keep our {0} defenders strong. |
| GAME_2023 | + | Stage {0} Blessing |
| GAME_2024 | + | {0} legions |
| GAME_2025 | + | This stage, {0} legions get {1} levels stronger (heroes and soldiers) in both attack and defense. |
| GAME_2026 | + | Switch your attack and defense legions to match the blessed tribe. |
| GAME_2027 | + | The rival guild gets the same blessing. |
| GAME_2028 | + | The blessed tribe changes with each stage. |
| GAME_2029 | + | Customize Profile |
| GAME_2030 | + | Customize |
| GAME_2031 | + | {0} race · Showcase: {1} |
| GAME_2032 | + | Now |
| GAME_2033 | + | Showcase |
| GAME_2034 | + | Current rebirth race — shown at the top |
| GAME_2035 | + | Shown at the top when reborn as {0} |
| GAME_2036 | + | Set as Showcase |
| GAME_2037 | + | Showcase Face |
| GAME_2038 | + | {0} face set as Showcase — others see it after you save |
| GAME_2039 | + | Face |
| GAME_2040 | + | Frame |
| GAME_2041 | + | Default {0} face |
| GAME_2042 | + | Used if you don't choose (same as now) |
| GAME_2043 | + | Get this hero to use it |
| GAME_2044 | + | Wave {0} |
| GAME_2045 | + | Reach wave {0} to unlock |
| GAME_2046 | + | Wave Milestones |
| GAME_2047 | + | Saved |
| GAME_2048 | + | Couldn't save. Please try again later. |
| GAME_2049 | + | Close without saving? |
| GAME_2050 | + | Showcase = the face others see, like in friend lists |
| GAME_2051 | + | Waves |
| GAME_2052 | + | Guild War Season · Server Rank |
| GAME_2053 | + | 4th–5th |
| GAME_2054 | + | Rank {0} |
| GAME_2055 | + | Champion |
| GAME_2056 | + | Runner-up |
| GAME_2057 | + | For members of the {0} guild on the server in a Guild War season |
| GAME_2058 | + | For members of the {0} guild in the Server Tournament |
| GAME_2059 | + | New profile frame received — try it in Profile › Customize |
| GAME_2060 | + | You already have this frame |
| GAME_2061 | + | 6th–8th |
| GAME_2062 | + | Top {0} |
| GAME_2063 | + | Own +{0} · Equip +{1} |
| GAME_2064 | + | Frame bonus: Castle · Hero Lv +{0} (Own +{1} · Equip +{2}) |
| GAME_2065 | + | Profile Frames |
| GAME_2066 | + | Frames raise the level of your castle and all heroes just by owning them (Own) or by putting one on your profile (Equip). Applies to normal battles only. |
| GAME_2067 | + | Server Tournament · Guild War Season Frames |
| GAME_2068 | + | Each rank's frame is given only once. You can't receive the same rank's frame again. |
| GAME_2069 | + | Only the highest-ranked frame's Own bonus applies. Even if you have both the 1st and 2nd place frames, you only get the 1st place bonus. |
| GAME_2070 | + | Server Tournament and Guild War Season count separately. If you have both, you get both bonuses. |
| GAME_2071 | + | Frames arrive by mail. After claiming, you can equip them in Customize. |
| GAME_2072 | + | Wave Frames |
| GAME_2073 | + | Unlocked when your highest wave reaches the target. |
| GAME_2074 | + | Owned bonuses from all wave frames stack. |
| GAME_2075 | + | Equip Bonus |
| GAME_2076 | + | Only the Equip bonus of the frame on your current rebirth race's slot applies. |
| GAME_2077 | + | When you're reborn as a different race, the Equip bonus switches to the frame in that race's slot. |
| GAME_2078 | + | Default |
| GAME_2079 | + | Hide My Team Formation |
| GAME_2080 | + | This player has set their team formation to private. |
| GAME_2081 | + | You can only add players on the same server |
| PROFILE_DECO_REP | + | Showcase Profile |
| PROFILE_DECO_PREVIEW | + | Preview |
| PROFILE_DECO_OWN_EFFECT | + | Owned Bonus |
| PROFILE_DECO_ACTIVE_EFFECT | + | Active bonus |
| PROFILE_DECO_ACQUIRE | + | Acquire to equip |
| PROFILE_DECO_FACE_HINT | + | Use the faces of heroes you own. |
| GAME_2082 | + | Gift Frames · Free for everyone |
| GAME_2083 | + | Silver |
| GAME_2084 | + | Copper |
| GAME_2085 | + | Red |
| GAME_2086 | + | Green |
| GAME_2087 | + | Blue |
| GAME_2088 | + | Purple |
| GAME_2089 | + | Gift Frames |
| GAME_2090 | + | Get it when you make your first friend |
| GAME_2091 | + | Get it when you first open Customize Profile |
| GAME_2092 | + | Get it when you're first reborn as {0} |
| GAME_2093 | + | Get them from your first friend, opening Customize Profile for the first time, and your first rebirth as each race. |
| GAME_2094 | + | The Own bonuses of all your gift frames add up. |
| GAME_2095 | + | Active |
| GAME_2096 | + | Applies once obtained |
| GAME_2097 | + | Applies when equipped |
| GAME_2098 | + | {0} bonus is active |
| GAME_2099 | + | Applies when reborn as {0} |
| GAME_2100 | + | Faces only change your look · No bonus |
| GAME_2101 | + | Not enough gems, so a normal Rebirth (Medal x 1) was done. |
| PET_NAME_1015 | + | Flutter |
| PET_NAME_1016 | + | Tusky |
| PET_NAME_1017 | + | Drumbo |
| PET_NAME_1018 | + | Guardion |
| PET_NAME_1019 | + | Champy |
| PET_NAME_1020 | + | Shellfort |
| GAME_2102 | + | The badges on the board edges show each zone's tribe, castles captured and the current level change. Tap one for details. |
| GAME_2103 | + | Tap the blessing chip at the top right of the board to see this stage's blessing. |
| GAME_1899 | ~ |
|
| GAME_1900 | ~ |
|
| GAME_1901 | ~ |
|
Translations touched: de (186), es (186), fr (186), id (186), it (186), ja (186), ko (187), pl (186), pt (186), ru (186), th (186), tr (186), vi (186), zh-CN (186), zh-TW (186)
Assets 136
Code 593 changes in 199 classes
Minified client code with short names blanked for diffing. Class names are real.
- AttendanceAutoTrigger 39540
- Encoder 23626
- Headers 17317
- FederatedEvent 15241
- StringSet 5671
- FrameLoopManager 3203
- LocalDataManager 2837
- Animation 1714
- SoundManager 794
- AgeRangeObjectAOS 393
- GuildRaidBookVO 378
- ProfileDecoManager 272
- GuildWarGuidePopup 185
- FireOrb1 114
- TribeBanner 105
- ProfilePopup 105
- (module) 104
- HeroAutoController 99
- PodiumColumn 95
- GameOverPopup 91
- MailLoading 78
- DescBox 64
- GuildShopItemRenderer 63
- FriendService 58
- GuildWarBattleController 53
- CastleAutoController 48
- CheckBox 47
- Timer 33
- URLManager 32
- FriendManager 25
- LanguageManager 23
- ShortcutManager 21
- RightMenu 21
- RankProfile 18
- DetailPopupLayer 16
- RankBadge 16
- AutoRebirthGuidePopup 16
- RebirthResultPopup 14
- GuildManager 13
- ActiveSkillDamageHelper 13
- RightBottomMenus 13
- HeroHireSubMenu 12
- BasePopup 11
- InAppPurchaseManager 11
- SoundOptionButton 11
- PVPRankItemRenderer 10
- GuildShopSubView 10
- HeroSubMenu 9
- PowerSaveManager 9
- ActiveSkillMain 8
- SpiritLandDataManager 7
- HeroMassiveBuyPopup 7
- CardEventDataManager 7
- PetDetailPopup 7
- RankingItemRenderer 7
- ConfigManager 6
- AttestManager 6
- Profile 6
- GoogleAuthManager 6
- ChatOverlay 6
- HeroMassiveBuyResultPopup 6
- HeroSubView 6
- HeroDetailPopup 6
- PVPBattleSubView 6
- GuildWarMainView 6
- RankingPopup 6
- TutorialController 6
- CastleUpgradeItemRenderer 6
- BattleController 6
- PetDataManager 5
- ActiveSkillButton 5
- BattleAutoController 5
- RunInfoPopup 5
- ShopView 5
- GuildBuildingItemRenderer 5
- GuildRaidBattleReadyPopup 5
- GuildRaidPopup 5
- TopMenu 5
- PetAwakeningEffects 4
- MiniAscentService 4
- EventDataManager 4
- AppsFlyerBridge 4
- RewardItem 4
- ShopPaySubView 4
- PVPOpponentItemRenderer 4
- MineMain 4
- AchievementPopup 4
- GuildWarPopup 4
- AttendanceDataManager 3
- MiniGameService 3
- SystemErrorPopup 3
- BaseGuidePopup 3
- SoulRestActivePopup 3
- BomberBigBombExplode1 3
- WalletPopup 3
- ShopProductPopupWithTimer 3
- FavoritePetSubMenu 3
- MailDetailPopup 3
- DailyQuestPopup 3
- GuildMainSubView 3
- AttendancePopup 3
- SettingEtcInfo 3
- VersionManager 2
- UnitDataManager 2
- HeroUniqueSkillDataManager 2
- BaseService 2
- AccountService 2
- GuildService 2
- GuildWarBuffSource 2
- GameSpeedMode 2
- GuildBarracksDataManager 2
- IconOnlyButton 2
- ResourceInfo 2
- SubscriptionPurchaseManager 2
- ShopPayItemRenderer 2
- GuideBubble 2
- HelpDetailPopup 2
- ShopPayItemRendererStage 2
- WaveCallInfo 2
- SpriteLandSubMenu 2
- TowerSimulationPopup 2
- MineRewardInfoPopup 2
- TreasureTransSubView 2
- EmblemBadge 2
- GuildRaidSubMenu 2
- GuildWarTournament2Popup 2
- SettingContent 2
- NpcDialogueToast 2
- SecretaryPopup 2
- CitadelBuildingDetailPopup 2
- BattleManager 2
- ReviveTreasureBanner 2
- AssetPathManager 1
- TreasureDataManager 1
- TreasureSetDataManager 1
- Base64Util 1
- RequestManager 1
- ShopService 1
- UserService 1
- DataManager 1
- EventBus 1
- CommonLabel 1
- GameUpdatePopup 1
- FireStormFx 1
- CommonIconLabel 1
- AutoTogglePill 1
- FireBird1 1
- FireSpirit1 1
- HeroUpgradeManager 1
- WalletSelectPopup 1
- PetSelectGuidePopup 1
- BaseShopProductPopup 1
- ShopItemRenderer 1
- MissionGuide 1
- ShopGemSubView 1
- HeroMultiLevelPopup 1
- TreasureTransItemRenderer 1
- TreasureTransResultPopup 1
- AttackEffectManager 1
- BattleSpeedHelper 1
- RaidResultPopup 1
- RaidHud 1
- BuffStatusPopup 1
- TowerReadyPopup 1
- DungeonCoreBuffPopup 1
- DungeonReadyPopup 1
- DungeonBattleController 1
- FavoritePetSubView 1
- PetSecretShopSubMenu 1
- PetShopSubMenu 1
- TreasureChest 1
- MineRewardPopup 1
- HeroPresetPart 1
- TreasureShopItemRenderer 1
- TreasureSubView 1
- TreasureTransDetailView 1
- HeroSelectGuidePopup 1
- MailItemRenderer 1
- MailPopup 1
- EventScheduleDetailPopup 1
- EventSchedulePopup 1
- GuildBarracksRaceView 1
- GuildBarracksTribeItemRenderer 1
- GuildGiftSubView 1
- GuildRaidSubView 1
- GuildWarHistoryItemRenderer 1
- GuildWarTournamentRewardGuidePopup 1
- RankingDataManager 1
- RankingVO 1
- UserRankVO 1
- RankingUserTeamPopup 1
- LanguageChangePopup 1
- QuizRouletteManager 1
- RouletteSubView 1
- ReviveTeamBanner 1
- AdsRewardPopup 1
- ElfSecretSkillToast 1
- IntroOverlay 1
- IntroView 1
AttendanceAutoTrigger 1 hunks, 39540 statements
- Qt($pi,"AttendanceAutoTrigger"),Zt($pi,"_instance"),Zt($pi,"UNLOCK_REVIVE30",3),Zt($pi,"RETRY_BLOCKED_MS",5e3); - let Hpi=$pi; - const Wpi=Object.freeze(Object.defineProperty({ - __proto__:null,AttendanceAutoTrigger:Hpi} - ,Symbol.toStringTag,{ - value:"Module"} - )),Vpi=class{ - constructor(){ - Zt(this,"level",1),Zt(this,"clearC",0),Zt(this,"clearB",0),Zt(this,"clearA",0),Zt(this,"clearS",0),Zt(this,"reqC",0),Zt(this,"reqB",0),Zt(this,"reqA",0),Zt(this,"reqS",0),Zt(this,"win",0),Zt(this,"lose",0),Zt(this,"plusC",0),Zt(this,"plusB",0),Zt(this,"plusA",0),Zt(this,"plusS",0)} - getClearScore(t){ - switch(t){ - case"s":return this.clearS; - case"a":return this.clearA; - case"b":return this.clearB; - case"c":return this.clearC} - } - getReqScore(t){ - switch(t){ - case"s":return this.reqS; - case"a":return this.reqA; - case"b":return this.reqB; - case"c":return this.reqC} - } - getKillScore(t){ - return"WIN"===t?this.win:this.lose} - getPlusLevel(t){ - switch(t){ - case"s":return this.plusS; - case"a":return this.plusA; - case"b":return this.plusB; - case"c":return this.plusC} - } - } - ; - Qt(Vpi,"GuildWarConfigVO"); - let jpi=Vpi; - const Kpi=class t{ - constructor(){ - Zt(this,"list",[]),Zt(this,"byLevel",new Map),Zt(this,"maxLevel",1)} - static getInstance(){ - return this.instance||(this.instance=new t),this.instance} - async ensureLoaded(){ - if(this.list.length>0)return; - await TD.getInstance().loadBook(AD.GUILD_WAR_CONFIG); - const t=TD.getInstance().getBook(AD.GUILD_WAR_CONFIG); - this.setBookData(t)} - setBookData(t){ - if(this.list=[],this.byLevel.clear(),this.maxLevel=1,Array.isArray(t)){ - for(const i of t){ - const t=new jpi; - t.level=Number(i.level)||1,t.clearC=Number(i.clearC)||0,t.clearB=Number(i.clearB)||0,t.clearA=Number(i.clearA)||0,t.clearS=Number(i.clearS)||0,t.reqC=Number(i.reqC)||0,t.reqB=Number(i.reqB)||0,t.reqA=Number(i.reqA)||0,t.reqS=Number(i.reqS)||0,t.win=Number(i.win)||0,t.lose=Number(i.lose)||0,t.plusC=Number(i.plusC)||0,t.plusB=Number(i.plusB)||0,t.plusA=Number(i.plusA)||0,t.plusS=Number(i.plusS)||0,this.list.push(t),this.byLevel.set(t.level,t),t.level>this.maxLevel&&(this.maxLevel=t.level)} - this.list.sort((t,i)=>t.level-i.level)} - } - hasBook(){ - return this.list.length>0} - getByPhase(t){ - const i=this.byLevel.get(t); - if(i)return i; - if(t>this.maxLevel){ - const t=this.byLevel.get(this.maxLevel); - if(t)return t} - return this.byLevel.get(1)||new jpi} - } - ; - Qt(Kpi,"GuildWarConfigDataManager"),Zt(Kpi,"instance"); - let zpi=Kpi; - const Ypi=["s","a1","a2","a3","a4","b1","b2","b3","b4","c1","c2","c3","c4","c5","c6","c7","c8"],qpi={ - s:"s",a1:"a",a2:"a",a3:"a",a4:"a",b1:"b",b2:"b",b3:"b",b4:"b",c1:"c",c2:"c",c3:"c",c4:"c",c5:"c",c6:"c",c7:"c",c8:"c"} - ,Xpi={ - s:["a1","a2","a3","a4"],a1:["s","b1","b2"],a2:["s","b2","b3"],a3:["s","b3","b4"],a4:["s","b1","b4"],b1:["a1","a4","c1","c8"],b2:["a1","a2","c2","c3"],b3:["a2","a3","c4","c5"],b4:["a3","a4","c6","c7"],c1:["b1"],c2:["b2"],c3:["b2"],c4:["b3"],c5:["b3"],c6:["b4"],c7:["b4"],c8:["b1"]} - ,Jpi={ - c5:{ - x:170,y:50,r:31} - ,c6:{ - x:391,y:52,r:32} - ,c4:{ - x:79,y:141,r:31} - ,c7:{ - x:481,y:141,r:31} - ,c3:{ - x:79,y:361,r:31} - ,c8:{ - x:481,y:361,r:31} - ,c2:{ - x:170,y:451,r:31} - ,c1:{ - x:391,y:450,r:32} - ,b3:{ - x:168,y:141,r:32} - ,b4:{ - x:390,y:140,r:31} - ,b2:{ - x:169,y:361,r:30} - ,b1:{ - x:391,y:361,r:34} - ,a3:{ - x:280,y:141,r:39} - ,a2:{ - x:171,y:251,r:40} - ,a4:{ - x:392,y:250,r:40} - ,a1:{ - x:281,y:361,r:41} - ,s:{ - x:279,y:251,r:44} - } - ,Qpi=Math.round(536.1702127659574),Zpi={ - s:["s"],a:["a1","a2","a3","a4"],b:["b1","b2","b3","b4"],c:["c1","c2","c3","c4","c5","c6","c7","c8"]} - ,twi=["s","a","b","c"],iwi=[16724787,3377407,4513262,3399014,16766720,16750899,11163135,16737996]; - function swi(t,i){ - const s=t.length/2; - if(s<=2)return t; - const e=new Array(s).fill(!1); - e[0]=!0,e[s-1]=!0,ewi(t,0,s-1,i,e); - const n=[]; - for(let h=0; - h<s; - h++)e[h]&&n.push(t[2*h],t[2*h+1]); - return n} - function ewi(t,i,s,e,n){ - if(s-i<2)return; - const h=t[2*i],r=t[2*i+1],o=t[2*s],a=t[2*s+1]; - let c=0,l=-1; - for(let u=i+1; - u<s; - u++){ - const i=nwi(t[2*u],t[2*u+1],h,r,o,a); - i>c&&(c=i,l=u)} - c>e&&l>0&&(n[l]=!0,ewi(t,i,l,e,n),ewi(t,l,s,e,n))} - function nwi(t,i,s,e,n,h){ - const r=n-s,o=h-e,a=r*r+o*o; - if(0===a)return Math.hypot(t-s,i-e); - let c=((t-s)*r+(i-e)*o)/a; - c=Math.max(0,Math.min(1,c)); - const l=s+c*r,u=e+c*o; - return Math.hypot(t-l,i-u)} - Qt(swi,"douglasPeucker"),Qt(ewi,"dpStep"),Qt(nwi,"perpDist"); - const hwi=class extends Ke{ - constructor(t,i){ - super(),Zt(this,"active",!1),Zt(this,"strokes",[]),Zt(this,"strokeGraphics",new Map),Zt(this,"strokeLayer",new Ke),Zt(this,"preview",new ep),Zt(this,"currentTool","pen"),Zt(this,"currentColor",iwi[0]),Zt(this,"isDrawing",!1),Zt(this,"currentPoints",[]),Zt(this,"dragStart",null),Zt(this,"dragEnd",null),Zt(this,"myUid",""),Zt(this,"myName",""),Zt(this,"myRole",null),Zt(this,"onStrokeFinalized",null),Zt(this,"onStrokeErased",null),Zt(this,"onEraseDenied",null),Zt(this,"onDown",Qt(t=>{ - if(!this.active)return; - if(!this.myUid||!this.myRole)return; - const i=this.toLocal(t.global); - return"eraser"===this.currentTool?(this.tryEraseAt(i.x,i.y),void(this.isDrawing=!0)):"pen"===this.currentTool?(this.isDrawing=!0,this.currentPoints=[i.x,i.y],void this.preview.clear()):void("circle"!==this.currentTool&&"rect"!==this.currentTool||(this.isDrawing=!0,this.dragStart={ - x:i.x,y:i.y} - ,this.dragEnd={ - x:i.x,y:i.y} - ,this.preview.clear()))} - ,"onDown")),Zt(this,"onMove",Qt(t=>{ - if(!this.active||!this.isDrawing)return; - const i=this.toLocal(t.global); - if("eraser"!==this.currentTool){ - if("pen"===this.currentTool){ - const t=this.currentPoints.length,s=this.currentPoints[t-2],e=this.currentPoints[t-1],n=i.x-s,h=i.y-e; - if(n*n+h*h<.25)return; - return this.currentPoints.push(i.x,i.y),void this.drawPreviewPen()} - if("circle"===this.currentTool)return this.dragEnd={ - x:i.x,y:i.y} - ,void this.drawPreviewCircle(); - "rect"===this.currentTool&&(this.dragEnd={ - x:i.x,y:i.y} - ,this.drawPreviewRect())} - else this.tryEraseAt(i.x,i.y)} - ,"onMove")),Zt(this,"onUp",Qt(t=>{ - if(this.active&&this.isDrawing&&(this.isDrawing=!1,"eraser"!==this.currentTool)){ - if("pen"===this.currentTool){ - this.preview.clear(); - const t=swi(this.currentPoints,1.5); - if(this.currentPoints=[],t.length<4)return; - const i={ - id:this.makeStrokeId(),authorUid:this.myUid,authorName:this.myName,authorRole:this.myRole,color:this.currentColor,createdAt:Date.now(),type:"pen",points:t} - ; - return void this.tryFinalize(i)} - if("circle"===this.currentTool){ - if(this.preview.clear(),!this.dragStart||!this.dragEnd)return; - const t=this.dragEnd.x-this.dragStart.x,i=this.dragEnd.y-this.dragStart.y,s=Math.hypot(t,i)/2,e=(this.dragStart.x+this.dragEnd.x)/2,n=(this.dragStart.y+this.dragEnd.y)/2; - this.dragStart=null,this.dragEnd=null; - const h=this.clampCircleRadius(e,n,s); - if(h<5)return; - const r={ - id:this.makeStrokeId(),authorUid:this.myUid,authorName:this.myName,authorRole:this.myRole,color:this.currentColor,createdAt:Date.now(),type:"circle",cx:e,cy:n,r:h} - ; - return void this.tryFinalize(r)} - if("rect"===this.currentTool){ - if(this.preview.clear(),!this.dragStart||!this.dragEnd)return; - const t=Math.min(this.dragStart.x,this.dragEnd.x),i=Math.min(this.dragStart.y,this.dragEnd.y),s=Math.abs(this.dragEnd.x-this.dragStart.x),e=Math.abs(this.dragEnd.y-this.dragStart.y); - if(this.dragStart=null,this.dragEnd=null,s<6||e<6)return; - const n={ - id:this.makeStrokeId(),authorUid:this.myUid,authorName:this.myName,authorRole:this.myRole,color:this.currentColor,createdAt:Date.now(),type:"rect",x:t,y:i,w:s,h:e} - ; - this.tryFinalize(n)} - } - } - ,"onUp")),this.srcW=t,this.srcH=i; - const s=new ep; - s.rect(0,0,t,i).fill({ - color:0,alpha:1e-4} - ),this.addChild(s),this.addChild(this.strokeLayer),this.addChild(this.preview),this.eventMode="none",this.hitArea=new $i(0,0,t,i),this.on("pointerdown",this.onDown),this.on("pointermove",this.onMove),this.on("pointerup",this.onUp),this.on("pointerupoutside",this.onUp)} - setIdentity(t,i,s){ - this.myUid=t,this.myName=i,this.myRole=s} - setActive(t){ - this.active!==t&&(this.active=t,this.eventMode=t?"static":"none",t||this.cancelInProgressStroke())} - isActive(){ - return this.active} - setStrokesVisible(t){ - this.strokeLayer.visible=t,this.preview.visible=t} - setTool(t){ - this.currentTool!==t&&(this.cancelInProgressStroke(),this.currentTool=t)} - setColor(t){ - this.currentColor=t} - getTool(){ - return this.currentTool} - getColor(){ - return this.currentColor} - setStrokes(t){ - this.cancelInProgressStroke(),this.strokes=t.slice(),this.renderAll()} - getStrokes(){ - return this.strokes.slice()} - countStrokes(){ - return this.strokes.length} - undoMine(t){ - for(let i=this.strokes.length-1; - i>=0; - i--)if(this.strokes[i].authorUid===t){ - const t=this.strokes.splice(i,1)[0]; - return this.removeGraphic(t.id),this.onStrokeErased&&this.onStrokeErased(t),t} - return null} - removeStrokeById(t){ - const i=this.strokes.findIndex(i=>i.id===t); - return!(i<0||(this.strokes.splice(i,1),this.removeGraphic(t),0))} - replaceStrokeId(t,i){ - const s=this.strokes.find(i=>i.id===t); - if(!s)return!1; - s.id=i; - const e=this.strokeGraphics.get(t); - return e&&(this.strokeGraphics.delete(t),this.strokeGraphics.set(i,e)),!0} - clearMine(t){ - const i=[],s=[]; - for(const e of this.strokes)e.authorUid===t?s.push(e):i.push(e); - if(this.strokes=i,this.renderAll(),this.onStrokeErased)for(const e of s)this.onStrokeErased(e); - return s.length} - clearAll(){ - const t=this.strokes.slice(); - if(this.strokes=[],this.renderAll(),this.onStrokeErased)for(const i of t)this.onStrokeErased(i); - return t.length} - tryFinalize(t){ - (!this.onStrokeFinalized||this.onStrokeFinalized(t))&&(this.strokes.push(t),this.drawStrokeGraphic(t))} - cancelInProgressStroke(){ - this.isDrawing=!1,this.currentPoints=[],this.dragStart=null,this.dragEnd=null,this.preview.clear()} - tryEraseAt(t,i){ - for(let s=this.strokes.length-1; - s>=0; - s--){ - const e=this.strokes[s]; - if(!this.hitTestStroke(e,t,i))continue; - const n=e.authorUid===this.myUid,h="MASTER"===this.myRole; - if(!n&&!h)return void(this.onEraseDenied&&this.onEraseDenied()); - const r=this.strokes.splice(s,1)[0]; - return this.removeGraphic(r.id),void(this.onStrokeErased&&this.onStrokeErased(r))} - } - hitTestStroke(t,i,s){ - if("circle"===t.type){ - const e=Math.hypot(i-t.cx,s-t.cy); - return Math.abs(e-t.r)<=8} - if("rect"===t.type){ - const e=t.x+t.w,n=t.y+t.h,h=nwi(i,s,t.x,t.y,e,t.y),r=nwi(i,s,e,t.y,e,n),o=nwi(i,s,e,n,t.x,n),a=nwi(i,s,t.x,n,t.x,t.y); - return Math.min(h,r,o,a)<=8} - const e=t.points; - if(e.length<4)return!1; - for(let n=0; - n<e.length-2; - n+=2)if(nwi(i,s,e[n],e[n+1],e[n+2],e[n+3])<=8)return!0; - return!1} - renderAll(){ - for(const t of this.strokeGraphics.values())t.destroy(); - this.strokeGraphics.clear(),this.strokeLayer.removeChildren(); - for(const t of this.strokes)this.drawStrokeGraphic(t)} - drawStrokeGraphic(t){ - const i=new ep; - if("pen"===t.type){ - const s=t.points; - if(s.length>=4){ - i.moveTo(s[0],s[1]); - for(let t=2; - t<s.length; - t+=2)i.lineTo(s[t],s[t+1]); - i.stroke({ - width:3,color:t.color,alpha:.95,cap:"round",join:"round"} - )} - } - else"circle"===t.type?(i.circle(t.cx,t.cy,t.r),i.stroke({ - width:3,color:t.color,alpha:.95} - )):"rect"===t.type&&(i.rect(t.x,t.y,t.w,t.h),i.stroke({ - width:3,color:t.color,alpha:.95,join:"round"} - )); - this.strokeLayer.addChild(i),this.strokeGraphics.set(t.id,i)} - removeGraphic(t){ - const i=this.strokeGraphics.get(t); - i&&(i.destroy(),this.strokeGraphics.delete(t))} - drawPreviewPen(){ - this.preview.clear(); - const t=this.currentPoints; - if(!(t.length<4)){ - this.preview.moveTo(t[0],t[1]); - for(let i=2; - i<t.length; - i+=2)this.preview.lineTo(t[i],t[i+1]); - this.preview.stroke({ - width:3,color:this.currentColor,alpha:.95,cap:"round",join:"round"} - )} - } - drawPreviewCircle(){ - if(this.preview.clear(),!this.dragStart||!this.dragEnd)return; - const t=this.dragEnd.x-this.dragStart.x,i=this.dragEnd.y-this.dragStart.y,s=Math.hypot(t,i)/2; - if(s<1)return; - const e=(this.dragStart.x+this.dragEnd.x)/2,n=(this.dragStart.y+this.dragEnd.y)/2,h=this.clampCircleRadius(e,n,s); - h<1||(this.preview.circle(e,n,h),this.preview.stroke({ - width:3,color:this.currentColor,alpha:.8} - ))} - clampCircleRadius(t,i,s){ - const e=1.5,n=Math.min(t-e,this.srcW-t-e,i-e,this.srcH-i-e); - return!Number.isFinite(n)||n<=0?0:Math.min(s,n)} - drawPreviewRect(){ - if(this.preview.clear(),!this.dragStart||!this.dragEnd)return; - const t=Math.min(this.dragStart.x,this.dragEnd.x),i=Math.min(this.dragStart.y,this.dragEnd.y),s=Math.abs(this.dragEnd.x-this.dragStart.x),e=Math.abs(this.dragEnd.y-this.dragStart.y); - s<1||e<1||(this.preview.rect(t,i,s,e),this.preview.stroke({ - width:3,color:this.currentColor,alpha:.8,join:"round"} - ))} - makeStrokeId(){ - return`${ - Date.now().toString(36)} - ${ - Math.random().toString(36).slice(2,8)} - `} - } - ; - Qt(hwi,"GuildWarStrategyCanvas"); - let rwi=hwi; - const owi=class t extends kx{ - constructor(){ - super(),Zt(this,"bg"),Zt(this,"lblSlotNo"),Zt(this,"lblName"),Zt(this,"lblBonus"),Zt(this,"lblStatus"),Zt(this,"lblProtect"),Zt(this,"lblProtectTime"),Zt(this,"lblInBattle"),Zt(this,"heroIcons",[]),Zt(this,"btnAttack"),this.bg=new hE({ - texture:RS.getTexture("UI_Ekkorr","Popup_List_02"),leftWidth:140,topHeight:30,rightWidth:20,bottomHeight:30} - ),this.bg.width=t.BG_W,this.bg.height=t.ROW_H,this.addChild(this.bg),this.lblSlotNo=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_OUTLINE_FONT_OPTION_24),this.lblSlotNo.textColor=hD.DEFAULT_COLOR,this.addChild(this.lblSlotNo),this.lblName=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_OUTLINE_FONT_OPTION_16),this.lblName.x=t.NAME_X,this.lblName.y=t.LINE1_Y,this.addChild(this.lblName),this.lblBonus=new iG("",16733525,hD.DEFAULT_OUTLINE_FONT_OPTION_16),this.lblBonus.textColor=16733525,this.lblBonus.y=t.LINE1_Y,this.lblBonus.visible=!1,this.addChild(this.lblBonus),this.lblStatus=new iG("",t.STATUS_COLOR_ALIVE,hD.DEFAULT_OUTLINE_FONT_OPTION_24),this.addChild(this.lblStatus),this.lblProtect=new iG(NB.getText("GAME_1146","보호중"),t.PROTECT_COLOR,hD.DEFAULT_OUTLINE_FONT_OPTION_16),this.lblProtect.visible=!1,this.addChild(this.lblProtect),this.lblProtectTime=new iG("",t.PROTECT_COLOR,hD.DEFAULT_OUTLINE_FONT_OPTION_16),this.lblProtectTime.visible=!1,this.addChild(this.lblProtectTime),this.lblInBattle=new iG(NB.getText("GAME_1145","전투중"),t.IN_BATTLE_COLOR,hD.DEFAULT_OUTLINE_FONT_OPTION_16),this.lblInBattle.textColor=t.IN_BATTLE_COLOR,this.lblInBattle.visible=!1,this.addChild(this.lblInBattle); - for(let i=0; - i<5; - i++){ - const s=new c4; - s.scale.set(t.ICON_SCALE),s.hideLevel(),s.hideEnhance(),s.x=t.ICON_X0+i*t.ICON_GAP,s.y=t.LINE2_Y,this.addChild(s),this.heroIcons.push(s)} - this.btnAttack=new nB(NB.getText("GAME_1040","공격")),this.btnAttack.color=nB.RED,this.btnAttack.width=t.BTN_W,this.btnAttack.height=t.BTN_H,this.btnAttack.x=t.BTN_X,this.btnAttack.y=t.BTN_Y,this.btnAttack.onClick=()=>this.onAttack(),this.btnAttack.visible=!1,this.addChild(this.btnAttack)} - setData(i){ - this.data=i,this.lblSlotNo.text=`${ - i.displayNo} - `,this.lblSlotNo.x=(t.SLOT_NO_W-this.lblSlotNo.width)/2,this.lblSlotNo.y=(t.ROW_H-this.lblSlotNo.height)/2,this.lblName.text=`${ - i.userName} - (Lv.${ - i.knightLevel} - )`; - const s=i.heroLevelBonus??0; - s>0?(this.lblBonus.text=` +${ - s} - Lv`,this.lblBonus.visible=!0,this.lblBonus.x=this.lblName.x+this.lblName.width):this.lblBonus.visible=!1; - const e="DESTROYED"===i.status,n="opp"===i.side; - this.lblName.textColor=e?t.NAME_COLOR_DEAD:t.NAME_COLOR_ALIVE; - const h=this.parseSquadHeroes(i.squads); - for(let t=0; - t<5; - t++){ - const i=h[t],s=this.heroIcons[t]; - if(i&&i.heroKindNum>0)try{ - s.setDataWithKindNum(i.heroKindNum,i.trans),s.showIcon()} - catch{ - s.hideIcon()} - else s.hideIcon(); - s.active=!e} - this.lblStatus.text=e?"X":"O",this.lblStatus.textColor=e?t.STATUS_COLOR_DEAD:t.STATUS_COLOR_ALIVE,this.lblStatus.x=t.STATUS_CENTER_X-this.lblStatus.width/2,this.lblStatus.y=(t.ROW_H-this.lblStatus.height)/2; - const r=this.isProtected(i),o=!!i.inBattle&&!e&&!r,a=!t.readonlyMode&&n&&!e&&!r&&!o; - if(this.btnAttack.visible=a,this.lblStatus.visible=!a&&!r&&!o,this.lblProtect.visible=r,this.lblProtectTime.visible=r,this.lblInBattle.visible=o,o&&(this.lblInBattle.x=t.STATUS_CENTER_X-this.lblInBattle.width/2,this.lblInBattle.y=(t.ROW_H-this.lblInBattle.height)/2),r){ - this.lblProtectTime.text=this.formatRemain(i.protectedUntil); - const s=2,e=this.lblProtect.height+s+this.lblProtectTime.height,n=(t.ROW_H-e)/2; - this.lblProtect.x=t.STATUS_CENTER_X-this.lblProtect.width/2,this.lblProtect.y=n,this.lblProtectTime.x=t.STATUS_CENTER_X-this.lblProtectTime.width/2,this.lblProtectTime.y=n+this.lblProtect.height+s} - } - tickProtectTime(){ - const i=this.data; - i&&this.lblProtect.visible&&(this.isProtected(i)?(this.lblProtectTime.text=this.formatRemain(i.protectedUntil),this.lblProtectTime.x=t.STATUS_CENTER_X-this.lblProtectTime.width/2):this.setData(i))} - isProtected(t){ - if("PROTECTED"!==t.status)return!1; - if(!t.protectedUntil)return!1; - const i=new Date(t.protectedUntil).getTime(); - return Number.isFinite(i)&&i>Date.now()} - formatRemain(t){ - if(!t)return"0:00"; - const i=new Date(t).getTime()-Date.now(); - if(!Number.isFinite(i)||i<=0)return"0:00"; - const s=Math.floor(i/1e3); - return`${ - Math.floor(s/60)} - :${ - (s%60).toString().padStart(2,"0")} - `} - parseSquadHeroes(t){ - const i=[null,null,null,null,null]; - if(!t)return i; - const s=t.split("|"); - for(let e=0; - e<Math.min(5,s.length); - e++){ - const[t,n]=s[e].split("-").map(Number); - t>0&&(i[e]={ - heroKindNum:t,trans:n||0} - )} - return i} - onAttack(){ - t.onAttackClick&&this.data&&t.onAttackClick(this.data)} - clearCache(){ - } - } - ; - Qt(owi,"GuildWarBattleSlotItemRenderer"),Zt(owi,"onAttackClick",null),Zt(owi,"readonlyMode",!1),Zt(owi,"ROW_W",600),Zt(owi,"ROW_H",77),Zt(owi,"BG_W",600),Zt(owi,"LINE1_Y",6),Zt(owi,"LINE2_Y",31),Zt(owi,"SLOT_NO_W",125),Zt(owi,"NAME_X",135),Zt(owi,"ICON_X0",135),Zt(owi,"ICON_GAP",65),Zt(owi,"ICON_SCALE",.503),Zt(owi,"BTN_W",90),Zt(owi,"BTN_H",46),Zt(owi,"BTN_RIGHT_PAD",12),Zt(owi,"BTN_X",owi.BG_W-owi.BTN_W-owi.BTN_RIGHT_PAD),Zt(owi,"BTN_Y",(owi.ROW_H-owi.BTN_H)/2),Zt(owi,"STATUS_CENTER_X",owi.BTN_X+owi.BTN_W/2),Zt(owi,"NAME_COLOR_ALIVE",hD.DEFAULT_COLOR),Zt(owi,"NAME_COLOR_DEAD",8947848),Zt(owi,"STATUS_COLOR_ALIVE",6750088),Zt(owi,"STATUS_COLOR_DEAD",16742246),Zt(owi,"PROTECT_COLOR",8965375),Zt(owi,"IN_BATTLE_COLOR",16759620); - let awi=owi; - const cwi=class t extends kx{ - constructor(){ - super(),Zt(this,"lblLeftName"),Zt(this,"lblArrow"),Zt(this,"lblRightName"),Zt(this,"lblCastle"),Zt(this,"lblResult"),Zt(this,"lblTime"),this.lblLeftName=this.makeLabel("",t.COLOR_TEXT),this.addChild(this.lblLeftName),this.lblArrow=this.makeLabel("→",11184810),this.addChild(this.lblArrow),this.lblRightName=this.makeLabel("",t.COLOR_TEXT),this.addChild(this.lblRightName),this.lblCastle=this.makeLabel("",t.COLOR_TEXT),this.addChild(this.lblCastle),this.lblResult=this.makeLabel("",t.COLOR_TEXT),this.addChild(this.lblResult),this.lblTime=this.makeLabel("",t.COLOR_TIME),this.addChild(this.lblTime)} - setData(i){ - this.data=i; - const s=(t.ROW_H-this.lblArrow.height)/2; - this.lblLeftName.text=this.truncate(i.leftName),this.lblLeftName.textColor=i.leftIsAlly?t.COLOR_ALLY:t.COLOR_OPP,this.lblLeftName.x=t.COL_LEFT_NAME_X,this.lblLeftName.y=s,this.lblArrow.x=t.COL_ARROW_CX-this.lblArrow.width/2,this.lblArrow.y=s,this.lblRightName.text=this.truncate(i.rightName),this.lblRightName.textColor=i.rightIsAlly?t.COLOR_ALLY:t.COLOR_OPP,this.lblRightName.x=t.COL_RIGHT_NAME_X,this.lblRightName.y=s,this.lblCastle.text=i.castleLabel,this.lblCastle.textColor=t.COLOR_TEXT,this.lblCastle.x=t.COL_CASTLE_CX-this.lblCastle.width/2,this.lblCastle.y=s,this.lblResult.text=i.resultLabel,this.lblResult.textColor=i.resultGood?t.COLOR_GOOD:t.COLOR_BAD,this.lblResult.x=t.COL_RESULT_CX-this.lblResult.width/2,this.lblResult.y=s,this.lblTime.text=i.timeLabel,this.lblTime.x=t.COL_TIME_CX-this.lblTime.width/2,this.lblTime.y=s} - truncate(i){ - const s=t.NAME_MAX_CHARS; - return i.length>s?`${ - i.substring(0,s-3)} - ...`:i} - makeLabel(t,i){ - const s=new iG(t,i,{ - ...hD.DEFAULT_FONT_OPTION_15,fontSize:14} - ); - return s.textColor=i,s} - async onClick(t,i){ - } - get height(){ - return t.ROW_H} - clearCache(){ - } - } - ; - Qt(cwi,"GuildWarCombatLogItemRenderer"),Zt(cwi,"ROW_H",28),Zt(cwi,"COL_LEFT_NAME_X",14),Zt(cwi,"COL_ARROW_CX",175),Zt(cwi,"COL_RIGHT_NAME_X",200),Zt(cwi,"COL_CASTLE_CX",380),Zt(cwi,"COL_RESULT_CX",460),Zt(cwi,"COL_TIME_CX",555),Zt(cwi,"NAME_MAX_CHARS",12),Zt(cwi,"COLOR_ALLY",6750088),Zt(cwi,"COLOR_OPP",16742246),Zt(cwi,"COLOR_TEXT",hD.DEFAULT_COLOR),Zt(cwi,"COLOR_TIME",8947848),Zt(cwi,"COLOR_GOOD",6750088),Zt(cwi,"COLOR_BAD",16742246); - let lwi=cwi; - const uwi="ef2.gw.strategy.color.",dwi="ef2.gw.strategy.show."; - function fwi(t){ - if("string"!=typeof t||0===t.length)return!1; - const i=t.split("|"); - if(5!==i.length)return!1; - let s=0; - for(const e of i){ - const t=e.split("-").map(Number); - if(3!==t.length||t.some(t=>!Number.isFinite(t)))return!1; - const[i,,n]=t; - if(0!==i||0!==n){ - if(i<=0)return!1; - if(0!==n&&(n<1||n>16))return!1; - s++} - } - return s>0} - Qt(fwi,"isValidAttackSquads"); - const pwi=Object.fromEntries(Object.entries({ - s:1,a1:2,a2:3,a3:4,a4:5,b1:6,b2:7,b3:8,b4:9,c1:10,c2:11,c3:12,c4:13,c5:14,c6:15,c7:16,c8:17} - ).map(([t,i])=>[i,t])),wwi={ - a1:3,a2:4,a3:1,a4:2,b1:1,b2:2,b3:3,b4:4,c1:2,c2:3,c3:1,c4:4,c5:2,c6:3,c7:1,c8:4} - ; - function gwi(t){ - return"s"===t?Math.floor(4*Math.random())+1:wwi[t]} - Qt(gwi,"pickMapIndexForCastle"); - const mwi=class t extends kx{ - constructor(){ - super(),Zt(this,"lblName"),Zt(this,"lblTicket"),Zt(this,"lblAttack1"),Zt(this,"lblAttack2"),this.lblName=this.makeLabel("",t.COLOR_TEXT),this.addChild(this.lblName),this.lblTicket=this.makeLabel("",t.COLOR_TEXT),this.addChild(this.lblTicket),this.lblAttack1=this.makeLabel("",t.COLOR_MUTED),this.addChild(this.lblAttack1),this.lblAttack2=this.makeLabel("",t.COLOR_MUTED),this.addChild(this.lblAttack2)} - setData(i){ - this.data=i; - const s=(t.ROW_H-this.lblName.height)/2; - this.lblName.text=i.nameLabel,this.lblName.textColor=t.COLOR_TEXT,this.lblName.x=t.COL_NAME_X,this.lblName.y=s,this.lblTicket.text=String(i.remainingTickets),this.lblTicket.textColor=i.remainingTickets>0?t.COLOR_WIN:t.COLOR_MUTED,this.lblTicket.x=t.COL_TICKET_CX-this.lblTicket.width/2,this.lblTicket.y=s,this.setAttackLabel(this.lblAttack1,i.attack1),this.lblAttack1.x=t.COL_ATTACK1_CX-this.lblAttack1.width/2,this.lblAttack1.y=s,this.setAttackLabel(this.lblAttack2,i.attack2),this.lblAttack2.x=t.COL_ATTACK2_CX-this.lblAttack2.width/2,this.lblAttack2.y=s} - setAttackLabel(i,s){ - i.text=s.label,i.textColor="WIN"===s.result?t.COLOR_WIN:"LOSE"===s.result?t.COLOR_LOSE:t.COLOR_MUTED} - makeLabel(t,i){ - const s=new iG(t,i,{ - ...hD.DEFAULT_FONT_OPTION_15,fontSize:14} - ); - return s.textColor=i,s} - async onClick(t,i){ - } - get height(){ - return t.ROW_H} - clearCache(){ - } - } - ; - Qt(mwi,"GuildWarMemberStatusItemRenderer"),Zt(mwi,"ROW_H",30),Zt(mwi,"COL_NAME_X",8),Zt(mwi,"COL_TICKET_CX",190),Zt(mwi,"COL_ATTACK1_CX",345),Zt(mwi,"COL_ATTACK2_CX",515),Zt(mwi,"COLOR_TEXT",hD.DEFAULT_COLOR),Zt(mwi,"COLOR_MUTED",8947848),Zt(mwi,"COLOR_WIN",6750088),Zt(mwi,"COLOR_LOSE",16742246); - let vwi=mwi; - const _wi=class t extends kx{ - constructor(){ - super(),Zt(this,"lblName"),Zt(this,"lblCastle"),Zt(this,"lblMarker"),Zt(this,"markerLabels",[]),Zt(this,"gvo"),this.lblName=this.makeLabel("",t.COLOR_TEXT),this.addChild(this.lblName),this.lblCastle=this.makeLabel("",t.COLOR_TEXT),this.addChild(this.lblCastle),this.lblMarker=this.makeLabel("",t.COLOR_MUTED),this.addChild(this.lblMarker); - for(let i=0; - i<t.MARKER_OPTIONS.length; - i++){ - const i=this.makeLabel("",t.COLOR_MUTED); - this.addChild(i),this.markerLabels.push(i)} - } - setData(i){ - this.data=i,this.gvo=i; - const s=(t.ROW_H-this.lblName.height)/2; - this.lblName.text=i.nameLabel,this.lblName.textColor=t.COLOR_TEXT,this.lblName.x=t.COL_NAME_X,this.lblName.y=s,this.lblCastle.text=i.castleLabel,this.lblCastle.textColor=t.COLOR_TEXT,this.lblCastle.x=t.COL_CASTLE_CX-this.lblCastle.width/2,this.lblCastle.y=s,this.lblMarker.text=null==i.marker?"-":String(i.marker),this.lblMarker.textColor=null==i.marker?t.COLOR_MUTED:t.COLOR_SELECTED,this.lblMarker.x=t.COL_MARKER_CX-this.lblMarker.width/2,this.lblMarker.y=s,this.lblMarker.visible=!i.editable; - for(let e=0; - e<t.MARKER_OPTIONS.length; - e++){ - const n=t.MARKER_OPTIONS[e],h=this.markerLabels[e],r=i.marker===n; - h.visible=i.editable,h.text=null==n?"[-]":`[${ - n} - ]`,h.textColor=r?t.COLOR_SELECTED:i.editable?t.COLOR_MUTED:t.COLOR_DISABLED; - const o=t.COL_MARKER_START_X+e*(t.MARKER_W+t.MARKER_GAP); - h.x=o+(t.MARKER_W-h.width)/2,h.y=s} - } - onClick(i,s){ - if(!this.gvo)return; - if(!this.gvo.editable)return; - const e=t.COL_MARKER_START_X,n=t.MARKER_W+t.MARKER_GAP,h=Math.floor((i-e)/n); - if(h<0||h>=t.MARKER_OPTIONS.length)return; - const r=i-e-h*n; - if(r<0||r>t.MARKER_W)return; - const o=t.MARKER_OPTIONS[h]; - t.onMarkerClick&&t.onMarkerClick(this.gvo,o)} - makeLabel(t,i){ - const s=new iG(t,i,{ - ...hD.DEFAULT_FONT_OPTION_15,fontSize:14} - ); - return s.textColor=i,s} - get height(){ - return t.ROW_H} - clearCache(){ - } - } - ; - Qt(_wi,"GuildWarTargetMarkerItemRenderer"),Zt(_wi,"onMarkerClick",null),Zt(_wi,"ROW_H",32),Zt(_wi,"MARKER_OPTIONS",[null,1,2,3,4,5,6,7,8]),Zt(_wi,"COL_NAME_X",8),Zt(_wi,"COL_CASTLE_CX",190),Zt(_wi,"COL_MARKER_CX",315),Zt(_wi,"COL_MARKER_START_X",245),Zt(_wi,"MARKER_W",34),Zt(_wi,"MARKER_GAP",4),Zt(_wi,"COLOR_TEXT",hD.DEFAULT_COLOR),Zt(_wi,"COLOR_MUTED",8947848),Zt(_wi,"COLOR_SELECTED",16763904),Zt(_wi,"COLOR_DISABLED",6710886); - let Mwi=_wi; - const bwi=class t extends YXt{ - constructor(){ - super(),Zt(this,"headerBox",new Ke),Zt(this,"boardBox",new Ke),Zt(this,"bottomBox",new Ke),Zt(this,"firstLoaded",!1),Zt(this,"nodesBox",new Ke),Zt(this,"mapBg"),Zt(this,"lblTitle"),Zt(this,"lblScore"),Zt(this,"lblTickets"),Zt(this,"lblAttackBuff"),Zt(this,"btnAttackBuffGuide"),Zt(this,"attackBuffInfoBox",null),Zt(this,"buffBarFill"),Zt(this,"lblBuffBar"),Zt(this,"lblBuffCur"),Zt(this,"lblBuffNext"),Zt(this,"lblBuffNeed"),Zt(this,"castleInfoBox",null),Zt(this,"lblCiTitle"),Zt(this,"lblCiRemain"),Zt(this,"lblCiWinLabel"),Zt(this,"lblCiWinVal"),Zt(this,"lblCiClearLabel"),Zt(this,"lblCiClearVal"),Zt(this,"lblCiGainLabel"),Zt(this,"lblCiGainVal"),Zt(this,"lblCiScoreDelta"),Zt(this,"castleInfoDismissed",!1),Zt(this,"lastSeenBuffWarId",0),Zt(this,"lastSeenBuffLevel",-1),Zt(this,"btnRefresh"),Zt(this,"lblBoardStat"),Zt(this,"phaseTabsBox",new Ke),Zt(this,"btnSideOpp"),Zt(this,"btnSideMe"),Zt(this,"btnTabBattle"),Zt(this,"btnTabLog"),Zt(this,"btnTabList"),Zt(this,"btnTabTarget"),Zt(this,"btnTargetEdit"),Zt(this,"iconBottomClock"),Zt(this,"lblBottomEndsIn"),Zt(this,"viewMode","battle"),Zt(this,"bottomHeader"),Zt(this,"bottomMessage"),Zt(this,"slotsList"),Zt(this,"bottomGateLine"),Zt(this,"bottomDetailAdj"),Zt(this,"bottomDetailScore"),Zt(this,"combatLogList"),Zt(this,"memberStatusList"),Zt(this,"targetMarkerList"),Zt(this,"mockCombatLog",[]),Zt(this,"logColLeft"),Zt(this,"logColArrow"),Zt(this,"logColRight"),Zt(this,"logColCastle"),Zt(this,"logColResult"),Zt(this,"logColTime"),Zt(this,"memberColName"),Zt(this,"memberColTicket"),Zt(this,"memberColAttack1"),Zt(this,"memberColAttack2"),Zt(this,"targetColName"),Zt(this,"targetColCastle"),Zt(this,"targetColMarker"),Zt(this,"warId",0),Zt(this,"targetWarId",null),Zt(this,"targetWarStartAtMs",0),Zt(this,"info",null),Zt(this,"lastInfoFetchAt",0),Zt(this,"cachedMyTeamASquads",null),Zt(this,"readonlyMode",!1),Zt(this,"readonlyResult","WIN"),Zt(this,"readonlyOppName",""),Zt(this,"readonlyMyScore",0),Zt(this,"readonlyOppScore",0),Zt(this,"readonlyEndAtMs",0),Zt(this,"oppPhases",[]),Zt(this,"myPhases",[]),Zt(this,"oppViewPhase",1),Zt(this,"myViewPhase",1),Zt(this,"initialPhaseAutoApplied",!1),Zt(this,"side","opp"),Zt(this,"selected",null),Zt(this,"targetEditMode",!1),Zt(this,"pendingTargetMarkers",new Map),Zt(this,"showScores",!1),Zt(this,"showCastleNames",!1),Zt(this,"showStrategyStrokes",!0),Zt(this,"cbScore"),Zt(this,"cbCastleName"),Zt(this,"cbStrategyShow"),Zt(this,"lblOptScore"),Zt(this,"lblOptName"),Zt(this,"lblOptStrategy"),Zt(this,"boardInner"),Zt(this,"strategyCanvas",null),Zt(this,"strategyMode",!1),Zt(this,"btnTabStrategy"),Zt(this,"strategyToolbarBox",new Ke),Zt(this,"strategyToolBtns",[]),Zt(this,"strategyColorSwatches",[]),Zt(this,"btnStrategyUndo"),Zt(this,"btnStrategyClearAll"),Zt(this,"btnStrategySave"),Zt(this,"myStrategyColor",iwi[0]),Zt(this,"protectTickHandle",null),Zt(this,"guild2HiddenByMe",!1),Zt(this,"guild2Ref",null),Zt(this,"isTournamentReadOnly",!1),Zt(this,"onHideHandler",null); - const i=Math.min(SS.safeHeight,1050); - this.bg.height=i,this.y=Math.max(0,SS.safeHeight-i),this.addChild(this.headerBox),this.addChild(this.boardBox),this.addChild(this.bottomBox),this.headerBox.y=40,this.boardBox.y=this.headerBox.y+t.HEADER_H+1,this.bottomBox.y=this.boardBox.y+Qpi+10,this.buildHeader(),this.buildBoard(),this.buildBottom(i),this.resetMockState()} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - async open(t,i){ - this.isTournamentReadOnly=!1,this.readonlyMode=!1,awi.readonlyMode=!1; - const s=this.targetWarId,e=this.targetWarStartAtMs; - this.targetWarId=t??null,this.targetWarStartAtMs=Number.isFinite(i)?i:null!=t&&t===s?e:0,this.selected=null,this.side="opp",this.viewMode="battle",this.btnTabBattle.selected=!0,this.btnTabLog.selected=!1,this.btnTabList.selected=!1,this.btnTabTarget.selected=!1,this.btnTabStrategy&&(this.btnTabStrategy.selected=!1),this.resetTargetEditState(),this.strategyMode=!1,this.myStrategyColor=this.loadMyStrategyColor(),this.showStrategyStrokes=this.loadStrategyShowPref(),this.cbStrategyShow&&(this.cbStrategyShow.selected=this.showStrategyStrokes),this.strategyCanvas&&this.strategyCanvas.setStrokesVisible(this.showStrategyStrokes),this.lastInfoFetchAt=0,await zpi.getInstance().ensureLoaded(),this.resetMockState(),this.firstLoaded||this.setContentVisible(!1),this.show2(),await this.hideGuild2IfVisible(),this.applyHeaderEmpty(),this.btnRefresh.visible=!0,this.refreshSideButtons(),this.renderBoard(),this.renderBottom(),this.applyStrategyMode(),this.refreshStrategyAvailability(),this.strategyCanvas&&(this.strategyCanvas.setColor(this.myStrategyColor),this.refreshStrategyColorSwatches()),this.startProtectTick(),await this.fetchHeaderInfo(!0)} - async hideGuild2IfVisible(){ - if(this.guild2HiddenByMe)return; - const{ - Guild2Popup:t} - =await ei(async()=>{ - const{ - Guild2Popup:t} - =await Promise.resolve().then(()=>ooi); - return{ - Guild2Popup:t} - } - ,void 0),i=t.getInstance(); - i.parent&&i.visible&&(i.visible=!1,this.guild2Ref=i,this.guild2HiddenByMe=!0,YXt.refreshDimVisibility())} - async openReadonly(t){ - this.isTournamentReadOnly=!1,this.readonlyMode=!0,awi.readonlyMode=!0,this.warId=t.warId,this.targetWarId=t.warId,this.targetWarStartAtMs=0,this.readonlyOppName=t.oppName,this.readonlyMyScore=t.myScore,this.readonlyOppScore=t.oppScore,this.readonlyEndAtMs=t.endAtMs,this.readonlyResult=t.result,this.selected=null,this.side="opp",this.viewMode="battle",this.btnTabBattle.selected=!0,await zpi.getInstance().ensureLoaded(),this.btnTabLog.selected=!1,this.btnTabList.selected=!1,this.btnTabTarget.selected=!1,this.btnTabStrategy&&(this.btnTabStrategy.selected=!1),this.resetTargetEditState(),this.strategyMode=!1,this.showStrategyStrokes=this.loadStrategyShowPref(),this.cbStrategyShow&&(this.cbStrategyShow.selected=this.showStrategyStrokes),this.strategyCanvas&&this.strategyCanvas.setStrokesVisible(this.showStrategyStrokes),this.resetMockState(),this.firstLoaded||this.setContentVisible(!1),this.show2(),await this.hideGuild2IfVisible(),this.btnRefresh.visible=!1,this.applyHeaderReadonly(),this.refreshSideButtons(),this.renderBoard(),this.renderBottom(),this.applyStrategyMode(),this.refreshStrategyAvailability(),this.startProtectTick(),await this.fetchHeaderInfo(!0)} - async openReadonlyTournament(t){ - this.isTournamentReadOnly=!0,this.readonlyMode=!0,awi.readonlyMode=!0,this.warId=t.warId,this.targetWarId=t.warId,this.targetWarStartAtMs=0,this.readonlyOppName=t.oppName,this.readonlyMyScore=t.myScore,this.readonlyOppScore=t.oppScore,this.readonlyEndAtMs=t.endAtMs,this.readonlyResult=t.result,this.selected=null,this.side="opp",this.viewMode="battle",this.btnTabBattle.selected=!0,await zpi.getInstance().ensureLoaded(),this.btnTabLog.selected=!1,this.btnTabList.selected=!1,this.btnTabTarget.selected=!1,this.btnTabStrategy&&(this.btnTabStrategy.selected=!1),this.resetTargetEditState(),this.strategyMode=!1,this.showStrategyStrokes=this.loadStrategyShowPref(),this.cbStrategyShow&&(this.cbStrategyShow.selected=this.showStrategyStrokes),this.strategyCanvas&&this.strategyCanvas.setStrokesVisible(this.showStrategyStrokes),this.resetMockState(),this.firstLoaded||this.setContentVisible(!1),this.show2(),await this.hideGuild2IfVisible(),this.btnRefresh.visible=!1,this.applyHeaderReadonly(),this.refreshSideButtons(),this.renderBoard(),this.renderBottom(),this.applyStrategyMode(),this.refreshStrategyAvailability(),this.startProtectTick(),await this.fetchHeaderInfo(!0,t.myGuildId)} - setContentVisible(t){ - this.headerBox.visible=t,this.boardBox.visible=t,this.bottomBox.visible=t} - startProtectTick(){ - null==this.protectTickHandle&&(this.protectTickHandle=setInterval(()=>{ - const t=this.slotsList.getItemList(); - for(let i=0; - i<t.length; - i++){ - const s=t[i]; - s&&"function"==typeof s.tickProtectTime&&s.tickProtectTime()} - this.refreshBottomEndsIn()} - ,1e3))} - stopProtectTick(){ - null!=this.protectTickHandle&&(clearInterval(this.protectTickHandle),this.protectTickHandle=null)} - buildHeader(){ - this.lblTitle=this.makeLabel("",16,hD.DEFAULT_COLOR),this.lblTitle.x=20,this.lblTitle.y=6,this.headerBox.addChild(this.lblTitle),this.lblScore=this.makeLabel("",18,16750899),this.lblScore.y=4,this.headerBox.addChild(this.lblScore); - const i=130; - this.btnSideMe=new Gqt(NB.getText("GAME_1042","우리 진영"),i),this.btnSideMe.autoResize=!1,this.btnSideMe.lbl.textSize=17,this.btnSideMe.width=i,this.btnSideMe.height=40,this.btnSideMe.x=t.W-i-10,this.btnSideMe.y=2,this.btnSideMe.onClick=()=>this.setSide("me"),this.headerBox.addChild(this.btnSideMe),this.btnSideOpp=new Gqt(NB.getText("GAME_1041","적 진영"),i),this.btnSideOpp.autoResize=!1,this.btnSideOpp.lbl.textSize=17,this.btnSideOpp.width=i,this.btnSideOpp.height=40,this.btnSideOpp.x=this.btnSideMe.x-i-3,this.btnSideOpp.y=2,this.btnSideOpp.onClick=()=>this.setSide("opp"),this.headerBox.addChild(this.btnSideOpp),this.btnRefresh=new Xe(RS.getTexture("UI_Ekkorr","Btn_Refresh_01")),this.btnRefresh.anchor.set(.5),this.btnRefresh.width=46,this.btnRefresh.height=46,this.btnRefresh.x=this.btnSideOpp.x-23-8+3,this.btnRefresh.y=25,this.btnRefresh.eventMode="static",this.btnRefresh.cursor="pointer",this.btnRefresh.on("pointertap",()=>this.onRefreshClick()),this.headerBox.addChild(this.btnRefresh),this.lblBoardStat=this.makeLabel("",13,16763904),this.lblBoardStat.x=20,this.lblBoardStat.y=29,this.headerBox.addChild(this.lblBoardStat),this.lblTickets=this.makeLabel("",13,11197951),this.lblAttackBuff=this.makeLabel("",13,16764006),this.lblAttackBuff.eventMode="static",this.lblAttackBuff.cursor="pointer",this.lblAttackBuff.on("pointertap",()=>this.toggleAttackBuffInfo()),this.btnAttackBuffGuide=new HU("UI_Ekkorr","UI_Alarm",.75),this.btnAttackBuffGuide.onClick=()=>this.toggleAttackBuffInfo(),this.btnAttackBuffGuide.visible=!1,this.btnSideOpp.selected=!0,this.btnSideMe.selected=!1} - applyHeaderEmpty(){ - this.lblTitle.text="",this.lblScore.text="",this.lblTickets.text="",this.lblAttackBuff.text="",this.btnAttackBuffGuide.visible=!1,this.hideAttackBuffInfo(),this.lblBoardStat.text="",this.iconBottomClock.visible=!1,this.lblBottomEndsIn.visible=!1} - applyHeaderReadonly(){ - let t="WIN"===this.readonlyResult?`[ ${ - NB.getText("GAME_1028","승리")} - ]`:"LOSE"===this.readonlyResult?`[ ${ - NB.getText("GAME_1029","패배")} - ]`:`[ ${ - NB.getText("GAME_1030","무승부")} - ]`; - const i="WIN"===this.readonlyResult?6750088:"LOSE"===this.readonlyResult?16742246:13421772; - "TBD"==this.readonlyResult&&(t=""),this.lblTitle.text=`vs ${ - this.readonlyOppName} - ${ - t} - `,this.lblTitle.textColor=i,this.lblScore.text=`( ${ - this.readonlyMyScore} - : ${ - this.readonlyOppScore} - )`,this.lblScore.textColor=16750899,this.lblScore.x=this.lblTitle.x+this.lblTitle.width+12,this.lblScore.y=6,this.lblTickets.text="",this.lblAttackBuff.text="",this.btnAttackBuffGuide.visible=!1,this.hideAttackBuffInfo(),this.refreshBoardStat(),this.iconBottomClock.visible=!1,this.lblBottomEndsIn.visible=!1} - applyHeader(){ - if(!this.info)return; - this.lblTitle.textColor=hD.DEFAULT_COLOR,this.lblTitle.text=`vs ${ - this.info.oppGuildName} - `,this.refreshScoreLabel(); - const t=Math.max(0,this.info.attacksMax-this.info.attacksUsed); - this.lblTickets.text=`${ - NB.getText("GAME_1043","공격권")} - ${ - t} - /${ - this.info.attacksMax} - `,this.lblTickets.textColor=11197951,this.lblTickets.x=622-this.lblTickets.width-12,this.refreshAttackBuffBadge(),this.refreshBoardStat(),this.refreshBottomEndsIn()} - refreshAttackBuffBadge(){ - var t,i; - const s=null==(t=this.info)?void 0:t.attackBuff; - if(!s||this.readonlyMode)return this.lblAttackBuff.text="",this.btnAttackBuffGuide.visible=!1,void this.hideAttackBuffInfo(); - const e=NB.getText("GAME_1645","공격버프"); - this.lblAttackBuff.text=`${ - e} - : +${ - s.level} - Lv`,this.btnAttackBuffGuide.visible=!0,this.btnAttackBuffGuide.x=610-this.btnAttackBuffGuide.width,this.btnAttackBuffGuide.y=this.lblAttackBuff.y+(this.lblAttackBuff.height-this.btnAttackBuffGuide.height)/2,this.lblAttackBuff.x=this.btnAttackBuffGuide.x-5-this.lblAttackBuff.width,this.lastSeenBuffWarId===this.info.warId&&this.lastSeenBuffLevel>=0&&s.level>this.lastSeenBuffLevel&&bH.getInstance().showMessage(`${ - NB.getText("GAME_1646","공격버프 상승!")} - +${ - s.level} - Lv`),this.lastSeenBuffWarId=this.info.warId,this.lastSeenBuffLevel=s.level,(null==(i=this.attackBuffInfoBox)?void 0:i.visible)&&this.refreshAttackBuffInfoBox()} - toggleAttackBuffInfo(){ - var t,i; - (null==(t=this.attackBuffInfoBox)?void 0:t.visible)?this.hideAttackBuffInfo():(null==(i=this.info)?void 0:i.attackBuff)&&(this.ensureAttackBuffInfoBox(),this.refreshAttackBuffInfoBox(),this.attackBuffInfoBox.visible=!0)} - hideAttackBuffInfo(){ - this.attackBuffInfoBox&&(this.attackBuffInfoBox.visible=!1)} - ensureAttackBuffInfoBox(){ - if(this.attackBuffInfoBox)return; - const i=t.BUFF_BOX_W,s=t.BUFF_BOX_H,e=t.BUFF_BOX_PAD,n=t.BUFF_BAR_Y,h=new Ke; - h.x=622-i-12,h.y=48,h.eventMode="static",h.cursor="pointer",h.on("pointertap",()=>this.hideAttackBuffInfo()); - const r=new ep; - r.roundRect(0,0,i,s,8).fill({ - color:657940,alpha:.92} - ).stroke({ - color:6710903,width:1} - ),h.addChild(r); - const o=this.makeLabel(NB.getText("GAME_1645","공격버프"),16,hD.DEFAULT_COLOR); - o.x=e,o.y=11,h.addChild(o),this.lblBuffCur=this.makeLabel("",14,hD.DEFAULT_COLOR),this.lblBuffCur.x=e,this.lblBuffCur.y=36,h.addChild(this.lblBuffCur),this.lblBuffNext=this.makeLabel("",14,16764006),this.lblBuffNext.y=36,h.addChild(this.lblBuffNext); - const a=new ep; - a.roundRect(0,0,t.BUFF_BAR_W,t.BUFF_BAR_H,6).fill({ - color:3355460,alpha:1} - ),a.x=e,a.y=n,h.addChild(a),this.buffBarFill=new ep,this.buffBarFill.x=e,this.buffBarFill.y=n,h.addChild(this.buffBarFill),this.lblBuffBar=this.makeLabel("",13,hD.DEFAULT_COLOR),h.addChild(this.lblBuffBar),this.lblBuffNeed=this.makeLabel("",12,14540253),this.lblBuffNeed.x=e,this.lblBuffNeed.y=n+t.BUFF_BAR_H+8,h.addChild(this.lblBuffNeed); - const c=this.makeLabel(NB.getText("GAME_1647","길드가 획득한 점수에 따라 공격 시 아군 영웅 레벨이 증가합니다."),11,10066329); - c.setWrapWidth(i-2*e),c.x=e,c.y=n+t.BUFF_BAR_H+28,h.addChild(c),this.boardBox.addChild(h),this.attackBuffInfoBox=h} - refreshAttackBuffInfoBox(){ - var i; - const s=null==(i=this.info)?void 0:i.attackBuff; - if(!s||!this.attackBuffInfoBox)return; - const e=this.info.myScore,n=t.BUFF_BOX_PAD,h=t.BUFF_BAR_W,r=t.BUFF_BAR_H,o=NB.getText("GAME_1648","현재 공격자"); - this.lblBuffCur.text=`${ - o} - Lv +${ - s.level} - `,null!=s.next?this.lblBuffNext.text=`→ ${ - NB.getText("GAME_1649","다음")} - Lv +${ - s.level+1} - `:this.lblBuffNext.text=`(${ - NB.getText("GAME_1650","최대")} - )`,this.lblBuffNext.x=n+this.lblBuffCur.width+8; - const a=NB.getText("GAME_1652","길드점수"),c=NB.getText("GAME_1653","점"); - if(this.buffBarFill.clear(),null!=s.next){ - const t=Math.min(1,Math.max(0,e/s.next)); - t>0&&this.buffBarFill.roundRect(0,0,Math.max(6,h*t),r,6).fill({ - color:13404211,alpha:1} - ),this.lblBuffBar.text=`${ - a} - ${ - e} - / ${ - s.next} - `; - const i=Math.max(0,s.next-e); - this.lblBuffNeed.text=`${ - NB.getText("GAME_1651","버프 강화에 필요한 점수")} - : ${ - i} - ${ - c} - `} - else this.buffBarFill.roundRect(0,0,h,r,6).fill({ - color:13404211,alpha:1} - ),this.lblBuffBar.text=`${ - a} - ${ - e} - `,this.lblBuffNeed.text=""; - this.lblBuffBar.x=n+(h-this.lblBuffBar.width)/2,this.lblBuffBar.y=t.BUFF_BAR_Y+(r-this.lblBuffBar.height)/2} - ensureCastleInfoBox(){ - if(this.castleInfoBox)return; - const i=t.CI_BOX_W,s=t.CI_BOX_H,e=t.CI_BOX_PAD,n=new Ke; - n.eventMode="static",n.visible=!1; - const h=new ep; - h.roundRect(0,0,i,s,8).fill({ - color:657940,alpha:.94} - ).stroke({ - color:8943428,width:1} - ),n.addChild(h),this.lblCiTitle=this.makeLabel("",15,16766026),this.lblCiTitle.x=e,this.lblCiTitle.y=10,n.addChild(this.lblCiTitle); - const r=this.makeLabel("X",14,11184810); - r.eventMode="static",r.cursor="pointer",r.on("pointertap",()=>{ - this.castleInfoDismissed=!0,this.refreshCastleInfoBox()} - ),r.x=i-e-r.width,r.y=10,n.addChild(r),this.lblCiRemain=this.makeLabel("",11,10070715),this.lblCiRemain.x=e,this.lblCiRemain.y=32,n.addChild(this.lblCiRemain),this.lblCiWinLabel=this.makeLabel(NB.getText("GAME_1656","승리 점수"),13,13421772),this.lblCiWinLabel.x=e,this.lblCiWinLabel.y=52,n.addChild(this.lblCiWinLabel),this.lblCiWinVal=this.makeLabel("",13,hD.DEFAULT_COLOR),this.lblCiWinVal.y=52,n.addChild(this.lblCiWinVal),this.lblCiClearLabel=this.makeLabel(NB.getText("GAME_1657","함락 보너스"),13,13421772),this.lblCiClearLabel.x=e,this.lblCiClearLabel.y=74,n.addChild(this.lblCiClearLabel),this.lblCiClearVal=this.makeLabel("",13,hD.DEFAULT_COLOR),this.lblCiClearVal.y=74,n.addChild(this.lblCiClearVal); - const o=new ep; - o.roundRect(e-4,96,i-2*(e-4),26,6).fill({ - color:5587985,alpha:.9} - ),n.addChild(o),this.lblCiGainLabel=this.makeLabel(NB.getText("GAME_1658","이번 승리 시"),13,16766026),this.lblCiGainLabel.x=e,this.lblCiGainLabel.y=101,n.addChild(this.lblCiGainLabel),this.lblCiGainVal=this.makeLabel("",14,16766026),this.lblCiGainVal.y=100,n.addChild(this.lblCiGainVal),this.lblCiScoreDelta=this.makeLabel("",13,16764006),this.lblCiScoreDelta.x=e,this.lblCiScoreDelta.y=130,n.addChild(this.lblCiScoreDelta),this.boardBox.addChild(n),this.castleInfoBox=n} - refreshCastleInfoBox(){ - var i; - const s=this.selected; - if(!s||"opp"!==this.side||"battle"!==this.viewMode||this.readonlyMode||this.isTournamentReadOnly||this.castleInfoDismissed||!this.info)return void(this.castleInfoBox&&(this.castleInfoBox.visible=!1)); - const e=this.currentBoard(),n=(null==(i=e.slots[s])?void 0:i.length)??0,h=this.remainSlotsForCastle(e,s); - if(e.captured.has(s)||h<=0)return void(this.castleInfoBox&&(this.castleInfoBox.visible=!1)); - this.ensureCastleInfoBox(); - const r=this.castleInfoBox,o=t.CI_BOX_W,a=t.CI_BOX_H,c=t.CI_BOX_PAD,l=qpi[s],u=zpi.getInstance().getByPhase(this.currentViewPhase()),d=u.getKillScore("WIN"),f=u.getClearScore(l),p=1===h,w=d+(p?f:0),g=this.info.myScore,m=NB.getText("GAME_1653","점"); - this.lblCiTitle.text=`${ - s.toUpperCase()} - ${ - NB.getText("GAME_1654","성 공격")} - `,this.lblCiRemain.text=`${ - NB.getText("GAME_1655","남은 방어자")} - ${ - h} - /${ - n} - `,this.lblCiWinVal.text=`+${ - d} - `,this.lblCiWinVal.x=o-c-this.lblCiWinVal.width,this.lblCiClearVal.text=`+${ - f} - `,this.lblCiClearVal.x=o-c-this.lblCiClearVal.width,this.lblCiClearLabel.textColor=p?13421772:7829367,this.lblCiClearVal.textColor=p?hD.DEFAULT_COLOR:7829367,this.lblCiGainVal.text=`+${ - w} - ${ - m} - `,this.lblCiGainVal.x=o-c-this.lblCiGainVal.width,this.lblCiScoreDelta.text=`${ - NB.getText("GAME_1652","길드점수")} - ${ - g} - → ${ - g+w} - `; - const v=1.0638297872340425,_=Jpi[s],M=22+_.x*v,b=(_.y+t.CASTLE_GLOBAL_Y_OFFSET)*v; - let y=M+_.r*v+10; - y+o>616&&(y=M-_.r*v-10-o),r.x=y,r.y=Math.max(6,Math.min(Qpi-a-6,b-a/2)),r.visible=!0} - refreshBottomEndsIn(){ - if(this.readonlyMode||!this.info)return this.iconBottomClock.visible=!1,void(this.lblBottomEndsIn.visible=!1); - const t=new Date(this.info.endAt).getTime(),i=Math.max(0,t-iN.serverTime); - this.lblBottomEndsIn.text=i>0?this.formatRemainShort(i):NB.getText("COMMON_32","종료"),this.iconBottomClock.visible=!0,this.lblBottomEndsIn.visible=!0,this.layoutBottomEndsIn()} - formatRemainShort(t){ - const i=Math.ceil(t/1e3),s=Math.floor(i/3600),e=Math.floor(i%3600/60); - return s>0?`${ - s} - h ${ - e} - m`:`${ - e} - m ${ - i%60} - s`} - layoutBottomEndsIn(){ - const t=Qpi-22-this.iconBottomClock.height; - this.iconBottomClock.x=34,this.iconBottomClock.y=t,this.lblBottomEndsIn.x=34+this.iconBottomClock.width+4,this.lblBottomEndsIn.y=t+(this.iconBottomClock.height-this.lblBottomEndsIn.height)/2} - refreshScoreLabel(){ - this.readonlyMode||this.info&&(this.lblScore.text=`( ${ - this.info.myScore} - : ${ - this.info.oppScore} - )`,this.lblScore.textColor=16750899,this.lblScore.x=this.lblTitle.x+this.lblTitle.width+8,this.lblScore.y=6)} - refreshBoardStat(){ - const t=this.currentBoard(),i="opp"===this.side?NB.getText("GAME_1041","적 진영"):NB.getText("GAME_1042","우리 진영"),s=NB.getValueReplace("GAME_1051","##",t.phase,`${ - t.phase} - 단계`); - this.lblBoardStat.text=`${ - i} - · ${ - s} - `,this.lblBoardStat.textColor="opp"===this.side?16763904:11193599,this.rebuildPhaseTabs(),this.refreshScoreLabel()} - rebuildPhaseTabs(){ - this.phaseTabsBox.removeChildren(); - const t=this.currentPhases(); - if(0===t.length)return; - const i=this.currentViewPhase(); - for(let s=1; - s<=t.length; - s++){ - const t=new Gqt(`${ - s} - `,44); - t.autoResize=!1,t.width=44,t.height=44,t.x=50*(s-1),t.y=0,t.selected=s===i,t.onClick=()=>this.setViewPhase(s),this.phaseTabsBox.addChild(t)} - } - setViewPhase(t){ - this.currentViewPhase()!==t&&(this.setCurrentViewPhase(t),this.selected=null,this.renderBoard(),this.renderBottom(),"opp"===this.side&&this.loadStrategyStrokesForCurrent())} - refreshSideButtons(){ - this.btnSideOpp.selected="opp"===this.side,this.btnSideMe.selected="me"===this.side} - buildBoard(){ - const t=new Ke; - t.x=22,t.y=0,t.scale.set(1.0638297872340425),this.boardInner=t,this.mapBg=new Xe(RS.getTexture("UI_GuildWar","gwBG")),this.mapBg.width=564,this.mapBg.height=504,t.addChild(this.mapBg),t.addChild(this.nodesBox),this.strategyCanvas=new rwi(564,504),this.strategyCanvas.onStrokeFinalized=t=>this.onStrategyStrokeFinalized(t),this.strategyCanvas.onStrokeErased=t=>this.onStrategyStrokeErased(t),this.strategyCanvas.onEraseDenied=()=>{ - bH.getInstance().showMessage(NB.getText("GUILD_WAR_STRATEGY_ERASE_DENIED","본인이 그린 것만 지울 수 있습니다."))} - ,t.addChild(this.strategyCanvas),this.boardBox.addChild(t),this.lblTickets.y=8,this.boardBox.addChild(this.lblTickets),this.lblAttackBuff.y=27,this.boardBox.addChild(this.lblAttackBuff),this.boardBox.addChild(this.btnAttackBuffGuide),this.phaseTabsBox.x=30,this.phaseTabsBox.y=8,this.boardBox.addChild(this.phaseTabsBox),this.buildBoardOptions(),this.iconBottomClock=new Xe(RS.getTexture("UI_Ekkorr","Icon_Time02")),this.iconBottomClock.scale.set(.595),this.iconBottomClock.visible=!1,this.boardBox.addChild(this.iconBottomClock),this.lblBottomEndsIn=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_OUTLINE_FONT_OPTION_16),this.lblBottomEndsIn.visible=!1,this.boardBox.addChild(this.lblBottomEndsIn)} - buildBoardOptions(){ - this.cbStrategyShow=new Xjt,this.cbStrategyShow.selected=!0,this.cbStrategyShow.x=510,this.cbStrategyShow.y=427,this.cbStrategyShow.onClick=t=>{ - this.showStrategyStrokes=t,this.saveStrategyShowPref(t),this.strategyCanvas&&this.strategyCanvas.setStrokesVisible(t)} - ,this.boardBox.addChild(this.cbStrategyShow); - const t=new iG(NB.getText("GAME_1160","전략"),16777215,{ - ...hD.DEFAULT_OUTLINE_FONT_OPTION_16,fontSize:13} - ); - t.textColor=16777215,t.x=538,t.y=429,this.boardBox.addChild(t),this.lblOptStrategy=t,this.cbScore=new Xjt,this.cbScore.selected=!1,this.cbScore.x=510,this.cbScore.y=460,this.cbScore.onClick=t=>{ - this.showScores=t,this.renderNodes()} - ,this.boardBox.addChild(this.cbScore); - const i=new iG(NB.getText("GAME_1044","점수"),16777215,{ - ...hD.DEFAULT_OUTLINE_FONT_OPTION_16,fontSize:13} - ); - i.textColor=16777215,i.x=538,i.y=462,this.boardBox.addChild(i),this.lblOptScore=i,this.cbCastleName=new Xjt,this.cbCastleName.selected=!1,this.cbCastleName.x=510,this.cbCastleName.y=493,this.cbCastleName.onClick=t=>{ - this.showCastleNames=t,this.renderNodes()} - ,this.boardBox.addChild(this.cbCastleName); - const s=new iG(NB.getText("GAME_1045","번호"),16777215,{ - ...hD.DEFAULT_OUTLINE_FONT_OPTION_16,fontSize:13} - ); - s.textColor=16777215,s.x=538,s.y=495,this.boardBox.addChild(s),this.lblOptName=s} - renderBoard(){ - this.updateMapTint(),this.renderNodes(),this.refreshBoardStat()} - updateMapTint(){ - this.mapBg&&(this.mapBg.tint="opp"===this.side?16769248:14542591)} - renderNodes(){ - this.stopAllFireAnimations(),this.nodesBox.removeChildren(); - for(const t of Ypi)this.nodesBox.addChild(this.buildNode(t))} - stopAllFireAnimations(){ - for(const t of this.nodesBox.children)if(t instanceof Ke)for(const i of t.children)i instanceof wp&&i.stop()} - onRemoved(){ - super.onRemoved(),this.stopAllFireAnimations(),this.stopProtectTick(),this.strategyMode&&(this.strategyMode=!1,this.applyStrategyMode()),this.strategyCanvas&&this.strategyCanvas.setStrokes([]),this.guild2HiddenByMe&&this.guild2Ref&&(this.guild2HiddenByMe=!1,this.guild2Ref.visible=!0,this.guild2Ref=null,YXt.refreshDimVisibility()); - try{ - sD.getInstance().guildWar.invalidateCache(OD.myGuildId),(async()=>{ - const{ - GuildWarMainView:t} - =await ei(async()=>{ - const{ - GuildWarMainView:t} - =await Promise.resolve().then(()=>yri); - return{ - GuildWarMainView:t} - } - ,void 0); - t.getInstance().setData()} - )()} - catch{ - } - } - buildNode(i){ - var s; - const e=this.currentBoard(),n=Jpi[i],h=qpi[i],r=e.captured.has(i),o=!1===this.isTournamentReadOnly?"opp"===this.side&&!r&&this.canAttackInCurrentPhase(i):!r&&this.canAttackInCurrentPhase(i),a=new Ke; - a.x=n.x,a.y=n.y+t.CASTLE_GLOBAL_Y_OFFSET; - const c=["Blue","Red","Green"],l=c[(e.phase-1)%c.length],u=t.TIER_SPRITE_SIZE[h],d=new Xe(RS.getTexture("UI_GuildWar",`${ - l} - ${ - u} - `)),f=t.CASTLE_ANCHOR[u]; - if(d.anchor.set(f.x,f.y),d.y=n.r*t.CASTLE_Y_OFFSET_RATIO,0==this.isTournamentReadOnly?r?d.tint=6710886:o||"opp"!==this.side||(d.alpha=.7):r?d.tint=6710886:o||(d.alpha=.7),this.selected===i&&(d.filters=[new s1t({ - distance:16,outerStrength:5,innerStrength:0,color:16750899,quality:.3} - )]),a.addChild(d),r){ - const i=RS.getTextures("UI_GuildWar","ZoneFireEffect1",!0); - if(i.length>0){ - const s=new wp(i); - s.anchor.set(.5,1),s.y=n.r*t.CASTLE_Y_OFFSET_RATIO,s.scale.set(t.FIRE_SCALE[h]),s.animationSpeed=.3,s.loop=!0,s.play(),a.addChild(s)} - } - const p=(null==(s=e.slots[i])?void 0:s.length)??0; - if(!r&&p>0){ - const t=this.remainSlotsForCastle(e,i),s=new iG(`${ - t} - /${ - p} - `,14548957,{ - ...hD.DEFAULT_OUTLINE_FONT_OPTION_16,fontSize:9} - ); - s.textColor=14548957,s.x=-s.width/2,s.y=n.r-12,a.addChild(s)} - if(this.showScores){ - const t=zpi.getInstance().getByPhase(this.currentViewPhase()).getClearScore(h),i=new iG(`+${ - t} - `,16766026,{ - ...hD.DEFAULT_OUTLINE_FONT_OPTION_16,fontSize:11} - ); - i.textColor=16766026,i.x=.4*n.r-i.width+10,i.y=.65*-n.r,a.addChild(i)} - if(this.showCastleNames){ - const t=new iG(i.toUpperCase(),13426175,{ - ...hD.DEFAULT_OUTLINE_FONT_OPTION_16,fontSize:9} - ); - t.textColor=13426175,t.x=-t.width/2,t.y=n.r+4,a.addChild(t)} - return a.eventMode="static",a.cursor="pointer",a.on("pointertap",()=>this.onSelectCastle(i)),a} - buildBottom(i){ - const s=Math.max(180,i-this.bottomBox.y-24),e=120,n=36,h=-2; - this.btnTabBattle=new Gqt(NB.getText("GAME_1046","전투"),e),this.btnTabBattle.autoResize=!1,this.btnTabBattle.lbl.textSize=17,this.btnTabBattle.width=e,this.btnTabBattle.height=n,this.btnTabBattle.x=20,this.btnTabBattle.y=h,this.btnTabBattle.onClick=()=>this.setViewMode("battle"),this.bottomBox.addChild(this.btnTabBattle),this.btnTabLog=new Gqt(NB.getText("GAME_1027","로그"),e),this.btnTabLog.autoResize=!1,this.btnTabLog.lbl.textSize=17,this.btnTabLog.width=e,this.btnTabLog.height=n,this.btnTabLog.x=this.btnTabBattle.x+e+3,this.btnTabLog.y=h,this.btnTabLog.onClick=()=>this.setViewMode("log"),this.bottomBox.addChild(this.btnTabLog),this.btnTabList=new Gqt(NB.getText("COMMON_26","목록"),e),this.btnTabList.autoResize=!1,this.btnTabList.lbl.textSize=17,this.btnTabList.width=e,this.btnTabList.height=n,this.btnTabList.x=this.btnTabLog.x+e+3,this.btnTabList.y=h,this.btnTabList.onClick=()=>this.setViewMode("list"),this.bottomBox.addChild(this.btnTabList),this.btnTabTarget=new Gqt(NB.getText("GAME_1175","타겟"),e),this.btnTabTarget.autoResize=!1,this.btnTabTarget.lbl.textSize=17,this.btnTabTarget.width=e,this.btnTabTarget.height=n,this.btnTabTarget.x=this.btnTabList.x+e+3,this.btnTabTarget.y=h,this.btnTabTarget.onClick=()=>this.setViewMode("target"),this.bottomBox.addChild(this.btnTabTarget),this.btnTabStrategy=new Gqt(NB.getText("GAME_1160","전략"),e),this.btnTabStrategy.autoResize=!1,this.btnTabStrategy.lbl.textSize=17,this.btnTabStrategy.width=e,this.btnTabStrategy.height=n,this.btnTabStrategy.x=t.W-e-20,this.btnTabStrategy.y=h,this.btnTabStrategy.onClick=()=>this.setViewMode("strategy"),this.btnTabStrategy.visible=!1,this.bottomBox.addChild(this.btnTabStrategy),this.btnTabBattle.selected=!0,this.btnTabLog.selected=!1,this.btnTabList.selected=!1,this.btnTabTarget.selected=!1,this.btnTabStrategy.selected=!1,this.btnTargetEdit=new Gqt(NB.getText("GUILD_WAR_TARGET_EDIT","Edit"),82),this.btnTargetEdit.autoResize=!1,this.btnTargetEdit.lbl.textSize=15,this.btnTargetEdit.width=82,this.btnTargetEdit.height=n,this.btnTargetEdit.x=this.btnTabTarget.x+e,this.btnTargetEdit.y=h,this.btnTargetEdit.onClick=()=>this.onTargetEditButtonClick(),this.btnTargetEdit.visible=!1,this.bottomBox.addChild(this.btnTargetEdit),this.refreshTargetEditButton(); - this.bottomHeader=this.makeLabel("",15,16746598),this.bottomHeader.textColor=16746598,this.bottomHeader.x=24,this.bottomHeader.y=44,this.bottomBox.addChild(this.bottomHeader),this.bottomGateLine=this.makeLabel("",14,16746632),this.bottomGateLine.textColor=16746632,this.bottomGateLine.x=24,this.bottomGateLine.y=70,this.bottomBox.addChild(this.bottomGateLine),this.bottomDetailAdj=this.makeLabel("",13,13421772),this.bottomDetailAdj.textColor=13421772,this.bottomDetailAdj.x=40,this.bottomDetailAdj.y=94,this.bottomBox.addChild(this.bottomDetailAdj),this.bottomDetailScore=this.makeLabel("",13,13421772),this.bottomDetailScore.textColor=13421772,this.bottomDetailScore.x=40,this.bottomDetailScore.y=116,this.bottomBox.addChild(this.bottomDetailScore),this.bottomMessage=this.makeLabel("",14,11184810),this.bottomMessage.textColor=11184810,this.bottomMessage.x=24,this.bottomMessage.y=70,this.bottomBox.addChild(this.bottomMessage),this.slotsList=new Ox(awi,600,s-100,4),this.slotsList.x=20,this.slotsList.y=70,this.slotsList.visible=!1,this.bottomBox.addChild(this.slotsList); - const r=44,o=lwi,a=20; - this.logColLeft=this.makeLabel("",12,11184810),this.logColLeft.textColor=11184810,this.logColLeft.x=a+o.COL_LEFT_NAME_X,this.logColLeft.y=r,this.bottomBox.addChild(this.logColLeft),this.logColArrow=this.makeLabel("",12,11184810),this.logColArrow.textColor=11184810,this.logColArrow.y=r,this.bottomBox.addChild(this.logColArrow),this.logColRight=this.makeLabel("",12,11184810),this.logColRight.textColor=11184810,this.logColRight.x=a+o.COL_RIGHT_NAME_X,this.logColRight.y=r,this.bottomBox.addChild(this.logColRight),this.logColCastle=this.makeLabel(NB.getText("GAME_1056","성"),12,11184810),this.logColCastle.textColor=11184810,this.logColCastle.y=r,this.bottomBox.addChild(this.logColCastle),this.logColResult=this.makeLabel(NB.getText("GAME_1057","결과"),12,11184810),this.logColResult.textColor=11184810,this.logColResult.y=r,this.bottomBox.addChild(this.logColResult),this.logColTime=this.makeLabel(NB.getText("GAME_1058","시간"),12,11184810),this.logColTime.textColor=11184810,this.logColTime.y=r,this.bottomBox.addChild(this.logColTime),this.setLogColumnHeaderVisible(!1); - const c=vwi; - this.memberColName=this.makeLabel(NB.getText("COMMON_58","닉네임"),12,11184810),this.memberColName.textColor=11184810,this.memberColName.x=a+c.COL_NAME_X,this.memberColName.y=r,this.bottomBox.addChild(this.memberColName),this.memberColTicket=this.makeLabel(NB.getText("GAME_1043","공격권"),12,11184810),this.memberColTicket.textColor=11184810,this.memberColTicket.y=r,this.bottomBox.addChild(this.memberColTicket),this.memberColAttack1=this.makeLabel(NB.getValueReplace("GAME_1178","##",1,"1차"),12,11184810),this.memberColAttack1.textColor=11184810,this.memberColAttack1.x=a+c.COL_ATTACK1_CX-this.memberColAttack1.width/2,this.memberColAttack1.y=r,this.bottomBox.addChild(this.memberColAttack1),this.memberColAttack2=this.makeLabel(NB.getValueReplace("GAME_1178","##",2,"2차"),12,11184810),this.memberColAttack2.textColor=11184810,this.memberColAttack2.x=a+c.COL_ATTACK2_CX-this.memberColAttack2.width/2,this.memberColAttack2.y=r,this.bottomBox.addChild(this.memberColAttack2),this.setMemberColumnHeaderVisible(!1); - const l=Mwi; - this.targetColName=this.makeLabel(NB.getText("COMMON_58","닉네임"),12,11184810),this.targetColName.textColor=11184810,this.targetColName.x=a+l.COL_NAME_X,this.targetColName.y=r,this.bottomBox.addChild(this.targetColName),this.targetColCastle=this.makeLabel(NB.getText("GAME_1176","성"),12,11184810),this.targetColCastle.textColor=11184810,this.targetColCastle.y=r,this.bottomBox.addChild(this.targetColCastle),this.targetColMarker=this.makeLabel(NB.getText("GAME_1177","마크"),12,11184810),this.targetColMarker.textColor=11184810,this.targetColMarker.y=r,this.bottomBox.addChild(this.targetColMarker),this.setTargetColumnHeaderVisible(!1); - const u=Math.max(120,s-66-4); - this.combatLogList=new Ox(lwi,600,u,2),this.combatLogList.x=20,this.combatLogList.y=66,this.combatLogList.visible=!1,this.bottomBox.addChild(this.combatLogList),this.memberStatusList=new Ox(vwi,600,u,2),this.memberStatusList.x=20,this.memberStatusList.y=66,this.memberStatusList.visible=!1,this.bottomBox.addChild(this.memberStatusList),this.targetMarkerList=new Ox(Mwi,600,u,2),this.targetMarkerList.x=20,this.targetMarkerList.y=66,this.targetMarkerList.visible=!1,this.bottomBox.addChild(this.targetMarkerList),awi.onAttackClick=t=>this.onAttackSlot(t),Mwi.onMarkerClick=(t,i)=>{ - this.onTargetMarkerClick(t,i)} - ,this.refreshTargetTabVisibility(),this.buildStrategyToolbar()} - buildStrategyToolbar(){ - this.strategyToolbarBox.x=0,this.strategyToolbarBox.y=0,this.strategyToolbarBox.visible=!1,this.bottomBox.addChild(this.strategyToolbarBox); - const t=[{ - tool:"pen",key:"GAME_1161",fallback:"펜"} - ,{ - tool:"circle",key:"GAME_1162",fallback:"원"} - ,{ - tool:"rect",key:"GAME_1163",fallback:"사각형"} - ]; - let i=20; - for(const r of t){ - const t=new Gqt(NB.getText(r.key,r.fallback),111); - t.autoResize=!1,t.lbl.textSize=15,t.width=111,t.height=40,t.x=i,t.y=56,t.onClick=()=>this.setStrategyTool(r.tool),this.strategyToolbarBox.addChild(t),this.strategyToolBtns.push({ - tool:r.tool,btn:t} - ),i+=114} - const s=168; - let e=20; - const n=new Gqt(NB.getText("GAME_1164","지우개"),s); - n.autoResize=!1,n.lbl.textSize=15,n.width=s,n.height=40,n.x=e,n.y=99,n.onClick=()=>this.setStrategyTool("eraser"),this.strategyToolbarBox.addChild(n),this.strategyToolBtns.push({ - tool:"eraser",btn:n} - ),e+=171,this.btnStrategyClearAll=new Gqt(NB.getText("GAME_1165","전체 지우기"),s),this.btnStrategyClearAll.autoResize=!1,this.btnStrategyClearAll.lbl.textSize=15,this.btnStrategyClearAll.width=s,this.btnStrategyClearAll.height=40,this.btnStrategyClearAll.x=e,this.btnStrategyClearAll.y=99,this.btnStrategyClearAll.onClick=()=>this.onStrategyClearAll(),this.strategyToolbarBox.addChild(this.btnStrategyClearAll); - let h=20; - this.btnStrategyUndo=new Gqt(NB.getText("GAME_1166","되돌리기"),s),this.btnStrategyUndo.autoResize=!1,this.btnStrategyUndo.lbl.textSize=15,this.btnStrategyUndo.width=s,this.btnStrategyUndo.height=40,this.btnStrategyUndo.x=h,this.btnStrategyUndo.y=142,this.btnStrategyUndo.onClick=()=>this.onStrategyUndo(),this.strategyToolbarBox.addChild(this.btnStrategyUndo),h+=171,this.btnStrategySave=new Gqt(NB.getText("GAME_527","저장"),s),this.btnStrategySave.autoResize=!1,this.btnStrategySave.lbl.textSize=15,this.btnStrategySave.width=s,this.btnStrategySave.height=40,this.btnStrategySave.x=h,this.btnStrategySave.y=142,this.btnStrategySave.onClick=()=>this.onStrategySave(),this.strategyToolbarBox.addChild(this.btnStrategySave); - for(let r=0; - r<iwi.length; - r++){ - const t=iwi[r],i=new ep,s=r%4,e=0===Math.floor(r/4)?76:119; - i.x=392+48*s+20,i.y=e,i.eventMode="static",i.cursor="pointer",i.on("pointertap",()=>this.setStrategyColor(t)),this.strategyToolbarBox.addChild(i),this.strategyColorSwatches.push({ - color:t,gfx:i} - )} - this.refreshStrategyToolButtons(),this.refreshStrategyColorSwatches()} - setViewMode(t){ - ("target"!==t||this.isTargetModeAvailable())&&("list"!==t||this.isListModeAvailable())&&("strategy"!==t||this.isStrategyModeAvailable())&&this.viewMode!==t&&(this.viewMode=t,this.btnTabBattle.selected="battle"===t,this.btnTabLog.selected="log"===t,this.btnTabList.selected="list"===t,this.btnTabTarget.selected="target"===t,this.btnTabStrategy&&(this.btnTabStrategy.selected="strategy"===t),this.strategyMode="strategy"===t,this.applyStrategyMode(),"strategy"!==t?this.renderBottom():this.refreshCastleInfoBox())} - renderBottom(){ - if(this.bottomGateLine.text="",this.bottomDetailAdj.text="",this.bottomDetailScore.text="",this.bottomMessage.text="",this.slotsList.visible=!1,this.combatLogList.visible=!1,this.memberStatusList.visible=!1,this.targetMarkerList.visible=!1,this.setLogColumnHeaderVisible(!1),this.setMemberColumnHeaderVisible(!1),this.setTargetColumnHeaderVisible(!1),this.refreshTargetTabVisibility(),this.refreshTargetEditButton(),this.refreshCastleInfoBox(),"log"===this.viewMode)return this.bottomHeader.text="",this.refreshLogColumnHeader(),this.setLogColumnHeaderVisible(!0),this.combatLogList.visible=!0,void(this.combatLogList.dataProvider=this.buildLogRowsForCurrentSide()); - if("list"===this.viewMode){ - this.bottomHeader.text="",this.refreshMemberColumnHeader(),this.setMemberColumnHeaderVisible(!0); - const t=this.buildMemberStatusRowsForCurrentSide(); - return 0===t.length?(this.bottomMessage.text=NB.getText("GUILD_WAR_MEMBER_LIST_EMPTY","표시할 목록이 없습니다."),void(this.bottomMessage.textColor=11184810)):(this.memberStatusList.visible=!0,void(this.memberStatusList.dataProvider=t))} - if("target"===this.viewMode){ - if(!this.isTargetModeAvailable())return void this.setViewMode("battle"); - this.bottomHeader.text="",this.refreshTargetColumnHeader(),this.setTargetColumnHeaderVisible(!0); - const t=this.buildTargetMarkerRows(); - return 0===t.length?(this.bottomMessage.text=NB.getText("GUILD_WAR_TARGET_EMPTY","표시할 타겟이 없습니다."),void(this.bottomMessage.textColor=11184810)):(this.targetMarkerList.visible=!0,this.targetMarkerList.dataProvider=t,void this.refreshTargetEditButton())} - if(null==this.selected)return this.bottomHeader.text=NB.getText("GAME_1047","성을 클릭하면 정보가 표시됩니다."),void(this.bottomHeader.textColor=11184810); - const t=this.currentBoard(),i=this.selected,s=qpi[i],e=t.captured.has(i),n=zpi.getInstance().getByPhase(this.currentViewPhase()),h=n.getClearScore(s),r=NB.getText("GAME_1048","성 정보"),o=e?` · ${ - NB.getText("GAME_1050","함락됨")} - `:""; - if(this.bottomHeader.text=`${ - r} - : ${ - i.toUpperCase()} - ( +${ - h} - )${ - o} - `,!1===this.isTournamentReadOnly&&"me"===this.side)return this.bottomHeader.textColor=e?8947848:11193599,void this.renderSlotsListForCurrent(i); - const a=this.canAttackInCurrentPhase(i),c=this.totalScoreFor(this.side),l=n.getReqScore(s); - if(this.bottomHeader.textColor=e?8947848:a?16746598:16746632,e)this.renderSlotsListForCurrent(i); - else{ - if(!a){ - const e="c"===s||Xpi[i].some(i=>t.captured.has(i)),n=c>=l; - return this.bottomGateLine.text=NB.getText("GAME_1052","접근 불가"),this.bottomGateLine.textColor=16746632,this.bottomDetailAdj.text=`- ${ - NB.getText("GAME_1053","인접 성 점령")} - : ${ - e?"O":"X"} - `,this.bottomDetailAdj.textColor=e?10092458:16746632,this.bottomDetailScore.text=`- ${ - NB.getText("GAME_1054","필요 점수")} - ( ${ - l} - ) : ${ - n?"O":"X"} - (${ - NB.getText("GAME_1055","현재")} - ${ - c} - )`,void(this.bottomDetailScore.textColor=n?10092458:16746632)} - this.renderSlotsListForCurrent(i)} - } - renderSlotsListForCurrent(t){ - const i=this.currentBoard().slots[t]??[]; - if(0===i.length)return this.bottomMessage.text=NB.getText("GAME_1049","수비가 없는 무방비 상태입니다."),void(this.bottomMessage.textColor=11197951); - this.slotsList.visible=!0,this.slotsList.dataProvider=i} - remainSlotsForCastle(t,i){ - const s=t.slots[i]??[]; - let e=0; - for(const n of s)"DESTROYED"!==n.status&&e++; - return e} - setSide(t){ - if(this.side===t)return; - this.side=t,this.selected=null; - const i="target"===this.viewMode&&!this.isTargetModeAvailable(),s="list"===this.viewMode&&!this.isListModeAvailable(); - (i||s)&&(this.viewMode="battle",this.btnTabBattle.selected=!0,this.btnTabLog.selected=!1,this.btnTabList.selected=!1,this.btnTabTarget.selected=!1,this.resetTargetEditState()),"me"===this.side?("strategy"===this.viewMode&&(this.viewMode="battle",this.btnTabBattle.selected=!0,this.btnTabStrategy.selected=!1),this.strategyMode&&(this.strategyMode=!1,this.applyStrategyMode()),this.strategyCanvas&&this.strategyCanvas.setStrokes([])):this.loadStrategyStrokesForCurrent(),this.refreshSideButtons(),this.refreshTargetTabVisibility(),this.refreshTargetEditButton(),this.refreshStrategyAvailability(),this.renderBoard(),this.renderBottom()} - onSelectCastle(t){ - this.selected=t,this.castleInfoDismissed=!1,"battle"!==this.viewMode&&(this.viewMode="battle",this.btnTabBattle.selected=!0,this.btnTabLog.selected=!1,this.btnTabList.selected=!1,this.btnTabTarget.selected=!1,this.btnTabStrategy&&(this.btnTabStrategy.selected=!1),this.strategyMode&&(this.strategyMode=!1,this.applyStrategyMode()),this.resetTargetEditState()),this.renderBoard(),this.renderBottom()} - async onRefreshClick(){ - await this.fetchHeaderInfo(!1)} - async onAttackSlot(i){ - var s,e; - if(this.readonlyMode)return void bH.getInstance().showMessage(NB.getText("GAME_1091","지난 길드전 - 공격불가")); - if("opp"!==this.side)return void bH.getInstance().showMessage(NB.getText("GAME_1065","우리 진영에서는 공격 불가")); - if(null==this.selected)return; - if(this.warId<=0)return; - const n=this.selected,h=this.oppViewPhase,r=this.oppPhases[h-1]; - if(!r)return; - if(r.captured.has(n))return void bH.getInstance().showMessage(NB.getText("GAME_1066","이미 함락된 성")); - if(!this.canAttackInCurrentPhase(n))return void bH.getInstance().showMessage(NB.getText("GAME_1067","공격 불가")); - if("DESTROYED"===i.status)return void bH.getInstance().showMessage(NB.getText("GAME_1068","이미 격파된 슬롯")); - if("PROTECTED"===i.status&&(i.protectedUntil?new Date(i.protectedUntil).getTime():0)>Date.now())return void bH.getInstance().showMessage(NB.getText("GAME_1069","보호 중인 슬롯")); - if(this.isJoinedAfterWarStart())return void bH.getInstance().showMessage(NB.getText("GAME_1070","다음 길드전부터 참여가 가능합니다.")); - const o=await this.ensureMyTeamASquads(); - if(!o)return void bH.getInstance().showMessage(NB.getText("GAME_1126","수비팀(A) 편성을 먼저 해주세요")); - const{ - GuildWarBattleReadyPopup:a} - =await ei(async()=>{ - const{ - GuildWarBattleReadyPopup:t} - =await Promise.resolve().then(()=>xwi); - return{ - GuildWarBattleReadyPopup:t} - } - ,void 0); - a.getInstance().open(i,o,async s=>{ - var e,r,o,a,c,l,u,d,f,p,w,g,m,v; - try{ - const _=await sD.getInstance().guildWar.attackV3Start(this.warId,n,i.slotId,s,h,!0); - if(_&&!1===_.success&&"NOT_IN_GUILD"===_.error)return void OD.handleNotInGuild(); - if(!0===(null==(e=null==_?void 0:_.body)?void 0:e.autoCleared))return bH.getInstance().showMessage(NB.getText("GAME_1619","이미 클리어된 유저입니다.")),this.lastInfoFetchAt=0,void this.fetchHeaderInfo(!0); - const M=null==(r=null==_?void 0:_.body)?void 0:r.attackId,b="string"==typeof(null==(o=null==_?void 0:_.body)?void 0:o.defenderSquads)&&_.body.defenderSquads.length>0?_.body.defenderSquads:i.squads,y=(null==(a=null==_?void 0:_.body)?void 0:a.defenderBarrackCounts)&&"object"==typeof _.body.defenderBarrackCounts?_.body.defenderBarrackCounts:{ - } - ,E=(null==(c=null==_?void 0:_.body)?void 0:c.attackerBarrackCounts)&&"object"==typeof _.body.attackerBarrackCounts?_.body.attackerBarrackCounts:{ - } - ,A=new Set(Array.isArray(null==(l=null==_?void 0:_.body)?void 0:l.attackerAwakenedTribes)?_.body.attackerAwakenedTribes.map(Number):Array.from(wP.getAwakenedBarrackTribes())),S=new Set(Array.isArray(null==(u=null==_?void 0:_.body)?void 0:u.defenderAwakenedTribes)?_.body.defenderAwakenedTribes.map(Number):[]),T=(null==(d=null==_?void 0:_.body)?void 0:d.attackerTransPoints)&&"object"==typeof _.body.attackerTransPoints?_.body.attackerTransPoints:null,C=Math.max(0,Math.floor(Number(null==(f=null==_?void 0:_.body)?void 0:f.attackerBuffLevel)||0)),O=(null==(p=null==_?void 0:_.body)?void 0:p.defenderTransPoints)&&"object"==typeof _.body.defenderTransPoints?_.body.defenderTransPoints:null,I=Qt(t=>{ - const i=t; - return i&&Array.isArray(i.owned)?fP.collectContextBuffsFor(i.owned,Number(i.representPet)||0,"GUILDPVP"):null} - ,"toPetBuffs"),k=I(null==(w=null==_?void 0:_.body)?void 0:w.attackerPets)??fP.collectContextBuffsFor(zx.getInstance().list.map(t=>({ - kindNum:t.kindNum,grade:t.grade} - )),zx.getInstance().representPet,"GUILDPVP"),x=I(null==(g=null==_?void 0:_.body)?void 0:g.defenderPets); - if(!M){ - const t=String((null==(v=null==(m=null==_?void 0:_.header)?void 0:m.errorInfo)?void 0:v.additional)??""); - return void(t.includes("joined after war start")?bH.getInstance().showMessage(NB.getText("GAME_1070","다음 길드전부터 참여가 가능합니다.")):t.includes("slot busy")?(bH.getInstance().showMessage(NB.getText("GAME_1071","다른 길드원이 이미 공격 중입니다.")),this.lastInfoFetchAt=0,this.fetchHeaderInfo(!0)):t.includes("slot status=PROTECTED")?(bH.getInstance().showMessage(NB.getText("GAME_1072","보호 중인 슬롯입니다.")),this.lastInfoFetchAt=0,this.fetchHeaderInfo(!0)):t.includes("slot status=DESTROYED")?(bH.getInstance().showMessage(NB.getText("GAME_1073","이미 격파된 슬롯입니다.")),this.lastInfoFetchAt=0,this.fetchHeaderInfo(!0)):t.includes("castle already captured")?(bH.getInstance().showMessage(NB.getText("GAME_1075","이미 함락된 성입니다.")),this.lastInfoFetchAt=0,this.fetchHeaderInfo(!0)):t.includes("score gate not met")?bH.getInstance().showMessage(NB.getText("GAME_1076","점수가 부족합니다.")):t.includes("no tickets")?bH.getInstance().showMessage(NB.getText("GAME_1077","공격권이 없습니다.")):t.includes("war not active")?(bH.getInstance().showMessage(NB.getText("GAME_1078","이미 종료된 길드전입니다.")),this.lastInfoFetchAt=0,this.fetchHeaderInfo(!0)):bH.getInstance().showMessage(NB.getText("GAME_1079","공격 시작 실패")))} - this.cachedMyTeamASquads=s,this.saveAttackSquadsToLs(s),(async()=>{ - try{ - const t=await sD.getInstance().guildBarracks.getAll(!0),i=(null==t?void 0:t.body)??t; - (null==i?void 0:i.states)&&BB.getInstance().setStates(i.states)} - catch(frt){ - } - } - )(); - const R=this.squadsToCorpsRich(s,E,A),P=this.squadsToCorpsRich(b,y,S),N=Math.floor(TG.maxWave/100),L=i.knightLevel??0,D=qpi[n],G=zpi.getInstance().getByPhase(h).getPlusLevel(D),B=z0t.getInstance(); - B.setMapIndex(gwi(n)),B.setTeams({ - allyHeroes:R.heroes,allyHeroTrans:R.heroTrans,allyCorpSoldierTiers:R.soldierTiers,allyKnightLevel:N,allyHeroLevelBonus:C,allyTransPoints:T,allyPetBuffs:k,enemyHeroes:P.heroes,enemyHeroTrans:P.heroTrans,enemyCorpSoldierTiers:P.soldierTiers,enemyKnightLevel:L,enemyHeroLevelBonus:G,enemyTransPoints:O,enemyPetBuffs:x} - ),B.onComplete=async t=>{ - try{ - const i=await sD.getInstance().guildWar.attackV3End(M,t,0,void 0,!1),s=(null==i?void 0:i.body)??i; - s&&"object"==typeof s&&("number"==typeof s.gem&&(TG.gem=s.gem,LH.getInstance().updateGem()),"number"==typeof s.honorCoin&&(TG.honorCoin=s.honorCoin,LH.getInstance().updateHonor()),B.lastReward={ - gem:"number"==typeof s.rewardGem?s.rewardGem:0,honorCoin:"number"==typeof s.rewardHonorCoin?s.rewardHonorCoin:0} - ),"WIN"!==t&&bH.getInstance().showMessage(NB.getText("GAME_1080","공격 실패")),sD.getInstance().guildWar.invalidateCache(OD.myGuildId),this.lastInfoFetchAt=0,await this.fetchHeaderInfo(!0)} - catch(frt){ - } - } - ; - const U=this.warId; - B.onAfterReturnToIdle=()=>{ - (async()=>{ - const{ - Guild2Popup:i} - =await ei(async()=>{ - const{ - Guild2Popup:t} - =await Promise.resolve().then(()=>ooi); - return{ - Guild2Popup:t} - } - ,void 0); - i.getInstance().show(); - const{ - GuildWarPopup:s} - =await ei(async()=>{ - const{ - GuildWarPopup:t} - =await Promise.resolve().then(()=>Jri); - return{ - GuildWarPopup:t} - } - ,void 0); - s.getInstance().show(),await t.getInstance().open(U); - const{ - GuildWarMainView:e} - =await ei(async()=>{ - const{ - GuildWarMainView:t} - =await Promise.resolve().then(()=>yri); - return{ - GuildWarMainView:t} - } - ,void 0); - e.getInstance().setData()} - )()} - ,await B.startBattle()} - catch(h6i){ - bH.getInstance().showMessage(NB.getText("GAME_1116","공격 실패 (티켓/슬롯 상태 확인)"))} - } - ,this.warId,(null==(e=null==(s=this.info)?void 0:s.attackBuff)?void 0:e.level)??0)} - squadsToCorpsRich(t,i,s){ - const e=[0,0,0,0,0],n=[0,0,0,0,0],h=[[],[],[],[],[]]; - if(!t)return{ - heroes:e,heroTrans:n,soldierTiers:h} - ; - const r=t.split("|"),o=BB.getInstance(); - for(let a=0; - a<Math.min(5,r.length); - a++){ - const[t,c,l]=r[a].split("-").map(Number); - if(t>0&&(e[a]=t,n[a]=Math.max(0,c||0)),!(l>0))continue; - const u=o.getBook(l); - if(!u)continue; - const d=i[l]; - if(void 0===d)continue; - const f=!!s&&s.has(u.tribe); - for(let i=u.unitKindNums.length-1; - i>=0; - i--){ - const t=Math.floor(Math.max(0,d[i]??0)); - if(t<=0)continue; - const{ - kindNum:s,plusLevel:e} - =wP.getShiftedSoldierTier(u.unitKindNums,u.plusLevel,i,f); - s>0&&h[a].push({ - kindNum:s,count:t,plusLevel:e} - )} - } - return{ - heroes:e,heroTrans:n,soldierTiers:h} - } - async ensureMyTeamASquads(){ - var t; - if(this.cachedMyTeamASquads)return this.cachedMyTeamASquads; - const i=this.loadAttackSquadsFromLs(); - if(i)return this.cachedMyTeamASquads=i,i; - try{ - const i=await sD.getInstance().guildDefense.getMyTeams(this.warId||1,!1),s=((null==(t=null==i?void 0:i.body)?void 0:t.teams)??[]).find(t=>"A"===t.teamSlot); - return this.cachedMyTeamASquads=(null==s?void 0:s.squads)??null,this.cachedMyTeamASquads} - catch(frt){ - return null} - } - attackSquadsLsKey(){ - const t=TG.userId; - return t?`ef2.gw.attackSquads.${ - t} - `:null} - loadAttackSquadsFromLs(){ - const t=this.attackSquadsLsKey(); - if(!t)return null; - try{ - const i=localStorage.getItem(t); - return i?fwi(i)?i:(localStorage.removeItem(t),null):null} - catch{ - return null} - } - saveAttackSquadsToLs(t){ - const i=this.attackSquadsLsKey(); - if(i&&fwi(t))try{ - localStorage.setItem(i,t)} - catch(frt){ - } - } - async fetchHeaderInfo(t,i=""){ - var s,e; - try{ - if(!OD.hasGuild)return void this.renderEmpty(NB.getText("GAME_1063","길드에 가입해야 참여할 수 있습니다")); - const n=Date.now(); - if(!t&&n-this.lastInfoFetchAt<6e4){ - const t=Math.ceil((6e4-(n-this.lastInfoFetchAt))/1e3),i=NB.getText("GAME_1143","사용중 잠시 후 다시 시도해 주세요."),s=NB.getValueReplace("COMMON_550","##",t,`${ - t} - 초`); - return void bH.getInstance().showMessage(`${ - i} - (${ - s} - )`)} - let h=this.targetWarId; - if(null==h){ - const t=OD.isTournamenEntered?await sD.getInstance().guildWar.getCurrentTournament(OD.myGuildId,!1):await sD.getInstance().guildWar.getCurrent(OD.myGuildId,!1),i=(null==(s=null==t?void 0:t.body)?void 0:s.wars)??[]; - if(0===i.length)return void this.renderEmpty(NB.getText("GAME_1026","진행 중인 길드전이 없습니다.")); - const n=null==(e=i[0])?void 0:e.war; - h=n.id,this.targetWarId=h,this.targetWarStartAtMs=new Date(n.startAt).getTime()} - const r=""!=i,o=await sD.getInstance().guildWar.getBattleInfo(h,r,!1); - if(o&&!1===o.success&&"NOT_IN_GUILD"===o.error)return void OD.handleNotInGuild(); - const a=null==o?void 0:o.body; - if(!a)return void this.renderEmpty(NB.getText("GAME_1064","전투 정보 로드 실패")); - ""!=i&&i!=a.myGuildId&&([a.myCastles,a.oppCastles]=[a.oppCastles,a.myCastles],[a.mySlots,a.oppSlots]=[a.oppSlots,a.mySlots]),this.warId=a.warId,this.info=a,this.lastInfoFetchAt=n,this.buildPhasesFromBattleInfo(),this.readonlyMode?this.applyHeaderReadonly():this.applyHeader(),this.renderBoard(),this.renderBottom(),this.refreshStrategyAvailability(),0==r&&"opp"===this.side&&this.loadStrategyStrokesForCurrent(),this.fetchCombatLog(i)} - catch(frt){ - bH.getInstance().showMessage(NB.getText("GAME_1064","전투 정보 로드 실패"))} - finally{ - this.firstLoaded||(this.setContentVisible(!0),this.firstLoaded=!0)} - } - buildPhasesFromBattleInfo(){ - if(!this.info)return; - const t=new Set(this.info.inBattleSlotIds??[]); - this.oppPhases=this.buildPhasesForSide("opp",this.info.oppCastles,this.info.oppSlots,t),this.myPhases=this.buildPhasesForSide("me",this.info.myCastles,this.info.mySlots,t),0===this.oppPhases.length&&this.oppPhases.push(this.makeFreshBoard(1)),0===this.myPhases.length&&this.myPhases.push(this.makeFreshBoard(1)),this.oppViewPhase=Math.min(Math.max(1,this.oppViewPhase),this.oppPhases.length),this.myViewPhase=Math.min(Math.max(1,this.myViewPhase),this.myPhases.length),this.initialPhaseAutoApplied||(this.oppViewPhase=this.oppPhases.length,this.myViewPhase=this.myPhases.length,this.initialPhaseAutoApplied=!0)} - buildPhasesForSide(t,i,s,e){ - const n=Qt(t=>"number"==typeof t&&t>0?t:1,"phaseOf"),h=new Set; - for(const r of i)h.add(n(r.phase)); - for(const r of s)h.add(n(r.phase)); - return 0===h.size&&h.add(1),Array.from(h).sort((t,i)=>t-i).map(h=>{ - const r=this.makeFreshBoard(h); - for(const t of i){ - if(n(t.phase)!==h)continue; - const i=pwi[t.castleIndex]; - i&&t.capturedAt&&r.captured.add(i)} - const o=zpi.getInstance().getByPhase(h),a=new Map; - for(const i of s){ - if(n(i.phase)!==h)continue; - const s=pwi[i.castleIndex]; - if(!s)continue; - const c=(a.get(s)??0)+1; - a.set(s,c); - const l=qpi[s],u=o.getPlusLevel(l); - r.slots[s].push({ - slotId:i.slotId,slotIndex:i.slotIndex,displayNo:c,side:t,status:i.status,protectedUntil:i.protectedUntil?new Date(i.protectedUntil).toISOString():null,userId:i.uid,userName:i.userName,knightLevel:i.knightLevel,heroLevelBonus:u,teamSlot:i.teamSlot,squads:i.squads,barrackCounts:i.barrackCounts??{ - } - ,isMine:i.isMine,inBattle:e.has(i.slotId),killedBy:i.killedBy?{ - userId:i.killedBy.uid,userName:i.killedBy.userName,attackedAt:new Date(i.killedBy.attackedAt).toISOString()} - :void 0} - )} - for(const t of Ypi)r.slots[t].sort((t,i)=>t.slotIndex-i.slotIndex); - return r} - )} - renderEmpty(t){ - this.applyHeaderEmpty(),this.btnRefresh.visible=!1,this.bottomHeader.text=t,this.bottomHeader.textColor=16746632,this.bottomGateLine.text="",this.bottomMessage.text="",this.slotsList.visible=!1,this.combatLogList.visible=!1,this.memberStatusList.visible=!1,this.targetMarkerList.visible=!1,this.btnTargetEdit.visible=!1,this.setLogColumnHeaderVisible(!1),this.setMemberColumnHeaderVisible(!1),this.setTargetColumnHeaderVisible(!1),this.resetTargetEditState()} - currentBoard(){ - return this.currentPhases()[this.currentViewPhase()-1]} - currentPhases(){ - return"opp"===this.side?this.oppPhases:this.myPhases} - currentViewPhase(){ - return"opp"===this.side?this.oppViewPhase:this.myViewPhase} - setCurrentViewPhase(t){ - "opp"===this.side?this.oppViewPhase=t:this.myViewPhase=t} - totalScoreFor(t){ - return this.info?"opp"===t?this.info.myScore:this.info.oppScore:0} - canAttackInCurrentPhase(t){ - const i=this.currentBoard(); - if(i.captured.has(t))return!1; - const s=this.totalScoreFor(this.side),e=qpi[t]; - return!(s<zpi.getInstance().getByPhase(this.currentViewPhase()).getReqScore(e))&&("c"===e||Xpi[t].some(t=>i.captured.has(t)))} - isJoinedAfterWarStart(){ - var t; - const i=null==(t=OD.myMembershipVO)?void 0:t.joinedAt; - if(!i||!this.targetWarStartAtMs)return!1; - const s=new Date(i).getTime(); - return!(!Number.isFinite(s)||!Number.isFinite(this.targetWarStartAtMs))&&s>this.targetWarStartAtMs} - resetMockState(){ - this.oppPhases=[this.makeFreshBoard(1)],this.myPhases=[this.makeFreshBoard(1)],this.oppViewPhase=1,this.myViewPhase=1,this.initialPhaseAutoApplied=!1,this.mockCombatLog=[],this.cachedMyTeamASquads=null,this.resetTargetEditState()} - async fetchCombatLog(t=""){ - var i; - if(this.warId<=0)return; - const s=t||OD.myGuildId; - try{ - const t=await sD.getInstance().guildWar.getCombatLog(this.warId,120,!1),e=(null==(i=null==t?void 0:t.body)?void 0:i.entries)??[]; - this.mockCombatLog=e.map(t=>({ - id:t.id,defenderName:t.defenderName,defenderIsAlly:t.defenderGuildId===s,attackerName:t.attackerName,attackerIsAlly:t.attackerGuildId===s,castleId:t.castleId,phase:t.phase??1,result:t.result,createdAtMs:t.createdAtMs} - )),"log"===this.viewMode?this.combatLogList.dataProvider=this.buildLogRowsForCurrentSide():"list"===this.viewMode&&(this.memberStatusList.dataProvider=this.buildMemberStatusRowsForCurrentSide())} - catch(h6i){ - } - } - buildLogRowsForCurrentSide(){ - const t="opp"===this.side,i=this.mockCombatLog.filter(i=>t?i.attackerIsAlly:i.defenderIsAlly); - return i.map(i=>{ - const s=t?"WIN"===i.result:"LOSE"===i.result; - return{ - id:i.id,leftName:i.attackerName,leftIsAlly:i.attackerIsAlly,rightName:i.defenderName,rightIsAlly:i.defenderIsAlly,castleLabel:i.castleId.toUpperCase(),resultLabel:s?NB.getText("GAME_1061","성공"):NB.getText("GAME_1062","실패"),resultGood:s,timeLabel:this.formatHHMM(i.createdAtMs)} - } - )} - buildMemberStatusRowsForCurrentSide(){ - if(!this.info)return[]; - const t="me"===this.side,i=(t?this.info.mySlots:this.info.oppSlots)??[],s=new Map; - let e=0; - for(const r of i){ - const t=this.memberNameKey(r.userName); - s.has(t)||s.set(t,{ - name:r.userName,level:r.knightLevel,order:e++,attacks:[]} - )} - const n=this.mockCombatLog.filter(i=>i.attackerIsAlly===t).sort((t,i)=>t.createdAtMs-i.createdAtMs||t.id-i.id); - for(const r of n){ - const t=this.memberNameKey(r.attackerName); - let i=s.get(t); - i||(i={ - name:r.attackerName,level:0,order:e++,attacks:[]} - ,s.set(t,i)),i.attacks.push(r)} - const h=this.info.attacksMax??2; - return Array.from(s.values()).sort((t,i)=>t.order-i.order).map(t=>({ - nameLabel:this.formatMemberStatusName(t.name,t.level),remainingTickets:Math.max(0,h-t.attacks.length),attack1:t.attacks[0]?this.formatMemberStatusAttack(t.attacks[0]):this.emptyMemberStatusAttack(),attack2:t.attacks[1]?this.formatMemberStatusAttack(t.attacks[1]):this.emptyMemberStatusAttack()} - ))} - memberNameKey(t){ - return(t||"-").trim().toLowerCase()} - formatMemberStatusName(t,i){ - const s=(t||"-").trim()||"-"; - return`${ - s.length>8?`${ - s.substring(0,8)} - ...`:s} - (Lv.${ - i>0?String(i):"-"} - )`} - formatMemberStatusAttack(t){ - return{ - label:`${ - "s"===t.castleId?"S":`${ - t.castleId.toUpperCase()} - (${ - t.phase} - )`} - : ${ - "WIN"===t.result?"O":"X"} - `,result:t.result} - } - emptyMemberStatusAttack(){ - return{ - label:"-",result:null} - } - buildTargetMarkerRows(){ - if(!this.info||"opp"!==this.side)return[]; - const t=this.targetEditMode&&this.canEditTargetMarkers(); - return(this.info.oppSlots??[]).map(i=>({ - slotId:i.slotId,slotIndex:i.slotIndex,userName:i.userName,nameLabel:this.formatTargetName(i.userName,i.knightLevel),castleLabel:this.formatTargetCastle(i.castleIndex,i.phase),castleSort:this.targetCastleSortValue(i.castleIndex),phase:i.phase,marker:this.getDisplayedTargetMarker(i.slotId,i.targetMarker),editable:t} - )).sort((t,i)=>t.castleSort!==i.castleSort?t.castleSort-i.castleSort:t.phase!==i.phase?t.phase-i.phase:t.slotIndex!==i.slotIndex?t.slotIndex-i.slotIndex:t.userName.localeCompare(i.userName))} - formatTargetName(t,i){ - const s=(t||"-").trim()||"-"; - return`${ - s.length>8?`${ - s.substring(0,8)} - ...`:s} - (Lv.${ - i>0?String(i):"-"} - )`} - formatTargetCastle(t,i){ - const s=pwi[t]; - if(!s)return"-"; - const e=s.toUpperCase(); - return i>1?`${ - e} - (${ - i} - )`:e} - targetCastleSortValue(t){ - return Number.isFinite(t)&&t>0?t:999} - normalizeTargetMarker(t){ - const i=Number(t); - return Number.isInteger(i)&&i>=1&&i<=8?i:null} - getDisplayedTargetMarker(t,i){ - return this.pendingTargetMarkers.has(t)?this.pendingTargetMarkers.get(t)??null:this.normalizeTargetMarker(i)} - isTargetModeAvailable(){ - return!1} - isListModeAvailable(){ - return!this.isTournamentReadOnly&&"me"===this.side} - refreshTargetTabVisibility(){ - if(this.btnTabList){ - const t=this.isListModeAvailable(); - this.btnTabList.visible=t,t||(this.btnTabList.selected=!1)} - this.btnTabTarget&&(this.btnTabTarget.visible=!1,this.btnTabTarget.selected=!1)} - refreshTargetEditButton(){ - this.btnTargetEdit&&(this.btnTargetEdit.visible=!1)} - canEditTargetMarkers(){ - var t; - if(!this.isTargetModeAvailable())return!1; - const i=null==(t=OD.myMembershipVO)?void 0:t.role; - return"MASTER"===i||"SUB_MASTER"===i||"ELDER"===i} - async onTargetMarkerClick(t,i){ - if(!this.canEditTargetMarkers())return void bH.getInstance().showMessage(NB.getText("GUILD_WAR_TARGET_NO_PERMISSION","타겟 마크 편집 권한이 없습니다.")); - if(!this.info||this.warId<=0)return; - if(!this.targetEditMode)return void bH.getInstance().showMessage(NB.getText("GUILD_WAR_TARGET_EDIT_HINT","Edit 버튼을 눌러 편집하세요.")); - const s=t.marker===i?null:i; - this.setPendingTargetMarker(t.slotId,s),this.targetMarkerList.dataProvider=this.buildTargetMarkerRows()} - async onTargetEditButtonClick(){ - if(this.canEditTargetMarkers()){ - if("target"!==this.viewMode&&this.setViewMode("target"),!this.targetEditMode)return this.targetEditMode=!0,this.pendingTargetMarkers.clear(),this.refreshTargetEditButton(),void(this.targetMarkerList.dataProvider=this.buildTargetMarkerRows()); - await this.saveTargetMarkers()} - } - async saveTargetMarkers(){ - if(!this.info||this.warId<=0)return; - const t=Array.from(this.pendingTargetMarkers.entries()); - if(0===t.length)return this.resetTargetEditState(),this.refreshTargetEditButton(),void(this.targetMarkerList.dataProvider=this.buildTargetMarkerRows()); - try{ - for(const[i,s]of t)await sD.getInstance().guildWar.setTargetMarker(this.warId,i,s,!1); - for(const[i,s]of t)this.setLocalTargetMarker(i,s); - this.resetTargetEditState(),this.refreshTargetEditButton(),this.targetMarkerList.dataProvider=this.buildTargetMarkerRows()} - catch(h6i){ - this.targetMarkerList.dataProvider=this.buildTargetMarkerRows(),bH.getInstance().showMessage(NB.getText("GUILD_WAR_TARGET_SAVE_FAILED","타겟 마크 저장 실패"))} - } - setPendingTargetMarker(t,i){ - if(!this.info)return; - const s=(this.info.oppSlots??[]).find(i=>i.slotId===t); - this.normalizeTargetMarker(null==s?void 0:s.targetMarker)!==i?this.pendingTargetMarkers.set(t,i):this.pendingTargetMarkers.delete(t)} - setLocalTargetMarker(t,i){ - if(this.info)for(const s of this.info.oppSlots??[])if(s.slotId===t){ - s.targetMarker=i; - break} - } - resetTargetEditState(){ - this.targetEditMode=!1,this.pendingTargetMarkers.clear()} - formatHHMM(t){ - const i=new Date(t); - return`${ - String(i.getHours()).padStart(2,"0")} - :${ - String(i.getMinutes()).padStart(2,"0")} - `} - refreshLogColumnHeader(){ - const t="opp"===this.side,i=NB.getText("GAME_1059","아군"),s=NB.getText("GAME_1060","적군"); - this.logColLeft.text=t?i:s,this.logColRight.text=t?s:i,this.logColArrow.text="→"; - const e=20,n=lwi; - this.logColLeft.x=e+n.COL_LEFT_NAME_X,this.logColArrow.x=e+n.COL_ARROW_CX-this.logColArrow.width/2,this.logColRight.x=e+n.COL_RIGHT_NAME_X,this.logColCastle.x=e+n.COL_CASTLE_CX-this.logColCastle.width/2,this.logColResult.x=e+n.COL_RESULT_CX-this.logColResult.width/2,this.logColTime.x=e+n.COL_TIME_CX-this.logColTime.width/2} - setLogColumnHeaderVisible(t){ - this.logColLeft.visible=t,this.logColArrow.visible=t,this.logColRight.visible=t,this.logColCastle.visible=t,this.logColResult.visible=t,this.logColTime.visible=t} - refreshMemberColumnHeader(){ - const t=vwi; - this.memberColName.x=20+t.COL_NAME_X,this.memberColTicket.x=20+t.COL_TICKET_CX-this.memberColTicket.width/2,this.memberColAttack1.x=20+t.COL_ATTACK1_CX-this.memberColAttack1.width/2,this.memberColAttack2.x=20+t.COL_ATTACK2_CX-this.memberColAttack2.width/2} - setMemberColumnHeaderVisible(t){ - this.memberColName.visible=t,this.memberColTicket.visible=t,this.memberColAttack1.visible=t,this.memberColAttack2.visible=t} - refreshTargetColumnHeader(){ - const t=Mwi; - if(this.targetColName.x=20+t.COL_NAME_X,this.targetColCastle.x=20+t.COL_CASTLE_CX-this.targetColCastle.width/2,this.targetEditMode){ - const i=9*t.MARKER_W+8*t.MARKER_GAP; - this.targetColMarker.x=20+t.COL_MARKER_START_X+i/2-this.targetColMarker.width/2} - else this.targetColMarker.x=20+t.COL_MARKER_CX-this.targetColMarker.width/2} - setTargetColumnHeaderVisible(t){ - this.targetColName.visible=t,this.targetColCastle.visible=t,this.targetColMarker.visible=t} - makeFreshBoard(t){ - const i={ - } - ; - for(const s of Ypi)i[s]=[]; - return{ - phase:t,captured:new Set,slots:i} - } - canEditStrategy(){ - var t; - if(this.readonlyMode)return!1; - const i=null==(t=OD.myMembershipVO)?void 0:t.role; - return"MASTER"===i||"SUB_MASTER"===i||"ELDER"===i} - canClearAllStrategy(){ - var t; - if(this.readonlyMode)return!1; - const i=null==(t=OD.myMembershipVO)?void 0:t.role; - return"MASTER"===i||"SUB_MASTER"===i} - currentRole(){ - var t; - const i=null==(t=OD.myMembershipVO)?void 0:t.role; - return"MASTER"===i||"SUB_MASTER"===i||"ELDER"===i?i:null} - loadMyStrategyColor(){ - const t=TG.uid; - if(!t)return iwi[0]; - try{ - const i=localStorage.getItem(uwi+t); - if(!i)return iwi[0]; - const s=Number(i); - return Number.isFinite(s)?iwi.indexOf(s)<0?iwi[0]:s:iwi[0]} - catch{ - return iwi[0]} - } - loadStrategyShowPref(){ - const t=TG.uid; - if(!t)return!0; - try{ - const i=localStorage.getItem(dwi+t); - return null==i||"1"===i} - catch{ - return!0} - } - saveStrategyShowPref(t){ - const i=TG.uid; - if(i)try{ - localStorage.setItem(dwi+i,t?"1":"0")} - catch{ - } - } - saveMyStrategyColor(t){ - const i=TG.uid; - if(i)try{ - localStorage.setItem(uwi+i,String(t))} - catch{ - } - } - async loadStrategyStrokesForCurrent(){ - var t; - if(this.isTournamentReadOnly)return; - if(!this.strategyCanvas)return; - if(this.warId<=0)return void this.strategyCanvas.setStrokes([]); - const i=this.oppViewPhase; - if(!i||i<1)this.strategyCanvas.setStrokes([]); - else try{ - const s=await sD.getInstance().guildWar.getStrokes(this.warId,i),e=((null==(t=null==s?void 0:s.body)?void 0:t.strokes)??[]).map(t=>this.normalizeServerStroke(t)).filter(t=>null!==t); - this.strategyCanvas.setStrokes(e)} - catch(h6i){ - this.strategyCanvas.setStrokes([])} - } - normalizeServerStroke(t){ - if(!t||"object"!=typeof t)return null; - if("string"!=typeof t.type)return null; - const i={ - id:String(t.id),authorUid:String(t.authorUid??""),authorName:String(t.authorName??""),authorRole:String(t.authorRole??"ELDER"),color:Number(t.color)||0,createdAt:Number(t.createdAt)||Date.now()} - ,s=t.data; - return"pen"===t.type&&s&&Array.isArray(s.points)?{ - ...i,type:"pen",points:s.points} - :"circle"===t.type&&s?{ - ...i,type:"circle",cx:Number(s.cx),cy:Number(s.cy),r:Number(s.r)} - :"rect"===t.type&&s?{ - ...i,type:"rect",x:Number(s.x),y:Number(s.y),w:Number(s.w),h:Number(s.h)} - :null} - onStrategyStrokeFinalized(t){ - if(this.warId<=0)return!1; - const i=this.oppViewPhase; - return!(!i||i<1||(this.persistStroke(t,i),0))} - async persistStroke(t,i){ - var s,e,n; - try{ - const n=this.toServerStrokeInput(t),h=await sD.getInstance().guildWar.addStroke(this.warId,i,n),r=null==(s=null==h?void 0:h.body)?void 0:s.stroke; - if(!r||null==r.id)throw new Error("invalid addStroke response"); - const o=String(r.id); - null==(e=this.strategyCanvas)||e.replaceStrokeId(t.id,o)} - catch(h6i){ - null==(n=this.strategyCanvas)||n.removeStrokeById(t.id),bH.getInstance().showMessage(NB.getText("GAME_1180","작전펜 저장 실패 - 다시 시도해주세요."))} - } - toServerStrokeInput(t){ - return"pen"===t.type?{ - type:"pen",color:t.color,data:{ - points:t.points} - } - :"circle"===t.type?{ - type:"circle",color:t.color,data:{ - cx:t.cx,cy:t.cy,r:t.r} - } - :{ - type:"rect",color:t.color,data:{ - x:t.x,y:t.y,w:t.w,h:t.h} - } - } - onStrategyStrokeErased(t){ - if(this.warId<=0)return; - const i=Number(t.id); - !Number.isInteger(i)||i<=0||sD.getInstance().guildWar.deleteStroke(this.warId,i).catch(t=>{ - } - )} - isStrategyModeAvailable(){ - return this.canEditStrategy()&&"opp"===this.side&&this.warId>0} - applyStrategyMode(){ - const t=this.strategyCanvas; - if(!t)return; - if(this.isTournamentReadOnly)return this.lblOptStrategy.visible=!1,void(this.cbStrategyShow.visible=!1); - if(this.strategyMode){ - const i=TG.uid||"",s=TG.name||"",e=this.currentRole(); - t.setIdentity(i,s,e)} - t.setActive(this.strategyMode); - const i=!this.strategyMode; - this.cbScore&&(this.cbScore.visible=i),this.cbCastleName&&(this.cbCastleName.visible=i),this.cbStrategyShow&&(this.cbStrategyShow.visible=i),this.lblOptScore&&(this.lblOptScore.visible=i),this.lblOptName&&(this.lblOptName.visible=i),this.lblOptStrategy&&(this.lblOptStrategy.visible=i),this.strategyMode&&!this.showStrategyStrokes&&(this.showStrategyStrokes=!0,this.cbStrategyShow.selected=!0,this.saveStrategyShowPref(!0),t.setStrokesVisible(!0)),this.strategyToolbarBox.visible=this.strategyMode,this.btnTabStrategy&&(this.btnTabStrategy.selected=this.strategyMode),this.strategyMode?(this.bottomHeader.visible=!1,this.bottomMessage.visible=!1,this.bottomGateLine.visible=!1,this.bottomDetailAdj.visible=!1,this.bottomDetailScore.visible=!1,this.slotsList.visible=!1,this.combatLogList.visible=!1,this.memberStatusList.visible=!1,this.targetMarkerList.visible=!1,this.setLogColumnHeaderVisible(!1),this.setMemberColumnHeaderVisible(!1),this.setTargetColumnHeaderVisible(!1)):(this.bottomHeader.visible=!0,this.bottomMessage.visible=!0,this.bottomGateLine.visible=!0,this.bottomDetailAdj.visible=!0,this.bottomDetailScore.visible=!0),this.refreshStrategyClearAllButton()} - refreshStrategyAvailability(){ - if(!this.btnTabStrategy)return; - const t=this.isStrategyModeAvailable(); - this.btnTabStrategy.visible=t,t||"strategy"!==this.viewMode||(this.viewMode="battle",this.btnTabBattle.selected=!0,this.btnTabStrategy.selected=!1,this.strategyMode=!1,this.applyStrategyMode(),this.renderBottom())} - setStrategyTool(t){ - this.strategyCanvas&&(this.strategyCanvas.setTool(t),this.refreshStrategyToolButtons())} - setStrategyColor(t){ - this.strategyCanvas&&(this.myStrategyColor=t,this.strategyCanvas.setColor(t),this.saveMyStrategyColor(t),this.refreshStrategyColorSwatches())} - refreshStrategyToolButtons(){ - if(!this.strategyCanvas)return; - const t=this.strategyCanvas.getTool(); - for(const i of this.strategyToolBtns)i.btn.selected=i.tool===t} - refreshStrategyColorSwatches(){ - const t=this.myStrategyColor; - for(const i of this.strategyColorSwatches){ - const s=i.gfx; - s.clear(),s.circle(0,0,17).fill({ - color:i.color,alpha:1} - ),i.color===t?s.circle(0,0,17).stroke({ - width:4,color:16777215,alpha:1} - ):s.circle(0,0,17).stroke({ - width:1.5,color:2236962,alpha:.8} - )} - } - refreshStrategyClearAllButton(){ - this.btnStrategyClearAll&&(this.btnStrategyClearAll.visible=this.canClearAllStrategy())} - onStrategyUndo(){ - if(!this.strategyCanvas)return; - const t=TG.uid; - t&&(this.strategyCanvas.undoMine(t)||bH.getInstance().showMessage(NB.getText("GUILD_WAR_STRATEGY_UNDO_EMPTY","되돌릴 작업이 없습니다.")))} - async onStrategyClearAll(){ - if(!this.strategyCanvas)return; - if(!this.canClearAllStrategy())return; - if(this.warId<=0)return; - const t=this.oppViewPhase; - if(t&&!(t<1))if(0!==this.strategyCanvas.countStrokes())try{ - await sD.getInstance().guildWar.clearStrokes(this.warId,t,"all"); - const i=this.strategyCanvas.onStrokeErased; - this.strategyCanvas.onStrokeErased=null,this.strategyCanvas.clearAll(),this.strategyCanvas.onStrokeErased=i} - catch(h6i){ - bH.getInstance().showMessage(NB.getText("GUILD_WAR_STRATEGY_CLEAR_ALL_FAILED","전체 지우기 실패"))} - else bH.getInstance().showMessage(NB.getText("GUILD_WAR_STRATEGY_CLEAR_ALL_EMPTY","지울 작업이 없습니다."))} - onStrategySave(){ - bH.getInstance().showMessage(NB.getText("GAME_1179","저장되었습니다."))} - makeLabel(t,i,s){ - const e=new iG(t,s,hD.DEFAULT_OUTLINE_FONT_OPTION_16); - return e.textSize=i,e} - get className(){ - return"GuildWarBattlePopupV3"} - onCloseBtnClick(){ - super.onCloseBtnClick(),this.onHideHandler&&this.onHideHandler(),this.onHideHandler=null} - } - ; - Qt(bwi,"GuildWarBattlePopupV3"),Zt(bwi,"_instance"),Zt(bwi,"W",640),Zt(bwi,"HEADER_H",54),Zt(bwi,"TIER_SPRITE_SIZE",{ - s:4,a:3,b:2,c:1} - ),Zt(bwi,"CASTLE_Y_OFFSET_RATIO",.7),Zt(bwi,"CASTLE_GLOBAL_Y_OFFSET",-10),Zt(bwi,"FIRE_SCALE",{ - c:.8,b:.9,a:.95,s:1} - ),Zt(bwi,"CASTLE_ANCHOR",{ - 1:{ - x:.427184,y:.818182} - ,2:{ - x:.5,y:.852459} - ,3:{ - x:.417476,y:.848485} - ,4:{ - x:.40708,y:.862385} - ,5:{ - x:.40708,y:.851852} - } - ),Zt(bwi,"BUFF_BOX_W",300),Zt(bwi,"BUFF_BOX_H",164),Zt(bwi,"BUFF_BOX_PAD",14),Zt(bwi,"BUFF_BAR_W",272),Zt(bwi,"BUFF_BAR_H",20),Zt(bwi,"BUFF_BAR_Y",62),Zt(bwi,"CI_BOX_W",232),Zt(bwi,"CI_BOX_H",156),Zt(bwi,"CI_BOX_PAD",12); - let ywi=bwi; - const Ewi=Object.freeze(Object.defineProperty({ - __proto__:null,GuildWarBattlePopupV3:ywi} - ,Symbol.toStringTag,{ - value:"Module"} - )); - function Awi(t,i=!1){ - switch(t){ - case 1:return i?3809055:6959152; - case 2:return i?2046495:3107376; - case 3:return i?3088186:5910378; - case 4:return i?2043716:3167600; - default:return i?2236979:3158096} - } - Qt(Awi,"tribePanelColor"); - const Swi=class t{ - constructor(){ - Zt(this,"barrackKindNum",0),Zt(this,"tribe",0),Zt(this,"unitKindNums",[]),Zt(this,"plusLevel",[]),Zt(this,"counts",[]),Zt(this,"awakened",!1),Zt(this,"selected",!1),Zt(this,"usedByOther",!1),Zt(this,"usedByDefense",!1),Zt(this,"unlocked",!1),Zt(this,"openCost",0),Zt(this,"canBoost",!1),Zt(this,"canTrainPerStage",[]),Zt(this,"trainTimeSec",[]),Zt(this,"showBoost",!0),Zt(this,"raidCcMatched",[])} - static getVO(){ - return this.recycleList.pop()??new t} - static remove(t){ - t.barrackKindNum=0,t.tribe=0,t.unitKindNums=[],t.plusLevel=[],t.counts=[],t.awakened=!1,t.selected=!1,t.usedByOther=!1,t.usedByDefense=!1,t.unlocked=!1,t.openCost=0,t.canBoost=!1,t.canTrainPerStage=[],t.trainTimeSec=[],t.showBoost=!0,t.raidCcMatched=[],this.recycleList.push(t)} - static removeAll(t){ - for(const i of t)this.remove(i); - t.length=0} - } - ; - Qt(Swi,"GuildBarrackRowVO"),Zt(Swi,"recycleList",[]); - let Twi=Swi; - const Cwi=class t extends kx{ - constructor(){ - super(),Zt(this,"panel"),Zt(this,"slots",[]),Zt(this,"btnSelect"),Zt(this,"btnUnlock"),Zt(this,"btnBoost"),Zt(this,"defenseIcon"),Zt(this,"ccBadge"),this.panel=new ep,this.addChild(this.panel); - for(let t=0; - t<5; - t++){ - const i=this.buildSoldierSlot(); - i.cell.x=25+75*t,i.cell.y=2.5,this.slots.push(i)} - for(let t=4; - t>=0; - t--)this.addChild(this.slots[t].cell); - this.btnSelect=new nB("배치"),this.btnSelect.color=nB.BROWN,this.btnSelect.width=100,this.btnSelect.height=60,this.btnSelect.lbl.textSize=16,this.btnSelect.x=420,this.btnSelect.y=20,this.btnSelect.onClick=()=>this.onSelectClick(),this.addChild(this.btnSelect),this.btnBoost=new M$("UI_GEM",`${ - t.BOOST_GEM_COST} - `,NB.getText("GAME_984","가속")),this.btnBoost.labelOrder=M$.TEXT_FIRST,this.btnBoost.color=M$.BROWN,this.btnBoost.iconScale=.55,this.btnBoost.textLabel.textSize=14,this.btnBoost.width=100,this.btnBoost.height=60,this.btnBoost.x=524,this.btnBoost.y=20,this.btnBoost.onClick=()=>this.onBoostClick(),this.addChild(this.btnBoost),this.btnUnlock=new M$("UI_GEM","0",NB.getText("GAME_985","오픈")),this.btnUnlock.labelOrder=M$.TEXT_FIRST,this.btnUnlock.color=M$.RED,this.btnUnlock.iconScale=.6,this.btnUnlock.textLabel.textSize=15,this.btnUnlock.width=204,this.btnUnlock.height=60,this.btnUnlock.x=420,this.btnUnlock.y=20,this.btnUnlock.visible=!1,this.btnUnlock.onClick=()=>this.onUnlockClick(),this.addChild(this.btnUnlock),this.defenseIcon=new Xe(RS.getTexture("UI_Ekkorr","Icon_RedDot_Red")),this.defenseIcon.width=18,this.defenseIcon.height=18,this.defenseIcon.visible=!1,this.defenseIcon.eventMode="none",this.addChild(this.defenseIcon),this.ccBadge=new Ke,this.ccBadge.eventMode="none",this.ccBadge.visible=!1,this.addChild(this.ccBadge)} - buildSoldierSlot(){ - const t=new Ke,i=new c4; - i.scale.set(.67),i.hideLevel(),i.hideEnhance(),i.hideIcon(),t.addChild(i); - const s=new iG("0",16777215,{ - ...hD.DEFAULT_OUTLINE_FONT_OPTION_16,fontSize:14} - ); - s.textColor=16777215,t.addChild(s); - const e=new pg({ - text:"",style:new Jw({ - fontFamily:"Arial",fontSize:18,fontWeight:"bold",fill:16772710,stroke:{ - color:0,width:4} - } - )} - ); - e.anchor.set(1,0),e.eventMode="none",t.addChild(e); - const n=new iG("",hD.DEFAULT_COLOR,{ - ...hD.DEFAULT_OUTLINE_FONT_OPTION_16,fontSize:13} - ); - return t.addChild(n),{ - cell:t,icon:i,countLbl:s,transBadge:e,trainTimeLbl:n} - } - setData(t){ - this.data=t; - const i=!t.showBoost,s=i?.78:.67,e=i?0:-20,n=i?35:25,h=i?520:420,r=i?482:382,o=i?78:68,a=i?-7:-15,c=i?3:0,l=86*s; - this.panel.clear().roundRect(20,0,610,100,10).fill({ - color:Awi(t.tribe,!1),alpha:.6} - ); - for(let d=0; - d<5; - d++){ - const i=wP.getShiftedSoldierTier(t.unitKindNums,t.plusLevel,d,t.awakened).kindNum,h=this.slots[d]; - if(h.cell.x=n+d*(95+e),h.icon.scale.set(s),i>0)try{ - h.icon.setDataWithKindNum(i),h.icon.showIcon()} - catch{ - h.icon.hideIcon()} - else h.icon.hideIcon(); - h.icon.x=0,h.icon.y=8; - const r=t.unlocked&&(t.canTrainPerStage[d]??!1); - h.icon.alpha=r?1:.35; - const u=t.counts[d]??0; - if(h.countLbl.text=`${ - u} - `,h.countLbl.x=.5*(95-h.countLbl.width)+a,h.countLbl.y=8+l-h.countLbl.height-2,h.countLbl.alpha=r?1:.35,i>0){ - const i=d+(t.awakened?1:0); - h.transBadge.text="+".repeat(Math.max(0,i-1))} - else h.transBadge.text=""; - h.transBadge.x=o,h.transBadge.y=5,h.transBadge.alpha=r?1:.35; - const f=t.trainTimeSec[d]??0; - h.trainTimeLbl.text=r&&i>0&&f>0?this.formatTrainTime(f):"",h.trainTimeLbl.x=.5*(95-h.trainTimeLbl.width)+a,h.trainTimeLbl.y=68+c,h.trainTimeLbl.alpha=r?1:.35} - const u=t.showBoost?204:100; - this.btnUnlock.width=u,this.btnSelect.x=h,this.btnUnlock.x=h,this.btnBoost.x=h+100+4,this.defenseIcon.x=r,this.defenseIcon.y=6,this.defenseIcon.visible=t.usedByDefense,this.ccBadge.x=n+2,this.ccBadge.y=12.5,this.ccBadge.alpha=t.unlocked?1:.5,this.ccBadge.visible=bJt(this.ccBadge,t.raidCcMatched),t.unlocked?(this.btnUnlock.visible=!1,this.btnSelect.visible=!0,this.btnBoost.visible=t.showBoost,t.selected?(this.btnSelect.text=NB.getText("GAME_1081","배치됨"),this.btnSelect.color=nB.GREEN):t.usedByOther?(this.btnSelect.text=NB.getText("GAME_1142","사용중"),this.btnSelect.color=nB.BROWN):(this.btnSelect.text=NB.getText("GAME_1038","배치"),this.btnSelect.color=nB.BROWN),t.canBoost?(this.btnBoost.activated=!0,this.btnBoost.alpha=1):(this.btnBoost.activated=!1,this.btnBoost.alpha=.55)):(this.btnSelect.visible=!1,this.btnBoost.visible=!1,this.btnUnlock.visible=!0,this.btnUnlock.iconText=`${ - t.openCost} - `)} - onSelectClick(){ - const i=this.data; - i&&i.unlocked&&t.onSelect&&t.onSelect(i.barrackKindNum)} - onUnlockClick(){ - const i=this.data; - i&&!i.unlocked&&t.onUnlock&&t.onUnlock(i.barrackKindNum,i.openCost)} - onBoostClick(){ - const i=this.data; - i&&i.unlocked&&i.canBoost&&t.onBoost&&t.onBoost(i.barrackKindNum)} - async onClick(t,i){ - } - formatTrainTime(t){ - const i=Math.floor(t); - if(i<60)return`${ - i} - s`; - const s=Math.floor(i/60),e=i%60; - return e>0?`${ - s} - m ${ - e} - s`:`${ - s} - m`} - get height(){ - return 104} - } - ; - Qt(Cwi,"GuildBarrackRowItemRenderer"),Zt(Cwi,"onSelect",null),Zt(Cwi,"onUnlock",null),Zt(Cwi,"onBoost",null),Zt(Cwi,"BOOST_GEM_COST",100); - let Owi=Cwi; - const Iwi=class t extends YXt{ - constructor(){ - super(),Zt(this,"lblMyName"),Zt(this,"lblMyLevel"),Zt(this,"lblMyBonus"),Zt(this,"lblOppName"),Zt(this,"lblOppLevel"),Zt(this,"lblOppBonus"),Zt(this,"oppHeroIcons",[]),Zt(this,"oppSoldierIcons",[]),Zt(this,"vsImage"),Zt(this,"lblListHeader"),Zt(this,"heroSlotBtns",[]),Zt(this,"soldierSlotBtns",[]),Zt(this,"soldierCountLbls",[]),Zt(this,"soldierStageBadges",[]),Zt(this,"oppSoldierStageBadges",[]),Zt(this,"heroList"),Zt(this,"soldierList"),Zt(this,"btnBattle"),Zt(this,"btnCancel"),Zt(this,"squads",[]),Zt(this,"mode",0),Zt(this,"v3HiddenByMe",!1),Zt(this,"v3Ref",null),Zt(this,"selectedSlot",-1),Zt(this,"heroVOs",[]),Zt(this,"barrackVOs",[]),Zt(this,"defenseBarrackKinds",new Set),Zt(this,"requestPending",!1),Zt(this,"onBattleStart",null); - const i=Math.min(SS.safeHeight,1050); - this.bg.height=i,this.y=Math.max(0,SS.safeHeight-i); - this.lblMyName=new iG("",16755302,hD.DEFAULT_OUTLINE_FONT_OPTION_16),this.lblMyName.textColor=16755302,this.lblMyName.x=15,this.lblMyName.y=42,this.addChild(this.lblMyName),this.lblMyLevel=new iG("",13421772,hD.DEFAULT_OUTLINE_FONT_OPTION_16),this.lblMyLevel.textColor=13421772,this.lblMyLevel.x=15,this.lblMyLevel.y=64,this.addChild(this.lblMyLevel),this.lblMyBonus=new iG("",5635925,hD.DEFAULT_OUTLINE_FONT_OPTION_16),this.lblMyBonus.textColor=5635925,this.lblMyBonus.y=64,this.addChild(this.lblMyBonus),this.lblOppName=new iG("",16755302,hD.DEFAULT_OUTLINE_FONT_OPTION_16),this.lblOppName.textColor=16755302,this.lblOppName.y=42,this.addChild(this.lblOppName),this.lblOppLevel=new iG("",13421772,hD.DEFAULT_OUTLINE_FONT_OPTION_16),this.lblOppLevel.textColor=13421772,this.lblOppLevel.y=64,this.addChild(this.lblOppLevel),this.lblOppBonus=new iG("",16733525,hD.DEFAULT_OUTLINE_FONT_OPTION_16),this.lblOppBonus.textColor=16733525,this.lblOppBonus.y=64,this.addChild(this.lblOppBonus); - const s=.55*1.1*1.1,e=.506*1.1,n=4.791600000000007,h=this.bg.width/2,r=h-50-46-58.56400000000002-30,o=r-90,a=h+50+70,c=a+90; - this.vsImage=new Xe(RS.getTexture("UI_Ekkorr","UI_VS")),this.vsImage.scale.set(.5),this.vsImage.anchor.set(.5),this.vsImage.x=h,this.vsImage.y=231.282,this.addChild(this.vsImage); - const l=[{ - x:r,y:-20} - ,{ - x:r,y:100} - ,{ - x:r,y:220} - ,{ - x:o,y:40} - ,{ - x:o,y:160} - ]; - for(let p=0; - p<t.NUM_SLOTS; - p++){ - const t=l[p],i=102+t.y,h=new CJt; - h.scale=e,h.x=t.x+46,h.y=i+n,h.onClick=()=>this.onSoldierSlotClick(p),this.addChild(h),this.soldierSlotBtns.push(h); - const r=new iG("",16772744,{ - ...hD.DEFAULT_OUTLINE_FONT_OPTION_16,fontSize:13} - ); - r.textColor=16772744,r.visible=!1,r.eventMode="none",this.addChild(r),this.soldierCountLbls.push(r); - const o=new pg({ - text:"",style:new Jw({ - fontFamily:"Arial",fontSize:14,fontWeight:"bold",fill:16772710,stroke:{ - color:0,width:3} - } - )} - ); - o.anchor.set(1,0),o.eventMode="none",o.visible=!1,this.addChild(o),this.soldierStageBadges.push(o); - const a=new CJt; - a.scale=s,a.x=t.x+-24,a.y=i,a.onClick=()=>this.onHeroSlotClick(p),this.addChild(a),this.heroSlotBtns.push(a)} - const u=[{ - x:a,y:-20} - ,{ - x:a,y:100} - ,{ - x:a,y:220} - ,{ - x:c,y:40} - ,{ - x:c,y:160} - ]; - for(let p=0; - p<t.NUM_SLOTS; - p++){ - const t=u[p],i=102+t.y,h=new c4; - h.scale.set(e),h.hideLevel(),h.hideEnhance(),h.x=t.x-46,h.y=i+n,this.addChild(h),this.oppSoldierIcons.push(h); - const r=new pg({ - text:"",style:new Jw({ - fontFamily:"Arial",fontSize:14,fontWeight:"bold",fill:16772710,stroke:{ - color:0,width:3} - } - )} - ); - r.anchor.set(1,0),r.eventMode="none",r.visible=!1,this.addChild(r),this.oppSoldierStageBadges.push(r); - const o=new c4; - o.scale.set(s),o.hideLevel(),o.hideEnhance(),o.x=t.x+12,o.y=i,this.addChild(o),this.oppHeroIcons.push(o)} - this.lblListHeader=this.makeLabel(`+ ${ - NB.getText("GAME_563","영웅 선택")} - `,16,16763904),this.lblListHeader.x=15,this.lblListHeader.y=396.564,this.addChild(this.lblListHeader); - const d=this.lblListHeader.y+this.lblListHeader.height+6,f=i-d-80; - this.heroList=new C4(SJt,630,f),this.heroList.x=5,this.heroList.y=d,this.addChild(this.heroList),this.soldierList=new C4(Owi,630,f),this.soldierList.x=-5,this.soldierList.y=d,this.soldierList.visible=!1,this.addChild(this.soldierList),this.btnCancel=new nB(NB.getText("COMMON_2","취소")),this.btnCancel.color=nB.BROWN,this.btnCancel.width=180,this.btnCancel.height=50,this.btnCancel.x=.5*this.bg.width-this.btnCancel.width-10,this.btnCancel.y=i-65,this.btnCancel.onClick=()=>this.hide(),this.addChild(this.btnCancel),this.btnBattle=new nB(NB.getText("COMMON_378","전투")),this.btnBattle.color=nB.RED,this.btnBattle.width=180,this.btnBattle.height=50,this.btnBattle.x=.5*this.bg.width+10,this.btnBattle.y=i-65,this.btnBattle.onClick=()=>this.onBattleClick(),this.addChild(this.btnBattle)} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - async open(i,s,e,n=1,h=0){ - var r,o; - this.bindListCallbacks(),this.onBattleStart=e,this.requestPending=!1,this.defenseBarrackKinds=new Set,this.lblMyName.text=TG.name??""; - const a=Math.floor(TG.maxWave/100); - this.lblMyLevel.text=`Lv.${ - a} - `; - const c=Math.max(0,Math.floor(h)||0); - this.lblMyBonus.text=c>0?`+${ - c} - `:"",this.lblMyBonus.visible=c>0,this.lblMyBonus.visible&&(this.lblMyBonus.x=this.lblMyLevel.x+this.lblMyLevel.width+4); - const l=await sD.getInstance().guildWar.getAwakenedTribes(i.userId),u=(null==(r=null==l?void 0:l.body)?void 0:r.awakenedTribes)??[]; - this.lblOppName.text=i.userName??"",this.lblOppLevel.text=`Lv.${ - i.knightLevel??0} - `; - const d=i.heroLevelBonus??0; - this.lblOppBonus.text=d>0?`+${ - d} - `:"",this.lblOppBonus.visible=d>0; - const f=this.bg.width-20; - this.lblOppName.x=f-this.lblOppName.width; - const p=this.lblOppBonus.visible?this.lblOppBonus.width+4:0; - this.lblOppLevel.x=f-this.lblOppLevel.width-p,this.lblOppBonus.visible&&(this.lblOppBonus.x=this.lblOppLevel.x+this.lblOppLevel.width+4); - const w=this.parseSquadHeroes(i.squads),g=BB.getInstance(); - for(let v=0; - v<t.NUM_SLOTS; - v++){ - const t=this.oppHeroIcons[v],s=this.oppSoldierIcons[v],e=w[v]; - if(e&&e.heroKindNum>0)try{ - t.setDataWithKindNum(e.heroKindNum,e.heroTrans),t.showIcon()} - catch{ - t.hideIcon()} - else t.hideIcon(); - const n=(null==e?void 0:e.barrackKindNum)??0,h=this.oppSoldierStageBadges[v]; - if(n>0){ - const t=g.getBook(n),e=null==(o=i.barrackCounts)?void 0:o[n],r=this.getRepresentativeSoldierStageIndex(e),a=this.getSoldierKindAt(null==t?void 0:t.unitKindNums,r),c=!!t&&u.indexOf(t.tribe)>-1; - if(a>0)try{ - s.setDataWithKindNum(a),s.showIcon(); - const t=this.shiftedStageBadge(r,c); - t?(h.text=t,h.x=s.x+s.width-12,h.y=s.y+2,h.visible=!0):h.visible=!1} - catch{ - s.hideIcon(),h.visible=!1} - else s.hideIcon(),h.visible=!1} - else s.hideIcon(),h.visible=!1} - const m=BB.getInstance(); - if(!m.hasStates())try{ - const t=await sD.getInstance().guildBarracks.getAll(!0),i=(null==t?void 0:t.body)??t; - (null==i?void 0:i.states)&&m.setStates(i.states)} - catch(frt){ - } - this.defenseBarrackKinds=await this.loadDefenseBarrackKinds(n),this.squads=[]; - for(let v=0; - v<t.NUM_SLOTS; - v++)this.squads.push({ - heroKindNum:-1,heroTrans:0,barrackKindNum:0} - ); - if(s&&s.length>0){ - const i=s.split("|"),e=new Map,n=BB.getInstance(); - for(let s=0; - s<Math.min(i.length,t.NUM_SLOTS); - s++){ - const[t,h,r]=i[s].split("-").map(Number); - if(t>0){ - const i=h||0,o=`${ - t} - _${ - i} - `,a=this.totalOwned(t,i),c=e.get(o)??0; - if(c<a){ - this.squads[s].heroKindNum=t,this.squads[s].heroTrans=i; - let h=r||0; - if(h>0){ - const i=this.heroTribe(t),s=n.getState(i),e=new Set((null==s?void 0:s.unlockedKinds)??[]); - Math.ceil(h/4)===i&&e.has(h)||(h=0)} - this.squads[s].barrackKindNum=h,e.set(o,c+1)} - } - } - } - this.bindListCallbacks(),SJt.skillCodeMap=null,this.selectedSlot=-1,this.setMode(0),this.refreshSlots(),this.refreshList(),LG.getInstance().addPopup(this),this.dimOverlay.visible=!1,await this.hideV3IfVisible()} - bindListCallbacks(){ - SJt.onHeroClick=(t,i)=>this.onHeroPick(t,i),Owi.onSelect=t=>this.onBarrackPick(t),Owi.onUnlock=(t,i)=>{ - this.onBarrackUnlock(t,i)} - ,Owi.onBoost=t=>this.onBarrackBoostConfirm(t)} - async hideV3IfVisible(){ - if(this.v3HiddenByMe)return; - const{ - GuildWarBattlePopupV3:t} - =await ei(async()=>{ - const{ - GuildWarBattlePopupV3:t} - =await Promise.resolve().then(()=>Ewi); - return{ - GuildWarBattlePopupV3:t} - } - ,void 0),i=t.getInstance(); - i.parent&&i.visible&&(i.visible=!1,this.v3Ref=i,this.v3HiddenByMe=!0,YXt.refreshDimVisibility())} - setMode(t){ - this.mode=t,this.heroList.visible=0===t,this.soldierList.visible=1===t,this.lblListHeader.text=0===t?`+ ${ - NB.getText("GAME_563","영웅 선택")} - `:`+ ${ - NB.getText("GAME_1087","병사 선택")} - `} - refreshSlots(){ - for(let i=0; - i<t.NUM_SLOTS; - i++){ - const t=this.squads[i],s=this.heroSlotBtns[i],e=this.soldierSlotBtns[i],n=eR.getVO(); - t.heroKindNum>0?(n.kindNum=t.heroKindNum,n.trans=t.heroTrans,n.level=1,s.setDataWith(i,n),s.hideLevel(),s.hideEnhance(),s.setAlphaToFrame(this.isHeroSlotSelected(i)?1:.85),s.selected=this.isHeroSlotSelected(i)):(n.kindNum=-1,s.setDataWith(i,n),s.hideBackground(),s.setAlphaToFrame(this.isHeroSlotSelected(i)?.9:.4),s.selected=!1); - const h=eR.getVO(),r=this.soldierCountLbls[i],o=this.soldierStageBadges[i]; - if(t.barrackKindNum>0){ - const s=BB.getInstance(),n=s.getBook(t.barrackKindNum),a=n?s.getState(n.tribe):null,c=n&&a?s.computeInstructorsForBarrack(n):null,l=n&&a&&c?s.computeSoldiers(n,a,c):null,u=this.getRepresentativeSoldierStageIndex(l??void 0),d=!!n&&wP.getAwakenedBarrackTribes().has(n.tribe),f=this.getDisplaySoldierKind(null==n?void 0:n.unitKindNums,null==n?void 0:n.plusLevel,u,d); - if(f>0){ - if(h.kindNum=f,h.trans=0,h.level=1,e.setDataWith(i,h),e.hideLevel(),e.hideEnhance(),e.setAlphaToFrame(this.isSoldierSlotSelected(i)?1:.85),e.selected=this.isSoldierSlotSelected(i),l){ - const t=l.reduce((t,i)=>t+i,0); - r.text=`${ - t} - `; - const i=31; - r.x=e.x+i-r.width/2,r.y=e.y-r.height+47,r.visible=!0} - else r.visible=!1; - const t=this.shiftedStageBadge(u,d); - t?(o.text=t,o.x=e.x+e.width-12,o.y=e.y+2,o.visible=!0):o.visible=!1} - else h.kindNum=-1,e.setDataWith(i,h),e.hideBackground(),e.setAlphaToFrame(.4),r.visible=!1,o.visible=!1} - else h.kindNum=-1,e.setDataWith(i,h),e.hideBackground(),e.setAlphaToFrame(this.isSoldierSlotSelected(i)?.9:.4),e.selected=!1,r.visible=!1,o.visible=!1} - } - getSoldierKindAt(t,i){ - if(!t||0===t.length)return-1; - const s=t[i]; - return s&&s>0?s:t.find(t=>t>0)??-1} - stageBadgeText(t){ - return 2===t?"+":3===t?"++":4===t?"+++":""} - getDisplaySoldierKind(t,i,s,e){ - if(e&&t&&i){ - const e=wP.getShiftedSoldierTier(t,i,s,!0).kindNum; - if(e>0)return e} - return this.getSoldierKindAt(t,s)} - shiftedStageBadge(t,i){ - const s=t+(i?1:0); - return"+".repeat(Math.max(0,s-1))} - getRepresentativeSoldierStageIndex(t){ - if(!t||0===t.length)return 0; - let i=0,s=0; - for(let e=0; - e<5; - e++){ - const n=Math.max(0,Number(t[e]??0)); - !Number.isFinite(n)||n<=0||(i+=n,s+=n*(e+1))} - return i<=0?0:Math.max(0,Math.min(4,Math.round(s/i)-1))} - isHeroSlotSelected(t){ - return 0===this.mode&&this.selectedSlot===t} - isSoldierSlotSelected(t){ - return 1===this.mode&&this.selectedSlot===t} - onHeroSlotClick(t){ - this.setMode(0),this.selectedSlot=this.selectedSlot===t?-1:t,this.refreshSlots(),this.refreshList()} - onSoldierSlotClick(t){ - this.squads[t].heroKindNum<=0?bH.getInstance().showMessage(NB.getText("GAME_1088","먼저 영웅을 선택하세요")):(this.setMode(1),this.selectedSlot=t,this.refreshSlots(),this.refreshList())} - refreshList(){ - 0===this.mode?this.refreshHeroList():this.refreshSoldierList()} - refreshHeroList(){ - EJt.removeAll(this.heroVOs); - const t=iR.getInstance(),i=new Map; - for(const n of this.squads){ - if(n.heroKindNum<=0)continue; - const t=`${ - n.heroKindNum} - _${ - n.heroTrans} - `; - i.set(t,(i.get(t)??0)+1)} - const s=Qt(i=>{ - if(i>=1e4)return!1; - const s=t.getBookVO(i); - return!(!s||(s.grade??0)<5||0===this.unlockedBarracksOfTribe(s.tribe).length)} - ,"eligible"),e=new Map; - for(const n of t.list){ - if(!s(n.kindNum))continue; - const t=`${ - n.kindNum} - _${ - n.trans} - `; - e.set(t,(e.get(t)??0)+1)} - for(const n of t.ownedUnitList)if(s(n.kindNum)){ - if(n.count>0){ - const t=`${ - n.kindNum} - _0`; - e.set(t,(e.get(t)??0)+n.count)} - for(let t=0; - t<n.trans.length; - t++)if(n.trans[t]>0){ - const i=`${ - n.kindNum} - _${ - t+1} - `; - e.set(i,(e.get(i)??0)+n.trans[t])} - } - this.heroVOs.push(EJt.set(EJt.getVO(),-1,0,0,0)); - for(const[n,h]of e){ - const[t,s]=n.split("_"),e=Number(t),r=Number(s),o=i.get(n)??0; - this.heroVOs.push(EJt.set(EJt.getVO(),e,r,h-o,h))} - this.heroVOs.sort((i,s)=>{ - if(i.kindNum<=0)return-1; - if(s.kindNum<=0)return 1; - const e=t.getBookVO(i.kindNum),n=t.getBookVO(s.kindNum); - if(!e||!n)return 0; - const h=1e12*e.grade-1e9*e.evolStage+1e6*i.trans-e.tribe; - return 1e12*n.grade-1e9*n.evolStage+1e6*s.trans-n.tribe-h} - ),this.heroList.dataProvider=Dx.chunkArray(this.heroVOs,7)} - refreshSoldierList(){ - if(Twi.removeAll(this.barrackVOs),this.selectedSlot<0)return void(this.soldierList.dataProvider=[]); - const t=this.squads[this.selectedSlot]; - if(t.heroKindNum<=0)return void(this.soldierList.dataProvider=[]); - const i=this.heroTribe(t.heroKindNum),s=BB.getInstance(),e=s.getState(i); - if(!e)return void(this.soldierList.dataProvider=[]); - const n=s.getBooksByTribe(i).slice().sort((t,i)=>t.kindNum-i.kindNum),h=new Set(e.unlockedKinds),r=new Set; - for(let o=0; - o<this.squads.length; - o++){ - if(o===this.selectedSlot)continue; - const t=this.squads[o].barrackKindNum; - t>0&&r.add(t)} - for(const o of n){ - const n=o.kindNum,a=h.has(n),c=Twi.getVO(); - if(c.barrackKindNum=n,c.tribe=i,c.unitKindNums=o.unitKindNums.slice(),c.plusLevel=o.plusLevel.slice(),c.awakened=wP.getAwakenedBarrackTribes().has(i),c.unlocked=a,c.openCost=o.openCost,c.canTrainPerStage=[],a){ - const i=s.computeInstructorsForBarrack(o); - c.counts=s.computeSoldiers(o,e,i).slice(),c.selected=t.barrackKindNum===n,c.usedByOther=!c.selected&&r.has(n),c.usedByDefense=this.defenseBarrackKinds.has(n),c.canBoost=s.canBoostBarrack(o,e,i,3600),c.trainTimeSec=[]; - for(let t=0; - t<5; - t++)c.canTrainPerStage.push(s.canTrainStage(o,t,i)),c.trainTimeSec.push(s.computeActualTrainingTime(o,t))} - else c.counts=[0,0,0,0,0],c.selected=!1,c.usedByOther=!1,c.usedByDefense=!1,c.canBoost=!1,c.canTrainPerStage=[!1,!1,!1,!1,!1],c.trainTimeSec=[0,0,0,0,0]; - this.barrackVOs.push(c)} - this.soldierList.dataProvider=this.barrackVOs} - async onBarrackUnlock(t,i){ - if(TG.gem<i)return void bH.getInstance().showMessage(NB.getText("COMMON_352","보석이 부족합니다.")); - const s=Math.ceil(t/4); - try{ - const e=await sD.getInstance().guildBarracks.unlockKind(s,t,!0),n=(null==e?void 0:e.body)??e; - BB.getInstance().applyMutationResult(n),TG.updateGem(-i),LH.getInstance().updateGem(),this.refreshSoldierList()} - catch{ - bH.getInstance().showMessage(NB.getText("GAME_1128","병영 개방 실패"))} - } - onBarrackBoostConfirm(i){ - if(TG.gem<t.BOOST_GEM_COST)return void bH.getInstance().showMessage(NB.getText("COMMON_352","보석이 부족합니다.")); - const s=NKt.getInstance(); - s.title=NB.getText("COMMON_4","알림"),s.textAlignCenter=!0,s.show(NB.getValueReplace("GAME_1127","##",t.BOOST_GEM_COST,`보석 ${ - t.BOOST_GEM_COST} - 개를 이용해서,\n병사훈련을 1시간동안 가속하시겠습니까?`),()=>{ - this.onBarrackBoost(i)} - ),s.y=480} - async onBarrackBoost(i){ - const s=Math.ceil(i/4); - try{ - const e=await sD.getInstance().guildBarracks.boost(s,i,"war",!0),n=(null==e?void 0:e.body)??e; - BB.getInstance().applyMutationResult(n),TG.updateGem(-t.BOOST_GEM_COST),LH.getInstance().updateGem(),this.refreshSlots(),this.refreshSoldierList()} - catch{ - bH.getInstance().showMessage(NB.getText("GAME_1144","가속 실패"))} - } - async loadDefenseBarrackKinds(t){ - var i; - try{ - const s=await sD.getInstance().guildDefense.getMyTeams(t||1,!1),e=((null==(i=null==s?void 0:s.body)?void 0:i.teams)??[]).find(t=>"A"===t.teamSlot); - return this.extractBarrackKinds((null==e?void 0:e.squads)??"")} - catch(frt){ - return new Set} - } - extractBarrackKinds(t){ - const i=new Set; - if(!t)return i; - for(const s of t.split("|")){ - const[,,t]=s.split("-"),e=Number(t); - Number.isFinite(e)&&e>0&&i.add(e)} - return i} - onHeroPick(i,s){ - if(i<=0)return void(this.selectedSlot>=0&&(this.squads[this.selectedSlot]={ - heroKindNum:-1,heroTrans:0,barrackKindNum:0} - ,this.selectedSlot=(this.selectedSlot+1)%t.NUM_SLOTS,this.refreshSlots(),this.refreshList())); - const e=this.heroTribe(i),n=this.unlockedBarracksOfTribe(e); - if(0===n.length)return void bH.getInstance().showMessage(NB.getText("GAME_1129","이 종족의 해금된 병영이 없습니다")); - let h=0; - for(const t of this.squads)t.heroKindNum===i&&t.heroTrans===s&&h++; - if(h>=this.totalOwned(i,s))return void bH.getInstance().showMessage(NB.getText("GAME_1089","이 영웅은 더 배치할 수 없습니다")); - let r=this.selectedSlot; - if((r<0||r>=t.NUM_SLOTS)&&(r=this.squads.findIndex(t=>t.heroKindNum<=0)),r<0)return void bH.getInstance().showMessage(NB.getText("GAME_1131","슬롯이 가득 찼습니다")); - const o=this.squads[r]; - let a=o.barrackKindNum; - if(o.barrackKindNum>0&&Math.ceil(o.barrackKindNum/4)!==e&&(a=0),0===a){ - const t=new Set; - for(let i=0; - i<this.squads.length; - i++)i!==r&&this.squads[i].barrackKindNum>0&&t.add(this.squads[i].barrackKindNum); - a=n.find(i=>!t.has(i))??0} - this.squads[r]={ - heroKindNum:i,heroTrans:s,barrackKindNum:a} - ,this.selectedSlot=(r+1)%t.NUM_SLOTS,this.refreshSlots(),this.refreshList()} - onBarrackPick(t){ - if(this.selectedSlot<0)return; - const i=this.squads[this.selectedSlot]; - if(i.heroKindNum<=0)return; - const s=this.heroTribe(i.heroKindNum); - if(Math.ceil(t/4)===s){ - for(let i=0; - i<this.squads.length; - i++)i!==this.selectedSlot&&this.squads[i].barrackKindNum===t&&(this.squads[i].barrackKindNum=0); - i.barrackKindNum=t,this.refreshSlots(),this.refreshSoldierList()} - else bH.getInstance().showMessage(NB.getText("GAME_1130","같은 종족 병영만 선택 가능합니다"))} - heroTribe(t){ - var i; - return(null==(i=iR.getInstance().getBookVO(t))?void 0:i.tribe)??0} - unlockedBarracksOfTribe(t){ - if(t<1||t>4)return[]; - const i=BB.getInstance().getState(t); - return i?i.unlockedKinds.slice().sort((t,i)=>t-i):[]} - totalOwned(t,i){ - const s=iR.getInstance(); - let e=0; - for(const h of s.list)h.kindNum===t&&h.trans===i&&e++; - const n=s.getOwnedUnitVO(t); - return n&&(e+=0===i?n.count:n.trans[i-1]??0),e} - parseSquadHeroes(t){ - const i=[null,null,null,null,null]; - if(!t)return i; - const s=t.split("|"); - for(let e=0; - e<Math.min(5,s.length); - e++){ - const[t,n,h]=s[e].split("-").map(Number); - t>0&&(i[e]={ - heroKindNum:t,heroTrans:n||0,barrackKindNum:h||0} - )} - return i} - async onBattleClick(){ - if(this.requestPending)return; - let i=0; - for(let e=0; - e<t.NUM_SLOTS; - e++)this.squads[e].heroKindNum>0&&i++; - if(0===i)return void bH.getInstance().showMessage(NB.getText("GAME_1132","영웅을 1명 이상 배치하세요")); - const s=this.squads.map(t=>t.heroKindNum>0?`${ - t.heroKindNum} - -${ - t.heroTrans} - -${ - t.barrackKindNum} - `:"0-0-0").join("|"); - if(this.onBattleStart){ - this.requestPending=!0; - try{ - await this.onBattleStart(s),this.hide()} - catch(frt){ - } - finally{ - this.requestPending=!1} - } - else this.hide()} - hide(){ - LG.getInstance().removePopup(this),this.v3HiddenByMe&&this.v3Ref&&(this.v3HiddenByMe=!1,this.v3Ref.visible=!0,this.v3Ref=null,YXt.refreshDimVisibility())} - makeLabel(t,i,s){ - return new iG(t,s,{ - ...hD.DEFAULT_OUTLINE_FONT_OPTION_16,fontSize:i} - )} - get className(){ - return"GuildWarBattleReadyPopup"} - } - ; - Qt(Iwi,"GuildWarBattleReadyPopup"),Zt(Iwi,"_instance"),Zt(Iwi,"NUM_SLOTS",5),Zt(Iwi,"BOOST_GEM_COST",100); - let kwi=Iwi; - const xwi=Object.freeze(Object.defineProperty({ - __proto__:null,GuildWarBattleReadyPopup:kwi} - ,Symbol.toStringTag,{ - value:"Module"} - )),Rwi=class t extends XU{ - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - constructor(){ - super(),this.outSideClickHide=!0,this.width=t.POPUP_WIDTH,this.buildContent()} - buildContent(){ - let i=t.TOP_OFFSET+8; - i+=this.addSectionHeader(NB.getText("GAME_1136","방어팀 슬롯 순서"),NB.getText("GAME_1137","방어팀 부대 번호는 왼쪽부터 순서대로 1, 2, 3, 4, 5입니다."),i); - const s=t.HEX_W,e=s+32; - { - const n=4*e,h=(t.POPUP_WIDTH-n)/2; - for(let t=0; - t<5; - t++)this.drawSlot(h+t*e,i+s/2,t+1); - i+=s+t.SECTION_GAP} - i+=this.addSectionHeader(NB.getText("GAME_1138","세로형 전투 배치"),NB.getText("GAME_1139","세로형 전투에서는 아래 그림과 같이 1, 2, 3 부대는 앞열, 4, 5 부대는 뒷열에 배치됩니다."),i); - { - const n=2*e,h=(t.POPUP_WIDTH-n)/2,r=e,o=(t.POPUP_WIDTH-r)/2; - this.drawSlot(o,i+s/2,4),this.drawSlot(o+e,i+s/2,5); - const a=i+s+22; - this.drawSlot(h,a+s/2,1),this.drawSlot(h+e,a+s/2,2),this.drawSlot(h+2*e,a+s/2,3),i=a+s+t.SECTION_GAP} - i+=this.addSectionHeader(NB.getText("GAME_1140","가로형 전투 배치"),NB.getText("GAME_1141","가로형 전투에서는 아래 그림과 같이 1, 2, 3 부대는 앞열, 4, 5 부대는 뒷열에 배치됩니다."),i); - { - const e=s+18,n=.36*t.POPUP_WIDTH,h=.64*t.POPUP_WIDTH; - this.drawSlot(n,i+s/2,1),this.drawSlot(n,i+s/2+e,2),this.drawSlot(n,i+s/2+2*e,3),this.drawSlot(h,i+s/2+.5*e,4),this.drawSlot(h,i+s/2+1.5*e,5),i+=3*e+4} - this.height=i+24} - addSectionHeader(i,s,e){ - const n=new iG(`# ${ - i} - `,16763904,hD.DEFAULT_OUTLINE_FONT_OPTION_16); - n.x=25,n.y=e,this.contentContainer.addChild(n); - const h=new iG(s,13421772,hD.DEFAULT_OUTLINE_FONT_OPTION_16); - return h.setWrapWidth(t.POPUP_WIDTH-50),h.x=25,h.y=e+n.height+2,this.contentContainer.addChild(h),n.height+h.height+10} - drawSlot(i,s,e){ - const n=t.HEX_W,h=t.HEX_H,r=[i+n/2,s,i+n/4,s+h/2,i-n/4,s+h/2,i-n/2,s,i-n/4,s-h/2,i+n/4,s-h/2],o=new ep; - o.poly(r).fill({ - color:t.HEX_FILL} - ).stroke({ - width:t.HEX_STROKE_W,color:t.HEX_STROKE} - ),this.contentContainer.addChild(o); - const a=new pg({ - text:String(e),style:{ - fontFamily:"Arial",fontSize:26,fontWeight:"700",fill:t.NUM_COLOR,stroke:{ - color:0,width:3} - } - } - ); - a.anchor.set(.5),a.x=i,a.y=s,this.contentContainer.addChild(a)} - async showGuide(){ - this.title=NB.getText("GAME_1135","배치 안내"),await this.loadImage(),super.show()} - getDefaultPositionY(){ - return.47*SS.stageHeight} - onBackButton(){ - return this.hide(),!0} - } - ; - Qt(Rwi,"DefenseFormationGuidePopup"),Zt(Rwi,"_instance"),Zt(Rwi,"POPUP_WIDTH",620),Zt(Rwi,"TOP_OFFSET",60),Zt(Rwi,"SECTION_GAP",18),Zt(Rwi,"HEX_W",56),Zt(Rwi,"HEX_H",56),Zt(Rwi,"HEX_FILL",2039583),Zt(Rwi,"HEX_STROKE",16763904),Zt(Rwi,"HEX_STROKE_W",2),Zt(Rwi,"NUM_COLOR",16777215); - let Pwi=Rwi; - const Nwi=class t extends YXt{ - constructor(){ - super(),Zt(this,"lblTitle"),Zt(this,"lblHeroHeader"),Zt(this,"lblSoldierHeader"),Zt(this,"lblHint1"),Zt(this,"lblHint2"),Zt(this,"heroSlotBtns",[]),Zt(this,"soldierSlotBtns",[]),Zt(this,"soldierCountLbls",[]),Zt(this,"soldierStageBadges",[]),Zt(this,"heroCcBadges",[]),Zt(this,"soldierCcBadges",[]),Zt(this,"heroList"),Zt(this,"soldierList"),Zt(this,"btnSave"),Zt(this,"btnCancel"),Zt(this,"lblListHeader"),Zt(this,"btnGuide"),Zt(this,"btnClearAll"),Zt(this,"squads",[]),Zt(this,"mode",0),Zt(this,"boostEnabled",!1),Zt(this,"raidVulns",null),Zt(this,"raidOrder",!1),Zt(this,"pool","war"),Zt(this,"selectedSlot",-1),Zt(this,"heroVOs",[]),Zt(this,"barrackVOs",[]),Zt(this,"onSaved",null); - const i=Math.min(SS.safeHeight,880); - this.bg.height=i,this.y=Math.max(0,SS.safeHeight-i),this.lblTitle=new iG("편성",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_17),this.lblTitle.x=15,this.lblTitle.y=52,this.addChild(this.lblTitle),this.btnGuide=new HU("UI_Ekkorr","UI_Alarm"),this.btnGuide.on("pointertap",()=>{ - Pwi.getInstance().showGuide()} - ),this.btnGuide.visible=!1,this.addChild(this.btnGuide),this.btnClearAll=new nB(NB.getText("GAME_1620","모두 비우기")),this.btnClearAll.color=nB.BROWN,this.btnClearAll.width=120,this.btnClearAll.height=34,this.btnClearAll.x=this.bg.width-this.btnClearAll.width-15,this.btnClearAll.y=this.lblTitle.y-5,this.btnClearAll.onClick=()=>this.onClearAllClick(),this.addChild(this.btnClearAll); - const s=t.SLOT_GAP,e=t.SLOTS_X,n=this.lblTitle.y+28; - this.lblHeroHeader=this.makeLabel(NB.getText("GAME_1083","영웅"),16,16763904),this.lblHeroHeader.x=15,this.lblHeroHeader.y=n+.5*(60-this.lblHeroHeader.height),this.addChild(this.lblHeroHeader); - for(let a=0; - a<t.NUM_SLOTS; - a++){ - const t=new CJt; - t.scale=.7,t.x=e+a*s,t.y=n,t.onClick=()=>this.onHeroSlotClick(a),this.addChild(t),this.heroSlotBtns.push(t); - const i=new Ke; - i.x=t.x+2,i.y=t.y+3,i.eventMode="none",i.visible=!1,this.addChild(i),this.heroCcBadges.push(i)} - const h=n+60+8; - this.lblSoldierHeader=this.makeLabel(NB.getText("GAME_1084","병사"),16,16763904),this.lblSoldierHeader.x=15,this.lblSoldierHeader.y=h+.5*(60-this.lblSoldierHeader.height),this.addChild(this.lblSoldierHeader); - for(let a=0; - a<t.NUM_SLOTS; - a++){ - const t=new CJt; - t.scale=.7,t.x=e+a*s,t.y=h,t.onClick=()=>this.onSoldierSlotClick(a),this.addChild(t),this.soldierSlotBtns.push(t); - const i=new iG("",16772744,{ - ...hD.DEFAULT_OUTLINE_FONT_OPTION_16,fontSize:14} - ); - i.textColor=16772744,i.visible=!1,i.eventMode="none",this.addChild(i),this.soldierCountLbls.push(i); - const n=new pg({ - text:"",style:new Jw({ - fontFamily:"Arial",fontSize:18,fontWeight:"bold",fill:16772710,stroke:{ - color:0,width:4} - } - )} - ); - n.anchor.set(1,0),n.eventMode="none",n.visible=!1,this.addChild(n),this.soldierStageBadges.push(n); - const r=new Ke; - r.x=t.x+2,r.y=t.y+3,r.eventMode="none",r.visible=!1,this.addChild(r),this.soldierCcBadges.push(r)} - this.lblHint1=this.makeLabel(`# ${ - NB.getText("GAME_1085","각 영웅은 자신과 같은 종족의 병사만 부하로 설정할 수 있습니다.")} - `,12,10079334),this.lblHint1.setWrapWidth(600),this.lblHint1.x=15,this.lblHint1.y=h+60+6,this.addChild(this.lblHint1),this.lblHint2=this.makeLabel(`# ${ - NB.getText("GAME_1086","선택된 병사는 일반/진화/정예 전체가 전투에 참여하게 됩니다.")} - `,12,10079334),this.lblHint2.setWrapWidth(600),this.lblHint2.x=15,this.lblHint2.y=this.lblHint1.y+this.lblHint1.height+2,this.addChild(this.lblHint2),this.lblListHeader=this.makeLabel(`+ ${ - NB.getText("GAME_563","영웅 선택")} - `,16,16763904),this.lblListHeader.x=15,this.lblListHeader.y=this.lblHint2.y+this.lblHint2.height+14,this.addChild(this.lblListHeader); - const r=this.lblListHeader.y+this.lblListHeader.height+6,o=i-r-80; - this.heroList=new C4(SJt,630,o),this.heroList.x=5,this.heroList.y=r,this.addChild(this.heroList),this.soldierList=new C4(Owi,630,o),this.soldierList.x=-5,this.soldierList.y=r,this.soldierList.visible=!1,this.addChild(this.soldierList),this.btnCancel=new nB(NB.getText("COMMON_2","취소")),this.btnCancel.color=nB.BROWN,this.btnCancel.width=180,this.btnCancel.height=50,this.btnCancel.x=.5*this.bg.width-this.btnCancel.width-10,this.btnCancel.y=i-65,this.btnCancel.onClick=()=>this.hide(),this.addChild(this.btnCancel),this.btnSave=new nB(NB.getText("GAME_527","저장")),this.btnSave.color=nB.GREEN,this.btnSave.width=180,this.btnSave.height=50,this.btnSave.x=.5*this.bg.width+10,this.btnSave.y=i-65,this.btnSave.onClick=()=>this.onSaveClick(),this.addChild(this.btnSave)} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - async open(i,s,e,n=!1,h=null,r=!1,o=!1,a="war"){ - this.boostEnabled=n,this.raidVulns=h,this.raidOrder=r,this.pool=a,this.layoutSlotColumns(),this.bindListCallbacks(),this.lblTitle.text=i; - const c=i.indexOf(NB.getText("GAME_1082","수비 편성"))>=0; - this.btnGuide.visible=c,c&&(this.btnGuide.x=this.lblTitle.x+this.lblTitle.width+6,this.btnGuide.y=this.lblTitle.y+.5*(this.lblTitle.height-this.btnGuide.height)),this.onSaved=e; - const l=BB.getInstance(); - if(!l.hasStates())try{ - const t=await sD.getInstance().guildBarracks.getAll(!0),i=(null==t?void 0:t.body)??t; - (null==i?void 0:i.states)&&l.setStates(i.states)} - catch(frt){ - } - this.squads=[]; - for(let u=0; - u<t.NUM_SLOTS; - u++)this.squads.push({ - heroKindNum:-1,heroTrans:0,barrackKindNum:0} - ); - if(s&&s.length>0){ - const i=s.split("|"),e=new Map,n=BB.getInstance(); - for(let s=0; - s<Math.min(i.length,t.NUM_SLOTS); - s++){ - const[t,h,r]=i[s].split("-").map(Number); - if(t>0){ - const i=h||0,o=`${ - t} - _${ - i} - `,a=this.totalOwned(t,i),c=e.get(o)??0; - if(c<a){ - this.squads[s].heroKindNum=t,this.squads[s].heroTrans=i; - let h=r||0; - if(h>0){ - const i=this.heroTribe(t),s=n.getState(i),e=new Set((null==s?void 0:s.unlockedKinds)??[]); - Math.ceil(h/4)===i&&e.has(h)||(h=0)} - this.squads[s].barrackKindNum=h,e.set(o,c+1)} - } - } - } - if(this.bindListCallbacks(),SJt.skillCodeMap=null,this.selectedSlot=-1,this.setMode(0),o){ - const t=this.squads.findIndex(t=>t.heroKindNum>0); - t>=0&&(this.selectedSlot=t,this.setMode(1))} - this.refreshSlots(),this.refreshList(),LG.getInstance().addPopup(this)} - bindListCallbacks(){ - SJt.onHeroClick=(t,i)=>this.onHeroPick(t,i),SJt.raidVulns=this.raidVulns,Owi.onSelect=t=>this.onBarrackPick(t),Owi.onUnlock=(t,i)=>{ - this.onBarrackUnlock(t,i)} - ,Owi.onBoost=this.boostEnabled?t=>this.onBarrackBoostConfirm(t):null} - setMode(t){ - this.mode=t,this.heroList.visible=0===t,this.soldierList.visible=1===t,this.lblListHeader.text=0===t?`+ ${ - NB.getText("GAME_563","영웅 선택")} - `:`+ ${ - NB.getText("GAME_1087","병사 선택")} - `} - layoutSlotColumns(){ - for(let i=0; - i<t.NUM_SLOTS; - i++){ - const s=this.raidOrder?f1t.indexOf(i):i,e=t.SLOTS_X+(s<0?i:s)*t.SLOT_GAP; - this.heroSlotBtns[i]&&(this.heroSlotBtns[i].x=e),this.soldierSlotBtns[i]&&(this.soldierSlotBtns[i].x=e),this.heroCcBadges[i]&&(this.heroCcBadges[i].x=e+2),this.soldierCcBadges[i]&&(this.soldierCcBadges[i].x=e+2)} - } - refreshSlots(){ - iR.getInstance(); - for(let i=0; - i<t.NUM_SLOTS; - i++){ - const t=this.squads[i],s=this.heroSlotBtns[i],e=this.soldierSlotBtns[i],n=eR.getVO(); - t.heroKindNum>0?(n.kindNum=t.heroKindNum,n.trans=t.heroTrans,n.level=1,s.setDataWith(i,n),s.hideLevel(),s.hideEnhance(),s.setAlphaToFrame(this.isHeroSlotSelected(i)?1:.85),s.selected=this.isHeroSlotSelected(i)):(n.kindNum=-1,s.setDataWith(i,n),s.hideBackground(),s.setAlphaToFrame(this.isHeroSlotSelected(i)?.9:.4),s.selected=!1); - const h=eR.getVO(),r=this.soldierCountLbls[i],o=this.soldierStageBadges[i]; - if(t.barrackKindNum>0){ - const s=BB.getInstance(),n=s.getBook(t.barrackKindNum),a=n?s.getState(n.tribe):null,c=n&&a?s.computeInstructorsForBarrack(n):null,l=n&&a&&c?s.computeSoldiers(n,a,c,Date.now(),this.pool):null,u=this.getRepresentativeSoldierStageIndex(l??void 0),d=!!n&&wP.getAwakenedBarrackTribes().has(n.tribe),f=this.getDisplaySoldierKind(null==n?void 0:n.unitKindNums,null==n?void 0:n.plusLevel,u,d); - if(f>0){ - if(h.kindNum=f,h.trans=0,h.level=1,e.setDataWith(i,h),e.hideLevel(),e.hideEnhance(),e.setAlphaToFrame(this.isSoldierSlotSelected(i)?1:.85),e.selected=this.isSoldierSlotSelected(i),l){ - const t=l.reduce((t,i)=>t+i,0); - r.text=`${ - t} - `; - const i=60; - r.x=e.x+i/2-r.width/2,r.y=e.y+i-r.height+2,r.visible=!0} - else r.visible=!1; - const t=this.shiftedStageBadge(u,d); - t?(o.text=t,o.x=e.x+e.width-13,o.y=e.y-2,o.visible=!0):o.visible=!1} - else h.kindNum=-1,e.setDataWith(i,h),e.hideBackground(),e.setAlphaToFrame(.4),r.visible=!1,o.visible=!1} - else h.kindNum=-1,e.setDataWith(i,h),e.hideBackground(),e.setAlphaToFrame(this.isSoldierSlotSelected(i)?.9:.4),e.selected=!1,r.visible=!1,o.visible=!1; - this.updateSlotCcBadge(this.heroCcBadges[i],t.heroKindNum),this.updateSlotCcBadge(this.soldierCcBadges[i],h.kindNum)} - } - updateSlotCcBadge(t,i){ - if(!this.raidVulns||i<=0)return void(t.visible=!1); - const s=iR.getInstance().getBookVO(i); - t.visible=bJt(t,MJt(null==s?void 0:s.raidCc,this.raidVulns))} - getSoldierKindAt(t,i){ - if(!t||0===t.length)return-1; - const s=t[i]; - return s&&s>0?s:t.find(t=>t>0)??-1} - stageBadgeText(t){ - return 2===t?"+":3===t?"++":4===t?"+++":""} - getDisplaySoldierKind(t,i,s,e){ - if(e&&t&&i){ - const e=wP.getShiftedSoldierTier(t,i,s,!0).kindNum; - if(e>0)return e} - return this.getSoldierKindAt(t,s)} - shiftedStageBadge(t,i){ - const s=t+(i?1:0); - return"+".repeat(Math.max(0,s-1))} - getRepresentativeSoldierStageIndex(t){ - if(!t||0===t.length)return 0; - let i=0,s=0; - for(let e=0; - e<5; - e++){ - const n=Math.max(0,Number(t[e]??0)); - !Number.isFinite(n)||n<=0||(i+=n,s+=n*(e+1))} - return i<=0?0:Math.max(0,Math.min(4,Math.round(s/i)-1))} - isHeroSlotSelected(t){ - return 0===this.mode&&this.selectedSlot===t} - isSoldierSlotSelected(t){ - return 1===this.mode&&this.selectedSlot===t} - onHeroSlotClick(t){ - this.setMode(0),this.selectedSlot=this.selectedSlot===t?-1:t,this.refreshSlots(),this.refreshList()} - onSoldierSlotClick(t){ - this.squads[t].heroKindNum<=0?bH.getInstance().showMessage(NB.getText("GAME_1088","먼저 영웅을 선택하세요")):(this.setMode(1),this.selectedSlot=t,this.refreshSlots(),this.refreshList())} - refreshList(){ - 0===this.mode?this.refreshHeroList():this.refreshSoldierList()} - refreshHeroList(){ - EJt.removeAll(this.heroVOs); - const t=iR.getInstance(),i=new Map; - for(const n of this.squads){ - if(n.heroKindNum<=0)continue; - const t=`${ - n.heroKindNum} - _${ - n.heroTrans} - `; - i.set(t,(i.get(t)??0)+1)} - const s=Qt(i=>{ - if(i>=1e4)return!1; - const s=t.getBookVO(i); - return!(!s||(s.grade??0)<5||0===this.unlockedBarracksOfTribe(s.tribe).length)} - ,"eligible"),e=new Map; - for(const n of t.list){ - if(!s(n.kindNum))continue; - const t=`${ - n.kindNum} - _${ - n.trans} - `; - e.set(t,(e.get(t)??0)+1)} - for(const n of t.ownedUnitList)if(s(n.kindNum)){ - if(n.count>0){ - const t=`${ - n.kindNum} - _0`; - e.set(t,(e.get(t)??0)+n.count)} - for(let t=0; - t<n.trans.length; - t++)if(n.trans[t]>0){ - const i=`${ - n.kindNum} - _${ - t+1} - `; - e.set(i,(e.get(i)??0)+n.trans[t])} - } - this.heroVOs.push(EJt.set(EJt.getVO(),-1,0,0,0)); - for(const[n,h]of e){ - const[t,s]=n.split("_"),e=Number(t),r=Number(s),o=i.get(n)??0; - this.heroVOs.push(EJt.set(EJt.getVO(),e,r,h-o,h))} - this.heroVOs.sort((i,s)=>{ - if(i.kindNum<=0)return-1; - if(s.kindNum<=0)return 1; - const e=t.getBookVO(i.kindNum),n=t.getBookVO(s.kindNum); - if(!e||!n)return 0; - const h=1e12*e.grade-1e9*e.evolStage+1e6*i.trans-e.tribe; - return 1e12*n.grade-1e9*n.evolStage+1e6*s.trans-n.tribe-h} - ),this.heroList.dataProvider=Dx.chunkArray(this.heroVOs,7)} - refreshSoldierList(){ - var t; - if(Twi.removeAll(this.barrackVOs),this.selectedSlot<0)return void(this.soldierList.dataProvider=[]); - const i=this.squads[this.selectedSlot]; - if(i.heroKindNum<=0)return void(this.soldierList.dataProvider=[]); - const s=this.heroTribe(i.heroKindNum),e=BB.getInstance(),n=e.getState(s); - if(!n)return void(this.soldierList.dataProvider=[]); - const h=e.getBooksByTribe(s).slice().sort((t,i)=>t.kindNum-i.kindNum),r=new Set(n.unlockedKinds),o=new Set; - for(let a=0; - a<this.squads.length; - a++){ - if(a===this.selectedSlot)continue; - const t=this.squads[a].barrackKindNum; - t>0&&o.add(t)} - for(const a of h){ - const h=a.kindNum,c=r.has(h),l=Twi.getVO(); - if(l.barrackKindNum=h,l.tribe=s,l.unitKindNums=a.unitKindNums.slice(),l.plusLevel=a.plusLevel.slice(),l.awakened=wP.getAwakenedBarrackTribes().has(s),l.unlocked=c,l.openCost=a.openCost,l.showBoost=this.boostEnabled,l.raidCcMatched=this.raidVulns?MJt(null==(t=iR.getInstance().getBookVO(a.unitKindNums.find(t=>t>0)??-1))?void 0:t.raidCc,this.raidVulns):[],c){ - const t=e.computeInstructorsForBarrack(a); - l.counts=e.computeSoldiers(a,n,t,Date.now(),this.pool).slice(),l.selected=i.barrackKindNum===h,l.usedByOther=!l.selected&&o.has(h),l.canBoost=!!this.boostEnabled&&e.canBoostBarrack(a,n,t,3600,Date.now(),this.pool),l.canTrainPerStage=[],l.trainTimeSec=[]; - for(let i=0; - i<5; - i++)l.canTrainPerStage.push(e.canTrainStage(a,i,t)),l.trainTimeSec.push(e.computeActualTrainingTime(a,i))} - else l.counts=[0,0,0,0,0],l.selected=!1,l.usedByOther=!1,l.canBoost=!1,l.canTrainPerStage=[!1,!1,!1,!1,!1],l.trainTimeSec=[0,0,0,0,0]; - this.barrackVOs.push(l)} - this.soldierList.dataProvider=this.barrackVOs} - async onBarrackUnlock(t,i){ - if(TG.gem<i)return void bH.getInstance().showMessage(NB.getText("COMMON_352","보석이 부족합니다.")); - const s=Math.ceil(t/4); - try{ - const e=await sD.getInstance().guildBarracks.unlockKind(s,t,!0),n=(null==e?void 0:e.body)??e; - BB.getInstance().applyMutationResult(n),TG.updateGem(-i),LH.getInstance().updateGem(),this.refreshSoldierList()} - catch{ - bH.getInstance().showMessage(NB.getText("GAME_1128","병영 개방 실패"))} - } - static todayStr(){ - const t=new Date(Bx.time); - return`${ - t.getFullYear()} - -${ - t.getMonth()+1} - -${ - t.getDate()} - `} - onBarrackBoostConfirm(i){ - if(TG.gem<t.BOOST_GEM_COST)return void bH.getInstance().showMessage(NB.getText("COMMON_352","보석이 부족합니다.")); - let s=!1; - try{ - s=localStorage.getItem(t.BOOST_SKIP_LS_KEY)===t.todayStr()} - catch{ - } - if(s)return void this.onBarrackBoost(i); - const e=NKt.getInstance(); - e.title=NB.getText("COMMON_4","알림"),e.textAlignCenter=!0,e.setCheckbox(NB.getText("COMMON_19","오늘 하루 보지 않기")),e.show(NB.getValueReplace("GAME_1127","##",t.BOOST_GEM_COST,`보석 ${ - t.BOOST_GEM_COST} - 개를 이용해서,\n병사훈련을 1시간동안 가속하시겠습니까?`),()=>{ - if(e.isCheckboxChecked)try{ - localStorage.setItem(t.BOOST_SKIP_LS_KEY,t.todayStr())} - catch{ - } - this.onBarrackBoost(i)} - ),e.y=480} - async onBarrackBoost(i){ - const s=Math.ceil(i/4); - try{ - const e=await sD.getInstance().guildBarracks.boost(s,i,this.pool,!0),n=(null==e?void 0:e.body)??e; - BB.getInstance().applyMutationResult(n),TG.updateGem(-t.BOOST_GEM_COST),LH.getInstance().updateGem(),this.refreshSlots(),this.refreshSoldierList()} - catch{ - bH.getInstance().showMessage(NB.getText("GAME_1144","가속 실패"))} - } - onClearAllClick(){ - for(let i=0; - i<t.NUM_SLOTS; - i++)this.squads[i]={ - heroKindNum:-1,heroTrans:0,barrackKindNum:0} - ; - this.selectedSlot=0,this.refreshSlots(),this.refreshList()} - onHeroPick(i,s){ - if(i<=0)return void(this.selectedSlot>=0&&(this.squads[this.selectedSlot]={ - heroKindNum:-1,heroTrans:0,barrackKindNum:0} - ,this.selectedSlot=(this.selectedSlot+1)%t.NUM_SLOTS,this.refreshSlots(),this.refreshList())); - const e=this.heroTribe(i),n=this.unlockedBarracksOfTribe(e); - if(0===n.length)return void bH.getInstance().showMessage(NB.getText("GAME_1129","이 종족의 해금된 병영이 없습니다")); - let h=0; - for(const t of this.squads)t.heroKindNum===i&&t.heroTrans===s&&h++; - if(h>=this.totalOwned(i,s))return void bH.getInstance().showMessage(NB.getText("GAME_1089","이 영웅은 더 배치할 수 없습니다.")); - let r=this.selectedSlot; - if((r<0||r>=t.NUM_SLOTS)&&(r=this.squads.findIndex(t=>t.heroKindNum<=0)),r<0)return void bH.getInstance().showMessage(NB.getText("GAME_1131","슬롯이 가득 찼습니다")); - const o=this.squads[r]; - let a=o.barrackKindNum; - if(o.barrackKindNum>0&&Math.ceil(o.barrackKindNum/4)!==e&&(a=0),0===a){ - const t=new Set; - for(let i=0; - i<this.squads.length; - i++)i!==r&&this.squads[i].barrackKindNum>0&&t.add(this.squads[i].barrackKindNum); - a=n.find(i=>!t.has(i))??0} - this.squads[r]={ - heroKindNum:i,heroTrans:s,barrackKindNum:a} - ,this.selectedSlot=(r+1)%t.NUM_SLOTS,this.refreshSlots(),this.refreshList()} - onBarrackPick(t){ - if(this.selectedSlot<0)return; - const i=this.squads[this.selectedSlot]; - if(i.heroKindNum<=0)return; - const s=this.heroTribe(i.heroKindNum); - if(Math.ceil(t/4)===s){ - for(let i=0; - i<this.squads.length; - i++)i!==this.selectedSlot&&this.squads[i].barrackKindNum===t&&(this.squads[i].barrackKindNum=0); - i.barrackKindNum=t,this.refreshSlots(),this.refreshSoldierList()} - else bH.getInstance().showMessage(NB.getText("GAME_1130","같은 종족 병영만 선택 가능합니다"))} - heroTribe(t){ - var i; - return(null==(i=iR.getInstance().getBookVO(t))?void 0:i.tribe)??0} - unlockedBarracksOfTribe(t){ - if(t<1||t>4)return[]; - const i=BB.getInstance().getState(t); - return i?i.unlockedKinds.slice().sort((t,i)=>t-i):[]} - totalOwned(t,i){ - const s=iR.getInstance(); - let e=0; - for(const h of s.list)h.kindNum===t&&h.trans===i&&e++; - const n=s.getOwnedUnitVO(t); - return n&&(e+=0===i?n.count:n.trans[i-1]??0),e} - onSaveClick(){ - this.saveAndClose()} - onCloseBtnClick(){ - this.saveAndClose()} - saveAndClose(){ - for(let s=0; - s<t.NUM_SLOTS; - s++)if(this.squads[s].heroKindNum<=0)return void bH.getInstance().showMessage(NB.getValueReplace("GAME_1090","##",s+1,`${ - s+1} - 번 슬롯에 영웅을 선택하세요.`)); - const i=this.squads.map(t=>`${ - t.heroKindNum} - -${ - t.heroTrans} - -${ - t.barrackKindNum} - `).join("|"); - this.onSaved&&this.onSaved(i),this.hide()} - hide(){ - SJt.raidVulns=null,LG.getInstance().removePopup(this)} - makeLabel(t,i,s){ - return new iG(t,s,{ - ...hD.DEFAULT_OUTLINE_FONT_OPTION_16,fontSize:i} - )} - get className(){ - return"GuildWarSquadsPopup"} - } - ; - Qt(Nwi,"GuildWarSquadsPopup"),Zt(Nwi,"_instance"),Zt(Nwi,"NUM_SLOTS",5),Zt(Nwi,"SLOT_GAP",92),Zt(Nwi,"SLOTS_X",115),Zt(Nwi,"BOOST_GEM_COST",100),Zt(Nwi,"BOOST_SKIP_LS_KEY","raidBoostConfirmSkipDate"); - let Lwi=Nwi; - const Dwi=Object.freeze(Object.defineProperty({ - __proto__:null,GuildWarSquadsPopup:Lwi} - ,Symbol.toStringTag,{ - value:"Module"} - )),Gwi=["s","a","b","c"],Bwi=class t extends kx{ - constructor(){ - super(),Zt(this,"bg"),Zt(this,"lblRole"),Zt(this,"lblUserName"),Zt(this,"lblKnightLv"),Zt(this,"btns",{ - } - ),Zt(this,"gvo"),this.bg=new hE({ - texture:RS.getTexture("UI_Ekkorr","Popup_List_02"),leftWidth:140,topHeight:30,rightWidth:20,bottomHeight:30} - ),this.bg.width=t.ROW_W,this.bg.height=t.ROW_H,this.addChild(this.bg),this.lblRole=new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_16),this.addChild(this.lblRole),this.lblUserName=new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_17),this.lblUserName.x=130,this.addChild(this.lblUserName),this.lblKnightLv=new iG("",11184810,hD.DEFAULT_OUTLINE_FONT_OPTION_16),this.lblKnightLv.x=130,this.addChild(this.lblKnightLv); - const i=48*Gwi.length+6*(Gwi.length-1),s=t.ROW_W-12-i,e=.5*(t.ROW_H-48); - for(let t=0; - t<Gwi.length; - t++){ - const i=Gwi[t],n=new nB(i.toUpperCase()); - n.color=nB.BROWN,n.width=48,n.height=48,n.x=s+54*t,n.y=e,n.onClick=()=>this.onTierBtn(i),this.addChild(n),this.btns[i]=n} - } - setData(t){ - this.data=t,this.gvo=t; - const i=.5*this.bg.height-21,s=i+23; - this.lblRole.text=OD.getRoleName(this.gvo.role),this.lblRole.textColor=OD.getColor(this.gvo.role),this.lblRole.x=.5*(120-this.lblRole.width),this.lblRole.y=.5*(this.bg.height-this.lblRole.height),this.lblUserName.text=this.gvo.userName,this.lblUserName.y=i,this.lblKnightLv.text=`Lv. ${ - this.gvo.knightLevel} - `,this.lblKnightLv.y=s,this.refreshTierButtons()} - onTierBtn(i){ - if(!this.gvo)return; - const s=this.gvo.tier===i?null:i; - this.gvo.tier=s,this.refreshTierButtons(),t.onTierClick&&t.onTierClick(this.gvo,s)} - refreshTierButtons(){ - for(const t of Gwi){ - const i=this.gvo.tier===t; - this.btns[t].color=i?this.tierBtnColor(t):nB.BROWN} - } - tierBtnColor(t){ - switch(t){ - case"s":return nB.RED; - case"a":return nB.GREEN; - case"b":return nB.BLUE; - case"c":return nB.LIGHT_GREEN} - } - get height(){ - return t.ROW_H+2} - } - ; - Qt(Bwi,"GuildWarTierAssignItemRenderer"),Zt(Bwi,"onTierClick",null),Zt(Bwi,"ROW_W",630),Zt(Bwi,"ROW_H",70); - let Uwi=Bwi; - const Fwi=class t extends YXt{ - constructor(){ - super(),Zt(this,"lblTitle"),Zt(this,"lblTierStat"),Zt(this,"lblHint"),Zt(this,"list"),Zt(this,"btnSave"),Zt(this,"btnCancel"),Zt(this,"vos",[]); - const t=Math.min(SS.safeHeight,880); - this.bg.height=t,this.y=Math.max(0,SS.safeHeight-t),this.lblTitle=this.makeLabel(`[ ${ - NB.getText("GAME_1094","길드원 배치")} - ]`,18,16763904),this.lblTitle.x=15,this.lblTitle.y=52,this.addChild(this.lblTitle),this.lblTierStat=this.makeLabel("",13,10079487),this.lblTierStat.x=15,this.lblTierStat.y=this.lblTitle.y+this.lblTitle.height+6,this.addChild(this.lblTierStat),this.lblHint=this.makeLabel(`# ${ - NB.getText("GAME_1095","미배정 인원은 자동 분배( 각 성 1명 우선 → s→a→b→c 순으로 잉여 채움 )")} - `,11,10079334),this.lblHint.setWrapWidth(600),this.lblHint.x=15,this.lblHint.y=this.lblTierStat.y+this.lblTierStat.height+6,this.addChild(this.lblHint),Uwi.onTierClick=(t,i)=>this.onTierAssigned(t,i); - const i=this.lblHint.y+this.lblHint.height+10,s=t-i-80; - this.list=new C4(Uwi,640,s),this.list.x=5,this.list.y=i,this.addChild(this.list),this.btnCancel=new nB(NB.getText("COMMON_2","취소")),this.btnCancel.color=nB.BROWN,this.btnCancel.width=180,this.btnCancel.height=50,this.btnCancel.x=.5*this.bg.width-this.btnCancel.width-10,this.btnCancel.y=t-65,this.btnCancel.onClick=()=>this.hide(),this.addChild(this.btnCancel),this.btnSave=new nB(NB.getText("GAME_527","저장")),this.btnSave.color=nB.GREEN,this.btnSave.width=180,this.btnSave.height=50,this.btnSave.x=.5*this.bg.width+10,this.btnSave.y=t-65,this.btnSave.onClick=()=>this.onSaveClick(),this.addChild(this.btnSave)} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - async open(){ - var i,s; - if(this.show2(),!OD.hasGuild)return this.refreshList(),void this.refreshTierStat(); - const e=OD.myGuildId; - if(!OD.memberList||0===OD.memberList.length)try{ - const t=await sD.getInstance().guild.getMembers(e); - (null==t?void 0:t.success)&&(null==(i=t.body)?void 0:i.members)&&OD.setMemberData(t.body.members)} - catch(frt){ - } - if(!t.loaded)try{ - const i=await sD.getInstance().guildWar.getTierAssignments(e,!1),n=(null==(s=null==i?void 0:i.body)?void 0:s.assignments)??[]; - t.assignments.clear(); - for(const s of n)"s"!==s.tier&&"a"!==s.tier&&"b"!==s.tier&&"c"!==s.tier||t.assignments.set(s.memberId,s.tier); - t.loaded=!0} - catch(frt){ - } - const n=new Set((OD.memberList??[]).map(t=>t.memberId)); - for(const h of[...t.assignments.keys()])n.has(h)||t.assignments.delete(h); - this.refreshList(),this.refreshTierStat()} - refreshList(){ - const i=[...OD.memberList??[]].sort((t,i)=>i.roleLevel!==t.roleLevel?i.roleLevel-t.roleLevel:(i.wave??0)-(t.wave??0)); - this.vos=i.map(i=>({ - memberId:i.memberId,userName:i.userName,role:i.role,knightLevel:Math.floor((i.wave??0)/100),tier:t.assignments.get(i.memberId)??null} - )),this.list.dataProvider=this.vos} - onTierAssigned(i,s){ - if(null!=s){ - const e=2*Zpi[s].length; - if(this.countByTier(s,i.memberId)>=e){ - bH.getInstance().showMessage(NB.getValueReplace("GAME_1105","##",e,`티어 인원 한도가 초과 ( 최대 ${ - e} - 명 )`)); - const s=t.assignments.get(i.memberId); - return i.tier=s??null,void(this.list.dataProvider=this.vos)} - t.assignments.set(i.memberId,s)} - else t.assignments.delete(i.memberId); - this.refreshTierStat()} - countByTier(i,s){ - let e=0; - for(const[n,h]of t.assignments)s&&n===s||h===i&&e++; - return e} - refreshTierStat(){ - const i=[]; - for(const t of twi){ - const s=2*Zpi[t].length,e=this.countByTier(t); - i.push(`${ - t.toUpperCase()} - ${ - e} - /${ - s} - `)} - const s=this.vos.length-t.assignments.size; - this.lblTierStat.text=`${ - i.join(" · ")} - · ${ - NB.getText("GAME_1103","자동분배")} - ${ - Math.max(0,s)} - `} - async onSaveClick(){ - if(!OD.hasGuild)return void bH.getInstance().showMessage(NB.getText("GAME_1106","길드에 가입해야 사용 가능합니다")); - const i=OD.myGuildId,s=[]; - for(const[e,n]of t.assignments)s.push({ - memberId:e,tier:n} - ); - try{ - await sD.getInstance().guildWar.setTierAssignments(i,s,!0),bH.getInstance().showMessage(NB.getValueReplace("GAME_1104","##",s.length,`배치저장 완료 ( ${ - s.length} - 명 )`)),this.hide()} - catch(frt){ - bH.getInstance().showMessage(NB.getText("GAME_1107","배치 저장 실패"))} - } - makeLabel(t,i,s){ - return new iG(t,s,{ - ...hD.DEFAULT_OUTLINE_FONT_OPTION_16,fontSize:i} - )} - get className(){ - return"GuildWarTierAssignPopup"} - } - ; - Qt(Fwi,"GuildWarTierAssignPopup"),Zt(Fwi,"_instance"),Zt(Fwi,"assignments",new Map),Zt(Fwi,"loaded",!1); - let $wi=Fwi; - const Hwi=Object.freeze(Object.defineProperty({ - __proto__:null,GuildWarTierAssignPopup:$wi} - ,Symbol.toStringTag,{ - value:"Module"} - )),Wwi=VKt("Device",{ - web:Qt(()=>ei(()=>Promise.resolve().then(()=>sji),void 0).then(t=>new t.DeviceWeb),"web")} - ),Vwi=Object.freeze(Object.defineProperty({ - __proto__:null,Device:Wwi} - ,Symbol.toStringTag,{ - value:"Module"} - )); - var jwi=new(Qt($t=class{ - get _window(){ - return"undefined"!=typeof window?window:{ - ReactNativeWebView:{ - postMessage:Qt(()=>{ - } - ,"postMessage")} - ,__GRANITE_NATIVE_EMITTER:{ - on:Qt(()=>()=>{ - } - ,"on")} - ,__CONSTANT_HANDLER_MAP:{ - } - } - } - postMessage(t){ - const i=this._window.ReactNativeWebView; - if(!i)throw new Error("ReactNativeWebView is not available in browser environment"); - i.postMessage(JSON.stringify(t))} - on(t,i){ - const s=this._window.__GRANITE_NATIVE_EMITTER; - if(!s)throw new Error("__GRANITE_NATIVE_EMITTER is not available"); - return s.on(t,i)} - getConstant(t){ - const i=this._window.__CONSTANT_HANDLER_MAP; - if(i&&t in i)return i[t]; - throw new Error(`${ - t} - is not a constant handler`)} - } - ,"NativeWindow"),$t),Kwi=Qt(()=>Math.random().toString(36).substring(2,15),"createEventId$1"),zwi=Qt(t=>{ - if(t&&t.__isError){ - const i=new Error(t.message); - for(const[s,e]of Object.entries(t))i[s]=e; - return i} - return t} - ,"deserializeError$1"); - function Ywi(t){ - return(...i)=>{ - const s=Kwi(),e=[],n=Qt(()=>{ - for(const t of e)t()} - ,"unsubscribe"); - return new Promise((h,r)=>{ - e.push(jwi.on(`${ - t} - /resolve/${ - s} - `,t=>{ - n(),h(t)} - )),e.push(jwi.on(`${ - t} - /reject/${ - s} - `,t=>{ - n(),r(zwi(t))} - )),jwi.postMessage({ - type:"method",functionName:t,eventId:s,args:i} - )} - )} - } - function qwi(t){ - return i=>{ - const s=Kwi(),e=[jwi.on(`${ - t} - /onEvent/${ - s} - `,t=>{ - i.onEvent(t)} - ),jwi.on(`${ - t} - /onError/${ - s} - `,t=>{ - i.onError(zwi(t))} - )]; - return jwi.postMessage({ - type:"addEventListener",functionName:t,eventId:s,args:i.options} - ),()=>{ - jwi.postMessage({ - type:"removeEventListener",functionName:t,eventId:s} - ),e.forEach(t=>t())} - } - } - function Xwi(t){ - return()=>jwi.getConstant(t)} - Qt(Ywi,"createAsyncBridge$1"),Qt(qwi,"createEventBridge$1"),Qt(Xwi,"createConstantBridge$1"); - var Jwi=Qt(function(){ - return{ - emit:Qt(function(t,i){ - for(var s=this.events[t]||[],e=0,n=s.length; - e<n; - e++)s[e](i)} - ,"emit"),events:{ - } - ,on:Qt(function(t,i){ - var s,e,n=this; - return((s=this.events)[e=t]||(s[e]=[])).push(i),function(){ - var s; - n.events[t]=null===(s=n.events[t])||void 0===s?void 0:s.filter(function(t){ - return i!==t} - )} - } - ,"on")} - } - ,"createEvents"); - "undefined"!=typeof window&&(window.__GRANITE_NATIVE_EMITTER=Jwi()); - var Qwi=Ywi("closeView"),Zwi=Ywi("generateHapticFeedback"),tgi=Ywi("share"),igi=Ywi("setSecureScreen"),sgi=Ywi("setScreenAwakeMode"),egi=Ywi("getNetworkStatus"),ngi=Ywi("setIosSwipeGestureEnabled"),hgi=Ywi("openURL"),rgi=Ywi("openPermissionDialog"),ogi=Ywi("getPermission"),agi=Ywi("requestPermission"),cgi=Ywi("appLogin"),lgi=Ywi("eventLog"),ugi=Ywi("getTossShareLink"),dgi=Ywi("setDeviceOrientation"),fgi=Ywi("checkoutPayment"),pgi=Ywi("saveBase64Data"),wgi=Ywi("appsInTossSignTossCert"),ggi=Ywi("getGameCenterGameProfile"),mgi=Ywi("openGameCenterLeaderboard"),vgi=Ywi("submitGameCenterLeaderBoardScore"),_gi=Ywi("getUserKeyForGame"),Mgi=Ywi("grantPromotionRewardForGame"),bgi=Ywi("getIsTossLoginIntegratedService"),ygi=Xwi("getLocale"),Egi=Xwi("getSchemeUri"),Agi=Xwi("getPlatformOS"),Sgi=Xwi("getOperationalEnvironment"),Tgi=Xwi("getTossAppVersion"),Cgi=Xwi("getDeviceId"),Ogi=Xwi("getGroupId"),Igi=qwi("contactsViral"),kgi=qwi("onVisibilityChangedByTransparentServiceWeb"),xgi=(Ht=class extends Error{ - constructor({ - methodName:t,message:i} - ){ - super(),this.name=`${ - t} - permission error`,this.message=i} - } - ,Qt(Ht,"PermissionError"),Ht),Rgi=(Qt(Wt=class extends xgi{ - constructor(){ - super({ - methodName:"fetchAlbumPhotos",message:"사진첩 권한이 거부되었어요."} - )} - } - ,"FetchAlbumPhotosPermissionError"),Wt),Pgi=(Qt(Vt=class extends xgi{ - constructor(){ - super({ - methodName:"fetchContacts",message:"연락처 권한이 거부되었어요."} - )} - } - ,"FetchContactsPermissionError"),Vt),Ngi=(Qt(jt=class extends xgi{ - constructor(){ - super({ - methodName:"openCamera",message:"카메라 권한이 거부되었어요."} - )} - } - ,"OpenCameraPermissionError"),jt),Lgi=(t=>(t[t.Lowest=1]="Lowest",t[t.Low=2]="Low",t[t.Balanced=3]="Balanced",t[t.High=4]="High",t[t.Highest=5]="Highest",t[t.BestForNavigation=6]="BestForNavigation",t))(Lgi||{ - } - ),Dgi=(Qt(Kt=class extends xgi{ - constructor(){ - super({ - methodName:"getCurrentLocation",message:"위치 권한이 거부되었어요."} - )} - } - ,"GetCurrentLocationPermissionError"),Kt),Ggi=Dgi,Bgi=(Qt(zt=class extends xgi{ - constructor(){ - super({ - methodName:"getClipboardText",message:"클립보드 읽기 권한이 거부되었어요."} - )} - } - ,"GetClipboardTextPermissionError"),zt),Ugi=(Qt(Yt=class extends xgi{ - constructor(){ - super({ - methodName:"setClipboardText",message:"클립보드 쓰기 권한이 거부되었어요."} - )} - } - ,"SetClipboardTextPermissionError"),Yt),Fgi=new(Qt(qt=class{ - get _window(){ - return"undefined"!=typeof window?window:{ - ReactNativeWebView:{ - postMessage:Qt(()=>{ - } - ,"postMessage")} - ,__GRANITE_NATIVE_EMITTER:{ - on:Qt(()=>()=>{ - } - ,"on")} - ,__CONSTANT_HANDLER_MAP:{ - } - } - } - postMessage(t){ - const i=this._window.ReactNativeWebView; - if(!i)throw new Error("ReactNativeWebView is not available in browser environment"); - i.postMessage(JSON.stringify(t))} - on(t,i){ - const s=this._window.__GRANITE_NATIVE_EMITTER; - if(!s)throw new Error("__GRANITE_NATIVE_EMITTER is not available"); - return s.on(t,i)} - getConstant(t){ - const i=this._window.__CONSTANT_HANDLER_MAP; - if(i&&t in i)return i[t]; - throw new Error(`${ - t} - is not a constant handler`)} - } - ,"NativeWindow"),qt),$gi=Qt(()=>Math.random().toString(36).substring(2,15),"createEventId"),Hgi=Qt(t=>{ - if(t&&t.__isError){ - const i=new Error(t.message); - for(const[s,e]of Object.entries(t))i[s]=e; - return i} - return t} - ,"deserializeError"); - function Wgi(t){ - return(...i)=>{ - const s=$gi(),e=[],n=Qt(()=>{ - for(const t of e)t()} - ,"unsubscribe"); - return new Promise((h,r)=>{ - e.push(Fgi.on(`${ - t} - /resolve/${ - s} - `,t=>{ - n(),h(t)} - )),e.push(Fgi.on(`${ - t} - /reject/${ - s} - `,t=>{ - n(),r(Hgi(t))} - )),Fgi.postMessage({ - type:"method",functionName:t,eventId:s,args:i} - )} - )} - } - function Vgi(t){ - return i=>{ - const s=$gi(),e=[Fgi.on(`${ - t} - /onEvent/${ - s} - `,t=>{ - i.onEvent(t)} - ),Fgi.on(`${ - t} - /onError/${ - s} - `,t=>{ - i.onError(Hgi(t))} - )]; - return Fgi.postMessage({ - type:"addEventListener",functionName:t,eventId:s,args:i.options} - ),()=>{ - Fgi.postMessage({ - type:"removeEventListener",functionName:t,eventId:s} - ),e.forEach(t=>t())} - } - } - function jgi(t){ - return()=>Fgi.getConstant(t)} - Qt(Wgi,"createAsyncBridge"),Qt(Vgi,"createEventBridge"),Qt(jgi,"createConstantBridge"); - var Kgi={ - getItem:Wgi("getStorageItem"),setItem:Wgi("setStorageItem"),removeItem:Wgi("removeStorageItem"),clearItems:Wgi("clearItems")} - ,zgi=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\\-]+(?:\.[\da-z\\-]+)*))?(?:\+[\da-z\\-]+(?:\.[\da-z\\-]+)*)?)?)?$/i,Ygi=Qt(t=>["*","x","X"].includes(t),"isWildcard"),qgi=Qt(t=>{ - const i=parseInt(t,10); - return isNaN(i)?t:i} - ,"tryParse"),Xgi=Qt((t,i)=>typeof t==typeof i?[t,i]:[String(t),String(i)],"coerceTypes"),Jgi=Qt((t,i)=>{ - if(Ygi(t)||Ygi(i))return 0; - const[s,e]=Xgi(qgi(t),qgi(i)); - return s>e?1:s<e?-1:0} - ,"compareValues"),Qgi=Qt(t=>{ - if("string"!=typeof t)throw new TypeError("Invalid argument: expected a string"); - const i=t.match(zgi); - if(!i)throw new Error(`Invalid semver: '${ - t} - '`); - const[,s,e,n,h,r]=i; - return[s,e,n,h,r]} - ,"parseVersion"),Zgi=Qt((t,i)=>{ - const s=Math.max(t.length,i.length); - for(let e=0; - e<s; - e++){ - const s=t[e]??"0",n=i[e]??"0",h=Jgi(s,n); - if(0!==h)return h} - return 0} - ,"compareSegments"),tmi=Qt((t,i)=>{ - const s=Qgi(t),e=Qgi(i),n=s.pop(),h=e.pop(),r=Zgi(s,e); - return 0!==r?r:n&&h?Zgi(n.split("."),h.split(".")):n?-1:h?1:0} - ,"compareVersions"); - function imi(t){ - if("sandbox"===jgi("getOperationalEnvironment")())return!0; - const i=jgi("getTossAppVersion")(),s="ios"===jgi("getPlatformOS")()?t.ios:t.android; - return void 0!==s&&("always"===s||"never"!==s&&tmi(i,s)>=0)} - function smi(t){ - return Wgi("processProductGrant")(t)} - Qt(imi,"isMinVersionSupported"),Qt(smi,"processProductGrant"); - var emi={ - createOneTimePurchaseOrder:Qt(t=>{ - const i=imi({ - android:"5.219.0",ios:"5.219.0"} - ),s=Qt(()=>{ - } - ,"noop"); - if(!i)return s; - const e=imi({ - android:"5.231.1",ios:"5.230.0"} - ),{ - options:n,onEvent:h,onError:r} - =t,o=n.sku??n.productId; - return e?Vgi("requestOneTimePurchase")({ - options:{ - sku:o} - ,onEvent:Qt(async t=>{ - if("purchased"===t.type){ - const i=await n.processProductGrant({ - orderId:t.data.orderId} - ); - await smi({ - orderId:t.data.orderId,isProductGranted:i} - ).catch(r)} - else h(t)} - ,"onEvent"),onError:Qt(t=>{ - r(t)} - ,"onError")} - ):Qt(()=>(Wgi("iapCreateOneTimePurchaseOrder")({ - productId:o} - ).then(t=>{ - Promise.resolve(n.processProductGrant({ - orderId:t.orderId} - )).then(()=>{ - h({ - type:"success",data:t} - )} - ).catch(t=>{ - r(t)} - )} - ).catch(t=>{ - r(t)} - ),s),"v1")()} - ,"createOneTimePurchaseOrder"),createSubscriptionPurchaseOrder:Qt(t=>{ - if(!imi({ - android:"5.248.0",ios:"5.249.0"} - ))return Qt(()=>{ - } - ,"noop"); - const{ - options:i,onEvent:s,onError:e} - =t,{ - sku:n,offerId:h,processProductGrant:r} - =i; - return Vgi("requestSubscriptionPurchase")({ - options:{ - sku:n,offerId:h??null} - ,onEvent:Qt(async t=>{ - if("purchased"===t.type){ - const i=await r({ - orderId:t.data.orderId,subscriptionId:t.data.subscriptionId} - ); - await smi({ - orderId:t.data.orderId,isProductGranted:i} - ).catch(e)} - else s(t)} - ,"onEvent"),onError:Qt(t=>{ - e(t)} - ,"onError")} - )} - ,"createSubscriptionPurchaseOrder"),getProductItemList:Wgi("iapGetProductItemList"),getPendingOrders:Wgi("getPendingOrders"),getCompletedOrRefundedOrders:Wgi("getCompletedOrRefundedOrders"),completeProductGrant:Wgi("completeProductGrant")} - ,nmi=jgi("getSafeAreaInsets"); - function hmi(){ - return nmi()} - function rmi({ - onEvent:t} - ){ - return Vgi("safeAreaInsetsChange")({ - onEvent:t,onError:Qt(()=>{ - } - ,"onError")} - )} - Qt(hmi,"getSafeAreaInsets"),Qt(rmi,"subscribeSafeAreaInsets"); - var omi={ - get:jgi("getSafeAreaInsets"),subscribe:rmi} - ,ami={ - loadAppsInTossAdMob:Object.assign(Vgi("loadAppsInTossAdMob"),{ - isSupported:jgi("loadAppsInTossAdMob_isSupported")} - ),showAppsInTossAdMob:Object.assign(Vgi("showAppsInTossAdMob"),{ - isSupported:jgi("showAppsInTossAdMob_isSupported")} - ),isAppsInTossAdMobLoaded:Object.assign(Wgi("isAppsInTossAdMobLoaded"),{ - isSupported:jgi("isAppsInTossAdMobLoaded_isSupported")} - )} - ,cmi={ - addEventListener:Qt((t,{ - onEvent:i,onError:s,options:e} - )=>Vgi(t)({ - onEvent:i,onError:s??(()=>{ - } - ),options:e} - ),"addEventListener")} - ,lmi={ - addEventListener:Qt((t,{ - onEvent:i,onError:s,options:e} - )=>Vgi(t)({ - onEvent:i,onError:s??(()=>{ - } - ),options:e} - ),"addEventListener")} - ,umi={ - getDeploymentId:jgi("getDeploymentId")} - ,dmi=jgi("deploymentId"),fmi=jgi("brandDisplayName"),pmi=jgi("brandIcon"),wmi=jgi("brandPrimaryColor"),gmi=Qt(()=>({ - deploymentId:dmi(),brandDisplayName:fmi(),brandIcon:pmi(),brandPrimaryColor:wmi()} - ),"getAppsInTossGlobals"),mmi={ - addEventListener:Qt((t,{ - onEvent:i,onError:s,options:e} - )=>Vgi(t)({ - onEvent:i,onError:s??(()=>{ - } - ),options:e} - ),"addEventListener")} - ,vmi={ - addAccessoryButton:Wgi("addAccessoryButton"),removeAccessoryButton:Wgi("removeAccessoryButton")} - ,_mi=Wgi("requestPermission"),Mmi=Wgi("getPermission"),bmi=Wgi("openPermissionDialog"); - function ymi({ - permission:t,handler:i,error:s} - ){ - const e=Qt(async(...e)=>{ - if("denied"===await _mi(t))throw new s; - return i(...e)} - ,"permissionFunction"); - return e.getPermission=()=>Mmi(t),e.openPermissionDialog=()=>bmi(t),e} - Qt(ymi,"createPermissionFunction"); - var Emi=ymi({ - handler:Qt(t=>Wgi("fetchAlbumPhotos")(t),"handler"),permission:{ - name:"photos",access:"read"} - ,error:Rgi} - ),Ami=ymi({ - handler:Qt(t=>Wgi("fetchContacts")(t),"handler"),permission:{ - name:"contacts",access:"read"} - ,error:Pgi} - ),Smi=ymi({ - handler:Qt(t=>Wgi("getCurrentLocation")(t),"handler"),permission:{ - name:"geolocation",access:"access"} - ,error:Dgi} - ),Tmi=ymi({ - handler:Qt(t=>Wgi("openCamera")(t),"handler"),permission:{ - name:"camera",access:"access"} - ,error:Ngi} - ),Cmi=ymi({ - handler:Qt(t=>Wgi("setClipboardText")(t),"handler"),permission:{ - name:"clipboard",access:"write"} - ,error:Ugi} - ),Omi=ymi({ - handler:Qt(()=>Wgi("getClipboardText")(),"handler"),permission:{ - name:"clipboard",access:"read"} - ,error:Bgi} - ),Imi=Wgi("getPermission"),kmi=Wgi("openPermissionDialog"),xmi=Qt(t=>Vgi("updateLocationEvent")({ - ...t,onError:Qt(i=>{ - const s=new Ggi; - return i instanceof Error&&i.name===s.name?t.onError(s):t.onError(i)} - ,"onError")} - ),"startUpdateLocation"); - xmi.getPermission=()=>Imi({ - name:"geolocation",access:"access"} - ),xmi.openPermissionDialog=()=>kmi({ - name:"geolocation",access:"access"} - ); - var Rmi=Object.assign(Vgi("loadFullScreenAd"),{ - isSupported:jgi("loadFullScreenAd_isSupported")} - ),Pmi=Object.assign(Vgi("showFullScreenAd"),{ - isSupported:jgi("showFullScreenAd_isSupported")} - ),Nmi=Wgi("openURL"); - function Lmi(t){ - const i=Dmi(t); - return Nmi(i)} - function Dmi(t){ - return["http://","https://"].some(i=>t.startsWith(i))?Gmi(t):t} - function Gmi(t){ - return`supertoss://web?url=${ - encodeURIComponent(t)} - &external=true`} - Qt(Lmi,"openUrlOpener"),Qt(Dmi,"getWebSchemeOrUri"),Qt(Gmi,"supertossWeb"); - var Bmi="https://static.toss.im/ads/sdk/toss-ads-space-kit-1.3.0.js",Umi=null; - function Fmi(){ - if("undefined"!=typeof window)return window.TossAdsSpaceKit} - function $mi(){ - if("undefined"==typeof window||"undefined"==typeof document)return Promise.reject(new Error("Ads SDK can only be loaded in a browser environment.")); - const t=Fmi(); - if(t)return Promise.resolve(t); - if(Umi)return Umi; - const i=new Promise((t,i)=>{ - const s=document.createElement("script"),e=Qt(()=>{ - s.removeEventListener("load",n),s.removeEventListener("error",h),window.clearTimeout(r),Umi=null} - ,"cleanup"),n=Qt(()=>{ - const s=Fmi(); - if(s)return e(),void t(s); - e(),i(new Error("Ads SDK script loaded but window.TossAdsSpaceKit was not exposed."))} - ,"handleLoad"),h=Qt(()=>{ - e(),i(new Error(`Failed to load Ads SDK script from ${ - Bmi} - .`))} - ,"handleError"),r=window.setTimeout(()=>{ - e(),i(new Error("Loading Ads SDK timed out after 15000ms."))} - ,15e3); - s.addEventListener("load",n),s.addEventListener("error",h),s.async=!0,s.src=Bmi,document.head.appendChild(s)} - ); - return Umi=i,i} - Qt(Fmi,"getAdsSdk"),Qt($mi,"loadAdsSdk"); - var Hmi=Object.assign(Vgi("fetchTossAd"),{ - isSupported:jgi("fetchTossAd_isSupported")} - ),Wmi=Wgi("tossAdEventLog"),Vmi=new Set(["1","2"]); - function jmi(t){ - return new Promise((i,s)=>{ - if(Hmi.isSupported())return Hmi({ - options:t,onEvent:i,onError:s} - ); - s(new Error("fetchTossAd is not supported in this environment."))} - )} - function Kmi(t){ - const i=Array.isArray(t.ads)?t.ads.filter(t=>Vmi.has(String(t.styleId))):[]; - return{ - requestId:t.requestId??"",status:t.status??"OK",ads:i,ext:t.ext} - } - function zmi(t){ - return Ymi(t)?"SUCCESS"!==t.resultType?t:t.success?{ - ...t,success:Kmi(t.success)} - :{ - resultType:"FAIL",error:{ - reason:"fetchTossAd returned SUCCESS without payload"} - } - :qmi(t)?{ - resultType:"SUCCESS",success:Kmi(t)} - :{ - resultType:"FAIL",error:{ - reason:"Invalid response from fetchTossAd"} - } - } - function Ymi(t){ - return Boolean(t&&"object"==typeof t&&"resultType"in t)} - function qmi(t){ - return Boolean(t&&"object"==typeof t&&"ads"in t)} - function Xmi(){ - return async(t,i)=>{ - try{ - return zmi(await jmi({ - adGroupId:i.spaceUnitId,sdkId:"108",availableStyleIds:["1","2"]} - ))} - catch(s){ - return{ - resultType:"FAIL",error:{ - reason:s instanceof Error?s.message:"Unknown fetchTossAd error"} - } - } - } - } - Qt(jmi,"fetchTossAdPromise"),Qt(Kmi,"normalizeAdResponse"),Qt(zmi,"normalizeApiResponse"),Qt(Ymi,"isApiResponse"),Qt(qmi,"isAdResponse"),Qt(Xmi,"createCustomAdFetcher"); - var Jmi=null; - function Qmi(t){ - const{ - callbacks:i} - =t,s=Qt(()=>{ - var t; - return null==(t=null==i?void 0:i.onInitialized)?void 0:t.call(i)} - ,"resolveInitialized"),e=Qt(t=>{ - var s; - const e=t instanceof Error?t:new Error(String(t)); - null==(s=null==i?void 0:i.onInitializationFailed)||s.call(i,e)} - ,"rejectInitialized"),n=Fmi(); - if(null==n?void 0:n.isInitialized())return void s(); - if(null!=Jmi)return void Jmi.then(s).catch(e); - const h=$mi().then(t=>{ - if(t.isInitialized())return; - const i={ - environment:"live",customAdFetcher:Xmi(),opener:Lmi} - ; - t.init(i)} - ); - Jmi=h,h.then(s).catch(e).finally(()=>{ - Jmi===h&&(Jmi=null)} - )} - function Zmi(t,i,s={ - } - ){ - const{ - callbacks:e} - =s,n=Qt(i=>{ - var s; - const n=i instanceof Error?i:new Error(String(i)); - null==(s=null==e?void 0:e.onAdFailedToRender)||s.call(e,{ - slotId:"",adGroupId:t,adMetadata:{ - } - ,error:{ - code:0,message:n.message} - } - )} - ,"rejectAttached"); - try{ - const e=t,n=Fmi(); - if(!n)throw new Error("[toss-ad] Call initialize() before attaching an ad."); - if(!n.banner)throw new Error("[toss-ad] Loaded TossAdsSpaceKit does not support banner ads."); - const h="string"==typeof i?document.querySelector(i):i; - if(!h)throw new Error(`[toss-ad] Failed to find target element: ${ - i} - `); - const r={ - spaceId:e,autoLoad:!0,theme:s.theme,padding:s.padding,callbacks:cvi(t,s.callbacks)} - ; - n.banner.createSlot(h,r)} - catch(h){ - n(h)} - } - Qt(Qmi,"initialize"),Qt(Zmi,"attach"); - var tvi="auto",ivi="blackAndWhite",svi="expanded",evi="toss-ads-attach",nvi="toss-ads-attach-style"; - function hvi(t){ - const i=t.ownerDocument; - if(!i)return; - if(i.getElementById(nvi))return; - const s=i.createElement("style"); - s.id=nvi,s.textContent=`\n .${ - evi} - { - background: #ffffff; - } - \n .${ - evi} - .toss-ads-tone-grey { - background: #f2f4f7; - } - \n @media (prefers-color-scheme: dark) { - \n .${ - evi} - { - background: #17171c; - } - \n .${ - evi} - .toss-ads-tone-grey { - background: #101013; - } - \n } - \n .${ - evi} - .toss-ads-theme-light { - background: #ffffff; - } - \n .${ - evi} - .toss-ads-theme-light.toss-ads-tone-grey { - background: #f2f4f7; - } - \n .${ - evi} - .toss-ads-theme-dark { - background: #17171c; - } - \n .${ - evi} - .toss-ads-theme-dark.toss-ads-tone-grey { - background: #101013; - } - \n `; - const e=i.head??i.body??i.documentElement; - e&&e.appendChild(s)} - function rvi(t,i,s={ - } - ){ - const{ - callbacks:e,theme:n=tvi,tone:h=ivi,variant:r=svi} - =s,o=document.createElement("div"); - o.style.width="100%",o.style.height="100%",o.style.boxSizing="border-box",o.style.display="flex",o.style.flexDirection="column",o.style.justifyContent="center",o.style.overflow="hidden","card"===r&&(o.style.padding="0 10px"); - const a=document.createElement("div"); - a.classList.add(evi),"grey"===h&&a.classList.add("toss-ads-tone-grey"),"light"===n?a.classList.add("toss-ads-theme-light"):"dark"===n&&a.classList.add("toss-ads-theme-dark"),"card"===r&&(a.style.borderRadius="16px",a.style.overflow="hidden"),o.appendChild(a); - let c=!1,l=null; - const u=Qt(i=>{ - var s; - const n=i instanceof Error?i:new Error(String(i)); - null==(s=null==e?void 0:e.onAdFailedToRender)||s.call(e,{ - slotId:"",adGroupId:t,adMetadata:{ - } - ,error:{ - code:0,message:n.message} - } - )} - ,"rejectAttached"),d=cvi(t,e); - try{ - const s=t,e=Fmi(); - if(!e)throw new Error("[toss-ad] Call initialize() before attaching an ad."); - if(!e.banner)throw new Error("[toss-ad] Loaded TossAdsSpaceKit does not support banner ads."); - const h="string"==typeof i?document.querySelector(i):i; - if(!h)throw new Error(`[toss-ad] Failed to find target element: ${ - i} - `); - hvi(h),h.appendChild(o),c=!0; - const r={ - spaceId:s,autoLoad:!0,theme:"auto"===n?void 0:n,renderPadding:Qt(t=>"1"===t?"16px 20px":"20px","renderPadding"),callbacks:d} - ; - l=e.banner.createSlot(a,r)} - catch(f){ - c&&o.parentNode&&o.parentNode.removeChild(o),u(f)} - return{ - destroy(){ - null==l||l.destroy(),c&&o.parentNode&&o.parentNode.removeChild(o)} - } - } - function ovi(t){ - const i=Fmi(); - (null==i?void 0:i.banner)&&i.banner.destroy(t)} - function avi(){ - const t=Fmi(); - (null==t?void 0:t.banner)&&t.banner.destroyAll()} - function cvi(t,i){ - if(!i)return; - const s=Qt(i=>{ - const s={ - ...i??{ - } - } - ; - return s.adGroupId=s.adGroupId??s.spaceId??t,delete s.spaceId,s} - ,"mapEvent"); - return{ - onAdRendered:Qt(t=>{ - var e; - return null==(e=i.onAdRendered)?void 0:e.call(i,s(t))} - ,"onAdRendered"),onAdViewable:Qt(t=>{ - var e; - return null==(e=i.onAdViewable)?void 0:e.call(i,s(t))} - ,"onAdViewable"),onAdClicked:Qt(t=>{ - var e; - return null==(e=i.onAdClicked)?void 0:e.call(i,s(t))} - ,"onAdClicked"),onAdImpression:Qt(t=>{ - var e,n; - Wmi({ - log_name:"display_ads_all::impression__1px_banner",log_type:"event",params:{ - event_type:"impression",schema_id:1812034,request_id:(null==(e=null==t?void 0:t.adMetadata)?void 0:e.requestId)??""} - } - ),null==(n=i.onAdImpression)||n.call(i,s(t))} - ,"onAdImpression"),onAdFailedToRender:Qt(t=>{ - var e; - return null==(e=i.onAdFailedToRender)?void 0:e.call(i,{ - ...s(t),error:(null==t?void 0:t.error)??{ - code:0,message:"UNKNOWN"} - } - )} - ,"onAdFailedToRender"),onNoFill:Qt(t=>{ - var e; - return null==(e=i.onNoFill)?void 0:e.call(i,s(t))} - ,"onNoFill")} - } - Qt(hvi,"ensureAttachStyles"),Qt(rvi,"attachBanner"),Qt(ovi,"destroy"),Qt(avi,"destroyAll"),Qt(cvi,"wrapCallbacks"); - var lvi={ - initialize:Object.assign(Qmi,{ - isSupported:Hmi.isSupported} - ),attach:Object.assign(Zmi,{ - isSupported:Hmi.isSupported} - ),attachBanner:Object.assign(rvi,{ - isSupported:Hmi.isSupported} - ),destroy:Object.assign(ovi,{ - isSupported:Hmi.isSupported} - ),destroyAll:Object.assign(avi,{ - isSupported:Hmi.isSupported} - )} - ,uvi=Object.assign(Wgi("getServerTime"),{ - isSupported:jgi("getServerTime_isSupported")} - ),dvi=Qt(t=>{ - const i=t.split("-").join("").slice(0,12),s=Number.parseInt(i,16); - return new Date(s)} - ,"extractDateFromUUIDv7"),fvi=Qt(()=>{ - try{ - return new URL(Egi()).searchParams.get("referrer")} - catch{ - return""} - } - ,"getReferrer"),pvi=Qt(()=>{ - try{ - const t=new URL(location.href); - if("https:"!==t.protocol)throw new Error("Invalid URL"); - return{ - groupId:t.pathname,search:t.search.startsWith("?")?t.search.substring(1):t.search} - } - catch{ - return{ - groupId:"unknown",search:"unknown"} - } - } - ,"getGroupId"),wvi={ - screen:Qt((t={ - } - )=>{ - const{ - groupId:i,search:s} - =pvi(); - if("unknown"===i)return; - const{ - log_name:e,...n} - =t; - return lgi({ - ...t,log_type:"screen",log_name:e??`${ - i} - ::screen`,params:{ - search:s,referrer:fvi(),document_title:document.title,deployment_id:umi.getDeploymentId(),deployment_timestamp:dvi(umi.getDeploymentId()).getTime(),...n} - } - )} - ,"screen"),impression:Qt((t={ - } - )=>{ - const{ - groupId:i,search:s} - =pvi(); - if("unknown"===i)return; - const{ - log_name:e,...n} - =t; - return lgi({ - log_type:"event",log_name:e??`${ - i} - ::impression`,params:{ - ...n,search:s,referrer:fvi(),deployment_id:umi.getDeploymentId(),deployment_timestamp:dvi(umi.getDeploymentId()).getTime(),event_type:"impression"} - } - )} - ,"impression"),click:Qt((t={ - } - )=>{ - const{ - groupId:i,search:s} - =pvi(); - if("unknown"===i)return; - const{ - log_name:e,...n} - =t; - return lgi({ - log_type:"event",log_name:e??`${ - i} - ::click`,params:{ - ...n,search:s,referrer:fvi(),deployment_id:umi.getDeploymentId(),deployment_timestamp:dvi(umi.getDeploymentId()).getTime(),event_type:"click"} - } - )} - ,"click")} - ; - const gvi=Object.freeze(Object.defineProperty({ - __proto__:null,Accuracy:Lgi,Analytics:wvi,FetchAlbumPhotosPermissionError:Rgi,FetchContactsPermissionError:Pgi,GetClipboardTextPermissionError:Bgi,GetCurrentLocationPermissionError:Dgi,GoogleAdMob:ami,IAP:emi,OpenCameraPermissionError:Ngi,SafeAreaInsets:omi,SetClipboardTextPermissionError:Ugi,StartUpdateLocationPermissionError:Ggi,Storage:Kgi,TossAds:lvi,appLogin:cgi,appsInTossEvent:lmi,appsInTossSignTossCert:wgi,checkoutPayment:fgi,closeView:Qwi,contactsViral:Igi,createAsyncBridge:Wgi,createConstantBridge:jgi,createEventBridge:Vgi,env:umi,eventLog:lgi,fetchAlbumPhotos:Emi,fetchContacts:Ami,generateHapticFeedback:Zwi,getAppsInTossGlobals:gmi,getClipboardText:Omi,getCurrentLocation:Smi,getDeviceId:Cgi,getGameCenterGameProfile:ggi,getGroupId:Ogi,getIsTossLoginIntegratedService:bgi,getLocale:ygi,getNetworkStatus:egi,getOperationalEnvironment:Sgi,getPermission:ogi,getPlatformOS:Agi,getSafeAreaInsets:hmi,getSchemeUri:Egi,getServerTime:uvi,getTossAppVersion:Tgi,getTossShareLink:ugi,getUserKeyForGame:_gi,graniteEvent:cmi,grantPromotionRewardForGame:Mgi,isMinVersionSupported:imi,loadFullScreenAd:Rmi,onVisibilityChangedByTransparentServiceWeb:kgi,openCamera:Tmi,openGameCenterLeaderboard:mgi,openPermissionDialog:rgi,openURL:hgi,partner:vmi,requestPermission:agi,saveBase64Data:pgi,setClipboardText:Cmi,setDeviceOrientation:dgi,setIosSwipeGestureEnabled:ngi,setScreenAwakeMode:sgi,setSecureScreen:igi,share:tgi,showFullScreenAd:Pmi,startUpdateLocation:xmi,submitGameCenterLeaderBoardScore:vgi,tdsEvent:mmi} - ,Symbol.toStringTag,{ - value:"Module"} - )),mvi=class{ - constructor(){ - Zt(this,"platformType","toss"),Zt(this,"userId",null),Zt(this,"safeAreaTop",0),Zt(this,"rewardedAdGroupIds",{ - 2:"ait.v2.live.b32a0c6f20944e13",3:"ait.v2.live.0d95cc1d1bc04177",4:"ait.v2.live.187bb9bedbc94900",5:"ait.v2.live.ed4535b2478d4e65"} - ),Zt(this,"defaultRewardedAdGroupId","ait.v2.live.ed4535b2478d4e65"),Zt(this,"interstitialAdGroupId","ait-ad-test-interstitial-id"),Zt(this,"rewardedAdLoaded",{ - } - ),Zt(this,"rewardedAdUnregisters",{ - } - ),Zt(this,"interstitialAdLoaded",!1),Zt(this,"interstitialAdUnregister",null)} - isAvailable(){ - return"undefined"!=typeof window} - async initialize(){ - var t,i; - try{ - const s=(await ei(()=>Promise.resolve().then(()=>gvi),void 0)).SafeAreaInsets,e=(null==(t=null==s?void 0:s.get)?void 0:t.call(s))??{ - top:0} - ,n=44,h=(e.top??0)+n,r=(null==(i=window.visualViewport)?void 0:i.width)??window.innerWidth,o=640; - this.safeAreaTop=Math.round(h*(o/r))} - catch(frt){ - this.safeAreaTop=100} - this.supportsAds()&&this.preloadAds()} - async login(t){ - const i=await _gi(); - if(!i)throw new Error("getUserKeyForGame: 지원하지 않는 토스앱 버전 (v5.232.0 이상 필요)"); - if("INVALID_CATEGORY"===i)throw new Error("getUserKeyForGame: 게임 카테고리 미니앱이 아닙니다"); - if("ERROR"===i)throw new Error("getUserKeyForGame: 알 수 없는 오류"); - return this.userId=i.hash,{ - platform:"toss",platformId:i.hash,authToken:""} - } - getUserId(){ - return this.userId} - supportsPurchase(){ - return!0} - async purchase(t,i){ - return new Promise(i=>{ - const s=emi.createOneTimePurchaseOrder({ - options:{ - sku:t,processProductGrant:Qt(async({ - orderId:i} - )=>{ - try{ - return!!(await this.requestProductGrant(i,t))} - catch(s){ - return!1} - } - ,"processProductGrant")} - ,onEvent:Qt(e=>{ - s(),i({ - success:!0,transactionId:e.data.orderId,productId:t} - )} - ,"onEvent"),onError:Qt(t=>{ - s(); - const e=(null==t?void 0:t.code)||(null==t?void 0:t.message)||String(t); - i({ - success:!1,error:"USER_CANCELED"===e?"USER_CANCELED":e} - )} - ,"onError")} - )} - )} - async requestProductGrant(t,i){ - try{ - const{ - DataManager:s} - =await ei(async()=>{ - const{ - DataManager:t} - =await Promise.resolve().then(()=>eD); - return{ - DataManager:t} - } - ,void 0),e=await s.getInstance().shop.confirmTossPayment(t,i); - return!1!==(null==e?void 0:e.success)} - catch(s){ - return!1} - } - async restorePendingOrders(){ - var t; - try{ - const s=await emi.getPendingOrders(); - if(!(null==(t=null==s?void 0:s.orders)?void 0:t.length))return; - for(const t of s.orders)try{ - await this.requestProductGrant(t.orderId,t.sku||"")&&await emi.completeProductGrant({ - params:{ - orderId:t.orderId} - } - )} - catch(i){ - } - } - catch(i){ - } - } - supportsAds(){ - return"function"!=typeof Rmi.isSupported||Rmi.isSupported()} - getRewardedAdGroupId(t){ - return t&&this.rewardedAdGroupIds[t]?this.rewardedAdGroupIds[t]:this.defaultRewardedAdGroupId} - async preloadAds(){ - const t=new Set(Object.values(this.rewardedAdGroupIds)); - t.add(this.defaultRewardedAdGroupId); - for(const i of t)this.loadRewardedAd(i); - this.loadInterstitialAd()} - loadRewardedAd(t){ - var i,s; - this.rewardedAdLoaded[t]=!1,null==(s=(i=this.rewardedAdUnregisters)[t])||s.call(i),this.rewardedAdUnregisters[t]=Rmi({ - options:{ - adGroupId:t} - ,onEvent:Qt(i=>{ - "loaded"===i.type&&(this.rewardedAdLoaded[t]=!0)} - ,"onEvent"),onError:Qt(t=>{ - } - ,"onError")} - )} - loadInterstitialAd(){ - var t; - this.interstitialAdLoaded=!1,null==(t=this.interstitialAdUnregister)||t.call(this),this.interstitialAdUnregister=Rmi({ - options:{ - adGroupId:this.interstitialAdGroupId} - ,onEvent:Qt(t=>{ - "loaded"===t.type&&(this.interstitialAdLoaded=!0)} - ,"onEvent"),onError:Qt(t=>{ - } - ,"onError")} - )} - async showRewardedAd(t){ - const i=this.getRewardedAdGroupId(t); - return this.rewardedAdLoaded[i]?new Promise(t=>{ - this.pauseGameSound(),Pmi({ - options:{ - adGroupId:i} - ,onEvent:Qt(s=>{ - switch(s.type){ - case"userEarnedReward":t({ - watched:!0,rewardType:s.data.unitType,rewardAmount:s.data.unitAmount} - ); - break; - case"dismissed":this.resumeGameSound(),this.forceResizeAfterAd(),this.loadRewardedAd(i),t({ - watched:!1} - ); - break; - case"failedToShow":this.resumeGameSound(),t({ - watched:!1} - )} - } - ,"onEvent"),onError:Qt(i=>{ - this.resumeGameSound(),t({ - watched:!1} - )} - ,"onError")} - )} - ):{ - watched:!1} - } - async showInterstitialAd(){ - if(this.interstitialAdLoaded)return new Promise(t=>{ - this.pauseGameSound(),Pmi({ - options:{ - adGroupId:this.interstitialAdGroupId} - ,onEvent:Qt(i=>{ - "dismissed"!==i.type&&"failedToShow"!==i.type||(this.resumeGameSound(),this.forceResizeAfterAd(),this.loadInterstitialAd(),t())} - ,"onEvent"),onError:Qt(i=>{ - this.resumeGameSound(),t()} - ,"onError")} - )} - )} - forceResizeAfterAd(){ - ei(async()=>{ - const{ - EkkorrGame:t} - =await Promise.resolve().then(()=>$S); - return{ - EkkorrGame:t} - } - ,void 0).then(({ - EkkorrGame:t} - )=>{ - t.forceResize(),setTimeout(()=>t.forceResize(),100),setTimeout(()=>t.forceResize(),300)} - )} - pauseGameSound(){ - try{ - ei(async()=>{ - const{ - Howler:t} - =await Promise.resolve().then(()=>UG); - return{ - Howler:t} - } - ,void 0).then(({ - Howler:t} - )=>{ - t.mute(!0)} - )} - catch(frt){ - } - } - resumeGameSound(){ - try{ - ei(async()=>{ - const{ - Howler:t} - =await Promise.resolve().then(()=>UG); - return{ - Howler:t} - } - ,void 0).then(({ - Howler:t} - )=>{ - t.mute(!1)} - )} - catch(frt){ - } - } - showBackButton(t){ - } - hapticFeedback(t="medium"){ - const i={ - light:"tickWeak",medium:"tap",heavy:"basicMedium",success:"success",error:"error"} - ; - try{ - ei(()=>Promise.resolve().then(()=>gvi),void 0).then(s=>{ - var e; - null==(e=s.generateHapticFeedback)||e.call(s,{ - type:i[t]} - )} - )} - catch(frt){ - } - } - openLink(t){ - window.open(t,"_blank")} - getSafeAreaTop(){ - return this.safeAreaTop} - getSafeAreaBottom(){ - return 0} - async requestPermissionAndRegister(){ - return!1} - async getFcmToken(){ - return null} - async subscribeTopic(t){ - return!1} - async unsubscribeTopic(t){ - return!1} - setPushSettings(t){ - } - getPushSettings(){ - return null} - exitApp(){ - } - } - ; - Qt(mvi,"TossBridge"); - let vvi=mvi; - const _vi=Object.freeze(Object.defineProperty({ - __proto__:null,TossBridge:vvi} - ,Symbol.toStringTag,{ - value:"Module"} - )),Mvi=class{ - constructor(){ - Zt(this,"platformType","telegram"),Zt(this,"userId",null)} - isAvailable(){ - var t,i; - return"undefined"!=typeof window&&void 0!==(null==(i=null==(t=window.Telegram)?void 0:t.WebApp)?void 0:i.initData)&&""!==window.Telegram.WebApp.initData} - async initialize(){ - if(!this.isAvailable())return; - const t=window.Telegram.WebApp; - t.ready(),t.expand()} - async login(t){ - var i; - const s=null==(i=window.Telegram)?void 0:i.WebApp; - return(null==s?void 0:s.initData)?{ - platform:"telegram",platformId:"",authToken:s.initData} - :{ - platform:"guest",platformId:"",authToken:""} - } - getUserId(){ - return this.userId} - supportsPurchase(){ - return!0} - async purchase(t,i){ - return{ - success:!1,error:"Not implemented"} - } - supportsAds(){ - return!1} - async preloadAds(){ - } - async showRewardedAd(t){ - return{ - watched:!1} - } - async showInterstitialAd(){ - } - showBackButton(t){ - var i,s,e; - const n=null==(i=window.Telegram)?void 0:i.WebApp; - n&&(t?null==(s=n.BackButton)||s.show():null==(e=n.BackButton)||e.hide())} - hapticFeedback(t="medium"){ - var i,s,e; - null==(e=null==(s=null==(i=window.Telegram)?void 0:i.WebApp)?void 0:s.HapticFeedback)||e.impactOccurred({ - light:"light",medium:"medium",heavy:"heavy",success:"medium",error:"heavy"} - [t])} - openLink(t){ - var i; - const s=null==(i=window.Telegram)?void 0:i.WebApp; - s?s.openLink(t):window.open(t,"_blank")} - share(t,i){ - var s; - const e=null==(s=window.Telegram)?void 0:s.WebApp; - e&&i&&e.openTelegramLink(`https://t.me/share/url?url=${ - encodeURIComponent(i)} - &text=${ - encodeURIComponent(t)} - `)} - getSafeAreaTop(){ - return 0} - getSafeAreaBottom(){ - return 0} - async requestPermissionAndRegister(){ - return!1} - async getFcmToken(){ - return null} - async subscribeTopic(t){ - return!1} - async unsubscribeTopic(t){ - return!1} - setPushSettings(t){ - } - getPushSettings(){ - return null} - exitApp(){ - } - } - ; - Qt(Mvi,"TelegramBridge"); - let bvi=Mvi; - const yvi=Object.freeze(Object.defineProperty({ - __proto__:null,TelegramBridge:bvi} - ,Symbol.toStringTag,{ - value:"Module"} - )),Evi=VKt("App",{ - web:Qt(()=>ei(()=>Promise.resolve().then(()=>hji),void 0).then(t=>new t.AppWeb),"web")} - ),Avi=VKt("AdMob"),Svi=class t{ - static isInitialized(){ - return!!CS.isAppBundleVersionLessThan("1.3.31")||this.initialized} - static async initialize(){ - try{ - const t=await Avi.initialize(); - this.initialized=t.success,eN.addExtraParams("admob_init_success",Xoi.getInstance().getString(t))} - catch(t){ - this.initialized=!1,eN.addExtraParams("admob_init_error",Xoi.getInstance().getString(t))} - } - static async requestConsent(){ - if(this.isInitialized())try{ - let t=await Avi.requestConsent({ - } - ); - this.useNonPersonalized="OBTAINED"!==t.status&&"NOT_REQUIRED"!==t.status,eN.addExtraParams("admob_useNonPersonalized",String(this.useNonPersonalized)),eN.addExtraParams("admob_consent_success",Xoi.getInstance().getString(t))} - catch(t){ - this.useNonPersonalized=!0,eN.addExtraParams("admob_consent_error",Xoi.getInstance().getString(t))} - } - static isTestMode(){ - return xG.getInstance().development||xG.getInstance().stage} - static async getRewardedAdUnits(){ - const i=OG.getInstance(); - let s=this.adUnitsGoogleTest; - if("ios"==i.buildType&&(s=this.adUnitsAppleTest),t.isTestMode())return xG.getInstance().development&&Z4t.getInstance().show("테스트 광고 모드",350,16777215,ZD.getInstance(),!0,600),s; - if(0==this.adStateChecked){ - const t=await sD.getInstance().ads.checkAdState(); - 1==t.success&&(this.adStateChecked=!0,i.setAdWhiteUser(Boolean(t.body)))} - return i.isAdWhiteUser()?(Z4t.getInstance().show("테스트 광고 모드",350,16777215,ZD.getInstance(),!0,600),s):(i.isGoogleClientKr()?s=this.adUnitsGoogleKr:i.isAppleClientKr()?s=this.adUnitsAppleKr:i.isGoogleClient()?s=this.adUnitsGoogle:i.isAppleClient()&&(s=this.adUnitsApple),s)} - static async getAdUnitId(t){ - const i=await this.getRewardedAdUnits(); - return t&&i[t]?i[t]:i[0]} - static async preloadAll(){ - if(!this.isInitialized())return void eN.addExtraParams("admob_preload","admob not initialized"); - const t=await this.getRewardedAdUnits(),i=new Set(Object.values(t)); - for(const s of i)this.loadAd(s)} - static async loadAd(t){ - if(!this.isInitialized())return this.adLoaded[t]=!1,void eN.addExtraParams("admob_loadAd",`admob not initialized (adUnitId: ${ - t} - )`); - const i=this.loadingPromise[t]; - if(i)return i; - const s=this.loadAdInternal(t).finally(()=>{ - this.loadingPromise[t]=null} - ); - return this.loadingPromise[t]=s,s} - static async loadAdInternal(i){ - try{ - const s=await Avi.loadRewardedAd({ - adUnitId:i,nonPersonalized:this.useNonPersonalized} - ); - this.adLoaded[i]=s.loaded,s.loaded?this.retryDelay[i]=t.RETRY_BASE_MS:this.scheduleRetry(i)} - catch(s){ - this.adLoaded[i]=!1,this.scheduleRetry(i)} - } - static scheduleRetry(i){ - if(this.retryTimer[i])return; - const s=this.retryDelay[i]??t.RETRY_BASE_MS; - this.retryDelay[i]=Math.min(2*s,t.RETRY_MAX_MS),this.retryTimer[i]=setTimeout(()=>{ - this.retryTimer[i]=null,this.loadAd(i)} - ,s)} - static async waitLoadWithTimeout(t,i){ - const s=this.loadAd(t); - return await Promise.race([s,new Promise(t=>setTimeout(t,i))]),this.isLoaded(t)} - static isLoaded(t){ - return!0===this.adLoaded[t]} - static async showRewardedAd(i){ - let s=i; - if(this.isPremiumAdsAvailable())switch(i){ - case 2:s=10; - break; - case 11:s=11} - let e=await this.getAdUnitId(s); - if(!this.isInitialized()){ - eN.addExtraParams("admob_showRewardedAd",`admob not initialized (adUnitId: ${ - e} - )`); - let t=NB.getText("COMMON_447","광고를 불러올 수 없습니다.(0)")+"\n"+NB.getText("COMMON_82","잠시 후에 다시 시도해 주세요."); - return Z4t.getInstance().show(t,350,16777215,ZD.getInstance(),!0),{ - watched:!1} - } - if(!this.isLoaded(e)&&(await this.waitLoadWithTimeout(e,t.LOAD_TIMEOUT_MS),!this.isLoaded(e))){ - let t=NB.getText("COMMON_447","광고를 불러올 수 없습니다.")+"\n"+NB.getText("COMMON_82","잠시 후에 다시 시도해 주세요."); - return Z4t.getInstance().show(t,350,16777215,ZD.getInstance(),!0),{ - watched:!1} - } - try{ - const t=await Avi.showRewardedAd({ - adUnitId:e,nonPersonalized:this.useNonPersonalized} - ); - return this.adLoaded[e]=!1,this.loadAd(e),t} - catch(n){ - let t=NB.getText("COMMON_448","광고 표시에 실패했습니다.")+"\n"+NB.getText("COMMON_82","잠시 후에 다시 시도해 주세요."); - return Z4t.getInstance().show(t,350,16777215,ZD.getInstance(),!0),this.adLoaded[e]=!1,this.loadAd(e),{ - watched:!1} - } - } - static isPremiumAdsAvailable(){ - let t=!1; - if(CS.isAppBundleVersionGreaterThan("1.11.76")){ - const i=OG.getInstance().getClientData("ADMOB_PREMIUMADS_YN"); - t=!i||"N"!=i} - return t} - } - ; - Qt(Svi,"AdMobManager"),Zt(Svi,"adLoaded",{ - } - ),Zt(Svi,"LOAD_TIMEOUT_MS",1e4),Zt(Svi,"PREMIUM_LOAD_TIMEOUT_MS",3e3),Zt(Svi,"RETRY_BASE_MS",3e4),Zt(Svi,"RETRY_MAX_MS",3e5),Zt(Svi,"retryDelay",{ - } - ),Zt(Svi,"retryTimer",{ - } - ),Zt(Svi,"loadingPromise",{ - } - ),Zt(Svi,"useNonPersonalized",!1),Zt(Svi,"initialized",!1),Zt(Svi,"adUnitsGoogleTest",{ - 0:"ca-app-pub-3940256099942544/5224354917",4:"ca-app-pub-3940256099942544/5224354917",5:"ca-app-pub-3940256099942544/5224354917",10:"ca-app-pub-3940256099942544/5224354917",11:"ca-app-pub-3940256099942544/5224354917"} - ),Zt(Svi,"adUnitsAppleTest",{ - 0:"ca-app-pub-3940256099942544/1712485313",4:"ca-app-pub-3940256099942544/1712485313",5:"ca-app-pub-3940256099942544/1712485313",10:"ca-app-pub-3940256099942544/1712485313",11:"ca-app-pub-3940256099942544/1712485313"} - ),Zt(Svi,"adUnitsGoogleKr",{ - 0:"ca-app-pub-3559942166422150/5418225700",4:"ca-app-pub-3559942166422150/9929585274",5:"ca-app-pub-3559942166422150/4889011580",10:"ca-app-pub-3559942166422150/7894844029",11:"ca-app-pub-3559942166422150/8611597073"} - ),Zt(Svi,"adUnitsAppleKr",{ - 0:"ca-app-pub-3559942166422150/5832429725",4:"ca-app-pub-3559942166422150/2071276552",5:"ca-app-pub-3559942166422150/4105144032",10:"ca-app-pub-3559942166422150/6893623087",11:"ca-app-pub-3559942166422150/5354526695"} - ),Zt(Svi,"adUnitsGoogle",{ - 0:"ca-app-pub-3559942166422150/8105323559",4:"ca-app-pub-3559942166422150/3152379775",5:"ca-app-pub-3559942166422150/1703566734",10:"ca-app-pub-3559942166422150/4706443446",11:"ca-app-pub-3559942166422150/1575063787"} - ),Zt(Svi,"adUnitsApple",{ - 0:"ca-app-pub-3559942166422150/5524835204",4:"ca-app-pub-3559942166422150/4211753536",5:"ca-app-pub-3559942166422150/4193786677",10:"ca-app-pub-3559942166422150/8454116769",11:"ca-app-pub-3559942166422150/9836697185"} - ),Zt(Svi,"adStateChecked",!1); - let Tvi=Svi; - var Cvi,Ovi,Ivi,kvi; - (Ovi=Cvi||(Cvi={ - } - )).IndexedDbLocal="INDEXED_DB_LOCAL",Ovi.InMemory="IN_MEMORY",Ovi.BrowserLocal="BROWSER_LOCAL",Ovi.BrowserSession="BROWSER_SESSION",(kvi=Ivi||(Ivi={ - } - )).APPLE="apple.com",kvi.FACEBOOK="facebook.com",kvi.GAME_CENTER="gc.apple.com",kvi.GITHUB="github.com",kvi.GOOGLE="google.com",kvi.MICROSOFT="microsoft.com",kvi.PLAY_GAMES="playgames.google.com",kvi.TWITTER="twitter.com",kvi.YAHOO="yahoo.com",kvi.PASSWORD="password",kvi.PHONE="phone"; - const xvi=VKt("FirebaseAuthentication",{ - web:Qt(()=>ei(()=>Promise.resolve().then(()=>x0i),void 0).then(t=>new t.FirebaseAuthenticationWeb),"web")} - ),Rvi=class{ - static async signIn(){ - const t=await xvi.signInWithApple(),i=t.user,s=t.credential; - if(!i)throw new Error("Apple Sign-In failed: no user returned"); - return{ - platform:"apple",platformId:i.uid,idToken:(null==s?void 0:s.idToken)||""} - } - } - ; - Qt(Rvi,"AppleAuthManager"); - let Pvi=Rvi; - const Nvi=VKt("PlayGames"),Lvi=class{ - static async signIn(){ - try{ - const t=await Nvi.signIn(); - return this._authenticated=t.isAuthenticated,t} - catch(t){ - return this._authenticated=!1,{ - isAuthenticated:!1} - } - } - static get isAuthenticated(){ - return this._authenticated} - static async unlockAchievement(t){ - if(!this._authenticated)return!1; - try{ - return(await Nvi.unlockAchievement({ - achievementId:t} - )).success} - catch(i){ - return!1} - } - static async incrementAchievement(t,i=1){ - if(!this._authenticated)return!1; - try{ - return(await Nvi.incrementAchievement({ - achievementId:t,steps:i} - )).success} - catch(s){ - return!1} - } - static async unlockAchievements(t){ - if(!this._authenticated||0===t.length)return 0; - try{ - return(await Nvi.unlockAchievements({ - achievementIds:t} - )).count||0} - catch(i){ - return 0} - } - static async showAchievements(){ - if(this._authenticated)try{ - await Nvi.showAchievements()} - catch(t){ - } - } - static get isPcCache(){ - return this._isPcCache} - static async isPlayGamesPC(){ - if(null!==this._isPcCache)return this._isPcCache; - try{ - const t=await Nvi.isPlayGamesPC(); - return this._isPcCache=!!t.isPc,this._isPcCache} - catch(t){ - return this._isPcCache=!1,!1} - } - static async requestServerSideAccess(t){ - if(!this._authenticated)return null; - try{ - return(await Nvi.requestServerSideAccess({ - webClientId:t,forceRefreshToken:!1} - )).code||null} - catch(i){ - return null} - } - } - ; - Qt(Lvi,"PlayGamesManager"),Zt(Lvi,"_authenticated",!1),Zt(Lvi,"_isPcCache",null); - let Dvi=Lvi; - const Gvi=Object.freeze(Object.defineProperty({ - __proto__:null,PlayGamesManager:Dvi} - ,Symbol.toStringTag,{ - value:"Module"} - )),Bvi=class{ - static async signIn(){ - const t=await Dvi.isPlayGamesPC(),i=OG.getInstance().getWebClientId(); - if(t&&i&&Dvi.isAuthenticated)try{ - return await this.signInForPC()} - catch(frt){ - } - return await this.signInMobile()} - static async signInMobile(){ - const t=await xvi.signInWithGoogle(),i=t.user,s=t.credential; - if(!i)throw new Error("Google Sign-In failed: no user returned"); - return{ - platform:"google",platformId:i.uid,idToken:(null==s?void 0:s.idToken)||""} - } - static async signInForPC(){ - const t=OG.getInstance().getWebClientId(); - if(!t)throw new Error("PC sign-in: no web client id"); - const i=await Dvi.requestServerSideAccess(t); - if(!i)throw new Error("PC sign-in: no server auth code"); - const{ - DataManager:s} - =await ei(async()=>{ - const{ - DataManager:t} - =await Promise.resolve().then(()=>eD); - return{ - DataManager:t} - } - ,void 0),e=await s.getInstance().account.exchangeGooglePcCode(i); - if(0==e.success)throw new Error("PC sign-in failed"); - const n=e.body.customToken; - if(!n)throw new Error("exchange: no customToken in response"); - const h=(await xvi.signInWithCustomToken({ - token:n} - )).user; - if(!h)throw new Error("PC sign-in: no Firebase user returned"); - let r=""; - try{ - r=(await xvi.getIdToken()).token||""} - catch(frt){ - } - return{ - platform:"google",platformId:h.uid,idToken:r} - } - static async getCurrentUser(){ - return(await xvi.getCurrentUser()).user} - static async signOut(){ - await xvi.signOut()} - } - ; - Qt(Bvi,"GoogleAuthManager"); - let Uvi=Bvi; - var Fvi,$vi,Hvi,Wvi; - ($vi=Fvi||(Fvi={ - } - ))[$vi.Min=1]="Min",$vi[$vi.Low=2]="Low",$vi[$vi.Default=3]="Default",$vi[$vi.High=4]="High",$vi[$vi.Max=5]="Max",(Wvi=Hvi||(Hvi={ - } - ))[Wvi.Secret=-1]="Secret",Wvi[Wvi.Private=0]="Private",Wvi[Wvi.Public=1]="Public"; - const Vvi=VKt("FirebaseMessaging",{ - web:Qt(()=>ei(()=>Promise.resolve().then(()=>Y2i),void 0).then(t=>new t.FirebaseMessagingWeb),"web")} - ),jvi=VKt("PushNotifications",{ - } - ),Kvi=class t{ - constructor(){ - Zt(this,"initialized",!1),Zt(this,"pushEnabled",!0),Zt(this,"pushNightEnabled",!1),Zt(this,"timezone",-99999)} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - async init(){ - this.initialized||(this.initialized=!0,await this.addListeners())} - async addListeners(){ - await jvi.addListener("registration",t=>{ - } - ),await jvi.addListener("registrationError",t=>{ - } - ),await jvi.addListener("pushNotificationReceived",async t=>{ - try{ - const{ - EventDispatcher:t} - =await ei(async()=>{ - const{ - EventDispatcher:t} - =await Promise.resolve().then(()=>Px); - return{ - EventDispatcher:t} - } - ,void 0); - t.getInstance().dispatchCustomEvent("MailUpdate",{ - forced:!0} - )} - catch(i){ - } - } - ),await jvi.addListener("pushNotificationActionPerformed",t=>{ - } - ),await Vvi.addListener("tokenReceived",async t=>{ - } - )} - async requestPermissionAndRegister(){ - await this.init(); - let t=await jvi.checkPermissions(); - return"granted"!==t.receive&&(t=await jvi.requestPermissions()),"granted"===t.receive&&(await jvi.register(),!0)} - async getFcmToken(){ - try{ - return(await Vvi.getToken()).token??null} - catch(t){ - return null} - } - async subscribeTopic(t){ - try{ - return await Vvi.subscribeToTopic({ - topic:t} - ),!0} - catch(i){ - return!1} - } - async unsubscribeTopic(t){ - try{ - return await Vvi.unsubscribeFromTopic({ - topic:t} - ),!0} - catch(i){ - return!1} - } - setPushSettings(t){ - t&&("pushEnabled"in t&&(this.pushEnabled=t.pushEnabled),"pushNightEnabled"in t&&(this.pushNightEnabled=t.pushNightEnabled),"timezone"in t&&(this.timezone=t.timezone))} - getPushSettings(){ - return{ - pushEnabled:this.pushEnabled,pushNightEnabled:this.pushNightEnabled,timezone:this.timezone,deviceTimezone:OG.getInstance().getDeviceTimezone()} - } - } - ; - Qt(Kvi,"PushNotificationManager"),Zt(Kvi,"_instance"); - let zvi=Kvi; - const Yvi=class{ - constructor(){ - Zt(this,"platformType","capacitor"),Zt(this,"userId",null),Zt(this,"safeAreaTop",0),Zt(this,"safeAreaBottom",0),Zt(this,"objProd",{ - } - )} - isAvailable(){ - return"undefined"!=typeof window} - async initialize(){ - if(await this.readSafeAreaInsets(),"android"===WKt.getPlatform()){ - Dvi.signIn().catch(t=>{ - } - ); - const t=await Dvi.isPlayGamesPC(); - OG.getInstance().setPlayGamesPC(t)} - } - async syncPgsAchievements(){ - if("android"===WKt.getPlatform()&&Dvi.isAuthenticated)try{ - const{ - AchievementDataManager:t} - =await ei(async()=>{ - const{ - AchievementDataManager:t} - =await Promise.resolve().then(()=>AYt); - return{ - AchievementDataManager:t} - } - ,void 0),{ - getPgsAchievementId:i} - =await ei(async()=>{ - const{ - getPgsAchievementId:t} - =await Promise.resolve().then(()=>lEi); - return{ - getPgsAchievementId:t} - } - ,void 0),s=t.getInstance().getClaimedAchievements(),e=[]; - for(const{ - type:n,main:h} - of s){ - const t=i(n,h); - t&&e.push(t)} - e.length>0&&await Dvi.unlockAchievements(e)} - catch(frt){ - } - } - recoverPendingPurchases(){ - "ios"===WKt.getPlatform()?this.recoverPendingAppleTransactions():"android"===WKt.getPlatform()&&this.recoverPendingGooglePurchases()} - async recoverPendingAppleTransactions(){ - var t,i,s; - let e=!1; - try{ - const h=await xzt.getPendingTransactions(); - if(0===h.length)return; - const{ - DataManager:r} - =await ei(async()=>{ - const{ - DataManager:t} - =await Promise.resolve().then(()=>eD); - return{ - DataManager:t} - } - ,void 0),{ - ShopDataManager:o} - =await ei(async()=>{ - const{ - ShopDataManager:t} - =await Promise.resolve().then(()=>w4); - return{ - ShopDataManager:t} - } - ,void 0),{ - InAppPurchaseManager:a} - =await ei(async()=>{ - const{ - InAppPurchaseManager:t} - =await Promise.resolve().then(()=>yzt); - return{ - InAppPurchaseManager:t} - } - ,void 0); - for(const c of h)try{ - const n=o.getInstance().getProductIdByStoreProductId(c.productId); - if(n<=0)continue; - const h=c.productId; - let l; - l=this.isSubscriptionProduct(h)?await r.getInstance().subscription.confirmApple(n,c.receipt,1):await r.getInstance().shop.confirmApplePayment(-1,c.transactionId,c.receipt,h,1),(null==l?void 0:l.success)&&(await xzt.finishTransaction(c.transactionId),"COMPLETED"===(null==(t=null==l?void 0:l.body)?void 0:t.status)&&((null==(s=null==(i=null==l?void 0:l.body)?void 0:i.rewardTypes)?void 0:s.length)??0)>0&&(e=!0,a.getInstance().trackPurchase(n,c.transactionId)))} - catch(n){ - } - } - catch(n){ - } - if(e){ - const{ - MailManager:t} - =await ei(async()=>{ - const{ - MailManager:t} - =await Promise.resolve().then(()=>NYt); - return{ - MailManager:t} - } - ,void 0); - t.getMailList()} - } - async recoverPendingGooglePurchases(){ - var t,i,s; - let e=!1; - try{ - const h=await Nzt.restorePurchases(); - if(0===h.length)return; - const{ - DataManager:r} - =await ei(async()=>{ - const{ - DataManager:t} - =await Promise.resolve().then(()=>eD); - return{ - DataManager:t} - } - ,void 0),{ - ShopDataManager:o} - =await ei(async()=>{ - const{ - ShopDataManager:t} - =await Promise.resolve().then(()=>w4); - return{ - ShopDataManager:t} - } - ,void 0),{ - InAppPurchaseManager:a} - =await ei(async()=>{ - const{ - InAppPurchaseManager:t} - =await Promise.resolve().then(()=>yzt); - return{ - InAppPurchaseManager:t} - } - ,void 0); - for(const c of h)try{ - const n=o.getInstance().getProductIdByStoreProductId(c.productId); - if(n<=0)continue; - const h=c.productId; - let l; - l=this.isSubscriptionProduct(h)?await r.getInstance().subscription.confirmGoogle(n,h,c.purchaseToken,1):await r.getInstance().shop.confirmGooglePayment(-1,c.purchaseToken,h,1),(null==l?void 0:l.success)&&"COMPLETED"===(null==(t=null==l?void 0:l.body)?void 0:t.status)&&((null==(s=null==(i=null==l?void 0:l.body)?void 0:i.rewardTypes)?void 0:s.length)??0)>0&&(e=!0,a.getInstance().trackPurchase(n,c.orderId))} - catch(n){ - } - } - catch(n){ - } - if(e){ - const{ - MailManager:t} - =await ei(async()=>{ - const{ - MailManager:t} - =await Promise.resolve().then(()=>NYt); - return{ - MailManager:t} - } - ,void 0); - t.getMailList()} - } - isSubscriptionProduct(t){ - return!!t&&!!t.includes("assistant_")} - async readSafeAreaInsets(){ - var t,i; - if(WKt.isPluginAvailable("SafeArea"))try{ - const s="@capacitor-community/safe-area",e=await import(s).catch(()=>null),n=null==e?void 0:e.SafeArea; - if(n&&"function"==typeof n.getSafeAreaInsets){ - const s=await n.getSafeAreaInsets(),e=(null==(t=null==s?void 0:s.insets)?void 0:t.top)??0,h=(null==(i=null==s?void 0:s.insets)?void 0:i.bottom)??0; - return void this.applySafeAreaPx(e,h,"plugin")} - } - catch(frt){ - } - this.readSafeAreaFromCss()} - readSafeAreaFromCss(){ - try{ - const t=document.createElement("div"); - t.style.position="fixed",t.style.visibility="hidden",document.body.appendChild(t),t.style.height="env(safe-area-inset-top, 0px)"; - const i=t.offsetHeight; - t.style.height="env(safe-area-inset-bottom, 0px)"; - const s=t.offsetHeight; - document.body.removeChild(t),this.applySafeAreaPx(i,s,"css-env")} - catch(frt){ - } - } - applySafeAreaPx(t,i,s){ - var e; - const n=640/((null==(e=window.visualViewport)?void 0:e.width)??window.innerWidth); - this.safeAreaTop=Math.round(t*n),this.safeAreaBottom=Math.round(i*n)} - async login(t){ - t||(t=WKt.getPlatform()); - let i=!1; - "apple"!=t&&"ios"!=t||(i=!0); - const s=i?await Pvi.signIn():await Uvi.signIn(); - return this.userId=s.platformId,{ - platform:s.platform,platformId:s.platformId,authToken:s.idToken} - } - getUserId(){ - return this.userId} - supportsPurchase(){ - return!0} - async purchase(t,i){ - return"ios"===WKt.getPlatform()?(await this.getProductsApple(t),this.purchaseApple(t)):(await this.getProductsGoogle(t),this.purchaseGoogle(t))} - async purchaseApple(t){ - var i; - if(0==await xzt.canMakePurchases())return{ - success:!1,error:`${ - NB.getText("COMMON_444","[앱 내 구입]이 허용되어 있는지 확인해 주세요.")} - (*${ - NB.getText("COMMON_445",'설정 > 스크린 타임 > 콘텐츠 및 개인 정보 보호 제한 > iTunes 및 App Store 구입 > 앱 내 구입 "허용"')} - )`} - ; - try{ - const s=Number(t),{ - ShopDataManager:e} - =await ei(async()=>{ - const{ - ShopDataManager:t} - =await Promise.resolve().then(()=>w4); - return{ - ShopDataManager:t} - } - ,[]),{ - ConfigManager:n} - =await ei(async()=>{ - const{ - ConfigManager:t} - =await Promise.resolve().then(()=>IG); - return{ - ConfigManager:t} - } - ,void 0); - if(!e.getInstance().getByProductId(s))return{ - success:!1,error:"Product not found"} - ; - let h=!1; - try{ - h=n.getInstance().isAppleClientKr()} - catch(frt){ - } - const r=e.getInstance().getStoreProductIdByProductId(s); - if(!r)return{ - success:!1,error:"Apple product ID not found"} - ; - const o=await xzt.purchase(r); - if(!o.success)return{ - success:!1,error:o.error} - ; - const{ - ServerStatusManager:a} - =await ei(async()=>{ - const{ - ServerStatusManager:t} - =await Promise.resolve().then(()=>PG); - return{ - ServerStatusManager:t} - } - ,void 0); - if(a.getInstance().development){ - const t=n.getInstance().getClientData("IN_APP_SHOP_PENDING_TEST"); - if(t&&"Y"==t)return{ - success:!1,error:"USER_CANCELED"} - } - const{ - DataManager:c} - =await ei(async()=>{ - const{ - DataManager:t} - =await Promise.resolve().then(()=>eD); - return{ - DataManager:t} - } - ,void 0),l=await c.getInstance().shop.confirmApplePayment(s,o.transactionId,o.receipt||"",r,0); - return(null==l?void 0:l.success)?(o.transactionId&&await xzt.finishTransaction(o.transactionId),{ - success:!0,transactionId:o.transactionId,productId:r,rewardTypes:null==(i=l.body)?void 0:i.rewardTypes,serverData:l.body} - ):{ - success:!1,error:(null==l?void 0:l.error)||"confirmApplePayment failed"} - } - catch(s){ - return{ - success:!1,error:(null==s?void 0:s.message)||"Purchase failed"} - } - } - async purchaseGoogle(t){ - var i; - try{ - const s=Number(t),{ - ShopDataManager:e} - =await ei(async()=>{ - const{ - ShopDataManager:t} - =await Promise.resolve().then(()=>w4); - return{ - ShopDataManager:t} - } - ,void 0),{ - DataManager:n} - =await ei(async()=>{ - const{ - DataManager:t} - =await Promise.resolve().then(()=>eD); - return{ - DataManager:t} - } - ,void 0),h=e.getInstance().getStoreProductIdByProductId(s),r=await Nzt.purchase(h); - if(!r.success)return{ - success:!1,error:r.error} - ; - const{ - ServerStatusManager:o} - =await ei(async()=>{ - const{ - ServerStatusManager:t} - =await Promise.resolve().then(()=>PG); - return{ - ServerStatusManager:t} - } - ,void 0); - if(o.getInstance().development){ - const t=OG.getInstance().getClientData("IN_APP_SHOP_PENDING_TEST"); - if(t&&"Y"==t)return{ - success:!1,error:"USER_CANCELED"} - } - const a=await n.getInstance().shop.confirmGooglePayment(s,r.purchaseToken,h,0); - return(null==a?void 0:a.success)?{ - success:!0,transactionId:r.orderId,productId:h,rewardTypes:null==(i=a.body)?void 0:i.rewardTypes,serverData:a.body} - :{ - success:!1,error:(null==a?void 0:a.error)||"confirmGooglePayment failed"} - } - catch(s){ - return{ - success:!1,error:(null==s?void 0:s.message)||"Purchase failed"} - } - } - async getProductsApple(t){ - const{ - ShopDataManager:i} - =await ei(async()=>{ - const{ - ShopDataManager:t} - =await Promise.resolve().then(()=>w4); - return{ - ShopDataManager:t} - } - ,void 0),s=i.getInstance().getStoreProductIdByProductId(Number(t)); - if(1==this.objProd[s])return; - const e=await xzt.getProducts([s]); - for(const n of e)n&&(this.objProd[n.id]=!0)} - async getProductsGoogle(t){ - const{ - ShopDataManager:i} - =await ei(async()=>{ - const{ - ShopDataManager:t} - =await Promise.resolve().then(()=>w4); - return{ - ShopDataManager:t} - } - ,void 0),s=i.getInstance().getStoreProductIdByProductId(Number(t)); - if(1==this.objProd[s])return; - const e=await Nzt.getProducts([s]); - for(const n of e)n&&(this.objProd[n.productId]=!0)} - supportsAds(){ - return!0} - async preloadAds(){ - if(0==CS.isAppBundleVersionLessThan("1.3.31")){ - await Tvi.initialize(); - const t=OG.getInstance(); - (t.isGoogleClient()||t.isAppleClient())&&await Tvi.requestConsent()} - await Tvi.preloadAll()} - async showRewardedAd(t){ - try{ - this.pauseGameSound(); - const i=await Tvi.showRewardedAd(t); - return this.resumeGameSound(),this.forceResizeAfterAd(),{ - watched:i.watched,rewardType:i.rewardType,rewardAmount:i.rewardAmount} - } - catch(i){ - return this.resumeGameSound(),{ - watched:!1} - } - } - async showInterstitialAd(){ - } - forceResizeAfterAd(){ - ei(async()=>{ - const{ - EkkorrGame:t} - =await Promise.resolve().then(()=>$S); - return{ - EkkorrGame:t} - } - ,void 0).then(({ - EkkorrGame:t} - )=>{ - t.forceResize(),setTimeout(()=>t.forceResize(),100),setTimeout(()=>t.forceResize(),300)} - )} - pauseGameSound(){ - try{ - ei(async()=>{ - const{ - Howler:t} - =await Promise.resolve().then(()=>UG); - return{ - Howler:t} - } - ,void 0).then(({ - Howler:t} - )=>{ - t.mute(!0)} - )} - catch(frt){ - } - } - resumeGameSound(){ - try{ - ei(async()=>{ - const{ - Howler:t} - =await Promise.resolve().then(()=>UG); - return{ - Howler:t} - } - ,void 0).then(({ - Howler:t} - )=>{ - t.mute(!1)} - )} - catch(frt){ - } - } - showBackButton(t){ - } - hapticFeedback(t="medium"){ - var i,s; - "light"!==t||"android"!==WKt.getPlatform()?ei(async()=>{ - const{ - Haptics:t,ImpactStyle:i,NotificationType:s} - =await Promise.resolve().then(()=>t5i); - return{ - Haptics:t,ImpactStyle:i,NotificationType:s} - } - ,void 0).then(({ - Haptics:i,ImpactStyle:s,NotificationType:e} - )=>{ - switch(t){ - case"light":i.impact({ - style:s.Light} - ); - break; - case"medium":i.impact({ - style:s.Medium} - ); - break; - case"heavy":i.impact({ - style:s.Heavy} - ); - break; - case"success":i.notification({ - type:e.Success} - ); - break; - case"error":i.notification({ - type:e.Error} - )} - } - ).catch(()=>{ - } - ):null==(s=null==(i=WKt.Plugins)?void 0:i.LightHaptic)||s.tap().catch(()=>{ - } - )} - openLink(t){ - window.open(t,"_blank")} - getSafeAreaTop(){ - return this.safeAreaTop} - getSafeAreaBottom(){ - return this.safeAreaBottom} - async requestPermissionAndRegister(){ - return await zvi.getInstance().requestPermissionAndRegister()} - async getFcmToken(){ - return await zvi.getInstance().getFcmToken()} - async subscribeTopic(t){ - return await zvi.getInstance().subscribeTopic(t)} - async unsubscribeTopic(t){ - return await zvi.getInstance().unsubscribeTopic(t)} - setPushSettings(t){ - zvi.getInstance().setPushSettings(t)} - getPushSettings(){ - return zvi.getInstance().getPushSettings()} - exitApp(){ - try{ - Evi.exitApp()} - catch(t){ - } - } - } - ; - Qt(Yvi,"CapacitorBridge"); - let qvi=Yvi; - function Xvi(){ - return WKt.isNativePlatform()?WKt.getPlatform():""} - Qt(Xvi,"getCapacitoryBuildType"); - const Jvi=Object.freeze(Object.defineProperty({ - __proto__:null,CapacitorBridge:qvi,getCapacitoryBuildType:Xvi} - ,Symbol.toStringTag,{ - value:"Module"} - )),Qvi=class{ - constructor(){ - Zt(this,"platformType","web"),Zt(this,"userId",null),Zt(this,"safeAreaTop",0),Zt(this,"safeAreaBottom",0)} - isAvailable(){ - return"undefined"!=typeof window} - async initialize(){ - this.readSafeAreaInsets()} - readSafeAreaInsets(){ - var t; - try{ - const i=document.createElement("div"); - i.style.position="fixed",i.style.visibility="hidden",document.body.appendChild(i),i.style.height="env(safe-area-inset-top, 0px)"; - const s=i.offsetHeight; - i.style.height="env(safe-area-inset-bottom, 0px)"; - const e=i.offsetHeight; - document.body.removeChild(i); - const n=640/((null==(t=window.visualViewport)?void 0:t.width)??window.innerWidth); - this.safeAreaTop=Math.round(s*n),this.safeAreaBottom=Math.round(e*n); - const h=new URLSearchParams(window.location.search),r=Number(h.get("safeTop")),o=Number(h.get("safeBottom")); - r>0&&(this.safeAreaTop=r),o>0&&(this.safeAreaBottom=o)} - catch(frt){ - } - } - async login(t){ - return{ - platform:"guest",platformId:"",authToken:""} - } - getUserId(){ - return this.userId} - supportsPurchase(){ - return!1} - async purchase(t,i){ - return{ - success:!1,error:"Not supported on web"} - } - supportsAds(){ - return!1} - async preloadAds(){ - } - async showRewardedAd(t){ - return{ - watched:!1} - } - async showInterstitialAd(){ - } - showBackButton(t){ - } - hapticFeedback(t="medium"){ - navigator.vibrate&&navigator.vibrate({ - light:30,medium:50,heavy:100,success:[50,30,50],error:[80,40,80,40,80]} - [t])} - openLink(t){ - window.open(t,"_blank")} - getSafeAreaTop(){ - return this.safeAreaTop} - getSafeAreaBottom(){ - return this.safeAreaBottom} - async requestPermissionAndRegister(){ - return!1} - async getFcmToken(){ - return null} - async subscribeTopic(t){ - return!1} - async unsubscribeTopic(t){ - return!1} - setPushSettings(t){ - } - getPushSettings(){ - return null} - exitApp(){ - } - } - ; - Qt(Qvi,"WebBridge"); - let Zvi=Qvi; - const t_i=Object.freeze(Object.defineProperty({ - __proto__:null,WebBridge:Zvi} - ,Symbol.toStringTag,{ - value:"Module"} - )),i_i=VKt("CapacitorPlayIntegrity",{ - web:Qt(()=>ei(()=>Promise.resolve().then(()=>e5i),void 0).then(t=>new t.CapacitorPlayIntegrityWeb),"web")} - ),s_i=Object.freeze(Object.defineProperty({ - __proto__:null,PlayIntegrity:i_i} - ,Symbol.toStringTag,{ - value:"Module"} - )),e_i=VKt("AppSig"),n_i=Object.freeze(Object.defineProperty({ - __proto__:null,AppSig:e_i} - ,Symbol.toStringTag,{ - value:"Module"} - )),h_i=class t extends pB{ - constructor(){ - super(),Zt(this,"lblMessage",new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_18)),Zt(this,"lblReward",new OF("UI_STAR_ICON","0",16750848,hD.DEFAULT_OUTLINE_FONT_OPTION_18)),Zt(this,"btnEnd",new M$("","","확인",.8,150,70)),Zt(this,"btnEndBonus",new M$("UI_GEM",String(t.GEM_COST),"훈장 x 2",.8,220,70)),Zt(this,"requestPending",!1),Zt(this,"pendingReward",0),this.title=NB.getText("GAME_899","휴식 종료"),this.lblMessage.align="center",this.lblReward.iconScale=.8,this.btnEnd.showIconLabel=!1,this.btnEnd.showTextLabel=!0,this.btnEnd.text=NB.getText("COMMON_1","확인"),this.btnEnd.color=M$.GREEN,this.btnEnd.onClick=this.onEndClick.bind(this),this.btnEndBonus.showIconLabel=!0,this.btnEndBonus.showTextLabel=!0,this.btnEndBonus.iconText=String(t.GEM_COST),this.btnEndBonus.text=`${ - NB.getText("GAME_7","훈장")} - x ${ - t.BONUS_MULT} - `,this.btnEndBonus.color=M$.RED,this.btnEndBonus.onClick=this.onEndBonusClick.bind(this),this.contentContainer.addChild(this.lblMessage,this.lblReward,this.btnEnd,this.btnEndBonus),hD.setLabelWrapWidth(this.lblMessage,this.width-60)} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - computePendingReward(){ - if(!TG.isSoulResting)return 0; - const t=Math.max(0,Math.min(144e5,Bx.time-TG.soulRestStartAt)),i=Math.floor(t/6e4),s=TG.bestMedalPerMin; - return Math.floor(i*s*.8)} - show(){ - this.pendingReward=this.computePendingReward(),this.lblMessage.text=NB.getText("GAME_902","영혼의 휴식을 종료하시겠습니까?"),this.lblReward.text=qD.displayLargeNumberAsAlphabet(this.pendingReward),this.btnEnd.text=NB.getText("COMMON_1","확인"),this.btnEndBonus.text=`${ - NB.getText("GAME_7","훈장")} - x ${ - t.BONUS_MULT} - `,this.updateLayout(),this.btnClose.visible=!0,this.outSideClickHide=!1,super.show()} - updateLayout(){ - const t=.5*this.width; - let i=95; - this.lblMessage.x=t-.5*this.lblMessage.width,this.lblMessage.y=i,i+=this.lblMessage.height+22,this.lblReward.x=t-.5*this.lblReward.width,this.lblReward.y=i,i+=this.lblReward.height+30; - let s=t-.5*(this.btnEnd.width+this.btnEndBonus.width+12); - this.btnEnd.x=s,this.btnEnd.y=i,s+=this.btnEnd.width+12,this.btnEndBonus.x=s,this.btnEndBonus.y=i,this.height=i+this.btnEnd.height+35} - async onEndClick(){ - this.requestPending||await this.doClaim(!1)} - async onEndBonusClick(){ - this.requestPending||(TG.gem<t.GEM_COST?AB.getInstance().show(NB.getText("COMMON_352","보석이 부족합니다.")):await this.doClaim(!0))} - async doClaim(t){ - var i,s,e; - this.requestPending=!0; - const n=await sD.getInstance().soulRest.claim(t); - if(this.requestPending=!1,!n.success)return void AB.getInstance().showError(n); - (null==(i=n.body)?void 0:i.user)&&(TG.setUserData(n.body.user),LH.getInstance().updateAll()); - const h=Number((null==(e=null==(s=n.body)?void 0:s.claim)?void 0:e.earnedMedal)??0); - h>0&&bH.getInstance().showMessage(`+${ - qD.displayLargeNumberAsAlphabet(h)} - ${ - NB.getText("GAME_7","훈장")} - `),this.hide(); - const{ - SoulRestLayer:r} - =await ei(async()=>{ - const{ - SoulRestLayer:t} - =await Promise.resolve().then(()=>hF); - return{ - SoulRestLayer:t} - } - ,void 0); - r.getInstance().hide()} - getDefaultPositionY(){ - return.4*SS.stageHeight} - } - ; - Qt(h_i,"SoulRestEndConfirmPopup"),Zt(h_i,"_instance"),Zt(h_i,"GEM_COST",1e3),Zt(h_i,"BONUS_MULT",2); - let r_i=h_i; - const o_i=Object.freeze(Object.defineProperty({ - __proto__:null,SoulRestEndConfirmPopup:r_i} - ,Symbol.toStringTag,{ - value:"Module"} - )); - var a_i,c_i,l_i,u_i,d_i,f_i; - (c_i=a_i||(a_i={ - } - )).onConversionDataSuccess="onConversionDataSuccess",c_i.onConversionDataFail="onConversionDataFail",c_i.onAppOpenAttribution="onAppOpenAttribution",c_i.onAttributionFailure="onAttributionFailure",c_i.CONVERSION_CALLBACK="conversion_callback",c_i.OAOA_CALLBACK="oaoa_callback",c_i.UDL_CALLBACK="udl_callback",(u_i=l_i||(l_i={ - } - )).oneTimePurchase="one_time_purchase",u_i.subscription="subscription",(f_i=d_i||(d_i={ - } - )).IRONSOURCE="ironsource",f_i.APPLOVIN_MAX="applovin_max",f_i.GOOGLE_ADMOB="google_admob",f_i.FYBER="fyber",f_i.APPODEAL="appodeal",f_i.ADMOST="admost",f_i.TOPON="topon",f_i.TRADPLUS="tradplus",f_i.YANDEX="yandex",f_i.CHARTBOOST="chartboost",f_i.UNITY="unity",f_i.TOPON_PTE="topon_pte",f_i.CUSTOM_MEDIATION="custom_mediation",f_i.DIRECT_MONETIZATION_NETWORK="direct_monetization_network"; - const p_i=VKt("AppsFlyerPlugin",{ - } - ),w_i=class t{ - constructor(){ - Zt(this,"isInitialized",!1),Zt(this,"uid",null),Zt(this,"sessionStartTime",0),Zt(this,"timeoutInfo","")} - static getInstance(){ - return t.instance||(t.instance=new t),t.instance} - getInitialized(){ - return this.isInitialized} - getPlatformId(){ - return OG.getInstance().buildType} - async init(){ - const t=OG.getInstance(); - if("capacitor"==t.envPlatform&&!CS.isAppBundleVersionLessThan("1.1.0")&&!this.isInitialized)try{ - const s=!1===this.getOptOutState(); - try{ - await p_i.anonymizeUser({ - anonymizeUser:!s} - )} - catch(i){ - } - this.setupDeepLinkListener(); - let e=t.getClientData("AF_DEV_KEY"); - e||(e="rXutk78H9uCQMgMoZQnp"); - let n=""; - 1==t.isAppleClientKr()?(n=t.getClientData("AF_IOS_APP_ID_KR"),n||(n="6760745556")):1==t.isAppleClient()&&(n=t.getClientData("AF_IOS_APP_ID_GB"),n||(n="6761818626")),eN.addExtraParams("af_app_id",n); - const h={ - devKey:e,appID:n,isDebug:!1,registerOnDeepLink:!0,registerConversionListener:!0} - ; - await p_i.initSDK(h),this.isInitialized=!0,eN.addExtraParams("af_init_success",`AppsFlyer 초기화 완료 (buildType: ${ - t.buildType} - )`)} - catch(s){ - eN.addExtraParams("af_init_error",Xoi.getInstance().getString(s))} - } - async setUid(t){ - if(0!=this.isTrackingAvailable())try{ - this.uid=t,await p_i.setCustomerUserId({ - cuid:t} - )} - catch(i){ - } - } - async getAppsFlyerId(){ - if(0==this.isTrackingAvailable())return""; - try{ - const t=await p_i.getAppsFlyerUID(); - return t?t.uid:""} - catch(t){ - return""} - } - async trackPurchase(t,i,s="USD",e,n){ - if(0!=this.isTrackingAvailable())try{ - const h={ - af_revenue:i,af_currency:s,af_content_id:t,af_content_type:"in_app_purchase",platform:this.getPlatformId()} - ; - e&&(h.af_order_id=e),n&&(h.af_receipt_id=n),this.uid&&(h.af_customer_user_id=this.uid),await p_i.logEvent({ - eventName:"af_purchase",eventValue:h} - )} - catch(h){ - } - } - async trackAd(t,i){ - if(0!=this.isTrackingAvailable())try{ - await p_i.logEvent({ - eventName:t,eventValue:{ - ad_type:i,timestamp:Date.now().toString()} - } - )} - catch(s){ - } - } - async trackRevive(t,i,s){ - if(0!=this.isTrackingAvailable()){ - try{ - const e=t>0?"revive":"revive_first"; - await p_i.logEvent({ - eventName:e,eventValue:{ - wave:String(i),maxWave:String(s),numRevive:String(t),timestamp:Date.now().toString(),platform:this.getPlatformId()} - } - )} - catch(e){ - } - t>50||(t<=10||t%2==0)&&setTimeout(()=>{ - this.trackReviveAcc(t,i,s)} - ,300)} - } - async trackReviveAcc(t,i,s){ - if(0!=this.isTrackingAvailable())try{ - const e="reviveAcc"; - await p_i.logEvent({ - eventName:e,eventValue:{ - numRevive:String(t),wave:String(i),maxWave:String(s),timestamp:Date.now().toString(),platform:this.getPlatformId()} - } - )} - catch(e){ - } - } - async trackGameStart(){ - if(0!=this.isTrackingAvailable())try{ - await p_i.logEvent({ - eventName:"game_start",eventValue:{ - timestamp:Date.now().toString(),platform:this.getPlatformId()} - } - )} - catch(t){ - } - } - async trackTutorialStart(){ - if(0!=this.isTrackingAvailable())try{ - await p_i.logEvent({ - eventName:"af_tutorial_start",eventValue:{ - timestamp:Date.now().toString()} - } - )} - catch(t){ - } - } - async trackTutorialComplete(t){ - if(0!=this.isTrackingAvailable())try{ - const i={ - success:"true",timestamp:Date.now().toString()} - ; - t&&(i.duration=t.toString()),await p_i.logEvent({ - eventName:"af_tutorial_completion",eventValue:i} - )} - catch(i){ - } - } - async trackLevelAchieved(t,i){ - if(0!=this.isTrackingAvailable())try{ - const s={ - af_level:t.toString(),timestamp:Date.now().toString()} - ; - i&&(s.play_time=i.toString()),await p_i.logEvent({ - eventName:"af_level_achieved",eventValue:s} - )} - catch(s){ - } - } - async trackLogin(){ - if(0!=this.isTrackingAvailable())try{ - const t={ - timestamp:Date.now().toString(),platform:this.getPlatformId()} - ; - this.uid&&(t.uid=this.uid),await p_i.logEvent({ - eventName:"af_login",eventValue:t} - )} - catch(t){ - } - } - async trackSessionStart(){ - if(0!=this.isTrackingAvailable())try{ - this.sessionStartTime=Date.now(),await p_i.logEvent({ - eventName:"session_start",eventValue:{ - timestamp:Date.now().toString()} - } - )} - catch(t){ - } - } - async trackSessionEnd(){ - if(0!=this.isTrackingAvailable())try{ - const t=(Date.now()-this.sessionStartTime)/1e3; - await p_i.logEvent({ - eventName:"session_end",eventValue:{ - duration:t.toString(),timestamp:Date.now().toString()} - } - )} - catch(t){ - } - } - async trackCustomEvent(t,i={ - } - ){ - if(0!=this.isTrackingAvailable())try{ - const s={ - } - ; - for(const[t,e]of Object.entries(i))s[t]=String(e); - s.platform=this.getPlatformId(),s.timestamp=Date.now().toString(),await p_i.logEvent({ - eventName:t,eventValue:s} - )} - catch(s){ - } - } - setupDeepLinkListener(){ - try{ - p_i.addListener(a_i.UDL_CALLBACK,t=>{ - t&&t.deepLink&&this.handleDeepLink(t.deepLink)} - ),p_i.addListener(a_i.CONVERSION_CALLBACK,t=>{ - t&&t.data&&(this.handleConversionData(t.data),OG.getInstance().setConversionData(t),jS.getInstance().dispatchCustomEvent("AfConversionData"))} - )} - catch(t){ - } - } - handleDeepLink(t){ - } - handleConversionData(t){ - } - isTrackingAvailable(){ - return"capacitor"==OG.getInstance().envPlatform&&!xG.getInstance().development&&0!=this.isInitialized} - getOptOutState(){ - return!qfi.getInstance().authorized||!!TG.optOut} - setTimtoutInfo(t){ - this.timeoutInfo?this.timeoutInfo+="-"+t:this.timeoutInfo=t} - getTimeoutInfo(){ - return this.timeoutInfo} - } - ; - Qt(w_i,"AppsFlyerManager"),Zt(w_i,"instance"); - let g_i=w_i; - const m_i=g_i.getInstance(); - function v_i(t,i="task",s=5e3){ - return new Promise((e,n)=>{ - const h=setTimeout(()=>{ - m_i.setTimtoutInfo(`${ - i} - :${ - s} - `),n(new Error(`${ - i} - :${ - s} - `))} - ,s); - t.then(t=>{ - clearTimeout(h),e(t)} - ,t=>{ - clearTimeout(h),n(t)} - )} - )} - Qt(v_i,"withTimeoutAf"); - const __i=Object.freeze(Object.defineProperty({ - __proto__:null,AppsFlyerManager:g_i,appsFlyer:m_i,withTimeoutAf:v_i} - ,Symbol.toStringTag,{ - value:"Module"} - )),M_i=class t extends pB{ - constructor(){ - super(),Zt(this,"lblTotal",new iG("",16763904,hD.DEFAULT_OUTLINE_FONT_OPTION_18)),Zt(this,"lblFire",new iG("",16743002,hD.DEFAULT_OUTLINE_FONT_OPTION_16)),Zt(this,"lblProduct",new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_16)),Zt(this,"lblTreasure",new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_16)),Zt(this,"lblHero",new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_16)),Zt(this,"lblGodBless",new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_16)),Zt(this,"lblPet",new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_16)),Zt(this,"heroIconContainer",new Ke),this.contentContainer.addChild(this.lblTotal,this.lblFire,this.lblProduct,this.lblGodBless,this.lblTreasure,this.lblHero,this.heroIconContainer,this.lblPet),this.outSideClickHide=!0} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - showPopup(){ - this.title=NB.getText("GAME_318","배속 버프 상세"),this.heroIconContainer.removeChildren(); - const t=Bx.time,i=.001*(TG.speed20EndTime-t),s=.001*(TG.speed15EndTime-t); - let e=0; - (i>0||s>0)&&(e=100); - const n=.001*(TG.godBlessEndTime-t)>0&&!zD.godBlessOff?300:0,h=RP.getInstance().treasure.getGameplayBuff(mP.GameSpeed),r=pR.getInstance().getTotal(dR.GameSpeed)+wP.getBarracksGameSpeedContribution(),o=Math.round(100*RP.getInstance().pet.getGameplayBuff(mP.GameSpeed))/100,a=gU(TG.wave),c=e+n+h+r+o-a; - let l=70; - const u=30; - this.lblTotal.text=`${ - NB.getText("GAME_332","전체 버프")} - : ${ - c>=0?"+":""} - ${ - c} - %`,this.lblTotal.x=u,this.lblTotal.y=l,l+=this.lblTotal.height+8,this.lblFire.visible=a>0,a>0&&(this.lblFire.text=`${ - jzt(K8t.fireAura)} - : -${ - a} - %`,this.lblFire.x=u,this.lblFire.y=l,l+=this.lblFire.height+8),l+=7,this.lblProduct.text=`${ - NB.getText("GAME_333","상품")} - : +${ - e} - %`,this.lblProduct.textColor=e>0?11206570:8947848,this.lblProduct.x=u,this.lblProduct.y=l,l+=this.lblProduct.height+8,n>0?(this.lblGodBless.text=`${ - NB.getText("GAME_190","신의 축복")} - : +${ - n} - %`,this.lblGodBless.textColor=16755455,this.lblGodBless.visible=!0):(this.lblGodBless.text=`${ - NB.getText("GAME_190","신의 축복")} - : +0%`,this.lblGodBless.textColor=8947848,this.lblGodBless.visible=!0),this.lblGodBless.x=u,this.lblGodBless.y=l,l+=this.lblGodBless.height+8,this.lblTreasure.text=`${ - NB.getText("GAME_4","유물")} - : +${ - h} - %`,this.lblTreasure.textColor=h>0?11206570:8947848,this.lblTreasure.x=u,this.lblTreasure.y=l,l+=this.lblTreasure.height+8,this.lblHero.text=`${ - NB.getText("GAME_3","영웅")} - : +${ - r} - %`,this.lblHero.textColor=r>0?11206570:8947848,this.lblHero.x=u,this.lblHero.y=l,l+=this.lblHero.height+8; - const d=pR.getInstance(),f=d.getContributors(dR.GameSpeed); - if(f.length>0){ - const t=iR.getInstance(),i=[...f].sort((t,i)=>{ - var s,e; - const n=(null==(s=d.getByKindNum(t))?void 0:s.value)??0; - return((null==(e=d.getByKindNum(i))?void 0:e.value)??0)-n} - ); - let s=40; - for(const e of i){ - const i=t.getBookVO(e); - if(!i)continue; - const n=new Xe(RS.getTexture("UI_Ekkorr",`Hero${ - i.base} - `)); - n.scale.set(.5),n.x=s,n.y=0,this.heroIconContainer.addChild(n),s+=n.width+5} - this.heroIconContainer.x=0,this.heroIconContainer.y=l,l+=(this.heroIconContainer.height||40)+10} - this.lblPet.text=`${ - NB.getText("GAME_565","펫")} - : +${ - o} - %`,this.lblPet.textColor=o>0?11206570:8947848,this.lblPet.x=u,this.lblPet.y=l,l+=this.lblPet.height+8,this.height=l+20,super.show()} - getDefaultPositionY(){ - return.5*SS.stageHeight} - onBackButton(){ - return this.hide(),!0} - } - ; - Qt(M_i,"GameSpeedBuffPopup"),Zt(M_i,"_instance"); - let b_i=M_i; - const y_i=Object.freeze(Object.defineProperty({ - __proto__:null,GameSpeedBuffPopup:b_i} - ,Symbol.toStringTag,{ - value:"Module"} - )),E_i=class t extends pB{ - constructor(){ - super(),Zt(this,"items"),Zt(this,"container"),Zt(this,"btnConfirm"),this.title=NB.getText("GAME_347","상품이 지급되었습니다."),this.items=[],this.container=new Ke,this.addChild(this.container),this.btnConfirm=new aB("확인"),this.addChild(this.btnConfirm),this.btnConfirm.onClick=()=>{ - this.hide()} - ,this.updateLayout()} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - updateLayout(){ - let t=80; - this.container.x=.5*(this.width-this.container.width),this.container.y=t,t+=this.container.height+20,this.btnConfirm.x=.5*(this.width-this.btnConfirm.width),this.btnConfirm.y=t,this.height=this.btnConfirm.y+this.btnConfirm.height+30} - setData(t){ - if(!t||!t.rewards)return; - let i,s,e; - this.title=NB.getText("GAME_347","상품이 지급되었습니다."); - let n=[],h=[],r=[],o=[],a=[],c=[],l=[]; - const u=t.rewards.length; - for(let m=0; - m<u; - ++m)if(e=t.rewards[m],i=e.type,s=e.subType,i==v4.buff)switch(s){ - case v4.ads:r.push(e); - break; - case v4.speed:o.push(e); - break; - case v4.assistant:a.push(e); - break; - case v4.bless:l.push(e)} - else i==v4.instant?h.push(e):i==v4.ticket?n.push(e):i==v4.pass?c.push(e):n.push(e); - this.container.removeChildren(); - const d=[],f=[]; - n.length>0&&(d.push(n),f.push(NB.getText("COMMON_120","메일함으로 발송되었습니다."))),h.length>0&&(d.push(h),f.push(NB.getText("COMMON_119","즉시 지급되었습니다."))),r.length>0&&(d.push(r),f.push(NB.getText("GAME_348","광고 제거 상품이 적용되었습니다."))),o.length>0&&(d.push(o),f.push(NB.getText("GAME_349","2배속 상품이 적용되었습니다."))),a.length>0&&(d.push(a),f.push(NB.getText("GAME_1242","전문비서가 고용되었습니다."))),c.length>0&&(d.push(c),f.push(NB.getText("GAME_350","WAVE 패스가 활성화되었습니다."))),l.length>0&&(d.push(l),f.push(NB.getText("COMMON_574","즉시 적용되었습니다."))); - let p,w=0; - const g=d.length; - for(let m=0; - m<g; - ++m){ - m<this.items.length?p=this.items[m]:(p=new T_i,this.items.push(p)); - const t=d[m]!=l; - p.setData(d[m],f[m],t),p.y=w,this.container.addChild(p),w+=p.height+15} - this.updateLayout()} - } - ; - Qt(E_i,"ShopProductResultPopup"),Zt(E_i,"_instance"); - let A_i=E_i; - const S_i=class extends Ke{ - constructor(){ - super(),Zt(this,"icon"),Zt(this,"lbl"),Zt(this,"bg"),Zt(this,"container"),Zt(this,"rewardItems"),this.icon=new Xe(RS.getTexture("UI_Ekkorr","Icon_alarm_check_brown")),this.addChild(this.icon); - const t=hD.DEFAULT_FONT_OPTION_18; - t.fill=hD.COLOR_WHITE,t.fontWeight="normal",this.lbl=new iG("메일함으로 발송되었습니다.",t.fill,t),this.lbl.x=this.icon.x+this.icon.width+5,this.lbl.y=this.icon.y,this.addChild(this.lbl),hD.setLabelWrapWidth(this.lbl,this.width-60),this.bg=new hE({ - texture:RS.getTexture("UI_Ekkorr","Popup_Bg_03"),leftWidth:30,topHeight:30,rightWidth:30,bottomHeight:30} - ),this.bg.alpha=.7,this.bg.width=this.width,this.bg.height=120,this.addChild(this.bg),this.container=new Ke,this.addChild(this.container),this.rewardItems=[]} - get width(){ - return 530} - get height(){ - return this.bg.visible?this.bg.y+this.bg.height:this.lbl.y+this.lbl.height} - setData(t,i,s=!0){ - if(this.lbl.text=i,0==s)return this.bg.visible=!1,void(this.container.visible=!1); - this.container.removeChildren(); - let e,n=0; - const h=t.length; - for(let r=0; - r<h; - ++r)r<this.rewardItems.length?e=this.rewardItems[r]:(e=new M4,this.rewardItems.push(e)),e.setDataFrom(t[r]),e.type==v4.speed||e.subType==v4.speed||e.type==v4.assistant||e.subType==v4.assistant||e.type==v4.ads||e.subType==v4.ads?e.hideAmount():e.showAmount(),e.x=n,this.container.addChild(e),n+=e.width+10; - this.bg.y=this.lbl.y+this.lbl.height+7,this.bg.height=this.container.height+15+10,this.container.x=.5*(this.width-n),this.container.y=this.bg.y+15,this.bg.visible=!0,this.container.visible=!0} - } - ; - Qt(S_i,"ShopProductResultItem"); - let T_i=S_i; - const C_i=Object.freeze(Object.defineProperty({ - __proto__:null,ShopProductResultItem:T_i,ShopProductResultPopup:A_i} - ,Symbol.toStringTag,{ - value:"Module"} - )),O_i=class t{ - constructor(){ - Zt(this,"_targets")} - static getInstance(){ - return t.instance||(t.instance=new t),t.instance} - get targets(){ - if(!this._targets){ - this._targets=[]; - const t=OG.getInstance(); - t.isAppleClientKr()||t.isAppleClient()} - return this._targets} - getOptOutState(){ - return!qfi.getInstance().authorized||!!TG.optOut} - isTrackingAvailable(){ - if("capacitor"!=OG.getInstance().envPlatform)return!1; - if(xG.getInstance().development)return!1; - try{ - if(0==mzt.getInstance().checkApproved().approved)return!1} - catch(t){ - return!1} - return 1!=this.getOptOutState()} - initialize(){ - if(0==this.isTrackingAvailable())return; - const t=this.targets.length; - for(let i=0; - i<t; - ++i)this.targets[i]&&this.targets[i].initialize()} - setUserId(t){ - if(0==this.isTrackingAvailable())return; - const i=this.targets.length; - for(let s=0; - s<i; - ++s)this.targets[s]&&this.targets[s].setUserId(t)} - logLogin(t){ - if(0==this.isTrackingAvailable())return; - const i=this.targets.length; - for(let s=0; - s<i; - ++s)this.targets[s]&&this.targets[s].logLogin(t)} - logGameStart(){ - if(0==this.isTrackingAvailable())return; - const t=this.targets.length; - for(let i=0; - i<t; - ++i)this.targets[i]&&this.targets[i].logGameStart()} - setUserProperty(t,i){ - if(0==this.isTrackingAvailable())return; - const s=this.targets.length; - for(let e=0; - e<s; - ++e)this.targets[e]&&this.targets[e].setUserProperty(t,i)} - trackUserProgress(t){ - if(0==this.isTrackingAvailable())return; - const i=this.targets.length; - for(let s=0; - s<i; - ++s)this.targets[s]&&this.targets[s].trackUserProgress(t)} - setPlatform(t){ - if(0==this.isTrackingAvailable())return; - const i=this.targets.length; - for(let s=0; - s<i; - ++s)this.targets[s]&&this.targets[s].setPlatform(t)} - setPaymentType(t){ - if(0==this.isTrackingAvailable())return; - const i=this.targets.length; - for(let s=0; - s<i; - ++s)this.targets[s]&&this.targets[s].setPaymentType(t)} - setVipLevel(t){ - if(0==this.isTrackingAvailable())return; - const i=this.targets.length; - for(let s=0; - s<i; - ++s)this.targets[s]&&this.targets[s].setVipLevel(t)} - trackPurchase(t,i,s){ - if(0==this.isTrackingAvailable())return; - const e=this.targets.length; - for(let n=0; - n<e; - ++n)this.targets[n]&&this.targets[n].trackPurchase(t,i,s)} - trackProgress(t,i,s){ - if(0==this.isTrackingAvailable())return; - const e=this.targets.length; - for(let n=0; - n<e; - ++n)this.targets[n]&&this.targets[n].trackProgress(t,i,s)} - trackItem(t,i,s,e,n){ - if(0==this.isTrackingAvailable())return; - const h=this.targets.length; - for(let r=0; - r<h; - ++r)this.targets[r]&&this.targets[r].trackItem(t,i,s,e,n)} - } - ; - Qt(O_i,"AnalyticsManager"),Zt(O_i,"instance"); - let I_i=O_i; - const k_i=Object.freeze(Object.defineProperty({ - __proto__:null,AnalyticsManager:I_i} - ,Symbol.toStringTag,{ - value:"Module"} - )),x_i=VKt("Browser",{ - web:Qt(()=>ei(()=>Promise.resolve().then(()=>o5i),void 0).then(t=>new t.BrowserWeb),"web")} - ),R_i=Object.freeze(Object.defineProperty({ - __proto__:null,Browser:x_i} - ,Symbol.toStringTag,{ - value:"Module"} - )),P_i=class t extends pB{ - constructor(){ - super(),Zt(this,"lblMessage",new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_17)),Zt(this,"btnConfirm",new M$("PVP_COIN_ON","0",NB.getText("GAME_820","초월"),1,200,70)),Zt(this,"btnTicket",new M$("Ticket_HeroTrans_s","0",NB.getText("GAME_820","초월"),1,200,70)),Zt(this,"onConfirm",null),this.title="",this.contentContainer.addChild(this.lblMessage,this.btnConfirm,this.btnTicket),this.btnClose.onClick=this.onCancelClick.bind(this),this.btnConfirm.showIconLabel=!0,this.btnConfirm.showTextLabel=!0,this.btnConfirm.color=M$.GREEN,this.btnConfirm.onClick=this.onConfirmClick.bind(this),this.btnTicket.showIconLabel=!0,this.btnTicket.showTextLabel=!0,this.btnTicket.color=M$.GREEN,this.btnTicket.onClick=this.onConfirmClick.bind(this),hD.setLabelWrapWidth(this.lblMessage,this.width-60)} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - showWith(t,i,s){ - this.onConfirm=i,this.lblMessage.text=s??NB.getText("GAME_853","영웅을 초월하시겠습니까?"),this.btnConfirm.text=NB.getText("GAME_820","초월"),this.btnConfirm.iconText=String(t),this.btnConfirm.visible=!0,this.btnTicket.visible=!1,this.updateLayout(),super.show()} - showWithTicket(t,i,s){ - this.onConfirm=i,this.lblMessage.text=s??NB.getText("GAME_853","영웅을 초월하시겠습니까?"),this.btnTicket.text=NB.getText("GAME_820","초월"),this.btnTicket.iconText=t,this.btnConfirm.visible=!1,this.btnTicket.visible=!0,this.updateLayout(),super.show()} - onConfirmClick(){ - const t=this.onConfirm; - this.onConfirm=null,this.hide(),t&&t()} - onCancelClick(){ - this.onConfirm=null,this.hide()} - updateLayout(){ - this.lblMessage.x=.5*(this.width-this.lblMessage.width),this.lblMessage.y=90,this.btnConfirm.x=.5*(this.width-this.btnConfirm.width),this.btnConfirm.y=this.lblMessage.y+this.lblMessage.height+30,this.btnTicket.x=.5*(this.width-this.btnTicket.width),this.btnTicket.y=this.lblMessage.y+this.lblMessage.height+30,this.height=this.btnConfirm.y+this.btnConfirm.height+40} - onBackButton(){ - return this.onCancelClick(),!0} - } - ; - Qt(P_i,"TransConfirmPopup"),Zt(P_i,"_instance"); - let N_i=P_i; - const L_i=Object.freeze(Object.defineProperty({ - __proto__:null,TransConfirmPopup:N_i} - ,Symbol.toStringTag,{ - value:"Module"} - )),D_i=class t extends pB{ - constructor(){ - super(),Zt(this,"icon",new pZt),Zt(this,"lblName",new iG("",16766282,hD.DEFAULT_OUTLINE_FONT_OPTION_18)),Zt(this,"buffInfo1",new TZt),Zt(this,"buffInfo2",new TZt),Zt(this,"lblBuffDesc1",new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_OUTLINE_FONT_OPTION_16)),Zt(this,"lblBuffDesc2",new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_OUTLINE_FONT_OPTION_16)),Zt(this,"setIcons",[]),Zt(this,"btnConfirm",new aB("확인")),Zt(this,"kindNum",0),this.title=NB.getText("COMMON_223","획득"),this.btnClose.removeFromParent(),this.icon.x=50,this.icon.y=80,this.contentContainer.addChild(this.icon),this.contentContainer.addChild(this.lblName),this.contentContainer.addChild(this.lblBuffDesc1),this.contentContainer.addChild(this.lblBuffDesc2),hD.setLabelWrapWidth(this.lblBuffDesc1,500),hD.setLabelWrapWidth(this.lblBuffDesc2,500); - for(let i=0; - i<t.MAX_SET_ICONS; - i++){ - const t=new pZt; - t.visible=!1,this.contentContainer.addChild(t),this.setIcons.push(t)} - this.btnConfirm.text=NB.getText("COMMON_1","확인"),this.btnConfirm.onClick=()=>this.hide(),this.contentContainer.addChild(this.btnConfirm)} - static getInstance(){ - return this.instance||(this.instance=new t),this.instance} - setData(i){ - this.kindNum=i,this.title=NB.getText("COMMON_223","획득"),this.icon.setDataWithKindNum(this.kindNum),this.icon.hideEnhance(),this.icon.hideTrans(); - const s=TR.getInstance().getBookDataByKindNum(this.kindNum),e=s?NB.getText(s.getNameKey(),s.name):"",n=this.icon.x+this.icon.width+15; - this.lblName.text=e,this.lblName.x=n,hD.setLabelWrapWidth(this.lblName,this.width-this.lblName.x-10),this.lblName.y=this.icon.y+10; - const h=this.applyAbilities(s)+70+10; - this.layoutSetIcons(s,h); - const r=h+100; - this.btnConfirm.x=.5*(this.width-this.btnConfirm.width),this.btnConfirm.y=r,this.resizeFor(r+this.btnConfirm.height+t.BOTTOM_PAD)} - applyAbilities(t){ - const i=this.icon.y+this.icon.height+20,s=(null==t?void 0:t.desc)?t.desc.split("|").map(t=>t.trim()):[]; - if(t&&s.length>0){ - const i=NB.getText(t.skillCode,s[0]); - this.lblBuffDesc1.text=`+ ${ - i} - : ${ - qD.displayLargeNumberAsAlphabet(t.getSkill1Value())} - %`,this.lblBuffDesc1.visible=!0} - else this.lblBuffDesc1.visible=!1; - if(t&&t.skillCode2&&s.length>1){ - const i=NB.getText(t.skillCode2,s[1]); - this.lblBuffDesc2.text=`+ ${ - i} - : ${ - qD.displayLargeNumberAsAlphabet(t.getSkill2Value())} - %`,this.lblBuffDesc2.visible=!0} - else this.lblBuffDesc2.visible=!1; - return this.lblBuffDesc1.x=50,this.lblBuffDesc1.y=i,this.lblBuffDesc2.x=50,this.lblBuffDesc2.y=i+30,i} - layoutSetIcons(t,i){ - if(!t){ - for(const t of this.setIcons)t.visible=!1; - return} - const s=LR.getInstance().getSetsByTreasureKindNum(t.kindNum); - if(!s||0===s.length){ - for(const t of this.setIcons)t.visible=!1; - return} - const e=s[0],n=TR.getInstance(),h=new Set([...n.equipedKindNums,...n.ownedList.map(t=>t.kindNum)]),r=Math.min(e.itemList.length,this.setIcons.length); - let o=50; - for(let a=0; - a<this.setIcons.length; - a++){ - const t=this.setIcons[a]; - if(a>=r){ - t.visible=!1; - continue} - const s=e.itemList[a],c=n.getBookDataByKindNum(s); - c?(t.setVO(c),t.hideEnhance(),t.scale.set(.8),t.x=o,t.y=i,t.alpha=h.has(s)?1:.55,t.visible=!0,t.hideTrans(),o+=.8*t.width+10):t.visible=!1} - } - resizeFor(i){ - this.bg.width=t.POPUP_W,this.bg.height=i,this.width=t.POPUP_W,this.height=i} - } - ; - Qt(D_i,"PetCoupleTreasurePopup"),Zt(D_i,"instance"),Zt(D_i,"MAX_SET_ICONS",6),Zt(D_i,"POPUP_W",580),Zt(D_i,"BOTTOM_PAD",50); - let G_i=D_i; - const B_i=Object.freeze(Object.defineProperty({ - __proto__:null,PetCoupleTreasurePopup:G_i} - ,Symbol.toStringTag,{ - value:"Module"} - )),U_i=class t extends kx{ - constructor(){ - super(),Zt(this,"cells",[]),Zt(this,"posList",[]),Zt(this,"kindNums",[]); - for(let t=0; - t<3; - t++){ - const i=new H_i; - i.x=14+204*t,i.y=0,this.addChild(i),this.cells.push(i),this.posList.push(i.x)} - this.posList.push(630)} - get width(){ - return 630} - get height(){ - return 96} - setData(i){ - var s; - const e=i; - if(e){ - this.kindNums=e; - for(let i=0; - i<3; - i++){ - const n=this.cells[i]; - if(i<e.length){ - const h=e[i],r=(null==(s=t.isFavorite)?void 0:s.call(t,h))??!1; - n.setData(h,r),n.visible=!0} - else n.visible=!1} - } - } - onClick(i,s){ - var e; - for(let n=0; - n<this.cells.length; - n++)if(i>this.posList[n]&&i<this.posList[n+1]){ - n<this.kindNums.length&&this.cells[n].visible&&(null==(e=t.onPetToggle)||e.call(t,this.kindNums[n])); - break} - } - } - ; - Qt(U_i,"FavoritePetSelectItemRenderer"),Zt(U_i,"onPetToggle",null),Zt(U_i,"isFavorite",null); - let F_i=U_i; - const $_i=class extends Ke{ - constructor(){ - super(),Zt(this,"petIcon"),Zt(this,"lblName"),Zt(this,"lblPiece"),Zt(this,"checkIcon"),this.petIcon=new u4,this.petIcon.x=6; - const t=this.petIcon.getLocalBounds(); - this.petIcon.y=.5*(96-t.height)-t.y,this.addChild(this.petIcon); - const i=this.petIcon.x+this.petIcon.width+10; - this.lblName=new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_16),this.lblName.x=i,this.lblName.y=this.petIcon.y,this.addChild(this.lblName),this.lblPiece=new iG("",8978244,hD.DEFAULT_OUTLINE_FONT_OPTION_16),this.lblPiece.x=i,this.lblPiece.y=this.petIcon.y+28,this.addChild(this.lblPiece),this.checkIcon=new Xe(RS.getTexture("UI_Ekkorr","Base_Check01")),this.checkIcon.x=this.petIcon.x+.5*(this.petIcon.width-this.checkIcon.width),this.checkIcon.y=this.petIcon.y+.5*(this.petIcon.height-this.checkIcon.height),this.checkIcon.visible=!1,this.addChild(this.checkIcon)} - setData(t,i){ - const s=zx.getInstance(),e=s.getPetVO(t),n=(null==e?void 0:e.grade)??0; - n>0?this.petIcon.setPet(t,n):this.petIcon.setInactive(t); - const h=s.getBookVO(t); - this.lblName.text=NB.getText(`PET_NAME_${ - t} - `,(null==h?void 0:h.name)||""),this.lblPiece.text=`${ - (null==e?void 0:e.piece)??0} - `,this.checkIcon.visible=i} - } - ; - Qt($_i,"PetSelectCell"); - let H_i=$_i; - const W_i=class t extends pB{ - constructor(){ - super(),Zt(this,"lblTitle"),Zt(this,"lblDesc"),Zt(this,"lblSelect"),Zt(this,"slotContainer"),Zt(this,"slotIcons",[]),Zt(this,"list"),Zt(this,"btnConfirm"),Zt(this,"tempFavorites",[]),this.width=640,this.lblTitle=new iG("",hD.COLOR_DEEP_SKYBLUE,hD.DEFAULT_OUTLINE_FONT_OPTION_16),this.lblTitle.x=24,this.lblTitle.y=68,this.addChild(this.lblTitle),this.lblDesc=new iG("",13421772,hD.DEFAULT_OUTLINE_FONT_OPTION_16),this.lblDesc.x=24,this.lblDesc.y=this.lblTitle.y+27,this.lblDesc.text="+ "+NB.getText("GAME_1194","정령의 고원에서 즉시 획득 가능한 펫만 목록에 나타납니다."),this.addChild(this.lblDesc),hD.setLabelWrapWidth(this.lblDesc,this.width-2*this.lblDesc.x); - const t=(new u4).width+9,i=this.lblDesc.y+this.lblDesc.height+5,s=.5*(640-7*t); - this.slotContainer=new Ke,this.slotContainer.x=s,this.slotContainer.y=i,this.addChild(this.slotContainer); - for(let n=0; - n<21; - n++){ - const i=n%7,s=Math.floor(n/7),e=new u4; - e.x=i*t,e.y=s*t,this.slotContainer.addChild(e),this.slotIcons.push(e)} - this.slotContainer.eventMode="static",this.slotContainer.on("pointertap",this.onSlotTap,this),this.lblSelect=new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_17),this.lblSelect.x=24,this.lblSelect.y=i+3*t+10,this.lblSelect.text="+ "+NB.getText("GAME_1195","펫 선택"),this.addChild(this.lblSelect); - const e=this.lblSelect.y+30; - this.list=new C4(F_i,630,320),this.list.x=5,this.list.y=e,this.addChild(this.list),this.btnConfirm=new nB(NB.getText("COMMON_1","확인")),this.btnConfirm.color=nB.GREEN,this.btnConfirm.width=200,this.btnConfirm.height=55,this.btnConfirm.x=.5*(640-this.btnConfirm.width),this.btnConfirm.y=e+320+16,this.btnConfirm.onClick=this.onConfirmClick.bind(this),this.addChild(this.btnConfirm),this.bg.height=this.btnConfirm.y+this.btnConfirm.height+24} - static getInstance(){ - return t._instance||(t._instance=new t),t._instance} - setData(){ - const t=_G.getInstance(); - this.tempFavorites=[...t.favoritePets],F_i.onPetToggle=this.toggle.bind(this),F_i.isFavorite=t=>-1!==this.tempFavorites.indexOf(t),this.list.dataProvider=Dx.chunkArray(this.getObtainablePets(),3),this.list.showTopItem(),this.updateSlots(),this.updateTitle()} - getObtainablePets(){ - const t=Math.floor(TG.maxWave/100),i=_G.getInstance(),s=new Set; - for(const e of i.bookList){ - if(t<e.reqLevel)continue; - if("PET"!==e.rewardType)continue; - const n=i.getStageVO(e.kindNum); - !n||n.star<=0||e.petKindNum>0&&s.add(e.petKindNum)} - return[...s].sort((t,i)=>{ - var s,e,n,h; - const r=zx.getInstance(),o=(null==(s=r.getPetVO(t))?void 0:s.grade)??0,a=(null==(e=r.getPetVO(i))?void 0:e.grade)??0,c=o<5?o:-1,l=a<5?a:-1; - if(c!==l)return l-c; - const u=(null==(n=r.getPetVO(t))?void 0:n.kindNum)??0; - return((null==(h=r.getPetVO(i))?void 0:h.kindNum)??0)-u} - )} - toggle(t){ - const i=this.tempFavorites.indexOf(t); - if(-1!==i)this.tempFavorites.splice(i,1); - else{ - if(this.tempFavorites.length>=21)return void bH.getInstance().showMessage(NB.getValueReplace("GAME_1196","##",21,"즐겨찾기는 최대 21개까지 가능합니다.")); - this.tempFavorites.push(t)} - this.updateSlots(),this.updateTitle(),this.refreshListSelection()} - updateSlots(){ - var t; - const i=zx.getInstance(); - for(let s=0; - s<21; - s++){ - const e=this.slotIcons[s]; - if(s<this.tempFavorites.length){ - const n=this.tempFavorites[s],h=(null==(t=i.getPetVO(n))?void 0:t.grade)??0; - h>0?e.setPet(n,h):e.setInactive(n)} - else e.setEmpty()} - } - refreshListSelection(){ - const t=this.list.itemList; - if(t)for(const i of t)i.setData(i.data)} - updateTitle(){ - const t=NB.getValueReplace("GAME_1193","##",`${ - this.tempFavorites.length} - /21`,`펫 즐겨찾기 설정 (${ - this.tempFavorites.length} - /21)`); - this.lblTitle.text=t,this.title=t} - onSlotTap(t){ - const i=this.slotContainer.toLocal(t.global); - for(let s=0; - s<this.tempFavorites.length; - s++){ - const t=this.slotIcons[s]; - if(i.x>=t.x&&i.x<=t.x+t.width&&i.y>=t.y&&i.y<=t.y+t.height)return void this.toggle(this.tempFavorites[s])} - } - async onConfirmClick(){ - const t=await sD.getInstance().spirit.saveFavoritePets(this.tempFavorites); - !1!==t.success?(t.body&&(TG.setUserInfo(t.body),t.body.spirit&&_G.getInstance().setData(t.body.spirit),t.body.pet&&zx.getInstance().setData(t.body.pet),LH.getInstance().updateAll()),Y6t.getInstance().setData(),this.hide()):bH.getInstance().showMessage(NB.getText("COMMON_467","저장 실패했습니다."))} - } - ; - Qt(W_i,"FavoritePetSelectPopup"),Zt(W_i,"_instance"); - let V_i=W_i; - const j_i=Object.freeze(Object.defineProperty({ - __proto__:null,FavoritePetSelectPopup:V_i} - ,Symbol.toStringTag,{ - value:"Module"} - )),K_i=class t extends pB{ - constructor(){ - super(),Zt(this,"btnMine",new nB(NB.getText("GAME_1203","화석 발굴"))),Zt(this,"btnAscent",new nB(NB.getText("GAME_1716","군단 도전"))),Zt(this,"btnFishing",new nB("낚시왕 (프로토타입)")),Zt(this,"opening",!1),this.width=t.POPUP_WIDTH; - for(const i of[this.btnMine,this.btnAscent,this.btnFishing])i.width=this.width-2*t.SIDE_PADDING,i.height=t.BUTTON_HEIGHT,i.color=nB.BROWN,this.contentContainer.addChild(i); - this.btnMine.onClick=()=>{ - this.openMine()} - ,this.btnAscent.onClick=()=>{ - this.openAscent()} - ,this.btnFishing.onClick=()=>{ - this.openFishing()} - ,this.on("added",this.onAdded,this),this.on("removed",this.onRemoved,this)} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - onAdded(){ - TXt.getInstance().registerHubMineButtonGetter(t=>"btnMine"===t&&this.btnMine.visible?{ - parent:this.contentContainer,btn:{ - x:this.btnMine.x,y:this.btnMine.y,width:this.btnMine.width,height:this.btnMine.height} - } - :null)} - onRemoved(){ - const t=iXt.getInstance(); - t.mineStep=2!=t.mineStep?0:t.mineStep,TXt.getInstance().unregisterHubMineButtonGetter()} - static isMineOpen(){ - return TG.maxWave>=200&&FB.isValidEvent($B.MINE_EVENT)} - static isAscentOpen(){ - return FB.isValidEvent($B.MINI_ASCENT_EVENT)} - static isAscentShopOpen(){ - return!t.isAscentOpen()&&FB.isAscentShopOpen()} - show(){ - this.title=NB.getText("GAME_1844","ko"===NB.language?"이벤트":"Event"),this.btnMine.text=NB.getText("GAME_1203","화석 발굴"),this.btnAscent.text=NB.getText("GAME_1716","군단 도전"),this.btnMine.activated=t.isMineOpen(),this.btnAscent.activated=(t.isAscentOpen()||t.isAscentShopOpen())&&!this.opening,this.btnFishing.visible=t.isFishingOpen(); - const i=[this.btnMine,this.btnAscent,this.btnFishing].filter(t=>t.visible); - this.height=t.HEADER_HEIGHT+2*t.BODY_PADDING+t.BUTTON_HEIGHT*i.length+t.BUTTON_GAP*(i.length-1); - for(const[e,n]of i.entries())n.position.set(.5*(this.width-n.width),t.HEADER_HEIGHT+t.BODY_PADDING+e*(t.BUTTON_HEIGHT+t.BUTTON_GAP)),n.lbl.scale.set(1),n.lbl.scale.set(Math.min(1,(n.width-40)/Math.max(1,n.lbl.width))),n.lbl.position.set(.5*-n.lbl.width,.5*-n.lbl.height); - const s=iXt.getInstance(); - s.mineStep=2!=s.mineStep?1:s.mineStep,this.outSideClickHide=!0,super.show()} - static isFishingOpen(){ - return xG.getInstance().development} - async openFishing(){ - if(!this.opening&&t.isFishingOpen()){ - this.opening=!0; - try{ - const{ - FishingFlow:t} - =await ei(async()=>{ - const{ - FishingFlow:t} - =await Promise.resolve().then(()=>sVi); - return{ - FishingFlow:t} - } - ,void 0); - this.hide(),await t.enter()} - catch(frt){ - bH.getInstance().showMessage(frt.message)} - finally{ - this.opening=!1} - } - } - async openMine(){ - if(!t.isMineOpen())return; - this.hide(); - const{ - MinePopup:i} - =await ei(async()=>{ - const{ - MinePopup:t} - =await Promise.resolve().then(()=>C8t); - return{ - MinePopup:t} - } - ,void 0); - await i.getInstance().show()} - async openAscent(){ - const i=t.isAscentShopOpen(); - if(!this.opening&&(t.isAscentOpen()||i)){ - this.opening=!0,this.btnAscent.activated=!1; - try{ - const{ - MiniAscentAssets:t} - =await ei(async()=>{ - const{ - MiniAscentAssets:t} - =await Promise.resolve().then(()=>Obi); - return{ - MiniAscentAssets:t} - } - ,void 0); - await t.ensure(); - const{ - MiniAscentFlow:s} - =await ei(async()=>{ - const{ - MiniAscentFlow:t} - =await Promise.resolve().then(()=>Tyi); - return{ - MiniAscentFlow:t} - } - ,void 0); - this.hide(),await(i?s.enterShop():s.enter())} - catch{ - const{ - pveText:t} - =await ei(async()=>{ - const{ - pveText:t} - =await Promise.resolve().then(()=>$bi); - return{ - pveText:t} - } - ,void 0); - bH.getInstance().showMessage(t("ASSET_ERROR"))} - finally{ - this.opening=!1,this.btnAscent.activated=t.isAscentOpen()||t.isAscentShopOpen()} - } - } - async execOpenAscent(){ - this.openAscent()} - } - ; - Qt(K_i,"EventHubPopup"),Zt(K_i,"_instance"),Zt(K_i,"POPUP_WIDTH",406),Zt(K_i,"HEADER_HEIGHT",53),Zt(K_i,"SIDE_PADDING",32),Zt(K_i,"BODY_PADDING",24),Zt(K_i,"BUTTON_HEIGHT",60),Zt(K_i,"BUTTON_GAP",14); - let z_i=K_i; - const Y_i=Object.freeze(Object.defineProperty({ - __proto__:null,EventHubPopup:z_i} - ,Symbol.toStringTag,{ - value:"Module"} - )),q_i=class extends nB{ - constructor(){ - super(""),Zt(this,"icon"),Zt(this,"iconCompleted"),Zt(this,"index",-1),Zt(this,"_completed",!1),this.color=nB.LIGHT_GREEN,this.lbl.removeFromParent(),this.icon=new Xe(RS.getTexture("UI_Ekkorr","Icon_Receive")),this.icon.scale=.7,this.icon.x=.5*-this.icon.width,this.icon.y=.5*-this.icon.height,this.container.addChild(this.icon),this.iconCompleted=new Xe(RS.getTexture("UI_Ekkorr","Icon_Check")),this.iconCompleted.visible=!1,this.iconCompleted.alpha=.8,this.iconCompleted.scale=.8,this.iconCompleted.x=.5*-this.iconCompleted.width,this.iconCompleted.y=.5*-this.iconCompleted.height,this.container.addChild(this.iconCompleted),this.width=65,this.height=40} - get width(){ - return this.bg.width} - set width(t){ - super.width=t,this.icon&&(this.icon.x=.5*-this.icon.width)} - get height(){ - return this.bg.height} - set height(t){ - super.height=t,this.icon&&(this.icon.y=.5*-this.icon.height)} - get activated(){ - return this._activated} - set activated(t){ - super.activated=t,this.icon.alpha=t?1:.8} - onTap(t){ - 0!=this._activated&&(QG.getInstance().playSFX(QG.SFX_NORMAL_CLICK),YG(),null!=this.onClick&&this.onClick(this.index))} - get completed(){ - return this._completed} - set completed(t){ - t!==this._completed&&(this._completed=t,this._completed?(this.icon.visible=!1,this.iconCompleted.visible=!0):(this.icon.visible=!0,this.iconCompleted.visible=!1))} - } - ; - Qt(q_i,"AttendEventRewardButton"); - let X_i=q_i; - const J_i=class extends kx{ - constructor(){ - super(),Zt(this,"bg"),Zt(this,"items"),Zt(this,"lbl"),Zt(this,"btn"),this.bg=new hE({ - texture:RS.getTexture("UI_Ekkorr","Popup_Bg_03"),leftWidth:30,topHeight:30,rightWidth:30,bottomHeight:30} - ),this.bg.alpha=.7,this.bg.width=395,this.bg.height=75,this.addChild(this.bg),this.items=[]; - let t,i=13; - for(let e=0; - e<5; - ++e)t=new M4,t.x=i,t.y=11,t.scale=.8,this.addChild(t),this.items.push(t),i+=.8*t.width+9; - const s=hD.DEFAULT_FONT_OPTION_15; - s.fill=9666663,this.lbl=new iG("Day 1",s.fill,s),this.addChild(this.lbl),this.btn=new X_i,this.btn.x=i+5,this.btn.y=this.lbl.y+this.lbl.height,this.addChild(this.btn),this.btn.onClick=this.onBtnClick.bind(this),this.lbl.x=this.btn.x+.5*(this.btn.width-this.lbl.width)} - get width(){ - return this.bg.width} - get height(){ - return this.bg.height} - setData(t){ - const i=t.index,s=t.attendCount,e=t.attendedToday; - t.completed,this.lbl.text=`Day ${ - i+1} - `; - const n=t.reward.length; - let h,r; - const o=this.items.length; - for(let c=0; - c<o; - ++c)h=t.reward[c],r=this.items[c],c<n?(r.visible=!0,r.setDataFrom(h),this.setItemEvent(r,!0)):(r.visible=!1,this.setItemEvent(r,!1)); - const a=e?s-1:s; - i>a?(this.btn.activated=!1,this.btn.completed=!1):i<a||e?(this.btn.activated=!1,this.btn.completed=!0):(this.btn.activated=!0,this.btn.completed=!1)} - async onBtnClick(){ - try{ - const{ - AttendEventPopup:t} - =await ei(async()=>{ - const{ - AttendEventPopup:t} - =await Promise.resolve().then(()=>hMi); - return{ - AttendEventPopup:t} - } - ,void 0); - t.getInstance().attendEvent()} - catch(t){ - } - } - setItemEvent(t,i){ - t.eventMode="none",t.off("pointertap",this.onItemTap,this),i&&(t.eventMode="dynamic",t.on("pointertap",this.onItemTap,this))} - async onItemTap(t){ - const i=t.target; - if(!i)return; - let s=""; - if(i.type==v4.ticket&&i.subType==v4.heroGacha?s=NB.getText("GAME_765","5성 영웅을 랜덤하게 획득할 수 있습니다."):i.type==v4.ticket&&i.subType==v4.heroSelect?s=NB.getText("GAME_943","제공되는 목록에서 원하는 5성 영웅을 선택할 수 있습니다."):i.type==v4.ticket&&i.subType==v4.treasureGacha?s=NB.getValueReplace("GAME_776","##",6,"6등급 유물을 랜덤하게 획득할 수 있습니다."):i.type==v4.ticket&&i.subType==v4.petSelect?s=NB.getText("GAME_944","제공되는 목록에서 원하는 펫 조각을 선택할 수 있습니다."):i.type!=v4.trans||i.subType!=v4.hero&&i.subType!=v4.treasure?i.type==v4.runeTicket&&(s=NB.getText("GAME_1502","레이드 상점에서 크리스탈을 랜덤하게 획득할 수 있습니다.")):s=NB.getText("GAME_1225","초월권을 사용하여 초월재료와 비용없이 초월시킬 수 있습니다."),s){ - const{ - ToolTip:t} - =await ei(async()=>{ - const{ - ToolTip:t} - =await Promise.resolve().then(()=>S4); - return{ - ToolTip:t} - } - ,void 0); - t.getInstance().widthMax=390,t.getInstance().text=s; - let e=this.x+i.x-20; - e+t.getInstance().width+7>this.bg.x+this.bg.width&&(e=this.bg.x+this.bg.width-t.getInstance().width-7); - let n=i.y-i.height; - n<7&&(n=7),t.getInstance().show(this,e,n)} - } - } - ; - Qt(J_i,"AttendEventRewardMultiItemRenderer"); - let Q_i=J_i; - const Z_i=class extends Ke{ - constructor(){ - super(),Zt(this,"list"); - const t=this.width,i=this.height; - this.list=new C4(Q_i,t,i,4),this.addChild(this.list)} - get width(){ - return 395} - get height(){ - return 180} - setData(t){ - const i=t.attendCount,s=t.attendedToday,e=t.completed,n=t.rewards.map((t,n)=>({ - index:n,reward:t,attendCount:i,attendedToday:s,completed:e} - )); - this.list.dataProvider=n,t.attendedToday||this.list.scrollTo(t.attendCount)} - } - ; - Qt(Z_i,"AttendEventRewardMulti"); - let tMi=Z_i; - const iMi=class extends Ke{ - constructor(){ - super(),Zt(this,"bg"),Zt(this,"container"),Zt(this,"lbls"),Zt(this,"items"),Zt(this,"btns"),this.bg=new hE({ - texture:RS.getTexture("UI_Ekkorr","Popup_Bg_03"),leftWidth:30,topHeight:30,rightWidth:30,bottomHeight:30} - ),this.bg.alpha=.7,this.bg.width=395,this.bg.height=180,this.addChild(this.bg),this.container=new Ke,this.addChild(this.container),this.lbls=[],this.items=[],this.btns=[]; - const t=hD.DEFAULT_FONT_OPTION_15; - t.fill=9666663; - let i,s,e,n=0; - for(let h=0; - h<5; - ++h)i=new iG(`Day ${ - h+1} - `,t.fill,t),this.container.addChild(i),this.lbls.push(i),s=new M4,this.container.addChild(s),this.items.push(s),e=new X_i,e.index=h,e.onClick=this.onBtnClick.bind(this),this.container.addChild(e),this.btns.push(e),s.x=n,i.x=s.x+.5*(s.width-i.width),e.x=s.x+.5*(s.width-e.width),s.y=i.y+i.height+3,e.y=s.y+s.height+8,n+=s.width+11} - get width(){ - return this.bg.width} - get height(){ - return this.bg.height} - setData(t){ - const i=t.attendCount,s=t.attendedToday; - t.completed; - const e=t.rewards.length; - let n,h,r; - for(let o=0; - o<5; - ++o)if(n=this.lbls[o],h=this.items[o],r=this.btns[o],o<e){ - h.setDataFrom(t.rewards[o][0]),h.visible=!0,this.setItemEvent(h,!0),n.visible=!0,r.visible=!0; - const e=s?i-1:i; - o>e?(r.activated=!1,r.completed=!1):o<e||s?(r.activated=!1,r.completed=!0):(r.activated=!0,r.completed=!1)} - else h.visible=!1,this.setItemEvent(h,!1),n.visible=!1,r.visible=!1; - this.container.x=.5*(this.bg.width-this.container.width)+3,this.container.y=.5*(this.bg.height-this.container.height)-2} - async onBtnClick(t){ - try{ - const{ - AttendEventPopup:t} - =await ei(async()=>{ - const{ - AttendEventPopup:t} - =await Promise.resolve().then(()=>hMi); - return{ - AttendEventPopup:t} - } - ,void 0); - t.getInstance().attendEvent()} - catch(i){ - } - } - setItemEvent(t,i){ - t.eventMode="none",t.off("pointertap",this.onItemTap,this),i&&(t.eventMode="dynamic",t.on("pointertap",this.onItemTap,this))} - async onItemTap(t){ - const i=t.target; - if(!i)return; - let s=""; - if(i.type==v4.ticket&&i.subType==v4.heroGacha?s=NB.getText("GAME_765","5성 영웅을 랜덤하게 획득할 수 있습니다."):i.type==v4.ticket&&i.subType==v4.heroSelect?s=NB.getText("GAME_943","제공되는 목록에서 원하는 5성 영웅을 선택할 수 있습니다."):i.type==v4.ticket&&i.subType==v4.treasureGacha?s=NB.getValueReplace("GAME_776","##",6,"6등급 유물을 랜덤하게 획득할 수 있습니다."):i.type==v4.ticket&&i.subType==v4.petSelect?s=NB.getText("GAME_944","제공되는 목록에서 원하는 펫 조각을 선택할 수 있습니다."):i.type!=v4.trans||i.subType!=v4.hero&&i.subType!=v4.treasure?i.type==v4.runeTicket&&(s=NB.getText("GAME_1502","레이드 상점에서 크리스탈을 랜덤하게 획득할 수 있습니다.")):s=NB.getText("GAME_1225","초월권을 사용하여 초월재료와 비용없이 초월시킬 수 있습니다."),s){ - const{ - ToolTip:t} - =await ei(async()=>{ - const{ - ToolTip:t} - =await Promise.resolve().then(()=>S4); - return{ - ToolTip:t} - } - ,void 0); - t.getInstance().widthMax=390,t.getInstance().text=s; - let e=this.x+i.x-20; - e+t.getInstance().width+7>this.bg.x+this.bg.width&&(e=this.bg.x+this.bg.width-t.getInstance().width-7); - let n=i.y-i.height; - n<7&&(n=7),t.getInstance().show(this,e,n)} - } - } - ; - Qt(iMi,"AttendEventRewardSingle"); - let sMi=iMi; - const eMi=class t extends pB{ - constructor(){ - super(),Zt(this,"bgImage"),Zt(this,"lblMessage"),Zt(this,"lblNote"),Zt(this,"lblDuration"),Zt(this,"rewardSingle"),Zt(this,"rewardMulti"),Zt(this,"_width",-1),Zt(this,"_height",-1),Zt(this,"requestPending",!1),this.bg.removeFromParent(),this.contentContainer.removeFromParent(),this.txtTitle.removeFromParent(),this.btnClose.removeFromParent(),this.outSideClickHide=!0; - const t=hD.DEFAULT_FONT_OPTION_17; - t.fill=13878933,this.lblMessage=new iG("매일 출석하고, 선물 받아가세요!",t.fill,t),this.addChild(this.lblMessage),hD.setLabelWrapWidth(this.lblMessage,420),this.lblDuration=new OF("Icon_Time02","",hD.DEFAULT_COLOR,hD.DEFAULT_OUTLINE_FONT_OPTION_17),this.addChild(this.lblDuration); - const i=hD.DEFAULT_FONT_OPTION_17; - i.fill=13421772,this.lblNote=new iG("빈 화면을 터치해 닫기",i.fill,i),this.addChild(this.lblNote),this.rewardSingle=new sMi,this.addChild(this.rewardSingle),this.rewardMulti=new tMi,this.addChild(this.rewardMulti)} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - async setData(){ - const t=FB.getActiveAttendEvent(); - if(!t)return; - if(!this.bgImage){ - const{ - Assets:i} - =await ei(async()=>{ - const{ - Assets:t} - =await Promise.resolve().then(()=>cE); - return{ - Assets:t} - } - ,void 0); - let s="https://cdn.endlessfrontier.io/ef2/img/"; - const e=OG.getInstance().getClientData("EXTERNAL_IMAGE_PATH"); - e&&e.startsWith("http")&&(s=e); - const n=`${ - s} - ${ - t.image} - `,h=await i.load(n); - this.bgImage=new Xe,this.bgImage.texture=h,this.bgImage.y=-50,this.addChildAt(this.bgImage,0)} - -1!==this._width&&-1!==this._height||(this._width=this.bgImage.width,this._height=this.bgImage.height,this.pivot.set(this._width/2,this._height/2),this.position.set(320,this.getPositionY())); - const i=this.bgImage.y+435; - this.lblMessage.text=t.message?t.message:NB.getText("GAME_1662","매일 출석하고, 선물 받아가세요!"),this.lblMessage.x=.5*(this.width-this.lblMessage.width),this.lblMessage.y=i+.5*(70-this.lblMessage.height)+1,this.lblNote.text=NB.getText("COMMON_573","빈 화면을 터치해 닫기"),this.lblNote.eventMode="none",this.lblNote.x=.5*(this.width-this.lblNote.width),this.lblNote.y=this.bgImage.y+this.height+50,this.update(); - const s=this.rewardMulti.visible?this.rewardMulti.y+this.rewardMulti.height+15:this.rewardSingle.y+this.rewardSingle.height+15,e=new Date(t.startTime),n=new Date(t.endTime); - this.lblDuration.text=n$.displayDate2(e,!0,".")+" ~ "+n$.displayDate2(n,!0,"."),this.lblDuration.x=.5*(this.width-this.lblDuration.width),this.lblDuration.y=s} - update(){ - const t=FB.getActiveAttendEvent(); - if(!t)return; - const i=this.bgImage.y+435; - this.rewardMulti.visible=!1,this.rewardSingle.visible=!1,t.rewards.some(t=>t.length>1)?(this.rewardMulti.x=.5*(this.width-this.rewardMulti.width),this.rewardMulti.y=i+70,this.rewardMulti.setData(t),this.rewardMulti.visible=!0):(this.rewardSingle.x=.5*(this.width-this.rewardSingle.width),this.rewardSingle.y=i+70,this.rewardSingle.setData(t),this.rewardSingle.visible=!0)} - get width(){ - return this._width} - set width(t){ - } - get height(){ - return this._height} - set height(t){ - } - async attendEvent(){ - if(1==this.requestPending)return; - this.setRequestPending(!0); - const t=await sD.getInstance().user.attendEvent(!0); - if(0==t.success){ - this.setRequestPending(!1); - let i=""; - return"ALREADY_ATTENDED"==t.error?i=NB.getText("COMMON_575","이미 오늘 보상을 받았습니다."):"EVENT_ATTEND_COMPLETED"==t.error&&(i=NB.getText("GAME_257","모든 보상을 수령했습니다.")),void(i?AB.getInstance().show(i):AB.getInstance().showError(t))} - FB.updateAttendEvent(t.body.attendEvent),this.update(),this.setRequestPending(!1),AB.getInstance().show(NB.getText("COMMON_120","메일함으로 발송되었습니다.")); - const{ - EventDispatcher:i} - =await ei(async()=>{ - const{ - EventDispatcher:t} - =await Promise.resolve().then(()=>Px); - return{ - EventDispatcher:t} - } - ,void 0); - i.getInstance().dispatchCustomEvent("MailUpdate",{ - forced:!0} - )} - setRequestPending(t){ - this.requestPending=t} - hideImmediately(){ - super.hideImmediately(),A4.getInstance().hide()} - onBackButton(){ - return this.hide(),!0} - } - ; - Qt(eMi,"AttendEventPopup"),Zt(eMi,"_instance"); - let nMi=eMi; - const hMi=Object.freeze(Object.defineProperty({ - __proto__:null,AttendEventPopup:nMi} - ,Symbol.toStringTag,{ - value:"Module"} - )),rMi=class t extends XU{ - constructor(){ - super(),Zt(this,"curTab","wave"),Zt(this,"tabWave"),Zt(this,"tabTimeShift"),Zt(this,"iconWave"),Zt(this,"iconTimeShift"),Zt(this,"lblHeader"),Zt(this,"autoPill",new _H),Zt(this,"lblIntro"),Zt(this,"lblGuideTitle"),Zt(this,"lblGuide"),Zt(this,"lblStatusTitle"),Zt(this,"lblStatus"),Zt(this,"lblHeroesTitle"),Zt(this,"heroGroups",[]),this.tabWave=new uMi(t.waveCallName()),this.tabWave.onTap=()=>this.showTab("wave"),this.contentContainer.addChild(this.tabWave),this.tabTimeShift=new uMi(t.timeShiftName()),this.tabTimeShift.onTap=()=>this.showTab("timeShift"),this.contentContainer.addChild(this.tabTimeShift),this.iconWave=new Xe(RS.getTexture("UI_Ekkorr","BTN_WAVE")),this.iconWave.eventMode="none",this.contentContainer.addChild(this.iconWave),this.iconTimeShift=new Xe(RS.getTexture("UI_Ekkorr","callOfDawn")),this.iconTimeShift.eventMode="none",this.contentContainer.addChild(this.iconTimeShift),this.lblHeader=new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_20),this.contentContainer.addChild(this.lblHeader),this.autoPill.onTap=()=>this.onAutoToggle(),this.contentContainer.addChild(this.autoPill),this.lblIntro=this.makeBody(),this.lblGuideTitle=this.makeSectionTitle(),this.lblGuide=this.makeBody(),this.lblStatusTitle=this.makeSectionTitle(),this.lblStatus=this.makeBody(),this.lblHeroesTitle=this.makeSectionTitle(),this.outSideClickHide=!0} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - static waveCallName(){ - return NB.getText("CASTLE_SPECIAL_SHORT_5","웨이브 호출")} - static timeShiftName(){ - return NB.getText("GAME_1565","황혼의 부름")} - makeSectionTitle(){ - const t=new iG("",16767354,hD.DEFAULT_FONT_OPTION_16); - return this.contentContainer.addChild(t),t} - makeBody(){ - const t=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_16); - return hD.setLabelWrapWidth(t,this.width-60),this.contentContainer.addChild(t),t} - async showGuide(){ - await m5t.load(),this.showTab(this.curTab),await this.loadImage(),super.show()} - onAutoToggle(){ - if("wave"===this.curTab)return EH.getInstance().toggleWaveFromUI(),void this.autoPill.setOn(EH.getInstance().waveEnabled); - if(!m5t.isUnlocked)return void bH.getInstance().showMessage(NB.getValueReplace("GAME_633","##",m5t.UNLOCK_MAX_WAVE,"최고 WAVE 200 이상에서 환생 후 이용가능합니다.")); - const t=!m5t.autoEnabled; - m5t.setAutoEnabled(t),this.autoPill.setOn(t)} - showTab(t){ - const i="wave"===t?"timeShift":"wave",s=this.fillTab(i),e=this.fillTab(t); - this.height=Math.max(s,e)+40} - fillTab(i){ - this.curTab=i; - const s="wave"===i,e=30; - this.title=NB.getText("COMMON_49","설정"),this.tabWave.setActive(s),this.tabTimeShift.setActive(!s); - const n=.5*(this.width-60-8); - this.tabWave.setSize(n),this.tabTimeShift.setSize(n),this.tabWave.x=e,this.tabWave.y=64,this.tabTimeShift.x=this.tabWave.x+n+8,this.tabTimeShift.y=64; - const h=64+this.tabWave.tabHeight+16; - this.iconWave.visible=s,this.iconTimeShift.visible=!s; - const r=s?this.iconWave:this.iconTimeShift; - r.scale.set(48/r.texture.height),r.x=e,r.y=h,this.lblHeader.text=s?t.waveCallName():t.timeShiftName(),this.lblHeader.x=r.x+r.width+12,this.lblHeader.y=h+.5*(48-this.lblHeader.height),this.autoPill.setOn(s?EH.getInstance().waveEnabled:m5t.autoEnabled),this.autoPill.x=this.width-30-this.autoPill.pillWidth,this.autoPill.y=h+.5*(48-this.autoPill.pillHeight),this.lblIntro.text=s?NB.getText("GAME_1553","웨이브 호출은 다음 웨이브의 적들을 한꺼번에 불러내 처리함으로써, 게임의 진행속도를 빠르게 하는 기술입니다."):NB.getText("GAME_1566","황혼의 부름은 낮을 밤으로 바꿈으로서, 낮을 건너뛰어 밤 웨이브로 전환하는 기술입니다."),this.lblIntro.x=e,this.lblIntro.y=h+48+16; - const o=s?[NB.getText("GAME_1555","1. 웨이브 호출 게이지는 100초 마다 충전되고, 가득 차면, 호출할 수 있습니다."),NB.getText("GAME_1556","2. 신전에서 [ 웨이브호출 ] 레벨을 올리면, 최대 호출 횟수가 늘어납니다."),NB.getText("GAME_1557","3. 영웅의 고유스킬로 충전속도를 빠르게 할 수 있습니다.")]:[NB.getValueReplace("GAME_1567","##",Math.round(m5t.intervalSec),`1. 황혼의 부름은 ${ - Math.round(m5t.intervalSec)} - 초마다 충전되며, 가득 차면 호출할 수 있습니다.`),NB.getText("GAME_1568","2. 영웅의 고유스킬로 충전속도를 빠르게 할 수 있습니다."),NB.getText("GAME_1710","3. 영웅의 고유스킬에 따라 일정 확률로 충전 횟수를 소모하지 않고 사용할 수 있습니다. 팀 편성 시 누적 적용되며, 최대 30%입니다.")]; - this.lblGuideTitle.text=NB.getSquareBracketStr(NB.getText("GAME_1554","상세 설명")),this.lblGuideTitle.x=e,this.lblGuideTitle.y=this.lblIntro.y+this.lblIntro.height+20,this.lblGuide.text=o.join("\n"),this.lblGuide.x=e,this.lblGuide.y=this.lblGuideTitle.y+this.lblGuideTitle.height+8; - let a=this.lblGuide.y+this.lblGuide.height; - this.lblStatusTitle.visible=!0,this.lblStatus.visible=!0,this.lblStatusTitle.text=NB.getSquareBracketStr(NB.getText("GAME_1558","현재 버프 상태")),this.lblStatusTitle.x=e,this.lblStatusTitle.y=a+20,this.lblStatus.text=s?this.buildWaveStatusText():this.buildDawnStatusText(),this.lblStatus.x=e,this.lblStatus.y=this.lblStatusTitle.y+this.lblStatusTitle.height+8,a=this.lblStatus.y+this.lblStatus.height,this.lblHeroesTitle.text=NB.getSquareBracketStr(s?NB.getText("GAME_1562","웨이브 호출 관련 영웅들"):NB.getText("GAME_1569","황혼의 부름 관련 영웅들")),this.lblHeroesTitle.x=e,this.lblHeroesTitle.y=a+20,a=this.lblHeroesTitle.y+this.lblHeroesTitle.height+8; - const c=s?[{ - title:NB.getText("GAME_1563","충전속도 증가 영웅"),code:dR.WaveCall} - ,{ - title:NB.getText("GAME_1564","호출당 층을 증가시켜주는 영웅 ( 더블 웨이브 호출 )"),code:dR.DoubleWave} - ]:[{ - title:NB.getText("GAME_1563","충전속도 증가 영웅"),code:dR.CallOfDawn} - ,{ - title:NB.getText("GAME_1712","충전 횟수를 보존하는 영웅"),code:dR.DawnChargePreserve} - ]; - for(let t=0; - t<c.length; - t++){ - const i=this.getHeroGroup(t); - i.setData(c[t].title,c[t].code,this.width-60),i.x=e,i.y=a,i.visible=!0,a+=i.rowHeight+10} - for(let t=c.length; - t<this.heroGroups.length; - t++)this.heroGroups[t].visible=!1; - return a} - getHeroGroup(t){ - let i=this.heroGroups[t]; - return i||(i=new cMi,this.heroGroups[t]=i,this.contentContainer.addChild(i)),i} - buildWaveStatusText(){ - const t=b5t.getInstance().getGuideStatus(),i=Math.round(100*(t.waveCallBuff-1)),s=RP.getInstance().getGameplayTotal(mP.DoubleWave)+wP.getRaptiOwnedDoubleWaveContribution(),e=Math.min(100,Math.round(s)); - return[NB.getValueReplace("GAME_1559","##",t.maxCall,`최대 충전 개수 : ${ - t.maxCall} - `),NB.getValueReplaceMulti("GAME_1560",["##","@@"],[Math.round(t.secondsPerCall),i],`1회 충전 시간 : ${ - Math.round(t.secondsPerCall)} - 초 ( 충전속도 +${ - i} - % )`),NB.getValueReplace("GAME_1561","##",e,`한번에 2층 넘어갈 확률 : ${ - e} - % 확률로 +1`)].join("\n")} - buildDawnStatusText(){ - const t=m5t.getGuideStatus(); - return[NB.getValueReplace("GAME_1559","##",t.maxStack,`최대 충전 개수 : ${ - t.maxStack} - `),NB.getValueReplaceMulti("GAME_1560",["##","@@"],[Math.round(t.secondsPerStack),t.buffPercent],`1회 충전 시간 : ${ - Math.round(t.secondsPerStack)} - 초 ( 충전속도 +${ - t.buffPercent} - % )`),NB.getValueReplace("GAME_1711","##",t.preservePercent,`충전 횟수 보존 확률 : ${ - t.preservePercent} - % (최대 30%)`)].join("\n")} - getDefaultPositionY(){ - return.45*SS.stageHeight} - onBackButton(){ - return this.hide(),!0} - } - ; - Qt(rMi,"WaveCallGuidePopup"),Zt(rMi,"_instance"); - let oMi=rMi; - const aMi=class t extends Ke{ - constructor(){ - super(),Zt(this,"lbl"),Zt(this,"icons",[]),Zt(this,"iconHeight",0),this.lbl=new iG("",13421772,hD.DEFAULT_FONT_OPTION_16),this.lbl.eventMode="none",this.addChild(this.lbl)} - get rowHeight(){ - return this.lbl.height+6+this.iconHeight} - setData(i,s,e){ - this.lbl.text=i,hD.setLabelWrapWidth(this.lbl,e),this.lbl.x=0,this.lbl.y=0; - for(const t of this.icons)t.removeFromParent(); - if(this.icons.length=0,this.iconHeight=0,!s)return; - const n=pR.getInstance(),h=iR.getInstance(),r=new Map; - for(const t of h.bookList)for(const i of n.getSkillsForUnit(t)){ - if(!i.code||n.normalizeCode(i.code)!==s)continue; - const e=i.value??0,h=r.get(t.base); - (void 0===h||e>h)&&r.set(t.base,e)} - const o=[...r.entries()].map(([t,i])=>({ - base:t,value:i} - )); - o.sort((t,i)=>i.value-t.value); - let a=0,c=this.lbl.height+6,l=0; - for(const u of o){ - const i=RS.getTexture("UI_Ekkorr",`Hero${ - u.base} - `); - if(!i)continue; - const s=new Xe(i); - s.scale.set(t.ICON_SCALE),s.eventMode="none",a>0&&a+s.width>e&&(a=0,c+=l+t.ICON_GAP,l=0),s.x=a,s.y=c,this.addChild(s),this.icons.push(s),a+=s.width+t.ICON_GAP,l=Math.max(l,s.height)} - this.iconHeight=this.icons.length>0?c+l-(this.lbl.height+6):0} - } - ; - Qt(aMi,"HeroGroupRow"),Zt(aMi,"ICON_SCALE",.5),Zt(aMi,"ICON_GAP",4); - let cMi=aMi; - const lMi=class t extends Ke{ - constructor(t){ - super(),Zt(this,"bg",new ep),Zt(this,"lbl"),Zt(this,"tabW",120),Zt(this,"active",!1),Zt(this,"onTap",null),this.lbl=new iG(t,10132122,hD.DEFAULT_FONT_OPTION_16),this.lbl.eventMode="none",this.bg.eventMode="none",this.addChild(this.bg,this.lbl),this.eventMode="static",this.cursor="pointer",this.on("pointertap",()=>{ - var t; - return null==(t=this.onTap)?void 0:t.call(this)} - ),this.draw()} - get tabHeight(){ - return t.H} - setSize(i){ - this.tabW!==i&&(this.tabW=i,this.hitArea=new $i(0,0,i,t.H),this.draw())} - setActive(t){ - this.active!==t&&(this.active=t,this.draw())} - draw(){ - const i=t.H; - this.bg.clear().roundRect(0,0,this.tabW,i,8).fill({ - color:this.active?_H.ON_BG:0,alpha:this.active?_H.ON_BG_ALPHA:.35} - ),this.lbl.textColor=this.active?16767354:10132122,this.lbl.x=.5*(this.tabW-this.lbl.width),this.lbl.y=.5*(i-this.lbl.height)} - } - ; - Qt(lMi,"TabButton"),Zt(lMi,"H",32); - let uMi=lMi; - const dMi=Object.freeze(Object.defineProperty({ - __proto__:null,WaveCallGuidePopup:oMi} - ,Symbol.toStringTag,{ - value:"Module"} - )),fMi=class t extends kx{ - constructor(){ - super(),Zt(this,"bg"),Zt(this,"highlightBg"),Zt(this,"rankBadge",new w0t(44)),Zt(this,"lblName"),Zt(this,"lblScore"),Zt(this,"lblRound"); - const i=t.ITEM_WIDTH,s=t.ITEM_HEIGHT; - this.bg=new hE({ - texture:RS.getTexture("UI_Ekkorr","Base_bg01"),leftWidth:25,topHeight:20,rightWidth:25,bottomHeight:23} - ),this.bg.alpha=.6,this.bg.width=i,this.bg.height=s,this.addChild(this.bg),this.highlightBg=new ep,this.highlightBg.rect(0,0,i,s).fill({ - color:16766720,alpha:.18} - ),this.highlightBg.visible=!1,this.addChild(this.highlightBg); - const e=hD.DEFAULT_OUTLINE_FONT_OPTION_18; - e.fill=hD.COLOR_WHITE,this.addChild(this.rankBadge),this.lblName=new iG("",e.fill,e),this.addChild(this.lblName),this.lblScore=new iG("0",e.fill,e),this.addChild(this.lblScore),this.lblRound=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_15),this.lblRound.textSize=13,this.addChild(this.lblRound)} - get height(){ - return t.ITEM_HEIGHT} - setData(t){ - if(this.data=t,!t)return; - this.rankBadge.setRank(t.rank),this.lblName.text=t.name,this.lblScore.text=qD.displayLargeNumberAsAlphabet(t.bestScore),this.lblRound.text=`${ - NB.getText("","관문")} - ${ - t.bestRound} - `; - const i=t.userId===TG.userId; - this.highlightBg.visible=i,this.lblName.textColor=i?6750054:16777215,this.layout()} - layout(){ - const i=t.ITEM_WIDTH,s=t.ITEM_HEIGHT,e=.5*(s-this.lblName.height); - this.rankBadge.x=16,this.rankBadge.y=.5*(s-44),this.lblName.x=80,this.lblName.y=e,this.lblScore.x=i-20-this.lblScore.width,this.lblScore.y=5,this.lblRound.x=i-20-this.lblRound.width,this.lblRound.y=28} - } - ; - Qt(fMi,"CardEventRankingItemRenderer"),Zt(fMi,"ITEM_WIDTH",520),Zt(fMi,"ITEM_HEIGHT",50); - let pMi=fMi; - const wMi=class t extends pB{ - constructor(){ - super(),Zt(this,"lblMyRank"),Zt(this,"list"),this.title=NB.getText("COMMON_20","랭킹"),this.height=t.POPUP_HEIGHT,this.lblMyRank=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_16),this.contentContainer.addChild(this.lblMyRank),this.list=new Ox(pMi,pMi.ITEM_WIDTH,t.LIST_HEIGHT,4),this.list.x=.5*(this.width-pMi.ITEM_WIDTH),this.list.y=t.LIST_TOP,this.contentContainer.addChild(this.list)} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - setData(t,i){ - this.lblMyRank.text=null!=i?`${ - NB.getText("","내 순위")} - : ${ - i} - ${ - NB.getText("","위")} - `:NB.getText("","아직 기록이 없습니다"),this.lblMyRank.x=.5*(this.width-this.lblMyRank.width),this.lblMyRank.y=80,this.list.dataProvider=t,this.list.scrollTo(0)} - } - ; - Qt(wMi,"CardEventRankingPopup"),Zt(wMi,"_instance"),Zt(wMi,"POPUP_HEIGHT",700),Zt(wMi,"LIST_TOP",120),Zt(wMi,"LIST_HEIGHT",540); - let gMi=wMi; - const mMi=[{ - id:1,kind:"angel",effect:"enhance",enhance:"power",name:"축복·힘"} - ,{ - id:2,kind:"angel",effect:"enhance",enhance:"buff",name:"축복·용맹"} - ,{ - id:3,kind:"angel",effect:"enhance",enhance:"wild",name:"축복·만능"} - ,{ - id:4,kind:"angel",effect:"enhance",enhance:"gold",name:"축복·재화"} - ,{ - id:5,kind:"angel",effect:"enhance",enhance:"glass",name:"축복·유리"} - ,{ - id:6,kind:"angel",effect:"sealRandom",name:"천사의 인장"} - ,{ - id:7,kind:"devil",effect:"convertSuit",name:"계약·변신"} - ,{ - id:8,kind:"devil",effect:"rankUp",name:"계약·승급"} - ,{ - id:9,kind:"devil",effect:"destroy",name:"계약·소멸"} - ,{ - id:10,kind:"devil",effect:"clone",name:"계약·복제"} - ,{ - id:11,kind:"devil",effect:"goldGamble",name:"계약·도박"} - ,{ - id:12,kind:"devil",effect:"recruitHero",name:"계약·징집"} - ]; - function vMi(t){ - const i=mMi.find(i=>i.id===t); - if(!i)throw new Error(`알 수 없는 소모품: ${ - t} - `); - return i} - Qt(vMi,"getConsumableDef"); - const _Mi=class t extends pB{ - constructor(){ - super(),Zt(this,"lblHeader"),Zt(this,"lblRound"),Zt(this,"lblScore"),Zt(this,"lblNewBest"),Zt(this,"lblReward"),Zt(this,"btnExit"),Zt(this,"onExit",null),this.title=NB.getText("","도전 결과"),this.lblHeader=new iG(NB.getText("","패배..."),14708828,hD.DEFAULT_OUTLINE_FONT_OPTION_24),this.lblHeader.textColor=14708828,this.contentContainer.addChild(this.lblHeader),this.lblRound=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_16),this.contentContainer.addChild(this.lblRound),this.lblScore=new iG("",16767332,hD.DEFAULT_OUTLINE_FONT_OPTION_32),this.lblScore.textColor=16767332,this.contentContainer.addChild(this.lblScore),this.lblNewBest=new iG(NB.getText("","★ 최고 기록 갱신!"),16771488,hD.DEFAULT_OUTLINE_FONT_OPTION_18),this.lblNewBest.textColor=16771488,this.contentContainer.addChild(this.lblNewBest),this.lblReward=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_16),this.contentContainer.addChild(this.lblReward),this.btnExit=new nB(NB.getText("COMMON_1","확인")),this.btnExit.onClick=this.onExitClick.bind(this),this.contentContainer.addChild(this.btnExit)} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - setData(t){ - this.lblRound.text=`${ - NB.getText("","관문")} - ${ - t.finalRound} - ${ - NB.getText("","도달")} - `,this.lblScore.text=qD.displayLargeNumberAsAlphabet(t.finalScore),this.lblNewBest.visible=t.isNewBest,this.lblReward.visible=t.rewardEventCoin>0,this.lblReward.text=`${ - NB.getText("","획득")} - : ${ - NB.getText("","이벤트 재화")} - ×${ - t.rewardEventCoin} - `,this.updateLayout()} - updateLayout(){ - const t=this.width; - let i=80; - this.lblHeader.x=.5*(t-this.lblHeader.width),this.lblHeader.y=i,i+=50,this.lblRound.x=.5*(t-this.lblRound.width),this.lblRound.y=i,i+=36,this.lblScore.x=.5*(t-this.lblScore.width),this.lblScore.y=i,i+=56,this.lblNewBest.visible&&(this.lblNewBest.x=.5*(t-this.lblNewBest.width),this.lblNewBest.y=i,i+=40),this.lblReward.visible&&(this.lblReward.x=.5*(t-this.lblReward.width),this.lblReward.y=i,i+=36),i+=14,this.btnExit.width=240,this.btnExit.x=.5*(t-this.btnExit.width),this.btnExit.y=i,i+=this.btnExit.height+30,this.height=i} - onExitClick(){ - const t=this.onExit; - this.hide(),t&&t()} - onBackButton(){ - return this.onExitClick(),!0} - } - ; - Qt(_Mi,"CardEventResultPopup"),Zt(_Mi,"_instance"); - let MMi=_Mi,bMi=(Qt(Xt=class extends pB{ - constructor(){ - super(),Zt(this,"lblTitle"),Zt(this,"lblScore"),Zt(this,"lblDesc"),Zt(this,"btnContinue"),Zt(this,"btnFinish"),Zt(this,"onChoice",null),this.bg.visible=!1,this.btnClose.visible=!1,this.width=640,this.lblTitle=new iG(NB.getText("","🏰 정복 완료!"),16767332,hD.DEFAULT_OUTLINE_FONT_OPTION_32),this.lblTitle.textColor=16767332,this.contentContainer.addChild(this.lblTitle),this.lblScore=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_OUTLINE_FONT_OPTION_24),this.contentContainer.addChild(this.lblScore),this.lblDesc=new iG(NB.getText("","랭킹 점수가 확정되었습니다.\n계속 싸우면 무한전투 — 개인 기록에만 남습니다."),hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_16),this.contentContainer.addChild(this.lblDesc),this.btnContinue=new nB(NB.getText("","계속 싸운다")),this.btnContinue.onClick=()=>this.pick(!0),this.contentContainer.addChild(this.btnContinue),this.btnFinish=new nB(NB.getText("","종료")),this.btnFinish.onClick=()=>this.pick(!1),this.contentContainer.addChild(this.btnFinish)} - static getInstance(){ - return this._instance||(this._instance=new Xt),this._instance} - setData(t){ - let i=10; - this.lblTitle.x=.5*(640-this.lblTitle.width),this.lblTitle.y=i,i+=64,this.lblScore.text=`${ - NB.getText("","정복 점수")} - ${ - qD.displayLargeNumberAsAlphabet(t)} - `,this.lblScore.x=.5*(640-this.lblScore.width),this.lblScore.y=i,i+=52,this.lblDesc.x=.5*(640-this.lblDesc.width),this.lblDesc.y=i,i+=this.lblDesc.height+30,this.btnContinue.width=220,this.btnFinish.width=220,this.btnContinue.x=90,this.btnFinish.x=330,this.btnContinue.y=i,this.btnFinish.y=i,i+=this.btnContinue.height+30,this.height=i} - pick(t){ - const i=this.onChoice; - this.hide(),i&&i(t)} - onBackButton(){ - return!0} - } - ,"ConquestPopup"),Zt(Xt,"_instance"),Xt); - const yMi=[{ - id:1,rarity:0,effect:"suitBuffAdd",value:2,suit:0,name:"문양 신봉자·불"} - ,{ - id:2,rarity:0,effect:"suitBuffAdd",value:2,suit:1,name:"문양 신봉자·물"} - ,{ - id:3,rarity:0,effect:"suitBuffAdd",value:2,suit:2,name:"문양 신봉자·숲"} - ,{ - id:4,rarity:0,effect:"suitBuffAdd",value:2,suit:3,name:"문양 신봉자·빛"} - ,{ - id:5,rarity:0,effect:"fewCardsBuffAdd",value:8,name:"저격수"} - ,{ - id:6,rarity:0,effect:"fiveCardsPowerAdd",value:100,name:"물량공세"} - ,{ - id:7,rarity:0,effect:"pairFamilyBuffAdd",value:6,name:"페어 장인"} - ,{ - id:8,rarity:0,effect:"straightFamilyBuffAdd",value:8,name:"직진"} - ,{ - id:9,rarity:0,effect:"flushFamilyBuffAdd",value:8,name:"같은 문양"} - ,{ - id:10,rarity:0,effect:"discardLeftBuffAdd",value:3,name:"알뜰함"} - ,{ - id:11,rarity:0,effect:"numberCardPowerAdd",value:15,name:"고물상"} - ,{ - id:12,rarity:0,effect:"faceCardBuffAdd",value:2,name:"귀족"} - ,{ - id:13,rarity:1,effect:"buffMult",value:1.5,name:"대장군"} - ,{ - id:14,rarity:1,effect:"lastSubmitBuffMult",value:3,name:"결의"} - ,{ - id:15,rarity:1,effect:"firstSubmitBuffMult",value:2,name:"선봉장"} - ,{ - id:16,rarity:1,effect:"acePerBuffMult",value:1.5,name:"에이스 수집가"} - ,{ - id:17,rarity:1,effect:"tripleFamilyBuffMult",value:2,name:"삼형제"} - ,{ - id:18,rarity:1,effect:"highCardBuffMult",value:4,name:"모험가"} - ,{ - id:19,rarity:2,effect:"buffMult",value:3,name:"전설의 용사"} - ,{ - id:20,rarity:2,effect:"permanentBuffStack",value:1,name:"노장"} - ],EMi=[{ - id:1,effect:"gold8",value:8,name:"군자금 태그"} - ,{ - id:2,effect:"freePack",value:1,name:"보급 태그"} - ,{ - id:3,effect:"freeReroll",value:1,name:"재정비 태그"} - ,{ - id:4,effect:"rarePetGuarantee",value:1,name:"희귀 펫 태그"} - ,{ - id:5,effect:"randomRelic",value:1,name:"유물 태그"} - ,{ - id:6,effect:"bossGoldDouble",value:2,name:"투자 태그"} - ],AMi={ - power:"⚔",buff:"🔥",wild:"✦",gold:"◉",glass:"◇"} - ,SMi={ - human:14263601,orc:12731695,elf:5012794,undead:8019102} - ,TMi=class t extends Ke{ - constructor(){ - super(),Zt(this,"bg"),Zt(this,"lblRank"),Zt(this,"lblSuit"),Zt(this,"lblCenter"),Zt(this,"lblEnhance"),Zt(this,"sealDot"),Zt(this,"dimOverlay"),Zt(this,"_card",null),Zt(this,"_selected",!1),Zt(this,"_baseY",0),Zt(this,"onTap",null),Zt(this,"handIndex",-1),this.bg=new ep,this.drawBg(!1),this.addChild(this.bg),this.lblRank=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_OUTLINE_FONT_OPTION_24),this.lblRank.x=10,this.lblRank.y=6,this.addChild(this.lblRank),this.lblSuit=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_OUTLINE_FONT_OPTION_18),this.lblSuit.x=12,this.lblSuit.y=40,this.addChild(this.lblSuit),this.lblCenter=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_OUTLINE_FONT_OPTION_32),this.addChild(this.lblCenter),this.lblEnhance=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_16),this.lblEnhance.visible=!1,this.addChild(this.lblEnhance),this.sealDot=new ep,this.sealDot.visible=!1,this.addChild(this.sealDot),this.dimOverlay=new ep,this.dimOverlay.roundRect(0,0,t.CARD_WIDTH,t.CARD_HEIGHT,10).fill({ - color:0,alpha:.55} - ),this.dimOverlay.visible=!1,this.addChild(this.dimOverlay),this.eventMode="static",this.cursor="pointer",this.on("pointertap",()=>{ - this.onTap&&this.onTap(this)} - )} - static rankLabel(t){ - return t<=10?String(t):["J","Q","K","A"][t-11]} - setCard(i){ - if(this._card=i,i.rank<2)return this.lblRank.text="",this.lblSuit.text="",this.lblCenter.text="?",this.lblCenter.textColor=9075814,this.lblCenter.alpha=.9,this.lblCenter.x=.5*(t.CARD_WIDTH-this.lblCenter.width),this.lblCenter.y=.5*(t.CARD_HEIGHT-this.lblCenter.height),this.lblEnhance.visible=!1,this.sealDot.visible=!1,void this.drawBg(this._selected,!0); - const s=t.SUIT_COLORS[i.suit]??16777215,e=t.SUIT_GLYPHS[i.suit]??"?"; - this.lblRank.text=t.rankLabel(i.rank),this.lblRank.textColor=s,this.lblSuit.text=e,this.lblSuit.textColor=s,this.lblCenter.text=e,this.lblCenter.textColor=s,this.lblCenter.alpha=.75,this.lblCenter.x=.5*(t.CARD_WIDTH-this.lblCenter.width),this.lblCenter.y=.5*(t.CARD_HEIGHT-this.lblCenter.height)+14,i.enhance?(this.lblEnhance.text=AMi[i.enhance]??"",this.lblEnhance.x=t.CARD_WIDTH-this.lblEnhance.width-8,this.lblEnhance.y=6,this.lblEnhance.visible=!0):this.lblEnhance.visible=!1,i.seal?(this.sealDot.clear(),this.sealDot.circle(16,t.CARD_HEIGHT-16,9).fill({ - color:SMi[i.seal]??16777215} - ).stroke({ - color:3813154,width:2} - ),this.sealDot.visible=!0):this.sealDot.visible=!1,this.drawBg(this._selected,!1)} - setDimmed(t){ - this.dimOverlay.visible=t} - get card(){ - return this._card} - setBaseY(t){ - this._baseY=t,this.applySelectedY()} - get selected(){ - return this._selected} - set selected(t){ - this._selected!==t&&(this._selected=t,this.applySelectedY(),this.drawBg(t,null!==this._card&&this._card.rank<2))} - drawBg(i,s=!1){ - this.bg.clear(),this.bg.roundRect(0,0,t.CARD_WIDTH,t.CARD_HEIGHT,10).fill({ - color:s?2901096:16644332} - ).stroke({ - color:i?16762940:s?8032952:10127986,width:i?6:3} - )} - applySelectedY(){ - this.y=this._selected?this._baseY-t.SELECT_POP_Y:this._baseY} - setDisplayScale(t){ - this.scale.set(t)} - } - ; - Qt(TMi,"PlayingCardRenderer"),Zt(TMi,"CARD_WIDTH",135),Zt(TMi,"CARD_HEIGHT",185),Zt(TMi,"SELECT_POP_Y",40),Zt(TMi,"SUIT_GLYPHS",["▲","●","◆","★"]),Zt(TMi,"SUIT_COLORS",[12731695,3042982,5012794,11040298]); - let CMi=TMi; - const OMi={ - [K2t.HIGH_CARD]:"하이카드",[K2t.PAIR]:"페어",[K2t.TWO_PAIR]:"투페어",[K2t.TRIPLE]:"트리플",[K2t.STRAIGHT]:"스트레이트",[K2t.FLUSH]:"플러시",[K2t.FULL_HOUSE]:"풀하우스",[K2t.FOUR_KIND]:"포카드",[K2t.STRAIGHT_FLUSH]:"스트레이트 플러시"} - ,IMi=["외성","내성","보스전"]; - function kMi(t,i){ - const s=o5t(t),e=null!==i?CMi.SUIT_GLYPHS[i]:"?"; - switch(s.effect){ - case"suitZero":return`${ - e} - 문양 카드 전투력 0`; - case"heroVoid":return"영웅 카드(J/Q/K) 무효"; - case"firstSubmitZero":return"첫 전투 점수 0"; - case"handMinus2":return"손패 -2"; - case"submitLimit3":return"전투 3회로 제한"; - case"repeatHandVoid":return"이미 낸 족보 무효"; - case"cardFlip":return"매 전투 손패 1장 뒤집힘"; - case"discardGoldPenalty":return"해고할 때마다 골드 -1"} - } - function xMi(t){ - var i; - return"relic"===t.kind?(null==(i=n5t[t.refId])?void 0:i.name)??"유물":vMi(t.refId).name} - function RMi(t){ - if("relic"===t.kind){ - const i=n5t[t.refId]; - return`${ - OMi[i.handType]} - 레벨 +1 (+${ - i.perLevelPower} - 전투력 / +${ - i.perLevelBuff} - 버프)`} - const i=vMi(t.refId); - switch(i.effect){ - case"enhance":return`카드 1장에 [${ - { - power:"전투력 강화 (+30)",buff:"버프 강화 (+4)",wild:"만능 (모든 문양)",gold:"골드 강화 (전투지 종료 시 손패에 있으면 +3)",glass:"유리 (버프 ×2, 20% 파괴)"} - [i.enhance??""]??""} - ]`; - case"sealRandom":return"카드 1장에 무작위 종족 인장"; - case"convertSuit":return"카드 2장을 지정 문양으로 변환"; - case"rankUp":return"카드 2장 랭크 +1"; - case"destroy":return"카드 2장 영구 파괴 (덱 압축)"; - case"clone":return"카드 1장 복제"; - case"goldGamble":return"50% 골드 ×2 / 50% 골드 0"; - case"recruitHero":return"무작위 영웅 카드 1장 덱에 추가"} - } - function PMi(t){ - const i=i5t.find(i=>i.id===t); - if(!i)return""; - switch(i.effect){ - case"handPlus1":return"손패 +1"; - case"submitPlus1":return"전투 횟수 +1"; - case"discardPlus1":return"해고 횟수 +1"; - case"shopSlotPlus1":return"상점 카드 슬롯 +1"; - case"packDiscount":return"팩 가격 25% 할인"; - case"rerollDiscount":return"리롤 비용 -2"; - case"interestCapPlus":return"이자 상한 +5"; - case"consumableSlotPlus1":return"소모품 슬롯 +1"} - } - function NMi(t){ - var i; - return(null==(i=i5t.find(i=>i.id===t))?void 0:i.name)??"특수카드"} - function LMi(t){ - var i; - return(null==(i=EMi.find(i=>i.id===t))?void 0:i.name)??"태그"} - function DMi(t){ - const i=EMi.find(i=>i.id===t); - if(!i)return""; - switch(i.effect){ - case"gold8":return"골드 +8"; - case"freePack":return"다음 팩 무료"; - case"freeReroll":return"다음 리롤 무료"; - case"rarePetGuarantee":return"다음 상점 희귀+ 펫 확정"; - case"randomRelic":return"무작위 유물 획득"; - case"bossGoldDouble":return"다음 보스전 클리어 골드 ×2"} - } - function GMi(t){ - var i,s; - switch(t.kind){ - case"pet":return(null==(i=yMi.find(i=>i.id===t.refId))?void 0:i.name)??"펫"; - case"consumable":return vMi(t.refId).name; - case"relic":return(null==(s=n5t[t.refId])?void 0:s.name)??"유물"; - case"voucher":return NMi(t.refId); - case"pack":return{ - soldier:"병사 팩",relic:"유물 팩",consumable:"천사·악마 팩",pet:"펫 팩"} - [t.packKind??""]??"팩"} - } - Qt(kMi,"gimmickDesc"),Qt(xMi,"consumableItemName"),Qt(RMi,"consumableItemDesc"),Qt(PMi,"voucherDesc"),Qt(NMi,"voucherName"),Qt(LMi,"tagName"),Qt(DMi,"tagDesc"),Qt(GMi,"shopItemName"); - const BMi=class t extends Ke{ - constructor(){ - super(),Zt(this,"renderers",[]),Zt(this,"selectedIdx",new Set),Zt(this,"onSelectionChange",null),Zt(this,"locked",!1),Zt(this,"sortMode","rank"); - for(let i=0; - i<10; - i++){ - const i=new CMi; - i.pivot.set(.5*CMi.CARD_WIDTH,CMi.CARD_HEIGHT),i.scale.set(t.HAND_SCALE),i.onTap=this.onCardTap.bind(this),this.renderers.push(i),this.addChild(i)} - } - setHand(i,s){ - this.selectedIdx.clear(); - const e=i.length,n=CMi.CARD_WIDTH*t.HAND_SCALE,h=e<=1?0:Math.min(t.SPACING,(t.AREA_WIDTH-n-20)/(e-1)),r=h*(e-1)+n,o=.5*(t.AREA_WIDTH-r),a=i.map((t,i)=>({ - card:t,originalIdx:i} - )); - a.sort((t,i)=>"suit"===this.sortMode&&t.card.suit!==i.card.suit?t.card.suit-i.card.suit:t.card.rank!==i.card.rank?i.card.rank-t.card.rank:t.card.suit-i.card.suit); - const c=.5*(e-1); - for(let l=0; - l<this.renderers.length; - l++){ - const i=this.renderers[l]; - if(l<e){ - const e=l-c,r=a[l]; - i.visible=!0,i.handIndex=r.originalIdx,i.setCard(r.card),i.setDimmed((null==s?void 0:s.has(r.card.id))??!1),i.x=o+l*h+.5*n,i.rotation=e*t.FAN_ANGLE_STEP,i.setBaseY(CMi.SELECT_POP_Y+CMi.CARD_HEIGHT*t.HAND_SCALE+e*e*t.FAN_ARC_DROP),i.selected=!1,i.zIndex=l} - else i.visible=!1} - this.sortChildren(),this.emitChange()} - getSelected(){ - return[...this.selectedIdx].sort((t,i)=>t-i)} - clearSelection(){ - this.selectedIdx.clear(); - for(const t of this.renderers)t.selected=!1; - this.emitChange()} - get areaHeight(){ - const i=12.25*t.FAN_ARC_DROP+Math.sin(3.5*t.FAN_ANGLE_STEP)*CMi.CARD_WIDTH*t.HAND_SCALE*.5; - return CMi.CARD_HEIGHT*t.HAND_SCALE+CMi.SELECT_POP_Y+Math.ceil(i)} - onCardTap(t){ - if(this.locked||!t.visible)return; - const i=t.handIndex; - if(this.selectedIdx.has(i))this.selectedIdx.delete(i),t.selected=!1; - else{ - if(this.selectedIdx.size>=5)return; - this.selectedIdx.add(i),t.selected=!0} - this.emitChange()} - emitChange(){ - this.onSelectionChange&&this.onSelectionChange(this.getSelected())} - } - ; - Qt(BMi,"HandFan"),Zt(BMi,"SPACING",72),Zt(BMi,"AREA_WIDTH",640),Zt(BMi,"FAN_ANGLE_STEP",.034),Zt(BMi,"FAN_ARC_DROP",1.9),Zt(BMi,"HAND_SCALE",.85); - let UMi=BMi; - const FMi=["불","물","숲","빛"]; - function $Mi(t){ - const i=t.value; - switch(t.effect){ - case"suitBuffAdd":return`출격한 ${ - FMi[t.suit??0]} - 1장당 사기 +${ - i} - `; - case"fewCardsBuffAdd":return`3장 이하 출격 시 사기 +${ - i} - `; - case"fiveCardsPowerAdd":return`5장 출격 시 전투력 +${ - i} - `; - case"pairFamilyBuffAdd":return`페어 계열 사기 +${ - i} - `; - case"straightFamilyBuffAdd":return`스트레이트 계열 사기 +${ - i} - `; - case"flushFamilyBuffAdd":return`같은 문양 계열 사기 +${ - i} - `; - case"discardLeftBuffAdd":return`남은 버리기 1회당 사기 +${ - i} - `; - case"numberCardPowerAdd":return`숫자 카드 1장당 전투력 +${ - i} - `; - case"faceCardBuffAdd":return`그림 카드 1장당 사기 +${ - i} - `; - case"buffMult":return`사기 ×${ - i} - `; - case"lastSubmitBuffMult":return`마지막 출격 사기 ×${ - i} - `; - case"firstSubmitBuffMult":return`첫 출격 사기 ×${ - i} - `; - case"acePerBuffMult":return`A 1장당 사기 ×${ - i} - `; - case"tripleFamilyBuffMult":return`트리플 계열 사기 ×${ - i} - `; - case"highCardBuffMult":return`하이카드 사기 ×${ - i} - `; - case"permanentBuffStack":return`출격마다 사기 +${ - i} - 누적`; - default:return""} - } - Qt($Mi,"describeJoker"); - const HMi=["일반","희귀","전설"],WMi=[13421772,8308963,16767332],VMi=class t extends Ke{ - constructor(i=!1){ - super(),Zt(this,"bg"),Zt(this,"lblRarity"),Zt(this,"lblName"),Zt(this,"lblDesc"),Zt(this,"_def",null),Zt(this,"_selected",!1),Zt(this,"compact"),Zt(this,"onTap",null),Zt(this,"slotIndex",-1),this.compact=i; - const s=i?t.COMPACT_WIDTH:t.FULL_WIDTH,e=i?t.COMPACT_HEIGHT:t.FULL_HEIGHT; - this.bg=new hE({ - texture:RS.getTexture("UI_Ekkorr","UI_Toast_Bg"),leftWidth:8,topHeight:8,rightWidth:8,bottomHeight:8} - ),this.bg.width=s,this.bg.height=e,this.addChild(this.bg),this.lblRarity=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_15),this.lblRarity.textSize=i?11:14,this.addChild(this.lblRarity),this.lblName=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_OUTLINE_FONT_OPTION_16),i&&(this.lblName.textSize=13),this.addChild(this.lblName),this.lblDesc=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_15),this.lblDesc.textSize=i?11:14,hD.setLabelWrapWidth(this.lblDesc,s-16),this.addChild(this.lblDesc),this.eventMode="static",this.cursor="pointer",this.on("pointertap",()=>{ - this.onTap&&this.onTap(this)} - )} - setEmpty(){ - this._def=null,this.lblRarity.text="",this.lblName.text="빈 슬롯",this.lblName.textColor=9075296,this.lblDesc.text="",this.bg.tint=10127986,this.layout()} - setJoker(t){ - this._def=t,this.lblRarity.text=HMi[t.rarity]??"",this.lblRarity.textColor=WMi[t.rarity]??16777215,this.lblName.text=t.name,this.lblName.textColor=16777215,this.lblDesc.text=$Mi(t),this.bg.tint=16777215,this.layout()} - get def(){ - return this._def} - get selected(){ - return this._selected} - set selected(t){ - this._selected=t,this.bg.tint=t?16771488:this._def?16777215:10127986} - layout(){ - const t=this.bg.width,i=this.bg.height; - this.lblRarity.x=.5*(t-this.lblRarity.width),this.lblRarity.y=this.compact?8:14,this.lblName.x=.5*(t-this.lblName.width),this.lblName.y=this.lblRarity.y+(this.compact?18:26),this.lblDesc.x=.5*(t-this.lblDesc.width),this.lblDesc.y=this.compact?this.lblName.y+26:Math.max(this.lblName.y+36,.55*(i-this.lblDesc.height))} - } - ; - Qt(VMi,"JokerCardRenderer"),Zt(VMi,"FULL_WIDTH",150),Zt(VMi,"FULL_HEIGHT",210),Zt(VMi,"COMPACT_WIDTH",118),Zt(VMi,"COMPACT_HEIGHT",170); - let jMi=VMi; - const KMi=class extends Ke{ - constructor(t=16767332){ - super(),Zt(this,"lbl"),Zt(this,"tickerFn",null),Zt(this,"prefix",""),Zt(this,"suffix",""),this.lbl=new iG("",t,hD.DEFAULT_OUTLINE_FONT_OPTION_24),this.lbl.textColor=t,this.addChild(this.lbl)} - setStatic(t){ - this.stop(),this.lbl.text=t,this.scale.set(1),this.centerLabel()} - countFromTo(t,i,s=260,e=0){ - this.stop(); - const n=performance.now(),h=Qt(()=>{ - const h=Math.min(1,(performance.now()-n)/s),r=t+(i-t)*h,o=e>0?(Math.round(r*10**e)/10**e).toLocaleString():Math.floor(r).toLocaleString(); - this.lbl.text=`${ - this.prefix} - ${ - o} - ${ - this.suffix} - `,this.scale.set(1+.3*Math.sin(h*Math.PI)),this.centerLabel(),h>=1&&(this.stop(),this.scale.set(1),this.centerLabel())} - ,"fn"); - this.tickerFn=h,Mn.shared.add(h),h()} - setBounce(t){ - this.stop(),this.lbl.text=`${ - this.prefix} - ${ - t} - ${ - this.suffix} - `; - const i=performance.now(),s=Qt(()=>{ - const t=Math.min(1,(performance.now()-i)/160); - this.scale.set(1+.35*(1-t)),this.centerLabel(),t>=1&&(this.stop(),this.scale.set(1))} - ,"fn"); - this.tickerFn=s,Mn.shared.add(s),s()} - countUp(t,i=700,s=0,e){ - this.stop(); - const n=performance.now(),h=Qt(()=>{ - const h=Math.min(1,(performance.now()-n)/i),r=t*h,o=s>0?(Math.round(r*10**s)/10**s).toLocaleString():Math.floor(r).toLocaleString(); - this.lbl.text=`${ - this.prefix} - ${ - o} - ${ - this.suffix} - `,this.scale.set(1+.4*Math.sin(h*Math.PI)),this.centerLabel(),h>=1&&(this.stop(),this.scale.set(1),e&&e())} - ,"fn"); - this.tickerFn=h,Mn.shared.add(h),h()} - setAffix(t,i=""){ - this.prefix=t,this.suffix=i} - stop(){ - this.tickerFn&&(Mn.shared.remove(this.tickerFn),this.tickerFn=null)} - centerLabel(){ - this.lbl.x=.5*-this.lbl.width,this.lbl.y=.5*-this.lbl.height} - } - ; - Qt(KMi,"ScoreCountUpLabel"); - let zMi=KMi; - function YMi(t,i,s){ - const e=[],n=e5t(t),h=h5t(n,s.handLevels[n]??1); - let r=h.power,o=h.buff+s.permBuffStacks,a=1; - const c=Qt((t,i=-1,s=-1)=>{ - e.push({ - kind:t,cardIndex:i,petIndex:s,power:r,buff:Math.round(o*a*10)/10} - )} - ,"push"); - c("base"); - const l=null!==s.bossGimmickId?o5t(s.bossGimmickId).effect:null; - for(let d=0; - d<t.length; - d++){ - const i=t[d]; - if("suitZero"===l&&i.suit===s.bossGimmickSuit||"heroVoid"===l&&i.rank>=11&&i.rank<=13||i.rank<2)continue; - const e="orc"===i.seal?2:1; - for(let t=0; - t<e; - t++)r+=Q2t(i.rank),"power"===i.enhance&&(r+=30),"buff"===i.enhance&&(o+=4),"glass"===i.enhance&&(a*=2); - c("card",d)} - let u=a5t(t,[],s); - for(let d=0; - d<i.length; - d++){ - const e=a5t(t,i.slice(0,d+1),s); - e.power===u.power&&e.buffAdd===u.buffAdd&&e.buffMultTotal===u.buffMultTotal||(r=e.power,o=e.buffAdd,a=e.buffMultTotal,c("pet",-1,d)),u=e} - return e} - Qt(YMi,"buildScoreSteps"); - const qMi=class t extends Ke{ - constructor(){ - super(),Zt(this,"bg"),Zt(this,"lblKind"),Zt(this,"lblName"),Zt(this,"lblPrice"),Zt(this,"item",null),Zt(this,"onTap",null),this.bg=new ep,this.addChild(this.bg),this.lblKind=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_15),this.lblKind.x=10,this.lblKind.y=8,this.addChild(this.lblKind),this.lblName=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_OUTLINE_FONT_OPTION_18),this.lblName.x=10,this.lblName.y=32,this.addChild(this.lblName),this.lblPrice=new iG("",16767332,hD.DEFAULT_OUTLINE_FONT_OPTION_18),this.lblPrice.textColor=16767332,this.addChild(this.lblPrice),this.eventMode="static",this.cursor="pointer",this.on("pointertap",()=>{ - this.item&&!this.item.sold&&this.onTap&&this.onTap(this)} - )} - setItem(i){ - this.item=i,this.visible=null!==i,i&&(this.lblKind.text={ - pet:"펫",consumable:"천사/악마",relic:"유물",voucher:"특수카드",pack:"팩"} - [i.kind]??"",this.lblKind.textColor={ - pet:7317759,consumable:15782016,relic:13616373,voucher:16752235,pack:10407804} - [i.kind]??16777215,this.lblName.text=GMi(i),this.lblPrice.text=i.sold?NB.getText("","판매됨"):`${ - i.price} - G`,this.lblPrice.x=t.W-this.lblPrice.width-10,this.lblPrice.y=t.H-this.lblPrice.height-8,this.bg.clear(),this.bg.roundRect(0,0,t.W,t.H,10).fill({ - color:i.sold?1709070:2760724} - ).stroke({ - color:i.sold?3813154:7033651,width:2} - ),this.alpha=i.sold?.5:1)} - } - ; - Qt(qMi,"ShopItemCell"),Zt(qMi,"W",190),Zt(qMi,"H",96); - let XMi=qMi; - const JMi=class extends Ke{ - constructor(){ - super(),Zt(this,"lblTitle"),Zt(this,"lblGold"),Zt(this,"cells",[]),Zt(this,"lblOwned"),Zt(this,"ownedPets",[]),Zt(this,"lblConsumables"),Zt(this,"btnReroll"),Zt(this,"btnNext"),Zt(this,"onBuy",null),Zt(this,"onPetTap",null),Zt(this,"onReroll",null),Zt(this,"onNext",null),this.lblTitle=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_OUTLINE_FONT_OPTION_24),this.lblTitle.x=25,this.addChild(this.lblTitle),this.lblGold=new iG("",16767332,hD.DEFAULT_OUTLINE_FONT_OPTION_24),this.lblGold.textColor=16767332,this.addChild(this.lblGold); - for(let t=0; - t<6; - t++){ - const t=new XMi; - t.onTap=t=>{ - this.onBuy&&t.item&&this.onBuy(t.item.slot)} - ,this.cells.push(t),this.addChild(t)} - this.lblOwned=new iG(NB.getText("","보유 — 펫 탭: 판매"),hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_15),this.lblOwned.x=25,this.addChild(this.lblOwned); - for(let t=0; - t<6; - t++){ - const i=new jMi(!0); - i.slotIndex=t,i.onTap=t=>{ - this.onPetTap&&this.onPetTap(t.slotIndex)} - ,i.scale.set(.72),this.ownedPets.push(i),this.addChild(i)} - this.lblConsumables=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_15),this.lblConsumables.x=25,this.addChild(this.lblConsumables),this.btnReroll=new nB(NB.getText("","리롤")),this.btnReroll.width=285,this.btnReroll.onClick=()=>{ - this.onReroll&&this.onReroll()} - ,this.addChild(this.btnReroll),this.btnNext=new nB(NB.getText("","다음 전투 →")),this.btnNext.width=285,this.btnNext.onClick=()=>{ - this.onNext&&this.onNext()} - ,this.addChild(this.btnNext)} - setData(t,i,s){ - const e=t.shop; - if(!e)return; - this.lblTitle.text=`${ - NB.getText("","상점")} - — ${ - t.chapter} - ${ - NB.getText("","챕터")} - · ${ - IMi[t.stage]} - `,this.lblTitle.y=i,this.lblGold.text=`${ - t.gold} - G`,this.lblGold.x=615-this.lblGold.width,this.lblGold.y=i; - let n=i+46; - const h=.5*(640-2*XMi.W-12); - for(let c=0; - c<this.cells.length; - c++){ - const t=c<e.items.length?e.items[c]:null; - this.cells[c].setItem(t),t&&(this.cells[c].x=h+c%2*(XMi.W+12),this.cells[c].y=n+Math.floor(c/2)*(XMi.H+10))} - n+=Math.ceil(e.items.length/2)*(XMi.H+10)+14,this.lblOwned.y=n,n+=26; - const r=.72*jMi.COMPACT_WIDTH; - for(let c=0; - c<this.ownedPets.length; - c++){ - const i=this.ownedPets[c]; - c<t.jokers.length?(i.visible=!0,i.setJoker(t.jokers[c]),i.x=25+c*(r+6),i.y=n):i.visible=!1} - n+=.72*jMi.COMPACT_HEIGHT+12; - const o=t.consumables.length>0?t.consumables.map(t=>xMi(t)).join(" · "):NB.getText("","(소모품 없음)"); - this.lblConsumables.text=`${ - NB.getText("","소모품")} - : ${ - o} - `,this.lblConsumables.y=n; - const a=s-this.btnReroll.height; - this.btnReroll.text=`${ - NB.getText("","리롤")} - ${ - e.rerollCost} - G`,this.btnReroll.x=25,this.btnReroll.y=a,this.btnReroll.activated=t.gold>=e.rerollCost,this.btnNext.x=615-this.btnNext.width,this.btnNext.y=a} - } - ; - Qt(JMi,"ShopView"); - let QMi=JMi; - const ZMi=class t extends pB{ - constructor(){ - super(),Zt(this,"lblHeader"),Zt(this,"cardChoices",[]),Zt(this,"petChoices",[]),Zt(this,"textChoices",[]),Zt(this,"btnConfirm"),Zt(this,"btnSkip"),Zt(this,"selected",-1),Zt(this,"onPick",null),this.bg.visible=!1,this.btnClose.visible=!1,this.width=640,this.lblHeader=new iG(NB.getText("","하나를 선택하세요"),hD.DEFAULT_COLOR,hD.DEFAULT_OUTLINE_FONT_OPTION_24),this.contentContainer.addChild(this.lblHeader); - for(let t=0; - t<3; - t++){ - const i=new CMi; - i.handIndex=t,i.onTap=t=>this.select(t.handIndex),i.visible=!1,this.cardChoices.push(i),this.contentContainer.addChild(i); - const s=new jMi(!1); - s.slotIndex=t,s.onTap=t=>this.select(t.slotIndex),s.visible=!1,this.petChoices.push(s),this.contentContainer.addChild(s); - const e=new nB(""); - e.width=560; - const n=t; - e.onClick=()=>this.select(n),e.visible=!1,this.contentContainer.addChild(e); - const h=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_15); - h.visible=!1,this.contentContainer.addChild(h),this.textChoices.push({ - bg:e,desc:h} - )} - this.btnConfirm=new nB(NB.getText("","선택")),this.btnConfirm.onClick=this.onConfirmClick.bind(this),this.contentContainer.addChild(this.btnConfirm),this.btnSkip=new nB(NB.getText("","스킵")),this.btnSkip.onClick=this.onSkipClick.bind(this),this.contentContainer.addChild(this.btnSkip)} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - setData(t){ - var i; - this.selected=-1; - const s=640; - let e=0; - this.lblHeader.text=NB.getText("",{ - soldier:"덱에 넣을 병사를 선택하세요",relic:"유물을 선택하세요",consumable:"천사/악마 카드를 선택하세요",pet:"함께할 펫을 선택하세요"} - [t.packKind]),this.lblHeader.x=.5*(s-this.lblHeader.width),this.lblHeader.y=e,e+=56; - for(const n of this.cardChoices)n.visible=!1; - for(const n of this.petChoices)n.visible=!1; - for(const n of this.textChoices)n.bg.visible=!1,n.desc.visible=!1; - if("soldier"===t.packKind&&t.cardChoices){ - const i=CMi.CARD_WIDTH,n=24,h=.5*(s-i*t.cardChoices.length-n*(t.cardChoices.length-1)); - for(let s=0; - s<t.cardChoices.length; - s++){ - const r=this.cardChoices[s]; - r.visible=!0,r.setCard(t.cardChoices[s]),r.selected=!1,r.setBaseY(e),r.x=h+s*(i+n)} - e+=CMi.CARD_HEIGHT+24} - else if("pet"===t.packKind&&t.refChoices){ - const i=jMi.FULL_WIDTH,n=20,h=.5*(s-i*t.refChoices.length-n*(t.refChoices.length-1)); - for(let s=0; - s<t.refChoices.length; - s++){ - const r=yMi.find(i=>i.id===t.refChoices[s]),o=this.petChoices[s]; - r&&(o.visible=!0,o.setJoker(r),o.selected=!1,o.x=h+s*(i+n),o.y=e)} - e+=jMi.FULL_HEIGHT+24} - else if(t.refChoices){ - for(let n=0; - n<t.refChoices.length; - n++){ - const h=t.refChoices[n],r=this.textChoices[n],o="relic"===t.packKind?(null==(i=n5t[h])?void 0:i.name)??"유물":vMi(h).name,a={ - kind:"relic"===t.packKind?"relic":"consumable",refId:h} - ; - r.bg.text=o,r.bg.visible=!0,r.bg.x=.5*(s-r.bg.width),r.bg.y=e,e+=r.bg.height+4,r.desc.text=RMi(a),r.desc.visible=!0,r.desc.x=.5*(s-r.desc.width),r.desc.y=e,e+=34} - e+=12} - this.btnConfirm.width=200,this.btnSkip.width=200,this.btnConfirm.x=110,this.btnSkip.x=330,this.btnConfirm.y=e,this.btnSkip.y=e,e+=this.btnConfirm.height+30,this.height=e} - select(t){ - this.selected=t; - for(const i of this.cardChoices)i.selected=i.handIndex===t&&i.visible; - for(const i of this.petChoices)i.selected=i.slotIndex===t&&i.visible} - onConfirmClick(){ - if(this.selected<0)return void bH.getInstance().showMessage(NB.getText("","하나를 선택하세요")); - const t=this.onPick,i=this.selected; - this.hide(),t&&t(i)} - onSkipClick(){ - const t=this.onPick; - this.hide(),t&&t(-1)} - onBackButton(){ - return!0} - } - ; - Qt(ZMi,"PackPickPopup"),Zt(ZMi,"_instance"); - let tbi=ZMi; - const ibi=class t extends pB{ - constructor(){ - super(),Zt(this,"lblBody"),Zt(this,"btnOk"),this.width=560,this.lblBody=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_16),this.lblBody.x=30,this.lblBody.y=20,this.contentContainer.addChild(this.lblBody),this.btnOk=new nB(NB.getText("","확인")),this.btnOk.width=200,this.btnOk.onClick=()=>this.hide(),this.contentContainer.addChild(this.btnOk)} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - setData(t){ - const i=[]; - i.push(`— ${ - NB.getText("","족보 레벨")} - —`); - for(let e=0; - e<9; - e++){ - const s=t.handLevels[e]??1,n=h5t(e,s); - i.push(`${ - OMi[e]} - Lv.${ - s} - (${ - n.power} - × ${ - n.buff} - )`)} - if(i.push(""),i.push(`— ${ - NB.getText("","특수카드")} - —`),0===t.vouchers.length)i.push(NB.getText("","(없음)")); - else for(const e of t.vouchers)i.push(`${ - NMi(e)} - — ${ - PMi(e)} - `); - if(i.push(""),i.push(`— ${ - NB.getText("","보유 태그")} - —`),0===t.tags.length)i.push(NB.getText("","(없음)")); - else for(const e of t.tags)i.push(`${ - LMi(e)} - — ${ - DMi(e)} - `); - this.lblBody.text=i.join("\n"); - const s=this.lblBody.y+this.lblBody.height+24; - this.btnOk.x=.5*(this.width-this.btnOk.width),this.btnOk.y=s,this.height=s+this.btnOk.height+26} - } - ; - Qt(ibi,"RunInfoPopup"),Zt(ibi,"_instance"); - let sbi=ibi; - const ebi=class t extends pB{ - constructor(){ - super(),Zt(this,"onPick",null),this.width=480; - const t=new iG(NB.getText("","변환할 문양을 선택하세요"),hD.DEFAULT_COLOR,hD.DEFAULT_OUTLINE_FONT_OPTION_18); - t.x=.5*(this.width-t.width),t.y=16,this.contentContainer.addChild(t); - const i=["▲","●","◆","★"]; - for(let s=0; - s<4; - s++){ - const t=new nB(i[s]); - t.width=96,t.x=24+108*s,t.y=64; - const e=s; - t.onClick=()=>{ - const t=this.onPick; - this.hide(),t&&t(e)} - ,this.contentContainer.addChild(t),this.height=t.y+t.height+30} - } - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - } - ; - Qt(ebi,"SuitPickPopup"),Zt(ebi,"_instance"); - let nbi=ebi; - const hbi=class t extends Ke{ - constructor(){ - super(),Zt(this,"bg"),Zt(this,"lbl"),Zt(this,"cellIndex",0),Zt(this,"onTap",null),this.bg=new ep,this.addChild(this.bg),this.lbl=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_15),this.addChild(this.lbl),this.eventMode="static",this.cursor="pointer",this.on("pointertap",()=>{ - this.onTap&&this.onTap(this.cellIndex)} - )} - setData(i,s){ - if(this.bg.clear(),null===i)return this.bg.roundRect(0,0,t.W,t.H,8).fill({ - color:1182984} - ).stroke({ - color:3813154,width:2} - ),void(this.lbl.text=""); - this.bg.roundRect(0,0,t.W,t.H,8).fill({ - color:s?2761528:3287576} - ).stroke({ - color:s?7036830:10390090,width:2} - ),this.lbl.text=i.replace("·","\n").replace(" ","\n"),this.lbl.x=.5*(t.W-this.lbl.width),this.lbl.y=.5*(t.H-this.lbl.height)} - } - ; - Qt(hbi,"ConsumableCell"),Zt(hbi,"W",74),Zt(hbi,"H",92); - let rbi=hbi; - const obi=class t extends YXt{ - constructor(){ - super(),Zt(this,"gameLayer"),Zt(this,"lblChapter"),Zt(this,"lblGold"),Zt(this,"btnSkip"),Zt(this,"bossBanner"),Zt(this,"lblBoss"),Zt(this,"lblCounts"),Zt(this,"lblTarget"),Zt(this,"gaugeBg"),Zt(this,"gaugeFill"),Zt(this,"lblGauge"),Zt(this,"jokerSlots",[]),Zt(this,"consumableCells",[]),Zt(this,"btnInfo"),Zt(this,"deckBack"),Zt(this,"lblDeck"),Zt(this,"panelBg"),Zt(this,"lblHandName"),Zt(this,"powerBox"),Zt(this,"buffBox"),Zt(this,"lblCalcX"),Zt(this,"powerCount"),Zt(this,"buffCount"),Zt(this,"playZoneBg"),Zt(this,"playedCards",[]),Zt(this,"totalCount"),Zt(this,"handFan"),Zt(this,"btnSubmit"),Zt(this,"btnSort"),Zt(this,"btnDiscard"),Zt(this,"shopView"),Zt(this,"requestPending",!1),Zt(this,"gaugeY",0),Zt(this,"gaugeOverrideScore",null),Zt(this,"playedScale",t.PLAYED_SCALE),Zt(this,"petScale",1),Zt(this,"floatLabels",[]),Zt(this,"floatIdx",0),Zt(this,"fxToken",0); - const i=t.getMinHeight(); - this.bg.height<i&&(this.y=Math.max(0,SS.safeHeight-i),this.bg.height=SS.safeHeight-this.y),this.gameLayer=new Ke,this.addChild(this.gameLayer),this.lblChapter=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_OUTLINE_FONT_OPTION_24),this.lblChapter.x=25,this.lblChapter.y=t.TOP_Y,this.gameLayer.addChild(this.lblChapter),this.lblGold=new iG("",16767332,hD.DEFAULT_OUTLINE_FONT_OPTION_24),this.lblGold.textColor=16767332,this.lblGold.y=t.TOP_Y,this.gameLayer.addChild(this.lblGold),this.btnSkip=new nB(NB.getText("","스킵")),this.btnSkip.width=110,this.btnSkip.onClick=this.onSkipClick.bind(this),this.gameLayer.addChild(this.btnSkip),this.bossBanner=new ep,this.bossBanner.visible=!1,this.gameLayer.addChild(this.bossBanner),this.lblBoss=new iG("",16757918,hD.DEFAULT_OUTLINE_FONT_OPTION_18),this.lblBoss.textColor=16757918,this.lblBoss.visible=!1,this.gameLayer.addChild(this.lblBoss),this.lblCounts=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_15),this.lblCounts.x=25,this.gameLayer.addChild(this.lblCounts),this.lblTarget=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_15),this.gameLayer.addChild(this.lblTarget),this.gaugeBg=new ep,this.gameLayer.addChild(this.gaugeBg),this.gaugeFill=new ep,this.gameLayer.addChild(this.gaugeFill),this.lblGauge=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_15),this.gameLayer.addChild(this.lblGauge); - for(let t=0; - t<6; - t++){ - const i=new jMi(!0); - i.slotIndex=t,i.pivot.set(.5*jMi.COMPACT_WIDTH,.5*jMi.COMPACT_HEIGHT),this.jokerSlots.push(i),this.gameLayer.addChild(i)} - for(let t=0; - t<3; - t++){ - const i=new rbi; - i.cellIndex=t,i.onTap=this.onConsumableTap.bind(this),this.consumableCells.push(i),this.gameLayer.addChild(i)} - this.btnInfo=new nB(NB.getText("","ⓘ")),this.btnInfo.width=64,this.btnInfo.onClick=this.onInfoClick.bind(this),this.gameLayer.addChild(this.btnInfo),this.deckBack=new ep,this.deckBack.roundRect(0,0,58,78,6).fill({ - color:2901096} - ).stroke({ - color:8032952,width:2} - ),this.gameLayer.addChild(this.deckBack),this.lblDeck=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_15),this.gameLayer.addChild(this.lblDeck),this.panelBg=new ep,this.gameLayer.addChild(this.panelBg),this.lblHandName=new iG("",16771488,hD.DEFAULT_OUTLINE_FONT_OPTION_24),this.lblHandName.textColor=16771488,this.gameLayer.addChild(this.lblHandName),this.powerBox=new ep,this.gameLayer.addChild(this.powerBox),this.buffBox=new ep,this.gameLayer.addChild(this.buffBox),this.lblCalcX=new iG("×",hD.DEFAULT_COLOR,hD.DEFAULT_OUTLINE_FONT_OPTION_24),this.gameLayer.addChild(this.lblCalcX),this.powerCount=new zMi(16777215),this.gameLayer.addChild(this.powerCount),this.buffCount=new zMi(16777215),this.gameLayer.addChild(this.buffCount),this.playZoneBg=new ep,this.gameLayer.addChild(this.playZoneBg); - for(let s=0; - s<5; - s++){ - const i=new CMi; - i.setDisplayScale(t.PLAYED_SCALE),i.pivot.set(.5*CMi.CARD_WIDTH,.5*CMi.CARD_HEIGHT),i.eventMode="none",i.visible=!1,this.playedCards.push(i),this.gameLayer.addChild(i)} - this.totalCount=new zMi(16767332),this.totalCount.visible=!1,this.gameLayer.addChild(this.totalCount); - for(let t=0; - t<4; - t++){ - const t=new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_24); - t.visible=!1,this.floatLabels.push(t),this.gameLayer.addChild(t)} - this.gameLayer.addChild(this.deckBack),this.gameLayer.addChild(this.lblDeck),this.handFan=new UMi,this.handFan.onSelectionChange=this.onSelectionChange.bind(this),this.gameLayer.addChild(this.handFan),this.btnSubmit=new nB(NB.getText("","전투")),this.btnSubmit.width=230,this.btnSubmit.onClick=this.onSubmitClick.bind(this),this.gameLayer.addChild(this.btnSubmit),this.btnSort=new nB(NB.getText("","정렬:랭크")),this.btnSort.width=130,this.btnSort.onClick=this.onSortClick.bind(this),this.gameLayer.addChild(this.btnSort),this.btnDiscard=new nB(NB.getText("","해고")),this.btnDiscard.width=230,this.btnDiscard.onClick=this.onDiscardClick.bind(this),this.gameLayer.addChild(this.btnDiscard),this.shopView=new QMi,this.shopView.visible=!1,this.shopView.onBuy=this.onShopBuy.bind(this),this.shopView.onPetTap=this.onShopPetSell.bind(this),this.shopView.onReroll=this.onShopReroll.bind(this),this.shopView.onNext=this.onShopNext.bind(this),this.addChild(this.shopView),this.btnClose.x=640-this.btnClose.width-8,this.btnClose.y=4,this.addChild(this.btnClose)} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - static getMinHeight(){ - return SS.safeHeight} - updateLayout(){ - const i=l5t.getInstance().run; - if(!i)return; - const s=2===i.stage; - this.lblGold.x=615-this.lblGold.width,this.btnSkip.x=this.lblGold.x-this.btnSkip.width-14,this.btnSkip.y=t.TOP_Y-6,this.btnInfo.x=(this.btnSkip.visible?this.btnSkip.x:this.lblGold.x)-this.btnInfo.width-12,this.btnInfo.y=t.TOP_Y-6; - let e=t.TOP_Y+44; - this.bossBanner.visible=s&&null!==i.bossGimmickId,this.lblBoss.visible=this.bossBanner.visible,this.bossBanner.visible&&(this.bossBanner.clear(),this.bossBanner.roundRect(25,e,590,40,8).fill({ - color:4003602} - ).stroke({ - color:9061428,width:2} - ),this.lblBoss.x=40,this.lblBoss.y=e+8,e+=48),this.lblCounts.y=e,this.lblTarget.x=615-this.lblTarget.width,this.lblTarget.y=e,e+=26,this.gaugeBg.clear(),this.gaugeBg.roundRect(25,e,590,30,15).fill({ - color:1511434} - ).stroke({ - color:s?9061428:6836030,width:2} - ),this.gaugeY=e,this.redrawGauge(i),this.lblGauge.y=e+6,this.lblGauge.x=.5*(640-this.lblGauge.width),e+=40; - const n=e; - this.panelBg.clear(),this.panelBg.roundRect(25,n,590,56,10).fill({ - color:2037520} - ).stroke({ - color:4864808,width:2} - ),this.lblHandName.x=40,this.lblHandName.y=n+12; - this.powerBox.clear(),this.powerBox.roundRect(350,n+8,110,40,8).fill({ - color:3042982} - ),this.buffBox.clear(),this.buffBox.roundRect(490,n+8,110,40,8).fill({ - color:12731695} - ),this.lblCalcX.x=468,this.lblCalcX.y=n+12,this.powerCount.x=405,this.powerCount.y=n+8+20,this.buffCount.x=545,this.buffCount.y=n+8+20,e+=64; - const h=s5t(i.lordId,i.vouchers,s?i.bossGimmickId:null),r=Math.min(this.jokerSlots.length,h.petSlots),o=Math.min(this.consumableCells.length,h.consumableSlots),a=o*rbi.W+6*(o-1),c=590-a-14; - this.petScale=Math.min(1,c/(r*jMi.COMPACT_WIDTH+6*(r-1))); - const l=jMi.COMPACT_WIDTH*this.petScale,u=jMi.COMPACT_HEIGHT*this.petScale,d=Math.max(u,rbi.H); - for(let t=0; - t<this.jokerSlots.length; - t++){ - const i=this.jokerSlots[t]; - i.visible=t<r,i.scale.set(this.petScale),i.x=25+t*(l+6)+.5*l,i.y=e+.5*d} - const f=615-a; - for(let t=0; - t<this.consumableCells.length; - t++){ - const i=this.consumableCells[t]; - i.visible=t<o,i.x=f+t*(rbi.W+6),i.y=e+.5*(d-rbi.H)} - e+=d+8; - const p=this.bg.height-this.btnDiscard.height-25; - this.btnSubmit.x=25,this.btnSubmit.y=p,this.btnSort.x=.5*(640-this.btnSort.width),this.btnSort.y=p,this.btnDiscard.x=615-this.btnDiscard.width,this.btnDiscard.y=p; - const w=p-this.handFan.areaHeight-8; - this.handFan.x=0,this.handFan.y=w; - const g=w-8,m=Math.max(110,g-e); - this.playZoneBg.clear(),this.playZoneBg.roundRect(15,e,610,m,12).fill({ - color:2568991} - ).stroke({ - color:4610106,width:2} - ),this.deckBack.x=555,this.deckBack.y=e+m-78-32,this.lblDeck.x=this.deckBack.x+.5*(58-this.lblDeck.width),this.lblDeck.y=this.deckBack.y+80,this.layoutPlayedFx(e,m)} - redrawGauge(t){ - const i=this.gaugeOverrideScore??t.stageScore,s=Math.min(1,i/Math.max(1,t.targetScore)); - this.gaugeFill.clear(),s>0&&this.gaugeFill.roundRect(27,this.gaugeY+2,586*s,26,13).fill({ - color:2===t.stage?11029038:6134857} - ),this.lblGauge.text=`${ - qD.displayLargeNumberAsAlphabet(Math.floor(i))} - / ${ - qD.displayLargeNumberAsAlphabet(t.targetScore)} - `,this.lblGauge.x=.5*(640-this.lblGauge.width)} - animateGauge(t,i,s){ - const e=performance.now(),n=Qt(()=>{ - const h=l5t.getInstance().run; - if(!h)return; - const r=Math.min(1,(performance.now()-e)/s),o=1-(1-r)*(1-r)*(1-r); - this.gaugeOverrideScore=t+(i-t)*o,this.redrawGauge(h),r<1&&null!==this.gaugeOverrideScore&&requestAnimationFrame(n)} - ,"tick"); - requestAnimationFrame(n)} - spawnFloat(t,i,s,e){ - const n=this.floatLabels[this.floatIdx]; - if(!n)return; - this.floatIdx=(this.floatIdx+1)%this.floatLabels.length,n.text=s,n.textColor=e,n.visible=!0,n.alpha=1; - const h=i; - n.x=t-.5*n.width; - const r=performance.now(),o=Qt(()=>{ - const t=Math.min(1,(performance.now()-r)/700); - n.y=h-40*t,n.alpha=1-t*t,t<1&&n.visible?requestAnimationFrame(o):n.visible=!1} - ,"tick"); - n.y=h,requestAnimationFrame(o)} - layoutPlayedFx(i,s){ - const e=this.playedCards.filter(t=>t.visible),n=Math.max(1,e.length),h=s-72,r=580-8*(n-1); - this.playedScale=Math.min(t.PLAYED_SCALE,h/CMi.CARD_HEIGHT,r/(n*CMi.CARD_WIDTH)); - const o=CMi.CARD_WIDTH*this.playedScale,a=CMi.CARD_HEIGHT*this.playedScale,c=i+Math.max(8,.5*(s-a-52)); - let l=.5*(640-(n*o+8*(n-1))); - for(const t of e)t.setDisplayScale(this.playedScale),t.x=l+.5*o,t.setBaseY(c+.5*a),l+=o+8; - this.totalCount.x=320,this.totalCount.y=c+a+40} - show(){ - super.show2(),TF.getInstance().visible=!1,ei(()=>Promise.resolve().then(()=>wfi),void 0).then(t=>{ - LH.castleDestroyedProvider=()=>t.BattleController.getInstance().isCastleDestroyed()} - ),LH.getInstance().setMode(PH.CARD_EVENT),this.requestPending=!1,this.clearPlayFx(),this.refreshFromRun()} - restoreWorld(){ - TF.getInstance().visible=!0,LH.castleDestroyedProvider=null,LH.getInstance().setMode(PH.NORMAL)} - hide(){ - this.restoreWorld(),super.hide()} - refreshFromRun(){ - var i; - const s=l5t.getInstance().run; - if(!s)return void this.hide(); - const e="SHOP"===s.status||"PACK_PICK"===s.status; - if(this.gameLayer.visible=!e,this.shopView.visible=e,e)return this.shopView.setData(s,t.TOP_Y,this.bg.height-25),void("PACK_PICK"===s.status&&(null==(i=s.shop)?void 0:i.packPick)&&this.openPackPick()); - const n=2===s.stage,h=s5t(s.lordId,s.vouchers,n?s.bossGimmickId:null); - if(this.lblChapter.text=`${ - s.chapter} - /8${ - NB.getText("","챕터")} - · ${ - IMi[s.stage]} - `+(s.endless?` (${ - NB.getText("","무한전투")} - )`:""),this.lblGold.text=`${ - s.gold} - G`,this.btnSkip.visible="PLAYING"===s.status&&s.stage<2&&0===s.stageScore&&s.submitsLeft===h.submits&&s.discardsLeft===h.discards,n&&null!==s.bossGimmickId){ - const t=o5t(s.bossGimmickId); - this.lblBoss.text=`${ - t.name} - — ${ - kMi(s.bossGimmickId,s.bossGimmickSuit)} - `} - this.lblCounts.text=`${ - NB.getText("","전투")} - ${ - s.submitsLeft} - /${ - h.submits} - · ${ - NB.getText("","해고")} - ${ - s.discardsLeft} - /${ - h.discards} - · ${ - NB.getText("","누적")} - ${ - qD.displayLargeNumberAsAlphabet(s.totalScore)} - `,this.lblTarget.text=`${ - NB.getText("","목표")} - ${ - qD.displayLargeNumberAsAlphabet(s.targetScore)} - `; - for(let t=0; - t<this.jokerSlots.length; - t++)t<s.jokers.length?this.jokerSlots[t].setJoker(s.jokers[t]):this.jokerSlots[t].setEmpty(); - for(let t=0; - t<this.consumableCells.length; - t++){ - const i=t<s.consumables.length?s.consumables[t]:null; - this.consumableCells[t].setData(i?xMi(i):null,"relic"===(null==i?void 0:i.kind))} - this.lblDeck.text=`${ - s.deckCount} - /${ - s.deckCount+s.graveyardCount+s.hand.length} - `; - const r=new Set; - if(n&&null!==s.bossGimmickId){ - const t=o5t(s.bossGimmickId).effect; - for(const i of s.hand)"suitZero"===t&&i.suit===s.bossGimmickSuit&&r.add(i.id),"heroVoid"===t&&i.rank>=11&&i.rank<=13&&r.add(i.id)} - this.handFan.locked=!1,this.handFan.setHand(s.hand,r),this.btnSubmit.text=`${ - NB.getText("","전투")} - ${ - s.submitsLeft} - /${ - h.submits} - `,this.btnDiscard.text=`${ - NB.getText("","해고")} - ${ - s.discardsLeft} - /${ - h.discards} - `,this.updateButtonStates(),this.updateLayout(),this.redrawGauge(s),this.lblGauge.x=.5*(640-this.lblGauge.width),"CONQUEST_CHOICE"===s.status&&this.openConquest(s)} - updateButtonStates(){ - const t=l5t.getInstance().run,i=this.handFan.getSelected(),s=!!t&&"PLAYING"===t.status&&!this.requestPending; - this.btnSubmit.activated=s&&i.length>0,this.btnDiscard.activated=s&&i.length>0&&((null==t?void 0:t.discardsLeft)??0)>0} - onSelectionChange(t){ - const i=l5t.getInstance(); - if(0===t.length)this.lblHandName.text="",this.powerCount.setStatic("0"),this.buffCount.setStatic("0"); - else{ - const s=i.previewScore(t); - if(s){ - this.lblHandName.text=`${ - OMi[s.hand]} - `+(s.handLevel>1?` Lv.${ - s.handLevel} - `:""); - const t=s.buffAdd*s.buffMultTotal; - this.powerCount.setBounce(qD.displayLargeNumberAsAlphabet(s.power)),this.buffCount.setBounce(""+Math.round(10*t)/10)} - else this.lblHandName.text="?",this.powerCount.setStatic("-"),this.buffCount.setStatic("-")} - this.updateButtonStates()} - async doAction(t,i){ - if(this.requestPending)return!1; - this.requestPending=!0,this.handFan.locked=!0; - try{ - return await t(),!0} - catch(frt){ - return bH.getInstance().showMessage(frt.message||NB.getText("",i)),!1} - finally{ - this.requestPending=!1,this.handFan.locked=!1} - } - async onSubmitClick(){ - const t=this.handFan.getSelected(); - if(0===t.length||this.requestPending)return; - const i=l5t.getInstance(),s=i.run; - if(!s||"PLAYING"!==s.status)return; - const e=t.map(t=>s.hand[t]),n=s.stageScore; - let h=[]; - try{ - const t=i.buildScoreCtx(); - t&&(h=YMi(e,s.jokers,t))} - catch{ - h=[]} - this.requestPending=!0,this.handFan.locked=!0,this.updateButtonStates(); - let r=null,o=""; - try{ - r=await i.submit(t)} - catch(frt){ - o=frt.message} - if(this.requestPending=!1,!r)return bH.getInstance().showMessage(o||NB.getText("","전투 실패 — 다시 시도해주세요")),this.handFan.locked=!1,void this.updateButtonStates(); - this.playSubmitFx(e,r,h,n)} - popCard(t,i){ - const s=t.y,e=Qt(t=>{ - const i=7.5625,s=2.75; - return t<1/s?i*t*t:t<2/s?i*(t-=1.5/s)*t+.75:t<2.5/s?i*(t-=2.25/s)*t+.9375:i*(t-=2.625/s)*t+.984375} - ,"easeOutBounce"),n=performance.now(),h=Qt(()=>{ - const i=Math.min(1,(performance.now()-n)/520); - if(i<.25){ - const e=i/.25; - t.y=s-30*(1-(1-e)*(1-e))} - else{ - const n=(i-.25)/.75; - t.y=s-30*(1-e(n))} - i<1?requestAnimationFrame(h):t.y=s} - ,"tick"); - requestAnimationFrame(h)} - async flyCardsToDeck(){ - const t=this.playedCards.filter(t=>t.visible); - if(0===t.length)return; - const i=this.deckBack.x+29,s=this.deckBack.y+39,e=260; - t.forEach((t,n)=>{ - const h=t.x,r=t.y,o=this.playedScale,a=performance.now()+90*n; - let c=!1; - const l=Qt(()=>{ - if(!t.visible)return; - const n=performance.now()-a; - if(n<0)requestAnimationFrame(l); - else{ - if(n<e){ - const i=n/e; - t.scale.x=o*Math.max(.02,Math.abs(1-2*i)),i>=.5&&!c&&(c=!0,t.setCard({ - id:-1,rank:0,suit:-1} - ))} - else{ - if(!(n<640))return t.visible=!1,void t.scale.set(o); - { - const a=(n-e)/380,c=a*(2-a),l=o*(1-.55*c); - t.scale.set(l),t.x=h+(i-h)*c,t.y=r+(s-r)*c} - } - requestAnimationFrame(l)} - } - ,"tick"); - requestAnimationFrame(l)} - ),await this.delay(90*t.length+e+380+80)} - flashPet(t,i){ - const s=performance.now(),e=Qt(()=>{ - const n=Math.min(1,(performance.now()-s)/240); - t.scale.set(i*(1+.2*Math.sin(n*Math.PI))),n<1?requestAnimationFrame(e):t.scale.set(i)} - ,"tick"); - requestAnimationFrame(e)} - delay(t){ - return new Promise(i=>setTimeout(i,t))} - async playSubmitFx(t,i,s,e){ - const n=++this.fxToken; - this.gaugeOverrideScore=e; - for(let c=0; - c<this.playedCards.length; - c++){ - const i=this.playedCards[c]; - c<t.length?(i.visible=!0,i.setCard(t[c])):i.visible=!1} - this.lblHandName.text=`${ - OMi[i.score.hand]} - `+(i.score.handLevel>1?` Lv.${ - i.score.handLevel} - `:""),this.updateLayout(); - let h=0,r=0; - const o=CMi.CARD_HEIGHT*this.playedScale; - for(const c of s){ - if(this.fxToken!==n)return; - const t=c.power-h,i=Math.round(10*(c.buff-r))/10; - if("card"===c.kind&&c.cardIndex>=0){ - const s=this.playedCards[c.cardIndex]; - (null==s?void 0:s.visible)&&(this.popCard(s,this.playedScale),t>0?this.spawnFloat(s.x,s.y-.5*o-14,`+${ - qD.displayLargeNumberAsAlphabet(t)} - `,10407935):i>0&&this.spawnFloat(s.x,s.y-.5*o-14,`+${ - i} - `,16747883))} - else if("pet"===c.kind&&c.petIndex>=0){ - const s=this.jokerSlots[c.petIndex]; - if(null==s?void 0:s.visible){ - this.flashPet(s,1); - const e=t>0?`+${ - qD.displayLargeNumberAsAlphabet(t)} - `:i>0?`+${ - i} - `:"×"; - this.spawnFloat(s.x,s.y-.5*jMi.COMPACT_HEIGHT-12,e,t>0?10407935:16747883)} - } - if(c.power!==h&&this.powerCount.countFromTo(h,c.power,320),c.buff!==r&&this.buffCount.countFromTo(r,c.buff,320,1),h=c.power,r=c.buff,"base"===c.kind)await this.delay(300); - else{ - if(await this.delay(350),this.fxToken!==n)return; - await this.delay(500)} - } - if(this.fxToken!==n)return; - const a=Math.round(i.score.buffAdd*i.score.buffMultTotal*10)/10; - i.score.power!==h?this.powerCount.countFromTo(h,i.score.power,260):this.powerCount.setBounce(qD.displayLargeNumberAsAlphabet(i.score.power)),a!==r&&this.buffCount.countFromTo(r,a,260,1),await this.delay(380),this.fxToken===n&&(this.totalCount.visible=!0,this.totalCount.setAffix("= ",""),this.animateGauge(e,e+i.score.total,900),this.totalCount.countUp(i.score.total,500,0,()=>{ - this.fxToken===n&&(async()=>{ - await this.delay(300),this.fxToken===n&&(await this.flyCardsToDeck(),this.fxToken===n&&(this.totalCount.visible=!1,this.afterSubmitFx(i)))} - )()} - ))} - afterSubmitFx(t){ - if(this.gaugeOverrideScore=null,t.destroyedCardIds.length>0&&bH.getInstance().showMessage(`${ - NB.getText("","유리 카드 파괴")} - ×${ - t.destroyedCardIds.length} - `),this.refreshFromRun(),t.dead&&t.result){ - this.clearPlayFx(); - const i=MMi.getInstance(); - return i.setData(t.result),i.onExit=()=>this.hide(),void i.show()} - t.cleared&&(this.clearPlayFx(),t.goldGained>0&&bH.getInstance().showMessage(`${ - NB.getText("","클리어!")} - +${ - t.goldGained} - G`+(t.bonus>0?` · ${ - NB.getText("","보너스")} - +${ - qD.displayLargeNumberAsAlphabet(t.bonus)} - `:"")))} - async onDiscardClick(){ - const t=this.handFan.getSelected(); - if(0===t.length)return; - const i=l5t.getInstance().run; - !i||"PLAYING"!==i.status||i.discardsLeft<=0||(await this.doAction(()=>l5t.getInstance().discard(t),"해고 실패 — 다시 시도해주세요")?this.refreshFromRun():this.updateButtonStates())} - onSortClick(){ - this.handFan.sortMode="rank"===this.handFan.sortMode?"suit":"rank",this.btnSort.text=NB.getText("","rank"===this.handFan.sortMode?"정렬:랭크":"정렬:문양"),l5t.getInstance().run&&this.refreshFromRun()} - async onSkipClick(){ - await this.doAction(async()=>{ - const t=await l5t.getInstance().skipStage(); - bH.getInstance().showMessage(`${ - NB.getText("","스킵")} - — ${ - LMi(t.tagId)} - ${ - NB.getText("","획득")} - `)} - ,"스킵 실패")&&this.refreshFromRun()} - onInfoClick(){ - const t=l5t.getInstance().run; - if(!t)return; - const i=sbi.getInstance(); - i.setData(t),i.show()} - async onConsumableTap(t){ - const i=l5t.getInstance(),s=i.run; - if(!s||t>=s.consumables.length||this.requestPending)return; - const e=s.consumables[t]; - let n=0,h=!1; - if("consumable"===e.kind){ - const t=vMi(e.refId); - n={ - enhance:1,sealRandom:1,clone:1,convertSuit:2,rankUp:2,destroy:2,goldGamble:0,recruitHero:0} - [t.effect]??0,h="convertSuit"===t.effect} - const r=this.handFan.getSelected(); - if(n>0&&r.length!==n)return void bH.getInstance().showMessage(`${ - NB.getText("","손패에서 카드")} - ${ - n} - ${ - NB.getText("","장을 선택 후 사용하세요")} - `); - const o=r.slice(0,n).map(t=>s.hand[t].id),a=Qt(async s=>{ - await this.doAction(()=>i.useConsumable(t,o,s),"사용 실패")&&this.refreshFromRun()} - ,"use"); - if(h){ - const t=nbi.getInstance(); - t.onPick=t=>{ - a(t)} - ,t.show()} - else await a()} - async onShopBuy(t){ - await this.doAction(()=>l5t.getInstance().shopBuy(t),"구매 실패")&&this.refreshFromRun()} - async onShopPetSell(t){ - await this.doAction(()=>l5t.getInstance().shopSell("pet",t),"판매 실패")&&this.refreshFromRun()} - async onShopReroll(){ - await this.doAction(()=>l5t.getInstance().shopReroll(),"리롤 실패")&&this.refreshFromRun()} - async onShopNext(){ - await this.doAction(()=>l5t.getInstance().leaveShop(),"진행 실패")&&(this.clearPlayFx(),this.refreshFromRun())} - openPackPick(){ - var t; - const i=l5t.getInstance().run; - if(!i||!(null==(t=i.shop)?void 0:t.packPick))return; - const s=tbi.getInstance(); - s.setData(i.shop.packPick),s.onPick=async t=>{ - await this.doAction(()=>l5t.getInstance().pickFromPack(t),"선택 실패")?this.refreshFromRun():this.openPackPick()} - ,s.show()} - openConquest(t){ - const i=bMi.getInstance(); - i.setData(t.totalScore),i.onChoice=async i=>{ - const s=l5t.getInstance(); - let e=null; - if(await this.doAction(async()=>{ - e=await s.conquestChoice(i)} - ,"요청 실패"))if(i)this.refreshFromRun(); - else{ - const t=MMi.getInstance(); - t.setData(e.result),t.onExit=()=>this.hide(),t.show()} - else this.openConquest(t)} - ,i.show()} - clearPlayFx(){ - this.fxToken++; - for(const t of this.floatLabels)t.visible=!1; - for(const t of this.playedCards)t.visible=!1; - this.totalCount.stop(),this.totalCount.visible=!1,this.powerCount.setStatic("0"),this.buffCount.setStatic("0"),this.lblHandName.text=""} - onBackButton(){ - return this.hide(),!0} - } - ; - Qt(obi,"CardGamePopup"),Zt(obi,"_instance"),Zt(obi,"TOP_Y",100),Zt(obi,"PLAYED_SCALE",.8); - let abi=obi; - const cbi=class t extends YXt{ - constructor(){ - super(),Zt(this,"lblTitle"),Zt(this,"lblRecord"),Zt(this,"btnStart"),Zt(this,"btnResume"),Zt(this,"btnAd"),Zt(this,"btnRanking"),Zt(this,"lblNote"),Zt(this,"requestPending",!1); - const t=Math.max(900,Math.floor(.8*SS.safeHeight)); - this.bg.height<t&&(this.y=Math.max(0,SS.safeHeight-t),this.bg.height=SS.safeHeight-this.y),this.lblTitle=new iG(NB.getText("","영웅의 패"),16767332,hD.DEFAULT_OUTLINE_FONT_OPTION_32),this.lblTitle.textColor=16767332,this.addChild(this.lblTitle),this.lblRecord=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_16),this.addChild(this.lblRecord),this.btnResume=new nB(NB.getText("","이어하기")),this.btnResume.width=420,this.btnResume.onClick=this.onResumeClick.bind(this),this.addChild(this.btnResume),this.btnStart=new nB(NB.getText("","도전하기")),this.btnStart.width=420,this.btnStart.onClick=this.onStartClick.bind(this),this.addChild(this.btnStart),this.btnAd=new nB(NB.getText("","광고 보고 도전")),this.btnAd.width=420,this.btnAd.onClick=this.onAdClick.bind(this),this.addChild(this.btnAd),this.btnRanking=new nB(NB.getText("COMMON_20","랭킹")),this.btnRanking.width=420,this.btnRanking.onClick=this.onRankingClick.bind(this),this.addChild(this.btnRanking),this.lblNote=new iG(NB.getText("","입장 횟수는 매일 자정(UTC) 초기화됩니다"),hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_15),this.addChild(this.lblNote),this.updateLayout()} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - updateLayout(){ - const t=640; - this.lblTitle.x=.5*(t-this.lblTitle.width),this.lblTitle.y=90,this.lblRecord.x=.5*(t-this.lblRecord.width),this.lblRecord.y=170; - let i=260; - for(const s of[this.btnResume,this.btnStart,this.btnAd,this.btnRanking])s.x=.5*(t-s.width),s.y=i,s.visible&&(i+=s.height+18); - this.lblNote.x=.5*(t-this.lblNote.width),this.lblNote.y=i+10} - show(){ - super.show2(),this.refresh()} - async refresh(){ - const t=l5t.getInstance(); - try{ - await t.fetchState()} - catch(frt){ - bH.getInstance().showMessage(`${ - NB.getText("","이벤트 정보 조회 실패")} - : ${ - frt.message} - `)} - const i=!!t.run; - this.btnResume.visible=i,this.btnStart.visible=!i,this.btnAd.visible=!i,this.lblRecord.text=`${ - NB.getText("","내 최고 기록")} - : ${ - qD.displayLargeNumberAsAlphabet(t.myRecord.bestScore)} - (${ - NB.getText("","관문")} - ${ - t.myRecord.bestRound} - )`,this.btnStart.text=`${ - NB.getText("","도전하기")} - (${ - t.entries.freeLeft} - /3)`,this.btnStart.activated=t.entries.freeLeft>0,this.btnAd.text=`${ - NB.getText("","광고 보고 도전")} - (${ - t.entries.adLeft} - /2)`,this.btnAd.activated=t.entries.adLeft>0,this.updateLayout()} - async onStartClick(){ - if(this.requestPending)return; - const t=l5t.getInstance(); - if(t.entries.freeLeft<=0)return void bH.getInstance().showMessage(NB.getText("","오늘 무료 입장을 모두 사용했습니다")); - this.requestPending=!0; - let i=null,s=""; - try{ - i=await t.start(!1)} - catch(frt){ - s=frt.message} - if(this.requestPending=!1,!i)return bH.getInstance().showMessage(s||NB.getText("","입장 실패 — 다시 시도해주세요")),void this.refresh(); - abi.getInstance().show(),this.refresh()} - onResumeClick(){ - l5t.getInstance().run?abi.getInstance().show():this.refresh()} - async onAdClick(){ - this.requestPending||(l5t.getInstance().entries.adLeft<=0?bH.getInstance().showMessage(NB.getText("","오늘 광고 입장을 모두 사용했습니다")):(this.requestPending=!0,TG.canSkipAds?(v$.trackAd("ad_skip","cardEvent"),await this.startWithAd()):(v$.trackAd("ad_try","cardEvent"),await qG(async()=>{ - v$.trackAd("ad_success","cardEvent"),await this.startWithAd()} - ,void 0,()=>{ - v$.trackAd("ad_fail","cardEvent")} - )),this.requestPending=!1))} - async startWithAd(){ - const t=l5t.getInstance(); - let i=null,s=""; - try{ - i=await t.start(!0)} - catch(frt){ - s=frt.message} - if(!i)return bH.getInstance().showMessage(s||NB.getText("","입장 실패 — 다시 시도해주세요")),void this.refresh(); - abi.getInstance().show(),this.refresh()} - async onRankingClick(){ - const t=l5t.getInstance(); - let i=null,s=""; - try{ - i=await t.getRanking(30)} - catch(frt){ - s=frt.message} - if(!i)return void bH.getInstance().showMessage(s||NB.getText("","랭킹 조회 실패")); - const e=gMi.getInstance(); - e.setData(i.list??[],i.myRank??null),e.show()} - } - ; - Qt(cbi,"CardEventLobbyPopup"),Zt(cbi,"_instance"); - let lbi=cbi; - const ubi=Object.freeze(Object.defineProperty({ - __proto__:null,CardEventLobbyPopup:lbi} - ,Symbol.toStringTag,{ - value:"Module"} - )),dbi="relic_layer_all_legions",fbi={ - armyLevel:"relic_layer_buff_count_up"} - ,pbi={ - attackSpeedPct:"relic_layer_buff_attack_speed",moveSpeedPct:"relic_layer_buff_move_speed",attackRangePct:"army_layer_buff_attack_range",attackPct:"army_layer_buff_attack_power",hpPct:"army_layer_buff_health"} - ,wbi={ - soldierLevel:["relic_layer_soldiers","relic_layer_buff_level_up"],soldierCount:["relic_layer_soldiers","relic_layer_buff_count_up"],heroLevel:["relic_layer_hero","relic_layer_buff_level_up"],armyStartLevel:["relic_layer_all_legions","relic_layer_buff_level_up"],armyAttackSpeed:["relic_layer_all_legions","relic_layer_buff_attack_speed"],armyMoveSpeed:["relic_layer_all_legions","relic_layer_buff_move_speed"],soldierCap:["relic_layer_soldiers","relic_layer_buff_capacity"]} - ,gbi="relic_layer_background",mbi="relic_layer_legion_tag",vbi=[...new Set([dbi,...Object.values(fbi),...Object.values(pbi),gbi,...Object.values(wbi).flat(),mbi])]; - function _bi(t){ - return"armyBuff"===t.type&&t.buffStat?pbi[t.buffStat]:fbi[t.type]} - function Mbi(t){ - return[gbi,...wbi[t]??["ui_challenge_seal"],mbi]} - Qt(_bi,"cardEffectIcon"),Qt(Mbi,"relicIconLayers"); - const bbi="crystal_gem",ybi=["crystal_bg_normal","crystal_bg_rare","crystal_bg_epic","crystal_bg_legendary","crystal_bg_mythic"],Ebi=["crystal_stars_1","crystal_stars_2","crystal_stars_3","crystal_stars_4","crystal_stars_5"],Abi={ - stun:"crystal_effect_stun",poison:"crystal_effect_poison",paralysis:"crystal_effect_paralysis",freeze:"crystal_effect_chill",attackPct:"crystal_effect_attack",hpPct:"crystal_effect_health",attackSpeedPct:"crystal_effect_attack_speed",moveSpeedPct:"crystal_effect_move_speed",attackRangePct:"crystal_effect_range",soldierCap:"crystal_effect_capacity",promotion:"crystal_effect_promotion"} - ,Sbi=[bbi,"crystal_effect_plate",...ybi,...Ebi,...Object.values(Abi)],Tbi=class{ - static async loadCrystalArt(){ - return await this.ensure(),this.texture(bbi)} - static async loadChapterArt(){ - return await this.ensure(),this.texture("chapter_journey")} - static get ready(){ - return null!==this.sheet} - static ensure(){ - return this.sheet?Promise.resolve():(this.pending||(this.pending=this.load().finally(()=>{ - this.pending=null} - )),this.pending)} - static async load(){ - const t=`?v=${ - CS.appVersion} - &atlas=20260928-relic-capacity`,i=await fetch(IS.getAssetPath(`UI_MINI.json${ - t} - `)); - if(!i.ok)throw new Error(`UI_MINI: HTTP ${ - i.status} - `); - const s=await i.json(),e=await wd.load(IS.getAssetPath(`UI_MINI.ktx2${ - t} - `)),n=new Kn(e,s); - await n.parse(); - for(const h of["background_map","chapter_journey","encounter_battle","encounter_elite","encounter_boss","encounter_event","encounter_shop","encounter_gambling","ui_arrow_up","ui_button_lobby_blank","ui_close","ui_coin","ui_energy","ui_challenge_seal","ui_divider","UI_VS","UI_Check1","UI_Check2",...vbi,...Sbi])if(!n.textures[h])throw new Error(`UI_MINI: missing ${ - h} - `); - this.sheet=n} - static texture(t){ - var i; - const s=null==(i=this.sheet)?void 0:i.textures[t]; - if(!s)throw new Error(`UI_MINI not ready: ${ - t} - `); - return s} - } - ; - Qt(Tbi,"MiniAscentAssets"),Zt(Tbi,"sheet",null),Zt(Tbi,"pending",null); - let Cbi=Tbi; - const Obi=Object.freeze(Object.defineProperty({ - __proto__:null,MiniAscentAssets:Cbi} - ,Symbol.toStringTag,{ - value:"Module"} - )),Ibi=Qt(t=>40+138*t,"routeTileX"),kbi=Qt((t,i)=>Math.abs(t-i)<=1,"adjacentLanes"); - function xbi(t){ - var i,s,e; - const n=Math.max(0,((null==(s=null==(i=t.rows[0])?void 0:i[0])?void 0:s.depth)??t.run.floor)-1),h=(null==(e=t.previousNode)?void 0:e.depth)===n?t.previousNode:null; - return{ - depth:n,lane:0===n?null:(null==h?void 0:h.lane)??t.positionLane,node:h} - } - function Rbi(t,i){ - var s,e,n; - return!!(null==(s=t.rows[0])?void 0:s.some(t=>t.id===i.id))&&((null==(e=t.currentNode)?void 0:e.id)===i.id||!((null==(n=t.run)?void 0:n.battlePending)||t.currentNode&&!["battle","elite","boss"].includes(t.currentNode.kind))&&(1!==i.depth||0===i.lane||3===i.lane)&&(null==t.positionLane||kbi(t.positionLane,i.lane)))} - Qt(xbi,"routeOrigin"),Qt(Rbi,"canSelectRouteNode"); - function Pbi(t,i){ - if(t.currentNode&&(t.run.battlePending||!["battle","elite","boss"].includes(t.currentNode.kind)))return; - const s="elite"===i?["elite","battle","boss"]:["battle","elite","boss"]; - return(t.rows[0]??[]).filter(i=>s.includes(i.kind)&&Rbi(t,i)).sort((i,e)=>{ - var n,h; - return s.indexOf(i.kind)-s.indexOf(e.kind)||Number(e.id===(null==(n=t.currentNode)?void 0:n.id))-Number(i.id===(null==(h=t.currentNode)?void 0:h.id))||Math.abs(i.lane-(t.positionLane??0))-Math.abs(e.lane-(t.positionLane??0))||i.lane-e.lane} - )[0]} - function Nbi(t,i){ - return Number.isSafeInteger(i)&&i>=t.floor&&i<=(t.totalWaves??t.floor+99)} - Qt(Pbi,"autoBattleNode"),Qt(Nbi,"validAutoTarget"); - const Lbi={ - CRYSTAL_TRIGGER_NORMAL:"Normal attack",CRYSTAL_TRIGGER_SKILL:"Skill attack",CRYSTAL_DESC_STAT:"Increases ## by @@%.",CRYSTAL_DESC_CAPACITY:"Increases the soldier recruitment cap by ## (up to 40).",CRYSTAL_DESC_PROMOTION:"While equipped, increases evolution/ascension by ## stage(s).",CRYSTAL_DESC_STUN:"## hits have a @@% chance to stun the enemy for %% seconds.",CRYSTAL_DESC_FREEZE:"## hits have a @@% chance to freeze the enemy for %% seconds, stopping movement and attacks.",CRYSTAL_DESC_SHOCK:"## hits have a @@% chance to reduce enemy attack speed by 30% for %% seconds.",CRYSTAL_DESC_POISON:"## hits have a @@% chance to poison the enemy for %% seconds, dealing 25% of attack as damage each second.",CRYSTAL_RANDOM_SECONDARY:"Random Secondary (##★)",CRYSTAL_SECONDARY:"Secondary (##★)",CRYSTAL_PRIMARY:"Primary (##★)",CRYSTAL_PROMOTION:"Promotion",CRYSTAL_CAPACITY:"Soldier capacity",TAB_CRYSTALS:"Crystals",CRYSTAL_SUMMON_TICKETS:"Crystal Summon Tickets · ##",CRYSTAL_DRAW_FIVE:"×5",CRYSTAL_CLAIM:"Claim",CRYSTAL_CLAIMED:"Claimed",CRYSTAL_ATTACK:"Attack",CRYSTAL_HEALTH:"Vitality",CRYSTAL_HASTE:"Attack speed",CRYSTAL_MOVE:"Movement",CRYSTAL_RANGE:"Reach",CRYSTAL_STUN:"Stun",CRYSTAL_POISON:"Poison",CRYSTAL_PARALYSIS:"Shock",CRYSTAL_CHILL:"Freeze",CRYSTAL_IN_BATTLE:"Change equipment after the battle ends.",CRYSTAL_REFRESHED:"Your collection changed. Review it and try again.",CRYSTAL_NO_TICKETS:"Not enough draw tickets.",CRYSTAL_PROTECTED:"Equipped crystals cannot be merged.",CRYSTAL_MERGE_RULE:"4 crystals for the same legion and rarity → 1 higher rarity",CRYSTAL_DUPLICATE:"4 slots per legion · No duplicate target/primary option",CRYSTAL_ERROR:"Could not complete the action. Reload and try again.",CRYSTAL_LOAD_FAILED:"Could not load crystals.",CRYSTAL_LOADING:"Loading crystals…",CRYSTAL_COLLECTION:"Collection · ##",CRYSTAL_CANCEL:"Cancel",CRYSTAL_MERGE:"Merge",CRYSTAL_EMPTY:"No crystals for this legion yet.\nDefeat bosses to earn crystals.",CRYSTAL_DRAW_ONE:"×1",CRYSTAL_UNEQUIP:"Unequip",CRYSTAL_SLOT:"Slot ##",CRYSTAL_REPLACE:"Replace selected slot",CRYSTAL_EQUIP:"Equip",CRYSTAL_MERGE_CONFIRM:"Consume these four crystals?\nReceive one higher-rarity crystal for this legion.",CRYSTAL_RECEIVED:"Crystals acquired",CRYSTAL_CONFIRM:"Confirm",CRYSTAL_BOSS_REWARD:"Boss rewards",CRYSTAL_FIRST_CLEAR:"First-clear reward · Crystal Summon Tickets ×##",CRYSTAL_TICKETS_GRANTED:"Crystal Summon Tickets ×## received",RELIC_ARMY_START_LEVEL:"All legions: hero and soldier level",RELIC_ARMY_ATTACK_SPEED:"All legions: attack speed",RELIC_ARMY_MOVE_SPEED:"All legions: movement speed",CARD_TRANSCEND:"Ascend ##",CARD_HERO_LEVEL_UP:"Hero level up",CARD_SOLDIER_LEVEL_UP:"Soldier level up",CARD_LEGION_LEVEL_UP:"Legion level up",CARD_ARMY_LEVEL_UP:"All legions level up",CARD_HERO_UPGRADE:"Hero ##",CARD_SOLDIER_UPGRADE:"Soldier ##",CARD_SOLDIER_CHANGE:"Soldier class change",CARD_SOLDIER_CHANGE_KEEP:"Level and count retained\nEvolution and ascension retained",CARD_AUTO_PICK:"Auto-select in ##s",AUTO_CARD_RULES:"Choose a card after each battle. After 7 seconds, one of the highest-rarity cards is selected automatically.",ARMY_ALL:"All legions",CARD_TARGET_BOTH:"Both",ARMY_ATK_SPEED:"Attack speed",ARMY_MOVE_SPEED:"Movement speed",ARMY_RANGE:"Attack range",ARMY_ATTACK:"Attack",ARMY_HP:"Health",ARMY_BUFF_RULES:"All heroes and soldiers",CARD_ALL_SOLDIERS_UP:"All current soldiers in this legion advance one stage.",EVENT_SHOP_HINT:"Exchange seals for main-game rewards. Purchases are sent to your mailbox.",EVENT_SHOP_EMPTY:"No products are currently available.",EVENT_SHOP_LIMIT:"( ## / @@ )",EVENT_SHOP_BUY:"Buy",EVENT_SHOP_DELIVERED:"Rewards sent to your mailbox.",CARD_NORMAL:"Normal",CARD_RARE:"Rare",CARD_EPIC:"Epic",CARDS_CURRENT:"Current card reward",CARDS_RECEIVE:"Receive",CARDS_WAVE:"Wave ## reward",CARDS_SEQUENTIAL_RULES:"Receive to reveal the current cards. Choose one before receiving the next reward.",CARDS_ALL_CLAIMED:"All card rewards have been chosen.",AUTO_BATTLE:"Auto battle",AUTO_TARGET:"Through wave ##",AUTO_NORMAL:"Normal first",AUTO_ELITE:"Elite first",AUTO_START:"Start auto battle",AUTO_STOP:"Stop after this battle",AUTO_STOPPING:"Stopping after this battle",AUTO_STATUS:"Through wave ## · @@",AUTO_SAVING:"Saving data…",AUTO_UNAVAILABLE:"Auto battle is unavailable right now.",AUTO_NO_BATTLE:"Auto battle stopped. Choose the next destination.",CARDS_RULES:"Choose one card per cleared wave. Effects apply when chosen. Unclaimed cards expire when this run ends.",CARDS_EMPTY:"No cards yet. Win a battle to earn cards.",CARDS_CHOOSE:"Choose a card",CARDS_APPLY:"Apply card",SHOP_ALL:"All legions",SHOP_REPLACE:"Replace hero",SHOP_HERO_UP:"Upgrade hero",SHOP_SOLDIER_UP:"Upgrade ## soldiers",SHOP_UPGRADE_DESC:"Upgrade up to ## soldiers, lowest tiers first",SHOP_ADD_LIMIT:"Legions at or below the soldier limit",SHOP_RUN_ONLY:"Applies to this run only",SHOP_RUN_BUFF:"Heroes & soldiers · Stacks this run",FOCUS_SOLDIERS:"Soldiers +##",DUAL_LEVEL:"Both legions: level +##",ASSAULT:"Combined attack",GUARD:"Cover",PAIR_LEGIONS:"Legions ## & @@",ATTACK_EFFECT:"Attack +##%",GUARD_EFFECT:"Damage taken −##%",TACTIC_REQUIRE:"Both: ## soldiers / Lv.@@",TACTIC_REQUIRE_HEADER:"Requirements",TACTIC_REQUIRE_BODY:"Each legion\n##+ soldiers\nHero & soldiers: Lv.@@+",CARD_SOLDIER_ADD:"Add soldiers",CARD_RECRUIT:"New legion",CARD_EACH:"Applies to each legion",CARD_SOLDIER_COUNT:"## soldiers",CARD_DAMAGE_TAKEN:"Damage taken",LEGION_TRAIN:"Legion ##: Hero and soldier levels +@@",CHAPTER_NAME:"Chapter ##",CHAPTER_WAVES:"## waves",CHAPTER_PROGRESS:"Chapter ## · Wave @@",NORMAL_MODE:"Normal",HARD_MODE:"Hard",HARD_CHAPTER_NAME:"Hard Chapter ##",HARD_LOCKED:"Clear Chapter ## to unlock Hard",HARD_CHAPTER_PROGRESS:"Hard Chapter ## · Wave @@",ENERGY_STATUS:"Energy ##/@@",ENERGY_NEXT:"Next +1 in ## min",ENERGY_SHORT:"Not enough energy (## needed)",ENERGY_FULL:"Full",CHAPTER_CLEAR:"Chapter ## cleared!",CHAPTER_STAGE_REWARDS:"First-clear stage rewards",CHAPTER_REWARD_RECEIVED:"Rewards claimed. Check your mailbox for main-game rewards.",TAB_RELICS:"Relics",RELIC_SUMMON:"Summon relic",RELIC_SUMMON_TEN:"Summon relic (×10)",RELIC_SUMMON_RESULT:"Relic summon results",RELIC_EFFECT_SUMMARY:"##: @@",RELIC_OWNED_COPIES:"Copies owned: ##",RELIC_REQUIRED_COPIES:"Copies needed for next level: ##",RELIC_LOADING:"Loading relics…",RELIC_LOAD_FAILED:"Could not load relics",RELIC_RELOAD:"Reload",RELIC_DRAW_RESULT:"## @@ · Lv.%%",RELIC_LIFE:"Extra life",RELIC_SOLDIER_LEVEL:"Legion ##: soldier level",RELIC_HERO_LEVEL:"Legion ##: hero level",RELIC_START_GOLD:"First-wave gold: once per chapter each season",RELIC_CLEAR_GOLD:"Gold per battle won",RELIC_SEAL_BONUS:"Seal rewards",RELIC_SOLDIER_COUNT:"Legion ##: soldiers",RELIC_LEVEL_GAIN:"Level-up gains for all legions",RELIC_FIFTH_LEGION:"Start with Legion 5",RELIC_SOLDIER_CHANGE:"Legion ##: choose soldier type",RELIC_LOCKED:"Not owned",RELIC_UNLOCKED:"Unlocked",RELIC_RETRY_LIFE:"Life used. ## remaining. Retry this stage.",RELIC_SEALS_EARNED:"Seals earned +##",RELIC_GRID_HINT:"Tap a relic to view its details.",TAB_BATTLE:"Battle",TAB_CORPS:"Legions",TAB_SHOP:"Shop",EMPTY_CORPS:"Start a run in the Battle tab to form your legions.",SHOP_LOCKED:"Choose a shop on the route to purchase items.",TIER_NORMAL:"Normal",TIER_EVOLVED:"Evolved",TIER_TRANS:"##◆",SOLDIERS:"Soldiers",HERO:"Hero",LEGION:"Legion ##",MY_CORPS:"My legions",BEST:"Best: Stage ##",RESULT_TITLE:"Challenge result",START:"Start",CURRENT_POSITION:"You are here",ASSET_ERROR:"Could not load minigame images. Please try again.",RESULT_DONE:"Reward received",RESULT_LOSS:"You lost",RESULT_WIN:"You won!",NO_COINS:"Not enough coins",WAGER_SKIP:"Pass without betting",WAGER_BET:"Bet ## coins",WAGER_LOSS:"Lose: spend ## coins",WAGER_WIN:"Win: receive ## coins (net +@@)",WAGER_ODDS:"Win chance: ##%",WAGER_ROUNDS:"Played ## / @@ rounds",WAGER_RETURN:"Bet → Return on a win",WAGER_LOSS_RULE:"If you lose, you lose the coins you bet.",WAGER:"Coin wager",TAKE_REWARD:"Take reward",SUPPLY_DESC:"Supplies and training apply to this run only",SUPPLY_COINS:"Receive funds",TITLE:"Legion Challenge",ROUTE:"Choose a route",DEPTH:"Stage ##",SHOP:"Shop",NEXT:"Next destination",CONTINUE:"Continue",EVENT_HINT:"Choose one reward without a battle",COINS:"Coins +##",HERO_TRAIN:"Legion ##: Hero level +@@",SOLDIER_TRAIN:"Legion ##: All soldiers level +@@",SHOP_HINT:"This run only · 3 random offers",RESET:"Legions reset after defeat. Gold and seals are kept.",DEFEAT:"Defeated at stage ##.",SUMMARY:"Stages cleared: ## · Coins earned: @@",RESTART:"New run",BATTLE_GIVEUP:"Give up",BATTLE_GIVEUP_QUESTION:"Give up this battle?\nThis will end the current run.",RECORD:"Run coins: ## · Best stage: @@",PROGRESS:"Stage ##",SAME_RACE:"Hero level and upgrades are retained"} - ,Dbi={ - TAB_CRYSTALS:"GAME_1713",TAB_RELICS:"GAME_4",TAB_BATTLE:"COMMON_378",TAB_CORPS:"GAME_1714",TAB_SHOP:"COMMON_356",BEST:"GAME_1715",TITLE:"GAME_1716",DEPTH:"COMMON_397",ASSET_ERROR:"GAME_1717",CHAPTER_NAME:"GAME_1718",CHAPTER_WAVES:"GAME_1590",CHAPTER_PROGRESS:"GAME_1719",CHAPTER_STAGE_REWARDS:"GAME_1720",CHAPTER_REWARD_RECEIVED:"GAME_1721",CONTINUE:"GAME_1722",RESET:"GAME_1723",RESTART:"GAME_1724",PROGRESS:"GAME_1725",BATTLE_GIVEUP:"GAME_1726",BATTLE_GIVEUP_QUESTION:"GAME_1727",CHAPTER_CLEAR:"GAME_1728",RELIC_SEALS_EARNED:"GAME_1729",RESULT_TITLE:"GAME_1730",DEFEAT:"GAME_1731",SUMMARY:"GAME_1732",CARD_TRANSCEND:"GAME_1173",CARD_LEGION_LEVEL_UP:"GAME_1733",CARD_ARMY_LEVEL_UP:"GAME_1734",CARD_HERO_UPGRADE:"GAME_1735",CARD_SOLDIER_UPGRADE:"GAME_1736",CARD_AUTO_PICK:"GAME_1737",ARMY_ALL:"GAME_1738",CARD_TARGET_BOTH:"GAME_1845",CARD_SOLDIER_CHANGE:"GAME_1846",CARD_SOLDIER_CHANGE_KEEP:"GAME_1847",CARD_HERO_LEVEL_UP:"GAME_1848",CARD_SOLDIER_LEVEL_UP:"GAME_1849",ARMY_ATK_SPEED:"GAME_21",ARMY_MOVE_SPEED:"GAME_22",ARMY_RANGE:"GAME_1739",ARMY_ATTACK:"GAME_19",ARMY_HP:"CombatBuffType_HU",ARMY_BUFF_RULES:"GAME_1740",CARD_ALL_SOLDIERS_UP:"GAME_1741",CARD_NORMAL:"EmblemGradeName1",CARD_RARE:"GAME_1742",CARD_EPIC:"EmblemGradeName4",CARDS_CURRENT:"GAME_1743",CARDS_RECEIVE:"COMMON_8",CARDS_WAVE:"GAME_1744",CARDS_SEQUENTIAL_RULES:"GAME_1745",CARDS_ALL_CLAIMED:"GAME_1746",CARDS_RULES:"GAME_1747",CARDS_EMPTY:"GAME_1748",CARDS_CHOOSE:"GAME_1749",CARDS_APPLY:"GAME_1750",CARD_SOLDIER_ADD:"GAME_1751",CARD_RECRUIT:"GAME_1752",CARD_SOLDIER_COUNT:"GAME_1753",SOLDIERS:"GAME_175",HERO:"GAME_3",LEGION:"GAME_1754",EMPTY_CORPS:"GAME_1755",TIER_NORMAL:"EmblemGradeName1",TIER_EVOLVED:"GAME_67",TIER_TRANS:"GAME_1756",MY_CORPS:"GAME_1757",CRYSTAL_CONFIRM:"COMMON_1",RELIC_ARMY_START_LEVEL:"GAME_1758",RELIC_ARMY_ATTACK_SPEED:"GAME_1759",RELIC_ARMY_MOVE_SPEED:"GAME_1760",RELIC_SUMMON:"GAME_1761",RELIC_SUMMON_TEN:"GAME_1762",RELIC_SUMMON_RESULT:"GAME_1763",RELIC_EFFECT_SUMMARY:"GAME_1764",RELIC_OWNED_COPIES:"GAME_1765",RELIC_REQUIRED_COPIES:"GAME_1766",RELIC_LOADING:"GAME_1767",RELIC_LOAD_FAILED:"GAME_1768",RELIC_RELOAD:"GAME_1769",RELIC_DRAW_RESULT:"GAME_1770",RELIC_SOLDIER_LEVEL:"GAME_1771",RELIC_HERO_LEVEL:"GAME_1772",RELIC_SOLDIER_COUNT:"GAME_1773",RELIC_LOCKED:"GAME_1774",RELIC_UNLOCKED:"GAME_1775",RELIC_GRID_HINT:"GAME_1776",CRYSTAL_TRIGGER_NORMAL:"GAME_26",CRYSTAL_TRIGGER_SKILL:"GAME_27",CRYSTAL_DESC_STAT:"GAME_1777",CRYSTAL_DESC_CAPACITY:"GAME_1778",CRYSTAL_DESC_PROMOTION:"GAME_1779",CRYSTAL_DESC_STUN:"GAME_1780",CRYSTAL_DESC_FREEZE:"GAME_1781",CRYSTAL_DESC_SHOCK:"GAME_1782",CRYSTAL_DESC_POISON:"GAME_1783",CRYSTAL_RANDOM_SECONDARY:"GAME_1784",CRYSTAL_SECONDARY:"GAME_1785",CRYSTAL_PRIMARY:"GAME_1786",CRYSTAL_PROMOTION:"GAME_1787",CRYSTAL_CAPACITY:"GAME_1788",CRYSTAL_SUMMON_TICKETS:"GAME_1789",CRYSTAL_DRAW_FIVE:"GAME_1790",CRYSTAL_CLAIM:"COMMON_223",CRYSTAL_CLAIMED:"COMMON_319",CRYSTAL_ATTACK:"GAME_19",CRYSTAL_HEALTH:"GAME_1791",CRYSTAL_HASTE:"GAME_21",CRYSTAL_MOVE:"GAME_22",CRYSTAL_RANGE:"GAME_1792",CRYSTAL_STUN:"GAME_1388",CRYSTAL_POISON:"GAME_1390",CRYSTAL_PARALYSIS:"GAME_1793",CRYSTAL_CHILL:"GAME_1794",CRYSTAL_IN_BATTLE:"GAME_1795",CRYSTAL_REFRESHED:"GAME_1796",CRYSTAL_NO_TICKETS:"GAME_1348",CRYSTAL_PROTECTED:"GAME_1797",CRYSTAL_MERGE_RULE:"GAME_1798",CRYSTAL_DUPLICATE:"GAME_1799",CRYSTAL_ERROR:"GAME_1800",CRYSTAL_LOAD_FAILED:"GAME_1801",CRYSTAL_LOADING:"GAME_1802",CRYSTAL_COLLECTION:"GAME_1803",CRYSTAL_CANCEL:"COMMON_2",CRYSTAL_MERGE:"GAME_1328",CRYSTAL_EMPTY:"GAME_1804",CRYSTAL_DRAW_ONE:"GAME_1805",CRYSTAL_UNEQUIP:"GAME_150",CRYSTAL_SLOT:"GAME_1806",CRYSTAL_REPLACE:"GAME_1807",CRYSTAL_EQUIP:"GAME_149",CRYSTAL_MERGE_CONFIRM:"GAME_1808",CRYSTAL_RECEIVED:"GAME_1809",CRYSTAL_BOSS_REWARD:"GAME_1810",CRYSTAL_FIRST_CLEAR:"GAME_1811",EVENT_SHOP_HINT:"GAME_1812",EVENT_SHOP_EMPTY:"GAME_1813",EVENT_SHOP_LIMIT:"GAME_1814",EVENT_SHOP_BUY:"COMMON_7",EVENT_SHOP_DELIVERED:"GAME_1815",SHOP:"COMMON_356",NORMAL_MODE:"GAME_1834",HARD_MODE:"GAME_1835",HARD_CHAPTER_NAME:"GAME_1836",HARD_LOCKED:"GAME_1837",HARD_CHAPTER_PROGRESS:"GAME_1838",ENERGY_STATUS:"GAME_1839",ENERGY_NEXT:"GAME_1840",ENERGY_SHORT:"GAME_1841",ENERGY_FULL:"GAME_1842",CRYSTAL_TICKETS_GRANTED:"GAME_1843"} - ,Gbi=Qt(t=>Dbi[t]??`MINI_PVE_${ - t} - `,"pveTextKey"); - function Bbi(t,i,s,e){ - return NB.getText(Gbi(t),Lbi[t]).replace(/\\n/g,"\n").replace(/##/g,String(i??"")).replace(/@@/g,String(s??"")).replace(/%%/g,String(e??""))} - Qt(Bbi,"pveText"); - const Ubi={ - battle:"Battle",elite:"Elite",boss:"Boss",event:"Event"} - ,Fbi=Qt(t=>"shop"===t?Bbi("SHOP"):Ubi[t]??String(t),"nodeName"),$bi=Object.freeze(Object.defineProperty({ - __proto__:null,PVE_ENGLISH:Lbi,nodeName:Fbi,pveText:Bbi,pveTextKey:Gbi} - ,Symbol.toStringTag,{ - value:"Module"} - )),Hbi={ - paperTint:3421755,surface:3156773,surfaceRaised:3814187,surfaceSelected:5324843,border:7626823,accent:16767113,text:15919057,muted:12102549,subtle:9339504,success:10998935,danger:15901582} - ,Wbi={ - normal:Hbi,rare:{ - surface:2437959,surfaceSelected:3165296,border:4951768,accent:8634879} - ,epic:{ - surface:3483969,surfaceSelected:5256549,border:10184401,accent:12950271} - } - ,Vbi=class t{ - constructor(){ - Zt(this,"stages",[]),Zt(this,"routes",[]),Zt(this,"relics",[]),Zt(this,"config",null)} - static getInstance(){ - return this.instance??(this.instance=new t)} - async load(){ - const t=TD.getInstance(),i=[AD.MINI_ASCENT_STAGE,AD.MINI_ASCENT_ROUTE,AD.MINI_ASCENT_RELIC,AD.MINI_ASCENT_CONFIG]; - await Promise.all(i.map(i=>t.loadBook(i))); - const s=i.map(i=>t.getBook(i)); - if(s.some(t=>!Array.isArray(t)||!t.length))throw new Error("Mini ascent books are not available"); - [this.stages,this.routes,this.relics]=s,this.config=s[3][0]} - getStage(t,i){ - return this.stages.find(s=>s.main===t&&s.sub===i)} - getRoutes(t,i){ - return this.routes.filter(s=>s.routeId===t&&s.sub===i)} - } - ; - Qt(Vbi,"MiniAscentBookDataManager"),Zt(Vbi,"instance"); - let jbi=Vbi; - function Kbi(t){ - return Array.from({ - length:5} - ,(i,s)=>t[s]??null)} - function zbi(t){ - const i=Kbi(t.ally),s=Kbi(t.enemy),e=Qt(t=>t?t.soldierTiers.map(t=>({ - ...t} - )):[],"tiers"); - return{ - allyCrystalStats:i.map(t=>(null==t?void 0:t.crystalStats)?{ - hero:{ - ...t.crystalStats.hero} - ,soldier:{ - ...t.crystalStats.soldier} - } - :void 0),allyCrystalProcs:i.map(t=>{ - var i; - return null==(i=null==t?void 0:t.crystalProcs)?void 0:i.map(t=>({ - ...t} - ))} - ),allyTacticBonuses:i.map(t=>({ - attackBonusPct:(null==t?void 0:t.attackBonusPct)??0,damageReductionPct:(null==t?void 0:t.damageReductionPct)??0,attackSpeedPct:(null==t?void 0:t.attackSpeedPct)??0,moveSpeedPct:(null==t?void 0:t.moveSpeedPct)??0,manaRegenPct:(null==t?void 0:t.manaRegenPct)??0,attackPct:(null==t?void 0:t.attackPct)??0,hpPct:(null==t?void 0:t.hpPct)??0,attackRangePct:(null==t?void 0:t.attackRangePct)??0} - )),allyHeroLevels:i.map(i=>(null==i?void 0:i.heroLevel)??t.allyLevel),allySoldierLevels:i.map(i=>(null==i?void 0:i.soldierLevel)??t.allyLevel),enemyHeroLevels:s.map(i=>(null==i?void 0:i.heroLevel)??t.enemyLevel),enemySoldierLevels:s.map(i=>(null==i?void 0:i.soldierLevel)??t.enemyLevel),allyHeroes:i.map(t=>(null==t?void 0:t.heroKindNum)??0),allyHeroTrans:i.map(t=>(null==t?void 0:t.heroTrans)??0),allyCorpSoldierTiers:i.map(e),allyKnightLevel:t.allyLevel,allyHeroLevelBonus:0,allyTransPoints:null,allyPetBuffs:null,enemyHeroes:s.map(t=>(null==t?void 0:t.heroKindNum)??0),enemyHeroTrans:s.map(t=>(null==t?void 0:t.heroTrans)??0),enemyCorpSoldierTiers:s.map(e),enemyKnightLevel:t.enemyLevel,enemyHeroLevelBonus:0,enemyTransPoints:null,enemyPetBuffs:null} - } - function Ybi(t,i){ - if("newHero"===t.type)return t.heroKind??0; - if("soldierChange"===t.type)return t.soldierKind??0; - const s=i[t.corp]; - return s?"heroUp"===t.type||"heroLevel"===t.type||"legionLevel"===t.type||"dualLevel"===t.type||"tactic"===t.type?s.heroKind:s.soldierKind||t.soldierKind||0:0} - function qbi(t){ - return t.counts.reduce((t,i)=>t+i,0)} - function Xbi(t,i){ - return Array.from({ - length:5} - ,(s,e)=>({ - kindNum:t.soldierKind<=0?0:0===e||i<=0?t.soldierKind:i,trans:t.soldierKind<=0?0:Math.max(0,e-1),count:t.soldierKind<=0?0:t.counts[e]??0} - ))} - function Jbi(t){ - return(Math.max(1,t)-1)%4+1} - function Qbi(t){ - return 2===t||3===t} - function Zbi(t){ - return Array.from({ - length:5} - ,(i,s)=>s<t?s:-1)} - function tyi(t,i){ - if(!Array.isArray(t)||5!==t.length)return Zbi(i); - const s=new Set,e=t.map(t=>{ - const e=Number.isInteger(t)&&t>=0&&t<i&&!s.has(t); - return e&&s.add(t),e?t:-1} - ); - for(let n=0; - n<i; - n++){ - if(s.has(n))continue; - const t=e.indexOf(-1); - if(t<0)return Zbi(i); - e[t]=n,s.add(n)} - return e} - function iyi(t,i,s){ - const e=[...t]; - return[e[i],e[s]]=[e[s],e[i]],e} - function syi(t,i){ - const s="ally"===i; - if(t){ - const t=[170,330,490].map(t=>t/640),i=[220,430].map(t=>t/640),e=s?.7:.3,n=s?.88:.12; - return[{ - x:t[0],y:e} - ,{ - x:t[1],y:e} - ,{ - x:t[2],y:e} - ,{ - x:i[0],y:n} - ,{ - x:i[1],y:n} - ]} - const e=s?.32:.68,n=s?.12:.88; - return[0,2,4,1,3].map((t,i)=>({ - x:i<3?e:n,y:.17+.16*t} - ))} - Qt(Kbi,"pad$1"),Qt(zbi,"toSetTeamsParams"),Qt(Ybi,"cardIconKind"),Qt(qbi,"totalSoldiers"),Qt(Xbi,"soldierDisplayTiers"),Qt(Jbi,"mapIndexForFloor"),Qt(Qbi,"isVerticalMap"),Qt(Zbi,"defaultFormation"),Qt(tyi,"normalizeFormation"),Qt(iyi,"swapSlots"),Qt(syi,"slotLayout"); - const eyi=class extends Error{ - } - ; - Qt(eyi,"ServerRejected"); - let nyi=eyi; - const hyi=class t{ - constructor(){ - Zt(this,"season",null),Zt(this,"run",null),Zt(this,"relics",null),Zt(this,"crystals",null),Zt(this,"lastDefeat",null),Zt(this,"lastClear",null),Zt(this,"eventActive",!1),Zt(this,"stateError",null),Zt(this,"seasonEndedByServer",!1),Zt(this,"onSeasonEnded",null),Zt(this,"shopOnly",!1),Zt(this,"viewRevision",0),Zt(this,"viewCache",new Map),Zt(this,"viewRequests",new Map)} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - takeLastClear(){ - const t=this.lastClear; - return this.lastClear=null,t} - isSeasonOver(){ - var t,i; - if(this.seasonEndedByServer)return!0; - if(this.shopOnly?!FB.isAscentShopOpen():!FB.isValidEvent($B.MINI_ASCENT_EVENT))return!0; - const s=Date.parse((this.shopOnly?null==(t=this.season)?void 0:t.shopEndTime:null==(i=this.season)?void 0:i.endTime)??""),e=Bx.time>=0?Bx.time:Date.now(); - return Number.isFinite(s)&&e>=s} - enterShopOnly(){ - this.shopOnly=!0,this.seasonEndedByServer=!1,this.run=null,this.relics=null,this.crystals=null,this.lastDefeat=null,this.invalidateViews()} - leaveShopOnly(){ - this.shopOnly=!1} - async discardPendingResult(){ - await yS.removeData(yS.KEY_MINI_ASCENT_PENDING)} - invalidateViews(){ - this.viewRevision++,this.viewCache.clear(),this.viewRequests.clear()} - currentView(t){ - return{ - ...t,..."season"in t?{ - season:this.season??t.season} - :{ - } - ,..."run"in t?{ - run:this.run} - :{ - } - } - } - async readView(t,i,s){ - s&&this.invalidateViews(); - const e=this.viewCache.get(t); - if(e)return this.currentView(e); - const n=this.viewRequests.get(t); - if(n)return n; - const h=this.viewRevision,r=(async()=>{ - let s; - try{ - s=await i()} - catch(n){ - if(h!==this.viewRevision)return this.readView(t,i,!1); - throw n} - if(h!==this.viewRevision)return this.readView(t,i,!1); - const e=this.unwrap(s); - return this.apply(e),this.viewCache.set(t,e),this.currentView(e)} - )(); - this.viewRequests.set(t,r); - try{ - return await r} - finally{ - this.viewRequests.get(t)===r&&this.viewRequests.delete(t)} - } - async requestUpdate(t){ - let i; - this.invalidateViews(); - try{ - i=await t()} - finally{ - this.invalidateViews()} - const s=this.unwrap(i); - return this.apply(s),s} - unwrap(t){ - var i; - if(!t)throw new Error("network"); - if(!1===t.success){ - const s=t.errorMessageFromServer??t.errorMessage??"rejected"; - throw"SEASON_NOT_FOUND"!==s||this.seasonEndedByServer||(this.seasonEndedByServer=!0,null==(i=this.onSeasonEnded)||i.call(this)),new nyi(s)} - return t.body??t} - apply(t){ - var i,s,e; - t&&((t.season&&(null==(i=this.season)?void 0:i.seasonId)!==t.season.seasonId||t.crystals&&t.crystals.revision!==(null==(s=this.crystals)?void 0:s.revision)||void 0!==t.run&&JSON.stringify(this.run)!==JSON.stringify(t.run))&&this.invalidateViews(),t.season&&(this.seasonEndedByServer=!1,(null==(e=this.season)?void 0:e.seasonId)!==t.season.seasonId&&(this.lastDefeat=null,this.relics=null,this.crystals=null),this.season=t.season),void 0!==t.lastDefeat&&(this.lastDefeat=t.lastDefeat),t.crystals&&(this.crystals=t.crystals),t.relics&&(this.relics=t.relics),void 0!==t.run&&(this.run=t.run,this.lastDefeat&&this.run&&this.run.floor>this.lastDefeat.floor&&(this.lastDefeat=null)),Array.isArray(t.rows)&&void 0!==t.currentNode&&this.viewCache.set("route",t),void 0!==t.shop&&this.viewCache.set("shop",t),t.eventShop&&this.viewCache.set("eventShop",t),t.crystals&&this.viewCache.set("crystals",t),t.relics&&this.viewCache.set("relics",t))} - api(){ - return sD.getInstance().miniAscent} - async fetchState(){ - try{ - const t=await this.requestUpdate(()=>this.api().state()); - return this.eventActive=!0,this.stateError=null,t.season.chapters&&await jbi.getInstance().load().catch(t=>{ - } - ),t} - catch(frt){ - throw frt instanceof nyi?(this.eventActive=!1,this.season=null,this.run=null,this.relics=null,this.crystals=null,this.lastDefeat=null,this.stateError="rejected"):this.stateError="network",frt} - } - async start(t,i){ - return await this.requestUpdate(()=>i?this.api().start(!0,t,!0):this.api().start(!0,t)),this.lastDefeat=null,await yS.removeData(yS.KEY_MINI_ASCENT_FORMATION),this.run} - async fetchEventShop(t=!1){ - return this.readView("eventShop",()=>this.api().eventShop(),t)} - async buyEventShop(t,i){ - return this.requestUpdate(()=>this.api().eventShopBuy(this.season.seasonId,t,i.kindNum,JSON.stringify(i)))} - async fetchCrystals(t=!1){ - return this.readView("crystals",()=>this.api().crystals(),t)} - async claimChapterReward(t,i,s){ - const e=await this.requestUpdate(()=>s?this.api().claimChapterReward(this.season.seasonId,t,i,!0):this.api().claimChapterReward(this.season.seasonId,t,i)); - return this.crystals=null,e} - async sweep(t,i){ - return this.requestUpdate(()=>i?this.api().sweep(t,!0):this.api().sweep(t))} - async devClearChapter(t,i){ - const s=await this.requestUpdate(()=>this.api().devClearChapter(t,i)); - return this.lastDefeat=null,this.lastClear={ - chapter:s.chapter,hard:!!s.hard} - ,s} - async devGrantEnergy(){ - await this.requestUpdate(()=>this.api().devGrantEnergy())} - async crystalAction(t,i,s){ - return this.requestUpdate(()=>this.api().crystalAction(this.season.seasonId,t,i,s))} - async fetchRelics(t=!1){ - return this.readView("relics",()=>this.api().relics(),t)} - async drawRelic(t,i,s=1){ - return this.requestUpdate(()=>this.api().relicDraw(t,i,s))} - async selectRelicSoldier(t,i){ - return this.requestUpdate(()=>this.api().relicSoldier(this.season.seasonId,t,i))} - async fetchRoute(t=!1,i=!0){ - return this.readView("route",()=>this.api().route(i),t)} - async selectNode(t,i=!0){ - return this.requestUpdate(()=>this.api().selectNode(t,i))} - async completeNode(t,i){ - return this.requestUpdate(()=>this.api().completeNode(t,i))} - async prepare(t=!1){ - return this.readView("prepare",()=>this.api().prepare(),t)} - async loadFormation(t){ - const i=await yS.getData(yS.KEY_MINI_ASCENT_FORMATION); - return tyi(i&&this.season&&i.seasonId===this.season.seasonId?i.slots:null,t)} - async saveFormation(t){ - var i; - await yS.saveData(yS.KEY_MINI_ASCENT_FORMATION,{ - seasonId:(null==(i=this.season)?void 0:i.seasonId)??0,slots:t} - )} - async battleStart(t,i,s=!0){ - const e=await this.requestUpdate(()=>this.api().battleStart(t,i,s)); - return this.run&&(this.run={ - ...this.run,battlePending:!0} - ),e} - async battleEnd(i,s,e=!0){ - await yS.saveData(yS.KEY_MINI_ASCENT_PENDING,{ - battleId:i,result:s} - ); - let n=null; - for(let h=0; - h<t.RETRY; - h++)try{ - const t=await this.requestUpdate(()=>this.api().battleEnd(i,s,e)); - return await yS.removeData(yS.KEY_MINI_ASCENT_PENDING),"CLEAR"===t.result&&(this.lastDefeat=null,this.lastClear={ - chapter:t.chapter,hard:!!t.hard} - ),"LOSE"===t.result&&(this.lastDefeat={ - ...t.summary} - ),t} - catch(frt){ - if(n=frt,frt instanceof nyi){ - await yS.removeData(yS.KEY_MINI_ASCENT_PENDING); - break} - await new Promise(i=>setTimeout(i,t.RETRY_DELAY_MS))} - throw n} - async flushPendingResult(){ - if(this.isSeasonOver())return await this.discardPendingResult(),null; - const t=await yS.getData(yS.KEY_MINI_ASCENT_PENDING); - if(!(null==t?void 0:t.battleId))return null; - try{ - return await this.battleEnd(t.battleId,t.result)} - catch{ - return null} - } - async revealCard(t){ - return await this.requestUpdate(()=>this.api().revealCard(t)),this.run} - async pickCard(t,i,s,e){ - return await this.requestUpdate(()=>this.api().pickCard(t,!0,i,s,e)),this.run} - async fetchShop(t=!1){ - return this.readView("shop",()=>this.api().shop(),t)} - async shopBuy(t){ - return this.requestUpdate(()=>this.api().shopBuy(t))} - async shopRefresh(t){ - return this.requestUpdate(()=>this.api().shopRefresh(t))} - async giveUp(){ - const t=await this.requestUpdate(()=>this.api().giveUp(this.run.runId)); - return this.run=null,this.lastDefeat=t.summary,t.summary} - } - ; - Qt(hyi,"MiniAscentDataManager"),Zt(hyi,"_instance"),Zt(hyi,"RETRY",3),Zt(hyi,"RETRY_DELAY_MS",1e3); - let ryi=hyi; - function oyi(t,i){ - if(!t)return""; - const s=Date.parse(t); - if(!Number.isFinite(s)||!Number.isFinite(i))return""; - const e=Math.max(0,Math.floor((s-i)/6e4)),n=Qt(t=>String(t).padStart(2,"0"),"pad"); - return`${ - n(Math.floor(e/1440))} - D ${ - n(Math.floor(e/60)%24)} - H ${ - n(e%60)} - M`} - Qt(oyi,"formatAscentRemaining"); - const ayi=[{ - id:"battle",key:"TAB_BATTLE"} - ,{ - id:"corps",key:"TAB_CORPS"} - ,{ - id:"relics",key:"TAB_RELICS"} - ,{ - id:"crystals",key:"TAB_CRYSTALS"} - ,{ - id:"shop",key:"TAB_SHOP"} - ],cyi=class t extends pB{ - constructor(){ - super(),Zt(this,"paper",new Xe(Cbi.texture("background_map"))),Zt(this,"clip",new ep),Zt(this,"contentClip",new ep),Zt(this,"pages",new Ke),Zt(this,"closeControl",new Ke),Zt(this,"header",new iG(Bbi("TITLE"),Hbi.accent,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:26,lineHeight:32} - )),Zt(this,"coin",new Xe(Cbi.texture("ui_coin"))),Zt(this,"coinText",new iG("",Hbi.accent,hD.DEFAULT_FONT_OPTION_16)),Zt(this,"seal",new Xe(Cbi.texture("ui_challenge_seal"))),Zt(this,"sealText",new iG("",Hbi.text,hD.DEFAULT_FONT_OPTION_16)),Zt(this,"energy",new Xe(Cbi.texture("ui_energy"))),Zt(this,"energyText",new iG("",Hbi.text,hD.DEFAULT_FONT_OPTION_16)),Zt(this,"progress",new iG("",Hbi.text,hD.DEFAULT_FONT_OPTION_16)),Zt(this,"remaining",new iG("",Hbi.muted,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:14,lineHeight:18} - )),Zt(this,"chrome",new ep),Zt(this,"navigation",new Ke),Zt(this,"tabButtons",[]),Zt(this,"navigating",!1),Zt(this,"countdown",new Rx(1e3)),Zt(this,"fxLayer",new Ke),Zt(this,"shown",{ - gold:null,energy:null} - ),Zt(this,"headerTweens",[]),Zt(this,"activePage",null),Zt(this,"onExit",null),Zt(this,"onSeasonEnded",null),Zt(this,"onNavigate",null),this.width=616,this.bg.visible=this.txtTitle.visible=this.btnClose.visible=!1,this.paper.tint=Hbi.paperTint,this.paper.eventMode="static",this.paper.mask=this.clip,this.pages.mask=this.contentClip,this.clip.eventMode=this.contentClip.eventMode=this.chrome.eventMode="none",this.addChild(this.paper,this.clip,this.pages,this.contentClip,this.chrome,this.header,this.coin,this.coinText,this.seal,this.sealText,this.energy,this.energyText,this.progress,this.remaining,this.navigation,this.closeControl,this.fxLayer),this.fxLayer.eventMode="none",this.coin.anchor.set(.5),this.energy.anchor.set(.5); - const t=new Xe(Cbi.texture("ui_close")); - t.width=t.height=44,t.eventMode="none",this.closeControl.addChild(t),this.closeControl.eventMode="static",this.closeControl.cursor="pointer",this.closeControl.hitArea=new $i(-4,-4,52,52),this.closeControl.on("pointertap",t=>{ - t.stopPropagation(),this.requestExit()} - ); - for(const{ - id:i,key:s} - of ayi){ - const t=new Ke,e=new ep,n=new iG(Bbi(s),Hbi.muted,hD.DEFAULT_FONT_OPTION_16); - t.addChild(e,n),t.eventMode="static",t.cursor="pointer",t.hitArea=new $i(0,0,112,54),t.on("pointertap",t=>{ - t.stopPropagation(),this.selectTab(i)} - ),this.navigation.addChild(t),this.tabButtons.push({ - id:i,root:t,bg:e,label:n} - )} - this.countdown.addEventListener("timer",()=>this.updateStatus()),this.on("added",()=>this.countdown.start()),this.on("removed",()=>this.countdown.stop())} - static getInstance(){ - return this.instance??(this.instance=new t)} - static get layoutHeight(){ - return Math.min(960,SS.safeHeight-28)} - present(t){ - this.activePage!==t&&(this.pages.removeChildren(),this.activePage=t,this.pages.addChild(t)),t.position.set(0),t.pivot.set(0),t.scale.set(1),t.alpha=1,t.eventMode="auto",t.interactiveChildren=!0,this.refresh(),this.parent||super.show()} - detach(t){ - t.parent===this.pages&&this.pages.removeChild(t),this.activePage===t&&(this.activePage=null),this.refresh()} - async selectTab(t){ - var i; - if(!this.navigating&&(null==(i=this.activePage)?void 0:i.canCloseShell())&&this.activePage.tabId!==t&&this.onNavigate){ - this.navigating=!0,this.refresh(); - try{ - await this.onNavigate(t)} - catch(s){ - bH.getInstance().showMessage(s.message)} - finally{ - this.navigating=!1,this.refresh()} - } - } - updateStatus(){ - var t,i,s,e,n,h,r,o; - const a=ryi.getInstance(); - if(this.parent&&a.isSeasonOver())return void(null==(t=this.onSeasonEnded)||t.call(this)); - this.coinText.text=String(a.run&&!a.run.battleOnly&&(null==(i=this.activePage)?void 0:i.usesRunWallet)?a.run.wallet:this.shown.gold??(null==(s=a.season)?void 0:s.gold)??0),this.coinText.scale.set(1),this.coinText.scale.set(Math.min(1,48/Math.max(1,this.coinText.width))),this.coinText.position.set(62,78),this.sealText.text=String((null==(e=a.season)?void 0:e.coin)??0),this.sealText.scale.set(1),this.sealText.scale.set(Math.min(1,48/Math.max(1,this.sealText.width))),this.sealText.position.set(156,78),this.progress.visible=!a.shopOnly,this.progress.text=a.run?Bbi("DEPTH",a.run.floor):Bbi("BEST",(null==(n=a.season)?void 0:n.bestFloor)??0),this.progress.scale.set(1),this.progress.scale.set(Math.min(1,130/Math.max(1,this.progress.width))),this.progress.position.set((this.width-this.progress.width)/2,78); - const c=a.shopOnly||null==(h=a.season)?void 0:h.energy; - this.energy.visible=this.energyText.visible=!!c,c&&(this.energyText.text=`${ - this.shown.energy??c.current} - /${ - c.max} - `,this.energyText.scale.set(1),this.energyText.scale.set(Math.min(1,72/Math.max(1,this.energyText.width))),this.energyText.position.set(this.width-28-this.energyText.width,78),this.energy.position.set(this.energyText.x-34+13,89)),this.remaining.text=oyi(a.shopOnly?null==(r=a.season)?void 0:r.shopEndTime:null==(o=a.season)?void 0:o.endTime,Bx.time>=0?Bx.time:Date.now()),this.remaining.scale.set(1),this.remaining.scale.set(Math.min(1,120/Math.max(1,this.remaining.width))),this.remaining.position.set(28,29); - const l=Math.min(440,this.width-2*(28+this.remaining.width+16)); - this.header.scale.set(1),this.header.scale.set(Math.min(1,l/Math.max(1,this.header.width))),this.header.position.set((this.width-this.header.width)/2,22)} - refresh(){ - var i; - this.height=t.layoutHeight; - const s=this.height-t.FOOTER_HEIGHT; - this.paper.width=this.width,this.paper.height=this.height,this.clip.clear().roundRect(0,0,this.width,this.height,20).fill(16777215),this.contentClip.clear().rect(12,120,this.width-24,s-128).fill(16777215),this.closeControl.position.set(this.width-56,16); - const e=!this.navigating&&!!(null==(i=this.activePage)?void 0:i.canCloseShell()); - this.closeControl.alpha=e?1:.35,this.pages.interactiveChildren=!this.navigating,this.coin.width=this.coin.height=26,this.coin.position.set(41,89),this.seal.width=this.seal.height=26,this.seal.position.set(122,76),this.energy.width=this.energy.height=26,this.chrome.clear().moveTo(24,112).lineTo(this.width-24,112).stroke({ - color:Hbi.border,width:1} - ).rect(12,s,this.width-24,t.FOOTER_HEIGHT-12).fill(Hbi.surface).moveTo(24,s).lineTo(this.width-24,s).stroke({ - color:Hbi.border,width:1} - ); - const n=ryi.getInstance().shopOnly,h=this.tabButtons.filter(({ - id:t,root:i} - )=>i.visible=!n||"shop"===t),r=(this.width-32-5*(h.length-1))/h.length; - h.forEach(({ - id:t,root:i,bg:n,label:h} - ,o)=>{ - var a; - i.position.set(16+o*(r+5),s+12),i.hitArea=new $i(0,0,r,54); - const c=(null==(a=this.activePage)?void 0:a.tabId)===t; - n.clear(),c&&n.roundRect(0,0,r,54,8).fill(Hbi.surfaceSelected).rect((r-64)/2,50,64,3).fill(Hbi.accent),h.textColor=c?Hbi.accent:Hbi.muted,h.scale.set(1),h.scale.set(Math.min(1,(r-8)/h.width)),h.position.set((r-h.width)/2,(50-h.height)/2),i.alpha=e?1:.5} - ),this.updateStatus(),this.resetPostionY(),this.parent&&this.position.set(320,this.getDefaultPositionY())} - holdHeader(t){ - this.killHeaderTweens(),void 0!==t.gold&&(this.shown.gold=t.gold),void 0!==t.energy&&(this.shown.energy=t.energy),this.updateStatus()} - rollHeader(t,i,s,e){ - const n={ - v:this.shown[t]??i} - ,h="gold"===t?this.coinText:this.energyText; - void 0!==e&&(h.textColor=e); - const r=yx.to(n,{ - v:i,duration:s,ease:"power1.out",onUpdate:Qt(()=>{ - this.shown[t]=Math.round(n.v),this.updateStatus()} - ,"onUpdate"),onComplete:Qt(()=>{ - this.shown[t]=null,this.resetHeaderColors(),this.updateStatus()} - ,"onComplete")} - ); - this.headerTweens.push(r)} - resetHeaderColors(){ - this.coinText.textColor=Hbi.accent,this.energyText.textColor=Hbi.text} - releaseHeader(){ - this.killHeaderTweens(),this.shown={ - gold:null,energy:null} - ,this.updateStatus()} - headerAnchor(t){ - const i="gold"===t?this.coin:this.energy; - return new Ai(i.x,i.y)} - pulseHeader(t){ - const i="gold"===t?this.coin:this.energy; - i.width=i.height=26; - const s=i.scale.x,e=i.scale.y; - yx.killTweensOf(i.scale); - const n=yx.fromTo(i.scale,{ - x:1.45*s,y:1.45*e} - ,{ - x:s,y:e,duration:.28,ease:"back.out(3)"} - ); - this.headerTweens.push(n)} - killHeaderTweens(){ - for(const t of this.headerTweens)t.kill(); - this.headerTweens=[],this.resetHeaderColors(),this.coin.width=this.coin.height=26,this.energy.width=this.energy.height=26} - requestExit(){ - var t,i; - !this.navigating&&(null==(t=this.activePage)?void 0:t.canCloseShell())&&(this.hideImmediately(),null==(i=this.onExit)||i.call(this))} - hideImmediately(){ - this.releaseHeader(),this.pages.removeChildren(),this.activePage=null,super.hideImmediately()} - getDefaultPositionY(){ - return SS.safeHeight/2} - onBackButton(){ - return this.requestExit(),!0} - } - ; - Qt(cyi,"MiniAscentShell"),Zt(cyi,"instance"),Zt(cyi,"FOOTER_HEIGHT",84); - let lyi=cyi; - const uyi=class t extends Ke{ - constructor(){ - super(),Zt(this,"background",new ep),Zt(this,"statusText",new iG("",Hbi.accent,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:20,lineHeight:26,align:"center"} - )),this.eventMode="none",this.addChild(this.background,this.statusText)} - static getInstance(){ - return this.instance??(this.instance=new t)} - show(t){ - const i=Math.min(380,SS.stageWidth-48); - this.statusText.setWrapWidth(i-32),this.statusText.text=t; - const s=Math.max(58,this.statusText.height+28); - this.statusText.position.set((i-this.statusText.width)/2,(s-this.statusText.height)/2),this.background.clear().roundRect(0,0,i,s,12).fill({ - color:Hbi.surface,alpha:.95} - ).stroke({ - color:Hbi.border,width:1} - ),this.position.set((SS.stageWidth-i)/2,.68*SS.safeHeight-s/2),M7t.getInstance().addChild(this)} - hide(){ - this.removeFromParent()} - } - ; - Qt(uyi,"MiniAscentBattleProgress"),Zt(uyi,"instance"); - let dyi=uyi; - const fyi=Qt(t=>t>=4?t-2:0,"crystalSecondaryGrade"); - function pyi(t,i,s){ - const e={ - ...t} - ; - for(const[n,h]of Object.entries((null==i?void 0:i[s])??{ - } - )){ - const t=n; - e[t]=(e[t]??0)+h} - return e} - Qt(pyi,"combineCrystalStats"); - const wyi=[16747381,9691812,13345023,9033215,16765563]; - function gyi(t){ - return Math.floor(t/100)-1} - function myi(t,i,s,e=-1){ - return!t.battlePending&&gyi(i.kind)===s&&t.items.some(t=>t.id===i.id)&&!(t.slots[s]??[]).some((s,n)=>{ - var h; - return n!==e&&(null==(h=t.items.find(t=>t.id===s))?void 0:h.kind)===i.kind&&s!==i.id} - )} - function vyi(t,i,s,e){ - if(!t.length||!Number.isSafeInteger(i)||i<=t.length)return; - const n=t.map(t=>({ - ...t} - )),h=e?"y":"x",r=[...new Set(n.map(t=>t[h]))].sort((t,i)=>t-i),o=r.length>1?r[1]-r[0]:24,a=e?s?1:-1:s?-1:1,c=a>0?r[r.length-1]:r[0],l=n.filter(t=>t[h]===c); - for(; - t.length<i; - ){ - const i=t.length-n.length,s={ - ...l[i%l.length]} - ; - s[h]+=a*o*(1+Math.floor(i/l.length)),t.push(s)} - } - Qt(gyi,"crystalCorp"),Qt(myi,"canEquipCrystal"),Qt(vyi,"extendMiniAscentPositions"); - const _yi={ - [Hx.HUMAN]:{ - type:"stun",seconds:.5} - ,[Hx.ELF]:{ - type:"poison",seconds:3} - ,[Hx.UNDEAD]:{ - type:"paralysis",seconds:2} - ,[Hx.ORC]:{ - type:"chill",seconds:2} - } - ; - function Myi(t,i){ - if(t.isSummoned)return; - const s=_yi[t.tribe]; - s&&t.addNormalAttackEffect(s.type,s.seconds,.05,{ - id:"mini-ascent:racial",cooldownSeconds:3,cooldownGroup:`mini-ascent:racial:${ - s.type} - `,slowRatio:.3,poisonAttackRatio:.25,poisonTickSeconds:1} - )} - function byi(t,i,s="soldier"){ - if(!t.isSummoned)for(const e of i){ - if(e.target&&e.target!==s)continue; - const i=e.trigger??"normal"; - "soldier"===e.target&&"skill"!==i||("skill"===i?t.addSkillAttackEffect.bind(t):t.addNormalAttackEffect.bind(t))(e.type,e.seconds,e.chance,{ - id:`mini-ascent:crystal:${ - i} - :${ - e.type} - `,cooldownSeconds:3,cooldownGroup:`mini-ascent:crystal:${ - e.type} - `,slowRatio:.3,poisonAttackRatio:.25,poisonTickSeconds:1} - )} - } - Qt(Myi,"registerMiniAscentAttackEffects"),Qt(byi,"registerCrystalAttackEffects"); - const yyi=class t extends z0t{ - constructor(){ - super(),Zt(this,"crystalStats",[]),Zt(this,"crystalProcs",[]),Zt(this,"autoStatus",null),Zt(this,"buffContext",vP.MiniGame),Zt(this,"onFinish",null)} - setTeams(t){ - super.setTeams(t),this.crystalProcs=t.allyCrystalProcs??[],this.crystalStats=t.allyCrystalStats??[]} - getAllyGrowthBonuses(t,i){ - return pyi(super.getAllyGrowthBonuses(t,i),this.crystalStats[t],i?"hero":"soldier")} - onAllyCorpReady(t,i,s=!1){ - const e=this.crystalProcs[i]; - void 0===e?Myi(t):byi(t,e,s?"hero":"soldier")} - extendSoldierPositions(t,i,s,e){ - vyi(t,(null==i?void 0:i.reduce((t,i)=>t+Math.max(0,i.count),0))??t.length,s,e)} - showAutoBattleStatus(t,i){ - var s; - null==(s=this.autoStatus)||s.destroy({ - children:!0} - ); - const e=new Ke; - this.autoStatus=e,e.position.set(12,SS.SAFE_AREA_TOP+44); - const n=new iG(t,16771e3,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:14,lineHeight:18} - ); - n.setWrapWidth(232),e.addChild(n); - const h=new Ke,r=new ep; - h.position.set(0,n.height+6); - const o=new iG(Bbi("AUTO_STOP"),16771e3,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:14,lineHeight:18} - ); - o.setWrapWidth(208),o.position.set(12,7); - const a=Math.max(34,o.height+14); - r.roundRect(0,0,232,a,8).fill({ - color:3156772,alpha:.92} - ).stroke({ - color:16766338,width:1} - ),h.addChild(r,o),h.eventMode="static",h.cursor="pointer",h.hitArea=new $i(0,0,232,a),h.on("pointertap",t=>{ - t.stopPropagation(),i(),h.eventMode="none",n.text=Bbi("AUTO_STOPPING"),h.visible=!1} - ),e.addChild(h),M7t.getInstance().addChild(e)} - playStartCountdown(){ - return Promise.resolve()} - cleanup(){ - var t; - null==(t=this.autoStatus)||t.destroy({ - children:!0} - ),this.autoStatus=null,super.cleanup()} - static getInstance(){ - return t.miniInstance||(t.miniInstance=new t),t.miniInstance} - onVictoryCallback(){ - this.finish("WIN")} - onDefeatCallback(){ - this.finish("LOSE")} - finish(i){ - const s=this.onFinish; - this.onFinish=null,setTimeout(()=>{ - nU.getInstance().remove(this.execute,this),s&&s(i)} - ,t.RESULT_DELAY_MS)} - } - ; - Qt(yyi,"MiniAscentBattleController"),Zt(yyi,"miniInstance"),Zt(yyi,"RESULT_DELAY_MS",1500); - let Eyi=yyi; - const Ayi=class t{ - static async openAutoBattle(){ - this.busy} - static async startAutoBattle(t){ - const i=ryi.getInstance().run; - if(!this.busy&&!this.auto){ - if(!i||i.battlePending||!Nbi(i,t.targetFloor)||!["battle","elite"].includes(t.priority))throw new Error(Bbi("AUTO_UNAVAILABLE")); - this.auto={ - ...t,runId:i.runId} - ,"undefined"!=typeof document&&document.addEventListener("visibilitychange",this.onVisibility),await this.continueAutoBattle()} - } - static stopAutoBattle(){ - this.auto=null,"undefined"!=typeof document&&document.removeEventListener("visibilitychange",this.onVisibility)} - static async continueAutoBattle(){ - var t,i; - const s=this.auto; - if(!s)return; - const e=ryi.getInstance(); - try{ - if(!e.run||e.run.runId!==s.runId)return this.stopAutoBattle(),void(await this.openBattleTab()); - if((null==(t=e.run.cardRewards)?void 0:t.current)&&!e.run.battlePending)return void(await this.openCards()); - if(e.run.floor>s.targetFloor)return this.stopAutoBattle(),void(await this.openCards()); - const n=await e.fetchRoute(!1,!1); - if(this.auto!==s)return void(await this.openBattleTab()); - if(n.run.runId!==s.runId||n.run.floor>s.targetFloor)return this.stopAutoBattle(),void(await this.openCards()); - const h=Pbi(n,s.priority); - if(!h)return this.stopAutoBattle(),bH.getInstance().showMessage(Bbi("AUTO_NO_BATTLE")),void(await this.openBattleTab()); - (null==(i=n.currentNode)?void 0:i.id)!==h.id&&await e.selectNode(h.id,!1); - const r=await e.loadFormation(e.run.corps.length); - if(this.auto!==s)return void(await this.openBattleTab()); - await this.startFloor(r,h.id)} - catch(n){ - this.stopAutoBattle(),bH.getInstance().showMessage(n.message),await this.openBattleTab()} - } - static async openCards(){ - var t; - this.configureShell(); - const i=ryi.getInstance().run; - if(!(null==(t=null==i?void 0:i.cardRewards)?void 0:t.current)||i.battlePending)return void(await this.openBattleTab()); - const s=this.navigationRevision; - try{ - await this.openCardPick()} - catch(e){ - if(s!==this.navigationRevision)return; - this.stopAutoBattle(),bH.getInstance().showMessage(e.message); - const{ - MiniAscentCardsPage:t} - =await ei(async()=>{ - const{ - MiniAscentCardsPage:t} - =await Promise.resolve().then(()=>p5i); - return{ - MiniAscentCardsPage:t} - } - ,void 0); - t.getInstance().show()} - } - static async enter(){ - if(this.seasonEndNotified=!1,ryi.getInstance().leaveShopOnly(),ryi.getInstance().isSeasonOver())return this.leaveEnded(); - this.navigationRevision++,this.stopAutoBattle(),await Cbi.ensure(),this.configureShell(); - const t=ryi.getInstance(); - await t.flushPendingResult(),await t.fetchState(),await this.openBattleTab()} - static async enterShop(){ - this.seasonEndNotified=!1; - const t=ryi.getInstance(); - if(t.enterShopOnly(),t.isSeasonOver())return this.leaveEnded(); - this.navigationRevision++,this.stopAutoBattle(),await Cbi.ensure(),this.configureShell(),await t.discardPendingResult(); - const{ - MiniAscentEventShopPage:i} - =await ei(async()=>{ - const{ - MiniAscentEventShopPage:t} - =await Promise.resolve().then(()=>M5i); - return{ - MiniAscentEventShopPage:t} - } - ,void 0); - i.getInstance().show()} - static configureShell(){ - this.shellReady=!0,lyi.getInstance().onSeasonEnded=()=>{ - this.leaveEnded()} - ,ryi.getInstance().onSeasonEnded=()=>{ - this.leaveEnded()} - ,lyi.getInstance().onNavigate=t=>this.openTab(t),lyi.getInstance().onExit=()=>{ - this.navigationRevision++,this.stopAutoBattle(); - const t=zui.getInstance(); - t.isIdleBattleActive()||t.returnToIdleBattle()} - } - static async openTab(t){ - if(!ryi.getInstance().shopOnly||"shop"===t){ - if(this.navigationRevision++,this.stopAutoBattle(),"battle"===t)return this.openBattleTab(); - if("corps"===t){ - const{ - MiniAscentCorpsPage:t} - =await ei(async()=>{ - const{ - MiniAscentCorpsPage:t} - =await Promise.resolve().then(()=>$5i); - return{ - MiniAscentCorpsPage:t} - } - ,void 0); - t.getInstance().show()} - else if("crystals"===t){ - const{ - MiniAscentCrystalsPage:t} - =await ei(async()=>{ - const{ - MiniAscentCrystalsPage:t} - =await Promise.resolve().then(()=>i3i); - return{ - MiniAscentCrystalsPage:t} - } - ,void 0); - t.getInstance().show()} - else if("relics"===t){ - const{ - MiniAscentRelicsPage:t} - =await ei(async()=>{ - const{ - MiniAscentRelicsPage:t} - =await Promise.resolve().then(()=>a3i); - return{ - MiniAscentRelicsPage:t} - } - ,void 0); - t.getInstance().show()} - else{ - const{ - MiniAscentEventShopPage:t} - =await ei(async()=>{ - const{ - MiniAscentEventShopPage:t} - =await Promise.resolve().then(()=>M5i); - return{ - MiniAscentEventShopPage:t} - } - ,void 0); - t.getInstance().show()} - } - } - static async openBattleTab(){ - var t,i; - const s=ryi.getInstance(); - if(s.isSeasonOver())return this.leaveEnded(); - if(this.configureShell(),!s.run)return this.showLobby(); - if((null==(t=s.run.cardRewards)?void 0:t.current)&&!s.run.battlePending)return this.openCards(); - const e=await s.fetchRoute(); - if((null==(i=e.run.cardRewards)?void 0:i.current)&&!e.run.battlePending)return this.openCards(); - const n=!zui.getInstance().isIdleBattleActive(); - e.currentNode&&"event"!==e.currentNode.kind&&"shop"!==e.currentNode.kind?await this.enterNode(e,n):await this.showRoute(e,n)} - static async openDeploy(t){ - var i,s; - const e=ryi.getInstance(); - if((null==(s=null==(i=e.run)?void 0:i.cardRewards)?void 0:s.current)&&!e.run.battlePending)return this.openCards(); - try{ - const i=await e.fetchRoute(); - i.run.battleOnly?await this.enterNode(i,t):await this.showRoute(i,t)} - catch(frt){ - bH.getInstance().showMessage(frt.message),await this.backToLobby()} - } - static async showRoute(t,i){ - await Cbi.ensure(),this.configureShell(); - const{ - MiniAscentRoutePopup:s} - =await ei(async()=>{ - const{ - MiniAscentRoutePopup:t} - =await Promise.resolve().then(()=>g3i); - return{ - MiniAscentRoutePopup:t} - } - ,void 0),e=s.getInstance(); - e.setData(t),e.onSelect=async t=>{ - if(!this.busy){ - this.busy=!0; - try{ - const s=await ryi.getInstance().selectNode(t); - await this.enterNode(s,i)} - catch(frt){ - bH.getInstance().showMessage(frt.message)} - finally{ - this.busy=!1} - } - } - ,e.onEvent=async(t,i)=>{ - if(!this.busy){ - this.busy=!0; - try{ - const s=await ryi.getInstance().completeNode(t,i); - e.showEventResult(s)} - catch(frt){ - bH.getInstance().showMessage(frt.message)} - finally{ - this.busy=!1} - } - } - ,e.onAuto=()=>this.openAutoBattle(),e.onBack=()=>{ - this.backToLobby()} - ,e.show()} - static async enterNode(t,i){ - const s=t.currentNode; - if(s)if("event"!==s.kind){ - if("shop"===s.kind){ - const{ - MiniAscentShopPopup:t} - =await ei(async()=>{ - const{ - MiniAscentShopPopup:t} - =await Promise.resolve().then(()=>M3i); - return{ - MiniAscentShopPopup:t} - } - ,void 0),e=t.getInstance(); - return e.onLeave=async()=>{ - const t=await ryi.getInstance().completeNode(s.id); - await this.showRoute(t,i)} - ,e.onReturn=()=>{ - this.openDeploy(i)} - ,void e.show()} - await this.showDeploy(await ryi.getInstance().prepare(),i)} - else await this.showRoute(t,i); - else await this.showRoute(t,i)} - static async showDeploy(i,s){ - var e; - const n=ryi.getInstance(),h=await n.loadFormation(i.ally.length),{ - MiniAscentDeployPopup:r} - =await ei(async()=>{ - const{ - MiniAscentDeployPopup:t} - =await Promise.resolve().then(()=>E3i); - return{ - MiniAscentDeployPopup:t} - } - ,void 0),o=r.getInstance(); - o.setData(i,h,Jbi(i.floor)),o.onFormationChange=t=>{ - n.saveFormation(t).catch(console.warn)} - ,o.onAuto=()=>this.openAutoBattle(),o.onStart=s=>t.startFloor(s,i.opponentId); - const a=null==(e=n.run)?void 0:e.runId; - o.onGiveUp=async()=>{ - var t; - if(!this.busy&&a&&(null==(t=n.run)?void 0:t.runId)===a){ - this.busy=!0,this.stopAutoBattle(); - try{ - await n.giveUp(),await this.backToLobby()} - finally{ - this.busy=!1} - } - } - ,o.onDevClear=async()=>{ - var t; - if(!this.busy&&a&&(null==(t=n.run)?void 0:t.runId)===a){ - this.busy=!0,this.stopAutoBattle(); - try{ - const t=await n.devClearChapter(); - bH.getInstance().showMessage(`[DEV] ${ - t.hard?"하드 ":""} - 챕터 ${ - t.chapter} - 클리어`),await this.backToLobby()} - finally{ - this.busy=!1} - } - } - ,o.onBack=()=>t.openDeploy(s),o.show()} - static async startFloor(i,s){ - var e,n; - if(t.busy)return; - const h=ryi.getInstance().run; - if((null==(e=null==h?void 0:h.cardRewards)?void 0:e.current)&&!h.battlePending)return void(await this.openCards()); - t.busy=!0; - const r=!!this.auto; - this.autoBattleInFlight=r; - try{ - const e=await ryi.getInstance().battleStart(s,i,!r),h=Eyi.getInstance(); - h.setMapIndex(Jbi(e.floor)),h.setTeams(zbi(e)),h.onFinish=i=>{ - t.onFinish(e.battleId,e.floor,i)} - ,lyi.getInstance().hideImmediately(),await h.startBattle(),r&&h.showAutoBattleStatus(this.auto?(null==(n=ryi.getInstance().run)?void 0:n.battleOnly)?Bbi("AUTO_TARGET",this.auto.targetFloor):Bbi("AUTO_STATUS",this.auto.targetFloor,Bbi("battle"===this.auto.priority?"AUTO_NORMAL":"AUTO_ELITE")):Bbi("AUTO_STOPPING"),()=>this.stopAutoBattle())} - catch(frt){ - this.stopAutoBattle(),this.autoBattleInFlight=!1,bH.getInstance().showMessage(`${ - NB.getText("GAME_1820","전투 시작 실패")} - : ${ - frt.message} - `),await t.backToLobby()} - finally{ - t.busy=!1} - } - static async onFinish(i,s,e){ - var n; - const h=ryi.getInstance(),r=this.autoBattleInFlight||!!(null==(n=h.run)?void 0:n.battleOnly); - if(this.autoBattleInFlight=!1,h.isSeasonOver())return this.leaveEnded(); - let o; - try{ - r&&dyi.getInstance().show(Bbi("AUTO_SAVING")),o=await h.battleEnd(i,e,!r)} - catch(frt){ - return h.isSeasonOver()?this.leaveEnded():(bH.getInstance().showMessage(NB.getText("","결과 전송 실패 — 로비에서 다시 전송합니다")),void(await t.backToLobby()))} - finally{ - r&&dyi.getInstance().hide()} - if(("WIN"===o.result||"CLEAR"===o.result)&&o.crystalReward)if(zui.getInstance().isIdleBattleActive()||zui.getInstance().returnToIdleBattle(),o.crystalReward.items.length){ - const{ - MiniAscentCrystalRewardPopup:t} - =await ei(async()=>{ - const{ - MiniAscentCrystalRewardPopup:t} - =await Promise.resolve().then(()=>T3i); - return{ - MiniAscentCrystalRewardPopup:t} - } - ,void 0); - await t.getInstance().presentReward(o.crystalReward)} - else o.crystalReward.tickets&&(ryi.getInstance().crystals=null,bH.getInstance().showMessage(Bbi("CRYSTAL_TICKETS_GRANTED",o.crystalReward.tickets))); - if("WIN"===o.result)return void(await this.openCards()); - if(this.stopAutoBattle(),"RETRY"===o.result){ - const{ - pveText:i} - =await ei(async()=>{ - const{ - pveText:t} - =await Promise.resolve().then(()=>$bi); - return{ - pveText:t} - } - ,void 0); - return bH.getInstance().showMessage(i("RELIC_RETRY_LIFE",o.run.lives??1)),void(await t.openBattleTab())} - const{ - MiniAscentResultPopup:a} - =await ei(async()=>{ - const{ - MiniAscentResultPopup:t} - =await Promise.resolve().then(()=>I3i); - return{ - MiniAscentResultPopup:t} - } - ,void 0),c=a.getInstance(); - c.setData(o.summary,"CLEAR"===o.result?o.chapter:void 0),c.onExit=()=>{ - t.backToLobby()} - ,c.show()} - static async openCardPick(t){ - var i,s,e,n; - const h=ryi.getInstance(); - let r=h.run,o=null==(i=null==r?void 0:r.cardRewards)?void 0:i.current; - if(!r||!o||r.battlePending||void 0!==t&&o.id!==t)return; - const a=zui.getInstance(); - a.isIdleBattleActive()||a.returnToIdleBattle(); - const c=this.navigationRevision,l=r.runId; - o.revealed||(r=await h.revealCard(o.id),o=null==(s=r.cardRewards)?void 0:s.current),c===this.navigationRevision&&(null==(e=h.run)?void 0:e.runId)===l&&(null==o?void 0:o.revealed)&&(null==(n=o.cards)?void 0:n.length)&&await this.showCardPick({ - coinGained:o.coinGained??0,rewards:[],offer:o.cards,run:r} - ,o.floor,!zui.getInstance().isIdleBattleActive(),o.id,{ - index:r.cardRewards.claimed+1,total:r.cardRewards.total} - )} - static async showCardPick(i,s,e,n,h){ - const r=this.navigationRevision,{ - MiniAscentCardPickPopup:o} - =await ei(async()=>{ - const{ - MiniAscentCardPickPopup:t} - =await Promise.resolve().then(()=>P3i); - return{ - MiniAscentCardPickPopup:t} - } - ,void 0); - if(r!==this.navigationRevision)return; - const a=o.getInstance(),c=this.auto; - a.setData({ - autoSelect:Qt(()=>{ - var t; - return null!==c&&this.auto===c&&(null==(t=ryi.getInstance().run)?void 0:t.runId)===c.runId} - ,"autoSelect"),rewardProgress:h,offerId:n,clearedFloor:s,coinGained:i.coinGained,rewards:i.rewards,offer:i.offer,corps:i.run.corps} - ),a.onDone=(s,h,r)=>{ - var o; - return t.afterPick(s,h,e,r,n,null===s?void 0:JSON.stringify(null==(o=i.offer)?void 0:o[s]))} - ,a.show()} - static async afterPick(i,s,e,n,h,r){ - var o,a,c,l; - if(null!==i)try{ - const s=await ryi.getInstance().pickCard(i,n,h,r),c=null==(o=s.cardRewards)?void 0:o.current; - if((null==c?void 0:c.id)===h&&(null==c?void 0:c.revealed)&&(null==(a=c.cards)?void 0:a.length))return void(await t.showCardPick({ - coinGained:0,rewards:[],offer:c.cards,run:s} - ,c.floor,e,h,{ - index:s.cardRewards.claimed+1,total:s.cardRewards.total} - ))} - catch(frt){ - throw this.stopAutoBattle(),frt} - (null==(l=null==(c=ryi.getInstance().run)?void 0:c.cardRewards)?void 0:l.current)?await this.openCards():this.auto?await this.continueAutoBattle():s?await t.openDeploy(e):e?await t.backToLobby():await t.showLobby()} - static async backToLobby(){ - this.stopAutoBattle(); - const i=zui.getInstance(); - i.isIdleBattleActive()||i.returnToIdleBattle(),await t.showLobby()} - static async leaveEnded(){ - this.navigationRevision++,this.stopAutoBattle(),this.autoBattleInFlight=!1; - const t=zui.getInstance(); - t.isIdleBattleActive()||t.returnToIdleBattle(),this.shellReady&&lyi.getInstance().hideImmediately(),await ryi.getInstance().discardPendingResult(),this.seasonEndNotified||(this.seasonEndNotified=!0,bH.getInstance().showMessage(NB.getText("COMMON_169","이벤트가 종료되었습니다.")))} - static async showLobby(){ - if(ryi.getInstance().isSeasonOver())return this.leaveEnded(); - await Cbi.ensure(),this.configureShell(); - const{ - MiniAscentLobbyPopup:t} - =await ei(async()=>{ - const{ - MiniAscentLobbyPopup:t} - =await Promise.resolve().then(()=>W3i); - return{ - MiniAscentLobbyPopup:t} - } - ,void 0); - t.getInstance().show()} - } - ; - Qt(Ayi,"MiniAscentFlow"),Zt(Ayi,"busy",!1),Zt(Ayi,"auto",null),Zt(Ayi,"autoBattleInFlight",!1),Zt(Ayi,"navigationRevision",0),Zt(Ayi,"onVisibility",Qt(()=>{ - document.hidden&&Ayi.stopAutoBattle()} - ,"onVisibility")),Zt(Ayi,"shellReady",!1),Zt(Ayi,"seasonEndNotified",!1); - let Syi=Ayi; - const Tyi=Object.freeze(Object.defineProperty({ - __proto__:null,MiniAscentFlow:Syi} - ,Symbol.toStringTag,{ - value:"Module"} - )),Cyi=class{ - static ensureLoaded(){ - return this.loadPromise||(this.loadPromise=this.load().catch(t=>{ - throw this.loadPromise=null,t} - )),this.loadPromise} - static url(t){ - return IS.getAssetPath(`conquest/${ - t} - ?v=${ - CS.appVersion} - `)} - static async fetchChecked(t){ - const i=await fetch(t),s=i.headers.get("content-type")??""; - if(!i.ok||s.includes("text/html"))throw new Error(`정복 리소스 로드 실패 (${ - i.status} - ${ - s.includes("text/html")?", html 폴백":""} - ): ${ - t} - `); - return i} - static async load(){ - const[t,i,s]=await Promise.all([this.fetchChecked(this.url("regionMetadata.json")).then(t=>t.json()),this.fetchChecked(this.url("regionGameData.draft.json")).then(t=>t.json()),this.fetchChecked(this.url("regionIdR8.png")).then(t=>t.blob())]); - this.mapWidth=t.width,this.mapHeight=t.height,this.startRegion=i.start_region??0; - const e=new Map((i.regions??[]).map(t=>[t.id,t])); - this.regionMap.clear(); - for(const n of t.regions){ - const t=e.get(n.id); - this.regionMap.set(n.id,{ - id:n.id,centerPx:[n.center_px[0],n.center_px[1]],pixelArea:n.pixel_area,neighbors:n.neighbors,biome:(null==t?void 0:t.biome)??"plains",biomeKo:(null==t?void 0:t.biome_ko)??(null==t?void 0:t.biome)??"",nameKo:(null==t?void 0:t.name_ko)??`지역 ${ - n.id} - `,zoneNameKo:(null==t?void 0:t.zone_name_ko)??"",zoneCode:(null==t?void 0:t.zone_name_ko)?`${ - t.zone_name_ko.split(" ")[0]} - -${ - String(t.zone_seq??0).padStart(2,"0")} - `:`#${ - n.id} - `,tier:(null==t?void 0:t.tier_suggestion)??1,landmarks:((null==t?void 0:t.landmarks)??[]).map(t=>({ - code:t.code,nameKo:t.name_ko,x:t.x,y:t.y} - ))} - )} - this.idMask=await this.decodeIdMask(s,t.width,t.height),this.buildBBoxes()} - static buildBBoxes(){ - if(!this.idMask)return; - this.bboxMap.clear(); - const t=this.mapWidth; - for(let i=0; - i<this.mapHeight; - i++)for(let s=0; - s<t; - s++){ - const e=this.idMask[i*t+s]; - if(0===e)continue; - const n=this.bboxMap.get(e); - n?(s<n[0]?n[0]=s:s>n[2]&&(n[2]=s),i<n[1]?n[1]=i:i>n[3]&&(n[3]=i)):this.bboxMap.set(e,[s,i,s,i])} - } - static buildRegionHighlight(t,i,s,e=2){ - const n=this.bboxMap.get(t); - if(!n||!this.idMask)return null; - const h=e+1,r=Math.max(0,n[0]-h),o=Math.max(0,n[1]-h),a=Math.min(this.mapWidth-1,n[2]+h)-r+1,c=Math.min(this.mapHeight-1,n[3]+h)-o+1,l=Qt((i,s)=>!(i<0||s<0||i>=this.mapWidth||s>=this.mapHeight)&&this.idMask[s*this.mapWidth+i]===t,"inRegion"),u=new Uint8Array(a*c); - for(let m=0; - m<c; - m++)for(let t=0; - t<a; - t++){ - const i=r+t,s=o+m; - if(!l(i,s))continue; - let e=!1; - for(let t=-1; - t<=1&&!e; - t++)for(let n=-1; - n<=1; - n++)if((n||t)&&!l(i+n,s+t)){ - e=!0; - break} - e&&(u[m*a+t]=1)} - let d=u; - for(let m=1; - m<e; - m++){ - const t=new Uint8Array(d); - for(let i=0; - i<c; - i++)for(let s=0; - s<a; - s++)d[i*a+s]||(s>0&&d[i*a+s-1]||s<a-1&&d[i*a+s+1]||i>0&&d[(i-1)*a+s]||i<c-1&&d[(i+1)*a+s])&&(t[i*a+s]=1); - d=t} - const f=document.createElement("canvas"); - f.width=a,f.height=c; - const p=f.getContext("2d"); - if(!p)return null; - const w=p.createImageData(a,c),g=w.data; - for(let m=0; - m<c; - m++)for(let t=0; - t<a; - t++){ - const e=4*(m*a+t); - d[m*a+t]?(g[e]=s[0],g[e+1]=s[1],g[e+2]=s[2],g[e+3]=s[3]):l(r+t,o+m)&&(g[e]=i[0],g[e+1]=i[1],g[e+2]=i[2],g[e+3]=i[3])} - return p.putImageData(w,0,0),{ - canvas:f,x:r,y:o} - } - static decodeBlob(t,i){ - return createImageBitmap(t,{ - colorSpaceConversion:"none",premultiplyAlpha:"none"} - ).catch(()=>new Promise((s,e)=>{ - const n=new Image; - n.onload=()=>s(n),n.onerror=()=>e(new Error(`정복 이미지 디코드 실패: ${ - i} - `)),n.src=URL.createObjectURL(t)} - ))} - static async decodeIdMask(t,i,s){ - const e=await this.decodeBlob(t,"regionIdR8.png"),n=document.createElement("canvas"); - n.width=i,n.height=s; - const h=n.getContext("2d",{ - willReadFrequently:!0} - ); - if(!h)throw new Error("ConquestDataManager: 2d context 생성 실패"); - h.drawImage(e,0,0); - const r=h.getImageData(0,0,i,s).data,o=new Uint8Array(i*s); - for(let a=0; - a<o.length; - a++)o[a]=r[4*a]; - return"close"in e&&"function"==typeof e.close&&e.close(),o} - static getRegionIdAtMapPx(t,i){ - if(!this.idMask)return 0; - const s=Math.floor(t),e=Math.floor(i); - return s<0||e<0||s>=this.mapWidth||e>=this.mapHeight?0:this.idMask[e*this.mapWidth+s]} - static getRegion(t){ - return this.regionMap.get(t)} - static get regions(){ - return[...this.regionMap.values()]} - static ensureArtPixels(){ - return this.artLoadPromise||(this.artLoadPromise=(async()=>{ - const t=await this.fetchChecked(this.url("worldMapBase.png")).then(t=>t.blob()),i=await this.decodeBlob(t,"worldMapBase.png"),s=document.createElement("canvas"); - s.width=this.mapWidth,s.height=this.mapHeight; - const e=s.getContext("2d",{ - willReadFrequently:!0} - ); - if(!e)throw new Error("ConquestDataManager: 2d context 생성 실패"); - e.drawImage(i,0,0),this.artPixels=e.getImageData(0,0,this.mapWidth,this.mapHeight).data,"close"in i&&"function"==typeof i.close&&i.close()} - )().catch(t=>{ - throw this.artLoadPromise=null,t} - )),this.artLoadPromise} - static buildRegionColorReveal(t){ - const i=this.bboxMap.get(t); - if(!i||!this.idMask||!this.artPixels)return null; - const[s,e,n,h]=i,r=n-s+1,o=h-e+1,a=document.createElement("canvas"); - a.width=r,a.height=o; - const c=a.getContext("2d"); - if(!c)return null; - const l=c.createImageData(r,o),u=l.data; - for(let d=0; - d<o; - d++)for(let i=0; - i<r; - i++){ - const n=(e+d)*this.mapWidth+(s+i); - if(this.idMask[n]!==t)continue; - const h=4*(d*r+i),o=4*n; - u[h]=this.artPixels[o],u[h+1]=this.artPixels[o+1],u[h+2]=this.artPixels[o+2],u[h+3]=255} - return c.putImageData(l,0,0),{ - canvas:a,x:s,y:e} - } - static computeVisibility(t,i=2){ - var s; - const e=new Map; - let n=[]; - for(const r of t)e.set(r,0),n.push(r); - let h=0; - for(; - n.length>0&&h<i; - ){ - h++; - const t=[]; - for(const i of n)for(const n of(null==(s=this.regionMap.get(i))?void 0:s.neighbors)??[])e.has(n)||(e.set(n,h),t.push(n)); - n=t} - return e} - static buildFogCanvas(t){ - if(!this.idMask)return null; - const i=Math.ceil(this.mapWidth/4),s=Math.ceil(this.mapHeight/4),e=.93,n=new Float32Array(i*s); - for(let l=0; - l<s; - l++)for(let s=0; - s<i; - s++){ - const h=Math.min(4*s,this.mapWidth-1),r=Math.min(4*l,this.mapHeight-1),o=this.idMask[r*this.mapWidth+h]; - if(0===o)n[l*i+s]=-1; - else{ - const h=t.get(o); - n[l*i+s]=void 0===h?e:h<=1?0:.5} - } - for(let l=0; - l<8; - l++){ - let t=!1; - for(let h=0; - h<s; - h++)for(let r=0; - r<i; - r++){ - const o=h*i+r; - if(-1!==n[o])continue; - let a=1/0; - r>0&&n[o-1]>=0&&(a=Math.min(a,n[o-1])),r<i-1&&n[o+1]>=0&&(a=Math.min(a,n[o+1])),h>0&&n[o-i]>=0&&(a=Math.min(a,n[o-i])),h<s-1&&n[o+i]>=0&&(a=Math.min(a,n[o+i])),a!==1/0&&(n[o]=Math.min(a+.12,e),t=!0)} - if(!t)break} - for(let l=0; - l<n.length; - l++)n[l]<0&&(n[l]=e); - const h=document.createElement("canvas"); - h.width=i,h.height=s; - const r=h.getContext("2d"); - if(!r)return null; - const o=r.createImageData(i,s); - for(let l=0; - l<i*s; - l++)o.data[4*l]=10,o.data[4*l+1]=14,o.data[4*l+2]=20,o.data[4*l+3]=Math.round(255*n[l]); - r.putImageData(o,0,0); - const a=document.createElement("canvas"); - a.width=i,a.height=s; - const c=a.getContext("2d"); - return c?(c.filter="blur(3px)",c.drawImage(h,0,0),a):h} - } - ; - Qt(Cyi,"ConquestDataManager"),Zt(Cyi,"mapWidth",0),Zt(Cyi,"mapHeight",0),Zt(Cyi,"startRegion",0),Zt(Cyi,"regionMap",new Map),Zt(Cyi,"idMask",null),Zt(Cyi,"bboxMap",new Map),Zt(Cyi,"loadPromise",null),Zt(Cyi,"artPixels",null),Zt(Cyi,"artLoadPromise",null); - let Oyi=Cyi; - const Iyi=[{ - id:1,bookId:2,name:"격납고",desc:"열기구 척수·탐사 속도"} - ,{ - id:2,bookId:4,name:"원정 사령부",desc:"원정 레벨·원정 공/체"} - ,{ - id:3,bookId:1,name:"수송대",desc:"영웅 슬롯·병사 수"} - ,{ - id:4,bookId:7,name:"보급소",desc:"창고 용량·식량(예정)"} - ,{ - id:5,bookId:5,name:"제작소",desc:"기후 장비 제작(예정)"} - ,{ - id:6,bookId:6,name:"대학",desc:"정복 연구(예정)"} - ],kyi=[{ - id:1,name:"일손 확장",desc:"일손 최대치 +24",cost:5} - ,{ - id:2,name:"열기구 정비",desc:"탐사 시간 -10%",cost:5} - ,{ - id:3,name:"빠른 회복",desc:"원정 회복 시간 -50%",cost:10} - ,{ - id:4,name:"풍년",desc:"완성 지역 자동 수확량 +50%",cost:20} - ,{ - id:5,name:"유물 슬롯 +1",desc:"본 게임 유물 슬롯 (연동 예정)",cost:50} - ,{ - id:6,name:"편성 슬롯 +1",desc:"본 게임 팀 편성 (연동 예정)",cost:50} - ],xyi=class t{ - static ensureLoaded(){ - return this.loadPromise||(this.loadPromise=this.load().catch(t=>{ - throw this.loadPromise=null,t} - )),this.loadPromise} - static url(t){ - return IS.getAssetPath(`conquest/${ - t} - ?v=${ - CS.appVersion} - `)} - static async load(){ - await Oyi.ensureLoaded(); - const[t,i,s]=await Promise.all([Oyi.fetchChecked(this.url("conquestRegionBook.draft.json")).then(t=>t.json()),Oyi.fetchChecked(this.url("conquestMaterialBook.draft.json")).then(t=>t.json()),Oyi.fetchChecked(this.url("conquestFacilityBook.draft.json")).then(t=>t.json())]); - this.regionBook=new Map(t.regions.map(t=>[t.id,t])),this.materialBook=new Map(i.materials.map(t=>[t.id,t])),this.facilityBook=new Map(s.facilities.map(t=>[t.id,t])),this.loadState(),this.tick()} - static now(){ - return Bx.time>0?Bx.time:Date.now()} - static todayKey(){ - return new Date(this.now()).toISOString().slice(0,10)} - static loadState(){ - try{ - const t=localStorage.getItem(this.LS_KEY); - if(t)return void(this.state=JSON.parse(t))} - catch{ - } - this.state={ - v:1,regions:{ - } - ,surveys:[],labor:{ - v:t.LABOR_MAX_BASE,ts:this.now()} - ,inv:{ - } - ,fac:{ - } - ,pts:{ - earn:0,spend:0} - ,nodes:{ - } - ,recover:0} - ; - const i=Oyi.startRegion,s=this.regionBook.get(i); - s&&(this.state.regions[i]={ - e:100,c:s.subzones,o:s.subzones,ms:0,la:""} - ,this.awardMilestones(i)),this.save()} - static save(){ - if(this.state)try{ - localStorage.setItem(this.LS_KEY,JSON.stringify(this.state))} - catch{ - } - } - static notify(){ - var t; - this.save(),null==(t=this.onChanged)||t.call(this)} - static book(t){ - return this.regionBook.get(t)} - static material(t){ - return this.materialBook.get(t)} - static prog(t){ - if(!this.state)throw new Error("ConquestStateManager 미로드"); - let i=this.state.regions[t]; - return i||(i={ - e:0,c:0,o:0,ms:0,la:""} - ,this.state.regions[t]=i),i} - static explorePct(t){ - var i,s; - return(null==(s=null==(i=this.state)?void 0:i.regions[t])?void 0:s.e)??0} - static clearedCount(t){ - var i,s; - return(null==(s=null==(i=this.state)?void 0:i.regions[t])?void 0:s.c)??0} - static outpostStage(t){ - var i,s; - return(null==(s=null==(i=this.state)?void 0:i.regions[t])?void 0:s.o)??0} - static pioneerPct(t){ - const i=this.regionBook.get(t); - return i?Math.floor(this.outpostStage(t)/i.subzones*100):0} - static exploreCap(t){ - const i=this.regionBook.get(t); - if(!i)return 0; - const s=this.clearedCount(t); - return s<i.subzones?10*(s+1):100} - static encounterPending(t){ - var i; - const s=this.regionBook.get(t); - if(!s)return!1; - const e=null==(i=this.state)?void 0:i.regions[t]; - return!!e&&e.c<s.subzones&&e.e>=10*(e.c+1)} - static isRegionOpen(t){ - if(t===Oyi.startRegion)return!0; - const i=Oyi.getRegion(t); - return!!i&&i.neighbors.some(t=>this.outpostStage(t)>=1)} - static outpostRegions(){ - if(!this.state)return[]; - const t=[]; - for(const i of Object.keys(this.state.regions))this.state.regions[i].o>=1&&t.push(Number(i)); - return t} - static balloonSlots(){ - return Math.min(3,this.facGrade(1))} - static activeSurveys(){ - var t; - return(null==(t=this.state)?void 0:t.surveys)??[]} - static surveyOf(t){ - var i; - return null==(i=this.state)?void 0:i.surveys.find(i=>i.r===t)} - static surveySec(i){ - var s; - let e=((null==(s=this.regionBook.get(i))?void 0:s.tier)??1)*t.SURVEY_SEC_PER_TIER; - return e*=1-.02*(this.facLevel(1)-1),this.nodeLevel(2)>0&&(e*=.9),Math.max(3,Math.round(e))} - static surveyBlockReason(t){ - return this.isRegionOpen(t)?this.explorePct(t)>=100?"탐사 완료":this.encounterPending(t)?"적 발견! 원정대로 제압하세요":this.surveyOf(t)?"탐사 진행 중":this.state.surveys.length>=this.balloonSlots()?"모든 열기구가 파견 중입니다":null:"인접 지역에 전초기지가 필요합니다"} - static startSurvey(t){ - return!this.surveyBlockReason(t)&&(this.state.surveys.push({ - r:t,end:this.now()+1e3*this.surveySec(t)} - ),this.notify(),!0)} - static recoverRemainSec(){ - var t; - const i=((null==(t=this.state)?void 0:t.recover)??0)-this.now(); - return i>0?Math.ceil(i/1e3):0} - static expeditionPower(){ - const t=this.facLevel(2),i=this.heroSlots()*(this.squadSize()+1),s=.015*(this.facLevel(2)-1); - return Math.round(t*i*10*(1+s))} - static encounterPower(t){ - const i=this.regionBook.get(t); - if(!i)return 0; - const s=this.clearedCount(t)+1; - return 12*(10*(i.tier-1)+8*s)} - static expeditionBlockReason(t){ - if(!this.encounterPending(t))return"제압할 조우가 없습니다"; - const i=this.recoverRemainSec(); - return i>0?`원정대 회복 중 (${ - i} - 초)`:null} - static runExpedition(i){ - if(this.expeditionBlockReason(i))return null; - const s=this.expeditionPower(),e=this.encounterPower(i),n=s>=e; - return n?(this.prog(i).c+=1,this.grantSurveyLoot(i,2)):this.state.recover=this.now()+1e3*t.RECOVER_SEC*(this.nodeLevel(3)>0?.5:1),this.notify(),{ - win:n,power:s,enemy:e} - } - static outpostCost(t){ - const i=this.regionBook.get(t); - if(!i)return[]; - const s=this.outpostStage(t)+1; - return i.production.filter(t=>"base"===t.unlock_type).map(t=>({ - material_id:t.material_id,qty:4*s*i.tier} - ))} - static outpostBlockReason(t){ - const i=this.regionBook.get(t); - if(!i)return"지역 정보 없음"; - const s=this.prog(t); - return s.o>=i.subzones?"전초기지 최대 단계":s.o>=s.c?"다음 조우를 먼저 제압하세요":this.hasMaterials(this.outpostCost(t))?null:"재료가 부족합니다"} - static buildOutpost(t){ - return!this.outpostBlockReason(t)&&(this.payMaterials(this.outpostCost(t)),this.prog(t).o+=1,this.awardMilestones(t),this.notify(),!0)} - static awardMilestones(i){ - const s=this.regionBook.get(i); - if(!s||!this.state)return; - const e=this.prog(i),n=this.pioneerPct(i); - for(let h=0; - h<t.MILESTONES.length; - h++){ - const i=1<<h; - n>=t.MILESTONES[h]&&!(e.ms&i)&&(e.ms|=i,this.state.pts.earn+=(h+1)*s.tier)} - } - static laborMax(){ - let i=t.LABOR_MAX_BASE; - if(this.state)for(const t of Object.keys(this.state.regions))i+=this.state.regions[t].o; - return this.nodeLevel(1)>0&&(i+=24),i} - static labor(){ - return this.state?(this.regenLabor(),Math.floor(this.state.labor.v)):0} - static regenLabor(){ - if(!this.state)return; - const i=this.now(),s=(i-this.state.labor.ts)/1e3/t.LABOR_REGEN_SEC; - s>0&&(this.state.labor.v=Math.min(this.laborMax(),this.state.labor.v+s),this.state.labor.ts=i)} - static harvestLabor(i){ - var s; - const e=(null==(s=this.regionBook.get(i))?void 0:s.tier)??1; - return t.HARVEST_LABOR[e-1]??10} - static unlockedSlots(t){ - const i=this.regionBook.get(t); - if(!i)return[]; - const s=this.outpostStage(t); - return i.production.filter(t=>{ - if("base"===t.unlock_type)return!0; - if("friendship"===t.unlock_type){ - const e=Math.max(1,Math.ceil(t.unlock_value/5*i.subzones)); - return s>=e} - return"landmark"===t.unlock_type&&s>=i.subzones} - )} - static harvestBlockReason(t){ - return this.outpostStage(t)<1?"전초기지가 필요합니다":this.pioneerPct(t)>=100?"완성 지역 — 매일 자동 수확":this.labor()<this.harvestLabor(t)?"일손이 부족합니다":this.inventoryTotal()>=this.storageCap()?"창고가 가득 찼습니다":null} - static harvest(t){ - if(this.harvestBlockReason(t))return!1; - this.regenLabor(),this.state.labor.v-=this.harvestLabor(t); - for(const i of this.unlockedSlots(t))this.addMaterial(i.material_id,i.rate); - return this.notify(),!0} - static autoHarvest(){ - if(!this.state)return!1; - const t=this.todayKey(); - let i=!1; - const s=1+(this.nodeLevel(4)>0?.5:0); - for(const e of Object.keys(this.state.regions)){ - const n=Number(e),h=this.state.regions[e]; - if(h.la!==t&&!(this.pioneerPct(n)<100)){ - for(const t of this.unlockedSlots(n))this.addMaterial(t.material_id,Math.round(t.rate*s)); - h.la=t,i=!0} - } - return i} - static inventory(){ - return this.state?Object.keys(this.state.inv).map(t=>({ - id:Number(t),qty:this.state.inv[t]} - )).filter(t=>t.qty>0).sort((t,i)=>t.id-i.id):[]} - static materialQty(t){ - var i; - return(null==(i=this.state)?void 0:i.inv[t])??0} - static inventoryTotal(){ - if(!this.state)return 0; - let t=0; - for(const i of Object.keys(this.state.inv))t+=this.state.inv[i]; - return t} - static storageCap(){ - return t.STORAGE_BASE+t.STORAGE_PER_LV*(this.facLevel(4)-1)} - static addMaterial(t,i){ - this.state&&(this.state.inv[t]=(this.state.inv[t]??0)+i)} - static hasMaterials(t){ - return t.every(t=>this.materialQty(t.material_id)>=t.qty)} - static payMaterials(t){ - for(const i of t)this.state.inv[i.material_id]=(this.state.inv[i.material_id]??0)-i.qty} - static grantSurveyLoot(t,i=1){ - const s=this.regionBook.get(t); - if(s)for(const e of s.production)"base"===e.unlock_type&&this.addMaterial(e.material_id,Math.max(1,Math.round(e.rate/25*i)))} - static facLevel(t){ - var i; - return(null==(i=this.state)?void 0:i.fac[t])??1} - static facGrade(t){ - return Math.ceil(this.facLevel(t)/10)} - static heroSlots(){ - return Math.min(5,this.facGrade(3))} - static squadSize(){ - return Math.min(40,10+2*Math.floor(this.facLevel(3)/2))} - static facMaxLevel(){ - return 60} - static facNextCost(t){ - const i=Iyi.find(i=>i.id===t); - if(!i)return null; - const s=this.facLevel(t); - if(s>=this.facMaxLevel())return null; - const e=this.facilityBook.get(i.bookId),n=null==e?void 0:e.levels[s]; - return n?n.costs:null} - static facLevelUpBlockReason(t){ - const i=this.facNextCost(t); - return i?this.hasMaterials(i)?null:"재료가 부족합니다":"최대 레벨"} - static facLevelUp(t){ - return!this.facLevelUpBlockReason(t)&&(this.payMaterials(this.facNextCost(t)),this.state.fac[t]=this.facLevel(t)+1,this.notify(),!0)} - static pointsEarned(){ - var t; - return(null==(t=this.state)?void 0:t.pts.earn)??0} - static pointsAvailable(){ - return this.state?this.state.pts.earn-this.state.pts.spend:0} - static nodeLevel(t){ - var i; - return(null==(i=this.state)?void 0:i.nodes[t])??0} - static learnBlockReason(t){ - const i=kyi.find(i=>i.id===t); - return i?this.nodeLevel(t)>=1?"배움 완료":this.pointsAvailable()<i.cost?"포인트가 부족합니다":null:"노드 없음"} - static learnNode(t){ - if(this.learnBlockReason(t))return!1; - const i=kyi.find(i=>i.id===t); - return this.state.pts.spend+=i.cost,this.state.nodes[t]=1,this.notify(),!0} - static tick(){ - if(!this.state)return!1; - let t=!1; - const i=this.now(),s=[]; - for(const e of this.state.surveys){ - if(e.end>i){ - s.push(e); - continue} - const n=this.prog(e.r); - n.e=Math.min(this.exploreCap(e.r),n.e+10),this.grantSurveyLoot(e.r),t=!0} - return t&&(this.state.surveys=s),this.autoHarvest()&&(t=!0),this.regenLabor(),t&&this.notify(),t} - } - ; - Qt(xyi,"ConquestStateManager"),Zt(xyi,"LS_KEY","ef2.conquest.demo.state.v1"),Zt(xyi,"SURVEY_SEC_PER_TIER",20),Zt(xyi,"LABOR_MAX_BASE",144),Zt(xyi,"LABOR_REGEN_SEC",600),Zt(xyi,"HARVEST_LABOR",[6,8,10,14,18,24]),Zt(xyi,"RECOVER_SEC",60),Zt(xyi,"MILESTONES",[20,40,60,80,100]),Zt(xyi,"STORAGE_BASE",2e3),Zt(xyi,"STORAGE_PER_LV",300),Zt(xyi,"regionBook",new Map),Zt(xyi,"materialBook",new Map),Zt(xyi,"facilityBook",new Map),Zt(xyi,"state",null),Zt(xyi,"loadPromise",null),Zt(xyi,"onChanged",null); - let Ryi=xyi; - const Pyi=class extends Ke{ - constructor(t,i=150,s=44,e=3042106){ - super(),Zt(this,"bgG",new ep),Zt(this,"lbl"),Zt(this,"btnW"),Zt(this,"btnH"),Zt(this,"color"),Zt(this,"_enabled",!0),Zt(this,"onClick",null),this.btnW=i,this.btnH=s,this.color=e,this.addChild(this.bgG),this.lbl=new iG(t),this.lbl.textSize=18,this.addChild(this.lbl),this.eventMode="static",this.cursor="pointer",this.on("pointerup",()=>{ - var t; - this._enabled&&(null==(t=this.onClick)||t.call(this))} - ),this.redraw()} - set label(t){ - this.lbl.text=t,this.centerLabel()} - get label(){ - return this.lbl.text} - setEnabled(t){ - this._enabled!==t&&(this._enabled=t,this.cursor=t?"pointer":"default",this.redraw())} - get enabled(){ - return this._enabled} - setColor(t){ - this.color!==t&&(this.color=t,this.redraw())} - redraw(){ - this.bgG.clear().roundRect(0,0,this.btnW,this.btnH,8).fill({ - color:this._enabled?this.color:3815994,alpha:.95} - ).stroke({ - width:2,color:this._enabled?16769126:7829367} - ),this.lbl.textColor=this._enabled?16777215:10066329,this.centerLabel()} - centerLabel(){ - this.lbl.x=Math.round(.5*(this.btnW-this.lbl.width)),this.lbl.y=Math.round(.5*(this.btnH-this.lbl.height))} - } - ; - Qt(Pyi,"ConquestButton"); - let Nyi=Pyi; - const Lyi=class extends Ke{ - constructor(t,i=18,s=16769126){ - super(),Zt(this,"bgG",new ep),Zt(this,"fillG",new ep),Zt(this,"lbl"),Zt(this,"barW"),Zt(this,"barH"),Zt(this,"color"),this.barW=t,this.barH=i,this.color=s,this.addChild(this.bgG),this.addChild(this.fillG),this.lbl=new iG(""),this.lbl.textSize=13,this.addChild(this.lbl),this.bgG.roundRect(0,0,t,i,.4*i).fill({ - color:1710618,alpha:.9} - ).stroke({ - width:1,color:6710886} - )} - setValue(t,i){ - const s=Math.max(0,Math.min(1,t)); - this.fillG.clear(),s>0&&this.fillG.roundRect(1,1,Math.max(4,(this.barW-2)*s),this.barH-2,.4*(this.barH-2)).fill({ - color:this.color,alpha:.9} - ),this.lbl.text=i,this.lbl.x=Math.round(.5*(this.barW-this.lbl.width)),this.lbl.y=Math.round(.5*(this.barH-this.lbl.height))} - } - ; - Qt(Lyi,"ConquestBar"); - let Dyi=Lyi; - function Gyi(t){ - switch(t){ - case 1:return 12303291; - case 2:return 8248189; - case 3:return 7189490; - case 4:return 13078512; - case 5:return 15773786; - case 6:return 15756653; - default:return 16777215} - } - function Byi(t){ - const i=Math.max(0,Math.ceil(t)); - return`${ - Math.floor(i/60)} - :${ - String(i%60).padStart(2,"0")} - `} - Qt(Gyi,"gradeColor"),Qt(Byi,"fmtSec"); - const Uyi=class extends Ke{ - constructor(t,i){ - super(),Zt(this,"cards",[]); - const s=new iG("외성 시설"); - s.textSize=22,s.x=16,s.y=8,this.addChild(s); - for(let e=0; - e<Iyi.length; - e++){ - const i=new Wyi(Iyi[e].id,t-32); - i.x=16,i.y=46+128*e,i.onChanged=()=>this.refreshAll(),this.addChild(i),this.cards.push(i)} - } - setData(){ - this.refreshAll()} - refreshAll(){ - for(const t of this.cards)t.refresh()} - } - ; - Qt(Uyi,"ConquestFacilityView"); - let Fyi=Uyi; - function $yi(t){ - const i=Ryi,s=i.facLevel(t); - switch(t){ - case 1:return`열기구 ${ - i.balloonSlots()} - 척 · 탐사 속도 +${ - 2*(s-1)} - %`; - case 2:return`원정 레벨 ${ - s} - · 원정 공/체 +${ - (1.5*(s-1)).toFixed(1)} - %`; - case 3:return`영웅 ${ - i.heroSlots()} - 명 · 영웅당 병사 ${ - i.squadSize()} - 명`; - case 4:return`창고 용량 ${ - i.storageCap()} - `; - case 5:return"기후 장비 제작 (준비 중)"; - case 6:return"정복 연구 (준비 중)"; - default:return""} - } - Qt($yi,"facilityEffectText"); - const Hyi=class extends Ke{ - constructor(t,i){ - super(),Zt(this,"fid"),Zt(this,"nameLbl"),Zt(this,"lvLbl"),Zt(this,"effectLbl"),Zt(this,"costLbl"),Zt(this,"btn"),Zt(this,"onChanged",null),this.fid=t; - const s=Iyi.find(i=>i.id===t),e=(new ep).roundRect(0,0,i,118,10).fill({ - color:1907997,alpha:.95} - ).stroke({ - width:2,color:5592405} - ); - this.addChild(e),this.nameLbl=new iG(s.name),this.nameLbl.textSize=20,this.nameLbl.x=16,this.nameLbl.y=10,this.addChild(this.nameLbl),this.lvLbl=new iG("",16769126),this.lvLbl.textSize=16,this.lvLbl.x=16,this.lvLbl.y=38,this.addChild(this.lvLbl),this.effectLbl=new iG("",12303291),this.effectLbl.textSize=14,this.effectLbl.x=16,this.effectLbl.y=62,this.addChild(this.effectLbl),this.costLbl=new iG("",10066329),this.costLbl.textSize=13,this.costLbl.x=16,this.costLbl.y=88,this.addChild(this.costLbl),this.btn=new Nyi("레벨업",120,46,3042106),this.btn.x=i-136,this.btn.y=36,this.btn.onClick=()=>{ - var t; - Ryi.facLevelUp(this.fid)&&(null==(t=this.onChanged)||t.call(this))} - ,this.addChild(this.btn),this.refresh()} - refresh(){ - const t=Ryi,i=t.facLevel(this.fid),s=t.facGrade(this.fid); - this.lvLbl.text=`${ - s} - 등급 · Lv.${ - i} - `,this.lvLbl.textColor=Gyi(s),this.effectLbl.text=$yi(this.fid); - const e=t.facNextCost(this.fid); - if(!e)return this.costLbl.text="최대 레벨",void this.btn.setEnabled(!1); - this.costLbl.text="비용: "+e.map(i=>{ - const s=t.material(i.material_id); - return`${ - (null==s?void 0:s.name_ko)??i.material_id} - ×${ - i.qty} - (${ - t.materialQty(i.material_id)} - )`} - ).join(" "),this.btn.setEnabled(null===t.facLevelUpBlockReason(this.fid))} - } - ; - Qt(Hyi,"FacilityCard"); - let Wyi=Hyi; - const Vyi=class extends Ke{ - constructor(t,i){ - super(),Zt(this,"pointLbl"),Zt(this,"rows",[]); - const s=new iG("정복자 트리"); - s.textSize=22,s.x=16,s.y=8,this.addChild(s),this.pointLbl=new iG("",16769126),this.pointLbl.textSize=17,this.pointLbl.x=16,this.pointLbl.y=40,this.addChild(this.pointLbl); - const e=new iG("개척 포인트 = 지역 개척도 20/40/60/80/100% 달성 × 티어",10066329); - e.textSize=13,e.x=16,e.y=66,this.addChild(e); - for(let n=0; - n<kyi.length; - n++){ - const i=new zyi(kyi[n].id,t-32); - i.x=16,i.y=96+92*n,i.onChanged=()=>this.setData(),this.addChild(i),this.rows.push(i)} - } - setData(){ - this.pointLbl.text=`보유 ${ - Ryi.pointsAvailable()} - P · 누적 ${ - Ryi.pointsEarned()} - P`; - for(const t of this.rows)t.refresh()} - } - ; - Qt(Vyi,"ConquestPointView"); - let jyi=Vyi; - const Kyi=class extends Ke{ - constructor(t,i){ - super(),Zt(this,"nodeId"),Zt(this,"btn"),Zt(this,"stateLbl"),Zt(this,"onChanged",null),this.nodeId=t; - const s=kyi.find(i=>i.id===t),e=(new ep).roundRect(0,0,i,84,10).fill({ - color:1907997,alpha:.95} - ).stroke({ - width:2,color:5592405} - ); - this.addChild(e); - const n=new iG(s.name); - n.textSize=18,n.x=16,n.y=12,this.addChild(n); - const h=new iG(s.desc,12303291); - h.textSize=14,h.x=16,h.y=42,this.addChild(h),this.stateLbl=new iG("",8248189),this.stateLbl.textSize=15,this.stateLbl.x=i-250,this.stateLbl.y=14,this.addChild(this.stateLbl),this.btn=new Nyi(`배우기 ${ - s.cost} - P`,130,44,6048302),this.btn.x=i-146,this.btn.y=20,this.btn.onClick=()=>{ - var t; - Ryi.learnNode(this.nodeId)&&(null==(t=this.onChanged)||t.call(this))} - ,this.addChild(this.btn),this.refresh()} - refresh(){ - const t=Ryi.nodeLevel(this.nodeId)>=1; - this.btn.visible=!t,this.stateLbl.text=t?"✔ 배움":"",t||this.btn.setEnabled(null===Ryi.learnBlockReason(this.nodeId))} - } - ; - Qt(Kyi,"NodeRow"); - let zyi=Kyi; - const Yyi=class extends Ke{ - constructor(t,i){ - super(); - const s=new iG("상점"); - s.textSize=22,s.x=16,s.y=8,this.addChild(s); - const e=new iG("준비 중입니다",10066329); - e.textSize=17,e.x=16,e.y=48,this.addChild(e)} - setData(){ - } - } - ; - Qt(Yyi,"ConquestShopView"); - let qyi=Yyi; - const Xyi=class t extends Ke{ - constructor(t,i){ - super(),Zt(this,"viewW"),Zt(this,"capBar"),Zt(this,"grid",new Ke),Zt(this,"emptyLbl"),this.viewW=t; - const s=new iG("창고"); - s.textSize=22,s.x=16,s.y=8,this.addChild(s),this.capBar=new Dyi(t-32,22,8248189),this.capBar.x=16,this.capBar.y=42,this.addChild(this.capBar),this.emptyLbl=new iG("창고가 비었습니다 — 지역을 수확해 보세요",10066329),this.emptyLbl.textSize=15,this.emptyLbl.x=16,this.emptyLbl.y=84,this.addChild(this.emptyLbl),this.grid.x=16,this.grid.y=78,this.addChild(this.grid)} - setData(){ - const i=Ryi,s=i.inventoryTotal(),e=i.storageCap(); - this.capBar.setValue(s/e,`${ - s} - / ${ - e} - `),this.grid.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const n=i.inventory(); - this.emptyLbl.visible=0===n.length; - for(let h=0; - h<n.length; - h++){ - const{ - id:s,qty:e} - =n[h],r=i.material(s),o=new Ke,a=h%t.COLS,c=Math.floor(h/t.COLS); - o.x=a*(t.CELL_W+6),o.y=c*(t.CELL_H+6); - const l=(null==r?void 0:r.grade)??1,u=(new ep).roundRect(0,0,t.CELL_W,t.CELL_H,8).fill({ - color:1907997,alpha:.95} - ).stroke({ - width:2,color:Gyi(l)} - ); - o.addChild(u); - const d=new iG((null==r?void 0:r.name_ko)??`#${ - s} - `); - d.textSize=15,d.textColor=Gyi(l),d.x=10,d.y=8,o.addChild(d); - const f=new iG(`${ - e} - `,16777215); - f.textSize=16,f.x=10,f.y=34,o.addChild(f),this.grid.addChild(o)} - } - } - ; - Qt(Xyi,"ConquestStorageView"),Zt(Xyi,"COLS",4),Zt(Xyi,"CELL_W",146),Zt(Xyi,"CELL_H",64); - let Jyi=Xyi; - const Qyi=class t extends Ke{ - constructor(i){ - super(),Zt(this,"sheetW"),Zt(this,"bgG",new ep),Zt(this,"nameLbl"),Zt(this,"subLbl"),Zt(this,"exploreBar"),Zt(this,"pioneerBar"),Zt(this,"statusLbl"),Zt(this,"btnSurvey"),Zt(this,"btnExpedition"),Zt(this,"btnOutpost"),Zt(this,"btnHarvest"),Zt(this,"costLbl"),Zt(this,"region",null),Zt(this,"resultText",null),Zt(this,"resultUntil",0),Zt(this,"onStateChanged",null),this.sheetW=i,this.bgG.rect(0,0,i,t.HEIGHT).fill({ - color:1118481,alpha:.93} - ),this.bgG.eventMode="static",this.addChild(this.bgG),this.nameLbl=new iG(""),this.nameLbl.textSize=22,this.nameLbl.x=16,this.nameLbl.y=10,this.addChild(this.nameLbl),this.subLbl=new iG("",12303291),this.subLbl.textSize=14,this.subLbl.x=16,this.subLbl.y=40,this.addChild(this.subLbl); - const s=i-32; - this.exploreBar=new Dyi(s,20,7189490),this.exploreBar.x=16,this.exploreBar.y=64,this.addChild(this.exploreBar),this.pioneerBar=new Dyi(s,20,16769126),this.pioneerBar.x=16,this.pioneerBar.y=90,this.addChild(this.pioneerBar),this.statusLbl=new iG("",16769126),this.statusLbl.textSize=15,this.statusLbl.x=16,this.statusLbl.y=118,this.addChild(this.statusLbl); - const e=Math.floor((i-32-24)/4); - this.btnSurvey=new Nyi("탐사",e,46,3038315),this.btnExpedition=new Nyi("원정 출정",e,46,7027246),this.btnOutpost=new Nyi("전초기지",e,46,6048302),this.btnHarvest=new Nyi("수확",e,46,3042106); - const n=[this.btnSurvey,this.btnExpedition,this.btnOutpost,this.btnHarvest]; - for(let t=0; - t<n.length; - t++)n[t].x=16+t*(e+8),n[t].y=146,this.addChild(n[t]); - this.btnSurvey.onClick=()=>this.doSurvey(),this.btnExpedition.onClick=()=>this.doExpedition(),this.btnOutpost.onClick=()=>this.doOutpost(),this.btnHarvest.onClick=()=>this.doHarvest(),this.costLbl=new iG("",10066329),this.costLbl.textSize=13,this.costLbl.x=16,this.costLbl.y=200,this.addChild(this.costLbl),this.visible=!1} - now(){ - return Bx.time>0?Bx.time:Date.now()} - setRegion(t){ - this.region=t,this.resultText=null,this.visible=!!t,t&&this.refresh()} - onFrame(){ - this.visible&&this.region&&this.refresh()} - doSurvey(){ - var t; - this.region&&Ryi.startSurvey(this.region.id)&&(null==(t=this.onStateChanged)||t.call(this),this.refresh())} - doExpedition(){ - var t; - if(!this.region)return; - const i=Ryi.runExpedition(this.region.id); - i&&(this.resultText=i.win?`승리! 착륙지 확보 (전투력 ${ - i.power} - vs ${ - i.enemy} - )`:`패배… 원정대 회복 필요 (전투력 ${ - i.power} - vs ${ - i.enemy} - )`,this.resultUntil=this.now()+5e3,null==(t=this.onStateChanged)||t.call(this),this.refresh())} - doOutpost(){ - var t; - this.region&&Ryi.buildOutpost(this.region.id)&&(null==(t=this.onStateChanged)||t.call(this),this.refresh())} - doHarvest(){ - var t; - this.region&&Ryi.harvest(this.region.id)&&(this.resultText="수확 완료! 창고에 재료가 들어왔습니다",this.resultUntil=this.now()+3e3,null==(t=this.onStateChanged)||t.call(this),this.refresh())} - refresh(){ - const t=this.region; - if(!t)return; - const i=t.id,s=Ryi.book(i),e=Ryi,n=t.landmarks.length?"★":""; - this.nameLbl.text=`${ - n} - ${ - t.nameKo} - `,this.subLbl.text=`[${ - t.zoneCode} - ] ${ - t.biomeKo} - · ${ - t.tier} - 티어 · 구역 ${ - (null==s?void 0:s.subzones)??"?"} - 곳 · ${ - (null==s?void 0:s.terrain)??""} - `; - const h=e.explorePct(i),r=e.exploreCap(i); - this.exploreBar.setValue(h/100,e.encounterPending(i)?`탐사 ${ - h} - % — 적 발견!`:h>=100?"탐사 완료":`탐사 ${ - h} - % (다음 조우 ${ - r} - %)`); - const o=e.pioneerPct(i); - this.pioneerBar.setValue(o/100,`개척 ${ - o} - % (전초기지 ${ - e.outpostStage(i)} - /${ - (null==s?void 0:s.subzones)??"?"} - 단계)`),this.updateStatus(i),this.updateButtons(i)} - updateStatus(t){ - const i=Ryi; - if(this.resultText&&this.now()<this.resultUntil)return void(this.statusLbl.text=this.resultText); - this.resultText=null; - const s=i.surveyOf(t); - if(s){ - const t=(s.end-this.now())/1e3; - return void(this.statusLbl.text=`🎈 탐험대 조사 중… ${ - Byi(t)} - `)} - if(i.encounterPending(t)){ - const t=i.recoverRemainSec(); - return void(this.statusLbl.text=t>0?`⚔ 적 발견! 원정대 회복 중 ${ - Byi(t)} - `:"⚔ 탐험대가 적을 발견했습니다! 원정대를 보내 제압하세요")} - i.pioneerPct(t)>=100?this.statusLbl.text="✔ 완성 지역 — 매일 물자가 자동으로 도착합니다":null!==i.outpostBlockReason(t)?this.statusLbl.text="":this.statusLbl.text="🏕 착륙지 확보! 전초기지를 지을 수 있습니다"} - updateButtons(t){ - var i; - const s=Ryi,e=s.surveyBlockReason(t); - this.btnSurvey.setEnabled(!e),this.btnSurvey.label=e?"탐사":`탐사 ${ - Byi(s.surveySec(t))} - `; - const n=s.expeditionBlockReason(t); - this.btnExpedition.setEnabled(!n); - const h=s.outpostBlockReason(t); - this.btnOutpost.setEnabled(!h); - const r=(null==(i=s.book(t))?void 0:i.subzones)??1,o=Math.min(s.outpostStage(t)+1,r); - this.btnOutpost.label=`전초기지 ${ - o} - 단계`; - const a=s.harvestBlockReason(t); - this.btnHarvest.setEnabled(!a),this.btnHarvest.label=`수확 (일손${ - s.harvestLabor(t)} - )`; - const c=[]; - if("재료가 부족합니다"===h||null===h){ - const i=s.outpostCost(t).map(t=>{ - const i=s.material(t.material_id); - return`${ - (null==i?void 0:i.name_ko)??t.material_id} - ×${ - t.qty} - (${ - s.materialQty(t.material_id)} - )`} - ).join(" "); - c.push(`건설: ${ - i} - `)} - const l=[e,n,h,a].find(t=>t&&"제압할 조우가 없습니다"!==t&&"탐사 완료"!==t&&"전초기지 최대 단계"!==t); - l&&c.push(l),this.costLbl.text=c.join(" · ")} - } - ; - Qt(Qyi,"ConquestRegionSheet"),Zt(Qyi,"HEIGHT",236); - let Zyi=Qyi; - const tEi=class t extends Ke{ - constructor(t,i){ - super(),Zt(this,"viewW"),Zt(this,"viewH"),Zt(this,"mapLayer",new Ke),Zt(this,"revealLayer",new Ke),Zt(this,"revealSprites",new Map),Zt(this,"highlightSprite",null),Zt(this,"highlightTexture",null),Zt(this,"nameLabelsSprite",null),Zt(this,"landmarkLabelsSprite",null),Zt(this,"progressLabelsSprite",null),Zt(this,"balloonSprites",new Map),Zt(this,"balloonTexture",null),Zt(this,"fogSprite",null),Zt(this,"visibility",null),Zt(this,"onRegionSelected",null),Zt(this,"fitScale",1),Zt(this,"zoomIdx",0),Zt(this,"dragPointerId",-1),Zt(this,"dragStartX",0),Zt(this,"dragStartY",0),Zt(this,"layerStartX",0),Zt(this,"layerStartY",0),Zt(this,"dragMoved",0),this.viewW=t,this.viewH=i,this.addChild(this.mapLayer); - const s=(new ep).rect(0,0,t,i).fill(16777215); - this.addChild(s),this.mask=s,this.eventMode="static",this.hitArea=new $i(0,0,t,i),this.on("pointerdown",this.onPointerDown,this),this.on("pointermove",this.onPointerMove,this),this.on("pointerup",this.onPointerUp,this),this.on("pointerupoutside",this.onPointerUpOutside,this)} - async init(){ - const i="ktx2",s=Qt(t=>IS.getAssetPath(`conquest/${ - t} - ?v=${ - CS.appVersion} - `),"url"),[e,n]=await Promise.all([wd.load(s(`worldMapBaseMono.${ - i} - `)),wd.load(s(`regionBorderOverlay.${ - i} - `)),Oyi.ensureLoaded(),Ryi.ensureLoaded()]),h=new Xe(e),r=new Xe(n); - h.eventMode=r.eventMode="none",this.revealLayer.eventMode="none",this.mapLayer.addChild(h),this.mapLayer.addChild(this.revealLayer),this.mapLayer.addChild(r),this.buildNameLabels(),this.buildLandmarkLabels(),await Oyi.ensureArtPixels().catch(t=>{ - } - ),this.refreshFromState(!1); - const o=Math.max(this.viewH/Oyi.mapHeight,this.viewW/Oyi.mapWidth); - this.fitScale=o,this.mapLayer.scale.set(o*t.ZOOM_LEVELS[this.zoomIdx]); - const a=Oyi.getRegion(Oyi.startRegion); - a&&(this.mapLayer.x=this.viewW/2-a.centerPx[0]*o,this.mapLayer.y=this.viewH/2-a.centerPx[1]*o),this.clampPan()} - refreshFromState(t=!0){ - for(const i of Oyi.regions){ - const s=Ryi.pioneerPct(i.id),e=this.revealSprites.get(i.id); - if(s<=0){ - e&&(this.revealSprites.delete(i.id),e.texture.destroy(!0),e.destroy()); - continue} - const n=.15+s/100*.85; - e?e.alpha=n:this.addRevealSprite(i.id,n,t)} - this.rebuildFog(),this.buildProgressLabels(),this.syncBalloons()} - onPointerDown(t){ - -1===this.dragPointerId&&(this.dragPointerId=t.pointerId,this.dragStartX=t.globalX,this.dragStartY=t.globalY,this.layerStartX=this.mapLayer.x,this.layerStartY=this.mapLayer.y,this.dragMoved=0)} - onPointerMove(t){ - if(t.pointerId!==this.dragPointerId)return; - const i=t.globalX-this.dragStartX,s=t.globalY-this.dragStartY; - this.dragMoved=Math.max(this.dragMoved,Math.abs(i),Math.abs(s)); - const e=this.worldTransform.a||1; - this.mapLayer.x=this.layerStartX+i/e,this.mapLayer.y=this.layerStartY+s/e,this.clampPan()} - onPointerUp(i){ - i.pointerId===this.dragPointerId&&(this.dragPointerId=-1,this.dragMoved<t.TAP_THRESHOLD&&this.handleTap(i))} - onPointerUpOutside(t){ - t.pointerId===this.dragPointerId&&(this.dragPointerId=-1)} - clampPan(){ - const t=this.mapLayer.scale.x,i=Oyi.mapWidth*t,s=Oyi.mapHeight*t; - this.mapLayer.x=Math.min(0,Math.max(this.viewW-i,this.mapLayer.x)),this.mapLayer.y=Math.min(0,Math.max(this.viewH-s,this.mapLayer.y))} - handleTap(t){ - var i,s; - const e=this.mapLayer.toLocal(t.global),n=Oyi.getRegionIdAtMapPx(e.x,e.y); - let h=n>0?Oyi.getRegion(n)??null:null; - if(h&&this.fogEnabled){ - const t=null==(i=this.visibility)?void 0:i.get(h.id); - (void 0===t||t>=2)&&(h=null)} - h?this.showHighlight(h):this.clearHighlight(),null==(s=this.onRegionSelected)||s.call(this,h)} - showHighlight(i){ - const s=Oyi.buildRegionHighlight(i.id,t.HIGHLIGHT_FILL,t.HIGHLIGHT_OUTLINE,t.HIGHLIGHT_OUTLINE_W); - s&&(this.clearHighlight(),this.highlightTexture=ls.from(s.canvas),this.highlightSprite=new Xe(this.highlightTexture),this.highlightSprite.eventMode="none",this.highlightSprite.position.set(s.x,s.y),this.mapLayer.addChild(this.highlightSprite))} - clearHighlight(){ - this.highlightSprite&&(this.highlightSprite.destroy(),this.highlightSprite=null),this.highlightTexture&&(this.highlightTexture.destroy(!0),this.highlightTexture=null)} - buildNameLabels(){ - const t=document.createElement("canvas"); - t.width=Oyi.mapWidth,t.height=Oyi.mapHeight; - const i=t.getContext("2d"); - if(!i)return; - i.textAlign="center",i.textBaseline="middle",i.font="600 17px sans-serif",i.lineWidth=3,i.strokeStyle="rgba(40,28,16,0.85)",i.fillStyle="rgba(255,245,220,0.9)"; - for(const e of Oyi.regions)e.landmarks.length||(i.strokeText(e.nameKo,e.centerPx[0],e.centerPx[1]),i.fillText(e.nameKo,e.centerPx[0],e.centerPx[1])); - const s=new Xe(ls.from(t)); - s.eventMode="none",s.visible=this.namesVisible,this.mapLayer.addChild(s),this.nameLabelsSprite=s} - buildLandmarkLabels(){ - const t=document.createElement("canvas"); - t.width=Oyi.mapWidth,t.height=Oyi.mapHeight; - const i=t.getContext("2d"); - if(!i)return; - i.textAlign="center"; - for(const e of Oyi.regions)for(const t of e.landmarks)i.font="bold 24px sans-serif",i.lineWidth=5,i.strokeStyle="rgba(40,28,16,0.9)",i.strokeText("★",t.x,t.y),i.fillStyle="#ffe066",i.fillText("★",t.x,t.y),i.font="bold 21px sans-serif",i.lineWidth=4,i.strokeText(t.nameKo,t.x,t.y+24),i.fillStyle="#fff3c0",i.fillText(t.nameKo,t.x,t.y+24); - const s=new Xe(ls.from(t)); - s.eventMode="none",this.mapLayer.addChild(s),this.landmarkLabelsSprite=s} - buildProgressLabels(){ - const t=document.createElement("canvas"); - t.width=Oyi.mapWidth,t.height=Oyi.mapHeight; - const i=t.getContext("2d"); - if(!i)return; - i.textAlign="center",i.textBaseline="middle"; - for(const e of Oyi.regions){ - const t=Ryi.pioneerPct(e.id),s=Ryi.explorePct(e.id); - if(t<=0&&s<=0)continue; - const n=e.centerPx[1]+(e.landmarks.length?44:18); - t>0?(i.font="bold 19px sans-serif",i.lineWidth=4,i.strokeStyle="rgba(40,28,16,0.9)",i.strokeText(`${ - t} - %`,e.centerPx[0],n),i.fillStyle=t>=100?"#8ef08e":"#ffe066",i.fillText(`${ - t} - %`,e.centerPx[0],n)):(i.font="600 15px sans-serif",i.lineWidth=3,i.strokeStyle="rgba(40,28,16,0.85)",i.strokeText(`탐사 ${ - s} - %`,e.centerPx[0],n),i.fillStyle="#9fd8ef",i.fillText(`탐사 ${ - s} - %`,e.centerPx[0],n))} - const s=ls.from(t); - if(this.progressLabelsSprite){ - const t=this.progressLabelsSprite.texture; - this.progressLabelsSprite.texture=s,t.destroy(!0)} - else{ - const t=new Xe(s); - t.eventMode="none",this.mapLayer.addChild(t),this.progressLabelsSprite=t} - } - get namesVisible(){ - try{ - return"1"===localStorage.getItem(t.SHOW_NAMES_LS_KEY)} - catch{ - return!1} - } - setNamesVisible(i){ - this.nameLabelsSprite&&(this.nameLabelsSprite.visible=i); - try{ - localStorage.setItem(t.SHOW_NAMES_LS_KEY,i?"1":"0")} - catch{ - } - } - addRevealSprite(t,i,s){ - const e=Oyi.buildRegionColorReveal(t); - if(!e)return; - const n=new Xe(ls.from(e.canvas)); - if(n.eventMode="none",n.position.set(e.x,e.y),this.revealLayer.addChild(n),this.revealSprites.set(t,n),s){ - n.alpha=0; - const t=Qt(s=>{ - n.alpha=Math.min(i,n.alpha+s.deltaMS/600*i),(n.alpha>=i||n.destroyed)&&Mn.shared.remove(t)} - ,"tick"); - Mn.shared.add(t)} - else n.alpha=i} - getBalloonTexture(){ - if(!this.balloonTexture){ - const t=document.createElement("canvas"); - t.width=44,t.height=48; - const i=t.getContext("2d"); - i&&(i.textAlign="center",i.textBaseline="middle",i.font="36px sans-serif",i.fillText("🎈",22,24)),this.balloonTexture=ls.from(t)} - return this.balloonTexture} - syncBalloons(){ - const t=Ryi.activeSurveys(),i=new Set(t.map(t=>t.r)); - for(const[s,e]of this.balloonSprites)i.has(s)||(this.balloonSprites.delete(s),e.destroy()); - for(const s of t){ - if(this.balloonSprites.has(s.r))continue; - const t=Oyi.getRegion(s.r); - if(!t)continue; - const i=new Xe(this.getBalloonTexture()); - i.eventMode="none",i.anchor.set(.5,1),this.mapLayer.addChild(i),this.balloonSprites.set(s.r,i); - const e=t.neighbors.find(t=>Ryi.outpostStage(t)>=1),n=e?Oyi.getRegion(e):null,h=t.centerPx[0],r=t.centerPx[1]-6; - if(n){ - const t=n.centerPx[0],s=n.centerPx[1]-6; - i.position.set(t,s); - let e=0; - const o=900,a=Qt(n=>{ - e+=n.deltaMS; - const c=Math.min(1,e/o),l=1-(1-c)*(1-c); - i.x=t+(h-t)*l,i.y=s+(r-s)*l-40*Math.sin(c*Math.PI),(c>=1||i.destroyed)&&Mn.shared.remove(a)} - ,"tick"); - Mn.shared.add(a)} - else{ - i.position.set(h,r),i.alpha=0; - const t=Qt(s=>{ - i.alpha=Math.min(1,i.alpha+s.deltaMS/400),(i.alpha>=1||i.destroyed)&&Mn.shared.remove(t)} - ,"tick"); - Mn.shared.add(t)} - } - } - get zoomPercent(){ - return 100*t.ZOOM_LEVELS[this.zoomIdx]} - cycleZoom(){ - return this.zoomIdx=(this.zoomIdx+1)%t.ZOOM_LEVELS.length,this.applyZoom(),this.zoomPercent} - applyZoom(){ - const i=this.mapLayer.scale.x,s=this.fitScale*t.ZOOM_LEVELS[this.zoomIdx],e=(this.viewW/2-this.mapLayer.x)/i,n=(this.viewH/2-this.mapLayer.y)/i; - this.mapLayer.scale.set(s),this.mapLayer.x=this.viewW/2-e*s,this.mapLayer.y=this.viewH/2-n*s,this.clampPan()} - rebuildFog(){ - const t=Ryi.outpostRegions(); - t.includes(Oyi.startRegion)||t.push(Oyi.startRegion); - const i=Oyi.computeVisibility(t,2); - this.visibility=i; - const s=Oyi.buildFogCanvas(i); - if(!s)return; - const e=ls.from(s); - if(this.fogSprite){ - const t=this.fogSprite.texture; - this.fogSprite.texture=e,t.destroy(!0)} - else{ - const t=new Xe(e); - t.eventMode="none",this.mapLayer.addChild(t),this.fogSprite=t} - this.fogSprite.width=Oyi.mapWidth,this.fogSprite.height=Oyi.mapHeight,this.fogSprite.visible=this.fogEnabled} - get fogEnabled(){ - try{ - return"0"!==localStorage.getItem(t.FOG_LS_KEY)} - catch{ - return!0} - } - setFogEnabled(i){ - this.fogSprite&&(this.fogSprite.visible=i); - try{ - localStorage.setItem(t.FOG_LS_KEY,i?"1":"0")} - catch{ - } - } - } - ; - Qt(tEi,"ConquestWorldMapView"),Zt(tEi,"SHOW_NAMES_LS_KEY","ef2.conquest.demo.showNames"),Zt(tEi,"FOG_LS_KEY","ef2.conquest.demo.fog"),Zt(tEi,"HIGHLIGHT_FILL",[255,228,110,90]),Zt(tEi,"HIGHLIGHT_OUTLINE",[255,242,160,255]),Zt(tEi,"HIGHLIGHT_OUTLINE_W",3),Zt(tEi,"ZOOM_LEVELS",[1,1.5,2]),Zt(tEi,"TAP_THRESHOLD",8); - let iEi=tEi; - const sEi=class extends Ke{ - constructor(t,i){ - super(),Zt(this,"viewW"),Zt(this,"viewH"),Zt(this,"mapView",null),Zt(this,"sheet"),Zt(this,"loadingLbl"),Zt(this,"btnZoom",new Ke),Zt(this,"btnZoomBg",new ep),Zt(this,"btnZoomLbl"),Zt(this,"btnFog",new Ke),Zt(this,"btnFogBg",new ep),Zt(this,"btnFogLbl"),Zt(this,"btnNames",new Ke),Zt(this,"btnNamesBg",new ep),Zt(this,"btnNamesLbl"),Zt(this,"initPromise",null),Zt(this,"onStateChanged",null),this.viewW=t,this.viewH=i,this.loadingLbl=new iG("월드맵 불러오는 중...",16769126),this.loadingLbl.x=20,this.loadingLbl.y=20,this.addChild(this.loadingLbl),this.sheet=new Zyi(t),this.sheet.y=i-Zyi.HEIGHT,this.sheet.onStateChanged=()=>{ - var t,i; - null==(t=this.mapView)||t.refreshFromState(),null==(i=this.onStateChanged)||i.call(this)} - ,this.btnZoomLbl=this.buildFloatBtn(this.btnZoom,this.btnZoomBg,"100%"),this.btnFogLbl=this.buildFloatBtn(this.btnFog,this.btnFogBg,"안개"),this.btnNamesLbl=this.buildFloatBtn(this.btnNames,this.btnNamesBg,"지역명"); - const s=i-Zyi.HEIGHT-52; - this.btnZoom.position.set(t-92,s),this.btnFog.position.set(t-92-84,s),this.btnNames.position.set(t-92-168,s),this.btnZoom.on("pointerup",this.onZoomToggle,this),this.btnFog.on("pointerup",this.onFogToggle,this),this.btnNames.on("pointerup",this.onNamesToggle,this)} - buildFloatBtn(t,i,s){ - i.roundRect(0,0,76,40,10).fill({ - color:2236962,alpha:.85} - ).stroke({ - width:2,color:16769126} - ),t.addChild(i); - const e=new iG(s); - return e.textSize=15,e.x=Math.round(.5*(76-e.width)),e.y=10,t.addChild(e),t.eventMode="static",t.cursor="pointer",t.visible=!1,this.addChild(t),e} - setData(){ - this.init()} - init(){ - return this.initPromise||(this.initPromise=this.initInternal().catch(t=>{ - throw this.loadingLbl.text="월드맵 로딩 실패",this.loadingLbl.visible=!0,this.initPromise=null,t} - )),this.initPromise} - async initInternal(){ - const t=new iEi(this.viewW,this.viewH); - await t.init(),t.onRegionSelected=this.onRegionSelected.bind(this),this.addChildAt(t,0),this.mapView=t,this.loadingLbl.visible=!1,this.addChild(this.sheet),this.btnZoom.visible=this.btnFog.visible=this.btnNames.visible=!0,this.updateFogBtn(),this.updateNamesBtn(),t.refreshFromState(!1)} - refresh(){ - var t; - null==(t=this.mapView)||t.refreshFromState(!1),this.sheet.onFrame()} - onFrame(t){ - var i; - t&&(null==(i=this.mapView)||i.refreshFromState()),this.sheet.onFrame()} - onRegionSelected(t){ - this.sheet.setRegion(t)} - onZoomToggle(){ - this.mapView&&(this.btnZoomLbl.text=`${ - this.mapView.cycleZoom()} - %`,this.btnZoomLbl.x=Math.round(.5*(76-this.btnZoomLbl.width)))} - onFogToggle(){ - this.mapView&&(this.mapView.setFogEnabled(!this.mapView.fogEnabled),this.updateFogBtn())} - updateFogBtn(){ - var t; - const i=(null==(t=this.mapView)?void 0:t.fogEnabled)??!0; - this.btnFogLbl.textColor=i?16769126:10066329} - onNamesToggle(){ - this.mapView&&(this.mapView.setNamesVisible(!this.mapView.namesVisible),this.updateNamesBtn())} - updateNamesBtn(){ - var t; - const i=(null==(t=this.mapView)?void 0:t.namesVisible)??!1; - this.btnNamesLbl.textColor=i?16769126:10066329} - } - ; - Qt(sEi,"ConquestWorldMapTabView"); - let eEi=sEi; - const nEi=class t extends YXt{ - constructor(){ - super(),Zt(this,"headerBg"),Zt(this,"titleLbl"),Zt(this,"pointLbl"),Zt(this,"laborLbl"),Zt(this,"tabButtons",[]),Zt(this,"viewContainer",new Ke),Zt(this,"views",[null,null,null,null,null]),Zt(this,"_activeIndex",-1),Zt(this,"contentH"),Zt(this,"lastFrameMs",0),this.y=0,this.bg.height=SS.safeHeight,this.dimOverlay.y=0,this.contentH=this.bg.height-t.HEADER_H-t.TAB_HEIGHT,this.headerBg=(new ep).rect(0,0,640,t.HEADER_H).fill({ - color:1118481,alpha:.92} - ),this.headerBg.eventMode="none",this.addChild(this.headerBg),this.titleLbl=new iG("정복"),this.titleLbl.textSize=22,this.titleLbl.x=14,this.titleLbl.y=SS.RESOURCE_INFO_H+12,this.addChild(this.titleLbl),this.pointLbl=new iG("",16769126),this.pointLbl.textSize=15,this.pointLbl.x=110,this.pointLbl.y=SS.RESOURCE_INFO_H+18,this.addChild(this.pointLbl),this.laborLbl=new iG("",8248189),this.laborLbl.textSize=15,this.laborLbl.x=300,this.laborLbl.y=SS.RESOURCE_INFO_H+18,this.addChild(this.laborLbl),this.btnClose.x=640-this.btnClose.width-4,this.btnClose.y=SS.RESOURCE_INFO_H+2,this.addChild(this.btnClose),this.viewContainer.y=t.HEADER_H,this.addChild(this.viewContainer); - const i=["월드맵","시설","포인트","창고","상점"],s=t.TAB_WIDTH*t.NUM_TABS+t.TAB_GAP*(t.NUM_TABS-1),e=Math.floor(.5*(this.bg.width-s)),n=this.bg.height-t.TAB_HEIGHT; - for(let h=0; - h<i.length; - h++){ - const s=new Gqt(i[h],t.TAB_WIDTH); - s.autoResize=!1,s.width=t.TAB_WIDTH,s.height=t.TAB_HEIGHT,s.x=e+h*(t.TAB_WIDTH+t.TAB_GAP),s.y=n,s.index=h,s.onClick=()=>this.selectTab(h),this.addChild(s),this.tabButtons.push(s)} - } - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - show(){ - this.show2(),Ryi.ensureLoaded().then(()=>{ - Ryi.onChanged=()=>this.updateHeader(),this._activeIndex<0?this.selectTab(0):this.refreshActive(),this.updateHeader()} - )} - onAdded(){ - super.onAdded(),wE.getInstance().add(this.onUiFrame,this)} - onRemoved(){ - super.onRemoved(),wE.getInstance().remove(this.onUiFrame,this)} - selectTab(t){ - var i; - if(this._activeIndex===t)return; - this._activeIndex=t; - for(let e=0; - e<this.tabButtons.length; - e++)this.tabButtons[e].selected=e===t; - if(!this.views[t]){ - const i=640,s=this.contentH; - switch(t){ - case 0:{ - const t=new eEi(i,s); - t.onStateChanged=()=>this.updateHeader(),this.views[0]=t; - break} - case 1:this.views[1]=new Fyi(i,s); - break; - case 2:this.views[2]=new jyi(i,s); - break; - case 3:this.views[3]=new Jyi(i,s); - break; - case 4:this.views[4]=new qyi(i,s)} - } - this.viewContainer.removeChildren(); - const s=this.views[t]; - this.viewContainer.addChild(s),null==(i=s.setData)||i.call(s),this.updateHeader()} - refreshActive(){ - var t; - const i=this.views[this._activeIndex]; - null==(t=null==i?void 0:i.setData)||t.call(i)} - onUiFrame(){ - const t=performance.now(); - if(t-this.lastFrameMs<300)return; - this.lastFrameMs=t; - const i=Ryi.tick(); - this.updateHeader(); - const s=this.views[this._activeIndex]; - s instanceof eEi?s.onFrame(i):i&&this.refreshActive()} - updateHeader(){ - this.pointLbl.text=`개척 P ${ - Ryi.pointsAvailable()} - `,this.laborLbl.text=`일손 ${ - Ryi.labor()} - /${ - Ryi.laborMax()} - `} - get className(){ - return"ConquestPopup"} - } - ; - Qt(nEi,"ConquestPopup"),Zt(nEi,"_instance"),Zt(nEi,"HEADER_H",96),Zt(nEi,"TAB_HEIGHT",60),Zt(nEi,"TAB_GAP",1),Zt(nEi,"NUM_TABS",5),Zt(nEi,"TAB_WIDTH",Math.floor((640-nEi.TAB_GAP*nEi.NUM_TABS)/nEi.NUM_TABS)); - let hEi=nEi; - const rEi=Object.freeze(Object.defineProperty({ - __proto__:null,ConquestPopup:hEi} - ,Symbol.toStringTag,{ - value:"Module"} - )),oEi={ - } - ,aEi={ - } - ; - function cEi(t,i){ - if(void 0!==i){ - const s=`${ - t} - _${ - i} - `; - if(aEi[s])return aEi[s]} - return oEi[t]?oEi[t]:null} - Qt(cEi,"getPgsAchievementId"); - const lEi=Object.freeze(Object.defineProperty({ - __proto__:null,PGS_ACHIEVEMENT_MAP:oEi,PGS_ACHIEVEMENT_MAP_DETAIL:aEi,getPgsAchievementId:cEi} - ,Symbol.toStringTag,{ - value:"Module"} - )),uEi=class extends Ke{ - constructor(){ - super(),Zt(this,"sp"),Zt(this,"_showed",!1),Zt(this,"_frame",0),Zt(this,"_incFrame",.6),this.sp=new wp(RS.getTextures("UI_Archery","ArrowHit")),this.addChild(this.sp)} - show(){ - 1!=this._showed&&(this._showed=!0,this._frame=0,wE.getInstance().add(this.onFrame,this))} - onFrame(){ - this._frame+=this._incFrame,Math.floor(this._frame)>32&&(this._frame=32,this.hide()),this.sp.gotoAndStop(Math.floor(this._frame))} - hide(){ - 0!=this._showed&&(this._showed=!1,wE.getInstance().remove(this.onFrame,this))} - } - ; - Qt(uEi,"ArcheryStuckArrow"); - let dEi=uEi; - const fEi=class t extends Ke{ - constructor(){ - super(),Zt(this,"spTarget"),Zt(this,"stuckArrows",new Ke),Zt(this,"speed",0),Zt(this,"_showed",!1),Zt(this,"_frame",0),Zt(this,"_incFrame",.6),this.spTarget=new wp(RS.getTextures("UI_Archery","ArcheryTarget")),this.addChild(this.spTarget),this.addChild(this.stuckArrows)} - show(){ - 1!=this._showed&&(this._showed=!0,this._frame=0,wE.getInstance().add(this.onFrame,this))} - onFrame(){ - this._frame+=this._incFrame,Math.floor(this._frame)>7&&(this._frame=0),this.spTarget.gotoAndStop(Math.floor(this._frame))} - hide(){ - 0!=this._showed&&(this._showed=!1,wE.getInstance().remove(this.onFrame,this))} - checkHit(i,s){ - const e=t.ZONE_COUNT,n=t.ZONE_WIDTH,h=t.TARGET_DEPTH,r=h/e; - if(s<0||s>h)return null; - const o=Math.abs(i); - for(let t=e-1; - t>=0; - t--)if(!(s>(t+1)*r)&&o<=(e-t)*n)return{ - score:t+1,stickY:(t+.5)*r} - ; - return null} - stickArrow(t,i){ - const s=new dEi; - s.x=t,s.y=i,this.stuckArrows.addChild(s),s.show()} - clearArrows(){ - this.stuckArrows.removeChildren()} - getTotalHalfWidth(){ - return t.TOTAL_HALF_WIDTH} - getDepth(){ - return t.TARGET_DEPTH} - } - ; - Qt(fEi,"Archery2Target"),Zt(fEi,"ZONE_COUNT",7),Zt(fEi,"ZONE_WIDTH",14),Zt(fEi,"TOTAL_HALF_WIDTH",fEi.ZONE_WIDTH*fEi.ZONE_COUNT),Zt(fEi,"TARGET_DEPTH",50); - let pEi=fEi; - const wEi=class extends Ke{ - constructor(){ - super(),Zt(this,"spBow"),Zt(this,"textures"),Zt(this,"idleFrames"),Zt(this,"readyFrames"),Zt(this,"fireFrames"),Zt(this,"readyRepeatStart",0),Zt(this,"startFrame",0),Zt(this,"endFrame",0),Zt(this,"currentFrame",0),Zt(this,"loop",!0),Zt(this,"state","IDLE"),Zt(this,"_showed",!1),Zt(this,"_incFrame",.6),this.textures=RS.getTextures("UI_Archery","ArcheryBow"),this.spBow=new Xe(this.textures[0]),this.addChild(this.spBow),this.readyFrames=new UH(0,45),this.fireFrames=new UH(46,53),this.idleFrames=new UH(54,89),this.startFrame=this.idleFrames.start,this.endFrame=this.idleFrames.end,this.currentFrame=this.startFrame} - gotoIdleState(){ - this.state="IDLE",this.startFrame=this.idleFrames.start,this.endFrame=this.idleFrames.end,this.currentFrame=this.startFrame,this.loop=!1} - gotoRreayState(){ - this.state="READY",this.startFrame=this.readyFrames.start,this.endFrame=this.readyFrames.end,this.currentFrame=this.startFrame,this.readyRepeatStart=10,this.loop=!0} - gotoFireState(){ - this.state="FIRE",this.startFrame=this.fireFrames.start,this.endFrame=this.fireFrames.end,this.currentFrame=this.startFrame,this.loop=!1} - show(){ - 1!=this._showed&&(this._showed=!0,this.currentFrame=0,wE.getInstance().add(this.onFrame,this))} - onFrame(){ - this.currentFrame+=this._incFrame,this.currentFrame>=this.endFrame&&(this.loop?"READY"==this.state?this.currentFrame=this.readyRepeatStart:this.currentFrame=this.startFrame:this.currentFrame=this.endFrame),this.spBow.texture=this.textures[Math.floor(this.currentFrame)]} - hide(){ - 0!=this._showed&&(this._showed=!1,wE.getInstance().remove(this.onFrame,this))} - } - ; - Qt(wEi,"ArcheryBow"); - let gEi=wEi; - const mEi=class t extends Ke{ - constructor(){ - super(),Zt(this,"arrow"),Zt(this,"active",!1),this.arrow=new Xe(RS.getTexture("UI_Archery","Arrow")),this.addChild(this.arrow),this.visible=!1} - fire(t,i){ - this.x=t,this.y=i,this.visible=!0,this.active=!0} - update(){ - this.active&&(this.y-=t.SPEED)} - deactivate(){ - this.active=!1,this.visible=!1} - } - ; - Qt(mEi,"Archery2Arrow"),Zt(mEi,"SPEED",12); - let vEi=mEi; - const _Ei=class t extends Ke{ - constructor(){ - super(),Zt(this,"target",new pEi),Zt(this,"arrow",new vEi),Zt(this,"gameArea",new Ke),Zt(this,"map"),Zt(this,"bow",new gEi),Zt(this,"lblRound"),Zt(this,"lblScore"),Zt(this,"lblCombo"),Zt(this,"lblMessage"),Zt(this,"currentRound",0),Zt(this,"totalScore",0),Zt(this,"consecutivePerfect",0),Zt(this,"isPlaying",!1),Zt(this,"canShoot",!1),Zt(this,"isArrowFlying",!1),Zt(this,"roundHit",!1),Zt(this,"waitingForExit",!1),Zt(this,"roundResults",[]),Zt(this,"onGameEnd",null),Zt(this,"hitChecked",!1),this.lblRound=new pg({ - text:"",style:{ - ...hD.DEFAULT_OUTLINE_FONT_OPTION_16,fill:16777215} - } - ),this.lblScore=new pg({ - text:"",style:{ - ...hD.DEFAULT_OUTLINE_FONT_OPTION_20,fill:16766720} - } - ),this.lblCombo=new pg({ - text:"",style:{ - ...hD.DEFAULT_OUTLINE_FONT_OPTION_16,fill:16737792} - } - ),this.lblMessage=new pg({ - text:"",style:{ - ...hD.DEFAULT_OUTLINE_FONT_OPTION_20,fill:16777215} - } - ),this.setup()} - setup(){ - this.map=new Xe(RS.getTexture("UI_Archery","Bg")),this.addChild(this.map),this.addChild(this.gameArea),this.bow.x=.5*t.SCENE_WIDTH,this.bow.y=t.ARCHER_Y,this.gameArea.addChild(this.bow),this.bow.show(),this.target.x=.5*t.SCENE_WIDTH,this.target.y=t.TARGET_Y,this.gameArea.addChild(this.target),this.target.show(),this.gameArea.addChild(this.arrow),this.lblRound.x=15,this.lblRound.y=10,this.addChild(this.lblRound),this.lblScore.x=t.SCENE_WIDTH-15,this.lblScore.y=10,this.lblScore.anchor.set(1,0),this.addChild(this.lblScore),this.lblCombo.x=.5*t.SCENE_WIDTH,this.lblCombo.y=t.TARGET_Y+130,this.lblCombo.anchor.set(.5),this.addChild(this.lblCombo),this.lblMessage.x=.5*t.SCENE_WIDTH,this.lblMessage.y=.5*t.SCENE_HEIGHT,this.lblMessage.anchor.set(.5),this.addChild(this.lblMessage)} - startGame(){ - this.currentRound=0,this.totalScore=0,this.consecutivePerfect=0,this.roundResults=[],this.isPlaying=!0,this.canShoot=!1,this.isArrowFlying=!1,this.roundHit=!1,this.waitingForExit=!1,this.lblCombo.text="",this.updateScoreUI(),wE.getInstance().add(this.onTick,this),this.startNextRound()} - stopGame(){ - this.isPlaying=!1,this.canShoot=!1,wE.getInstance().remove(this.onTick,this),this.arrow.deactivate()} - startNextRound(){ - if(this.currentRound++,this.currentRound>t.TOTAL_ROUNDS)return void this.endGame(); - this.updateRoundUI(); - const i=this.target.getTotalHalfWidth(); - this.target.x=t.SCENE_WIDTH+i,this.target.y=t.TARGET_Y,this.target.visible=!0,this.target.alpha=1,this.target.clearArrows(),this.target.speed=t.TARGET_MIN_SPEED+Math.random()*(t.TARGET_MAX_SPEED-t.TARGET_MIN_SPEED)+.3*(this.currentRound-1),this.bow.gotoRreayState(),this.arrow.deactivate(),this.isArrowFlying=!1,this.roundHit=!1,this.waitingForExit=!1,this.canShoot=!0} - endGame(){ - this.isPlaying=!1,this.canShoot=!1,wE.getInstance().remove(this.onTick,this); - const t=this.roundResults.filter(t=>7===t.score).length,i={ - totalScore:this.totalScore,rounds:this.roundResults,perfectCount:t} - ; - this.showResultMessage(),this.reset(),this.onGameEnd&&this.onGameEnd(i)} - showResultMessage(){ - this.lblMessage.text=`게임 종료!\n총점: ${ - this.totalScore} - `,this.lblMessage.alpha=0,yx.to(this.lblMessage,{ - alpha:1,duration:.5} - )} - shoot(){ - this.isPlaying&&this.canShoot&&!this.isArrowFlying&&(this.canShoot=!1,this.isArrowFlying=!0,this.hitChecked=!1,this.bow.gotoFireState(),QG.getInstance().playSFX(QG.SFX_ARCHERY_FIRE_ARROW),this.arrow.fire(.5*t.SCENE_WIDTH,t.ARCHER_Y-25))} - onTick(){ - this.isPlaying&&(this.updateTarget(),this.updateArrow())} - updateTarget(){ - if(!this.target.visible)return; - this.target.x-=this.target.speed; - const t=this.target.getTotalHalfWidth(); - this.target.x<-t&&(this.target.visible=!1,this.waitingForExit?(this.waitingForExit=!1,this.startNextRound()):this.isArrowFlying||this.onMiss())} - updateArrow(){ - if(this.arrow.active){ - if(this.arrow.update(),this.target.visible&&!this.hitChecked&&this.arrow.y<=this.target.y){ - this.hitChecked=!0; - const t=this.arrow.x-this.target.x,i=this.getScore(t); - if(i>0)return this.arrow.deactivate(),this.isArrowFlying=!1,void this.onHit(i,t,0)} - this.arrow.y<-30&&(this.arrow.deactivate(),this.isArrowFlying=!1,this.roundHit||(this.target.visible&&(this.waitingForExit=!0),this.onMiss()))} - } - getScore(i){ - const s=Math.abs(i),e=t.TARGET_RADII; - for(let t=0; - t<e.length; - t++)if(s<=e[t])return e.length-t; - return 0} - onHit(t,i,s){ - QG.getInstance().playSFX(QG.SFX_ARCHERY_HIT_ON_TARGET),this.target.stickArrow(i,s),this.roundHit=!0; - let e=0; - 7===t?(this.consecutivePerfect++,this.consecutivePerfect>=2&&(e=this.consecutivePerfect-1)):this.consecutivePerfect=0,this.totalScore+=t+e,this.roundResults.push({ - round:this.currentRound,score:t,combo:this.consecutivePerfect,bonusScore:e} - ),this.showHitEffect(t,e),this.updateScoreUI(),this.waitingForExit=!0} - onMiss(){ - this.roundHit||(this.consecutivePerfect=0,this.roundResults.push({ - round:this.currentRound,score:0,combo:0,bonusScore:0} - ),this.showMissEffect(),this.updateScoreUI(),this.arrow.deactivate(),this.isArrowFlying=!1,this.target.visible?this.waitingForExit=!0:this.startNextRound())} - updateRoundUI(){ - this.lblRound.text=`Round ${ - this.currentRound} - / ${ - t.TOTAL_ROUNDS} - `} - updateScoreUI(){ - this.lblScore.text=`Score: ${ - this.totalScore} - `} - showHitEffect(t,i){ - let s=NB.getValueReplace("GAME_814","##",t,`${ - t} - 점`)+"!"; - 7===t&&(s="★ PERFECT! "+NB.getValueReplace("GAME_814","##",7,"7점")+"!"),i>0&&(s+=" "+NB.getText("GAME_816","보너스")+` +${ - i} - `),this.consecutivePerfect>=2&&(this.lblCombo.text=NB.getValueReplace("GAME_815","##",this.consecutivePerfect,`${ - this.consecutivePerfect} - 연속 콤보`)+"!",this.lblCombo.alpha=1,yx.to(this.lblCombo,{ - alpha:0,duration:1.5,delay:.5} - )),this.lblMessage.text=s,this.lblMessage.alpha=1,this.lblMessage.scale.set(1.3),yx.to(this.lblMessage,{ - alpha:0,duration:.8,delay:.3} - ),yx.to(this.lblMessage.scale,{ - x:1,y:1,duration:.3} - )} - showMissEffect(){ - this.lblMessage.text="MISS!",this.lblMessage.alpha=1,this.lblMessage.style.fill=16729156,yx.to(this.lblMessage,{ - alpha:0,duration:.8,delay:.3,onComplete:Qt(()=>{ - this.lblMessage.style.fill=16777215} - ,"onComplete")} - )} - reset(){ - this.stopGame(),this.currentRound=0,this.totalScore=0,this.consecutivePerfect=0,this.roundResults=[],this.roundHit=!1,this.waitingForExit=!1,this.target.visible=!0,this.target.x=.5*t.SCENE_WIDTH,this.target.clearArrows(),this.bow.gotoIdleState(),this.arrow.deactivate(),this.lblRound.text="",this.lblScore.text="",this.lblCombo.text="",this.lblMessage.text=""} - destroy(){ - this.stopGame(),super.destroy({ - children:!0} - )} - } - ; - Qt(_Ei,"Archery2GameScene"),Zt(_Ei,"SCENE_WIDTH",550),Zt(_Ei,"SCENE_HEIGHT",738),Zt(_Ei,"TOTAL_ROUNDS",7),Zt(_Ei,"TARGET_Y",140),Zt(_Ei,"ARCHER_Y",620),Zt(_Ei,"TARGET_MIN_SPEED",1),Zt(_Ei,"TARGET_MAX_SPEED",3),Zt(_Ei,"TARGET_RADII",[5,11,17,24,30,37,43]); - let MEi=_Ei; - const bEi=class t extends kx{ - constructor(){ - super(),Zt(this,"bg"),Zt(this,"lblScore",new iG("",hD.COLOR_BRIGHT_ORANGE,hD.DEFAULT_OUTLINE_FONT_OPTION_16)),Zt(this,"iconGem"),Zt(this,"lblGem",new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_16)),Zt(this,"iconHonor"),Zt(this,"lblHonor",new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_16)),Zt(this,"iconGuild"),Zt(this,"lblGuild",new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_16)); - const i=t.ITEM_WIDTH,s=t.ITEM_HEIGHT,e=t.ICON_SIZE,n=.5*(s-this.lblScore.height),h=.5*(s-e); - this.bg=new hE({ - texture:RS.getTexture("UI_Ekkorr","Popup_List_02"),leftWidth:140,topHeight:30,rightWidth:20,bottomHeight:30} - ),this.bg.width=i,this.bg.height=s,this.addChild(this.bg),this.lblScore.x=t.COL_SCORE_X,this.lblScore.y=n,this.addChild(this.lblScore),this.iconGem=new Xe(RS.getTexture("UI_Ekkorr","UI_GEM_ICON")),this.iconGem.width=e,this.iconGem.height=e,this.iconGem.x=t.COL_GEM_X,this.iconGem.y=h,this.addChild(this.iconGem),this.lblGem.x=this.iconGem.x+e+t.LABEL_GAP,this.lblGem.y=n,this.addChild(this.lblGem),this.iconHonor=new Xe(RS.getTexture("UI_Ekkorr","PVP_COIN_ON")),this.iconHonor.width=e,this.iconHonor.height=e,this.iconHonor.x=t.COL_HONOR_X,this.iconHonor.y=h,this.addChild(this.iconHonor),this.lblHonor.x=this.iconHonor.x+e+t.LABEL_GAP,this.lblHonor.y=n,this.addChild(this.lblHonor),this.iconGuild=new Xe(RS.getTexture("UI_Ekkorr","GUILD_COIN")),this.iconGuild.width=e,this.iconGuild.height=e,this.iconGuild.x=t.COL_GUILD_X,this.iconGuild.y=h,this.addChild(this.iconGuild),this.lblGuild.x=this.iconGuild.x+e+t.LABEL_GAP,this.lblGuild.y=n,this.addChild(this.lblGuild)} - setData(t){ - this.data=t,t&&(this.lblScore.text=t.scoreLabel,this.lblGem.text=String(t.gem),this.lblHonor.text=String(t.honor),this.lblGuild.text=String(t.guild))} - get height(){ - return t.ITEM_HEIGHT+2} - static get scoreX(){ - return t.COL_SCORE_X} - static get gemX(){ - return t.COL_GEM_X} - static get honorX(){ - return t.COL_HONOR_X} - static get guildX(){ - return t.COL_GUILD_X} - } - ; - Qt(bEi,"ArcheryRewardItemRenderer"),Zt(bEi,"ITEM_WIDTH",520),Zt(bEi,"ITEM_HEIGHT",48),Zt(bEi,"COL_SCORE_X",20),Zt(bEi,"COL_GEM_X",175),Zt(bEi,"COL_HONOR_X",300),Zt(bEi,"COL_GUILD_X",415),Zt(bEi,"ICON_SIZE",22),Zt(bEi,"LABEL_GAP",6); - let yEi=bEi; - const EEi=class t extends XU{ - constructor(){ - super(),Zt(this,"tapDesc"),Zt(this,"tapReward"),Zt(this,"descContainer"),Zt(this,"markerText"),Zt(this,"rewardContainer"),Zt(this,"lblHdrScore"),Zt(this,"lblHdrGem"),Zt(this,"lblHdrHonor"),Zt(this,"lblHdrGuild"),Zt(this,"rewardList"),this.height=t.POPUP_HEIGHT,this.tapDesc=new Gqt(NB.getText("GAME_578","기본설명"),200),this.tapDesc.x=30,this.tapDesc.y=t.TAB_Y,this.tapDesc.selected=!0,this.tapDesc.onClick=this.onDescTap.bind(this),this.contentContainer.addChild(this.tapDesc),this.tapReward=new Gqt(NB.getText("COMMON_22","보상"),200),this.tapReward.x=this.tapDesc.x+this.tapDesc.width+4,this.tapReward.y=this.tapDesc.y,this.tapReward.onClick=this.onRewardTap.bind(this),this.contentContainer.addChild(this.tapReward),this.descContainer=new Ke,this.contentContainer.addChild(this.descContainer),this.markerText=new VU("@",this.width-80,16,hD.DEFAULT_COLOR,8,10,16763904),this.markerText.x=30,this.markerText.y=t.CONTENT_Y,this.descContainer.addChild(this.markerText),this.rewardContainer=new Ke,this.rewardContainer.visible=!1,this.contentContainer.addChild(this.rewardContainer); - const i=hD.DEFAULT_OUTLINE_FONT_OPTION_16; - this.lblHdrScore=new iG("",8947848,i),this.lblHdrGem=new iG("",8947848,i),this.lblHdrHonor=new iG("",8947848,i),this.lblHdrGuild=new iG("",8947848,i),this.rewardContainer.addChild(this.lblHdrScore),this.rewardContainer.addChild(this.lblHdrGem),this.rewardContainer.addChild(this.lblHdrHonor),this.rewardContainer.addChild(this.lblHdrGuild),this.rewardList=new Ox(yEi,yEi.ITEM_WIDTH,t.LIST_HEIGHT,2),this.rewardList.x=t.REWARD_LIST_X,this.rewardContainer.addChild(this.rewardList),this.outSideClickHide=!0} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - async showGuide(){ - this.title=NB.getText("GAME_803","양궁게임"),this.tapDesc.text=NB.getText("GAME_578","기본설명"),this.tapReward.text=NB.getText("COMMON_22","보상"); - const i=[NB.getText("GAME_804","과녁이 오른쪽에서 왼쪽으로 이동합니다."),NB.getText("GAME_805","화면을 탭하면 화살이 발사됩니다."),NB.getText("GAME_806","과녁의 속도를 가늠해 정확한 타이밍에 발사하세요."),NB.getText("GAME_807","명중 위치에 따라 1점 ~ 7점을 획득합니다. (중앙일수록 고득점)"),NB.getText("GAME_808","7점을 연속으로 맞추면 콤보 보너스가 붙습니다. (1콤보 +1점 → 6콤보 +6점)"),NB.getText("GAME_809","총 7발을 쏘며, 누적 점수에 따라 보상이 지급됩니다."),NB.getText("GAME_810","총 7발을 쏘며, 만점은 70점입니다."),NB.getText("GAME_811","매일 1회 도전 가능하며, 점수에 따라 즉시 보상이 지급됩니다.")]; - this.markerText.text=i.map(t=>`@ ${ - t} - `).join("\n"),this.refreshRewardHeaders(),this.rewardList.dataProvider=t.REWARD_TABLE.slice(),this.rewardList.scrollTo(0),this.tapDesc.selected=!0,this.tapReward.selected=!1,this.descContainer.visible=!0,this.rewardContainer.visible=!1,await this.loadImage(),super.show()} - refreshRewardHeaders(){ - this.lblHdrScore.text=NB.getText("COMMON_37","점수"),this.lblHdrGem.text=NB.getText("COMMON_350","보석"),this.lblHdrHonor.text=NB.getText("GAME_88","명예코인"),this.lblHdrGuild.text=NB.getText("GAME_812","길드코인"); - const i=t.REWARD_LIST_X,s=t.CONTENT_Y; - this.lblHdrScore.x=i+yEi.scoreX,this.lblHdrGem.x=i+yEi.gemX,this.lblHdrHonor.x=i+yEi.honorX,this.lblHdrGuild.x=i+yEi.guildX,this.lblHdrScore.y=s,this.lblHdrGem.y=s,this.lblHdrHonor.y=s,this.lblHdrGuild.y=s,this.rewardList.y=s+this.lblHdrScore.height+12} - onDescTap(){ - this.tapDesc.selected=!0,this.tapReward.selected=!1,this.descContainer.visible=!0,this.rewardContainer.visible=!1} - onRewardTap(){ - this.tapDesc.selected=!1,this.tapReward.selected=!0,this.descContainer.visible=!1,this.rewardContainer.visible=!0} - getDefaultPositionY(){ - return.5*SS.stageHeight} - onBackButton(){ - return this.hide(),!0} - } - ; - Qt(EEi,"ArcheryGameGuidePopup"),Zt(EEi,"_instance"),Zt(EEi,"REWARD_TABLE",[{ - scoreLabel:"70",gem:200,honor:200,guild:200} - ,{ - scoreLabel:"60~69",gem:160,honor:160,guild:200} - ,{ - scoreLabel:"50~59",gem:130,honor:130,guild:200} - ,{ - scoreLabel:"45~49",gem:100,honor:100,guild:100} - ,{ - scoreLabel:"42~44",gem:90,honor:90,guild:100} - ,{ - scoreLabel:"40~41",gem:80,honor:80,guild:100} - ,{ - scoreLabel:"38~39",gem:70,honor:70,guild:100} - ,{ - scoreLabel:"35~37",gem:60,honor:60,guild:80} - ,{ - scoreLabel:"30~34",gem:50,honor:50,guild:70} - ,{ - scoreLabel:"25~29",gem:50,honor:40,guild:60} - ,{ - scoreLabel:"20~24",gem:50,honor:30,guild:50} - ,{ - scoreLabel:"15~19",gem:50,honor:20,guild:50} - ,{ - scoreLabel:"10~14",gem:50,honor:10,guild:50} - ,{ - scoreLabel:"5~9",gem:50,honor:0,guild:50} - ,{ - scoreLabel:"0~4",gem:40,honor:0,guild:50} - ]),Zt(EEi,"POPUP_HEIGHT",720),Zt(EEi,"TAB_Y",80),Zt(EEi,"CONTENT_Y",145),Zt(EEi,"LIST_HEIGHT",520),Zt(EEi,"REWARD_LIST_X",30); - let AEi=EEi; - const SEi=class t extends pB{ - constructor(){ - super(),Zt(this,"lblScore"),Zt(this,"container"),Zt(this,"containerBg"),Zt(this,"rewardItems"),Zt(this,"btnConfirm"),Zt(this,"onClose",null),this.title=NB.getText("COMMON_223","획득"); - const t=hD.LABEL_OPTION_NO_DROP_SHADOW; - t.fill=hD.COLOR_WHITE,t.fontSize=22,this.lblScore=new iG("점수 : 0",t.fill,t),this.addChild(this.lblScore),this.containerBg=new Xe(RS.getTexture("UI_Ekkorr","Pass_Bg_0")),this.containerBg.alpha=.7,this.containerBg.width=this.width-24,this.addChild(this.containerBg),this.container=new Ke,this.addChild(this.container),this.rewardItems=[],this.btnConfirm=new aB(NB.getText("COMMON_1","확인")),this.addChild(this.btnConfirm),this.btnConfirm.onClick=this.onConfirmBtnClick.bind(this),this.updateLayout()} - static getInstance(){ - return null==this.instance&&(this.instance=new t),this.instance} - updateLayout(){ - this.lblScore.x=.5*(this.width-this.lblScore.width),this.lblScore.y=95,this.containerBg.x=.5*(this.width-this.containerBg.width),this.containerBg.y=this.lblScore.y+this.lblScore.height+30,this.containerBg.height=this.container.height+40,this.container.x=.5*(this.width-this.container.width),this.container.y=this.containerBg.y+20,this.btnConfirm.x=.5*(this.width-this.btnConfirm.width),this.btnConfirm.y=this.containerBg.y+this.containerBg.height+30,this.height=this.btnConfirm.y+this.btnConfirm.height+50} - setData(t){ - this.title=NB.getText("COMMON_223","획득"),this.btnConfirm.text=NB.getText("COMMON_1","확인"),this.lblScore.text=`${ - NB.getText("COMMON_37","점수")} - : ${ - t.totalScore} - `,this.setRewards(t.reward),this.setPositonRatioY(.35),this.updateLayout()} - setRewards(t){ - this.container.removeChildren(); - const i=[]; - t.gem>0&&i.push({ - type:"gem",amount:t.gem} - ),t.honorCoin>0&&i.push({ - type:"honorCoin",amount:t.honorCoin} - ),t.guildPoint>0&&i.push({ - type:"guildPoint",amount:t.guildPoint} - ); - let s,e=0; - for(let n=0; - n<i.length; - n++)n<this.rewardItems.length?s=this.rewardItems[n]:(s=new M4,this.rewardItems.push(s)),s.x=e,s.y=0,s.setDataFrom(i[n]),this.container.addChild(s),e+=s.width+15} - onConfirmBtnClick(){ - if(this.hide(),this.onClose){ - const t=this.onClose; - this.onClose=null,t()} - } - } - ; - Qt(SEi,"ArcheryRewardPopup"),Zt(SEi,"instance"); - let TEi=SEi; - const CEi=class t extends kx{ - constructor(){ - super(),Zt(this,"bg"),Zt(this,"highlightBg"),Zt(this,"rankBadge",new w0t(44)),Zt(this,"lblName"),Zt(this,"lblScore"); - const i=t.ITEM_WIDTH,s=t.ITEM_HEIGHT; - this.bg=new hE({ - texture:RS.getTexture("UI_Ekkorr","Base_bg01"),leftWidth:25,topHeight:20,rightWidth:25,bottomHeight:23} - ),this.bg.alpha=.6,this.bg.width=i,this.bg.height=s,this.addChild(this.bg),this.highlightBg=new ep,this.highlightBg.rect(0,0,i,s).fill({ - color:16766720,alpha:.18} - ),this.highlightBg.visible=!1,this.addChild(this.highlightBg); - const e=hD.DEFAULT_OUTLINE_FONT_OPTION_18; - e.fill=hD.COLOR_WHITE,this.addChild(this.rankBadge),this.lblName=new iG("",e.fill,e),this.addChild(this.lblName),this.lblScore=new iG("0",e.fill,e),this.addChild(this.lblScore)} - get height(){ - return t.ITEM_HEIGHT} - setData(t){ - if(this.data=t,!t)return; - this.rankBadge.setRank(t.rank),this.lblName.text=t.name,this.lblScore.text=`${ - t.score} - `; - const i=t.userId===TG.userId; - this.highlightBg.visible=i,this.lblName.textColor=i?6750054:16777215,this.layout()} - layout(){ - const i=t.ITEM_WIDTH,s=t.ITEM_HEIGHT,e=.5*(s-this.lblName.height); - this.rankBadge.x=16,this.rankBadge.y=.5*(s-44),this.lblScore.x=i-20-this.lblScore.width,this.lblScore.y=e,this.lblName.x=80,this.lblName.y=e} - } - ; - Qt(CEi,"MiniGameRankingItemRenderer"),Zt(CEi,"ITEM_WIDTH",520),Zt(CEi,"ITEM_HEIGHT",50); - let OEi=CEi; - const IEi=class t extends pB{ - constructor(){ - super(),Zt(this,"list"),this.title=NB.getText("COMMON_20","랭킹"),this.height=t.POPUP_HEIGHT,this.list=new Ox(OEi,OEi.ITEM_WIDTH,t.LIST_HEIGHT,4),this.list.x=.5*(this.width-OEi.ITEM_WIDTH),this.list.y=t.LIST_TOP,this.addChild(this.list)} - static getInstance(){ - return null==this.instance&&(this.instance=new t),this.instance} - setData(i){ - this.title=i.title,this.height=t.POPUP_HEIGHT; - const s=i.topList.map((t,i)=>({ - rank:i+1,userId:t.userId,name:t.name,score:t.score} - )); - this.list.dataProvider=s,this.list.scrollTo(0)} - } - ; - Qt(IEi,"MiniGameRankingPopup"),Zt(IEi,"instance"),Zt(IEi,"POPUP_HEIGHT",700),Zt(IEi,"LIST_TOP",90),Zt(IEi,"LIST_PADDING_X",30),Zt(IEi,"LIST_HEIGHT",580); - let kEi=IEi; - const xEi=class t extends YXt{ - constructor(){ - super(),Zt(this,"lblTitle"),Zt(this,"btnGuide"),Zt(this,"btnRanking"),Zt(this,"gameScene"),Zt(this,"btnStart"),Zt(this,"lblDoneToday"),Zt(this,"shootArea"),Zt(this,"isGameStarted",!1),Zt(this,"playCount",0),Zt(this,"maxPlays",1),Zt(this,"currentAttemptId",0),Zt(this,"requestPending",!1),this.bg.height<t.MIN_HEIGHT&&(this.y=Math.max(0,SS.safeHeight-t.MIN_HEIGHT),this.bg.height=SS.safeHeight-this.y),this.lblTitle=new iG(NB.getText("GAME_803","양궁게임"),hD.DEFAULT_COLOR,hD.DEFAULT_OUTLINE_FONT_OPTION_18),this.addChild(this.lblTitle),this.btnGuide=new HU("UI_Ekkorr","UI_Alarm"),this.btnGuide.onClick=this.onGuideBtnClick.bind(this),this.addChild(this.btnGuide),this.btnRanking=new HU("UI_Ekkorr","Icon_Ranking"),this.btnRanking.scale.set(t.RANKING_ICON_SIZE/this.btnRanking.width),this.btnRanking.onClick=this.onRankingBtnClick.bind(this),this.addChild(this.btnRanking),this.gameScene=new MEi,this.gameScene.scale.set(t.SCENE_SCALE),this.gameScene.x=.5*(this.width-t.SCALED_SCENE_W),this.gameScene.y=t.HEADER_Y+t.HEADER_HEIGHT+10,this.addChild(this.gameScene),this.shootArea=new ep,this.shootArea.rect(this.gameScene.x,this.gameScene.y,t.SCALED_SCENE_W,t.SCALED_SCENE_H).fill({ - color:0,alpha:.001} - ),this.shootArea.eventMode="static",this.shootArea.cursor="pointer",this.shootArea.on("pointertap",this.onShootTap.bind(this)),this.addChild(this.shootArea),this.btnStart=new nB("게임 시작"),this.btnStart.onClick=this.onStartClick.bind(this),this.addChild(this.btnStart),this.lblDoneToday=new iG(NB.getText("GAME_802","오늘 도전 끝"),6736896,hD.DEFAULT_OUTLINE_FONT_OPTION_18),this.lblDoneToday.textColor=6736896,this.lblDoneToday.visible=!1,this.addChild(this.lblDoneToday),this.gameScene.onGameEnd=this.onGameEnd.bind(this),this.updateLayout()} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - updateLayout(){ - const i=.5*this.width,s=t.HEADER_Y,e=s+.5*(t.HEADER_HEIGHT-this.lblTitle.height); - this.lblTitle.x=25,this.lblTitle.y=e,this.btnGuide.x=this.lblTitle.x+this.lblTitle.width+6,this.btnGuide.y=s+.5*(t.HEADER_HEIGHT-this.btnGuide.height)+2; - const n=t.RANKING_ICON_SIZE; - this.btnRanking.x=this.width-n-15,this.btnRanking.y=s+.5*(t.HEADER_HEIGHT-n)+5; - const h=this.gameScene.y+.5*t.SCALED_SCENE_H; - this.btnStart.x=i-.5*this.btnStart.width,this.btnStart.y=h+40,this.lblDoneToday.x=i-.5*this.lblDoneToday.width,this.lblDoneToday.y=this.btnStart.y+.5*(this.btnStart.height-this.lblDoneToday.height)} - show(){ - this.resetState(),super.show2(),this.fetchInfo()} - hide(){ - this.gameScene.stopGame(),this.isGameStarted=!1,super.hide()} - resetState(){ - this.gameScene.reset(),this.isGameStarted=!1,this.btnStart.visible=!0,this.shootArea.eventMode="none"} - async fetchInfo(){ - var t; - const i=await sD.getInstance().miniGame.getInfo(1); - if((null==i?void 0:i.success)&&(null==(t=i.body)?void 0:t.daily)){ - const t=i.body.daily; - this.playCount=t.playCount??0,this.maxPlays=t.maxPlays??1} - else this.playCount=0,this.maxPlays=1; - this.refreshStartButton()} - refreshStartButton(){ - this.playCount>=this.maxPlays?(this.btnStart.visible=!1,this.lblDoneToday.text=NB.getText("GAME_802","오늘 도전 끝"),this.lblDoneToday.visible=!0):(this.btnStart.visible=!0,this.btnStart.text=NB.getText("GAME_813","게임 시작"),this.btnStart.activated=!0,this.lblDoneToday.visible=!1),this.updateLayout()} - async onStartClick(){ - var t; - if(this.playCount>=this.maxPlays)return void bH.getInstance().showMessage("오늘 도전 횟수를 모두 사용했습니다."); - if(this.requestPending)return; - this.requestPending=!0; - const i=await sD.getInstance().miniGame.start(1); - this.requestPending=!1,!1!==(null==i?void 0:i.success)?(this.currentAttemptId=(null==(t=null==i?void 0:i.body)?void 0:t.attemptId)??0,this.currentAttemptId<=0?bH.getInstance().showMessage("게임 시작 실패"):(this.btnStart.visible=!1,this.shootArea.eventMode="static",this.isGameStarted=!0,this.gameScene.startGame())):bH.getInstance().showMessage(i.errorMessage??"게임 시작 실패")} - onShootTap(){ - this.isGameStarted&&this.gameScene.shoot()} - async onGameEnd(t){ - if(this.isGameStarted=!1,this.shootArea.eventMode="none",this.requestPending)return; - this.requestPending=!0; - const i=t.rounds.map(t=>t.score),s=await sD.getInstance().miniGame.submit(1,this.currentAttemptId,t.totalScore,i); - if(this.requestPending=!1,this.currentAttemptId=0,!1===(null==s?void 0:s.success))return bH.getInstance().showMessage(s.errorMessage??"보상 지급 실패"),void this.refreshStartButton(); - const e=null==s?void 0:s.body,n=(null==e?void 0:e.reward)??{ - gem:0,honorCoin:0,guildPoint:0} - ,h=TEi.getInstance(); - h.setData({ - totalScore:t.totalScore,reward:n} - ),h.onClose=()=>{ - e&&TG.setUserInfo(e),n.guildPoint>0&&OD.myMembershipVO&&(OD.myMembershipVO.coin=(OD.myMembershipVO.coin??0)+n.guildPoint),LH.getInstance().updateAll(),LH.getInstance().updateGuildCoin(),(null==e?void 0:e.daily)&&(this.playCount=e.daily.playCount??this.playCount,this.maxPlays=e.daily.maxPlays??this.maxPlays,this.refreshStartButton())} - ,h.show()} - onGuideBtnClick(){ - AEi.getInstance().showGuide()} - async onRankingBtnClick(){ - const t=await sD.getInstance().miniGame.getRanking(1,10); - if(!1===(null==t?void 0:t.success)||!(null==t?void 0:t.body))return void bH.getInstance().showMessage((null==t?void 0:t.errorMessage)??"랭킹 조회 실패"); - const i=t.body,s=kEi.getInstance(); - s.setData({ - title:NB.getText("COMMON_20","랭킹"),myRank:i.myRank??null,myScore:i.myScore??0,totalUsers:i.totalUsers??0,topList:i.topList??[]} - ),s.show()} - updateLanguage(){ - this.lblTitle.text=NB.getText("GAME_803","양궁게임"),this.btnStart.text=NB.getText("GAME_813","게임 시작"),this.lblDoneToday.text=NB.getText("GAME_802","오늘 도전 끝"),this.refreshStartButton()} - } - ; - Qt(xEi,"ArcheryGamePopup"),Zt(xEi,"_instance"),Zt(xEi,"MIN_HEIGHT",980),Zt(xEi,"TARGET_SCENE_WIDTH",640),Zt(xEi,"SCENE_SCALE",xEi.TARGET_SCENE_WIDTH/MEi.SCENE_WIDTH),Zt(xEi,"SCALED_SCENE_W",MEi.SCENE_WIDTH*xEi.SCENE_SCALE),Zt(xEi,"SCALED_SCENE_H",MEi.SCENE_HEIGHT*xEi.SCENE_SCALE),Zt(xEi,"HEADER_Y",50),Zt(xEi,"HEADER_HEIGHT",50),Zt(xEi,"RANKING_ICON_SIZE",40); - let REi=xEi; - const PEi=Object.freeze(Object.defineProperty({ - __proto__:null,ArcheryGamePopup:REi} - ,Symbol.toStringTag,{ - value:"Module"} - )),NEi=class t extends Ke{ - constructor(i,s=96,e=44){ - super(),Zt(this,"bg",new ep),Zt(this,"lbl"),Zt(this,"lockIcon",null),Zt(this,"chipW"),Zt(this,"chipH"),Zt(this,"_selected",!1),Zt(this,"_locked",!1),Zt(this,"onTap",null),this.chipW=s,this.chipH=e,this.bg.eventMode="none",this.addChild(this.bg),this.lbl=new iG(i,t.OFF_TEXT,hD.DEFAULT_FONT_OPTION_16),this.lbl.eventMode="none",this.addChild(this.lbl); - const n=t.HIT_PAD; - this.hitArea=new $i(-n,-n,s+2*n,e+2*n),this.eventMode="static",this.cursor="pointer",this.on("pointertap",this.onPointerTap,this),this.on("pointerdown",t.stopEvent),this.on("pointerup",t.stopEvent),this.redraw()} - static stopEvent(t){ - t.stopPropagation()} - onPointerTap(t){ - var i; - t.stopPropagation(),this._locked||(YG(),null==(i=this.onTap)||i.call(this))} - set text(t){ - this.lbl.text=t,this.layout()} - get selected(){ - return this._selected} - set selected(t){ - this._selected!==t&&(this._selected=t,this.redraw())} - get locked(){ - return this._locked} - set locked(i){ - this._locked!==i&&(this._locked=i,i&&!this.lockIcon&&(this.lockIcon=new Xe(RS.getTexture("UI_Ekkorr","Icon_Lock")),this.lockIcon.scale.set(t.LOCK_ICON_SCALE),this.lockIcon.eventMode="none",this.addChild(this.lockIcon)),this.lockIcon&&(this.lockIcon.visible=i),this.redraw())} - get chipWidth(){ - return this.chipW} - redraw(){ - const i=this._selected&&!this._locked,s=this.chipW,e=this.chipH,n=t.RADIUS; - this.bg.clear().roundRect(0,0,s,e,n).fill({ - color:i?t.ON_BG:t.OFF_BG} - ),this.lbl.textColor=this._locked?t.LOCKED_TEXT:i?t.ON_TEXT:t.OFF_TEXT,this.layout()} - layout(){ - this.lbl.x=.5*(this.chipW-this.lbl.width),this.lbl.y=.5*(this.chipH-this.lbl.height),this.lockIcon&&(this.lockIcon.x=this.chipW-this.lockIcon.width-5,this.lockIcon.y=4)} - } - ; - Qt(NEi,"ChoiceChip"),Zt(NEi,"RADIUS",8),Zt(NEi,"OFF_BG",1709068),Zt(NEi,"OFF_TEXT",13482901),Zt(NEi,"ON_BG",9925962),Zt(NEi,"ON_TEXT",2891793),Zt(NEi,"LOCKED_TEXT",7168070),Zt(NEi,"LOCK_ICON_SCALE",.7),Zt(NEi,"HIT_PAD",4); - let LEi=NEi; - const DEi=class t extends Ke{ - constructor(){ - super(),Zt(this,"track",new ep),Zt(this,"knob",new ep),Zt(this,"isOn",!1),Zt(this,"onTap",null),this.track.eventMode="none",this.knob.eventMode="none",this.addChild(this.track,this.knob),this.knob.y=.5*t.H,this.knob.x=this.knobX(!1),this.redraw(); - const i=t.HIT_PAD; - this.hitArea=new $i(-i,-i,t.W+2*i,t.H+2*i),this.eventMode="static",this.cursor="pointer",this.on("pointertap",this.onPointerTap,this),this.on("pointerdown",t.stopEvent),this.on("pointerup",t.stopEvent)} - static stopEvent(t){ - t.stopPropagation()} - onPointerTap(t){ - var i; - t.stopPropagation(),YG(),null==(i=this.onTap)||i.call(this)} - knobX(i){ - return i?t.W-t.PAD-t.KNOB_R:t.PAD+t.KNOB_R} - setOn(t,i=!0){ - this.isOn!==t&&(this.isOn=t,yx.killTweensOf(this.knob),i?yx.to(this.knob,{ - x:this.knobX(t),duration:.18,ease:"back.out(1.6)"} - ):this.knob.x=this.knobX(t),this.redraw())} - get switchWidth(){ - return t.W} - get switchHeight(){ - return t.H} - redraw(){ - const i=this.isOn,s=t.W,e=t.H; - this.track.clear().roundRect(0,0,s,e,.5*e).fill({ - color:i?t.ON_TRACK:t.OFF_TRACK} - ),this.knob.clear().circle(0,0,t.KNOB_R).fill({ - color:i?t.ON_KNOB:t.OFF_KNOB} - )} - } - ; - Qt(DEi,"ToggleSwitch"),Zt(DEi,"W",64),Zt(DEi,"H",32),Zt(DEi,"KNOB_R",12),Zt(DEi,"PAD",4),Zt(DEi,"ON_TRACK",4165439),Zt(DEi,"OFF_TRACK",4866355),Zt(DEi,"ON_KNOB",16183260),Zt(DEi,"OFF_KNOB",10260342),Zt(DEi,"HIT_PAD",8); - let GEi=DEi; - const BEi=class t extends pB{ - constructor(){ - super(),Zt(this,"mains",[]),Zt(this,"enabled",!0),Zt(this,"slots",[null,null]),Zt(this,"requestPending",!1),Zt(this,"lblAuto"),Zt(this,"toggle"),Zt(this,"slotPanels",[]),Zt(this,"slotBadges",[]),Zt(this,"slotMainButtons",[]),Zt(this,"slotChipContainers",[]),Zt(this,"previewPanel"),Zt(this,"previewY"),Zt(this,"lblPreviewMain"),Zt(this,"lblPreviewSub"),Zt(this,"lblFooter"),Zt(this,"btnSave"),this.width=t.POPUP_WIDTH,this.height=t.POPUP_HEIGHT,this.title=NB.getText("COMMON_49","설정"); - const i=t.PANEL_X,s=t.PANEL_W,e=t.SLOT_PANEL_H; - this.lblAuto=new iG(NB.getText("GAME_1595","자동 오픈"),16777215,hD.WHITE_OUTLINE_FONT_OPTION_16),this.lblAuto.x=i+6,this.lblAuto.y=78,this.contentContainer.addChild(this.lblAuto),this.toggle=new GEi,this.toggle.x=t.POPUP_WIDTH-i-this.toggle.switchWidth,this.toggle.y=72,this.toggle.onTap=()=>{ - this.enabled=!this.enabled,this.toggle.setOn(this.enabled),this.apply()} - ,this.contentContainer.addChild(this.toggle); - for(let h=0; - h<2; - h++){ - const n=126+h*(e+10),r=(new ep).roundRect(0,0,s,e,t.PANEL_RADIUS).fill({ - color:t.PANEL_BG} - ); - r.x=i,r.y=n,r.eventMode="none",this.contentContainer.addChild(r),this.slotPanels.push(r); - const o=this.buildPrioBadge(NB.getValueReplace("GAME_1600","##",h+1,`${ - h+1} - 순위`)); - o.x=i+14,o.y=n+.5*(e-t.BADGE_H),this.contentContainer.addChild(o),this.slotBadges.push(o); - const a=new LEi("-",t.MAIN_BTN_W,t.CHIP_H); - a.x=i+t.CONTENT_X,a.y=n+8,a.onTap=()=>this.cycleMain(h),this.contentContainer.addChild(a),this.slotMainButtons.push(a); - const c=new Ke; - c.x=i+t.CONTENT_X,c.y=n+8+t.CHIP_H+8,this.contentContainer.addChild(c),this.slotChipContainers.push(c)} - this.previewY=126+2*(e+10),this.previewPanel=new ep,this.previewPanel.x=i,this.previewPanel.y=this.previewY,this.previewPanel.eventMode="none",this.contentContainer.addChild(this.previewPanel); - const n=i+18; - this.lblPreviewMain=new iG("",16777215,hD.WHITE_OUTLINE_FONT_OPTION_16),this.lblPreviewMain.x=n,this.lblPreviewMain.setWrapWidth(s-36),this.contentContainer.addChild(this.lblPreviewMain),this.lblPreviewSub=new iG("",12432284,hD.DEFAULT_FONT_OPTION_15),this.lblPreviewSub.x=n,this.contentContainer.addChild(this.lblPreviewSub),this.lblFooter=new iG(NB.getText("GAME_1597","기간 마지막 날 23:50 (UTC) 마감 · 00:00 (UTC) 오픈"),10128756,hD.DEFAULT_FONT_OPTION_15),this.lblFooter.textSize=13,this.lblFooter.y=this.previewY+112,this.contentContainer.addChild(this.lblFooter),this.lblFooter.x=.5*(t.POPUP_WIDTH-this.lblFooter.width),this.btnSave=new aB(NB.getText("COMMON_297","저장하기")),this.btnSave.x=.5*(t.POPUP_WIDTH-this.btnSave.width),this.btnSave.y=this.previewY+140,this.btnSave.onClick=()=>{ - this.onSave()} - ,this.contentContainer.addChild(this.btnSave)} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - static difficultLabel(t){ - return NB.getValueReplace("GAME_1601","##",t,`${ - t} - 단계`)} - buildPrioBadge(i){ - const s=new Ke; - s.eventMode="none"; - const e=t.BADGE_W,n=t.BADGE_H,h=(new ep).roundRect(0,0,e,n,6).fill({ - color:t.BADGE_BG} - ); - s.addChild(h); - const r=new iG(i,t.BADGE_TEXT,hD.DEFAULT_FONT_OPTION_15); - return r.x=.5*(e-r.width),r.y=.5*(n-r.height),s.addChild(r),s} - async openSettings(){ - const t=await sD.getInstance().guildRaid.getOpenRule(!0); - if(!(null==t?void 0:t.success))return void AB.getInstance().showError(t); - const i=d1t.getInstance(); - await i.ensureLoaded(); - const s=t.body??{ - } - ,e=s.mains??[],n=e.filter(t=>i.isLiveMain(t.main)); - if(this.mains=n.length>0?n:e,0===this.mains.length)return; - const h=s.rule; - this.enabled=!h||!!h.enabled,this.slots=[this.parseSlot(null==h?void 0:h.slot1Main,null==h?void 0:h.slot1Difficult)??this.defaultSlot(),this.parseSlot(null==h?void 0:h.slot2Main,null==h?void 0:h.slot2Difficult)],this.toggle.setOn(this.enabled,!1),this.apply(),super.show()} - parseSlot(t,i){ - return null==t||null==i?null:this.mains.some(i=>i.main===t)?{ - main:t,difficult:i} - :null} - defaultSlot(){ - const t=this.mains[0],i=t.difficulties.filter(t=>t.unlocked),s=i.length>0?i[i.length-1]:t.difficulties[0]; - return{ - main:t.main,difficult:s.difficult} - } - getMainInfo(t){ - return this.mains.find(i=>i.main===t)} - cycleMain(t){ - if(!this.enabled)return; - const i=this.slots[t],s=(null==i?void 0:i.main)??this.mains[0].main,e=this.mains.findIndex(t=>t.main===s),n=this.mains[(e+1)%this.mains.length],h=n.difficulties.filter(t=>t.unlocked),r=h.length>0?h[h.length-1]:n.difficulties[0]; - this.slots[t]={ - main:n.main,difficult:r.difficult} - ,this.apply()} - apply(){ - const i=d1t.getInstance(),s=this.enabled?1:.45,e=t.SLOT_PANEL_H,n=t.CHIP_H; - for(let t=0; - t<2; - t++){ - const h=this.slots[t],r=this.getMainInfo((null==h?void 0:h.main)??this.mains[0].main),o=this.slotMainButtons[t],a=126+t*(e+10); - o.visible=null!=h,h&&(o.text=i.getMainName(h.main),o.selected=!0),this.slotChipContainers[t].y=null!=h?a+8+n+8:a+.5*(e-n),this.rebuildChips(t,r),this.slotPanels[t].alpha=s,this.slotBadges[t].alpha=s,o.alpha=s,this.slotChipContainers[t].alpha=s} - this.applyPreview()} - rebuildChips(i,s){ - const e=this.slotChipContainers[i]; - if(e.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),!s)return; - const n=t.CHIP_W,h=t.CHIP_H,r=t.CHIP_GAP; - let o=0; - if(1===i){ - const t=new LEi(NB.getText("GAME_1596","미사용"),n,h); - t.x=o,t.selected=null==this.slots[1],t.onTap=()=>{ - this.enabled&&(this.slots[1]=null,this.apply())} - ,e.addChild(t),o+=n+r} - const a=this.slots[i]; - for(const c of s.difficulties){ - const l=new LEi(t.difficultLabel(c.difficult),n,h); - l.x=o,c.unlocked?(l.selected=null!=a&&a.difficult===c.difficult&&a.main===s.main,l.onTap=()=>{ - this.enabled&&(this.slots[i]={ - main:s.main,difficult:c.difficult} - ,this.apply())} - ):l.locked=!0,e.addChild(l),o+=n+r} - } - applyPreview(){ - const i=d1t.getInstance(),s=this.slots.filter(t=>null!=t); - let e,n=""; - if(this.enabled){ - const h=s.map(s=>`${ - i.getMainName(s.main)} - ${ - t.difficultLabel(s.difficult)} - `).join(" + "); - e=NB.getValueReplace("GAME_1602","##",h,`00:00 (UTC) 오픈 : ${ - h} - `),2===s.length&&(n=s[0].main===s[1].main?NB.getText("GAME_1603","같은 레이드 → 1순위가 끝나면 2순위가 이어서 열립니다."):NB.getText("GAME_1604","서로 다른 레이드 → 동시에 열립니다."))} - else e=NB.getText("GAME_1598","자동 오픈이 꺼져 있습니다."),n=NB.getText("GAME_1599","길드마스터/부길드마스터가 직접 오픈해야 합니다."); - const h=t.PREVIEW_PAD_Y,r=t.PREVIEW_LINE_H; - let o=this.previewY+h; - this.lblPreviewMain.text=e,this.lblPreviewMain.y=o,o+=r,this.lblPreviewSub.text=n,this.lblPreviewSub.visible=""!==n,""!==n&&(this.lblPreviewSub.y=o,o+=r); - const a=o-this.previewY-r+22+h; - this.previewPanel.clear().roundRect(0,0,t.PANEL_W,a,t.PANEL_RADIUS).fill({ - color:t.PANEL_BG} - )} - async onSave(){ - if(this.requestPending)return; - const t=this.slots.filter(t=>null!=t); - if(this.enabled&&0===t.length)return; - this.requestPending=!0; - const i=await sD.getInstance().guildRaid.setOpenRule(this.enabled,t.map(t=>({ - main:t.main,difficult:t.difficult} - )),!0); - if(this.requestPending=!1,!(null==i?void 0:i.success))return void AB.getInstance().showError(i); - this.hide(); - const{ - GuildRaidSubView:s} - =await ei(async()=>{ - const{ - GuildRaidSubView:t} - =await Promise.resolve().then(()=>uri); - return{ - GuildRaidSubView:t} - } - ,void 0); - s.getInstance().setData()} - } - ; - Qt(BEi,"GuildRaidOpenSettingsPopup"),Zt(BEi,"_instance"),Zt(BEi,"POPUP_WIDTH",620),Zt(BEi,"POPUP_HEIGHT",600),Zt(BEi,"PANEL_X",26),Zt(BEi,"PANEL_W",568),Zt(BEi,"SLOT_PANEL_H",112),Zt(BEi,"PANEL_BG",3155482),Zt(BEi,"PANEL_RADIUS",10),Zt(BEi,"BADGE_BG",15251020),Zt(BEi,"BADGE_TEXT",3811853),Zt(BEi,"BADGE_W",64),Zt(BEi,"BADGE_H",28),Zt(BEi,"CONTENT_X",92),Zt(BEi,"CHIP_W",96),Zt(BEi,"CHIP_H",44),Zt(BEi,"CHIP_GAP",8),Zt(BEi,"MAIN_BTN_W",190),Zt(BEi,"PREVIEW_PAD_Y",16),Zt(BEi,"PREVIEW_LINE_H",26); - let UEi=BEi; - const FEi=Object.freeze(Object.defineProperty({ - __proto__:null,GuildRaidOpenSettingsPopup:UEi} - ,Symbol.toStringTag,{ - value:"Module"} - )),$Ei=class t extends pB{ - constructor(){ - super(),Zt(this,"lblMessage",new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_18)),Zt(this,"lblCost",new OF("UI_GEM_ICON","0",6737151,hD.DEFAULT_OUTLINE_FONT_OPTION_18)),Zt(this,"btnConfirm",new M$("","","확인",.8,150,60)),Zt(this,"btnCancel",new M$("","","취소",.8,150,60)),Zt(this,"requestPending",!1),Zt(this,"onSuccess",null),this.title=NB.getText("GAME_912","시간 단축"),this.lblMessage.align="center",this.lblCost.iconScale=.8,this.btnConfirm.showIconLabel=!1,this.btnConfirm.showTextLabel=!0,this.btnConfirm.text=NB.getText("COMMON_1","확인"),this.btnConfirm.color=M$.GREEN,this.btnConfirm.onClick=this.onConfirmClick.bind(this),this.btnCancel.showIconLabel=!1,this.btnCancel.showTextLabel=!0,this.btnCancel.text=NB.getText("COMMON_2","취소"),this.btnCancel.color=M$.BROWN,this.btnCancel.onClick=this.onCancelClick.bind(this),this.contentContainer.addChild(this.lblMessage,this.lblCost,this.btnConfirm,this.btnCancel),hD.setLabelWrapWidth(this.lblMessage,this.width-60)} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - showConfirm(t=null){ - this.onSuccess=t,this.lblMessage.text=NB.getText("GAME_907","남은 시간을 1시간 단축하시겠습니까?"),this.lblCost.text=String(TG.soulRestSkipCost),this.btnConfirm.text=NB.getText("COMMON_1","확인"),this.btnCancel.text=NB.getText("COMMON_2","취소"),this.updateLayout(),this.btnClose.visible=!0,this.outSideClickHide=!1,super.show()} - updateLayout(){ - const t=.5*this.width; - let i=95; - this.lblMessage.x=t-.5*this.lblMessage.width,this.lblMessage.y=i,i+=this.lblMessage.height+22,this.lblCost.x=t-.5*this.lblCost.width,this.lblCost.y=i,i+=this.lblCost.height+30; - let s=t-.5*(this.btnConfirm.width+this.btnCancel.width+14); - this.btnConfirm.x=s,this.btnConfirm.y=i,s+=this.btnConfirm.width+14,this.btnCancel.x=s,this.btnCancel.y=i,this.height=i+this.btnConfirm.height+30} - async onConfirmClick(){ - var t; - if(this.requestPending)return; - const i=TG.soulRestSkipCost; - if(TG.gem<i)return void AB.getInstance().show(NB.getText("COMMON_352","보석이 부족합니다.")); - this.requestPending=!0; - const s=await sD.getInstance().soulRest.skipCooldown(); - this.requestPending=!1,s.success?((null==(t=s.body)?void 0:t.user)&&(TG.setUserData(s.body.user),LH.getInstance().updateAll()),this.onSuccess&&this.onSuccess(),this.hide()):AB.getInstance().showError(s)} - onCancelClick(){ - this.hide()} - getDefaultPositionY(){ - return.4*SS.stageHeight} - } - ; - Qt($Ei,"SoulRestSkipConfirmPopup"),Zt($Ei,"_instance"); - let HEi=$Ei; - const WEi=Object.freeze(Object.defineProperty({ - __proto__:null,SoulRestSkipConfirmPopup:HEi} - ,Symbol.toStringTag,{ - value:"Module"} - )),VEi=class t extends kx{ - constructor(){ - super(),Zt(this,"cells",[]),Zt(this,"fxUnits",[]),Zt(this,"setVO",null); - for(let t=0; - t<6; - t++){ - const i=new zEi; - i.x=12+t*(i.width+10),i.y=.5*(80-i.height),this.addChild(i),this.cells.push(i)} - for(let t=0; - t<3; - t++){ - const t=new qEi; - this.addChild(t),this.fxUnits.push(t)} - } - get width(){ - return 630} - get height(){ - return 80} - setData(i){ - var s; - const e=i; - if(!e)return; - this.setVO=e; - const n=TR.getInstance(),h=new Map; - for(const t of[...n.equipedList,...n.ownedList])t&&h.set(t.kindNum,t.trans||0); - const r=e.itemList.slice(0,6); - for(let d=0; - d<6; - d++){ - const i=this.cells[d]; - if(d<r.length){ - const e=r[d]; - i.visible=!0,i.setData(e,h.has(e),(null==(s=t.isSelected)?void 0:s.call(t,e))??!1)} - else i.visible=!1} - const o=e.itemList.filter(i=>{ - var s; - return(null==(s=t.isSelected)?void 0:s.call(t,i))??!1} - ).map(t=>h.get(t)??0).sort((t,i)=>i-t),a=o.length,c=e.itemList.filter(t=>h.has(t)).map(t=>h.get(t)??0).sort((t,i)=>i-t),l=[]; - for(let t=0; - t<e.numSetList.length; - t++){ - const i=(e.skillList[t]||[]).indexOf("medal"); - if(i<0)continue; - if(e.getValueAt(3,t,i)<=0)continue; - const s=e.numSetList[t],n=a>=s,h=e.getValueAt(c[s-1]??0,t,i),r=n?e.getValueAt(o[s-1]??0,t,i):h,u=n&&r<h; - l.push({ - required:s,value:r,active:n,suboptimal:u} - )} - let u=576; - for(let t=this.fxUnits.length-1; - t>=0; - t--){ - const i=this.fxUnits[t]; - if(t<l.length){ - const s=l[t],e=i.setData(s.required,s.value,s.active,s.suboptimal); - i.visible=!0,i.x=u-e,i.y=0,u=i.x-12} - else i.visible=!1} - } - onClick(i,s){ - var e; - if(!this.setVO)return; - const n=this.setVO.itemList.slice(0,6); - for(let h=0; - h<n.length; - h++){ - const s=this.cells[h]; - if(i>=s.x&&i<=s.x+s.width)return void(s.visible&&s.owned&&(null==(e=t.onToggle)||e.call(t,n[h])))} - } - } - ; - Qt(VEi,"ReviveTreasureSetRowRenderer"),Zt(VEi,"onToggle",null),Zt(VEi,"isSelected",null); - let jEi=VEi; - const KEi=class extends Ke{ - constructor(){ - super(),Zt(this,"icon"),Zt(this,"checkIcon"),Zt(this,"owned",!1),this.icon=new pZt,this.icon.scale=.9,this.icon.hideEnhance(),this.addChild(this.icon),this.checkIcon=new Xe(RS.getTexture("UI_Ekkorr","Base_Check01")),this.checkIcon.scale=.8,this.checkIcon.x=.5*(this.width-this.checkIcon.width),this.checkIcon.y=.5*(this.height-this.checkIcon.height),this.checkIcon.visible=!1,this.addChild(this.checkIcon)} - get width(){ - return.9*this.icon.width} - get height(){ - return.9*this.icon.height} - setData(t,i,s){ - this.owned=i; - const e=TR.getInstance().getBookDataByKindNum(t); - e&&this.icon.setVO(e),this.icon.alpha=i?1:.32,this.checkIcon.visible=s} - } - ; - Qt(KEi,"SetMemberCell"); - let zEi=KEi; - const YEi=class t extends Ke{ - constructor(){ - super(),Zt(this,"chipContainer"),Zt(this,"lblValue"),this.chipContainer=new Ke,this.chipContainer.eventMode="none",this.addChild(this.chipContainer),this.lblValue=new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_17),this.lblValue.textSize=15,this.lblValue.eventMode="none",this.addChild(this.lblValue)} - setData(i,s,e,n=!1){ - const h=Nni(this.chipContainer,[{ - label:`${ - i} - set`,color:e?t.COLOR_ON:t.COLOR_OFF} - ]); - this.lblValue.text=`${ - s} - %`,this.lblValue.textColor=e?n?t.COLOR_VALUE_SUBOPTIMAL:t.COLOR_VALUE_ON:t.COLOR_OFF,this.lblValue.alpha=e?1:.8; - const r=Math.max(h,this.lblValue.width),o=.5*(80-(t.CHIP_H+t.CHIP_VALUE_GAP+this.lblValue.height)); - return this.chipContainer.x=.5*(r-h),this.chipContainer.y=o,this.lblValue.x=.5*(r-this.lblValue.width),this.lblValue.y=o+t.CHIP_H+t.CHIP_VALUE_GAP,r} - } - ; - Qt(YEi,"SetEffectInline"),Zt(YEi,"COLOR_ON",16767354),Zt(YEi,"COLOR_VALUE_ON",16777215),Zt(YEi,"COLOR_OFF",9079434),Zt(YEi,"COLOR_VALUE_SUBOPTIMAL",16739162),Zt(YEi,"CHIP_H",14),Zt(YEi,"CHIP_VALUE_GAP",3); - let qEi=YEi; - const XEi=.9,JEi=class t extends pB{ - constructor(){ - super(),Zt(this,"onSaved",null),Zt(this,"lblDesc"),Zt(this,"lblBuff"),Zt(this,"lblSelect"),Zt(this,"slotContainer"),Zt(this,"slotIcons",[]),Zt(this,"list"),Zt(this,"btnConfirm"),Zt(this,"btnClearAll"),Zt(this,"selected",[]),Zt(this,"slotCount",5),this.width=640,this.title=NB.getText("GAME_1546","환생유물 편성"),this.lblDesc=new iG("",13421772,hD.DEFAULT_OUTLINE_FONT_OPTION_16),this.lblDesc.x=24,this.lblDesc.y=68,this.lblDesc.text=NB.getText("GAME_1547","환생 시 이 유물들의 훈장이 사용됩니다."),this.addChild(this.lblDesc),hD.setLabelWrapWidth(this.lblDesc,this.width-2*this.lblDesc.x),this.slotContainer=new Ke,this.slotContainer.x=24,this.slotContainer.y=this.lblDesc.y+this.lblDesc.height+10,this.addChild(this.slotContainer),this.slotContainer.eventMode="static",this.slotContainer.on("pointertap",this.onSlotTap,this),this.lblBuff=new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_18),this.lblBuff.textColor=16767354,this.addChild(this.lblBuff),this.lblSelect=new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_17),this.lblSelect.x=24,this.lblSelect.text="+ "+NB.getText("GAME_1548","유물 선택"),this.addChild(this.lblSelect),this.btnClearAll=new nB(NB.getText("GAME_1620","모두 비우기")),this.btnClearAll.color=nB.BROWN,this.btnClearAll.width=120,this.btnClearAll.height=30,this.btnClearAll.x=this.width-24-this.btnClearAll.width,this.btnClearAll.onClick=()=>{ - 0!==this.selected.length&&(this.selected.length=0,this.updateSlots(),this.refreshListSelection())} - ,this.addChild(this.btnClearAll),this.list=new C4(jEi,630,500),this.list.x=5,this.addChild(this.list),this.btnConfirm=new nB(NB.getText("COMMON_1","확인")),this.btnConfirm.color=nB.GREEN,this.btnConfirm.width=200,this.btnConfirm.height=55,this.btnConfirm.x=.5*(640-this.btnConfirm.width),this.btnConfirm.onClick=this.onConfirmClick.bind(this),this.addChild(this.btnConfirm)} - static getInstance(){ - return t._instance||(t._instance=new t),t._instance} - async setData(){ - var t; - const i=TR.getInstance(); - this.slotCount=Math.max(1,i.maxSlots); - let s=[]; - try{ - const i=await sD.getInstance().user.getReviveTreasure(); - !1!==(null==i?void 0:i.success)&&Array.isArray(null==(t=null==i?void 0:i.body)?void 0:t.treasures)&&(s=i.body.treasures.map(Number).filter(t=>t>0))} - catch(frt){ - } - const e=new Set(this.getOwnedTreasures().map(t=>t.kindNum)); - this.selected=s.filter(t=>e.has(t)).slice(0,this.slotCount),this.buildSlots(),this.refreshList(),this.layout()} - getOwnedTreasures(){ - const t=TR.getInstance(); - return[...t.equipedList,...t.ownedList].filter(t=>!!t)} - buildSlots(){ - this.slotContainer.removeChildren(),this.slotIcons.length=0; - const t=new pZt,i=t.width*XEi+10; - for(let s=0; - s<this.slotCount; - s++){ - const e=0===s?t:new pZt; - e.scale=XEi,e.hideEnhance(),e.x=s%8*i,e.y=Math.floor(s/8)*i,this.slotContainer.addChild(e),this.slotIcons.push(e)} - this.updateSlots()} - updateSlots(){ - this.lblSelect.text="+ "+NB.getText("GAME_1548","유물 선택")+` (${ - this.selected.length} - /${ - this.slotCount} - )`; - const t=TR.getInstance(); - for(let i=0; - i<this.slotIcons.length; - i++){ - const s=this.slotIcons[i]; - if(i<this.selected.length){ - const e=t.getBookDataByKindNum(this.selected[i]); - if(e){ - s.setVO(e),s.visible=!0; - continue} - } - s.visible=i<this.selected.length} - this.updateBuffLabel()} - updateBuffLabel(){ - const i=LR.getInstance().getMedalSummaryForKindNums(this.selected); - this.lblBuff.text=NB.getValueReplace("GAME_825","##",String(i.total),`훈장버프 : ${ - i.total} - %`),this.lblBuff.textColor=i.suboptimal?t.COLOR_BUFF_SUBOPTIMAL:t.COLOR_BUFF_NORMAL,this.lblBuff.x=this.width-24-this.lblBuff.width} - refreshList(){ - jEi.onToggle=t=>this.toggle(t),jEi.isSelected=t=>-1!==this.selected.indexOf(t); - const t=TR.getInstance(),i=new Set(this.getOwnedTreasures().map(t=>t.kindNum)),s=Qt(t=>t.itemList.filter(t=>i.has(t)).length,"ownedCountOf"),e=Qt(i=>{ - var s; - return(null==(s=t.getBookDataByKindNum(i.itemList[0]))?void 0:s.grade)??0} - ,"gradeOf"),n=Qt(t=>{ - let i=0; - for(let s=0; - s<t.numSetList.length; - s++){ - const e=(t.skillList[s]||[]).indexOf("medal"); - e>=0&&(i=Math.max(i,t.getValueAt(0,s,e)))} - return i} - ,"maxMedalOf"),h=LR.getInstance().bookList.slice().sort((t,i)=>e(i)-e(t)||n(i)-n(t)||s(i)-s(t)||t.kindNum-i.kindNum); - this.list.dataProvider=h,this.list.showTopItem()} - toggle(t){ - const i=this.selected.indexOf(t); - if(-1!==i)this.selected.splice(i,1); - else{ - if(this.selected.length>=this.slotCount)return void bH.getInstance().showMessage(NB.getValueReplace("GAME_1549","##",this.slotCount,`최대 ${ - this.slotCount} - 개까지 선택할 수 있습니다.`)); - this.selected.push(t)} - this.updateSlots(),this.refreshListSelection()} - refreshListSelection(){ - const t=this.list.itemList; - if(t)for(const i of t)i.setData(i.data)} - onSlotTap(t){ - const i=this.slotContainer.toLocal(t.global); - for(let s=0; - s<this.selected.length; - s++){ - const t=this.slotIcons[s]; - if(i.x>=t.x&&i.x<=t.x+t.width*XEi&&i.y>=t.y&&i.y<=t.y+t.height*XEi)return void this.toggle(this.selected[s])} - } - layout(){ - var t; - const i=Math.ceil(this.slotCount/8),s=((null==(t=this.slotIcons[0])?void 0:t.height)??80)*XEi+10; - this.lblBuff.y=this.slotContainer.y+i*s+8,this.lblBuff.x=this.width-24-this.lblBuff.width,this.lblSelect.y=this.lblBuff.y+this.lblBuff.height+8,this.btnClearAll.y=this.lblSelect.y+.5*(this.lblSelect.height-this.btnClearAll.height),this.list.y=this.lblSelect.y+30,this.btnConfirm.y=this.list.y+500+16,this.bg.height=this.btnConfirm.y+this.btnConfirm.height+24} - async onConfirmClick(){ - var t; - try{ - const t=await sD.getInstance().user.setReviveTreasure(this.selected); - if(!1===(null==t?void 0:t.success))return void bH.getInstance().showMessage(NB.getText("COMMON_167","저장에 실패하였습니다."))} - catch(frt){ - return} - SH.getInstance().setKindNums(this.selected),bH.getInstance().showMessage(NB.getText("GAME_1179","저장되었습니다")),this.hide(),null==(t=this.onSaved)||t.call(this)} - } - ; - Qt(JEi,"ReviveTreasurePopup"),Zt(JEi,"_instance"),Zt(JEi,"COLOR_BUFF_SUBOPTIMAL",16739162),Zt(JEi,"COLOR_BUFF_NORMAL",16767354); - let QEi=JEi; - const ZEi=Object.freeze(Object.defineProperty({ - __proto__:null,ReviveTreasurePopup:QEi} - ,Symbol.toStringTag,{ - value:"Module"} - )),tAi=class extends WS{ - constructor(){ - super(),Zt(this,"countText"),Zt(this,"currentNum",0),Zt(this,"resolve",null),Zt(this,"failsafeTimer",null); - const t=new Jw({ - fontFamily:"Arial",fontSize:120,fontWeight:"bold",fill:16777215,stroke:{ - color:"#000000",width:6,join:"round"} - ,dropShadow:{ - color:0,blur:10,angle:Math.PI/4,distance:4} - } - ); - this.countText=new pg({ - text:"",style:t} - ),this.countText.anchor.set(.5),this.countText.x=320,this.countText.y=300,this.addChild(this.countText),this.visible=!1,this.eventMode="static",this.on("pointertap",this.onTap,this)} - play(t=5){ - return new Promise(i=>{ - this.visible=!0,this.resolve=i,this.currentNum=t,this.showNumber(this.currentNum),null!==this.failsafeTimer&&clearTimeout(this.failsafeTimer),this.failsafeTimer=setTimeout(()=>this.finish(),1e3*(t+2))} - )} - onTap(){ - this.currentNum<=0||(this.currentNum--,this.currentNum<=0?this.finish():this.showNumber(this.currentNum))} - showNumber(t){ - yx.killTweensOf(this.countText),yx.killTweensOf(this.countText.scale),this.countText.text=`${ - t} - `,this.countText.alpha=1,this.countText.scale.set(1.8),yx.to(this.countText.scale,{ - x:1,y:1,duration:.25,ease:"back.out(1.5)"} - ),yx.to(this.countText,{ - alpha:0,duration:.2,delay:.8,ease:"power2.in",onComplete:Qt(()=>{ - this.currentNum--,this.currentNum<=0?this.finish():this.showNumber(this.currentNum)} - ,"onComplete")} - )} - finish(){ - null!==this.failsafeTimer&&(clearTimeout(this.failsafeTimer),this.failsafeTimer=null),yx.killTweensOf(this.countText),yx.killTweensOf(this.countText.scale),this.visible=!1,this.resolve&&(this.resolve(),this.resolve=null)} - } - ; - Qt(tAi,"OfflineCountdown"); - let iAi=tAi; - const sAi=Object.freeze(Object.defineProperty({ - __proto__:null,OfflineCountdown:iAi} - ,Symbol.toStringTag,{ - value:"Module"} - )),eAi=class t{ - static getInstance(){ - return t.instance||(t.instance=new t),t.instance} - constructor(){ - } - async requestReview(t,i){ - const s=OG.getInstance(); - if("capacitor"!=s.envPlatform)return; - if(0==xG.getInstance().production)return; - if(CS.isAppBundleVersionLessThan("1.4.27"))return; - const e=s.getClientData("STORE_REVIEW_YN"); - if(e&&"N"==e)return; - const n=[100]; - let h,r=!1; - const o=n.length; - for(let a=0; - a<o; - ++a)if(h=n[a],i<h&&t>=h){ - r=!0; - break} - 0!=r&&setTimeout(async()=>{ - try{ - const{ - AppReview:t} - =await ei(async()=>{ - const{ - AppReview:t} - =await Promise.resolve().then(()=>j3i); - return{ - AppReview:t} - } - ,void 0); - await t.requestReview()} - catch(t){ - } - } - ,9e4)} - } - ; - Qt(eAi,"StoreReviewManager"),Zt(eAi,"instance"); - let nAi=eAi; - const hAi=Object.freeze(Object.defineProperty({ - __proto__:null,StoreReviewManager:nAi} - ,Symbol.toStringTag,{ - value:"Module"} - )),rAi=class t extends Ke{ - constructor(i=24){ - super(); - const s=new ep; - s.circle(0,0,i).stroke({ - width:3,color:t.COLOR_INK,alpha:.92} - ),s.circle(0,0,i-4).stroke({ - width:1.5,color:t.COLOR_INK,alpha:.6} - ),s.eventMode="none",this.addChild(s); - const e=new ep; - e.moveTo(.42*-i,.05*i).lineTo(.1*-i,.36*i).lineTo(.46*i,.32*-i).stroke({ - width:Math.max(3,.16*i),color:t.COLOR_INK,alpha:.92,cap:"round",join:"round"} - ),e.eventMode="none",this.addChild(e),this.eventMode="none"} - setDayRotation(t){ - this.rotation=(37*t%13-6)*(Math.PI/180)} - playPop(){ - yx.killTweensOf(this.scale),yx.fromTo(this.scale,{ - x:2.4,y:2.4} - ,{ - x:1,y:1,duration:.38,ease:"back.out(1.8)"} - ),yx.fromTo(this,{ - alpha:0} - ,{ - alpha:1,duration:.16} - )} - } - ; - Qt(rAi,"StampMark"),Zt(rAi,"COLOR_INK",12597547); - let oAi=rAi; - const aAi=class t extends Ke{ - constructor(){ - super(),Zt(this,"bg"),Zt(this,"lblDay"),Zt(this,"reward"),Zt(this,"lblAmount"),Zt(this,"redDot"),Zt(this,"stamp"),Zt(this,"onTap",null),Zt(this,"data",null); - const i=t.WIDTH,s=t.HEIGHT; - this.bg=new ep,this.bg.roundRect(0,0,i,s,t.BG_RADIUS).fill({ - color:t.BG_COLOR} - ),this.bg.tint=16777215,this.bg.eventMode="none",this.addChild(this.bg),this.lblDay=new iG("",16777215,hD.DEFAULT_FONT_OPTION_16),this.lblDay.textColor=t.COLOR_DAY,this.lblDay.textSize=12,this.lblDay.x=8,this.lblDay.y=4,this.lblDay.eventMode="none",this.addChild(this.lblDay),this.reward=new M4,this.reward.scale=t.ICON_SCALE,this.reward.hideAmount(),this.reward.eventMode="none",this.addChild(this.reward),this.lblAmount=new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_18),this.lblAmount.textColor=t.COLOR_AMOUNT,this.lblAmount.textSize=13,this.lblAmount.eventMode="none",this.addChild(this.lblAmount),this.redDot=new Xe(RS.getTexture("UI_Ekkorr","Icon_RedDot_Red")),this.redDot.visible=!1,this.redDot.eventMode="none",this.addChild(this.redDot),this.stamp=new oAi(24),this.stamp.x=.5*i,this.stamp.y=.5*s,this.stamp.visible=!1,this.addChild(this.stamp),this.eventMode="static",this.cursor="pointer",this.hitArea=new $i(0,0,i,s),this.on("pointerup",()=>{ - this.data&&this.onTap&&this.onTap(this.data)} - )} - get width(){ - return t.WIDTH} - get height(){ - return t.HEIGHT} - update(i){ - this.data=i; - const s=t.WIDTH,e=t.HEIGHT,n="claimed"===i.state,h="claimable"===i.state,r=1===i.milestone; - this.bg.tint=n?t.CLAIMED_TINT:h?t.CLAIMABLE_TINT:r?t.MILESTONE_TINT:16777215,this.lblDay.text=String(i.day),this.lblDay.textColor=h||r?t.COLOR_GOLD:t.COLOR_DAY,t.applyReward(this.reward,i.rewardType,i.num),this.reward.hideAmount(),this.reward.x=.5*(s-this.reward.width*t.ICON_SCALE),this.reward.y=10,this.lblAmount.text="gem"===i.rewardType?String(i.num):`x${ - i.num} - `,this.lblAmount.x=.5*(s-this.lblAmount.width),this.lblAmount.y=e-this.lblAmount.height-3,this.redDot.visible=h,this.redDot.x=s-this.redDot.width-2,this.redDot.y=-2,this.reward.alpha=n?.45:1,this.lblAmount.alpha=n?.45:1,this.stamp.visible=n,n&&this.stamp.setDayRotation(i.day)} - playStampPop(){ - this.stamp.playPop()} - static getRewardName(t){ - switch(t){ - case"gem":return NB.getText("COMMON_350","보석"); - case"heroGacha":return NB.getText("GAME_217","영웅 뽑기권"); - case"heroSelect":return NB.getText("GAME_769","영웅 선택권"); - case"petGacha":return NB.getText("GAME_772","정령의 고원 입장권"); - case"treasureGacha":return NB.getText("GAME_218","유물 뽑기권"); - case"runeTicket":return NB.getText("GAME_1500","크리스탈 뽑기권"); - case"honorCoin":return NB.getText("GAME_88","명예코인"); - case"heroTrans":return NB.getText("GAME_1223","영웅 초월권"); - default:return t} - } - static applyReward(t,i,s){ - switch(i){ - case"gem":default:t.setData(v4.gem,s); - break; - case"heroGacha":t.setData(v4.ticket,s,5,-1,v4.heroGacha); - break; - case"heroSelect":t.setData(v4.ticket,s,-1,1,v4.heroSelect); - break; - case"petGacha":t.setData(v4.ticket,s,1,-1,v4.pet); - break; - case"treasureGacha":t.setData(v4.ticket,s,-1,-1,v4.treasureGacha); - break; - case"runeTicket":t.setData(v4.runeTicket,s); - break; - case"honorCoin":t.setData(v4.honorCoin,s); - break; - case"heroTrans":t.setData(v4.trans,s,5,-1,v4.hero)} - } - } - ; - Qt(aAi,"StampDayCell"),Zt(aAi,"WIDTH",114),Zt(aAi,"HEIGHT",72),Zt(aAi,"ICON_SCALE",.6),Zt(aAi,"COLOR_DAY",10325880),Zt(aAi,"COLOR_GOLD",16767354),Zt(aAi,"COLOR_AMOUNT",16777215),Zt(aAi,"CLAIMED_TINT",9211020),Zt(aAi,"MILESTONE_TINT",16771512),Zt(aAi,"CLAIMABLE_TINT",16774095),Zt(aAi,"BG_COLOR",6904901),Zt(aAi,"BG_RADIUS",10); - let cAi=aAi; - const lAi=class t extends pB{ - constructor(){ - super(),Zt(this,"lblMsg"),Zt(this,"lblProgress"),Zt(this,"panel"),Zt(this,"cells",[]),Zt(this,"nextBanner"),Zt(this,"btnClaim"),Zt(this,"placed",!1),Zt(this,"requestPending",!1),this.width=580,this.title=NB.getText("GAME_1533","30일 선물"); - const i=hD.LABEL_OPTION_NO_DROP_SHADOW; - i.fill=16638906,i.lineHeight=24,i.fontSize=16,i.stroke={ - color:"#000000",width:4,join:"round"} - ,i.align="center",this.lblMsg=new iG("",i.fill,i),this.lblMsg.eventMode="none",this.contentContainer.addChild(this.lblMsg),this.lblProgress=new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_18),this.lblProgress.textColor=16767354,this.lblProgress.eventMode="none",this.contentContainer.addChild(this.lblProgress),this.panel=new hE({ - texture:RS.getTexture("UI_Ekkorr","Popup_Bg_03"),leftWidth:30,topHeight:30,rightWidth:30,bottomHeight:30} - ),this.panel.width=t.PANEL_WIDTH,this.panel.x=t.PANEL_X,this.panel.eventMode="none",this.panel.visible=!1,this.contentContainer.addChild(this.panel); - for(let t=0; - t<30; - t++){ - const t=new cAi; - t.onTap=t=>this.showRewardToast(t),this.cells.push(t),this.contentContainer.addChild(t)} - this.nextBanner=new fAi(4*cAi.WIDTH+3*t.GAP_X),this.nextBanner.onTap=t=>this.showRewardToast(t),this.contentContainer.addChild(this.nextBanner),this.btnClaim=new Gqt(""),this.btnClaim.autoResize=!1,this.btnClaim.width=300,this.btnClaim.height=60,this.btnClaim.onClick=()=>{ - this.claim()} - ,this.contentContainer.addChild(this.btnClaim)} - static getInstance(){ - return null==this.instance&&(this.instance=new t),this.instance} - updateLayout(){ - const i=cAi.WIDTH,s=cAi.HEIGHT,e=t.GAP_X,n=t.GAP_Y,h=t.COLUMNS; - this.lblMsg.x=.5*(this.width-this.lblMsg.width),this.lblMsg.y=64,this.panel.y=this.lblMsg.y+this.lblMsg.height+12; - const r=h*i+(h-1)*e,o=this.panel.x+.5*(t.PANEL_WIDTH-r),a=this.panel.y+t.PAD_TOP,c=Math.ceil(30/h); - for(let t=0; - t<30; - t++){ - const r=this.cells[t]; - r.x=o+t%h*(i+e),r.y=a+Math.floor(t/h)*(s+n)} - this.nextBanner.x=o,this.nextBanner.y=a+c*(s+n),this.panel.height=this.nextBanner.y+(this.nextBanner.visible?this.nextBanner.height:0)+t.PAD_BOTTOM-this.panel.y,this.btnClaim.x=.5*(this.width-this.btnClaim.width),this.btnClaim.y=this.panel.y+this.panel.height+14,this.height=this.btnClaim.y+this.btnClaim.height+26,this.applyVerticalPlacement()} - placeVertically(t){ - this.placed=!0,this.applyVerticalPlacement()} - applyVerticalPlacement(){ - if(!this.placed)return; - const t=SS.bottomAnchorY,i=Math.max(10,.35*(t-this.height)); - this.y=i+.5*this.height} - setData(){ - this.title=NB.getText("GAME_1533","30일 선물"),this.lblMsg.text=NB.getText("GAME_1534","접속할 때마다 도장 쾅!"),this.updateSections()} - updateSections(){ - const t=d$.getInstance(),i=t.status; - this.lblProgress.visible=!1; - for(let e=0; - e<this.cells.length; - e++){ - const t=i.schedule[e]; - t?(this.cells[e].visible=!0,this.cells[e].update(t)):this.cells[e].visible=!1} - const s=i.schedule[i.claimedCount]; - if(s?(this.nextBanner.visible=!0,this.nextBanner.update(s,t.hasReward()?NB.getText("GAME_1538","오늘의 선물"):NB.getText("GAME_1539","내일의 선물"))):this.nextBanner.visible=!1,t.hasReward()){ - const t=i.claimedCount+1; - this.btnClaim.text=NB.getValueReplace("GAME_1535","##",t,`${ - t} - 번째 도장 찍기`),this.btnClaim.activated=!0} - else this.btnClaim.text=t.isCompleted()?NB.getText("GAME_1537","모든 선물을 받았어요"):NB.getText("GAME_1536","내일 다시 만나요"),this.btnClaim.activated=!1; - this.updateLayout()} - showRewardToast(t){ - const i=cAi.getRewardName(t.rewardType),s="gem"===t.rewardType?`${ - i} - ${ - t.num} - `:`${ - i} - x${ - t.num} - `; - bH.getInstance().showMessage(s)} - async claim(){ - var t,i; - const s=d$.getInstance(); - if(this.requestPending||!s.hasReward())return; - this.requestPending=!0; - const e=await sD.getInstance().stampCalendar.claim(!0); - if(0==e.success)return this.requestPending=!1,void AB.getInstance().showError(e); - const n=e.body; - if(!1===(null==n?void 0:n.success))return this.requestPending=!1,await s.init(),void this.updateSections(); - n.user&&(TG.setUserData(n.user),LH.getInstance().updateGem()),n.inventory&&HYt.getInstance().setData(n),n.transTicket&&jYt.getInstance().setData(n.transTicket),n.status&&s.setStatusData(n.status),this.updateSections(); - const h=Number((null==(t=n.reward)?void 0:t.day)??0); - h>=1&&h<=30&&this.cells[h-1].playStampPop(),"gem"===(null==(i=n.reward)?void 0:i.rewardType)&&this.displayGemGathering(this.contentContainer,Number(n.reward.num)),this.requestPending=!1} - displayGemGathering(t,i){ - const s=t.getGlobalPosition(),e=SS.stage.toLocal(s); - Iii.getInstance().getGem(e.x+.5*this.width-15,e.y+.5*this.height-20,i,Math.min(30,i),BYt.getInstance())} - } - ; - Qt(lAi,"StampCalendarPopup"),Zt(lAi,"instance"),Zt(lAi,"PANEL_X",25),Zt(lAi,"PANEL_WIDTH",530),Zt(lAi,"PAD_X",24),Zt(lAi,"PAD_TOP",10),Zt(lAi,"PAD_BOTTOM",12),Zt(lAi,"GAP_X",8),Zt(lAi,"GAP_Y",7),Zt(lAi,"COLUMNS",4); - let uAi=lAi; - const dAi=class t extends Ke{ - constructor(i=482){ - super(),Zt(this,"w"),Zt(this,"bg"),Zt(this,"reward"),Zt(this,"lblDay"),Zt(this,"lblReward"),Zt(this,"redDot"),Zt(this,"onTap",null),Zt(this,"data",null),this.w=i; - const s=this.w,e=t.HEIGHT; - this.bg=new ep,this.bg.roundRect(0,0,s,e,cAi.BG_RADIUS).fill({ - color:cAi.BG_COLOR} - ),this.bg.eventMode="none",this.addChild(this.bg),this.reward=new M4,this.reward.scale=.62,this.reward.hideAmount(),this.reward.eventMode="none",this.addChild(this.reward),this.lblDay=new iG("",16777215,hD.DEFAULT_FONT_OPTION_16),this.lblDay.textColor=16767354,this.lblDay.textSize=13,this.lblDay.eventMode="none",this.addChild(this.lblDay),this.lblReward=new iG("",16777215,hD.DEFAULT_FONT_OPTION_16),this.lblReward.textColor=16777215,this.lblReward.textSize=13,this.lblReward.eventMode="none",this.addChild(this.lblReward),this.redDot=new Xe(RS.getTexture("UI_Ekkorr","Icon_RedDot_Red")),this.redDot.visible=!1,this.redDot.eventMode="none",this.addChild(this.redDot),this.eventMode="static",this.cursor="pointer",this.hitArea=new $i(0,0,s,e),this.on("pointerup",()=>{ - this.data&&this.onTap&&this.onTap(this.data)} - )} - get width(){ - return this.w} - get height(){ - return t.HEIGHT} - update(i,s){ - this.data=i; - const e=this.w,n=t.HEIGHT,h="claimable"===i.state; - this.bg.tint=h?t.CLAIMABLE_TINT:t.MILESTONE_TINT,cAi.applyReward(this.reward,i.rewardType,i.num),this.reward.hideAmount(); - const r=NB.getValueReplace("GAME_1550","##",i.day,`${ - i.day} - 일차`); - this.lblDay.text=`${ - s} - · ${ - r} - `; - const o=cAi.getRewardName(i.rewardType); - this.lblReward.text="gem"===i.rewardType?`${ - o} - ${ - i.num} - `:`${ - o} - x${ - i.num} - `; - const a=.62*this.reward.width,c=.62*this.reward.height,l=Math.max(this.lblDay.width,this.lblReward.width),u=.5*(e-(a+14+l)); - this.reward.x=u,this.reward.y=.5*(n-c)+1; - const d=u+a+14; - this.lblDay.x=d+.5*(l-this.lblDay.width),this.lblDay.y=11,this.lblReward.x=d+.5*(l-this.lblReward.width),this.lblReward.y=34,this.redDot.visible=h,this.redDot.x=e-this.redDot.width-2,this.redDot.y=-2} - } - ; - Qt(dAi,"StampNextRewardBanner"),Zt(dAi,"HEIGHT",62),Zt(dAi,"MILESTONE_TINT",16771512),Zt(dAi,"CLAIMABLE_TINT",16774095); - let fAi=dAi; - const pAi=Object.freeze(Object.defineProperty({ - __proto__:null,StampCalendarPopup:uAi} - ,Symbol.toStringTag,{ - value:"Module"} - )),wAi=[[72,4,138],[49,4,170],[39,4,170],[35,4,168],[45,4,170],[60,4,154],[43,8,170],[54,4,170],[40,4,170],[26,5,170],[41,4,170],[35,4,170],[45,4,170],[39,5,170],[42,4,162],[43,4,170],[46,4,170],[39,4,170],[35,4,170],[50,4,170],[39,4,170],[44,4,170],[41,4,170],[44,4,170],[60,4,142],[44,4,166],[53,5,170],[43,4,170],[48,4,170],[27,4,163],[44,4,170],[51,4,170],[17,10,170],[36,5,170],[44,4,170],[50,4,170],[38,4,170],[56,5,162],[44,24,170],[35,5,170],[47,5,170],[50,4,170],[53,4,164],[49,5,170],[50,7,170],[43,5,170],[52,5,149],[39,4,170]],gAi=236/256,mAi="boat_gear.webp",vAi="gear_chest.webp",_Ai="boat_big.webp",MAi="boat_deco.webp",bAi="area_stamp.webp",yAi="menu_icons.webp",EAi="monster_icons.webp",AAi=["catfish","eel","sturgeon","manta","turtle","shark","whaleShark","whale","megalodon","croc","jelly","hammer","narwhal","squid","angler","octopus","sperm","serpent"],SAi="harpoon_icons.webp",TAi="hunt_mats.webp",CAi=["bone","thunder"],OAi=["wood","iron","mithril","bone","thunder"],IAi=["fish","gear","net","quest","shop","map"],kAi="hazard_cuts/",xAi="gear_backgrounds/",RAi=192,PAi=class{ - static ensure(){ - return this.sheet&&this.topInfo?Promise.resolve():(this.pending??(this.pending=Promise.all([this.sheet?Promise.resolve():this.load(),this.ensureTopdown()]).then(()=>{ - } - ).finally(()=>{ - this.pending=null} - )),this.pending)} - static async load(){ - const t=`?v=${ - CS.appVersion} - &atlas=20261011-fish-263`,i=await fetch(IS.getAssetPath(`UI_FISH.json${ - t} - `)); - if(!i.ok)throw new Error(`UI_FISH: HTTP ${ - i.status} - `); - const s=await i.json(),e=await wd.load({ - src:IS.getAssetPath(`UI_FISH.webp${ - t} - `),parser:"loadTextures"} - ),n=new Kn(e,s); - await n.parse(),this.sheet=n} - static async loadGiantSpines(){ - if(this.giantSpine.whale)return; - const t="fishing_giant_whale_skel",i="fishing_giant_whale_atlas"; - try{ - wd.cache.has(t)||wd.add({ - alias:t,src:IS.getAssetPath("fishing/topdown/spine/giant_whale.json")} - ),wd.cache.has(i)||wd.add({ - alias:i,src:this.topPath("spine/giant_whale.atlas")} - ),await wd.load([t,i]),this.giantSpine.whale={ - skeleton:t,atlas:i} - } - catch(frt){ - } - } - static topPath(t){ - const i=t.startsWith(xAi)?"20261008-gear-background-v1":"giants.json"===t||"spine/giant_whale.atlas"===t?"20261004-giants-v1":t===mAi?"20261012-boat-gear-v3":t===vAi?"20261008-gear-chest-v1":t===_Ai||t===MAi||/^boat_[4-8]\.png$/.test(t)?"20261012-ship9-v1":t===bAi?"20261008-area-stamp-v1":t===yAi?"20261008-menu-icons-v1":t===EAi?"20261011-monster-icons-v2":t===SAi?"20261010-harpoon-icons-v2":t===TAi?"20261010-hunt-mats-v1":t.startsWith(kAi)?"20261009-hazard-cut-v2":"20261001-topdown-v25"; - return IS.getAssetPath(`fishing/topdown/${ - t} - ?v=${ - CS.appVersion} - &art=${ - i} - `)} - static async ensureTopdown(){ - if(this.topInfo)return; - const t=await fetch(this.topPath("maps.json"),{ - cache:"no-store"} - ); - if(!t.ok)throw new Error(`topdown maps: HTTP ${ - t.status} - `); - const i=await t.json(),s=await fetch(this.topPath("terrain.json"),{ - cache:"no-store"} - ); - if(!s.ok)throw new Error(`topdown terrain: HTTP ${ - s.status} - `); - this.terrainInfo=await s.json(); - const e=await fetch(this.topPath("world.json"),{ - cache:"no-store"} - ); - if(!e.ok)throw new Error(`topdown world: HTTP ${ - e.status} - `); - this.worldInfo=await e.json(); - const n={ - autoGenerateMipmaps:!0} - ,[h,[r,o,a,c,l,u,d,f,p,w,g,m,v,_,M,b,y,E,A,S,T,C]]=await Promise.all([wd.load(this.topPath("giants.json")),Promise.all([["boat_0.png",n],["boat_1.png",n],["boat_2.png",n],["boat_3.png",n],["boat_4.png",n],["boat_5.png",n],["boat_6.png",n],["boat_7.png",n],["boat_8.png",n],["shadow.png"],["water_caustic.png"],["water_blotch.png"],["floats.webp",n],["angler.webp",n],["lanterns.png",n],["npc_boats.webp",n],["guests.webp",n],["guest_heads.webp",n],["bubbles.webp",n],["times.png",n],["journey_npcs.webp",n],["glints.png",n]].map(([t,i])=>wd.load({ - src:this.topPath(t),parser:"loadTextures",...i?{ - data:i} - :{ - } - } - )))]),O=Qt(t=>({ - sharp:h.textures[t],deep:h.textures[t]} - ),"giant"),I=await fetch(this.topPath("gear.json"),{ - cache:"no-store"} - ); - if(!I.ok)throw new Error(`topdown gear: HTTP ${ - I.status} - `); - const k=Qt((t,i)=>Array.from({ - length:i} - ,(i,s)=>new ls({ - source:t.source,frame:new $i(s*t.height,0,t.height,t.height)} - )),"strip"),x=Qt(t=>wAi.map(([i,s,e],n)=>new ls({ - source:t.source,frame:new $i(n%Math.floor(t.width/256)*256+i,256*Math.floor(n/Math.floor(t.width/256))+s,e,e)} - )),"faces"),R=Qt((t,i)=>Array.from({ - length:Math.floor(t.width/i)*Math.floor(t.height/i)} - ,(s,e)=>new ls({ - source:t.source,frame:new $i(e%Math.floor(t.width/i)*i,Math.floor(e/Math.floor(t.width/i))*i,i,i)} - )),"grid"); - this.gearArt={ - floats:k(v,4),angler:k(_,2),lanterns:k(M,3),npcBoats:k(b,3),guests:k(y,3),guestHeads:k(E,3),bubbles:k(A,3),times:k(S,4),journeyNpcs:R(T,256),journeyFaces:x(T),glints:k(C,12),giants:{ - whale:O("whale"),shark:O("shark"),manta:O("manta"),catfish:O("catfish"),eel:O("eel")} - ,info:await I.json()} - ,await this.loadGiantSpines(),this.boatGearTex=await wd.load({ - src:this.topPath(mAi),parser:"loadTextures",data:n} - ).catch(()=>null),this.gearChestTex=await wd.load({ - src:this.topPath(vAi),parser:"loadTextures",data:n} - ).catch(()=>null),this.boatBigTex=await wd.load({ - src:this.topPath(_Ai),parser:"loadTextures",data:n} - ).catch(()=>null),this.boatDecoTex=await wd.load({ - src:this.topPath(MAi),parser:"loadTextures",data:n} - ).catch(()=>null),this.areaStampTex=await wd.load({ - src:this.topPath(bAi),parser:"loadTextures",data:n} - ).catch(()=>null),this.menuIconTex=await wd.load({ - src:this.topPath(yAi),parser:"loadTextures",data:n} - ).catch(()=>null),this.monsterIconTex=await wd.load({ - src:this.topPath(EAi),parser:"loadTextures",data:n} - ).catch(()=>null),this.harpoonIconTex=await wd.load({ - src:this.topPath(SAi),parser:"loadTextures",data:n} - ).catch(()=>null),this.huntMatTex=await wd.load({ - src:this.topPath(TAi),parser:"loadTextures",data:n} - ).catch(()=>null),this.gearBackgrounds=await Promise.all(Array.from({ - length:7} - ,(t,i)=>wd.load({ - src:this.topPath(`${ - xAi} - star_${ - i+1} - .webp`),parser:"loadTextures",data:n} - ).catch(()=>null))),this.toolTex=await wd.load({ - src:this.topPath("tools_v3/atlas.webp"),parser:"loadTextures",data:n} - ).catch(()=>null),this.topBoats=[r,o,a,c,l,u,d,f,p],this.topShadow=w; - for(const G of[g,m])G.source.addressMode="repeat"; - this.waterTex={ - caustic:g,blotch:m} - ; - const[P,N]=await Promise.all(["foam.png","wake_strip.png"].map(t=>wd.load({ - src:this.topPath(t),parser:"loadTextures",data:{ - autoGenerateMipmaps:!0} - } - ))),L=P.width/4,D=[]; - for(let G=0; - G<16; - G++)D.push(new ls({ - source:P.source,frame:new $i(G%4*L,Math.floor(G/4)*L,L,L)} - )); - N.source.addressMode="repeat",this.foamTex={ - puffs:D.slice(0,8),crowns:D.slice(8,12),churn:D.slice(12,16),wake:N} - ,this.topInfo=i} - static topdownInfo(t){ - var i; - const s=null==(i=this.topInfo)?void 0:i[t]; - if(!s)throw new Error(`topdown map not ready: ${ - t} - `); - return s} - static topdownMap(t){ - let i=this.topMaps.get(t); - return i||(i=wd.load({ - src:this.topPath(this.topdownInfo(t).file),parser:"loadTextures"} - ),this.topMaps.set(t,i)),i} - static topdownChunk(t,i,s){ - return wd.load({ - src:this.topPath(`${ - this.topdownInfo(t).file} - ${ - i} - _${ - s} - .webp`),parser:"loadTextures"} - )} - static unloadChunk(t,i,s){ - wd.unload(this.topPath(`${ - this.topdownInfo(t).file} - ${ - i} - _${ - s} - .webp`))} - static terrainLand(t){ - var i,s; - return(null==(s=null==(i=this.terrainInfo)?void 0:i.races[t])?void 0:s.land)??null} - static world(){ - if(!this.worldInfo)throw new Error("topdown not ready"); - return this.worldInfo} - static worldMap(){ - return this.worldTex??(this.worldTex=wd.load({ - src:this.topPath("world_map.webp"),parser:"loadTextures",data:{ - autoGenerateMipmaps:!0} - } - )),this.worldTex} - static terrain(t){ - let i=this.terrains.get(t); - if(!i){ - const s=this.terrainInfo,e=null==s?void 0:s.races[t]; - if(!s||!e)throw new Error(`terrain not ready: ${ - t} - `); - i=wd.load({ - src:this.topPath(e.file),parser:"loadTextures"} - ).then(t=>{ - const i=Qt((i,e)=>new ls({ - source:t.source,frame:new $i(i.x+e%i.cols*i.pitch+s.pad,i.y+Math.floor(e/i.cols)*i.pitch+s.pad,i.size,i.size)} - ),"cut"),n=Qt(t=>e[t].map((e,n)=>({ - tex:i(s.layout[t],n),w:e.w,h:e.h} - )),"props"),h=Qt(t=>t[0]<<16|t[1]<<8|t[2],"rgb"); - return{ - terrain:Array.from({ - length:240} - ,(t,e)=>i(s.layout.terrain,e)),small:n("small"),large:n("large"),landmarks:n("landmarks"),sand:h(e.sand),wet:h(e.wet),land:e.land} - } - ),this.terrains.set(t,i)} - return i} - static water(){ - if(!this.waterTex)throw new Error("topdown not ready"); - return this.waterTex} - static toolIcon(t,i){ - var s; - const e="auto"===t?i-1:i; - if(!Number.isInteger(e)||e<0||e>=7)return null; - if("bobber"===t&&i<4)return(null==(s=this.gearArt)?void 0:s.floats[i])??null; - const n=["line","rod","reel","bobber","icebox","auto"].indexOf(t); - if(!this.toolTex||n<0)return null; - const h=`${ - t} - _${ - i} - `; - let r=this.toolCells.get(h); - return r||(r=new ls({ - source:this.toolTex.source,frame:new $i(256*e,256*n,256,256)} - ),this.toolCells.set(h,r)),r} - static gearBackground(t){ - return this.gearBackgrounds[Math.max(1,Math.min(7,t))-1]??null} - static dressBigBoat(t,i,s){ - for(const o of t.removeChildren())o.destroy(); - if(!this.gearArt)return; - const e=this.gearArt.info.boats[this.boatArt(i)],n=e.sail?this.boatDeco("sail",s.sail):null,h=e.bow?this.boatDeco("prow",s.prow):null; - if(n&&e.sail){ - const i=new Xe(n); - i.anchor.set(.5),i.position.set(3*e.sail[0],3*e.sail[1]),t.addChild(i)} - if(h&&e.bow){ - const i=new Xe(h); - i.anchor.set(.5,.78125),i.position.set(3*e.bow[0],3*e.bow[1]),t.addChild(i)} - const r=new Xe(this.gearArt.lanterns[Math.min(2,Math.floor(this.boatArt(i)/2))]); - r.anchor.set(.5),r.position.set(3*e.lantern[0],3*e.lantern[1]),r.scale.set(.2/.36*3),t.addChild(r); - for(const o of t.children)o.eventMode="none"} - static boatDeco(t,i){ - const s=this.boatDecoTex; - if(!s||i<0||i>4)return null; - if(!this.boatDecoCells.length){ - const t=s.height/2; - this.boatDecoCells=Array.from({ - length:10} - ,(i,e)=>new ls({ - source:s.source,frame:new $i(e%5*t,Math.floor(e/5)*t,t,t)} - ))} - return this.boatDecoCells[("sail"===t?5:0)+i]} - static boatBig(t){ - const i=this.boatBigTex; - if(!i)return this.boat(t); - if(!this.boatBigCells.length){ - const t=i.width/3; - this.boatBigCells=Array.from({ - length:9} - ,(s,e)=>new ls({ - source:i.source,frame:new $i(e%3*t,Math.floor(e/3)*t,t,t)} - ))} - return this.boatBigCells[this.boatArt(t)]} - static hazardCut(t){ - let i=this.hazardCuts.get(t); - return i||(i=wd.load({ - src:this.topPath(`${ - kAi} - ${ - t} - .webp`),parser:"loadTextures",data:{ - autoGenerateMipmaps:!0} - } - ).catch(()=>null),this.hazardCuts.set(t,i)),i} - static menuIcon(t){ - const i=this.menuIconTex; - if(!i)return null; - if(!this.menuIconCells.length){ - const t=i.height; - this.menuIconCells=IAi.map((s,e)=>new ls({ - source:i.source,frame:new $i(e*t,0,t,t)} - ))} - return this.menuIconCells[IAi.indexOf(t)]} - static monsterIcon(t){ - const i=this.monsterIconTex,s=AAi.indexOf(t); - if(!i||s<0)return null; - if(!this.monsterIconCells.length){ - const t=i.height; - this.monsterIconCells=AAi.map((s,e)=>new ls({ - source:i.source,frame:new $i(e*t,0,t,t)} - ))} - return this.monsterIconCells[s]} - static harpoonIcon(t){ - const i=this.harpoonIconTex,s=OAi.indexOf(t); - if(!i||s<0)return null; - if(!this.harpoonIconCells.length){ - const t=i.height,s=Math.floor(i.width/t); - this.harpoonIconCells=OAi.map((e,n)=>n<s?new ls({ - source:i.source,frame:new $i(n*t,0,t,t)} - ):null)} - return this.harpoonIconCells[s]} - static huntMatIcon(t){ - const i=this.huntMatTex,s=CAi.indexOf(t); - if(!i||s<0)return null; - if(!this.huntMatCells.length){ - const t=i.height; - this.huntMatCells=CAi.map((s,e)=>new ls({ - source:i.source,frame:new $i(e*t,0,t,t)} - ))} - return this.huntMatCells[s]??null} - static areaStamp(t){ - const i=this.areaStampTex; - if(!i)return null; - if(!this.areaStampCells.length){ - const t=i.height; - this.areaStampCells=Array.from({ - length:6} - ,(s,e)=>new ls({ - source:i.source,frame:new $i(e*t,0,t,t)} - ))} - return this.areaStampCells["mini"===t?5:Math.max(1,Math.min(5,Math.round(t)))-1]} - static gearChest(t){ - const i=this.gearChestTex; - if(!i)return null; - if(!this.gearChestCells.length){ - const t=i.height; - this.gearChestCells=[0,1].map(s=>new ls({ - source:i.source,frame:new $i(s*t,0,t,t)} - ))} - return this.gearChestCells[t?1:0]} - static boatGearIcon(t,i){ - const s=this.boatGearTex; - if(!s)return null; - const e=6*t+i; - let n=this.boatGearCells.get(e); - return n||(n=new ls({ - source:s.source,frame:new $i(i*RAi,t*RAi,RAi,RAi)} - ),this.boatGearCells.set(e,n)),n} - static gear(){ - if(!this.gearArt)throw new Error("topdown not ready"); - return this.gearArt} - static foam(){ - if(!this.foamTex)throw new Error("topdown not ready"); - return this.foamTex} - static boatArt(t){ - return Math.max(0,Math.min(8,Math.round(t)))} - static boat(t){ - return this.topBoats[Math.max(0,Math.min(this.topBoats.length-1,this.boatArt(t)))]} - static shadow(){ - if(!this.topShadow)throw new Error("topdown not ready"); - return this.topShadow} - static fish(t){ - var i; - const s=null==(i=this.sheet)?void 0:i.textures[`fish_${ - String(t).padStart(3,"0")} - `]; - if(!s)throw new Error(`UI_FISH not ready: ${ - t} - `); - return s} - } - ; - Qt(PAi,"FishingAssets"),Zt(PAi,"sheet",null),Zt(PAi,"pending",null),Zt(PAi,"topInfo",null),Zt(PAi,"topBoats",[]),Zt(PAi,"topShadow",null),Zt(PAi,"topMaps",new Map),Zt(PAi,"giantSpine",{ - whale:null} - ),Zt(PAi,"terrainInfo",null),Zt(PAi,"worldInfo",null),Zt(PAi,"worldTex",null),Zt(PAi,"terrains",new Map),Zt(PAi,"waterTex",null),Zt(PAi,"boatGearTex",null),Zt(PAi,"toolTex",null),Zt(PAi,"toolCells",new Map),Zt(PAi,"gearBackgrounds",[]),Zt(PAi,"gearChestTex",null),Zt(PAi,"boatBigTex",null),Zt(PAi,"boatDecoTex",null),Zt(PAi,"boatDecoCells",[]),Zt(PAi,"boatBigCells",[]),Zt(PAi,"hazardCuts",new Map),Zt(PAi,"menuIconTex",null),Zt(PAi,"menuIconCells",[]),Zt(PAi,"monsterIconTex",null),Zt(PAi,"monsterIconCells",[]),Zt(PAi,"harpoonIconTex",null),Zt(PAi,"harpoonIconCells",[]),Zt(PAi,"huntMatTex",null),Zt(PAi,"huntMatCells",[]),Zt(PAi,"areaStampTex",null),Zt(PAi,"areaStampCells",[]),Zt(PAi,"gearChestCells",[]),Zt(PAi,"boatGearCells",new Map),Zt(PAi,"gearArt",null),Zt(PAi,"foamTex",null); - let NAi=PAi; - const LAi={ - "인간|강":["은빛강 상류","버들 샛강","조약돌 너른 못","들꽃 실개천","햇살 굽이","노을 소","물레방아 물길","은빛 샛강","은빛강 하류"],"인간|연안":["은빛강 어귀","갈매기 앞바다","소금 석호","조개 너른 만","노을 포구","파도 섬 사이","모래 난바다","돛단배 물길","등대 모래톱"],"인간|대양":["햇살 먼바다","갈매기 군도","파도 물길","고래 섬 사이","산호 난바다","푸른 해류","돌고래 암초","폭풍 한바다","햇살 군도"],"엘프|강":["이끼강 상류","고사리 너른 못","반딧불 굽이","이슬 샛강","꽃잎 실개천","버섯 물길","버들 여울","달빛 샛강","이끼강 하류"],"엘프|연안":["이끼강 어귀","해초 석호","진주 물길","조개 포구","물새 앞바다","이슬 너른 만","달빛 섬 사이","꽃잎 난바다","연꽃 모래톱"],"엘프|대양":["잎새 먼바다","해초 군도","진주 난바다","고래 한바다","산호 섬 사이","초록 암초","달빛 군도","바람 물길","고래 먼바다"],"언데드|강":["잿빛강 상류","마른 갈대 굽이","달그림자 샛강","가시 너른 못","녹슨 실개천","부엉이 소","검은 물길","잿빛 샛강","잿빛강 하류"],"언데드|연안":["잿빛강 어귀","안개 석호","해골 포구","녹슨 닻 섬 사이","뼈 앞바다","달그림자 석호","검은 물길","유령 너른 만","난파선 모래톱"],"언데드|대양":["망령 먼바다","안개 군도","난파선 난바다","검은 섬 사이","해골 암초","폭풍 군도","달그림자 물길","유령 섬 사이","망령 한바다"],"오크|강":["서리강 상류","얼음 샛강","눈보라 너른 못","늑대 실개천","북풍 물길","흰 소","바위 샛강","얼음꽃 웅덩이","서리강 하류"],"오크|연안":["서리강 어귀","고래뼈 석호","얼음 포구","북풍 앞바다","바위 물길","서리 너른 만","유빙 섬 사이","약탈선 석호","물개 포구"],"오크|대양":["고래 먼바다","유빙 난바다","폭풍 한바다","얼음 물길","북풍 군도","서리 해류","바다표범 섬 사이","흰 암초","고래 군도"]} - ,DAi=5e3,GAi=[1,1.15,1.3,1.4,1.5]; - function BAi(t){ - let i=2654435769^t; - return i=Math.imul(i^i>>>16,2246822507),i=Math.imul(i^i>>>13,3266489909),(i^i>>>16)>>>0} - function UAi(t,i,s,e=1){ - const n=BAi(Math.imul(t,7919)+Math.imul(i+1,104729))/4294967296; - return Math.max(200,Math.round((15e3+15e3*n)/GAi[s]/Math.max(1,e)))} - function FAi(t){ - return Math.max(2,5-t)} - function $Ai(t,i,s=1){ - t.k++,t.nextAt+=UAi(t.seed,t.k,i,s)} - function HAi(t,i,s,e){ - $Ai(t,i,s),e&&(t.nextAt+=3500)} - function WAi(t,i,s,e,n=[]){ - const h={ - ...t} - ; - for(; - h.k<i; - )HAi(h,s,e,n.includes(h.k)); - return h.nextAt} - Qt(BAi,"hash32$1"),Qt(UAi,"biteGap"),Qt(FAi,"idleOffNeed"),Qt($Ai,"advanceSeq"),Qt(HAi,"nextBite"),Qt(WAi,"biteAt"); - const VAi=["prow","sail","deck","harpoon","rod","bobber","net","lantern"],jAi=Qt(t=>"string"==typeof t&&VAi.includes(t),"isGearSlot"),KAi={ - rod:0,net:0,lantern:0,bobber:1,prow:1,deck:2,sail:2,harpoon:3} - ,zAi=Qt((t,i)=>t>=KAi[i],"slotOpen"),YAi=Qt(t=>`배 ★${ - KAi[t]+1} - 부터 열리는 칸이에요`,"slotLockText"),qAi=Qt(t=>VAi.indexOf(t),"GEAR_ICON_ROW"),XAi=VAi.length,JAi=["hold","bite","net"],QAi=Qt(t=>JAi.includes(t),"isToolMain"),ZAi=Qt(t=>aSi.includes(t),"isStatKey"),tSi=[1,2,3,4,5],iSi=[0,5,12,20,30],sSi=[1,1.15,1.3,1.4,1.5],eSi=[1,1.3,1.6,2,2],nSi=[40,60,90,120],hSi={ - hold:"버티는 힘 · 큰 개체",bite:"입질 · 귀한 물고기",net:"담는 칸"} - ; - function rSi(t,i){ - const s=Math.max(0,Math.min("net"===t?3:4,i)); - return"hold"===t?`힘 ${ - tSi[s]} - · ${ - iSi[s]} - %`:"bite"===t?`×${ - sSi[s]} - · ×${ - eSi[s]} - ${ - s>=4?" · 심해":""} - `:`${ - nSi[s]} - 마리`} - function oSi(t){ - return"hold"===t?"힘센 물고기를 버티고, 큰 물고기가 더 잘 나와요":"bite"===t?"입질이 빨라지고 귀한 물고기(★3 이상)가 더 잘 물어요 · ★4 부터 심해":"어망에 물고기를 더 많이 담아요"} - Qt(rSi,"toolMainValue"),Qt(oSi,"toolMainHelp"); - const aSi=["luck","hp","armor","repair","speed","aim","power","steal","icebox","big","star","protect","sell"],cSi={ - luck:[1,2,3,5,6,8,11],hp:[10,20,35,55,80,110,150],armor:[1,2,4,6,9,12,16],repair:[4,8,12,17,23,30,38],speed:[3,6,9,13,17,22,28],aim:[5,10,16,23,31,40,50],power:[5,10,16,23,31,40,50],steal:[3,6,9,13,17,22,28],icebox:[4,8,12,18,24,32,40],big:[4,8,13,19,26,34,43],star:[1,2,4,6,8,10,13],protect:[5,10,15,20,30,40,60],sell:[3,6,10,15,22,32,45]} - ,lSi={ - repair:60,steal:50,big:90,protect:120,sell:60} - ,uSi={ - luck:{ - name:"행운력",unit:"%"} - ,hp:{ - name:"내구도",unit:""} - ,armor:{ - name:"재난 피해 감소",unit:""} - ,repair:{ - name:"수리 시간",unit:"%↓"} - ,speed:{ - name:"배 속도",unit:"%"} - ,aim:{ - name:"작살 조준력",unit:"%"} - ,power:{ - name:"작살 공격력",unit:"%"} - ,steal:{ - name:"훔치는 시간",unit:"%↓"} - ,icebox:{ - name:"어망",unit:"마리"} - ,big:{ - name:"대물 확률",unit:"%"} - ,star:{ - name:"별 확률",unit:"%"} - ,protect:{ - name:"털림 보호",unit:"분"} - ,sell:{ - name:"물고기 판매가",unit:"%"} - } - ; - function dSi(t){ - switch(t){ - case"luck":return"귀한 물고기와 큰 물고기가 둘 다 조금씩 더 잘 잡혀요"; - case"star":return"별이 많은 귀한 물고기(★3 이상)가 더 자주 잡혀요"; - case"big":return"더 크고 무거운 물고기가 잘 잡혀요. 특대·왕도 더 자주 나와요"; - case"hp":return"배가 더 튼튼해져서 쉽게 부서지지 않아요"; - case"armor":return"재난을 맞거나 먼 바다로 나갈 때 배가 덜 상해요"; - case"repair":return"부서진 배를 더 빨리 고쳐요"; - case"speed":return"배가 더 빨리 움직여요"; - case"aim":return"몬스터에게 작살을 던질 때 더 잘 맞아요"; - case"power":return"작살로 몬스터에게 주는 피해가 커져요"; - case"steal":return"다른 사람 어망에서 물고기를 더 빨리 훔쳐요"; - case"icebox":return"어망에 물고기를 더 많이 담을 수 있어요"; - case"protect":return"털린 뒤 다시 털리지 않는 시간이 길어져요"; - case"sell":return"물고기를 팔 때 더 많은 골드를 받아요"} - } - Qt(dSi,"statHelp"); - const fSi={ - prow:"luck",sail:"speed",deck:"hp",harpoon:"power",rod:"hold",bobber:"bite",net:"net",lantern:"sell"} - ,pSi={ - prow:[["사자 선수상","hp","armor"],["인어 선수상","big","aim"],["용 선수상","star","power"],["독수리 선수상","aim","speed"],["고래 선수상","icebox","hp"]],deck:[["참나무 갑판","repair","armor"],["철판 갑판","armor","repair"],["고래뼈 갑판","icebox","luck"],["흑단 갑판","protect","steal"],["산호 갑판","luck","big"]],harpoon:[["갈고리 작살","aim","steal"],["방패 작살","armor","hp"],["산호 작살","repair","luck"],["관통 작살","aim","big"],["소라 작살","protect","speed"]],rod:[["버들 낚싯대","big","luck"],["대나무 낚싯대","star","icebox"],["물푸레 낚싯대","big","sell"],["룬 낚싯대","star","big"],["명인의 낚싯대","luck","star"]],bobber:[["깃털 찌","star","luck"],["코르크 찌","big","icebox"],["반딧불 찌","star","sell"],["황금 찌","luck","big"],["유리 찌","sell","star"]],net:[["삼베 어망","icebox","protect"],["그물 어망","icebox","sell"],["드워프 어망","icebox","armor"],["마법 어망","icebox","luck"],["용 어망","icebox","steal"]],sail:[["삼베 돛","armor","repair"],["비단 돛","luck","big"],["폭풍 돛","steal","power"],["별빛 돛","aim","star"],["가죽 돛","hp","protect"]],lantern:[["반딧불 등불","big","star"],["등대 등불","aim","speed"],["도깨비불 등불","power","steal"],["달빛 등불","luck","hp"],["촛불 등불","repair","armor"]]} - ,wSi={ - prow:10,deck:30,sail:60,lantern:70,harpoon:80,rod:90,bobber:100,net:110} - ,gSi=VAi.flatMap(t=>pSi[t].map(([i,s,e],n)=>({ - id:wSi[t]+n+1,slot:t,v:n,name:i,stats:[fSi[t],s,e]} - ))),mSi=new Map(gSi.map(t=>[t.id,t])),vSi=Qt(t=>mSi.get(t),"gearDef"),_Si={ - prow:"선수상",sail:"돛",deck:"갑판",harpoon:"작살",rod:"낚싯대",bobber:"찌",net:"어망",lantern:"등불"} - ,MSi=[[1,.7],[2,.22],[3,.07],[4,.01]],bSi=Qt(t=>Math.max(1,Math.min(7,t+1)),"equipCap"); - function ySi(t,i){ - const s=vSi(t); - if(!s)return{ - } - ; - const e=Math.max(1,Math.min(7,i))-1,n={ - } - ,h=Qt((t,i)=>{ - n[t]=Math.round(10*((n[t]??0)+cSi[t][e]*i))/10} - ,"add"); - return ZAi(s.stats[0])&&h(s.stats[0],1),h(s.stats[1],.6),i>=5&&h(s.stats[2],.6),n} - Qt(ySi,"itemStats"); - const ESi=Qt(()=>Object.fromEntries(aSi.map(t=>[t,0])),"zeroStats"); - function ASi(t){ - var i; - const s=ESi(),e=t.gearBox; - if(!e)return s; - const n=bSi(t.gear.boat); - for(const[h,r]of Object.entries(e.equipped)){ - const o=e.items.find(t=>t.uid===r); - if(o&&jAi(h)&&zAi(t.gear.boat,h)&&(null==(i=vSi(o.id))?void 0:i.slot)===h)for(const[t,i]of Object.entries(ySi(o.id,Math.min(n,o.star))))s[t]+=i} - for(const[h,r]of Object.entries(lSi))s[h]=Math.min(r,s[h]); - for(const h of aSi)s[h]=Math.round(10*s[h])/10; - return s} - Qt(ASi,"gearStats"); - const SSi=Qt(t=>1+ASi(t).sell/100,"saleMult"),TSi=Qt((t,i)=>Math.round(t*SSi(i)),"saleGold"); - function CSi(t,i,s){ - return t.items.filter(t=>{ - var e; - return t.star<=s&&(null==(e=vSi(t.id))?void 0:e.slot)===i} - ).sort((t,i)=>i.star-t.star||t.uid-i.uid)[0]} - function OSi(t,i,s){ - if(!t)return; - const e=CSi(t,i,s); - if(!e)return; - const n=t.items.find(s=>s.uid===t.equipped[i]); - return!n||n.star>s||e.star>n.star?e:void 0} - function ISi(t){ - if(!t)return[]; - const i=new Set([...Object.values(t.equipped),...t.kept??[]]),s=new Map; - for(const e of t.items){ - const t=vSi(e.id); - if(!t||i.has(e.uid)||e.star>=7)continue; - const n=`${ - t.slot} - |${ - e.star} - `; - s.set(n,(s.get(n)??0)+1)} - return[...s.entries()].filter(([,t])=>t>=3).map(([t,i])=>({ - slot:t.split("|")[0],star:Number(t.split("|")[1]),n:i} - ))} - function kSi(t){ - if(!t)return[]; - const i=new Set(Object.values(t.equipped)),s=new Map; - for(const e of t.items){ - const t=vSi(e.id); - if(!t||i.has(e.uid)||e.star>=7)continue; - const n=`${ - t.slot} - |${ - e.star} - `; - s.set(n,[...s.get(n)??[],e])} - return[...s.entries()].filter(([,t])=>t.length>=3).map(([t,i])=>({ - slot:t.split("|")[0],star:Number(t.split("|")[1]),list:i.sort((t,i)=>t.uid-i.uid)} - )).sort((t,i)=>t.star-i.star||VAi.indexOf(t.slot)-VAi.indexOf(i.slot))} - Qt(CSi,"bestGear"),Qt(OSi,"betterGear"),Qt(ISi,"mergeable"),Qt(kSi,"mergeGroups"); - const xSi=["prow","sail","lantern"]; - function RSi(t){ - const i=t.gearBox; - return xSi.map(t=>{ - const s=null==i?void 0:i.items.find(s=>s.uid===i.equipped[t]),e=s?vSi(s.id):void 0; - return e&&e.slot===t?String(e.v):"-"} - ).join("")} - Qt(RSi,"decoOf"); - const PSi=Qt(t=>{ - const i=Qt(i=>{ - const s=null==t?void 0:t[i]; - return s&&s>="0"&&s<="4"?Number(s):-1} - ,"at"); - return{ - prow:i(0),sail:i(1),lantern:i(2)} - } - ,"decoParts"),NSi=[10354538,16773296,7000319,13623551,16757575],LSi=[3032396,10135467,6142819,4886754,10513640,16734815,16757806,4184298,15967960,7044351],DSi={ - LEVELS:9,MAX_HP:[100,140,190,250,320,400,500,620,760],ARMOR:[0,5,11,18,26,35,45,56,68],REPAIR_MIN:[1,3,6,12,20,32,45,60,80],ZONE_REPAIR_ADD_MIN:{ - R:0,C:10,O:20} - ,MOVE_MIN:20,ENTRY:{ - R:0,C:2,O:5} - ,TRAVEL:{ - R:4,C:16,O:36} - ,HAZARD_MS:3e5,HELP_PCT:.03,HELP_MAX:10,HELP_MS:36e5,HELP_RANGE:380} - ,GSi=["인간|R","오크|R","엘프|R","언데드|R","인간|C","오크|C","엘프|C","언데드|C","인간|O","오크|O","엘프|O","언데드|O"],BSi=[1,1.08,1.16,1.24],USi=Qt(t=>BSi[(t-1)%4],"tierSub"),FSi=[0,0,0,0,3,3,3,4,5,6,6,6],$Si=Qt((t,i)=>GSi.indexOf(`${ - t} - |${ - i} - `)+1,"regionTier"),HSi={ - R:[{ - key:"gust",text:"돌풍이 불어서",dmg:4,w:4} - ,{ - key:"rapid",text:"급류에 휩쓸려",dmg:9,w:3} - ,{ - key:"rock",text:"바위에 긁혀서",dmg:7,w:2} - ],C:[{ - key:"gust",text:"돌풍이 불어서",dmg:14,w:3} - ,{ - key:"wave",text:"거센 파도로",dmg:34,w:3} - ,{ - key:"reef",text:"암초에 부딪혀",dmg:28,w:2} - ],O:[{ - key:"swell",text:"큰 너울에",dmg:63,w:3} - ,{ - key:"storm",text:"폭풍이 몰아쳐",dmg:89,w:2} - ,{ - key:"thunder",text:"번개를 맞아",dmg:77,w:1} - ,{ - key:"monster",text:"몬스터의 물살로",dmg:69,w:2} - ]} - ,WSi={ - "인간":{ - key:"log",text:"떠내려온 통나무에 부딪혀"} - ,"엘프":{ - key:"vine",text:"가시 덩굴에 걸려"} - ,"언데드":{ - key:"ghost",text:"망령의 손길에"} - ,"오크":{ - key:"ice",text:"얼음 덩어리에 부딪혀"} - } - ,VSi={ - R:11,C:30,O:83} - ; - function jSi(t,i){ - const s=USi($Si(t,i)); - return[...HSi[i],{ - ...WSi[t],dmg:VSi[i],w:1} - ].map(t=>({ - ...t,dmg:Math.round(t.dmg*s)} - ))} - Qt(jSi,"hazardsOf"); - const KSi=Qt(t=>.35+.03*(t-1),"hazardChance"); - function zSi(t,i,s){ - const e=$Si(t,i),n=BAi(104729*e+7919*s); - if(n%1e3>=1e3*KSi(e))return null; - const h=jSi(t,i),r=h.reduce((t,i)=>t+i.w,0); - let o=BAi(n+17)%r,a=h[0]; - for(const c of h){ - if(o<c.w){ - a=c; - break} - o-=c.w} - return{ - k:s,at:s*DSi.HAZARD_MS+2e4+BAi(n+31)%(DSi.HAZARD_MS-4e4),def:a} - } - Qt(zSi,"hazardAt"); - const YSi=Qt(t=>Math.floor(t/DSi.HAZARD_MS),"hazardWindow"); - function qSi(t,i,s){ - for(let e=YSi(s); - e<YSi(s)+24; - e++){ - const n=zSi(t,i,e); - if(n&&n.at>s)return n} - return null} - Qt(qSi,"nextHazard"); - const XSi=Qt(t=>Math.max(0,Math.min(DSi.LEVELS-1,t)),"clampLv"),JSi=Qt(t=>DSi.MAX_HP[XSi(t)],"maxHp"),QSi=Qt(t=>DSi.ARMOR[XSi(t)],"armorOf"),ZSi=Qt((t,i)=>6e4*(DSi.REPAIR_MIN[XSi(t)]+DSi.ZONE_REPAIR_ADD_MIN[i]),"repairMs"),tTi=Qt(t=>Math.min(4,1+Math.floor(t/2)),"helpSlots"); - function iTi(t){ - return Math.round(10*t)/10} - Qt(iTi,"round1"); - const sTi=Qt(t=>iTi(JSi(t.gear.boat)+ASi(t).hp),"maxHpOf"),eTi=Qt(t=>iTi(QSi(t.gear.boat)+ASi(t).armor),"armorOfS"),nTi=Qt((t,i)=>iTi(Math.max(0,t-i)),"hitDamage"),hTi=Qt((t,i)=>iTi(.35*Math.max(0,t-i)),"ringDamage"),rTi=Qt(t=>String(iTi(t)),"hpText"),oTi=Qt(t=>t.replace(/\d+\.\d{ - 3,} - /g,t=>String(iTi(Number(t)))),"tidyNumbers"),aTi=Qt(t=>Math.round(ZSi(t.gear.boat,t.spot.zone)*(1-ASi(t).repair/100)),"repairMsOf"); - function cTi(t,i,s){ - if(!i.repairAt)return i.hp; - const e=sTi(t); - return Math.min(e,i.repairHp+(s-i.repairAt)*e/aTi(t))} - function lTi(t,i){ - if(!i.repairAt)return 0; - const s=sTi(t); - return i.repairAt+Math.max(0,(s-i.repairHp)/s*aTi(t))} - function uTi(t,i){ - const s=t.boat,e=tTi(t.gear.boat); - if(!s)return{ - n:1,nextAt:null} - ; - if(s.helpPts>=e)return{ - n:e,nextAt:null} - ; - const n=Math.floor(Math.max(0,i-s.helpAt)/DSi.HELP_MS),h=Math.min(e,s.helpPts+n),r=s.helpAt+n*DSi.HELP_MS; - return{ - n:h,nextAt:h>=e?null:r+DSi.HELP_MS} - } - function dTi(t,i){ - const s=FSi[$Si(t,i)-1]+1,e=DSi.ENTRY[i]+1; - return e>=s?`배 ${ - e} - 단계부터`:`배 ${ - e} - 단계부터 · 안정 ${ - s} - 단계`} - Qt(cTi,"hpAt"),Qt(lTi,"repairEndAt"),Qt(uTi,"helpPtsOf"),Qt(dTi,"regionBoatText"); - const fTi=["인간","엘프","언데드","오크"],pTi=["R","C","O"],wTi=["S","M","B"],gTi={ - R:"강",C:"연안",O:"대양"} - ,mTi={ - S:"수면",M:"중층",B:"바닥"} - ,vTi=["햇살","노을","달빛","안개"],_Ti=["낮","저녁","밤","새벽"],MTi={ - "인간|R":"은빛강","인간|C":"노을만","인간|O":"왕국 앞바다","엘프|R":"이끼강","엘프|C":"연꽃만","엘프|O":"초록 바다","언데드|R":"잿빛강","언데드|C":"안개만","언데드|O":"망령 바다","오크|R":"서리강","오크|C":"북풍만","오크|O":"고래 바다"} - ,bTi=36e5,yTi={ - "아주작음":{ - kg:.008,cm:4} - ,"작음":{ - kg:.05,cm:8} - ,"보통":{ - kg:.2,cm:20} - ,"큼":{ - kg:1,cm:35} - ,"아주큼":{ - kg:5,cm:70} - ,"대물":{ - kg:30,cm:130} - ,"거대":{ - kg:200,cm:250} - ,"범고래":{ - kg:1e3,cm:400} - ,"고래":{ - kg:5e3,cm:800} - } - ,ETi=[["피라루쿠","대물"],["금붕어","작음"],["비파고기","보통"],["별거미게","큼"],["듀공","거대"],["망둥어","작음"],["리프피시","작음"],["쥐노래미","보통"],["톱가오리","대물"],["쥐가오리","대물"],["수염상어","아주큼"],["은상어","큼"],["콩게","아주작음"],["농게","아주작음"],["대합","작음"],["새조개","작음"],["빗조개","작음"],["지붕굴","작음"],["방패굴","작음"],["오리너구리","큼"],["물쥐","보통"],["혹돔","큼"],["도루묵","작음"],["닭새우","큼"],["바다코끼리","거대"],["물개","대물"],["전갱이","보통"],["빙어","아주작음"],["쏠종개","보통"],["패들피시","대물"],["물돼지","대물"],["바다악어","거대"],["돛새치","대물"],["다랑어","대물"],["큰넙치","대물"],["창꼬치","큼"],["늑대고기","큼"],["바다뱀","보통"],["쥐치","보통"],["넙치","보통"],["가자미","보통"],["앵무고기","보통"],["나비고기","작음"],["투명머리고기","작음"],["씬벵이","작음"],["해룡","작음"],["바다나비","아주작음"],["고래상어","고래"],["돌고래","거대"],["범고래","범고래"],["고래","고래"],["백상아리","거대"],["바다사자","거대"],["매너티","거대"],["장수거북","거대"],["개복치","거대"],["대왕오징어","대물"],["산갈치","대물"],["가비알","대물"],["철갑상어","대물"],["실러캔스","대물"],["청새치","대물"],["참치","대물"],["물범","대물"],["꼬마상어","아주큼"],["상어","대물"],["거북손","아주작음"],["늑대거북","아주큼"],["가오리","아주큼"],["곰치","아주큼"],["늑대장어","아주큼"],["해달","아주큼"],["비버","아주큼"],["가아","아주큼"],["망토문어","아주큼"],["초롱아귀","큼"],["아귀","아주큼"],["메기","큼"],["장어","큼"],["문어","큼"],["펭귄","큼"],["거북","큼"],["투구게","큼"],["잉어","큼"],["용고기","큼"],["도치","큼"],["대왕등각류","보통"],["갑오징어","보통"],["오징어","보통"],["앵무조개","보통"],["전복","보통"],["해삼","보통"],["가시복","보통"],["쏠배감펭","보통"],["날치","보통"],["놀래기","보통"],["박쥐고기","보통"],["토끼고기","보통"],["통구멍","보통"],["칼고기","보통"],["성대","보통"],["빗해파리","아주작음"],["해파리","보통"],["볼루트고둥","보통"],["왕우럭조개","보통"],["집소라게","아주작음"],["달랑게","아주작음"],["매미새우","작음"],["불가사리","작음"],["도롱뇽","작음"],["게","작음"],["가재","작음"],["가리비","작음"],["소라","작음"],["진주조개","작음"],["가시굴","작음"],["홍합","작음"],["말미잘","작음"],["상자고기","작음"],["학공치","작음"],["집낙지","작음"],["꼬마고둥","아주작음"],["고둥","작음"],["새우","아주작음"],["등각류","아주작음"],["실고기","아주작음"],["해마","아주작음"],["베타","아주작음"],["갯민숭이","아주작음"],["리본벌레","아주작음"],["바다나리","아주작음"],["삿갓조개","아주작음"],["군부","아주작음"],["바다천사","아주작음"],["맛조개","아주작음"],["도끼고기","아주작음"]],ATi=Qt(t=>{ - var i; - return(null==(i=ETi.find(([i])=>t.includes(i)))?void 0:i[1])??"보통"} - ,"weightBand"),STi=[[0,1],[.7,2.5],[.92,4.5],[.99,7],[1,10]]; - function TTi(t,i){ - const s=Math.max(0,Math.min(1,i)); - let e=10; - for(let n=1; - n<STi.length; - n++){ - const[t,i]=STi[n-1],[h,r]=STi[n]; - if(s<=h){ - e=i*Math.pow(r/i,(s-t)/(h-t)); - break} - } - return{ - kg:Math.round(t.kg[0]*e*1e3)/1e3,cm:Math.round(t.cm[0]*Math.cbrt(e)*10)/10} - } - function CTi(t){ - let i=2654435769^t; - return i=Math.imul(i^i>>>16,2246822507),i=Math.imul(i^i>>>13,3266489909),(i^i>>>16)>>>0} - Qt(TTi,"sizeOf"),Qt(CTi,"hash32"); - const OTi={ - "인간":[8,27,48,12,18],"엘프":[63,70,52,65],"언데드":[128,126,118,119,116],"오크":[174,167,163,171]} - ,ITi=Qt((t,i,s,e,n)=>{ - var h; - return 1!==e||"R"!==s||(null==(h=OTi[i])?void 0:h.includes(t))?n:n.filter(t=>t>=3)} - ,"startTrim"),kTi=new Set([33,81,129,177,178,179,180,181]),xTi=[[1,"인간","어류","화로입꿀꺽장어","O","B","전체",3,"대형",4,285,[3,6],0,7,""],[2,"인간","어류","불꽃돛청새치","O","S","노을",4,"대형",4,570,[2,4,6,7],1,8,""],[3,"인간","어류","잿꽃꼬리베타","R","S","전체",2,"중형",1,20,[0,1,2,3,4],0,2,""],[4,"인간","어류","숯갑옷상자고기","C","M","전체",2,"중형",2,50,[0,1,2,3,4],0,4,"O"],[5,"인간","어류","대장간귀상어","O","M","전체",3,"대형",4,190,[4,7],0,7,""],[6,"인간","어류","불갈기해마","C","S","노을",3,"소형",2,125,[3,6],0,5,""],[7,"인간","어류","석탄주걱통구멍","C","B","전체",1,"중형",2,25,[0,1,2,3,4,5,6,7,8],0,1,"O"],[8,"인간","어류","불씨가시복","R","S","전체",1,"중형",1,10,[0,1,2,3,4,5,6,7,8],0,1,""],[9,"인간","어류","용암띠장어","R","M","노을",2,"대형",2,20,[3,4,5,6],0,2,"CO"],[10,"인간","어류","숯등철갑상어","R","B","노을",5,"대형",3,300,[8],0,5,""],[11,"인간","어류","장밋날개날치","O","S","햇살",2,"중형",3,76,[0,1,2,3,4],0,6,""],[12,"인간","어류","화덕수염메기","R","B","전체",1,"대형",2,10,[0,1,2,3,4,5,6,7,8],0,1,""],[13,"인간","어류","햇살원반가오리","R","S","햇살",3,"대형",2,50,[3,6],0,3,"CO"],[14,"인간","어류","홍등초롱아귀","O","B","달빛",4,"대형",4,855,[2,4,6,7],1,7,""],[15,"인간","어류","불꽃꼬리참치","O","M","전체",2,"대형",4,76,[2,3,4,5],0,6,""],[16,"인간","어류","잿꽃갈기쏠배감펭","C","M","전체",2,"중형",2,50,[2,3,4,5],0,4,"O"],[17,"인간","갑각·껍질","도가니등게","R","B","전체",3,"소형",1,50,[4,7],0,3,"CO"],[18,"인간","갑각·껍질","잿구름벙어리게","R","B","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,"CO"],[19,"인간","갑각·껍질","현무암투구게","C","B","달빛",4,"소형",2,375,[2,4,6,7],1,6,""],[20,"인간","갑각·껍질","숯주걱집게게","R","B","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,"CO"],[21,"인간","갑각·껍질","대장간권총새우","R","M","전체",2,"소형",1,20,[5,6,7,8],0,2,"C"],[22,"인간","갑각·껍질","불씨마디등각류","O","B","전체",1,"소형",3,57,[0,1,2,3,4,5,6,7,8],0,1,""],[23,"인간","갑각·껍질","용암주먹갯가재","C","B","전체",3,"소형",2,125,[4,7],0,5,""],[24,"인간","갑각·껍질","화산집소라게","C","B","전체",1,"소형",2,25,[0,1,2,3,4,5,6,7,8],0,2,"O"],[25,"인간","갑각·껍질","노을불꽃가리비","C","M","노을",2,"소형",2,50,[4,5,6,7],0,4,""],[26,"인간","갑각·껍질","불씨진주조개","R","B","전체",3,"소형",1,50,[5,8],0,3,""],[27,"인간","갑각·껍질","화로소용돌이고둥","R","M","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,"C"],[28,"인간","갑각·껍질","잿구름뿔소라","C","B","전체",1,"소형",2,25,[0,1,2,3,4,5,6,7,8],0,2,"O"],[29,"인간","갑각·껍질","용암판앵무조개","O","M","전체",2,"소형",3,76,[4,5,6,7],0,6,""],[30,"인간","갑각·껍질","화덕삿갓조개","R","B","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,"C"],[31,"인간","갑각·껍질","햇살테전복","C","B","햇살",1,"소형",2,25,[0,1,2,3,4,5,6,7,8],0,3,""],[32,"인간","갑각·껍질","홍등꼬마고둥","O","B","전체",1,"소형",3,57,[0,1,2,3,4,5,6,7,8],0,2,""],[33,"인간","비어류","화로배고래","O","S","햇살",5,"거대",5,1140,[8],0,5,""],[34,"인간","비어류","잿꽃꼬리돌고래","O","S","전체",3,"거대",5,190,[5,8],0,7,""],[35,"인간","비어류","화산등늑대거북","R","S","전체",4,"대형",2,150,[2,4,6,7],1,4,""],[36,"인간","비어류","불꽃아가미도롱뇽","R","M","전체",2,"중형",1,20,[1,2,7,8],0,2,""],[37,"인간","비어류","풀무입문어","C","B","전체",2,"대형",3,50,[5,6,7,8],0,4,"O"],[38,"인간","비어류","횃불오징어","O","M","달빛",2,"대형",4,76,[5,6,7,8],0,6,""],[39,"인간","비어류","잿꽃치마갑오징어","C","S","전체",1,"대형",3,25,[0,1,2,3,4,5,6,7,8],0,1,"O"],[40,"인간","비어류","불씨심장귀문어","O","B","전체",2,"대형",4,114,[1,2,7,8],0,6,""],[41,"인간","비어류","화로등해파리","O","M","전체",1,"중형",3,38,[0,1,2,3,4,5,6,7,8],0,3,""],[42,"인간","비어류","불꽃말미잘","C","B","전체",1,"소형",2,25,[0,1,2,3,4,5,6,7,8],0,3,""],[43,"인간","비어류","불바퀴거미불가사리","O","B","전체",1,"소형",3,57,[0,1,2,3,4,5,6,7,8],0,3,""],[44,"인간","비어류","불씨혹해삼","O","B","전체",1,"소형",3,57,[0,1,2,3,4,5,6,7,8],0,4,""],[45,"인간","비어류","잿갈기바다사자","C","S","전체",5,"거대",5,750,[8],0,7,""],[46,"인간","비어류","불꽃볏펭귄","C","S","전체",3,"대형",3,125,[5,8],0,5,"O"],[47,"인간","비어류","노을꽃갯민숭이","C","M","노을",2,"소형",2,50,[1,2,7,8],0,4,""],[48,"인간","비어류","용암리본벌레","R","M","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,""],[49,"엘프","어류","연꽃꼬리베타","R","S","전체",2,"중형",1,20,[0,1,2,3,4],0,2,""],[50,"엘프","어류","도토리가시복","C","S","전체",2,"중형",2,50,[0,1,2,3,4],0,4,"O"],[51,"엘프","어류","연잎가오리","R","S","전체",3,"대형",2,50,[3,6],0,3,"CO"],[52,"엘프","어류","뿌리수염메기","R","B","전체",1,"대형",2,10,[0,1,2,3,4,5,6,7,8],0,1,""],[53,"엘프","어류","고사리돛청새치","O","S","햇살",4,"대형",4,570,[2,4,6,7],1,8,""],[54,"엘프","어류","꼬투리상자고기","C","S","전체",2,"중형",2,50,[2,3,4,5],0,4,"O"],[55,"엘프","어류","버들잎장어","R","M","달빛",2,"대형",2,20,[3,4,5,6],0,2,"CO"],[56,"엘프","어류","은행잎개복치","O","M","전체",3,"대형",4,190,[3,6],0,7,""],[57,"엘프","어류","솔방울철갑상어","R","B","안개",5,"대형",3,300,[8],0,5,""],[58,"엘프","어류","단풍날개날치","O","S","노을",2,"중형",3,76,[0,1,2,3,4],0,6,""],[59,"엘프","어류","완두꼬투리학공치","O","S","전체",1,"중형",3,38,[0,1,2,3,4,5,6,7,8],0,4,""],[60,"엘프","어류","이끼혹놀래기","C","M","전체",1,"중형",2,25,[0,1,2,3,4,5,6,7,8],0,1,"O"],[61,"엘프","어류","덩굴꼬리해마","C","S","햇살",3,"소형",2,125,[3,6],0,5,""],[62,"엘프","어류","꽃입아귀","O","B","달빛",4,"대형",4,855,[2,4,6,7],1,7,""],[63,"엘프","어류","씨앗비늘잉어","R","M","전체",1,"중형",1,10,[0,1,2,3,4,5,6,7,8],0,1,""],[64,"엘프","어류","잎꼬리꼬마상어","O","M","전체",2,"대형",4,76,[2,3,4,5],0,6,""],[65,"엘프","갑각·껍질","밤송이집게게","R","B","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,"CO"],[66,"엘프","갑각·껍질","연꽃그릇게","R","S","햇살",2,"소형",1,20,[5,6,7,8],0,2,"C"],[67,"엘프","갑각·껍질","고사리집게게","C","B","전체",1,"소형",2,25,[0,1,2,3,4,5,6,7,8],0,1,"O"],[68,"엘프","갑각·껍질","잎방패투구게","C","B","달빛",4,"소형",2,375,[2,4,6,7],1,6,""],[69,"엘프","갑각·껍질","씨앗주먹갯가재","C","B","전체",3,"소형",2,125,[4,7],0,5,""],[70,"엘프","갑각·껍질","대나무마디새우","R","M","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,"CO"],[71,"엘프","갑각·껍질","솔방울등각류","O","B","전체",1,"소형",3,57,[0,1,2,3,4,5,6,7,8],0,1,""],[72,"엘프","갑각·껍질","버섯집소라게","C","B","전체",1,"소형",2,25,[0,1,2,3,4,5,6,7,8],0,2,"O"],[73,"엘프","갑각·껍질","은행부채가리비","C","M","전체",2,"소형",2,50,[4,5,6,7],0,4,""],[74,"엘프","갑각·껍질","씨앗진주조개","R","B","전체",3,"소형",1,50,[4,7],0,3,"C"],[75,"엘프","갑각·껍질","도토리뿔소라","C","B","전체",1,"소형",2,25,[0,1,2,3,4,5,6,7,8],0,3,""],[76,"엘프","갑각·껍질","덩굴나선고둥","R","M","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,"C"],[77,"엘프","갑각·껍질","호두방앵무조개","O","M","전체",3,"소형",3,190,[4,7],0,7,""],[78,"엘프","갑각·껍질","꽃잎삿갓조개","C","B","전체",1,"소형",2,25,[0,1,2,3,4,5,6,7,8],0,3,""],[79,"엘프","갑각·껍질","이끼테전복","C","B","안개",3,"소형",2,125,[5,8],0,5,""],[80,"엘프","갑각·껍질","초롱꼬투리고둥","O","B","달빛",2,"소형",3,114,[4,5,6,7],0,6,""],[81,"엘프","비어류","버들잎지느러미고래","O","S","햇살",5,"거대",5,1140,[8],0,5,""],[82,"엘프","비어류","완두꼬투리매너티","R","S","햇살",4,"거대",3,150,[2,4,6,7],1,4,""],[83,"엘프","비어류","나이테등거북","R","M","전체",1,"대형",2,10,[0,1,2,3,4,5,6,7,8],0,1,""],[84,"엘프","비어류","고사리아가미도롱뇽","R","B","안개",2,"중형",1,20,[1,2,7,8],0,2,""],[85,"엘프","비어류","꽃봉오리오징어","O","M","달빛",2,"대형",4,76,[5,6,7,8],0,6,""],[86,"엘프","비어류","연꽃망토문어","C","M","전체",5,"대형",4,750,[8],0,7,""],[87,"엘프","비어류","클로버귀문어","O","B","전체",3,"대형",4,285,[5,8],0,7,""],[88,"엘프","비어류","이끼치마갑오징어","C","S","전체",2,"대형",3,50,[5,6,7,8],0,4,"O"],[89,"엘프","비어류","버섯갓해파리","O","M","전체",1,"중형",3,38,[0,1,2,3,4,5,6,7,8],0,2,""],[90,"엘프","비어류","꽃잎말미잘","O","B","전체",1,"소형",3,57,[0,1,2,3,4,5,6,7,8],0,3,""],[91,"엘프","비어류","고사리깃바다나리","O","B","전체",1,"소형",3,57,[0,1,2,3,4,5,6,7,8],0,3,""],[92,"엘프","비어류","완두등해삼","C","B","전체",1,"소형",2,25,[0,1,2,3,4,5,6,7,8],0,2,"O"],[93,"엘프","비어류","뿌리수염해달","R","S","전체",3,"대형",2,50,[5,8],0,3,""],[94,"엘프","비어류","버들꼬리물범","O","S","전체",2,"대형",4,76,[1,2,7,8],0,6,""],[95,"엘프","비어류","단풍망토갯민숭이","C","M","노을",2,"소형",2,50,[1,2,7,8],0,4,""],[96,"엘프","비어류","덩굴리본벌레","R","B","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,"C"],[97,"언데드","어류","뼈줄무늬가아","R","S","전체",2,"대형",2,20,[0,1,2,3,4],0,2,""],[98,"언데드","어류","달그늘도끼고기","O","M","달빛",1,"중형",3,38,[0,1,2,3,4,5,6,7,8],0,4,""],[99,"언데드","어류","송곳니늑대장어","C","B","전체",3,"대형",3,125,[3,6],0,5,"O"],[100,"언데드","어류","잿빛박쥐고기","C","B","전체",2,"중형",2,50,[0,1,2,3,4],0,4,""],[101,"언데드","어류","유령칼고기","R","M","달빛",2,"중형",1,20,[3,4,5,6],0,2,""],[102,"언데드","어류","그림자꿀꺽장어","O","M","전체",2,"대형",4,76,[0,1,2,3,4],0,6,""],[103,"언데드","어류","뼈턱용고기","O","B","달빛",3,"대형",4,285,[3,6],0,7,""],[104,"언데드","어류","자주초롱아귀","O","B","전체",2,"대형",4,114,[2,3,4,5],0,6,""],[105,"언데드","어류","고대뼈실러캔스","O","B","달빛",5,"대형",5,1710,[8],0,8,""],[106,"언데드","어류","달가면토끼고기","C","S","전체",1,"중형",2,25,[0,1,2,3,4,5,6,7,8],0,3,""],[107,"언데드","어류","무덤입통구멍","C","B","전체",2,"중형",2,50,[2,3,4,5],0,4,"O"],[108,"언데드","어류","뼈마디실고기","R","M","전체",2,"소형",1,20,[5,6,7,8],0,2,""],[109,"언데드","어류","망령주름상어","O","M","안개",4,"대형",4,570,[2,4,6,7],1,8,""],[110,"언데드","어류","뼈등철갑상어","R","B","안개",5,"대형",3,300,[8],0,5,""],[111,"언데드","어류","해골무늬가오리","R","B","전체",3,"대형",2,50,[3,6],0,3,"CO"],[112,"언데드","어류","유령갈기쏠배감펭","C","M","달빛",2,"중형",2,50,[4,5,6,7],0,4,"O"],[113,"언데드","갑각·껍질","해골방패투구게","C","B","달빛",3,"소형",2,125,[4,7],0,5,""],[114,"언데드","갑각·껍질","뼈가시거미게","O","B","전체",2,"소형",3,114,[4,5,6,7],0,6,""],[115,"언데드","갑각·껍질","봉합등상자게","C","B","전체",1,"소형",2,25,[0,1,2,3,4,5,6,7,8],0,2,"O"],[116,"언데드","갑각·껍질","박쥐날개집게게","R","B","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,"CO"],[117,"언데드","갑각·껍질","뼈갑옷대왕등각류","O","B","전체",3,"소형",3,285,[4,7],0,7,""],[118,"언데드","갑각·껍질","뼈마디유령새우","R","M","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,"CO"],[119,"언데드","갑각·껍질","숯뼈가재","R","B","전체",1,"중형",1,10,[0,1,2,3,4,5,6,7,8],0,1,""],[120,"언데드","갑각·껍질","묘비집소라게","R","B","전체",2,"소형",1,20,[1,2,7,8],0,2,"CO"],[121,"언데드","갑각·껍질","뼈고리뿔고둥","C","B","전체",1,"소형",2,25,[0,1,2,3,4,5,6,7,8],0,3,""],[122,"언데드","갑각·껍질","송곳니가리비","C","M","전체",2,"소형",2,50,[5,6,7,8],0,4,""],[123,"언데드","갑각·껍질","관뚜껑홍합","R","B","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,"C"],[124,"언데드","갑각·껍질","흑진주가시굴","C","B","안개",4,"소형",2,375,[2,4,6,7],1,6,""],[125,"언데드","갑각·껍질","자주번개볼루트고둥","O","B","전체",2,"소형",3,114,[5,6,7,8],0,6,""],[126,"언데드","갑각·껍질","유령관고둥","R","M","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,"C"],[127,"언데드","갑각·껍질","뼈방앵무조개","O","M","전체",3,"소형",3,190,[5,8],0,7,""],[128,"언데드","갑각·껍질","잿뿔유령소라","R","S","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,"C"],[129,"언데드","비어류","망령갈비고래","O","S","달빛",4,"거대",5,570,[2,4,6,7],1,4,""],[130,"언데드","비어류","보랏띠물범","C","S","달빛",5,"대형",4,750,[8],0,7,""],[131,"언데드","비어류","뼈등가비알","R","S","전체",4,"거대",3,150,[2,4,6,7],1,4,""],[132,"언데드","비어류","창백동굴도롱뇽","R","B","안개",3,"소형",1,50,[4,7],0,3,""],[133,"언데드","비어류","초승망토문어","C","M","달빛",3,"대형",3,125,[5,8],0,5,""],[134,"언데드","비어류","유리유령오징어","O","S","전체",1,"대형",4,38,[0,1,2,3,4,5,6,7,8],0,4,""],[135,"언데드","비어류","죄수줄무늬오징어","C","S","전체",1,"대형",3,25,[0,1,2,3,4,5,6,7,8],0,1,"O"],[136,"언데드","비어류","양뿔촉수오징어","O","M","전체",2,"대형",4,76,[1,2,7,8],0,6,""],[137,"언데드","비어류","흰보유령해파리","R","S","달빛",3,"중형",1,50,[5,8],0,3,"CO"],[138,"언데드","비어류","자주꽃거꾸로해파리","C","B","전체",1,"중형",2,25,[0,1,2,3,4,5,6,7,8],0,1,"O"],[139,"언데드","비어류","뼈마디거미불가사리","O","B","전체",1,"소형",3,57,[0,1,2,3,4,5,6,7,8],0,1,""],[140,"언데드","비어류","잿가시해삼","C","B","전체",1,"소형",2,25,[0,1,2,3,4,5,6,7,8],0,2,"O"],[141,"언데드","비어류","박쥐망토갯민숭이","C","M","전체",2,"소형",2,50,[1,2,7,8],0,4,""],[142,"언데드","비어류","망령관말미잘","O","B","전체",1,"소형",3,57,[0,1,2,3,4,5,6,7,8],0,2,""],[143,"언데드","비어류","보랏깃바다나리","O","B","전체",1,"소형",3,57,[0,1,2,3,4,5,6,7,8],0,3,""],[144,"언데드","비어류","그림자리본벌레","R","B","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,""],[145,"오크","어류","푸른질주참치","O","M","전체",1,"대형",4,38,[0,1,2,3,4,5,6,7,8],0,3,""],[146,"오크","어류","달원반개복치","O","M","달빛",1,"대형",4,38,[0,1,2,3,4,5,6,7,8],0,4,""],[147,"오크","어류","하늘날개날치","C","S","전체",1,"중형",2,25,[0,1,2,3,4,5,6,7,8],0,1,"O"],[148,"오크","어류","물결갈기산갈치","O","B","달빛",5,"거대",5,1710,[8],0,8,""],[149,"오크","어류","별점고래상어","O","S","전체",3,"거대",5,190,[3,6],0,7,""],[150,"오크","어류","파도이빨백상아리","O","M","전체",3,"거대",5,190,[4,7],0,7,""],[151,"오크","어류","남빛망치귀상어","O","M","전체",2,"대형",4,76,[0,1,2,3,4],0,6,""],[152,"오크","어류","물톱주둥이상어","R","B","안개",5,"대형",3,300,[8],0,5,""],[153,"오크","어류","초승꼬리환도상어","C","M","노을",4,"대형",3,375,[2,4,6,7],1,6,""],[154,"오크","어류","물방울전기가오리","R","B","전체",3,"대형",2,50,[3,6],0,3,"CO"],[155,"오크","어류","서리가시복","R","S","전체",2,"중형",1,20,[0,1,2,3,4],0,2,""],[156,"오크","어류","남빛상자고기","C","M","전체",1,"중형",2,25,[0,1,2,3,4,5,6,7,8],0,2,"O"],[157,"오크","어류","물창학공치","R","S","전체",2,"중형",1,20,[3,4,5,6],0,2,""],[158,"오크","어류","물날개성대","C","B","전체",2,"중형",2,50,[0,1,2,3,4],0,4,"O"],[159,"오크","어류","방울혹도치","R","M","안개",3,"중형",1,50,[4,7],0,3,""],[160,"오크","어류","푸른리본곰치","C","B","전체",3,"대형",3,125,[3,6],0,5,""],[161,"오크","갑각·껍질","파도주걱게","C","S","전체",1,"소형",2,25,[0,1,2,3,4,5,6,7,8],0,2,"O"],[162,"오크","갑각·껍질","해면이불게","C","B","전체",2,"소형",2,50,[2,3,4,5],0,4,"O"],[163,"오크","갑각·껍질","서리벙어리참게","R","B","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,"CO"],[164,"오크","갑각·껍질","물안경달랑게","C","S","전체",1,"소형",2,25,[0,1,2,3,4,5,6,7,8],0,3,"O"],[165,"오크","갑각·껍질","넓적부채매미새우","C","B","전체",3,"소형",2,125,[4,7],0,5,"O"],[166,"오크","갑각·껍질","물대포권총새우","C","M","전체",2,"소형",2,50,[4,5,6,7],0,4,""],[167,"오크","갑각·껍질","남빛꼬부리옆새우","R","M","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,"CO"],[168,"오크","갑각·껍질","서리꽃거북손","R","S","안개",2,"대형",2,20,[5,6,7,8],0,2,"C"],[169,"오크","갑각·껍질","물결방앵무조개","O","M","전체",1,"소형",3,38,[0,1,2,3,4,5,6,7,8],0,1,""],[170,"오크","갑각·껍질","달배집낙지","O","S","달빛",2,"소형",3,76,[2,3,4,5],0,6,""],[171,"오크","갑각·껍질","푸른막대맛조개","R","B","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,"C"],[172,"오크","갑각·껍질","긴목왕우럭조개","C","B","전체",3,"소형",2,125,[5,8],0,5,""],[173,"오크","갑각·껍질","서리삿갓조개","R","B","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,"C"],[174,"오크","갑각·껍질","물소용돌이고둥","R","M","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,""],[175,"오크","갑각·껍질","산호뿔소라","C","B","전체",1,"소형",2,25,[0,1,2,3,4,5,6,7,8],0,3,""],[176,"오크","갑각·껍질","남빛갑옷군부","R","B","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,""],[177,"오크","비어류","밤바다범고래","O","S","달빛",4,"거대",5,570,[2,4,6,7],1,4,""],[178,"오크","비어류","네모머리향유고래","O","B","전체",4,"거대",5,855,[2,4,6,7],1,4,""],[179,"오크","비어류","파도날개혹등고래","O","S","전체",2,"거대",5,76,[4,5,6,7],0,2,""],[180,"오크","비어류","초승턱북극고래","O","S","안개",2,"거대",5,76,[5,6,7,8],0,2,""],[181,"오크","비어류","긴팔대왕오징어","O","B","전체",3,"거대",5,285,[5,8],0,3,""],[182,"오크","비어류","밤망토흡혈오징어","O","B","달빛",1,"대형",4,57,[0,1,2,3,4,5,6,7,8],0,4,""],[183,"오크","비어류","방울귀오징어","C","M","전체",1,"대형",3,25,[0,1,2,3,4,5,6,7,8],0,1,"O"],[184,"오크","비어류","비단망토문어","C","M","달빛",5,"대형",4,750,[8],0,7,""],[185,"오크","비어류","물줄기등장수거북","O","M","전체",2,"거대",5,76,[1,2,7,8],0,6,""],[186,"오크","비어류","파도날개펭귄","C","S","전체",2,"대형",3,50,[5,6,7,8],0,4,"O"],[187,"오크","비어류","물방망이비버","R","S","전체",4,"대형",2,150,[2,4,6,7],1,4,""],[188,"오크","비어류","둥실배해달","R","S","전체",3,"대형",2,50,[5,8],0,3,"C"],[189,"오크","비어류","서리날개바다천사","C","M","안개",2,"소형",2,50,[1,2,7,8],0,4,""],[190,"오크","비어류","푸른용갯민숭이","O","S","전체",1,"소형",3,38,[0,1,2,3,4,5,6,7,8],0,2,""],[191,"오크","비어류","물줄무늬빗해파리","R","M","달빛",2,"소형",1,20,[1,2,7,8],0,2,"CO"],[192,"오크","비어류","물방울말미잘","R","B","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,""],[193,"인간","어류","부싯돌이빨쥐치","O","S","전체",1,"중형",3,38,[0,1,2,3,4,5,6,7,8],0,4,""],[194,"인간","어류","숯가마비늘피라루쿠","R","M","전체",3,"대형",2,50,[3,6],0,3,""],[195,"인간","어류","홍옥혹금붕어","R","S","전체",2,"중형",1,20,[2,3,4,5],0,2,""],[196,"인간","어류","노을치마넙치","O","S","전체",1,"중형",3,38,[0,1,2,3,4,5,6,7,8],0,5,""],[197,"인간","어류","용광로입칠성장어","R","B","노을",2,"대형",2,20,[5,6,7,8],0,2,"CO"],[198,"인간","어류","불씨망토비파고기","R","B","전체",1,"중형",1,10,[0,1,2,3,4,5,6,7,8],0,1,""],[199,"인간","갑각·껍질","불꽃수염바닷가재","O","M","전체",1,"중형",3,38,[0,1,2,3,4,5,6,7,8],0,5,""],[200,"인간","갑각·껍질","잿빛별거미게","O","B","전체",4,"소형",3,855,[2,4,6,7],1,7,""],[201,"인간","갑각·껍질","홍옥부채홍합","C","B","전체",1,"소형",2,25,[0,1,2,3,4,5,6,7,8],0,3,""],[202,"인간","갑각·껍질","벽돌등군부","C","B","전체",1,"소형",2,25,[0,1,2,3,4,5,6,7,8],0,3,""],[203,"인간","어류","분홍돛해룡","O","M","전체",1,"중형",3,38,[0,1,2,3,4,5,6,7,8],0,5,""],[205,"인간","비어류","숯가마배듀공","C","S","전체",4,"거대",4,375,[2,4,6,7],1,6,""],[206,"인간","비어류","화염꼬리바다뱀","O","S","전체",1,"중형",3,38,[0,1,2,3,4,5,6,7,8],0,5,""],[209,"엘프","어류","수련볼망둥어","R","S","전체",1,"중형",1,10,[0,1,2,3,4,5,6,7,8],0,1,"C"],[210,"엘프","어류","버들깃리프피시","R","M","전체",2,"중형",1,20,[2,3,4,5],0,2,""],[211,"엘프","어류","대나무부리나비고기","O","S","전체",1,"중형",3,38,[0,1,2,3,4,5,6,7,8],0,4,""],[212,"엘프","어류","도토리턱쥐노래미","C","M","전체",1,"중형",2,25,[0,1,2,3,4,5,6,7,8],0,3,""],[213,"엘프","어류","이슬관투명머리고기","O","M","전체",1,"중형",3,38,[0,1,2,3,4,5,6,7,8],0,5,""],[214,"엘프","어류","이끼잠옷가자미","O","M","전체",1,"중형",3,38,[0,1,2,3,4,5,6,7,8],0,5,""],[215,"엘프","어류","수초부채톱가오리","O","B","전체",4,"대형",4,855,[2,4,6,7],1,7,""],[216,"엘프","어류","꽃술수염수염상어","C","B","전체",3,"대형",3,125,[3,6],0,5,"O"],[218,"엘프","갑각·껍질","연밥등콩게","R","B","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,""],[219,"엘프","갑각·껍질","클로버입대합","C","B","전체",1,"중형",2,25,[0,1,2,3,4,5,6,7,8],0,3,""],[220,"엘프","갑각·껍질","새싹지붕굴","C","B","전체",2,"소형",2,50,[2,3,4,5],0,4,""],[221,"엘프","비어류","연잎등오리너구리","R","S","전체",3,"중형",1,50,[3,6],0,3,""],[222,"엘프","비어류","갈대꼬리물쥐","R","S","전체",2,"중형",1,20,[5,6,7,8],0,2,""],[224,"엘프","비어류","수련날개바다나비","O","S","전체",1,"중형",3,38,[0,1,2,3,4,5,6,7,8],0,5,""],[227,"언데드","어류","묘비이마혹돔","C","M","전체",2,"대형",3,50,[2,3,4,5],0,4,""],[228,"언데드","어류","망령부채나비고기","O","S","전체",1,"중형",3,38,[0,1,2,3,4,5,6,7,8],0,5,""],[229,"언데드","어류","박쥐입씬벵이","O","M","전체",1,"중형",3,38,[0,1,2,3,4,5,6,7,8],0,5,""],[230,"언데드","어류","흑요석쐐기쥐치","O","M","전체",2,"중형",3,76,[2,3,4,5],0,6,""],[231,"언데드","어류","뼈바늘도루묵","R","M","달빛",2,"중형",1,20,[2,3,4,5],0,2,"C"],[232,"언데드","어류","장막꼬리금붕어","R","S","전체",2,"중형",1,20,[5,6,7,8],0,2,""],[233,"언데드","갑각·껍질","망령투구닭새우","C","B","전체",2,"소형",2,50,[5,6,7,8],0,4,"O"],[234,"언데드","갑각·껍질","뼈열쇠농게","R","B","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,""],[235,"언데드","갑각·껍질","유령가면새조개","C","B","전체",1,"소형",2,25,[0,1,2,3,4,5,6,7,8],0,3,""],[236,"언데드","갑각·껍질","관문나선고둥","R","B","전체",1,"소형",1,10,[0,1,2,3,4,5,6,7,8],0,1,""],[237,"언데드","비어류","초승엄니바다코끼리","O","S","전체",4,"거대",5,570,[2,4,6,7],1,7,""],[238,"언데드","비어류","유령두건물개","C","S","전체",3,"대형",3,125,[3,6],0,5,""],[239,"언데드","비어류","봉합등바다뱀","O","M","전체",1,"중형",3,38,[0,1,2,3,4,5,6,7,8],0,5,""],[240,"언데드","비어류","망령방울해파리","O","S","전체",1,"중형",3,38,[0,1,2,3,4,5,6,7,8],0,3,""],[241,"오크","어류","여울창꼬치고기","O","S","전체",1,"중형",3,38,[0,1,2,3,4,5,6,7,8],0,5,""],[242,"오크","어류","얼음부리앵무고기","O","S","전체",1,"중형",3,38,[0,1,2,3,4,5,6,7,8],0,5,""],[243,"오크","어류","물방패전갱이","O","M","전체",1,"중형",3,38,[0,1,2,3,4,5,6,7,8],0,5,""],[244,"오크","어류","서리날개빙어","R","M","전체",1,"중형",1,10,[0,1,2,3,4,5,6,7,8],0,1,""],[245,"오크","어류","해류줄무늬쏠종개","O","B","전체",2,"중형",3,114,[2,3,4,5],0,6,""],[246,"오크","어류","푸른주걱패들피시","O","M","전체",2,"대형",4,76,[5,6,7,8],0,6,""],[247,"오크","어류","얼음턱늑대고기","O","B","전체",1,"중형",3,57,[0,1,2,3,4,5,6,7,8],0,5,""],[248,"오크","어류","파도깃실고기","C","M","전체",1,"소형",2,25,[0,1,2,3,4,5,6,7,8],0,3,""],[249,"오크","갑각·껍질","얼음망토대게","O","B","전체",1,"소형",3,57,[0,1,2,3,4,5,6,7,8],0,3,""],[250,"오크","갑각·껍질","물방울손새우","R","B","전체",2,"소형",1,20,[2,3,4,5],0,2,"CO"],[251,"오크","갑각·껍질","서리문빗조개","C","B","전체",1,"소형",2,25,[0,1,2,3,4,5,6,7,8],0,3,""],[252,"오크","갑각·껍질","물결방패굴","C","B","전체",2,"소형",2,50,[2,3,4,5],0,4,""],[253,"오크","비어류","눈송이이마흰돌고래","O","S","전체",4,"거대",5,570,[2,4,6,7],1,8,""],[254,"오크","비어류","파도엄니물돼지","O","S","전체",4,"대형",4,570,[2,4,6,7],1,7,""],[255,"오크","비어류","빙하등바다악어","C","S","전체",4,"거대",4,375,[2,4,6,7],1,6,""],[257,"인간","어류","화산갑옷개복치","O","S","햇살",5,"대형",5,1140,[8],0,8,""],[258,"인간","어류","태양창돛새치","O","S","전체",6,"대형",5,2280,[8],0,8,""],[259,"엘프","어류","고사리날개쥐가오리","O","M","전체",6,"대형",5,2280,[8],0,8,""],[260,"엘프","어류","꽃술갈기다랑어","O","S","햇살",5,"대형",5,1140,[8],0,8,""],[261,"언데드","어류","망령은상어","O","M","전체",6,"대형",5,2280,[8],0,8,""],[262,"언데드","어류","그림자망토쥐가오리","O","S","전체",4,"대형",4,570,[2,4,6,7],1,7,""],[263,"오크","어류","빙산등큰넙치","O","S","전체",6,"대형",5,2280,[8],0,8,""]].map(t=>{ - const i=yTi[ATi(t[3])],s=.75+CTi(t[0])%50/100,e=Math.cbrt(s); - return{ - id:t[0],race:t[1],kind:t[2],name:t[3],zone:t[4],depth:t[5],tide:t[6],star:t[7],tier:t[13]??t[7],also:(t[14]??"").split(""),wclass:t[8],power:t[9],price:t[10],pts:ITi(t[0],t[1],t[4],t[7],t[11]),roam:1===t[12],cm:[i.cm*e,i.cm*e*Math.cbrt(10)],kg:[i.kg*s,i.kg*s*10]} - } - ),RTi=xTi.filter(t=>!kTi.has(t.id)),PTi=new Map(xTi.map(t=>[t.id,t])),NTi=Qt(t=>{ - var i; - return(null==(i=PTi.get(t))?void 0:i.tier)??1} - ,"tierOf"),LTi=Qt((t,i)=>t.zone===i||t.also.includes(i),"livesInZone"); - function DTi(t){ - const i=PTi.get(t); - if(!i)throw new Error(`fish ${ - t} - `); - return i} - Qt(DTi,"species"); - const GTi=Qt((t,i,s)=>LAi[`${ - t} - |${ - gTi[i]} - `][s],"pointName"),BTi=63e5,UTi=Qt(t=>Math.floor(t/BTi)%4,"tideAt"),FTi=Qt(t=>BTi-t%BTi,"untilNextTide"),$Ti=Qt((t,i)=>{ - const s=UTi(t); - return s===i?0:((i-s+4)%4-1)*BTi+FTi(t)} - ,"untilTide"),HTi=Qt(t=>Math.floor(t/864e5),"dayIndex"),WTi=Qt((t,i)=>t.pts[CTi(1e3*t.id+i)%t.pts.length],"roamPoint"); - function VTi(t,i,s){ - return t.roam?i===WTi(t,s):t.pts.includes(i)} - function jTi(t){ - const i=t.roam||t.star<=1&&t.pts.includes(0)?0:t.pts[0]; - return{ - race:t.race,zone:t.zone,point:i,depth:t.depth} - } - function KTi(t,i,s,e){ - const n=CTi(131*Math.floor(e/(6*bTi))+17*fTi.indexOf(t)+5*pTi.indexOf(i)+s),h="R"===i?180:"C"===i?110:60,r=.45+n%1e3/1e3; - return Math.max(2,Math.round(h*r*(.8+(n>>>10)%400/1e3)))} - function zTi(t){ - return t.star<=2?"":t.roam?"회유":"명물"} - function YTi(t){ - const i=t.also.length?` · ${ - t.also.map(t=>gTi[t]).join("·")} - 에서도`:""; - return qTi(t)+i} - function qTi(t){ - if(1===t.star)return t.pts.includes(0)?"이 지역 어디서나 · 옆 깊이와 이웃 지역에서도 가끔":`${ - GTi(t.race,t.zone,t.pts[0])} - 부터 · 옆 깊이와 이웃 지역에서도 가끔`; - if(t.roam)return`회유어 · ${ - t.pts.length} - 곳을 날마다 옮겨 다녀요`; - const i=t.pts.map(i=>GTi(t.race,t.zone,i)),s=i.length<=2?i.join(" · "):`${ - i.slice(0,2).join(" · ")} - 외 ${ - i.length-2} - 곳`; - return 2===t.star&&"전체"!==t.tide?`${ - s} - · ${ - t.tide} - 물때`:s} - Qt(VTi,"livesAt"),Qt(jTi,"homeSpot"),Qt(KTi,"anglersAt"),Qt(zTi,"tagText"),Qt(YTi,"whereText"),Qt(qTi,"whereHome"); - const XTi=[{ - key:"boat",title:"배",names:["통나무 뗏목","나무 배","채색 배","놋쇠 장식 배","철갑 배","날개 배","고래뼈 배","황금 결정 배","잠수 배"],effects:[0,1,2,3,4,5,6,7,8].map(Qt(t=>[`내구도 ${ - DSi.MAX_HP[t]} - · 튼튼함 ${ - DSi.ARMOR[t]} - · 장비 ★${ - Math.min(7,t+1)} - 까지`,t>0&&t===DSi.ENTRY.C?"연안 갈 수 있음":"",t>0&&t===DSi.ENTRY.O?"대양 갈 수 있음":"",t===DSi.LEVELS-1?"잠수 (심연 준비 중)":""].filter(Boolean).join(" · "),"boatEffect")),prices:[0,1500,6e3,2e4,6e4,15e4,5e5,12e5,3e6]} - ,{ - key:"auto",title:"자동 낚싯대",names:["없음","자동 받침대","자동 얼레 받침대","명인의 자동대"],effects:["켜 두면 입질 2번에 1마리 · 꺼 두면 5번에 1마리","꺼 둔 동안 4번에 1마리","꺼 둔 동안 3번에 1마리","꺼 둔 동안 2번에 1마리"],prices:[0,5e3,4e4,15e4]} - ],JTi=[1,1.15,1.3,1.4,1.5],QTi=[0,.05,.12,.2,.3],ZTi=[1,1.3,1.6,2,2],tCi=[40,60,90,120],iCi=Qt(t=>JTi[t.reel],"reelSpeed"),sCi=Qt((t,i=0)=>tCi[t.icebox]+Math.max(0,Math.round(i)),"iceboxCap"),eCi=Qt(t=>t.line+1,"lineLimit"),nCi={ - R:[1,1,1,2,2,3,3,3,3],C:[3,3,3,4,4,5,5,5,5],O:[5,5,5,6,6,7,7,7,7]} - ,hCi=Qt(t=>nCi[t.zone][Math.min(nCi[t.zone].length-1,Math.max(0,t.point))],"spotLevel"),rCi=Qt((t,i)=>1===hCi(i)?Math.max(1,t.power-1):t.power,"fishPower"); - function oCi(t,i){ - return"C"===i.zone&&t.boat<0?"채색 배 이상이 필요해요":"O"===i.zone&&t.boat<0?"날개 배 이상이 필요해요":"O"===i.zone&&"B"===i.depth&&t.reel<4?"심해는 ★4 찌가 필요해요":null} - Qt(oCi,"accessProblem"); - const aCi={ - R:{ - 1:100,2:40,3:12,4:6,5:.25} - ,C:{ - 1:100,2:60,3:35,4:20,5:10,6:4,7:1,8:.2} - ,O:{ - 1:100,2:60,3:35,4:20,5:10,6:4,7:1,8:.2} - } - ,cCi={ - R:["C"],C:["R","O"],O:["C"]} - ,lCi={ - S:["M"],M:["S","B"],B:["M"]} - ,uCi=Qt(t=>1===hCi(t)&&OTi[t.race].some(i=>{ - var s; - return(null==(s=PTi.get(i))?void 0:s.depth)===t.depth} - ),"startDepthOwned"); - function dCi(t,i,s,e){ - if(t.race!==i.race)return 0; - let n,h; - if(LTi(t,i.zone))n=1; - else{ - if(!(1===t.star&&cCi[t.zone].includes(i.zone)&&hCi(i)>1))return 0; - n=.3} - if(t.depth===i.depth)h=1; - else{ - if(!(t.star<=2&&1===n&&lCi[t.depth].includes(i.depth))||uCi(i))return 0; - h=1===t.star?.5:.3} - return t.star>=2&&"전체"!==t.tide&&t.tide!==s?0:1!==n||VTi(t,i.point,e)?n*h*(1===t.star||"전체"===t.tide?1:t.star>=3?2:1.5):0} - function fCi(t,i,s,e){ - return RTi.filter(n=>n.race===t&&(LTi(n,i)?VTi(n,s,e):1===n.star&&cCi[n.zone].includes(i)&&hCi({ - zone:i,point:s} - )>1))} - function pCi(t,i,s,e,n=0,h=!1){ - const r=vTi[UTi(i)],o=HTi(i),a=e&&e.until>i?e.kind:null,c=[]; - for(const l of RTi){ - const i=dCi(l,t,r,o); - if(i<=0||h&&l.star>=5)continue; - let e=(aCi[t.zone][l.tier]??0)*(l.zone!==t.zone&&l.also.includes(t.zone)?.5:1)*i; - l.star>=3&&(e*=ZTi[s.bobber]*(l.star<=4?1+Math.max(0,n)/100:1)),a&&a===l.kind&&(e*=2),c.push({ - s:l,w:e} - )} - return c} - Qt(dCi,"spawnFactor"),Qt(fCi,"speciesAtPoint"),Qt(pCi,"poolAt"); - const wCi=["C","B","A","S"],gCi=["","대","특대","왕"],mCi=[1,1.5,3,10],vCi=Qt(t=>t>=.99?3:t>=.92?2:t>=.7?1:0,"gradeOf"),_Ci=Qt(t=>gCi[t]??"","gradeName"),MCi=Qt(t=>t>=1?` (${ - gCi[t]} - )`:"","gradeSuffix"),bCi=Qt((t,i,s)=>1e4*t+1e3*i+Math.round(999*s),"starScore"); - function yCi(t,i,s,e,n=Math.random){ - const h=pCi(t,i,s,e); - if(!h.length)return null; - const r=h.reduce((t,i)=>t+i.w,0); - let o=n()*r,a=h[0].s; - for(const p of h)if(o-=p.w,o<=0){ - a=p.s; - break} - const c=rCi(a,t)-eCi(s),l=c>=1&&n()<(1===c?.5:.9); - let u=n(); - n()<QTi[s.rod]&&(u=Math.max(u,n())); - const{ - kg:d,cm:f} - =TTi(a,u); - return{ - id:a.id,star:a.star,grade:vCi(u),r:u,kg:d,cm:f,at:i,race:t.race,zone:t.zone,point:t.point,tide:UTi(i),broken:l} - } - Qt(yCi,"rollCatch"); - const ECi={ - R:10,C:25,O:38} - ,ACi={ - 1:1,2:2,3:5,4:15,5:30,6:60} - ; - function SCi(t,i,s=.5){ - const e=DTi(t),n="O"===e.zone&&"B"===e.depth?1.5:1; - return Math.round(ECi[e.zone]*ACi[e.star]*n*(.8+.7*s)*mCi[i])} - Qt(SCi,"unitPrice"); - const TCi=Qt(t=>t>=1e3?`${ - (t/1e3).toFixed(2)} - t`:t>=10?`${ - t.toFixed(1)} - kg`:t>=.1?`${ - t.toFixed(2)} - kg`:`${ - Math.max(1,Math.round(1e3*t))} - g`,"formatKg"),CCi=Qt(t=>"★".repeat(Math.max(0,t)),"starText"),OCi=["","물고기","흔하지 않은 물고기","드문 물고기","아주 드문 물고기","가장 드문 물고기"],ICi=[{ - day:1,title:"월척",kind:"big",speciesId:3,desc:"잿꽃꼬리베타 최대 무게 · 은빛강"} - ,{ - day:2,title:"다어",kind:"count",desc:"어디서나 잡은 마릿수"} - ,{ - day:3,title:"명물 월척",kind:"big",speciesId:132,desc:"창백동굴도롱뇽 최대 무게 · 잿빛강 어딘가 · 안개 물때"} - ,{ - day:4,title:"분류전",kind:"class",kindClass:"갑각·껍질",desc:"갑각·껍질류 마릿수 · 어디서나"} - ,{ - day:5,title:"대어 사냥",kind:"star",desc:"가장 높은 별 한 마리 (같으면 종 대비 크기)"} - ,{ - day:6,title:"명물 월척",kind:"big",speciesId:6,desc:"불갈기해마 최대 무게 · 노을만 어딘가"} - ,{ - day:7,title:"도감전",kind:"dex",desc:"대회 동안 잡은 서로 다른 종 수"} - ,{ - day:8,title:"달빛 대물전",kind:"tidePct",tide:2,desc:"달빛 물때에 잡은 한 마리 · 종 대비 크기"} - ,{ - day:9,title:"회유어 월척",kind:"big",speciesId:131,desc:"뼈등가비알 최대 무게 · 오늘은 어느 포인트?"} - ,{ - day:10,title:"낚시왕 결승",kind:"pct",desc:"어디서나 종 대비 가장 큰 한 마리"} - ],kCi=Qt(t=>ICi[(Math.max(1,Math.floor(t))-1)%10],"contestFor"),xCi=[{ - id:"weight",day:1,title:"최대 무게",kind:"big",desc:"가장 무거운 한 마리!"} - ,{ - id:"rarity",day:1,title:"최고 희귀도",kind:"star",desc:"가장 높은 별 한 마리!"} - ,{ - id:"giant",day:1,title:"대어 사냥",kind:"pct",desc:"같은 종에서 가장 큰 한 마리!"} - ,{ - id:"count",day:1,title:"다어",kind:"count",desc:"많이 잡을수록 높은 순위!"} - ],RCi=Qt((t,i)=>xCi.find(t=>t.id===i)??kCi(t),"contestDef"),PCi=Qt(t=>"big"===t.kind||"star"===t.kind||"tidePct"===t.kind||"pct"===t.kind,"contestIsMax"); - function NCi(t,i){ - if(i<=0)return"-"; - switch(t.kind){ - case"big":return TCi(i); - case"count":case"class":return`${ - Math.round(i)} - 마리`; - case"dex":return`${ - Math.round(i)} - 종`; - case"star":{ - const t=gCi[Math.floor(i/1e3)%10]; - return`★${ - Math.floor(i/1e4)} - ${ - t?` ${ - t} - `:""} - · ${ - (i%1e3/10).toFixed(1)} - %`} - case"tidePct":case"pct":return`${ - (100*i).toFixed(2)} - %`} - } - Qt(NCi,"formatContestScore"); - const LCi=Qt(t=>1===t?1200:2===t?720:3===t?480:t<=10?240:80,"pearlByRank"); - function DCi(t,i,s,e){ - const n=Math.min(1,Math.pow(Math.max(0,e),s)); - if("star"===t.kind){ - if(n<=.15)return 0; - const t=i%1e3/999*(.75+.25*n); - return bCi(Math.floor(i/1e4),vCi(t),t)} - return PCi(t)?n>.15?i*(.75+.25*n):0:Math.round(i*n)} - function GCi(t){ - return RTi.filter(i=>"R"===i.zone||"C"===i.zone&&t.boat>=0||"O"===i.zone&&t.boat>=0&&("B"!==i.depth||t.reel>=4))} - function BCi(t,i,s){ - let e=CTi(7919*t); - const n=Qt(()=>(e=CTi(e+1831565813),e/4294967296),"rnd"),h=GCi(i),r=Qt(t=>t[Math.floor(n()*t.length)]??h[0],"pick"),o=r(h.filter(t=>1===t.star)),a=r(h.filter(t=>t.star<=2&&"전체"===t.tide)),c=h.filter(t=>t.star>=2&&t.star<=3&&!s.has(t.id)),l=r(c.length?c:h.filter(t=>3===t.star)),u=Qt(t=>"O"===t.zone?8:"C"===t.zone?3:1,"zoneGold"); - return[{ - key:`${ - t} - :m`,npc:"마르타",role:"시장 상인",line:`"${ - o.name} - 좀 넉넉히 가져와 줘요!"`,speciesId:o.id,count:5,minGrade:0,gold:250*u(o),pearl:0} - ,{ - key:`${ - t} - :b`,npc:"브루노",role:"요리사",line:'"오늘 요리엔 큰 놈이 필요하네."',speciesId:a.id,count:2,minGrade:2,gold:900*u(a),pearl:95} - ,{ - key:`${ - t} - :e`,npc:"엘리안",role:"학자",line:`"${ - MTi[`${ - l.race} - |${ - l.zone} - `]} - 의 ${ - l.name} - 를 연구하고 싶군요."`,speciesId:l.id,count:1,minGrade:0,gold:600*u(l),pearl:255} - ]} - Qt(DCi,"botShown"),Qt(GCi,"reachableSpecies"),Qt(BCi,"visitorsFor"); - const UCi=Qt(t=>Math.floor(t/(6*bTi)),"questWindow"),FCi=Qt((t,i,s)=>27*fTi.indexOf(t)+9*pTi.indexOf(i)+s,"areaIndex"),$Ci=Qt((t,i,s)=>RTi.filter(e=>e.race===t&&e.zone===i&&!e.roam&&e.pts.includes(s)),"areaSpecies"),HCi=Qt((t,i)=>20*hCi({ - zone:t,point:i} - ),"areaPearl"),WCi=[{ - need:10,pearl:220} - ,{ - need:25,pearl:440} - ,{ - need:50,pearl:660} - ,{ - need:75,pearl:880} - ,{ - need:100,pearl:1320} - ,{ - need:150,pearl:1760} - ,{ - need:192,pearl:3300} - ],VCi=[{ - need:2e3,pearl:250} - ,{ - need:1e4,pearl:500} - ,{ - need:4e4,pearl:750} - ,{ - need:1e5,pearl:1e3} - ,{ - need:2e5,pearl:1500} - ,{ - need:4e5,pearl:2500} - ],jCi=[{ - need:1,pearl:325} - ,{ - need:5,pearl:650} - ,{ - need:15,pearl:1300} - ,{ - need:30,pearl:1950} - ,{ - need:60,pearl:3250} - ,{ - need:100,pearl:5200} - ],KCi=[],zCi=Qt(t=>Math.floor(t/864e5),"utcDay"),YCi=Qt(t=>new Date(t).toISOString().slice(0,10),"utcDate"),qCi=Qt(t=>Number.isInteger(t)&&t>=1&&t<=30?31-t:0,"rankPearl"),XCi=Qt((t,i={ - } - )=>-Math.cos(t/1e3*3.4*(i.speed??1)+.6*Math.sin(t/1700+(i.wob??0))),"socialGaugeValue"),JCi=[.85,1.2]; - function QCi(t){ - return{ - center:Math.round(.35*(2*t()-1)*1e3)/1e3,speed:Math.round(1e3*(JCi[0]+t()*(JCi[1]-JCi[0])))/1e3,wob:Math.round(t()*Math.PI*2*1e3)/1e3} - } - Qt(QCi,"randomAim"); - const ZCi=class{ - static runId(){ - return this.run} - static user(){ - return TG.userId||"guest"} - static setRun(t){ - if(!t||t===this.run)return; - const i=0===this.run,s=this.user(); - this.saveTimer&&(clearTimeout(this.saveTimer),this.saveTimer=null),this.maps.clear(),this.dirty.clear(),this.foundCache.clear(),this.run=t; - try{ - if(i)for(const i of Object.keys(localStorage)){ - const e=/^fishing:(fog|spots):v1:([^:]+):(.+)$/.exec(i); - if(!e||e[2]!==s)continue; - const n=`fishing:${ - e[1]} - :v2:${ - s} - :${ - t} - :${ - e[3]} - `,h=localStorage.getItem(i); - null!==h&&null===localStorage.getItem(n)&&localStorage.setItem(n,h),localStorage.removeItem(i)} - const e=`:${ - s} - :${ - t} - :`; - for(const t of Object.keys(localStorage))!t.startsWith(`fishing:fog:v2:${ - s} - :`)&&!t.startsWith(`fishing:spots:v2:${ - s} - :`)||t.includes(e)||localStorage.removeItem(t)} - catch{ - } - } - static storeKey(t,i){ - let s=2166136261; - for(let e=0; - e<i.length; - e++)s^=i.charCodeAt(e),s=Math.imul(s,16777619); - return`fishing:fog:v2:${ - this.user()} - :${ - this.run} - :${ - t} - :${ - (s>>>0).toString(36)} - `} - static bits(t,i){ - let s=this.maps.get(t); - if(s)return s; - s=new Uint8Array(i+7>>3); - try{ - const i=localStorage.getItem(t); - if(i){ - const t=atob(i); - if(t.length===s.length)for(let i=0; - i<t.length; - i++)s[i]=t.charCodeAt(i)} - } - catch{ - } - return this.maps.set(t,s),s} - static has(t,i){ - return 1==(t[i>>3]>>(7&i)&1)} - static set(t,i){ - t[i>>3]|=1<<(7&i)} - static pointKnown(t,i,s=-1){ - if(0===i||i===s)return!0; - const e=NAi.topdownInfo(t); - if(!e.verts||!e.tile)return!0; - const n=e.points[i]; - if(!n)return!1; - if(this.found(t)>>i&1)return!0; - const h=this.bits(this.storeKey(t,e.verts),e.cols*e.rows); - return this.has(h,Math.floor(n.y/e.tile)*e.cols+Math.floor(n.x/e.tile))} - static foundKey(t){ - const i=NAi.topdownInfo(t); - return this.storeKey(t,i.verts??"").replace("fishing:fog:v2:","fishing:spots:v2:")} - static found(t){ - const i=this.foundKey(t); - let s=this.foundCache.get(i); - if(void 0===s){ - s=0; - try{ - s=Number(localStorage.getItem(i))||0} - catch{ - } - this.foundCache.set(i,s)} - return s} - static markFound(t,i){ - const s=this.foundKey(t),e=this.found(t); - if(e>>i&1)return!1; - const n=e|1<<i; - this.foundCache.set(s,n); - try{ - localStorage.setItem(s,String(n))} - catch{ - } - return!0} - static markDirty(t){ - this.dirty.add(t),this.saveTimer??(this.saveTimer=setTimeout(()=>this.flush(),2e3))} - static flush(){ - this.saveTimer=null; - for(const t of this.dirty){ - const i=this.maps.get(t); - if(i)try{ - localStorage.setItem(t,btoa(String.fromCharCode(...i)))} - catch{ - } - } - this.dirty.clear()} - } - ; - Qt(ZCi,"FishingFog"),Zt(ZCi,"maps",new Map),Zt(ZCi,"dirty",new Set),Zt(ZCi,"saveTimer",null),Zt(ZCi,"run",0),Zt(ZCi,"foundCache",new Map); - let tOi=ZCi; - function iOi(t,i,s,e,n=[]){ - let h=t.k,r=t.nextAt,o=t.castAt; - for(let a=0; - a<400&&r+DAi<=e; - a++){ - const e=n.includes(h)?3500:0; - o=r,h++,r+=UAi(t.seed,h,i,s)+e} - return{ - k:h,at:r,prevAt:o} - } - function sOi(t,i,s,e){ - if(s>=t.at&&s<t.at+DAi)return t.k===e?null:{ - k:t.k} - ; - const n=t.k-1; - return n>=i&&s>=t.prevAt&&s<t.prevAt+DAi+2e3&&n!==e?{ - k:n} - :null} - function eOi(t){ - let i=(t%4294967296^1540483477)>>>0; - return()=>(i=Math.imul(i,1664525)+1013904223>>>0,i>>>24)} - Qt(iOi,"currentBite"),Qt(sOi,"hookTarget"),Qt(eOi,"stream"); - const nOi=Qt(t=>"function"==typeof atob?atob(t):Buffer.from(t,"base64").toString("latin1"),"fromB64"); - function hOi(t,i){ - if("string"!=typeof t||!t)return null; - try{ - const s=nOi(t),e=eOi(i); - let n=""; - for(let t=0; - t<s.length; - t++)n+=String.fromCharCode(s.charCodeAt(t)^e()); - if("~"!==n[0])return null; - const h=JSON.parse(n.slice(1)); - if(!Number.isInteger(h.k)||!Array.isArray(h.f))return null; - const r=h.f.map(t=>Array.isArray(t)&&7===t.length?{ - id:t[0],star:t[1],grade:t[2],r:t[3],kg:t[4],cm:t[5],broken:1===t[6]} - :null); - return{ - k0:h.k,fish:r} - } - catch{ - return null} - } - Qt(hOi,"decodeTicket"); - const rOi=!1,oOi={ - "인간":{ - race:"인간",river:"은빛강",npcs:[{ - id:"ben",name:"벤 선장",role:"나룻배 선장",anchor:0,art:4,ship:!0} - ,{ - id:"berta",name:"베르타 할머니",role:"절임 가게",anchor:1,art:1} - ,{ - id:"toto",name:"토토",role:"물고기 관찰꾼",anchor:5,art:2} - ,{ - id:"hans",name:"한스",role:"강가 식당",anchor:8,art:0} - ],steps:[{ - npc:"ben",title:"첫 손맛",line:"자, 이제 실전일세! 내 배 옆에서 아무 물고기나 세 마리만 낚아 보게.",done:"허허, 손맛이 제법이구먼!",kind:"any",count:3,gold:200,pearl:0} - ,{ - npc:"ben",title:"바닥의 메기",line:"메기는 바닥에 붙어 산다네. 깊이를 바닥으로 두고 두 마리만 부탁하네.",done:"통통하구먼! 선원들 저녁거리로 딱이야.",kind:"fish",id:12,count:2,gold:300,pearl:70} - ,{ - npc:"ben",to:"berta",title:"절임 가게 할머니",line:"아래쪽 버들 샛강에 베르타 할머니 절임 가게가 있다네. 일손이 필요하시대.",done:"벤 선장이 보냈다고? 마침 잘 왔구나.",kind:"meet",count:0,gold:200,pearl:70} - ,{ - npc:"berta",title:"게장 담그기",line:"게장 담글 벙어리게가 모자라. 바닥에서 세 마리만 잡아다 주렴.",done:"옳지, 살이 꽉 찼구나.",kind:"fish",id:18,count:3,gold:400,pearl:70} - ,{ - npc:"berta",title:"꼬리 고운 베타",line:"잿꽃꼬리베타는 물 위쪽에서 논단다. 깊이를 수면으로 바꿔 보렴.",done:"꼬리가 참 곱기도 하지.",kind:"fish",id:3,count:2,gold:600,pearl:105} - ,{ - npc:"berta",title:"도롱뇽 한 마리",line:"불꽃아가미도롱뇽은 중층에 사는데, 이 근처 몇 군데에서만 보인단다.",done:"이걸로 약술을 담가야겠다.",kind:"fish",id:36,count:1,gold:700,pearl:105} - ,{ - npc:"berta",to:"toto",title:"물레방아 아이",line:"강 아래 물레방아 쪽에 토토라는 아이가 물고기를 살핀다더구나. 가서 도와주렴.",done:"할머니가요? 와, 반가워요!",kind:"meet",count:0,gold:200,pearl:70} - ,{ - npc:"toto",title:"들꽃 실개천",line:"동쪽 들꽃 실개천에 가 봤어요? 거기서 낚시를 한 번 해 보고 와요!",done:"거기 물 맑죠? 저도 가 보고 싶어요.",kind:"visit",point:3,count:1,gold:300,pearl:105} - ,{ - npc:"toto",title:"햇살 가오리",line:"햇살원반가오리는 낮에만 물 위쪽으로 올라와요. 한 마리만 보여 줄래요?",done:"우와, 진짜 원반 같아요!",kind:"fish",id:13,count:1,gold:1200,pearl:210} - ,{ - npc:"toto",title:"저녁 장어",line:"용암띠장어는 저녁에 중층으로 나와요. 두 마리만 부탁해요!",done:"무늬가 전부 달라요! 그림으로 남겨야지.",kind:"fish",id:9,count:2,gold:900,pearl:140} - ,{ - npc:"toto",to:"hans",title:"강가 식당",line:"하류 식당 한스 아저씨가 물고기를 찾는대요. 아저씨한테 가 봐요!",done:"토토 녀석이 보냈군. 배고프지?",kind:"meet",count:0,gold:200,pearl:70} - ,{ - npc:"hans",title:"새우 튀김",line:"오늘 메뉴는 새우 튀김이야. 대장간권총새우 세 마리, 중층이다.",done:"딱 좋아! 튀김옷을 입혀 볼까.",kind:"fish",id:21,count:3,gold:1e3,pearl:140} - ,{ - npc:"hans",title:"진주조개",line:"하류 바닥에 불씨진주조개가 있지. 하나만 구해 와.",done:"껍데기 속이 반짝이는구먼.",kind:"fish",id:26,count:1,gold:1500,pearl:280} - ,{ - npc:"hans",title:"은빛강의 주인",line:"마지막 부탁이야. 저녁 무렵 하류 바닥에 숯등철갑상어가 나온다더군.",done:"해냈구나! 이제 은빛강에서 너를 모르는 사람은 없을 거다.",kind:"fish",id:10,count:1,gold:5e3,pearl:1050} - ]} - ,"엘프":{ - race:"엘프",river:"이끼강",npcs:[{ - id:"lilien",name:"릴리엔 선장",role:"연잎배 선장",anchor:0,art:16,ship:!0} - ,{ - id:"ria",name:"리아",role:"연못 정원사",anchor:1,art:13} - ,{ - id:"silven",name:"실벤",role:"수상생물 사서",anchor:5,art:14} - ,{ - id:"pipi",name:"피피",role:"숲속 소풍대장",anchor:8,art:15} - ],steps:[{ - npc:"lilien",title:"강의 결",line:"이제 혼자 해 볼 차례예요. 내 배 곁에서 강의 결부터 느껴 봐요. 아무 물고기나 세 마리.",done:"좋아요, 손이 강을 아네요.",kind:"any",count:3,gold:300,pearl:0} - ,{ - npc:"lilien",title:"뿌리수염메기",line:"수염이 뿌리인지 뿌리가 수염인지… 바닥에서 뿌리수염메기 두 마리만 데려와 줘요.",done:"역시 뿌리였어요! 아니, 수염인가?",kind:"fish",id:52,count:2,gold:400,pearl:30} - ,{ - npc:"lilien",to:"ria",title:"연못 정원사",line:"고사리 너른 못에 리아라는 정원사가 있어요. 일손이 필요하대요.",done:"릴리엔 선장님이요? 마침 잘 왔어요!",kind:"meet",count:0,gold:200,pearl:20} - ,{ - npc:"ria",title:"비늘 씨앗",line:"씨앗비늘잉어 비늘을 정원에 심어 볼래요. 중층에서 세 마리만!",done:"비늘에서 싹이 나면 꼭 보여 줄게요.",kind:"fish",id:63,count:3,gold:500,pearl:30} - ,{ - npc:"ria",title:"연꽃 꼬리",line:"연꽃꼬리베타는 물 위쪽에서 놀아요. 깊이를 수면으로 바꿔 봐요.",done:"꼬리가 진짜 연꽃잎 같아요!",kind:"fish",id:49,count:2,gold:700,pearl:40} - ,{ - npc:"ria",to:"silven",title:"물고기 사서",line:"버섯 물길의 사서 실벤이 물고기 기록을 모은대요. 가 보세요.",done:"리아가 보냈군요. 기록할 게 많아요.",kind:"meet",count:0,gold:200,pearl:20} - ,{ - npc:"silven",title:"빈 기록",line:"꽃잎 실개천의 물고기는 아직 기록이 비어 있어요. 거기서 낚시를 해 봐 주세요.",done:"덕분에 빈칸 하나가 채워졌어요.",kind:"visit",point:4,count:1,gold:400,pearl:30} - ,{ - npc:"silven",title:"씨앗 진주",line:"씨앗진주조개는 꽃잎 실개천이나 달빛 샛강 바닥에 있어요. 하나만 부탁해요.",done:"진주 속에 씨앗이… 정말 있군요!",kind:"fish",id:74,count:1,gold:1200,pearl:60} - ,{ - npc:"silven",to:"pipi",title:"소풍 준비",line:"이끼강 하류의 피피가 소풍을 준비한대요. 도와주세요.",done:"와, 손님이다! 소풍에 같이 가요!",kind:"meet",count:0,gold:200,pearl:20} - ,{ - npc:"pipi",title:"이끼강의 주인",line:"이끼강의 주인 솔방울철갑상어를 보고 싶어요! 안개 낀 하류 바닥에 산대요.",done:"해냈다! 이제 이끼강에서 모르는 사람이 없을 거예요!",kind:"fish",id:57,count:1,gold:5e3,pearl:350} - ]} - ,"언데드":{ - race:"언데드",river:"잿빛강",npcs:[{ - id:"charon",name:"카론 선장",role:"해골 나룻배 선장",anchor:0,art:28,ship:!0} - ,{ - id:"mora",name:"모라 할머니",role:"유령 재봉 할머니",anchor:1,art:25} - ,{ - id:"mumu",name:"무무",role:"미라 행상인",anchor:5,art:26} - ,{ - id:"luna",name:"루나",role:"해골 생태학자",anchor:8,art:27} - ],steps:[{ - npc:"charon",title:"산 손님",line:"이제 혼자 해 보게, 산 손님! 손부터 풀어 보게. 아무거나 세 마리.",done:"좋아, 산 사람 손은 역시 빠르군!",kind:"any",count:3,gold:300,pearl:0} - ,{ - npc:"charon",title:"숯뼈가재 국물",line:"배에서 끓일 국물엔 숯뼈가재가 제격이지. 바닥에서 두 마리 부탁하네.",done:"이 향이야… 맛은 못 보지만!",kind:"fish",id:119,count:2,gold:400,pearl:30} - ,{ - npc:"charon",to:"mora",title:"바느질감",line:"마른 갈대 굽이의 모라 할머니가 바느질감을 찾으셔.",done:"카론이 보냈니? 어서 오렴.",kind:"meet",count:0,gold:200,pearl:20} - ,{ - npc:"mora",title:"고둥 단추",line:"고둥 껍데기로 단추를 달 거란다. 중층에서 유령관고둥 세 개만.",done:"단추가 반짝이니 망토가 사는구나.",kind:"fish",id:126,count:3,gold:500,pearl:30} - ,{ - npc:"mora",title:"줄무늬 수",line:"뼈줄무늬가아 무늬를 따라 수를 놓고 싶구나. 물 위쪽이란다.",done:"무늬가 참 곱기도 하지.",kind:"fish",id:97,count:2,gold:700,pearl:40} - ,{ - npc:"mora",to:"mumu",title:"수상한 행상인",line:"부엉이 소에 무무라는 행상인이 있단다. 뭐든 산다더구나.",done:"손님! 좋은 물건 있으면 보여 줘!",kind:"meet",count:0,gold:200,pearl:20} - ,{ - npc:"mumu",title:"가라앉은 물건",line:"가시 너른 못에 좋은 게 가라앉아 있대. 거기서 낚시 좀 해 봐.",done:"역시 그 못이야! 내 감이 맞았어.",kind:"visit",point:3,count:1,gold:400,pearl:30} - ,{ - npc:"mumu",title:"비밀 거래",line:"해골무늬가오리! 가시 너른 못이나 검은 물길 바닥에 있어. 비싸게 쳐 줄게, 쉿.",done:"쉿, 다른 상인한테는 비밀이야.",kind:"fish",id:111,count:1,gold:1200,pearl:60} - ,{ - npc:"mumu",to:"luna",title:"오래된 생물",line:"잿빛강 하류의 루나가 오래된 생물을 연구한대.",done:"새 조수님이군요! 반가워요.",kind:"meet",count:0,gold:200,pearl:20} - ,{ - npc:"luna",title:"잿빛강의 선배",line:"나보다 오래 산 물고기가 하류 바닥에 있대요. 새벽 안개가 낄 때만 나온대요!",done:"선배님을 만났어요! 잿빛강이 당신을 기억할 거예요.",kind:"fish",id:110,count:1,gold:5e3,pearl:350} - ]} - ,"오크":{ - race:"오크",river:"서리강",npcs:[{ - id:"borkan",name:"보르칸 선장",role:"원양선 선장",anchor:0,art:36,ship:!0} - ,{ - id:"gruma",name:"그루마 할머니",role:"왕년의 낚시왕",anchor:1,art:37} - ,{ - id:"udong",name:"우동",role:"국수 장인",anchor:5,art:38} - ,{ - id:"krara",name:"크라라",role:"꼬마 게 동호회장",anchor:7,art:39} - ],steps:[{ - npc:"borkan",title:"꼬마 선원",line:"이제 실전이다, 꼬마 선원! 내 배 옆에서 손부터 풀어라. 아무거나 세 마리.",done:"제법인데! 배에 태워 줄 만하군.",kind:"any",count:3,gold:300,pearl:0} - ,{ - npc:"borkan",title:"선원 밥",line:"선원 밥으로 서리벙어리참게가 필요하다. 바닥에서 두 마리!",done:"오늘 저녁은 게찜이다!",kind:"fish",id:163,count:2,gold:400,pearl:30} - ,{ - npc:"borkan",to:"gruma",title:"왕년의 낚시왕",line:"얼음 샛강의 그루마 할머니는 왕년의 낚시왕이시다. 인사드려라.",done:"보르칸 그 꼬맹이가 보냈다고?",kind:"meet",count:0,gold:200,pearl:20} - ,{ - npc:"gruma",title:"낚싯대 장식",line:"내 낚싯대에 달 장식이 필요해. 물소용돌이고둥 세 개, 중층이야.",done:"그래, 이 소리야. 손맛이 난다.",kind:"fish",id:174,count:3,gold:500,pearl:30} - ,{ - npc:"gruma",title:"가시복 백 마리",line:"가시복은 물 위쪽에서 잡는 거야. 내 젊을 땐 하루에 백 마리였지.",done:"흠, 나쁘지 않아. 낚시왕 될 상이야.",kind:"fish",id:155,count:2,gold:700,pearl:40} - ,{ - npc:"gruma",to:"udong",title:"국수 국물",line:"흰 소의 우동이 국수 국물 재료를 찾는다더라.",done:"할머니 손님이면 국수 곱빼기!",kind:"meet",count:0,gold:200,pearl:20} - ,{ - npc:"udong",title:"국물 맛 물",line:"늑대 실개천 물이 국물 맛을 낸대. 거기서 낚시 좀 해 줘.",done:"이 물 냄새, 국물 맛이 나는데?",kind:"visit",point:3,count:1,gold:400,pearl:30} - ,{ - npc:"udong",title:"찌릿한 국물",line:"찌릿한 국물을 만들 거야! 물방울전기가오리는 늑대 실개천이나 바위 샛강 바닥에 있어.",done:"찌릿찌릿! 신메뉴 완성이다!",kind:"fish",id:154,count:1,gold:1200,pearl:60} - ,{ - npc:"udong",to:"krara",title:"게 동호회",line:"얼음꽃 웅덩이의 크라라가 게 동호회를 한대. 가 봐!",done:"새 회원이다! 환영해!",kind:"meet",count:0,gold:200,pearl:20} - ,{ - npc:"krara",title:"서리강의 톱",line:"하류 바닥에 톱 같은 주둥이 상어가 산대! 새벽 안개가 낄 때만 나온대!",done:"우와, 진짜 톱이야! 서리강 최고 낚시꾼!",kind:"fish",id:152,count:1,gold:5e3,pearl:350} - ]} - } - ,aOi=[[15,5],[10,4],[5,3],[3,2]],cOi=Qt(t=>{ - var i; - return(null==(i=aOi.find(([i])=>t.done.length>=i))?void 0:i[1])??1} - ,"questHoldMax"),lOi=Qt((t,i)=>({ - id:`teach:${ - t} - `,npc:"",teach:!0,...i} - ),"T"),uOi={ - sell:lOi("sell",{ - title:"어망 비우기",line:"잡은 물고기는 팔아서 골드로 바꿔요. 200골드어치만 팔아 봐요.",done:"두둑하네요! 그 골드로 장비를 손볼 수 있어요.",kind:"sell",count:200,gold:300,pearl:0} - ),line1:lOi("line1",{ - title:"튼튼한 낚싯대",line:"낚싯대가 없으면 힘센 물고기를 못 버텨요. 장비 상자에서 낚싯대를 얻어 낚싯대 칸에 껴 봐요.",done:"이제 힘 2짜리도 끄떡없어요.",kind:"gear",gear:"line",level:1,count:1,gold:0,pearl:50} - ),rod1:lOi("rod1",{ - title:"큰 물고기",line:"낚싯대를 끼면 큰 물고기가 더 잘 나와요. 장비 → 내 배에서 낚싯대 칸에 껴 봐요.",done:"손에 착 붙네요.",kind:"gear",gear:"rod",level:1,count:1,gold:0,pearl:50} - ),icebox1:lOi("icebox1",{ - title:"넓은 어망",line:"어망이 금방 차지요? 장비 상자에서 어망을 얻어 어망 칸에 껴 봐요.",done:"이제 넉넉하게 담겠어요.",kind:"gear",gear:"icebox",level:1,count:1,gold:0,pearl:50} - ),boat1:lOi("boat1",{ - title:"나무 배",line:"뗏목은 느려요. 장비에서 배를 나무 배로 올려 봐요.",done:"물살을 가르는 소리가 다르네요!",kind:"gear",gear:"boat",level:1,count:1,gold:0,pearl:100} - ),reel1:lOi("reel1",{ - title:"빠른 입질",line:"찌를 끼면 입질이 빨라져요. 장비 → 내 배에서 찌 칸에 껴 봐요 (배 ★2부터).",done:"찌가 금방 움직이네요.",kind:"gear",gear:"reel",level:1,count:1,gold:0,pearl:50} - ),bobber1:lOi("bobber1",{ - title:"귀한 손님",line:"찌를 끼면 귀한 물고기가 더 잘 물어요. 장비 → 내 배에서 찌 칸에 껴 봐요 (배 ★2부터).",done:"귀한 손님이 올 거예요.",kind:"gear",gear:"bobber",level:1,count:1,gold:0,pearl:50} - ),harpoon:lOi("harpoon",{ - title:"첫 작살",line:"물고기로 작살을 만들 수 있어요. 작살 하나만 만들어 봐요.",done:"날이 잘 섰네요.",kind:"harpoon",count:1,gold:500,pearl:0} - ),hunt:lOi("hunt",{ - title:"몬스터 사냥",line:"큰 그림자가 지나가면 작살을 던져요. 한 번만 던져 봐요.",done:"용감하네요!",kind:"hunt",count:1,gold:0,pearl:100} - ),contest:lOi("contest",{ - title:"오늘 대회",line:"오늘 대회에 나가 봐요. 퀘스트의 대회 칸에서 참가해요.",done:"대회 맛을 봤으니 이제 우승이에요!",kind:"contest",count:1,gold:0,pearl:50} - ),auto1:lOi("auto1",{ - title:"자동 받침대",line:"자동 낚싯대를 자동 받침대로 올려 봐요. 꺼 둔 동안에도 잘 잡혀요.",done:"자는 동안에도 잡히겠어요.",kind:"gear",gear:"auto",level:1,count:1,gold:0,pearl:100} - ),line2:lOi("line2",{ - title:"더 튼튼한 낚싯대",line:"힘 3짜리를 잡으려면 ★2 낚싯대가 필요해요. 합성하거나 상자에서 얻어 껴 봐요 (배 ★2부터 ★2).",done:"이제 강의 주인도 버틸 수 있어요.",kind:"gear",gear:"line",level:2,count:1,gold:0,pearl:100} - )} - ,dOi=Qt((t,i,s,e,n,h)=>({ - title:t,line:i,done:s,kind:"any",count:e,gold:n,pearl:0,...void 0!==h?{ - point:h} - :{ - } - } - ),"any"),fOi=Qt((t,i,s,e,n,h,r=0)=>({ - title:t,line:i,done:s,kind:"fish",fish:e,count:n,gold:h,pearl:r} - ),"fish"),pOi=Qt((t,i,s,e,n)=>({ - title:t,line:i,done:s,kind:"area",point:e,count:1,gold:0,pearl:n} - ),"area"),wOi=Qt((t,i,s,e)=>({ - title:t,line:i,done:s,kind:"meet",to:e,count:0,gold:200,pearl:0} - ),"meet"),gOi=[[dOi("첫 손맛","자, 이제 실전일세! 내 배 곁에서 손부터 풀어 보게. 아무 물고기나 세 마리.","좋아, 손맛을 봤구먼!",3,200),fOi("바닥의 메기","메기는 바닥에 붙어 산다네. 깊이를 바닥으로 두고 두 마리 부탁하네.","통통하구먼! 선원들 저녁거리로 딱이야.",12,2,300),fOi("수면의 가시복","가시복은 물 위쪽에서 논다네. 깊이를 수면으로 바꿔 두 마리!","가시에 찔리지 않았나? 잘했네.",8,2,300),fOi("중층 고둥","고둥은 물 가운데쯤에 있지. 중층에서 두 개만.","소리가 좋구먼. 배에 걸어 둬야겠어.",27,2,300),"sell","line1",fOi("리본벌레","용암리본벌레도 세 마리 부탁하네. 중층이야.","꿈틀꿈틀 잘 잡았구먼!",48,3,300),pOi("상류 도감","은빛강 상류에 사는 물고기를 도감에 다 채우고, 퀘스트의 수역 칸에서 받아 보게.","상류 박사가 다 됐구먼!",0,30),wOi("절임 가게 할머니","버들 샛강의 베르타 할머니가 일손을 찾으신다네. 인사드리게.","벤 선장이 보냈다고? 마침 잘 왔구나.","berta")],[fOi("게장 담그기","게장을 담글 거란다. 바닥에서 잿구름벙어리게 세 마리만.","이 정도면 한 독 가득이구나.",18,3,400),fOi("꼬리 고운 베타","잿꽃꼬리베타 꼬리가 참 곱지. 물 위쪽에서 두 마리 부탁하마.","꼬리가 꽃잎 같구나!",3,2,600),fOi("도롱뇽 한 마리","불꽃아가미도롱뇽 한 마리만. 버들 샛강 중층에 산단다.","아가미가 불꽃처럼 붉구나.",36,1,600),"rod1","icebox1","boat1",pOi("버들 샛강 도감","버들 샛강 물고기를 도감에 다 채워 보렴.","샛강이 네 손바닥 안이구나.",1,30),pOi("조약돌 너른 못 도감","조약돌 너른 못 물고기도 다 채워 보렴.","못이 반짝이는구나.",2,30),wOi("물레방아 아이","노을 소에 토토라는 아이가 물고기를 관찰한단다. 가 보렴.","할머니가 보냈어요? 같이 관찰해요!","toto")],[dOi("실개천 구경","들꽃 실개천은 처음이죠? 거기서 아무 물고기나 세 마리!","실개천 물고기는 무늬가 달라요!",3,400,3),fOi("노을 장어","용암띠장어는 노을 물때에만 나와요! 중층에서 두 마리.","장어가 노을빛이에요!",9,2,900),fOi("집게게","숯주걱집게게 집게가 궁금해요. 바닥에서 세 마리!","집게가 진짜 주걱 같아요!",20,3,500),fOi("권총새우","대장간권총새우가 탕 소리를 낸대요. 중층에서 두 마리!","탕! 진짜 소리가 나요!",21,2,800),"reel1","bobber1",fOi("햇살 가오리","햇살 물때에만 수면으로 올라오는 가오리가 있어요. 한 마리만!","햇살처럼 반짝여요!",13,1,1200),"harpoon","hunt",wOi("강가 식당","은빛강 하류의 한스 아저씨가 식당 재료를 찾아요.","토토 친구라고? 배고프지?","hans")],[fOi("새우 튀김","새우 튀김엔 대장간권총새우지! 세 마리 부탁해.","바삭하게 튀겨 주지!",21,3,1e3),fOi("삿갓조개","삿갓조개 국물이 일품이지. 바닥에서 세 개!","국물이 시원하겠어!",30,3,600),fOi("도가니등게","도가니등게 한 마리면 특식이야. 은빛 샛강 바닥에 있대.","오늘 특식은 게찜이다!",17,1,1200),fOi("진주조개","불씨진주조개 하나만. 하류나 노을 소 바닥에 있어.","진주가 불씨처럼 빛나!",26,1,1500),"contest","auto1","line2",pOi("하류 도감","은빛강 하류 물고기를 도감에 다 채워 봐.","하류의 물고기 박사로군!",8,50),fOi("은빛강의 주인","하류 바닥에 은빛강의 주인이 산대. 노을 때 나오는 힘센 놈이야. 튼튼한 줄을 챙겨!","은빛강이 너를 기억할 거야!",10,1,5e3,300)]],mOi=[[dOi("강의 결","이제 혼자 해 볼 차례예요. 내 배 곁에서 강의 결부터 느껴 봐요. 아무 물고기나 세 마리.","좋아요, 손이 강을 아네요.",3,200),fOi("뿌리수염메기","수염이 뿌리인지 뿌리가 수염인지… 바닥에서 뿌리수염메기 두 마리만 데려와 줘요.","역시 뿌리였어요! 아니, 수염인가?",52,2,300),fOi("마디 새우","대나무마디새우는 물 가운데쯤에 살아요. 깊이를 중층으로 바꿔 두 마리!","마디마디 대나무 같죠?",70,2,300),"sell","line1",fOi("밤송이 게","바닥에서 밤송이집게게 세 마리만 더 부탁해요!","가시가 진짜 밤송이 같아요.",65,3,300),pOi("상류 도감","이끼강 상류에 사는 물고기를 도감에 다 채우고, 퀘스트의 수역 칸에서 받아 봐요.","상류는 이제 다 아는 물이네요!",0,30),wOi("연못 정원사","고사리 너른 못에 리아라는 정원사가 있어요. 일손이 필요하대요.","릴리엔 선장님이요? 마침 잘 왔어요!","ria")],[fOi("비늘 씨앗","씨앗비늘잉어 비늘을 정원에 심어 볼래요. 중층에서 세 마리만!","비늘에서 싹이 나면 꼭 보여 줄게요.",63,3,400),fOi("연꽃 꼬리","연꽃꼬리베타는 물 위쪽에서 놀아요. 깊이를 수면으로 바꿔 봐요.","꼬리가 진짜 연꽃잎 같아요!",49,2,600),fOi("고사리 도롱뇽","고사리아가미도롱뇽은 안개 낀 날 바닥에 나와요. 한 마리만!","아가미가 고사리 잎 같아요.",84,1,600),"rod1","icebox1","boat1",pOi("고사리 너른 못 도감","고사리 너른 못 물고기를 도감에 다 채워 봐요.","연못이 다 네 정원이네요.",1,30),pOi("반딧불 굽이 도감","반딧불 굽이 물고기도 다 채워 봐요.","반딧불처럼 반짝이는 도감이에요.",2,30),wOi("물고기 사서","버섯 물길의 사서 실벤이 물고기 기록을 모은대요. 가 보세요.","리아가 보냈군요. 기록할 게 많아요.","silven")],[dOi("빈 기록","꽃잎 실개천의 물고기는 아직 기록이 비어 있어요. 거기서 아무 물고기나 세 마리.","덕분에 빈칸이 채워졌어요.",3,400,4),fOi("달빛 장어","버들잎장어는 달빛 물때에만 중층으로 나와요. 두 마리 기록해 주세요.","달빛에 잎맥이 비쳐요.",55,2,900),fOi("덩굴 고둥","덩굴나선고둥은 중층에 있어요. 세 개만 부탁해요.","나선이 덩굴처럼 감겨 있군요.",76,3,500),fOi("씨앗 진주","씨앗진주조개는 꽃잎 실개천이나 달빛 샛강 바닥에 있어요. 하나만 부탁해요.","진주 속에 씨앗이… 정말 있군요!",74,1,800),"reel1","bobber1",fOi("연잎 가오리","연잎가오리는 이슬 샛강이나 버들 여울 수면에 떠 있어요. 한 마리만!","연잎이 헤엄치는 줄 알았어요.",51,1,1200),"harpoon","hunt",wOi("소풍 준비","이끼강 하류의 피피가 소풍을 준비한대요. 도와주세요.","와, 손님이다! 소풍에 같이 가요!","pipi")],[fOi("연꽃 그릇","소풍 그릇은 연꽃그릇게면 돼요! 햇살 물때 수면에서 세 마리!","그릇이 세 개! 소풍 준비 끝!",66,3,1e3),fOi("덩굴 리본","덩굴리본벌레로 소풍 깃발을 꾸밀래요. 바닥에서 세 마리!","깃발이 펄럭펄럭!",96,3,600),fOi("나이테 거북","나이테등거북 등을 세면 나이를 안대요. 중층에서 두 마리!","와, 저보다 나이가 많아요!",83,2,800),fOi("수염 해달","뿌리수염해달이 버섯 물길이나 하류 수면에 산대요. 한 마리만 보고 싶어요!","수염이 뿌리 같아요! 귀여워!",93,1,1500),"contest","auto1","line2",pOi("하류 도감","이끼강 하류 물고기를 도감에 다 채워 봐요.","하류 물고기 박사님이에요!",8,50),fOi("이끼강의 주인","이끼강의 주인 솔방울철갑상어를 보고 싶어요! 안개 낀 하류 바닥에 산대요. 튼튼한 줄을 챙겨요!","해냈다! 이제 이끼강에서 모르는 사람이 없을 거예요!",57,1,5e3,300)]],vOi=[[dOi("산 손님","이제 혼자 해 보게, 산 손님! 손부터 풀어 보게. 아무거나 세 마리.","좋아, 산 사람 손은 역시 빠르군!",3,200),fOi("숯뼈가재 국물","배에서 끓일 국물엔 숯뼈가재가 제격이지. 바닥에서 두 마리 부탁하네.","이 향이야… 맛은 못 보지만!",119,2,300),fOi("수면의 소라","잿뿔유령소라는 물 위쪽에 떠다닌다네. 깊이를 수면으로 바꿔 두 마리!","뿔이 잿빛으로 빛나는군.",128,2,300),fOi("중층 새우","뼈마디유령새우는 물 가운데쯤에 있지. 중층에서 두 마리.","마디가 뼈처럼 딱딱하군.",118,2,300),"sell","line1",fOi("박쥐 날개 게","바닥에서 박쥐날개집게게 세 마리만 더 부탁하네.","날개가 있어도 못 나는 게로군!",116,3,300),pOi("상류 도감","잿빛강 상류에 사는 물고기를 도감에 다 채우고, 퀘스트의 수역 칸에서 받아 보게.","상류는 자네 손바닥 안이군!",0,30),wOi("바느질감","마른 갈대 굽이의 모라 할머니가 바느질감을 찾으셔.","카론이 보냈니? 어서 오렴.","mora")],[fOi("고둥 단추","고둥 껍데기로 단추를 달 거란다. 중층에서 유령관고둥 세 개만.","단추가 반짝이니 망토가 사는구나.",126,3,400),fOi("줄무늬 수","뼈줄무늬가아 무늬를 따라 수를 놓고 싶구나. 물 위쪽이란다.","무늬가 참 곱기도 하지.",97,2,600),fOi("묘비 소라게","묘비집소라게 껍데기로 바늘꽂이를 만들 거란다. 바닥에서 한 마리만.","바늘이 쏙쏙 들어가겠구나.",120,1,600),"rod1","icebox1","boat1",pOi("마른 갈대 굽이 도감","마른 갈대 굽이 물고기를 도감에 다 채워 보렴.","굽이가 네 손바닥 안이구나.",1,30),pOi("달그림자 샛강 도감","달그림자 샛강 물고기도 다 채워 보렴.","샛강 그림자까지 다 아는구나.",2,30),wOi("수상한 행상인","부엉이 소에 무무라는 행상인이 있단다. 뭐든 산다더구나.","손님! 좋은 물건 있으면 보여 줘!","mumu")],[dOi("가라앉은 물건","가시 너른 못에 좋은 게 가라앉아 있대. 거기서 아무 물고기나 세 마리 낚아 봐.","역시 그 못이야! 내 감이 맞았어.",3,400,3),fOi("유령 칼","유령칼고기는 달빛 물때에만 중층으로 나와. 두 마리면 값을 쳐 주지.","칼날이 투명해! 좋은 물건이야.",101,2,900),fOi("그림자 리본","그림자리본벌레를 리본으로 팔 거야. 바닥에서 세 마리!","리본이 그림자처럼 흔들려!",144,3,500),fOi("뼈마디 실고기","뼈마디실고기는 부엉이 소 중층에 있어. 두 마리!","실처럼 가는데 뼈가 다 보여!",108,2,800),"reel1","bobber1",fOi("비밀 거래","해골무늬가오리! 가시 너른 못이나 검은 물길 바닥에 있어. 비싸게 쳐 줄게, 쉿.","쉿, 다른 상인한테는 비밀이야.",111,1,1200),"harpoon","hunt",wOi("오래된 생물","잿빛강 하류의 루나가 오래된 생물을 연구한대.","새 조수님이군요! 반가워요.","luna")],[fOi("실고기 표본","뼈마디실고기 표본이 더 필요해요. 중층에서 세 마리!","표본 상자가 꽉 찼어요.",108,3,1e3),fOi("관뚜껑 홍합","관뚜껑홍합은 몇 살인지 궁금해요. 바닥에서 세 개!","껍데기에 나이테가 있어요!",123,3,600),fOi("동굴 도롱뇽","창백동굴도롱뇽은 안개 낀 날 녹슨 실개천이나 잿빛 샛강 바닥에 나와요. 한 마리만!","눈이 없는데 길을 잘 찾아요.",132,1,1200),fOi("유령 해파리","흰보유령해파리는 달빛 물때 수면에 떠요. 한 마리만 연구할게요!","빛이 흔들흔들, 정말 유령 같아요.",137,1,1500),"contest","auto1","line2",pOi("하류 도감","잿빛강 하류 물고기를 도감에 다 채워 봐요.","하류 연구는 당신 덕분이에요!",8,50),fOi("잿빛강의 선배","나보다 오래 산 물고기가 하류 바닥에 있대요. 새벽 안개가 낄 때만 나온대요! 튼튼한 줄을 챙겨요.","선배님을 만났어요! 잿빛강이 당신을 기억할 거예요.",110,1,5e3,300)]],_Oi=[[dOi("꼬마 선원","이제 실전이다, 꼬마 선원! 내 배 옆에서 손부터 풀어라. 아무거나 세 마리.","제법인데! 배에 태워 줄 만하군.",3,200),fOi("선원 밥","선원 밥으로 서리벙어리참게가 필요하다. 바닥에서 두 마리!","오늘 저녁은 게찜이다!",163,2,300),fOi("꼬부리 새우","남빛꼬부리옆새우는 물 가운데쯤에 산다. 깊이를 중층으로 바꿔 두 마리!","꼬부랑 새우, 맛있겠군!",167,2,300),"sell","line1",fOi("막대 맛조개","바닥에서 푸른막대맛조개 세 개 잡아 와라!","국에 넣으면 시원하겠군!",171,3,300),pOi("상류 도감","서리강 상류에 사는 물고기를 도감에 다 채우고, 퀘스트의 수역 칸에서 받아 봐라.","상류는 이제 네 바다다!",0,30),wOi("왕년의 낚시왕","얼음 샛강의 그루마 할머니는 왕년의 낚시왕이시다. 인사드려라.","보르칸 그 꼬맹이가 보냈다고?","gruma")],[fOi("낚싯대 장식","내 낚싯대에 달 장식이 필요해. 물소용돌이고둥 세 개, 중층이야.","그래, 이 소리야. 손맛이 난다.",174,3,400),fOi("가시복 백 마리","서리가시복은 물 위쪽에서 잡는 거야. 내 젊을 땐 하루에 백 마리였지. 두 마리만 해 봐.","흠, 나쁘지 않아. 낚시왕 될 상이야.",155,2,600),fOi("빗해파리","물줄무늬빗해파리는 달빛 물때 중층에 떠. 한 마리만 보여 줘.","줄무늬가 무지개처럼 반짝이지?",191,1,600),"rod1","icebox1","boat1",pOi("얼음 샛강 도감","얼음 샛강 물고기를 도감에 다 채워 봐.","샛강은 네 손바닥 안이구나.",1,30),pOi("눈보라 너른 못 도감","눈보라 너른 못 물고기도 다 채워 봐.","눈보라 속에서도 다 찾았구나!",2,30),wOi("국수 국물","흰 소의 우동이 국수 국물 재료를 찾는다더라.","할머니 손님이면 국수 곱빼기!","udong")],[dOi("국물 맛 물","늑대 실개천 물이 국물 맛을 낸대. 거기서 아무 물고기나 세 마리 잡아 줘.","이 물 냄새, 국물 맛이 나는데?",3,400,3),fOi("학공치 고명","국수 고명은 물창학공치지! 물 위쪽에서 두 마리.","고명이 반짝반짝!",157,2,900),fOi("삿갓조개 국물","서리삿갓조개로 국물을 낼 거야. 바닥에서 세 개!","국물이 시원해!",173,3,500),fOi("갑옷 군부","남빛갑옷군부는 바위 바닥에 붙어 있어. 두 마리 떼어 와 줘.","쫄깃쫄깃 씹는 맛!",176,2,800),"reel1","bobber1",fOi("찌릿한 국물","찌릿한 국물을 만들 거야! 물방울전기가오리는 늑대 실개천이나 바위 샛강 바닥에 있어.","찌릿찌릿! 신메뉴 완성이다!",154,1,1200),"harpoon","hunt",wOi("게 동호회","얼음꽃 웅덩이의 크라라가 게 동호회를 한대. 가 봐!","새 회원이다! 환영해!","krara")],[fOi("거북손 모으기","서리꽃거북손은 안개 낀 날 물 위쪽에 붙어 있어! 세 개 모아 줘!","거북손도 게 친구야!",168,3,1e3),fOi("말미잘 친구","게는 말미잘이랑 친해. 바닥에서 물방울말미잘 세 개!","게들이 좋아하겠다!",192,3,600),fOi("방울 도치","방울혹도치는 안개 낀 날 중층에 나와. 한 마리만 보여 줘!","방울이 딸랑딸랑!",159,1,1200),fOi("둥실 해달","둥실배해달은 흰 소나 하류 수면에 둥실 떠 있대. 한 마리만!","배를 두드리며 떠 있어! 귀여워!",188,1,1500),"contest","auto1","line2",pOi("얼음꽃 웅덩이 도감","얼음꽃 웅덩이 물고기를 도감에 다 채워 봐!","웅덩이 회장님이다!",7,50),fOi("서리강의 톱","하류 바닥에 톱 같은 주둥이 상어가 산대! 새벽 안개가 낄 때만 나온대! 튼튼한 줄을 챙겨!","우와, 진짜 톱이야! 서리강 최고 낚시꾼!",152,1,5e3,300)]]; - function MOi(t,i){ - return i.map((i,s)=>{ - const e=oOi[t].npcs[s].id; - let n=0; - return i.map(i=>"string"==typeof i?{ - ...uOi[i],npc:e} - :{ - ...i,id:`${ - t} - :${ - e} - :${ - ++n} - `,npc:e} - )} - )} - Qt(MOi,"build"); - const bOi={ - "인간":MOi("인간",gOi),"엘프":MOi("엘프",mOi),"언데드":MOi("언데드",vOi),"오크":MOi("오크",_Oi)} - ,yOi=new Map; - for(const Set of fTi)for(const t of bOi[Set])for(const i of t)i.teach||yOi.set(i.id,i); - for(const Set of Object.values(uOi))yOi.set(Set.id,Set); - const EOi=new Map([["sell","line1"],["rod1","icebox1","boat1"],["reel1","bobber1","harpoon","hunt"],["contest","auto1","line2"]].flatMap((t,i)=>t.map(t=>[`teach:${ - t} - `,i]))),AOi=Qt(()=>({ - held:[],done:[],met:[]} - ),"freshQuestLog"),SOi=Qt((t,i,s)=>(bOi[t][i]??[]).filter(i=>!i.teach||t===s),"chapterQuests"),TOi=Qt(t=>yOi.get(t)??null,"questDef"); - function COi(t,i){ - const s=EOi.get(t); - if(void 0!==s)return{ - race:i,ci:s} - ; - const e=t.split(":")[0]; - if(!bOi[e])return null; - const n=bOi[e].findIndex(i=>i.some(i=>i.id===t)); - return n<0?null:{ - race:e,ci:n} - } - function OOi(t,i){ - return"meet"===t.kind?t.to:t.teach?oOi[i].npcs[EOi.get(t.id)??0].id:t.npc} - Qt(COi,"questRiver"),Qt(OOi,"questTurnIn"); - const IOi=Qt(t=>"meet"===t.kind?0:"any"===t.kind||"fish"===t.kind||"sell"===t.kind?t.count:1,"questNeed"),kOi=Qt(t=>t.id.split(":")[0],"riverOf"); - function xOi(t,i,s){ - const e=t.held.find(t=>t.id===i.id); - return e?"gear"===i.kind?s.gear[i.gear]>=i.level?1:0:"area"===i.kind?s.areaClaimed.includes(FCi(kOi(i),"R",i.point))?1:0:"contest"===i.kind?Math.max(e.got,s.contestToday?1:0):Math.min(e.got,IOi(i)):0} - Qt(xOi,"questGot"); - const ROi=Qt((t,i,s)=>t.held.some(t=>t.id===i.id)&&xOi(t,i,s)>=IOi(i),"questReady"),POi=Qt((t,i,s)=>{ - var e; - return(null==(e=oOi[i].npcs[0])?void 0:e.id)===s||t.met.includes(s)} - ,"npcMet"); - function NOi(t,i,s,e){ - var n; - const h=(null==(n=oOi[i])?void 0:n.npcs.findIndex(t=>t.id===s))??-1; - if(h<0||!POi(t,i,s))return[]; - const r=SOi(i,h,e),o=[],a=Qt(i=>t.done.includes(i)||t.held.some(t=>t.id===i),"taken"); - for(const c of r)if(!a(c.id)&&!("meet"===c.kind&&r.filter(i=>"meet"!==i.kind&&!t.done.includes(i.id)).length>2)&&(o.push(c),o.length>=3))break; - return o} - function LOi(t,i){ - if(!i.broken)for(const s of t.held){ - const t=TOi(s.id); - if(!t)continue; - const e=IOi(t); - "fish"===t.kind&&i.id===t.fish?s.got=Math.min(e,s.got+1):"any"!==t.kind||i.race!==kOi(t)||"R"!==i.zone||void 0!==t.point&&i.point!==t.point||(s.got=Math.min(e,s.got+1))} - } - function DOi(t,i){ - var s; - const e=i&&t.held.some(t=>t.id===i)?i:null==(s=t.held[0])?void 0:s.id; - return e?TOi(e):null} - Qt(NOi,"questOffers"),Qt(LOi,"questOnCatch"),Qt(DOi,"trackedQuest"); - const GOi=Qt(t=>{ - var i; - return(null==(i=fTi.map(i=>oOi[i].npcs.find(i=>i.id===t)).find(Boolean))?void 0:i.name)??t} - ,"npcName"),BOi=["gear","sell","harpoon","contest","area"]; - function UOi(t,i){ - const s=IOi(t),e=Math.min(i,s); - switch(t.kind){ - case"fish":{ - const i=DTi(t.fish); - return{ - text:`${ - i.name} - ${ - e} - /${ - s} - 마리`,ask:`${ - i.name} - ${ - s} - 마리`,done:`${ - i.name} - ${ - s} - 마리 다 잡았어요`,hint:i.pts.length>=9?"이 강 어디서나":`${ - GTi(i.race,i.zone,i.pts[0])} - 근처`} - } - case"any":{ - const i=void 0!==t.point?GTi(t.id.split(":")[0],"R",t.point):null; - return{ - text:`${ - i?`${ - i} - 에서 `:""} - 아무 물고기 ${ - e} - /${ - s} - 마리`,ask:`${ - i?`${ - i} - 에서 `:""} - 아무 물고기 ${ - s} - 마리`,done:"다 잡았어요",hint:i??"이 강 어디서나"} - } - case"sell":return{ - text:`물고기 팔기 ${ - e.toLocaleString()} - /${ - s.toLocaleString()} - 골드`,ask:`물고기 ${ - s.toLocaleString()} - 골드어치 팔기`,done:"다 팔았어요",hint:"[어망]에서"} - ; - case"gear":{ - const i="line"===t.gear||"rod"===t.gear?"낚싯대":"reel"===t.gear||"bobber"===t.gear?"찌":"icebox"===t.gear?"어망":null; - if(i)return{ - text:`${ - i} - ★${ - t.level} - 끼기`,ask:`${ - i} - 칸에 ★${ - t.level} - ${ - i} - 끼기`,done:`★${ - t.level} - ${ - i} - 를 꼈어요`,hint:"[장비] › 내 배에서"} - ; - const s=XTi.find(i=>i.key===t.gear); - return{ - text:`${ - s.title} - → ${ - s.names[t.level]} - `,ask:`${ - s.title} - 을 ${ - s.names[t.level]} - 로`,done:`${ - s.names[t.level]} - 로 바꿨어요`,hint:"boat"===t.gear?"[장비] › 내 배에서":"[장비] › 도구에서"} - } - case"harpoon":return{ - text:"작살 만들기",ask:"작살 하나 만들기",done:"작살을 만들었어요",hint:"[작살] 단추에서"} - ; - case"hunt":return{ - text:"몬스터에게 작살 던지기",ask:"몬스터에게 작살 한 번 던지기",done:"작살을 던졌어요",hint:"큰 그림자가 지나갈 때"} - ; - case"contest":return{ - text:"오늘 대회 참가",ask:"오늘 대회에 참가하기",done:"대회에 참가했어요",hint:"[퀘스트] › 대회에서"} - ; - case"area":{ - const i=GTi(t.id.split(":")[0],"R",t.point); - return{ - text:`${ - i} - 수역 클리어`,ask:`${ - i} - 수역 클리어 받기`,done:"수역을 채웠어요",hint:"[퀘스트] › 수역에서"} - } - case"meet":return{ - text:`${ - GOi(t.to)} - 에게 가기`,ask:`${ - GOi(t.to)} - 에게 가서 인사하기`,done:"인사했어요",hint:"배를 몰고 가서 말을 걸어요"} - } - } - function FOi(t,i,s,e,n=[]){ - return WAi(t,i,s,e,n)} - function $Oi(t,i,s){ - return t?t.c!==i.castAt?[]:t.ks.filter(t=>t<i.k&&!s.includes(t)):[]} - function HOi(t,i,s,e){ - return{ - id:t.id,star:t.star,grade:t.grade,r:t.r,kg:t.kg,cm:t.cm,at:i,race:s.race,zone:s.zone,point:s.point,tide:UTi(i),broken:t.broken&&!e,manual:!0} - } - function WOi(t,i,s,e){ - if(t.qlog&&LOi(t.qlog,i),i.broken)return t.lost[i.id]=Math.max(t.lost[i.id]??0,i.kg),!1; - t.icebox.push(i); - const n=t.dex[i.id]; - return n?(n.count++,n.bestKg=Math.max(n.bestKg,i.kg),n.bestR=Math.max(n.bestR,i.r),!1):(t.dex[i.id]={ - firstDay:s,firstPoint:e,bestKg:i.kg,bestR:i.r,count:1} - ,!0)} - function VOi(t,i){ - if(!t||t.c!==i.castAt)return null; - const s=t.ks.filter(t=>t>=i.k); - return s.length?{ - c:t.c,ks:s} - :null} - function jOi(t,i){ - const s=i||"guest"; - return t.filter(t=>t===`ef2_fishing_pending_hooks_v1:${ - s} - `||t.startsWith(`fishing:fog:v1:${ - s} - :`)||t.startsWith(`fishing:spots:v1:${ - s} - :`)||t.startsWith(`fishing:fog:v2:${ - s} - :`)||t.startsWith(`fishing:spots:v2:${ - s} - :`)||"fishing.trackedQuest"===t||t===`fishing.plunder.seen.${ - i} - `||"fishing.plunder.hint"===t)} - Qt(UOi,"questObjective"),Qt(FOi,"biteTime"),Qt($Oi,"lostHooks"),Qt(HOi,"ticketCatch"),Qt(WOi,"applyLocalCatch"),Qt(VOi,"pruneHooks"),Qt(jOi,"fishingLocalKeys"); - const KOi=class t extends rN{ - constructor(){ - super(...arguments),Zt(this,"have",null),Zt(this,"hooks",null),Zt(this,"beforeSend",null)} - url(t){ - return`${ - GP.baseURL} - /minigame/fishing/${ - t} - `} - async send(i,s={ - } - ,e=!1){ - var n; - !t.NO_FLUSH.has(i)&&this.beforeSend&&await this.beforeSend(); - const h=null==(n=this.have)?void 0:n.call(this); - return this.post(this.url(i),h?{ - ...s,have:h} - :s,e)} - sync(t,i=!0){ - var s; - const e=null==(s=this.hooks)?void 0:s.call(this); - return this.send("sync",{ - ...t?{ - pos:t} - :{ - } - ,...i?{ - } - :{ - others:!1} - ,...e?{ - hooks:e} - :{ - } - } - )} - cast(t){ - return this.send("cast",t?{ - pos:t} - :{ - } - )} - hook(t,i){ - return this.send("hook",i?{ - k:t,pos:i} - :{ - k:t} - )} - awayReport(){ - return this.send("awayReport")} - move(t,i,s,e){ - return this.send("move",{ - race:t,zone:i,point:s,depth:e} - )} - sell(t){ - return this.send("sell",{ - key:t} - )} - sellAll(){ - return this.send("sellAll",{ - } - ,!0)} - sellKeys(t){ - return this.send("sellKeys",{ - keys:t} - ,!0)} - sellFish(t){ - return this.send("sellFish",{ - fish:t} - ,!0)} - autoSell(t){ - return this.send("autoSell",{ - opts:t} - ,!0)} - aquariumPut(t){ - return this.send("aquariumPut",{ - key:t} - )} - aquariumPutFish(t){ - return this.send("aquariumPut",{ - fish:t} - )} - aquariumTake(t){ - return this.send("aquariumTake",{ - index:t} - )} - aquariumExpand(){ - return this.send("aquariumExpand",{ - } - ,!0)} - upgrade(t){ - return this.send("upgrade",{ - key:t} - ,!0)} - buy(t){ - return this.send("buy",{ - id:t} - ,!0)} - exchange(t,i,s,e){ - return this.send("exchange",{ - seasonId:t,rev:i,kindNum:s,qty:e} - ,!0)} - life(){ - return this.send("life")} - dailyClaim(t){ - return this.send("daily/claim",{ - day:t} - ,!0)} - joinContest(t){ - return this.send("joinContest",{ - contestId:t} - ,!0)} - socialStatus(){ - return this.send("social/status")} - socialJoin(t){ - return this.send("social/join",{ - contestId:t} - ,!0)} - socialClaim(t){ - return this.send("social/claim",{ - ids:t} - ,!0)} - huntPing(){ - return this.send("hunt/ping")} - huntAim(t){ - return this.send("hunt/aim",{ - pingId:t} - )} - huntShot(t,i){ - return this.send("hunt/shot",{ - aimId:t,...i?{ - pos:i} - :{ - } - } - )} - claimContest(){ - return this.send("claimContest",{ - } - ,!0)} - deliver(t){ - return this.send("deliver",{ - key:t} - )} - claimAllMilestones(){ - return this.send("claimAllMilestones",{ - } - ,!0)} - claimMilestone(t,i){ - return this.send("claimMilestone",{ - kind:t,idx:i} - )} - questAccept(t,i,s){ - return this.send("quest/accept",{ - id:t,race:i,npc:s} - )} - questAbandon(t){ - return this.send("quest/abandon",{ - id:t} - )} - questComplete(t){ - return this.send("quest/complete",{ - id:t} - )} - areaClaim(t,i,s){ - return this.send("area/claim",{ - race:t,zone:i,point:s} - )} - guideSeen(t){ - return this.send("guideSeen",t?{ - tip:t} - :{ - } - )} - look(t){ - return this.send("look",{ - look:t} - ,!0)} - plunderPeek(t,i){ - return this.send("plunder/peek",i?{ - target:t,pos:i} - :{ - target:t} - )} - plunderStart(t,i){ - return this.send("plunder/start",i?{ - target:t,pos:i} - :{ - target:t} - ,!0)} - plunderStop(t){ - return this.send("plunder/stop",t?{ - pos:t} - :{ - } - )} - plunderCut(){ - return this.send("plunder/cut",{ - } - )} - tradeRequest(t,i){ - return this.send("trade/request",i?{ - target:t,pos:i} - :{ - target:t} - )} - tradeAnswer(t,i,s){ - return this.send("trade/answer",s?{ - room:t,yes:i,pos:s} - :{ - room:t,yes:i} - )} - tradeOffer(t,i){ - return this.send("trade/offer",{ - room:t,refs:i} - )} - tradeReady(t,i,s,e){ - return this.send("trade/ready",e?{ - room:t,ok:i,ver:s,pos:e} - :{ - room:t,ok:i,ver:s} - )} - tradeCancel(t){ - return this.send("trade/cancel",{ - room:t} - )} - tradeEmote(t,i){ - return this.send("trade/emote",{ - room:t,e:i} - )} - tradePoll(){ - return this.send("trade/poll",{ - } - )} - huntThrow(t,i){ - return this.send("hunt/throw",i?{ - grade:t,pos:i} - :{ - grade:t} - )} - huntStatus(t){ - return this.send("hunt/status",t?{ - hint:t} - :void 0)} - wsTicket(){ - return this.send("ws/ticket")} - huntCraft(t,i){ - return this.send("hunt/craft",{ - kind:t,n:i} - )} - huntMakeMat(t,i){ - return this.send("hunt/mat",{ - kind:t,n:i} - )} - huntMats(){ - return this.send("hunt/mats")} - gearPull(t){ - return this.send("gear/pull",{ - n:t} - )} - gearMerge(t,i,s=!1){ - return this.send("gear/merge",s?{ - all:!0} - :{ - slot:t,star:i} - )} - gearMergeGroups(t){ - return this.send("gear/merge",{ - groups:t} - )} - gearKeep(t,i){ - return this.send("gear/keep",{ - uid:t,on:i} - )} - gearEquip(t,i){ - return this.send("gear/equip",null===t?{ - uid:null,slot:i} - :{ - uid:t} - )} - gearEquipBest(){ - return this.send("gear/equipBest",{ - } - )} - huntUse(t){ - return this.send("hunt/use",{ - kind:t} - )} - boatRepair(t,i){ - return this.send("boat/repair",i?{ - action:t,pos:i} - :{ - action:t} - )} - boatHelp(t,i){ - return this.send("boat/help",i?{ - target:t,pos:i} - :{ - target:t} - )} - dev(t,i={ - } - ){ - return this.send("dev",{ - action:t,...i} - )} - } - ; - Qt(KOi,"FishingService"),Zt(KOi,"NO_FLUSH",new Set(["sync","hunt/status","ws/ticket","life","trade/poll","trade/emote","trade/cancel","trade/answer"])); - let zOi=KOi; - const YOi=[{ - id:"hello",prog:0,kind:"talk"} - ,{ - id:"hello2",prog:0,kind:"talk"} - ,{ - id:"goal",prog:0,kind:"goal"} - ,{ - id:"sailing",prog:0,kind:"wait"} - ,{ - id:"rod",prog:1,kind:"rod"} - ,{ - id:"wait",prog:1,kind:"wait"} - ,{ - id:"bite",prog:2,kind:"bite"} - ,{ - id:"caught",prog:2,kind:"talk"} - ,{ - id:"idle",prog:2,kind:"talk"} - ,{ - id:"movebtn",prog:3,kind:"btn"} - ,{ - id:"sea",prog:3,kind:"sea"} - ,{ - id:"done",prog:3,kind:"talk"} - ,{ - id:"end",prog:3,kind:"end"} - ],qOi=["sail","rod","bite","move"],XOi=Qt((t,i)=>({ - info:i?1-t:1,menu:1-t} - ),"immersionAlpha"),JOi=["배 몰기","낚시 시작","챔질","다시 이동"],QOi=Qt(t=>{ - var i; - return(null==(i=YOi[YOi.findIndex(i=>i.id===t)+1])?void 0:i.id)??null} - ,"nextStep"),ZOi=Qt(t=>YOi.find(i=>i.id===t),"tutStep"),tIi=1700,iIi=1400; - function sIi(t){ - const i=oOi[t].npcs; - return i.find(t=>t.ship)??i[0]} - Qt(sIi,"tutorialCaptain"); - const eIi=Qt((t,i,s)=>{ - const e=t.charCodeAt(t.length-1); - return`${ - t} - ${ - e>=44032&&e<=55203&&(e-44032)%28==0?s:i} - `} - ,"withJosa"),nIi={ - ben:{ - hello:"어서 오게, 새 낚시꾼!\n나는 벤 선장일세.",hello2:"본격적으로 낚시하기 전에\n배 모는 법부터 익혀 보세.",goal:"금빛 고리가 보이지?\n눌러서 배를 옮겨 보게.",sailing:"그렇지! 배는 누른 곳까지\n알아서 간다네.",rod:"멈추면 머리 위에 낚싯대가 뜨지.\n낚싯대를 누르면 찌를 던져 준다네.",wait:"물고기가 물 때까지\n조금만 기다려 보게…",bite:"지금이야!\n누르게!",caught:"첫 물고기로군! 축하하네.",idle:"가만 둬도 물고기는 잡히네.\n느낌표 때 누르면 훨씬 빨라지지!",movebtn:"낚시를 하다가 이동하려면\n[이동] 버튼을 누르게.",sea:"이제 가고 싶은 물을\n아무 데나 눌러 보게.",done:"좋아, 다 배웠네!",end:"자, 이제 내 배로 가세.\n거기서 첫 부탁을 주겠네!",missed:"놓쳤군! 괜찮네.\n다음 느낌표 때 눌러 보게.",fishA:"이야.",fishB:"야."} - ,lilien:{ - hello:"어서 와요, 새 낚시꾼!\n나는 릴리엔 선장이에요.",hello2:"본격적으로 낚시하기 전에\n배 모는 법부터 익혀 봐요.",goal:"금빛 고리가 보이죠?\n눌러서 배를 옮겨 봐요.",sailing:"좋아요! 배는 누른 곳까지\n알아서 가요.",rod:"멈추면 머리 위에 낚싯대가 떠요.\n낚싯대를 누르면 찌를 던져 줄게요.",wait:"물고기가 물 때까지\n조금만 기다려 봐요…",bite:"지금이에요!\n눌러요!",caught:"첫 물고기네요! 축하해요.",idle:"가만 둬도 물고기는 잡혀요.\n느낌표 때 누르면 훨씬 빨라져요!",movebtn:"낚시를 하다가 이동하려면\n[이동] 버튼을 눌러요.",sea:"이제 가고 싶은 물을\n아무 데나 눌러 봐요.",done:"좋아요, 다 배웠어요!",end:"자, 이제 내 배로 가요.\n거기서 첫 부탁을 줄게요!",missed:"놓쳤네요! 괜찮아요.\n다음 느낌표 때 눌러 봐요.",fishA:"이에요.",fishB:"예요."} - ,charon:{ - hello:"어서 오게, 산 손님!\n잿빛강 뱃사공 카론일세.",hello2:"본격적으로 낚시하기 전에\n배 모는 법부터 익혀 보세.",goal:"금빛 고리가 보이나?\n눌러서 배를 옮겨 보게.",sailing:"그렇지! 배는 누른 곳까지\n알아서 간다네.",rod:"멈추면 머리 위에 낚싯대가 뜨지.\n낚싯대를 누르면 찌를 던져 준다네.",wait:"물고기가 물 때까지\n조금만 기다려 보게…",bite:"지금일세!\n누르게!",caught:"첫 물고기로군! 축하하네.",idle:"가만 둬도 물고기는 잡히네.\n느낌표 때 누르면 훨씬 빨라지지!",movebtn:"낚시를 하다가 이동하려면\n[이동] 버튼을 누르게.",sea:"이제 가고 싶은 물을\n아무 데나 눌러 보게.",done:"좋아, 다 배웠네!",end:"자, 이제 내 배로 가세.\n거기서 첫 부탁을 주겠네!",missed:"놓쳤군! 괜찮네.\n다음 느낌표 때 눌러 보게.",fishA:"이로군.",fishB:"로군."} - ,borkan:{ - hello:"어서 와라, 꼬마 선원!\n나는 보르칸 선장이다.",hello2:"본격적으로 낚시하기 전에\n배 모는 법부터 익혀라.",goal:"금빛 고리가 보이지?\n눌러서 배를 옮겨 봐라.",sailing:"그렇지! 배는 누른 곳까지\n알아서 간다.",rod:"멈추면 머리 위에 낚싯대가 뜬다.\n낚싯대를 누르면 찌를 던져 주마.",wait:"물고기가 물 때까지\n조금만 기다려라…",bite:"지금이다!\n눌러라!",caught:"첫 물고기다! 잘했다.",idle:"가만 둬도 물고기는 잡힌다.\n느낌표 때 누르면 훨씬 빨라지지!",movebtn:"낚시를 하다가 이동하려면\n[이동] 버튼을 눌러라.",sea:"이제 가고 싶은 물을\n아무 데나 눌러 봐라.",done:"좋아, 다 배웠다!",end:"자, 이제 내 배로 가자.\n거기서 첫 부탁을 주마!",missed:"놓쳤군! 괜찮다.\n다음 느낌표 때 눌러라.",fishA:"이군.",fishB:"군."} - } - ; - function hIi(t,i=""){ - const s=nIi[sIi(t).id]??nIi.ben,{ - fishA:e,fishB:n,...h} - =s; - return{ - ...h,caught:i?`${ - h.caught} - \n${ - eIi(i,e,n)} - `:h.caught} - } - function rIi(t){ - return!t.tutSeen&&t.look&&0===t.dex&&0===t.journeyStep&&!t.accepted} - function oIi(t,i,s=62){ - const e=[...t].length; - return e?Math.min(e,1+Math.floor(Math.max(0,i)/s)):0} - Qt(hIi,"tutorialLines"),Qt(rIi,"shouldStartTutorial"),Qt(oIi,"typedCount"); - const aIi=Qt(t=>{ - const i=Math.max(0,Math.min(1,t)); - return i*i*(3-2*i)} - ,"smooth$4"); - function cIi(t){ - const i=(t%tIi+tIi)%tIi/tIi,s=i<.4?-4*aIi(i/.4):i<.55?-4*(1-aIi((i-.4)/.15)):0; - return{ - dx:s,dy:s,scale:i<.55?1-.08*aIi(i/.55):i<.7?.92+.08*aIi((i-.55)/.15):1} - } - function lIi(t){ - const i=(t%iIi+iIi)%iIi/iIi,s=1-(1-i)*(1-i); - return{ - r:15+35*s,alpha:.9*(1-s)} - } - Qt(cIi,"handPose"),Qt(lIi,"ringPose"); - const uIi=[15.5,14.5,13.5,13]; - function dIi(t){ - for(const i of[!1,!0])for(const s of uIi){ - const e=t(s,i); - if(e<=3)return{ - size:s,lines:e,narrow:i,over:!1} - } - return{ - size:13,lines:t(13,!0),narrow:!0,over:!0} - } - Qt(dIi,"fitTalk"); - const fIi=["남","여"],pIi=["인간","엘프","언데드","오크"],wIi=[[16243908,15713183,14394746,6635563,14271210,12904143,11127024],[16508628,15979186,15057053,6635563,14271210,12904143,11127024],[13621467,11780556,12761299,11058350,14538182],[10475238,6077652,3975360,4165560,8366020]],gIi=[["짧은 머리","긴 머리","뒤로 묶음"],["짧은 머리","긴 머리","뒤로 묶음"]],mIi=[["short","long","pony"],["bob","long","pony"]],vIi=[2825751,7225123,12864046,15123036,15525594,4165769,4025536],_Ii=[2,5,0,6],MIi=["주근깨","볼터치","수염","흉터","안경","안대","귀걸이"],bIi=[3,1,4,5,6]; - function yIi(t){ - return Array.isArray(t)?[...new Set(t.filter(t=>Number.isInteger(t)&&bIi.includes(t)))].sort((t,i)=>t-i).slice(0,2):[]} - Qt(yIi,"normalizeFeats"); - const EIi=[{ - name:"어부 조끼",hat:"none"} - ,{ - name:"비옷",hat:"rain"} - ,{ - name:"줄무늬 선원복",hat:"cap"} - ,{ - name:"후드 망토",hat:"hood"} - ],AIi=[13190973,3108771,14854458,4164186,6965898,3817290],SIi={ - sex:2,race:4,skin:7,hair:3,hairColor:7,feats:7,outfit:4,outfitColor:6,talent:4} - ,TIi={ - v:1,sex:0,race:0,skin:1,hair:0,hairColor:1,feats:[],outfit:0,outfitColor:0,talent:0} - ,CIi=Qt((t,i)=>Number.isInteger(t)&&t>=0&&t<i,"isIndex"); - function OIi(t){ - if(!t||"object"!=typeof t)return null; - for(const i of["sex","race","skin","hair","hairColor"])if(!CIi(t[i],"hair"===i?4:SIi[i]))return null; - return t.skin>=wIi[t.race].length?null:{ - v:1,sex:t.sex,race:t.race,skin:t.skin,hair:t.hair<SIi.hair?t.hair:0,hairColor:t.hairColor,feats:yIi(t.feats),outfit:0,outfitColor:0,talent:0} - } - function IIi(t){ - const i=Qt(i=>void 0===t.feats[i]?"-":String(t.feats[i]),"f"); - return`${ - t.v} - ${ - t.sex} - ${ - t.race} - ${ - t.skin} - ${ - t.hair} - ${ - t.hairColor} - ${ - i(0)} - ${ - i(1)} - ${ - t.outfit} - ${ - t.outfitColor} - ${ - t.talent} - `} - function kIi(t){ - if("string"!=typeof t||11!==t.length||"1"!==t[0])return null; - const i=Qt(i=>"-"===t[i]?-1:Number(t[i]),"n"); - return OIi({ - sex:i(1),race:i(2),skin:i(3),hair:i(4),hairColor:i(5),feats:[i(6),i(7)].filter(t=>t>=0),outfit:i(8),outfitColor:i(9),talent:i(10)} - )} - Qt(OIi,"validLook"),Qt(IIi,"packLook"),Qt(kIi,"unpackLook"); - const xIi=36e5,RIi=160; - function PIi(t,i){ - if(!t)return{ - n:3,nextAt:null} - ; - if(t.tickets>=3)return{ - n:3,nextAt:null} - ; - const s=Math.floor(Math.max(0,i-t.ticketAt)/xIi),e=Math.min(3,t.tickets+s),n=t.ticketAt+s*xIi; - return{ - n:e,nextAt:e>=3?null:n+xIi} - } - function NIi(t,i){ - return Math.max(0,Math.min(t.max,Math.floor((i-t.startAt)/t.every)))} - function LIi(t,i){ - const s=NIi(t,i); - return s>=t.max?0:t.startAt+(s+1)*t.every-i} - Qt(PIi,"ticketsOf"),Qt(NIi,"raidCount"),Qt(LIi,"raidNextIn"); - const DIi=Qt(t=>Math.min(.5*t.every,2e4),"leadOf"); - function GIi(t,i){ - var s; - const e=NIi(t,i),n=null==(s=t.plan)?void 0:s[e]; - if(!n||e>=t.max)return{ - level:0,p:0} - ; - const h=DIi(t),r=t.startAt+(e+1)*t.every-i; - return r>h?{ - level:0,p:0} - :{ - level:n.grade>=3?3:2===n.grade?2:1===n.grade&&BAi(t.seed+7919*e)%100<35?1:0,p:Math.max(0,Math.min(1,1-r/h))} - } - function BIi(t,i){ - if(!t.net)return null; - const s=[...t.net]; - for(const e of(t.plan??[]).slice(0,NIi(t,i)))s[e.grade]=Math.max(0,s[e.grade]-1); - return s} - Qt(GIi,"raidTension"),Qt(BIi,"netLeft"); - const UIi={ - EVERY_MS:18e5,DUR_MS:24e4,CD_MS:1500,SLOT_BASE:3,START_WOOD:5,STOCK_MAX:99,DMG:10,MULT:{ - perfect:3,great:2,good:1,miss:0} - ,KEY_TTL_SEC:10800,MIN_LEVEL:2} - ,FIi=["wood","iron","mithril","bone","thunder"],$Ii={ - wood:{ - kind:"wood",name:"나무 작살",mult:1,fish:3,minStar:1,gold:20} - ,iron:{ - kind:"iron",name:"쇠 작살",mult:2,fish:3,minStar:2,gold:100} - ,mithril:{ - kind:"mithril",name:"미스릴 작살",mult:3.5,fish:2,minStar:3,gold:400} - ,bone:{ - kind:"bone",name:"용뼈 작살",mult:6,fish:0,minStar:0,gold:1e3,mat:"bone",matN:1} - ,thunder:{ - kind:"thunder",name:"번개 작살",mult:10,fish:0,minStar:0,gold:2e3,mat:"thunder",matN:1} - } - ,HIi=["bone","thunder"],WIi={ - bone:{ - kind:"bone",kindNum:1,name:"용뼈",fish:2,minStar:4,gold:1e3} - ,thunder:{ - kind:"thunder",kindNum:2,name:"번개 결정",fish:1,minStar:5,gold:2e3} - } - ,VIi={ - R:[{ - kind:"catfish",name:"거대 메기",min:1,wave:6} - ,{ - kind:"eel",name:"왕장어",min:1,wave:8} - ,{ - kind:"sturgeon",name:"늙은 철갑상어",min:2,wave:12} - ,{ - kind:"croc",name:"늪 악어",min:2,wave:10} - ],C:[{ - kind:"manta",name:"대왕 가오리",min:2,wave:26} - ,{ - kind:"turtle",name:"고대 바다거북",min:2,wave:30} - ,{ - kind:"shark",name:"백상아리",min:3,wave:36} - ,{ - kind:"whaleShark",name:"고래상어",min:3,wave:40} - ,{ - kind:"jelly",name:"거대 해파리",min:2,wave:28} - ,{ - kind:"hammer",name:"귀상어 떼",min:3,wave:38} - ],O:[{ - kind:"shark",name:"식인 상어",min:3,wave:75} - ,{ - kind:"whaleShark",name:"심해 고래상어",min:4,wave:85} - ,{ - kind:"narwhal",name:"얼음 일각고래",min:4,wave:80} - ,{ - kind:"squid",name:"대왕오징어",min:6,wave:100} - ,{ - kind:"angler",name:"거대 아귀",min:5,wave:95,deep:!0} - ,{ - kind:"octopus",name:"왕문어",min:6,wave:105,deep:!0} - ,{ - kind:"sperm",name:"흰 향유고래",min:8,wave:110,deep:!0} - ,{ - kind:"serpent",name:"심연 바다뱀",min:10,wave:120,deep:!0} - ]} - ,jIi=Qt((t,i)=>VIi[t].filter(s=>!!s.deep==("O"===t&&i>=11)),"bossList"),KIi=["R","C","O"].flatMap(t=>VIi[t].map(i=>({ - ...i,zone:t} - ))),zIi=Qt(t=>Math.round(80*Math.pow(1.24,t-1)),"huntShare"),YIi=(UIi.SLOT_BASE+Math.min(3,Math.floor(3)))*(UIi.DMG+18)*UIi.MULT.great*$Ii.thunder.mult*1.6; - function qIi(t,i,s=0){ - const e=Math.max(i.min,Math.pow(Math.max(0,s),.85)),n=Math.round(zIi(t)*e),h=i.needBest?100*Math.ceil(((i.needBest-1)*YIi+1)/100):0; - return{ - hp:Math.max(n,h),pot:4*n} - } - function XIi(t,i,s){ - const e=$Si(t,i),n=BAi(7919*e+104729*s),h=jIi(i,e),r=h[n%h.length],o=s*UIi.EVERY_MS+BAi(n+3)%Math.floor(UIi.EVERY_MS/2); - return{ - w:s,at:o,end:o+UIi.DUR_MS,kind:r.kind,name:r.name,tier:e,...qIi(e,r),min:r.min,...r.needBest?{ - needBest:r.needBest} - :{ - } - ,wave:Math.round(r.wave*USi(e))} - } - function JIi(t,i,s){ - const e=-Math.floor(s/1e3); - return{ - ...XIi(t,i,Math.floor(s/UIi.EVERY_MS)),w:e,at:s,end:s+UIi.DUR_MS} - } - function QIi(t,i,s,e){ - if(e&&s>=e&&s<e+UIi.DUR_MS)return JIi(t,i,e); - const n=XIi(t,i,Math.floor(s/UIi.EVERY_MS)); - return s>=n.at&&s<n.end?n:null} - function ZIi(t,i,s){ - return s&&i>=s&&i<s+UIi.DUR_MS?JIi(t.race,t.zone,s):hCi(t)>=UIi.MIN_LEVEL?QIi(t.race,t.zone,i):null} - function tki(t,i,s){ - return ZIi(t,i,s)||(hCi(t)>=UIi.MIN_LEVEL?iki(t.race,t.zone,i):null)} - function iki(t,i,s,e){ - const n=QIi(t,i,s,e); - if(n)return n; - const h=Math.floor(s/UIi.EVERY_MS),r=XIi(t,i,h); - return s<r.end?r:XIi(t,i,h+1)} - function ski(t,i,s,e=3,n){ - const h=iki(t,i,s,n),r=[h]; - let o=h.w>=0?h.w:Math.floor(s/UIi.EVERY_MS); - for(; - r.length<e; - ){ - const s=XIi(t,i,++o); - s.at>r[r.length-1].at&&r.push(s)} - return r} - function eki(t,i){ - if(i>=t.at&&i<t.end)return{ - state:"live",left:t.end-i} - ; - const s=Math.max(0,t.at-i); - return{ - state:s<=6e4?"soon":"idle",left:s} - } - function nki(t){ - for(let i=0; - i<20; - i++)if(hCi({ - zone:t,point:i} - )>=UIi.MIN_LEVEL)return i+1; - return 1} - Qt(qIi,"bossHpFor"),Qt(XIi,"bossOf"),Qt(JIi,"devBoss"),Qt(QIi,"bossNow"),Qt(ZIi,"bossHere"),Qt(tki,"bossNextHere"),Qt(iki,"bossNext"),Qt(ski,"bossSchedule"),Qt(eki,"monsterState"),Qt(nki,"monsterFirstPoint"); - const hki=Qt(t=>UIi.SLOT_BASE+Math.min(3,Math.floor(t/2)),"harpoonSlots"),rki=Qt(t=>100*UIi.MULT[t],"throwGradePercent"),oki=[{ - xp:0,name:"견습 작살꾼"} - ,{ - xp:100,name:"작살꾼"} - ,{ - xp:400,name:"사냥꾼"} - ,{ - xp:1200,name:"명사수"} - ,{ - xp:3e3,name:"괴물 사냥꾼"} - ,{ - xp:8e3,name:"전설의 헌터"} - ],aki=Qt(t=>{ - var i; - let s=0; - for(; - s+1<oki.length&&t>=oki[s+1].xp; - )s++; - return{ - i:s,name:oki[s].name,next:(null==(i=oki[s+1])?void 0:i.xp)??null} - } - ,"rankOf"); - function cki(t){ - const i=t.hunt; - return{ - stock:{ - wood:UIi.START_WOOD,iron:0,mithril:0,bone:0,thunder:0,...(null==i?void 0:i.stock)??{ - } - } - ,use:(null==i?void 0:i.use)??"wood"} - } - function lki(t,i,s){ - var e; - const n=null==(e=t.hunt)?void 0:e.round; - return!!n&&n.w===i.w&&n.map!==s} - function uki(t,i,s){ - var e; - if(lki(t,i,s))return 0; - const n=(null==(e=t.hunt)?void 0:e.thrown)&&t.hunt.thrown.w===i.w&&t.hunt.thrown.map===s?t.hunt.thrown.n:0; - return Math.max(0,hki(t.gear.boat)-n)} - function dki(t){ - return t.stock[t.use]>0?t.use:FIi.find(i=>t.stock[i]>0)??null} - Qt(cki,"stockOf"),Qt(lki,"roundElsewhere"),Qt(uki,"loadedLeft"),Qt(dki,"pickHarpoon"); - const fki={ - perfect:.07,great:.2,good:.6} - ; - function pki(t=0){ - const i=1+Math.max(0,t)/100; - return{ - perfect:Math.min(.16,fki.perfect*i),great:Math.min(.34,fki.great*i),good:Math.min(.8,fki.good*i)} - } - Qt(pki,"gaugeRangeFor"); - const wki=Qt((t,i=fki)=>{ - const s=Math.abs(t-(i.center??0)); - return s<=i.perfect?"perfect":s<=i.great?"great":s<=i.good?"good":"miss"} - ,"gaugeGrade"),gki={ - AQUARIUM_SLOTS:[10,15,20],AQUARIUM_PRICES:[0,5e3,2e4],KEEP_STAR:4,KEEP_GRADE:2} - ,mki=Qt(t=>`${ - t.id} - :${ - t.grade} - `,"fishKey"),vki=Qt(t=>SCi(t.id,t.grade,t.r),"fishValue"),_ki=Qt(t=>({ - id:t.id,grade:t.grade,at:t.at,kg:t.kg} - ),"fishRef"),Mki=Qt(t=>DTi(t.id).star>=gki.KEEP_STAR||t.grade>=gki.KEEP_GRADE,"keepable"),bki=Qt(t=>gki.AQUARIUM_SLOTS[Math.min(t,gki.AQUARIUM_SLOTS.length-1)],"aquariumCap"),yki={ - on:!1,when:"full",star:2,size:1} - ,Eki=Qt((t,i)=>!Mki(i)&&DTi(i.id).star<=t.star&&i.grade<=t.size,"autoSellRule"); - function Aki(t){ - const i=new Map; - for(const s of t){ - if(s.broken)continue; - const t=mki(s),e=i.get(t)??{ - key:t,id:s.id,grade:s.grade,count:0,value:0,bestKg:0} - ; - e.count++,e.value+=vki(s),e.bestKg=Math.max(e.bestKg,s.kg),i.set(t,e)} - return[...i.values()]} - function Ski(t){ - const i=t.now+t.heartbeatMs; - if(!t.open)return i; - let s=i; - return null!==t.autoAt&&(s=Math.min(s,t.autoAt-t.offset+400)),null!==t.hazardAt&&(s=Math.min(s,t.hazardAt-t.offset+500)),null!==t.repairEndAt&&(s=Math.min(s,t.repairEndAt-t.offset+500)),s} - Qt(Aki,"netGroups"),Qt(Ski,"nextSyncAt"); - const Tki=160,Cki=[["👍","좋아요"],["🤔","글쎄요"],["☝️","하나만 더"],["🙏","부탁해요"],["😅","너무 비싸요"],["⏳","잠깐만요"],["😊","고마워요"],["👋","다음에 해요"]],Oki=Qt((t,i)=>({ - src:i,id:t.id,grade:t.grade,at:t.at,kg:t.kg,r:t.r} - ),"refOf"),Iki=Qt((t,i)=>t.src===i.src&&t.id===i.id&&t.grade===i.grade&&t.at===i.at&&t.kg===i.kg,"sameRef"); - function kki(t,i,s,e,n,h){ - const r=i-t+n.filter(t=>"net"===t.src).length; - let o=e-s+n.filter(t=>"aq"===t.src).length; - const a=o; - let c=0,l=0; - for(const u of h)"aq"===u.src&&Mki(u)&&o>0?(o--,c++):l++; - return{ - ok:l<=r,short:Math.max(0,l-r),toNet:l,toAq:c,netFree:r,aqFree:a} - } - Qt(kki,"roomFit"); - const xki=Qt((t,i)=>Math.max(0,10-((null==t?void 0:t.day)===i?t.n:0)),"tradeLeft"),Rki=Qt(t=>Math.max(0,Math.min(1,t)),"clamp01$7"),Pki=Qt(t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,"ease"),Nki=Qt(t=>1-Math.pow(1-t,3),"easeOut$1"); - function Lki(t){ - return{ - lift:Rki(t/.2)*(1-Rki((t-.9)/.2)),spin:Pki(Rki(t/.4)),cross:Pki(Rki((t-.2)/.7)),pop:t<.9?0:Math.sin(Math.PI*Rki((t-.9)/.2)),dim:Nki(Rki((t-1.1)/.3)),result:Nki(Rki((t-1.1)/.5))} - } - Qt(Lki,"tradeSwapPose"); - const Dki=[{ - key:"contest",goal:1} - ,{ - key:"catch",goal:30} - ,{ - key:"hunt",goal:1} - ,{ - key:"sell",goal:5e3} - ],Gki={ - contest:"오늘 대회 참가하기",visit:"손님 부탁 들어주기",catch:"직접 낚기",hunt:"몬스터에게 작살 던지기",sell:"물고기 팔기"} - ,Bki=Qt(()=>({ - contest:0,visit:0,catch:0,hunt:0,sell:0} - ),"zero"),Uki=Qt(t=>Dki.every(i=>t.n[i.key]>=i.goal),"dailyDone"),Fki=Qt((t,i)=>t&&t.day===i?t:{ - day:i,n:Bki(),claimed:!1} - ,"dailyToday"); - function $ki(t,i){ - const s=Dki.find(i=>i.key===t).goal,e=Math.min(Math.floor(i),s); - return"sell"===t?`${ - Gki[t]} - ${ - e.toLocaleString()} - /${ - s.toLocaleString()} - 골드`:`${ - Gki[t]} - ${ - e} - /${ - s} - `} - Qt($ki,"dailyLine"); - const Hki={ - contest:"contest",visit:"visit",catch:"fish",hunt:"hunt",sell:"net"} - ; - function Wki(t){ - if(t.boatBroken)return{ - kind:"repair",title:"배가 고장 났어요",sub:"눌러서 고치기",go:"repair"} - ; - if(t.netFull)return{ - kind:"net",title:"어망이 가득 찼어요",sub:"어망을 비워야 더 잡혀요",go:"net"} - ; - if(t.contestReady)return{ - kind:"contest",title:"대회 결과가 나왔어요",sub:"눌러서 받기",go:"contest"} - ; - const i=t.daily??{ - n:Bki(),claimed:!1} - ; - if(!t.dailyOff&&Uki(i)&&!i.claimed)return{ - kind:"claim",title:"오늘 할 일 끝! 상자 받기",sub:"진주 200",go:"claim"} - ; - if(t.journeyReady)return{ - kind:"journeyReady",title:"여정 · 다 했어요",sub:`${ - t.journeyReady.npc} - 에게 돌아가기`,go:"journey"} - ; - if(t.goalsReady>0)return{ - kind:"goal",title:`업적 ${ - t.goalsReady} - 개 받기`,sub:"진주가 기다려요",go:"goal"} - ; - if(t.areaReady)return{ - kind:"area",title:"수역 클리어! 진주 받기",sub:`${ - t.areaReady.name} - · 진주 ${ - t.areaReady.pearl} - `,go:"area"} - ; - if(t.monster&&t.monster.inMs<=3e5)return t.monster.inMs<=0?{ - kind:"hunt",title:`${ - t.monster.name} - 지나가는 중!`,sub:"작살을 던져요",go:"hunt"} - :{ - kind:"hunt",title:`${ - t.monster.name} - 곧 와요`,sub:`${ - Math.ceil(t.monster.inMs/6e4)} - 분 뒤`,go:"hunt"} - ; - if(t.journeyHere&&t.journeyNext)return{ - kind:"journey",title:t.journeyNext.title,sub:t.journeyNext.line,go:"journey"} - ; - const s=t.dailyOff?void 0:Dki.find(t=>i.n[t.key]<t.goal); - if(s){ - const t=Dki.filter(t=>i.n[t.key]>=t.goal).length; - return{ - kind:"daily",title:`오늘 할 일 ${ - t} - /${ - Dki.length} - `,sub:$ki(s.key,i.n[s.key]),go:Hki[s.key]} - } - return t.journeyNext?{ - kind:"journey",title:t.journeyNext.title,sub:t.journeyNext.line,go:"journey"} - :t.areaNext?{ - kind:"areaNext",title:`수역 도감 ${ - t.areaNext.have} - /${ - t.areaNext.need} - `,sub:`${ - t.areaNext.name} - 물고기 채우기`,go:"area"} - :t.dailyOff?{ - kind:"done",title:"수역 도감 채우기",sub:"다른 지역 물고기도 모아 보세요",go:"area"} - :{ - kind:"done",title:"오늘 할 일을 다 했어요",sub:"대물을 노려 보세요",go:"today"} - } - function Vki(t){ - const i={ - today:t.dailyClaimable,contest:t.contestReady,visit:t.visitDeliverable,goal:t.goalsReady>0,area:!!t.areaReady} - ; - return{ - tank:t.netFull&&!t.onTank,quest:i.today||i.contest||i.visit||i.goal||i.area,seg:i} - } - function jki(t,i,s,e){ - return Array.from({ - length:9} - ,(n,h)=>{ - const r=$Ci(t,i,h),o=r.filter(t=>!s[t.id]),a=FCi(t,i,h),c=e.includes(a); - return{ - race:t,zone:i,point:h,idx:a,name:GTi(t,i,h),level:hCi({ - zone:i,point:h} - ),pearl:HCi(i,h),species:r,have:r.length-o.length,need:r.length,missing:o,claimed:c,ready:!c&&0===o.length} - } - )} - function Kki(t,i,s,e){ - const n=[[t,i],...fTi.flatMap(t=>pTi.map(i=>[t,i])).filter(([s,e])=>s!==t||e!==i)]; - for(const[h,r]of n){ - const t=jki(h,r,s,e).find(t=>t.ready); - if(t)return t} - return null} - function zki(t,i,s,e){ - const n=jki(t,i,s,e).filter(t=>!t.claimed&&t.missing.length>0); - return n.sort((t,i)=>t.missing.length-i.missing.length||t.point-i.point),n[0]??null} - Qt(Wki,"nextTask"),Qt(Vki,"fishingDots"),Qt(jki,"areaRows"),Qt(Kki,"areaReady"),Qt(zki,"areaNext"); - const Yki=["dex","icebox","aquarium","lost","cups","history","quests","contest"],qki=Qt(()=>`ef2_fishing_pending_hooks_v1:${ - TG.userId||"guest"} - `,"pendingKey"); - function Xki(){ - try{ - const t=JSON.parse(localStorage.getItem(qki())??"null"); - return t&&Number.isFinite(t.c)&&Array.isArray(t.ks)?t:null} - catch{ - return null} - } - function Jki(t){ - try{ - t?localStorage.setItem(qki(),JSON.stringify(t)):localStorage.removeItem(qki())} - catch{ - } - } - Qt(Xki,"loadPending"),Qt(Jki,"savePending"); - const Qki=Qt(t=>t.sold??0,"soldOf"),Zki=Qt((t,i)=>`어망이 가득 차서 ${ - t} - 마리를 자동으로 팔았어요 · ${ - i.toLocaleString()} - G`,"autoSoldText"),txi=class t{ - constructor(){ - Zt(this,"state"),Zt(this,"ready",!1),Zt(this,"season",null),Zt(this,"social",null),Zt(this,"socialRefreshing",!1),Zt(this,"socialRefreshAt",0),Zt(this,"shop",[]),Zt(this,"life",null),Zt(this,"newSeason",null),Zt(this,"seasonListeners",new Set),Zt(this,"feed",[]),Zt(this,"active",!1),Zt(this,"open",!1),Zt(this,"api",Object.assign(new zOi,{ - have:Qt(()=>this.haveRev(),"have"),hooks:Qt(()=>this.pending,"hooks"),beforeSend:Qt(()=>this.flushHooks(),"beforeSend")} - )),Zt(this,"pending",null),Zt(this,"ticket",null),Zt(this,"ticketCast",-1),Zt(this,"serverHeavy",{ - } - ),Zt(this,"flushing",null),Zt(this,"onHidden","undefined"!=typeof document?document.addEventListener("visibilitychange",()=>{ - "hidden"===document.visibilityState&&this.flushHooks()} - ):void 0),Zt(this,"others",[]),Zt(this,"othersAt",0),Zt(this,"crowd",null),Zt(this,"posProvider",null),Zt(this,"offset",0),Zt(this,"syncing",!1),Zt(this,"nextSyncAt",0),Zt(this,"hooked",{ - castAt:-1,k:-1} - ),Zt(this,"listeners",new Set),Zt(this,"catchListeners",new Set),Zt(this,"noticeListeners",new Set),Zt(this,"boatListeners",new Set),Zt(this,"boatSeenAt",-1),Zt(this,"trade",null),Zt(this,"tradePreview",!1),Zt(this,"tradeListeners",new Set),Zt(this,"pollAt",0),Zt(this,"polling",!1),Zt(this,"tradeClosed",new Set),Zt(this,"onBigMove",null),Zt(this,"trackedId",(()=>{ - try{ - return localStorage.getItem("fishing.trackedQuest")} - catch{ - return null} - } - )()),Zt(this,"seenTips",new Set),Zt(this,"eventDays",10),Zt(this,"boatRule",DSi),Zt(this,"mats",{ - bone:0,thunder:0} - ),Zt(this,"ringsShown",new Set)} - static getInstance(){ - return this.instance??(this.instance=new t)} - onSeasonChange(t){ - return this.seasonListeners.add(t),()=>this.seasonListeners.delete(t)} - phase(){ - var t; - return(null==(t=this.season)?void 0:t.phase)??"open"} - async flushHooks(){ - var t,i,s; - for(let e=0; - e<3; - e++){ - if(!this.ready||!(null==(t=this.pending)?void 0:t.ks.length))return; - const e=new Set(this.pending.ks); - if(await(this.flushing??(this.flushing=this.call(this.api.sync(null==(i=this.posProvider)?void 0:i.call(this),this.active)).then(()=>{ - } - ,()=>{ - } - ).finally(()=>{ - this.flushing=null} - ))),!(null==(s=this.pending)?void 0:s.ks.some(t=>!e.has(t))))return} - } - hookedKs(t=this.state){ - var i; - const s=null==t?void 0:t.seq; - return s?[...s.hooks??[],...(null==(i=this.pending)?void 0:i.c)===s.castAt?this.pending.ks:[]]:[]} - ticketFish(t){ - var i; - const s=this.ticket,e=null==(i=this.state)?void 0:i.seq; - if(!s||!e||this.ticketCast!==e.castAt)return null; - const n=t-s.k0; - return n>=0&&n<s.fish.length?s.fish[n]:null} - localCatch(t,i,s=!1){ - t.icebox===this.serverHeavy.icebox&&(t.icebox=t.icebox.slice()),t.dex===this.serverHeavy.dex&&(t.dex=Object.fromEntries(Object.entries(t.dex).map(([t,i])=>[t,{ - ...i} - ]))),t.lost===this.serverHeavy.lost&&(t.lost={ - ...t.lost} - ); - const e=Math.floor((i.at-t.startAt)/864e5)+1,n=WOi(t,i,e,GTi(i.race,i.zone,i.point)),h=t.daily&&Fki(t.daily,t.dailyUtc?zCi(i.at-t.devOffset):e); - return!i.broken&&h&&t.daily&&h===t.daily&&(t.daily={ - ...t.daily,n:{ - ...t.daily.n,catch:t.daily.n.catch+1} - } - ),this.localAutoSell(t,i,s),n} - autoSellable(t,i){ - var s,e; - const n=t.autoSell; - return!!(null==n?void 0:n.on)&&!i.broken&&!(null==(s=t.plunder)?void 0:s.raidBy)&&Eki(n,i)&&((null==(e=t.dex[i.id])?void 0:e.count)??0)>1&&!this.isQuestFish(i)} - localAutoSell(t,i,s){ - const e=t.autoSell; - if(!(null==e?void 0:e.on)||i.broken)return; - let n=[]; - if("catch"===e.when&&this.autoSellable(t,i)?(n=[i],i.sold=TSi(vki(i),t)):t.icebox.length>=sCi(t.gear,ASi(t).icebox)&&(n=t.icebox.filter(i=>this.autoSellable(t,i))),!n.length)return; - const h=new Set(n),r=TSi(n.reduce((t,i)=>t+vki(i),0),t); - t.icebox=t.icebox.filter(t=>!h.has(t)),t.gold+=r,t.sales+=r,t.autoSell={ - ...e,n:e.n+n.length,g:e.g+r} - ,"full"!==e.when||s||this.notice(Zki(n.length,r))} - get autoSell(){ - var t; - return(null==(t=this.state)?void 0:t.autoSell)??null} - async setAutoSell(t){ - return(await this.call(this.api.autoSell(t))).message} - haveRev(){ - const t=this.state,i=null==t?void 0:t.rev; - if(!t||!i)return; - const s={ - } - ; - for(const e of Yki)e in t&&"number"==typeof i[e]&&(s[e]=i[e]); - return s} - onChange(t){ - return this.listeners.add(t),()=>this.listeners.delete(t)} - onCatch(t){ - return this.catchListeners.add(t),()=>this.catchListeners.delete(t)} - onNotice(t){ - return this.noticeListeners.add(t),()=>this.noticeListeners.delete(t)} - notice(t){ - for(const i of this.noticeListeners)i(t)} - onBoatLog(t){ - return this.boatListeners.add(t),()=>this.boatListeners.delete(t)} - touch(){ - for(const t of this.listeners)t()} - apply(t){ - var i,s,e,n,h,r,o,a; - if(!(null==t?void 0:t.success))return{ - message:(null==(s=null==(i=null==t?void 0:t.header)?void 0:i.errorInfo)?void 0:s.additional)??(null==(n=null==(e=null==t?void 0:t.header)?void 0:e.errorInfo)?void 0:n.message)??"연결이 원활하지 않아요"} - ; - const c=t.body,l=null==(h=this.season)?void 0:h.id,u=null==(r=c.season)?void 0:r.id,d=null!=l&&null!=u&&u<l,f=l===u&&(null==(o=c.state)?void 0:o.social)&&(null==(a=this.state)?void 0:a.social)&&(c.state.social.revision??0)<(this.state.social.revision??0); - if(d||f)return{ - message:c.message??null,result:c.result} - ; - if(c.season){ - const t=this.season; - if(this.season=c.season,t&&(t.phase!==c.season.phase||t.id!==c.season.id))for(const i of this.seasonListeners)i(c.season)} - if(c.social&&(!this.social||c.social.now>=this.social.now)&&(this.social=c.social),c.shop&&(this.shop=c.shop),c.newSeason&&(this.newSeason=c.newSeason),!c.state)return this.touch(),{ - message:c.message??null,result:c.result} - ; - this.offset=c.now-Date.now(); - const p=this.state,w=c.state; - for(const M of Yki)M in w&&(this.serverHeavy[M]=w[M]); - if(p)for(const M of Yki)M in w||(w[M]=this.serverHeavy[M]??p[M]); - const g=w.tk; - this.ticket=g?hOi(g,w.seq.castAt):null,this.ticketCast=this.ticket?w.seq.castAt:-1; - const m=$Oi(this.pending,w.seq,(c.hooked??[]).map(t=>t.k)); - if(m.length&&this.notice(`연결이 늦어 물고기 ${ - m.length} - 마리를 놓쳤어요`),this.pending=VOi(this.pending,w.seq),Jki(this.pending),this.pending)for(const M of this.pending.ks){ - const t=this.ticketFish0(M,w); - t&&this.localCatch(w,HOi(t,FOi(w.seq,M,w.gear.reel,w.devSpeed,this.hookedKs(w).filter(t=>t<M)),w.spot,!Object.keys(w.dex).length),!0)} - tOi.setRun(w.startAt); - const v=null==p?void 0:p.autoSell,_=w.autoSell; - v&&(null==_?void 0:_.on)&&"full"===_.when&&_.n>v.n&&(null==p?void 0:p.startAt)===w.startAt&&this.notice(Zki(_.n-v.n,_.g-v.g)),this.state=w,this.ready=!0,this.emitBoatLogs(); - for(const M of c.caught??[])this.addCatch(M,M.isNew); - return c.others&&(this.others=c.others,this.othersAt=Date.now()),c.crowd&&(this.crowd=c.crowd),this.planSync(),this.touch(),{ - message:c.message??null,result:c.result} - } - addCatch(t,i){ - this.feed.unshift(t),this.feed.length=Math.min(this.feed.length,8); - for(const s of this.catchListeners)s(t,i)} - async call(t){ - return this.apply(await t)} - async load(){ - var t; - this.pending??(this.pending=Xki()); - const i=await this.call(this.api.sync(null==(t=this.posProvider)?void 0:t.call(this))); - return this.ready?i.message:i.message??"낚시왕 정보를 받지 못했어요"} - tick(){ - var t; - this.tradeTick(),this.ready&&this.open&&!this.syncing&&(Date.now()<this.nextSyncAt||(this.syncing=!0,this.call(this.api.sync(null==(t=this.posProvider)?void 0:t.call(this),this.active)).finally(()=>{ - this.syncing=!1} - )))} - syncSoon(){ - this.nextSyncAt=0,this.tick()} - planSync(){ - var t,i; - const s=null==(t=this.state)?void 0:t.plunder,e=null==(i=this.state)?void 0:i.boat,n="open"===this.phase(),h=n&&e&&!e.repairAt?qSi(this.state.spot.race,this.state.spot.zone,this.now()):null; - this.nextSyncAt=Ski({ - now:Date.now(),open:n,offset:this.offset,heartbeatMs:(null==s?void 0:s.raid)||(null==s?void 0:s.raidBy)?5e3:6e4,autoAt:n?this.predictAutoAt():null,hazardAt:h?h.at:null,repairEndAt:n&&(null==e?void 0:e.repairAt)?lTi(this.state,e):null} - ); - const r=this.currentBite(),o=this.ticket,a=!!o&&!!r&&this.ticketCast===this.state.seq.castAt&&o.k0+o.fish.length-r.k<4; - (this.pending&&this.pending.ks.length>=5||a)&&(this.nextSyncAt=Math.min(this.nextSyncAt,Date.now()+1e3))} - predictAutoAt(){ - var t; - const i=null==(t=this.state)?void 0:t.seq; - if(!i)return null; - let s=i.prog,e=i.k,n=i.nextAt; - const h=this.hookedKs(),r=Math.max(-1,...h); - r>=i.k&&(s=0,n=FOi(i,r+1,this.state.gear.reel,this.state.devSpeed,h),e=r+1); - for(let o=0; - o<20; - o++){ - if(s+=1,s>=i.need-1e-9)return n+DAi+2500; - e++,n+=UAi(i.seed,e,this.state.gear.reel,this.state.devSpeed)} - return null} - onTrade(t){ - return this.tradeListeners.add(t),()=>this.tradeListeners.delete(t)} - setTrade(i){ - const s=this.trade,e=t.phaseRank; - if(!(i&&s&&i.id===s.id&&(e[i.phase]<e[s.phase]||i.phase===s.phase&&i.ver<s.ver))){ - i&&("done"===i.phase||"gone"===i.phase)&&this.tradeClosed.has(i.id)&&(i=null),"done"!==(null==i?void 0:i.phase)||"done"===(null==s?void 0:s.phase)||this.tradePreview||this.syncSoon(),this.trade=i; - for(const t of this.tradeListeners)t(i)} - } - tradeDismiss(){ - this.trade&&this.tradeClosed.add(this.trade.id),this.setTrade(null)} - get tradeLive(){ - return!!this.trade&&("ask"===this.trade.phase||"open"===this.trade.phase)} - tradeLeft(){ - return this.state?xki(this.state.trade,this.state.dailyUtc?zCi(this.realNow()):this.eventDay()):0} - tradeFish(){ - var t,i,s,e; - const n=this.serverHeavy.icebox??(null==(t=this.state)?void 0:t.icebox)??[],h=(null==(i=this.serverHeavy.aquarium)?void 0:i.fish)??(null==(e=null==(s=this.state)?void 0:s.aquarium)?void 0:e.fish)??[]; - return{ - net:n.filter(t=>!t.broken),aq:h} - } - applyTrade(t){ - var i,s,e,n; - if(!(null==t?void 0:t.success))return(null==(s=null==(i=null==t?void 0:t.header)?void 0:i.errorInfo)?void 0:s.additional)??(null==(n=null==(e=null==t?void 0:t.header)?void 0:e.errorInfo)?void 0:n.message)??"연결이 원활하지 않아요"; - const h=t.body??{ - } - ,r=h.state?this.apply(t).message:h.message??null; - return"trade"in h&&this.setTrade(h.trade??null),r} - tradeTick(){ - if(this.tradePreview||!this.ready||!this.open||!this.active||this.polling||"open"!==this.phase())return; - const t=this.tradeLive?1e3:this.others.some(t=>!t.a&&!t.id.startsWith("bot:"))?3e3:0; - !t||Date.now()<this.pollAt||(this.pollAt=Date.now()+t,this.polling=!0,this.api.tradePoll().then(t=>{ - this.applyTrade(t)} - ).catch(()=>{ - } - ).finally(()=>{ - this.polling=!1} - ))} - async tradeCall(t){ - return this.pollAt=Date.now()+1e3,this.applyTrade(await t)} - tradeRequest(t){ - var i; - return this.tradeCall(this.api.tradeRequest(t,null==(i=this.posProvider)?void 0:i.call(this)))} - tradeAnswer(t){ - var i; - return this.trade?this.tradeCall(this.api.tradeAnswer(this.trade.id,t,null==(i=this.posProvider)?void 0:i.call(this))):Promise.resolve("거래가 끝났어요")} - tradeOffer(t){ - return this.trade?this.tradeCall(this.api.tradeOffer(this.trade.id,t)):Promise.resolve("거래가 끝났어요")} - tradeReady(t){ - var i; - return this.trade?this.tradeCall(this.api.tradeReady(this.trade.id,t,this.trade.ver,null==(i=this.posProvider)?void 0:i.call(this))):Promise.resolve("거래가 끝났어요")} - tradeCancel(){ - return this.trade?this.tradeCall(this.api.tradeCancel(this.trade.id)):Promise.resolve(null)} - tradeEmote(t){ - return this.trade?this.tradeCall(this.api.tradeEmote(this.trade.id,t)):Promise.resolve(null)} - now(){ - return Date.now()+this.offset} - realNow(){ - var t; - return this.now()-((null==(t=this.state)?void 0:t.devOffset)??0)} - eventDay(){ - return Math.floor((this.now()-this.state.startAt)/864e5)+1} - currentBite(){ - var t; - const i=null==(t=this.state)?void 0:t.seq; - return i?iOi(i,this.state.gear.reel,this.state.devSpeed,this.now(),this.hookedKs()):null} - biteOpen(){ - if(this.netFull()||this.boatProblem())return null; - const t=this.currentBite(); - if(!t||t.k===this.hooked.k&&this.state.seq.castAt===this.hooked.castAt)return null; - const i=this.now(); - return i>=t.at&&i<t.at+DAi?{ - k:t.k,left:t.at+DAi-i} - :null} - biteIn(){ - const t=this.currentBite(); - return t?t.at-this.now():1/0} - idleLeft(){ - const t=this.state.seq; - return Math.max(1,Math.ceil(t.need-t.prog))} - async cast(){ - var t; - return(await this.call(this.api.cast(null==(t=this.posProvider)?void 0:t.call(this)))).message} - hookable(){ - if(this.netFull())return null; - const t=this.currentBite(); - if(!t)return null; - const i=this.state.seq; - return sOi(t,i.k,this.now(),i.castAt===this.hooked.castAt?this.hooked.k:null)} - ticketFish0(t,i){ - const s=this.ticket; - if(!s||this.ticketCast!==i.seq.castAt)return null; - const e=t-s.k0; - return e>=0&&e<s.fish.length?s.fish[e]:null} - async hook(){ - var t,i,s,e,n; - const h=this.hookable(); - if(!h)return{ - message:null} - ; - const r=this.state.seq; - this.hooked={ - castAt:r.castAt,k:h.k} - ; - let o=this.ticketFish(h.k); - if(!o&&this.ticket&&h.k>=this.ticket.k0+this.ticket.fish.length&&(await this.flushHooks(),this.state.seq.castAt===r.castAt&&(o=this.ticketFish(h.k))),o){ - const i=HOi(o,FOi(r,h.k,this.state.gear.reel,this.state.devSpeed,this.hookedKs().filter(t=>t<h.k)),this.state.spot,!Object.keys(this.state.dex).length),s=this.localCatch(this.state,i); - return this.pending={ - c:r.castAt,ks:[...(null==(t=this.pending)?void 0:t.c)===r.castAt?this.pending.ks:[],h.k]} - ,Jki(this.pending),this.addCatch(i,s),this.planSync(),this.touch(),{ - message:null,caught:i,isNew:s} - } - const a=await this.call(this.api.hook(h.k,null==(i=this.posProvider)?void 0:i.call(this))); - return(null==(s=a.result)?void 0:s.sold)&&(a.result.catch.sold=a.result.sold),a.result&&this.addCatch(a.result.catch,a.result.isNew),{ - message:a.message,caught:null==(e=a.result)?void 0:e.catch,isNew:null==(n=a.result)?void 0:n.isNew} - } - get netCap(){ - return sCi(this.state.gear,ASi(this.state).icebox)} - netCount(){ - return this.state.icebox.length} - netFull(){ - return!!this.state&&this.netCount()>=this.netCap} - gearStats(){ - return ASi(this.state)} - netGroups(){ - return Aki(this.state.icebox).sort((t,i)=>DTi(i.id).star-DTi(t.id).star||i.grade-t.grade||i.value/i.count-t.value/t.count)} - netSellable(){ - let t=0,i=0; - for(const s of this.netGroups())this.isQuestFish(s)||(t+=s.count,i+=s.value); - return{ - count:t,gold:i} - } - aquarium(){ - const t=this.state.aquarium??{ - lv:0,fish:[]} - ,i=t.lv+1<gki.AQUARIUM_SLOTS.length?gki.AQUARIUM_PRICES[t.lv+1]:null; - return{ - lv:t.lv,cap:bki(t.lv),fish:t.fish,nextPrice:i} - } - isQuestFish(t){ - const i=this.quests(); - return i.reqs.some(s=>!i.done.includes(s.key)&&s.speciesId===t.id&&(t.grade??0)>=(s.minGrade??0))} - dexCount(){ - return Object.keys(this.state.dex).length} - records(){ - let t=0,i=0,s=0,e=null; - for(const[n,h]of Object.entries(this.state.dex))t+=h.count,i=Math.max(i,DTi(Number(n)).star),3===vCi(h.bestR)&&s++,(!e||h.bestKg>e.kg)&&(e={ - id:Number(n),kg:h.bestKg} - ); - return{ - total:t,heaviest:e,topStar:i,kinds:this.dexCount(),sCount:s} - } - baitLeftMs(){ - const t=this.state.bait; - return t?Math.max(0,t.until-this.now()):0} - todayContest(){ - var t; - const i=null==(t=this.social)?void 0:t.board,s=this.state.contest; - return i?RCi(i.day,i.contestId):s&&!s.claimed?RCi(s.day,s.contestId):RCi(1,"weight")} - contestStanding(){ - const t=this.state.contest; - if(!t)return null; - const i=RCi(t.day,t.contestId),s=this.now(),e=Math.min(1,(s-t.startAt)/(t.endAt-t.startAt)),n=s>=t.endAt,h=t.bots.map(t=>({ - name:t.name,score:n?t.final:DCi(i,t.final,t.pace,e),me:!1} - )); - return h.push({ - name:"나",score:t.my,me:!0} - ),h.sort((t,i)=>i.score-t.score||(t.me?1:i.me?-1:0)),{ - rows:h,myRank:h.findIndex(t=>t.me)+1,progress:e,ended:n} - } - quests(){ - const t=UCi(this.now()),i=this.state.quests; - return this.visitorsOpen()?{ - ...i&&i.window===t?i:{ - window:t,reqs:BCi(t,this.state.gear,new Set(Object.keys(this.state.dex).map(Number))),done:[]} - ,nextAt:6*(t+1)*36e5} - :{ - window:t,reqs:[],done:[],nextAt:6*(t+1)*36e5} - } - questHave(t){ - return this.state.icebox.filter(i=>!i.broken&&i.id===t.speciesId&&i.grade>=(t.minGrade??0)).length} - milestoneRows(){ - const t=this.state,i=this.dexCount(); - return[...WCi.map((s,e)=>({ - kind:"dex",idx:e,label:`도감 ${ - s.need} - 종`,progress:i,need:s.need,pearl:s.pearl,claimed:t.milestones.dex.includes(e)} - )),...VCi.map((i,s)=>({ - kind:"sales",idx:s,label:`누적 판매 ${ - i.need.toLocaleString()} - G`,progress:t.sales,need:i.need,pearl:i.pearl,claimed:t.milestones.sales.includes(s)} - )),...jCi.map((i,s)=>{ - var e,n; - return{ - kind:"help",idx:s,label:`배 수리 도움 ${ - i.need} - 번`,progress:(null==(e=t.boat)?void 0:e.helped)??0,need:i.need,pearl:i.pearl,claimed:!!(null==(n=t.milestones.help)?void 0:n.includes(s))} - } - )]} - async awayReport(){ - return this.state.away||this.state.migratedSold?(await this.call(this.api.awayReport())).result??null:null} - async moveTo(t,i,s,e=this.state.spot.depth){ - var n; - this.feed=[]; - const h={ - ...this.state.spot} - ,r=this.call(this.api.move(t,i,s,e)).then(t=>t.message); - return h.race===t&&h.zone===i||null==(n=this.onBigMove)||n.call(this,h,{ - race:t,zone:i,point:s,depth:e} - ,r),r} - async setDepth(t){ - const i=this.state.spot; - return(await this.call(this.api.move(i.race,i.zone,i.point,t))).message} - async goTo(t){ - const i=this.state.spot,s=i.race===t.race&&i.zone===t.zone?i.point:-1,e=tOi.pointKnown(`${ - t.race} - |${ - t.zone} - `,t.point,s)?t.point:0; - return this.moveTo(t.race,t.zone,e,t.depth)} - async sell(t){ - const i=await this.call(this.api.sell(t.key)); - return{ - message:i.message,gold:i.result??0} - } - async sellAll(){ - const t=await this.call(this.api.sellAll()); - return{ - message:t.message,...t.result??{ - count:0,gold:0} - } - } - netFish(){ - return this.state.icebox.filter(t=>!t.broken).sort((t,i)=>DTi(i.id).star-DTi(t.id).star||i.grade-t.grade||i.kg-t.kg)} - async sellFish(t){ - const i=await this.call(this.api.sellFish(t.map(_ki))); - return{ - message:i.message,...i.result??{ - count:0,gold:0} - } - } - async aquariumPutFish(t){ - return(await this.call(this.api.aquariumPutFish(_ki(t)))).message} - async sellKeys(t){ - const i=await this.call(this.api.sellKeys(t)); - return{ - message:i.message,...i.result??{ - count:0,gold:0} - } - } - async aquariumPut(t){ - return(await this.call(this.api.aquariumPut(t.key))).message} - async aquariumTake(t){ - return(await this.call(this.api.aquariumTake(t))).message} - async aquariumExpand(){ - return(await this.call(this.api.aquariumExpand())).message} - async upgrade(t){ - return(await this.call(this.api.upgrade(t))).message} - async buy(t){ - return(await this.call(this.api.buy(t.id))).message} - async exchange(t,i){ - var s; - const e=null==(s=this.season)?void 0:s.id; - return null==e?"지금은 바꿀 수 없어요":(await this.call(this.api.exchange(e,this.state.exchangeRev??0,t.kindNum,i))).message} - exchangeMax(t){ - var i; - const s=(null==(i=this.state.exchange)?void 0:i[String(t.kindNum)])??0,e=null===t.limit?1/0:t.limit-s; - return Math.max(0,Math.min(Math.floor(this.state.pearl/t.pearl),e,1e3))} - async loadLife(){ - try{ - const t=await this.api.life(); - (null==t?void 0:t.success)&&(this.life=t.body.life)} - catch{ - } - } - daily(){ - return Fki(this.state.daily,this.state.dailyUtc?zCi(this.realNow()):this.eventDay())} - dailyClaimable(){ - const t=this.daily(); - return Uki(t)&&!t.claimed} - async claimDaily(){ - return(await this.call(this.api.dailyClaim(this.daily().day))).message} - contestReady(){ - if(this.socialRewardsReady())return!0; - const t=this.contestStanding(); - return!!(null==t?void 0:t.ended)&&!!this.state.contest&&!this.state.contest.claimed} - goalsReady(){ - return this.milestoneRows().filter(t=>!t.claimed&&t.progress>=t.need).length} - visitDeliverable(){ - const t=this.quests(); - return t.reqs.some(i=>!t.done.includes(i.key)&&this.questHave(i)>=i.count)} - dotsInput(t){ - return{ - netFull:this.netFull(),onTank:t,dailyClaimable:!1,contestReady:this.contestReady(),visitDeliverable:this.visitDeliverable(),goalsReady:this.goalsReady(),areaReady:!!this.areaReady()} - } - qlog(){ - var t; - return(t=this.state).qlog??(t.qlog=AOi())} - questHoldMax(){ - return cOi(this.qlog())} - questCtx(){ - var t; - const i=this.now(),s=this.state; - return{ - gear:s.gear,areaClaimed:this.areaClaimed(),contestToday:!!s.contest&&i<s.contest.endAt||Object.values((null==(t=s.social)?void 0:t.scores)??{ - } - ).some(t=>i<t.endAt)} - } - questOffers(t,i){ - return NOi(this.qlog(),t,i,this.startRace())} - questHeld(){ - const t=this.qlog(),i=this.questCtx(); - return t.held.map(t=>TOi(t.id)).filter(t=>!!t).map(s=>({ - def:s,got:xOi(t,s,i),need:IOi(s),ready:ROi(t,s,i)} - ))} - questTurnIn(t){ - return OOi(t,this.startRace())} - tracked(){ - return DOi(this.qlog(),this.trackedId)} - track(t){ - this.trackedId=t; - try{ - t?localStorage.setItem("fishing.trackedQuest",t):localStorage.removeItem("fishing.trackedQuest")} - catch{ - } - } - async questAccept(t,i,s){ - const e=(await this.call(this.api.questAccept(t,i,s))).message; - return e||this.track(t),e} - async questAbandon(t){ - return(await this.call(this.api.questAbandon(t))).message} - async questComplete(t){ - var i,s; - const e=await this.call(this.api.questComplete(t)); - return{ - message:e.message,gold:(null==(i=e.result)?void 0:i.gold)??0,pearl:(null==(s=e.result)?void 0:s.pearl)??0} - } - areaClaimed(){ - return this.state.milestones.area??[]} - areaRows(t,i){ - return jki(t,i,this.state.dex,this.areaClaimed())} - areaReady(){ - const t=this.state.spot; - return Kki(t.race,t.zone,this.state.dex,this.areaClaimed())} - areaNext(){ - const t=this.state.spot; - return zki(t.race,t.zone,this.state.dex,this.areaClaimed())} - async claimArea(t,i,s){ - var e,n; - const h=await this.call(this.api.areaClaim(t,i,s)); - return{ - message:h.message,pearl:(null==(e=h.result)?void 0:e.pearl)??0,bonus:(null==(n=h.result)?void 0:n.bonus)??0} - } - seasonDays(){ - const t=this.season; - return null!=(null==t?void 0:t.startAt)&&null!=t.endAt?Math.ceil((t.endAt-t.startAt)/864e5):null} - isLastDay(){ - var t; - const i=null==(t=this.season)?void 0:t.endAt; - return null!=i&&"open"===this.phase()&&i-this.realNow()<864e5} - socialRewardsReady(){ - return this.claimableSocialIds().length>0} - claimableSocialIds(){ - var t; - return((null==(t=this.social)?void 0:t.rewards)??[]).filter(t=>{ - var i; - return null===t.claimedAt&&t.seasonId===(null==(i=this.season)?void 0:i.id)} - ).map(t=>t.id)} - async refreshSocial(t=!1){ - var i; - if(!(!(null==(i=this.social)?void 0:i.enabled)||this.socialRefreshing||!t&&Date.now()<this.socialRefreshAt)){ - this.socialRefreshing=!0,this.socialRefreshAt=Date.now()+1e4; - try{ - const i=await this.call(this.api.socialStatus()); - i.message&&t&&this.notice(i.message)} - catch{ - t&&this.notice("순위와 보상을 불러오지 못했어요. 잠시 후 다시 눌러 주세요")} - finally{ - this.socialRefreshing=!1} - } - } - async joinSocial(t){ - return(await this.call(this.api.socialJoin(t))).message} - async claimSocial(t){ - return(await this.call(this.api.socialClaim(t))).message} - async prepareHuntAim(){ - const t=await this.call(this.api.huntPing()); - if(t.message||!t.result)return{ - message:t.message??"연결을 확인하지 못했어요"} - ; - const i=performance.now(),s=await this.api.huntAim(t.result.id),e=performance.now(),n=this.apply(s); - if(n.message||!n.result)return{ - message:n.message??"조준을 준비하지 못했어요"} - ; - const h=s.body.clock,r=h?(h.receivedAt+h.sentAt)/2:s.body.now; - return{ - message:null,aim:n.result,startPerf:(i+e)/2+n.result.startAt-r} - } - async huntShot(t){ - var i,s; - let e; - try{ - e=await this.api.huntShot(t,null==(i=this.posProvider)?void 0:i.call(this))} - catch{ - e=await this.api.huntShot(t,null==(s=this.posProvider)?void 0:s.call(this))} - return this.apply(e)} - async joinContest(t){ - return(await this.call(this.api.joinContest(t))).message} - async claimContest(){ - return(await this.call(this.api.claimContest())).result??null} - async deliver(t){ - return(await this.call(this.api.deliver(t.key))).message} - visitorsOpen(){ - return rOi} - startRace(){ - const t=this.state.startRace; - return t&&fTi.includes(t)?t:"인간"} - async claimAllMilestones(){ - return(await this.call(this.api.claimAllMilestones())).message} - async claimMilestone(t,i){ - return(await this.call(this.api.claimMilestone(t,i))).message} - tipSeen(t){ - var i,s,e; - return!!(null==(i=this.state)?void 0:i.guideSeen)||!!(null==(e=null==(s=this.state)?void 0:s.tips)?void 0:e.includes(t))||this.seenTips.has(t)} - async markTip(t){ - var i; - if(!this.tipSeen(t)){ - for(const i of"tut"===t?["tut",...qOi]:[t])this.seenTips.add(i); - ((i=this.state).tips??(i.tips=[])).push(t),await this.call(this.api.guideSeen(t))} - } - get look(){ - var t; - return OIi((null==(t=this.state)?void 0:t.look)??null)} - get plunder(){ - var t; - return(null==(t=this.state)?void 0:t.plunder)??null} - tickets(){ - return PIi(this.plunder,this.realNow())} - async plunderPeek(t){ - var i; - return this.call(this.api.plunderPeek(t,null==(i=this.posProvider)?void 0:i.call(this)))} - async plunderStart(t){ - var i; - return(await this.call(this.api.plunderStart(t,null==(i=this.posProvider)?void 0:i.call(this)))).message} - async plunderStop(){ - var t; - return this.call(this.api.plunderStop(null==(t=this.posProvider)?void 0:t.call(this)))} - async plunderCut(){ - return(await this.call(this.api.plunderCut())).message} - async saveLook(t){ - return(await this.call(this.api.look(t))).message} - emitBoatLogs(){ - var t,i; - const s=(null==(t=this.state.boat)?void 0:t.log)??[]; - if(this.boatSeenAt<0)return void(this.boatSeenAt=(null==(i=s[0])?void 0:i.at)??0); - const e=s.filter(t=>t.at>this.boatSeenAt).reverse(); - if(e.length){ - this.boatSeenAt=e[e.length-1].at; - for(const t of this.boatListeners)t(e)} - } - boatHp(){ - const t=this.state,i=null==t?void 0:t.boat,s=t?sTi(t):JSi(0); - return i?{ - hp:cTi(t,i,this.now()),max:s,fixing:!!i.repairAt,broken:i.broken,endAt:lTi(t,i)} - :{ - hp:s,max:s,fixing:!1,broken:!1,endAt:0} - } - boatProblem(){ - var t; - const i=null==(t=this.state)?void 0:t.boat; - return(null==i?void 0:i.repairAt)?i.broken?"배가 고장 나서 고치는 중이에요":"배를 고치는 중이에요":null} - helpPts(){ - return uTi(this.state,this.now())} - async boatRepair(t){ - var i; - return(await this.call(this.api.boatRepair(t,null==(i=this.posProvider)?void 0:i.call(this)))).message} - async boatHelp(t){ - var i; - return this.call(this.api.boatHelp(t,null==(i=this.posProvider)?void 0:i.call(this)))} - harpoons(){ - return cki(this.state)} - get huntMatHave(){ - return this.mats} - keepMats(t){ - var i; - const s=null==(i=null==t?void 0:t.body)?void 0:i.mats; - s&&(this.mats={ - bone:s.bone??0,thunder:s.thunder??0} - )} - async refreshHuntMats(){ - const t=await this.api.huntMats().catch(()=>null); - (null==t?void 0:t.success)&&this.keepMats(t)} - async huntCraft(t,i){ - const s=await this.api.huntCraft(t,i); - return this.keepMats(s),this.apply(s)} - async huntMakeMat(t,i){ - const s=await this.api.huntMakeMat(t,i); - return this.keepMats(s),this.apply(s)} - async huntUse(t){ - return(await this.call(this.api.huntUse(t))).message} - async huntThrow(t){ - var i; - return this.call(this.api.huntThrow(t,null==(i=this.posProvider)?void 0:i.call(this)))} - async wsTicket(){ - var t; - const i=await this.api.wsTicket().catch(()=>null); - return(null==i?void 0:i.success)?(null==(t=i.body)?void 0:t.ticket)??null:null} - markRingShown(t){ - this.ringsShown.add(t),this.ringsShown.size>60&&this.ringsShown.delete(this.ringsShown.values().next().value)} - async huntStatus(){ - var t; - const i=this.state,s=null==(t=this.posProvider)?void 0:t.call(this),e=i?{ - race:i.spot.race,zone:i.spot.zone,point:i.spot.point,...i.social?{ - server:i.social.serverId} - :{ - } - ,...s?{ - x:Math.round(s.x),y:Math.round(s.y)} - :{ - } - } - :void 0,n=!!(null==i?void 0:i.huntDevAt)&&this.realNow()>=i.huntDevAt&&this.realNow()<i.huntDevAt+UIi.DUR_MS,h=await this.api.huntStatus(n?void 0:e); - return(null==h?void 0:h.success)?h.body:null} - async gearPull(t){ - return this.call(this.api.gearPull(t))} - async gearMerge(t,i){ - return this.call(this.api.gearMerge(t,i))} - async gearMergeAll(){ - return this.call(this.api.gearMerge(null,null,!0))} - async gearMergeGroups(t){ - return this.call(this.api.gearMergeGroups(t))} - async gearKeep(t,i){ - return(await this.call(this.api.gearKeep(t,i))).message} - async gearEquip(t){ - return(await this.call(this.api.gearEquip(t))).message} - async gearUnequip(t){ - return(await this.call(this.api.gearEquip(null,t))).message} - async gearEquipBest(){ - const t=await this.call(this.api.gearEquipBest()); - return{ - message:t.message,n:t.result??0} - } - async devGear(){ - return t.devProblem((await this.call(this.api.dev("gearFill"))).message)} - async devNetFill(){ - return t.devProblem((await this.call(this.api.dev("netFill"))).message)} - async devHunt(i){ - const s=await this.call(this.api.dev(i)); - return t.devProblem(s.message)} - async devBoatTest(i,s=[]){ - var e; - const n=await this.call(this.api.dev(i,{ - spots:s} - )); - return await this.call(this.api.sync(null==(e=this.posProvider)?void 0:e.call(this))),t.devProblem(n.message)} - async devSpeed(){ - await this.call(this.api.dev("speed"))} - async devSkipDay(){ - await this.call(this.api.dev("day")),await this.call(this.api.sync())} - async devQuest(){ - return t.devProblem((await this.call(this.api.dev("quest"))).message)} - async devArea(){ - return t.devProblem((await this.call(this.api.dev("area"))).message)} - async devBoat(){ - return t.devProblem((await this.call(this.api.dev("boat"))).message)} - async devSkipTide(){ - const i=t.devProblem((await this.call(this.api.dev("tide"))).message); - return i||await this.call(this.api.sync()),i} - static devProblem(t){ - return t?t.includes("없는 개발 도구")?"서버가 예전 빌드예요 · ef2_server 를 다시 빌드·재시작해 주세요":t:null} - async devAddGold(){ - await this.call(this.api.dev("gold"))} - async devEndContest(){ - await this.call(this.api.dev("endContest"))} - async devContestDay(i){ - return t.devProblem((await this.call(this.api.dev("contestDay",{ - day:i} - ))).message)} - async devBots(t){ - var i; - const s=await this.call(this.api.dev("bots",{ - spots:t} - )); - return await this.call(this.api.sync(null==(i=this.posProvider)?void 0:i.call(this))),s.result??0} - async devReset(){ - this.pending=null,Jki(null); - const i=t.devProblem((await this.call(this.api.dev("reset"))).message); - if(i)return i; - try{ - for(const t of jOi(Object.keys(localStorage),TG.userId))localStorage.removeItem(t)} - catch{ - } - try{ - sessionStorage.setItem("ef2_fishing_reopen","1")} - catch{ - } - return window.location.reload(),null} - async devPlunder(i,s=[]){ - var e; - const n=await this.call(this.api.dev(i,{ - spots:s} - )); - return await this.call(this.api.sync(null==(e=this.posProvider)?void 0:e.call(this))),t.devProblem(n.message)} - } - ; - Qt(txi,"FishingDataManager"),Zt(txi,"instance"),Zt(txi,"phaseRank",{ - ask:0,open:1,done:2,gone:2} - ); - let ixi=txi; - const sxi={ - luck:'<path d="M12 12c-2.5-4.5-6.5-3-5.5 0 .8 2.4 5.5 0 5.5 0zm0 0c4.5-2.5 3-6.5 0-5.5-2.4.8 0 5.5 0 5.5zm0 0c2.5 4.5 6.5 3 5.5 0-.8-2.4-5.5 0-5.5 0zm0 0c-4.5 2.5-3 6.5 0 5.5 2.4-.8 0-5.5 0-5.5z"/><path d="M13 14l4 6"/>',hp:'<path d="M12 20s-7-4.4-7-9.5A4 4 0 0 1 12 8a4 4 0 0 1 7 2.5C19 15.6 12 20 12 20z"/>',armor:'<path d="M12 3l7 3v6c0 4.5-3 7.5-7 9-4-1.5-7-4.5-7-9V6z"/>',repair:'<path d="M14.5 6.5a4 4 0 0 0-5.3 5.3L4 17l3 3 5.2-5.2a4 4 0 0 0 5.3-5.3l-2.6 2.6-2.4-.6-.6-2.4z"/>',speed:'<path d="M3 8h11a3 3 0 1 0-3-3M3 12h15a3 3 0 1 1-3 3M3 16h7"/>',aim:'<circle cx="12" cy="12" r="7"/><circle cx="12" cy="12" r="2.5"/><path d="M12 2v3M12 19v3M2 12h3M19 12h3"/>',power:'<path d="M4 20L18 6M18 6l-1-3 4 1-1 3zM8 14l-3-1M10 16l1 3"/>',steal:'<path d="M7 11V6a1.5 1.5 0 0 1 3 0v4M10 10V4.5a1.5 1.5 0 0 1 3 0V10M13 10V5.5a1.5 1.5 0 0 1 3 0V12M16 9a1.5 1.5 0 0 1 3 0v5a6 6 0 0 1-6 6h-1a6 6 0 0 1-5-2.7L4 13.5a1.5 1.5 0 0 1 2.6-1.5L7 13"/>',icebox:'<path d="M4 6h16l-2 13H6zM4 6l4 13M20 6l-4 13M12 6v13M5 10.5h14M5.6 15h12.8"/>',big:'<path d="M3 12c3-5 9-6 13-2l5-3-1 5 1 5-5-3c-4 4-10 3-13-2z"/><circle cx="8" cy="11" r="1"/>',star:'<path d="M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1-4.4-4.3 6.1-.9z"/>',protect:'<rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V8a4 4 0 0 1 8 0v3"/>',sell:'<circle cx="10" cy="14" r="6"/><path d="M10 11v6M8.2 12.6c.4-.8 3.2-1 3.4.3.2 1.4-3.5 1-3.4 2.6.1 1.2 3 1.2 3.6.2"/><path d="M18 3v8M15 6l3-3 3 3"/>',lock:'<rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V8a4 4 0 0 1 8 0v3"/>',map:'<path d="M9 4L3 6v14l6-2 6 2 6-2V4l-6 2z"/><path d="M9 4v14M15 6v14"/>',line:'<path d="M6 4h12M6 20h12M8 4v16M16 4v16M8 9h8M8 14h8"/>',clock:'<circle cx="12" cy="12" r="8"/><path d="M12 7v5l3 2"/>',moon:'<path d="M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5z"/>',weight:'<path d="M8.5 9a3.5 3.5 0 1 1 7 0"/><path d="M6 9.5h12l2 10H4z"/>',ruler:'<rect x="3" y="8" width="18" height="8" rx="1.5"/><path d="M7 8v3M10.5 8v4.5M14 8v3M17.5 8v4.5"/>',pin:'<path d="M12 21s-6-6-6-10.5a6 6 0 0 1 12 0C18 15 12 21 12 21z"/><circle cx="12" cy="10.5" r="2"/>',shield:'<path d="M12 3l7 3v6c0 4.5-3 7.5-7 9-4-1.5-7-4.5-7-9V6z"/><path d="M9 12l2.2 2.2L15 10"/>',trophy:'<path d="M8 4h8v5a4 4 0 0 1-8 0zM8 6H5c0 2.5 1.3 3.8 3 4M16 6h3c0 2.5-1.3 3.8-3 4M12 13v4M9 20h6"/>',depth:'<path d="M3 6.5c1.5-1.2 3-1.2 4.5 0s3 1.2 4.5 0 3-1.2 4.5 0 3 1.2 4.5 0"/><path d="M12 10v10M8.5 16.5L12 20l3.5-3.5"/>'} - ,exi=Qt(t=>`#${ - t.toString(16).padStart(6,"0")} - `,"hex"); - function nxi(t,i,s,e=2.2){ - const n=(new ep).svg(`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g fill="none" stroke="${ - exi(s)} - " stroke-width="${ - e} - " stroke-linecap="round" stroke-linejoin="round">${ - sxi[t]} - </g></svg>`); - return n.scale.set(i/24),n.eventMode="none",n} - Qt(nxi,"lineIcon"); - const hxi=[3032396,10135467,6142819,4886754,10513640,16734815,16757806,4184298,15967960,7044351],rxi=Qt(t=>t>=9?9414911:8===t?16762088:7===t?4184298:null,"gradeGlow"),oxi=Qt(t=>Math.max(1,Math.min(9,Math.round(t))),"clampGrade"); - function axi(t){ - const i=oxi(t); - if(i<=4)return Array.from({ - length:i} - ,()=>"s"); - const s=i-5,e=Math.floor(s/2),n=s-e; - return[...Array(e).fill("s"),9===i?"kr":"k",...Array(n).fill("s")]} - function cxi(t){ - const i=oxi(t); - return 7===i?[{ - corner:"tl",kind:"cyan"} - ]:8===i?[{ - corner:"tl",kind:"pink"} - ,{ - corner:"br",kind:"pink"} - ]:9===i?["tl","tr","bl","br"].map(t=>({ - corner:t,kind:"rainbow"} - )):[]} - Qt(axi,"starLayout"),Qt(cxi,"pearls"); - const lxi=Qt(t=>oxi(t)>=9,"hasCrown"),uxi=Qt(t=>oxi(t)>=8,"isCoated"),dxi=4.6,fxi=[0,3.8,2],pxi=Qt(t=>oxi(t)>=9?3:8===oxi(t)?2:0,"glintCount"); - function wxi(t){ - const i=(t%dxi+dxi)%dxi,s=Qt(t=>{ - const s=(i-t)/.7; - return s>0&&s<1?Math.pow(Math.sin(Math.PI*s),1.5):0} - ,"pop"); - return{ - ho:.5-.5*Math.cos(2*Math.PI*i/dxi),glints:[s(fxi[0]),s(fxi[1]),s(fxi[2])]} - } - Qt(wxi,"coat"); - const gxi=Qt(t=>Math.max(0,Math.min(23,Math.round(23*t))),"holoFrame"),mxi=Qt(t=>({ - scale:.35+.75*t,rot:20*t*Math.PI/180,alpha:t} - ),"glintPose"); - function vxi(t){ - let i=0|t; - return()=>{ - i=i+1831565813|0; - let t=Math.imul(i^i>>>15,1|i); - return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296} - } - Qt(vxi,"rng"); - const _xi=Qt(t=>vxi(31*t)()*dxi,"cardPhase"); - function Mxi(t,i,s){ - const e=vxi(7919*t+104729*i+13),n=[]; - let h=0; - for(; - n.length<s&&h++<200; - ){ - const t=[.16+.68*e(),.12+.5*e()]; - (n.every(i=>Math.hypot(i[0]-t[0],i[1]-t[1])>.32)||h>150)&&n.push(t)} - return n} - Qt(Mxi,"glintSpots"); - const bxi=Qt(t=>IS.getAssetPath(`fishing/topdown/grade_card/${ - t} - ?v=${ - CS.appVersion} - &art=20261011-grade-card-v1`),"path"),yxi=class{ - static load(){ - if(this.loading)return this.loading; - const t={ - autoGenerateMipmaps:!0,mipmapFilter:"nearest"} - ,i=Qt(i=>wd.load({ - src:bxi(`${ - i} - .webp`),parser:"loadTextures",data:t} - ),"get"); - return this.loading=(async()=>{ - try{ - const[t,s,e,n,h]=await Promise.all([Promise.all(Array.from({ - length:9} - ,(t,s)=>i(`card_${ - s+1} - `))),i("parts"),i("gloss"),i("holo_8"),i("holo_9")]); - this.cards=t,this.parts=Array.from({ - length:8} - ,(t,i)=>new ls({ - source:s.source,frame:new $i(i%4*64,64*Math.floor(i/4),64,64)} - )),this.glossTex=e; - const r=Qt(t=>Array.from({ - length:24} - ,(i,s)=>new ls({ - source:t.source,frame:new $i(s%6*96,96*Math.floor(s/6),96,96)} - )),"cut"); - return this.holo={ - 8:r(n),9:r(h)} - ,Txi.redrawAll(),!0} - catch(frt){ - return!1} - } - )(),this.loading} - static get ready(){ - return 9===this.cards.length} - static card(t){ - return this.cards[oxi(t)-1]} - static part(t){ - return this.parts[t]} - static gloss(){ - return this.glossTex} - static holoFrames(t){ - return oxi(t)>=9?this.holo[9]:this.holo[8]} - } - ; - Qt(yxi,"GradeCardArt"),Zt(yxi,"cards",[]),Zt(yxi,"parts",[]),Zt(yxi,"glossTex",null),Zt(yxi,"holo",{ - 8:[],9:[]} - ),Zt(yxi,"loading",null); - let Exi=yxi,Axi=0; - const Sxi=class t{ - constructor(i){ - Zt(this,"back",new Ke),Zt(this,"front",new Ke),Zt(this,"glow",new ep),Zt(this,"bg",new Xe),Zt(this,"plain",new ep),Zt(this,"holo",new Xe),Zt(this,"gloss",new Xe),Zt(this,"glints",[]),Zt(this,"deco",new Ke),Zt(this,"stars",new Ke),Zt(this,"star",null),Zt(this,"tlPearl",!0),Zt(this,"seed",++Axi),Zt(this,"phase",_xi(this.seed)),Zt(this,"cycle",-1),this.size=i,this.back.eventMode="none",this.front.eventMode="none",this.back.addChild(this.glow,this.plain,this.bg,this.holo),this.front.addChild(this.gloss,this.deco,this.stars),t.track(this),Exi.load()} - set(t,i=!0){ - this.star=null===t?null:oxi(t),this.tlPearl=i,this.draw()} - get grade(){ - return this.star} - showStars(t){ - this.stars.visible=t} - draw(){ - const i=this.size,s=this.star,e=Exi.ready; - if(this.glow.clear(),this.plain.clear(),this.deco.removeChildren().forEach(t=>t.destroy()),this.stars.removeChildren().forEach(t=>t.destroy()),this.glints.forEach(t=>t.destroy()),this.glints=[],this.bg.visible=this.holo.visible=this.gloss.visible=!1,null===s)return this.plain.roundRect(0,0,i,i,.2*i).fill(2765112).roundRect(.05*i,.05*i,.9*i,.9*i,.144*i).fill(1054234),void t.live.delete(this); - const n=rxi(s); - if(null!==n&&this.glow.roundRect(-5,-5,i+10,i+10,.2*i+5).fill({ - color:n,alpha:.16} - ).roundRect(-3,-3,i+6,i+6,.2*i+3).fill({ - color:n,alpha:.35} - ),e){ - this.bg.texture=Exi.card(s),this.bg.width=this.bg.height=i,this.bg.visible=!0; - const e=.15*i,n=-.008*i,h={ - tl:[n,n],tr:[i-e-n,n],bl:[n,i-e-n],br:[i-e-n,i-e-n]} - ; - for(const t of cxi(s)){ - if("tl"===t.corner&&!this.tlPearl)continue; - const i=new Xe(Exi.part("cyan"===t.kind?2:"pink"===t.kind?3:4)); - i.width=i.height=e,i.position.set(...h[t.corner]),this.deco.addChild(i)} - if(lxi(s)){ - const t=new Xe(Exi.part(5)),s=.28*i; - t.width=t.height=s,t.position.set(.36*i,.2*-i),this.deco.addChild(t)} - if(uxi(s)){ - this.holo.visible=!0,this.holo.width=this.holo.height=i,this.holo.alpha=s>=9?.5:.36; - const e=Exi.gloss(); - e&&(this.gloss.texture=e,this.gloss.width=this.gloss.height=i,this.gloss.visible=!0); - for(let t=0; - t<pxi(s); - t++){ - const t=new Xe(Exi.part(6)); - t.anchor.set(.5),t.alpha=0,this.glints.push(t),this.deco.addChild(t)} - this.cycle=-1,t.live.add(this),t.startTicker(),this.tick(t.clock)} - else t.live.delete(this)} - else this.plain.roundRect(0,0,i,i,.2*i).fill(hxi[s]).roundRect(.05*i,.05*i,.9*i,.9*i,.144*i).fill(1447964); - this.drawStars(s,e)} - drawStars(t,i){ - const s=this.size,e=axi(t),n=.165*s,h=.27*s,r=-.022*s,o=e.map(t=>"s"===t?n:h),a=Math.max(...o),c=s+.42*a,l=o.reduce((t,i)=>t+i,0)+2*r*(e.length-1); - let u=(s-l)/2; - e.forEach((t,e)=>{ - const h=o[e],l="s"===t&&a>n?.02*s:0; - if(i){ - const i=new Xe(Exi.part("kr"===t?1:0)); - i.width=i.height=h,i.position.set(u,c-h-l),this.stars.addChild(i)} - else this.stars.addChild((new ep).circle(u+h/2,c-h/2-l,.36*h).fill(16767053).stroke({ - color:5911048,width:Math.max(1,.1*h)} - )); - u+=h+2*r} - )} - tick(t){ - const i=this.star; - if(null===i||!uxi(i))return; - const s=t+this.phase,e=wxi(s),n=Exi.holoFrames(i); - n.length&&(this.holo.texture=n[gxi(e.ho)]); - const h=Math.floor(s/dxi),r=this.size; - h!==this.cycle&&(this.cycle=h,Mxi(this.seed,h,this.glints.length).forEach(([t,i],s)=>this.glints[s].position.set(t*r,i*r))),this.glints.forEach((t,i)=>{ - const s=mxi(e.glints[i]),n=.29*r; - t.width=t.height=n*s.scale,t.rotation=s.rot,t.alpha=s.alpha,t.visible=s.alpha>.01} - )} - onStage(){ - var t; - let i=this.front; - for(; - i; - ){ - if(!i.visible||i.alpha<=0||i.destroyed)return!1; - if(!i.parent)return i===(null==(t=SS.app)?void 0:t.stage)||i.isRenderGroup; - i=i.parent} - return!1} - static startTicker(){ - this.ticking||(this.ticking=!0,Mn.shared.add(this.step,this))} - static step(t){ - if(this.paused||(this.clock+=t.deltaMS/1e3*this.speed),this.acc+=t.deltaMS,!(this.acc<1e3/30)){ - this.acc%=1e3/30; - for(const t of this.live)t.front.destroyed||t.back.destroyed?this.live.delete(t):t.onStage()&&t.tick(this.clock); - this.live.size||(Mn.shared.remove(this.step,this),this.ticking=!1)} - } - static track(t){ - Exi.ready||this.waiting.add(t)} - static redrawAll(){ - for(const t of this.waiting)t.front.destroyed||null===t.star||t.draw(); - this.waiting.clear()} - static setClock(t){ - this.clock=t; - for(const i of this.live)i.tick(t)} - static get now(){ - return this.clock} - } - ; - Qt(Sxi,"GradeFrame"),Zt(Sxi,"live",new Set),Zt(Sxi,"ticking",!1),Zt(Sxi,"acc",0),Zt(Sxi,"clock",0),Zt(Sxi,"speed",1),Zt(Sxi,"paused",!1),Zt(Sxi,"waiting",new Set); - let Txi=Sxi; - const Cxi=723725,Oxi=1644829,Ixi=2368554,kxi=3158071,xxi=4013379,Rxi=3158071,Pxi=3881795,Nxi=.62,Lxi=3815998,Dxi=16106577,Gxi=2825477,Bxi=15921908,Uxi=10592678,Fxi=7237235,$xi=8378016,Hxi=16751752,Wxi=15262964,Vxi=921104,jxi=3813926,Kxi=8158338,zxi=[3815998,10135467,6142819,4886754,10513640,16734815,16757806,4184298,15967960,7044351],Yxi=[0,7315384,15247664,16732013],qxi={ - corner:"right"} - ,Xxi={ - "인간":12862767,"엘프":4165445,"언데드":8082856,"오크":3108787} - ; - function Jxi(t,i=Bxi,s=16,e=!0){ - const n=new iG(t,i,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:s,lineHeight:Math.round(1.3*s),fontWeight:e?"bolder":"normal"} - ); - return n.eventMode="none",n} - Qt(Jxi,"label"); - const Qxi=16,Zxi=14,tRi=class extends Ke{ - constructor(t){ - super(),Zt(this,"titleL",Jxi("",Bxi,24)),Zt(this,"arrow",Jxi("▾",Uxi,Qxi)),Zt(this,"capL",Jxi("",Uxi,Zxi,!1)),Zt(this,"accentL",Jxi("",Dxi,Zxi)),Zt(this,"rightL",Jxi("",Uxi,15)),Zt(this,"hit",new Ke),Zt(this,"onTitle",null),this.w=t,this.titleL.position.set(2,0),this.capL.position.set(2,34),this.arrow.visible=!1,this.hit.eventMode="static",this.hit.cursor="pointer",this.hit.visible=!1,this.hit.on("pointertap",t=>{ - var i; - t.stopPropagation(),null==(i=this.onTitle)||i.call(this)} - ),this.addChild(this.titleL,this.arrow,this.capL,this.accentL,this.rightL,this.hit)} - set(t,i,s={ - } - ){ - const e=this.w,n=s.rightW??0,h=!!this.onTitle; - this.titleL.text=t,this.rightL.text=s.right??"",this.rightL.position.set(e-2-this.rightL.width,7),sRi(this.titleL,e-4-(h?24:0)-Math.max(n,s.right?this.rightL.width+16:0)),this.arrow.visible=h,this.arrow.position.set(this.titleL.x+this.titleL.width+6,(31-this.arrow.height)/2+2),this.hit.visible=h,this.hit.hitArea=new $i(-6,-6,this.titleL.width+40,44),this.capL.text=i,this.accentL.text=s.accent??"",this.accentL.textColor=s.accentColor??Dxi,sRi(this.capL,e-4-this.accentL.width-n),this.accentL.position.set(this.capL.x+this.capL.width+(i&&s.accent?4:0),34)} - } - ; - Qt(tRi,"PageHeader"); - let iRi=tRi; - function sRi(t,i){ - t.scale.set(1),t.scale.set(Math.min(1,i/Math.max(1,t.width)))} - function eRi(t,i,s=2368554,e=3815998,n=12){ - const h=new ep; - return null===e?h.roundRect(0,0,t,i,n).fill(s):h.roundRect(.5,.5,t-1,i-1,n).fill(s).stroke({ - color:e,width:1} - ),h.eventMode="none",h} - Qt(sRi,"fitLabel"),Qt(eRi,"panel"); - const nRi=class extends Ke{ - constructor(t,i=!1,s=!1){ - super(),Zt(this,"bg",new ep),Zt(this,"icon",new Xe),Zt(this,"band",new ep),Zt(this,"stars",Jxi("",Dxi,11)),Zt(this,"marks",new Ke),Zt(this,"fade",1),Zt(this,"unknown",!1),Zt(this,"badge",new Ke),Zt(this,"badgeBg",new ep),Zt(this,"badgeText",Jxi("",16777215,12)),Zt(this,"starsAlways",!1),Zt(this,"mystery",Jxi("?",Uxi,16)),Zt(this,"frame"),this.size=t,this.minimal=i,this.banded=s,this.eventMode="none",this.icon.anchor.set(.5),this.mystery.visible=!1,this.band.eventMode="none",this.marks.eventMode="none",this.badge.addChild(this.badgeBg,this.badgeText),this.frame=i?null:new Txi(t),this.frame?this.addChild(this.bg,this.frame.back,this.icon,this.mystery,this.frame.front,this.band,this.stars,this.badge,this.marks):this.addChild(this.bg,this.icon,this.mystery,this.band,this.stars,this.badge,this.marks)} - set(t,i,s=0,e=!1){ - null!==t&&i>0&&(i=NTi(t)); - const n=this.size,h=e?zxi[0]:zxi[Math.max(1,Math.min(9,i))],r=Math.max(2,.05*n),o=n*(this.minimal?.12:.2),a=!!this.frame&&null!==t&&!e&&i>0; - this.bg.clear(),this.frame&&(this.frame.back.visible=this.frame.front.visible=a,a&&(this.frame.set(i),this.frame.showStars(n>=40||this.starsAlways))); - const c=e&&null!==t?xxi:Vxi; - if(this.minimal?this.bg.roundRect(0,0,n,n,o).fill(c):a||this.bg.roundRect(0,0,n,n,o).fill(h).roundRect(r,r,n-2*r,n-2*r,Math.max(1,o-r)).fill(c),this.icon.visible=null!==t,this.mystery.visible=null===t&&i>0,this.mystery.visible&&(this.mystery.textSize=Math.round(.42*n),this.mystery.position.set((n-this.mystery.width)/2,.43*n-this.mystery.height/2)),this.unknown=e,null!==t){ - this.icon.texture=NAi.fish(t); - const i=n*(a?.86:this.banded?.7:.8)/100; - this.icon.scale.set(i),this.icon.position.set(n/2,n*(a?.46:this.banded?.41:.46)),this.icon.tint=e?0:16777215} - if(this.stars.visible=!a&&(n>=40||this.starsAlways)&&(e||i>0),this.stars.text=e?"?":CCi(i),this.stars.textColor=e?Fxi:Dxi,this.band.clear(),this.banded&&this.stars.visible&&!a){ - const t=Math.round(.22*n),i=r,s=n-r,e=n-r-t,h=n-r,a=Math.max(1,o-r); - this.band.moveTo(i,e).lineTo(s,e).lineTo(s,h-a).arcTo(s,h,s-a,h,a).lineTo(i+a,h).arcTo(i,h,i,h-a,a).closePath().fill({ - color:0,alpha:.5} - ),this.stars.textSize=Math.max(9,Math.round(.15*n)),sRi(this.stars,n-2*r-4),this.stars.position.set((n-this.stars.width)/2,e+(t-this.stars.height)/2)} - else this.stars.textSize=Math.max(9,Math.round(.16*n)),sRi(this.stars,n-6),this.stars.position.set((n-this.stars.width)/2,n-this.stars.height-1); - const l=e?0:s??0; - if(this.badge.visible=l>=1,l>=1){ - const t=Math.max(13,Math.round(.26*n)),i=Yxi[l],s=2; - this.badgeBg.clear(),3===l&&this.badgeBg.roundRect(-s,-s,t+2*s,t+2*s,.36*t).fill({ - color:i,alpha:.35} - ),this.badgeBg.roundRect(0,0,t,t,.3*t).fill(i),this.badgeText.text=wCi[l],this.badgeText.textSize=Math.round(.66*t),this.badgeText.position.set((t-this.badgeText.width)/2,(t-this.badgeText.height)/2); - const e=Math.ceil(r)+s+1; - this.badge.position.set("left"===qxi.corner?e:n-t-e,e)} - this.applyFade()} - setFade(t){ - this.fade=t,this.applyFade()} - applyFade(){ - for(const t of[this.bg,this.mystery,this.band,this.stars,this.badge])t.alpha=this.fade; - this.frame&&(this.frame.back.alpha=this.frame.front.alpha=this.fade),this.icon.alpha=(this.unknown?.8:1)*this.fade} - setMark(t,i=1644829){ - if(this.marks.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),!t)return; - const s=Math.max(9,Math.round(.15*this.size)),e=s-4,n=(new ep).circle(e,e,s+2).fill(i).circle(e,e,s).fill("on"===t?Dxi:"lock"===t?3816e3:3116890); - if("on"===t&&n.moveTo(e-.45*s,e).lineTo(e-.1*s,e+.35*s).lineTo(e+.5*s,e-.35*s).stroke({ - color:Gxi,width:Math.max(2,.26*s),cap:"round",join:"round"} - ),"quest"===t&&n.roundRect(e-.13*s,e-.58*s,.26*s,.7*s,.13*s).fill(15400945).circle(e,e+.42*s,.15*s).fill(15400945),this.marks.addChild(n),"lock"===t){ - const t=nxi("lock",1.2*s,13092812,2.6); - t.position.set(e-.6*s,e-.62*s),this.marks.addChild(t)} - } - } - ; - Qt(nRi,"FishCard"); - let hRi=nRi; - const rRi=class extends Ke{ - constructor(t,i,s=34,e=14){ - super(),Zt(this,"bg",new ep),Zt(this,"text"),Zt(this,"onTap",null),Zt(this,"w",0),Zt(this,"h",0),Zt(this,"selected",!1),Zt(this,"enabled",!0),Zt(this,"value"),Zt(this,"soft",!1),Zt(this,"dot",null),Zt(this,"dotG",new ep),this.value=t,this.text=Jxi(t,Uxi,e),this.dotG.eventMode="none",this.addChild(this.bg,this.dotG,this.text),this.eventMode="static",this.cursor="pointer",this.on("pointertap",t=>{ - var i; - t.stopPropagation(),this.enabled&&(null==(i=this.onTap)||i.call(this))} - ),this.resize(i,s)} - resize(t,i){ - this.w=t,this.h=i,this.hitArea=new $i(0,0,t,i),this.draw()} - setText(t){ - this.text.text=t,this.draw()} - draw(){ - const{ - w:t,h:i} - =this,s=this.soft?this.selected?jxi:Ixi:this.selected?Dxi:kxi; - this.bg.clear().roundRect(0,0,t,i,Math.min(9,i/2)).fill(s),this.text.textColor=this.soft?this.selected?Dxi:this.enabled?Uxi:Fxi:this.selected?Gxi:this.enabled?Bxi:Fxi; - const e=null!==this.dot?16:0; - sRi(this.text,t-12-e); - const n=(t-this.text.width-e)/2; - this.dotG.clear(),null!==this.dot&&this.dotG.circle(n+4.5,i/2,4.5).fill(this.dot),this.text.position.set(n+e,(i-this.text.height)/2),this.alpha=this.enabled?1:.55} - } - ; - Qt(rRi,"Chip"); - let oRi=rRi; - const aRi=class extends Ke{ - constructor(t,i,s=44,e=15){ - super(),Zt(this,"bg",new ep),Zt(this,"text"),Zt(this,"onTap",null),Zt(this,"w"),Zt(this,"h"),Zt(this,"primary",!0),Zt(this,"_enabled",!0),this.w=i,this.h=s,this.text=Jxi(t,Gxi,e),this.addChild(this.bg,this.text),this.eventMode="static",this.cursor="pointer",this.hitArea=new $i(0,0,i,s),this.on("pointerdown",()=>{ - this._enabled&&this.scale.set(.96)} - ),this.on("pointerup",()=>this.scale.set(1)),this.on("pointerupoutside",()=>this.scale.set(1)),this.on("pointertap",t=>{ - var i; - t.stopPropagation(),this._enabled&&(null==(i=this.onTap)||i.call(this))} - ),this.draw()} - set enabled(t){ - this._enabled=t,this.draw()} - get enabled(){ - return this._enabled} - setText(t){ - this.text.text=t,this.draw()} - draw(){ - const t=this._enabled,i=t?this.primary?Dxi:xxi:2763309; - this.bg.clear().roundRect(0,0,this.w,this.h,9).fill(i),this.text.textColor=t?this.primary?Gxi:Bxi:Kxi,sRi(this.text,this.w-12),this.text.position.set((this.w-this.text.width)/2,(this.h-this.text.height)/2)} - setPrimary(t){ - this.primary=t,this.draw()} - } - ; - Qt(aRi,"FButton"); - let cRi=aRi; - function lRi(t,i,s){ - const e=t.charCodeAt(t.length-1); - return e<44032||e>55203?`${ - t} - ${ - i} - (${ - s} - )`:`${ - t} - ${ - (e-44032)%28?i:s} - `} - function uRi(t,i){ - const s=new Ke,e=i/2,n=Math.max(1.5,.06*i); - s.eventMode="none"; - const h=(new ep).circle(e,e,e).fill(2372155),r=new Xe(t); - r.width=r.height=i-2*n,r.position.set(n,n); - const o=(new ep).circle(e,e,e-n).fill(16777215); - r.mask=o; - const a=(new ep).circle(e,e,e-n/2).stroke({ - color:15984328,width:n} - ); - return s.addChild(h,r,o,a),s} - function dRi(t,i,s,e=11,n=6){ - const h=new Ke,r=Jxi(t,i,e),o=new ep; - return o.roundRect(0,0,r.width+2*n,r.height+2,(r.height+2)/2).fill(s),r.position.set(n,1),h.addChild(o,r),h.eventMode="none",h} - function fRi(t,i,s,e,n,h,r=Dxi,o=3158071){ - t.roundRect(i,s,e,n,n/2).fill(o); - const a=e*Math.max(0,Math.min(1,h)); - return a>.5&&t.roundRect(i,s,Math.max(n,a),n,n/2).fill(r),t} - function pRi(t,i=22){ - const s=new ep; - return"gold"===t?s.circle(i/2,i/2,i/2).fill(14723118).circle(i/2,i/2,.34*i).fill(16106577).circle(.4*i,.38*i,.1*i).fill(16774870):s.circle(i/2,i/2,i/2).fill(12433110).circle(i/2,i/2,.42*i).fill(Wxi).circle(.38*i,.36*i,.12*i).fill(16777215),s.eventMode="none",s} - function wRi(t){ - const i=Math.max(0,Math.floor(t/1e3)),s=Math.floor(i/3600),e=Math.floor(i%3600/60),n=i%60; - return s>0?`${ - s} - :${ - String(e).padStart(2,"0")} - :${ - String(n).padStart(2,"0")} - `:`${ - e} - :${ - String(n).padStart(2,"0")} - `} - Qt(lRi,"josa$1"),Qt(uRi,"faceBadge"),Qt(dRi,"pill"),Qt(fRi,"drawBar"),Qt(pRi,"coinIcon"),Qt(wRi,"formatTime"); - const gRi=Qt(t=>{ - const i=new Date(t-1); - return`${ - i.getMonth()+1} - 월 ${ - i.getDate()} - 일`} - ,"seasonDateText"); - function mRi(t,i,s,e=16106577){ - const n=new ep; - n.eventMode="none"; - const h=i,r=Math.max(1.4,.085*h),o={ - color:s,width:r,cap:"round",join:"round"} - ; - switch(t){ - case"hook":n.circle(.6*h,.14*h,.07*h).stroke(o).moveTo(.6*h,.21*h).lineTo(.6*h,.62*h).arc(.43*h,.62*h,.17*h,0,Math.PI).lineTo(.26*h,.5*h).lineTo(.35*h,.56*h).stroke(o); - break; - case"toolbox":n.roundRect(.12*h,.36*h,.76*h,.46*h,.07*h).stroke(o).moveTo(.36*h,.36*h).lineTo(.36*h,.2*h).lineTo(.64*h,.2*h).lineTo(.64*h,.36*h).stroke(o).moveTo(.12*h,.54*h).lineTo(.88*h,.54*h).stroke(o).roundRect(.44*h,.49*h,.12*h,.1*h,.02*h).fill(s); - break; - case"bowl":n.moveTo(.3*h,.18*h).lineTo(.7*h,.18*h).stroke(o).moveTo(.33*h,.2*h).bezierCurveTo(.02*h,.36*h,.1*h,.86*h,.5*h,.86*h).bezierCurveTo(.9*h,.86*h,.98*h,.36*h,.67*h,.2*h).stroke(o).moveTo(.2*h,.4*h).lineTo(.8*h,.4*h).stroke({ - ...o,width:.6*r,alpha:.6} - ).ellipse(.47*h,.6*h,.13*h,.08*h).fill(s).poly([.58*h,.6*h,.7*h,.52*h,.7*h,.68*h]).fill(s); - break; - case"trophy":n.moveTo(.26*h,.16*h).lineTo(.74*h,.16*h).lineTo(.7*h,.42*h).bezierCurveTo(.66*h,.58*h,.34*h,.58*h,.3*h,.42*h).closePath().stroke(o).moveTo(.26*h,.22*h).bezierCurveTo(.06*h,.22*h,.1*h,.46*h,.3*h,.44*h).stroke(o).moveTo(.74*h,.22*h).bezierCurveTo(.94*h,.22*h,.9*h,.46*h,.7*h,.44*h).stroke(o).moveTo(.5*h,.58*h).lineTo(.5*h,.72*h).stroke(o).roundRect(.3*h,.72*h,.4*h,.12*h,.03*h).stroke(o); - break; - case"stall":n.moveTo(.12*h,.34*h).lineTo(.2*h,.14*h).lineTo(.8*h,.14*h).lineTo(.88*h,.34*h).stroke(o),n.moveTo(.12*h,.34*h); - for(let t=0; - t<4; - t++)n.arc(h*(.215+.19*t),.34*h,.095*h,Math.PI,0,!0); - n.stroke(o).moveTo(.18*h,.44*h).lineTo(.18*h,.84*h).lineTo(.82*h,.84*h).lineTo(.82*h,.44*h).stroke(o).rect(.4*h,.58*h,.2*h,.26*h).stroke(o); - break; - case"boat":n.moveTo(.08*h,.62*h).lineTo(.92*h,.62*h).lineTo(.76*h,.84*h).lineTo(.24*h,.84*h).closePath().fill(s).moveTo(.5*h,.62*h).lineTo(.5*h,.1*h).stroke(o).poly([.55*h,.14*h,.84*h,.52*h,.55*h,.52*h]).fill(e).poly([.45*h,.24*h,.45*h,.52*h,.24*h,.52*h]).fill({ - color:s,alpha:.7} - ); - break; - case"spool":n.roundRect(.18*h,.14*h,.64*h,.1*h,.03*h).fill(s).roundRect(.18*h,.76*h,.64*h,.1*h,.03*h).fill(s).rect(.28*h,.24*h,.44*h,.52*h).fill({ - color:e,alpha:.9} - ); - for(let t=0; - t<5; - t++)n.moveTo(.28*h,h*(.3+.1*t)).lineTo(.72*h,h*(.26+.1*t)); - n.stroke({ - color:0,width:Math.max(1,.03*h),alpha:.25} - ); - break; - case"rod":n.moveTo(.14*h,.88*h).quadraticCurveTo(.5*h,.36*h,.9*h,.1*h).stroke(o).moveTo(.9*h,.1*h).quadraticCurveTo(.98*h,.44*h,.86*h,.62*h).stroke({ - ...o,width:.5*r,alpha:.8} - ).circle(.34*h,.66*h,.1*h).fill(e).moveTo(.14*h,.88*h).lineTo(.26*h,.74*h).stroke({ - ...o,width:1.8*r} - ); - break; - case"autorod":n.moveTo(.2*h,.9*h).lineTo(.34*h,.56*h).lineTo(.48*h,.9*h).stroke(o).moveTo(.3*h,.66*h).quadraticCurveTo(.56*h,.3*h,.9*h,.1*h).stroke(o).circle(.72*h,.7*h,.13*h).fill(e).circle(.72*h,.7*h,.05*h).fill(1184276); - for(let t=0; - t<6; - t++){ - const i=t/6*Math.PI*2; - n.rect(.72*h+Math.cos(i)*h*.15-.03*h,.7*h+Math.sin(i)*h*.15-.03*h,.06*h,.06*h).fill(e)} - break; - case"reel":n.circle(.46*h,.54*h,.3*h).stroke(o).circle(.46*h,.54*h,.12*h).fill(e).moveTo(.46*h,.54*h).lineTo(.8*h,.2*h).stroke(o).circle(.82*h,.18*h,.07*h).fill(s).moveTo(.2*h,.86*h).lineTo(.72*h,.86*h).stroke(o); - break; - case"bobber":n.moveTo(.5*h,.04*h).lineTo(.5*h,.22*h).stroke(o).moveTo(.5*h,.78*h).lineTo(.5*h,.96*h).stroke(o).ellipse(.5*h,.5*h,.2*h,.3*h).fill(15921382).poly(Array.from({ - length:13} - ,(t,i)=>Math.PI+i/12*Math.PI).flatMap(t=>[.5*h+Math.cos(t)*h*.2,.5*h+Math.sin(t)*h*.3])).fill(15226687).ellipse(.5*h,.5*h,.2*h,.3*h).stroke({ - ...o,width:.6*r} - ); - break; - case"keepnet":{ - const t=[[.5,.2,.36,.09],[.5,.5,.3,.08],[.5,.8,.24,.07]]; - for(let i=0; - i<2; - i++){ - const[s,e,r]=t[i],[o,a,c]=t[i+1]; - for(const t of[-1,-.33,.33,1])n.moveTo(h*(s+r*t),h*e).lineTo(h*(o+c*t),h*a)} - n.stroke({ - color:s,width:.5*r,alpha:.75} - ); - for(const[i,s,e,r]of t)n.ellipse(h*i,h*s,h*e,h*r).stroke(o); - n.poly([.62*h,.16*h,.8*h,.02*h,.84*h,.2*h]).fill(e); - break} - case"shrimp":n.moveTo(.78*h,.3*h).bezierCurveTo(.72*h,.9*h,.2*h,.86*h,.22*h,.52*h).stroke({ - ...o,width:.2*h,color:15698538} - ).moveTo(.8*h,.28*h).lineTo(.92*h,.08*h).moveTo(.76*h,.26*h).lineTo(.62*h,.06*h).stroke({ - ...o,width:.5*r,color:15698538} - ).poly([.2*h,.5*h,.06*h,.36*h,.1*h,.6*h]).fill(15698538).circle(.72*h,.34*h,.04*h).fill(1776411); - break; - case"shell":n.moveTo(.5*h,.86*h).lineTo(.1*h,.46*h).arc(.5*h,.46*h,.4*h,Math.PI,0).lineTo(.5*h,.86*h).fill(15849399); - for(let t=0; - t<5; - t++){ - const i=Math.PI+(t+.5)*(Math.PI/5); - n.moveTo(.5*h,.84*h).lineTo(.5*h+Math.cos(i)*h*.36,.46*h+Math.sin(i)*h*.36)} - n.stroke({ - color:11897441,width:.6*r,cap:"round"} - ); - break; - case"lure":n.ellipse(.46*h,.46*h,.3*h,.16*h).fill(10148330).poly([.74*h,.46*h,.92*h,.3*h,.92*h,.62*h]).fill(10148330).ellipse(.4*h,.42*h,.14*h,.05*h).fill({ - color:16777215,alpha:.8} - ).circle(.26*h,.44*h,.035*h).fill(1776411).moveTo(.46*h,.62*h).lineTo(.46*h,.8*h).arc(.38*h,.8*h,.08*h,0,Math.PI).stroke({ - ...o,width:.6*r,color:14212576} - ); - break; - case"bigbait":n.moveTo(.14*h,.7*h).bezierCurveTo(.3*h,.3*h,.5*h,.9*h,.66*h,.5*h).bezierCurveTo(.74*h,.3*h,.84*h,.34*h,.88*h,.44*h).stroke({ - ...o,width:.16*h,color:14256800} - ).star(.74*h,.2*h,5,.14*h,.06*h).fill(e); - break; - case"map":n.poly([.1*h,.22*h,.36*h,.14*h,.64*h,.24*h,.9*h,.16*h,.9*h,.78*h,.64*h,.86*h,.36*h,.76*h,.1*h,.84*h]).fill(15325096).moveTo(.36*h,.14*h).lineTo(.36*h,.76*h).moveTo(.64*h,.24*h).lineTo(.64*h,.86*h).stroke({ - color:11901794,width:.5*r} - ).moveTo(.44*h,.42*h).lineTo(.56*h,.56*h).moveTo(.56*h,.42*h).lineTo(.44*h,.56*h).stroke({ - color:13780270,width:.8*r,cap:"round"} - ); - break; - case"people":n.circle(.36*h,.34*h,.14*h).fill(s).moveTo(.1*h,.86*h).bezierCurveTo(.1*h,.52*h,.62*h,.52*h,.62*h,.86*h).fill(s).circle(.68*h,.3*h,.12*h).fill({ - color:s,alpha:.65} - ).moveTo(.5*h,.56*h).bezierCurveTo(.62*h,.46*h,.92*h,.5*h,.92*h,.82*h).lineTo(.66*h,.82*h).fill({ - color:s,alpha:.65} - ); - break; - case"pin":n.moveTo(.5*h,.92*h).bezierCurveTo(.2*h,.6*h,.16*h,.46*h,.16*h,.38*h).arc(.5*h,.38*h,.34*h,Math.PI,0).bezierCurveTo(.84*h,.46*h,.8*h,.6*h,.5*h,.92*h).fill(s).circle(.5*h,.38*h,.13*h).fill(1184276); - break; - case"clock":n.circle(.5*h,.5*h,.38*h).stroke(o).moveTo(.5*h,.5*h).lineTo(.5*h,.26*h).moveTo(.5*h,.5*h).lineTo(.68*h,.6*h).stroke(o); - break; - case"check":n.moveTo(.18*h,.52*h).lineTo(.42*h,.76*h).lineTo(.84*h,.26*h).stroke({ - ...o,width:1.4*r} - )} - return n} - Qt(mRi,"fishingIcon"); - const vRi=class extends Ke{ - constructor(t,i,s,e=16777215,n=s){ - super(),Zt(this,"art",null),Zt(this,"line"),this.kind=t,this.size=s,this.line=mRi(i,n,e),this.line.position.set((s-n)/2,(s-n)/2),this.addChild(this.line),this.eventMode="none",this.refresh()} - get hasArt(){ - return!!this.art} - refresh(){ - if(this.art)return; - const t=NAi.menuIcon(this.kind); - t&&(this.art=new Xe(t),this.art.width=this.art.height=this.size,this.line.visible=!1,this.addChild(this.art))} - setTone(t,i=16777215){ - this.line.tint=t,this.art&&(this.art.tint=i)} - } - ; - Qt(vRi,"MenuArt"); - let _Ri=vRi; - const MRi=class extends Ke{ - constructor(t,i,s,e){ - super(),Zt(this,"onTap",null),Zt(this,"plate",new ep),Zt(this,"icon"),this.size=s,this.icon=new _Ri(t,i,s,16777215,Math.round(.55*s)),this.plate.roundRect(0,0,s,s,12).fill(e),this.plate.eventMode="none",this.addChild(this.plate,this.icon),this.pivot.set(s/2,s/2),this.eventMode="static",this.cursor="pointer",this.hitArea=new $i(-4,-4,s+8,s+8),this.on("pointerdown",()=>this.scale.set(.92)),this.on("pointerup",()=>this.scale.set(1)),this.on("pointerupoutside",()=>this.scale.set(1)),this.on("pointertap",t=>{ - var i; - t.stopPropagation(),null==(i=this.onTap)||i.call(this)} - ),this.refresh()} - place(t,i){ - this.position.set(t+this.size/2,i+this.size/2)} - refresh(){ - this.icon.refresh(),this.plate.visible=!this.icon.hasArt} - } - ; - Qt(MRi,"MenuArtButton"); - let bRi=MRi; - const yRi=[[255,215,177],[255,220,186],[193,204,214],[85,208,227]],ERi=[255/246,255/249,255/243,255/244],ARi=new Map; - function SRi(t){ - const i=8*t.race+t.skin; - let s=ARi.get(i); - if(s)return s; - const e=yRi[t.race],n=e.reduce((t,i)=>t+i*i,0),h=wIi[t.race][t.skin],r=[h>>16,h>>8&255,255&h]; - s=new Ef({ - resolution:"inherit",antialias:"inherit"} - ); - const[o,a,c]=e.map(i=>i*ERi[t.race]/n),[l,u,d]=r; - return s.matrix=[l*o,l*a,l*c,0,0,u*o,u*a,u*c,0,0,d*o,d*a,d*c,0,0,0,0,0,1,0],ARi.set(i,s),s} - function TRi(t,i){ - const s=new Ke,e=new Xe(t),n=new ep,h=[[346,367,348,354,356,350,366,350,380,350,387,357,390,368],[346,367,348,353,356,349,366,349,381,349,389,356,393,368],[346,367,348,355,356,351,366,351,380,351,388,358,391,368],[346,367,348,353,356,349,366,349,381,349,389,356,393,368]][i.race]; - return n.moveTo(h[0],h[1]).bezierCurveTo(h[2],h[3],h[4],h[5],h[6],h[7]).bezierCurveTo(h[8],h[9],h[10],h[11],h[12],h[13]).lineTo(346,368).closePath().fill(16777215),e.label=`free-hand-skin-${ - i.race} - `,e.filters=[SRi(i)],s.addChild(e,n),e.mask=n,s} - Qt(SRi,"skinFilter"),Qt(TRi,"buildFreeHandSkin"); - const CRi=[[{ - eyes:[[211,200],[271,200]],cheeks:[[205,220],[284,219]],ear:[328,217],hull:[190,178,207,154,277,141,300,181,300,222,278,239,222,240,196,229]} - ,{ - eyes:[[213,199],[277,197]],cheeks:[[211,223],[289,219]],ear:[337,206],hull:[187,180,206,151,263,145,305,180,304,224,277,242,222,242,195,230]} - ],[{ - eyes:[[212,201],[271,200]],cheeks:[[210,223],[285,220]],ear:[329,212],hull:[192,181,207,152,277,140,302,180,302,224,279,240,222,241,196,229]} - ,{ - eyes:[[213,199],[277,197]],cheeks:[[212,223],[289,220]],ear:[337,202],hull:[188,181,206,151,263,145,306,180,305,224,277,243,221,243,195,230]} - ],[{ - eyes:[[212,200],[271,201]],cheeks:[[208,221],[284,220]],ear:[329,216],hull:[190,178,207,154,277,136,301,180,300,223,278,240,221,241,196,230]} - ,{ - eyes:[[213,198],[277,197]],cheeks:[[211,223],[290,220]],ear:[337,206],hull:[188,180,206,151,263,144,306,180,305,225,277,243,221,243,195,230]} - ],[{ - eyes:[[212,200],[271,200]],cheeks:[[204,211],[283,210]],ear:[339,186],hull:[190,178,207,153,277,138,301,178,300,223,278,240,221,241,196,229]} - ,{ - eyes:[[212,197],[277,197]],cheeks:[[206,212],[290,211]],ear:[350,180],hull:[188,180,206,151,263,144,305,180,305,225,277,243,221,243,195,230]} - ]],ORi=Qt((t,i=2497046)=>({ - width:t,color:i,cap:"round",join:"round"} - ),"stroke"); - function IRi(t){ - const i=CRi[t.race][t.sex],s=new ep,e=Qt(i=>t.feats.includes(i),"has"); - if(e(1))for(const[n,h]of i.cheeks){ - s.ellipse(n,h,9,4.5).fill({ - color:15628921,alpha:.55} - ); - for(const t of[-3,1,5])s.moveTo(n+t-1,h-1).lineTo(n+t,h+1.5).stroke(ORi(1.2,13196642))} - if(e(3)){ - const[t,e]=i.cheeks[1]; - s.moveTo(t-3,e-6).lineTo(t+2,e+6).stroke(ORi(2.5,10178641)); - for(const i of[-2,2])s.moveTo(t-4,e+i+1).lineTo(t+3,e+i-2).stroke(ORi(1.6,10968155))} - if(e(5)){ - const[t,e]=i.eyes[0]; - s.moveTo(190,e-10).lineTo(t,e-3).lineTo(300,e-29).stroke(ORi(4,2762022)),s.moveTo(t-12,e-13).quadraticCurveTo(t,e-17,t+13,e-10).lineTo(t+11,e+8).quadraticCurveTo(t,e+20,t-11,e+8).closePath().fill(3156780).stroke(ORi(2.5,1446680)),s.moveTo(t-7,e-8).quadraticCurveTo(t,e-11,t+6,e-7).stroke(ORi(1.7,6050128))} - if(e(4)){ - const[t,e]=i.eyes; - for(const[n,h]of i.eyes)s.ellipse(n,h+1,16,17).stroke(ORi(3.5)); - s.moveTo(t[0]+16,t[1]-1).quadraticCurveTo((t[0]+e[0])/2,t[1]-6,e[0]-16,e[1]-1).stroke(ORi(3)),s.moveTo(t[0]-16,t[1]-4).lineTo(191,t[1]-8).stroke(ORi(3)),s.moveTo(e[0]+16,e[1]-4).lineTo(301,e[1]-9).stroke(ORi(3))} - return s} - function kRi(t){ - const i=new ep; - if(t.feats.includes(6)){ - const[s,e]=CRi[t.race][t.sex].ear; - i.ellipse(s,e+5,4.7,6.5).stroke(ORi(4,3154712)),i.ellipse(s,e+5,4.7,6.5).stroke(ORi(2.3,15317589)),i.circle(s,e-1,2).fill(16770722)} - return i} - Qt(IRi,"buildFaceDetails"),Qt(kRi,"buildEarring"); - const xRi=[[[210,128,224,111,290,111,306,140,300,181,293,183,276,156,231,203,219,189,214,171,204,186,200,188],[210,128,224,111,290,111,306,140,307,174,298,174,265,142,259,190,233,187,216,178,205,157,200,178,200,182]],[[210,128,224,111,290,111,306,140,300,182,291,183,271,154,247,209,224,199,215,173,206,186,200,190],[210,128,224,111,290,111,306,140,307,174,298,173,264,144,257,200,234,190,216,181,206,156,200,178,200,182]],[[210,128,224,111,290,111,306,140,300,180,292,182,276,141,248,138,223,185,214,179,207,167,200,186,200,190],[210,128,224,111,290,111,306,140,307,173,300,173,258,123,250,155,244,191,224,188,208,173,202,159,200,177,200,181]],[[210,128,224,111,290,111,306,140,307,177,299,178,279,143,239,202,223,191,217,172,206,188,200,192],[210,128,224,111,290,111,306,140,307,174,299,175,265,140,258,200,234,191,217,181,208,162,200,180,200,184]]],RRi=new _f({ - strength:1.3,quality:3} - ); - function PRi(t){ - const i=(new ep).poly([...xRi[t.race][t.sex]]).fill(16119285).stroke({ - width:5,color:16119285,join:"round"} - ); - return i.tint=wIi[t.race][t.skin],i.filters=[RRi],i.label="native-forehead",i} - Qt(PRi,"buildNativeForehead"); - const NRi=1971215,LRi=15721679,DRi=7029798,GRi={ - autoGenerateMipmaps:!0,magFilter:"linear",minFilter:"linear",mipmapFilter:"nearest"} - ; - function BRi(t,i){ - const s=Qt(t=>Math.max(0,Math.min(255,Math.round(t*i))),"f"); - return s(t>>16)<<16|s(t>>8&255)<<8|s(255&t)} - function URi(t,i,s,e,n=0,h=0,r=2*Math.PI,o=28){ - const a=[],c=Math.cos(n),l=Math.sin(n); - for(let u=0; - u<=o; - u++){ - const n=h+u/o*(r-h),d=Math.cos(n)*s,f=Math.sin(n)*e; - a.push(t+d*c-f*l,i+d*l+f*c)} - return a} - Qt(BRi,"shade"),Qt(URi,"ellipsePts"); - const FRi=Qt(t=>({ - width:t,color:NRi,join:"round",cap:"round"} - ),"ink"),$Ri=Qt(t=>({ - skin:wIi[t.race][t.skin],hair:vIi[t.hairColor],cloth:AIi[t.outfitColor],hat:EIi[t.outfit].hat,style:mIi[t.sex][t.hair]??mIi[t.sex][0]} - ),"colorsOf"),HRi=Qt((t,i)=>t.feats.includes(i),"has"); - function WRi(t,i,s,e,n,h){ - const r=-e*s*.15; - if("bob"===i)t.roundRect(1.14*-s+r,.92*-s,2.28*s,1.7*s,.62*s).fill(n).stroke(FRi(h)); - else if("long"===i)t.roundRect(1.16*-s+r,.92*-s,2.32*s,2.45*s,.7*s).fill(n).stroke(FRi(h)); - else if("twin"===i)for(const o of e?[-1]:[-1,1])t.poly(URi(o*s*1.14+r,.6*s,.34*s,.62*s,.25*o)).fill(n).stroke(FRi(h)); - else"pony"===i?t.poly(URi(e?1.12*-s:1.05*s,e?.15*s:.35*s,.33*s,.76*s,e?.55:-.3)).fill(n).stroke(FRi(h)):"tied"===i&&t.circle(e?.98*-s:.55*s,e?.5*-s:.95*-s,.3*s).fill(n).stroke(FRi(h)); - "short"!==i&&"shag"!==i&&"twin"!==i&&"pony"!==i||t.ellipse(r,.12*-s,1.08*s,.98*s).fill(n).stroke(FRi(h))} - function VRi(t,i,s,e,n,h){ - if(1===i?t.moveTo(e*s*.8,.14*-s).quadraticCurveTo(e*s*1.5,.36*-s,e*s*1.86,.66*-s).quadraticCurveTo(e*s*1.42,.08*s,e*s*.86,.3*s).closePath():3===i?t.moveTo(e*s*.84,.16*-s).quadraticCurveTo(e*s*1.25,.2*-s,e*s*1.5,.42*-s).quadraticCurveTo(e*s*1.25,.2*s,e*s*.86,.32*s).closePath():t.ellipse(e*s*.96,.12*s,.19*s,.25*s),t.fill(n).stroke(FRi(h)),0===i||2===i){ - const i=e>0?-1.2:Math.PI-1.2,r=e*s*.98,o=.13*s,a=.09*s; - t.moveTo(r+Math.cos(i)*a,o+Math.sin(i)*a).arc(r,o,a,i,i+2.4).stroke({ - width:.7*h,color:BRi(n,.72)} - )} - } - function jRi(t,i,s,e,n,h){ - if("bald"===i)return void t.ellipse(.35*-s,.6*-s,.2*s,.09*s).fill({ - color:16777215,alpha:.35} - ); - const r=e*s*.12,o={ - short:.3,shag:.26,tied:.46,bob:.22,twin:.26,pony:.28,long:.2} - [i],a={ - bob:.74,long:.95} - [i]??.06,c={ - short:[1.04,1.14,9],shag:[1.04,1.34,11],tied:[1.06,1.06,2],bob:[1.06,1.1,7],twin:[1.04,1.13,9],pony:[1.04,1.14,9],long:[1.06,1.08,5]} - [i]; - t.moveTo(1.05*-s,s*a).lineTo(1.05*-s,.05*s); - const[l,u,d]=c; - for(let w=0; - w<=d; - w++){ - const i=Math.PI*(1.02+w/d*.96),e=s*(w%2?u:l); - t.lineTo(Math.cos(i)*e+.3*r,Math.sin(i)*e*.98-.06*s)} - t.lineTo(1.05*s,.05*s).lineTo(1.05*s,s*a).lineTo(.8*s,s*a).lineTo(.82*s,-s*o+.08*s); - const f="long"===i?1:"shag"===i?6:5; - for(let w=f; - w>=0; - w--){ - const e=.82*-s+1.64*s*(w/f)+r,n="long"===i?-s*o:-s*o+(w%2?.16*s:.04*-s); - t.lineTo(e,n)} - t.lineTo(.82*-s,-s*o+.08*s).lineTo(.8*-s,s*a).closePath(),t.fill(n).stroke(FRi(h)); - const p=BRi(n,.72); - for(const[w,g,m,v]of[[-.35,-.95,-.2,-.45],[.12,-1,.18,-.5],[.52,-.82,.42,-.42]])t.moveTo(s*w+.3*r,s*g).lineTo(s*m+.3*r,s*v).stroke({ - width:.6*h,color:p,cap:"round"} - ); - if("twin"===i)for(const w of e?[-1]:[-1,1])t.circle(w*s*1.02,.12*s,.1*s).fill(16748451).stroke(FRi(.7*h)); - "pony"===i&&t.circle(e?.92*-s:.86*s,e?.32*-s:.2*-s,.1*s).fill(16748451).stroke(FRi(.7*h))} - function KRi(t,i,s,e,n){ - t.moveTo(.86*-i+.5*s,.42*-i).quadraticCurveTo(s,.95*-i,.86*i+.5*s,.42*-i); - for(let h=5; - h>=0; - h--)t.lineTo(.8*-i+1.6*i*(h/5)+s,h%2?.1*-i:.32*-i); - t.closePath().fill(e).stroke(FRi(n))} - function zRi(t,i,s,e=0){ - const{ - skin:n,hair:h,cloth:r,hat:o,style:a} - =$Ri(i),c=.09*s,l=e*s*.2; - "hood"===o?t.poly(URi(-e*s*.12,.1*-s,1.34*s,1.3*s)).fill(r).stroke(FRi(c)):WRi(t,a,s,e,h,c); - const u=e?[-1]:[-1,1]; - for(const g of u)VRi(t,i.race,s,g,n,c); - t.ellipse(0,0,s,.96*s).fill(n).stroke(FRi(c)),t.ellipse(l,.3*-s,.78*s,.2*s).fill({ - color:BRi(n,.86),alpha:.7} - ); - const d=[[.34*-s+l,.12*s,1,-1],[.32*s+l,.12*s,e?.78:1,1]],f=2===i.race; - for(const[g,m,v,_]of d){ - const e=g+_*s*.11*v,n=g-_*s*.11*v; - t.moveTo(e,m-.13*s).lineTo(n,m-.07*s).quadraticCurveTo(g-_*s*.13*v,m+.16*s,g,m+.15*s).quadraticCurveTo(g+_*s*.13*v,m+.14*s,e,m-.13*s).closePath().fill(f?2897218:1708560),f?t.circle(g,m+.03*s,.045*s).fill(9433343):t.circle(g+_*s*.025,m-.01*s,.035*s).fill(16777215),1===i.sex&&t.moveTo(e,m-.13*s).lineTo(e+_*s*.09*v,m-.2*s).stroke({ - width:.75*c,color:1708560,cap:"round"} - )} - if("bald"===a||"tied"===a)for(const[g,,m,v]of d)t.moveTo(g+v*s*.12*m,YRi(s)-.3*s).lineTo(g-v*s*.1*m,YRi(s)-.22*s).stroke({ - width:1.1*c,color:BRi(h,.8),cap:"round"} - ); - if(t.circle(l+e*s*.1,.3*s,.035*s).fill(BRi(n,.7)),HRi(i,1))for(const g of[-1,1])t.ellipse(g*s*.58+l,.38*s,.15*s,.08*s).fill({ - color:16744319,alpha:.42} - ); - if(HRi(i,0))for(const[g,m]of[[-.58,.3],[-.47,.37],[-.64,.4],[.5,.3],[.42,.38],[.58,.41]])t.circle(g*s+l,m*s,.035*s).fill({ - color:9062952,alpha:.7} - ); - if(HRi(i,3)){ - t.moveTo(l-.62*s,.2*s).lineTo(l-.3*s,.48*s).stroke({ - width:.9*c,color:11028554,cap:"round"} - ); - for(const i of[.3,.65]){ - const e=l-s*(.62-.32*i),n=s*(.2+.28*i); - t.moveTo(e-.06*s,n+.07*s).lineTo(e+.06*s,n-.07*s).stroke({ - width:.7*c,color:11028554,cap:"round"} - )} - } - const p=.52*s; - if(3===i.race){ - t.ellipse(l,p,.2*s,.08*s).fill(2758676); - for(const i of[-1,1])t.moveTo(l+i*s*.16-.06*s,p+.04*s).lineTo(l+i*s*.2,p-.2*s).lineTo(l+i*s*.16+.06*s,p+.04*s).closePath().fill(16511968).stroke(FRi(.6*c))} - else t.moveTo(l-.08*s,p).quadraticCurveTo(l,p+.05*s,l+.08*s,p).stroke({ - width:.85*c,color:4858904,cap:"round"} - ); - if(HRi(i,2)&&(t.moveTo(l-.66*s,.22*s).quadraticCurveTo(l-.55*s,1.16*s,l,1.14*s).quadraticCurveTo(l+.55*s,1.16*s,l+.66*s,.22*s).quadraticCurveTo(l+.32*s,.6*s,l,.5*s).quadraticCurveTo(l-.32*s,.6*s,l-.66*s,.22*s).closePath().fill(h).stroke(FRi(c)),t.poly(URi(l-.15*s,.43*s,.17*s,.07*s,.3)).fill(h),t.poly(URi(l+.15*s,.43*s,.17*s,.07*s,-.3)).fill(h)),HRi(i,4)){ - for(const[i,e,n]of d)t.ellipse(i,e+.02*s,.22*s*n,.21*s).stroke({ - width:.85*c,color:1708560} - ); - t.moveTo(d[0][0]+.22*s,d[0][1]).lineTo(d[1][0]-.22*s*d[1][2],d[1][1]).stroke({ - width:.85*c,color:1708560} - )} - if(HRi(i,5)){ - const[i,e]=d[0]; - t.moveTo(.98*-s,.08*-s).lineTo(i,e).lineTo(.96*s,.5*-s).stroke({ - width:.8*c,color:1314832} - ),t.ellipse(i,e+.02*s,.21*s,.2*s).fill(1314832)} - if("hood"===o){ - "bald"!==a&&KRi(t,s,l,h,c); - const e=.8*Math.PI,o=2.2*Math.PI,d=.4*l,f=.04*-s,p=URi(d,f,1.24*s,1.2*s,0,e,o,32),w=URi(d,f,1*s,.97*s,0,o,e,32); - if(t.poly([...p,...w]).fill(r).stroke(FRi(c)),t.poly(URi(d,f,1.04*s,1.01*s,0,e+.08,o-.08,32),!1).stroke({ - width:.8*c,color:LRi} - ),1===i.race||3===i.race)for(const h of u)VRi(t,i.race,s,h,n,c)} - else jRi(t,a,s,e,h,c); - if(f)for(const g of[0,.5,1]){ - const i=l-.55*s+.38*s*g,e=.5*-s-.06*s*g; - 0===g&&t.moveTo(l-.55*s,.5*-s).lineTo(l-.17*s,.56*-s).stroke({ - width:.8*c,color:5199974} - ),t.moveTo(i,e-.07*s).lineTo(i,e+.07*s).stroke({ - width:.7*c,color:5199974} - )} - if(HRi(i,6))for(const g of u)t.circle(g*s*.98,.42*s,.07*s).stroke({ - width:.8*c,color:15251504} - ); - const w=.3*l; - "rain"===o?(t.ellipse(w,.46*-s,1.48*s,.38*s).fill(r).stroke(FRi(c)),t.moveTo(.82*-s+w,.5*-s).quadraticCurveTo(.88*-s+w,1.36*-s,w+.05*s,1.34*-s).quadraticCurveTo(.9*s+w,1.32*-s,.84*s+w,.5*-s).closePath().fill(BRi(r,.95)).stroke(FRi(c)),t.moveTo(.8*-s+w,.66*-s).quadraticCurveTo(w,.56*-s,.82*s+w,.66*-s).stroke({ - width:1.4*c,color:BRi(r,.62)} - ),t.ellipse(w-.35*s,1.05*-s,.2*s,.08*s).fill({ - color:16777215,alpha:.3} - )):"cap"===o&&(t.poly(URi(.04*-s+w,.86*-s,1.06*s,.38*s,-.12)).fill(r).stroke(FRi(c)),t.circle(.04*-s+w,1.24*-s,.17*s).fill(LRi).stroke(FRi(.8*c)))} - Qt(WRi,"drawHairBack"),Qt(VRi,"drawEar"),Qt(jRi,"drawHairFront"),Qt(KRi,"drawFringe"),Qt(zRi,"drawHead"); - const YRi=Qt(t=>.12*t,"y0"); - function qRi(t,i,s,e){ - const{ - skin:n,cloth:h} - =$Ri(s),r=.08*e; - t.clear(),i.clear(),t.ellipse(0,0,.85*e,.14*e).fill({ - color:0,alpha:.28} - ); - for(const l of[-1,1])t.roundRect(l*e*.25-.17*e,.82*-e,.34*e,.72*e,.1*e).fill(2828853).stroke(FRi(r)),t.roundRect(l*e*.27-.24*e,.36*-e,.48*e,.38*e,.12*e).fill(DRi).stroke(FRi(r)),t.circle(l*e*.27+l*e*.12,.24*-e,.045*e).fill(15251504); - const o=1.95*-e; - 3===s.outfit&&t.moveTo(.6*-e,o+.1*e).lineTo(.6*e,o+.1*e).lineTo(1*e,.45*-e).lineTo(1*-e,.45*-e).closePath().fill(BRi(h,.82)).stroke(FRi(r)); - const a=1===s.outfit?h:(s.outfit,LRi); - if(t.roundRect(.64*-e,o,1.28*e,e*(1===s.outfit?1.5:1.3),.3*e).fill(a).stroke(FRi(r)),0===s.outfit)for(const l of[-1,1]){ - t.roundRect(l>0?.08*e:.64*-e,o,.56*e,1.3*e,.22*e).fill(h).stroke(FRi(r)); - for(let i=0; - i<2; - i++)t.roundRect(.1*-e,o+e*(.3+.22*i),.2*e,.07*e,.03*e).fill(14263872)} - if(1===s.outfit){ - t.rect(.42*-e,o+.18*e,.08*e,1*e).fill({ - color:16777215,alpha:.25} - ); - for(let i=0; - i<3; - i++)t.roundRect(.1*-e,o+e*(.28+.26*i),.2*e,.08*e,.03*e).fill(DRi)} - if(2===s.outfit){ - for(let i=o+.3*e; - i<o+1.2*e; - i+=.26*e)t.rect(.6*-e,i,1.2*e,.12*e).fill(h); - t.moveTo(.3*-e,o+.04*e).lineTo(.3*e,o+.04*e).lineTo(0,o+.46*e).closePath().fill(BRi(h,.75)).stroke(FRi(.8*r))} - 3===s.outfit&&(t.moveTo(.66*-e,o+.05*e).lineTo(.66*e,o+.05*e).lineTo(.5*e,o+.7*e).lineTo(0,o+.5*e).lineTo(.5*-e,o+.7*e).closePath().fill(h).stroke(FRi(r)),t.circle(0,o+.2*e,.1*e).fill(15251504).stroke(FRi(.7*r))),t.roundRect(.64*-e,o+.98*e,1.28*e,.16*e,.05*e).fill(5913122).stroke(FRi(.8*r)),t.circle(.05*e,o+1.06*e,.09*e).stroke({ - width:.9*r,color:15251504} - ); - const c=1===s.outfit||3===s.outfit?h:LRi; - t.roundRect(.58*e,o+.1*e,.3*e,.85*e,.14*e).fill(c).stroke(FRi(r)),t.roundRect(.58*e,o+.62*e,.3*e,.2*e,.06*e).fill(DRi),t.circle(.73*e,o+1*e,.14*e).fill(n).stroke(FRi(r)),t.moveTo(.62*-e,o-2.1*e).lineTo(.98*-e,o+1.1*e).stroke({ - width:.09*e,color:9067051,cap:"round"} - ),t.moveTo(.62*-e,o-2.1*e).lineTo(.98*-e,o+1.1*e).stroke({ - width:.03*e,color:13146714,cap:"round"} - ),t.moveTo(.62*-e,o-2.1*e).quadraticCurveTo(1.2*-e,o-1.4*e,1.25*-e,o-.7*e).stroke({ - width:.025*e,color:15263976,alpha:.7} - ),t.ellipse(1.25*-e,o-.6*e,.09*e,.13*e).fill(14256698).stroke(FRi(.6*r)),t.roundRect(.98*-e,o+.1*e,.32*e,.62*e,.14*e).fill(c).stroke(FRi(r)),t.circle(.84*-e,o+.72*e,.15*e).fill(n).stroke(FRi(r)),i.position.set(0,o-.62*e),zRi(i,s,e,0)} - Qt(qRi,"drawFront"); - const XRi=[{ - body:[-1,77],tip:[0,-124]} - ,{ - body:[-15,74],tip:[62,-124]} - ]; - function JRi(t,i,s){ - const{ - skin:e,hair:n,cloth:h,hat:r,style:o} - =$Ri(i),a=XRi[s],c=128+a.body[0],l=128+a.body[1],u=128+a.tip[0],d=128+a.tip[1],f=c+.22*(u-c)+(s?6:0),p=l-74; - for(const _ of[-1,1])t.ellipse(c+56*_,l-62,12,18).fill(DRi).stroke(FRi(4)); - t.ellipse(c,l-2,56,33).fill(2===i.outfit?LRi:h).stroke(FRi(4)),2===i.outfit&&(t.roundRect(c-36,l-2,72,30,6).fill(h).stroke(FRi(3.2)),t.moveTo(c-30,l+4).lineTo(c+30,l+4).stroke({ - width:3,color:LRi} - )),0===i.outfit&&t.moveTo(c,l-34).lineTo(c,l+30).stroke({ - width:3,color:BRi(h,.7)} - ),3===i.outfit&&t.moveTo(c-56,l-6).quadraticCurveTo(c,l+50,c+56,l-6).closePath().fill(BRi(h,.85)).stroke(FRi(4)); - const w=1===i.outfit||3===i.outfit?h:LRi; - for(const _ of[-1,1])t.moveTo(c+44*_,l-18).quadraticCurveTo(c+40*_,l-60,f+9*_,p+6).stroke({ - width:17,color:NRi,cap:"round"} - ),t.moveTo(c+44*_,l-18).quadraticCurveTo(c+40*_,l-60,f+9*_,p+6).stroke({ - width:11,color:w,cap:"round"} - ); - t.moveTo(f,p+18).lineTo(u,d).stroke({ - width:8,color:NRi,cap:"round"} - ),t.moveTo(f,p+18).lineTo(u,d).stroke({ - width:5,color:10119733,cap:"round"} - ); - for(const _ of[.25,.5,.75])t.circle(f+(u-f)*_,p+18+(d-p-18)*_,3.5).fill(15260864); - for(const _ of[-1,1])t.circle(f+7*_,p+4,7).fill(e).stroke(FRi(3.2)); - const g=c+(s?4:0),m=l-6,v=31; - if(("none"===r||"cap"===r)&&("long"!==o&&"bob"!==o||t.ellipse(g,m+("long"===o?12:4),37,v+("long"===o?14:6)).fill(n).stroke(FRi(4)),"pony"===o&&t.poly(URi(g+5,m+30,10,18,-.2)).fill(n).stroke(FRi(4)),"twin"===o))for(const _ of[-1,1])t.poly(URi(g+28*_,m+20,9,16,.5*_)).fill(n).stroke(FRi(4)); - if((1===i.race||3===i.race)&&"rain"!==r)for(const _ of[-1,1]){ - const s=1===i.race?1:.6; - t.moveTo(g+26*_,m-4).lineTo(g+_*(v+20*s),m+18*s).lineTo(g+24*_,m+10).closePath().fill(e).stroke(FRi(4))} - if("rain"===r)t.circle(g,m,45).fill(h).stroke(FRi(4)),t.circle(g,m-2,25).fill(BRi(h,.92)).stroke(FRi(3.2)),t.ellipse(g-9,m-12,10,5).fill({ - color:16777215,alpha:.3} - ); - else if("hood"===r)t.moveTo(g-v-3,m-4).quadraticCurveTo(g-v-1,m-v-4,g,m-v-3).quadraticCurveTo(g+v+1,m-v-4,g+v+3,m-4).quadraticCurveTo(g+v,m+v,g,m+v+14).quadraticCurveTo(g-v,m+v,g-v-3,m-4).closePath().fill(h).stroke(FRi(4)),t.moveTo(g-v+5,m-8).quadraticCurveTo(g,m-v+2,g+v-5,m-8).stroke({ - width:3,color:LRi,cap:"round"} - ); - else{ - if(t.circle(g,m,v).fill("bald"===o?e:n).stroke(FRi(4)),"bald"===o)t.ellipse(g-8,m-10,10,6).fill({ - color:16777215,alpha:.35} - ); - else{ - const i=BRi(n,.7); - for(let s=0; - s<7; - s++){ - const e=s/7*Math.PI*2+.3; - t.moveTo(g+5*Math.cos(e),m+3+5*Math.sin(e)).quadraticCurveTo(g+Math.cos(e+.5)*v*.6,m+Math.sin(e+.5)*v*.6,g+28*Math.cos(e+.2),m+28*Math.sin(e+.2)).stroke({ - width:2,color:i,cap:"round"} - )} - "tied"===o&&t.circle(g,m+v-3,9).fill(n).stroke(FRi(4))} - "cap"===r&&(t.circle(g,m-2,30).fill(h).stroke(FRi(4)),t.circle(g,m-2,7).fill(LRi).stroke(FRi(3.2)))} - } - Qt(JRi,"drawTop"); - let QRi=null; - const ZRi={ - } - ; - let tPi=[],iPi=null; - function sPi(){ - return iPi??(iPi=(async()=>{ - try{ - const t=Qt(t=>IS.getAssetPath(`fishing/avatar/${ - t} - ?v=${ - CS.appVersion} - `),"path"),i=await fetch(t("avatar_parts.json"),{ - cache:"no-store"} - ); - if(!i.ok)return; - const{ - pages:s} - =await i.json(),e={ - } - ; - let n=[]; - for(const h of s){ - const i=await(await fetch(t(h),{ - cache:"no-store"} - )).json(),s=await wd.load({ - src:t(i.meta.image),parser:"loadTextures",data:{ - autoGenerateMipmaps:!0} - } - ),r=new Kn(s,i); - await r.parse(),Object.assign(e,r.textures),Array.isArray(i.meta.parts)&&!n.length&&(n=i.meta.parts)} - await Promise.all(["male-long","male-pony","female-long","female-pony"].map(async i=>{ - try{ - ZRi[i]=await wd.load({ - src:t(`hair-v2/${ - i} - .webp`)+"&hair=redraw-1008-640-v3",parser:"loadTextures",data:{ - autoGenerateMipmaps:!0} - } - )} - catch(frt){ - } - } - )),QRi=e,tPi=n,uPi.clear()} - catch(frt){ - } - } - )()),iPi} - Qt(sPi,"loadAvatarParts"); - const ePi=["human","elf","undead","orc"]; - function nPi(t,i,s=0){ - var e; - if(!QRi||!tPi.length)return null; - const{ - skin:n,hair:h,cloth:r} - =$Ri(t),o=ePi[t.race],a=t.sex?"f":"m",c="front"===i?mIi[t.sex][0]:0===t.sex&&2===t.hair?"tied":$Ri(t).style,l="top"===i?`@${ - s} - `:"",u=Qt(s=>!(s.view!==i||void 0!==s.style&&s.style!==c||void 0!==s.race&&s.race!==o||void 0!==s.sex&&s.sex!==a||void 0!==s.outfit&&s.outfit!==t.outfit||void 0!==s.feat),"fits"),d=tPi.filter(u); - if(!d.some(t=>"skin"===t.tint&&t.race===o&&("top"===i||t.sex===a)))return null; - d.sort((t,i)=>t.layer-i.layer||(t.order??0)-(i.order??0)); - const f=[]; - for(const p of d){ - let s=p.file.replace(/\.png$/,""); - if("front"===i&&t.hair>0&&s.includes("/hair-"))continue; - const o=(null==(e=p.clipByOutfit)?void 0:e[String(t.outfit)])?`${ - s} - --hat${ - t.outfit} - ${ - l} - `:null,a=o&&QRi[o]?o:`${ - s} - ${ - l} - `; - QRi[a]&&f.push([a,"hair"===p.tint?h:"skin"===p.tint?n:"cloth"===p.tint?r:null])} - return f} - Qt(nPi,"layersFor"); - const hPi=Qt(t=>t.hair>0&&!ZRi[`${ - t.sex?"female":"male"} - -${ - 1===t.hair?"long":"pony"} - `]?nPi({ - ...t,hair:0} - ,"front"):nPi(t,"front"),"frontLayers"),rPi=Qt((t,i)=>nPi(t,"top",i),"topLayers"); - function oPi(t){ - const i=new Ke; - for(const[s,e]of t){ - const t=new Xe(QRi[s]); - t.label=s,null!==e&&(t.tint=e),i.addChild(t)} - return i.eventMode="none",i} - Qt(oPi,"stack"); - const aPi=[{ - long:[11,12,.37,.34],pony:[67,2,.31,.31]} - ,{ - long:[64,3,.3,.3],pony:[105,-5,.28,.31]} - ]; - function cPi(t,i){ - const s=new Ke,e=1===t.hair?"long":"pony",n=ZRi[`${ - t.sex?"female":"male"} - -${ - e} - `]; - if(!n)return s; - const[h,r,o,a]=aPi[t.sex][e],c=new Xe(n); - c.label=`hair-v2/${ - t.sex} - -${ - e} - `,c.position.set(h,r),c.scale.set(1254*o/n.width,1254*a/n.height),c.tint=vIi[t.hairColor]; - const l=(new ep).rect(0,i?220:0,512,i?292:220).fill(16777215); - return s.addChild(c,l),c.mask=l,s} - function lPi(t,i){ - const s=new Ke,e=t.hair>0; - e&&s.addChild(cPi(t,!0)); - let n=!t.feats.some(t=>6!==t); - const h=Qt(()=>{ - const i=new Ke,e=IRi(t),h=(new ep).poly(CRi[t.race][t.sex].hull).fill(16777215); - i.addChild(e,h),e.mask=h,s.addChild(i),n=!0} - ,"details"); - for(const[r,o]of i){ - n||!r.includes("tusks-")&&!r.includes("hair-front-")||h(); - const i=new Xe(QRi[r]); - if(i.label=r,null!==o&&(i.tint=o),r.includes("/outfit-")){ - const t=(new ep).poly([0,0,310,0,310,245,512,245,512,512,0,512]).fill(16777215); - s.addChild(i,t),i.mask=t} - else s.addChild(i); - r===`front/skin-${ - ePi[t.race]} - -${ - t.sex?"f":"m"} - `&&s.addChild(PRi(t)),1===t.sex&&r===`front/outfit-0-base-${ - ePi[t.race]} - -f`&&s.addChild(TRi(QRi[r],t))} - return n||h(),e&&s.addChild(cPi(t,!1)),HRi(t,6)&&s.addChild(kRi(t)),s.eventMode="none",s} - Qt(cPi,"newHair"),Qt(lPi,"stackFront"); - const uPi=new Map; - let dPi=!1; - function fPi(){ - var t,i; - dPi||(dPi=!0,null==(i=(t=SS.app.canvas).addEventListener)||i.call(t,"webglcontextrestored",()=>setTimeout(()=>{ - var t,i; - for(const s of uPi.values()){ - if(s.tex.destroyed)continue; - const e=new Ke; - s.build(e),SS.app.renderer.render({ - container:e,target:s.tex,clear:!0} - ),null==(i=(t=s.tex.source).updateMipmaps)||i.call(t),e.destroy({ - children:!0} - )} - } - ,0)))} - function pPi(t,i,s,e,n=1){ - const h=uPi.get(t); - if(h&&!h.tex.destroyed)return h.tex; - fPi(); - const r=new Ke; - e(r); - const o=SS.app.renderer.generateTexture({ - target:r,frame:new $i(0,0,i,s),resolution:n,textureSourceOptions:GRi} - ); - return r.destroy({ - children:!0} - ),uPi.set(t,{ - tex:o,w:i,h:s,build:e} - ),o} - Qt(fPi,"hookRestore"),Qt(pPi,"bake$2"); - const wPi=128/330; - function gPi(t){ - return pPi(`p:${ - IIi(t)} - `,128,128,i=>{ - const s=hPi(t); - if(s){ - const e=lPi(t,s); - return e.scale.set(wPi),e.position.set(64-102.4,64-174*wPi),void i.addChild(e)} - const e=new ep; - e.position.set(64,72),zRi(e,t,40,0),i.addChild(e)} - ,2)} - function mPi(t,i,s=!1){ - return pPi(`t${ - i} - ${ - s?"s":""} - :${ - IIi(t)} - `,256,256,s=>{ - const e=rPi(t,i); - if(e)return void s.addChild(oPi(e)); - const n=new ep; - JRi(n,t,i),s.addChild(n)} - ,s?.5:1)} - function vPi(t){ - return[mPi(t,0),mPi(t,1)]} - function _Pi(t){ - const i=hPi(t); - if(i){ - const s=new Ke,e=lPi(t,i),n=(new ep).rect(-64,-64,128,128).fill(16777215); - return e.scale.set(wPi),e.pivot.set(264,174),s.addChild(e,n),e.mask=n,s} - const s=new ep; - return zRi(s,t,40,0),s} - Qt(gPi,"avatarPortrait"),Qt(mPi,"avatarTopPose"),Qt(vPi,"avatarTop"),Qt(_Pi,"buildFace"); - const MPi=class extends Ke{ - constructor(t){ - super(),Zt(this,"body",new ep),Zt(this,"head",new ep),Zt(this,"art",null),this.R=t,this.eventMode="none",this.addChild(this.body,this.head)} - set(t){ - var i; - null==(i=this.art)||i.destroy({ - children:!0} - ),this.art=null; - const s=hPi(t); - if(s)return this.body.clear(),this.head.clear(),this.art=lPi(t,s),this.art.pivot.set(256,480),this.art.scale.set(this.R/100),void this.addChild(this.art); - qRi(this.body,this.head,t,this.R)} - } - ; - Qt(MPi,"AvatarFront"); - let bPi=MPi; - const yPi=[{ - id:"fish",text:"낚시",icon:"hook",art:"fish"} - ,{ - id:"gear",text:"장비",icon:"toolbox",art:"gear"} - ,{ - id:"tank",text:"어망",icon:"keepnet",art:"net"} - ,{ - id:"quest",text:"퀘스트",icon:"trophy",art:"quest"} - ,{ - id:"shop",text:"상점",icon:"stall",art:"shop"} - ],EPi=class t extends pB{ - constructor(){ - super(),Zt(this,"paper",new ep),Zt(this,"pageBg",new ep),Zt(this,"chrome",new ep),Zt(this,"pages",new Ke),Zt(this,"pageMask",new ep),Zt(this,"overlay",new Ke),Zt(this,"me",new Ke),Zt(this,"meBg",new ep),Zt(this,"meFace",new Xe),Zt(this,"meLookRaw"),Zt(this,"dayBg",new ep),Zt(this,"dayText",Jxi("",Uxi,12)),Zt(this,"walletBg",new ep),Zt(this,"goldIcon",pRi("gold",18)),Zt(this,"goldText",Jxi("",Bxi,13)),Zt(this,"pearlIcon",pRi("pearl",18)),Zt(this,"pearlText",Jxi("",Wxi,13)),Zt(this,"walletSig",""),Zt(this,"battleBg",new ep),Zt(this,"battleIcon",new ep),Zt(this,"battleText",Jxi("",Bxi,13)),Zt(this,"battleSig",""),Zt(this,"castleDown",Qt(()=>!1,"castleDown")),Zt(this,"close",new Ke),Zt(this,"minimizeBtn",new Ke),Zt(this,"minimizing",!1),Zt(this,"navigation",new Ke),Zt(this,"subBar",new Ke),Zt(this,"subSig",""),Zt(this,"tabButtons",[]),Zt(this,"tabDrawn",null),Zt(this,"fxLayer",new Ke),Zt(this,"shown",{ - gold:-1,pearl:-1} - ),Zt(this,"target",{ - gold:-1,pearl:-1} - ),Zt(this,"devRow",new Ke),Zt(this,"devToggle",new oRi("테스트",56,26,12)),Zt(this,"scrollTrack",new ep),Zt(this,"scrollY",0),Zt(this,"drag",null),Zt(this,"dragged",!1),Zt(this,"onResize",Qt(()=>{ - var t,i,s; - null==(i=null==(t=this.activePage)?void 0:t.onResize)||i.call(t),null==(s=this.activePage)||s.update(),this.refresh()} - ,"onResize")),Zt(this,"speedChip",new oRi("×1",62,26,12)),Zt(this,"dayChip",new oRi("+1일",62,26,12)),Zt(this,"tideChip",new oRi("▸노을",62,26,12)),Zt(this,"goldChip",new oRi("+골드",62,26,12)),Zt(this,"botsChip",new oRi("+200명",62,26,12)),Zt(this,"boatChip",new oRi("배 1",62,26,12)),Zt(this,"journeyChip",new oRi("퀘스트+",62,26,12)),Zt(this,"giantChip",new oRi("그림자",62,26,12)),Zt(this,"badgeChip",new oRi("뱃지 ▸",62,26,12)),Zt(this,"raidChip",new oRi("약탈",62,26,12)),Zt(this,"robbedChip",new oRi("털리기",62,26,12)),Zt(this,"cutChip",new oRi("줄끊김",62,26,12)),Zt(this,"breakChip",new oRi("고장",62,26,12)),Zt(this,"hazardChip",new oRi("재난",62,26,12)),Zt(this,"fixChip",new oRi("다고침",62,26,12)),Zt(this,"brokenDummyChip",new oRi("고장배",62,26,12)),Zt(this,"huntChip",new oRi("사냥",62,26,12)),Zt(this,"huntCrowdChip",new oRi("사냥꾼+",62,26,12)),Zt(this,"gearChip",new oRi("장비+",62,26,12)),Zt(this,"netChip",new oRi("어망+",62,26,12)),Zt(this,"resetChip",new oRi("처음부터",62,26,12)),Zt(this,"resetArmedUntil",0),Zt(this,"botSpots",null),Zt(this,"plunderSpots",null),Zt(this,"timer",new Rx(250)),Zt(this,"unsubscribe",[]),Zt(this,"activePage",null),Zt(this,"onNavigate",null),Zt(this,"backStack",[]),Zt(this,"backBtn",new Ke),Zt(this,"backBg",new ep),Zt(this,"backGlow",new ep),Zt(this,"backArrow",new ep),Zt(this,"backText",Jxi("",Gxi,14)),Zt(this,"backNow",null),Zt(this,"onExit",null),Zt(this,"lastInput",performance.now()),Zt(this,"immersed",!1),Zt(this,"immerseTween",null),Zt(this,"wake",new Ke),Zt(this,"exchangeOnly",!1),Zt(this,"tutorialMode",!1),Zt(this,"tutorialEvents",new Map),Zt(this,"pointer",null),this.width=t.WIDTH,this.bg.visible=this.txtTitle.visible=this.btnClose.visible=!1,this.paper.eventMode="static",this.pageBg.eventMode="none",this.chrome.eventMode="none",this.pageMask.eventMode="none",this.pages.mask=this.pageMask,this.pages.position.set(t.CONTENT_X,t.CONTENT_Y),this.overlay.position.set(t.CONTENT_X,t.CONTENT_Y); - const i=(new ep).moveTo(14,14).lineTo(34,34).moveTo(34,14).lineTo(14,34).stroke({ - color:Uxi,width:4,cap:"round"} - ); - i.eventMode="none",this.close.addChild(i),this.close.eventMode="static",this.close.cursor="pointer",this.close.hitArea=new $i(-4,-4,56,56),this.close.on("pointertap",t=>{ - t.stopPropagation(),this.requestExit()} - ); - const s=(new ep).moveTo(13,31).lineTo(35,31).stroke({ - color:Uxi,width:3.5,cap:"round"} - ); - s.eventMode="none",this.minimizeBtn.addChild(s),this.minimizeBtn.eventMode="static",this.minimizeBtn.cursor="pointer",this.minimizeBtn.hitArea=new $i(-2,-4,48,56),this.minimizeBtn.on("pointertap",t=>{ - t.stopPropagation(),queueMicrotask(()=>{ - this.minimize()} - )} - ),this.on("removed",()=>this.setFullscreen(!1)),this.on("pointerdowncapture",()=>{ - this.lastInput=performance.now(),this.pointer&&performance.now()-this.pointer.t0>300&&queueMicrotask(()=>this.endPoint())} - ),this.wake.eventMode="static",this.wake.visible=!1,this.wake.on("pointertap",t=>{ - var i,s; - t.stopPropagation(),(null==(s=null==(i=this.activePage)?void 0:i.immersiveTap)?void 0:s.call(i))||this.setImmersed(!1)} - ); - for(const{ - id:t,text:h,icon:r,art:o} - of yPi){ - const i=new Ke,s=new ep,e=(new ep).circle(0,0,6).fill(14698538),n=new _Ri(o,r,64,16777215,30),a=Jxi(h,Dxi,15); - n.pivot.set(32,32),s.eventMode="none",e.eventMode="none",e.visible=!1,i.addChild(s,n,a,e),i.eventMode="static",i.cursor="pointer",i.on("pointertap",i=>{ - i.stopPropagation(),this.selectTab(t,"user")} - ),this.navigation.addChild(i),this.tabButtons.push({ - id:t,root:i,bg:s,icon:n,name:a,dot:e} - )} - const e=ixi.getInstance(); - this.speedChip.onTap=()=>{ - e.devSpeed()} - ,this.dayChip.onTap=()=>{ - e.devSkipDay().then(()=>bH.getInstance().showMessage("하루를 넘겼어요 (꺼둔 시간으로 처리)"))} - ,this.tideChip.onTap=()=>{ - e.devSkipTide().then(t=>bH.getInstance().showMessage(t??`${ - _Ti[UTi(e.now())]} - (으)로 넘겼어요 (꺼둔 시간으로 처리)`))} - ,this.goldChip.onTap=()=>{ - e.devAddGold()} - ,this.boatChip.onTap=()=>{ - e.devBoat().then(t=>bH.getInstance().showMessage(t??`배 ${ - e.state.gear.boat+1} - 단계로 바꿨어요`))} - ,this.botsChip.onTap=()=>{ - var t; - const i=(null==(t=this.botSpots)?void 0:t.call(this))??[]; - e.devBots(i).then(t=>bH.getInstance().showMessage(`가짜 낚시꾼 ${ - t} - 명을 30분 동안 띄웠어요`))} - ,this.journeyChip.onTap=()=>{ - e.devQuest().then(t=>bH.getInstance().showMessage(t??"들고 있는 퀘스트를 채웠어요 · NPC 에게 가서 마치기"))} - ,this.giantChip.onTap=()=>{ - ei(()=>Promise.resolve().then(()=>q$i),void 0).then(t=>t.FishingMainPage.getInstance().devGiant())} - ,this.badgeChip.onTap=()=>{ - qxi.corner="right"===qxi.corner?"left":"right",this.badgeChip.setText("right"===qxi.corner?"뱃지 ▸":"◂ 뱃지"); - const t=this.activePage; - t&&(t.onHide(),t.onShow())} - ,this.raidChip.onTap=()=>{ - var t; - e.devPlunder("dummies",(null==(t=this.plunderSpots)?void 0:t.call(this,3))??[]).then(t=>bH.getInstance().showMessage(t??"어망이 찬 정박한 배 3척을 옆에 띄웠어요 (Zz) · 눌러서 망원경"))} - ,this.robbedChip.onTap=()=>{ - var t; - e.devPlunder("robMe",((null==(t=this.plunderSpots)?void 0:t.call(this,4))??[]).slice(3)).then(t=>bH.getInstance().showMessage(t??"수상한 낚시꾼이 내 어망을 털기 시작했어요"))} - ,this.cutChip.onTap=()=>{ - e.devPlunder("dummyCut").then(t=>bH.getInstance().showMessage(t??"시험 배 주인이 줄을 끊었어요"))} - ,this.breakChip.onTap=()=>{ - e.devBoatTest("boatBreak").then(t=>t&&bH.getInstance().showMessage(t))} - ,this.hazardChip.onTap=()=>{ - e.devBoatTest("boatHazard").then(t=>t&&bH.getInstance().showMessage(t))} - ,this.fixChip.onTap=()=>{ - e.devBoatTest("boatFix").then(t=>bH.getInstance().showMessage(t??"배를 다 고치고 도움 점수를 채웠어요"))} - ,this.brokenDummyChip.onTap=()=>{ - var t; - e.devBoatTest("brokenDummy",(null==(t=this.plunderSpots)?void 0:t.call(this,1))??[]).then(t=>bH.getInstance().showMessage(t??"옆에 고장 난 시험 배를 띄웠어요 · 눌러서 수리 돕기"))} - ,this.huntChip.onTap=()=>{ - e.devHunt("huntNow").then(t=>bH.getInstance().showMessage(t??"몬스터를 불렀어요 · 작살을 채웠어요 (4분)"))} - ,this.gearChip.onTap=()=>{ - e.devGear().then(t=>bH.getInstance().showMessage(t??"장비 33개를 넣었어요 (뽑기 30 + ★3·4·5)"))} - ,this.netChip.onTap=()=>{ - e.devNetFill().then(t=>bH.getInstance().showMessage(t??"어망을 가득 채웠어요 (앞 3마리 특대)"))} - ,this.huntCrowdChip.onTap=()=>{ - e.devHunt("huntCrowd").then(t=>bH.getInstance().showMessage(t??"가짜 사냥꾼 5명이 작살을 던졌어요"))} - ,this.resetChip.onTap=()=>{ - const t=performance.now(); - if(t>this.resetArmedUntil)return this.resetArmedUntil=t+3e3,this.resetChip.setText("한 번 더"),bH.getInstance().showMessage("한 번 더 누르면 낚시왕을 처음부터 다시 시작해요 (이 계정 · 나 만들기부터)"),void setTimeout(()=>{ - performance.now()>this.resetArmedUntil&&this.resetChip.setText("처음부터")} - ,3100); - this.resetArmedUntil=0,this.resetChip.setText("지우는 중"),e.devReset().then(t=>{ - t&&(this.resetChip.setText("처음부터"),bH.getInstance().showMessage(t))} - )} - ,this.devRow.addChild(this.speedChip,this.dayChip,this.tideChip,this.boatChip,this.goldChip,this.botsChip,this.journeyChip,this.giantChip,this.badgeChip,this.raidChip,this.robbedChip,this.cutChip,this.breakChip,this.hazardChip,this.fixChip,this.brokenDummyChip,this.huntChip,this.huntCrowdChip,this.gearChip,this.netChip,this.resetChip),this.devRow.visible=!1,this.devToggle.visible=xG.getInstance().development,this.devToggle.onTap=()=>{ - this.devRow.visible=!this.devRow.visible} - ,this.scrollTrack.eventMode="none",this.pages.eventMode="static",this.pages.on("wheel",i=>{ - this.maxScroll()<=0||(i.preventDefault(),i.stopPropagation(),this.scrollY+=i.deltaY*(1===i.deltaMode?16:2===i.deltaMode?t.contentHeight:1),this.updateScroll())} - ),this.pages.on("pointerdown",t=>{ - this.dragged=!1,this.drag={ - y:this.toLocal(t.global).y,scroll:this.scrollY,id:t.pointerId} - } - ),this.pages.on("pointermove",t=>this.moveScroll(t)),this.pages.on("pointerup",()=>{ - this.drag=null} - ),this.pages.on("pointerupoutside",()=>{ - this.drag=null} - ),this.pages.on("pointercancel",()=>{ - this.drag=null} - ),this.pages.on("pointertapcapture",t=>{ - this.dragged&&t.stopPropagation()} - ),this.goldIcon.pivot.set(9,9),this.pearlIcon.pivot.set(9,9),this.dayBg.eventMode=this.walletBg.eventMode=this.battleBg.eventMode=this.battleIcon.eventMode="none",this.meBg.circle(14,14,14).fill(Ixi),this.meFace.anchor.set(.5),this.meFace.position.set(14,15),this.meFace.scale.set(.26); - const n=(new ep).circle(14,14,14).fill(16777215); - this.meFace.mask=n,this.meBg.eventMode=this.meFace.eventMode="none",this.me.addChild(this.meBg,this.meFace,n),this.me.visible=!1,this.me.eventMode="static",this.me.cursor="pointer",this.me.hitArea=new $i(-6,-8,40,44),this.me.on("pointertap",t=>{ - t.stopPropagation(),ei(()=>Promise.resolve().then(()=>ZNi),void 0).then(t=>{ - t.FishingAvatarMaker.isOpen||t.FishingAvatarMaker.getInstance().open(!1)} - )} - ),ei(()=>Promise.resolve().then(()=>wfi),void 0).then(t=>{ - this.castleDown=()=>t.BattleController.getInstance().isCastleDestroyed()} - ),this.fxLayer.eventMode="none",this.backGlow.eventMode=this.backBg.eventMode=this.backArrow.eventMode="none",this.backBtn.addChild(this.backGlow,this.backBg,this.backArrow,this.backText),this.backBtn.visible=!1,this.backBtn.eventMode="static",this.backBtn.cursor="pointer",this.backBtn.on("pointertap",t=>{ - t.stopPropagation(),this.tapBack()} - ),this.addChild(this.paper,this.pageBg,this.pages,this.pageMask,this.overlay,this.chrome,this.subBar,this.backBtn,this.me,this.dayBg,this.dayText,this.walletBg,this.battleBg,this.battleIcon,this.battleText,this.goldIcon,this.goldText,this.pearlIcon,this.pearlText,this.devRow,this.devToggle,this.navigation,this.minimizeBtn,this.close,this.scrollTrack,this.fxLayer,this.wake),this.timer.addEventListener("timer",()=>this.onTimer())} - static getInstance(){ - return this.instance??(this.instance=new t)} - static get layoutHeight(){ - return this.fullscreen?SS.safeHeight:Math.min(960,SS.safeHeight-48)} - static get WIDTH(){ - return this.fullscreen?640:616} - static get footerTop(){ - return this.layoutHeight-this.FOOTER-(this.subOn?this.SUB_BAR:0)} - static get CONTENT_X(){ - return(this.WIDTH-this.CONTENT_W)/2} - static get BLEED_W(){ - return this.fullscreen?this.WIDTH:this.CONTENT_W} - static get OVERLAY_PAD(){ - return this.fullscreen?this.CONTENT_X:0} - static get contentTop(){ - return this.CONTENT_Y*(1-this.immersion)} - static get contentHeight(){ - const t=this.footerTop-this.CONTENT_Y-6; - return t+(this.layoutHeight-t)*this.immersion} - present(i){ - var s,e; - if(this.activePage===i&&this.parent)return i.update(),void this.refresh(); - if(this.parent||this.setFullscreen(!0),this.activePage!==i&&(this.setImmersed(!1,!0),null==(s=this.activePage)||s.onHide(),this.pages.removeChildren(),this.activePage=i,t.subOn=!!(null==(e=i.subTabs)?void 0:e.call(i)),this.scrollY=0,this.drag=null,this.pages.addChild(i)),i.onShow(),this.refresh(),!this.parent){ - super.show(),this.eventMode="static",this.timer.start(),SS.stage.on("resized",this.onResize); - const i=ixi.getInstance(); - i.open=!0,this.unsubscribe.push(i.onChange(()=>this.updateHeader()),i.onNotice(t=>bH.getInstance().showMessage(t)),i.onCatch(i=>{ - Qki(i)>0&&this.flyCurrency("gold",this.toGlobal({ - x:t.WIDTH/2,y:.5*t.layoutHeight} - ),3)} - ))} - } - setExchangeOnly(t){ - var i; - this.exchangeOnly=t,this.minimizeBtn.visible=!t,this.battleSig=""; - for(const s of this.tabButtons)s.root.alpha=!t||"shop"===s.id||"quest"===s.id&&(null==(i=ixi.getInstance().social)?void 0:i.enabled)?1:.35; - ei(()=>Promise.resolve().then(()=>JWi),void 0).then(i=>i.FishingShopPage.getInstance().forceExchange(t))} - closeForSeason(){ - var t; - this.parent&&(this.hideImmediately(),null==(t=this.onExit)||t.call(this))} - async selectTab(t,i="jump"){ - var s,e,n; - if(this.exchangeOnly&&"shop"!==t&&("quest"!==t||!(null==(s=ixi.getInstance().social)?void 0:s.enabled)))return void bH.getInstance().showMessage("회차가 끝나 교환소만 열려 있어요"); - const h=null==(e=this.activePage)?void 0:e.tabId; - "user"===i||"fish"===t?this.backStack=[]:h&&h!==t&&(this.backStack[this.backStack.length-1]===t?this.backStack.pop():this.backStack.push(h)),h!==t||"fish"===t?(await(null==(n=this.onNavigate)?void 0:n.call(this,t)),this.drawBack()):this.drawBack()} - async goBack(){ - var t; - const i=this.backStack.pop(); - i?(await(null==(t=this.onNavigate)?void 0:t.call(this,i)),this.drawBack()):this.drawBack()} - tapBack(){ - var t,i,s,e; - (null==(i=null==(t=this.activePage)?void 0:t.backLabel)?void 0:i.call(t))?null==(e=(s=this.activePage).closeOne)||e.call(s):this.goBack(),this.drawBack()} - drawBack(){ - var t,i,s; - const e=(null==(i=null==(t=this.activePage)?void 0:t.backLabel)?void 0:i.call(t))??null,n=this.backStack[this.backStack.length-1],h=e??(n?(null==(s=yPi.find(t=>t.id===n))?void 0:s.text)??null:null),r=h?lRi(h,"으로","로"):null; - if(r===this.backNow)return; - const o=!this.backNow&&!!r; - this.backNow=r,this.walletSig="",this.drawCurrency(),o&&(yx.fromTo(this.backBtn.scale,{ - x:.6,y:.6} - ,{ - x:1,y:1,duration:.3,ease:"back.out(2.6)"} - ),yx.killTweensOf(this.backGlow),yx.fromTo(this.backGlow,{ - alpha:.95} - ,{ - alpha:0,duration:.7,repeat:1,delay:.25,ease:"power1.out"} - ),yx.fromTo(this.backGlow.scale,{ - x:1,y:1} - ,{ - x:1.12,y:1.45,duration:.7,repeat:1,delay:.25,ease:"power1.out"} - ))} - onTimer(){ - var t; - ixi.getInstance().tick(),null==(t=this.activePage)||t.update(),this.updateScroll(),this.updateHeader(),this.updateImmersion(),this.drawBack()} - updateImmersion(){ - var i; - if(this.tutorialMode)return; - const s=this.activePage; - if(!(t.fullscreen&&(null==s?void 0:s.fullBleed)&&0===this.overlay.children.length&&(null==(i=s.canImmerse)?void 0:i.call(s)))||this.isCastleDown())return this.lastInput=performance.now(),void(this.immersed&&this.setImmersed(!1)); - !this.immersed&&performance.now()-this.lastInput>=t.IMMERSE_AFTER_MS&&this.setImmersed(!0)} - get inTutorial(){ - return this.tutorialMode} - setTutorialMode(t){ - var i; - if(this.tutorialMode!==t){ - this.tutorialMode=t; - for(const i of[this.navigation,this.subBar,this.close,this.minimizeBtn,this.me,this.backBtn,this.devToggle,this.devRow])t?(this.tutorialEvents.set(i,i.eventMode??"passive"),i.eventMode="none"):i.eventMode=this.tutorialEvents.get(i)??i.eventMode; - t?(null==(i=this.immerseTween)||i.kill(),this.immerseTween=null,this.immersed=!0,this.wake.visible=!1,this.applyImmersion(1)):this.setImmersed(!1)} - } - setImmersed(i,s=!1){ - var e; - if(this.immersed===i&&!s)return; - this.immersed=i,this.lastInput=performance.now(),this.wake.visible=i&&!this.tutorialMode,null==(e=this.immerseTween)||e.kill(),this.immerseTween=null; - const n=i?1:0; - if(s)return void this.applyImmersion(n); - const h={ - t:t.immersion} - ; - this.immerseTween=yx.to(h,{ - t:n,duration:i?.6:.3,ease:i?"power2.inOut":"power2.out",onUpdate:Qt(()=>this.applyImmersion(h.t),"onUpdate"),onComplete:Qt(()=>{ - this.immerseTween=null} - ,"onComplete")} - )} - applyImmersion(i){ - var s,e,n,h,r; - t.immersion=i; - for(const t of[this.chrome,this.me,this.backBtn,this.dayBg,this.dayText,this.walletBg,this.battleBg,this.battleIcon,this.battleText,this.goldIcon,this.goldText,this.pearlIcon,this.pearlText,this.devRow,this.devToggle,this.navigation,this.subBar,this.minimizeBtn,this.close,this.scrollTrack])t.alpha=1-i; - null==(e=null==(s=this.activePage)?void 0:s.setImmersion)||e.call(s,i),null==(h=null==(n=this.activePage)?void 0:n.onResize)||h.call(n),this.layoutPageArea(); - for(const t of this.overlay.children)null==(r=t.layout)||r.call(t)} - layoutPageArea(){ - const i=this.pageSpan(); - this.pages.x=i.x,this.pageMask.clear().rect(i.x,t.contentTop,i.w,t.contentHeight).fill(16777215),this.updateScroll()} - updateHeader(){ - var t; - const i=ixi.getInstance(),s=i.state; - if(s.look!==this.meLookRaw){ - this.meLookRaw=s.look; - const t=i.look; - this.me.visible=!!t,t&&(this.meFace.texture=gPi(t)),this.walletSig=""} - const e=i.season,n=i.seasonDays(); - this.dayText.text="exchangeOnly"===i.phase()&&(null==e?void 0:e.shopEndAt)?`교환만 · ${ - gRi(e.shopEndAt)} - 까지`:i.isLastDay()?`${ - i.eventDay()} - 일차 · 오늘 회차 끝`:n?`${ - i.eventDay()} - 일차 / ${ - n} - 일`:(null==e?void 0:e.endAt)?`${ - i.eventDay()} - 일차 · ${ - gRi(e.endAt)} - 끝`:`${ - i.eventDay()} - 일차`,this.dayText.textColor=i.isLastDay()||"exchangeOnly"===i.phase()?Hxi:Uxi; - for(const r of["gold","pearl"]){ - if(s[r]===this.target[r])continue; - const t=this.target[r]<0; - this.target[r]=s[r],yx.killTweensOf(this.shown,r),t?this.shown[r]=s[r]:yx.to(this.shown,{ - [r]:s[r],duration:.7,ease:"power2.out",onUpdate:Qt(()=>this.drawCurrency(),"onUpdate")} - )} - this.drawCurrency(),this.drawBattle(),this.speedChip.setText(`×${ - s.devSpeed} - `),this.boatChip.setText(`배 ${ - s.gear.boat+1} - `),this.tideChip.setText(`▸${ - _Ti[(UTi(ixi.getInstance().now())+1)%4]} - `); - const h=Vki(i.dotsInput("tank"===(null==(t=this.activePage)?void 0:t.tabId))); - for(const r of this.tabButtons)r.dot.visible="quest"===r.id?h.quest:"tank"===r.id&&h.tank; - this.refreshSub()} - refreshSub(){ - var i,s,e,n,h; - const r=!!(null==(s=null==(i=this.activePage)?void 0:i.subTabs)?void 0:s.call(i)); - if(r===t.subOn)this.drawSub(); - else{ - t.subOn=r,this.refresh(),null==(n=null==(e=this.activePage)?void 0:e.onResize)||n.call(e); - for(const t of this.overlay.children)null==(h=t.layout)||h.call(t)} - } - drawSub(){ - var i,s; - const e=t.subOn?(null==(s=null==(i=this.activePage)?void 0:i.subTabs)?void 0:s.call(i))??null:null,n=t.CONTENT_X,h=t.CONTENT_W,r=t.footerTop+6,o=e?`${ - n} - |${ - r} - |${ - e.index} - |${ - e.items.join(",")} - |${ - (e.dots??[]).map(Number).join("")} - `:"off"; - if(o===this.subSig)return; - if(this.subSig=o,this.subBar.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),this.subBar.visible=!!e,!e)return; - const a=e.items.length,c=(h-8-4*(a-1))/a; - this.subBar.position.set(n,r); - const l=(new ep).roundRect(0,0,h,50,14).fill(Ixi); - l.eventMode="none",this.subBar.addChild(l),e.items.forEach((t,i)=>{ - var s; - const n=i===e.index,h=new Ke; - if(h.position.set(4+i*(c+4),4),n){ - const t=(new ep).roundRect(0,0,c,42,10).fill(xxi); - t.eventMode="none",h.addChild(t)} - const r=Jxi(t,n?Bxi:Uxi,16); - if(sRi(r,c-16),r.position.set((c-r.width)/2,(42-r.height)/2),h.addChild(r),null==(s=e.dots)?void 0:s[i]){ - const t=(new ep).circle(0,0,6).fill(15029053); - t.eventMode="none",t.position.set(c-12,9),h.addChild(t)} - h.eventMode="static",h.cursor="pointer",h.hitArea=new $i(-2,-8,c+4,58),h.on("pointertap",t=>{ - var s,e; - t.stopPropagation(),n||(null==(e=null==(s=this.activePage)?void 0:s.selectSub)||e.call(s,i),this.resetScroll(),queueMicrotask(()=>this.refreshSub()))} - ),this.subBar.addChild(h)} - )} - drawCurrency(){ - this.goldText.text=Math.round(this.shown.gold).toLocaleString(),this.pearlText.text=Math.round(this.shown.pearl).toLocaleString(); - const i=`${ - this.dayText.text} - |${ - this.goldText.text} - |${ - this.pearlText.text} - |${ - this.backNow} - `; - if(i===this.walletSig)return; - this.walletSig=i,sRi(this.goldText,110),sRi(this.pearlText,80); - const s=t.HEADER/2,e=s-14,n=this.backNow; - let h; - if(this.backBtn.visible=!!n,this.me.visible=!!ixi.getInstance().look&&!n,this.dayBg.visible=this.dayText.visible=!n,n){ - this.backText.text=n; - const t=32,i=30+this.backText.width+14; - this.backBg.clear().roundRect(0,-t/2,i,t,t/2).fill(Dxi),this.backGlow.clear().roundRect(0,-t/2,i,t,t/2).stroke({ - color:Dxi,width:3} - ),this.backGlow.pivot.set(i/2,0),this.backGlow.x=i/2,this.backGlow.alpha=0,this.backArrow.clear().moveTo(19,-7).lineTo(12,0).lineTo(19,7).stroke({ - color:Gxi,width:3,cap:"round",join:"round"} - ),this.backText.position.set(26,-this.backText.height/2),this.backBtn.position.set(14,s),this.backBtn.hitArea=new $i(-10,-t/2-8,i+20,t+16),h=14+i+8} - else{ - const t=this.me.visible?50:16; - this.me.position.set(16,s-14),this.dayText.position.set(t+10,s-this.dayText.height/2); - const i=this.dayText.width+20; - this.dayBg.clear().roundRect(t,e,i,28,9).fill(Ixi),h=t+i+6} - this.goldIcon.position.set(h+9+9,s),this.goldText.position.set(this.goldIcon.x+9+5,s-this.goldText.height/2),this.pearlIcon.position.set(this.goldText.x+Math.max(36,this.goldText.width)+12+9,s),this.pearlText.position.set(this.pearlIcon.x+9+5,s-this.pearlText.height/2),this.walletBg.clear().roundRect(h,e,this.pearlText.x+Math.max(12,this.pearlText.width)+10-h,28,9).fill(Ixi)} - drawBattle(){ - const i=t.fullscreen; - if(this.battleBg.visible=this.battleIcon.visible=this.battleText.visible=i,!i)return void(this.battleSig=""); - const s=this.isCastleDown(),e=s&&Math.floor(performance.now()/500)%2==0,n=`${ - TG.wave.toLocaleString()} - 층`,h=`${ - n} - |${ - s} - |${ - e} - |${ - t.WIDTH} - |${ - this.devToggle.visible} - |${ - this.minimizeBtn.visible} - `; - if(h===this.battleSig)return; - this.battleSig=h,this.battleText.text=n,this.battleText.textColor=s?e?16739179:16777215:Bxi; - const r=t.HEADER/2,o=s?5906207:Ixi,a=this.devToggle.visible?this.devToggle.x-8:(this.minimizeBtn.visible?this.minimizeBtn.x:this.close.x)+4,c=32+this.battleText.width+10,l=a-c; - this.battleBg.clear().roundRect(l,r-14,c,28,9).fill(o); - const u=l+10,d=r-8,f=s?16739179:Uxi; - this.battleIcon.clear().rect(u,d+5,16,11).fill(f).rect(u,d+1,4,5).fill(f).rect(u+6,d+1,4,5).fill(f).rect(u+12,d+1,4,5).fill(f).roundRect(u+5.5,d+9,5,7,2.5).fill(o),this.battleText.position.set(u+16+6,r-this.battleText.height/2)} - isCastleDown(){ - try{ - return this.castleDown()} - catch{ - return!1} - } - pulse(t){ - const i="gold"===t?this.goldIcon:this.pearlIcon; - yx.killTweensOf(i.scale),yx.fromTo(i.scale,{ - x:1.4,y:1.4} - ,{ - x:1,y:1,duration:.35,ease:"back.out(3)"} - )} - flyCurrency(t,i,s=7){ - if(!this.parent)return; - const e="gold"===t?this.goldIcon:this.pearlIcon,n=this.toLocal(i); - for(let h=0; - h<s; - h++){ - const i=pRi(t,20); - i.pivot.set(10,10),i.position.set(n.x,n.y),this.fxLayer.addChild(i); - const r=h/s*Math.PI*2+.6*Math.random(),o=26+30*Math.random(); - yx.timeline({ - delay:.035*h,onComplete:Qt(()=>{ - i.destroy(),this.pulse(t),0===h&&QG.getInstance().playSFX(QG.SFX_GOLD_GOBLIN,.4)} - ,"onComplete")} - ).fromTo(i.scale,{ - x:.4,y:.4} - ,{ - x:1,y:1,duration:.2} - ,0).to(i,{ - x:n.x+Math.cos(r)*o,y:n.y+Math.sin(r)*o*.7,duration:.24,ease:"power2.out"} - ,0).to(i,{ - x:e.x,y:e.y,duration:.46,ease:"power2.in"} - ,.26).to(i.scale,{ - x:.7,y:.7,duration:.46} - ,.26)} - } - setFullscreen(i){ - var s; - if(t.fullscreen!==i){ - this.setImmersed(!1,!0),t.fullscreen=i,TF.getInstance().visible=!i,this.width=t.WIDTH,this.onResize(); - for(const t of this.overlay.children)null==(s=t.layout)||s.call(t)} - } - pageSpan(){ - var i; - return t.fullscreen&&(null==(i=this.activePage)?void 0:i.fullBleed)?{ - x:0,w:t.BLEED_W} - :{ - x:t.CONTENT_X,w:t.CONTENT_W} - } - refresh(){ - var i; - const s=t.WIDTH,e=t.layoutHeight,n=t.fullscreen; - this.height=e; - const h=e-t.FOOTER; - n?this.paper.clear().rect(0,0,s,e).fill(Cxi):this.paper.clear().roundRect(0,0,s,e,20).fill(Cxi).stroke({ - color:Lxi,width:2} - ),this.pageBg.clear().rect(n?0:2,t.HEADER,n?s:s-4,t.footerTop-t.HEADER).fill(Oxi),this.overlay.position.set(t.CONTENT_X,t.CONTENT_Y),this.wake.hitArea=new $i(0,0,s,e),this.chrome.clear().moveTo(24,t.footerTop).lineTo(s-24,t.footerTop).stroke({ - color:Lxi,width:1} - ),this.subSig=""; - const r=t.HEADER/2; - this.walletSig="",this.battleSig="",this.close.position.set(s-56,r-24),this.minimizeBtn.position.set(s-56-44,r-24); - const o=this.minimizeBtn.visible?this.minimizeBtn.x:this.close.x; - this.devToggle.position.set(o-8-56,r-13),[this.speedChip,this.dayChip,this.tideChip,this.boatChip,this.goldChip,this.botsChip,this.journeyChip,this.giantChip,this.badgeChip,this.raidChip,this.robbedChip,this.cutChip,this.breakChip,this.hazardChip,this.fixChip,this.brokenDummyChip,this.huntChip,this.huntCrowdChip,this.gearChip,this.netChip,this.resetChip].forEach((t,i)=>t.position.set(i%4*68,30*Math.floor(i/4))),this.devRow.position.set(s-16-266,t.CONTENT_Y+54); - const a=(s-28-5*(yPi.length-1))/yPi.length,c=(null==(i=this.activePage)?void 0:i.tabId)??null,l=c!==this.tabDrawn; - this.tabDrawn=c,this.tabButtons.forEach(({ - id:t,root:i,bg:s,icon:e,name:n,dot:r} - ,o)=>{ - i.position.set(14+o*(a+5),h+8),i.hitArea=new $i(0,-10,a,82); - const u=c===t; - s.clear(),u&&s.roundRect((a-88)/2,2,88,72,16).fill(Ixi),e.refresh(),e.setTone(u?Dxi:Uxi,u?16777215:12369084),n.visible=u,n.position.set((a-n.width)/2,52); - const d=u?18:30,f=u?1:.875; - e.x=a/2,yx.killTweensOf(e),yx.killTweensOf(e.scale),yx.killTweensOf(n),l&&u?(yx.fromTo(e,{ - y:30} - ,{ - y:d,duration:.2,ease:"back.out(2.4)"} - ),yx.fromTo(e.scale,{ - x:.875,y:.875} - ,{ - x:f,y:f,duration:.2,ease:"back.out(2.4)"} - ),yx.fromTo(n,{ - alpha:0} - ,{ - alpha:1,duration:.15,delay:.05} - )):(e.y=d,e.scale.set(f),n.alpha=1),r.position.set(a/2+26,(u?18:30)-26)} - ),this.updateHeader(),this.layoutPageArea(),this.resetPostionY(),this.parent&&this.position.set(320,this.getDefaultPositionY())} - scrollToShow(i){ - const s=i.getBounds(),e=this.pages.toLocal({ - x:s.x,y:s.y} - ).y; - this.scrollY=e-.35*t.contentHeight,this.updateScroll()} - point(t,i){ - this.endPoint(); - const s=new ep,e=new Ke,n=Jxi(i,Gxi,14),h=(new ep).roundRect(0,0,n.width+20,n.height+10,10).fill(Dxi); - n.position.set(10,5),e.addChild(h,n),this.fxLayer.addChild(s,e),this.pointer={ - node:t,g:s,tag:e,t0:performance.now()} - ,Mn.shared.add(this.drawPoint,this),this.drawPoint()} - drawPoint(){ - const i=this.pointer; - if(!i)return; - const s=performance.now()-i.t0; - let e=!i.node.destroyed,n=i.node; - for(; - e&&n&&n!==this; - n=n.parent)n.visible||(e=!1); - if(n!==this&&(e=!1),!e||s>5e3)return void this.endPoint(); - const h=i.node.getBounds(),r=this.toLocal({ - x:h.x,y:h.y} - ),o=this.toLocal({ - x:h.x+h.width,y:h.y+h.height} - ),a=.55+.45*Math.abs(Math.sin(s/260)); - i.g.clear().roundRect(r.x-5,r.y-5,o.x-r.x+10,o.y-r.y+10,12).stroke({ - color:Dxi,width:4,alpha:a} - ),i.tag.position.set(Math.max(8,Math.min(t.WIDTH-i.tag.width-8,(r.x+o.x)/2-i.tag.width/2)),r.y-i.tag.height-12),i.tag.alpha=Math.min(1,s/150)} - endPoint(){ - this.pointer&&(Mn.shared.remove(this.drawPoint,this),this.pointer.g.destroy(),this.pointer.tag.destroy({ - children:!0} - ),this.pointer=null)} - resetScroll(){ - this.scrollY=0,this.updateScroll()} - maxScroll(){ - var i,s; - return!1===(null==(i=this.activePage)?void 0:i.scrollInShell)?0:Math.max(0,((null==(s=this.activePage)?void 0:s.getLocalBounds().maxY)??0)+12-t.contentHeight)} - updateScroll(){ - const i=this.maxScroll(),s=t.contentHeight; - if(this.scrollY=Math.max(0,Math.min(i,this.scrollY)),this.pages.y=t.contentTop-this.scrollY,this.pages.hitArea=new $i(0,this.scrollY,this.pageSpan().w,s),this.scrollTrack.clear(),i>0){ - const e=Math.max(28,s*s/(s+i)); - this.scrollTrack.roundRect(t.WIDTH-12,t.contentTop+(s-e)*this.scrollY/i,3,e,1.5).fill({ - color:Fxi,alpha:.65} - )} - } - moveScroll(t){ - if(!this.drag||this.drag.id!==t.pointerId||this.maxScroll()<=0)return; - const i=this.toLocal(t.global).y-this.drag.y; - Math.abs(i)>6&&(this.dragged=!0),this.dragged&&(this.scrollY=this.drag.scroll-i,this.updateScroll())} - requestExit(){ - var t,i,s,e; - const n=this.overlay.children[this.overlay.children.length-1]; - (null==(t=null==n?void 0:n.closeOne)?void 0:t.call(n))||(null==(s=null==(i=this.activePage)?void 0:i.closeOne)?void 0:s.call(i))?this.drawBack():this.backStack.length?this.goBack():!this.activePage||"fish"===this.activePage.tabId||this.exchangeOnly?(this.hideImmediately(),null==(e=this.onExit)||e.call(this)):this.selectTab("fish","user")} - async minimize(){ - if(this.parent&&!this.minimizing&&!this.exchangeOnly&&!this.tutorialMode){ - this.minimizing=!0; - try{ - const{ - FishingMiniWindow:t} - =await ei(async()=>{ - const{ - FishingMiniWindow:t} - =await Promise.resolve().then(()=>EVi); - return{ - FishingMiniWindow:t} - } - ,void 0); - if(!this.parent)return; - const i=t.capture(); - this.hideImmediately(),ixi.getInstance().open=!0,t.getInstance().show(i)} - finally{ - this.minimizing=!1} - } - } - hideImmediately(){ - var t; - this.setFullscreen(!1),this.timer.stop(),SS.stage.off("resized",this.onResize),this.drag=null; - for(const i of this.unsubscribe)i(); - this.unsubscribe=[],null==(t=this.activePage)||t.onHide(),this.pages.removeChildren(),this.overlay.removeChildren(),this.activePage=null,this.backStack=[],this.backNow=null,this.walletSig="",ixi.getInstance().active=!1,ixi.getInstance().flushHooks(),ixi.getInstance().open=!1,super.hideImmediately()} - getDefaultPositionY(){ - return SS.safeHeight/2} - onBackButton(){ - return this.requestExit(),!0} - } - ; - Qt(EPi,"FishingShell"),Zt(EPi,"instance"),Zt(EPi,"fullscreen",!1),Zt(EPi,"HEADER",52),Zt(EPi,"FOOTER",84),Zt(EPi,"SUB_BAR",62),Zt(EPi,"subOn",!1),Zt(EPi,"CONTENT_Y",56),Zt(EPi,"CONTENT_W",568),Zt(EPi,"IMMERSE_AFTER_MS",3e4),Zt(EPi,"immersion",0); - let APi=EPi; - const SPi=[398,307],TPi={ - "인간":[[387,317],[363,343],[337,363],[310,383]],"엘프":[[410,317],[443,330],[477,350]],"언데드":[[413,297],[450,263],[477,240]],"오크":[[380,300],[350,270],[323,233]]} - ,CPi={ - "인간":[[277,413],[250,437],[217,463],[193,490]],"엘프":[[543,387],[577,400],[610,420],[630,437]],"언데드":[[517,205],[547,183],[577,160]],"오크":[[270,193],[243,173],[217,150],[200,135]]} - ; - function OPi(t,i,s){ - const e=Qt((i,s)=>{ - const e=t[`${ - i} - |${ - s} - `]??[.5,.5]; - return[800*e[0],600*e[1]]} - ,"p"),n=Qt(t=>{ - const i=[...TPi[t]],s={ - } - ; - return s.R=i.push(e(t,"R"))-1,i.push(...CPi[t]),s.C=i.push(e(t,"C"))-1,s.O=i.push(e(t,"O"))-1,{ - pts:i,at:s} - } - ,"spoke"),h=n(i.race),r=n(s.race),o=h.at[i.zone],a=r.at[s.zone]; - if(i.race===s.race)return o===a?[h.pts[o],h.pts[o]]:o<a?h.pts.slice(o,a+1):h.pts.slice(a,o+1).reverse(); - if("R"===i.zone||"R"===s.zone)return[...h.pts.slice(0,o+1).reverse(),SPi,...r.pts.slice(0,a+1)]; - const c=h.pts.slice(h.at.C,o+1).reverse(),l=Qt(t=>Math.atan2((t[1]-SPi[1])/268,(t[0]-SPi[0])/362),"ang"),u=l(e(i.race,"C")); - let d=l(e(s.race,"C"))-u; - for(; - d>Math.PI; - )d-=2*Math.PI; - for(; - d<=-Math.PI; - )d+=2*Math.PI; - const f=Math.max(3,Math.ceil(Math.abs(d)/(Math.PI/12))); - for(let p=1; - p<f; - p++){ - const t=u+d*p/f; - c.push([SPi[0]+362*Math.cos(t),SPi[1]+268*Math.sin(t)])} - return c.push(...r.pts.slice(r.at.C,a+1)),c} - function IPi(t){ - const i=[t[0],...t,t[t.length-1]],s=[]; - for(let n=1; - n<i.length-2; - n++){ - const t=i[n-1],e=i[n],h=i[n+1],r=i[n+2]; - for(let i=0; - i<16; - i++){ - const n=i/16,o=n*n,a=o*n,c=Qt(i=>.5*(2*e[i]+(-t[i]+h[i])*n+(2*t[i]-5*e[i]+4*h[i]-r[i])*o+(-t[i]+3*e[i]-3*h[i]+r[i])*a),"f"); - s.push([c(0),c(1)])} - } - s.push(t[t.length-1]); - const e=[0]; - for(let n=1; - n<s.length; - n++)e.push(e[n-1]+Math.hypot(s[n][0]-s[n-1][0],s[n][1]-s[n-1][1])); - return{ - pts:s,L:e,len:e[e.length-1]} - } - Qt(OPi,"travelRoute"),Qt(IPi,"sampleRoute"); - const kPi=Qt((t,i=0,s=1)=>t<i?i:t>s?s:t,"clamp$3"); - function xPi(t,i){ - const s=kPi(i)*t.len; - let e=1; - for(; - e<t.pts.length-1&&t.L[e]<s; - )e++; - const n=t.pts[e-1],h=t.pts[e],r=kPi((s-t.L[e-1])/Math.max(1e-6,t.L[e]-t.L[e-1])); - return{ - x:n[0]+(h[0]-n[0])*r,y:n[1]+(h[1]-n[1])*r,ang:Math.atan2(h[1]-n[1],h[0]-n[0])} - } - function RPi(t,i){ - const s=kPi(i)*t.len,e=[t.pts[0]]; - for(let h=1; - h<t.pts.length&&t.L[h]<=s; - h++)e.push(t.pts[h]); - const n=xPi(t,i); - return e.push([n.x,n.y]),e} - Qt(xPi,"routeAt"),Qt(RPi,"routeUpTo"); - const PPi=Qt(t=>kPi(.5+.0035*t,1.1,1.9),"travelVoyage"),NPi=Qt(t=>.75+t,"travelArrive"),LPi=Qt(t=>NPi(t)+1.6,"travelTotal"),DPi=Qt(t=>NPi(t)+.7,"travelUnblock"),GPi={ - outQuad:Qt(t=>1-(1-t)*(1-t),"outQuad"),inQuad:Qt(t=>t*t,"inQuad"),outCubic:Qt(t=>1-(1-t)**3,"outCubic"),inOutSine:Qt(t=>(1-Math.cos(Math.PI*t))/2,"inOutSine"),outBack:Qt(t=>1+2.70158*(t-1)**3+1.70158*(t-1)**2,"outBack")} - ,BPi=Qt((t,i,s)=>kPi((t-i)/(s-i)),"prog"),UPi=Qt((t,i,s)=>t+(i-t)*s,"lerp$2"); - function FPi(t,i){ - const s=NPi(i),e=t<s+.3?.55*GPi.outQuad(BPi(t,0,.3)):.55*(1-GPi.outQuad(BPi(t,s+.3,s+.7))),n=BPi(t,.1,.45),h=BPi(t,s+.3,s+.7); - return{ - dim:e,card:{ - o:Math.min(GPi.outQuad(n),1-GPi.inQuad(h)),y:40*(1-GPi.outBack(n))+30*GPi.inQuad(h),s:UPi(.94,1,kPi(GPi.outBack(n),0,1.2))} - ,draw:GPi.outQuad(BPi(t,.45,.75)),sail:GPi.inOutSine(BPi(t,.75,s)),sailing:t>=.75,ring:t>=s?BPi(t,s,s+.35):-1,pillTo:{ - o:GPi.outQuad(BPi(t,.65,.8)),s:t>=s?UPi(1.2,1,GPi.outBack(BPi(t,s,s+.25))):1} - ,live:GPi.outQuad(BPi(t,s+.3,s+.7)),boatBack:1-GPi.outCubic(BPi(t,s+.35,s+.95)),banner:BPi(t,s+.55,s+.75)*(1-BPi(t,s+1.3,s+1.6))} - } - Qt(FPi,"travelPose"); - const $Pi=Qt((t,i,s)=>s?t:Math.min(t,NPi(i)),"travelClock"),HPi=Qt((t,i,s)=>s&&t<NPi(i)?NPi(i):t,"travelSkip"); - function WPi(t){ - const i=t.charCodeAt(t.length-1)-44032; - if(i<0||i>11171)return"(으)로"; - const s=i%28; - return 0===s||8===s?"로":"으로"} - Qt(WPi,"ro"); - const VPi=class t{ - constructor(t){ - Zt(this,"root",new Ke),Zt(this,"snap",null),Zt(this,"dim",new ep),Zt(this,"card",new Ke),Zt(this,"win",new Ke),Zt(this,"routeG",new ep),Zt(this,"pins",new ep),Zt(this,"ring",new ep),Zt(this,"wake",new ep),Zt(this,"boat"),Zt(this,"pillTo",new Ke),Zt(this,"banner",new Ke),Zt(this,"route"),Zt(this,"V"),Zt(this,"geom",{ - x:0,y:0,s:1} - ),Zt(this,"k"),Zt(this,"W"),Zt(this,"H"),Zt(this,"t0",performance.now()),Zt(this,"t",0),Zt(this,"result"),Zt(this,"glided",!1),Zt(this,"closing",-1),Zt(this,"resolveDone"),Zt(this,"done",new Promise(t=>this.resolveDone=t)),this.o=t; - const i=APi.getInstance(); - this.W=APi.WIDTH,this.H=APi.layoutHeight,this.k=APi.BLEED_W/430; - const s=NAi.world(); - this.route=IPi(OPi(s.pins,t.from,t.to)),this.V=PPi(this.route.len); - try{ - const t=FS.app.renderer.generateTexture({ - target:i,frame:new $i(0,0,this.W,this.H)} - ); - this.snap=new Xe(t)} - catch{ - this.snap=null} - this.dim.rect(0,0,this.W,this.H).fill(133132),this.boat=new Xe(NAi.boat(t.boatLv)),this.build(),this.snap&&this.root.addChild(this.snap),this.root.addChild(this.dim,this.card,this.banner),this.root.eventMode="static",this.root.hitArea=new $i(0,0,this.W,this.H),this.root.on("pointertap",t=>{ - t.stopPropagation(),this.skip()} - ),i.addChild(this.root),t.wait.then(t=>{ - this.result=t} - ,()=>{ - this.result="옮기지 못했어요"} - ),FS.app.ticker.add(this.tick,this),this.tick()} - static get active(){ - return!!this.current} - static play(i){ - var s; - null==(s=this.current)||s.finish(); - const e=new t(i); - return this.current=e,e.done} - build(){ - const t=this.k,i=this.o.from,s=this.o.to,e=356*t,n=230*t,h=12*t,r=e+2*h,o=n+2*h+30*t,a=this.route.pts.map(t=>t[0]),c=this.route.pts.map(t=>t[1]),l=Math.min(...a),u=Math.max(...a),d=Math.min(...c),f=Math.max(...c),p=Math.max(u-l+124,(f-d+124)*e/n),w=p*n/e; - this.geom={ - x:(l+u)/2-p/2,y:(d+f)/2+6-w/2,s:e/p} - ; - const g=(new ep).roundRect(0,0,r,o,16*t).fill(Vxi),m=new Xe(ls.EMPTY); - NAi.worldMap().then(t=>{ - m.texture=t,m.width=800*this.geom.s,m.scale.y=m.scale.x,m.position.set(-this.geom.x*this.geom.s,-this.geom.y*this.geom.s)} - ); - const v=(new ep).roundRect(0,0,e,n,10*t).fill(16777215); - this.win.addChild(m,this.routeG,this.wake,this.pins,this.ring,this.boat,v),this.win.mask=v,this.win.position.set(h,h),this.boat.anchor.set(.5),this.boat.width=this.boat.height=40*t; - const _=this.px(this.route.pts[0]),M=this.px(this.route.pts[this.route.pts.length-1]),b=Qt((i,s)=>Math.max(4*t,Math.min(e-4*t-s,i)),"inX"),y=this.pill(GTi(i.race,i.zone,i.point),16777215),E=_.y+12*t+y.height>n-4*t?_.y-12*t-y.height:_.y+12*t; - y.position.set(b(_.x-y.width/2,y.width),E); - const A=this.pill(GTi(s.race,s.zone,s.point),Dxi),S=M.y-12*t-A.height<4*t; - A.pivot.set(A.width/2,S?0:A.height),A.position.set(b(M.x-A.width/2,A.width)+A.width/2,S?M.y+12*t:M.y-12*t),this.pillTo.addChild(A),this.win.addChild(y,this.pillTo); - const T=GTi(i.race,i.zone,i.point),C=GTi(s.race,s.zone,s.point),O=Jxi(`${ - T} - 에서`,Uxi,13*t),I=Jxi(`${ - C} - ${ - WPi(C)} - 가는 중`,Bxi,13*t); - O.position.set(h+4*t,h+n+8*t),I.position.set(r-h-4*t-I.width,h+n+8*t),this.card.addChild(g,this.win,O,I),this.card.pivot.set(r/2,o/2),this.card.position.set(this.W/2,.262*this.H+o/2); - const k=Jxi(C,16777215,17*t),x=new Ke,R=Jxi(s.race,16777215,12*t),P=(new ep).roundRect(0,0,R.width+14*t,R.height+4*t,8*t).fill(Xxi[s.race]??Dxi); - R.position.set(7*t,2*t),x.addChild(P,R); - const N=k.width+x.width+40*t,L=Math.max(k.height,x.height)+16*t,D=(new ep).roundRect(0,0,N,L,14*t).fill({ - color:Vxi,alpha:.88} - ); - k.position.set(16*t,(L-k.height)/2),x.position.set(16*t+k.width+8*t,(L-x.height)/2),this.banner.addChild(D,k,x),this.banner.position.set((this.W-N)/2,.167*this.H)} - pill(t,i){ - const s=this.k,e=new Ke,n=Jxi(t,i,12*s),h=(new ep).roundRect(0,0,n.width+18*s,n.height+6*s,10*s).fill({ - color:659990,alpha:.86} - ); - return n.position.set(9*s,3*s),e.addChild(h,n),e} - px(t){ - const i=Array.isArray(t)?t[0]:t.x,s=Array.isArray(t)?t[1]:t.y; - return{ - x:(i-this.geom.x)*this.geom.s,y:(s-this.geom.y)*this.geom.s} - } - get ready(){ - return null===this.result&&this.o.mapReady()} - skip(){ - const i=HPi(this.t,this.V,this.ready); - i!==this.t&&(this.t0-=1e3*(i-this.t)/t.speed)} - tick(){ - var i,s; - if("string"==typeof this.result){ - this.closing<0&&(this.closing=performance.now()); - const t=Math.min(1,(performance.now()-this.closing)/250); - return this.root.alpha=1-t,void(t>=1&&this.finish())} - const e=(performance.now()-this.t0)/1e3*t.speed,n=this.t=$Pi(e,this.V,this.ready); - n<e&&(this.t0=performance.now()-1e3*n/t.speed); - const h=FPi(n,this.V),r=this.k,o=NPi(this.V); - this.snap&&(this.snap.alpha=1-h.live),this.dim.alpha=h.dim,this.card.alpha=h.card.o,this.card.scale.set(h.card.s),this.card.y=.262*this.H+this.card.pivot.y+h.card.y*r; - const a=this.routeG.clear(); - if(this.dashes(a,RPi(this.route,h.draw),5*r,6*r),a.stroke({ - color:16777215,width:2.5*r,cap:"round"} - ),h.sailing&&h.sail>0){ - const t=RPi(this.route,h.sail).map(t=>this.px(t)); - a.moveTo(t[0].x,t[0].y); - for(const i of t.slice(1))a.lineTo(i.x,i.y); - a.stroke({ - color:Dxi,width:3.5*r,cap:"round",join:"round"} - )} - const c=this.px(this.route.pts[0]),l=this.px(this.route.pts[this.route.pts.length-1]); - this.pins.clear().circle(c.x,c.y,5*r).fill(15921908),h.draw>.85&&this.pins.circle(l.x,l.y,6*r).fill(Dxi),this.ring.clear(),h.ring>=0&&this.ring.circle(l.x,l.y,(6+20*(1-(1-h.ring)**2))*r).stroke({ - color:Dxi,width:3*r,alpha:.9*(1-h.ring)} - ); - const u=xPi(this.route,h.sail),d=this.px(u),f=1.2*Math.sin(9*n)*r; - if(this.boat.visible=h.sailing,this.boat.position.set(d.x,d.y+f),this.boat.rotation=u.ang+Math.PI/2,this.wake.clear(),h.sailing&&h.sail<.999)for(let t=0; - t<3; - t++){ - const i=this.px(xPi(this.route,h.sail-.035*(t+1))); - this.wake.circle(i.x,i.y,3*r).fill({ - color:15334399,alpha:.7-.2*t} - )} - this.pillTo.alpha=h.pillTo.o,this.pillTo.scale.set(h.pillTo.s),this.banner.alpha=h.banner,!this.glided&&n>=o+.35&&(this.glided=!0,null==(s=(i=this.o).onGlide)||s.call(i,xPi(this.route,1).ang)),this.root.eventMode=n<DPi(this.V)?"static":"none",n>=LPi(this.V)&&this.finish()} - dashes(t,i,s,e){ - let n=!0,h=s; - for(let r=1; - r<i.length; - r++){ - let o=this.px(i[r-1]); - const a=this.px(i[r]); - let c=Math.hypot(a.x-o.x,a.y-o.y); - for(; - c>0; - ){ - const i=Math.min(c,h),r=i/c,l={ - x:o.x+(a.x-o.x)*r,y:o.y+(a.y-o.y)*r} - ; - n&&t.moveTo(o.x,o.y).lineTo(l.x,l.y),o=l,c-=i,h-=i,h<=1e-6&&(n=!n,h=n?s:e)} - } - } - finish(){ - var i; - t.current===this&&(t.current=null),FS.app.ticker.remove(this.tick,this); - const s=null==(i=this.snap)?void 0:i.texture; - this.root.destroy({ - children:!0} - ),null==s||s.destroy(!0),this.resolveDone()} - } - ; - Qt(VPi,"FishingTravelFx"),Zt(VPi,"speed",1),Zt(VPi,"current",null); - let jPi=VPi; - function KPi(t,i,s){ - const e=new Ke,n=Jxi(t,i,13),h=new ep; - return h.roundRect(0,0,n.width+20,26,13).fill(s),n.position.set(10,(26-n.height)/2),e.addChild(h,n),e.eventMode="none",e} - function zPi(t,i=16){ - const s=new Ke; - let e=0; - for(const n of t){ - if(n.icon){ - const t=nxi(n.icon,18,Uxi,2.2); - t.position.set(e,0),s.addChild(t),e+=24} - const t=Jxi(n.text,n.color??Bxi,14,!1); - t.position.set(e,(18-t.height)/2+1),s.addChild(t),e+=t.width+i} - return s.eventMode="none",s} - function YPi(t,i,s){ - const e=new Ke,n=MTi[`${ - t.race} - |${ - t.zone} - `],h=i?`${ - n} - · 잡아 봐야 알아요`:t.roam?`${ - n} - · 날마다 바뀌는 곳 (회유)`:t.pts.length>=9?`${ - n} - 어디서나`:`${ - n} - · ${ - t.pts.slice(0,2).map(i=>GTi(t.race,t.zone,i)).join(", ")} - ${ - t.pts.length>2?` 외 ${ - t.pts.length-2} - 곳`:""} - `,r=[["depth","깊이","O"===t.zone&&"B"===t.depth?"심해":mTi[t.depth]],["clock","시간","전체"===t.tide?"모든 시간대":_Ti[vTi.indexOf(t.tide)]],["map","위치",h]],o=20+34*r.length; - return e.addChild(eRi(s,o,Pxi,null,12)),r.forEach(([t,n,h],r)=>{ - const o=10+34*r,a=nxi(t,18,Uxi,2.2),c=Jxi(n,Uxi,12),l=Jxi(h,i&&"map"===t?Uxi:Bxi,14); - a.position.set(14,o+8),c.position.set(40,o+(34-c.height)/2),l.position.set(84,o+(34-l.height)/2),sRi(l,s-84-14),e.addChild(a,c,l)} - ),e.eventMode="none",e} - Qt(KPi,"tagChip"),Qt(zPi,"factRow"),Qt(YPi,"habitatInfo"); - const qPi=APi.CONTENT_W,XPi=["net","aquarium","dex"],JPi=["어망","어항","도감"],QPi=qPi/6,ZPi=80,tNi=class t extends kx{ - constructor(){ - super(),Zt(this,"cells",[]),Zt(this,"headTitle",Jxi("",Bxi,Qxi)),Zt(this,"headHint",Jxi("",Uxi,Zxi,!1)),Zt(this,"row",null); - const i=(new ep).rect(0,0,qPi,t.H).fill({ - color:0,alpha:.001} - ); - i.eventMode="none",this.addChild(i,this.headTitle,this.headHint); - for(let s=0; - s<6; - s++){ - const i=new Ke,e=new ep,n=new hRi(ZPi,!1,!0),h=pRi("gold",14),r=Jxi("",Uxi,Zxi,!1); - e.roundRect(1.5,0,QPi-3,t.H-2,14).fill(jxi),e.eventMode="none",n.position.set((QPi-ZPi)/2,8),i.addChild(e,n,h,r),i.position.set(s*QPi,0),i.eventMode="static",i.cursor="pointer",i.hitArea=new $i(0,0,QPi,t.H),i.on("pointertap",t=>{ - var i,e,n,h; - t.stopPropagation(); - const r=null==(e=null==(i=this.row)?void 0:i.items)?void 0:e[s]; - r&&(null==(h=(n=this.row).onPick)||h.call(n,r))} - ),this.addChild(i),this.cells.push({ - root:i,tile:e,card:n,coin:h,under:r} - )} - } - setData(i){ - this.row=i; - const s=i.head; - if(this.headTitle.visible=this.headHint.visible=!!s,s){ - this.headTitle.text=s.title,this.headHint.text=s.hint; - const i=t.H-this.headTitle.height-10; - this.headTitle.position.set(4,i),this.headHint.position.set(this.headTitle.x+this.headTitle.width+8,i+(this.headTitle.height-this.headHint.height)/2+1),sRi(this.headHint,qPi-this.headHint.x-4)} - this.cells.forEach((t,s)=>{ - var e; - const n=null==(e=i.items)?void 0:e[s]; - if(t.root.visible=!!n,!n)return; - const h="on"===n.check,r="lock"===n.check,o="price"===i.under&&!r; - t.tile.visible=h,t.card.set(n.c.id,DTi(n.c.id).star,n.c.grade),t.card.setFade(r?.4:1),t.card.setMark(h?"on":r?"lock":!n.check&&n.quest?"quest":null,h?jxi:Oxi),t.coin.visible=o,t.under.text=r?"의뢰":o?TSi(vki(n.c),ixi.getInstance().state).toLocaleString():TCi(n.c.kg),t.under.textColor=h?Dxi:Uxi,sRi(t.under,QPi-26); - const a=(o?17:0)+t.under.width,c=(QPi-a)/2; - t.coin.position.set(c,93+(t.under.height-14)/2),t.under.position.set(c+(o?17:0),93)} - )} - } - ; - Qt(tNi,"FishGridRow"),Zt(tNi,"H",116); - let iNi=tNi; - const sNi=qPi/6,eNi=class t extends kx{ - constructor(){ - super(),Zt(this,"cells",[]),Zt(this,"row",null); - const i=(new ep).rect(0,0,qPi,t.H).fill({ - color:0,alpha:.001} - ); - i.eventMode="none",this.addChild(i); - for(let s=0; - s<6; - s++){ - const i=new Ke,e=new hRi(72,!1,!0); - e.position.set((sNi-72)/2,6),i.addChild(e),i.position.set(s*sNi,0),i.eventMode="static",i.cursor="pointer",i.hitArea=new $i(0,0,sNi,t.H),i.on("pointertap",t=>{ - var i; - t.stopPropagation(); - const e=null==(i=this.row)?void 0:i.items[s]; - e&&this.row.onPick(e.s.id)} - ),this.addChild(i),this.cells.push({ - root:i,card:e} - )} - } - setData(t){ - this.row=t,this.cells.forEach((i,s)=>{ - const e=t.items[s]; - if(i.root.visible=!!e,!e)return; - const n=e.d??e.past; - i.card.set(e.s.id,e.s.star,n?vCi(n.bestR):0,!n),i.card.setFade(!e.d&&e.past?.45:1)} - )} - } - ; - Qt(eNi,"DexRow"),Zt(eNi,"H",88); - let nNi=eNi; - function hNi(t,i,s,e,n,h,r){ - const o=new cRi("",s,e,n); - o.setPrimary(h),o.enabled=r; - const a=r?h?Gxi:Bxi:Kxi,c=Jxi(t,a,n),l=pRi("gold",n+2),u=Jxi(i.toLocaleString(),a,n-1); - l.alpha=r?1:.5; - let d=(s-(c.width+8+l.width+5+u.width))/2; - return c.position.set(d,(e-c.height)/2),d+=c.width+8,l.position.set(d,(e-l.height)/2),d+=l.width+5,u.position.set(d,(e-u.height)/2),o.addChild(c,l,u),o} - Qt(hNi,"coinButton"); - const rNi=[{ - v:1,text:"흔한 것만"} - ,{ - v:2,text:"보통까지"} - ,{ - v:3,text:"드문 것까지"} - ],oNi=[{ - v:0,text:"C 보통"} - ,{ - v:1,text:"B 대 이하"} - ],aNi=104,cNi=42,lNi=[{ - v:"full",text:"어망이 차면"} - ,{ - v:"catch",text:"잡자마자"} - ],uNi=[{ - v:1,text:"흔한 것만"} - ,{ - v:2,text:"보통까지"} - ,{ - v:3,text:"드문 것까지"} - ],dNi=[{ - v:0,text:"C 보통"} - ,{ - v:1,text:"B 대 이하"} - ],fNi=class t extends Ke{ - constructor(){ - super(),Zt(this,"tabId","tank"),Zt(this,"view","net"),Zt(this,"scrollInShell",!1),Zt(this,"netLayer",new Ke),Zt(this,"netHead",new iRi(qPi)),Zt(this,"sellBtn",new cRi("팔기",aNi,cNi,Qxi)),Zt(this,"sellGlow",new ep),Zt(this,"glowTween",null),Zt(this,"cutBtn",new cRi("줄 끊기",aNi,cNi,Qxi)),Zt(this,"autoBtn",new Ke),Zt(this,"autoBg",new ep),Zt(this,"autoText",Jxi("자동 팔기",Uxi,14)),Zt(this,"autoSwitch",new ep),Zt(this,"autoDrawn",""),Zt(this,"autoPanel",new Ke),Zt(this,"autoDraft",{ - ...yki} - ),Zt(this,"autoBusy",!1),Zt(this,"netEmpty",Jxi("어망이 비었어요. 잡은 물고기는 모두 여기에 담겨요.",Uxi,Zxi,!1)),Zt(this,"netList",new Ox(iNi,qPi,400,0)),Zt(this,"detail",new Ke),Zt(this,"card",null),Zt(this,"sheet",new Ke),Zt(this,"sheetOpen",!1),Zt(this,"sheetBg",new ep),Zt(this,"sheetBack",new Ke),Zt(this,"sheetTitle",Jxi("물고기 팔기",Bxi,24)),Zt(this,"allChip",new oRi("모두 고르기",150,40,14)),Zt(this,"starLb",Jxi("별",Uxi,14)),Zt(this,"sizeLb",Jxi("크기",Uxi,14)),Zt(this,"sizeNote",Jxi("특대·왕은 눌러서만",Uxi,Zxi,!1)),Zt(this,"starChips",rNi.map(t=>new oRi(t.text,120,38,15))),Zt(this,"sizeChips",oNi.map(t=>new oRi(t.text,120,38,15))),Zt(this,"sellList",new Ox(iNi,qPi,300,0)),Zt(this,"barBg",new ep),Zt(this,"barN",Jxi("",Uxi,Zxi)),Zt(this,"barCoin",pRi("gold",24)),Zt(this,"barGold",Jxi("",Dxi,24)),Zt(this,"barEmpty",Jxi("",Uxi,Qxi)),Zt(this,"barEmptySub",Jxi("위 칩으로 한꺼번에 · 눌러서 하나씩",Uxi,Zxi,!1)),Zt(this,"barSell",new cRi("팔기",200,60,19)),Zt(this,"pickStar",0),Zt(this,"pickSize",-1),Zt(this,"pickAll",!1),Zt(this,"pickAdd",new Set),Zt(this,"pickDel",new Set),Zt(this,"selling",!1),Zt(this,"confirm",new Ke),Zt(this,"aqLayer",new Ke),Zt(this,"dexLayer",new Ke),Zt(this,"raceChips",["전체",...fTi].map(t=>new oRi(t,108,36,14))),Zt(this,"zoneChips",["전체",...pTi.map(t=>gTi[t])].map(t=>new oRi(t,130,36,14))),Zt(this,"dexHead",new iRi(qPi)),Zt(this,"dexList",new Ox(nNi,qPi,300,0)),Zt(this,"raceFilter","전체"),Zt(this,"zoneFilter","전체"),Zt(this,"selected",0),Zt(this,"lastSig",""),this.sellGlow.eventMode="none",this.netLayer.addChild(this.netHead),this.sellBtn.position.set(qPi-aNi,1),this.sellBtn.onTap=()=>this.openSheet(),this.cutBtn.position.set(qPi-aNi,1),this.cutBtn.onTap=async()=>{ - const t=await ixi.getInstance().plunderCut(); - bH.getInstance().showMessage(t??"줄을 끊었어요! 어망을 지켰어요"),this.render()} - ,this.netEmpty.position.set(4,78),this.netEmpty.setWrapWidth(qPi-8),this.netList.y=66,this.netLayer.addChild(this.sellGlow,this.sellBtn,this.cutBtn,this.netEmpty,this.netList),this.autoBg.eventMode=this.autoSwitch.eventMode="none",this.autoBtn.addChild(this.autoBg,this.autoText,this.autoSwitch),this.autoBtn.position.set(qPi-aNi-8-128,1),this.autoBtn.eventMode="static",this.autoBtn.cursor="pointer",this.autoBtn.hitArea=new $i(0,-4,128,50),this.autoBtn.on("pointertap",t=>{ - t.stopPropagation(),queueMicrotask(()=>this.openAuto())} - ),this.netLayer.addChild(this.autoBtn),this.autoPanel.visible=!1,this.sheetBg.eventMode="static"; - const t=(new ep).roundRect(0,0,46,46,12).fill(Ixi).moveTo(27,14).lineTo(18,23).lineTo(27,32).stroke({ - color:Bxi,width:3.5,cap:"round",join:"round"} - ); - t.eventMode="none",this.sheetBack.addChild(t),this.sheetBack.eventMode="static",this.sheetBack.cursor="pointer",this.sheetBack.hitArea=new $i(-6,-6,58,58),this.sheetBack.on("pointertap",t=>{ - t.stopPropagation(),queueMicrotask(()=>this.closeSheet())} - ),this.sheetTitle.position.set(60,(46-this.sheetTitle.height)/2),this.allChip.soft=!0,this.allChip.position.set(qPi-150,3),this.allChip.onTap=()=>this.pickRule("all",0),this.starLb.position.set(2,67),this.sizeLb.position.set(2,113); - const i=(qPi-52-16)/3; - this.starChips.forEach((t,s)=>{ - t.soft=!0,t.resize(i,38),t.position.set(52+s*(i+8),58),t.onTap=()=>this.pickRule("star",rNi[s].v)} - ),this.sizeChips.forEach((t,s)=>{ - t.soft=!0,t.resize(i,38),t.position.set(52+s*(i+8),104),t.onTap=()=>this.pickRule("size",oNi[s].v)} - ),sRi(this.sizeNote,i-8),this.sizeNote.position.set(52+2*(i+8)+(i-this.sizeNote.width)/2,104+(38-this.sizeNote.height)/2),this.sellList.y=156,this.barBg.eventMode="none",this.barSell.onTap=()=>{ - this.sellPicked()} - ,this.sheet.addChild(this.sheetBg,this.sheetBack,this.sheetTitle,this.allChip,this.starLb,this.sizeLb,...this.starChips,...this.sizeChips,this.sizeNote,this.sellList,this.barBg,this.barN,this.barCoin,this.barGold,this.barEmpty,this.barEmptySub,this.barSell),this.sheet.visible=!1,this.detail.visible=!1,this.confirm.visible=!1,this.dexLayer.addChild(this.dexHead); - const s=(qPi-32)/5; - this.raceChips.forEach((t,i)=>{ - t.soft=!0,t.dot=i?Xxi[fTi[i-1]]:null,t.resize(s,36),t.position.set(i*(s+8),66),t.onTap=()=>{ - this.raceFilter=i?fTi[i-1]:"전체",this.render(!0)} - ,this.dexLayer.addChild(t)} - ); - const e=(qPi-24)/4; - this.zoneChips.forEach((t,i)=>{ - t.soft=!0,t.resize(e,36),t.position.set(i*(e+8),110),t.onTap=()=>{ - this.zoneFilter=t.value,this.render(!0)} - ,this.dexLayer.addChild(t)} - ),this.dexList.y=158,this.dexLayer.addChild(this.dexList),this.addChild(this.netLayer,this.aqLayer,this.dexLayer,this.sheet,this.detail,this.autoPanel,this.confirm)} - static getInstance(){ - return this.instance??(this.instance=new t)} - onResize(){ - this.render()} - onShow(){ - this.render(!0)} - onHide(){ - this.sheetOpen=!1,this.sheet.visible=!1,this.card=null,this.detail.visible=!1,this.hideConfirm(),this.hideAuto(),this.stopGlow()} - subTabs(){ - return this.sheetOpen?null:{ - items:JPi,index:XPi.indexOf(this.view)} - } - selectSub(t){ - this.view=XPi[t]??"net",this.card=null,this.detail.visible=!1,this.render(!0)} - closeOne(){ - return this.confirm.visible?(this.hideConfirm(),!0):this.autoPanel.visible?(this.hideAuto(),!0):this.card?(this.closeDetail(),!0):!!this.sheetOpen&&(this.closeSheet(),!0)} - update(){ - this.sig()!==this.lastSig&&"dex"!==this.view&&this.render()} - sig(){ - var t,i,s,e; - const n=ixi.getInstance(),h=n.state; - return`${ - this.view} - |${ - h.icebox.length} - |${ - n.netCap} - |${ - (null==(t=h.aquarium)?void 0:t.fish.length)??0} - |${ - (null==(i=h.aquarium)?void 0:i.lv)??0} - |${ - !!(null==(s=n.plunder)?void 0:s.raidBy)} - |${ - (null==(e=h.autoSell)?void 0:e.on)??!1} - `} - openDex(t){ - this.view="dex",this.selected=t,this.raceFilter=DTi(t).race,this.zoneFilter="전체",this.card={ - mode:"dex",id:t} - } - openView(t){ - this.view=t,this.sheetOpen&&this.closeSheet(),this.card=null,this.detail.visible=!1} - get sellButton(){ - return this.sellBtn} - render(t=!1){ - this.lastSig=this.sig(),this.netLayer.visible="net"===this.view,this.aqLayer.visible="aquarium"===this.view,this.dexLayer.visible="dex"===this.view,"net"===this.view?this.renderNet(t):(this.stopGlow(),"aquarium"===this.view?this.renderAquarium():this.renderDex(t)),this.sheetOpen&&this.renderSheet(),this.card&&this.drawDetail()} - fishCells(){ - const t=ixi.getInstance(),i=new Map; - return t.netFish().map(s=>{ - const e=`${ - s.id} - :${ - s.grade} - :${ - s.at} - :${ - s.kg} - `,n=i.get(e)??0; - return i.set(e,n+1),{ - c:s,uid:`${ - e} - #${ - n} - `,quest:t.isQuestFish(s)} - } - )} - renderNet(t){ - var i; - const s=ixi.getInstance(),e=APi.contentHeight,n=s.netCount(),h=s.netCap,r=n>=h,o=!!(null==(i=s.plunder)?void 0:i.raidBy),a=this.fishCells(),c=[3,2,1,0].map(t=>[wCi[t],a.filter(i=>i.c.grade===t).length]).filter(([,t])=>t>0).map(([t,i])=>`${ - t} - ${ - i} - `),l=`${ - n} - / ${ - h} - 마리${ - c.length?` · ${ - c.join(" · ")} - `:""} - `; - o?this.netHead.set("어망","도둑이 줄을 걸었어요 ·",{ - accent:"줄을 끊어야 팔 수 있어요",accentColor:Hxi,rightW:252} - ):this.netHead.set("어망",r?`${ - l} - ·`:l,{ - accent:r?"가득 찼어요":"",rightW:252} - ),this.drawAutoBtn(),this.sellBtn.visible=!o,this.cutBtn.visible=o,this.sellBtn.enabled=n>0,r&&!o?this.startGlow():this.stopGlow(),this.netEmpty.visible=!a.length,this.netList.visible=a.length>0,this.netList.setListHeight(Math.max(60,e-this.netList.y),!1); - const u=[]; - for(let d=0; - d<a.length; - d+=6)u.push({ - items:a.slice(d,d+6),under:"kg",onPick:Qt(t=>this.openCard({ - mode:"net",uid:t.uid} - ),"onPick")} - ); - this.netList.dataProvider=u,t&&this.netList.showTopItem()} - startGlow(){ - if(this.glowTween)return; - const t=this.sellBtn,i=this.sellGlow; - i.clear().roundRect(-52,-21,aNi,cNi,10).fill(Dxi),i.position.set(t.x+52,t.y+21),i.visible=!0,this.glowTween=yx.timeline({ - repeat:-1} - ).fromTo(i,{ - alpha:.5} - ,{ - alpha:0,duration:1.4,ease:"power1.out"} - ,0).fromTo(i.scale,{ - x:1,y:1} - ,{ - x:1+24/aNi,y:1+24/cNi,duration:1.4,ease:"power1.out"} - ,0)} - stopGlow(){ - this.glowTween&&(this.glowTween.kill(),this.glowTween=null,this.sellGlow.visible=!1)} - openCard(t){ - this.card=t,this.drawDetail(),yx.fromTo(this.detail,{ - alpha:0} - ,{ - alpha:1,duration:.15} - ),YG("light")} - closeDetail(){ - this.card=null,this.detail.visible=!1,queueMicrotask(()=>{ - this.card||this.detail.removeChildren().forEach(t=>t.destroy({ - children:!0} - ))} - )} - drawDetail(){ - var t,i; - const s=this.card; - if(!s)return; - const e=ixi.getInstance(); - let n=null,h=!1; - if("net"===s.mode){ - const t=this.fishCells().find(t=>t.uid===s.uid); - if(!t)return void this.closeDetail(); - n=t.c,h=t.quest} - else if("aq"===s.mode&&(n=e.aquarium().fish[s.index]??null,!n))return void this.closeDetail(); - const r=DTi(n?n.id:s.id),o="dex"===s.mode?e.state.dex[r.id]:void 0,a="dex"!==s.mode||o||null==(t=e.life)?void 0:t.dex[r.id],c="dex"!==s.mode||!!o||!!a,l=this.detail,u=APi.contentHeight,d=APi.OVERLAY_PAD,f=Math.min(qPi-40,500),p=20,w=!!(null==(i=e.plunder)?void 0:i.raidBy); - l.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),l.visible=!0; - const g=(new ep).rect(-d,0,qPi+2*d,u).fill({ - color:0,alpha:Nxi} - ); - g.eventMode="static",g.on("pointertap",t=>{ - t.stopPropagation(),queueMicrotask(()=>this.closeDetail())} - ); - const m=new Ke,v=new ep; - m.eventMode="static",m.on("pointertap",t=>t.stopPropagation()),m.addChild(v); - const _=n?n.grade:o?vCi(o.bestR):a?vCi(a.bestR):0,M=new hRi(104,!1,!0); - M.set(r.id,r.star,_,!c),M.setFade(!o&&a?.45:1),M.position.set(p,p); - const b=142,y=f-b-p,E=Jxi(c?r.name:"???",c?Bxi:Uxi,21); - E.position.set(b,22),sRi(E,y-40); - const A=new Ke,S=[]; - n?S.push(n.grade?KPi(`${ - wCi[n.grade]} - ${ - _Ci(n.grade)} - `,16777215,Yxi[n.grade]):KPi("C 보통",Uxi,kxi)):_&&S.push(KPi(`최고 ${ - wCi[_]} - ${ - _Ci(_)} - `,16777215,Yxi[_])),S.push(KPi(`★${ - r.tier} - `,Dxi,kxi),KPi(r.kind,Uxi,kxi)); - const T=zTi(r); - T&&S.push(KPi(T,Uxi,kxi)),h&&S.push(KPi("의뢰용",$xi,1522214)); - let C,O,I=0; - for(const D of S)D.x=I,I+=D.width+6,A.addChild(D); - if(A.position.set(b,56),A.width>y&&A.scale.set(y/A.width),n){ - const t=Math.max(1,Math.floor((n.at-e.state.startAt)/864e5)+1); - C=zPi([{ - icon:"weight",text:TCi(n.kg)} - ,{ - icon:"ruler",text:`${ - n.cm} - cm`} - ]),O=zPi([{ - icon:"pin",text:GTi(n.race,n.zone,n.point)} - ,{ - text:`· ${ - t} - 일차`,color:Uxi} - ],6)} - else if(o)C=zPi([{ - icon:"trophy",text:`최고 ${ - TCi(o.bestKg)} - `} - ,{ - text:"잡은 수",color:Uxi} - ,{ - text:`${ - o.count} - 마리`} - ],12),O=zPi([{ - icon:"pin",text:`처음 ${ - o.firstPoint} - `} - ,{ - text:`· ${ - o.firstDay} - 일차`,color:Uxi} - ],6); - else if(a)C=zPi([{ - text:`지난 회차에 잡았어요 (${ - a.firstSeason} - 회차부터)`,color:Uxi} - ]),O=zPi([{ - icon:"trophy",text:`최고 ${ - TCi(a.bestKg)} - `} - ,{ - text:`· ${ - a.count} - 마리`,color:Uxi} - ],6); - else{ - const t=e.state.lost[r.id]; - C=zPi([{ - text:"아직 못 잡았어요",color:Uxi} - ]),O=t?zPi([{ - icon:"trophy",text:`놓친 대물 ${ - TCi(t)} - `,color:Dxi} - ]):null} - C.position.set(b,92); - for(const D of[C,O])D&&D.width>y&&D.scale.set(y/D.width); - m.addChild(M,E,A,C),O&&(O.position.set(b,116),m.addChild(O)); - let k=144; - const x=YPi(r,"dex"===s.mode&&!c&&r.star>=3,f-40); - x.position.set(p,k),m.addChild(x),k+=x.height+16; - const R=f-40; - if("net"===s.mode&&n){ - const t=n,i=Mki(t),s=i?(R-10)/2:R,o=hNi("팔기",TSi(vki(t),ixi.getInstance().state),s,58,17,!0,!w); - if(o.position.set(i?p+s+10:p,k),o.onTap=()=>{ - h?this.ask("의뢰에 쓸 물고기예요","팔면 다시 잡아야 해요",[t],"남겨 두기","그래도 팔기",!1,()=>{ - this.sellCatches([t],o)} - ):this.sellCatches([t],o)} - ,i){ - const i=e.aquarium(),n=new cRi("어항에 넣기",s,58,17); - n.setPrimary(!1),n.position.set(p,k),n.enabled=!w&&i.fish.length<i.cap,n.onTap=async()=>{ - n.enabled=!1; - const i=await e.aquariumPutFish(t); - bH.getInstance().showMessage(i??`${ - lRi(r.name,"을","를")} - 어항에 넣었어요. 어항 물고기는 도둑맞지 않고 팔리지도 않아요`),i?n.enabled=!0:(this.card=null,this.detail.visible=!1,this.render())} - ,m.addChild(n)} - m.addChild(o)} - else if("aq"===s.mode){ - const t=zPi([{ - icon:"shield",text:"어항 물고기는 도둑맞지 않고 팔리지도 않아요",color:Fxi} - ]); - t.position.set(p,k-2),m.addChild(t),k+=30; - const i=new cRi("어망으로 꺼내기",R,58,17); - i.setPrimary(!1),i.position.set(p,k),i.onTap=async()=>{ - i.enabled=!1; - const t=await e.aquariumTake(s.index); - bH.getInstance().showMessage(t??`${ - lRi(r.name,"을","를")} - 어망으로 꺼냈어요`),t?i.enabled=!0:(this.card=null,this.detail.visible=!1,this.render())} - ,m.addChild(i)} - const P=new Ke,N=(new ep).moveTo(14,14).lineTo(30,30).moveTo(30,14).lineTo(14,30).stroke({ - color:Uxi,width:3,cap:"round"} - ); - N.eventMode="none",P.addChild(N),P.position.set(f-52,8),P.eventMode="static",P.cursor="pointer",P.hitArea=new $i(0,0,44,44),P.on("pointertap",t=>{ - t.stopPropagation(),queueMicrotask(()=>this.closeDetail())} - ),m.addChild(P); - const L="dex"===s.mode?k-16+p:k+58+p; - v.roundRect(0,0,f,L,16).fill(Rxi),m.hitArea=new $i(0,0,f,L),m.position.set((qPi-f)/2,Math.max(10,(u-L)/2)),l.addChild(g,m)} - drawAutoBtn(){ - var t; - const i=!!(null==(t=ixi.getInstance().autoSell)?void 0:t.on),s=`${ - i} - `; - if(s===this.autoDrawn)return; - this.autoDrawn=s,this.autoBg.clear().roundRect(0,0,128,cNi,10).fill(i?jxi:Ixi),this.autoText.textColor=i?Dxi:Uxi,this.autoText.position.set(14,(cNi-this.autoText.height)/2); - this.autoSwitch.clear().roundRect(80,11,36,20,10).fill(i?Dxi:kxi).circle(i?106:90,21,7).fill(i?Gxi:Uxi)} - openAuto(){ - const t=ixi.getInstance().autoSell; - this.autoDraft=t?{ - on:t.on,when:t.when,star:t.star,size:t.size} - :{ - ...yki} - ,YG("light"),this.drawAuto(),yx.fromTo(this.autoPanel,{ - alpha:0} - ,{ - alpha:1,duration:.15} - )} - hideAuto(){ - this.autoPanel.visible&&(this.autoPanel.visible=!1,queueMicrotask(()=>{ - this.autoPanel.visible||this.autoPanel.removeChildren().forEach(t=>t.destroy({ - children:!0} - ))} - ))} - drawAuto(){ - var t; - const i=this.autoPanel,s=ixi.getInstance(),e=!!(null==(t=s.autoSell)?void 0:t.on),n=this.autoDraft,h=APi.contentHeight,r=APi.OVERLAY_PAD,o=Math.min(qPi-40,480); - i.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const a=(new ep).rect(-r,0,qPi+2*r,h).fill({ - color:0,alpha:Nxi} - ),c=new Ke,l=Jxi("자동 팔기",Dxi,19); - let u=20; - l.position.set((o-l.width)/2,u),u+=l.height+16; - const d=[["언제",lNi.map(t=>({ - text:t.text,on:n.when===t.v,tap:Qt(()=>{ - n.when=t.v} - ,"tap")} - ))],["별",uNi.map(t=>({ - text:t.text,on:n.star===t.v,tap:Qt(()=>{ - n.star=t.v} - ,"tap")} - ))],["크기",dNi.map(t=>({ - text:t.text,on:n.size===t.v,tap:Qt(()=>{ - n.size=t.v} - ,"tap")} - ))]],f=[l]; - for(const[M,b]of d){ - const t=Jxi(M,Uxi,14); - t.position.set(20,u+(38-t.height)/2); - const i=(o-40-52-8*(b.length-1))/b.length; - b.forEach((t,s)=>{ - const e=new oRi(t.text,i,38,15); - e.soft=!0,e.selected=t.on,e.draw(),e.position.set(72+s*(i+8),u),e.onTap=()=>{ - t.tap(),YG("light"),queueMicrotask(()=>{ - this.autoPanel.visible&&this.drawAuto()} - )} - ,f.push(e)} - ),f.push(t),u+=48} - u+=4; - const p=s.netFish().filter(t=>{ - var i; - return Eki(n,t)&&((null==(i=s.state.dex[t.id])?void 0:i.count)??0)>1&&!s.isQuestFish(t)} - ).length,w=["full"===n.when?"어망이 가득 차면 맞는 물고기를 팔아 자리를 만들어요":"맞는 물고기는 어망에 넣지 않고 바로 팔아요","아주 드문 것·특대·왕 · 의뢰용 · 처음 잡은 물고기는 남겨요",`지금 어망에서 맞는 물고기 ${ - p} - 마리`]; - for(const[M,b]of w.entries()){ - const t=Jxi(b,0===M?Bxi:Uxi,14,0===M); - sRi(t,o-40),t.position.set((o-t.width)/2,u),u+=t.height+4,f.push(t)} - u+=14; - const g=(o-40-10)/2,m=new cRi(e?"끄기":"닫기",g,52,16),v=new cRi(e?"적용":"켜기",g,52,16); - m.setPrimary(!1),v.setPrimary(!0),m.position.set(20,u),v.position.set(20+g+10,u),m.onTap=()=>{ - e?this.saveAuto({ - ...n,on:!1} - ):this.hideAuto()} - ,v.onTap=()=>{ - this.saveAuto({ - ...n,on:!0} - )} - ; - const _=u+52+20; - c.addChild(eRi(o,_,Rxi,null,16),...f,m,v),c.position.set((qPi-o)/2,Math.max(10,(h-_)/2)),i.addChild(a,c),i.hitArea=new $i(-r,0,qPi+2*r,h),i.eventMode="static",i.removeAllListeners("pointertap"),i.on("pointertap",t=>t.stopPropagation()),i.visible=!0} - async saveAuto(t){ - var i,s; - if(this.autoBusy)return; - this.autoBusy=!0; - const e=ixi.getInstance(),n=(null==(i=e.autoSell)?void 0:i.n)??0,h=(null==(s=e.autoSell)?void 0:s.g)??0,r=this.autoBtn.toGlobal({ - x:64,y:21} - ); - let o; - try{ - o=await e.setAutoSell(t)} - finally{ - this.autoBusy=!1} - if(o)return void bH.getInstance().showMessage(o); - this.hideAuto(); - const a=e.autoSell,c=((null==a?void 0:a.n)??0)-n,l=((null==a?void 0:a.g)??0)-h,u=`${ - uNi.find(i=>i.v===t.star).text} - · ${ - dNi.find(i=>i.v===t.size).text} - · ${ - lNi.find(i=>i.v===t.when).text} - `; - t.on?c>0?(bH.getInstance().showMessage(`자동 팔기를 켰어요 · 어망이 가득이라 ${ - c} - 마리를 바로 팔았어요 · ${ - l.toLocaleString()} - G`),APi.getInstance().flyCurrency("gold",r,Math.min(10,3+c))):bH.getInstance().showMessage(`자동 팔기를 켰어요 · ${ - u} - `):bH.getInstance().showMessage("자동 팔기를 껐어요"),YG("medium"),this.autoDrawn="",this.render()} - openSheet(){ - this.sellBtn.enabled&&(this.pickStar=0,this.pickSize=-1,this.pickAll=!1,this.pickAdd.clear(),this.pickDel.clear(),this.sheetOpen=!0,this.sheet.visible=!0,this.sellList.showTopItem(),APi.getInstance().refreshSub(),this.renderSheet(),yx.fromTo(this.sheet,{ - alpha:0,y:30} - ,{ - alpha:1,y:0,duration:.22,ease:"power2.out"} - ))} - closeSheet(){ - this.sheetOpen=!1,this.sheet.visible=!1,this.hideConfirm(),APi.getInstance().refreshSub(),this.render()} - pickRule(t,i){ - "all"===t?(this.pickAll=!this.pickAll,this.pickAll&&(this.pickStar=0,this.pickSize=-1)):("star"===t?this.pickStar=this.pickStar===i?0:i:this.pickSize=this.pickSize===i?-1:i,this.pickAll=!1),this.pickAdd.clear(),this.pickDel.clear(),YG("light"),this.renderSheet()} - ruleHit(t){ - return!(Mki(t)||!this.pickAll&&(!this.pickStar&&this.pickSize<0||this.pickStar&&!(DTi(t.id).star<=this.pickStar)||!(this.pickSize<0||t.grade<=this.pickSize)))} - picked(t){ - return!t.quest&&!this.pickDel.has(t.uid)&&(this.ruleHit(t.c)||this.pickAdd.has(t.uid))} - togglePick(t){ - t.quest?bH.getInstance().showMessage("의뢰에 쓸 물고기라 남겨 둬요"):(this.picked(t)?(this.pickAdd.delete(t.uid),this.ruleHit(t.c)&&this.pickDel.add(t.uid)):(this.pickDel.delete(t.uid),this.ruleHit(t.c)||this.pickAdd.add(t.uid)),YG("light"),queueMicrotask(()=>{ - this.sheetOpen&&this.renderSheet()} - ))} - pickedFish(){ - return this.fishCells().filter(t=>this.picked(t)).map(t=>t.c)} - renderSheet(){ - var t; - const i=ixi.getInstance(),s=APi.contentHeight,e=APi.OVERLAY_PAD,n=!!(null==(t=i.plunder)?void 0:t.raidBy); - this.sheetBg.clear().rect(-e,0,qPi+2*e,s).fill(Oxi),this.allChip.selected=this.pickAll,this.allChip.setText(this.pickAll?"모두 고름":"모두 고르기"),this.starChips.forEach((t,i)=>{ - t.selected=rNi[i].v===this.pickStar,t.draw()} - ),this.sizeChips.forEach((t,i)=>{ - t.selected=oNi[i].v===this.pickSize,t.draw()} - ); - const h=this.fishCells().map(t=>({ - ...t,check:t.quest?"lock":this.picked(t)?"on":"off"} - )).sort((t,i)=>vki(t.c)-vki(i.c)||DTi(t.c.id).star-DTi(i.c.id).star),r=h.filter(t=>!t.quest&&!Mki(t.c)),o=h.filter(t=>!t.quest&&Mki(t.c)),a=h.filter(t=>t.quest),c=[],l=Qt(t=>{ - for(let i=0; - i<t.length; - i+=6)c.push({ - items:t.slice(i,i+6),under:"price",onPick:Qt(t=>this.togglePick(t),"onPick")} - )} - ,"add"); - l(r),o.length&&(c.push({ - head:{ - title:`아끼는 물고기 ${ - o.length} - `,hint:"아주 드문 것·특대·왕 · 눌러야 골라져요"} - } - ),l(o)),a.length&&(c.push({ - head:{ - title:`의뢰용 ${ - a.length} - `,hint:"퀘스트에 써서 팔지 않아요"} - } - ),l(a)),this.sellList.setListHeight(Math.max(60,s-156-96),!1),this.sellList.dataProvider=c; - const u=s-96; - this.barBg.clear().rect(-e,u,qPi+2*e,96).fill(Cxi); - const d=this.pickedFish(),f=d.length,p=TSi(d.reduce((t,i)=>t+vki(i),0),i.state),w=f>0&&!n; - this.barN.visible=this.barCoin.visible=this.barGold.visible=w,this.barEmpty.visible=!w,this.barEmptySub.visible=!f&&!n,w&&(this.barN.text=`${ - f} - 마리 팔면`,this.barN.position.set(4,u+16),this.barCoin.position.set(4,u+48),this.barGold.text=p.toLocaleString(),this.barGold.position.set(36,u+60-this.barGold.height/2)),this.barEmpty.text=n?"도둑이 줄을 걸었어요. 줄을 끊어야 팔 수 있어요":"팔 물고기를 골라요",this.barEmpty.textColor=n?Hxi:Uxi,sRi(this.barEmpty,qPi-230),this.barEmpty.position.set(4,u+(n?36:20)),this.barEmptySub.position.set(4,u+52),this.barSell.position.set(qPi-200,u+18),this.barSell.enabled=w&&!this.selling} - async sellPicked(){ - const t=this.pickedFish(); - if(!t.length||this.selling)return; - const i=t.filter(t=>Mki(t)); - i.length?this.ask("아끼는 물고기도 팔까요?",`아주 드문 것·특대·왕 ${ - i.length} - 마리가 들어 있어요\n어항에 넣으면 털리지 않고 남아요`,i,"빼고 팔기","모두 팔기",!1,()=>{ - this.sellCatches(t,this.barSell)} - ,()=>{ - const i=t.filter(t=>!Mki(t)); - i.length&&this.sellCatches(i,this.barSell)} - ):await this.sellCatches(t,this.barSell)} - async sellCatches(t,i){ - if(this.selling)return; - this.selling=!0,this.sheetOpen&&this.renderSheet(); - const s=i.toGlobal({ - x:60,y:28} - ); - let e; - try{ - e=await ixi.getInstance().sellFish(t)} - finally{ - this.selling=!1} - if(e.message)return bH.getInstance().showMessage(e.message),void this.render(); - bH.getInstance().showMessage(`${ - e.count} - 마리 팔았어요 · ${ - e.gold.toLocaleString()} - G`),APi.getInstance().flyCurrency("gold",s,Math.min(10,3+e.count)),YG("medium"),this.card=null,this.detail.visible=!1,this.sheetOpen?this.closeSheet():this.render()} - ask(t,i,s,e,n,h,r,o){ - const a=this.confirm,c=APi.contentHeight,l=APi.OVERLAY_PAD,u=Math.min(qPi-60,420); - a.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const d=(new ep).rect(-l,0,qPi+2*l,c).fill({ - color:0,alpha:Nxi} - ),f=Jxi(t,Dxi,19),p=i.split("\n").map(t=>{ - const i=Jxi(t,Uxi,14,!1); - return sRi(i,u-36),i} - ),w=new Ke,g=s.slice(0,6); - g.forEach((t,i)=>{ - const s=new hRi(52,!1,!0); - s.set(t.id,DTi(t.id).star,t.grade),s.position.set(60*i,0),w.addChild(s)} - ); - let m=18; - f.position.set((u-f.width)/2,m),m+=f.height+14,w.position.set((u-(60*g.length-8))/2,m),m+=66; - for(const E of p)E.position.set((u-E.width)/2,m),m+=E.height+2; - m+=16; - const v=(u-36-10)/2,_=new cRi(e,v,52,16),M=new cRi(n,v,52,16); - _.setPrimary(!h),M.setPrimary(h),_.position.set(18,m),M.position.set(18+v+10,m),_.onTap=()=>{ - this.hideConfirm(),null==o||o()} - ,M.onTap=()=>{ - this.hideConfirm(),r()} - ; - const b=m+52+18,y=new Ke; - y.addChild(eRi(u,b,Rxi,null,16),f,w,...p,_,M),y.position.set((qPi-u)/2,Math.max(10,(c-b)/2)),a.addChild(d,y),a.hitArea=new $i(-l,0,qPi+2*l,c),a.eventMode="static",a.removeAllListeners("pointertap"),a.on("pointertap",t=>t.stopPropagation()),a.visible=!0,yx.fromTo(y,{ - alpha:0} - ,{ - alpha:1,duration:.15} - )} - hideConfirm(){ - this.confirm.visible&&(this.confirm.visible=!1,queueMicrotask(()=>{ - this.confirm.visible||this.confirm.removeChildren().forEach(t=>t.destroy({ - children:!0} - ))} - ))} - renderAquarium(){ - const t=ixi.getInstance(),i=t.state,s=t.aquarium(),e=this.aqLayer; - e.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const n=new iRi(qPi); - if(n.set("어항",`${ - s.fish.length} - / ${ - s.cap} - 칸 · 도둑맞지 않고 팔리지도 않아요`,{ - rightW:null!==s.nextPrice?184:0} - ),e.addChild(n),null!==s.nextPrice){ - const n=s.nextPrice,h=hNi("칸 +5",n,172,42,Zxi,!1,i.gold>=n); - h.position.set(qPi-172,1),h.onTap=async()=>{ - const i=await t.aquariumExpand(); - bH.getInstance().showMessage(i??`어항이 ${ - t.aquarium().cap} - 칸이 됐어요`),this.render()} - ,e.addChild(h)} - const h=qPi/5; - for(let r=0; - r<s.cap; - r++){ - const t=r%5*h,i=66+Math.floor(r/5)*iNi.H,n=s.fish[r],o=new Ke; - if(o.position.set(t,i),n){ - const t=new hRi(ZPi,!1,!0); - t.set(n.id,DTi(n.id).star,n.grade),t.position.set((h-ZPi)/2,8); - const i=Jxi(TCi(n.kg),Uxi,Zxi,!1); - i.position.set((h-i.width)/2,93),o.addChild(t,i),o.eventMode="static",o.cursor="pointer",o.hitArea=new $i(0,0,h,iNi.H),o.on("pointertap",t=>{ - t.stopPropagation(),this.openCard({ - mode:"aq",index:r} - )} - )} - else{ - const t=(new ep).roundRect((h-ZPi)/2,8,ZPi,ZPi,16).fill({ - color:Ixi,alpha:.75} - ); - t.eventMode="none",o.addChild(t)} - e.addChild(o)} - if(!s.fish.length){ - const t=Jxi("아주 드문 물고기나 특대·왕을 어망에서 누르고 [어항에 넣기]로 넣어요.",Uxi,Zxi,!1); - t.setWrapWidth(qPi-8),t.position.set(4,66+Math.ceil(s.cap/5)*iNi.H+4),e.addChild(t)} - } - renderDex(t){ - const i=ixi.getInstance(),s=i.state,e=APi.contentHeight; - this.raceChips.forEach(t=>{ - t.selected=t.value===this.raceFilter,t.draw()} - ),this.zoneChips.forEach(t=>{ - t.selected=t.value===this.zoneFilter,t.draw()} - ); - const n=RTi.filter(t=>!("전체"!==this.raceFilter&&t.race!==this.raceFilter||"전체"!==this.zoneFilter&&gTi[t.zone]!==this.zoneFilter)),h=n.filter(t=>s.dex[t.id]).length; - this.dexHead.set("도감",`잡은 종 ${ - h} - / ${ - n.length} - `,{ - accent:h&&h===n.length?"· 다 모았어요":""} - ); - const r=[]; - for(let o=0; - o<n.length; - o+=6)r.push({ - items:n.slice(o,o+6).map(t=>{ - var e; - return{ - s:t,d:s.dex[t.id],past:s.dex[t.id]||null==(e=i.life)?void 0:e.dex[t.id]} - } - ),onPick:Qt(t=>{ - this.selected=t,this.openCard({ - mode:"dex",id:t} - )} - ,"onPick")} - ); - if(this.dexList.setListHeight(e-this.dexList.y,!1),this.dexList.dataProvider=r,t){ - const t=this.selected?n.findIndex(t=>t.id===this.selected):-1; - t>=12?this.dexList.scrollTo(Math.floor(t/6)):this.dexList.showTopItem()} - } - } - ; - Qt(fNi,"FishingTankPage"),Zt(fNi,"instance"); - let pNi=fNi; - const wNi=APi.CONTENT_W,gNi=500,mNi=Qt((t,i,s=0)=>222+s+108*t+(i?28:0)+90,"cardH"),vNi=class t extends Ke{ - constructor(){ - super(),Zt(this,"dim",new ep),Zt(this,"card",new Ke),Zt(this,"bg",eRi(gNi,mNi(2,!0),Rxi,null,18)),Zt(this,"cooler",new _Ri("net","keepnet",44,Dxi,40)),Zt(this,"away",Jxi("",Uxi,14)),Zt(this,"count",Jxi("",Bxi,40)),Zt(this,"sub",Jxi("",Uxi,14)),Zt(this,"warn",Jxi("",Hxi,13)),Zt(this,"cells",[]),Zt(this,"sum",Jxi("",Dxi,15)),Zt(this,"ok",new cRi("확인",200,50,16)),Zt(this,"tl",null),Zt(this,"cardHeight",0),this.dim.eventMode="static",this.cooler.pivot.set(22,22),this.cooler.position.set(250,38),this.card.addChild(this.bg,this.cooler,this.away,this.count,this.sub,this.warn,this.sum,this.ok); - for(let t=0; - t<12; - t++){ - const i=new Ke,s=new hRi(70),e=Jxi("",Bxi,13),n=new Ke,h=30+t%6*74,r=222+108*Math.floor(t/6); - i.position.set(h+35,r+35),i.pivot.set(35,35),e.y=73,i.addChild(s,e,n),i.eventMode="none",this.card.addChild(i),this.cells.push({ - root:i,card:s,n:e,badge:n} - )} - this.ok.onTap=()=>this.close(),this.warn.setWrapWidth(460),this.addChild(this.dim,this.card)} - static getInstance(){ - return this.instance??(this.instance=new t)} - close(){ - var t,i; - null==(t=this.tl)||t.progress(1),null==(i=this.parent)||i.removeChild(this)} - closeOne(){ - return this.close(),!0} - layout(){ - const t=APi.contentHeight,i=APi.OVERLAY_PAD; - this.dim.clear().rect(-i,0,wNi+2*i,t).fill({ - color:0,alpha:Nxi} - ),this.dim.hitArea=new $i(-i,0,wNi+2*i,2e3),this.card.position.set((wNi-gNi)/2,Math.max(10,(t-this.cardHeight)/2))} - open(t){ - var i,s,e,n; - const h=0===t.count&&t.lost>0,r=[]; - if(h?r.push("더 튼튼한 낚싯줄(장비 › 도구)이 있으면 잡을 수 있어요"):t.lost>0&&r.push(`줄이 끊어져 ${ - t.lost} - 마리를 놓쳤어요 · 더 튼튼한 낚싯줄이 필요해요`),t.fullAt>0){ - const s=new Date(t.fullAt-((null==(i=ixi.getInstance().state)?void 0:i.devOffset)??0)); - r.push(`어망이 가득 차서 ${ - String(s.getHours()).padStart(2,"0")} - :${ - String(s.getMinutes()).padStart(2,"0")} - 부터 낚시를 쉬었어요. 어망을 비우면 다시 잡혀요`)} - t.sold&&r.push(`수조가 어망으로 바뀌어 넘친 ${ - t.sold.count} - 마리를 ${ - t.sold.gold.toLocaleString()} - G에 자동으로 팔았어요`),(null==(s=t.autoSold)?void 0:s.count)&&r.push(`자동 팔기로 ${ - t.autoSold.count} - 마리를 ${ - t.autoSold.gold.toLocaleString()} - G에 팔았어요`); - const o=18*Math.max(0,r.length-1),a=t.byId.length-12,c=mNi(Math.ceil(Math.min(12,t.byId.length)/6),a>0,o); - this.cardHeight=c,this.layout(),this.bg.clear().roundRect(0,0,gNi,c,18).fill(Rxi); - const l=Math.floor(t.minutes/60),u=t.minutes%60; - this.away.text=t.minutes>0?`다녀온 동안 · 약 ${ - l?`${ - l} - 시간 `:""} - ${ - u} - 분`:"어망 정리",this.away.position.set((gNi-this.away.width)/2,66); - const d=!h&&0===t.count&&t.fullAt>0; - this.count.text=h?"놓쳤어요":d?"어망 가득":`${ - t.count} - 마리`,this.count.position.set((gNi-this.count.width)/2,88),this.sub.text=h?`${ - t.lost} - 마리가 줄을 끊고 달아났어요`:0===t.count?d?"어망이 차서 더 잡지 못했어요. 팔아서 비우면 다시 잡혀요":"어망을 정리했어요":`${ - (null==(e=t.autoSold)?void 0:e.count)?"잡았어요":"어망에 담겼어요"} - · 새 도감 ${ - t.newIds.length} - 종`,sRi(this.sub,460),this.sub.position.set((gNi-this.sub.width)/2,142),this.warn.visible=r.length>0,this.warn.textColor=t.lost>0||t.fullAt>0?Hxi:Dxi,this.warn.text=r.join("\n"),this.warn.position.set(Math.max(20,(gNi-this.warn.width)/2),170),this.ok.position.set(150,c-72),this.cells.forEach((t,i)=>{ - const s=30+i%6*74,e=222+o+108*Math.floor(i/6); - t.root.position.set(s+35,e+35)} - ),this.cells.forEach((i,s)=>{ - const e=t.byId[s]; - i.root.visible=!!e,e&&(i.card.set(e.id,DTi(e.id).star,e.grade??0),i.n.text=`×${ - e.count} - `,i.n.position.x=(70-i.n.width)/2,i.badge.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),t.newIds.includes(e.id)&&(i.badge.addChild(dRi("NEW",728852,$xi,11,6)),i.badge.position.set((70-i.badge.width)/2,-9)))} - ),this.sum.text=a>0?`외 ${ - a} - 종 더`:"",this.sum.position.set((gNi-this.sum.width)/2,c-106),APi.getInstance().overlay.addChild(this),this.cooler.refresh(),QG.getInstance().playSFX(QG.SFX_POPUP),null==(n=this.tl)||n.kill(); - const f={ - n:0} - ,p=yx.timeline(); - p.fromTo(this.card,{ - alpha:0,y:this.card.y+24} - ,{ - alpha:1,y:this.card.y,duration:.22,ease:"power2.out"} - ).fromTo(this.cooler.scale,{ - x:.6,y:.6} - ,{ - x:1,y:1,duration:.3,ease:"back.out(3)"} - ,.05).to(f,{ - n:t.count,duration:Math.min(.9,.3+.02*t.count),ease:"power1.out",onUpdate:Qt(()=>{ - h||0===t.count||(this.count.text=`${ - Math.round(f.n)} - 마리`,this.count.x=(gNi-this.count.width)/2)} - ,"onUpdate")} - ,.12),this.cells.forEach((t,i)=>{ - t.root.visible&&(t.root.alpha=0,p.fromTo(t.root,{ - alpha:0} - ,{ - alpha:1,duration:.12} - ,.25+.055*i).fromTo(t.root.scale,{ - x:.4,y:.4} - ,{ - x:1,y:1,duration:.26,ease:"back.out(2.6)"} - ,.25+.055*i))} - ),this.tl=p} - } - ; - Qt(vNi,"FishingSettlePanel"),Zt(vNi,"instance"); - let _Ni=vNi; - const MNi=Qt(t=>Math.max(0,Math.min(1,t)),"clamp01$6"),bNi=Qt(t=>1+2.70158*Math.pow(t-1,3)+1.70158*Math.pow(t-1,2),"backOut$3"); - function yNi(t,i){ - if(null!==i&&t>=i){ - const s=yNi(i,null),e=MNi((t-i)/160); - return{ - scale:s.scale*(1-.1*e),alpha:s.alpha*(1-e),bob:0} - } - if(t<120)return{ - scale:.6,alpha:0,bob:0} - ; - const s=MNi((t-120)/240),e=t>=360?6*Math.sin((t-360)/1200*Math.PI*2):0; - return{ - scale:.6+.4*bNi(s),alpha:s,bob:e} - } - Qt(yNi,"coachPose"); - const ENi=Dxi,ANi=Gxi,SNi=class t extends Ke{ - constructor(){ - super(),Zt(this,"id",null),Zt(this,"body",new Ke),Zt(this,"bg",new ep),Zt(this,"tail",new ep),Zt(this,"text",Jxi("",ANi,13)),Zt(this,"t0",0),Zt(this,"tapAt",null),Zt(this,"target",null),Zt(this,"below",!1),Zt(this,"width0",0),this.eventMode="none",this.body.addChild(this.bg,this.tail,this.text),this.addChild(this.body),this.visible=!1} - show(t,i,s,e,n){ - this.id=t,this.target=s,this.below=e,this.width0=n,this.text.text=i,this.t0=performance.now(),this.tapAt=null,this.visible=!0,this.alpha=0,Mn.shared.remove(this.tick,this),Mn.shared.add(this.tick,this),this.tick()} - dismiss(){ - this.visible&&null===this.tapAt&&(this.tapAt=(performance.now()-this.t0)*t.speed)} - stop(){ - (this.visible||this.target)&&this.end()} - tick(){ - var i; - if(!this.parent)return this.end(); - const s=(performance.now()-this.t0)*t.speed,e=(null==(i=this.target)?void 0:i.call(this))??null; - e||this.dismiss(); - const n=yNi(s,this.tapAt); - if(e){ - const t=this.parent.toLocal(e); - this.position.set(t.x,t.y)} - const h=this.text.width+24,r=this.text.height+16; - let o=-h/2; - const a=this.x+o; - a<8?o+=8-a:a+h>this.width0-8&&(o-=a+h-(this.width0-8)); - const c=this.below?8:-8-r; - this.bg.clear().roundRect(o,c,h,r,10).fill(ENi),this.tail.clear(),this.below?this.tail.moveTo(-8,9).lineTo(0,0).lineTo(8,9).closePath().fill(ENi):this.tail.moveTo(-8,-9).lineTo(0,0).lineTo(8,-9).closePath().fill(ENi),this.text.position.set(o+12,c+8),this.body.scale.set(n.scale),this.body.y=this.below?-n.bob:n.bob,this.alpha=n.alpha,null!==this.tapAt&&s>=this.tapAt+160&&this.end()} - end(){ - Mn.shared.remove(this.tick,this),this.visible=!1,this.id=null,this.target=null} - } - ; - Qt(SNi,"FishingCoach"),Zt(SNi,"speed",1); - let TNi=SNi; - const CNi=APi.CONTENT_W,ONi=1e3,INi=28,kNi=1842206,xNi=921104,RNi=2894894,PNi=4013377,NNi=15921908,LNi=10592678,DNi=7237235,GNi=Dxi,BNi=Dxi,UNi=Gxi,FNi=["종족","성별","얼굴"],$Ni=["어느 종족으로 시작할까요?","성별을 골라요","얼굴을 꾸며요"],HNi=Qt(t=>t/512*100,"frontR"),WNi=class extends Ke{ - constructor(t,i,s,e,n=!0){ - super(),Zt(this,"bg",new ep),Zt(this,"text"),Zt(this,"onTap",null),Zt(this,"_enabled",!0),this.w=i,this.h=s,this.primary=n,this.text=Jxi(t,UNi,e),this.addChild(this.bg,this.text),this.eventMode="static",this.cursor="pointer",this.hitArea=new $i(0,0,i,s),this.on("pointerdown",()=>{ - this._enabled&&this.scale.set(.97)} - ),this.on("pointerup",()=>this.scale.set(1)),this.on("pointerupoutside",()=>this.scale.set(1)),this.on("pointertap",t=>{ - var i; - t.stopPropagation(),this._enabled&&(null==(i=this.onTap)||i.call(this))} - ),this.draw()} - set enabled(t){ - this._enabled=t,this.draw()} - get enabled(){ - return this._enabled} - setText(t){ - this.text.text=t,this.draw()} - draw(){ - const t=this._enabled; - this.bg.clear().roundRect(0,0,this.w,this.h,16).fill({ - color:this.primary?BNi:RNi,alpha:t?1:.4} - ),this.text.textColor=this.primary?UNi:NNi,this.text.alpha=t?1:.55,sRi(this.text,this.w-12),this.text.position.set((this.w-this.text.width)/2,(this.h-this.text.height)/2)} - } - ; - Qt(WNi,"MkButton"); - let VNi=WNi; - const jNi=class extends Ke{ - constructor(t,i,s,e,n=null){ - super(),Zt(this,"bg",new ep),Zt(this,"main"),this.w=i,this.h=s,this.onTap=n,this.main=Jxi(t,NNi,e),this.addChild(this.bg,this.main),this.eventMode="static",this.cursor="pointer",this.hitArea=new $i(0,0,i,s),this.on("pointertap",t=>{ - var i; - t.stopPropagation(),null==(i=this.onTap)||i.call(this)} - ),this.setOn(!1)} - setOn(t,i=!1){ - this.bg.clear().roundRect(0,0,this.w,this.h,12).fill(t?BNi:i?PNi:RNi),this.main.textColor=t?UNi:NNi,sRi(this.main,this.w-12),this.main.position.set((this.w-this.main.width)/2,(this.h-this.main.height)/2)} - } - ; - Qt(jNi,"OptButton"); - let KNi=jNi; - const zNi=class extends Ke{ - constructor(t,i,s=null){ - super(),Zt(this,"bg",new ep),this.color=t,this.s=i,this.onTap=s,this.addChild(this.bg),this.eventMode="static",this.cursor="pointer",this.hitArea=new $i(-4,-4,i+8,i+8),this.on("pointertap",t=>{ - var i; - t.stopPropagation(),null==(i=this.onTap)||i.call(this)} - ),this.setOn(!1)} - setOn(t){ - const i=this.s,s=t?6:0; - this.bg.clear(),t&&this.bg.roundRect(0,0,i,i,15).fill(BNi),this.bg.roundRect(s,s,i-2*s,i-2*s,t?9:15).fill(this.color)} - } - ; - Qt(zNi,"Swatch"); - let YNi=zNi; - const qNi=class extends Ke{ - constructor(t,i,s,e,n,h){ - super(),Zt(this,"bg",new ep),Zt(this,"check",new Ke),this.w=t,this.h=i,this.onTap=h; - const r=Jxi(s,NNi,28); - r.position.set((t-r.width)/2,e); - const o=(new ep).circle(0,0,20).fill(BNi),a=Jxi("✓",UNi,24); - a.position.set(-a.width/2,-a.height/2),this.check.addChild(o,a),this.check.position.set(t-32,32); - const c=(new ep).roundRect(0,0,t,i,22).fill(16777215),l=new Ke; - l.addChild(...n),l.mask=c,this.addChild(this.bg,l,c,r,this.check),this.eventMode="static",this.cursor="pointer",this.hitArea=new $i(0,0,t,i),this.on("pointertap",t=>{ - t.stopPropagation(),this.onTap()} - ),this.setOn(!1)} - setOn(t){ - this.bg.clear().roundRect(0,0,this.w,this.h,22).fill(t?PNi:RNi),this.check.visible=t} - } - ; - Qt(qNi,"PickCard"); - let XNi=qNi; - const JNi=class t extends Ke{ - constructor(){ - super(),Zt(this,"dim",new ep),Zt(this,"card",new Ke),Zt(this,"cardBg",new ep),Zt(this,"title",Jxi("캐릭터 생성",GNi,34)),Zt(this,"closeBtn",Jxi("닫기",DNi,20)),Zt(this,"chips",new Ke),Zt(this,"question",Jxi("",NNi,30)),Zt(this,"body",new Ke),Zt(this,"back",new VNi("이전",120,76,26,!1)),Zt(this,"go",new VNi("다음",484,76,26)),Zt(this,"draft",{ - ...TIi} - ),Zt(this,"picked",{ - race:!1,sex:!1} - ),Zt(this,"step",0),Zt(this,"first",!0),Zt(this,"busy",!1),Zt(this,"onDone",null),this.dim.eventMode="static",this.back.onTap=()=>{ - this.step>0&&(this.step=this.step-1,this.render())} - ,this.go.onTap=()=>{ - this.step<2?(this.step=this.step+1,this.render()):this.confirm()} - ,this.closeBtn.eventMode="static",this.closeBtn.cursor="pointer",this.closeBtn.on("pointertap",i=>{ - var s; - i.stopPropagation(),this.first?(t.skipped=!0,this.close(),null==(s=this.onDone)||s.call(this)):this.close()} - ),this.cardBg.roundRect(0,0,540,ONi,30).fill(kNi),this.title.position.set(INi,30),this.chips.position.set(INi,96),this.question.position.set(INi,164),this.back.position.set(INi,896),this.card.addChild(this.cardBg,this.title,this.closeBtn,this.chips,this.question,this.body,this.back,this.go),this.addChild(this.dim,this.card)} - static getInstance(){ - return this.instance??(this.instance=new t)} - static get isOpen(){ - var t; - return!!(null==(t=this.instance)?void 0:t.parent)} - open(t,i){ - this.first=t,this.onDone=i??null; - const s=OIi(ixi.getInstance().look); - this.draft=t?{ - ...TIi,skin:0,hair:0,hairColor:0,feats:[]} - :s??{ - ...TIi} - ,this.picked={ - race:!t||!!s,sex:!t||!!s} - ,this.step=t?0:2,this.title.text=t?"캐릭터 생성":"모습 바꾸기",this.closeBtn.text=t?"나중에 하기":"닫기",this.closeBtn.visible=!t||xG.getInstance().development,this.closeBtn.position.set(512-this.closeBtn.width,40),this.parent||APi.getInstance().overlay.addChild(this),this.layout(),this.render(),yx.fromTo(this.card,{ - alpha:0} - ,{ - alpha:1,duration:.2} - )} - close(){ - var t; - this.busy||null==(t=this.parent)||t.removeChild(this)} - closeOne(){ - return this.first&&!this.closeBtn.visible?(bH.getInstance().showMessage("먼저 내 낚시꾼 모습을 정해요"),!0):(this.close(),!0)} - layout(){ - const t=APi.contentHeight,i=APi.OVERLAY_PAD; - this.dim.clear().rect(-i,0,CNi+2*i,t).fill({ - color:0,alpha:.72} - ),this.dim.hitArea=new $i(-i,0,CNi+2*i,2e3); - const s=Math.min(1,(t-16)/ONi,(CNi-16)/540); - this.card.scale.set(s),this.card.position.set((CNi-540*s)/2,Math.max(8,(t-ONi*s)/2))} - render(){ - const t=this.step; - this.chips.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const i=464/3; - FNi.forEach((s,e)=>{ - const n=new KNi(`${ - e+1} - ${ - s} - `,i,44,20,this.first?null:()=>{ - this.step=e,this.render()} - ); - n.setOn(e===t,e<t),this.first&&(n.eventMode="none",n.cursor="default"),n.position.set(e*(i+10),0),this.chips.addChild(n)} - ),this.question.text=$Ni[t],this.body.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),this.body.position.set(INi,216),0===t?this.renderRaces():1===t?this.renderSexes():this.renderFace(),this.back.visible=t>0; - const s=t>0?352:484; - if(Math.abs(this.go.w-s)>1){ - const t=this.go; - this.go=new VNi("",s,76,26),this.go.onTap=t.onTap,this.card.addChildAt(this.go,this.card.getChildIndex(t)),t.destroy()} - this.go.position.set(t>0?160:INi,896),this.go.setText(t<2?"다음":this.first?"출발":"바꾸기"),this.go.enabled=0===t?this.picked.race:1!==t||this.picked.sex} - renderRaces(){ - pIi.forEach((t,i)=>{ - const s=new bPi(HNi(236)); - s.set({ - ...TIi,race:i,sex:1,skin:0,hair:0,hairColor:_Ii[i],feats:[]} - ),s.position.set(117,231.25); - const e=new XNi(234,300,t,243,[s],()=>{ - this.picked.race&&this.draft.race===i||(this.draft.hairColor=_Ii[i]),this.draft.race=i,this.draft.skin=Math.min(this.draft.skin,wIi[i].length-1),this.picked.race=!0,this.render()} - ); - e.setOn(this.picked.race&&this.draft.race===i),e.position.set(i%2*250,316*Math.floor(i/2)),this.body.addChild(e)} - )} - renderSexes(){ - fIi.forEach((t,i)=>{ - const s=new bPi(HNi(230)); - s.set({ - ...TIi,race:this.draft.race,sex:i,skin:0,hair:0,hairColor:this.draft.hairColor,feats:[]} - ),s.position.set(117,229.625); - const e=new XNi(234,360,t,299,[s],()=>{ - this.draft.sex=i,this.picked.sex=!0,this.render()} - ); - e.setOn(this.picked.sex&&this.draft.sex===i),e.position.set(250*i,0),this.body.addChild(e)} - )} - renderFace(){ - const t=this.draft,i=this.body,s=(new ep).circle(100,100,100).fill(xNi),e=(new ep).circle(100,100,100).fill(16777215),n=_Pi(t); - n.scale.set(1.5625),n.position.set(100,100); - const h=new Ke; - h.addChild(n),h.mask=e; - const r=(new ep).roundRect(214,0,270,200,22).fill(xNi),o=new bPi(HNi(200)); - o.set(t),o.position.set(349,187.5); - const a=new VNi("무작위",96,40,18,!1); - a.position.set(378,10),a.onTap=()=>{ - t.skin=Math.floor(Math.random()*wIi[t.race].length),t.hair=Math.floor(Math.random()*gIi[t.sex].length),t.hairColor=Math.floor(Math.random()*vIi.length),this.render()} - ,i.addChild(s,h,e,r,o,a); - let c=214; - const l=Qt(t=>{ - const s=Jxi(t,LNi,20,!1); - s.position.set(0,c),i.addChild(s),c+=34} - ,"title"),u=Qt((t,s,e)=>{ - t.forEach((t,n)=>{ - const h=new YNi(t,58,()=>{ - e(n),this.render()} - ); - h.setOn(n===s),h.position.set(70*n,c),i.addChild(h)} - ),c+=70} - ,"swatches"),d=Qt((t,s,e,n,h=10)=>{ - t.forEach((t,r)=>{ - const o=new KNi(t,n,54,21,()=>e(r)); - o.setOn(s(r)),o.position.set(r*(n+h),c),i.addChild(o)} - ),c+=66} - ,"opts"); - l("피부색"),u(wIi[t.race],t.skin,i=>{ - t.skin=i} - ),l("머리 모양"),d(gIi[t.sex],i=>i===t.hair,i=>{ - t.hair=i,this.render()} - ,146),l("머리 색"),u(vIi,t.hairColor,i=>{ - t.hairColor=i} - ),l("얼굴 장식 · 두 개까지"); - const f=(484-10*(bIi.length-1))/bIi.length; - d(bIi.map(t=>MIi[t]),i=>t.feats.includes(bIi[i]),i=>{ - const s=bIi[i]; - if(t.feats.includes(s))t.feats=t.feats.filter(t=>t!==s); - else{ - if(!(t.feats.length<2))return void bH.getInstance().showMessage("얼굴 장식은 두 개까지 고를 수 있어요"); - t.feats=[...t.feats,s].sort((t,i)=>t-i)} - this.render()} - ,f)} - async confirm(){ - var t; - if(this.busy)return; - const i=OIi(this.draft); - if(i){ - this.busy=!0,this.go.enabled=!1; - try{ - let s; - try{ - s=await ixi.getInstance().saveLook(i)} - catch{ - s="연결이 원활하지 않아요"} - if(s||!ixi.getInstance().look)return bH.getInstance().showMessage(`모습을 저장하지 못했어요 (${ - s??"서버가 모습을 모름"} - )`),void(this.closeBtn.visible=!0); - this.busy=!1,this.close(),bH.getInstance().showMessage(this.first?"출발!":"모습을 바꿨어요"),null==(t=this.onDone)||t.call(this)} - finally{ - this.busy=!1,this.go.enabled=!0} - } - else bH.getInstance().showMessage("고를 수 없는 모습이에요")} - } - ; - Qt(JNi,"FishingAvatarMaker"),Zt(JNi,"instance"),Zt(JNi,"skipped",!1); - let QNi=JNi; - const ZNi=Object.freeze(Object.defineProperty({ - __proto__:null,FishingAvatarMaker:QNi} - ,Symbol.toStringTag,{ - value:"Module"} - )),tLi=new Map; - function iLi(t,i){ - const s=tLi.get(t); - if(s&&!s.destroyed)return s; - const e=i(),n=SS.app.renderer.generateTexture({ - target:e,resolution:2,antialias:!0} - ); - return e.destroy({ - children:!0} - ),tLi.set(t,n),n} - Qt(iLi,"bake$1"); - const sLi={ - wood:{ - shaft:10119740,shaftHi:13081186,head:12042438,headDark:6121584,fin:13193021,glow:null} - ,iron:{ - shaft:6253427,shaftHi:10135470,head:14870764,headDark:5661547,fin:4157363,glow:null} - ,mithril:{ - shaft:7322073,shaftHi:14219007,head:15924735,headDark:4889792,fin:10185983,glow:8380671} - ,bone:{ - shaft:15128244,shaftHi:16774621,head:16116952,headDark:11023418,fin:11739180,glow:16747130} - ,thunder:{ - shaft:4995988,shaftHi:10127082,head:16770138,headDark:12159504,fin:16765498,glow:16773242} - } - ; - function eLi(t){ - return iLi(`harpoon:${ - t} - `,()=>{ - const i=new Ke,s=new ep,e=sLi[t]; - s.rect(0,0,128,28).fill({ - color:0,alpha:.001} - ),e.glow&&s.poly([96,2,127,14,96,26,102,14]).fill({ - color:e.glow,alpha:.35} - ).roundRect(6,9,92,10,5).fill({ - color:e.glow,alpha:.18} - ),s.poly([2,6,18,12,18,16,2,22,7,14]).fill(e.fin).stroke({ - color:2759186,width:1,alpha:.6} - ),s.roundRect(10,12,86,5,2.5).fill(e.shaft).rect(12,12.4,82,1.2).fill({ - color:e.shaftHi,alpha:.9} - ); - for(let t=0; - t<6; - t++)s.rect(30+3.2*t,11.2,1.7,6.6).fill(14731151); - return s.roundRect(92,10.5,9,8,2).fill(e.headDark),s.poly([99,4,124,14,99,24,104,14]).fill(e.head).stroke({ - color:e.headDark,width:1.2} - ),s.poly([104,7,97,1,101,9]).fill(e.head).stroke({ - color:e.headDark,width:1} - ),s.poly([104,21,97,27,101,19]).fill(e.head).stroke({ - color:e.headDark,width:1} - ),s.moveTo(102,14).lineTo(121,14).stroke({ - color:16777215,width:1,alpha:.7} - ),i.addChild(s),i} - )} - function nLi(){ - return iLi("harpoonShadow",()=>{ - const t=new Ke,i=new ep; - return i.rect(0,0,128,28).fill({ - color:16777215,alpha:.001} - ),i.poly([2,6,18,12,18,16,2,22,7,14]).fill(16777215),i.roundRect(10,12,86,5,2.5).fill(16777215),i.roundRect(92,10.5,9,8,2).fill(16777215),i.poly([99,4,124,14,99,24,104,14]).fill(16777215),i.poly([104,7,97,1,101,9]).fill(16777215),i.poly([104,21,97,27,101,19]).fill(16777215),t.addChild(i),t} - )} - function hLi(){ - return iLi("harpoonBlood",()=>{ - const t=new Ke,i=new ep; - i.rect(0,0,64,64).fill({ - color:16777215,alpha:.001} - ); - for(let s=10; - s>=1; - s--){ - const t=s/10; - i.ellipse(28,32,23*t,15*t).fill({ - color:16777215,alpha:.075} - ),i.ellipse(40,27,16*t,11*t).fill({ - color:16777215,alpha:.055} - ),i.ellipse(31,40,13*t,12*t).fill({ - color:16777215,alpha:.045} - )} - return t.addChild(i),t} - )} - Qt(eLi,"harpoonTex"),Qt(nLi,"harpoonShadowTex"),Qt(hLi,"harpoonBloodTex"); - const rLi={ - perfect:{ - text:"퍼펙트!",top:"#fff6b0",bottom:"#ff9a1f",stroke:5907456,size:46,rays:16766282} - ,great:{ - text:"그레이트!",top:"#d8ffe4",bottom:"#28c068",stroke:736546,size:40,rays:9437119} - ,good:{ - text:"명중",top:"#e2f4ff",bottom:"#4aa3ff",stroke:731725,size:36,rays:null} - ,miss:{ - text:"빗나감…",top:"#eef4f5",bottom:"#8aa0a6",stroke:2240566,size:30,rays:null} - } - ; - function oLi(t){ - return iLi(`grade:${ - t} - `,()=>{ - const i=rLi[t],s=new Ke,e=new ml({ - type:"linear",start:{ - x:0,y:0} - ,end:{ - x:0,y:1} - ,textureSpace:"local",colorStops:[{ - offset:0,color:i.top} - ,{ - offset:.55,color:i.top} - ,{ - offset:1,color:i.bottom} - ]} - ),n=new pg({ - text:i.text,style:new Jw({ - fontFamily:"Arial",fontSize:i.size,fontWeight:"900",fill:e,letterSpacing:1,stroke:{ - color:i.stroke,width:Math.round(.17*i.size),join:"round"} - ,dropShadow:{ - color:0,alpha:.55,blur:3,distance:4,angle:Math.PI/2} - ,padding:10} - )} - ),h=n.width+40,r=n.height+30,o=new ep; - o.rect(0,0,h,r).fill({ - color:0,alpha:.001} - ); - for(let t=6; - t>=1; - t--)o.ellipse(h/2,r/2+2,(n.width/2+10)*(.7+.06*t),(n.height/2+4)*(.7+.07*t)).fill({ - color:398362,alpha:.07} - ); - if(i.rays){ - const t=h/2,s=r/2,e=14,n=Math.min(h,1.6*r)/2,a=.42*n,c=[]; - for(let i=0; - i<2*e; - i++){ - const h=i/(2*e)*Math.PI*2,r=i%2?a:n; - c.push(t+Math.cos(h)*r*1.15,s+Math.sin(h)*r*.55)} - o.poly(c).fill({ - color:i.rays,alpha:.32} - ),o.ellipse(t,s,.75*n,.32*n).fill({ - color:i.rays,alpha:.28} - )} - return n.position.set((h-n.width)/2,(r-n.height)/2),s.addChild(o,n),s} - )} - function aLi(){ - return iLi("glow",()=>{ - const t=new Ke,i=new ep; - for(let s=12; - s>=1; - s--)i.circle(64,64,s/12*64).fill({ - color:16777215,alpha:.085} - ); - return t.addChild(i),t} - )} - function cLi(){ - return iLi("ring",()=>{ - const t=new Ke,i=new ep; - return i.circle(64,64,58).stroke({ - color:16777215,width:7,alpha:.9} - ).circle(64,64,50).stroke({ - color:16777215,width:3,alpha:.35} - ),t.addChild(i),t} - )} - function lLi(){ - return iLi("harpoonRipple",()=>{ - const t=new Ke,i=new ep; - i.rect(0,0,128,128).fill({ - color:16777215,alpha:.001} - ),i.circle(64,64,58).stroke({ - color:16777215,width:3.2,alpha:.85} - ); - for(const s of[.2,2.5,4.4])i.arc(64,64,53,s,s+1.15).stroke({ - color:16777215,width:1.8,alpha:.4} - ); - return t.addChild(i),t} - )} - function uLi(){ - return iLi("woodenMallet:flat",()=>{ - const t=new Ke,i=new ep; - return i.rect(0,0,80,80).fill({ - color:0,alpha:.001} - ),i.roundRect(30,28,8,41,2).fill(13870186).stroke({ - color:5519136,width:2} - ),i.roundRect(12,10,44,23,2.5).fill(12158028).stroke({ - color:5519136,width:2} - ).moveTo(18,15).lineTo(50,15).stroke({ - color:14660985,width:1.8,cap:"round"} - ).moveTo(20,24).lineTo(30,24).moveTo(39,27).lineTo(48,27).stroke({ - color:9396278,width:1.2,cap:"round"} - ),t.addChild(i),t} - )} - Qt(oLi,"gradeTex"),Qt(aLi,"glowTex"),Qt(cLi,"ringTex"),Qt(lLi,"harpoonRippleTex"),Qt(uLi,"woodenMalletTex"); - const dLi={ - cycleMs:2300,hits:[0,220,440],stowMs:300,crop:120,soundWindowMs:1e4,finishBurstMs:300,finishMs:2100,helpFlightMs:600} - ,fLi=Qt(t=>Math.min(1,Math.max(0,t)),"clamp01$5"),pLi=Qt((t,i,s)=>fLi((t-i)/s),"seg"),wLi=Qt(t=>1-(1-t)**3,"outCubic$1"),gLi=Qt((t,i)=>{ - const s=t-1; - return s*s*((i+1)*s+i)+1} - ,"outBack"); - function mLi(t,i=1){ - const s=150/i,e=40/i,n=120/i; - return t>=-s&&t<-e?wLi((t+s)/(s-e)):t>=-e&&t<0?1-((t+e)/e)**2:t>=0&&t<n?.15*Math.sin(Math.PI*t/n):0} - function vLi(t){ - if(!(t>=0))return{ - raise:0,impactAge:1/0,hitIndex:-1,burstFirst:!1} - ; - const{ - cycleMs:i,hits:s} - =dLi,e=Math.floor(t/i),n=t-e*i; - let h=0,r=1/0,o=-1,a=!1; - for(const c of[-1,0,1])s.forEach((t,l)=>{ - const u=n-(t+c*i); - e+c<0||(h=Math.max(h,mLi(u)),u>=0&&u<r&&(r=u,o=(e+c)*s.length+l,a=0===l))} - ); - return{ - raise:h,impactAge:r,hitIndex:o,burstFirst:a} - } - function _Li(t){ - const i=t.impactAge<90?1.2*(1-t.impactAge/90):0,s=-1.4*t.raise+i; - return Math.abs(s)<1e-9?0:s} - function MLi(t){ - return wLi(pLi(t,0,dLi.stowMs))} - function bLi(t){ - return 8*Math.round(dLi.crop*fLi(t)/8)} - function yLi(t){ - return t>=400?1:gLi(pLi(t,80,320),2)} - function ELi(t){ - const i=dLi.finishBurstMs; - let s=0,e=1/0; - for(const h of[0,90,180,270]){ - const i=t-h; - s=Math.max(s,mLi(i,2.2)),i>=0&&i<e&&(e=i)} - t>=i&&(s=0); - const n=t-i; - return{ - raise:s,impactAge:e,white:n>=0&&n<260?.5*(1-n/260):0,rise:n>=0&&n<520?Math.sin(Math.PI*n/520):0,shine:n>=120&&n<820?(n-120)/700:-1,check:n>=120,badgeScale:n<0?1:n<260?1+.3*Math.sin(Math.PI*n/260):n<900?1:1-wLi(pLi(n,900,300)),ribbon:n>=60?gLi(pLi(n,60,380),2.2)*(1-pLi(n,1500,300)):0,starAge:n-100,ringAge:n,unstow:wLi(pLi(n,500,300)),done:t>=dLi.finishMs} - } - function ALi(t){ - const i=pLi(t,0,dLi.helpFlightMs); - return{ - k:i,lift:70*Math.sin(Math.PI*i),arrived:t>=dLi.helpFlightMs,impactAge:t-dLi.helpFlightMs} - } - function SLi(t,i){ - return null!==t&&t>=0&&t<=dLi.soundWindowMs&&i} - Qt(mLi,"raiseFor"),Qt(vLi,"hammerAt"),Qt(_Li,"leanAt"),Qt(MLi,"stowAt"),Qt(bLi,"rodCrop"),Qt(yLi,"badgePop"),Qt(ELi,"finishPose"),Qt(ALi,"helpFlight"),Qt(SLi,"hitSound"); - const TLi=new Map; - function CLi(t,i,s=3){ - const e=TLi.get(t); - if(e&&!e.destroyed)return e; - const n=i(),h=SS.app.renderer.generateTexture({ - target:n,resolution:s,antialias:!0} - ); - return n.destroy({ - children:!0} - ),TLi.set(t,h),h} - function OLi(t){ - return CLi(`repair:head:${ - t} - `,()=>{ - const i=new ep; - i.roundRect(-7.5,-4.2,15,8.4,2).fill(t?15053370:12158028).stroke({ - color:t?8016392:4861720,width:1} - ),i.roundRect(-7.5,-4.2,1.6,8.4,.6).fill(t?10975248:7226917).roundRect(5.9,-4.2,1.6,8.4,.6).fill(t?10975248:7226917),i.moveTo(-5.2,-2.1).lineTo(5.2,-2.1).stroke({ - color:t?16773560:14859140,width:1,cap:"round"} - ); - const s=new Ke; - return s.addChild(i),s} - ,4)} - function ILi(){ - return CLi("repair:chip",()=>{ - const t=new Ke; - return t.addChild((new ep).rect(-1.6,-.8,3.2,1.6).fill(16777215)),t} - ,4)} - function kLi(){ - return CLi("repair:soft",()=>{ - const t=new ep; - for(let s=16; - s>=2; - s-=2)t.circle(0,0,s).fill({ - color:16777215,alpha:.11} - ); - const i=new Ke; - return i.addChild(t),i} - ,2)} - function xLi(){ - return CLi("repair:star",()=>{ - const t=(new ep).poly([0,-4,1.2,-1.2,4,0,1.2,1.2,0,4,-1.2,1.2,-4,0,-1.2,-1.2]).fill(16777215),i=new Ke; - return i.addChild(t),i} - ,4)} - function RLi(t){ - return CLi(`repair:ribbon:${ - t} - `,()=>{ - const i=new Ke,s=new ep; - s.roundRect(-56,-15,112,30,7).fill(5913118).roundRect(-53,-12,106,24,5).fill(9067054).stroke({ - color:16106577,width:1.4} - ),s.circle(-46,0,1.8).fill(3810322).circle(46,0,1.8).fill(3810322); - const e=new pg({ - text:t,style:{ - fontFamily:"Arial",fontWeight:"900",fontSize:15,fill:16773583,stroke:{ - color:2758408,width:4,join:"round"} - } - } - ); - return e.anchor.set(.5),e.y=.5,e.width>92&&e.scale.set(92/e.width),i.addChild(s,e),i} - ,3)} - Qt(CLi,"bake"),Qt(OLi,"malletHeadTex"),Qt(ILi,"chipTex"),Qt(kLi,"softTex"),Qt(xLi,"starTex"),Qt(RLi,"ribbonTex"); - const PLi=new WeakMap,NLi=new WeakMap; - function LLi(t,i){ - const s=NLi.get(t)??t; - if(i<=0)return s; - let e=PLi.get(s); - e||(e=new Map,PLi.set(s,e)); - let n=e.get(i); - if(!n||n.destroyed){ - const t=s.frame,h=i*(t.height/256); - n=new ls({ - source:s.source,frame:new $i(t.x,t.y+h,t.width,t.height-h)} - ),e.set(i,n),NLi.set(n,s)} - return n} - function DLi(t,i){ - return(t-i)/(256-i)} - function GLi(t){ - return NLi.get(t)??t} - Qt(LLi,"cropRod"),Qt(DLi,"cropAnchorY"),Qt(GLi,"uncropped"); - const BLi=Qt(t=>{ - const i=43758.5453*Math.sin(127.1*t+311.7); - return i-Math.floor(i)} - ,"hash"),ULi=Qt(t=>{ - let i=0; - for(let s=0; - s<t.length; - s++)i=31*i+t.charCodeAt(s)|0; - return Math.abs(i)} - ,"strHash$1"),FLi=Qt(t=>1-(1-t)**3,"outCubic"),$Li=class{ - constructor(t){ - Zt(this,"under",new Ke),Zt(this,"over",new Ke),Zt(this,"onSound",null),Zt(this,"myCrew",null),Zt(this,"crewOf",new Map),Zt(this,"otherLastHit",new Map),Zt(this,"mine",null),Zt(this,"pendingFresh",-1e9),Zt(this,"finishAt",-1),Zt(this,"stopAt",-1),Zt(this,"lastMineImpact",1/0),Zt(this,"lastFinishImpact",1/0),Zt(this,"finishSounded",!1),Zt(this,"helpPunchAt",-1e9),Zt(this,"rings",[]),Zt(this,"chips",[]),Zt(this,"flights",[]),Zt(this,"ringG",new ep),Zt(this,"trailG",new ep),Zt(this,"pool",[]),Zt(this,"used",0),Zt(this,"badge",new Ke),Zt(this,"badgeArc",new ep),Zt(this,"badgeCheck",new ep),Zt(this,"badgeMallet",new Xe(uLi())),Zt(this,"badgeGlow",new ep),Zt(this,"arcDrawn",-1),Zt(this,"arcBroken",!1),Zt(this,"ribbon",null),Zt(this,"hullFlash",new Xe),Zt(this,"shineWrap",new Ke),Zt(this,"shineBand",new ep),Zt(this,"shineMask",new Xe),this.scale=t; - for(const e of[this.under,this.over])e.eventMode="none"; - this.under.addChild(this.ringG); - const i=(new ep).circle(0,0,16).fill({ - color:1970698,alpha:.9} - ).circle(0,0,13.2).stroke({ - color:2759182,width:3.6} - ),s=(new ep).circle(0,0,16).stroke({ - color:16106577,width:1.2,alpha:.55} - ); - this.badgeMallet.anchor.set(.425,.49375),this.badgeMallet.rotation=-.45,this.badgeMallet.scale.set(.3),this.badgeCheck.circle(0,0,14).fill(4173418).moveTo(-6,.5).lineTo(-1.5,5).lineTo(6.5,-4.5).stroke({ - color:16777215,width:3.2,cap:"round",join:"round"} - ),this.badgeCheck.visible=!1,this.badge.addChild(i,this.badgeGlow,this.badgeArc,this.badgeMallet,this.badgeCheck,s),this.badge.visible=!1,this.hullFlash.anchor.set(.5),this.hullFlash.blendMode="add",this.hullFlash.visible=!1,this.shineMask.anchor.set(.5),this.shineBand.blendMode="add",this.shineWrap.addChild(this.shineBand,this.shineMask),this.shineBand.mask=this.shineMask,this.shineWrap.visible=!1; - for(let e=-5; - e<=5; - e++)this.shineBand.rect(5*e,-90,5,180).fill({ - color:16777215,alpha:.55*(1-Math.abs(e)/6)} - ); - this.over.addChild(this.hullFlash,this.shineWrap,this.trailG,this.badge)} - markFresh(){ - this.pendingFresh=performance.now()} - setMine(t){ - const i=performance.now(); - if(!t)return this.mine&&this.finishAt<0&&(this.stopAt=i),void(this.finishAt<0&&(this.mine=null)); - if(!(this.finishAt>=0)){ - if(!this.mine){ - const s=i-this.pendingFresh<5e3; - return this.mine={ - since:s?i:i-dLi.stowMs-1e3,fresh:s?i:null,progress:t.progress,shown:t.progress,broken:t.broken} - ,this.stopAt=-1,this.finishSounded=!1,this.pendingFresh=-1e9,void(this.lastMineImpact=1/0)} - this.mine.progress=t.progress,this.mine.broken=t.broken} - } - finish(){ - !this.mine||this.finishAt>=0||(this.finishAt=performance.now(),this.mine.progress=1,this.lastFinishImpact=1/0)} - get busy(){ - return!!this.mine} - help(t,i,s=null){ - const e=i(); - e?this.flights.push({ - from:t??{ - x:e.x-60,y:e.y-220} - ,to:i,t0:performance.now(),arrived:!1,onArrive:s} - ):null==s||s()} - crewFor(t){ - return this.crewOf.get(t)??null} - update(t,i,s){ - const e=performance.now(); - this.used=0,this.ringG.clear(),this.trailG.clear(),this.crewOf.clear(),this.myCrew=null,this.badge.visible=!1,this.hullFlash.visible=!1,this.shineWrap.visible=!1,this.ribbon&&(this.ribbon.visible=!1); - for(const n of s){ - const t=vLi(e+ULi(n.id)%dLi.cycleMs); - this.crewOf.set(n.id,{ - crop:dLi.crop,lean:_Li(t)} - ); - const i=this.drawHead(n,t,_Li(t),!1); - t.hitIndex>=0&&this.otherLastHit.get(n.id)!==t.hitIndex&&(this.otherLastHit.has(n.id)&&t.impactAge<200&&this.chips.push({ - x:i.x,y:i.y,t0:e-t.impactAge,seed:t.hitIndex+ULi(n.id),k:.8,gold:!1} - ),this.otherLastHit.set(n.id,t.hitIndex)),n.broken&&this.smoke(n,e,.5,ULi(n.id))} - if(t&&this.mine)this.drawMine(t,i,e); - else if(t&&this.stopAt>=0){ - const t=1-MLi(e-this.stopAt); - t>0?this.myCrew={ - crop:bLi(t),lean:0} - :this.stopAt=-1} - this.drawFlights(e),this.drawChips(e),this.drawRings(e); - for(let n=this.used; - n<this.pool.length; - n++)this.pool[n].visible=!1; - if(this.otherLastHit.size>s.length)for(const n of[...this.otherLastHit.keys()])this.crewOf.has(n)||this.otherLastHit.delete(n)} - drawMine(t,i,s){ - var e,n,h; - const r=this.mine; - if(r.shown+=.12*(r.progress-r.shown),this.finishAt>=0){ - const h=s-this.finishAt,r=ELi(h); - if(r.done)return this.mine=null,void(this.finishAt=-1); - if(this.myCrew={ - crop:bLi(1-r.unstow),lean:_Li(r)} - ,h<dLi.finishBurstMs+500){ - const i=this.drawHead(t,r,_Li(r),!1); - r.impactAge<this.lastFinishImpact&&(this.chips.push({ - x:i.x,y:i.y,t0:s-r.impactAge,seed:900+Math.floor(h/90),k:1,gold:!1} - ),null==(e=this.onSound)||e.call(this,"hit"))} - return this.lastFinishImpact=r.impactAge,h>=dLi.finishBurstMs&&!this.finishSounded&&(this.finishSounded=!0,null==(n=this.onSound)||n.call(this,"finish"),this.rings.push({ - x:t.x,y:t.y,t0:s,r0:24,r1:62,dur:900,color:16772798,width:2.2} - ,{ - x:t.x,y:t.y,t0:s+150,r0:20,r1:44,dur:800,color:16777215,width:1.4} - )),this.drawHullFx(i,r.white,r.shine),this.drawBadge(t,1,r.badgeScale,r.check,0),this.drawStars(t,r.starAge),void(r.ribbon>0&&(this.ribbon||(this.ribbon=new Xe(RLi("수리 완료!")),this.ribbon.anchor.set(.5),this.over.addChild(this.ribbon)),this.ribbon.visible=!0,this.ribbon.position.set(t.x,t.y-84),this.ribbon.scale.set(r.ribbon)))} - const o=s-r.since,a=MLi(o),c=vLi(o-350),l=o>=350?_Li(c):0; - if(this.myCrew={ - crop:bLi(a),lean:l} - ,o>=200){ - const i=this.drawHead(t,o<350?{ - raise:.35*Math.min(1,(o-200)/150),impactAge:1/0} - :c,l,!1); - c.impactAge<this.lastMineImpact&&c.hitIndex>=0&&(this.chips.push({ - x:i.x,y:i.y,t0:s-c.impactAge,seed:c.hitIndex,k:1,gold:!1} - ),c.burstFirst&&this.rings.push({ - x:t.x,y:t.y,t0:s-c.impactAge,r0:24,r1:40,dur:650,color:15137013,width:1.4} - ),SLi(null===r.fresh?null:s-r.fresh,c.burstFirst)&&(null==(h=this.onSound)||h.call(this,"hit"))),this.lastMineImpact=c.impactAge} - r.broken&&this.smoke(t,s,1-.9*Math.min(1,r.shown),0); - const u=null===r.fresh?1:yLi(o),d=s-this.helpPunchAt,f=d>=0&&d<300?1+.25*Math.sin(Math.PI*d/300):1; - this.drawBadge(t,r.shown,u*f,!1,d>=0&&d<500?.8*(1-d/500):0,r.broken)} - drawHead(t,i,s,e){ - const n=this.scale.angler,h=Math.sin(t.face),r=-Math.cos(t.face),o=85*n,a=o+4.5-5*i.raise+s,c=t.x+h*a,l=t.y+r*a; - if(i.raise>.05){ - const s=this.sprite(kLi(),t.x+h*a+3*i.raise,t.y+r*a+4*i.raise,663070,.28*i.raise); - s.scale.set(.38,.24),s.rotation=t.face} - this.trailG.moveTo(t.x+h*(o-3+s),t.y+r*(o-3+s)).lineTo(c,l).stroke({ - color:13212254,width:2,cap:"round"} - ); - const u=this.sprite(OLi(e),c,l,16777215,1); - if(u.anchor.set(.5),u.rotation=t.face,u.scale.set(.7*(1+.35*i.raise)),i.impactAge<90){ - const t=i.impactAge/90; - this.sprite(kLi(),c,l,16777200,.9*(1-t)).scale.set((3+4*t)/16)} - return{ - x:c,y:l} - } - smoke(t,i,s,e){ - if(s<=.01)return; - const n=Math.sin(t.face),h=-Math.cos(t.face),r=t.x-13*n,o=t.y-13*h; - for(let a=0; - a<7; - a++){ - const t=1700,n=243*a+e%500,h=Math.floor((i-n)/t)*t+n,c=i-h,l=c/t,u=3*Math.sin((h+c)/260+a),d=r+.5*u+26*l,f=o-16*l+.4*u,p=s*(1-l)*Math.min(1,6*l); - this.sprite(kLi(),d,f,3421752,.62*p).scale.set((3.5+7.5*l)/14),this.sprite(kLi(),d-1.5,f-1.5,9868948,.22*p).scale.set((2+4*l)/14)} - } - drawBadge(t,i,s,e,n,h=!1){ - if(s<=.01)return; - const r=this.badge; - r.visible=!0,r.position.set(t.x,t.y-46),r.scale.set(s),this.badgeCheck.visible=e,this.badgeMallet.visible=this.badgeArc.visible=!e; - const o=Math.round(200*Math.min(1,Math.max(0,i)))/200; - o===this.arcDrawn&&h===this.arcBroken||(this.arcDrawn=o,this.arcBroken=h,this.badgeArc.clear(),o>.005&&this.badgeArc.arc(0,0,13.2,-Math.PI/2,-Math.PI/2+2*Math.PI*o).stroke({ - color:h?16747100:16757611,width:3.6,cap:"round"} - )),this.badgeGlow.clear(),n>0&&this.badgeGlow.circle(0,0,13.2).stroke({ - color:16770700,width:6,alpha:n} - )} - drawHullFx(t,i,s){ - const e=null==t?void 0:t.sprite; - if(!e||e.destroyed)return; - const n=Qt(t=>{ - t.texture=e.texture,t.anchor.copyFrom(e.anchor),t.position.copyFrom(e.position),t.rotation=e.rotation,t.scale.copyFrom(e.scale),t.skew.copyFrom(e.skew)} - ,"copy"); - if(i>0&&(n(this.hullFlash),this.hullFlash.visible=!0,this.hullFlash.alpha=i),s>=0){ - this.shineWrap.visible=!0,n(this.shineMask); - const t=e.width,i=e.x,h=e.y; - this.shineBand.position.set(i-.9*t+1.8*t*s,h),this.shineBand.rotation=e.rotation+.6,this.shineBand.alpha=.85} - } - drawStars(t,i){ - if(i<0||i>800)return; - const s=i/800; - for(let e=0; - e<10; - e++){ - const i=e/10*Math.PI*2+.3,n=10+34*FLi(s),h=this.sprite(xLi(),t.x+Math.cos(i)*n,t.y-46+Math.sin(i)*n*.85,e%3?16769674:16777215,1-s); - h.anchor.set(.5),h.rotation=3*s,h.scale.set(1-.5*s)} - } - drawFlights(t){ - this.flights=this.flights.filter(i=>{ - var s,e; - const n=i.to(),h=ALi(t-i.t0); - if(!n)return!1; - if(!h.arrived){ - const t=Qt(t=>({ - x:i.from.x+(n.x-i.from.x)*t,y:i.from.y+(n.y-i.from.y)*t-70*Math.sin(Math.PI*t)} - ),"at"); - for(let i=1; - i<=5; - i++){ - const s=t(Math.max(0,h.k-.05*i)); - this.trailG.circle(s.x,s.y,2.6-.3*i).fill({ - color:16769674,alpha:.5-.08*i} - )} - const s=t(h.k),e=this.sprite(uLi(),s.x,s.y,16765803,1); - e.anchor.set(.425,.49375),e.scale.set(.34),e.rotation=7*h.k-.6; - const r=this.sprite(kLi(),s.x,s.y,16769674,.5); - return r.scale.set(.9),r.blendMode="add",!0} - return i.arrived||(i.arrived=!0,this.chips.push({ - x:n.x,y:n.y,t0:t,seed:99,k:1.4,gold:!0} - ),this.rings.push({ - x:n.x,y:n.y,t0:t,r0:14,r1:30,dur:600,color:16769674,width:1.8} - ),null==(s=this.onSound)||s.call(this,"help"),null==(e=i.onArrive)||e.call(i)),!1} - )} - helpPunch(){ - this.helpPunchAt=performance.now()} - drawChips(t){ - this.chips=this.chips.filter(i=>t-i.t0<=450); - for(const i of this.chips){ - const s=t-i.t0,e=s/450; - for(let t=0; - t<6; - t++){ - const s=BLi(7*i.seed+t)*Math.PI*2,n=(8+9*BLi(i.seed+3*t))*FLi(e)*i.k,h=this.sprite(ILi(),i.x+Math.cos(s)*n,i.y+Math.sin(s)*n,i.gold?t%2?16769674:16774864:t%2?14200179:9132587,1-e); - h.anchor.set(.5),h.rotation=s+6*e,h.scale.set(i.k)} - if(s<220){ - const t=s/220; - this.ringG.circle(i.x,i.y,(3+7*t)*i.k).stroke({ - color:16775398,width:1.4,alpha:.7*(1-t)} - )} - } - } - drawRings(t){ - this.rings=this.rings.filter(i=>t-i.t0<=i.dur); - for(const i of this.rings){ - const s=t-i.t0; - if(s<0)continue; - const e=s/i.dur,n=i.r0+(i.r1-i.r0)*FLi(e); - this.ringG.ellipse(i.x,i.y,n,.82*n).stroke({ - color:i.color,width:i.width,alpha:.9*(1-e)} - )} - } - sprite(t,i,s,e,n){ - let h=this.pool[this.used]; - return h||(h=new Xe,h.eventMode="none",this.pool.push(h),this.over.addChildAt(h,Math.max(0,this.over.getChildIndex(this.badge)))),this.used++,h.texture=t,h.anchor.set(.5),h.position.set(i,s),h.tint=e,h.alpha=n,h.rotation=0,h.scale.set(1),h.blendMode="normal",h.visible=!0,h} - destroy(){ - this.flights=[],this.chips=[],this.rings=[],this.under.destroy({ - children:!0} - ),this.over.destroy({ - children:!0} - )} - } - ; - Qt($Li,"BoatRepairFx"); - let HLi=$Li; - const WLi=.115,VLi=Qt(t=>Math.max(0,Math.min(1,t)),"clamp01$4"),jLi=Qt(t=>{ - const i=VLi(t); - return i*i*(3-2*i)} - ,"smooth01"); - function KLi(t,i,s){ - const e=46*(i<0?-1:1),n=Math.hypot(e,154),h=e/n,r=154/n,o={ - x:t.x-16*h,y:t.y-16*r} - ,a=VLi(s/WLi),c=n*(1-a*(.35+.65*a)),l=16*VLi((s-WLi)/.04); - return{ - x:o.x-h*c+h*l,y:o.y-r*c+r*l,angle:Math.atan2(154,e),entry:o,submerged:l,air:a} - } - function zLi(t,i){ - if(i<=0||t<0||t>=.24)return{ - push:0,flash:0} - ; - const s=t/.24,e=Math.min(3,i); - return{ - push:[0,1.4,2.1,3][e]*Math.sin(Math.PI*Math.min(1,1.6*s))*(1-s),flash:[0,.22,.32,.45][e]*(1-jLi(2*s))} - } - Qt(KLi,"harpoonDrop"),Qt(zLi,"harpoonFlinch"); - const YLi=Qt(t=>{ - const i=46*(t<0?-1:1),s=Math.hypot(i,154); - return{ - x:i/s,y:154/s} - } - ,"harpoonDir"); - function qLi(t,i){ - const s=16777215===t?16767436:6989494,e=VLi(i),n=Qt((t,i)=>t>>i&255,"ch"),h=Qt(i=>Math.round(n(t,i)+(n(s,i)-n(t,i))*e)<<i,"mix"); - return h(16)|h(8)|h(0)} - Qt(qLi,"flinchTint"); - const XLi=Qt(t=>[{ - amp:0,ms:0} - ,{ - amp:.9,ms:80} - ,{ - amp:1.5,ms:110} - ,{ - amp:2.4,ms:150} - ][Math.max(0,Math.min(3,t))],"harpoonShake"),JLi={ - wood:{ - tier:0,trail:12957073,water:12902357,accent:11589334} - ,iron:{ - tier:1,trail:11127016,water:12836341,accent:8894942} - ,mithril:{ - tier:2,trail:7922916,water:9104614,accent:12100591} - ,bone:{ - tier:3,trail:15784376,water:14674401,accent:15759988} - ,thunder:{ - tier:4,trail:16770922,water:16774328,accent:12165887} - } - ,QLi=class extends Ke{ - constructor(t,i,s,e,n={ - } - ,h,r=!0){ - super(),Zt(this,"underwater",new Ke),Zt(this,"age",0),Zt(this,"released",!1),Zt(this,"entered",!1),Zt(this,"impacted",!1),Zt(this,"aim"),Zt(this,"waterPoint",{ - x:0,y:0} - ),Zt(this,"impactPoint",{ - x:0,y:0} - ),Zt(this,"impactAngle",0),Zt(this,"bodyAngle",0),Zt(this,"side"),Zt(this,"miss"),Zt(this,"power"),Zt(this,"material"),Zt(this,"spear"),Zt(this,"wetSpear"),Zt(this,"dryMask",new ep),Zt(this,"wetMask",new ep),Zt(this,"wetBody",new Ke),Zt(this,"waterBlur",new _f({ - strength:.35,quality:2} - )),Zt(this,"blood",new Xe(hLi())),Zt(this,"bloodWisp",new Xe(hLi())),Zt(this,"pinMark",(new ep).poly([-2.7,-.2,-1.1,-1.2,2.2,-.8,2.8,.3,.7,1.1,-1.8,.9]).fill({ - color:5324874,alpha:.45} - )),Zt(this,"trail",new ep),Zt(this,"bubbles",new ep),Zt(this,"surface",new Ke),Zt(this,"rings",[]),Zt(this,"contact",(new ep).ellipse(0,0,3.2,1.2).fill({ - color:14085609,alpha:.65} - )),Zt(this,"pressure"),Zt(this,"pressureEcho",new Xe(lLi())),Zt(this,"impactGlow",new Xe(aLi())),Zt(this,"result",new Ke),Zt(this,"droplets",[]),Zt(this,"crown",[]),Zt(this,"foam",(()=>{ - const t=(new ep).ellipse(0,0,8,3.2).fill({ - color:15136500,alpha:.32} - ); - for(let i=0; - i<9; - i++){ - const s=i/9*Math.PI*2+i%2*.2,e=7+i%3; - t.ellipse(Math.cos(s)*e,Math.sin(s)*e*.42,1.6+i%3*.6,.9+i%2*.4).fill({ - color:16055290,alpha:.7} - )} - return t} - )()),Zt(this,"spray",new Ke),Zt(this,"sprayBeads",[]),Zt(this,"sprayFoam",new Xe(lLi())),Zt(this,"done"),Zt(this,"finish"),this.target=e,this.feedback=n,this.viewBounds=h,this.showResult=r,this.eventMode="none",this.done=new Promise(t=>{ - this.finish=t} - ),this.miss=s<=0,this.power=this.miss?0:"perfect"===i?3:"great"===i?2:1,this.material=JLi[t],this.pressure=new Xe(0===this.material.tier?lLi():cLi()),this.side=e.missOffset<0?-1:1,this.aim={ - ...e.point} - ,this.spear=new Xe(eLi(t)),this.wetSpear=new Xe(nLi()); - for(const a of[this.spear,this.wetSpear])a.anchor.set(.96875,.5),a.scale.set(.2),a.visible=!1; - this.wetSpear.tint=this.aim.tint,this.spear.mask=this.dryMask,this.wetSpear.mask=this.wetMask,this.wetBody.addChild(this.bloodWisp,this.blood,this.wetSpear,this.wetMask,this.pinMark),this.wetBody.filters=[this.waterBlur],this.underwater.eventMode="none"; - for(const a of[this.blood,this.bloodWisp])a.anchor.set(.5),a.tint=7886174,a.visible=!1; - this.pinMark.visible=!1; - for(let a=0; - a<=this.material.tier; - a++){ - const t=new Xe(lLi()); - t.anchor.set(.5),t.tint=1===a?this.material.accent:this.material.water,this.rings.push(t),this.surface.addChild(t)} - this.surface.addChild(this.foam,this.contact),this.foam.visible=!1,this.spray.visible=!1,this.sprayFoam.anchor.set(.5),this.sprayFoam.tint=this.material.water,this.spray.addChild(this.sprayFoam),this.contact.tint=this.material.water,this.pressure.anchor.set(.5),this.pressure.tint=this.material.water,this.pressureEcho.anchor.set(.5),this.pressureEcho.tint=this.material.accent,this.impactGlow.anchor.set(.5),this.impactGlow.tint=this.material.water,this.impactGlow.blendMode="add",this.pressure.visible=this.pressureEcho.visible=this.impactGlow.visible=this.surface.visible=this.result.visible=!1; - const o=new Xe(oLi(this.miss?"miss":i)); - if(o.anchor.set(.5),o.scale.set(3===this.power?.35:.31),this.result.addChild(o),!this.miss){ - const t=new pg({ - text:`-${ - s} - `,style:{ - fontFamily:"Arial",fontSize:[0,15,18,22][this.power],fontWeight:"900",fill:3===this.power?16770202:2===this.power?14221284:16777215,stroke:{ - color:1059638,width:3,join:"round"} - } - } - ); - t.anchor.set(.5),t.y=20,this.result.addChild(t)} - this.underwater.addChild(this.impactGlow,this.wetBody,this.bubbles,this.pressure,this.pressureEcho),this.addChild(this.underwater,this.trail,this.spear,this.dryMask,this.surface,this.spray,this.result)} - destination(){ - const t=this.target.sample(); - t&&(this.aim={ - ...t} - ); - const i=this.miss?this.target.missOffset:0; - return{ - ...this.aim,x:this.aim.x-Math.sin(this.aim.angle)*i,y:this.aim.y+Math.cos(this.aim.angle)*i} - } - placeSpear(t,i,s,e,n=1,h=0){ - const r=Math.min(30,Math.max(0,e)); - for(const o of[this.spear,this.wetSpear,this.dryMask,this.wetMask])o.position.set(t,i),o.rotation=s; - this.spear.visible=r<30,this.wetSpear.visible=r>0,this.spear.alpha=n,this.wetSpear.alpha=n*VLi(this.aim.alpha),this.wetSpear.tint=this.aim.tint,this.waterBlur.strength=this.aim.blur,this.dryMask.clear().rect(-30,-5,30-r,10).fill(16777215),this.wetMask.clear().rect(-r,-5,Math.max(0,r+(h>0?-h:1)),10).fill(16777215)} - enterWater(t,i){ - this.entered=!0,this.waterPoint={ - ...t} - ,this.surface.position.copyFrom(t),this.surface.visible=!0; - const s=this.miss?6:7+this.power+2*this.material.tier; - for(let n=0; - n<s; - n++){ - const t=2.39996*n,s=(12+n%4*5)*(.8+.2*this.material.tier),e=(new ep).circle(0,0,.55+n%3*.16).fill(n%3?13953767:11131103); - this.surface.addChild(e),this.droplets.push({ - sp:e,ox:2.5*Math.cos(t),oy:Math.sin(t),vx:Math.cos(t)*s-5*Math.cos(i),vy:Math.sin(t)*s*.42,vz:26+n%4*6} - )} - const e=this.miss?7:8+3*this.power; - for(let n=0; - n<e; - n++){ - const t=n/e*Math.PI*2+.3,i=3+n%2,s=(new ep).circle(0,0,.9+n%3*.35).fill(n%4?15398901:12575976); - this.surface.addChild(s),this.crown.push({ - sp:s,ox:Math.cos(t)*i,oy:Math.sin(t)*i*.45,vx:Math.cos(t)*(14+n%3*4),vy:6*Math.sin(t),vz:(this.miss?46:52+8*this.power)*(.8+7*n%5*.08),life:.34+.03*this.power} - )} - this.foam.visible=!0} - startSpray(t){ - if(this.miss)return; - this.spray.position.copyFrom(t),this.spray.visible=!0; - const i=4+3*this.power; - for(let s=0; - s<i; - s++){ - const t=s/i*Math.PI*2+.7,e=(new ep).circle(0,0,.7+s%3*.3).fill(14939379); - this.spray.addChild(e),this.sprayBeads.push({ - sp:e,vx:Math.cos(t)*(10+4*this.power),vy:4*Math.sin(t),vz:34+9*this.power+s%3*5,life:.3} - )} - } - drawSpray(t){ - if(!this.spray.visible)return; - const i=VLi(t/(.32+.05*this.power)),s=.05+(.1+.04*this.power)*(1-(1-i)**3); - this.sprayFoam.scale.set(s,.45*s),this.sprayFoam.alpha=.55*(1-i)**1.4*VLi(this.aim.alpha/.3); - for(const e of this.sprayBeads)e.sp.position.set(e.vx*t,e.vy*t-e.vz*t+230*t*t),e.sp.alpha=.85*(1-jLi(t/e.life)); - t>.6&&(this.spray.visible=!1)} - drawWater(t){ - const i=Math.max(0,t),s=this.material.tier,e=(.22+.11*s+.018*this.power)*(this.miss?.75:1); - for(let o=0; - o<this.rings.length; - o++){ - const t=this.rings[o],n=i-.075*o,h=VLi(n/(.38+.11*s+.09*o)),r=.035+(e+.07*o)*(1-(1-h)**3); - t.visible=n>=0,t.scale.set(r,.42*r),t.alpha=(0===o?.55+.12*s:.32+.08*s)*(1-h)**1.5} - const n=(.8+.2*s)*(1+jLi(i/.08)); - this.contact.scale.set(n,.7*n),this.contact.alpha=1-VLi(i/.085); - for(const o of this.crown)o.sp.position.set(o.ox+o.vx*i,o.oy+o.vy*i-o.vz*i+300*i*i),o.sp.alpha=.9*(1-jLi(i/o.life)); - const h=VLi(i/.3),r=(this.miss?.9:1+.18*this.power)*(.6+1.1*(1-(1-h)**2)); - this.foam.scale.set(r,r),this.foam.alpha=.8*(1-h)**1.6; - for(const o of this.droplets)o.sp.position.set(o.ox+o.vx*i,o.oy+o.vy*i-o.vz*i+220*i*i),o.sp.alpha=.75*(1-jLi(i/.24)),o.sp.scale.set(1-.4*jLi(i/.24))} - advance(t){ - var i,s,e,n,h; - if(this.destroyed)return; - this.age+=Math.max(0,t); - const r=this.age-.025; - if(r<0)return; - const o=this.destination(),a=KLi(o,this.side,r); - if(this.released||(this.released=!0,null==(s=(i=this.feedback).release)||s.call(i)),!this.entered&&r>=WLi&&this.enterWater(a.entry,a.angle),this.entered&&this.drawWater(r-WLi),!this.impacted){ - this.placeSpear(a.x,a.y,a.angle,a.submerged),this.trail.clear(); - const t=this.material.tier,i=10+a.air*(16+9*t),s=Math.cos(a.angle),h=Math.sin(a.angle); - for(let e=this.entered?0:3; - e>=1; - e--){ - const n=21+i*e/3,r=21+i*(e-1)/3; - this.trail.moveTo(a.x-s*n,a.y-h*n).lineTo(a.x-s*r,a.y-h*r).stroke({ - color:this.material.trail,width:.4+.15*t+.25*(3-e),alpha:(4-e)*(.06+.035*t)} - )} - if(r<.155)return void this.drawBubbles(a,a.entry,r-WLi); - this.impacted=!0,this.impactPoint={ - x:o.x,y:o.y} - ,this.impactAngle=a.angle,this.bodyAngle=o.angle,this.trail.clear(),this.pressure.position.copyFrom(o),this.pressureEcho.position.copyFrom(o),this.impactGlow.position.copyFrom(o),this.pressure.visible=!this.miss,this.pressureEcho.visible=!this.miss&&this.material.tier>=2,this.impactGlow.visible=!this.miss&&this.material.tier>0,this.pinMark.visible=this.blood.visible=this.bloodWisp.visible=!this.miss,this.result.visible=this.showResult,this.miss||this.target.hit(this.power),null==(n=(e=this.feedback).impact)||n.call(e,this.power),this.startSpray(o)} - const c=Math.max(0,r-.155),l=VLi(c/1.4),u=Math.atan2(Math.sin(o.angle-this.bodyAngle),Math.cos(o.angle-this.bodyAngle)),d=this.impactAngle+(this.miss?0:u),f=this.miss?10*jLi(c/.12):7.2+(1.2+.4*this.material.tier)*jLi((c-.04)/.04),p=this.miss?this.impactPoint:o,w=this.miss?0:Math.sin(90*Math.max(0,c-.035))*Math.max(.03,.14-.04*this.material.tier)*Math.exp(20*-Math.max(0,c-.035)),g=(1-jLi((c-(this.miss?.14:.95))/.4))*Math.min(1,o.alpha/.15),m=d+w; - this.placeSpear(p.x+Math.cos(m)*f,p.y+Math.sin(m)*f,m,this.miss?16+16*jLi(c/.1):30,g,this.miss?0:f),this.drawWound(p,c,g),this.drawBubbles(p,this.waterPoint,c+.04),this.drawImpact(c),this.drawSpray(c),this.result.position.set(this.impactPoint.x+14,this.impactPoint.y-60-12*jLi(l)); - const v=null==(h=this.viewBounds)?void 0:h.call(this); - if(v){ - const t=Math.min(v.width/2,this.result.width/2+6); - this.result.x=Math.max(v.x+t,Math.min(v.x+v.width-t,this.result.x)),this.result.y=Math.max(v.y+22,Math.min(v.y+v.height-38,this.result.y))} - this.result.scale.set(1+.18*(1-jLi((c-.11)/.14))),this.result.alpha=jLi((c-.11)/.06)*(1-jLi((c-.7)/.35)),c>=1.4&&(this.finish(!0),this.destroy({ - children:!0} - ))} - drawImpact(t){ - const i=this.material.tier,s=VLi(this.aim.alpha/.4),e=.025+(.12+.11*i)*jLi(t/(.14+.03*i)); - this.pressure.scale.set(e,.5*e),this.pressure.alpha=(.32+.14*i)*(1-jLi(t/(.2+.07*i)))*s; - const n=VLi((t-.065)/.42),h=.03+.35*(1-(1-n)**3); - this.pressureEcho.scale.set(h,.48*h),this.pressureEcho.alpha=t<.065?0:.6*(1-n)**1.5*s; - const r=VLi(t/(2===i?.22:.1)),o=.07+.035*i+.1*r; - this.impactGlow.scale.set(o,.52*o),this.impactGlow.alpha=(2===i?.44:.18)*(1-r)**2*s} - drawWound(t,i,s){ - if(this.miss)return; - const e=VLi(this.aim.alpha/.4); - this.pinMark.position.copyFrom(t),this.pinMark.alpha=s*VLi(this.aim.alpha),this.pinMark.scale.set(1+.25*(1-jLi(i/.09))); - const n=1-jLi((i-.5)/.85),h=jLi(i/.4),r=this.impactPoint.x+.35*(t.x-this.impactPoint.x),o=this.impactPoint.y+.35*(t.y-this.impactPoint.y)-2*i; - this.blood.position.set(r,o),this.blood.rotation=.4*this.bodyAngle,this.blood.scale.set(.16+.38*h,.12+.25*h),this.blood.alpha=(.42-.14*h)*n*e,this.bloodWisp.position.set(r-this.side*(1+5*i),o-4*i),this.bloodWisp.scale.set(.13+.37*h,.08+.16*h),this.bloodWisp.alpha=.14*jLi(i/.13)*n*e} - drawBubbles(t,i,s){ - const e=this.bubbles.clear(); - if(!(s<0||s>.43))for(let n=0; - n<5; - n++){ - const h=(n+1)/6,r=.5*(1-VLi(s/.43)); - e.circle(i.x+(t.x-i.x)*h+1.4*Math.sin(2.4*n),i.y+(t.y-i.y)*h-s*(4+n),.6+n%2*.35).stroke({ - color:13234160,width:.65,alpha:r} - )} - } - get landed(){ - return this.impacted} - cancel(){ - this.destroyed||this.destroy({ - children:!0} - )} - destroy(t){ - this.destroyed||(this.finish(!1),this.underwater.destroyed||this.underwater.destroy({ - children:!0} - ),this.result.destroyed||this.result.destroy({ - children:!0} - ),this.waterBlur.blurXFilter.destroy(),this.waterBlur.blurYFilter.destroy(),this.waterBlur.destroy(),super.destroy(t??{ - children:!0} - ))} - } - ; - Qt(QLi,"FishingHarpoonFx"); - let ZLi=QLi; - const tDi=new WeakMap; - function iDi(t,i){ - const s=Math.max(0,Math.min(1,i)); - let e,n; - if(t.rig){ - const i=t.rig; - if(e=i,"geometry"in i){ - const t=i.geometry.positions,s=i.columns,e=(i.rows-1)/2; - n=Qt(i=>{ - const n=(1-i)*(s-1),h=Math.min(s-2,Math.floor(n)),r=n-h,o=2*(e*s+h); - return{ - x:t[o]+(t[o+2]-t[o])*r,y:t[o+1]+(t[o+3]-t[o+1])*r} - } - ,"point")} - else n=Qt("bodyPoint"in i?t=>i.bodyPoint(t):t=>({ - x:.5-t,y:0} - ),"point")} - else{ - if(!t.spine)return null; - { - const i=t.spine,s=i.skeleton.findSlot("body"),h=null==s?void 0:s.getAttachment(); - if(!s||!h||!("regionUVs"in h))return null; - const r=h; - let o=tDi.get(r); - if(!o){ - o=[]; - for(let t=0; - t<r.regionUVs.length; - t+=2)Math.abs(r.regionUVs[t+1]-.5)<.001&&o.push({ - u:r.regionUVs[t],index:t} - ); - o.sort((t,i)=>t.u-i.u),tDi.set(r,o)} - if(o.length<2)return null; - e=i; - const a=o,c=new Float32Array(4); - n=Qt(t=>{ - const i=1-t; - let e=0; - for(; - e<a.length-2&&a[e+1].u<i; - )e++; - const n=a[e],h=a[e+1],o=(i-n.u)/(h.u-n.u); - return r.computeWorldVertices(s,n.index,2,c,0,2),r.computeWorldVertices(s,h.index,2,c,2,2),{ - x:c[0]+(c[2]-c[0])*o,y:c[1]+(c[3]-c[1])*o} - } - ,"point")} - } - e.updateLocalTransform(); - const h=e.localTransform.apply(n(s)),r=e.localTransform.apply(n(Math.max(0,s-.015))),o=e.localTransform.apply(n(Math.min(1,s+.015))); - return{ - x:h.x,y:h.y,angle:Math.atan2(r.y-o.y,r.x-o.x)} - } - Qt(iDi,"sampleHarpoonBody"); - const sDi=class{ - static get(t){ - if(this.cache.has(t))return this.cache.get(t); - const i=this.build(t); - return this.cache.set(t,i),i} - static at(t,i,s){ - const e=this.get(t); - if(e){ - const t=Math.min(e.cols-1,Math.max(0,Math.floor(i/e.tile))),n=Math.min(e.rows-1,Math.max(0,Math.floor(s/e.tile))),h=e.owner[n*e.cols+t]; - if(h>=0)return h} - return this.nearest(t,i,s)} - static nearest(t,i,s){ - const e=NAi.topdownInfo(t).points; - let n=0,h=1/0; - return e.forEach((t,e)=>{ - const r=(t.x-i)**2+(t.y-s)**2; - r<h&&(h=r,n=e)} - ),n} - static build(t){ - const i=NAi.topdownInfo(t); - if("tile"!==i.type||!i.verts||!i.tile)return null; - const s=i.cols,e=i.rows,n=i.tile,h=s*e,r=s+1,o=Uint8Array.from(atob(i.verts),t=>t.charCodeAt(0)),a=Qt((t,i)=>{ - const s=i*r+t; - return o[s>>3]>>(7&s)&1} - ,"vert"),c=new Uint8Array(h); - for(let v=0; - v<e; - v++)for(let t=0; - t<s; - t++)c[v*s+t]=a(t,v)+a(t+1,v)+a(t,v+1)+a(t+1,v+1)<=2?1:0; - const l=new Int8Array(h).fill(-1),u=new Int32Array(h).fill(2147483647),d=[],f=[],p=Qt((t,i)=>{ - let s=d.length; - for(d.push(t),f.push(i); - s>0; - ){ - const i=s-1>>1; - if(d[i]<=t)break; - d[s]=d[i],f[s]=f[i],s=i} - d[s]=t,f[s]=i} - ,"push"),w=Qt(()=>{ - const t=f[0],i=d.pop(),s=f.pop(); - if(d.length){ - let t=0; - for(; - ; - ){ - const s=2*t+1,e=s+1; - let n=t,h=i; - if(s<d.length&&d[s]<h&&(n=s,h=d[s]),e<d.length&&d[e]<h&&(n=e,h=d[e]),n===t)break; - d[t]=d[n],f[t]=f[n],t=n} - d[t]=i,f[t]=s} - return t} - ,"pop"); - i.points.forEach((t,i)=>{ - const h=Math.min(e-1,Math.floor(t.y/n))*s+Math.min(s-1,Math.floor(t.x/n)); - 0!==u[h]&&(u[h]=0,l[h]=i,c[h]=1,p(0,h))} - ); - const g=[[1,0,10],[-1,0,10],[0,1,10],[0,-1,10],[1,1,14],[1,-1,14],[-1,1,14],[-1,-1,14]]; - for(; - d.length; - ){ - const t=d[0],i=w(); - if(t>u[i])continue; - const n=i%s,h=(i-n)/s; - for(const[r,o,a]of g){ - const d=n+r,f=h+o; - if(d<0||f<0||d>=s||f>=e)continue; - const w=f*s+d; - if(!c[w])continue; - if(r&&o&&!c[h*s+d]&&!c[f*s+n])continue; - const g=t+a; - g<u[w]&&(u[w]=g,l[w]=l[i],p(g,w))} - } - for(let v=0; - v<h; - v++)if(c[v]&&l[v]<0){ - const i=v%s,e=(v-i)/s; - l[v]=this.nearest(t,(i+.5)*n,(e+.5)*n)} - const m=new Uint8Array(h); - for(let v=0; - v<e; - v++)for(let t=0; - t<s; - t++){ - const i=v*s+t,n=l[i]; - n<0||(t+1<s&&l[i+1]>=0&&l[i+1]!==n||v+1<e&&l[i+s]>=0&&l[i+s]!==n)&&(m[i]=1)} - return{ - cols:s,rows:e,tile:n,owner:l,edge:m,verts:o} - } - static fine(t){ - if(t.fine)return t.fine; - const i=4*t.cols,s=4*t.rows,e=t.cols+1,n=Qt((i,s)=>{ - if(i<0||s<0||i>t.cols||s>t.rows)return 1; - const n=s*e+i; - return t.verts[n>>3]>>(7&n)&1} - ,"vert"),h=Qt((i,s)=>i<0||s<0||i>=t.cols||s>=t.rows?-1:t.owner[s*t.cols+i],"own"),r=new Int8Array(i*s).fill(-1),o=new Uint8Array(i*s),a=new Float32Array(16); - for(let c=0; - c<s; - c++)for(let t=0; - t<i; - t++){ - const s=(t+.5)/4,e=(c+.5)/4,o=Math.floor(s),l=Math.floor(e),u=s-o,d=e-l; - if((n(o,l)*(1-u)+n(o+1,l)*u)*(1-d)+(n(o,l+1)*(1-u)+n(o+1,l+1)*u)*d>.5)continue; - const f=s-.5,p=e-.5,w=Math.floor(f),g=Math.floor(p),m=f-w,v=p-g; - a.fill(0); - let _=-1,M=0; - for(const[t,i,n]of[[0,0,(1-m)*(1-v)],[1,0,m*(1-v)],[0,1,(1-m)*v],[1,1,m*v]]){ - const s=h(w+t,g+i); - s<0||(a[s]+=n,a[s]>M&&(M=a[s],_=s))} - r[c*i+t]=_>=0?_:h(Math.floor(s),Math.floor(e))} - for(let c=0; - c<s; - c++)for(let t=0; - t<i; - t++){ - const e=c*i+t,n=r[e]; - n<0||(t+1<i&&r[e+1]>=0&&r[e+1]!==n||c+1<s&&r[e+i]>=0&&r[e+i]!==n)&&(o[e]=1)} - return t.fine={ - owner:r,edge:o} - } - static paint(t,i,s,e,n,h=!0){ - const r=this.fine(i),o=4*i.cols,a=4*i.rows; - t.width===o&&t.height===a||(t.width=o,t.height=a); - const c=t.getContext("2d"),l=c.createImageData(o,a),u=l.data,d=n>>16&255,f=n>>8&255,p=255&n,w=new Uint8Array(32); - for(let g=0; - g<w.length; - g++)w[g]=s(g)?1:0; - for(let g=0; - g<r.owner.length; - g++){ - const t=r.owner[g]; - if(t<0||!w[t])continue; - const i=t===e,s=4*g; - h&&1===r.edge[g]?(u[s]=i?d:255,u[s+1]=i?f:255,u[s+2]=i?p:255,u[s+3]=i?235:150):(u[s]=255,u[s+1]=255,u[s+2]=i?236:255,u[s+3]=i?46:22)} - c.putImageData(l,0,0)} - } - ; - Qt(sDi,"FishingTerritory"),Zt(sDi,"cache",new Map); - let eDi=sDi; - const nDi=32,hDi=class{ - constructor(t,i,s){ - Zt(this,"cols"),Zt(this,"rows"),Zt(this,"open"),Zt(this,"g"),Zt(this,"came"),Zt(this,"seen"),Zt(this,"shut"),Zt(this,"stamp",0),this.isLand=s,this.cols=Math.ceil(t/nDi),this.rows=Math.ceil(i/nDi); - const e=this.cols*this.rows; - this.open=new Uint8Array(e); - for(let n=0; - n<this.rows; - n++)for(let t=0; - t<this.cols; - t++){ - const i=(t+.5)*nDi,e=(n+.5)*nDi; - this.open[n*this.cols+t]=s(i,e)||s(i-12,e)||s(i+12,e)||s(i,e-12)||s(i,e+12)?0:1} - this.g=new Float32Array(e),this.came=new Int32Array(e),this.seen=new Uint32Array(e),this.shut=new Uint32Array(e)} - nearestOpen(t,i,s=12){ - const e=Math.min(this.cols-1,Math.max(0,Math.floor(t/nDi))),n=Math.min(this.rows-1,Math.max(0,Math.floor(i/nDi))); - if(this.open[n*this.cols+e])return n*this.cols+e; - let h=-1,r=1/0; - for(let o=1; - o<=s&&h<0; - o++)for(let s=n-o; - s<=n+o; - s++)for(let a=e-o; - a<=e+o; - a++){ - if(Math.max(Math.abs(s-n),Math.abs(a-e))!==o||a<0||s<0||a>=this.cols||s>=this.rows)continue; - const c=s*this.cols+a; - if(!this.open[c])continue; - const l=((a+.5)*nDi-t)**2+((s+.5)*nDi-i)**2; - l<r&&(r=l,h=c)} - return h} - center(t){ - const i=t%this.cols; - return{ - x:(i+.5)*nDi,y:((t-i)/this.cols+.5)*nDi} - } - lineOpen(t,i,s,e){ - const n=Math.hypot(s-t,e-i),h=Math.max(1,Math.ceil(n/8)); - for(let r=0; - r<=h; - r++){ - const n=t+(s-t)*r/h,o=i+(e-i)*r/h,a=Math.floor(n/nDi),c=Math.floor(o/nDi); - if(a<0||c<0||a>=this.cols||c>=this.rows||!this.open[c*this.cols+a])return!1} - return!0} - find(t,i,s,e){ - const n=this.nearestOpen(t,i),h=this.nearestOpen(s,e); - if(n<0||h<0)return null; - const r=h===Math.floor(e/nDi)*this.cols+Math.floor(s/nDi)?{ - x:s,y:e} - :this.center(h),o=n===Math.floor(i/nDi)*this.cols+Math.floor(t/nDi); - if(o&&this.lineOpen(t,i,r.x,r.y))return[r]; - const a=++this.stamp,c=this.cols,l=this.rows,u=h%c,d=(h-u)/c,f=[],p=[],w=Qt((t,i)=>{ - let s=f.length; - for(f.push(t),p.push(i); - s>0; - ){ - const i=s-1>>1; - if(f[i]<=t)break; - f[s]=f[i],p[s]=p[i],s=i} - f[s]=t,p[s]=i} - ,"push"),g=Qt(()=>{ - const t=p[0],i=f.pop(),s=p.pop(); - if(f.length){ - let t=0; - for(; - ; - ){ - const s=2*t+1,e=s+1; - let n=t,h=i; - if(s<f.length&&f[s]<h&&(n=s,h=f[s]),e<f.length&&f[e]<h&&(n=e,h=f[e]),n===t)break; - f[t]=f[n],p[t]=p[n],t=n} - f[t]=i,p[t]=s} - return t} - ,"pop"),m=Qt(t=>{ - const i=t%c,s=(t-i)/c,e=Math.abs(i-u),n=Math.abs(s-d); - return 10*(e+n)-6*Math.min(e,n)} - ,"h"); - this.g[n]=0,this.came[n]=-1,this.seen[n]=a,w(m(n),n); - let v=!1; - const _=[[1,0,10],[-1,0,10],[0,1,10],[0,-1,10],[1,1,14],[1,-1,14],[-1,1,14],[-1,-1,14]]; - for(; - f.length; - ){ - const t=g(); - if(this.shut[t]===a)continue; - if(this.shut[t]=a,t===h){ - v=!0; - break} - const i=t%c,s=(t-i)/c,e=this.g[t]; - for(const[n,h,r]of _){ - const o=i+n,u=s+h; - if(o<0||u<0||o>=c||u>=l)continue; - const d=u*c+o; - if(!this.open[d]||this.shut[d]===a)continue; - if(n&&h&&(!this.open[s*c+o]||!this.open[u*c+i]))continue; - const f=e+r; - this.seen[d]===a&&f>=this.g[d]||(this.seen[d]=a,this.g[d]=f,this.came[d]=t,w(f+m(d),d))} - } - if(!v)return null; - const M=[]; - for(let A=h; - -1!==A&&A!==n; - A=this.came[A])M.push(this.center(A)); - M.reverse(),M[M.length-1]=r; - const b=[]; - let y=o?{ - x:t,y:i} - :this.center(n),E=-1; - for(o||b.push(y); - E<M.length-1; - ){ - let t=M.length-1; - for(; - t>E+1&&!this.lineOpen(y.x,y.y,M[t].x,M[t].y); - )t--; - b.push(M[t]),y=M[t],E=t} - return b} - } - ; - Qt(hDi,"FishingPath"); - let rDi=hDi; - const oDi=Qt(t=>Math.max(0,Math.min(1,t)),"clamp01$3"); - function aDi(t,i,s){ - const e=oDi((s-t)/(i-t)); - return e*e*(3-2*e)} - function cDi(t,i){ - return.38+.62*aDi(.12,.88,.5+.5*Math.sin(.19*t+i))} - function lDi(t){ - return t+.18*Math.sin(t)} - function uDi(t,i,s,e,n,h){ - const r=t-.5,o=(i-.5)*s,a=Math.sign(o),c=Math.max(0,Math.abs(o)-.07),l=aDi(.07,.49*s,Math.abs(o)),u=aDi(.9,.4,t),d=lDi(e)-.85*l-.65*u,f=(.18+.56*n)*Math.sin(d)*Math.pow(l,.65)+a*h*.13*l,p=c*Math.sin(f),w=aDi(.34,.02,t); - return{ - x:r-.16*p+l*l*.016*Math.sin(d-.5),y:a*(Math.min(Math.abs(o),.07)+c*Math.cos(f))+w*w*.012*Math.sin(.62*e-3.5*(1-t))} - } - function dDi(t,i,s){ - const e=aDi(.38,1,t); - return.042*(.55+.45*s)*e*e*Math.sin(lDi(i)-3.2*t)} - function fDi(t,i){ - const s=lDi(t); - return{ - pitch:(.14+.22*i)*Math.sin(s),yaw:.32*i*Math.sin(s-.6)} - } - Qt(aDi,"smoothRange"),Qt(cDi,"swimEffort"),Qt(lDi,"strokePhase"),Qt(uDi,"mantaVertex"),Qt(dDi,"sharkTail"),Qt(fDi,"whaleStroke"); - const pDi={ - catfish:{ - k:5.7,slip:.55} - ,eel:{ - k:9,slip:.7} - ,megalodon:{ - k:3.2,slip:.32} - ,whaleShark:{ - k:3.2,slip:.38} - ,sturgeon:{ - k:4.6,slip:.5} - } - ; - function wDi(t,i,s){ - const e=pDi[t]; - return e?e.k*i/(e.slip*s):null} - function gDi(t,i){ - return"manta"===t||"turtle"===t?0:"catfish"===t?aDi(.12,.6,i):"eel"===t||"serpent"===t?1:aDi(.38,.9,i)} - function mDi(t,i,s,e,n=!1){ - const h=aDi(0,.68,(t/(2*Math.PI)%1+1)%1)*Math.PI*2,r=.55+.45*i; - return{ - sweep:e*(n?.08:.31)*r*Math.sin(h)+s*(n?.12:.07),span:Math.cos((n?.16:.7)*r*Math.sin(h))*(1-e*s*.025)} - } - function vDi(t,i,s){ - return(.006+.06*Math.pow(aDi(.12,1,t),1.5))*(.45+.55*s)*Math.sin(i-t*pDi.catfish.k)} - function _Di(t,i,s){ - const e=.12*s+.035*Math.sin(i-2.7),n=.32+1.3*Math.abs(Math.sin(e)); - return 1-aDi(.18,.1,t)*(1-n)} - function MDi(t,i,s){ - return(.02+.028*t)*(.7+.3*s)*Math.sin(i-t*pDi.eel.k)} - Qt(wDi,"bodyPhaseRate"),Qt(gDi,"bodyFlex"),Qt(mDi,"turtleFlipperPose"),Qt(vDi,"catfishSway"),Qt(_Di,"catfishTailProjection"),Qt(MDi,"eelSway"); - const bDi=-.02,yDi=[[0,0],[.05,.02],[.1,.021],[.14,.018],[.2,.026],[.34,.037],[.5,.05],[.64,.062],[.76,.072],[.86,.079],[.92,.08],[.955,.073],[.98,.058],[.995,.035],[1,0]]; - function EDi(t){ - if(t<=0||t>=1)return 0; - for(let i=1; - i<yDi.length; - i++){ - const[s,e]=yDi[i]; - if(t<=s){ - const[n,h]=yDi[i-1]; - return h+(e-h)*(t-n)/(s-n)} - } - return 0} - function ADi(t,i,s,e,n){ - const h=Math.abs(i),r=i<0?-1:1,o=EDi(t); - if(t<.6||h<=o+.004)return{ - x:0,y:0} - ; - const a=Qt((s,e,n)=>{ - const h=Math.cos(n),r=Math.sin(n),o=t-s,a=i-e; - return{ - x:s+o*h-a*r-t,y:e+o*r+a*h-i} - } - ,"turn"),c=.05*r,l=Math.hypot(t-.985,i-c),u=.072*r,d=Math.hypot(t-.84,i-u),f=aDi(.72,.82,t)*aDi(o+.004,o+.12,h),p=(1-aDi(.06,.1,d))*aDi(o+.004,o+.05,h)*(1-f),w=(r*(.08*Math.sin(.8*s+1.3-7*l)+.06*e)-.14*n)*aDi(0,.06,l),g=r*(.16*Math.sin(.6*s+(r>0?0:.9))+.06*e)*aDi(0,.04,d),m=a(.985,c,w),v=a(.84,u,g); - return{ - x:m.x*f+v.x*p,y:m.y*f+v.y*p} - } - Qt(EDi,"catfishHalf"),Qt(ADi,"catfishAppendage"); - const SDi=Qt((t,i)=>Math.atan2(Math.sin(t-i),Math.cos(t-i)),"chainAngDiff"); - function TDi(t,i,s,e,n,h){ - const r=-.06*e,o=.01*e,a=h-n,c=new Float32Array(113),l=new Float32Array(113),u=new Float32Array(113),d=Qt(t=>i+SDi(s(Math.max(0,t)),i)*aDi(n+.3*a,n+.8*a,t/e),"ang"); - c[6]=t.x,l[6]=t.y,u[6]=d(0); - for(let f=7; - f<=112; - f++){ - const t=r+f*o,i=d(t-o/2); - c[f]=c[f-1]-Math.cos(i)*o,l[f]=l[f-1]-Math.sin(i)*o,u[f]=d(t)} - for(let f=5; - f>=0; - f--){ - const t=r+f*o,i=d(t+o/2); - c[f]=c[f+1]+Math.cos(i)*o,l[f]=l[f+1]+Math.sin(i)*o,u[f]=d(t)} - return{ - x:c,y:l,a:u,b0:r,db:o,n:112} - } - function CDi(t,i){ - const s=Math.max(0,Math.min(t.n,(i-t.b0)/t.db)),e=Math.min(t.n-1,Math.floor(s)),n=s-e; - return{ - x:t.x[e]+(t.x[e+1]-t.x[e])*n,y:t.y[e]+(t.y[e+1]-t.y[e])*n,a:t.a[e]+SDi(t.a[e+1],t.a[e])*n} - } - Qt(TDi,"whaleChain"),Qt(CDi,"chainAt"); - const ODi={ - manta:[33,33],catfish:[49,17],eel:[65,5]} - ,IDi=class extends jy{ - constructor(t,i){ - const[s,e]=ODi[t]; - super({ - texture:i,verticesX:s,verticesY:e} - ),Zt(this,"columns"),Zt(this,"rows"),Zt(this,"aspect"),this.kind=t,this.autoResize=!1,this.columns=s,this.rows=e,this.aspect=i.height/i.width,this.eventMode="none"} - pose(t,i,s,e,n){ - const h=this.geometry.positions; - if("manta"===this.kind){ - const r=n(.5*t),o=Math.cos(r.a),a=Math.sin(r.a); - for(let n=0; - n<this.rows; - n++)for(let c=0; - c<this.columns; - c++){ - const l=uDi(c/(this.columns-1),n/(this.rows-1),this.aspect,i,s,e),u=2*(n*this.columns+c); - h[u]=r.x+(o*l.x-a*l.y)*t,h[u+1]=r.y+(a*l.x+o*l.y)*t} - } - else{ - const r="catfish"===this.kind?vDi:MDi,o=1.05; - for(let a=0; - a<this.columns; - a++){ - const c=a/(this.columns-1),l=1-c,u=n(l*t),d=r(l,i,s)*t,f=(r(l+.002,i,s)-r(l-.002,i,s))/.004,p=u.a-Math.atan(f),w=Math.cos(p),g=Math.sin(p),m="catfish"===this.kind?_Di(bDi+c*o,i,e):1; - for(let n=0; - n<this.rows; - n++){ - const r=(n/(this.rows-1)-.5)*this.aspect; - let l=0,f=r*t; - if("catfish"===this.kind){ - const n=ADi(bDi+c*o,r*o,i,s,e); - l=n.x/o*t,f=(r+n.y/o)*t} - f*=m; - const p=2*(n*this.columns+a); - h[p]=u.x-Math.sin(u.a)*d+w*l-g*f,h[p+1]=u.y+Math.cos(u.a)*d+g*l+w*f} - } - } - this.geometry.getBuffer("aPosition").update()} - destroy(t){ - const i=this.geometry; - super.destroy(t),i.destroy()} - } - ; - Qt(IDi,"FishingGiantRig"); - let kDi=IDi; - function xDi(t){ - const i=Array.from({ - length:9} - ,(i,s)=>t.skeleton.findBone(`b${ - s} - `)),s=t.skeleton.findBone("fluke"),e=t.skeleton.findBone("finL"),n=t.skeleton.findBone("finR"); - return(t,h,r,o)=>{ - const a=fDi(h,r); - i.forEach((i,s)=>{ - if(!i)return; - const e=aDi(3,8,s),n=a.pitch*e; - i.rotation=i.data.rotation+(t[s]??0)+a.yaw*e*.3,i.x=i.data.x*Math.cos(n),i.y=i.data.y} - ),s&&(s.scaleX=s.data.scaleX*Math.cos(a.pitch+.12*Math.sin(h-.7)),s.scaleY=s.data.scaleY,s.rotation=s.data.rotation+a.yaw),[e,n].forEach((t,i)=>{ - if(!t)return; - const s=0===i?1:-1,e=.12*Math.sin(.5*h+.25*i+.7)+s*o*.16; - t.rotation=t.data.rotation+s*(2*Math.sin(.5*h+.7)+o*s*4),t.scaleX=t.data.scaleX*Math.cos(e),t.scaleY=t.data.scaleY} - )} - } - Qt(xDi,"whalePoser"); - const RDi={ - R:{ - amplitude:.8,drift:.8,current:3.2} - ,C:{ - amplitude:1.3,drift:1.25,current:1.25} - ,O:{ - amplitude:1.85,drift:1.7,current:.55} - } - ,PDi=.83205,NDi=.5547,LDi=[{ - x:.83205,y:.5547,k:2*Math.PI/290,w:2*Math.PI/9.6,a:.64,phase:0} - ,{ - x:.36,y:.93295,k:2*Math.PI/190,w:2*Math.PI/6.7,a:.25,phase:1.7} - ,{ - x:-.62,y:.7846,k:2*Math.PI/410,w:2*Math.PI/14.3,a:.11,phase:3.1} - ],DDi=Qt((t,i,s)=>Math.max(i,Math.min(s,t)),"clamp$2"); - function GDi(t,i,s){ - const e=DDi((s-t)/(i-t),0,1); - return e*e*(3-2*e)} - function BDi(t,i,s,e){ - let n=0,h=0,r=0,o=0,a=0,c=0; - const l=RDi[e]; - for(const u of LDi){ - const e=(t*u.x+i*u.y)*u.k-s*u.w+u.phase,d=Math.sin(e),f=Math.cos(e),p=u.a*l.amplitude; - n+=p*d,h-=p*u.w*f,r+=p*u.k*f*u.x,o+=p*u.k*f*u.y,a+=u.x*u.a*f*l.drift,c+=u.y*u.a*f*l.drift} - return{ - height:n,velocity:h,slopeX:r,slopeY:o,driftX:a,driftY:c} - } - function UDi(t,i,s,e,n=1/0){ - const h=BDi(t,i,s,e),r=Math.max(0,n),o=Number.isFinite(r)?Math.sin(r*Math.PI*2/.95)*Math.exp(1.8*-r):0; - return{ - x:t+.65*h.driftX,y:i+.65*h.driftY-.95*h.height+1.4*o,rotation:DDi(2.8*h.slopeX+.65*h.slopeY+.1*o,-.14,.14),height:h.height} - } - function FDi(t,i=1){ - return{ - halfLength:(17.2+.9*Math.min(5,t))*i,halfWidth:(0===t?9:8.4+.65*Math.min(5,t))*i} - } - function $Di(t,i,s,e,n,h,r,o=1){ - const a=DDi(h,0,5),c=1-.055*a,l=FDi(a,o),u=BDi(t,i,e,n),d=1-GDi(4,85,r),f=Math.cos(s),p=Math.sin(s); - let w=0,g=0,m=0,v=0,_=0,M=0; - for(const A of LDi){ - const s=A.x*f+A.y*p,h=A.y*f-A.x*p,o=(t*A.x+i*A.y)*A.k-e*A.w+A.phase,u=A.w-Math.max(0,r)*A.k*s,d=u*(.42+.09*a),b=u*(.72+.13*a),y=A.a*RDi[n].amplitude*c,E=y/Math.hypot(1,d),S=y/Math.hypot(1,b),T=o+Math.atan(d),C=o+Math.atan(b); - w+=E*Math.sin(T),g-=E*u*Math.cos(T); - const O=Math.sin(A.k*h*l.halfWidth)/l.halfWidth*S*3.15,I=Math.sin(A.k*s*l.halfLength)/l.halfLength*S*2.25; - m+=O*Math.cos(C),v+=I*Math.cos(C),_+=O*u*Math.sin(C),M+=I*u*Math.sin(C)} - const b=m*(.24+.34*d)+v*d*.1,y=t+u.driftX*c*(.3+.7*d),E=i+u.driftY*c*(.3+.7*d); - return{ - x:y+3*m,y:E-1.25*w+2*v,waterX:y,waterY:E,rotation:s+Math.PI/2+b,scaleX:Math.cos(m),scaleY:Math.cos(v),skew:.6*m,height:w,roll:m,pitch:v,velocity:g,rollVelocity:_,pitchVelocity:M} - } - Qt(GDi,"smoothWater"),Qt(BDi,"sampleWater"),Qt(UDi,"bobberFloatPose"),Qt(FDi,"hullSize"),Qt($Di,"boatFloatPose"); - const HDi={ - full:{ - points:220,foam:96,ripples:6,spacing:4} - ,nearby:{ - points:56,foam:12,ripples:4,spacing:8} - } - ; - function WDi(t,i){ - const s=FDi(t.level,t.hullScale),e=Math.max(0,-t.velocity-i*s.halfWidth*(t.rollVelocity??0)+Math.abs(t.pitchVelocity??0)*s.halfLength*.25),n=Math.max(0,-i*(t.roll??0)*8); - return Math.min(1.6,.7*e+.55*n+.035*RDi[t.zone].current)} - Qt(WDi,"hullWaterPressure"); - const VDi=class{ - constructor(t="full",i=719){ - Zt(this,"points",[]),Zt(this,"foam",[]),Zt(this,"ripples",[]),Zt(this,"last",null),Zt(this,"group",0),Zt(this,"distance",0),Zt(this,"bubbles",0),Zt(this,"contact",[0,0]),Zt(this,"threshold",[1,1]),Zt(this,"anchor",null),this.detail=t,this.seed=i,this.reset()} - random(){ - return this.seed=Math.imul(this.seed,1664525)+1013904223>>>0,this.seed/4294967296} - reset(){ - this.points=[],this.foam=[],this.ripples=[],this.last=null,this.bubbles=this.distance=0,this.group++,this.anchor=null,this.contact=[.7*this.random(),.7*this.random()],this.threshold=[.8+.4*this.random(),.8+.4*this.random()]} - update(t,i){ - const{ - x:s,y:e,heading:n,speed:h,level:r,zone:o} - =i; - (t>.5||this.anchor&&Math.hypot(s-this.anchor.x,e-this.anchor.y)>80)&&(this.reset(),t=0),t=Math.max(0,t),this.anchor={ - x:s,y:e} - ; - const a=HDi[this.detail],c="nearby"===this.detail,l=RDi[o].current,u=PDi*l,d=NDi*l; - for(const _ of this.points)_.age+=t,_.x+=u*t*.35,_.y+=d*t*.35; - this.points=this.points.filter(t=>t.age<4.8); - for(const _ of this.foam){ - _.age+=t; - const i=Math.exp(-1.25*t),s=(1-i)/1.25; - _.x+=u*t+_.vx*s,_.y+=d*t+_.vy*s,_.vx*=i,_.vy*=i} - this.foam=this.foam.filter(t=>t.age<t.life); - for(const _ of this.ripples)_.age+=t,_.x+=u*t*.55,_.y+=d*t*.55; - this.ripples=this.ripples.filter(t=>t.age<t.life); - const f=GDi(3,150,h),p=Math.cos(n),w=Math.sin(n),g=FDi(r,i.hullScale),m={ - x:s-p*g.halfLength*.83,y:e-w*g.halfLength*.83} - ; - if(h>4){ - this.last||(this.last=m,this.group++); - let i=Math.hypot(m.x-this.last.x,m.y-this.last.y); - for(; - i>=a.spacing; - ){ - const t=a.spacing/i; - this.last={ - x:this.last.x+(m.x-this.last.x)*t,y:this.last.y+(m.y-this.last.y)*t} - ,this.distance+=a.spacing,this.points.push({ - ...this.last,nx:-w,ny:p,age:0,power:f,distance:this.distance,group:this.group} - ),i-=a.spacing} - for(this.bubbles+=t*(3+20*f)*GDi(3,18,h)*(c?.3:1); - this.bubbles>=1; - ){ - this.bubbles--; - const t=this.random()<.5?-1:1,i=this.random()<.72,n=i?g.halfLength*(.3+.3*this.random()):.8*-g.halfLength,h=t*g.halfWidth*(i?.95:.45); - this.foam.push({ - x:s+p*n-w*h,y:e+w*n+p*h,vx:-p*(6+12*f)-w*t*(2+4*f),vy:-w*(6+12*f)+p*t*(2+4*f),age:0,life:1.5+1.5*this.random(),size:2.1+this.random()*(1.5+2.5*f),alpha:.18+.22*f,rotation:this.random()*Math.PI*2,frame:Math.floor(8*this.random())} - )} - } - else this.last=null,this.bubbles=0; - const v=1-GDi(8,55,h); - for(let _=0; - _<2; - _++){ - const h=0===_?1:-1,r=WDi(i,h); - if(this.contact[_]+=t*(.13+.46*r)*v,this.contact[_]<this.threshold[_])continue; - this.contact[_]-=this.threshold[_],this.threshold[_]=.8+.4*this.random(); - const o=DDi(5*-(i.pitchVelocity??0),-.3,.3)*g.halfLength; - this.ripples.push({ - x:s+p*o,y:e+w*o,age:0,life:3.5+1.1*this.random(),rotation:n+Math.PI/2,start:(1===h?0:Math.PI)-.9+.3*(this.random()-.5),span:1.5+.45*this.random(),spread:4.5+1.4*r,seed:this.random()*Math.PI*2,width:g.halfWidth+.6,length:g.halfLength,alpha:.23+.08*r} - )} - this.points.length>a.points&&this.points.splice(0,this.points.length-a.points),this.foam.length>a.foam&&this.foam.splice(0,this.foam.length-a.foam),this.ripples.length>a.ripples&&this.ripples.splice(0,this.ripples.length-a.ripples)} - } - ; - Qt(VDi,"BoatWaterModel"); - let jDi=VDi; - const KDi=class t extends Ke{ - constructor(t="full",i=719){ - super(),Zt(this,"model"),Zt(this,"surface",new ep),Zt(this,"trail",new ep),Zt(this,"contact",new ep),Zt(this,"bubbles",new Ke),Zt(this,"crests",new Ke),Zt(this,"waterlines",new Ke),Zt(this,"pool",[]),Zt(this,"crestPool",[]),Zt(this,"waterlinePool",[]),Zt(this,"renderElapsed",1),this.detail=t,this.model=new jDi(t,i),this.eventMode="none",this.addChild(this.surface,this.trail,this.crests,this.contact,this.waterlines,this.bubbles)} - static crestTexture(t){ - if(this.crestTextures[t])return this.crestTextures[t]; - const i=document.createElement("canvas"); - i.width=i.height=128; - const s=i.getContext("2d"),e=1.5+.15*t; - s.lineCap="round"; - for(let h=0; - h<48; - h++){ - const i=(h+.5)/48,n=Math.sin(i*Math.PI)**.8; - for(const[r,o,a]of[[1.7,4.5,`rgba(11,71,94,${ - .38*n} - )`],[0,2.8,`rgba(224,245,239,${ - n} - )`]]){ - const i=Qt(i=>{ - const s=-e/2+i/48*e,n=44+.7*Math.sin(4*s+1.9*t)+r; - return[64+Math.cos(s)*n,64+Math.sin(s)*n]} - ,"at"),n=i(h),c=i(h+1); - s.beginPath(),s.moveTo(n[0],n[1]),s.lineTo(c[0],c[1]),s.lineWidth=o,s.strokeStyle=a,s.stroke()} - } - const n=ls.from(i); - return n.source.scaleMode="linear",this.crestTextures[t]=n} - reset(){ - this.model.reset(),this.surface.clear(),this.trail.clear(),this.contact.clear(),this.renderElapsed=1,this.pool.forEach(t=>t.visible=!1),this.crestPool.forEach(t=>t.visible=!1),this.waterlinePool.forEach(t=>t.visible=!1)} - update(t,i,s,e=()=>!0){ - if(this.model.update(t,i),this.renderElapsed+=t,"nearby"===this.detail&&this.renderElapsed<1/30)return; - this.renderElapsed%=1/30,"full"===this.detail&&this.drawSurface(i,e),this.drawTrail(s.wake),this.drawContact(i,e),this.drawRipples(e); - let n=0; - for(const h of this.model.foam){ - if(!e(h.x,h.y))continue; - let t=this.pool[n]; - t||(t=new Xe(s.puffs[h.frame]),t.anchor.set(.5),this.pool.push(t),this.bubbles.addChild(t)); - const i=h.age/h.life; - t.texture=s.puffs[h.frame],t.visible=!0,t.position.set(h.x,h.y),t.rotation=h.rotation+.12*i,t.width=h.size*(1+1.1*i),t.height=h.size*(.72+.85*i),t.alpha=h.alpha*GDi(0,.12,i)*Math.pow(1-i,1.6),t.tint=14873839,n++} - for(let h=n; - h<this.pool.length; - h++)this.pool[h].visible=!1} - drawSurface(t,i){ - const s=this.surface.clear(),{ - x:e,y:n,time:h,zone:r} - =t,o=RDi[r].amplitude; - for(let a=-3; - a<=3; - a++)for(let t=-3; - t<=3; - t++){ - const c=Math.floor(e/55)+t,l=Math.floor(n/55)+a,u=((Math.imul(c,374761393)^Math.imul(l,668265263))>>>0)/4294967296,d=55*c+15*Math.sin(51*u),f=55*l+15*Math.cos(37*u),p=Math.hypot(d-e,f-n); - if(p>170||!i(d,f))continue; - const w=BDi(d,f,h,r),g=.06*GDi(.15,.8,w.height/o)*(1-GDi(85,170,p)); - if(g<.003)continue; - const m=-.5547,v=PDi,_=6+10*u,M=d+w.driftX,b=f+w.driftY; - s.moveTo(M-m*_,b-v*_).quadraticCurveTo(M-1.6641,b-1.1094,M+m*_,b+v*_).stroke({ - color:13823720,width:.8,alpha:g,cap:"round"} - ),s.moveTo(M-m*_+1.3,b-v*_+1.3).quadraticCurveTo(M-1.6641+1.3,b-1.1094+1.3,M+m*_+1.3,b+v*_+1.3).stroke({ - color:739166,width:1.8,alpha:.45*g,cap:"round"} - )} - } - drawTrail(t){ - const i=this.trail.clear(),s=this.model.points; - for(let e=1; - e<s.length; - e++){ - const n=s[e-1],h=s[e],r=Math.hypot(h.x-n.x,h.y-n.y); - if(n.group!==h.group||r>20||r<.1||n.nx*h.nx+n.ny*h.ny<.8)continue; - const o=n.age/4.8,a=h.age/4.8,c=Math.pow(Math.max(0,1-.5*(o+a)),1.8),l=.5*(n.power+h.power),u=6+n.age*(5+9*n.power),d=6+h.age*(5+9*h.power); - for(const t of[-1,1]){ - const s=n.x+n.nx*u*t,e=n.y+n.ny*u*t,r=h.x+h.nx*d*t,o=h.y+h.ny*d*t; - i.moveTo(s,e+1).lineTo(r,o+1).stroke({ - color:671828,width:2,alpha:c*l*.035} - ),i.moveTo(s,e).lineTo(r,o).stroke({ - color:14349294,width:.7+.3*l,alpha:c*l*.2} - )} - const f=3+n.age*(1.5+n.power),p=3+h.age*(1.5+h.power),w=.5*(f+p),g=(h.x-n.x)/r,m=(h.y-n.y)/r,v=-m,_=g; - if("nearby"===this.detail)continue; - const M=100,b=n.distance%M,y=new Ci(g*M/t.width,m*M/t.width,v*w*2/t.height,_*w*2/t.height,n.x-v*w-g*b,n.y-_*w-m*b); - i.poly([n.x+v*f,n.y+_*f,h.x+v*p,h.y+_*p,h.x-v*p,h.y-_*p,n.x-v*f,n.y-_*f]).fill({ - texture:t,matrix:y,textureSpace:"global",alpha:c*(.1+.28*l)} - )} - } - drawContact(i,s){ - const e=this.contact.clear(),n=FDi(i.level,i.hullScale),h=GDi(3,150,i.speed),r=GDi(2,18,i.speed),o=Math.cos(i.heading),a=Math.sin(i.heading),c=Qt((t,s)=>({ - x:i.x+o*t-a*s,y:i.y+a*t+o*s} - ),"point"); - this.waterlinePool.forEach(t=>t.visible=!1); - for(const l of[-1,1]){ - const o=WDi(i,l),a=c(.5*n.halfLength,l*n.halfWidth*.82),u=c(.1*-n.halfLength,l*(n.halfWidth+1)),d=c(.68*-n.halfLength,l*n.halfWidth*.8); - if(!s(a.x,a.y)||!s(d.x,d.y))continue; - const f=(.065+.14*o)*(1-.35*r); - if("nearby"===this.detail){ - const s=-1===l?0:1; - let e=this.waterlinePool[s]; - e||(e=new Xe(t.crestTexture(1)),e.anchor.set(.5),this.waterlinePool[s]=e,this.waterlines.addChild(e)),e.visible=!0,e.position.set(i.x,i.y),e.rotation=i.heading+Math.PI/2,e.scale.set(l*(n.halfWidth+.5)/44,.82*n.halfLength/44),e.alpha=f} - else e.moveTo(a.x+.6,a.y+.8).quadraticCurveTo(u.x+.6,u.y+.8,d.x+.6,d.y+.8).stroke({ - color:737362,width:2.2,alpha:.45*f,cap:"round"} - ),e.moveTo(a.x,a.y).quadraticCurveTo(u.x,u.y,d.x,d.y).stroke({ - color:13954792,width:2,alpha:.2*f,cap:"round"} - ),e.moveTo(a.x,a.y).quadraticCurveTo(u.x,u.y,d.x,d.y).stroke({ - color:15005678,width:.7,alpha:f,cap:"round"} - ); - if(r>0){ - const t=c(n.halfLength+.5,l*(0===i.level?.55*n.halfWidth:.8)),s=c(.62*n.halfLength,l*(n.halfWidth+2+2*h)),o=c(.55*-n.halfLength,l*(n.halfWidth+5+5*h)); - e.moveTo(t.x,t.y).quadraticCurveTo(s.x,s.y,o.x,o.y).stroke({ - color:12379363,width:3+1.5*h,alpha:r*(.025+.025*h),cap:"round"} - ),e.moveTo(t.x,t.y).quadraticCurveTo(s.x,s.y,o.x,o.y).stroke({ - color:15399410,width:.9+.65*h,alpha:r*(.16+.22*h),cap:"round"} - )} - } - } - drawRipples(i){ - let s=0; - for(const e of this.model.ripples){ - const n=e.age/e.life,h=e.age*e.spread/(1+.08*e.age),r=e.alpha*GDi(0,.1,n)*Math.pow(1-n,1.65),o=Math.cos(e.rotation),a=Math.sin(e.rotation),c=e.width+h,l=e.length+.82*h,u=Math.cos(e.start+e.span/2)>0?1:-1; - let d=!0; - for(const t of[-.9,0,.9]){ - const s=Math.cos(t)*c*u,n=Math.sin(t)*l; - if(!i(e.x+o*s-a*n,e.y+a*s+o*n)){ - d=!1; - break} - } - if(!d)continue; - const f=t.crestTexture(Math.min(3,Math.floor(e.seed/(2*Math.PI)*4))); - let p=this.crestPool[s]; - p||(p=new Xe(f),p.anchor.set(.5),this.crestPool.push(p),this.crests.addChild(p)),p.texture=f,p.visible=!0,p.position.set(e.x,e.y),p.rotation=e.rotation,p.scale.set(u*c/44,l/44),p.alpha=r,s++} - for(let t=s; - t<this.crestPool.length; - t++)this.crestPool[t].visible=!1} - } - ; - Qt(KDi,"FishingBoatWater"),Zt(KDi,"crestTextures",[]); - let zDi=KDi; - const YDi={ - fish:[[0,.001],[.06,.003],[.16,.006],[.23,.013],[.34,.032],[.48,.061],[.64,.078],[.76,.073],[.86,.057],[.94,.038],[.98,.021],[1,.002]],shark:[[0,.001],[.06,.003],[.13,.006],[.2,.014],[.32,.033],[.46,.058],[.6,.077],[.72,.077],[.83,.063],[.94,.036],[.98,.018],[1,.002]],megalodon:[[0,.001],[.07,.004],[.15,.009],[.24,.023],[.38,.051],[.53,.078],[.67,.089],[.78,.083],[.88,.064],[.96,.033],[1,.002]],whaleShark:[[0,.001],[.07,.004],[.16,.009],[.28,.027],[.43,.054],[.6,.078],[.77,.09],[.89,.094],[.96,.079],[.99,.05],[1,.012]],sturgeon:[[0,.001],[.06,.003],[.15,.007],[.27,.019],[.43,.044],[.59,.066],[.72,.07],[.81,.056],[.88,.035],[.96,.012],[1,.001]]} - ,qDi={ - fish:[[.48,0],[.53,.062],[.565,.104],[.59,.102],[.63,.077],[.71,.045]],shark:[[.46,0],[.49,.06],[.52,.174],[.535,.186],[.555,.16],[.6,.114],[.66,.081],[.71,.055]],megalodon:[[.43,0],[.48,.06],[.52,.172],[.54,.182],[.565,.155],[.63,.106],[.71,.078]],whaleShark:[[.42,0],[.47,.06],[.5,.183],[.525,.202],[.56,.179],[.63,.12],[.74,.076]],sturgeon:[[.51,0],[.55,.08],[.58,.142],[.605,.155],[.635,.14],[.7,.09],[.77,.06]]} - ,XDi={ - fish:[[.3,0],[.35,.041],[.39,.047],[.44,.03]],shark:[[.27,0],[.305,.049],[.325,.06],[.355,.051],[.41,.036]],megalodon:[[.26,0],[.295,.055],[.32,.063],[.36,.05],[.43,.032]],whaleShark:[[.23,0],[.28,.055],[.3,.071],[.34,.062],[.41,.03]],sturgeon:[[.2,0],[.24,.045],[.265,.062],[.3,.054],[.36,.024]]} - ,JDi={ - fish:[[0,0],[.025,.085],[.08,.064],[.17,0]],shark:[[0,0],[.025,.16],[.075,.109],[.18,0]],megalodon:[[0,0],[.027,.17],[.08,.114],[.19,0]],whaleShark:[[0,0],[.025,.18],[.085,.118],[.2,0]],sturgeon:[[0,0],[.03,.13],[.09,.086],[.2,0]]} - ,QDi={ - fish:[[0,0],[.025,.085],[.08,.064],[.17,0]],shark:[[.045,0],[.065,.074],[.115,.043],[.18,0]],megalodon:[[.025,0],[.045,.115],[.105,.075],[.19,0]],whaleShark:[[.04,0],[.065,.1],[.13,.056],[.2,0]],sturgeon:[[.075,0],[.1,.051],[.14,.029],[.2,0]]} - ; - function ZDi(t,i){ - if(i<t[0][0]||i>t[t.length-1][0])return 0; - for(let s=1; - s<t.length; - s++){ - const[e,n]=t[s]; - if(i<=e){ - const[h,r]=t[s-1],o=e-h,a=(i-h)/o,c=Qt(i=>{ - if(0===i)return(t[1][1]-t[0][1])/(t[1][0]-t[0][0]); - if(i===t.length-1)return(t[i][1]-t[i-1][1])/(t[i][0]-t[i-1][0]); - const s=t[i-1],e=t[i],n=t[i+1],h=e[0]-s[0],r=n[0]-e[0],o=(e[1]-s[1])/h,a=(n[1]-e[1])/r; - return o*a<=0?0:3*(h+r)/((2*r+h)/o+(r+2*h)/a)} - ,"slope"),l=a*a,u=l*a; - return(2*u-3*l+1)*r+(u-2*l+a)*o*c(s-1)+(-2*u+3*l)*n+(u-l)*o*c(s)} - } - return t[t.length-1][1]} - function tGi(t,i,s,e){ - if("shark"===t)return dDi(i,s,e); - if("megalodon"===t||"whaleShark"===t)return dDi(i,s,e)*("megalodon"===t?.72:.88); - if("sturgeon"===t){ - const t=aDi(.3,1,i); - return.043*(.45+.55*e)*t*t*Math.sin(s-4.6*i)} - const n=aDi(.28,1,i); - return.048*(.4+.6*e)*n*n*Math.sin(s-4.1*i)} - function iGi(t,i){ - return 2*Math.PI*Math.max(.65,Math.min(2.2,.35+t/Math.max(10,.9*i)))} - function sGi(t,i){ - return Math.max(.001,ZDi(YDi[t],i))} - function eGi(t,i,s,e){ - const n=sGi(t,i),h=ZDi(qDi[t],i),r=ZDi(XDi[t],i),o="megalodon"===t||"whaleShark"===t,a=e*(o?.075:.12)+(o?.025:.035)*Math.sin(s-2.7),c=ZDi(JDi[t],i)*Math.sin(a),l=-ZDi(QDi[t],i)*Math.sin(a),u=Qt(t=>Math.max(h*Math.cos(.12+t*e*.2+.055*Math.sin(.5*s)),r),"fin"); - return{ - left:Math.max(n,u(1),c,l),right:Math.max(n,u(-1),-c,-l)} - } - Qt(ZDi,"profile"),Qt(tGi,"fishBodySway"),Qt(iGi,"fishTailRate"),Qt(sGi,"topFishBodyHalfWidth"),Qt(eGi,"topFishSection"); - const nGi=new Map; - function hGi(t){ - const i=nGi.get(t); - if(i)return i; - const s=document.createElement("canvas"); - s.width=384,s.height=96; - const e=s.getContext("2d"),n=s.width,h=s.height,r=e.createImageData(n,h); - for(let l=0; - l<n; - l++){ - const i=l/(n-1),s=eGi(t,i,0,0).left,e=sGi(t,i); - for(let t=0; - t<h; - t++){ - const i=Math.abs(t/(h-1)*2-1),o=i*s/e,a=Math.min(1,(1-i)/.06),c=(o>1?.72:.87+.13*Math.cos(o*Math.PI/2))*a,u=4*(t*n+l); - r.data[u]=r.data[u+1]=r.data[u+2]=255,r.data[u+3]=Math.round(255*c)} - } - e.putImageData(r,0,0); - const o=Qt((i,s)=>[i*n,h*(.5+s/(2*eGi(t,i,0,0).left))],"uv"),a=Qt((i,s,r,a)=>{ - const[c,l]=o(i,s),u=eGi(t,i,0,0).left; - e.fillStyle=`rgba(255,255,255,${ - a} - )`,e.beginPath(),e.ellipse(c,l,r*n,r*h/(2*u),0,0,2*Math.PI),e.fill()} - ,"dot"); - if(e.globalCompositeOperation="destination-out","whaleShark"===t)for(let l=0; - l<24; - l++)for(let i=-3; - i<=3; - i++){ - const s=.23+.029*l+Math.abs(i)%2*.012; - a(s,i*sGi(t,s)*.23+.0015*Math.sin(2.4*l+i),.0034+9e-4*Math.sin(1.7*l+2*i)**2,.48)} - else if("sturgeon"===t)for(let l=0; - l<13; - l++)for(const i of[-1,0,1]){ - const s=.24+.045*l,n=i*sGi(t,s)*.69,h=[[s-.012,n],[s,n-.004],[s+.009,n],[s,n+.004]]; - e.beginPath(),h.forEach(([t,i],s)=>{ - const[n,h]=o(t,i); - s?e.lineTo(n,h):e.moveTo(n,h)} - ),e.closePath(),e.fillStyle=`rgba(255,255,255,${ - 0===i?.43:.3} - )`,e.fill()} - else for(let l=0; - l<130; - l++)a(.3+.004*l,0,.0018,.07); - e.globalCompositeOperation="source-over"; - const c=ls.from(s); - return c.source.scaleMode="linear",nGi.set(t,c),c} - Qt(hGi,"megafaunaTexture"); - const rGi=class t extends jy{ - constructor(i,s){ - const e=s??("fish"===i?49:129); - super({ - texture:"fish"===i||"shark"===i?t.edgeTexture():hGi(i),verticesX:e,verticesY:5} - ),Zt(this,"columns"),Zt(this,"rows",5),this.kind=i,this.autoResize=!1,this.columns=e,this.eventMode="none"} - static edgeTexture(){ - if(this.feather)return this.feather; - const t=document.createElement("canvas"); - t.width=4,t.height=64; - const i=t.getContext("2d"),s=i.createLinearGradient(0,0,0,64); - return s.addColorStop(0,"rgba(255,255,255,0)"),s.addColorStop(.13,"white"),s.addColorStop(.87,"white"),s.addColorStop(1,"rgba(255,255,255,0)"),i.fillStyle=s,i.fillRect(0,0,4,64),this.feather=ls.from(t)} - pose(t,i,s,e,n){ - const h=this.geometry.positions; - for(let r=0; - r<this.columns; - r++){ - const o=r/(this.columns-1),a=1-o,c=n(a*t),l=tGi(this.kind,a,i,s),u=(tGi(this.kind,a+.002,i,s)-tGi(this.kind,a-.002,i,s))/.004,d=c.a-Math.atan(u),f=eGi(this.kind,o,i,e); - for(let i=0; - i<this.rows; - i++){ - const s=i/(this.rows-1)*2-1,e=s*(s<0?f.left:f.right)*t,n=2*(i*this.columns+r); - h[n]=c.x-Math.sin(c.a)*l*t-Math.sin(d)*e,h[n+1]=c.y+Math.cos(c.a)*l*t+Math.cos(d)*e} - } - this.geometry.getBuffer("aPosition").update()} - swim(t,i,s,e=0){ - this.pose(t,i,s,e,i=>{ - const s=Math.max(0,i/t-.25); - return{ - x:.5*t-i,y:e*t*s*s*.1,a:-Math.atan(e*s*.2)} - } - )} - destroy(t){ - const i=this.geometry; - super.destroy(t),i.destroy()} - } - ; - Qt(rGi,"FishingTopFishRig"),Zt(rGi,"feather",null); - let oGi=rGi; - const aGi=["stream","swirl","scatter","ball","predator","ribbon","pods","leap","dart"],cGi={ - SPEED:40,BOAT_R:46,FADE_IN:1.2,FADE_OUT:1.6,MARGIN:70,COUNT:{ - R:[50,70],C:[70,90],O:[90,120]} - ,FIRST_S:[20,40],EVERY_S:[60,120],SWIRL_IN:58,SWIRL_OUT:44,SWIRL_HOLD:6.5,SWIRL_DIST:[90,150],RIBBON_GAP:9,DART_ROUND:48,RIBBON_V:70,DART_V:110,PRED_V:95,PRED_L:40,PRED_R:70,PRED_RUN:90,BALL_IN:4,BALL_RUN:110,BALL_HOLD:7,BALL_OUT:2.4,LEAP_P:.12,LEAP_S:.55,LEAP_H:22,SIZE:{ - R:.9,C:1,O:1.2} - } - ,lGi=2*Math.PI,uGi=Qt((t,i,s)=>Math.max(i,Math.min(s,t)),"clamp$1"),dGi=Qt((t,i,s)=>{ - const e=uGi((s-t)/(i-t),0,1); - return e*e*(3-2*e)} - ,"smooth$3"),fGi=Qt((t,i,s)=>t+(i-t)*s,"lerp$1"); - function pGi(t){ - let i=t>>>0; - return()=>{ - i=i+1831565813>>>0; - let t=i; - return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296} - } - Qt(pGi,"schoolRng"); - const wGi=Qt((t,i)=>{ - const[s,e]=cGi.COUNT[t]; - return Math.round(s+i()*(e-s))} - ,"schoolCount"),gGi=Qt((t,i)=>{ - const[s,e]=t?cGi.FIRST_S:cGi.EVERY_S; - return s+i()*(e-s)} - ,"nextSchoolDelay"); - function mGi(t){ - const i=[t[0],...t,t[t.length-1]],s=[]; - for(let e=1; - e<i.length-2; - e++)for(let t=0; - t<24; - t++){ - const n=t/24,h=n*n,r=h*n,[o,a,c,l]=[i[e-1],i[e],i[e+1],i[e+2]],u=Qt((t,i,s,e)=>.5*(2*i+(-t+s)*n+(2*t-5*i+4*s-e)*h+(3*i-t-3*s+e)*r),"f"); - s.push([u(o.x,a.x,c.x,l.x),u(o.y,a.y,c.y,l.y)])} - return s.push([t[t.length-1].x,t[t.length-1].y]),vGi(s)} - function vGi(t){ - const i=[0]; - for(let r=1; - r<t.length; - r++)i.push(i[r-1]+Math.hypot(t[r][0]-t[r-1][0],t[r][1]-t[r-1][1])); - const s=i[i.length-1],e=t.length,n=Qt(i=>Math.atan2(t[i+1][1]-t[i][1],t[i+1][0]-t[i][0]),"seg"),h=t.map((i,s)=>0===s?n(0):s===e-1?n(e-2):Math.atan2(t[s+1][1]-t[s-1][1],t[s+1][0]-t[s-1][0])); - return{ - len:s,at(n){ - if(n<=0){ - const i=h[0]; - return[t[0][0]+Math.cos(i)*n,t[0][1]+Math.sin(i)*n,i]} - if(n>=s){ - const i=h[e-1]; - return[t[e-1][0]+Math.cos(i)*(n-s),t[e-1][1]+Math.sin(i)*(n-s),i]} - let r=0,o=e-1; - for(; - o-r>1; - ){ - const t=r+o>>1; - i[t]<n?r=t:o=t} - const a=(n-i[r])/Math.max(1e-9,i[o]-i[r]),c=Math.atan2(Math.sin(h[o]-h[r]),Math.cos(h[o]-h[r])); - return[fGi(t[r][0],t[o][0],a),fGi(t[r][1],t[o][1],a),h[r]+c*a]} - } - } - function _Gi(t,i){ - let s=1e18,e=0; - for(let n=0; - n<=t.len; - n+=2){ - const[h,r]=t.at(n),o=(h-i.x)**2+(r-i.y)**2; - o<s&&(s=o,e=n)} - return e} - function MGi(t,i,s,e=cGi.SPEED,n={ - } - ){ - const h=Array.isArray(i)?{ - mode:"stream",pts:i} - :i,r=pGi(s),o=40+.7*t,a=14+.14*t,c=[],l=uGi(Math.sqrt(t/80),.8,1.2); - for(let w=0; - w<t; - w++){ - const t=Math.pow(r(),.85),i=2*r()-1,s=Math.pow(Math.sin(Math.PI*uGi(.96*t+.02,0,1)),.8)*(1-.3*t); - c.push({ - d:t*o,w:i*a*s,depth:r(),L:10+4*r(),ph:r()*lGi,p1:r()*lGi,p2:r()*lGi,f1:.6+.5*r(),f2:.9+.6*r(),orbR:(10+36*Math.sqrt(r()))*l,orbA:r()*lGi,orbW:1.55*(.85+.3*r()),br:r()*lGi,sc:r()*lGi,flashAt:.25*r(),r1:r(),r2:r(),r3:r(),pod:0} - )} - const u={ - color:n.color??"deep",sizeK:n.sizeK??1} - ,d=DGi(h,c,o,a,r,s,u); - if(d)return d; - if("swirl"===h.mode){ - const t=mGi(h.inPts),i=mGi(h.outPts),n=_Gi(t,h.center),l=_Gi(i,h.center),d=n/cGi.SWIRL_IN,f=d+cGi.SWIRL_HOLD,p={ - C:h.center,inPath:t,outPath:i,inC:n,outC:l,tArrive:d,tLeave:f,spin:r()<.5?1:-1} - ; - return{ - mode:"swirl",fish:c,D:o,W:a,path:t,v:e,seed:s,swirl:p,dur:f+(i.len-l+.9*o+10)/cGi.SWIRL_OUT,...u} - } - if("stream"!==h.mode&&"scatter"!==h.mode)throw new Error(`fishSchool: ${ - h.mode} - `); - const f=mGi(h.pts),p={ - mode:h.mode,fish:c,D:o,W:a,path:f,v:e,seed:s,dur:(f.len+o)/e,...u} - ; - if("scatter"===h.mode){ - let i=1e18,s=p.dur/2; - for(let a=0; - a<p.dur; - a+=.1){ - let e=0,n=0; - for(let i=0; - i<t; - i++){ - const t=EGi(p,i,a); - e+=t.x,n+=t.y} - const r=(e/t-h.boat.x)**2+(n/t-h.boat.y)**2; - r<i&&(i=r,s=a)} - const e=Math.max(1.5,s-.9),n=c.map((t,i)=>bGi(EGi(p,i,e).x,EGi(p,i,e).y,EGi(p,i,e).a,c[i].w,h.boat)),r=n.reduce((t,i)=>t+i.x,0)/t,o=n.reduce((t,i)=>t+i.y,0)/t; - p.scatter={ - ts:e,dir:n.map(t=>{ - const i=t.x-r,s=t.y-o,e=Math.hypot(i,s)||1; - return[i/e,s/e,e]} - )} - } - return p} - function bGi(t,i,s,e,n,h=cGi.BOAT_R){ - const r=Math.cos(s),o=Math.sin(s),a=t-n.x,c=i-n.y,l=a*r+c*o,u=-a*o+c*r+(e>=0?1:-1)*h*Math.exp(-Math.pow(l/(1.7*h),2)); - return{ - x:n.x+r*l-o*u,y:n.y+o*l+r*u} - } - function yGi(t,i,s=cGi.BOAT_R){ - const e=t.x-i.x,n=t.y-i.y,h=Math.hypot(e,n); - if(h>=2*s||h<1e-6)return t; - const r=s*(h/(h+24))*(1-h/(2*s))**2; - return{ - x:t.x+e/h*r,y:t.y+n/h*r} - } - function EGi(t,i,s){ - const e=t.fish[i],n=5*Math.sin(e.f1*s+e.p1),h=3.5*Math.sin(e.f2*s+e.p2),[r,o,a]=t.path.at(t.v*s-(e.d+n)),c=e.w+h; - return{ - x:r-Math.sin(a)*c,y:o+Math.cos(a)*c,a} - } - function AGi(t,i,s){ - const e=t.scatter; - if(!e)return{ - x:0,y:0} - ; - const n=t.fish[i],h=s-e.ts-.4*n.flashAt; - if(h<=0)return{ - x:0,y:0} - ; - const r=42+34*(1-Math.min(1,e.dir[i][2]/60))+18*Math.sin(n.sc),o=h<.6?1-Math.pow(1-h/.6,3):1-dGi(.6,3.4,h); - return{ - x:e.dir[i][0]*r*o,y:e.dir[i][1]*r*o} - } - function SGi(t,i,s){ - if(!t.scatter)return 0; - const e=s-t.scatter.ts-.4*t.fish[i].flashAt; - return e<0?0:e<.12?e/.12:Math.max(0,1-(e-.12)/.38)} - function TGi(t,i,s,e){ - if("stream"!==t.mode&&"swirl"!==t.mode&&"scatter"!==t.mode)return GGi(t,i,s,e); - const n=t.fish[i]; - if("swirl"===t.mode&&t.swirl){ - const i=t.swirl,h=5*Math.sin(n.f1*s+n.p1),r=3.5*Math.sin(n.f2*s+n.p2),o=.8*(n.w+r),[a,c,l]=i.inPath.at(Math.min(cGi.SWIRL_IN*s-(.8*n.d+h),i.inPath.len+40)); - let u={ - x:a-Math.sin(l)*o,y:c+Math.cos(l)*o} - ; - const d=n.orbR*(1+.12*Math.sin(1.1*s+n.br)),f=n.orbA+i.spin*n.orbW*(46/(n.orbR+18))*s,p={ - x:i.C.x+Math.cos(f)*d,y:i.C.y+Math.sin(f)*d*.92} - ,[w,g,m]=i.outPath.at(cGi.SWIRL_OUT*(s-i.tLeave)-(.9*n.d+h)+i.outC); - let v={ - x:w-Math.sin(m)*o*.875,y:g+Math.cos(m)*o*.875} - ; - e&&(u=bGi(u.x,u.y,l,n.w,e),v=bGi(v.x,v.y,m,n.w,e)); - const _=dGi(i.tArrive-.6,i.tArrive+1.4,s+.004*n.d),M=dGi(i.tLeave,i.tLeave+2.2,s-.006*n.d),b=fGi(u.x,p.x,_),y=fGi(u.y,p.y,_); - return{ - x:fGi(b,v.x,M),y:fGi(y,v.y,M)} - } - const h=EGi(t,i,s),r=e?bGi(h.x,h.y,h.a,n.w,e):h,o=AGi(t,i,s); - return{ - x:r.x+o.x,y:r.y+o.y} - } - function CGi(t,i,s){ - const e=t.swirl; - if(!e)return[]; - const n=pGi(20973^t.seed),h=[],r=e.tArrive+.6,o=Math.floor((e.tLeave-r)/.17); - for(let a=0; - a<o; - a++){ - const t=r+.17*a+.1*n(),o=n()*lGi,c=40*Math.sqrt(n()); - t>i&&t<=s&&h.push({ - x:e.C.x+Math.cos(o)*c,y:e.C.y+Math.sin(o)*c*.9} - )} - return h} - function OGi(t,i){ - const s=t.swirl; - if(!s)return[]; - const e=dGi(s.tArrive+.6,s.tArrive+1.6,i)*(1-dGi(s.tLeave,s.tLeave+1,i)); - if(e<=0)return[]; - const n=pGi(39454^t.seed),h=[]; - for(let r=0; - r<10; - r++){ - const t=n()*lGi,r=38*Math.sqrt(n()),o=Math.max(0,Math.sin(i*(5+4*n())+n()*lGi)); - h.push({ - x:s.C.x+Math.cos(t)*r,y:s.C.y+Math.sin(t)*r,a:.7*o*o*e} - )} - return h} - function IGi(t,i){ - return dGi(0,cGi.FADE_IN,i)*(1-dGi(t.dur-cGi.FADE_OUT,t.dur,i))} - function kGi(t,i,s,e){ - const n=t.fish[i],h=TGi(t,i,s,e),r=s>=.06,o=TGi(t,i,r?s-.06:s+.06,e),a=r?Math.atan2(h.y-o.y,h.x-o.x):Math.atan2(o.y-h.y,o.x-h.x),c=BGi(t,i,s),l=n.L*(1-.15*n.depth)*(t.sizeK??1)*c.scale,u=lGi*uGi(.35+36/Math.max(10,.9*l),.65,2.2); - return{ - x:h.x,y:h.y,rot:a,L:l,alpha:(.36-.14*n.depth)*IGi(t,s)*c.alpha,phase:n.ph+u*s,flash:Math.max(SGi(t,i,s),c.flash),lift:c.lift} - } - function xGi(t,i,s,e){ - const n=s>0?(t.x+t.w-i.x)/s:s<0?(t.x-i.x)/s:1/0,h=e>0?(t.y+t.h-i.y)/e:e<0?(t.y-i.y)/e:1/0; - return Math.max(0,Math.min(n,h))} - Qt(mGi,"schoolPath"),Qt(vGi,"polyPath"),Qt(_Gi,"nearestS"),Qt(MGi,"makeFishSchool"),Qt(bGi,"flowAround"),Qt(yGi,"avoidBoat"),Qt(EGi,"streamAt"),Qt(AGi,"scatterOffset"),Qt(SGi,"schoolFlash"),Qt(TGi,"schoolFishAt"),Qt(CGi,"swirlRipples"),Qt(OGi,"swirlGlints"),Qt(IGi,"schoolAlpha"),Qt(kGi,"schoolFishPose"),Qt(xGi,"toEdge"); - const RGi=Qt(t=>(i,s)=>i>=t.x&&i<=t.x+t.w&&s>=t.y&&s<=t.y+t.h,"inViewOf"); - function PGi(t,i,s,e){ - const n=RGi(i); - for(let h=0; - h<=t.len; - h+=10){ - const[i,r,o]=t.at(h),a=-Math.sin(o)*e,c=Math.cos(o)*e; - for(const[t,e]of[[i,r],[i+a,r+c],[i-a,r-c]])if(n(t,e)&&!s(t,e))return!1} - return!0} - function NGi(t,i,s,e,n=!1){ - for(let h=0; - h<16; - h++){ - const h=e()*lGi,r=Math.cos(h),o=Math.sin(h),a=-o,c=r,l=xGi(t,i,-r,-o)+cGi.MARGIN,u=xGi(t,i,r,o)+cGi.MARGIN,d=n?16*(2*e()-1):e()<.55?22*(2*e()-1):(e()<.5?-1:1)*(60+60*e()),f={ - x:i.x-r*l,y:i.y-o*l} - ,p={ - x:i.x+r*u,y:i.y+o*u} - ,w={ - x:i.x+a*d,y:i.y+c*d} - ,g=45*(2*e()-1),m=45*(2*e()-1),v=[f,{ - x:fGi(f.x,w.x,.5)+a*g,y:fGi(f.y,w.y,.5)+c*g} - ,w,{ - x:fGi(w.x,p.x,.5)+a*m,y:fGi(w.y,p.y,.5)+c*m} - ,p]; - if(PGi(mGi(v),t,s,24))return v} - return null} - function LGi(t,i,s,e,n=s){ - const h=RGi({ - x:t.x+60,y:t.y+60,w:t.w-120,h:t.h-120} - ); - for(let r=0; - r<40; - r++){ - const r=e()*lGi,o=cGi.SWIRL_DIST[0]+e()*(cGi.SWIRL_DIST[1]-cGi.SWIRL_DIST[0]),a={ - x:i.x+Math.cos(r)*o,y:i.y+Math.sin(r)*o} - ; - if(!h(a.x,a.y)||!n(a.x,a.y))continue; - let c=!0; - for(let t=0; - t<12&&c; - t++)c=n(a.x+60*Math.cos(t*lGi/12),a.y+60*Math.sin(t*lGi/12)); - if(!c)continue; - const l=e()*lGi,u=Math.cos(l),d=Math.sin(l),f=l+(e()<.5?-1:1)*(1.05+.95*e()),p=Math.cos(f),w=Math.sin(f),g={ - x:a.x-u*(xGi(t,a,-u,-d)+cGi.MARGIN),y:a.y-d*(xGi(t,a,-u,-d)+cGi.MARGIN)} - ,m={ - x:a.x+p*(xGi(t,a,p,w)+cGi.MARGIN),y:a.y+w*(xGi(t,a,p,w)+cGi.MARGIN)} - ,v=35*(2*e()-1),_=35*(2*e()-1),M={ - x:fGi(g.x,a.x,.5)-d*v,y:fGi(g.y,a.y,.5)+u*v} - ,b={ - x:fGi(a.x,m.x,.5)-w*_,y:fGi(a.y,m.y,.5)+p*_} - ,y=[g,M,a,{ - x:a.x+40*u,y:a.y+40*d} - ],E=[{ - x:a.x-72*p,y:a.y-72*w} - ,a,b,m]; - if(PGi(mGi(y),t,s,20)&&PGi(mGi(E),t,s,20))return{ - center:a,inPts:y,outPts:E} - } - return null} - function DGi(t,i,s,e,n,h,r){ - const o=i.length; - switch(t.mode){ - case"ribbon":{ - const s=mGi(t.pts),e=cGi.RIBBON_V,n=cGi.RIBBON_GAP; - return i.forEach((t,i)=>{ - t.d=i*n,t.w=1} - ),{ - mode:"ribbon",fish:i,D:o*n,W:4,path:s,v:e,seed:h,dur:(s.len+o*n)/e,...r} - } - case"leap":{ - const n=mGi(t.pts),o=cGi.SPEED+5,a=(n.len+s)/o,c=i.map(t=>t.r1<cGi.LEAP_P?1.5+t.r2*Math.max(.5,a-4):-1); - return{ - mode:"leap",fish:i,D:s,W:e,path:n,v:o,seed:h,dur:a,jumps:c,...r} - } - case"dart":{ - const s=WGi(t.pts),e=cGi.DART_V; - i.forEach(t=>{ - const i=46*t.r1; - t.d=i,t.w=(t.r2<.5?-1:1)*i*.55+4*(t.r3-.5)} - ); - const n=t.pts.slice(1,-1).map(t=>_Gi(s,t)); - return{ - mode:"dart",fish:i,D:46,W:26,path:s,v:e,seed:h,dur:(s.len+60)/e,turns:n,...r} - } - case"pods":{ - const a=t.routes.length,c=Math.max(6,Math.floor(o/a)),l=18+.7*c,u=t.routes.map((t,i)=>{ - const s=mGi(t),e=48+32*n(),h=i*(.6+.8*n()); - return{ - path:s,v:e,t0:h,D:l,end:h+(s.len+l)/e} - } - ); - return i.forEach((t,i)=>{ - t.pod=Math.min(a-1,Math.floor(i/c)),t.d*=.45,t.w*=.55} - ),{ - mode:"pods",fish:i,D:s,W:e,path:u[0].path,v:u[0].v,seed:h,dur:Math.max(...u.map(t=>t.end)),pods:u,...r} - } - case"ball":{ - const n=cGi.BALL_IN+cGi.BALL_HOLD; - return{ - mode:"ball",fish:i,D:s,W:e,path:mGi([t.from[0],t.center]),v:cGi.SPEED,seed:h,dur:n+cGi.BALL_OUT+.4,ball:{ - C:t.center,from:t.from,tBurst:n} - ,...r} - } - case"predator":{ - const n=mGi(t.pts),o=mGi(t.pred),a=cGi.SPEED+2,c=t.pred[1],l=(_Gi(n,c)+s/2)/a,u=Math.max(.5,l-_Gi(o,c)/cGi.PRED_V),d={ - mode:"predator",fish:i,D:s,W:e,path:n,v:a,seed:h,dur:Math.max((n.len+s)/a,u+o.len/cGi.PRED_V),pred:{ - path:o,p0:u,dodge:[]} - ,...r} - ; - return d.pred.dodge=i.map((t,i)=>{ - let s=0,e=1/0,n=0,h=0,r=1; - for(let a=0; - a<d.dur; - a+=.1){ - const t=UGi(d,a); - if(!t)continue; - const o=EGi(d,i,a),c=o.x-t.x,l=o.y-t.y,u=Math.hypot(c,l); - u<e&&(e=u,s=a,n=-Math.sin(t.rot),h=Math.cos(t.rot),r=c*n+l*h<0?-1:1)} - const o=r*Math.max(0,cGi.PRED_R-e)*.85; - return{ - t:s,x:n*o,y:h*o} - } - ),d} - default:return null} - } - function GGi(t,i,s,e){ - var n; - const h=t.fish[i]; - switch(t.mode){ - case"ribbon":{ - const i=t.v*s-h.d,[n,r,o]=t.path.at(i),a=3*Math.sin(i/18+h.p1),c={ - x:n-Math.sin(o)*a,y:r+Math.cos(o)*a} - ; - return e?yGi(c,e):c} - case"dart":{ - const[i,n,r]=t.path.at(t.v*s-h.d),o={ - x:i-Math.sin(r)*h.w,y:n+Math.cos(r)*h.w} - ; - return e?yGi(o,e):o} - case"pods":{ - const i=t.pods[h.pod],n=4*Math.sin(h.f1*s+h.p1),[r,o,a]=i.path.at(i.v*(s-i.t0)-(h.d+n)),c=h.w+2.5*Math.sin(h.f2*s+h.p2),l={ - x:r-Math.sin(a)*c,y:o+Math.cos(a)*c} - ; - return e?yGi(l,e):l} - case"ball":{ - const e=t.ball,n=e.from[i%e.from.length],r=Math.atan2(e.C.y-n.y,e.C.x-n.x),o=100*(h.r1-.5),a=80*h.r2,c=n.x-Math.cos(r)*a-Math.sin(r)*o,l=n.y-Math.sin(r)*a+Math.cos(r)*o,u=e.C.x+30*Math.sin(.35*s),d=e.C.y+18*Math.sin(.5*s),f=6+30*Math.sqrt(h.r3),p=1+.15*Math.sin(2.2*s),w=h.orbA+1.6*(1.3+.8*h.r1)*s,g=u+Math.cos(w)*f*p,m=d+Math.sin(w)*f*p*.9,v=dGi(0,cGi.BALL_IN+.01*f,s),_=dGi(e.tBurst,e.tBurst+cGi.BALL_OUT,s); - return{ - x:fGi(c,g,v)+60*Math.cos(h.br)*_,y:fGi(l,m,v)+60*Math.sin(h.br)*_} - } - case"predator":{ - const h=EGi(t,i,s); - let r=e?yGi(h,e):h; - const o=null==(n=t.pred)?void 0:n.dodge[i]; - if(o){ - const t=dGi(o.t-.9,o.t-.3,s)*(1-dGi(o.t+.4,o.t+1.2,s)); - r={ - x:r.x+o.x*t,y:r.y+o.y*t} - } - return r} - default:{ - const n=EGi(t,i,s); - return e?yGi(n,e):n} - } - } - function BGi(t,i,s){ - const e=t.fish[i]; - if("leap"===t.mode&&t.jumps){ - const e=t.jumps[i]; - if(e>0&&s>e&&s<e+cGi.LEAP_S){ - const t=Math.sin(Math.PI*(s-e)/cGi.LEAP_S); - return{ - lift:cGi.LEAP_H*t,scale:1+.5*t,alpha:2.2,flash:.4+.6*t} - } - } - if("ball"===t.mode&&t.ball){ - const i=t.ball.tBurst,e=dGi(i,i+cGi.BALL_OUT,s),n=(s-(i-.6))/1; - return{ - lift:0,scale:1-.4*e,alpha:1-.9*e,flash:n>0&&n<1?Math.sin(Math.PI*n):0} - } - if("dart"===t.mode&&t.turns){ - const i=t.v*s-e.d; - let n=0; - for(const s of t.turns){ - const t=i-s; - t>0&&t<30&&(n=Math.max(n,1-t/30))} - return{ - lift:0,scale:1,alpha:1,flash:n} - } - if("pods"===t.mode&&t.pods){ - const i=t.pods[e.pod]; - return{ - lift:0,scale:1,alpha:dGi(i.t0,i.t0+1,s)*(1-dGi(i.end-1.6,i.end,s)),flash:0} - } - return{ - lift:0,scale:1,alpha:1,flash:0} - } - function UGi(t,i){ - const s=t.pred; - if(!s)return null; - const e=cGi.PRED_V*(i-s.p0); - if(e<=0||e>=s.path.len)return null; - const[n,h,r]=s.path.at(e); - return{ - x:n,y:h,rot:r,L:cGi.PRED_L*(t.sizeK??1),alpha:.5*dGi(0,60,e)*(1-dGi(s.path.len-60,s.path.len,e)),phase:6*i} - } - function FGi(t,i,s){ - if(!t.jumps)return[]; - const e=[]; - return t.jumps.forEach((n,h)=>{ - if(!(n<0))for(const r of[n,n+cGi.LEAP_S])r>i&&r<=s&&e.push(TGi(t,h,r,null))} - ),e} - Qt(PGi,"pathInWater"),Qt(NGi,"planSchoolPath"),Qt(LGi,"planSwirl"),Qt(DGi,"makeExtra"),Qt(GGi,"extraFishAt"),Qt(BGi,"extraLook"),Qt(UGi,"schoolPredator"),Qt(FGi,"leapSplashes"); - const $Gi=Qt((t,i,s)=>[t*Math.cos(s)-i*Math.sin(s),t*Math.sin(s)+i*Math.cos(s)],"rot"); - function HGi(t,i,s,e){ - for(let n=0; - n<16; - n++){ - const n=e()*lGi,h=Math.cos(n),r=Math.sin(n),o=-r,a=h,c=xGi(t,i,-h,-r)+cGi.MARGIN,l=xGi(t,i,h,r)+cGi.MARGIN,u=(e()<.5?-1:1)*(50+80*e()),d=(e()<.5?-1:1)*(60+40*e()),f=-Math.sign(d)*(60+40*e()),p={ - x:i.x-h*c,y:i.y-r*c} - ,w={ - x:i.x+h*l,y:i.y+r*l} - ,g={ - x:i.x+o*u,y:i.y+a*u} - ,m=[p,{ - x:fGi(p.x,g.x,.5)+o*d,y:fGi(p.y,g.y,.5)+a*d} - ,g,{ - x:fGi(g.x,w.x,.5)+o*f,y:fGi(g.y,w.y,.5)+a*f} - ,w]; - if(PGi(mGi(m),t,s,16))return m} - return null} - function WGi(t){ - const i=cGi.DART_ROUND,s=[],e=Qt((t,i)=>{ - const e=Math.hypot(i.x-t.x,i.y-t.y),n=Math.max(1,Math.ceil(e/6)); - for(let h=0; - h<n; - h++)s.push([fGi(t.x,i.x,h/n),fGi(t.y,i.y,h/n)])} - ,"line"); - let n=t[0]; - for(let h=1; - h<t.length-1; - h++){ - const r=t[h-1],o=t[h],a=t[h+1],c=Math.hypot(o.x-r.x,o.y-r.y)||1,l=Math.hypot(a.x-o.x,a.y-o.y)||1,u={ - x:o.x-(o.x-r.x)/c*i,y:o.y-(o.y-r.y)/c*i} - ,d={ - x:o.x+(a.x-o.x)/l*i,y:o.y+(a.y-o.y)/l*i} - ; - e(n,u); - for(let t=0; - t<24; - t++){ - const i=t/24,e=1-i; - s.push([e*e*u.x+2*e*i*o.x+i*i*d.x,e*e*u.y+2*e*i*o.y+i*i*d.y])} - n=d} - return e(n,t[t.length-1]),s.push([t[t.length-1].x,t[t.length-1].y]),vGi(s)} - function VGi(t,i,s,e){ - const n=RGi({ - x:t.x+30,y:t.y+30,w:t.w-60,h:t.h-60} - ); - for(let h=0; - h<24; - h++){ - const h=e()*lGi,r=Math.cos(h),o=Math.sin(h),a=-o,c=r,l=xGi(t,i,-r,-o)+cGi.MARGIN,u=(e()<.5?-1:1)*(60+50*e()),d=40+60*e(),f={ - x:i.x-r*l,y:i.y-o*l} - ,p={ - x:i.x+a*u-r*d,y:i.y+c*u-o*d} - ,w=(e()<.5?-1:1)*(1.1+.4*e()),[g,m]=$Gi(r,o,w),v=110+70*e(),_={ - x:p.x+g*v,y:p.y+m*v} - ,[M,b]=$Gi(g,m,-Math.sign(w)*(1.6+.4*e())),y={ - x:_.x+M*(xGi(t,_,M,b)+cGi.MARGIN),y:_.y+b*(xGi(t,_,M,b)+cGi.MARGIN)} - ; - if(!n(p.x,p.y)||!n(_.x,_.y))continue; - const E=[f,p,_,y]; - if(PGi(WGi(E),t,s,20))return E} - return null} - function jGi(t,i,s,e){ - const n=RGi({ - x:t.x+60,y:t.y+60,w:t.w-120,h:t.h-120} - ); - for(let h=0; - h<40; - h++){ - const t=e()*lGi,h=cGi.SWIRL_DIST[0]+e()*(cGi.SWIRL_DIST[1]-cGi.SWIRL_DIST[0]),r={ - x:i.x+Math.cos(t)*h,y:i.y+Math.sin(t)*h} - ; - if(!n(r.x,r.y)||!s(r.x,r.y))continue; - let o=!0; - for(let i=0; - i<12&&o; - i++)o=s(r.x+60*Math.cos(i*lGi/12),r.y+60*Math.sin(i*lGi/12)); - if(o)return r} - return null} - function KGi(t,i,s,e,n){ - const h=jGi(t,i,e,n); - if(!h)return null; - const r=[],o=[],a=n()*lGi; - for(let c=0; - c<24&&r.length<3; - c++){ - const i=a+c*lGi/24*7+.3*(n()-.5),e=Math.cos(i),l=Math.sin(i); - if(o.some(t=>Math.abs(Math.atan2(Math.sin(i-t),Math.cos(i-t)))<1.2))continue; - const u=xGi(t,h,e,l)+cGi.MARGIN; - let d=0; - for(; - d+8<=u&&s(h.x+e*(d+8),h.y+l*(d+8)); - )d+=8; - d<cGi.BALL_RUN||(o.push(i),r.push({ - x:h.x+e*d,y:h.y+l*d} - ))} - return r.length>=2?{ - center:h,from:r} - :null} - function zGi(t,i,s,e){ - for(let n=0; - n<14; - n++){ - const n=NGi(t,i,s,e); - if(!n)return null; - const h=mGi(n),[r,o,a]=h.at(h.len*(.3+.4*e())),c={ - x:r,y:o} - ; - if(Math.hypot(r-i.x,o-i.y)<70)continue; - const l=a+(e()<.5?-1:1)*(.55+1.25*e()),u=Math.cos(l),d=Math.sin(l),f=Qt((i,e)=>{ - const n=xGi(t,c,i,e)+cGi.MARGIN; - let h=0; - for(; - h+8<=n&&s(c.x+i*(h+8),c.y+e*(h+8)); - )h+=8; - return h} - ,"reach"),p=f(-u,-d),w=f(u,d); - if(p<cGi.PRED_RUN||w<cGi.PRED_RUN)continue; - const g={ - x:c.x-u*p,y:c.y-d*p} - ,m={ - x:c.x+u*w,y:c.y+d*w} - ; - return{ - pts:n,pred:[g,c,m]} - } - return null} - function YGi(t,i,s,e){ - const n=[]; - for(let h=0; - h<12&&n.length<4; - h++){ - const h=NGi(t,i,s,e); - h&&n.push(h)} - return n.length>=3?n:null} - function qGi(t,i,s,e,n,h=e){ - switch(t){ - case"swirl":{ - const t=LGi(i,s,e,n,h); - return t?{ - mode:"swirl",...t} - :null} - case"scatter":{ - const t=NGi(i,s,e,n,!0); - return t?{ - mode:"scatter",pts:t,boat:s} - :null} - case"ribbon":{ - const t=HGi(i,s,e,n); - return t?{ - mode:"ribbon",pts:t} - :null} - case"dart":{ - const t=VGi(i,s,e,n); - return t?{ - mode:"dart",pts:t} - :null} - case"leap":{ - const t=NGi(i,s,e,n); - return t?{ - mode:"leap",pts:t} - :null} - case"pods":{ - const t=YGi(i,s,e,n); - return t?{ - mode:"pods",routes:t} - :null} - case"ball":{ - const t=KGi(i,s,e,h,n); - return t?{ - mode:"ball",...t} - :null} - case"predator":{ - const t=zGi(i,s,e,n); - return t?{ - mode:"predator",...t} - :null} - default:{ - const t=NGi(i,s,e,n); - return t?{ - mode:"stream",pts:t} - :null} - } - } - function XGi(t){ - let i=2166136261; - for(let s=0; - s<t.length; - s++)i^=t.charCodeAt(s),i=Math.imul(i,16777619); - return i>>>0} - function JGi(t,i,s,e,n,h,r,o=h){ - const a=i.filter(i=>i!==t&&"stream"!==i&&i!==s); - for(let l=a.length-1; - l>0; - l--){ - const t=Math.floor(r()*(l+1)); - [a[l],a[t]]=[a[t],a[l]]} - const c=[t,...a]; - s&&s!==t&&"stream"!==s&&i.includes(s)&&c.push(s),c.includes("stream")||c.push("stream"); - for(const l of c){ - const t=qGi(l,e,n,h,r,o); - if(t)return t} - return null} - function QGi(t){ - const i=pGi(XGi(t)),s=aGi.filter(t=>"stream"!==t); - for(let e=s.length-1; - e>0; - e--){ - const t=Math.floor(i()*(e+1)); - [s[e],s[t]]=[s[t],s[e]]} - return["stream",...s.slice(0,3)]} - function ZGi(t,i,s){ - const e=t.flatMap(t=>"stream"===t?[t,t]:[t]).filter(t=>t!==i),n=e.length?e:t; - return n[Math.floor(s()*n.length)]} - Qt(HGi,"planCurvy"),Qt(WGi,"dartPath"),Qt(VGi,"planDart"),Qt(jGi,"pickOpenCenter"),Qt(KGi,"planBall"),Qt(zGi,"planPredator"),Qt(YGi,"planPods"),Qt(qGi,"planSchool"),Qt(XGi,"hashText"),Qt(JGi,"planSchoolFor"),Qt(QGi,"schoolModesFor"),Qt(ZGi,"pickSchoolMode"); - const tBi=Qt(t=>{ - const i=t(); - return i<.7?"deep":i<.92?"silver":"gold"} - ,"schoolColor"); - function iBi(t,i,s){ - return"ribbon"===t?40+Math.round(20*s()):"pods"===t?48+Math.round(16*s()):"dart"===t?50+Math.round(20*s()):"ball"===t?Math.min(140,Math.round(1.2*wGi(i,s))):wGi(i,s)} - Qt(iBi,"schoolCountFor"); - const sBi=12,eBi=665137,nBi=14283512,hBi=Qt((t,i,s)=>{ - const e=Qt(e=>Math.round((t>>e&255)+((i>>e&255)-(t>>e&255))*s),"ch"); - return e(16)<<16|e(8)<<8|e(0)} - ,"mix"),rBi={ - autoGenerateMipmaps:!0,magFilter:"linear",minFilter:"linear",mipmapFilter:"nearest"} - ; - let oBi=null; - function aBi(){ - if(oBi&&oBi.every(t=>!t.destroyed))return oBi; - oBi=[]; - for(let t=0; - t<sBi; - t++){ - const i=new Ke,s=(new ep).rect(0,0,48,24).fill({ - color:0,alpha:.001} - ),e=new oGi("fish",25); - e.tint=16777215,e.swim(32,t/sBi*Math.PI*2,.75,0),e.position.set(24,12),i.addChild(s,e),oBi.push(SS.app.renderer.generateTexture({ - target:i,resolution:2,antialias:!0,textureSourceOptions:rBi} - )),i.destroy({ - children:!0} - )} - return oBi} - Qt(aBi,"schoolFrames"); - const cBi=class t extends Ke{ - constructor(){ - super(),Zt(this,"school",null),Zt(this,"t",0),Zt(this,"sprites",[]),Zt(this,"glints",new ep),Zt(this,"pred",new Xe(ls.EMPTY)),this.eventMode="none",this.glints.eventMode="none",this.pred.anchor.set(.5),this.pred.eventMode="none",this.pred.visible=!1,this.pred.tint=399906,this.addChild(this.pred,this.glints)} - get mode(){ - var t; - return(null==(t=this.school)?void 0:t.mode)??null} - get active(){ - return!!this.school} - start(t,i,s,e={ - } - ){ - this.school=MGi(t,i,s,void 0,e),this.t=0; - const n=aBi(); - for(; - this.sprites.length<t; - ){ - const t=new Xe(n[0]); - t.anchor.set(.5),t.tint=eBi,t.eventMode="none",this.addChildAt(t,this.children.length-1),this.sprites.push(t)} - for(const h of this.sprites)h.visible=!1} - clear(){ - this.school=null; - for(const t of this.sprites)t.visible=!1; - this.pred.visible=!1,this.glints.clear()} - update(i,s,e,n){ - const h=this.school; - if(!h)return; - const r=this.t; - if(this.t+=i*t.speed,this.t>=h.dur)return void this.clear(); - if(n)for(const t of[...CGi(h,r,this.t),...FGi(h,r,this.t)])n(t.x,t.y); - this.glints.clear(); - for(const t of OGi(h,this.t))t.a>.01&&this.glints.circle(t.x,t.y,1.4).fill({ - color:16777215,alpha:t.a} - ); - const o=aBi(),a=UGi(h,this.t),c=a?a.alpha*e(a.x,a.y):0; - this.pred.visible=!!a&&c>.01,a&&this.pred.visible&&(this.pred.texture=o[(Math.floor(a.phase/(2*Math.PI)*sBi)%sBi+sBi)%sBi],this.pred.position.set(a.x,a.y),this.pred.rotation=a.rot,this.pred.scale.set(a.L/32),this.pred.alpha=c); - const l="silver"===h.color?.55:0; - for(let t=0; - t<h.fish.length; - t++){ - const i=kGi(h,t,this.t,s),n=this.sprites[t],r=i.alpha*(i.alpha>.003?e(i.x,i.y):0); - if(n.visible=r>.003,!n.visible)continue; - const a=(Math.floor(i.phase/(2*Math.PI)*sBi)%sBi+sBi)%sBi; - n.texture=o[a],n.position.set(i.x,i.y-i.lift),n.rotation=i.rot,n.scale.set(i.L/32),i.lift>.5&&this.glints.ellipse(i.x,i.y,.45*i.L,.18*i.L).fill({ - color:401450,alpha:.18*Math.min(1,r)} - ); - const c="gold"===h.color&&t%5==0,u=c?.75+.25*Math.sin(5*this.t+t):0,d=c?16766836:l?hBi(eBi,nBi,l):eBi; - n.alpha=Math.min(1,r*(1+1.3*i.flash)*(c?2.2*u:l?1.5:1)),n.tint=i.flash>0?hBi(d,nBi,i.flash):d} - } - } - ; - Qt(cBi,"FishingFishSchool"),Zt(cBi,"speed",1); - let lBi=cBi; - const uBi={ - DUR:3.4,STOP:.25,THRASH_END:1.1,FLIP_END:1.5,CARD_AT:1.8,RINGS:[{ - at:.3,life:.7,r0:14,r1:80,alpha:.6} - ,{ - at:.6,life:.7,r0:14,r1:80,alpha:.5} - ,{ - at:.9,life:.7,r0:14,r1:80,alpha:.45} - ,{ - at:1.5,life:1.2,r0:30,r1:110,alpha:.35} - ],SPLASH:[.3,.6,.9],BUBBLE_FROM:1.5,BUBBLE_EVERY:.11,BUBBLES:12,SHAKE_PX:7,SHAKE_MS:400,BELLY:14085359} - ,dBi=Qt(t=>Math.max(0,Math.min(1,t)),"clamp01$2"),fBi=Qt((t,i,s)=>{ - const e=dBi((s-t)/(i-t)); - return e*e*(3-2*e)} - ,"smooth$2"),pBi=Qt(t=>1-Math.pow(1-dBi(t),3),"easeOut"); - function wBi(t){ - if(t<0)return{ - rate:1,drift:0,rot:0,squash:1,belly:0,flash:0,scale:1,alpha:1,blur:0,done:!1} - ; - const i=dBi((t-uBi.FLIP_END)/(uBi.DUR-uBi.FLIP_END)),s=dBi((t-uBi.THRASH_END)/(uBi.FLIP_END-uBi.THRASH_END)),e=t<.12?1-t/.12:t>=.13&&t<uBi.STOP?1-(t-.13)/.12:0,n=.2*Math.sin(2*Math.PI*4.5*(t-uBi.STOP))*fBi(uBi.STOP,.35,t)*(1-fBi(.9,uBi.THRASH_END,t)); - return{ - rate:t<uBi.STOP?.3:t<uBi.THRASH_END?3:.25,drift:t>uBi.FLIP_END?18*pBi(i):0,rot:n+.35*fBi(uBi.FLIP_END,uBi.DUR,t),squash:t<uBi.THRASH_END?1:.12+.88*Math.abs(Math.cos(Math.PI*s)),belly:fBi(1.24,1.32,t),flash:Math.max(0,e),scale:1-.28*i*i,alpha:t<uBi.FLIP_END?1:1-Math.pow(i,1.6),blur:6*i,done:t>=uBi.DUR} - } - function gBi(t,i){ - const s=Qt(s=>s>t&&s<=i,"hit"),e=[]; - for(let n=0; - n<uBi.BUBBLES; - n++)s(uBi.BUBBLE_FROM+n*uBi.BUBBLE_EVERY)&&e.push(n); - return{ - rings:uBi.RINGS.filter(t=>s(t.at)),splashes:uBi.SPLASH.filter(s).length,bubbles:e,shake:t<0&&i>=0,card:s(uBi.CARD_AT)} - } - function mBi(t,i,s){ - const e=dBi(s),n=Qt(s=>Math.round((t>>s&255)*(1-e)+(i>>s&255)*e),"c"); - return n(16)<<16|n(8)<<8|n(0)} - Qt(wBi,"defeatPose"),Qt(gBi,"defeatEvents"),Qt(mBi,"mixColor"); - const vBi=.85,_Bi=.18; - function MBi(t){ - return t<20?{ - w0:15,w1:25,travel:.5,tilt:.035,push:3,shake:0,burst:8,crown:16} - :t<60?{ - w0:20,w1:40,travel:.45,tilt:.07,push:5,shake:1,burst:12,crown:22} - :{ - w0:28,w1:60,travel:.42,tilt:.105,push:7,shake:2,burst:16,crown:30} - } - Qt(MBi,"waveSize"); - const bBi=Qt(t=>Math.max(0,Math.min(1,t)),"clamp01$1"),yBi=Qt(t=>t*t,"easeIn"); - function EBi(t,i=!1){ - return.3+t.travel*(i?Math.sqrt(vBi):1)} - function ABi(t,i=!1){ - return i?EBi(t,!0)+.2:.3+t.travel+.38} - function SBi(t,i,s=!1){ - const e=t-.3,n=i.travel; - if(e<0)return null; - const h=Qt(t=>i.w0+(i.w1-i.w0)*Math.min(1.3,t),"width"); - if(s){ - const t=n*Math.sqrt(vBi); - if(e<=t){ - const t=yBi(e/n); - return{ - p:t,half:h(t),alpha:1} - } - const i=(e-t)/.2; - return i>=1?null:{ - p:vBi,half:h(vBi)*(1+.3*i),alpha:1-i} - } - if(e>n+.38)return null; - const r=e<=n?yBi(e/n):1+(e-n)/n*.9; - return{ - p:r,half:h(r),alpha:r>1?bBi(1-(r-1)/.9):1} - } - function TBi(t,i,s=!1){ - const e=t-EBi(i,s); - if(e<=0)return{ - push:0,rot:0,shake:0} - ; - const n=Math.exp(3*-e),h=s?.25:1; - return{ - push:i.push*n*h,rot:-Math.sin(8.5*e)*i.tilt*n*h,shake:!s&&e<_Bi?i.shake*(1-e/_Bi):0} - } - function CBi(t,i,s,e=!1){ - const n=Qt(s=>t<s&&s<=i,"at"); - return{ - crown:n(.16),hit:n(EBi(s,e)),done:n(ABi(s,e))} - } - Qt(EBi,"waveHitAt"),Qt(ABi,"waveEndAt"),Qt(SBi,"crestPose"),Qt(TBi,"boatKick"),Qt(CBi,"waveEvents"); - const OBi=class extends Ke{ - constructor(){ - super(),Zt(this,"flippers",[]),this.eventMode="none"; - for(const i of[!0,!1])for(const t of[-1,1]){ - const s=new ep; - i?s.moveTo(.025,0).bezierCurveTo(-.01,.065,-.065,.13,-.145,.15).bezierCurveTo(-.17,.08,-.06,-.01,0,-.03).closePath().fill(16777215):s.moveTo(.04,0).bezierCurveTo(.045,.13,-.075,.31,-.2,.37).bezierCurveTo(-.225,.375,-.2,.29,-.16,.22).bezierCurveTo(-.105,.11,-.085,.035,-.055,-.025).closePath().fill(16777215),s.position.set(i?-.25:.19,t*(i?.145:.15)),s.scale.y=t,this.addChild(s),this.flippers.push({ - shape:s,side:t,rear:i} - )} - const t=new ep; - t.moveTo(-.31,-.035).lineTo(-.47,0).lineTo(-.31,.035).closePath().fill(16777215),t.moveTo(.24,-.06).bezierCurveTo(.33,-.055,.37,-.082,.43,-.075).bezierCurveTo(.51,-.063,.525,.06,.43,.075).bezierCurveTo(.37,.082,.33,.055,.24,.06).closePath().fill(16777215),t.moveTo(.33,0).bezierCurveTo(.34,.13,.19,.235,-.02,.233).bezierCurveTo(-.23,.23,-.38,.11,-.37,0).bezierCurveTo(-.38,-.11,-.23,-.23,-.02,-.233).bezierCurveTo(.19,-.235,.34,-.13,.33,0).closePath().fill(16777215),this.addChild(t)} - pose(t,i,s,e,n){ - const h=n(.5*t); - this.position.set(h.x,h.y),this.rotation=h.a,this.scale.set(t); - for(const{ - shape:r,side:o,rear:a} - of this.flippers){ - const t=mDi(i,s,e,o,a); - r.rotation=t.sweep,r.scale.y=o*t.span} - } - } - ; - Qt(OBi,"FishingTurtleRig"); - let IBi=OBi; - const kBi=["croc","jelly","hammer","narwhal","squid","angler","octopus","sperm","serpent"],xBi=Qt(t=>kBi.includes(t),"isSilhouetteKind"),RBi=2*Math.PI,PBi=Qt((t,i,s)=>t+(i-t)*s,"lerp"),NBi=Qt(t=>Math.max(0,Math.min(1,t)),"clamp01"); - function LBi(t,i){ - for(let s=1; - s<t.length; - s++)if(i<=t[s][0])return PBi(t[s-1][1],t[s][1],(i-t[s-1][0])/(t[s][0]-t[s-1][0])); - return t[t.length-1][1]} - function DBi(t,i,s,e,n,h=44){ - const r=[]; - for(let o=0; - o<=h; - o++){ - const a=o/h; - r.push({ - x:(a-.5)*t,y:s*t*Math.sin(RBi*e*(1-a)-i)*Math.pow(1-a,n)} - )} - return r} - function GBi(t,i){ - const s=NBi(i)*(t.length-1),e=Math.min(t.length-2,Math.floor(s)),n=s-e,h=t[e],r=t[e+1]; - return{ - x:h.x+(r.x-h.x)*n,y:h.y+(r.y-h.y)*n,a:Math.atan2(r.y-h.y,r.x-h.x)} - } - function BBi(t){ - const i=t.length,s=[]; - let e=(t[i-1][0]+t[0][0])/2,n=(t[i-1][1]+t[0][1])/2; - for(let h=0; - h<i; - h++){ - const r=t[h],o=t[(h+1)%i],a=(r[0]+o[0])/2,c=(r[1]+o[1])/2; - for(const t of[1/3,2/3,1]){ - const i=1-t; - s.push(i*i*e+2*i*t*r[0]+t*t*a,i*i*n+2*i*t*r[1]+t*t*c)} - e=a,n=c} - return s} - function UBi(t,i,s={ - } - ){ - const e=t.length,n=[],h=[],r=s.ws??1; - for(let d=0; - d<e; - d++){ - const s=t[d],o=t[Math.max(0,d-1)],a=t[Math.min(e-1,d+1)],c=Math.atan2(a.y-o.y,a.x-o.x),l=LBi(i,d/(e-1))*r; - n.push([s.x-Math.sin(c)*l,s.y+Math.cos(c)*l]),h.push([s.x+Math.sin(c)*l,s.y-Math.cos(c)*l])} - const o=t[e-1],a=t[e-2],c=Math.atan2(o.y-a.y,o.x-a.x),l=LBi(i,1)*r,u=s.square?[[n[e-1][0]+Math.cos(c)*l*.25,n[e-1][1]+Math.sin(c)*l*.25],[h[e-1][0]+Math.cos(c)*l*.25,h[e-1][1]+Math.sin(c)*l*.25]]:[[o.x+Math.cos(c)*l*(s.nose??.9),o.y+Math.sin(c)*l*(s.nose??.9)]]; - return BBi([...n,...u,...h.reverse()])} - function FBi(t,i,s){ - const e=t.length,n=[],h=[]; - for(let o=0; - o<e; - o++){ - const r=t[o],a=t[Math.max(0,o-1)],c=t[Math.min(e-1,o+1)],l=Math.atan2(c.y-a.y,c.x-a.x),u=PBi(i,s,o/(e-1)); - n.push([r.x-Math.sin(l)*u,r.y+Math.cos(l)*u]),h.push([r.x+Math.sin(l)*u,r.y-Math.cos(l)*u])} - const r=t[e-1]; - return BBi([...n,[r.x,r.y],...h.reverse()])} - Qt(LBi,"prof"),Qt(DBi,"spine"),Qt(GBi,"at"),Qt(BBi,"smooth$1"),Qt(UBi,"body"),Qt(FBi,"ribbon"); - const $Bi=Qt(t=>BBi(t),"blob"),HBi=Qt((t,i,s)=>{ - const e=i*(.55+.45*Math.abs(Math.sin(s))); - return BBi([[6,.9*e],[.55*-t,e],[-t,.35*e],[-t-2,0],[-t,.35*-e],[.55*-t,-e],[6,.9*-e]])} - ,"finEdge"),WBi=Qt((t,i,s)=>[...t,...i,...s],"tri"); - function VBi(t,i){ - const s=Math.cos(t.a),e=Math.sin(t.a),n=new Array(i.length); - for(let h=0; - h<i.length; - h+=2)n[h]=t.x+i[h]*s-i[h+1]*e,n[h+1]=t.y+i[h]*e+i[h+1]*s; - return n} - Qt(VBi,"place"); - const jBi=Qt((t,i,s)=>t.map((t,e)=>t+(e%2?s:i)),"shift"); - function KBi(t,i,s,e,n,h,r,o,a=0){ - const c=[]; - for(let l=0; - l<=n; - l++){ - const u=l/n,d=s+a*u*u,f=e*u,p=h*Math.sin(r*u*RBi-o)*u; - c.push({ - x:t+Math.cos(d)*f-Math.sin(d)*p,y:i+Math.sin(d)*f+Math.cos(d)*p} - )} - return c} - function zBi(t,i,s,e){ - const n=[]; - for(let h=0; - h<=e; - h++){ - const r=h/e,o=1-r; - n.push({ - x:o*o*t.x+2*o*r*i.x+r*r*s.x,y:o*o*t.y+2*o*r*i.y+r*r*s.y} - )} - return n} - Qt(KBi,"wavy"),Qt(zBi,"bezier"); - const YBi=[[0,2],[.1,6],[.3,13],[.6,17],[.85,16],[.9,15],[.93,21],[.97,25],[1,12]]; - function qBi(t,i,s=1){ - const e=[]; - for(const r of[.3,.55,.75]){ - const i=GBi(t,r),n=LBi(YBi,r)*s; - e.push(VBi(i,WBi([5,n-1],[-10,n+12*s],[-6,n-1])),VBi(i,WBi([5,1-n],[-10,-n-12*s],[-6,1-n])))} - const n=GBi(t,.9),h=LBi(YBi,.9)*s; - for(let r=0; - r<4; - r++){ - const t=1+.08*Math.sin(3*i+r); - e.push(VBi(n,WBi([8-6*r,h-2],[-14-7*r,(h+(26-4*r)*t)*s],[-2-6*r,h-2])),VBi(n,WBi([8-6*r,2-h],[-14-7*r,-(h+(26-4*r)*t)*s],[-2-6*r,2-h])))} - return e.push(UBi(t,YBi,{ - ws:s,nose:1.1} - )),e} - function XBi(t){ - const i=DBi(170,1.4*t,.045,.9,2.2),s=[[0,2],[.08,3],[.25,8.5],[.45,14],[.6,15],[.76,11],[.88,6.5],[1,5]],e=[]; - e.push(VBi(GBi(i,0),HBi(20,2.6,1.4*t))); - for(const n of[1,-1]){ - const t=GBi(i,.62),h=LBi(s,.62); - e.push(VBi(t,WBi([6,n*(h-2)],[-18,n*(h+22)],[-8,n*(h-2)])))} - return e.push(VBi(GBi(i,.95),$Bi([[-6,-31],[4,-33],[7,-29],[6,29],[4,33],[-6,31],[-1,0]]))),e.push(UBi(i,s,{ - nose:.6} - )),e} - function JBi(t,i,s=44){ - const e=i+.18*Math.sin(i),n=Math.sin(e)**2,h=.008*Math.sin(e-.6),r=[]; - for(let o=0; - o<=s; - o++){ - const i=o/s,e=Math.max(0,(.3-i)/.3); - r.push({ - x:(i-.5)*t+e*e*t*.012*n,y:h*t*Math.pow(1-i,3)} - )} - return{ - pts:r,lift:n} - } - Qt(qBi,"serpentOn"),Qt(XBi,"hammerOne"),Qt(JBi,"whaleSpine"); - const QBi=Qt((t,i)=>t.map(([t,s])=>[t*(1-.1*i),s]),"fluke"),ZBi=Qt((t,i)=>{ - const s=GBi(t,1); - return{ - x:s.x+14+1.5*Math.sin(1.2*i),y:s.y+2*Math.sin(.9*i)} - } - ,"anglerOrb"),tUi=Qt(t=>DBi(260,.8*t,.03,.8,2.2),"anglerSpine"),iUi={ - croc(t){ - const i=[]; - for(let n=0; - n<=44; - n++){ - const s=n/44,e=Math.pow(NBi((.55-s)/.55),1.6); - i.push({ - x:230*(s-.5),y:17.25*Math.sin(.85*RBi*(1-s)-t)*e} - )} - const s=[[0,1.2],[.12,4],[.3,9],[.44,14],[.56,15.5],[.66,13],[.72,9.5],[.78,11.5],[.86,8.5],[.94,6],[1,4.5]],e=[]; - for(const[n,h,r,o]of[[.42,1,0,0],[.42,-1,Math.PI,0],[.64,1,Math.PI,1],[.64,-1,0,1]]){ - const a=GBi(i,n),c=LBi(s,n),l=.6*Math.sin(1.3*t+r),u=h,d=o?-7:-5,f=c+(o?3.2:3.8),p=(o?-19:-21)+l,w=c+(o?2.2:1.6)+.3*l; - e.push(VBi(a,FBi([{ - x:1,y:u*(c-3)} - ,{ - x:d,y:u*f} - ,{ - x:p,y:u*w} - ],3.6,2.1))); - for(const t of[-1,1])e.push(VBi(a,FBi([{ - x:p+1,y:u*w} - ,{ - x:p-4.5,y:u*(w+1.6*t)} - ],1.5,.9)))} - for(let n=.07; - n<.42; - n+=.06){ - const t=GBi(i,n),h=LBi(s,n); - e.push(VBi(t,WBi([-2,h-.8],[0,h+2.2],[2,h-.8])),VBi(t,WBi([-2,.8-h],[0,-h-2.2],[2,.8-h])))} - return e.push(UBi(i,s,{ - nose:.7} - )),e} - ,jelly(t){ - const i=.5+.5*Math.sin(1.3*t),s=44*(1-.09*i),e=[]; - for(let h=0; - h<5; - h++)e.push(FBi(KBi(50-.55*s,15*(h-2)*(1-.15*i),Math.PI+.08*(h-2),150-14*Math.abs(h-2),18,10,1.3,2*t+1.1*h),5.5,1.4)); - for(let h=0; - h<4; - h++)e.push(FBi(KBi(50-.2*s,9*(h-1.5),Math.PI+.25*(h-1.5),78,12,7,1.6,2.4*t+h),8,2.5)); - const n=[]; - for(let h=0; - h<40; - h++){ - const t=h/40*RBi,i=s*(1+.06*Math.cos(10*t))*(t>.6*Math.PI&&t<1.4*Math.PI?.96:1); - n.push([50+Math.cos(t)*i*1.05,Math.sin(t)*i])} - return e.push($Bi(n)),e} - ,hammer(t){ - const i=[]; - for(const[s,e,n]of[[-80,-46,1.3],[-80,46,2.6],[0,0,0]])for(const h of XBi(t+n))i.push(jBi(h,s+40,e)); - return i} - ,narwhal(t){ - const{ - pts:i,lift:s} - =JBi(380,t),e=[[0,3],[.06,6],[.2,15],[.4,31],[.6,39],[.8,37],[.92,29],[.98,19],[1,11]],n=[]; - n.push(VBi(GBi(i,0),$Bi(QBi([[10,0],[2,-22],[-20,-46],[-12,-18],[-14,0],[-12,18],[-20,46],[2,22]],s)))); - for(const h of[1,-1]){ - const t=GBi(i,.78),s=LBi(e,.78); - n.push(VBi(t,$Bi([[8,h*(s-4)],[-4,h*(s+18)],[-22,h*(s+24)],[-12,h*(s+4)]])))} - return n.push(UBi(i,e,{ - nose:.7} - )),n.push(VBi(GBi(i,1),[4,-5,134,-1.4,136,0,134,1.4,4,5])),n} - ,squid(t){ - const i=[],s=DBi(240,.6*t,.012,.5,1,24).map(t=>({ - x:t.x+130,y:t.y} - )); - for(const n of[1,-1])i.push($Bi([[250,0],[222,30*n],[186,64*n],[170,50*n],[176,18*n]])); - for(let n=0; - n<8; - n++)i.push(FBi(KBi(6,4*(n-3.5),Math.PI+.11*(n-3.5),128+n%3*10,14,8,1.2,2*t+.8*n,.05*(n-3.5)),7.5,1.6)); - for(const n of[1,-1]){ - const s=KBi(6,6*n,Math.PI+.05*n,270,22,10,1,1.6*t+(n>0?0:1.7)),e=s[s.length-1],h=s[s.length-3],r=Math.atan2(e.y-h.y,e.x-h.x); - i.push(FBi(s,3.6,2.4)); - const o=[]; - for(let t=0; - t<12; - t++){ - const i=t/12*RBi; - o.push([e.x+12*Math.cos(i)*Math.cos(r)-6.5*Math.sin(i)*Math.sin(r),e.y+12*Math.cos(i)*Math.sin(r)+6.5*Math.sin(i)*Math.cos(r)])} - i.push($Bi(o))} - const e=[]; - for(let n=0; - n<16; - n++){ - const t=n/16*RBi; - e.push([8+26*Math.cos(t),25*Math.sin(t)])} - return i.push($Bi(e)),i.push(UBi(s,[[0,24],[.15,31],[.45,33],[.75,24],[.92,12],[1,5]],{ - nose:.8} - )),i} - ,angler(t){ - const i=tUi(t),s=[[0,4],[.1,6],[.22,22],[.4,56],[.6,70],[.78,66],[.9,57],[.97,47],[1,42]],e=[]; - e.push(VBi(GBi(i,0),HBi(28,4,.8*t))); - for(const c of[1,-1]){ - const n=GBi(i,.55),h=LBi(s,.55); - e.push(VBi(n,$Bi([[6,c*(h-6)],[-2,c*(h+16+3*Math.sin(2*t))],[-18,c*(h+12)],[-14,c*(h-6)]])))} - e.push(UBi(i,s,{ - square:!0} - )); - const n=GBi(i,1),h=[8,-40]; - for(let c=0; - c<=12; - c++)h.push(c%2?15:9,c*(80/12)-40); - h.push(8,40,0,40,0,-40),e.push(VBi(n,h)); - const r=ZBi(i,t),o=GBi(i,.84); - e.push(FBi(zBi(o,{ - x:(o.x+r.x)/2,y:(o.y+r.y)/2} - ,r,6),1.7,1.4)); - const a=[]; - for(let c=0; - c<10; - c++){ - const t=c/10*RBi; - a.push([r.x+6*Math.cos(t),r.y+6*Math.sin(t)])} - return e.push($Bi(a)),e} - ,octopus(t,i){ - const s=i.arms??8,e=[],n=(t/RBi%1+1)%1,h=n<.35,r=Qt(t=>t*t*(3-2*t),"sm")(h?n/.35:(n-.35)/.65),o=h?PBi(.62,.14,r):PBi(.14,.62,r),a=h?1-.12*Math.sin(n/.35*Math.PI):1,c=[-1,-.72,-.44,-.15,.15,.44,.72,1]; - for(let f=0; - f<s; - f++){ - const i=c[f],s=Math.PI+i*o,n=196+(Math.abs(i)<.3?18:0)-10*Math.abs(i); - e.push(FBi(KBi(-6,12*i,s,n,18,h?3:7,1.1,1.6*t+.7*f,.25*-i*o),13,2.2))} - const l=[[2,0]]; - for(let f=0; - f<=8; - f++){ - const t=f/4-1,i=Math.PI+t*o,s=62-8*Math.abs(t); - l.push([Math.cos(i)*s-6,12*t+Math.sin(i)*s])} - e.push($Bi(l)); - const u=[]; - for(let f=0; - f<18; - f++){ - const t=f/18*RBi; - u.push([6+30*Math.cos(t),Math.sin(t)*(34+4*o)])} - e.push($Bi(u)); - const d=[]; - for(let f=0; - f<28; - f++){ - const t=f/28*RBi,i=t<Math.PI/2||t>1.5*Math.PI?96:40; - d.push([44+Math.cos(t)*i*(.96+.04*a),46*Math.sin(t)*a])} - return e.push($Bi(d)),e} - ,sperm(t){ - const{ - pts:i,lift:s} - =JBi(620,.7*t),e=[[0,4],[.06,8],[.2,24],[.4,45],[.55,55],[.66,58],[.75,60],[.96,60],[1,57]],n=[]; - n.push(VBi(GBi(i,0),$Bi(QBi([[12,0],[4,-32],[-30,-72],[-16,-26],[-22,0],[-16,26],[-30,72],[4,32]],s)))); - for(const h of[1,-1]){ - const t=GBi(i,.63),s=LBi(e,.63); - n.push(VBi(t,$Bi([[8,h*(s-4)],[-6,h*(s+22)],[-28,h*(s+26)],[-16,h*(s+2)]])))} - return n.push(UBi(i,e,{ - square:!0} - )),n} - ,serpent(t){ - const i=[]; - for(let s=0; - s<=70; - s++){ - const e=s/70; - i.push({ - x:1e3*(e-.5),y:60*Math.sin(2.1*RBi*(1-e)-1.4*t)*(.35+.65*(1-e))} - )} - return qBi(i,t)} - } - ,sUi=new Map; - function eUi(t){ - let i=sUi.get(t); - if(!i){ - let s=1/0,e=-1/0,n=0; - for(const i of[0,1.6,3.2,4.8])for(const h of iUi[t](i,{ - } - ))for(let t=0; - t<h.length; - t+=2)s=Math.min(s,h[t]),e=Math.max(e,h[t]),n=Math.max(n,Math.abs(h[t+1])); - i={ - cx:(s+e)/2,len:e-s,half:n/(e-s)} - ,sUi.set(t,i)} - return i} - function nUi(t,i,s={ - } - ){ - const{ - cx:e,len:n} - =eUi(t),h=1/n; - return iUi[t](i,s).map(t=>t.map((t,i)=>i%2?t*h:(t-e)*h))} - function hUi(t,i){ - if("angler"!==t)return null; - const{ - cx:s,len:e} - =eUi(t),n=ZBi(tUi(i),i); - return{ - x:(n.x-s)/e,y:n.y/e,r:6/e,flicker:.78+.22*Math.sin(2.3*i)*Math.sin(.7*i+1)} - } - Qt(eUi,"boxOf"),Qt(nUi,"silhouette"),Qt(hUi,"silhouetteLight"); - const rUi={ - narwhal:380,sperm:620} - ; - function oUi(t){ - const i=rUi[t]; - if(!i)return null; - const{ - cx:s,len:e} - =eUi(t); - return{ - nose:.5-(i/2-s)/e,tail:.5+(i/2+s)/e} - } - Qt(oUi,"silhouetteBodySpan"); - const aUi=Qt(t=>eUi(t).half,"silhouetteHalfWidth"),cUi=class extends Ke{ - constructor(t){ - super(),Zt(this,"shape",new ep),Zt(this,"fx",new Float32Array(97)),Zt(this,"fy",new Float32Array(97)),Zt(this,"fa",new Float32Array(97)),Zt(this,"posed",!1),Zt(this,"arms",8),Zt(this,"light",null),this.kind=t,this.eventMode="none",this.addChild(this.shape)} - pose(t,i,s,e,n){ - for(let o=0; - o<=96; - o++){ - const i=n((1.12*o/96-.06)*t); - this.fx[o]=i.x,this.fy[o]=i.y,this.fa[o]=i.a} - this.posed=!0; - const h=hUi(this.kind,i); - if(h){ - const i=this.at(.5-h.x),s=h.y*t; - this.light={ - x:i.x-Math.sin(i.a)*s,y:i.y+Math.cos(i.a)*s,r:h.r*t,flicker:h.flicker} - } - else this.light=null; - const r=this.shape; - r.clear(); - for(const o of nUi(this.kind,i,{ - arms:this.arms} - )){ - const i=new Array(o.length); - for(let s=0; - s<o.length; - s+=2){ - const e=this.at(.5-o[s]),n=o[s+1]*t; - i[s]=e.x-Math.sin(e.a)*n,i[s+1]=e.y+Math.cos(e.a)*n} - r.poly(i).fill(16777215)} - } - bodyPoint(t){ - if(!this.posed)return{ - x:0,y:0} - ; - const i=this.at(t); - return{ - x:i.x,y:i.y} - } - at(t){ - const i=Math.max(0,Math.min(96,(t- -.06)/1.12*96)),s=Math.min(95,Math.floor(i)),e=i-s; - let n=this.fa[s+1]-this.fa[s]; - return n>Math.PI?n-=2*Math.PI:n<-Math.PI&&(n+=2*Math.PI),{ - x:this.fx[s]+(this.fx[s+1]-this.fx[s])*e,y:this.fy[s]+(this.fy[s+1]-this.fy[s])*e,a:this.fa[s]+n*e} - } - } - ; - Qt(cUi,"FishingSilhouetteRig"); - let lUi=cUi; - const uUi=2*Math.PI,dUi=Qt((t,i,s)=>Math.max(i,Math.min(s,t)),"clamp"); - function fUi(t,i,s){ - const e=dUi((s-t)/(i-t),0,1); - return e*e*(3-2*e)} - function pUi(t,i){ - const s=1-i; - return{ - x:s**3*t[0].x+3*s*s*i*t[1].x+3*s*i*i*t[2].x+i**3*t[3].x,y:s**3*t[0].y+3*s*s*i*t[1].y+3*s*i*i*t[2].y+i**3*t[3].y} - } - function wUi(t){ - const i=dUi(t.age*t.speed,0,t.length),s=t.distances; - let e=1; - for(; - e<s.length-1&&s[e]<i; - )e++; - const n=(e-1+(i-s[e-1])/Math.max(.001,s[e]-s[e-1]))/(s.length-1),h=t.points,r=1-n,o=pUi(h,n),a=3*(r*r*(h[1].x-h[0].x)+2*r*n*(h[2].x-h[1].x)+n*n*(h[3].x-h[2].x)),c=3*(r*r*(h[1].y-h[0].y)+2*r*n*(h[2].y-h[1].y)+n*n*(h[3].y-h[2].y)),l=6*(r*(h[2].x-2*h[1].x+h[0].x)+n*(h[3].x-2*h[2].x+h[1].x)),u=(a*(6*(r*(h[2].y-2*h[1].y+h[0].y)+n*(h[3].y-2*h[2].y+h[1].y)))-c*l)/Math.max(1,Math.hypot(a,c)**3); - return{ - ...o,heading:Math.atan2(c,a),bank:dUi(u*t.speed*3.5,-.55,.55),height:t.height+3*Math.sin(.38*t.age+t.seed),alpha:fUi(0,2,t.age)*(1-fUi(t.life-2,t.life,t.age))} - } - function gUi(t,i,s,e,n){ - const h="gull"===t?2.7:1.6,r=(i+2*s)%("gull"===t?10.5:18),o=fUi(0,.45,r)*(1-fUi(h-.5,h,r)),a=i*uUi*("gull"===t?1.55:1.8)+s,c=.12+.7*Math.sin(a)*o+n*e,l=.18+.95*Math.sin(a-.65)*o+n*e; - return{ - inner:Math.cos(dUi(c,-1.05,1.05)),outer:Math.cos(dUi(l,-1.2,1.2)),sweep:o*Math.sin(a-.4)*.045,shade:dUi(.92+n*e*.14-.07*o*Math.sin(a),.65,1)} - } - Qt(fUi,"smooth"),Qt(pUi,"curve"),Qt(wUi,"sampleBirdFlight"),Qt(gUi,"birdWingPose"); - const mUi=class{ - constructor(t=Math.random){ - Zt(this,"birds",[]),Zt(this,"nextIn",5),Zt(this,"id",0),Zt(this,"zone","R"),this.random=t} - reset(t){ - this.zone=t,this.birds.length=0,this.nextIn=("R"===t?7:4)+5*this.random()} - update(t,i,s,e){ - for(let _=this.birds.length-1; - _>=0; - _--)this.birds[_].age+=t,this.birds[_].age>=this.birds[_].life&&this.birds.splice(_,1); - if(2===s)return void(this.nextIn=Math.max(this.nextIn-t,6)); - if(this.nextIn-=t,this.nextIn>0||this.birds.length)return; - const n=this.random,h="R"===this.zone?"hawk":"gull",r="hawk"===h?1:"C"===this.zone&&n()<.25?3:n()<.65?2:1,o=n()*uUi,a=Math.cos(o),c=Math.sin(o),l=-c,u=a,d=.5*Math.hypot(i.width,i.height)+160,f=d*("hawk"===h?.85:.18+.16*n())*(n()<.5?-1:1),p="hawk"===h?72:32+18*n(),w="hawk"===h&&e?e:{ - x:i.x+.5*i.width,y:i.y+.5*i.height} - ,g=w.x-l*f*.65,m=w.y+p-u*f*.65,v=("hawk"===h?29:34)+7*n(); - for(let _=0; - _<r; - _++){ - const t=-a*_*32+l*_*26,i=-c*_*32+u*_*26,s=Qt((s,e)=>({ - x:g+a*s+l*e+t,y:m+c*s+u*e+i} - ),"at"),e=[s(-d,0),s(.35*-d,f),s(.35*d,f),s(d,0)],r=[0]; - let o=e[0],w=0; - for(let n=1; - n<=64; - n++){ - const t=pUi(e,n/64); - w+=Math.hypot(t.x-o.x,t.y-o.y),r.push(w),o=t} - const M=v*(1-.018*_); - this.birds.push({ - id:++this.id,kind:h,age:0,life:w/M,speed:M,span:"hawk"===h?35+5*n():25+6*n(),height:p+5*_,seed:n()*uUi,points:e,distances:r,length:w} - )} - this.nextIn=Math.max(...this.birds.map(t=>t.life))+("hawk"===h?27:"O"===this.zone?22:15)+15*n()} - } - ; - Qt(mUi,"BirdFlightModel"); - let vUi=mUi; - const _Ui=class extends Ke{ - constructor(t,i=!1){ - super(),Zt(this,"wings",[new ep,new ep]),Zt(this,"tail",new ep),this.kind=t,this.shadow=i,this.eventMode="none"; - const s="gull"===t,e=1324356,n=new ep,h=i?e:s?15265263:6640452; - this.tail.moveTo(-8,-3.8).lineTo(s?-24:-29,-7).quadraticCurveTo(s?-27:-31,0,s?-24:-29,7).lineTo(-8,3.8).closePath().fill(h),this.tail.pivot.set(-8,0),this.tail.position.set(-8,0),n.ellipse(-1,0,15.5,4.5).fill(i?e:s?16118504:7757899),n.ellipse(14,0,6.5,3.5).fill(i?e:s?16776175:4799539),n.moveTo(19.2,-1.4).lineTo(24,0).lineTo(19.2,1.4).closePath().fill(i?e:s?14200162:9205586),i||n.ellipse(16.5,-2.1,.6,.6).fill(3620668),this.addChild(this.tail,...this.wings,n)} - pose(t,i,s,e){ - this.scale.set(t/100),this.tail.rotation=.12*-e+.018*Math.sin(.65*i+s); - for(let n=0; - n<2; - n++){ - const t=0===n?-1:1,h=gUi(this.kind,i,s,e,t),r=this.wings[n].clear(),o="gull"===this.kind,a=23*h.inner,c=a+27*h.outer,l=2.5+100*h.sweep,u=(o?-15:-11)+140*h.sweep,d=Qt(i=>i*t,"y"); - r.moveTo(8.5,d(2.5)).quadraticCurveTo(9.5,d(.65*a),l,d(a)).quadraticCurveTo(u+7,d(c-7),u,d(c)).quadraticCurveTo(u+1.2,d(c-11),o?-7.5:-10.5,d(.9*a)).quadraticCurveTo(-8,d(6),-10.5,d(2.5)).closePath().fill(this.shadow?1324356:o?14279653:6115396),this.shadow||(r.moveTo(u,d(c)).quadraticCurveTo(u+1.5,d(c-6.5),u+3.1,d(c-10)).lineTo(u+5.5,d(c-7.3)).quadraticCurveTo(u+2.9,d(c-2.7),u,d(c)).closePath().fill(o?5069922:3421745),r.moveTo(3.5,d(7.5)).quadraticCurveTo(1.8,d(a),u+3.4,d(c-7.5)).stroke({ - color:o?16119275:10191972,alpha:.5,width:.9} - )),r.alpha=this.shadow?1:h.shade} - } - } - ; - Qt(_Ui,"FishingBirdRig"); - let MUi=_Ui; - const bUi=class{ - constructor(){ - Zt(this,"sky",new Ke),Zt(this,"shadows",new Ke),Zt(this,"model",new vUi),Zt(this,"views",new Map),Zt(this,"blur",new _f({ - strength:1.25,quality:2} - )),Zt(this,"daylight",1),this.sky.eventMode=this.shadows.eventMode="none",this.shadows.filters=[this.blur],this.shadows.on("destroyed",()=>this.blur.destroy())} - reset(t){ - this.model.reset(t); - for(const i of this.views.values())i.bird.destroy({ - children:!0} - ),i.shadow.destroy({ - children:!0} - ); - this.views.clear()} - update(t,i,s,e,n){ - let h; - if("R"===s&&!this.model.birds.length){ - let t=1/0; - for(const s of[.25,.5,.75])for(const e of[.3,.5,.7]){ - const r=i.x+i.width*s,o=i.y+i.height*e,a=n(r,o); - a>0&&Math.abs(a-55)<t&&(t=Math.abs(a-55),h={ - x:r,y:o} - )} - } - this.model.update(t,i,e,h); - const r=new Set(this.model.birds.map(t=>t.id)); - for(const[o,a]of this.views)r.has(o)||(a.bird.destroy({ - children:!0} - ),a.shadow.destroy({ - children:!0} - ),this.views.delete(o)); - this.daylight+=((2===e?0:1)-this.daylight)*(1-Math.exp(1.3*-t)); - for(const o of this.model.birds){ - let t=this.views.get(o.id); - t||(t={ - bird:new MUi(o.kind),shadow:new MUi(o.kind,!0)} - ,this.views.set(o.id,t),this.sky.addChild(t.bird),this.shadows.addChild(t.shadow)); - const s=wUi(o); - t.bird.pose(o.span,o.age,o.seed,s.bank),t.shadow.pose(.86*o.span,o.age,o.seed,s.bank),t.bird.position.set(s.x,s.y-s.height),t.bird.rotation=t.shadow.rotation=s.heading,t.shadow.position.set(s.x+.28*s.height,s.y+.18*s.height),t.bird.alpha=s.alpha*this.daylight*("gull"===o.kind?.86:.8),t.shadow.alpha=s.alpha*this.daylight*("gull"===o.kind?.09:.065)*(3===e?.28:1===e?.65:1); - const n=s.x>i.x-160&&s.x<i.x+i.width+160&&s.y>i.y-160&&s.y<i.y+i.height+160; - t.bird.visible=t.shadow.visible=n} - this.shadows.visible=this.model.birds.length>0&&this.daylight>.01} - } - ; - Qt(bUi,"FishingBirds"); - let yUi=bUi; - const EUi=class t extends Ke{ - constructor(){ - super(),Zt(this,"pool",[]),Zt(this,"used",0),Zt(this,"moon",0),Zt(this,"lantern",0),Zt(this,"initialized",!1),this.eventMode="none"} - static softLight(){ - if(!this.texture){ - const t=document.createElement("canvas"); - t.width=t.height=64; - const i=t.getContext("2d"),s=i.createRadialGradient(32,32,0,32,32,32); - s.addColorStop(0,"rgba(255,255,255,1)"),s.addColorStop(.28,"rgba(255,255,255,.55)"),s.addColorStop(.65,"rgba(255,255,255,.12)"),s.addColorStop(1,"rgba(255,255,255,0)"),i.fillStyle=s,i.fillRect(0,0,64,64),this.texture=ls.from(t),this.texture.source.scaleMode="linear"} - return this.texture} - facet(i,s,e,n,h,r,o){ - if(o<.003||this.used>=400)return; - let a=this.pool[this.used++]; - a||(a=new Xe(t.softLight()),a.anchor.set(.5),a.blendMode="add",a.eventMode="none",this.pool.push(a),this.addChild(a)),a.visible=!0,a.position.set(i,s),a.width=e,a.height=n,a.rotation=h,a.tint=r,a.alpha=o} - update(t,i,s,e,n,h,r){ - const o=2===n?1:0,a=[0,.32,1,.16][n]??0,c=this.initialized?1-Math.exp(.8*-t):1; - this.initialized=!0,this.moon+=(o-this.moon)*c,this.lantern+=(a-this.lantern)*c,this.used=0; - const l=Qt((t,i,s)=>r(t,i)&&r(t-.5*s,i)&&r(t+.5*s,i),"wet"); - if(this.moon>.01){ - const t=64,n=46; - for(let h=Math.floor((s.y-48)/n); - h<=Math.ceil((s.y+s.height+48)/n); - h++)for(let r=Math.floor((s.x-64)/t); - r<=Math.ceil((s.x+s.width+64)/t); - r++){ - let s=Math.imul(r,374761393)^Math.imul(h,668265263); - s=Math.imul(s^s>>>13,1274126177); - const o=(s>>>0)/4294967296,a=o*Math.PI*2,c=(r+.5)*t+25*Math.sin(7*a),u=(h+.5)*n+17*Math.cos(9*a),d=BDi(c,u,i,e),f=Math.pow(Math.max(0,Math.sin(i*(.43+.14*o)+a+.28*d.height)),3),p=(8+20*o)*(.8+.2*f),w=c+d.driftX,g=u-.9*d.height; - if(f<.025||!l(w,g,p))continue; - const m=.65+.35*Math.sin(.003*c+.0015*u)**2; - this.facet(w,g,p,1.1+.7*o,2*d.slopeX-.13,11914463,f*m*this.moon*.32)} - } - if(this.lantern>.01)for(const u of h.slice(0,24))if(!(u.x<s.x-80||u.x>s.x+s.width+80||u.y<s.y-80||u.y>s.y+s.height+80))for(let t=0; - t<11; - t++){ - const s=1.7*u.seed+2.39996*t,n=7+4.1*t,h=u.x+Math.sin(s)*(2+.72*t),r=u.y+n,o=BDi(h,r,i,e),a=.58+.42*Math.sin(.8*i+s+.6*o.height),c=(6+2*Math.sin(3*s)+.52*t)*(.8+.35*a),d=h+1.4*o.driftX+75*o.slopeX,f=r-o.height; - l(d,f,c)&&this.facet(d,f,c,1.5+.9*a,2*o.slopeX-.13,u.color,this.lantern*u.strength*(1-t/12)**1.5*(.18+.35*a))} - for(let u=this.used; - u<this.pool.length; - u++)this.pool[u].visible=!1; - this.visible=this.used>0} - } - ; - Qt(EUi,"FishingWaterLight"),Zt(EUi,"texture"); - let AUi=EUi; - function SUi(t,i,s,e){ - const n=new Set; - return t.filter(t=>!(n.has(t.id)||!Number.isFinite(t.x)||!Number.isFinite(t.y))&&(n.add(t.id),t.x>=s.x&&t.x<=s.x+s.width&&t.y>=s.y&&t.y<=s.y+s.height)).map(t=>({ - boat:t,score:Math.max(0,Math.hypot(t.x-i.x,t.y-i.y)-(e.has(t.id)?45:0))} - )).sort((t,i)=>t.score-i.score||t.boat.id.localeCompare(i.boat.id)).slice(0,30).map(t=>t.boat)} - Qt(SUi,"nearbyBoats"); - const TUi=165,CUi="육지와 너무 가까워요 · 조금 더 넓은 물로 가요",OUi=[1,1.1,1.25,1.5],IUi=[1400,700],kUi=3e3,xUi=IUi[0]+250,RUi=.78125,PUi=.36,NUi=[60,76,92,108,124,140,158],LUi=[6,16,26],DUi=.135,GUi=.105,BUi=[.62,.55,.55,.55],UUi=new Map; - function FUi(t,i){ - let s=UUi.get(t); - if(!s){ - const e=t.frame; - s=new ls({ - source:t.source,frame:new $i(e.x,e.y,e.width,Math.round(e.height*(BUi[i]??.55)))} - ),UUi.set(t,s)} - return s} - Qt(FUi,"floatTop"); - const $Ui=[0,.5,1,.65],HUi=[16765562,16751178,13172586,8377599,16748488,12164351,6287568,15922943],WUi=Qt(t=>{ - let i=2166136261; - for(let s=0; - s<t.length; - s++)i^=t.charCodeAt(s),i=Math.imul(i,16777619); - return i>>>0} - ,"strHash"),VUi=Qt(t=>HUi[WUi(t)%HUi.length],"lanternColor"),jUi=.29,KUi=Qt(t=>Math.max(0,["m","b","e"].indexOf(t.slice(-1))),"guestIndex"),zUi=Math.round(37.5)+16,YUi=1.7*jUi,qUi={ - "인간":15909198,"엘프":7327615,"언데드":10849535,"오크":3975360} - ; - function XUi(t,i,s,e,n){ - const h=rFi[e],r=oFi[n],o=new Float32Array(t*i); - for(let f=0; - f<i; - f++)for(let i=0; - i<t; - i++)o[f*t+i]=s(i,f)?0:1e9; - const a=Qt((s,e,n,h,r)=>{ - const a=s+n,c=e+h; - if(a<0||c<0||a>=i||c>=t)return; - const l=s*t+e,u=o[a*t+c]+r; - u<o[l]&&(o[l]=u)} - ,"relax"); - for(let f=0; - f<i; - f++)for(let i=0; - i<t; - i++)a(f,i,0,-1,1),a(f,i,-1,0,1),a(f,i,-1,-1,1.414),a(f,i,-1,1,1.414); - for(let f=i-1; - f>=0; - f--)for(let i=t-1; - i>=0; - i--)a(f,i,0,1,1),a(f,i,1,0,1),a(f,i,1,1,1.414),a(f,i,1,-1,1.414); - const c=Qt(t=>{ - let i=h[r[0][1]]; - for(let s=1; - s<r.length; - s++){ - const[e]=r[s-1],[n,o,a]=r[s],c=i,l=h[o].map((t,i)=>c[i]+(t-c[i])*a); - if(t<=e)break; - const u=Math.min(1,(t-e)/(n-e)),d=u*u*(3-2*u); - if(i=c.map((t,i)=>t+(l[i]-t)*d),t<n)break} - return i} - ,"colorAt"),l=document.createElement("canvas"); - l.width=t,l.height=i; - const u=l.getContext("2d"),d=u.createImageData(t,i); - for(let f=0; - f<i; - f++)for(let i=0; - i<t; - i++){ - const s=c(Math.max(0,o[f*t+i]-.5)),e=4*(f*t+i); - d.data[e]=s[0],d.data[e+1]=s[1],d.data[e+2]=s[2],d.data[e+3]=255} - return u.putImageData(d,0,0),{ - canvas:l,dist:o} - } - Qt(XUi,"waterCanvas"); - const JUi={ - whale:{ - L:520,rope:!0,amp:.006,tailPow:3,wave:.8,freq:.2,speed:30,turn:.065,rMin:2.2,wn:.45,alpha:.38,need:230} - ,manta:{ - L:280,rope:!1,amp:0,tailPow:1,wave:0,freq:.23,speed:32,turn:.16,rMin:1.5,wn:.6,alpha:.36,need:180} - ,shark:{ - L:230,rope:!0,amp:.04,tailPow:2.4,wave:2.8,freq:.65,speed:42,turn:.24,rMin:1.35,wn:.8,alpha:.38,need:120} - ,catfish:{ - L:170,rope:!0,amp:.04,tailPow:2,wave:1.8,freq:.5,speed:20,turn:.25,rMin:.55,wn:.7,alpha:.42,need:90} - ,eel:{ - L:170,rope:!0,amp:.05,tailPow:1,wave:3.6,freq:.45,speed:22,turn:.35,rMin:.4,wn:.9,alpha:.38,need:60} - ,megalodon:{ - L:900,rope:!0,amp:.03,tailPow:3,wave:3.2,freq:.08,speed:31,turn:.035,rMin:2.8,wn:.32,alpha:.36,need:300} - ,whaleShark:{ - L:440,rope:!0,amp:.035,tailPow:3,wave:3.2,freq:.12,speed:25,turn:.075,rMin:2,wn:.45,alpha:.43,need:190} - ,turtle:{ - L:112,rope:!1,amp:0,tailPow:1,wave:0,freq:.12,speed:15,turn:.12,rMin:1.7,wn:.55,alpha:.44,need:85} - ,sturgeon:{ - L:245,rope:!0,amp:.04,tailPow:2.4,wave:4.6,freq:.18,speed:21,turn:.16,rMin:1.3,wn:.65,alpha:.43,need:100} - ,croc:{ - L:345,rope:!1,amp:0,tailPow:1,wave:0,freq:.55,speed:20,turn:.25,rMin:.8,wn:.7,alpha:.42,need:143} - ,jelly:{ - L:267,rope:!1,amp:0,tailPow:1,wave:0,freq:.28,speed:17,turn:.12,rMin:1.4,wn:.5,alpha:.4,need:143} - ,hammer:{ - L:250,rope:!1,amp:0,tailPow:1,wave:0,freq:.7,speed:40,turn:.22,rMin:1.3,wn:.8,alpha:.38,need:150} - ,narwhal:{ - L:510,rope:!1,amp:0,tailPow:1,wave:0,freq:.2,speed:30,turn:.08,rMin:2,wn:.5,alpha:.4,need:200} - ,squid:{ - L:520,rope:!1,amp:0,tailPow:1,wave:0,freq:.3,speed:26,turn:.09,rMin:1.8,wn:.5,alpha:.4,need:210} - ,angler:{ - L:330,rope:!1,amp:0,tailPow:1,wave:0,freq:.25,speed:21,turn:.1,rMin:1.6,wn:.5,alpha:.44,need:160} - ,octopus:{ - L:380,rope:!1,amp:0,tailPow:1,wave:0,freq:.25,speed:18,turn:.1,rMin:1.6,wn:.5,alpha:.42,need:180} - ,sperm:{ - L:620,rope:!1,amp:0,tailPow:1,wave:0,freq:.12,speed:26,turn:.06,rMin:2.4,wn:.4,alpha:.4,need:250} - ,serpent:{ - L:1e3,rope:!1,amp:0,tailPow:1,wave:0,freq:.22,speed:32,turn:.05,rMin:2.6,wn:.35,alpha:.38,need:280} - } - ,QUi={ - O:{ - kinds:[["whale",.14],["manta",.1],["shark",.1],["whaleShark",.12],["turtle",.06],["megalodon",.05],["narwhal",.08],["squid",.08],["angler",.07],["octopus",.07],["sperm",.07],["serpent",.06]],first:[12,25],every:[40,80],under:.3,scale:1} - ,C:{ - kinds:[["shark",.22],["manta",.2],["turtle",.3],["whaleShark",.08],["jelly",.12],["hammer",.08]],first:[45,70],every:[90,170],under:.25,scale:.8} - ,R:{ - kinds:[["catfish",.34],["eel",.22],["sturgeon",.22],["croc",.22]],first:[100,160],every:[200,360],under:.2,scale:1} - } - ,ZUi=.95,tFi=[.95,.84,.73,.62,.51,.4,.29,.18,.12],iFi=[1,.85,0,.6],sFi=[16774358,16761486,12900607,16769772],eFi=[{ - color:16777215,alpha:.2} - ,{ - color:16756848,alpha:.22} - ,{ - color:9416959,alpha:.08} - ,{ - color:15791359,alpha:.14} - ],nFi=[{ - color:16777215,alpha:0} - ,{ - color:16747082,alpha:.16} - ,{ - color:726848,alpha:.52} - ,{ - color:14674154,alpha:.12} - ],hFi=[0,0,0,.55],rFi={ - "인간":{ - shallow:[126,208,214],mid:[58,162,198],deep:[26,104,162],abyss:[14,44,104],riverShallow:[126,208,214],riverDeep:[62,142,168],land:[128,168,92]} - ,"엘프":{ - shallow:[128,222,196],mid:[52,168,172],deep:[22,104,136],abyss:[12,46,92],riverShallow:[128,222,196],riverDeep:[58,138,136],land:[84,158,88]} - ,"언데드":{ - shallow:[120,150,144],mid:[74,110,118],deep:[36,62,82],abyss:[16,26,50],riverShallow:[120,150,144],riverDeep:[64,88,92],land:[92,88,104]} - ,"오크":{ - shallow:[152,208,228],mid:[84,162,206],deep:[32,96,154],abyss:[14,42,94],riverShallow:[152,208,228],riverDeep:[70,126,160],land:[222,232,238]} - } - ,oFi={ - R:[[0,"riverShallow",1],[2.5,"riverDeep",1]],C:[[0,"shallow",1],[2,"mid",1],[6,"deep",1],[16,"abyss",.45]],O:[[0,"shallow",1],[2,"mid",1],[6,"deep",1],[14,"abyss",.6],[26,"abyss",1]]} - ,aFi=.72,cFi=[18e3,55e3],lFi=Qt((t,i)=>{ - let s=t-i; - for(; - s>Math.PI; - )s-=2*Math.PI; - for(; - s<-Math.PI; - )s+=2*Math.PI; - return s} - ,"angDiff"),uFi=class t extends Ke{ - constructor(i,s=t.DEFAULT_H){ - super(),Zt(this,"world",new Ke),Zt(this,"mapSprite",new Xe(ls.EMPTY)),Zt(this,"chunkLayer",new Ke),Zt(this,"chunks",new Map),Zt(this,"shadowLayer",new Ke),Zt(this,"underLayer",new Ke),Zt(this,"giantLayer",new Ke),Zt(this,"giants",[]),Zt(this,"school",new lBi),Zt(this,"nextSchoolAt",0),Zt(this,"nextGiantAt",0),Zt(this,"giantSeen",!1),Zt(this,"landDist",null),Zt(this,"othersLayer",new Ke),Zt(this,"otherNames",new Ke),Zt(this,"others",new Map),Zt(this,"otherCandidates",[]),Zt(this,"otherPickAt",0),Zt(this,"boatWater",new zDi),Zt(this,"hullPose",$Di(0,0,0,0,"R",0,0)),Zt(this,"bobberWave",0),Zt(this,"floatLandedAt",-1/0),Zt(this,"boatShadow",new ep),Zt(this,"boat",new Xe(ls.EMPTY)),Zt(this,"angler",new Xe(ls.EMPTY)),Zt(this,"myLookRaw"),Zt(this,"myTop",null),Zt(this,"anglerRot",0),Zt(this,"lamp",new Xe(ls.EMPTY)),Zt(this,"prowSp",new Xe(ls.EMPTY)),Zt(this,"sailSp",new Xe(ls.EMPTY)),Zt(this,"myDeco",{ - prow:-1,sail:-1,lantern:-1} - ),Zt(this,"myDecoKey",""),Zt(this,"floatSp",new Xe(ls.EMPTY)),Zt(this,"bobberLv",0),Zt(this,"rodTip",{ - x:0,y:0} - ),Zt(this,"lampAt",{ - x:0,y:0} - ),Zt(this,"lightLayer",new Ke),Zt(this,"lightClip",new ep),Zt(this,"lightPool",[]),Zt(this,"lightUsed",0),Zt(this,"waterLight",new AUi),Zt(this,"myColor",VUi(TG.userId||"me")),Zt(this,"baseColor",this.myColor),Zt(this,"line",new ep),Zt(this,"float",new ep),Zt(this,"fx",new ep),Zt(this,"fxAdd",new ep),Zt(this,"flyLayer",new Ke),Zt(this,"hitLayer",new Ke),Zt(this,"worldTop",new Ke),Zt(this,"harpoonFxs",[]),Zt(this,"aimMark",null),Zt(this,"shakeAmp",0),Zt(this,"shakeUntil",0),Zt(this,"birds",new yUi),Zt(this,"birdClip",new ep),Zt(this,"labels",new Ke),Zt(this,"tideTint",new ep),Zt(this,"clip",new ep),Zt(this,"frame",new ep),Zt(this,"hint",new Ke),Zt(this,"hud",new Ke),Zt(this,"key",""),Zt(this,"info",null),Zt(this,"landBits",null),Zt(this,"race","인간"),Zt(this,"zone","R"),Zt(this,"point",0),Zt(this,"boatLv",0),Zt(this,"bx",0),Zt(this,"by",0),Zt(this,"heading",-Math.PI/2),Zt(this,"speed",0),Zt(this,"target",null),Zt(this,"route",[]),Zt(this,"nav",null),Zt(this,"stuckFor",0),Zt(this,"replanned",!1),Zt(this,"fxp",{ - x:0,y:0} - ),Zt(this,"floatLift",0),Zt(this,"floatVisible",!1),Zt(this,"camX",0),Zt(this,"camY",0),Zt(this,"bite",!1),Zt(this,"biteIn",1/0),Zt(this,"biteInAt",0),Zt(this,"tide",0),Zt(this,"shadows",[]),Zt(this,"ripples",[]),Zt(this,"particles",[]),Zt(this,"foam",[]),Zt(this,"crowns",[]),Zt(this,"foamLayer",new Ke),Zt(this,"foamPool",[]),Zt(this,"foamUsed",0),Zt(this,"glints",new Ke),Zt(this,"glintList",[]),Zt(this,"glintPool",[]),Zt(this,"sun",new Xe(ls.EMPTY)),Zt(this,"vignette",new Xe(ls.EMPTY)),Zt(this,"fogOfWar",new Xe(ls.EMPTY)),Zt(this,"fogCanvas",null),Zt(this,"fogTex",null),Zt(this,"fogBits",null),Zt(this,"fogStore",""),Zt(this,"fogCell",-1),Zt(this,"miniFog",new Xe(ls.EMPTY)),Zt(this,"bigFog",new Xe(ls.EMPTY)),Zt(this,"miniTerr",new Xe(ls.EMPTY)),Zt(this,"bigTerr",new Xe(ls.EMPTY)),Zt(this,"terrCanvas",[null,null]),Zt(this,"terrTex",[null,null]),Zt(this,"fog",null),Zt(this,"reel",null),Zt(this,"catchTl",null),Zt(this,"castTween",null),Zt(this,"retrieveTween",null),Zt(this,"departAt",0),Zt(this,"reelPull",!1),Zt(this,"running",!1),Zt(this,"lastTime",0),Zt(this,"startAt",performance.now()),Zt(this,"busyUntil",0),Zt(this,"nibbleSeen",-1),Zt(this,"onTapBefore",null),Zt(this,"onStopAtPoint",null),Zt(this,"onFrame",Qt(()=>this.drawMotion(performance.now()-this.startAt),"onFrame")),Zt(this,"startInSail",null),Zt(this,"rodHold",!1),Zt(this,"mode","fish"),Zt(this,"modeBtn",new Ke),Zt(this,"modeBg",new ep),Zt(this,"modeIcons",{ - fish:mRi("hook",22,16777215),sail:mRi("boat",22,16777215)} - ),Zt(this,"modeText",Jxi("",Gxi,13)),Zt(this,"onCast",null),Zt(this,"onModeChange",null),Zt(this,"hintTween",null),Zt(this,"foundMask",0),Zt(this,"zoneNow",-1),Zt(this,"zoneBanner",new Ke),Zt(this,"zoneTween",null),Zt(this,"fogRun",0),Zt(this,"glide",{ - dx:0,dy:0,at:0,ms:0} - ),Zt(this,"mapFogCanvas",null),Zt(this,"mapFogTex",null),Zt(this,"nextFishAt",0),Zt(this,"rockUntil",0),Zt(this,"devWhaleBox",null),Zt(this,"lastSchool",null),Zt(this,"nibbler",null),Zt(this,"nibbleRolled",0),Zt(this,"verts",null),Zt(this,"terr",null),Zt(this,"tileLayer",new Ke),Zt(this,"shoreLayer",new Ke),Zt(this,"shoreFoamLayer",new Ke),Zt(this,"propLayer",new Ke),Zt(this,"regions",new Map),Zt(this,"shoreRuns",new Map),Zt(this,"water",null),Zt(this,"surf",[]),Zt(this,"miniMap",new Ke),Zt(this,"miniImg",new Xe(ls.EMPTY)),Zt(this,"miniBg",new ep),Zt(this,"miniDots",new ep),Zt(this,"miniGoal",new ep),Zt(this,"bigGoal",new ep),Zt(this,"bigMap",new Ke),Zt(this,"bigImg",new Xe(ls.EMPTY)),Zt(this,"bigDots",new ep),Zt(this,"bigLabels",new Ke),Zt(this,"bigDim",new ep),Zt(this,"bigClose",new cRi("닫기",132,46,16)),Zt(this,"bigTip",dRi("가고 싶은 곳을 누르면 배가 출발해요",16777215,Vxi,12,9)),Zt(this,"miniTex",null),Zt(this,"miniMe",new ep),Zt(this,"miniView",new ep),Zt(this,"miniTarget",new ep),Zt(this,"bigMe",new ep),Zt(this,"bigTarget",new ep),Zt(this,"bigOthers",new ep),Zt(this,"markSig",""),Zt(this,"bigOthersAt",0),Zt(this,"npcLayer",new Ke),Zt(this,"npcTags",new Ke),Zt(this,"npcs",[]),Zt(this,"npcSig",""),Zt(this,"npcSpots",[]),Zt(this,"onVisitorTap",null),Zt(this,"onHubTap",null),Zt(this,"onHubArrive",null),Zt(this,"hubLayer",new Ke),Zt(this,"hubs",[]),Zt(this,"hubViews",new Map),Zt(this,"hubPlaces",new Map),Zt(this,"hubSig",""),Zt(this,"goal",null),Zt(this,"goalSig",""),Zt(this,"goalMarks",new ep),Zt(this,"goalArrow",new Ke),Zt(this,"goalArrowHead",new ep),Zt(this,"goalArrowText",""),Zt(this,"chunkKey",""),Zt(this,"othersFloats",new Ke),Zt(this,"othersWater",new Ke),Zt(this,"othersLines",new ep),Zt(this,"onOtherTap",null),Zt(this,"speedBonus",0),Zt(this,"sailBlock",null),Zt(this,"repairFx",new HLi({ - angler:DUi} - )),Zt(this,"fixingNow",!1),Zt(this,"afterFixAt",0),Zt(this,"waveG",new ep),Zt(this,"waves",[]),Zt(this,"waveKick",{ - dx:0,dy:0,rot:0} - ),Zt(this,"waveIncoming",0),Zt(this,"waveWait",null),Zt(this,"plunderG",new ep),Zt(this,"ropes",[]),Zt(this,"plunderFocus",null),Zt(this,"snaps",[]),Zt(this,"tut",!1),Zt(this,"tutorialMoveBtn",!1),Zt(this,"modeBtnHidden",!1),Zt(this,"tutorialRing",null),Zt(this,"tutorialRingScale",1),Zt(this,"tutorialLift",0),Zt(this,"rodBalloon",new Ke),Zt(this,"rodBalloonOn",!1),Zt(this,"rodBubble",new Xe(ls.EMPTY)),Zt(this,"pointSyncUntil",0),Zt(this,"dockAt",0),Zt(this,"dockShown",0),this.viewW=i,this.viewH=s,this.on("removed",()=>this.cancelHarpoon()); - for(const t of[this.boatShadow,this.line,this.float,this.fx,this.fxAdd,this.tideTint,this.frame,this.glints])t.eventMode="none"; - this.glints.eventMode="none",this.shadowLayer.eventMode=this.flyLayer.eventMode=this.labels.eventMode=this.foamLayer.eventMode="none",this.underLayer.eventMode=this.giantLayer.eventMode="none",this.underLayer.addChild(this.giantLayer,this.shadowLayer,this.school),this.fxAdd.blendMode="add",this.boat.anchor.set(.5),this.boat.eventMode=this.prowSp.eventMode=this.sailSp.eventMode="none",this.angler.eventMode=this.lamp.eventMode=this.floatSp.eventMode="none",this.lamp.anchor.set(.5),this.floatSp.visible=!1,this.lightLayer.eventMode="none",this.lightLayer.mask=this.lightClip,this.birdClip.eventMode="none",this.birds.sky.mask=this.birdClip,this.chunkLayer.eventMode="none",this.othersLayer.eventMode=this.otherNames.eventMode=this.othersFloats.eventMode=this.othersLines.eventMode=this.othersWater.eventMode=this.plunderG.eventMode="none",this.tileLayer.eventMode="none",this.shoreFoamLayer.eventMode=this.shoreLayer.eventMode=this.propLayer.eventMode="none",this.npcLayer.eventMode=this.npcTags.eventMode=this.hubLayer.eventMode=this.goalMarks.eventMode=this.goalArrow.eventMode="none",this.world.addChild(this.mapSprite,this.tileLayer,this.shoreFoamLayer,this.shoreLayer,this.chunkLayer,this.glints,this.waterLight,this.birds.shadows,this.propLayer,this.npcLayer,this.hubLayer,this.othersWater,this.othersLayer,this.othersFloats,this.othersLines,this.plunderG,this.boatWater,this.foamLayer,this.boatShadow,this.line,this.float,this.floatSp,this.boat,this.sailSp,this.prowSp,this.angler,this.lamp,this.fx,this.fxAdd,this.flyLayer,this.otherNames,this.hitLayer,this.npcTags,this.fogOfWar,this.goalMarks,this.labels,this.rodBalloon),this.world.addChildAt(this.repairFx.under,this.world.getChildIndex(this.boatWater)),this.world.addChildAt(this.repairFx.over,this.world.getChildIndex(this.otherNames)),this.waveG.eventMode="none",this.world.addChildAt(this.waveG,this.world.getChildIndex(this.boatShadow)),this.repairFx.onSound=t=>{ - try{ - QG.getInstance().playSFX("finish"===t?QG.SFX_GOLD_GOBLIN:QG.SFX_WOOD_MALLET,"finish"===t?.5:"help"===t?.35:.22)} - catch{ - } - } - ,this.world.mask=this.clip,this.tideTint.alpha=0; - const[e,n]=t.lightTextures(); - this.sun.texture=e,this.vignette.texture=n,this.sun.anchor.set(.5),this.sun.blendMode="add",this.sun.eventMode="none",this.vignette.eventMode="none",this.hint.eventMode=this.zoneBanner.eventMode="none",this.buildModeButton(),this.buildRodBalloon(),this.buildMinimap(),this.hud.addChild(this.hint,this.goalArrow,this.modeBtn,this.miniMap),this.worldTop.eventMode="none",this.addChild(this.world,this.clip,this.sun,this.vignette,this.birdClip,this.birds.sky,this.tideTint,this.lightClip,this.lightLayer,this.worldTop,this.zoneBanner,this.hud,this.bigMap,this.frame),this.layoutView(),this.setMode("fish"),this.eventMode="static",this.cursor="pointer",this.on("pointertap",t=>{ - var i,s,e; - const n=this.world.toLocal(t.global); - if(this.rodBalloonHit(n.x,n.y))return t.stopPropagation(),this.hideRodBalloon(),this.hint.visible=!1,void this.arrive(); - const h=this.hubAt(n.x,n.y); - if(h)return t.stopPropagation(),void(null==(i=this.onHubTap)||i.call(this,h,this.hubNear(h))); - const r="fish"===this.mode?this.npcAt(n.x,n.y):null; - if(r)return t.stopPropagation(),void(null==(s=this.onVisitorTap)||s.call(this,r)); - if(null==(e=this.onTapBefore)?void 0:e.call(this))return void t.stopPropagation(); - const o=this.otherAt(n.x,n.y); - if(o&&this.onOtherTap)return t.stopPropagation(),void this.onOtherTap(o.a,Math.hypot(o.x-this.bx,o.y-this.by)<=RIi); - const a=this.world.toLocal(t.global); - this.tapAt(a.x,a.y),t.stopPropagation()} - )} - resize(t,i){ - if(t!==this.viewW||i!==this.viewH){ - this.viewW=t,this.viewH=i,this.layoutView(); - for(const s of this.surf)s.width=t+128,s.height=i+128; - this.fog&&(this.fog.width=t,this.fog.height=i),this.miniImg.texture!==ls.EMPTY&&this.miniMap.position.set(10,i-this.miniImg.height-18),this.markSig="",this.bigMap.visible&&this.info&&this.buildMinimapTexture(),this.hint.visible&&this.hint.position.set((t-this.hint.width)/2,i-this.hint.height-12)} - } - setHudAlpha(t){ - this.tut?this.applyTutorialHud():(this.hud.alpha=t,this.hud.visible=t>.01)} - layoutView(){ - const t=this.viewW,i=this.viewH; - for(const s of[this.lightClip,this.birdClip,this.clip,this.tideTint])s.clear().rect(0,0,t,i).fill(16777215); - this.sun.width=1.5*t,this.sun.height=1.1*i,this.vignette.width=t,this.vignette.height=i,this.hitArea=new $i(0,0,t,i),this.modeBtn.position.set(t-58,i-32-(this.tut?this.tutorialLift:0)),this.bigDim.clear().rect(0,0,t,i).fill({ - color:526346,alpha:.82} - ),this.bigClose.position.set((t-132)/2,i-46-14),this.bigTip.position.set((t-this.bigTip.width)/2,i-46-14-this.bigTip.height-8),this.bigMap.hitArea=new $i(0,0,t,i)} - get floatX(){ - return this.fxp.x+this.world.x} - get floatY(){ - return this.fxp.y+this.world.y-8} - get sailing(){ - return"sail"===this.mode||!!this.target||this.speed>1} - get bigMapOpen(){ - return this.bigMap.visible} - closeBigMap(){ - this.bigMap.visible&&this.openBigMap(!1)} - get mapKey(){ - return this.info?this.key:""} - get idleInSail(){ - return"sail"===this.mode&&!this.target&&this.speed<=1} - get rodShown(){ - return this.rodBalloonOn} - get boatSprite(){ - return this.boat} - get rodBalloonView(){ - return this.rodBalloon} - get fishing(){ - return!this.sailing&&(this.floatVisible||!!this.reel||!!this.catchTl)} - start(){ - this.running||(this.running=!0,this.lastTime=performance.now()-this.startAt,SS.app.ticker.add(this.onFrame))} - stop(){ - this.cancelHarpoon(),this.running=!1,SS.app.ticker.remove(this.onFrame)} - update(i,s,e,n,h=1/0,r){ - if(this.bite=n,this.biteIn=h,this.biteInAt=performance.now(),r&&r.boat!==this.boatLv&&(this.boatLv=r.boat,this.boat.texture=NAi.boat(this.boatLv),this.lamp.texture=NAi.gear().lanterns[t.lampGrade(this.boatLv)]),this.boat.texture===ls.EMPTY&&(this.boat.texture=NAi.boat(this.boatLv),this.lamp.texture=NAi.gear().lanterns[t.lampGrade(this.boatLv)]),r&&(r.bobber!==this.bobberLv||this.floatSp.texture===ls.EMPTY)){ - this.bobberLv=Math.min(3,r.bobber); - const t=NAi.gear(); - this.floatSp.texture=FUi(t.floats[this.bobberLv],this.bobberLv),this.floatSp.anchor.set(.5,1)} - if(s!==this.tide||0===this.tideTint.alpha){ - this.tide=s; - const t=nFi[s]; - this.tideTint.tint=t.color,this.tideTint.alpha=t.alpha; - const i=eFi[s]; - this.sun.tint=i.color,this.sun.alpha=i.alpha} - const o=`${ - i.race} - |${ - i.zone} - `; - o!==this.key?(this.key=o,this.loadMap(i)):this.fogRun!==tOi.runId()&&this.fogBits?(this.fogRun=tOi.runId(),this.initFog(),this.foundMask=tOi.found(this.key),this.updateFog(!0)):i.point===this.point?this.pointSyncUntil=0:!this.target&&performance.now()>this.pointSyncUntil&&(this.point=i.point,this.teleport(i.point)),this.running||this.drawMotion(e)} - async loadMap(t){ - this.cancelHarpoon(),this.race=t.race,this.zone=t.zone,this.point=t.point,this.otherCandidates=[],this.otherPickAt=0; - for(const i of this.others.values())this.dropOtherBoat(i); - this.others.clear(),this.info=NAi.topdownInfo(this.key),this.foundMask=tOi.found(this.key),this.zoneNow=-1,this.clearGiants(),this.birds.reset(t.zone); - { - const i=QUi[t.zone].first; - this.nextGiantAt=performance.now()+1e3*(i[0]+Math.random()*(i[1]-i[0]))} - if(this.school.clear(),this.nextSchoolAt=performance.now()+1e3*gGi(!0,Math.random),this.nav=null,this.route=[],this.clearChunks(),this.clearTiles(),"tile"===this.info.type){ - this.landBits=null,this.verts=Uint8Array.from(atob(this.info.verts),t=>t.charCodeAt(0)),this.buildWater(); - const t=this.info,i=await NAi.terrain(t.terrain); - if(this.info!==t)return; - this.terr=i,this.buildShore(),this.placeNpcShips(),this.hubSig="",this.hubPlaces.clear(),this.initFog()} - else this.verts=null,this.landBits=Uint8Array.from(atob(this.info.land),t=>t.charCodeAt(0)); - if(this.info.chunk||"tile"===this.info.type)this.mapSprite.texture=ls.EMPTY; - else{ - const t=await NAi.topdownMap(this.key); - if(this.info!==NAi.topdownInfo(`${ - this.race} - |${ - this.zone} - `))return; - this.mapSprite.texture=t} - this.drawStatic(),this.buildMinimapTexture(),this.teleport(t.point),this.spawnShadows()} - teleport(t){ - var i,s; - if(!(null==(i=this.info)?void 0:i.points[t]))return; - const e=this.startSpot(t); - this.bx=e.bx,this.by=e.by,this.target=null,this.route=[],this.speed=0,this.heading=-Math.PI/4,this.boatWater.reset(),this.foam=[],this.crowns=[],this.bobberWave=0; - for(const n of this.glintList)n.sp.visible=!1,this.glints.removeChild(n.sp),this.glintPool.push(n.sp); - this.glintList=[],this.dockAt=0,this.hideRodBalloon(),(null==(s=this.startInSail)?void 0:s.call(this))?"sail"!==this.mode?this.setMode("sail"):this.dock():("fish"!==this.mode&&this.setMode("fish"),this.cast(e.fx,e.fy,!0)),this.camX=this.bx,this.camY=this.by,this.updateFog(!0)} - startSpot(t){ - const i=this.info.points[t],s=this.labels.children.find(i=>i.label===String(t)),e=18+(s?s.width/2:60),n=18+(s?s.height/2:15),h=Qt((t,s,h)=>Math.abs(t-i.x)>e+h||Math.abs(s-i.y)>n+h,"clear"); - for(const a of[!0,!1])for(const s of a?[130,160,105,190,230,270,80]:[130,160,105,190])for(const e of[100,80,125,55,150,30,180,0,210,330,240,300,270]){ - const n=e*Math.PI/180,r=i.x+Math.cos(n)*s,o=i.y+Math.sin(n)*s; - if(!h(r,o,26)||this.isLand(r,o)||eDi.at(this.key,r,o)!==t)continue; - if(a?!this.boatCanFish(r,o):this.shoreDist(r,o)<30)continue; - const c=Math.atan2(o-i.y,r-i.x); - for(const t of[.5,-.5,0,1,-1]){ - const i=c+t,s=r+80*Math.cos(i),e=o+80*Math.sin(i); - if(h(s,e,10)&&(a?this.floatOk(s,e):!this.isLand(s,e)&&this.shoreDist(s,e)>=40))return{ - bx:r,by:o,fx:s,fy:e} - } - } - let r=i.x-70,o=i.y+40; - return this.isLand(r,o)&&(r=i.x,o=i.y+70),this.isLand(r,o)&&(r=i.x,o=i.y),{ - bx:r,by:o,fx:i.x+20,fy:i.y-10} - } - sailTo(t,i){ - var s; - if(!this.info)return!1; - const e=null==(s=this.sailBlock)?void 0:s.call(this); - if(e)return this.showHint(e,!0),!1; - !this.nav&&this.verts&&(this.nav=new rDi(this.info.w,this.info.h,(t,i)=>this.isLand(t,i))); - const n=this.nav?this.nav.find(this.bx,this.by,t,i):[{ - x:t,y:i} - ]; - return n&&n.length?(this.route=n,this.target=n[n.length-1],this.stuckFor=0,this.replanned=!1,this.dockAt=0,this.departAt=Math.max(this.departAt,performance.now()+this.reelIn()),!0):(this.showHint("그곳으로 이어진 물길이 없어요",!0),!1)} - reelIn(){ - var t; - if(this.catchTl){ - const t=this.catchTl; - this.catchTl=null,t.progress(1)} - if(this.reel=null,this.reelPull=!1,null==(t=this.castTween)||t.kill(),this.castTween=null,!this.floatVisible||this.retrieveTween)return this.floatLift=0,this.retrieveTween?200:0; - const i={ - ...this.fxp} - ,s={ - p:0} - ; - return this.splash(i.x,i.y,3,15004914),this.retrieveTween=yx.to(s,{ - p:1,duration:.24,ease:"power2.in",onUpdate:Qt(()=>{ - const t=this.rodTip; - this.fxp={ - x:i.x+(t.x-i.x)*s.p,y:i.y+(t.y-i.y)*s.p} - ,this.floatLift=12*Math.sin(s.p*Math.PI)} - ,"onUpdate"),onComplete:Qt(()=>{ - this.floatVisible=!1,this.floatLift=0,this.retrieveTween=null} - ,"onComplete")} - ),260} - sailToHub(t){ - const i=this.hubPlaces.get(t); - return!!i&&("sail"!==this.mode&&this.setMode("sail"),!!this.sailTo(i.dx,i.dy)&&(this.hideRodBalloon(),this.marker(i.dx,i.dy,16777215),!0))} - tapAt(i,s){ - if(this.info){ - if("sail"===this.mode){ - if(this.isLand(i,s))return void this.marker(i,s,16751752); - if(!this.sailTo(i,s))return; - return this.marker(i,s,16777215),t.hintSeen=!0,this.hideRodBalloon(),void this.showHint("가는 중 · 멈추면 낚싯대 풍선을 눌러 낚시 시작",!1,!0)} - yx.fromTo(this.modeBtn.scale,{ - x:1.25,y:1.25} - ,{ - x:1,y:1,duration:.45,ease:"elastic.out(1.2, 0.4)"} - ),this.showHint("배를 옮기려면 오른쪽 아래 [이동]을 눌러요",!0)} - } - buildModeButton(){ - const t=this.modeBtn; - t.addChild(this.modeBg,this.modeIcons.fish,this.modeIcons.sail,this.modeText); - for(const i of Object.values(this.modeIcons))i.position.set(12,11); - this.modeText.position.set(40,13),t.eventMode="static",t.cursor="pointer",t.hitArea=new $i(0,0,96,44),t.pivot.set(48,22),t.on("pointertap",t=>{ - t.stopPropagation(),"fish"!==this.mode?this.fixingNow?this.showHint("배를 다 고친 뒤에 낚시해요",!0):this.target?this.showHint("멈추면 머리 위 낚싯대 풍선을 눌러 낚시 시작",!0):(this.dockAt=0,this.showRodBalloon()):this.setMode("sail")} - )} - setMode(t){ - var i; - const s=t!==this.mode; - this.mode=t; - const e="sail"===t; - this.modeBg.clear().roundRect(0,0,96,44,12).fill(e?6012341:Dxi),this.modeIcons.fish.visible=!1,this.modeIcons.sail.visible=!0; - for(const n of Object.values(this.modeIcons))n.tint=Gxi; - this.modeText.text=e?"이동 중":"이동",e?(this.departAt=Math.max(this.departAt,performance.now()+this.reelIn()),this.showHint("가고 싶은 곳을 누르세요",!1),this.target||this.dock()):(this.hideRodBalloon(),this.dockAt=0,this.showHint("느낌표(!)가 뜨면 눌러요 · 그냥 두면 입질 두 번에 한 마리",!1)),s&&(null==(i=this.onModeChange)||i.call(this,e))} - showHint(i,s,e=!1){ - var n; - if(this.tut)return void(this.hint.visible=!1); - if(!e&&!s&&t.hintSeen&&"fish"===this.mode)return void(this.hint.visible=!1); - this.hint.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const h=dRi(i,16777215,Vxi,12,9); - h.alpha=.9,this.hint.addChild(h),this.hint.position.set((this.viewW-h.width)/2,this.viewH-h.height-12),this.hint.visible=!0,this.hint.alpha=1,null==(n=this.hintTween)||n.kill(),s&&(this.hintTween=yx.timeline().to(this.hint,{ - alpha:0,duration:.4,delay:1.8} - ))} - marker(t,i,s){ - this.ripples.push({ - x:t,y:i,age:0,life:.6,r0:4,r1:18,alpha:.8} - ),16777215!==s&&this.ripples.push({ - x:t,y:i,age:0,life:.4,r0:2,r1:10,alpha:.9} - )} - cast(t,i,s,e=!0){ - var n,h,r; - if(this.fixingNow)return; - const o=Math.hypot(t-this.bx,i-this.by); - if(o>TUi&&(t=this.bx+(t-this.bx)*TUi/o,i=this.by+(i-this.by)*TUi/o),!this.floatOk(t,i))return; - if(null==(n=this.castTween)||n.kill(),this.castTween=null,null==(h=this.retrieveTween)||h.kill(),this.retrieveTween=null,this.floatLandedAt=-1/0,s)return this.fxp={ - x:t,y:i} - ,this.floatLift=0,void(this.floatVisible=!0); - const a={ - ...this.rodTip} - ,c={ - p:0} - ,l=.34+.2*Math.min(1,o/TUi),u=18+.12*Math.min(o,TUi); - e&&(null==(r=this.onCast)||r.call(this)),this.fxp={ - ...a} - ,this.floatLift=0,this.floatVisible=!0,this.busyUntil=performance.now()+1e3*l+150,this.castTween=yx.to(c,{ - p:1,duration:l,ease:"none",onUpdate:Qt(()=>{ - this.fxp={ - x:a.x+(t-a.x)*c.p,y:a.y+(i-a.y)*c.p} - ,this.floatLift=4*u*c.p*(1-c.p)} - ,"onUpdate"),onComplete:Qt(()=>{ - this.castTween=null,this.floatLift=0,this.floatLandedAt=performance.now(),this.splash(t,i,3,15004914,12),this.ripples.push({ - x:t,y:i,age:0,life:1.4,r0:3,r1:17,alpha:.35} - )} - ,"onComplete")} - )} - isLand(t,i){ - const s=this.info; - if(!s)return!1; - if(t<8||i<8||t>s.w-8||i>s.h-8)return!0; - if(this.verts){ - const e=s.tile,n=t/e,h=i/e,r=Math.floor(n),o=Math.floor(h),a=n-r,c=h-o; - return(this.vert(r,o)*(1-a)+this.vert(r+1,o)*a)*(1-c)+(this.vert(r,o+1)*(1-a)+this.vert(r+1,o+1)*a)*c>.5} - const e=this.landBits; - if(!e)return!1; - const n=Math.floor(t/s.cell),h=Math.floor(i/s.cell)*s.cols+n; - return 1==(e[h>>3]>>(7&h)&1)} - known(t){ - var i; - const s=null==(i=this.info)?void 0:i.points[t]; - return!(!s||0!==t&&t!==this.point&&1&~(this.foundMask>>t)&&this.unexplored(s.x,s.y))} - knownSig(){ - var t; - return((null==(t=this.info)?void 0:t.points)??[]).map((t,i)=>this.known(i)?1:0).join("")} - nearestPoint(){ - return eDi.at(this.key,this.bx,this.by)} - trackZone(){ - var t; - if(!(null==(t=this.info)?void 0:t.points.length))return; - const i=this.nearestPoint(); - if(i===this.zoneNow)return; - const s=this.zoneNow<0; - this.zoneNow=i; - const e=!this.known(i); - tOi.markFound(this.key,i)&&(this.foundMask=tOi.found(this.key)),s||this.showZone(i,e)} - showZone(t,i){ - var s; - const e=this.zoneBanner; - e.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const n=Jxi(GTi(this.race,this.zone,t),16777215,20),h=`난이도 ${ - hCi({ - zone:this.zone,point:t} - )} - `,r=Jxi(i?`새 수역을 찾았어요 · ${ - h} - `:`${ - t+1} - 번 수역 · ${ - h} - `,i?Dxi:13229279,12),o=Math.max(n.width,r.width)+44,a=(new ep).roundRect(0,0,o,58,12).fill({ - color:Vxi,alpha:.78} - ); - n.position.set((o-n.width)/2,9),r.position.set((o-r.width)/2,36),e.addChild(a,n,r),e.position.set((this.viewW-o)/2,170),e.visible=!0,null==(s=this.zoneTween)||s.kill(),this.zoneTween=yx.timeline().fromTo(e,{ - alpha:0} - ,{ - alpha:1,duration:.25} - ).to(e,{ - alpha:0,duration:.5,delay:i?2.2:1.4,onComplete:Qt(()=>{ - e.visible=!1} - ,"onComplete")} - ),i&&YG("light")} - drawStatic(){ - var t; - const i=this.labels; - i.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),null==(t=this.info)||t.points.forEach((t,s)=>{ - const e=dRi(GTi(this.race,this.zone,s),16777215,Vxi,13,9); - e.alpha=.9,e.position.set(t.x-e.width/2,t.y-e.height/2),e.label=String(s),i.addChild(e)} - )} - spawnShadows(){ - this.shadowLayer.removeChildren().forEach(t=>t.destroy()),this.shadows=[],this.nibbler=null,this.nextFishAt=0} - drawMotion(t){ - var i; - const s=Math.min(.05,Math.max(0,(t-this.lastTime)/1e3)); - if(this.lastTime=t,!this.info)return; - const e=this.viewH; - if(this.target&&performance.now()>=this.departAt){ - const t=this.route.length<=1,e=this.route[0]??this.target; - !t&&Math.hypot(e.x-this.bx,e.y-this.by)<28&&this.route.shift(); - const n=this.route[0]??this.target,h=n.x-this.bx,r=n.y-this.by,o=Math.hypot(h,r),a=this.route.length<=1; - let c=Math.atan2(r,h)-this.heading; - for(; - c>Math.PI; - )c-=2*Math.PI; - for(; - c<-Math.PI; - )c+=2*Math.PI; - this.heading+=Math.max(-3.2*s,Math.min(3.2*s,c)); - const l=NUi[Math.min(NUi.length-1,this.boatLv)]*(1+this.speedBonus/100),u=Math.max(.12,Math.cos(Math.min(Math.PI/2,Math.abs(c)))),d=(a&&o<60?l*Math.max(.15,o/60):l)*u; - this.speed+=(d-this.speed)*Math.min(1,3*s); - const f=this.bx+Math.cos(this.heading)*this.speed*s,p=this.by+Math.sin(this.heading)*this.speed*s; - if(f<40||p<40||f>this.info.w-40||p>this.info.h-40)this.target=null,this.route=[],this.speed=0,this.dock(),this.showHint("R"===this.zone?"여기까지예요 · 더 나갈 수 없어요":"바다 끝이에요 · 더 나갈 수 없어요",!0); - else if(this.isLand(f,p)&&!this.isLand(this.bx,this.by)){ - if(this.speed=0,this.stuckFor+=s,this.stuckFor>1.2){ - this.stuckFor=0; - const t=!this.replanned&&(null==(i=this.nav)?void 0:i.find(this.bx,this.by,this.target.x,this.target.y)); - t?(this.route=t,this.replanned=!0):(this.target=null,this.route=[],this.dock())} - } - else this.bx=f,this.by=p,this.stuckFor=0; - this.target&&a&&o<6&&(this.target=null,this.route=[],this.dock())} - else this.speed*=Math.pow(.9,60*s); - if(this.afterFixAt&&performance.now()>=this.afterFixAt&&!this.fixingNow)if(this.afterFixAt=0,"fish"!==this.mode||this.floatVisible||this.target)"sail"!==this.mode||this.target||this.showRodBalloon(); - else{ - const t=this.castSpot(); - t&&this.cast(t.x,t.y,!1)} - this.dockAt&&performance.now()>=this.dockAt&&!this.rodHold&&(this.dockAt=0,"sail"!==this.mode||this.target||this.showRodBalloon()),this.drawRodBalloon(t),this.camX+=(this.bx-this.camX)*Math.min(1,4*s),this.camY+=(this.by-this.camY)*Math.min(1,4*s); - const n=Math.max(this.viewW/2,Math.min(this.info.w-this.viewW/2,this.camX)),h=Math.max(e/2,Math.min(this.info.h-e/2,this.camY)); - this.world.position.set(this.viewW/2-n,e/2-h); - const r=this.shakeUntil-performance.now(); - if(r>0){ - const t=this.shakeAmp*Math.min(1,r/220); - this.world.position.x+=2*(Math.random()-.5)*t,this.world.position.y+=2*(Math.random()-.5)*t} - if(this.birds.sky.position.copyFrom(this.world.position),this.worldTop.position.copyFrom(this.world.position),this.info.chunk&&this.updateChunks(n,h),this.verts&&this.updateTiles(n,h),this.drawSurface(t),this.drawGlints(s),this.shoreFoamLayer.alpha=.76+.12*Math.sin(t/2800)+.04*Math.sin(t/4700+1.3),this.fog){ - const i=hFi[this.tide]??0; - this.fog.alpha+=(i-this.fog.alpha)*Math.min(1,1.5*s),this.fog.visible=this.fog.alpha>.01,this.fog.visible&&this.fog.tilePosition.set(.85*this.world.x+t/1e3*7,.85*this.world.y+t/1e3*3)} - this.sun.position.set(.22*this.viewW+18*Math.sin(t/9e3),.12*e+10*Math.cos(t/11e3)),this.moveShadows(t,s),this.moveSchool(s,{ - x:n-this.viewW/2,y:h-e/2,w:this.viewW,h:e} - ),this.moveGiants(t,s),this.birds.update(s,{ - x:n-this.viewW/2,y:h-e/2,width:this.viewW,height:e} - ,this.zone,this.tide,(t,i)=>this.shoreDist(t,i)),this.updateFog(!1),this.trackZone(),this.drawOthers(t,s),this.drawFixing(s),this.drawNpcs(t,s),this.drawHubs(t,s),this.drawGoal(t),this.drawMinimap(t),this.tut?this.applyTutorialHud():this.modeBtn.visible=!this.modeBtnHidden; - const o=(1-(this.glide.ms?Math.min(1,(performance.now()-this.glide.at)/this.glide.ms):1))**3,a=this.hullPose=$Di(this.bx+this.glide.dx*o,this.by+this.glide.dy*o,this.heading,t/1e3,this.zone,this.boatLv,this.speed),c=performance.now()<this.rockUntil?.07*Math.sin(t/110)*((this.rockUntil-performance.now())/1800):0,l=this.waveKick; - this.boat.position.set(a.x+l.dx,a.y+l.dy),this.boat.rotation=a.rotation+c+l.rot,this.boat.skew.set(a.skew,0),this.boat.scale.set(PUi*a.scaleX,PUi*a.scaleY); - const u=FDi(this.boatLv); - if(this.boatShadow.clear().ellipse(0,0,.95*u.halfWidth,.86*u.halfLength).fill({ - color:401450,alpha:.19-.012*a.height} - ),this.boatShadow.position.set(a.waterX+1.5+l.dx,a.waterY+2+l.dy),this.boatShadow.rotation=this.boat.rotation,this.boatWater.update(s,{ - x:a.waterX,y:a.waterY,heading:this.boat.rotation-Math.PI/2,speed:this.speed,level:this.boatLv,zone:this.zone,time:t/1e3,velocity:a.velocity,roll:a.roll,pitch:a.pitch,rollVelocity:a.rollVelocity,pitchVelocity:a.pitchVelocity} - ,NAi.foam(),(t,i)=>!this.isLand(t,i)),this.drawFoam(t,s),this.drawCrew(t,s),this.harpoonFxs.length){ - for(const t of this.harpoonFxs)t.advance(s); - this.harpoonFxs=this.harpoonFxs.filter(t=>!t.destroyed)} - let d=0; - const f=this.biteIn-(performance.now()-this.biteInAt); - IUi.forEach((t,i)=>{ - const s=(f-t)/110; - d+=Math.exp(-s*s),f<=t&&this.nibbleSeen<i&&this.floatVisible&&(this.nibbleSeen=i,this.ripples.push({ - x:this.fxp.x,y:this.fxp.y,age:0,life:.8,r0:3,r1:12,alpha:.5} - ))} - ),f>IUi[0]+500&&(this.nibbleSeen=-1),this.moveNibbler(s,f),(this.floatVisible&&!this.retrieveTween&&Math.hypot(this.fxp.x-this.bx,this.fxp.y-this.by)>245||this.reel&&Math.hypot(this.reel.x-this.bx,this.reel.y-this.by)>285)&&(this.floatVisible=!1,this.reel&&this.reelIn()); - const p=this.line.clear(),w=this.float.clear(); - if(this.reel){ - const i=this.rodTip.x,s=this.rodTip.y,e=this.reelPull?.8*Math.sin(t/28):5,n=(i+this.reel.x)/2,h=(s+this.reel.y)/2+e; - p.moveTo(i,s).quadraticCurveTo(n,h,this.reel.x,this.reel.y).stroke({ - color:16053480,width:this.reelPull?.7:.55,alpha:.7} - )} - if(this.floatVisible){ - const i=!!this.castTween||!!this.retrieveTween,e=UDi(this.fxp.x,this.fxp.y,t/1e3,this.zone,(performance.now()-this.floatLandedAt)/1e3),n=i?this.fxp.x:e.x,h=i?this.fxp.y-this.floatLift:e.y,r=this.bite?.55+.2*Math.sin(t/70):.3*d,o=this.rodTip.x,a=this.rodTip.y,c=this.floatSp,l=NAi.gear(),u=i?l.floats[this.bobberLv]:FUi(l.floats[this.bobberLv],this.bobberLv); - c.texture!==u&&(c.texture=u,c.anchor.set(.5,i?BUi[this.bobberLv]??.55:1)),c.visible=!0,c.position.set(n+(this.bite?.8*Math.sin(t/45):0),h+3*r),c.rotation=i?0:e.rotation,c.scale.set(GUi,GUi*(1-.5*r)),c.alpha=1-.25*r; - const f=-2.4*(1-.5*r),g=c.x-Math.sin(c.rotation)*f,m=c.y+Math.cos(c.rotation)*f; - p.moveTo(o,a).quadraticCurveTo((o+g)/2,(a+m)/2+8,g,m).stroke({ - color:16053480,width:.5,alpha:.56} - ),w.ellipse(n,h+.5,4.5+3*r,1.8+r).stroke({ - color:14808302,width:.6,alpha:i?0:this.bite?.5:.2} - ),!this.bite&&!i&&this.bobberWave<=0&&e.height>0&&this.ripples.push({ - x:n,y:h,age:0,life:2.4,r0:4,r1:15,alpha:.18} - ),this.bobberWave=e.height,this.bite&&Math.random()<8*s&&this.ripples.push({ - x:this.fxp.x,y:this.fxp.y,age:0,life:.6,r0:5,r1:16,alpha:.6} - )} - else this.floatSp.visible=!1; - this.waveStep(s); - const g=this.fx.clear(),m=this.fxAdd.clear(); - for(const v of this.ripples){ - v.age+=s; - const t=v.age/v.life; - t<1&&g.ellipse(v.x,v.y,v.r0+(v.r1-v.r0)*t,.75*(v.r0+(v.r1-v.r0)*t)).stroke({ - color:16777215,width:1.3,alpha:(1-t)*v.alpha} - )} - this.ripples=this.ripples.filter(t=>t.age<t.life); - for(const v of this.particles){ - v.age+=s,v.vz-=260*s,v.z=Math.max(0,v.z+v.vz*s),v.x+=v.vx*s,v.y+=v.vy*s; - const t=1-v.age/v.life; - t>0&&m.circle(v.x,v.y-v.z,v.size).fill({ - color:v.color,alpha:.8*t} - )} - this.particles=this.particles.filter(t=>t.age<t.life),this.drawLights(t,s); - for(const v of this.labels.children){ - const t=Number(v.label),i=this.info.points[t],s=Math.hypot(i.x-this.bx,i.y-this.by); - v.alpha=t===this.point?1:Math.max(.3,Math.min(.85,1.25-s/900)),v.visible=this.known(t)} - } - mapReadyFor(t){ - return!(this.key!==t||!this.info||"tile"===this.info.type&&!this.terr)} - glideIn(t,i=70,s=600){ - this.glide={ - dx:-Math.cos(t)*i,dy:-Math.sin(t)*i,at:performance.now(),ms:s} - ,this.heading=t} - initFog(){ - var t; - const i=this.info; - this.fogRun=tOi.runId(),this.fogStore=tOi.storeKey(this.key,i.verts),this.fogBits=tOi.bits(this.fogStore,i.cols*i.rows),this.fogCanvas&&this.fogCanvas.width===i.cols&&this.fogCanvas.height===i.rows||(this.fogCanvas=document.createElement("canvas"),this.fogCanvas.width=i.cols,this.fogCanvas.height=i.rows,null==(t=this.fogTex)||t.destroy(!0),this.fogTex=ls.from(this.fogCanvas),this.fogTex.source.scaleMode="linear"),this.fogOfWar.texture=this.fogTex,this.fogOfWar.eventMode="none",this.fogOfWar.position.set(0,0),this.fogOfWar.width=i.cols*i.tile,this.fogOfWar.height=i.rows*i.tile,this.fogCell=-1} - unexplored(t,i){ - const s=this.info,e=this.fogBits; - if(!s||!e||!s.tile)return!1; - const n=Math.floor(t/s.tile),h=Math.floor(i/s.tile); - return n<0||h<0||n>=s.cols||h>=s.rows||!tOi.has(e,h*s.cols+n)} - updateFog(t){ - const i=this.info,s=this.fogBits,e=this.fogCanvas; - if(!(i&&s&&e&&i.tile))return; - const n=i.tile,h=i.cols,r=i.rows,o=Math.min(h-1,Math.max(0,Math.floor(this.bx/n))),a=Math.min(r-1,Math.max(0,Math.floor(this.by/n))),c=a*h+o; - if(c===this.fogCell&&!t)return; - const l=this.fogCell; - this.fogCell=c; - const u=Math.ceil(380/n)+2; - let d=!1; - for(let b=Math.max(0,a-u); - b<=Math.min(r-1,a+u); - b++)for(let t=Math.max(0,o-u); - t<=Math.min(h-1,o+u); - t++)Math.hypot((t+.5)*n-this.bx,(b+.5)*n-this.by)<=380&&!tOi.has(s,b*h+t)&&(tOi.set(s,b*h+t),d=!0); - d&&tOi.markDirty(this.fogStore); - let f=0,p=h-1,w=0,g=r-1; - if(!t&&l>=0){ - const t=l%h,i=Math.floor(l/h); - f=Math.max(0,Math.min(o,t)-u),p=Math.min(h-1,Math.max(o,t)+u),w=Math.max(0,Math.min(a,i)-u),g=Math.min(r-1,Math.max(a,i)+u)} - const m=e.getContext("2d"),v=p-f+1,_=g-w+1,M=m.createImageData(v,_); - for(let b=w; - b<=g; - b++)for(let t=f; - t<=p; - t++){ - const i=4*((b-w)*v+(t-f)); - let e=.93; - if(tOi.has(s,b*h+t)){ - const i=Math.hypot((t+.5)*n-this.bx,(b+.5)*n-this.by); - e=.42*(1-Math.min(1,Math.max(0,(380-i)/(1.5*n))))} - M.data[i]=LUi[0],M.data[i+1]=LUi[1],M.data[i+2]=LUi[2],M.data[i+3]=Math.round(255*e)} - m.putImageData(M,f,w),this.fogTex.source.update(),(t||d)&&this.paintMapFog(t?null:[f,w,p,g])} - paintMapFog(t){ - var i; - const s=this.info,e=this.fogBits; - if(!s||!e||!s.tile)return; - const n=s.cols,h=s.rows; - this.mapFogCanvas&&this.mapFogCanvas.width===n&&this.mapFogCanvas.height===h||(this.mapFogCanvas=document.createElement("canvas"),this.mapFogCanvas.width=n,this.mapFogCanvas.height=h,null==(i=this.mapFogTex)||i.destroy(!0),this.mapFogTex=ls.from(this.mapFogCanvas),this.mapFogTex.source.scaleMode="linear",t=null); - const[r,o,a,c]=t??[0,0,n-1,h-1],l=this.mapFogCanvas.getContext("2d"),u=a-r+1,d=c-o+1,f=l.createImageData(u,d),p=Math.round(209.1); - for(let w=o; - w<=c; - w++)for(let t=r; - t<=a; - t++){ - const i=4*((w-o)*u+(t-r)); - f.data[i]=LUi[0],f.data[i+1]=LUi[1],f.data[i+2]=LUi[2],f.data[i+3]=tOi.has(e,w*n+t)?0:p} - l.putImageData(f,r,o),this.mapFogTex.source.update(),this.miniFog.texture!==this.mapFogTex&&(this.miniFog.texture=this.mapFogTex,this.bigFog.texture=this.mapFogTex)} - placeMapFog(t,i){ - const s=this.info; - if(!this.mapFogTex&&this.fogBits&&this.paintMapFog(null),t.visible=!!this.mapFogTex&&!!s.tile,!t.visible)return; - t.texture=this.mapFogTex; - const e=i.width/s.w; - t.position.set(i.x,i.y),t.width=s.cols*s.tile*e,t.height=s.rows*s.tile*e} - myAnglerTex(){ - var t; - const i=null==(t=ixi.getInstance().state)?void 0:t.look; - if(i!==this.myLookRaw){ - this.myLookRaw=i; - const t=ixi.getInstance().look; - this.myTop=t?vPi(t):null} - return this.myTop} - static otherAnglerTex(t){ - const i=kIi(t); - return i?mPi(i,0,!0):null} - static lampGrade(t){ - return Math.min(2,Math.floor(NAi.boatArt(t)/2))} - drawCrew(i,s){ - var e; - const n=NAi.gear(),h=this.boat.rotation,r=this.boat.scale.x,o=this.boat.scale.y,a=Math.cos(h),c=Math.sin(h),l=n.info.boats[NAi.boatArt(this.boatLv)],u=Qt((t,i)=>({ - x:this.boat.x+t*a*r-i*Math.sin(h-this.boat.skew.x)*o,y:this.boat.y+t*c*r+i*Math.cos(h-this.boat.skew.x)*o} - ),"local"),d=u(l.seat[0],l.seat[1]),f=this.reel??(this.floatVisible&&!this.sailing?this.fxp:null),p=f?Math.atan2(f.y-d.y,f.x-d.x)+Math.PI/2:h; - this.anglerRot+=lFi(p,this.anglerRot)*Math.min(1,6*s); - const w=(this.reel?this.reelPull:this.bite)?1:0,g=n.info.angler[w],m=this.repairFx.myCrew,v=(null==m?void 0:m.crop)??0,_=(null==m?void 0:m.lean)??0,M=this.angler,b=LLi((null==(e=this.myAnglerTex())?void 0:e[w])??n.angler[w],v); - M.texture!==b&&(M.texture=b,M.anchor.set((128+g.body[0])/256,DLi(128+g.body[1],v))),M.position.set(d.x+Math.sin(this.anglerRot)*_,d.y-Math.cos(this.anglerRot)*_),M.rotation=this.anglerRot,M.scale.set(DUi); - const y=(g.tip[0]-g.body[0])*DUi,E=(g.tip[1]-g.body[1])*DUi,A=Math.cos(this.anglerRot),S=Math.sin(this.anglerRot); - this.rodTip={ - x:d.x+y*A-E*S,y:d.y+y*S+E*A} - ; - const T=u(l.lantern[0],l.lantern[1]); - this.lamp.position.set(T.x,T.y),this.lamp.rotation=h-.7*this.hullPose.roll+.014*Math.sin(i/2200),this.lamp.scale.set(.2); - const C=n.info.lanterns[t.lampGrade(this.boatLv)].glass,O=Math.cos(this.lamp.rotation),I=Math.sin(this.lamp.rotation); - this.lampAt={ - x:T.x+.2*(C[0]*O-C[1]*I),y:T.y+.2*(C[0]*I+C[1]*O)} - ,this.syncMyDeco(); - for(const[t,k,x,R,P]of[[this.prowSp,"prow",this.myDeco.prow,l.bow,RUi],[this.sailSp,"sail",this.myDeco.sail,l.sail,.5]]){ - const i=R?NAi.boatDeco(k,x):null; - if(t.visible=!!i,!i||!R)continue; - t.texture!==i&&(t.texture=i,t.anchor.set(.5,P)); - const s=u(R[0],R[1]); - t.position.set(s.x,s.y),t.rotation=h,t.scale.set(r/3,o/3)} - } - syncMyDeco(){ - var t; - const i=null==(t=ixi.getInstance().state)?void 0:t.gearBox,s=(null==i?void 0:i.equipped)??{ - } - ,e=`${ - s.prow} - |${ - s.sail} - |${ - s.lantern} - `; - e!==this.myDecoKey&&(this.myDecoKey=e,this.myDeco=PSi(RSi({ - gearBox:i} - )),this.myColor=this.myDeco.lantern>=0?NSi[this.myDeco.lantern]:this.baseColor)} - static dressBoat(t,i,s){ - const e=NAi.gear().info.boats[NAi.boatArt(i)],n=PSi(s); - for(const[h,r,o,a,c]of[[t.prow,"prow",n.prow,e.bow,RUi],[t.sail,"sail",n.sail,e.sail,.5]]){ - const t=a?NAi.boatDeco(r,o):null; - h.visible=!!t,t&&a&&(h.texture=t,h.anchor.set(.5,c),h.position.set(a[0],a[1]),h.scale.set(1/3))} - } - drawLights(t,i){ - this.lightUsed=0; - const s=[],e=$Ui[this.tide]??0; - if(e>0){ - const i=3===this.tide,n=this.world.x,h=this.world.y,r=Qt(i=>.97+.02*Math.sin(t/2400+i)+.01*Math.sin(t/1100+1.7*i),"flick"),o=Qt((t,o,a,c,l,u,d=0)=>{ - const f=r(u),p=1/(1+.45*d); - this.glow(n+t,h+o,c*(i?1.25:1)*(.7+.3*p),a,l*(i?.45:1)*f*p),this.glow(n+t,h+o,.16*c,a,.9*e*f*(.5+.5*p)),this.glow(n+t,h+o,5,16777215,.75*e*(.4+.6*p)),s.push({ - x:t,y:o,color:a,seed:u,strength:f*p} - )} - ,"lamp"); - if(this.floatSp.visible){ - const t=2===this.bobberLv; - this.glow(n+this.floatSp.x,h+this.floatSp.y-8,t?46:26,t?16769658:this.myColor,(t?.8:.55)*e)} - const a=NAi.gear(),c=[{ - x:this.lampAt.x,y:this.lampAt.y,color:this.myColor,seed:0,me:!0} - ]; - for(const t of this.others.values()){ - if(!t.sp.visible)continue; - const i=a.info.boats[NAi.boatArt(t.a.b)],s=t.sp.scale.x,e=t.sp.scale.y,r=t.sp.rotation,o=t.sp.skew.x,l=t.px+i.lantern[0]*Math.cos(r)*s-i.lantern[1]*Math.sin(r-o)*e,u=t.py+i.lantern[0]*Math.sin(r)*s+i.lantern[1]*Math.cos(r-o)*e,d=n+l,f=h+u; - if(d<-80||f<-80||d>this.viewW+80||f>this.viewH+80)continue; - const p=WUi(t.a.id),w=PSi(t.a.dk).lantern; - c.push({ - x:l,y:u,color:w>=0?NSi[w]:HUi[p%HUi.length],seed:p%100,me:!1,a:t.alpha/aFi} - )} - for(const t of this.npcs)t.ship.visible&&c.push({ - x:t.x-9,y:t.y+20,color:16761962,seed:50+10*t.phase,me:!1} - ); - for(const t of c){ - let i=0; - for(const s of c)s!==t&&Math.abs(s.x-t.x)<70&&Math.abs(s.y-t.y)<70&&i++; - t.me?o(t.x,t.y,t.color,150,.3*e,0,.5*i):o(t.x,t.y,t.color,110,.24*e*(t.a??1),t.seed,i)} - } - this.waterLight.update(i,t/1e3,{ - x:-this.world.x,y:-this.world.y,width:this.viewW,height:this.viewH} - ,this.zone,this.tide,s,(t,i)=>!this.isLand(t,i)); - for(let n=this.lightUsed; - n<this.lightPool.length; - n++)this.lightPool[n].visible=!1} - glow(i,s,e,n,h){ - let r=this.lightPool[this.lightUsed]; - r||(r=new Xe(t.lightTextures()[0]),r.anchor.set(.5),r.blendMode="add",r.eventMode="none",this.lightPool.push(r),this.lightLayer.addChild(r)),r.visible=!0,r.position.set(i,s),r.width=r.height=e,r.tint=n,r.alpha=Math.min(1,h),this.lightUsed++} - drawFoam(t,i){ - const s=NAi.foam(); - this.foamUsed=0; - for(const e of this.foam){ - e.age+=i,e.x+=e.vx*i,e.y+=e.vy*i,e.rot+=e.spin*i; - const t=Math.max(0,1-2*i); - e.vx*=t,e.vy*=t; - const n=e.age/e.life; - n<1&&this.foamSprite(s.puffs[e.t],e.x,e.y,2.8*e.r*(1+.6*n),e.rot,e.alpha*(1-n*n))} - this.foam=this.foam.filter(t=>t.age<t.life); - for(const e of this.crowns){ - e.age+=i; - const t=Math.min(1,e.age/e.life),n=1-(1-t)*(1-t); - this.foamSprite(s.crowns[e.t],e.x,e.y,e.size*(.5+.65*n),e.rot,1-t*t)} - if(this.crowns=this.crowns.filter(t=>t.age<t.life),this.reel){ - const i=this.reel,e=Math.floor(t/85)%4; - this.foamSprite(s.churn[e],i.x,i.y,(20+5*i.level)*(1+.06*Math.sin(t/70)),t/900,.95)} - for(let e=this.foamUsed; - e<this.foamPool.length; - e++)this.foamPool[e].visible=!1} - addFoam(t,i,s,e,n,h=0,r=0){ - this.foam.push({ - x:t,y:i,vx:h,vy:r,age:0,life:e,r:s,alpha:n,t:Math.floor(8*Math.random()),rot:Math.random()*Math.PI*2,spin:1.2*(Math.random()-.5)} - )} - foamSprite(t,i,s,e,n,h){ - let r=this.foamPool[this.foamUsed]; - r||(r=new Xe(t),r.anchor.set(.5),r.eventMode="none",this.foamPool.push(r),this.foamLayer.addChild(r)),r.texture=t,r.visible=!0,r.position.set(i,s),r.rotation=n,r.alpha=h,r.width=r.height=e,this.foamUsed++} - drawGlints(t){ - const i=NAi.gear().glints; - if(!i||i.length<12)return; - const s=2===this.tide,e=Math.round(18*iFi[this.tide]*(this.viewW*this.viewH)/48e4); - if(this.glintList.length<e&&Math.random()<t*e*.7){ - let t=null,e=-1; - for(let i=0; - i<3; - i++){ - const i=Math.random()*this.viewW,n=Math.random()*this.viewH,h=-this.world.x+i,r=-this.world.y+n; - if(this.isLand(h,r))continue; - const o=Math.hypot(i-this.sun.x,n-this.sun.y)/this.viewW,a=(s?1:.35+Math.exp(-o*o*3))*Math.random(); - a>e&&(e=a,t={ - x:h,y:r} - )} - if(t){ - const e=1+(Math.random()<.55?1:0)+(Math.random()<.25?1:0); - for(let n=0; - n<e; - n++){ - const e=Math.random()*Math.PI*2,h=n?6+16*Math.random():0,r=t.x+Math.cos(e)*h,o=t.y+Math.sin(e)*h*.7; - if(n&&this.isLand(r,o))continue; - const a=s?Math.random()<.7:Math.random()<.3,c=this.glintPool.pop()??new Xe; - c.anchor.set(.5),c.blendMode="add",c.tint=sFi[this.tide]??16777215,c.visible=!1,c.rotation=0,c.texture=i[a?8:0],this.glints.addChild(c),this.glintList.push({ - sp:c,x:r,y:o,dot:a,age:-n*(.08+.14*Math.random()),life:a?.45+.35*Math.random():.5+.35*Math.random(),s:(a?.5+.15*Math.random():.4+.15*Math.random())*(s?.85:1)} - )} - } - } - for(const n of this.glintList){ - n.age+=t; - const e=n.sp; - if(n.age<0){ - e.visible=!1; - continue} - const h=Math.min(.999,n.age/n.life); - e.visible=!0,e.texture=n.dot?i[8+Math.floor(4*h)]:i[Math.floor(8*h)],e.position.set(n.x+2.5*n.age,n.y),e.scale.set(n.s),e.alpha=s?.25*Math.sin(h*Math.PI):.95} - for(const n of this.glintList)n.age>=n.life&&(n.sp.visible=!1,this.glints.removeChild(n.sp),this.glintPool.push(n.sp)); - this.glintList=this.glintList.filter(t=>t.age<t.life)} - static lightTextures(){ - if(this.lightTex)return this.lightTex; - const t=Qt(t=>{ - const i=document.createElement("canvas"); - i.width=i.height=256,t(i.getContext("2d")); - const s=ls.from(i); - return s.source.scaleMode="linear",s} - ,"mk"),i=t(t=>{ - const i=t.createRadialGradient(128,128,0,128,128,128); - i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(.35,"rgba(255,255,255,0.42)"),i.addColorStop(1,"rgba(255,255,255,0)"),t.fillStyle=i,t.fillRect(0,0,256,256)} - ),s=t(t=>{ - const i=t.createRadialGradient(128,128,80,128,128,182); - i.addColorStop(0,"rgba(2,12,20,0)"),i.addColorStop(1,"rgba(2,12,20,0.42)"),t.fillStyle=i,t.fillRect(0,0,256,256)} - ); - return this.lightTex=[i,s]} - shoreDist(t,i){ - const s=this.info,e=this.landDist; - if(!(null==s?void 0:s.tile)||!e)return 1e6; - const n=s.tile,h=s.cols+1,r=s.rows+1,o=t/n,a=i/n,c=Math.max(0,Math.min(h-2,Math.floor(o))),l=Math.max(0,Math.min(r-2,Math.floor(a))),u=Math.min(1,Math.max(0,o-c)),d=Math.min(1,Math.max(0,a-l)),f=Qt((t,i)=>Math.min(e[i*h+t],1e4),"at"); - return((f(c,l)*(1-u)+f(c+1,l)*u)*(1-d)+(f(c,l+1)*(1-u)+f(c+1,l+1)*u)*d)*n} - clearGiants(){ - for(const i of this.giants)t.destroyGiant(i); - this.giants=[]} - static destroyGiant(t){ - var i,s,e; - null==(i=t.defeat)||i.done(),t.view.destroy(),t.src.destroy({ - children:!0} - ),t.rt.destroy(!0),null==(s=t.blur)||s.destroy(),null==(e=t.glow)||e.destroy()} - devWhaleSheet(){ - if(this.devWhaleBox)return this.devWhaleBox.destroy({ - children:!0} - ),this.devWhaleBox=null,"off"; - const t=NAi.giantSpine.whale; - if(!t)return"no spine"; - const i=new Ke; - return i.addChild((new ep).rect(0,0,this.viewW,this.viewH).fill(13624298)),[[0,0],[8,1],[-8,2],[0,3]].forEach(([s,e],n)=>{ - const h=s0.from({ - skeleton:t.skeleton,atlas:t.atlas,autoUpdate:!1} - ),r=xDi(h); - h.beforeUpdateWorldTransforms=()=>r(tFi.map((t,i)=>i<3?0:s),e*Math.PI/2,.8,0),h.update(e),h.tint=666170,h.scale.set(.95),h.position.set(.72*this.viewW,90+n*this.viewH*.24); - const o=Jxi(`휨 ${ - s} - ° · ${ - e} - 초`,1056816,12); - o.position.set(10,20+n*this.viewH*.24),i.addChild(h,o)} - ),this.addChild(i),this.devWhaleBox=i,"on"} - devGiant(t){ - this.giants.length?this.showHint("지나가는 그림자가 떠난 뒤 다시 불러주세요",!0):this.spawnGiant(!0,t)||this.showHint("이 생물이 지나갈 만큼 넓고 깊은 수역이 필요해요",!0)} - spawnGiant(t=Math.random()<QUi[this.zone].under,i){ - if(!this.info||!this.landDist||this.giants.length>=1)return!1; - const s=QUi[this.zone]; - if(i&&!s.kinds.some(([t])=>t===i))return!1; - let e=Math.random(),n=s.kinds[0][0]; - for(const[p,w]of s.kinds)if((e-=w)<=0){ - n=p; - break} - i&&(n=i); - const h=JUi[n],r=h.L*s.scale,o=h.need*s.scale,a=Math.hypot(this.viewW,this.viewH)/2,c=-this.world.x+this.viewW/2,l=-this.world.y+this.viewH/2,u=t?this.bx:c+(Math.random()-.5)*this.viewW*.6,d=t?this.by:l+(Math.random()-.5)*this.viewH*.6; - if(this.shoreDist(u,d)<.7*o)return!1; - const f=Math.random()*Math.PI*2; - for(let p=0; - p<24; - p++){ - const i=f+p*(2*Math.PI/24),s=.8*a+.3*r,e=u+Math.cos(i)*s,c=d+Math.sin(i)*s; - if(this.shoreDist(e,c)<o)continue; - let l=!0; - for(let t=.25; - t<=.75&&l; - t+=.25)this.shoreDist(e+(u-e)*t,c+(d-c)*t)<.8*o&&(l=!1); - if(!l)continue; - const w=Math.atan2(d-c,u-e); - for(let t=.25; - t<=1&&l; - t+=.25)this.shoreDist(e-Math.cos(w)*r*t,c-Math.sin(w)*r*t)<.8*o&&(l=!1); - if(!l)continue; - const g="megalodon"===n||"whaleShark"===n||"sturgeon"===n||"turtle"===n||xBi(n),m=g?{ - sharp:ls.WHITE,deep:ls.WHITE} - :NAi.gear().giants[n],v=r/m.sharp.width; - let _,M,b=[]; - const y="whale"===n?NAi.giantSpine.whale:null; - let E,A; - y?(E=s0.from({ - skeleton:y.skeleton,atlas:y.atlas,autoUpdate:!1} - ),_=new Xe(ls.EMPTY),M=new Xe(ls.EMPTY)):xBi(n)?(A=new lUi(n),_=new Xe(ls.EMPTY),M=new Xe(ls.EMPTY)):"turtle"===n?(A=new IBi,_=new Xe(ls.EMPTY),M=new Xe(ls.EMPTY)):"shark"===n||"megalodon"===n||"whaleShark"===n||"sturgeon"===n?(A=new oGi(n),_=new Xe(ls.EMPTY),M=new Xe(ls.EMPTY)):"manta"===n||"catfish"===n||"eel"===n?(A=new kDi(n,m.sharp),_=new Xe(ls.EMPTY),M=new Xe(ls.EMPTY)):h.rope?(b=Array.from({ - length:28} - ,()=>new Ai),_=new qy({ - texture:m.deep,points:b} - ),M=new qy({ - texture:m.sharp,points:b} - )):(_=new Xe(m.deep),M=new Xe(m.sharp),_.anchor.set(.5),M.anchor.set(.5)); - const S=g?r*(xBi(n)?2.2*aUi(n):"turtle"===n?1.15:.43):Math.max(m.sharp.height,h.rope?0:m.sharp.width)*v,T=Math.ceil(.5*(1.1*r+1.15*S+40)),C=yv.create({ - width:T,height:T} - ),O=new Ke; - O.addChild(_,M),E&&O.addChild(E),A&&O.addChild(A),O.position.set(T/2,T/2),O.scale.set(.5); - const I=new Xe(C); - I.anchor.set(.5),I.scale.set(2),I.tint=400424,I.alpha=0,I.eventMode="none",this.giantLayer.addChild(I); - const k=[]; - for(let t=r+40; - t>=0; - t-=4)k.push({ - x:e-Math.cos(w)*t,y:c-Math.sin(w)*t} - ); - const x=E?new Array(tFi.length).fill(0):void 0,R={ - kind:n,src:O,rt:C,view:I,deep:_,sharp:M,pts:b,k:v,L:r,x:e,y:c,dir:w,spine:E,bend:x,rig:A,v:.85*h.speed,want:w,w:0,tgt:w,vanish:0,passX:u,passY:d,reached:!1,reachedAt:0,trail:k,seed:Math.random()*Math.PI*2,effort:.7,bank:0,cruiseDir:w,depth:1,minDepth:"megalodon"===n?.42+.12*Math.random():t?.2:.35+.25*Math.random(),age:0,life:Math.max(12,r/h.speed*.85)+5*Math.random(),leaving:!1,phase:10*Math.random(),passed:!1} - ; - if(E&&x){ - const t=xDi(E); - E.beforeUpdateWorldTransforms=()=>t(x,R.phase,R.effort,R.bank)} - return this.giants.push(R),this.giantSeen||(this.giantSeen=!0,this.showHint("…깊은 곳에서 거대한 그림자가 지나가요",!0)),!0} - return!1} - static makeGlow(i){ - if(!t.glowTex){ - const i=document.createElement("canvas"); - i.width=i.height=64; - const s=i.getContext("2d"),e=s.createRadialGradient(32,32,0,32,32,32); - e.addColorStop(0,"rgba(255,246,190,1)"),e.addColorStop(.16,"rgba(255,228,120,0.95)"),e.addColorStop(.45,"rgba(255,200,70,0.32)"),e.addColorStop(1,"rgba(255,190,60,0)"),s.fillStyle=e,s.fillRect(0,0,64,64),t.glowTex=ls.from(i)} - const s=new Xe(t.glowTex); - return s.anchor.set(.5),s.blendMode="add",s.eventMode="none",i.addChild(s),s} - static trailAt(t,i,s){ - let e=0,n=i; - for(let o=t.length-1; - o>=0; - o--){ - const i=t[o],h=Math.hypot(n.x-i.x,n.y-i.y); - if(h>0&&e+h>=s){ - const t=(s-e)/h; - return{ - x:n.x+(i.x-n.x)*t,y:n.y+(i.y-n.y)*t,a:Math.atan2(n.y-i.y,n.x-i.x)} - } - e+=h,n=i} - const h=t[0]??i,r=t[1]??i; - return{ - x:h.x,y:h.y,a:Math.atan2(r.y-h.y,r.x-h.x)} - } - static trailDir(i,s,e,n){ - const h=t.trailAt(i,s,Math.max(0,e-n)),r=t.trailAt(i,s,e+n); - return Math.atan2(h.y-r.y,h.x-r.x)} - moveGiants(i,s){ - var e; - const n=performance.now(); - if(this.info&&this.landDist&&n>=this.nextGiantAt){ - const t=0===this.giants.length&&hCi({ - zone:this.zone,point:this.point} - )>=UIi.MIN_LEVEL&&this.spawnGiant(),i=QUi[this.zone].every; - this.nextGiantAt=n+(t?1e3*(i[0]+Math.random()*(i[1]-i[0])):2e4)} - const h=Math.hypot(this.viewW,this.viewH)/2,r=-this.world.x+this.viewW/2,o=-this.world.y+this.viewH/2,a=QUi[this.zone].scale; - for(const l of this.giants){ - const i=JUi[l.kind],c=i.need*a,u=l.defeat?{ - x:l.x,y:l.y,dir:l.dir,phase:l.phase} - :null; - l.age+=s; - const d=Math.hypot(l.passX-l.x,l.passY-l.y),f=Math.atan2(l.passY-l.y,l.passX-l.x); - !l.reached&&(d<.35*l.L||l.age>6&&Math.abs(lFi(f,l.dir))>Math.PI/2||l.age>45)&&(l.reached=!0,l.reachedAt=l.age,l.cruiseDir=l.dir,l.want=l.dir),(l.reached&&l.age-l.reachedAt>l.life||l.age>90)&&(l.leaving=!0),l.want=l.reached||l.leaving?l.cruiseDir+.075*Math.sin(.12*(l.age-l.reachedAt)+l.seed):f; - const p=Math.min(i.turn,l.v/(i.rMin*l.L)),w=Math.max(110,.55*l.L,i.rMin*l.L*.7),g=[]; - let m=0; - for(let t=-7; - t<=7; - t++){ - const i=l.dir+.2*t,s=Math.min(1.5*c,this.shoreDist(l.x+Math.cos(i)*w*.45,l.y+Math.sin(i)*w*.45),this.shoreDist(l.x+Math.cos(i)*w,l.y+Math.sin(i)*w)); - g.push(s/c*1.6+1.5*Math.cos(lFi(l.want,i))-t*t*.003),g[g.length-1]>g[m]&&(m=g.length-1)} - let v=0; - if(m>0&&m<g.length-1){ - const t=g[m-1]-2*g[m]+g[m+1]; - t<0&&(v=Math.max(-.5,Math.min(.5,.5*(g[m-1]-g[m+1])/t)))} - l.tgt+=lFi(l.dir+.2*(m-7+v),l.tgt)*(1-Math.exp(1.2*-s)); - const _=l.w+(i.wn*i.wn*lFi(l.tgt,l.dir)-2*i.wn*l.w)*s,M=.5*p*s; - l.w=Math.max(-p,Math.min(p,l.w+Math.max(-M,Math.min(M,_-l.w)))),l.dir+=l.w*s,(this.shoreDist(l.x+Math.cos(l.dir)*w*.4,l.y+Math.sin(l.dir)*w*.4)<.35*c||l.age>105)&&(l.leaving=!0,l.vanish=Math.max(l.vanish,1e-4)),l.vanish>0&&(l.vanish=Math.min(1,l.vanish+s/5)),l.effort+=(cDi(l.age,l.seed)-l.effort)*(1-Math.exp(.7*-s)),l.bank+=(l.w/(p||1)-l.bank)*(1-Math.exp(.8*-s)); - const b=i.speed*(.78+.16*l.effort+.035*Math.sin(.11*l.age+l.seed))*(1-.1*Math.abs(l.bank)); - l.v+=(b-l.v)*(1-Math.exp(.35*-s)),l.x+=Math.cos(l.dir)*l.v*s,l.y+=Math.sin(l.dir)*l.v*s,l.phase+=s*(wDi(l.kind,l.v,l.L)??i.freq*Math.PI*2*(.62+.38*l.effort)),u&&this.defeatStep(l,u,s); - let y=l.trail[l.trail.length-1],E=Math.hypot(l.x-y.x,l.y-y.y); - for(; - E>=4; - )y={ - x:y.x+4*(l.x-y.x)/E,y:y.y+4*(l.y-y.y)/E} - ,l.trail.push(y),E-=4; - for(; - l.trail.length>Math.ceil((1.08*l.L+80)/4); - )l.trail.shift(); - const A=l.leaving?1:l.reached||d<.8*h?l.minDepth:.9; - l.depthV=(l.depthV??0)+((A-l.depth)*(l.leaving?.2:.3)-(l.depthV??0))*(1-Math.exp(1.5*-s)),l.depth+=l.depthV*s; - const S=t.trailAt(l.trail,l,.5*l.L),T=Math.min(1,Math.max(0,(this.shoreDist(S.x,S.y)-.3*c)/(.45*c))),C=aDi(0,4,l.age)*T*i.alpha*(1-aDi(0,1,l.vanish)),O=l.depth,I=1-O+O*O; - l.deep.alpha=O,l.sharp.alpha=1-O; - const k=(1-.45*O)*(1-aDi(.78,1,O)); - if(l.view.alpha=C*k/(l.spine||l.rig?1:I),l.view.position.set(S.x,S.y),l.flinch){ - const t=zLi((performance.now()-l.flinch.at)/1e3,l.flinch.power); - t.push||t.flash?(l.view.position.x+=l.flinch.dx*t.push,l.view.position.y+=l.flinch.dy*t.push,l.view.tint=qLi(l.flinch.base,t.flash)):(l.view.tint=l.flinch.base,l.flinch=void 0)} - const x=1+.06*(1-O); - let R=1/0; - if(l.spine&&l.bend){ - const i=tFi,e=l.L*x,n=t.trailDir(l.trail,l,.06*e,.05*e); - let h=0; - for(let s=0; - s<i.length; - s++){ - const r=(ZUi-i[s])*e,o=s+1<i.length?(ZUi-i[s+1])*e:r+.06*e,a=lFi(t.trailDir(l.trail,l,(r+o)/2,.07*e),n)*aDi(.14,.6,r/e); - if(l.bend[s]=-180*lFi(a,h)/Math.PI,h=a,s%2==0){ - const i=t.trailAt(l.trail,l,r); - R=Math.min(R,Math.hypot(i.x-this.bx,i.y-this.by))} - } - const r=l.spine,o=t.trailAt(l.trail,l,0); - r.position.set(o.x-S.x-Math.cos(n)*(1-ZUi)*e,o.y-S.y-Math.sin(n)*(1-ZUi)*e),r.rotation=n,r.scale.set(e/300),r.update(s)} - else if(l.rig&&xBi(l.kind)&&oUi(l.kind)){ - const i=l.L*x,s=oUi(l.kind),e=TDi(t.trailAt(l.trail,l,0),t.trailDir(l.trail,l,.15*i,.12*i),s=>t.trailDir(l.trail,l,s,.07*i),i,s.nose,s.tail); - l.rig.pose(i,l.phase,l.effort,l.bank,t=>{ - const i=CDi(e,t); - return{ - x:i.x-S.x,y:i.y-S.y,a:i.a} - } - ); - for(let t=1; - t<=4; - t++){ - const s=CDi(e,i*t/5); - R=Math.min(R,Math.hypot(s.x-this.bx,s.y-this.by))} - } - else if(l.rig){ - const i=l.L*x,s=t.trailDir(l.trail,l,.18*i,.13*i),e=t.trailAt(l.trail,l,.2*i); - l.rig.pose(i,l.phase,l.effort,l.bank,n=>{ - const h=t.trailAt(l.trail,l,n),r=gDi(l.kind,n/i),o=e.x-Math.cos(s)*(n-.2*i),a=e.y-Math.sin(s)*(n-.2*i); - return{ - x:o+(h.x-o)*r-S.x,y:a+(h.y-a)*r-S.y,a:s+lFi(t.trailDir(l.trail,l,n,.06*i),s)*r} - } - ); - for(let n=1; - n<=4; - n++){ - const s=t.trailAt(l.trail,l,i*n/5); - R=Math.min(R,Math.hypot(s.x-this.bx,s.y-this.by))} - } - else if(l.sharp instanceof qy){ - const s=l.pts.length,e=l.L*x,n=l.k*x; - for(let h=0; - h<s; - h++){ - const r=h/(s-1),o=(1-r)*e,a=Math.pow(1-r,i.tailPow),c=t.trailAt(l.trail,l,o),u=i.amp*e*a*Math.sin(l.phase-(1-r)*i.wave),d=c.x-Math.sin(c.a)*u,f=c.y+Math.cos(c.a)*u; - l.pts[h].set((d-S.x)/n,(f-S.y)/n),h%3==0&&(R=Math.min(R,Math.hypot(d-this.bx,f-this.by)))} - l.deep.scale.set(n),l.sharp.scale.set(n)} - else{ - const i=l.L/l.sharp.texture.width*x,s=l.L*x,e=t.trailAt(l.trail,l,.2*s),n=t.trailAt(l.trail,l,.746*s),h=(e.x+n.x)/2,r=(e.y+n.y)/2,o=Math.atan2(e.y-n.y,e.x-n.x); - for(const t of[l.deep,l.sharp])t.position.set(h-S.x,r-S.y),t.rotation=o,t.scale.set(i); - R=Math.hypot(h-this.bx,r-this.by)} - if(l.spine||l.rig){ - const t=.35+O*O*4; - l.blur??(l.blur=new _f({ - strength:t,quality:2} - )),l.blur.strength=t,l.view.filters||(l.view.filters=[l.blur])} - (null==(e=l.defeat)?void 0:e.pose)&&this.defeatLook(l); - const P=Math.hypot(S.x-r,S.y-o)<h+.7*l.L; - l.view.visible=P; - const N=l.rig&&"light"in l.rig?l.rig.light:null; - if(N&&!l.glow&&(l.glow=t.makeGlow(this.giantLayer)),l.glow&&(l.glow.visible=P&&!!N&&!l.defeat,N&&(l.glow.position.set(l.view.x+N.x,l.view.y+N.y),l.glow.scale.set(7*N.r/32),l.glow.alpha=Math.min(1,l.view.alpha/i.alpha)*N.flicker*(1-.5*l.depth))),P&&l.view.alpha>.002&&SS.app.renderer.render({ - container:l.src,target:l.rt,clear:!0} - ),!l.passed&&l.view.alpha>.15&&R<.14*l.L){ - l.passed=!0,this.rockUntil=n+1800,YG("whale"===l.kind||"megalodon"===l.kind?"medium":"light"); - for(let t=0; - t<6; - t++)this.addFoam(this.bx+40*(Math.random()-.5),this.by+40*(Math.random()-.5),1.2+2*Math.random(),1.2+Math.random(),.55)} - } - const c=Qt(t=>t.vanish>=1||t.leaving&&t.depth>.992||t.leaving&&Math.hypot(r-t.x,o-t.y)>h+1.2*t.L,"gone"); - for(const l of this.giants)c(l)&&t.destroyGiant(l); - this.giants=this.giants.filter(t=>!c(t))} - moveShadows(t,i){ - const s=performance.now(),e=Math.max(8,Math.min(20,Math.round(this.viewW*this.viewH/42e3))); - if(this.info&&s>=this.nextFishAt&&this.shadows.length<e){ - this.nextFishAt=s+(this.shadows.length<e/2?150:350+500*Math.random()); - for(let t=0; - t<4; - t++){ - const t=40-this.world.x+Math.random()*(this.viewW-80),i=60-this.world.y+Math.random()*(this.viewH-120); - if(Math.hypot(t-this.bx,i-this.by)<=90||this.isLand(t,i)||this.unexplored(t,i)||this.shoreDist(t,i)<60)continue; - const s=Math.random()*Math.PI*2,n=.5*(Math.random()-.5),h=14+18*Math.random(),r=4+4*Math.random(),o=Math.random()<.3?2+Math.floor(2*Math.random()):1; - for(let a=0; - a<o&&this.shadows.length<e; - a++){ - const e=a*(12+8*Math.random()),c=(a%2?1:-1)*(a?8+8*Math.random():0),l=t-Math.cos(s)*e-Math.sin(s)*c,u=i-Math.sin(s)*e+Math.cos(s)*c; - if(a&&this.isLand(l,u))continue; - const d=new oGi("fish",25); - d.tint=665137,d.alpha=0,this.shadowLayer.addChild(d),this.shadows.push({ - s:d,x:l,y:u,rot:s+.2*(Math.random()-.5),turn:n,v:h*(.92+.16*Math.random()),size:(o>1?16:18)+12*Math.random(),age:0,life:r+.6*Math.random(),phase:Math.random()*Math.PI*2,seed:Math.random()*Math.PI*2} - )} - break} - } - for(const n of this.shadows){ - n.age+=i; - const t=n.x+Math.cos(n.rot)*n.v*i,s=n.y+Math.sin(n.rot)*n.v*i,e=t+36*Math.cos(n.rot),h=s+36*Math.sin(n.rot); - this.isLand(e,h)||this.shoreDist(e,h)<40?n.rot+=2.5*i:(n.x=t,n.y=s,n.rot+=n.turn*i); - const r=n.age/n.life,o=Math.min(1,n.age/.9),a=Math.min(1,Math.max(0,(1-r)/.3)); - n.s.alpha=.32*o*a; - const c=.65+.2*Math.sin(.8*n.age+n.seed); - n.phase+=i*iGi(n.v,n.size),n.s.swim(n.size,n.phase,c,n.turn),n.s.position.set(n.x,n.y),n.s.rotation=n.rot} - for(const n of this.shadows)n.age>=n.life&&n.s.destroy(); - this.shadows=this.shadows.filter(t=>t.age<t.life)} - moveSchool(t,i){ - const s=performance.now(); - !this.school.active&&this.info&&s>=this.nextSchoolAt&&(this.giants.length?this.nextSchoolAt=s+15e3:this.nextSchoolAt=s+(this.playSchool(i)?1e3*gGi(!1,Math.random):2e4)),this.school.update(t,{ - x:this.bx,y:this.by} - ,(t,i)=>this.isLand(t,i)?0:this.seenSoft(t,i)*Math.max(0,Math.min(1,this.shoreDist(t,i)/25)),(t,i)=>this.ripples.push({ - x:t,y:i,age:0,life:.9,r0:3,r1:16,alpha:.32} - ))} - get schoolModes(){ - return QGi(this.key)} - playSchool(t,i,s){ - if(!this.info)return!1; - const e=t??{ - x:-this.world.x,y:-this.world.y,w:this.viewW,h:this.viewH} - ,n={ - x:this.bx,y:this.by} - ,h=Qt((t,i)=>!this.isLand(t,i)&&this.shoreDist(t,i)>=30,"water"),r=Qt((t,i)=>h(t,i)&&!this.unexplored(t,i),"seen"),o=s?[s]:QGi(this.key),a=JGi(s??ZGi(o,this.lastSchool,Math.random),o,this.lastSchool,e,n,h,Math.random,r); - return!!a&&(this.lastSchool=a.mode,this.school.start(i??iBi(a.mode,this.zone,Math.random),a,1e9*Math.random()|0,{ - color:tBi(Math.random),sizeK:cGi.SIZE[this.zone]} - ),!0)} - seenSoft(t,i){ - const s=this.info,e=this.fogBits; - if(!s||!e||!s.tile)return 1; - const n=t/s.tile-.5,h=i/s.tile-.5,r=Math.floor(n),o=Math.floor(h),a=n-r,c=h-o,l=Qt((t,i)=>t<0||i<0||t>=s.cols||i>=s.rows?0:tOi.has(e,i*s.cols+t)?1:0,"at"); - return(l(r,o)*(1-a)+l(r+1,o)*a)*(1-c)+(l(r,o+1)*(1-a)+l(r+1,o+1)*a)*c} - get schoolMode(){ - return this.school.mode} - spawnNibbler(){ - if(!this.floatVisible||this.sailing||this.reel||this.castTween||this.retrieveTween||performance.now()<this.busyUntil)return; - const t=this.fxp.x,i=this.fxp.y; - for(let s=0; - s<10; - s++){ - const s=Math.random()*Math.PI*2,e=80+40*Math.random(),n=t+Math.cos(s)*e,h=i+Math.sin(s)*e; - if(this.isLand(n,h)||this.isLand((n+t)/2,(h+i)/2)||Math.hypot(n-this.bx,h-this.by)<60)continue; - const r=new oGi("fish",25); - r.tint=665137,r.alpha=0,this.shadowLayer.addChild(r); - const o=Math.atan2(i-h,t-n),a=performance.now(); - return void(this.nibbler={ - s:r,sx:n,sy:h,dist:e,ang:o,wob:Math.random()<.5?-1:1,x:n,y:h,rot:o,awayRot:o,size:20+5*Math.random(),phase:Math.random()*Math.PI*2,seed:10*Math.random(),state:"come",since:a,born:a} - )} - } - nibblerTo(t){ - const i=this.nibbler; - i&&(i.state=t,i.since=performance.now(),"leave"===t&&(i.awayRot=i.rot+Math.PI+1.2*(Math.random()-.5)))} - resolveNibbler(t){ - const i=this.nibbler; - i&&"leave"!==i.state&&"merge"!==i.state&&this.nibblerTo(t&&!this.sailing&&"come"!==i.state?"merge":"leave")} - moveNibbler(t,i){ - const s=performance.now(); - if(!this.nibbler){ - const t=s+i; - return void(i<=kUi&&i>2400&&Math.abs(t-this.nibbleRolled)>1500&&(this.nibbleRolled=t,(this.tut||Math.random()<.45)&&this.spawnNibbler()))} - const e=this.nibbler,n="leave"!==e.state&&"merge"!==e.state; - (n&&(!this.floatVisible||this.sailing||this.castTween||this.retrieveTween)||("come"===e.state||"nibble"===e.state)&&i>3200)&&this.nibblerTo("leave"); - const h=Math.cos(e.ang),r=Math.sin(e.ang),o=this.fxp.x-h*(.5*e.size+2),a=this.fxp.y-r*(.5*e.size+2); - let c=e.x,l=e.y,u=e.rot,d=6,f=.45; - if("come"===e.state){ - const t=kUi-xUi,s=Math.max(0,Math.min(1,(kUi-i)/t)),n=s*s*(3-2*s),p=10*Math.sin(s*Math.PI)*e.wob; - c=e.sx+(o-e.sx)*n-r*p,l=e.sy+(a-e.sy)*n+h*p,u=e.ang-.3*Math.cos(s*Math.PI)*e.wob,d=8+e.dist/(t/1e3)*6*s*(1-s),f=.65,s>=1&&this.nibblerTo("nibble")} - else if("nibble"===e.state){ - let t=0; - for(const s of IUi){ - const e=(i-s)/110; - t+=Math.exp(-e*e)} - const n=1.2*Math.sin(s/420+e.seed); - c=o+h*(6*t-2)-r*n,l=a+r*(6*t-2)+h*n,u=e.ang,d=8+50*t,f=.5+.5*t,this.bite&&this.nibblerTo("bite")} - else if("bite"===e.state){ - const t=1.6*Math.sin(s/45); - c=o+5*h-r*t,l=a+5*r+h*t,u=e.ang+.12*Math.sin(s/60),d=45,f=1,this.bite||this.nibblerTo("wait")} - else if("wait"===e.state){ - const t=1.5*Math.sin(s/380+e.seed); - c=o-r*t,l=a+h*t,u=e.ang,s-e.since>3200&&this.nibblerTo("leave")} - else if("leave"===e.state){ - const i=(s-e.since)/1e3; - u=e.rot+(e.awayRot-e.rot)*Math.min(1,6*t),d=30+90*Math.min(1,2*i),f=1,c=e.x+Math.cos(u)*d*t,l=e.y+Math.sin(u)*d*t} - let p=.55*Math.min(1,(s-e.born)/500); - if("leave"===e.state&&(p*=Math.max(0,1-(s-e.since)/900)),"merge"===e.state&&(p*=Math.max(0,1-(s-e.since)/180)),!n&&p<=0)return e.s.destroy(),void(this.nibbler=null); - e.x=c,e.y=l,e.rot=u,e.phase+=t*iGi(d,e.size),e.s.swim(e.size,e.phase,f,0),e.s.position.set(c,l),e.s.rotation=u,e.s.alpha=p} - updateChunks(t,i){ - const s=this.info,e=s.chunk,n=this.viewH,h=this.key,r=e/2,o=Math.max(0,Math.floor((t-this.viewW/2-r)/e)),a=Math.min(s.chunkCols-1,Math.floor((t+this.viewW/2+r)/e)),c=Math.max(0,Math.floor((i-n/2-r)/e)),l=Math.min(s.chunkRows-1,Math.floor((i+n/2+r)/e)); - for(let u=c; - u<=l; - u++)for(let t=o; - t<=a; - t++){ - const i=`${ - t} - _${ - u} - `; - this.chunks.has(i)||(this.chunks.set(i,null),NAi.topdownChunk(h,t,u).then(s=>{ - if(this.key!==h||!this.chunks.has(i))return void NAi.unloadChunk(h,t,u); - const n=new Xe(s); - n.position.set(t*e,u*e),this.chunkLayer.addChild(n),this.chunks.set(i,n)} - ))} - for(const[u,d]of this.chunks){ - const[t,i]=u.split("_").map(Number); - t>=o-2&&t<=a+2&&i>=c-2&&i<=l+2||(this.chunks.delete(u),d&&(d.destroy(),NAi.unloadChunk(h,t,i)))} - } - static regionMap(t){ - const i=this.regionTex.get(t); - if(i)return i; - const s=NAi.topdownInfo(t),[e,n]=t.split("|"),h=s.cols+1,r=s.rows+1,o=Uint8Array.from(atob(s.verts),t=>t.charCodeAt(0)),a=Qt((t,i)=>{ - if(t<0||i<0||t>s.cols||i>s.rows)return 1; - const e=i*h+t; - return o[e>>3]>>(7&e)&1} - ,"vert"),c=XUi(h,r,a,e,n).canvas.getContext("2d").getImageData(0,0,h,r).data,l=NAi.terrainLand(s.terrain??"")??rFi[e].land,u=[.45*l[0]+232*.55,.45*l[1]+117.7,.45*l[2]+162*.55],d=new Float32Array(h*r); - for(let M=0; - M<r; - M++)for(let t=0; - t<h; - t++){ - let i=0; - for(let s=-1; - s<=1; - s++)for(let e=-1; - e<=1; - e++)i+=a(t+e,M+s)*(0===e&&0===s?4:0===e||0===s?2:1); - d[M*h+t]=i/16} - const f=Qt((t,i)=>d[Math.min(r-1,Math.max(0,i))*h+Math.min(h-1,Math.max(0,t))],"sv"),p=4*(h-1),w=4*(r-1),g=document.createElement("canvas"); - g.width=p,g.height=w; - const m=g.getContext("2d"),v=m.createImageData(p,w); - for(let M=0; - M<w; - M++){ - const t=M/4,i=Math.floor(t),s=t-i; - for(let e=0; - e<p; - e++){ - const t=e/4,n=Math.floor(t),o=t-n,a=(f(n,i)*(1-o)+f(n+1,i)*o)*(1-s)+(f(n,i+1)*(1-o)+f(n+1,i+1)*o)*s,d=4*(M*p+e),w=Math.min(h-1,n+1),g=Math.min(r-1,i+1),m=4*(i*h+n),_=4*(i*h+w),b=4*(g*h+n),y=4*(g*h+w),E=[0,1,2].map(t=>(c[m+t]*(1-o)+c[_+t]*o)*(1-s)+(c[b+t]*(1-o)+c[y+t]*o)*s),A=Math.min(1,Math.max(0,(a-.4)/.08)),S=Math.min(1,Math.max(0,(a-.5)/.12)); - for(let i=0; - i<3; - i++){ - const t=u[i]+(l[i]-u[i])*S; - v.data[d+i]=E[i]+(t-E[i])*A} - v.data[d+3]=255} - } - m.putImageData(v,0,0); - const _=ls.from(g); - return _.source.scaleMode="linear",this.regionTex.set(t,_),_} - static regionFog(t){ - const i=NAi.topdownInfo(t); - if(!i.verts||!i.tile)return null; - const s=tOi.bits(tOi.storeKey(t,i.verts),i.cols*i.rows),e=document.createElement("canvas"); - e.width=i.cols,e.height=i.rows; - const n=e.getContext("2d"),h=n.createImageData(i.cols,i.rows); - for(let o=0; - o<i.cols*i.rows; - o++)h.data[4*o]=LUi[0],h.data[4*o+1]=LUi[1],h.data[4*o+2]=LUi[2],h.data[4*o+3]=tOi.has(s,o)?0:Math.round(.86*255); - n.putImageData(h,0,0); - const r=ls.from(e); - return r.source.scaleMode="linear",r} - vert(t,i){ - const s=this.info,e=s.cols+1; - if(t<0||i<0||t>s.cols||i>s.rows)return 1; - const n=i*e+t; - return this.verts[n>>3]>>(7&n)&1} - tileIndex(t,i){ - return 8*this.vert(t,i)+4*this.vert(t+1,i)+2*this.vert(t+1,i+1)+this.vert(t,i+1)} - buildMinimap(){ - const t=this.miniMap; - this.miniImg.eventMode=this.miniDots.eventMode=this.miniBg.eventMode="none"; - for(const s of[this.miniMe,this.miniView,this.miniTarget,this.bigMe,this.bigTarget,this.bigOthers])s.eventMode="none"; - this.miniMe.circle(0,0,3.5).fill(Dxi).circle(0,0,1.6).fill(2825477),this.bigMe.circle(0,0,7).fill(Dxi).circle(0,0,3).fill(2825477),this.miniTarget.circle(0,0,2.4).stroke({ - color:16777215,width:1.5} - ),this.bigTarget.circle(0,0,5).stroke({ - color:16777215,width:1.5} - ),this.miniFog.eventMode=this.bigFog.eventMode=this.miniTerr.eventMode=this.bigTerr.eventMode="none",t.addChild(this.miniBg,this.miniImg,this.miniFog,this.miniTerr,this.miniDots,this.miniGoal,this.miniView,this.miniTarget,this.miniMe),t.eventMode="static",t.cursor="pointer",t.on("pointertap",t=>{ - t.stopPropagation(),this.openBigMap(!0)} - ); - const i=this.bigMap; - i.addChild(this.bigDim,this.bigImg,this.bigFog,this.bigTerr,this.bigOthers,this.bigDots,this.bigGoal,this.bigTarget,this.bigMe,this.bigLabels,this.bigClose,this.bigTip),this.bigImg.eventMode=this.bigDots.eventMode=this.bigLabels.eventMode="none",i.eventMode="static",i.visible=!1,this.bigClose.onTap=()=>this.openBigMap(!1),i.on("pointertap",t=>{ - t.stopPropagation(); - const s=i.toLocal(t.global),e=this.info; - if(!e)return; - const n=this.bigImg.width/e.w,h=(s.x-this.bigImg.x)/n,r=(s.y-this.bigImg.y)/n; - h<0||r<0||h>e.w||r>e.h?this.openBigMap(!1):this.isLand(h,r)?this.showHint("육지예요 · 물을 눌러 주세요",!0):(this.openBigMap(!1),"sail"!==this.mode&&this.setMode("sail"),this.sailTo(h,r)&&this.marker(h,r,16777215))} - )} - buildMinimapTexture(){ - var i,s; - const e=this.info; - let n; - if(null==(i=this.miniTex)||i.destroy(!0),this.miniTex=null,this.verts&&this.water){ - const t=e.cols+1,i=e.rows+1,h=document.createElement("canvas"); - h.width=t,h.height=i; - const r=h.getContext("2d"); - r.drawImage(this.water.texture.source.resource,0,0); - const o=(null==(s=this.terr)?void 0:s.land)??rFi[this.race].land; - r.fillStyle=`rgb(${ - o[0]} - ,${ - o[1]} - ,${ - o[2]} - )`; - for(let s=0; - s<i; - s++)for(let i=0; - i<t; - i++)this.vert(i,s)&&r.fillRect(i,s,1,1); - n=ls.from(h),n.source.scaleMode="linear",this.miniTex=n} - else n=this.mapSprite.texture; - const h=t.MINI/Math.max(e.w,e.h); - this.miniImg.texture=n,this.miniImg.width=e.w*h,this.miniImg.height=e.h*h,this.miniImg.position.set(4,4),this.placeMapFog(this.miniFog,this.miniImg),this.miniBg.clear().roundRect(0,0,this.miniImg.width+8,this.miniImg.height+8,8).fill({ - color:Vxi,alpha:.85} - ),this.miniMap.position.set(10,this.viewH-this.miniImg.height-18),this.miniMap.hitArea=new $i(0,0,this.miniImg.width+8,this.miniImg.height+8); - const r=this.viewH,o=Math.min((this.viewW-40)/e.w,(r-44-46-14-34-12)/e.h); - this.bigImg.texture=n,this.bigImg.width=e.w*o,this.bigImg.height=e.h*o,this.bigImg.position.set((this.viewW-this.bigImg.width)/2,44),this.placeMapFog(this.bigFog,this.bigImg),this.markSig="",this.bigLabels.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const a=ixi.getInstance().areaRows(this.race,this.zone); - e.points.forEach((t,i)=>{ - if(!this.known(i))return; - const s=a[i],e=dRi(`${ - GTi(this.race,this.zone,i)} - ${ - s.claimed||s.ready?"✓":`${ - s.have} - /${ - s.need} - `} - `,16777215,Vxi,11,6); - e.position.set(this.bigImg.x+t.x*o-e.width/2,this.bigImg.y+t.y*o-26),this.bigLabels.addChild(e)} - )} - openBigMap(t){ - this.bigMap.visible=t,this.miniMap.visible=!t,t&&(this.buildMinimapTexture(),this.bigOthersAt=0,yx.fromTo(this.bigMap,{ - alpha:0} - ,{ - alpha:1,duration:.18} - ))} - drawMapMarks(){ - const t=this.info,i=eDi.get(this.key); - for(const e of[this.miniTerr,this.bigTerr])e.visible=!!i; - i&&[[this.miniTerr,this.miniImg],[this.bigTerr,this.bigImg]].forEach(([s,e],n)=>{ - var h; - const r=(h=this.terrCanvas)[n]??(h[n]=document.createElement("canvas")); - eDi.paint(r,i,t=>this.known(t),this.point,Dxi,1===n); - let o=this.terrTex[n]; - o&&o.width===r.width&&o.height===r.height?o.source.update():(null==o||o.destroy(!0),o=this.terrTex[n]=ls.from(r),o.source.scaleMode="linear"); - const a=e.width/t.w; - s.texture=o,s.position.set(e.x,e.y),s.width=i.cols*i.tile*a,s.height=i.rows*i.tile*a} - ); - for(const[e,n,h]of[[this.miniDots,this.miniImg,!1],[this.bigDots,this.bigImg,!0]]){ - const i=n.width/t.w; - e.clear(),t.points.forEach((t,s)=>{ - this.known(s)&&e.circle(n.x+t.x*i,n.y+t.y*i,h?4.5:2).fill(s===this.point?Dxi:16777215)} - )} - for(const[e,n,h]of[[this.miniGoal,this.miniImg,!1],[this.bigGoal,this.bigImg,!0]]){ - const i=n.width/t.w; - e.clear(); - for(const t of this.goalPoints()){ - const s=n.x+t.x*i,r=n.y+t.y*i,o=h?7:3.4; - e.circle(s,r,o+(h?3:1.6)).fill({ - color:Vxi,alpha:.7} - ).circle(s,r,o).fill(Dxi),h&&e.circle(s,r,.38*o).fill(2825477)} - for(const t of this.hubs){ - const s=this.hubPlaces.get(t.id); - if(!s)continue; - const r=n.x+s.x*i,o=n.y+s.y*i,a=h?5:2.4; - e.roundRect(r-a,o-a,2*a,2*a,.4*a).fill("offer"===t.state||"ready"===t.state?16773296:14206628).stroke({ - color:3811860,width:h?1.5:1} - )} - } - const s=this.miniImg.width/t.w; - this.miniView.clear().rect(0,0,this.viewW*s,this.viewH*s).stroke({ - color:16777215,width:1,alpha:.7} - )} - drawMinimap(t){ - const i=this.info; - if(!i||this.miniImg.texture===ls.EMPTY)return; - const s=`${ - this.point} - |${ - this.knownSig()} - |${ - this.miniImg.width} - |${ - this.bigImg.width} - |${ - this.goalSig} - |${ - this.hubSig} - `; - s!==this.markSig&&(this.markSig=s,this.drawMapMarks()); - const e=.6+.4*Math.sin(t/250),n=Qt((t,s,n)=>{ - const h=n.width/i.w; - return t.position.set(n.x+this.bx*h,n.y+this.by*h),t.alpha=e,s.visible=!!this.target,this.target&&s.position.set(n.x+this.target.x*h,n.y+this.target.y*h),h} - ,"place"); - if(this.miniMap.visible){ - const t=n(this.miniMe,this.miniTarget,this.miniImg); - this.miniView.position.set(this.miniImg.x-this.world.x*t,this.miniImg.y-this.world.y*t)} - if(this.bigMap.visible){ - const t=n(this.bigMe,this.bigTarget,this.bigImg),i=performance.now(); - if(i-this.bigOthersAt>500){ - this.bigOthersAt=i; - const s=this.bigOthers.clear(); - for(const e of this.others.values()){ - const n=this.otherPos(e,i); - s.circle(this.bigImg.x+n.x*t,this.bigImg.y+n.y*t,1.8).fill({ - color:14675954,alpha:.7} - )} - } - } - } - buildWater(){ - const t=this.info,i=t.cols+1,s=t.rows+1,e=t.tile,{ - canvas:n,dist:h} - =XUi(i,s,(t,i)=>this.vert(t,i),this.race,this.zone); - this.landDist=h; - const r=ls.from(n); - r.source.scaleMode="linear",this.water=new Xe(r),this.water.position.set(-e/2,-e/2),this.water.width=i*e,this.water.height=s*e,this.water.eventMode="none"; - const o=NAi.water(),a=Qt((t,i,s,e=16777215)=>{ - const n=new zp({ - texture:t,width:this.viewW+128,height:this.viewH+128} - ); - return n.alpha=i,n.blendMode=s,n.tint=e,n.eventMode="none",n} - ,"mk"); - if(this.surf=[a(o.blotch,.32,"normal",135192),a(o.caustic,.11,"add"),a(o.caustic,.08,"add")],!this.fog){ - const t=new zp({ - texture:o.blotch,width:this.viewW,height:this.viewH} - ); - t.tint=15660277,t.alpha=0,t.tileScale.set(5.5),t.eventMode="none",this.addChildAt(t,this.getChildIndex(this.birds.sky)),t.mask=null,this.fog=t} - this.surf[0].tileScale.set(4.2),this.surf[2].tileScale.set(1.45),this.tileLayer.addChild(this.water,this.underLayer,...this.surf)} - drawSurface(t){ - if(!this.surf.length)return; - const i=t/1e3,s=-this.world.x-64,e=-this.world.y-64,n="R"===this.zone?.3:"C"===this.zone?.55:.8,h=[[2.99538,1.99692],[3.5,1.6],[-2.1,2.5]],r=[.27,.085,.06],o=BDi(-this.world.x+this.viewW/2,-this.world.y+this.viewH/2,i,this.zone).height/RDi[this.zone].amplitude; - this.surf.forEach((t,a)=>{ - const[c,l]=h[a]; - t.position.set(s,e),t.tilePosition.set(c*i*n-s,l*i*n-e),t.alpha=r[a]*(0===a?1:(.85+.15*o)*(2===this.tide?.35:1))} - )} - updateTiles(t,i){ - if(!this.terr)return; - const s=this.info.tile,e=8*s,n=this.viewH,h=Math.max(0,Math.floor((t-this.viewW/2-3*s)/e)),r=Math.floor((t+this.viewW/2+3*s)/e),o=Math.max(0,Math.floor((i-n/2-s)/e)),a=Math.floor((i+n/2+3*s)/e); - for(let c=o; - c<=a; - c++)for(let t=h; - t<=r; - t++){ - const i=`${ - t} - _${ - c} - `; - this.regions.has(i)||this.regions.set(i,this.buildRegion(t,c))} - for(const[c,l]of this.regions){ - const[t,i]=c.split("_").map(Number); - t>=h-1&&t<=r+1&&i>=o-1&&i<=a+1||(this.regions.delete(c),this.destroyRegion(l))} - } - destroyRegion(t){ - t.tiles.destroy({ - children:!0} - ),t.props.destroy({ - children:!0} - ),t.sand.destroy(),t.foam.destroy()} - dropRegions(){ - for(const t of this.regions.values())this.destroyRegion(t); - this.regions.clear()} - solid(t,i){ - const s=this.info; - return t>=0&&i>=0&&t<s.cols&&i<s.rows&&15===this.tileIndex(t,i)} - cellHash(t,i,s=0){ - return BAi(7919*(this.info.seed??1)+104729*t+1299709*i+15485863*s)} - largeAt(t,i){ - if(t%3||i%3||this.cellHash(t,i,1)%100>=3)return!1; - for(let s=i-2; - s<=i+1; - s++)for(let i=t-1; - i<=t+2; - i++)if(!this.solid(i,s))return!1; - return!0} - coveredByLarge(t,i){ - for(let s=i; - s<=i+1; - s++)for(let i=t-1; - i<=t; - i++)if(this.largeAt(i,s))return!0; - return!1} - placeNpcShips(){ - const t=this.info; - this.npcSpots=t.points.slice(0,3).map((i,s)=>{ - const e=[[250,-140],[-260,-130],[20,-290],[260,150],[-260,150],[0,300]],n=Qt((t,i)=>[[0,0],[0,-46],[0,46],[-24,0],[24,0]].every(([s,e])=>!this.isLand(t+s,i+e)),"ok"),h=e.find(([t,s])=>n(i.x+t,i.y+s))??e[0]; - return{ - x:i.x+h[0],y:i.y+h[1],rot:1.2*(BAi(31*(t.seed??1)+s)%100/100-.5)} - } - ),this.npcSig=""; - for(const i of this.npcs)i.ship.destroy(),i.shade.destroy(),i.water.destroy({ - children:!0} - ),i.tag.destroy({ - children:!0} - ); - this.npcs=[]} - setVisitors(t){ - if(!this.info||!this.npcSpots.length)return; - const i=t.map(t=>`${ - t.key} - :${ - t.state} - `).join("|")+this.key; - if(i===this.npcSig)return; - this.npcSig=i; - for(const e of this.npcs)e.ship.destroy(),e.shade.destroy(),e.water.destroy({ - children:!0} - ),e.tag.destroy({ - children:!0} - ); - this.npcs=[]; - const s=NAi.gear(); - t.slice(0,this.npcSpots.length).forEach((t,i)=>{ - const e=this.npcSpots[i],n=KUi(t.key),h=new Xe(s.npcBoats[n]); - h.anchor.set(.5),h.scale.set(jUi),h.rotation=e.rot,h.eventMode="none"; - const r=(new ep).ellipse(3,5,20,34).fill({ - color:401450,alpha:.22} - ); - r.position.set(e.x,e.y),r.rotation=e.rot,r.eventMode="none"; - const o=new Ke; - o.eventMode="none"; - const a=new Xe(s.guestHeads[n]); - a.width=a.height=30; - const c=dRi(`${ - t.npc} - · ${ - t.role} - `,16777215,Vxi,11,7),l=a.width+4+c.width; - a.position.set(-l/2,-8),c.position.set(-l/2+a.width+4,0),a.alpha=c.alpha="done"===t.state?.55:.95; - const u=new Ke; - if("done"!==t.state){ - const i="ready"===t.state,e=new Xe(s.bubbles[i?1:0]); - e.anchor.set(.5,gAi),e.scale.set(.15),e.position.set(0,18),u.addChild(e),u.position.set(-l/2+15,-26)} - o.addChild(c,a,u); - const d=new zDi("nearby",819+397*i); - d.alpha=.6,this.npcLayer.addChild(d,r,h),this.npcTags.addChild(o),this.npcs.push({ - key:t.key,ship:h,shade:r,water:d,tag:o,bubble:u,x:e.x,y:e.y,rot:e.rot,state:t.state,phase:1.7*i} - )} - )} - drawNpcs(t,i){ - for(const s of this.npcs){ - const e=this.unexplored(s.x,s.y)||s.x<-this.world.x-120||s.x>-this.world.x+this.viewW+120||s.y<-this.world.y-120||s.y>-this.world.y+this.viewH+120; - if(e&&s.water.visible&&s.water.reset(),s.ship.visible=s.shade.visible=s.tag.visible=s.water.visible=!e,e)continue; - const n=t/1e3,h=$Di(s.x,s.y,s.rot-Math.PI/2,n,this.zone,4,0,1.5); - s.ship.position.set(h.x,h.y),s.ship.rotation=h.rotation,s.ship.scale.set(jUi*h.scaleX,jUi*h.scaleY),s.ship.skew.set(h.skew,0),s.tag.position.set(s.x,s.y-50),s.bubble.y=1.2*Math.sin(.85*n+s.phase)-26,s.shade.position.set(h.waterX,h.waterY),s.shade.rotation=h.rotation,s.water.update(i,{ - x:h.waterX,y:h.waterY,heading:h.rotation-Math.PI/2,speed:0,level:4,hullScale:1.5,zone:this.zone,time:n,velocity:h.velocity,roll:h.roll,pitch:h.pitch,rollVelocity:h.rollVelocity,pitchVelocity:h.pitchVelocity} - ,NAi.foam(),(t,i)=>!this.isLand(t,i))} - } - npcAt(i,s){ - for(const e of this.npcs)if(Math.hypot(i-e.x,s-(e.y-8))<=44||t.tagHit(e.tag,i,s))return e.key; - return null} - static tagHit(t,i,s,e=6){ - if(!t.visible)return!1; - const n=t.getLocalBounds(); - return i>=t.x+n.x-e&&i<=t.x+n.x+n.width+e&&s>=t.y+n.y-e&&s<=t.y+n.y+n.height+e} - setHubs(t){ - var i; - (null==(i=this.info)?void 0:i.tile)&&this.verts||(t=[]); - const s=`${ - this.key} - |`+t.map(t=>`${ - t.id} - :${ - t.state} - `).join("|"); - if(s===this.hubSig)return; - this.hubSig=s,this.hubs=t; - for(const n of this.hubViews.values())n.body.destroy(),n.shade.destroy(),n.pier.destroy(),n.tag.destroy({ - children:!0} - ),n.ship&&(n.ship.hull.destroy(),n.ship.mast.destroy(),n.ship.water.destroy({ - children:!0} - )); - this.hubViews.clear(); - const e=NAi.gear(); - t.forEach((t,i)=>{ - const s=this.hubPlaces.get(t.id)??(t.ship?this.placeShip(t.anchor):null)??this.placeHub(t.anchor); - if(!s)return; - if(this.hubPlaces.set(t.id,s),s.ship)return void this.addShipHub(t,i,{ - x:s.x,y:s.y,rot:s.rot??0} - ); - const n=Math.atan2(s.dy-s.y,s.dx-s.x),h=Math.hypot(s.dx-s.x,s.dy-s.y)-6,r=new ep; - r.rect(-4,-13,h,26).fill(9071173).stroke({ - color:5126692,width:2} - ); - for(let e=6; - e<h-4; - e+=11)r.moveTo(e,-12).lineTo(e,12); - r.stroke({ - color:6112560,width:1.5,alpha:.8} - ),r.rect(h-8,-16,6,6).fill(5126692).rect(h-8,10,6,6).fill(5126692),r.position.set(s.x,s.y-4),r.rotation=n; - const o=(new ep).ellipse(0,0,12,4.5).fill({ - color:1714714,alpha:.28} - ); - o.position.set(s.x,s.y); - const a=new Xe(e.journeyNpcs[t.art]??e.journeyNpcs[0]); - a.anchor.set(.5,250/256),a.scale.set(.15),a.position.set(s.x,s.y); - const{ - tag:c,bubble:l} - =this.hubTag(t,!1); - this.hubLayer.addChild(r,o,a),this.npcTags.addChild(c),this.hubViews.set(t.id,{ - body:a,shade:o,pier:r,tag:c,bubble:l,x:s.x,y:s.y,phase:1.3*i} - )} - ),this.markSig=""} - hubTag(t,i){ - const s=NAi.gear(),e=new Ke,n=i?34:28,h=uRi(s.journeyFaces[t.art]??s.journeyFaces[0],n),r=dRi(`${ - t.name} - · ${ - t.role} - `,16777215,Vxi,i?13:11,7),o=n+4+r.width; - h.position.set(-o/2,i?-11:-9),r.position.set(-o/2+n+4,-1),h.alpha=r.alpha="idle"===t.state?.6:.96; - const a=new Xe("ready"===t.state?s.bubbles[1]:s.bubbles[0]); - return a.anchor.set(.5,gAi),a.scale.set(i?.2:.17),a.visible="offer"===t.state||"ready"===t.state,e.addChild(r,h,a),{ - tag:e,bubble:a} - } - placeShip(t){ - const i=this.info,s=null==i?void 0:i.points[t]; - if(!i||!s)return null; - const e=this.startSpot(t),n=this.labels.children.find(i=>i.label===String(t)),h=56+(n?n.width/2:60),r=84+(n?n.height/2:15),o=Qt((t,i)=>[[0,0],[0,-72],[0,72],[-38,0],[38,0],[-28,-48],[28,-48],[-28,48],[28,48]].every(([s,e])=>!this.isLand(t+s,i+e)),"hullWet"),a=Math.atan2(e.fy-e.by,e.fx-e.bx); - let c=null,l=1/0; - for(const d of[190,160,220,250,270,150])for(let t=0; - t<24; - t++){ - const i=t/24*Math.PI*2,n=e.bx+Math.cos(i)*d,u=e.by+Math.sin(i)*d; - if(!o(n,u)||this.shoreDist(n,u)<20)continue; - if(Math.abs(n-s.x)<h&&Math.abs(u-s.y)<r)continue; - if(Math.hypot(n-e.fx,u-e.fy)<130||this.npcSpots.some(t=>Math.hypot(t.x-n,t.y-u)<170))continue; - const f=Math.abs(Math.atan2(Math.sin(i-a),Math.cos(i-a))),p=Math.abs(d-190)+45*(Math.PI-f); - p<l&&(l=p,c={ - x:n,y:u} - )} - if(!c)return null; - const u=Math.atan2(e.by-c.y,e.bx-c.x)+Math.PI/2+.9; - return{ - x:c.x,y:c.y,dx:e.bx,dy:e.by,ship:!0,rot:u} - } - addShipHub(t,i,s){ - const e=NAi.gear(),n=new Xe(e.npcBoats[2]??e.npcBoats[0]); - n.anchor.set(.5),n.scale.set(YUi),n.rotation=s.rot; - const h=(new ep).ellipse(4,8,36,62).fill({ - color:401450,alpha:.26} - ); - h.position.set(s.x,s.y),h.rotation=s.rot; - const r=new ep,o=new Xe(e.journeyNpcs[t.art]??e.journeyNpcs[0]); - o.anchor.set(.5,250/256),o.scale.set(.21),o.position.set(s.x,s.y+10); - const a=new zDi("nearby",1201+331*i); - a.alpha=.7; - const{ - tag:c,bubble:l} - =this.hubTag(t,!0); - this.hubLayer.addChild(a,h,n,r,o),this.npcTags.addChild(c),this.hubViews.set(t.id,{ - body:o,shade:h,pier:new ep,tag:c,bubble:l,x:s.x,y:s.y,phase:1.3*i,ship:{ - hull:n,mast:r,water:a,rot:s.rot,flag:qUi[this.race]??qUi["인간"]} - } - )} - placeHub(t){ - const i=this.info,s=eDi.get(this.key),e=null==i?void 0:i.points[t]; - if(!i||!s||!e)return null; - const n=s.tile,h=[...this.hubPlaces.values()]; - let r=null,o=1/0; - for(let a=0; - a<s.owner.length; - a++){ - if(s.owner[a]!==t)continue; - const i=a%s.cols,c=(i+.5)*n,l=((a-i)/s.cols+.5)*n; - if(!this.isLand(c,l))for(const[t,s,a]of[[0,-1,0],[-1,0,90],[1,0,90],[0,1,200]]){ - const i=c+t*n,u=l+s*n; - if(!this.isLand(i,u)||!this.isLand(i+t*n*.7,u+s*n*.7)||!this.isLand(i+(s?.5*n:0),u+(t?.5*n:0)))continue; - if(h.some(t=>Math.hypot(t.x-i,t.y-u)<300))continue; - const d=Math.abs(Math.hypot(c-e.x,l-e.y)-230)+a; - d<o&&(o=d,r={ - x:i-14*t,y:u-14*s,dx:c-34*t,dy:l-34*s} - )} - } - return r} - hubNear(t){ - const i=this.hubPlaces.get(t); - return!!i&&Math.hypot(this.bx-i.x,this.by-i.y)<=330} - hubPos(t){ - return this.hubPlaces.get(t)??null} - hubAt(i,s){ - for(const[e,n]of this.hubViews)if(n.body.visible){ - if(n.ship?Math.abs(i-n.x)<=54&&s>=n.y-140&&s<=n.y+74:Math.abs(i-n.x)<=26&&s>=n.y-zUi-16&&s<=n.y+14)return e; - if(t.tagHit(n.tag,i,s))return e} - return null} - drawHubs(t,i){ - for(const s of this.hubViews.values()){ - const e=this.unexplored(s.x,s.y); - if(s.body.visible=s.shade.visible=s.pier.visible=s.tag.visible=!e,s.ship&&(e&&s.ship.water.visible&&s.ship.water.reset(),s.ship.hull.visible=s.ship.mast.visible=s.ship.water.visible=!e),e)continue; - const n=t/1e3+s.phase; - s.ship?this.drawShip(s,t/1e3,n,i):(s.tag.position.set(s.x,s.y-zUi),s.bubble.position.set(-s.tag.width/2+14,2.5*Math.sin(3*n)-12))} - } - drawShip(t,i,s,e){ - const n=t.ship,h=$Di(t.x,t.y,n.rot-Math.PI/2,i,this.zone,5,0,2.4); - n.hull.position.set(h.x,h.y),n.hull.rotation=h.rotation,n.hull.scale.set(YUi*h.scaleX,YUi*h.scaleY),n.hull.skew.set(h.skew,0),t.shade.position.set(h.waterX,h.waterY),t.shade.rotation=h.rotation; - const r=.035*Math.sin(1.3*s); - t.body.position.set(t.x,t.y+12); - const o=h.x+22,a=h.y+4,c=a-92,l=n.mast.clear(); - l.moveTo(o,a).lineTo(o+30*r,c).stroke({ - color:5126692,width:4} - ),l.circle(o+30*r,c,3.5).fill(15325616); - const u=o+30*r,d=c+4,f=[]; - for(let p=0; - p<=6; - p++){ - const t=p/6; - f.push(u+40*t,d+3.2*Math.sin(5.5*i-3*t)*t)} - for(let p=6; - p>=0; - p--){ - const t=p/6; - f.push(u+40*t,d+24*(1-t)+3.2*Math.sin(5.5*i-3*t)*t)} - l.poly(f).fill(n.flag).stroke({ - color:1905672,width:2,alpha:.8} - ),l.circle(u+12,d+24*.38,4).fill({ - color:16777215,alpha:.9} - ),t.tag.position.set(t.x,t.y-128),t.bubble.position.set(-t.tag.width/2+16,2.5*Math.sin(3*s)-14),n.water.update(e,{ - x:h.waterX,y:h.waterY,heading:h.rotation-Math.PI/2,speed:0,level:5,hullScale:2.4,zone:this.zone,time:i,velocity:h.velocity,roll:h.roll,pitch:h.pitch,rollVelocity:h.rollVelocity,pitchVelocity:h.pitchVelocity} - ,NAi.foam(),(t,i)=>!this.isLand(t,i))} - setGoal(t){ - const i=t?`${ - t.points.join(",")} - |${ - t.hub} - |${ - t.label} - `:""; - i!==this.goalSig&&(this.goalSig=i,this.goal=t,this.goalArrowText="")} - goalPoints(){ - const t=this.goal,i=this.info; - if(!t||!i)return[]; - if(t.hub){ - const i=this.hubPlaces.get(t.hub); - return i?[i]:[]} - return t.points.map(t=>i.points[t]).filter(Boolean)} - drawGoal(t){ - const i=this.goalPoints(),s=this.goalMarks.clear(); - this.goalArrow.visible=!1; - const e=this.tutorialRing; - if(e){ - const i=lIi(t),n=this.tutorialRingScale; - s.circle(e.x,e.y,i.r*n).stroke({ - color:Dxi,width:3*n,alpha:i.alpha} - ),s.circle(e.x,e.y,7*n).fill(Dxi).circle(e.x,e.y,7*n).stroke({ - color:2825477,width:2.5*n} - )} - if(!i.length||!this.goal)return; - const n=t/1400%1; - if(!this.goal.hub)for(const b of i)s.circle(b.x,b.y,22+26*n).stroke({ - color:Dxi,width:3,alpha:.75*(1-n)} - ),s.circle(b.x,b.y,7).fill(Dxi).circle(b.x,b.y,7).stroke({ - color:2825477,width:2} - ); - let h=i[0],r=1/0; - for(const b of i){ - const t=Math.hypot(b.x-this.bx,b.y-this.by); - t<r&&(r=t,h=b)} - const o=h.x+this.world.x,a=h.y+this.world.y,c=this.viewW,l=this.viewH; - if(o>46&&o<c-46&&a>86&&a<l-46)return; - const u=c/2,d=l/2,f=o-u,p=a-d,w=p>0?44:0,g=Math.min((c/2-46)/Math.max(1e-6,Math.abs(f)),(l/2-46-20-w)/Math.max(1e-6,Math.abs(p))),m=u+f*g,v=d+p*g+10,_=Math.atan2(p,f); - if(this.goalArrowText!==this.goal.label){ - this.goalArrowText=this.goal.label,this.goalArrow.removeChildren().forEach(t=>{ - t!==this.goalArrowHead&&t.destroy({ - children:!0} - )} - ); - const t=dRi(this.goal.label,Gxi,Dxi,11,7); - t.label="tag",this.goalArrowHead.clear().poly([16,0,-8,-11,-3,0,-8,11]).fill(Dxi).stroke({ - color:2825477,width:2} - ),this.goalArrow.addChild(this.goalArrowHead,t)} - this.goalArrow.visible=!0,this.goalArrow.position.set(m,v),this.goalArrowHead.rotation=_,this.goalArrowHead.position.set(Math.cos(_)*(6+3*Math.sin(t/180)),Math.sin(_)*(6+3*Math.sin(t/180))); - const M=this.goalArrow.getChildByLabel("tag"); - if(M){ - let t=30*-Math.cos(_)-M.width/2,i=26*-Math.sin(_)-M.height/2; - t=Math.max(8-m,Math.min(c-8-m-M.width,t)),i=Math.max(8-v,Math.min(l-8-v-M.height,i)),M.position.set(t,i)} - } - buildShore(){ - const t=this.info,i=t.tile,s=8*i,e=[[1,0],[2,1],[1,2],[0,1]],n=[]; - for(let a=0; - a<t.rows; - a++)for(let i=0; - i<t.cols; - i++){ - const t=this.tileIndex(i,a); - if(0===t||15===t)continue; - const s=[t>>3&1,t>>2&1,t>>1&1,1&t],h=Qt((t,s)=>n.push([2*i+e[t][0],2*a+e[t][1],2*i+e[s][0],2*a+e[s][1]]),"add"); - if(5===t){ - h(0,1),h(2,3); - continue} - if(10===t){ - h(3,0),h(1,2); - continue} - const r=[0,1,2,3].filter(t=>s[t]!==s[(t+1)%4]); - 2===r.length&&h(r[0],r[1])} - const h=Qt((t,i)=>1e5*i+t,"key"),r=new Map; - n.forEach((t,i)=>{ - for(const s of[h(t[0],t[1]),h(t[2],t[3])]){ - const t=r.get(s); - t?t.push(i):r.set(s,[i])} - } - ); - const o=new Uint8Array(n.length); - this.shoreRuns.clear(); - for(let a=0; - a<n.length; - a++){ - if(o[a])continue; - o[a]=1; - const t=[[n[a][0],n[a][1]],[n[a][2],n[a][3]]]; - for(const i of[!0,!1])for(; - ; - ){ - const s=i?t[t.length-1]:t[0],e=(r.get(h(s[0],s[1]))??[]).find(t=>!o[t]); - if(void 0===e)break; - o[e]=1; - const a=n[e],c=a[0]===s[0]&&a[1]===s[1]?[a[2],a[3]]:[a[0],a[1]]; - i?t.push(c):t.unshift(c)} - let e=t.map(t=>[t[0]*i/2,t[1]*i/2]); - const c=t.length>2&&t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]; - for(let i=0; - i<3; - i++){ - const t=c?[]:[e[0]]; - for(let i=0; - i<e.length-1; - i++){ - const[s,n]=e[i],[h,r]=e[i+1]; - t.push([.75*s+.25*h,.75*n+.25*r],[.25*s+.75*h,.25*n+.75*r])} - t.push(c?t[0]:e[e.length-1]),e=t} - let l=null,u=""; - for(let i=0; - i<e.length-1; - i++){ - const[t,n]=e[i],[h,r]=e[i+1],o=`${ - Math.floor((t+h)/2/s)} - _${ - Math.floor((n+r)/2/s)} - `; - if(o!==u||!l){ - l=[t,n],u=o; - const i=this.shoreRuns.get(o); - i?i.push(l):this.shoreRuns.set(o,[l])} - l.push(h,r)} - } - } - buildRegion(t,i){ - const s=this.info,e=s.tile,n=this.terr,h=new Ke,r=new Ke; - h.eventMode=r.eventMode="none"; - const o=[]; - for(let u=8*i; - u<Math.min(s.rows,8*i+8); - u++)for(let i=8*t; - i<Math.min(s.cols,8*t+8); - i++){ - const t=this.tileIndex(i,u); - if(t){ - const s=new Xe(n.terrain[16*(t-1)+u%4*4+i%4]); - s.position.set(i*e,u*e),h.addChild(s)} - if(!this.solid(i,u))continue; - if(this.largeAt(i,u)){ - const t=n.large[this.cellHash(i,u,2)%n.large.length]; - o.push({ - tex:t.tex,x:(i+1)*e,y:(u+1)*e-4,w:t.w,scale:1} - ); - continue} - if(!(this.solid(i-1,u)&&this.solid(i+1,u)&&this.solid(i,u-1)&&this.solid(i,u+1)))continue; - if(this.coveredByLarge(i,u))continue; - const s=this.cellHash(i,u),r=s%100,a=r<50?0:r<85?1:2; - for(let h=0; - h<a; - h++){ - const t=BAi(s+31337*h),r=t%100,a=r<40?t%6:r<70?6+(t>>>4)%6:r<90?12+(t>>>4)%4:16+(t>>>4)%8,c=n.small[a]; - o.push({ - tex:c.tex,x:i*e+12+(t>>>8)%40,y:u*e+22+(t>>>16)%38,w:c.w,scale:1} - )} - } - o.sort((t,i)=>t.y-i.y); - const a=new ep; - for(const u of o)a.ellipse(u.x+2,u.y-2,u.w*u.scale*.36,Math.max(2.5,u.w*u.scale*.1)).fill({ - color:662032,alpha:.2} - ); - r.addChild(a); - for(const u of o){ - const t=new Xe(u.tex); - t.anchor.set(.5,1),t.position.set(u.x,u.y),t.scale.set(u.scale),r.addChild(t)} - const c=new ep,l=new ep; - for(const u of this.shoreRuns.get(`${ - t} - _${ - i} - `)??[])u.length<4||(l.poly(u,!1).stroke({ - color:16777215,width:30,alpha:.16,join:"round",cap:"round"} - ),l.poly(u,!1).stroke({ - color:16055291,width:19,alpha:.42,join:"round",cap:"round"} - ),c.poly(u,!1).stroke({ - color:n.wet,width:13,join:"round",cap:"round"} - ),c.poly(u,!1).stroke({ - color:n.sand,width:8.5,join:"round",cap:"round"} - )); - return this.tileLayer.addChild(h),this.propLayer.addChild(r),this.shoreLayer.addChild(c),this.shoreFoamLayer.addChild(l),{ - tiles:h,props:r,sand:c,foam:l} - } - clearTiles(){ - var t; - this.dropRegions(),null==(t=this.water)||t.destroy(!0),this.water=null; - for(const i of this.surf)i.destroy(); - this.surf=[],this.tileLayer.removeChildren(),this.shoreRuns.clear(),this.terr=null} - clearChunks(){ - const t=this.chunks,i=this.chunkKey; - this.chunks=new Map,this.chunkKey=this.key; - for(const[s,e]of t){ - if(!e)continue; - e.destroy(); - const[t,n]=s.split("_").map(Number); - NAi.unloadChunk(i,t,n)} - } - get boatPos(){ - return this.info?{ - x:Math.round(this.bx),y:Math.round(this.by),s:this.sailing} - :null} - setOthers(t){ - this.otherCandidates=t.filter(t=>t.id!==TG.userId),this.pickOtherBoats(performance.now(),!0)} - dropOtherBoat(t){ - yx.killTweensOf([t.sp,t.name,t.float,t.water]),t.sp.destroy({ - children:!0} - ),t.name.destroy({ - children:!0} - ),t.float.destroy(),t.water.destroy({ - children:!0} - ),t.fixing=!1} - pickOtherBoats(i,s=!1){ - var e; - this.otherPickAt=i+500; - const n=SUi(this.otherCandidates.map(t=>{ - const i=this.others.get(t.id),s=i?this.otherPos(i):t; - return{ - id:t.id,x:s.x,y:s.y,angler:t} - } - ).filter(t=>!this.unexplored(t.x,t.y)),{ - x:this.bx,y:this.by} - ,{ - x:-this.world.x-80,y:-this.world.y-80,width:this.viewW+160,height:this.viewH+160} - ,new Set(this.others.keys())).map(t=>t.angler),h=new Set(n.map(t=>t.id)); - for(const[t,r]of this.others)h.has(t)||"leave"===r.mode||(r.sp.visible&&r.alpha>.05?(r.mode="leave",r.pending=null,r.away=Math.atan2(r.y-this.by,r.x-this.bx)+(Math.random()-.5)):(this.others.delete(t),this.dropOtherBoat(r))); - for(const r of n){ - let n=this.others.get(r.id); - if(!n||s||"leave"===n.mode){ - if(n){ - "leave"===n.mode&&(n.mode="fish",n.castAt=i+800+1500*Math.random()); - const s=Math.hypot(r.x-n.x,r.y-n.y); - if(n.tx=r.x,n.ty=r.y,s>=25){ - const t="sail"===n.mode||r.s; - n.pending=this.crossesLand({ - x:n.x,y:n.y} - ,r)?"hop":"sail",n.goAt=i+(t?2500*Math.random():1500+12500*Math.random()),n.cruise=Math.max(30,Math.min(140,s/35))*(.85+n.seed%30/100),"hop"===n.pending&&(n.away=Math.atan2(r.y-n.y,r.x-n.x)+1.2*(Math.random()-.5))} - if(r.b!==n.a.b&&(n.hull.texture=NAi.boat(r.b),n.lamp.texture=NAi.gear().lanterns[t.lampGrade(r.b)]),r.b===n.a.b&&r.dk===n.a.dk||t.dressBoat(n,r.b,r.dk),r.lk!==n.a.lk&&(n.crew.texture=t.otherAnglerTex(r.lk)??NAi.gear().angler[0]),!!r.a!=!!n.a.a||r.n!==n.a.n||(r.fx??0)!==(n.a.fx??0)||!!r.fk!=!!n.a.fk){ - const i=t.otherName(r); - i.alpha=n.name.alpha,i.visible=n.name.visible,this.otherNames.addChildAt(i,this.otherNames.getChildIndex(n.name)),n.name.destroy({ - children:!0} - ),n.name=i} - n.a=r} - else{ - if(this.others.size>=30)continue; - const s=NAi.gear(),h=s.info.boats[NAi.boatArt(r.b)],o=s.info.angler[0],a=new Ke,c=new Xe(NAi.boat(r.b)),l=new Xe(t.otherAnglerTex(r.lk)??s.angler[0]),u=new Xe(s.lanterns[t.lampGrade(r.b)]); - c.anchor.set(.5),l.anchor.set((128+o.body[0])/256,(128+o.body[1])/256),l.position.set(h.seat[0],h.seat[1]),l.scale.set(.37500000000000006),u.anchor.set(.5),u.position.set(h.lantern[0],h.lantern[1]),u.scale.set(.5555555555555556); - const d=new Xe(ls.EMPTY),f=new Xe(ls.EMPTY); - t.dressBoat({ - prow:d,sail:f} - ,r.b,r.dk),a.addChild(c,f,d,l,u),a.scale.set(PUi),a.alpha=0,this.othersLayer.addChild(a); - const p=new zDi("nearby",WUi(r.id)); - p.alpha=0,this.othersWater.addChild(p); - const w=WUi(r.id)%Math.max(1,s.floats.length),g=new Xe(FUi(s.floats[w],w)); - g.anchor.set(.5,1),g.scale.set(GUi),g.alpha=0,this.othersFloats.addChild(g); - const m=t.otherName(r); - m.alpha=0,this.otherNames.addChild(m),n={ - a:r,sp:a,hull:c,lamp:u,prow:d,sail:f,name:m,rot:Math.random()*Math.PI*2,seenCatch:(null==(e=r.c)?void 0:e.at)??0,catchAt:0,dist:0,px:r.x,py:r.y,x:r.x,y:r.y,v:0,tx:r.x,ty:r.y,cruise:40,alpha:0,mode:"fish",pending:null,goAt:0,away:0,crew:l,float:g,fx:0,fy:0,fAlpha:0,seed:WUi(r.id)%1e3,fSet:!1,fly:null,castAt:i+600+2e3*Math.random(),recastAt:0,water:p} - ,this.others.set(r.id,n)} - r.c&&r.c.at>n.seenCatch&&(n.seenCatch=r.c.at,n.catchAt=i,this.otherCatch(n,r.c.id,r.c.star,r.c.g??0))} - } - } - otherPos(t,i){ - return{ - x:t.x,y:t.y} - } - crossesLand(t,i){ - const s=Math.hypot(i.x-t.x,i.y-t.y),e=Math.ceil(s/48); - for(let n=1; - n<e; - n++)if(this.isLand(t.x+(i.x-t.x)*n/e,t.y+(i.y-t.y)*n/e))return!0; - return!1} - stepOther(t,i,s){ - t.pending&&i>=t.goAt&&(t.mode=t.pending,t.pending=null); - const e=Qt(i=>{ - t.rot+=Math.max(-.7*s,Math.min(.7*s,lFi(i,t.rot)))} - ,"turn"); - if("fish"===t.mode){ - const i=Math.min(1,.15*s); - t.x+=(t.tx-t.x)*i,t.y+=(t.ty-t.y)*i,t.v*=Math.max(0,1-2*s),t.alpha+=(this.otherAlpha(t)-t.alpha)*Math.min(1,1.5*s)} - else if("sail"===t.mode){ - const n=t.tx-t.x,h=t.ty-t.y,r=Math.hypot(n,h),o=lFi(Math.atan2(h,n),t.rot); - e(Math.atan2(h,n)); - const a=Math.min(t.cruise,6+.6*r)*Math.max(.15,Math.cos(o)); - t.v+=(a-t.v)*Math.min(1,.9*s); - const c=t.x+Math.cos(t.rot)*t.v*s,l=t.y+Math.sin(t.rot)*t.v*s; - this.isLand(c+14*Math.cos(t.rot),l+14*Math.sin(t.rot))?(t.mode="hop",t.away=t.rot+.9*(Math.random()<.5?-1:1)):(t.x=c,t.y=l),r<8&&(t.mode="fish",t.castAt=i+800+1800*Math.random()),t.alpha+=(this.otherAlpha(t)-t.alpha)*Math.min(1,1.5*s)} - else{ - e(t.away),t.v+=(40-t.v)*Math.min(1,.8*s); - const n=t.x+Math.cos(t.rot)*t.v*s,h=t.y+Math.sin(t.rot)*t.v*s; - this.isLand(n,h)?t.v*=.5:(t.x=n,t.y=h),t.alpha=Math.max(0,t.alpha-s*aFi/2.8),"hop"===t.mode&&t.alpha<=.01&&(t.x=t.tx,t.y=t.ty,t.v=0,t.mode="fish",t.rot=Math.random()*Math.PI*2,t.fSet=!1,t.fly=null,t.castAt=i+1200+1500*Math.random())} - } - pickOtherFloat(t,i){ - const s=t.rot+.25*(t.seed%7-3)+(i?2.4*(Math.random()-.5):0); - for(let e=0; - e<8; - e++){ - const n=s+(e%2?1:-1)*Math.ceil(e/2)*.7,h=60+(t.seed+(i?40*Math.random():0))%35,r=t.x+Math.cos(n)*h,o=t.y+Math.sin(n)*h; - if(!(this.isLand(r,o)||i&&Math.hypot(r-t.fx,o-t.fy)<25))return t.fx=r,t.fy=o,!0} - return!1} - drawOthers(t,i){ - const s=performance.now(),e=this.viewH; - s>=this.otherPickAt&&this.pickOtherBoats(s); - const n=-this.world.x-80,h=-this.world.x+this.viewW+80,r=-this.world.y-80,o=-this.world.y+e+80,a=this.othersLines.clear(),c=t/1e3,l=NAi.gear(); - for(const[d,f]of this.others){ - if(this.stepOther(f,s,i),"leave"===f.mode&&f.alpha<=.01){ - this.others.delete(d),this.dropOtherBoat(f); - continue} - const t=this.otherPos(f),e=t.x>n&&t.x<h&&t.y>r&&t.y<o&&!this.unexplored(t.x,t.y); - if(f.sp.visible=e,!e){ - f.name.visible=!1,f.float.visible=!1,f.water.visible&&f.water.reset(),f.water.visible=!1; - continue} - f.sp.alpha=f.alpha,f.v; - const u=$Di(t.x,t.y,f.rot,c,this.zone,f.a.b,f.v); - f.sp.position.set(u.x,u.y),f.sp.rotation=u.rotation,f.sp.scale.set(PUi*u.scaleX,PUi*u.scaleY),f.sp.skew.set(u.skew,0),f.water.visible=!0; - const p=Math.hypot(t.x-this.bx,t.y-this.by); - f.water.alpha=f.alpha/aFi*(.42+.25*Math.max(0,1-p/500)),f.water.update(i,{ - x:u.waterX,y:u.waterY,heading:u.rotation-Math.PI/2,speed:f.v,level:f.a.b,zone:this.zone,time:c,velocity:u.velocity,roll:u.roll,pitch:u.pitch,rollVelocity:u.rollVelocity,pitchVelocity:u.pitchVelocity} - ,NAi.foam(),(t,i)=>!this.isLand(t,i)),f.lamp.rotation=.65*-u.roll+.012*Math.sin(c/2.2+f.seed); - const w=l.info.boats[NAi.boatArt(f.a.b)],g=f.sp.scale.x,m=f.sp.scale.y,v=f.sp.rotation,_=f.sp.skew.x,M=f.sp.x+w.seat[0]*Math.cos(v)*g-w.seat[1]*Math.sin(v-_)*m,b=f.sp.y+w.seat[0]*Math.sin(v)*g+w.seat[1]*Math.cos(v-_)*m; - if("fish"!==f.mode||f.a.s||f.pending&&s>f.goAt-1200||f.a.fx&&f.a.fx>Date.now())f.fSet=!1,f.fly=null; - else if(!f.fSet&&s>=f.castAt&&f.fAlpha<.05)if(this.pickOtherFloat(f,f.recastAt>0)){ - const t=Math.atan2(f.fy-b,f.fx-M); - f.fly={ - x0:M+9*Math.cos(t),y0:b+9*Math.sin(t),t0:s} - ,f.fSet=!0,f.fAlpha=1,f.recastAt=s+cFi[0]+Math.random()*(cFi[1]-cFi[0])} - else f.castAt=s+3e3; - else f.fSet&&!f.fly&&s>=f.recastAt&&(f.fSet=!1,f.castAt=s+650); - if(f.fly||(f.fAlpha+=((f.fSet?1:0)-f.fAlpha)*Math.min(1,5*i)),f.float.visible=f.fAlpha>.02,f.float.visible){ - let t,e; - if(f.fly){ - const i=Math.min(1,(s-f.fly.t0)/480),n=4*(14+.12*Math.hypot(f.fx-f.fly.x0,f.fy-f.fly.y0))*i*(1-i); - t=f.fly.x0+(f.fx-f.fly.x0)*i,e=f.fly.y0+(f.fy-f.fly.y0)*i-n,f.float.rotation=0,i>=1&&(f.fly=null,this.ripples.push({ - x:f.fx,y:f.fy,age:0,life:1.2,r0:3,r1:14,alpha:.32} - ))} - else{ - const s=UDi(f.fx,f.fy,c,this.zone); - t=s.x,e=s.y,f.float.rotation=s.rotation,f.fSet&&Math.random()<.08*i&&this.ripples.push({ - x:t,y:e,age:0,life:2.1,r0:4,r1:13,alpha:.16*f.fAlpha} - )} - f.float.position.set(t,e),f.float.alpha=f.fAlpha*f.alpha/aFi; - const n=Math.atan2(f.fy-b,f.fx-M); - f.crew.rotation=lFi(n+Math.PI/2,v)*Math.min(1,1.5*f.fAlpha); - const h=M+9*Math.cos(n),r=b+9*Math.sin(n); - a.moveTo(h,r).quadraticCurveTo((h+t)/2,(r+e)/2+9,t,e-3).stroke({ - color:16053480,width:.45,alpha:.45*f.float.alpha} - )} - else f.crew.rotation*=Math.max(0,1-3*i); - f.dist=Math.hypot(t.x-this.bx,t.y-this.by),f.px=f.sp.x,f.py=f.sp.y} - const u=[...this.others.values()].filter(t=>t.sp.visible&&"leave"!==t.mode).sort((t,i)=>t.dist-i.dist); - for(const d of this.others.values())"leave"===d.mode&&(d.name.visible=!1); - u.forEach((t,i)=>{ - const e=s-t.catchAt<4e3; - t.name.visible=i<6||e,t.name.visible&&(t.name.position.set(t.px-t.name.width/2,t.py-34),t.name.alpha=t.a.fx&&t.a.fx>Date.now()?1:(e?1:.7)*t.alpha/aFi)} - ),this.drawPlunder(t)} - setFixing(t){ - this.repairFx.setMine(t?{ - broken:t.broken,progress:t.progress??0} - :null); - const i=!!t; - i&&!this.fixingNow&&(this.hideRodBalloon(),this.reelIn(),this.afterFixAt=0),!i&&this.fixingNow&&(this.afterFixAt=performance.now()+1600),this.fixingNow=i} - repairStarted(){ - this.repairFx.markFresh()} - repairFinished(){ - this.repairFx.finish()} - drawFixing(t){ - const i=NAi.gear(),s=128+i.info.angler[0].body[1],e=Date.now(),n=[]; - for(const[h,r]of this.others){ - const t=i.info.boats[NAi.boatArt(r.a.b)]; - if(r.a.fx&&r.a.fx>e&&r.sp.visible&&"leave"!==r.mode&&r.alpha>.2){ - const i=r.sp.rotation,s=r.sp.scale.x; - n.push({ - id:h,broken:!!r.a.fk,face:i,x:r.sp.x+(t.seat[0]*Math.cos(i)-t.seat[1]*Math.sin(i))*s,y:r.sp.y+(t.seat[0]*Math.sin(i)+t.seat[1]*Math.cos(i))*s} - )} - else r.fixing&&(r.fixing=!1,r.crew.texture=GLi(r.crew.texture),r.crew.anchor.y=s/256,r.crew.position.set(t.seat[0],t.seat[1]))} - this.repairFx.update({ - x:this.angler.x,y:this.angler.y,face:this.anglerRot} - ,{ - sprite:this.boat} - ,n); - for(const h of n){ - const t=this.others.get(h.id),e=this.repairFx.crewFor(h.id); - if(!t||!e)continue; - const n=i.info.boats[NAi.boatArt(t.a.b)]; - t.fixing=!0,t.crew.texture=LLi(t.crew.texture,e.crop),t.crew.anchor.y=DLi(s,e.crop),t.crew.rotation=0,t.crew.position.set(n.seat[0],n.seat[1]-e.lean/Math.max(.01,t.sp.scale.y))} - } - cameraShake(t,i){ - this.shakeAmp=Math.max(t,performance.now()<this.shakeUntil?this.shakeAmp:0),this.shakeUntil=Math.max(this.shakeUntil,performance.now()+i)} - boatHit(t,i=!1){ - this.rockUntil=performance.now()+(i?2600:t>0?1800:900),this.splash(this.bx,this.by+6,i?18:t>0?10:5,15004914,i?30:t>0?20:10),i?this.floatTag("고장!",16739179,this.bx,this.by-70):this.floatTag(t>0?`내구도 −${ - rTi(t)} - `:"끄떡없음",t>0?16751752:8378016,this.bx,this.by-64)} - monsterWave(t,i,s,e=!1,n){ - return new Promise(h=>this.waves.push({ - t:0,from:{ - x:t.x,y:t.y} - ,tail:n??{ - x:t.x,y:t.y} - ,size:MBi(i),blocked:s<=0,dmg:s,broke:e,done:h} - ))} - expectWave(){ - var i; - return null==(i=this.waveWait)||i.resolve(!1),new Promise(i=>{ - const s=setTimeout(()=>{ - var t; - (null==(t=this.waveWait)?void 0:t.timer)===s&&(this.waveWait=null),i(!1)} - ,2500/t.fxSpeed); - this.waveWait={ - resolve:Qt(t=>{ - clearTimeout(s),this.waveWait=null,i(t)} - ,"resolve"),timer:s} - } - )} - waveStep(i){ - var s; - const e=this.waveG.clear(); - let n=0,h=0,r=0; - for(const o of this.waves){ - const a=o.t,c=o.t+=i*t.fxSpeed,l={ - x:this.bx,y:this.by} - ,u=l.x-o.from.x,d=l.y-o.from.y,f=Math.max(1,Math.hypot(u,d)),p=u/f,w=d/f,g=CBi(a,c,o.size,o.blocked); - g.crown&&this.splash(o.tail.x,o.tail.y,Math.round(o.size.burst/2),15004914,.7*o.size.crown); - const m=SBi(c,o.size,o.blocked); - if(m){ - const s=o.from.x+28*p,n=o.from.y+28*w,h=l.x-16*p,r=l.y-16*w,a=s+(h-s)*m.p,c=n+(r-n)*m.p,u=-w,d=p,f=m.half; - e.moveTo(a-26*p+u*f*.92,c-26*w+d*f*.92).quadraticCurveTo(a+6*p,c+6*w,a-26*p-u*f*.92,c-26*w-d*f*.92).lineTo(a-2*p-u*f,c-2*w-d*f).quadraticCurveTo(a+10*p,c+10*w,a-2*p+u*f,c-2*w+d*f).closePath().fill({ - color:15267830,alpha:.22*m.alpha} - ),e.moveTo(a-6*p+u*f,c-6*w+d*f).quadraticCurveTo(a+12*p,c+12*w,a-6*p-u*f,c-6*w-d*f).stroke({ - color:16777215,width:2+f/20,alpha:.95*m.alpha,cap:"round"} - ); - for(let t=0; - t<9; - t++){ - const i=2*(t/8-.5),s=3-9*i*i+4*(BAi(31*t+7)%100/100-.5); - e.circle(a+p*s+u*i*f,c+w*s+d*i*f,1.4+BAi(17*t+3)%100/70).fill({ - color:16777215,alpha:.9*m.alpha} - )} - Math.random()<30*i&&this.addFoam(a-10*p+u*(Math.random()-.5)*f*1.4,c-10*w+d*(Math.random()-.5)*f*1.4,1.2+1.4*Math.random(),.6/t.fxSpeed,.45*m.alpha)} - if(g.hit){ - const i={ - x:l.x-14*p,y:l.y-14*w} - ; - if(o.blocked)this.splash(i.x-30*p,i.y-30*w,6,15004914,14),this.floatTag("끄떡없음",8378016,this.bx,this.by-64); - else{ - this.crowns.push({ - x:i.x,y:i.y,age:0,life:.55/t.fxSpeed,size:o.size.crown,t:Math.floor(4*Math.random()),rot:Math.random()*Math.PI*2} - ); - const s=Math.atan2(-w,-p); - for(let e=0; - e<o.size.burst; - e++){ - const e=s+2.2*(Math.random()-.5),n=(25+45*Math.random())*t.fxSpeed; - this.particles.push({ - x:i.x,y:i.y,vx:Math.cos(e)*n,vy:Math.sin(e)*n*.6,z:0,vz:(60+60*Math.random())*t.fxSpeed,life:.65/t.fxSpeed,age:0,size:1.2+Math.random(),color:15004914} - )} - o.broke||this.floatTag(`내구도 −${ - rTi(o.dmg)} - `,16751752,this.bx,this.by-64),o.size.shake&&this.cameraShake(o.size.shake,180/t.fxSpeed),YG(o.size.shake>=2?"heavy":"medium"); - try{ - QG.getInstance().playSFX(QG.SFX_STONE_BREAK,.25+.1*o.size.shake)} - catch{ - } - } - null==(s=this.waveWait)||s.resolve(!0)} - const v=TBi(c,o.size,o.blocked); - n+=p*v.push,h+=w*v.push,r+=v.rot,g.done&&o.done()} - this.waves=this.waves.filter(t=>t.t<=EBi(t.size,t.blocked)+1.2),this.waveKick={ - dx:n,dy:h,rot:r} - } - bossGiant(t){ - if(this.giants.length)return!0; - for(const i of[!0,!1,!1])if(this.spawnGiant(i,t)||this.spawnGiant(i))return!0; - return!1} - get fxSpeed(){ - return t.fxSpeed} - defeatBoss(i){ - const s=this.giants.find(t=>!t.leaving&&t.vanish<.5)??this.giants[0]; - return s?s.defeat?new Promise(t=>{ - const i=s.defeat.done; - s.defeat.done=()=>{ - i(),t(!0)} - } - ):(this.nextGiantAt=Math.max(this.nextGiantAt,performance.now()+6e4),new Promise(e=>{ - var n; - let h=!1; - s.defeat={ - t:0,dir:t.trailDir(s.trail,s,.18*s.L,.13*s.L),drift:0,base:(null==(n=s.flinch)?void 0:n.base)??s.view.tint,pose:null,done:Qt(()=>{ - var t; - if(!h){ - if(h=!0,null==(t=s.defeat)?void 0:t.onCard){ - const t=s.defeat.onCard; - s.defeat.onCard=void 0,t()} - e(!0)} - } - ,"done"),onCard:i} - } - )):(null==i||i(),Promise.resolve(!1))} - defeatStep(i,s,e){ - const n=i.defeat,h=n.t; - n.t+=e*t.fxSpeed; - const r=wBi(n.t),o=gBi(h,n.t),a=r.drift-n.drift; - n.drift=r.drift,n.pose=r,i.x=s.x+Math.cos(n.dir)*a,i.y=s.y+Math.sin(n.dir)*a,i.dir=s.dir,i.w=0,i.phase=s.phase+(i.phase-s.phase)*r.rate*t.fxSpeed,i.leaving=!1,i.vanish=0; - const c=t.trailAt(i.trail,i,.5*i.L); - for(const l of o.rings)this.ripples.push({ - x:c.x,y:c.y,age:0,life:l.life/t.fxSpeed,r0:l.r0,r1:l.r1,alpha:l.alpha} - ); - for(let t=0; - t<o.splashes; - t++)this.splash(c.x,c.y,6,15004914,24); - for(const l of o.bubbles){ - const i=BAi(7919*l+13)/4294967296*Math.PI*2,s=10+BAi(104729*l+7)%30; - this.addFoam(c.x+Math.cos(i)*s,c.y+Math.sin(i)*s*.8,1.6+l%3,1.1/t.fxSpeed,.6,0,-14*t.fxSpeed)} - if(o.shake&&this.cameraShake(uBi.SHAKE_PX,uBi.SHAKE_MS/t.fxSpeed),o.card&&n.onCard){ - const t=n.onCard; - n.onCard=void 0,t()} - r.done&&(i.vanish=1,n.done())} - defeatLook(t){ - const i=t.defeat,s=i.pose,e=s.scale/.5; - t.view.setFromMatrix((new Ci).scale(e,e).rotate(-i.dir).scale(1,s.squash).rotate(i.dir+s.rot).translate(t.view.x,t.view.y)),t.view.tint=mBi(mBi(i.base,uBi.BELLY,s.belly),16777215,.75*s.flash),t.view.alpha*=s.alpha*(1+.5*s.belly),t.blur&&(t.blur.strength+=s.blur)} - defeatWarp(t,i,s){ - var e; - const n=null==(e=t.defeat)?void 0:e.pose; - if(!n)return{ - x:i,y:s,rot:0} - ; - const h=t.defeat.dir,r=Math.cos(h),o=Math.sin(h),a=(i*r+s*o)*n.scale,c=(-i*o+s*r)*n.scale*n.squash,l=h+n.rot; - return{ - x:a*Math.cos(l)-c*Math.sin(l),y:a*Math.sin(l)+c*Math.cos(l),rot:n.rot} - } - get hasBossShadow(){ - return this.giants.some(t=>!t.leaving&&t.vanish<.5)} - bossShadow(t){ - const i=this.giants.find(t=>!t.leaving&&t.vanish<.5&&!t.defeat); - if(!i)return null; - const s=-this.world.x+this.viewW/2,e=-this.world.y+this.viewH/2; - let n=Math.hypot(i.x-this.bx,i.y-this.by),h=!1; - const r=i.trail.slice(-Math.ceil(i.L/4)); - for(let o=0; - o<r.length; - o+=3){ - const t=r[o]; - n=Math.min(n,Math.hypot(t.x-this.bx,t.y-this.by)),Math.abs(t.x-s)<this.viewW/2-10&&Math.abs(t.y-e)<this.viewH/2-10&&(h=!0)} - return Math.abs(i.x-s)<this.viewW/2&&Math.abs(i.y-e)<this.viewH/2&&(h=!0),h=h&&i.view.alpha>.12,{ - near:h&&n<=t,dist:n,seen:h} - } - bossPoint(){ - const t=this.giants.find(t=>!t.leaving); - if(!t)return{ - x:this.bx+40,y:this.by-110} - ; - let i={ - x:t.x,y:t.y} - ,s=Math.hypot(t.x-this.bx,t.y-this.by); - for(const e of t.trail.slice(-Math.ceil(t.L/4))){ - const t=Math.hypot(e.x-this.bx,e.y-this.by); - t<s&&(s=t,i=e)} - return{ - x:i.x,y:i.y} - } - harpoonBodyPoint(i,s){ - var e; - const n={ - alpha:i.view.alpha,tint:i.view.tint,blur:(null==(e=i.blur)?void 0:e.strength)??.35+i.depth*i.depth*4} - ,h=iDi(i,s); - if(h){ - const t=this.defeatWarp(i,h.x,h.y); - return{ - ...h,x:i.view.x+t.x,y:i.view.y+t.y,angle:h.angle+t.rot,...n} - } - const r=i.L*(1+.06*(1-i.depth)),o=r*s,a=t.trailAt(i.trail,i,o); - let c=a.x,l=a.y,u=t.trailDir(i.trail,i,o,.06*r); - if(i.rig){ - const e=t.trailDir(i.trail,i,.18*r,.13*r),n=t.trailAt(i.trail,i,.2*r),h=gDi(i.kind,s),d=n.x-Math.cos(e)*(o-.2*r),f=n.y-Math.sin(e)*(o-.2*r); - c=d+(a.x-d)*h,l=f+(a.y-f)*h,u=e+lFi(u,e)*h} - else if(!i.spine){ - const t=JUi[i.kind],e=t.amp*r*Math.pow(s,t.tailPow)*Math.sin(i.phase-s*t.wave); - c-=Math.sin(a.a)*e,l+=Math.cos(a.a)*e} - return{ - x:c,y:l,angle:u,...n} - } - captureHarpoonTarget(t){ - var i; - const s=this.giants.find(t=>!t.leaving&&t.vanish<.5&&t.view.alpha>.12&&!t.defeat); - if(!s||!(null==(i=this.bossShadow(t))?void 0:i.near))return null; - let e=.35,n=1/0; - for(let o=.18; - o<=.66; - o+=.04){ - const i=this.harpoonBodyPoint(s,o),h=Math.hypot(i.x-this.bx,i.y-this.by),r=i.x+this.world.x,a=i.y+this.world.y,c=h+3*Math.max(0,64-h); - h<=t&&c<n&&r>=12&&r<=this.viewW-12&&a>=12&&a<=this.viewH-12&&(n=c,e=o)} - if(!Number.isFinite(n))return null; - const h=this.harpoonBodyPoint(s,e),r=(this.bx-h.x)*-Math.sin(h.angle)+(this.by-h.y)*Math.cos(h.angle)>=0?1:-1; - return{ - point:h,sample:Qt(()=>s.view.destroyed?null:this.harpoonBodyPoint(s,e),"sample"),missOffset:r*Math.max(44,Math.min(100,.3*s.L)),hit:Qt((t=1)=>{ - var i; - if(s.view.destroyed)return; - s.effort=Math.min(1,s.effort+.025); - const e=YLi(r); - s.flinch={ - at:performance.now(),power:t,dx:e.x,dy:e.y,base:(null==(i=s.flinch)?void 0:i.base)??s.view.tint} - } - ,"hit")} - } - get harpoonBusy(){ - return this.harpoonFxs.some(t=>!t.destroyed&&!t.landed)} - cancelHarpoon(){ - for(const t of this.harpoonFxs)t.cancel(); - this.harpoonFxs=[],this.setAimMark(null),this.line.destroyed||(this.line.visible=!0)} - setAimMark(t,i=16777215,s=0,e=!1){ - var n; - if(!t)return null==(n=this.aimMark)||n.destroy(),void(this.aimMark=null); - this.aimMark&&!this.aimMark.destroyed||(this.aimMark=new ep,this.aimMark.eventMode="none",this.worldTop.addChild(this.aimMark)); - const h=e?9:16-7*Math.max(0,Math.min(1,s)),r=this.aimMark.clear(); - r.circle(0,0,h).stroke({ - color:399649,width:4,alpha:.45} - ).circle(0,0,h).stroke({ - color:i,width:2,alpha:.95} - ); - for(let o=0; - o<4; - o++){ - const t=o*Math.PI/2+Math.PI/4,s=Math.cos(t),e=Math.sin(t); - r.moveTo(s*(h+3),e*(h+3)).lineTo(s*(h+9),e*(h+9)).stroke({ - color:i,width:2,alpha:.9} - )} - r.circle(0,0,1.6).fill(i),r.position.set(t.x,t.y)} - harpoonStrike(t,i,s,e,n={ - } - ){ - if(!this.running||this.harpoonBusy)return Promise.resolve(!1); - this.setAimMark(null); - const h=new ZLi(t,i,s,e,{ - release:n.release,impact:Qt((t=0)=>{ - var i; - const s=XLi(t); - s.amp&&this.cameraShake(s.amp,s.ms),null==(i=n.impact)||i.call(n,t)} - ,"impact")} - ,()=>({ - x:12-this.world.x,y:12-this.world.y,width:this.viewW-24,height:this.viewH-24} - )); - return this.harpoonFxs.push(h),this.giantLayer.addChild(h.underwater),this.hitLayer.addChild(h),this.worldTop.addChild(h.result),h.done} - helpFx(t,i=null,s="수리 +3%"){ - const e=Qt(()=>{ - if("me"===t)return{ - x:this.angler.x,y:this.angler.y-8} - ; - const i=this.boatPoint(t); - return i?{ - x:i.x,y:i.y-8} - :null} - ,"target"),n=i?this.boatPoint(i):"me"===t?null:this.boatPoint("me"); - this.repairFx.help(n?{ - x:n.x,y:n.y-20} - :null,e,()=>{ - const i=e(); - i&&("me"===t&&this.repairFx.helpPunch(),this.floatTag(s,16106577,i.x,i.y-64))} - )} - otherAlpha(t){ - return t.a.a?.62*aFi:aFi} - static otherName(t){ - return t.fx&&t.fx>Date.now()?dRi(`${ - t.fk?"고장":"수리 중"} - · ${ - t.n} - `,16777215,t.fk?11879211:10115614,10,5):dRi(t.a?`Zz ${ - t.n} - `:t.n,t.a?13096664:16777215,Vxi,10,5)} - otherAt(t,i){ - let s=null,e=30; - for(const n of this.others.values()){ - if(!n.sp.visible||"leave"===n.mode||n.alpha<.2)continue; - const h=Math.hypot(t-n.x,i-n.y); - h<=e&&(e=h,s=n)} - return s} - boatPoint(t){ - if("me"===t)return{ - x:this.bx,y:this.by} - ; - const i=this.others.get(t); - return i&&"leave"!==i.mode?{ - x:i.x,y:i.y} - :null} - setPlunder(t,i){ - this.ropes=t,this.plunderFocus=i} - drawPlunder(t){ - const i=this.plunderG.clear(),s=t/1e3,e=Qt(t=>{ - if("me"===t)return{ - x:this.boat.x,y:this.boat.y} - ; - const i=this.others.get(t); - return i&&i.sp.visible?{ - x:i.sp.x,y:i.sp.y} - :null} - ,"at"); - for(const n of this.ropes){ - const t=e(n.from),h=e(n.to); - if(!t||!h)continue; - const r=n.tension??0,o=n.tp??0,a=Math.hypot(h.x-t.x,h.y-t.y),c=Math.min(26,6+.08*a)*(1+.15*Math.sin(1.7*s))*(1-.18*r*o),l=r?Math.sin(s*(28+8*r))*(1.2+1.4*r)*(.4+o):0,u=-(h.y-t.y)/(a||1),d=(h.x-t.x)/(a||1),f=(t.x+h.x)/2+u*l,p=(t.y+h.y)/2+c+d*l,w=r>=3?16739211:2===r?16106577:1===r?14862735:13213802; - if(r>=2&&i.moveTo(t.x,t.y).quadraticCurveTo(f,p,h.x,h.y).stroke({ - color:w,width:6+2*Math.sin(10*s),alpha:.22+.2*o} - ),i.moveTo(t.x,t.y).quadraticCurveTo(f,p,h.x,h.y).stroke({ - color:2759182,width:3.2,alpha:.55} - ),i.moveTo(t.x,t.y).quadraticCurveTo(f,p,h.x,h.y).stroke({ - color:w,width:1.6+(r>=2?.8:0),alpha:.95} - ),r&&Math.random()<.05*r*(.5+o)){ - const i=Math.random()*Math.PI*2,s=14+18*Math.random(),e="me"===n.to?t:h; - this.ripples.push({ - x:e.x+Math.cos(i)*s,y:e.y+Math.sin(i)*s,age:0,life:.7,r0:3,r1:10+3*r,alpha:.45} - )} - const g=Math.atan2(h.y-p,h.x-f); - i.arc(h.x-6*Math.cos(g),h.y-6*Math.sin(g),5,g-.4,g+.9*Math.PI).stroke({ - color:14673640,width:1.6,alpha:.9} - )} - if(this.drawSnaps(i),this.plunderFocus){ - const t=e(this.plunderFocus); - if(t){ - const e=1+.06*Math.sin(3*s); - i.circle(t.x,t.y,30*e).stroke({ - color:Dxi,width:2,alpha:.85} - ),i.circle(t.x,t.y,30*e+5).stroke({ - color:Dxi,width:1,alpha:.3} - )} - } - } - plunderFly(t,i,s,e){ - const n=this.boatPoint(t),h=this.boatPoint(i); - if(!n||!h)return; - let r,o=null,a=1; - if(s){ - if(r=new Ke,o=new Xe(NAi.fish(s.id)),o.anchor.set(.5),a=40/Math.max(o.texture.width,o.texture.height,1),o.scale.set(h.x<n.x?-a:a,a),r.addChild(o),s.grade>=1){ - const t=dRi(["","B","A","S"][s.grade],16777215,Yxi[s.grade],9,4); - t.position.set(10,-22),r.addChild(t)} - } - else r=(new ep).ellipse(0,0,9,4.5).fill(12178652).ellipse(0,0,9,4.5).stroke({ - color:2373180,width:1.2} - ).poly([-8,0,-14,-5,-14,5]).fill(12178652).circle(5,-1,1.1).fill(1778727); - r.eventMode="none",this.flyLayer.addChild(r); - const c=Math.hypot(h.x-n.x,h.y-n.y),l=Math.min(26,6+.08*c),u={ - t:0} - ; - yx.to(u,{ - t:1,duration:1.1,ease:"power1.inOut",onUpdate:Qt(()=>{ - const t=u.t,i=(n.x+h.x)/2,s=(n.y+h.y)/2+l,e=(1-t)*(1-t)*n.x+2*(1-t)*t*i+t*t*h.x,a=(1-t)*(1-t)*n.y+2*(1-t)*t*s+t*t*h.y-10*Math.sin(t*Math.PI); - r.position.set(e,a),o?(r.scale.set(.85+.35*Math.sin(t*Math.PI)),o.rotation=.25*Math.sin(22*t)):r.rotation=Math.atan2(h.y-n.y,h.x-n.x)+.35*Math.sin(18*t)} - ,"onUpdate"),onComplete:Qt(()=>{ - r.destroy({ - children:!0} - ),this.splash(h.x,h.y,4,15004914,10); - const t=this.boatPoint(i)??h; - s&&s.grade>=2&&(this.burst(t.x,t.y,s.grade>=3?26:14,Yxi[s.grade]),this.splash(t.x,t.y,8,16777215,20)),e&&this.floatTag(e.text,e.color,t.x,t.y-64)} - ,"onComplete")} - ),this.splash(n.x,n.y,3,15004914,8)} - ropeSnap(t,i){ - this.snaps.push({ - a:t,b:i,t0:performance.now()} - ); - const s=this.boatPoint(t),e=this.boatPoint(i); - s&&e&&this.splash((s.x+e.x)/2,(s.y+e.y)/2+12,8,15004914,18)} - drawSnaps(t){ - const i=performance.now(); - this.snaps=this.snaps.filter(t=>i-t.t0<900); - for(const s of this.snaps){ - const e=this.boatPoint(s.a),n=this.boatPoint(s.b); - if(!e||!n)continue; - const h=(i-s.t0)/900,r=1-h,o=(e.x+n.x)/2,a=(e.y+n.y)/2,c=6+26*h,l=30*h; - for(const[i,s]of[[e,-1],[n,1]]){ - const e=o+s*c,n=a+l; - t.moveTo(i.x,i.y).quadraticCurveTo((i.x+e)/2,(i.y+n)/2+10+.5*l,e,n).stroke({ - color:13213802,width:1.6,alpha:r} - )} - } - } - sailNearBoat(t){ - const i=this.boatPoint(t); - if(!i)return!1; - const s=Math.atan2(this.by-i.y,this.bx-i.x); - for(let e=0; - e<12; - e++){ - const t=s+(e%2?1:-1)*Math.ceil(e/2)*.5,n=i.x+85*Math.cos(t),h=i.y+85*Math.sin(t); - if(!this.isLand(n,h)&&("sail"!==this.mode&&this.setMode("sail"),this.sailTo(n,h)))return this.hideRodBalloon(),this.marker(n,h,Dxi),!0} - return!1} - otherCatch(t,i,s,e=0){ - const n=performance.now(),h=this.otherPos(t,n),r=new Xe(NAi.fish(i)); - r.anchor.set(.5),r.width=r.height=30; - const o=dRi(`★${ - NTi(i)} - ${ - MCi(e)} - ${ - t.a.n} - `,16777215,e>=2?Yxi[e]:zxi[NTi(i)],10,6); - o.position.set(h.x-o.width/2,h.y-70),this.flyLayer.addChild(r,o); - const a={ - h:0} - ; - yx.timeline({ - onComplete:Qt(()=>{ - r.destroy(),o.destroy({ - children:!0} - )} - ,"onComplete")} - ).to(a,{ - h:1,duration:.7,ease:"none",onUpdate:Qt(()=>{ - r.position.set(h.x+18*a.h,h.y-240*a.h*(1-a.h)+10),r.rotation=1.2*(a.h-.5)} - ,"onUpdate")} - ).from(o,{ - alpha:0,y:o.y+8,duration:.25} - ,0).to([r,o],{ - alpha:0,duration:.5} - ,2.2),this.splash(h.x+10,h.y,5,15004914,16),(s>=5||3===e)&&this.burst(h.x,h.y,14,3===e?Yxi[3]:zxi[5])} - waterAround(t){ - const i=[],s=[90,520,120]; - for(let e=0; - e<t; - e++){ - const t=s[e%s.length]; - for(let s=0; - s<24; - s++){ - const n=2.1*e+.55*s,h=this.bx+Math.cos(n)*t,r=this.by+Math.sin(n)*t; - if(!(this.isLand(h,r)||this.info&&(h<0||r<0||h>this.info.w||r>this.info.h))){ - i.push({ - x:Math.round(h),y:Math.round(r),p:eDi.at(this.key,h,r)} - ); - break} - } - } - return i} - sampleWater(t){ - var i; - const s=(null==(i=this.info)?void 0:i.points)??[],e=[],n=this.info; - for(let h=0; - e.length<t&&h<60*t; - h++){ - let t,i; - if(Math.random()<.4){ - const e=s[Math.floor(Math.random()*s.length)],h=Math.random()*Math.PI*2,r=60+Math.random()*(n.w>1500?380:200); - t=e.x+Math.cos(h)*r,i=e.y+Math.sin(h)*r} - else t=Math.random()*n.w,i=Math.random()*n.h; - this.isLand(t,i)||e.push({ - x:Math.round(t),y:Math.round(i),p:eDi.at(this.key,t,i)} - )} - return e} - get loadedChunks(){ - return[...this.chunks.values()].filter(Boolean).length} - setTutorial(t){ - this.tut=t,this.layoutView(),this.tutorialMoveBtn=!1,this.tutorialRing=null; - for(const i of[this.othersLayer,this.othersFloats,this.othersLines,this.otherNames,this.othersWater,this.plunderG])i.visible=!t; - t?this.applyTutorialHud():(this.modeBtn.visible=!0,this.miniMap.visible=!this.bigMap.visible)} - get inTutorial(){ - return this.tut} - applyTutorialHud(){ - this.hud.visible=!0,this.hud.alpha=1,this.hint.visible=!1,this.goalArrow.visible=!1,this.miniMap.visible=!1,this.modeBtn.visible=this.tutorialMoveBtn} - tutorialSail(t,i){ - return!(!this.info||(this.isLand(t,i)?(this.marker(t,i,16751752),1):("sail"!==this.mode&&this.setMode("sail"),!this.sailTo(t,i)||(this.marker(t,i,16777215),this.hideRodBalloon(),0))))} - tutorialTapRod(){ - return!!this.rodBalloonOn&&(this.hideRodBalloon(),this.arrive(),!0)} - tutorialModeTap(){ - "fish"===this.mode&&this.setMode("sail")} - get moving(){ - return!!this.target} - worldToGlobal(t,i){ - return this.world.toGlobal({ - x:t,y:i} - )} - globalToWorld(t){ - return this.world.toLocal(t)} - get boatWorld(){ - return{ - x:this.bx,y:this.by} - } - get pointNow(){ - return this.point} - get rodBalloonCenter(){ - return this.rodBalloonOn?{ - x:this.rodBalloon.x,y:this.rodBalloon.y+-24.8} - :null} - get modeButton(){ - return this.modeBtn} - tutorialSpot(t,i,s,e,n){ - if(!this.info)return null; - const h=this.viewW,r=this.viewH,o=this.world.x,a=this.world.y,c=Qt((t,i)=>{ - const s=t+o,c=i+a; - if(s<44||s>h-44||c<e+36||c>r-n-36)return!1; - if(this.isLand(t,i)||this.shoreDist(t,i)<50)return!1; - for(const e of this.hubPlaces.values())if(Math.abs(e.x-t)<130&&i>e.y-175&&i<e.y+80)return!1; - for(const e of this.labels.children)if(Math.abs(e.x+e.width/2-t)<e.width/2+40&&Math.abs(e.y+e.height/2-i)<50)return!1; - if(eDi.at(this.key,t,i)!==this.point)return!1; - const l=Math.hypot(t-this.bx,i-this.by); - for(let e=12; - e<l; - e+=12){ - const s=this.bx+(t-this.bx)*e/l,n=this.by+(i-this.by)*e/l; - if(this.isLand(s,n)||this.shoreDist(s,n)<22)return!1} - return!0} - ,"ok"); - for(const l of[s,(i+s)/2,i])for(const i of t){ - const t=i*Math.PI/180,s=this.bx+Math.cos(t)*l,e=this.by+Math.sin(t)*l; - if(c(s,e))return{ - x:s,y:e} - } - return null} - buildRodBalloon(){ - const t=this.rodBalloon; - this.rodBubble.anchor.set(.5,gAi),this.rodBubble.scale.set(.2),t.addChild(this.rodBubble),t.eventMode="none",t.visible=!1} - showRodBalloon(){ - if(!this.fixingNow){ - if(!this.castSpot())return this.hideRodBalloon(),void(this.hubs.some(t=>this.hubNear(t.id))||this.showHint(CUi,!0)); - this.rodBalloonOn=!0,this.rodBalloon.visible=!0,this.rodBubble.texture===ls.EMPTY&&(this.rodBubble.texture=NAi.gear().bubbles[2]),yx.killTweensOf(this.rodBalloon.scale),yx.fromTo(this.rodBalloon.scale,{ - x:.2,y:.2} - ,{ - x:1,y:1,duration:.32,ease:"back.out(3)"} - ),YG("light"),this.showHint("낚싯대 풍선을 누르면 낚시 시작 · 물을 누르면 그곳으로 가요",!1,!0)} - } - hideRodBalloon(){ - this.rodBalloonOn=!1,this.rodBalloon.visible=!1} - drawRodBalloon(t){ - if(!this.rodBalloonOn)return; - this.rodBalloon.position.set(this.bx,this.by-44+2.5*Math.sin(t/320)); - const i=t%1600/1600; - yx.isTweening(this.rodBalloon.scale)||this.rodBubble.scale.set(.2*(1+(i<.18?.08*Math.sin(i/.18*Math.PI):0)))} - rodBalloonHit(t,i){ - return this.rodBalloonOn&&Math.hypot(t-this.rodBalloon.x,i-(this.rodBalloon.y+-24.8))<=30} - dock(){ - var t; - this.dockAt=performance.now()+2e3,this.dockShown=0,this.hint.visible=!1; - const i=this.hubs.find(t=>("offer"===t.state||"ready"===t.state)&&this.hubNear(t.id)); - i&&(null==(t=this.onHubArrive)||t.call(this,i.id))} - castSpot(){ - if(!this.boatCanFish())return null; - const t=this.heading; - for(const i of[80,110,140,60])for(let s=0; - s<16; - s++){ - const e=t+(s%2?1:-1)*Math.ceil(s/2)*(Math.PI/8),n=this.bx+Math.cos(e)*i,h=this.by+Math.sin(e)*i; - if(this.floatOk(n,h)&&!this.isLand((this.bx+n)/2,(this.by+h)/2))return{ - x:n,y:h} - } - return null} - landWithin(t,i,s){ - if(this.isLand(t,i))return!0; - for(const e of[.5*s,s])for(let s=0; - s<16; - s++){ - const n=s*Math.PI/8; - if(this.isLand(t+Math.cos(n)*e,i+Math.sin(n)*e))return!0} - return!1} - pierDist(t,i){ - let s=1/0; - for(const e of this.hubPlaces.values()){ - if(e.ship)continue; - const n=e.x,h=e.y-4,r=Math.atan2(e.dy-e.y,e.dx-e.x),o=Math.hypot(e.dx-e.x,e.dy-e.y)-6,a=Math.cos(r),c=Math.sin(r),l=Math.max(-4,Math.min(o,(t-n)*a+(i-h)*c)); - s=Math.min(s,Math.hypot(t-(n+a*l),i-(h+c*l))-13)} - return s} - floatOk(t,i){ - return!this.landWithin(t,i,56)&&this.pierDist(t,i)>=36} - boatCanFish(t=this.bx,i=this.by){ - return!this.landWithin(t,i,110)&&this.pierDist(t,i)>=90} - arrive(){ - var t; - const i=this.castSpot(); - if(!i)return this.hideRodBalloon(),void this.showHint(CUi,!0); - this.setMode("fish"); - const s=this.nearestPoint(); - this.cast(i.x,i.y,!1,s===this.point),s!==this.point&&(this.point=s,this.pointSyncUntil=performance.now()+4e3,null==(t=this.onStopAtPoint)||t.call(this,s))} - splash(t,i,s,e=16777215,n=0){ - n>0&&this.crowns.push({ - x:t,y:i,age:0,life:.55,size:n,t:Math.floor(4*Math.random()),rot:Math.random()*Math.PI*2} - ); - for(let h=0; - h<s; - h++){ - const s=Math.random()*Math.PI*2,n=20+40*Math.random(); - this.particles.push({ - x:t,y:i,vx:Math.cos(s)*n,vy:Math.sin(s)*n*.6,z:0,vz:60+60*Math.random(),life:.6,age:0,size:1.2+Math.random(),color:e} - )} - this.ripples.push({ - x:t,y:i,age:0,life:.9,r0:4,r1:20,alpha:.7} - )} - playCatch(t,i,s){ - if(this.resolveNibbler("어류"===DTi(t.id).kind),this.sailing)return this.catchAboard(t,i); - if(this.reel||performance.now()<this.busyUntil)return t.broken||this.tag(`${ - DTi(t.id).name} - ${ - MCi(t.grade??0)} - ${ - TCi(t.kg)} - `,16777215),.3; - const e=DTi(t.id),n=t.grade??0,h=t.broken?1:t.star>=5||3===n?4:4===t.star||2===n?3:3===t.star||i?2:1,r={ - x:this.bx,y:this.by} - ,o=this.floatVisible?{ - ...this.fxp} - :{ - x:this.bx-70*Math.sin(this.heading),y:this.by+70*Math.cos(this.heading)} - ,a=this.floatVisible&&!this.sailing; - this.floatVisible=!1,this.splash(o.x,o.y,8+3*h,15004914,22+5*h),YG(h>=3?"medium":"light"); - const c=Math.max(1,Math.hypot(r.x-o.x,r.y-o.y)),l=(r.x-o.x)/c,u=(r.y-o.y)/c,d=c>34?{ - x:r.x-22*l,y:r.y-22*u} - :{ - ...o} - ,f=new oGi("fish"),p=96*(.2+.025*h); - f.tint=665137,f.alpha=.5,f.swim(p,0,1),this.shadowLayer.addChild(f); - const w={ - p:0} - ,g=Qt((t,i,s)=>{ - this.reel={ - x:t,y:i,level:h} - ,f.position.set(t,i),f.rotation=Math.atan2(r.y-i,r.x-t),f.swim(p,40*s,1,.25*Math.sin(9*s)),Math.random()<.7&&this.addFoam(t+9*(Math.random()-.5),i+7*(Math.random()-.5),1.6+2.6*Math.random(),1+Math.random(),.65),Math.random()<.18+.05*h&&this.splash(t,i,1),Math.random()<.08&&this.ripples.push({ - x:t,y:i,age:0,life:.9,r0:6,r1:18+3*h,alpha:.45} - )} - ,"place"),m=yx.timeline({ - onComplete:Qt(()=>{ - yx.killTweensOf(f),f.destroy(),this.catchTl===m&&(this.catchTl=null)} - ,"onComplete")} - ); - if(this.catchTl=m,this.busyUntil=1/0,t.broken){ - const t=Math.min(26,.3*c); - return m.to(w,{ - p:1,duration:.9,ease:"none",onUpdate:Qt(()=>{ - const i=9*Math.sin(w.p*Math.PI*5); - g(o.x+l*t*w.p-u*i,o.y+u*t*w.p+l*i,w.p)} - ,"onUpdate")} - ).call(()=>{ - const t=this.reel; - this.reel=null,this.splash(t.x,t.y,10,15004914,26),this.tag("줄이 끊겼다! · 더 튼튼한 낚싯줄이 필요해요",Hxi),YG("heavy"),yx.to(f,{ - x:t.x-70*l,y:t.y-70*u,alpha:0,duration:.6,ease:"power2.out"} - )} - ).to({ - } - ,{ - duration:.6} - ).call(()=>{ - this.busyUntil=0,!a||this.sailing||this.floatVisible||this.cast(o.x,o.y,!1,!1)} - ),.9} - const v=[3,3,4,5,6][h],_={ - q:0,side:0} - ,M=Qt(()=>{ - const t=performance.now()/1e3,i=Math.sin(9*t+h)*(2.5+h)*(1-.6*_.q),s=_.side+i,e=Math.max(0,Math.min(1,_.q)); - g(o.x+(d.x-o.x)*e-u*s,o.y+(d.y-o.y)*e+l*s,t/4)} - ,"upd"); - let b=0,y=0; - for(let R=0; - R<v; - R++){ - const t=R===v-1,i=t?1-b:1/v*(.85+.45*Math.random()); - b=Math.min(1,b+i); - const s=.26+.02*h; - if(m.to(_,{ - q:b,side:0,duration:s,ease:"power2.out",onUpdate:M,onStart:Qt(()=>{ - this.reelPull=!0,this.reel&&this.splash(this.reel.x,this.reel.y,2+h,15004914),h>=3&&YG("light")} - ,"onStart")} - ),y+=s,t)break; - const e=h>=3&&Math.random()<.35,n=e?.55:.3+.2*Math.random(); - b=Math.max(0,b-i*(e?.45:.15)),m.to(_,{ - q:b,side:(Math.random()<.5?-1:1)*(e?16+3*h:4+2*h),duration:n,ease:e?"power1.out":"sine.inOut",onUpdate:M,onStart:Qt(()=>{ - this.reelPull=!1} - ,"onStart")} - ),y+=n} - m.call(()=>{ - this.reelPull=!1} - ); - const E=[0,26,30,34,40][h]*OUi[t.grade??0],A=new Xe(NAi.fish(t.id)); - A.anchor.set(.5),A.width=A.height=E,A.visible=!1; - const S=(new ep).ellipse(0,0,.4*E,.18*E).fill({ - color:401450,alpha:.35} - ); - S.visible=!1,this.flyLayer.addChild(S,A); - const T=Math.hypot(r.x-d.x,r.y-d.y),C=22+.4*T+6*h,O=.42+T/400+.05*h,I={ - p:0} - ; - let k=d.x,x=d.y; - return m.call(()=>{ - this.reel=null,f.visible=!1,A.visible=S.visible=!0,this.splash(d.x,d.y,8+3*h,15004914,20+4*h),YG(h>=3?"medium":"light")} - ).to(I,{ - p:1,duration:O,ease:"none",onUpdate:Qt(()=>{ - const t=I.p,i=4*C*t*(1-t),s=d.x+(r.x-d.x)*t,e=d.y+(r.y-d.y)*t; - A.position.set(s,e-i),A.scale.set(E/100*(1+i/C*.35)); - const n=A.x-k,h=A.y-x; - Math.abs(n)+Math.abs(h)>.2&&(A.rotation=Math.sign(n||1)*Math.atan2(h,Math.abs(n))*.8),k=A.x,x=A.y,S.position.set(s,e),S.alpha=1-i/C*.6} - ,"onUpdate")} - ).call(()=>{ - this.splash(r.x,r.y,4,14207136),h>=3&&this.burst(r.x,r.y,h>=4?24:12,zxi[NTi(t.id)]),i||t.star>=4||this.tag(`${ - e.name} - ${ - MCi(t.grade??0)} - ${ - TCi(t.kg)} - `,16777215)} - ).to([A,S],{ - alpha:0,duration:.3} - ,"+=0.35").call(()=>{ - A.destroy(),S.destroy(),this.busyUntil=0,!a||this.sailing||this.floatVisible||this.cast(o.x,o.y,!1,!1)} - ),y+O} - burst(t,i,s,e){ - for(let n=0; - n<s; - n++){ - const s=Math.random()*Math.PI*2,n=40+80*Math.random(); - this.particles.push({ - x:t,y:i,vx:Math.cos(s)*n,vy:Math.sin(s)*n,z:10,vz:40+60*Math.random(),life:.8,age:0,size:1.5+1.5*Math.random(),color:e} - )} - } - catchAboard(t,i){ - const s=Math.random()<.5?-1:1,e=34*-Math.sin(this.heading)*s,n=34*Math.cos(this.heading)*s; - if(this.splash(this.bx+e,this.by+n,6,15004914,18),t.broken)return.3; - const h=DTi(t.id),r=t.grade??0,o=t.star>=5||3===r?4:4===t.star||2===r?3:3===t.star||i?2:1,a=[0,26,30,34,40][o]*OUi[t.grade??0],c=new Xe(NAi.fish(t.id)); - c.anchor.set(.5),c.width=c.height=a,this.flyLayer.addChild(c); - const l={ - p:0} - ,u=26+5*o; - return yx.to(l,{ - p:1,duration:.55,ease:"none",onUpdate:Qt(()=>{ - const t=l.p; - c.position.set(this.bx+e*(1-t),this.by+n*(1-t)-4*u*t*(1-t)),c.rotation=(.5-t)*s*1.4} - ,"onUpdate"),onComplete:Qt(()=>{ - c.destroy(),this.splash(this.bx,this.by,3,14207136),o>=3&&this.burst(this.bx,this.by,o>=4?24:12,zxi[NTi(t.id)]),i||t.star>=4||this.tag(`${ - h.name} - ${ - MCi(t.grade??0)} - ${ - TCi(t.kg)} - `,16777215)} - ,"onComplete")} - ),YG(o>=3?"medium":"light"),.55} - tag(t,i){ - this.floatTag(t,i,this.bx,this.by-64)} - floatTag(t,i,s,e){ - var n; - const h=Jxi(t,i,13),r=new Ke,o=new ep; - o.roundRect(0,0,h.width+14,h.height+6,(h.height+6)/2).fill({ - color:Vxi,alpha:.85} - ),h.position.set(7,3),r.addChild(o,h),r.position.set(s-r.width/2,e),null==(n=this.labels.parent)||n.addChild(r),yx.timeline({ - onComplete:Qt(()=>r.destroy({ - children:!0} - ),"onComplete")} - ).from(r,{ - alpha:0,y:r.y+8,duration:.2} - ).to(r,{ - y:r.y-14,alpha:0,duration:.5,ease:"power1.in"} - ,1.4)} - } - ; - Qt(uFi,"FishingSeaMap"),Zt(uFi,"DEFAULT_H",400),Zt(uFi,"hintSeen",!1),Zt(uFi,"lightTex",null),Zt(uFi,"glowTex",null),Zt(uFi,"regionTex",new Map),Zt(uFi,"MINI",108),Zt(uFi,"fxSpeed",1),Zt(uFi,"devAnyZone",!1); - let dFi=uFi; - const fFi=[{ - rays:[14,150],rays2:[9,110],sparkles:18,burst2:!1,ring:0,fish:124,shake:0} - ,{ - rays:[14,160],rays2:[10,118],sparkles:22,burst2:!1,ring:1,fish:128,shake:0} - ,{ - rays:[16,180],rays2:[11,130],sparkles:26,burst2:!0,ring:2,fish:138,shake:0} - ,{ - rays:[18,205],rays2:[12,150],sparkles:32,burst2:!0,ring:3,fish:150,shake:5} - ],pFi=class{ - static get active(){ - return!!this.current&&this.current.h.shown&&!this.current.h.done} - static get pending(){ - return!!this.current&&!this.current.h.done} - static dismiss(t=!1){ - var i; - null==(i=this.current)||i.h.dismiss(t)} - static release(){ - const t=this.current; - if(!t||t.h.done)return; - const i=t.startAt+1.6-performance.now()/1e3; - i<=0?t.h.dismiss():yx.delayedCall(i,()=>t.h.dismiss())} - static show(t,i,s,e,n,h,r={ - } - ){ - const o=r.queue??!0,a=r.holdSec??20,c=performance.now()/1e3; - let l=c+n; - const u=o?this.current:null; - if(u&&!u.h.done&&(l=Math.max(l,u.startAt+1.6),l-(c+n)>8))return null; - const d=Math.max(0,Math.min(3,i.grade)),f=fFi[d],p=Math.max(1,Math.min(7,i.star)),w=zxi[p]??Dxi,g=d>=2?Yxi[d]:w,m=new Ke; - m.eventMode="none",m.position.set(s,e),m.alpha=0; - const v=this.glow(g,300+30*d),_=this.glow(16777215,220+30*d),M=this.rays(f.rays[0],f.rays[1],16769946,.42),b=this.rays(f.rays2[0],f.rays2[1],g,.35),y=new Ke,E=(new ep).ellipse(0,.47*f.fish,.37*f.fish,9).fill({ - color:398362,alpha:.35} - ),A=new Xe(i.tex); - A.anchor.set(.5),A.width=A.height=f.fish; - const S=A.scale.x,T=new Ke,C=dRi("새 물고기 발견!",Gxi,Dxi,15,12); - if(T.addChild(C),d>=1){ - const t=dRi(`${ - wCi[d]} - ${ - gCi[d]} - `,16777215,Yxi[d],14,9); - t.position.set(C.width+6,(C.height-t.height)/2),T.addChild(t)} - T.pivot.set(T.width/2,T.height/2); - const O=.5*-f.fish-36; - T.position.set(0,O); - const I=Jxi(`${ - i.name} - ${ - MCi(d)} - `,Bxi,20); - sRi(I,300); - const k=Jxi("★".repeat(p),w,15),x=Jxi(`${ - TCi(i.kg)} - ${ - i.dex?` · 도감 ${ - i.dex} - 종째`:""} - `,Uxi,13),R=new Ke,P=Math.max(I.width,k.width,x.width)+32,N=(new ep).roundRect(-P/2,0,P,78,14).fill({ - color:Vxi,alpha:.94} - ); - d>=1&&N.roundRect(-P/2,0,P,78,14).stroke({ - color:Yxi[d],width:2,alpha:.9} - ),I.position.set(-I.width/2,8),k.position.set(-k.width/2,34),x.position.set(-x.width/2,54); - const L=dRi("화면을 누르면 닫혀요",Uxi,Vxi,12,8); - L.position.set(-L.width/2,86),L.alpha=0,R.addChild(N,I,k,x,L); - const D=.5*f.fish+12; - R.position.set(0,D); - const G=new Ke; - m.addChild(v,M,b,_,y,E,A,G,T,R),t.addChild(m); - const B=[]; - let U=!1,F=!1,$=!1; - const H={ - get shown(){ - return U} - ,get done(){ - return F} - ,dismiss:Qt((t=!1)=>{ - if(!F&&!$){ - if($=!0,!U)return j.kill(),void V(); - j.kill(),null==W||W.kill(); - for(const t of B)t.kill(); - yx.to(m,{ - alpha:0,y:m.y-18,duration:t?.15:.35,ease:"power1.in",onComplete:V} - )} - } - ,"dismiss")} - ; - let W=null; - const V=Qt(()=>{ - var t,i; - if(!F){ - F=!0,j.kill(),null==W||W.kill(); - for(const t of B)t.kill(); - yx.killTweensOf(m); - for(const t of G.children)yx.killTweensOf([t,t.scale]); - m.destroy({ - children:!0} - ),(null==(t=this.current)?void 0:t.h)===H&&(this.current=null),null==(i=r.onEnd)||i.call(r)} - } - ,"finish"); - o&&(this.current={ - h:H,startAt:l} - ); - const j=yx.timeline({ - delay:l-c} - ); - j.set(m,{ - alpha:1} - ).call(()=>{ - U=!0,u&&u.h!==H&&u.h.dismiss(!0),null==h||h(),this.burst(G,g,f.sparkles,70,90+15*d),B.push(yx.to(M,{ - rotation:"+="+2*Math.PI,duration:26,ease:"none",repeat:-1} - ),yx.to(b,{ - rotation:"-="+2*Math.PI,duration:34,ease:"none",repeat:-1} - ),yx.to(v,{ - alpha:.75,duration:1.4,ease:"sine.inOut",yoyo:!0,repeat:-1,delay:.6} - ),yx.to(A,{ - y:-5,duration:.8,ease:"sine.inOut",yoyo:!0,repeat:-1,delay:.6} - ),yx.timeline({ - repeat:-1,repeatDelay:1.3,delay:1.6} - ).call(()=>this.burst(G,g,3+d,26,50)),yx.to(L,{ - alpha:.8,duration:.5,delay:1.5} - )),W=yx.delayedCall(a,()=>H.dismiss())} - ,[],0).fromTo(_.scale,{ - x:.2,y:.2} - ,{ - x:1.7*_.scale.x,y:1.7*_.scale.y,duration:.45,ease:"power2.out"} - ,0).fromTo(_,{ - alpha:1} - ,{ - alpha:0,duration:.45,ease:"power1.in"} - ,0).fromTo(v.scale,{ - x:0,y:0} - ,{ - x:v.scale.x,y:v.scale.y,duration:.4,ease:"back.out(2)"} - ,0).fromTo([M,b],{ - alpha:0} - ,{ - alpha:1,duration:.35} - ,0).fromTo(M.scale,{ - x:.4,y:.4} - ,{ - x:1,y:1,duration:.5,ease:"back.out(1.6)"} - ,0).fromTo(b.scale,{ - x:.4,y:.4} - ,{ - x:1,y:1,duration:.5,ease:"back.out(1.6)"} - ,.05).fromTo(A.scale,{ - x:.15*S,y:.15*S} - ,{ - x:S,y:S,duration:.5,ease:"back.out(2.4)"} - ,.08).fromTo(A,{ - rotation:-.35} - ,{ - rotation:0,duration:.5,ease:"back.out(2)"} - ,.08).fromTo(E,{ - alpha:0} - ,{ - alpha:1,duration:.3} - ,.2).fromTo(T,{ - alpha:0,y:O+14} - ,{ - alpha:1,y:O,duration:.3,ease:"back.out(2.5)"} - ,.3).fromTo(T.scale,{ - x:.6,y:.6} - ,{ - x:1,y:1,duration:.3,ease:"back.out(2.5)"} - ,.3).fromTo(R,{ - alpha:0,y:D+10} - ,{ - alpha:1,y:D,duration:.3,ease:"power2.out"} - ,.42); - for(let K=0; - K<f.ring; - K++){ - const t=new ep; - y.addChild(t); - const i={ - p:0} - ; - j.fromTo(i,{ - p:0} - ,{ - p:1,duration:.7,ease:"power2.out",onUpdate:Qt(()=>{ - t.clear().circle(0,0,40+i.p*(130+25*d)).stroke({ - color:Yxi[d],width:5*(1-i.p)+1,alpha:.85*(1-i.p)} - )} - ,"onUpdate")} - ,.05+.2*K)} - if(f.burst2&&j.call(()=>this.burst(G,16774084,Math.round(.6*f.sparkles),40,70+15*d),[],.55),f.shake){ - const t={ - k:0} - ; - j.fromTo(t,{ - k:1} - ,{ - k:0,duration:.45,ease:"power1.out",onUpdate:Qt(()=>{ - m.position.set(s+2*(Math.random()-.5)*f.shake*t.k,e+2*(Math.random()-.5)*f.shake*t.k)} - ,"onUpdate")} - ,.08)} - return H} - static glow(t,i){ - if(!this.glowTex){ - const t=document.createElement("canvas"); - t.width=t.height=128; - const i=t.getContext("2d"),s=i.createRadialGradient(64,64,0,64,64,64); - s.addColorStop(0,"rgba(255,255,255,0.9)"),s.addColorStop(.4,"rgba(255,255,255,0.35)"),s.addColorStop(1,"rgba(255,255,255,0)"),i.fillStyle=s,i.fillRect(0,0,128,128),this.glowTex=ls.from(t)} - const s=new Xe(this.glowTex); - return s.anchor.set(.5),s.width=s.height=i,s.tint=t,s.blendMode="add",s} - static rays(t,i,s,e){ - const n=new ep; - for(let h=0; - h<t; - h++){ - const r=h/t*Math.PI*2,o=.07+h%2*.04,a=i*(h%2?.8:1); - n.poly([0,0,Math.cos(r-o)*a,Math.sin(r-o)*a,Math.cos(r+o)*a,Math.sin(r+o)*a]).fill({ - color:s,alpha:e*(h%2?.7:1)} - )} - return n.blendMode="add",n} - static burst(t,i,s,e,n){ - for(let h=0; - h<s; - h++){ - const r=3+4*Math.random(),o=(new ep).poly([0,-r,.28*r,.28*-r,r,0,.28*r,.28*r,0,r,.28*-r,.28*r,-r,0,.28*-r,.28*-r]).fill(h%3==0?i:16774084); - o.blendMode="add",t.addChild(o); - const a=h/s*Math.PI*2+.4*Math.random(),c=e+Math.random()*n; - yx.timeline({ - onComplete:Qt(()=>o.destroy(),"onComplete")} - ).fromTo(o,{ - x:0,y:0,alpha:1,rotation:0} - ,{ - x:Math.cos(a)*c,y:Math.sin(a)*c*.85,rotation:3*Math.random(),duration:.7+.4*Math.random(),ease:"power2.out"} - ).fromTo(o.scale,{ - x:.4,y:.4} - ,{ - x:1.2,y:1.2,duration:.3} - ,0).to(o,{ - alpha:0,duration:.4} - ,"-=0.35")} - } - } - ; - Qt(pFi,"FishingDiscoveryFx"),Zt(pFi,"current",null),Zt(pFi,"glowTex",null); - let wFi=pFi; - const gFi=Qt(()=>`fishing.plunder.seen.${ - TG.userId} - `,"seenKey"); - function mFi(t,i){ - try{ - QG.getInstance().playSFX(t,i)} - catch{ - } - } - function vFi(t,i=12){ - const s=new Ke,e=["C","B","A","S"],n=[5921376,Yxi[1],Yxi[2],Yxi[3]]; - let h=0; - for(const r of[3,2,1,0]){ - if(!t[r])continue; - const o=dRi(`${ - e[r]} - ${ - t[r]} - `,16777215,n[r],i,6); - o.x=h,h+=o.width+5,s.addChild(o)} - return s.eventMode="none",s} - Qt(mFi,"sfx$4"),Qt(vFi,"gradeChips"); - const _Fi=166; - function MFi(){ - try{ - const t=JSON.parse(localStorage.getItem(gFi())??"null"); - return t&&"number"==typeof t.log?t:null} - catch{ - return null} - } - function bFi(t){ - try{ - localStorage.setItem(gFi(),JSON.stringify(t))} - catch{ - } - } - Qt(MFi,"loadSeen"),Qt(bFi,"saveSeen"); - const yFi=class extends Ke{ - constructor(t,i){ - super(),Zt(this,"peekPanel",new Ke),Zt(this,"banner",new Ke),Zt(this,"notice",new Ke),Zt(this,"peekAngler",null),Zt(this,"peek",null),Zt(this,"peekBusy",!1),Zt(this,"track",{ - thief:{ - key:"",count:-1} - ,victim:{ - key:"",count:-1} - } - ),Zt(this,"autoStopAt",0),Zt(this,"tensionKey",{ - thief:"",victim:""} - ),Zt(this,"oldServerWarned",!1),Zt(this,"stopping",!1),Zt(this,"seen",null),Zt(this,"seenFor",""),Zt(this,"peekDrawnAt",0),Zt(this,"peekSig",""),Zt(this,"peekLive",null),Zt(this,"starting",!1),Zt(this,"hinted",!1),Zt(this,"bannerRows",new Map),Zt(this,"bannerW",0),Zt(this,"overlayOpen",Qt(()=>!1,"overlayOpen")),this.scene=t,this.viewH=i,this.peekPanel.visible=!1,this.peekPanel.eventMode="static",this.banner.visible=!1,this.banner.eventMode="static",this.notice.visible=!1,this.notice.eventMode="static",this.addChild(this.banner,this.notice,this.peekPanel),t.onOtherTap=(t,i)=>{ - this.openPeek(t,i)} - } - get panelOpen(){ - return this.peekPanel.visible||this.notice.visible} - get bannerBottom(){ - return this.banner.visible?_Fi+this.banner.height+8:_Fi} - async openPeek(t,i){ - var s; - if(this.peekBusy)return; - const e=this.scene.boatPoint("me"),n=this.scene.boatPoint(t.id); - if(!e||!n||Math.hypot(e.x-n.x,e.y-n.y)>380)bH.getInstance().showMessage(`${ - t.n} - · 멀어서 안 보여요. 더 가까이 가 보세요`); - else{ - this.peekAngler=t,this.peek=null,this.renderPeek(),this.peekPanel.visible=!0,yx.fromTo(this.peekPanel,{ - alpha:0,y:12} - ,{ - alpha:1,y:0,duration:.18} - ),YG("light"),this.peekBusy=!0; - try{ - const i=await ixi.getInstance().plunderPeek(t.id); - if((null==(s=this.peekAngler)?void 0:s.id)!==t.id)return; - if(i.message||!i.result)return bH.getInstance().showMessage(i.message??"훔쳐볼 수 없어요"),void this.closePeek(); - this.peek=i.result,this.renderPeek()} - finally{ - this.peekBusy=!1} - } - } - closePeek(){ - this.peekAngler=null,this.peek=null,this.peekPanel.visible=!1} - near(t){ - const i=this.scene.boatPoint("me"),s=this.scene.boatPoint(t); - return!!i&&!!s&&Math.hypot(i.x-s.x,i.y-s.y)<=RIi} - renderPeek(){ - var t,i,s,e,n,h; - const r=this.peekPanel,o=this.peekAngler,a=ixi.getInstance(); - if(r.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),!o)return; - const c=APi.BLEED_W,l=this.viewH(),u=c-20,d=26,f=null==(t=this.peek)?void 0:t.view,p=(null==f?void 0:f.fish)??[],w=Math.max(1,Math.floor((u-32+4)/34)),g=4*w,m=p.length>g?g-1:p.length,v=p.length?Math.ceil(Math.min(p.length,g)/w):0,_=v?34*v-4:24,M=86+_+12+44+54,b=l-M-8,y=eRi(u,M,Vxi,null,14); - y.alpha=.95,y.position.set(10,b); - const E=[y],A=kIi(o.lk); - let S=d; - if(A){ - const t=new Xe(gPi(A)),i=(new ep).circle(22,22,22).fill(kxi),s=(new ep).circle(22,22,21).fill(16777215); - t.width=t.height=44; - const e=new Ke; - e.addChild(i,t,s),t.mask=s,e.position.set(d,b+10),E.push(e),S=80} - const T=Jxi(`훔쳐보기 · ${ - o.n} - `,Dxi,17); - T.position.set(S,b+12),sRi(T,u-40-(S-d)); - const C=this.peek?this.peek.away:!!o.a,O=Jxi(this.peek?C?`정박 중 (자리 비움) · 어망 ${ - f.count} - 마리`:`낚시 중 · 어망 ${ - f.count} - 마리`:"살펴보는 중…",Uxi,13); - O.position.set(S,b+36),sRi(O,u-40-(S-d)),E.push(T,O); - const I=b+60+24; - if(f&&p.length){ - const t=vFi(f.grades); - if(t.position.set(d,b+60),E.push(t),p.slice(0,m).forEach((t,i)=>{ - const s=new hRi(30); - s.starsAlways=!0,s.set(null,t.star,t.grade),s.position.set(d+i%w*34,I+34*Math.floor(i/w)),E.push(s)} - ),m<p.length){ - const t=m,i=new Ke,s=(new ep).roundRect(0,0,30,30,6).fill(kxi),e=Jxi("+"+(p.length-m),Uxi,11); - e.position.set((30-e.width)/2,(30-e.height)/2),i.addChild(s,e),i.position.set(d+t%w*34,I+34*Math.floor(t/w)),E.push(i)} - } - else if(f){ - const t=Jxi("어망이 비어 있어요",Uxi,13,!1); - t.position.set(d,I),sRi(t,u-40),E.push(t)} - const k=a.tickets(),x=a.realNow(),R=Jxi(f?"guild"===f.why?"같은 길드원의 물고기는 훔칠 수 없어요":"protected"===f.why?`경계 중 · ${ - wRi(f.protectUntil-x)} - 뒤에 다시`:"raided"===f.why?(null==(s=null==(i=a.plunder)?void 0:i.raid)?void 0:s.id)===o.id?"내가 털고 있어요 · 이미 넘어온 물고기는 빼고 보여요":`${ - lRi(f.raidedBy??"다른 낚시꾼","이","가")} - 털고 있어요`:"capped"===f.why?"오늘은 더 털 수 없는 배예요":"empty"===f.why?"":`훔칠 수 있어요 · 어망에서 아무거나 1분에 한 마리씩, 최대 ${ - Math.min(10,f.remaining,f.count)} - 마리`:"","raided"===(null==f?void 0:f.why)&&(null==(n=null==(e=a.plunder)?void 0:e.raid)?void 0:n.id)===o.id?Dxi:"guild"===(null==f?void 0:f.why)?Uxi:(null==f?void 0:f.why)?Hxi:$xi,13); - R.position.set(d,I+_+12),sRi(R,u-40); - const P=Jxi(this.ticketText(),Uxi,12); - P.position.set(d,I+_+34),E.push(R,P),this.peekLive={ - info:R,tk:P,infoW:u-40} - ; - const N=b+M-54,L=new cRi("닫기",96,40,14); - L.setPrimary(!1),L.onTap=()=>this.closePeek(); - const D=new cRi("",150,40,14); - D.position.set(10+u-16-150,N),L.position.set(D.x-8-96,N); - const G=!!(null==(h=a.plunder)?void 0:h.raid); - f?G?(D.setText("이미 훔치는 중"),D.enabled=!1):"guild"===f.why?(D.setText("같은 길드원"),D.enabled=!1):f.why||0===f.count?(D.setText("훔칠 수 없어요"),D.enabled=!1):this.near(o.id)?k.n<1?(D.setText(`표 없음 · ${ - wRi((k.nextAt??x)-x)} - `),D.enabled=!1):(D.setText("훔치기 (표 1장)"),D.onTap=async()=>{ - if(this.starting)return; - this.starting=!0,D.enabled=!1; - const t=await a.plunderStart(o.id).finally(()=>{ - this.starting=!1} - ); - if(t)return bH.getInstance().showMessage(t),void(D.destroyed||(D.enabled=!0)); - YG("medium"),mFi(QG.SFX_ARCHERY_FIRE_ARROW,.6),this.closePeek(),bH.getInstance().showMessage(`${ - o.n} - 의 어망에 갈고리를 걸었어요. 1분에 한 마리씩 가져와요`)} - ):(D.setText("옆으로 가기"),D.onTap=()=>{ - this.scene.sailNearBoat(o.id)&&(bH.getInstance().showMessage("옆에 닿으면 다시 눌러 훔치기"),this.closePeek())} - ):(D.setText("살펴보는 중"),D.enabled=!1),E.push(L,D),this.peekSig=this.peekSignature(),r.hitArea=new $i(0,0,c,l),r.removeAllListeners("pointertap"),r.on("pointertap",t=>{ - t.stopPropagation(),r.toLocal(t.global).y<b&&this.closePeek()} - ),r.addChild(...E)} - update(){ - var t,i,s; - const e=ixi.getInstance(),n=e.plunder,h=e.realNow(),r=[]; - if(null==n?void 0:n.raid){ - const t=GIi(n.raid,h); - r.push({ - from:"me",to:n.raid.id,tension:t.level,tp:t.p} - )} - if(null==n?void 0:n.raidBy){ - const t=GIi(n.raidBy,h); - r.push({ - from:n.raidBy.id,to:"me",tension:t.level,tp:t.p} - )} - for(const a of e.others)a.r&&a.r!==TG.userId&&a.id!==(null==(t=null==n?void 0:n.raidBy)?void 0:t.id)&&r.push({ - from:a.id,to:a.r} - ); - this.scene.setPlunder(r,this.peekPanel.visible?(null==(i=this.peekAngler)?void 0:i.id)??null:null); - const o=(null==n?void 0:n.raid)??(null==n?void 0:n.raidBy); - !o||o.plan||this.oldServerWarned||(this.oldServerWarned=!0,xG.getInstance().development&&bH.getInstance().showMessage("서버가 예전 빌드예요 — 훔친 물고기를 보려면 ef2_server 를 빌드·재시작해 주세요")); - for(const a of["thief","victim"]){ - const t="thief"===a?(null==n?void 0:n.raid)??null:(null==n?void 0:n.raidBy)??null,i=t?`${ - t.id} - :${ - t.startAt} - `:"",e=this.track[a]; - if(i!==e.key&&(t&&"victim"===a&&(mFi(QG.SFX_WAVE_CALL,.5),YG("heavy")),e.key=i,e.count=t?NIi(t,h):-1),!t)continue; - const r=NIi(t,h); - if(r>e.count){ - const i=null==(s=t.plan)?void 0:s[r-1],n=i?{ - id:i.id,star:i.star,grade:i.grade} - :void 0,h=i?`${ - DTi(i.id).name} - ${ - MCi(i.grade)} - `:"",o=(null==i?void 0:i.grade)??0; - "thief"===a?this.scene.plunderFly(t.id,"me",n,i?{ - text:o>=3?`대물!! ${ - h} - `:2===o?`큰 놈! ${ - h} - `:`훔쳤다! ${ - h} - `,color:o>=2?Yxi[o]:Dxi} - :void 0):(this.scene.plunderFly("me",t.id,n,i?{ - text:o>=3?`대물을 빼앗겼어요!! ${ - h} - `:`빼앗김 · ${ - h} - `,color:16757670} - :void 0),YG("light")),mFi(QG.SFX_NORMAL_CLICK,.45),"thief"===a&&o>=2&&yx.delayedCall(1.1,()=>{ - mFi(o>=3?QG.SFX_TRUMPET:QG.SFX_GOLD_GOBLIN,.6),YG(o>=3?"heavy":"success")} - ),e.count=r} - const o=GIi(t,h),c=o.level?`${ - i} - :${ - r} - `:""; - if(c&&c!==this.tensionKey[a]&&(this.tensionKey[a]=c,YG(o.level>=3?"heavy":2===o.level?"medium":"light")),"thief"===a&&!this.stopping){ - const i=this.scene.boatPoint("me"),s=this.scene.boatPoint(t.id); - if(i&&s&&Math.hypot(i.x-s.x,i.y-s.y)>230){ - this.scene.ropeSnap("me",t.id),mFi(QG.SFX_STONE_BREAK,.5),bH.getInstance().showMessage(`너무 멀어져 줄이 끊겼어요. ${ - Math.min(r,t.max)} - 마리만 챙겼어요`),this.stop(!0); - continue} - } - "thief"===a&&r>=t.max&&!this.stopping&&performance.now()>=this.autoStopAt&&(this.autoStopAt=performance.now()+5e3,this.stop(!0))} - this.renderBanner(),this.checkNotices(),this.hintOnce(e.others.some(t=>t.a)),this.peekPanel.visible&&this.peek&&this.renderPeekLive()} - ticketText(){ - const t=ixi.getInstance(),i=t.tickets(),s=t.realNow(); - return`훔치기 표 ${ - i.n} - /3${ - i.nextAt?` · 다음 ${ - wRi(i.nextAt-s)} - `:""} - `} - peekSignature(){ - var t,i; - const s=this.peekAngler,e=null==(t=this.peek)?void 0:t.view,n=ixi.getInstance(); - return s?`${ - s.id} - |${ - null==e?void 0:e.why} - |${ - null==e?void 0:e.count} - |${ - this.near(s.id)} - |${ - n.tickets().n} - |${ - !!(null==(i=n.plunder)?void 0:i.raid)} - |${ - APi.BLEED_W} - |${ - this.viewH()} - `:""} - renderPeekLive(){ - var t; - const i=performance.now(); - if(i-this.peekDrawnAt<500)return; - if(this.peekDrawnAt=i,this.peekSignature()!==this.peekSig||!this.peekLive||this.peekLive.tk.destroyed)return void this.renderPeek(); - const s=null==(t=this.peek)?void 0:t.view,e=ixi.getInstance().realNow(); - this.peekLive.tk.text=this.ticketText(),"protected"===(null==s?void 0:s.why)&&(this.peekLive.info.text=`경계 중 · ${ - wRi(s.protectUntil-e)} - 뒤에 다시`,sRi(this.peekLive.info,this.peekLive.infoW))} - hintOnce(t){ - if(!this.hinted&&t&&!this.overlayOpen()){ - this.hinted=!0; - try{ - if(localStorage.getItem("fishing.plunder.hint"))return; - localStorage.setItem("fishing.plunder.hint","1")} - catch{ - } - bH.getInstance().showMessage("다른 배를 누르면 망원경으로 어망을 볼 수 있어요 (Zz 배 = 자리 비운 낚시꾼)")} - } - async stop(t){ - if(!this.stopping){ - this.stopping=!0; - try{ - const i=await ixi.getInstance().plunderStop(); - i.message&&!t&&bH.getInstance().showMessage(i.message)} - finally{ - this.stopping=!1} - } - } - async cut(){ - var t,i,s; - const e=null==(i=null==(t=ixi.getInstance().plunder)?void 0:t.raidBy)?void 0:i.id,n=await ixi.getInstance().plunderCut(); - if(n)return void bH.getInstance().showMessage(n); - e&&this.scene.ropeSnap(e,"me"),YG("success"),mFi(QG.SFX_STONE_BREAK,.6),bH.getInstance().showMessage("줄을 끊었어요! 어망을 지켰어요"); - const h=null==(s=ixi.getInstance().plunder)?void 0:s.log[0]; - h&&this.seen&&(this.seen={ - ...this.seen,log:Math.max(this.seen.log,h.at)} - ,bFi(this.seen))} - renderBanner(){ - const t=ixi.getInstance(),i=t.plunder,s=t.realNow(),e=this.banner,n=[(null==i?void 0:i.raidBy)?{ - r:i.raidBy,thief:!1} - :null,(null==i?void 0:i.raid)?{ - r:i.raid,thief:!0} - :null].filter(Boolean),h=APi.BLEED_W,r=Math.min(h-20,420); - if(r!==this.bannerW){ - for(const t of this.bannerRows.values())t.row.destroy({ - children:!0} - ); - this.bannerRows.clear(),this.bannerW=r} - const o=new Set(n.map(({ - r:t,thief:i} - )=>`${ - i?"t":"v"} - :${ - t.id} - :${ - t.startAt} - `)); - for(const[u,d]of this.bannerRows)o.has(u)||(d.row.destroy({ - children:!0} - ),this.bannerRows.delete(u)); - if(!n.length)return void(e.visible=!1); - const a=this.scene.boatPoint("me"); - n.forEach(({ - r:t,thief:i} - ,n)=>{ - var h; - const o=`${ - i?"t":"v"} - :${ - t.id} - :${ - t.startAt} - `; - let c=this.bannerRows.get(o); - if(!c){ - const s=new Ke,n=new ep,h=Jxi(i?`${ - t.name} - 의 어망 털기`:`${ - lRi(t.name,"이","가")} - 내 어망을 털고 있어요!`,i?Dxi:16765640,14); - h.position.set(12,8),sRi(h,r-130); - const a=Jxi("",Bxi,12,!1); - a.position.set(12,31); - const l=new cRi(i?"도망치기":"줄 끊기",104,40,14); - l.position.set(r-112,9),i?(l.setPrimary(!1),l.onTap=()=>{ - this.stop(!1)} - ):l.onTap=()=>{ - this.cut()} - ; - const u=new Ke,d=new Ke; - u.position.set(12,54),s.addChild(n,h,a,l,u,d),e.addChild(s),c={ - row:s,bg:n,t2:a,cards:u,netRow:d,shown:-1,netSig:"",bgSig:"",sig:"",h:0} - ,this.bannerRows.set(o,c)} - const l=NIi(t,s),u=LIi(t,s),d=this.scene.boatPoint(t.id),f=i&&!!a&&!!d&&Math.hypot(a.x-d.x,a.y-d.y)>188,p=GIi(t,s),w=p.level?i?p.level>=3?"줄이 엄청 묵직해요!! 대물 예감!!":2===p.level?"줄이 묵직해요… 큰 놈인가?!":"조금 묵직…?":p.level>=3?"뭔가 엄청 큰 게 끌려가요!! 줄을 끊어요!!":2===p.level?"큰 놈이 끌려가요… 줄을 끊어요!":"뭔가 끌려가요…":"",g=f?`${ - l} - /${ - t.max} - 마리 · 더 멀어지면 줄이 끊겨요!`:w?`${ - i?`${ - l} - /${ - t.max} - 마리 · `:""} - ${ - w} - `:i?`${ - l} - /${ - t.max} - 마리 · ${ - l>=t.max?"다 끌어왔어요":`다음 한 마리 ${ - wRi(u)} - `} - `:0===l?"갈고리를 걸었어요 · 1분마다 한 마리씩 끌려가요":`${ - l} - 마리 끌려가는 중 · 끊으면 모두 돌아와요`,m=p.level>=3?Yxi[3]:2===p.level?Yxi[2]:1===p.level?14862735:Bxi,v=`${ - g} - |${ - f} - |${ - p.level} - `; - v!==c.sig&&(c.sig=v,c.t2.text=g,c.t2.textColor=f?Hxi:m,sRi(c.t2,r-130)); - const _=Math.min(l,(null==(h=t.plan)?void 0:h.length)??0); - if(_!==c.shown){ - c.shown=_,c.cards.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const i=Math.min(34,Math.floor((r-24-36)/10)); - (t.plan??[]).slice(0,_).forEach((t,s)=>{ - const e=new hRi(i); - e.starsAlways=!0,e.set(t.id,t.star,t.grade),e.position.set(s*(i+4),0),c.cards.addChild(e)} - )} - const M=BIi(t,s),b=M?M.join(","):"",y=_>0?Math.min(34,Math.floor((r-24-36)/10))+6:0; - if(b!==c.netSig&&(c.netSig=b,c.netRow.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),M&&M.some(t=>t>0))){ - const t=Jxi(i?"남은 어망":"내 어망에 남은 것",Uxi,11,!1),s=vFi(M,10); - s.position.set(t.width+6,1),c.netRow.addChild(t,s)} - c.netRow.position.set(12,54+y); - const E=58+y+(c.netRow.children.length?18:0),A=`${ - E} - |${ - p.level} - `; - A!==c.bgSig&&(c.bgSig=A,c.h=E,c.bg.clear().roundRect(0,0,r,E,12).fill({ - color:i?2825477:4855058,alpha:.92} - ),p.level>=2&&c.bg.roundRect(1,1,r-2,E-2,11).stroke({ - color:p.level>=3?Yxi[3]:Yxi[2],width:2,alpha:.9} - ))} - ); - let c=0; - for(const{ - r:u,thief:d} - of n){ - const t=this.bannerRows.get(`${ - d?"t":"v"} - :${ - u.id} - :${ - u.startAt} - `); - t.row.y=c,c+=t.h+6} - const l=c-6; - e.hitArea=new $i(0,0,r,l),e.position.x=(h-r)/2,e.visible||(e.visible=!0,yx.fromTo(e,{ - alpha:0,y:154} - ,{ - alpha:1,y:_Fi,duration:.25} - ))} - checkNotices(){ - var t,i; - const s=ixi.getInstance().plunder; - if(!s||this.notice.visible)return; - if(this.overlayOpen())return; - if(this.seenFor!==TG.userId&&(this.seenFor=TG.userId,this.seen=MFi()),!this.seen){ - const t=ixi.getInstance().realNow()-432e5; - this.seen={ - log:t,last:t} - } - const e=s.last&&s.last.at>this.seen.last?s.last:null,n=s.log.filter(t=>t.at>this.seen.log); - (e||n.length)&&(this.seen={ - log:Math.max(this.seen.log,(null==(t=s.log[0])?void 0:t.at)??0),last:Math.max(this.seen.last,(null==(i=s.last)?void 0:i.at)??0)} - ,bFi(this.seen),this.showNotice(e,n))} - showNotice(t,i){ - var s; - const e=this.notice,n=APi.BLEED_W; - e.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const h=[]; - if(t&&(t.cut?h.push({ - text:`${ - t.name} - 에게 들켰어요! 줄이 끊겨 빈손으로 돌아왔어요`,color:Hxi} - ):h.push({ - text:`${ - t.name} - 의 어망에서 ${ - t.n} - 마리를 훔쳤어요!`,color:Dxi,ids:t.ids,grades:t.grades} - )),i.length){ - const t=i.filter(t=>!t.cut).reduce((t,i)=>t+i.n,0); - h.push({ - text:t>0?`어망에서 ${ - t} - 마리를 도둑맞았어요`:"도둑이 왔지만 줄을 끊어 지켰어요",color:t>0?16765640:$xi} - ); - for(const s of i.slice(0,3))h.push({ - text:`· ${ - s.name} - ${ - s.cut?"줄을 끊었어요":`${ - s.n} - 마리`} - `,color:Uxi} - )} - const r=Math.min(n-20,420); - let o=12; - const a=[]; - for(const d of h){ - const t=Jxi(d.text,d.color,14,d.color!==Uxi); - if(t.position.set(14,o),sRi(t,r-28),a.push(t),o+=24,null==(s=d.ids)?void 0:s.length){ - const t=Math.min(36,Math.floor((r-28-36)/10)); - d.ids.slice(0,10).forEach((i,s)=>{ - var e; - const n=new hRi(t); - n.starsAlways=!0,n.set(i,DTi(i).star,(null==(e=d.grades)?void 0:e[s])??0),n.position.set(14+s*(t+4),o),a.push(n)} - ),o+=t+8} - } - const c=Jxi("눌러서 닫기",Fxi,11,!1); - c.position.set(r-14-c.width,o),a.push(c),o+=20; - const l=(new ep).roundRect(0,0,r,o,12).fill({ - color:Vxi,alpha:.94} - ); - e.addChild(l,...a),e.hitArea=new $i(0,0,r,o),e.removeAllListeners("pointertap"),e.on("pointertap",t=>{ - t.stopPropagation(),e.visible=!1} - ); - const u=this.banner.visible?_Fi+this.banner.height+8:_Fi; - e.position.set((n-r)/2,u),e.visible=!0,yx.killTweensOf(e),yx.fromTo(e,{ - alpha:0,y:u-12} - ,{ - alpha:1,y:u,duration:.25} - ),yx.to(e,{ - alpha:0,duration:.4,delay:15,onComplete:Qt(()=>{ - e.visible=!1} - ,"onComplete")} - ),t&&!t.cut&&t.n>0?(YG("success"),mFi(QG.SFX_GOLD_GOBLIN,.5)):(null==t?void 0:t.cut)&&mFi(QG.SFX_STONE_BREAK,.5)} - layout(){ - this.bannerW=0,this.peekPanel.visible&&this.renderPeek()} - onHide(){ - this.closePeek(),this.notice.visible=!1} - } - ; - Qt(yFi,"FishingPlunderUi"); - let EFi=yFi; - const AFi=Qt(t=>bH.getInstance().showMessage(t),"toast"); - function SFi(t,i){ - try{ - QG.getInstance().playSFX(t,i)} - catch{ - } - } - Qt(SFi,"sfx$3"); - const TFi=Qt(t=>`${ - t.src} - :${ - t.id} - :${ - t.grade} - :${ - t.at} - :${ - t.kg} - `,"refKey"),CFi=Qt(t=>t.reduce((t,i)=>t+SCi(i.id,i.grade,i.r??.5),0),"valueOf"),OFi=Qt(t=>lRi(t,"이","가"),"ga"); - function IFi(t,i,s){ - const e=ixi.getInstance().others.find(i=>i.id===t),n=kIi(null==e?void 0:e.lk); - if(n)return uRi(gPi(n),s); - const h=new Ke,r=Jxi(i.slice(0,1),16777215,Math.round(.42*s)); - return h.addChild((new ep).circle(s/2,s/2,s/2).fill(xxi),r),r.position.set((s-r.width)/2,(s-r.height)/2),h.eventMode="none",h} - Qt(IFi,"faceOf"); - const kFi=class t extends Ke{ - constructor(t,i){ - super(),Zt(this,"banner",new Ke),Zt(this,"ask",new Ke),Zt(this,"win",new Ke),Zt(this,"emo",new Ke),Zt(this,"fx",new Ke),Zt(this,"confirm",new Ke),Zt(this,"bannerY",Qt(()=>166,"bannerY")),Zt(this,"onOpen",null),Zt(this,"nameEnd",{ - them:0,me:0} - ),Zt(this,"view",null),Zt(this,"local",null),Zt(this,"sendTimer",null),Zt(this,"sending",null),Zt(this,"tab","net"),Zt(this,"pick",null),Zt(this,"flash",null),Zt(this,"chgAt",0),Zt(this,"palOpen",!1),Zt(this,"emoUntil",0),Zt(this,"emoSeq",0),Zt(this,"skipMineEmo",!1),Zt(this,"theirsSig",""),Zt(this,"busyOk",!1),Zt(this,"swapping",!1),Zt(this,"gridScroll",0),Zt(this,"sailReq",null),Zt(this,"live",{ - } - ),Zt(this,"rendering",!1),Zt(this,"sigs",{ - banner:"",ask:"",win:""} - ),Zt(this,"chgOn",!1),Zt(this,"parts",new Map),this.scene=t,this.viewH=i; - for(const s of[this.banner,this.ask,this.win,this.emo,this.fx,this.confirm])s.visible=!1,s.eventMode="static"; - this.emo.eventMode="none",this.addChild(this.banner,this.ask,this.win,this.emo,this.fx,this.confirm),ixi.getInstance().onTrade(t=>this.onView(t))} - get panelOpen(){ - return this.ask.visible||this.win.visible||this.fx.visible} - closeOne(){ - return this.fx.visible?(this.swapping&&!this.fx.children.some(t=>t.alpha>.9&&"result"===t.label)||this.finishResult(),!0):this.confirm.visible?(this.hideConfirm(),!0):this.win.visible?(this.showConfirm(),!0):!!this.ask.visible&&(ixi.getInstance().tradeAnswer(!1),!0)} - finishResult(){ - queueMicrotask(()=>{ - this.swapping=!1,this.closeAll(),this.view=null,ixi.getInstance().tradeDismiss()} - )} - showConfirm(){ - var t; - const i=this.confirm,s=this.W,e=this.H,n=Math.min(s-60,360),h=(s-n)/2,r=156,o=(e-r)/2; - i.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const a=(new ep).rect(0,0,s,e).fill({ - color:0,alpha:.55} - ),c=eRi(n,r,1315863,null,16); - c.position.set(h,o); - const l=Jxi("거래를 그만둘까요?",Dxi,18); - l.position.set(h+(n-l.width)/2,o+20); - const u=Jxi("올린 물고기는 그대로 내 어망·어항에 있어요",Uxi,13,!1); - u.position.set(h+(n-u.width)/2,o+52),sRi(u,n-24),u.x=h+(n-u.width)/2; - const d=(n-32-8)/2,f=new cRi("계속 거래",d,44,15),p=new cRi("그만두기",d,44,15); - f.setPrimary(!1),f.position.set(h+16,o+r-60),p.position.set(h+16+d+8,o+r-60),f.onTap=()=>this.hideConfirm(),p.onTap=()=>{ - this.hideConfirm(),ixi.getInstance().tradeCancel()} - ,i.addChild(a,c,l,u,f,p),i.hitArea=new $i(0,0,s,e),i.removeAllListeners("pointertap"),i.on("pointertap",t=>t.stopPropagation()),i.visible=!0,null==(t=this.parent)||t.setChildIndex(this,this.parent.children.length-1),yx.fromTo(c,{ - alpha:0} - ,{ - alpha:1,duration:.15} - )} - hideConfirm(){ - this.confirm.visible=!1,queueMicrotask(()=>this.confirm.removeChildren().forEach(t=>t.destroy({ - children:!0} - )))} - get bannerBottom(){ - return this.banner.visible?this.bannerY()+66:this.bannerY()} - get W(){ - return APi.BLEED_W} - get H(){ - return this.viewH()} - request(t){ - this.near(t.id,148)?this.sendRequest(t):this.scene.sailNearBoat(t.id)?(this.sailReq={ - a:t,until:Date.now()+25e3} - ,AFi(`${ - t.n} - 옆으로 가요 · 닿으면 거래를 청해요`)):AFi("그 배 옆으로 갈 수 없어요")} - near(t,i=160){ - const s=this.scene.boatPoint("me"),e=this.scene.boatPoint(t); - return!!s&&!!e&&Math.hypot(s.x-e.x,s.y-e.y)<=i} - async sendRequest(t){ - this.sailReq=null; - const i=await ixi.getInstance().tradeRequest(t.id); - i?AFi(i):YG("light")} - onView(t){ - const i=this.view,s=ixi.getInstance(); - if(this.view=t,!t)return!i||"ask"!==i.phase&&"open"!==i.phase||this.fx.visible||AFi("거래가 끝났어요"),void(this.fx.visible||this.closeAll()); - if("gone"===t.phase){ - const e=t.other.name,n="reject"===t.why?t.asker?`${ - OFi(e)} - 거래를 거절했어요`:"":"timeout"===t.why?t.asker?`${ - OFi(e)} - 답이 없어요`:"거래 요청이 지나갔어요":"idle"===t.why?"오래 손대지 않아 거래가 닫혔어요":t.byMe?"":"open"===(null==i?void 0:i.phase)?`${ - OFi(e)} - 거래를 그만뒀어요`:`${ - OFi(e)} - 거래 요청을 거뒀어요`; - return n&&AFi(n),this.closeAll(),void s.tradeDismiss()} - if("done"===t.phase)return(null==i?void 0:i.id)!==t.id?(this.view=null,void s.tradeDismiss()):void(this.swapping||this.fx.visible||this.playSwap("open"===i.phase?i:null,t)); - (null==i?void 0:i.id)!==t.id&&this.resetRoom(t),t.emote&&t.emote.seq>this.emoSeq&&(this.emoSeq=t.emote.seq,t.emote.mine&&this.skipMineEmo?this.skipMineEmo=!1:this.showEmote(t.emote.mine,t.emote.e)); - const e=t.theirs.map(TFi).join("|"); - (null==i?void 0:i.id)===t.id&&"open"===i.phase&&"open"===t.phase&&e!==this.theirsSig&&(this.chgAt=Date.now()+1e3,this.flash={ - text:i.okMe?`${ - OFi(t.other.name)} - 올린 것을 바꿨어요 · 다시 보고 OK 해 주세요`:`${ - OFi(t.other.name)} - 올린 것을 바꿨어요`,until:Date.now()+3200} - ,YG("light")),this.theirsSig=e,this.sendTimer||this.sending||(this.local=null),this.render()} - front(){ - var t,i; - null==(t=this.onOpen)||t.call(this),null==(i=this.parent)||i.setChildIndex(this,this.parent.children.length-1)} - resetRoom(t){ - var i; - this.local=null,this.tab="net",this.pick=null,this.flash=null,this.palOpen=!1,this.emoSeq=(null==(i=t.emote)?void 0:i.seq)??0,this.theirsSig=t.theirs.map(TFi).join("|"),this.gridScroll=0,this.busyOk=!1} - closeAll(){ - this.banner.visible=this.ask.visible=this.win.visible=this.emo.visible=this.fx.visible=this.confirm.visible=!1,this.palOpen=!1,this.swapping=!1,this.local=null,this.sendTimer&&(clearTimeout(this.sendTimer),this.sendTimer=null); - for(const t of[this.banner,this.ask,this.win,this.emo,this.fx])t.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - this.live={ - } - ,this.sigs={ - banner:"",ask:"",win:""} - ,this.parts.clear()} - onHide(){ - this.sailReq=null; - const t=ixi.getInstance(); - t.tradeLive&&!t.tradePreview&&t.tradeCancel()} - layout(){ - this.render()} - update(){ - const t=this.sailReq; - t&&(this.near(t.a.id,148)?this.sendRequest(t.a):Date.now()>t.until&&(this.sailReq=null,AFi("옆에 닿지 못했어요 · 다시 눌러 주세요"))); - const i=this.view; - if("ask"===(null==i?void 0:i.phase)&&this.live.text){ - const t=Math.max(0,i.exp-ixi.getInstance().realNow()),s=Math.ceil(t/1e3); - this.live.text.text=i.asker?`답을 기다려요 · ${ - s} - 초`:`${ - s} - 초 안에 고르지 않으면 저절로 거절돼요`; - const{ - bar:e,barW:n=0,barX:h=0,barY:r=0} - =this.live; - e&&e.clear().roundRect(h,r,Math.max(4,n*(t/2e4)),i.asker?3:6,3).fill(Dxi)} - "open"===(null==i?void 0:i.phase)&&this.flash&&Date.now()>this.flash.until&&(this.flash=null,this.render()),"open"===(null==i?void 0:i.phase)&&this.chgOn!==this.chgAt>Date.now()&&this.render()} - render(){ - if(!this.rendering&&!this.swapping){ - this.rendering=!0; - try{ - const t=this.view; - this.renderBanner("ask"===(null==t?void 0:t.phase)&&t.asker?t:null),this.renderAsk("ask"!==(null==t?void 0:t.phase)||t.asker?null:t),this.renderWin("open"===(null==t?void 0:t.phase)?t:null)} - finally{ - this.rendering=!1} - } - } - soon(){ - queueMicrotask(()=>this.render())} - renderBanner(t){ - const i=this.banner,s=t?`${ - t.id} - |${ - t.other.name} - |${ - this.bannerY()} - |${ - this.W} - `:""; - if(s===this.sigs.banner&&i.visible===!!t)return; - if(this.sigs.banner=s,i.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),i.visible=!!t,!t)return; - const e=this.W-20,n=this.bannerY(); - i.addChild(eRi(e,58,Vxi,null,12)).position.set(10,n),i.children[0].alpha=.94; - const h=Jxi(`${ - t.other.name} - 에게 거래를 청했어요`,Dxi,14); - h.position.set(24,n+9),sRi(h,e-110); - const r=Jxi("답을 기다려요",Uxi,12,!1); - r.position.set(24,n+31); - const o=new ep,a=new cRi("취소",72,34,13); - a.setPrimary(!1),a.position.set(10+e-10-72,n+12),a.onTap=()=>{ - ixi.getInstance().tradeCancel()} - ,i.addChild(h,r,o,a),this.live={ - text:r,bar:o,barW:e,barX:10,barY:n+58-3} - ,this.update()} - renderAsk(t){ - const i=this.ask,s=t?`${ - t.id} - |${ - t.other.name} - |${ - ixi.getInstance().tradeLeft()} - |${ - this.W} - |${ - this.H} - `:""; - if(s===this.sigs.ask&&i.visible===!!t)return; - this.sigs.ask=s,i.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const e=i.visible; - if(i.visible=!!t,!t)return; - e||this.front(); - const n=ixi.getInstance(),h=this.W,r=this.H,o=Math.min(h-20,460),a=(h-o)/2,c=176,l=r-c-8,u=a+16,d=eRi(o,c,Vxi,null,14); - d.alpha=.97,d.position.set(a,l); - const f=IFi(t.other.id,t.other.name,44); - f.position.set(u,l+14); - const p=Jxi(`${ - t.other.name} - 님이 거래하자고 해요`,Dxi,17); - p.position.set(u+54,l+14),sRi(p,o-86); - const w=Jxi(`어망·어항 물고기를 서로 6마리까지 바꿔요 · 오늘 남은 거래 ${ - n.tradeLeft()} - 번`,Uxi,12,!1); - w.position.set(u+54,l+40),sRi(w,o-86); - const g=(new ep).roundRect(u,l+72,o-32,6,3).fill(kxi),m=new ep,v=Jxi("",Fxi,12,!1); - v.position.set(u,l+84); - const _=new cRi("거절",120,44,15),M=new cRi("수락",o-32-128,44,15); - _.setPrimary(!1),_.position.set(u,l+c-58),M.position.set(u+128,l+c-58),_.onTap=()=>{ - n.tradeAnswer(!1)} - ,M.onTap=async()=>{ - M.enabled=!1; - const t=await n.tradeAnswer(!0); - t&&(AFi(t),M.destroyed||(M.enabled=!0))} - ,i.addChild(d,f,p,w,g,m,v,_,M),i.hitArea=new $i(0,0,h,r),i.removeAllListeners("pointertap"),i.on("pointertap",t=>t.stopPropagation()),this.live={ - text:v,bar:m,barW:o-32,barX:u,barY:l+72} - ,this.update()} - mine(t){ - return this.local??t.mine} - geo(){ - const t=this.W,i=this.H,s=t-16,e=i-10-8,n=s-24,h=Math.min(56,Math.floor((n-20-30)/6)),r=32+h+10,o=56+r+12,a=o+r+10,c=a+26,l=c+40,u=10+e-12-46; - return{ - W:t,H:i,x0:8,y0:10,PW:s,PH:e,L:20,IW:n,S:h,blkH:r,aTop:56,bTop:o,infoY:a,phY:c,gridTop:l,gridH:Math.max(60,u-10-l),footY:u,cell:48,gap:6,cols:Math.max(4,Math.floor((n+6)/54))} - } - slotPos(t,i){ - const s=this.geo(),e=6*s.S+30; - return{ - x:s.L+(s.IW-e)/2+i*(s.S+6),y:("a"===t?s.aTop:s.bTop)+32} - } - card(t,i){ - const s=new hRi(i); - return s.set(t.id,DTi(t.id).star,t.grade),s} - part(t,i,s,e){ - let n=this.parts.get(t); - n||(n={ - c:new Ke,sig:"\0"} - ,n.c.label=t,this.parts.set(t,n),this.win.addChild(n.c)),(e||n.sig!==i)&&(n.sig=i,n.c.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),s(n.c))} - renderWin(t,i=!1){ - var s; - const e=this.win,n=ixi.getInstance(),h=e.visible; - if(e.visible=!!t,this.emo.visible=!!t,!t)return void((h||this.parts.size)&&(e.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),this.parts.clear())); - h||this.front(),this.chgOn=this.chgAt>Date.now(); - const r=this.geo(),{ - W:o,H:a,x0:c,y0:l,PW:u,PH:d,L:f,IW:p,S:w,blkH:g} - =r,m=n.tradeFish(),v=this.mine(t),_=t.theirs,M=kki(m.net.length,n.netCap,m.aq.length,bki((null==(s=n.state.aquarium)?void 0:s.lv)??0),v,_),b=`${ - o} - x${ - a} - `; - this.part("frame",JSON.stringify([t.other.name,n.tradeLeft(),b]),i=>{ - const s=(new ep).rect(0,0,o,a).fill({ - color:0,alpha:.5} - ),e=eRi(u,d,Vxi,null,16); - e.alpha=.97,e.position.set(c,l); - const h=Jxi(`${ - lRi(t.other.name,"과","와")} - 거래`,Dxi,18); - h.position.set(f,l+14),sRi(h,p-130); - const r=Jxi(`오늘 남은 거래 ${ - n.tradeLeft()} - 번`,Uxi,12,!1); - r.position.set(f+p-r.width,l+20),i.addChild(s,e,h,r)} - ,i),this.part("rows",JSON.stringify([v.map(TFi),_.map(TFi),t.okMe,t.okThem,this.chgOn,this.swapping,t.other.name,b]),i=>{ - const s=Qt((t,s,e,n,h,r)=>{ - const o=(new ep).roundRect(f,t,p,g,12).fill(n?1451549:"them"===s&&this.chgOn?3811860:1710621),a=(new ep).circle(f+14,t+16,4).fill(r),c=Jxi(h,Bxi,14); - c.position.set(f+24,t+7); - const l=n?dRi("OK",730132,$xi,11):dRi("고르는 중",Uxi,kxi,11); - l.position.set(f+30+c.width,t+8),this.nameEnd[s]=l.x+l.width; - const u=Jxi(e.length?`팔면 ${ - CFi(e).toLocaleString()} - 골드`:"me"===s?`${ - e.length} - /6`:"아직 없음",Uxi,12); - u.position.set(f+p-10-u.width,t+9),i.addChild(o,a,c,l,u); - for(let d=0; - d<6; - d++){ - const t=this.slotPos("them"===s?"a":"b",d),n=this.swapping?void 0:e[d]; - if(!n){ - if(i.addChild((new ep).roundRect(t.x,t.y,w,w,.2*w).fill("me"===s?2302758:2039586)),"me"===s&&d===e.length&&!this.swapping){ - const s=Jxi("+",4868688,22); - s.position.set(t.x+(w-s.width)/2,t.y+(w-s.height)/2),i.addChild(s)} - continue} - const h=new Ke; - h.position.set(t.x,t.y),h.addChild(this.card(n,w)),h.eventMode="static",h.cursor="pointer",h.hitArea=new $i(0,0,w,w),h.label=`slot-${ - s} - -${ - d} - `,h.on("pointertap",t=>{ - t.stopPropagation(),"me"===s?this.removeMine(n):(this.pick={ - who:"them",ref:n} - ,this.soon())} - ),i.addChild(h)} - } - ,"row"); - s(r.aTop,"them",_,t.okThem,`${ - OFi(t.other.name)} - 올린 것`,9418751),s(r.bTop,"me",v,t.okMe,"내가 올린 것",Dxi); - const e=new Ke; - e.addChild((new ep).circle(0,0,15).fill(kxi),this.swapIcon()),e.position.set(o/2,r.bTop-6),e.label="swapIcon",i.addChild(e)} - ,i); - let y="아래에서 누르면 올려요 · 올린 칸을 누르면 빼요",E=Uxi; - if(this.flash&&this.flash.until>Date.now())y=this.flash.text,E=this.flash.bad?Hxi:16757611; - else if(M.ok){ - if(this.pick){ - const i=this.pick.ref,s=DTi(i.id); - y=`${ - s.name} - ${ - MCi(i.grade)} - ${ - "★".repeat(s.tier)} - · ${ - TCi(i.kg)} - · 팔면 ${ - SCi(i.id,i.grade,i.r??.5).toLocaleString()} - 골드${ - "aq"===i.src?" · 어항":""} - ${ - "them"===this.pick.who?` · ${ - t.other.name} - 것`:""} - `,E=Bxi} - } - else y=`받을 어망 자리가 ${ - M.short} - 칸 모자라요 · 어망을 비우거나 덜 받아 주세요`,E=Hxi; - this.part("info",JSON.stringify([y,E,b]),t=>{ - const i=Jxi(y,E,12.5,E!==Uxi); - i.position.set(f+2,r.infoY),sRi(i,p-4),t.addChild(i)} - ,i); - const A=`${ - m.net.map(t=>`${ - t.id} - :${ - t.grade} - :${ - t.at} - `).join()} - |${ - m.aq.map(t=>`${ - t.id} - :${ - t.grade} - :${ - t.at} - `).join()} - `; - this.part("picker",JSON.stringify([this.tab,A,v.map(TFi),M.netFree,M.aqFree,M.ok,b]),t=>{ - [["어망","net",m.net.length],["어항","aq",m.aq.length]].forEach(([i,s,e],n)=>{ - const h=new oRi(`${ - i} - ${ - e} - `,84,30,13); - h.selected=this.tab===s,h.draw(),h.position.set(f+90*n,r.phY),h.onTap=()=>{ - this.tab!==s&&(this.tab=s,this.gridScroll=0,this.soon())} - ,t.addChild(h)} - ); - const i=M.ok?Fxi:Hxi,s=Jxi("받을 자리",i,11,!M.ok),e=Jxi(`어망 ${ - M.netFree} - 칸 · 어항 ${ - M.aqFree} - 칸`,i,11,!M.ok); - s.position.set(f+p-s.width,r.phY),e.position.set(f+p-e.width,r.phY+15),t.addChild(s,e,this.grid(v,m))} - ,i); - const S=!v.length&&!_.length,T=this.swapping?["바꾸는 중…",!1,!0]:this.busyOk?["…",!1,!0]:S?["물고기를 올려 주세요",!1,!0]:M.ok?t.okMe&&!this.local?[`OK 풀기 · ${ - t.other.name} - 기다리는 중`,!0,!1]:["OK",!0,!0]:["받을 자리가 모자라요",!1,!0],C=Date.now()>=this.emoUntil; - this.part("foot",JSON.stringify([T,this.palOpen,C,b]),t=>{ - const i=new cRi("😊",46,46,20); - i.setPrimary(this.palOpen),i.enabled=C,i.position.set(f,r.footY),i.onTap=()=>{ - this.palOpen=!this.palOpen,this.soon()} - ; - const s=new cRi("그만두기",92,46,15); - s.setPrimary(!1),s.position.set(f+54,r.footY),s.onTap=()=>{ - n.tradeCancel()} - ; - const e=new cRi(T[0],p-54-100,46,15); - e.position.set(f+154,r.footY),e.enabled=T[1],e.setPrimary(T[2]),e.onTap=()=>{ - this.toggleOk()} - ,t.addChild(i,s,e)} - ,i),this.part("pal",JSON.stringify([this.palOpen,b]),t=>{ - this.palOpen&&t.addChild(this.palette(r))} - ,i),h&&!i||(e.hitArea=new $i(0,0,o,a),e.removeAllListeners("pointertap"),e.on("pointertap",t=>{ - t.stopPropagation(),this.palOpen&&(this.palOpen=!1,this.soon())} - ))} - swapIcon(){ - const t=new ep,i={ - color:Dxi,width:2.4,cap:"round",join:"round"} - ; - return t.moveTo(-4,-6).lineTo(-4,7).stroke(i).moveTo(-8,3).lineTo(-4,7).lineTo(0,3).stroke(i).moveTo(4,7).lineTo(4,-6).stroke(i).moveTo(0,-2).lineTo(4,-6).lineTo(8,-2).stroke(i),t.scale.set(1),t} - grid(t,i){ - const s=this.geo(),e=("net"===this.tab?i.net:i.aq).map(t=>({ - c:t,r:Oki(t,this.tab)} - )).sort((t,i)=>SCi(i.c.id,i.c.grade,i.c.r)-SCi(t.c.id,t.c.grade,t.c.r)),n=new Ke,h=new Ke,r=(new ep).rect(s.L,s.gridTop,s.IW,s.gridH).fill(16777215); - n.addChild(h,r),h.mask=r; - const o=Math.ceil(e.length/s.cols)*(s.cell+s.gap),a=Math.max(0,o-s.gridH); - this.gridScroll=Math.max(0,Math.min(a,this.gridScroll)); - const c=new Set,l=e.map((t,i)=>({ - ...t,i} - )); - for(const f of t){ - const t=l.findIndex(t=>!c.has(t.i)&&Iki(t.r,f)); - t>=0&&c.add(t)} - if(l.forEach((t,i)=>{ - const e=new hRi(s.cell); - if(e.set(t.c.id,DTi(t.c.id).star,t.c.grade),e.position.set(s.L+i%s.cols*(s.cell+s.gap),s.gridTop+Math.floor(i/s.cols)*(s.cell+s.gap)),c.has(i)){ - e.alpha=.35; - const t=(new ep).moveTo(-7,0).lineTo(-2,5).lineTo(8,-6).stroke({ - color:Dxi,width:3.2,cap:"round",join:"round"} - ); - t.position.set(e.x+s.cell/2,e.y+s.cell/2),h.addChild(e,t)} - else h.addChild(e)} - ),!e.length){ - const t=Jxi("net"===this.tab?"어망이 비어 있어요":"어항이 비어 있어요",Uxi,13,!1); - t.position.set(s.L+4,s.gridTop+6),h.addChild(t)} - h.y=-this.gridScroll,n.eventMode="static",n.hitArea=new $i(s.L,s.gridTop,s.IW,s.gridH); - let u=null; - n.on("pointerdown",t=>{ - u={ - y:t.global.y,s:this.gridScroll,moved:!1} - } - ),n.on("globalpointermove",t=>{ - if(!u)return; - const i=t.global.y-u.y; - Math.abs(i)>6&&(u.moved=!0),u.moved&&(this.gridScroll=Math.max(0,Math.min(a,u.s-i)),h.y=-this.gridScroll)} - ); - const d=Qt(()=>{ - setTimeout(()=>{ - u=null} - ,0)} - ,"end"); - return n.on("pointerup",d),n.on("pointerupoutside",d),n.on("wheel",t=>{ - this.gridScroll=Math.max(0,Math.min(a,this.gridScroll+t.deltaY)),h.y=-this.gridScroll} - ),n.on("pointertap",t=>{ - if(t.stopPropagation(),null==u?void 0:u.moved)return; - const i=n.toLocal(t.global),e=i.x-s.L,h=i.y-s.gridTop+this.gridScroll,r=Math.floor(e/(s.cell+s.gap)),o=Math.floor(h/(s.cell+s.gap)); - if(r<0||r>=s.cols||e%(s.cell+s.gap)>s.cell||h%(s.cell+s.gap)>s.cell)return; - const a=l[o*s.cols+r]; - a&&this.addMine(a.r)} - ),n} - palette(t){ - const i=new Ke,s=(t.IW-18)/4,e=t.footY-10-138; - return i.addChild((new ep).roundRect(t.L,e,t.IW,138,14).fill(2500139)),Cki.forEach(([n,h],r)=>{ - const o=new Ke,a=t.L+8+r%4*(s+2),c=e+8+64*Math.floor(r/4); - o.addChild((new ep).roundRect(0,0,s-4,58,10).fill(3421242)); - const l=Jxi(n,Bxi,22),u=Jxi(h,Bxi,11); - l.position.set((s-4-l.width)/2,6),u.position.set((s-4-u.width)/2,36),sRi(u,s-10),u.x=(s-4-u.width)/2,o.addChild(l,u),o.position.set(a,c),o.eventMode="static",o.cursor="pointer",o.hitArea=new $i(0,0,s-4,58),o.on("pointertap",t=>{ - t.stopPropagation(),this.sendEmote(r)} - ),i.addChild(o)} - ),i} - addMine(t){ - const i=this.view; - if(!i||"open"!==i.phase)return; - const s=[...this.mine(i)]; - return this.pick={ - who:"me",ref:t} - ,s.some(i=>Iki(i,t))?(AFi("이미 올렸어요 · 위 칸을 누르면 빼요"),void this.soon()):s.length>=6?(AFi("한 번에 6마리까지 올릴 수 있어요"),void this.soon()):(s.push(t),void this.changeMine(s))} - removeMine(t){ - const i=this.view; - if(!i)return; - const s=[...this.mine(i)],e=s.findIndex(i=>Iki(i,t)); - e>=0&&s.splice(e,1),this.pick=null,this.changeMine(s)} - changeMine(t){ - this.local=t,this.view&&(this.view={ - ...this.view,okMe:!1,okThem:!1} - ),YG("light"),this.sendTimer&&clearTimeout(this.sendTimer),this.sendTimer=setTimeout(()=>{ - this.sendTimer=null,this.flushOffer()} - ,250),this.soon()} - async flushOffer(){ - for(this.sendTimer&&(clearTimeout(this.sendTimer),this.sendTimer=null); - this.sending; - )await this.sending; - const t=this.local; - if(!t)return; - const i=ixi.getInstance(); - this.sending=(async()=>{ - const s=await i.tradeOffer(t); - s?(AFi(s),this.local=null):this.local===t&&(this.local=null)} - )().finally(()=>{ - this.sending=null} - ),await this.sending,this.local?await this.flushOffer():this.soon()} - async toggleOk(){ - if(!this.busyOk){ - this.busyOk=!0,this.soon(); - try{ - await this.flushOffer(); - const t=this.view; - if(!t||"open"!==t.phase)return; - const i=await ixi.getInstance().tradeReady(!t.okMe); - i?AFi(i):YG("medium")} - finally{ - this.busyOk=!1,this.soon()} - } - } - async sendEmote(t){ - if(Date.now()<this.emoUntil)return; - this.palOpen=!1,this.emoUntil=Date.now()+1500,setTimeout(()=>this.soon(),1530),this.showEmote(!0,t),this.skipMineEmo=!0,this.soon(); - const i=await ixi.getInstance().tradeEmote(t); - i&&(this.skipMineEmo=!1,AFi(i))} - showEmote(t,i){ - const s=Cki[i]; - if(!s||!this.win.visible)return; - const e=this.geo(),n=t?e.bTop:e.aTop; - for(const c of[...this.emo.children])c.label===(t?"emo-me":"emo-them")&&c.destroy({ - children:!0} - ); - const h=new Ke,r=Jxi(s[0],1315863,20),o=Jxi(s[1],1315863,14),a=r.width+o.width+22; - h.addChild((new ep).roundRect(0,0,a,34,16).fill(15921908).poly([12,33,24,33,14,41]).fill(15921908),r,o),r.position.set(9,(34-r.height)/2),o.position.set(13+r.width,(34-o.height)/2),h.label=t?"emo-me":"emo-them",h.pivot.set(12,41),h.position.set(Math.min(e.L+e.IW-a,this.nameEnd[t?"me":"them"]+18),n+2),this.emo.addChild(h),yx.fromTo(h.scale,{ - x:.4,y:.4} - ,{ - x:1,y:1,duration:.3,ease:"back.out(2.2)"} - ),yx.fromTo(h,{ - alpha:0} - ,{ - alpha:1,duration:.15} - ),yx.to(h,{ - alpha:0,y:h.y-6,delay:2.5,duration:.3,onComplete:Qt(()=>{ - h.destroyed||h.destroy({ - children:!0} - )} - ,"onComplete")} - ),t||YG("light")} - playSwap(i,s){ - const e=s.result; - if(!e)return ixi.getInstance().tradeDismiss(),void this.closeAll(); - this.view={ - ...i??s,phase:"open",mine:e.gave,theirs:e.got,okMe:!0,okThem:!0} - ,this.palOpen=!1,this.local=null,this.swapping=!0,this.renderWin(this.view,!0),this.renderBanner(null),this.renderAsk(null); - const n=this.fx,h=this.geo(); - n.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),n.visible=!0,n.hitArea=new $i(0,0,h.W,h.H),n.removeAllListeners("pointertap"),n.on("pointertap",t=>t.stopPropagation()); - const r=[],o=Qt((t,i,s,e)=>{ - const o=(new ep).circle(0,0,.7*h.S).fill({ - color:16771488,alpha:.55} - ); - o.alpha=0; - const a=this.card(t,h.S); - a.pivot.set(h.S/2,h.S/2),n.addChild(o,a),r.push({ - c:a,from:i,to:s,side:e,big:DTi(t.id).star>=4||t.grade>=3,glow:o} - )} - ,"add"); - e.gave.forEach((t,i)=>o(t,this.slotPos("b",i),this.slotPos("a",i),1)),e.got.forEach((t,i)=>o(t,this.slotPos("a",i),this.slotPos("b",i),-1)); - const a=(new ep).rect(0,0,h.W,h.H).fill(0); - a.alpha=0; - const c=this.resultCard(s); - n.addChild(a,c); - const l=this.win.getChildByLabel("swapIcon",!0),u=performance.now(),d=t.speed; - let f=!1; - const p=Qt(()=>{ - if(n.destroyed||!n.visible)return void Mn.shared.remove(p); - const t=Math.min(1.6,(performance.now()-u)/1e3*d),i=Lki(t); - for(const s of r){ - const t=s.from.x+(s.to.x-s.from.x)*i.cross+22*s.side*Math.sin(Math.PI*i.cross),e=s.from.y+(s.to.y-s.from.y)*i.cross-6*i.lift; - s.c.position.set(t+h.S/2,e+h.S/2),s.c.scale.set(1+.06*i.lift+.14*i.pop),s.c.zIndex=s.side>0?1:2,s.glow.position.set(s.to.x+h.S/2,s.to.y+h.S/2),s.glow.alpha=s.big?i.pop:0,s.glow.scale.set(.6+i.pop)} - l&&(l.rotation=Math.PI*i.spin),a.alpha=.5*i.dim,c.alpha=i.result,c.y=40*(1-i.result),!f&&t>=.9&&(f=!0,YG("medium"),SFi(QG.SFX_ARCHERY_FIRE_ARROW,.35)),t>=1.6&&Mn.shared.remove(p)} - ,"tick"); - n.sortableChildren=!0,a.zIndex=9,c.zIndex=10,Mn.shared.add(p)} - resultCard(t){ - const i=ixi.getInstance(),s=t.result,e=this.geo(),n=new Ke,h=Math.min(e.W-36,400),r=(e.W-h)/2,o=r+16; - n.label="result"; - const a=[]; - let c=18; - const l=Jxi(s.got.length?"교환했어요!":"건네줬어요!",Dxi,20); - if(l.position.set(r+(h-l.width)/2,c),a.push(l),c+=38,s.got.length){ - const t=Jxi("받은 것",Uxi,12,!1); - t.position.set(o,c),a.push(t),c+=22; - const i=56,e=10,n=Math.max(1,Math.floor((h-32+e)/(i+e))),l=Math.ceil(s.got.length/n); - s.got.forEach((t,o)=>{ - const l=Math.floor(o/n),u=Math.min(n,s.got.length-l*n),d=r+(h-(u*i+(u-1)*e))/2+o%n*(i+e),f=c+l*(i+26),p=this.card(t,i); - p.position.set(d,f),a.push(p); - const w=Jxi(DTi(t.id).name,13224398,10.5,!1); - sRi(w,i+8),w.position.set(d+(i-w.width)/2,f+i+3),a.push(w)} - ),c+=l*(i+26)+4; - const u=Jxi([s.toNet?`어망으로 ${ - s.toNet} - 마리`:"",s.toAq?`어항으로 ${ - s.toAq} - 마리`:""].filter(Boolean).join(" · "),Uxi,12.5,!1); - u.position.set(r+(h-u.width)/2,c),a.push(u),c+=26} - else{ - const t=Jxi("받은 것 없음 (선물)",Uxi,12.5,!1); - t.position.set(r+(h-t.width)/2,c),a.push(t),c+=26} - if(s.gave.length){ - const t=Jxi("준 것",Uxi,12,!1); - t.position.set(o,c),a.push(t),c+=20; - const i=34,e=5,n=s.gave.length*i+(s.gave.length-1)*e; - s.gave.forEach((t,s)=>{ - const o=this.card(t,i); - o.alpha=.55,o.position.set(r+(h-n)/2+s*(i+e),c),a.push(o)} - ),c+=i+12} - const u=Jxi(`오늘 남은 거래 ${ - i.tradeLeft()} - 번`,Uxi,12.5,!1); - u.position.set(r+(h-u.width)/2,c),a.push(u),c+=26; - const d=new cRi("확인",h-32,44,15); - d.position.set(o,c),d.onTap=()=>this.finishResult(),a.push(d),c+=58; - const f=c,p=Math.max(20,(e.H-f)/2),w=(new ep).roundRect(r,0,h,f,16).fill(1315863); - return n.addChild(w,...a),n.pivot.set(0,-p),n.alpha=0,n} - } - ; - Qt(kFi,"FishingTradeUi"),Zt(kFi,"speed",1); - let xFi=kFi; - const RFi=class extends Ke{ - constructor(t,i){ - super(),Zt(this,"box",new Ke),Zt(this,"target",null),Zt(this,"w",236),Zt(this,"follow",Qt(()=>this.place(),"follow")),Zt(this,"onTrade",null),Zt(this,"onPeek",null),Zt(this,"onHelp",null),Zt(this,"wantsHelp",Qt(()=>!1,"wantsHelp")),this.scene=t,this.viewH=i,this.visible=!1,this.eventMode="static",this.addChild(this.box),this.on("pointertap",t=>{ - this.box.getBounds().containsPoint(t.global.x,t.global.y)||(t.stopPropagation(),this.close())} - )} - get isOpen(){ - return this.visible} - open(t){ - this.target=t,this.render(),this.visible=!0,this.hitArea=new $i(0,0,APi.BLEED_W,this.viewH()),this.place(),Mn.shared.remove(this.follow),Mn.shared.add(this.follow),yx.fromTo(this.box,{ - alpha:0} - ,{ - alpha:1,duration:.14} - ),YG("light")} - close(){ - this.visible=!1,this.target=null,Mn.shared.remove(this.follow)} - gate(t){ - const i=ixi.getInstance(),s=i.plunder,e=this.scene.boatPoint("me"),n=this.scene.boatPoint(t.id),h=!e||!n||Math.hypot(e.x-n.x,e.y-n.y)>Tki,r=this.wantsHelp(t)?"고치는 중 · ":""; - return t.a?{ - ok:!1,far:h,text:"자리 비움 · 거래는 둘 다 있을 때만",warn:!0} - :(null==s?void 0:s.raid)||(null==s?void 0:s.raidBy)?{ - ok:!1,far:h,text:"털기 중에는 거래할 수 없어요",warn:!0} - :i.tradeLeft()<=0?{ - ok:!1,far:h,text:"오늘 거래를 다 했어요 (하루 10번)",warn:!0} - :i.tradeLive?{ - ok:!1,far:h,text:"다른 거래가 진행 중이에요",warn:!0} - :h?{ - ok:!0,far:h,text:`${ - r} - 조금 멀어요 · 누르면 옆으로 가서 청해요`,warn:!1} - :{ - ok:!0,far:h,text:`${ - r} - 바로 옆이에요 · 오늘 남은 거래 ${ - i.tradeLeft()} - 번`,warn:!1} - } - render(){ - const t=this.target,i=this.box; - if(i.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),!t)return; - const s=this.wantsHelp(t),e=this.gate(t),n=this.w=s?300:236,h=(n-24-(s?16:8))/(s?3:2),r=(new ep).roundRect(0,0,n,112,14).fill({ - color:Vxi,alpha:.96} - ),o=(new ep).poly([-7,0,7,0,0,8]).fill({ - color:Vxi,alpha:.96} - ); - o.label="tail",o.y=112,r.eventMode="static"; - const a=Jxi(`${ - t.n} - 님의 배`,Dxi,15); - a.position.set(12,11),sRi(a,n-24); - const c=Jxi(e.text,e.warn?Hxi:s?16757611:Uxi,12,!1); - c.position.set(12,34),sRi(c,n-24); - const l=new cRi("거래하기",h,40,14); - l.enabled=e.ok,l.onTap=()=>{ - var t; - const i=this.target; - this.close(),i&&(null==(t=this.onTrade)||t.call(this,i))} - ; - const u=new cRi("훔쳐보기",h,40,14); - if(u.setPrimary(!1),u.onTap=()=>{ - var t; - const i=this.target; - this.close(),i&&(null==(t=this.onPeek)||t.call(this,i))} - ,l.position.set(12,60),u.position.set(12+h+8,60),i.addChild(r,o,a,c,l,u),s){ - const t=new cRi("수리 돕기",h,40,14); - t.setPrimary(!1),t.onTap=()=>{ - var t; - const i=this.target; - this.close(),i&&(null==(t=this.onHelp)||t.call(this,i))} - ,t.position.set(12+2*(h+8),60),i.addChild(t)} - } - place(){ - const t=this.target; - if(!t||!this.visible)return; - const i=this.scene.boatPoint(t.id); - if(!i)return void this.close(); - const s=this.toLocal(this.scene.worldToGlobal(i.x,i.y)),e=this.w,n=Math.max(10,Math.min(APi.BLEED_W-10-e,s.x-e/2)),h=Math.max(8,s.y-46-112); - this.box.position.set(n,h); - const r=this.box.getChildByLabel("tail"); - r&&(r.x=Math.max(16,Math.min(e-16,s.x-n)))} - } - ; - Qt(RFi,"FishingBoatMenu"); - let PFi=RFi; - const NFi={ - gust:{ - name:"돌풍",cause:"돌풍으로",icon:"wind",color:11986151,prefixes:["돌풍"]} - ,rapid:{ - name:"급류",cause:"급류로",icon:"rapid",color:8375529,prefixes:["급류"]} - ,rock:{ - name:"바위 충돌",cause:"바위 충돌로",icon:"rock",color:12504016,prefixes:["바위"]} - ,wave:{ - name:"큰파도",cause:"큰파도로",icon:"wave",color:8902897,prefixes:["거센 파도","큰파도","큰 파도"]} - ,reef:{ - name:"암초 충돌",cause:"암초 충돌로",icon:"rock",color:10340045,prefixes:["암초"]} - ,swell:{ - name:"큰 너울",cause:"큰 너울로",icon:"wave",color:8042992,prefixes:["큰 너울"]} - ,storm:{ - name:"폭풍",cause:"폭풍으로",icon:"storm",color:12369136,prefixes:["폭풍"]} - ,thunder:{ - name:"번개",cause:"번개로",icon:"thunder",color:16766843,prefixes:["번개"]} - ,monster:{ - name:"몬스터의 물살",cause:"몬스터의 물살로",icon:"monster",color:12822761,prefixes:["몬스터"]} - ,log:{ - name:"통나무 충돌",cause:"통나무 충돌로",icon:"log",color:14464907,prefixes:["떠내려온 통나무","통나무"]} - ,vine:{ - name:"가시 덩굴",cause:"가시 덩굴로",icon:"vine",color:10869146,prefixes:["가시 덩굴"]} - ,ghost:{ - name:"망령의 손길",cause:"망령의 손길로",icon:"ghost",color:12892397,prefixes:["망령"]} - ,ice:{ - name:"얼음 충돌",cause:"얼음 덩어리 충돌로",icon:"ice",color:10938865,prefixes:["얼음"]} - } - ,LFi={ - name:"재난",cause:"재난으로",icon:"warning",color:16764803,prefixes:[]} - ; - function DFi(t){ - return NFi[t]??Object.values(NFi).find(i=>i.prefixes.some(i=>t.startsWith(i)))??LFi} - function GFi(t){ - if(NFi[t])return t; - const i=Object.entries(NFi).find(([,i])=>i.prefixes.some(i=>t.startsWith(i))); - return i?i[0]:null} - function BFi(t,i=30){ - const s=new ep,e=t.color,n={ - color:e,width:2.1,cap:"round",join:"round"} - ; - switch(s.eventMode="none",t.icon){ - case"wind":s.moveTo(3,10).lineTo(20,10).bezierCurveTo(28,10,27,2,22,4).stroke(n).moveTo(1,16).lineTo(25,16).bezierCurveTo(33,16,31,24,26,22).stroke(n).moveTo(5,22).lineTo(16,22).bezierCurveTo(23,22,22,30,17,28).stroke(n); - break; - case"wave":s.moveTo(2,25).bezierCurveTo(9,24,7,10,16,6).bezierCurveTo(23,2,30,7,27,12).bezierCurveTo(24,7,18,10,20,16).bezierCurveTo(22,23,27,23,30,23).lineTo(30,28).lineTo(2,28).closePath().fill({ - color:e,alpha:.23} - ).stroke(n).moveTo(6,25).quadraticCurveTo(13,28,18,23).stroke({ - ...n,color:15202047,width:1.6} - ); - break; - case"rapid":for(let t=0; - t<3; - t++){ - const i=7+9*t,e=1===t?2:5; - s.moveTo(e,i).bezierCurveTo(e+5,i-4,17,i+4,26,i).moveTo(22,i-3).lineTo(27,i).lineTo(23,i+4).stroke(n)} - break; - case"rock":s.poly([4,24,9,11,16,7,24,14,28,24]).fill({ - color:e,alpha:.25} - ).stroke(n).moveTo(16,8).lineTo(14,17).lineTo(22,23).stroke({ - ...n,width:1.4} - ).moveTo(1,28).quadraticCurveTo(8,25,15,28).quadraticCurveTo(22,31,31,27).stroke(n).moveTo(25,8).lineTo(28,4).moveTo(28,12).lineTo(31,11).stroke(n); - break; - case"storm":s.moveTo(7,19).bezierCurveTo(0,19,0,10,7,10).bezierCurveTo(7,0,21,0,23,9).bezierCurveTo(33,7,34,19,25,19).closePath().fill({ - color:e,alpha:.25} - ).stroke(n).moveTo(8,23).lineTo(5,28).moveTo(16,23).lineTo(13,29).moveTo(24,23).lineTo(21,28).stroke(n); - break; - case"thunder":s.poly([18,2,5,18,14,18,11,30,28,12,18,12,23,2]).fill(e); - break; - case"monster":s.moveTo(4,25).bezierCurveTo(11,26,11,17,12,8).bezierCurveTo(13,1,26,2,26,11).bezierCurveTo(26,17,20,18,18,14).bezierCurveTo(23,15,23,8,19,9).bezierCurveTo(17,10,24,27,13,28).closePath().fill({ - color:e,alpha:.3} - ).stroke(n).moveTo(1,29).quadraticCurveTo(7,26,15,29).quadraticCurveTo(23,32,31,27).stroke(n); - break; - case"log":s.moveTo(9,10).lineTo(24,3).quadraticCurveTo(33,10,27,20).lineTo(13,28).closePath().fill({ - color:e,alpha:.22} - ).stroke(n).ellipse(10,19,6,9).stroke(n).ellipse(10,19,2.5,4).stroke({ - ...n,width:1.4} - ).moveTo(18,13).lineTo(25,9).moveTo(20,20).lineTo(27,16).stroke({ - ...n,width:1.4} - ); - break; - case"vine":s.moveTo(5,29).bezierCurveTo(30,27,4,5,27,3).stroke({ - ...n,width:3} - ).poly([13,23,6,19,13,18]).fill(e).poly([17,14,25,11,18,9]).fill(e).moveTo(15,9).quadraticCurveTo(4,9,5,3).quadraticCurveTo(14,1,15,9).fill({ - color:e,alpha:.5} - ); - break; - case"ghost":s.moveTo(5,28).lineTo(5,13).bezierCurveTo(5,-1,27,-1,27,13).lineTo(27,28).lineTo(21,24).lineTo(16,29).lineTo(11,24).closePath().fill({ - color:e,alpha:.2} - ).stroke(n).ellipse(12,13,1.7,2.4).fill(e).ellipse(21,13,1.7,2.4).fill(e); - break; - case"ice":s.poly([7,6,21,3,29,13,24,27,10,30,3,19]).fill({ - color:e,alpha:.2} - ).stroke(n).moveTo(7,6).lineTo(13,15).lineTo(29,13).moveTo(13,15).lineTo(10,30).moveTo(17,8).lineTo(21,7).stroke({ - ...n,width:1.5} - ); - break; - default:s.poly([16,3,30,28,2,28]).stroke(n).moveTo(16,11).lineTo(16,19).stroke(n).circle(16,24,1.4).fill(e)} - return s.scale.set(i/32),s} - function UFi(t,i){ - const s=DFi(t.text),e=t.dmg>0,n=new Ke,h=Jxi(e?`${ - s.cause} - 내구도가 감소했습니다.`:`${ - s.name} - 에도 배가 끄떡없습니다.`,Bxi,14),r=Jxi(e?`내구도 −${ - rTi(t.dmg)} - · 남은 내구도 ${ - Math.ceil(t.hp)} - `:"내구도 손상 없음",e?Hxi:$xi,12,!1),o=Math.min(i,Math.max(300,Math.max(h.width,r.width)+80)); - h.setWrapWidth(o-80),r.setWrapWidth(o-80); - const a=Math.max(62,h.height+r.height+23),c=new ep; - c.roundRect(0,0,o,a,13).fill({ - color:e?2694947:Ixi,alpha:.96} - ).roundRect(11,(a-40)/2,40,40,11).fill({ - color:s.color,alpha:.12} - ); - const l=BFi(s,30); - return l.position.set(16,(a-30)/2),h.position.set(64,10),r.position.set(64,14+h.height),n.addChild(c,l,h,r),n.eventMode="none",n} - Qt(DFi,"hazardArt"),Qt(GFi,"hazardKey"),Qt(BFi,"hazardIcon"),Qt(UFi,"hazardNotice"); - const FFi=.22,$Fi=2.3,HFi=Qt(t=>Math.max(0,Math.min(1,t)),"c01$2"),WFi=Qt(t=>1-(1-t)*(1-t),"eOut$1"),VFi=Qt(t=>1+2.70158*Math.pow(t-1,3)+1.70158*Math.pow(t-1,2),"backOut$2"); - function jFi(t){ - const i=HFi((t-$Fi)/(2.6-$Fi)),s=VFi(HFi(t/FFi)); - return{ - dim:.55*HFi(t/.15)*(1-i),y:60*s-60,scale:1.12-.12*s,rot:4*s-6,alpha:(t>0?1:0)*(1-i),shake:t<FFi?0:8*(1-HFi((t-FFi)/.3))*Math.sin(60*(t-FFi)),flash:t<FFi?0:.7*(1-HFi((t-FFi)/.12)),numAlpha:t<.3?0:1,numScale:1.8-.8*HFi((t-.3)/.15),capAlpha:HFi((t-.4)/.2),drain:WFi(HFi((t-.35)/.6)),fade:HFi((t-.95)/.35)} - } - function KFi(t,i,s){ - const e=jFi(s),n=t+(i-t)*e.drain; - return{ - cur:n,lostTo:t+(n-t)*e.fade} - } - function zFi(t){ - const i=t.filter(t=>"hazard"===t.kind&&t.dmg>0); - return i.length?{ - main:i.reduce((t,i)=>i.dmg>t.dmg?i:t),more:i.length-1} - :{ - main:null,more:0} - } - Qt(jFi,"cutPose"),Qt(KFi,"cutHp"),Qt(zFi,"pickCut"); - const YFi=new Set(["gust","log","vine","ghost","ice"]); - function qFi(t,i){ - return"R"!==i&&YFi.has(t)?`${ - t} - _sea`:t} - Qt(qFi,"cutArt"); - const XFi={ - gust:["돌풍!","돌풍에 배가 밀렸어요"],rapid:["급류!","급류에 휩쓸렸어요"],rock:["바위 충돌!","바위에 배가 긁혔어요"],wave:["거센 파도!","거센 파도가 배를 덮쳤어요"],reef:["암초 충돌!","암초에 배 밑이 부딪혔어요"],swell:["큰 너울!","큰 너울에 배가 들렸다 떨어졌어요"],storm:["폭풍!","폭풍이 배를 몰아쳤어요"],thunder:["번개!","번개가 배에 떨어졌어요"],monster:["몬스터의 물살!","몬스터가 지나가며 물살이 일었어요"],log:["통나무 충돌!","떠내려온 통나무에 부딪혔어요"],vine:["가시 덩굴!","가시 덩굴이 배에 감겼어요"],ghost:["망령의 손길!","망령이 배를 붙잡아 끌었어요"],ice:["얼음 충돌!","얼음 덩어리에 부딪혔어요"]} - ,JFi=7035454,QFi=class extends Ke{ - constructor(){ - super(),Zt(this,"dim",new ep),Zt(this,"card",new Ke),Zt(this,"cardBg",new ep),Zt(this,"img",new Xe),Zt(this,"imgMask",new ep),Zt(this,"flash",new ep),Zt(this,"bar",new ep),Zt(this,"num",Jxi("",15029053,30)),Zt(this,"cap",Jxi("",JFi,Zxi,!1)),Zt(this,"title",Jxi("",2825477,24)),Zt(this,"moreL",Jxi("",JFi,Zxi)),Zt(this,"t",0),Zt(this,"play",null),Zt(this,"hitDone",!1),Zt(this,"onHit",null),Zt(this,"onEnd",null),Zt(this,"barW",0),this.dim.eventMode="static",this.dim.on("pointertap",t=>{ - t.stopPropagation(),this.skip()} - ),this.card.eventMode="static",this.card.on("pointertap",t=>{ - t.stopPropagation(),this.skip()} - ),this.img.mask=this.imgMask; - for(const t of[this.cardBg,this.img,this.imgMask,this.flash,this.bar,this.num,this.cap,this.title,this.moreL])t.eventMode="none"; - this.card.addChild(this.cardBg,this.img,this.imgMask,this.flash,this.title,this.moreL,this.cap,this.bar,this.num),this.addChild(this.dim,this.card),this.visible=!1,this.once("destroyed",()=>Mn.shared.remove(this.tick,this))} - get playing(){ - return!!this.play} - get hpNow(){ - return this.play?KFi(this.play.from,this.play.to,this.t).cur:null} - start(t,i,s){ - this.stop(),this.play=t,this.onHit=i,this.onEnd=s,this.t=0,this.hitDone=!1; - const[e,n]=XFi[t.key]??["돌발사건!","배가 크게 흔들렸어요"],h=Math.min(t.W-48,520),r=h-24,o=Math.round(2*r/3); - this.img.texture=t.tex,this.img.position.set(12,12),this.img.width=r,this.img.height=o,this.imgMask.clear().roundRect(12,12,r,o,14).fill(16777215),this.flash.clear().roundRect(12,12,r,o,14).fill(16777215),this.title.text=e,this.title.position.set(20,12+o+12),this.moreL.text=t.more>0?`외 ${ - t.more} - 건`:"",this.moreL.position.set(h-20-this.moreL.width,this.title.y+(this.title.height-this.moreL.height)/2),this.cap.text=n,this.cap.position.set(20,this.title.y+this.title.height+2); - const a=this.cap.y+this.cap.height+12; - this.barW=h-40-96,this.bar.position.set(20,a),this.num.text=`−${ - Math.round(t.dmg)} - `,this.num.position.set(20+this.barW+14,a+6-this.num.height/2); - const c=a+12+18; - this.cardBg.clear().roundRect(0,12,h,c,22).fill({ - color:0,alpha:.4} - ).roundRect(0,0,h,c,22).fill(16511967),this.card.pivot.set(h/2,c/2),this.card.hitArea=new $i(0,0,h,c),this.card.position.set(t.W/2,Math.round(.46*t.H)),this.dim.clear().rect(0,0,t.W,t.H).fill(0),this.visible=!0,this.draw(),Mn.shared.add(this.tick,this)} - skip(){ - var t; - !this.play||this.t<.5||this.t>=$Fi||(this.hitDone||(this.hitDone=!0,null==(t=this.onHit)||t.call(this)),this.t=$Fi)} - stop(){ - Mn.shared.remove(this.tick,this),this.play=null,this.visible=!1} - tick(t){ - var i; - const s=this.play; - if(s){ - if(this.t+=t.deltaMS/1e3*(s.speed??1),!this.hitDone&&this.t>=FFi&&(this.hitDone=!0,null==(i=this.onHit)||i.call(this)),this.t>=2.6){ - const t=this.onEnd; - return this.stop(),void(null==t||t())} - this.draw()} - } - draw(){ - const t=this.play; - if(!t)return; - const i=jFi(this.t),s=KFi(t.from,t.to,this.t); - this.dim.alpha=i.dim,this.card.alpha=i.alpha,this.card.scale.set(i.scale),this.card.rotation=i.rot*Math.PI/180,this.card.position.set(t.W/2+i.shake,Math.round(.46*t.H)+i.y),this.flash.alpha=i.flash,this.cap.alpha=i.capAlpha,this.num.alpha=i.numAlpha,this.num.scale.set(i.numScale); - const e=this.barW,n=Math.max(0,s.cur/t.max),h=Math.max(n,s.lostTo/t.max),r=this.bar.clear().roundRect(0,0,e,12,6).fill(15195332); - n>0&&r.roundRect(0,0,Math.max(12,e*n),12,6).fill(8378016),h>n+.001&&r.rect(e*n,0,e*(h-n),12).fill(16743016)} - } - ; - Qt(QFi,"FishingHazardCut"); - let ZFi=QFi; - const t$i=Qt(t=>!!t&&t in XFi,"hasHazardCut"); - function i$i(t,i){ - try{ - QG.getInstance().playSFX(t,i)} - catch{ - } - } - Qt(i$i,"sfx$2"); - const s$i=XTi.find(t=>"boat"===t.key).names,e$i=Qt(t=>t>.5?8378016:t>.25?16106577:16739179,"hpColor"),n$i=class extends Ke{ - constructor(t,i){ - super(),Zt(this,"chip",new Ke),Zt(this,"chipBg",new ep),Zt(this,"chipBar",new ep),Zt(this,"chipText",Jxi("",Bxi,12)),Zt(this,"banner",new Ke),Zt(this,"bannerBg",new ep),Zt(this,"bannerBar",new ep),Zt(this,"bannerTitle",Jxi("",Bxi,14)),Zt(this,"bannerSub",Jxi("",Uxi,12,!1)),Zt(this,"stopBtn",new cRi("그만 고치기",112,34,13)),Zt(this,"panelBox",new Ke),Zt(this,"helpBox",new Ke),Zt(this,"helpTarget",null),Zt(this,"helpBusy",!1),Zt(this,"notices",[]),Zt(this,"cut",new ZFi),Zt(this,"cutHold",null),Zt(this,"chipKey",""),Zt(this,"wasFixing",!1),Zt(this,"finishFxAt",0),Zt(this,"onPeek",null),Zt(this,"bannerY",Qt(()=>166,"bannerY")),Zt(this,"panelSig",""),Zt(this,"panelLive",null),Zt(this,"helpSig",""),Zt(this,"helpLive",null),this.scene=t,this.viewH=i,this.chip.addChild(this.chipBg,this.chipBar,this.chipText),this.chip.eventMode="static",this.chip.cursor="pointer",this.chip.on("pointertap",t=>{ - t.stopPropagation(),this.openPanel()} - ),this.banner.addChild(this.bannerBg,this.bannerBar,this.bannerTitle,this.bannerSub,this.stopBtn),this.banner.visible=!1,this.banner.eventMode="static",this.banner.on("pointertap",t=>t.stopPropagation()),this.stopBtn.onTap=()=>{ - this.stop()} - ,this.panelBox.visible=this.helpBox.visible=!1,this.panelBox.eventMode=this.helpBox.eventMode="static",this.addChild(this.banner,this.panelBox,this.helpBox,this.cut),t.sailBlock=()=>ixi.getInstance().boatProblem(); - const s=ixi.getInstance().onBoatLog(t=>this.onLogs(t)); - this.once("destroyed",()=>{ - s(); - for(const t of this.notices)yx.killTweensOf(t); - this.notices=[]} - )} - get panelOpen(){ - return this.panelBox.visible||this.helpBox.visible} - get bannerBottom(){ - return this.bannerY()+(this.banner.visible?66:0)} - closeAll(){ - this.panelBox.visible=!1,this.helpBox.visible=!1,this.helpTarget=null} - update(){ - const t=ixi.getInstance(); - if(!t.ready)return; - const i=t.boatHp(),s=(this.cut.hpNow??this.cutHold??i.hp)/i.max,e=i.fixing?`수리 ${ - Math.floor(100*s)} - %`:`배 ${ - Math.ceil(i.hp)} - /${ - i.max} - `,n=`${ - e} - |${ - Math.round(50*s)} - |${ - i.fixing} - `; - if(n!==this.chipKey){ - this.chipKey=n,this.chipText.text=e,this.chipText.textColor=i.fixing?16757611:s<=.25?Hxi:Bxi; - const t=Math.max(92,this.chipText.width+20); - this.chipBg.clear().roundRect(0,0,t,26,8).fill({ - color:i.fixing?3810324:Vxi,alpha:.78} - ),this.chipText.position.set(10,3),this.chipBar.clear(),fRi(this.chipBar,10,20,t-20,3,s,i.fixing?16757611:e$i(s),kxi),this.chip.hitArea=new $i(0,0,t,26)} - this.wasFixing&&!i.fixing&&i.hp>=i.max-.5&&this.playFinish(),this.wasFixing=i.fixing,this.scene.setFixing(i.fixing?{ - broken:i.broken,progress:i.hp/i.max} - :null),this.renderBanner(),this.panelBox.visible&&this.renderPanel(),this.helpBox.visible&&this.renderHelp()} - renderBanner(){ - var t; - const i=ixi.getInstance(),s=i.boatHp(); - if(this.banner.visible=s.fixing,!s.fixing)return; - const e=APi.BLEED_W,n=Math.min(e-20,460),h=(e-n)/2; - this.banner.position.set(h,this.bannerY()),this.bannerBg.clear().roundRect(0,0,n,58,12).fill({ - color:s.broken?3807764:2827284,alpha:.92} - ),this.bannerTitle.text=s.broken?"배가 고장 났어요 · 고치는 중":"배를 고치는 중",this.bannerTitle.textColor=s.broken?16757611:Dxi,this.bannerTitle.position.set(14,8),sRi(this.bannerTitle,n-150); - const r=(null==(t=i.state.boat)?void 0:t.helps.length)??0,o=Math.max(0,s.endAt-i.now()),a=!s.broken||s.hp>=DSi.MOVE_MIN; - this.bannerSub.text=`${ - wRi(o)} - 남음 · 내구도 ${ - Math.floor(s.hp)} - /${ - s.max} - ${ - r?` · 도움 ${ - r} - 명`:""} - ${ - a?"":` · ${ - DSi.MOVE_MIN} - 까지는 고쳐야 떠나요`} - `,this.bannerSub.position.set(14,30),sRi(this.bannerSub,n-150),this.bannerBar.clear(),fRi(this.bannerBar,14,49,n-150,4,s.hp/s.max,16757611,4864552),this.stopBtn.position.set(n-124,12),this.stopBtn.setPrimary(!1),this.stopBtn.enabled=a,this.banner.hitArea=new $i(0,0,n,58)} - async stop(){ - const t=await ixi.getInstance().boatRepair("stop"); - t&&bH.getInstance().showMessage(t)} - async start(){ - const t=await ixi.getInstance().boatRepair("start"); - t?bH.getInstance().showMessage(t):(this.closeAll(),YG("light"),this.scene.repairStarted(),bH.getInstance().showMessage("배를 고치기 시작했어요. 고치는 동안은 낚시를 쉬어요"))} - openPanel(){ - this.helpBox.visible=!1,this.panelBox.visible=!0,this.panelSig="",this.renderPanel(),yx.fromTo(this.panelBox,{ - alpha:0} - ,{ - alpha:1,duration:.15} - )} - renderPanel(){ - const t=ixi.getInstance(),i=t.state,s=t.boatHp(),e=i.gear.boat,n=t.helpPts(),h=tTi(e),r=t.now(),o=`${ - e} - |${ - i.spot.race} - |${ - i.spot.zone} - |${ - s.fixing} - |${ - s.hp>=s.max} - `; - if(o===this.panelSig&&this.panelLive)return this.panelLive.hp.text=`내구도 ${ - Math.floor(s.hp)} - / ${ - s.max} - `,this.panelLive.help.text=`도움 점수 ${ - n.n} - /${ - h} - ${ - n.nextAt?` · 다음 ${ - wRi(n.nextAt-r)} - `:""} - · 고치는 남의 배를 누르면 3% 앞당겨 줘요`,this.panelLive.bar.clear(),void fRi(this.panelLive.bar,0,0,this.panelLive.barW,8,s.hp/s.max,s.fixing?16757611:e$i(s.hp/s.max)); - this.panelSig=o; - const a=this.panelBox; - a.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const c=APi.BLEED_W,l=this.viewH(),u=Math.min(c-20,480),d=(c-u)/2,f=d+18,p=$Si(i.spot.race,i.spot.zone),w=jSi(i.spot.race,i.spot.zone),g=330,m=l-g-8,v=eRi(u,g,Vxi,null,14); - v.alpha=.96,v.position.set(d,m); - const _=Jxi(`${ - s$i[e]} - · 배 ${ - e+1} - 단계`,Dxi,17); - _.position.set(f,m+14); - const M=Jxi(`튼튼함 ${ - eTi(i)} - · 다 고치는 데 ${ - wRi(aTi(i))} - (${ - gTi[i.spot.zone]} - ) · 배 장비 포함`,Uxi,12,!1); - M.position.set(f,m+40),sRi(M,u-36); - const b=Jxi(`내구도 ${ - Math.floor(s.hp)} - / ${ - s.max} - `,Bxi,14); - b.position.set(f,m+62); - const y=new ep,E=u-36; - y.position.set(f,m+86),fRi(y,0,0,E,8,s.hp/s.max,s.fixing?16757611:e$i(s.hp/s.max)); - const A=FSi[p-1],S=Jxi(`이 지역 난이도 ${ - p} - /12 · ${ - dTi(i.spot.race,i.spot.zone)} - ${ - e>=A?" · 내 배로 안정적":" · 내 배는 자주 고장 나요"} - `,e>=A?$xi:Hxi,13); - S.position.set(f,m+108),sRi(S,u-36); - const T=[v,_,M,b,y,S]; - let C=m+134; - for(const x of[...w].sort((t,i)=>i.dmg-t.dmg)){ - const t=nTi(x.dmg,eTi(i)),s=DFi(x.key),e=BFi(s,16),n=Jxi(s.name,Bxi,12,!1); - e.position.set(f,C),n.position.set(f+23,C); - const h=Jxi(t>0?`내구도 −${ - rTi(t)} - `:"끄떡없음",t>0?Hxi:$xi,12); - h.position.set(f+190,C),T.push(e,n,h),C+=20} - const O=Jxi(`도움 점수 ${ - n.n} - /${ - h} - ${ - n.nextAt?` · 다음 ${ - wRi(n.nextAt-r)} - `:""} - · 고치는 남의 배를 누르면 3% 앞당겨 줘요`,Uxi,12,!1); - O.position.set(f,m+g-82),sRi(O,u-36),T.push(O),this.panelLive={ - hp:b,help:O,bar:y,barW:E} - ; - const I=new cRi("닫기",96,40,14); - I.setPrimary(!1),I.onTap=()=>this.closeAll(); - const k=new cRi("",170,40,14); - if(k.position.set(d+u-18-170,m+g-54),I.position.set(k.x-8-96,k.y),s.fixing)k.setText("고치는 중"),k.enabled=!1; - else if(s.hp>=s.max)k.setText("고칠 곳이 없어요"),k.enabled=!1; - else{ - const t=(s.max-s.hp)/s.max*aTi(i); - k.setText(`고치기 (${ - wRi(t)} - )`),k.onTap=()=>{ - this.start()} - } - T.push(I,k),a.hitArea=new $i(0,0,c,l),a.removeAllListeners("pointertap"),a.on("pointertap",t=>{ - t.stopPropagation(),a.toLocal(t.global).y<m&&this.closeAll()} - ),a.addChild(...T)} - wantsHelp(t){ - return!!t.fx&&t.fx>ixi.getInstance().realNow()} - openHelp(t){ - this.panelBox.visible=!1,this.helpTarget=t,this.helpBox.visible=!0,this.helpSig="",this.renderHelp(),yx.fromTo(this.helpBox,{ - alpha:0,y:12} - ,{ - alpha:1,y:0,duration:.16} - ),YG("light")} - renderHelp(){ - const t=this.helpTarget,i=ixi.getInstance(); - if(!t)return void(this.helpBox.visible=!1); - const s=i.others.find(i=>i.id===t.id)??t,e=i.realNow(),n=Math.max(0,(s.fx??0)-e),h=i.helpPts(),r=this.scene.boatPoint("me"),o=this.scene.boatPoint(t.id),a=!!r&&!!o&&Math.hypot(r.x-o.x,r.y-o.y)<=DSi.HELP_RANGE,c=`${ - t.id} - |${ - n>0} - |${ - h.n} - |${ - a} - `,l=n>0?`${ - s.fk?"고장 나서 고치는 중":"고치는 중"} - · ${ - wRi(n)} - 남음`:"다 고친 것 같아요"; - if(c===this.helpSig&&this.helpLive)return void(this.helpLive.sub.text=l); - this.helpSig=c; - const u=this.helpBox; - u.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const d=APi.BLEED_W,f=this.viewH(),p=Math.min(d-20,480),w=(d-p)/2,g=w+18,m=f-168-8,v=eRi(p,168,Vxi,null,14); - v.alpha=.96,v.position.set(w,m); - const _=Jxi(`${ - t.n} - 님의 배`,Dxi,17); - _.position.set(g,m+14),sRi(_,p-36); - const M=Jxi(l,16757611,13); - M.position.set(g,m+40),sRi(M,p-36); - const b=Jxi(`도움 점수 ${ - h.n} - 개 · 한 번 도우면 다 고치는 시간의 3%를 앞당겨요 (한 번 고장에 한 번)`,Uxi,12,!1); - b.position.set(g,m+64),sRi(b,p-36),this.helpLive={ - sub:M} - ; - const y=new cRi("훔쳐보기",96,40,14); - y.setPrimary(!1),y.onTap=()=>{ - var t; - const i=this.helpTarget; - this.closeAll(),i&&(null==(t=this.onPeek)||t.call(this,i))} - ; - const E=new cRi("닫기",80,40,14); - E.setPrimary(!1),E.onTap=()=>this.closeAll(); - const A=new cRi("",160,40,14); - A.position.set(w+p-18-160,m+168-54),y.position.set(A.x-8-96,A.y),E.position.set(y.x-8-80,A.y),n<=0?(A.setText("다 고쳤어요"),A.enabled=!1):a?h.n<1?(A.setText(`점수 없음 · ${ - wRi((h.nextAt??i.now())-i.now())} - `),A.enabled=!1):(A.setText("수리 돕기 (점수 1)"),A.onTap=async()=>{ - if(this.helpBusy)return; - this.helpBusy=!0,A.enabled=!1; - const s=await i.boatHelp(t.id).finally(()=>{ - this.helpBusy=!1} - ); - if(s.message)return bH.getInstance().showMessage(s.message),void(A.destroyed||(A.enabled=!0)); - YG("medium"),this.scene.helpFx(t.id),this.closeAll(),bH.getInstance().showMessage(`${ - t.n} - 님의 배 수리를 도와줬어요! (3% 앞당김)`)} - ):(A.setText("옆으로 가기"),A.onTap=()=>{ - this.scene.sailNearBoat(t.id)&&(bH.getInstance().showMessage("옆에 닿으면 다시 눌러 수리 돕기"),this.closeAll())} - ),r$i(u,[v,_,M,b,E,y,A]),u.hitArea=new $i(0,0,d,f),u.removeAllListeners("pointertap"),u.on("pointertap",t=>{ - t.stopPropagation(),u.toLocal(t.global).y<m&&this.closeAll()} - )} - onLogs(t){ - const i=t.filter(t=>"wave"===t.kind); - i.length&&performance.now()<this.scene.waveIncoming?this.scene.expectWave().then(s=>{ - if(!this.destroyed){ - if(!s)for(const t of i)this.scene.boatHit(t.dmg); - this.playLogs(t.filter(t=>"wave"!==t.kind))} - } - ):this.playLogs(t)} - playLogs(t){ - var i,s; - const{ - main:e,more:n} - =zFi(t); - for(const h of t)if("wave"===h.kind){ - if(h.rid&&ixi.getInstance().ringsShown.has(h.rid))continue; - this.scene.boatHit(h.dmg),h.dmg>0&&(YG(h.dmg>=30?"heavy":"medium"),i$i(QG.SFX_STONE_BREAK,.3))} - else if("hazard"===h.kind){ - if(e&&h.dmg>0&&h!==e)continue; - if(h===e&&this.playCut(h,n))continue; - this.hazardPlain(h)} - else if("broke"===h.kind)this.scene.boatHit(0,!0),this.scene.repairStarted(),this.notice("배가 고장 났어요! 고치는 동안은 낚시할 수 없어요",16777215,11879211),YG("heavy"); - else if("repaired"===h.kind)this.wasFixing?(this.playFinish(),this.wasFixing=!1):Date.now()-this.finishFxAt>5e3&&(this.notice("배를 다 고쳤어요! 다시 낚시해요",$xi,1194538),i$i(QG.SFX_GOLD_GOBLIN,.5)); - else if("help"===h.kind){ - this.notice(oTi(h.text),Dxi,2827284); - const t=ixi.getInstance(),e=(null==(i=t.state.boat)?void 0:i.helps)??[],n=e[e.length-1]??null,r=n?null==(s=t.others.find(t=>t.id===n))?void 0:s.n:void 0; - this.scene.helpFx("me",n,r?`+3% · ${ - r} - 님`:"수리 +3%")} - else"travel"===h.kind&&this.notice(oTi(h.text),16751752,3807764)} - hazardPlain(t){ - this.scene.boatHit(t.dmg),this.showNotice(UFi(t,Math.min(460,APi.BLEED_W-24))),t.dmg>0&&(YG(t.dmg>=30?"heavy":"medium"),i$i(QG.SFX_STONE_BREAK,.35))} - playCut(t,i){ - const s=GFi(t.text); - if(!t$i(s))return!1; - const e=ixi.getInstance(),n=e.boatHp().max,h=Math.min(n,t.hp+t.dmg); - this.cutHold=h; - const r=new Promise(t=>setTimeout(()=>t(null),1500)); - return Promise.race([NAi.hazardCut(qFi(s,e.state.spot.zone)),r]).then(e=>{ - this.cutHold=null,this.destroyed||(e?this.cut.start({ - key:s,tex:e,dmg:t.dmg,from:h,to:t.hp,max:n,more:i,W:APi.BLEED_W,H:this.viewH()} - ,()=>{ - this.scene.boatHit(t.dmg),YG(t.dmg>=30?"heavy":"medium"),i$i(QG.SFX_STONE_BREAK,.5)} - ,()=>this.update()):this.hazardPlain(t))} - ),!0} - async previewCut(t,i,s=1,e=0,n=!1){ - const h=await NAi.hazardCut(qFi(t,n?"C":"R")); - if(!h)return!1; - const r=ixi.getInstance().boatHp(),o=Math.max(i,r.hp); - return this.cut.start({ - key:t,tex:h,dmg:i,from:o,to:o-i,max:r.max,more:e,W:APi.BLEED_W,H:this.viewH(),speed:s} - ,()=>{ - this.scene.boatHit(i),YG(i>=30?"heavy":"medium"),i$i(QG.SFX_STONE_BREAK,.5)} - ,()=>this.update()),!0} - playFinish(){ - this.finishFxAt=Date.now(),this.scene.repairFinished()} - notice(t,i,s){ - const e=APi.BLEED_W,n=dRi(t,i,s,14,12); - n.scale.set(Math.min(1,(e-24)/n.width)),this.showNotice(n)} - showNotice(t){ - if(this.addChild(t),this.notices.push(t),this.notices.length>3){ - const t=this.notices.shift(); - yx.killTweensOf(t),t.destroy({ - children:!0} - )} - this.layoutNotices(),yx.fromTo(t,{ - alpha:0} - ,{ - alpha:1,duration:.2} - ),yx.to(t,{ - alpha:0,delay:3.2,duration:.5,onComplete:Qt(()=>{ - this.notices=this.notices.filter(i=>i!==t),t.destroy({ - children:!0} - ),this.layoutNotices()} - ,"onComplete")} - )} - layoutNotices(){ - let t=this.viewH()-104; - for(let i=this.notices.length-1; - i>=0; - i--){ - const s=this.notices[i]; - s.position.set((APi.BLEED_W-s.width)/2,t-s.height),t=s.y-8} - } - layout(){ - this.chipKey="",this.panelSig="",this.helpSig="",this.layoutNotices()} - } - ; - Qt(n$i,"FishingBoatUi"); - let h$i=n$i; - function r$i(t,i){ - t.addChild(...i)} - Qt(r$i,"kids"); - const o$i={ - miss:9018538,good:9685215,great:9298101,perfect:16766836} - ,a$i={ - miss:"빗나감",good:"명중",great:"그레이트",perfect:"퍼펙트!"} - ,c$i={ - wood:14464634,iron:12375785,mithril:10807780,bone:15654080,thunder:16767050} - ,l$i=class extends Ke{ - constructor(){ - super(),Zt(this,"shade",new ep),Zt(this,"card",new Ke),Zt(this,"back",new ep),Zt(this,"rail",new ep),Zt(this,"focus",new ep),Zt(this,"trail",new ep),Zt(this,"needle",new Ke),Zt(this,"needleInk",new ep),Zt(this,"feedback",new ep),Zt(this,"weapon",new Xe),Zt(this,"title",Jxi("",Bxi,20)),Zt(this,"target",Jxi("",Uxi,16,!1)),Zt(this,"hint",Jxi("노란 칸에 맞춰 멈추세요",Uxi,16,!1)),Zt(this,"legends",["good","great","perfect"].map(t=>({ - grade:t,bg:new ep,text:Jxi("good"===t?"명중":`${ - a$i[t].replace("!","")} - ${ - rki(t)} - %`,o$i[t],16)} - ))),Zt(this,"fireBg",new ep),Zt(this,"fireText",Jxi("눌러서 던지기",Gxi,19)),Zt(this,"cancel",new Ke),Zt(this,"cancelBg",new ep),Zt(this,"cancelText",Jxi("취소",Uxi,17)),Zt(this,"range",fki),Zt(this,"motion",{ - } - ),Zt(this,"state","closed"),Zt(this,"startedAt",0),Zt(this,"lockedAt",0),Zt(this,"now",0),Zt(this,"w",1),Zt(this,"railW",1),Zt(this,"cardY",0),Zt(this,"accent",c$i.wood),Zt(this,"currentGrade",null),Zt(this,"lockGrade","miss"),Zt(this,"finishResolve",null),Zt(this,"value",-1),Zt(this,"onFire",null),Zt(this,"onCancel",null),Zt(this,"onKey",Qt(t=>{ - var i,s; - "aiming"!==this.state||t.repeat||t.target instanceof HTMLElement&&(t.target.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(t.target.tagName))||"Space"!==t.code&&"Enter"!==t.code&&"Escape"!==t.code||(t.preventDefault(),t.stopPropagation(),"Escape"===t.code?null==(i=this.onCancel)||i.call(this):null==(s=this.onFire)||s.call(this))} - ,"onKey")),this.visible=!1,this.eventMode="none",this.weapon.anchor.set(.5),this.weapon.scale.set(.36),this.weapon.rotation=-.3,this.needle.addChild((new ep).roundRect(-3.5,-6,7,41,2).fill(Vxi),this.needleInk),this.needleInk.roundRect(-1.5,-5,3,39,1).fill(16774361).poly([-6,-13,6,-13,0,-5]).fill(16774361).poly([-4,37,4,37,0,32]).fill(16774361),this.card.addChild(this.back,this.rail,this.focus,this.trail,this.needle,this.feedback,this.weapon,this.title,this.target,this.hint); - for(const t of this.legends)this.card.addChild(t.bg,t.text); - this.cancel.addChild(this.cancelBg,this.cancelText),this.cancel.eventMode="static",this.cancel.cursor="pointer",this.cancel.on("pointerdown",t=>{ - var i; - t.stopPropagation(),"aiming"===this.state&&(null==(i=this.onCancel)||i.call(this))} - ),this.cancel.on("pointertap",t=>t.stopPropagation()),this.card.addChild(this.fireBg,this.fireText,this.cancel),this.addChild(this.shade,this.card),this.on("pointerdown",t=>{ - var i; - t.stopPropagation(),"aiming"===this.state&&(null==(i=this.onFire)||i.call(this))} - ),this.on("pointertap",t=>t.stopPropagation())} - open(t,i,s,e,n=performance.now(),h=fki,r={ - } - ){ - this.close(),this.range=h,this.motion=r,this.state="aiming",this.visible=!0,this.eventMode="static",this.cursor="pointer",this.startedAt=this.now=n,this.value=-1,this.currentGrade=null,this.accent=c$i[t],this.weapon.texture=eLi(t),this.title.text=$Ii[t].name,this.title.textSize=20,this.title.textColor=this.accent,this.target.text=i,this.hint.text="노란 칸에 맞춰 멈추세요",this.fireText.text="눌러서 던지기",this.cancel.visible=!0,this.layout(s,e),this.update(n),window.addEventListener("keydown",this.onKey)} - layout(t,i){ - this.hitArea=new $i(0,0,t,i),this.w=Math.min(560,t-24),this.railW=this.w-40,this.cardY=Math.max(12,i-242-Math.min(146,.2*i)),this.card.position.set((t-this.w)/2,this.cardY),this.shade.clear().rect(0,0,t,i).fill({ - color:0,alpha:.12} - ),this.back.clear().roundRect(0,4,this.w,242,16).fill({ - color:0,alpha:.26} - ).roundRect(0,0,this.w,242,16).fill({ - color:Ixi,alpha:.98} - ).roundRect(.5,.5,this.w-1,241,16).stroke({ - color:this.accent,alpha:.5,width:1} - ).moveTo(18,46).lineTo(this.w-18,46).stroke({ - color:Lxi,alpha:.8,width:1} - ),this.weapon.position.set(40,25),this.title.position.set(72,11),sRi(this.title,this.w-90),sRi(this.target,.4*this.w),this.target.position.set(this.w-20-this.target.width,52),this.hint.position.set(20,52),sRi(this.hint,.55*this.w-22),this.drawRail(),this.needle.y=90; - const s=(this.w-40)/3; - this.legends.forEach((t,i)=>{ - sRi(t.text,s-12),t.text.position.set(20+i*s+(s-t.text.width)/2,138+(34-t.text.height)/2)} - ),this.cancel.position.set(16,184),this.cancel.hitArea=new $i(0,-4,84,54),this.cancelBg.clear().roundRect(0,0,84,46,9).fill(kxi),this.cancelText.position.set((84-this.cancelText.width)/2,(46-this.cancelText.height)/2),this.currentGrade=null,this.paintGrade("locked"===this.state?this.lockGrade:wki(this.value,this.range)),this.placeNeedle()} - drawRail(){ - const t=this.rail.clear(),i=this.railW; - t.roundRect(17,87,i+6,34,9).fill(Vxi).roundRect(20,90,i,28,6).fill(kxi); - const s=20+i*(1+(this.range.center??0))/2; - for(const h of[{ - r:this.range.good,c:3304320} - ,{ - r:this.range.great,c:4756605} - ,{ - r:this.range.perfect,c:15316814} - ]){ - const e=Math.max(20,s-h.r*i/2),n=Math.min(20+i,s+h.r*i/2)-e; - t.roundRect(e,90,n,28,3).fill(h.c).roundRect(e+1,91,n-2,4,2).fill({ - color:16777215,alpha:.16} - )} - for(let h=0; - h<=20; - h++){ - const s=20+i*h/20; - t.moveTo(s,124).lineTo(s,118+(h%5?8:11))} - t.stroke({ - color:9020842,alpha:.35,width:1} - ); - const e=this.range.perfect*i/2,n=s; - this.focus.clear().moveTo(n-e,86).lineTo(n-e,82).lineTo(n-e+5,82).moveTo(n+e,86).lineTo(n+e,82).lineTo(n+e-5,82).stroke({ - color:o$i.perfect,width:1.5} - )} - paintGrade(t){ - if(t===this.currentGrade)return; - this.currentGrade=t; - const i=this.railW/3; - this.legends.forEach((s,e)=>{ - s.bg.clear().roundRect(20+e*i+2,138,i-4,34,8).fill({ - color:o$i[s.grade],alpha:t===s.grade?.17:.035} - ),s.text.alpha=t===s.grade?1:.68} - ); - const s="locked"===this.state,e=s?16:108,n=this.w-e-16; - this.fireBg.clear().roundRect(e,184,n,46,9).fill(s?kxi:this.accent),this.fireText.textColor=s?o$i[t]:1517611,this.fireText.position.set(e+(n-this.fireText.width)/2,184+(46-this.fireText.height)/2),this.needleInk.tint=s?o$i[t]:16777215} - placeNeedle(){ - this.needle.x=20+(this.value+1)*this.railW/2} - update(t){ - if(this.visible&&!this.destroyed)if(this.now=t,"aiming"===this.state){ - const i=Math.max(0,t-this.startedAt),s=XCi(i,this.motion),e=XCi(Math.max(0,i-28),this.motion); - this.value=s,this.placeNeedle(),this.paintGrade(wki(s,this.range)); - const n=Math.max(-26,Math.min(26,(e-s)*this.railW/2)); - this.trail.clear().poly([this.needle.x,100,this.needle.x+n,104,this.needle.x,108]).fill({ - color:16774361,alpha:.2} - ); - const h=Math.min(1,i/140); - this.card.alpha=.65+.35*h,this.card.y=this.cardY+(1-h)**2*7,this.focus.alpha=.65+.2*Math.sin(i/240)} - else if("locked"===this.state){ - const i=Math.max(0,t-this.lockedAt),s=Math.min(1,i/280); - this.needle.scale.set(1+.14*Math.sin(s*Math.PI)); - const e=this.needle.x,n=5+15*s; - if(this.feedback.clear().moveTo(e-n,88).lineTo(e-n,120).moveTo(e+n,88).lineTo(e+n,120).stroke({ - color:o$i[this.lockGrade],alpha:.6*(1-s),width:1.5} - ),s>=1&&this.finishResolve){ - const t=this.finishResolve; - this.finishResolve=null,t(!0)} - } - } - freeze(t,i=performance.now()){ - "aiming"===this.state&&(this.state="locked",this.lockedAt=this.now=i,this.trail.clear(),this.cancel.visible=!1,this.card.alpha=this.focus.alpha=1,this.card.y=this.cardY,this.setResult(t))} - setResult(t){ - this.lockGrade=t,this.currentGrade=null,this.title.text="great"===t||"perfect"===t?`${ - a$i[t]} - ${ - rki(t)} - %`:a$i[t],this.title.textSize=22,this.title.textColor=o$i[t],sRi(this.title,this.w-90),this.hint.text="조준 완료",this.fireText.text="작살 투척",this.paintGrade(t)} - finish(t){ - return"locked"===this.state&&this.visible?(this.setResult(t),this.now-this.lockedAt>=280?Promise.resolve(!0):new Promise(t=>{ - this.finishResolve=t} - )):Promise.resolve(!1)} - close(){ - var t; - this.state="closed",this.visible=!1,this.eventMode="none",this.needle.scale.set(1),this.feedback.clear(),window.removeEventListener("keydown",this.onKey),null==(t=this.finishResolve)||t.call(this,!1),this.finishResolve=null} - destroy(t){ - this.close(),super.destroy(t)} - } - ; - Qt(l$i,"FishingHarpoonGauge"); - let u$i=l$i; - const d$i=16739146,f$i=16757611; - function p$i(t,i=!1){ - return"live"===t.state?`${ - i?"사냥!":"지나가는 중"} - ${ - wRi(t.left)} - `:"soon"===t.state?`곧 와요 ${ - wRi(t.left)} - `:`${ - wRi(t.left)} - 뒤`} - Qt(p$i,"monsterTimeText"); - const w$i=class extends Ke{ - constructor(t,i=!0){ - super(),Zt(this,"body",new Ke),Zt(this,"bg",new ep),Zt(this,"art",new Xe(ls.EMPTY)),Zt(this,"edge",new ep),Zt(this,"ripple",new ep),Zt(this,"anim",null),Zt(this,"sig",""),this.size=t,this.rippleOn=i; - const s=t/2; - this.bg.circle(0,0,s).fill(1054235),this.art.anchor.set(.5),this.ripple.circle(0,0,s+1).stroke({ - color:d$i,width:Math.max(2,.09*t)} - ),this.ripple.visible=!1,this.body.position.set(s,s),this.ripple.position.set(s,s),this.body.addChild(this.bg,this.art,this.edge),this.addChild(this.ripple,this.body); - for(const e of[this.body,this.bg,this.art,this.edge,this.ripple])e.eventMode="none"} - set(t,i,s=!1){ - var e; - const n=`${ - t} - |${ - i} - |${ - s} - `; - if(n===this.sig)return this; - this.sig=n; - const h=NAi.monsterIcon(t),r=this.size/2; - this.art.texture=h??ls.EMPTY,h&&this.art.scale.set(1.12*this.size/Math.max(1,h.width)),this.art.tint=s?9079434:16777215,this.art.alpha=s?.75:1; - const o=Math.max(2,.09*this.size); - return this.edge.clear(),"live"===i?this.edge.circle(0,0,r).stroke({ - color:d$i,width:o} - ):"soon"===i&&this.edge.circle(0,0,r).stroke({ - color:f$i,width:.85*o} - ),null==(e=this.anim)||e.kill(),this.anim=null,this.ripple.visible=this.rippleOn&&"live"===i&&!s,this.ripple.visible&&(this.anim=yx.timeline({ - repeat:-1} - ).fromTo(this.ripple.scale,{ - x:1,y:1} - ,{ - x:1.7,y:1.7,duration:1.4,ease:"power1.out"} - ,0).fromTo(this.ripple,{ - alpha:.8} - ,{ - alpha:0,duration:1.4,ease:"power1.out"} - ,0)),this} - destroy(t){ - var i; - null==(i=this.anim)||i.kill(),this.anim=null,super.destroy(t)} - } - ; - Qt(w$i,"MonsterFace"); - let g$i=w$i; - const m$i=class t extends Ke{ - constructor(t,i,s,e,n,h){ - super(),Zt(this,"times",[]),Zt(this,"tick",Qt(()=>this.refresh(),"tick")),this.W=t,this.H=i,this.race=s,this.zone=e,this.real=n,this.opts=h; - const r=ski(s,e,n(),3,h.devAt),o=Math.min(t-40,470),a=20,c=(new ep).rect(0,0,t,i).fill({ - color:0,alpha:Nxi} - ); - c.eventMode="static",c.on("pointertap",t=>{ - t.stopPropagation(),queueMicrotask(()=>this.closeCard())} - ); - const l=new Ke,u=Jxi(`${ - MTi[`${ - s} - |${ - e} - `]??"이 물"} - 몬스터`,Dxi,21),d=nki(e),f=Jxi(d>1?`${ - d} - 번 수역부터 와요 (1~${ - d-1} - 번은 초급 수역)`:"이 물의 모든 수역에 와요",Uxi,14,!1),p=Jxi(`같은 물이면 모두 같은 시각에 ${ - Math.round(UIi.DUR_MS/6e4)} - 분 동안 지나가요`,Uxi,13,!1); - for(const M of[f,p])sRi(M,o-40); - let w=a; - u.position.set((o-u.width)/2,w),w+=u.height+6,f.position.set((o-f.width)/2,w),w+=f.height+2,p.position.set((o-p.width)/2,w),w+=p.height+12; - const g=[u,f,p]; - r.forEach(t=>{ - const i=(new ep).roundRect(a,w,o-40,56,12).fill(Ixi),s=new g$i(46); - s.position.set(28,w+5); - const e=Jxi(t.name,Bxi,17); - e.position.set(84,w+(56-e.height)/2); - const n=Jxi("",Bxi,16); - g.push(i,s,e,n),this.times.push({ - b:t,t:n,face:s} - ),w+=64} - ),w+=6; - const m=h.onRecords?(o-40-10)/2:o-40; - if(h.onRecords){ - const t=new cRi("기록 보기",m,50,16); - t.setPrimary(!1),t.position.set(a,w),t.onTap=()=>{ - const t=h.onRecords; - this.closeCard(),t()} - ,g.push(t)} - const v=new cRi("닫기",m,50,16); - v.position.set(h.onRecords?a+m+10:a,w),v.onTap=()=>this.closeCard(),g.push(v); - const _=w+50+a; - l.addChild(eRi(o,_,Rxi,null,18),...g),l.position.set((t-o)/2,Math.max(10,(i-_)/2)),l.eventMode="static",l.hitArea=new $i(0,0,o,_),l.on("pointertap",t=>t.stopPropagation()),this.addChild(c,l),this.eventMode="static",this.refresh(),SS.app.ticker.add(this.tick)} - static get isOpen(){ - var t; - return!!(null==(t=this.current)?void 0:t.parent)} - static close(t){ - var i,s; - t&&(null==(i=this.current)?void 0:i.parent)!==t||null==(s=this.current)||s.closeCard()} - static open(i,s,e,n,h,r,o={ - } - ){ - var a; - null==(a=this.current)||a.closeCard(); - const c=new t(s,e,n,h,r,o); - return i.addChild(c),this.current=c,yx.fromTo(c,{ - alpha:0} - ,{ - alpha:1,duration:.15} - ),c} - refresh(){ - const t=this.real(),i=Math.min(this.W-40,470); - for(const{ - b:s,t:e,face:n} - of this.times){ - const h=eki(s,t),r=t>=s.end?"지나갔어요":p$i(h); - if(e.text!==r){ - e.text=r,e.textColor=t>=s.end?Fxi:"live"===h.state?d$i:"soon"===h.state?f$i:Bxi; - const o=n.y-5; - e.position.set(i-20-14-e.width,o+(56-e.height)/2)} - n.set(s.kind,t>=s.end||"idle"===h.state?null:h.state)} - } - closeOne(){ - return this.closeCard(),!0} - closeCard(){ - SS.app.ticker.remove(this.tick),t.current===this&&(t.current=null),this.parent&&(this.parent.removeChild(this),queueMicrotask(()=>this.destroy({ - children:!0} - )))} - } - ; - Qt(m$i,"MonsterScheduleCard"),Zt(m$i,"current",null); - let v$i=m$i; - const _$i=class{ - constructor(t,i,s){ - Zt(this,"layer",new Ke),Zt(this,"line",new Ke),Zt(this,"lineFace",new g$i(26)),Zt(this,"lineName",Jxi("",Bxi,14)),Zt(this,"lineTime",Jxi("",Dxi,14)),Zt(this,"faces",[]),Zt(this,"sig",""),Zt(this,"legendAdded",!1),this.scene=t,this.real=i,this.devAt=s,this.line.addChild(this.lineFace,this.lineName,this.lineTime),this.line.eventMode="static",this.line.cursor="pointer",this.line.on("pointertap",t=>{ - t.stopPropagation(),this.openCard()} - ),this.layer.addChild(this.line); - try{ - this.addLegend(this.parts)} - catch{ - } - } - get parts(){ - return this.scene} - where(){ - const[t,i]=this.scene.mapKey.split("|"); - return t&&i?{ - race:t,zone:i} - :null} - openCard(){ - const t=this.where(),i=this.parts; - t&&v$i.open(i.bigMap,i.viewW,i.viewH,t.race,t.zone,this.real,{ - devAt:this.devAt()} - )} - sync(){ - let t,i; - try{ - t=this.parts,i=this.where()} - catch{ - return} - if(!((null==t?void 0:t.bigMap)&&t.bigImg&&i&&t.info&&this.scene.bigMapOpen))return this.layer.parent&&this.layer.parent.removeChild(this.layer),void(!this.scene.bigMapOpen&&(null==t?void 0:t.bigMap)&&v$i.close(t.bigMap)); - this.layer.parent!==t.bigMap&&t.bigMap.addChild(this.layer); - const s=this.real(),e=iki(i.race,i.zone,s,this.devAt()),n=eki(e,s); - this.lineFace.set(e.kind,"idle"===n.state?null:n.state),this.lineName.text=e.name,this.lineTime.text=p$i(n),this.lineTime.textColor="live"===n.state?d$i:"soon"===n.state?f$i:Dxi,this.lineName.position.set(32,(26-this.lineName.height)/2),this.lineTime.position.set(this.lineName.x+this.lineName.width+8,(26-this.lineTime.height)/2); - const h=this.lineTime.x+this.lineTime.width; - if(t.bigTitle&&t.bigClose){ - const i=t.bigClose.x-10,s=t.bigTitle.x+t.bigTitle.width+12,e=t.bigClose.y+20; - this.lineName.visible=i-s>=h,this.lineName.visible||(this.lineTime.x=32); - const n=this.lineName.visible?h:this.lineTime.x+this.lineTime.width; - this.line.position.set(i-n,e-13),this.line.hitArea=new $i(-6,-8,n+12,42)} - else this.lineName.visible=!0,this.line.position.set(t.bigImg.x+(t.bigImg.width-h)/2,Math.max(8,t.bigImg.y-36)),this.line.hitArea=new $i(-6,-8,h+12,42); - const r=t.bigImg.width/t.info.w,o=t.info.points.map((t,i)=>({ - q:t,n:i} - )).filter(({ - n:s} - )=>t.known(s)&&hCi({ - zone:i.zone,point:s} - )>=UIi.MIN_LEVEL),a=`${ - this.scene.mapKey} - |${ - o.map(t=>t.n).join(",")} - |${ - e.kind} - |${ - n.state} - |${ - Math.round(t.bigImg.x)} - |${ - Math.round(t.bigImg.y)} - |${ - Math.round(t.bigImg.width)} - `; - if(a!==this.sig){ - this.sig=a; - for(const t of this.faces)t.destroy({ - children:!0} - ); - this.faces=o.map(({ - q:i} - )=>{ - const s=new g$i(26).set(e.kind,"idle"===n.state?null:n.state); - return s.position.set(t.bigImg.x+i.x*r+10,t.bigImg.y+i.y*r-6),s.eventMode="static",s.cursor="pointer",s.hitArea=new $i(-6,-6,38,38),s.on("pointertap",t=>{ - t.stopPropagation(),this.openCard()} - ),this.layer.addChildAt(s,0),s} - )} - } - addLegend(t){ - if(this.legendAdded||!t.bigLegend)return; - this.legendAdded=!0; - const i=t.bigLegend.width+20,s=new g$i(16).set("catfish",null),e=Jxi("몬스터",Uxi,12,!1); - s.position.set(i,0),e.position.set(i+20,0),t.bigLegend.addChild(s,e)} - } - ; - Qt(_$i,"MonsterMapMarks"); - let M$i=_$i; - const b$i=class t{ - constructor(){ - Zt(this,"live",!1),Zt(this,"ws",null),Zt(this,"want",0),Zt(this,"room",""),Zt(this,"joined",""),Zt(this,"retry",0),Zt(this,"timer",null),Zt(this,"pinger",null),Zt(this,"ticket",null),Zt(this,"huntFns",new Set),Zt(this,"ringFns",new Set)} - static get(){ - return t.inst??(t.inst=new t)} - static url(t=GP.baseURL){ - try{ - const i=new URL(t); - if("localhost"===i.hostname||"127.0.0.1"===i.hostname)return`ws://${ - i.hostname} - :4111/fishing-ws`; - if("teledev.weracle.io"===i.hostname&&"4101"===i.port)return"wss://teledev.weracle.io:4101/fishing-ws"} - catch{ - } - return null} - start(t){ - this.ticket=t,1===++this.want&&this.connect()} - stop(){ - --this.want>0||(this.want=0,this.close())} - setWater(t){ - var i; - this.room=t,(null==(i=this.ws)?void 0:i.readyState)===WebSocket.OPEN&&this.joined!==t&&this.join()} - onHunt(t){ - return this.huntFns.add(t),()=>this.huntFns.delete(t)} - onRing(t){ - return this.ringFns.add(t),()=>this.ringFns.delete(t)} - async connect(){ - var i; - const s=t.url(); - if(!s||!this.want||this.ws)return; - const e=await(null==(i=this.ticket)?void 0:i.call(this).catch(()=>null)); - if(!e||!this.want||this.ws)return void(this.want&&!this.ws&&this.later()); - const n=new WebSocket(`${ - s} - ?t=${ - encodeURIComponent(e)} - `); - this.ws=n,n.onmessage=t=>this.onMessage(String(t.data)),n.onclose=()=>{ - this.ws===n&&(this.ws=null,this.live=!1,this.joined="",this.pinger&&(clearInterval(this.pinger),this.pinger=null),this.want&&this.later())} - ,n.onerror=()=>{ - } - } - later(){ - if(this.timer)return; - const t=Math.min(3e4,2e3*2**this.retry++); - this.timer=setTimeout(()=>{ - this.timer=null,this.connect()} - ,t)} - close(){ - this.timer&&(clearTimeout(this.timer),this.timer=null),this.pinger&&(clearInterval(this.pinger),this.pinger=null); - const t=this.ws; - this.ws=null,this.live=!1,this.joined=""; - try{ - null==t||t.close()} - catch{ - } - } - join(){ - var t; - this.room&&(null==(t=this.ws)?void 0:t.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify({ - event:"join",data:{ - room:this.room} - } - ))} - onMessage(t){ - var i; - let s; - try{ - s=JSON.parse(t)} - catch{ - return} - if("hello"===s.ev)this.retry=0,this.join(),this.pinger??(this.pinger=setInterval(()=>{ - var t; - (null==(t=this.ws)?void 0:t.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify({ - event:"ping"} - ))} - ,25e3)); - else if("joined"===s.ev)this.joined=(null==(i=s.data)?void 0:i.room)??"",this.live=this.joined===this.room; - else if("hunt"===s.ev&&s.data)for(const e of this.huntFns)e(s.data); - else if("ring"===s.ev&&s.data)for(const e of this.ringFns)e(s.data)} - } - ; - Qt(b$i,"FishingSocket"),Zt(b$i,"inst",null); - let y$i=b$i; - function E$i(t,i){ - try{ - QG.getInstance().playSFX(t,i)} - catch{ - } - } - function A$i(t,i,s){ - const e=t.charCodeAt(t.length-1); - return e<44032||e>55203?`${ - t} - ${ - i} - (${ - s} - )`:`${ - t} - ${ - (e-44032)%28?i:s} - `} - Qt(E$i,"sfx$1"),Qt(A$i,"josa"); - const S$i=230,T$i={ - miss:9018538,good:9685215,great:9298101,perfect:16766836} - ,C$i=class t extends Ke{ - constructor(t,i){ - super(),Zt(this,"chip",new Ke),Zt(this,"chipBg",new ep),Zt(this,"chipFace",new g$i(30,!1)),Zt(this,"chipText",Jxi("",Bxi,14)),Zt(this,"mapMarks"),Zt(this,"banner",new Ke),Zt(this,"bannerBg",new ep),Zt(this,"bannerBar",new ep),Zt(this,"bannerTitle",Jxi("",Bxi,14)),Zt(this,"bannerSub",Jxi("",Uxi,12,!1)),Zt(this,"throwBtn",new Ke),Zt(this,"throwGlow",new ep),Zt(this,"throwBg",new ep),Zt(this,"throwArt",new Xe(ls.EMPTY)),Zt(this,"throwText",Jxi("작살",Gxi,15)),Zt(this,"throwSub",Jxi("",Bxi,13)),Zt(this,"throwSubBg",new ep),Zt(this,"throwBadge",new ep),Zt(this,"throwBadgeText",Jxi("",Bxi,12)),Zt(this,"throwKey",""),Zt(this,"gauge",new u$i),Zt(this,"gaugeOn",!1),Zt(this,"throwing",!1),Zt(this,"preparing",!1),Zt(this,"aimId",null),Zt(this,"aimStartPerf",0),Zt(this,"aimEndPerf",0),Zt(this,"gaugeFrame",0),Zt(this,"aimTarget",null),Zt(this,"generation",0),Zt(this,"contextKey",""),Zt(this,"statusRevision",0),Zt(this,"records",new Ke),Zt(this,"boss",null),Zt(this,"status",null),Zt(this,"statusAt",0),Zt(this,"sockOff",[]),Zt(this,"statusQuiet",!1),Zt(this,"spawnedW",null),Zt(this,"alertMap",""),Zt(this,"spawnTry",0),Zt(this,"spawnFails",0),Zt(this,"craft",new Ke),Zt(this,"crafting",!1),Zt(this,"warnedW",null),Zt(this,"lastSeenResult",-1),Zt(this,"chipKey",""),Zt(this,"killedW",null),Zt(this,"killedAt",0),Zt(this,"mine",{ - w:null,dmg:0,last:!1} - ),Zt(this,"bossSeenAt",0),Zt(this,"card",null),Zt(this,"cardFor",null),Zt(this,"bannerY",Qt(()=>166,"bannerY")),Zt(this,"tickGauge",Qt(()=>{ - if(!this.gauge.visible||this.destroyed)return void(this.gaugeFrame=0); - if(this.aimId&&this.gaugeOn&&performance.now()>=this.aimEndPerf)return this.closeGauge(),void this.renderThrowBtn(); - this.gauge.update(performance.now()); - const t=!this.gaugeOn; - t||(this.aimTarget=this.scene.captureHarpoonTarget(S$i)); - const i=this.aimTarget?this.aimTarget.sample()??this.aimTarget.point:null,s=wki(this.gauge.value,this.gauge.range); - this.scene.setAimMark(i,T$i[s],1-Math.min(1,Math.abs(this.gauge.value-(this.gauge.range.center??0))/this.gauge.range.good),t),this.gaugeFrame=requestAnimationFrame(this.tickGauge)} - ,"tickGauge")),Zt(this,"recordsSig",""),Zt(this,"craftSig",""),this.scene=t,this.viewH=i; - const s=y$i.get(); - s.start(()=>ixi.getInstance().wsTicket()),this.sockOff=[s.onHunt(t=>this.onSocketHunt(t)),s.onRing(t=>this.onSocketRing(t))],this.chipBg.eventMode="none",this.chipFace.position.set(3,2),this.chip.addChild(this.chipBg,this.chipFace,this.chipText),this.chip.eventMode="static",this.chip.cursor="pointer",this.chip.on("pointertap",t=>{ - t.stopPropagation(),this.openSchedule()} - ); - const e=Qt(()=>ixi.getInstance(),"dm"); - this.mapMarks=new M$i(t,()=>e().realNow(),()=>{ - var t; - return null==(t=e().state)?void 0:t.huntDevAt} - ),this.banner.addChild(this.bannerBg,this.bannerBar,this.bannerTitle,this.bannerSub),this.banner.visible=!1,this.banner.eventMode="static",this.banner.on("pointertap",t=>{ - t.stopPropagation(),this.openRecords()} - ),this.throwArt.anchor.set(.5); - for(const n of[this.throwGlow,this.throwBg,this.throwArt,this.throwText,this.throwSub,this.throwSubBg,this.throwBadge,this.throwBadgeText])n.eventMode="none"; - this.throwBtn.addChild(this.throwGlow,this.throwBg,this.throwArt,this.throwText,this.throwSubBg,this.throwSub,this.throwBadge,this.throwBadgeText),this.throwBtn.visible=!1,this.throwBtn.eventMode="static",this.throwBtn.cursor="pointer",this.throwBtn.on("pointertap",t=>{ - t.stopPropagation(),this.live&&dki(ixi.getInstance().harpoons())?this.openGauge():this.openCraft()} - ),this.gauge.onFire=()=>{ - this.stopGauge()} - ,this.gauge.onCancel=()=>{ - this.closeAll(),this.renderThrowBtn()} - ,this.records.visible=!1,this.records.eventMode="static",this.craft.visible=!1,this.craft.eventMode="static",this.addChild(this.banner,this.throwBtn,this.gauge,this.records,this.craft)} - get panelOpen(){ - return this.gauge.visible||this.records.visible||this.craft.visible||v$i.isOpen} - get bannerBottom(){ - return this.bannerY()+(this.banner.visible?this.banner.height+8:0)} - get active(){ - return!!this.boss} - closeAll(){ - this.generation++,this.records.visible=this.craft.visible=!1,v$i.close(),this.closeGauge(),this.scene.cancelHarpoon()} - update(){ - var t,i,s,e,n; - const h=ixi.getInstance(); - if(!h.ready)return; - const r=h.state,o=h.realNow(),a=ZIi(r.spot,o,r.huntDevAt); - y$i.get().setWater(`w:${ - r.social?`s${ - r.social.serverId} - |`:""} - ${ - r.spot.race} - |${ - r.spot.zone} - `); - const c=`${ - r.spot.race} - |${ - r.spot.zone} - |${ - (null==a?void 0:a.w)??"none"} - `; - if(c!==this.contextKey){ - this.closeAll(),this.contextKey=c,this.status=null,this.statusAt=0; - const t=`${ - r.spot.race} - |${ - r.spot.zone} - `; - t!==this.alertMap&&(this.alertMap=t,this.spawnedW=null)} - this.boss=a; - const l=!!a&&this.killedW===a.w; - a&&!l&&(null==(t=this.status)?void 0:t.w)===a.w&&this.status.total>=(this.status.hp??a.hp)&&this.onKilled(a,!1),a&&this.killedW===a.w?this.renderChip(null,o,a.end+1):this.renderChip(a,o),this.mapMarks.sync(); - const u=tki(r.spot,o,r.huntDevAt); - if(!a&&u&&u.at-o<6e4&&u.at>o&&this.warnedW!==u.w&&(this.warnedW=u.w,bH.getInstance().showMessage(`거대한 그림자가 다가와요… ${ - u.name} - ! (1분 뒤)`)),a&&this.spawnedW!==a.w){ - this.spawnedW=a.w,this.bossSeenAt=performance.now(); - const t=null==(i=r.hunt)?void 0:i.pending; - this.mine={ - w:a.w,dmg:t&&t.w===a.w&&t.map===`${ - r.spot.race} - |${ - r.spot.zone} - `?t.my:0,last:!1} - ,this.status=null,this.spawnTry=0,this.spawnFails=0,YG("medium"),E$i(QG.SFX_STONE_BREAK,.5),bH.getInstance().showMessage(`${ - A$i(a.name,"이","가")} - 나타났어요! 그림자가 가까이 지날 때 작살을 던져요`)} - const d=!!a&&((null==(s=this.status)?void 0:s.w)===a.w||performance.now()-this.bossSeenAt>4e3); - a&&this.killedW!==a.w&&d&&!this.scene.hasBossShadow&&performance.now()>this.spawnTry&&(this.spawnTry=performance.now()+3e3,this.scene.bossGiant(a.kind)?this.spawnFails=0:this.spawnFails++); - const f=y$i.get().live?3e4:this.statusQuiet?1e4:5e3; - if(a&&this.killedW!==a.w&&!this.throwing&&performance.now()-this.statusAt>f){ - this.statusAt=performance.now(); - const t=this.statusRevision,i=this.generation,s=(null==(e=this.status)?void 0:e.w)===a.w?this.status.total:-1; - h.huntStatus().then(e=>{ - i===this.generation&&t===this.statusRevision&&!this.throwing&&(null==e?void 0:e.boss)&&this.boss&&e.boss.w===this.boss.w&&(this.statusQuiet=e.boss.total===s,this.status={ - w:e.boss.w,total:e.boss.total,n:e.boss.n,hp:e.boss.hp} - )} - ).catch(()=>{ - } - )} - this.renderBanner(),this.renderThrowBtn(),this.records.visible&&this.renderRecords(!1),this.craft.visible&&this.renderCraft(); - const p=null==(n=r.hunt)?void 0:n.last; - if(p&&p.at!==this.lastSeenResult){ - const t=this.lastSeenResult<0; - this.lastSeenResult=p.at,(!t||o-p.at<6e5)&&this.showResult(p)} - } - onSocketHunt(t){ - this.boss&&t.w===this.boss.w&&!this.throwing&&(this.statusRevision++,this.status={ - w:t.w,total:t.total,n:t.n,hp:t.hp} - ,this.statusAt=performance.now(),this.statusQuiet=!1)} - onSocketRing(t){ - var i; - const s=ixi.getInstance(),e=TG.userId; - if(s.ringsShown.has(t.id)||e&&t.id.endsWith(`:${ - e} - `))return; - const n=null==(i=s.posProvider)?void 0:i.call(s); - !n||Math.hypot(n.x-t.x,n.y-t.y)>380||s.boatHp().fixing||(s.markRingShown(t.id),this.scene.boatHit(hTi(t.power,eTi(s.state))))} - onKilled(t,i){ - var s; - if(this.killedW===t.w)return; - const e=ixi.getInstance(); - this.killedW=t.w,this.killedAt=performance.now(),i&&this.mine.w===t.w&&(this.mine.last=!0),this.gauge.visible&&!this.throwing&&this.closeGauge(); - const n=(null==(s=this.status)?void 0:s.w)===t.w?this.status.n:0; - if(!this.scene.hasBossShadow)return this.mine.w===t.w&&this.mine.dmg?this.showCard(t.w,t.name,t.kind,n):bH.getInstance().showMessage(`${ - A$i(t.name,"은","는")} - 벌써 잡혔어요 · 다음 회차에 만나요`),void e.syncSoon(); - YG("heavy"),E$i(QG.SFX_STONE_BREAK,.6); - const h=this.generation; - this.scene.defeatBoss(()=>{ - var i,s; - this.destroyed||h!==this.generation||(E$i(QG.SFX_TRUMPET,.55),this.mine.w===t.w&&this.mine.dmg>0?this.showCard(t.w,t.name,t.kind,(null==(i=this.status)?void 0:i.w)===t.w?this.status.n:n):bH.getInstance().showMessage(`함께 ${ - (null==(s=this.status)?void 0:s.n)??n} - 명이 ${ - A$i(t.name,"을","를")} - 잡았어요!`),e.syncSoon())} - )} - showCard(t,i,s,e,n){ - var h; - this.closeCard(); - const r=APi.BLEED_W,o=Math.min(r-32,420),a=new Ke,c=!!(null==(h=ixi.getInstance().social)?void 0:h.enabled); - a.addChild((new ep).roundRect(0,4,o,104,18).fill({ - color:0,alpha:.25} - ).roundRect(0,0,o,104,18).fill({ - color:927774,alpha:.96} - )); - const l=NAi.monsterIcon(s); - if(l){ - const t=new Xe(l); - t.width=t.height=76,t.position.set(14,14),a.addChild(t)} - const u=l?104:18,d=o-u-14,f=Jxi(`${ - i} - 사냥 성공!`,$xi,19); - f.position.set(u,12),sRi(f,d); - const p=this.mine.w===t?this.mine.dmg:0,w=Jxi(`${ - p?`내 피해 ${ - p} - `:"구경"} - · 함께 ${ - e||"여러"} - 명${ - this.mine.w===t&&this.mine.last?" · 마지막 한 방!":""} - `,Bxi,13,!1); - w.position.set(u,42),sRi(w,d); - const g=Jxi(n?"골드 +0 진주 +0":c?"보상은 대회·사냥 보상함에서 받아요":"보상 받는 중…",n?16766836:Uxi,n?17:13); - g.position.set(u,68),sRi(g,d),a.addChild(f,w,g),a.position.set((r-o)/2,this.viewH()-250),a.eventMode="static",a.cursor="pointer",a.on("pointertap",t=>{ - t.stopPropagation(),this.closeCard()} - ),this.addChild(a),this.card=a,this.cardFor={ - w:t,name:i} - ,a.reward=t=>{ - const i={ - k:0} - ; - g.textColor=16766836,g.textSize=17,yx.to(i,{ - k:1,duration:.6,ease:"power2.out",onUpdate:Qt(()=>{ - g.text=`골드 +${ - Math.round(t.gold*i.k).toLocaleString()} - 진주 +${ - Math.round(t.pearl*i.k)} - `,sRi(g,d)} - ,"onUpdate")} - )} - ,n&&a.reward(n),yx.fromTo(a,{ - alpha:0,y:a.y+40} - ,{ - alpha:1,y:a.y,duration:.35,ease:"back.out(1.9)"} - ),yx.delayedCall(7,()=>{ - this.card===a&&this.closeCard()} - )} - closeCard(){ - const t=this.card; - t&&(this.card=null,this.cardFor=null,yx.killTweensOf(t),yx.to(t,{ - alpha:0,duration:.25,onComplete:Qt(()=>t.destroy({ - children:!0} - ),"onComplete")} - ))} - renderBanner(){ - var t,i,s; - const e=this.boss,n=ixi.getInstance(),h=(performance.now()-this.killedAt)/1e3*this.scene.fxSpeed,r=!!e&&this.killedW===e.w; - if(this.banner.visible=!!e&&(!r||h<1.9),!e||!this.banner.visible)return; - this.banner.alpha=r?1-Math.min(1,Math.max(0,(h-1.6)/.3)):1; - const o=APi.BLEED_W,a=Math.min(o-20,460),c=(o-a)/2; - this.banner.position.set(c,this.bannerY()); - const l=(null==(t=this.status)?void 0:t.w)===e.w?this.status.total:0,u=(null==(i=this.status)?void 0:i.w)===e.w?this.status.n:0,d=((null==(s=this.status)?void 0:s.w)===e.w?this.status.hp:void 0)??e.hp,f=r||l>=d,p=Math.max(0,e.end-n.realNow()); - this.bannerBg.clear().roundRect(0,0,a,56,12).fill({ - color:f?1194538:2759472,alpha:.92} - ),this.bannerTitle.text=f?`${ - e.name} - 사냥 성공!`:`${ - e.name} - · ${ - gTi[n.state.spot.zone]} - 의 몬스터`,this.bannerTitle.textColor=f?$xi:15120639,this.bannerTitle.position.set(14,7),sRi(this.bannerTitle,a-28); - const w=this.spawnFails>=2?" · 물이 좁아 그림자가 안 와요. 넓은 물로 가요":"",g=lki(n.state,e,`${ - n.state.spot.race} - |${ - n.state.spot.zone} - `)?" · 이번 회차는 다른 물에서 참가했어요":""; - this.bannerSub.text=f?`함께 ${ - u} - 명이 잡았어요`:`체력 ${ - Math.max(0,d-l).toLocaleString()} - /${ - d.toLocaleString()} - · 함께 ${ - u} - 명 · ${ - wRi(p)} - 남음${ - g} - ${ - w} - `,this.bannerSub.position.set(14,28),sRi(this.bannerSub,a-28),this.bannerBar.clear(),fRi(this.bannerBar,14,47,a-28,4,f?1:1-l/d,f?$xi:13724671,3811904),this.banner.hitArea=new $i(0,0,a,56)} - throwState(){ - var t; - const i=ixi.getInstance(),s=this.boss,e=i.harpoons(),n=dki(e),h=n?e.stock[n]:0,r=`${ - i.state.spot.race} - |${ - i.state.spot.zone} - `,o=uki(i.state,s,r),a=lki(i.state,s,r),c=this.scene.bossShadow(S$i),l=i.realNow()-((null==(t=i.state.hunt)?void 0:t.lastThrow)??0)<UIi.CD_MS,u=this.throwing||this.scene.harpoonBusy?"투척 중":l?"재장전":i.boatProblem()?"수리 중":a?"참가 끝":n?o<1?"장전 끝":c?c.near&&this.scene.captureHarpoonTarget(S$i)?"":c.seen?"더 가까이":"그림자 대기":"그림자 대기":"만들기"; - return{ - ok:!u,kind:n,have:h,left:o,why:u} - } - get live(){ - return!!this.boss&&this.killedW!==this.boss.w} - renderThrowBtn(){ - const t=ixi.getInstance(); - if(this.throwBtn.visible=!(APi.getInstance().inTutorial||this.gauge.visible||this.craft.visible||this.records.visible),!this.throwBtn.visible)return; - const i=APi.BLEED_W,s=this.viewH(),e=38,n=!this.live,h=t.harpoons(),r=FIi.reduce((t,i)=>t+(h.stock[i]??0),0),o=n?{ - ok:!1,kind:dki(h),left:0,why:r?`작살 ${ - r} - `:"만들기"} - :this.throwState(),a="만들기"===o.why||n,c=hki(t.state.gear.boat); - this.throwBtn.pivot.set(0,0),this.throwBtn.scale.set(1),this.throwBtn.position.set(i-16-76,s-160-76),this.throwGlow.alpha=o.ok?.35+.35*Math.sin(performance.now()/260):0; - const l=o.ok?"던지기!":n?o.why:a?"작살 만들기":o.why,u=`${ - o.ok} - |${ - a} - |${ - n} - |${ - o.kind} - |${ - l} - |${ - o.left} - |${ - c} - `; - if(u===this.throwKey)return; - this.throwKey=u,this.throwGlow.clear().circle(e,e,45).fill({ - color:Dxi,alpha:.45} - ),this.throwBg.clear().circle(e,e,e).fill(o.ok?Dxi:a&&!n?kxi:{ - color:Vxi,alpha:.86} - ); - const d=NAi.harpoonIcon(o.kind??"wood"); - this.throwArt.visible=!!d,this.throwText.visible=!d,d?(this.throwArt.texture=d,this.throwArt.scale.set(62/d.width),this.throwArt.position.set(e,e),this.throwArt.alpha=o.ok||a?1:.5,this.throwArt.tint=o.ok||a?16777215:10132122):(this.throwText.textColor=o.ok?Gxi:Kxi,this.throwText.position.set(e-this.throwText.width/2,e-this.throwText.height/2)),this.throwSub.text=l,this.throwSub.textColor=o.ok?Dxi:n||a?Bxi:Uxi,sRi(this.throwSub,100); - const f=this.throwSub.width+18,p=this.throwSub.height+6; - this.throwSubBg.clear().roundRect(e-f/2,82,f,p,p/2).fill({ - color:Vxi,alpha:.82} - ),this.throwSub.position.set(e-this.throwSub.width/2,85),this.throwBadgeText.text=a?"+":`${ - o.left} - /${ - c} - `,this.throwBadgeText.textColor=a?Gxi:o.left>0?Bxi:Hxi; - const w=Math.max(24,this.throwBadgeText.width+12); - this.throwBadge.clear().roundRect(76-w+8,-4,w,22,11).fill(a?Dxi:{ - color:1054235,alpha:.92} - ),this.throwBadgeText.position.set(76-w+8+(w-this.throwBadgeText.width)/2,(22-this.throwBadgeText.height)/2-4),this.throwBtn.hitArea=new $i(-6,-8,90,82+p+10)} - closeGauge(){ - this.gaugeOn=!1,this.aimId=null,this.gauge.close(),this.aimTarget=null,this.scene.setAimMark(null),cancelAnimationFrame(this.gaugeFrame),this.gaugeFrame=0} - async openGauge(){ - var t; - const i=ixi.getInstance(); - if(!this.live||this.preparing||this.throwing||this.gauge.visible||this.scene.harpoonBusy)return; - const s=this.throwState(); - if(!s.ok)return void bH.getInstance().showMessage("재장전"===s.why?"작살을 다시 준비하고 있어요":"수리 중"===s.why?"배를 고치는 중엔 작살을 던질 수 없어요":"참가 끝"===s.why?"이번 회차에는 다른 물 몬스터를 이미 잡으러 갔어요 · 다음 회차에 만나요":"장전 끝"===s.why?`이번 몬스터에는 ${ - hki(i.state.gear.boat)} - 개까지 던질 수 있어요 (장전 칸)`:"그림자가 배 가까이 지날 때 던질 수 있어요"); - const e=QCi(Math.random); - let n=performance.now(),h={ - ...pki(i.gearStats().aim),center:e.center} - ,r=s.kind,o=e; - if(null==(t=i.social)?void 0:t.enabled){ - const t=this.generation,s=this.contextKey; - this.preparing=!0; - try{ - const e=await i.prepareHuntAim(); - if(this.destroyed||t!==this.generation||s!==this.contextKey||!this.boss)return; - if(e.message||!e.aim)return void bH.getInstance().showMessage(e.message??"다시 조준해 주세요"); - this.aimId=e.aim.id,n=e.startPerf,h=e.aim.range,r=e.aim.kind,o={ - speed:e.aim.speed,wob:e.aim.wob} - ,this.aimStartPerf=n,this.aimEndPerf=n+e.aim.expiresAt-e.aim.startAt} - catch{ - return void bH.getInstance().showMessage("조준을 준비하지 못했어요. 다시 눌러 주세요")} - finally{ - this.preparing=!1} - } - this.boss&&this.live&&(this.gaugeOn=!0,this.gauge.open(r,this.boss.name,APi.BLEED_W,this.viewH(),n,h,o),this.throwBtn.visible=!1,YG("light"),this.tickGauge())} - async stopGauge(){ - var t; - if(!this.gaugeOn||this.throwing||!this.boss)return; - if(this.aimId&&performance.now()<this.aimStartPerf)return; - const i=ixi.getInstance(),s=this.boss,e=this.throwState(),n=((null==(t=this.aimTarget)?void 0:t.sample())?this.aimTarget:null)??this.scene.captureHarpoonTarget(S$i); - this.aimTarget=n,this.gaugeOn=!1; - const h=ZIi(i.state.spot,i.realNow(),i.state.huntDevAt); - if(!e.ok||!n||(null==h?void 0:h.w)!==s.w)return this.closeGauge(),this.renderThrowBtn(),void bH.getInstance().showMessage(n?"지금은 작살을 던질 수 없어요":"그림자가 멀어졌어요. 가까이 오면 다시 조준해요"); - const r=wki(this.gauge.value,this.gauge.range),o=this.generation,a=this.contextKey,c=`${ - i.state.spot.race} - |${ - i.state.spot.zone} - `,l=Qt(()=>!this.destroyed&&o===this.generation&&a===this.contextKey&&c===`${ - i.state.spot.race} - |${ - i.state.spot.zone} - `,"current"); - this.throwing=!0,this.scene.waveIncoming=performance.now()+3e3,this.statusRevision++,this.gauge.freeze(r),YG("light"); - try{ - const t=this.aimId?await i.huntShot(this.aimId):await i.huntThrow(r); - if(!l())return; - if(t.message||!t.result)return this.closeGauge(),void bH.getInstance().showMessage(t.message??"작살을 던지지 못했어요"); - const h=t.result,o=h.dmg<=0?"miss":h.grade??r,a=h.kind??e.kind??"wood",c=FIi.indexOf(a); - if(!(await this.gauge.finish(o))||!l())return; - let u; - this.closeGauge(); - const d=new Promise(t=>{ - u=t} - ),f=this.scene.harpoonStrike(a,o,h.dmg,n,{ - release:Qt(()=>{ - l()&&E$i(QG.SFX_ARCHERY_FIRE_ARROW,.3+.08*c)} - ,"release"),impact:Qt(()=>{ - u(),l()&&(this.statusRevision++,this.status={ - w:s.w,total:h.total,n:h.n,hp:h.hp} - ,this.statusAt=performance.now(),this.renderBanner(),YG("miss"===o?"light":"perfect"===o&&c>0?"heavy":c>0?"medium":"light"),E$i("miss"===o?QG.SFX_BATTLE_BOW_ATTACK2:QG.SFX_ARCHERY_HIT_ON_TARGET,"miss"===o?.36:.42+.1*c+("perfect"===o?.08:0)),this.mine.w!==s.w&&(this.mine={ - w:s.w,dmg:0,last:!1} - ),this.mine.dmg+=h.dmg,h.killed&&this.onKilled(s,h.total-h.dmg<h.hp),h.wave&&"miss"!==o&&this.scene.monsterWave(n.sample()??n.point,s.wave,h.wave.dmg,h.wave.broke))} - ,"impact")} - ); - await Promise.race([d,f])} - catch{ - l()&&(this.closeGauge(),bH.getInstance().showMessage("투척 결과를 확인하지 못했어요. 잠시 후 다시 확인해 주세요"))} - finally{ - this.throwing=!1,l()&&this.renderThrowBtn()} - } - showResult(t){ - var i; - if(t.killed){ - const s=this.card&&(null==(i=this.cardFor)?void 0:i.name)===t.name?this.card:null; - return void((null==s?void 0:s.reward)?s.reward({ - gold:t.gold,pearl:t.pearl} - ):(0!==this.mine.dmg&&null!==this.mine.w||(this.mine={ - w:-1,dmg:t.my,last:!1} - ),this.showCard(this.mine.w??-1,t.name,t.kind,t.n,{ - gold:t.gold,pearl:t.pearl} - )))} - const s=APi.BLEED_W,e=dRi(t.killed?`${ - t.name} - 사냥 성공! 내 피해 ${ - t.my} - · 골드 +${ - t.gold.toLocaleString()} - · 진주 +${ - t.pearl} - `:`${ - A$i(t.name,"이","가")} - 달아났어요 · 모두의 피해 ${ - t.total} - /${ - t.hp} - (함께 ${ - t.n} - 명)`,t.killed?16777215:Uxi,t.killed?3111503:2759472,14,12); - e.position.set((s-e.width)/2,this.viewH()-190),this.addChild(e),t.killed&&(E$i(QG.SFX_TRUMPET,.6),YG("heavy")),yx.fromTo(e,{ - alpha:0,y:e.y+10} - ,{ - alpha:1,y:e.y,duration:.25} - ),yx.to(e,{ - alpha:0,delay:5,duration:.6,onComplete:Qt(()=>e.destroy({ - children:!0} - ),"onComplete")} - )} - renderChip(t,i,s){ - const e=ixi.getInstance().state,n=hCi(e.spot)<UIi.MIN_LEVEL&&!t; - if(this.chip.visible=!APi.getInstance().inTutorial,!this.chip.visible)return; - const h=t??iki(e.spot.race,e.spot.zone,s??i,s?null:e.huntDevAt),r=t?{ - state:"live",left:t.end-i} - :eki(h,i),o=n?`${ - nki(e.spot.zone)} - 번 수역부터`:p$i(r,!0),a=n?"dim":r.state; - this.chipFace.set(h.kind,n||"idle"===r.state?null:r.state,n),this.chipText.text!==o&&(this.chipText.text=o),this.chipText.alpha="soon"===a&&Math.floor(performance.now()/500)%2?.5:1; - const c=39+Math.ceil(this.chipText.width)+10,l=`${ - a} - |${ - c} - `; - if(l===this.chipKey)return; - this.chipKey=l,this.chipText.textColor="live"===a?16765124:"soon"===a?f$i:"dim"===a?Fxi:Bxi,this.chipText.position.set(39,(34-this.chipText.height)/2); - const u=this.chipBg.clear().roundRect(0,0,c,34,10).fill({ - color:"live"===a?4856338:"soon"===a?3810324:Vxi,alpha:"idle"===a||"dim"===a?.82:.92} - ); - "live"===a&&u.roundRect(0,0,c,34,10).stroke({ - color:d$i,width:2} - ),this.chip.hitArea=new $i(-4,-6,c+8,46)} - openSchedule(){ - const t=ixi.getInstance(),i=t.state; - this.records.visible=this.craft.visible=!1,v$i.open(this,APi.BLEED_W,this.viewH(),i.spot.race,i.spot.zone,()=>t.realNow(),{ - devAt:i.huntDevAt,onRecords:Qt(()=>this.openRecords(),"onRecords")} - )} - openRecords(){ - this.records.visible=!0,this.renderRecords(!0),yx.fromTo(this.records,{ - alpha:0} - ,{ - alpha:1,duration:.15} - )} - renderRecords(t){ - const i=ixi.getInstance(),s=i.state.hunt,e=(null==s?void 0:s.xp)??0,n=aki(e),h=tki(i.state.spot,i.realNow(),i.state.huntDevAt),r=`${ - e} - |${ - JSON.stringify((null==s?void 0:s.records)??{ - } - )} - |${ - (null==h?void 0:h.w)??"x"} - `; - if(!t&&r===this.recordsSig)return; - this.recordsSig=r; - const o=this.records; - o.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const a=APi.BLEED_W,c=this.viewH(),l=Math.min(a-20,480),u=(a-l)/2,d=u+18,f=Math.max(18,Math.min(24,Math.floor((c-18-188)/KIi.length))),p=128+KIi.length*f+60,w=Math.max(10,c-p-8),g=eRi(l,p,Vxi,null,14); - g.alpha=.96,g.position.set(u,w); - const m=Jxi(`몬스터 헌터 · ${ - n.name} - `,Dxi,17); - m.position.set(d,w+14); - const v=Jxi(`경험치 ${ - e} - ${ - n.next?` / 다음 등급 ${ - n.next} - `:" · 최고 등급"} - · 사냥에 성공하면 내가 준 피해만큼`,Uxi,12,!1); - v.position.set(d,w+40),sRi(v,l-36); - const _=i.realNow(),M=Jxi(h?h.at<=_?`지금 ${ - A$i(h.name,"이","가")} - 지나가는 중!`:`이 지역 다음 몬스터: ${ - h.name} - · ${ - wRi(h.at-_)} - 뒤`:"난이도 2 자리부터 몬스터가 지나가요",h&&h.at<=_?16757611:Bxi,13); - M.position.set(d,w+62),sRi(M,l-36); - const b=[d+200,d+250,d+300,d+360],y=[g,m,v,M],E=Jxi("몬스터",Fxi,12,!1); - E.position.set(d,w+92),y.push(E),["목격","참가","성공","최고 기여"].forEach((t,i)=>{ - const s=Jxi(t,Fxi,12,!1); - s.position.set(b[i]-s.width/2,w+92),y.push(s)} - ),KIi.forEach((t,i)=>{ - const e=null==s?void 0:s.records[t.name],n=w+116+i*f,h=Jxi(`${ - t.name} - (${ - t.deep?"깊은 대양":gTi[t.zone]} - )`,(null==e?void 0:e.killed)?$xi:(null==e?void 0:e.seen)||(null==e?void 0:e.joined)?Bxi:Fxi,13,!!(null==e?void 0:e.killed)); - h.position.set(d,n),sRi(h,170),y.push(h),[null==e?void 0:e.seen,null==e?void 0:e.joined,null==e?void 0:e.killed,null==e?void 0:e.best].forEach((t,i)=>{ - const s=Jxi(t?String(t):"-",(null==e?void 0:e.killed)?$xi:Uxi,13,!1); - s.position.set(b[i]-s.width/2,n),y.push(s)} - )} - ); - const A=new cRi("닫기",96,40,14); - A.setPrimary(!1),A.position.set(u+l-18-96,w+p-52),A.onTap=()=>{ - this.records.visible=!1} - ; - const S=new cRi("작살 만들기",140,40,14); - S.position.set(A.x-8-140,A.y),S.onTap=()=>this.openCraft(),y.push(A,S),o.hitArea=new $i(0,0,a,c),o.removeAllListeners("pointertap"),o.on("pointertap",t=>{ - t.stopPropagation(),o.toLocal(t.global).y<w&&(this.records.visible=!1)} - ),o.addChild(...y)} - openCraft(){ - this.records.visible=!1,this.craft.visible=!0,this.craftSig="",this.renderCraft(),yx.fromTo(this.craft,{ - alpha:0} - ,{ - alpha:1,duration:.15} - ),ixi.getInstance().refreshHuntMats().then(()=>{ - this.craft.visible&&(this.craftSig="",this.renderCraft())} - )} - static fishFor(t){ - const i=ixi.getInstance(); - return i.netGroups().filter(s=>DTi(s.id).star>=t&&!i.isQuestFish(s)).reduce((t,i)=>t+i.count,0)} - renderCraft(){ - const i=ixi.getInstance(),s=i.harpoons(),e=i.huntMatHave,n=`${ - JSON.stringify(s)} - |${ - i.state.gold} - |${ - e.bone} - |${ - e.thunder} - |${ - [1,2,3,4,5].map(i=>t.fishFor(i)).join(",")} - `; - if(n===this.craftSig)return; - this.craftSig=n; - const h=this.craft; - h.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const r=APi.BLEED_W,o=this.viewH(),a=Math.min(r-20,480),c=(r-a)/2,l=c+18,u=84+62*HIi.length+10,d=Math.max(72,Math.min(92,Math.floor((o-u-76)/FIi.length))),f=u+FIi.length*d+60,p=Math.max(4,o-f-8),w=eRi(a,f,Vxi,null,14); - w.alpha=.96,w.position.set(c,p); - const g=Jxi("작살 만들기",Dxi,17); - g.position.set(l,p+14); - const m=Jxi(`물고기(값싼 것부터 · 의뢰 물고기 빼고) + 골드 · 용뼈·번개 작살은 재료 + 골드 · 한 번에 ${ - hki(i.state.gear.boat)} - 개까지 던져요`,Uxi,12,!1); - m.position.set(l,p+40),sRi(m,a-36); - const v=[w,g,m]; - HIi.forEach((s,n)=>{ - const h=WIi[s],r=p+70+62*n,o=t.fishFor(h.minStar),u=Qt(t=>o>=h.fish*t&&i.state.gold>=h.gold*t,"can"); - v.push((new ep).roundRect(l-8,r,a-20,56,10).fill({ - color:Ixi,alpha:.7} - )); - const d=NAi.huntMatIcon(s),f=d?46:0; - if(d){ - const t=new Xe(d); - t.anchor.set(.5),t.scale.set(38/d.width),t.position.set(l+20,r+28),t.eventMode="none",v.push(t)} - const w=Jxi(`${ - h.name} - ${ - e[s]} - 개`,Bxi,15); - w.position.set(l+4+f,r+6); - const g=Jxi(`${ - OCi[h.minStar]} - ${ - h.fish} - 마리 + ${ - h.gold.toLocaleString()} - 골드 (맞는 물고기 ${ - o} - 마리)`,u(1)?Uxi:Hxi,12,!1); - g.position.set(l+4+f,r+30),sRi(g,a-190-f); - const m=new cRi("1개",56,30,13),_=new cRi("5개",56,30,13); - m.position.set(c+a-24-118,r+13),_.position.set(c+a-24-56,r+13),m.enabled=u(1),_.enabled=u(5),m.onTap=()=>{ - this.makeMat(s,1)} - ,_.onTap=()=>{ - this.makeMat(s,5)} - ,v.push(w,g,m,_)} - ),FIi.forEach((n,h)=>{ - const r=$Ii[n],o=p+u+h*d,f=s.use===n,w=r.fish?t.fishFor(r.minStar):0,g=Qt(t=>w>=r.fish*t&&(!r.mat||e[r.mat]>=(r.matN??1)*t)&&i.state.gold>=r.gold*t,"can"),m=(new ep).roundRect(l-8,o,a-20,d-8,10).fill(f?kxi:Ixi),_=NAi.harpoonIcon(n),M=_?50:0; - if(_){ - const t=new Xe(_); - t.anchor.set(.5),t.scale.set(44/_.width),t.position.set(l+24,o+26),t.eventMode="none",v.push(t)} - const b=Jxi(`${ - r.name} - · 피해 ×${ - r.mult} - · ${ - s.stock[n]} - 개`,f?Dxi:Bxi,15); - b.position.set(l+4+M,o+8); - const y=Jxi(r.fish?`${ - OCi[r.minStar]} - ${ - r.fish} - 마리 + ${ - r.gold.toLocaleString()} - 골드 (맞는 물고기 ${ - w} - 마리)`:`${ - WIi[r.mat].name} - ${ - r.matN??1} - 개 + ${ - r.gold.toLocaleString()} - 골드 (가진 ${ - WIi[r.mat].name} - ${ - e[r.mat]} - 개)`,g(1)?Uxi:Hxi,12,!1); - y.position.set(l+4+M,o+30),sRi(y,a-60-M),v.splice(v.length-(_?1:0),0,m),v.push(b,y); - const E=new cRi("1개",64,32,13),A=new cRi("5개",64,32,13),S=new cRi(f?"던질 작살":"이걸 던지기",104,32,13); - S.setPrimary(!1),S.enabled=!f; - const T=o+d-8-36; - E.position.set(l+4,T),A.position.set(l+74,T),S.position.set(c+a-24-104,T),E.enabled=g(1),A.enabled=g(5),E.onTap=()=>{ - this.make(n,1)} - ,A.onTap=()=>{ - this.make(n,5)} - ,S.onTap=async()=>{ - const t=await i.huntUse(n); - t&&bH.getInstance().showMessage(t),this.craftSig="",this.renderCraft()} - ,v.push(E,A,S)} - ); - const _=new cRi("닫기",96,40,14); - _.setPrimary(!1),_.position.set(c+a-18-96,p+f-52),_.onTap=()=>{ - this.craft.visible=!1} - ,v.push(_),h.hitArea=new $i(0,0,r,o),h.removeAllListeners("pointertap"),h.on("pointertap",t=>{ - t.stopPropagation(),h.toLocal(t.global).y<p&&(this.craft.visible=!1)} - ),h.addChild(...v)} - async makeMat(t,i){ - if(this.crafting)return; - this.crafting=!0; - const s=await ixi.getInstance().huntMakeMat(t,i).finally(()=>{ - this.crafting=!1} - ); - if(s.message||!s.result)return void bH.getInstance().showMessage(s.message??"재료를 만들지 못했어요"); - const e=s.result.used.map(t=>`${ - DTi(t.id).name} - ${ - t.count} - `).join(" · "); - bH.getInstance().showMessage(`${ - WIi[t].name} - ${ - i} - 개를 만들었어요 (${ - e} - )`),YG("light"),E$i(QG.SFX_STONE_BREAK,.4),this.craftSig="",this.renderCraft()} - async make(t,i){ - if(this.crafting)return; - this.crafting=!0; - const s=await ixi.getInstance().huntCraft(t,i).finally(()=>{ - this.crafting=!1} - ); - if(s.message||!s.result)return void bH.getInstance().showMessage(s.message??"작살을 만들지 못했어요"); - const e=s.result.used.map(t=>`${ - DTi(t.id).name} - ${ - t.count} - `).join(" · "); - bH.getInstance().showMessage(`${ - $Ii[t].name} - ${ - i} - 개를 만들었어요 (${ - e} - )`),YG("light"),E$i(QG.SFX_STONE_BREAK,.4),this.craftSig="",this.renderCraft()} - layout(){ - this.chipKey="",this.recordsSig="",this.craftSig="",this.gaugeOn?this.closeGauge():this.gauge.visible&&this.gauge.layout(APi.BLEED_W,this.viewH())} - destroy(t){ - this.closeAll(); - for(const i of this.sockOff)i(); - y$i.get().stop(),super.destroy(t)} - } - ; - Qt(C$i,"FishingHuntUi"),Zt(C$i,"rule",UIi); - let O$i=C$i; - const I$i=class t extends Ke{ - constructor(i){ - super(),Zt(this,"active",!1),Zt(this,"rodHold",!0),Zt(this,"stepId","hello"),Zt(this,"lines",hIi("인간")),Zt(this,"captain",sIi("인간")),Zt(this,"clock",0),Zt(this,"timers",[]),Zt(this,"wantTap",!1),Zt(this,"dim",new Ke),Zt(this,"dimHole",new Xe(t.holeTexture())),Zt(this,"dimRest",new ep),Zt(this,"dimTarget",null),Zt(this,"flash",new ep),Zt(this,"flashUntil",0),Zt(this,"flashOn",!1),Zt(this,"hand",new Ke),Zt(this,"handArt",new ep),Zt(this,"handTarget",null),Zt(this,"taps",new Ke),Zt(this,"prog",new Ke),Zt(this,"chips",[]),Zt(this,"skip",new Ke),Zt(this,"skipBg",new ep),Zt(this,"skipText",Jxi("건너뛰기",Uxi,12)),Zt(this,"talk",new Ke),Zt(this,"talkBg",new ep),Zt(this,"faceBg",new ep),Zt(this,"faceMask",new ep),Zt(this,"face",new Xe(ls.EMPTY)),Zt(this,"who",Jxi("",Dxi,14)),Zt(this,"say",Jxi("",Bxi,15.5)),Zt(this,"more",Jxi("▼",Dxi,13)),Zt(this,"go",new Ke),Zt(this,"goBg",new ep),Zt(this,"goText",Jxi("시작 포인트로 이동",Gxi,16)),Zt(this,"talkTop",!1),Zt(this,"typing",null),Zt(this,"onGo",null),Zt(this,"idle",new Ke),Zt(this,"ring",null),Zt(this,"seaPoint",null),Zt(this,"fishId",0),Zt(this,"finished",!1),Zt(this,"progH",0),Zt(this,"progAt",0),Zt(this,"seaSailing",!1),Zt(this,"waitingBite",!1),Zt(this,"lastNow",performance.now()),Zt(this,"moreY",0),Zt(this,"talkLayout",{ - x:0,y:0,w:0,h:0,padL:0,narrow:!1,size:15.5} - ),Zt(this,"button",null),Zt(this,"withMore",!1),this.host=i,this.visible=!1,this.eventMode="static",this.dim.eventMode=this.flash.eventMode=this.hand.eventMode=this.taps.eventMode=this.idle.eventMode=this.prog.eventMode="none",this.dimHole.anchor.set(.5),this.dim.addChild(this.dimHole,this.dimRest),this.dim.visible=!1,this.flash.blendMode="add",this.handArt.svg('<svg viewBox="0 0 64 64"><path d="M23 5c3.3 0 5.5 2.4 5.5 5.6v16.6l1.9-.9c2.3-1 5 0 6.1 2.2l.4.9 1.7-.7c2.3-.9 4.9.2 5.9 2.4l.4.9.9-.2c3-.5 5.7 1.8 5.7 4.8v9.2C51.5 54.1 44 61 35.3 61h-4.2c-6.3 0-12-3.4-15-8.9l-6.4-11.6c-1.2-2.2-.4-5 1.8-6.2 2-1.1 4.5-.6 5.9 1.2l2.1 2.7V10.6C17.5 7.4 19.7 5 23 5z" fill="#ffffff" stroke="#1b1b1d" stroke-width="3" stroke-linejoin="round"/><path d="M28.5 27v12M36.8 29.5V40M45 32.6V41" stroke="#1b1b1d" stroke-width="2.4" stroke-linecap="round" fill="none"/></svg>'),this.hand.addChild(this.handArt),this.hand.visible=!1,this.skip.addChild(this.skipBg,this.skipText),this.skip.eventMode="static",this.skip.cursor="pointer",this.skip.on("pointertap",t=>{ - t.stopPropagation(),this.skipToEnd()} - ),this.faceBg.eventMode=this.faceMask.eventMode="none",this.face.mask=this.faceMask,this.go.addChild(this.goBg,this.goText),this.go.eventMode="static",this.go.cursor="pointer",this.go.on("pointertap",t=>{ - t.stopPropagation(); - const i=this.onGo; - this.onGo=null,null==i||i()} - ),this.talkBg.eventMode="none",this.talk.addChild(this.talkBg,this.faceBg,this.face,this.faceMask,this.who,this.say,this.more,this.go),this.talk.visible=!1,this.addChild(this.dim,this.flash,this.idle,this.prog,this.skip,this.talk,this.hand,this.taps),this.on("pointerdown",t=>this.onDown(t))} - get k(){ - return this.host.W()/370} - start(t){ - this.active=!0,this.finished=!1,this.visible=!0,this.eventMode="static",yx.killTweensOf(this),this.alpha=1,this.clock=0,this.timers=[],this.lastNow=performance.now(),this.lines=hIi(t),this.captain=sIi(t),this.rodHold=!0,this.ring=this.seaPoint=null,this.face.texture=NAi.gear().journeyNpcs[this.captain.art]??ls.EMPTY,this.who.text=this.captain.name,this.talkTop=!1,this.host.scene.tutorialRingScale=this.k,this.host.scene.tutorialLift=this.host.lift(),this.host.scene.setTutorial(!0),this.layout(),Mn.shared.remove(this.tick,this),Mn.shared.add(this.tick,this),this.run("hello")} - stop(){ - this.active&&(this.active=!1,this.visible=!1,Mn.shared.remove(this.tick,this),this.timers=[],this.typing=null,this.host.scene.setTutorial(!1))} - layout(){ - const t=this.host.W(),i=this.host.H(),s=this.k; - this.hitArea=new $i(0,0,t,i),this.skipText.textSize=Math.round(12*s); - const e=this.skipText.width+20*s,n=this.skipText.height+12*s; - if(this.skipBg.clear().roundRect(0,0,e,n,8*s).fill({ - color:921104,alpha:.72} - ),this.skipText.position.set(10*s,6*s),this.skip.position.set(t-14*s-e,14*s),this.skip.hitArea=new $i(-6*s,-6*s,e+12*s,n+12*s),!this.chips.length)for(const c of JOi){ - const t=new ep,i=Jxi(c,Fxi,11.5); - this.prog.addChild(t,i),this.chips.push({ - bg:t,text:i} - )} - const h=14*s,r=this.skip.x-8*s,o=5*s,a=(r-h-3*o)/4; - this.chips.forEach((t,i)=>{ - t.text.textSize=Math.round(11.5*s),t.text.scale.set(Math.min(1,(a-10*s)/Math.max(1,t.text.width/t.text.scale.x))),t.bg.position.set(h+i*(a+o),14*s),t.bg.label=String(a)} - ),this.progH=n,this.drawProg(),this.drawTalk(),this.idle.visible&&this.buildIdle()} - drawProg(){ - const t=this.k; - this.chips.forEach((i,s)=>{ - const e=Number(i.bg.label),n=s===this.progAt,h=s<this.progAt; - i.bg.clear().roundRect(0,0,e,this.progH,8*t).fill(n?{ - color:Dxi,alpha:1} - :h?{ - color:4013377,alpha:.9} - :{ - color:921104,alpha:.72} - ),i.text.textColor=n?Gxi:h?Bxi:Fxi,i.text.position.set(i.bg.x+(e-i.text.width)/2,i.bg.y+(this.progH-i.text.height)/2)} - )} - run(t){ - const i=ZOi(t); - switch(this.stepId=t,this.wantTap=!1,this.progAt=i.prog,this.drawProg(),this.spot(null),this.point(null),"idle"!==t&&(this.idle.visible=!1),"movebtn"===t&&(this.talkTop=!0),i.kind){ - case"talk":return"idle"===t&&(this.buildIdle(),this.idle.visible=!0,yx.fromTo(this.idle,{ - alpha:0} - ,{ - alpha:1,duration:.3} - )),void this.speak(this.lines[t],{ - more:!0,onDone:Qt(()=>{ - this.wantTap=!0} - ,"onDone")} - ); - case"goal":{ - const t=this.host.scene,i=this.k; - return this.ring=t.tutorialSpot([-45,-20,-70,0,-100,20,-135,45,180,90,135,-160],150,230,14*i+this.progH,150*i)??t.tutorialSpot([-45,0,-90,45,-135,90,135,180,-20,-70,20,70],90,150,14*i+this.progH,150*i),this.ring?(t.tutorialRing=this.ring,void this.speak(this.lines.goal,{ - onDone:Qt(()=>{ - const i=this.ring; - i&&(this.spot(()=>({ - p:this.toLocalOf(t.worldToGlobal(i.x,i.y)),r:46*this.k} - )),this.point(()=>this.toLocalOf(t.worldToGlobal(i.x,i.y))),this.wantTap=!0)} - ,"onDone")} - )):(this.rodHold=!1,void this.run("rod"))} - case"wait":return void this.speak(this.lines[t],{ - } - ); - case"rod":return this.rodHold=!1,void this.speak(this.lines.rod,{ - } - ); - case"bite":return this.speak(this.lines.bite,{ - } - ),this.point(()=>{ - const t=this.host.biteGlobal(); - return t?this.toLocalOf(t):null} - ),this.flashUntil=this.clock+3300,this.wantTap=!0,void YG("medium"); - case"btn":{ - const t=this.host.scene,i=t.modeButton; - return t.tutorialMoveBtn=!0,yx.fromTo(i.scale,{ - x:.3,y:.3} - ,{ - x:1,y:1,duration:.35,ease:"back.out(3)"} - ),void this.speak(this.lines.movebtn,{ - onDone:Qt(()=>{ - const t=Qt(()=>{ - const t=i.getBounds(); - return this.toLocalOf({ - x:t.x+t.width/2,y:t.y+t.height/2} - )} - ,"at"); - this.spot(()=>({ - p:t(),r:44*this.k} - )),this.point(t),this.wantTap=!0} - ,"onDone")} - )} - case"sea":{ - const t=this.host.scene,i=this.k; - return this.rodHold=!0,void this.speak(this.lines.sea,{ - onDone:Qt(()=>{ - this.seaPoint=t.tutorialSpot([-135,-110,-160,180,-90,160,135,110,90,-45,0,45],120,190,this.talkBottom()+10*i,90*i)??t.tutorialSpot([-135,-90,180,135,90,45,0,-45],90,150,this.talkBottom()+10*i,90*i); - const s=this.seaPoint; - s&&this.point(()=>this.toLocalOf(t.worldToGlobal(s.x,s.y))),this.wantTap=!0} - ,"onDone")} - )} - case"end":return void this.speak(this.lines.end,{ - button:"시작 포인트로 이동",onButton:Qt(()=>this.finish(),"onButton")} - )} - } - next(){ - const t="hooked"===this.stepId||"missed"===this.stepId?null:QOi(this.stepId); - t&&this.run(t)} - skipToEnd(){ - if(this.finished)return; - const t=this.host.scene; - t.tutorialRing=null,this.ring=this.seaPoint=null,wFi.dismiss(!0),this.timers=[],this.talkTop=t.tutorialMoveBtn,this.run("end")} - finish(){ - this.finished||(this.finished=!0,this.wantTap=!1,this.spot(null),this.point(null),this.host.backend().finish(),YG("light"),this.active=!1,this.eventMode="none",Mn.shared.remove(this.tick,this),this.timers=[],this.typing=null,this.host.scene.setTutorial(!1),yx.to(this,{ - alpha:0,duration:.6,onComplete:Qt(()=>{ - this.active||(this.visible=!1)} - ,"onComplete")} - ),this.host.onFinish(this.captain.id))} - onCatch(t,i,s){ - this.active&&"hooked"===this.stepId&&(this.fishId=t.id,this.lines=hIi(this.host.race(),DTi(t.id).name),this.later(1e3*s+(i?2800:900),()=>this.run("caught")))} - onDown(t){ - if(t.target!==this||!this.active||this.finished)return; - const i=this.toLocal(t.global),s=this.k; - this.tapRing(i); - const e=this.stepId,n="hooked"===e||"missed"===e?null:ZOi(e); - if(this.typing&&(this.typing.shown=1/0,!n||"talk"===n.kind||!this.wantTap))return; - if(!n)return; - if("talk"===n.kind){ - if(!this.wantTap)return; - return"caught"===e&&wFi.dismiss(),void this.next()} - if(!this.wantTap)return; - const h=this.host.scene; - if("goal"===n.kind&&this.ring){ - const t=this.toLocalOf(h.worldToGlobal(this.ring.x,this.ring.y)); - if(Math.hypot(i.x-t.x,i.y-t.y)>50*s)return; - const e=this.ring; - if(this.ring=null,h.tutorialRing=null,!h.tutorialSail(e.x,e.y))return this.rodHold=!1,void this.run("rod"); - YG("light"),this.run("sailing")} - else if("rod"===n.kind){ - const t=h.rodBalloonCenter; - if(!t)return; - const e=this.toLocalOf(h.worldToGlobal(t.x,t.y)); - if(Math.hypot(i.x-e.x,i.y-e.y)>48*s)return; - if(!h.tutorialTapRod())return; - YG("light"),this.wantTap=!1,this.spot(null),this.point(null),this.later(650,()=>this.run("wait"))} - else if("bite"===n.kind){ - if(!this.host.backend().hookable())return; - this.hook()} - else if("btn"===n.kind){ - const t=h.modeButton.getBounds(),e=this.toLocalOf({ - x:t.x+t.width/2,y:t.y+t.height/2} - ); - if(Math.abs(i.x-e.x)>t.width/2+14*s||Math.abs(i.y-e.y)>t.height/2+14*s)return; - h.tutorialModeTap(),YG("light"),this.run("sea")} - else if("sea"===n.kind){ - const t=h.globalToWorld(this.toGlobal(i)); - if(!h.tutorialSail(t.x,t.y))return; - YG("light"),this.wantTap=!1,this.point(null),this.talk.visible=!1,this.stepId="sea",this.seaSailing=!0} - } - hook(){ - this.stepId="hooked",this.wantTap=!1,this.point(null),this.spot(null),this.talk.visible=!1,this.flashUntil=0,this.host.backend().hook().then(t=>{ - t&&this.active&&"hooked"===this.stepId&&(this.stepId="missed",this.speak(this.lines.missed,{ - } - ),this.later(900,()=>{ - this.host.backend().recast(),this.waitBite()} - ))} - )} - missed(){ - this.stepId="missed",this.wantTap=!1,this.point(null),this.flashUntil=0,this.speak(this.lines.missed,{ - } - ),this.later(900,()=>{ - this.host.backend().recast(),this.waitBite()} - )} - waitBite(){ - this.waitingBite=!0} - tick(){ - if(!this.active)return; - const i=performance.now(),s=Math.min(1e3,i-this.lastNow)*t.speed; - if(this.lastNow=i,this.clock+=s,this.timers.length){ - const t=this.timers.filter(t=>t.at<=this.clock); - this.timers=this.timers.filter(t=>t.at>this.clock); - for(const i of t)i.fn()} - const e=this.typing; - if(e){ - const t=Math.min(e.chars.length,e.shown===1/0?e.chars.length:oIi(e.chars.join(""),this.clock-e.t0)); - if(t!==e.drawn&&(e.drawn=t,this.say.text=e.chars.slice(0,t).join("")),t>=e.chars.length){ - this.typing=null; - const t=e.onDone; - this.finishTalk(),null==t||t()} - } - const n=this.host.scene,h=this.host.backend(),r=this.stepId; - if("sailing"===r&&!n.moving&&n.idleInSail)this.run("rod"); - else if("rod"!==r||!n.rodShown||this.wantTap||this.typing)"wait"===r&&h.biteOpen()?this.run("bite"):"missed"===r&&this.waitingBite&&h.biteOpen()?(this.waitingBite=!1,this.run("bite")):"bite"!==r||h.biteOpen()||h.hookable()?"sea"===r&&this.seaSailing&&!n.moving&&(this.seaSailing=!1,this.talk.visible=!1,this.later(900,()=>this.run("done"))):this.missed(); - else{ - const t=Qt(()=>{ - const t=n.rodBalloonCenter; - return t?this.toLocalOf(n.worldToGlobal(t.x,t.y)):null} - ,"at"); - this.spot(()=>{ - const i=t(); - return i?{ - p:i,r:40*this.k} - :null} - ),this.point(t),this.wantTap=!0} - this.drawDim(),this.drawHand(),this.drawFlash(),this.more.visible&&(this.more.y=this.moreY+1.5*Math.sin(this.clock/1e3*Math.PI*2)*this.k); - for(const t of[...this.taps.children]){ - const i=Math.min(1,(this.clock-(t.t0??0))/550),s=this.k; - t.clear().circle(t.p.x,t.p.y,(8+20*(1-(1-i)*(1-i)))*s).stroke({ - color:16777215,width:3*s,alpha:1-i} - ),i>=1&&t.destroy()} - } - later(t,i){ - this.timers.push({ - at:this.clock+t,fn:i} - )} - talkBottom(){ - return this.talkTop?this.talkLayout.y+this.talkLayout.h:this.progH+14*this.k} - speak(t,i){ - const s=this.k,e=this.host.W()-24*s,n=Qt(t=>({ - ...this.say.getStyle(),fontSize:t*s,lineHeight:Math.round(t*s*1.5)} - ),"style"),h=Qt(t=>e-(t?72:94)*s-16*s,"wrapW"),r=Qt((i,s)=>hD.wrapTextCJK(t,n(i),h(s)),"wrap"),o=dIi((t,i)=>r(t,i).split("\n").length),a=r(o.size,o.narrow); - this.say.setWrapWidth(0),this.say.setStyle(n(o.size)),this.say.textColor=Bxi,this.talkLayout={ - ...this.talkLayout,narrow:o.narrow,size:o.size} - ,this.say.text=a,this.button=i.button??null,this.goText.text=i.button??"",this.onGo=i.onButton??null,this.withMore=!!i.more,this.drawTalk(),this.say.text="",this.more.visible=!1,this.go.visible=!1,this.talk.visible=!0,this.typing={ - chars:[...a],t0:this.clock,shown:0,drawn:0,onDone:i.onDone} - } - finishTalk(){ - this.more.visible=this.withMore,this.go.visible=!!this.button} - drawTalk(){ - const t=this.k,i=this.host.W(),s=this.host.H(),e=this.talkLayout,n=12*t,h=i-24*t,r=(e.narrow?72:94)*t; - this.who.textSize=Math.round(14*t); - const o=this.say.height,a=this.button?10*t+48*t:0,c=Math.max(112*t,14*t+this.who.height+4*t+o+a+14*t),l=this.talkTop?14*t+this.progH+10*t:s-14*t-c; - this.talkLayout={ - ...e,x:n,y:l,w:h,h:c,padL:r} - ,this.talkBg.clear().roundRect(n,l,h,c,18*t).fill({ - color:921104,alpha:.95} - ); - const u=(e.narrow?52:72)*t,d=(e.narrow?66:88)*t,f=n+12*t,p=l+12*t; - this.faceBg.clear().roundRect(f,p,u,d,12*t).fill(2894894),this.faceMask.clear().roundRect(f,p,u,d,12*t).fill(16777215); - const w=(e.narrow?76:104)*t; - if(this.face.width=this.face.height=w,this.face.position.set(f-(e.narrow?8:10)*t,p+1*t),this.who.position.set(n+r,l+14*t),this.say.position.set(n+r,this.who.y+this.who.height+4*t),this.more.textSize=Math.round(13*t),this.moreY=l+c-10*t-this.more.height,this.more.position.set(n+h-14*t-this.more.width,this.moreY),this.button){ - const i=h-r-16*t,s=this.say.y+o+10*t; - this.goText.textSize=Math.round(16*t),this.goBg.clear().roundRect(0,0,i,48*t,12*t).fill(Dxi),this.goText.position.set((i-this.goText.width)/2,(48*t-this.goText.height)/2),this.go.position.set(n+r,s),this.go.hitArea=new $i(0,0,i,48*t)} - } - buildIdle(){ - const t=this.k,i=this.host.W(),s=this.host.H(),e=NAi.gear(); - this.idle.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const n=22*t,h=i-44*t,r=46*t,o=16*t,a=o+2*r+12*t,c=Math.max(this.talkBottom()+14*t,.24*s),l=(new ep).roundRect(n,c,h,a,18*t).fill({ - color:921104,alpha:.95} - ).rect(n+o,c+o+r,h-2*o,1).fill(Lxi); - this.idle.addChild(l),[["그냥 두면","자동으로",2,Bxi],["눌러 주면","느낌표 때",1,Dxi]].forEach(([i,s,a,l],u)=>{ - const d=c+o+r*u+r/2,f=Jxi(i,l,Math.round(14*t)),p=Jxi(s,Uxi,Math.round(11.5*t)); - f.position.set(n+o,d-(f.height+p.height+2*t)/2),p.position.set(n+o,f.y+f.height+2*t),this.idle.addChild(f,p); - const w=n+o+74*t+8*t; - for(let n=0; - n<a; - n++){ - const i=new Xe(e.bubbles[0]); - i.width=i.height=30*t,i.position.set(w+32*n*t,d-15*t),this.idle.addChild(i)} - const g=Jxi("→",Uxi,Math.round(16*t)),m=n+h-o-40*t; - g.position.set(m-8*t-18*t+(18*t-g.width)/2,d-g.height/2); - const v=new Xe(this.fishId?NAi.fish(this.fishId):ls.EMPTY); - v.anchor.set(.5),v.scale.set(40*t/100),v.position.set(m+20*t,d),this.idle.addChild(g,v)} - )} - spot(t){ - this.dimTarget=t,t?(this.dim.visible=!0,yx.to(this.dim,{ - alpha:1,duration:.35} - )):yx.to(this.dim,{ - alpha:0,duration:.25,onComplete:Qt(()=>{ - this.dimTarget||(this.dim.visible=!1)} - ,"onComplete")} - )} - drawDim(){ - var t; - const i=null==(t=this.dimTarget)?void 0:t.call(this); - if(!i)return; - const s=this.host.W(),e=this.host.H(),n=i.r/100,h=256*n; - this.dimHole.scale.set(n),this.dimHole.position.set(i.p.x,i.p.y); - const r=i.p.x-h,o=i.p.x+h,a=i.p.y-h,c=i.p.y+h; - this.dimRest.clear().rect(0,0,s,Math.max(0,a)).rect(0,c,s,Math.max(0,e-c)).rect(0,Math.max(0,a),Math.max(0,r),Math.max(0,Math.min(e,c)-Math.max(0,a))).rect(o,Math.max(0,a),Math.max(0,s-o),Math.max(0,Math.min(e,c)-Math.max(0,a))).fill({ - color:0,alpha:.58} - )} - point(t){ - this.handTarget=t,this.hand.visible=!!t} - drawHand(){ - var t; - const i=null==(t=this.handTarget)?void 0:t.call(this); - if(!i)return void(this.hand.visible=!1); - const s=this.k,e=54*s,n=cIi(this.clock); - this.hand.visible=!0,this.handArt.scale.set(e/64); - const h=23/64*e,r=5/64*e,o=10*s; - this.hand.pivot.set(e/2,e/2),this.hand.position.set(i.x-h+e/2+n.dx*s,i.y+o-r+e/2+n.dy*s),this.hand.scale.set(n.scale)} - drawFlash(){ - const t=this.flashUntil-this.clock; - if(t<=0)return void(this.flashOn&&(this.flash.clear(),this.flashOn=!1)); - this.flashOn=!0,this.flash.clear(); - const i=.06*Math.sin((3300-t)/1100*Math.PI)**2; - this.flash.rect(0,0,this.host.W(),this.host.H()).fill({ - color:16777215,alpha:i} - )} - tapRing(t){ - const i=new ep; - i.t0=this.clock,i.p=t,this.taps.addChild(i)} - toLocalOf(t){ - return this.toLocal(t)} - static holeTexture(){ - if(this.hole)return this.hole; - const t=document.createElement("canvas"); - t.width=t.height=512; - const i=t.getContext("2d"),s=i.createRadialGradient(256,256,100,256,256,156); - return s.addColorStop(0,"rgba(0,0,0,0)"),s.addColorStop(1,"rgba(0,0,0,0.58)"),i.fillStyle=s,i.fillRect(0,0,512,512),this.hole=ls.from(t)} - } - ; - Qt(I$i,"FishingTutorial"),Zt(I$i,"speed",1),Zt(I$i,"hole",null); - let k$i=I$i; - const x$i=[9,15,21,3],R$i=Qt(t=>String(t).padStart(2,"0"),"pad"); - function P$i(t){ - const i=UTi(t),s=FTi(t),e=(x$i[i]+6*(1-s/BTi))%24,n=Math.floor(e),h=Math.min(59,Math.floor(60*(e-n))); - return{ - tide:i,hour:e,text:`${ - R$i(n)} - :${ - R$i(h)} - `,left:s} - } - Qt(P$i,"gameClock"); - const N$i=Qt(t=>(t-12)/24*Math.PI*2,"dialAngle"),L$i=Qt(t=>[N$i(x$i[t]),N$i(x$i[t]+6)],"phaseArc"); - function D$i(t){ - const i=[]; - for(const s of t){ - const t=i.find(t=>t.id===s.id); - t?t.who.push({ - name:s.name,have:s.have,need:s.need} - ):i.push({ - id:s.id,who:[{ - name:s.name,have:s.have,need:s.need} - ]} - )} - return i} - function G$i(t,i,s){ - const e=HTi(s),n=t.race===i.race&&t.zone===i.zone&&VTi(t,i.point,e),h=t.depth===i.depth,r="전체"===t.tide||vTi[UTi(s)]===t.tide,o=!!t.roam; - let a=null; - return o||n||(a=t.pts.reduce((t,s)=>Math.abs(s-i.point)<Math.abs(t-i.point)?s:t,t.pts[0])),{ - here:n&&h&&r,placeOk:n,depthOk:h,tideOk:r,roam:o,near:a,tideWait:r?0:$Ti(s,vTi.indexOf(t.tide))} - } - function B$i(t,i){ - if(!t||"fish"!==t.kind||!t.id)return null; - const s=DTi(t.id).depth; - return s===i.depth?null:s} - function U$i(t,i,s,e,n){ - const h=ixi.getInstance(),r=G$i(t,i,s),o=new Ke,a=MTi[`${ - t.race} - |${ - t.zone} - `],c=r.roam?`${ - a} - · 날마다 바뀌는 곳 (회유)`:t.pts.length>=9?`${ - a} - 어디서나`:`${ - a} - · ${ - t.pts.slice(0,2).map(i=>GTi(t.race,t.zone,i)).join(", ")} - ${ - t.pts.length>2?` 외 ${ - t.pts.length-2} - 곳`:""} - `,l="전체"===t.tide?"모든 시간대":`${ - _Ti[vTi.indexOf(t.tide)]} - 에만`,u=_Ti[P$i(s).tide],d=[{ - k:"서식지",v:c,ok:r.placeOk,okText:"✓ 여기",act:null!==r.near?{ - text:"가기",go:!0,run:Qt(()=>h.goTo({ - race:t.race,zone:t.zone,point:r.near,depth:t.depth} - ),"run")} - :void 0} - ,{ - k:"깊이",v:mTi[t.depth],ok:r.depthOk,okText:"✓ 지금 깊이",act:{ - text:"맞추기",go:!1,run:Qt(()=>h.setDepth(t.depth),"run")} - } - ,{ - k:"시간대",v:l,ok:r.tideOk,okText:`✓ 지금 ${ - u} - `,wait:r.tideOk?void 0:`${ - _Ti[vTi.indexOf(t.tide)]} - 까지 ${ - wRi(r.tideWait)} - `} - ]; - let f=0; - for(const w of d){ - const t=Jxi(w.k,Uxi,12),i=Jxi(w.v,Bxi,13); - t.position.set(0,f+6),i.position.set(54,f+5); - let s=e; - if(w.ok){ - const t=Jxi(w.okText,$xi,12); - t.position.set(e-t.width,f+6),s=t.x-8,o.addChild(t)} - else if(w.act){ - const t=new cRi(w.act.text,64,28,12); - t.position.set(e-64,f+1),s=t.x-8; - const{ - run:i,go:h} - =w.act; - t.onTap=async()=>{ - t.enabled=!1; - const s=await i(); - if(s)return bH.getInstance().showMessage(s),void(t.enabled=!0); - YG("light"),n(h)} - ,o.addChild(t)} - else if(w.wait){ - const t=Jxi(w.wait,Uxi,11); - t.position.set(e-t.width,f+7),s=t.x-8,o.addChild(t)} - sRi(i,s-i.x),o.addChild(t,i),f+=32} - const p=Jxi(r.here?"지금 여기서 잘 잡혀요!":"셋 다 맞으면 잘 잡혀요",r.here?$xi:Uxi,11,!!r.here); - return p.position.set(0,f+4),o.addChild(p),{ - node:o,height:f+4+p.height} - } - Qt(D$i,"wantedFish"),Qt(G$i,"habitat"),Qt(B$i,"journeyDepth"),Qt(U$i,"habitatRows"); - const F$i=[16106577,16748378,4876472,12034796],$$i=Qt(t=>t<=2?8378016:t<=4?16106577:t<=6?16757611:16751752,"levelColor"),H$i=class extends Ke{ - constructor(){ - super(),Zt(this,"band",new Ke),Zt(this,"bandBg",new ep),Zt(this,"clockSeg",new Ke),Zt(this,"dial",new ep),Zt(this,"dialIcon",new Xe(ls.EMPTY)),Zt(this,"needle",new ep),Zt(this,"clockText",Jxi("",Bxi,15)),Zt(this,"depthSeg",new Ke),Zt(this,"depthGlyph",new ep),Zt(this,"depthArrow",Jxi("▾",Uxi,11)),Zt(this,"netSeg",new Ke),Zt(this,"netIcon",new _Ri("net","keepnet",22,16777215,20)),Zt(this,"netText",Jxi("",Bxi,13)),Zt(this,"seps",new ep),Zt(this,"place",new Ke),Zt(this,"placeBg",new ep),Zt(this,"badge",new ep),Zt(this,"badgeText",Jxi("",1056783,11)),Zt(this,"placeText",Jxi("",Bxi,12)),Zt(this,"pop",new Ke),Zt(this,"strip",new Ke),Zt(this,"card",new Ke),Zt(this,"cardId",0),Zt(this,"onDepth",null),Zt(this,"onNet",null),Zt(this,"sig",""),Zt(this,"stripSig",""),Zt(this,"last",null),Zt(this,"bandY",19),Zt(this,"bandW",0),Zt(this,"popSig",""),Zt(this,"cardSig",""),this.bandBg.eventMode=this.dial.eventMode=this.needle.eventMode=this.depthGlyph.eventMode=this.seps.eventMode="none",this.dialIcon.eventMode="none",this.dialIcon.anchor.set(.5),this.clockSeg.addChild(this.dial,this.dialIcon,this.needle,this.clockText),this.depthSeg.addChild(this.depthGlyph,this.depthArrow),this.netSeg.addChild(this.netIcon,this.netText); - for(const[t,i]of[[this.clockSeg,()=>this.togglePop()],[this.depthSeg,()=>{ - var t; - return null==(t=this.onDepth)?void 0:t.call(this)} - ],[this.netSeg,()=>{ - var t; - return null==(t=this.onNet)?void 0:t.call(this)} - ]])t.eventMode="static",t.cursor="pointer",t.on("pointertap",t=>{ - t.stopPropagation(),i()} - ); - this.band.addChild(this.bandBg,this.seps,this.clockSeg,this.depthSeg,this.netSeg),this.band.position.set(10,10),this.placeBg.eventMode=this.badge.eventMode="none",this.place.addChild(this.placeBg,this.badge,this.badgeText,this.placeText),this.place.eventMode="none",this.place.position.set(10,59),this.pop.visible=!1,this.pop.eventMode="static",this.pop.on("pointertap",t=>{ - t.stopPropagation(),this.closePops()} - ),this.card.visible=!1,this.card.eventMode="static",this.card.on("pointertap",t=>t.stopPropagation()),this.strip.eventMode="static",this.addChild(this.band,this.place,this.strip,this.pop,this.card)} - get cardOpen(){ - return this.card.visible||this.pop.visible} - get bandRight(){ - return this.band.x+this.bandW} - closePops(){ - this.pop.visible=!1,this.card.visible=!1,this.cardId=0} - closeIfOutside(t){ - if(!this.cardOpen)return!1; - for(let i=t; - i; - i=i.parent)if(i===this.card||i===this.pop||i===this.strip||i===this.clockSeg)return!1; - return this.closePops(),!0} - update(t){ - this.last=t; - const i=P$i(t.now),s=hCi(t.spot),e=`${ - i.text} - |${ - i.tide} - |${ - t.spot.race} - |${ - t.spot.zone} - |${ - t.spot.point} - |${ - t.spot.depth} - |${ - t.net} - /${ - t.netCap} - |${ - t.problem??""} - `; - e!==this.sig&&(this.sig=e,this.drawBand(i.hour,i.tide,i.text,t),this.drawPlace(s,t)),this.pop.visible&&this.drawPop(),this.drawStrip(t),this.card.visible&&this.cardId&&this.drawCard(this.cardId)} - drawBand(t,i,s,e){ - const n=20,h=this.dial.clear(); - h.circle(n,n,19.5).fill({ - color:Vxi,alpha:.65} - ); - for(let _=0; - _<4; - _++){ - const[t,s]=L$i(_),e=t+.07-Math.PI/2,r=s-.07-Math.PI/2; - h.moveTo(n+16*Math.cos(e),n+16*Math.sin(e)).arc(n,n,16,e,r).stroke({ - color:F$i[_],width:_===i?4.5:3,alpha:_===i?1:.45,cap:"round"} - )} - const r=NAi.gear().times; - this.dialIcon.texture!==r[i]&&(this.dialIcon.texture=r[i]),this.dialIcon.width=this.dialIcon.height=24,this.dialIcon.position.set(n,n); - const o=N$i(t),a=n+13.5*Math.sin(o),c=n-13.5*Math.cos(o); - this.needle.clear().moveTo(n,n).lineTo(a,c).stroke({ - color:16777215,width:1.6,alpha:.9,cap:"round"} - ).circle(a,c,2.6).fill(16777215).circle(a,c,2.6).stroke({ - color:Vxi,width:.8} - ),this.dial.position.set(0,0),this.dialIcon.x=n,this.needle.position.set(0,0),this.clockText.text=s,this.clockText.position.set(44,(44-this.clockText.height)/2-2); - const l=44+this.clockText.width+2; - this.clockSeg.position.set(2,2),this.clockSeg.hitArea=new $i(-2,-2,l+6,44); - const u=this.depthGlyph.clear(),d=["S","M","B"].indexOf(e.spot.depth); - [3,9,15].forEach((t,i)=>u.roundRect(1,t,18,4.5,2.25).fill(i===d?8048872:3820114)),this.depthArrow.position.set(22,3); - const f=22+this.depthArrow.width,p=e.netCap?e.net/e.netCap:0,w=p>=1?Hxi:p>=.8?16757611:Bxi; - this.netIcon.refresh(),this.netIcon.setTone(w),this.netIcon.position.set(-1,-2),this.netText.text=`${ - e.net} - /${ - e.netCap} - `,this.netText.textColor=w,this.netText.position.set(24,1); - const g=24+this.netText.width; - let m=2+l+9; - const v=Qt(t=>this.seps.rect(t,13,1,18).fill({ - color:3815998} - ),"sep"); - this.seps.clear(),v(m),m+=10,this.depthSeg.position.set(m,11),this.depthSeg.hitArea=new $i(-9,-11,f+18,44),m+=f+9,v(m),m+=10,this.netSeg.position.set(m,11),this.netSeg.hitArea=new $i(-9,-11,g+18,44),m+=g+10,this.bandW=m,this.bandBg.clear().roundRect(0,0,m,44,12).fill({ - color:Vxi,alpha:.8} - )} - drawPlace(t,i){ - const s=!!i.problem; - this.badge.visible=this.badgeText.visible=!s,s||(this.badge.clear().roundRect(0,0,18,18,6).fill($$i(t)),this.badgeText.text=String(t),this.badgeText.position.set((18-this.badgeText.width)/2,(18-this.badgeText.height)/2)),this.placeText.text=s?i.problem:GTi(i.spot.race,i.spot.zone,i.spot.point),this.placeText.textColor=s?Hxi:Bxi,sRi(this.placeText,250); - const e=s?8:24; - this.placeText.position.set(e,(18-this.placeText.height)/2),this.placeBg.clear().roundRect(-2,-3,e+this.placeText.width+9,24,8).fill({ - color:Vxi,alpha:.55} - )} - togglePop(){ - this.card.visible=!1,this.cardId=0,this.pop.visible=!this.pop.visible,this.pop.visible&&(this.drawPop(),yx.fromTo(this.pop,{ - alpha:0} - ,{ - alpha:1,duration:.15} - ),YG("light"))} - drawPop(){ - const t=this.last; - if(!t)return; - const i=P$i(t.now),s=_Ti[(i.tide+1)%4],e=hCi(t.spot),n=[`${ - _Ti[i.tide]} - ${ - i.text} - · ${ - s} - 까지 ${ - wRi(i.left)} - `,`낚시꾼 ${ - t.crowd} - 명 · 난이도 ${ - e} - ${ - e<=1?" (초급 자리)":""} - `,"물때가 바뀌면 나오는 물고기도 바뀌어요"],h=n.join("|"); - if(h===this.popSig&&this.pop.children.length)return; - this.popSig=h,this.pop.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const r=new ep,o=n.map((t,i)=>Jxi(t,2===i?Uxi:Bxi,2===i?11:12,2!==i)); - let a=9,c=0; - for(const l of o)l.position.set(12,a),a+=l.height+4,c=Math.max(c,l.width); - r.roundRect(0,0,c+24,a+5,10).fill({ - color:Vxi,alpha:.95} - ),this.pop.addChild(r,...o),this.pop.position.set(8,57),this.pop.hitArea=new $i(0,0,c+24,a+5)} - stripCell(t=0){ - return this.strip.children.filter(t=>"static"===t.eventMode)[t]??null} - setStripY(t){ - this.strip.y=t,this.card.visible&&(this.card.y=t+52)} - drawStrip(t){ - const i=t.wanted.slice(0,5),s=i.map(i=>G$i(DTi(i.id),t.spot,t.now).here),e=ixi.getInstance().state.dex,n=i.map((t,i)=>`${ - t.id} - :${ - t.who.map(t=>`${ - t.have} - /${ - t.need} - `).join(",")} - :${ - s[i]} - :${ - !!e[t.id]} - `).join("|")+`|${ - t.wanted.length} - `; - if(n===this.stripSig)return; - if(this.stripSig=n,this.strip.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),this.strip.visible=i.length>0,!i.length)return void this.closePops(); - const h=new ep; - this.strip.addChild(h),i.forEach((t,i)=>{ - const n=DTi(t.id),h=new Ke,r=new hRi(38); - r.set(t.id,n.star,0,!e[t.id]),h.addChild(r); - const o=t.who.find(t=>t.need>0&&t.have<t.need)??t.who.find(t=>t.need>0); - if(o){ - const t=Jxi(`${ - Math.min(o.have,o.need)} - /${ - o.need} - `,Bxi,10),i=(new ep).roundRect(0,0,t.width+8,14,7).fill({ - color:Vxi,alpha:.92} - ),s=new Ke; - s.addChild(i,t),t.position.set(4,1),s.position.set(38-t.width-6,28),h.addChild(s)} - s[i]&&h.addChild((new ep).circle(34,4,5).fill(8378016).circle(34,4,5).stroke({ - color:Vxi,width:1.5} - )),h.position.set(6+44*i,6),h.eventMode="static",h.cursor="pointer",h.hitArea=new $i(-3,-3,44,46),h.on("pointertap",i=>{ - i.stopPropagation(),this.toggleCard(t.id)} - ),this.strip.addChild(h)} - ); - const r=t.wanted.length-i.length; - let o=6+44*i.length-6+6; - if(r>0){ - const t=Jxi(`+${ - r} - `,Uxi,12); - t.position.set(o,6+(38-t.height)/2),this.strip.addChild(t),o+=t.width+8} - h.roundRect(0,0,o,50,12).fill({ - color:Vxi,alpha:.6} - ),this.strip.x=10,this.strip.hitArea=new $i(0,0,o,50)} - openCard(t){ - this.card.visible&&this.cardId===t||this.toggleCard(t)} - toggleCard(t){ - this.pop.visible=!1,this.card.visible&&this.cardId===t?this.closePops():(this.cardId=t,this.card.visible=!0,this.cardSig="",this.drawCard(t),yx.fromTo(this.card,{ - alpha:0} - ,{ - alpha:1,duration:.15} - ),YG("light"))} - drawCard(t){ - const i=this.last; - if(!i)return; - const s=i.wanted.find(i=>i.id===t); - if(!s)return void this.closePops(); - const e=DTi(t),n=G$i(e,i.spot,i.now),h=!!ixi.getInstance().state.dex[t],r=`${ - t} - |${ - n.placeOk} - |${ - n.depthOk} - |${ - n.tideOk} - |${ - Math.ceil(n.tideWait/6e4)} - |${ - s.who.map(t=>t.have).join(",")} - |${ - h} - `; - if(r===this.cardSig&&this.card.children.length)return; - this.cardSig=r,this.card.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const o=new ep,a=[o],c=new hRi(44); - c.set(t,e.star,0,!h),c.position.set(12,12); - const l=Jxi(`${ - e.name} - `,Bxi,15),u=Jxi("★".repeat(e.tier),Dxi,12); - l.position.set(66,14),sRi(l,202),u.position.set(l.x+l.width+6,17); - const d=Jxi(s.who.map(t=>t.need>0?`${ - t.name} - ${ - Math.min(t.have,t.need)} - /${ - t.need} - `:t.name).join(" · "),Uxi,11,!1); - d.position.set(66,37),sRi(d,242),a.push(c,l,u,d); - const f=U$i(e,i.spot,i.now,296,()=>{ - this.cardSig=""} - ); - f.node.position.set(12,66),a.push(f.node); - const p=66+f.height+12; - o.roundRect(0,0,320,p,12).fill({ - color:Vxi,alpha:.96} - ),this.card.addChild(...a),this.card.position.set(10,this.strip.y+52),this.card.hitArea=new $i(0,0,320,p)} - } - ; - Qt(H$i,"FishingStatusHud"); - let W$i=H$i; - const V$i=68,j$i=class extends Ke{ - constructor(){ - super(),Zt(this,"bg",new ep),Zt(this,"lines",[Jxi("",Bxi,15),Jxi("",Uxi,12,!1),Jxi("",Uxi,12,!1),Jxi("",Dxi,12,!1)]),Zt(this,"forId",0),Zt(this,"hideCall",null),this.eventMode="none",this.addChild(this.bg,...this.lines),this.visible=!1} - show(t,i,s,e,n,h){ - var r; - this.forId=t; - let o=10,a=0; - this.lines.forEach((t,e)=>{ - t.text=i[e]??"",t.textColor=s[e]??Uxi,t.visible=!!i[e],t.visible&&(sRi(t,300),t.position.set(12,o),o+=t.height+3,a=Math.max(a,t.width))} - ),o+=7,a+=24,this.bg.clear().roundRect(0,0,a,o,10).fill({ - color:Vxi,alpha:.96} - ),this.position.set(Math.max(0,Math.min(APi.BLEED_W-a,e-a/2)),h?n-o-6:n+6),this.visible=!0,yx.fromTo(this,{ - alpha:0} - ,{ - alpha:1,duration:.12} - ),null==(r=this.hideCall)||r.kill(),this.hideCall=yx.delayedCall(4,()=>this.hide())} - hide(){ - var t; - this.visible=!1,this.forId=0,null==(t=this.hideCall)||t.kill(),this.hideCall=null} - } - ; - Qt(j$i,"FishTip"); - let K$i=j$i; - const z$i=class t extends Ke{ - constructor(){ - super(),Zt(this,"tabId","fish"),Zt(this,"scrollInShell",!1),Zt(this,"fullBleed",!0),Zt(this,"onOpenMap",null),Zt(this,"scene",new dFi(APi.BLEED_W,this.H)),Zt(this,"hud",new W$i),Zt(this,"fishBtn",new cRi("물고기",76,34,13)),Zt(this,"mapBtn",new bRi("map","map",56,xxi)),Zt(this,"bite",new Ke),Zt(this,"popLayer",new Ke),Zt(this,"fxCatch",new Ke),Zt(this,"fishPanel",new Ke),Zt(this,"panelBg",new ep),Zt(this,"candTitle",Jxi("이곳의 물고기",Bxi,16)),Zt(this,"candCount",Jxi("",Uxi,13)),Zt(this,"candClose",Jxi("✕",Uxi,20)),Zt(this,"candCards",[]),Zt(this,"candBadges",[]),Zt(this,"candPool",[]),Zt(this,"candMore",Jxi("",Uxi,12,!1)),Zt(this,"tip",new K$i),Zt(this,"settling",!1),Zt(this,"awayRetryAt",0),Zt(this,"netSellBtn",new cRi("가득 참",92,26,12)),Zt(this,"netWasFull",!1),Zt(this,"othersAt",-1),Zt(this,"t0",performance.now()),Zt(this,"unsub",[]),Zt(this,"journeyBox",new Ke),Zt(this,"journeySig",""),Zt(this,"hubPanel",new Ke),Zt(this,"hubId",""),Zt(this,"logPanel",new Ke),Zt(this,"plunder"),Zt(this,"boatUi"),Zt(this,"huntUi"),Zt(this,"tradeUi"),Zt(this,"boatMenu"),Zt(this,"trackerTask",null),Zt(this,"progressHoldUntil",0),Zt(this,"lastWanted",[]),Zt(this,"dailyBusy",!1),Zt(this,"greeted",!1),Zt(this,"hubNearNow",!1),Zt(this,"depthOnClose",!1),Zt(this,"hubBusy",new Set),Zt(this,"hubPraise",""),Zt(this,"hubDrawn",""),Zt(this,"abandonArm",""),Zt(this,"logDrawn",""),Zt(this,"biteMark",new Xe(ls.EMPTY)),Zt(this,"visitorPanel",new Ke),Zt(this,"visitorKey",""),Zt(this,"visitorSpot",""),Zt(this,"swallowTap",!1),Zt(this,"coach",new TNi),Zt(this,"sailTipAnchor",Qt(()=>this.scene.idleInSail?t.anchorOf(this.scene.boatSprite,!1)():null,"sailTipAnchor")),Zt(this,"realTutBackend",{ - biteOpen:Qt(()=>!!ixi.getInstance().biteOpen(),"biteOpen"),hookable:Qt(()=>!!ixi.getInstance().hookable(),"hookable"),hook:Qt(async()=>(await ixi.getInstance().hook()).message,"hook"),recast:Qt(()=>{ - ixi.getInstance().cast()} - ,"recast"),finish:Qt(()=>{ - ixi.getInstance().markTip("tut")} - ,"finish"),biteIn:Qt(()=>ixi.getInstance().biteIn(),"biteIn")} - ),Zt(this,"tutBackend",this.realTutBackend),Zt(this,"tutPreviewing",!1),Zt(this,"tutRace","인간"),Zt(this,"tut",new k$i({ - scene:this.scene,backend:Qt(()=>this.tutBackend,"backend"),race:Qt(()=>this.tutRace,"race"),W:Qt(()=>APi.BLEED_W,"W"),H:Qt(()=>this.H,"H"),biteGlobal:Qt(()=>t.shown(this.bite)?this.bite.toGlobal({ - x:0,y:0} - ):null,"biteGlobal"),onFinish:Qt(t=>this.endTutorial(t),"onFinish"),lift:Qt(()=>APi.FOOTER+6,"lift")} - )),Zt(this,"quietAfterTut",!1),Zt(this,"onTutorialPreviewEnd",null),Zt(this,"autoTag",new Ke),this.hud.onDepth=()=>{ - this.cycleDepth()} - ,this.hud.onNet=()=>{ - pNi.getInstance().openView("net"),APi.getInstance().selectTab("tank")} - ,this.netSellBtn.visible=!1,this.netSellBtn.onTap=()=>{ - pNi.getInstance().openView("net"),APi.getInstance().selectTab("tank")} - ,this.fishBtn.setPrimary(!1),this.mapBtn.onTap=()=>{ - var t; - return null==(t=this.onOpenMap)?void 0:t.call(this)} - ,this.fishBtn.onTap=()=>this.toggleFishPanel(),this.biteMark.anchor.set(.5,gAi),this.biteMark.scale.set(.2),this.biteMark.position.set(0,25),this.bite.addChild(this.biteMark),this.bite.visible=!1,this.bite.eventMode="static",this.bite.cursor="pointer",this.bite.hitArea=new $i(-44,-44,88,96),this.bite.on("pointertap",t=>{ - t.stopPropagation(),this.tryHook()} - ),this.scene.onTapBefore=()=>this.hookTap(),this.scene.startInSail=()=>{ - const t=ixi.getInstance(); - return!t.tipSeen("sail")||!t.tipSeen("rod")} - ,this.autoTag.eventMode="none",this.scene.onStopAtPoint=t=>{ - var i,s; - this.tutPreviewing?null==(s=(i=this.tutBackend).onCast)||s.call(i):this.stopAt(t)} - ,this.scene.onVisitorTap=t=>this.openVisitor(t),this.scene.onModeChange=()=>ixi.getInstance().syncSoon(),this.scene.onCast=()=>{ - var t,i; - this.tutPreviewing?null==(i=(t=this.tutBackend).onCast)||i.call(t):ixi.getInstance().cast()} - ,this.scene.onHubTap=(t,i)=>this.openHub(t,i),ixi.getInstance().onBigMove=(t,i,s)=>this.playTravel(t,i,s),this.scene.onHubArrive=t=>{ - this.hubPanel.visible||this.logPanel.visible||this.tut.active||this.openHub(t,!0)} - ,this.journeyBox.eventMode="static",this.journeyBox.cursor="pointer",this.journeyBox.on("pointertap",t=>{ - t.stopPropagation(),this.tapNext()} - ),this.journeyBox.position.set(10,84),this.hubPanel.visible=!1,this.hubPanel.eventMode="static",this.logPanel.visible=!1,this.logPanel.eventMode="static",this.visitorPanel.visible=!1,this.visitorPanel.eventMode="static",this.popLayer.eventMode="none",this.buildFishPanel(),this.fxCatch.eventMode="static",this.fxCatch.visible=!1,this.fxCatch.on("pointertap",t=>{ - var i,s; - t.stopPropagation(),null==(s=(i=this.scene).onTapBefore)||s.call(i),wFi.dismiss()} - ),this.plunder=new EFi(this.scene,()=>this.H),this.plunder.overlayOpen=()=>!(!_Ni.getInstance().parent&&!QNi.isOpen); - const i=this.scene.onOtherTap; - this.boatUi=new h$i(this.scene,()=>this.H),this.boatUi.bannerY=()=>this.plunder.bannerBottom,this.boatUi.onPeek=t=>null==i?void 0:i(t,!1),this.huntUi=new O$i(this.scene,()=>this.H),this.huntUi.bannerY=()=>this.boatUi.bannerBottom,this.tradeUi=new xFi(this.scene,()=>this.H),this.tradeUi.bannerY=()=>this.huntUi.bannerBottom,this.tradeUi.onOpen=()=>{ - this.closeHub(),this.closeVisitor(),this.closeLog(),this.plunder.closePeek(),this.boatUi.closeAll(),this.huntUi.closeAll(),this.boatMenu.close()} - ,this.boatMenu=new PFi(this.scene,()=>this.H),this.boatMenu.wantsHelp=t=>this.boatUi.wantsHelp(t),this.boatMenu.onTrade=t=>this.tradeUi.request(t),this.boatMenu.onPeek=t=>null==i?void 0:i(t,!1),this.boatMenu.onHelp=t=>{ - this.plunder.closePeek(),this.boatUi.openHelp(t)} - ,this.scene.onOtherTap=t=>{ - this.closeHub(),this.closeVisitor(),this.boatUi.closeAll(),this.plunder.closePeek(),this.tradeUi.panelOpen||this.boatMenu.open(t)} - ,this.addChild(this.scene,this.boatUi.chip,this.huntUi.chip,this.netSellBtn,this.fishBtn,this.mapBtn,this.bite,this.autoTag,this.journeyBox,this.hud,this.popLayer,this.fishPanel,this.visitorPanel,this.hubPanel,this.logPanel,this.plunder,this.boatUi,this.huntUi,this.tradeUi,this.boatMenu,this.fxCatch,this.coach,this.tut),this.eventMode="static",this.on("pointerdowncapture",t=>{ - this.coach.dismiss(); - const i=this.hud.closeIfOutside(t.target); - this.swallowTap=!1,(this.hookTap()||i)&&(this.swallowTap=!0,t.stopPropagation())} - ),this.on("pointertapcapture",t=>{ - this.swallowTap&&(this.swallowTap=!1,t.stopPropagation())} - )} - static getInstance(){ - return this.instance??(this.instance=new t)} - get H(){ - return APi.contentHeight} - get depthBtn(){ - return this.hud.depthSeg} - get netChip(){ - return this.hud.netSeg} - get hereDef(){ - const t=ixi.getInstance().state.spot; - return"R"===t.zone?oOi[t.race]:null} - static questRace(t){ - var i; - const s=ixi.getInstance(); - return(null==(i=COi(t.id,s.startRace()))?void 0:i.race)??s.startRace()} - get inJourneyMap(){ - const i=ixi.getInstance().state.spot,s=this.trackedNow(); - return"R"===i.zone&&(!s||i.race===t.questRace(s.def))} - static npc(t){ - for(const i of Object.values(oOi)){ - const s=i.npcs.find(i=>i.id===t); - if(s)return s} - return oOi["인간"].npcs[0]} - trackedNow(){ - const t=ixi.getInstance(),i=t.tracked(); - return i?t.questHeld().find(t=>t.def.id===i.id)??null:null} - hubStates(t){ - const i=ixi.getInstance(),s=i.questHeld(),e=new Map; - for(const n of t.npcs){ - const h=s.filter(t=>i.questTurnIn(t.def)===n.id); - e.set(n.id,h.some(t=>t.ready)?"ready":i.questOffers(t.race,n.id).length?"offer":h.length?"wait":"idle")} - return e} - offeringNpc(t){ - const i=ixi.getInstance(); - return t.npcs.find(s=>i.questOffers(t.race,s.id).length>0)??null} - get questFresh(){ - const t=ixi.getInstance().qlog(); - return!t.held.length&&!t.done.length} - syncJourney(){ - const i=this.hereDef,s=ixi.getInstance(); - if(i){ - const e=this.hubStates(i); - this.scene.setHubs(i.npcs.map(t=>({ - id:t.id,name:t.name,role:t.role,art:t.art,anchor:t.anchor,ship:t.ship,state:this.tut.active?"idle":e.get(t.id)??"idle"} - ))),!this.questFresh||i.race!==s.startRace()||this.tut.active||this.tutorialDue()||this.greetFirstHub(i.npcs[0].id); - let n=null; - const h=this.trackedNow(); - if(h&&t.questRace(h.def)===i.race){ - const e=h.def,r=s.questTurnIn(e); - (h.ready||"meet"===e.kind)&&i.npcs.some(t=>t.id===r)?n={ - points:[],hub:r,label:t.npc(r).name} - :"fish"===e.kind?n={ - points:DTi(e.fish).pts,hub:null,label:DTi(e.fish).name} - :"any"!==e.kind&&"area"!==e.kind||void 0===e.point||(n={ - points:[e.point],hub:null,label:GTi(i.race,"R",e.point)} - )} - else if(!h){ - const t=this.offeringNpc(i); - t&&(n={ - points:[],hub:t.id,label:t.name} - )} - this.scene.setGoal(this.tut.active?null:n)} - else this.scene.setHubs([]),this.scene.setGoal(null); - this.renderTracker(),this.logPanel.visible&&this.renderLog()} - taskInput(){ - const i=ixi.getInstance(),s=i.state,e=s.boat,n=this.trackedNow(),h=i.questHeld(),r=i.realNow(),o=tki(s.spot,r,s.huntDevAt),a=h.find(t=>t.ready&&"meet"!==t.def.kind),c=this.hereDef?this.offeringNpc(this.hereDef):null; - return{ - boatBroken:!!(null==e?void 0:e.broken)&&!e.repairAt,netFull:i.netFull(),contestReady:i.contestReady(),daily:i.daily(),journeyReady:a?{ - npc:t.npc(i.questTurnIn(a.def)).name} - :null,goalsReady:i.goalsReady(),monster:o?{ - name:o.name,inMs:o.at-r} - :null,journeyNext:n?{ - title:`퀘스트 · ${ - n.def.title} - `,line:UOi(n.def,n.got).text} - :c?{ - title:"퀘스트",line:`${ - c.name} - 에게 퀘스트 받기`} - :null,journeyHere:this.inJourneyMap,areaReady:(()=>{ - const t=i.areaReady(); - return t?{ - name:t.name,pearl:t.pearl} - :null} - )(),areaNext:(()=>{ - const t=i.areaNext(); - return t?{ - name:t.name,have:t.have,need:t.need} - :null} - )(),dailyOff:!0} - } - get progressHeld(){ - return performance.now()<this.progressHoldUntil} - renderTracker(){ - this.progressHeld&&this.journeySig||(this.drawTracker(),this.hud.setStripY(this.journeyBox.y+this.journeyBox.height+6))} - drawTracker(){ - const i=ixi.getInstance(),s=this.journeyBox,e=Wki(this.taskInput()),n=this.trackedNow(),h=i.qlog().held.length,r=this.hereDef?this.offeringNpc(this.hereDef):null,o=("journey"===e.kind||"journeyReady"===e.kind)&&this.inJourneyMap&&(!!n||!!r),a=o?`q|${ - null==n?void 0:n.def.id} - |${ - null==n?void 0:n.got} - |${ - null==n?void 0:n.ready} - |${ - h} - |${ - null==r?void 0:r.id} - `:`t|${ - e.kind} - |${ - e.title} - |${ - e.sub} - `; - if(this.trackerTask=e,s.visible=!0,a===this.journeySig)return; - this.journeySig=a,s.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const c=new ep; - if(o){ - const e=NAi.gear().journeyFaces,o=null==n?void 0:n.def,a="meet"===(null==o?void 0:o.kind),l=!!(null==n?void 0:n.ready)&&!a,u=t.npc(o?l||a||o.teach?i.questTurnIn(o):o.npc:r.id),d=uRi(e[u.art]??e[0],28); - d.position.set(3,3); - const f=Jxi(o?l?`✓ ${ - u.name} - 에게 가서 마치기`:t.questLine(o,n.got):`${ - u.name} - 에게 퀘스트 받기`,l?$xi:Bxi,13); - f.setWrapWidth(214); - const p=Math.max(34,f.height+12); - f.position.set(38,(p-f.height)/2); - const w=Jxi("›",Uxi,16); - w.position.set(38+f.width+6,(p-w.height)/2-1); - const g=w.x+w.width+10; - if(c.roundRect(0,0,g,p,Math.min(17,p/2)).fill({ - color:l?1194534:Vxi,alpha:.85} - ),d.y=(p-28)/2,s.addChild(c,d,f,w),h){ - const t=new Ke,e=Jxi(`${ - h} - `,1776411,10); - t.addChild((new ep).circle(0,0,8).fill(h>=i.questHoldMax()?Hxi:Dxi),e),e.position.set(-e.width/2,-e.height/2),t.position.set(d.x+27,d.y+3),s.addChild(t)} - if(n&&!n.ready&&n.need>1){ - const t=(new ep).roundRect(10,p-3,Math.max(0,(g-20)*Math.min(1,n.got/n.need)),3,1.5).fill(Dxi); - s.addChild(t)} - s.hitArea=new $i(0,0,g,p)} - else{ - const t="repair"===e.kind||"net"===e.kind,i="claim"===e.kind||"contest"===e.kind||"goal"===e.kind||"journeyReady"===e.kind,n=Jxi(e.title,t?Hxi:i?$xi:Dxi,12); - n.position.set(12,5); - const h=Jxi(e.sub,Bxi,13); - h.position.set(12,22),sRi(n,260),sRi(h,260); - const r=Jxi("›",Uxi,16),o=Math.max(n.width,h.width)+12+22; - r.position.set(o-18,(42-r.height)/2-1),c.roundRect(0,0,o,42,14).fill({ - color:i?1194534:t?3806994:Vxi,alpha:.85} - ),s.hitArea=new $i(0,0,o,42),s.addChild(c,n,h,r)} - this.hubPanel.visible&&this.renderHub()} - tapNext(){ - const t=this.trackerTask,i=APi.getInstance(); - if(t)switch(t.go){ - case"repair":return void this.boatUi.openPanel(); - case"net":return pNi.getInstance().openView("net"),void i.selectTab("tank"); - case"hunt":return void this.huntUi.openRecords(); - case"claim":return void this.claimDailyHere(); - case"fish":return void bH.getInstance().showMessage("입질이 오면 직접 눌러 낚아요"); - case"journey":return void(ixi.getInstance().qlog().held.length?this.openLog():this.inJourneyMap?this.tapTracker():this.goJourney()); - default:ei(()=>Promise.resolve().then(()=>KWi),void 0).then(s=>{ - s.FishingQuestPage.getInstance().openView(t.go),i.selectTab("quest")} - )} - } - async goJourney(){ - const t=ixi.getInstance(),i=t.startRace(),s=oOi[i],e=this.offeringNpc(s)??s.npcs[0],n=await t.goTo({ - race:i,zone:"R",point:e.anchor,depth:t.state.spot.depth} - ); - !n&&jPi.active||bH.getInstance().showMessage(n??`${ - s.river} - 으로 왔어요 · ${ - e.name} - 에게 가 보세요`)} - goTurnIn(i){ - const s=ixi.getInstance(),e=s.questTurnIn(i),n=t.npc(e); - if(this.closeLog(),this.scene.hubNear(e))return void this.openHub(e,!0); - if(this.scene.sailToHub(e))return void bH.getInstance().showMessage(`${ - n.name} - 에게 가요`); - const h=Object.values(oOi).find(t=>t.npcs.some(t=>t.id===e)); - h&&s.goTo({ - race:h.race,zone:"R",point:n.anchor,depth:s.state.spot.depth} - ).then(t=>{ - !t&&jPi.active||bH.getInstance().showMessage(t??`${ - h.river} - 으로 왔어요 · ${ - n.name} - 에게 가 보세요`)} - )} - static questLine(t,i){ - const s=UOi(t,i); - return BOi.includes(t.kind)?`${ - s.hint} - ${ - s.text} - `:s.text} - async goQuestPlace(i){ - const s=APi.getInstance(),e=Qt(async(t,i,e)=>{ - await s.selectTab(t); - const n=i(); - n&&(s.scrollToShow(n),s.point(n,e))} - ,"go"); - switch(i.kind){ - case"gear":{ - const{ - FishingGearPage:t} - =await ei(async()=>{ - const{ - FishingGearPage:t} - =await Promise.resolve().then(()=>dWi); - return{ - FishingGearPage:t} - } - ,void 0),s="line"===i.gear||"rod"===i.gear?"낚싯대":"reel"===i.gear||"bobber"===i.gear?"찌":"icebox"===i.gear?"어망":null,n=XTi.find(t=>t.key===i.gear); - return void(await e("gear",()=>t.getInstance().focusTool(i.gear),s?`여기에 ${ - s} - 를 껴요`:`여기서 ${ - lRi((null==n?void 0:n.title)??"","을","를")} - 올려요`))} - case"sell":return pNi.getInstance().openView("net"),void(await e("tank",()=>pNi.getInstance().sellButton,"여기서 물고기를 팔아요")); - case"contest":case"area":{ - const{ - FishingQuestPage:t} - =await ei(async()=>{ - const{ - FishingQuestPage:t} - =await Promise.resolve().then(()=>KWi); - return{ - FishingQuestPage:t} - } - ,void 0); - return t.getInstance().openView(i.kind),void(await s.selectTab("quest"))} - case"harpoon":return void(t.shown(this.huntUi.throwBtn)?s.point(this.huntUi.throwBtn,"물고기로 작살을 만들어요"):this.huntUi.openCraft())} - } - playTravel(t,i,s){ - if(!APi.getInstance().parent||this.tut.active)return; - const e=`${ - i.race} - |${ - i.zone} - `; - jPi.play({ - from:t,to:i,boatLv:ixi.getInstance().state.gear.boat,wait:s,mapReady:Qt(()=>this.scene.mapReadyFor(e),"mapReady"),onGlide:Qt(t=>this.scene.glideIn(t),"onGlide")} - )} - async claimDailyHere(){ - if(!this.dailyBusy){ - this.dailyBusy=!0; - try{ - const t=await ixi.getInstance().claimDaily(); - if(t)return void bH.getInstance().showMessage(t); - YG("success"),bH.getInstance().showMessage("오늘 할 일 끝! 진주 200개를 받았어요"),APi.getInstance().flyCurrency("pearl",this.journeyBox.toGlobal({ - x:60,y:23} - ),8)} - finally{ - this.dailyBusy=!1,this.renderTracker()} - } - } - greetFirstHub(t){ - this.greeted||this.hubPanel.visible||!this.scene.hubPos(t)||_Ni.getInstance().parent||QNi.isOpen||!ixi.getInstance().look&&!QNi.skipped||(this.greeted=!0,this.openHub(t,this.scene.hubNear(t)))} - devGiant(){ - this.scene.devGiant()} - tapTracker(){ - const t=this.hereDef,i=t?this.offeringNpc(t):null; - i&&this.openHub(i.id,this.scene.hubNear(i.id))} - async matchQuestDepth(t){ - const i=ixi.getInstance(),s="fish"===t.kind?B$i({ - kind:"fish",id:t.fish} - ,i.state.spot):null; - if(!s)return; - const e=await i.setDepth(s); - bH.getInstance().showMessage(e??`${ - mTi[s]} - 에 사는 물고기예요 · 깊이를 ${ - mTi[s]} - 으로 맞췄어요`),this.render()} - openHub(t,i){ - this.plunder.closePeek(),this.closeLog(),this.hubId=t,this.hubNearNow=i,this.closeVisitor(),this.renderHub(!0),this.hubPanel.visible=!0,yx.fromTo(this.hubPanel,{ - alpha:0,y:12} - ,{ - alpha:1,y:0,duration:.18} - )} - closeHub(){ - this.hubPraise="",this.hubId="",this.quietAfterTut=!1,this.hubPanel.visible=!1; - const t=this.depthOnClose?ixi.getInstance().tracked():null; - this.depthOnClose=!1,"fish"===(null==t?void 0:t.kind)&&this.matchQuestDepth(t)} - static questIcon(t,i){ - if("fish"===t.kind){ - const s=DTi(t.fish),e=new hRi(i); - return e.set(s.id,s.star,0,!ixi.getInstance().state.dex[s.id]),e} - const s="sell"===t.kind?"keepnet":"harpoon"===t.kind?"toolbox":"hunt"===t.kind?"pin":"contest"===t.kind?"trophy":"area"===t.kind?"map":"meet"===t.kind?"people":"any"===t.kind?"hook":"boat"===t.gear?"boat":"line"===t.gear?"spool":"rod"===t.gear?"rod":"reel"===t.gear?"reel":"bobber"===t.gear?"bobber":"auto"===t.gear?"autorod":"keepnet",e=new Ke; - return e.addChild((new ep).roundRect(0,0,i,i,9).fill(kxi),mRi(s,.62*i,16777215)),e.children[1].position.set(.19*i,.19*i),e} - static rewardRow(t){ - const i=new Ke; - let s=0; - if(t.gold){ - const e=pRi("gold",15),n=Jxi(t.gold.toLocaleString(),Dxi,12); - n.position.set(19,-1),e.x=s,n.x+=s,i.addChild(e,n),s=n.x+n.width+10} - if(t.pearl){ - const e=pRi("pearl",15),n=Jxi(`${ - t.pearl} - `,Wxi,12); - e.x=s,n.position.set(s+19,-1),i.addChild(e,n)} - return i} - renderHub(i=!1){ - var s,e; - const n=ixi.getInstance(),h=this.hubPanel; - if(!this.hubId)return h.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),void this.closeHub(); - const r=Object.values(oOi).find(t=>t.npcs.some(t=>t.id===this.hubId))??this.hereDef??oOi[n.startRace()],o=t.npc(this.hubId),a=(null==(s=this.hereDef)?void 0:s.race)===r.race,c=a&&(this.hubNearNow||this.scene.hubNear(o.id)),l=n.questHeld().filter(t=>n.questTurnIn(t.def)===o.id),u=n.questOffers(r.race,o.id),d=n.questHoldMax(),f=n.qlog().held.length>=d,p=null==(e=SOi(r.race,0,n.startRace())[0])?void 0:e.id,w=APi.BLEED_W,g=w-20,m=10,v=138,_=[...l.filter(t=>t.ready),...l.filter(t=>!t.ready)].length+u.length,M=[r.race,o.id,c,l.map(t=>`${ - t.def.id} - :${ - t.got} - :${ - t.ready} - `).join(","),u.map(t=>t.id).join(","),f,[...this.hubBusy].join(","),w,this.H].join("|"); - if(!i&&M===this.hubDrawn&&h.children.length)return; - this.hubDrawn=M,h.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const b=104,y=b+58*_+58,E=this.H-y-8,A=eRi(g,y,Vxi,null,14); - A.alpha=.96,A.position.set(m,E); - const S=NAi.gear(),T=new Xe(S.journeyNpcs[o.art]??S.journeyNpcs[0]); - T.width=T.height=132,T.position.set(6,E+b-128); - const C=Jxi(o.name,Dxi,18),O=Jxi(o.role,Uxi,13); - C.position.set(v,E+14),O.position.set(C.x+C.width+8,E+18); - const I=[A,T,C,O],k=l.find(t=>t.ready),x=!!k&&"meet"===k.def.kind&&!c,R=r.npcs.findIndex(t=>t.id===o.id),P=SOi(r.race,R,n.startRace()).every(t=>n.qlog().done.includes(t.id)),N=x?`${ - o.role} - · 배를 몰고 가서 말을 걸어요`:this.hubPraise?this.hubPraise:k?k.def.done:u.length?u[0].line:l.length?"맡긴 일 잘 부탁해요!":P?`고마웠어요! ${ - r.river} - 에 오면 또 들러 줘요.`:"어서 와요. 지금은 딱히 부탁할 게 없네요.",L=Jxi(x?N:`"${ - N} - "`,x?Uxi:Bxi,13,!1); - if(L.setWrapWidth(m+g-14-v),L.position.set(v,E+42),sRi(L,2.2*(m+g-14-v)),I.push(L),_){ - const t=n.qlog().held.length,i=new Ke,s=(new ep).circle(9,9,9).fill(Dxi),e=Jxi("!",1776411,12,!1),h=Jxi(`퀘스트 ${ - t} - /${ - d} - `,t>=d?Hxi:Dxi,13); - e.position.set(9-e.width/2,9-e.height/2),h.position.set(24,9-h.height/2),i.addChild(s,e,h),i.position.set(m+g-16-i.width,E+b-24),I.push(i)} - let D=E+b; - const G=Qt((i,s,e,n,h)=>{ - const r=(new ep).roundRect(20,D,g-20,52,10).fill(h?1194534:Ixi),o=t.questIcon(i,40); - o.position.set(28,D+6); - const a=Jxi(i.title,Bxi,14); - a.position.set(76,D+7); - const c=Jxi(s,e,12,!1); - c.position.set(76,D+28); - const l=t.rewardRow(i); - l.position.set(76+a.width+10,D+9); - const u=g-20-66-(n?104:12); - sRi(a,u-60),sRi(c,u),I.push(r,o,a,c,l),n&&(n.position.set(m+g-10-96,D+6),I.push(n)),D+=58} - ,"addRow"); - for(const t of l.filter(t=>t.ready)){ - const i=new cRi("마치기",88,40,14); - i.enabled=c&&!this.hubBusy.has(t.def.id),i.onTap=async()=>{ - if(this.hubBusy.has(t.def.id))return; - const s=i.toGlobal({ - x:44,y:20} - ),e=n.questHoldMax(); - this.hubBusy.add(t.def.id),i.enabled=!1; - const h=await n.questComplete(t.def.id).finally(()=>this.hubBusy.delete(t.def.id)); - if(h.message)return bH.getInstance().showMessage(h.message),void this.renderHub(!0); - YG("success"); - const r=APi.getInstance(); - h.gold&&r.flyCurrency("gold",s,6),h.pearl&&r.flyCurrency("pearl",s,4); - const o=n.questHoldMax(); - o>e?(this.hubPraise=`잘하고 있어요! 이제 퀘스트를 한 번에 ${ - o} - 개까지 받을 수 있어요.`,bH.getInstance().showMessage(`퀘스트를 한 번에 ${ - o} - 개까지 받을 수 있어요`),QG.getInstance().playSFX(QG.SFX_POPUP)):bH.getInstance().showMessage(`"${ - t.def.done} - "`),this.syncJourney(),this.renderHub(!0)} - ,G(t.def,"meet"===t.def.kind?"✓ 인사하러 왔어요":"✓ 다 했어요",$xi,i,!0)} - for(const $ of l.filter(t=>!t.ready))G($.def,t.questLine($.def,$.got),Uxi,null,!1); - for(const t of u){ - const i=new cRi("받기",88,40,14),s=t.id===p; - i.enabled=!f&&(c||s)&&!this.hubBusy.has(t.id),i.onTap=async()=>{ - if(this.hubBusy.has(t.id))return; - this.hubBusy.add(t.id),i.enabled=!1; - const e=await n.questAccept(t.id,r.race,o.id).finally(()=>this.hubBusy.delete(t.id)); - if(e)return bH.getInstance().showMessage(e),void this.renderHub(!0); - YG("light"),this.syncJourney(),"fish"===t.kind&&(this.depthOnClose=!0),s||"meet"===t.kind?this.closeHub():this.renderHub(!0)} - ,G(t,UOi(t,0).ask,Uxi,i,!1)} - const B=E+y-58+8,U=new cRi("닫기",96,40,14); - U.setPrimary(!1),U.onTap=()=>this.closeHub(),U.position.set(m+g-16-96,B),I.push(U); - const F=Jxi(f&&u.length?`퀘스트는 지금 ${ - d} - 개까지 들 수 있어요 · 마칠수록 늘어요`:!c&&_?"가까이 가야 받고 마칠 수 있어요":"",Uxi,12); - if(F.position.set(28,B+12),I.push(F),!c&&_){ - const t=new cRi("여기로 가기",120,40,14); - t.position.set(U.x-8-120,B),t.onTap=()=>{ - a?this.scene.sailToHub(o.id)&&this.closeHub():(this.closeHub(),n.goTo({ - race:r.race,zone:"R",point:o.anchor,depth:n.state.spot.depth} - ).then(t=>{ - !t&&jPi.active||bH.getInstance().showMessage(t??`${ - r.river} - 으로 왔어요 · ${ - o.name} - 에게 가 보세요`)} - ))} - ,I.push(t),sRi(F,t.x-F.x-10)} - h.hitArea=new $i(0,0,w,this.H),h.removeAllListeners("pointertap"),h.on("pointertap",t=>{ - t.stopPropagation(),h.toLocal(t.global).y<E&&this.closeHub()} - ),h.addChild(...I)} - openLog(){ - this.closeHub(),this.closeVisitor(),this.abandonArm="",this.renderLog(!0),this.logPanel.visible=!0,yx.fromTo(this.logPanel,{ - alpha:0,y:12} - ,{ - alpha:1,y:0,duration:.18} - )} - closeLog(){ - this.logPanel.visible=!1,this.abandonArm=""} - renderLog(i=!1){ - var s; - const e=ixi.getInstance(),n=this.logPanel,h=e.questHeld(),r=null==(s=e.tracked())?void 0:s.id,o=APi.BLEED_W,a=o-20,c=[h.map(t=>`${ - t.def.id} - :${ - t.got} - :${ - t.ready} - `).join(","),r,this.abandonArm,o,this.H].join("|"); - if(!i&&c===this.logDrawn&&n.children.length)return; - this.logDrawn=c,n.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const l=50+64*Math.max(1,h.length)+58,u=this.H-l-8,d=eRi(a,l,Vxi,null,14); - d.alpha=.96,d.position.set(10,u); - const f=Jxi(`퀘스트 ${ - h.length} - /${ - e.questHoldMax()} - `,Dxi,17); - f.position.set(26,u+14); - const p=[d,f]; - if(!h.length){ - const t=Jxi("들고 있는 퀘스트가 없어요. NPC 에게 말을 걸어 받아요.",Uxi,13); - t.position.set(26,u+50+18),p.push(t)} - const w=NAi.gear().journeyFaces; - h.forEach((i,s)=>{ - const n=u+50+64*s,h=i.def.id===r,o=new Ke,c=(new ep).roundRect(0,0,a-20,58,10).fill(i.ready?1194534:h?xxi:Ixi); - o.addChild(c); - const l=t.npc(e.questTurnIn(i.def)),d=uRi(w[l.art]??w[0],34); - d.position.set(10,12); - const f=Jxi(i.def.title,Bxi,14); - f.position.set(54,8); - const g=Jxi(i.ready?`✓ ${ - l.name} - 에게 가서 마치기`:t.questLine(i.def,i.got),i.ready?$xi:Uxi,12,!1); - g.position.set(54,31),sRi(f,a-20-54-110),sRi(g,a-20-54-110),o.addChild(d,f,g),i.need>1&&!i.ready&&o.addChild((new ep).roundRect(54,52,Math.max(0,(a-20-54-110)*(i.got/i.need)),3,1.5).fill(Dxi)); - const m=i.ready||"meet"===i.def.kind,v=new cRi(m?"이동":this.abandonArm===i.def.id?"정말 포기?":"포기",92,36,12); - v.setPrimary(m),v.position.set(a-20-100,11),v.onTap=async()=>{ - if(m)return void this.goTurnIn(i.def); - if(this.abandonArm!==i.def.id)return this.abandonArm=i.def.id,void this.renderLog(); - v.enabled=!1; - const t=await e.questAbandon(i.def.id); - if(this.abandonArm="",t)return bH.getInstance().showMessage(t),void this.renderLog(); - bH.getInstance().showMessage(`"${ - i.def.title} - " 퀘스트를 포기했어요 · ${ - l.name} - 에게 다시 받을 수 있어요`),this.syncJourney(),this.renderLog()} - ,o.addChild(v),o.position.set(20,n),c.eventMode="static",c.cursor="pointer",c.on("pointertap",t=>{ - if(t.stopPropagation(),e.track(i.def.id),this.abandonArm="",this.journeySig="",this.syncJourney(),"fish"===i.def.kind&&!i.ready)return this.closeLog(),this.render(),this.hud.openCard(i.def.fish),void this.matchQuestDepth(i.def); - if(i.ready||"meet"===i.def.kind){ - this.closeLog(); - const t=e.questTurnIn(i.def); - return void this.openHub(t,this.scene.hubNear(t))} - if(BOi.includes(i.def.kind))return this.closeLog(),void this.goQuestPlace(i.def); - this.renderLog()} - ),p.push(o)} - ); - const g=new cRi("닫기",96,40,14); - g.setPrimary(!1),g.position.set(10+a-16-96,u+l-58+8),g.onTap=()=>this.closeLog(); - const m=Jxi("누르면 그 퀘스트 하는 곳으로 가요",Uxi,12); - m.position.set(26,g.y+12),p.push(g,m),n.hitArea=new $i(0,0,o,this.H),n.removeAllListeners("pointertap"),n.on("pointertap",t=>{ - t.stopPropagation(),n.toLocal(t.global).y<u&&this.closeLog()} - ),n.addChild(...p)} - syncVisitors(){ - const t=ixi.getInstance(),i=t.quests(); - this.hereDef?this.scene.setVisitors([]):this.scene.setVisitors(i.reqs.map(s=>({ - key:s.key,npc:s.npc,role:s.role,state:i.done.includes(s.key)?"done":t.questHave(s)>=s.count?"ready":"open"} - )))} - openVisitor(t){ - this.plunder.closePeek(),this.visitorKey=t,this.renderVisitor(),this.visitorPanel.visible=!0,yx.fromTo(this.visitorPanel,{ - alpha:0,y:12} - ,{ - alpha:1,y:0,duration:.18} - )} - closeVisitor(){ - this.visitorKey="",this.visitorPanel.visible=!1} - renderVisitor(){ - const t=ixi.getInstance(),i=t.quests(),s=i.reqs.find(t=>t.key===this.visitorKey),e=this.visitorPanel; - if(e.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),!s)return void this.closeVisitor(); - const n=i.done.includes(s.key),h=t.questHave(s),r=!n&&h>=s.count,o=APi.BLEED_W,a=o-20,c=196,l=this.H-c-8,u=160,d=eRi(a,c,Vxi,null,14); - d.alpha=.94,d.position.set(10,l); - const f=new Xe(NAi.gear().guests[["m","b","e"].indexOf(s.key.slice(-1))]??NAi.gear().guests[0]); - f.width=f.height=164,f.position.set(4,l+c-170); - const p=Jxi(`${ - s.npc} - `,Dxi,18),w=Jxi(s.role,Uxi,13); - p.position.set(u,l+14),w.position.set(p.x+p.width+8,l+18); - const g=Jxi(s.line,Bxi,14,!1); - g.position.set(u,l+42),sRi(g,10+a-14-u); - const m=DTi(s.speciesId),v=!!t.state.dex[s.speciesId],_=new hRi(56); - _.set(s.speciesId,m.star,s.minGrade,!v),_.position.set(u,l+70); - const M=Jxi(`${ - v||s.line.includes(m.name)?m.name:"???"} - ${ - s.minGrade?` (${ - _Ci(s.minGrade)} - 이상)`:""} - `,Bxi,15); - M.position.set(226,l+74),sRi(M,10+a-14-226); - const b=Jxi(`가진 수 ${ - Math.min(h,s.count)} - / ${ - s.count} - `,r?$xi:Uxi,13); - b.position.set(226,l+98); - const y=new Ke,E=pRi("gold",16),A=Jxi(s.gold.toLocaleString(),Dxi,13); - if(A.position.set(20,-1),y.addChild(E,A),s.pearl){ - const t=pRi("pearl",16),i=Jxi(`${ - s.pearl} - `,Wxi,13); - t.x=A.x+A.width+12,i.position.set(t.x+20,-1),y.addChild(t,i)} - y.position.set(226,l+118); - const S=new cRi("닫기",96,40,14); - S.setPrimary(!1),S.position.set(10+a-16-96-8-120,l+c-54),S.onTap=()=>this.closeVisitor(); - const T=new cRi(n?"납품 완료":r?"납품하기":"물고기 부족",120,40,14); - T.enabled=r,T.position.set(10+a-16-120,l+c-54),T.onTap=async()=>{ - const i=await t.deliver(s); - if(i)return void bH.getInstance().showMessage(i); - bH.getInstance().showMessage(`${ - s.npc} - : "고마워요!"`),YG("success"); - const e=APi.getInstance(); - e.flyCurrency("gold",T.toGlobal({ - x:60,y:20} - ),7),s.pearl&&e.flyCurrency("pearl",T.toGlobal({ - x:60,y:20} - ),4),this.syncVisitors(),this.renderVisitor()} - ,e.hitArea=new $i(0,0,o,this.H),e.removeAllListeners("pointertap"),e.on("pointertap",t=>{ - t.stopPropagation(),e.toLocal(t.global).y<l&&this.closeVisitor()} - ),e.addChild(d,f,p,w,g,_,M,b,y,S,T)} - buildFishPanel(){ - const t=this.fishPanel; - t.visible=!1,t.eventMode="static",t.on("pointertap",t=>{ - t.stopPropagation(),this.tip.hide()} - ),this.candTitle.position.set(16,16),this.candCount.y=19,this.candClose.eventMode="static",this.candClose.cursor="pointer",this.candClose.hitArea=new $i(-10,-10,44,44),this.candClose.on("pointertap",t=>{ - t.stopPropagation(),this.toggleFishPanel()} - ),t.addChild(this.panelBg,this.candTitle,this.candCount,this.candClose,this.candMore,this.tip)} - toggleFishPanel(){ - this.fishPanel.visible=!this.fishPanel.visible,this.tip.hide(),this.fishPanel.visible&&(this.render(),yx.fromTo(this.fishPanel,{ - alpha:0} - ,{ - alpha:1,duration:.15} - ))} - onResize(){ - this.layout()} - backLabel(){ - return this.scene.bigMapOpen?"낚시":null} - closeOne(){ - return!(!this.tradeUi.closeOne()&&(this.scene.bigMapOpen?(this.scene.closeBigMap(),0):this.boatMenu.isOpen?(this.boatMenu.close(),0):this.hud.cardOpen?(this.hud.closePops(),0):this.logPanel.visible?(this.closeLog(),0):this.hubPanel.visible?(this.closeHub(),0):this.visitorPanel.visible?(this.closeVisitor(),0):this.fishPanel.visible?(this.toggleFishPanel(),0):this.plunder.panelOpen?(this.plunder.onHide(),0):this.boatUi.panelOpen?(this.boatUi.closeAll(),0):!this.huntUi.panelOpen||(this.huntUi.closeAll(),0)))} - layout(){ - const t=APi.BLEED_W,i=this.H; - this.scene.resize(t,i),this.mapBtn.refresh(),this.mapBtn.place(t-56-10,-1),this.fishBtn.position.set(t-56-10-76-8,10),this.fishPanel.hitArea=new $i(0,0,t,i),this.fxCatch.hitArea=new $i(0,0,t,i),this.candClose.position.set(t-34,12),this.hubPanel.visible&&this.renderHub(!0),this.logPanel.visible&&this.renderLog(),this.visitorPanel.visible&&this.renderVisitor(),this.plunder.layout(),this.tradeUi.layout(),this.boatUi.layout(),this.huntUi.layout(),this.tut.active&&this.tut.layout()} - canImmerse(){ - const t=ixi.getInstance().plunder; - return!this.tut.active&&!this.hud.cardOpen&&this.scene.fishing&&!this.fishPanel.visible&&!this.hubPanel.visible&&!this.logPanel.visible&&!this.visitorPanel.visible&&!this.plunder.panelOpen&&!(null==t?void 0:t.raid)&&!(null==t?void 0:t.raidBy)&&!this.scene.bigMapOpen&&!this.boatUi.panelOpen&&!ixi.getInstance().boatHp().fixing&&!this.huntUi.panelOpen&&!this.huntUi.active&&!this.tradeUi.panelOpen&&!this.boatMenu.isOpen&&!ixi.getInstance().tradeLive} - setImmersion(t){ - const i=XOi(t,APi.getInstance().inTutorial); - for(const s of[this.hud,this.boatUi.chip,this.huntUi.chip,this.netSellBtn,this.journeyBox])s.alpha=i.info; - for(const s of[this.fishBtn,this.mapBtn])s.alpha=i.menu; - this.scene.setHudAlpha(i.menu)} - immersiveTap(){ - var t,i; - return(null==(i=(t=this.scene).onTapBefore)?void 0:i.call(t))??!1} - onShow(){ - const t=ixi.getInstance(); - this.layout(),t.active=!0,t.posProvider=()=>{ - const t=this.scene.boatPos; - return t&&this.tutPreviewing?{ - ...t,s:!0} - :t} - ,APi.getInstance().botSpots=()=>this.scene.sampleWater(200),APi.getInstance().plunderSpots=t=>this.scene.waterAround(t),this.unsub.push(t.onCatch((t,i)=>this.pop(t,i))),this.render(),this.scene.start(),t.look||QNi.skipped?this.intro():QNi.isOpen||QNi.getInstance().open(!0,()=>this.intro())} - intro(){ - APi.getInstance().activePage===this&&this.settleIfAny()} - async settleIfAny(){ - const t=ixi.getInstance(),i=_Ni.getInstance(); - if(!(this.settling||!t.state.away&&!t.state.migratedSold||i.parent||QNi.isOpen||Date.now()<this.awayRetryAt)){ - this.settling=!0; - try{ - const s=await t.awayReport(); - s?i.open(s):(t.state.away||t.state.migratedSold)&&(this.awayRetryAt=Date.now()+3e4)} - finally{ - this.settling=!1} - } - } - drawNetFull(){ - const t=ixi.getInstance().netFull(); - this.netSellBtn.visible=t,t&&!this.netWasFull&&bH.getInstance().showMessage("어망이 가득 찼어요. 어망을 비워야 다시 잡혀요"),this.netWasFull=t} - wantedList(){ - const i=ixi.getInstance(),s=[]; - if(this.tut.active)return[]; - for(const o of i.questHeld())"fish"===o.def.kind&&o.got<o.need&&s.push({ - id:o.def.fish,name:t.npc(i.questTurnIn(o.def)).name,have:o.got,need:o.need} - ); - const e=i.state.contest,n=i.contestStanding(),h=e?kCi(e.day):null; - (null==h?void 0:h.speciesId)&&n&&!n.ended&&s.push({ - id:h.speciesId,name:`대회 · ${ - h.title} - `,have:0,need:0} - ); - const r=i.quests(); - for(const t of r.reqs)r.done.includes(t.key)||s.push({ - id:t.speciesId,name:t.npc,have:i.questHave(t),need:t.count} - ); - return D$i(s)} - async stopAt(t){ - const i=ixi.getInstance(),s=i.state.spot,e=await i.moveTo(s.race,s.zone,t); - !e&&this.tut.active||bH.getInstance().showMessage(e??`${ - GTi(s.race,s.zone,t)} - · 여기서 낚시해요`),this.render()} - hookTap(){ - if(this.tut.active)return!1; - const t=ixi.getInstance(),i=t.plunder; - return!(!this.scene.fishing||this.fishPanel.visible||this.hubPanel.visible||this.logPanel.visible||this.visitorPanel.visible||this.plunder.panelOpen||(null==i?void 0:i.raid)||(null==i?void 0:i.raidBy)||this.hud.cardOpen||this.scene.bigMapOpen||this.boatUi.panelOpen||this.huntUi.panelOpen||this.tradeUi.panelOpen||this.boatMenu.isOpen||!t.hookable()||(this.tryHook(),0))} - async tryHook(){ - const t=await ixi.getInstance().hook(); - t.message&&bH.getInstance().showMessage(t.message)} - onHide(){ - wFi.dismiss(!0),this.coach.stop(),this.tut.active&&(this.tut.stop(),APi.getInstance().setTutorialMode(!1)),this.scene.stop(),this.tip.hide(),this.fishPanel.visible=!1,this.closeVisitor(),this.depthOnClose=!1,this.closeHub(),this.closeLog(),this.plunder.onHide(),this.tradeUi.onHide(),this.boatMenu.close(),this.boatUi.closeAll(),this.huntUi.closeAll(),ixi.getInstance().active=!1; - for(const t of this.unsub)t(); - this.unsub=[]} - update(){ - this.settleIfAny(),this.render()} - async cycleDepth(){ - const t=ixi.getInstance(),i=t.state,s=wTi.indexOf(i.spot.depth); - for(let e=1; - e<wTi.length; - e++){ - const n=wTi[(s+e)%wTi.length]; - if(oCi(i.gear,{ - ...i.spot,depth:n} - ))continue; - const h=await t.setDepth(n); - return h&&bH.getInstance().showMessage(h),void this.render()} - bH.getInstance().showMessage("다른 깊이는 도구가 더 필요해요")} - static shown(t){ - if(!(null==t?void 0:t.parent))return!1; - for(let i=t; - i; - i=i.parent)if(!i.visible)return!1; - return!0} - static anchorOf(i,s){ - return()=>{ - if(!t.shown(i))return null; - const e=i.getLocalBounds(); - return i.toGlobal({ - x:e.x+e.width/2,y:s?e.y+e.height+2:e.y-2} - )} - } - previewTip(i){ - const s=t.anchorOf,e=Qt(i=>i&&t.shown(i)?i:this.netChip,"or"),n={ - bite:[t.BITE_TIP,()=>this.toGlobal({ - x:this.scene.floatX,y:this.scene.floatY-62} - ),!1],sail:[t.SAIL_TIP,s(this.scene.boatSprite,!1),!1],rod:[t.ROD_TIP,s(this.scene.rodBalloonView.visible?this.scene.rodBalloonView:this.scene.boatSprite,!1),!1],net:["잡은 물고기는 어망에 담겨요",s(this.netChip,!0),!0],sell:["누르면 어망으로 가요",s(e(this.netSellBtn),!0),!0],next:["누르면 할 일로 바로 가요",s(e(this.journeyBox),!0),!0],move:["이동을 누르고 갈 물을 눌러요",s(e(this.scene.modeBtn),!1),!1],depth:["누르면 물 깊이가 바뀌어요",s(this.depthBtn,!0),!0],card:[t.CARD_TIP,s(e(this.hud.stripCell()??void 0),!0),!0]} - ,[h,r,o]=n[i]; - this.coach.show(i,h,r,o,APi.BLEED_W)} - dismissTip(){ - this.coach.dismiss()} - tutorialDue(){ - const i=ixi.getInstance(),s=i.state; - if(!s||!i.look||t.previewing||this.tutPreviewing)return!1; - const e=i.startRace(),n=i.qlog(); - return"R"===s.spot.zone&&s.spot.race===e&&rIi({ - tutSeen:i.tipSeen("tut"),look:!0,dex:i.dexCount(),journeyStep:n.done.length,accepted:n.held.length>0} - )} - tutorialCheck(){ - if(this.tut.active||!this.tutorialDue())return; - const t=ixi.getInstance(),i=t.state; - APi.getInstance().activePage!==this||QNi.isOpen||_Ni.getInstance().parent||this.scene.mapKey===`${ - i.spot.race} - |${ - i.spot.zone} - `&&this.scene.boatPos&&this.startTutorial(t.startRace())} - startTutorial(t){ - this.tutRace=t,this.closeHub(),this.closeVisitor(),this.fishPanel.visible=!1,this.tip.hide(),this.coach.dismiss(),this.plunder.closePeek(),APi.getInstance().setTutorialMode(!0),this.layout(),this.tut.start(t)} - endTutorial(t){ - var i; - APi.getInstance().setTutorialMode(!1),this.layout(),this.greeted=!0,this.quietAfterTut=!0,this.tutPreviewing&&(this.tutPreviewing=!1,this.tutBackend=this.realTutBackend,null==(i=this.onTutorialPreviewEnd)||i.call(this)),this.syncJourney(),this.scene.sailToHub(t)||this.openHub(t,this.scene.hubNear(t))} - previewTutorial(t){ - this.tut.active&&(this.tut.stop(),APi.getInstance().setTutorialMode(!1)); - let i=-1,s=!1; - const e=Qt(()=>performance.now(),"now"),n=Qt(()=>i+4e3/k$i.speed,"at"),h=DAi/k$i.speed,r=Qt((t=0)=>i>=0&&!s&&e()>=n()&&e()<n()+h+t,"open"); - this.tutPreviewing=!0,this.tutBackend={ - biteOpen:Qt(()=>r(),"biteOpen"),hookable:Qt(()=>r(2e3),"hookable"),biteIn:Qt(()=>i>=0&&!s?n()-e():1/0,"biteIn"),hook:Qt(async()=>{ - s=!0; - const t=ixi.getInstance(),i=t.state,e=yCi({ - ...i.spot,point:this.scene.pointNow} - ,t.now(),i.gear,null)??yCi(i.spot,t.now(),i.gear,null); - return e&&this.pop({ - ...e,broken:!1,manual:!0} - ,!0),e?null:"물고기가 없어요"} - ,"hook"),recast:Qt(()=>{ - i=e(),s=!1} - ,"recast"),onCast:Qt(()=>{ - i=e(),s=!1} - ,"onCast"),finish:Qt(()=>{ - } - ,"finish")} - ,this.startTutorial(t)} - showAutoTag(t=0){ - const i=this.scene.boatPos,s=this.scene.world; - if(!i||!s)return; - yx.killTweensOf(this.autoTag),this.autoTag.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const e=dRi("자동으로 잡았어요",16106577,Vxi,12,9); - this.autoTag.addChild(e),this.autoTag.position.set(s.x+i.x-e.width/2,s.y+i.y-64-e.height-6),this.autoTag.alpha=0,yx.timeline({ - delay:t} - ).to(this.autoTag,{ - alpha:1,y:this.autoTag.y-6,duration:.15} - ).to(this.autoTag,{ - alpha:0,duration:.2,delay:1.05} - )} - coachCheck(){ - var i; - const s=ixi.getInstance(),e=s.state,n=this.coach; - if(t.previewing||this.tut.active||this.tutPreviewing||this.quietAfterTut)return; - if(n.visible)return void("bite"!==n.id||this.bite.visible||n.dismiss()); - if(QNi.isOpen||!s.look&&!QNi.skipped)return; - if(this.tutorialDue())return; - if(this.scene.mapKey!==`${ - e.spot.race} - |${ - e.spot.zone} - `)return; - if(_Ni.getInstance().parent||this.hubPanel.visible||this.logPanel.visible||this.visitorPanel.visible||this.fishPanel.visible)return; - if(wFi.pending||this.fxCatch.visible||this.plunder.panelOpen||this.boatUi.panelOpen||this.huntUi.panelOpen||this.tradeUi.panelOpen||this.boatMenu.isOpen||this.scene.bigMapOpen)return; - const h=APi.BLEED_W,r=Qt((i,e,r,o)=>{ - n.show(i,e,t.anchorOf(r,o),o,h),s.markTip(i)} - ,"show"),o=s.qlog(),a=s.questHeld().some(t=>"meet"===t.def.kind); - if(!s.tipSeen("bite")&&this.bite.visible&&((null==(i=s.biteOpen())?void 0:i.left)??0)>=t.BITE_TIP_MIN_LEFT)r("bite",t.BITE_TIP,this.bite,!1); - else if(!s.tipSeen("sail")&&this.scene.idleInSail)n.show("sail",t.SAIL_TIP,this.sailTipAnchor,!1,h),s.markTip("sail"); - else if(!s.tipSeen("rod")&&this.scene.rodShown)r("rod",t.ROD_TIP,this.scene.rodBalloonView,!1); - else if(!s.tipSeen("net")&&Object.keys(e.dex).length>0&&t.shown(this.netChip))r("net","잡은 물고기는 어망에 담겨요",this.netChip,!0); - else if(!s.tipSeen("sell")&&t.shown(this.netSellBtn)&&s.netCount()>=s.netCap/2)r("sell","누르면 어망으로 가요",this.netSellBtn,!0); - else if(!s.tipSeen("next")&&o.done.length>=1&&t.shown(this.journeyBox))r("next","누르면 할 일로 바로 가요",this.journeyBox,!0); - else if(!s.tipSeen("move")&&a){ - const i=this.scene.modeBtn; - t.shown(i)&&r("move","이동을 누르고 갈 물을 눌러요",i,!1)} - else!s.tipSeen("card")&&s.questHeld().some(t=>"fish"===t.def.kind&&!t.ready)&&t.shown(this.hud.stripCell()??void 0)&&r("card",t.CARD_TIP,this.hud.stripCell(),!0)} - render(){ - var t; - this.tutorialCheck(),this.coachCheck(); - const i=ixi.getInstance(),s=i.state,e=s.spot,n=i.now(); - this.scene.rodHold=this.tut.active?this.tut.rodHold:!i.tipSeen("sail")||this.coach.visible&&"sail"===this.coach.id; - const h=UTi(n),r=oCi(s.gear,e)??i.boatProblem(),o=this.tut.active?this.tutBackend:null,a=r?null:o?o.biteOpen()?{ - } - :null:i.biteOpen(),c=r?1/0:o?o.biteIn():i.biteIn(),l=this.tutPreviewing?{ - ...e,point:this.scene.pointNow} - :e; - this.scene.update(l,h,performance.now()-this.t0,!!a&&!this.scene.sailing,c,s.gear),i.othersAt!==this.othersAt&&(this.othersAt=i.othersAt,this.scene.setOthers(i.others)); - const u=(null==(t=i.crowd)?void 0:t[e.point])??KTi(e.race,e.zone,e.point,n); - this.hud.update({ - now:n,spot:e,problem:r,crowd:u,net:i.netCount(),netCap:i.netCap,wanted:this.progressHeld?this.lastWanted:this.lastWanted=this.wantedList()} - ),this.drawNetFull(); - let d=this.hud.bandRight+6; - for(const w of[this.boatUi.chip,this.huntUi.chip,this.netSellBtn])w.position.set(d,this.hud.bandY),w.visible&&(d+=w.width+6); - this.biteMark.texture===ls.EMPTY&&(this.biteMark.texture=NAi.gear().bubbles[0]),this.bite.position.set(this.scene.floatX,this.scene.floatY-30); - const f=!!a&&!this.scene.sailing; - f&&!this.bite.visible&&yx.fromTo(this.bite.scale,{ - x:.3,y:.3} - ,{ - x:1,y:1,duration:.22,ease:"back.out(4)"} - ),this.bite.visible=f,this.fishPanel.visible&&this.renderFishPanel(); - const p=`${ - e.race} - |${ - e.zone} - `; - p!==this.visitorSpot&&(this.visitorSpot=p,this.closeVisitor(),this.closeHub()),this.syncVisitors(),this.syncJourney(),this.plunder.update(),this.boatUi.update(),this.huntUi.update(),this.tradeUi.update(),this.scene.speedBonus=i.gearStats().speed,this.scene.modeBtnHidden=this.hubPanel.visible||this.logPanel.visible||this.visitorPanel.visible} - renderFishPanel(){ - const t=ixi.getInstance(),i=t.state,s=t.now(),e=t.gearStats(),n=pCi(i.spot,s,i.gear,i.bait,e.star+e.luck).sort((t,i)=>i.w-t.w); - this.candPool=n; - const h=n.reduce((t,i)=>t+i.w,0)||1; - this.candCount.text=`발견 ${ - n.filter(t=>i.dex[t.s.id]).length} - /${ - n.length} - `,this.candCount.x=this.candTitle.x+this.candTitle.width+10; - const r=APi.BLEED_W; - for(; - this.candCards.length<n.length; - ){ - const t=this.candCards.length,i=new hRi(V$i,!0); - i.eventMode="static",i.cursor="pointer",i.hitArea=new $i(0,0,V$i,V$i),i.on("pointertap",i=>{ - i.stopPropagation(),this.toggleTip(t)} - ); - const s=new Ke; - this.fishPanel.addChildAt(i,this.fishPanel.getChildIndex(this.tip)),this.fishPanel.addChildAt(s,this.fishPanel.getChildIndex(this.tip)),this.candCards.push(i),this.candBadges.push(s)} - const o=Math.min(7,Math.max(1,n.length)),a=o>1?Math.min(12,(r-32-o*V$i)/(o-1)):0; - this.candCards.forEach((t,s)=>{ - const e=n[s],h=this.candBadges[s]; - if(t.visible=h.visible=!!e,!e)return; - t.set(e.s.id,e.s.star,0,!i.dex[e.s.id]),t.position.set(16+s%o*(V$i+a),56+82*Math.floor(s/o)); - const r=zTi(e.s); - h.label!==r&&(h.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),h.label=r,r&&h.addChild(dRi(r,16777215,zxi[e.s.tier],10,5))),h.position.set(t.x+(V$i-h.width)/2,t.y-8)} - ); - const c=Math.ceil(n.length/o); - this.candMore.position.set(16,56+82*c+4); - const l=n.filter(t=>t.s.star>=3).reduce((t,i)=>t+i.w/h*100,0); - this.candMore.text=n.length?(l>0?`희귀 어종 출현 확률 ${ - l.toFixed(1)} - %`:"다른 물때와 깊이에서 희귀 어종을 찾아보세요.")+" · 카드를 누르면 정보가 보여요":"이 물때에는 만날 수 있는 물고기가 없어요.",sRi(this.candMore,r-32); - const u=this.candMore.y+this.candMore.height+16; - this.panelBg.clear().rect(0,0,r,this.H).fill({ - color:526346,alpha:.5} - ).roundRect(0,0,r,u,12).fill({ - color:Vxi,alpha:.95} - )} - toggleTip(t){ - const i=this.candPool[t],s=this.candCards[t]; - if(!i||!s)return; - if(this.tip.visible&&this.tip.forId===i.s.id)return void this.tip.hide(); - const e=ixi.getInstance().state,n=e.dex[i.s.id],h=i.s,r=this.candPool.reduce((t,i)=>t+i.w,0)||1,o=zTi(h),a=rCi(h,e.spot),c=a>eCi(e.gear); - this.tip.show(h.id,[`${ - n?h.name:"???"} - ★${ - h.tier} - ${ - o?` · ${ - o} - `:""} - `,`${ - "O"===h.zone&&"B"===h.depth?"심해":mTi[h.depth]} - · ${ - "전체"===h.tide?"모든 물때":`${ - h.tide} - 물때`} - · 힘 ${ - a} - ${ - c?" (줄이 약해요)":""} - `,`지금 확률 ${ - (i.w/r*100).toFixed(1)} - % · ${ - h.kind} - `,n?`잡은 수 ${ - n.count} - · 최고 ${ - TCi(n.bestKg)} - `:"아직 못 잡았어요"],[Bxi,c?Hxi:Uxi,Uxi,n?Dxi:Fxi],s.x+34,s.y+V$i,!1)} - pop(t,i){ - const s=this.scene.playCatch(t,i,ixi.getInstance().state.gear); - if(this.progressHoldUntil=Math.max(this.progressHoldUntil,performance.now()+1e3*s),yx.delayedCall(s+.02,()=>{ - this.parent&&!this.progressHeld&&(this.renderTracker(),this.render())} - ),this.tut.onCatch(t,i,s),t.broken)return; - if(t.manual||this.showAutoTag(s),wFi.release(),i)return void wFi.show(this.popLayer,{ - tex:NAi.fish(t.id),name:DTi(t.id).name,star:NTi(t.id),grade:t.grade??0,kg:t.kg,dex:ixi.getInstance().dexCount()} - ,APi.BLEED_W/2,Math.max(150,Math.min(300,.3*this.H)),s+.05,()=>{ - QG.getInstance().playSFX(QG.SFX_TRUMPET,.6),YG("success"),this.fxCatch.visible=!0} - ,{ - onEnd:Qt(()=>{ - wFi.active||(this.fxCatch.visible=!1)} - ,"onEnd")} - ); - if(t.star<4)return; - const e=new hRi(84); - e.set(t.id,t.star,t.grade??0,!1); - const n=Jxi(`${ - DTi(t.id).name} - ${ - TCi(t.kg)} - `,Dxi,16),h=new Ke; - h.eventMode="none",h.addChild(e,n),sRi(n,300),n.position.set((84-n.width)/2,88),h.pivot.set(42,42),h.position.set(APi.BLEED_W/2,130),h.alpha=0,this.popLayer.addChild(h),yx.timeline({ - delay:s+.1,onComplete:Qt(()=>{ - h.destroy({ - children:!0} - )} - ,"onComplete")} - ).set(h,{ - alpha:1} - ).fromTo(h.scale,{ - x:.3,y:.3} - ,{ - x:1,y:1,duration:.28,ease:"back.out(2)"} - ,0).to(h,{ - alpha:0,y:118,duration:.4} - ,2.1)} - } - ; - Qt(z$i,"FishingMainPage"),Zt(z$i,"instance"),Zt(z$i,"previewing",!1),Zt(z$i,"BITE_TIP","지금! 눌러요"),Zt(z$i,"SAIL_TIP","물을 누르면 배가 그곳으로 가요"),Zt(z$i,"CARD_TIP","물고기를 누르면 사는 곳·깊이·시간대가 나와요"),Zt(z$i,"ROD_TIP","낚싯대를 누르면 낚시를 시작해요"),Zt(z$i,"BITE_TIP_MIN_LEFT",900); - let Y$i=z$i; - const q$i=Object.freeze(Object.defineProperty({ - __proto__:null,FishingMainPage:Y$i} - ,Symbol.toStringTag,{ - value:"Module"} - )),X$i=APi.CONTENT_W,J$i=(X$i-16)/3,Q$i=class extends Ke{ - constructor(){ - super(),Zt(this,"bg",new ep),Zt(this,"nameText",Jxi("",Bxi,15)),Zt(this,"sub",Jxi("",Uxi,12,!1)),Zt(this,"crowd",new Ke),Zt(this,"crowdText",Jxi("",Uxi,11)),Zt(this,"bar",new ep),Zt(this,"fish",new hRi(42)),Zt(this,"badge",new Ke),Zt(this,"onTap",null),this.bg.eventMode="none",this.bar.eventMode="none"; - const t=mRi("people",14,Fxi); - this.crowd.addChild(t,this.crowdText),this.crowdText.position.set(17,-1),this.addChild(this.bg,this.bar,this.nameText,this.sub,this.crowd,this.fish,this.badge),this.nameText.position.set(10,9),this.sub.position.set(10,33),this.crowd.position.set(10,60),this.fish.position.set(J$i-42-8,24),this.eventMode="static",this.cursor="pointer",this.hitArea=new $i(0,0,J$i,84),this.on("pointertap",t=>{ - var i; - t.stopPropagation(),null==(i=this.onTap)||i.call(this)} - )} - set(t){ - var i; - this.bg.clear().roundRect(.5,.5,J$i-1,83,10).fill(t.unknown?Vxi:t.current?xxi:Ixi).stroke({ - color:t.current?Dxi:Lxi,width:t.current?2:1} - ),this.nameText.textColor=t.unknown?Fxi:Bxi,this.crowd.visible=!t.unknown; - const s=t.fish?J$i-42-24:J$i-20; - this.nameText.text=t.name,sRi(this.nameText,t.unknown?J$i-20:s),this.sub.text=t.sub,sRi(this.sub,t.unknown?J$i-20:s),this.crowdText.text=`${ - t.crowd} - 명`,this.bar.clear(),t.unknown||fRi(this.bar,58,66,s-50,5,t.live?t.known/t.live:0,t.known>=t.live?$xi:6012341),this.fish.visible=!!t.fish,this.badge.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),t.current?this.badge.addChild(dRi("낚시 중",Gxi,Dxi,10,6)):(null==(i=t.fish)?void 0:i.tag)&&this.badge.addChild(dRi(t.fish.tag,16777215,zxi[NTi(t.fish.id)],10,5)),this.badge.position.set(J$i-this.badge.width-6,5),t.fish&&this.fish.set(t.fish.id,t.fish.star,0,!t.fish.known)} - } - ; - Qt(Q$i,"PointCard"); - let Z$i=Q$i; - const tHi={ - "인간":"인간 왕국","엘프":"엘프 숲","언데드":"언데드 늪","오크":"오크 설원"} - ,iHi=420,sHi=96,eHi=class t extends Ke{ - constructor(){ - super(),Zt(this,"tabId","fish"),Zt(this,"onBack",null),Zt(this,"race","인간"),Zt(this,"zone","R"),Zt(this,"view","world"),Zt(this,"back",new cRi("‹ 낚시로",110,38,14)),Zt(this,"titleText",Jxi("해도",Bxi,20)),Zt(this,"worldView",new Ke),Zt(this,"worldImg",new Xe(ls.EMPTY)),Zt(this,"worldPins",new Ke),Zt(this,"worldHint",Jxi("",Uxi,13,!1)),Zt(this,"regionView",new Ke),Zt(this,"regionImg",new Xe(ls.EMPTY)),Zt(this,"regionFog",new Xe(ls.EMPTY)),Zt(this,"regionTerr",new Xe(ls.EMPTY)),Zt(this,"terrCanvas",document.createElement("canvas")),Zt(this,"terrTex",null),Zt(this,"regionMarks",new Ke),Zt(this,"regionTitle",Jxi("",Bxi,17)),Zt(this,"regionDex",Jxi("",Uxi,12)),Zt(this,"regionGate",Jxi("",Uxi,12)),Zt(this,"cards",[]),Zt(this,"foot",Jxi("수역은 스팟 둘레의 넓은 물이에요. 배로 새 수역에 들어가면 지도에 드러나요. 회유어는 날마다 UTC 0시에 몇몇 수역 중 한 곳으로 옮겨요.",Fxi,12,!1)),Zt(this,"pulse",0),this.back.setPrimary(!1),this.back.onTap=()=>{ - var t; - "region"===this.view?this.showWorld():null==(t=this.onBack)||t.call(this)} - ,this.titleText.position.set(126,6),this.addChild(this.back,this.titleText); - const t=Math.round(.75*X$i); - this.worldImg.position.set(0,50),this.worldImg.eventMode="none"; - const i=(new ep).roundRect(0,50,X$i,t,14).fill(16777215); - this.worldImg.mask=i,this.worldPins.position.set(0,50),this.worldHint.position.set(4,50+t+12),this.worldHint.setWrapWidth(X$i-8),this.worldView.addChild(this.worldImg,i,this.worldPins,this.worldHint),this.regionTitle.position.set(4,52),this.regionDex.y=56,this.regionGate.y=56; - const s=(X$i-iHi)/2; - this.regionImg.position.set(s,sHi),this.regionImg.width=this.regionImg.height=iHi,this.regionImg.eventMode="none"; - const e=(new ep).roundRect(s,sHi,iHi,iHi,14).fill(16777215); - this.regionImg.mask=e,this.regionFog.position.set(s,sHi),this.regionFog.eventMode="none",this.regionTerr.position.set(s,sHi),this.regionTerr.eventMode="none"; - const n=(new ep).roundRect(s,sHi,iHi,iHi,14).fill(16777215); - this.regionTerr.mask=n; - const h=(new ep).roundRect(s,sHi,iHi,iHi,14).fill(16777215); - this.regionFog.mask=h,this.regionMarks.position.set(s,sHi),this.regionView.addChild(this.regionTitle,this.regionDex,this.regionGate,this.regionImg,e,this.regionFog,h,this.regionTerr,n,this.regionMarks); - for(let r=0; - r<9; - r++){ - const t=new Z$i; - t.position.set(r%3*(J$i+8),530+92*Math.floor(r/3)),t.onTap=()=>{ - this.tapPoint(this.zone,r,t)} - ,this.regionView.addChild(t),this.cards.push(t)} - this.foot.setWrapWidth(X$i-8),this.foot.position.set(4,812),this.regionView.addChild(this.foot)} - static getInstance(){ - return this.instance??(this.instance=new t)} - closeOne(){ - var t; - return"region"===this.view?this.showWorld():null==(t=this.onBack)||t.call(this),!0} - onShow(){ - const t=ixi.getInstance().state; - this.race=t.spot.race,this.zone=t.spot.zone,this.showWorld()} - onHide(){ - } - update(){ - if("world"!==this.view)return; - this.pulse+=.25; - const t=this.worldPins.getChildByLabel("here"); - t&&(t.scale.set(1+.12*Math.sin(this.pulse)),t.alpha=.75+.25*Math.sin(this.pulse))} - showWorld(){ - this.view="world",this.titleText.text="해도",this.back.setText("‹ 낚시로"),this.removeChild(this.regionView),this.addChild(this.worldView),NAi.worldMap().then(t=>{ - this.worldImg.texture=t,this.worldImg.width=X$i,this.worldImg.height=Math.round(.75*X$i)} - ),this.renderWorld(),APi.getInstance().resetScroll()} - renderWorld(){ - const t=ixi.getInstance().state,i=NAi.world(),s=Math.round(.75*X$i); - this.worldPins.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - for(const n of fTi){ - const[t,e]=i.labels[n]??[.5,.5],h=dRi(tHi[n],16777215,Xxi[n],12,8); - h.alpha=.92,h.position.set(t*X$i-h.width/2,e*s-h.height/2),h.eventMode="none",this.worldPins.addChild(h)} - for(const n of fTi)for(const e of pTi){ - const h=`${ - n} - |${ - e} - `,r=i.pins[h]; - if(!r)continue; - const o=t.spot.race===n&&t.spot.zone===e,a=new Ke; - if(a.position.set(r[0]*X$i,r[1]*s),o){ - const t=(new ep).circle(0,0,17).stroke({ - color:Dxi,width:3} - ); - t.label="here",t.position.set(r[0]*X$i,r[1]*s),t.eventMode="none",this.worldPins.addChild(t)} - const c=(new ep).circle(0,0,11).fill(Xxi[n]).circle(0,0,11).stroke({ - color:16777215,width:2.5} - ),l=Jxi(gTi[e][0],16777215,11); - l.position.set(-l.width/2,-l.height/2-1); - const u=dRi(MTi[h],16777215,o?8018448:Vxi,11,6); - u.alpha=.9,u.position.set(-u.width/2,14),a.addChild(c,l,u),a.eventMode="static",a.cursor="pointer",a.hitArea=new $i(-Math.max(28,u.width/2),-24,Math.max(56,u.width),58),a.on("pointertap",t=>{ - t.stopPropagation(),this.showRegion(n,e)} - ),this.worldPins.addChild(a)} - const e=`${ - tHi[t.spot.race]} - · ${ - gTi[t.spot.zone]} - · ${ - GTi(t.spot.race,t.spot.zone,t.spot.point)} - `; - this.worldHint.text=`지역을 누르면 그 지역의 낚시터를 골라요 · 지금: ${ - e} - `} - showRegion(t,i){ - this.view="region",this.race=t,this.zone=i,this.titleText.text=tHi[t],this.back.setText("‹ 전체 지도"),this.removeChild(this.worldView),this.addChild(this.regionView),this.regionImg.texture=dFi.regionMap(`${ - t} - |${ - i} - `),this.regionImg.width=this.regionImg.height=iHi; - const s=this.regionFog.texture,e=dFi.regionFog(`${ - t} - |${ - i} - `); - this.regionFog.texture=e??ls.EMPTY,this.regionFog.visible=!!e,e&&(this.regionFog.width=this.regionFog.height=iHi),s!==ls.EMPTY&&s.destroy(!0),this.render(),APi.getInstance().resetScroll(),yx.fromTo(this.regionView,{ - alpha:0} - ,{ - alpha:1,duration:.18} - )} - async tapPoint(t,i,s){ - var e; - const n=ixi.getInstance(); - if(!this.pointKnown(t,i))return bH.getInstance().showMessage("아직 못 찾은 곳이에요 · 배를 몰아 찾아가 보세요"),void yx.fromTo(s,{ - x:s.x-6} - ,{ - x:s.x,duration:.3,ease:"elastic.out(1.2, 0.3)"} - ); - const h=await n.moveTo(this.race,t,i); - if(h)return bH.getInstance().showMessage(h),void yx.fromTo(s,{ - x:s.x-6} - ,{ - x:s.x,duration:.3,ease:"elastic.out(1.2, 0.3)"} - ); - QG.getInstance().playSFX(QG.SFX_POPUP),jPi.active||bH.getInstance().showMessage(`${ - GTi(this.race,t,i)} - (으)로 옮겼어요`),null==(e=this.onBack)||e.call(this)} - pointKnown(t,i){ - const s=ixi.getInstance().state.spot,e=s.race===this.race&&s.zone===t?s.point:-1; - return tOi.pointKnown(`${ - this.race} - |${ - t} - `,i,e)} - render(){ - var t; - const i=ixi.getInstance(),s=i.state,e=i.now(),n=HTi(e),h=this.zone; - this.regionTitle.text=`${ - gTi[h]} - · ${ - MTi[`${ - this.race} - |${ - h} - `]} - `; - const r=RTi.filter(t=>t.race===this.race&&t.zone===h); - this.regionDex.text=`도감 ${ - r.filter(t=>s.dex[t.id]).length} - /${ - r.length} - `,this.regionDex.x=this.regionTitle.width+14; - const o=oCi(s.gear,{ - race:this.race,zone:h,depth:"M"} - ),a=s.gear.boat<DSi.ENTRY[h]; - this.regionGate.text=o?`잠김 · ${ - o} - `:`${ - dTi(this.race,h)} - ${ - "O"===h?" · 바닥은 ★4 찌":""} - `,this.regionGate.textColor=o||a?Hxi:s.gear.boat<FSi[$Si(this.race,h)-1]?16757611:Uxi,this.regionGate.position.x=X$i-this.regionGate.width-4; - const c=`${ - this.race} - |${ - h} - `,l=NAi.topdownInfo(c),u=iHi/Math.max(l.w,l.h),d=s.spot.race===this.race&&s.spot.zone===h?s.spot.point:-1,f=eDi.get(c); - this.regionTerr.visible=!!f,f&&(eDi.paint(this.terrCanvas,f,t=>this.pointKnown(h,t),d,Dxi),this.terrTex&&this.terrTex.width===this.terrCanvas.width&&this.terrTex.height===this.terrCanvas.height?this.terrTex.source.update():(null==(t=this.terrTex)||t.destroy(!0),this.terrTex=ls.from(this.terrCanvas),this.terrTex.source.scaleMode="linear"),this.regionTerr.texture=this.terrTex,this.regionTerr.width=f.cols*f.tile*u,this.regionTerr.height=f.rows*f.tile*u),this.regionMarks.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),l.points.forEach((t,i)=>{ - if(!this.pointKnown(h,i))return; - const e=s.spot.race===this.race&&s.spot.zone===h&&s.spot.point===i,n=new Ke; - n.position.set(t.x*u,t.y*u); - const r=e?Dxi:16777215; - n.addChild((new ep).circle(0,0,6).fill(r).circle(0,0,6).stroke({ - color:Vxi,width:2} - )); - const o=dRi(GTi(this.race,h,i),e?Gxi:16777215,e?Dxi:Vxi,10,5); - o.alpha=.9,o.position.set(-o.width/2,-28),n.addChild(o),n.eventMode="static",n.cursor="pointer",n.hitArea=new $i(-Math.max(24,o.width/2),-38,Math.max(48,o.width),52),n.on("pointertap",t=>{ - t.stopPropagation(),this.tapPoint(h,i,this.cards[i])} - ),this.regionMarks.addChild(n)} - ); - const p=ixi.getInstance().areaRows(this.race,h); - for(let w=0; - w<this.cards.length; - w++){ - const t=fCi(this.race,h,w,n),i=p[w],r=t.filter(t=>t.zone===h&&!t.roam&&t.star>=2).sort((t,i)=>i.star-t.star||t.pts.length-i.pts.length)[0],a=s.spot.race===this.race&&s.spot.zone===h&&s.spot.point===w,c=t.filter(t=>s.dex[t.id]).length; - this.cards[w].alpha=o?.5:1; - const l=this.pointKnown(h,w); - this.cards[w].set(l?{ - name:GTi(this.race,h,w),sub:`난이도 ${ - hCi({ - zone:h,point:w} - )} - · 수역 도감 ${ - i.have} - /${ - i.need} - ${ - i.claimed?" · ✓ 클리어":i.ready?" · 진주 받기":""} - `,crowd:KTi(this.race,h,w,e),known:c,live:t.length,current:a,fish:r?{ - id:r.id,star:r.star,known:!!s.dex[r.id],tag:r.star>=3?"명물":""} - :null} - :{ - name:`${ - w+1} - 번 · 아직 못 찾은 곳`,sub:"배로 찾아가면 드러나요",crowd:0,known:0,live:0,current:!1,unknown:!0,fish:null} - )} - } - } - ; - Qt(eHi,"FishingMapPage"),Zt(eHi,"instance"); - let nHi=eHi; - const hHi=[{ - main:10119740,dark:6176032,light:13803626,gem:8378016} - ,{ - main:11565626,dark:7030048,light:15250538,gem:6014660} - ,{ - main:11122367,dark:6056821,light:15331829,gem:9422847} - ,{ - main:14723118,dark:9067792,light:16769162,gem:16739211} - ,{ - main:5222030,dark:2252876,light:11858136,gem:16106577} - ]; - function rHi(t,i,s){ - const e=hHi[s%5],n={ - color:e.dark,width:3} - ; - switch(i){ - case"prow":if(t.moveTo(40,112).quadraticCurveTo(30,70,58,46).lineTo(74,56).quadraticCurveTo(56,78,62,112).closePath().fill(e.main).stroke(n),t.circle(72,40,22).fill(e.main).stroke(n),t.circle(80,36,4).fill(e.dark),0===s)for(let i=0; - i<5; - i++)t.circle(54+3*i,26+6*i,7).fill(e.light); - 1===s&&t.poly([86,52,106,48,92,62]).fill(e.light).stroke(n),2===s&&t.poly([66,18,60,2,74,16]).fill(e.light).poly([80,20,84,4,88,22]).fill(e.light),3===s&&t.poly([92,40,110,44,92,48]).fill(e.light).stroke(n),4===s&&t.ellipse(72,22,14,6).fill(e.light),t.circle(48,92,5).fill(e.gem); - break; - case"harpoon":if(t.moveTo(26,104).lineTo(92,38).stroke({ - color:e.dark,width:9,cap:"round"} - ).moveTo(26,104).lineTo(92,38).stroke({ - color:e.main,width:5,cap:"round"} - ),t.poly([92,38,112,16,100,46]).fill(e.light).stroke(n),0!==s&&3!==s||t.poly([98,30,88,24,94,36]).fill(e.light).stroke(n),1===s&&t.circle(56,74,12).fill(e.main).stroke(n),2===s)for(let i=0; - i<3; - i++)t.circle(70+6*i,58-6*i,4).fill(16747130); - 4===s&&t.ellipse(44,86,10,6).fill(e.light).stroke(n),t.circle(30,100,7).stroke({ - color:13148266,width:3} - ),t.circle(64,66,3).fill(e.gem); - break; - case"deck":for(let i=0; - i<4; - i++){ - const s=22+22*i; - t.roundRect(16,s,96,19,4).fill(i%2?e.main:e.light).stroke({ - color:e.dark,width:2} - ),t.circle(26,s+9.5,2.5).fill(e.dark).circle(102,s+9.5,2.5).fill(e.dark)} - 1===s&&t.rect(16,50,96,6).fill({ - color:6056821,alpha:.8} - ),2===s&&t.ellipse(64,64,30,10).fill({ - color:16052192,alpha:.7} - ),3===s&&t.rect(60,22,8,85).fill({ - color:e.dark,alpha:.6} - ),4===s&&t.circle(96,30,7).fill(e.gem).circle(36,96,5).fill(e.gem); - break; - case"sail":if(t.rect(30,10,6,108).fill(e.dark),t.moveTo(38,14).quadraticCurveTo(100,40,108,100).lineTo(38,100).closePath().fill(e.light).stroke({ - color:e.dark,width:3} - ),t.moveTo(38,56).quadraticCurveTo(80,64,100,80).stroke({ - color:e.main,width:4} - ),0===s&&t.circle(66,72,6).fill(e.main),1===s&&t.moveTo(38,36).quadraticCurveTo(70,44,90,56).stroke({ - color:e.gem,width:3} - ),2===s&&t.poly([62,60,76,70,66,74,80,88,60,74,70,70]).fill(e.main),3===s)for(let i=0; - i<3; - i++)t.poly(oHi(58+14*i,80-8*i,5)).fill(e.gem); - 4===s&&t.rect(38,86,70,6).fill(e.main),t.poly([30,8,44,4,36,14]).fill(12866111); - break; - case"lantern":{ - const i=[16763210,9431295,10485642,12035839,16752730][s%5]; - t.circle(64,66,40).fill({ - color:i,alpha:.18} - ),t.moveTo(64,6).lineTo(64,20).stroke({ - color:e.dark,width:4} - ).circle(64,10,6).stroke({ - color:e.dark,width:3} - ),t.roundRect(42,20,44,10,3).fill(e.main).stroke(n),t.roundRect(44,30,40,58,8).fill({ - color:16055290,alpha:.55} - ).stroke({ - color:e.main,width:5} - ),t.ellipse(64,62,8,14).fill(i).ellipse(64,66,4,8).fill(16777215),t.roundRect(40,88,48,12,4).fill(e.main).stroke(n),3===s&&t.circle(64,104,5).fill(e.gem),2===s&&t.poly([44,30,38,24,46,26]).fill(e.main).poly([84,30,90,24,82,26]).fill(e.main); - break} - } - } - function oHi(t,i,s){ - const e=[]; - for(let n=0; - n<10; - n++){ - const h=-Math.PI/2+n/10*Math.PI*2,r=n%2?.45*s:s; - e.push(t+Math.cos(h)*r,i+Math.sin(h)*r)} - return e} - function aHi(t){ - const i=vSi(t); - if(!i)return ls.EMPTY; - return NAi.boatGearIcon(qAi(i.slot),i.v)||iLi(`gear:${ - t} - `,()=>{ - const t=new Ke,s=new ep; - return s.rect(0,0,128,128).fill({ - color:0,alpha:.001} - ),rHi(s,i.slot,i.v),t.addChild(s),t} - )} - function cHi(t){ - return NAi.boatGearIcon(qAi(t),5)||iLi(`gearSlot:${ - t} - `,()=>{ - const i=new Ke,s=new ep; - return s.rect(0,0,128,128).fill({ - color:0,alpha:.001} - ),rHi(s,t,2),i.addChild(s),i} - )} - Qt(rHi,"drawIcon"),Qt(oHi,"starPts"),Qt(aHi,"gearIconTex"),Qt(cHi,"gearSlotTex"); - const lHi=16740241; - function uHi(t,i,s,e){ - return t.moveTo(i,s+.9*e).bezierCurveTo(i-1.55*e,s-.05*e,i-.95*e,s-1.3*e,i,s-.45*e).bezierCurveTo(i+.95*e,s-1.3*e,i+1.55*e,s-.05*e,i,s+.9*e)} - Qt(uHi,"heartPath"); - const dHi=class extends Ke{ - constructor(t,i=!1){ - super(),Zt(this,"frame"),Zt(this,"icon",new Xe),Zt(this,"marks",new Ke),Zt(this,"ring",Oxi),this.size=t,this.eventMode="none",this.icon.anchor.set(.5),this.marks.eventMode="none",this.frame=new Txi(t),this.addChild(this.frame.back,this.icon,this.frame.front,this.marks)} - set(t,i,s,e={ - } - ){ - const n=this.size,h=.2*n,r=!!(e.on||e.lock||e.kept&&(e.up||e.pick)); - this.frame.set(null===t?null:Math.max(1,i),!r),this.icon.texture=null!==t?aHi(t):s?cHi(s):ls.EMPTY,this.icon.alpha=null!==t?e.lock?.45:1:.3,this.icon.scale.set(n*(null!==t?.86:.7)/(this.icon.texture.frame.width||128)),this.icon.position.set(n/2,n*(null!==t?.46:.5)),this.marks.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const o=Math.max(9,Math.round(.15*n)); - if(null!==t&&(e.on||e.lock)){ - const t=(new ep).circle(o-4,o-4,o+2).fill(this.ring).circle(o-4,o-4,o).fill(e.on?5030794:3816e3); - if(e.on&&t.moveTo(o-4-.45*o,o-4).lineTo(o-4-.1*o,o-4+.35*o).lineTo(o-4+.5*o,o-4-.35*o).stroke({ - color:536604,width:Math.max(2,.24*o),cap:"round",join:"round"} - ),this.marks.addChild(t),e.lock&&!e.on){ - const t=nxi("lock",1.2*o,13092812,2.6); - t.position.set(o-4-.6*o,o-4-.62*o),this.marks.addChild(t)} - } - if(null!==t&&e.pick){ - const t=n-o+4,i=o-4,s=new ep; - "on"===e.pick?s.roundRect(-3,-3,n+6,n+6,h+3).stroke({ - color:Dxi,width:3.5} - ).circle(t,i,o+2).fill(this.ring).circle(t,i,o).fill(Dxi).moveTo(t-.45*o,i).lineTo(t-.1*o,i+.35*o).lineTo(t+.5*o,i-.35*o).stroke({ - color:Gxi,width:Math.max(2,.24*o),cap:"round",join:"round"} - ):s.circle(t,i,o+2).fill(this.ring).circle(t,i,o).fill({ - color:Vxi,alpha:.8} - ).circle(t,i,o-1.2).stroke({ - color:Uxi,width:2.2} - ),this.marks.addChild(s)} - if(null!==t&&e.kept){ - const t=e.up||e.pick?o-4:n-o+4,i=o-4; - this.marks.addChild(uHi((new ep).circle(t,i,o+2).fill(this.ring).circle(t,i,o).fill(lHi),t,i+.06*o,.5*o).fill(16777215))} - if(e.up){ - const t=n-o+4,i=o-4; - this.marks.addChild((new ep).circle(t,i,o+2).fill(this.ring).circle(t,i,o).fill(15029053).poly([t,i-.45*o,t+.48*o,i+.32*o,t-.48*o,i+.32*o]).fill(16777215))} - } - } - ; - Qt(dHi,"GearCard"); - let fHi=dHi; - const pHi=APi.CONTENT_W; - function wHi(t,i){ - try{ - QG.getInstance().playSFX(t,i)} - catch{ - } - } - Qt(wHi,"sfx"); - const gHi=Qt((t,i)=>{ - const s=uSi[t].unit; - return`${ - s.endsWith("↓")?"−":"+"} - ${ - Math.round(10*i)/10} - ${ - s.replace("↓","")} - `} - ,"fmt"),mHi=Qt(t=>{ - const i=ixi.getInstance().state.gearBox,s=vSi(t.id),e=new Set(Object.values((null==i?void 0:i.equipped)??{ - } - )); - return((null==i?void 0:i.items)??[]).filter(i=>{ - var n; - return i.star===t.star&&(null==(n=vSi(i.id))?void 0:n.slot)===s.slot&&!e.has(i.uid)} - ).length} - ,"freeSame"),vHi=class t extends Ke{ - constructor(){ - super(...arguments),Zt(this,"card",new Ke),Zt(this,"shade",null)} - show(){ - var i; - null==(i=t.current)||i.close(),t.current=this,APi.getInstance().overlay.addChild(this),yx.fromTo(this.card,{ - alpha:0,y:this.card.y+14} - ,{ - alpha:1,y:this.card.y,duration:.18,ease:"power2.out"} - )} - frame(t,i){ - const s=APi.contentHeight,e=APi.OVERLAY_PAD,n=!!this.shade; - this.shade||(this.shade=new ep,this.shade.eventMode="static",this.shade.on("pointertap",t=>{ - t.stopPropagation(),queueMicrotask(()=>this.close())} - ),this.eventMode="static",this.addChildAt(this.shade,0),this.card.eventMode="static",this.card.on("pointertap",t=>t.stopPropagation())),this.shade.clear().rect(-e,0,pHi+2*e,s).fill({ - color:0,alpha:Nxi} - ); - const h=(new ep).roundRect(0,6,t,i,20).fill({ - color:0,alpha:.35} - ).roundRect(0,0,t,i,20).fill(Rxi); - h.eventMode="none",this.card.addChildAt(h,0),this.card.hitArea=new $i(0,0,t,i); - const r=Math.max(10,(s-i)/2); - this.card.position.set((pHi-t)/2,n?Math.max(10,Math.min(this.card.y,s-i-10)):r),this.card.parent||this.addChild(this.card)} - closeX(t){ - const i=new Ke,s=(new ep).moveTo(14,14).lineTo(30,30).moveTo(30,14).lineTo(14,30).stroke({ - color:Uxi,width:3,cap:"round"} - ); - return s.eventMode="none",i.addChild(s),i.position.set(t-52,8),i.eventMode="static",i.cursor="pointer",i.hitArea=new $i(0,0,44,44),i.on("pointertap",t=>{ - t.stopPropagation(),queueMicrotask(()=>this.close())} - ),i} - close(){ - t.current===this&&(t.current=null),this.destroyed||this.destroy({ - children:!0} - )} - closeOne(){ - return this.close(),!0} - } - ; - Qt(vHi,"GearOverlay"),Zt(vHi,"current",null); - let _Hi=vHi; - const MHi=class t extends _Hi{ - static open(i){ - ixi.getInstance().state.gear.boat+1<DSi.LEVELS&&new t(i).show()} - constructor(t){ - super(); - const i=ixi.getInstance().state,s=i.gear.boat,e=s+1,n=XTi.find(t=>"boat"===t.key),h=n.prices[e],r=Math.min(pHi-24,520),o=22,a=new Xe(NAi.boatBig(e)); - a.anchor.set(.5),a.scale.set(88/(a.texture.frame.height||384)),a.position.set(62,58); - const c=Jxi(`다음 배 · ${ - e+1} - 단계`,Uxi,15,!1),l=Jxi(n.names[e],Bxi,24); - c.position.set(116,25),l.position.set(116,50),sRi(l,r-44-144),this.card.addChild(a,c,l,this.closeX(r)); - const u=Math.min(44,(r-44)/DSi.LEVELS-4),d=new Ke,f=new ep; - d.addChild(f); - for(let b=0; - b<DSi.LEVELS; - b++){ - const t=o+b*(u+4),i=new Xe(NAi.boatBig(b)); - i.anchor.set(.5),i.scale.set((u-6)/(i.texture.frame.height||384)),i.position.set(t+u/2,104+u/2),i.alpha=b>e?.35:1; - const n=Jxi(`${ - b+1} - `,b===e?Dxi:b<=s?Uxi:7237235,12); - n.position.set(t+(u-n.width)/2,106+u),b!==s&&b!==e||f.roundRect(t,104,u,u,10).stroke({ - color:b===e?Dxi:8378016,width:2} - ),d.addChild(i,n)} - this.card.addChild(d); - const p={ - ...i,gear:{ - ...i.gear,boat:e} - } - ,w=[["기본 내구도",`${ - DSi.MAX_HP[s]} - → ${ - DSi.MAX_HP[e]} - `],["장비 포함 최대 내구도",`${ - sTi(i)} - → ${ - sTi(p)} - `],["장착 가능한 장비",`★${ - bSi(s)} - → ★${ - bSi(e)} - `]],g=e===DSi.ENTRY.C?"연안":e===DSi.ENTRY.O?"대양":e===DSi.LEVELS-1?"잠수 · 심연 (준비 중)":""; - g&&w.push(["새로 갈 수 있는 지역",g]); - let m=104+u+34; - for(const[b,y]of w){ - const t=Jxi(b,Uxi,16,!1),i=Jxi(y,Dxi,18); - t.position.set(o,m),i.position.set(r-o-i.width,m),sRi(t,i.x-o-18),this.card.addChild(t,i,(new ep).moveTo(o,m+34).lineTo(r-o,m+34).stroke({ - color:Lxi,width:1} - )),m+=48} - const v=new cRi(`${ - h.toLocaleString()} - 골드 · 업그레이드`,r-44,54,18); - v.position.set(o,m+4),v.enabled=i.gold>=h,v.onTap=()=>{ - this.close(),t()} - ; - const _=Math.max(0,h-Math.floor(i.gold)),M=Jxi(_?`${ - _.toLocaleString()} - 골드 부족 · 보유 ${ - Math.floor(i.gold).toLocaleString()} - `:`보유 골드 ${ - Math.floor(i.gold).toLocaleString()} - `,_?Hxi:Uxi,15,!1); - sRi(M,r-44),M.position.set((r-M.width)/2,m+72),this.card.addChild(v,M),this.frame(r,m+116)} - } - ; - Qt(MHi,"BoatUpgradePanel"); - let bHi=MHi; - const yHi=class t extends _Hi{ - static open(i){ - new t(i).show()} - constructor(i){ - super(); - const s=ixi.getInstance().state,e=s.gearBox,n=bSi(s.gear.boat),h=new Set(Object.values((null==e?void 0:e.equipped)??{ - } - )),r=OSi(e,i,n),o=((null==e?void 0:e.items)??[]).filter(t=>{ - var s; - return(null==(s=vSi(t.id))?void 0:s.slot)===i} - ).sort((t,i)=>Number(h.has(i.uid))-Number(h.has(t.uid))||i.star-t.star||t.uid-i.uid),a=Math.min(pHi-24,520),c=Math.floor((a-40-48)/5),l=new Xe(cHi(i)); - l.anchor.set(.5),l.scale.set(44/(l.texture.frame.width||128)),l.position.set(42,42); - const u=Jxi(_Si[i],Bxi,22),d=dRi(`${ - o.length} - `,Uxi,Pxi,14,9); - u.position.set(74,28),d.position.set(u.x+u.width+10,32),this.card.addChild(l,u,d,this.closeX(a)); - let f=84; - if(o.length){ - if(o.slice(0,t.MAX).forEach((t,e)=>{ - var o,a; - const l=new fHi(c); - l.ring=Rxi,l.set(t.id,t.star,void 0,{ - on:h.has(t.uid),lock:!h.has(t.uid)&&t.star>n,up:(null==r?void 0:r.uid)===t.uid,kept:!!(null==(a=null==(o=s.gearBox)?void 0:o.kept)?void 0:a.includes(t.uid))} - ),l.position.set(20+e%5*(c+12),f+Math.floor(e/5)*(c+12)),l.eventMode="static",l.cursor="pointer",l.hitArea=new $i(0,0,c,c),l.on("pointertap",s=>{ - s.stopPropagation(),queueMicrotask(()=>SHi.open(t,i))} - ),this.card.addChild(l)} - ),f+=Math.ceil(Math.min(o.length,t.MAX)/5)*(c+12)-12,o.length>t.MAX){ - const t=new cRi(`가방에서 모두 보기 (${ - o.length} - )`,a-40,50,16); - t.setPrimary(!1),t.position.set(20,f+16),t.onTap=()=>{ - this.close(),ei(()=>Promise.resolve().then(()=>dWi),void 0).then(t=>t.FishingGearPage.getInstance().showMode("bag",i))} - ,this.card.addChild(t),f+=66} - } - else{ - const t=Jxi(`아직 ${ - _Si[i]} - 장비가 없어요. 장비 상자에서 나와요`,Uxi,15,!1); - t.position.set(20,f),sRi(t,a-40); - const s=new cRi("장비 상자로",a-40,56,17); - s.position.set(20,f+40),s.onTap=()=>{ - this.close(),ei(()=>Promise.resolve().then(()=>dWi),void 0).then(t=>t.FishingGearPage.getInstance().showMode("chest"))} - ,this.card.addChild(t,s),f+=96} - this.frame(a,f+20)} - } - ; - Qt(yHi,"GearSlotPanel"),Zt(yHi,"MAX",15); - let EHi=yHi; - const AHi=class t extends _Hi{ - constructor(t,i){ - super(),Zt(this,"busy",!1),Zt(this,"openStat",null),this.it=t,this.from=i,this.build()} - static open(i,s){ - new t(i,s).show()} - rebuild(){ - this.card.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),this.build()} - build(){ - var t,i,s; - const e=this.it,n=this.from,h=ixi.getInstance().state,r=vSi(e.id),o=bSi(h.gear.boat),a=null==(t=h.gearBox)?void 0:t.equipped[r.slot],c=a===e.uid,l=e.star>o,u=mHi(e),d=!!(null==(s=null==(i=h.gearBox)?void 0:i.kept)?void 0:s.includes(e.uid)),f=Math.min(pHi-24,500),p=20; - let w=p; - if(n){ - const t=new Ke,i=Jxi(_Si[n],Uxi,15),s=i.width+40; - t.addChild((new ep).roundRect(0,0,s,38,11).fill(Pxi).moveTo(20,12).lineTo(13,19).lineTo(20,26).stroke({ - color:Uxi,width:3,cap:"round",join:"round"} - ),i),i.position.set(28,(38-i.height)/2),t.position.set(p,w-6),t.eventMode="static",t.cursor="pointer",t.hitArea=new $i(0,0,s,38),t.on("pointertap",t=>{ - t.stopPropagation(),queueMicrotask(()=>EHi.open(n))} - ),this.card.addChild(t),w+=44} - this.card.addChild(this.closeX(f)); - const g=new fHi(124); - g.ring=Rxi,g.set(e.id,e.star,void 0,{ - on:c,kept:d} - ),g.position.set(p,w); - const m=Jxi(r.name,Bxi,24); - m.position.set(164,w+16),sRi(m,f-p-144-56); - const v=new Ke; - let _=0; - const M=Qt((t,i,s=!1)=>{ - const e=new Ke,n=Jxi(t,i,14),h=s?28:11,r=n.height+10,o=h+n.width+11; - if(e.addChild((new ep).roundRect(0,0,o,r,r/2).fill(Pxi),n),n.position.set(h,5),s){ - const t=nxi("lock",15,i,2.6); - t.position.set(9,(r-15)/2),e.addChild(t)} - e.x=_,v.addChild(e),_+=o+8} - ,"addPill"); - M(_Si[r.slot],Uxi),M(`★${ - e.star} - `,Dxi),c?M("장착 중",$xi):l&&M(`배 ${ - e.star} - 단계부터`,Hxi,!0),v.position.set(164,w+62); - const b=new Ke,y=Jxi(d?"아끼는 장비":"아끼기",d?lHi:Uxi,14),E=40+y.width+12,A=(new ep).roundRect(0,0,E,34,17).fill(d?4860469:Pxi); - uHi(A,22,18,8),d?A.fill(lHi):A.stroke({ - color:Uxi,width:2.2,join:"round"} - ),y.position.set(40,(34-y.height)/2),b.addChild(A,y),b.position.set(164,w+124-34),b.eventMode="static",b.cursor="pointer",b.hitArea=new $i(-6,-6,E+12,46),b.on("pointertap",t=>{ - t.stopPropagation(),this.toggleKeep(!d)} - ),this.card.addChild(g,m,v,b),w+=142; - const S=ySi(e.id,e.star),T=f-40,C=r.stats.map((t,i)=>{ - const s=QAi(t),n=s||void 0!==S[t]&&(i<2||e.star>=5),h=this.openStat===t,r=h?Jxi(`${ - n?"":"★5가 되면 생겨요 · "} - ${ - s?oSi(t):dSi(t)} - `,12763848,14,!1):null; - return null==r||r.setWrapWidth(T-66),{ - k:t,i,has:n,open:h,help:r,h:50+(r?r.height+12:0)} - } - ),O=C.reduce((t,i)=>t+i.h,0)+8,I=eRi(T,O,Pxi,null,14); - I.position.set(p,w),this.card.addChild(I); - let k=w+4; - for(const{ - k:P,i:N,has:L,open:D,help:G,h:B} - of C){ - const t=new Ke; - t.position.set(p,k),N&&t.addChild((new ep).rect(14,0,T-28,1).fill({ - color:16777215,alpha:.06} - )),D&&t.addChild((new ep).roundRect(4,2,T-8,B-4,10).fill({ - color:16777215,alpha:.04} - )); - const i=QAi(P),s=nxi(L?i?"hold"===P?"line":"bite"===P?"clock":"icebox":P:"lock",22,L?Dxi:5921376); - s.position.set(16,14); - const n=Jxi(i?hSi[P]:uSi[P].name,L?0===N?Bxi:14079706:7829373,0===N?17:16,0===N&&L); - n.position.set(50,(50-n.height)/2); - const r=new Ke,o=D?Dxi:9342611,a=Jxi("i",o,12); - r.addChild((new ep).circle(9,9,8.5).stroke({ - color:o,width:1.6} - ),a),a.position.set(9-a.width/2,9-a.height/2),r.position.set(n.x+n.width+8,16); - const c=Jxi(L?i?rSi(P,Math.min(bSi(h.gear.boat),e.star)):gHi(P,S[P]):"★5부터",L?0===N?Dxi:Bxi:7829373,0===N?18:16,L); - c.position.set(T-16-c.width,(50-c.height)/2),t.addChild(s,n,r,c),G&&(G.position.set(50,46),t.addChild(G)),t.eventMode="static",t.cursor="pointer",t.hitArea=new $i(0,0,T,B),t.on("pointertap",t=>{ - t.stopPropagation(),this.openStat=D?null:P,YG("light"),queueMicrotask(()=>{ - this.destroyed||this.rebuild()} - )} - ),this.card.addChild(t),k+=B} - if(w+=O+18,e.star<7){ - const t=!c&&u>=3,i=168,s=Jxi("합성",Uxi,15); - s.position.set(p,w+12); - const n=Jxi(`같은 ${ - _Si[r.slot]} - ★${ - e.star} - ${ - u} - 개`,t?13092812:Fxi,15,!1); - n.position.set(76,w+12),sRi(n,f-p-i-10-76); - const h=new cRi("이 장비로 합성",i,44,15); - h.setPrimary(t),h.enabled=t,h.position.set(f-p-i,w),h.onTap=()=>{ - this.close(),ei(()=>Promise.resolve().then(()=>dWi),void 0).then(t=>t.FishingGearPage.getInstance().openMerge(e))} - ,this.card.addChild(s,n,h),w+=62} - const x=f-40,R=new cRi(c?"해제":l?`배 ${ - e.star} - 단계부터 장착`:a?"바꿔 장착":"장착",x,60,19); - if(R.setPrimary(!c),R.enabled=c||!l,R.position.set(p,w),R.onTap=()=>{ - this.toggle(c,r.slot)} - ,this.card.addChild(R),w+=60,c){ - const t=Jxi("장착 중인 장비는 합성에 쓰지 않아요",Fxi,13,!1); - t.position.set((f-t.width)/2,w+10),this.card.addChild(t),w+=30} - this.frame(f,w+p)} - async toggle(t,i){ - if(this.busy)return; - this.busy=!0; - const s=ixi.getInstance(),e=t?await s.gearUnequip(i):await s.gearEquip(this.it.uid); - this.busy=!1,e?bH.getInstance().showMessage(e):(YG("light"),wHi(QG.SFX_STONE_BREAK,.3),bH.getInstance().showMessage(t?`${ - _Si[i]} - 해제`:`${ - vSi(this.it.id).name} - ★${ - this.it.star} - 장착`),this.close())} - async toggleKeep(t){ - if(this.busy)return; - this.busy=!0; - const i=await ixi.getInstance().gearKeep(this.it.uid,t); - this.busy=!1,i?bH.getInstance().showMessage(i):(YG("light"),this.destroyed||this.rebuild())} - } - ; - Qt(AHi,"GearDetailPanel"); - let SHi=AHi; - const THi=class t extends _Hi{ - constructor(t,i,s){ - super(),Zt(this,"reveal",yx.timeline()),this.on("removed",()=>this.close()); - const e=Math.min(pHi-16,540),n=Math.min(5,Math.max(1,t.length)),h=Math.min(110,Math.floor((e-40-48)/5)); - let r=20; - const o=s?NAi.gearChest(!0):null; - if(o){ - const t=new Xe(o); - t.anchor.set(.5,0),t.scale.set(150/o.frame.width),t.position.set(e/2,r-12),this.card.addChild(t),this.reveal.fromTo(t.scale,{ - x:90/o.frame.width,y:90/o.frame.width} - ,{ - x:150/o.frame.width,y:150/o.frame.width,duration:.35,ease:"back.out(2.2)"} - ,0),r+=130} - const a=Jxi(i,Dxi,22); - a.position.set((e-a.width)/2,r),this.card.addChild(a),r+=a.height+16; - const c=Math.ceil(t.length/n),l=n*h+12*(n-1),u=Math.max(0,...t.map(t=>t.star)); - t.forEach((t,i)=>{ - const s=new Ke,a=new fHi(h),c=vSi(t.id),u=.08*i+(o?.2:0); - s.position.set((e-l)/2+i%n*(h+12),r+Math.floor(i/n)*(h+34)),a.ring=Rxi,a.set(t.id,t.star); - const d=Jxi(c.name,t.star>=4?Dxi:13092812,13,!1); - sRi(d,h+8),d.position.set((h-d.width)/2,h+5),s.addChild(a,d),this.card.addChild(s),s.alpha=0,this.reveal.fromTo(s,{ - alpha:0,y:s.y+18} - ,{ - alpha:1,y:s.y,duration:.22,ease:"back.out(2)"} - ,u)} - ),r+=c*(h+34)+6,u>=4?(wHi(QG.SFX_TRUMPET,.5),YG("heavy")):u>=3&&wHi(QG.SFX_GOLD_GOBLIN,.45); - const d=(e-40-10)/2,f=new cRi("내 배로",d,56,17),p=new cRi("확인",d,56,17); - f.setPrimary(!1),f.position.set(20,r),p.position.set(20+d+10,r),f.onTap=()=>{ - this.close(),ei(()=>Promise.resolve().then(()=>dWi),void 0).then(t=>t.FishingGearPage.getInstance().showMode("boat"))} - ,p.onTap=()=>this.close(),this.card.addChild(f,p),this.frame(e,r+56+20)} - static open(i,s,e=!1){ - new t(i,s,e).show()} - destroy(t){ - this.reveal.kill(),yx.killTweensOf(this.card),super.destroy(t??{ - children:!0} - )} - } - ; - Qt(THi,"GearRevealPanel"); - let CHi=THi; - const OHi=APi.CONTENT_W,IHi=XTi.find(t=>"boat"===t.key),kHi=66,xHi=class extends iRi{ - constructor(){ - super(OHi)} - } - ; - Qt(xHi,"GearHeader"); - let RHi=xHi; - function PHi(t,i,s,e){ - const n=new cRi("",i,s,17),h=Jxi(t,Gxi,18),r=pRi("gold",18),o=Jxi("",Gxi,15); - n.setPrimary(e),n.addChild(h,r,o); - const a=Qt((t,a,c=!1)=>{ - const l=null!==t&&a<t,u=null!==t&&!l&&!c; - n.enabled=u; - const d=u?e?Gxi:Bxi:Kxi; - h.textColor=d,o.text=null===t?"":t.toLocaleString(),o.textColor=l?Hxi:d,r.visible=null!==t; - const f=23+o.width; - h.position.set((i-h.width)/2,null===t?(s-h.height)/2:.5*s-h.height-1),r.position.set((i-f)/2,.5*s+4),o.position.set(r.x+23,.5*s+2)} - ,"set"); - return{ - btn:n,set:a} - } - Qt(PHi,"priceButton"); - const NHi={ - prow:[.5,0],harpoon:[0,1],rod:[0,2],bobber:[0,3],sail:[1,1],deck:[1,2],net:[1,3],lantern:[.5,4]} - ,LHi=["prow","harpoon","sail","rod","deck","bobber","net","lantern"],DHi=76,GHi=["fish","raid","steal"],BHi={ - fish:"낚시",raid:"레이드",steal:"훔치기"} - ,UHi={ - fish:["prow","rod","bobber","net","lantern"],raid:["harpoon","deck","sail"],steal:["sail","deck","net"]} - ,FHi=class extends Ke{ - constructor(){ - super(),Zt(this,"head",new RHi),Zt(this,"dock",new Ke),Zt(this,"water",new ep),Zt(this,"waterMask",new ep),Zt(this,"boat",new Xe),Zt(this,"boatWrap",new Ke),Zt(this,"boatDeco",new Ke),Zt(this,"slots",LHi.map(t=>{ - const i=new Ke,s=new fHi(DHi,!0),e=new Ke; - return s.ring=1914434,e.eventMode="none",i.addChild(s,e),i.eventMode="static",i.cursor="pointer",i.hitArea=new $i(-6,-6,88,88),i.on("pointertap",i=>{ - i.stopPropagation(),queueMicrotask(()=>this.tapSlot(t))} - ),{ - slot:t,root:i,card:s,lock:e} - } - )),Zt(this,"auto",new cRi("자동 장착",132,40,15)),Zt(this,"info",new Ke),Zt(this,"tab","fish"),Zt(this,"next",new Ke),Zt(this,"details",new cRi("›",44,44,28)),Zt(this,"up",new cRi("",OHi-32,48,17)),Zt(this,"upCoin",pRi("gold",20)),Zt(this,"upTitle",Jxi("",Gxi,17)),Zt(this,"upNote",Jxi("",Uxi,15,!1)),Zt(this,"busy",!1),Zt(this,"sig",""),this.water.eventMode="none",this.waterMask.eventMode="none",this.water.mask=this.waterMask,this.boat.anchor.set(.5),this.boat.eventMode="none",this.auto.onTap=()=>{ - this.autoEquip()} - ,this.auto.setPrimary(!1),this.details.setPrimary(!1),this.details.onTap=()=>bHi.open(()=>{ - this.upgrade()} - ),this.up.onTap=()=>{ - this.upgrade()} - ,this.up.addChild(this.upCoin,this.upTitle,this.upNote),this.boatWrap.addChild(this.boat,this.boatDeco),this.boatWrap.eventMode="none",this.dock.addChild(this.water,this.waterMask,this.boatWrap,...this.slots.map(t=>t.root)),this.dock.y=kHi,this.addChild(this.head,this.dock,this.auto,this.info,this.next)} - slotNode(t){ - var i; - return(null==(i=this.slots.find(i=>i.slot===t))?void 0:i.root)??null} - get upgradeButton(){ - return this.up.parent?this.up:null} - dockH(){ - return Math.round(Math.min(500,Math.max(420,APi.contentHeight-330)))} - tapSlot(t){ - const i=ixi.getInstance().state; - zAi(i.gear.boat,t)?EHi.open(t):bH.getInstance().showMessage(YAi(t))} - update(){ - const t=ixi.getInstance().state,i=t.gearBox,s=t.gear.boat,e=`${ - this.dockH()} - |${ - s} - |${ - Math.floor(t.gold)} - |${ - this.busy} - |${ - this.tab} - |${ - JSON.stringify((null==i?void 0:i.equipped)??{ - } - )} - |${ - ((null==i?void 0:i.items)??[]).map(t=>`${ - t.uid} - .${ - t.id} - .${ - t.star} - `).join(",")} - `; - e!==this.sig&&(this.sig=e,this.draw())} - draw(){ - const t=ixi.getInstance(),i=t.state,s=i.gearBox,e=i.gear.boat,n=bSi(e),h=this.dockH(),r=Qt(t=>zAi(e,t),"open"),o=LHi.filter(t=>r(t)&&(null==s?void 0:s.items.some(i=>i.uid===s.equipped[t]))),a=VAi.filter(t=>r(t)&&OSi(s,t,n)); - this.auto.visible=a.length>0,this.auto.enabled=!this.busy,this.auto.setText(`자동 장착 ${ - a.length} - `),this.auto.position.set(OHi-132,1),this.head.set(IHi.names[e],`${ - e+1} - / ${ - IHi.names.length} - 단계 · 장착 ${ - o.length} - / ${ - LHi.length} - ·`,{ - accent:`장비 ★${ - n} - 까지`,rightW:this.auto.visible?144:0} - ); - const c=OHi/2,l=(h+112)/2; - this.water.clear().rect(0,0,OHi,h).fill(1778217); - for(const[O,I,k]of[[.62,.62,1715254],[.5,.5,1782848],[.4,.41,2047050],[.3,.32,2245715],[.2,.22,2443610]])this.water.ellipse(c,l,OHi*O,h*I).fill({ - color:k,alpha:.9} - ); - for(const O of[.34,.46])this.water.ellipse(c,l,OHi*O*.8,h*O).stroke({ - color:10542320,width:1.5,alpha:.07} - ); - this.waterMask.clear().roundRect(0,0,OHi,h,24).fill(16777215),this.boat.texture=NAi.boatBig(e),this.boatWrap.scale.set(Math.min(.74*h,OHi-200)/(this.boat.texture.frame.height||384)),this.boatWrap.position.set(c,l),NAi.dressBigBoat(this.boatDeco,e,PSi(RSi(i))); - const u=UHi[this.tab],d=Qt(t=>0===t?8:4===t?h-DHi-18:8+t*((h-DHi-26)/4),"rowY"); - this.slots.forEach(({ - slot:t,root:i,card:e,lock:h} - )=>{ - const[o,c]=NHi[t]; - i.position.set(.5===o?(OHi-DHi)/2:0===o?18:OHi-18-DHi,d(c)),h.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),i.alpha=r(t)&&!u.includes(t)?.4:1; - const l=null==s?void 0:s.items.find(i=>i.uid===s.equipped[t]); - if(r(t)?e.set(l?l.id:null,(null==l?void 0:l.star)??0,t,{ - lock:!!l&&l.star>n,up:a.includes(t)} - ):e.set(null,0,t),!r(t)){ - const i=DHi,s=nxi("lock",22,13092812,2.6),e=Jxi(`★${ - KAi[t]+1} - `,13092812,13); - s.position.set((i-22)/2,i/2-22),e.position.set((i-e.width)/2,i/2+2),h.addChild((new ep).roundRect(0,0,i,i,.2*i).fill({ - color:727586,alpha:.72} - ),s,e)} - } - ); - const f=this.info; - f.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),f.y=kHi+h+12; - const p=(OHi-8)/3; - f.addChild(eRi(OHi,44,Ixi,null,12)),GHi.forEach((t,i)=>{ - const s=t===this.tab,e=new Ke,n=Jxi(BHi[t],s?Bxi:Uxi,16); - s&&e.addChild(eRi(p,36,kxi,null,9)),sRi(n,p-12),n.position.set((p-n.width)/2,(36-n.height)/2),e.addChild(n),e.position.set(4+i*p,4),e.eventMode="static",e.cursor="pointer",e.hitArea=new $i(0,0,p,36),e.on("pointertap",i=>{ - i.stopPropagation(),this.tab=t,this.update()} - ),f.addChild(e)} - ); - const w=t.gearStats(),g=Qt(t=>`+${ - Math.round(10*t)/10} - %`,"pct"),m="fish"===this.tab?[[cHi("prow"),g(w.luck),"행운"],[cHi("rod"),`${ - i.gear.line+1} - `,"버티는 힘"],[cHi("bobber"),`×${ - iCi(i.gear)} - `,"입질"],[cHi("lantern"),g(w.sell),"판매가"]]:"raid"===this.tab?[[cHi("harpoon"),g(w.power),"작살 공격력"],[cHi("harpoon"),g(w.aim),"조준"],[cHi("deck"),`${ - sTi(i)} - `,"내구도"],[cHi("deck"),`${ - eTi(i)} - `,"튼튼함"]]:[[cHi("sail"),`−${ - Math.round(10*w.steal)/10} - %`,"훔치는 시간"],[cHi("sail"),`+${ - Math.round(w.protect)} - 분`,"털림 보호"],[cHi("net"),`${ - t.netCap} - `,"털릴 칸"],[cHi("sail"),g(w.speed),"속도"]],v=(OHi-18)/4; - m.forEach(([t,i,s],e)=>{ - const n=e*(v+6),h=eRi(v,88,Ixi,null,12); - if(h.position.set(n,54),f.addChild(h),t){ - const i=new Xe(t); - i.anchor.set(.5),i.scale.set(34/(t.frame.width||128)),i.position.set(n+v/2,76),i.eventMode="none",f.addChild(i)} - const r=Jxi(i,Bxi,18),o=Jxi(s,Uxi,12,!1); - sRi(r,v-8),sRi(o,v-8),r.position.set(n+(v-r.width)/2,96),o.position.set(n+(v-o.width)/2,120),f.addChild(r,o)} - ); - const _=this.next; - _.removeChildren().forEach(t=>{ - t!==this.up&&t!==this.details&&t.destroy({ - children:!0} - )} - ),_.y=f.y+142+14; - const M=e+1; - if(M>=IHi.names.length){ - const t=dRi("가장 좋은 배예요",Dxi,Ixi,15,14); - return void _.addChild(t)} - _.addChild(eRi(OHi,168,2894632,6115378,18)); - const b=new Xe(NAi.boatBig(M)); - b.anchor.set(.5),b.scale.set(72/(b.texture.frame.height||384)),b.position.set(50,46); - const y=Jxi(`다음 배 · ${ - M+1} - 단계`,Uxi,15,!1),E=Jxi(IHi.names[M],Bxi,23),A=M===DSi.ENTRY.C?"연안 해금":M===DSi.ENTRY.O?"대양 해금":M===DSi.LEVELS-1?"잠수 (심연 준비 중)":"",S=Jxi(`기본 내구도 ${ - DSi.MAX_HP[e]} - → ${ - DSi.MAX_HP[M]} - · ★${ - bSi(M)} - 장비${ - A?` · ${ - A} - `:""} - `,14206864,16,!1); - y.position.set(94,14),E.position.set(94,37),S.position.set(18,83),sRi(E,OHi-176),sRi(S,OHi-36),this.details.position.set(OHi-62,23),this.up.position.set(16,108); - const T=IHi.prices[M],C=Math.max(0,T-Math.floor(i.gold)); - this.up.enabled=!this.busy&&!C,this.upTitle.text=`${ - T.toLocaleString()} - · 업그레이드`,this.upTitle.textColor=this.up.enabled?Gxi:14011049,this.upNote.text=C?`${ - C.toLocaleString()} - 골드 부족`:this.busy?"처리 중":"",this.upNote.textColor=C?14005387:Uxi,this.upCoin.position.set(13,14),this.upTitle.position.set(41,(48-this.upTitle.height)/2),this.upNote.position.set(OHi-48-this.upNote.width,(48-this.upNote.height)/2),sRi(this.upTitle,(this.upNote.text?this.upNote.x-12:OHi-48)-this.upTitle.x),_.addChild(b,y,E,S,this.details,this.up)} - async autoEquip(){ - if(this.busy)return; - this.busy=!0,this.update(); - const t=await ixi.getInstance().gearEquipBest().finally(()=>{ - this.busy=!1,this.update()} - ); - if(t.message)return bH.getInstance().showMessage(t.message),void this.update(); - YG("success"); - try{ - QG.getInstance().playSFX(QG.SFX_STONE_BREAK,.35)} - catch{ - } - bH.getInstance().showMessage(t.n?`${ - t.n} - 칸을 더 좋은 장비로 바꿨어요`:"이미 가장 좋은 장비예요"),this.update(); - for(const i of this.slots)yx.fromTo(i.card.scale,{ - x:1.12,y:1.12} - ,{ - x:1,y:1,duration:.35,ease:"back.out(3)"} - )} - async upgrade(){ - if(this.busy)return; - const t=ixi.getInstance(),i=IHi.prices[t.state.gear.boat+1]; - if(void 0===i||t.state.gold<i)return; - let s; - this.busy=!0,this.update(); - try{ - s=await t.upgrade("boat")} - finally{ - this.busy=!1,this.update()} - if(s)return bH.getInstance().showMessage(s),void this.update(); - bH.getInstance().showMessage(`배: ${ - IHi.names[t.state.gear.boat]} - (으)로 올렸어요`),YG("success"),QG.getInstance().playSFX(QG.SFX_LEVEL_UP),this.update(); - const e=this.boatWrap.scale.x; - yx.fromTo(this.boatWrap.scale,{ - x:1.15*e,y:1.15*e} - ,{ - x:e,y:e,duration:.5,ease:"back.out(3)"} - )} - } - ; - Qt(FHi,"FishingMyBoatView"); - let $Hi=FHi; - const HHi=OHi/6,WHi=class extends Ke{ - constructor(){ - super(),Zt(this,"filter",null),Zt(this,"onMerge",null),Zt(this,"head",new RHi),Zt(this,"merge",new cRi("합성",104,42,16)),Zt(this,"chips",[]),Zt(this,"grid",new Ke),Zt(this,"cards",[]),Zt(this,"shown",[]),Zt(this,"sig",""),this.merge.position.set(OHi-104,1),this.merge.onTap=()=>{ - var t; - return null==(t=this.onMerge)?void 0:t.call(this)} - ,this.addChild(this.head,this.merge,this.grid); - const t=(OHi-6*VAi.length)/(VAi.length+1); - for(let i=0; - i<VAi.length+1; - i++){ - const s=new Ke; - s.position.set(i*(t+6),kHi),s.eventMode="static",s.cursor="pointer",s.hitArea=new $i(0,0,t,t); - const e=i?VAi[i-1]:null; - s.on("pointertap",t=>{ - t.stopPropagation(),this.filter=this.filter!==e&&e?e:null,this.sig="",this.update(),APi.getInstance().resetScroll()} - ),this.chips.push(s),this.addChild(s)} - this.grid.y=kHi+t+18} - update(){ - const t=ixi.getInstance().state,i=t.gearBox,s=bSi(t.gear.boat),e=`${ - this.filter} - |${ - s} - |${ - JSON.stringify((null==i?void 0:i.equipped)??{ - } - )} - |${ - ((null==i?void 0:i.kept)??[]).join(".")} - |${ - ((null==i?void 0:i.items)??[]).map(t=>`${ - t.uid} - .${ - t.star} - `).join(",")} - `; - if(e===this.sig)return; - this.sig=e; - const n=(null==i?void 0:i.items)??[],h=new Set(Object.values((null==i?void 0:i.equipped)??{ - } - )),r=new Set((null==i?void 0:i.kept)??[]); - this.merge.setPrimary(ISi(i).length>0),this.merge.enabled=kSi(i).length>0; - const o=(OHi-6*VAi.length)/(VAi.length+1); - this.chips.forEach((t,i)=>{ - t.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const s=i?VAi[i-1]:null,e=this.filter===s,n=(new ep).roundRect(0,0,o,o,14).fill(e?4865308:Ixi); - if(e&&n.roundRect(1.5,1.5,o-3,o-3,13).stroke({ - color:Dxi,width:2.5} - ),t.addChild(n),!s){ - const i=Jxi("전체",e?Dxi:13092812,15); - return i.position.set((o-i.width)/2,(o-i.height)/2),void t.addChild(i)} - const h=new Xe(cHi(s)); - h.anchor.set(.5),h.scale.set(.8*o/(h.texture.frame.width||128)),h.position.set(o/2,o/2),h.alpha=e?1:.7,t.addChild(h)} - ); - const a=n.filter(t=>{ - var i; - return!this.filter||(null==(i=vSi(t.id))?void 0:i.slot)===this.filter} - ).sort((t,i)=>Number(h.has(i.uid))-Number(h.has(t.uid))||VAi.indexOf(vSi(t.id).slot)-VAi.indexOf(vSi(i.id).slot)||i.star-t.star||t.id-i.id); - for(; - this.cards.length<a.length; - ){ - const t=new fHi(82),i=this.cards.length; - t.eventMode="static",t.cursor="pointer",t.hitArea=new $i(-4,-4,90,90),t.on("pointertap",t=>{ - var s; - t.stopPropagation(); - const e=this.shown[i],n=null==(s=ixi.getInstance().state.gearBox)?void 0:s.items.find(t=>t.uid===e); - n&&queueMicrotask(()=>SHi.open(n))} - ),this.grid.addChild(t),this.cards.push(t)} - const c=!a.length&&this.filter?` · ${ - _Si[this.filter]} - 없음`:""; - this.head.set("장비 가방",`${ - n.length} - / 400칸 · 같은 장비 3개로 합성${ - c} - `,{ - rightW:116} - ),this.shown=a.map(t=>t.uid),this.cards.forEach((t,i)=>{ - const e=a[i]; - t.visible=!!e,e&&(t.set(e.id,e.star,void 0,{ - on:h.has(e.uid),lock:!h.has(e.uid)&&e.star>s,kept:r.has(e.uid)} - ),t.position.set(i%6*HHi+(HHi-82)/2,96*Math.floor(i/6)))} - )} - } - ; - Qt(WHi,"FishingGearBagView"); - let VHi=WHi; - const jHi=class extends Ke{ - constructor(){ - super(),Zt(this,"glow",new ep),Zt(this,"chest",new Xe),Zt(this,"head",new RHi),Zt(this,"odds",new Ke),Zt(this,"one",PHi("1개 열기",(OHi-12)/2,100,!1)),Zt(this,"ten",PHi("10개 열기",(OHi-12)/2,100,!0)),Zt(this,"bob",null),Zt(this,"busy",!1),Zt(this,"sig",""),this.glow.eventMode="none",this.chest.anchor.set(.5),this.chest.eventMode="none",this.one.btn.onTap=()=>{ - this.pull(1)} - ,this.ten.btn.onTap=()=>{ - this.pull(10)} - ; - let t=0; - for(const[i,s]of MSi){ - const e=new Ke,n=Jxi(`★${ - i} - ${ - Math.round(100*s)} - %`,13092812,14),h=n.height+12,r=30+n.width+12; - e.addChild((new ep).roundRect(0,0,r,h,h/2).fill(Ixi).roundRect(12,h/2-5,10,10,3).fill(LSi[i]),n),n.position.set(30,6),e.x=t,t+=r+8,this.odds.addChild(e)} - this.addChild(this.head,this.glow,this.chest,this.odds,this.one.btn,this.ten.btn)} - stop(){ - var t; - null==(t=this.bob)||t.kill(),this.bob=null,this.sig=""} - update(){ - var t,i,s; - const e=ixi.getInstance().state,n=APi.contentHeight,h=`${ - n} - |${ - e.gold} - |${ - this.busy} - |${ - (null==(t=e.gearBox)?void 0:t.items.length)??0} - `; - if(h===this.sig)return; - this.sig=h,this.head.set("장비 상자","열면 배 장비 하나가 나와요",{ - right:`가방 ${ - (null==(i=e.gearBox)?void 0:i.items.length)??0} - / 400`} - ); - const r=kHi+Math.max(8,(n-kHi-488)/2),o=NAi.gearChest(!1)??aHi(55); - this.chest.texture=o,this.chest.scale.set(300/(o.frame.width||384)),null==(s=this.bob)||s.kill(),this.bob=null,this.chest.position.set(OHi/2,r+150),this.visible&&(this.bob=yx.to(this.chest,{ - y:"-=8",duration:1.3,yoyo:!0,repeat:-1,ease:"sine.inOut"} - )),this.glow.clear(); - for(const[c,l]of[[1,.05],[.78,.07],[.56,.09],[.36,.1]])this.glow.circle(OHi/2,r+150,186*c).fill({ - color:16106577,alpha:l} - ); - let a=r+300+24; - this.odds.position.set((OHi-this.odds.width)/2,a),a+=64,this.one.btn.position.set(0,a),this.ten.btn.position.set((OHi-12)/2+12,a),this.one.set(100,e.gold,this.busy),this.ten.set(1e3,e.gold,this.busy)} - async pull(t){ - if(!this.busy){ - this.busy=!0,this.update(); - try{ - const i=await ixi.getInstance().gearPull(t); - if(i.message||!i.result)return void bH.getInstance().showMessage(i.message??"열지 못했어요"); - YG("medium"),CHi.open(i.result,`상자 ${ - t} - 개`,!0)} - finally{ - this.busy=!1,this.sig="",this.update()} - } - } - } - ; - Qt(jHi,"FishingGearChestView"); - let KHi=jHi; - const zHi=APi.CONTENT_W,YHi=(zHi-24)/6,qHi=Math.min(82,Math.floor(YHi-14)),XHi=qHi+18,JHi=[{ - q:"s1",text:"★1",max:1} - ,{ - q:"s2",text:"★2 이하",max:2} - ,{ - q:"all",text:"모두",max:6} - ]; - function QHi(t,i,s,e,n,h=16){ - const r=zHi,o=i+s,a=e?h:0,c=n?h:0; - return t.moveTo(0+a,i).lineTo(r-a,i),a&&t.arcTo(r,i,r,i+a,a),t.lineTo(r,o-c),c&&t.arcTo(r,o,r-c,o,c),t.lineTo(0+c,o),c&&t.arcTo(0,o,0,o-c,c),t.lineTo(0,i+a),a&&t.arcTo(0,i,0+a,i,a),t.closePath().fill(Ixi)} - Qt(QHi,"part"); - const ZHi=class extends kx{ - constructor(){ - super(),Zt(this,"bg",new ep),Zt(this,"icon",new Xe),Zt(this,"slotName",Jxi("",Bxi,18)),Zt(this,"stars",Jxi("",Dxi,14)),Zt(this,"count",Jxi("",Fxi,14)),Zt(this,"res",Jxi("",Uxi,15)),Zt(this,"cells",[]),Zt(this,"row",null); - const t=(new ep).rect(0,0,zHi,XHi).fill({ - color:0,alpha:.001} - ); - t.eventMode=this.bg.eventMode=this.icon.eventMode="none",this.icon.anchor.set(.5),this.addChild(t,this.bg,this.icon,this.slotName,this.stars,this.count,this.res); - for(let i=0; - i<6; - i++){ - const t=new Ke,s=new fHi(qHi); - s.ring=Ixi,s.position.set((YHi-qHi)/2,6),t.addChild(s),t.position.set(12+i*YHi,0),t.eventMode="static",t.cursor="pointer",t.hitArea=new $i(0,0,YHi,XHi),t.on("pointertap",t=>{ - var s,e,n,h; - t.stopPropagation(); - const r=null==(e=null==(s=this.row)?void 0:s.items)?void 0:e[i]; - r&&(null==(h=(n=this.row).onPick)||h.call(n,r.it.uid))} - ),this.addChild(t),this.cells.push({ - root:t,card:s} - )} - } - setData(t){ - this.row=t; - const i=t.head; - if(this.bg.clear(),[this.icon,this.slotName,this.stars,this.count,this.res].forEach(t=>t.visible=!!i),i){ - QHi(this.bg,14,XHi-14+1,!0,!1); - const t=14+(XHi-14)/2+2; - this.icon.texture=cHi(i.slot),this.icon.scale.set(44/(this.icon.texture.frame.width||128)),this.icon.position.set(38,t),this.slotName.text=_Si[i.slot],this.slotName.position.set(70,t-this.slotName.height/2),this.stars.text=CCi(i.star),this.stars.position.set(this.slotName.x+this.slotName.width+6,t-this.stars.height/2),this.count.text=`${ - i.n} - 개`,this.count.position.set(this.stars.x+this.stars.width+10,t-this.count.height/2); - const s=Math.floor(i.picks/3),e=i.picks%3?3-i.picks%3:0; - this.res.text=s?`→ ★${ - i.star+1} - × ${ - s} - ${ - e?` · ${ - e} - 개 더`:""} - `:e?`${ - e} - 개 더 고르면 ★${ - i.star+1} - `:`3개 → ★${ - i.star+1} - `,this.res.textColor=s?Dxi:e?16757611:Uxi,sRi(this.res,zHi-12-(this.count.x+this.count.width+12)),this.res.position.set(zHi-12-this.res.width,t-this.res.height/2)} - else t.items&&QHi(this.bg,-1,(t.last?XHi-2:XHi)+1,!1,!!t.last); - this.cells.forEach((i,s)=>{ - var e; - const n=null==(e=t.items)?void 0:e[s]; - i.root.visible=!!n,n&&i.card.set(n.it.id,n.it.star,void 0,{ - pick:n.picked?"on":"off",kept:n.kept} - )} - )} - } - ; - Qt(ZHi,"MergeRow"); - let tWi=ZHi; - const iWi=class extends Ke{ - constructor(){ - super(),Zt(this,"onClose",null),Zt(this,"bg",new ep),Zt(this,"back",new Ke),Zt(this,"title",Jxi("합성",Bxi,20)),Zt(this,"hint",Jxi("같은 부위 · 같은 별 3개 → 별 하나 위",Uxi,13,!1)),Zt(this,"quickChips",JHi.map(t=>new oRi(t.text,120,44,15))),Zt(this,"clearChip",new oRi("비우기",100,44,15)),Zt(this,"allChip",new oRi("다른 장비도 보기",200,44,15)),Zt(this,"list",new Ox(tWi,zHi,300,0)),Zt(this,"empty",Jxi("",Fxi,15,!1)),Zt(this,"barBg",new ep),Zt(this,"barN",Jxi("",Bxi,20)),Zt(this,"barSub",Jxi("",Uxi,14,!1)),Zt(this,"barKept",new Ke),Zt(this,"barGo",new cRi("합성",200,60,19)),Zt(this,"picked",[]),Zt(this,"quick",null),Zt(this,"only",null),Zt(this,"busy",!1),Zt(this,"sig",""),this.bg.eventMode="static"; - const t=(new ep).roundRect(0,0,48,48,12).fill(Ixi).moveTo(28,15).lineTo(19,24).lineTo(28,33).stroke({ - color:Bxi,width:3.5,cap:"round",join:"round"} - ); - t.eventMode="none",this.back.addChild(t),this.back.eventMode="static",this.back.cursor="pointer",this.back.hitArea=new $i(-6,-6,60,60),this.back.on("pointertap",t=>{ - t.stopPropagation(),queueMicrotask(()=>{ - var t; - return null==(t=this.onClose)?void 0:t.call(this)} - )} - ),this.back.position.set(0,2),this.title.position.set(62,12); - const i=(zHi-100-32)/3; - this.quickChips.forEach((t,s)=>{ - t.resize(i,44),t.position.set(s*(i+8),64),t.onTap=()=>this.pickQuick(JHi[s].q)} - ),this.clearChip.position.set(zHi-100,64),this.clearChip.onTap=()=>{ - this.picked=[],this.quick=null,YG("light"),this.render()} - ,this.allChip.position.set(0,64),this.allChip.onTap=()=>{ - this.only=null,this.render()} - ,this.list.y=120,this.empty.position.set(4,144),this.barBg.eventMode="none",this.barGo.onTap=()=>{ - this.merge()} - ,this.addChild(this.bg,this.back,this.title,this.hint,...this.quickChips,this.clearChip,this.allChip,this.list,this.empty,this.barBg,this.barN,this.barSub,this.barKept,this.barGo),this.visible=!1} - get isOpen(){ - return this.visible} - open(t){ - if(this.picked=[],this.quick=null,this.only=null,this.sig="",t){ - const i=vSi(t.id),s=ixi.getInstance().state.gearBox,e=new Set((null==s?void 0:s.kept)??[]),n=i&&kSi(s).find(s=>s.slot===i.slot&&s.star===t.star); - n&&(this.only={ - slot:n.slot,star:n.star} - ,this.picked=[t.uid,...n.list.filter(i=>i.uid!==t.uid&&!e.has(i.uid)).slice(0,2).map(t=>t.uid)])} - this.visible=!0,this.render(),this.list.showTopItem()} - close(){ - this.visible=!1,this.busy=!1} - update(){ - this.visible&&this.render()} - groups(){ - const t=kSi(ixi.getInstance().state.gearBox); - return this.only?t.filter(t=>t.slot===this.only.slot&&t.star===this.only.star):t} - pickQuick(t){ - var i; - const s=new Set((null==(i=ixi.getInstance().state.gearBox)?void 0:i.kept)??[]); - if(this.picked=[],this.quick===t)this.quick=null; - else{ - this.quick=t; - const i=JHi.find(i=>i.q===t).max; - for(const t of this.groups()){ - if(t.star>i)continue; - const e=t.list.filter(t=>!s.has(t.uid)); - this.picked.push(...e.slice(0,3*Math.floor(e.length/3)).map(t=>t.uid))} - } - YG("light"),this.render()} - toggle(t){ - const i=this.picked.indexOf(t); - i>=0?this.picked.splice(i,1):this.picked.push(t),this.quick=null,queueMicrotask(()=>{ - this.visible&&this.render()} - )} - plan(){ - const t=ixi.getInstance().state.gearBox,i=new Set((null==t?void 0:t.kept)??[]),s=new Map,e=[],n=new Map; - for(const r of this.picked){ - const i=null==t?void 0:t.items.find(t=>t.uid===r),e=i&&vSi(i.id); - if(!i||!e)continue; - const n=`${ - e.slot} - |${ - i.star} - `; - s.set(n,[...s.get(n)??[],r])} - let h=0; - for(const[r,o]of s){ - const t=Number(r.split("|")[1]); - for(let s=0; - s+3<=o.length; - s+=3){ - const r=o.slice(s,s+3); - e.push(r),h+=r.filter(t=>i.has(t)).length,n.set(t+1,(n.get(t+1)??0)+1)} - } - return{ - triples:e,made:n,kept:h} - } - render(){ - var t,i; - const s=ixi.getInstance().state.gearBox,e=APi.contentHeight,n=APi.OVERLAY_PAD,h=this.groups(),r=new Set(h.flatMap(t=>t.list.map(t=>t.uid))); - this.picked=this.picked.filter(t=>r.has(t)); - const o=new Set((null==s?void 0:s.kept)??[]),a=`${ - e} - |${ - null==(t=this.only)?void 0:t.slot} - ${ - null==(i=this.only)?void 0:i.star} - |${ - this.quick} - |${ - this.busy} - |${ - this.picked.join(",")} - |${ - [...o].join(",")} - |${ - h.map(t=>`${ - t.slot} - ${ - t.star} - :${ - t.list.map(t=>t.uid).join(".")} - `).join("/")} - `; - if(a===this.sig)return; - this.sig=a,this.bg.clear().rect(-n,0,zHi+2*n,e).fill(Oxi),sRi(this.hint,zHi-62-this.title.width-24),this.hint.position.set(zHi-this.hint.width-2,18),this.quickChips.forEach((t,i)=>{ - t.visible=!this.only,t.selected=this.quick===JHi[i].q,t.draw()} - ),this.clearChip.visible=!this.only,this.clearChip.enabled=this.picked.length>0,this.clearChip.draw(),this.allChip.visible=!!this.only; - const c=new Set(this.picked),l=[],u=Qt(t=>this.toggle(t),"onPick"); - for(const w of h){ - l.push({ - head:{ - slot:w.slot,star:w.star,n:w.list.length,picks:w.list.filter(t=>c.has(t.uid)).length} - } - ); - for(let t=0; - t<w.list.length; - t+=6)l.push({ - items:w.list.slice(t,t+6).map(t=>({ - it:t,picked:c.has(t.uid),kept:o.has(t.uid)} - )),last:t+6>=w.list.length,onPick:u} - )} - this.list.visible=l.length>0,this.empty.visible=!l.length,this.empty.text="합성할 장비가 없어요\n같은 부위 · 같은 별 장비가 3개 모이면 여기에 나와요 (장착한 것은 빼고)",this.empty.setWrapWidth(zHi-8),this.list.setListHeight(Math.max(60,e-120-92-8),!1),this.list.dataProvider=l; - const d=e-92,f=this.plan(),p=f.triples.length; - if(this.barBg.clear().rect(-n,d,zHi+2*n,92).fill(Vxi),this.barN.text=p?`합성 ${ - p} - 번`:"골라 주세요",this.barN.textColor=p?Bxi:Uxi,this.barN.position.set(4,d+14),this.barSub.text=p?`장비 ${ - 3*p} - 개 → ${ - [...f.made.entries()].sort((t,i)=>t[0]-i[0]).map(([t,i])=>`★${ - t} - ${ - i} - `).join(" · ")} - `:"칸을 누르거나 위에서 한꺼번에",this.barSub.textColor=p?Dxi:Fxi,sRi(this.barSub,zHi-230-(f.kept?56:0)),this.barSub.position.set(4,d+52),this.barKept.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),f.kept){ - const t=Jxi(`${ - f.kept} - `,lHi,15),i=uHi(new ep,9,9,8).fill(lHi); - t.position.set(22,(18-t.height)/2),this.barKept.addChild(i,t),this.barKept.position.set(this.barSub.x+this.barSub.width+12,d+53)} - this.barGo.position.set(zHi-200,d+16),this.barGo.enabled=p>0&&!this.busy} - async merge(){ - var t; - const i=this.plan().triples; - if(!i.length||this.busy)return; - this.busy=!0,this.render(); - const s=await ixi.getInstance().gearMergeGroups(i); - if(this.busy=!1,s.message||!s.result)return bH.getInstance().showMessage(s.message??"합성하지 못했어요"),this.sig="",void this.render(); - YG("success"),null==(t=this.onClose)||t.call(this),CHi.open(s.result,"합성 결과")} - } - ; - Qt(iWi,"FishingGearMergeView"); - let sWi=iWi; - const eWi=(APi.CONTENT_W-12)/2,nWi={ - boat:"boat",line:"spool",rod:"rod",reel:"reel",bobber:"bobber",icebox:"keepnet",auto:"autorod"} - ,hWi=XTi.filter(t=>"boat"!==t.key),rWi=["boat","bag","chest","tools"],oWi=["내 배","가방","상자","도구"]; - function aWi(){ - const t=eWi-24,i=new cRi("",t,46),s=Jxi("올리기",Gxi,16),e=pRi("gold",18),n=Jxi("",Gxi,16); - return i.addChild(s,e,n),{ - btn:i,set:Qt((h,r,o=!1)=>{ - const a=r<h; - i.enabled=!a&&!o; - const c=i.enabled?Gxi:Kxi; - s.textColor=c,n.text=h.toLocaleString(),n.textColor=a?Hxi:c; - const l=s.width+10+18+5+n.width,u=(t-l)/2; - s.position.set(u,(46-s.height)/2),e.position.set(u+s.width+10,14),n.position.set(e.x+18+5,(46-n.height)/2)} - ,"set")} - } - function cWi(t,i,s){ - const e=XTi.find(i=>i.key===t).effects.map(String),n=Qt((t,i)=>{ - var s; - return(null==(s=i.exec(t))?void 0:s[1])??""} - ,"m"),h=Qt((t,e)=>i===s?`${ - t} - `:`${ - t} - → ${ - e} - `,"values"); - switch(t){ - case"line":return["줄 힘",`${ - h(i+1,s+1)} - ${ - s===e.length-1?" · 고래도!":""} - `]; - case"rod":return["버티는 힘 · 큰 개체",`${ - h(i+1,s+1)} - · ${ - h(n(e[i],/([\d.]+%)/),n(e[s],/([\d.]+%)/))} - `]; - case"reel":return["입질 속도",`${ - h(n(e[i],/(×[\d.]+)/),n(e[s],/(×[\d.]+)/))} - ${ - /심해/.test(e[s])?" · 심해 입장":""} - `]; - case"bobber":return["입질 · 귀한",`${ - h(n(e[i],/입질 (×[\d.]+)/),n(e[s],/입질 (×[\d.]+)/))} - · ${ - h(n(e[i],/귀한 물고기 (×[\d.]+)/),n(e[s],/귀한 물고기 (×[\d.]+)/))} - ${ - /심해/.test(e[s])?" · 심해":""} - `]; - case"icebox":return["어망",`${ - h(n(e[i],/(\d+)마리/),n(e[s],/(\d+)마리/))} - 마리`]; - case"auto":return["꺼 둔 동안",`입질 ${ - h(FAi(i),FAi(s))} - 번에 1마리`]; - default:return["",""]} - } - Qt(aWi,"toolButton"),Qt(cWi,"toolEffect"); - const lWi=class t extends Ke{ - constructor(){ - super(),Zt(this,"tabId","gear"),Zt(this,"myBoat",new $Hi),Zt(this,"bag",new VHi),Zt(this,"chest",new KHi),Zt(this,"mergeView",new sWi),Zt(this,"tools",new Ke),Zt(this,"toolsHead",new RHi),Zt(this,"rows",[]),Zt(this,"busy",!1); - const i=this.tools; - this.toolsHead.set("낚시 도구","올리면 바로 세져요"),i.addChild(this.toolsHead),hWi.forEach((t,s)=>{ - const e=new Ke; - e.position.set(s%2*(eWi+12),66+262*Math.floor(s/2)); - const n=(new ep).roundRect(0,0,eWi,250,16).fill(Dxi); - n.alpha=0,n.eventMode="none"; - const h=(new ep).roundRect((eWi-88)/2,14,88,88,16).fill(kxi); - h.eventMode="none"; - const r=mRi(nWi[t.key],46,Bxi); - r.pivot.set(23,23),r.position.set(eWi/2,58); - const o=new Xe(ls.EMPTY); - o.anchor.set(.5),o.position.set(eWi/2,58),o.eventMode="none"; - const a=Jxi("",Bxi,18); - a.y=112; - const c=new ep; - c.eventMode="none",c.y=142; - const l=new Ke,u=Jxi("",Uxi,14,!1),d=Jxi("",Dxi,16); - l.addChild(u,d),l.y=158; - const f=aWi(); - f.btn.position.set(12,192),f.btn.onTap=()=>{ - this.upgrade(t.key,s)} - ; - const p=dRi("최고 단계",Dxi,3813920,15,14); - p.position.set((eWi-p.width)/2,215-p.height/2),e.addChild(eRi(eWi,250,Ixi,null,16),n,h,r,o,a,c,l,f.btn,p),i.addChild(e),this.rows.push({ - key:t.key,root:e,flash:n,icon:r,img:o,name:a,pips:c,fxLine:l,effect:u,fx:d,up:f,max:p} - )} - ),this.bag.onMerge=()=>this.openMerge(),this.mergeView.onClose=()=>this.closeMerge(),this.addChild(this.myBoat,this.bag,this.chest,this.tools,this.mergeView),this.setMode(t.mode)} - static getInstance(){ - return this.instance??(this.instance=new t)} - get scrollInShell(){ - return!this.mergeView.isOpen} - onShow(){ - this.update()} - onHide(){ - this.chest.stop(),this.mergeView.isOpen&&(this.mergeView.close(),this.bag.visible="bag"===t.mode)} - closeOne(){ - return!!this.mergeView.isOpen&&(this.closeMerge(),!0)} - openMerge(i){ - "bag"!==t.mode&&this.setMode("bag"),this.bag.visible=!1,this.mergeView.open(i); - const s=APi.getInstance(); - s.refreshSub(),s.resetScroll()} - closeMerge(){ - this.mergeView.isOpen&&(this.mergeView.close(),this.bag.visible="bag"===t.mode,APi.getInstance().refreshSub(),this.update())} - subTabs(){ - if(this.mergeView.isOpen)return null; - const i=ixi.getInstance().state,s=i.gearBox,e=bSi(i.gear.boat),n=VAi.some(t=>!!OSi(s,t,e)),h=ISi(s).some(t=>t.n>=3); - return{ - items:oWi,index:rWi.indexOf(t.mode),dots:[n,h,!1,!1]} - } - selectSub(t){ - this.setMode(rWi[t]??"boat")} - showMode(t,i){ - "bag"===t&&(this.bag.filter=i??null),this.setMode(t); - const s=APi.getInstance(); - s.refreshSub(),s.resetScroll()} - focusTool(t){ - var i; - if("boat"===t)return this.setMode("boat"),APi.getInstance().refreshSub(),this.myBoat.upgradeButton; - const s="line"===t||"rod"===t?"rod":"reel"===t||"bobber"===t?"bobber":"icebox"===t?"net":null; - return s?(this.setMode("boat"),APi.getInstance().refreshSub(),this.myBoat.slotNode(s)):(this.setMode("tools"),APi.getInstance().refreshSub(),(null==(i=this.rows.find(i=>i.key===t))?void 0:i.up.btn)??null)} - setMode(i){ - this.mergeView.isOpen&&"bag"!==i&&(this.mergeView.close(),APi.getInstance().refreshSub()),t.mode=i,this.myBoat.visible="boat"===i,this.bag.visible="bag"===i&&!this.mergeView.isOpen,this.chest.visible="chest"===i,this.tools.visible="tools"===i,"chest"!==i&&this.chest.stop(),this.update()} - async upgrade(t,i){ - if(this.busy)return; - const s=ixi.getInstance(),e=hWi[i]; - let n; - this.busy=!0,this.update(); - try{ - n=await s.upgrade(t)} - finally{ - this.busy=!1,this.update()} - if(n)return void bH.getInstance().showMessage(n); - bH.getInstance().showMessage(`${ - e.title} - : ${ - e.names[s.state.gear[t]]} - (으)로 올렸어요`),YG("success"),QG.getInstance().playSFX(QG.SFX_LEVEL_UP); - const h=this.rows[i]; - yx.fromTo(h.flash,{ - alpha:.35} - ,{ - alpha:0,duration:.6,ease:"power2.out"} - ),this.update(); - const r=h.img.visible?h.img:h.icon,o=h.img.visible?80/Math.max(h.img.texture.width,h.img.texture.height):1; - yx.killTweensOf(r.scale),yx.killTweensOf(r),yx.fromTo(r.scale,{ - x:1.35*o,y:1.35*o} - ,{ - x:o,y:o,duration:.45,ease:"back.out(3)"} - ),yx.fromTo(r,{ - rotation:-.25} - ,{ - rotation:0,duration:.45,ease:"back.out(3)"} - )} - update(){ - const i=t.mode; - if("boat"===i)return void this.myBoat.update(); - if("bag"===i)return void(this.mergeView.isOpen?this.mergeView.update():this.bag.update()); - if("chest"===i)return void this.chest.update(); - const s=ixi.getInstance().state,e=s.gear; - hWi.forEach((t,i)=>{ - const n=this.rows[i],h=e[t.key],r=t.prices.length-1,o=h>=r,a=o?h:h+1; - n.icon.tint=o?Dxi:16777215; - const c=NAi.toolIcon(t.key,a); - n.img.visible=!!c,n.icon.visible=!c,c&&n.img.texture!==c&&(n.img.texture=c,n.img.scale.set(80/Math.max(c.width,c.height))),n.name.text=t.names[a],sRi(n.name,eWi-24),n.name.x=(eWi-n.name.width)/2,n.pips.clear(); - const l="auto"===t.key?1:0,u=r-l+1; - for(let s=l; - s<=r; - s++){ - const t=20*(s-l); - s<=h?n.pips.roundRect(t,0,16,7,3.5).fill(Dxi):s===h+1?n.pips.roundRect(t+.75,.75,14.5,5.5,2.75).stroke({ - color:Dxi,width:1.5} - ):n.pips.roundRect(t,0,16,7,3.5).fill(xxi)} - n.pips.x=(eWi-(16*u+4*(u-1)))/2; - const[d,f]=cWi(t.key,h,a); - n.effect.text=d,n.fx.text=f,n.fxLine.scale.set(1),n.fx.position.set(n.effect.width+6,(n.effect.height-n.fx.height)/2),n.fxLine.scale.set(Math.min(1,(eWi-24)/Math.max(1,n.fxLine.width))),n.fxLine.x=(eWi-n.fxLine.width)/2,n.up.btn.visible=!o,n.max.visible=o,o||n.up.set(t.prices[h+1],s.gold,this.busy)} - )} - } - ; - Qt(lWi,"FishingGearPage"),Zt(lWi,"instance"),Zt(lWi,"mode","boat"); - let uWi=lWi; - const dWi=Object.freeze(Object.defineProperty({ - __proto__:null,FishingGearPage:uWi} - ,Symbol.toStringTag,{ - value:"Module"} - )),fWi=430,pWi=Qt((t,i,s,e,n=16,h=Bxi,r=fWi-s)=>{ - const o=Jxi(i,h,n); - return sRi(o,r),o.position.set(s,e),t.addChild(o),o} - ,"qText"),wWi=Qt((t,i,s,e,n=16,h=Bxi,r=fWi)=>{ - const o=pWi(t,i,0,e,n,h,r); - return o.x=s-o.width/2,o} - ,"qCenter"); - function gWi(t,i,s,e,n,h=n){ - if(!i)return null; - const r=new Xe(i); - return r.anchor.set(.5),r.scale.set(Math.min(n/i.width,h/i.height)),r.position.set(s,e),r.eventMode="none",t.addChild(r),r} - function mWi(t,i,s,e,n=1){ - const h=gWi(t,NAi.menuIcon("quest"),i,s,e); - if(h&&1!==n){ - const t=new Ef,i=2===n?[.83,.89,1]:[1,.66,.36]; - t.matrix=[.3*i[0],.59*i[0],.11*i[0],0,0,.3*i[1],.59*i[1],.11*i[1],0,0,.3*i[2],.59*i[2],.11*i[2],0,0,0,0,0,1,0],h.filters=[t]} - } - function vWi(t,i,s,e,n,h=2368554,r=null){ - const o=eRi(e,n,h,r,14); - return o.position.set(i,s),t.addChild(o),o} - function _Wi(t,i,s,e,n,h){ - const r=new Ke; - return r.position.set(i,s),r.hitArea=new $i(0,0,e,n),r.eventMode="static",r.cursor="pointer",r.on("pointertap",t=>{ - t.stopPropagation(),queueMicrotask(h)} - ),t.addChild(r),r} - function MWi(t,i,s,e,n,h,r,o=!0,a=!0){ - o&&a&&vWi(t,s,e+4,n,h,9397287); - const c=new cRi(i,n,h,h>=44?19:14); - return c.position.set(s,e),c.setPrimary(o),c.enabled=a,c.onTap=()=>queueMicrotask(r),t.addChild(c),c} - function bWi(t,i,s,e,n=17,h="pearl"){ - const r=pRi(h,n); - r.position.set(s,e+2),t.addChild(r),pWi(t,i.toLocaleString(),s+n+7,e,n,"gold"===h?Dxi:Wxi)} - Qt(gWi,"qArt"),Qt(mWi,"qCup"),Qt(vWi,"qBox"),Qt(_Wi,"qTap"),Qt(MWi,"qButton"),Qt(bWi,"qMoney"); - const yWi=class extends Ke{ - constructor(){ - super(),Zt(this,"canvas",new Ke),Zt(this,"signature",""),Zt(this,"busy",!1),Zt(this,"logicalHeight",530),this.y=48,this.addChild(this.canvas)} - paint(t,i){ - const s=APi.contentHeight,e=Math.min(APi.CONTENT_W/fWi,s/530); - this.logicalHeight=s/e,t=`${ - s} - :${ - t} - `,this.canvas.scale.set(e),this.canvas.x=(APi.CONTENT_W-fWi*e)/2,this.signature!==t&&(this.signature=t,this.canvas.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),i())} - } - ; - Qt(yWi,"QuestCanvas"); - let EWi=yWi; - const AWi=class t extends Ke{ - constructor(t,i,s){ - super(),Zt(this,"shade",new ep),Zt(this,"card",new Ke),Zt(this,"page",0),this.title=t,this.rows=i,this.action=s,this.addChild(this.shade,this.card),this.shade.eventMode="static",this.shade.on("pointertap",t=>{ - t.stopPropagation(),queueMicrotask(()=>this.close())} - ),this.card.eventMode="static",this.card.on("pointertap",t=>t.stopPropagation())} - static open(i,s,e){ - var n; - null==(n=this.current)||n.close(); - const h=new t(i,s,e); - this.current=h,APi.getInstance().overlay.addChild(h),h.layout()} - close(){ - t.current===this&&(t.current=null),this.destroyed||this.destroy({ - children:!0} - )} - closeOne(){ - return this.close(),!0} - layout(){ - this.card.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const t=APi.contentHeight,i=APi.CONTENT_W,s=APi.OVERLAY_PAD; - this.shade.clear().rect(-s,0,i+2*s,t).fill({ - color:0,alpha:Nxi} - ); - const e=Math.min(i/430,t/480),n=Math.max(2,Math.min(6,Math.floor((t/e-146)/74))),h=Math.max(1,Math.ceil(this.rows.length/n)); - this.page=Math.min(this.page,h-1); - const r=this.rows.slice(this.page*n,(this.page+1)*n),o=72+74*Math.max(1,r.length)+(h>1||this.action?64:18); - this.card.scale.set(e),this.card.position.set((i-398*e)/2,Math.max(0,(t-o*e)/2)),this.card.hitArea=new $i(0,0,398,o),vWi(this.card,0,0,398,o,Rxi),pWi(this.card,this.title,20,20,22,Bxi,310),MWi(this.card,"×",344,13,40,40,()=>this.close(),!1),r.length||wWi(this.card,"아직 기록이 없어요",199,92,16,Uxi),r.forEach((t,i)=>{ - const s=68+74*i,e=t.action?254:350; - if(vWi(this.card,14,s,370,68,t.me?jxi:Pxi),pWi(this.card,t.title,25,s+8,16,t.me?Dxi:Bxi,e),t.detail){ - const i=pWi(this.card,t.detail,25,s+31,12,Uxi,e); - i.scale.set(1),i.setWrapWidth(e)} - t.reward&&pWi(this.card,t.reward,25,s+49,12,Dxi,e),t.action&&MWi(this.card,t.button??"받기",295,s+18,76,34,()=>{ - this.close(),t.action()} - )} - ); - const a=o-53; - h>1?(MWi(this.card,"‹",20,a,54,38,()=>{ - this.page--,this.layout()} - ,!1,this.page>0),wWi(this.card,`${ - this.page+1} - / ${ - h} - `,199,a+8,15,Uxi),MWi(this.card,"›",324,a,54,38,()=>{ - this.page++,this.layout()} - ,!1,this.page<h-1)):this.action&&MWi(this.card,this.action.text,20,a,358,42,()=>{ - this.close(),this.action.run()} - )} - } - ; - Qt(AWi,"QuestDetails"),Zt(AWi,"current",null); - let SWi=AWi; - const TWi={ - dex:"도감 수집가",sales:"노련한 상인",help:"든든한 이웃"} - ,CWi=Qt(t=>t>=1e4?+(t/1e4).toFixed(1)+"만":t.toLocaleString(),"short"),OWi=class extends EWi{ - render(){ - var t; - const i=ixi.getInstance(),s=i.milestoneRows(),e=[...(null==(t=i.life)?void 0:t.cups)??[],...i.state.cups]; - this.paint(JSON.stringify([s,e,this.busy]),()=>{ - const t=this.canvas,i=this.logicalHeight-530,n=120+.25*i,h=181+.25*i,r=72+.1*i,o=s.filter(t=>!t.claimed&&t.progress>=t.need).reduce((t,i)=>t+i.pearl,0); - pWi(t,"업적",8,6,25),MWi(t,"내 기록 ›",321,3,101,36,()=>this.records(),!1),vWi(t,6,49,418,n,Ixi); - for(const[s,a]of[2,1,3].entries()){ - const n=88+127*s; - mWi(t,n,(1===a?99:108)+.12*i,(1===a?96:76)+.14*i,a),wWi(t,`× ${ - e.filter(t=>t.rank===a).length} - `,n,142+.25*i,18,1===a?Dxi:Bxi),_Wi(t,n-48,55,96,108+.25*i,()=>SWi.open("대회 트로피 · 누적",e.filter(t=>t.rank===a).map(t=>({ - title:`${ - t.rank} - 위 · ${ - t.title} - `,detail:t.record} - ))))} - vWi(t,6,h,418,r,o?jxi:Ixi,o?7822901:null),gWi(t,NAi.gearChest(!!o),50,h+r/2,80+.05*i),pWi(t,o?"모아 둔 보상":"다음 메달을 향해!",95,h+r/2-26,13,Uxi),o?bWi(t,o,97,h+r/2-1,19):pWi(t,"도전은 계속된다",95,h+r/2+1,17,Bxi,180),MWi(t,"모두 받기",298,h+(r-38)/2,110,38,()=>{ - this.claim()} - ,!0,!this.busy&&!!o),["dex","sales","help"].forEach((e,n)=>{ - const h=s.filter(t=>t.kind===e),r=h.find(t=>!t.claimed)??h[h.length-1],o=h.every(t=>t.claimed),a=70+.65*i/3,c=266+.35*i+n*(a+8),l=c+(a-70)/2,u=!o&&r.progress>=r.need; - vWi(t,6,c,418,a,Ixi); - const d=(new ep).poly([26,l+47,20,l+70,39,l+62,56,l+70,51,l+47]).fill(12143441).circle(39,l+29,27).fill(9136180).circle(39,l+27,23).fill(14858582).circle(39,l+27,18).fill(8217404); - t.addChild(d); - const f="dex"===e?NAi.menuIcon("map"):"sales"===e?NAi.menuIcon("shop"):NAi.boatGearIcon(XAi,0); - gWi(t,f,39,l+25,44),pWi(t,TWi[e],81,l+9,17,Bxi,212),pWi(t,"›",273,l+10,17,Uxi),_Wi(t,6,c,288,a,()=>this.stages(e)); - const p="sales"===e?`${ - CWi(r.progress)} - / ${ - CWi(r.need)} - `:`${ - r.progress} - / ${ - r.need} - ${ - "dex"===e?"종":"번"} - `; - pWi(t,o?"모든 메달 달성!":p,81,l+34,13,o?Dxi:Uxi,200); - const w=new ep; - fRi(w,81,l+57,202,5,Math.min(1,r.progress/r.need),u||o?Dxi:6925487),t.addChild(w),o||bWi(t,r.pearl,303,l+8,13),u?MWi(t,"받기",304,l+31,104,30,()=>{ - this.claim(r)} - ,!0,!this.busy):wWi(t,o?"✓ 완료":"도전 중",356,l+39,13,o?Dxi:Fxi)} - ),MWi(t,`달성한 메달 ${ - s.filter(t=>t.claimed).length} - ›`,103,507+i,224,23,()=>SWi.open("달성한 메달",s.filter(t=>t.claimed).map(t=>({ - title:TWi[t.kind],detail:t.label,reward:`진주 ${ - t.pearl.toLocaleString()} - · 수령 완료`} - ))),!1)} - )} - stages(t){ - SWi.open(`${ - TWi[t]} - · 이번 회차`,ixi.getInstance().milestoneRows().filter(i=>i.kind===t).map(t=>({ - title:t.label,detail:t.claimed?"수령 완료":`${ - t.progress.toLocaleString()} - / ${ - t.need.toLocaleString()} - `,reward:`진주 ${ - t.pearl.toLocaleString()} - `,action:!this.busy&&!t.claimed&&t.progress>=t.need?()=>{ - this.claim(t)} - :void 0} - )))} - async claim(t){ - if(!this.busy){ - this.busy=!0,this.render(); - try{ - const i=ixi.getInstance(),s=i.state.pearl,e=t?await i.claimMilestone(t.kind,t.idx):await i.claimAllMilestones(); - bH.getInstance().showMessage(e??`진주 +${ - Math.max(0,i.state.pearl-s).toLocaleString()} - `)} - catch{ - bH.getInstance().showMessage("연결을 확인하고 다시 받아 주세요")} - finally{ - this.busy=!1,this.render()} - } - } - records(){ - var t,i; - const s=ixi.getInstance(),e=s.records(); - SWi.open("내 기록",[{ - title:"총 포획 · 이번 회차",detail:`${ - e.total.toLocaleString()} - 마리`} - ,{ - title:"도감 · 이번 회차",detail:`${ - e.kinds} - / 192종 · 최고 ★${ - e.topStar} - · 왕 크기 ${ - e.sCount} - 종`} - ,{ - title:"판매 · 이번 회차",detail:`${ - s.state.sales.toLocaleString()} - G`} - ,{ - title:"가장 무거운 한 마리 · 이번 회차",detail:e.heaviest?`${ - DTi(e.heaviest.id).name} - · ${ - TCi(e.heaviest.kg)} - `:"아직 기록이 없어요"} - ,{ - title:"평생 도감 · 누적",detail:`${ - new Set([...Object.keys((null==(t=s.life)?void 0:t.dex)??{ - } - ),...Object.keys(s.state.dex)]).size} - / ${ - RTi.length} - 종`} - ,{ - title:"수리 도움 · 이번 회차",detail:`${ - (null==(i=s.state.boat)?void 0:i.helped)??0} - 번`} - ])} - } - ; - Qt(OWi,"FishingAchievementPanel"); - let IWi=OWi; - const kWi={ - weight:33,rarity:47,giant:10,count:49} - ,xWi={ - weight:"kg",rarity:"★★★",giant:"S",count:"+ +"} - ,RWi={ - weight:"어떤 어종이든 가장 무거운 한 마리로 겨뤄요.",rarity:"별 → 크기 등급 → 크기 비율 순으로 겨뤄요.",giant:"같은 종 안에서의 크기 비율로 겨뤄요. 작살 사냥과는 별개예요.",count:"참가한 뒤 잡은 모든 물고기의 마릿수를 더해요."} - ,PWi=class extends EWi{ - constructor(){ - super(...arguments),Zt(this,"selected","weight"),Zt(this,"dismissed",new Set),Zt(this,"clockLabel",null),Zt(this,"endAt",0)} - render(){ - var t,i,s; - const e=ixi.getInstance(),n=e.social,h=(null==n?void 0:n.enabled)?e.realNow():e.now(),r=(null==n?void 0:n.enabled)?n.board:null,o=e.state.contest,a=!!o&&!o.claimed&&h>=o.endAt,c=!o||o.claimed||a||r&&!r.final?null:o,l=null==(t=null==n?void 0:n.rewards)?void 0:t.find(t=>{ - var i; - return"contest"===t.source&&t.seasonId===(null==(i=e.season)?void 0:i.id)&&null===t.claimedAt&&!this.dismissed.has(t.id)} - ),u=r&&!r.final?r:null,d=c?e.contestStanding():null,f="open"===e.phase()&&((null==n?void 0:n.enabled)?!0===n.canJoin&&(null==(i=e.state.social)?void 0:i.legacyDate)!==n.date:(!o||(o.claimed||a)&&YCi(o.startAt)!==YCi(h))&&(!(null==(s=e.season)?void 0:s.endAt)||h+432e5<=e.season.endAt)),p=e.claimableSocialIds().length+(a?1:0),w=JSON.stringify([this.selected,this.busy,u,l,c,null==d?void 0:d.rows,f,p,e.phase(),!!u&&h>=(u.myEndAt??u.endAt),c&&h>=c.endAt,[...this.dismissed]]); - this.paint(w,()=>{ - this.clockLabel=null,this.endAt=0; - const t=this.canvas; - pWi(t,"낚시 대회",8,6,25),vWi(t,282,5,140,29,Ixi),wWi(t,"하루 1회 "+(f?"1/1":"0/1"),352,11,13,f?Dxi:Uxi),u?this.live(u,h):c&&d?this.legacy(c,d,h):l?this.result(l,f):this.choose(f,h),MWi(t,u?"전체 순위 ›":l&&f&&!c?"새 대회 고르기 ›":"지난 기록 ›",8,this.logicalHeight-33,176,32,()=>{ - u?this.ranking(u):l&&f&&!c?(this.dismissed.add(l.id),this.render()):this.history()} - ,!1),MWi(t,p?`받을 보상 ${ - p} - ›`:"대회 안내 ?",230,this.logicalHeight-33,192,32,()=>p?this.rewards():this.info(),!1)} - ),this.clockLabel&&(this.clockLabel.text=this.endAt>h?`${ - wRi(this.endAt-h)} - 남음`:"기록 집계 중",this.clockLabel.x=(430-this.clockLabel.width)/2)} - fish(t,i,s,e,n=e){ - const h=this.canvas; - "count"===t?(gWi(h,NAi.fish(49),i-.15*e,s-.1*n,.65*e,.8*n),gWi(h,NAi.fish(63),i+.24*e,s+.14*n,.42*e,.6*n),gWi(h,NAi.fish(61),i-.26*e,s+.26*n,.32*e,.45*n)):gWi(h,NAi.fish(kWi[t]),i,s,e,n)} - choose(t,i){ - const s=this.canvas,e=this.logicalHeight-530,n=166+.14*e,h=111+.43*e,r=.07*e; - if(mWi(s,93,100+r,116+Math.min(24,r)),pWi(s,"오늘은 내가",164,57+r,24),pWi(s,"낚시왕!",164,85+r,34,Dxi),pWi(s,"도전할 대회를 골라봐!",164,128+r,14,Uxi),xCi.forEach((t,i)=>{ - const e=8+i%2*212,r=n+Math.floor(i/2)*(h+11),o=t.id===this.selected; - vWi(s,e,r+3,202,h,921104),vWi(s,e,r,202,h,o?jxi:Ixi,o?Dxi:Lxi),this.fish(t.id,e+98,r+(h-24)/2,Math.min(184,1.3*h),h-27),pWi(s,xWi[t.id],e+13,r+10,"rarity"===t.id?13:17,o?Dxi:Uxi,66),o&&(s.addChild((new ep).circle(e+180,r+15,10).fill(Dxi)),wWi(s,"✓",e+180,r+7,14,Gxi,18)),wWi(s,t.title,e+101,r+h-26,18),_Wi(s,e,r,202,h,()=>{ - this.selected=t.id,this.render()} - )} - ),wWi(s,RCi(1,this.selected).desc,202,414+e,14,Uxi,335),MWi(s,"?",382,406+e,38,34,()=>this.info(this.selected),!1),MWi(s,t?"도전!":"open"!==ixi.getInstance().phase()?"이번 회차 종료":"오늘의 도전 완료",8,448+e,414,40,()=>this.confirm(),!0,t&&!this.busy),!t&&"open"===ixi.getInstance().phase()){ - const t=ixi.getInstance().social,n=(null==t?void 0:t.endAt)??864e5*(Math.floor(i/864e5)+1); - wWi(s,(null==t?void 0:t.joinedToday)||!(null==t?void 0:t.enabled)?`다음 참가 ${ - new Date(n).toLocaleTimeString([],{ - hour:"2-digit",minute:"2-digit"} - )} - `:"회차 마감 전에는 새 대회를 열 수 없어요",215,431+e,11,Fxi)} - } - confirm(){ - const t=this.selected; - SWi.open(RCi(1,t).title,[{ - title:"오늘의 도전 1회",detail:"시작하면 오늘은 다른 종목으로 바꿀 수 없어요."} - ,{ - title:"참가한 순간부터 12시간",detail:"참가 후 잡은 물고기만 기록돼요. 날짜가 바뀌어도 이어져요."} - ,{ - title:"이렇게 겨뤄요",detail:RWi[t]} - ],{ - text:"도전 시작!",run:Qt(()=>{ - this.perform(async()=>{ - var i; - const s=ixi.getInstance(); - if(null==(i=s.social)?void 0:i.enabled)return s.joinSocial(t); - const e=s.state.contest,n=e&&!e.claimed&&s.now()>=e.endAt?await s.claimContest():null,h=await s.joinContest(t); - return!h&&n&&bH.getInstance().showMessage(`지난 대회 ${ - n.rank} - 위 보상도 받았어요 · 진주 ${ - n.pearl} - `),h} - ,"대회 시작! 낚시하러 가자!")} - ,"run")} - )} - live(t,i){ - const s=RCi(t.day,t.contestId),e=t.rows.find(t=>t.me),n=t.myEndAt??t.endAt,h=this.canvas,r=this.logicalHeight-530; - wWi(h,s.title,215,53,24,Dxi),this.endAt=n,this.clockLabel=wWi(h,"",215,85,13,Uxi),t.contestId?this.fish(t.contestId,215,173+.28*r,244+Math.min(50,.15*r),148+.3*r):mWi(h,215,176+.28*r,148+Math.min(60,.2*r)),wWi(h,NCi(s,(null==e?void 0:e.score)??0),215,242+.52*r,"star"===s.kind?27:36),wWi(h,`${ - (null==e?void 0:e.rank)?`${ - e.rank} - 위`:"기록 없음"} - / ${ - t.count} - 명`,215,291+.6*r,18,Dxi),vWi(h,8,328+r,414,94,Ixi),t.rows.slice(0,3).forEach((t,i)=>{ - const e=338+r+26*i; - pWi(h,t.rank?`${ - t.rank} - `:"—",23,e,15,Dxi),pWi(h,t.name+(t.me?" · 나":""),53,e,14,t.me?Dxi:Bxi,212),pWi(h,NCi(s,t.score),278,e,14,Uxi,127)} - ),_Wi(h,8,328+r,414,94,()=>this.ranking(t)),MWi(h,"낚시하러 가자!",8,448+r,414,40,()=>{ - APi.getInstance().selectTab("fish")} - ,!0),wWi(h,i<n?"참가 후 잡은 물고기만 기록돼요":"약 2~7분 뒤 순위가 확정돼요",215,430+r,11,Fxi)} - ranking(t){ - const i=RCi(t.day,t.contestId); - SWi.open(`${ - i.title} - · ${ - t.final?"최종":"현재"} - 순위`,t.rows.map(s=>({ - title:`${ - s.rank?`${ - s.rank} - 위`:"—"} - · ${ - s.name} - ${ - s.me?" · 나":""} - `,detail:NCi(i,s.score),reward:s.rank?`${ - t.final?"":"예상 "} - 진주 ${ - qCi(s.rank)} - `:"기록을 남기면 순위에 올라요",me:s.me} - )))} - result(t,i){ - var s; - const e=this.canvas,n=this.logicalHeight-530; - wWi(e,t.contest?RCi(t.contest.day,t.contest.contestId).title:t.title,215,56,23,Dxi),mWi(e,215,183+.3*n,215+Math.min(50,.15*n),t.rank<=3&&t.rank>0?t.rank:1),wWi(e,t.rank?`${ - t.rank} - 위!`:"도전 완료!",215,279+.55*n,39,Dxi),wWi(e,(null==(s=t.contest)?void 0:s.record)??"기록 없음",215,334+.65*n,24),vWi(e,94,378+1*n,242,49,jxi),pWi(e,"보상",117,393+1*n,14,Uxi),bWi(e,t.rankPearl+t.participationPearl,207,390+1*n,22),MWi(e,"보상 받기",8,448+n,414,40,()=>{ - this.perform(()=>ixi.getInstance().claimSocial([t.id]),"대회 보상을 받았어요!")} - ,!0,!this.busy),_Wi(e,94,49,242,375,()=>{ - var i,s; - const e=ixi.getInstance(),n=[null==(i=e.social)?void 0:i.board,...(null==(s=e.social)?void 0:s.past)??[]].find(i=>(null==i?void 0:i.id)===t.sourceId); - n?this.ranking(n):this.history()} - )} - legacy(t,i,s){ - const e={ - id:"legacy",day:t.day,contestId:t.contestId,date:YCi(t.startAt),group:t.room,endAt:t.endAt,count:i.rows.length,final:i.ended,rows:i.rows.map((t,i)=>({ - ...t,userId:String(i),rank:i+1,scoreAt:0,order:i} - ))} - ; - if(!i.ended)return void this.live(e,s); - const n=this.canvas,h=this.logicalHeight-530,r=RCi(t.day,t.contestId); - wWi(n,r.title,215,57,23,Dxi),mWi(n,215,185+.3*h,220+Math.min(50,.15*h),i.myRank<=3?i.myRank:1),wWi(n,`${ - i.myRank} - 위!`,215,280+.55*h,39,Dxi),wWi(n,NCi(r,t.my),215,336+.65*h,25),bWi(n,LCi(i.myRank),170,389+1*h,22),MWi(n,"보상 받기",8,448+h,414,40,()=>{ - this.claimLegacy()} - ,!0,!this.busy),MWi(n,"전체 순위 ›",131,424+h,168,22,()=>SWi.open(r.title,i.rows.map((t,i)=>({ - title:`${ - i+1} - 위 · ${ - t.name} - `,detail:NCi(r,t.score),me:t.me} - ))),!1)} - info(t){ - SWi.open(t?RCi(1,t).title:"대회 안내",[...t?[{ - title:"승부 기준",detail:RWi[t]} - ]:[],{ - title:"매일 원하는 종목으로",detail:"서버 날짜(UTC 0시)마다 전체 종목 중 한 번 참가해요."} - ,{ - title:"12시간 동안 낚시!",detail:"직접 잡기·자동 낚시 모두 집계해요. 같은 점수는 먼저 기록한 순서예요."} - ,{ - title:"최대 30명과 승부",detail:"같은 종목에 비슷한 시간에 참가한 낚시꾼끼리 겨뤄요."} - ,{ - title:"마지막 기록까지 집계",detail:"내 대회가 끝나면 약 2~7분 뒤 순위가 확정돼요."} - ,{ - title:"대회 보상",detail:"1위 진주 30개 ~ 30위 1개. 기록이 없으면 순위 보상은 없어요."} - ,{ - title:"보상은 교환 마감 전까지",detail:"받지 않은 보상은 새 참가를 막지 않아요. 이번 회차 교환이 끝나기 전에 받아요."} - ])} - history(){ - var t,i,s; - const e=ixi.getInstance(),n=[]; - for(const h of[null==(t=e.social)?void 0:t.board,...(null==(i=e.social)?void 0:i.past)??[]])if(h){ - const t=h.rows.find(t=>t.me); - n.push({ - title:`${ - h.date} - · ${ - RCi(h.day,h.contestId).title} - `,detail:`${ - h.final?"최종":"현재"} - ${ - (null==t?void 0:t.rank)?`${ - t.rank} - 위`:"기록 없음"} - · ${ - NCi(RCi(h.day,h.contestId),(null==t?void 0:t.score)??0)} - `,button:"순위",action:Qt(()=>this.ranking(h),"action")} - )} - if(!(null==(s=e.social)?void 0:s.enabled))for(const h of[...e.state.history].reverse())n.push({ - title:h.title,detail:`${ - h.rank} - 위`} - ); - SWi.open("최근 대회 기록",n)} - rewards(){ - var t,i,s; - const e=ixi.getInstance(),n=[],h=e.claimableSocialIds(); - h.length>1&&n.push({ - title:`보상 ${ - h.length} - 개`,detail:"이번 회차에 받을 수 있는 보상",button:"모두 받기",action:Qt(()=>{ - this.perform(()=>e.claimSocial(h),"보상을 모두 받았어요!")} - ,"action")} - ); - for(const a of(null==(t=e.social)?void 0:t.rewards)??[])h.includes(a.id)&&n.push({ - title:a.title,detail:`${ - a.rank?`${ - a.rank} - 위 · `:""} - ${ - (null==(i=a.contest)?void 0:i.record)??((null==(s=a.hunt)?void 0:s.killed)?"사냥 성공":"사냥 종료")} - `,reward:`진주 ${ - a.participationPearl+a.rankPearl} - ${ - a.gold?` · ${ - a.gold.toLocaleString()} - G`:""} - `,action:Qt(()=>{ - this.perform(()=>e.claimSocial([a.id]),"보상을 받았어요!")} - ,"action")} - ); - const r=e.state.contest,o=r&&!r.claimed&&e.now()>=r.endAt?e.contestStanding():null; - if(r&&o){ - const t=RCi(r.day,r.contestId); - n.push({ - title:`지난 대회 · ${ - t.title} - `,detail:`${ - o.myRank} - 위 · ${ - NCi(t,r.my)} - `,reward:`진주 ${ - LCi(o.myRank)} - `,action:Qt(()=>{ - this.claimLegacy()} - ,"action")} - )} - SWi.open("받을 보상",n)} - async claimLegacy(){ - await this.perform(async()=>await ixi.getInstance().claimContest()?null:"결과를 확인한 뒤 다시 받아 주세요","대회 보상을 받았어요!")} - async perform(t,i){ - if(!this.busy){ - this.busy=!0,this.render(); - try{ - bH.getInstance().showMessage(await t()??i)} - catch{ - bH.getInstance().showMessage("연결을 확인하고 다시 시도해 주세요")} - finally{ - this.busy=!1,this.render()} - } - } - } - ; - Qt(PWi,"FishingSocialPanel"); - let NWi=PWi; - const LWi=.16,DWi=Qt(t=>Math.max(0,Math.min(1,t)),"c01$1"),GWi=Qt(t=>t*t,"eIn"),BWi=Qt(t=>1-(1-t)*(1-t),"eOut"),UWi=Qt(t=>1+2.70158*Math.pow(t-1,3)+1.70158*Math.pow(t-1,2),"backOut$1"); - function FWi(t){ - const i=GWi(DWi(t/LWi)); - let s=2.4-1.4*i,e=16*i-30,n=1,h=1; - const r=DWi(t/.07); - if(t>=LWi){ - const i=BWi(DWi((t-LWi)/.12)); - n=1.12-.12*i,h=.9+.1*i,s=1-.03*Math.sin(Math.PI*DWi((t-.28)/.22)),e=-14} - const o=DWi((t-LWi)/.3),a=DWi((t-LWi)/.2); - return{ - scale:s,rot:e,sx:n,sy:h,alpha:r,burst:t<LWi?{ - s:0,a:0} - :{ - s:.8+.9*BWi(o),a:.5*(1-o)} - ,shake:t<LWi?0:5*(1-a)*Math.sin(a*Math.PI*6),pin:t<.45?0:UWi(DWi((t-.45)/.25)),oldPin:1-DWi((t-.45)/.08)} - } - Qt(FWi,"stampPose"); - const $Wi=APi.CONTENT_W,HWi=[["area","수역"],["contest","대회"],["visit","의뢰"],["goal","업적"]].filter(([t])=>"visit"!==t||rOi),WWi=HWi.map(([t])=>t),VWi=class t extends Ke{ - constructor(){ - super(),Zt(this,"tabId","quest"),Zt(this,"view","area"),Zt(this,"socialPanel",new NWi),Zt(this,"achievementPanel",new IWi),Zt(this,"body",new Ke),Zt(this,"visitLayer",new Ke),Zt(this,"vNext",Jxi("",Uxi,Zxi)),Zt(this,"vCards",[]),Zt(this,"areaLayer",new Ke),Zt(this,"areaKey",null),Zt(this,"areaSel",null),Zt(this,"areaSheet",!1),Zt(this,"areaPop",null),Zt(this,"areaSig",""),Zt(this,"areaBusy",!1),Zt(this,"pinGlows",[]),Zt(this,"slam",null),Zt(this,"slamRefs",{ - stamp:null,burst:null,panel:null,pin:null} - ),Zt(this,"previewIdx",-1),this.buildVisit(),this.body.y=-t.LIFT,this.body.addChild(this.visitLayer,this.areaLayer,this.socialPanel,this.achievementPanel),this.addChild(this.body)} - static getInstance(){ - return this.instance??(this.instance=new t)} - get scrollInShell(){ - return"visit"===this.view} - closeOne(){ - return"area"===this.view&&(null!==this.areaPop?(this.areaPop=null,this.renderArea(!0),!0):!!this.areaSheet&&(this.areaSheet=!1,this.renderArea(!0),!0))} - onResize(){ - this.render()} - subTabs(){ - const t=ixi.getInstance(),i=Vki(t.dotsInput(!1)).seg; - return{ - items:HWi.map(([,t])=>t),index:WWi.indexOf(this.view),dots:WWi.map(s=>"contest"===s?i.contest||t.socialRewardsReady():!!i[s])} - } - selectSub(t){ - APi.getInstance().exchangeOnly&&"contest"!==WWi[t]||(this.view=WWi[t],this.render())} - buildVisit(){ - this.vNext.position.set(4,52),this.visitLayer.addChild(this.vNext); - for(let t=0; - t<3; - t++){ - const i=new Ke; - i.y=82+192*t; - const s=new ep; - s.eventMode="none"; - const e=new ep,n=Jxi("",16777215,20),h=Jxi("",Bxi,16),r=Jxi("",Uxi,13,!1); - e.eventMode="none"; - const o=new hRi(60),a=Jxi("",Bxi,14),c=Jxi("",Uxi,12,!1),l=new ep,u=new Ke; - l.eventMode="none",u.eventMode="none"; - const d=new cRi("그곳으로",96,40,13),f=new cRi("납품",104,44,15); - d.setPrimary(!1),h.position.set(76,14),r.position.set(76,40),r.setWrapWidth($Wi-90),o.position.set(16,80),a.position.set(88,82),c.position.set(88,106),u.position.set(16,150),d.position.set($Wi-216,128),f.position.set($Wi-116,126); - const p=new Ke; - p.eventMode="none"; - const w=new Xe(ls.EMPTY); - w.position.set(12,10),w.eventMode="none",i.addChild(s,e,n,w,h,r,o,a,c,l,u,d,f,p),this.visitLayer.addChild(i),this.vCards.push({ - root:i,bg:s,av:e,init:n,face:w,npc:h,line:r,fish:o,ask:a,where:c,bar:l,reward:u,go:d,btn:f,stamp:p} - )} - } - openView(t){ - this.view=WWi.includes(t)?t:"reward"===t?"contest":"area","area"===this.view&&(this.areaKey=null,this.areaSel=null,this.areaSig="")} - onShow(){ - APi.getInstance().exchangeOnly&&(this.view="contest"),ixi.getInstance().refreshSocial(!0),this.render()} - onHide(){ - this.areaSheet=!1,this.areaPop=null,this.stopPinGlows(),this.areaSig=""} - update(){ - "contest"===this.view&&ixi.getInstance().refreshSocial(),this.render()} - render(){ - const t="contest"===this.view; - this.socialPanel.visible=t,this.visitLayer.visible="visit"===this.view,this.areaLayer.visible="area"===this.view,this.achievementPanel.visible="goal"===this.view,this.socialPanel.visible?this.socialPanel.render():"visit"===this.view?this.renderVisit():"area"===this.view?this.renderArea():this.achievementPanel.render()} - areaRowsOf(t,i){ - return ixi.getInstance().areaRows(t,i).map(t=>t.idx===this.previewIdx?{ - ...t,claimed:!0,ready:!1} - :t)} - defaultArea(t,i,s){ - const e=t.find(t=>t.ready); - if(e)return e.point; - const n=ixi.getInstance().state.spot; - return n.race===i&&n.zone===s?n.point:([...t].filter(t=>!t.claimed).sort((t,i)=>t.missing.length-i.missing.length||t.point-i.point)[0]??t[0]).point} - stopPinGlows(){ - this.pinGlows.forEach(t=>t.kill()),this.pinGlows=[]} - static mapView(t,i,s,e){ - const n=650,h=s/e; - let r=Math.min(...t.map(t=>t.x))-n,o=Math.min(...t.map(t=>t.y))-n,a=Math.max(...t.map(t=>t.x))+n-r,c=Math.max(...t.map(t=>t.y))+n-o; - if(a/c<h){ - const t=c*h; - r-=(t-a)/2,a=t} - else{ - const t=a/h; - o-=(t-c)/2,c=t} - a>i&&(a=i,c=a/h),c>i&&(c=i,a=c*h),r=Math.max(0,Math.min(i-a,r)),o=Math.max(0,Math.min(i-c,o)); - const l=s/a; - return{ - k:l,ox:r*l,oy:o*l} - } - renderArea(i=!1){ - const s=ixi.getInstance(),e=s.state,n=APi.contentHeight; - this.areaKey||(this.areaKey=`${ - e.spot.race} - |${ - e.spot.zone} - `); - const h=this.areaKey,[r,o]=h.split("|"),a=this.areaRowsOf(r,o); - null===this.areaSel&&(this.areaSel=this.defaultArea(a,r,o)); - const c=[h,this.areaSel,s.areaClaimed().join(","),Object.keys(e.dex).length,`${ - e.spot.race} - ${ - e.spot.zone} - ${ - e.spot.point} - `,this.areaSheet,this.areaPop,e.gear.boat,Math.round(n),this.previewIdx].join("|"); - if(!i&&(this.slam||c===this.areaSig))return; - this.areaSig=c; - const l=this.areaLayer; - this.stopPinGlows(),this.slamRefs={ - stamp:null,burst:null,panel:null,pin:null} - ,l.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const u=t.LIFT+4,d=a.filter(t=>t.claimed).length,f=9===d,p=new iRi($Wi); - p.onTitle=()=>queueMicrotask(()=>{ - this.areaSheet=!0,this.renderArea(!0)} - ),p.set(MTi[h],`${ - r} - · ${ - gTi[o]} - ·`,{ - accent:f?"9곳 다 채웠어요 · 진주 +300":"9곳 다 채우면 진주 +300",right:`수역 ${ - d} - / 9`} - ),p.y=u,l.addChild(p); - const w=Math.max(240,Math.min(470,n-84-392)),g=u+66,m=NAi.topdownInfo(h),v=t.mapView(m.points,m.w,$Wi,w),_=new Ke; - _.position.set(0,g); - const M=new Xe(dFi.regionMap(h)); - M.width=M.height=m.w*v.k,M.position.set(-v.ox,-v.oy),M.eventMode="none"; - const b=(new ep).roundRect(0,0,$Wi,w,16).fill(16777215); - M.mask=b,_.addChild(M,b); - const y=e.spot.race===r&&e.spot.zone===o?e.spot.point:-1; - a.forEach(t=>{ - const i=m.points[t.point],s=Math.max(32,Math.min($Wi-32,i.x*v.k-v.ox)),e=Math.max(40,Math.min(w-44,i.y*v.k-v.oy)),n=t.point===this.areaSel; - if(!t.claimed&&!t.ready&&!n){ - const i=Jxi(`${ - t.have} - /${ - t.need} - `,Bxi,12),n=(new ep).roundRect(0,0,i.width+16,i.height+4,10).fill({ - color:657932,alpha:.78} - ); - n.position.set(s-(i.width+16)/2,e+28),i.position.set(n.x+8,n.y+2),n.eventMode="none",_.addChild(n,i)} - if(_.addChild(this.buildPin(t,s,e,n,h)),t.point===y){ - const t=Jxi("지금 여기",Gxi,12),i=t.width+16,h=e-(n?40:34)-22,r=(new ep).roundRect(s-i/2,h,i,22,9).fill(Dxi).poly([s-5,h+22,s+5,h+22,s,h+27]).fill(Dxi); - r.eventMode="none",t.position.set(s-t.width/2,h+(22-t.height)/2),_.addChild(r,t)} - } - ),l.addChild(_),this.drawAreaPanel(l,a[this.areaSel]??a[0],g+w+12,t.LIFT+n-4,h),this.areaSheet&&this.drawAreaSheet(l,n),null!==this.areaPop&&this.drawAreaPop(l,this.areaPop,n)} - buildPin(t,i,s,e,n){ - const h=new Ke; - if(h.position.set(i,s),e){ - const t=(new ep).circle(0,0,29).fill({ - color:16777215,alpha:.85} - ); - t.eventMode="none",h.addChild(t)} - if(t.claimed){ - const i=NAi.areaStamp("mini"),s=new Ke; - if(i){ - const t=new Xe(i); - t.anchor.set(.5),t.width=t.height=48,s.addChild(t)} - else s.addChild((new ep).circle(0,0,24).fill(13909298)); - this.slam&&this.slam.key===n&&this.slam.p===t.point&&(s.scale.set(0),this.slamRefs.pin=s),h.addChild(s)} - else if(t.ready){ - const t=(new ep).circle(0,0,24).fill(Dxi),i=(new ep).circle(0,0,24).fill(Dxi),s=pRi("pearl",22); - t.eventMode=i.eventMode="none",s.position.set(-11,-11),h.addChild(t,i,s),e||this.pinGlows.push(yx.fromTo(t,{ - alpha:.7} - ,{ - alpha:0,duration:1.4,repeat:-1,ease:"power1.out",onUpdate:Qt(()=>{ - t.scale.set(1+.6*(1-t.alpha/.7))} - ,"onUpdate")} - ))} - else{ - const i=t.need?t.have/t.need:0,s=(new ep).circle(0,0,24).fill({ - color:16777215,alpha:.22} - ); - i>0&&s.moveTo(0,0).arc(0,0,24,-Math.PI/2,-Math.PI/2+2*Math.PI*i).closePath().fill(Dxi),s.circle(0,0,19).fill(1447707),s.eventMode="none"; - const e=Jxi(`${ - t.point+1} - `,16777215,18); - e.position.set(-e.width/2,-e.height/2),h.addChild(s,e)} - return h.scale.set(e?1.22:1),h.eventMode="static",h.cursor="pointer",h.hitArea=new da(0,0,30),h.on("pointertap",i=>{ - i.stopPropagation(),queueMicrotask(()=>{ - this.areaSel=t.point,this.renderArea(!0)} - )} - ),h} - drawAreaPanel(i,s,e,n,h){ - const r=ixi.getInstance(),o=r.state,a=Math.max(300,n-e),c=16,l=new Ke; - l.position.set(0,e); - const u=(new ep).roundRect(0,0,$Wi,a,16).fill(Ixi); - u.eventMode="none",l.addChild(u); - const d=new Ke; - if(s.claimed){ - const t=NAi.areaStamp("mini"); - if(t){ - const i=new Xe(t); - i.width=i.height=34,d.addChild(i)} - } - else if(s.ready){ - d.addChild((new ep).circle(17,17,15).fill(Dxi)); - const t=pRi("pearl",18); - t.position.set(8,8),d.addChild(t)} - else{ - const t=s.need?s.have/s.need:0,i=(new ep).circle(17,17,15).fill({ - color:16777215,alpha:.22} - ); - t>0&&i.moveTo(17,17).arc(17,17,15,-Math.PI/2,-Math.PI/2+2*Math.PI*t).closePath().fill(Dxi),i.circle(17,17,12).fill(1447707); - const e=Jxi(`${ - s.point+1} - `,16777215,14); - e.position.set(17-e.width/2,17-e.height/2),d.addChild(i,e)} - d.position.set(c,14); - const f=Jxi(s.name,Bxi,18); - f.position.set(60,31-f.height/2); - const p=KPi(`난이도 ${ - s.level} - `,Uxi,kxi); - if(l.addChild(d,f,p),s.claimed)sRi(f,$Wi-170-p.width-10-f.x); - else{ - const t=pRi("pearl",20),i=Jxi(`${ - s.pearl} - `,Dxi,Qxi); - i.position.set($Wi-c-i.width,31-i.height/2),t.position.set(i.x-24,21),l.addChild(t,i),sRi(f,t.x-12-p.width-10-f.x)} - p.position.set(f.x+f.width+10,18); - const w=Jxi(`${ - s.claimed?"클리어":s.ready?"다 잡았어요!":`남은 물고기 ${ - s.missing.length} - `} - · ${ - s.have} - /${ - s.need} - `,Uxi,14),g=s.claimed?$Wi-150:$Wi-c; - w.position.set(g-w.width,60); - const m=new ep; - fRi(m,c,66,Math.max(60,w.x-12-c),8,s.need?s.have/s.need:0,Dxi),m.eventMode="none",l.addChild(m,w); - const v=[...s.missing,...s.species.filter(t=>o.dex[t.id])],_=($Wi-32)/6; - v.forEach((t,i)=>{ - const s=!!o.dex[t.id],e=c+i%6*_,n=92+110*Math.floor(i/6),h=new Ke,r=new hRi(72,!1,!0); - r.set(t.id,t.star,0,!s),r.setFade(s?.55:1),r.setMark(null,Ixi),r.position.set((_-72)/2,0); - const a="전체"===t.tide?null:_Ti[vTi.indexOf(t.tide)],u=Jxi(s?"✓ 잡음":`${ - "O"===t.zone&&"B"===t.depth?"심해":mTi[t.depth]} - ${ - a?` · ${ - a} - `:""} - `,s?Dxi:Uxi,Zxi,s); - sRi(u,_-4),u.position.set((_-u.width)/2,80),h.addChild(r,u),h.position.set(e,n),h.eventMode="static",h.cursor="pointer",h.hitArea=new $i(0,0,_,102),h.on("pointertap",i=>{ - i.stopPropagation(),queueMicrotask(()=>{ - this.areaPop=t.id,this.renderArea(!0)} - )} - ),l.addChild(h)} - ); - const M=a-c-58; - if(s.ready){ - const t=new cRi("",$Wi-32,58,Qxi),i=Jxi("받기",Gxi,Qxi),e=pRi("pearl",22),n=Jxi(`${ - s.pearl} - `,Gxi,Qxi),h=i.width+10+22+6+n.width; - i.position.set(($Wi-32-h)/2,(58-i.height)/2),e.position.set(i.x+i.width+10,18),n.position.set(e.x+28,(58-n.height)/2),t.addChild(i,e,n),t.position.set(c,M),t.onTap=()=>{ - this.claimAreaRow(s,t)} - ,l.addChild(t)} - else if(s.claimed){ - const t=r.areaClaimed().filter(t=>Math.floor(t/9)===Math.floor(s.idx/9)).length+(this.previewIdx!==s.idx||r.areaClaimed().includes(s.idx)?0:1),i=(new ep).roundRect(c,M,$Wi-32,58,9).fill(2762274),e=pRi("pearl",20),n=Jxi(`진주 ${ - s.pearl} - 받았어요 · 도장 ${ - t} - /9`,Uxi,Zxi),h=28+n.width; - e.position.set(($Wi-h)/2,M+19),n.position.set(e.x+28,M+(58-n.height)/2),i.eventMode="none",l.addChild(i,e,n)} - else{ - const t=o.spot.race===s.race&&o.spot.zone===s.zone&&o.spot.point===s.point,i=new cRi(t?"지금 이 수역에 있어요":"이 수역으로 가기",$Wi-32,58,Qxi); - i.setPrimary(!1),i.enabled=!t,i.position.set(c,M),i.onTap=()=>{ - this.goAreaRow(s)} - ,l.addChild(i)} - if(s.claimed){ - const i=FWi(this.slam&&this.slam.key===h&&this.slam.p===s.point?0:1.2),e=new Ke,n=new ep,r=new Ke; - e.position.set($Wi-4-75,59),n.circle(0,0,92).fill({ - color:13909298,alpha:.18} - ).circle(0,0,75).cut().circle(0,0,75).fill({ - color:13909298,alpha:.55} - ).circle(0,0,58).cut(),n.scale.set(i.burst.s),n.alpha=i.burst.a; - const o=NAi.areaStamp(s.level); - if(o){ - const t=new Xe(o); - t.anchor.set(.5),t.width=t.height=150,r.addChild(t)} - t.poseStamp(r,i),e.addChild(n,r),e.eventMode="none",l.addChild(e),this.slam&&this.slam.key===h&&this.slam.p===s.point&&(this.slamRefs.stamp=r,this.slamRefs.burst=n,this.slamRefs.panel=l)} - i.addChild(l)} - static poseStamp(t,i){ - t.scale.set(i.scale*i.sx,i.scale*i.sy); - const s=t.children[0]; - s&&(s.rotation=i.rot*Math.PI/180),t.alpha=i.alpha} - async claimAreaRow(t,i){ - if(this.areaBusy)return; - this.areaBusy=!0; - const s=ixi.getInstance(),e=i.toGlobal({ - x:($Wi-32)/2,y:29} - ); - try{ - const i=await s.claimArea(t.race,t.zone,t.point); - if(i.message)return void bH.getInstance().showMessage(i.message); - bH.getInstance().showMessage(i.bonus?`${ - t.name} - 도장! 진주 ${ - i.pearl} - · 지역 9곳을 다 채워 진주 ${ - i.bonus} - 더`:`${ - t.name} - 도장! 진주 ${ - i.pearl} - `),this.playSlam(`${ - t.race} - |${ - t.zone} - `,t.point,e,i.bonus?10:5)} - finally{ - this.areaBusy=!1} - } - playSlam(i,s,e,n){ - this.areaKey=i,this.areaSel=s; - const h={ - key:i,p:s,t0:performance.now(),from:e,pearls:n,hit:!1,flown:!1} - ; - this.slam=h,this.renderArea(!0); - const r=Qt(()=>{ - if(this.slam!==h)return; - const i=Math.min(1.2,(performance.now()-h.t0)/1e3*t.stampSpeed),s=FWi(i),e=this.slamRefs; - e.stamp&&!e.stamp.destroyed&&t.poseStamp(e.stamp,s),e.burst&&!e.burst.destroyed&&(e.burst.scale.set(s.burst.s),e.burst.alpha=s.burst.a),e.panel&&!e.panel.destroyed&&(e.panel.x=s.shake),e.pin&&!e.pin.destroyed&&e.pin.scale.set(s.pin),!h.hit&&i>=LWi&&(h.hit=!0,YG("medium"),QG.getInstance().playSFX(QG.SFX_WOOD_MALLET)),!h.flown&&i>=.3&&(h.flown=!0,h.pearls&&APi.getInstance().flyCurrency("pearl",h.from,h.pearls)),i<1.2?requestAnimationFrame(r):(this.slam=null,this.renderArea(!0))} - ,"step"); - requestAnimationFrame(r)} - async goAreaRow(t){ - var i; - const s=ixi.getInstance(),e=await s.goTo({ - race:t.race,zone:t.zone,point:t.point,depth:(null==(i=t.missing[0])?void 0:i.depth)??s.state.spot.depth} - ); - e?bH.getInstance().showMessage(e):(bH.getInstance().showMessage(`${ - t.name} - (으)로 가요 · 못 잡은 물고기 ${ - t.missing.length} - 마리`),APi.getInstance().selectTab("fish"))} - drawAreaSheet(i,s){ - const e=ixi.getInstance(),n=e.state,h=APi.OVERLAY_PAD,r=t.LIFT,o=(new ep).rect(-h,r,$Wi+2*h,s).fill({ - color:0,alpha:Nxi} - ); - o.eventMode="static",o.on("pointertap",t=>{ - t.stopPropagation(),queueMicrotask(()=>{ - this.areaSheet=!1,this.renderArea(!0)} - )} - ); - const a=["R","C","O"],c=($Wi-74-16)/3,l=90+96*fTi.length+16,u=new Ke; - u.position.set(0,r+s-l),u.eventMode="static",u.on("pointertap",t=>t.stopPropagation()),u.addChild((new ep).roundRect(-h,0,$Wi+2*h,l+30,22).fill(Rxi)); - const d=Jxi("지역",Bxi,24),f=Jxi(`12곳 · 수역 ${ - e.areaClaimed().length} - /108 · 지역마다 9곳을 다 채우면 진주 +300`,Uxi,Zxi); - d.position.set(0,24),f.position.set(d.width+14,24+d.height-f.height-2),sRi(f,$Wi-60-f.x); - const p=new Ke,w=(new ep).moveTo(12,12).lineTo(28,28).moveTo(28,12).lineTo(12,28).stroke({ - color:Uxi,width:3,cap:"round"} - ); - w.eventMode="none",p.addChild(w),p.position.set($Wi-40,16),p.eventMode="static",p.cursor="pointer",p.hitArea=new $i(0,0,40,40),p.on("pointertap",t=>{ - t.stopPropagation(),queueMicrotask(()=>{ - this.areaSheet=!1,this.renderArea(!0)} - )} - ),u.addChild(d,f,p),a.forEach((t,i)=>{ - const s=Jxi(gTi[t],Uxi,Zxi); - s.position.set(74+i*(c+8)+(c-s.width)/2,70),u.addChild(s)} - ),fTi.forEach((t,i)=>{ - const s=96+96*i,e=(new ep).circle(6,s+44,5).fill(Xxi[t]),h=Jxi(t,Bxi,14); - e.eventMode="none",h.position.set(18,s+(88-h.height)/2),u.addChild(e,h),a.forEach((i,e)=>{ - const h=`${ - t} - |${ - i} - `,r=74+e*(c+8),o=n.gear.boat<DSi.ENTRY[i],a=this.areaRowsOf(t,i),l=a.filter(t=>t.claimed).length,d=new Ke,f=(new ep).roundRect(0,0,c,88,12).fill(o?1908001:h===this.areaKey?jxi:Ixi); - f.eventMode="none"; - const p=Jxi(MTi[h],o?Fxi:Bxi,Qxi); - if(p.position.set(12,16),sRi(p,c-24),d.addChild(f,p),o){ - const t=nxi("lock",16,Fxi,2.4),s=Jxi(`배 ${ - DSi.ENTRY[i]+1} - 단계부터`,Uxi,Zxi); - t.position.set(12,54),s.position.set(32,62-s.height/2),sRi(s,c-44),d.addChild(t,s)} - else{ - const t=Jxi(`${ - l} - /9`,Uxi,Zxi),i=new ep; - if(t.position.set(12,62-t.height/2),a.forEach((s,e)=>i.roundRect(t.x+t.width+8+11*e,58,8,8,2.5).fill(s.claimed?13909298:s.ready?Dxi:3816e3)),i.eventMode="none",d.addChild(t,i),a.some(t=>t.ready)){ - const t=(new ep).circle(c-12,12,5).fill(15029053); - t.eventMode="none",d.addChild(t)} - d.eventMode="static",d.cursor="pointer",d.hitArea=new $i(0,0,c,88),d.on("pointertap",t=>{ - t.stopPropagation(),queueMicrotask(()=>{ - this.areaKey=h,this.areaSel=null,this.areaSheet=!1,this.renderArea(!0)} - )} - )} - d.position.set(r,s),u.addChild(d)} - )} - ),i.addChild(o,u)} - drawAreaPop(i,s,e){ - const n=ixi.getInstance(),h=DTi(s),r=!!n.state.dex[s],o=APi.OVERLAY_PAD,a=t.LIFT,c=Qt(()=>{ - queueMicrotask(()=>{ - this.areaPop=null,this.renderArea(!0)} - )} - ,"close"),l=(new ep).rect(-o,a,$Wi+2*o,e).fill({ - color:0,alpha:Nxi} - ); - l.eventMode="static",l.on("pointertap",t=>{ - t.stopPropagation(),c()} - ); - const u=Math.min($Wi-40,500),d=new Ke,f=new ep; - d.eventMode="static",d.on("pointertap",t=>t.stopPropagation()); - const p=new hRi(104,!1,!0); - p.set(h.id,h.star,0,!r),p.position.set(20,20); - const w=Jxi(r?h.name:"???",r?Bxi:Uxi,21); - w.position.set(142,22),sRi(w,u-20-122-52); - const g=new Ke,m=zTi(h); - [KPi(`★${ - h.tier} - `,Dxi,kxi),KPi(h.kind,Uxi,kxi),...m?[KPi(m,Uxi,kxi)]:[]].forEach((t,i,s)=>{ - t.x=i?s[i-1].x+s[i-1].width+6:0,g.addChild(t)} - ),g.position.set(142,56); - const v=zPi([{ - text:r?"✓ 잡았어요":"아직 못 잡았어요",color:r?$xi:Uxi} - ]); - v.position.set(142,94); - const _=YPi(h,!r&&h.star>=3,u-40); - _.position.set(20,144); - const M=new Ke,b=(new ep).moveTo(14,14).lineTo(30,30).moveTo(30,14).lineTo(14,30).stroke({ - color:Uxi,width:3,cap:"round"} - ); - b.eventMode="none",M.addChild(b),M.position.set(u-52,8),M.eventMode="static",M.cursor="pointer",M.hitArea=new $i(0,0,44,44),M.on("pointertap",t=>{ - t.stopPropagation(),c()} - ); - const y=144+_.height+20; - f.roundRect(0,0,u,y,16).fill(Rxi),d.addChild(f,p,w,g,v,_,M),d.hitArea=new $i(0,0,u,y),d.position.set(($Wi-u)/2,a+Math.max(10,(e-y)/2)),i.addChild(l,d)} - previewStamp(t=!1){ - const i=ixi.getInstance(),s=i.state.spot,e=`${ - s.race} - |${ - s.zone} - `,n=i.areaRows(s.race,s.zone),h=n.findIndex(t=>t.idx===this.previewIdx),r=t?h+1:Math.max(0,h),o=[...n.slice(r),...n.slice(0,r)].find(t=>!t.claimed)??n[0]; - this.view="area",this.previewIdx=o.idx,this.playSlam(e,o.point,{ - x:0,y:0} - ,0)} - renderVisit(){ - const t=ixi.getInstance(),i=t.quests(),s=t.visitorsOpen(); - if(this.vCards.forEach((t,e)=>{ - t.root.visible=s&&e<i.reqs.length} - ),!s)return this.vNext.text="아직 찾아온 손님이 없어요",void sRi(this.vNext,$Wi-8); - this.vNext.text=`손님 배를 눌러도 납품할 수 있어요 · 다음 손님까지 ${ - wRi(i.nextAt-t.now())} - `,sRi(this.vNext,$Wi-8); - const e=[14921803,13132906,5995472]; - i.reqs.forEach((s,n)=>{ - const h=this.vCards[n],r=DTi(s.speciesId),o=i.done.includes(s.key),a=t.questHave(s),c=!o&&a>=s.count; - h.bg.clear().roundRect(.5,.5,$Wi-1,180,14).fill(c?2244666:Ixi).stroke({ - color:c?$xi:Lxi,width:c?1.5:1} - ),h.av.clear().circle(40,38,26).fill(e[n]).circle(40,38,26).stroke({ - color:16777215,width:2,alpha:.35} - ),h.init.text=s.npc[0],h.init.position.set(40-h.init.width/2,38-h.init.height/2); - const l=NAi.gear().guestHeads,u=["m","b","e"].indexOf(s.key.slice(-1)); - u>=0&&l[u]?(h.face.texture=l[u],h.face.width=h.face.height=56,h.face.visible=!0,h.av.clear(),h.init.visible=!1):(h.face.visible=!1,h.init.visible=!0),h.npc.text=`${ - s.npc} - · ${ - s.role} - `,h.line.text=s.line; - const d=!!t.state.dex[r.id]; - h.fish.set(r.id,r.star,s.minGrade,!d); - const f=d||s.line.includes(r.name); - if(h.ask.text=`${ - f?r.name:"???"} - ${ - s.minGrade?` (${ - _Ci(s.minGrade)} - 이상)`:""} - ×${ - s.count} - ${ - Math.min(a,s.count)} - /${ - s.count} - `,h.ask.textColor=c?$xi:Bxi,sRi(h.ask,$Wi-88-20),h.where.text=d?YTi(r):`${ - MTi[`${ - r.race} - |${ - r.zone} - `]} - 어딘가 · ${ - "전체"===r.tide?"모든 물때":`${ - r.tide} - 물때`} - `,sRi(h.where,$Wi-88-20),h.bar.clear(),fRi(h.bar,88,132,$Wi-88-232,6,a/s.count,c||o?$xi:Dxi),h.reward.label!==s.key){ - h.reward.label=s.key,h.reward.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const t=pRi("gold",16),i=Jxi(s.gold.toLocaleString(),Dxi,13); - if(i.position.set(20,-1),h.reward.addChild(t,i),s.pearl){ - const t=pRi("pearl",16),e=Jxi(`${ - s.pearl} - `,Wxi,13); - t.x=i.x+i.width+12,e.position.set(t.x+20,-1),h.reward.addChild(t,e)} - } - if(h.btn.enabled=c,h.btn.setText(o?"완료":"납품"),h.go.visible=!o&&!c,h.go.onTap=async()=>{ - const i=jTi(r); - !d&&r.star>=3&&(i.point=0); - const s=await t.goTo(i); - s?bH.getInstance().showMessage(s):(bH.getInstance().showMessage(`${ - MTi[`${ - r.race} - |${ - r.zone} - `]} - (으)로 옮겼어요`),APi.getInstance().selectTab("fish"))} - ,h.btn.onTap=async()=>{ - const i=await t.deliver(s); - if(i)return void bH.getInstance().showMessage(i); - bH.getInstance().showMessage(`${ - s.npc} - : "고마워요!"`),YG("success"); - const e=APi.getInstance(); - e.flyCurrency("gold",h.btn.toGlobal({ - x:52,y:22} - ),7),s.pearl&&e.flyCurrency("pearl",h.btn.toGlobal({ - x:52,y:22} - ),4),this.render(),yx.fromTo(h.stamp.scale,{ - x:1.8,y:1.8} - ,{ - x:1,y:1,duration:.35,ease:"back.out(2)"} - )} - ,h.root.alpha=o?.72:1,h.stamp.label!==String(o)&&(h.stamp.label=String(o),h.stamp.removeChildren().forEach(t=>t.destroy({ - children:!0} - ))),o&&!h.stamp.children.length){ - const t=(new ep).roundRect(-58,-20,116,40,8).stroke({ - color:$xi,width:3} - ),i=Jxi("납품 완료",$xi,18); - i.pivot.set(i.width/2,i.height/2),h.stamp.addChild(t,i),h.stamp.position.set($Wi-90,58),h.stamp.rotation=-.18} - } - )} - } - ; - Qt(VWi,"FishingQuestPage"),Zt(VWi,"instance"),Zt(VWi,"LIFT",48),Zt(VWi,"stampSpeed",1); - let jWi=VWi; - const KWi=Object.freeze(Object.defineProperty({ - __proto__:null,FishingQuestPage:jWi} - ,Symbol.toStringTag,{ - value:"Module"} - )),zWi=APi.CONTENT_W,YWi={ - bait_fish:"shrimp",bait_shell:"shell",bait_aqua:"lure",bait_big:"bigbait"} - ,qWi=class t extends Ke{ - constructor(t){ - super(),Zt(this,"tabId","shop"),Zt(this,"view","items"),Zt(this,"head",new iRi(zWi)),Zt(this,"banner",new Ke),Zt(this,"bannerBg",new ep),Zt(this,"bannerIcon",new Ke),Zt(this,"bannerTitle",Jxi("",Bxi,14)),Zt(this,"bannerSub",Jxi("",Uxi,12,!1)),Zt(this,"bannerBar",new ep),Zt(this,"rows",[]),Zt(this,"rewardIcons",Array.from({ - length:4} - ,()=>new M4)),Zt(this,"qty",new Map),Zt(this,"locked",!1),Zt(this,"itemIcons",new Map),Zt(this,"bannerKey",""),Zt(this,"busy",!1),this.only=t,this.view=t,this.banner.y=0,this.bannerIcon.position.set(12,12),this.bannerTitle.position.set(66,12),this.bannerSub.position.set(66,36),this.bannerBar.eventMode="none",this.bannerSub.setWrapWidth(zWi-80),this.banner.addChild(this.bannerBg,this.bannerIcon,this.bannerTitle,this.bannerSub,this.bannerBar),this.banner.eventMode="none",this.addChild(this.banner,this.head); - for(let i=0; - i<Math.max(KCi.length,4); - i++){ - const s=new Ke; - s.y=("exchange"===t?66:78)+88*i; - const e=eRi(zWi,80,Ixi,null),n=(new ep).roundRect(12,12,56,56,12).fill(kxi); - n.eventMode="none"; - const h=new Ke; - h.position.set(40,40); - const r=Jxi("",Bxi,18),o=Jxi("",Uxi,Zxi,!1),a=new cRi("",150,46,Qxi),c=new Ke; - r.position.set(84,16),o.position.set(84,46),a.position.set(zWi-164,17),c.eventMode="none"; - const l=[0,1,2].map(t=>{ - const i=new oRi("",64,30,Zxi); - return i.position.set(84+70*t,42),i.visible=!1,i} - ); - s.addChild(e,n,h,r,o,a,c,...l),this.addChild(s),this.rows.push({ - root:s,tile:n,icon:h,name:r,desc:o,btn:a,cost:c,qtyChips:l} - )} - this.rewardIcons.forEach(t=>{ - t.eventMode="none"} - )} - static getInstance(){ - return this.instance??(this.instance=new t("exchange"))} - async guarded(t){ - if(!this.busy){ - this.busy=!0; - try{ - return await t()} - finally{ - this.busy=!1} - } - } - onShow(){ - this.render()} - forceExchange(t){ - this.locked=t,ixi.getInstance().ready&&this.render()} - onHide(){ - } - update(){ - this.renderBanner()} - focusItem(t){ - var i; - this.render(); - const s=KCi.findIndex(i=>i.id===t); - return s<0?null:(null==(i=this.rows[s])?void 0:i.btn)??null} - render(){ - const t=ixi.getInstance(),i=t.state; - this.view=this.only,this.renderBanner(),"items"===this.view?this.rows.forEach((s,e)=>{ - const n=KCi[e]; - if(s.root.visible=!!n,s.qtyChips.forEach(t=>{ - t.visible=!1} - ),s.desc.visible=!0,!n)return; - let h=this.itemIcons.get(n.id); - h||(h=mRi(YWi[n.id]??"shrimp",40,Bxi),h.pivot.set(20,20),this.itemIcons.set(n.id,h)),this.setIcon(s,h),s.name.text=n.name,s.desc.text=n.desc,sRi(s.desc,zWi-260); - const r=n.pearl?i.pearl>=n.pearl:i.gold>=(n.gold??0); - this.setCost(s,n.pearl?"pearl":"gold",n.pearl??n.gold??0,r),s.btn.enabled=r,s.btn.onTap=async()=>{ - const i=await this.guarded(()=>t.buy(n)); - void 0!==i&&(i?bH.getInstance().showMessage(i):(bH.getInstance().showMessage(n.bait?`${ - n.name} - 사용 · 30분 동안 효과`:`${ - n.name} - 을(를) 샀어요`),YG("light"),yx.fromTo(s.icon.scale,{ - x:1.35,y:1.35} - ,{ - x:1,y:1,duration:.4,ease:"back.out(3)"} - ),this.render()))} - } - ):this.rows.forEach((i,s)=>{ - const e=t.shop[s]; - if(i.root.visible=!!e,i.qtyChips.forEach(t=>{ - t.visible=!!e} - ),!e)return; - i.desc.visible=!1; - const n=t.exchangeMax(e),h=Math.max(1,Math.min(this.qty.get(e.kindNum)??1,Math.max(1,n))),r=this.rewardIcons[s]; - r.setData(e.reward.type,e.reward.amount,-1,-1,e.reward.subType??""),r.hideAmount(),r.scale.set(52/64),r.pivot.set(32,32),this.setIcon(i,r),i.name.text=h>1?`${ - e.name} - × ${ - h.toLocaleString()} - `:e.name,sRi(i.name,zWi-260),this.setCost(i,"pearl",e.pearl*h,n>=h),i.btn.enabled=n>=h,i.btn.onTap=async()=>{ - const s=await this.guarded(()=>t.exchange(e,h)); - void 0!==s&&(s?bH.getInstance().showMessage(s):(bH.getInstance().showMessage(`${ - e.name} - ${ - h>1?` × ${ - h.toLocaleString()} - `:""} - , 메인 게임 우편함으로 보냈어요`),YG("success"),yx.fromTo(i.icon.scale,{ - x:1.3,y:1.3} - ,{ - x:1,y:1,duration:.4,ease:"back.out(3)"} - ),this.render()))} - ; - const o=[1,10,Math.max(1,n)]; - i.qtyChips.forEach((t,i)=>{ - t.setText(2===i?"최대":String(o[i])),t.selected=h===o[i]&&(2!==i||n>10),t.enabled=0===i||n>=o[i],t.draw(),t.onTap=()=>{ - this.qty.set(e.kindNum,o[i]),this.render()} - } - )} - )} - renderBanner(){ - var t; - const i=ixi.getInstance(),s=i.state; - if("exchange"===this.view){ - const e=null==(t=i.season)?void 0:t.shopEndAt; - return this.banner.visible=!1,this.head.visible=!0,void("exchangeOnly"===i.phase()&&e?this.head.set("상점","회차가 끝났어요 ·",{ - accent:`${ - gRi(e)} - 까지 바꿀 수 있어요`,right:`진주 ${ - s.pearl.toLocaleString()} - `} - ):this.head.set("상점","모은 진주를 메인 게임 재화로 바꿔요 ·",{ - accent:e?`${ - gRi(e)} - 까지`:"회차가 끝나고 며칠 안에",right:`진주 ${ - s.pearl.toLocaleString()} - `} - ))} - this.banner.visible=!0,this.head.visible=!1; - const e=i.baitLeftMs(),n=e>0&&!!s.bait; - this.bannerBar.clear(); - const h=n?KCi.find(t=>t.bait===s.bait.kind):null,r=(null==h?void 0:h.id)??"none"; - r!==this.bannerKey&&(this.bannerKey=r,this.bannerIcon.removeChildren().forEach(t=>t.destroy({ - children:!0} - )),this.bannerIcon.addChild(mRi(h?YWi[h.id]:"hook",40,Uxi))),this.bannerTitle.text=n?`사용 중 · ${ - (null==h?void 0:h.name)??s.bait.kind} - · ${ - wRi(e)} - 남음`:"미끼 없음",this.bannerTitle.textColor=n?Dxi:Bxi,this.bannerSub.text=n?"미끼는 한 번에 하나만 효과가 있어요. 새로 사면 바뀌어요.":"미끼는 30분 동안 효과가 있어요",n&&fRi(this.bannerBar,66,60,zWi-80,5,e/18e5,Dxi),sRi(this.bannerSub,zWi-80),this.bannerBg.clear().roundRect(0,0,zWi,66,12).fill(n?2763288:kxi)} - setIcon(t,i){ - t.icon.children[0]!==i&&(t.icon.removeChildren(),t.icon.addChild(i))} - setCost(t,i,s,e){ - t.btn.setText(""),t.cost.removeChildren().forEach(t=>t.destroy({ - children:!0} - )); - const n=pRi(i,20),h=Jxi(s.toLocaleString(),e?Gxi:Kxi,16); - h.position.set(26,-1),n.alpha=e?1:.6,t.cost.addChild(n,h),t.cost.position.set(t.btn.x+(150-t.cost.width)/2,t.btn.y+13)} - } - ; - Qt(qWi,"FishingShopPage"),Zt(qWi,"instance"); - let XWi=qWi; - const JWi=Object.freeze(Object.defineProperty({ - __proto__:null,FishingShopPage:XWi} - ,Symbol.toStringTag,{ - value:"Module"} - )),QWi=class t extends Ke{ - constructor(){ - super(),Zt(this,"dim",new ep),Zt(this,"card",new ep),Zt(this,"title",Jxi("",Dxi,24)),Zt(this,"lines",Jxi("",Bxi,15,!1)),Zt(this,"note",Jxi("내 모습과 도감 기록·대회 컵은 그대로 남아요.\n골드·배·도구는 새로 시작해요.",Uxi,13,!1)),Zt(this,"ok",new cRi("출발!",220,50,17)),Zt(this,"view",null),this.dim.eventMode="static",this.card.eventMode="none",this.ok.onTap=()=>{ - var t; - null==(t=this.parent)||t.removeChild(this)} - ,this.addChild(this.dim,this.card,this.title,this.lines,this.note,this.ok)} - static getInstance(){ - return this.instance??(this.instance=new t)} - closeOne(){ - var t,i; - return null==(i=(t=this.ok).onTap)||i.call(t),!0} - show(t){ - this.view=t,this.parent||APi.getInstance().overlay.addChild(this),this.layout(),yx.fromTo(this,{ - alpha:0} - ,{ - alpha:1,duration:.25} - )} - layout(){ - var t; - const i=this.view; - if(!i)return; - const s=APi.CONTENT_W,e=APi.contentHeight,n=APi.OVERLAY_PAD; - this.dim.clear().rect(-n,0,s+2*n,e).fill({ - color:0,alpha:.72} - ),this.dim.hitArea=new $i(-n,0,s+2*n,e); - const h=Math.min(s-32,460),r=(s-h)/2,o=(e-280)/2; - this.card.clear().roundRect(r,o,h,280,18).fill(Rxi); - const a=(null==(t=ixi.getInstance().season)?void 0:t.id)??i.prevId+1; - this.title.text=`${ - a} - 회차 시작!`,this.lines.text=`지난 회차에 ${ - i.prevDex} - 종을 잡았어요${ - i.prevCups?` · 대회 컵 ${ - i.prevCups} - 개`:""} - `,sRi(this.lines,h-48),this.title.position.set(r+24,o+26),this.lines.position.set(r+24,o+76),this.note.position.set(r+24,o+118),this.ok.position.set(r+(h-220)/2,o+280-74)} - } - ; - Qt(QWi,"FishingSeasonCard"),Zt(QWi,"instance"); - let ZWi=QWi; - const tVi=class{ - static async enter(){ - var t; - await NAi.ensure(),await sPi(); - const i=ixi.getInstance(),s=await i.load(),e=i.season; - if("closed"===(null==e?void 0:e.phase))throw new Error(e.nextStartAt?`다음 회차는 ${ - gRi(e.nextStartAt+1)} - 에 열려요`:"다음 회차를 준비하고 있어요"); - if(!i.ready)throw new Error("exchangeOnly"===(null==e?void 0:e.phase)?"이번 회차는 끝났어요. 다음 회차를 기다려 주세요":s??"낚시왕 정보를 받지 못했어요"); - i.loadLife(); - const n=APi.getInstance(); - n.onNavigate=t=>this.openTab(t); - const h=Y$i.getInstance(),r=nHi.getInstance(); - if(h.onOpenMap=()=>n.present(r),r.onBack=()=>n.present(h),null==(t=this.unwatch)||t.call(this),this.unwatch=i.onSeasonChange(t=>this.onSeasonChange(t)),"exchangeOnly"===i.phase())return n.setExchangeOnly(!0),await this.openTab("shop"),void bH.getInstance().showMessage(`회차가 끝났어요 · ${ - gRi(e.shopEndAt)} - 까지 진주를 바꿀 수 있어요`); - n.setExchangeOnly(!1),await this.openTab("fish"),i.newSeason&&(ZWi.getInstance().show(i.newSeason),i.newSeason=null),i.isLastDay()&&(null==e?void 0:e.shopEndAt)&&bH.getInstance().showMessage(`오늘 회차가 끝나요 · 진주는 ${ - gRi(e.shopEndAt)} - 까지 교환소에서 바꿀 수 있어요`)} - static onSeasonChange(t){ - const i=APi.getInstance(); - i.parent&&("exchangeOnly"===t.phase?(i.setExchangeOnly(!0),this.openTab("shop"),t.shopEndAt&&bH.getInstance().showMessage(`회차가 끝났어요 · ${ - gRi(t.shopEndAt)} - 까지 진주를 바꿀 수 있어요`)):"closed"===t.phase?(i.closeForSeason(),bH.getInstance().showMessage("이번 회차의 교환소가 닫혔어요")):i.setExchangeOnly(!1))} - static async openTab(t){ - const i=APi.getInstance(); - switch(t){ - case"fish":i.present(Y$i.getInstance()); - break; - case"gear":i.present(uWi.getInstance()); - break; - case"tank":i.present(pNi.getInstance()); - break; - case"quest":i.present(jWi.getInstance()); - break; - case"shop":i.present(XWi.getInstance())} - } - } - ; - Qt(tVi,"FishingFlow"),Zt(tVi,"unwatch",null); - let iVi=tVi; - const sVi=Object.freeze(Object.defineProperty({ - __proto__:null,FishingFlow:iVi} - ,Symbol.toStringTag,{ - value:"Module"} - )),eVi=150,nVi=34,hVi=140,rVi=.8,oVi=.25,aVi=Qt(t=>Math.max(0,Math.min(1,t)),"c01"),cVi=Qt(t=>1+2.70158*Math.pow(t-1,3)+1.70158*Math.pow(t-1,2),"backOut"),lVi=Qt((t,i)=>null!=t&&t>=0&&t<i,"on"); - function uVi(t,i){ - const s=t.bite,e=t.catch,n=t.hit,h=null!=s&&s>=0?cVi(aVi(s/.25)):0,r=lVi(e,rVi)?aVi(e/rVi):0,o=null!=e&&e>=rVi&&e<1.05?1-(e-rVi)/oVi:0; - return{ - bang:h,bangY:-6*h,ring:null!=s&&s>=0?.4+.6*Math.abs(Math.sin(6*s)):0,fishAlpha:lVi(e,rVi)?1-aVi((r-.85)/.15):0,fishX:i.from.x+(i.to.x-i.from.x)*r,fishY:i.from.y+(i.to.y-i.from.y)*r*r-88*r*(1-r),fishScale:.6+.6*Math.sin(Math.PI*r),netScale:1+.35*o,flash:null!=n&&n>=0?.55*(1-aVi(n/.35)):0,shake:lVi(n,.4)?5*(1-n/.4)*Math.sin(70*n):0,numAlpha:lVi(n,1.3)?1-aVi((n-.9)/.4):0,numY:null!=n&&n>=0?-16*aVi(n):0} - } - function dVi(t,i,s,e,n=150){ - const h=t+n/2<s/2,r=Math.max(10,e-n-150); - return{ - x:h?10:s-n-10,y:Math.round(Math.max(10,Math.min(r,i)))} - } - function fVi(t,i){ - return{ - x:t-70,y:i-50.88533333333333,w:hVi,h:hVi} - } - Qt(uVi,"miniPose"),Qt(dVi,"miniSnap"),Qt(fVi,"miniShotFrame"); - const pVi="ef2_fishing_mini_pos_v1",wVi=16739166,gVi=16757611,mVi=eVi,vVi=116; - function _Vi(){ - try{ - const t=JSON.parse(localStorage.getItem(pVi)??"null"); - if(t&&Number.isFinite(t.x)&&Number.isFinite(t.y))return t} - catch{ - } - return{ - x:10,y:96} - } - function MVi(t){ - try{ - localStorage.setItem(pVi,JSON.stringify(t))} - catch{ - } - } - Qt(_Vi,"loadPos"),Qt(MVi,"savePos"); - const bVi=class t extends Ke{ - constructor(){ - super(),Zt(this,"fake",null),Zt(this,"speed",1),Zt(this,"onPreviewTap",null),Zt(this,"body",new Ke),Zt(this,"edge",new ep),Zt(this,"clip",new Ke),Zt(this,"clipMask",new ep),Zt(this,"water",new ep),Zt(this,"shot",new Xe),Zt(this,"shotTex",null),Zt(this,"boatAlt",new Xe),Zt(this,"stripBg",new ep),Zt(this,"netIcon",new Xe),Zt(this,"netNum",new Ke),Zt(this,"netText",Jxi("0",Bxi,15)),Zt(this,"boatIcon",new Xe),Zt(this,"hpText",Jxi("",Bxi,15)),Zt(this,"flash",new ep),Zt(this,"fix",new Ke),Zt(this,"fixBg",new ep),Zt(this,"fixRing",new ep),Zt(this,"ring",new ep),Zt(this,"bang",new Ke),Zt(this,"fish",new Xe),Zt(this,"num",new iG("",wVi,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:20,lineHeight:26,fontWeight:"bolder",stroke:{ - color:3804424,width:4} - } - )),Zt(this,"maxBtn",new Ke),Zt(this,"closeBtn",new Ke),Zt(this,"clock",0),Zt(this,"biteK",null),Zt(this,"biteAt",null),Zt(this,"catchAt",null),Zt(this,"hitAt",null),Zt(this,"netHold",null),Zt(this,"fishBase",1),Zt(this,"path",{ - from:{ - x:75,y:54.519999999999996} - ,to:{ - x:30,y:133} - } - ),Zt(this,"view",null),Zt(this,"sampleAt",0),Zt(this,"stripSig",""),Zt(this,"fixSig",""),Zt(this,"timer",new Rx(250)),Zt(this,"unsub",[]),Zt(this,"down",null),Zt(this,"pos",_Vi()),Zt(this,"onFrame",Qt(t=>this.frame(t.deltaMS),"onFrame")),Zt(this,"onShellOpen",Qt(()=>this.hide(),"onShellOpen")),Zt(this,"onResize",Qt(()=>this.place(this.x,this.y,!1),"onResize")),this.edge.roundRect(0,6,mVi,mVi,18).fill({ - color:0,alpha:.44} - ).roundRect(-3,-3,156,156,21).fill(1118481),this.clipMask.roundRect(0,0,mVi,mVi,18).fill(16777215),this.clip.mask=this.clipMask,this.water.rect(0,0,mVi,mVi).fill(2379871),this.shot.width=this.shot.height=mVi,this.boatAlt.anchor.set(.5),this.boatAlt.position.set(75,54.519999999999996),this.stripBg.rect(0,116,mVi,nVi).fill({ - color:789518,alpha:.82} - ),this.netNum.addChild(this.netText),this.flash.rect(0,0,mVi,mVi).fill(wVi),this.flash.alpha=0,this.fixBg.rect(0,0,mVi,vVi).fill({ - color:0,alpha:.55} - ); - const t=new ep,i={ - color:gVi,width:3.5,cap:"round",join:"round"} - ,s=-Math.PI/4+.7; - t.moveTo(-8,8).lineTo(2,-2).stroke(i).moveTo(6+5.5*Math.cos(s),5.5*Math.sin(s)-6).arc(6,-6,5.5,s,s+2*Math.PI-1.4).stroke(i),t.position.set(75,58),this.fix.addChild(this.fixBg,this.fixRing,t),this.fix.visible=!1,this.clip.addChild(this.water,this.boatAlt,this.shot,this.stripBg,this.netIcon,this.netNum,this.boatIcon,this.hpText,this.fix,this.flash),this.ring.roundRect(2,2,146,146,16).stroke({ - color:Dxi,width:4} - ),this.ring.alpha=0; - const e=Jxi("!",Gxi,24); - e.position.set(-e.width/2,-e.height/2),this.bang.addChild((new ep).ellipse(0,3,17,17).fill({ - color:0,alpha:.4} - ).circle(0,0,17).fill(Dxi),e),this.bang.position.set(75,37),this.bang.visible=!1,this.fish.anchor.set(.5),this.fish.visible=!1,this.num.alpha=0; - const n={ - color:14540253,width:2.2,cap:"round",join:"round"} - ,h=Qt((t,i,s,e,n)=>{ - i.eventMode="none"; - const h=(new ep).circle(0,0,12).fill({ - color:0,alpha:.55} - ); - h.eventMode="none",t.addChild(h,i),t.position.set(s,16),t.eventMode="static",t.cursor="pointer",t.hitArea=e,t.on("pointerdown",t=>t.stopPropagation()),t.on("pointertap",t=>{ - t.stopPropagation(),queueMicrotask(n)} - )} - ,"roundBtn"); - h(this.maxBtn,(new ep).roundRect(-4.5,-4.5,9,9,1.5).stroke(n),106,new $i(-16,-18,30,36),()=>this.expand()),h(this.closeBtn,(new ep).moveTo(-4.5,-4.5).lineTo(4.5,4.5).moveTo(4.5,-4.5).lineTo(-4.5,4.5).stroke(n),134,new $i(-14,-18,32,36),()=>this.turnOff()); - for(const r of[this.edge,this.clip,this.clipMask,this.ring,this.bang,this.fish,this.num])r.eventMode="none"; - this.body.addChild(this.edge,this.clip,this.clipMask,this.ring,this.bang,this.fish,this.num,this.maxBtn,this.closeBtn),this.addChild(this.body),this.eventMode="static",this.cursor="grab",this.hitArea=new $i(-3,-3,156,159),this.on("pointerdown",t=>this.onDown(t)),this.on("globalpointermove",t=>this.onMove(t)),this.on("pointerup",t=>this.onUp(t)),this.on("pointerupoutside",t=>this.onUp(t)),this.timer.addEventListener("timer",()=>this.onTimer())} - static getInstance(){ - return this.instance??(this.instance=new t)} - static get isOn(){ - var t; - return!!(null==(t=this.instance)?void 0:t.parent)} - static capture(){ - try{ - const t=Y$i.getInstance().scene,i=t.boatPos; - if(!i)return null; - const s=t.toLocal(t.worldToGlobal(i.x,i.y)),e=fVi(s.x,s.y),n=SS.app.renderer; - return n.generateTexture({ - target:t,frame:new $i(e.x,e.y,e.w,e.h),resolution:Math.min(2,n.resolution)*mVi/hVi} - )} - catch(frt){ - return null} - } - show(t){ - this.setShot(t); - const i=!this.parent; - if(i&&zci.getInstance().addChild(this),this.place(this.pos.x,this.pos.y,!1),this.clock=0,this.sampleAt=0,this.biteK=this.biteAt=this.catchAt=this.hitAt=this.netHold=null,this.view=null,this.stripSig=this.fixSig="",this.frame(0),!i)return; - SS.app.ticker.add(this.onFrame),SS.stage.on("resized",this.onResize),this.timer.start(); - const s=ixi.getInstance(),e=APi.getInstance(); - e.on("added",this.onShellOpen),this.unsub.push(()=>e.off("added",this.onShellOpen),s.onCatch(t=>this.onCatch(t)),s.onBoatLog(t=>this.onLogs(t)),s.onSeasonChange(t=>{ - "open"!==t.phase&&this.turnOff(!1)} - )),yx.fromTo(this.scale,{ - x:.82,y:.82} - ,{ - x:1,y:1,duration:.22,ease:"back.out(2.2)"} - )} - hide(){ - if(this.parent){ - SS.app.ticker.remove(this.onFrame),SS.stage.off("resized",this.onResize),this.timer.stop(); - for(const t of this.unsub)t(); - this.unsub=[],yx.killTweensOf(this),yx.killTweensOf(this.scale),this.down=null,this.parent.removeChild(this),this.setShot(null)} - } - turnOff(t=!0){ - if(!this.parent)return; - if(this.hide(),this.fake)return; - const i=ixi.getInstance(); - i.open=!1,i.flushHooks(),t&&bH.getInstance().showMessage("낚시를 껐어요 · 꺼 둔 동안에도 천천히 잡혀요")} - previewCatch(t){ - this.onCatch({ - id:t,broken:!1} - )} - previewHit(t){ - this.onLogs([{ - kind:"hazard",dmg:t} - ])} - onCatch(t){ - var i; - if(t.broken)return; - const s=NAi.fish(t.id); - this.fish.texture=s,this.fishBase=44/Math.max(1,s.width,s.height),Qki(t)||(this.netHold??(this.netHold=(null==(i=this.view)?void 0:i.net)??null)),this.catchAt=this.clock} - onLogs(t){ - const{ - main:i} - =zFi(t),s=t.some(t=>"broke"===t.kind); - (i||s)&&(this.num.text=i?`−${ - Math.round(i.dmg)} - `:"",this.num.x=(mVi-this.num.width)/2,this.hitAt=this.clock)} - liveView(){ - const t=ixi.getInstance(); - if(!t.ready||!t.state)return null; - const i=t.boatHp(),s=t.biteOpen(); - return{ - net:t.netCount(),cap:t.netCap,hp:i.hp,max:i.max,fixing:i.fixing,broken:i.broken,boatLv:t.state.gear.boat,bite:s?s.k:null} - } - frame(t){ - if(this.clock+=t/1e3*this.speed,this.clock>=this.sampleAt){ - this.sampleAt=this.clock+.1; - const t=this.fake??this.liveView(); - t&&(this.view=t,t.bite!==this.biteK&&(this.biteK=t.bite,this.biteAt=null==t.bite?null:this.clock),this.drawStrip(t),this.drawFix(t))} - const i=Qt(t=>null==t?null:this.clock-t,"since"),s=uVi({ - bite:i(this.biteAt),catch:i(this.catchAt),hit:i(this.hitAt)} - ,this.path); - this.body.x=s.shake,this.ring.alpha=s.ring,this.bang.visible=s.bang>.01,this.bang.scale.set(s.bang),this.bang.y=37+s.bangY,this.fish.visible=s.fishAlpha>0,this.fish.alpha=s.fishAlpha,this.fish.position.set(s.fishX,s.fishY),this.fish.scale.set(this.fishBase*s.fishScale),this.netNum.scale.set(s.netScale),this.flash.alpha=s.flash,this.num.alpha=s.numAlpha,this.num.y=50-this.num.height/2+s.numY,null!=this.netHold&&(null==this.catchAt||this.clock-this.catchAt>=rVi)&&(this.netHold=null,this.view&&this.drawStrip(this.view)),null!=this.catchAt&&this.clock-this.catchAt>1.05&&(this.catchAt=null),null!=this.hitAt&&this.clock-this.hitAt>1.3&&(this.hitAt=null)} - drawStrip(t){ - const i=this.netHold??t.net,s=t.hp/Math.max(1,t.max),e=t.fixing?"수리":t.broken?"고장":`${ - Math.ceil(100*s)} - %`,n=`${ - i} - |${ - t.cap} - |${ - e} - |${ - t.boatLv} - |${ - t.fixing} - `; - if(n===this.stripSig)return; - this.stripSig=n,this.netText.text=`${ - i} - `,this.netText.textColor=i>=t.cap?wVi:Bxi,this.hpText.text=e,this.hpText.textColor=t.fixing?gVi:s<=.25?wVi:Bxi; - const h=NAi.menuIcon("net"); - this.netIcon.visible=!!h,h&&(this.netIcon.texture=h,this.netIcon.width=this.netIcon.height=22),this.boatIcon.texture=NAi.boatBig(t.boatLv),this.boatIcon.width=this.boatIcon.height=20; - const r=(h?25:0)+this.netText.width,o=23+this.hpText.width,a=Math.max(0,mVi-r-o),c=133,l=a/4,u=l+r+a/2; - this.netIcon.position.set(l,122); - const d=l+(h?25:0); - this.netText.position.set(-this.netText.width/2,-this.netText.height/2),this.netNum.position.set(d+this.netText.width/2,c),this.boatIcon.position.set(u,123),this.hpText.position.set(u+23,c-this.hpText.height/2),this.path={ - from:{ - x:75,y:54.519999999999996} - ,to:{ - x:l+11,y:c} - } - ,this.shot.visible||this.drawBoatAlt(t.boatLv)} - drawFix(t){ - if(this.fix.visible=t.fixing,!t.fixing)return void(this.fixSig=""); - const i=Math.max(0,Math.min(1,t.hp/Math.max(1,t.max))),s=i.toFixed(2); - if(s===this.fixSig)return; - this.fixSig=s; - this.fixRing.clear().circle(75,58,28).stroke({ - color:16777215,alpha:.13,width:7} - ),i>0&&this.fixRing.moveTo(75,30).arc(75,58,28,-Math.PI/2,-Math.PI/2+2*Math.PI*i).stroke({ - color:gVi,width:7,cap:"round"} - )} - setShot(t){ - this.shotTex&&this.shotTex!==t&&this.shotTex.destroy(!0),this.shotTex=t,this.shot.texture=t??ls.EMPTY,this.shot.width=this.shot.height=mVi,this.shot.visible=!!t,this.boatAlt.visible=!t} - drawBoatAlt(t){ - const i=NAi.boat(t); - this.boatAlt.texture=i,this.boatAlt.scale.set(64/Math.max(1,i.width,i.height))} - onDown(t){ - var i; - const s=null==(i=this.parent)?void 0:i.toLocal(t.global); - s&&(yx.killTweensOf(this),this.down={ - sx:s.x,sy:s.y,x:this.x,y:this.y,moved:!1,id:t.pointerId} - )} - onMove(t){ - const i=this.down; - if(!i||t.pointerId!==i.id||!this.parent)return; - const s=this.parent.toLocal(t.global),e=s.x-i.sx,n=s.y-i.sy; - if(!i.moved&&Math.hypot(e,n)<6)return; - i.moved=!0; - const{ - w:h,h:r} - =this.screen(); - this.position.set(Math.max(-75,Math.min(h-75,i.x+e)),Math.max(0,Math.min(r-mVi,i.y+n)))} - onUp(t){ - const i=this.down; - i&&t.pointerId===i.id&&(this.down=null,i.moved?this.place(this.x,this.y,!0):this.tap())} - tap(){ - var t; - if(this.fake)return void(null==(t=this.onPreviewTap)||t.call(this)); - const i=ixi.getInstance(); - i.hookable()&&i.hook().then(t=>{ - t.message&&bH.getInstance().showMessage(t.message)} - )} - expand(){ - ei(()=>Promise.resolve().then(()=>sVi),void 0).then(t=>t.FishingFlow.openTab("fish"))} - screen(){ - return{ - w:SS.stageWidth||640,h:SS.safeHeight||1280} - } - place(t,i,s){ - const{ - w:e,h:n} - =this.screen(),h=dVi(t,i,e,n); - this.pos=h,MVi(h),s?yx.to(this,{ - x:h.x,y:h.y,duration:.18,ease:"power2.out"} - ):this.position.set(h.x,h.y)} - onTimer(){ - if(this.fake)return; - const t=ixi.getInstance(); - if(!t.ready)return; - const i="undefined"==typeof document||"visible"===document.visibilityState; - t.open=i&&!d5t.getInstance().isActive,t.tick()} - } - ; - Qt(bVi,"FishingMiniWindow"),Zt(bVi,"instance",null); - let yVi=bVi; - const EVi=Object.freeze(Object.defineProperty({ - __proto__:null,FishingMiniWindow:yVi} - ,Symbol.toStringTag,{ - value:"Module"} - )),AVi=class t extends pB{ - constructor(){ - super(),Zt(this,"lblMessage"),Zt(this,"btnGoogle"),Zt(this,"btnApple"),Zt(this,"btnGuest"),Zt(this,"resolveChoice",null),this.btnClose.visible=!1,this.title=NB.getText("COMMON_429","로그인"); - const t=hD.LABEL_OPTION_NO_DROP_SHADOW; - t.fill=hD.COLOR_WHITE,t.fontSize=20,t.lineHeight=30; - const i=NB.getText("COMMON_430","로그인 방법을 선택해 주세요."); - this.lblMessage=new iG(i,t.fill,t),this.addChild(this.lblMessage),hD.setLabelWrapWidth(this.lblMessage,this.width-80),this.btnGoogle=new bKt("Google"),this.addChild(this.btnGoogle),this.btnGoogle.onClick=this.onGoogleBtnClick.bind(this),this.btnApple=new bKt("Apple"),this.addChild(this.btnApple),this.btnApple.onClick=this.onAppleBtnClick.bind(this),this.btnGuest=new bKt("Guest"),this.addChild(this.btnGuest),this.btnGuest.onClick=this.onGuestBtnClick.bind(this),this.updateLayout()} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - updateLayout(){ - this.lblMessage.x=.5*(this.width-this.lblMessage.width),this.lblMessage.y=90,this.btnGoogle.x=.5*this.width,this.btnApple.x=this.btnGoogle.x,this.btnGuest.x=this.btnGoogle.x; - const t=[],i=OG.getInstance(); - "android"==i.buildType?(t.push(this.btnGoogle),1!=i.isPlayGamesPC&&t.push(this.btnApple)):(t.push(this.btnApple),t.push(this.btnGoogle)),t.push(this.btnGuest),t.includes(this.btnApple)?this.btnApple.visible=!0:this.btnApple.visible=!1; - let s=this.lblMessage.y+this.lblMessage.height+.5*t[0].height+30; - const e=t.length; - for(let n=0; - n<e; - ++n)t[n].y=s,s+=t[n].height+15; - this.height=this.btnGuest.y+this.btnGuest.height+40} - async waitForChoice(){ - return new Promise(t=>{ - this.resolveChoice=t,this.show()} - )} - onGoogleBtnClick(){ - this.hide(),this.resolveChoice&&(this.resolveChoice("google"),this.resolveChoice=null)} - onAppleBtnClick(){ - this.hide(),this.resolveChoice&&(this.resolveChoice("apple"),this.resolveChoice=null)} - onGuestBtnClick(){ - this.hide(),this.resolveChoice&&(this.resolveChoice("guest"),this.resolveChoice=null)} - onCloseBtnClick(){ - } - onBackButton(){ - return!1} - } - ; - Qt(AVi,"CapacitorLoginPopup"),Zt(AVi,"_instance"); - let SVi=AVi; - const TVi=Object.freeze(Object.defineProperty({ - __proto__:null,CapacitorLoginPopup:SVi} - ,Symbol.toStringTag,{ - value:"Module"} - )),CVi=class t extends pB{ - constructor(){ - super(),Zt(this,"lblMessage"),Zt(this,"btnConfirm"),Zt(this,"btnCancel"),this.title="게임종료",this.btnClose.removeFromParent(); - const t=hD.MENU_LABEL_OPTION; - t.fill=hD.DEFAULT_COLOR,t.fontSize=20,t.lineHeight=28,t.align="center",this.lblMessage=new iG("게임을 종료하시겠습니까?",t.fill,t),this.lblMessage.y=90,this.addChild(this.lblMessage),hD.setLabelWrapWidth(this.lblMessage,this.width-60),this.btnConfirm=new aB("확인"),this.addChild(this.btnConfirm),this.btnConfirm.onClick=this.onConfirmClick.bind(this),this.btnCancel=new Hjt("취소"),this.addChild(this.btnCancel),this.btnCancel.onClick=this.onCancelClick.bind(this),this.updateLayout()} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - updateLayout(){ - this.lblMessage.x=.5*(this.width-this.lblMessage.width),this.btnConfirm.x=.5*(this.width-this.btnConfirm.width-this.btnCancel.width-20),this.btnCancel.x=this.btnConfirm.x+this.btnConfirm.width+20,this.btnConfirm.y=this.lblMessage.y+this.lblMessage.height+30,this.btnCancel.y=this.btnConfirm.y,this.height=this.btnConfirm.y+this.btnConfirm.height+50} - setData(){ - this.title=NB.getText("COMMON_427","게임종료"),this.lblMessage.text=NB.getText("COMMON_428","게임을 종료하시겠습니까?"),this.btnConfirm.text=NB.getText("COMMON_1","확인"),this.btnCancel.text=NB.getText("COMMON_2","취소"),this.updateLayout()} - onConfirmClick(){ - this.hide(); - try{ - VG().exitApp()} - catch(t){ - } - } - onCancelClick(){ - this.hide()} - } - ; - Qt(CVi,"GameExitPopup"),Zt(CVi,"_instance"); - let OVi=CVi; - const IVi=class t{ - static getInstance(){ - return t.instance||(t.instance=new t),t.instance} - constructor(){ - } - onBackButton(){ - const t=SS.stage.children.length; - if(t>0){ - let i; - for(let s=t-1; - s>-1; - --s)if(i=SS.stage.getChildAt(s),"function"==typeof i.onBackButton&&i.onBackButton())return!1} - if(hai.getInstance().activated)return hai.getInstance().close(),!1; - if(LG.getInstance().hasPopup){ - const t=LG.getInstance().children.length-1,i=LG.getInstance().getChildAt(t); - if("function"==typeof i.onBackButton&&i.onBackButton())return!1} - if(Mci.getInstance().children.length>0){ - const t=Mci.getInstance().children.length-1,i=Mci.getInstance().getChildAt(t); - if("function"==typeof i.onBackButton&&i.onBackButton())return!1} - if(A$.getInstance().children.length>0){ - const t=A$.getInstance().children.length-1,i=A$.getInstance().getChildAt(t); - if("function"==typeof i.onBackButton&&i.onBackButton())return!1} - return OVi.getInstance().parent?OVi.getInstance().hide():(OVi.getInstance().setData(),OVi.getInstance().show()),!0} - } - ; - Qt(IVi,"BackButtonManager"),Zt(IVi,"instance"); - let kVi=IVi; - const xVi=class t{ - constructor(){ - Zt(this,"registering",!1),Zt(this,"backButtonHandle"),Zt(this,"handleBackPress",Qt(()=>{ - kVi.getInstance().onBackButton()} - ,"handleBackPress"))} - static getInstance(){ - return t.instance||(t.instance=new t),t.instance} - async registerHandler(){ - if("android"===WKt.getPlatform()&&WKt.isNativePlatform()&&!this.registering){ - this.registering=!0; - try{ - await this.unregisterHandler(),this.backButtonHandle=await Evi.addListener("backButton",this.handleBackPress)} - finally{ - this.registering=!1} - } - } - async unregisterHandler(){ - this.backButtonHandle&&(await this.backButtonHandle.remove(),this.backButtonHandle=void 0)} - } - ; - Qt(xVi,"MobileBackButtonManager"),Zt(xVi,"instance"); - let RVi=xVi; - const PVi=Object.freeze(Object.defineProperty({ - __proto__:null,MobileBackButtonManager:RVi} - ,Symbol.toStringTag,{ - value:"Module"} - )),NVi=class t extends oii{ - constructor(){ - super(),this.className="UI_GOLD"} - remove(){ - t.addRecycle(this)} - static getPiece(){ - let i; - return i=this.pool.length>0?this.pool.pop():new t,i.initialize(),i} - static addRecycle(t){ - t.removeFromParent(),t.removeAllListeners(),this.pool.push(t)} - } - ; - Qt(NVi,"GoldPiece"),Zt(NVi,"pool",[]); - let LVi=NVi; - const DVi=class t extends pB{ - constructor(){ - super(),Zt(this,"lblDesc"),Zt(this,"lblOfflineTime"),Zt(this,"lblWaveResult"),Zt(this,"lblBuffInfo"),Zt(this,"lblGoldLabel"),Zt(this,"lblGoldValue"),Zt(this,"lblRules"),Zt(this,"btnConfirm"),Zt(this,"onConfirmCallback",null),Zt(this,"goldReward",0),Zt(this,"image"),Zt(this,"numGoldRemained",0),this.width=520,this.title=NB.getText("GAME_338","오프라인 전투"),this.btnClose.removeFromParent(),this.lblDesc=new iG("",13421772,hD.DEFAULT_FONT_OPTION_16),this.lblDesc.text=NB.getText("GAME_339","영주님,\n부재중에도 용감한 기사들이 전투를 이어갔습니다."),hD.setLabelWrapWidth(this.lblDesc,this.width-50),this.contentContainer.addChild(this.lblDesc),this.lblOfflineTime=new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_17),this.contentContainer.addChild(this.lblOfflineTime),this.lblWaveResult=new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_17),this.contentContainer.addChild(this.lblWaveResult),this.lblBuffInfo=new iG("",11206570,hD.DEFAULT_FONT_OPTION_16),this.lblBuffInfo.visible=!1,this.contentContainer.addChild(this.lblBuffInfo),this.lblGoldLabel=new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_17),this.contentContainer.addChild(this.lblGoldLabel),this.lblGoldValue=new OF("UI_GOLD","",16768324,hD.DEFAULT_OUTLINE_FONT_OPTION_17),this.contentContainer.addChild(this.lblGoldValue); - const t=NB.getValueReplaceMulti("GAME_340",["##","@@"],[1,60],"전투는 1분에 1층씩, 최고기록의 60%까지 진행됩니다."),i=NB.getText("GAME_341","골드는 온라인의 50% 효율이고, 최대 1시간 동안만 획득됩니다."); - this.lblRules=new iG(`# ${ - t} - \n# ${ - i} - `,6710886,hD.DEFAULT_FONT_OPTION_16),hD.setLabelWrapWidth(this.lblRules,this.width-70),this.contentContainer.addChild(this.lblRules),this.btnConfirm=new aKt(NB.getText("COMMON_1","확인"),200),this.btnConfirm.height=52,this.contentContainer.addChild(this.btnConfirm),this.btnConfirm.onClick=()=>this.onConfirm()} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - calculateOfflineGold(t){ - const i=lG.getInstance().list,s=Math.min(t,3600); - if(s<=0)return 0; - const e=1e3*s; - let n=0; - for(const h of i){ - if(!h.isOpen||0===h.level)continue; - const t=h.effectiveDurationMs; - t<=0||(n+=Math.floor(e/t)*h.gold)} - return Math.floor(.5*n)} - async showResult(t){ - this.title=NB.getText("GAME_338","오프라인 전투"),this.lblDesc.text=NB.getText("GAME_339","영주님,\n부재중에도 용감한 기사들이 전투를 이어갔습니다."),this.btnConfirm.text=NB.getText("COMMON_1","확인"); - const{ - beforeWave:i,afterWave:s,offlineMinutes:e,offlineSeconds:n} - =t,h=Math.floor(e/60),r=Math.floor(e%60); - let o=""; - o=h>0?NB.getValueReplaceMulti("COMMON_432",["##","@@"],[h,r],`${ - h} - 시간 ${ - r} - 분`):NB.getValueReplace("COMMON_433","##",r,`${ - r} - 분`),this.lblOfflineTime.text=`${ - NB.getText("GAME_342","오프라인 시간")} - : ${ - o} - `,this.lblWaveResult.text=`${ - NB.getText("GAME_338","오프라인 전투")} - : ${ - i} - wave → ${ - s} - wave`; - const a=wP.getCitadelOwnershipTotalWithAwakening(dR.OfflineMax),c=wP.getCitadelOwnershipTotalWithAwakening(dR.OfflineSpeed),l=[]; - if(a>0){ - const t=60+a; - l.push(`# ${ - NB.getValueReplaceMulti("GAME_692",["##","@@"],[a,t],`망루버프 : +${ - a} - % (${ - t} - %)`)} - `)} - if(c>0){ - const t=(1+c/100).toFixed(2); - l.push(`# ${ - NB.getValueReplaceMulti("GAME_693",["##","@@"],[c,t],`훈련소 버프 : +${ - c} - % (1분당 ${ - t} - Wave)`)} - `)} - l.length>0?(this.lblBuffInfo.text=l.join("\n"),this.lblBuffInfo.textColor=11206570,this.lblBuffInfo.visible=!0):this.lblBuffInfo.visible=!1; - const u=(1+c/100).toFixed(2),d=60+a,f=NB.getValueReplaceMulti("GAME_340",["##","@@"],[u,d],`전투는 1분에 ${ - u} - 층씩, 최고기록의 ${ - d} - %까지 진행됩니다.`),p=NB.getText("GAME_341","골드는 온라인의 50% 효율이고, 최대 1시간 동안만 획득됩니다."); - if(this.lblRules.text=`# ${ - f} - \n# ${ - p} - `,this.goldReward=n?this.calculateOfflineGold(n):0,this.goldReward>0?(this.lblGoldLabel.text=`${ - NB.getText("GAME_343","오프라인 골드")} - : +`,this.lblGoldValue.text=qD.displayLargeNumberAsAlphabet(this.goldReward),this.lblGoldLabel.visible=!0,this.lblGoldValue.visible=!0):(this.lblGoldLabel.visible=!1,this.lblGoldValue.visible=!1),!this.image){ - this.image=new Xe,this.image.eventMode="none",this.addChildAt(this.image,0); - const{ - AssetPathManager:t} - =await ei(async()=>{ - const{ - AssetPathManager:t} - =await Promise.resolve().then(()=>kS); - return{ - AssetPathManager:t} - } - ,void 0),{ - Assets:i} - =await ei(async()=>{ - const{ - Assets:t} - =await Promise.resolve().then(()=>cE); - return{ - Assets:t} - } - ,void 0),s=t.getAssetPath("CharOffline.png"),e=await i.load(s); - this.image.texture=e,this.image.x=this.width-this.image.width-20,this.image.y=5-this.image.height} - this.updateLayout(),super.show()} - updateLayout(){ - const t=.5*this.width,i=35; - let s=85; - this.lblDesc.x=i,this.lblDesc.y=s,s+=this.lblDesc.height+22,this.lblOfflineTime.x=i,this.lblOfflineTime.y=s,s+=28,this.lblWaveResult.x=i,this.lblWaveResult.y=s,s+=28,this.lblBuffInfo.visible&&(this.lblBuffInfo.x=45,this.lblBuffInfo.y=s,s+=this.lblBuffInfo.height+10),this.lblGoldLabel.visible&&(this.lblGoldLabel.x=i,this.lblGoldLabel.y=s,this.lblGoldValue.x=i+this.lblGoldLabel.width,this.lblGoldValue.y=s,s+=45),s+=12,this.lblRules.x=i,this.lblRules.y=s,s+=this.lblRules.height+32,this.btnConfirm.x=t-.5*this.btnConfirm.width,this.btnConfirm.y=s,this.height=this.btnConfirm.y+this.btnConfirm.height+40} - setOnConfirm(t){ - this.onConfirmCallback=t} - onConfirm(){ - this.goldReward>0&&this.spawnGoldCoins(this.goldReward),this.hide(),this.onConfirmCallback&&(this.onConfirmCallback(),this.onConfirmCallback=null)} - spawnGoldCoins(t){ - const i=Math.floor(t/40),s=t-40*i,e=BYt.getInstance(),n=this.lblGoldValue.toGlobal({ - x:.5*this.lblGoldValue.width,y:.5*this.lblGoldValue.height} - ),h=SS.stage.toLocal(n),r=LH.getInstance(),o=SS.stage.toLocal(r.getGlobalPosition()),a=r.getGoldPoint(),c=a.x,l=a.y+o.y; - this.numGoldRemained=40; - for(let u=0; - u<40; - u++){ - const t=LVi.getPiece(); - t.value=0===u?i+s:i,e.addChild(t),t.x=h.x+80*(Math.random()-.5),t.y=h.y+30*(Math.random()-.5); - const n=2*Math.PI*Math.random(),r=25+25*Math.random(),o=t.x+r*Math.cos(n),a=t.y+r*Math.sin(n),d=c+7-14*Math.random(),f=l+7-14*Math.random(),p=.1+.15*Math.random(),w=.15+.15*Math.random(); - t.start(o,a,d,f,p,w,()=>{ - t.remove(),LH.getInstance().startGoldMotion(null,1.1),Sii.play(d,f),this.numGoldRemained--,TG.gold+=t.value,LH.getInstance().updateGold()} - )} - } - getDefaultPositionY(){ - return.4*SS.stageHeight} - } - ; - Qt(DVi,"OfflinePopup"),Zt(DVi,"_instance"); - let GVi=DVi; - const BVi=Object.freeze(Object.defineProperty({ - __proto__:null,OfflinePopup:GVi} - ,Symbol.toStringTag,{ - value:"Module"} - )),UVi=class{ - static async enable(){ - this.enabled||(this.enabled=!0,this.listenerAttached||(document.addEventListener("visibilitychange",this.onVisibilityChange),this.listenerAttached=!0),await this.acquire())} - static async disable(){ - this.enabled=!1,this.listenerAttached&&(document.removeEventListener("visibilitychange",this.onVisibilityChange),this.listenerAttached=!1),await this.release()} - static async acquire(){ - if(!this.wakeLock&&"wakeLock"in navigator)try{ - this.wakeLock=await navigator.wakeLock.request("screen"),this.wakeLock.addEventListener("release",()=>{ - this.wakeLock=null} - )} - catch(frt){ - } - } - static async release(){ - if(this.wakeLock){ - try{ - await this.wakeLock.release()} - catch(frt){ - } - this.wakeLock=null} - } - } - ; - Qt(UVi,"KeepScreenAwake"),Zt(UVi,"wakeLock",null),Zt(UVi,"enabled",!1),Zt(UVi,"listenerAttached",!1),Zt(UVi,"onVisibilityChange",Qt(async()=>{ - UVi.enabled&&"visible"===document.visibilityState&&await UVi.acquire()} - ,"onVisibilityChange")); - let FVi=UVi; - const $Vi=Object.freeze(Object.defineProperty({ - __proto__:null,KeepScreenAwake:FVi} - ,Symbol.toStringTag,{ - value:"Module"} - )),HVi=[{ - id:9999} - ,{ - id:9998} - ]; - async function WVi(){ - return(await ei(()=>Promise.resolve().then(()=>q3i),void 0)).LocalNotifications} - async function VVi(){ - try{ - const{ - Capacitor:t} - =await ei(async()=>{ - const{ - Capacitor:t} - =await Promise.resolve().then(()=>czt); - return{ - Capacitor:t} - } - ,void 0); - return t.isNativePlatform()} - catch{ - return!1} - } - Qt(WVi,"getLocalNotifications"),Qt(VVi,"isCapacitor"); - const jVi=class t{ - constructor(){ - Zt(this,"intervalId",null),Zt(this,"initialized",!1),Zt(this,"available",!1),Zt(this,"enteredFromPush",!1),Zt(this,"tappedNotificationId",0)} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - async init(){ - if(!this.initialized&&(this.initialized=!0,this.available=await VVi(),this.available)){ - try{ - const t=await WVi(); - if("granted"!==(await t.requestPermissions()).display)return void(this.available=!1); - t.addListener("localNotificationActionPerformed",t=>{ - this.enteredFromPush=!0,this.tappedNotificationId=t.notification.id} - )} - catch(frt){ - return void(this.available=!1)} - this.cancelAll(),this.scheduleAll(),this.intervalId=setInterval(()=>{ - this.scheduleAll()} - ,3e5)} - } - async cancelAll(){ - if(this.available)try{ - const t=await WVi(); - await t.cancel({ - notifications:HVi} - )} - catch{ - } - } - onBackground(){ - this.scheduleAll()} - onForeground(){ - this.cancelAll()} - destroy(){ - this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null),this.cancelAll()} - async scheduleAll(){ - if(this.available)try{ - const t=await WVi(); - await t.cancel({ - notifications:HVi} - ); - const i=this.calcScheduledTime(4),s=this.calcScheduledTime(24); - await t.schedule({ - notifications:[{ - id:9999,title:NB.getText("PUSH_1","환생 디펜스 2"),body:NB.getText("PUSH_2","영웅들이 기다리고 있어요! 돌아와서 전투를 이어가세요."),schedule:{ - at:i} - ,sound:void 0,smallIcon:"ic_stat_icon_config_sample",iconColor:"#488AFF"} - ,{ - id:9998,title:NB.getText("PUSH_1","환생 디펜스 2"),body:NB.getText("PUSH_3","오랜만이에요! 영웅들이 당신을 기다리고 있어요."),schedule:{ - at:s} - ,sound:void 0,smallIcon:"ic_stat_icon_config_sample",iconColor:"#488AFF"} - ]} - )} - catch(frt){ - } - } - calcScheduledTime(t){ - const i=new Date((new Date).getTime()+60*t*60*1e3),s=i.getHours(); - if(s>=22||s<9){ - const t=new Date(i); - return s>=22&&t.setDate(t.getDate()+1),t.setHours(9,0,0,0),t} - return i} - } - ; - Qt(jVi,"LocalPushManager"),Zt(jVi,"_instance"); - let KVi=jVi; - const zVi=Object.freeze(Object.defineProperty({ - __proto__:null,LocalPushManager:KVi} - ,Symbol.toStringTag,{ - value:"Module"} - )),YVi=class t extends pB{ - constructor(){ - super(),Zt(this,"lblMessage"),Zt(this,"btnGoogle"),Zt(this,"btnApple"),Zt(this,"resolveChoice",null),this.btnClose.visible=!1,this.title=NB.getText("COMMON_429","로그인"); - const t=hD.LABEL_OPTION_NO_DROP_SHADOW; - t.fill=hD.COLOR_WHITE,t.fontSize=20,t.lineHeight=30,t.align="center"; - const i=NB.getText("COMMON_506","원활한 계정 이용을 위해\n다시 로그인을 진행해 주세요."); - this.lblMessage=new iG(i,t.fill,t),this.addChild(this.lblMessage),hD.setLabelWrapWidth(this.lblMessage,this.width-80),this.btnGoogle=new bKt("Google"),this.addChild(this.btnGoogle),this.btnGoogle.onClick=this.onGoogleBtnClick.bind(this),this.btnApple=new bKt("Apple"),this.addChild(this.btnApple),this.btnApple.onClick=this.onAppleBtnClick.bind(this),this.updateLayout()} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - updateLayout(){ - this.lblMessage.x=.5*(this.width-this.lblMessage.width),this.lblMessage.y=90,this.btnGoogle.x=.5*this.width,this.btnApple.x=this.btnGoogle.x; - const t=[],i=OG.getInstance(); - "android"==i.buildType?(t.push(this.btnGoogle),1!=i.isPlayGamesPC&&t.push(this.btnApple)):(t.push(this.btnApple),t.push(this.btnGoogle)),t.includes(this.btnApple)?this.btnApple.visible=!0:this.btnApple.visible=!1; - let s=this.lblMessage.y+this.lblMessage.height+.5*t[0].height+30; - const e=t.length; - for(let h=0; - h<e; - ++h)t[h].y=s,s+=t[h].height+15; - const n=t[t.length-1]; - this.height=n.y+n.height+40} - async waitForChoice(){ - return new Promise(t=>{ - this.resolveChoice=t,this.show()} - )} - onGoogleBtnClick(){ - this.hide(),this.resolveChoice&&(this.resolveChoice("google"),this.resolveChoice=null)} - onAppleBtnClick(){ - this.hide(),this.resolveChoice&&(this.resolveChoice("apple"),this.resolveChoice=null)} - onCloseBtnClick(){ - } - onBackButton(){ - return!1} - } - ; - Qt(YVi,"CapacitorLoginPopup2"),Zt(YVi,"_instance"); - let qVi=YVi; - const XVi=Object.freeze(Object.defineProperty({ - __proto__:null,CapacitorLoginPopup2:qVi} - ,Symbol.toStringTag,{ - value:"Module"} - )),JVi=class extends KKt{ - constructor(){ - super(...arguments),this.group="CapacitorStorage"} - async configure({ - group:t} - ){ - "string"==typeof t&&(this.group=t)} - async get(t){ - return{ - value:this.impl.getItem(this.applyPrefix(t.key))} - } - async set(t){ - this.impl.setItem(this.applyPrefix(t.key),t.value)} - async remove(t){ - this.impl.removeItem(this.applyPrefix(t.key))} - async keys(){ - return{ - keys:this.rawKeys().map(t=>t.substring(this.prefix.length))} - } - async clear(){ - for(const t of this.rawKeys())this.impl.removeItem(t)} - async migrate(){ - var t; - const i=[],s=[],e=Object.keys(this.impl).filter(t=>0===t.indexOf("_cap_")); - for(const n of e){ - const e=n.substring(5),h=null!==(t=this.impl.getItem(n))&&void 0!==t?t:"",{ - value:r} - =await this.get({ - key:e} - ); - "string"==typeof r?s.push(e):(await this.set({ - key:e,value:h} - ),i.push(e))} - return{ - migrated:i,existing:s} - } - async removeOld(){ - const t=Object.keys(this.impl).filter(t=>0===t.indexOf("_cap_")); - for(const i of t)this.impl.removeItem(i)} - get impl(){ - return window.localStorage} - get prefix(){ - return"NativeStorage"===this.group?"":`${ - this.group} - .`} - rawKeys(){ - return Object.keys(this.impl).filter(t=>0===t.indexOf(this.prefix))} - applyPrefix(t){ - return this.prefix+t} - } - ; - Qt(JVi,"PreferencesWeb"); - let QVi=JVi; - const ZVi=Object.freeze(Object.defineProperty({ - __proto__:null,PreferencesWeb:QVi} - ,Symbol.toStringTag,{ - value:"Module"} - )),tji=class extends KKt{ - async getId(){ - return{ - identifier:this.getUid()} - } - async getInfo(){ - if("undefined"==typeof navigator||!navigator.userAgent)throw this.unavailable("Device API not available in this browser"); - const t=navigator.userAgent,i=this.parseUa(t); - return{ - model:i.model,platform:"web",operatingSystem:i.operatingSystem,osVersion:i.osVersion,manufacturer:navigator.vendor,isVirtual:!1,webViewVersion:i.browserVersion} - } - async getBatteryInfo(){ - if("undefined"==typeof navigator||!navigator.getBattery)throw this.unavailable("Device API not available in this browser"); - let t={ - } - ; - try{ - t=await navigator.getBattery()} - catch(frt){ - } - return{ - batteryLevel:t.level,isCharging:t.charging} - } - async getLanguageCode(){ - return{ - value:navigator.language.split("-")[0].toLowerCase()} - } - async getLanguageTag(){ - return{ - value:navigator.language} - } - parseUa(t){ - const i={ - } - ,s=t.indexOf("(")+1; - let e=t.indexOf(") AppleWebKit"); - -1!==t.indexOf(") Gecko")&&(e=t.indexOf(") Gecko")); - const n=t.substring(s,e); - if(-1!==t.indexOf("Android")){ - const t=n.replace("; - wv","").split("; - ").pop(); - t&&(i.model=t.split(" Build")[0]),i.osVersion=n.split("; - ")[1]} - else if(i.model=n.split("; - ")[0],"undefined"!=typeof navigator&&navigator.oscpu)i.osVersion=navigator.oscpu; - else if(-1!==t.indexOf("Windows"))i.osVersion=n; - else{ - const t=n.split("; - ").pop(); - if(t){ - const s=t.replace(" like Mac OS X","").split(" "); - i.osVersion=s[s.length-1].replace(/_/g,".")} - } - /android/i.test(t)?i.operatingSystem="android":/iPad|iPhone|iPod/.test(t)&&!window.MSStream?i.operatingSystem="ios":/Win/.test(t)?i.operatingSystem="windows":/Mac/i.test(t)?i.operatingSystem="mac":i.operatingSystem="unknown"; - const h=!!window.ApplePaySession,r=!!window.chrome,o=/Firefox/.test(t),a=/Edg/.test(t),c=/FxiOS/.test(t),l=/CriOS/.test(t),u=/EdgiOS/.test(t); - if(h||r&&!a||c||l||u){ - let s; - s=c?"FxiOS":l?"CriOS":u?"EdgiOS":h?"Version":"Chrome"; - const e=t.split(" "); - for(const t of e)if(t.includes(s)){ - const s=t.split("/")[1]; - i.browserVersion=s} - } - else if(o||a){ - const s=t.split("").reverse().join("").split("/")[0].split("").reverse().join(""); - i.browserVersion=s} - return i} - getUid(){ - if("undefined"!=typeof window&&window.localStorage){ - let t=window.localStorage.getItem("_capuid"); - return t||(t=this.uuid4(),window.localStorage.setItem("_capuid",t),t)} - return this.uuid4()} - uuid4(){ - return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){ - const i=16*Math.random()|0; - return("x"===t?i:3&i|8).toString(16)} - )} - } - ; - Qt(tji,"DeviceWeb"); - let iji=tji; - const sji=Object.freeze(Object.defineProperty({ - __proto__:null,DeviceWeb:iji} - ,Symbol.toStringTag,{ - value:"Module"} - )),eji=class extends KKt{ - constructor(){ - super(),this.handleVisibilityChange=()=>{ - const t={ - isActive:!0!==document.hidden} - ; - this.notifyListeners("appStateChange",t),document.hidden?this.notifyListeners("pause",null):this.notifyListeners("resume",null)} - ,document.addEventListener("visibilitychange",this.handleVisibilityChange,!1)} - exitApp(){ - throw this.unimplemented("Not implemented on web.")} - async getInfo(){ - throw this.unimplemented("Not implemented on web.")} - async getLaunchUrl(){ - return{ - url:""} - } - async getState(){ - return{ - isActive:!0!==document.hidden} - } - async minimizeApp(){ - throw this.unimplemented("Not implemented on web.")} - async toggleBackButtonHandler(){ - throw this.unimplemented("Not implemented on web.")} - async getAppLanguage(){ - return{ - value:navigator.language.split("-")[0].toLowerCase()} - } - } - ; - Qt(eji,"AppWeb"); - let nji=eji; - const hji=Object.freeze(Object.defineProperty({ - __proto__:null,AppWeb:nji} - ,Symbol.toStringTag,{ - value:"Module"} - )),rji=Qt(()=>{ - } - ,"getDefaultsFromPostinstall"); - var oji={ - } - ; - const aji=Qt(function(t){ - const i=[]; - let s=0; - for(let e=0; - e<t.length; - e++){ - let n=t.charCodeAt(e); - n<128?i[s++]=n:n<2048?(i[s++]=n>>6|192,i[s++]=63&n|128):55296==(64512&n)&&e+1<t.length&&56320==(64512&t.charCodeAt(e+1))?(n=65536+((1023&n)<<10)+(1023&t.charCodeAt(++e)),i[s++]=n>>18|240,i[s++]=n>>12&63|128,i[s++]=n>>6&63|128,i[s++]=63&n|128):(i[s++]=n>>12|224,i[s++]=n>>6&63|128,i[s++]=63&n|128)} - return i} - ,"stringToByteArray$1"),cji=Qt(function(t){ - const i=[]; - let s=0,e=0; - for(; - s<t.length; - ){ - const n=t[s++]; - if(n<128)i[e++]=String.fromCharCode(n); - else if(n>191&&n<224){ - const h=t[s++]; - i[e++]=String.fromCharCode((31&n)<<6|63&h)} - else if(n>239&&n<365){ - const h=((7&n)<<18|(63&t[s++])<<12|(63&t[s++])<<6|63&t[s++])-65536; - i[e++]=String.fromCharCode(55296+(h>>10)),i[e++]=String.fromCharCode(56320+(1023&h))} - else{ - const h=t[s++],r=t[s++]; - i[e++]=String.fromCharCode((15&n)<<12|(63&h)<<6|63&r)} - } - return i.join("")} - ,"byteArrayToString"),lji={ - byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){ - return this.ENCODED_VALS_BASE+"+/="} - ,get ENCODED_VALS_WEBSAFE(){ - return this.ENCODED_VALS_BASE+"-_."} - ,HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(t,i){ - if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter"); - this.init_(); - const s=i?this.byteToCharMapWebSafe_:this.byteToCharMap_,e=[]; - for(let n=0; - n<t.length; - n+=3){ - const i=t[n],h=n+1<t.length,r=h?t[n+1]:0,o=n+2<t.length,a=o?t[n+2]:0,c=i>>2,l=(3&i)<<4|r>>4; - let u=(15&r)<<2|a>>6,d=63&a; - o||(d=64,h||(u=64)),e.push(s[c],s[l],s[u],s[d])} - return e.join("")} - ,encodeString(t,i){ - return this.HAS_NATIVE_SUPPORT&&!i?btoa(t):this.encodeByteArray(aji(t),i)} - ,decodeString(t,i){ - return this.HAS_NATIVE_SUPPORT&&!i?atob(t):cji(this.decodeStringToByteArray(t,i))} - ,decodeStringToByteArray(t,i){ - this.init_(); - const s=i?this.charToByteMapWebSafe_:this.charToByteMap_,e=[]; - for(let n=0; - n<t.length; - ){ - const i=s[t.charAt(n++)],h=n<t.length?s[t.charAt(n)]:0; - ++n; - const r=n<t.length?s[t.charAt(n)]:64; - ++n; - const o=n<t.length?s[t.charAt(n)]:64; - if(++n,null==i||null==h||null==r||null==o)throw new dji; - const a=i<<2|h>>4; - if(e.push(a),64!==r){ - const t=h<<4&240|r>>2; - if(e.push(t),64!==o){ - const t=r<<6&192|o; - e.push(t)} - } - } - return e} - ,init_(){ - if(!this.byteToCharMap_){ - this.byteToCharMap_={ - } - ,this.charToByteMap_={ - } - ,this.byteToCharMapWebSafe_={ - } - ,this.charToByteMapWebSafe_={ - } - ; - for(let t=0; - t<this.ENCODED_VALS.length; - t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)} - } - } - ,uji=class extends Error{ - constructor(){ - super(...arguments),this.name="DecodeBase64StringError"} - } - ; - Qt(uji,"DecodeBase64StringError"); - let dji=uji; - const fji=Qt(function(t){ - const i=aji(t); - return lji.encodeByteArray(i,!0)} - ,"base64Encode"),pji=Qt(function(t){ - return fji(t).replace(/\./g,"")} - ,"base64urlEncodeWithoutPadding"),wji=Qt(function(t){ - try{ - return lji.decodeString(t,!0)} - catch(frt){ - } - return null} - ,"base64Decode"); - function gji(){ - if("undefined"!=typeof self)return self; - if("undefined"!=typeof window)return window; - if("undefined"!=typeof global)return global; - throw new Error("Unable to locate global object.")} - Qt(gji,"getGlobal"); - const mji=Qt(()=>gji().__FIREBASE_DEFAULTS__,"getDefaultsFromGlobal"),vji=Qt(()=>{ - if("undefined"==typeof process)return; - const t=oji.__FIREBASE_DEFAULTS__; - return t?JSON.parse(t):void 0} - ,"getDefaultsFromEnvVariable"),_ji=Qt(()=>{ - if("undefined"==typeof document)return; - let t; - try{ - t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^; - ]+)/)} - catch(frt){ - return} - const i=t&&wji(t[1]); - return i&&JSON.parse(i)} - ,"getDefaultsFromCookie"),Mji=Qt(()=>{ - try{ - return rji()||mji()||vji()||_ji()} - catch(frt){ - return} - } - ,"getDefaults"),bji=Qt(t=>{ - var i,s; - return null==(s=null==(i=Mji())?void 0:i.emulatorHosts)?void 0:s[t]} - ,"getDefaultEmulatorHost"),yji=Qt(()=>{ - var t; - return null==(t=Mji())?void 0:t.config} - ,"getDefaultAppConfig"),Eji=Qt(t=>{ - var i; - return null==(i=Mji())?void 0:i[`_${ - t} - `]} - ,"getExperimentalSetting"),Aji=class{ - constructor(){ - this.reject=()=>{ - } - ,this.resolve=()=>{ - } - ,this.promise=new Promise((t,i)=>{ - this.resolve=t,this.reject=i} - )} - wrapCallback(t){ - return(i,s)=>{ - i?this.reject(i):this.resolve(s),"function"==typeof t&&(this.promise.catch(()=>{ - } - ),1===t.length?t(i):t(i,s))} - } - } - ; - Qt(Aji,"Deferred"); - let Sji=Aji; - function Tji(){ - return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""} - function Cji(){ - return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Tji())} - function Oji(){ - return"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent} - function Iji(){ - const t="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0; - return"object"==typeof t&&void 0!==t.id} - function kji(){ - return"object"==typeof navigator&&"ReactNative"===navigator.product} - function xji(){ - const t=Tji(); - return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0} - function Rji(){ - try{ - return"object"==typeof indexedDB} - catch(frt){ - return!1} - } - function Pji(){ - return new Promise((t,i)=>{ - try{ - let s=!0; - const e="validate-browser-context-for-indexeddb-analytics-module",n=self.indexedDB.open(e); - n.onsuccess=()=>{ - n.result.close(),s||self.indexedDB.deleteDatabase(e),t(!0)} - ,n.onupgradeneeded=()=>{ - s=!1} - ,n.onerror=()=>{ - var t; - i((null==(t=n.error)?void 0:t.message)||"")} - } - catch(s){ - i(s)} - } - )} - function Nji(){ - return!("undefined"==typeof navigator||!navigator.cookieEnabled)} - Qt(Tji,"getUA"),Qt(Cji,"isMobileCordova"),Qt(Oji,"isCloudflareWorker"),Qt(Iji,"isBrowserExtension"),Qt(kji,"isReactNative"),Qt(xji,"isIE"),Qt(Rji,"isIndexedDBAvailable"),Qt(Pji,"validateIndexedDBOpenable"),Qt(Nji,"areCookiesEnabled"); - const Lji=class t extends Error{ - constructor(i,s,e){ - super(s),this.code=i,this.customData=e,this.name="FirebaseError",Object.setPrototypeOf(this,t.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Bji.prototype.create)} - } - ; - Qt(Lji,"FirebaseError"); - let Dji=Lji; - const Gji=class{ - constructor(t,i,s){ - this.service=t,this.serviceName=i,this.errors=s} - create(t,...i){ - const s=i[0]||{ - } - ,e=`${ - this.service} - /${ - t} - `,n=this.errors[t],h=n?Uji(n,s):"Error",r=`${ - this.serviceName} - : ${ - h} - (${ - e} - ).`; - return new Dji(e,r,s)} - } - ; - Qt(Gji,"ErrorFactory"); - let Bji=Gji; - function Uji(t,i){ - return t.replace(Fji,(t,s)=>{ - const e=i[s]; - return null!=e?String(e):`<${ - s} - ?>`} - )} - Qt(Uji,"replaceTemplate"); - const Fji=/\{ - \$([^} - ]+)} - /g; - function $ji(t){ - for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i))return!1; - return!0} - function Hji(t,i){ - if(t===i)return!0; - const s=Object.keys(t),e=Object.keys(i); - for(const n of s){ - if(!e.includes(n))return!1; - const s=t[n],h=i[n]; - if(Wji(s)&&Wji(h)){ - if(!Hji(s,h))return!1} - else if(s!==h)return!1} - for(const n of e)if(!s.includes(n))return!1; - return!0} - function Wji(t){ - return null!==t&&"object"==typeof t} - function Vji(t){ - const i=[]; - for(const[s,e]of Object.entries(t))Array.isArray(e)?e.forEach(t=>{ - i.push(encodeURIComponent(s)+"="+encodeURIComponent(t))} - ):i.push(encodeURIComponent(s)+"="+encodeURIComponent(e)); - return i.length?"&"+i.join("&"):""} - function jji(t){ - const i={ - } - ; - return t.replace(/^\?/,"").split("&").forEach(t=>{ - if(t){ - const[s,e]=t.split("="); - i[decodeURIComponent(s)]=decodeURIComponent(e)} - } - ),i} - function Kji(t){ - const i=t.indexOf("?"); - if(!i)return""; - const s=t.indexOf("#",i); - return t.substring(i,s>0?s:void 0)} - function zji(t,i){ - const s=new qji(t,i); - return s.subscribe.bind(s)} - Qt($ji,"isEmpty"),Qt(Hji,"deepEqual"),Qt(Wji,"isObject"),Qt(Vji,"querystring"),Qt(jji,"querystringDecode"),Qt(Kji,"extractQuerystring"),Qt(zji,"createSubscribe"); - const Yji=class{ - constructor(t,i){ - this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=i,this.task.then(()=>{ - t(this)} - ).catch(t=>{ - this.error(t)} - )} - next(t){ - this.forEachObserver(i=>{ - i.next(t)} - )} - error(t){ - this.forEachObserver(i=>{ - i.error(t)} - ),this.close(t)} - complete(){ - this.forEachObserver(t=>{ - t.complete()} - ),this.close()} - subscribe(t,i,s){ - let e; - if(void 0===t&&void 0===i&&void 0===s)throw new Error("Missing Observer."); - e=Xji(t,["next","error","complete"])?t:{ - next:t,error:i,complete:s} - ,void 0===e.next&&(e.next=Jji),void 0===e.error&&(e.error=Jji),void 0===e.complete&&(e.complete=Jji); - const n=this.unsubscribeOne.bind(this,this.observers.length); - return this.finalized&&this.task.then(()=>{ - try{ - this.finalError?e.error(this.finalError):e.complete()} - catch(frt){ - } - } - ),this.observers.push(e),n} - unsubscribeOne(t){ - void 0!==this.observers&&void 0!==this.observers[t]&&(delete this.observers[t],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))} - forEachObserver(t){ - if(!this.finalized)for(let i=0; - i<this.observers.length; - i++)this.sendOne(i,t)} - sendOne(t,i){ - this.task.then(()=>{ - if(void 0!==this.observers&&void 0!==this.observers[t])try{ - i(this.observers[t])} - catch(frt){ - "undefined"!=typeof console&&console.error} - } - )} - close(t){ - this.finalized||(this.finalized=!0,void 0!==t&&(this.finalError=t),this.task.then(()=>{ - this.observers=void 0,this.onNoObservers=void 0} - ))} - } - ; - Qt(Yji,"ObserverProxy"); - let qji=Yji; - function Xji(t,i){ - if("object"!=typeof t||null===t)return!1; - for(const s of i)if(s in t&&"function"==typeof t[s])return!0; - return!1} - function Jji(){ - } - function Qji(t){ - return t&&t._delegate?t._delegate:t} - function Zji(t){ - try{ - return(t.startsWith("http://")||t.startsWith("https://")?new URL(t).hostname:t).endsWith(".cloudworkstations.dev")} - catch{ - return!1} - } - async function tKi(t){ - return(await fetch(t,{ - credentials:"include"} - )).ok} - Qt(Xji,"implementsAnyMethods"),Qt(Jji,"noop"),Qt(Qji,"getModularInstance"),Qt(Zji,"isCloudWorkstation"),Qt(tKi,"pingServer"); - const iKi=class{ - constructor(t,i,s){ - this.name=t,this.instanceFactory=i,this.type=s,this.multipleInstances=!1,this.serviceProps={ - } - ,this.instantiationMode="LAZY",this.onInstanceCreated=null} - setInstantiationMode(t){ - return this.instantiationMode=t,this} - setMultipleInstances(t){ - return this.multipleInstances=t,this} - setServiceProps(t){ - return this.serviceProps=t,this} - setInstanceCreatedCallback(t){ - return this.onInstanceCreated=t,this} - } - ; - Qt(iKi,"Component"); - let sKi=iKi; - const eKi="[DEFAULT]",nKi=class{ - constructor(t,i){ - this.name=t,this.container=i,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map} - get(t){ - const i=this.normalizeInstanceIdentifier(t); - if(!this.instancesDeferred.has(i)){ - const t=new Sji; - if(this.instancesDeferred.set(i,t),this.isInitialized(i)||this.shouldAutoInitialize())try{ - const s=this.getOrInitializeService({ - instanceIdentifier:i} - ); - s&&t.resolve(s)} - catch(frt){ - } - } - return this.instancesDeferred.get(i).promise} - getImmediate(t){ - const i=this.normalizeInstanceIdentifier(null==t?void 0:t.identifier),s=(null==t?void 0:t.optional)??!1; - if(!this.isInitialized(i)&&!this.shouldAutoInitialize()){ - if(s)return null; - throw Error(`Service ${ - this.name} - is not available`)} - try{ - return this.getOrInitializeService({ - instanceIdentifier:i} - )} - catch(frt){ - if(s)return null; - throw frt} - } - getComponent(){ - return this.component} - setComponent(t){ - if(t.name!==this.name)throw Error(`Mismatching Component ${ - t.name} - for Provider ${ - this.name} - .`); - if(this.component)throw Error(`Component for ${ - this.name} - has already been provided`); - if(this.component=t,this.shouldAutoInitialize()){ - if(oKi(t))try{ - this.getOrInitializeService({ - instanceIdentifier:eKi} - )} - catch(frt){ - } - for(const[t,i]of this.instancesDeferred.entries()){ - const s=this.normalizeInstanceIdentifier(t); - try{ - const t=this.getOrInitializeService({ - instanceIdentifier:s} - ); - i.resolve(t)} - catch(frt){ - } - } - } - } - clearInstance(t=eKi){ - this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)} - async delete(){ - const t=Array.from(this.instances.values()); - await Promise.all([...t.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...t.filter(t=>"_delete"in t).map(t=>t._delete())])} - isComponentSet(){ - return null!=this.component} - isInitialized(t=eKi){ - return this.instances.has(t)} - getOptions(t=eKi){ - return this.instancesOptions.get(t)||{ - } - } - initialize(t={ - } - ){ - const{ - options:i={ - } - } - =t,s=this.normalizeInstanceIdentifier(t.instanceIdentifier); - if(this.isInitialized(s))throw Error(`${ - this.name} - (${ - s} - ) has already been initialized`); - if(!this.isComponentSet())throw Error(`Component ${ - this.name} - has not been registered yet`); - const e=this.getOrInitializeService({ - instanceIdentifier:s,options:i} - ); - for(const[n,h]of this.instancesDeferred.entries())s===this.normalizeInstanceIdentifier(n)&&h.resolve(e); - return e} - onInit(t,i){ - const s=this.normalizeInstanceIdentifier(i),e=this.onInitCallbacks.get(s)??new Set; - e.add(t),this.onInitCallbacks.set(s,e); - const n=this.instances.get(s); - return n&&t(n,s),()=>{ - e.delete(t)} - } - invokeOnInitCallbacks(t,i){ - const s=this.onInitCallbacks.get(i); - if(s)for(const e of s)try{ - e(t,i)} - catch{ - } - } - getOrInitializeService({ - instanceIdentifier:t,options:i={ - } - } - ){ - let s=this.instances.get(t); - if(!s&&this.component&&(s=this.component.instanceFactory(this.container,{ - instanceIdentifier:rKi(t),options:i} - ),this.instances.set(t,s),this.instancesOptions.set(t,i),this.invokeOnInitCallbacks(s,t),this.component.onInstanceCreated))try{ - this.component.onInstanceCreated(this.container,t,s)} - catch{ - } - return s||null} - normalizeInstanceIdentifier(t=eKi){ - return this.component?this.component.multipleInstances?t:eKi:t} - shouldAutoInitialize(){ - return!!this.component&&"EXPLICIT"!==this.component.instantiationMode} - } - ; - Qt(nKi,"Provider"); - let hKi=nKi; - function rKi(t){ - return t===eKi?void 0:t} - function oKi(t){ - return"EAGER"===t.instantiationMode} - Qt(rKi,"normalizeIdentifierForFactory"),Qt(oKi,"isComponentEager"); - const aKi=class{ - constructor(t){ - this.name=t,this.providers=new Map} - addComponent(t){ - const i=this.getProvider(t.name); - if(i.isComponentSet())throw new Error(`Component ${ - t.name} - has already been registered with ${ - this.name} - `); - i.setComponent(t)} - addOrOverwriteComponent(t){ - this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)} - getProvider(t){ - if(this.providers.has(t))return this.providers.get(t); - const i=new hKi(t,this); - return this.providers.set(t,i),i} - getProviders(){ - return Array.from(this.providers.values())} - } - ; - Qt(aKi,"ComponentContainer"); - let cKi=aKi; - var lKi,uKi; - (uKi=lKi||(lKi={ - } - ))[uKi.DEBUG=0]="DEBUG",uKi[uKi.VERBOSE=1]="VERBOSE",uKi[uKi.INFO=2]="INFO",uKi[uKi.WARN=3]="WARN",uKi[uKi.ERROR=4]="ERROR",uKi[uKi.SILENT=5]="SILENT"; - const dKi={ - debug:lKi.DEBUG,verbose:lKi.VERBOSE,info:lKi.INFO,warn:lKi.WARN,error:lKi.ERROR,silent:lKi.SILENT} - ,fKi=lKi.INFO,pKi={ - [lKi.DEBUG]:"log",[lKi.VERBOSE]:"log",[lKi.INFO]:"info",[lKi.WARN]:"warn",[lKi.ERROR]:"error"} - ,wKi=Qt((t,i,...s)=>{ - if(!(i<t.logLevel||((new Date).toISOString(),pKi[i])))throw new Error(`Attempted to log a message with an invalid logType (value: ${ - i} - )`)} - ,"defaultLogHandler"),gKi=class{ - constructor(t){ - this.name=t,this._logLevel=fKi,this._logHandler=wKi,this._userLogHandler=null} - get logLevel(){ - return this._logLevel} - set logLevel(t){ - if(!(t in lKi))throw new TypeError(`Invalid value "${ - t} - " assigned to \`logLevel\``); - this._logLevel=t} - setLogLevel(t){ - this._logLevel="string"==typeof t?dKi[t]:t} - get logHandler(){ - return this._logHandler} - set logHandler(t){ - if("function"!=typeof t)throw new TypeError("Value assigned to `logHandler` must be a function"); - this._logHandler=t} - get userLogHandler(){ - return this._userLogHandler} - set userLogHandler(t){ - this._userLogHandler=t} - debug(...t){ - this._userLogHandler&&this._userLogHandler(this,lKi.DEBUG,...t),this._logHandler(this,lKi.DEBUG,...t)} - log(...t){ - this._userLogHandler&&this._userLogHandler(this,lKi.VERBOSE,...t),this._logHandler(this,lKi.VERBOSE,...t)} - info(...t){ - this._userLogHandler&&this._userLogHandler(this,lKi.INFO,...t),this._logHandler(this,lKi.INFO,...t)} - warn(...t){ - this._userLogHandler&&this._userLogHandler(this,lKi.WARN,...t),this._logHandler(this,lKi.WARN,...t)} - error(...t){ - this._userLogHandler&&this._userLogHandler(this,lKi.ERROR,...t),this._logHandler(this,lKi.ERROR,...t)} - } - ; - Qt(gKi,"Logger"); - let mKi=gKi; - const vKi=Qt((t,i)=>i.some(i=>t instanceof i),"instanceOfAny"); - let _Ki,MKi; - function bKi(){ - return _Ki||(_Ki=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])} - function yKi(){ - return MKi||(MKi=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])} - Qt(bKi,"getIdbProxyableTypes"),Qt(yKi,"getCursorAdvanceMethods"); - const EKi=new WeakMap,AKi=new WeakMap,SKi=new WeakMap,TKi=new WeakMap,CKi=new WeakMap; - function OKi(t){ - const i=new Promise((i,s)=>{ - const e=Qt(()=>{ - t.removeEventListener("success",n),t.removeEventListener("error",h)} - ,"unlisten"),n=Qt(()=>{ - i(NKi(t.result)),e()} - ,"success"),h=Qt(()=>{ - s(t.error),e()} - ,"error"); - t.addEventListener("success",n),t.addEventListener("error",h)} - ); - return i.then(i=>{ - i instanceof IDBCursor&&EKi.set(i,t)} - ).catch(()=>{ - } - ),CKi.set(i,t),i} - function IKi(t){ - if(AKi.has(t))return; - const i=new Promise((i,s)=>{ - const e=Qt(()=>{ - t.removeEventListener("complete",n),t.removeEventListener("error",h),t.removeEventListener("abort",h)} - ,"unlisten"),n=Qt(()=>{ - i(),e()} - ,"complete"),h=Qt(()=>{ - s(t.error||new DOMException("AbortError","AbortError")),e()} - ,"error"); - t.addEventListener("complete",n),t.addEventListener("error",h),t.addEventListener("abort",h)} - ); - AKi.set(t,i)} - Qt(OKi,"promisifyRequest"),Qt(IKi,"cacheDonePromiseForTransaction"); - let kKi={ - get(t,i,s){ - if(t instanceof IDBTransaction){ - if("done"===i)return AKi.get(t); - if("objectStoreNames"===i)return t.objectStoreNames||SKi.get(t); - if("store"===i)return s.objectStoreNames[1]?void 0:s.objectStore(s.objectStoreNames[0])} - return NKi(t[i])} - ,set:(t,i,s)=>(t[i]=s,!0),has:(t,i)=>t instanceof IDBTransaction&&("done"===i||"store"===i)||i in t} - ; - function xKi(t){ - kKi=t(kKi)} - function RKi(t){ - return t!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?yKi().includes(t)?function(...i){ - return t.apply(LKi(this),i),NKi(EKi.get(this))} - :function(...i){ - return NKi(t.apply(LKi(this),i))} - :function(i,...s){ - const e=t.call(LKi(this),i,...s); - return SKi.set(e,i.sort?i.sort():[i]),NKi(e)} - } - function PKi(t){ - return"function"==typeof t?RKi(t):(t instanceof IDBTransaction&&IKi(t),vKi(t,bKi())?new Proxy(t,kKi):t)} - function NKi(t){ - if(t instanceof IDBRequest)return OKi(t); - if(TKi.has(t))return TKi.get(t); - const i=PKi(t); - return i!==t&&(TKi.set(t,i),CKi.set(i,t)),i} - Qt(xKi,"replaceTraps"),Qt(RKi,"wrapFunction"),Qt(PKi,"transformCachableValue"),Qt(NKi,"wrap"); - const LKi=Qt(t=>CKi.get(t),"unwrap"); - function DKi(t,i,{ - blocked:s,upgrade:e,blocking:n,terminated:h} - ={ - } - ){ - const r=indexedDB.open(t,i),o=NKi(r); - return e&&r.addEventListener("upgradeneeded",t=>{ - e(NKi(r.result),t.oldVersion,t.newVersion,NKi(r.transaction),t)} - ),s&&r.addEventListener("blocked",t=>s(t.oldVersion,t.newVersion,t)),o.then(t=>{ - h&&t.addEventListener("close",()=>h()),n&&t.addEventListener("versionchange",t=>n(t.oldVersion,t.newVersion,t))} - ).catch(()=>{ - } - ),o} - function GKi(t,{ - blocked:i} - ={ - } - ){ - const s=indexedDB.deleteDatabase(t); - return i&&s.addEventListener("blocked",t=>i(t.oldVersion,t)),NKi(s).then(()=>{ - } - )} - Qt(DKi,"openDB"),Qt(GKi,"deleteDB"); - const BKi=["get","getKey","getAll","getAllKeys","count"],UKi=["put","add","delete","clear"],FKi=new Map; - function $Ki(t,i){ - if(!(t instanceof IDBDatabase)||i in t||"string"!=typeof i)return; - if(FKi.get(i))return FKi.get(i); - const s=i.replace(/FromIndex$/,""),e=i!==s,n=UKi.includes(s); - if(!(s in(e?IDBIndex:IDBObjectStore).prototype)||!n&&!BKi.includes(s))return; - const h=Qt(async function(t,...i){ - const h=this.transaction(t,n?"readwrite":"readonly"); - let r=h.store; - return e&&(r=r.index(i.shift())),(await Promise.all([r[s](...i),n&&h.done]))[0]} - ,"method"); - return FKi.set(i,h),h} - Qt($Ki,"getMethod"),xKi(t=>({ - ...t,get:Qt((i,s,e)=>$Ki(i,s)||t.get(i,s,e),"get"),has:Qt((i,s)=>!!$Ki(i,s)||t.has(i,s),"has")} - )); - const HKi=class{ - constructor(t){ - this.container=t} - getPlatformInfoString(){ - return this.container.getProviders().map(t=>{ - if(VKi(t)){ - const i=t.getImmediate(); - return`${ - i.library} - /${ - i.version} - `} - return null} - ).filter(t=>t).join(" ")} - } - ; - Qt(HKi,"PlatformLoggerServiceImpl"); - let WKi=HKi; - function VKi(t){ - const i=t.getComponent(); - return"VERSION"===(null==i?void 0:i.type)} - Qt(VKi,"isVersionServiceProvider"); - const jKi="@firebase/app",KKi="0.14.10",zKi=new mKi("@firebase/app"),YKi="@firebase/app-compat",qKi="@firebase/analytics-compat",XKi="@firebase/analytics",JKi="@firebase/app-check-compat",QKi="@firebase/app-check",ZKi="@firebase/auth",tzi="@firebase/auth-compat",izi="@firebase/database",szi="@firebase/data-connect",ezi="@firebase/database-compat",nzi="@firebase/functions",hzi="@firebase/functions-compat",rzi="@firebase/installations",ozi="@firebase/installations-compat",azi="@firebase/messaging",czi="@firebase/messaging-compat",lzi="@firebase/performance",uzi="@firebase/performance-compat",dzi="@firebase/remote-config",fzi="@firebase/remote-config-compat",pzi="@firebase/storage",wzi="@firebase/storage-compat",gzi="@firebase/firestore",mzi="@firebase/ai",vzi="@firebase/firestore-compat",_zi="firebase",Mzi="[DEFAULT]",bzi={ - [jKi]:"fire-core",[YKi]:"fire-core-compat",[XKi]:"fire-analytics",[qKi]:"fire-analytics-compat",[QKi]:"fire-app-check",[JKi]:"fire-app-check-compat",[ZKi]:"fire-auth",[tzi]:"fire-auth-compat",[izi]:"fire-rtdb",[szi]:"fire-data-connect",[ezi]:"fire-rtdb-compat",[nzi]:"fire-fn",[hzi]:"fire-fn-compat",[rzi]:"fire-iid",[ozi]:"fire-iid-compat",[azi]:"fire-fcm",[czi]:"fire-fcm-compat",[lzi]:"fire-perf",[uzi]:"fire-perf-compat",[dzi]:"fire-rc",[fzi]:"fire-rc-compat",[pzi]:"fire-gcs",[wzi]:"fire-gcs-compat",[gzi]:"fire-fst",[vzi]:"fire-fst-compat",[mzi]:"fire-vertex","fire-js":"fire-js",[_zi]:"fire-js-all"} - ,yzi=new Map,Ezi=new Map,Azi=new Map; - function Szi(t,i){ - try{ - t.container.addComponent(i)} - catch(frt){ - zKi.debug(`Component ${ - i.name} - failed to register with FirebaseApp ${ - t.name} - `,frt)} - } - function Tzi(t){ - const i=t.name; - if(Azi.has(i))return zKi.debug(`There were multiple attempts to register component ${ - i} - .`),!1; - Azi.set(i,t); - for(const s of yzi.values())Szi(s,t); - for(const s of Ezi.values())Szi(s,t); - return!0} - function Czi(t,i){ - const s=t.container.getProvider("heartbeat").getImmediate({ - optional:!0} - ); - return s&&s.triggerHeartbeat(),t.container.getProvider(i)} - function Ozi(t){ - return null!=t&&void 0!==t.settings} - Qt(Szi,"_addComponent"),Qt(Tzi,"_registerComponent"),Qt(Czi,"_getProvider"),Qt(Ozi,"_isFirebaseServerApp"); - const Izi=new Bji("app","Firebase",{ - "no-app":"No Firebase App '{ - $appName} - ' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{ - $appName} - '","duplicate-app":"Firebase App named '{ - $appName} - ' already exists with different options or config","app-deleted":"Firebase App named '{ - $appName} - ' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{ - $appName} - () takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: { - $originalErrorMessage} - .","idb-get":"Error thrown when reading from IndexedDB. Original error: { - $originalErrorMessage} - .","idb-set":"Error thrown when writing to IndexedDB. Original error: { - $originalErrorMessage} - .","idb-delete":"Error thrown when deleting from IndexedDB. Original error: { - $originalErrorMessage} - .","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."} - ),kzi=class{ - constructor(t,i,s){ - this._isDeleted=!1,this._options={ - ...t} - ,this._config={ - ...i} - ,this._name=i.name,this._automaticDataCollectionEnabled=i.automaticDataCollectionEnabled,this._container=s,this.container.addComponent(new sKi("app",()=>this,"PUBLIC"))} - get automaticDataCollectionEnabled(){ - return this.checkDestroyed(),this._automaticDataCollectionEnabled} - set automaticDataCollectionEnabled(t){ - this.checkDestroyed(),this._automaticDataCollectionEnabled=t} - get name(){ - return this.checkDestroyed(),this._name} - get options(){ - return this.checkDestroyed(),this._options} - get config(){ - return this.checkDestroyed(),this._config} - get container(){ - return this._container} - get isDeleted(){ - return this._isDeleted} - set isDeleted(t){ - this._isDeleted=t} - checkDestroyed(){ - if(this.isDeleted)throw Izi.create("app-deleted",{ - appName:this._name} - )} - } - ; - Qt(kzi,"FirebaseAppImpl"); - let xzi=kzi; - const Rzi="12.11.0"; - function Pzi(t,i={ - } - ){ - let s=t; - "object"!=typeof i&&(i={ - name:i} - ); - const e={ - name:Mzi,automaticDataCollectionEnabled:!0,...i} - ,n=e.name; - if("string"!=typeof n||!n)throw Izi.create("bad-app-name",{ - appName:String(n)} - ); - if(s||(s=yji()),!s)throw Izi.create("no-options"); - const h=yzi.get(n); - if(h){ - if(Hji(s,h.options)&&Hji(e,h.config))return h; - throw Izi.create("duplicate-app",{ - appName:n} - )} - const r=new cKi(n); - for(const a of Azi.values())r.addComponent(a); - const o=new xzi(s,e,r); - return yzi.set(n,o),o} - function Nzi(t=Mzi){ - const i=yzi.get(t); - if(!i&&t===Mzi&&yji())return Pzi(); - if(!i)throw Izi.create("no-app",{ - appName:t} - ); - return i} - function Lzi(t,i,s){ - let e=bzi[t]??t; - s&&(e+=`-${ - s} - `); - const n=e.match(/\s|\//),h=i.match(/\s|\//); - if(n||h){ - const t=[`Unable to register library "${ - e} - " with version "${ - i} - ":`]; - return n&&t.push(`library name "${ - e} - " contains illegal characters (whitespace or "/")`),n&&h&&t.push("and"),h&&t.push(`version name "${ - i} - " contains illegal characters (whitespace or "/")`),void zKi.warn(t.join(" "))} - Tzi(new sKi(`${ - e} - -version`,()=>({ - library:e,version:i} - ),"VERSION"))} - Qt(Pzi,"initializeApp"),Qt(Nzi,"getApp"),Qt(Lzi,"registerVersion"); - const Dzi="firebase-heartbeat-store"; - let Gzi=null; - function Bzi(){ - return Gzi||(Gzi=DKi("firebase-heartbeat-database",1,{ - upgrade:Qt((t,i)=>{ - if(0===i)try{ - t.createObjectStore(Dzi)} - catch(frt){ - } - } - ,"upgrade")} - ).catch(t=>{ - throw Izi.create("idb-open",{ - originalErrorMessage:t.message} - )} - )),Gzi} - async function Uzi(t){ - try{ - const i=(await Bzi()).transaction(Dzi),s=await i.objectStore(Dzi).get($zi(t)); - return await i.done,s} - catch(frt){ - if(frt instanceof Dji)zKi.warn(frt.message); - else{ - const i=Izi.create("idb-get",{ - originalErrorMessage:null==frt?void 0:frt.message} - ); - zKi.warn(i.message)} - } - } - async function Fzi(t,i){ - try{ - const s=(await Bzi()).transaction(Dzi,"readwrite"),e=s.objectStore(Dzi); - await e.put(i,$zi(t)),await s.done} - catch(frt){ - if(frt instanceof Dji)zKi.warn(frt.message); - else{ - const i=Izi.create("idb-set",{ - originalErrorMessage:null==frt?void 0:frt.message} - ); - zKi.warn(i.message)} - } - } - function $zi(t){ - return`${ - t.name} - !${ - t.options.appId} - `} - Qt(Bzi,"getDbPromise$2"),Qt(Uzi,"readHeartbeatsFromIndexedDB"),Qt(Fzi,"writeHeartbeatsToIndexedDB"),Qt($zi,"computeKey"); - const Hzi=class{ - constructor(t){ - this.container=t,this._heartbeatsCache=null; - const i=this.container.getProvider("app").getImmediate(); - this._storage=new zzi(i),this._heartbeatsCachePromise=this._storage.read().then(t=>(this._heartbeatsCache=t,t))} - async triggerHeartbeat(){ - var t,i; - try{ - const s=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),e=Vzi(); - if(null==(null==(t=this._heartbeatsCache)?void 0:t.heartbeats)&&(this._heartbeatsCache=await this._heartbeatsCachePromise,null==(null==(i=this._heartbeatsCache)?void 0:i.heartbeats)))return; - if(this._heartbeatsCache.lastSentHeartbeatDate===e||this._heartbeatsCache.heartbeats.some(t=>t.date===e))return; - if(this._heartbeatsCache.heartbeats.push({ - date:e,agent:s} - ),this._heartbeatsCache.heartbeats.length>30){ - const t=qzi(this._heartbeatsCache.heartbeats); - this._heartbeatsCache.heartbeats.splice(t,1)} - return this._storage.overwrite(this._heartbeatsCache)} - catch(frt){ - zKi.warn(frt)} - } - async getHeartbeatsHeader(){ - var t; - try{ - if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null==(null==(t=this._heartbeatsCache)?void 0:t.heartbeats)||0===this._heartbeatsCache.heartbeats.length)return""; - const i=Vzi(),{ - heartbeatsToSend:s,unsentEntries:e} - =jzi(this._heartbeatsCache.heartbeats),n=pji(JSON.stringify({ - version:2,heartbeats:s} - )); - return this._heartbeatsCache.lastSentHeartbeatDate=i,e.length>0?(this._heartbeatsCache.heartbeats=e,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),n} - catch(frt){ - return zKi.warn(frt),""} - } - } - ; - Qt(Hzi,"HeartbeatServiceImpl"); - let Wzi=Hzi; - function Vzi(){ - return(new Date).toISOString().substring(0,10)} - function jzi(t,i=1024){ - const s=[]; - let e=t.slice(); - for(const n of t){ - const t=s.find(t=>t.agent===n.agent); - if(t){ - if(t.dates.push(n.date),Yzi(s)>i){ - t.dates.pop(); - break} - } - else if(s.push({ - agent:n.agent,dates:[n.date]} - ),Yzi(s)>i){ - s.pop(); - break} - e=e.slice(1)} - return{ - heartbeatsToSend:s,unsentEntries:e} - } - Qt(Vzi,"getUTCDateString"),Qt(jzi,"extractHeartbeatsForHeader"); - const Kzi=class{ - constructor(t){ - this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()} - async runIndexedDBEnvironmentCheck(){ - return!!Rji()&&Pji().then(()=>!0).catch(()=>!1)} - async read(){ - if(await this._canUseIndexedDBPromise){ - const t=await Uzi(this.app); - return(null==t?void 0:t.heartbeats)?t:{ - heartbeats:[]} - } - return{ - heartbeats:[]} - } - async overwrite(t){ - if(await this._canUseIndexedDBPromise){ - const i=await this.read(); - return Fzi(this.app,{ - lastSentHeartbeatDate:t.lastSentHeartbeatDate??i.lastSentHeartbeatDate,heartbeats:t.heartbeats} - )} - } - async add(t){ - if(await this._canUseIndexedDBPromise){ - const i=await this.read(); - return Fzi(this.app,{ - lastSentHeartbeatDate:t.lastSentHeartbeatDate??i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...t.heartbeats]} - )} - } - } - ; - Qt(Kzi,"HeartbeatStorageImpl"); - let zzi=Kzi; - function Yzi(t){ - return pji(JSON.stringify({ - version:2,heartbeats:t} - )).length} - function qzi(t){ - if(0===t.length)return-1; - let i=0,s=t[0].date; - for(let e=1; - e<t.length; - e++)t[e].date<s&&(s=t[e].date,i=e); - return i} - function Xzi(t){ - Tzi(new sKi("platform-logger",t=>new WKi(t),"PRIVATE")),Tzi(new sKi("heartbeat",t=>new Wzi(t),"PRIVATE")),Lzi(jKi,KKi,t),Lzi(jKi,KKi,"esm2020"),Lzi("fire-js","")} - function Jzi(){ - return{ - "dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."} - } - Qt(Yzi,"countBytes"),Qt(qzi,"getEarliestHeartbeatIdx"),Qt(Xzi,"registerCoreComponents"),Xzi(""),Qt(Jzi,"_prodErrorMap"); - const Qzi=Jzi,Zzi=new Bji("auth","Firebase",{ - "dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."} - ),tYi=new mKi("@firebase/auth"); - function iYi(t,...i){ - tYi.logLevel<=lKi.WARN&&tYi.warn(`Auth (${ - Rzi} - ): ${ - t} - `,...i)} - function sYi(t,...i){ - tYi.logLevel<=lKi.ERROR&&tYi.error(`Auth (${ - Rzi} - ): ${ - t} - `,...i)} - function eYi(t,...i){ - throw aYi(t,...i)} - function nYi(t,...i){ - return aYi(t,...i)} - function hYi(t,i,s){ - const e={ - ...Qzi(),[i]:s} - ; - return new Bji("auth","Firebase",e).create(i,{ - appName:t.name} - )} - function rYi(t){ - return hYi(t,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")} - function oYi(t,i,s){ - if(!(i instanceof s))throw s.name!==i.constructor.name&&eYi(t,"argument-error"),hYi(t,"argument-error",`Type of ${ - i.constructor.name} - does not match expected instance.Did you pass a reference from a different Auth SDK?`)} - function aYi(t,...i){ - if("string"!=typeof t){ - const s=i[0],e=[...i.slice(1)]; - return e[0]&&(e[0].appName=t.name),t._errorFactory.create(s,...e)} - return Zzi.create(t,...i)} - function cYi(t,i,...s){ - if(!t)throw aYi(i,...s)} - function lYi(t){ - const i="INTERNAL ASSERTION FAILED: "+t; - throw sYi(i),new Error(i)} - function uYi(t,i){ - t||lYi(i)} - function dYi(){ - var t; - return"undefined"!=typeof self&&(null==(t=self.location)?void 0:t.href)||""} - function fYi(){ - return"http:"===pYi()||"https:"===pYi()} - function pYi(){ - var t; - return"undefined"!=typeof self&&(null==(t=self.location)?void 0:t.protocol)||null} - function wYi(){ - return!("undefined"!=typeof navigator&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&(fYi()||Iji()||"connection"in navigator))||navigator.onLine} - function gYi(){ - if("undefined"==typeof navigator)return null; - const t=navigator; - return t.languages&&t.languages[0]||t.language||null} - Qt(iYi,"_logWarn"),Qt(sYi,"_logError"),Qt(eYi,"_fail"),Qt(nYi,"_createError"),Qt(hYi,"_errorWithCustomMessage"),Qt(rYi,"_serverAppCurrentUserOperationNotSupportedError"),Qt(oYi,"_assertInstanceOf"),Qt(aYi,"createErrorInternal"),Qt(cYi,"_assert"),Qt(lYi,"debugFail"),Qt(uYi,"debugAssert"),Qt(dYi,"_getCurrentUrl"),Qt(fYi,"_isHttpOrHttps"),Qt(pYi,"_getCurrentScheme"),Qt(wYi,"_isOnline"),Qt(gYi,"_getUserLanguage"); - const mYi=class{ - constructor(t,i){ - this.shortDelay=t,this.longDelay=i,uYi(i>t,"Short delay should be less than long delay!"),this.isMobile=Cji()||kji()} - get(){ - return wYi()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)} - } - ; - Qt(mYi,"Delay"); - let vYi=mYi; - function _Yi(t,i){ - uYi(t.emulator,"Emulator should always be set here"); - const{ - url:s} - =t.emulator; - return i?`${ - s} - ${ - i.startsWith("/")?i.slice(1):i} - `:s} - Qt(_Yi,"_emulatorUrl"); - const MYi=class{ - static initialize(t,i,s){ - this.fetchImpl=t,i&&(this.headersImpl=i),s&&(this.responseImpl=s)} - static fetch(){ - return this.fetchImpl?this.fetchImpl:"undefined"!=typeof self&&"fetch"in self?self.fetch:"undefined"!=typeof globalThis&&globalThis.fetch?globalThis.fetch:"undefined"!=typeof fetch?fetch:void lYi("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")} - static headers(){ - return this.headersImpl?this.headersImpl:"undefined"!=typeof self&&"Headers"in self?self.Headers:"undefined"!=typeof globalThis&&globalThis.Headers?globalThis.Headers:"undefined"!=typeof Headers?Headers:void lYi("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")} - static response(){ - return this.responseImpl?this.responseImpl:"undefined"!=typeof self&&"Response"in self?self.Response:"undefined"!=typeof globalThis&&globalThis.Response?globalThis.Response:"undefined"!=typeof Response?Response:void lYi("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")} - } - ; - Qt(MYi,"FetchProvider"); - let bYi=MYi; - const yYi={ - CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"} - ,EYi=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],AYi=new vYi(3e4,6e4); - function SYi(t,i){ - return t.tenantId&&!i.tenantId?{ - ...i,tenantId:t.tenantId} - :i} - async function TYi(t,i,s,e,n={ - } - ){ - return CYi(t,n,async()=>{ - let n={ - } - ,h={ - } - ; - e&&("GET"===i?h=e:n={ - body:JSON.stringify(e)} - ); - const r=Vji({ - key:t.config.apiKey,...h} - ).slice(1),o=await t._getAdditionalHeaders(); - o["Content-Type"]="application/json",t.languageCode&&(o["X-Firebase-Locale"]=t.languageCode); - const a={ - method:i,headers:o,...n} - ; - return Oji()||(a.referrerPolicy="no-referrer"),t.emulatorConfig&&Zji(t.emulatorConfig.host)&&(a.credentials="include"),bYi.fetch()(await IYi(t,t.config.apiHost,s,r),a)} - )} - async function CYi(t,i,s){ - t._canInitEmulator=!1; - const e={ - ...yYi,...i} - ; - try{ - const i=new RYi(t),n=await Promise.race([s(),i.promise]); - i.clearNetworkTimeout(); - const h=await n.json(); - if("needConfirmation"in h)throw PYi(t,"account-exists-with-different-credential",h); - if(n.ok&&!("errorMessage"in h))return h; - { - const i=n.ok?h.errorMessage:h.error.message,[s,r]=i.split(" : "); - if("FEDERATED_USER_ID_ALREADY_LINKED"===s)throw PYi(t,"credential-already-in-use",h); - if("EMAIL_EXISTS"===s)throw PYi(t,"email-already-in-use",h); - if("USER_DISABLED"===s)throw PYi(t,"user-disabled",h); - const o=e[s]||s.toLowerCase().replace(/[_\s]+/g,"-"); - if(r)throw hYi(t,o,r); - eYi(t,o)} - } - catch(frt){ - if(frt instanceof Dji)throw frt; - eYi(t,"network-request-failed",{ - message:String(frt)} - )} - } - async function OYi(t,i,s,e,n={ - } - ){ - const h=await TYi(t,i,s,e,n); - return"mfaPendingCredential"in h&&eYi(t,"multi-factor-auth-required",{ - _serverResponse:h} - ),h} - async function IYi(t,i,s,e){ - const n=`${ - i} - ${ - s} - ?${ - e} - `,h=t,r=h.config.emulator?_Yi(t.config,n):`${ - t.config.apiScheme} - ://${ - n} - `; - return EYi.includes(s)&&(await h._persistenceManagerAvailable,"COOKIE"===h._getPersistenceType())?h._getPersistence()._getFinalTarget(r).toString():r} - function kYi(t){ - switch(t){ - case"ENFORCE":return"ENFORCE"; - case"AUDIT":return"AUDIT"; - case"OFF":return"OFF"; - default:return"ENFORCEMENT_STATE_UNSPECIFIED"} - } - Qt(SYi,"_addTidIfNecessary"),Qt(TYi,"_performApiRequest"),Qt(CYi,"_performFetchWithErrorHandling"),Qt(OYi,"_performSignInRequest"),Qt(IYi,"_getFinalTarget"),Qt(kYi,"_parseEnforcementState"); - const xYi=class{ - clearNetworkTimeout(){ - clearTimeout(this.timer)} - constructor(t){ - this.auth=t,this.timer=null,this.promise=new Promise((t,i)=>{ - this.timer=setTimeout(()=>i(nYi(this.auth,"network-request-failed")),AYi.get())} - )} - } - ; - Qt(xYi,"NetworkTimeout"); - let RYi=xYi; - function PYi(t,i,s){ - const e={ - appName:t.name} - ; - s.email&&(e.email=s.email),s.phoneNumber&&(e.phoneNumber=s.phoneNumber); - const n=nYi(t,i,e); - return n.customData._tokenResponse=s,n} - function NYi(t){ - return void 0!==t&&void 0!==t.getResponse} - function LYi(t){ - return void 0!==t&&void 0!==t.enterprise} - Qt(PYi,"_makeTaggedError"),Qt(NYi,"isV2"),Qt(LYi,"isEnterprise"); - const DYi=class{ - constructor(t){ - if(this.siteKey="",this.recaptchaEnforcementState=[],void 0===t.recaptchaKey)throw new Error("recaptchaKey undefined"); - this.siteKey=t.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=t.recaptchaEnforcementState} - getProviderEnforcementState(t){ - if(!this.recaptchaEnforcementState||0===this.recaptchaEnforcementState.length)return null; - for(const i of this.recaptchaEnforcementState)if(i.provider&&i.provider===t)return kYi(i.enforcementState); - return null} - isProviderEnabled(t){ - return"ENFORCE"===this.getProviderEnforcementState(t)||"AUDIT"===this.getProviderEnforcementState(t)} - isAnyProviderEnabled(){ - return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PROVIDER")} - } - ; - Qt(DYi,"RecaptchaConfig"); - let GYi=DYi; - async function BYi(t){ - return(await TYi(t,"GET","/v1/recaptchaParams")).recaptchaSiteKey||""} - async function UYi(t,i){ - return TYi(t,"GET","/v2/recaptchaConfig",SYi(t,i))} - async function FYi(t,i){ - return TYi(t,"POST","/v1/accounts:delete",i)} - async function $Yi(t,i){ - return TYi(t,"POST","/v1/accounts:update",i)} - async function HYi(t,i){ - return TYi(t,"POST","/v1/accounts:lookup",i)} - function WYi(t){ - if(t)try{ - const i=new Date(Number(t)); - if(!isNaN(i.getTime()))return i.toUTCString()} - catch(frt){ - } - } - async function VYi(t,i=!1){ - const s=Qji(t),e=await s.getIdToken(i),n=KYi(e); - cYi(n&&n.exp&&n.auth_time&&n.iat,s.auth,"internal-error"); - const h="object"==typeof n.firebase?n.firebase:void 0,r=null==h?void 0:h.sign_in_provider; - return{ - claims:n,token:e,authTime:WYi(jYi(n.auth_time)),issuedAtTime:WYi(jYi(n.iat)),expirationTime:WYi(jYi(n.exp)),signInProvider:r||null,signInSecondFactor:(null==h?void 0:h.sign_in_second_factor)||null} - } - function jYi(t){ - return 1e3*Number(t)} - function KYi(t){ - const[i,s,e]=t.split("."); - if(void 0===i||void 0===s||void 0===e)return sYi("JWT malformed, contained fewer than 3 sections"),null; - try{ - const t=wji(s); - return t?JSON.parse(t):(sYi("Failed to decode base64 JWT payload"),null)} - catch(frt){ - return sYi("Caught error parsing JWT payload as JSON",null==frt?void 0:frt.toString()),null} - } - function zYi(t){ - const i=KYi(t); - return cYi(i,"internal-error"),cYi(void 0!==i.exp,"internal-error"),cYi(void 0!==i.iat,"internal-error"),Number(i.exp)-Number(i.iat)} - async function YYi(t,i,s=!1){ - if(s)return i; - try{ - return await i} - catch(frt){ - throw frt instanceof Dji&&qYi(frt)&&t.auth.currentUser===t&&await t.auth.signOut(),frt} - } - function qYi({ - code:t} - ){ - return"auth/user-disabled"===t||"auth/user-token-expired"===t} - Qt(BYi,"getRecaptchaParams"),Qt(UYi,"getRecaptchaConfig"),Qt(FYi,"deleteAccount"),Qt($Yi,"deleteLinkedAccounts"),Qt(HYi,"getAccountInfo"),Qt(WYi,"utcTimestampToDateString"),Qt(VYi,"getIdTokenResult"),Qt(jYi,"secondsStringToMilliseconds"),Qt(KYi,"_parseToken"),Qt(zYi,"_tokenExpiresIn"),Qt(YYi,"_logoutIfInvalidated"),Qt(qYi,"isUserInvalidated"); - const XYi=class{ - constructor(t){ - this.user=t,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4} - _start(){ - this.isRunning||(this.isRunning=!0,this.schedule())} - _stop(){ - this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))} - getInterval(t){ - if(t){ - const t=this.errorBackoff; - return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),t} - { - this.errorBackoff=3e4; - const t=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5; - return Math.max(0,t)} - } - schedule(t=!1){ - if(!this.isRunning)return; - const i=this.getInterval(t); - this.timerId=setTimeout(async()=>{ - await this.iteration()} - ,i)} - async iteration(){ - try{ - await this.user.getIdToken(!0)} - catch(frt){ - return void("auth/network-request-failed"===(null==frt?void 0:frt.code)&&this.schedule(!0))} - this.schedule()} - } - ; - Qt(XYi,"ProactiveRefresh"); - let JYi=XYi; - const QYi=class{ - constructor(t,i){ - this.createdAt=t,this.lastLoginAt=i,this._initializeTime()} - _initializeTime(){ - this.lastSignInTime=WYi(this.lastLoginAt),this.creationTime=WYi(this.createdAt)} - _copy(t){ - this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()} - toJSON(){ - return{ - createdAt:this.createdAt,lastLoginAt:this.lastLoginAt} - } - } - ; - Qt(QYi,"UserMetadata"); - let ZYi=QYi; - async function tqi(t){ - var i; - const s=t.auth,e=await t.getIdToken(),n=await YYi(t,HYi(s,{ - idToken:e} - )); - cYi(null==n?void 0:n.users.length,s,"internal-error"); - const h=n.users[0]; - t._notifyReloadListener(h); - const r=(null==(i=h.providerUserInfo)?void 0:i.length)?eqi(h.providerUserInfo):[],o=sqi(t.providerData,r),a=t.isAnonymous,c=!(t.email&&h.passwordHash||(null==o?void 0:o.length)),l=!!a&&c,u={ - uid:h.localId,displayName:h.displayName||null,photoURL:h.photoUrl||null,email:h.email||null,emailVerified:h.emailVerified||!1,phoneNumber:h.phoneNumber||null,tenantId:h.tenantId||null,providerData:o,metadata:new ZYi(h.createdAt,h.lastLoginAt),isAnonymous:l} - ; - Object.assign(t,u)} - async function iqi(t){ - const i=Qji(t); - await tqi(i),await i.auth._persistUserIfCurrent(i),i.auth._notifyListenersIfCurrent(i)} - function sqi(t,i){ - const s=t.filter(t=>!i.some(i=>i.providerId===t.providerId)); - return[...s,...i]} - function eqi(t){ - return t.map(({ - providerId:t,...i} - )=>({ - providerId:t,uid:i.rawId||"",displayName:i.displayName||null,email:i.email||null,phoneNumber:i.phoneNumber||null,photoURL:i.photoUrl||null} - ))} - async function nqi(t,i){ - const s=await CYi(t,{ - } - ,async()=>{ - const s=Vji({ - grant_type:"refresh_token",refresh_token:i} - ).slice(1),{ - tokenApiHost:e,apiKey:n} - =t.config,h=await IYi(t,e,"/v1/token",`key=${ - n} - `),r=await t._getAdditionalHeaders(); - r["Content-Type"]="application/x-www-form-urlencoded"; - const o={ - method:"POST",headers:r,body:s} - ; - return t.emulatorConfig&&Zji(t.emulatorConfig.host)&&(o.credentials="include"),bYi.fetch()(h,o)} - ); - return{ - accessToken:s.access_token,expiresIn:s.expires_in,refreshToken:s.refresh_token} - } - async function hqi(t,i){ - return TYi(t,"POST","/v2/accounts:revokeToken",SYi(t,i))} - Qt(tqi,"_reloadWithoutSaving"),Qt(iqi,"reload"),Qt(sqi,"mergeProviderData"),Qt(eqi,"extractProviderData"),Qt(nqi,"requestStsToken"),Qt(hqi,"revokeToken"); - const rqi=class t{ - constructor(){ - this.refreshToken=null,this.accessToken=null,this.expirationTime=null} - get isExpired(){ - return!this.expirationTime||Date.now()>this.expirationTime-3e4} - updateFromServerResponse(t){ - cYi(t.idToken,"internal-error"),cYi(void 0!==t.idToken,"internal-error"),cYi(void 0!==t.refreshToken,"internal-error"); - const i="expiresIn"in t&&void 0!==t.expiresIn?Number(t.expiresIn):zYi(t.idToken); - this.updateTokensAndExpiration(t.idToken,t.refreshToken,i)} - updateFromIdToken(t){ - cYi(0!==t.length,"internal-error"); - const i=zYi(t); - this.updateTokensAndExpiration(t,null,i)} - async getToken(t,i=!1){ - return i||!this.accessToken||this.isExpired?(cYi(this.refreshToken,t,"user-token-expired"),this.refreshToken?(await this.refresh(t,this.refreshToken),this.accessToken):null):this.accessToken} - clearRefreshToken(){ - this.refreshToken=null} - async refresh(t,i){ - const{ - accessToken:s,refreshToken:e,expiresIn:n} - =await nqi(t,i); - this.updateTokensAndExpiration(s,e,Number(n))} - updateTokensAndExpiration(t,i,s){ - this.refreshToken=i||null,this.accessToken=t||null,this.expirationTime=Date.now()+1e3*s} - static fromJSON(i,s){ - const{ - refreshToken:e,accessToken:n,expirationTime:h} - =s,r=new t; - return e&&(cYi("string"==typeof e,"internal-error",{ - appName:i} - ),r.refreshToken=e),n&&(cYi("string"==typeof n,"internal-error",{ - appName:i} - ),r.accessToken=n),h&&(cYi("number"==typeof h,"internal-error",{ - appName:i} - ),r.expirationTime=h),r} - toJSON(){ - return{ - refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime} - } - _assign(t){ - this.accessToken=t.accessToken,this.refreshToken=t.refreshToken,this.expirationTime=t.expirationTime} - _clone(){ - return Object.assign(new t,this.toJSON())} - _performRefresh(){ - return lYi("not implemented")} - } - ; - Qt(rqi,"StsTokenManager"); - let oqi=rqi; - function aqi(t,i){ - cYi("string"==typeof t||void 0===t,"internal-error",{ - appName:i} - )} - Qt(aqi,"assertStringOrUndefined"); - const cqi=class t{ - constructor({ - uid:t,auth:i,stsTokenManager:s,...e} - ){ - this.providerId="firebase",this.proactiveRefresh=new JYi(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=i,this.stsTokenManager=s,this.accessToken=s.accessToken,this.displayName=e.displayName||null,this.email=e.email||null,this.emailVerified=e.emailVerified||!1,this.phoneNumber=e.phoneNumber||null,this.photoURL=e.photoURL||null,this.isAnonymous=e.isAnonymous||!1,this.tenantId=e.tenantId||null,this.providerData=e.providerData?[...e.providerData]:[],this.metadata=new ZYi(e.createdAt||void 0,e.lastLoginAt||void 0)} - async getIdToken(t){ - const i=await YYi(this,this.stsTokenManager.getToken(this.auth,t)); - return cYi(i,this.auth,"internal-error"),this.accessToken!==i&&(this.accessToken=i,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),i} - getIdTokenResult(t){ - return VYi(this,t)} - reload(){ - return iqi(this)} - _assign(t){ - this!==t&&(cYi(this.uid===t.uid,this.auth,"internal-error"),this.displayName=t.displayName,this.photoURL=t.photoURL,this.email=t.email,this.emailVerified=t.emailVerified,this.phoneNumber=t.phoneNumber,this.isAnonymous=t.isAnonymous,this.tenantId=t.tenantId,this.providerData=t.providerData.map(t=>({ - ...t} - )),this.metadata._copy(t.metadata),this.stsTokenManager._assign(t.stsTokenManager))} - _clone(i){ - const s=new t({ - ...this,auth:i,stsTokenManager:this.stsTokenManager._clone()} - ); - return s.metadata._copy(this.metadata),s} - _onReload(t){ - cYi(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=t,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)} - _notifyReloadListener(t){ - this.reloadListener?this.reloadListener(t):this.reloadUserInfo=t} - _startProactiveRefresh(){ - this.proactiveRefresh._start()} - _stopProactiveRefresh(){ - this.proactiveRefresh._stop()} - async _updateTokensIfNecessary(t,i=!1){ - let s=!1; - t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),s=!0),i&&await tqi(this),await this.auth._persistUserIfCurrent(this),s&&this.auth._notifyListenersIfCurrent(this)} - async delete(){ - if(Ozi(this.auth.app))return Promise.reject(rYi(this.auth)); - const t=await this.getIdToken(); - return await YYi(this,FYi(this.auth,{ - idToken:t} - )),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()} - toJSON(){ - return{ - uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(t=>({ - ...t} - )),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name} - } - get refreshToken(){ - return this.stsTokenManager.refreshToken||""} - static _fromJSON(i,s){ - const e=s.displayName??void 0,n=s.email??void 0,h=s.phoneNumber??void 0,r=s.photoURL??void 0,o=s.tenantId??void 0,a=s._redirectEventId??void 0,c=s.createdAt??void 0,l=s.lastLoginAt??void 0,{ - uid:u,emailVerified:d,isAnonymous:f,providerData:p,stsTokenManager:w} - =s; - cYi(u&&w,i,"internal-error"); - const g=oqi.fromJSON(this.name,w); - cYi("string"==typeof u,i,"internal-error"),aqi(e,i.name),aqi(n,i.name),cYi("boolean"==typeof d,i,"internal-error"),cYi("boolean"==typeof f,i,"internal-error"),aqi(h,i.name),aqi(r,i.name),aqi(o,i.name),aqi(a,i.name),aqi(c,i.name),aqi(l,i.name); - const m=new t({ - uid:u,auth:i,email:n,emailVerified:d,displayName:e,isAnonymous:f,photoURL:r,phoneNumber:h,tenantId:o,stsTokenManager:g,createdAt:c,lastLoginAt:l} - ); - return p&&Array.isArray(p)&&(m.providerData=p.map(t=>({ - ...t} - ))),a&&(m._redirectEventId=a),m} - static async _fromIdTokenResponse(i,s,e=!1){ - const n=new oqi; - n.updateFromServerResponse(s); - const h=new t({ - uid:s.localId,auth:i,stsTokenManager:n,isAnonymous:e} - ); - return await tqi(h),h} - static async _fromGetAccountInfoResponse(i,s,e){ - const n=s.users[0]; - cYi(void 0!==n.localId,"internal-error"); - const h=void 0!==n.providerUserInfo?eqi(n.providerUserInfo):[],r=!(n.email&&n.passwordHash||(null==h?void 0:h.length)),o=new oqi; - o.updateFromIdToken(e); - const a=new t({ - uid:n.localId,auth:i,stsTokenManager:o,isAnonymous:r} - ),c={ - uid:n.localId,displayName:n.displayName||null,photoURL:n.photoUrl||null,email:n.email||null,emailVerified:n.emailVerified||!1,phoneNumber:n.phoneNumber||null,tenantId:n.tenantId||null,providerData:h,metadata:new ZYi(n.createdAt,n.lastLoginAt),isAnonymous:!(n.email&&n.passwordHash||(null==h?void 0:h.length))} - ; - return Object.assign(a,c),a} - } - ; - Qt(cqi,"UserImpl"); - let lqi=cqi; - const uqi=new Map; - function dqi(t){ - uYi(t instanceof Function,"Expected a class definition"); - let i=uqi.get(t); - return i?(uYi(i instanceof t,"Instance stored in cache mismatched with class"),i):(i=new t,uqi.set(t,i),i)} - Qt(dqi,"_getInstance"); - const fqi=class{ - constructor(){ - this.type="NONE",this.storage={ - } - } - async _isAvailable(){ - return!0} - async _set(t,i){ - this.storage[t]=i} - async _get(t){ - const i=this.storage[t]; - return void 0===i?null:i} - async _remove(t){ - delete this.storage[t]} - _addListener(t,i){ - } - _removeListener(t,i){ - } - } - ; - Qt(fqi,"InMemoryPersistence"); - let pqi=fqi; - pqi.type="NONE"; - const wqi=pqi; - function gqi(t,i,s){ - return`firebase:${ - t} - :${ - i} - :${ - s} - `} - Qt(gqi,"_persistenceKeyName"); - const mqi=class t{ - constructor(t,i,s){ - this.persistence=t,this.auth=i,this.userKey=s; - const{ - config:e,name:n} - =this.auth; - this.fullUserKey=gqi(this.userKey,e.apiKey,n),this.fullPersistenceKey=gqi("persistence",e.apiKey,n),this.boundEventHandler=i._onStorageEvent.bind(i),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)} - setCurrentUser(t){ - return this.persistence._set(this.fullUserKey,t.toJSON())} - async getCurrentUser(){ - const t=await this.persistence._get(this.fullUserKey); - if(!t)return null; - if("string"==typeof t){ - const i=await HYi(this.auth,{ - idToken:t} - ).catch(()=>{ - } - ); - return i?lqi._fromGetAccountInfoResponse(this.auth,i,t):null} - return lqi._fromJSON(this.auth,t)} - removeCurrentUser(){ - return this.persistence._remove(this.fullUserKey)} - savePersistenceForRedirect(){ - return this.persistence._set(this.fullPersistenceKey,this.persistence.type)} - async setPersistence(t){ - if(this.persistence===t)return; - const i=await this.getCurrentUser(); - return await this.removeCurrentUser(),this.persistence=t,i?this.setCurrentUser(i):void 0} - delete(){ - this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)} - static async create(i,s,e="authUser"){ - if(!s.length)return new t(dqi(wqi),i,e); - const n=(await Promise.all(s.map(async t=>{ - if(await t._isAvailable())return t} - ))).filter(t=>t); - let h=n[0]||dqi(wqi); - const r=gqi(e,i.config.apiKey,i.name); - let o=null; - for(const t of s)try{ - const s=await t._get(r); - if(s){ - let e; - if("string"==typeof s){ - const t=await HYi(i,{ - idToken:s} - ).catch(()=>{ - } - ); - if(!t)break; - e=await lqi._fromGetAccountInfoResponse(i,t,s)} - else e=lqi._fromJSON(i,s); - t!==h&&(o=e),h=t; - break} - } - catch{ - } - const a=n.filter(t=>t._shouldAllowMigration); - return h._shouldAllowMigration&&a.length?(h=a[0],o&&await h._set(r,o.toJSON()),await Promise.all(s.map(async t=>{ - if(t!==h)try{ - await t._remove(r)} - catch{ - } - } - )),new t(h,i,e)):new t(h,i,e)} - } - ; - Qt(mqi,"PersistenceUserManager"); - let vqi=mqi; - function _qi(t){ - const i=t.toLowerCase(); - if(i.includes("opera/")||i.includes("opr/")||i.includes("opios/"))return"Opera"; - if(Eqi(i))return"IEMobile"; - if(i.includes("msie")||i.includes("trident/"))return"IE"; - if(i.includes("edge/"))return"Edge"; - if(Mqi(i))return"Firefox"; - if(i.includes("silk/"))return"Silk"; - if(Sqi(i))return"Blackberry"; - if(Tqi(i))return"Webos"; - if(bqi(i))return"Safari"; - if((i.includes("chrome/")||yqi(i))&&!i.includes("edge/"))return"Chrome"; - if(Aqi(i))return"Android"; - { - const i=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,s=t.match(i); - if(2===(null==s?void 0:s.length))return s[1]} - return"Other"} - function Mqi(t=Tji()){ - return/firefox\//i.test(t)} - function bqi(t=Tji()){ - const i=t.toLowerCase(); - return i.includes("safari/")&&!i.includes("chrome/")&&!i.includes("crios/")&&!i.includes("android")} - function yqi(t=Tji()){ - return/crios\//i.test(t)} - function Eqi(t=Tji()){ - return/iemobile/i.test(t)} - function Aqi(t=Tji()){ - return/android/i.test(t)} - function Sqi(t=Tji()){ - return/blackberry/i.test(t)} - function Tqi(t=Tji()){ - return/webos/i.test(t)} - function Cqi(t=Tji()){ - return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)} - function Oqi(t=Tji()){ - var i; - return Cqi(t)&&!!(null==(i=window.navigator)?void 0:i.standalone)} - function Iqi(){ - return xji()&&10===document.documentMode} - function kqi(t=Tji()){ - return Cqi(t)||Aqi(t)||Tqi(t)||Sqi(t)||/windows phone/i.test(t)||Eqi(t)} - function xqi(t,i=[]){ - let s; - switch(t){ - case"Browser":s=_qi(Tji()); - break; - case"Worker":s=`${ - _qi(Tji())} - -${ - t} - `; - break; - default:s=t} - const e=i.length?i.join(","):"FirebaseCore-web"; - return`${ - s} - /JsCore/${ - Rzi} - /${ - e} - `} - Qt(_qi,"_getBrowserName"),Qt(Mqi,"_isFirefox"),Qt(bqi,"_isSafari"),Qt(yqi,"_isChromeIOS"),Qt(Eqi,"_isIEMobile"),Qt(Aqi,"_isAndroid"),Qt(Sqi,"_isBlackBerry"),Qt(Tqi,"_isWebOS"),Qt(Cqi,"_isIOS"),Qt(Oqi,"_isIOSStandalone"),Qt(Iqi,"_isIE10"),Qt(kqi,"_isMobileBrowser"),Qt(xqi,"_getClientVersion"); - const Rqi=class{ - constructor(t){ - this.auth=t,this.queue=[]} - pushCallback(t,i){ - const s=Qt(i=>new Promise((s,e)=>{ - try{ - s(t(i))} - catch(frt){ - e(frt)} - } - ),"wrappedCallback"); - s.onAbort=i,this.queue.push(s); - const e=this.queue.length-1; - return()=>{ - this.queue[e]=()=>Promise.resolve()} - } - async runMiddleware(t){ - if(this.auth.currentUser===t)return; - const i=[]; - try{ - for(const s of this.queue)await s(t),s.onAbort&&i.push(s.onAbort)} - catch(frt){ - i.reverse(); - for(const e of i)try{ - e()} - catch(s){ - } - throw this.auth._errorFactory.create("login-blocked",{ - originalMessage:null==frt?void 0:frt.message} - )} - } - } - ; - Qt(Rqi,"AuthMiddlewareQueue"); - let Pqi=Rqi; - async function Nqi(t,i={ - } - ){ - return TYi(t,"GET","/v2/passwordPolicy",SYi(t,i))} - Qt(Nqi,"_getPasswordPolicy"); - const Lqi=class{ - constructor(t){ - var i; - const s=t.customStrengthOptions; - this.customStrengthOptions={ - } - ,this.customStrengthOptions.minPasswordLength=s.minPasswordLength??6,s.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=s.maxPasswordLength),void 0!==s.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=s.containsLowercaseCharacter),void 0!==s.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=s.containsUppercaseCharacter),void 0!==s.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=s.containsNumericCharacter),void 0!==s.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=s.containsNonAlphanumericCharacter),this.enforcementState=t.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(null==(i=t.allowedNonAlphanumericCharacters)?void 0:i.join(""))??"",this.forceUpgradeOnSignin=t.forceUpgradeOnSignin??!1,this.schemaVersion=t.schemaVersion} - validatePassword(t){ - const i={ - isValid:!0,passwordPolicy:this} - ; - return this.validatePasswordLengthOptions(t,i),this.validatePasswordCharacterOptions(t,i),i.isValid&&(i.isValid=i.meetsMinPasswordLength??!0),i.isValid&&(i.isValid=i.meetsMaxPasswordLength??!0),i.isValid&&(i.isValid=i.containsLowercaseLetter??!0),i.isValid&&(i.isValid=i.containsUppercaseLetter??!0),i.isValid&&(i.isValid=i.containsNumericCharacter??!0),i.isValid&&(i.isValid=i.containsNonAlphanumericCharacter??!0),i} - validatePasswordLengthOptions(t,i){ - const s=this.customStrengthOptions.minPasswordLength,e=this.customStrengthOptions.maxPasswordLength; - s&&(i.meetsMinPasswordLength=t.length>=s),e&&(i.meetsMaxPasswordLength=t.length<=e)} - validatePasswordCharacterOptions(t,i){ - let s; - this.updatePasswordCharacterOptionsStatuses(i,!1,!1,!1,!1); - for(let e=0; - e<t.length; - e++)s=t.charAt(e),this.updatePasswordCharacterOptionsStatuses(i,s>="a"&&s<="z",s>="A"&&s<="Z",s>="0"&&s<="9",this.allowedNonAlphanumericCharacters.includes(s))} - updatePasswordCharacterOptionsStatuses(t,i,s,e,n){ - this.customStrengthOptions.containsLowercaseLetter&&(t.containsLowercaseLetter||(t.containsLowercaseLetter=i)),this.customStrengthOptions.containsUppercaseLetter&&(t.containsUppercaseLetter||(t.containsUppercaseLetter=s)),this.customStrengthOptions.containsNumericCharacter&&(t.containsNumericCharacter||(t.containsNumericCharacter=e)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(t.containsNonAlphanumericCharacter||(t.containsNonAlphanumericCharacter=n))} - } - ; - Qt(Lqi,"PasswordPolicyImpl"); - let Dqi=Lqi; - const Gqi=class{ - constructor(t,i,s,e){ - this.app=t,this.heartbeatServiceProvider=i,this.appCheckServiceProvider=s,this.config=e,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new $qi(this),this.idTokenSubscription=new $qi(this),this.beforeStateQueue=new Pqi(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=Zzi,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={ - } - ,this._projectPasswordPolicy=null,this._tenantPasswordPolicies={ - } - ,this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={ - appVerificationDisabledForTesting:!1} - ,this.frameworks=[],this.name=t.name,this.clientVersion=e.sdkClientVersion,this._persistenceManagerAvailable=new Promise(t=>this._resolvePersistenceManagerAvailable=t)} - _initializeWithPersistence(t,i){ - return i&&(this._popupRedirectResolver=dqi(i)),this._initializationPromise=this.queue(async()=>{ - var s,e,n; - if(!this._deleted&&(this.persistenceManager=await vqi.create(this,t),null==(s=this._resolvePersistenceManagerAvailable)||s.call(this),!this._deleted)){ - if(null==(e=this._popupRedirectResolver)?void 0:e._shouldInitProactively)try{ - await this._popupRedirectResolver._initialize(this)} - catch(frt){ - } - await this.initializeCurrentUser(i),this.lastNotifiedUid=(null==(n=this.currentUser)?void 0:n.uid)||null,this._deleted||(this._isInitialized=!0)} - } - ),this._initializationPromise} - async _onStorageEvent(){ - if(this._deleted)return; - const t=await this.assertedPersistence.getCurrentUser(); - return this.currentUser||t?this.currentUser&&t&&this.currentUser.uid===t.uid?(this._currentUser._assign(t),void(await this.currentUser.getIdToken())):void(await this._updateCurrentUser(t,!0)):void 0} - async initializeCurrentUserFromIdToken(t){ - try{ - const i=await HYi(this,{ - idToken:t} - ),s=await lqi._fromGetAccountInfoResponse(this,i,t); - await this.directlySetCurrentUser(s)} - catch(h6i){ - await this.directlySetCurrentUser(null)} - } - async initializeCurrentUser(t){ - var i; - if(Ozi(this.app)){ - const t=this.app.settings.authIdToken; - return t?new Promise(i=>{ - setTimeout(()=>this.initializeCurrentUserFromIdToken(t).then(i,i))} - ):this.directlySetCurrentUser(null)} - const s=await this.assertedPersistence.getCurrentUser(); - let e=s,n=!1; - if(t&&this.config.authDomain){ - await this.getOrInitRedirectPersistenceManager(); - const s=null==(i=this.redirectUser)?void 0:i._redirectEventId,h=null==e?void 0:e._redirectEventId,r=await this.tryRedirectSignIn(t); - s&&s!==h||!(null==r?void 0:r.user)||(e=r.user,n=!0)} - if(!e)return this.directlySetCurrentUser(null); - if(!e._redirectEventId){ - if(n)try{ - await this.beforeStateQueue.runMiddleware(e)} - catch(frt){ - e=s,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(frt))} - return e?this.reloadAndSetCurrentUserOrClear(e):this.directlySetCurrentUser(null)} - return cYi(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===e._redirectEventId?this.directlySetCurrentUser(e):this.reloadAndSetCurrentUserOrClear(e)} - async tryRedirectSignIn(t){ - let i=null; - try{ - i=await this._popupRedirectResolver._completeRedirectFn(this,t,!0)} - catch(frt){ - await this._setRedirectUser(null)} - return i} - async reloadAndSetCurrentUserOrClear(t){ - try{ - await tqi(t)} - catch(frt){ - if("auth/network-request-failed"!==(null==frt?void 0:frt.code))return this.directlySetCurrentUser(null)} - return this.directlySetCurrentUser(t)} - useDeviceLanguage(){ - this.languageCode=gYi()} - async _delete(){ - this._deleted=!0} - async updateCurrentUser(t){ - if(Ozi(this.app))return Promise.reject(rYi(this)); - const i=t?Qji(t):null; - return i&&cYi(i.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(i&&i._clone(this))} - async _updateCurrentUser(t,i=!1){ - if(!this._deleted)return t&&cYi(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),i||await this.beforeStateQueue.runMiddleware(t),this.queue(async()=>{ - await this.directlySetCurrentUser(t),this.notifyAuthListeners()} - )} - async signOut(){ - return Ozi(this.app)?Promise.reject(rYi(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))} - setPersistence(t){ - return Ozi(this.app)?Promise.reject(rYi(this)):this.queue(async()=>{ - await this.assertedPersistence.setPersistence(dqi(t))} - )} - _getRecaptchaConfig(){ - return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]} - async validatePassword(t){ - this._getPasswordPolicyInternal()||await this._updatePasswordPolicy(); - const i=this._getPasswordPolicyInternal(); - return i.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{ - } - )):i.validatePassword(t)} - _getPasswordPolicyInternal(){ - return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]} - async _updatePasswordPolicy(){ - const t=await Nqi(this),i=new Dqi(t); - null===this.tenantId?this._projectPasswordPolicy=i:this._tenantPasswordPolicies[this.tenantId]=i} - _getPersistenceType(){ - return this.assertedPersistence.persistence.type} - _getPersistence(){ - return this.assertedPersistence.persistence} - _updateErrorMap(t){ - this._errorFactory=new Bji("auth","Firebase",t())} - onAuthStateChanged(t,i,s){ - return this.registerStateListener(this.authStateSubscription,t,i,s)} - beforeAuthStateChanged(t,i){ - return this.beforeStateQueue.pushCallback(t,i)} - onIdTokenChanged(t,i,s){ - return this.registerStateListener(this.idTokenSubscription,t,i,s)} - authStateReady(){ - return new Promise((t,i)=>{ - if(this.currentUser)t(); - else{ - const s=this.onAuthStateChanged(()=>{ - s(),t()} - ,i)} - } - )} - async revokeAccessToken(t){ - if(this.currentUser){ - const i={ - providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:t,idToken:await this.currentUser.getIdToken()} - ; - null!=this.tenantId&&(i.tenantId=this.tenantId),await hqi(this,i)} - } - toJSON(){ - var t; - return{ - apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null==(t=this._currentUser)?void 0:t.toJSON()} - } - async _setRedirectUser(t,i){ - const s=await this.getOrInitRedirectPersistenceManager(i); - return null===t?s.removeCurrentUser():s.setCurrentUser(t)} - async getOrInitRedirectPersistenceManager(t){ - if(!this.redirectPersistenceManager){ - const i=t&&dqi(t)||this._popupRedirectResolver; - cYi(i,this,"argument-error"),this.redirectPersistenceManager=await vqi.create(this,[dqi(i._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()} - return this.redirectPersistenceManager} - async _redirectUserForId(t){ - var i,s; - return this._isInitialized&&await this.queue(async()=>{ - } - ),(null==(i=this._currentUser)?void 0:i._redirectEventId)===t?this._currentUser:(null==(s=this.redirectUser)?void 0:s._redirectEventId)===t?this.redirectUser:null} - async _persistUserIfCurrent(t){ - if(t===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(t))} - _notifyListenersIfCurrent(t){ - t===this.currentUser&&this.notifyAuthListeners()} - _key(){ - return`${ - this.config.authDomain} - :${ - this.config.apiKey} - :${ - this.name} - `} - _startProactiveRefresh(){ - this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()} - _stopProactiveRefresh(){ - this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()} - get _currentUser(){ - return this.currentUser} - notifyAuthListeners(){ - var t; - if(!this._isInitialized)return; - this.idTokenSubscription.next(this.currentUser); - const i=(null==(t=this.currentUser)?void 0:t.uid)??null; - this.lastNotifiedUid!==i&&(this.lastNotifiedUid=i,this.authStateSubscription.next(this.currentUser))} - registerStateListener(t,i,s,e){ - if(this._deleted)return()=>{ - } - ; - const n="function"==typeof i?i:i.next.bind(i); - let h=!1; - const r=this._isInitialized?Promise.resolve():this._initializationPromise; - if(cYi(r,this,"internal-error"),r.then(()=>{ - h||n(this.currentUser)} - ),"function"==typeof i){ - const n=t.addObserver(i,s,e); - return()=>{ - h=!0,n()} - } - { - const s=t.addObserver(i); - return()=>{ - h=!0,s()} - } - } - async directlySetCurrentUser(t){ - this.currentUser&&this.currentUser!==t&&this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh(),this.currentUser=t,t?await this.assertedPersistence.setCurrentUser(t):await this.assertedPersistence.removeCurrentUser()} - queue(t){ - return this.operations=this.operations.then(t,t),this.operations} - get assertedPersistence(){ - return cYi(this.persistenceManager,this,"internal-error"),this.persistenceManager} - _logFramework(t){ - t&&!this.frameworks.includes(t)&&(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=xqi(this.config.clientPlatform,this._getFrameworks()))} - _getFrameworks(){ - return this.frameworks} - async _getAdditionalHeaders(){ - var t; - const i={ - "X-Client-Version":this.clientVersion} - ; - this.app.options.appId&&(i["X-Firebase-gmpid"]=this.app.options.appId); - const s=await(null==(t=this.heartbeatServiceProvider.getImmediate({ - optional:!0} - ))?void 0:t.getHeartbeatsHeader()); - s&&(i["X-Firebase-Client"]=s); - const e=await this._getAppCheckToken(); - return e&&(i["X-Firebase-AppCheck"]=e),i} - async _getAppCheckToken(){ - var t; - if(Ozi(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken; - const i=await(null==(t=this.appCheckServiceProvider.getImmediate({ - optional:!0} - ))?void 0:t.getToken()); - return(null==i?void 0:i.error)&&iYi(`Error while retrieving App Check token: ${ - i.error} - `),null==i?void 0:i.token} - } - ; - Qt(Gqi,"AuthImpl"); - let Bqi=Gqi; - function Uqi(t){ - return Qji(t)} - Qt(Uqi,"_castAuth"); - const Fqi=class{ - constructor(t){ - this.auth=t,this.observer=null,this.addObserver=zji(t=>this.observer=t)} - get next(){ - return cYi(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)} - } - ; - Qt(Fqi,"Subscription"); - let $qi=Fqi,Hqi={ - async loadJS(){ - throw new Error("Unable to load external scripts")} - ,recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""} - ; - function Wqi(t){ - Hqi=t} - function Vqi(t){ - return Hqi.loadJS(t)} - function jqi(){ - return Hqi.recaptchaV2Script} - function Kqi(){ - return Hqi.recaptchaEnterpriseScript} - function zqi(){ - return Hqi.gapiScript} - function Yqi(t){ - return`__${ - t} - ${ - Math.floor(1e6*Math.random())} - `} - Qt(Wqi,"_setExternalJSProvider"),Qt(Vqi,"_loadJS"),Qt(jqi,"_recaptchaV2ScriptUrl"),Qt(Kqi,"_recaptchaEnterpriseScriptUrl"),Qt(zqi,"_gapiScriptUrl"),Qt(Yqi,"_generateCallbackName"); - const qqi=1e12,Xqi=class{ - constructor(t){ - this.auth=t,this.counter=qqi,this._widgets=new Map} - render(t,i){ - const s=this.counter; - return this._widgets.set(s,new eXi(t,this.auth.name,i||{ - } - )),this.counter++,s} - reset(t){ - var i; - const s=t||qqi; - null==(i=this._widgets.get(s))||i.delete(),this._widgets.delete(s)} - getResponse(t){ - var i; - const s=t||qqi; - return(null==(i=this._widgets.get(s))?void 0:i.getResponse())||""} - async execute(t){ - var i; - const s=t||qqi; - return null==(i=this._widgets.get(s))||i.execute(),""} - } - ; - Qt(Xqi,"MockReCaptcha"); - let Jqi=Xqi; - const Qqi=class{ - constructor(){ - this.enterprise=new iXi} - ready(t){ - t()} - execute(t,i){ - return Promise.resolve("token")} - render(t,i){ - return""} - } - ; - Qt(Qqi,"MockGreCAPTCHATopLevel"); - let Zqi=Qqi; - const tXi=class{ - ready(t){ - t()} - execute(t,i){ - return Promise.resolve("token")} - render(t,i){ - return""} - } - ; - Qt(tXi,"MockGreCAPTCHA"); - let iXi=tXi; - const sXi=class{ - constructor(t,i,s){ - this.params=s,this.timerId=null,this.deleted=!1,this.responseToken=null,this.clickHandler=()=>{ - this.execute()} - ; - const e="string"==typeof t?document.getElementById(t):t; - cYi(e,"argument-error",{ - appName:i} - ),this.container=e,this.isVisible="invisible"!==this.params.size,this.isVisible?this.execute():this.container.addEventListener("click",this.clickHandler)} - getResponse(){ - return this.checkIfDeleted(),this.responseToken} - delete(){ - this.checkIfDeleted(),this.deleted=!0,this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.container.removeEventListener("click",this.clickHandler)} - execute(){ - this.checkIfDeleted(),this.timerId||(this.timerId=window.setTimeout(()=>{ - this.responseToken=nXi(50); - const{ - callback:t,"expired-callback":i} - =this.params; - if(t)try{ - t(this.responseToken)} - catch(frt){ - } - this.timerId=window.setTimeout(()=>{ - if(this.timerId=null,this.responseToken=null,i)try{ - i()} - catch(frt){ - } - this.isVisible&&this.execute()} - ,6e4)} - ,500))} - checkIfDeleted(){ - if(this.deleted)throw new Error("reCAPTCHA mock was already deleted!")} - } - ; - Qt(sXi,"MockWidget"); - let eXi=sXi; - function nXi(t){ - const i=[]; - for(let s=0; - s<t; - s++)i.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))); - return i.join("")} - Qt(nXi,"generateRandomAlphaNumericString"); - const hXi="NO_RECAPTCHA",rXi=class{ - constructor(t){ - this.type="recaptcha-enterprise",this.auth=Uqi(t)} - async verify(t="verify",i=!1){ - async function s(t){ - if(!i){ - if(null==t.tenantId&&null!=t._agentRecaptchaConfig)return t._agentRecaptchaConfig.siteKey; - if(null!=t.tenantId&&void 0!==t._tenantRecaptchaConfigs[t.tenantId])return t._tenantRecaptchaConfigs[t.tenantId].siteKey} - return new Promise(async(i,s)=>{ - UYi(t,{ - clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"} - ).then(e=>{ - if(void 0!==e.recaptchaKey){ - const s=new GYi(e); - return null==t.tenantId?t._agentRecaptchaConfig=s:t._tenantRecaptchaConfigs[t.tenantId]=s,i(s.siteKey)} - s(new Error("recaptcha Enterprise site key undefined"))} - ).catch(t=>{ - s(t)} - )} - )} - function e(i,s,e){ - const n=window.grecaptcha; - LYi(n)?n.enterprise.ready(()=>{ - n.enterprise.execute(i,{ - action:t} - ).then(t=>{ - s(t)} - ).catch(()=>{ - s(hXi)} - )} - ):e(Error("No reCAPTCHA enterprise script loaded."))} - return Qt(s,"retrieveSiteKey"),Qt(e,"retrieveRecaptchaToken"),this.auth.settings.appVerificationDisabledForTesting?(new Zqi).execute("siteKey",{ - action:"verify"} - ):new Promise((t,n)=>{ - s(this.auth).then(s=>{ - if(!i&&LYi(window.grecaptcha))e(s,t,n); - else{ - if("undefined"==typeof window)return void n(new Error("RecaptchaVerifier is only supported in browser")); - let i=Kqi(); - 0!==i.length&&(i+=s),Vqi(i).then(()=>{ - e(s,t,n)} - ).catch(t=>{ - n(t)} - )} - } - ).catch(t=>{ - n(t)} - )} - )} - } - ; - Qt(rXi,"RecaptchaEnterpriseVerifier"); - let oXi=rXi; - async function aXi(t,i,s,e=!1,n=!1){ - const h=new oXi(t); - let r; - if(n)r=hXi; - else try{ - r=await h.verify(s)} - catch(a){ - r=await h.verify(s,!0)} - const o={ - ...i} - ; - if("mfaSmsEnrollment"===s||"mfaSmsSignIn"===s){ - if("phoneEnrollmentInfo"in o){ - const t=o.phoneEnrollmentInfo.phoneNumber,i=o.phoneEnrollmentInfo.recaptchaToken; - Object.assign(o,{ - phoneEnrollmentInfo:{ - phoneNumber:t,recaptchaToken:i,captchaResponse:r,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"} - } - )} - else if("phoneSignInInfo"in o){ - const t=o.phoneSignInInfo.recaptchaToken; - Object.assign(o,{ - phoneSignInInfo:{ - recaptchaToken:t,captchaResponse:r,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"} - } - )} - return o} - return e?Object.assign(o,{ - captchaResp:r} - ):Object.assign(o,{ - captchaResponse:r} - ),Object.assign(o,{ - clientType:"CLIENT_TYPE_WEB"} - ),Object.assign(o,{ - recaptchaVersion:"RECAPTCHA_ENTERPRISE"} - ),o} - async function cXi(t,i,s,e,n){ - var h,r; - if("EMAIL_PASSWORD_PROVIDER"===n){ - if(null==(h=t._getRecaptchaConfig())?void 0:h.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){ - const n=await aXi(t,i,s,"getOobCode"===s); - return e(t,n)} - return e(t,i).catch(async n=>{ - if("auth/missing-recaptcha-token"===n.code){ - const n=await aXi(t,i,s,"getOobCode"===s); - return e(t,n)} - return Promise.reject(n)} - )} - if("PHONE_PROVIDER"===n){ - if(null==(r=t._getRecaptchaConfig())?void 0:r.isProviderEnabled("PHONE_PROVIDER")){ - const n=await aXi(t,i,s); - return e(t,n).catch(async n=>{ - var h; - if("AUDIT"===(null==(h=t._getRecaptchaConfig())?void 0:h.getProviderEnforcementState("PHONE_PROVIDER"))&&("auth/missing-recaptcha-token"===n.code||"auth/invalid-app-credential"===n.code)){ - const n=await aXi(t,i,s,!1,!0); - return e(t,n)} - return Promise.reject(n)} - )} - { - const n=await aXi(t,i,s,!1,!0); - return e(t,n)} - } - return Promise.reject(n+" provider is not supported.")} - async function lXi(t){ - const i=Uqi(t),s=await UYi(i,{ - clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"} - ),e=new GYi(s); - null==i.tenantId?i._agentRecaptchaConfig=e:i._tenantRecaptchaConfigs[i.tenantId]=e,e.isAnyProviderEnabled()&&new oXi(i).verify()} - function uXi(t,i){ - const s=Czi(t,"auth"); - if(s.isInitialized()){ - const t=s.getImmediate(); - if(Hji(s.getOptions(),i??{ - } - ))return t; - eYi(t,"already-initialized")} - return s.initialize({ - options:i} - )} - function dXi(t,i){ - const s=(null==i?void 0:i.persistence)||[],e=(Array.isArray(s)?s:[s]).map(dqi); - (null==i?void 0:i.errorMap)&&t._updateErrorMap(i.errorMap),t._initializeWithPersistence(e,null==i?void 0:i.popupRedirectResolver)} - function fXi(t,i,s){ - const e=Uqi(t); - cYi(/^https?:\/\//.test(i),e,"invalid-emulator-scheme"); - const n=pXi(i),{ - host:h,port:r} - =wXi(i),o=null===r?"":`:${ - r} - `,a={ - url:`${ - n} - //${ - h} - ${ - o} - /`} - ,c=Object.freeze({ - host:h,port:r,protocol:n.replace(":",""),options:Object.freeze({ - disableWarnings:!1} - )} - ); - if(!e._canInitEmulator)return cYi(e.config.emulator&&e.emulatorConfig,e,"emulator-config-failed"),void cYi(Hji(a,e.config.emulator)&&Hji(c,e.emulatorConfig),e,"emulator-config-failed"); - e.config.emulator=a,e.emulatorConfig=c,e.settings.appVerificationDisabledForTesting=!0,Zji(h)?tKi(`${ - n} - //${ - h} - ${ - o} - `):mXi()} - function pXi(t){ - const i=t.indexOf(":"); - return i<0?"":t.substr(0,i+1)} - function wXi(t){ - const i=pXi(t),s=/(\/\/)?([^?#/]+)/.exec(t.substr(i.length)); - if(!s)return{ - host:"",port:null} - ; - const e=s[2].split("@").pop()||"",n=/^(\[[^\]]+\])(:|$)/.exec(e); - if(n){ - const t=n[1]; - return{ - host:t,port:gXi(e.substr(t.length+1))} - } - { - const[t,i]=e.split(":"); - return{ - host:t,port:gXi(i)} - } - } - function gXi(t){ - if(!t)return null; - const i=Number(t); - return isNaN(i)?null:i} - function mXi(){ - function t(){ - const t=document.createElement("p"),i=t.style; - t.innerText="Running in emulator mode. Do not use with production credentials.",i.position="fixed",i.width="100%",i.backgroundColor="#ffffff",i.border=".1em solid #000000",i.color="#b50000",i.bottom="0px",i.left="0px",i.margin="0px",i.zIndex="10000",i.textAlign="center",t.classList.add("firebase-emulator-warning"),document.body.appendChild(t)} - Qt(t,"attachBanner"),"undefined"!=typeof console&&console.info,"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",t):t())} - Qt(aXi,"injectRecaptchaFields"),Qt(cXi,"handleRecaptchaFlow"),Qt(lXi,"_initializeRecaptchaConfig"),Qt(uXi,"initializeAuth"),Qt(dXi,"_initializeAuthInstance"),Qt(fXi,"connectAuthEmulator"),Qt(pXi,"extractProtocol"),Qt(wXi,"extractHostAndPort"),Qt(gXi,"parsePort"),Qt(mXi,"emitEmulatorWarning"); - const vXi=class{ - constructor(t,i){ - this.providerId=t,this.signInMethod=i} - toJSON(){ - return lYi("not implemented")} - _getIdTokenResponse(t){ - return lYi("not implemented")} - _linkToIdToken(t,i){ - return lYi("not implemented")} - _getReauthenticationResolver(t){ - return lYi("not implemented")} - } - ; - Qt(vXi,"AuthCredential"); - let _Xi=vXi; - async function MXi(t,i){ - return TYi(t,"POST","/v1/accounts:resetPassword",SYi(t,i))} - async function bXi(t,i){ - return TYi(t,"POST","/v1/accounts:update",i)} - async function yXi(t,i){ - return TYi(t,"POST","/v1/accounts:signUp",i)} - async function EXi(t,i){ - return TYi(t,"POST","/v1/accounts:update",SYi(t,i))} - async function AXi(t,i){ - return OYi(t,"POST","/v1/accounts:signInWithPassword",SYi(t,i))} - async function SXi(t,i){ - return TYi(t,"POST","/v1/accounts:sendOobCode",SYi(t,i))} - async function TXi(t,i){ - return SXi(t,i)} - async function CXi(t,i){ - return SXi(t,i)} - async function OXi(t,i){ - return SXi(t,i)} - async function IXi(t,i){ - return SXi(t,i)} - async function kXi(t,i){ - return OYi(t,"POST","/v1/accounts:signInWithEmailLink",SYi(t,i))} - async function xXi(t,i){ - return OYi(t,"POST","/v1/accounts:signInWithEmailLink",SYi(t,i))} - Qt(MXi,"resetPassword"),Qt(bXi,"updateEmailPassword"),Qt(yXi,"linkEmailPassword"),Qt(EXi,"applyActionCode$1"),Qt(AXi,"signInWithPassword"),Qt(SXi,"sendOobCode"),Qt(TXi,"sendEmailVerification$1"),Qt(CXi,"sendPasswordResetEmail$1"),Qt(OXi,"sendSignInLinkToEmail$1"),Qt(IXi,"verifyAndChangeEmail"),Qt(kXi,"signInWithEmailLink$1"),Qt(xXi,"signInWithEmailLinkForLinking"); - const RXi=class t extends _Xi{ - constructor(t,i,s,e=null){ - super("password",s),this._email=t,this._password=i,this._tenantId=e} - static _fromEmailAndPassword(i,s){ - return new t(i,s,"password")} - static _fromEmailAndCode(i,s,e=null){ - return new t(i,s,"emailLink",e)} - toJSON(){ - return{ - email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId} - } - static fromJSON(t){ - const i="string"==typeof t?JSON.parse(t):t; - if((null==i?void 0:i.email)&&(null==i?void 0:i.password)){ - if("password"===i.signInMethod)return this._fromEmailAndPassword(i.email,i.password); - if("emailLink"===i.signInMethod)return this._fromEmailAndCode(i.email,i.password,i.tenantId)} - return null} - async _getIdTokenResponse(t){ - switch(this.signInMethod){ - case"password":return cXi(t,{ - returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"} - ,"signInWithPassword",AXi,"EMAIL_PASSWORD_PROVIDER"); - case"emailLink":return kXi(t,{ - email:this._email,oobCode:this._password} - ); - default:eYi(t,"internal-error")} - } - async _linkToIdToken(t,i){ - switch(this.signInMethod){ - case"password":return cXi(t,{ - idToken:i,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"} - ,"signUpPassword",yXi,"EMAIL_PASSWORD_PROVIDER"); - case"emailLink":return xXi(t,{ - idToken:i,email:this._email,oobCode:this._password} - ); - default:eYi(t,"internal-error")} - } - _getReauthenticationResolver(t){ - return this._getIdTokenResponse(t)} - } - ; - Qt(RXi,"EmailAuthCredential"); - let PXi=RXi; - async function NXi(t,i){ - return OYi(t,"POST","/v1/accounts:signInWithIdp",SYi(t,i))} - Qt(NXi,"signInWithIdp"); - const LXi=class t extends _Xi{ - constructor(){ - super(...arguments),this.pendingToken=null} - static _fromParams(i){ - const s=new t(i.providerId,i.signInMethod); - return i.idToken||i.accessToken?(i.idToken&&(s.idToken=i.idToken),i.accessToken&&(s.accessToken=i.accessToken),i.nonce&&!i.pendingToken&&(s.nonce=i.nonce),i.pendingToken&&(s.pendingToken=i.pendingToken)):i.oauthToken&&i.oauthTokenSecret?(s.accessToken=i.oauthToken,s.secret=i.oauthTokenSecret):eYi("argument-error"),s} - toJSON(){ - return{ - idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod} - } - static fromJSON(i){ - const s="string"==typeof i?JSON.parse(i):i,{ - providerId:e,signInMethod:n,...h} - =s; - if(!e||!n)return null; - const r=new t(e,n); - return r.idToken=h.idToken||void 0,r.accessToken=h.accessToken||void 0,r.secret=h.secret,r.nonce=h.nonce,r.pendingToken=h.pendingToken||null,r} - _getIdTokenResponse(t){ - return NXi(t,this.buildRequest())} - _linkToIdToken(t,i){ - const s=this.buildRequest(); - return s.idToken=i,NXi(t,s)} - _getReauthenticationResolver(t){ - const i=this.buildRequest(); - return i.autoCreate=!1,NXi(t,i)} - buildRequest(){ - const t={ - requestUri:"http://localhost",returnSecureToken:!0} - ; - if(this.pendingToken)t.pendingToken=this.pendingToken; - else{ - const i={ - } - ; - this.idToken&&(i.id_token=this.idToken),this.accessToken&&(i.access_token=this.accessToken),this.secret&&(i.oauth_token_secret=this.secret),i.providerId=this.providerId,this.nonce&&!this.pendingToken&&(i.nonce=this.nonce),t.postBody=Vji(i)} - return t} - } - ; - Qt(LXi,"OAuthCredential"); - let DXi=LXi; - async function GXi(t,i){ - return TYi(t,"POST","/v1/accounts:sendVerificationCode",SYi(t,i))} - async function BXi(t,i){ - return OYi(t,"POST","/v1/accounts:signInWithPhoneNumber",SYi(t,i))} - async function UXi(t,i){ - const s=await OYi(t,"POST","/v1/accounts:signInWithPhoneNumber",SYi(t,i)); - if(s.temporaryProof)throw PYi(t,"account-exists-with-different-credential",s); - return s} - Qt(GXi,"sendPhoneVerificationCode"),Qt(BXi,"signInWithPhoneNumber$1"),Qt(UXi,"linkWithPhoneNumber$1"); - const FXi={ - USER_NOT_FOUND:"user-not-found"} - ; - async function $Xi(t,i){ - return OYi(t,"POST","/v1/accounts:signInWithPhoneNumber",SYi(t,{ - ...i,operation:"REAUTH"} - ),FXi)} - Qt($Xi,"verifyPhoneNumberForExisting"); - const HXi=class t extends _Xi{ - constructor(t){ - super("phone","phone"),this.params=t} - static _fromVerification(i,s){ - return new t({ - verificationId:i,verificationCode:s} - )} - static _fromTokenResponse(i,s){ - return new t({ - phoneNumber:i,temporaryProof:s} - )} - _getIdTokenResponse(t){ - return BXi(t,this._makeVerificationRequest())} - _linkToIdToken(t,i){ - return UXi(t,{ - idToken:i,...this._makeVerificationRequest()} - )} - _getReauthenticationResolver(t){ - return $Xi(t,this._makeVerificationRequest())} - _makeVerificationRequest(){ - const{ - temporaryProof:t,phoneNumber:i,verificationId:s,verificationCode:e} - =this.params; - return t&&i?{ - temporaryProof:t,phoneNumber:i} - :{ - sessionInfo:s,code:e} - } - toJSON(){ - const t={ - providerId:this.providerId} - ; - return this.params.phoneNumber&&(t.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(t.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(t.verificationCode=this.params.verificationCode),this.params.verificationId&&(t.verificationId=this.params.verificationId),t} - static fromJSON(i){ - "string"==typeof i&&(i=JSON.parse(i)); - const{ - verificationId:s,verificationCode:e,phoneNumber:n,temporaryProof:h} - =i; - return e||s||n||h?new t({ - verificationId:s,verificationCode:e,phoneNumber:n,temporaryProof:h} - ):null} - } - ; - Qt(HXi,"PhoneAuthCredential"); - let WXi=HXi; - function VXi(t){ - switch(t){ - case"recoverEmail":return"RECOVER_EMAIL"; - case"resetPassword":return"PASSWORD_RESET"; - case"signIn":return"EMAIL_SIGNIN"; - case"verifyEmail":return"VERIFY_EMAIL"; - case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL"; - case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION"; - default:return null} - } - function jXi(t){ - const i=jji(Kji(t)).link,s=i?jji(Kji(i)).deep_link_id:null,e=jji(Kji(t)).deep_link_id; - return(e?jji(Kji(e)).link:null)||e||s||i||t} - Qt(VXi,"parseMode"),Qt(jXi,"parseDeepLink"); - const KXi=class t{ - constructor(t){ - const i=jji(Kji(t)),s=i.apiKey??null,e=i.oobCode??null,n=VXi(i.mode??null); - cYi(s&&e&&n,"argument-error"),this.apiKey=s,this.operation=n,this.code=e,this.continueUrl=i.continueUrl??null,this.languageCode=i.lang??null,this.tenantId=i.tenantId??null} - static parseLink(i){ - const s=jXi(i); - try{ - return new t(s)} - catch{ - return null} - } - } - ; - Qt(KXi,"ActionCodeURL"); - let zXi=KXi; - const YXi=class t{ - constructor(){ - this.providerId=t.PROVIDER_ID} - static credential(t,i){ - return PXi._fromEmailAndPassword(t,i)} - static credentialWithLink(t,i){ - const s=zXi.parseLink(i); - return cYi(s,"argument-error"),PXi._fromEmailAndCode(t,s.code,s.tenantId)} - } - ; - Qt(YXi,"EmailAuthProvider"); - let qXi=YXi; - qXi.PROVIDER_ID="password",qXi.EMAIL_PASSWORD_SIGN_IN_METHOD="password",qXi.EMAIL_LINK_SIGN_IN_METHOD="emailLink"; - const XXi=class{ - constructor(t){ - this.providerId=t,this.defaultLanguageCode=null,this.customParameters={ - } - } - setDefaultLanguage(t){ - this.defaultLanguageCode=t} - setCustomParameters(t){ - return this.customParameters=t,this} - getCustomParameters(){ - return this.customParameters} - } - ; - Qt(XXi,"FederatedAuthProvider"); - let JXi=XXi; - const QXi=class extends JXi{ - constructor(){ - super(...arguments),this.scopes=[]} - addScope(t){ - return this.scopes.includes(t)||this.scopes.push(t),this} - getScopes(){ - return[...this.scopes]} - } - ; - Qt(QXi,"BaseOAuthProvider"); - let ZXi=QXi; - const tJi=class t extends ZXi{ - static credentialFromJSON(t){ - const i="string"==typeof t?JSON.parse(t):t; - return cYi("providerId"in i&&"signInMethod"in i,"argument-error"),DXi._fromParams(i)} - credential(t){ - return this._credential({ - ...t,nonce:t.rawNonce} - )} - _credential(t){ - return cYi(t.idToken||t.accessToken,"argument-error"),DXi._fromParams({ - ...t,providerId:this.providerId,signInMethod:this.providerId} - )} - static credentialFromResult(i){ - return t.oauthCredentialFromTaggedObject(i)} - static credentialFromError(i){ - return t.oauthCredentialFromTaggedObject(i.customData||{ - } - )} - static oauthCredentialFromTaggedObject({ - _tokenResponse:i} - ){ - if(!i)return null; - const{ - oauthIdToken:s,oauthAccessToken:e,oauthTokenSecret:n,pendingToken:h,nonce:r,providerId:o} - =i; - if(!(e||n||s||h))return null; - if(!o)return null; - try{ - return new t(o)._credential({ - idToken:s,accessToken:e,nonce:r,pendingToken:h} - )} - catch(frt){ - return null} - } - } - ; - Qt(tJi,"OAuthProvider"); - let iJi=tJi; - const sJi=class t extends ZXi{ - constructor(){ - super("facebook.com")} - static credential(i){ - return DXi._fromParams({ - providerId:t.PROVIDER_ID,signInMethod:t.FACEBOOK_SIGN_IN_METHOD,accessToken:i} - )} - static credentialFromResult(i){ - return t.credentialFromTaggedObject(i)} - static credentialFromError(i){ - return t.credentialFromTaggedObject(i.customData||{ - } - )} - static credentialFromTaggedObject({ - _tokenResponse:i} - ){ - if(!i||!("oauthAccessToken"in i))return null; - if(!i.oauthAccessToken)return null; - try{ - return t.credential(i.oauthAccessToken)} - catch{ - return null} - } - } - ; - Qt(sJi,"FacebookAuthProvider"); - let eJi=sJi; - eJi.FACEBOOK_SIGN_IN_METHOD="facebook.com",eJi.PROVIDER_ID="facebook.com"; - const nJi=class t extends ZXi{ - constructor(){ - super("google.com"),this.addScope("profile")} - static credential(i,s){ - return DXi._fromParams({ - providerId:t.PROVIDER_ID,signInMethod:t.GOOGLE_SIGN_IN_METHOD,idToken:i,accessToken:s} - )} - static credentialFromResult(i){ - return t.credentialFromTaggedObject(i)} - static credentialFromError(i){ - return t.credentialFromTaggedObject(i.customData||{ - } - )} - static credentialFromTaggedObject({ - _tokenResponse:i} - ){ - if(!i)return null; - const{ - oauthIdToken:s,oauthAccessToken:e} - =i; - if(!s&&!e)return null; - try{ - return t.credential(s,e)} - catch{ - return null} - } - } - ; - Qt(nJi,"GoogleAuthProvider"); - let hJi=nJi; - hJi.GOOGLE_SIGN_IN_METHOD="google.com",hJi.PROVIDER_ID="google.com"; - const rJi=class t extends ZXi{ - constructor(){ - super("github.com")} - static credential(i){ - return DXi._fromParams({ - providerId:t.PROVIDER_ID,signInMethod:t.GITHUB_SIGN_IN_METHOD,accessToken:i} - )} - static credentialFromResult(i){ - return t.credentialFromTaggedObject(i)} - static credentialFromError(i){ - return t.credentialFromTaggedObject(i.customData||{ - } - )} - static credentialFromTaggedObject({ - _tokenResponse:i} - ){ - if(!i||!("oauthAccessToken"in i))return null; - if(!i.oauthAccessToken)return null; - try{ - return t.credential(i.oauthAccessToken)} - catch{ - return null} - } - } - ; - Qt(rJi,"GithubAuthProvider"); - let oJi=rJi; - oJi.GITHUB_SIGN_IN_METHOD="github.com",oJi.PROVIDER_ID="github.com"; - const aJi=class t extends ZXi{ - constructor(){ - super("twitter.com")} - static credential(i,s){ - return DXi._fromParams({ - providerId:t.PROVIDER_ID,signInMethod:t.TWITTER_SIGN_IN_METHOD,oauthToken:i,oauthTokenSecret:s} - )} - static credentialFromResult(i){ - return t.credentialFromTaggedObject(i)} - static credentialFromError(i){ - return t.credentialFromTaggedObject(i.customData||{ - } - )} - static credentialFromTaggedObject({ - _tokenResponse:i} - ){ - if(!i)return null; - const{ - oauthAccessToken:s,oauthTokenSecret:e} - =i; - if(!s||!e)return null; - try{ - return t.credential(s,e)} - catch{ - return null} - } - } - ; - Qt(aJi,"TwitterAuthProvider"); - let cJi=aJi; - async function lJi(t,i){ - return OYi(t,"POST","/v1/accounts:signUp",SYi(t,i))} - cJi.TWITTER_SIGN_IN_METHOD="twitter.com",cJi.PROVIDER_ID="twitter.com",Qt(lJi,"signUp"); - const uJi=class t{ - constructor(t){ - this.user=t.user,this.providerId=t.providerId,this._tokenResponse=t._tokenResponse,this.operationType=t.operationType} - static async _fromIdTokenResponse(i,s,e,n=!1){ - const h=await lqi._fromIdTokenResponse(i,e,n),r=fJi(e); - return new t({ - user:h,providerId:r,_tokenResponse:e,operationType:s} - )} - static async _forOperation(i,s,e){ - await i._updateTokensIfNecessary(e,!0); - const n=fJi(e); - return new t({ - user:i,providerId:n,_tokenResponse:e,operationType:s} - )} - } - ; - Qt(uJi,"UserCredentialImpl"); - let dJi=uJi; - function fJi(t){ - return t.providerId?t.providerId:"phoneNumber"in t?"phone":null} - async function pJi(t){ - var i; - if(Ozi(t.app))return Promise.reject(rYi(t)); - const s=Uqi(t); - if(await s._initializationPromise,null==(i=s.currentUser)?void 0:i.isAnonymous)return new dJi({ - user:s.currentUser,providerId:null,operationType:"signIn"} - ); - const e=await lJi(s,{ - returnSecureToken:!0} - ),n=await dJi._fromIdTokenResponse(s,"signIn",e,!0); - return await s._updateCurrentUser(n.user),n} - Qt(fJi,"providerIdForResponse"),Qt(pJi,"signInAnonymously"); - const wJi=class t extends Dji{ - constructor(i,s,e,n){ - super(s.code,s.message),this.operationType=e,this.user=n,Object.setPrototypeOf(this,t.prototype),this.customData={ - appName:i.name,tenantId:i.tenantId??void 0,_serverResponse:s.customData._serverResponse,operationType:e} - } - static _fromErrorAndOperation(i,s,e,n){ - return new t(i,s,e,n)} - } - ; - Qt(wJi,"MultiFactorError"); - let gJi=wJi; - function mJi(t,i,s,e){ - return("reauthenticate"===i?s._getReauthenticationResolver(t):s._getIdTokenResponse(t)).catch(s=>{ - if("auth/multi-factor-auth-required"===s.code)throw gJi._fromErrorAndOperation(t,s,i,e); - throw s} - )} - function vJi(t){ - return new Set(t.map(({ - providerId:t} - )=>t).filter(t=>!!t))} - async function _Ji(t,i){ - const s=Qji(t); - await bJi(!0,s,i); - const{ - providerUserInfo:e} - =await $Yi(s.auth,{ - idToken:await s.getIdToken(),deleteProvider:[i]} - ),n=vJi(e||[]); - return s.providerData=s.providerData.filter(t=>n.has(t.providerId)),n.has("phone")||(s.phoneNumber=null),await s.auth._persistUserIfCurrent(s),s} - async function MJi(t,i,s=!1){ - const e=await YYi(t,i._linkToIdToken(t.auth,await t.getIdToken()),s); - return dJi._forOperation(t,"link",e)} - async function bJi(t,i,s){ - await tqi(i); - const e=!1===t?"provider-already-linked":"no-such-provider"; - cYi(vJi(i.providerData).has(s)===t,i.auth,e)} - async function yJi(t,i,s=!1){ - const{ - auth:e} - =t; - if(Ozi(e.app))return Promise.reject(rYi(e)); - const n="reauthenticate"; - try{ - const h=await YYi(t,mJi(e,n,i,t),s); - cYi(h.idToken,e,"internal-error"); - const r=KYi(h.idToken); - cYi(r,e,"internal-error"); - const{ - sub:o} - =r; - return cYi(t.uid===o,e,"user-mismatch"),dJi._forOperation(t,n,h)} - catch(frt){ - throw"auth/user-not-found"===(null==frt?void 0:frt.code)&&eYi(e,"user-mismatch"),frt} - } - async function EJi(t,i,s=!1){ - if(Ozi(t.app))return Promise.reject(rYi(t)); - const e="signIn",n=await mJi(t,e,i),h=await dJi._fromIdTokenResponse(t,e,n); - return s||await t._updateCurrentUser(h.user),h} - async function AJi(t,i){ - return EJi(Uqi(t),i)} - async function SJi(t,i){ - const s=Qji(t); - return await bJi(!1,s,i.providerId),MJi(s,i)} - async function TJi(t,i){ - return OYi(t,"POST","/v1/accounts:signInWithCustomToken",SYi(t,i))} - async function CJi(t,i){ - if(Ozi(t.app))return Promise.reject(rYi(t)); - const s=Uqi(t),e=await TJi(s,{ - token:i,returnSecureToken:!0} - ),n=await dJi._fromIdTokenResponse(s,"signIn",e); - return await s._updateCurrentUser(n.user),n} - function OJi(t,i,s){ - var e; - cYi((null==(e=s.url)?void 0:e.length)>0,t,"invalid-continue-uri"),cYi(void 0===s.dynamicLinkDomain||s.dynamicLinkDomain.length>0,t,"invalid-dynamic-link-domain"),cYi(void 0===s.linkDomain||s.linkDomain.length>0,t,"invalid-hosting-link-domain"),i.continueUrl=s.url,i.dynamicLinkDomain=s.dynamicLinkDomain,i.linkDomain=s.linkDomain,i.canHandleCodeInApp=s.handleCodeInApp,s.iOS&&(cYi(s.iOS.bundleId.length>0,t,"missing-ios-bundle-id"),i.iOSBundleId=s.iOS.bundleId),s.android&&(cYi(s.android.packageName.length>0,t,"missing-android-pkg-name"),i.androidInstallApp=s.android.installApp,i.androidMinimumVersionCode=s.android.minimumVersion,i.androidPackageName=s.android.packageName)} - async function IJi(t){ - const i=Uqi(t); - i._getPasswordPolicyInternal()&&await i._updatePasswordPolicy()} - async function kJi(t,i,s){ - const e=Uqi(t),n={ - requestType:"PASSWORD_RESET",email:i,clientType:"CLIENT_TYPE_WEB"} - ; - s&&OJi(e,n,s),await cXi(e,n,"getOobCode",CXi,"EMAIL_PASSWORD_PROVIDER")} - async function xJi(t,i,s){ - await MXi(Qji(t),{ - oobCode:i,newPassword:s} - ).catch(async i=>{ - throw"auth/password-does-not-meet-requirements"===i.code&&IJi(t),i} - )} - async function RJi(t,i){ - await EXi(Qji(t),{ - oobCode:i} - )} - async function PJi(t,i,s){ - if(Ozi(t.app))return Promise.reject(rYi(t)); - const e=Uqi(t),n=cXi(e,{ - returnSecureToken:!0,email:i,password:s,clientType:"CLIENT_TYPE_WEB"} - ,"signUpPassword",lJi,"EMAIL_PASSWORD_PROVIDER"),h=await n.catch(i=>{ - throw"auth/password-does-not-meet-requirements"===i.code&&IJi(t),i} - ),r=await dJi._fromIdTokenResponse(e,"signIn",h); - return await e._updateCurrentUser(r.user),r} - function NJi(t,i,s){ - return Ozi(t.app)?Promise.reject(rYi(t)):AJi(Qji(t),qXi.credential(i,s)).catch(async i=>{ - throw"auth/password-does-not-meet-requirements"===i.code&&IJi(t),i} - )} - async function LJi(t,i,s){ - const e=Uqi(t),n={ - requestType:"EMAIL_SIGNIN",email:i,clientType:"CLIENT_TYPE_WEB"} - ; - function h(t,i){ - cYi(i.handleCodeInApp,e,"argument-error"),i&&OJi(e,t,i)} - Qt(h,"setActionCodeSettings"),h(n,s),await cXi(e,n,"getOobCode",OXi,"EMAIL_PASSWORD_PROVIDER")} - function DJi(t,i){ - const s=zXi.parseLink(i); - return"EMAIL_SIGNIN"===(null==s?void 0:s.operation)} - async function GJi(t,i,s){ - if(Ozi(t.app))return Promise.reject(rYi(t)); - const e=Qji(t),n=qXi.credentialWithLink(i,s||dYi()); - return cYi(n._tenantId===(e.tenantId||null),e,"tenant-id-mismatch"),AJi(e,n)} - async function BJi(t,i){ - return TYi(t,"POST","/v1/accounts:createAuthUri",SYi(t,i))} - async function UJi(t,i){ - const s={ - identifier:i,continueUri:fYi()?dYi():"http://localhost"} - ,{ - signinMethods:e} - =await BJi(Qji(t),s); - return e||[]} - async function FJi(t,i){ - const s=Qji(t),e={ - requestType:"VERIFY_EMAIL",idToken:await t.getIdToken()} - ; - i&&OJi(s.auth,e,i); - const{ - email:n} - =await TXi(s.auth,e); - n!==t.email&&await t.reload()} - async function $Ji(t,i,s){ - const e=Qji(t),n={ - requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:await t.getIdToken(),newEmail:i} - ; - s&&OJi(e.auth,n,s); - const{ - email:h} - =await IXi(e.auth,n); - h!==t.email&&await t.reload()} - async function HJi(t,i){ - return TYi(t,"POST","/v1/accounts:update",i)} - async function WJi(t,{ - displayName:i,photoURL:s} - ){ - if(void 0===i&&void 0===s)return; - const e=Qji(t),n={ - idToken:await e.getIdToken(),displayName:i,photoUrl:s,returnSecureToken:!0} - ,h=await YYi(e,HJi(e.auth,n)); - e.displayName=h.displayName||null,e.photoURL=h.photoUrl||null; - const r=e.providerData.find(({ - providerId:t} - )=>"password"===t); - r&&(r.displayName=e.displayName,r.photoURL=e.photoURL),await e._updateTokensIfNecessary(h)} - function VJi(t,i){ - const s=Qji(t); - return Ozi(s.auth.app)?Promise.reject(rYi(s.auth)):KJi(s,i,null)} - function jJi(t,i){ - return KJi(Qji(t),null,i)} - async function KJi(t,i,s){ - const{ - auth:e} - =t,n={ - idToken:await t.getIdToken(),returnSecureToken:!0} - ; - i&&(n.email=i),s&&(n.password=s); - const h=await YYi(t,bXi(e,n)); - await t._updateTokensIfNecessary(h,!0)} - function zJi(t){ - var i,s; - if(!t)return null; - const{ - providerId:e} - =t,n=t.rawUserInfo?JSON.parse(t.rawUserInfo):{ - } - ,h=t.isNewUser||"identitytoolkit#SignupNewUserResponse"===t.kind; - if(!e&&(null==t?void 0:t.idToken)){ - const e=null==(s=null==(i=KYi(t.idToken))?void 0:i.firebase)?void 0:s.sign_in_provider; - if(e)return new qJi(h,"anonymous"!==e&&"custom"!==e?e:null)} - if(!e)return null; - switch(e){ - case"facebook.com":return new ZJi(h,n); - case"github.com":return new iQi(h,n); - case"google.com":return new eQi(h,n); - case"twitter.com":return new hQi(h,n,t.screenName||null); - case"custom":case"anonymous":return new qJi(h,null); - default:return new qJi(h,e,n)} - } - Qt(mJi,"_processCredentialSavingMfaContextIfNecessary"),Qt(vJi,"providerDataAsNames"),Qt(_Ji,"unlink"),Qt(MJi,"_link$1"),Qt(bJi,"_assertLinkedStatus"),Qt(yJi,"_reauthenticate"),Qt(EJi,"_signInWithCredential"),Qt(AJi,"signInWithCredential"),Qt(SJi,"linkWithCredential"),Qt(TJi,"signInWithCustomToken$1"),Qt(CJi,"signInWithCustomToken"),Qt(OJi,"_setActionCodeSettingsOnRequest"),Qt(IJi,"recachePasswordPolicy"),Qt(kJi,"sendPasswordResetEmail"),Qt(xJi,"confirmPasswordReset"),Qt(RJi,"applyActionCode"),Qt(PJi,"createUserWithEmailAndPassword"),Qt(NJi,"signInWithEmailAndPassword"),Qt(LJi,"sendSignInLinkToEmail"),Qt(DJi,"isSignInWithEmailLink"),Qt(GJi,"signInWithEmailLink"),Qt(BJi,"createAuthUri"),Qt(UJi,"fetchSignInMethodsForEmail"),Qt(FJi,"sendEmailVerification"),Qt($Ji,"verifyBeforeUpdateEmail"),Qt(HJi,"updateProfile$1"),Qt(WJi,"updateProfile"),Qt(VJi,"updateEmail"),Qt(jJi,"updatePassword"),Qt(KJi,"updateEmailOrPassword"),Qt(zJi,"_fromIdTokenResponse"); - const YJi=class{ - constructor(t,i,s={ - } - ){ - this.isNewUser=t,this.providerId=i,this.profile=s} - } - ; - Qt(YJi,"GenericAdditionalUserInfo"); - let qJi=YJi; - const XJi=class extends qJi{ - constructor(t,i,s,e){ - super(t,i,s),this.username=e} - } - ; - Qt(XJi,"FederatedAdditionalUserInfoWithUsername"); - let JJi=XJi; - const QJi=class extends qJi{ - constructor(t,i){ - super(t,"facebook.com",i)} - } - ; - Qt(QJi,"FacebookAdditionalUserInfo"); - let ZJi=QJi; - const tQi=class extends JJi{ - constructor(t,i){ - super(t,"github.com",i,"string"==typeof(null==i?void 0:i.login)?null==i?void 0:i.login:null)} - } - ; - Qt(tQi,"GithubAdditionalUserInfo"); - let iQi=tQi; - const sQi=class extends qJi{ - constructor(t,i){ - super(t,"google.com",i)} - } - ; - Qt(sQi,"GoogleAdditionalUserInfo"); - let eQi=sQi; - const nQi=class extends JJi{ - constructor(t,i,s){ - super(t,"twitter.com",i,s)} - } - ; - Qt(nQi,"TwitterAdditionalUserInfo"); - let hQi=nQi; - function rQi(t){ - const{ - user:i,_tokenResponse:s} - =t; - return i.isAnonymous&&!s?{ - providerId:null,isNewUser:!1,profile:null} - :zJi(s)} - function oQi(t,i){ - return Qji(t).setPersistence(i)} - function aQi(t,i,s,e){ - return Qji(t).onIdTokenChanged(i,s,e)} - function cQi(t,i,s){ - return Qji(t).beforeAuthStateChanged(i,s)} - function lQi(t,i){ - return Uqi(t).revokeAccessToken(i)} - async function uQi(t){ - return Qji(t).delete()} - function dQi(t,i){ - return TYi(t,"POST","/v2/accounts/mfaEnrollment:start",SYi(t,i))} - Qt(rQi,"getAdditionalUserInfo"),Qt(oQi,"setPersistence"),Qt(aQi,"onIdTokenChanged"),Qt(cQi,"beforeAuthStateChanged"),Qt(lQi,"revokeAccessToken"),Qt(uQi,"deleteUser"),Qt(dQi,"startEnrollPhoneMfa"); - const fQi="__sak",pQi=class{ - constructor(t,i){ - this.storageRetriever=t,this.type=i} - _isAvailable(){ - try{ - return this.storage?(this.storage.setItem(fQi,"1"),this.storage.removeItem(fQi),Promise.resolve(!0)):Promise.resolve(!1)} - catch{ - return Promise.resolve(!1)} - } - _set(t,i){ - return this.storage.setItem(t,JSON.stringify(i)),Promise.resolve()} - _get(t){ - const i=this.storage.getItem(t); - return Promise.resolve(i?JSON.parse(i):null)} - _remove(t){ - return this.storage.removeItem(t),Promise.resolve()} - get storage(){ - return this.storageRetriever()} - } - ; - Qt(pQi,"BrowserPersistenceClass"); - let wQi=pQi; - const gQi=class extends wQi{ - constructor(){ - super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,i)=>this.onStorageEvent(t,i),this.listeners={ - } - ,this.localCache={ - } - ,this.pollTimer=null,this.fallbackToPolling=kqi(),this._shouldAllowMigration=!0} - forAllChangedKeys(t){ - for(const i of Object.keys(this.listeners)){ - const s=this.storage.getItem(i),e=this.localCache[i]; - s!==e&&t(i,e,s)} - } - onStorageEvent(t,i=!1){ - if(!t.key)return void this.forAllChangedKeys((t,i,s)=>{ - this.notifyListeners(t,s)} - ); - const s=t.key; - i?this.detachListener():this.stopPolling(); - const e=Qt(()=>{ - const t=this.storage.getItem(s); - (i||this.localCache[s]!==t)&&this.notifyListeners(s,t)} - ,"triggerListeners"),n=this.storage.getItem(s); - Iqi()&&n!==t.newValue&&t.newValue!==t.oldValue?setTimeout(e,10):e()} - notifyListeners(t,i){ - this.localCache[t]=i; - const s=this.listeners[t]; - if(s)for(const e of Array.from(s))e(i?JSON.parse(i):i)} - startPolling(){ - this.stopPolling(),this.pollTimer=setInterval(()=>{ - this.forAllChangedKeys((t,i,s)=>{ - this.onStorageEvent(new StorageEvent("storage",{ - key:t,oldValue:i,newValue:s} - ),!0)} - )} - ,1e3)} - stopPolling(){ - this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)} - attachListener(){ - window.addEventListener("storage",this.boundEventHandler)} - detachListener(){ - window.removeEventListener("storage",this.boundEventHandler)} - _addListener(t,i){ - 0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(i)} - _removeListener(t,i){ - this.listeners[t]&&(this.listeners[t].delete(i),0===this.listeners[t].size&&delete this.listeners[t]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())} - async _set(t,i){ - await super._set(t,i),this.localCache[t]=JSON.stringify(i)} - async _get(t){ - const i=await super._get(t); - return this.localCache[t]=JSON.stringify(i),i} - async _remove(t){ - await super._remove(t),delete this.localCache[t]} - } - ; - Qt(gQi,"BrowserLocalPersistence"); - let mQi=gQi; - mQi.type="LOCAL"; - const vQi=mQi,_Qi=class extends wQi{ - constructor(){ - super(()=>window.sessionStorage,"SESSION")} - _addListener(t,i){ - } - _removeListener(t,i){ - } - } - ; - Qt(_Qi,"BrowserSessionPersistence"); - let MQi=_Qi; - MQi.type="SESSION"; - const bQi=MQi; - function yQi(t){ - return Promise.all(t.map(async t=>{ - try{ - return{ - fulfilled:!0,value:await t} - } - catch(i){ - return{ - fulfilled:!1,reason:i} - } - } - ))} - Qt(yQi,"_allSettled"); - const EQi=class t{ - constructor(t){ - this.eventTarget=t,this.handlersMap={ - } - ,this.boundEventHandler=this.handleEvent.bind(this)} - static _getInstance(i){ - const s=this.receivers.find(t=>t.isListeningto(i)); - if(s)return s; - const e=new t(i); - return this.receivers.push(e),e} - isListeningto(t){ - return this.eventTarget===t} - async handleEvent(t){ - const i=t,{ - eventId:s,eventType:e,data:n} - =i.data,h=this.handlersMap[e]; - if(!(null==h?void 0:h.size))return; - i.ports[0].postMessage({ - status:"ack",eventId:s,eventType:e} - ); - const r=Array.from(h).map(async t=>t(i.origin,n)),o=await yQi(r); - i.ports[0].postMessage({ - status:"done",eventId:s,eventType:e,response:o} - )} - _subscribe(t,i){ - 0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(i)} - _unsubscribe(t,i){ - this.handlersMap[t]&&i&&this.handlersMap[t].delete(i),i&&0!==this.handlersMap[t].size||delete this.handlersMap[t],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)} - } - ; - Qt(EQi,"Receiver"); - let AQi=EQi; - function SQi(t="",i=10){ - let s=""; - for(let e=0; - e<i; - e++)s+=Math.floor(10*Math.random()); - return t+s} - AQi.receivers=[],Qt(SQi,"_generateEventId"); - const TQi=class{ - constructor(t){ - this.target=t,this.handlers=new Set} - removeMessageHandler(t){ - t.messageChannel&&(t.messageChannel.port1.removeEventListener("message",t.onMessage),t.messageChannel.port1.close()),this.handlers.delete(t)} - async _send(t,i,s=50){ - const e="undefined"!=typeof MessageChannel?new MessageChannel:null; - if(!e)throw new Error("connection_unavailable"); - let n,h; - return new Promise((r,o)=>{ - const a=SQi("",20); - e.port1.start(); - const c=setTimeout(()=>{ - o(new Error("unsupported_event"))} - ,s); - h={ - messageChannel:e,onMessage(t){ - const i=t; - if(i.data.eventId===a)switch(i.data.status){ - case"ack":clearTimeout(c),n=setTimeout(()=>{ - o(new Error("timeout"))} - ,3e3); - break; - case"done":clearTimeout(n),r(i.data.response); - break; - default:clearTimeout(c),clearTimeout(n),o(new Error("invalid_response"))} - } - } - ,this.handlers.add(h),e.port1.addEventListener("message",h.onMessage),this.target.postMessage({ - eventType:t,eventId:a,data:i} - ,[e.port2])} - ).finally(()=>{ - h&&this.removeMessageHandler(h)} - )} - } - ; - Qt(TQi,"Sender"); - let CQi=TQi; - function OQi(){ - return window} - function IQi(t){ - OQi().location.href=t} - function kQi(){ - return void 0!==OQi().WorkerGlobalScope&&"function"==typeof OQi().importScripts} - async function xQi(){ - if(!(null==navigator?void 0:navigator.serviceWorker))return null; - try{ - return(await navigator.serviceWorker.ready).active} - catch{ - return null} - } - function RQi(){ - var t; - return(null==(t=null==navigator?void 0:navigator.serviceWorker)?void 0:t.controller)||null} - function PQi(){ - return kQi()?self:null} - Qt(OQi,"_window"),Qt(IQi,"_setWindowLocation"),Qt(kQi,"_isWorker"),Qt(xQi,"_getActiveServiceWorker"),Qt(RQi,"_getServiceWorkerController"),Qt(PQi,"_getWorkerGlobalScope"); - const NQi="firebaseLocalStorageDb",LQi="firebaseLocalStorage",DQi="fbase_key",GQi=class{ - constructor(t){ - this.request=t} - toPromise(){ - return new Promise((t,i)=>{ - this.request.addEventListener("success",()=>{ - t(this.request.result)} - ),this.request.addEventListener("error",()=>{ - i(this.request.error)} - )} - )} - } - ; - Qt(GQi,"DBPromise"); - let BQi=GQi; - function UQi(t,i){ - return t.transaction([LQi],i?"readwrite":"readonly").objectStore(LQi)} - function FQi(){ - const t=indexedDB.deleteDatabase(NQi); - return new BQi(t).toPromise()} - function $Qi(){ - const t=indexedDB.open(NQi,1); - return new Promise((i,s)=>{ - t.addEventListener("error",()=>{ - s(t.error)} - ),t.addEventListener("upgradeneeded",()=>{ - const i=t.result; - try{ - i.createObjectStore(LQi,{ - keyPath:DQi} - )} - catch(frt){ - s(frt)} - } - ),t.addEventListener("success",async()=>{ - const s=t.result; - s.objectStoreNames.contains(LQi)?i(s):(s.close(),await FQi(),i(await $Qi()))} - )} - )} - async function HQi(t,i,s){ - const e=UQi(t,!0).put({ - [DQi]:i,value:s} - ); - return new BQi(e).toPromise()} - async function WQi(t,i){ - const s=UQi(t,!1).get(i),e=await new BQi(s).toPromise(); - return void 0===e?null:e.value} - function VQi(t,i){ - const s=UQi(t,!0).delete(i); - return new BQi(s).toPromise()} - Qt(UQi,"getObjectStore"),Qt(FQi,"_deleteDatabase"),Qt($Qi,"_openDatabase"),Qt(HQi,"_putObject"),Qt(WQi,"getObject"),Qt(VQi,"_deleteObject"); - const jQi=class{ - constructor(){ - this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={ - } - ,this.localCache={ - } - ,this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{ - } - ,()=>{ - } - )} - async _openDb(){ - return this.db||(this.db=await $Qi()),this.db} - async _withRetries(t){ - let i=0; - for(; - ; - )try{ - const i=await this._openDb(); - return await t(i)} - catch(frt){ - if(i++>3)throw frt; - this.db&&(this.db.close(),this.db=void 0)} - } - async initializeServiceWorkerMessaging(){ - return kQi()?this.initializeReceiver():this.initializeSender()} - async initializeReceiver(){ - this.receiver=AQi._getInstance(PQi()),this.receiver._subscribe("keyChanged",async(t,i)=>({ - keyProcessed:(await this._poll()).includes(i.key)} - )),this.receiver._subscribe("ping",async(t,i)=>["keyChanged"])} - async initializeSender(){ - var t,i; - if(this.activeServiceWorker=await xQi(),!this.activeServiceWorker)return; - this.sender=new CQi(this.activeServiceWorker); - const s=await this.sender._send("ping",{ - } - ,800); - s&&(null==(t=s[0])?void 0:t.fulfilled)&&(null==(i=s[0])?void 0:i.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0)} - async notifyServiceWorker(t){ - if(this.sender&&this.activeServiceWorker&&RQi()===this.activeServiceWorker)try{ - await this.sender._send("keyChanged",{ - key:t} - ,this.serviceWorkerReceiverAvailable?800:50)} - catch{ - } - } - async _isAvailable(){ - try{ - if(!indexedDB)return!1; - const t=await $Qi(); - return await HQi(t,fQi,"1"),await VQi(t,fQi),!0} - catch{ - } - return!1} - async _withPendingWrite(t){ - this.pendingWrites++; - try{ - await t()} - finally{ - this.pendingWrites--} - } - async _set(t,i){ - return this._withPendingWrite(async()=>(await this._withRetries(s=>HQi(s,t,i)),this.localCache[t]=i,this.notifyServiceWorker(t)))} - async _get(t){ - const i=await this._withRetries(i=>WQi(i,t)); - return this.localCache[t]=i,i} - async _remove(t){ - return this._withPendingWrite(async()=>(await this._withRetries(i=>VQi(i,t)),delete this.localCache[t],this.notifyServiceWorker(t)))} - async _poll(){ - const t=await this._withRetries(t=>{ - const i=UQi(t,!1).getAll(); - return new BQi(i).toPromise()} - ); - if(!t)return[]; - if(0!==this.pendingWrites)return[]; - const i=[],s=new Set; - if(0!==t.length)for(const{ - fbase_key:e,value:n} - of t)s.add(e),JSON.stringify(this.localCache[e])!==JSON.stringify(n)&&(this.notifyListeners(e,n),i.push(e)); - for(const e of Object.keys(this.localCache))this.localCache[e]&&!s.has(e)&&(this.notifyListeners(e,null),i.push(e)); - return i} - notifyListeners(t,i){ - this.localCache[t]=i; - const s=this.listeners[t]; - if(s)for(const e of Array.from(s))e(i)} - startPolling(){ - this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),800)} - stopPolling(){ - this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)} - _addListener(t,i){ - 0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(i)} - _removeListener(t,i){ - this.listeners[t]&&(this.listeners[t].delete(i),0===this.listeners[t].size&&delete this.listeners[t]),0===Object.keys(this.listeners).length&&this.stopPolling()} - } - ; - Qt(jQi,"IndexedDBLocalPersistence"); - let KQi=jQi; - KQi.type="LOCAL"; - const zQi=KQi; - function YQi(t,i){ - return TYi(t,"POST","/v2/accounts/mfaSignIn:start",SYi(t,i))} - Qt(YQi,"startSignInPhoneMfa"); - const qQi=Yqi("rcb"),XQi=new vYi(3e4,6e4),JQi=class{ - constructor(){ - var t; - this.hostLanguage="",this.counter=0,this.librarySeparatelyLoaded=!!(null==(t=OQi().grecaptcha)?void 0:t.render)} - load(t,i=""){ - return cYi(ZQi(i),t,"argument-error"),this.shouldResolveImmediately(i)&&NYi(OQi().grecaptcha)?Promise.resolve(OQi().grecaptcha):new Promise((s,e)=>{ - const n=OQi().setTimeout(()=>{ - e(nYi(t,"network-request-failed"))} - ,XQi.get()); - OQi()[qQi]=()=>{ - OQi().clearTimeout(n),delete OQi()[qQi]; - const h=OQi().grecaptcha; - if(!h||!NYi(h))return void e(nYi(t,"internal-error")); - const r=h.render; - h.render=(t,i)=>{ - const s=r(t,i); - return this.counter++,s} - ,this.hostLanguage=i,s(h)} - ,Vqi(`${ - jqi()} - ?${ - Vji({ - onload:qQi,render:"explicit",hl:i} - )} - `).catch(()=>{ - clearTimeout(n),e(nYi(t,"internal-error"))} - )} - )} - clearedOneInstance(){ - this.counter--} - shouldResolveImmediately(t){ - var i; - return!!(null==(i=OQi().grecaptcha)?void 0:i.render)&&(t===this.hostLanguage||this.counter>0||this.librarySeparatelyLoaded)} - } - ; - Qt(JQi,"ReCaptchaLoaderImpl"); - let QQi=JQi; - function ZQi(t){ - return t.length<=6&&/^\s*[a-zA-Z0-9\-]*\s*$/.test(t)} - Qt(ZQi,"isHostLanguageValid"); - const tZi=class{ - async load(t){ - return new Jqi(t)} - clearedOneInstance(){ - } - } - ; - Qt(tZi,"MockReCaptchaLoaderImpl"); - let iZi=tZi; - const sZi="recaptcha",eZi={ - theme:"light",type:"image"} - ,nZi=class{ - constructor(t,i,s={ - ...eZi} - ){ - this.parameters=s,this.type=sZi,this.destroyed=!1,this.widgetId=null,this.tokenChangeListeners=new Set,this.renderPromise=null,this.recaptcha=null,this.auth=Uqi(t),this.isInvisible="invisible"===this.parameters.size,cYi("undefined"!=typeof document,this.auth,"operation-not-supported-in-this-environment"); - const e="string"==typeof i?document.getElementById(i):i; - cYi(e,this.auth,"argument-error"),this.container=e,this.parameters.callback=this.makeTokenCallback(this.parameters.callback),this._recaptchaLoader=this.auth.settings.appVerificationDisabledForTesting?new iZi:new QQi,this.validateStartingState()} - async verify(){ - this.assertNotDestroyed(); - const t=await this.render(),i=this.getAssertedRecaptcha(); - return i.getResponse(t)||new Promise(s=>{ - const e=Qt(t=>{ - t&&(this.tokenChangeListeners.delete(e),s(t))} - ,"tokenChange"); - this.tokenChangeListeners.add(e),this.isInvisible&&i.execute(t)} - )} - render(){ - try{ - this.assertNotDestroyed()} - catch(frt){ - return Promise.reject(frt)} - return this.renderPromise||(this.renderPromise=this.makeRenderPromise().catch(t=>{ - throw this.renderPromise=null,t} - )),this.renderPromise} - _reset(){ - this.assertNotDestroyed(),null!==this.widgetId&&this.getAssertedRecaptcha().reset(this.widgetId)} - clear(){ - this.assertNotDestroyed(),this.destroyed=!0,this._recaptchaLoader.clearedOneInstance(),this.isInvisible||this.container.childNodes.forEach(t=>{ - this.container.removeChild(t)} - )} - validateStartingState(){ - cYi(!this.parameters.sitekey,this.auth,"argument-error"),cYi(this.isInvisible||!this.container.hasChildNodes(),this.auth,"argument-error"),cYi("undefined"!=typeof document,this.auth,"operation-not-supported-in-this-environment")} - makeTokenCallback(t){ - return i=>{ - if(this.tokenChangeListeners.forEach(t=>t(i)),"function"==typeof t)t(i); - else if("string"==typeof t){ - const s=OQi()[t]; - "function"==typeof s&&s(i)} - } - } - assertNotDestroyed(){ - cYi(!this.destroyed,this.auth,"internal-error")} - async makeRenderPromise(){ - if(await this.init(),!this.widgetId){ - let t=this.container; - if(!this.isInvisible){ - const i=document.createElement("div"); - t.appendChild(i),t=i} - this.widgetId=this.getAssertedRecaptcha().render(t,this.parameters)} - return this.widgetId} - async init(){ - cYi(fYi()&&!kQi(),this.auth,"internal-error"),await rZi(),this.recaptcha=await this._recaptchaLoader.load(this.auth,this.auth.languageCode||void 0); - const t=await BYi(this.auth); - cYi(t,this.auth,"internal-error"),this.parameters.sitekey=t} - getAssertedRecaptcha(){ - return cYi(this.recaptcha,this.auth,"internal-error"),this.recaptcha} - } - ; - Qt(nZi,"RecaptchaVerifier"); - let hZi=nZi; - function rZi(){ - let t=null; - return new Promise(i=>{ - "complete"!==document.readyState?(t=Qt(()=>i(),"resolver"),window.addEventListener("load",t)):i()} - ).catch(i=>{ - throw t&&window.removeEventListener("load",t),i} - )} - Qt(rZi,"domReady"); - const oZi=class{ - constructor(t,i){ - this.verificationId=t,this.onConfirmation=i} - confirm(t){ - const i=WXi._fromVerification(this.verificationId,t); - return this.onConfirmation(i)} - } - ; - Qt(oZi,"ConfirmationResultImpl"); - let aZi=oZi; - async function cZi(t,i,s){ - if(Ozi(t.app))return Promise.reject(rYi(t)); - const e=Uqi(t),n=await uZi(e,i,Qji(s)); - return new aZi(n,t=>AJi(e,t))} - async function lZi(t,i,s){ - const e=Qji(t); - await bJi(!1,e,"phone"); - const n=await uZi(e.auth,i,Qji(s)); - return new aZi(n,t=>SJi(e,t))} - async function uZi(t,i,s){ - var e; - if(!t._getRecaptchaConfig())try{ - await lXi(t)} - catch(n){ - } - try{ - let n; - if(n="string"==typeof i?{ - phoneNumber:i} - :i,"session"in n){ - const i=n.session; - if("phoneNumber"in n){ - cYi("enroll"===i.type,t,"internal-error"); - const e=cXi(t,{ - idToken:i.credential,phoneEnrollmentInfo:{ - phoneNumber:n.phoneNumber,clientType:"CLIENT_TYPE_WEB"} - } - ,"mfaSmsEnrollment",Qt(async(t,i)=>i.phoneEnrollmentInfo.captchaResponse===hXi?(cYi((null==s?void 0:s.type)===sZi,t,"argument-error"),dQi(t,await dZi(t,i,s))):dQi(t,i),"startEnrollPhoneMfaActionCallback"),"PHONE_PROVIDER"); - return(await e.catch(t=>Promise.reject(t))).phoneSessionInfo.sessionInfo} - { - cYi("signin"===i.type,t,"internal-error"); - const h=(null==(e=n.multiFactorHint)?void 0:e.uid)||n.multiFactorUid; - cYi(h,t,"missing-multi-factor-info"); - const r=cXi(t,{ - mfaPendingCredential:i.credential,mfaEnrollmentId:h,phoneSignInInfo:{ - clientType:"CLIENT_TYPE_WEB"} - } - ,"mfaSmsSignIn",Qt(async(t,i)=>i.phoneSignInInfo.captchaResponse===hXi?(cYi((null==s?void 0:s.type)===sZi,t,"argument-error"),YQi(t,await dZi(t,i,s))):YQi(t,i),"startSignInPhoneMfaActionCallback"),"PHONE_PROVIDER"); - return(await r.catch(t=>Promise.reject(t))).phoneResponseInfo.sessionInfo} - } - { - const i=cXi(t,{ - phoneNumber:n.phoneNumber,clientType:"CLIENT_TYPE_WEB"} - ,"sendVerificationCode",Qt(async(t,i)=>i.captchaResponse===hXi?(cYi((null==s?void 0:s.type)===sZi,t,"argument-error"),GXi(t,await dZi(t,i,s))):GXi(t,i),"sendPhoneVerificationCodeActionCallback"),"PHONE_PROVIDER"); - return(await i.catch(t=>Promise.reject(t))).sessionInfo} - } - finally{ - null==s||s._reset()} - } - async function dZi(t,i,s){ - cYi(s.type===sZi,t,"argument-error"); - const e=await s.verify(); - cYi("string"==typeof e,t,"argument-error"); - const n={ - ...i} - ; - if("phoneEnrollmentInfo"in n){ - const t=n.phoneEnrollmentInfo.phoneNumber,i=n.phoneEnrollmentInfo.captchaResponse,s=n.phoneEnrollmentInfo.clientType,h=n.phoneEnrollmentInfo.recaptchaVersion; - return Object.assign(n,{ - phoneEnrollmentInfo:{ - phoneNumber:t,recaptchaToken:e,captchaResponse:i,clientType:s,recaptchaVersion:h} - } - ),n} - if("phoneSignInInfo"in n){ - const t=n.phoneSignInInfo.captchaResponse,i=n.phoneSignInInfo.clientType,s=n.phoneSignInInfo.recaptchaVersion; - return Object.assign(n,{ - phoneSignInInfo:{ - recaptchaToken:e,captchaResponse:t,clientType:i,recaptchaVersion:s} - } - ),n} - return Object.assign(n,{ - recaptchaToken:e} - ),n} - function fZi(t,i){ - return i?dqi(i):(cYi(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)} - Qt(cZi,"signInWithPhoneNumber"),Qt(lZi,"linkWithPhoneNumber"),Qt(uZi,"_verifyPhoneNumber"),Qt(dZi,"injectRecaptchaV2Token"),Qt(fZi,"_withDefaultResolver"); - const pZi=class extends _Xi{ - constructor(t){ - super("custom","custom"),this.params=t} - _getIdTokenResponse(t){ - return NXi(t,this._buildIdpRequest())} - _linkToIdToken(t,i){ - return NXi(t,this._buildIdpRequest(i))} - _getReauthenticationResolver(t){ - return NXi(t,this._buildIdpRequest())} - _buildIdpRequest(t){ - const i={ - requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0} - ; - return t&&(i.idToken=t),i} - } - ; - Qt(pZi,"IdpCredential"); - let wZi=pZi; - function gZi(t){ - return EJi(t.auth,new wZi(t),t.bypassAuthState)} - function mZi(t){ - const{ - auth:i,user:s} - =t; - return cYi(s,i,"internal-error"),yJi(s,new wZi(t),t.bypassAuthState)} - async function vZi(t){ - const{ - auth:i,user:s} - =t; - return cYi(s,i,"internal-error"),MJi(s,new wZi(t),t.bypassAuthState)} - Qt(gZi,"_signIn"),Qt(mZi,"_reauth"),Qt(vZi,"_link"); - const _Zi=class{ - constructor(t,i,s,e,n=!1){ - this.auth=t,this.resolver=s,this.user=e,this.bypassAuthState=n,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(i)?i:[i]} - execute(){ - return new Promise(async(t,i)=>{ - this.pendingPromise={ - resolve:t,reject:i} - ; - try{ - this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)} - catch(frt){ - this.reject(frt)} - } - )} - async onAuthEvent(t){ - const{ - urlResponse:i,sessionId:s,postBody:e,tenantId:n,error:h,type:r} - =t; - if(h)return void this.reject(h); - const o={ - auth:this.auth,requestUri:i,sessionId:s,tenantId:n||void 0,postBody:e||void 0,user:this.user,bypassAuthState:this.bypassAuthState} - ; - try{ - this.resolve(await this.getIdpTask(r)(o))} - catch(frt){ - this.reject(frt)} - } - onError(t){ - this.reject(t)} - getIdpTask(t){ - switch(t){ - case"signInViaPopup":case"signInViaRedirect":return gZi; - case"linkViaPopup":case"linkViaRedirect":return vZi; - case"reauthViaPopup":case"reauthViaRedirect":return mZi; - default:eYi(this.auth,"internal-error")} - } - resolve(t){ - uYi(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()} - reject(t){ - uYi(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(t),this.unregisterAndCleanUp()} - unregisterAndCleanUp(){ - this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()} - } - ; - Qt(_Zi,"AbstractPopupRedirectOperation"); - let MZi=_Zi; - const bZi=new vYi(2e3,1e4); - async function yZi(t,i,s){ - if(Ozi(t.app))return Promise.reject(nYi(t,"operation-not-supported-in-this-environment")); - const e=Uqi(t); - oYi(t,i,JXi); - const n=fZi(e,s); - return new SZi(e,"signInViaPopup",i,n).executeNotNull()} - async function EZi(t,i,s){ - const e=Qji(t); - oYi(e.auth,i,JXi); - const n=fZi(e.auth,s); - return new SZi(e.auth,"linkViaPopup",i,n,e).executeNotNull()} - Qt(yZi,"signInWithPopup"),Qt(EZi,"linkWithPopup"); - const AZi=class t extends MZi{ - constructor(i,s,e,n,h){ - super(i,s,n,h),this.provider=e,this.authWindow=null,this.pollId=null,t.currentPopupAction&&t.currentPopupAction.cancel(),t.currentPopupAction=this} - async executeNotNull(){ - const t=await this.execute(); - return cYi(t,this.auth,"internal-error"),t} - async onExecution(){ - uYi(1===this.filter.length,"Popup operations only handle one event"); - const t=SQi(); - this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],t),this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch(t=>{ - this.reject(t)} - ),this.resolver._isIframeWebStorageSupported(this.auth,t=>{ - t||this.reject(nYi(this.auth,"web-storage-unsupported"))} - ),this.pollUserCancellation()} - get eventId(){ - var t; - return(null==(t=this.authWindow)?void 0:t.associatedEvent)||null} - cancel(){ - this.reject(nYi(this.auth,"cancelled-popup-request"))} - cleanUp(){ - this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,t.currentPopupAction=null} - pollUserCancellation(){ - const t=Qt(()=>{ - var i,s; - (null==(s=null==(i=this.authWindow)?void 0:i.window)?void 0:s.closed)?this.pollId=window.setTimeout(()=>{ - this.pollId=null,this.reject(nYi(this.auth,"popup-closed-by-user"))} - ,8e3):this.pollId=window.setTimeout(t,bZi.get())} - ,"poll"); - t()} - } - ; - Qt(AZi,"PopupOperation"); - let SZi=AZi; - SZi.currentPopupAction=null; - const TZi=new Map,CZi=class extends MZi{ - constructor(t,i,s=!1){ - super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],i,void 0,s),this.eventId=null} - async execute(){ - let t=TZi.get(this.auth._key()); - if(!t){ - try{ - const i=await IZi(this.resolver,this.auth)?await super.execute():null; - t=Qt(()=>Promise.resolve(i),"readyOutcome")} - catch(frt){ - t=Qt(()=>Promise.reject(frt),"readyOutcome")} - TZi.set(this.auth._key(),t)} - return this.bypassAuthState||TZi.set(this.auth._key(),()=>Promise.resolve(null)),t()} - async onAuthEvent(t){ - if("signInViaRedirect"===t.type)return super.onAuthEvent(t); - if("unknown"!==t.type){ - if(t.eventId){ - const i=await this.auth._redirectUserForId(t.eventId); - if(i)return this.user=i,super.onAuthEvent(t); - this.resolve(null)} - } - else this.resolve(null)} - async onExecution(){ - } - cleanUp(){ - } - } - ; - Qt(CZi,"RedirectAction"); - let OZi=CZi; - async function IZi(t,i){ - const s=PZi(i),e=RZi(t); - if(!(await e._isAvailable()))return!1; - const n="true"===await e._get(s); - return await e._remove(s),n} - async function kZi(t,i){ - return RZi(t)._set(PZi(i),"true")} - function xZi(t,i){ - TZi.set(t._key(),i)} - function RZi(t){ - return dqi(t._redirectPersistence)} - function PZi(t){ - return gqi("pendingRedirect",t.config.apiKey,t.name)} - function NZi(t,i,s){ - return LZi(t,i,s)} - async function LZi(t,i,s){ - if(Ozi(t.app))return Promise.reject(rYi(t)); - const e=Uqi(t); - oYi(t,i,JXi),await e._initializationPromise; - const n=fZi(e,s); - return await kZi(n,e),n._openRedirect(e,i,"signInViaRedirect")} - function DZi(t,i,s){ - return GZi(t,i,s)} - async function GZi(t,i,s){ - const e=Qji(t); - oYi(e.auth,i,JXi),await e.auth._initializationPromise; - const n=fZi(e.auth,s); - await bJi(!1,e,i.providerId),await kZi(n,e.auth); - const h=await FZi(e); - return n._openRedirect(e.auth,i,"linkViaRedirect",h)} - async function BZi(t,i){ - return await Uqi(t)._initializationPromise,UZi(t,i,!1)} - async function UZi(t,i,s=!1){ - if(Ozi(t.app))return Promise.reject(rYi(t)); - const e=Uqi(t),n=fZi(e,i),h=new OZi(e,n,s),r=await h.execute(); - return r&&!s&&(delete r.user._redirectEventId,await e._persistUserIfCurrent(r.user),await e._setRedirectUser(null,i)),r} - async function FZi(t){ - const i=SQi(`${ - t.uid} - :::`); - return t._redirectEventId=i,await t.auth._setRedirectUser(t),await t.auth._persistUserIfCurrent(t),i} - Qt(IZi,"_getAndClearPendingRedirectStatus"),Qt(kZi,"_setPendingRedirectStatus"),Qt(xZi,"_overrideRedirectResult"),Qt(RZi,"resolverPersistence"),Qt(PZi,"pendingRedirectKey"),Qt(NZi,"signInWithRedirect"),Qt(LZi,"_signInWithRedirect"),Qt(DZi,"linkWithRedirect"),Qt(GZi,"_linkWithRedirect"),Qt(BZi,"getRedirectResult"),Qt(UZi,"_getRedirectResult"),Qt(FZi,"prepareUserForRedirect"); - const $Zi=class{ - constructor(t){ - this.auth=t,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()} - registerConsumer(t){ - this.consumers.add(t),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,t)&&(this.sendToConsumer(this.queuedRedirectEvent,t),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)} - unregisterConsumer(t){ - this.consumers.delete(t)} - onEvent(t){ - if(this.hasEventBeenHandled(t))return!1; - let i=!1; - return this.consumers.forEach(s=>{ - this.isEventForConsumer(t,s)&&(i=!0,this.sendToConsumer(t,s),this.saveEventToCache(t))} - ),this.hasHandledPotentialRedirect||!jZi(t)||(this.hasHandledPotentialRedirect=!0,i||(this.queuedRedirectEvent=t,i=!0)),i} - sendToConsumer(t,i){ - var s; - if(t.error&&!VZi(t)){ - const e=(null==(s=t.error.code)?void 0:s.split("auth/")[1])||"internal-error"; - i.onError(nYi(this.auth,e))} - else i.onAuthEvent(t)} - isEventForConsumer(t,i){ - const s=null===i.eventId||!!t.eventId&&t.eventId===i.eventId; - return i.filter.includes(t.type)&&s} - hasEventBeenHandled(t){ - return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(WZi(t))} - saveEventToCache(t){ - this.cachedEventUids.add(WZi(t)),this.lastProcessedEventTime=Date.now()} - } - ; - Qt($Zi,"AuthEventManager"); - let HZi=$Zi; - function WZi(t){ - return[t.type,t.eventId,t.sessionId,t.tenantId].filter(t=>t).join("-")} - function VZi({ - type:t,error:i} - ){ - return"unknown"===t&&"auth/no-auth-event"===(null==i?void 0:i.code)} - function jZi(t){ - switch(t.type){ - case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0; - case"unknown":return VZi(t); - default:return!1} - } - async function KZi(t,i={ - } - ){ - return TYi(t,"GET","/v1/projects",i)} - Qt(WZi,"eventUid"),Qt(VZi,"isNullRedirectEvent"),Qt(jZi,"isRedirectEvent"),Qt(KZi,"_getProjectConfig"); - const zZi=/^\d{ - 1,3} - \.\d{ - 1,3} - \.\d{ - 1,3} - \.\d{ - 1,3} - $/,YZi=/^https?/; - async function qZi(t){ - if(t.config.emulator)return; - const{ - authorizedDomains:i} - =await KZi(t); - for(const s of i)try{ - if(XZi(s))return} - catch{ - } - eYi(t,"unauthorized-domain")} - function XZi(t){ - const i=dYi(),{ - protocol:s,hostname:e} - =new URL(i); - if(t.startsWith("chrome-extension://")){ - const n=new URL(t); - return""===n.hostname&&""===e?"chrome-extension:"===s&&t.replace("chrome-extension://","")===i.replace("chrome-extension://",""):"chrome-extension:"===s&&n.hostname===e} - if(!YZi.test(s))return!1; - if(zZi.test(t))return e===t; - const n=t.replace(/\./g,"\\."); - return new RegExp("^(.+\\."+n+"|"+n+")$","i").test(e)} - Qt(qZi,"_validateOrigin"),Qt(XZi,"matchDomain"); - const JZi=new vYi(3e4,6e4); - function QZi(){ - const t=OQi().___jsl; - if(null==t?void 0:t.H)for(const i of Object.keys(t.H))if(t.H[i].r=t.H[i].r||[],t.H[i].L=t.H[i].L||[],t.H[i].r=[...t.H[i].L],t.CP)for(let s=0; - s<t.CP.length; - s++)t.CP[s]=null} - function ZZi(t){ - return new Promise((i,s)=>{ - var e,n,h; - function r(){ - QZi(),gapi.load("gapi.iframes",{ - callback:Qt(()=>{ - i(gapi.iframes.getContext())} - ,"callback"),ontimeout:Qt(()=>{ - QZi(),s(nYi(t,"network-request-failed"))} - ,"ontimeout"),timeout:JZi.get()} - )} - if(Qt(r,"loadGapiIframe"),null==(n=null==(e=OQi().gapi)?void 0:e.iframes)?void 0:n.Iframe)i(gapi.iframes.getContext()); - else{ - if(!(null==(h=OQi().gapi)?void 0:h.load)){ - const i=Yqi("iframefcb"); - return OQi()[i]=()=>{ - gapi.load?r():s(nYi(t,"network-request-failed"))} - ,Vqi(`${ - zqi()} - ?onload=${ - i} - `).catch(t=>s(t))} - r()} - } - ).catch(t=>{ - throw t0i=null,t} - )} - Qt(QZi,"resetUnloadedGapiModules"),Qt(ZZi,"loadGapi"); - let t0i=null; - function i0i(t){ - return t0i=t0i||ZZi(t),t0i} - Qt(i0i,"_loadGapi"); - const s0i=new vYi(5e3,15e3),e0i={ - style:{ - position:"absolute",top:"-100px",width:"1px",height:"1px"} - ,"aria-hidden":"true",tabindex:"-1"} - ,n0i=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]); - function h0i(t){ - const i=t.config; - cYi(i.authDomain,t,"auth-domain-config-required"); - const s=i.emulator?_Yi(i,"emulator/auth/iframe"):`https://${ - t.config.authDomain} - /__/auth/iframe`,e={ - apiKey:i.apiKey,appName:t.name,v:Rzi} - ,n=n0i.get(t.config.apiHost); - n&&(e.eid=n); - const h=t._getFrameworks(); - return h.length&&(e.fw=h.join(",")),`${ - s} - ?${ - Vji(e).slice(1)} - `} - async function r0i(t){ - const i=await i0i(t),s=OQi().gapi; - return cYi(s,t,"internal-error"),i.open({ - where:document.body,url:h0i(t),messageHandlersFilter:s.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:e0i,dontclear:!0} - ,i=>new Promise(async(s,e)=>{ - await i.restyle({ - setHideOnLeave:!1} - ); - const n=nYi(t,"network-request-failed"),h=OQi().setTimeout(()=>{ - e(n)} - ,s0i.get()); - function r(){ - OQi().clearTimeout(h),s(i)} - Qt(r,"clearTimerAndResolve"),i.ping(r).then(r,()=>{ - e(n)} - )} - ))} - Qt(h0i,"getIframeUrl"),Qt(r0i,"_openIframe"); - const o0i={ - location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"} - ,a0i=class{ - constructor(t){ - this.window=t,this.associatedEvent=null} - close(){ - if(this.window)try{ - this.window.close()} - catch(frt){ - } - } - } - ; - Qt(a0i,"AuthPopup"); - let c0i=a0i; - function l0i(t,i,s,e=500,n=600){ - const h=Math.max((window.screen.availHeight-n)/2,0).toString(),r=Math.max((window.screen.availWidth-e)/2,0).toString(); - let o=""; - const a={ - ...o0i,width:e.toString(),height:n.toString(),top:h,left:r} - ,c=Tji().toLowerCase(); - s&&(o=yqi(c)?"_blank":s),Mqi(c)&&(i=i||"http://localhost",a.scrollbars="yes"); - const l=Object.entries(a).reduce((t,[i,s])=>`${ - t} - ${ - i} - =${ - s} - ,`,""); - if(Oqi(c)&&"_self"!==o)return u0i(i||"",o),new c0i(null); - const u=window.open(i||"",o,l); - cYi(u,t,"popup-blocked"); - try{ - u.focus()} - catch(frt){ - } - return new c0i(u)} - function u0i(t,i){ - const s=document.createElement("a"); - s.href=t,s.target=i; - const e=document.createEvent("MouseEvent"); - e.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),s.dispatchEvent(e)} - Qt(l0i,"_open"),Qt(u0i,"openAsNewWindowIOS"); - const d0i=encodeURIComponent("fac"); - async function f0i(t,i,s,e,n,h){ - cYi(t.config.authDomain,t,"auth-domain-config-required"),cYi(t.config.apiKey,t,"invalid-api-key"); - const r={ - apiKey:t.config.apiKey,appName:t.name,authType:s,redirectUrl:e,v:Rzi,eventId:n} - ; - if(i instanceof JXi){ - i.setDefaultLanguage(t.languageCode),r.providerId=i.providerId||"",$ji(i.getCustomParameters())||(r.customParameters=JSON.stringify(i.getCustomParameters())); - for(const[t,i]of Object.entries({ - } - ))r[t]=i} - if(i instanceof ZXi){ - const t=i.getScopes().filter(t=>""!==t); - t.length>0&&(r.scopes=t.join(","))} - t.tenantId&&(r.tid=t.tenantId); - const o=r; - for(const l of Object.keys(o))void 0===o[l]&&delete o[l]; - const a=await t._getAppCheckToken(),c=a?`#${ - d0i} - =${ - encodeURIComponent(a)} - `:""; - return`${ - p0i(t)} - ?${ - Vji(o).slice(1)} - ${ - c} - `} - function p0i({ - config:t} - ){ - return t.emulator?_Yi(t,"emulator/auth/handler"):`https://${ - t.authDomain} - /__/auth/handler`} - Qt(f0i,"_getRedirectUrl"),Qt(p0i,"getHandlerBase"); - const w0i="webStorageSupport",g0i=class{ - constructor(){ - this.eventManagers={ - } - ,this.iframes={ - } - ,this.originValidationPromises={ - } - ,this._redirectPersistence=bQi,this._completeRedirectFn=UZi,this._overrideRedirectResult=xZi} - async _openPopup(t,i,s,e){ - var n; - return uYi(null==(n=this.eventManagers[t._key()])?void 0:n.manager,"_initialize() not called before _openPopup()"),l0i(t,await f0i(t,i,s,dYi(),e),SQi())} - async _openRedirect(t,i,s,e){ - return await this._originValidation(t),IQi(await f0i(t,i,s,dYi(),e)),new Promise(()=>{ - } - )} - _initialize(t){ - const i=t._key(); - if(this.eventManagers[i]){ - const{ - manager:t,promise:s} - =this.eventManagers[i]; - return t?Promise.resolve(t):(uYi(s,"If manager is not set, promise should be"),s)} - const s=this.initAndGetManager(t); - return this.eventManagers[i]={ - promise:s} - ,s.catch(()=>{ - delete this.eventManagers[i]} - ),s} - async initAndGetManager(t){ - const i=await r0i(t),s=new HZi(t); - return i.register("authEvent",i=>(cYi(null==i?void 0:i.authEvent,t,"invalid-auth-event"),{ - status:s.onEvent(i.authEvent)?"ACK":"ERROR"} - ),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[t._key()]={ - manager:s} - ,this.iframes[t._key()]=i,s} - _isIframeWebStorageSupported(t,i){ - this.iframes[t._key()].send(w0i,{ - type:w0i} - ,s=>{ - var e; - const n=null==(e=null==s?void 0:s[0])?void 0:e[w0i]; - void 0!==n&&i(!!n),eYi(t,"internal-error")} - ,gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)} - _originValidation(t){ - const i=t._key(); - return this.originValidationPromises[i]||(this.originValidationPromises[i]=qZi(t)),this.originValidationPromises[i]} - get _shouldInitProactively(){ - return kqi()||bqi()||Cqi()} - } - ; - Qt(g0i,"BrowserPopupRedirectResolver"); - const m0i=g0i; - var v0i="@firebase/auth",_0i="1.12.2"; - const M0i=class{ - constructor(t){ - this.auth=t,this.internalListeners=new Map} - getUid(){ - var t; - return this.assertAuthConfigured(),(null==(t=this.auth.currentUser)?void 0:t.uid)||null} - async getToken(t){ - return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{ - accessToken:await this.auth.currentUser.getIdToken(t)} - :null} - addAuthTokenListener(t){ - if(this.assertAuthConfigured(),this.internalListeners.has(t))return; - const i=this.auth.onIdTokenChanged(i=>{ - t((null==i?void 0:i.stsTokenManager.accessToken)||null)} - ); - this.internalListeners.set(t,i),this.updateProactiveRefresh()} - removeAuthTokenListener(t){ - this.assertAuthConfigured(); - const i=this.internalListeners.get(t); - i&&(this.internalListeners.delete(t),i(),this.updateProactiveRefresh())} - assertAuthConfigured(){ - cYi(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")} - updateProactiveRefresh(){ - this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()} - } - ; - Qt(M0i,"AuthInterop"); - let b0i=M0i; - function y0i(t){ - switch(t){ - case"Node":return"node"; - case"ReactNative":return"rn"; - case"Worker":return"webworker"; - case"Cordova":return"cordova"; - case"WebExtension":return"web-extension"; - default:return} - } - function E0i(t){ - Tzi(new sKi("auth",(i,{ - options:s} - )=>{ - const e=i.getProvider("app").getImmediate(),n=i.getProvider("heartbeat"),h=i.getProvider("app-check-internal"),{ - apiKey:r,authDomain:o} - =e.options; - cYi(r&&!r.includes(":"),"invalid-api-key",{ - appName:e.name} - ); - const a={ - apiKey:r,authDomain:o,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:xqi(t)} - ,c=new Bqi(e,n,h,a); - return dXi(c,s),c} - ,"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,i,s)=>{ - t.getProvider("auth-internal").initialize()} - )),Tzi(new sKi("auth-internal",t=>{ - const i=Uqi(t.getProvider("auth").getImmediate()); - return new b0i(i)} - ,"PRIVATE").setInstantiationMode("EXPLICIT")),Lzi(v0i,_0i,y0i(t)),Lzi(v0i,_0i,"esm2020")} - Qt(y0i,"getVersionForPlatform"),Qt(E0i,"registerAuth"); - const A0i=Eji("authIdTokenMaxAge")||300; - let S0i=null; - const T0i=Qt(t=>async i=>{ - const s=i&&await i.getIdTokenResult(),e=s&&((new Date).getTime()-Date.parse(s.issuedAtTime))/1e3; - if(e&&e>A0i)return; - const n=null==s?void 0:s.token; - S0i!==n&&(S0i=n,await fetch(t,{ - method:n?"POST":"DELETE",headers:n?{ - Authorization:`Bearer ${ - n} - `} - :{ - } - } - ))} - ,"mintCookieFactory"); - function C0i(t=Nzi()){ - const i=Czi(t,"auth"); - if(i.isInitialized())return i.getImmediate(); - const s=uXi(t,{ - popupRedirectResolver:m0i,persistence:[zQi,vQi,bQi]} - ),e=Eji("authTokenSyncURL"); - if(e&&"boolean"==typeof isSecureContext&&isSecureContext){ - const t=new URL(e,location.origin); - if(location.origin===t.origin){ - const i=T0i(t.toString()); - cQi(s,i,()=>i(s.currentUser)),aQi(s,t=>i(t))} - } - const n=bji("auth"); - return n&&fXi(s,`http://${ - n} - `),s} - function O0i(){ - var t; - return(null==(t=document.getElementsByTagName("head"))?void 0:t[0])??document} - Qt(C0i,"getAuth"),Qt(O0i,"getScriptParentElement"),Wqi({ - loadJS:t=>new Promise((i,s)=>{ - const e=document.createElement("script"); - e.setAttribute("src",t),e.onload=i,e.onerror=t=>{ - const i=nYi("internal-error"); - i.customData=t,s(i)} - ,e.type="text/javascript",e.charset="UTF-8",O0i().appendChild(e)} - ),gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="} - ),E0i("Browser"); - const I0i=class t extends KKt{ - constructor(){ - super(),this.lastConfirmationResult=new Map; - const t=C0i(); - t.onAuthStateChanged(t=>this.handleAuthStateChange(t)),t.onIdTokenChanged(t=>{ - this.handleIdTokenChange(t)} - )} - async applyActionCode(t){ - return RJi(C0i(),t.oobCode)} - async createUserWithEmailAndPassword(t){ - const i=C0i(),s=await PJi(i,t.email,t.password); - return this.createSignInResult(s,null)} - async confirmPasswordReset(t){ - return xJi(C0i(),t.oobCode,t.newPassword)} - async confirmVerificationCode(i){ - const{ - verificationCode:s,verificationId:e} - =i,n=this.lastConfirmationResult.get(e); - if(!n)throw new Error(t.ERROR_CONFIRMATION_RESULT_MISSING); - const h=await n.confirm(s); - return this.createSignInResult(h,null)} - async deleteUser(){ - const i=C0i().currentUser; - if(!i)throw new Error(t.ERROR_NO_USER_SIGNED_IN); - return uQi(i)} - async fetchSignInMethodsForEmail(t){ - const i=C0i(); - return{ - signInMethods:await UJi(i,t.email)} - } - async getPendingAuthResult(){ - throw this.unimplemented("Not implemented on web.")} - async getCurrentUser(){ - const t=C0i(); - return{ - user:this.createUserResult(t.currentUser)} - } - async getIdToken(i){ - const s=C0i(); - if(!s.currentUser)throw new Error(t.ERROR_NO_USER_SIGNED_IN); - return{ - token:await s.currentUser.getIdToken(null==i?void 0:i.forceRefresh)||""} - } - async getIdTokenResult(i){ - const s=C0i(); - if(!s.currentUser)throw new Error(t.ERROR_NO_USER_SIGNED_IN); - const e=await s.currentUser.getIdTokenResult(null==i?void 0:i.forceRefresh); - return Object.assign(Object.assign({ - } - ,e),{ - authTime:Date.parse(e.authTime),expirationTime:Date.parse(e.expirationTime),issuedAtTime:Date.parse(e.issuedAtTime)} - )} - async getRedirectResult(){ - const t=C0i(),i=await BZi(t),s=i?iJi.credentialFromResult(i):null; - return this.createSignInResult(i,s)} - async getTenantId(){ - return{ - tenantId:C0i().tenantId} - } - async isSignInWithEmailLink(t){ - return C0i(),{ - isSignInWithEmailLink:DJi(0,t.emailLink)} - } - async linkWithApple(t){ - const i=new iJi(Ivi.APPLE); - this.applySignInOptions(t||{ - } - ,i); - const s=await this.linkCurrentUserWithPopupOrRedirect(i,null==t?void 0:t.mode),e=iJi.credentialFromResult(s); - return this.createSignInResult(s,e)} - async linkWithEmailAndPassword(t){ - const i=qXi.credential(t.email,t.password),s=await this.linkCurrentUserWithCredential(i); - return this.createSignInResult(s,i)} - async linkWithEmailLink(t){ - const i=qXi.credentialWithLink(t.email,t.emailLink),s=await this.linkCurrentUserWithCredential(i); - return this.createSignInResult(s,i)} - async linkWithFacebook(t){ - const i=new eJi; - this.applySignInOptions(t||{ - } - ,i); - const s=await this.linkCurrentUserWithPopupOrRedirect(i,null==t?void 0:t.mode),e=eJi.credentialFromResult(s); - return this.createSignInResult(s,e)} - async linkWithGameCenter(){ - throw this.unimplemented("Not implemented on web.")} - async linkWithGithub(t){ - const i=new oJi; - this.applySignInOptions(t||{ - } - ,i); - const s=await this.linkCurrentUserWithPopupOrRedirect(i,null==t?void 0:t.mode),e=oJi.credentialFromResult(s); - return this.createSignInResult(s,e)} - async linkWithGoogle(t){ - const i=new hJi; - this.applySignInOptions(t||{ - } - ,i); - const s=await this.linkCurrentUserWithPopupOrRedirect(i,null==t?void 0:t.mode),e=hJi.credentialFromResult(s); - return this.createSignInResult(s,e)} - async linkWithMicrosoft(t){ - const i=new iJi(Ivi.MICROSOFT); - this.applySignInOptions(t||{ - } - ,i); - const s=await this.linkCurrentUserWithPopupOrRedirect(i,null==t?void 0:t.mode),e=iJi.credentialFromResult(s); - return this.createSignInResult(s,e)} - async linkWithOpenIdConnect(t){ - const i=new iJi(t.providerId); - this.applySignInOptions(t,i); - const s=await this.linkCurrentUserWithPopupOrRedirect(i,t.mode),e=iJi.credentialFromResult(s); - return this.createSignInResult(s,e)} - async linkWithPhoneNumber(i){ - const s=C0i().currentUser; - if(!s)throw new Error(t.ERROR_NO_USER_SIGNED_IN); - if(!i.phoneNumber)throw new Error(t.ERROR_PHONE_NUMBER_MISSING); - if(!(i.recaptchaVerifier&&i.recaptchaVerifier instanceof hZi))throw new Error(t.ERROR_RECAPTCHA_VERIFIER_MISSING); - try{ - const e=await lZi(s,i.phoneNumber,i.recaptchaVerifier),{ - verificationId:n} - =e; - this.lastConfirmationResult.set(n,e); - const h={ - verificationId:n} - ; - this.notifyListeners(t.PHONE_CODE_SENT_EVENT,h)} - catch(e){ - const i={ - message:this.getErrorMessage(e)} - ; - this.notifyListeners(t.PHONE_VERIFICATION_FAILED_EVENT,i)} - } - async linkWithPlayGames(){ - throw this.unimplemented("Not implemented on web.")} - async linkWithTwitter(t){ - const i=new cJi; - this.applySignInOptions(t||{ - } - ,i); - const s=await this.linkCurrentUserWithPopupOrRedirect(i,null==t?void 0:t.mode),e=cJi.credentialFromResult(s); - return this.createSignInResult(s,e)} - async linkWithYahoo(t){ - const i=new iJi(Ivi.YAHOO); - this.applySignInOptions(t||{ - } - ,i); - const s=await this.linkCurrentUserWithPopupOrRedirect(i,null==t?void 0:t.mode),e=iJi.credentialFromResult(s); - return this.createSignInResult(s,e)} - async reload(){ - const i=C0i().currentUser; - if(!i)throw new Error(t.ERROR_NO_USER_SIGNED_IN); - return iqi(i)} - async revokeAccessToken(t){ - return lQi(C0i(),t.token)} - async sendEmailVerification(i){ - const s=C0i().currentUser; - if(!s)throw new Error(t.ERROR_NO_USER_SIGNED_IN); - return FJi(s,null==i?void 0:i.actionCodeSettings)} - async sendPasswordResetEmail(t){ - return kJi(C0i(),t.email,t.actionCodeSettings)} - async sendSignInLinkToEmail(t){ - return LJi(C0i(),t.email,t.actionCodeSettings)} - async setLanguageCode(t){ - C0i().languageCode=t.languageCode} - async setPersistence(t){ - const i=C0i(); - switch(t.persistence){ - case Cvi.BrowserLocal:await oQi(i,vQi); - break; - case Cvi.BrowserSession:await oQi(i,bQi); - break; - case Cvi.IndexedDbLocal:await oQi(i,zQi); - break; - case Cvi.InMemory:await oQi(i,wqi)} - } - async setTenantId(t){ - C0i().tenantId=t.tenantId} - async signInAnonymously(){ - const t=C0i(),i=await pJi(t); - return this.createSignInResult(i,null)} - async signInWithApple(t){ - const i=new iJi(Ivi.APPLE); - this.applySignInOptions(t||{ - } - ,i); - const s=await this.signInWithPopupOrRedirect(i,null==t?void 0:t.mode),e=iJi.credentialFromResult(s); - return this.createSignInResult(s,e)} - async signInWithCustomToken(t){ - const i=C0i(),s=await CJi(i,t.token); - return this.createSignInResult(s,null)} - async signInWithEmailAndPassword(t){ - const i=C0i(),s=await NJi(i,t.email,t.password); - return this.createSignInResult(s,null)} - async signInWithEmailLink(t){ - const i=C0i(),s=await GJi(i,t.email,t.emailLink); - return this.createSignInResult(s,null)} - async signInWithFacebook(t){ - const i=new eJi; - this.applySignInOptions(t||{ - } - ,i); - const s=await this.signInWithPopupOrRedirect(i,null==t?void 0:t.mode),e=eJi.credentialFromResult(s); - return this.createSignInResult(s,e)} - async signInWithGithub(t){ - const i=new oJi; - this.applySignInOptions(t||{ - } - ,i); - const s=await this.signInWithPopupOrRedirect(i,null==t?void 0:t.mode),e=oJi.credentialFromResult(s); - return this.createSignInResult(s,e)} - async signInWithGoogle(t){ - const i=new hJi; - this.applySignInOptions(t||{ - } - ,i); - const s=await this.signInWithPopupOrRedirect(i,null==t?void 0:t.mode),e=hJi.credentialFromResult(s); - return this.createSignInResult(s,e)} - async signInWithMicrosoft(t){ - const i=new iJi(Ivi.MICROSOFT); - this.applySignInOptions(t||{ - } - ,i); - const s=await this.signInWithPopupOrRedirect(i,null==t?void 0:t.mode),e=iJi.credentialFromResult(s); - return this.createSignInResult(s,e)} - async signInWithOpenIdConnect(t){ - const i=new iJi(t.providerId); - this.applySignInOptions(t,i); - const s=await this.signInWithPopupOrRedirect(i,t.mode),e=iJi.credentialFromResult(s); - return this.createSignInResult(s,e)} - async signInWithPhoneNumber(i){ - if(!i.phoneNumber)throw new Error(t.ERROR_PHONE_NUMBER_MISSING); - if(!(i.recaptchaVerifier&&i.recaptchaVerifier instanceof hZi))throw new Error(t.ERROR_RECAPTCHA_VERIFIER_MISSING); - const s=C0i(); - try{ - const e=await cZi(s,i.phoneNumber,i.recaptchaVerifier),{ - verificationId:n} - =e; - this.lastConfirmationResult.set(n,e); - const h={ - verificationId:n} - ; - this.notifyListeners(t.PHONE_CODE_SENT_EVENT,h)} - catch(e){ - const i={ - message:this.getErrorMessage(e)} - ; - this.notifyListeners(t.PHONE_VERIFICATION_FAILED_EVENT,i)} - } - async signInWithPlayGames(){ - throw this.unimplemented("Not implemented on web.")} - async signInWithGameCenter(){ - throw this.unimplemented("Not implemented on web.")} - async signInWithTwitter(t){ - const i=new cJi; - this.applySignInOptions(t||{ - } - ,i); - const s=await this.signInWithPopupOrRedirect(i,null==t?void 0:t.mode),e=cJi.credentialFromResult(s); - return this.createSignInResult(s,e)} - async signInWithYahoo(t){ - const i=new iJi(Ivi.YAHOO); - this.applySignInOptions(t||{ - } - ,i); - const s=await this.signInWithPopupOrRedirect(i,null==t?void 0:t.mode),e=iJi.credentialFromResult(s); - return this.createSignInResult(s,e)} - async signOut(){ - const t=C0i(); - await t.signOut()} - async unlink(i){ - const s=C0i(); - if(!s.currentUser)throw new Error(t.ERROR_NO_USER_SIGNED_IN); - const e=await _Ji(s.currentUser,i.providerId); - return{ - user:this.createUserResult(e)} - } - async updateEmail(i){ - const s=C0i().currentUser; - if(!s)throw new Error(t.ERROR_NO_USER_SIGNED_IN); - return VJi(s,i.newEmail)} - async updatePassword(i){ - const s=C0i().currentUser; - if(!s)throw new Error(t.ERROR_NO_USER_SIGNED_IN); - return jJi(s,i.newPassword)} - async updateProfile(i){ - const s=C0i().currentUser; - if(!s)throw new Error(t.ERROR_NO_USER_SIGNED_IN); - return WJi(s,{ - displayName:i.displayName,photoURL:i.photoUrl} - )} - async useAppLanguage(){ - C0i().useDeviceLanguage()} - async useEmulator(t){ - const i=C0i(),s=t.port||9099,e=t.scheme||"http"; - t.host.includes("://")?fXi(i,`${ - t.host} - :${ - s} - `):fXi(i,`${ - e} - ://${ - t.host} - :${ - s} - `)} - async verifyBeforeUpdateEmail(i){ - const s=C0i().currentUser; - if(!s)throw new Error(t.ERROR_NO_USER_SIGNED_IN); - return $Ji(s,null==i?void 0:i.newEmail,null==i?void 0:i.actionCodeSettings)} - handleAuthStateChange(i){ - const s={ - user:this.createUserResult(i)} - ; - this.notifyListeners(t.AUTH_STATE_CHANGE_EVENT,s,!0)} - async handleIdTokenChange(i){ - if(!i)return; - const s={ - token:await i.getIdToken(!1)} - ; - this.notifyListeners(t.ID_TOKEN_CHANGE_EVENT,s,!0)} - applySignInOptions(t,i){ - if(t.customParameters){ - const s={ - } - ; - t.customParameters.map(t=>{ - s[t.key]=t.value} - ),i.setCustomParameters(s)} - if(t.scopes)for(const s of t.scopes)i.addScope(s)} - signInWithPopupOrRedirect(t,i){ - const s=C0i(); - return"redirect"===i?NZi(s,t):yZi(s,t)} - linkCurrentUserWithPopupOrRedirect(i,s){ - const e=C0i(); - if(!e.currentUser)throw new Error(t.ERROR_NO_USER_SIGNED_IN); - return"redirect"===s?DZi(e.currentUser,i):EZi(e.currentUser,i)} - linkCurrentUserWithCredential(i){ - const s=C0i(); - if(!s.currentUser)throw new Error(t.ERROR_NO_USER_SIGNED_IN); - return SJi(s.currentUser,i)} - requestAppTrackingTransparencyPermission(){ - throw this.unimplemented("Not implemented on web.")} - checkAppTrackingTransparencyPermission(){ - throw this.unimplemented("Not implemented on web.")} - createSignInResult(t,i){ - return{ - user:this.createUserResult((null==t?void 0:t.user)||null),credential:this.createCredentialResult(i),additionalUserInfo:this.createAdditionalUserInfoResult(t)} - } - createCredentialResult(t){ - if(!t)return null; - const i={ - providerId:t.providerId} - ; - return t instanceof DXi&&(i.accessToken=t.accessToken,i.idToken=t.idToken,i.secret=t.secret),i} - createUserResult(t){ - return t?{ - displayName:t.displayName,email:t.email,emailVerified:t.emailVerified,isAnonymous:t.isAnonymous,metadata:this.createUserMetadataResult(t.metadata),phoneNumber:t.phoneNumber,photoUrl:t.photoURL,providerData:this.createUserProviderDataResult(t.providerData),providerId:t.providerId,tenantId:t.tenantId,uid:t.uid} - :null} - createUserMetadataResult(t){ - const i={ - } - ; - return t.creationTime&&(i.creationTime=Date.parse(t.creationTime)),t.lastSignInTime&&(i.lastSignInTime=Date.parse(t.lastSignInTime)),i} - createUserProviderDataResult(t){ - return t.map(t=>({ - displayName:t.displayName,email:t.email,phoneNumber:t.phoneNumber,photoUrl:t.photoURL,providerId:t.providerId,uid:t.uid} - ))} - createAdditionalUserInfoResult(t){ - if(!t)return null; - const i=rQi(t); - if(!i)return null; - const{ - isNewUser:s,profile:e,providerId:n,username:h} - =i,r={ - isNewUser:s} - ; - return null!==n&&(r.providerId=n),null!==e&&(r.profile=e),null!=h&&(r.username=h),r} - getErrorMessage(t){ - return t instanceof Object&&"message"in t&&"string"==typeof t.message?t.message:JSON.stringify(t)} - } - ; - Qt(I0i,"FirebaseAuthenticationWeb"); - let k0i=I0i; - k0i.AUTH_STATE_CHANGE_EVENT="authStateChange",k0i.ID_TOKEN_CHANGE_EVENT="idTokenChange",k0i.PHONE_CODE_SENT_EVENT="phoneCodeSent",k0i.PHONE_VERIFICATION_FAILED_EVENT="phoneVerificationFailed",k0i.ERROR_NO_USER_SIGNED_IN="No user is signed in.",k0i.ERROR_PHONE_NUMBER_MISSING="phoneNumber must be provided.",k0i.ERROR_RECAPTCHA_VERIFIER_MISSING="recaptchaVerifier must be provided and must be an instance of RecaptchaVerifier.",k0i.ERROR_CONFIRMATION_RESULT_MISSING="No confirmation result with this verification id was found."; - const x0i=Object.freeze(Object.defineProperty({ - __proto__:null,FirebaseAuthenticationWeb:k0i} - ,Symbol.toStringTag,{ - value:"Module"} - )),R0i="@firebase/installations",P0i="0.6.21",N0i=`w:${ - P0i} - `,L0i="FIS_v2",D0i=new Bji("installations","Installations",{ - "missing-app-config-values":'Missing App configuration value: "{ - $valueName} - "',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{ - $requestName} - request failed with error "{ - $serverCode} - { - $serverStatus} - : { - $serverMessage} - "',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."} - ); - function G0i(t){ - return t instanceof Dji&&t.code.includes("request-failed")} - function B0i({ - projectId:t} - ){ - return`https://firebaseinstallations.googleapis.com/v1/projects/${ - t} - /installations`} - function U0i(t){ - return{ - token:t.token,requestStatus:2,expiresIn:V0i(t.expiresIn),creationTime:Date.now()} - } - async function F0i(t,i){ - const s=(await i.json()).error; - return D0i.create("request-failed",{ - requestName:t,serverCode:s.code,serverMessage:s.message,serverStatus:s.status} - )} - function $0i({ - apiKey:t} - ){ - return new Headers({ - "Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t} - )} - function H0i(t,{ - refreshToken:i} - ){ - const s=$0i(t); - return s.append("Authorization",j0i(i)),s} - async function W0i(t){ - const i=await t(); - return i.status>=500&&i.status<600?t():i} - function V0i(t){ - return Number(t.replace("s","000"))} - function j0i(t){ - return`${ - L0i} - ${ - t} - `} - async function K0i({ - appConfig:t,heartbeatServiceProvider:i} - ,{ - fid:s} - ){ - const e=B0i(t),n=$0i(t),h=i.getImmediate({ - optional:!0} - ); - if(h){ - const t=await h.getHeartbeatsHeader(); - t&&n.append("x-firebase-client",t)} - const r={ - fid:s,authVersion:L0i,appId:t.appId,sdkVersion:N0i} - ,o={ - method:"POST",headers:n,body:JSON.stringify(r)} - ,a=await W0i(()=>fetch(e,o)); - if(a.ok){ - const t=await a.json(); - return{ - fid:t.fid||s,registrationStatus:2,refreshToken:t.refreshToken,authToken:U0i(t.authToken)} - } - throw await F0i("Create Installation",a)} - function z0i(t){ - return new Promise(i=>{ - setTimeout(i,t)} - )} - function Y0i(t){ - return btoa(String.fromCharCode(...t)).replace(/\+/g,"-").replace(/\//g,"_")} - Qt(G0i,"isServerError"),Qt(B0i,"getInstallationsEndpoint"),Qt(U0i,"extractAuthTokenInfoFromResponse"),Qt(F0i,"getErrorFromResponse"),Qt($0i,"getHeaders$1"),Qt(H0i,"getHeadersWithAuth"),Qt(W0i,"retryIfServerError"),Qt(V0i,"getExpiresInFromResponseExpiresIn"),Qt(j0i,"getAuthorizationHeader"),Qt(K0i,"createInstallationRequest"),Qt(z0i,"sleep"),Qt(Y0i,"bufferToBase64UrlSafe"); - const q0i=/^[cdef][\w-]{ - 21} - $/; - function X0i(){ - try{ - const t=new Uint8Array(17); - (self.crypto||self.msCrypto).getRandomValues(t),t[0]=112+t[0]%16; - const i=J0i(t); - return q0i.test(i)?i:""} - catch{ - return""} - } - function J0i(t){ - return Y0i(t).substr(0,22)} - function Q0i(t){ - return`${ - t.appName} - !${ - t.appId} - `} - Qt(X0i,"generateFid"),Qt(J0i,"encode"),Qt(Q0i,"getKey$1"); - const Z0i=new Map; - function t1i(t,i){ - const s=Q0i(t); - i1i(s,i),s1i(s,i)} - function i1i(t,i){ - const s=Z0i.get(t); - if(s)for(const e of s)e(i)} - function s1i(t,i){ - const s=n1i(); - s&&s.postMessage({ - key:t,fid:i} - ),h1i()} - Qt(t1i,"fidChanged"),Qt(i1i,"callFidChangeCallbacks"),Qt(s1i,"broadcastFidChange"); - let e1i=null; - function n1i(){ - return!e1i&&"BroadcastChannel"in self&&(e1i=new BroadcastChannel("[Firebase] FID Change"),e1i.onmessage=t=>{ - i1i(t.data.key,t.data.fid)} - ),e1i} - function h1i(){ - 0===Z0i.size&&e1i&&(e1i.close(),e1i=null)} - Qt(n1i,"getBroadcastChannel"),Qt(h1i,"closeBroadcastChannel"); - const r1i="firebase-installations-store"; - let o1i=null; - function a1i(){ - return o1i||(o1i=DKi("firebase-installations-database",1,{ - upgrade:Qt((t,i)=>{ - 0===i&&t.createObjectStore(r1i)} - ,"upgrade")} - )),o1i} - async function c1i(t,i){ - const s=Q0i(t),e=(await a1i()).transaction(r1i,"readwrite"),n=e.objectStore(r1i),h=await n.get(s); - return await n.put(i,s),await e.done,h&&h.fid===i.fid||t1i(t,i.fid),i} - async function l1i(t){ - const i=Q0i(t),s=(await a1i()).transaction(r1i,"readwrite"); - await s.objectStore(r1i).delete(i),await s.done} - async function u1i(t,i){ - const s=Q0i(t),e=(await a1i()).transaction(r1i,"readwrite"),n=e.objectStore(r1i),h=await n.get(s),r=i(h); - return void 0===r?await n.delete(s):await n.put(r,s),await e.done,!r||h&&h.fid===r.fid||t1i(t,r.fid),r} - async function d1i(t){ - let i; - const s=await u1i(t.appConfig,s=>{ - const e=f1i(s),n=p1i(t,e); - return i=n.registrationPromise,n.installationEntry} - ); - return""===s.fid?{ - installationEntry:await i} - :{ - installationEntry:s,registrationPromise:i} - } - function f1i(t){ - return v1i(t||{ - fid:X0i(),registrationStatus:0} - )} - function p1i(t,i){ - if(0===i.registrationStatus){ - if(!navigator.onLine)return{ - installationEntry:i,registrationPromise:Promise.reject(D0i.create("app-offline"))} - ; - const s={ - fid:i.fid,registrationStatus:1,registrationTime:Date.now()} - ; - return{ - installationEntry:s,registrationPromise:w1i(t,s)} - } - return 1===i.registrationStatus?{ - installationEntry:i,registrationPromise:g1i(t)} - :{ - installationEntry:i} - } - async function w1i(t,i){ - try{ - const s=await K0i(t,i); - return c1i(t.appConfig,s)} - catch(frt){ - throw G0i(frt)&&409===frt.customData.serverCode?await l1i(t.appConfig):await c1i(t.appConfig,{ - fid:i.fid,registrationStatus:0} - ),frt} - } - async function g1i(t){ - let i=await m1i(t.appConfig); - for(; - 1===i.registrationStatus; - )await z0i(100),i=await m1i(t.appConfig); - if(0===i.registrationStatus){ - const{ - installationEntry:i,registrationPromise:s} - =await d1i(t); - return s||i} - return i} - function m1i(t){ - return u1i(t,t=>{ - if(!t)throw D0i.create("installation-not-found"); - return v1i(t)} - )} - function v1i(t){ - return _1i(t)?{ - fid:t.fid,registrationStatus:0} - :t} - function _1i(t){ - return 1===t.registrationStatus&&t.registrationTime+1e4<Date.now()} - async function M1i({ - appConfig:t,heartbeatServiceProvider:i} - ,s){ - const e=b1i(t,s),n=H0i(t,s),h=i.getImmediate({ - optional:!0} - ); - if(h){ - const t=await h.getHeartbeatsHeader(); - t&&n.append("x-firebase-client",t)} - const r={ - installation:{ - sdkVersion:N0i,appId:t.appId} - } - ,o={ - method:"POST",headers:n,body:JSON.stringify(r)} - ,a=await W0i(()=>fetch(e,o)); - if(a.ok)return U0i(await a.json()); - throw await F0i("Generate Auth Token",a)} - function b1i(t,{ - fid:i} - ){ - return`${ - B0i(t)} - /${ - i} - /authTokens:generate`} - async function y1i(t,i=!1){ - let s; - const e=await u1i(t.appConfig,e=>{ - if(!T1i(e))throw D0i.create("not-registered"); - const n=e.authToken; - if(!i&&C1i(n))return e; - if(1===n.requestStatus)return s=E1i(t,i),e; - { - if(!navigator.onLine)throw D0i.create("app-offline"); - const i=I1i(e); - return s=S1i(t,i),i} - } - ); - return s?await s:e.authToken} - async function E1i(t,i){ - let s=await A1i(t.appConfig); - for(; - 1===s.authToken.requestStatus; - )await z0i(100),s=await A1i(t.appConfig); - const e=s.authToken; - return 0===e.requestStatus?y1i(t,i):e} - function A1i(t){ - return u1i(t,t=>{ - if(!T1i(t))throw D0i.create("not-registered"); - return k1i(t.authToken)?{ - ...t,authToken:{ - requestStatus:0} - } - :t} - )} - async function S1i(t,i){ - try{ - const s=await M1i(t,i),e={ - ...i,authToken:s} - ; - return await c1i(t.appConfig,e),s} - catch(frt){ - if(!G0i(frt)||401!==frt.customData.serverCode&&404!==frt.customData.serverCode){ - const s={ - ...i,authToken:{ - requestStatus:0} - } - ; - await c1i(t.appConfig,s)} - else await l1i(t.appConfig); - throw frt} - } - function T1i(t){ - return void 0!==t&&2===t.registrationStatus} - function C1i(t){ - return 2===t.requestStatus&&!O1i(t)} - function O1i(t){ - const i=Date.now(); - return i<t.creationTime||t.creationTime+t.expiresIn<i+36e5} - function I1i(t){ - return{ - ...t,authToken:{ - requestStatus:1,requestTime:Date.now()} - } - } - function k1i(t){ - return 1===t.requestStatus&&t.requestTime+1e4<Date.now()} - async function x1i(t){ - const i=t,{ - installationEntry:s,registrationPromise:e} - =await d1i(i); - return e?e.catch(console.error):y1i(i).catch(console.error),s.fid} - async function R1i(t,i=!1){ - const s=t; - return await P1i(s),(await y1i(s,i)).token} - async function P1i(t){ - const{ - registrationPromise:i} - =await d1i(t); - i&&await i} - function N1i(t){ - if(!t||!t.options)throw L1i("App Configuration"); - if(!t.name)throw L1i("App Name"); - const i=["projectId","apiKey","appId"]; - for(const s of i)if(!t.options[s])throw L1i(s); - return{ - appName:t.name,projectId:t.options.projectId,apiKey:t.options.apiKey,appId:t.options.appId} - } - function L1i(t){ - return D0i.create("missing-app-config-values",{ - valueName:t} - )} - Qt(a1i,"getDbPromise$1"),Qt(c1i,"set"),Qt(l1i,"remove"),Qt(u1i,"update"),Qt(d1i,"getInstallationEntry"),Qt(f1i,"updateOrCreateInstallationEntry"),Qt(p1i,"triggerRegistrationIfNecessary"),Qt(w1i,"registerInstallation"),Qt(g1i,"waitUntilFidRegistration"),Qt(m1i,"updateInstallationRequest"),Qt(v1i,"clearTimedOutRequest"),Qt(_1i,"hasInstallationRequestTimedOut"),Qt(M1i,"generateAuthTokenRequest"),Qt(b1i,"getGenerateAuthTokenEndpoint"),Qt(y1i,"refreshAuthToken"),Qt(E1i,"waitUntilAuthTokenRequest"),Qt(A1i,"updateAuthTokenRequest"),Qt(S1i,"fetchAuthTokenFromServer"),Qt(T1i,"isEntryRegistered"),Qt(C1i,"isAuthTokenValid"),Qt(O1i,"isAuthTokenExpired"),Qt(I1i,"makeAuthTokenRequestInProgressEntry"),Qt(k1i,"hasAuthTokenRequestTimedOut"),Qt(x1i,"getId"),Qt(R1i,"getToken$2"),Qt(P1i,"completeInstallationRegistration"),Qt(N1i,"extractAppConfig$1"),Qt(L1i,"getMissingValueError$1"); - const D1i="installations",G1i=Qt(t=>{ - const i=t.getProvider("app").getImmediate(); - return{ - app:i,appConfig:N1i(i),heartbeatServiceProvider:Czi(i,"heartbeat"),_delete:Qt(()=>Promise.resolve(),"_delete")} - } - ,"publicFactory"),B1i=Qt(t=>{ - const i=Czi(t.getProvider("app").getImmediate(),D1i).getImmediate(); - return{ - getId:Qt(()=>x1i(i),"getId"),getToken:Qt(t=>R1i(i,t),"getToken")} - } - ,"internalFactory"); - function U1i(){ - Tzi(new sKi(D1i,G1i,"PUBLIC")),Tzi(new sKi("installations-internal",B1i,"PRIVATE"))} - Qt(U1i,"registerInstallations"),U1i(),Lzi(R0i,P0i),Lzi(R0i,P0i,"esm2020"); - const F1i="BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4",$1i="google.c.a.c_id"; - var H1i,W1i,V1i; - function j1i(t){ - const i=new Uint8Array(t); - return btoa(String.fromCharCode(...i)).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")} - function K1i(t){ - const i=(t+"=".repeat((4-t.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),s=atob(i),e=new Uint8Array(s.length); - for(let n=0; - n<s.length; - ++n)e[n]=s.charCodeAt(n); - return e} - (W1i=H1i||(H1i={ - } - ))[W1i.DATA_MESSAGE=1]="DATA_MESSAGE",W1i[W1i.DISPLAY_NOTIFICATION=3]="DISPLAY_NOTIFICATION",function(t){ - t.PUSH_RECEIVED="push-received",t.NOTIFICATION_CLICKED="notification-clicked"} - (V1i||(V1i={ - } - )),Qt(j1i,"arrayToBase64"),Qt(K1i,"base64ToArray"); - const z1i="fcm_token_details_db",Y1i="fcm_token_object_Store"; - async function q1i(t){ - if("databases"in indexedDB&&!(await indexedDB.databases()).map(t=>t.name).includes(z1i))return null; - let i=null; - return(await DKi(z1i,5,{ - upgrade:Qt(async(s,e,n,h)=>{ - if(e<2)return; - if(!s.objectStoreNames.contains(Y1i))return; - const r=h.objectStore(Y1i),o=await r.index("fcmSenderId").get(t); - if(await r.clear(),o)if(2===e){ - const t=o; - if(!t.auth||!t.p256dh||!t.endpoint)return; - i={ - token:t.fcmToken,createTime:t.createTime??Date.now(),subscriptionOptions:{ - auth:t.auth,p256dh:t.p256dh,endpoint:t.endpoint,swScope:t.swScope,vapidKey:"string"==typeof t.vapidKey?t.vapidKey:j1i(t.vapidKey)} - } - } - else if(3===e){ - const t=o; - i={ - token:t.fcmToken,createTime:t.createTime,subscriptionOptions:{ - auth:j1i(t.auth),p256dh:j1i(t.p256dh),endpoint:t.endpoint,swScope:t.swScope,vapidKey:j1i(t.vapidKey)} - } - } - else if(4===e){ - const t=o; - i={ - token:t.fcmToken,createTime:t.createTime,subscriptionOptions:{ - auth:j1i(t.auth),p256dh:j1i(t.p256dh),endpoint:t.endpoint,swScope:t.swScope,vapidKey:j1i(t.vapidKey)} - } - } - } - ,"upgrade")} - )).close(),await GKi(z1i),await GKi("fcm_vapid_details_db"),await GKi("undefined"),X1i(i)?i:null} - function X1i(t){ - if(!t||!t.subscriptionOptions)return!1; - const{ - subscriptionOptions:i} - =t; - return"number"==typeof t.createTime&&t.createTime>0&&"string"==typeof t.token&&t.token.length>0&&"string"==typeof i.auth&&i.auth.length>0&&"string"==typeof i.p256dh&&i.p256dh.length>0&&"string"==typeof i.endpoint&&i.endpoint.length>0&&"string"==typeof i.swScope&&i.swScope.length>0&&"string"==typeof i.vapidKey&&i.vapidKey.length>0} - Qt(q1i,"migrateOldDatabase"),Qt(X1i,"checkTokenDetails"); - const J1i="firebase-messaging-store"; - let Q1i=null; - function Z1i(){ - return Q1i||(Q1i=DKi("firebase-messaging-database",1,{ - upgrade:Qt((t,i)=>{ - 0===i&&t.createObjectStore(J1i)} - ,"upgrade")} - )),Q1i} - async function t2i(t){ - const i=e2i(t),s=await Z1i(),e=await s.transaction(J1i).objectStore(J1i).get(i); - if(e)return e; - { - const i=await q1i(t.appConfig.senderId); - if(i)return await i2i(t,i),i} - } - async function i2i(t,i){ - const s=e2i(t),e=(await Z1i()).transaction(J1i,"readwrite"); - return await e.objectStore(J1i).put(i,s),await e.done,i} - async function s2i(t){ - const i=e2i(t),s=(await Z1i()).transaction(J1i,"readwrite"); - await s.objectStore(J1i).delete(i),await s.done} - function e2i({ - appConfig:t} - ){ - return t.appId} - Qt(Z1i,"getDbPromise"),Qt(t2i,"dbGet"),Qt(i2i,"dbSet"),Qt(s2i,"dbRemove"),Qt(e2i,"getKey"); - const n2i=new Bji("messaging","Messaging",{ - "missing-app-config-values":'Missing App configuration value: "{ - $valueName} - "',"only-available-in-window":"This method is available in a Window context.","only-available-in-sw":"This method is available in a service worker context.","permission-default":"The notification permission was not granted and dismissed instead.","permission-blocked":"The notification permission was not granted and blocked instead.","unsupported-browser":"This browser doesn't support the API's required to use the Firebase SDK.","indexed-db-unsupported":"This browser doesn't support indexedDb.open() (ex. Safari iFrame, Firefox Private Browsing, etc)","failed-service-worker-registration":"We are unable to register the default service worker. { - $browserErrorMessage} - ","token-subscribe-failed":"A problem occurred while subscribing the user to FCM: { - $errorInfo} - ","token-subscribe-no-token":"FCM returned no token when subscribing the user to push.","token-unsubscribe-failed":"A problem occurred while unsubscribing the user from FCM: { - $errorInfo} - ","token-update-failed":"A problem occurred while updating the user from FCM: { - $errorInfo} - ","token-update-no-token":"FCM returned no token when updating the user to push.","use-sw-after-get-token":"The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.","invalid-sw-registration":"The input to useServiceWorker() must be a ServiceWorkerRegistration.","invalid-bg-handler":"The input to setBackgroundMessageHandler() must be a function.","invalid-vapid-key":"The public VAPID key must be a string.","use-vapid-key-after-get-token":"The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used."} - ); - async function h2i(t,i){ - const s=await c2i(t),e=l2i(i),n={ - method:"POST",headers:s,body:JSON.stringify(e)} - ; - let h; - try{ - const i=await fetch(a2i(t.appConfig),n); - h=await i.json()} - catch(h6i){ - throw n2i.create("token-subscribe-failed",{ - errorInfo:null==h6i?void 0:h6i.toString()} - )} - if(h.error){ - const t=h.error.message; - throw n2i.create("token-subscribe-failed",{ - errorInfo:t} - )} - if(!h.token)throw n2i.create("token-subscribe-no-token"); - return h.token} - async function r2i(t,i){ - const s=await c2i(t),e=l2i(i.subscriptionOptions),n={ - method:"PATCH",headers:s,body:JSON.stringify(e)} - ; - let h; - try{ - const s=await fetch(`${ - a2i(t.appConfig)} - /${ - i.token} - `,n); - h=await s.json()} - catch(h6i){ - throw n2i.create("token-update-failed",{ - errorInfo:null==h6i?void 0:h6i.toString()} - )} - if(h.error){ - const t=h.error.message; - throw n2i.create("token-update-failed",{ - errorInfo:t} - )} - if(!h.token)throw n2i.create("token-update-no-token"); - return h.token} - async function o2i(t,i){ - const s={ - method:"DELETE",headers:await c2i(t)} - ; - try{ - const e=await fetch(`${ - a2i(t.appConfig)} - /${ - i} - `,s),n=await e.json(); - if(n.error){ - const t=n.error.message; - throw n2i.create("token-unsubscribe-failed",{ - errorInfo:t} - )} - } - catch(h6i){ - throw n2i.create("token-unsubscribe-failed",{ - errorInfo:null==h6i?void 0:h6i.toString()} - )} - } - function a2i({ - projectId:t} - ){ - return`https://fcmregistrations.googleapis.com/v1/projects/${ - t} - /registrations`} - async function c2i({ - appConfig:t,installations:i} - ){ - const s=await i.getToken(); - return new Headers({ - "Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t.apiKey,"x-goog-firebase-installations-auth":`FIS ${ - s} - `} - )} - function l2i({ - p256dh:t,auth:i,endpoint:s,vapidKey:e} - ){ - const n={ - web:{ - endpoint:s,auth:i,p256dh:t} - } - ; - return e!==F1i&&(n.web.applicationPubKey=e),n} - async function u2i(t){ - const i=await w2i(t.swRegistration,t.vapidKey),s={ - vapidKey:t.vapidKey,swScope:t.swRegistration.scope,endpoint:i.endpoint,auth:j1i(i.getKey("auth")),p256dh:j1i(i.getKey("p256dh"))} - ,e=await t2i(t.firebaseDependencies); - if(e){ - if(g2i(e.subscriptionOptions,s))return Date.now()>=e.createTime+6048e5?f2i(t,{ - token:e.token,createTime:Date.now(),subscriptionOptions:s} - ):e.token; - try{ - await o2i(t.firebaseDependencies,e.token)} - catch(frt){ - } - return p2i(t.firebaseDependencies,s)} - return p2i(t.firebaseDependencies,s)} - async function d2i(t){ - const i=await t2i(t.firebaseDependencies); - i&&(await o2i(t.firebaseDependencies,i.token),await s2i(t.firebaseDependencies)); - const s=await t.swRegistration.pushManager.getSubscription(); - return!s||s.unsubscribe()} - async function f2i(t,i){ - try{ - const s=await r2i(t.firebaseDependencies,i),e={ - ...i,token:s,createTime:Date.now()} - ; - return await i2i(t.firebaseDependencies,e),s} - catch(frt){ - throw frt} - } - async function p2i(t,i){ - const s={ - token:await h2i(t,i),createTime:Date.now(),subscriptionOptions:i} - ; - return await i2i(t,s),s.token} - async function w2i(t,i){ - return await t.pushManager.getSubscription()||t.pushManager.subscribe({ - userVisibleOnly:!0,applicationServerKey:K1i(i)} - )} - function g2i(t,i){ - const s=i.vapidKey===t.vapidKey,e=i.endpoint===t.endpoint,n=i.auth===t.auth,h=i.p256dh===t.p256dh; - return s&&e&&n&&h} - function m2i(t){ - const i={ - from:t.from,collapseKey:t.collapse_key,messageId:t.fcmMessageId} - ; - return v2i(i,t),_2i(i,t),M2i(i,t),i} - function v2i(t,i){ - if(!i.notification)return; - t.notification={ - } - ; - const s=i.notification.title; - s&&(t.notification.title=s); - const e=i.notification.body; - e&&(t.notification.body=e); - const n=i.notification.image; - n&&(t.notification.image=n); - const h=i.notification.icon; - h&&(t.notification.icon=h)} - function _2i(t,i){ - i.data&&(t.data=i.data)} - function M2i(t,i){ - var s,e,n,h; - if(!i.fcmOptions&&!(null==(s=i.notification)?void 0:s.click_action))return; - t.fcmOptions={ - } - ; - const r=(null==(e=i.fcmOptions)?void 0:e.link)??(null==(n=i.notification)?void 0:n.click_action); - r&&(t.fcmOptions.link=r); - const o=null==(h=i.fcmOptions)?void 0:h.analytics_label; - o&&(t.fcmOptions.analyticsLabel=o)} - function b2i(t){ - return"object"==typeof t&&!!t&&$1i in t} - function y2i(t){ - if(!t||!t.options)throw E2i("App Configuration Object"); - if(!t.name)throw E2i("App Name"); - const i=["projectId","apiKey","appId","messagingSenderId"],{ - options:s} - =t; - for(const e of i)if(!s[e])throw E2i(e); - return{ - appName:t.name,projectId:s.projectId,apiKey:s.apiKey,appId:s.appId,senderId:s.messagingSenderId} - } - function E2i(t){ - return n2i.create("missing-app-config-values",{ - valueName:t} - )} - Qt(h2i,"requestGetToken"),Qt(r2i,"requestUpdateToken"),Qt(o2i,"requestDeleteToken"),Qt(a2i,"getEndpoint"),Qt(c2i,"getHeaders"),Qt(l2i,"getBody"),Qt(u2i,"getTokenInternal"),Qt(d2i,"deleteTokenInternal"),Qt(f2i,"updateToken"),Qt(p2i,"getNewToken"),Qt(w2i,"getPushSubscription"),Qt(g2i,"isTokenValid"),Qt(m2i,"externalizePayload"),Qt(v2i,"propagateNotificationPayload"),Qt(_2i,"propagateDataPayload"),Qt(M2i,"propagateFcmOptions"),Qt(b2i,"isConsoleMessage"),Qt(y2i,"extractAppConfig"),Qt(E2i,"getMissingValueError"); - const A2i=class{ - constructor(t,i,s){ - this.deliveryMetricsExportedToBigQueryEnabled=!1,this.onBackgroundMessageHandler=null,this.onMessageHandler=null,this.logEvents=[],this.isLogServiceStarted=!1; - const e=y2i(t); - this.firebaseDependencies={ - app:t,appConfig:e,installations:i,analyticsProvider:s} - } - _delete(){ - return Promise.resolve()} - } - ; - Qt(A2i,"MessagingService"); - let S2i=A2i; - async function T2i(t){ - try{ - t.swRegistration=await navigator.serviceWorker.register("/firebase-messaging-sw.js",{ - scope:"/firebase-cloud-messaging-push-scope"} - ),t.swRegistration.update().catch(()=>{ - } - ),await C2i(t.swRegistration)} - catch(frt){ - throw n2i.create("failed-service-worker-registration",{ - browserErrorMessage:null==frt?void 0:frt.message} - )} - } - async function C2i(t){ - return new Promise((i,s)=>{ - const e=setTimeout(()=>s(new Error("Service worker not registered after 10000 ms")),1e4),n=t.installing||t.waiting; - t.active?(clearTimeout(e),i()):n?n.onstatechange=t=>{ - var s; - "activated"===(null==(s=t.target)?void 0:s.state)&&(n.onstatechange=null,clearTimeout(e),i())} - :(clearTimeout(e),s(new Error("No incoming service worker found.")))} - )} - async function O2i(t,i){ - if(i||t.swRegistration||await T2i(t),i||!t.swRegistration){ - if(!(i instanceof ServiceWorkerRegistration))throw n2i.create("invalid-sw-registration"); - t.swRegistration=i} - } - async function I2i(t,i){ - i?t.vapidKey=i:t.vapidKey||(t.vapidKey=F1i)} - async function k2i(t,i){ - if(!navigator)throw n2i.create("only-available-in-window"); - if("default"===Notification.permission&&await Notification.requestPermission(),"granted"!==Notification.permission)throw n2i.create("permission-blocked"); - return await I2i(t,null==i?void 0:i.vapidKey),await O2i(t,null==i?void 0:i.serviceWorkerRegistration),u2i(t)} - async function x2i(t,i,s){ - const e=R2i(i); - (await t.firebaseDependencies.analyticsProvider.get()).logEvent(e,{ - message_id:s[$1i],message_name:s["google.c.a.c_l"],message_time:s["google.c.a.ts"],message_device_time:Math.floor(Date.now()/1e3)} - )} - function R2i(t){ - switch(t){ - case V1i.NOTIFICATION_CLICKED:return"notification_open"; - case V1i.PUSH_RECEIVED:return"notification_foreground"; - default:throw new Error} - } - async function P2i(t,i){ - const s=i.data; - if(!s.isFirebaseMessaging)return; - t.onMessageHandler&&s.messageType===V1i.PUSH_RECEIVED&&("function"==typeof t.onMessageHandler?t.onMessageHandler(m2i(s)):t.onMessageHandler.next(m2i(s))); - const e=s.data; - b2i(e)&&"1"===e["google.c.a.e"]&&await x2i(t,s.messageType,e)} - Qt(T2i,"registerDefaultSw"),Qt(C2i,"waitForRegistrationActive"),Qt(O2i,"updateSwReg"),Qt(I2i,"updateVapidKey"),Qt(k2i,"getToken$1"),Qt(x2i,"logToScion"),Qt(R2i,"getEventType"),Qt(P2i,"messageEventListener"); - const N2i="@firebase/messaging",L2i="0.12.25",D2i=Qt(t=>{ - const i=new S2i(t.getProvider("app").getImmediate(),t.getProvider("installations-internal").getImmediate(),t.getProvider("analytics-internal")); - return navigator.serviceWorker.addEventListener("message",t=>P2i(i,t)),i} - ,"WindowMessagingFactory"),G2i=Qt(t=>{ - const i=t.getProvider("messaging").getImmediate(); - return{ - getToken:Qt(t=>k2i(i,t),"getToken")} - } - ,"WindowMessagingInternalFactory"); - function B2i(){ - Tzi(new sKi("messaging",D2i,"PUBLIC")),Tzi(new sKi("messaging-internal",G2i,"PRIVATE")),Lzi(N2i,L2i),Lzi(N2i,L2i,"esm2020")} - async function U2i(){ - try{ - await Pji()} - catch(frt){ - return!1} - return"undefined"!=typeof window&&Rji()&&Nji()&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")} - async function F2i(t){ - if(!navigator)throw n2i.create("only-available-in-window"); - return t.swRegistration||await T2i(t),d2i(t)} - function $2i(t,i){ - if(!navigator)throw n2i.create("only-available-in-window"); - return t.onMessageHandler=i,()=>{ - t.onMessageHandler=null} - } - function H2i(t=Nzi()){ - return U2i().then(t=>{ - if(!t)throw n2i.create("unsupported-browser")} - ,t=>{ - throw n2i.create("indexed-db-unsupported")} - ),Czi(Qji(t),"messaging").getImmediate()} - async function W2i(t,i){ - return k2i(t=Qji(t),i)} - function V2i(t){ - return F2i(t=Qji(t))} - function j2i(t,i){ - return $2i(t=Qji(t),i)} - Qt(B2i,"registerMessagingInWindow"),Qt(U2i,"isWindowSupported"),Qt(F2i,"deleteToken$1"),Qt($2i,"onMessage$1"),Qt(H2i,"getMessagingInWindow"),Qt(W2i,"getToken"),Qt(V2i,"deleteToken"),Qt(j2i,"onMessage"),B2i(); - const K2i=class t extends KKt{ - constructor(){ - super(),U2i().then(t=>{ - t&&j2i(H2i(),t=>this.handleNotificationReceived(t))} - )} - async checkPermissions(){ - return await U2i()?{ - receive:this.convertNotificationPermissionToPermissionState(Notification.permission)} - :{ - receive:"denied"} - } - async requestPermissions(){ - if(!(await U2i()))return{ - receive:"denied"} - ; - const t=await Notification.requestPermission(); - return{ - receive:this.convertNotificationPermissionToPermissionState(t)} - } - async isSupported(){ - return{ - isSupported:await U2i()} - } - async getToken(t){ - const i=H2i(); - return{ - token:await W2i(i,{ - vapidKey:t.vapidKey,serviceWorkerRegistration:t.serviceWorkerRegistration} - )} - } - async deleteToken(){ - const t=H2i(); - await V2i(t)} - async getDeliveredNotifications(){ - this.throwUnimplementedError()} - async removeDeliveredNotifications(t){ - this.throwUnimplementedError()} - async removeAllDeliveredNotifications(){ - this.throwUnimplementedError()} - async subscribeToTopic(t){ - this.throwUnimplementedError()} - async unsubscribeFromTopic(t){ - this.throwUnimplementedError()} - async createChannel(t){ - this.throwUnimplementedError()} - async deleteChannel(t){ - this.throwUnimplementedError()} - async listChannels(){ - this.throwUnimplementedError()} - handleNotificationReceived(i){ - const s={ - notification:this.createNotificationResult(i)} - ; - this.notifyListeners(t.notificationReceivedEvent,s)} - createNotificationResult(t){ - var i,s,e; - return{ - body:null===(i=t.notification)||void 0===i?void 0:i.body,data:t.data,id:t.messageId,image:null===(s=t.notification)||void 0===s?void 0:s.image,title:null===(e=t.notification)||void 0===e?void 0:e.title} - } - convertNotificationPermissionToPermissionState(t){ - let i="prompt"; - switch(t){ - case"granted":i="granted"; - break; - case"denied":i="denied"} - return i} - throwUnimplementedError(){ - throw this.unimplemented("Not implemented on web.")} - } - ; - Qt(K2i,"FirebaseMessagingWeb"); - let z2i=K2i; - z2i.notificationReceivedEvent="notificationReceived"; - const Y2i=Object.freeze(Object.defineProperty({ - __proto__:null,FirebaseMessagingWeb:z2i} - ,Symbol.toStringTag,{ - value:"Module"} - )); - var q2i,X2i,J2i,Q2i; - (X2i=q2i||(q2i={ - } - )).Heavy="HEAVY",X2i.Medium="MEDIUM",X2i.Light="LIGHT",(Q2i=J2i||(J2i={ - } - )).Success="SUCCESS",Q2i.Warning="WARNING",Q2i.Error="ERROR"; - const Z2i=VKt("Haptics",{ - web:Qt(()=>ei(()=>Promise.resolve().then(()=>Q3i),void 0).then(t=>new t.HapticsWeb),"web")} - ),t5i=Object.freeze(Object.defineProperty({ - __proto__:null,Haptics:Z2i,get ImpactStyle(){ - return q2i} - ,get NotificationType(){ - return J2i} - } - ,Symbol.toStringTag,{ - value:"Module"} - )),i5i=class extends KKt{ - async requestIntegrityToken(t){ - if(!t.nonce)throw new Error("Nonce must be specified"); - return{ - token:""} - } - } - ; - Qt(i5i,"CapacitorPlayIntegrityWeb"); - let s5i=i5i; - const e5i=Object.freeze(Object.defineProperty({ - __proto__:null,CapacitorPlayIntegrityWeb:s5i} - ,Symbol.toStringTag,{ - value:"Module"} - )),n5i=class extends KKt{ - constructor(){ - super(),this._lastWindow=null} - async open(t){ - this._lastWindow=window.open(t.url,t.windowName||"_blank")} - async close(){ - return new Promise((t,i)=>{ - null!=this._lastWindow?(this._lastWindow.close(),this._lastWindow=null,t()):i("No active window to close!")} - )} - } - ; - Qt(n5i,"BrowserWeb"); - let h5i=n5i; - const r5i=new h5i,o5i=Object.freeze(Object.defineProperty({ - __proto__:null,Browser:r5i,BrowserWeb:h5i} - ,Symbol.toStringTag,{ - value:"Module"} - )),a5i=class extends pB{ - constructor(){ - super(),Zt(this,"tabId","battle"),Zt(this,"canCloseShell",Qt(()=>!0,"canCloseShell")),this.width=616,this.bg.visible=this.txtTitle.visible=this.btnClose.visible=!1} - set height(t){ - super.height=lyi.layoutHeight-lyi.FOOTER_HEIGHT,this.pivot.set(0)} - get height(){ - return super.height} - drawPanel(){ - this.pivot.set(0),this.parent&&lyi.getInstance().refresh()} - show(){ - lyi.getInstance().present(this)} - hide(){ - this.hideImmediately()} - hideImmediately(){ - if(lyi.getInstance().detach(this),this.hideHandler){ - const t=this.hideHandler; - this.hideHandler=null,t()} - } - onCloseBtnClick(){ - lyi.getInstance().requestExit()} - onBackButton(){ - return this.onCloseBtnClick(),!0} - } - ; - Qt(a5i,"MiniAscentModalPopup"); - let c5i=a5i; - const l5i=class extends nB{ - constructor(t,i=16777215){ - super(t),Zt(this,"skin"),this.skinTint=i,this.skin=new hE({ - texture:Cbi.texture("ui_button_lobby_blank"),leftWidth:22,rightWidth:22,topHeight:18,bottomHeight:18} - ),this.bg.visible=!1,this.container.addChildAt(this.skin,0),this.activatedTextColor=16771e3,this.syncSkin()} - syncSkin(){ - this.skin&&(this.skin.width=this.bg.width,this.skin.height=this.bg.height,this.skin.position.copyFrom(this.bg.position),this.skin.tint=this.activated?this.skinTint:8947848)} - set width(t){ - super.width=t,this.syncSkin()} - get width(){ - return super.width} - set height(t){ - super.height=t,this.syncSkin()} - get height(){ - return super.height} - set activated(t){ - super.activated=t,this.syncSkin()} - get activated(){ - return super.activated} - } - ; - Qt(l5i,"MiniAscentImageButton"); - let u5i=l5i; - const d5i=class t extends c5i{ - constructor(){ - super(),Zt(this,"tabId","battle"),Zt(this,"body",new Ke),Zt(this,"busy",!1),this.contentContainer.addChild(this.body),this.canCloseShell=()=>!this.busy} - static getInstance(){ - return this.instance??(this.instance=new t)} - show(){ - this.height=876,this.render(),super.show()} - render(){ - for(const w of this.body.removeChildren())w.destroy({ - children:!0} - ); - this.body.scale.set(1),this.body.position.set(0); - const t=ryi.getInstance().run,i=null==t?void 0:t.cardRewards,s=null==i?void 0:i.current,e=Qt((t,i,s,e=Hbi.text,n=520)=>{ - const h=new iG(t,e,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:s,lineHeight:s+6} - ); - return h.align="center",h.setWrapWidth(n),h.position.set((616-h.width)/2,i),this.body.addChild(h),h} - ,"center"),n=e(Bbi("CARDS_CURRENT"),142,26,Hbi.accent); - if(!s)return void e(Bbi((null==i?void 0:i.total)?"CARDS_ALL_CLAIMED":"CARDS_EMPTY"),n.y+n.height+48,20,Hbi.muted); - const h=n.y+n.height+28,r=new ep; - this.body.addChild(r); - const o=e(`${ - i.claimed+1} - / ${ - i.total} - `,h+28,40,Hbi.accent),a=e(Bbi("CARDS_WAVE",s.floor),o.y+o.height+12,18),c=e(Bbi("CARDS_SEQUENTIAL_RULES"),a.y+a.height+28,17,Hbi.muted,456),l=c.y+c.height+32; - r.roundRect(40,h,536,l+82-h,16).fill(Hbi.surface).stroke({ - color:Hbi.border,width:1.5} - ); - const u=new u5i(Bbi(s.revealed?"CARDS_CHOOSE":"CARDS_RECEIVE")); - u.width=320,u.height=54,u.position.set(148,l),u.activated=!this.busy&&!(null==t?void 0:t.battlePending),u.onClick=()=>{ - this.busy||(null==t?void 0:t.battlePending)||(this.busy=!0,u.activated=!1,Syi.openCardPick(s.id).catch(t=>bH.getInstance().showMessage(t.message)).finally(()=>{ - this.busy=!1,this.parent&&this.render()} - ))} - ,this.body.addChild(u); - const d=e(Bbi("CARDS_RULES"),l+106,15,Hbi.muted),f=d.y+d.height+24,p=Math.min(1,(this.height-150)/Math.max(1,f-142)); - this.body.scale.set(p),this.body.position.set(308*(1-p),142*(1-p))} - } - ; - Qt(d5i,"MiniAscentCardsPage"),Zt(d5i,"instance"); - let f5i=d5i; - const p5i=Object.freeze(Object.defineProperty({ - __proto__:null,MiniAscentCardsPage:f5i} - ,Symbol.toStringTag,{ - value:"Module"} - )); - function w5i(t){ - const i=Qt((t,i)=>NB.getText(t,i),"text"); - switch(t.type){ - case"gem":return i("COMMON_350","보석"); - case"honorCoin":return i("GAME_88","명예코인"); - case"runeTicket":return i("GAME_1500","크리스탈 뽑기권"); - case"pet":return`${ - i(`PET_NAME_${ - t.kindNum} - `,"")} - ${ - i("GAME_736","조각")} - `.trim(); - case"trans":return"treasure"===t.subType?i("GAME_1224","유물 초월권"):i("GAME_1223","영웅 초월권"); - case"ticket":return"heroGacha"===t.subType?i("GAME_764","5성 영웅 확정권"):"heroSelect"===t.subType?i("GAME_769","영웅 선택권"):"pet"===t.subType?i("GAME_772","정령의 고원 입장권"):t.subType??t.type; - default:return t.type} - } - Qt(w5i,"shopProductName"); - const g5i=class t extends kx{ - constructor(){ - super(),Zt(this,"reward",new M4),Zt(this,"productName",new iG("",Hbi.text,hD.DEFAULT_FONT_OPTION_16)),Zt(this,"limit",new iG("",Hbi.muted,hD.DEFAULT_FONT_OPTION_16)),Zt(this,"sealIcon",new Xe(Cbi.texture("ui_challenge_seal"))),Zt(this,"price",new iG("",Hbi.text,hD.DEFAULT_FONT_OPTION_16)),Zt(this,"buy",new u5i(Bbi("EVENT_SHOP_BUY"))); - const{ - W:i,H:s,BUTTON_W:e,BUTTON_H:n,TEXT_X:h} - =t,r=(new ep).roundRect(1,1,i-2,s-2,12).fill(Hbi.surface).stroke({ - color:Hbi.border,width:1} - ); - r.eventMode="none",this.reward.scale.set(1.2),this.productName.textSize=18,this.productName.position.set(h,20),this.limit.textSize=18,this.limit.position.set(h,20),this.sealIcon.width=this.sealIcon.height=22,this.sealIcon.position.set(h+2,54),this.price.textSize=18,this.price.position.set(h+32,52),this.buy.width=e,this.buy.height=n,this.buy.position.set(i-e-16,(s-n)/2),this.buy.onClick=()=>{ - const t=this.data; - t&&this.buy.activated&&t.onBuy(t.item)} - ,this.addChild(r,this.reward,this.productName,this.limit,this.sealIcon,this.price,this.buy)} - get width(){ - return t.W} - get height(){ - return t.H} - setData(i){ - const s=i; - if(!s)return; - this.data=s,this.reward.setDataFrom(s.item.reward); - const e=this.reward.frameBounds,n=this.reward.scale; - this.reward.position.set(16+(64*n.x-e.width*n.x)/2-e.x*n.x,(t.H-e.height*n.y)/2-e.y*n.y),this.limit.text=Bbi("EVENT_SHOP_LIMIT",s.item.purchased,s.item.limit),this.productName.text=w5i(s.item.reward); - const h=t.TEXT_W-this.limit.width-8; - this.productName.scale.set(1),this.productName.scale.set(Math.min(1,h/Math.max(1,this.productName.width))),this.limit.x=this.productName.x+this.productName.width+8,this.price.text=String(s.item.price),this.buy.activated=!s.busy&&s.item.purchased<s.item.limit&&s.seals>=s.item.price} - } - ; - Qt(g5i,"MiniAscentShopItemRenderer"),Zt(g5i,"W",552),Zt(g5i,"H",96),Zt(g5i,"BUTTON_W",140),Zt(g5i,"BUTTON_H",58),Zt(g5i,"TEXT_X",116),Zt(g5i,"TEXT_W",g5i.W-g5i.BUTTON_W-32-g5i.TEXT_X); - let m5i=g5i; - const v5i=class t extends c5i{ - constructor(){ - super(),Zt(this,"tabId","shop"),Zt(this,"heading",new iG(Bbi("SHOP"),Hbi.text,hD.DEFAULT_FONT_OPTION_16)),Zt(this,"hint",new iG(Bbi("EVENT_SHOP_HINT"),Hbi.text,hD.DEFAULT_FONT_OPTION_16)),Zt(this,"message",new iG("",Hbi.text,hD.DEFAULT_FONT_OPTION_16)),Zt(this,"reload",new u5i(Bbi("RELIC_RELOAD"))),Zt(this,"list",new Ox(m5i,m5i.W,m5i.H,t.ROW_GAP)),Zt(this,"rows",[]),Zt(this,"data",null),Zt(this,"busy",!1),this.canCloseShell=()=>!this.busy,this.heading.textSize=26,this.hint.setWrapWidth(536),this.message.setWrapWidth(496),this.reload.width=260,this.reload.height=46,this.reload.onClick=()=>{ - this.busy||this.load(!0)} - ,this.list.x=t.LIST_X,this.contentContainer.addChild(this.heading,this.hint,this.message,this.reload,this.list)} - static getInstance(){ - return this.instance??(this.instance=new t)} - show(){ - this.height=876,this.layout(),this.render(),super.show(),this.load()} - layout(){ - this.heading.position.set((this.width-this.heading.width)/2,140),this.hint.position.set(40,188); - const t=this.hint.y+this.hint.height+24; - this.list.y=t,this.list.setListHeight(Math.max(m5i.H,this.height-t-12),!1),this.message.position.set(60,t+55),this.reload.position.set((this.width-this.reload.width)/2,t+150)} - setBusy(t){ - this.busy=t,this.render(),this.parent&&lyi.getInstance().refresh()} - async load(t=!1){ - this.setBusy(!0); - try{ - this.data=await ryi.getInstance().fetchEventShop(t)} - catch(frt){ - bH.getInstance().showMessage(frt.message)} - finally{ - this.setBusy(!1)} - } - render(){ - var t; - const i=(null==(t=this.data)?void 0:t.eventShop.items)??[],s=!i.length; - if(this.message.visible=this.reload.visible=s,this.list.visible=!s,s)return this.message.text=Bbi(this.data?"EVENT_SHOP_EMPTY":"RELIC_LOADING"),void(this.reload.activated=!this.busy); - const e=this.data.season.seals??this.data.season.coin; - this.rows.length===i.length&&this.rows.every((t,s)=>t.item.kindNum===i[s].kindNum)?(this.rows.forEach((t,s)=>{ - t.item=i[s],t.seals=e,t.busy=this.busy} - ),this.list.updateItemData()):(this.rows=i.map(t=>({ - item:t,seals:e,busy:this.busy,onBuy:Qt(t=>{ - this.buy(t)} - ,"onBuy")} - )),this.list.dataProvider=this.rows,this.list.showTopItem())} - async buy(t){ - if(!this.busy&&this.data){ - this.setBusy(!0); - try{ - this.data=await ryi.getInstance().buyEventShop(this.data.eventShop.revision,t),bH.getInstance().showMessage(Bbi("EVENT_SHOP_DELIVERED"))} - catch(frt){ - bH.getInstance().showMessage(frt.message); - try{ - this.data=await ryi.getInstance().fetchEventShop(!0)} - catch{ - } - } - finally{ - this.setBusy(!1)} - } - } - } - ; - Qt(v5i,"MiniAscentEventShopPage"),Zt(v5i,"instance"),Zt(v5i,"LIST_X",32),Zt(v5i,"ROW_GAP",6); - let _5i=v5i; - const M5i=Object.freeze(Object.defineProperty({ - __proto__:null,MiniAscentEventShopPage:_5i} - ,Symbol.toStringTag,{ - value:"Module"} - )); - function b5i(t){ - const i=iR.getInstance().getBookVO(t); - return NB.getText(`UNIT_NAME_${ - t} - `,(null==i?void 0:i.name)??String(t))} - function y5i(t){ - if(0===t.heroStage)return t.heroKind; - const i=iR.getInstance().getBookVO(t.heroKind); - return i&&i.evolKindNum>0?i.evolKindNum:t.heroKind} - function E5i(t){ - return[NB.getText("GAME_1825","5성"),NB.getText("GAME_1826","6성"),NB.getText("GAME_1827","6성 1◆"),NB.getText("GAME_1828","6성 2◆"),NB.getText("GAME_1829","6성 3◆")][t]??""} - function A5i(t){ - return[NB.getText("EmblemGradeName1","일반"),NB.getText("GAME_67","진화"),NB.getText("GAME_1830","1◆"),NB.getText("GAME_1831","2◆"),NB.getText("GAME_1832","3◆")][t]??""} - function S5i(t){ - return Bbi("DEPTH",t)} - function T5i(t){ - return Bbi("epic"===t.rarity?"CARD_EPIC":"rare"===t.rarity?"CARD_RARE":"CARD_NORMAL")} - function C5i(t,i){ - if(!i)return[]; - if("heroUp"===t.type)return i.heroStage<4?[i.heroStage]:[]; - if("soldierUp"!==t.type&&"soldierAllUp"!==t.type)return[]; - let s="soldierAllUp"===t.type?1/0:t.amount??3; - const e=[]; - for(let n=0; - n<4&&s>0; - n++){ - const t=Math.min(s,i.counts[n]); - t<=0||(e.push(n),s-=t)} - return e} - function O5i(t,i){ - return C5i(t,i).map(t=>0===t?NB.getText("GAME_67","진화"):Bbi("CARD_TRANSCEND",t)).join(" · ")} - function I5i(t,i){ - if(!i)return""; - const s=iR.getInstance(),e=s.getBookVO("heroUp"===t.type?i.heroKind:i.soldierKind),n=e&&e.evolKindNum>0?s.getBookVO(e.evolKindNum):void 0,h=Qt(t=>{ - const i=0===t?null==e?void 0:e.grade:null==n?void 0:n.grade,s=void 0!==i?`${ - i} - ★`:""; - return t>1?[s,Bbi("CARD_TRANSCEND",t-1)].filter(Boolean).join(" "):s||A5i(t)} - ,"stageLabel"); - return C5i(t,i).map(t=>`${ - h(t)} - → ${ - h(t+1)} - `).join("\n")} - function k5i(t,i){ - const s=O5i(t,i[t.corp]); - return{ - armyLevel:Bbi("CARD_ARMY_LEVEL_UP"),armyBuff:x5i(t),soldierAllUp:Bbi("CARD_SOLDIER_UPGRADE",s),soldierChange:Bbi("CARD_SOLDIER_CHANGE"),soldierAdd:Bbi("CARD_SOLDIER_ADD"),dualSoldier:Bbi("CARD_SOLDIER_ADD"),legionLevel:Bbi("CARD_LEGION_LEVEL_UP"),dualLevel:Bbi("CARD_LEGION_LEVEL_UP"),heroLevel:Bbi("CARD_HERO_LEVEL_UP"),soldierLevel:Bbi("CARD_SOLDIER_LEVEL_UP"),heroUp:Bbi("CARD_HERO_UPGRADE",s),soldierUp:Bbi("CARD_SOLDIER_UPGRADE",s),newHero:Bbi("CARD_RECRUIT"),tactic:`${ - Bbi("assault"===t.tactic?"ASSAULT":"GUARD")} - ${ - t.tacticLevel??1} - `} - [t.type]} - function x5i(t){ - return Bbi({ - attackSpeedPct:"ARMY_ATK_SPEED",moveSpeedPct:"ARMY_MOVE_SPEED",attackRangePct:"ARMY_RANGE",attackPct:"ARMY_ATTACK",hpPct:"ARMY_HP"} - [t.buffStat??"attackPct"])} - function R5i(t){ - if("newHero"===t.type)return[]; - const i=[...new Set([t.corp,...void 0!==t.partner?[t.partner]:[]])]; - return["armyLevel"===t.type||"armyBuff"===t.type?Bbi("ARMY_ALL"):Bbi("LEGION",i.map(t=>t+1).join("·")),Bbi({ - armyLevel:"CARD_TARGET_BOTH",armyBuff:"CARD_TARGET_BOTH",legionLevel:"CARD_TARGET_BOTH",dualLevel:"CARD_TARGET_BOTH",tactic:"CARD_TARGET_BOTH",heroLevel:"HERO",heroUp:"HERO",soldierLevel:"SOLDIERS",soldierUp:"SOLDIERS",soldierAllUp:"SOLDIERS",soldierAdd:"SOLDIERS",dualSoldier:"SOLDIERS",soldierChange:"SOLDIERS"} - [t.type])]} - function P5i(t,i){ - var s; - switch(t.type){ - case"soldierChange":return`${ - b5i((null==(s=i[t.corp])?void 0:s.soldierKind)??0)} - → ${ - b5i(t.soldierKind??0)} - `; - case"armyLevel":return`+${ - t.amount} - Lv`; - case"armyBuff":return`+${ - t.amount} - %`; - case"soldierAllUp":case"heroUp":case"soldierUp":return I5i(t,i[t.corp]); - case"dualLevel":case"legionLevel":return`+${ - t.amount??0} - Lv`; - case"dualSoldier":return`+${ - t.amount??0} - `; - case"tactic":return`${ - "assault"===t.tactic?"+":"−"} - ${ - t.tacticMaxPercent??0} - %`; - case"heroLevel":case"soldierLevel":return`+${ - t.amount??6} - Lv`; - case"newHero":return"NEW!"; - case"soldierAdd":return`+${ - t.amount??3} - `} - } - function N5i(t,i){ - const s=i[t.corp]; - switch(t.type){ - case"soldierChange":return Bbi("CARD_SOLDIER_CHANGE_KEEP"); - case"armyLevel":case"armyBuff":case"legionLevel":case"heroLevel":case"soldierLevel":case"soldierAdd":case"heroUp":return""; - case"soldierAllUp":return Bbi("CARD_ALL_SOLDIERS_UP"); - case"dualLevel":case"dualSoldier":return Bbi("CARD_EACH"); - case"tactic":return["assault"===t.tactic?NB.getText("GAME_19","공격력"):Bbi("CARD_DAMAGE_TAKEN"),Bbi("DUAL_LEVEL",t.amount)].join("\n"); - case"soldierUp":return Bbi("CARD_SOLDIER_COUNT",Math.min(t.amount??3,s.counts.slice(0,4).reduce((t,i)=>t+i,0))); - case"newHero":return[b5i(t.heroKind??0),...(t.soldierKind??0)>0&&(t.amount??0)>0?[`${ - b5i(t.soldierKind)} - ×${ - t.amount} - `]:[]].join("\n")} - } - function L5i(t){ - return"tactic"!==t.type?"":Bbi("TACTIC_REQUIRE_BODY",(t.tacticSoldierStep??5)*(t.tacticLevel??1),(t.tacticLevelStep??5)*(t.tacticLevel??1))} - function D5i(t){ - return t.map(t=>`${ - cAi.getRewardName(t.type)} - ${ - t.amount} - `).join(", ")} - Qt(b5i,"unitName"),Qt(y5i,"heroIconKind"),Qt(E5i,"heroStageLabel"),Qt(A5i,"soldierStageLabel"),Qt(S5i,"floorText"),Qt(T5i,"cardRarityLabel"),Qt(C5i,"cardUpgradeStages"),Qt(O5i,"cardUpgradeHeading"),Qt(I5i,"cardUpgradeTransition"),Qt(k5i,"cardHeading"),Qt(x5i,"armyBuffName"),Qt(R5i,"cardTags"),Qt(P5i,"cardTitle"),Qt(N5i,"cardDesc"),Qt(L5i,"cardRequirements"),Qt(D5i,"rewardsText"); - const G5i=class t extends Ke{ - constructor(){ - super(),Zt(this,"dividers",new ep),Zt(this,"rows",[]),Zt(this,"visibleRows",4),this.eventMode="none",this.addChild(this.dividers),[Bbi("HERO"),Bbi("TIER_NORMAL"),Bbi("TIER_EVOLVED"),...[1,2,3].map(t=>Bbi("TIER_TRANS",t))].forEach((i,s)=>{ - const e=this.makeLabel(i,13,Hbi.text),n=0===s?t.HERO_W:t.SOLDIER_W,h=0===s?t.HERO_X:this.soldierX(s-1); - e.scale.set(Math.min(1,(n-2)/e.width)),e.position.set(h+(n-e.width)/2,12),this.addChild(e)} - ); - for(let i=0; - i<5; - i++){ - const s=new Ke; - s.y=t.HEADER_H+i*t.ROW_H; - const e=this.makeLabel(Bbi("LEGION",i+1),15,Hbi.text); - e.scale.set(Math.min(1,64/e.width)),e.position.set((64-e.width)/2,(t.ROW_H-e.height)/2),s.addChild(e); - const n=this.unitView(); - n.root.position.set(t.HERO_X,6),s.addChild(n.root); - const h=Array.from({ - length:5} - ,()=>this.unitView()); - for(const t of h)s.addChild(t.root); - const r=this.makeLabel("—",18,Hbi.subtle); - r.position.set(102,38),s.addChild(r),this.addChild(s),this.rows.push({ - root:s,hero:n,soldiers:h,empty:r} - )} - this.setData(null)} - soldierX(i){ - return t.SOLDIER_X+i*(t.SOLDIER_W+t.COLUMN_GAP)} - makeLabel(t,i,s){ - return new iG(t,s,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:i,lineHeight:i+4} - )} - unitView(){ - const t=new Ke,i=new c4,s=this.makeLabel("",14,Hbi.text),e=new iG("",16777215,{ - ...hD.DEFAULT_OUTLINE_FONT_OPTION_16,fontSize:16,lineHeight:20} - ); - return t.addChild(i,e,s),{ - root:t,icon:i,count:e,level:s} - } - setUnit(t,i,s,e,n,h){ - t.root.visible=!0; - const r=0===h; - t.icon.active=!r,t.level.alpha=r?.45:1,t.count.textColor=r?Hbi.subtle:16777215,t.icon.scale.set(1),t.icon.setDataWithKindNum(i,s),t.icon.scale.set(Math.min(n/t.icon.width,54/t.icon.height)),t.icon.position.set((n-t.icon.width)/2,54-t.icon.height),t.level.text=`Lv.${ - e} - `,t.level.textSize=n<68?12:14,t.level.scale.set(1),t.level.scale.set(Math.min(1,n/t.level.width)),t.level.position.set((n-t.level.width)/2-(void 0!==h?8:7),56),t.count.visible=void 0!==h,void 0!==h&&(t.count.text=`×${ - h} - `,t.count.scale.set(1),t.count.position.set(n-t.count.width-16,54-t.count.height-1))} - setData(i){ - this.visibleRows=Math.min(5,Math.max(4,(null==i?void 0:i.length)??4)),this.dividers.clear(); - for(let s=1; - s<this.visibleRows; - s++){ - const i=t.HEADER_H+s*t.ROW_H; - this.dividers.moveTo(16,i).lineTo(t.WIDTH-16,i).stroke({ - color:Hbi.border,alpha:.32,width:1} - )} - this.rows.forEach((s,e)=>{ - var n; - const h=null==i?void 0:i[e]; - s.root.visible=e<this.visibleRows,s.hero.root.visible=!!h,s.empty.visible=!h; - for(const t of s.soldiers)t.root.visible=!1; - if(!h)return; - this.setUnit(s.hero,y5i(h),Math.max(0,h.heroStage-1),h.heroLevel??10,t.HERO_W); - const r=(null==(n=iR.getInstance().getBookVO(h.soldierKind))?void 0:n.evolKindNum)??0; - Xbi(h,r).forEach((i,e)=>{ - const n=s.soldiers[e]; - n.root.position.set(this.soldierX(e),6),this.setUnit(n,i.kindNum,i.trans,h.soldierLevel??10,t.SOLDIER_W,i.count)} - )} - )} - get panelHeight(){ - return t.HEADER_H+this.visibleRows*t.ROW_H+6} - } - ; - Qt(G5i,"MiniAscentCorpsPanel"),Zt(G5i,"WIDTH",552),Zt(G5i,"ROW_H",92),Zt(G5i,"HEADER_H",34),Zt(G5i,"HERO_X",72),Zt(G5i,"HERO_W",76),Zt(G5i,"SOLDIER_X",176),Zt(G5i,"SOLDIER_W",68),Zt(G5i,"COLUMN_GAP",6); - let B5i=G5i; - const U5i=class t extends c5i{ - constructor(){ - super(),Zt(this,"tabId","corps"),Zt(this,"corps",new B5i),Zt(this,"heading",new iG(Bbi("MY_CORPS"),Hbi.accent,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:22,lineHeight:28} - )),Zt(this,"empty",new iG(Bbi("EMPTY_CORPS"),Hbi.muted,hD.DEFAULT_FONT_OPTION_16)),Zt(this,"buffs",new iG("",Hbi.accent,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:14,lineHeight:19} - )),this.empty.setWrapWidth(500),this.empty.align="center",this.contentContainer.addChild(this.heading,this.corps,this.empty,this.buffs)} - static getInstance(){ - return this.instance??(this.instance=new t)} - show(){ - this.height=876,this.render(),super.show()} - render(){ - const t=ryi.getInstance().run; - this.heading.position.set((this.width-this.heading.width)/2,138),this.corps.setData((null==t?void 0:t.corps)??null),this.corps.visible=!!t,this.buffs.text=["attackSpeedPct","moveSpeedPct","attackRangePct","attackPct","hpPct"].filter(i=>{ - var s; - return((null==(s=null==t?void 0:t.shopBuffs)?void 0:s[i])??0)>0} - ).map(i=>`${ - x5i({ - buffStat:i} - )} - +${ - t.shopBuffs[i]} - %`).join(" · "),this.buffs.setWrapWidth(536),this.buffs.align="center",this.buffs.visible=!!this.buffs.text&&!!t; - const i=this.buffs.visible?this.buffs.height+16:0,s=Math.min(1,(this.height-284-i)/this.corps.panelHeight); - this.corps.scale.set(s),this.corps.position.set((this.width-B5i.WIDTH*s)/2,208),this.buffs.position.set((this.width-this.buffs.width)/2,this.corps.y+this.corps.panelHeight*s+12),this.empty.visible=!t,this.empty.position.set((this.width-this.empty.width)/2,280),this.drawPanel()} - } - ; - Qt(U5i,"MiniAscentCorpsPage"),Zt(U5i,"instance"); - let F5i=U5i; - const $5i=Object.freeze(Object.defineProperty({ - __proto__:null,MiniAscentCorpsPage:F5i} - ,Symbol.toStringTag,{ - value:"Module"} - )); - function H5i(t,i,s,e,n=96,h,r){ - const o=new Ke; - o.eventMode="none"; - const a=Qt((t,i=100,s=0,e=0)=>{ - const n=new Xe(Cbi.texture(t)); - return n.width=n.height=i,n.position.set(s,e),o.addChild(n),n} - ,"layer"),c=Math.max(0,Math.min(4,s-1)); - a(ybi[c]); - const l=new Xe(t); - l.anchor.set(.5),l.width=l.height=82,l.position.set(50,43),l.tint=wyi[i],o.addChild(l),a("relic_layer_legion_tag"); - const u=new iG(String(i+1),3151104,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:20,fontWeight:"900"} - ); - u.position.set(82-u.width/2,1),o.addChild(u); - const d=Qt((t,i,s,e)=>{ - a("crystal_effect_plate",i,s,e),a(Abi[t],i,s,e).tint="hero"===h?16764755:6670847} - ,"buff"); - return e&&d(e,28.8,3,3),r&&d(r,22.4,3,42),a(Ebi[c],100,-4,-1),o.scale.set(n/100),o} - Qt(H5i,"crystalIcon"); - const W5i={ - attackPct:"CRYSTAL_ATTACK",hpPct:"CRYSTAL_HEALTH",attackSpeedPct:"CRYSTAL_HASTE",moveSpeedPct:"CRYSTAL_MOVE",attackRangePct:"CRYSTAL_RANGE",soldierCap:"CRYSTAL_CAPACITY",promotion:"CRYSTAL_PROMOTION",stun:"CRYSTAL_STUN",poison:"CRYSTAL_POISON",paralysis:"CRYSTAL_PARALYSIS",freeze:"CRYSTAL_CHILL"} - ,V5i=Qt(t=>Bbi(W5i[t.effect]),"crystalName"),j5i=Qt(t=>`${ - t} - ★`,"crystalGradeName"),K5i=Qt(t=>Bbi("hero"===t.target?"HERO":"SOLDIERS"),"crystalTargetName"),z5i=Qt(t=>`${ - K5i(t)} - · ${ - V5i(t)} - `,"crystalTitle"); - function Y5i(t,i){ - const s=t.values[i-1]; - if("promotion"===t.effect)return Bbi("CRYSTAL_DESC_PROMOTION",s); - if("soldierCap"===t.effect)return Bbi("CRYSTAL_DESC_CAPACITY",s); - if(!t.seconds)return Bbi("CRYSTAL_DESC_STAT",V5i(t),s); - const e={ - stun:"CRYSTAL_DESC_STUN",freeze:"CRYSTAL_DESC_FREEZE",poison:"CRYSTAL_DESC_POISON",paralysis:"CRYSTAL_DESC_SHOCK"} - [t.effect],n=Qt((i,s)=>Bbi(e,Bbi("normal"===i?"CRYSTAL_TRIGGER_NORMAL":"CRYSTAL_TRIGGER_SKILL"),s,t.seconds),"sentence"),h=n("skill",t.skillValues[i-1]); - return"hero"===t.target?n("normal",s)+"\n"+h:h} - function q5i(t,i,s){ - const e=fyi(i.grade),n=Y5i(t,i.grade); - if(!e)return n; - const h=s.find(t=>t.kind===i.secondaryKind); - return Bbi("CRYSTAL_PRIMARY",i.grade)+"\n"+n+"\n\n"+(h?Bbi("CRYSTAL_SECONDARY",e)+"\n"+Y5i(h,e):Bbi("CRYSTAL_RANDOM_SECONDARY",e))} - function X5i(t){ - var i; - const s=t instanceof Error?t.message:String(t); - return Bbi((null==(i=[["in_battle","CRYSTAL_IN_BATTLE"],["stale","CRYSTAL_REFRESHED"],["no_tickets","CRYSTAL_NO_TICKETS"],["protected_material","CRYSTAL_PROTECTED"],["merge_four","CRYSTAL_MERGE_RULE"],["merge_mismatch","CRYSTAL_MERGE_RULE"],["invalid_equipment","CRYSTAL_DUPLICATE"]].find(([t])=>s.includes(`crystal:${ - t} - `)))?void 0:i[1])??"CRYSTAL_ERROR")} - Qt(Y5i,"crystalDescription"),Qt(q5i,"crystalItemDescription"),Qt(X5i,"crystalErrorText"); - const J5i=class t extends kx{ - constructor(){ - super(),Zt(this,"cells",new Ke),this.addChild(this.cells)} - get width(){ - return t.W} - get height(){ - return t.H} - setData(i){ - const s=i; - this.data=s; - for(const t of this.cells.removeChildren())t.destroy({ - children:!0} - ); - s&&s.items.forEach((i,e)=>{ - const n=s.cell(i); - n.position.set(e*(t.SIZE+t.GAP),0),this.cells.addChild(n)} - )} - } - ; - Qt(J5i,"MiniAscentCrystalRowRenderer"),Zt(J5i,"COLUMNS",6),Zt(J5i,"SIZE",84),Zt(J5i,"GAP",10),Zt(J5i,"W",J5i.COLUMNS*J5i.SIZE+(J5i.COLUMNS-1)*J5i.GAP),Zt(J5i,"H",J5i.SIZE); - let Q5i=J5i; - const Z5i=class t extends c5i{ - constructor(){ - super(),Zt(this,"tabId","crystals"),Zt(this,"body",new Ke),Zt(this,"art",null),Zt(this,"busy",!1),Zt(this,"failed",!1),Zt(this,"corp",0),Zt(this,"list",new Ox(Q5i,Q5i.W,300,12)),Zt(this,"rows",[]),Zt(this,"selected",null),Zt(this,"selectedSlot",null),Zt(this,"merging",null),Zt(this,"result",null),Zt(this,"confirmingMerge",!1),this.contentContainer.addChild(this.body),this.canCloseShell=()=>!this.busy} - static getInstance(){ - return this.instance??(this.instance=new t)} - get data(){ - return ryi.getInstance().crystals} - show(){ - this.height=876,this.selected=null,this.merging=null,this.result=null,this.confirmingMerge=!1,this.render(),super.show(),this.load()} - addLabel(t,i,s,e,n=16,h=Hbi.text,r=0,o=!1){ - const a=new iG(i,h,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:n,lineHeight:n+5,fontWeight:"bold"} - ); - return r&&(a.setWrapWidth(r),o&&(a.align="center")),a.position.set(o?s+(r-a.width)/2:s,e),t.addChild(a),a} - button(t,i,s,e,n,h,r=!0,o=!1,a=36){ - const c=new Ke; - c.position.set(s,e),c.addChild((new ep).roundRect(0,0,n,a,8).fill(o?Hbi.surfaceSelected:Hbi.surfaceRaised).stroke({ - color:o?Hbi.accent:Hbi.border,width:o?2:1} - )); - const l=this.addLabel(c,i,0,0,15,o?Hbi.accent:Hbi.text); - return l.scale.set(Math.min(1,(n-16)/Math.max(1,l.width),(a-12)/Math.max(1,l.height))),l.position.set((n-l.width)/2,(a-l.height)/2),c.alpha=r?1:.4,c.hitArea=new $i(0,0,n,a),c.eventMode="static",c.cursor=r?"pointer":"default",c.on("pointertap",t=>{ - t.stopPropagation(),r&&!this.busy&&h()} - ),t.addChild(c),c} - primary(t,i,s,e,n,h,r=!0){ - const o=new u5i(i); - o.width=n,o.height=57,o.position.set(s,e),o.lbl.scale.set(Math.min(1,(n-44)/Math.max(1,o.lbl.width),33/Math.max(1,o.lbl.height))),o.lbl.position.set(-o.lbl.width/2,-o.lbl.height/2),o.activated=r&&!this.busy,o.onClick=()=>{ - !this.busy&&r&&h()} - ,t.addChild(o)} - definition(t){ - return this.data.catalog.find(i=>i.kind===t.kind)} - gridCell(t,i,s){ - const e=this.data,n=this.itemIcon(t,i); - if(n.eventMode="static",n.cursor="pointer",n.hitArea=new $i(0,0,100,100),n.label=`crystal-item:${ - t.id} - `,this.merging){ - const i=e.items.find(t=>t.id===this.merging[0]),h=!s.has(t.id)&&t.grade<e.maxGrade&&(!i||i.grade===t.grade); - n.alpha=h?1:.35,this.merging.includes(t.id)&&n.addChild((new ep).roundRect(0,0,100,100,12).stroke({ - color:Hbi.accent,width:4} - )),n.on("pointertap",i=>{ - i.stopPropagation(),!this.busy&&h&&(this.merging.includes(t.id)?this.merging=this.merging.filter(i=>i!==t.id):this.merging.length<4&&this.merging.push(t.id),this.render())} - )} - else n.on("pointertap",i=>{ - i.stopPropagation(),this.busy||(this.selected=t,this.render())} - ); - return n} - itemIcon(t,i){ - const s=this.definition(t),e=t.grade>=4?this.data.catalog.find(i=>i.kind===t.secondaryKind):void 0,n=H5i(this.art,s.corp,t.grade,s.effect,i,s.target,null==e?void 0:e.effect); - if(this.data.slots.some(i=>i.includes(t.id))){ - const t=new Xe(Cbi.texture("UI_Check2")); - t.label="crystal-equipped",t.eventMode="none",t.anchor.set(0,.5),t.width=t.height=14,t.position.set(12,83),n.addChild(t)} - return n} - render(){ - var t; - this.body.removeChild(this.list); - for(const _ of this.body.removeChildren())_.destroy({ - children:!0} - ); - this.list.visible=!1; - const i=this.data,s=this.height<800; - if(this.addLabel(this.body,Bbi("TAB_CRYSTALS"),24,130,24,Hbi.accent,this.width-48,!0),!i||!this.art||this.failed)return this.addLabel(this.body,Bbi(this.failed?"CRYSTAL_LOAD_FAILED":"CRYSTAL_LOADING"),32,300,18,Hbi.text,this.width-64,!0),this.failed&&this.button(this.body,Bbi("RELIC_RELOAD"),218,356,180,()=>{ - this.load()} - ),void this.drawPanel(); - const e=s?184:200,n=this.width-28-412,h=this.addLabel(this.body,Bbi("LEGION",this.corp+1),28,e,20,Hbi.accent); - h.label="crystal-legion-name",h.scale.set(Math.min(1,(n-48)/Math.max(1,h.width))),h.y=e+(36-h.height)/2; - for(let _=0; - _<5; - _++){ - const h=n+84*_; - this.button(this.body,String(_+1),h,e,76,()=>{ - this.corp=_,this.list.scrollTo(0),this.selectedSlot=null,this.merging=null,this.render()} - ,!0,_===this.corp).label=`crystal-legion:${ - _} - `; - const r=(null==(t=i.slots[_])?void 0:t.length)??0; - this.addLabel(this.body,`${ - r} - /4`,h,s?224:240,12,r?wyi[_]:Hbi.subtle,76,!0)} - const r=s?253:286,o=s?64:90,a=4*o+96; - this.body.addChild((new ep).roundRect(26,r-12,this.width-52,o+24,12).fill({ - color:Hbi.surface,alpha:.92} - ).stroke({ - color:Hbi.border,width:1} - )); - for(let _=0; - _<4; - _++){ - const t=i.items.find(t=>{ - var s; - return t.id===(null==(s=i.slots[this.corp])?void 0:s[_])} - ),s=(this.width-a)/2+_*(o+32),e=t?this.itemIcon(t,o):new Ke; - t||(e.addChild((new ep).roundRect(0,0,o,o,10).fill(2367774).stroke({ - color:Hbi.border,width:1.5} - )),this.addLabel(e,"+",0,o/2-20,30,Hbi.border,o,!0)),e.position.set(s,r),e.eventMode="static",e.cursor="pointer",e.hitArea=new $i(0,0,t?100:o,t?100:o),e.label=`crystal-slot:${ - _} - `,e.on("pointertap",i=>{ - i.stopPropagation(),this.busy||(this.selectedSlot=_,t?this.selected=t:this.list.scrollTo(0),this.render())} - ),this.body.addChild(e)} - const c=r+o+(s?25:36),l=i.items.filter(t=>gyi(t.kind)===this.corp); - this.addLabel(this.body,Bbi("CRYSTAL_COLLECTION",l.length),30,c+6,17,Hbi.accent),this.button(this.body,Bbi(this.merging?"CRYSTAL_CANCEL":"CRYSTAL_MERGE"),this.width-104,c,76,()=>{ - this.merging=this.merging?null:[],this.list.scrollTo(0),this.render()} - ,!0,!!this.merging),this.merging&&this.addLabel(this.body,`${ - this.merging.length} - /4`,this.width-178,c+8,16,Hbi.accent,64,!0); - const u=c+(s?49:45),d=this.height-(s?151:140),f=Q5i.COLUMNS,p=Q5i.SIZE,w=(this.width-Q5i.W)/2,g=new Set(i.slots.flat()),m=[...l].sort((t,i)=>Number(g.has(i.id))-Number(g.has(t.id))||i.grade-t.grade||t.kind-i.kind||t.id.localeCompare(i.id)),v=[]; - for(let _=0; - _<m.length; - _+=f)v.push({ - items:m.slice(_,_+f),cell:Qt(t=>this.gridCell(t,p,g),"cell")} - ); - this.list.position.set(w,u),this.list.setListHeight(Math.max(p,d-8-u),!1),this.rows.length===v.length?(v.forEach((t,i)=>Object.assign(this.rows[i],t)),this.list.updateItemData()):(this.rows=v,this.list.dataProvider=this.rows),this.list.visible=m.length>0,this.body.addChild(this.list),m.length||this.addLabel(this.body,Bbi("CRYSTAL_EMPTY"),42,u+6,16,Hbi.muted,this.width-84,!0),this.body.addChild((new ep).moveTo(28,d-8).lineTo(this.width-28,d-8).stroke({ - color:Hbi.border,width:1} - )),this.merging?(this.addLabel(this.body,Bbi("CRYSTAL_MERGE_RULE"),32,d+6,14,Hbi.muted,this.width-64,!0),this.primary(this.body,Bbi("CRYSTAL_MERGE"),138,d+54,340,()=>{ - this.confirmingMerge=!0,this.render()} - ,4===this.merging.length)):this.drawTickets(d),i.battlePending&&this.addLabel(this.body,Bbi("CRYSTAL_IN_BATTLE"),32,this.height-23,12,Hbi.danger,this.width-64,!0),this.selected&&this.drawDetail(this.selected),this.confirmingMerge&&this.drawMergeConfirmation(),this.result&&this.drawResult(),this.body.interactiveChildren=!this.busy,this.drawPanel()} - drawTickets(t){ - const i=Object.values(this.data.tickets).reduce((t,i)=>t+i,0); - this.addLabel(this.body,Bbi("CRYSTAL_SUMMON_TICKETS",i),32,t+8,18,Hbi.accent,this.width-64,!0); - const s=Qt(t=>{ - this.action("draw",{ - count:t} - )} - ,"draw"); - this.primary(this.body,Bbi("CRYSTAL_DRAW_ONE"),58,t+58,240,()=>s(1),i>=1),this.primary(this.body,Bbi("CRYSTAL_DRAW_FIVE"),318,t+58,240,()=>s(5),i>=5)} - overlay(t,i){ - const s=new Ke,e=(new ep).rect(12,120,this.width-24,this.height-125).fill({ - color:0,alpha:.75} - ); - e.eventMode="static",e.on("pointertap",t=>{ - t.stopPropagation(),this.busy||i()} - ),s.addChild(e); - const n=new Ke; - n.addChild((new ep).roundRect(0,0,500,t,16).fill(Hbi.surface).stroke({ - color:Hbi.border,width:2} - )),n.eventMode="static",n.on("pointertap",t=>t.stopPropagation()); - const h=Math.min(1,(this.height-156)/t); - return n.scale.set(h),n.position.set((this.width-500*h)/2,130+(this.height-150-t*h)/2),this.button(n,"×",454,10,34,i),s.addChild(n),this.body.addChild(s),n} - drawDetail(t){ - var i; - const s=this.data,e=this.definition(t),n=null==(i=s.slots[this.corp])?void 0:i.includes(t.id),h=Qt(()=>{ - this.selected=null,this.render()} - ,"close"),r=[...s.slots[this.corp]],o=!n&&r.length>=4,a=new Ke,c=this.addLabel(a,q5i(e,t,s.catalog),0,0,20,Hbi.text,428,!0),l=o?63:0,u=Math.min(this.height-156,Math.max(380,222+c.height+28+l+57+28)),d=this.overlay(u,h); - d.label="crystal-detail",this.addLabel(d,z5i(e),30,25,24,Hbi.accent,440,!0); - const f=this.itemIcon(t,122); - f.position.set(189,75),d.addChild(f); - const p=u-28-57; - if(this.addDescription(d,a,36,222,428,p-l-28-222),n)this.primary(d,Bbi("CRYSTAL_UNEQUIP"),70,p,360,()=>{ - this.action("equip",{ - corp:this.corp,ids:r.filter(i=>i!==t.id)} - )} - ,!s.battlePending); - else{ - const i=r.findIndex(i=>{ - var e; - return(null==(e=s.items.find(t=>t.id===i))?void 0:e.kind)===t.kind} - ),e=o||i>=0,n=i>=0?i:this.selectedSlot??-1; - if(o)for(let t=0; - t<4; - t++)this.button(d,Bbi("CRYSTAL_SLOT",t+1),32+111*t,p-l,103,()=>{ - this.selectedSlot=t,this.render()} - ,i<0||i===t,n===t,51); - const h=myi(s,t,this.corp,n)&&(!e||n>=0&&n<4); - this.primary(d,Bbi(e?"CRYSTAL_REPLACE":"CRYSTAL_EQUIP"),70,p,360,()=>{ - e?r[n]=t.id:r.push(t.id),this.action("equip",{ - corp:this.corp,ids:r} - )} - ,h)} - } - addDescription(t,i,s,e,n,h){ - const r=i.height,o=new Ke,a=(new ep).rect(0,0,n,h).fill(16777215); - o.position.set(s,e),o.addChild(i,a),i.mask=a,o.label="crystal-description",t.addChild(o); - const c=Math.max(0,r-h); - if(!c)return; - o.eventMode="static",o.hitArea=new $i(0,0,n,h); - const l=new ep; - l.eventMode="none",l.x=n+8,o.addChild(l); - const u=Math.max(20,h*h/r); - let d=0,f=null,p=0; - const w=Qt(t=>{ - d=Math.max(0,Math.min(c,t)),i.y=-d,l.clear().roundRect(0,0,3,h,1.5).fill(Hbi.surfaceRaised).roundRect(0,d/c*(h-u),3,u,1.5).fill(Hbi.border)} - ,"scroll"); - o.on("wheel",t=>{ - t.stopPropagation(),t.preventDefault(),w(d+t.deltaY)} - ),o.on("pointerdown",t=>{ - t.stopPropagation(),f=o.toLocal(t.global).y,p=d} - ),o.on("globalpointermove",t=>{ - null!==f&&w(p+f-o.toLocal(t.global).y)} - ),o.on("pointerup",()=>{ - f=null} - ),o.on("pointerupoutside",()=>{ - f=null} - ),w(0)} - drawMergeConfirmation(){ - var t; - if(4!==(null==(t=this.merging)?void 0:t.length))return; - const i=this.overlay(382,()=>{ - this.confirmingMerge=!1,this.render()} - ); - this.addLabel(i,Bbi("CRYSTAL_MERGE"),30,28,23,Hbi.accent,440,!0),this.merging.forEach((t,s)=>{ - const e=this.data.items.find(i=>i.id===t),n=this.itemIcon(e,86); - n.position.set(48+106*s,88),i.addChild(n)} - ),this.addLabel(i,Bbi("CRYSTAL_MERGE_CONFIRM"),36,205,17,Hbi.text,428,!0),this.primary(i,Bbi("CRYSTAL_MERGE"),70,307,360,()=>{ - this.confirmingMerge=!1,this.action("merge",{ - ids:[...this.merging]} - )} - )} - drawResult(){ - const t=this.result,i=this.overlay(300,()=>{ - this.result=null,this.render()} - ); - this.addLabel(i,Bbi("CRYSTAL_RECEIVED"),24,26,23,Hbi.accent,452,!0); - const s=t.length>4?78:t.length>3?90:110,e=t.length*s+14*(t.length-1); - t.forEach((t,n)=>{ - const h=this.itemIcon(t,s); - h.position.set((500-e)/2+n*(s+14),91),i.addChild(h)} - ),this.primary(i,Bbi("CRYSTAL_CONFIRM"),130,230,240,()=>{ - this.result=null,this.render()} - )} - async load(){ - if(!this.busy){ - this.busy=!0,this.failed=!1,this.render(); - try{ - const[t,i]=await Promise.all([ryi.getInstance().fetchCrystals(!0),Cbi.loadCrystalArt()]); - this.art=i} - catch{ - this.failed=!0} - finally{ - this.busy=!1,this.render()} - } - } - async action(t,i){ - var s; - if(this.busy||!this.data)return; - const e=ryi.getInstance(),n=this.data.revision,h=e.season.seasonId,r=JSON.stringify([t,i]); - this.busy=!0,this.render(); - try{ - const h=await e.crystalAction(n,t,i); - this.finishAction((null==(s=h.crystals.lastAction)?void 0:s.items)??[])} - catch(o){ - try{ - const t=await e.fetchCrystals(!0),i=t.crystals.lastAction; - t.season.seasonId===h&&(null==i?void 0:i.revision)===n&&i.key===r?this.finishAction(i.items):(this.finishAction([]),this.confirmingMerge=!1,bH.getInstance().showMessage(X5i(o)))} - catch{ - this.failed=!0,bH.getInstance().showMessage(Bbi("CRYSTAL_ERROR"))} - } - finally{ - this.busy=!1,this.render()} - } - finishAction(t){ - this.selected=null,this.selectedSlot=null,this.merging=null,this.list.scrollTo(0),this.result=t.length?t:null} - } - ; - Qt(Z5i,"MiniAscentCrystalsPage"),Zt(Z5i,"instance"); - let t3i=Z5i; - const i3i=Object.freeze(Object.defineProperty({ - __proto__:null,MiniAscentCrystalsPage:t3i} - ,Symbol.toStringTag,{ - value:"Module"} - )),s3i=class extends nB{ - constructor(t){ - super(t),this.bg.visible=!1,this.lbl.setStyle({ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:15,lineHeight:20} - ),this.activatedTextColor=Hbi.muted,this.width=160,this.height=44} - fitLabel(){ - this.lbl.scale.set(1),this.lbl.scale.set(Math.min(1,(this.width-16)/Math.max(1,this.lbl.width))),this.lbl.position.set(-this.lbl.width/2,-this.lbl.height/2)} - set text(t){ - super.text=t,this.fitLabel()} - get text(){ - return super.text} - set width(t){ - super.width=t,this.fitLabel()} - get width(){ - return super.width} - } - ; - Qt(s3i,"MiniAscentTextButton"); - let e3i=s3i; - const n3i={ - armyStartLevel:"RELIC_ARMY_START_LEVEL",armyAttackSpeed:"RELIC_ARMY_ATTACK_SPEED",armyMoveSpeed:"RELIC_ARMY_MOVE_SPEED",life:"RELIC_LIFE",soldierLevel:"RELIC_SOLDIER_LEVEL",heroLevel:"RELIC_HERO_LEVEL",startGold:"RELIC_START_GOLD",clearGold:"RELIC_CLEAR_GOLD",sealBonus:"RELIC_SEAL_BONUS",soldierCount:"RELIC_SOLDIER_COUNT",levelGain:"RELIC_LEVEL_GAIN",fifthLegion:"RELIC_FIFTH_LEGION",soldierChange:"RELIC_SOLDIER_CHANGE",soldierCap:"CRYSTAL_CAPACITY"} - ,h3i=Qt(t=>Bbi(n3i[t.effect],(t.corp??0)+1),"title"),r3i=class t extends c5i{ - constructor(){ - super(),Zt(this,"tabId","relics"),Zt(this,"body",new Ke),Zt(this,"unownedFilter",(()=>{ - const t=new Ef({ - resolution:"inherit"} - ); - return t.desaturate(),t} - )()),Zt(this,"busy",!1),Zt(this,"loaded",!1),Zt(this,"failed",!1),Zt(this,"selectedId",null),Zt(this,"result",""),Zt(this,"drawResults",null),this.canCloseShell=()=>!this.busy,this.contentContainer.addChild(this.body)} - static getInstance(){ - return this.instance??(this.instance=new t)} - show(){ - this.render(),super.show(),this.load()} - addLabel(t,i,s,e=16,n=Hbi.text,h=0){ - const r=new iG(t,n,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:e,lineHeight:e+5} - ); - return h&&r.setWrapWidth(h),r.position.set(i,s),this.body.addChild(r),r} - center(t,i,s=16,e=Hbi.text){ - const n=this.addLabel(t,0,i,s,e,556); - return n.align="center",n.x=(this.width-n.width)/2,n} - button(t,i,s,e,n,h=!0,r=!1,o=42){ - const a=r?new e3i(t):new u5i(t); - return a.width=e,a.height=o,a.position.set(i,s),a.lbl.scale.set(Math.min(1,(e-40)/Math.max(1,a.lbl.width))),a.lbl.position.set(-a.lbl.width/2,-a.lbl.height/2),a.activated=h&&!this.busy,a.onClick=()=>{ - !this.busy&&h&&n()} - ,this.body.addChild(a),a} - render(){ - var t; - for(const w of this.body.removeChildren())w.destroy({ - children:!0} - ); - const i=ryi.getInstance(),s=i.relics,e=this.height<800; - if(this.center(Bbi("TAB_RELICS"),e?144:152,23,Hbi.accent),!this.loaded||!s)return this.center(Bbi(this.failed?"RELIC_LOAD_FAILED":"RELIC_LOADING"),280,17),this.failed&&this.button(Bbi("RELIC_RELOAD"),188,340,240,()=>{ - this.load()} - ),void this.drawPanel(); - const n={ - soldierLevel:0,soldierCount:1,soldierCap:2,heroLevel:3,armyStartLevel:4,armyAttackSpeed:5,armyMoveSpeed:6} - ,h=[...s.items].sort((t,i)=>(n[t.effect]??7)-(n[i.effect]??7)||(t.corp??0)-(i.corp??0)),r=Math.ceil(h.length/5),o=e?188:204,a=this.height-182,c=Math.max(24,Math.floor(Math.min(96,(this.width-56-72)/5,(a-o-18*(r-1))/Math.max(1,r)))),l=r*c+18*Math.max(0,r-1),u=o+Math.max(0,(a-o-l)/2); - h.forEach((t,i)=>{ - const s=Math.floor(i/5),e=i%5,n=Math.min(5,h.length-5*s),r=n*c+18*(n-1),o=this.thumbnail(t,c); - o.position.set((this.width-r)/2+e*(c+18),u+s*(c+18)),o.label=`relic:${ - t.id} - `,o.eventMode="static",o.cursor="pointer",o.hitArea=new $i(0,0,c,c),o.on("pointertap",i=>{ - i.stopPropagation(),this.busy||(this.selectedId=t.id,this.render())} - ),this.body.addChild(o)} - ),this.center(this.result||Bbi("RELIC_GRID_HINT"),this.height-161,13,this.result?Hbi.success:Hbi.muted); - const d=s.items.length>0&&s.items.every(t=>t.maxLevel>0&&t.level>=t.maxLevel),f=(this.width-88)/2; - for(const[w,g]of[1,10].entries()){ - const e=32+w*(f+24),n=s.drawCost*g,h=s.canDraw&&!d&&((null==(t=i.season)?void 0:t.gold)??0)>=n,r=new Ke,o=new Xe(Cbi.texture("ui_coin")); - o.width=o.height=26; - const a=new iG(String(n),Hbi.accent,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:18} - ); - a.position.set(34,(26-a.height)/2),r.addChild(o,a),r.position.set(e+(f-r.width)/2,this.height-124),r.label=`relic-price:${ - g} - `,this.body.addChild(r),this.button(Bbi(1===g?"RELIC_SUMMON":"RELIC_SUMMON_TEN"),e,this.height-86,f,()=>{ - this.draw(g)} - ,h,!1,56).label=`relic-summon:${ - g} - `} - const p=s.items.find(t=>t.id===this.selectedId); - this.drawResults?this.renderDrawResults(this.drawResults):p?this.renderDetail(p):this.selectedId=null,this.drawPanel()} - thumbnail(t,i){ - const s=new Ke,e=new Ke; - e.scale.set(i/100),s.addChild(e); - const n=t.level>0; - n||(e.filters=[this.unownedFilter]); - for(const a of Mbi(t.effect)){ - const t=new Xe(Cbi.texture(a)); - t.width=t.height=100,a.startsWith("relic_layer_buff_")&&t.position.set(3,-3),e.addChild(t)} - const h=void 0===t.corp,r=new iG(h?"A":String(t.corp+1),3151104,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:20,lineHeight:22,fontWeight:"900",stroke:{ - color:3151104,width:.6,join:"round"} - } - ); - if(r.scale.set(Math.min(1,22/Math.max(1,r.width),22/Math.max(1,r.height))),r.position.set(72+(22-r.width)/2,2+(22-r.height)/2),e.addChild(r),n){ - const i=t.requiredCopies??Math.ceil((t.level+1)/2),s=new iG(`${ - t.copies??0} - /${ - i} - `,Hbi.text,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:16,lineHeight:19,fontWeight:"900",stroke:{ - color:0,width:4,join:"round"} - } - ); - s.scale.set(Math.min(1,58/Math.max(1,s.width))),s.position.set(7,6),e.addChild(s)} - const o=new iG(`Lv.${ - t.level} - `,n?Hbi.text:Hbi.muted,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:17,lineHeight:20,fontWeight:"900",stroke:{ - color:0,width:4,join:"round"} - } - ); - return o.scale.set(Math.min(1,63/Math.max(1,o.width))),o.position.set(94-o.width,97-o.height),e.addChild(o),s.eventMode="none",s} - renderDetail(t){ - const i=new Ke; - i.label="relic-detail"; - const s=(new ep).rect(12,120,this.width-24,this.height-128).fill({ - color:0,alpha:.64} - ); - s.eventMode="static"; - const e=Qt(()=>{ - this.selectedId=null,this.render()} - ,"close"); - s.on("pointertap",t=>{ - t.stopPropagation(),e()} - ),i.addChild(s); - const n=new Ke,h=new Ke,r=Qt((t,i,s,e)=>{ - const n=new iG(t,e,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:s,lineHeight:s+5} - ); - return n.setWrapWidth(436),n.align="center",n.position.set((500-n.width)/2,i),h.addChild(n),n} - ,"label"); - let o=28; - const a=this.thumbnail(t,112); - a.position.set(194,o),h.addChild(a),o+=136,o+=r(Bbi("RELIC_EFFECT_SUMMARY",h3i(t),this.effectText(t,t.level)),o,21,Hbi.accent).height+18,o+=r(Bbi("RELIC_OWNED_COPIES",t.copies??0),o,18,Hbi.text).height+10,o+=r(Bbi("RELIC_REQUIRED_COPIES",t.requiredCopies??Math.ceil((t.level+1)/2)),o,18,Hbi.text).height+28,n.addChild((new ep).roundRect(0,0,500,o,16).fill(Hbi.surface).stroke({ - color:Hbi.border,width:2} - ),h),n.eventMode="static",n.on("pointertap",t=>t.stopPropagation()); - const c=new Ke,l=new Xe(Cbi.texture("ui_close")); - l.width=l.height=32,c.addChild(l),c.position.set(476,-12),c.hitArea=new $i(-6,-6,44,44),c.eventMode="static",c.cursor="pointer",c.on("pointertap",t=>{ - t.stopPropagation(),e()} - ),n.addChild(c); - const u=this.height-152,d=Math.min(1,u/o); - n.scale.set(d),n.position.set((this.width-500*d)/2,130+(u-o*d)/2),i.addChild(n),this.body.addChild(i)} - renderDrawResults(t){ - const i=new Ke,s=new Ke,e=552,n=178+116*Math.ceil(t.length/5); - i.label="relic-draw-results"; - const h=Qt(()=>{ - this.drawResults=null,this.render()} - ,"close"),r=(new ep).rect(12,120,this.width-24,this.height-128).fill({ - color:0,alpha:.64} - ); - r.eventMode="static",r.on("pointertap",t=>{ - t.stopPropagation(),h()} - ),i.addChild(r),s.addChild((new ep).roundRect(0,0,e,n,16).fill(Hbi.surface).stroke({ - color:Hbi.border,width:2} - )),s.eventMode="static",s.on("pointertap",t=>t.stopPropagation()); - const o=new iG(Bbi("RELIC_SUMMON_RESULT"),Hbi.accent,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:23} - ); - o.setWrapWidth(488),o.align="center",o.position.set((e-o.width)/2,26),s.addChild(o),t.forEach((i,n)=>{ - var h; - const r=null==(h=ryi.getInstance().relics)?void 0:h.items.find(t=>t.id===i.id); - if(!r)return; - const o=this.thumbnail({ - ...r,...i} - ,84),a=n%5,c=Math.floor(n/5),l=Math.min(5,t.length-5*c),u=84*l+16*(l-1); - o.position.set((e-u)/2+100*a,82+116*c),o.label=`relic-drawn:${ - n} - `,s.addChild(o); - const d=new iG("+1",Hbi.accent,hD.DEFAULT_FONT_OPTION_16); - d.position.set(o.x+(84-d.width)/2,o.y+84+4),s.addChild(d)} - ); - const a=new u5i(Bbi("CRYSTAL_CONFIRM")); - a.width=240,a.height=56,a.position.set((e-a.width)/2,n-76),a.onClick=h,s.addChild(a); - const c=new Xe(Cbi.texture("ui_close")); - c.width=c.height=32,c.position.set(528,-12),c.eventMode="static",c.cursor="pointer",c.on("pointertap",t=>{ - t.stopPropagation(),h()} - ),s.addChild(c); - const l=this.height-152,u=Math.min(1,l/n); - s.scale.set(u),s.position.set((this.width-e*u)/2,130+(l-n*u)/2),i.addChild(s),this.body.addChild(i)} - async load(){ - if(!this.busy){ - this.busy=!0,this.failed=!1,this.loaded=!1,this.render(); - try{ - await ryi.getInstance().fetchRelics(),this.loaded=!0} - catch{ - this.failed=!0} - finally{ - this.busy=!1,this.render()} - } - } - effectText(t,i){ - if("fifthLegion"===t.effect||"soldierChange"===t.effect)return Bbi(i?"RELIC_UNLOCKED":"RELIC_LOCKED"); - const s=["sealBonus","armyAttackSpeed","armyMoveSpeed"].includes(t.effect)?"%":"",e=t.stepChangeLevel??0,n=e<=0||i<e?i*t.step:(e-1)*t.step+(i-e+1)*(t.stepAfter??t.step); - return`+${ - Number.isInteger(n)?n:Math.ceil(n-1e-9)} - ${ - s} - `} - showDraw(t){ - var i,s; - if(null==(i=null==t?void 0:t.results)?void 0:i.length)return this.drawResults=t.results,this.selectedId=null,void(this.result=""); - const e=null==(s=ryi.getInstance().relics)?void 0:s.items.find(i=>i.id===(null==t?void 0:t.id)); - e&&t&&(this.result=Bbi("RELIC_DRAW_RESULT",h3i(e),this.effectText(e,t.level),t.level),t.leveledUp&&(this.result+=" ↑"),this.selectedId=e.id,bH.getInstance().showMessage(this.result))} - async draw(t){ - var i,s; - const e=ryi.getInstance(); - if(this.busy||!(null==(i=e.relics)?void 0:i.canDraw)||!e.season||(e.season.gold??0)<e.relics.drawCost*t)return; - const n=e.season.seasonId,h=e.relics.revision; - this.busy=!0,this.result="",this.drawResults=null,this.render(); - try{ - this.showDraw((await e.drawRelic(n,h,t)).drawn)} - catch(r){ - try{ - const i=await e.fetchRelics(!0); - i.season.seasonId===n&&(null==(s=i.relics.lastDraw)?void 0:s.revision)===h&&(i.relics.lastDraw.count??1)===t?this.showDraw(i.relics.lastDraw):bH.getInstance().showMessage(r.message)} - catch{ - this.loaded=!1,this.failed=!0} - } - finally{ - this.busy=!1,this.render()} - } - } - ; - Qt(r3i,"MiniAscentRelicsPage"),Zt(r3i,"instance"); - let o3i=r3i; - const a3i=Object.freeze(Object.defineProperty({ - __proto__:null,MiniAscentRelicsPage:o3i} - ,Symbol.toStringTag,{ - value:"Module"} - )),c3i={ - battle:"encounter_battle",elite:"encounter_elite",boss:"encounter_boss",shop:"encounter_shop",event:"encounter_event"} - ; - let l3i,u3i; - function d3i(t){ - return t?u3i??(u3i=new s1t({ - distance:10,outerStrength:4,innerStrength:0,color:16759844,quality:.2} - )):l3i??(l3i=new s1t({ - distance:8,outerStrength:3,innerStrength:0,color:16763446,quality:.2} - ))} - function f3i(t,i,s,e=!1){ - const n=new Ke,h=new Xe(Cbi.texture(e?"encounter_gambling":c3i[t])); - return h.anchor.set(.5),h.scale.set(Math.min(140/h.texture.width,136/h.texture.height)),(i||s)&&(h.filters=[d3i(s)]),n.addChild(h),n.eventMode="none",n} - Qt(d3i,"glow"),Qt(f3i,"routeIsland"); - const p3i=class t extends c5i{ - constructor(){ - super(),Zt(this,"usesRunWallet",!0),Zt(this,"body",new Ke),Zt(this,"unreachableFilter",(()=>{ - const t=new Ef; - return t.desaturate(),t} - )()),Zt(this,"onSelect",null),Zt(this,"onEvent",null),Zt(this,"onAuto",null),Zt(this,"onBack",null),Zt(this,"busy",!1),this.canCloseShell=()=>!this.busy,this.height=690,this.contentContainer.addChild(this.body)} - static getInstance(){ - return this.instance??(this.instance=new t)} - addLabel(t,i,s,e=16,n=Hbi.text,h){ - const r=new iG(t,n,hD.DEFAULT_FONT_OPTION_16); - return r.textSize=e,h&&r.setWrapWidth(h),r.position.set(i,s),this.body.addChild(r),r} - center(t,i,s=16,e=Hbi.text){ - const n=this.addLabel(t,0,i,s,e); - n.width>this.width-48&&(n.textSize=s*(this.width-48)/n.width),n.x=(this.width-n.width)/2} - button(t,i,s,e,n,h=!0){ - const r=new u5i(t); - return r.width=e,r.height=48,r.position.set(i,s),r.onClick=async()=>{ - if(!this.busy&&h){ - this.busy=!0,r.activated=!1; - try{ - await n()} - finally{ - this.busy=!1,r.destroyed||(r.activated=!0)} - } - } - ,r.activated=h,this.body.addChild(r),r} - setData(t){ - var i,s,e; - for(const r of this.body.removeChildren())r.destroy({ - children:!0} - ); - const n="event"===(null==(i=t.currentNode)?void 0:i.kind); - this.height=n?690:Math.min(960,SS.safeHeight-28); - const h=t.currentNode; - if("event"===(null==h?void 0:h.kind))if("wager"===h.eventKind&&h.wager){ - const{ - stake:i,winChance:e,payout:n,stakes:r,roundsPlayed:o,maxRounds:a} - =h.wager; - this.center(Bbi("WAGER"),130,24,Hbi.accent),this.eventIcon("encounter_gambling",64,176,90),this.addLabel(Bbi("WAGER_ODDS",e),178,180,22,Hbi.accent,380),this.addLabel(Bbi("WAGER_ROUNDS",o,a),178,225,18,Hbi.text,380); - const c=(null==(s=t.eventResult)?void 0:s.nodeId)===h.id&&"wager"===t.eventResult.kind?t.eventResult:void 0; - c?this.center(`${ - Bbi(c.won?"RESULT_WIN":"RESULT_LOSS")} - ${ - c.amount>=0?"+":""} - ${ - c.amount} - `,276,22,c.won?Hbi.success:Hbi.danger):this.center(Bbi(r.some(i=>i<=t.run.wallet)?"WAGER_LOSS_RULE":"NO_COINS"),276,16,Hbi.muted); - const l=Math.min(334,this.height-252); - this.center(Bbi("WAGER_RETURN"),l-25,14,Hbi.muted),r.forEach((s,e)=>{ - const r=l+64*e; - this.body.addChild((new ep).roundRect(40,r,536,56,10).fill(Hbi.surfaceRaised).stroke({ - color:Hbi.border,width:1} - )),this.eventIcon("ui_coin",58,r+14,28),this.addLabel(`${ - s} - → ${ - Math.round(n*s/i)} - `,100,r+13,22,Hbi.accent),this.button(Bbi("WAGER_BET",s),342,r+4,216,async()=>{ - var t; - await(null==(t=this.onEvent)?void 0:t.call(this,h.id,`bet:${ - o+1} - :${ - s} - `))} - ,o<a&&t.run.wallet>=s)} - ),this.button(Bbi(o?"NEXT":"WAGER_SKIP"),58,this.height-60,500,async()=>{ - var t; - await(null==(t=this.onEvent)?void 0:t.call(this,h.id,"skip"))} - ).color=nB.BROWN} - else this.center(Bbi("EVENT_HINT"),132,18,12179631),null==(e=h.eventChoices)||e.forEach((i,s)=>{ - const e=185+176*s; - this.body.addChild((new ep).roundRect(28,e,560,158,14).fill(Hbi.surface).stroke({ - color:Hbi.border,width:1} - )); - const n="coins"===i.kind,r=t.run.corps[i.corp??0]; - if(n)this.eventIcon("ui_coin",52,e+24,64); - else if(r){ - const t=new c4; - t.setDataWithKindNum(y5i(r),Math.max(0,r.heroStage-1)),t.scale.set(Math.min(76/t.width,60/t.height)),t.position.set(48,e+28),this.body.addChild(t)} - const o=n?Bbi("SUPPLY_COINS"):Bbi("legionLevel"===i.kind?"LEGION_TRAIN":"heroLevel"===i.kind?"HERO_TRAIN":"SOLDIER_TRAIN",(i.corp??0)+1,i.amount); - this.addLabel(o,144,e+17,18,15982508,420); - const a=r?("heroLevel"===i.kind?r.heroLevel:r.soldierLevel)??10:10; - this.addLabel(n?Bbi("COINS",i.amount):"legionLevel"===i.kind&&r?`Lv.${ - r.heroLevel??1} - / ${ - r.soldierLevel??1} - → ${ - (r.heroLevel??1)+i.amount} - / ${ - (r.soldierLevel??1)+i.amount} - `:`Lv.${ - a} - → Lv.${ - a+i.amount} - `,144,e+58,22,n?16767332:11590560,416),this.button(Bbi("TAKE_REWARD"),144,e+101,414,async()=>{ - var t; - await(null==(t=this.onEvent)?void 0:t.call(this,h.id,i.id))} - )} - ),this.center(Bbi("SUPPLY_DESC"),563,14); - else{ - const i=182,s=(this.height-80-i)/5,e=Math.min(1.05,(s-30)/140),n=Qt(t=>Ibi(t)+54+20,"choiceX"),r=xbi(t),o=null==r.lane?this.width/2:Ibi(r.lane)+54,a=Qt(t=>i+s*(4-t+.43),"rowY"),c=this.height-40-Math.max(25,66*e+3),l=Qt((t,i,s)=>{ - const e=this.addLabel(String(t).padStart(2,"0"),0,0,s?22:20); - e.width>34&&e.scale.set(34/e.width),e.position.set(27-e.width/2,i-e.height/2),e.textColor=s?Hbi.accent:Hbi.muted} - ,"stageLabel"); - l(r.depth,c,!0); - const u=new ep; - u.eventMode="none"; - for(const h of t.rows[0]??[]){ - if(!Rbi(t,h))continue; - const i=n(h.lane),s=h.lane===r.lane?0:Math.sign(i-o),l=o+s*(r.node?44*e:18),d=c-(s?8:55*e),f=a(1)+66*e+Math.max(12,16*e)+13,p=Math.atan2(f-d,i-l); - u.moveTo(l,d).lineTo(i,f).stroke({ - color:Hbi.accent,width:2.5,alpha:.9} - ),u.moveTo(i,f).lineTo(i-9*Math.cos(p-.5),f-9*Math.sin(p-.5)).lineTo(i-9*Math.cos(p+.5),f-9*Math.sin(p+.5)).closePath().fill(Hbi.accent)} - if(this.body.addChild(u),r.node){ - const t=f3i(r.node.kind,!1,!1,"wager"===r.node.eventKind); - t.position.set(o,c),t.scale.set(e),this.body.addChild(t); - const i=(new ep).circle(0,0,10).fill(4481847).moveTo(-5,0).lineTo(-1,4).lineTo(6,-4).stroke({ - color:16773834,width:2.5} - ); - i.position.set(o+40*e,c-38*e),this.body.addChild(i)} - else{ - const t=(new ep).moveTo(0,23).lineTo(-13,4).lineTo(13,4).closePath().fill(8672033).circle(0,-5,18).fill(8672033).circle(0,-5,10).fill(16768118); - t.position.set(o,c),this.body.addChild(t)} - const d=this.addLabel(Bbi(0===r.depth?"START":"CURRENT_POSITION"),0,c+(r.node?66*e+3:25),14); - d.x=o-d.width/2,t.rows.slice(0,4).forEach((i,s)=>{ - const r=a(s+1); - l(i[0].depth,r,0===s),i.forEach(i=>{ - const o=n(i.lane),a=(null==h?void 0:h.id)===i.id,c=Rbi(t,i),l=f3i(i.kind,c,a,"wager"===i.eventKind),u=new Ke; - u.position.set(o,r); - const d=0===s&&!c; - u.alpha=d?.6:s>0?.85:1,d&&(l.filters=[this.unreachableFilter]),this.body.addChild(u),l.scale.set(e),u.addChild(l); - const f=Math.max(12,16*e),p=new iG("wager"===i.eventKind?Bbi("WAGER"):Fbi(i.kind),Hbi.text,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:f,lineHeight:f+2} - ); - p.setWrapWidth(118),p.position.set(-p.width/2,66*e+3),d&&(p.textColor=Hbi.muted),u.addChild(p); - const w=(new ep).roundRect(-61,-58*e,122,124*e+3+p.height,16).fill({ - color:16777215,alpha:.001} - ); - w.eventMode=c?"static":"none",w.cursor=c?"pointer":"default",w.on("pointertap",async()=>{ - var t; - if(!this.busy&&c){ - this.busy=!0; - try{ - await(null==(t=this.onSelect)?void 0:t.call(this,i.id))} - finally{ - this.busy=!1} - } - } - ),u.addChild(w)} - )} - )} - this.drawPanel()} - eventIcon(t,i,s,e){ - const n=Cbi.texture(t); - if(!n)return; - const h=new Xe(n); - h.scale.set(Math.min(e/n.width,e/n.height)),h.position.set(i+(e-h.width)/2,s+(e-h.height)/2),this.body.addChild(h)} - showEventResult(t){ - var i; - const s=t.eventResult; - if("wager"===(null==s?void 0:s.kind)&&(null==(i=t.currentNode)?void 0:i.id)===s.nodeId)return void this.setData(t); - if(!s||"skip"===s.kind)return void this.setData(t); - for(const n of this.body.removeChildren())n.destroy({ - children:!0} - ); - this.height=690; - const e="wager"===s.kind; - this.center(Bbi(e?s.won?"RESULT_WIN":"RESULT_LOSS":"RESULT_DONE"),138,26,16768133),this.eventIcon(e?"encounter_gambling":"ui_coin",266,186,84),null!=s.level?(this.center(Bbi("legionLevel"===s.kind?"LEGION_TRAIN":"heroLevel"===s.kind?"HERO_TRAIN":"SOLDIER_TRAIN",(s.corp??0)+1,s.amount),280,20),this.center("legionLevel"===s.kind?`Lv.${ - s.previousLevel} - / ${ - s.previousSoldierLevel} - → ${ - s.level} - / ${ - s.soldierLevel} - `:`Lv.${ - s.previousLevel} - → Lv.${ - s.level} - `,326,30,10868123)):(this.center(`${ - s.amount>=0?"+":""} - ${ - s.amount} - `,285,46,s.amount>=0?16767332:15049619),e&&this.center(Bbi(s.won?"WAGER_WIN":"WAGER_LOSS",s.won?s.payout:s.stake,s.amount),355,17)),this.center(Bbi("RECORD",s.wallet,t.season.bestFloor),430,17),this.button(Bbi("NEXT"),58,555,500,async()=>{ - this.setData(t)} - ),this.drawPanel()} - onCloseBtnClick(){ - this.busy||super.onCloseBtnClick()} - } - ; - Qt(p3i,"MiniAscentRoutePopup"),Zt(p3i,"instance"); - let w3i=p3i; - const g3i=Object.freeze(Object.defineProperty({ - __proto__:null,MiniAscentRoutePopup:w3i} - ,Symbol.toStringTag,{ - value:"Module"} - )),m3i=Qt(t=>NB.getText("",t),"text"),v3i=class t extends c5i{ - constructor(){ - super(),Zt(this,"usesRunWallet",!0),Zt(this,"tabId","battle"),Zt(this,"locked",!0),Zt(this,"onLeave",null),Zt(this,"onReturn",null),Zt(this,"body",new Ke),Zt(this,"shop",null),Zt(this,"busy",!1),Zt(this,"loaded",!1),Zt(this,"failed",!1),this.canCloseShell=()=>!this.busy,this.height=672,this.contentContainer.addChild(this.body)} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - show(){ - if(this.parent)return; - const t=ryi.getInstance().run; - this.locked=!t||"shop"!==t.nodeKind||t.battlePending,this.shop=null,this.loaded=!1,this.failed=!1,this.refresh(),super.show(),this.locked||this.load()} - addLabel(t,i,s,e=16,n=Hbi.text,h,r=this.body){ - const o=new iG(t,n,hD.DEFAULT_FONT_OPTION_16); - return o.textSize=e,h&&o.setWrapWidth(h),o.position.set(i,s),r.addChild(o),o} - centered(t,i,s=16,e=Hbi.text){ - const n=this.addLabel(t,0,i,s,e); - n.x=(this.width-n.width)/2} - itemText(t){ - var i; - const s=t.targetCorp<0?Bbi("SHOP_ALL"):Bbi("LEGION",t.targetCorp+1),e=null==(i=ryi.getInstance().run)?void 0:i.corps[t.targetCorp],n=t.amount??("soldierUp"===t.type?3:1); - let h="",r=""; - switch(t.type){ - case"heroReplace":h=Bbi("SHOP_REPLACE"),r=Bbi("SAME_RACE")+(t.bonus?"\n"+("soldierAdd"===t.bonus?Bbi("FOCUS_SOLDIERS",n):`${ - Bbi("HERO")} - +${ - n} - Lv`):""); - break; - case"heroUp":h=Bbi("SHOP_HERO_UP"),r=e?`${ - E5i(e.heroStage)} - → ${ - E5i(Math.min(4,e.heroStage+1))} - `:""; - break; - case"soldierUp":h=Bbi("SHOP_SOLDIER_UP",n),r=Bbi("SHOP_UPGRADE_DESC",n); - break; - case"legionLevel":case"allLevel":h=`${ - NB.getText("COMMON_41","Level up")} - +${ - n} - Lv`,r=`${ - Bbi("HERO")} - · ${ - Bbi("SOLDIERS")} - `; - break; - case"soldierAdd":case"allSoldier":h=Bbi("FOCUS_SOLDIERS",n),r="allSoldier"===t.type?Bbi("SHOP_ADD_LIMIT"):Bbi("SHOP_RUN_ONLY"); - break; - case"attackSpeed":h=`${ - NB.getText("GAME_21","Attack speed")} - +${ - n} - %`,r=Bbi("SHOP_RUN_BUFF"); - break; - case"moveSpeed":h=`${ - NB.getText("GAME_22","Movement speed")} - +${ - n} - %`,r=Bbi("SHOP_RUN_BUFF"); - break; - case"manaRegen":h=NB.getText("EmblemDesc15","Mana recovery speed +{ - v} - %").replace(/\{ - v\} - /g,String(n)),r=Bbi("SHOP_RUN_BUFF")} - return{ - title:`${ - s} - · ${ - h} - `,desc:r} - } - refresh(){ - var t,i; - for(const c of this.body.removeChildren())c.destroy({ - children:!0} - ); - const s=ryi.getInstance(); - if(this.locked){ - this.centered(Bbi("TAB_SHOP"),168,24,Hbi.accent); - const t=this.addLabel(Bbi("SHOP_LOCKED"),0,260,17,Hbi.muted,500); - return t.align="center",t.x=(this.width-t.width)/2,void this.drawPanel()} - if(this.centered(Bbi("SHOP_HINT"),147,15,Hbi.muted),!this.loaded||!this.shop){ - if(this.centered(m3i(this.failed?"상점을 불러오지 못했습니다":this.loaded?"상점 정보가 없습니다":"상품을 불러오는 중…"),310,18),this.failed){ - const t=new u5i(m3i("다시 불러오기")); - t.width=300,t.position.set(158,550),t.activated=!this.busy,t.onClick=()=>{ - this.load()} - ,this.body.addChild(t)} - return void this.drawPanel()} - const e=new Ke; - e.y=174,this.body.addChild(e); - let n=0; - this.shop.offers.forEach(t=>{ - var i,h,r,o; - const a=new Ke; - a.y=n,e.addChild(a); - const c=this.itemText(t),l=this.addLabel(c.title,160,14,18,t.sold?Hbi.subtle:Hbi.text,408,a),u=this.addLabel(c.desc,160,l.y+l.height+10,15,Hbi.muted,256,a),d=Math.max(132,u.y+u.height+18),f=(new ep).roundRect(24,0,568,d,12).fill(Hbi.surface).stroke({ - color:Hbi.border,width:1} - ); - a.addChildAt(f,0),a.addChildAt((new ep).roundRect(38,(d-112)/2,108,112,12).fill(Hbi.surfaceRaised),1); - const p=null==(i=s.run)?void 0:i.corps[t.targetCorp],w={ - allLevel:"UI_LEVELUP",allSoldier:"ICON_UNIT",attackSpeed:"UI_ATTACK_SPEED",moveSpeed:"UI_MOVE_SPEED",manaRegen:"UI_MAGIC_WAND"} - [t.type]; - if(w){ - const t=new Xe(RS.getTexture("UI_Ekkorr",w)); - t.scale.set(Math.min(92/t.width,96/t.height)),t.position.set(92-t.width/2,(d-t.height)/2),a.addChild(t)} - else if(p){ - const i="heroReplace"===t.type,s=i||"legionLevel"===t.type,e=i&&p.heroStage>0?null==(h=iR.getInstance().getBookVO(t.heroKind))?void 0:h.evolKindNum:t.heroKind; - (i?[y5i(p),e||t.heroKind]:"legionLevel"===t.type?[y5i(p),p.soldierKind]:["heroUp"===t.type?y5i(p):p.soldierKind]).forEach((i,e)=>{ - if(!i)return; - const n=new c4,h="soldierUp"===t.type||"soldierAdd"===t.type||"legionLevel"===t.type&&1===e; - n.setDataWithKindNum(i,h?0:Math.max(0,p.heroStage-1)),n.scale.set(Math.min((s?70:94)/n.width,(s?44:94)/n.height)),n.position.set(92-n.width/2,s?(d-108)/2+66*e+(42-n.height)/2:(d-n.height)/2),a.addChild(n)} - ),i&&this.addLabel("↓",85,d/2-14,20,Hbi.text,void 0,a)} - const g=new u5i(t.sold?m3i("구매 완료"):t.available?m3i("## 코인").replace(/##/g,String(t.price)):m3i("구매 불가")); - g.width=142,g.height=50,g.position.set(432,d-64),g.activated=!this.busy&&!(null==(r=s.run)?void 0:r.battlePending)&&t.available&&((null==(o=s.run)?void 0:o.wallet)??0)>=t.price,g.onClick=()=>{ - this.act(()=>s.shopBuy(t.id))} - ,a.addChild(g),n+=d+12} - ); - const h=Math.min(1,Math.max(1,this.height-166-e.y)/Math.max(1,n-12)); - e.scale.set(h),e.x=(this.width-this.width*h)/2,0===this.shop.offers.length&&this.centered(m3i("모든 상점 강화를 완료했습니다"),315,18); - const r=new u5i(m3i("새로고침 · ## 코인").replace(/##/g,String(this.shop.refreshPrice))); - r.color=nB.BROWN,r.width=280,r.height=54,r.position.set((this.width-r.width)/2,this.height-150),r.activated=!this.busy&&!(null==(t=s.run)?void 0:t.battlePending)&&this.shop.canRefresh&&((null==(i=s.run)?void 0:i.wallet)??0)>=this.shop.refreshPrice; - const o=this.shop.revision; - r.onClick=()=>{ - this.act(()=>s.shopRefresh(o))} - ,this.body.addChild(r),this.centered(m3i("상품을 모두 구매하면 무료로 새로고침됩니다"),this.height-90,14,Hbi.muted); - const a=new u5i(Bbi("NEXT")); - a.width=280,a.height=48,a.position.set((this.width-a.width)/2,this.height-62),a.activated=!this.busy,a.onClick=async()=>{ - var t; - if(!this.busy){ - this.busy=!0,a.activated=!1; - try{ - await(null==(t=this.onLeave)?void 0:t.call(this))} - catch(frt){ - bH.getInstance().showMessage(frt.message)} - finally{ - this.busy=!1,this.parent&&this.refresh()} - } - } - ,this.body.addChild(a),this.drawPanel()} - onCloseBtnClick(){ - this.busy||super.onCloseBtnClick()} - async load(){ - if(!this.busy){ - this.busy=!0,this.failed=!1,this.refresh(); - try{ - this.shop=(await ryi.getInstance().fetchShop()).shop,this.loaded=!0} - catch(t){ - this.failed=!0,bH.getInstance().showMessage(t.message)} - finally{ - this.busy=!1,this.refresh()} - } - } - async act(t){ - if(!this.busy){ - this.busy=!0,this.refresh(); - try{ - const i=await t(); - this.shop=i.shop; - const s=null!=i.targetCorp?m3i("##군단에 적용했습니다").replace(/##/g,String(i.targetCorp+1)):void 0!==i.autoRefreshed?m3i("상품을 구매했습니다"):m3i("상점이 갱신되었습니다"); - bH.getInstance().showMessage(s+(i.autoRefreshed?"\n"+m3i("모두 구매하여 무료로 새로고침했습니다"):""))} - catch(i){ - bH.getInstance().showMessage(i.message); - try{ - this.shop=(await ryi.getInstance().fetchShop(!0)).shop} - catch{ - this.shop=null,this.loaded=!1,this.failed=!0} - } - finally{ - this.busy=!1,this.refresh()} - } - } - } - ; - Qt(v3i,"MiniAscentShopPopup"),Zt(v3i,"_instance"); - let _3i=v3i; - const M3i=Object.freeze(Object.defineProperty({ - __proto__:null,MiniAscentShopPopup:_3i} - ,Symbol.toStringTag,{ - value:"Module"} - )),b3i=class t extends c5i{ - constructor(){ - super(),Zt(this,"usesRunWallet",!0),Zt(this,"lblTitle"),Zt(this,"lblLevel"),Zt(this,"lblHint"),Zt(this,"field",new Ke),Zt(this,"map",new Xe),Zt(this,"mapMask",new ep),Zt(this,"fieldChrome",new ep),Zt(this,"versus",new Xe),Zt(this,"tacticLines",new ep),Zt(this,"tacticLabels",[]),Zt(this,"tactics",[]),Zt(this,"chrome",new ep),Zt(this,"tokenScale",1),Zt(this,"slotMarks",[]),Zt(this,"lblEmpty",[]),Zt(this,"allyTokens",[]),Zt(this,"enemyTokens",[]),Zt(this,"btnStart"),Zt(this,"btnGiveUp"),Zt(this,"btnBack"),Zt(this,"btnAuto"),Zt(this,"btnDevClear"),Zt(this,"onAuto",null),Zt(this,"fieldW",0),Zt(this,"fieldH",0),Zt(this,"vertical",!0),Zt(this,"ally",[]),Zt(this,"formation",[]),Zt(this,"dragSlot",-1),Zt(this,"dragOffX",0),Zt(this,"dragOffY",0),Zt(this,"hoverSlot",-1),Zt(this,"busy",!1),Zt(this,"onStart",null),Zt(this,"onGiveUp",null),Zt(this,"onDevClear",null),Zt(this,"onBack",null),Zt(this,"onFormationChange",null),this.canCloseShell=()=>!this.busy&&this.dragSlot<0,this.on("removed",()=>this.detachStage()),this.chrome.eventMode="none",this.contentContainer.addChild(this.chrome),this.lblTitle=new iG("",16767332,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:24,lineHeight:30} - ),this.lblTitle.textColor=Hbi.accent,this.lblTitle.visible=!1,this.contentContainer.addChild(this.lblTitle),this.lblLevel=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_16),this.contentContainer.addChild(this.lblLevel),this.lblHint=new iG(NB.getText("GAME_1816","아군 군단을 끌어서 자리를 바꾸세요"),Hbi.muted,hD.DEFAULT_FONT_OPTION_15),this.lblHint.textColor=Hbi.muted,this.contentContainer.addChild(this.lblHint),this.contentContainer.addChild(this.field),this.map.eventMode="none",this.field.addChild(this.map),this.mapMask.eventMode="none",this.fieldChrome.eventMode="none",this.field.addChild(this.mapMask,this.fieldChrome),this.map.mask=this.mapMask,this.tacticLines.eventMode="none",this.field.addChild(this.tacticLines),this.versus.anchor.set(.5),this.versus.eventMode="none",this.field.addChild(this.versus); - for(let t=0; - t<5; - t++){ - const t=new ep; - t.eventMode="none",this.field.addChild(t),this.slotMarks.push(t); - const i=new iG("+",16777215,hD.DEFAULT_FONT_OPTION_15); - i.textSize=44,i.textColor=16777215,i.eventMode="none",this.field.addChild(i),this.lblEmpty.push(i)} - for(let t=0; - t<5; - t++)this.enemyTokens.push(this.makeToken(!1)); - for(let t=0; - t<5; - t++){ - const i=this.makeToken(!0),s=t; - i.root.on("pointerdown",t=>this.onDown(s,t)),this.allyTokens.push(i)} - this.btnStart=new u5i(NB.getText("GAME_1818","전투 시작")),this.btnStart.width=184,this.btnStart.onClick=()=>this.finish(!0),this.contentContainer.addChild(this.btnStart),this.btnGiveUp=new u5i(Bbi("BATTLE_GIVEUP"),16742263),this.btnGiveUp.onClick=()=>this.confirmGiveUp(),this.contentContainer.addChild(this.btnGiveUp),this.btnBack=new u5i(Bbi("ROUTE")),this.btnBack.width=184,this.btnBack.color=nB.BROWN,this.btnBack.onClick=()=>this.finish(!1),this.contentContainer.addChild(this.btnBack),this.btnAuto=new u5i(Bbi("AUTO_BATTLE")),this.btnAuto.width=184,this.btnAuto.onClick=()=>{ - var t; - this.busy||null==(t=this.onAuto)||t.call(this)} - ,this.contentContainer.addChild(this.btnAuto),this.btnDevClear=new e3i("DEV 즉시 클리어"),this.btnDevClear.width=150,this.btnDevClear.height=40,this.btnDevClear.activatedTextColor=10474495,this.btnDevClear.onClick=()=>this.devClear(),this.contentContainer.addChild(this.btnDevClear)} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - makeToken(i){ - const s=new Ke,e=new ep; - e.eventMode="none",s.addChild(e); - const n=new c4; - n.eventMode="none",s.addChild(n); - const h=new c4; - h.eventMode="none",s.addChild(h); - const r=new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_16); - r.textColor=16777215,r.eventMode="none"; - const o={ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:16,lineHeight:20} - ,a=new iG("",Hbi.text,o),c=new iG("",Hbi.text,o); - a.eventMode=c.eventMode="none",s.addChild(a,c,r); - const l=t.TILE_W,u=t.TILE_H; - return e.roundRect(-l/2,-u/2,l,u,10).fill({ - color:Hbi.surface,alpha:.97} - ).stroke({ - width:1.5,color:i?10276486:14060672} - ),i?(s.eventMode="static",s.cursor="grab",s.hitArea=new $i(-l/2,-u/2,l,u)):s.eventMode="none",this.field.addChild(s),{ - root:s,frame:e,hero:n,soldier:h,lblCount:r,lblHeroLevel:a,lblSoldierLevel:c} - } - onCloseBtnClick(){ - this.busy||super.onCloseBtnClick()} - setData(i,s,e){ - var n; - this.btnBack.visible=!(null==(n=ryi.getInstance().run)?void 0:n.battleOnly),this.btnGiveUp.text=Bbi("BATTLE_GIVEUP"),this.detachStage(),this.ally=i.ally,this.tactics=i.tactics??[],this.formation=[...s],this.vertical=Qbi(e),this.busy=!1,this.dragSlot=-1,this.hoverSlot=-1,this.lblTitle.text=NB.getText("GAME_1819","## 배치").replace(/##/g,S5i(i.floor)); - const h=i.opponents.find(t=>t.id===i.opponentId); - this.lblLevel.text=(null==h?void 0:h.training)?"훈련 상대":(null==h?void 0:h.name)??"상대 편성",this.height=Math.min(900,SS.safeHeight-48),this.fieldW=this.width-48,this.fieldH=Math.max(160,this.height-t.FIELD_TOP-t.BOTTOM_RESERVE-(this.tactics.length?86:0)),this.field.position.set((this.width-this.fieldW)/2,t.FIELD_TOP),this.map.texture=RS.getTexture("GW_BG2",`gwbg${ - e} - `); - const r=Math.max(this.fieldW/this.map.texture.width,this.fieldH/this.map.texture.height); - this.map.scale.set(r),this.map.position.set((this.fieldW-this.map.width)/2,(this.fieldH-this.map.height)/2),this.mapMask.clear().roundRect(0,0,this.fieldW,this.fieldH,16).fill(16777215),this.fieldChrome.clear().roundRect(0,0,this.fieldW,this.fieldH,16).fill({ - color:1513744,alpha:.18} - ).stroke({ - width:2,color:7692356} - ),this.tokenScale=Math.min(1,.16*this.fieldH/(t.TILE_H+8),this.fieldW*(this.vertical?.23:.2)/t.TILE_W); - for(const t of[...this.allyTokens,...this.enemyTokens])t.root.scale.set(this.tokenScale); - this.layoutVersus(); - const o=this.slotPositions("enemy"); - for(let t=0; - t<5; - t++){ - const s=this.enemyTokens[t],e=i.enemy[t]; - s.root.visible=!!(null==e?void 0:e.heroKindNum),(null==e?void 0:e.heroKindNum)&&(this.fillToken(s,e),s.root.position.set(o[t].x,o[t].y))} - this.layoutAlly(),this.layoutChrome(),this.layoutTactics(),this.setBusy(!1)} - slotPositions(i){ - return syi(this.vertical,i).map((s,e)=>({ - x:s.x*this.fieldW+(!this.vertical&&e<3?("ally"===i?-1:1)*t.FRONT_COLUMN_OFFSET:0),y:s.y*this.fieldH} - ))} - layoutVersus(){ - this.versus.texture=Cbi.texture("UI_VS"),this.versus.position.set(this.fieldW/2,this.fieldH/2); - const i=this.slotPositions("ally")[0],s=this.slotPositions("enemy")[0],e=this.vertical?Math.abs(i.y-s.y)-t.TILE_H*this.tokenScale:Math.abs(i.x-s.x)-t.TILE_W*this.tokenScale,n=this.vertical?this.versus.texture.height:this.versus.texture.width; - this.versus.scale.set(Math.min(1,Math.max(0,e-16)/n))} - fillToken(t,i){ - t.hero.setDataWithKindNum(i.heroKindNum,i.heroTrans); - const s=i.soldierTiers[0],e=i.soldierTiers.reduce((t,i)=>t+i.count,0); - t.soldier.setDataWithKindNum((null==s?void 0:s.kindNum)??0,Math.max(0,Math.round(((null==s?void 0:s.plusLevel)??0)/6))),t.soldier.active=e>0; - const n=Qt((t,i,s,e,n,h)=>{ - t.scale.set(1),t.scale.set(Math.min(n/t.width,h/t.height)),t.position.set(e+(n-t.width)/2,8-t.height),i.text=`Lv.${ - s} - `,i.scale.set(1),i.scale.set(Math.min(1,n/Math.max(1,i.width))),i.position.set(e+(n-i.width)/2,11)} - ,"unit"); - n(t.hero,t.lblHeroLevel,i.heroLevel??10,-68,68,44),n(t.soldier,t.lblSoldierLevel,i.soldierLevel??10,6,62,40),t.lblCount.text=`×${ - e} - `,t.lblCount.scale.set(1),t.lblCount.scale.set(Math.min(1,54/Math.max(1,t.lblCount.width))),t.lblCount.position.set(56-t.lblCount.width,9-t.lblCount.height)} - layoutAlly(){ - const i=this.slotPositions("ally"),s=t.TILE_W*this.tokenScale,e=t.TILE_H*this.tokenScale; - for(let t=0; - t<5; - t++){ - const n=i[t].x,h=i[t].y,r=t===this.hoverSlot&&this.dragSlot>=0&&t!==this.dragSlot,o=this.formation[t],a=o>=0?this.ally[o]:void 0; - this.slotMarks[t].visible=!(null==a?void 0:a.heroKindNum)||r||t===this.dragSlot,this.slotMarks[t].clear().roundRect(n-s/2-3,h-e/2-3,s+6,e+6,12).fill({ - color:r?16767332:1318933,alpha:r?.4:.55} - ).stroke({ - width:r?3:1,color:r?16767332:12767656,alpha:r?1:.6} - ),this.lblEmpty[t].visible=!(null==a?void 0:a.heroKindNum),this.lblEmpty[t].scale.set(this.tokenScale),this.lblEmpty[t].x=n-this.lblEmpty[t].width/2,this.lblEmpty[t].y=h-this.lblEmpty[t].height/2; - const c=this.allyTokens[t]; - c.root.visible=!!(null==a?void 0:a.heroKindNum),(null==a?void 0:a.heroKindNum)&&(this.fillToken(c,a),t!==this.dragSlot&&(c.root.x=n,c.root.y=h,c.root.alpha=1))} - } - layoutTactics(){ - this.tacticLines.clear(); - for(const i of this.tacticLabels)i.removeFromParent(),i.destroy(); - this.tacticLabels=[]; - const t=this.slotPositions("ally"); - this.tactics.forEach((i,s)=>{ - const e=i.corps.map(t=>this.formation.indexOf(t)); - if(e.some(t=>t<0))return; - const n=t[e[0]],h=t[e[1]],r="assault"===i.kind?Hbi.accent:8636911; - this.tacticLines.moveTo(n.x,n.y).lineTo(h.x,h.y).stroke({ - width:3,color:r,alpha:i.percent?.85:.3} - ); - const o=new iG([`${ - Bbi("PAIR_LEGIONS",i.corps[0]+1,i.corps[1]+1)} - · ${ - Bbi("assault"===i.kind?"ASSAULT":"GUARD")} - ${ - i.level} - `,Bbi("assault"===i.kind?"ATTACK_EFFECT":"GUARD_EFFECT",i.percent),Bbi("TACTIC_REQUIRE",i.nextSoldiers,i.nextLevel)].join("\n"),r,{ - ...hD.DEFAULT_FONT_OPTION_15,fontSize:12,lineHeight:16} - ); - o.textColor=r,o.setWrapWidth((this.width-64)/2),o.eventMode="none",o.scale.set(Math.min(1,72/Math.max(1,o.height))),o.position.set(24+s*(this.width-48)/2,this.field.y+this.fieldH+8),this.contentContainer.addChild(o),this.tacticLabels.push(o)} - )} - layoutChrome(){ - const t=this.width; - this.lblTitle.x=(t-this.lblTitle.width)/2,this.lblTitle.y=24,this.btnDevClear.visible=xG.getInstance().development&&!!this.onDevClear,this.btnDevClear.position.set(t-24-this.btnDevClear.width,16),this.lblLevel.x=(t-this.lblLevel.width)/2,this.lblLevel.visible=!1,this.chrome.clear(); - const i=this.field.y+this.fieldH+(this.tactics.length?86:0); - this.lblHint.x=(t-this.lblHint.width)/2,this.lblHint.y=i+14,this.btnAuto.visible=false; - const s=[this.btnBack,this.btnAuto].filter(t=>t.visible); - s.forEach((t,s)=>{ - t.width=116,t.position.set(24+128*s,i+48)} - ),this.btnGiveUp.width=156,this.btnGiveUp.lbl.scale.set(1),this.btnGiveUp.lbl.scale.set(Math.min(1,(this.btnGiveUp.width-16)/Math.max(1,this.btnGiveUp.lbl.width))),this.btnGiveUp.lbl.position.set(-this.btnGiveUp.lbl.width/2,-this.btnGiveUp.lbl.height/2),this.btnStart.width=t-48-128*s.length-12-this.btnGiveUp.width,this.btnStart.position.set(24+128*s.length,i+48),this.btnGiveUp.position.set(this.btnStart.x+this.btnStart.width+12,this.btnStart.y)} - onDown(t,i){ - if(this.busy||this.dragSlot>=0)return; - const s=this.allyTokens[t]; - if(!s.root.visible)return; - i.stopPropagation(),this.dragSlot=t; - const e=this.field.toLocal(i.global); - this.dragOffX=s.root.x-e.x,this.dragOffY=s.root.y-e.y,s.root.alpha=.9,s.root.cursor="grabbing",this.field.addChild(s.root),this.layoutAlly(); - const n=SS.stage; - n&&(n.on("globalpointermove",this.onMove,this),n.on("pointerup",this.onUp,this),n.on("pointerupoutside",this.onUp,this))} - onMove(t){ - if(this.dragSlot<0)return; - const i=this.field.toLocal(t.global),s=this.allyTokens[this.dragSlot]; - s.root.x=i.x+this.dragOffX,s.root.y=i.y+this.dragOffY; - const e=this.nearestSlot(s.root.x,s.root.y); - e!==this.hoverSlot&&(this.hoverSlot=e,this.layoutAlly())} - onUp(t){ - var i; - if(this.dragSlot<0)return; - const s=this.dragSlot,e=this.allyTokens[s],n=this.nearestSlot(e.root.x,e.root.y); - this.detachStage(),e.root.cursor="grab",this.dragSlot=-1,this.hoverSlot=-1,n>=0&&n!==s&&(this.formation=iyi(this.formation,s,n)),this.layoutAlly(),this.layoutTactics(),null==(i=this.onFormationChange)||i.call(this,[...this.formation])} - nearestSlot(i,s){ - const e=this.slotPositions("ally"); - let n=-1,h=t.DROP_R*this.tokenScale; - for(let t=0; - t<5; - t++){ - const r=Math.hypot(e[t].x-i,e[t].y-s); - r<h&&(h=r,n=t)} - return n} - detachStage(){ - const t=SS.stage; - t&&(t.off("globalpointermove",this.onMove,this),t.off("pointerup",this.onUp,this),t.off("pointerupoutside",this.onUp,this))} - finish(t){ - if(this.busy)return; - this.setBusy(!0),this.detachStage(),this.dragSlot=-1; - const i=[...this.formation]; - queueMicrotask(async()=>{ - var s,e; - try{ - t?await(null==(s=this.onStart)?void 0:s.call(this,i)):await(null==(e=this.onBack)?void 0:e.call(this))} - finally{ - this.setBusy(!1)} - } - )} - setBusy(t){ - this.busy=t; - for(const i of[this.btnStart,this.btnGiveUp,this.btnBack,this.btnAuto,this.btnDevClear])i.activated=!t; - this.drawPanel()} - confirmGiveUp(){ - if(this.busy||this.dragSlot>=0||!this.onGiveUp)return; - const t=this.onGiveUp; - this.setBusy(!0); - const i=NKt.getInstance(); - i.title=Bbi("BATTLE_GIVEUP"),i.textAlignCenter=!0; - let s=!1; - const e=Qt(i=>{ - s||(s=!0,i&&this.parent?queueMicrotask(async()=>{ - try{ - await t()} - catch(i){ - bH.getInstance().showMessage(i.message)} - finally{ - this.setBusy(!1)} - } - ):this.setBusy(!1))} - ,"answer"); - i.show(Bbi("BATTLE_GIVEUP_QUESTION"),()=>e(!0),()=>e(!1))} - devClear(){ - if(this.busy||this.dragSlot>=0||!this.onDevClear)return; - const t=this.onDevClear; - this.setBusy(!0),this.detachStage(),queueMicrotask(async()=>{ - try{ - await t()} - catch(i){ - bH.getInstance().showMessage(i.message)} - finally{ - this.setBusy(!1)} - } - )} - hide(){ - this.detachStage(),super.hide()} - hideImmediately(){ - this.detachStage(),super.hideImmediately()} - onBackButton(){ - return this.finish(!1),!0} - } - ; - Qt(b3i,"MiniAscentDeployPopup"),Zt(b3i,"_instance"),Zt(b3i,"FIELD_TOP",128),Zt(b3i,"BOTTOM_RESERVE",116),Zt(b3i,"TILE_W",152),Zt(b3i,"TILE_H",88),Zt(b3i,"DROP_R",80),Zt(b3i,"FRONT_COLUMN_OFFSET",25); - let y3i=b3i; - const E3i=Object.freeze(Object.defineProperty({ - __proto__:null,MiniAscentDeployPopup:y3i} - ,Symbol.toStringTag,{ - value:"Module"} - )),A3i=class t extends pB{ - constructor(){ - super(),Zt(this,"body",new Ke),this.contentContainer.addChild(this.body)} - static getInstance(){ - return this.instance??(this.instance=new t)} - async presentReward(t,i=!1){ - const s=await Promise.allSettled([Cbi.loadCrystalArt(),ryi.getInstance().fetchCrystals(!0)]),e="fulfilled"===s[0].status?s[0].value:ls.EMPTY; - this.width=550,this.height=t.tickets?428:366,this.bg.visible=this.txtTitle.visible=!1; - for(const a of this.body.removeChildren())a.destroy({ - children:!0} - ); - this.body.addChild((new ep).roundRect(0,0,550,this.height,18).fill(Hbi.surface).stroke({ - color:Hbi.accent,width:2} - )); - const n=Qt((t,i,s=19,e=Hbi.text)=>{ - const n=new iG(t,e,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:s,lineHeight:s+5} - ); - n.setWrapWidth(470),n.align="center",n.position.set((550-n.width)/2,i),this.body.addChild(n)} - ,"label"); - n(Bbi(i?"CRYSTAL_RECEIVED":"CRYSTAL_BOSS_REWARD"),27,26,Hbi.accent); - const h=t.items.length>3?100:132,r=t.items.length*h+20*(t.items.length-1); - t.items.forEach((t,i)=>{ - var s,n,o; - const a=null==(s=ryi.getInstance().crystals)?void 0:s.catalog.find(i=>i.kind===t.kind),c=(550-r)/2+i*(h+20),l=H5i(e,gyi(t.kind),t.grade,null==a?void 0:a.effect,h,null==a?void 0:a.target,null==(o=null==(n=ryi.getInstance().crystals)?void 0:n.catalog.find(i=>i.kind===t.secondaryKind))?void 0:o.effect); - l.position.set(c,87),this.body.addChild(l); - const u=new iG(j5i(t.grade),Hbi.text,hD.DEFAULT_FONT_OPTION_16); - u.position.set(c+(h-u.width)/2,229),this.body.addChild(u)} - ),t.tickets&&n(Bbi("CRYSTAL_FIRST_CLEAR",t.tickets),279,18,Hbi.accent); - const o=new u5i(Bbi("CRYSTAL_CONFIRM")); - return o.width=260,o.height=44,o.position.set(145,this.height-67),o.onClick=()=>this.hideImmediately(),this.body.addChild(o),new Promise(t=>{ - this.hideHandler=t,this.show()} - )} - } - ; - Qt(A3i,"MiniAscentCrystalRewardPopup"),Zt(A3i,"instance"); - let S3i=A3i; - const T3i=Object.freeze(Object.defineProperty({ - __proto__:null,MiniAscentCrystalRewardPopup:S3i} - ,Symbol.toStringTag,{ - value:"Module"} - )),C3i=class t extends c5i{ - constructor(){ - super(),Zt(this,"lblHeader"),Zt(this,"lblCleared"),Zt(this,"rewardIcons",new Ke),Zt(this,"btnExit"),Zt(this,"onExit",null),this.btnClose.visible=!1; - const t=new iG(Bbi("RESULT_TITLE"),Hbi.accent,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:24,lineHeight:30} - ); - t.position.set((this.width-t.width)/2,138),this.contentContainer.addChild(t),this.lblHeader=new iG("",Hbi.danger,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:24,lineHeight:30} - ),this.lblHeader.textColor=Hbi.danger,this.contentContainer.addChild(this.lblHeader),this.lblCleared=new iG("",Hbi.accent,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:32,lineHeight:38} - ),this.lblCleared.textColor=Hbi.accent,this.contentContainer.addChild(this.lblCleared),this.contentContainer.addChild(this.rewardIcons),this.btnExit=new u5i(NB.getText("COMMON_1","확인")),this.btnExit.onClick=this.onExitClick.bind(this),this.contentContainer.addChild(this.btnExit)} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - setData(t,i){ - const s=this.width; - let e=Math.max(170,.3*this.height); - this.lblHeader.textSize=i?36:24,this.lblHeader.lineHeight=i?44:30,this.lblHeader.setWrapWidth(s-64),this.lblHeader.align="center",this.lblHeader.text=i?Bbi("CHAPTER_CLEAR",i):Bbi("DEFEAT",t.floor),this.lblHeader.textColor=i?Hbi.accent:Hbi.danger,this.lblHeader.x=.5*(s-this.lblHeader.width),this.lblHeader.y=e,e+=this.lblHeader.height+28,this.lblCleared.visible=!i,this.rewardIcons.visible=!!i,i&&(this.setRewardIcons(t),this.rewardIcons.position.set((s-this.rewardIcons.width)/2,e)),this.lblCleared.text=Bbi("SUMMARY",t.cleared,t.runCoin),this.lblCleared.textSize=18,this.lblCleared.setWrapWidth(s-48),this.lblCleared.align="center",this.lblCleared.x=.5*(s-this.lblCleared.width),this.lblCleared.y=e,e+=56,this.btnExit.width=240,this.btnExit.x=.5*(s-this.btnExit.width),this.btnExit.y=this.height-62,e+=this.btnExit.height+30,this.height=e} - setRewardIcons(t){ - for(const s of this.rewardIcons.removeChildren())s.destroy({ - children:!0} - ); - let i=0; - for(const[s,e]of[["ui_coin",t.runCoin],["ui_challenge_seal",t.sealsGained??0]]){ - const t=new Ke,n=new Xe(Cbi.texture(s)); - n.scale.set(Math.min(42/n.width,42/n.height)),n.position.set((42-n.width)/2,(42-n.height)/2); - const h=new iG(String(e),Hbi.accent,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:30,lineHeight:36} - ); - h.scale.set(Math.min(1,136/Math.max(1,h.width))),h.position.set(54,(42-h.height)/2),t.addChild(n,h),t.x=i,this.rewardIcons.addChild(t),i+=t.width+64} - } - onExitClick(){ - const t=this.onExit; - this.onExit=null,this.hide(),queueMicrotask(()=>{ - t&&t()} - )} - onBackButton(){ - return super.onBackButton()} - } - ; - Qt(C3i,"MiniAscentResultPopup"),Zt(C3i,"_instance"); - let O3i=C3i; - const I3i=Object.freeze(Object.defineProperty({ - __proto__:null,MiniAscentResultPopup:O3i} - ,Symbol.toStringTag,{ - value:"Module"} - )); - function k3i(t,i=Math.random){ - const s={ - normal:0,rare:1,epic:2} - ,e=Math.max(...t.map(t=>s[t.rarity??"normal"])),n=t.flatMap((t,i)=>s[t.rarity??"normal"]===e?[i]:[]); - return n.length?n[Math.floor(i()*n.length)]:-1} - Qt(k3i,"automaticCardIndex"); - const x3i=class t extends c5i{ - constructor(){ - super(),Zt(this,"usesRunWallet",!0),Zt(this,"lblHeader"),Zt(this,"lblReward"),Zt(this,"lblHint"),Zt(this,"lblCountdown"),Zt(this,"choiceTimer",new Rx(100)),Zt(this,"choiceDeadline",0),Zt(this,"autoSelect",Qt(()=>!1,"autoSelect")),Zt(this,"presentationId",0),Zt(this,"onVisibility",Qt(()=>{ - document.hidden?this.stopCountdown():this.parent&&!this.busy&&this.startCountdown()} - ,"onVisibility")),Zt(this,"rewardBg",new ep),Zt(this,"rewardCoin",new Xe(Cbi.texture("ui_coin"))),Zt(this,"cardHeight",t.CARD_H),Zt(this,"iconTop",t.ICON_TOP),Zt(this,"cards",[]),Zt(this,"btnNext"),Zt(this,"tabId","battle"),Zt(this,"offer",null),Zt(this,"selected",-1),Zt(this,"busy",!1),Zt(this,"selectionKey",""),Zt(this,"onDone",null),this.canCloseShell=()=>!this.busy,this.btnClose.visible=!1,this.bg.visible=!1,this.txtTitle.visible=!1,this.lblHeader=new iG("",Hbi.accent,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:32,lineHeight:38} - ),this.lblHeader.textColor=Hbi.accent,this.contentContainer.addChild(this.lblHeader),this.rewardCoin.eventMode="none",this.contentContainer.addChild(this.rewardBg,this.rewardCoin),this.lblHint=new iG(NB.getText("GAME_1821","카드를 하나 선택하세요"),Hbi.muted,hD.DEFAULT_FONT_OPTION_15),this.contentContainer.addChild(this.lblHint),this.lblCountdown=new iG("",Hbi.accent,hD.DEFAULT_FONT_OPTION_16),this.lblCountdown.align="center",this.lblCountdown.setWrapWidth(540),this.contentContainer.addChild(this.lblCountdown),this.choiceTimer.addEventListener("timer",()=>this.updateCountdown()),this.on("removed",()=>{ - this.stopCountdown(),document.removeEventListener("visibilitychange",this.onVisibility)} - ),this.lblReward=new iG("",Hbi.text,hD.DEFAULT_FONT_OPTION_15),this.lblReward.align="center",this.lblReward.setWrapWidth(488),this.contentContainer.addChild(this.lblReward); - for(let i=0; - i<3; - i++){ - const s=new Ke; - s.eventMode="static",s.cursor="pointer",s.hitArea=new $i(0,0,t.CARD_W,t.CARD_H); - const e=new ep; - e.eventMode="none",s.addChild(e); - const n=new iG("",Hbi.accent,{ - ...hD.DEFAULT_FONT_OPTION_15,fontSize:12,lineHeight:16} - ); - n.eventMode="none",n.align="center",n.setWrapWidth(132),n.y=10,s.addChild(n); - const h=new iG("",Hbi.accent,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:18,lineHeight:24} - ); - h.eventMode="none",h.align="center",h.setWrapWidth(148),h.y=26,s.addChild(h); - const r=new c4; - r.eventMode="none",s.addChild(r); - const o=new Ke,a=new Xe(Cbi.texture(dbi)); - a.width=a.height=100; - const c=new Xe(Cbi.texture("relic_layer_buff_count_up")); - c.width=c.height=100,c.position.set(3,-3),o.addChild(a,c),o.visible=!1,o.eventMode="none",s.addChild(o); - const l=new c4; - l.eventMode="none",l.visible=!1,s.addChild(l); - const u=new Ke; - u.eventMode="none",s.addChild(u); - const d=new iG("",Hbi.text,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:28,lineHeight:34} - ); - d.eventMode="none",d.textColor=Hbi.text,d.align="center",d.setWrapWidth(156),s.addChild(d); - const f=new iG("",Hbi.text,hD.DEFAULT_FONT_OPTION_15); - f.eventMode="none",f.textColor=Hbi.muted,f.textSize=14,f.align="center",f.setWrapWidth(152),s.addChild(f); - const p=new Ke; - p.eventMode="none",p.visible=!1; - const w=new Ke,g=new iG("",Hbi.muted,{ - ...hD.DEFAULT_FONT_OPTION_15,fontSize:13,lineHeight:18} - ); - g.align="center",g.setWrapWidth(152),p.addChild(w,g),s.addChild(p); - const m=new Ke; - m.eventMode="none",m.visible=!1,s.addChild(m); - const v=new c4; - v.eventMode="none",v.scale.set(.528); - const _=new c4; - _.scale.set(.48); - const M=new iG("",Hbi.text,hD.DEFAULT_FONT_OPTION_16); - m.addChild(v,_,M); - const b=Qt(()=>{ - const t=new iG("",Hbi.text,{ - ...hD.DEFAULT_FONT_OPTION_15,fontSize:14} - ); - return t.eventMode="none",t} - ,"levelLabel"),y=b(),E=b(); - m.addChild(y,E); - const A=new Ke; - A.eventMode="none",s.addChild(A); - const S=i; - s.on("pointertap",()=>this.select(S)),this.contentContainer.addChild(s),this.cards.push({ - root:s,bg:e,icon:r,partnerIcon:l,effectIcon:o,effectBadge:c,legionBadges:u,targetSummary:m,targetHero:v,targetSoldier:_,targetCount:M,targetIconHeight:0,targetHeroLevel:y,targetSoldierLevel:E,lblHeading:h,lblRarity:n,lblTitle:d,lblDesc:f,conditions:p,conditionHeader:w,lblConditions:g,tags:A,baseY:0} - )} - this.btnNext=new u5i(Bbi("NEXT")),this.btnNext.height=t.APPLY_BUTTON_HEIGHT,this.btnNext.onClick=()=>this.done(!0),this.contentContainer.addChild(this.btnNext)} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - setData(i){ - var s,e,n,h; - this.stopCountdown(),this.presentationId++; - for(const t of this.contentContainer.children)t.scale.set(1); - this.offer=i.offer,this.autoSelect=i.autoSelect??(()=>!1),this.btnNext.text=Bbi("CARDS_APPLY"),this.btnNext.visible=!0; - const r=JSON.stringify([i.offerId,i.clearedFloor,i.offer,i.corps]); - this.selectionKey!==r&&(this.selected=-1),this.selectionKey=r,this.busy=!1; - const o=this.width; - this.lblHeader.text=null!=i.clearedFloor?NB.getText("GAME_1822","## 클리어!").replace(/##/g,S5i(i.clearedFloor)):NB.getText("GAME_1823","성장 카드"),this.lblHeader.x=(o-this.lblHeader.width)/2,this.lblHeader.y=130; - const a=[]; - this.rewardCoin.visible=i.coinGained>0,this.rewardCoin.width=this.rewardCoin.height=24,this.rewardCoin.visible&&a.push(`+${ - i.coinGained} - `),i.rewards.length>0&&a.push(NB.getText("GAME_1824","우편 보상: ##").replace(/##/g,D5i(i.rewards))),this.lblReward.visible=a.length>0; - const c=this.rewardCoin.visible?this.rewardCoin.width+8:0; - this.lblReward.setWrapWidth(488-c),this.lblReward.text=a.join(" · "); - const l=c+this.lblReward.width,u=Math.max(this.rewardCoin.visible?this.rewardCoin.height:0,this.lblReward.height),d=(o-l)/2; - this.rewardCoin.position.set(d,176+(u-this.rewardCoin.height)/2),this.lblReward.position.set(d+c,176+(u-this.lblReward.height)/2),this.rewardBg.clear(),this.lblReward.visible&&this.rewardBg.roundRect(d-16,168,l+32,u+16,12).fill(Hbi.surfaceRaised); - let f=this.lblReward.visible?208+u:182; - this.lblHint.text=NB.getText("GAME_1821","카드를 하나 선택하세요"),this.lblHint.visible=!!(null==(s=i.offer)?void 0:s.length),this.lblHint.x=(o-this.lblHint.width)/2,this.lblHint.y=f,this.lblHint.visible&&(f+=this.lblHint.height+8),this.lblCountdown.visible=!!(null==(e=i.offer)?void 0:e.length)&&this.autoSelect(),this.setCountdownText(7),this.lblCountdown.y=f,this.lblCountdown.visible?f+=this.lblCountdown.height+28:this.lblHint.visible&&(f+=24); - const p=Math.min((null==(n=i.offer)?void 0:n.length)??0,this.cards.length),w=t.CARD_W,g=(o-(p*w+16*Math.max(0,p-1)))/2; - this.cardHeight=t.CARD_H,this.iconTop=t.ICON_TOP; - let m=0; - for(let t=0; - t<p; - t++){ - const s=this.cards[t],e=i.offer[t],n=Wbi[e.rarity??"normal"]??Wbi.normal; - s.lblRarity.text=T5i(e),s.lblRarity.textColor=n.accent,s.lblRarity.x=(w-s.lblRarity.width)/2,s.lblHeading.y=s.lblRarity.y+s.lblRarity.height+6,s.lblHeading.textColor=n.accent,s.lblHeading.text=k5i(i.offer[t],i.corps),s.lblHeading.x=(w-s.lblHeading.width)/2,this.iconTop=Math.max(this.iconTop,s.lblHeading.y+s.lblHeading.height+10),this.setTags(s,R5i(i.offer[t])),m=Math.max(m,s.tags.height)} - for(let v=0; - v<this.cards.length; - v++){ - const s=this.cards[v],e=null==(h=i.offer)?void 0:h[v]; - if(s.root.visible=!!e,!e)continue; - s.tags.visible&&s.tags.height<m&&this.setTags(s,R5i(e),m); - const n="armyLevel"===e.type||"armyBuff"===e.type?_bi(e):void 0; - if(s.effectIcon.visible=!!n,n){ - s.effectBadge.texture=Cbi.texture(n),s.effectBadge.width=s.effectBadge.height=100; - const i=Math.min(w-24-2*t.ICON_PADDING,t.ICON_H-8); - s.effectIcon.scale.set(i/100),s.effectIcon.position.set((w-i)/2,this.iconTop+(t.ICON_H-i)/2)} - s.tags.y=this.iconTop+t.ICON_H+14; - const r=i.corps[e.corp],o="heroUp"===e.type||"heroLevel"===e.type||"legionLevel"===e.type?r:void 0,a=o?y5i(o):Ybi(e,i.corps); - s.icon.visible=!n&&a>0,s.icon.visible&&s.icon.setDataWithKindNum(a,o?Math.max(0,o.heroStage-1):0),s.icon.scale.set(1),s.icon.scale.set(.85*Math.min(1,(w-24-2*t.ICON_PADDING)/s.icon.width,(t.ICON_H-2*t.ICON_PADDING)/s.icon.height)),s.icon.x=(w-s.icon.width)/2,s.icon.y=this.iconTop+(t.ICON_H-s.icon.height)/2; - const c="newHero"===e.type&&(e.soldierKind??0)>0&&(e.amount??0)>0; - if(s.partnerIcon.visible=!n&&(void 0!==e.partner||c),n||void 0===e.partner)!n&&c&&s.partnerIcon.setDataWithKindNum(e.soldierKind,0); - else{ - const t=i.corps[e.partner],n="dualSoldier"===e.type; - s.icon.setDataWithKindNum(n?r.soldierKind:y5i(r),n?0:Math.max(0,r.heroStage-1)),s.partnerIcon.setDataWithKindNum(n?t.soldierKind:y5i(t),n?0:Math.max(0,t.heroStage-1))} - if(s.partnerIcon.visible)for(const[i,h]of[s.icon,s.partnerIcon].entries())h.scale.set(1),h.scale.set(Math.min(72/h.width,70/h.height)),h.position.set(15.5+79*i+(72-h.width)/2,this.iconTop+(t.ICON_H-h.height)/2); - this.setLegionBadges(s,e); - const l="heroUp"===e.type||"soldierUp"===e.type||"soldierAllUp"===e.type||"soldierChange"===e.type,u="newHero"===e.type; - s.lblTitle.setStyle({ - ...s.lblTitle.getStyle(),fontSize:u?30:l?22:28,lineHeight:u?36:l?28:34} - ); - const d=Wbi[e.rarity??"normal"]??Wbi.normal; - s.lblTitle.textColor=u?16769902:e.rarity&&"normal"!==e.rarity?d.accent:Hbi.text,s.lblTitle.text=P5i(e,i.corps),s.lblTitle.x=(w-s.lblTitle.width)/2,s.lblTitle.y=s.tags.y+m+10,s.lblDesc.text=N5i(e,i.corps),s.lblDesc.visible=!!s.lblDesc.text,s.lblDesc.x=(w-s.lblDesc.width)/2,s.lblDesc.y=s.lblTitle.y+s.lblTitle.height+8,this.setConditions(s,e),"newHero"===e.type&&n?this.setTargetSummary(s,{ - heroKind:e.heroKind??0,heroStage:0,soldierKind:e.soldierKind??0,counts:[e.amount??0,0,0,0,0]} - ,!1):this.setTargetSummary(s,"newHero"===e.type||void 0!==e.partner||"armyLevel"===e.type||"armyBuff"===e.type?void 0:r),this.cardHeight=Math.max(this.cardHeight,(s.lblDesc.visible?s.lblDesc.y+s.lblDesc.height:s.lblTitle.y+s.lblTitle.height)+(s.conditions.visible?24+s.conditions.height+28:(s.targetSummary.visible?s.targetIconHeight+40:28)+t.TRANSLATION_PADDING+t.LEVEL_FOOTER_HEIGHT)),s.baseY=f,s.root.position.set(g+v*(w+16),f)} - for(const v of this.cards)v.root.visible&&v.conditions.visible&&v.conditions.position.set(0,this.cardHeight-v.conditions.height-28),v.root.visible&&v.targetSummary.visible&&v.targetSummary.position.set((w-v.targetSummary.width)/2,this.cardHeight-t.LEVEL_FOOTER_HEIGHT-v.targetIconHeight-24); - this.drawCards(),p&&(f+=this.cardHeight+40),this.btnNext.width=280,this.btnNext.position.set((o-this.btnNext.width)/2,f),this.btnNext.activated=!p||this.selected>=0,this.layoutScreen()} - setLegionBadges(i,s){ - for(const t of i.legionBadges.removeChildren())t.destroy({ - children:!0} - ); - const e="armyLevel"===s.type||"armyBuff"===s.type?["A"]:[...new Set([s.corp,...void 0!==s.partner?[s.partner]:[]])].map(t=>String(t+1)); - e.forEach((s,n)=>{ - const h=new Ke,r=new Xe(Cbi.texture("relic_layer_legion_tag")); - r.width=r.height=100; - const o=new iG(s,3151104,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:20,lineHeight:22,fontWeight:"900",stroke:{ - color:3151104,width:.6,join:"round"} - } - ); - o.scale.set(Math.min(1,22/Math.max(1,o.width),22/Math.max(1,o.height))),o.position.set(72+(22-o.width)/2,2+(22-o.height)/2),h.addChild(r,o),h.position.set(t.CARD_W-112-36*(e.length-1-n),this.iconTop),i.legionBadges.addChild(h)} - )} - setTags(i,s,e=26){ - for(const t of i.tags.removeChildren())t.destroy({ - children:!0} - ); - if(i.tags.visible=s.length>0,!s.length)return; - const n=(t.CARD_W-24-6)/2,h=s.map(t=>{ - const i=new iG(t,2502713,{ - ...hD.DEFAULT_FONT_OPTION_15,fontSize:12,lineHeight:16} - ); - return i.align="center",i.setWrapWidth(n-10),i} - ),r=Math.max(e,...h.map(t=>t.height+8)); - h.forEach((t,s)=>{ - const e=new Ke,h=(new ep).roundRect(0,0,n,r,5).fill(0===s?15915151:9754344).stroke({ - color:0===s?9204033:4357008,width:1} - ); - t.position.set((n-t.width)/2,(r-t.height)/2),e.addChild(h,t),e.position.set(12+s*(n+6),0),i.tags.addChild(e)} - )} - setConditions(i,s){ - const e=L5i(s); - i.conditions.visible=!!e,e&&(Nni(i.conditionHeader,[{ - label:Bbi("TACTIC_REQUIRE_HEADER"),color:Pni} - ]),i.conditionHeader.scale.set(1),i.conditionHeader.scale.set(Math.min(1,152/Math.max(1,i.conditionHeader.width))),i.conditionHeader.position.set((t.CARD_W-i.conditionHeader.width)/2,0),i.lblConditions.text=e,i.lblConditions.position.set((t.CARD_W-i.lblConditions.width)/2,22))} - setTargetSummary(i,s,e=!0){ - if(i.targetSummary.visible=!!s,!s)return; - i.targetHero.setDataWithKindNum(y5i(s),Math.max(0,s.heroStage-1)),i.targetSoldier.setDataWithKindNum(s.soldierKind),i.targetCount.text=`×${ - qbi(s)} - `; - const n=[i.targetHero,i.targetSoldier,i.targetCount],h=Math.max(...n.map(t=>t.height)); - let r=0; - for(const t of n)t.position.set(r,h-t.height),r+=t.width+4; - const o=Qt((t,i,s,e,n)=>{ - i.visible=e,e&&(i.text=`Lv.${ - s} - `,i.scale.set(1),i.scale.set(Math.min(1,(t.width-8)/Math.max(1,i.width))),i.position.set(t.x+(t.width-i.width)/2+n,h+3))} - ,"placeLevel"); - o(i.targetHero,i.targetHeroLevel,s.heroLevel??1,e,-6),o(i.targetSoldier,i.targetSoldierLevel,s.soldierLevel??1,e&&s.soldierKind>0,-4),i.targetSummary.scale.set(Math.min(1,(t.CARD_W-28)/(r-4))),i.targetIconHeight=h*i.targetSummary.scale.y} - layoutScreen(){ - var i; - const s=(null==(i=this.cards.find(t=>t.root.visible))?void 0:i.baseY)??174,e=this.height-t.APPLY_BUTTON_HEIGHT-12,n=Math.min(1,Math.max(1,e-24-s)/this.cardHeight); - for(let h=0; - h<this.cards.length; - h++){ - const i=this.cards[h]; - i.root.scale.set(n),i.root.x=(this.width-(3*t.CARD_W+32)*n)/2+200*h*n,i.root.y=i.baseY} - this.btnNext.y=e,this.drawPanel()} - show(){ - super.show(),document.addEventListener("visibilitychange",this.onVisibility),this.startCountdown(),this.cards.forEach((t,i)=>{ - yx.killTweensOf(t.root),yx.fromTo(t.root,{ - y:t.baseY+16,alpha:0} - ,{ - y:t.baseY,alpha:1,duration:.2,delay:.05*i} - )} - )} - hideImmediately(){ - this.stopCountdown(); - for(const t of this.cards)yx.killTweensOf(t.root); - super.hideImmediately()} - setCountdownText(t){ - this.lblCountdown.text=Bbi("CARD_AUTO_PICK",t),this.lblCountdown.x=(this.width-this.lblCountdown.width)/2} - startCountdown(){ - var t; - this.stopCountdown(),this.autoSelect()&&!this.busy&&(null==(t=this.offer)?void 0:t.length)&&!document.hidden&&(this.choiceDeadline=performance.now()+7e3,this.setCountdownText(7),this.lblCountdown.visible=!0,this.choiceTimer.start())} - stopCountdown(){ - this.choiceTimer.stop(),this.choiceDeadline=0,this.lblCountdown.visible=!1} - updateCountdown(){ - if(!this.autoSelect())return void this.stopCountdown(); - if(!this.parent||this.busy||document.hidden||!this.choiceDeadline)return; - const t=Math.max(0,Math.ceil((this.choiceDeadline-performance.now())/1e3)); - if(this.setCountdownText(t),t>0)return; - const i=k3i(this.offer??[]); - i<0?this.stopCountdown():(this.select(i),this.done(!0))} - drawCards(){ - var i,s; - const e=t.CARD_W; - for(let n=0; - n<this.cards.length; - n++){ - const h=n===this.selected,r=this.cards[n],o=Wbi[(null==(s=null==(i=this.offer)?void 0:i[n])?void 0:s.rarity)??"normal"]??Wbi.normal; - r.root.hitArea=new $i(0,0,e,this.cardHeight),r.bg.clear().roundRect(0,4,e,this.cardHeight,12).fill({ - color:0,alpha:.3} - ).roundRect(0,0,e,this.cardHeight,12).fill(h?o.surfaceSelected:o.surface).stroke({ - width:h?3:1.5,color:h?o.accent:o.border} - ).roundRect(12,this.iconTop,e-24,t.ICON_H,8).fill({ - color:o.accent,alpha:.12} - ).roundRect(e/2-16,this.cardHeight-12,32,3,1.5).fill(h?o.accent:o.border),r.conditions.visible&&r.bg.moveTo(16,r.conditions.y-12).lineTo(e-16,r.conditions.y-12).stroke({ - width:1,color:o.border,alpha:.65} - ),h&&r.bg.circle(e-13,13,10).fill(o.accent).moveTo(e-18,13).lineTo(e-14,17).lineTo(e-8,9).stroke({ - width:2,color:3155993} - )} - } - select(t){ - this.busy||(this.selected=t,this.btnNext.activated=!0,this.cards.forEach((i,s)=>{ - yx.killTweensOf(i.root),i.root.alpha=1,yx.to(i.root,{ - y:i.baseY-(s===t?10:0),duration:.16,ease:"power2.out"} - )} - ),this.drawCards())} - done(t){ - if(this.busy)return; - const i=!!this.offer&&this.offer.length>0; - if(i&&this.selected<0)return void bH.getInstance().showMessage(NB.getText("GAME_1821","카드를 하나 선택하세요")); - this.busy=!0,this.stopCountdown(),this.btnNext.activated=!1,this.drawPanel(); - const s=this.presentationId,e=this.onDone,n=i?this.selected:null; - queueMicrotask(async()=>{ - try{ - await(null==e?void 0:e(n,t))} - catch(i){ - bH.getInstance().showMessage(i.message)} - finally{ - s===this.presentationId&&(this.busy=!1,this.btnNext.activated=this.selected>=0,this.drawPanel())} - } - )} - } - ; - Qt(x3i,"MiniAscentCardPickPopup"),Zt(x3i,"_instance"),Zt(x3i,"CARD_W",184),Zt(x3i,"TRANSLATION_PADDING",30),Zt(x3i,"LEVEL_FOOTER_HEIGHT",40),Zt(x3i,"CARD_H",292+x3i.TRANSLATION_PADDING+x3i.LEVEL_FOOTER_HEIGHT),Zt(x3i,"ICON_TOP",60),Zt(x3i,"ICON_H",104),Zt(x3i,"ICON_PADDING",12),Zt(x3i,"APPLY_BUTTON_HEIGHT",60); - let R3i=x3i; - const P3i=Object.freeze(Object.defineProperty({ - __proto__:null,MiniAscentCardPickPopup:R3i} - ,Symbol.toStringTag,{ - value:"Module"} - )),N3i=class t extends Ke{ - constructor(i,s){ - super(),Zt(this,"bg",new ep),Zt(this,"pill",new ep),Zt(this,"segments",[]),Zt(this,"enabled",!0),Zt(this,"onSelect",null); - const e=t.WIDTH,n=t.HEIGHT,h=e/2; - this.bg.eventMode=this.pill.eventMode="none",this.addChild(this.bg,this.pill),[i,s].forEach((t,i)=>{ - const s=new Ke,e=new iG(t,Hbi.muted,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:19,lineHeight:24} - ),r=(new ep).moveTo(3,8).arc(7,8,4,Math.PI,0).stroke({ - color:16777215,width:2} - ).roundRect(0,7,14,10,2).fill(16777215); - e.eventMode=r.eventMode="none",s.addChild(e,r),s.x=i*h,s.eventMode="static",s.cursor="pointer",s.hitArea=new $i(0,0,h,n),s.on("pointertap",t=>{ - var s; - t.stopPropagation(),this.enabled&&(QG.getInstance().playSFX(QG.SFX_NORMAL_CLICK),null==(s=this.onSelect)||s.call(this,1===i))} - ),this.addChild(s),this.segments.push({ - root:s,label:e,lock:r} - )} - ),this.bg.roundRect(0,0,e,n,n/2).fill({ - color:1775380,alpha:.9} - ).stroke({ - color:Hbi.border,width:1.5} - )} - update(i,s,e){ - const n=t.WIDTH,h=t.HEIGHT,r=n/2; - this.enabled=e,this.alpha=e?1:.6,this.pill.clear().roundRect((i?r:0)+4,4,r-8,h-8,(h-8)/2).fill(i?7024166:Hbi.surfaceSelected).stroke({ - color:i?12609626:Hbi.accent,width:1.5} - ),this.segments.forEach(({ - label:t,lock:e} - ,n)=>{ - const o=1===n===i,a=1===n&&!s; - t.textColor=o?1===n?16770010:Hbi.accent:a?Hbi.subtle:Hbi.muted,e.visible=a,e.tint=Hbi.subtle; - const c=a?20:0,l=(r-(c+t.width))/2; - e.position.set(l,(h-17)/2),t.position.set(l+c,(h-t.height)/2)} - )} - } - ; - Qt(N3i,"MiniAscentModeSwitch"),Zt(N3i,"WIDTH",260),Zt(N3i,"HEIGHT",44); - let L3i=N3i; - const D3i=class t extends Ke{ - constructor(i,s,e,n){ - super(),this.label=`chapter-reward:${ - i.floor} - `,this.addChild((new ep).roundRect(0,0,s,t.HEIGHT,10).fill({ - color:i.claimable?Hbi.surfaceSelected:Hbi.surface,alpha:.9} - ).stroke({ - color:i.claimable?Hbi.accent:Hbi.border,width:1} - )); - const h=new iG(Bbi("CHAPTER_WAVES",i.floor),Hbi.accent,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:14} - ); - let r; - if(h.scale.set(Math.min(1,(s-12)/Math.max(1,h.width))),h.position.set((s-h.width)/2,9),this.addChild(h),i.reward){ - const t=new M4; - t.setDataFrom(i.reward),t.scale.set(.9),t.position.set((s-t.width*t.scale.x)/2,33),r=t} - else{ - const t=new Xe(Cbi.texture("ui_challenge_seal")); - t.width=t.height=56,t.position.set((s-56)/2,36),r=t} - r.eventMode="none",this.addChild(r); - const o=Qt(()=>{ - const t=new Xe(Cbi.texture(bbi)); - return t.width=t.height=30,t} - ,"crystalTicketIcon"),a=Qt(()=>{ - const t=new Xe(Cbi.texture("ui_challenge_seal")); - return t.width=t.height=30,t} - ,"sealIcon"),c=[]; - i.crystalTickets&&c.push({ - icon:o,count:i.crystalTickets,label:"chapter-crystal-tickets"} - ),i.seals&&c.push({ - icon:a,count:i.seals,label:"chapter-seals"} - ),c.forEach((t,i)=>{ - const e=new Ke,n=t.icon(),h=new iG(`×${ - t.count} - `,Hbi.accent,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:15} - ); - h.position.set(35,(30-h.height)/2),e.addChild(n,h),e.position.set((s-e.width)/2,98-32*(c.length-1-i)),e.label=t.label,this.addChild(e)} - ); - const l=new u5i(Bbi(i.claimed?"CRYSTAL_CLAIMED":"CRYSTAL_CLAIM")); - l.label=`chapter-claim:${ - i.floor} - `,l.width=s-12,l.height=42,l.lbl.textSize=14,l.lbl.scale.set(Math.min(1,(l.width-24)/Math.max(1,l.lbl.width))),l.lbl.position.set(-l.lbl.width/2,-l.lbl.height/2),l.position.set(6,128),l.activated=!e&&i.claimable,l.onClick=n,this.addChild(l),i.claimed&&(r.alpha=.55)} - } - ; - Qt(D3i,"MiniAscentChapterRewardItem"),Zt(D3i,"HEIGHT",176); - let G3i=D3i; - const B3i=Hbi.danger,U3i=class{ - constructor(){ - Zt(this,"root",new Ke),Zt(this,"ring",new ep),Zt(this,"spend",new Ke),Zt(this,"spendIcon"),Zt(this,"spendLabel"),Zt(this,"amount"),Zt(this,"timeline",null),Zt(this,"settle",null),this.root.eventMode="none",this.ring.circle(0,0,40).stroke({ - width:4,color:16777215} - ),this.ring.blendMode="add",this.spendIcon=new Xe(Cbi.texture("ui_energy")),this.spendIcon.anchor.set(0,.5),this.spendIcon.width=this.spendIcon.height=20,this.spendLabel=new iG("",B3i,hD.DEFAULT_OUTLINE_FONT_OPTION_16),this.spendLabel.textSize=20,this.spendLabel.textColor=B3i,this.spend.addChild(this.spendIcon,this.spendLabel),this.amount=new iG("",Hbi.accent,hD.DEFAULT_OUTLINE_FONT_OPTION_16),this.amount.textSize=30,this.amount.textColor=Hbi.accent,this.root.addChild(this.ring,this.spend,this.amount),this.hideAll()} - playSweep(t){ - const i=lyi.getInstance(),s=this.begin(),e=this.spendEnergy(s,0,t.cost,t.energySpent,t.energyTo)?.3:0,n=e+.3; - return this.amount.text=t.goldText,this.showAmount(s,e,t.art,n+.8),s.call(()=>{ - QG.getInstance().playSFX(QG.SFX_GOLD_GOBLIN),i.rollHeader("gold",t.goldTo,.8,16773572)} - ,[],n),s.call(()=>i.pulseHeader("gold"),[],n+.8),this.finish(s)} - playLaunch(t){ - const i=this.begin(); - this.spendEnergy(i,0,t.cost,t.energySpent,t.energyTo),i.call(()=>QG.getInstance().playSFX(QG.SFX_WAVE_CALL),[],.05); - const s=this.ring; - return i.set(s,{ - visible:!0,alpha:.7,x:t.button.x,y:t.button.y,tint:Hbi.accent} - ,.05),i.fromTo(s.scale,{ - x:.8,y:.8} - ,{ - x:2.1,y:2.1,duration:.4,ease:"power2.out"} - ,.05),i.to(s,{ - alpha:0,duration:.4,ease:"power1.in",onComplete:Qt(()=>{ - s.visible=!1} - ,"onComplete")} - ,.05),this.finish(i,.4)} - stop(){ - var t; - null==(t=this.timeline)||t.kill(),this.timeline=null,this.hideAll(); - const i=this.settle; - this.settle=null,null==i||i()} - begin(){ - this.stop(); - const t=lyi.getInstance().fxLayer; - return this.root.parent!==t&&t.addChild(this.root),this.timeline=yx.timeline(),this.timeline} - finish(t,i){ - return new Promise(s=>{ - this.settle=s; - const e=Qt(()=>{ - this.settle===s&&(this.settle=null,s())} - ,"done"); - void 0!==i&&t.call(e,[],i),t.eventCallback("onComplete",()=>{ - this.timeline=null,this.hideAll(),e()} - )} - )} - spendEnergy(t,i,s,e,n){ - if(e<=0||void 0===n)return!1; - t.call(()=>lyi.getInstance().rollHeader("energy",n,.35,B3i),[],i); - const h=this.spend,r=this.spendLabel; - r.text=`-${ - e} - `,r.position.set(this.spendIcon.width+4,-r.height/2); - const o=this.spendIcon.width+4+r.width,a=s.y-26; - return t.set(h,{ - visible:!0,alpha:0,x:s.x-o/2,y:a+6} - ,i),t.to(h,{ - alpha:1,y:a,duration:.15,ease:"power2.out"} - ,i),t.to(h,{ - y:a-10,duration:.6,ease:"power1.out"} - ,i+.15),t.to(h,{ - alpha:0,duration:.3,ease:"power1.in",onComplete:Qt(()=>{ - h.visible=!1} - ,"onComplete")} - ,i+.45),!0} - showAmount(t,i,s,e){ - const n=this.amount; - n.scale.set(1),n.pivot.set(n.width/2,n.height/2),t.set(n,{ - visible:!0,alpha:0,x:s.x,y:s.y} - ,i),t.fromTo(n.scale,{ - x:1.35,y:1.35} - ,{ - x:1,y:1,duration:.22,ease:"back.out(2)"} - ,i),t.to(n,{ - alpha:1,duration:.12} - ,i),t.to(n,{ - alpha:0,y:s.y-12,duration:.3,ease:"power1.in",onComplete:Qt(()=>{ - n.visible=!1} - ,"onComplete")} - ,e)} - hideAll(){ - for(const t of this.root.children)yx.killTweensOf(t),yx.killTweensOf(t.scale),t.visible=!1} - } - ; - Qt(U3i,"MiniAscentLobbyFx"); - let F3i=U3i; - const $3i=class t extends c5i{ - constructor(){ - super(),Zt(this,"art",new Xe(Cbi.texture("encounter_battle"))),Zt(this,"chapterPanel",new ep),Zt(this,"artRequested",!1),Zt(this,"artLoaded",!1),Zt(this,"artTop",290),Zt(this,"artBottom",600),Zt(this,"status",new iG("",Hbi.accent,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:24,lineHeight:32} - )),Zt(this,"hint",new iG(Bbi("RESET"),Hbi.muted,hD.DEFAULT_FONT_OPTION_16)),Zt(this,"start",new u5i("")),Zt(this,"sweep",new u5i(NB.getText("COMMON_379","소탕"))),Zt(this,"busy",!1),Zt(this,"selectedChapter",0),Zt(this,"lastPendingChapter",0),Zt(this,"rewardLabel",new iG(Bbi("CHAPTER_STAGE_REWARDS"),Hbi.accent,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:18,lineHeight:24} - )),Zt(this,"rewards",new Ke),Zt(this,"chapterLabel",new iG("",Hbi.accent,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:42,lineHeight:50} - )),Zt(this,"waveLabel",new iG("",Hbi.text,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:18,lineHeight:24} - )),Zt(this,"previousChapter",new u5i("")),Zt(this,"nextChapter",new u5i("")),Zt(this,"hardMode",!1),Zt(this,"modeSwitch",new L3i(Bbi("NORMAL_MODE"),Bbi("HARD_MODE"))),Zt(this,"energyIcon",new Xe(Cbi.texture("ui_energy"))),Zt(this,"energyCost",new iG("",Hbi.text,hD.DEFAULT_FONT_OPTION_16)),Zt(this,"fx",new F3i),Zt(this,"devClear",new e3i("DEV 즉시 클리어")),Zt(this,"devEnergy",new e3i("DEV 에너지+120")),this.canCloseShell=()=>!this.busy,this.status.setWrapWidth(540),this.status.align="center",this.hint.setWrapWidth(540),this.hint.align="center",this.start.width=280,this.start.height=54,this.start.onClick=()=>{ - this.startRun()} - ,this.sweep.width=220,this.sweep.height=54,this.sweep.onClick=()=>{ - this.sweepChapter()} - ,this.rewardLabel.setWrapWidth(480),this.rewardLabel.align="center",this.chapterLabel.setWrapWidth(340),this.chapterLabel.align="center",this.waveLabel.setWrapWidth(340),this.waveLabel.align="center"; - for(const[t,i]of[[this.previousChapter,-1],[this.nextChapter,1]]){ - t.width=68,t.height=68; - const s=new Xe(Cbi.texture("ui_arrow_up")); - s.anchor.set(.5),s.scale.set(Math.min(36/s.width,36/s.height)),s.rotation=i*Math.PI/2,t.addChildToContainer(s)} - this.previousChapter.onClick=()=>this.changeChapter(-1),this.nextChapter.onClick=()=>this.changeChapter(1),this.modeSwitch.onSelect=t=>this.setMode(t); - for(const t of[this.devClear,this.devEnergy])t.width=136,t.height=40,t.activatedTextColor=10474495; - this.devClear.onClick=()=>{ - this.devClearChapter()} - ,this.devEnergy.onClick=()=>{ - this.devGrantEnergy()} - ,this.contentContainer.addChild(this.chapterPanel,this.art,this.status,this.hint,this.start,this.chapterLabel,this.waveLabel,this.previousChapter,this.nextChapter,this.rewardLabel,this.rewards,this.modeSwitch,this.energyIcon,this.energyCost,this.sweep,this.devClear,this.devEnergy),this.energyCost.textSize=18,this.energyIcon.width=this.energyIcon.height=24,this.energyIcon.eventMode=this.energyCost.eventMode="none"} - static getInstance(){ - return this.instance??(this.instance=new t)} - show(){ - var t,i,s,e; - const n=ryi.getInstance(),h=this.height<760,r=null==(t=n.season)?void 0:t.hard; - r||(this.hardMode=!1); - const o=this.chapterList(); - o.some(t=>t.main===this.selectedChapter)||(this.selectedChapter=(null==(i=o[o.length-1])?void 0:i.main)??0); - const a=this.hardMode?0:(null==(s=o.find(t=>{ - var i; - return null==(i=t.rewards)?void 0:i.some(t=>t.claimable)} - ))?void 0:s.main)??0,c=n.takeLastClear(); - if(c){ - const t=c.hard===this.hardMode?o.find(t=>t.main===c.chapter+1):void 0; - t&&(this.selectedChapter=t.main)} - else a&&a!==this.lastPendingChapter&&(this.selectedChapter=a); - this.lastPendingChapter=a; - const l=o.find(t=>t.main===this.selectedChapter),u=!n.run&&!!l,d=n.run?!!n.run.hard:this.hardMode; - this.chapterLabel.textColor=d?15901582:Hbi.accent,this.chapterLabel.visible=this.waveLabel.visible=this.previousChapter.visible=this.nextChapter.visible=u,this.chapterLabel.text=l?Bbi(this.hardMode?"HARD_CHAPTER_NAME":"CHAPTER_NAME",l.main):"",this.waveLabel.text=l?Bbi("CHAPTER_WAVES",l.waves):""; - const f=o.findIndex(t=>t.main===this.selectedChapter); - this.previousChapter.activated=!this.busy&&f>0,this.nextChapter.activated=!this.busy&&f>=0&&f<o.length-1,this.previousChapter.alpha=this.previousChapter.activated?1:.3,this.nextChapter.alpha=this.nextChapter.activated?1:.3; - const p=Qt(t=>{ - var i; - return!!(null==(i=t.rewards)?void 0:i.some(t=>t.claimable))} - ,"claimable"),w=Qt((t,i)=>i?t.showRedDot():t.hideRedDot(),"dot"); - w(this.previousChapter,u&&o.some(t=>t.main<this.selectedChapter&&p(t))),w(this.nextChapter,u&&o.some(t=>t.main>this.selectedChapter&&p(t))),this.status.text=n.run?n.run.chapter?Bbi(n.run.hard?"HARD_CHAPTER_PROGRESS":"CHAPTER_PROGRESS",n.run.chapter,n.run.floor):Bbi("PROGRESS",n.run.floor):"",this.status.visible=!!this.status.text,this.status.position.set((this.width-this.status.width)/2,148); - const g=this.status.visible?this.status.y+this.status.height+18:138,m=this.height-(h?124:164); - this.chapterPanel.clear().roundRect(32,g,this.width-64,m-g,22).fill({ - color:Hbi.surfaceRaised,alpha:.55} - ).stroke({ - color:d?10506826:Hbi.border,width:d?2:1.5} - ); - const v=!n.run&&!!r; - this.modeSwitch.visible=v,v&&(this.modeSwitch.update(this.hardMode,r.unlocked,!this.busy),this.modeSwitch.position.set((this.width-L3i.WIDTH)/2,g+10)); - const _=v?h?48:54:0; - this.chapterLabel.scale.set(h?.82:1),this.chapterLabel.position.set((this.width-this.chapterLabel.width)/2,g+(h?12:22)+_),this.waveLabel.position.set((this.width-this.waveLabel.width)/2,this.chapterLabel.y+this.chapterLabel.height+(h?4:8)); - const M=this.chapterLabel.y+(this.chapterLabel.height+8+this.waveLabel.height-68)/2; - this.previousChapter.position.set(48,M),this.nextChapter.position.set(this.width-116,M),this.artTop=u?this.waveLabel.y+this.waveLabel.height+(h?8:16):g+16; - const b=u?(null==l?void 0:l.rewards)??[]:[]; - for(const I of this.rewards.removeChildren())I.destroy({ - children:!0} - ); - if(this.rewardLabel.visible=this.rewards.visible=b.length>0,b.length){ - const t=10,i=(this.width-96-t*(b.length-1))/b.length; - this.rewards.position.set(48,m-G3i.HEIGHT-16),b.forEach((s,e)=>{ - const n=new G3i(s,i,this.busy,()=>{ - this.claimChapterReward(s.floor)} - ); - n.x=e*(i+t),this.rewards.addChild(n)} - ),this.rewardLabel.position.set((this.width-this.rewardLabel.width)/2,this.rewards.y-this.rewardLabel.height-12)} - this.artBottom=b.length?this.rewardLabel.y-12:m-16,this.layoutArt(),this.artRequested||(this.artRequested=!0,Cbi.loadChapterArt().then(t=>{ - this.art.texture=t,this.artLoaded=!0,this.layoutArt()} - ).catch(t=>{ - this.artRequested=!1} - )); - const y=null==(e=n.season)?void 0:e.energy,E=!!y&&!n.run&&y.current<y.perRun; - this.start.text=n.run?Bbi("CONTINUE"):Bbi("RESTART"); - const A=u&&!!(null==l?void 0:l.cleared)&&!!y,S=this.height-(h?62:76); - if(this.sweep.visible=A,A?(this.start.width=220,this.start.position.set(this.width/2-8-this.start.width,S),this.sweep.position.set(this.width/2+8,S),this.sweep.activated=n.eventActive&&!!n.season&&!this.busy&&!E):(this.start.width=280,this.start.position.set((this.width-this.start.width)/2,S)),this.energyIcon.visible=this.energyCost.visible=!!y,y){ - this.energyCost.text=String(y.perRun),this.energyCost.textColor=E?Hbi.danger:Hbi.text; - const t=this.energyIcon.width+6+this.energyCost.width,i=this.start.y-(h?22:28); - this.energyIcon.position.set((this.width-t)/2,i),this.energyCost.position.set(this.energyIcon.x+this.energyIcon.width+6,i+(this.energyIcon.height-this.energyCost.height)/2)} - const T=E?Bbi("ENERGY_SHORT",y.perRun):v&&!r.unlocked?Bbi("HARD_LOCKED",r.unlockChapter):""; - this.hint.visible=!!T,T&&(this.hint.text=T,this.hint.scale.set(h?.85:1),this.hint.position.set((this.width-this.hint.width)/2,this.height-(h?118:142))),this.start.activated=n.eventActive&&!!n.season&&!this.busy&&!E; - const C=xG.getInstance().development&&!!n.season; - this.devClear.visible=C&&(!!n.run||u&&!(null==l?void 0:l.cleared)),this.devEnergy.visible=C&&!!y; - let O=this.artTop; - for(const I of[this.devClear,this.devEnergy])I.visible&&(I.position.set(this.width-40-I.width,O),I.activated=!this.busy,O+=I.height+6); - super.show()} - hideImmediately(){ - this.fx.stop(),super.hideImmediately()} - fxRect(t){ - const i=t.getBounds(),s=lyi.getInstance().fxLayer,e=s.toLocal(new Ai(i.x,i.y)),n=s.toLocal(new Ai(i.x+i.width,i.y+i.height)); - return new $i(e.x,e.y,n.x-e.x,n.y-e.y)} - fxCenter(t){ - const i=this.fxRect(t); - return new Ai(i.x+i.width/2,i.y+i.height/2)} - fxCostRow(){ - const t=this.fxRect(this.energyIcon),i=this.fxRect(this.energyCost); - return new Ai((t.x+i.x+i.width)/2,t.y+t.height/2)} - layoutArt(){ - const t=this.artLoaded?this.width-112:210,i=Math.max(48,this.artBottom-this.artTop); - this.art.scale.set(Math.min(1,t/this.art.texture.width,i/this.art.texture.height)),this.art.position.set((this.width-this.art.width)/2,this.artTop+(i-this.art.height)/2)} - chapterList(){ - var t; - const i=ryi.getInstance().season,s=this.hardMode?null==(t=null==i?void 0:i.hard)?void 0:t.chapters:null==i?void 0:i.chapters; - return(null==s?void 0:s.filter(t=>t.unlocked))??[]} - setMode(t){ - var i; - if(this.busy||this.hardMode===t)return; - const s=null==(i=ryi.getInstance().season)?void 0:i.hard; - !t||(null==s?void 0:s.unlocked)?(this.hardMode=t,this.selectedChapter=0,this.show()):s&&bH.getInstance().showMessage(Bbi("HARD_LOCKED",s.unlockChapter))} - changeChapter(t){ - if(this.busy)return; - const i=this.chapterList(),s=i[i.findIndex(t=>t.main===this.selectedChapter)+t]; - s&&(this.selectedChapter=s.main,this.show())} - async claimChapterReward(t){ - var i,s,e,n,h,r,o; - if(this.busy)return; - const a=ryi.getInstance(),c=this.selectedChapter,l=this.hardMode; - if(!(null==(e=null==(s=null==(i=this.chapterList().find(t=>t.main===c))?void 0:i.rewards)?void 0:s.find(i=>i.floor===t))?void 0:e.claimable))return; - const u=a.season.seasonId; - this.busy=!0,this.show(); - try{ - await a.claimChapterReward(c,t,l||void 0),bH.getInstance().showMessage(Bbi("CHAPTER_REWARD_RECEIVED"))} - catch(d){ - try{ - const i=await a.fetchState(),s=l?null==(n=i.season.hard)?void 0:n.chapters:i.season.chapters; - i.season.seasonId===u&&(null==(o=null==(r=null==(h=null==s?void 0:s.find(t=>t.main===c))?void 0:h.rewards)?void 0:r.find(i=>i.floor===t))?void 0:o.claimed)?bH.getInstance().showMessage(Bbi("CHAPTER_REWARD_RECEIVED")):bH.getInstance().showMessage(d.message)} - catch{ - bH.getInstance().showMessage(d.message)} - } - finally{ - this.busy=!1,this.parent&&this.show()} - } - async sweepChapter(){ - var t,i,s,e,n,h,r; - if(this.busy)return; - const o=ryi.getInstance(),a=this.selectedChapter,c=this.hardMode; - if(o.run||!(null==(t=this.chapterList().find(t=>t.main===a))?void 0:t.cleared))return; - const l=lyi.getInstance(),u=null==(s=null==(i=o.season)?void 0:i.energy)?void 0:s.current; - l.holdHeader({ - gold:(null==(e=o.season)?void 0:e.gold)??0,energy:u} - ),this.busy=!0,this.show(); - try{ - const{ - goldGained:t,crystalReward:i} - =await o.sweep(a,c||void 0),s=null==(h=null==(n=o.season)?void 0:n.energy)?void 0:h.current; - await this.fx.playSweep({ - cost:this.fxCostRow(),art:this.fxCenter(this.art),goldText:`${ - NB.getText("COMMON_358","골드")} - +${ - t} - `,goldTo:(null==(r=o.season)?void 0:r.gold)??0,energySpent:void 0!==u&&void 0!==s?u-s:0,energyTo:s} - ),(null==i?void 0:i.tickets)&&(o.crystals=null,bH.getInstance().showMessage(Bbi("CRYSTAL_TICKETS_GRANTED",i.tickets)))} - catch(d){ - bH.getInstance().showMessage(d.message),await o.fetchState().catch(()=>{ - } - )} - finally{ - l.releaseHeader(),this.busy=!1,this.parent&&this.show()} - } - async devClearChapter(){ - if(this.busy)return; - const t=ryi.getInstance(),i=t.run?void 0:this.selectedChapter||void 0,s=t.run?void 0:this.hardMode||void 0; - this.busy=!0,this.show(); - try{ - const e=await t.devClearChapter(i,s); - bH.getInstance().showMessage(`[DEV] ${ - e.hard?"하드 ":""} - 챕터 ${ - e.chapter} - 클리어`)} - catch(e){ - bH.getInstance().showMessage(e.message)} - finally{ - this.busy=!1,this.parent&&this.show()} - } - async devGrantEnergy(){ - if(!this.busy){ - this.busy=!0,this.show(); - try{ - await ryi.getInstance().devGrantEnergy(),bH.getInstance().showMessage("[DEV] 에너지 +120")} - catch(t){ - bH.getInstance().showMessage(t.message)} - finally{ - this.busy=!1,this.parent&&this.show()} - } - } - async startRun(){ - var t,i,s,e; - if(this.busy)return; - const n=ryi.getInstance(),h=lyi.getInstance(),r=!n.run,o=null==(i=null==(t=n.season)?void 0:t.energy)?void 0:i.current; - this.busy=!0,this.start.activated=!1,r&&h.holdHeader({ - energy:o} - ); - try{ - if(r){ - await n.start(this.selectedChapter||void 0,this.hardMode||void 0); - const t=null==(e=null==(s=n.season)?void 0:s.energy)?void 0:e.current; - await this.fx.playLaunch({ - button:this.fxCenter(this.start),cost:this.fxCostRow(),energySpent:void 0!==o&&void 0!==t?o-t:0,energyTo:t} - )} - await Syi.openBattleTab()} - catch(a){ - bH.getInstance().showMessage(a.message)} - finally{ - h.releaseHeader(),this.busy=!1,this.parent&&this.show()} - } - } - ; - Qt($3i,"MiniAscentLobbyPopup"),Zt($3i,"instance"); - let H3i=$3i; - const W3i=Object.freeze(Object.defineProperty({ - __proto__:null,MiniAscentLobbyPopup:H3i} - ,Symbol.toStringTag,{ - value:"Module"} - )),V3i=VKt("AppReview",{ - web:Qt(()=>ei(()=>Promise.resolve().then(()=>i6i),void 0).then(t=>new t.AppReviewWeb),"web")} - ),j3i=Object.freeze(Object.defineProperty({ - __proto__:null,AppReview:V3i} - ,Symbol.toStringTag,{ - value:"Module"} - )); - var K3i,z3i; - (z3i=K3i||(K3i={ - } - ))[z3i.Sunday=1]="Sunday",z3i[z3i.Monday=2]="Monday",z3i[z3i.Tuesday=3]="Tuesday",z3i[z3i.Wednesday=4]="Wednesday",z3i[z3i.Thursday=5]="Thursday",z3i[z3i.Friday=6]="Friday",z3i[z3i.Saturday=7]="Saturday"; - const Y3i=VKt("LocalNotifications",{ - web:Qt(()=>ei(()=>Promise.resolve().then(()=>n6i),void 0).then(t=>new t.LocalNotificationsWeb),"web")} - ),q3i=Object.freeze(Object.defineProperty({ - __proto__:null,LocalNotifications:Y3i,get Weekday(){ - return K3i} - } - ,Symbol.toStringTag,{ - value:"Module"} - )),X3i=class extends KKt{ - constructor(){ - super(...arguments),this.selectionStarted=!1} - async impact(t){ - const i=this.patternForImpact(null==t?void 0:t.style); - this.vibrateWithPattern(i)} - async notification(t){ - const i=this.patternForNotification(null==t?void 0:t.type); - this.vibrateWithPattern(i)} - async vibrate(t){ - const i=(null==t?void 0:t.duration)||300; - this.vibrateWithPattern([i])} - async selectionStart(){ - this.selectionStarted=!0} - async selectionChanged(){ - this.selectionStarted&&this.vibrateWithPattern([70])} - async selectionEnd(){ - this.selectionStarted=!1} - patternForImpact(t=q2i.Heavy){ - return t===q2i.Medium?[43]:t===q2i.Light?[20]:[61]} - patternForNotification(t=J2i.Success){ - return t===J2i.Warning?[30,40,30,50,60]:t===J2i.Error?[27,45,50]:[35,65,21]} - vibrateWithPattern(t){ - if(!navigator.vibrate)throw this.unavailable("Browser does not support the vibrate API"); - navigator.vibrate(t)} - } - ; - Qt(X3i,"HapticsWeb"); - let J3i=X3i; - const Q3i=Object.freeze(Object.defineProperty({ - __proto__:null,HapticsWeb:J3i} - ,Symbol.toStringTag,{ - value:"Module"} - )),Z3i=class extends KKt{ - async openAppStore(){ - throw this.createUnimplementedException()} - async requestReview(){ - throw this.createUnimplementedException()} - createUnimplementedException(){ - return new FKt("This plugin method is not implemented on this platform.",DKt.Unimplemented)} - } - ; - Qt(Z3i,"AppReviewWeb"); - let t6i=Z3i; - const i6i=Object.freeze(Object.defineProperty({ - __proto__:null,AppReviewWeb:t6i} - ,Symbol.toStringTag,{ - value:"Module"} - )),s6i=class extends KKt{ - constructor(){ - super(...arguments),this.pending=[],this.deliveredNotifications=[],this.hasNotificationSupport=()=>{ - if(!("Notification"in window)||!Notification.requestPermission)return!1; - if("granted"!==Notification.permission)try{ - new Notification("")} - catch(frt){ - if(frt instanceof Error&&"TypeError"===frt.name)return!1} - return!0} - } - async getDeliveredNotifications(){ - const t=[]; - for(const i of this.deliveredNotifications){ - const s={ - title:i.title,id:parseInt(i.tag),body:i.body} - ; - t.push(s)} - return{ - notifications:t} - } - async removeDeliveredNotifications(t){ - for(const i of t.notifications){ - const t=this.deliveredNotifications.find(t=>t.tag===String(i.id)); - null==t||t.close(),this.deliveredNotifications=this.deliveredNotifications.filter(()=>!t)} - } - async removeAllDeliveredNotifications(){ - for(const t of this.deliveredNotifications)t.close(); - this.deliveredNotifications=[]} - async createChannel(){ - throw this.unimplemented("Not implemented on web.")} - async deleteChannel(){ - throw this.unimplemented("Not implemented on web.")} - async listChannels(){ - throw this.unimplemented("Not implemented on web.")} - async schedule(t){ - if(!this.hasNotificationSupport())throw this.unavailable("Notifications not supported in this browser."); - for(const i of t.notifications)this.sendNotification(i); - return{ - notifications:t.notifications.map(t=>({ - id:t.id} - ))} - } - async getPending(){ - return{ - notifications:this.pending} - } - async registerActionTypes(){ - throw this.unimplemented("Not implemented on web.")} - async cancel(t){ - this.pending=this.pending.filter(i=>!t.notifications.find(t=>t.id===i.id))} - async areEnabled(){ - const{ - display:t} - =await this.checkPermissions(); - return{ - value:"granted"===t} - } - async changeExactNotificationSetting(){ - throw this.unimplemented("Not implemented on web.")} - async checkExactNotificationSetting(){ - throw this.unimplemented("Not implemented on web.")} - async requestPermissions(){ - if(!this.hasNotificationSupport())throw this.unavailable("Notifications not supported in this browser."); - return{ - display:this.transformNotificationPermission(await Notification.requestPermission())} - } - async checkPermissions(){ - if(!this.hasNotificationSupport())throw this.unavailable("Notifications not supported in this browser."); - return{ - display:this.transformNotificationPermission(Notification.permission)} - } - transformNotificationPermission(t){ - switch(t){ - case"granted":return"granted"; - case"denied":return"denied"; - default:return"prompt"} - } - sendPending(){ - var t; - const i=[],s=(new Date).getTime(); - for(const e of this.pending)(null===(t=e.schedule)||void 0===t?void 0:t.at)&&e.schedule.at.getTime()<=s&&(this.buildNotification(e),i.push(e)); - this.pending=this.pending.filter(t=>!i.find(i=>i===t))} - sendNotification(t){ - var i; - if(null===(i=t.schedule)||void 0===i?void 0:i.at){ - const i=t.schedule.at.getTime()-(new Date).getTime(); - return this.pending.push(t),void setTimeout(()=>{ - this.sendPending()} - ,i)} - this.buildNotification(t)} - buildNotification(t){ - const i=new Notification(t.title,{ - body:t.body,tag:String(t.id)} - ); - return i.addEventListener("click",this.onClick.bind(this,t),!1),i.addEventListener("show",this.onShow.bind(this,t),!1),i.addEventListener("close",()=>{ - this.deliveredNotifications=this.deliveredNotifications.filter(()=>!this)} - ,!1),this.deliveredNotifications.push(i),i} - onClick(t){ - const i={ - actionId:"tap",notification:t} - ; - this.notifyListeners("localNotificationActionPerformed",i)} - onShow(t){ - this.notifyListeners("localNotificationReceived",t)} - } - ; - Qt(s6i,"LocalNotificationsWeb"); - let e6i=s6i; - const n6i=Object.freeze(Object.defineProperty({ - __proto__:null,LocalNotificationsWeb:e6i} - ,Symbol.toStringTag,{ - value:"Module"} - ));
Encoder 1 hunks, 23626 statements
- var Mgt={ - } - ,bgt={ - } - ,ygt={ - } - ,Egt={ - } - ; - !function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.ConnectorState=t.CONNECT_PROTOCOL_VER=t.CONNECT_JSONRPC_VER=t.OKXCONNECTOR_SESSION_LIVE_TTL=t.OKXCONNECTOR_MESSAGE_DISCONNECT_TTL=t.OKXCONNECTOR_MESSAGE_TTL=t.OKXCONNECTOR_WS_URL_PENDING_CLOSE_CODE=t.OKXCONNECTOR_WS_URL_LIST=t.OKXCONNECTOR_WS_URL_IDX_KEY=t.OKXCONNECTOR_WS_URL_3=t.OKXCONNECTOR_WS_URL_2=t.OKXCONNECTOR_WS_URL_1=t.EVENT_EMITTER_MAX_LISTENERS=t.OKXCONNECTOR_PROTOCOL_VERSION=void 0,t.OKXCONNECTOR_PROTOCOL_VERSION=2,t.EVENT_EMITTER_MAX_LISTENERS=10,t.OKXCONNECTOR_WS_URL_1="wss://wsdexpri.okx.com/ws/v1/wallet-connect-relay",t.OKXCONNECTOR_WS_URL_2="wss://wsdexpri.okx.ac/ws/v1/wallet-connect-relay",t.OKXCONNECTOR_WS_URL_3="wss://wsdexpri.coinall.ltd/ws/v1/wallet-connect-relay",t.OKXCONNECTOR_WS_URL_IDX_KEY="wuik",t.OKXCONNECTOR_WS_URL_LIST=[t.OKXCONNECTOR_WS_URL_1,t.OKXCONNECTOR_WS_URL_2,t.OKXCONNECTOR_WS_URL_3],t.OKXCONNECTOR_WS_URL_PENDING_CLOSE_CODE={ - TIME_OUT:3990,CANCELED:3991,FINISHED:3992} - ,t.OKXCONNECTOR_MESSAGE_TTL=3e5,t.OKXCONNECTOR_MESSAGE_DISCONNECT_TTL=864e5,t.OKXCONNECTOR_SESSION_LIVE_TTL=864e5,t.CONNECT_JSONRPC_VER="2.0",t.CONNECT_PROTOCOL_VER=2,t.ConnectorState={ - InitState:0,Connecting:1,Connected:2,Disconnected:3,OnError:4} - } - (Egt); - var Agt={ - } - ; - Object.defineProperty(Agt,"__esModule",{ - value:!0} - ),Agt.OKXCONNECTOR_STORAGE_TOPIC_WALLET_EXPIRE_CACHE=Agt.OKXCONNECTOR_STORAGE_TOPIC_EXPIRE_CACHE=Agt.OKXCONNECTOR_STORAGE_PROTOCOL_CACHE=Agt.OKXCONNECTOR_STORAGE_CIPHER_METHOD=Agt.OKXCONNECTOR_STORAGE_CRYPTO_CIPHERIV=Agt.OKXCONNECTOR_STORAGER_CRYPTO_SALT=Agt.OKXCONNECTOR_STORAGE_CRYPTO_PASSWORD=Agt.OKXCONNECTOR_TON_KEY=Agt.OKXCONNECTOR_CRYPTO_SENDER_PK_CACHE=Agt.OKXCONNECTOR_TOKEN_CACHE=Agt.OKXCONNECTOR_JWT_KEY=Agt.OKXCONNECTOR_SESSION_PREFIX_KEY=Agt.OKXCONNECTOR_CRYPTO_KEY=Agt.OKXCONNECTOR_CACHE_KEY_DAPP=Agt.OKXCONNECTOR_CACHE_KEY=void 0,Agt.OKXCONNECTOR_CACHE_KEY="ck",Agt.OKXCONNECTOR_CACHE_KEY_DAPP="ck_dapp",Agt.OKXCONNECTOR_CRYPTO_KEY="cck_k",Agt.OKXCONNECTOR_SESSION_PREFIX_KEY="cspk_",Agt.OKXCONNECTOR_JWT_KEY="cjk_k",Agt.OKXCONNECTOR_TOKEN_CACHE="ct",Agt.OKXCONNECTOR_CRYPTO_SENDER_PK_CACHE="csp",Agt.OKXCONNECTOR_TON_KEY="OKXStorage_ctc",Agt.OKXCONNECTOR_STORAGE_CRYPTO_PASSWORD="scp",Agt.OKXCONNECTOR_STORAGER_CRYPTO_SALT="scs",Agt.OKXCONNECTOR_STORAGE_CRYPTO_CIPHERIV="scpc",Agt.OKXCONNECTOR_STORAGE_CIPHER_METHOD="aes-256-cbc",Agt.OKXCONNECTOR_STORAGE_PROTOCOL_CACHE="okx_connect_split_cache_key",Agt.OKXCONNECTOR_STORAGE_TOPIC_EXPIRE_CACHE="okx_connect_te_cache_key",Agt.OKXCONNECTOR_STORAGE_TOPIC_WALLET_EXPIRE_CACHE="okx_connect_twe_cache_key"; - var Sgt={ - } - ,Tgt={ - exports:{ - } - } - ; - !function(t){ - var i=Qt(function(t){ - var i,s=new Float64Array(16); - if(t)for(i=0; - i<t.length; - i++)s[i]=t[i]; - return s} - ,"gf"),s=Qt(function(){ - throw new Error("no PRNG")} - ,"randombytes"),e=new Uint8Array(16),n=new Uint8Array(32); - n[0]=9; - var h=i(),r=i([1]),o=i([56129,1]),a=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),c=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),l=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),u=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),d=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]); - function f(t,i,s,e){ - t[i]=s>>24&255,t[i+1]=s>>16&255,t[i+2]=s>>8&255,t[i+3]=255&s,t[i+4]=e>>24&255,t[i+5]=e>>16&255,t[i+6]=e>>8&255,t[i+7]=255&e} - function p(t,i,s,e,n){ - var h,r=0; - for(h=0; - h<n; - h++)r|=t[i+h]^s[e+h]; - return(1&r-1>>>8)-1} - function w(t,i,s,e){ - return p(t,i,s,e,16)} - function g(t,i,s,e){ - return p(t,i,s,e,32)} - function m(t,i,s,e){ - for(var n,h=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,r=255&s[0]|(255&s[1])<<8|(255&s[2])<<16|(255&s[3])<<24,o=255&s[4]|(255&s[5])<<8|(255&s[6])<<16|(255&s[7])<<24,a=255&s[8]|(255&s[9])<<8|(255&s[10])<<16|(255&s[11])<<24,c=255&s[12]|(255&s[13])<<8|(255&s[14])<<16|(255&s[15])<<24,l=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,u=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,d=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,f=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,p=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,g=255&s[16]|(255&s[17])<<8|(255&s[18])<<16|(255&s[19])<<24,m=255&s[20]|(255&s[21])<<8|(255&s[22])<<16|(255&s[23])<<24,v=255&s[24]|(255&s[25])<<8|(255&s[26])<<16|(255&s[27])<<24,_=255&s[28]|(255&s[29])<<8|(255&s[30])<<16|(255&s[31])<<24,M=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,b=h,y=r,E=o,A=a,S=c,T=l,C=u,O=d,I=f,k=p,x=w,R=g,P=m,N=v,L=_,D=M,G=0; - G<20; - G+=2)b^=(n=(P^=(n=(I^=(n=(S^=(n=b+P|0)<<7|n>>>25)+b|0)<<9|n>>>23)+S|0)<<13|n>>>19)+I|0)<<18|n>>>14,T^=(n=(y^=(n=(N^=(n=(k^=(n=T+y|0)<<7|n>>>25)+T|0)<<9|n>>>23)+k|0)<<13|n>>>19)+N|0)<<18|n>>>14,x^=(n=(C^=(n=(E^=(n=(L^=(n=x+C|0)<<7|n>>>25)+x|0)<<9|n>>>23)+L|0)<<13|n>>>19)+E|0)<<18|n>>>14,D^=(n=(R^=(n=(O^=(n=(A^=(n=D+R|0)<<7|n>>>25)+D|0)<<9|n>>>23)+A|0)<<13|n>>>19)+O|0)<<18|n>>>14,b^=(n=(A^=(n=(E^=(n=(y^=(n=b+A|0)<<7|n>>>25)+b|0)<<9|n>>>23)+y|0)<<13|n>>>19)+E|0)<<18|n>>>14,T^=(n=(S^=(n=(O^=(n=(C^=(n=T+S|0)<<7|n>>>25)+T|0)<<9|n>>>23)+C|0)<<13|n>>>19)+O|0)<<18|n>>>14,x^=(n=(k^=(n=(I^=(n=(R^=(n=x+k|0)<<7|n>>>25)+x|0)<<9|n>>>23)+R|0)<<13|n>>>19)+I|0)<<18|n>>>14,D^=(n=(L^=(n=(N^=(n=(P^=(n=D+L|0)<<7|n>>>25)+D|0)<<9|n>>>23)+P|0)<<13|n>>>19)+N|0)<<18|n>>>14; - b=b+h|0,y=y+r|0,E=E+o|0,A=A+a|0,S=S+c|0,T=T+l|0,C=C+u|0,O=O+d|0,I=I+f|0,k=k+p|0,x=x+w|0,R=R+g|0,P=P+m|0,N=N+v|0,L=L+_|0,D=D+M|0,t[0]=b>>>0&255,t[1]=b>>>8&255,t[2]=b>>>16&255,t[3]=b>>>24&255,t[4]=y>>>0&255,t[5]=y>>>8&255,t[6]=y>>>16&255,t[7]=y>>>24&255,t[8]=E>>>0&255,t[9]=E>>>8&255,t[10]=E>>>16&255,t[11]=E>>>24&255,t[12]=A>>>0&255,t[13]=A>>>8&255,t[14]=A>>>16&255,t[15]=A>>>24&255,t[16]=S>>>0&255,t[17]=S>>>8&255,t[18]=S>>>16&255,t[19]=S>>>24&255,t[20]=T>>>0&255,t[21]=T>>>8&255,t[22]=T>>>16&255,t[23]=T>>>24&255,t[24]=C>>>0&255,t[25]=C>>>8&255,t[26]=C>>>16&255,t[27]=C>>>24&255,t[28]=O>>>0&255,t[29]=O>>>8&255,t[30]=O>>>16&255,t[31]=O>>>24&255,t[32]=I>>>0&255,t[33]=I>>>8&255,t[34]=I>>>16&255,t[35]=I>>>24&255,t[36]=k>>>0&255,t[37]=k>>>8&255,t[38]=k>>>16&255,t[39]=k>>>24&255,t[40]=x>>>0&255,t[41]=x>>>8&255,t[42]=x>>>16&255,t[43]=x>>>24&255,t[44]=R>>>0&255,t[45]=R>>>8&255,t[46]=R>>>16&255,t[47]=R>>>24&255,t[48]=P>>>0&255,t[49]=P>>>8&255,t[50]=P>>>16&255,t[51]=P>>>24&255,t[52]=N>>>0&255,t[53]=N>>>8&255,t[54]=N>>>16&255,t[55]=N>>>24&255,t[56]=L>>>0&255,t[57]=L>>>8&255,t[58]=L>>>16&255,t[59]=L>>>24&255,t[60]=D>>>0&255,t[61]=D>>>8&255,t[62]=D>>>16&255,t[63]=D>>>24&255} - function v(t,i,s,e){ - for(var n,h=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,r=255&s[0]|(255&s[1])<<8|(255&s[2])<<16|(255&s[3])<<24,o=255&s[4]|(255&s[5])<<8|(255&s[6])<<16|(255&s[7])<<24,a=255&s[8]|(255&s[9])<<8|(255&s[10])<<16|(255&s[11])<<24,c=255&s[12]|(255&s[13])<<8|(255&s[14])<<16|(255&s[15])<<24,l=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,u=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,d=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,f=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,p=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,g=255&s[16]|(255&s[17])<<8|(255&s[18])<<16|(255&s[19])<<24,m=255&s[20]|(255&s[21])<<8|(255&s[22])<<16|(255&s[23])<<24,v=255&s[24]|(255&s[25])<<8|(255&s[26])<<16|(255&s[27])<<24,_=255&s[28]|(255&s[29])<<8|(255&s[30])<<16|(255&s[31])<<24,M=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,b=0; - b<20; - b+=2)h^=(n=(m^=(n=(f^=(n=(c^=(n=h+m|0)<<7|n>>>25)+h|0)<<9|n>>>23)+c|0)<<13|n>>>19)+f|0)<<18|n>>>14,l^=(n=(r^=(n=(v^=(n=(p^=(n=l+r|0)<<7|n>>>25)+l|0)<<9|n>>>23)+p|0)<<13|n>>>19)+v|0)<<18|n>>>14,w^=(n=(u^=(n=(o^=(n=(_^=(n=w+u|0)<<7|n>>>25)+w|0)<<9|n>>>23)+_|0)<<13|n>>>19)+o|0)<<18|n>>>14,M^=(n=(g^=(n=(d^=(n=(a^=(n=M+g|0)<<7|n>>>25)+M|0)<<9|n>>>23)+a|0)<<13|n>>>19)+d|0)<<18|n>>>14,h^=(n=(a^=(n=(o^=(n=(r^=(n=h+a|0)<<7|n>>>25)+h|0)<<9|n>>>23)+r|0)<<13|n>>>19)+o|0)<<18|n>>>14,l^=(n=(c^=(n=(d^=(n=(u^=(n=l+c|0)<<7|n>>>25)+l|0)<<9|n>>>23)+u|0)<<13|n>>>19)+d|0)<<18|n>>>14,w^=(n=(p^=(n=(f^=(n=(g^=(n=w+p|0)<<7|n>>>25)+w|0)<<9|n>>>23)+g|0)<<13|n>>>19)+f|0)<<18|n>>>14,M^=(n=(_^=(n=(v^=(n=(m^=(n=M+_|0)<<7|n>>>25)+M|0)<<9|n>>>23)+m|0)<<13|n>>>19)+v|0)<<18|n>>>14; - t[0]=h>>>0&255,t[1]=h>>>8&255,t[2]=h>>>16&255,t[3]=h>>>24&255,t[4]=l>>>0&255,t[5]=l>>>8&255,t[6]=l>>>16&255,t[7]=l>>>24&255,t[8]=w>>>0&255,t[9]=w>>>8&255,t[10]=w>>>16&255,t[11]=w>>>24&255,t[12]=M>>>0&255,t[13]=M>>>8&255,t[14]=M>>>16&255,t[15]=M>>>24&255,t[16]=u>>>0&255,t[17]=u>>>8&255,t[18]=u>>>16&255,t[19]=u>>>24&255,t[20]=d>>>0&255,t[21]=d>>>8&255,t[22]=d>>>16&255,t[23]=d>>>24&255,t[24]=f>>>0&255,t[25]=f>>>8&255,t[26]=f>>>16&255,t[27]=f>>>24&255,t[28]=p>>>0&255,t[29]=p>>>8&255,t[30]=p>>>16&255,t[31]=p>>>24&255} - function _(t,i,s,e){ - m(t,i,s,e)} - function M(t,i,s,e){ - v(t,i,s,e)} - Qt(f,"ts64"),Qt(p,"vn"),Qt(w,"crypto_verify_16"),Qt(g,"crypto_verify_32"),Qt(m,"core_salsa20"),Qt(v,"core_hsalsa20"),Qt(_,"crypto_core_salsa20"),Qt(M,"crypto_core_hsalsa20"); - var b=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]); - function y(t,i,s,e,n,h,r){ - var o,a,c=new Uint8Array(16),l=new Uint8Array(64); - for(a=0; - a<16; - a++)c[a]=0; - for(a=0; - a<8; - a++)c[a]=h[a]; - for(; - n>=64; - ){ - for(_(l,c,r,b),a=0; - a<64; - a++)t[i+a]=s[e+a]^l[a]; - for(o=1,a=8; - a<16; - a++)o=o+(255&c[a])|0,c[a]=255&o,o>>>=8; - n-=64,i+=64,e+=64} - if(n>0)for(_(l,c,r,b),a=0; - a<n; - a++)t[i+a]=s[e+a]^l[a]; - return 0} - function E(t,i,s,e,n){ - var h,r,o=new Uint8Array(16),a=new Uint8Array(64); - for(r=0; - r<16; - r++)o[r]=0; - for(r=0; - r<8; - r++)o[r]=e[r]; - for(; - s>=64; - ){ - for(_(a,o,n,b),r=0; - r<64; - r++)t[i+r]=a[r]; - for(h=1,r=8; - r<16; - r++)h=h+(255&o[r])|0,o[r]=255&h,h>>>=8; - s-=64,i+=64} - if(s>0)for(_(a,o,n,b),r=0; - r<s; - r++)t[i+r]=a[r]; - return 0} - function A(t,i,s,e,n){ - var h=new Uint8Array(32); - M(h,e,n,b); - for(var r=new Uint8Array(8),o=0; - o<8; - o++)r[o]=e[o+16]; - return E(t,i,s,r,h)} - function S(t,i,s,e,n,h,r){ - var o=new Uint8Array(32); - M(o,h,r,b); - for(var a=new Uint8Array(8),c=0; - c<8; - c++)a[c]=h[c+16]; - return y(t,i,s,e,n,a,o)} - Qt(y,"crypto_stream_salsa20_xor"),Qt(E,"crypto_stream_salsa20"),Qt(A,"crypto_stream"),Qt(S,"crypto_stream_xor"); - var T=Qt(function(t){ - var i,s,e,n,h,r,o,a; - this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,i=255&t[0]|(255&t[1])<<8,this.r[0]=8191&i,s=255&t[2]|(255&t[3])<<8,this.r[1]=8191&(i>>>13|s<<3),e=255&t[4]|(255&t[5])<<8,this.r[2]=7939&(s>>>10|e<<6),n=255&t[6]|(255&t[7])<<8,this.r[3]=8191&(e>>>7|n<<9),h=255&t[8]|(255&t[9])<<8,this.r[4]=255&(n>>>4|h<<12),this.r[5]=h>>>1&8190,r=255&t[10]|(255&t[11])<<8,this.r[6]=8191&(h>>>14|r<<2),o=255&t[12]|(255&t[13])<<8,this.r[7]=8065&(r>>>11|o<<5),a=255&t[14]|(255&t[15])<<8,this.r[8]=8191&(o>>>8|a<<8),this.r[9]=a>>>5&127,this.pad[0]=255&t[16]|(255&t[17])<<8,this.pad[1]=255&t[18]|(255&t[19])<<8,this.pad[2]=255&t[20]|(255&t[21])<<8,this.pad[3]=255&t[22]|(255&t[23])<<8,this.pad[4]=255&t[24]|(255&t[25])<<8,this.pad[5]=255&t[26]|(255&t[27])<<8,this.pad[6]=255&t[28]|(255&t[29])<<8,this.pad[7]=255&t[30]|(255&t[31])<<8} - ,"poly1305"); - function C(t,i,s,e,n,h){ - var r=new T(h); - return r.update(s,e,n),r.finish(t,i),0} - function O(t,i,s,e,n,h){ - var r=new Uint8Array(16); - return C(r,0,s,e,n,h),w(t,i,r,0)} - function I(t,i,s,e,n){ - var h; - if(s<32)return-1; - for(S(t,0,i,0,s,e,n),C(t,16,t,32,s-32,t),h=0; - h<16; - h++)t[h]=0; - return 0} - function k(t,i,s,e,n){ - var h,r=new Uint8Array(32); - if(s<32)return-1; - if(A(r,0,32,e,n),0!==O(i,16,i,32,s-32,r))return-1; - for(S(t,0,i,0,s,e,n),h=0; - h<32; - h++)t[h]=0; - return 0} - function x(t,i){ - var s; - for(s=0; - s<16; - s++)t[s]=0|i[s]} - function R(t){ - var i,s,e=1; - for(i=0; - i<16; - i++)s=t[i]+e+65535,e=Math.floor(s/65536),t[i]=s-65536*e; - t[0]+=e-1+37*(e-1)} - function P(t,i,s){ - for(var e,n=~(s-1),h=0; - h<16; - h++)e=n&(t[h]^i[h]),t[h]^=e,i[h]^=e} - function N(t,s){ - var e,n,h,r=i(),o=i(); - for(e=0; - e<16; - e++)o[e]=s[e]; - for(R(o),R(o),R(o),n=0; - n<2; - n++){ - for(r[0]=o[0]-65517,e=1; - e<15; - e++)r[e]=o[e]-65535-(r[e-1]>>16&1),r[e-1]&=65535; - r[15]=o[15]-32767-(r[14]>>16&1),h=r[15]>>16&1,r[14]&=65535,P(o,r,1-h)} - for(e=0; - e<16; - e++)t[2*e]=255&o[e],t[2*e+1]=o[e]>>8} - function L(t,i){ - var s=new Uint8Array(32),e=new Uint8Array(32); - return N(s,t),N(e,i),g(s,0,e,0)} - function D(t){ - var i=new Uint8Array(32); - return N(i,t),1&i[0]} - function G(t,i){ - var s; - for(s=0; - s<16; - s++)t[s]=i[2*s]+(i[2*s+1]<<8); - t[15]&=32767} - function B(t,i,s){ - for(var e=0; - e<16; - e++)t[e]=i[e]+s[e]} - function U(t,i,s){ - for(var e=0; - e<16; - e++)t[e]=i[e]-s[e]} - function F(t,i,s){ - var e,n,h=0,r=0,o=0,a=0,c=0,l=0,u=0,d=0,f=0,p=0,w=0,g=0,m=0,v=0,_=0,M=0,b=0,y=0,E=0,A=0,S=0,T=0,C=0,O=0,I=0,k=0,x=0,R=0,P=0,N=0,L=0,D=s[0],G=s[1],B=s[2],U=s[3],F=s[4],$=s[5],H=s[6],W=s[7],V=s[8],j=s[9],K=s[10],z=s[11],Y=s[12],q=s[13],X=s[14],J=s[15]; - h+=(e=i[0])*D,r+=e*G,o+=e*B,a+=e*U,c+=e*F,l+=e*$,u+=e*H,d+=e*W,f+=e*V,p+=e*j,w+=e*K,g+=e*z,m+=e*Y,v+=e*q,_+=e*X,M+=e*J,r+=(e=i[1])*D,o+=e*G,a+=e*B,c+=e*U,l+=e*F,u+=e*$,d+=e*H,f+=e*W,p+=e*V,w+=e*j,g+=e*K,m+=e*z,v+=e*Y,_+=e*q,M+=e*X,b+=e*J,o+=(e=i[2])*D,a+=e*G,c+=e*B,l+=e*U,u+=e*F,d+=e*$,f+=e*H,p+=e*W,w+=e*V,g+=e*j,m+=e*K,v+=e*z,_+=e*Y,M+=e*q,b+=e*X,y+=e*J,a+=(e=i[3])*D,c+=e*G,l+=e*B,u+=e*U,d+=e*F,f+=e*$,p+=e*H,w+=e*W,g+=e*V,m+=e*j,v+=e*K,_+=e*z,M+=e*Y,b+=e*q,y+=e*X,E+=e*J,c+=(e=i[4])*D,l+=e*G,u+=e*B,d+=e*U,f+=e*F,p+=e*$,w+=e*H,g+=e*W,m+=e*V,v+=e*j,_+=e*K,M+=e*z,b+=e*Y,y+=e*q,E+=e*X,A+=e*J,l+=(e=i[5])*D,u+=e*G,d+=e*B,f+=e*U,p+=e*F,w+=e*$,g+=e*H,m+=e*W,v+=e*V,_+=e*j,M+=e*K,b+=e*z,y+=e*Y,E+=e*q,A+=e*X,S+=e*J,u+=(e=i[6])*D,d+=e*G,f+=e*B,p+=e*U,w+=e*F,g+=e*$,m+=e*H,v+=e*W,_+=e*V,M+=e*j,b+=e*K,y+=e*z,E+=e*Y,A+=e*q,S+=e*X,T+=e*J,d+=(e=i[7])*D,f+=e*G,p+=e*B,w+=e*U,g+=e*F,m+=e*$,v+=e*H,_+=e*W,M+=e*V,b+=e*j,y+=e*K,E+=e*z,A+=e*Y,S+=e*q,T+=e*X,C+=e*J,f+=(e=i[8])*D,p+=e*G,w+=e*B,g+=e*U,m+=e*F,v+=e*$,_+=e*H,M+=e*W,b+=e*V,y+=e*j,E+=e*K,A+=e*z,S+=e*Y,T+=e*q,C+=e*X,O+=e*J,p+=(e=i[9])*D,w+=e*G,g+=e*B,m+=e*U,v+=e*F,_+=e*$,M+=e*H,b+=e*W,y+=e*V,E+=e*j,A+=e*K,S+=e*z,T+=e*Y,C+=e*q,O+=e*X,I+=e*J,w+=(e=i[10])*D,g+=e*G,m+=e*B,v+=e*U,_+=e*F,M+=e*$,b+=e*H,y+=e*W,E+=e*V,A+=e*j,S+=e*K,T+=e*z,C+=e*Y,O+=e*q,I+=e*X,k+=e*J,g+=(e=i[11])*D,m+=e*G,v+=e*B,_+=e*U,M+=e*F,b+=e*$,y+=e*H,E+=e*W,A+=e*V,S+=e*j,T+=e*K,C+=e*z,O+=e*Y,I+=e*q,k+=e*X,x+=e*J,m+=(e=i[12])*D,v+=e*G,_+=e*B,M+=e*U,b+=e*F,y+=e*$,E+=e*H,A+=e*W,S+=e*V,T+=e*j,C+=e*K,O+=e*z,I+=e*Y,k+=e*q,x+=e*X,R+=e*J,v+=(e=i[13])*D,_+=e*G,M+=e*B,b+=e*U,y+=e*F,E+=e*$,A+=e*H,S+=e*W,T+=e*V,C+=e*j,O+=e*K,I+=e*z,k+=e*Y,x+=e*q,R+=e*X,P+=e*J,_+=(e=i[14])*D,M+=e*G,b+=e*B,y+=e*U,E+=e*F,A+=e*$,S+=e*H,T+=e*W,C+=e*V,O+=e*j,I+=e*K,k+=e*z,x+=e*Y,R+=e*q,P+=e*X,N+=e*J,M+=(e=i[15])*D,r+=38*(y+=e*B),o+=38*(E+=e*U),a+=38*(A+=e*F),c+=38*(S+=e*$),l+=38*(T+=e*H),u+=38*(C+=e*W),d+=38*(O+=e*V),f+=38*(I+=e*j),p+=38*(k+=e*K),w+=38*(x+=e*z),g+=38*(R+=e*Y),m+=38*(P+=e*q),v+=38*(N+=e*X),_+=38*(L+=e*J),h=(e=(h+=38*(b+=e*G))+(n=1)+65535)-65536*(n=Math.floor(e/65536)),r=(e=r+n+65535)-65536*(n=Math.floor(e/65536)),o=(e=o+n+65535)-65536*(n=Math.floor(e/65536)),a=(e=a+n+65535)-65536*(n=Math.floor(e/65536)),c=(e=c+n+65535)-65536*(n=Math.floor(e/65536)),l=(e=l+n+65535)-65536*(n=Math.floor(e/65536)),u=(e=u+n+65535)-65536*(n=Math.floor(e/65536)),d=(e=d+n+65535)-65536*(n=Math.floor(e/65536)),f=(e=f+n+65535)-65536*(n=Math.floor(e/65536)),p=(e=p+n+65535)-65536*(n=Math.floor(e/65536)),w=(e=w+n+65535)-65536*(n=Math.floor(e/65536)),g=(e=g+n+65535)-65536*(n=Math.floor(e/65536)),m=(e=m+n+65535)-65536*(n=Math.floor(e/65536)),v=(e=v+n+65535)-65536*(n=Math.floor(e/65536)),_=(e=_+n+65535)-65536*(n=Math.floor(e/65536)),M=(e=M+n+65535)-65536*(n=Math.floor(e/65536)),h=(e=(h+=n-1+37*(n-1))+(n=1)+65535)-65536*(n=Math.floor(e/65536)),r=(e=r+n+65535)-65536*(n=Math.floor(e/65536)),o=(e=o+n+65535)-65536*(n=Math.floor(e/65536)),a=(e=a+n+65535)-65536*(n=Math.floor(e/65536)),c=(e=c+n+65535)-65536*(n=Math.floor(e/65536)),l=(e=l+n+65535)-65536*(n=Math.floor(e/65536)),u=(e=u+n+65535)-65536*(n=Math.floor(e/65536)),d=(e=d+n+65535)-65536*(n=Math.floor(e/65536)),f=(e=f+n+65535)-65536*(n=Math.floor(e/65536)),p=(e=p+n+65535)-65536*(n=Math.floor(e/65536)),w=(e=w+n+65535)-65536*(n=Math.floor(e/65536)),g=(e=g+n+65535)-65536*(n=Math.floor(e/65536)),m=(e=m+n+65535)-65536*(n=Math.floor(e/65536)),v=(e=v+n+65535)-65536*(n=Math.floor(e/65536)),_=(e=_+n+65535)-65536*(n=Math.floor(e/65536)),M=(e=M+n+65535)-65536*(n=Math.floor(e/65536)),h+=n-1+37*(n-1),t[0]=h,t[1]=r,t[2]=o,t[3]=a,t[4]=c,t[5]=l,t[6]=u,t[7]=d,t[8]=f,t[9]=p,t[10]=w,t[11]=g,t[12]=m,t[13]=v,t[14]=_,t[15]=M} - function $(t,i){ - F(t,i,i)} - function H(t,s){ - var e,n=i(); - for(e=0; - e<16; - e++)n[e]=s[e]; - for(e=253; - e>=0; - e--)$(n,n),2!==e&&4!==e&&F(n,n,s); - for(e=0; - e<16; - e++)t[e]=n[e]} - function W(t,s){ - var e,n=i(); - for(e=0; - e<16; - e++)n[e]=s[e]; - for(e=250; - e>=0; - e--)$(n,n),1!==e&&F(n,n,s); - for(e=0; - e<16; - e++)t[e]=n[e]} - function V(t,s,e){ - var n,h,r=new Uint8Array(32),a=new Float64Array(80),c=i(),l=i(),u=i(),d=i(),f=i(),p=i(); - for(h=0; - h<31; - h++)r[h]=s[h]; - for(r[31]=127&s[31]|64,r[0]&=248,G(a,e),h=0; - h<16; - h++)l[h]=a[h],d[h]=c[h]=u[h]=0; - for(c[0]=d[0]=1,h=254; - h>=0; - --h)P(c,l,n=r[h>>>3]>>>(7&h)&1),P(u,d,n),B(f,c,u),U(c,c,u),B(u,l,d),U(l,l,d),$(d,f),$(p,c),F(c,u,c),F(u,l,f),B(f,c,u),U(c,c,u),$(l,c),U(u,d,p),F(c,u,o),B(c,c,d),F(u,u,c),F(c,d,p),F(d,l,a),$(l,f),P(c,l,n),P(u,d,n); - for(h=0; - h<16; - h++)a[h+16]=c[h],a[h+32]=u[h],a[h+48]=l[h],a[h+64]=d[h]; - var w=a.subarray(32),g=a.subarray(16); - return H(w,w),F(g,g,w),N(t,g),0} - function j(t,i){ - return V(t,i,n)} - function K(t,i){ - return s(i,32),j(t,i)} - function z(t,i,s){ - var n=new Uint8Array(32); - return V(n,s,i),M(t,e,n,b)} - T.prototype.blocks=function(t,i,s){ - for(var e,n,h,r,o,a,c,l,u,d,f,p,w,g,m,v,_,M,b,y=this.fin?0:2048,E=this.h[0],A=this.h[1],S=this.h[2],T=this.h[3],C=this.h[4],O=this.h[5],I=this.h[6],k=this.h[7],x=this.h[8],R=this.h[9],P=this.r[0],N=this.r[1],L=this.r[2],D=this.r[3],G=this.r[4],B=this.r[5],U=this.r[6],F=this.r[7],$=this.r[8],H=this.r[9]; - s>=16; - )d=u=0,d+=(E+=8191&(e=255&t[i+0]|(255&t[i+1])<<8))*P,d+=(A+=8191&(e>>>13|(n=255&t[i+2]|(255&t[i+3])<<8)<<3))*(5*H),d+=(S+=8191&(n>>>10|(h=255&t[i+4]|(255&t[i+5])<<8)<<6))*(5*$),d+=(T+=8191&(h>>>7|(r=255&t[i+6]|(255&t[i+7])<<8)<<9))*(5*F),u=(d+=(C+=8191&(r>>>4|(o=255&t[i+8]|(255&t[i+9])<<8)<<12))*(5*U))>>>13,d&=8191,d+=(O+=o>>>1&8191)*(5*B),d+=(I+=8191&(o>>>14|(a=255&t[i+10]|(255&t[i+11])<<8)<<2))*(5*G),d+=(k+=8191&(a>>>11|(c=255&t[i+12]|(255&t[i+13])<<8)<<5))*(5*D),d+=(x+=8191&(c>>>8|(l=255&t[i+14]|(255&t[i+15])<<8)<<8))*(5*L),f=u+=(d+=(R+=l>>>5|y)*(5*N))>>>13,f+=E*N,f+=A*P,f+=S*(5*H),f+=T*(5*$),u=(f+=C*(5*F))>>>13,f&=8191,f+=O*(5*U),f+=I*(5*B),f+=k*(5*G),f+=x*(5*D),u+=(f+=R*(5*L))>>>13,f&=8191,p=u,p+=E*L,p+=A*N,p+=S*P,p+=T*(5*H),u=(p+=C*(5*$))>>>13,p&=8191,p+=O*(5*F),p+=I*(5*U),p+=k*(5*B),p+=x*(5*G),w=u+=(p+=R*(5*D))>>>13,w+=E*D,w+=A*L,w+=S*N,w+=T*P,u=(w+=C*(5*H))>>>13,w&=8191,w+=O*(5*$),w+=I*(5*F),w+=k*(5*U),w+=x*(5*B),g=u+=(w+=R*(5*G))>>>13,g+=E*G,g+=A*D,g+=S*L,g+=T*N,u=(g+=C*P)>>>13,g&=8191,g+=O*(5*H),g+=I*(5*$),g+=k*(5*F),g+=x*(5*U),m=u+=(g+=R*(5*B))>>>13,m+=E*B,m+=A*G,m+=S*D,m+=T*L,u=(m+=C*N)>>>13,m&=8191,m+=O*P,m+=I*(5*H),m+=k*(5*$),m+=x*(5*F),v=u+=(m+=R*(5*U))>>>13,v+=E*U,v+=A*B,v+=S*G,v+=T*D,u=(v+=C*L)>>>13,v&=8191,v+=O*N,v+=I*P,v+=k*(5*H),v+=x*(5*$),_=u+=(v+=R*(5*F))>>>13,_+=E*F,_+=A*U,_+=S*B,_+=T*G,u=(_+=C*D)>>>13,_&=8191,_+=O*L,_+=I*N,_+=k*P,_+=x*(5*H),M=u+=(_+=R*(5*$))>>>13,M+=E*$,M+=A*F,M+=S*U,M+=T*B,u=(M+=C*G)>>>13,M&=8191,M+=O*D,M+=I*L,M+=k*N,M+=x*P,b=u+=(M+=R*(5*H))>>>13,b+=E*H,b+=A*$,b+=S*F,b+=T*U,u=(b+=C*B)>>>13,b&=8191,b+=O*G,b+=I*D,b+=k*L,b+=x*N,E=d=8191&(u=(u=((u+=(b+=R*P)>>>13)<<2)+u|0)+(d&=8191)|0),A=f+=u>>>=13,S=p&=8191,T=w&=8191,C=g&=8191,O=m&=8191,I=v&=8191,k=_&=8191,x=M&=8191,R=b&=8191,i+=16,s-=16; - this.h[0]=E,this.h[1]=A,this.h[2]=S,this.h[3]=T,this.h[4]=C,this.h[5]=O,this.h[6]=I,this.h[7]=k,this.h[8]=x,this.h[9]=R} - ,T.prototype.finish=function(t,i){ - var s,e,n,h,r=new Uint16Array(10); - if(this.leftover){ - for(h=this.leftover,this.buffer[h++]=1; - h<16; - h++)this.buffer[h]=0; - this.fin=1,this.blocks(this.buffer,0,16)} - for(s=this.h[1]>>>13,this.h[1]&=8191,h=2; - h<10; - h++)this.h[h]+=s,s=this.h[h]>>>13,this.h[h]&=8191; - for(this.h[0]+=5*s,s=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=s,s=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=s,r[0]=this.h[0]+5,s=r[0]>>>13,r[0]&=8191,h=1; - h<10; - h++)r[h]=this.h[h]+s,s=r[h]>>>13,r[h]&=8191; - for(r[9]-=8192,e=(1^s)-1,h=0; - h<10; - h++)r[h]&=e; - for(e=~e,h=0; - h<10; - h++)this.h[h]=this.h[h]&e|r[h]; - for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),n=this.h[0]+this.pad[0],this.h[0]=65535&n,h=1; - h<8; - h++)n=(this.h[h]+this.pad[h]|0)+(n>>>16)|0,this.h[h]=65535&n; - t[i+0]=this.h[0]>>>0&255,t[i+1]=this.h[0]>>>8&255,t[i+2]=this.h[1]>>>0&255,t[i+3]=this.h[1]>>>8&255,t[i+4]=this.h[2]>>>0&255,t[i+5]=this.h[2]>>>8&255,t[i+6]=this.h[3]>>>0&255,t[i+7]=this.h[3]>>>8&255,t[i+8]=this.h[4]>>>0&255,t[i+9]=this.h[4]>>>8&255,t[i+10]=this.h[5]>>>0&255,t[i+11]=this.h[5]>>>8&255,t[i+12]=this.h[6]>>>0&255,t[i+13]=this.h[6]>>>8&255,t[i+14]=this.h[7]>>>0&255,t[i+15]=this.h[7]>>>8&255} - ,T.prototype.update=function(t,i,s){ - var e,n; - if(this.leftover){ - for((n=16-this.leftover)>s&&(n=s),e=0; - e<n; - e++)this.buffer[this.leftover+e]=t[i+e]; - if(s-=n,i+=n,this.leftover+=n,this.leftover<16)return; - this.blocks(this.buffer,0,16),this.leftover=0} - if(s>=16&&(n=s-s%16,this.blocks(t,i,n),i+=n,s-=n),s){ - for(e=0; - e<s; - e++)this.buffer[this.leftover+e]=t[i+e]; - this.leftover+=s} - } - ,Qt(C,"crypto_onetimeauth"),Qt(O,"crypto_onetimeauth_verify"),Qt(I,"crypto_secretbox"),Qt(k,"crypto_secretbox_open"),Qt(x,"set25519"),Qt(R,"car25519"),Qt(P,"sel25519"),Qt(N,"pack25519"),Qt(L,"neq25519"),Qt(D,"par25519"),Qt(G,"unpack25519"),Qt(B,"A"),Qt(U,"Z"),Qt(F,"M"),Qt($,"S"),Qt(H,"inv25519"),Qt(W,"pow2523"),Qt(V,"crypto_scalarmult"),Qt(j,"crypto_scalarmult_base"),Qt(K,"crypto_box_keypair"),Qt(z,"crypto_box_beforenm"); - var Y=I,q=k; - function X(t,i,s,e,n,h){ - var r=new Uint8Array(32); - return z(r,n,h),Y(t,i,s,e,r)} - function J(t,i,s,e,n,h){ - var r=new Uint8Array(32); - return z(r,n,h),q(t,i,s,e,r)} - Qt(X,"crypto_box"),Qt(J,"crypto_box_open"); - var Q=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]; - function Z(t,i,s,e){ - for(var n,h,r,o,a,c,l,u,d,f,p,w,g,m,v,_,M,b,y,E,A,S,T,C,O,I,k=new Int32Array(16),x=new Int32Array(16),R=t[0],P=t[1],N=t[2],L=t[3],D=t[4],G=t[5],B=t[6],U=t[7],F=i[0],$=i[1],H=i[2],W=i[3],V=i[4],j=i[5],K=i[6],z=i[7],Y=0; - e>=128; - ){ - for(y=0; - y<16; - y++)E=8*y+Y,k[y]=s[E+0]<<24|s[E+1]<<16|s[E+2]<<8|s[E+3],x[y]=s[E+4]<<24|s[E+5]<<16|s[E+6]<<8|s[E+7]; - for(y=0; - y<80; - y++)if(n=R,h=P,r=N,o=L,a=D,c=G,l=B,d=F,f=$,p=H,w=W,g=V,m=j,v=K,T=65535&(S=z),C=S>>>16,O=65535&(A=U),I=A>>>16,T+=65535&(S=(V>>>14|D<<18)^(V>>>18|D<<14)^(D>>>9|V<<23)),C+=S>>>16,O+=65535&(A=(D>>>14|V<<18)^(D>>>18|V<<14)^(V>>>9|D<<23)),I+=A>>>16,T+=65535&(S=V&j^~V&K),C+=S>>>16,O+=65535&(A=D&G^~D&B),I+=A>>>16,T+=65535&(S=Q[2*y+1]),C+=S>>>16,O+=65535&(A=Q[2*y]),I+=A>>>16,A=k[y%16],C+=(S=x[y%16])>>>16,O+=65535&A,I+=A>>>16,O+=(C+=(T+=65535&S)>>>16)>>>16,T=65535&(S=b=65535&T|C<<16),C=S>>>16,O=65535&(A=M=65535&O|(I+=O>>>16)<<16),I=A>>>16,T+=65535&(S=(F>>>28|R<<4)^(R>>>2|F<<30)^(R>>>7|F<<25)),C+=S>>>16,O+=65535&(A=(R>>>28|F<<4)^(F>>>2|R<<30)^(F>>>7|R<<25)),I+=A>>>16,C+=(S=F&$^F&H^$&H)>>>16,O+=65535&(A=R&P^R&N^P&N),I+=A>>>16,u=65535&(O+=(C+=(T+=65535&S)>>>16)>>>16)|(I+=O>>>16)<<16,_=65535&T|C<<16,T=65535&(S=w),C=S>>>16,O=65535&(A=o),I=A>>>16,C+=(S=b)>>>16,O+=65535&(A=M),I+=A>>>16,P=n,N=h,L=r,D=o=65535&(O+=(C+=(T+=65535&S)>>>16)>>>16)|(I+=O>>>16)<<16,G=a,B=c,U=l,R=u,$=d,H=f,W=p,V=w=65535&T|C<<16,j=g,K=m,z=v,F=_,y%16==15)for(E=0; - E<16; - E++)A=k[E],T=65535&(S=x[E]),C=S>>>16,O=65535&A,I=A>>>16,A=k[(E+9)%16],T+=65535&(S=x[(E+9)%16]),C+=S>>>16,O+=65535&A,I+=A>>>16,M=k[(E+1)%16],T+=65535&(S=((b=x[(E+1)%16])>>>1|M<<31)^(b>>>8|M<<24)^(b>>>7|M<<25)),C+=S>>>16,O+=65535&(A=(M>>>1|b<<31)^(M>>>8|b<<24)^M>>>7),I+=A>>>16,M=k[(E+14)%16],C+=(S=((b=x[(E+14)%16])>>>19|M<<13)^(M>>>29|b<<3)^(b>>>6|M<<26))>>>16,O+=65535&(A=(M>>>19|b<<13)^(b>>>29|M<<3)^M>>>6),I+=A>>>16,I+=(O+=(C+=(T+=65535&S)>>>16)>>>16)>>>16,k[E]=65535&O|I<<16,x[E]=65535&T|C<<16; - T=65535&(S=F),C=S>>>16,O=65535&(A=R),I=A>>>16,A=t[0],C+=(S=i[0])>>>16,O+=65535&A,I+=A>>>16,I+=(O+=(C+=(T+=65535&S)>>>16)>>>16)>>>16,t[0]=R=65535&O|I<<16,i[0]=F=65535&T|C<<16,T=65535&(S=$),C=S>>>16,O=65535&(A=P),I=A>>>16,A=t[1],C+=(S=i[1])>>>16,O+=65535&A,I+=A>>>16,I+=(O+=(C+=(T+=65535&S)>>>16)>>>16)>>>16,t[1]=P=65535&O|I<<16,i[1]=$=65535&T|C<<16,T=65535&(S=H),C=S>>>16,O=65535&(A=N),I=A>>>16,A=t[2],C+=(S=i[2])>>>16,O+=65535&A,I+=A>>>16,I+=(O+=(C+=(T+=65535&S)>>>16)>>>16)>>>16,t[2]=N=65535&O|I<<16,i[2]=H=65535&T|C<<16,T=65535&(S=W),C=S>>>16,O=65535&(A=L),I=A>>>16,A=t[3],C+=(S=i[3])>>>16,O+=65535&A,I+=A>>>16,I+=(O+=(C+=(T+=65535&S)>>>16)>>>16)>>>16,t[3]=L=65535&O|I<<16,i[3]=W=65535&T|C<<16,T=65535&(S=V),C=S>>>16,O=65535&(A=D),I=A>>>16,A=t[4],C+=(S=i[4])>>>16,O+=65535&A,I+=A>>>16,I+=(O+=(C+=(T+=65535&S)>>>16)>>>16)>>>16,t[4]=D=65535&O|I<<16,i[4]=V=65535&T|C<<16,T=65535&(S=j),C=S>>>16,O=65535&(A=G),I=A>>>16,A=t[5],C+=(S=i[5])>>>16,O+=65535&A,I+=A>>>16,I+=(O+=(C+=(T+=65535&S)>>>16)>>>16)>>>16,t[5]=G=65535&O|I<<16,i[5]=j=65535&T|C<<16,T=65535&(S=K),C=S>>>16,O=65535&(A=B),I=A>>>16,A=t[6],C+=(S=i[6])>>>16,O+=65535&A,I+=A>>>16,I+=(O+=(C+=(T+=65535&S)>>>16)>>>16)>>>16,t[6]=B=65535&O|I<<16,i[6]=K=65535&T|C<<16,T=65535&(S=z),C=S>>>16,O=65535&(A=U),I=A>>>16,A=t[7],C+=(S=i[7])>>>16,O+=65535&A,I+=A>>>16,I+=(O+=(C+=(T+=65535&S)>>>16)>>>16)>>>16,t[7]=U=65535&O|I<<16,i[7]=z=65535&T|C<<16,Y+=128,e-=128} - return e} - function tt(t,i,s){ - var e,n=new Int32Array(8),h=new Int32Array(8),r=new Uint8Array(256),o=s; - for(n[0]=1779033703,n[1]=3144134277,n[2]=1013904242,n[3]=2773480762,n[4]=1359893119,n[5]=2600822924,n[6]=528734635,n[7]=1541459225,h[0]=4089235720,h[1]=2227873595,h[2]=4271175723,h[3]=1595750129,h[4]=2917565137,h[5]=725511199,h[6]=4215389547,h[7]=327033209,Z(n,h,i,s),s%=128,e=0; - e<s; - e++)r[e]=i[o-s+e]; - for(r[s]=128,r[(s=256-128*(s<112?1:0))-9]=0,f(r,s-8,o/536870912|0,o<<3),Z(n,h,r,s),e=0; - e<8; - e++)f(t,8*e,n[e],h[e]); - return 0} - function it(t,s){ - var e=i(),n=i(),h=i(),r=i(),o=i(),a=i(),l=i(),u=i(),d=i(); - U(e,t[1],t[0]),U(d,s[1],s[0]),F(e,e,d),B(n,t[0],t[1]),B(d,s[0],s[1]),F(n,n,d),F(h,t[3],s[3]),F(h,h,c),F(r,t[2],s[2]),B(r,r,r),U(o,n,e),U(a,r,h),B(l,r,h),B(u,n,e),F(t[0],o,a),F(t[1],u,l),F(t[2],l,a),F(t[3],o,u)} - function st(t,i,s){ - var e; - for(e=0; - e<4; - e++)P(t[e],i[e],s)} - function et(t,s){ - var e=i(),n=i(),h=i(); - H(h,s[2]),F(e,s[0],h),F(n,s[1],h),N(t,n),t[31]^=D(e)<<7} - function nt(t,i,s){ - var e,n; - for(x(t[0],h),x(t[1],r),x(t[2],r),x(t[3],h),n=255; - n>=0; - --n)st(t,i,e=s[n/8|0]>>(7&n)&1),it(i,t),it(t,t),st(t,i,e)} - function ht(t,s){ - var e=[i(),i(),i(),i()]; - x(e[0],l),x(e[1],u),x(e[2],r),F(e[3],l,u),nt(t,e,s)} - function rt(t,e,n){ - var h,r=new Uint8Array(64),o=[i(),i(),i(),i()]; - for(n||s(e,32),tt(r,e,32),r[0]&=248,r[31]&=127,r[31]|=64,ht(o,r),et(t,o),h=0; - h<32; - h++)e[h+32]=t[h]; - return 0} - Qt(Z,"crypto_hashblocks_hl"),Qt(tt,"crypto_hash"),Qt(it,"add"),Qt(st,"cswap"),Qt(et,"pack"),Qt(nt,"scalarmult"),Qt(ht,"scalarbase"),Qt(rt,"crypto_sign_keypair"); - var ot=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]); - function at(t,i){ - var s,e,n,h; - for(e=63; - e>=32; - --e){ - for(s=0,n=e-32,h=e-12; - n<h; - ++n)i[n]+=s-16*i[e]*ot[n-(e-32)],s=Math.floor((i[n]+128)/256),i[n]-=256*s; - i[n]+=s,i[e]=0} - for(s=0,n=0; - n<32; - n++)i[n]+=s-(i[31]>>4)*ot[n],s=i[n]>>8,i[n]&=255; - for(n=0; - n<32; - n++)i[n]-=s*ot[n]; - for(e=0; - e<32; - e++)i[e+1]+=i[e]>>8,t[e]=255&i[e]} - function ct(t){ - var i,s=new Float64Array(64); - for(i=0; - i<64; - i++)s[i]=t[i]; - for(i=0; - i<64; - i++)t[i]=0; - at(t,s)} - function lt(t,s,e,n){ - var h,r,o=new Uint8Array(64),a=new Uint8Array(64),c=new Uint8Array(64),l=new Float64Array(64),u=[i(),i(),i(),i()]; - tt(o,n,32),o[0]&=248,o[31]&=127,o[31]|=64; - var d=e+64; - for(h=0; - h<e; - h++)t[64+h]=s[h]; - for(h=0; - h<32; - h++)t[32+h]=o[32+h]; - for(tt(c,t.subarray(32),e+32),ct(c),ht(u,c),et(t,u),h=32; - h<64; - h++)t[h]=n[h]; - for(tt(a,t,e+64),ct(a),h=0; - h<64; - h++)l[h]=0; - for(h=0; - h<32; - h++)l[h]=c[h]; - for(h=0; - h<32; - h++)for(r=0; - r<32; - r++)l[h+r]+=a[h]*o[r]; - return at(t.subarray(32),l),d} - function ut(t,s){ - var e=i(),n=i(),o=i(),c=i(),l=i(),u=i(),f=i(); - return x(t[2],r),G(t[1],s),$(o,t[1]),F(c,o,a),U(o,o,t[2]),B(c,t[2],c),$(l,c),$(u,l),F(f,u,l),F(e,f,o),F(e,e,c),W(e,e),F(e,e,o),F(e,e,c),F(e,e,c),F(t[0],e,c),$(n,t[0]),F(n,n,c),L(n,o)&&F(t[0],t[0],d),$(n,t[0]),F(n,n,c),L(n,o)?-1:(D(t[0])===s[31]>>7&&U(t[0],h,t[0]),F(t[3],t[0],t[1]),0)} - function dt(t,s,e,n){ - var h,r=new Uint8Array(32),o=new Uint8Array(64),a=[i(),i(),i(),i()],c=[i(),i(),i(),i()]; - if(e<64)return-1; - if(ut(c,n))return-1; - for(h=0; - h<e; - h++)t[h]=s[h]; - for(h=0; - h<32; - h++)t[h+32]=n[h]; - if(tt(o,t,e),ct(o),nt(a,c,o),ht(c,s.subarray(32)),it(a,c),et(r,a),e-=64,g(s,0,r,0)){ - for(h=0; - h<e; - h++)t[h]=0; - return-1} - for(h=0; - h<e; - h++)t[h]=s[h+64]; - return e} - Qt(at,"modL"),Qt(ct,"reduce"),Qt(lt,"crypto_sign"),Qt(ut,"unpackneg"),Qt(dt,"crypto_sign_open"); - var ft,pt=64,wt=32,gt=64; - function mt(t,i){ - if(32!==t.length)throw new Error("bad key size"); - if(24!==i.length)throw new Error("bad nonce size")} - function vt(t,i){ - if(32!==t.length)throw new Error("bad public key size"); - if(32!==i.length)throw new Error("bad secret key size")} - function _t(){ - for(var t=0; - t<arguments.length; - t++)if(!(arguments[t]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")} - function Mt(t){ - for(var i=0; - i<t.length; - i++)t[i]=0} - t.lowlevel={ - crypto_core_hsalsa20:M,crypto_stream_xor:S,crypto_stream:A,crypto_stream_salsa20_xor:y,crypto_stream_salsa20:E,crypto_onetimeauth:C,crypto_onetimeauth_verify:O,crypto_verify_16:w,crypto_verify_32:g,crypto_secretbox:I,crypto_secretbox_open:k,crypto_scalarmult:V,crypto_scalarmult_base:j,crypto_box_beforenm:z,crypto_box_afternm:Y,crypto_box:X,crypto_box_open:J,crypto_box_keypair:K,crypto_hash:tt,crypto_sign:lt,crypto_sign_keypair:rt,crypto_sign_open:dt,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:pt,crypto_sign_PUBLICKEYBYTES:wt,crypto_sign_SECRETKEYBYTES:gt,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:i,D:a,L:ot,pack25519:N,unpack25519:G,M:F,A:B,S:$,Z:U,pow2523:W,add:it,set25519:x,modL:at,scalarmult:nt,scalarbase:ht} - ,Qt(mt,"checkLengths"),Qt(vt,"checkBoxLengths"),Qt(_t,"checkArrayTypes"),Qt(Mt,"cleanup"),t.randomBytes=function(t){ - var i=new Uint8Array(t); - return s(i,t),i} - ,t.secretbox=function(t,i,s){ - _t(t,i,s),mt(s,i); - for(var e=new Uint8Array(32+t.length),n=new Uint8Array(e.length),h=0; - h<t.length; - h++)e[h+32]=t[h]; - return I(n,e,e.length,i,s),n.subarray(16)} - ,t.secretbox.open=function(t,i,s){ - _t(t,i,s),mt(s,i); - for(var e=new Uint8Array(16+t.length),n=new Uint8Array(e.length),h=0; - h<t.length; - h++)e[h+16]=t[h]; - return e.length<32||0!==k(n,e,e.length,i,s)?null:n.subarray(32)} - ,t.secretbox.keyLength=32,t.secretbox.nonceLength=24,t.secretbox.overheadLength=16,t.scalarMult=function(t,i){ - if(_t(t,i),32!==t.length)throw new Error("bad n size"); - if(32!==i.length)throw new Error("bad p size"); - var s=new Uint8Array(32); - return V(s,t,i),s} - ,t.scalarMult.base=function(t){ - if(_t(t),32!==t.length)throw new Error("bad n size"); - var i=new Uint8Array(32); - return j(i,t),i} - ,t.scalarMult.scalarLength=32,t.scalarMult.groupElementLength=32,t.box=function(i,s,e,n){ - var h=t.box.before(e,n); - return t.secretbox(i,s,h)} - ,t.box.before=function(t,i){ - _t(t,i),vt(t,i); - var s=new Uint8Array(32); - return z(s,t,i),s} - ,t.box.after=t.secretbox,t.box.open=function(i,s,e,n){ - var h=t.box.before(e,n); - return t.secretbox.open(i,s,h)} - ,t.box.open.after=t.secretbox.open,t.box.keyPair=function(){ - var t=new Uint8Array(32),i=new Uint8Array(32); - return K(t,i),{ - publicKey:t,secretKey:i} - } - ,t.box.keyPair.fromSecretKey=function(t){ - if(_t(t),32!==t.length)throw new Error("bad secret key size"); - var i=new Uint8Array(32); - return j(i,t),{ - publicKey:i,secretKey:new Uint8Array(t)} - } - ,t.box.publicKeyLength=32,t.box.secretKeyLength=32,t.box.sharedKeyLength=32,t.box.nonceLength=24,t.box.overheadLength=t.secretbox.overheadLength,t.sign=function(t,i){ - if(_t(t,i),i.length!==gt)throw new Error("bad secret key size"); - var s=new Uint8Array(pt+t.length); - return lt(s,t,t.length,i),s} - ,t.sign.open=function(t,i){ - if(_t(t,i),i.length!==wt)throw new Error("bad public key size"); - var s=new Uint8Array(t.length),e=dt(s,t,t.length,i); - if(e<0)return null; - for(var n=new Uint8Array(e),h=0; - h<n.length; - h++)n[h]=s[h]; - return n} - ,t.sign.detached=function(i,s){ - for(var e=t.sign(i,s),n=new Uint8Array(pt),h=0; - h<n.length; - h++)n[h]=e[h]; - return n} - ,t.sign.detached.verify=function(t,i,s){ - if(_t(t,i,s),i.length!==pt)throw new Error("bad signature size"); - if(s.length!==wt)throw new Error("bad public key size"); - var e,n=new Uint8Array(pt+t.length),h=new Uint8Array(pt+t.length); - for(e=0; - e<pt; - e++)n[e]=i[e]; - for(e=0; - e<t.length; - e++)n[e+pt]=t[e]; - return dt(h,n,n.length,s)>=0} - ,t.sign.keyPair=function(){ - var t=new Uint8Array(wt),i=new Uint8Array(gt); - return rt(t,i),{ - publicKey:t,secretKey:i} - } - ,t.sign.keyPair.fromSecretKey=function(t){ - if(_t(t),t.length!==gt)throw new Error("bad secret key size"); - for(var i=new Uint8Array(wt),s=0; - s<i.length; - s++)i[s]=t[32+s]; - return{ - publicKey:i,secretKey:new Uint8Array(t)} - } - ,t.sign.keyPair.fromSeed=function(t){ - if(_t(t),32!==t.length)throw new Error("bad seed size"); - for(var i=new Uint8Array(wt),s=new Uint8Array(gt),e=0; - e<32; - e++)s[e]=t[e]; - return rt(i,s,!0),{ - publicKey:i,secretKey:s} - } - ,t.sign.publicKeyLength=wt,t.sign.secretKeyLength=gt,t.sign.seedLength=32,t.sign.signatureLength=pt,t.hash=function(t){ - _t(t); - var i=new Uint8Array(64); - return tt(i,t,t.length),i} - ,t.hash.hashLength=64,t.verify=function(t,i){ - return _t(t,i),0!==t.length&&0!==i.length&&t.length===i.length&&0===p(t,0,i,0,t.length)} - ,t.setPRNG=function(t){ - s=t} - ,(ft="undefined"!=typeof self?self.crypto||self.msCrypto:null)&&ft.getRandomValues?t.setPRNG(function(t,i){ - var s,e=new Uint8Array(i); - for(s=0; - s<i; - s+=65536)ft.getRandomValues(e.subarray(s,s+Math.min(i-s,65536))); - for(s=0; - s<i; - s++)t[s]=e[s]; - Mt(e)} - ):void 0!==gE&&(ft=vE)&&ft.randomBytes&&t.setPRNG(function(t,i){ - var s,e=ft.randomBytes(i); - for(s=0; - s<i; - s++)t[s]=e[s]; - Mt(e)} - )} - (Tgt.exports?Tgt.exports:self.nacl=self.nacl||{ - } - ); - var Cgt=Tgt.exports,Ogt={ - } - ,Igt={ - exports:{ - } - } - ; - !function(t){ - var i,s; - i=pi,s=function(){ - var t={ - } - ; - function i(t){ - if(!/^(?:[A-Za-z0-9+\/]{ - 2} - [A-Za-z0-9+\/]{ - 2} - )*(?:[A-Za-z0-9+\/]{ - 2} - ==|[A-Za-z0-9+\/]{ - 3} - =)?$/.test(t))throw new TypeError("invalid encoding")} - return Qt(i,"validateBase64"),t.decodeUTF8=function(t){ - if("string"!=typeof t)throw new TypeError("expected string"); - var i,s=unescape(encodeURIComponent(t)),e=new Uint8Array(s.length); - for(i=0; - i<s.length; - i++)e[i]=s.charCodeAt(i); - return e} - ,t.encodeUTF8=function(t){ - var i,s=[]; - for(i=0; - i<t.length; - i++)s.push(String.fromCharCode(t[i])); - return decodeURIComponent(escape(s.join("")))} - ,"undefined"==typeof atob?void 0!==Buffer.from?(t.encodeBase64=function(t){ - return Buffer.from(t).toString("base64")} - ,t.decodeBase64=function(t){ - return i(t),new Uint8Array(Array.prototype.slice.call(Buffer.from(t,"base64"),0))} - ):(t.encodeBase64=function(t){ - return new Buffer(t).toString("base64")} - ,t.decodeBase64=function(t){ - return i(t),new Uint8Array(Array.prototype.slice.call(new Buffer(t,"base64"),0))} - ):(t.encodeBase64=function(t){ - var i,s=[],e=t.length; - for(i=0; - i<e; - i++)s.push(String.fromCharCode(t[i])); - return btoa(s.join(""))} - ,t.decodeBase64=function(t){ - i(t); - var s,e=atob(t),n=new Uint8Array(e.length); - for(s=0; - s<e.length; - s++)n[s]=e.charCodeAt(s); - return n} - ),t} - ,t.exports?t.exports=s():(i.nacl||(i.nacl={ - } - ),i.nacl.util=s())} - (Igt); - var kgt=Igt.exports; - function xgt(t,i){ - if(t.length>=255)throw new TypeError("Alphabet too long"); - for(var s=new Uint8Array(256),e=0; - e<s.length; - e++)s[e]=255; - for(var n=0; - n<t.length; - n++){ - var h=t.charAt(n),r=h.charCodeAt(0); - if(255!==s[r])throw new TypeError(h+" is ambiguous"); - s[r]=n} - var o=t.length,a=t.charAt(0),c=Math.log(o)/Math.log(256),l=Math.log(256)/Math.log(o); - function u(i){ - if(i instanceof Uint8Array||(ArrayBuffer.isView(i)?i=new Uint8Array(i.buffer,i.byteOffset,i.byteLength):Array.isArray(i)&&(i=Uint8Array.from(i))),!(i instanceof Uint8Array))throw new TypeError("Expected Uint8Array"); - if(0===i.length)return""; - for(var s=0,e=0,n=0,h=i.length; - n!==h&&0===i[n]; - )n++,s++; - for(var r=(h-n)*l+1>>>0,c=new Uint8Array(r); - n!==h; - ){ - for(var u=i[n],d=0,f=r-1; - (0!==u||d<e)&&-1!==f; - f--,d++)u+=256*c[f]>>>0,c[f]=u%o>>>0,u=u/o>>>0; - if(0!==u)throw new Error("Non-zero carry"); - e=d,n++} - for(var p=r-e; - p!==r&&0===c[p]; - )p++; - for(var w=a.repeat(s); - p<r; - ++p)w+=t.charAt(c[p]); - return w} - function d(t){ - if("string"!=typeof t)throw new TypeError("Expected String"); - if(0===t.length)return new Uint8Array; - var i=0; - if(" "!==t[i]){ - for(var e=0,n=0; - t[i]===a; - )e++,i++; - for(var h=(t.length-i)*c+1>>>0,r=new Uint8Array(h); - t[i]; - ){ - var l=s[t.charCodeAt(i)]; - if(255===l)return; - for(var u=0,d=h-1; - (0!==l||u<n)&&-1!==d; - d--,u++)l+=o*r[d]>>>0,r[d]=l%256>>>0,l=l/256>>>0; - if(0!==l)throw new Error("Non-zero carry"); - n=u,i++} - if(" "!==t[i]){ - for(var f=h-n; - f!==h&&0===r[f]; - )f++; - for(var p=new Uint8Array(e+(h-f)),w=e; - f!==h; - )p[w++]=r[f++]; - return p} - } - } - function f(t){ - var s=d(t); - if(s)return s; - throw new Error(`Non-${ - i} - character`)} - return Qt(u,"encode"),Qt(d,"decodeUnsafe"),Qt(f,"decode"),{ - encode:u,decodeUnsafe:d,decode:f} - } - Qt(xgt,"base$2"); - var Rgt=xgt; - const Pgt=new Uint8Array(0),Ngt=Qt(t=>t.reduce((t,i)=>t+i.toString(16).padStart(2,"0"),""),"toHex"),Lgt=Qt(t=>{ - const i=t.match(/../g); - return i?new Uint8Array(i.map(t=>parseInt(t,16))):Pgt} - ,"fromHex"),Dgt=Qt((t,i)=>{ - if(t===i)return!0; - if(t.byteLength!==i.byteLength)return!1; - for(let s=0; - s<t.byteLength; - s++)if(t[s]!==i[s])return!1; - return!0} - ,"equals$1"),Ggt=Qt(t=>{ - if(t instanceof Uint8Array&&"Uint8Array"===t.constructor.name)return t; - if(t instanceof ArrayBuffer)return new Uint8Array(t); - if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength); - throw new Error("Unknown type, must be binary type")} - ,"coerce"),Bgt=Qt(t=>t instanceof ArrayBuffer||ArrayBuffer.isView(t),"isBinary"),Ugt=Qt(t=>(new TextEncoder).encode(t),"fromString"),Fgt=Qt(t=>(new TextDecoder).decode(t),"toString$2"),$gt=Object.freeze(Object.defineProperty({ - __proto__:null,coerce:Ggt,empty:Pgt,equals:Dgt,fromHex:Lgt,fromString:Ugt,isBinary:Bgt,toHex:Ngt,toString:Fgt} - ,Symbol.toStringTag,{ - value:"Module"} - )),Hgt=class{ - constructor(t,i,s){ - this.name=t,this.prefix=i,this.baseEncode=s} - encode(t){ - if(t instanceof Uint8Array)return`${ - this.prefix} - ${ - this.baseEncode(t)} - `; - throw Error("Unknown type, must be binary type")} - } - ; - Qt(Hgt,"Encoder"); - let Wgt=Hgt; - const Vgt=class{ - constructor(t,i,s){ - this.name=t,this.prefix=i,this.baseDecode=s} - decode(t){ - if("string"==typeof t){ - if(t[0]===this.prefix)return this.baseDecode(t.slice(1)); - throw Error(`Unable to decode multibase string ${ - JSON.stringify(t)} - , ${ - this.name} - decoder only supports inputs prefixed with ${ - this.prefix} - `)} - throw Error("Can only multibase decode strings")} - or(t){ - const i={ - [this.prefix]:this,...t.decoders||{ - [t.prefix]:t} - } - ; - return new zgt(i)} - } - ; - Qt(Vgt,"Decoder"); - let jgt=Vgt; - const Kgt=class t{ - constructor(t){ - this.decoders=t} - or(i){ - const s=i.decoders||{ - [i.prefix]:i} - ; - return new t({ - ...this.decoders,...s} - )} - decode(t){ - const i=t[0],s=this.decoders[i]; - if(s)return s.decode(t); - throw RangeError(`Unable to decode multibase string ${ - JSON.stringify(t)} - , only inputs prefixed with ${ - Object.keys(this.decoders)} - are supported`)} - } - ; - Qt(Kgt,"ComposedDecoder"); - let zgt=Kgt; - const Ygt=class{ - constructor(t,i,s,e){ - this.name=t,this.prefix=i,this.baseEncode=s,this.baseDecode=e,this.encoder=new Wgt(t,i,s),this.decoder=new jgt(t,i,e)} - encode(t){ - return this.encoder.encode(t)} - decode(t){ - return this.decoder.decode(t)} - } - ; - Qt(Ygt,"Codec"); - let qgt=Ygt; - const Xgt=Qt(({ - name:t,prefix:i,encode:s,decode:e} - )=>new qgt(t,i,s,e),"from$1"),Jgt=Qt(({ - prefix:t,name:i,alphabet:s} - )=>{ - const{ - encode:e,decode:n} - =Rgt(s,i); - return Xgt({ - prefix:t,name:i,encode:e,decode:Qt(t=>Ggt(n(t)),"decode")} - )} - ,"baseX"),Qgt=Qt((t,i,s,e)=>{ - const n={ - } - ; - for(let l=0; - l<i.length; - ++l)n[i[l]]=l; - let h=t.length; - for(; - "="===t[h-1]; - )--h; - const r=new Uint8Array(h*s/8|0); - let o=0,a=0,c=0; - for(let l=0; - l<h; - ++l){ - const i=n[t[l]]; - if(void 0===i)throw new SyntaxError(`Non-${ - e} - character`); - a=a<<s|i,o+=s,o>=8&&(o-=8,r[c++]=255&a>>o)} - if(o>=s||255&a<<8-o)throw new SyntaxError("Unexpected end of data"); - return r} - ,"decode$6"),Zgt=Qt((t,i,s)=>{ - const e="="===i[i.length-1],n=(1<<s)-1; - let h="",r=0,o=0; - for(let a=0; - a<t.length; - ++a)for(o=o<<8|t[a],r+=8; - r>s; - )r-=s,h+=i[n&o>>r]; - if(r&&(h+=i[n&o<<s-r]),e)for(; - h.length*s&7; - )h+="="; - return h} - ,"encode$5"),tmt=Qt(({ - name:t,prefix:i,bitsPerChar:s,alphabet:e} - )=>Xgt({ - prefix:i,name:t,encode:t=>Zgt(t,e,s),decode:i=>Qgt(i,e,s,t)} - ),"rfc4648"),imt=Xgt({ - prefix:"\0",name:"identity",encode:Qt(t=>Fgt(t),"encode"),decode:Qt(t=>Ugt(t),"decode")} - ),smt=Object.freeze(Object.defineProperty({ - __proto__:null,identity:imt} - ,Symbol.toStringTag,{ - value:"Module"} - )),emt=tmt({ - prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1} - ),nmt=Object.freeze(Object.defineProperty({ - __proto__:null,base2:emt} - ,Symbol.toStringTag,{ - value:"Module"} - )),hmt=tmt({ - prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3} - ),rmt=Object.freeze(Object.defineProperty({ - __proto__:null,base8:hmt} - ,Symbol.toStringTag,{ - value:"Module"} - )),omt=Jgt({ - prefix:"9",name:"base10",alphabet:"0123456789"} - ),amt=Object.freeze(Object.defineProperty({ - __proto__:null,base10:omt} - ,Symbol.toStringTag,{ - value:"Module"} - )),cmt=tmt({ - prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4} - ),lmt=tmt({ - prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4} - ),umt=Object.freeze(Object.defineProperty({ - __proto__:null,base16:cmt,base16upper:lmt} - ,Symbol.toStringTag,{ - value:"Module"} - )),dmt=tmt({ - prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5} - ),fmt=tmt({ - prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5} - ),pmt=tmt({ - prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5} - ),wmt=tmt({ - prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5} - ),gmt=tmt({ - prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5} - ),mmt=tmt({ - prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5} - ),vmt=tmt({ - prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5} - ),_mt=tmt({ - prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5} - ),Mmt=tmt({ - prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5} - ),bmt=Object.freeze(Object.defineProperty({ - __proto__:null,base32:dmt,base32hex:gmt,base32hexpad:vmt,base32hexpadupper:_mt,base32hexupper:mmt,base32pad:pmt,base32padupper:wmt,base32upper:fmt,base32z:Mmt} - ,Symbol.toStringTag,{ - value:"Module"} - )),ymt=Jgt({ - prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"} - ),Emt=Jgt({ - prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"} - ),Amt=Object.freeze(Object.defineProperty({ - __proto__:null,base36:ymt,base36upper:Emt} - ,Symbol.toStringTag,{ - value:"Module"} - )),Smt=Jgt({ - name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"} - ),Tmt=Jgt({ - name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"} - ),Cmt=Object.freeze(Object.defineProperty({ - __proto__:null,base58btc:Smt,base58flickr:Tmt} - ,Symbol.toStringTag,{ - value:"Module"} - )),Omt=tmt({ - prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6} - ),Imt=tmt({ - prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6} - ),kmt=tmt({ - prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6} - ),xmt=tmt({ - prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6} - ),Rmt=Object.freeze(Object.defineProperty({ - __proto__:null,base64:Omt,base64pad:Imt,base64url:kmt,base64urlpad:xmt} - ,Symbol.toStringTag,{ - value:"Module"} - )); - var Pmt=Gmt,Nmt=128,Lmt=-128,Dmt=Math.pow(2,31); - function Gmt(t,i,s){ - i=i||[]; - for(var e=s=s||0; - t>=Dmt; - )i[s++]=255&t|Nmt,t/=128; - for(; - t&Lmt; - )i[s++]=255&t|Nmt,t>>>=7; - return i[s]=0|t,Gmt.bytes=s-e+1,i} - Qt(Gmt,"encode$4"); - var Bmt=$mt,Umt=128,Fmt=127; - function $mt(t,i){ - var s,e=0,n=0,h=i=i||0,r=t.length; - do{ - if(h>=r)throw $mt.bytes=0,new RangeError("Could not decode varint"); - s=t[h++],e+=n<28?(s&Fmt)<<n:(s&Fmt)*Math.pow(2,n),n+=7} - while(s>=Umt); - return $mt.bytes=h-i,e} - Qt($mt,"read"); - var Hmt=Math.pow(2,7),Wmt=Math.pow(2,14),Vmt=Math.pow(2,21),jmt=Math.pow(2,28),Kmt=Math.pow(2,35),zmt=Math.pow(2,42),Ymt=Math.pow(2,49),qmt=Math.pow(2,56),Xmt=Math.pow(2,63),Jmt={ - encode:Pmt,decode:Bmt,encodingLength:Qt(function(t){ - return t<Hmt?1:t<Wmt?2:t<Vmt?3:t<jmt?4:t<Kmt?5:t<zmt?6:t<Ymt?7:t<qmt?8:t<Xmt?9:10} - ,"length")} - ; - const Qmt=Qt(t=>[Jmt.decode(t),Jmt.decode.bytes],"decode$4"),Zmt=Qt((t,i,s=0)=>(Jmt.encode(t,i,s),i),"encodeTo"),tvt=Qt(t=>Jmt.encodingLength(t),"encodingLength"),ivt=Object.freeze(Object.defineProperty({ - __proto__:null,decode:Qmt,encodeTo:Zmt,encodingLength:tvt} - ,Symbol.toStringTag,{ - value:"Module"} - )),svt=Qt((t,i)=>{ - const s=i.byteLength,e=tvt(t),n=e+tvt(s),h=new Uint8Array(n+s); - return Zmt(t,h,0),Zmt(s,h,e),h.set(i,n),new rvt(t,s,i,h)} - ,"create"),evt=Qt(t=>{ - const i=Ggt(t),[s,e]=Qmt(i),[n,h]=Qmt(i.subarray(e)),r=i.subarray(e+h); - if(r.byteLength!==n)throw new Error("Incorrect length"); - return new rvt(s,n,r,i)} - ,"decode$3"),nvt=Qt((t,i)=>t===i||t.code===i.code&&t.size===i.size&&Dgt(t.bytes,i.bytes),"equals"),hvt=class{ - constructor(t,i,s,e){ - this.code=t,this.size=i,this.digest=s,this.bytes=e} - } - ; - Qt(hvt,"Digest"); - let rvt=hvt; - const ovt=Object.freeze(Object.defineProperty({ - __proto__:null,Digest:rvt,create:svt,decode:evt,equals:nvt} - ,Symbol.toStringTag,{ - value:"Module"} - )),avt=Qt(({ - name:t,code:i,encode:s} - )=>new lvt(t,i,s),"from"),cvt=class{ - constructor(t,i,s){ - this.name=t,this.code=i,this.encode=s} - async digest(t){ - if(t instanceof Uint8Array){ - const i=await this.encode(t); - return svt(this.code,i)} - throw Error("Unknown type, must be binary type")} - } - ; - Qt(cvt,"Hasher"); - let lvt=cvt; - const uvt=Object.freeze(Object.defineProperty({ - __proto__:null,Hasher:lvt,from:avt} - ,Symbol.toStringTag,{ - value:"Module"} - )),dvt=Qt(t=>async i=>new Uint8Array(await crypto.subtle.digest(t,i)),"sha"),fvt=avt({ - name:"sha2-256",code:18,encode:dvt("SHA-256")} - ),pvt=avt({ - name:"sha2-512",code:19,encode:dvt("SHA-512")} - ),wvt=Object.freeze(Object.defineProperty({ - __proto__:null,sha256:fvt,sha512:pvt} - ,Symbol.toStringTag,{ - value:"Module"} - )),gvt=avt({ - name:"identity",code:0,encode:Qt(t=>Ggt(t),"encode")} - ),mvt=Object.freeze(Object.defineProperty({ - __proto__:null,identity:gvt} - ,Symbol.toStringTag,{ - value:"Module"} - )),vvt=Qt(t=>Ggt(t),"raw"),{ - name:_vt,code:Mvt,encode:bvt,decode:yvt} - ={ - name:"raw",code:85,decode:vvt,encode:vvt} - ,Evt=Object.freeze(Object.defineProperty({ - __proto__:null,code:Mvt,decode:yvt,encode:bvt,name:_vt} - ,Symbol.toStringTag,{ - value:"Module"} - )),{ - name:Avt,code:Svt,encode:Tvt,decode:Cvt} - ={ - name:"json",code:512,encode:Qt(t=>(new TextEncoder).encode(JSON.stringify(t)),"encode"),decode:Qt(t=>JSON.parse((new TextDecoder).decode(t)),"decode")} - ,Ovt=Object.freeze(Object.defineProperty({ - __proto__:null,code:Svt,decode:Cvt,encode:Tvt,name:Avt} - ,Symbol.toStringTag,{ - value:"Module"} - )),Ivt=class t{ - constructor(t,i,s,e){ - this.code=i,this.version=t,this.multihash=s,this.bytes=e,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{ - byteOffset:Uvt,byteLength:Uvt,code:Bvt,version:Bvt,multihash:Bvt,bytes:Bvt,_baseCache:Uvt,asCID:Uvt} - )} - toV0(){ - if(0===this.version)return this; - { - const{ - code:i,multihash:s} - =this; - if(i!==Nvt)throw new Error("Cannot convert a non dag-pb CID to CIDv0"); - if(s.code!==Lvt)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0"); - return t.createV0(s)} - } - toV1(){ - switch(this.version){ - case 0:{ - const{ - code:i,digest:s} - =this.multihash,e=svt(i,s); - return t.createV1(this.code,e)} - case 1:return this; - default:throw Error(`Can not convert CID version ${ - this.version} - to version 0. This is a bug please report`)} - } - equals(t){ - return t&&this.code===t.code&&this.version===t.version&&nvt(this.multihash,t.multihash)} - toString(t){ - const{ - bytes:i,version:s,_baseCache:e} - =this; - return 0===s?Rvt(i,e,t||Smt.encoder):Pvt(i,e,t||dmt.encoder)} - toJSON(){ - return{ - code:this.code,version:this.version,hash:this.multihash.bytes} - } - get[Symbol.toStringTag](){ - return"CID"} - [Symbol.for("nodejs.util.inspect.custom")](){ - return"CID("+this.toString()+")"} - static isCID(t){ - return Fvt(/^0\.0/,$vt),!(!t||!t[Gvt]&&t.asCID!==t)} - get toBaseEncodedString(){ - throw new Error("Deprecated, use .toString()")} - get codec(){ - throw new Error('"codec" property is deprecated, use integer "code" property instead')} - get buffer(){ - throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")} - get multibaseName(){ - throw new Error('"multibaseName" property is deprecated')} - get prefix(){ - throw new Error('"prefix" property is deprecated')} - static asCID(i){ - if(i instanceof t)return i; - if(null!=i&&i.asCID===i){ - const{ - version:s,code:e,multihash:n,bytes:h} - =i; - return new t(s,e,n,h||Dvt(s,e,n.bytes))} - if(null!=i&&!0===i[Gvt]){ - const{ - version:s,multihash:e,code:n} - =i,h=evt(e); - return t.create(s,n,h)} - return null} - static create(i,s,e){ - if("number"!=typeof s)throw new Error("String codecs are no longer supported"); - switch(i){ - case 0:if(s!==Nvt)throw new Error(`Version 0 CID must use dag-pb (code: ${ - Nvt} - ) block encoding`); - return new t(i,s,e,e.bytes); - case 1:{ - const n=Dvt(i,s,e.bytes); - return new t(i,s,e,n)} - default:throw new Error("Invalid version")} - } - static createV0(i){ - return t.create(0,Nvt,i)} - static createV1(i,s){ - return t.create(1,i,s)} - static decode(i){ - const[s,e]=t.decodeFirst(i); - if(e.length)throw new Error("Incorrect length"); - return s} - static decodeFirst(i){ - const s=t.inspectBytes(i),e=s.size-s.multihashSize,n=Ggt(i.subarray(e,e+s.multihashSize)); - if(n.byteLength!==s.multihashSize)throw new Error("Incorrect length"); - const h=n.subarray(s.multihashSize-s.digestSize),r=new rvt(s.multihashCode,s.digestSize,h,n); - return[0===s.version?t.createV0(r):t.createV1(s.codec,r),i.subarray(s.size)]} - static inspectBytes(t){ - let i=0; - const s=Qt(()=>{ - const[s,e]=Qmt(t.subarray(i)); - return i+=e,s} - ,"next"); - let e=s(),n=Nvt; - if(18===e?(e=0,i=0):1===e&&(n=s()),0!==e&&1!==e)throw new RangeError(`Invalid CID version ${ - e} - `); - const h=i,r=s(),o=s(),a=i+o; - return{ - version:e,codec:n,multihashCode:r,digestSize:o,multihashSize:a-h,size:a} - } - static parse(i,s){ - const[e,n]=xvt(i,s),h=t.decode(n); - return h._baseCache.set(e,i),h} - } - ; - Qt(Ivt,"CID"); - let kvt=Ivt; - const xvt=Qt((t,i)=>{ - switch(t[0]){ - case"Q":{ - const s=i||Smt; - return[Smt.prefix,s.decode(`${ - Smt.prefix} - ${ - t} - `)]} - case Smt.prefix:{ - const s=i||Smt; - return[Smt.prefix,s.decode(t)]} - case dmt.prefix:{ - const s=i||dmt; - return[dmt.prefix,s.decode(t)]} - default:if(null==i)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided"); - return[t[0],i.decode(t)]} - } - ,"parseCIDtoBytes"),Rvt=Qt((t,i,s)=>{ - const{ - prefix:e} - =s; - if(e!==Smt.prefix)throw Error(`Cannot string encode V0 in ${ - s.name} - encoding`); - const n=i.get(e); - if(null==n){ - const n=s.encode(t).slice(1); - return i.set(e,n),n} - return n} - ,"toStringV0"),Pvt=Qt((t,i,s)=>{ - const{ - prefix:e} - =s,n=i.get(e); - if(null==n){ - const n=s.encode(t); - return i.set(e,n),n} - return n} - ,"toStringV1"),Nvt=112,Lvt=18,Dvt=Qt((t,i,s)=>{ - const e=tvt(t),n=e+tvt(i),h=new Uint8Array(n+s.byteLength); - return Zmt(t,h,0),Zmt(i,h,e),h.set(s,n),h} - ,"encodeCID"),Gvt=Symbol.for("@ipld/js-cid/CID"),Bvt={ - writable:!1,configurable:!1,enumerable:!0} - ,Uvt={ - writable:!1,enumerable:!1,configurable:!1} - ,Fvt=Qt((t,i)=>{ - if(!t.test("0.0.0-dev"))throw new Error(i)} - ,"deprecate"),$vt="CID.isCID(v) is deprecated and will be removed in the next major release.\nFollowing code pattern:\n\nif (CID.isCID(value)) { - \n doSomethingWithCID(value)\n} - \n\nIs replaced with:\n\nconst cid = CID.asCID(value)\nif (cid) { - \n // Make sure to use cid instead of value\n doSomethingWithCID(cid)\n} - \n",Hvt={ - ...smt,...nmt,...rmt,...amt,...umt,...bmt,...Amt,...Cmt,...Rmt} - ,Wvt={ - ...wvt,...mvt} - ,Vvt={ - raw:Evt,json:Ovt} - ,jvt=Object.freeze(Object.defineProperty({ - __proto__:null,CID:kvt,bases:Hvt,bytes:$gt,codecs:Vvt,digest:ovt,hasher:uvt,hashes:Wvt,varint:ivt} - ,Symbol.toStringTag,{ - value:"Module"} - )); - function Kvt(t=0){ - return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)} - function zvt(t,i,s,e){ - return{ - name:t,prefix:i,encoder:{ - name:t,prefix:i,encode:s} - ,decoder:{ - decode:e} - } - } - Qt(Kvt,"allocUnsafe"),Qt(zvt,"createCodec"); - const Yvt=zvt("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>(new TextEncoder).encode(t.substring(1))),qvt=zvt("ascii","a",t=>{ - let i="a"; - for(let s=0; - s<t.length; - s++)i+=String.fromCharCode(t[s]); - return i} - ,t=>{ - const i=Kvt((t=t.substring(1)).length); - for(let s=0; - s<t.length; - s++)i[s]=t.charCodeAt(s); - return i} - ),Xvt={ - utf8:Yvt,"utf-8":Yvt,hex:Hvt.base16,latin1:qvt,ascii:qvt,binary:qvt,...Hvt} - ; - function Jvt(t,i="utf8"){ - const s=Xvt[i]; - if(!s)throw new Error(`Unsupported encoding "${ - i} - "`); - return"utf8"!==i&&"utf-8"!==i||null==globalThis.Buffer||null==globalThis.Buffer.from?s.encoder.encode(t).substring(1):globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8")} - Qt(Jvt,"toString"); - const Qvt=gi(Object.freeze(Object.defineProperty({ - __proto__:null,toString:Jvt} - ,Symbol.toStringTag,{ - value:"Module"} - ))); - var Zvt={ - } - ,t_t={ - } - ,i_t={ - } - ; - !function(t){ - function i(t,i){ - var s=65535&t,e=65535&i; - return s*e+((t>>>16&65535)*e+s*(i>>>16&65535)<<16>>>0)|0} - function s(t,i){ - return t+i|0} - function e(t,i){ - return t-i|0} - function n(t,i){ - return t<<i|t>>>32-i} - function h(t,i){ - return t<<32-i|t>>>i} - function r(t){ - return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t} - Object.defineProperty(t,"__esModule",{ - value:!0} - ),Qt(i,"imulShim"),t.mul=Math.imul||i,Qt(s,"add"),t.add=s,Qt(e,"sub"),t.sub=e,Qt(n,"rotl"),t.rotl=n,Qt(h,"rotr"),t.rotr=h,Qt(r,"isIntegerShim"),t.isInteger=Number.isInteger||r,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(i){ - return t.isInteger(i)&&i>=-t.MAX_SAFE_INTEGER&&i<=t.MAX_SAFE_INTEGER} - } - (i_t),Object.defineProperty(t_t,"__esModule",{ - value:!0} - ); - var s_t=i_t; - function e_t(t,i){ - return void 0===i&&(i=0),(t[i+0]<<8|t[i+1])<<16>>16} - function n_t(t,i){ - return void 0===i&&(i=0),(t[i+0]<<8|t[i+1])>>>0} - function h_t(t,i){ - return void 0===i&&(i=0),(t[i+1]<<8|t[i])<<16>>16} - function r_t(t,i){ - return void 0===i&&(i=0),(t[i+1]<<8|t[i])>>>0} - function o_t(t,i,s){ - return void 0===i&&(i=new Uint8Array(2)),void 0===s&&(s=0),i[s+0]=t>>>8,i[s+1]=t>>>0,i} - function a_t(t,i,s){ - return void 0===i&&(i=new Uint8Array(2)),void 0===s&&(s=0),i[s+0]=t>>>0,i[s+1]=t>>>8,i} - function c_t(t,i){ - return void 0===i&&(i=0),t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3]} - function l_t(t,i){ - return void 0===i&&(i=0),(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3])>>>0} - function u_t(t,i){ - return void 0===i&&(i=0),t[i+3]<<24|t[i+2]<<16|t[i+1]<<8|t[i]} - function d_t(t,i){ - return void 0===i&&(i=0),(t[i+3]<<24|t[i+2]<<16|t[i+1]<<8|t[i])>>>0} - function f_t(t,i,s){ - return void 0===i&&(i=new Uint8Array(4)),void 0===s&&(s=0),i[s+0]=t>>>24,i[s+1]=t>>>16,i[s+2]=t>>>8,i[s+3]=t>>>0,i} - function p_t(t,i,s){ - return void 0===i&&(i=new Uint8Array(4)),void 0===s&&(s=0),i[s+0]=t>>>0,i[s+1]=t>>>8,i[s+2]=t>>>16,i[s+3]=t>>>24,i} - function w_t(t,i){ - void 0===i&&(i=0); - var s=c_t(t,i),e=c_t(t,i+4); - return 4294967296*s+e-4294967296*(e>>31)} - function g_t(t,i){ - return void 0===i&&(i=0),4294967296*l_t(t,i)+l_t(t,i+4)} - function m_t(t,i){ - void 0===i&&(i=0); - var s=u_t(t,i); - return 4294967296*u_t(t,i+4)+s-4294967296*(s>>31)} - function v_t(t,i){ - void 0===i&&(i=0); - var s=d_t(t,i); - return 4294967296*d_t(t,i+4)+s} - function __t(t,i,s){ - return void 0===i&&(i=new Uint8Array(8)),void 0===s&&(s=0),f_t(t/4294967296>>>0,i,s),f_t(t>>>0,i,s+4),i} - function M_t(t,i,s){ - return void 0===i&&(i=new Uint8Array(8)),void 0===s&&(s=0),p_t(t>>>0,i,s),p_t(t/4294967296>>>0,i,s+4),i} - function b_t(t,i,s){ - if(void 0===s&&(s=0),t%8!=0)throw new Error("readUintBE supports only bitLengths divisible by 8"); - if(t/8>i.length-s)throw new Error("readUintBE: array is too short for the given bitLength"); - for(var e=0,n=1,h=t/8+s-1; - h>=s; - h--)e+=i[h]*n,n*=256; - return e} - function y_t(t,i,s){ - if(void 0===s&&(s=0),t%8!=0)throw new Error("readUintLE supports only bitLengths divisible by 8"); - if(t/8>i.length-s)throw new Error("readUintLE: array is too short for the given bitLength"); - for(var e=0,n=1,h=s; - h<s+t/8; - h++)e+=i[h]*n,n*=256; - return e} - function E_t(t,i,s,e){ - if(void 0===s&&(s=new Uint8Array(t/8)),void 0===e&&(e=0),t%8!=0)throw new Error("writeUintBE supports only bitLengths divisible by 8"); - if(!s_t.isSafeInteger(i))throw new Error("writeUintBE value must be an integer"); - for(var n=1,h=t/8+e-1; - h>=e; - h--)s[h]=i/n&255,n*=256; - return s} - function A_t(t,i,s,e){ - if(void 0===s&&(s=new Uint8Array(t/8)),void 0===e&&(e=0),t%8!=0)throw new Error("writeUintLE supports only bitLengths divisible by 8"); - if(!s_t.isSafeInteger(i))throw new Error("writeUintLE value must be an integer"); - for(var n=1,h=e; - h<e+t/8; - h++)s[h]=i/n&255,n*=256; - return s} - function S_t(t,i){ - return void 0===i&&(i=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat32(i)} - function T_t(t,i){ - return void 0===i&&(i=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat32(i,!0)} - function C_t(t,i){ - return void 0===i&&(i=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat64(i)} - function O_t(t,i){ - return void 0===i&&(i=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat64(i,!0)} - function I_t(t,i,s){ - return void 0===i&&(i=new Uint8Array(4)),void 0===s&&(s=0),new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat32(s,t),i} - function k_t(t,i,s){ - return void 0===i&&(i=new Uint8Array(4)),void 0===s&&(s=0),new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat32(s,t,!0),i} - function x_t(t,i,s){ - return void 0===i&&(i=new Uint8Array(8)),void 0===s&&(s=0),new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat64(s,t),i} - function R_t(t,i,s){ - return void 0===i&&(i=new Uint8Array(8)),void 0===s&&(s=0),new DataView(i.buffer,i.byteOffset,i.byteLength).setFloat64(s,t,!0),i} - Qt(e_t,"readInt16BE"),t_t.readInt16BE=e_t,Qt(n_t,"readUint16BE"),t_t.readUint16BE=n_t,Qt(h_t,"readInt16LE"),t_t.readInt16LE=h_t,Qt(r_t,"readUint16LE"),t_t.readUint16LE=r_t,Qt(o_t,"writeUint16BE"),t_t.writeUint16BE=o_t,t_t.writeInt16BE=o_t,Qt(a_t,"writeUint16LE"),t_t.writeUint16LE=a_t,t_t.writeInt16LE=a_t,Qt(c_t,"readInt32BE"),t_t.readInt32BE=c_t,Qt(l_t,"readUint32BE"),t_t.readUint32BE=l_t,Qt(u_t,"readInt32LE"),t_t.readInt32LE=u_t,Qt(d_t,"readUint32LE"),t_t.readUint32LE=d_t,Qt(f_t,"writeUint32BE"),t_t.writeUint32BE=f_t,t_t.writeInt32BE=f_t,Qt(p_t,"writeUint32LE"),t_t.writeUint32LE=p_t,t_t.writeInt32LE=p_t,Qt(w_t,"readInt64BE"),t_t.readInt64BE=w_t,Qt(g_t,"readUint64BE"),t_t.readUint64BE=g_t,Qt(m_t,"readInt64LE"),t_t.readInt64LE=m_t,Qt(v_t,"readUint64LE"),t_t.readUint64LE=v_t,Qt(__t,"writeUint64BE"),t_t.writeUint64BE=__t,t_t.writeInt64BE=__t,Qt(M_t,"writeUint64LE"),t_t.writeUint64LE=M_t,t_t.writeInt64LE=M_t,Qt(b_t,"readUintBE"),t_t.readUintBE=b_t,Qt(y_t,"readUintLE"),t_t.readUintLE=y_t,Qt(E_t,"writeUintBE"),t_t.writeUintBE=E_t,Qt(A_t,"writeUintLE"),t_t.writeUintLE=A_t,Qt(S_t,"readFloat32BE"),t_t.readFloat32BE=S_t,Qt(T_t,"readFloat32LE"),t_t.readFloat32LE=T_t,Qt(C_t,"readFloat64BE"),t_t.readFloat64BE=C_t,Qt(O_t,"readFloat64LE"),t_t.readFloat64LE=O_t,Qt(I_t,"writeFloat32BE"),t_t.writeFloat32BE=I_t,Qt(k_t,"writeFloat32LE"),t_t.writeFloat32LE=k_t,Qt(x_t,"writeFloat64BE"),t_t.writeFloat64BE=x_t,Qt(R_t,"writeFloat64LE"),t_t.writeFloat64LE=R_t; - var P_t={ - } - ; - function N_t(t){ - for(var i=0; - i<t.length; - i++)t[i]=0; - return t} - Object.defineProperty(P_t,"__esModule",{ - value:!0} - ),Qt(N_t,"wipe"),P_t.wipe=N_t,function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ); - var i=t_t,s=P_t; - t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64; - var e=function(){ - function e(){ - this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()} - return Qt(e,"SHA256"),e.prototype._initState=function(){ - this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225} - ,e.prototype.reset=function(){ - return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this} - ,e.prototype.clean=function(){ - s.wipe(this._buffer),s.wipe(this._temp),this.reset()} - ,e.prototype.update=function(t,i){ - if(void 0===i&&(i=t.length),this._finished)throw new Error("SHA256: can't update because hash was finished."); - var s=0; - if(this._bytesHashed+=i,this._bufferLength>0){ - for(; - this._bufferLength<this.blockSize&&i>0; - )this._buffer[this._bufferLength++]=t[s++],i--; - this._bufferLength===this.blockSize&&(h(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)} - for(i>=this.blockSize&&(s=h(this._temp,this._state,t,s,i),i%=this.blockSize); - i>0; - )this._buffer[this._bufferLength++]=t[s++],i--; - return this} - ,e.prototype.finish=function(t){ - if(!this._finished){ - var s=this._bytesHashed,e=this._bufferLength,n=s/536870912|0,r=s<<3,o=s%64<56?64:128; - this._buffer[e]=128; - for(var a=e+1; - a<o-8; - a++)this._buffer[a]=0; - i.writeUint32BE(n,this._buffer,o-8),i.writeUint32BE(r,this._buffer,o-4),h(this._temp,this._state,this._buffer,0,o),this._finished=!0} - for(a=0; - a<this.digestLength/4; - a++)i.writeUint32BE(this._state[a],t,4*a); - return this} - ,e.prototype.digest=function(){ - var t=new Uint8Array(this.digestLength); - return this.finish(t),t} - ,e.prototype.saveState=function(){ - if(this._finished)throw new Error("SHA256: cannot save finished state"); - return{ - state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed} - } - ,e.prototype.restoreState=function(t){ - return this._state.set(t.state),this._bufferLength=t.bufferLength,t.buffer&&this._buffer.set(t.buffer),this._bytesHashed=t.bytesHashed,this._finished=!1,this} - ,e.prototype.cleanSavedState=function(t){ - s.wipe(t.state),t.buffer&&s.wipe(t.buffer),t.bufferLength=0,t.bytesHashed=0} - ,e} - (); - t.SHA256=e; - var n=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]); - function h(t,s,e,h,r){ - for(; - r>=64; - ){ - for(var o=s[0],a=s[1],c=s[2],l=s[3],u=s[4],d=s[5],f=s[6],p=s[7],w=0; - w<16; - w++){ - var g=h+4*w; - t[w]=i.readUint32BE(e,g)} - for(w=16; - w<64; - w++){ - var m=t[w-2],v=(m>>>17|m<<15)^(m>>>19|m<<13)^m>>>10,_=((m=t[w-15])>>>7|m<<25)^(m>>>18|m<<14)^m>>>3; - t[w]=(v+t[w-7]|0)+(_+t[w-16]|0)} - for(w=0; - w<64; - w++)v=(((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+(u&d^~u&f)|0)+(p+(n[w]+t[w]|0)|0)|0,_=((o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+(o&a^o&c^a&c)|0,p=f,f=d,d=u,u=l+v|0,l=c,c=a,a=o,o=v+_|0; - s[0]+=o,s[1]+=a,s[2]+=c,s[3]+=l,s[4]+=u,s[5]+=d,s[6]+=f,s[7]+=p,h+=64,r-=64} - return h} - function r(t){ - var i=new e; - i.update(t); - var s=i.digest(); - return i.clean(),s} - Qt(h,"hashBlocks"),Qt(r,"hash"),t.hash=r} - (Zvt); - var L_t={ - } - ,D_t={ - } - ,G_t={ - } - ,B_t={ - } - ,U_t={ - } - ,F_t={ - } - ,$_t={ - } - ; - !function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.DEFAULT_ERROR=t.STANDARD_ERROR_MAP=t.SERVER_ERROR_CODE_RANGE=t.RESERVED_ERROR_CODES=t.SERVER_ERROR=t.INTERNAL_ERROR=t.INVALID_PARAMS=t.METHOD_NOT_FOUND=t.INVALID_REQUEST=t.PARSE_ERROR=t.OKX_CONNECT_ERROR_CODES=t.OKXConnectError=void 0; - const i=class t extends Error{ - constructor(i,s){ - null==s&&(s=e(i)),super(s),this.code=i,this.message=`${ - t.prefix} - ${ - s?"\n"+s:""} - `,Object.setPrototypeOf(this,t.prototype)} - toJSON(){ - return{ - message:this.message,code:this.code} - } - } - ; - Qt(i,"OKXConnectError"); - let s=i; - function e(t){ - return t==n.UNKNOWN_ERROR?"unknown error":t==n.BAD_REQUEST_ERROR?"bad request error":t==n.ALREADY_CONNECTED_ERROR?"already connected error":t==n.NOT_CONNECTED_ERROR?"not connected error":t==n.UNKNOWN_APP_ERROR?"unknown app error":t==n.USER_REJECTS_ERROR?"user rejects error":t==n.USER_REJECTS_ERROR_CAUSE_REGISTER?"wallet address are registering":t==n.METHOD_NOT_SUPPORTED?"method not supported":t==n.CONNECTION_ERROR?"connect error":t==n.CHAIN_NOT_SUPPORTED?"chain not supported":"unknown error"} - var n,h; - t.OKXConnectError=s,s.prefix="[OKX_CONNECT_SDK_ERROR]",Qt(e,"getDefaultMessageByCode"),(h=n||(t.OKX_CONNECT_ERROR_CODES=n={ - } - ))[h.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",h[h.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",h[h.ALREADY_CONNECTED_ERROR=11]="ALREADY_CONNECTED_ERROR",h[h.NOT_CONNECTED_ERROR=12]="NOT_CONNECTED_ERROR",h[h.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",h[h.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",h[h.USER_REJECTS_ERROR_CAUSE_REGISTER=301]="USER_REJECTS_ERROR_CAUSE_REGISTER",h[h.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED",h[h.CHAIN_NOT_SUPPORTED=500]="CHAIN_NOT_SUPPORTED",h[h.WALLET_NOT_SUPPORTED=600]="WALLET_NOT_SUPPORTED",h[h.CONNECTION_ERROR=700]="CONNECTION_ERROR",t.PARSE_ERROR="PARSE_ERROR",t.INVALID_REQUEST="INVALID_REQUEST",t.METHOD_NOT_FOUND="METHOD_NOT_FOUND",t.INVALID_PARAMS="INVALID_PARAMS",t.INTERNAL_ERROR="INTERNAL_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.RESERVED_ERROR_CODES=[-32700,-32600,-32601,-32602,-32603],t.SERVER_ERROR_CODE_RANGE=[-32e3,-32099],t.STANDARD_ERROR_MAP={ - [t.PARSE_ERROR]:{ - code:-32700,message:"Parse error"} - ,[t.INVALID_REQUEST]:{ - code:-32600,message:"Invalid Request"} - ,[t.METHOD_NOT_FOUND]:{ - code:-32601,message:"Method not found"} - ,[t.INVALID_PARAMS]:{ - code:-32602,message:"Invalid params"} - ,[t.INTERNAL_ERROR]:{ - code:-32603,message:"Internal error"} - ,[t.SERVER_ERROR]:{ - code:-32e3,message:"Server error"} - } - ,t.DEFAULT_ERROR=t.SERVER_ERROR} - ($_t),function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.OKX_CONNECT_ERROR_CODES=t.OKXConnectError=void 0; - var i=$_t; - Object.defineProperty(t,"OKXConnectError",{ - enumerable:!0,get:Qt(function(){ - return i.OKXConnectError} - ,"get")} - ),Object.defineProperty(t,"OKX_CONNECT_ERROR_CODES",{ - enumerable:!0,get:Qt(function(){ - return i.OKX_CONNECT_ERROR_CODES} - ,"get")} - )} - (F_t); - var H_t,W_t,V_t={ - } - ; - Object.defineProperty(V_t,"__esModule",{ - value:!0} - ),V_t.NameSpaceKeyStarknet=V_t.NameSpaceKeyTron=V_t.NameSpaceKeyCosmos=V_t.NameSpaceKeyAptos=V_t.NameSpaceKeyBtc=V_t.NameSpaceKeySui=V_t.NameSpaceKeyTON=V_t.NameSpaceKeySOL=V_t.NameSpaceKeyEip155=V_t.OpenAppLinkType=void 0,(W_t=H_t||(V_t.OpenAppLinkType=H_t={ - } - )).UniversalLink="universallink",W_t.DeepLink="deeplink",V_t.NameSpaceKeyEip155="eip155",V_t.NameSpaceKeySOL="solana",V_t.NameSpaceKeyTON="ton",V_t.NameSpaceKeySui="sui",V_t.NameSpaceKeyBtc="btc",V_t.NameSpaceKeyAptos="aptos",V_t.NameSpaceKeyCosmos="cosmos",V_t.NameSpaceKeyTron="tron",V_t.NameSpaceKeyStarknet="starknet"; - var j_t={ - } - ; - !function(t){ - function i(){ - return window.okxTesttwaUrl} - function s(){ - return window.okxTestTgtwaUrl} - function e(t){ - const i=new URL(t).pathname.split("/").filter(Boolean); - if(i.length>=2)return{ - botName:i[0],appName:i[1]} - } - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.tgwalletAppName=t.tgwalletName=t.tonConnectSdkVersion=t.standardDeeplink=t.okxCommonStackDeepLink=t.okxWalletStackDeepLink=t.okxAppStackDeepLink=t.okxCommonDeepLink=t.okxWalletDeepLink=t.okxAppDeepLink=t.downloadUrl=t.okxCommonUniversalLink=t.okxWalletUniversalLink=t.okxAppUniversalLink=void 0,t.getTestTwaUrl=i,t.getTestTgTwaUrl=s,t.getBotNameAndAppName=e,t.okxAppUniversalLink="https://link.okx.com/ul/connect",t.okxWalletUniversalLink="https://web3link.okx.com/ul/connect",t.okxCommonUniversalLink="https://web3.okx.com/ul/connect",t.downloadUrl="https://www.okx.com/download",t.okxAppDeepLink="okx://web3/wallet/connect",t.okxWalletDeepLink="okxwallet://web3/wallet/connect",t.okxCommonDeepLink="okxweb3://web3/wallet/connect",t.okxAppStackDeepLink="okx://web3?stack=true",t.okxWalletStackDeepLink="okxwallet://web3?stack=true",t.okxCommonStackDeepLink="okxweb3://web3?stack=true",t.standardDeeplink=t.okxAppStackDeepLink,t.tonConnectSdkVersion="1",t.tgwalletName="OKX_WALLET_BOT",t.tgwalletAppName="start",Qt(i,"getTestTwaUrl"),Qt(s,"getTestTgTwaUrl"),Qt(e,"getBotNameAndAppName")} - (j_t); - var K_t={ - } - ,z_t={ - } - ,Y_t=pi&&pi.__importDefault||function(t){ - return t&&t.__esModule?t:{ - default:t} - } - ; - function q_t(t){ - return"object"==typeof t&&"id"in t&&"jsonrpc"in t&&"2.0"===t.jsonrpc} - function X_t(t){ - return q_t(t)&&"method"in t} - function J_t(t){ - return q_t(t)&&(Q_t(t)||Z_t(t))} - function Q_t(t){ - return"result"in t} - function Z_t(t){ - return"error"in t} - Object.defineProperty(z_t,"__esModule",{ - value:!0} - ),z_t.isJsonRpcPayload=q_t,z_t.isJsonRpcRequest=X_t,z_t.isJsonRpcResponse=J_t,z_t.isJsonRpcResult=Q_t,z_t.isJsonRpcError=Z_t,z_t.payloadId=hMt,z_t.getBigIntRpcId=rMt,z_t.formatJsonRpcRequest=oMt,z_t.formatJsonRpcResult=aMt,z_t.formatJsonRpcError=cMt,z_t.isReservedErrorCode=lMt,z_t.getError=uMt,z_t.getErrorByCode=dMt,z_t.formatErrorMessage=fMt,z_t.isHttpUrl=gMt,z_t.isWsUrl=mMt,z_t.parseConnectionError=vMt,Qt(q_t,"isJsonRpcPayload$1"),Qt(X_t,"isJsonRpcRequest$1"),Qt(J_t,"isJsonRpcResponse$1"),Qt(Q_t,"isJsonRpcResult$1"),Qt(Z_t,"isJsonRpcError$1"); - const tMt=$_t,iMt=Y_t(Cgt); - let sMt=(Qt(bt=class{ - constructor(t){ - this.i=1,this.initialValue=t?iMt.default.randomBytes(t/8)[0]:0} - getNextValue(){ - return this.initialValue+this.i++} - } - ,"IncrementalRandomGenerator"),bt); - const eMt=new sMt(8),nMt=new sMt(16); - function hMt(){ - return 1e3*Date.now()+eMt.getNextValue()} - function rMt(){ - return BigInt(Date.now())*BigInt(1e6)+BigInt(nMt.getNextValue())} - function oMt(t,i,s){ - return{ - id:s||hMt(),jsonrpc:"2.0",method:t,params:i} - } - function aMt(t,i){ - return{ - id:t,jsonrpc:"2.0",result:i} - } - function cMt(t,i,s){ - return{ - id:t,jsonrpc:"2.0",error:fMt(i,s)} - } - function lMt(t){ - return tMt.RESERVED_ERROR_CODES.includes(t)} - function uMt(t){ - return Object.keys(tMt.STANDARD_ERROR_MAP).includes(t)?tMt.STANDARD_ERROR_MAP[t]:tMt.STANDARD_ERROR_MAP[tMt.DEFAULT_ERROR]} - function dMt(t){ - const i=Object.values(tMt.STANDARD_ERROR_MAP).find(i=>i.code===t); - return i||tMt.STANDARD_ERROR_MAP[tMt.DEFAULT_ERROR]} - function fMt(t,i){ - return void 0===t?uMt(tMt.INTERNAL_ERROR):("string"==typeof t&&(t=Object.assign(Object.assign({ - } - ,uMt(tMt.SERVER_ERROR)),{ - message:t} - )),void 0!==i&&(t.data=i),lMt(t.code)&&(t=dMt(t.code)),t)} - function pMt(t){ - const i=t.match(new RegExp(/^\w+:/,"gi")); - if(i&&i.length)return i[0]} - function wMt(t,i){ - const s=pMt(t); - return void 0!==s&&new RegExp(i).test(s)} - function gMt(t){ - return wMt(t,"^https?:")} - function mMt(t){ - return wMt(t,"^wss?:")} - function vMt(t,i,s){ - return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${ - s} - RPC url at ${ - i} - `):t} - Qt(hMt,"payloadId$1"),Qt(rMt,"getBigIntRpcId$1"),Qt(oMt,"formatJsonRpcRequest$1"),Qt(aMt,"formatJsonRpcResult$1"),Qt(cMt,"formatJsonRpcError$1"),Qt(lMt,"isReservedErrorCode$1"),Qt(uMt,"getError$1"),Qt(dMt,"getErrorByCode$1"),Qt(fMt,"formatErrorMessage$1"),Qt(pMt,"getUrlProtocol$1"),Qt(wMt,"matchRegexProtocol$1"),Qt(gMt,"isHttpUrl$1"),Qt(mMt,"isWsUrl$1"),Qt(vMt,"parseConnectionError$1"); - var _Mt={ - } - ; - const MMt=gi(_i); - var bMt=pi&&pi.__importDefault||function(t){ - return t&&t.__esModule?t:{ - default:t} - } - ; - Object.defineProperty(_Mt,"__esModule",{ - value:!0} - ),_Mt.IEngine=_Mt.ISignClient=_Mt.ISignClientEvents=_Mt.IEngineEvents=void 0; - const yMt=bMt(MMt); - let EMt=(yt=class extends yMt.default{ - constructor(){ - super()} - } - ,Qt(yt,"IEngineEvents"),yt); - _Mt.IEngineEvents=EMt; - let AMt=(Et=class extends yMt.default{ - constructor(){ - super()} - } - ,Qt(Et,"ISignClientEvents"),Et); - _Mt.ISignClientEvents=AMt; - let SMt=(Qt(At=class{ - constructor(t){ - this.data=t} - } - ,"ISignClient"),At); - _Mt.ISignClient=SMt; - let TMt=(Qt(St=class{ - constructor(t){ - this.client=t} - } - ,"IEngine"),St); - _Mt.IEngine=TMt; - var CMt,OMt,IMt={ - } - ; - Object.defineProperty(IMt,"__esModule",{ - value:!0} - ),IMt.ConnectWalletType=void 0,(OMt=CMt||(IMt.ConnectWalletType=CMt={ - } - ))[OMt.OKX_MINI=110]="OKX_MINI",OMt[OMt.OKX_APP=100]="OKX_APP",OMt[OMt.OKX_WALLET=120]="OKX_WALLET",OMt[OMt.OKX_APP_COMMON=130]="OKX_APP_COMMON"; - var kMt,xMt={ - } - ,RMt={ - } - ; - Object.defineProperty(RMt,"__esModule",{ - value:!0} - ),RMt.TONCHAIN=void 0,(kMt||(RMt.TONCHAIN=kMt={ - } - )).MAINNET="-239"; - var PMt,NMt,LMt={ - } - ; - Object.defineProperty(LMt,"__esModule",{ - value:!0} - ),LMt.CONNECT_ITEM_ERROR_CODES=void 0,(NMt=PMt||(LMt.CONNECT_ITEM_ERROR_CODES=PMt={ - } - ))[NMt.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",NMt[NMt.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED",function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.CONNECT_ITEM_ERROR_CODES=t.TONCHAIN=void 0; - var i=RMt; - Object.defineProperty(t,"TONCHAIN",{ - enumerable:!0,get:Qt(function(){ - return i.TONCHAIN} - ,"get")} - ); - var s=LMt; - Object.defineProperty(t,"CONNECT_ITEM_ERROR_CODES",{ - enumerable:!0,get:Qt(function(){ - return s.CONNECT_ITEM_ERROR_CODES} - ,"get")} - )} - (xMt); - var DMt={ - } - ; - !function(t){ - function i(){ - return{ - appName:"okxAppWallet",name:t.OKXWalletName,imageUrl:"https://static.okx.com/cdn/assets/imgs/247/58E63FEA47A2B7D7.png"} - } - function s(){ - return{ - appName:"okxMiniApp",name:t.OKXMiniWalletName,imageUrl:"https://static.okx.com/cdn/assets/imgs/247/58E63FEA47A2B7D7.png"} - } - function e(){ - return{ - appName:"okxInjectWallet",name:t.OKXInjectWalletName,imageUrl:""} - } - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.AptosAppleWalletName=t.AptosGoogleWalletName=t.OKXInjectWalletName=t.OKXMiniWalletName=t.OKXWalletName=void 0,t.creatOKXWalletInfo=i,t.creatOKXMiniAppWalletInfo=s,t.creatOKXInjectWalletInfo=e,t.OKXWalletName="OKX Wallet",t.OKXMiniWalletName="OKX Mini Wallet",t.OKXInjectWalletName="OKX Inject Wallet",t.AptosGoogleWalletName="Continue with Google",t.AptosAppleWalletName="Continue with Apple",Qt(i,"creatOKXWalletInfo"),Qt(s,"creatOKXMiniAppWalletInfo"),Qt(e,"creatOKXInjectWalletInfo")} - (DMt),function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.ConnectWalletType=t.ISignClientEvents=t.IEngine=t.IEngineEvents=t.ISignClient=t.getBigIntRpcId=t.formatJsonRpcRequest=t.isJsonRpcError=t.isJsonRpcResponse=t.parseConnectionError=t.isHttpUrl=t.formatJsonRpcError=void 0; - var e=z_t; - Object.defineProperty(t,"formatJsonRpcError",{ - enumerable:!0,get:Qt(function(){ - return e.formatJsonRpcError} - ,"get")} - ),Object.defineProperty(t,"isHttpUrl",{ - enumerable:!0,get:Qt(function(){ - return e.isHttpUrl} - ,"get")} - ),Object.defineProperty(t,"parseConnectionError",{ - enumerable:!0,get:Qt(function(){ - return e.parseConnectionError} - ,"get")} - ),Object.defineProperty(t,"isJsonRpcResponse",{ - enumerable:!0,get:Qt(function(){ - return e.isJsonRpcResponse} - ,"get")} - ),Object.defineProperty(t,"isJsonRpcError",{ - enumerable:!0,get:Qt(function(){ - return e.isJsonRpcError} - ,"get")} - ),Object.defineProperty(t,"formatJsonRpcRequest",{ - enumerable:!0,get:Qt(function(){ - return e.formatJsonRpcRequest} - ,"get")} - ),Object.defineProperty(t,"getBigIntRpcId",{ - enumerable:!0,get:Qt(function(){ - return e.getBigIntRpcId} - ,"get")} - ); - var n=_Mt; - Object.defineProperty(t,"ISignClient",{ - enumerable:!0,get:Qt(function(){ - return n.ISignClient} - ,"get")} - ),Object.defineProperty(t,"IEngineEvents",{ - enumerable:!0,get:Qt(function(){ - return n.IEngineEvents} - ,"get")} - ),Object.defineProperty(t,"IEngine",{ - enumerable:!0,get:Qt(function(){ - return n.IEngine} - ,"get")} - ),Object.defineProperty(t,"ISignClientEvents",{ - enumerable:!0,get:Qt(function(){ - return n.ISignClientEvents} - ,"get")} - ); - var h=IMt; - Object.defineProperty(t,"ConnectWalletType",{ - enumerable:!0,get:Qt(function(){ - return h.ConnectWalletType} - ,"get")} - ),s(xMt,t),s(DMt,t)} - (K_t); - var GMt={ - } - ; - !function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.NAMES_CHAINS=t.TON_CHAINS=t.COSMOS_CHAINS=t.APTOS_CHAINS=t.SUI_CHAINS=t.SOLANA_CHAINS_STANDARD=t.SOLANA_CHAINS=t.BTC_CHAINS=void 0; - const i=V_t; - t.BTC_CHAINS={ - MAINNET:"btc:mainnet",FRACTAL:"fractal:mainnet"} - ,t.SOLANA_CHAINS={ - MAINNET:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",TESTNET:"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z",SONIC_TESTNET:"sonic:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z"} - ,t.SOLANA_CHAINS_STANDARD={ - MAINNET:"solana:mainnet",TESTNET:"solana:testnet"} - ,t.SUI_CHAINS={ - MAINNET:"sui:mainnet"} - ,t.APTOS_CHAINS={ - MAINNET:"aptos:mainnet",MOVEMENT_MAINNET:"movement:mainnet",MOVEMENT_TESTNET:"movement:testnet"} - ,t.COSMOS_CHAINS={ - COSMOS_MAINNET:"cosmos:cosmoshub-4"} - ,t.TON_CHAINS={ - MAINNET:"ton:-239"} - ,t.NAMES_CHAINS={ - [i.NameSpaceKeyBtc]:Object.values(t.BTC_CHAINS),[i.NameSpaceKeySOL]:Object.values(t.SOLANA_CHAINS),[i.NameSpaceKeyTON]:Object.values(t.TON_CHAINS),[i.NameSpaceKeySui]:Object.values(t.SUI_CHAINS),[i.NameSpaceKeyAptos]:Object.values(t.APTOS_CHAINS),[i.NameSpaceKeyCosmos]:Object.values(t.COSMOS_CHAINS)} - } - (GMt),function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.okxWalletUniversalLink=t.okxAppUniversalLink=t.okxWalletDeepLink=t.okxAppDeepLink=t.okxWalletStackDeepLink=t.okxAppStackDeepLink=t.standardDeeplink=t.downloadUrl=t.tonConnectSdkVersion=t.OpenAppLinkType=t.NameSpaceKeyStarknet=t.NameSpaceKeyTron=t.NameSpaceKeyCosmos=t.NameSpaceKeyAptos=t.NameSpaceKeyBtc=t.NameSpaceKeySui=t.NameSpaceKeyTON=t.NameSpaceKeySOL=t.NameSpaceKeyEip155=void 0,s(F_t,t); - var e=V_t; - Object.defineProperty(t,"NameSpaceKeyEip155",{ - enumerable:!0,get:Qt(function(){ - return e.NameSpaceKeyEip155} - ,"get")} - ),Object.defineProperty(t,"NameSpaceKeySOL",{ - enumerable:!0,get:Qt(function(){ - return e.NameSpaceKeySOL} - ,"get")} - ),Object.defineProperty(t,"NameSpaceKeyTON",{ - enumerable:!0,get:Qt(function(){ - return e.NameSpaceKeyTON} - ,"get")} - ),Object.defineProperty(t,"NameSpaceKeySui",{ - enumerable:!0,get:Qt(function(){ - return e.NameSpaceKeySui} - ,"get")} - ),Object.defineProperty(t,"NameSpaceKeyBtc",{ - enumerable:!0,get:Qt(function(){ - return e.NameSpaceKeyBtc} - ,"get")} - ),Object.defineProperty(t,"NameSpaceKeyAptos",{ - enumerable:!0,get:Qt(function(){ - return e.NameSpaceKeyAptos} - ,"get")} - ),Object.defineProperty(t,"NameSpaceKeyCosmos",{ - enumerable:!0,get:Qt(function(){ - return e.NameSpaceKeyCosmos} - ,"get")} - ),Object.defineProperty(t,"NameSpaceKeyTron",{ - enumerable:!0,get:Qt(function(){ - return e.NameSpaceKeyTron} - ,"get")} - ),Object.defineProperty(t,"NameSpaceKeyStarknet",{ - enumerable:!0,get:Qt(function(){ - return e.NameSpaceKeyStarknet} - ,"get")} - ),Object.defineProperty(t,"OpenAppLinkType",{ - enumerable:!0,get:Qt(function(){ - return e.OpenAppLinkType} - ,"get")} - ); - var n=j_t; - Object.defineProperty(t,"tonConnectSdkVersion",{ - enumerable:!0,get:Qt(function(){ - return n.tonConnectSdkVersion} - ,"get")} - ),Object.defineProperty(t,"downloadUrl",{ - enumerable:!0,get:Qt(function(){ - return n.downloadUrl} - ,"get")} - ),Object.defineProperty(t,"standardDeeplink",{ - enumerable:!0,get:Qt(function(){ - return n.standardDeeplink} - ,"get")} - ),Object.defineProperty(t,"okxAppStackDeepLink",{ - enumerable:!0,get:Qt(function(){ - return n.okxAppStackDeepLink} - ,"get")} - ),Object.defineProperty(t,"okxWalletStackDeepLink",{ - enumerable:!0,get:Qt(function(){ - return n.okxWalletStackDeepLink} - ,"get")} - ),Object.defineProperty(t,"okxAppDeepLink",{ - enumerable:!0,get:Qt(function(){ - return n.okxAppDeepLink} - ,"get")} - ),Object.defineProperty(t,"okxWalletDeepLink",{ - enumerable:!0,get:Qt(function(){ - return n.okxWalletDeepLink} - ,"get")} - ),Object.defineProperty(t,"okxAppUniversalLink",{ - enumerable:!0,get:Qt(function(){ - return n.okxAppUniversalLink} - ,"get")} - ),Object.defineProperty(t,"okxWalletUniversalLink",{ - enumerable:!0,get:Qt(function(){ - return n.okxWalletUniversalLink} - ,"get")} - ),s(K_t,t),s(GMt,t)} - (U_t); - var BMt={ - } - ,UMt={ - } - ,FMt={ - exports:{ - } - } - ; - !function(t,i){ - !function(s,e){ - var n="function",h="undefined",r="object",o="string",a="major",c="model",l="name",u="type",d="vendor",f="version",p="architecture",w="console",g="mobile",m="tablet",v="smarttv",_="wearable",M="embedded",b="Amazon",y="Apple",E="ASUS",A="BlackBerry",S="Browser",T="Chrome",C="Firefox",O="Google",I="Honor",k="Huawei",x="LG",R="Microsoft",P="Motorola",N="Nvidia",L="OnePlus",D="Opera",G="OPPO",B="Samsung",U="Sharp",F="Sony",$="Xiaomi",H="Zebra",W="Facebook",V="Chromium OS",j="Mac OS",K=" Browser",z=Qt(function(t,i){ - var s={ - } - ; - for(var e in t)i[e]&&i[e].length%2==0?s[e]=i[e].concat(t[e]):s[e]=t[e]; - return s} - ,"extend"),Y=Qt(function(t){ - for(var i={ - } - ,s=0; - s<t.length; - s++)i[t[s].toUpperCase()]=t[s]; - return i} - ,"enumerize"),q=Qt(function(t,i){ - return typeof t===o&&-1!==X(i).indexOf(X(t))} - ,"has"),X=Qt(function(t){ - return t.toLowerCase()} - ,"lowerize"),J=Qt(function(t){ - return typeof t===o?t.replace(/[^\d\.]/g,"").split(".")[0]:e} - ,"majorize"),Q=Qt(function(t,i){ - if(typeof t===o)return t=t.replace(/^\s\s*/,""),typeof i===h?t:t.substring(0,500)} - ,"trim"),Z=Qt(function(t,i){ - for(var s,h,o,a,c,l,u=0; - u<i.length&&!c; - ){ - var d=i[u],f=i[u+1]; - for(s=h=0; - s<d.length&&!c&&d[s]; - )if(c=d[s++].exec(t))for(o=0; - o<f.length; - o++)l=c[++h],typeof(a=f[o])===r&&a.length>0?2===a.length?typeof a[1]==n?this[a[0]]=a[1].call(this,l):this[a[0]]=a[1]:3===a.length?typeof a[1]!==n||a[1].exec&&a[1].test?this[a[0]]=l?l.replace(a[1],a[2]):e:this[a[0]]=l?a[1].call(this,l,a[2]):e:4===a.length&&(this[a[0]]=l?a[3].call(this,l.replace(a[1],a[2])):e):this[a]=l||e; - u+=2} - } - ,"rgxMapper"),tt=Qt(function(t,i){ - for(var s in i)if(typeof i[s]===r&&i[s].length>0){ - for(var n=0; - n<i[s].length; - n++)if(q(i[s][n],t))return"?"===s?e:s} - else if(q(i[s],t))return"?"===s?e:s; - return i.hasOwnProperty("*")?i["*"]:t} - ,"strMapper"),it={ - ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"} - ,st={ - browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{ - 3,6} - )\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,f],[/opios[\/ ]+([\w\.]+)/i],[f,[l,D+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[f,[l,D+" GX"]],[/\bopr\/([\w\.]+)/i],[f,[l,D]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{ - 5,6} - )[\/ ]?([\w\.]+)/i],[f,[l,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[f,[l,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[l,f],[/quark(?:pc)?\/([-\w\.]+)/i],[f,[l,"Quark"]],[/\bddg\/([\w\.]+)/i],[f,[l,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[l,"UC"+S]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[f,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{ - 1,9} - )\b.+like gecko/i],[f,[l,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[f,[l,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[f,[l,"Smart Lenovo "+S]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure "+S],f],[/\bfocus\/([\w\.]+)/i],[f,[l,C+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[l,D+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[l,D+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[l,"MIUI"+K]],[/fxios\/([\w\.-]+)/i],[f,[l,C]],[/\bqihoobrowser\/?([\w\.]*)/i],[f,[l,"360"]],[/\b(qq)\/([\w\.]+)/i],[[l,/(.+)/,"$1Browser"],f],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1"+K],f],[/samsungbrowser\/([\w\.]+)/i],[f,[l,B+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[f,[l,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[l,"Sogou Mobile"],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[l,f],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[l],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[f,l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|; - fbav\/([\w\.]+); - )/i],[[l,W],f],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[l,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[l,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[f,[l,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[l,T+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,T+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[l,"Android "+S]],[/(chrome|omniweb|arora|[tizenoka]{ - 5} - ?browser)\/v?([\w\.]+)/i],[l,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[l,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[f,tt,{ - "1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"} - ]],[/(webkit|khtml)\/([\w\.]+)/i],[l,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],f],[/(wolvic|librewolf)\/([\w\.]+)/i],[l,f],[/mobile vr; - rv:([\w\.]+)\).+firefox/i],[f,[l,C+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[l,[f,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[l,[f,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[p,"amd64"]],[/(ia32(?=; - ))/i,/\b((i[346]|x)86)(pc)?\b/i],[[p,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[p,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/( (ce|mobile); - ppc; - |\/[\w\.]+arm\b)/i],[[p,"arm"]],[/((ppc|powerpc)(64)?)( mac|; - |\))/i],[[p,/ower/,"",X]],[/ sun4\w[; - \)]/i],[[p,"sparc"]],[/\b(avr32|ia64(?=; - )|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|; - |eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[p,X]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{ - 2,4} - |gt-[pn]\d{ - 2,4} - |sgh-t8[56]9|nexus 10)/i],[c,[d,B],[u,m]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[c,[d,B],[u,g]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|; - )/i],[c,[d,y],[u,g]],[/\((ipad); - [-\w\),; - ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[; - \]].+ios/i],[c,[d,y],[u,m]],[/(macintosh); - /i],[c,[d,y]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[c,[d,U],[u,g]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|; - )/i],[c,[d,I],[u,m]],[/honor([-\w ]+)[; - \)]/i],[c,[d,I],[u,g]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[c,[d,k],[u,m]],[/(?:huawei)([-\w ]+)[; - \)]/i,/\b(nexus 6p|\w{ - 2,4} - e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[c,[d,k],[u,g]],[/oid[^\)]+; - (2[\dbc]{ - 4} - (182|283|rp\w{ - 2} - )[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[c,/_/g," "],[d,$],[u,m]],[/\b(poco[\w ]+|m2\d{ - 3} - j\d\d[a-z]{ - 2} - )(?: bui|\))/i,/\b; - (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; - (m?[12][0-389][01]\w{ - 3,6} - [c-y])( bui|; - wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[c,/_/g," "],[d,$],[u,g]],[/; - (\w+) bui.+ oppo/i,/\b(cph[12]\d{ - 3} - |p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[c,[d,G],[u,g]],[/\b(opd2(\d{ - 3} - a?))(?: bui|\))/i],[c,[d,tt,{ - OnePlus:["304","403","203"],"*":G} - ],[u,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{ - 3} - \w?[at])(?: bui|; - )/i],[c,[d,"Vivo"],[u,g]],[/\b(rmx[1-3]\d{ - 3} - )(?: bui|; - |\))/i],[c,[d,"Realme"],[u,g]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{ - 3,4} - |nexus 6)(?= bui|\)))/i],[c,[d,P],[u,g]],[/\b(mz60\d|xoom[2 ]{ - 0,2} - ) build\//i],[c,[d,P],[u,m]],[/((?=lg)?[vl]k\-?\d{ - 3} - ) bui| 3\.[-\w; - ]{ - 10} - lg?-([06cv9]{ - 3,4} - )/i],[c,[d,x],[u,m]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e; - \/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[c,[d,x],[u,g]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{ - 3,4} - (?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|; - |\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{ - 6,7} - )( bui|; - |\)|\/)/i],[c,[d,"Lenovo"],[u,m]],[/(nokia) (t[12][01])/i],[d,c,[u,m]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[c,/_/g," "],[u,g],[d,"Nokia"]],[/(pixel (c|tablet))\b/i],[c,[d,O],[u,m]],[/droid.+; - (pixel[\daxl ]{ - 0,6} - )(?: bui|\))/i],[c,[d,O],[u,g]],[/droid.+; - (a?\d[0-2]{ - 2} - so|[c-g]\d{ - 4} - |so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{ - 0,1} - \d\.))/i],[c,[d,F],[u,g]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[c,"Xperia Tablet"],[d,F],[u,m]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[c,[d,L],[u,g]],[/(alexa)webm/i,/(kf[a-z]{ - 2} - wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[c,[d,b],[u,m]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[c,/(.+)/g,"Fire Phone $1"],[d,b],[u,g]],[/(playbook); - [-\w\),; - ]+(rim)/i],[c,d,[u,m]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; - (\w+)/i],[c,[d,A],[u,g]],[/(?:\b|asus_)(transfo[prime ]{ - 4,10} - \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[c,[d,E],[u,m]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[c,[d,E],[u,g]],[/(nexus 9)/i],[c,[d,"HTC"],[u,m]],[/(htc)[-; - _ ]{ - 1,2} - ([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:; - |\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[c,/_/g," "],[u,g]],[/droid [\w\.]+; - ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[c,[d,"TCL"],[u,m]],[/(itel) ((\w+))/i],[[d,X],c,[u,tt,{ - tablet:["p10001l","w7001"],"*":"mobile"} - ]],[/droid.+; - ([ab][1-7]-?[0178a]\d\d?)/i],[c,[d,"Acer"],[u,m]],[/droid.+; - (m[1-5] note) bui/i,/\bmz-([-\w]{ - 2,} - )/i],[c,[d,"Meizu"],[u,g]],[/; - ((?:power )?armor(?:[\w ]{ - 0,8} - ))(?: bui|\))/i],[c,[d,"Ulefone"],[u,g]],[/; - (energy ?\w+)(?: bui|\))/i,/; - energizer ([\w ]+)(?: bui|\))/i],[c,[d,"Energizer"],[u,g]],[/; - cat (b35); - /i,/; - (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[c,[d,"Cat"],[u,g]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[c,[d,"Smartfren"],[u,g]],[/droid.+; - (a(?:015|06[35]|142p?))/i],[c,[d,"Nothing"],[u,g]],[/; - (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[c,[d,"Archos"],[u,m]],[/archos ([\w ]+)( b|\))/i,/; - (ac[3-6]\d\w{ - 2,8} - )( b|\))/i],[c,[d,"Archos"],[u,g]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[d,c,[u,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; - (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); - (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[d,c,[u,g]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{ - 1,9} - ) bui/i,/(trinity)[- ]*(t\d{ - 3} - ) bui/i,/(gigaset)[- ]+(q\w{ - 1,9} - ) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,c,[u,m]],[/(surface duo)/i],[c,[d,R],[u,m]],[/droid [\d\.]+; - (fp\du?)(?: b|\))/i],[c,[d,"Fairphone"],[u,g]],[/(u304aa)/i],[c,[d,"AT&T"],[u,g]],[/\bsie-(\w*)/i],[c,[d,"Siemens"],[u,g]],[/\b(rct\w+) b/i],[c,[d,"RCA"],[u,m]],[/\b(venue[\d ]{ - 2,7} - ) b/i],[c,[d,"Dell"],[u,m]],[/\b(q(?:mv|ta)\w+) b/i],[c,[d,"Verizon"],[u,m]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[c,[d,"Barnes & Noble"],[u,m]],[/\b(tm\d{ - 3} - \w+) b/i],[c,[d,"NuVision"],[u,m]],[/\b(k88) b/i],[c,[d,"ZTE"],[u,m]],[/\b(nx\d{ - 3} - j) b/i],[c,[d,"ZTE"],[u,g]],[/\b(gen\d{ - 3} - ) b.+49h/i],[c,[d,"Swiss"],[u,g]],[/\b(zur\d{ - 3} - ) b/i],[c,[d,"Swiss"],[u,m]],[/\b((zeki)?tb.*\b) b/i],[c,[d,"Zeki"],[u,m]],[/\b([yr]\d{ - 2} - ) b/i,/\b(dragon[- ]+touch |dt)(\w{ - 5} - ) b/i],[[d,"Dragon Touch"],c,[u,m]],[/\b(ns-?\w{ - 0,9} - ) b/i],[c,[d,"Insignia"],[u,m]],[/\b((nxa|next)-?\w{ - 0,9} - ) b/i],[c,[d,"NextBook"],[u,m]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],c,[u,g]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],c,[u,g]],[/\b(ph-1) /i],[c,[d,"Essential"],[u,g]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[c,[d,"Envizen"],[u,m]],[/\b(trio[-\w\. ]+) b/i],[c,[d,"MachSpeed"],[u,m]],[/\btu_(1491) b/i],[c,[d,"Rotor"],[u,m]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[c,[d,N],[u,m]],[/(sprint) (\w+)/i],[d,c,[u,g]],[/(kin\.[onetw]{ - 3} - )/i],[[c,/\./g," "],[d,R],[u,g]],[/droid.+; - (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[c,[d,H],[u,m]],[/droid.+; - (ec30|ps20|tc[2-8]\d[kx])\)/i],[c,[d,H],[u,g]],[/smart-tv.+(samsung)/i],[d,[u,v]],[/hbbtv.+maple; - (\d+)/i],[[c,/^/,"SmartTV"],[d,B],[u,v]],[/(nux; - netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,x],[u,v]],[/(apple) ?tv/i],[d,[c,y+" TV"],[u,v]],[/crkey/i],[[c,T+"cast"],[d,O],[u,v]],[/droid.+aft(\w+)( bui|\))/i],[c,[d,b],[u,v]],[/(shield \w+ tv)/i],[c,[d,N],[u,v]],[/\(dtv[\); - ].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[c,[d,U],[u,v]],[/(bravia[\w ]+)( bui|\))/i],[c,[d,F],[u,v]],[/(mi(tv|box)-?\w+) bui/i],[c,[d,$],[u,v]],[/Hbbtv.*(technisat) (.*); - /i],[d,c,[u,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; - *([\w\d][^; - ]*); - ([^; - ]*)/i],[[d,Q],[c,Q],[u,v]],[/droid.+; - ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[c,[u,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; - rv:)\b/i],[[u,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,c,[u,w]],[/droid.+; - (shield)( bui|\))/i],[c,[d,N],[u,w]],[/(playstation \w+)/i],[c,[d,F],[u,w]],[/\b(xbox(?: one)?(?!; - xbox))[\); - ]/i],[c,[d,R],[u,w]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[c,[d,B],[u,_]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[d,c,[u,_]],[/(ow(?:19|20)?we?[1-3]{ - 1,3} - )/i],[c,[d,G],[u,_]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[c,[d,y],[u,_]],[/(opwwe\d{ - 3} - )/i],[c,[d,L],[u,_]],[/(moto 360)/i],[c,[d,P],[u,_]],[/(smartwatch 3)/i],[c,[d,F],[u,_]],[/(g watch r)/i],[c,[d,x],[u,_]],[/droid.+; - (wt63?0{ - 2,3} - )\)/i],[c,[d,H],[u,_]],[/droid.+; - (glass) \d/i],[c,[d,O],[u,_]],[/(pico) (4|neo3(?: link|pro)?)/i],[d,c,[u,_]],[/; - (quest( \d| pro)?)/i],[c,[d,W],[u,_]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[u,M]],[/(aeobc)\b/i],[c,[d,b],[u,M]],[/(homepod).+mac os/i],[c,[d,y],[u,M]],[/windows iot/i],[[u,M]],[/droid .+?; - ([^; - ]+?)(?: bui|; - wv\)|\) applew).+? mobile safari/i],[c,[u,g]],[/droid .+?; - ([^; - ]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[c,[u,m]],[/\b((tablet|tab)[; - \/]|focus\/\d(?!.+mobile))/i],[[u,m]],[/(phone|mobile(?:[; - \/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[u,g]],[/droid .+?; - ([\w\. -]+)( bui|\))/i],[c,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[l,"EdgeHTML"]],[/(arkweb)\/([\w\.]+)/i],[l,f],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[l,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[l,f],[/ladybird\//i],[[l,"LibWeb"]],[/rv\:([\w\.]{ - 1,9} - )\b.+(gecko)/i],[f,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,f],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[l,[f,tt,it]],[/windows nt 6\.2; - (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[f,tt,it],[l,"Windows"]],[/[adehimnop]{ - 4,7} - \b(?:.*os ([\w]+) like mac|; - opera)/i,/(?:ios; - fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,j],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,l],[/(ubuntu) ([\w\.]+) like android/i],[[l,/(.+)/,"$1 Touch"],f],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; - ]?([\d\.]*)/i],[l,f],[/\(bb(10); - /i],[f,[l,A]],[/(?:symbian ?os|symbos|s60(?=; - )|series ?60)[-\/ ]?([\w\.]*)/i],[f,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; - [\w ]+); - rv:.+ gecko\/([\w\.]+)/i],[f,[l,C+" OS"]],[/web0s; - .+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[l,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[f,[l,"watchOS"]],[/crkey\/([\d\.]+)/i],[f,[l,T+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[l,V],f],[/panasonic; - (viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); - +xbox ([^\); - ]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; - ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{ - 0,5} - bsd|dragonfly)[\/ ]?(?!amd|[ix346]{ - 1,2} - 86)([\w\.]*)/i,/(haiku) (\w+)/i],[l,f],[/(sunos) ?([\w\.\d]*)/i],[[l,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[l,f]]} - ,et=Qt(function(t,i){ - if(typeof t===r&&(i=t,t=e),!(this instanceof et))return new et(t,i).getResult(); - var w=typeof s!==h&&s.navigator?s.navigator:e,v=t||(w&&w.userAgent?w.userAgent:""),_=w&&w.userAgentData?w.userAgentData:e,M=i?z(st,i):st,b=w&&w.userAgent==v; - return this.getBrowser=function(){ - var t={ - } - ; - return t[l]=e,t[f]=e,Z.call(t,v,M.browser),t[a]=J(t[f]),b&&w&&w.brave&&typeof w.brave.isBrave==n&&(t[l]="Brave"),t} - ,this.getCPU=function(){ - var t={ - } - ; - return t[p]=e,Z.call(t,v,M.cpu),t} - ,this.getDevice=function(){ - var t={ - } - ; - return t[d]=e,t[c]=e,t[u]=e,Z.call(t,v,M.device),b&&!t[u]&&_&&_.mobile&&(t[u]=g),b&&"Macintosh"==t[c]&&w&&typeof w.standalone!==h&&w.maxTouchPoints&&w.maxTouchPoints>2&&(t[c]="iPad",t[u]=m),t} - ,this.getEngine=function(){ - var t={ - } - ; - return t[l]=e,t[f]=e,Z.call(t,v,M.engine),t} - ,this.getOS=function(){ - var t={ - } - ; - return t[l]=e,t[f]=e,Z.call(t,v,M.os),b&&!t[l]&&_&&_.platform&&"Unknown"!=_.platform&&(t[l]=_.platform.replace(/chrome os/i,V).replace(/macos/i,j)),t} - ,this.getResult=function(){ - return{ - ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()} - } - ,this.getUA=function(){ - return v} - ,this.setUA=function(t){ - return v=typeof t===o&&t.length>500?Q(t,500):t,this} - ,this.setUA(v),this} - ,"UAParser"); - et.VERSION="1.0.41",et.BROWSER=Y([l,f,a]),et.CPU=Y([p]),et.DEVICE=Y([c,d,u,w,g,v,m,_,M]),et.ENGINE=et.OS=Y([l,f]),t.exports&&(i=t.exports=et),i.UAParser=et; - var nt=typeof s!==h&&(s.jQuery||s.Zepto); - if(nt&&!nt.ua){ - var ht=new et; - nt.ua=ht.getResult(),nt.ua.get=function(){ - return ht.getUA()} - ,nt.ua.set=function(t){ - ht.setUA(t); - var i=ht.getResult(); - for(var s in i)nt.ua[s]=i[s]} - } - } - ("object"==typeof window?window:pi)} - (FMt,FMt.exports); - var $Mt=FMt.exports; - const HMt=wi($Mt); - var WMt,VMt,jMt; - function KMt(){ - if(WMt)return UMt; - WMt=1; - var t=pi&&pi.__importDefault||function(t){ - return t&&t.__esModule?t:{ - default:t} - } - ; - Object.defineProperty(UMt,"__esModule",{ - value:!0} - ),UMt.openLink=n,UMt.openLinkBlank=h,UMt.openDeeplinkWithFallback=r,UMt.isMobileUserAgent=o,UMt.getUserAgent=a,UMt.isOS=c,UMt.isBrowser=l; - const i=t($Mt),s=ubt(),e=zMt(); - function n(t,i="_self"){ - (0,s.logDebug)("openLink",t,i),window.open(t,i,"noopener noreferrer")} - function h(t){ - n(t,"_blank")} - function r(t,i){ - const s=Qt(()=>{ - l("safari")||c("android")&&l("firefox")||i()} - ,"doFallback"),h=setTimeout(()=>s(),500); - window.addEventListener("blur",()=>clearTimeout(h),{ - once:!0} - ),c("android")&&(0,e.inTg)()?n(t,"_blank"):n(t,"_self")} - function o(){ - let t=!1; - var i; - return i=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(i)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(i.slice(0,4)))&&(t=!0),t} - function a(){ - var t,s,e; - const n=(new i.default).getResult(),h=null===(t=n.os.name)||void 0===t?void 0:t.toLowerCase(); - let r; - switch(!0){ - case"ipad"===(null===(s=n.device.model)||void 0===s?void 0:s.toLowerCase()):r="ipad"; - break; - case"ios"===h:r="ios"; - break; - case"android"===h:r="android"; - break; - case"mac os"===h:r="macos"; - break; - case"linux"===h:r="linux"; - break; - case null==h?void 0:h.includes("windows"):r="windows"} - const o=null===(e=n.browser.name)||void 0===e?void 0:e.toLowerCase(); - let a; - switch(!0){ - case"chrome"===o:a="chrome"; - break; - case"firefox"===o:a="firefox"; - break; - case null==o?void 0:o.includes("safari"):a="safari"; - break; - case null==o?void 0:o.includes("opera"):a="opera"} - return{ - os:r,browser:a} - } - function c(...t){ - return t.includes(a().os)} - function l(...t){ - return t.includes(a().browser)} - return Qt(n,"openLink"),Qt(h,"openLinkBlank"),Qt(r,"openDeeplinkWithFallback"),Qt(o,"isMobileUserAgent"),Qt(a,"getUserAgent"),Qt(c,"isOS"),Qt(l,"isBrowser"),UMt} - function zMt(){ - if(VMt)return BMt; - var t,i,s,e,n,h,r; - VMt=1,Object.defineProperty(BMt,"__esModule",{ - value:!0} - ),BMt.isTmaPlatform=p,BMt.isInTMA=w,BMt.inTg=g,BMt.isInTelegramBrowser=m,BMt.sendExpand=v,BMt.sendOpenTelegramLink=_,BMt.versionCompare=S; - const o=YMt(),a=ubt(),c=U_t,l=KMt(); - let u={ - } - ; - try{ - u=y(location.hash.toString())} - catch(frt){ - } - let d="unknown"; - if((null==u?void 0:u.tgWebAppPlatform)&&(d=null!==(t=u.tgWebAppPlatform)&&void 0!==t?t:"unknown"),"unknown"===d){ - const t=(0,o.getWindow)(); - d=null!==(e=null===(s=null===(i=null==t?void 0:t.Telegram)||void 0===i?void 0:i.WebApp)||void 0===s?void 0:s.platform)&&void 0!==e?e:"unknown"} - let f="6.0"; - if((null==u?void 0:u.tgWebAppVersion)&&(f=u.tgWebAppVersion),!f){ - const t=(0,o.getWindow)(); - f=null!==(r=null===(h=null===(n=null==t?void 0:t.Telegram)||void 0===n?void 0:n.WebApp)||void 0===h?void 0:h.version)&&void 0!==r?r:"6.0"} - function p(...t){ - return t.includes(d)} - function w(){ - var t; - return"unknown"!==d||!!(null===(t=(0,o.getWindow)())||void 0===t?void 0:t.TelegramWebviewProxy)} - function g(){ - return m()||w()} - function m(){ - var t; - const i=!!(null===(t=(0,o.getWindow)())||void 0===t?void 0:t.TelegramWebview); - return(w()||i)&&"unknown"===d} - function v(){ - b("web_app_expand",{ - } - )} - function _(t,i){ - const s=new URL(t); - if("http:"!==s.protocol&&"https:"!==s.protocol){ - if(i)return i(); - throw new c.OKXConnectError(c.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Url protocol is not supported: ${ - s} - `)} - if("t.me"!==s.hostname){ - if(i)return i(); - throw new c.OKXConnectError(c.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Url host is not supported: ${ - s} - `)} - const e=s.pathname+s.search; - M()||T("6.1")?b("web_app_open_tg_link",{ - path_full:e} - ):(0,l.openLinkBlank)("https://t.me"+e)} - function M(){ - try{ - const t=(0,o.getWindow)(); - return!!t&&null!=t.parent&&t!==t.parent} - catch(frt){ - return!1} - } - function b(t,i){ - try{ - const s=(0,o.getWindow)(); - if(!s)throw new c.OKXConnectError(c.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"Can't post event to parent window: window is not defined"); - if(void 0!==s.TelegramWebviewProxy)(0,a.logDebug)("postEvent",t,i),s.TelegramWebviewProxy.postEvent(t,JSON.stringify(i)); - else if(s.external&&"notify"in s.external)(0,a.logDebug)("postEvent",t,i),s.external.notify(JSON.stringify({ - eventType:t,eventData:i} - )); - else{ - if(!M())throw new c.OKXConnectError(c.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"Can't post event to TMA"); - { - const e="*",n=JSON.stringify({ - eventType:t,eventData:i} - ); - (0,a.logDebug)("postEvent",t,i),s.parent.postMessage(n,e)} - } - } - catch(frt){ - (0,a.logError)(`Can't post event to parent window: ${ - frt} - `)} - } - function y(t){ - let i={ - } - ; - if(!(t=t.replace(/^#/,"")).length)return i; - if(t.indexOf("=")<0&&t.indexOf("?")<0)return i._path=E(t),i; - let s=t.indexOf("?"); - if(s>=0){ - let e=t.substr(0,s); - i._path=E(e),t=t.substr(s+1)} - let e=A(t); - for(let n in e)i[n]=e[n]; - return i} - function E(t){ - try{ - return t=t.replace(/\+/g,"%20"),decodeURIComponent(t)} - catch(frt){ - return t} - } - function A(t){ - let i={ - } - ; - if(!t.length)return i; - let s,e,n,h,r=t.split("&"); - for(s=0; - s<r.length; - s++)e=r[s].split("="),n=E(e[0]),h=null==e[1]?null:E(e[1]),i[n]=h; - return i} - function S(t,i){ - "string"!=typeof t&&(t=""),"string"!=typeof i&&(i=""); - let s,e,n,h,r=t.replace(/^\s+|\s+$/g,"").split("."),o=i.replace(/^\s+|\s+$/g,"").split("."); - for(s=Math.max(r.length,o.length),e=0; - e<s; - e++)if(n=parseInt(r[e])||0,h=parseInt(o[e])||0,n!==h)return n>h?1:-1; - return 0} - function T(t){ - return S(f,t)>=0} - return Qt(p,"isTmaPlatform"),Qt(w,"isInTMA"),Qt(g,"inTg"),Qt(m,"isInTelegramBrowser"),Qt(v,"sendExpand"),Qt(_,"sendOpenTelegramLink"),Qt(M,"isIframe"),Qt(b,"postEvent"),Qt(y,"urlParseHashParams"),Qt(E,"urlSafeDecode"),Qt(A,"urlParseQueryString"),Qt(S,"versionCompare"),Qt(T,"versionAtLeast"),BMt} - function YMt(){ - if(jMt)return B_t; - var t,i,s,e; - jMt=1,Object.defineProperty(B_t,"__esModule",{ - value:!0} - ),B_t.removeUrlLastSlash=l,B_t.addPathToUrl=u,B_t.openOKXDeeplink=d,B_t.openOKXDeeplinkWithFallback=f,B_t.getWindow=p,B_t.isTelegramUrl=w,B_t.encodeTelegramUrlParameters=g,B_t.encodeConnectParams=m,B_t.encodeTWAConnectURLParams=v,B_t.openOKXTMAWalletlinkWithFallback=M,B_t.isInTMA=T,B_t.isInTelegramBrowser=C,B_t.getOKXLink=O; - const n=U_t,h=ubt(),r=j_t,o=vbt(),a=zMt(),c=Egt; - function l(t){ - return"/"===t.slice(-1)?t.slice(0,-1):t} - function u(t,i){ - return l(t)+"/"+i} - function d(t,i,s){ - f(t,i,s,!1)} - function f(t,i,s,e=!0){ - var r; - const a=!!(null===(r=p())||void 0===r?void 0:r.TelegramWebviewProxy); - let c=!1,l=null,u=Qt(()=>{ - } - ,"fallbackToDownloadPage"),d=!1; - if(d=s===n.OpenAppLinkType.UniversalLink?(0,o.isInIOSChrome)()||(0,o.isInIOSLine)()||(0,o.isInIOSLark)()||(0,o.isInIOSWeChat)():!1===a&&(0,o.isIos)(),e&&((0,o.isIos)()?d&&(u=Qt(()=>{ - c||window.open(i,"_self")} - ,"fallbackToDownloadPage")):u=Qt(()=>{ - c||(l?l.open(i,"_self"):window.open(i,"_blank"))} - ,"fallbackToDownloadPage")),!(0,o.isIos)()||d){ - if(a?((0,h.logDebug)("window.open(deeplinkUrl, '_blank') ",t),l=window.open(t,"_blank")):window.location.href=t,e){ - setTimeout(u,3e3); - let t=0,i=setInterval(()=>{ - t++,document.hidden&&(c=!0),(t>10||document.hidden)&&clearInterval(i)} - ,200); - window.addEventListener("blur",()=>{ - c=!0} - ,{ - once:!0} - ),document.addEventListener("visibilitychange",()=>{ - "hidden"===document.visibilityState&&(c=!0)} - )} - } - else a||(null===window||void 0===window?void 0:window.okxLogDebug)?window.open(i,"_blank"):window.open(i,"_self")} - function p(){ - if("undefined"!=typeof window)return window} - function w(t){ - if(!t)return!1; - const i=new URL(t); - return"tg:"===i.protocol||"t.me"===i.hostname} - function g(t){ - let i=t; - return i=i.replace(/\./g,"%2E"),i=i.replace(/-/g,"%2D"),i=i.replace(/_/g,"%5F"),i=i.replace(/&/g,"-"),i=i.replace(/=/g,"__"),i=i.replace(/%/g,"--"),i} - function m(t){ - let i=Object.assign(Object.assign({ - } - ,t),{ - protocolVersion:c.CONNECT_PROTOCOL_VER} - ); - const s=JSON.stringify(i); - (0,h.logDebug)("url encodeConnectParams connectRequestStr ",s); - const e=(new TextEncoder).encode(s),n=btoa(String.fromCharCode(...e)); - return(0,h.logDebug)("url encodeConnectParams base64Encoded ",n),n} - function v(t){ - const i=JSON.stringify({ - topic:t.topic,clientId:t.clientId} - ); - (0,h.logDebug)("url encodeConnectParams connectRequestStr",i); - const s=(new TextEncoder).encode(i); - return btoa(String.fromCharCode(...s))} - function _(t,i){ - let s={ - okxconnect:"",redirect:"",extraparams:"",fromtg:!1} - ; - t&&(s.okxconnect=t),i&&(s.redirect=i),T()?s.fromtg=!0:s.fromtg=!1,(0,h.logDebug)("getTelegramWalletTWAUrl redirect:",s.redirect); - let e=JSON.stringify(s); - const n=(new TextEncoder).encode(e),a=btoa(String.fromCharCode(...n)),c=(0,o.toSafeBase64FromBase64)(a); - if((0,h.logDebug)("[TWA] open link:",s,a),t||i){ - if(T())return(0,r.getTestTgTwaUrl)()?`${ - (0,r.getTestTgTwaUrl)()} - ?startapp=${ - c} - `:`https://t.me/${ - r.tgwalletName} - /start?startapp=${ - c} - `; - if((0,r.getTestTwaUrl)())return`${ - (0,r.getTestTwaUrl)()} - ?tgWebAppStartParam=${ - c} - `; - if((0,r.getTestTgTwaUrl)()){ - let t=(0,r.getBotNameAndAppName)((0,r.getTestTgTwaUrl)()); - if(t){ - let{ - botName:i,appName:s} - =t; - return`tg://resolve?domain=${ - i} - &appname=${ - s} - &startapp=${ - c} - `} - return`tg://resolve?domain=${ - r.tgwalletName} - &appname=${ - r.tgwalletAppName} - &startapp=${ - c} - `} - return`tg://resolve?domain=${ - r.tgwalletName} - &appname=${ - r.tgwalletAppName} - &startapp=${ - c} - `} - if(T())return(0,r.getTestTgTwaUrl)()?`${ - (0,r.getTestTgTwaUrl)()} - `:`https://t.me/${ - r.tgwalletName} - /start`; - if((0,r.getTestTwaUrl)())return`${ - (0,r.getTestTwaUrl)()} - `; - if((0,r.getTestTgTwaUrl)()){ - let t=(0,r.getBotNameAndAppName)((0,r.getTestTgTwaUrl)()); - if(t){ - let{ - botName:i,appName:s} - =t; - return`tg://resolve?domain=${ - i} - &appname=${ - s} - `} - return`tg://resolve?domain=${ - r.tgwalletName} - &appname=${ - r.tgwalletAppName} - `} - return`tg://resolve?domain=${ - r.tgwalletName} - &appname=${ - r.tgwalletAppName} - `} - function M(t){ - var i,s,e,n,o; - (0,h.logDebug)("[TWA] open link:",t,"isInTMA ==> ",T()),T()?(null===(s=null===(i=p())||void 0===i?void 0:i.Telegram)||void 0===s?void 0:s.WebApp)?null===(o=null===(n=null===(e=p())||void 0===e?void 0:e.Telegram)||void 0===n?void 0:n.WebApp)||void 0===o||o.openTelegramLink(t):(0,a.sendOpenTelegramLink)(t):(0,r.getTestTwaUrl)()?window.open(t,"_blank"):window.open(t,"_self")} - function b(t){ - try{ - return t=t.replace(/\+/g,"%20"),decodeURIComponent(t)} - catch(frt){ - return t} - } - function y(t){ - let i={ - } - ; - if(!t.length)return i; - let s,e,n,h,r=t.split("&"); - for(s=0; - s<r.length; - s++)e=r[s].split("="),n=b(e[0]),h=null==e[1]?null:b(e[1]),i[n]=h; - return i} - function E(t){ - let i={ - } - ; - if(!(t=t.replace(/^#/,"")).length)return i; - if(t.indexOf("=")<0&&t.indexOf("?")<0)return i._path=b(t),i; - let s=t.indexOf("?"); - if(s>=0){ - let e=t.substr(0,s); - i._path=b(e),t=t.substr(s+1)} - let e=y(t); - for(let n in e)i[n]=e[n]; - return i} - Qt(l,"removeUrlLastSlash"),Qt(u,"addPathToUrl"),Qt(d,"openOKXDeeplink"),Qt(f,"openOKXDeeplinkWithFallback"),Qt(p,"getWindow"),Qt(w,"isTelegramUrl"),Qt(g,"encodeTelegramUrlParameters"),Qt(m,"encodeConnectParams"),Qt(v,"encodeTWAConnectURLParams"),Qt(_,"getTelegramWalletTWAUrl"),Qt(M,"openOKXTMAWalletlinkWithFallback"),Qt(b,"urlSafeDecode"),Qt(y,"urlParseQueryString"),Qt(E,"urlParseHashParams"); - let A={ - } - ; - try{ - A=E(location.hash.toString())} - catch(frt){ - } - let S="unknown"; - if((null==A?void 0:A.tgWebAppPlatform)&&(S=null!==(t=A.tgWebAppPlatform)&&void 0!==t?t:"unknown"),"unknown"===S){ - const t=p(); - S=null!==(e=null===(s=null===(i=null==t?void 0:t.Telegram)||void 0===i?void 0:i.WebApp)||void 0===s?void 0:s.platform)&&void 0!==e?e:"unknown"} - function T(){ - var t; - return"unknown"!==S||!!(null===(t=p())||void 0===t?void 0:t.TelegramWebviewProxy)} - function C(){ - var t; - const i=!!(null===(t=p())||void 0===t?void 0:t.TelegramWebview); - return(T()||i)&&"unknown"===S} - function O(t,i=n.ConnectWalletType.OKX_APP_COMMON,s){ - function e(i,s){ - if(!t)return{ - universalLink:s,deepLink:i} - ; - const e=`${ - i} - ?param=${ - m(t)} - `; - return{ - universalLink:`${ - s} - ?topic=${ - t.topic} - ${ - (0,o.getLastSixMd5Hash)(t.clientId)} - `,deepLink:e} - } - switch((0,h.logDebug)(`url getOKXLink() called connectRequest==> ${ - JSON.stringify(t)} - walletType=> ${ - i} - tmaReturnUrl==> ${ - s} - `),Qt(e,"generateLinks"),i){ - case n.ConnectWalletType.OKX_WALLET:return e(n.okxWalletDeepLink,n.okxWalletUniversalLink); - case n.ConnectWalletType.OKX_APP_COMMON:return e(r.okxCommonDeepLink,r.okxCommonUniversalLink); - case n.ConnectWalletType.OKX_MINI:return t?{ - universalLink:_(v(t),null!=s?s:"back")} - :{ - universalLink:_(void 0,null!=s?s:"back")} - ; - default:return e(n.okxAppDeepLink,n.okxAppUniversalLink)} - } - return Qt(T,"isInTMA"),Qt(C,"isInTelegramBrowser"),Qt(O,"getOKXLink"),B_t} - Qt(KMt,"requireWebApi"),Qt(zMt,"requireTmaApi"),Qt(YMt,"requireUrl"); - var qMt={ - } - ,XMt={ - } - ,JMt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - function QMt(t,i){ - return JMt(this,void 0,void 0,function*(){ - var s,e; - const n=null!==(s=null==i?void 0:i.attempts)&&void 0!==s?s:3,h=null!==(e=null==i?void 0:i.delayMs)&&void 0!==e?e:800; - if("function"!=typeof t)throw new Error("Expected a function, got "+typeof t); - let r,o=0; - for(; - o<n; - )try{ - return yield t()} - catch(h6i){ - r=h6i,o++,o<n&&(yield ZMt(h))} - throw r} - )} - function ZMt(t,i){ - return JMt(this,void 0,void 0,function*(){ - return new Promise((s,e)=>{ - var n,h; - if(null===(n=null==i?void 0:i.signal)||void 0===n?void 0:n.aborted)return void e(new Error("Delay aborted")); - const r=setTimeout(()=>s(),t); - null===(h=null==i?void 0:i.signal)||void 0===h||h.addEventListener("abort",()=>{ - clearTimeout(r),e(new Error("Delay aborted"))} - )} - )} - )} - Object.defineProperty(XMt,"__esModule",{ - value:!0} - ),XMt.callForSuccess=QMt,XMt.delay=ZMt,Qt(QMt,"callForSuccess"),Qt(ZMt,"delay"); - var tbt={ - } - ; - Object.defineProperty(tbt,"__esModule",{ - value:!0} - ),tbt.Report_WalletType_Key=tbt.Report_OKXConnectSDK_RequestError_Log=tbt.Report_OKXConnectSDK_RequestSuccess_Log=tbt.Report_OKXConnectSDK_RequestStart_Log=tbt.Report_OKXConnectSDKExtension_ConnectDapp_Button_Click=tbt.Report_OKXConnectSDKExtension_Module_Retry_Click=tbt.Report_ConnectDapp_ConnectAndSign_Click=tbt.Report_Proceed_QRCode_Click=tbt.Report_ChooseType_Download_Click=tbt.Report_ChooseType_ConnectWallet_Click=tbt.Report_Proceed_Retry_Click=tbt.Report_OKXConnectSDKExtension_ConnectDapp_ConnectSuccess_View=tbt.Report_OKXConnectSDKExtension_ConnectDapp_Page_View=tbt.Report_ChooseType_ConnectWallet_View=tbt.Report_Loading_ConnectWallet_View=tbt.Report_Proceed_QRCode_View=tbt.Report_Proceed_Proceed_View=void 0,tbt.Report_Proceed_Proceed_View="OKXConnectSDK_Proceed_Proceed_View",tbt.Report_Proceed_QRCode_View="OKXConnectSDK_Proceed_QRCode_View",tbt.Report_Loading_ConnectWallet_View="OKXConnectSDK_Loading_ConnectWallet_View",tbt.Report_ChooseType_ConnectWallet_View="OKXConnectSDK_ChooseType_ConnectWallet_View",tbt.Report_OKXConnectSDKExtension_ConnectDapp_Page_View="OKXConnectSDKExtension_ConnectDapp_Page_View",tbt.Report_OKXConnectSDKExtension_ConnectDapp_ConnectSuccess_View="OKXConnectSDKExtension_ConnectDapp_ConnectSuccess_View",tbt.Report_Proceed_Retry_Click="OKXConnectSDK_Proceed_Retry_Click",tbt.Report_ChooseType_ConnectWallet_Click="OKXConnectSDK_ChooseType_ConnectWallet_Click",tbt.Report_ChooseType_Download_Click="OKXConnectSDK_ChooseType_Download_Click",tbt.Report_Proceed_QRCode_Click="OKXConnectSDK_Proceed_QRCode_Click",tbt.Report_ConnectDapp_ConnectAndSign_Click="OKXConnectSDK_ConnectDapp_ConnectAndSign_Click",tbt.Report_OKXConnectSDKExtension_Module_Retry_Click="OKXConnectSDKExtension_Module_Retry_Click",tbt.Report_OKXConnectSDKExtension_ConnectDapp_Button_Click="OKXConnectSDKExtension_ConnectDapp_Button_Click",tbt.Report_OKXConnectSDK_RequestStart_Log="Report_OKXConnectSDK_RequestStart_View",tbt.Report_OKXConnectSDK_RequestSuccess_Log="Report_OKXConnectSDK_RequestSuccess_View",tbt.Report_OKXConnectSDK_RequestError_Log="Report_OKXConnectSDK_RequestError_View",tbt.Report_WalletType_Key="wallet_type"; - var ibt={ - } - ; - Object.defineProperty(ibt,"__esModule",{ - value:!0} - ),ibt.checkMetaData=ebt; - const sbt=U_t; - function ebt(t){ - if(!t)throw new sbt.OKXConnectError(sbt.OKX_CONNECT_ERROR_CODES.BAD_REQUEST_ERROR,"You have to specify a `dappMetaData`in the options."); - if(!t.name)throw new sbt.OKXConnectError(sbt.OKX_CONNECT_ERROR_CODES.BAD_REQUEST_ERROR,"dappName is required"); - return!0} - var nbt,hbt; - function rbt(){ - return nbt||(nbt=1,function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.chainIdToStandardChainIdMap=t.getNamespaceKeyByChain=t.chainName2IdMap=t.replaceChainIdToChainName=t.replaceChainNameToChainId=t.checkMetaData=t.versionCompare=t.isBrowser=t.isOS=t.isMobileUserAgent=t.openDeeplinkWithFallback=t.openLinkBlank=t.openLink=t.getChainId=t.useShortLink=t.toSafeBase64FromBase64=t.isValidObject=t.isIos=t.base64decode=t.base64encode=t.splitToUint8Arrays=t.concatUint8Arrays=t.toHexString=t.hexToByteArray=t.getOKXLink=t.encodeTWAConnectURLParams=t.encodeConnectParams=t.openOKXTMAWalletlinkWithFallback=t.encodeTelegramUrlParameters=t.isTelegramUrl=t.openOKXDeeplinkWithFallback=t.openOKXDeeplink=t.safeJsonStringify=t.safeJsonParse=t.getDefaultReporter=t.reportEvent=t.reportLog=t.logWarning=t.logError=t.logDebug=t.callForSuccess=void 0; - var e=XMt; - Object.defineProperty(t,"callForSuccess",{ - enumerable:!0,get:Qt(function(){ - return e.callForSuccess} - ,"get")} - ); - var n=ubt(); - Object.defineProperty(t,"logDebug",{ - enumerable:!0,get:Qt(function(){ - return n.logDebug} - ,"get")} - ),Object.defineProperty(t,"logError",{ - enumerable:!0,get:Qt(function(){ - return n.logError} - ,"get")} - ),Object.defineProperty(t,"logWarning",{ - enumerable:!0,get:Qt(function(){ - return n.logWarning} - ,"get")} - ),Object.defineProperty(t,"reportLog",{ - enumerable:!0,get:Qt(function(){ - return n.reportLog} - ,"get")} - ),Object.defineProperty(t,"reportEvent",{ - enumerable:!0,get:Qt(function(){ - return n.reportEvent} - ,"get")} - ),Object.defineProperty(t,"getDefaultReporter",{ - enumerable:!0,get:Qt(function(){ - return n.getDefaultReporter} - ,"get")} - ),s(tbt,t),s(obt(),t); - var h=dbt(); - Object.defineProperty(t,"safeJsonParse",{ - enumerable:!0,get:Qt(function(){ - return h.safeJsonParse} - ,"get")} - ),Object.defineProperty(t,"safeJsonStringify",{ - enumerable:!0,get:Qt(function(){ - return h.safeJsonStringify} - ,"get")} - ); - var r=YMt(); - Object.defineProperty(t,"openOKXDeeplink",{ - enumerable:!0,get:Qt(function(){ - return r.openOKXDeeplink} - ,"get")} - ),Object.defineProperty(t,"openOKXDeeplinkWithFallback",{ - enumerable:!0,get:Qt(function(){ - return r.openOKXDeeplinkWithFallback} - ,"get")} - ),Object.defineProperty(t,"isTelegramUrl",{ - enumerable:!0,get:Qt(function(){ - return r.isTelegramUrl} - ,"get")} - ),Object.defineProperty(t,"encodeTelegramUrlParameters",{ - enumerable:!0,get:Qt(function(){ - return r.encodeTelegramUrlParameters} - ,"get")} - ),Object.defineProperty(t,"openOKXTMAWalletlinkWithFallback",{ - enumerable:!0,get:Qt(function(){ - return r.openOKXTMAWalletlinkWithFallback} - ,"get")} - ),Object.defineProperty(t,"encodeConnectParams",{ - enumerable:!0,get:Qt(function(){ - return r.encodeConnectParams} - ,"get")} - ),Object.defineProperty(t,"encodeTWAConnectURLParams",{ - enumerable:!0,get:Qt(function(){ - return r.encodeTWAConnectURLParams} - ,"get")} - ),Object.defineProperty(t,"getOKXLink",{ - enumerable:!0,get:Qt(function(){ - return r.getOKXLink} - ,"get")} - ); - var o=vbt(); - Object.defineProperty(t,"hexToByteArray",{ - enumerable:!0,get:Qt(function(){ - return o.hexToByteArray} - ,"get")} - ),Object.defineProperty(t,"toHexString",{ - enumerable:!0,get:Qt(function(){ - return o.toHexString} - ,"get")} - ),Object.defineProperty(t,"concatUint8Arrays",{ - enumerable:!0,get:Qt(function(){ - return o.concatUint8Arrays} - ,"get")} - ),Object.defineProperty(t,"splitToUint8Arrays",{ - enumerable:!0,get:Qt(function(){ - return o.splitToUint8Arrays} - ,"get")} - ),Object.defineProperty(t,"base64encode",{ - enumerable:!0,get:Qt(function(){ - return o.base64encode} - ,"get")} - ),Object.defineProperty(t,"base64decode",{ - enumerable:!0,get:Qt(function(){ - return o.base64decode} - ,"get")} - ),Object.defineProperty(t,"isIos",{ - enumerable:!0,get:Qt(function(){ - return o.isIos} - ,"get")} - ),Object.defineProperty(t,"isValidObject",{ - enumerable:!0,get:Qt(function(){ - return o.isValidObject} - ,"get")} - ),Object.defineProperty(t,"toSafeBase64FromBase64",{ - enumerable:!0,get:Qt(function(){ - return o.toSafeBase64FromBase64} - ,"get")} - ),Object.defineProperty(t,"useShortLink",{ - enumerable:!0,get:Qt(function(){ - return o.useShortLink} - ,"get")} - ),Object.defineProperty(t,"getChainId",{ - enumerable:!0,get:Qt(function(){ - return o.getChainId} - ,"get")} - ); - var a=KMt(); - Object.defineProperty(t,"openLink",{ - enumerable:!0,get:Qt(function(){ - return a.openLink} - ,"get")} - ),Object.defineProperty(t,"openLinkBlank",{ - enumerable:!0,get:Qt(function(){ - return a.openLinkBlank} - ,"get")} - ),Object.defineProperty(t,"openDeeplinkWithFallback",{ - enumerable:!0,get:Qt(function(){ - return a.openDeeplinkWithFallback} - ,"get")} - ),Object.defineProperty(t,"isMobileUserAgent",{ - enumerable:!0,get:Qt(function(){ - return a.isMobileUserAgent} - ,"get")} - ),Object.defineProperty(t,"isOS",{ - enumerable:!0,get:Qt(function(){ - return a.isOS} - ,"get")} - ),Object.defineProperty(t,"isBrowser",{ - enumerable:!0,get:Qt(function(){ - return a.isBrowser} - ,"get")} - ); - var c=zMt(); - Object.defineProperty(t,"versionCompare",{ - enumerable:!0,get:Qt(function(){ - return c.versionCompare} - ,"get")} - ); - var l=ibt; - Object.defineProperty(t,"checkMetaData",{ - enumerable:!0,get:Qt(function(){ - return l.checkMetaData} - ,"get")} - ); - var u=vbt(); - Object.defineProperty(t,"replaceChainNameToChainId",{ - enumerable:!0,get:Qt(function(){ - return u.replaceChainNameToChainId} - ,"get")} - ),Object.defineProperty(t,"replaceChainIdToChainName",{ - enumerable:!0,get:Qt(function(){ - return u.replaceChainIdToChainName} - ,"get")} - ),Object.defineProperty(t,"chainName2IdMap",{ - enumerable:!0,get:Qt(function(){ - return u.chainName2IdMap} - ,"get")} - ),Object.defineProperty(t,"getNamespaceKeyByChain",{ - enumerable:!0,get:Qt(function(){ - return u.getNamespaceKeyByChain} - ,"get")} - ),Object.defineProperty(t,"chainIdToStandardChainIdMap",{ - enumerable:!0,get:Qt(function(){ - return u.chainIdToStandardChainIdMap} - ,"get")} - )} - (qMt)),qMt} - function obt(){ - return hbt||(hbt=1,function(t){ - var i=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ,s=pi&&pi.__importDefault||function(t){ - return t&&t.__esModule?t:{ - default:t} - } - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.OKXReporter=t.OKXReportSide=t.OKXReportType=t.versionStr=void 0; - const e=s(I4),n=ubt(),h=YMt(),r=rbt(),o=s(_S); - t.versionStr="1.9.1"; - const a=["https://www.okx.com/dappstat/wallet-connect","https://www.okx.ac/dappstat/wallet-connect"],c="OKX_RP_UUID_CK",l={ - headers:{ - Accept:"*/*","Content-Type":"text/plain"} - ,method:"POST"} - ; - t.OKXReportType={ - PAGE_IN:"page_in",PAGE_OUT:"page_out",CLICK:"click",LOG:"log"} - ,t.OKXReportSide={ - DAPP:"dapp",WALLET:"wallet"} - ; - const u=Qt((t,...s)=>i(void 0,[t,...s],void 0,function*(t,i={ - } - ,s=5e3){ - for(const h of t)try{ - const t=new AbortController,n=t.signal,r=(0,e.default)(h,Object.assign(Object.assign({ - } - ,i),{ - signal:n} - )),o=new Promise((i,e)=>setTimeout(()=>{ - t.abort(),e(new Error("Request timed out"))} - ,s)),a=yield Promise.race([r,o]); - if(a.ok)return a; - if(502==a.status)return a} - catch(n){ - } - throw new Error("All fetch attempts failed.")} - ),"fetchListWithTimeout"),d=class{ - constructor(){ - this.currentSide=t.OKXReportSide.DAPP,this.currentVersion=t.versionStr,this.storage=o.default.createInstance({ - name:"OKXReporter"} - ),this.recordList=new Array,this.currentUUID="fjdkakfjsadkfklasdkfsdjkljfklsdjklfioruer3239084dkskfsa"} - configVersionAndSide(t,i,s){ - this.currentVersion=t+n.logVersion,this.currentSide=i,this.appName=s} - get recordCacheKey(){ - return"OKX_RP_CK@"+this.appName} - get reportPlatform(){ - return(0,r.isMobileUserAgent)()?(0,r.isIos)()?"iOS":"android":"pc"} - beginReport(){ - return i(this,void 0,void 0,function*(){ - this.startErrorCatching(); - let t=yield this.storage.getItem(this.recordCacheKey),i=yield this.storage.getItem(c); - i?this.currentUUID=i:this.storage.setItem(c,this.currentUUID),t&&(this.recordList=t,(0,n.logDebug)("resume records from cache length: ",this.recordList.length),yield this.sendCachedRecords())} - )} - startErrorCatching(){ - (0,h.getWindow)()&&(0,n.logDebug)("begin capture console error")} - cachedErrors(){ - return this.recordList} - sendRecord(t){ - return i(this,void 0,void 0,function*(){ - return new Promise((s,e)=>i(this,void 0,void 0,function*(){ - try{ - const i=JSON.stringify(t); - (0,n.logDebug)("[REPORT] record: ",i); - const h=yield u(a,Object.assign(Object.assign({ - } - ,l),{ - body:i} - )); - (0,n.logDebug)("[REPORT] get rsp:",h),h&&h.status&&200==h.status?(this.recordList=this.recordList.filter(i=>i.timestamp!=t.timestamp||i.content!=t.content),yield this.storage.setItem(this.recordCacheKey,this.recordList),s(!0)):e(!1)} - catch(frt){ - (0,n.logDebug)("send record error:",frt),s(!0)} - } - ))} - )} - sendRecordContent(t,s,e){ - return i(this,arguments,void 0,function*(t,i,s,e=void 0,n=void 0,r=void 0,o=void 0,a=void 0,c=void 0){ - var l,u,d,f; - let p=null===(l=(0,h.getWindow)())||void 0===l?void 0:l.location.pathname,w=null===(u=(0,h.getWindow)())||void 0===u?void 0:u.location.origin; - p&&w&&(w+=p); - let g=null===(d=(0,h.getWindow)())||void 0===d?void 0:d.navigator.language,m=null===(f=(0,h.getWindow)())||void 0===f?void 0:f.navigator.userAgent,v=this.reportPlatform,_={ - uuid:this.currentUUID,version:this.currentVersion,content:t,action:s,side:this.currentSide,timestamp:(new Date).getTime(),url:w,lang:g,type:i,platform:v,"user-agent":m,reverved1:e,reverved2:n,reverved3:r,reverved4:o,reverved5:a,reverved6:c} - ; - yield this.markRecordItem(_),yield this.sendRecord(_)} - )} - sendCachedRecords(){ - return i(this,void 0,void 0,function*(){ - return new Promise((t,s)=>i(this,void 0,void 0,function*(){ - let i=this.recordList.map(t=>this.sendRecord(t)); - (0,n.logDebug)("[REPORT] submit & clean recorded caches begin @",(new Date).toUTCString()),Promise.allSettled(i).then(i=>{ - (0,n.logDebug)("[REPORT] submit & clean recorded caches ends @",(new Date).toUTCString()); - let e=[]; - i.forEach((t,i)=>{ - "rejected"==t.status&&e.push(i)} - ),this.recordList=this.recordList.filter((t,i)=>!e.includes(i)),this.storage.setItem(this.recordCacheKey,this.recordList).then(function(i){ - t()} - ).catch(function(t){ - s(t)} - )} - )} - ))} - )} - markRecordItem(t){ - return i(this,void 0,void 0,function*(){ - if(this.recordList.push(t),this.recordList.length>100){ - let t=this.recordList.length-100; - this.recordList.splice(0,t)} - return new Promise((i,s)=>{ - this.storage.setItem(this.recordCacheKey,this.recordList).then(function(s){ - i(t)} - ).catch(function(t){ - s(t)} - )} - )} - )} - } - ; - Qt(d,"OKXReporter"); - let f=d; - t.OKXReporter=f} - (G_t)),G_t} - Qt(ebt,"checkMetaData"),Qt(rbt,"requireUtils$1"),Qt(obt,"requireReport"); - const abt={ - version:"1.9.1"} - ; - var cbt,lbt; - function ubt(){ - if(cbt)return D_t; - cbt=1; - var t=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(D_t,"__esModule",{ - value:!0} - ),D_t.logVersion=void 0,D_t.getDefaultReporter=h,D_t.logDebug=o,D_t.logError=a,D_t.logWarning=c,D_t.reportEvent=l,D_t.reportLog=u; - const i=!1,s=!1,e=obt(),n=new e.OKXReporter; - function h(){ - return n} - Qt(h,"getDefaultReporter"); - const r=abt.version; - function o(...t){ - if("undefined"!=typeof console)try{ - i||null===window||void 0===window||window.okxLogDebug} - catch(s){ - } - } - function a(...t){ - if("undefined"!=typeof console)try{ - if(i||null===window||void 0===window||window.okxLogDebug,s||!i){ - let i=""; - i+=[...t].reduce((t,i)=>{ - "string"==typeof i||"object"==typeof i&&JSON.stringify(i)} - ),n.sendRecordContent(i,e.OKXReportType.LOG,"")} - } - catch(h){ - } - } - function c(...t){ - if("undefined"!=typeof console)try{ - i||null===window||void 0===window||window.okxLogDebug} - catch(s){ - } - } - function l(i,s,e){ - return t(this,arguments,void 0,function*(t,i,s,e=void 0,h=void 0,r=void 0,o=void 0,a=void 0,c=void 0){ - try{ - yield n.sendRecordContent(s,t,i,e,h,r,o,a,c)} - catch(frt){ - } - } - )} - function u(i){ - return t(this,arguments,void 0,function*(t,i="default"){ - } - )} - return Qt(o,"logDebug"),Qt(a,"logError"),Qt(c,"logWarning"),Qt(l,"reportEvent"),Qt(u,"reportLog"),D_t.logVersion=r,D_t} - function dbt(){ - if(lbt)return L_t; - lbt=1,Object.defineProperty(L_t,"__esModule",{ - value:!0} - ),L_t.safeJsonParse=e,L_t.safeJsonStringify=n; - const t=ubt(),i=Qt(t=>JSON.stringify(t,(t,i)=>"bigint"==typeof i?i.toString()+"n":i),"JSONStringify"),s=Qt(t=>{ - const i=t.replace(/:(\b\d{ - 17,} - |\b(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))(?=[,\} - \]]|$)/g,(t,i)=>`:"${ - i} - n"`); - try{ - return JSON.parse(i,(t,i)=>"string"==typeof i&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)} - catch(frt){ - return JSON.parse(t)} - } - ,"JSONParse"); - function e(i){ - if("string"!=typeof i)throw(0,t.logDebug)(i),new Error("Cannot safe json parse value of type "+typeof i); - try{ - return s(i)} - catch(frt){ - return i} - } - function n(t){ - return"string"==typeof t?t:i(t)||""} - return Qt(e,"safeJsonParse"),Qt(n,"safeJsonStringify"),L_t} - Qt(ubt,"requireLog"),Qt(dbt,"requireSafejson"); - var fbt={ - } - ; - const pbt=gi(jvt); - var wbt,gbt; - function mbt(){ - if(wbt)return fbt; - wbt=1,Object.defineProperty(fbt,"__esModule",{ - value:!0} - ),fbt.okxfromString=s,fbt.okxtoString=e,fbt.alloc=n,fbt.allocUnsafe=h; - const t=pbt,i=ubt(); - function s(t,s="utf8"){ - const e=c[s]; - if((0,i.logDebug)("okxfromstring ====> "),!e)throw new Error(`Unsupported encoding "${ - s} - "`); - return e.decoder.decode(`${ - e.prefix} - ${ - t} - `)} - function e(t,s="utf8"){ - const e=c[s]; - if((0,i.logDebug)("okxtoString ====> "),!e)throw new Error(`Unsupported encoding "${ - s} - "`); - return e.encoder.encode(t).substring(1)} - function n(t=0){ - return new Uint8Array(t)} - function h(t=0){ - return new Uint8Array(t)} - function r(t,i,s,e){ - return{ - name:t,prefix:i,encoder:{ - name:t,prefix:i,encode:s} - ,decoder:{ - decode:e} - } - } - Qt(s,"okxfromString"),Qt(e,"okxtoString"),Qt(n,"alloc"),Qt(h,"allocUnsafe"),Qt(r,"createCodec"); - const o=r("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>(new TextEncoder).encode(t.substring(1))),a=r("ascii","a",t=>{ - let i="a"; - for(let s=0; - s<t.length; - s++){ - let e=t[s]; - e&&String.fromCharCode(e)&&(i+=String.fromCharCode(e))} - return i} - ,t=>{ - const i=h((t=t.substring(1)).length); - for(let s=0; - s<t.length; - s++)i[s]=t.charCodeAt(s); - return i} - ),c=Object.assign({ - utf8:o,"utf-8":o,hex:t.bases.base16,latin1:a,ascii:a,binary:a} - ,t.bases); - return fbt} - function vbt(){ - return gbt||(gbt=1,function(t){ - var i=pi&&pi.__importDefault||function(t){ - return t&&t.__esModule?t:{ - default:t} - } - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.chainIdToStandardChainIdMap=t.chainName2IdMap=t.isValidObject=t.RANDOM_LENGTH=t.isBrowser=t.resolveLocalStorage=t.hasLocalStorage=t.hasBuiltInWebSocket=t.resolveWebSocketImplementation=void 0,t.hexToByteArray=d,t.getChainId=f,t.toHexString=p,t.concatUint8Arrays=w,t.splitToUint8Arrays=g,t.base64encode=_,t.base64decode=M,t.checkWSUrl=b,t.hashKey=C,t.generateRandomBytes32=O,t.generateTopic=I,t.generateGroupId=k,t.isInIOSLine=R,t.isInIOSLark=P,t.isInIOSChrome=N,t.isInIOSWeChat=L,t.isIos=D,t.getLastSixMd5Hash=G,t.toSafeBase64FromBase64=B,t.useShortLink=U,t.replaceChainNameToChainId=F,t.replaceChainIdToChainName=$,t.getNamespaceKeyByChain=H,t.scopePollingDetectionStrategy=W; - const s=i(Cgt),e=i(kgt),n=Qvt,h=Zvt,r=dbt(),o=ubt(),a=mbt(),c=i(gS),l=U_t,u="base16"; - function d(t){ - if(t.length%2!=0)throw new Error(`Cannot convert ${ - t} - to bytesArray`); - const i=new Uint8Array(t.length/2); - for(let s=0; - s<t.length; - s+=2)i[s/2]=parseInt(t.slice(s,s+2),16); - return i} - function f(t){ - return t.includes(":")?t.split(":")[1]:t} - function p(t){ - let i=""; - return t.forEach(t=>{ - i+=("0"+(255&t).toString(16)).slice(-2)} - ),i} - function w(t,i){ - const s=new Uint8Array(t.length+i.length); - return s.set(t),s.set(i,t.length),s} - function g(t,i){ - if(i>=t.length)throw new Error("Index is out of buffer"); - return[t.slice(0,i),t.slice(i)]} - function m(t,i){ - const s=e.default.encodeBase64(t); - return i?encodeURIComponent(s):s} - function v(t,i){ - return i&&(t=decodeURIComponent(t)),e.default.decodeBase64(t)} - function _(t,i){ - let s; - return t instanceof Uint8Array?s=t:("string"!=typeof t&&(t=(0,r.safeJsonStringify)(t)),s=e.default.decodeUTF8(t)),m(s,i)} - function M(t,i){ - const s=v(t,i); - return{ - toString:()=>e.default.encodeUTF8(s),toObject(){ - try{ - return(0,r.safeJsonParse)(e.default.encodeUTF8(s))} - catch(frt){ - return null} - } - ,toUint8Array:()=>s} - } - function b(t){ - const i=t.match(new RegExp(/^\w+:/,"gi")); - if(!i||!i.length)return!1; - let s=i[0]; - return void 0!==s&&new RegExp("^wss?:").test(s)} - Qt(d,"hexToByteArray"),Qt(f,"getChainId"),Qt(p,"toHexString"),Qt(w,"concatUint8Arrays"),Qt(g,"splitToUint8Arrays"),Qt(m,"encodeUint8Array"),Qt(v,"decodeToUint8Array"),Qt(_,"base64encode"),Qt(M,"base64decode"),Qt(b,"checkWSUrl"); - const y=Qt(()=>"undefined"!=typeof WebSocket?WebSocket:void 0!==pi&&void 0!==pi.WebSocket?pi.WebSocket:"undefined"!=typeof window&&void 0!==window.WebSocket?window.WebSocket:"undefined"!=typeof self&&void 0!==self.WebSocket?self.WebSocket:WebSocket,"resolveWebSocketImplementation"); - t.resolveWebSocketImplementation=y; - const E=Qt(()=>"undefined"!=typeof WebSocket||void 0!==pi&&void 0!==pi.WebSocket||"undefined"!=typeof window&&void 0!==window.WebSocket||"undefined"!=typeof self&&void 0!==self.WebSocket,"hasBuiltInWebSocket"); - t.hasBuiltInWebSocket=E; - const A=Qt(()=>void 0!==pi&&void 0!==pi.localStorage||"undefined"!=typeof window&&void 0!==window.localStorage,"hasLocalStorage"); - t.hasLocalStorage=A; - const S=Qt(()=>void 0!==pi&&void 0!==pi.localStorage?pi.localStorage:"undefined"!=typeof window&&void 0!==window.localStorage?window.localStorage:localStorage,"resolveLocalStorage"); - t.resolveLocalStorage=S; - const T=Qt(()=>"undefined"!=typeof window,"isBrowser"); - function C(t,i=u){ - (0,o.logDebug)(`hash key called ${ - t} - `); - const s=(0,h.hash)((0,a.okxfromString)(t,i)); - return(0,n.toString)(s,i)} - function O(){ - return s.default.randomBytes(t.RANDOM_LENGTH)} - function I(){ - let t=O(); - return(0,o.logDebug)(`generate topic called ${ - t} - `),C((0,n.toString)(t,u))} - function k(){ - let t=s.default.randomBytes(16); - return(0,o.logDebug)(`generate groupid called ${ - t} - `),C((0,n.toString)(t,u))} - t.isBrowser=T,t.RANDOM_LENGTH=32,Qt(C,"hashKey"),Qt(O,"generateRandomBytes32"),Qt(I,"generateTopic"),Qt(k,"generateGroupId"); - const x=Qt(t=>Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length,"isValidObject"); - function R(){ - return navigator.userAgent.includes("Safari Line/")&&D()} - function P(){ - return navigator.userAgent.includes("Lark/")&&D()} - function N(){ - return navigator.userAgent.includes("CriOS/")&&D()} - function L(){ - return navigator.userAgent.includes("MicroMessenger/")&&D()} - function D(){ - const t=navigator.userAgent,i=navigator.maxTouchPoints||0,s=/iPad|iPhone|iPod/.test(t)&&!window.MSStream,e=t.includes("Mac")&&i>1; - return(0,o.logDebug)(`utils isIos >>>isIOSDevice: ${ - s} - >> isIPadOS: ${ - e} - `),s||e} - function G(t){ - return c.default.MD5(t).toString().slice(-6)} - function B(t){ - return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")} - function U(){ - return!0} - function F(i){ - return t.chainName2IdMap.forEach((t,s)=>{ - i.includes(s)&&(i=i.replace(s,t))} - ),i} - function $(i){ - return t.chainName2IdMap.forEach((t,s)=>{ - i.includes(t)&&(i=i.replace(t,s))} - ),i} - function H(t){ - for(const[i,s]of Object.entries(l.NAMES_CHAINS))if(Object.values(s).includes(t))return i; - return t} - function W(t){ - if("undefined"==typeof window||"undefined"==typeof document)return; - const i=[]; - function s(){ - if(t())for(const t of i)t()} - Qt(s,"detectAndDispose"); - const e=setInterval(s,1e3); - i.push(()=>clearInterval(e)),"loading"===document.readyState&&(document.addEventListener("DOMContentLoaded",s,{ - once:!0} - ),i.push(()=>document.removeEventListener("DOMContentLoaded",s))),"complete"!==document.readyState&&(window.addEventListener("load",s,{ - once:!0} - ),i.push(()=>window.removeEventListener("load",s))),s()} - t.isValidObject=x,Qt(R,"isInIOSLine"),Qt(P,"isInIOSLark"),Qt(N,"isInIOSChrome"),Qt(L,"isInIOSWeChat"),Qt(D,"isIos"),Qt(G,"getLastSixMd5Hash"),Qt(B,"toSafeBase64FromBase64"),Qt(U,"useShortLink"),t.chainName2IdMap=new Map,t.chainName2IdMap.set("aptos:mainnet","aptos:637"),t.chainName2IdMap.set("movement:testnet","aptos:70000060"),t.chainName2IdMap.set("movement:mainnet","aptos:70000066"),t.chainName2IdMap.set("soon:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","svm:70000069"),t.chainName2IdMap.set("soon:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z","svm:70000067"),t.chainName2IdMap.set("eclipse:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","svm:70000068"),t.chainName2IdMap.set("sonic:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","svm:70000073"),t.chainIdToStandardChainIdMap=new Map,t.chainIdToStandardChainIdMap.set(l.SOLANA_CHAINS.MAINNET,l.SOLANA_CHAINS_STANDARD.MAINNET),t.chainIdToStandardChainIdMap.set(l.SOLANA_CHAINS.TESTNET,l.SOLANA_CHAINS_STANDARD.TESTNET),Qt(F,"replaceChainNameToChainId"),Qt($,"replaceChainIdToChainName"),Qt(H,"getNamespaceKeyByChain"),Qt(W,"scopePollingDetectionStrategy")} - (Ogt)),Ogt} - Qt(mbt,"requireStringUtils"),Qt(vbt,"requireUtils"); - var _bt=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),Mbt=pi&&pi.__setModuleDefault||(Object.create?function(t,i){ - Object.defineProperty(t,"default",{ - enumerable:!0,value:i} - )} - :function(t,i){ - t.default=i} - ),bbt=pi&&pi.__importStar||function(){ - var t=Qt(function(i){ - return(t=Object.getOwnPropertyNames||function(t){ - var i=[]; - for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[i.length]=s); - return i} - )(i)} - ,"ownKeys"); - return function(i){ - if(i&&i.__esModule)return i; - var s={ - } - ; - if(null!=i)for(var e=t(i),n=0; - n<e.length; - n++)"default"!==e[n]&&_bt(s,i,e[n]); - return Mbt(s,i),s} - } - (),ybt=pi&&pi.__importDefault||function(t){ - return t&&t.__esModule?t:{ - default:t} - } - ; - Object.defineProperty(Sgt,"__esModule",{ - value:!0} - ),Sgt.Storage=void 0; - const Ebt=Agt,Abt=ybt(Cgt),Sbt=vbt(),Tbt=rbt(),Cbt=bbt(ubt()),Obt=rbt(),Ibt=gS; - let kbt=(Qt(Tt=class{ - constructor(t,i=void 0){ - const s=(0,Sbt.resolveLocalStorage)(); - this.storeKey="",this.cipherIV="",this.subKey=t,Cbt.logDebug("--------get current local storage --------"),Cbt.logDebug(s),this.synchronizedCache()} - checkAndUpgradeCache(t,i){ - if(t&&t.length>0&&i&&i.length>0){ - Cbt.logDebug("--------get current local storage --------"),Cbt.logDebug(localStorage); - const s=localStorage.getItem(Tt.cacheKey+t); - if(null==s)return void Cbt.logDebug("no pre cache content"); - Cbt.logDebug(s),(null==s?void 0:s.length)>0&&(Cbt.logDebug("write in cache content: ",t,"->",i),localStorage.setItem(Tt.cacheKey+i,s),Cbt.logDebug("clean in cache content: ",t),localStorage.removeItem(Tt.cacheKey+t))} - else Cbt.logDebug("no pre cache key:",t)} - saveContent(t,i,s="-"){ - let e={ - id:s,timestamp:Date.now().toString(),content:t} - ; - this.saveItem(e,i)} - saveItem(t,i){ - let s=Tt.cacheKey+this.subKey; - const e=(0,Sbt.resolveLocalStorage)(); - Cbt.logDebug(this.cache),Cbt.logDebug(`get cache obj: ${ - this.cache} - , ${ - i} - , ${ - t} - `),this.cache[i]=t; - let n=(0,Tbt.safeJsonStringify)(this.cache); - Cbt.logDebug(`STORAGE: ${ - i} - @ ${ - this.cache} - `),e.setItem(s,n)} - getItem(t){ - return Cbt.logDebug(`STORAGE >> getItem: ${ - t} - @ ${ - this.cache} - `),this.cache[t]} - synchronizedCache(){ - const t=localStorage.getItem(Tt.cacheKey+this.subKey); - if(null==t)return Cbt.logDebug("with no cache"),void(this.cache={ - } - ); - if(Cbt.logDebug(t),(null==t?void 0:t.length)>0){ - var i=(0,Tbt.safeJsonParse)(t); - this.cache=i} - Cbt.logDebug(`get cache obj: ${ - this.cache} - `),void 0!==this.cache&&null!=this.cache||(this.cache={ - } - )} - getCachedPBKDF2InfoKey(){ - var t,i,s,e; - if(this.storeKey.length>0&&(null===(t=this.cipherIV)||void 0===t?void 0:t.length)>0)return{ - pw:this.storeKey,iv:this.cipherIV} - ; - let n=null===(i=this.getItem(Ebt.OKXCONNECTOR_STORAGER_CRYPTO_SALT))||void 0===i?void 0:i.content; - n||(n=(0,Sbt.toHexString)(Abt.default.randomBytes(24)),this.saveContent(n,Ebt.OKXCONNECTOR_STORAGER_CRYPTO_SALT)); - let h=null===(s=this.getItem(Ebt.OKXCONNECTOR_STORAGE_CRYPTO_PASSWORD))||void 0===s?void 0:s.content; - h||(h=(0,Sbt.toHexString)(Abt.default.randomBytes(32)),this.saveContent(h,Ebt.OKXCONNECTOR_STORAGE_CRYPTO_PASSWORD)); - let r=null===(e=this.getItem(Ebt.OKXCONNECTOR_STORAGE_CRYPTO_CIPHERIV))||void 0===e?void 0:e.content; - if(!r){ - let t=Abt.default.randomBytes(16); - r=(0,Sbt.toHexString)(t),this.saveContent(r,Ebt.OKXCONNECTOR_STORAGE_CRYPTO_CIPHERIV)} - return this.cipherIV=r,this.storeKey=(0,Ibt.PBKDF2)(h,n,{ - iterations:10} - ).toString(),{ - pw:this.storeKey,iv:this.cipherIV} - } - encryptStoreMsg(t,i){ - (0,Obt.logDebug)(`encryptStoreMsg encryptStoreMsg start ${ - Date.now()} - `); - let s=this.getCachedPBKDF2InfoKey(); - (0,Obt.logDebug)(`encryptStoreMsg encryptStoreMsg mid ${ - Date.now()} - `); - var e=Ibt.AES.encrypt(t,s.pw).toString(); - this.saveContent(e,i),(0,Obt.logDebug)(`encryptStoreMsg encryptStoreMsg end ${ - Date.now()} - `)} - getAndDecrypt(t){ - (0,Obt.logDebug)(`encryptStoreMsg getAndDecrypt start ${ - Date.now()} - `); - let i=this.getItem(t); - if(i&&i.content){ - let t=this.getCachedPBKDF2InfoKey(); - (0,Obt.logDebug)(`encryptStoreMsg getAndDecrypt mid ${ - Date.now()} - `); - let s=Ibt.AES.decrypt(i.content,t.pw).toString(Ibt.enc.Utf8); - return(0,Obt.logDebug)(`encryptStoreMsg getAndDecrypt end ${ - Date.now()} - `),s} - return null} - clearCache(t=void 0){ - if(void 0===t){ - const t=(0,Sbt.resolveLocalStorage)(); - this.cache={ - } - ; - let i=Tt.cacheKey+this.subKey; - t.setItem(i,"")} - else{ - let i=Tt.cacheKey+this.subKey; - const s=(0,Sbt.resolveLocalStorage)(); - Cbt.logDebug(this.cache),this.cache[t]=null; - let e=(0,Tbt.safeJsonStringify)(this.cache); - Cbt.logDebug(`STORAGE: clean key ${ - t} - @ ${ - this.cache} - `),s.setItem(i,e)} - } - } - ,"Storage"),Tt); - Sgt.Storage=kbt,kbt.cacheKey="OKXStorageKey"; - var xbt=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),Rbt=pi&&pi.__setModuleDefault||(Object.create?function(t,i){ - Object.defineProperty(t,"default",{ - enumerable:!0,value:i} - )} - :function(t,i){ - t.default=i} - ),Pbt=pi&&pi.__importStar||function(){ - var t=Qt(function(i){ - return(t=Object.getOwnPropertyNames||function(t){ - var i=[]; - for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[i.length]=s); - return i} - )(i)} - ,"ownKeys"); - return function(i){ - if(i&&i.__esModule)return i; - var s={ - } - ; - if(null!=i)for(var e=t(i),n=0; - n<e.length; - n++)"default"!==e[n]&&xbt(s,i,e[n]); - return Rbt(s,i),s} - } - (),Nbt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(ygt,"__esModule",{ - value:!0} - ),ygt.OKXWalletConnector=void 0; - const Lbt=Egt,Dbt=Agt,Gbt=Sgt,Bbt=rbt(),Ubt=vbt(),Fbt=MMt,$bt=Pbt(ubt()),Hbt=U_t,Wbt=obt(),Vbt=(0,Ubt.resolveWebSocketImplementation)(),jbt=class{ - constructor(t){ - if(this.events=new Fbt.EventEmitter,this.state=Lbt.ConnectorState.InitState,this.selectedUrlIndex=0,this.retryCount=0,this.timeOutLimit=8e3,!(0,Ubt.checkWSUrl)(t))throw new Error(`CONNECTOR: invalid url ${ - t} - `); - this.url=t,this.heartbeatTimer=null,this.connectionTimeoutTimer=null,this.connectURLStorage=new Gbt.Storage(Dbt.OKXCONNECTOR_CACHE_KEY+Dbt.OKXCONNECTOR_CACHE_KEY)} - get connecting(){ - return this.state==Lbt.ConnectorState.Connecting} - onPayload(t){ - if(void 0!==t.data){ - if($bt.logDebug("get received data"),$bt.logDebug(t),"string"==typeof t.data&&"pong"===t.data)return void $bt.logDebug(`CONNECT: receive pong ${ - Date.now().toString()} - `); - this.events.emit("payload",t.data)} - } - onClose(t){ - var i; - $bt.logDebug("socket get closed: ",null===(i=this.socket)||void 0===i?void 0:i.url,t.code),this.socket=void 0,this.events.emit("close",t)} - onError(t,i){ - const s={ - id:t,msg:i.toString()} - ; - this.events.emit("payload",s)} - onopen(t){ - t.onmessage=t=>this.onPayload(t),t.onclose=t=>this.onClose(t),this.socket=t,this.state=Lbt.ConnectorState.Connected,this.events.emit("open")} - emitError(t){ - this.events.emit("fail",t)} - heartbeat(){ - return Nbt(this,void 0,void 0,function*(){ - if(this.heartbeatTimer&&clearTimeout(this.heartbeatTimer),this.state==Lbt.ConnectorState.Connected||this.state==Lbt.ConnectorState.OnError){ - if(this.socket){ - if(this.socket.readyState===WebSocket.OPEN)$bt.logDebug(`send ping heart beat: ${ - Date.now().toString()} - , ${ - this.socket} - `),this.socket.send("ping"),this.heartbeatTimer=setTimeout(this.heartbeat.bind(this),5e3); - else if($bt.logDebug("socket not ready"),this.state==Lbt.ConnectorState.Connected||this.state==Lbt.ConnectorState.OnError){ - $bt.logDebug("socket reconnect by heartbeat with state",this.state,this.socket.readyState); - try{ - yield this.tryRegistOpen()} - catch(frt){ - $bt.logError("regist open failed"),this.heartbeatTimer=setTimeout(this.heartbeat.bind(this),5e3)} - } - } - else if($bt.logDebug("socket not exist"),this.state==Lbt.ConnectorState.Connected||this.state==Lbt.ConnectorState.OnError){ - $bt.logDebug("socket reconnect by heartbeat"); - try{ - yield this.tryRegistOpen()} - catch(frt){ - $bt.logError("regist open failed"),this.heartbeatTimer=setTimeout(this.heartbeat.bind(this),5e3)} - } - } - else $bt.logDebug("heart beat close")} - )} - registOpen(t=this.url,i=!1){ - if(!(0,Ubt.checkWSUrl)(t))throw new Error(`CONNECTOR: invalid url ${ - t} - `); - return this.url=t,i||$bt.logDebug("Connection connect:",this.url,(new Date).toUTCString()),this.state=Lbt.ConnectorState.Connecting,new URLSearchParams(t).get("origin"),new Promise((i,s)=>{ - const e=new Vbt(t,[]); - $bt.logDebug("Connection connect Begin:",this.url,(new Date).toUTCString()),this.startTimeOutTimer(e),(0,Ubt.hasBuiltInWebSocket)()?($bt.logDebug("Add socket error handler"),e.onerror=()=>{ - s(new Error("socket error")),e.close()} - ):($bt.logDebug("Add socket error handler"),e.on("error",()=>{ - s(new Error("socket error")),e.close()} - )),e.onopen=()=>{ - $bt.logDebug("socket opened"),this.resetTimeOutTimer(Lbt.OKXCONNECTOR_WS_URL_PENDING_CLOSE_CODE.FINISHED),this.onopen(e),this.heartbeat(),i(e)} - } - )} - checkMaxRetry(){ - return $bt.logDebug("current retry count:",this.retryCount,"of",Lbt.OKXCONNECTOR_WS_URL_LIST.length),this.retryCount>3*Lbt.OKXCONNECTOR_WS_URL_LIST.length} - connectionTryNext(){ - return Nbt(this,void 0,void 0,function*(){ - if(!this.checkMaxRetry()){ - this.retryCount+=1; - let t=this.getNextSelectUrl(); - return $bt.logDebug("Connection retry:",t,(new Date).toUTCString()),this.registOpen(t,!0)} - $bt.logDebug("Max Connection retry ",this.retryCount,(new Date).toUTCString())} - )} - startTimeOutTimer(t){ - this.connectionTimeoutTimer&&this.resetTimeOutTimer(Lbt.OKXCONNECTOR_WS_URL_PENDING_CLOSE_CODE.CANCELED),this.pendingSocket=t,this.connectionTimeoutTimer=setTimeout(()=>{ - this.pendingSocket&&this.resetTimeOutTimer(Lbt.OKXCONNECTOR_WS_URL_PENDING_CLOSE_CODE.TIME_OUT)} - ,this.timeOutLimit)} - resetTimeOutTimer(t){ - var i; - if(t==Lbt.OKXCONNECTOR_WS_URL_PENDING_CLOSE_CODE.TIME_OUT)throw clearTimeout(this.connectionTimeoutTimer),null===(i=this.pendingSocket)||void 0===i||i.close(),this.pendingSocket=void 0,$bt.reportEvent(Wbt.OKXReportType.LOG,"timeout",this.retryCount.toString()),new Error("socket timeout"); - this.pendingSocket=void 0,clearTimeout(this.connectionTimeoutTimer)} - cacheSuccessUrlSelect(){ - this.connectURLStorage.saveContent(this.selectedUrlIndex.toString(),Dbt.OKXCONNECTOR_CACHE_KEY)} - getNextSelectUrl(){ - return this.selectedUrlIndex+=1,this.selectedUrlIndex=this.selectedUrlIndex%Lbt.OKXCONNECTOR_WS_URL_LIST.length,Lbt.OKXCONNECTOR_WS_URL_LIST[this.selectedUrlIndex]} - onVisibleChanged(){ - return Nbt(this,void 0,void 0,function*(){ - if("visible"!==document.visibilityState||($bt.logDebug(`get changed ${ - this.state} - , ${ - this.socket} - `),this.state!=Lbt.ConnectorState.Connected||void 0!==this.socket)); - else{ - $bt.logDebug("CONNECTION need reopen"); - try{ - yield this.tryRegistOpen()} - catch(frt){ - $bt.logError("regist open failed")} - } - } - )} - tryRegistOpen(){ - return Nbt(this,arguments,void 0,function*(t=this.url){ - if(this.connecting)return $bt.logDebug("tryRegistOpen => connecting state"),new Promise((t,i)=>{ - this.events.once("fail",t=>($bt.logDebug("tryRegistOpen => connecting fail listener",t),i(t))),this.events.once("open",()=>void 0===this.socket?i(new Error("Connect lost")):t(this.socket))} - ); - $bt.logDebug("tryRegistOpen => try registOpen until retry limit is hit"); - let i=!1; - for(; - !this.checkMaxRetry()&&!this.socket; - )try{ - $bt.logDebug("tryRegistOpen => call registOpen, try count:",this.retryCount,i),yield this.registOpen(t,i)} - catch(h6i){ - $bt.logDebug("tryRegistOpen => registOpen failed",h6i),this.retryCount+=1,t=this.getNextSelectUrl(),i=!0} - if($bt.logDebug("tryRegistOpen => exit while loop",this.retryCount,this.socket),!this.socket&&this.checkMaxRetry())throw $bt.logDebug("tryRegistOpen => failed to open a socket",this.retryCount,this.socket),this.retryCount=0,this.state=Lbt.ConnectorState.OnError,this.emitError(new Error("tryRegistOpen failed")),new Hbt.OKXConnectError(Hbt.OKX_CONNECT_ERROR_CODES.CONNECTION_ERROR,"Failed to connect")} - )} - connect(){ - return Nbt(this,void 0,void 0,function*(){ - try{ - yield this.tryRegistOpen(),document.removeEventListener("visibilitychange",this.onVisibleChanged.bind(this)),document.addEventListener("visibilitychange",this.onVisibleChanged.bind(this))} - catch(frt){ - throw $bt.logDebug("connect => failed to connect",frt),frt} - } - )} - disconnect(){ - return Nbt(this,void 0,void 0,function*(){ - return this.state=Lbt.ConnectorState.Disconnected,new Promise((t,i)=>{ - void 0!==this.socket?(this.socket.onclose=i=>{ - this.onClose(i),t()} - ,this.socket.close(),this.heartbeatTimer&&clearTimeout(this.heartbeatTimer)):t()} - )} - )} - currentStatus(){ - return{ - state:this.state,url:this.url} - } - addListener(t,i,s,e,n){ - this.listenPayloadHandler&&this.events.removeListener("payload",this.listenPayloadHandler),this.listenPayloadHandler=h=>Nbt(this,void 0,void 0,function*(){ - var r; - $bt.logDebug(`<<< get payload ${ - h} - `); - let o=(0,Bbt.safeJsonParse)(h); - if(o.params&&o.params.data){ - let h=null===(r=o.params.data)||void 0===r?void 0:r.message,c=!1; - if(h&&n){ - let t=yield n(o.params.data); - c=t.isSplitPackage&&!t.finalMessage,t.isSplitPackage&&(t.finalMessage&&t.finalMessage.length>0?($bt.logDebug("CONNECT: update raw msg content"),h=t.finalMessage):($bt.logDebug("CONNECT: skip raw msg content"),c=!0))} - if(!c)try{ - let n=i(h); - void 0===n?($bt.logDebug("CONNECT: decrypt undefined"),e(t,"Decrypt undefined")):s(t,n)} - catch(a){ - $bt.logDebug(`CONNECT: decrypt failed: ${ - a} - `),e(t,a.message)} - } - } - ),this.events.on("payload",this.listenPayloadHandler),this.failHandler&&this.events.removeListener("fail",this.failHandler),this.failHandler=i=>{ - i?($bt.logDebug(`CONNECT failed: ${ - i} - `),e(t,i.message)):e(t,"Unkonow error")} - ,this.events.on("fail",this.failHandler)} - addPackageParse(t){ - this.payloadHandler&&this.events.removeListener("payload",this.payloadHandler),this.payloadHandler=i=>Nbt(this,void 0,void 0,function*(){ - $bt.logDebug(`CONNECTION @[${ - (new Date).toUTCString()} - ] <<<< received e:${ - i} - `); - let s=(0,Bbt.safeJsonParse)(i); - yield t(s)} - ),this.events.on("payload",this.payloadHandler)} - once(t,i){ - this.events.once(t,i)} - off(t,i){ - this.events.off(t,i)} - removeListener(t,i){ - this.events.removeListener(t,i)} - send(t,i){ - return Nbt(this,void 0,void 0,function*(){ - try{ - void 0===this.socket&&($bt.logDebug(`>>> send payload undefined ${ - i} - `),yield t()),$bt.logDebug(`CONNECTION @[${ - (new Date).toUTCString()} - ]>>> send payload ${ - (0,Bbt.safeJsonStringify)(i)} - `),this.socket&&this.socket.send((0,Bbt.safeJsonStringify)(i))} - catch(frt){ - this.onError(i.id,frt)} - } - )} - getMsgPayloadFromHistory(t){ - return Nbt(this,void 0,void 0,function*(){ - if(void 0===t)return; - let i={ - params:{ - data:t} - } - ,s=(0,Bbt.safeJsonStringify)(t); - $bt.logDebug("get received data from history"),$bt.logDebug(s),s=(0,Bbt.safeJsonStringify)(i),this.events.emit("payload",s)} - )} - onOpen(t){ - this.openHandler&&this.events.removeListener("open",this.openHandler),this.openHandler=()=>Nbt(this,void 0,void 0,function*(){ - $bt.logDebug(`CONNECTION @[${ - (new Date).toUTCString()} - ] >>> ws opened: `),yield t()} - ),this.events.on("open",this.openHandler),this.cacheSuccessUrlSelect()} - } - ; - Qt(jbt,"OKXWalletConnector"); - let Kbt=jbt; - ygt.OKXWalletConnector=Kbt; - var zbt={ - } - ,Ybt={ - } - ; - Object.defineProperty(Ybt,"__esModule",{ - value:!0} - ),Ybt.CONNECT_METHOD_RECV_DISCONNECT=Ybt.CONNECT_METHOD_DISCONNECT=Ybt.CONNECT_METHOD_BATCH_FETCHMSG=Ybt.CONNECT_METHOD_FETCHMSG=Ybt.CONNECT_METHOD_RECEIVE=Ybt.CONNECT_METHOD_UNSUB=Ybt.CONNECT_METHOD_SUB=Ybt.CONNECT_METHOD_PUBLISH=Ybt.CONNECT_METHOD_LOGIN=Ybt.CONNECT_METHOD_PUSH=void 0,Ybt.CONNECT_METHOD_PUSH="push",Ybt.CONNECT_METHOD_LOGIN="login",Ybt.CONNECT_METHOD_PUBLISH="publish",Ybt.CONNECT_METHOD_SUB="subscribe",Ybt.CONNECT_METHOD_UNSUB="unsubscribe",Ybt.CONNECT_METHOD_RECEIVE="receive",Ybt.CONNECT_METHOD_FETCHMSG="fetchMessages",Ybt.CONNECT_METHOD_BATCH_FETCHMSG="batchFetchMessages",Ybt.CONNECT_METHOD_DISCONNECT="disconnect",Ybt.CONNECT_METHOD_RECV_DISCONNECT="receiveDisconnect"; - var qbt={ - } - ; - Object.defineProperty(qbt,"__esModule",{ - value:!0} - ),qbt.OKXCONNECTOR_JWT_TTL=qbt.OKXCONNECTOR_JWT_WALLET_SIDE=qbt.OKXCONNECTOR_JWT_SIDE=void 0,qbt.OKXCONNECTOR_JWT_SIDE="wallet",qbt.OKXCONNECTOR_JWT_WALLET_SIDE="dapp",qbt.OKXCONNECTOR_JWT_TTL=864e5; - var Xbt={ - } - ,Jbt=pi&&pi.__importDefault||function(t){ - return t&&t.__esModule?t:{ - default:t} - } - ; - Object.defineProperty(Xbt,"__esModule",{ - value:!0} - ),Xbt.SessionCrypto=void 0; - const Qbt=Jbt(Cgt),Zbt=vbt(),tyt=class{ - constructor(t=void 0){ - this.nonceLength=24,this.sessionKeyPair=t?this.createKeypairFromString(t):this.createKeypair()} - createKeypair(){ - return Qbt.default.box.keyPair()} - createKeypairFromString(t){ - return{ - publicKey:(0,Zbt.hexToByteArray)(t.publicKey),secretKey:(0,Zbt.hexToByteArray)(t.secretKey)} - } - createNonce(){ - return Qbt.default.randomBytes(this.nonceLength)} - get keyPair(){ - return this.sessionKeyPair} - encrypt(t,i){ - const s=(new TextEncoder).encode(t),e=this.createNonce(),n=Qbt.default.box(s,e,(0,Zbt.hexToByteArray)(i),this.keyPair.secretKey); - let h=(0,Zbt.concatUint8Arrays)(e,n); - var r=(0,Zbt.toHexString)(h),o=(new TextEncoder).encode(r); - return(0,Zbt.base64encode)(o,!1)} - encryptWallet(t,i){ - const s=(new TextEncoder).encode(t),e=this.createNonce(),n=Qbt.default.box(s,e,(0,Zbt.hexToByteArray)(i),this.keyPair.secretKey); - let h=(0,Zbt.concatUint8Arrays)(e,n); - return(0,Zbt.base64encode)(h,!1)} - decrypt(t,i){ - let s=(0,Zbt.base64decode)(t,!0).toUint8Array(); - const[e,n]=(0,Zbt.splitToUint8Arrays)(s,this.nonceLength),h=Qbt.default.box.open(n,e,(0,Zbt.hexToByteArray)(i),this.keyPair.secretKey); - if(!h)throw new Error(`Decryption error: \n message: ${ - t.toString()} - \n sender pubkey: ${ - i.toString()} - \n keypair pubkey: ${ - (0,Zbt.toHexString)(this.keyPair.publicKey)} - \n keypair secretkey: ${ - (0,Zbt.toHexString)(this.keyPair.secretKey)} - `); - return(new TextDecoder).decode(h)} - decryptWallet(t,i){ - let s=(0,Zbt.base64decode)(t,!0),e=(0,Zbt.hexToByteArray)(s.toString()); - const[n,h]=(0,Zbt.splitToUint8Arrays)(e,this.nonceLength),r=Qbt.default.box.open(h,n,(0,Zbt.hexToByteArray)(i),this.keyPair.secretKey); - if(!r)throw new Error(`Decryption error: \n message: ${ - t.toString()} - \n sender pubkey: ${ - i.toString()} - \n keypair pubkey: ${ - (0,Zbt.toHexString)(this.keyPair.publicKey)} - \n keypair secretkey: ${ - (0,Zbt.toHexString)(this.keyPair.secretKey)} - `); - return(new TextDecoder).decode(r)} - stringifyKeypair(){ - return{ - publicKey:(0,Zbt.toHexString)(this.keyPair.publicKey),secretKey:(0,Zbt.toHexString)(this.keyPair.secretKey)} - } - } - ; - Qt(tyt,"SessionCrypto"); - let iyt=tyt; - Xbt.SessionCrypto=iyt; - var syt={ - } - ,eyt={ - } - ,nyt={ - } - ,hyt={ - } - ,ryt={ - } - ; - Object.defineProperty(ryt,"__esModule",{ - value:!0} - ),ryt.BrowserRandomSource=void 0; - const oyt=class{ - constructor(){ - this.isAvailable=!1,this.isInstantiated=!1; - const t="undefined"!=typeof self?self.crypto||self.msCrypto:null; - t&&void 0!==t.getRandomValues&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)} - randomBytes(t){ - if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available."); - const i=new Uint8Array(t); - for(let s=0; - s<i.length; - s+=65536)this._crypto.getRandomValues(i.subarray(s,s+Math.min(i.length-s,65536))); - return i} - } - ; - Qt(oyt,"BrowserRandomSource"); - let ayt=oyt; - ryt.BrowserRandomSource=ayt; - var cyt={ - } - ; - Object.defineProperty(cyt,"__esModule",{ - value:!0} - ),cyt.NodeRandomSource=void 0; - const lyt=P_t,uyt=class{ - constructor(){ - if(this.isAvailable=!1,this.isInstantiated=!1,void 0!==gE){ - const t=vE; - t&&t.randomBytes&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)} - } - randomBytes(t){ - if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available."); - let i=this._crypto.randomBytes(t); - if(i.length!==t)throw new Error("NodeRandomSource: got fewer bytes than requested"); - const s=new Uint8Array(t); - for(let e=0; - e<s.length; - e++)s[e]=i[e]; - return(0,lyt.wipe)(i),s} - } - ; - Qt(uyt,"NodeRandomSource"); - let dyt=uyt; - cyt.NodeRandomSource=dyt,Object.defineProperty(hyt,"__esModule",{ - value:!0} - ),hyt.SystemRandomSource=void 0; - const fyt=ryt,pyt=cyt,wyt=class{ - constructor(){ - return this.isAvailable=!1,this.name="",this._source=new fyt.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new pyt.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)} - randomBytes(t){ - if(!this.isAvailable)throw new Error("System random byte generator is not available."); - return this._source.randomBytes(t)} - } - ; - Qt(wyt,"SystemRandomSource"); - let gyt=wyt; - hyt.SystemRandomSource=gyt,function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0; - const i=hyt,s=t_t,e=P_t; - function n(i,s=t.defaultRandomSource){ - return s.randomBytes(i)} - function h(i=t.defaultRandomSource){ - const h=n(4,i),r=(0,s.readUint32LE)(h); - return(0,e.wipe)(h),r} - t.defaultRandomSource=new i.SystemRandomSource,Qt(n,"randomBytes"),t.randomBytes=n,Qt(h,"randomUint32"),t.randomUint32=h; - const r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; - function o(i,s=r,h=t.defaultRandomSource){ - if(s.length<2)throw new Error("randomString charset is too short"); - if(s.length>256)throw new Error("randomString charset is too long"); - let o=""; - const a=s.length,c=256-256%a; - for(; - i>0; - ){ - const t=n(Math.ceil(256*i/c),h); - for(let e=0; - e<t.length&&i>0; - e++){ - const n=t[e]; - n<c&&(o+=s.charAt(n%a),i--)} - (0,e.wipe)(t)} - return o} - function a(i,s=r,e=t.defaultRandomSource){ - return o(Math.ceil(i/(Math.log(s.length)/Math.LN2)),s,e)} - Qt(o,"randomString"),t.randomString=o,Qt(a,"randomStringForEntropy"),t.randomStringForEntropy=a} - (nyt); - var myt={ - } - ; - !function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ); - var i=t_t,s=P_t; - t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128; - var e=function(){ - function e(){ - this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()} - return Qt(e,"SHA512"),e.prototype._initState=function(){ - this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209} - ,e.prototype.reset=function(){ - return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this} - ,e.prototype.clean=function(){ - s.wipe(this._buffer),s.wipe(this._tempHi),s.wipe(this._tempLo),this.reset()} - ,e.prototype.update=function(i,s){ - if(void 0===s&&(s=i.length),this._finished)throw new Error("SHA512: can't update because hash was finished."); - var e=0; - if(this._bytesHashed+=s,this._bufferLength>0){ - for(; - this._bufferLength<t.BLOCK_SIZE&&s>0; - )this._buffer[this._bufferLength++]=i[e++],s--; - this._bufferLength===this.blockSize&&(h(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)} - for(s>=this.blockSize&&(e=h(this._tempHi,this._tempLo,this._stateHi,this._stateLo,i,e,s),s%=this.blockSize); - s>0; - )this._buffer[this._bufferLength++]=i[e++],s--; - return this} - ,e.prototype.finish=function(t){ - if(!this._finished){ - var s=this._bytesHashed,e=this._bufferLength,n=s/536870912|0,r=s<<3,o=s%128<112?128:256; - this._buffer[e]=128; - for(var a=e+1; - a<o-8; - a++)this._buffer[a]=0; - i.writeUint32BE(n,this._buffer,o-8),i.writeUint32BE(r,this._buffer,o-4),h(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,o),this._finished=!0} - for(a=0; - a<this.digestLength/8; - a++)i.writeUint32BE(this._stateHi[a],t,8*a),i.writeUint32BE(this._stateLo[a],t,8*a+4); - return this} - ,e.prototype.digest=function(){ - var t=new Uint8Array(this.digestLength); - return this.finish(t),t} - ,e.prototype.saveState=function(){ - if(this._finished)throw new Error("SHA256: cannot save finished state"); - return{ - stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed} - } - ,e.prototype.restoreState=function(t){ - return this._stateHi.set(t.stateHi),this._stateLo.set(t.stateLo),this._bufferLength=t.bufferLength,t.buffer&&this._buffer.set(t.buffer),this._bytesHashed=t.bytesHashed,this._finished=!1,this} - ,e.prototype.cleanSavedState=function(t){ - s.wipe(t.stateHi),s.wipe(t.stateLo),t.buffer&&s.wipe(t.buffer),t.bufferLength=0,t.bytesHashed=0} - ,e} - (); - t.SHA512=e; - var n=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]); - function h(t,s,e,h,r,o,a){ - for(var c,l,u,d,f,p,w,g,m=e[0],v=e[1],_=e[2],M=e[3],b=e[4],y=e[5],E=e[6],A=e[7],S=h[0],T=h[1],C=h[2],O=h[3],I=h[4],k=h[5],x=h[6],R=h[7]; - a>=128; - ){ - for(var P=0; - P<16; - P++){ - var N=8*P+o; - t[P]=i.readUint32BE(r,N),s[P]=i.readUint32BE(r,N+4)} - for(P=0; - P<80; - P++){ - var L,D,G=m,B=v,U=_,F=M,$=b,H=y,W=E,V=S,j=T,K=C,z=O,Y=I,q=k,X=x; - if(f=65535&(l=R),p=l>>>16,w=65535&(c=A),g=c>>>16,f+=65535&(l=(I>>>14|b<<18)^(I>>>18|b<<14)^(b>>>9|I<<23)),p+=l>>>16,w+=65535&(c=(b>>>14|I<<18)^(b>>>18|I<<14)^(I>>>9|b<<23)),g+=c>>>16,f+=65535&(l=I&k^~I&x),p+=l>>>16,w+=65535&(c=b&y^~b&E),g+=c>>>16,c=n[2*P],f+=65535&(l=n[2*P+1]),p+=l>>>16,w+=65535&c,g+=c>>>16,c=t[P%16],p+=(l=s[P%16])>>>16,w+=65535&c,g+=c>>>16,w+=(p+=(f+=65535&l)>>>16)>>>16,f=65535&(l=d=65535&f|p<<16),p=l>>>16,w=65535&(c=u=65535&w|(g+=w>>>16)<<16),g=c>>>16,f+=65535&(l=(S>>>28|m<<4)^(m>>>2|S<<30)^(m>>>7|S<<25)),p+=l>>>16,w+=65535&(c=(m>>>28|S<<4)^(S>>>2|m<<30)^(S>>>7|m<<25)),g+=c>>>16,p+=(l=S&T^S&C^T&C)>>>16,w+=65535&(c=m&v^m&_^v&_),g+=c>>>16,L=65535&(w+=(p+=(f+=65535&l)>>>16)>>>16)|(g+=w>>>16)<<16,D=65535&f|p<<16,f=65535&(l=z),p=l>>>16,w=65535&(c=F),g=c>>>16,p+=(l=d)>>>16,w+=65535&(c=u),g+=c>>>16,v=G,_=B,M=U,b=F=65535&(w+=(p+=(f+=65535&l)>>>16)>>>16)|(g+=w>>>16)<<16,y=$,E=H,A=W,m=L,T=V,C=j,O=K,I=z=65535&f|p<<16,k=Y,x=q,R=X,S=D,P%16==15)for(N=0; - N<16; - N++)c=t[N],f=65535&(l=s[N]),p=l>>>16,w=65535&c,g=c>>>16,c=t[(N+9)%16],f+=65535&(l=s[(N+9)%16]),p+=l>>>16,w+=65535&c,g+=c>>>16,u=t[(N+1)%16],f+=65535&(l=((d=s[(N+1)%16])>>>1|u<<31)^(d>>>8|u<<24)^(d>>>7|u<<25)),p+=l>>>16,w+=65535&(c=(u>>>1|d<<31)^(u>>>8|d<<24)^u>>>7),g+=c>>>16,u=t[(N+14)%16],p+=(l=((d=s[(N+14)%16])>>>19|u<<13)^(u>>>29|d<<3)^(d>>>6|u<<26))>>>16,w+=65535&(c=(u>>>19|d<<13)^(d>>>29|u<<3)^u>>>6),g+=c>>>16,g+=(w+=(p+=(f+=65535&l)>>>16)>>>16)>>>16,t[N]=65535&w|g<<16,s[N]=65535&f|p<<16} - f=65535&(l=S),p=l>>>16,w=65535&(c=m),g=c>>>16,c=e[0],p+=(l=h[0])>>>16,w+=65535&c,g+=c>>>16,g+=(w+=(p+=(f+=65535&l)>>>16)>>>16)>>>16,e[0]=m=65535&w|g<<16,h[0]=S=65535&f|p<<16,f=65535&(l=T),p=l>>>16,w=65535&(c=v),g=c>>>16,c=e[1],p+=(l=h[1])>>>16,w+=65535&c,g+=c>>>16,g+=(w+=(p+=(f+=65535&l)>>>16)>>>16)>>>16,e[1]=v=65535&w|g<<16,h[1]=T=65535&f|p<<16,f=65535&(l=C),p=l>>>16,w=65535&(c=_),g=c>>>16,c=e[2],p+=(l=h[2])>>>16,w+=65535&c,g+=c>>>16,g+=(w+=(p+=(f+=65535&l)>>>16)>>>16)>>>16,e[2]=_=65535&w|g<<16,h[2]=C=65535&f|p<<16,f=65535&(l=O),p=l>>>16,w=65535&(c=M),g=c>>>16,c=e[3],p+=(l=h[3])>>>16,w+=65535&c,g+=c>>>16,g+=(w+=(p+=(f+=65535&l)>>>16)>>>16)>>>16,e[3]=M=65535&w|g<<16,h[3]=O=65535&f|p<<16,f=65535&(l=I),p=l>>>16,w=65535&(c=b),g=c>>>16,c=e[4],p+=(l=h[4])>>>16,w+=65535&c,g+=c>>>16,g+=(w+=(p+=(f+=65535&l)>>>16)>>>16)>>>16,e[4]=b=65535&w|g<<16,h[4]=I=65535&f|p<<16,f=65535&(l=k),p=l>>>16,w=65535&(c=y),g=c>>>16,c=e[5],p+=(l=h[5])>>>16,w+=65535&c,g+=c>>>16,g+=(w+=(p+=(f+=65535&l)>>>16)>>>16)>>>16,e[5]=y=65535&w|g<<16,h[5]=k=65535&f|p<<16,f=65535&(l=x),p=l>>>16,w=65535&(c=E),g=c>>>16,c=e[6],p+=(l=h[6])>>>16,w+=65535&c,g+=c>>>16,g+=(w+=(p+=(f+=65535&l)>>>16)>>>16)>>>16,e[6]=E=65535&w|g<<16,h[6]=x=65535&f|p<<16,f=65535&(l=R),p=l>>>16,w=65535&(c=A),g=c>>>16,c=e[7],p+=(l=h[7])>>>16,w+=65535&c,g+=c>>>16,g+=(w+=(p+=(f+=65535&l)>>>16)>>>16)>>>16,e[7]=A=65535&w|g<<16,h[7]=R=65535&f|p<<16,o+=128,a-=128} - return o} - function r(t){ - var i=new e; - i.update(t); - var s=i.digest(); - return i.clean(),s} - Qt(h,"hashBlocks"),Qt(r,"hash"),t.hash=r} - (myt),function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0; - const i=nyt,s=myt,e=P_t; - function n(t){ - const i=new Float64Array(16); - if(t)for(let s=0; - s<t.length; - s++)i[s]=t[s]; - return i} - t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32,Qt(n,"gf"),new Uint8Array(32)[0]=9; - const h=n(),r=n([1]),o=n([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),a=n([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),c=n([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),l=n([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),u=n([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]); - function d(t,i){ - for(let s=0; - s<16; - s++)t[s]=0|i[s]} - function f(t){ - let i=1; - for(let s=0; - s<16; - s++){ - let e=t[s]+i+65535; - i=Math.floor(e/65536),t[s]=e-65536*i} - t[0]+=i-1+37*(i-1)} - function p(t,i,s){ - const e=~(s-1); - for(let n=0; - n<16; - n++){ - const s=e&(t[n]^i[n]); - t[n]^=s,i[n]^=s} - } - function w(t,i){ - const s=n(),e=n(); - for(let n=0; - n<16; - n++)e[n]=i[n]; - f(e),f(e),f(e); - for(let n=0; - n<2; - n++){ - s[0]=e[0]-65517; - for(let i=1; - i<15; - i++)s[i]=e[i]-65535-(s[i-1]>>16&1),s[i-1]&=65535; - s[15]=e[15]-32767-(s[14]>>16&1); - const t=s[15]>>16&1; - s[14]&=65535,p(e,s,1-t)} - for(let n=0; - n<16; - n++)t[2*n]=255&e[n],t[2*n+1]=e[n]>>8} - function g(t,i){ - let s=0; - for(let e=0; - e<32; - e++)s|=t[e]^i[e]; - return(1&s-1>>>8)-1} - function m(t,i){ - const s=new Uint8Array(32),e=new Uint8Array(32); - return w(s,t),w(e,i),g(s,e)} - function v(t){ - const i=new Uint8Array(32); - return w(i,t),1&i[0]} - function _(t,i){ - for(let s=0; - s<16; - s++)t[s]=i[2*s]+(i[2*s+1]<<8); - t[15]&=32767} - function M(t,i,s){ - for(let e=0; - e<16; - e++)t[e]=i[e]+s[e]} - function b(t,i,s){ - for(let e=0; - e<16; - e++)t[e]=i[e]-s[e]} - function y(t,i,s){ - let e,n,h=0,r=0,o=0,a=0,c=0,l=0,u=0,d=0,f=0,p=0,w=0,g=0,m=0,v=0,_=0,M=0,b=0,y=0,E=0,A=0,S=0,T=0,C=0,O=0,I=0,k=0,x=0,R=0,P=0,N=0,L=0,D=s[0],G=s[1],B=s[2],U=s[3],F=s[4],$=s[5],H=s[6],W=s[7],V=s[8],j=s[9],K=s[10],z=s[11],Y=s[12],q=s[13],X=s[14],J=s[15]; - e=i[0],h+=e*D,r+=e*G,o+=e*B,a+=e*U,c+=e*F,l+=e*$,u+=e*H,d+=e*W,f+=e*V,p+=e*j,w+=e*K,g+=e*z,m+=e*Y,v+=e*q,_+=e*X,M+=e*J,e=i[1],r+=e*D,o+=e*G,a+=e*B,c+=e*U,l+=e*F,u+=e*$,d+=e*H,f+=e*W,p+=e*V,w+=e*j,g+=e*K,m+=e*z,v+=e*Y,_+=e*q,M+=e*X,b+=e*J,e=i[2],o+=e*D,a+=e*G,c+=e*B,l+=e*U,u+=e*F,d+=e*$,f+=e*H,p+=e*W,w+=e*V,g+=e*j,m+=e*K,v+=e*z,_+=e*Y,M+=e*q,b+=e*X,y+=e*J,e=i[3],a+=e*D,c+=e*G,l+=e*B,u+=e*U,d+=e*F,f+=e*$,p+=e*H,w+=e*W,g+=e*V,m+=e*j,v+=e*K,_+=e*z,M+=e*Y,b+=e*q,y+=e*X,E+=e*J,e=i[4],c+=e*D,l+=e*G,u+=e*B,d+=e*U,f+=e*F,p+=e*$,w+=e*H,g+=e*W,m+=e*V,v+=e*j,_+=e*K,M+=e*z,b+=e*Y,y+=e*q,E+=e*X,A+=e*J,e=i[5],l+=e*D,u+=e*G,d+=e*B,f+=e*U,p+=e*F,w+=e*$,g+=e*H,m+=e*W,v+=e*V,_+=e*j,M+=e*K,b+=e*z,y+=e*Y,E+=e*q,A+=e*X,S+=e*J,e=i[6],u+=e*D,d+=e*G,f+=e*B,p+=e*U,w+=e*F,g+=e*$,m+=e*H,v+=e*W,_+=e*V,M+=e*j,b+=e*K,y+=e*z,E+=e*Y,A+=e*q,S+=e*X,T+=e*J,e=i[7],d+=e*D,f+=e*G,p+=e*B,w+=e*U,g+=e*F,m+=e*$,v+=e*H,_+=e*W,M+=e*V,b+=e*j,y+=e*K,E+=e*z,A+=e*Y,S+=e*q,T+=e*X,C+=e*J,e=i[8],f+=e*D,p+=e*G,w+=e*B,g+=e*U,m+=e*F,v+=e*$,_+=e*H,M+=e*W,b+=e*V,y+=e*j,E+=e*K,A+=e*z,S+=e*Y,T+=e*q,C+=e*X,O+=e*J,e=i[9],p+=e*D,w+=e*G,g+=e*B,m+=e*U,v+=e*F,_+=e*$,M+=e*H,b+=e*W,y+=e*V,E+=e*j,A+=e*K,S+=e*z,T+=e*Y,C+=e*q,O+=e*X,I+=e*J,e=i[10],w+=e*D,g+=e*G,m+=e*B,v+=e*U,_+=e*F,M+=e*$,b+=e*H,y+=e*W,E+=e*V,A+=e*j,S+=e*K,T+=e*z,C+=e*Y,O+=e*q,I+=e*X,k+=e*J,e=i[11],g+=e*D,m+=e*G,v+=e*B,_+=e*U,M+=e*F,b+=e*$,y+=e*H,E+=e*W,A+=e*V,S+=e*j,T+=e*K,C+=e*z,O+=e*Y,I+=e*q,k+=e*X,x+=e*J,e=i[12],m+=e*D,v+=e*G,_+=e*B,M+=e*U,b+=e*F,y+=e*$,E+=e*H,A+=e*W,S+=e*V,T+=e*j,C+=e*K,O+=e*z,I+=e*Y,k+=e*q,x+=e*X,R+=e*J,e=i[13],v+=e*D,_+=e*G,M+=e*B,b+=e*U,y+=e*F,E+=e*$,A+=e*H,S+=e*W,T+=e*V,C+=e*j,O+=e*K,I+=e*z,k+=e*Y,x+=e*q,R+=e*X,P+=e*J,e=i[14],_+=e*D,M+=e*G,b+=e*B,y+=e*U,E+=e*F,A+=e*$,S+=e*H,T+=e*W,C+=e*V,O+=e*j,I+=e*K,k+=e*z,x+=e*Y,R+=e*q,P+=e*X,N+=e*J,e=i[15],M+=e*D,b+=e*G,y+=e*B,E+=e*U,A+=e*F,S+=e*$,T+=e*H,C+=e*W,O+=e*V,I+=e*j,k+=e*K,x+=e*z,R+=e*Y,P+=e*q,N+=e*X,L+=e*J,h+=38*b,r+=38*y,o+=38*E,a+=38*A,c+=38*S,l+=38*T,u+=38*C,d+=38*O,f+=38*I,p+=38*k,w+=38*x,g+=38*R,m+=38*P,v+=38*N,_+=38*L,n=1,e=h+n+65535,n=Math.floor(e/65536),h=e-65536*n,e=r+n+65535,n=Math.floor(e/65536),r=e-65536*n,e=o+n+65535,n=Math.floor(e/65536),o=e-65536*n,e=a+n+65535,n=Math.floor(e/65536),a=e-65536*n,e=c+n+65535,n=Math.floor(e/65536),c=e-65536*n,e=l+n+65535,n=Math.floor(e/65536),l=e-65536*n,e=u+n+65535,n=Math.floor(e/65536),u=e-65536*n,e=d+n+65535,n=Math.floor(e/65536),d=e-65536*n,e=f+n+65535,n=Math.floor(e/65536),f=e-65536*n,e=p+n+65535,n=Math.floor(e/65536),p=e-65536*n,e=w+n+65535,n=Math.floor(e/65536),w=e-65536*n,e=g+n+65535,n=Math.floor(e/65536),g=e-65536*n,e=m+n+65535,n=Math.floor(e/65536),m=e-65536*n,e=v+n+65535,n=Math.floor(e/65536),v=e-65536*n,e=_+n+65535,n=Math.floor(e/65536),_=e-65536*n,e=M+n+65535,n=Math.floor(e/65536),M=e-65536*n,h+=n-1+37*(n-1),n=1,e=h+n+65535,n=Math.floor(e/65536),h=e-65536*n,e=r+n+65535,n=Math.floor(e/65536),r=e-65536*n,e=o+n+65535,n=Math.floor(e/65536),o=e-65536*n,e=a+n+65535,n=Math.floor(e/65536),a=e-65536*n,e=c+n+65535,n=Math.floor(e/65536),c=e-65536*n,e=l+n+65535,n=Math.floor(e/65536),l=e-65536*n,e=u+n+65535,n=Math.floor(e/65536),u=e-65536*n,e=d+n+65535,n=Math.floor(e/65536),d=e-65536*n,e=f+n+65535,n=Math.floor(e/65536),f=e-65536*n,e=p+n+65535,n=Math.floor(e/65536),p=e-65536*n,e=w+n+65535,n=Math.floor(e/65536),w=e-65536*n,e=g+n+65535,n=Math.floor(e/65536),g=e-65536*n,e=m+n+65535,n=Math.floor(e/65536),m=e-65536*n,e=v+n+65535,n=Math.floor(e/65536),v=e-65536*n,e=_+n+65535,n=Math.floor(e/65536),_=e-65536*n,e=M+n+65535,n=Math.floor(e/65536),M=e-65536*n,h+=n-1+37*(n-1),t[0]=h,t[1]=r,t[2]=o,t[3]=a,t[4]=c,t[5]=l,t[6]=u,t[7]=d,t[8]=f,t[9]=p,t[10]=w,t[11]=g,t[12]=m,t[13]=v,t[14]=_,t[15]=M} - function E(t,i){ - y(t,i,i)} - function A(t,i){ - const s=n(); - let e; - for(e=0; - e<16; - e++)s[e]=i[e]; - for(e=253; - e>=0; - e--)E(s,s),2!==e&&4!==e&&y(s,s,i); - for(e=0; - e<16; - e++)t[e]=s[e]} - function S(t,i){ - const s=n(); - let e; - for(e=0; - e<16; - e++)s[e]=i[e]; - for(e=250; - e>=0; - e--)E(s,s),1!==e&&y(s,s,i); - for(e=0; - e<16; - e++)t[e]=s[e]} - function T(t,i){ - const s=n(),e=n(),h=n(),r=n(),o=n(),c=n(),l=n(),u=n(),d=n(); - b(s,t[1],t[0]),b(d,i[1],i[0]),y(s,s,d),M(e,t[0],t[1]),M(d,i[0],i[1]),y(e,e,d),y(h,t[3],i[3]),y(h,h,a),y(r,t[2],i[2]),M(r,r,r),b(o,e,s),b(c,r,h),M(l,r,h),M(u,e,s),y(t[0],o,c),y(t[1],u,l),y(t[2],l,c),y(t[3],o,u)} - function C(t,i,s){ - for(let e=0; - e<4; - e++)p(t[e],i[e],s)} - function O(t,i){ - const s=n(),e=n(),h=n(); - A(h,i[2]),y(s,i[0],h),y(e,i[1],h),w(t,e),t[31]^=v(s)<<7} - function I(t,i,s){ - d(t[0],h),d(t[1],r),d(t[2],r),d(t[3],h); - for(let e=255; - e>=0; - --e){ - const n=s[e/8|0]>>(7&e)&1; - C(t,i,n),T(i,t),T(t,t),C(t,i,n)} - } - function k(t,i){ - const s=[n(),n(),n(),n()]; - d(s[0],c),d(s[1],l),d(s[2],r),y(s[3],c,l),I(t,s,i)} - function x(i){ - if(i.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${ - t.SEED_LENGTH} - bytes`); - const e=(0,s.hash)(i); - e[0]&=248,e[31]&=127,e[31]|=64; - const h=new Uint8Array(32),r=[n(),n(),n(),n()]; - k(r,e),O(h,r); - const o=new Uint8Array(64); - return o.set(i),o.set(h,32),{ - publicKey:h,secretKey:o} - } - function R(t){ - const s=(0,i.randomBytes)(32,t),n=x(s); - return(0,e.wipe)(s),n} - function P(i){ - if(i.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${ - t.SECRET_KEY_LENGTH} - bytes`); - return new Uint8Array(i.subarray(32))} - Qt(d,"set25519"),Qt(f,"car25519"),Qt(p,"sel25519"),Qt(w,"pack25519"),Qt(g,"verify32"),Qt(m,"neq25519"),Qt(v,"par25519"),Qt(_,"unpack25519"),Qt(M,"add"),Qt(b,"sub"),Qt(y,"mul"),Qt(E,"square"),Qt(A,"inv25519"),Qt(S,"pow2523"),Qt(T,"edadd"),Qt(C,"cswap"),Qt(O,"pack"),Qt(I,"scalarmult"),Qt(k,"scalarbase"),Qt(x,"generateKeyPairFromSeed"),t.generateKeyPairFromSeed=x,Qt(R,"generateKeyPair"),t.generateKeyPair=R,Qt(P,"extractPublicKeyFromSecretKey"),t.extractPublicKeyFromSecretKey=P; - const N=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]); - function L(t,i){ - let s,e,n,h; - for(e=63; - e>=32; - --e){ - for(s=0,n=e-32,h=e-12; - n<h; - ++n)i[n]+=s-16*i[e]*N[n-(e-32)],s=Math.floor((i[n]+128)/256),i[n]-=256*s; - i[n]+=s,i[e]=0} - for(s=0,n=0; - n<32; - n++)i[n]+=s-(i[31]>>4)*N[n],s=i[n]>>8,i[n]&=255; - for(n=0; - n<32; - n++)i[n]-=s*N[n]; - for(e=0; - e<32; - e++)i[e+1]+=i[e]>>8,t[e]=255&i[e]} - function D(t){ - const i=new Float64Array(64); - for(let s=0; - s<64; - s++)i[s]=t[s]; - for(let s=0; - s<64; - s++)t[s]=0; - L(t,i)} - function G(t,i){ - const e=new Float64Array(64),h=[n(),n(),n(),n()],r=(0,s.hash)(t.subarray(0,32)); - r[0]&=248,r[31]&=127,r[31]|=64; - const o=new Uint8Array(64); - o.set(r.subarray(32),32); - const a=new s.SHA512; - a.update(o.subarray(32)),a.update(i); - const c=a.digest(); - a.clean(),D(c),k(h,c),O(o,h),a.reset(),a.update(o.subarray(0,32)),a.update(t.subarray(32)),a.update(i); - const l=a.digest(); - D(l); - for(let s=0; - s<32; - s++)e[s]=c[s]; - for(let s=0; - s<32; - s++)for(let t=0; - t<32; - t++)e[s+t]+=l[s]*r[t]; - return L(o.subarray(32),e),o} - function B(t,i){ - const s=n(),e=n(),a=n(),c=n(),l=n(),f=n(),p=n(); - return d(t[2],r),_(t[1],i),E(a,t[1]),y(c,a,o),b(a,a,t[2]),M(c,t[2],c),E(l,c),E(f,l),y(p,f,l),y(s,p,a),y(s,s,c),S(s,s),y(s,s,a),y(s,s,c),y(s,s,c),y(t[0],s,c),E(e,t[0]),y(e,e,c),m(e,a)&&y(t[0],t[0],u),E(e,t[0]),y(e,e,c),m(e,a)?-1:(v(t[0])===i[31]>>7&&b(t[0],h,t[0]),y(t[3],t[0],t[1]),0)} - function U(i,e,h){ - const r=new Uint8Array(32),o=[n(),n(),n(),n()],a=[n(),n(),n(),n()]; - if(h.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${ - t.SIGNATURE_LENGTH} - bytes`); - if(B(a,i))return!1; - const c=new s.SHA512; - c.update(h.subarray(0,32)),c.update(i),c.update(e); - const l=c.digest(); - return D(l),I(o,a,l),k(a,h.subarray(32)),T(o,a),O(r,o),!g(h,r)} - function F(t){ - let i=[n(),n(),n(),n()]; - if(B(i,t))throw new Error("Ed25519: invalid public key"); - let s=n(),e=n(),h=i[1]; - M(s,r,h),b(e,r,h),A(e,e),y(s,s,e); - let o=new Uint8Array(32); - return w(o,s),o} - function $(t){ - const i=(0,s.hash)(t.subarray(0,32)); - i[0]&=248,i[31]&=127,i[31]|=64; - const n=new Uint8Array(i.subarray(0,32)); - return(0,e.wipe)(i),n} - Qt(L,"modL"),Qt(D,"reduce"),Qt(G,"sign"),t.sign=G,Qt(B,"unpackneg"),Qt(U,"verify"),t.verify=U,Qt(F,"convertPublicKeyToX25519"),t.convertPublicKeyToX25519=F,Qt($,"convertSecretKeyToX25519"),t.convertSecretKeyToX25519=$} - (eyt),function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__setModuleDefault||(Object.create?function(t,i){ - Object.defineProperty(t,"default",{ - enumerable:!0,value:i} - )} - :function(t,i){ - t.default=i} - ),e=pi&&pi.__importStar||function(){ - var t=Qt(function(i){ - return(t=Object.getOwnPropertyNames||function(t){ - var i=[]; - for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[i.length]=s); - return i} - )(i)} - ,"ownKeys"); - return function(e){ - if(e&&e.__esModule)return e; - var n={ - } - ; - if(null!=e)for(var h=t(e),r=0; - r<h.length; - r++)"default"!==h[r]&&i(n,e,h[r]); - return s(n,e),n} - } - (),n=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ,h=pi&&pi.__importDefault||function(t){ - return t&&t.__esModule?t:{ - default:t} - } - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.MULTICODEC_ED25519_LENGTH=t.MULTICODEC_ED25519_HEADER=t.MULTICODEC_ED25519_BASE=t.MULTICODEC_ED25519_ENCODING=t.DID_METHOD=t.DID_PREFIX=t.DID_DELIMITER=t.KEY_PAIR_SEED_LENGTH=t.DATA_ENCODING=t.JSON_ENCODING=t.JWT_ENCODING=t.JWT_DELIMITER=t.JWT_IRIDIUM_TYP=t.JWT_IRIDIUM_ALG=t.JWTHeaderType=void 0,t.generateKeyPair=d,t.decodeJSON=f,t.encodeJSON=p,t.encodeIss=w,t.decodeIss=g,t.encodeSig=m,t.decodeSig=v,t.encodeData=_,t.decodeData=M,t.encodeJWT=b,t.decodeJWT=y,t.signJWT=E,t.verifyJWT=A; - const r=e(eyt),o=dbt(),a=vbt(),c=h(Cgt),l=e(ubt()),u=mbt(); - function d(){ - return c.default.sign.keyPair()} - function f(i){ - return(0,o.safeJsonParse)((0,u.okxtoString)((0,u.okxfromString)(i,t.JWT_ENCODING),t.JSON_ENCODING))} - function p(i){ - return(0,u.okxtoString)((0,u.okxfromString)((0,o.safeJsonStringify)(i),t.JSON_ENCODING),t.JWT_ENCODING)} - function w(i){ - l.logDebug(`publicKey: ${ - (0,a.toHexString)(i)} - `); - var s=(0,u.okxtoString)(i,t.MULTICODEC_ED25519_ENCODING); - return[t.DID_PREFIX,t.DID_METHOD,s].join(t.DID_DELIMITER)} - function g(i){ - const[s,e,n]=i.split(t.DID_DELIMITER); - if(s!==t.DID_PREFIX||e!==t.DID_METHOD)throw new Error('Issuer must be a DID with method "key"'); - if(void 0===n)throw new Error("multicodec is undefined"); - const h=(0,u.okxfromString)(n,t.MULTICODEC_ED25519_ENCODING); - if(void 0===h||h.length!==t.MULTICODEC_ED25519_LENGTH)throw new Error("Issuer must be a public key with length 32 bytes"); - return h} - function m(i){ - return(0,u.okxtoString)(i,t.JWT_ENCODING)} - function v(i){ - return(0,u.okxfromString)(i,t.JWT_ENCODING)} - function _(i){ - return(0,u.okxfromString)([p(i.header),p(i.payload)].join(t.JWT_DELIMITER),t.DATA_ENCODING)} - function M(i){ - var s,e; - const n=(0,u.okxtoString)(i,t.DATA_ENCODING).split(t.JWT_DELIMITER); - return{ - header:f(null!==(s=n[0])&&void 0!==s?s:"{ - } - "),payload:f(null!==(e=n[1])&&void 0!==e?e:"{ - } - ")} - } - function b(i){ - return[p(i.header),p(i.payload),m(i.signature)].join(t.JWT_DELIMITER)} - function y(i){ - var s,e,n; - const h=i.split(t.JWT_DELIMITER); - return{ - header:f(null!==(s=h[0])&&void 0!==s?s:"{ - } - "),payload:f(null!==(e=h[1])&&void 0!==e?e:"{ - } - "),signature:v(null!==(n=h[2])&&void 0!==n?n:"{ - } - "),data:(0,u.okxfromString)(h.slice(0,2).join(t.JWT_DELIMITER),t.DATA_ENCODING)} - } - function E(i,s,e,h){ - return n(this,arguments,void 0,function*(i,s,e,n,h=Math.floor(Date.now())){ - const r={ - alg:t.JWT_IRIDIUM_ALG,typ:t.JWT_IRIDIUM_TYP} - ,o={ - iss:w(n.publicKey),sub:i,aud:s,act:"authenticate user",iat:h,exp:h+e} - ,a=_({ - header:r,payload:o} - ); - return l.logDebug(`get sec kp: ${ - n.secretKey} - { - ${ - n.secretKey.length} - } - `),b({ - header:r,payload:o,signature:c.default.sign.detached(a,n.secretKey)} - )} - )} - function A(i){ - return n(this,void 0,void 0,function*(){ - const{ - header:s,payload:e,data:n,signature:h} - =y(i); - if(s.alg!==t.JWT_IRIDIUM_ALG||s.typ!==t.JWT_IRIDIUM_TYP)throw new Error("JWT must use EdDSA algorithm"); - const o=g(e.iss); - return r.verify(o,n,h)} - )} - t.JWTHeaderType="dapp",t.JWT_IRIDIUM_ALG="EdDSA",t.JWT_IRIDIUM_TYP="JWT",t.JWT_DELIMITER=".",t.JWT_ENCODING="base64url",t.JSON_ENCODING="utf8",t.DATA_ENCODING="utf8",t.KEY_PAIR_SEED_LENGTH=32,t.DID_DELIMITER=":",t.DID_PREFIX="did",t.DID_METHOD="key",t.MULTICODEC_ED25519_ENCODING="base58btc",t.MULTICODEC_ED25519_BASE="z",t.MULTICODEC_ED25519_HEADER="K36",t.MULTICODEC_ED25519_LENGTH=32,Qt(d,"generateKeyPair"),Qt(f,"decodeJSON"),Qt(p,"encodeJSON"),Qt(w,"encodeIss"),Qt(g,"decodeIss"),Qt(m,"encodeSig"),Qt(v,"decodeSig"),Qt(_,"encodeData"),Qt(M,"decodeData"),Qt(b,"encodeJWT"),Qt(y,"decodeJWT"),Qt(E,"signJWT"),Qt(A,"verifyJWT")} - (syt); - var vyt={ - } - ,_yt=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),Myt=pi&&pi.__setModuleDefault||(Object.create?function(t,i){ - Object.defineProperty(t,"default",{ - enumerable:!0,value:i} - )} - :function(t,i){ - t.default=i} - ),byt=pi&&pi.__importStar||function(){ - var t=Qt(function(i){ - return(t=Object.getOwnPropertyNames||function(t){ - var i=[]; - for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[i.length]=s); - return i} - )(i)} - ,"ownKeys"); - return function(i){ - if(i&&i.__esModule)return i; - var s={ - } - ; - if(null!=i)for(var e=t(i),n=0; - n<e.length; - n++)"default"!==e[n]&&_yt(s,i,e[n]); - return Myt(s,i),s} - } - (),yyt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ,Eyt=pi&&pi.__importDefault||function(t){ - return t&&t.__esModule?t:{ - default:t} - } - ; - Object.defineProperty(vyt,"__esModule",{ - value:!0} - ),vyt.ConnectionSplitPackages=void 0; - const Ayt=Agt,Syt=Eyt(_S),Tyt=vbt(),Cyt=dbt(),Oyt=byt(ubt()),Iyt=ubt(),kyt="ConnectionReceiveKey",xyt="ConnectionSendKey",Ryt="ConnectionSenderVersionKey",Pyt=class{ - constructor(t){ - this.splitMessageSendArray=new Map,this.splitMessageReceivedArray=new Map,this.splitMessageSenderVersionMap=new Map,this.splitPackageCache=Syt.default.createInstance({ - name:Ayt.OKXCONNECTOR_STORAGE_PROTOCOL_CACHE+t} - )} - init(t){ - return yyt(this,void 0,void 0,function*(){ - if(yield this.recoverFromCache(),this.splitMessageSendArray.size>0){ - for(const[s,e]of this.splitMessageSendArray.entries())for(let n=0; - n<e.length; - ){ - const h=e[n]; - try{ - yield t((0,Cyt.safeJsonStringify)(h),s),Oyt.logDebug(`Successfully sent payload: ${ - (0,Cyt.safeJsonStringify)(h)} - to topic: ${ - s} - `),e.splice(n,1)} - catch(i){ - Oyt.logError(`Failed to send payload: ${ - (0,Cyt.safeJsonStringify)(h)} - to topic: ${ - s} - `,i),h.retryCount=(h.retryCount||0)+1,h.retryCount>3?(Oyt.logError(`Payload failed after 3 retries: ${ - (0,Cyt.safeJsonStringify)(h)} - `),e.splice(n,1)):n++} - } - yield this.syncCache()} - } - )} - tryParseMessageSplitPayload(t){ - var i; - let s; - try{ - if(t.trimStart().startsWith("{ - ")){ - let e=(0,Cyt.safeJsonParse)(t); - if(e&&e.protocol_version&&e.protocol_version>=2){ - let t=e; - t.package_group_id&&(null===(i=t.package_group_id)||void 0===i?void 0:i.length)>0&&(s=e)} - } - else(0,Iyt.logDebug)("not split packages")} - catch(e){ - (0,Iyt.logDebug)("not split packages")} - return s} - updateTopicSenderVersion(t,i){ - return yyt(this,void 0,void 0,function*(){ - this.splitMessageSenderVersionMap.set(t,i),yield this.syncCache(),(0,Iyt.logDebug)("get update topic sender version: ",t,i)} - )} - sendSplitPackages(t,i,s,e){ - return yyt(this,void 0,void 0,function*(){ - if(!t)return void Oyt.logError("sendSplitPackages invalid topic"); - let n=this.splitMessageSenderVersionMap.get(t),h=i.length; - try{ - if(h<63e3)throw new Error(`no need to split (size:${ - h} - )`); - if(!n||n&&n<2)throw new Error(`version not support split (version: ${ - n} - )`); - const s=[]; - let o=63e3; - for(let t=0; - t<i.length; - t+=o)t+o<i.length?s.push(i.slice(t,t+o)):s.push(i.slice(t)); - let a=(0,Tyt.generateGroupId)(),c=s.map((i,e)=>({ - topicId:t,protocol_version:2,total_count:s.length,package_index:e,package_group_id:a,content:i} - )); - this.mergePackageArray(!0,c); - for(let i=0; - i<c.length; - ){ - const s=c[i],n=(0,Cyt.safeJsonStringify)(s); - try{ - yield e(n,t),Oyt.logDebug(`Successfully sent payload: ${ - n} - to topic: ${ - t} - `),c.splice(i,1)} - catch(r){ - Oyt.logError(`Failed to send payload: ${ - n} - to topic: ${ - t} - `,r),s.retryCount=(s.retryCount||0)+1,s.retryCount>3?(Oyt.logError(`Payload failed after 3 retries: ${ - n} - `),c.splice(i,1)):i++} - } - this.splitMessageSendArray.set(t,[]),yield this.syncCache()} - catch(frt){ - (0,Iyt.logDebug)("send split packages no split"),(0,Iyt.logDebug)(frt),yield s(t,i)} - } - )} - onReceivedPackageCheck(t){ - return yyt(this,void 0,void 0,function*(){ - this.mergePackageArray(!1,[t]); - let i=new Map,s=t.topicId; - this.splitMessageReceivedArray.forEach((s,e)=>{ - e==t.topicId&&s.forEach(t=>{ - if(t.messageObject.package_group_id){ - let s=i.get(t.messageObject.package_group_id); - s||(s=new Array),s.push(t),i.set(t.messageObject.package_group_id,s)} - } - )} - ),(0,Iyt.logDebug)("on received message, check message cache"); - let e={ - isSplitPackage:!1} - ; - if(t.messageObject.package_group_id){ - e.isSplitPackage=!0; - let n=i.get(t.messageObject.package_group_id); - if(null==n?void 0:n.length){ - let i=new Set; - if(n.forEach(t=>{ - void 0!==t.messageObject.package_index&&i.add(t.messageObject.package_index)} - ),i.size==t.messageObject.total_count){ - n.sort((t,i)=>!t.messageObject.package_index&&0!==t.messageObject.package_index||!i.messageObject.package_index&&0!==i.messageObject.package_index?0:t.messageObject.package_index-i.messageObject.package_index); - let t=n.reduce((t,i)=>(t.push(i.messageObject.content),t),[]),i=n.reduce((t,i)=>(t.push(i.messageId),t),[]); - e.isSplitPackage=!0,e.finalMessage=t.join(""),e.completeMessageIdList=i; - let h=this.splitMessageReceivedArray.get(s); - h&&(h=h.filter(t=>!i.includes(t.messageId)),this.splitMessageReceivedArray.set(s,h)),yield this.syncCache()} - } - } - return e} - )} - mergePackageArray(t,i){ - return yyt(this,void 0,void 0,function*(){ - if((0,Iyt.logDebug)("append sending array"),t){ - let t=i.filter(t=>{ - let i=t.topicId,s=!0,e=this.splitMessageSendArray.get(i); - return null==e||e.forEach(i=>{ - i.package_group_id==t.package_group_id&&i.total_count==t.total_count&&i.package_index==t.package_index&&(s=!1)} - ),s} - ); - if(t.length>0){ - let i=t[0].topicId,s=this.splitMessageSendArray.get(i); - s||(s=new Array),s=s.concat(t),this.splitMessageSendArray.set(i,s),(0,Iyt.logDebug)("append sending array (after filted): ",s)} - } - else{ - let t=i.filter(t=>{ - let i=t.topicId,s=!0,e=this.splitMessageReceivedArray.get(i); - return null==e||e.forEach(i=>{ - i.messageId==t.messageId&&(s=!1)} - ),s} - ); - if(t.length>0){ - let i=t[0].topicId,s=this.splitMessageReceivedArray.get(i); - s||(s=new Array),s=s.concat(t),this.splitMessageReceivedArray.set(i,s),(0,Iyt.logDebug)("append received array (after filted): ",s)} - } - } - )} - syncCache(){ - return yyt(this,void 0,void 0,function*(){ - (0,Iyt.logDebug)("sync split message cache"),yield this.splitPackageCache.setItem(kyt,this.splitMessageReceivedArray),yield this.splitPackageCache.setItem(xyt,this.splitMessageSendArray),yield this.splitPackageCache.setItem(Ryt,this.splitMessageSenderVersionMap)} - )} - recoverFromCache(){ - return yyt(this,void 0,void 0,function*(){ - let t=yield this.splitPackageCache.getItem(kyt); - this.splitMessageReceivedArray=t||new Map; - let i=yield this.splitPackageCache.getItem(xyt); - this.splitMessageSendArray=i||new Map; - let s=yield this.splitPackageCache.getItem(Ryt); - this.splitMessageSenderVersionMap=s||new Map} - )} - } - ; - Qt(Pyt,"ConnectionSplitPackages"); - let Nyt=Pyt; - vyt.ConnectionSplitPackages=Nyt; - var Lyt=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),Dyt=pi&&pi.__setModuleDefault||(Object.create?function(t,i){ - Object.defineProperty(t,"default",{ - enumerable:!0,value:i} - )} - :function(t,i){ - t.default=i} - ),Gyt=pi&&pi.__importStar||function(){ - var t=Qt(function(i){ - return(t=Object.getOwnPropertyNames||function(t){ - var i=[]; - for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[i.length]=s); - return i} - )(i)} - ,"ownKeys"); - return function(i){ - if(i&&i.__esModule)return i; - var s={ - } - ; - if(null!=i)for(var e=t(i),n=0; - n<e.length; - n++)"default"!==e[n]&&Lyt(s,i,e[n]); - return Dyt(s,i),s} - } - (),Byt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(zbt,"__esModule",{ - value:!0} - ),zbt.ConnectionManager=void 0; - const Uyt=ygt,Fyt=Ybt,$yt=Agt,Hyt=qbt,Wyt=Egt,Vyt=MMt,jyt=Sgt,Kyt=vbt(),zyt=Xbt,Yyt=syt,qyt=dbt(),Xyt=Gyt(ubt()),Jyt=ubt(),Qyt=obt(),Zyt=YMt(),tEt=vyt,iEt=class{ - constructor(t=void 0){ - this.events=new Vyt.EventEmitter,this.splitManager=new tEt.ConnectionSplitPackages("dapp"),this.connectorEnable=!1,this.connectStorage=new jyt.Storage($yt.OKXCONNECTOR_CACHE_KEY_DAPP+t,$yt.OKXCONNECTOR_CACHE_KEY_DAPP),this.tonsdkConnectStorage=new jyt.Storage($yt.OKXCONNECTOR_TON_KEY+t,$yt.OKXCONNECTOR_TON_KEY),this.crypto=new zyt.SessionCrypto; - let i=(0,Zyt.isInTMA)(); - if((0,Jyt.logDebug)("do init:",i),Xyt.reportLog("connection manager do init"),i)try{ - const t=this.getCachedCryptoKeyPair(); - (0,Jyt.logDebug)("use same pk:",t),this.crypto=new zyt.SessionCrypto(t)} - catch(s){ - this.connectStorage.clearCache(),Xyt.reportEvent(Qyt.OKXReportType.LOG,"cache_fail","cache failed")} - this.jwtKeyPair=this.getCachedJWTKeyPair(),this.saveJWTKeyPair(this.jwtKeyPair),this.connector=new Uyt.OKXWalletConnector(Wyt.OKXCONNECTOR_WS_URL_1),this.packageId=Date.now(),this.connectedWalletPK="",this.currentTopic="",Xyt.logDebug(`this.connectedWalletPK constructor ${ - this.connectedWalletPK} - `)} - refreshPackageId(){ - let t=Date.now(); - t==this.packageId&&(this.packageId=t+1),this.packageId=t} - saveCryptoKeyPair(t){ - let i=(0,qyt.safeJsonStringify)(t); - this.connectStorage.encryptStoreMsg(i,$yt.OKXCONNECTOR_CRYPTO_KEY)} - getCachedCryptoKeyPair(){ - const t=this.connectStorage.getAndDecrypt($yt.OKXCONNECTOR_CRYPTO_KEY); - return"string"==typeof t?(Xyt.logDebug("get cached crypto key:"),Xyt.logDebug(t),(0,qyt.safeJsonParse)(t)):(this.connectStorage.clearCache(),null)} - saveJWTKeyPair(t){ - var i={ - publicKey:(0,Kyt.toHexString)(t.publicKey),secretKey:(0,Kyt.toHexString)(t.secretKey)} - ; - Xyt.logDebug("save jwt kp"); - let s=(0,qyt.safeJsonStringify)(i); - Xyt.logDebug(s),this.connectStorage.encryptStoreMsg(s,$yt.OKXCONNECTOR_JWT_KEY)} - getCachedJWTKeyPair(){ - try{ - const t=this.connectStorage.getAndDecrypt($yt.OKXCONNECTOR_JWT_KEY); - if("string"==typeof t){ - Xyt.logDebug("get cached jwt kp:"),Xyt.logDebug(t); - let i=(0,qyt.safeJsonParse)(t); - return Xyt.logDebug("save jwt kp"),Xyt.logDebug(i),{ - publicKey:(0,Kyt.hexToByteArray)(i.publicKey),secretKey:(0,Kyt.hexToByteArray)(i.secretKey)} - } - return(0,Yyt.generateKeyPair)()} - catch(t){ - return Xyt.reportEvent(Qyt.OKXReportType.LOG,"cache_fail","cache failed"),(0,Yyt.generateKeyPair)()} - } - isWalletPKReady(){ - return Xyt.logDebug(`isWalletPKReady ===> ${ - this.connectedWalletPK} - `),this.connectedWalletPK.length>0} - makeJWT(t){ - return Byt(this,void 0,void 0,function*(){ - return yield(0,Yyt.signJWT)(t,Hyt.OKXCONNECTOR_JWT_SIDE,Hyt.OKXCONNECTOR_JWT_TTL,this.jwtKeyPair)} - )} - parsePackage(t){ - return Byt(this,arguments,void 0,function*(t,i=!1){ - var s,e,n,h,r,o,a,c,l,u,d,f,p; - if(this.events.emit(t.id,t),!i){ - yield this.sendACK(t.id,!0); - let i=null===(s=this.connectStorage.getItem($yt.OKXCONNECTOR_TOKEN_CACHE))||void 0===s?void 0:s.content; - if(i){ - let s=t; - if(null===(n=null===(e=s.params)||void 0===e?void 0:e.data)||void 0===n?void 0:n.messageId){ - s.method&&s.method===Fyt.CONNECT_METHOD_PUSH&&((0,Jyt.logDebug)("checkExpire: update expire when get push"),this.updateExpireLimit(i)); - let t=this.splitManager.tryParseMessageSplitPayload(null===(r=null===(h=s.params)||void 0===h?void 0:h.data)||void 0===r?void 0:r.message); - if(t){ - let e={ - topicId:null===(a=null===(o=s.params)||void 0===o?void 0:o.data)||void 0===a?void 0:a.topic,messageId:null===(l=null===(c=s.params)||void 0===c?void 0:c.data)||void 0===l?void 0:l.messageId,messageObject:t,publishedAt:null===(d=null===(u=s.params)||void 0===u?void 0:u.data)||void 0===d?void 0:d.publishedAt} - ,n=yield this.splitManager.onReceivedPackageCheck(e); - n.completeMessageIdList&&n.completeMessageIdList.forEach(t=>Byt(this,void 0,void 0,function*(){ - this.refreshPackageId(),yield this.sendReceive(this.packageId.toString(),t,i)} - ))} - else this.refreshPackageId(),yield this.sendReceive(this.packageId.toString(),null===(p=null===(f=s.params)||void 0===f?void 0:f.data)||void 0===p?void 0:p.messageId,i)} - } - } - } - )} - restoreConnect(t){ - return Byt(this,void 0,void 0,function*(){ - if(Xyt.reportLog("connection manager restore connection"),Xyt.logDebug(`connectionManager restoreConenct ${ - t} - `),"string"!=typeof t||0===t.length)throw new Error("CONNECTION: invalid topic"); - Xyt.logDebug("connectionManager restoreConenct disconnect"),yield this.disconnect(!0),this.connectStorage.saveContent(t,$yt.OKXCONNECTOR_TOKEN_CACHE),Xyt.logDebug("connectionManager restoreConenct conect"),yield this.connect(!0)} - )} - getConnectInfo(){ - var t=(0,Kyt.generateTopic)(); - return Xyt.logDebug(`generate topic token: ${ - t} - `),Xyt.reportLog("connection manager generate connection info"),this.currentTopic=t,{ - channelId:t,clientId:this.crypto.stringifyKeypair().publicKey} - } - connect(){ - return Byt(this,arguments,void 0,function*(t=!1){ - this.timeLog=(new Date).getTime(),(0,Jyt.logDebug)("ConnectTime---enter->",this.timeLog),Xyt.reportLog("connection manager begin connect"); - let i=this.connectStorage.getItem($yt.OKXCONNECTOR_TOKEN_CACHE); - var s=this.currentTopic; - if(Xyt.logDebug(`generate topic token: ${ - s} - `),t){ - null!=i&&(Xyt.logDebug(`read last connect id: ${ - i} - `),s=i.content); - var e=this.connectStorage.getItem($yt.OKXCONNECTOR_CRYPTO_SENDER_PK_CACHE); - e&&(this.connectedWalletPK=e.content,(0,Jyt.logDebug)(`connectionManager connect() this.connectedWalletPK : ${ - this.connectedWalletPK} - `)),Xyt.reportLog("connection manager do restore connection")} - if(t)try{ - const t=this.getCachedCryptoKeyPair(); - t&&(this.crypto=new zyt.SessionCrypto(t))} - catch(h){ - throw Xyt.logError("get crypto key pair from cache failed"),Xyt.reportEvent(Qyt.OKXReportType.LOG,"cache_fail","cache failed"),this.connectStorage.clearCache(),new Error("crypto cache failed")} - Xyt.logDebug(`use crypto client id: ${ - this.crypto.stringifyKeypair().publicKey} - `),this.connectStorage.saveContent(s,$yt.OKXCONNECTOR_TOKEN_CACHE); - var n=yield this.makeJWT(s); - return Xyt.logDebug(`generate jwt token: ${ - n} - `),this.connectStorage.saveContent(n,"jwt"),new Promise((i,e)=>{ - this.connector.onOpen(()=>Byt(this,void 0,void 0,function*(){ - Xyt.logDebug("1. connector on open"),Xyt.reportLog("1. connect ws open"); - const h=(new Date).getTime(); - (0,Jyt.logDebug)("ConnectTime---open->",h-this.timeLog),this.events.once(this.packageId.toString(),n=>Byt(this,void 0,void 0,function*(){ - if(n&&n.error){ - Xyt.logError("failed when login"),Xyt.reportLog("2. connect login failed"),yield this.connector.disconnect(); - var h=new Error; - h.message=n.error.message,h.name=n.error.code.toString(),e(h)} - this.refreshPackageId(),this.events.once(this.packageId.toString(),n=>Byt(this,void 0,void 0,function*(){ - if(n&&n.error){ - Xyt.logError("failed when subscribe"),Xyt.reportLog("3. connect subscribe failed"),yield this.connector.disconnect(); - var h=new Error; - h.message=n.error.message,h.name=n.error.code.toString(),e(h)} - this.refreshPackageId(),Xyt.logDebug(`4. subscribe callback then send fetch: ${ - this.packageId} - `),Xyt.reportLog("4. subscribe callback then send fetch"); - const r=(new Date).getTime(); - (0,Jyt.logDebug)("ConnectTime--subscribe callback->",r-this.timeLog),yield this.sendFetchAndConsumeMessages(this.packageId.toString(),s),Xyt.logDebug(`5. splitmanager init: ${ - this.packageId} - `),Xyt.reportLog("5. splitmanager init"),yield this.splitManager.init(this.sendRaw.bind(this)),t&&(this.checkExpire(s)?((0,Jyt.logDebug)("disconnect From topic expire"),setTimeout(()=>{ - this.activateDisconnect()} - ,1e3)):((0,Jyt.logDebug)("extends expire check"),this.updateExpireLimit(s))),i()} - )),Xyt.logDebug(`3. login callback then send subscribe: ${ - this.packageId} - `),Xyt.reportLog("3. connect subscribe failed"); - const r=(new Date).getTime(); - (0,Jyt.logDebug)("ConnectTime---login callback->",r-this.timeLog),yield this.connector.send(()=>Byt(this,void 0,void 0,function*(){ - Xyt.logDebug("CONNECT: reconnect before send"),yield this.connector.connect().catch(t=>{ - (0,Jyt.logDebug)("ConnectionManager connect error",t),e(t)} - )} - ),{ - id:this.packageId.toString(),jsonrpc:Wyt.CONNECT_JSONRPC_VER,method:Fyt.CONNECT_METHOD_SUB,params:{ - topic:s} - } - )} - )),Xyt.logDebug("2. login called"),Xyt.reportLog("2. connection manager connect call login"),yield this.connector.send(()=>Byt(this,void 0,void 0,function*(){ - Xyt.logDebug("CONNECT: reconnect before send"),yield this.connector.connect().catch(t=>{ - (0,Jyt.logDebug)("ConnectionManager connect error",t),e(t)} - )} - ),{ - id:this.packageId.toString(),jsonrpc:Wyt.CONNECT_JSONRPC_VER,method:Fyt.CONNECT_METHOD_LOGIN,params:{ - token:n} - } - ),this.connector.addPackageParse(t=>{ - var i; - if(Xyt.logDebug("connect: parse package"),Xyt.logDebug(t),!("params"in t)||!("data"in t.params))return void this.parsePackage(t,!0); - let s=null===(i=t.params.data)||void 0===i?void 0:i.message; - if(void 0!==s&&s.length>0){ - s=s.replace(/'/g,'"'); - let t=(0,qyt.safeJsonParse)(s); - "string"!=typeof t&&"clientId"in t&&t.clientId&&t.clientId.length>0&&(this.connectedWalletPK=t.clientId,Xyt.logDebug(`this.connectedWalletPK addPackageParse ${ - this.connectedWalletPK} - `),this.connectStorage.saveContent(this.connectedWalletPK,$yt.OKXCONNECTOR_CRYPTO_SENDER_PK_CACHE),this.saveCryptoKeyPair(this.crypto.stringifyKeypair()))} - this.parsePackage(t,t.method===Fyt.CONNECT_METHOD_RECEIVE)} - )} - )),this.connector.connect().catch(t=>{ - (0,Jyt.logDebug)("ConnectionManager connect error",t),e(t)} - ),this.connectorEnable=!0} - )} - )} - sendSubscribe(t){ - return Byt(this,void 0,void 0,function*(){ - this.refreshPackageId(),yield this.connector.send(()=>Byt(this,void 0,void 0,function*(){ - } - ),{ - id:this.packageId.toString(),jsonrpc:Wyt.CONNECT_JSONRPC_VER,method:Fyt.CONNECT_METHOD_SUB,params:{ - topic:t} - } - )} - )} - sendDisconnect(t){ - return Byt(this,void 0,void 0,function*(){ - return new Promise((i,s)=>Byt(this,void 0,void 0,function*(){ - if(this.refreshPackageId(),!this.connectorEnable)return Xyt.logDebug("skip disconnect before connected relay"),void i(); - this.events.once(this.packageId.toString(),t=>Byt(this,void 0,void 0,function*(){ - Xyt.logDebug("CONNECT: disconnect command send"),this.connectorEnable=!1,i()} - )); - const s={ - id:this.packageId.toString(),jsonrpc:Wyt.CONNECT_JSONRPC_VER,method:Fyt.CONNECT_METHOD_DISCONNECT,params:{ - message:{ - topic:t,ttl:Wyt.OKXCONNECTOR_MESSAGE_DISCONNECT_TTL} - } - } - ; - yield this.connector.send(()=>Byt(this,void 0,void 0,function*(){ - Xyt.logDebug("CONNECT: skip reconnect send")} - ),s)} - ))} - )} - sendRecvDisconnect(t){ - return Byt(this,void 0,void 0,function*(){ - this.refreshPackageId(); - const i={ - id:this.packageId.toString(),jsonrpc:Wyt.CONNECT_JSONRPC_VER,method:Fyt.CONNECT_METHOD_RECV_DISCONNECT,params:{ - topic:t} - } - ; - yield this.connector.send(()=>Byt(this,void 0,void 0,function*(){ - return Xyt.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()} - ),i)} - )} - disconnect(){ - return Byt(this,arguments,void 0,function*(t=!1){ - try{ - yield this.sendDisconnect(this.currentTopic)} - catch(i){ - Xyt.logError("send disconnect command failed",i)} - yield this.connector.disconnect(),Xyt.reportLog("connect disconnect"),this.connectStorage.clearCache($yt.OKXCONNECTOR_TOKEN_CACHE),t||(this.connectStorage.clearCache($yt.OKXCONNECTOR_CRYPTO_SENDER_PK_CACHE),this.connectedWalletPK="",(0,Jyt.logDebug)(`connectionManager disconnect() this.connectedWalletPK : ${ - this.connectedWalletPK} - `))} - )} - updateProtocolVersion(t,i){ - this.splitManager.updateTopicSenderVersion(t,i)} - addListener(t,i,s){ - this.connector.addListener((0,qyt.safeJsonStringify)(t),t=>{ - if(t=t.replace(/'/g,'"'),Xyt.logDebug(`addListener ===> ${ - t} - `),void 0!==t&&t.length>0){ - var i=(0,qyt.safeJsonParse)(t),s=i.message; - let e; - return s.trimStart().startsWith("{ - ")?e=s:(i.clientId&&i.clientId.length>0&&(this.connectedWalletPK=i.clientId,this.connectStorage.saveContent(this.connectedWalletPK,$yt.OKXCONNECTOR_CRYPTO_SENDER_PK_CACHE),Xyt.logDebug(`this.connectedWalletPK addListener ${ - this.connectedWalletPK} - `),Xyt.logDebug(`this.cryptoKey addListener ${ - (0,Kyt.toHexString)(this.crypto.keyPair.publicKey)} - `),this.saveCryptoKeyPair(this.crypto.stringifyKeypair())),e=this.crypto.decrypt(s,this.connectedWalletPK)),Xyt.logDebug(`addListener ===> ${ - e} - `),e} - } - ,i,s,t=>new Promise((i,s)=>Byt(this,void 0,void 0,function*(){ - let s=this.splitManager.tryParseMessageSplitPayload(t.message); - if(s){ - let e={ - topicId:t.topic,messageId:null==t?void 0:t.messageId,messageObject:s,publishedAt:null==t?void 0:t.publishedAt} - ,n=yield this.splitManager.onReceivedPackageCheck(e); - i(n)} - else i({ - isSplitPackage:!1} - )} - )))} - sendRaw(t){ - return Byt(this,void 0,void 0,function*(){ - Xyt.logDebug(`message send =====> ${ - t} - `),Xyt.reportLog("connect send raw msg"); - let i=t; - Xyt.logDebug(`message send =====encrypt message.length>>>> ${ - i.length} - `); - let s=this.connectStorage.getItem($yt.OKXCONNECTOR_TOKEN_CACHE); - Xyt.logDebug(`message send =====topic>>>> ${ - null==s?void 0:s.content} - `),this.refreshPackageId(); - const e={ - id:this.packageId.toString(),method:Fyt.CONNECT_METHOD_PUBLISH,jsonrpc:Wyt.CONNECT_JSONRPC_VER,params:{ - message:{ - topic:null==s?void 0:s.content,message:i,ttl:Wyt.OKXCONNECTOR_MESSAGE_TTL} - } - } - ; - return this.events.once(this.packageId.toString(),t=>Byt(this,void 0,void 0,function*(){ - t&&t.error?Xyt.logError(`@${ - (new Date).toUTCString()} - >>> failed when send msg`):t&&!t.error&&Xyt.logDebug(`CONNECTION @[${ - (new Date).toUTCString()} - ] >>> send msg with id ${ - this.packageId} - successed`)} - )),yield this.connector.send(()=>Byt(this,void 0,void 0,function*(){ - return Xyt.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()} - ),e),this.packageId} - )} - sendEncryptedMsg(t,i){ - return Byt(this,arguments,void 0,function*(t,i,s=Wyt.OKXCONNECTOR_MESSAGE_TTL){ - this.refreshPackageId(); - const e={ - id:this.packageId.toString(),method:Fyt.CONNECT_METHOD_PUBLISH,jsonrpc:Wyt.CONNECT_JSONRPC_VER,params:{ - message:{ - topic:t,message:i,ttl:s} - } - } - ; - this.events.once(this.packageId.toString(),t=>Byt(this,void 0,void 0,function*(){ - t&&t.error?Xyt.logError(`@${ - (new Date).toUTCString()} - >>> failed when send msg`):t&&!t.error&&Xyt.logDebug(`CONNECTION @[${ - (new Date).toUTCString()} - ] >>> send msg with id ${ - this.packageId} - successed`)} - )),yield this.connector.send(()=>Byt(this,void 0,void 0,function*(){ - return Xyt.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()} - ),e)} - )} - send(t){ - return Byt(this,arguments,void 0,function*(t,i=Wyt.OKXCONNECTOR_MESSAGE_TTL){ - if(Xyt.logDebug(`message send =====> ${ - t} - `),Xyt.reportLog("connect send msg"),!this.isWalletPKReady())throw new Error("connection not finish"); - let s=this.crypto.encrypt(t,this.connectedWalletPK); - Xyt.logDebug(`message send =====encrypt message.length>>>> ${ - s.length} - `),Xyt.reportEvent(Qyt.OKXReportType.LOG,"msg_size",s.length.toString()); - let e=this.connectStorage.getItem($yt.OKXCONNECTOR_TOKEN_CACHE); - return Xyt.logDebug(`message send =====topic>>>> ${ - null==e?void 0:e.content} - `),yield this.splitManager.sendSplitPackages(null==e?void 0:e.content,s,this.sendEncryptedMsg.bind(this),this.sendRaw.bind(this)),this.packageId} - )} - sendACK(t,i){ - return Byt(this,arguments,void 0,function*(t,i,s=void 0){ - if(!0===i){ - const i={ - id:t,jsonrpc:Wyt.CONNECT_JSONRPC_VER,result:!0} - ; - yield this.connector.send(()=>Byt(this,void 0,void 0,function*(){ - return Xyt.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()} - ),i)} - else if(s){ - const i={ - id:t,jsonrpc:Wyt.CONNECT_JSONRPC_VER,error:{ - code:s.code,message:s.message} - } - ; - yield this.connector.send(()=>Byt(this,void 0,void 0,function*(){ - return Xyt.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()} - ),i)} - } - )} - sendReceive(t,i,s){ - return Byt(this,void 0,void 0,function*(){ - const e={ - id:t,jsonrpc:Wyt.CONNECT_JSONRPC_VER,method:Fyt.CONNECT_METHOD_RECEIVE,params:{ - data:{ - messageId:i,topic:s} - } - } - ; - yield this.connector.send(()=>Byt(this,void 0,void 0,function*(){ - return Xyt.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()} - ),e)} - )} - sendFetchAndConsumeMessages(t,i){ - return Byt(this,void 0,void 0,function*(){ - this.events.once(t,t=>Byt(this,void 0,void 0,function*(){ - var s,e; - if(t.result){ - var n=t.result.hasMore,h=t.result.data; - const s=t.result.disconnectedTopics; - if(s)try{ - for(let t=0; - t<s.length; - t++){ - const i=s[t]; - if(i.topic){ - (0,Jyt.logDebug)("send receive disconnect:",i.topic),yield this.sendRecvDisconnect(i.topic); - let t=(0,qyt.safeJsonStringify)({ - requestId:i.publishedAt.toString(),method:"disconnect"} - ),s={ - messageId:i.publishedAt.toString(),message:(0,qyt.safeJsonStringify)({ - message:t} - ),topic:i.topic,publishedAt:i.publishedAt} - ; - yield this.connector.getMsgPayloadFromHistory(s)} - } - } - catch(r){ - Xyt.logError("disconnect topic fails",r)} - if(h)for(let t=0; - t<h.length; - t++){ - let s=h[t]; - if(s&&s.topic==i){ - let t=s.messageId; - Xyt.reportLog("5. get fetch result"),this.splitManager.tryParseMessageSplitPayload(s.message)?(yield this.connector.getMsgPayloadFromHistory(s),Xyt.logDebug("skip receive")):(yield this.connector.getMsgPayloadFromHistory(s),this.refreshPackageId(),yield this.sendReceive(this.packageId.toString(),t,i))} - } - n&&(this.refreshPackageId(),yield this.sendFetchAndConsumeMessages(this.packageId.toString(),i))} - else Xyt.logDebug(`CONNECT: get error rsp ${ - null===(s=t.error)||void 0===s?void 0:s.code} - : ${ - null===(e=t.error)||void 0===e?void 0:e.message} - `)} - )),Xyt.logDebug("5. send fetch more"),Xyt.reportLog("5. send fetch more"); - const s=(new Date).getTime(); - (0,Jyt.logDebug)("ConnectTime---5->",s-this.timeLog); - const e={ - id:t,jsonrpc:Wyt.CONNECT_JSONRPC_VER,method:Fyt.CONNECT_METHOD_FETCHMSG,params:{ - data:{ - topic:i} - } - } - ; - yield this.connector.send(()=>Byt(this,void 0,void 0,function*(){ - return Xyt.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()} - ),e)} - )} - cleanCache(){ - Xyt.reportLog("connection cache clean called"),this.connectStorage.clearCache()} - saveSessionContent(t,i){ - i||this.connectStorage.clearCache($yt.OKXCONNECTOR_SESSION_PREFIX_KEY+t); - let s=(0,qyt.safeJsonStringify)(i); - this.connectStorage.encryptStoreMsg(s,$yt.OKXCONNECTOR_SESSION_PREFIX_KEY+t)} - getSessionContent(t){ - try{ - let i=this.connectStorage.getAndDecrypt($yt.OKXCONNECTOR_SESSION_PREFIX_KEY+t); - if(i)return(0,qyt.safeJsonParse)(i)} - catch(i){ - this.connectStorage.clearCache($yt.OKXCONNECTOR_SESSION_PREFIX_KEY+t)} - } - getCurrentConnectionReady(){ - let t=!1; - try{ - this.getCachedCryptoKeyPair()&&(t=!0)} - catch(i){ - Xyt.logError("check connection ready failed")} - return this.isWalletPKReady()&&t} - getCryptoKeyEnable(){ - let t=!1; - try{ - this.getCachedCryptoKeyPair()&&(t=!0)} - catch(i){ - Xyt.logError("check connection ready failed")} - return t} - checkExpire(t){ - let i=!1; - if(0==t.length)return(0,Jyt.logDebug)("checkExpire: invalid topic"),i; - let s=this.getSessionContent($yt.OKXCONNECTOR_STORAGE_TOPIC_EXPIRE_CACHE); - return s&&s.topic?s.topic==t?Date.now()>s.timestamp&&((0,Jyt.logDebug)("checkExpire: connection is Expired"),i=!0):((0,Jyt.logDebug)("checkExpire: not same connection"),i=!1):((0,Jyt.logDebug)("checkExpire: not topic records"),this.updateExpireLimit(t),i=!1),i} - updateExpireLimit(t){ - (0,Jyt.logDebug)(`update expire limit for topic: ${ - t} - `); - let i={ - topic:t,timestamp:Date.now()+Wyt.OKXCONNECTOR_SESSION_LIVE_TTL} - ; - this.saveSessionContent($yt.OKXCONNECTOR_STORAGE_TOPIC_EXPIRE_CACHE,i)} - activateDisconnect(){ - return Byt(this,void 0,void 0,function*(){ - let t=(0,qyt.safeJsonStringify)({ - requestId:"",method:"disconnect"} - ),i={ - messageId:"",message:(0,qyt.safeJsonStringify)({ - message:t} - ),topic:this.currentTopic,publishedAt:0} - ; - yield this.connector.getMsgPayloadFromHistory(i)} - )} - } - ; - Qt(iEt,"ConnectionManager"); - let sEt=iEt; - zbt.ConnectionManager=sEt; - var eEt={ - } - ,nEt={ - } - ; - Object.defineProperty(nEt,"__esModule",{ - value:!0} - ),nEt.WalletConnectionManagerEvent=nEt.WalletConnectionManagerTopicInfoCacheKey=void 0,nEt.WalletConnectionManagerTopicInfoCacheKey="wcmtic",nEt.WalletConnectionManagerEvent={ - RECEIVE_REQUEST:"payload"} - ; - var hEt=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),rEt=pi&&pi.__setModuleDefault||(Object.create?function(t,i){ - Object.defineProperty(t,"default",{ - enumerable:!0,value:i} - )} - :function(t,i){ - t.default=i} - ),oEt=pi&&pi.__importStar||function(){ - var t=Qt(function(i){ - return(t=Object.getOwnPropertyNames||function(t){ - var i=[]; - for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[i.length]=s); - return i} - )(i)} - ,"ownKeys"); - return function(i){ - if(i&&i.__esModule)return i; - var s={ - } - ; - if(null!=i)for(var e=t(i),n=0; - n<e.length; - n++)"default"!==e[n]&&hEt(s,i,e[n]); - return rEt(s,i),s} - } - (),aEt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(eEt,"__esModule",{ - value:!0} - ),eEt.WalletConnectionManager=void 0; - const cEt=ygt,lEt=Ybt,uEt=Agt,dEt=qbt,fEt=Egt,pEt=nEt,wEt=vyt,gEt=MMt,mEt=Sgt,vEt=vbt(),_Et=Xbt,MEt=syt,bEt=dbt(),yEt=oEt(ubt()),EEt=ubt(),AEt=rbt(),SEt=class{ - constructor(){ - this.events=new gEt.EventEmitter,this.communicateEvents=new gEt.EventEmitter,this.splitManager=new wEt.ConnectionSplitPackages("wallet"),yEt.logDebug("connect manager construct"),this.connectStorage=new mEt.Storage(uEt.OKXCONNECTOR_CACHE_KEY),this.jwtKeyPair=this.getCachedJWTKeyPair(),this.saveJWTKeyPair(this.jwtKeyPair),this.connector=new cEt.OKXWalletConnector(fEt.OKXCONNECTOR_WS_URL_1),this.packageId=Date.now(),this.sessionCryptoInfoMap=new Map,this.inLogin=!1,this.isLogined=!1} - refreshPackageId(t=0){ - let i=Date.now()+t; - i==this.packageId&&(this.packageId=i+1),this.packageId=i} - saveCryptoKeyPair(t,i){ - let s=(0,bEt.safeJsonStringify)(i); - this.connectStorage.encryptStoreMsg(s,uEt.OKXCONNECTOR_CRYPTO_KEY+t)} - getCachedCryptoKeyPair(t){ - const i=this.connectStorage.getAndDecrypt(uEt.OKXCONNECTOR_CRYPTO_KEY+t); - return"string"==typeof i?(yEt.logDebug("get cached crypto key:"),yEt.logDebug(i),(0,bEt.safeJsonParse)(i)):(this.connectStorage.clearCache(),null)} - saveJWTKeyPair(t){ - var i={ - publicKey:(0,vEt.toHexString)(t.publicKey),secretKey:(0,vEt.toHexString)(t.secretKey)} - ; - yEt.logDebug("save jwt kp"); - let s=(0,bEt.safeJsonStringify)(i); - yEt.logDebug(s),this.connectStorage.encryptStoreMsg(s,uEt.OKXCONNECTOR_JWT_KEY),yEt.logDebug("after save jwt kp")} - getCachedJWTKeyPair(){ - const t=this.connectStorage.getAndDecrypt(uEt.OKXCONNECTOR_JWT_KEY); - if("string"==typeof t){ - yEt.logDebug("get cached jwt kp:"),yEt.logDebug(t); - let i=(0,bEt.safeJsonParse)(t); - return yEt.logDebug("save jwt kp"),yEt.logDebug(i),{ - publicKey:(0,vEt.hexToByteArray)(i.publicKey),secretKey:(0,vEt.hexToByteArray)(i.secretKey)} - } - return(0,MEt.generateKeyPair)()} - isTopicPublicKeyExist(t){ - return yEt.logDebug(`isTopicPublicKeyExist ===> ${ - t} - `),this.sessionCryptoInfoMap.get(t)} - makeJWT(t){ - return aEt(this,void 0,void 0,function*(){ - return yield(0,MEt.signJWT)(t,dEt.OKXCONNECTOR_JWT_WALLET_SIDE,dEt.OKXCONNECTOR_JWT_TTL,this.jwtKeyPair)} - )} - parseInternalMsg(t){ - try{ - let i=(0,bEt.safeJsonParse)(t)["ivur-igbfft-ptjip"]; - if(i&&i.length>0)return(0,AEt.base64decode)(i,!0).toString()} - catch(i){ - yEt.logError("parse internal msg",i)} - } - updateClientId(t,i){ - let s=this.sessionCryptoInfoMap.get(t); - if((0,EEt.logDebug)("updateClientId",s,t,i),s&&i&&i.length>0){ - if(s.cid){ - let e=(0,vEt.getLastSixMd5Hash)(i); - s.cid==e?s.dappPublicKey=i:yEt.logError("cid check failed",s,t,i)} - else s.dappPublicKey=i; - this.syncCacheSessionInfo()} - return!1} - parsePackage(t,i){ - return aEt(this,arguments,void 0,function*(t,i,s=!1){ - var e,n,h,r,o,a,c,l,u,d,f,p,w,g,m,v,_; - this.events.emit(i.id,i); - let M=this.sessionCryptoInfoMap.get(t); - yEt.logDebug("get sessionInfo for decrypt topic:",t),yEt.logDebug("get sessionInfo for decrypt:",i.id,t,M,this.sessionCryptoInfoMap); - let b=!1; - if(M&&i.params.data&&(null===(e=i.params.data)||void 0===e?void 0:e.message))if(null===(n=i.params.data)||void 0===n?void 0:n.isInternalData){ - let t=null===(h=i.params.data)||void 0===h?void 0:h.message,s=null===(r=i.params.data)||void 0===r?void 0:r.topic,e=this.parseInternalMsg(t); - (0,EEt.logDebug)("parse internal origin: ",e),e&&e.length>0&&this.communicateEvents.emit("origin",e,s)} - else try{ - let s=null===(o=i.params.data)||void 0===o?void 0:o.message; - if(i.method&&i.method===lEt.CONNECT_METHOD_PUSH&&((0,EEt.logDebug)("checkExpire: update expire when get push"),this.updateExpireLimit(t)),s.trimStart().startsWith("{ - ")){ - let e=this.splitManager.tryParseMessageSplitPayload(s); - if(e){ - (0,EEt.logDebug)("parse split msg object: ",e),b=!0; - let s={ - topicId:null===(c=null===(a=i.params)||void 0===a?void 0:a.data)||void 0===c?void 0:c.topic,messageId:null===(u=null===(l=i.params)||void 0===l?void 0:l.data)||void 0===u?void 0:u.messageId,messageObject:e,publishedAt:null===(f=null===(d=i.params)||void 0===d?void 0:d.data)||void 0===f?void 0:f.publishedAt} - ,n=yield this.splitManager.onReceivedPackageCheck(s); - if(n.completeMessageIdList&&n.completeMessageIdList.forEach(i=>aEt(this,void 0,void 0,function*(){ - this.refreshPackageId(),yield this.sendReceive(this.packageId.toString(),i,t)} - )),n.finalMessage){ - let i=M.crypto.decryptWallet(n.finalMessage,M.dappPublicKey); - (0,EEt.logDebug)("<<< receive msg from split:",t,i),this.communicateEvents.emit(t,i)} - } - else{ - let i=(0,bEt.safeJsonParse)(s); - if(i.method){ - if("session_info"==i.method){ - let s=i.params.sessionInfo,e=(0,AEt.base64decode)(s,!1); - (0,EEt.logDebug)("wallet connection manager requset base64Content:",e),(0,EEt.logDebug)("base64Content:"+e); - let n=e.toObject(); - this.updateClientId(t,n.clientId)} - (0,EEt.logDebug)("<<< parse raw msg:",t,i),this.communicateEvents.emit(t,s)} - } - } - else{ - let s=M.crypto.decryptWallet(null===(p=i.params.data)||void 0===p?void 0:p.message,M.dappPublicKey); - (0,EEt.logDebug)("<<< receive msg:",t,s),this.communicateEvents.emit(t,s)} - } - catch(y){ - let s=M.crypto.decryptWallet(null===(w=i.params.data)||void 0===w?void 0:w.message,M.dappPublicKey); - (0,EEt.logDebug)("<<< receive msg:",t,s),this.communicateEvents.emit(t,s)} - if(!s&&(yield this.sendACK(i.id,!0),t&&!b)){ - let s=i; - (null===(m=null===(g=s.params)||void 0===g?void 0:g.data)||void 0===m?void 0:m.messageId)&&(this.refreshPackageId(),yield this.sendReceive(this.packageId.toString(),null===(_=null===(v=s.params)||void 0===v?void 0:v.data)||void 0===_?void 0:_.messageId,t))} - } - )} - recovrySessionInfoFromCache(){ - let t=this.connectStorage.getAndDecrypt(pEt.WalletConnectionManagerTopicInfoCacheKey); - if(yEt.logDebug("get cached sessionInfos:",t),t){ - let i=(0,bEt.safeJsonParse)(t); - for(let t in i){ - let s=i[t]; - yEt.logDebug("make topicItem:",s); - let e={ - topic:t,crypto:new _Et.SessionCrypto({ - publicKey:s.cryptoKeyPair.publicKey,secretKey:s.cryptoKeyPair.secretKey} - ),dappPublicKey:s.dappPublicKey,cid:s.cid} - ; - this.sessionCryptoInfoMap.set(t,e)} - } - yEt.logDebug("get cached sessionInfos map:",this.sessionCryptoInfoMap)} - syncCacheSessionInfo(){ - let t={ - } - ; - for(let[s,e]of this.sessionCryptoInfoMap)yEt.logDebug("for each Keys",s),e&&(t[s]={ - cryptoKeyPair:e.crypto.stringifyKeypair(),dappPublicKey:e.dappPublicKey,cid:e.cid} - ); - let i=(0,bEt.safeJsonStringify)(t); - yEt.logDebug("sync cache sessionInfos:",i),this.connectStorage.encryptStoreMsg(i,pEt.WalletConnectionManagerTopicInfoCacheKey)} - cacheSessionInfo(t,i,s=!0){ - let e=i.dappPublicKey,n=[]; - for(let[h,r]of this.sessionCryptoInfoMap)yEt.logDebug("for each Keys",h),r.dappPublicKey==e&&(yEt.logDebug("duplicated dapp public key:",h,e),n.push(h)); - for(let[h,r]of this.sessionCryptoInfoMap)n.includes(h)&&this.sessionCryptoInfoMap.delete(h); - return yEt.logDebug("cleaned connect session cache:",this.sessionCryptoInfoMap),this.sessionCryptoInfoMap.set(t,i),yEt.logDebug("cache sessionInfo:",t,i,this.sessionCryptoInfoMap),s&&this.syncCacheSessionInfo(),n} - updateProtocolVersion(t,i){ - this.splitManager.updateTopicSenderVersion(t,i)} - appendTopic(t,i,s){ - return aEt(this,void 0,void 0,function*(){ - return(0,EEt.logDebug)("4.1. get append Topic:",t),new Promise((e,n)=>aEt(this,void 0,void 0,function*(){ - if(!this.isLogined){ - var h=new Error; - return h.message="connection is not logined",h.name="append error",void n(h)} - let r={ - topic:t,crypto:new _Et.SessionCrypto,dappPublicKey:i||"",cid:s} - ,o=this.cacheSessionInfo(t,r,!1); - yield this.subscribeTopics(Array.from([t])),this.refreshPackageId(),yEt.logDebug(`5. subscribe callback then fetch append message: ${ - this.packageId} - , ${ - t} - `),yEt.reportLog("5. subscribe callback then fetch append message"); - const a=(new Date).getTime(); - (0,EEt.logDebug)("Append --subscribe callback->",a-this.timeLog),e(o)} - ))} - )} - confirmAppendingTopics(){ - this.syncCacheSessionInfo()} - connect(){ - return aEt(this,void 0,void 0,function*(){ - this.timeLog=(new Date).getTime(),(0,EEt.logDebug)("[Wallet] ConnectTime---enter->",this.timeLog),yEt.reportLog("wallet connect connect called"); - let t=Date.now().toString(); - var i=yield this.makeJWT(t); - return yEt.logDebug(`generate jwt token: ${ - i} - `),this.connectStorage.saveContent(i,"jwt"),this.recovrySessionInfoFromCache(),new Promise((t,s)=>{ - this.inLogin=!0,this.connector.onOpen(()=>aEt(this,void 0,void 0,function*(){ - yEt.logDebug("1. connector on open"),yEt.reportLog("1. wallet connect connect on open"); - const e=(new Date).getTime(); - (0,EEt.logDebug)("ConnectTime---open->",e-this.timeLog),this.events.once(this.packageId.toString(),i=>aEt(this,void 0,void 0,function*(){ - if(i&&i.error){ - yEt.logError("failed when login"),yield this.connector.disconnect(); - var e=new Error; - e.message=i.error.message,e.name=i.error.code.toString(),s(e)} - else this.isLogined=!0,t(),yEt.logDebug("3. subscribe cached topics",this.sessionCryptoInfoMap),yEt.reportLog("3. wallet connect connect subscribe cached topics"),this.sessionCryptoInfoMap.size>0&&(yield this.subscribeTopics(Array.from(this.sessionCryptoInfoMap.keys())))} - )),yEt.logDebug("2. login called"),yEt.reportLog("2. wallet connect login called"),yield this.connector.send(()=>aEt(this,void 0,void 0,function*(){ - return yEt.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()} - ),{ - id:this.packageId.toString(),jsonrpc:fEt.CONNECT_JSONRPC_VER,method:lEt.CONNECT_METHOD_LOGIN,params:{ - token:i} - } - )} - )),this.connector.connect().catch(t=>{ - (0,EEt.logDebug)("WalletConnectionManager connect error",t),s(t)} - ),this.connector.addPackageParse(t=>{ - var i,s; - yEt.logDebug("connect: parse package"),yEt.logDebug(t),"params"in t&&"data"in t.params?(null===(i=t.params.data)||void 0===i?void 0:i.topic)&&this.parsePackage(null===(s=t.params.data)||void 0===s?void 0:s.topic,t,t.method===lEt.CONNECT_METHOD_RECEIVE):this.parsePackage("",t,!0)} - )} - )} - )} - getSessionPublicKey(t){ - if(this.isTopicPublicKeyExist(t)){ - let i=this.sessionCryptoInfoMap.get(t); - if(i)return(0,vEt.toHexString)(i.crypto.keyPair.publicKey)} - } - getCurrentCachedTopicIdList(){ - return Array.from(this.sessionCryptoInfoMap.keys())} - sendDisconnect(t){ - return aEt(this,void 0,void 0,function*(){ - this.refreshPackageId(); - const i={ - id:this.packageId.toString(),jsonrpc:fEt.CONNECT_JSONRPC_VER,method:lEt.CONNECT_METHOD_DISCONNECT,params:{ - message:{ - topic:t,ttl:fEt.OKXCONNECTOR_MESSAGE_DISCONNECT_TTL} - } - } - ; - yield this.connector.send(()=>aEt(this,void 0,void 0,function*(){ - return yEt.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()} - ),i)} - )} - sendRecvDisconnect(t){ - return aEt(this,void 0,void 0,function*(){ - this.refreshPackageId(); - const i={ - id:this.packageId.toString(),jsonrpc:fEt.CONNECT_JSONRPC_VER,method:lEt.CONNECT_METHOD_RECV_DISCONNECT,params:{ - topic:t} - } - ; - yield this.connector.send(()=>aEt(this,void 0,void 0,function*(){ - return yEt.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()} - ),i)} - )} - disconnect(){ - return aEt(this,arguments,void 0,function*(t=!1){ - yield this.connector.disconnect(),this.connectStorage.clearCache(uEt.OKXCONNECTOR_TOKEN_CACHE),t||this.connectStorage.clearCache(uEt.OKXCONNECTOR_CRYPTO_SENDER_PK_CACHE)} - )} - sendRaw(t,i){ - return aEt(this,void 0,void 0,function*(){ - i&&(yield this.sendMsg(i,t,fEt.OKXCONNECTOR_MESSAGE_TTL))} - )} - sendMsg(t,i,s){ - return aEt(this,void 0,void 0,function*(){ - if(i){ - this.refreshPackageId(); - const e={ - id:this.packageId.toString(),method:lEt.CONNECT_METHOD_PUBLISH,jsonrpc:fEt.CONNECT_JSONRPC_VER,params:{ - message:{ - topic:t,message:i,ttl:s} - } - } - ; - this.events.once(this.packageId.toString(),t=>aEt(this,void 0,void 0,function*(){ - t&&t.error?yEt.logError(`@${ - (new Date).toUTCString()} - >>> failed when send msg`):t&&!t.error&&yEt.logDebug(`CONNECTION @[${ - (new Date).toUTCString()} - ] >>> send msg with id ${ - this.packageId} - successed`)} - )),yield this.connector.send(()=>aEt(this,void 0,void 0,function*(){ - return yEt.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()} - ),e)} - } - )} - send(t,i){ - return aEt(this,arguments,void 0,function*(t,i,s=!1,e=fEt.OKXCONNECTOR_MESSAGE_TTL,n=!1){ - var h,r; - if(yEt.logDebug(`message send =====> ${ - i} - `),!this.isTopicPublicKeyExist(t))throw new Error("connection not finish"); - let o,a=null===(h=this.sessionCryptoInfoMap.get(t))||void 0===h?void 0:h.dappPublicKey,c=null===(r=this.sessionCryptoInfoMap.get(t))||void 0===r?void 0:r.crypto; - n&&(o={ - message:i} - ); - let l=!1; - if(c&&a&&!n&&(l=!0,o={ - message:c.encryptWallet(i,a)} - ),o){ - s&&c&&(o.clientId=(0,vEt.toHexString)(c.keyPair.publicKey)); - let i=(0,bEt.safeJsonStringify)(o); - !n&&l?yield this.splitManager.sendSplitPackages(t,i,this.sendMsg.bind(this),this.sendRaw.bind(this)):yield this.sendMsg(t,i,e)} - } - )} - sendACK(t,i){ - return aEt(this,arguments,void 0,function*(t,i,s=void 0){ - if(!0===i){ - const i={ - id:t,jsonrpc:fEt.CONNECT_JSONRPC_VER,result:!0} - ; - yield this.connector.send(()=>aEt(this,void 0,void 0,function*(){ - return yEt.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()} - ),i)} - else if(s){ - const i={ - id:t,jsonrpc:fEt.CONNECT_JSONRPC_VER,error:{ - code:s.code,message:s.message} - } - ; - yield this.connector.send(()=>aEt(this,void 0,void 0,function*(){ - return yEt.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()} - ),i)} - } - )} - sendReceive(t,i,s){ - return aEt(this,void 0,void 0,function*(){ - const e={ - id:t,jsonrpc:fEt.CONNECT_JSONRPC_VER,method:lEt.CONNECT_METHOD_RECEIVE,params:{ - data:{ - messageId:i,topic:s} - } - } - ; - yield this.connector.send(()=>aEt(this,void 0,void 0,function*(){ - return yEt.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()} - ),e)} - )} - sendUnsubscribe(t){ - return aEt(this,void 0,void 0,function*(){ - yield this.connector.send(()=>aEt(this,void 0,void 0,function*(){ - return yEt.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()} - ),{ - id:this.packageId.toString(),jsonrpc:fEt.CONNECT_JSONRPC_VER,method:lEt.CONNECT_METHOD_UNSUB,params:{ - topic:t} - } - ); - try{ - yield this.sendDisconnect(t)} - catch(i){ - yEt.logError("send disconnect command failed",i)} - this.sessionCryptoInfoMap.delete(t),this.syncCacheSessionInfo()} - )} - sendFetchAndConsumeMessages(t,i){ - return aEt(this,void 0,void 0,function*(){ - this.events.once(t,t=>aEt(this,void 0,void 0,function*(){ - var s,e; - if(t.result){ - var n=t.result.hasMore,h=t.result.data; - if(h)for(let t=0; - t<h.length; - t++){ - let s=h[t]; - if(s&&s.topic==i){ - let t=s.messageId; - yield this.connector.getMsgPayloadFromHistory(s),this.refreshPackageId(),yield this.sendReceive(this.packageId.toString(),t,i)} - } - n&&(this.refreshPackageId(),yield this.sendFetchAndConsumeMessages(this.packageId.toString(),i))} - else yEt.logDebug(`CONNECT: get error rsp ${ - null===(s=t.error)||void 0===s?void 0:s.code} - : ${ - null===(e=t.error)||void 0===e?void 0:e.message} - `)} - )),yEt.logDebug("5. send fetch more"); - const s=(new Date).getTime(); - (0,EEt.logDebug)("ConnectTime---5->",s-this.timeLog); - const e={ - id:t,jsonrpc:fEt.CONNECT_JSONRPC_VER,method:lEt.CONNECT_METHOD_FETCHMSG,params:{ - data:{ - topic:i} - } - } - ; - yield this.connector.send(()=>aEt(this,void 0,void 0,function*(){ - return yEt.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()} - ),e)} - )} - sendBatchFetchAndConsumeMessages(t,i){ - return aEt(this,void 0,void 0,function*(){ - this.events.once(t,t=>aEt(this,void 0,void 0,function*(){ - var s,e; - if(t.result){ - var n=t.result.hasMore,h=t.result.data; - const s=t.result.disconnectedTopics; - if(s)try{ - for(let t=0; - t<s.length; - t++){ - const i=s[t]; - if(i.topic){ - (0,EEt.logDebug)("send receive disconnect:",i.topic),yield this.sendRecvDisconnect(i.topic); - let t=(0,bEt.safeJsonStringify)({ - requestId:i.publishedAt.toString(),method:lEt.CONNECT_METHOD_DISCONNECT} - ),s={ - messageId:i.publishedAt.toString(),message:(0,bEt.safeJsonStringify)({ - message:t} - ),topic:i.topic,publishedAt:i.publishedAt} - ; - yield this.connector.getMsgPayloadFromHistory(s)} - } - } - catch(r){ - yEt.logError("disconnect topic fails",r)} - if(h)for(let t=0; - t<h.length; - t++){ - let i=h[t]; - if(i&&i.topic)if(this.splitManager.tryParseMessageSplitPayload(i.message))yield this.connector.getMsgPayloadFromHistory(i); - else{ - let s=i.messageId; - yield this.connector.getMsgPayloadFromHistory(i),this.refreshPackageId(t),yield this.sendReceive(this.packageId.toString(),s,i.topic)} - } - n&&(this.refreshPackageId(),yield this.sendBatchFetchAndConsumeMessages(this.packageId.toString(),i))} - else yEt.logDebug(`CONNECT: get error rsp ${ - null===(s=t.error)||void 0===s?void 0:s.code} - : ${ - null===(e=t.error)||void 0===e?void 0:e.message} - `)} - )),yEt.logDebug("5. send fetch more"),yEt.reportLog("5. send fetch more"); - const s=(new Date).getTime(); - (0,EEt.logDebug)("ConnectTime---5->",s-this.timeLog); - const e={ - id:t,jsonrpc:fEt.CONNECT_JSONRPC_VER,method:lEt.CONNECT_METHOD_BATCH_FETCHMSG,params:{ - topics:i,withInternalData:!0} - } - ; - yield this.connector.send(()=>aEt(this,void 0,void 0,function*(){ - yEt.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()} - ),e)} - )} - cleanCache(){ - return aEt(this,void 0,void 0,function*(){ - this.connectStorage.clearCache()} - )} - saveSessionContent(t,i){ - i||this.connectStorage.clearCache(uEt.OKXCONNECTOR_SESSION_PREFIX_KEY+t); - let s=(0,bEt.safeJsonStringify)(i); - this.connectStorage.encryptStoreMsg(s,uEt.OKXCONNECTOR_SESSION_PREFIX_KEY+t)} - getSessionContent(t){ - let i=this.connectStorage.getAndDecrypt(uEt.OKXCONNECTOR_SESSION_PREFIX_KEY+t); - if(i)return(0,bEt.safeJsonParse)(i)} - subscribeTopics(t){ - return aEt(this,void 0,void 0,function*(){ - (0,EEt.logDebug)("4. topicid list",t),yEt.reportLog("4. topicid list"),this.refreshPackageId(); - const i=(new Date).getTime(); - return(0,EEt.logDebug)("ConnectTime--subscribe callback->",i-this.timeLog),new Promise((i,s)=>aEt(this,void 0,void 0,function*(){ - let s=0; - for(let e=0; - e<t.length; - ++e){ - let n=t[e]; - this.refreshPackageId(e),this.events.once(this.packageId.toString(),h=>aEt(this,void 0,void 0,function*(){ - if(h&&h.error){ - yEt.logError("failed when subscribe"),yield this.connector.disconnect(); - var r=new Error; - r.message=h.error.message,r.name=h.error.code.toString(),s+=1,s==t.length&&i()} - this.refreshPackageId(e); - const o=(new Date).getTime(); - (0,EEt.logDebug)("ConnectTime--subscribe callback->",o-this.timeLog),s+=1,s==t.length&&(yEt.logDebug(`5. send fetch msg: ${ - this.packageId} - , ${ - n} - `),yield this.sendBatchFetchAndConsumeMessages(this.packageId.toString(),t),yield this.splitManager.init(this.sendRaw.bind(this)),this.checkExpire(n)?((0,EEt.logDebug)("disconnect From topic expire"),yield this.activateDisconnect(n)):((0,EEt.logDebug)("extends expire check"),this.updateExpireLimit(n)),i())} - )),yEt.logDebug(`3. login callback then send subscribe: ${ - this.packageId} - , ${ - n} - `),yEt.reportLog("3. login callback then send subscribe"); - const h=(new Date).getTime(); - (0,EEt.logDebug)("ConnectTime---login callback->",h-this.timeLog),yield this.connector.send(()=>aEt(this,void 0,void 0,function*(){ - return yEt.logDebug("CONNECT: reconnect before send"),yield this.connector.connect()} - ),{ - id:this.packageId.toString(),jsonrpc:fEt.CONNECT_JSONRPC_VER,method:lEt.CONNECT_METHOD_SUB,params:{ - topic:n} - } - )} - } - ))} - )} - checkExpire(t){ - let i=!1; - if(0==t.length)return(0,EEt.logDebug)("checkExpire: invalid topic"),i; - let s=this.getSessionContent(uEt.OKXCONNECTOR_STORAGE_TOPIC_WALLET_EXPIRE_CACHE); - if(s&&s instanceof Object)try{ - let e=new Map(Object.entries(s)).get(t); - e?Date.now()>e&&((0,EEt.logDebug)("checkExpire: connection is Expired"),i=!0):((0,EEt.logDebug)("checkExpire: not same connection"),i=!1)} - catch(e){ - (0,EEt.logDebug)("checkExpire: cache error"),i=!1} - else(0,EEt.logDebug)("checkExpire: not topic records"),this.updateExpireLimit(t),i=!1; - return i} - updateExpireLimit(t){ - (0,EEt.logDebug)(`update expire limit for topic: ${ - t} - `); - try{ - let i=this.getSessionContent(uEt.OKXCONNECTOR_STORAGE_TOPIC_WALLET_EXPIRE_CACHE),s=new Map; - i&&(s=new Map(Object.entries(i))); - let e=Date.now()+fEt.OKXCONNECTOR_SESSION_LIVE_TTL; - s.set(t,e),this.saveSessionContent(uEt.OKXCONNECTOR_STORAGE_TOPIC_WALLET_EXPIRE_CACHE,Object.fromEntries(s))} - catch(i){ - (0,EEt.logDebug)("update cache failed")} - } - activateDisconnect(t){ - return aEt(this,void 0,void 0,function*(){ - let i=(0,bEt.safeJsonStringify)({ - requestId:"",method:lEt.CONNECT_METHOD_DISCONNECT} - ),s={ - messageId:"",message:(0,bEt.safeJsonStringify)({ - message:i} - ),topic:t,publishedAt:0} - ; - yield this.connector.getMsgPayloadFromHistory(s)} - )} - } - ; - Qt(SEt,"WalletConnectionManager"); - let TEt=SEt; - eEt.WalletConnectionManager=TEt; - var CEt={ - } - ,OEt={ - } - ; - Object.defineProperty(OEt,"__esModule",{ - value:!0} - ),OEt.CONNECTOR_TYPE=OEt.STANDARD_INJECT_WALLET=OEt.OKX_TG_WALLET=OEt.OKX_APP_COMMON_WALLET=OEt.OKX_WALLET_APP_WALLET=OEt.OKX_APP_WALLET=OEt.OKX_INJECT_WALLET=void 0; - const IEt=U_t,kEt=DMt; - OEt.OKX_INJECT_WALLET=kEt.OKXInjectWalletName,OEt.OKX_APP_WALLET=IEt.OKXWalletName,OEt.OKX_WALLET_APP_WALLET=IEt.OKXWalletName,OEt.OKX_APP_COMMON_WALLET=IEt.OKXWalletName,OEt.OKX_TG_WALLET=kEt.OKXMiniWalletName,OEt.STANDARD_INJECT_WALLET="standard_inject_wallet",OEt.CONNECTOR_TYPE={ - NOT_INSTALLED:-1,WS:{ - OKX_APP_WALLET:100,OKX_TG_WALLET:110,OKX_WALLET_APP_WALLET:120,OKX_APP_COMMON:130} - ,INJECT:{ - OKX_INJECT_WALLET:200,STANDARD_INJECT_WALLET:210} - ,KEYLESS:{ - APPLE_WALLET:300,GOOGLE_WALLET:310} - } - ; - var xEt={ - } - ; - Object.defineProperty(xEt,"__esModule",{ - value:!0} - ),xEt.buildNameSpacesByConnectResponse=PEt,xEt.buildRequestAccountNameSpacesByConnectResponse=NEt,xEt.buildAccountNameSpaces=LEt,xEt.findConnectorBySession=DEt; - const REt=ubt(); - function PEt(t){ - return NEt(t)} - function NEt(t){ - let i={ - } - ; - (0,REt.logDebug)("buildRequestAccountNameSpacesByConnectResponse start connectResponse111>>",JSON.stringify(t)); - let s=t.payload.responses.find(t=>"requestAccounts"===t.name); - if(s&&s.accounts){ - let t=[]; - for(const i of s.accounts)"ton"===i.namespace?i.data&&i.data.ton_addr&&i.data.ton_addr.address&&i.data.ton_addr.address.length>0&&((0,REt.logDebug)("buildRequestAccountNameSpacesByConnectResponse start TON>>",JSON.stringify(i)),t.push(i)):((0,REt.logDebug)("buildRequestAccountNameSpacesByConnectResponse start other>>",JSON.stringify(i)),t.push(i)); - s.accounts=t} - const e=t.payload.responses.find(t=>"ton_addr"===t.name),n=t.payload.responses.find(t=>"ton_proof"===t.name); - if(e&&!s){ - (0,REt.logDebug)("buildRequestAccountNameSpacesByConnectResponse adapt ton data >>"); - let t=e.address; - t="ton:"+e.network+":"+t; - let i={ - ton_addr:e} - ; - n&&(i.ton_proof=n),s={ - name:"requestAccounts",accounts:[{ - namespace:"ton",addresses:[t],methods:["ton_sendTransaction"],extra:{ - } - ,data:i} - ]} - } - return(0,REt.logDebug)("buildRequestAccountNameSpacesByConnectResponse end universalResponse>>>",JSON.stringify(s)),LEt(s.accounts,i),i} - function LEt(t,i){ - t.forEach(t=>{ - var s=[],e=[]; - t.addresses.forEach(t=>{ - var i=t.split(":"); - if((0,REt.logDebug)("buildRequestAccountNameSpacesByConnectResponse addressArr>>",i.length),i.length>=3){ - let n=i.slice(0,2).join(":"); - s.push(n),e.push(t),(0,REt.logDebug)("buildRequestAccountNameSpacesByConnectResponse chain:>>",n,"addressItem:",t)} - } - ),t.data&&t.data.ton_addr&&(t.data.ton_addr.name="ton_addr"),t.data&&t.data.ton_proof&&(t.data.ton_proof.name="ton_proof"),i[t.namespace]={ - chains:s,accounts:e,methods:t.methods,extra:t.extra,payload:t.data} - ,(0,REt.logDebug)("buildRequestAccountNameSpacesByConnectResponse result>>",JSON.stringify(i))} - )} - function DEt(t,i,s){ - let e; - if(s&&s.connectWalletType&&(e=t.find(t=>t.getType()===s.connectWalletType)),!e){ - let s=null==i?void 0:i.appName; - s&&(e=t.find(t=>t.getTag()===s))} - return e} - Qt(PEt,"buildNameSpacesByConnectResponse"),Qt(NEt,"buildRequestAccountNameSpacesByConnectResponse"),Qt(LEt,"buildAccountNameSpaces"),Qt(DEt,"findConnectorBySession"); - var GEt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(CEt,"__esModule",{ - value:!0} - ),CEt.Engine=void 0; - const BEt=U_t,UEt=Egt,FEt=rbt(),$Et=OEt,HEt=zbt,WEt=xEt,VEt=class{ - constructor(t){ - this.connectors=[],this.useConnector=void 0,this.wsOpenWalletConnector=void 0,this.sessionRetryTimer=null,this.connectionManager=new HEt.ConnectionManager(t),this.addConnectionListener()} - getConnector(){ - if(this.useConnector)return this.useConnector} - setAccountChangeListener(t){ - this.accountChangeListener=t,(0,FEt.logDebug)("setAccountChangeListener: engine",t); - for(const i of this.connectors)i.setAccountChangeListener(t)} - registerConnector(t){ - this.connectors=t; - for(const i of t)i.setConnectionManager(this.connectionManager); - this.accountChangeListener&&this.setAccountChangeListener(this.accountChangeListener)} - getAllConnectors(){ - return this.connectors} - hasWsConnector(){ - for(const t of this.connectors)if(this.isWsConnector(t))return!0; - return!1} - isWsConnector(t){ - return!!t&&Object.values($Et.CONNECTOR_TYPE.WS).includes(t.getType())} - isInjectedConnector(t){ - return!!t&&(Object.values($Et.CONNECTOR_TYPE.INJECT).includes(t.getType())||Object.values($Et.CONNECTOR_TYPE.KEYLESS).includes(t.getType()))} - universalConnect(t,i,s){ - return GEt(this,void 0,void 0,function*(){ - return this.addConnectionListener(),this.wsOpenWalletConnector=void 0,new Promise((e,n)=>GEt(this,void 0,void 0,function*(){ - var h,r,o,a,c; - try{ - (0,FEt.logDebug)("engine universalConnect request :",JSON.stringify(t)),(0,FEt.logDebug)("engine universalConnect sessionConfig :",JSON.stringify(i)); - let l=[]; - t.forEach(t=>{ - let i=t.name; - (i.startsWith("requestAccounts")||i.startsWith("ton"))&&l.push(t)} - ),(0,FEt.logDebug)("engine universalConnect universalRequest :",JSON.stringify(l)); - const u=this.connectionManager.getConnectInfo(),d=Date.now().toString(); - let f=null!==(h=i.openUniversalUrl)&&void 0!==h&&h,p=null!==(r=i.openAppLinkType)&&void 0!==r?r:BEt.OpenAppLinkType.UniversalLink; - const w={ - protocolVer:Number(BEt.tonConnectSdkVersion),topic:u.channelId,clientId:u.clientId,requestId:d,dAppInfo:this.fixDappName(i.dappInfo),requests:l,redirect:null!==(o=null==i?void 0:i.redirect)&&void 0!==o?o:"none"} - ,g=(0,FEt.encodeConnectParams)(w); - w.redirect=null!==(a=null==i?void 0:i.redirect)&&void 0!==a?a:"none",(0,FEt.logDebug)("engine universalConnect ==>>universalConnectRequest:",JSON.stringify(w)); - const m=Qt(()=>{ - let t; - return t=1==this.connectors.length&&this.connectors[0].getType()===$Et.CONNECTOR_TYPE.INJECT.OKX_INJECT_WALLET?this.connectors[0]:this.connectors.find(t=>t.getType()===i.connectWalletType),null==t?void 0:t.openWallet({ - connectRequest:w} - ,p)} - ,"openMethod"); - this.setWsOpenWallet(); - const v=(0,FEt.isIos)(); - if(v&&f&&((0,FEt.logDebug)(`engine universalConnect ==>>isIOS: ${ - v} - openUniversalLink: ${ - f} - `),m()),this.addOnConnectResultListener((t,s)=>{ - var h,r,o,a; - try{ - this.stopSendSessionRetry(),this.addOnConnectResultListener(void 0); - let n=t; - if("connect"==n.method){ - (0,FEt.logDebug)("engin universalConnect success connectResponse:>>>",JSON.stringify(n)); - let t=(0,WEt.buildNameSpacesByConnectResponse)(n); - if(!t)throw new BEt.OKXConnectError(BEt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR); - { - let a; - (null===(r=null===(h=n.payload)||void 0===h?void 0:h.responses)||void 0===r?void 0:r[0])&&"walletName"in n.payload.responses[0]&&(a=n.payload.responses[0].walletName); - var c,l=null===(o=n.payload)||void 0===o?void 0:o.wallet.appName; - c=s,null==i.connectWalletType&&s.getTag()==BEt.OKXWalletName&&(i.connectWalletType=s.getType()); - let d=Object.assign({ - topic:u.channelId,sessionConfig:i,namespaces:t} - ,n.payload&&{ - wallet:Object.assign(Object.assign({ - } - ,n.payload.wallet),{ - walletName:a} - )} - ),f=n.payload.responses.find(t=>"requestAccounts"===t.name); - f&&f.connectRequestMethods&&(d.signResponse=f.connectRequestMethods),(0,FEt.logDebug)("engin universalConnect success session:>>>",JSON.stringify(d)),this.isWsConnector(c)&&((0,FEt.logDebug)("engine update protocol version"),this.connectionManager.updateProtocolVersion(u.channelId,n.payload.wallet.maxProtocolVersion)),this.deviceInfo=Object.assign({ - } - ,d.wallet),e(d),this.setUseConnector(c),(0,FEt.reportEvent)(FEt.OKXReportType.PAGE_IN,FEt.Report_OKXConnectSDKExtension_ConnectDapp_ConnectSuccess_View,l,this.getChainIdsFromSession(d))} - } - else if("connect_error"==n.method&&null!=(null===(a=n.payload)||void 0===a?void 0:a.code))throw new BEt.OKXConnectError(n.payload.code)} - catch(frt){ - n(frt)} - } - ),this.hasWsConnector()){ - yield null===(c=this.connectionManager)||void 0===c?void 0:c.disconnect(!1); - try{ - yield this.connectionManager.connect()} - catch(frt){ - throw(0,FEt.logDebug)("Engine universalConnect error",frt),frt} - (0,FEt.logDebug)("engin universalConnect ==>> connectInfoAndUrl:",s),this.sendSession(g,w.topic,f)} - if(!v&&f&&m(),(0,FEt.logDebug)("engin universalConnect ==>> connectInfoAndUrl:",s),s){ - const t={ - connectRequest:w,redirect:i.redirect,tmaReturnUrl:i.tmaReturnUrl} - ; - (0,FEt.logDebug)("universalConnect connectInfoAndUrl info :",JSON.stringify(t)),s(t)} - } - catch(l){ - (0,FEt.logDebug)("Engine universalConnect catch error",l),n(l)} - } - ))} - )} - fixDappName(t){ - try{ - if("dapp portal"===t.name.toLowerCase()){ - let i=document.title; - if(i||(i=this.getOGSiteName()),i)return Object.assign(Object.assign({ - } - ,t),{ - name:t.name+" - "+i} - )} - return t} - catch(frt){ - return t} - } - setWsOpenWallet(){ - this.connectors.filter(t=>this.isWsConnector(t)).forEach(t=>{ - t.setOpenWalletCalled(t=>{ - this.wsOpenWalletConnector=t} - )} - )} - getOGSiteName(){ - let t=document.getElementsByTagName("meta"),i=["og:site_name","og:title","twitter:title"]; - for(let s of t){ - let t=s.getAttribute("property"); - for(let e of i)if(t==e)return s.getAttribute("content")} - } - addOnConnectResultListener(t){ - for(const i of this.connectors)this.isInjectedConnector(i)&&i.setOnConnectResultListener(t); - this.connectResultListener=t} - openWallet(t,i,s){ - var e; - i?i.openWallet(t,s):null===(e=this.getConnector())||void 0===e||e.openWallet(t,s)} - send(t,i,s){ - return GEt(this,void 0,void 0,function*(){ - var s,e,n,h,r,o,a,c,l; - let u; - "chainId"in t&&null!=t.chainId&&(u=t.chainId.toString()); - try{ - if((0,FEt.reportEvent)(FEt.OKXReportType.LOG,FEt.Report_OKXConnectSDK_RequestStart_Log,"",null!==(e=null===(s=this.getConnector())||void 0===s?void 0:s.getTag())&&void 0!==e?e:"",t.method,null!==(h=null===(n=this.deviceInfo)||void 0===n?void 0:n.platform)&&void 0!==h?h:"",u),!this.getConnector())throw new BEt.OKXConnectError(BEt.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR); - null===(r=this.getConnector())||void 0===r||r.send(t,{ - resolve:Qt(s=>{ - var e,n,h,r,o,a,c,l,d; - null===(e=null==i?void 0:i.resolve)||void 0===e||e.call(i,s),"error"in s&&s.error?(0,FEt.reportEvent)(FEt.OKXReportType.LOG,FEt.Report_OKXConnectSDK_RequestError_Log,"",null!==(h=null===(n=this.getConnector())||void 0===n?void 0:n.getTag())&&void 0!==h?h:"",t.method,null!==(o=null===(r=this.deviceInfo)||void 0===r?void 0:r.platform)&&void 0!==o?o:"",u):(0,FEt.reportEvent)(FEt.OKXReportType.LOG,FEt.Report_OKXConnectSDK_RequestSuccess_Log,"",null!==(c=null===(a=this.getConnector())||void 0===a?void 0:a.getTag())&&void 0!==c?c:"",t.method,null!==(d=null===(l=this.deviceInfo)||void 0===l?void 0:l.platform)&&void 0!==d?d:"",u)} - ,"resolve"),onAck:Qt(()=>{ - var t; - null===(t=null==i?void 0:i.onAck)||void 0===t||t.call(i)} - ,"onAck")} - )} - catch(d){ - throw(0,FEt.reportEvent)(FEt.OKXReportType.LOG,FEt.Report_OKXConnectSDK_RequestError_Log,"",null!==(a=null===(o=this.getConnector())||void 0===o?void 0:o.getTag())&&void 0!==a?a:"",t.method,null!==(l=null===(c=this.deviceInfo)||void 0===c?void 0:c.platform)&&void 0!==l?l:"",u),d} - } - )} - clearData(){ - var t; - null===(t=this.getConnector())||void 0===t||t.clearData()} - addDisconnectListener(t){ - var i; - null===(i=this.getConnector())||void 0===i||i.addDisconnectListener(t)} - saveSessionContent(t,i){ - this.connectionManager.saveSessionContent(t,i)} - getSessionContent(t){ - var i=this.connectionManager.getSessionContent(t); - if(i&&"object"==typeof i&&(0,WEt.findConnectorBySession)(this.connectors,i.wallet,i.sessionConfig))return i} - setConnectConnector(t,i){ - (null==t?void 0:t.appName)&&this.setUseConnector((0,WEt.findConnectorBySession)(this.connectors,t,i))} - setUseConnector(t){ - this.useConnector=t,this.isWsConnector(t)&&t.addConnectionListener()} - setSessionConnectingListener(t){ - this.sessionConnectingListener=t} - restoreconnect(t,i){ - return GEt(this,void 0,void 0,function*(){ - this.getConnector()?this.getConnector().restoreconnect(t,t=>{ - var s,e; - i(t),t&&(this.deviceInfo=Object.assign({ - } - ,t.wallet),(0,FEt.reportEvent)(FEt.OKXReportType.PAGE_IN,FEt.Report_OKXConnectSDKExtension_ConnectDapp_ConnectSuccess_View,null!==(e=null===(s=this.getConnector())||void 0===s?void 0:s.getTag())&&void 0!==e?e:"",this.getChainIdsFromSession(t)))} - ):i(null)} - )} - restoreconnectFromTopic(t){ - return GEt(this,void 0,void 0,function*(){ - this.isWsConnector(this.getConnector())&&(yield this.getConnector().restoreconnectFromTopic(t))} - )} - getCurrentConnectionReady(t){ - var i; - return!!(null===(i=this.getConnector())||void 0===i?void 0:i.getCurrentConnectionReady(t))} - getChainIdsFromSession(t){ - if(!t.namespaces)return""; - const i=new Set; - return Object.values(t.namespaces).forEach(t=>{ - t.chains&&t.chains.forEach(t=>{ - i.add(t)} - )} - ),Array.from(i).join(",")} - connectManagerDisconnect(){ - return GEt(this,arguments,void 0,function*(t=!1){ - var i,s; - this.getConnector()?null===(i=this.getConnector())||void 0===i||i.connectManagerDisconnect(t):yield null===(s=this.connectors.find(t=>this.isWsConnector(t)))||void 0===s?void 0:s.connectManagerDisconnect(t),this.stopSendSessionRetry(),this.setUseConnector(void 0)} - )} - sendSession(t,i,s){ - return GEt(this,void 0,void 0,function*(){ - (0,FEt.logDebug)("[Connect] sendSession called:",t); - const e=Date.now().toString(); - let n={ - method:"session_info",params:{ - protocolVersion:UEt.CONNECT_PROTOCOL_VER,sessionInfo:t} - } - ; - yield this.connectionManager.sendRaw(JSON.stringify(Object.assign(Object.assign({ - } - ,n),{ - requestId:e} - ))),this.sessionRetryTimer&&clearInterval(this.sessionRetryTimer),s||(this.sessionRetryTimer=setInterval(()=>GEt(this,void 0,void 0,function*(){ - const t=Date.now().toString(); - (0,FEt.logDebug)("[Connect] Retrying sendSession..."),yield this.connectionManager.sendSubscribe(i),yield this.connectionManager.sendRaw(JSON.stringify(Object.assign(Object.assign({ - } - ,n),{ - requestId:t} - )))} - ),UEt.OKXCONNECTOR_MESSAGE_TTL))} - )} - stopSendSessionRetry(){ - this.sessionRetryTimer&&(clearInterval(this.sessionRetryTimer),this.sessionRetryTimer=null,(0,FEt.logDebug)("[Connect] Stopped retry for session"))} - getDefaultWsConnector(){ - return this.connectors.find(t=>this.isWsConnector(t))} - addConnectionListener(){ - var t; - null===(t=this.connectionManager)||void 0===t||t.addListener("sdk_response",(t,i)=>{ - var s=(0,FEt.safeJsonParse)(i); - (0,FEt.logDebug)(`Engine ==>> addListener ==> success ==> ${ - s} - `),null==this.wsOpenWalletConnector&&(this.wsOpenWalletConnector=this.getDefaultWsConnector()),"connect"===s.method?this.connectResultListener&&this.wsOpenWalletConnector&&this.connectResultListener(s,this.wsOpenWalletConnector):"connect_error"===s.method?this.connectManagerDisconnect(!1).catch(()=>{ - } - ).finally(()=>{ - this.connectResultListener&&this.wsOpenWalletConnector&&this.connectResultListener(s,this.wsOpenWalletConnector)} - ):"session_connecting"===s.method&&((0,FEt.logDebug)("Engine ==>> handleResponse_4 ===> sessionConnectingListener"),this.sessionConnectingListener&&((0,FEt.logDebug)("Engine ==>> handleResponse_4 ===> sessionConnectingListener not null"),this.sessionConnectingListener(),this.sessionConnectingListener=void 0))} - ,function(){ - } - )} - } - ; - Qt(VEt,"Engine"); - let jEt=VEt; - CEt.Engine=jEt,function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.Storage=t.Engine=t.WalletConnectionManager=t.ConnectionManager=t.OKXWalletConnector=void 0; - var i=ygt; - Object.defineProperty(t,"OKXWalletConnector",{ - enumerable:!0,get:Qt(function(){ - return i.OKXWalletConnector} - ,"get")} - ); - var s=zbt; - Object.defineProperty(t,"ConnectionManager",{ - enumerable:!0,get:Qt(function(){ - return s.ConnectionManager} - ,"get")} - ); - var e=eEt; - Object.defineProperty(t,"WalletConnectionManager",{ - enumerable:!0,get:Qt(function(){ - return e.WalletConnectionManager} - ,"get")} - ); - var n=CEt; - Object.defineProperty(t,"Engine",{ - enumerable:!0,get:Qt(function(){ - return n.Engine} - ,"get")} - ); - var h=Sgt; - Object.defineProperty(t,"Storage",{ - enumerable:!0,get:Qt(function(){ - return h.Storage} - ,"get")} - )} - (bgt); - var KEt={ - } - ,zEt={ - } - ; - function YEt(){ - return void 0!==qEt("okxwallet")} - function qEt(t){ - const i=Qt((t,s)=>{ - const[e,...n]=s.split("."),h=t[e]; - if(h)return 0===n.length?h:i(h,n.join("."))} - ,"providerSearch"); - if("undefined"!=typeof window)return i(window,t)} - Object.defineProperty(zEt,"__esModule",{ - value:!0} - ),zEt.BtcMethods=zEt.SuiMethods=zEt.TONMethods=zEt.AptosMethods=zEt.SOLANAMethods=zEt.Eip55Methods=void 0,zEt.hasOKXInjectedProvider=YEt,Qt(YEt,"hasOKXInjectedProvider"),Qt(qEt,"getWindowProviderNamespace"),zEt.Eip55Methods=["personal_sign","eth_signTypedData_v4","eth_sendTransaction","wallet_addEthereumChain","wallet_watchAsset","wallet_switchEthereumChain","eth_requestAccounts","eth_accounts","eth_chainId"],zEt.SOLANAMethods=["solana_signTransaction","solana_signMessage","solana_signAllTransactions","solana_signAndSendTransaction"],zEt.AptosMethods=["aptos_signMessage","aptos_signTransaction","aptos_signAndSubmitTransaction"],zEt.TONMethods=["ton_sendTransaction"],zEt.SuiMethods=["sui_signMessage","sui_signPersonalMessage","sui_signTransactionBlock","sui_signAndExecuteTransactionBlock"],zEt.BtcMethods=["btc_signMessage","btc_signPsbts","btc_send","btc_sendInscription","btc_signAndPushPsbt","btc_inscribeTransfer","btc_sendRunes"]; - var XEt={ - } - ,JEt={ - } - ,QEt={ - } - ; - !function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.mediaNotTouch=t.mediaTouch=t.maxWidth=void 0,t.isDevice=h,t.media=r,t.mediaMin=o,t.mediaMax=a,t.mediaMinMax=c; - const i=KMt(),s=zMt(),e=YMt(),n=ubt(); - function h(h){ - var r; - const o=(0,e.getWindow)(); - if(!o)return"desktop"===h; - if((0,s.isTmaPlatform)("weba"))return!0; - const a=o.innerWidth; - switch(h){ - case"desktop":return a>t.maxWidth.tablet; - case"tablet":return a>t.maxWidth.mobile; - default:let s=a<=t.maxWidth.mobile||(0,i.isOS)("ios","android","ipad"); - if(s){ - const t=!!(null===(r=(0,e.getWindow)())||void 0===r?void 0:r.TelegramWebviewProxy),i=navigator.maxTouchPoints||0; - t&&0===i&&(s=!1),(0,n.logDebug)("isDevice mobile isTelegram and maxTouchPoints:",s,t,i)} - return s} - } - function r(i){ - switch(i){ - case"mobile":return`@media (max-width: ${ - t.maxWidth.mobile} - px)`; - case"tablet":return`@media (max-width: ${ - t.maxWidth.tablet} - px) (min-width: ${ - t.maxWidth.mobile} - px)`; - default:return`@media (min-width: ${ - t.maxWidth.tablet} - px)`} - } - function o(t){ - return`@media (min-width: ${ - t} - px)`} - function a(t){ - return`@media (max-width: ${ - t} - px)`} - function c(t,i){ - return`@media (min-width: ${ - t} - px) and (max-width: ${ - i} - px)`} - t.maxWidth={ - mobile:440,tablet:1020} - ,Qt(h,"isDevice"),Qt(r,"media"),Qt(o,"mediaMin"),Qt(a,"mediaMax"),Qt(c,"mediaMinMax"),t.mediaTouch="@media (hover: none)",t.mediaNotTouch="@media not all and (hover: none)"} - (QEt); - var ZEt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(JEt,"__esModule",{ - value:!0} - ),JEt.Eip155Provider=void 0; - const tAt=U_t,iAt=rbt(),sAt=QEt,eAt=zEt; - let nAt=(Qt(Ct=class{ - constructor(){ - this.accountChangedEVMHandler=null} - send(t){ - return ZEt(this,void 0,void 0,function*(){ - var i; - try{ - (0,iAt.logDebug)("Eip155Provider send request:",(0,iAt.safeJsonStringify)(t)),yield this.restoreConnect(); - let s=null; - switch(t.method){ - case"personal_sign":t.params&&"message"in t.params&&(s={ - method:t.method,params:[t.params.message,t.address]} - ); - break; - case"eth_sendTransaction":case"wallet_addEthereumChain":case"wallet_switchEthereumChain":t.params&&(s={ - method:t.method,params:[t.params]} - ); - break; - case"eth_signTypedData_v4":t.params&&"typedDataJson"in t.params&&(null===(i=t.params)||void 0===i?void 0:i.typedDataJson)&&"string"==typeof t.params.typedDataJson&&(s={ - method:t.method,params:[t.address,t.params.typedDataJson]} - ); - break; - case"wallet_watchAsset":t.params&&(s={ - method:t.method,params:t.params} - ); - break; - default:s={ - method:t.method,params:t.injectParams} - } - if(!s)throw new tAt.OKXConnectError(tAt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED); - if(("wallet_switchEthereumChain"===t.method||"wallet_addEthereumChain"===t.method)&&t.params&&"chainId"in t.params){ - (0,iAt.logDebug)("Eip155Provider send request switch requestParams:",(0,iAt.safeJsonStringify)(s)); - const i=parseInt(t.params.chainId,16).toString(); - yield window.okxwallet.request(s); - const e=`eip155:${ - i} - :${ - t.address} - `; - return(0,iAt.logDebug)("Eip155Provider send request switch result:",e),{ - result:e,method:t.method} - } - { - const i=(0,iAt.getChainId)(t.chainId),e=`0x${ - Number(i).toString(16)} - `; - if((0,iAt.logDebug)("Eip155Provider current chainId:",i,e),e){ - yield window.okxwallet.request({ - method:"wallet_switchEthereumChain",params:[{ - chainId:e} - ]} - ),(0,iAt.logDebug)("Eip155Provider send request requestParams:",e,(0,iAt.safeJsonStringify)(s)); - const i=yield window.okxwallet.request(s); - return(0,iAt.logDebug)("Eip155Provider send request result:",(0,iAt.safeJsonStringify)(i)),{ - result:i,method:t.method} - } - } - } - catch(s){ - throw(0,iAt.logDebug)("Eip155Provider encountered an error:",s),s} - } - )} - restoreConnect(){ - return(0,sAt.isDevice)("mobile")?window.okxwallet.request({ - method:"eth_requestAccounts"} - ):Promise.resolve()} - parseConnectResponse(t,i,s,e,n,h){ - return ZEt(this,void 0,void 0,function*(){ - try{ - let t=[]; - e.forEach(i=>{ - i.namespace===tAt.NameSpaceKeyEip155&&t.push(...i.chains)} - ); - let i=[],s={ - } - ; - return t.forEach(t=>{ - let e=(0,iAt.getChainId)(t),h=n.address.find(i=>i.chainId===e&&60===i.coinType||i.namespaceChainId===t); - h&&(i.push(t+":"+h.address),s[t]={ - publicKey:h.publicKey} - )} - ),i&&i.length>0?{ - namespace:tAt.NameSpaceKeyEip155,addresses:i,methods:[...eAt.Eip55Methods],extra:s} - :void 0} - catch(t){ - throw t} - } - )} - connect(){ - return ZEt(this,void 0,void 0,function*(){ - return window.okxwallet.request({ - method:"eth_requestAccounts"} - )} - )} - singleConnect(){ - return this.connect()} - addAccountChangedListener(t){ - this.accountChangedEVMHandler=i=>{ - i&&i.length>0&&t()} - ,window.okxwallet.on("accountsChanged",this.accountChangedEVMHandler)} - removeListener(){ - this.accountChangedEVMHandler&&window.okxwallet.removeListener("accountsChanged",this.accountChangedEVMHandler)} - } - ,"Eip155Provider"),Ct); - JEt.Eip155Provider=nAt,function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),s(JEt,t)} - (XEt); - var hAt={ - } - ,rAt={ - } - ; - Object.defineProperty(rAt,"__esModule",{ - value:!0} - ); - var oAt={ - } - ; - Object.defineProperty(oAt,"__esModule",{ - value:!0} - ),function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),s(rAt,t),s(oAt,t)} - (hAt); - var aAt={ - } - ,cAt={ - } - ,lAt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(cAt,"__esModule",{ - value:!0} - ),cAt.SuiStandardProvider=void 0; - const uAt=U_t,dAt=rbt(),fAt=QEt,pAt=class{ - constructor(t){ - this.wallet=t} - getVersion(){ - return this.wallet.version} - supportChains(t){ - return 1===t.length&&t[0]===uAt.SUI_CHAINS.MAINNET} - send(t){ - return lAt(this,void 0,void 0,function*(){ - try{ - (0,dAt.logDebug)("suiProvider send request:",JSON.stringify(t)); - const i=t.method; - let s; - if(t.injectParams&&this.wallet){ - let e=t.injectParams; - switch(i){ - case"sui_signTransactionBlock":let t; - if(this.wallet.features["sui:signTransaction"])t=yield this.wallet.features["sui:signTransaction"].signTransaction(e); - else{ - if(!this.wallet.features["sui:signTransactionBlock"])throw new uAt.OKXConnectError(uAt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED); - t=yield this.wallet.features["sui:signTransactionBlock"].signTransactionBlock(e)} - s={ - method:"sui_signTransactionBlock",result:null==t?void 0:t.signature} - ; - break; - case"sui_signAndExecuteTransactionBlock":let i; - if(this.wallet.features["sui:signAndExecuteTransaction"])i=yield this.wallet.features["sui:signAndExecuteTransaction"].signAndExecuteTransaction(e); - else{ - if(!this.wallet.features["sui:signAndExecuteTransactionBlock"])throw new uAt.OKXConnectError(uAt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED); - i=yield this.wallet.features["sui:signAndExecuteTransactionBlock"].signAndExecuteTransactionBlock(e)} - s={ - method:"sui_signAndExecuteTransactionBlock",result:i.digest} - ; - break; - case"sui_signMessage":s={ - method:"sui_signMessage",result:(yield this.wallet.features["sui:signMessage"].signMessage(e)).signature} - ; - break; - case"sui_signPersonalMessage":s={ - method:"sui_signPersonalMessage",result:(yield this.wallet.features["sui:signPersonalMessage"].signPersonalMessage(e)).signature} - } - } - return s} - catch(frt){ - throw(0,dAt.logDebug)("suiProvider send error:",frt),frt} - } - )} - addAccountChangedListener(){ - } - removeListener(){ - } - disconnect(){ - return lAt(this,void 0,void 0,function*(){ - } - )} - connect(){ - return lAt(this,void 0,void 0,function*(){ - return this.wallet.features["standard:connect"].connect()} - )} - restoreConnect(){ - return(0,fAt.isDevice)("mobile")?this.connect():Promise.resolve()} - getAccount(t){ - return lAt(this,void 0,void 0,function*(){ - var t; - let i=yield this.connect(); - if(!i)throw new uAt.OKXConnectError(uAt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR); - null==i||i.address; - let s=null!==(t=null==i?void 0:i.publicKey)&&void 0!==t?t:""; - s instanceof Uint8Array&&(s=this.normalizeUint8Array(s),s=btoa(String.fromCharCode(...s))); - let e={ - } - ; - return e[uAt.SUI_CHAINS.MAINNET]={ - publicKey:s} - ,{ - namespace:uAt.NameSpaceKeySui,addresses:[`${ - uAt.SUI_CHAINS.MAINNET} - :${ - i.address} - `],methods:i.features,extra:e} - } - )} - normalizeUint8Array(t){ - return 33===t.length&&0===t[0]?t.slice(1):t} - } - ; - Qt(pAt,"SuiStandardProvider"); - let wAt=pAt; - cAt.SuiStandardProvider=wAt; - var gAt={ - } - ,mAt={ - } - ,vAt={ - } - ; - Object.defineProperty(vAt,"__esModule",{ - value:!0} - ),vAt.AptosNetwork=vAt.UserResponseStatus=void 0,vAt.getArgs=AAt; - const _At=U_t; - var MAt,bAt,yAt,EAt; - function AAt(t){ - if("object"==typeof t&&null!==t&&"status"in t){ - if(t.status===MAt.REJECTED)throw new _At.OKXConnectError(_At.OKX_CONNECT_ERROR_CODES.USER_REJECTS_ERROR); - return t.args} - return t} - (bAt=MAt||(vAt.UserResponseStatus=MAt={ - } - )).APPROVED="Approved",bAt.REJECTED="Rejected",Qt(AAt,"getArgs"),(EAt=yAt||(vAt.AptosNetwork=yAt={ - } - )).MAINNET="mainnet",EAt.TESTNET="testnet",EAt.DEVNET="devnet"; - var SAt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(mAt,"__esModule",{ - value:!0} - ),mAt.AptosStandardProvider=void 0; - const TAt=U_t,CAt=rbt(),OAt=vAt,IAt=class{ - constructor(t){ - this.wallet=t,this.mainNetWorkInfo={ - chainId:"1",name:OAt.AptosNetwork.MAINNET} - } - getVersion(){ - return this.wallet.version} - supportChains(t){ - return 1===t.length&&t[0]===TAt.APTOS_CHAINS.MAINNET} - send(t){ - return SAt(this,void 0,void 0,function*(){ - var i,s,e,n,h; - try{ - try{ - (0,CAt.logDebug)("AptosStandardProvider send request:",JSON.stringify(t))} - catch(r){ - } - yield this.confirmNetwrok(t.chainId); - const o=t.method; - let a; - if(t.injectParams&&this.wallet){ - let r=t.injectParams; - switch(o){ - case"aptos_signTransaction":let o; - if(!this.wallet.features["aptos:signTransaction"])throw new TAt.OKXConnectError(TAt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED); - if("rawTransaction"in r){ - const t=yield this.wallet.features["aptos:signTransaction"].signTransaction(r); - o=(0,OAt.getArgs)(t)} - else{ - if("1.1"!==this.wallet.features["aptos:signTransaction"].version)throw new TAt.OKXConnectError(TAt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED); - { - const t=r,c={ - payload:t.data,expirationTimestamp:null===(i=t.options)||void 0===i?void 0:i.expirationTimestamp,expirationSecondsFromNow:null===(s=t.options)||void 0===s?void 0:s.expirationSecondsFromNow,gasUnitPrice:null===(e=null==t?void 0:t.options)||void 0===e?void 0:e.gasUnitPrice,maxGasAmount:null===(n=null==t?void 0:t.options)||void 0===n?void 0:n.maxGasAmount,sequenceNumber:null===(h=null==t?void 0:t.options)||void 0===h?void 0:h.accountSequenceNumber,sender:t.sender} - ; - yield this.wallet.features["aptos:signTransaction"].signTransaction(c),o=(0,OAt.getArgs)(a)} - } - a={ - method:"aptos_signTransaction",injectResult:o} - ; - break; - case"aptos_signMessage":let c; - if(!this.wallet.features["aptos:signMessage"])throw new TAt.OKXConnectError(TAt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED); - { - let t=yield this.wallet.features["aptos:signMessage"].signMessage(r); - c=(0,OAt.getArgs)(t)} - a={ - method:"aptos_signMessage",injectResult:c} - ; - break; - case"aptos_signAndSubmitTransaction":let l; - if(!this.wallet.features["aptos:signAndSubmitTransaction"])throw new TAt.OKXConnectError(TAt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED); - if("1.0.0"==this.wallet.features["aptos:signAndSubmitTransaction"].version){ - if("standardV1Transaction"in r){ - let t=yield this.wallet.features["aptos:signAndSubmitTransaction"].signAndSubmitTransaction(r.standardV1Transaction); - l=(0,OAt.getArgs)(t)} - } - else{ - if("1.1.0"!=this.wallet.features["aptos:signAndSubmitTransaction"].version)throw new TAt.OKXConnectError(TAt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED); - if("standardV11Transaction"in r){ - t.params; - let i=yield this.wallet.features["aptos:signAndSubmitTransaction"].signAndSubmitTransaction(r.standardV11Transaction); - l=(0,OAt.getArgs)(i)} - } - a={ - method:"aptos_signAndSubmitTransaction",result:l.hash.toString()} - } - } - return a} - catch(frt){ - throw(0,CAt.logDebug)("aptosProvider send error:",frt),frt} - } - )} - removeListener(){ - this.previousAccountChangedListener=void 0} - addAccountChangedListener(t){ - this.accountChangedListener=t} - setAccountChangedListener(){ - if(this.previousAccountChangedListener!=this.accountChangedListener&&this.wallet.features["aptos:onAccountChange"]&&this.accountChangedListener)try{ - this.wallet.features["aptos:onAccountChange"].onAccountChange(t=>{ - var i,s,e,n; - try{ - let h=null===(s=null===(i=(0,OAt.getArgs)(t))||void 0===i?void 0:i.address)||void 0===s?void 0:s.toString(); - this.address!=h&&(this.accountChangedListener(null===(n=null===(e=(0,OAt.getArgs)(t))||void 0===e?void 0:e.address)||void 0===n?void 0:n.toString()),this.address=h)} - catch(frt){ - this.address&&(this.accountChangedListener(void 0),this.address=void 0)} - } - ),this.previousAccountChangedListener=this.accountChangedListener} - catch(h6i){ - (0,CAt.logDebug)(`aptosStandardProvider addAccountChangedListener: error ${ - h6i.toString()} - `)} - } - connect(){ - return SAt(this,void 0,void 0,function*(){ - return this.wallet.features["aptos:connect"].connect()} - )} - getAccount(t){ - return SAt(this,void 0,void 0,function*(){ - let t=(0,OAt.getArgs)(yield this.connect()),i=t.address; - "object"==typeof i&&i.toString&&(i=i.toString()),i instanceof Uint8Array&&(i=this.normalizeUint8Array(i),i=btoa(String.fromCharCode(...i))); - let s=t.publicKey.toString(); - this.address!==i&&(this.setAccountChangedListener(),this.address=i); - let e={ - } - ; - return e[TAt.APTOS_CHAINS.MAINNET]={ - publicKey:s} - ,{ - namespace:TAt.NameSpaceKeyAptos,addresses:[`${ - TAt.APTOS_CHAINS.MAINNET} - :${ - i} - `],methods:[],extra:e} - } - )} - normalizeUint8Array(t){ - return 33===t.length&&0===t[0]?t.slice(1):t} - disconnect(){ - return SAt(this,void 0,void 0,function*(){ - if(this.wallet.features["aptos:disconnect"])return this.wallet.features["aptos:disconnect"].disconnect()} - )} - confirmNetwrok(t){ - return SAt(this,void 0,void 0,function*(){ - if(t!==CAt.chainName2IdMap.get(TAt.APTOS_CHAINS.MAINNET))throw new TAt.OKXConnectError(TAt.OKX_CONNECT_ERROR_CODES.CHAIN_NOT_SUPPORTED); - if(!this.wallet.features["aptos:network"])throw new TAt.OKXConnectError(TAt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED); - { - let t=yield this.wallet.features["aptos:network"].network(); - if(1==t.chainId&&t.name.toLowerCase()==OAt.AptosNetwork.MAINNET)return Promise.resolve(); - yield this.changeMainNetwork()} - } - )} - changeMainNetwork(){ - return SAt(this,void 0,void 0,function*(){ - if(!this.wallet.features["aptos:changeNetwork"])throw new TAt.OKXConnectError(TAt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED); - { - let t=yield this.wallet.features["aptos:changeNetwork"].changeNetwork(this.mainNetWorkInfo); - if((0,OAt.getArgs)(t).success)return Promise.resolve()} - } - )} - } - ; - Qt(IAt,"AptosStandardProvider"); - let kAt=IAt; - mAt.AptosStandardProvider=kAt; - var xAt,RAt,PAt={ - } - ,NAt={ - } - ,LAt={ - } - ; - Object.defineProperty(LAt,"__esModule",{ - value:!0} - ),LAt.WalletReadyState=void 0,(RAt=xAt||(LAt.WalletReadyState=xAt={ - } - )).Installed="Installed",RAt.NotDetected="NotDetected",RAt.Loadable="Loadable",RAt.Unsupported="Unsupported"; - var DAt={ - } - ,GAt={ - } - ; - Object.defineProperty(GAt,"__esModule",{ - value:!0} - ),GAt.BaseAptosWalletAdapter=void 0; - const BAt=MMt,UAt=class extends BAt.EventEmitter{ - get connected(){ - return!!this.publicAccount.publicKey} - } - ; - Qt(UAt,"BaseAptosWalletAdapter"); - let FAt=UAt; - GAt.BaseAptosWalletAdapter=FAt; - var $At=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(DAt,"__esModule",{ - value:!0} - ),DAt.MartainWalletAdapter=void 0; - const HAt=GAt,WAt=LAt,VAt=U_t,jAt=vbt(),KAt=rbt(),zAt=class extends HAt.BaseAptosWalletAdapter{ - get readyState(){ - throw new Error("Method not implemented.")} - constructor(){ - super(),this.name="Martian",this.icon="https://raw.githubusercontent.com/hippospace/aptos-wallet-adapter/main/logos/martian.png",this.url="",this._version="unknown",this._readyState="undefined"==typeof window||"undefined"==typeof document?WAt.WalletReadyState.Unsupported:WAt.WalletReadyState.NotDetected,this._provider="undefined"!=typeof window?window.martian:void 0,this._network=void 0,this._connecting=!1,this._wallet=null,"undefined"!=typeof window&&this._readyState!==WAt.WalletReadyState.Unsupported&&(0,jAt.scopePollingDetectionStrategy)(()=>!!window.martian&&(this._readyState=WAt.WalletReadyState.Installed,this.emit("readyStateChange",this._readyState),!0))} - get publicAccount(){ - var t,i,s; - return{ - publicKey:(null===(t=this._wallet)||void 0===t?void 0:t.publicKey)||null,address:(null===(i=this._wallet)||void 0===i?void 0:i.address)||null,authKey:(null===(s=this._wallet)||void 0===s?void 0:s.authKey)||null} - } - get connecting(){ - return this._connecting} - get version(){ - return this._version} - get network(){ - return{ - name:this._network,chainId:this._chainId} - } - onAccountChange(t){ - return $At(this,void 0,void 0,function*(){ - try{ - const t=this._wallet,i=this._provider||window.martian; - if(!t||!i)throw new VAt.OKXConnectError(VAt.OKX_CONNECT_ERROR_CODES.WALLET_NOT_SUPPORTED); - const s=Qt(t=>$At(this,void 0,void 0,function*(){ - const{ - publicKey:s} - =yield null==i?void 0:i.account(); - this._wallet=Object.assign(Object.assign({ - } - ,this._wallet),{ - address:t,publicKey:s} - )} - ),"handleChangeAccount"); - yield null==i?void 0:i.onAccountChange(s)} - catch(t){ - throw t.message,t} - (0,KAt.logDebug)("MartainWalletAdapter.onAccountChange()")} - )} - onNetworkChange(){ - return $At(this,void 0,void 0,function*(){ - (0,KAt.logDebug)("MartainWalletAdapter.onNetworkChange()")} - )} - connect(){ - return $At(this,void 0,void 0,function*(){ - try{ - if(this._readyState!==WAt.WalletReadyState.Loadable&&this._readyState!==WAt.WalletReadyState.Installed)throw new VAt.OKXConnectError(VAt.OKX_CONNECT_ERROR_CODES.WALLET_NOT_SUPPORTED); - if(this.connecting)return; - if(this.connected)return void(yield this.initNetWork()); - this._connecting=!0; - const t=this._provider||window.martian; - if((yield null==t?void 0:t.isConnected())&&(yield null==t?void 0:t.disconnect()),!(yield null==t?void 0:t.connect()))throw new VAt.OKXConnectError(VAt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR); - yield this.initNetWork()} - catch(t){ - throw t} - finally{ - this._connecting=!1} - } - )} - initNetWork(){ - return $At(this,void 0,void 0,function*(){ - const t=this._provider||window.martian,i=yield null==t?void 0:t.account(); - if(i){ - this._wallet=Object.assign(Object.assign({ - } - ,i),{ - isConnected:!0} - ); - const s=yield null==t?void 0:t.network(),{ - chainId:e} - =yield t.getChainId(); - this._network=s,this._chainId=e.toString()} - } - )} - disconnect(){ - return $At(this,void 0,void 0,function*(){ - const t=this._wallet,i=this._provider||window.martian; - if(t){ - this._wallet=null; - try{ - yield null==i?void 0:i.disconnect()} - catch(s){ - } - } - } - )} - signAndSubmitTransaction(t,i){ - return $At(this,void 0,void 0,function*(){ - try{ - const s=this._wallet,e=this._provider||window.martian; - if(!s||!e)throw new VAt.OKXConnectError(VAt.OKX_CONNECT_ERROR_CODES.WALLET_NOT_SUPPORTED); - const n=yield e.generateTransaction(s.address||"",t,i); - if(!n)throw new VAt.OKXConnectError(VAt.OKX_CONNECT_ERROR_CODES.BAD_REQUEST_ERROR,"generate transaction error"); - const h=yield null==e?void 0:e.signAndSubmitTransaction(n); - if(!h)throw new Error("No response"); - return{ - hash:h} - } - catch(s){ - throw s} - } - )} - signTransaction(t,i){ - return $At(this,void 0,void 0,function*(){ - try{ - const s=this._wallet,e=this._provider||window.martian; - if(!s||!e)throw new VAt.OKXConnectError(VAt.OKX_CONNECT_ERROR_CODES.WALLET_NOT_SUPPORTED); - const n=yield e.generateTransaction(s.address||"",t,i); - if(!n)throw new VAt.OKXConnectError(VAt.OKX_CONNECT_ERROR_CODES.BAD_REQUEST_ERROR,"generate transaction error"); - const h=yield null==e?void 0:e.signTransaction(n); - if(!h)throw new Error("No response"); - return h} - catch(s){ - throw s} - } - )} - signMessage(t){ - return $At(this,void 0,void 0,function*(){ - try{ - const i=this._wallet,s=this._provider||window.martian; - if(!i||!s)throw new VAt.OKXConnectError(VAt.OKX_CONNECT_ERROR_CODES.WALLET_NOT_SUPPORTED); - if("object"!=typeof t||!t.nonce)throw new VAt.OKXConnectError(VAt.OKX_CONNECT_ERROR_CODES.BAD_REQUEST_ERROR,"Invalid signMessage Payload"); - const e=yield null==s?void 0:s.signMessage(t); - if(e)return e; - throw new Error("Sign Message failed")} - catch(i){ - throw i} - } - )} - } - ; - Qt(zAt,"MartainWalletAdapter"); - let YAt=zAt; - DAt.MartainWalletAdapter=YAt; - var qAt={ - } - ,XAt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(qAt,"__esModule",{ - value:!0} - ),qAt.PetraWalletAdapter=void 0; - const JAt=GAt,QAt=LAt,ZAt=vbt(),tSt=U_t,iSt=class extends JAt.BaseAptosWalletAdapter{ - get readyState(){ - return this._readyState} - getPerta(){ - var t; - if(this._provider)return this._provider; - if(!window.petra)return; - let i=window.petra; - return i&&(i.isOKExWallet||i.isOkxWallet||(null===(t=window.okxwallet)||void 0===t?void 0:t.aptos)===i)?void 0:(this._provider=i,i)} - constructor(){ - super(),this.name="Petra",this.icon="https://raw.githubusercontent.com/hippospace/aptos-wallet-adapter/main/logos/petra.png",this.url="",this._version="unknown",this._readyState="undefined"==typeof window||"undefined"==typeof document?QAt.WalletReadyState.Unsupported:QAt.WalletReadyState.NotDetected,this._network=void 0,this._connecting=!1,this._wallet=null,"undefined"!=typeof window&&this._readyState!==QAt.WalletReadyState.Unsupported&&(0,ZAt.scopePollingDetectionStrategy)(()=>!!this.getPerta()&&(this._readyState=QAt.WalletReadyState.Installed,!0))} - get publicAccount(){ - var t,i,s; - return{ - publicKey:(null===(t=this._wallet)||void 0===t?void 0:t.publicKey)||null,address:(null===(i=this._wallet)||void 0===i?void 0:i.address)||null,authKey:(null===(s=this._wallet)||void 0===s?void 0:s.authKey)||null} - } - get connecting(){ - return this._connecting} - get version(){ - return this._version} - get network(){ - return{ - name:this._network} - } - connect(){ - return XAt(this,void 0,void 0,function*(){ - try{ - if(this._readyState!==QAt.WalletReadyState.Loadable&&this._readyState!==QAt.WalletReadyState.Installed)throw new tSt.OKXConnectError(tSt.OKX_CONNECT_ERROR_CODES.WALLET_NOT_SUPPORTED); - if(this.connected)return void(yield this.initNetWork()); - this._connecting=!0; - const t=this.getPerta(),i=yield null==t?void 0:t.connect(); - this._wallet={ - address:null==i?void 0:i.address,publicKey:null==i?void 0:i.publicKey,isConnected:!0} - ,yield this.initNetWork()} - catch(t){ - throw t} - finally{ - this._connecting=!1} - } - )} - initNetWork(){ - return XAt(this,void 0,void 0,function*(){ - const t=this.getPerta(),i=yield null==t?void 0:t.network(); - this._network=i} - )} - disconnect(){ - return XAt(this,void 0,void 0,function*(){ - const t=this._wallet,i=this.getPerta(); - if(t){ - this._wallet=null; - try{ - yield null==i?void 0:i.disconnect()} - catch(s){ - } - } - } - )} - signAndSubmitTransaction(t,i){ - return XAt(this,void 0,void 0,function*(){ - try{ - const s=this._wallet,e=this.getPerta(); - if(!s||!e)throw new tSt.OKXConnectError(tSt.OKX_CONNECT_ERROR_CODES.WALLET_NOT_SUPPORTED); - const n=yield e.signAndSubmitTransaction(t,i); - if(n.code)throw new Error(n.message); - return n} - catch(s){ - throw s} - } - )} - signTransaction(t,i){ - return XAt(this,void 0,void 0,function*(){ - try{ - const i=this._wallet,s=this.getPerta(); - if(!i||!s)throw new tSt.OKXConnectError(tSt.OKX_CONNECT_ERROR_CODES.WALLET_NOT_SUPPORTED); - const e=yield null==s?void 0:s.signTransaction(t); - if(e.code)throw new Error(e.message); - return e} - catch(i){ - throw i} - } - )} - signMessage(t){ - return XAt(this,void 0,void 0,function*(){ - try{ - const i=this._wallet,s=this.getPerta(); - if(!i||!s)throw new tSt.OKXConnectError(tSt.OKX_CONNECT_ERROR_CODES.WALLET_NOT_SUPPORTED); - const e=yield null==s?void 0:s.signMessage(t); - if(e)return e; - throw new Error("Sign Message failed")} - catch(i){ - throw i} - } - )} - onAccountChange(t){ - return XAt(this,void 0,void 0,function*(){ - try{ - this._wallet; - const i=this.getPerta(),s=Qt(s=>XAt(this,void 0,void 0,function*(){ - var e,n,h,r,o,a; - if(null==s?void 0:s.publicKey)this._wallet=Object.assign(Object.assign({ - } - ,this._wallet),{ - publicKey:s.publicKey||(null===(e=this._wallet)||void 0===e?void 0:e.publicKey),authKey:s.authKey||(null===(n=this._wallet)||void 0===n?void 0:n.authKey),address:s.address||(null===(h=this._wallet)||void 0===h?void 0:h.address)} - ); - else{ - const t=yield null==i?void 0:i.connect(); - this._wallet=Object.assign(Object.assign({ - } - ,this._wallet),{ - authKey:(null==t?void 0:t.authKey)||(null===(r=this._wallet)||void 0===r?void 0:r.authKey),address:(null==t?void 0:t.address)||(null===(o=this._wallet)||void 0===o?void 0:o.address),publicKey:(null==t?void 0:t.publicKey)||(null===(a=this._wallet)||void 0===a?void 0:a.publicKey)} - )} - null==t||t(this._wallet)} - ),"handleAccountChange"); - null==i||i.onAccountChange(s)} - catch(i){ - throw i} - } - )} - onNetworkChange(){ - return XAt(this,void 0,void 0,function*(){ - try{ - this._wallet,this.getPerta()} - catch(t){ - throw t} - } - )} - } - ; - Qt(iSt,"PetraWalletAdapter"); - let sSt=iSt; - qAt.PetraWalletAdapter=sSt,function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),s(LAt,t),s(DAt,t),s(qAt,t)} - (NAt); - var eSt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(PAt,"__esModule",{ - value:!0} - ),PAt.AptosThirdpartInjectProvider=void 0; - const nSt=U_t,hSt=NAt,rSt=rbt(),oSt=vAt,aSt=class{ - constructor(t){ - this.walletAdapter=t} - disconnect(){ - return eSt(this,void 0,void 0,function*(){ - yield this.walletAdapter.disconnect()} - )} - getVersion(){ - return this.walletAdapter.version} - getAccount(t){ - return eSt(this,void 0,void 0,function*(){ - yield this.walletAdapter.connect(); - let t=this.walletAdapter.publicAccount,i=t.address,s=t.publicKey.toString(),e={ - } - ; - return e[nSt.APTOS_CHAINS.MAINNET]={ - publicKey:s} - ,{ - namespace:nSt.NameSpaceKeyAptos,addresses:[`${ - nSt.APTOS_CHAINS.MAINNET} - :${ - i} - `],methods:[],extra:e} - } - )} - supportChains(t){ - return this.walletAdapter.readyState===hSt.WalletReadyState.Installed&&1===t.length&&t[0]===nSt.APTOS_CHAINS.MAINNET} - send(t){ - return eSt(this,void 0,void 0,function*(){ - try{ - try{ - (0,rSt.logDebug)("AptosStandardProvider send request:",JSON.stringify(t))} - catch(frt){ - } - this.confirmNetwrok(t.chainId); - const i=t.method; - let s; - if(t.injectParams&&this.walletAdapter){ - let e=t.injectParams; - switch(i){ - case"aptos_signTransaction":s={ - method:"aptos_signTransaction",result:yield this.walletAdapter.signTransaction(t.params)} - ; - break; - case"aptos_signMessage":let i=yield this.walletAdapter.signMessage(e); - "object"==typeof i&&"signature"in i&&(i=i.signature),s={ - method:"aptos_signMessage",result:i} - ; - break; - case"aptos_signAndSubmitTransaction":s={ - method:"aptos_signAndSubmitTransaction",result:(yield this.walletAdapter.signAndSubmitTransaction(t.params)).hash} - } - } - return s} - catch(frt){ - throw(0,rSt.logDebug)("aptosProvider send error:",frt),frt} - } - )} - removeListener(){ - } - addAccountChangedListener(t){ - this.walletAdapter.onAccountChange(i=>{ - null==t||t(null==i?void 0:i.address)} - )} - confirmNetwrok(t){ - var i; - if(t!==rSt.chainName2IdMap.get(nSt.APTOS_CHAINS.MAINNET))throw new nSt.OKXConnectError(nSt.OKX_CONNECT_ERROR_CODES.CHAIN_NOT_SUPPORTED); - if((null===(i=this.walletAdapter.network.name)||void 0===i?void 0:i.toLowerCase())!=oSt.AptosNetwork.MAINNET)throw new nSt.OKXConnectError(nSt.OKX_CONNECT_ERROR_CODES.CHAIN_NOT_SUPPORTED)} - } - ; - Qt(aSt,"AptosThirdpartInjectProvider"); - let cSt=aSt; - PAt.AptosThirdpartInjectProvider=cSt,function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),s(mAt,t),s(PAt,t),s(NAt,t)} - (gAt); - var lSt,uSt={ - } - ,dSt={ - } - ,fSt={ - } - ,pSt={ - } - ,wSt={ - } - ,gSt=pi&&pi.__classPrivateFieldGet||function(t,i,s,e){ - if("a"===s&&!e)throw new TypeError("Private accessor was defined without a getter"); - if("function"==typeof i?t!==i||!e:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return"m"===s?e:"a"===s?e.call(t):e?e.value:i.get(t)} - ,mSt=pi&&pi.__classPrivateFieldSet||function(t,i,s,e,n){ - if("m"===e)throw new TypeError("Private method is not writable"); - if("a"===e&&!n)throw new TypeError("Private accessor was defined without a setter"); - if("function"==typeof i?t!==i||!n:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return"a"===e?n.call(t,s):n?n.value=s:i.set(t,s),s} - ; - let vSt; - Object.defineProperty(wSt,"__esModule",{ - value:!0} - ),wSt.DEPRECATED_getWallets=wSt.getWallets=void 0; - const _St=new Set; - function MSt(t){ - SSt=void 0,_St.add(t)} - function bSt(t){ - SSt=void 0,_St.delete(t)} - Qt(MSt,"addRegisteredWallet"),Qt(bSt,"removeRegisteredWallet"); - const ySt={ - } - ; - function ESt(){ - if(vSt)return vSt; - if(vSt=Object.freeze({ - register:ASt,get:TSt,on:CSt} - ),"undefined"==typeof window)return vSt; - const t=Object.freeze({ - register:ASt} - ); - try{ - window.addEventListener("wallet-standard:register-wallet",({ - detail:i} - )=>i(t))} - catch(i){ - } - try{ - window.dispatchEvent(new kSt(t))} - catch(i){ - } - return vSt} - function ASt(...t){ - var i; - return(t=t.filter(t=>!_St.has(t))).length?(t.forEach(t=>MSt(t)),null===(i=ySt.register)||void 0===i||i.forEach(i=>OSt(()=>i(...t))),Qt(function(){ - var i; - t.forEach(t=>bSt(t)),null===(i=ySt.unregister)||void 0===i||i.forEach(i=>OSt(()=>i(...t)))} - ,"unregister")):()=>{ - } - } - let SSt; - function TSt(){ - return SSt||(SSt=[..._St]),SSt} - function CSt(t,i){ - var s; - return(null===(s=ySt[t])||void 0===s?void 0:s.push(i))||(ySt[t]=[i]),Qt(function(){ - var s; - ySt[t]=null===(s=ySt[t])||void 0===s?void 0:s.filter(t=>i!==t)} - ,"off")} - function OSt(t){ - try{ - t()} - catch(i){ - } - } - Qt(ESt,"getWallets"),wSt.getWallets=ESt,Qt(ASt,"register$1"),Qt(TSt,"get"),Qt(CSt,"on$1"),Qt(OSt,"guard$1"); - const ISt=class extends Event{ - get detail(){ - return gSt(this,lSt,"f")} - get type(){ - return"wallet-standard:app-ready"} - constructor(t){ - super("wallet-standard:app-ready",{ - bubbles:!1,cancelable:!1,composed:!1} - ),lSt.set(this,void 0),mSt(this,lSt,t,"f")} - preventDefault(){ - throw new Error("preventDefault cannot be called")} - stopImmediatePropagation(){ - throw new Error("stopImmediatePropagation cannot be called")} - stopPropagation(){ - throw new Error("stopPropagation cannot be called")} - } - ; - Qt(ISt,"AppReadyEvent"); - let kSt=ISt; - function xSt(){ - if(vSt)return vSt; - if(vSt=ESt(),"undefined"==typeof window)return vSt; - const t=window.navigator.wallets||[]; - if(!Array.isArray(t))return vSt; - const{ - register:i} - =vSt,s=Qt((...t)=>t.forEach(t=>OSt(()=>t({ - register:i} - ))),"push"); - try{ - Object.defineProperty(window.navigator,"wallets",{ - value:Object.freeze({ - push:s} - )} - )} - catch(e){ - return vSt} - return s(...t),vSt} - lSt=new WeakMap,Qt(xSt,"DEPRECATED_getWallets"),wSt.DEPRECATED_getWallets=xSt,function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),s(wSt,t)} - (pSt); - var RSt={ - } - ,PSt={ - } - ; - Object.defineProperty(PSt,"__esModule",{ - value:!0} - ); - var NSt={ - } - ; - Object.defineProperty(NSt,"__esModule",{ - value:!0} - ); - var LSt={ - } - ; - Object.defineProperty(LSt,"__esModule",{ - value:!0} - ); - var DSt={ - } - ; - Object.defineProperty(DSt,"__esModule",{ - value:!0} - ),function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),s(PSt,t),s(NSt,t),s(LSt,t),s(DSt,t)} - (RSt); - var GSt={ - } - ,BSt={ - } - ; - Object.defineProperty(BSt,"__esModule",{ - value:!0} - ),BSt.WALLET_STANDARD_ERROR__FEATURES__WALLET_FEATURE_UNIMPLEMENTED=BSt.WALLET_STANDARD_ERROR__FEATURES__WALLET_ACCOUNT_FEATURE_UNIMPLEMENTED=BSt.WALLET_STANDARD_ERROR__FEATURES__WALLET_ACCOUNT_CHAIN_UNSUPPORTED=BSt.WALLET_STANDARD_ERROR__USER__REQUEST_REJECTED=BSt.WALLET_STANDARD_ERROR__REGISTRY__WALLET_ACCOUNT_NOT_FOUND=BSt.WALLET_STANDARD_ERROR__REGISTRY__WALLET_NOT_FOUND=void 0,BSt.WALLET_STANDARD_ERROR__REGISTRY__WALLET_NOT_FOUND=3834e3,BSt.WALLET_STANDARD_ERROR__REGISTRY__WALLET_ACCOUNT_NOT_FOUND=3834001,BSt.WALLET_STANDARD_ERROR__USER__REQUEST_REJECTED=4001e3,BSt.WALLET_STANDARD_ERROR__FEATURES__WALLET_ACCOUNT_CHAIN_UNSUPPORTED=616e4,BSt.WALLET_STANDARD_ERROR__FEATURES__WALLET_ACCOUNT_FEATURE_UNIMPLEMENTED=6160001,BSt.WALLET_STANDARD_ERROR__FEATURES__WALLET_FEATURE_UNIMPLEMENTED=6160002; - var USt={ - } - ,FSt={ - } - ,$St={ - } - ; - function HSt(t){ - const i=atob(t); - return Object.fromEntries(new URLSearchParams(i).entries())} - function WSt(t){ - return Array.isArray(t)?"%5B"+t.map(WSt).join("%2C%20")+"%5D":"bigint"==typeof t?`${ - t} - n`:encodeURIComponent(String(null!=t&&null===Object.getPrototypeOf(t)?Object.assign({ - } - ,t):t))} - function VSt([t,i]){ - return`${ - t} - =${ - WSt(i)} - `} - function jSt(t){ - const i=Object.entries(t).map(VSt).join("&"); - return btoa(i)} - Object.defineProperty($St,"__esModule",{ - value:!0} - ),$St.decodeEncodedContext=HSt,$St.encodeContextObject=jSt,Qt(HSt,"decodeEncodedContext"),Qt(WSt,"encodeValue"),Qt(VSt,"encodeObjectContextEntry"),Qt(jSt,"encodeContextObject"); - var KSt={ - } - ; - Object.defineProperty(KSt,"__esModule",{ - value:!0} - ),KSt.WalletStandardErrorMessages=void 0; - const zSt=BSt; - KSt.WalletStandardErrorMessages={ - [zSt.WALLET_STANDARD_ERROR__FEATURES__WALLET_ACCOUNT_CHAIN_UNSUPPORTED]:"The wallet account $address does not support the chain `$chain`",[zSt.WALLET_STANDARD_ERROR__FEATURES__WALLET_ACCOUNT_FEATURE_UNIMPLEMENTED]:"The wallet account $address does not support the `$featureName` feature",[zSt.WALLET_STANDARD_ERROR__FEATURES__WALLET_FEATURE_UNIMPLEMENTED]:"The wallet '$walletName' does not support the `$featureName` feature",[zSt.WALLET_STANDARD_ERROR__REGISTRY__WALLET_ACCOUNT_NOT_FOUND]:"No account with address $address could be found in the '$walletName' wallet",[zSt.WALLET_STANDARD_ERROR__REGISTRY__WALLET_NOT_FOUND]:"No underlying Wallet Standard wallet could be found for this handle. This can happen if the wallet associated with the handle has been unregistered.",[zSt.WALLET_STANDARD_ERROR__USER__REQUEST_REJECTED]:"The user rejected the request"} - ,Object.defineProperty(FSt,"__esModule",{ - value:!0} - ),FSt.getHumanReadableErrorMessage=tTt,FSt.getErrorMessage=iTt; - const YSt=$St,qSt=KSt; - var XSt,JSt; - (JSt=XSt||(XSt={ - } - ))[JSt.EscapeSequence=0]="EscapeSequence",JSt[JSt.Text=1]="Text",JSt[JSt.Variable=2]="Variable"; - const QSt="i",ZSt="t"; - function tTt(t,i={ - } - ){ - const s=qSt.WalletStandardErrorMessages[t]; - if(0===s.length)return""; - let e; - function n(t){ - if(e[ZSt]===XSt.Variable){ - const n=s.slice(e[QSt]+1,t); - h.push(n in i?`${ - i[n]} - `:`$${ - n} - `)} - else e[ZSt]===XSt.Text&&h.push(s.slice(e[QSt],t))} - Qt(n,"commitStateUpTo"); - const h=[]; - return s.split("").forEach((t,i)=>{ - if(0===i)return void(e={ - [QSt]:0,[ZSt]:"\\"===s[0]?XSt.EscapeSequence:"$"===s[0]?XSt.Variable:XSt.Text} - ); - let h; - switch(e[ZSt]){ - case XSt.EscapeSequence:h={ - [QSt]:i,[ZSt]:XSt.Text} - ; - break; - case XSt.Text:"\\"===t?h={ - [QSt]:i,[ZSt]:XSt.EscapeSequence} - :"$"===t&&(h={ - [QSt]:i,[ZSt]:XSt.Variable} - ); - break; - case XSt.Variable:"\\"===t?h={ - [QSt]:i,[ZSt]:XSt.EscapeSequence} - :"$"===t?h={ - [QSt]:i,[ZSt]:XSt.Variable} - :t.match(/\w/)||(h={ - [QSt]:i,[ZSt]:XSt.Text} - )} - h&&(e!==h&&n(i),e=h)} - ),n(),h.join("")} - function iTt(t,i={ - } - ){ - { - let s=`Wallet Standard error #${ - t} - ; - Decode this error by running \`npx @wallet-standard/errors decode -- ${ - t} - `; - return Object.keys(i).length&&(s+=` '${ - (0,YSt.encodeContextObject)(i)} - '`),`${ - s} - \``} - } - Qt(tTt,"getHumanReadableErrorMessage"),Qt(iTt,"getErrorMessage"); - var sTt=pi&&pi.__rest||function(t,i){ - var s={ - } - ; - for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&i.indexOf(e)<0&&(s[e]=t[e]); - if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){ - var n=0; - for(e=Object.getOwnPropertySymbols(t); - n<e.length; - n++)i.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(t,e[n])&&(s[e[n]]=t[e[n]])} - return s} - ; - Object.defineProperty(USt,"__esModule",{ - value:!0} - ),USt.WalletStandardError=void 0,USt.isWalletStandardError=nTt; - const eTt=FSt; - function nTt(t,i){ - return!!(t instanceof Error&&"WalletStandardError"===t.name)&&(void 0===i||t.context.__code===i)} - Qt(nTt,"isWalletStandardError"); - const hTt=class extends Error{ - constructor(...[t,i]){ - let s,e; - if(i){ - const{ - cause:t} - =i,n=sTt(i,["cause"]); - t&&(e={ - cause:t} - ),Object.keys(n).length>0&&(s=n)} - super((0,eTt.getErrorMessage)(t,s),e),this.context=Object.assign({ - __code:t} - ,s),this.name="WalletStandardError"} - } - ; - Qt(hTt,"WalletStandardError"); - let rTt=hTt; - USt.WalletStandardError=rTt; - var oTt={ - } - ; - function aTt(...t){ - "captureStackTrace"in Error&&"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(...t)} - Object.defineProperty(oTt,"__esModule",{ - value:!0} - ),oTt.safeCaptureStackTrace=aTt,Qt(aTt,"safeCaptureStackTrace"),function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),s(BSt,t),s(USt,t),s(oTt,t)} - (GSt); - var cTt={ - } - ,lTt={ - } - ; - !function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.Connect=t.StandardConnect=void 0,t.StandardConnect="standard:connect",t.Connect=t.StandardConnect} - (lTt); - var uTt={ - } - ; - !function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.Disconnect=t.StandardDisconnect=void 0,t.StandardDisconnect="standard:disconnect",t.Disconnect=t.StandardDisconnect} - (uTt); - var dTt={ - } - ; - !function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.Events=t.StandardEvents=void 0,t.StandardEvents="standard:events",t.Events=t.StandardEvents} - (dTt),function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),s(lTt,t),s(uTt,t),s(dTt,t)} - (cTt); - var fTt,pTt={ - } - ,wTt={ - } - ,gTt=pi&&pi.__classPrivateFieldGet||function(t,i,s,e){ - if("a"===s&&!e)throw new TypeError("Private accessor was defined without a getter"); - if("function"==typeof i?t!==i||!e:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return"m"===s?e:"a"===s?e.call(t):e?e.value:i.get(t)} - ,mTt=pi&&pi.__classPrivateFieldSet||function(t,i,s,e,n){ - if("m"===e)throw new TypeError("Private method is not writable"); - if("a"===e&&!n)throw new TypeError("Private accessor was defined without a setter"); - if("function"==typeof i?t!==i||!n:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return"a"===e?n.call(t,s):n?n.value=s:i.set(t,s),s} - ; - function vTt(t){ - const i=Qt(({ - register:i} - )=>i(t),"callback"); - try{ - window.dispatchEvent(new MTt(i))} - catch(s){ - } - try{ - window.addEventListener("wallet-standard:app-ready",({ - detail:t} - )=>i(t))} - catch(s){ - } - } - Object.defineProperty(wTt,"__esModule",{ - value:!0} - ),wTt.DEPRECATED_registerWallet=wTt.registerWallet=void 0,Qt(vTt,"registerWallet"),wTt.registerWallet=vTt; - const _Tt=class extends Event{ - get detail(){ - return gTt(this,fTt,"f")} - get type(){ - return"wallet-standard:register-wallet"} - constructor(t){ - super("wallet-standard:register-wallet",{ - bubbles:!1,cancelable:!1,composed:!1} - ),fTt.set(this,void 0),mTt(this,fTt,t,"f")} - preventDefault(){ - throw new Error("preventDefault cannot be called")} - stopImmediatePropagation(){ - throw new Error("stopImmediatePropagation cannot be called")} - stopPropagation(){ - throw new Error("stopPropagation cannot be called")} - } - ; - Qt(_Tt,"RegisterWalletEvent"); - let MTt=_Tt; - function bTt(t){ - var i; - vTt(t); - try{ - ((i=window.navigator).wallets||(i.wallets=[])).push(({ - register:i} - )=>i(t))} - catch(s){ - } - } - fTt=new WeakMap,Qt(bTt,"DEPRECATED_registerWallet"),wTt.DEPRECATED_registerWallet=bTt; - var yTt,ETt,ATt,STt,TTt,CTt,OTt={ - } - ,ITt=pi&&pi.__classPrivateFieldGet||function(t,i,s,e){ - if("a"===s&&!e)throw new TypeError("Private accessor was defined without a getter"); - if("function"==typeof i?t!==i||!e:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return"m"===s?e:"a"===s?e.call(t):e?e.value:i.get(t)} - ,kTt=pi&&pi.__classPrivateFieldSet||function(t,i,s,e,n){ - if("m"===e)throw new TypeError("Private method is not writable"); - if("a"===e&&!n)throw new TypeError("Private accessor was defined without a setter"); - if("function"==typeof i?t!==i||!n:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return"a"===e?n.call(t,s):n?n.value=s:i.set(t,s),s} - ; - Object.defineProperty(OTt,"__esModule",{ - value:!0} - ),OTt.guard=OTt.pick=OTt.concatBytes=OTt.bytesEqual=OTt.arraysEqual=OTt.ReadonlyWalletAccount=void 0; - const xTt=class t{ - get address(){ - return ITt(this,yTt,"f")} - get publicKey(){ - return ITt(this,ETt,"f").slice()} - get chains(){ - return ITt(this,ATt,"f").slice()} - get features(){ - return ITt(this,STt,"f").slice()} - get label(){ - return ITt(this,TTt,"f")} - get icon(){ - return ITt(this,CTt,"f")} - constructor(i){ - yTt.set(this,void 0),ETt.set(this,void 0),ATt.set(this,void 0),STt.set(this,void 0),TTt.set(this,void 0),CTt.set(this,void 0),new.target===t&&Object.freeze(this),kTt(this,yTt,i.address,"f"),kTt(this,ETt,i.publicKey.slice(),"f"),kTt(this,ATt,i.chains.slice(),"f"),kTt(this,STt,i.features.slice(),"f"),kTt(this,TTt,i.label,"f"),kTt(this,CTt,i.icon,"f")} - } - ; - Qt(xTt,"ReadonlyWalletAccount"); - let RTt=xTt; - function PTt(t,i){ - if(t===i)return!0; - const s=t.length; - if(s!==i.length)return!1; - for(let e=0; - e<s; - e++)if(t[e]!==i[e])return!1; - return!0} - function NTt(t,i){ - return PTt(t,i)} - function LTt(t,...i){ - const s=i.reduce((t,i)=>t+i.length,t.length),e=new Uint8Array(s); - e.set(t,0); - for(const n of i)e.set(n,e.length); - return e} - function DTt(t,...i){ - const s={ - } - ; - for(const e of i)s[e]=t[e]; - return s} - function GTt(t){ - try{ - t()} - catch(i){ - } - } - OTt.ReadonlyWalletAccount=RTt,yTt=new WeakMap,ETt=new WeakMap,ATt=new WeakMap,STt=new WeakMap,TTt=new WeakMap,CTt=new WeakMap,Qt(PTt,"arraysEqual"),OTt.arraysEqual=PTt,Qt(NTt,"bytesEqual"),OTt.bytesEqual=NTt,Qt(LTt,"concatBytes"),OTt.concatBytes=LTt,Qt(DTt,"pick"),OTt.pick=DTt,Qt(GTt,"guard"),OTt.guard=GTt,function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),s(wTt,t),s(OTt,t)} - (pTt),function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),s(pSt,t),s(RSt,t),s(GSt,t),s(cTt,t),s(pTt,t)} - (fSt); - var BTt,UTt,FTt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ,$Tt=pi&&pi.__classPrivateFieldGet||function(t,i,s,e){ - if("a"===s&&!e)throw new TypeError("Private accessor was defined without a getter"); - if("function"==typeof i?t!==i||!e:!i.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return"m"===s?e:"a"===s?e.call(t):e?e.value:i.get(t)} - ,HTt=pi&&pi.__classPrivateFieldSet||function(t,i,s,e,n){ - if("m"===e)throw new TypeError("Private method is not writable"); - if("a"===e&&!n)throw new TypeError("Private accessor was defined without a setter"); - if("function"==typeof i?t!==i||!n:!i.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return"a"===e?n.call(t,s):n?n.value=s:i.set(t,s),s} - ; - Object.defineProperty(dSt,"__esModule",{ - value:!0} - ),dSt.SolanaStandardProvider=void 0; - const WTt=U_t,VTt=rbt(),jTt=fSt,KTt=class{ - constructor(t){ - this.wallet=t,BTt.set(this,void 0),UTt.set(this,void 0)} - getVersion(){ - return this.wallet.version} - supportChains(t){ - return 1===t.length&&t[0]===WTt.SOLANA_CHAINS.MAINNET} - send(t){ - return FTt(this,void 0,void 0,function*(){ - try{ - try{ - (0,VTt.logDebug)("SolanaStandardProvider send request:",JSON.stringify(t))} - catch(i){ - } - const s=VTt.chainIdToStandardChainIdMap.get(t.chainId); - if(!s)throw new WTt.OKXConnectError(WTt.OKX_CONNECT_ERROR_CODES.CHAIN_NOT_SUPPORTED); - const e=t.method; - let n; - if(t.injectParams&&this.wallet){ - let i=t.injectParams; - switch(e){ - case"solana_signMessage":let t,e=this.wallet.features["solana:signMessage"],h=i.message,r=(new TextEncoder).encode(h); - if(e)switch(e.version){ - case"1.0.0":case"1.1.0":let i={ - message:r,account:this.wallet.accounts[0]} - ; - t=yield e.signMessage(i)} - t&&(n={ - method:"solana_signMessage",injectResult:t} - ); - break; - case"solana_signTransaction":if("transactionBuffer"in i){ - let t=yield this.signTransaction(i.transactionBuffer,s); - t&&(n={ - method:"solana_signTransaction",injectResult:t} - )} - break; - case"solana_signAndSendTransaction":let o,a=this.wallet.features["solana:signAndSendTransaction"]; - if(a&&"transactionBuffer"in i&&"1.0.0"===a.version){ - let t={ - transaction:i.transactionBuffer,account:this.wallet.accounts[0],chain:s} - ; - o=yield a.signAndSendTransaction(t)} - o&&(n={ - method:"solana_signAndSendTransaction",injectResult:o} - ); - break; - case"solana_signAllTransactions":let c=[]; - if("transactionBufferArray"in i&&Array.isArray(i.transactionBufferArray))for(const n of i.transactionBufferArray){ - const t=yield this.signTransaction(n,s); - c.push(t)} - c&&(n={ - method:"solana_signAllTransactions",injectResult:c} - )} - } - if(!n)throw new WTt.OKXConnectError(WTt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED); - return n} - catch(frt){ - throw(0,VTt.logDebug)("solana request send error:",frt),frt} - } - )} - signTransaction(t,i){ - return FTt(this,void 0,void 0,function*(){ - let s,e=this.wallet.features["solana:signTransaction"]; - if(e&&"1.0.0"===e.version){ - let n={ - transaction:t,account:this.wallet.accounts[0],chain:i} - ; - s=yield e.signTransaction(n)} - return s} - )} - removeListener(){ - const t=$Tt(this,BTt,"f"); - t&&(HTt(this,BTt,null,"f"),t())} - addAccountChangedListener(t){ - if(this.wallet.features["standard:events"]){ - let i=this.wallet.features["standard:events"]; - i&&"1.0.0"===i.version&&HTt(this,BTt,this.wallet.features[jTt.StandardEvents].on("change",i=>{ - if("accounts"in i){ - const i=this.wallet.accounts[0]; - $Tt(this,UTt,"f")&&i!==$Tt(this,UTt,"f")&&t(i?i.address:void 0)} - "features"in i&&t(void 0)} - ),"f")} - } - connect(t){ - return FTt(this,void 0,void 0,function*(){ - this.wallet.features["bitkeep:"]&&(yield new Promise(t=>{ - setTimeout(t,400)} - )),this.wallet.accounts.length||(yield this.wallet.features[jTt.StandardConnect].connect(t))} - )} - getAccount(t){ - return FTt(this,void 0,void 0,function*(){ - yield this.connect(t); - let i=this.wallet.accounts[0]; - HTt(this,UTt,i,"f"); - let s=i.address; - return{ - namespace:WTt.NameSpaceKeySOL,addresses:[`${ - WTt.SOLANA_CHAINS.MAINNET} - :${ - s} - `],methods:[],extra:{ - } - } - } - )} - disconnect(){ - return FTt(this,void 0,void 0,function*(){ - if(this.wallet.features["standard:disconnect"])return this.wallet.features["standard:disconnect"].disconnect()} - )} - } - ; - Qt(KTt,"SolanaStandardProvider"); - let zTt=KTt; - dSt.SolanaStandardProvider=zTt,BTt=new WeakMap,UTt=new WeakMap,function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),s(dSt,t)} - (uSt),function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),s(cAt,t),s(gAt,t),s(uSt,t)} - (aAt); - var YTt={ - } - ; - !function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.wallets=t.WalletNames=void 0; - const i=U_t; - t.WalletNames={ - BitKeep:"Bitget Wallet",Nightly:"Nightly",Petra:"Petra",Pontem:"Pontem Wallet",BackPack:"Backpack",Coin98:"Coin98",MagicEden:"Magic Eden",Phantom:"Phantom",Solflare:"Solflare",Trust:"Trust",AptosGoole:i.AptosGoogleWalletName,AptosApple:i.AptosAppleWalletName} - ,t.wallets={ - [t.WalletNames.BitKeep]:{ - icon:"data:image/jpeg; - base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAMCAggGCAgGCAgICAgICAcHCAgHCAkIBgYICAYIBggICAcICggICAgJBggICBYICAgICQsJBwkXGAoIDQcICQgBAwQEBgUGCAYGCA0ICQ0JCA4ICA4NDQ4JCAkICAgICggIDQgICAgICggICAgICg4ICAgICAgIDQgICAgICAgICP/AABEIAHgAeAMBEQACEQEDEQH/xAAcAAEBAAIDAQEAAAAAAAAAAAAACAEJAwQHBQL/xAA2EAACAgEDAgMDCQkBAAAAAAABAgADEQQFIQgxEhNBFDJRBiI0QmFjlbHUCRUZIyRDU1WBM//EABwBAQACAwEBAQAAAAAAAAAAAAABBgMHCAIFBP/EAD8RAAIBAgMFBAMNCAMAAAAAAAABAgMRBAVBBhIhMVETImFxB0KRFFJVYpKTorHB0tPh8BYXIzJDU4GhFSQz/9oADAMBAAIRAxEAPwDXPPtlUEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEAQBAEASCRJIEAQBAEAQBAEAQBIB+XfAJ+AJ478DMklK7SKw2X9n/fdTXbZu1NbuiuUr0TXIhYeLwrd7VV5gGfe8tM/ASzUshqVIqaqpXXLdbt9JfUaSx/pTwuExFSh7inPdk1v9pGO9bWzpS3b9N526s7v8PG3/AHNf4a362Zf2dq/3o/Jf3z5/738L8H1Pno/gHxvlX0C67T0vdpdfTrbVBYadtOdI1uBnw12tfehsPYLYK0JxmxBkzDWyGtTi5Rmpv3trf7cnp5eaPqZb6U8vxdaNKtQnhot27VzU0m+V1GnB2vzau0uUZPgTJrtC9DtTYjV2IxR0dSrowOCrKcEEH0MrcouLs1Z9DctOpGpFTg1KLV1JcU09VY4JB7EASAJIEAQBAEAQBAEAq7pV6ovZTXsu4v8A0/Fel1LnnTdgtNp9afQOeU7crjw2nKs0dNqlVfd0fTw8jR+3WxEcbGWPwUbVVd1YL+pq5r43Va81qWyrZAI5BAII5BB5BB9Rj1l6TTV0ctzpypycZKzT4roZnoxngPUt00V75W2u0qrXuCL9gXWKo4R/vAOA5/KVnNMrVZOpTVpa+JurYjbeeXyjg8W3Ki33Za02+nh16+Zr93Db3od6bUZLK2KOjjDoynBUg9iDKFKLi2nwfQ6qpVYVYKcGpRaTjJcmnqjrzwZBJAgCAIAgCAIAgCAIBWHS71VeymvZ9zs/kEhNNqnP0cngV3Mf7RPAf6p78HItWV5p2bVKq+GkunmaN232FjjIyxuBjaqk3OmvX6uNtdWvZ0LXU55HY8gjsZeU0+KOXalOVOTjJWa5ozPRjJ66nOmNd7U7jogqbii/OX3a9wRRwrHsuoUcLaeGGFbjy3prGaZWqydWkrS1XvvzN37DbcvL2sDjm5UG+5P1qTf1weq5p96PHejOBNw296Hem1GrsRijo4KujA4IZTyCDKHKLi2nweqOpaVWFWCnBqUWk4yXJp6o688mQQBAEAQBAEAQBAEAQCr+lbqjOlNezblYTQcJpdS5y2nPYU2seTV2AY8p25GMWnKs0dNqlVfd0fTwNHbc7ERxkZY7BRtVV3UprlP40UuT69ea1LYVs8jkHkEcgg8gg+ox6y9ppq6OXJ05U5OMlZp8UZkng8B6mOmmvfK212lVU3CtSeOF1iqPcf7zHAcysZplirJ1KatLVdTdOxG28svnHB4uW9Rb7snzpt6+Xh9pr51GnatmRgVZSVZTwVZT4SCPiCMShNNOzOrITU4qUXdNJp6NNXTXmjjkHoQBAEAQBAEAQBIAkgQDY50i/vD90J7f48eP+j83/wBfZvCMeLPzsePxY8X1cfbNi5N2vY/xOXq9bHIHpG9w/wDI/wDTtvW/jW/l37vlbwtfxvbge2SwGpxIYV7q3PQ1h9TLVH5Qbr5OPL9oTt7vmjSUDUYxx9M87/uZqvMLe6au7y3lb5Mb/Sud1bIqqslwXbX7Tspb1+f/AK1N36G7b4tjzOfPLaIAgCAIAgCAIAgCAVf0rdLh1Jr3ncqyKBh9LpnGG1B7i61TyKuxCnl+/Axm05VlbqNVaqtHRdfE0dtztvHBxlgcFK9V3VSouUF72LWvXpyWpbCrjgDAHAA7ADgAD0AEvSSSsjlypUlUk5Sd23xZmejGeA9THUrXsdbaHSMr7hYuOOV0SsPff7zHIQ/lKxmmaKknTpu8tX0N17EbETzCccZjI7tFPuxfOo1p5eP2mvrU6lrGaxyWZ2LMzHLMzHxEk+pJOZQm23dnVUIRhFRirJJJLRJKyS8kcUg9iAIAgCAIAgCAIBWHS70q+0mvd9zr/kAh9NpXH0gjkWXKf7QPIT6x78cG05XlXaNVaq7ukevn4Gjtt9uo4OMsFgZXqtNTqL1OqjbXRv2dS11GOB2HAHoJeklFWRy5UnKpJyk7t82Znoxk89TnU4uyKdu0RV9xdfnP71e3ow4Zh2bUMOVqPCj5zceWl1YzTNFRXZUuMtX738zd+w2wzzBrHY5ONBPuU+Uqsl9UFq+bfdjx3pQgXcNwe93utdrLHYu7uSzuxOSWY8kkyhSk5O74s6lpUoUoKEEoxSSjFcklojrzyZBJAgCAIAgCAIAgkq7pW6XDqjXvO5V4oGH0umcc6k91utHpV6hDy/fhceK05VlbqNVaq7vqrr4+Ro7brbeOCjLA4KV6r4Vai9RaxXj1enJalsquBgDAHAA4AA4AA9ABL2kkrI5bqTlUk5yd2+b6mZJjPAepbqXr2OttDpWWzcHX7CujVhw7j/JjkIfylYzTNFRTp03eWr6G6tiNiJ5hKOMxkXGineMdajXTw69PM1+7huD3u91rs9ljF3dzl3ZjksSe5JlCbcnd8X1OqqVOFKChBKMUkoxXJJaI68gyCAIAgCAIAgCAIBh0yCPiCOO/IxBKdmn+uBV+y/tAL6aa6bNppsdEVGsTXNSlhVfD4hT7Lb5YOM+DzHx8TLNSz6pTiodknZc95q/+Nx29ppHH+izC4zEVK/u2cN6Te52cZbt9LurHet13VfnZHd/iHW/6av8AEm/RTL+0VX+zH5T+4fg/dBhfhCp8zH8c+P8AKrr61uopenS6CnRWupUag6k6pqsjHirqaihPGBkhnNig4yjgEHDVz6tUi4qChw/mTu17YpfrkfTy70V5fhK0atbESxMU79k4KCk1yu41ZStfnZJtcFKL4qY9drnudrrHayx2Lu7sWd2JyWZjkkk+plbbcndu7Ny06cacVCCUYpWSXBJLRWOCQZRBAgCAIAgCAIAgCAIAgkQQIAgCAIAgCAIAgCAIAgCAIAgCAIAgCAIAgCAIAgCAIAgCAIAgCAIAgCAIAgCAIAgH/9k=",downloadUrl:"https://chrome.google.com/webstore/detail/bitkeep-bitcoin-crypto-wa/jiidiaalihmmhddjgbnbgdfflelocpak"} - ,[t.WalletNames.Petra]:{ - icon:"data:image/png; - base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAABHNCSVQICAgIfAhkiAAACChJREFUeJztnW1oHNUagJ8zuzbRGI1BW7BN/GhaK2otaIN4iz8tCHoLIlKV23wIhaJc6C8vgvjH6B/RC4JgbbrFIuhFof2jBjSgrdVoUVEhaio12SStTVNNbTapu3PujzfTpOlXPmY7Z07eB4bt7s5u3+TJe2bOnPPOMcwC29RUibW3kc0+grUNWNuIMXWz+Q5llljbC/QQBF0Ui++YnTu/nc3HzUW/v7U1oFRaRibThLX/BmrnGKoSD/0Y8zal0mtkswPmzTeLF9r5goJtc/MSjHkceBYV6xongFcIw+3kcr3nE3nO121ra5YwXIsxzwP3lytCJRY6sLaNINhntm8/K5vPEmxbWjLAQ8BLwMpLEKAyf34GngH2mPb20tQ3gqlPbHNzFpHbhspNEysRZw/Z1tbs1DdOC7aFAhjzDyRzV13a+JQYWAW8RBiunfri6SbaNjfXY8w29JibdjoIw3+ZXO4ITGSwffLJLMa0onJ94H4ymcftli0BRE10sXg9sDXJqJQYsfZZCoVlEAnOZJ4GrkwyJiVWaoEmmDgG25aWPLA0wYCU+BkmDJcGtqlpDSrXR2qB2wKMeTTpSJQyYcwjAdCYdBxK2VgRYExD0lEoZcKYtQFQn3QcStmoCy6+j5JmVLDnqGDPUcGeo4I9RwV7jgr2nIUhuFSa2Wse4q/gMIRCAf76C268ETKZyfeCAOrqYGgIxsZkX0/JXnyXFGEt/P23SL32Wli/Hu6+G8bH4Y03YGRE9rv6ati8Wfb74gv4/HORXVUFl10G5qL1AKnBD8GlEoyOiqDGRrjvPsnaykqoqID+/klp1koG19bCsmWy34MPwm+/wd698OmnkM3KZ6dmfUpJr+AwlMw8eRKWL4cnnoA774RrrhExU7PQWtnO9byyUrbaWli9GjZuhH37oLNT/jAqKmRLaVanR3AkpFiEEyeguho2bIB77oH6GMZLjJHMve46+d4NG6CvDz75BN57T5ruqirZJ9o/BbgtOMq0SK61cMst8PDD8ljuX3JdHWzaJNuBA/DRR9DdLS1EGMr/H22O4p7gSGgYStZcfjncdJM0v+vWSXOZBHfdJdsff8APP0BHBxw/LoeIUkkkB+51StwSXCpJE1hTI8fS22+HNWvghhuSjmySmhr5Q1u3Dg4ehC+/hHweDh8W+WHo1MmZO4KDQM5q77gDbr0VVqyARYuSjurCLF8u26lT0nR//71k9++/Jx3ZadwQHIZy0rR+Pdx7b9LRzJ5Fi+QMfPVq+PhjePdd6Y87cGx256ARBHLMTTvZrFPHYncigTP7qmnFsZ/BLcFK7Khgz1HBnqOCPUcFe44K9hwV7DkqOG4cuHo1FRXsOSo4bkZGZEKCI5msguOkWJTxYYdmaargODl2DI4edWo8WAXHydAQDA6qYG85elQG+3W40EOOHYOeHqmmcOQEC1RwfAwOypQdx6YZqeA4KBTg119heNip5hlU8PyxVuTu3+/UyVWECp4vx4/DZ59JmYsK9oyxMejqki3rxgTV6ajg+dDXBx9+OFnG4iAqeK4cOgSvvy7VDA42zRFutiuuk89DW5uUrzraNEdoBs+W3l7YujUVckEFz5wwlBLSLVvOrBN2nHREmSTFIvz5J7z/PuzeDYsXO3tCdS5U8PkoFKQb9M03sGuXNMlLliQd1axZmILPV5Uf3XZpdFTEdnbK6FB0H48UsvAEGyOlnfm8HEvDUOp7CwW5085338mo0Pi4VDtecUXSEc+LhSc4CGRazVtvyYnS+LhU5588KfIrKqRfm9KMnc7CEwwyQNDXJ4/RvTWu9HNdsIUpGJy++hQn2g/2HBXsOSrYc1Sw57gjuFiUTYkVNwQbIxcaCoWkI/EOFew5bgiOOHxYRm6U2HBHcCYDAwNO3efRB9wSnM+r4JhxR3B0HB4YkOE6JRbcEQySxQcOyLwnJRbcE9zfL1NST51KOhovcEswyNDd/v0ynKfMG/cEZ7NSzPX113IzE2VeuCcYRHJnp9wmf4GsMVgu3BQcTav54APpOilzxk3BIJXyBw/KlNWhoaSjSS3uCgZpqru7Ydu2yYUllVnhtmCQTO7uhhde0EyeA+4LBsnkwUF47jl5VGZMOgSDTEIfHYXHHpM6IWVGpEcwyJWum2+WhaeeekqWlSuVnLo3pGukc150VZXUEL38MjQ0wAMPyGNNjTTn00s7HV8htJykUzBINldXy7XrV1+Fq66S1b9XrZJVvaurJ9cEHhlZsFlubEuLW0t1zRVrpahsfFz+vXixZHRVlTw/dGhBSk5vBk/HGOlSRbcSHB2Vq2HRUnMpqciPG39/asduKZgU+lvwHBXsOSrYc1Sw56hgz1HBnqOCPScAdPqiv/QGGPNV0lEoZcLanoAw/CXpOJSy0RVg7f+SjkIpE9a+EwA/AsNJx6LETr/J5b4NTC43hrX/TToaJXbehsluUg7NYp84gbWvQSQ4DPNY25ZoSEqcvIIxAzAh2OzcGQK7gI4ko1JioYMw3G7a24sw5UqW2bHjCNY+D2i3Kb38jLUvksudrqA/81JlEHwFPAP8dIkDU+bPT8B/CIK9U+ePnjWX1La0ZIB/Ai8CKy9RcMr8+AVJzN2mvf2MetuzBhtMe3sJY/Zg7Wb0mJwGOrB2E8bsmS4XzpHBERagubkeaMWYrYCft0RPL8MTPZ9dZseOI+fb6aLT/W1TUxZjrgeexpiNwNIYg1Rmz/DEhakcYZif6AGdl1nXc9impjUY8yjQCDRgTP0cA1VmgrV9GNOFtT0T4wY/mlxubKYf/z/Dhnu5uHkRfgAAAABJRU5ErkJggg==",downloadUrl:"https://chrome.google.com/webstore/detail/petra-aptos-wallet/ejjladinnckdgjemekebdpeokbikhfci"} - ,[t.WalletNames.Pontem]:{ - icon:"data:image/png; - base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAABHNCSVQICAgIfAhkiAAAAF96VFh0UmF3IHByb2ZpbGUgdHlwZSBBUFAxAAAImeNKT81LLcpMVigoyk/LzEnlUgADYxMuE0sTS6NEAwMDCwMIMDQwMDYEkkZAtjlUKNEABZgamFmaGZsZmgMxiM8FAEi2FMk61EMyAAAgAElEQVR4nOx9d5xUVdL2U3Xu7Z6eABJdUVFBUZKEISkqDBkDZhDTumtAXVcx7Lqru4hZ14TsqoDuruvKSnBNqOQBAwo4JEkGgqigAgrMMDPdfe+p+v643T3dExBwZnzf7/vq97sdbjp16zl1Tp2qOucS/geT3roN9FgLKJRw8QLCjveI5t5lM05qPAIb23VuQrCtRbUNgVtD6ShAD1fgUCI0VqABQBGChgBAAY+AUgXtBXQngO0AbQWwBaQbGPS5qtnUeuXMnShdmMnTwLEGzU5T/KdACaRJHv+nEv3cDFQmxUVAry7A4tsJI6bQ4ti3OOm10bLw6N9Qo0Obh12HjSumo0PmZCU9WaFdFXqMASPbhMBEUFUIFL4qfBWIWggUqkEZRACDYGBgmGFAMMQgAkQV5TYOHwpW2gRgBYE+8FU+8Nhfrb7632//Nn7a5qf1w3PGca/wYcDUEYpfP6wYsAJ08ZSfVX6V6X8MwHr5G4DvA3O/JBy6FbTmEV3c7UHOc6WBIWoaJtNTgSEC6SuqR+Q5ERAATyziYmEhqoAAKolbEgGkIKKK50x+a/KbABFoageBQIAxYAqxgcsGCqDEj4IJXzswhaI6Jw5ZYlV27ra7i3svfUT0jlsJhx4BzD9KcYgDemFYPUlu3/SzA/z24AthS06gns3y0fz1cxQAVve8p4FB6LCw43Qn0rOs2IEhNo1ccuGpRVQ8KOADCgIREmACICZSACAkfkCRgasmzk78p+CYKgANPkmD/8EuqAaww8liFy4ZxNWDJ3aXITNPIa/HrC0S4JsOi+8oBoDt57xKS7Yvx56mRi99Y2y9yLEm+lkBfqfPfdT+qzu16aaAjTW9HjqMCCeG2QwAMIyJ2rhkAi1VK6oqIIBATAAbYg20FBAVMLG6ZMoMcTmDykGIimpcoT4Aq1BJAMwEGAI5DAoByBJoxFfJ9tVGRIWYGISgSlgVUkAUwQ8QsUuGXTLwg7bjcwLNiFtvjq/4uOOSP34DADua30JNT+0F+u9wrV4CdU8/C8D/unAoXW5GgaYEGvtxr4eOCbHp5ZIZZlWGGqKGTISY+CqaanLZISZDDEXQt4bZ2eOS2S6qO6Li7RSVrQrdpsAOge4kwi4AJQqUOkpxn9QP1NI6DA6rIgJQAyY0IqKmAJqRUgtDdHgWh5oSUTNfbfOY+A0dYhAIVgU+RAEIFGAiDpNDAoVV2eOQmempvOFbu6j9ktu/BAAd/hqh0xLQnQ/WO9D1CrACWNl5Ene57hrBKGBVrwcOD7M7KETueRa2H4GyFYq4WCWoBKpG7JCBBDjbMLtbiPDZXi+6CazrVGmTqGwOkW49/sM7SmqDz097P5oXt/7hIBzDRK2hOCHHhFsT6PiYeC0BMkwEXy2silDQiJBLhjmogKUMmhMV+1rMjxd2+eiOrwHgo44TudvqUVKfQq+3suYV3M0nrrxLm++CFvV8LJRl5IIIuxeIykAC5VoV+Gol0fexS4YMMawKHDIbAF0RE69ISNeR0prv1q35st+eF6RyOS9eNJ0a7vmGepV9j6ZEWAlghwr6Nm0Llw2AwDBbuHM9mhGjM4Cdqlic3QR7Gh6ml065sIqWTWtzNx/fONzSgDoyUdswu90A6uKrPTbJo6+S5J1cYubANCghpflReNNLfXq559Lb4jtwFH1c8Cvqv2BsFd7rguocYIUCp/6N6b3fCgCs7vnwycp8TY4JD/XEb64AfLWpWu2SwyBAVUsdMot89RfExV+mrGs6ffCHbyru/E8Ut+1HRYc+S16oITjSTQe83lfpJz6SQjHv7AdIyneTG89Ft+8Wa4P1MzNA//ikv7SAanuXnXyXnH6+2pMJlAMoPLUpK94lQwIgzM72UhubCcGkjkt+9wEArOo8mU9cebH8VH5/jOr07nrRNEJJS9BbvXR57wcPcaw7qoETGVlio51cYsTVpoYrLhk2xPDV7jLgGXH1Z1rI8p1edOOAojEWCNRjQd+7mEB4faHqONxdL33aaIyls/uCFIqChXenKuPbXW43LcJNWhuYriE2Q63KWQ6bRlYFnlohBZRAITbkiSDPZK3aY0v/45M+m//B7bv0zMWE3C9BU+rOCKszgD/sMomPbNxAj5h/kS7v+ZeTs034DwD6KzTbEwGgqqTKYA6zg5j4e102/4qp95paWt158S3fgQjfNAH9os0tQItuwMqXlDbOqCuW94u09VlA55GEbUXYseFxbb4DwKPAx9Meba5EnUPGucBXe3GY3Zy49dSSKikIIHKZQURlUMwvldiD+Yt//+Gmgsn03e5SOmnFNXXSZNc6wAoAvW5kWjxe5h37CjdusnlUQydyY0y8E3yt8Ccp1EZMyLEqENUpPuQZga7q+uGtezAWePTLX1HHr7ui9XfL9dhV/6xtNmuFNnQahY2HNqL3jnwI9x4HpT8ART0ea+SCOhrD1xLRSIcY5TbuE8gAABGRA0aY3U+K/fLxnfOumEDzmqj2upGxeHytG2C1er/rcCMOxyH8J9wjy3s+3Azk3p/F7iWimuWrJQCkEJ+InTwTwV6/fDWxuT3ml7/ffentJRubPsetdn6m04dF4WdP14unfPOjZf5PoKcuOgODylrTsW/kAr1XgRa9pUt7/CUvy3FPUcHDuU6k415bDqvqM8gBoC6xEnE0JvEXRe2f8pf8fsd9GMNbsVuewfha463WAH7+stmIlO/mES+PkMXd/3J8Azd7vAKD4uKn+heF+rkmyy2VGIzSHXtk76OntvjCm7eHuP+CQ3Vx95ba66M1IDxZW2zVKynGAgMAzPNofsH3NGD3BFlo7nWbug1vias8lGvC2GujHoFcBG40hMghAuYUe2U39vro959OvWAql0cOkSv+PbhWeKoVgBf0HQDLJ5kBhffaJd0f69TAzZ6sQPtyiQmBOOEjpgZOhPb60c2etUN7fHTLpwAwt+AOM3DBA/bHyvjfSHrxy0z/uUAAYGWPv7SBCb+dayKt9/hlCpASwKoqERNmAtYWe2WX9Pzo1lXz+/3JsCy2BQvn/WQefjLAiwveRzFnm0Hzu9qiHuMGhp3QdAY1LLNxywQDwDpkDIHgqfd4/uLRtwJAUddJbrfl13g/+Qn+F1D6sy7rNf4xl8wtgefLWgBGVG22k2VEZU/Uehd0X3LTvNn9l5mGUm57LTjlJ5XNP+XixQXvoydnm9VNukpRr/HnuBx6k8ANS23cAmRUSUIUNlaxq0y94Ulwp104zfy/Ai4AdFt+jTftwukGAPIX33hrDPZCBf0QorBRJSGwKfNjlsANQ+y+WdRj/DkyP9/2NNlmccF7P6nsg9bgBX0HwJq/mF05XaXl9vHDXXKmGBBi4vkEcgDSiAmJr3ZF1IuN6lU0evnyrs+Zl757Wx7Z+srP5nz/Oen6Fv3oykMv5vwVV9klvcZ1zaLwJEOmc7mNE6CsUD+LQ46FwFc7YsPi+6Y17T/TOPZ3tmDh/IMq86A0+PnLZkP5JDNgflfbcvtfz3bgTjFglItvAXIUhDCHPKv6dqmNjuhVNHr5iu7PGl99+/8quADw9LZCtfDtim7Pmp6LRy/fY6PDrepbYQ75iWinUy5xn2Fg1Ext1ePPZw+c39Uqn2yev2z2QZV5wABfhxsRKd/N/QrvtYt6jB/owJ1qiFEuvg+QARghdssFOmWXX/7b3ktv3lR+7kvcuUsL22PFtQfF5P9N1GPFtejctYXVc1/i05bevGlPvPxGUZ3islsOMBTslIvnGzZw2Jm6qPv4gf0K77WR8t18I2484PIOCGAFcAQa8oiXR8i7PZ7sFOGs6YZMKCqer0oOgeFyqAzgF3f5pX/u+9HoLU/iSY68Olto0hkHzNz/rUSTzgBenS2b8SSftmz0llIb/ROBX3Q5VEZgKMgpE883ZMIRkzX9/e5Pdhrx8ghpiIYHrJAH1Aev6TWVOyweIQu7PnH8IeG8V1TRrlxiNvDSEMLGKWfQi3ts2T19lt749bp+hdS2sOAnBwD+byWFAv0WEBX203d6jD+igckeo9DL4tbL0uCojXDYAFhb7O89r0/R6M+m9JrKFy0esd9uzf2uEcu6PM0dFo+Q9/OfbpYXyh2vinZlEljLAGuYQ3Eoppf40Xv7LL3x61V976W2hf3+P7j7IAIBhf10Vd97qc/SG7/+wS+9T4FpYQ7FARaATJnErYLa5zm5T77b/a/NLlo8QpZ1eXq/cdsv6b940TQ6ckcUHWwc68viE8PkXh0TTyhIfZGICauovrXH33tjv6Kbtmi/QkJhP/3/0O4fKYD1/QqpXWE/Lew+7qgGTu5fDfj0chsjTThDskyIoxKfdPgJA6/9+qv3seXQHFy6H1Eo58cLVyzZuwS95vfSd3s8fX0WhS6Jq68gZoXaMIeNp1JU5pff3K/opi2P40lGYcFBOc1fGDmVmpTsopySb0jpf1f1UAialnfWjkvOPeAYLwHQwgJ9Ek9yv49u2lLY48nRuZxzWIjD3WISsyAyMfE1TKFLv1o/d+VpH13/zPtnvE9akTS4z3vvk/7deTJftvISKez21EmHuLn/8KzXJg6fAKhDhqH4ISaxgX2Lblj+0rkv8exXZ8vzeP6AHjCRtEqJ1Jf/1aT3/40Q/kbptvsP+NorcAUGnzuYR746Ut7pNqGry2YeERolEiLIgdGwcT8r9kp/3afoNx9+cOoSPvm9nvvsj/cJ8IKCO7lgwf0yr8f4JrmU87yqnmmDtBpSKELsUszGhvcpun76R92fNYu6tLCjD9BaTgf3rc6Ph7KcrA4MzoFCBELKGnC5D291kMtMKhBicBBmB6lCg+vTRGBgVGCrrUmVk6YNWAVKFVnTCWKk7kkgMBEsqUL10wFFv9mpjToTdp2jhLEHJAsAGHfNW+i94mvT/aNR9r1uT1/gmvD0uHgpW8YhQ0Q0o8SWXz6w6IbdhQV3cL8FD9QIco0AKxRotINoV3Nd0P2ZP0Q4/GdP/GwNjnkNnGy3xJY9ftrSUbeuyn/O+OLb/AMc56ZNNNDC7hNbZbEzPkxuzwRC6QnN+3s7qua7ynmalhm9n/f8cSKimMS/j/veHcdtavxai10zFTjqoEBe1mUCmMl0WTbKvttt4mO5bvYtJX6pR2CXCHDJKYtK/J6+H137sLYoIWzLrdGYrZH5pzs+zdevvl4W9nj65DyT90zMeid66qtCbI7JdqIS23Dq0quPA4DfHX4eHYyH6t1T7wSyl3Bs5/mHNHJz7zfga4ttaZ3nKdUBkUAlh7OMQNaW2fJLCoquW6UYDMLBeaC+PPUFtHzvcgDAez2e3ZjF4ValttwnkHHJobBxVxXbsusLlo764NnOz/LVK6+uVourNbf1fqXrV18vc9uOC6k615T40RPjahNdunFKbQwWegYQBA4O1v34zWGdcdrseWLINI6Kd0pU44m5J8rVb0hs+zq+P9eg0v59Ha/uWJWyCQCXSRxR8dqDnKODJ5xVtXnfT2r53uWYduE0AwAWOrTUjwJgR0GIq0WJH+0EpWvmth8Xunr0EJl24bRqtaJagCevCiZQmdzsCyKcdbpDDiSYxmFzTDYM8R/6Lr3ms2X5E93h04cfdCyXErPBVIlUiQNXHZEqQUFIfae2xHyS5LFqj6cd00rXJLfk3BRF9dclr0nNX0nnB9WUGxxDYr+o/qQoXZKGTx9ul+VPdPsuveYzInNHjsmGQq0A6pCDCEeGOtk5F+CKI2FN9feowoh//jS6dNpIndd1whFZFL4wrrZZXKxCScOc5ZTa6Oo9funjAJC/bFSthPw4qOUaCAmqCISF5HelLV3Aqf1IOx/VHNfMczXt/HRwKt8DSAe34rz0/6nyKfk8tTcaSMr4e6/00b1+dHWYsxwoaVysxtVvHuLQ+bO7T2gxcspwfafPfVW0OAPgtcPGYuySmQAAw24/C/RPKhmDyReBALefmRPx9OJptVJLAUCQnD8GaOq75i2dMrRNq56zr3tU/p15v0BWWqlArfQn877JVqDWRBMUc/FUPu+U33rM9HtfLAjESV5EMTCkoUEAcFrxTfr24Aszrs3gZOtOS/d9/U+dkz+ppUPuOarI80RUldRll5Twkqf+++uz+jL9Z3itpXkKCFJZY36uLaOZPtBrEyKtZR8e/WeEfPLpBi7zY4sUeCnEIShIPBEBKM9l9/zZXZ89hlbkwSk5IaPwFMBvXP4G5h/WCgDgsNtboANtouk05JioeGUxsRMGFY0qOWHu+Fp1SGQKExkCq9BKytDQqlpbVdhpc0Ar9b2V++Zq7lVtP7uPMpWg4NSx2qbj5z6iQ5dfV+KJToiKt9fAGCglJrlrgctOLwCYc1hrvHH5G6nrUgBv9308/N9f6az8v7cwcM8GONcXEQWBiWHInSyK1X8v2Ez3D7io1p8hJXhNByddq6ozoNL6xcQ1qO5aUOY+VJSFFOCVjTVkAqrVAFrpGFBxTm3TsO7dtUvr+9mDrjLk/ovJgQLwxQqBcgw5Z83u+txhj/73Ct3u+6nrUm35le8tIgAg0Im+2iGiCg20lz2VH+LivTxk2ZW7li94Hn+a17tWmRehDK1IGkwVwtr3VvmaytcrSBUkwYbEN2nl8yt3D/sqq+p1gXOrLrQXAD756C84Y6PRocuu3BNT7zVP7Q+GXFZAJViq4nQQnwgAV767KGXlMQCs6jUb/mFn4u3Of2/gwB1I4IZxtaIgBggMM0NUVz73uOLcYafWAfuMCuGmAx1Q9f1hNQYOkn05IAkwAYJDDrkc4hCHOcQhdsllBpOCVAAJxt6EykZFdWUm+al6PJOH2qbP8Tn6DuuG5x9RwGI1w7yZkB3H1QrDNHTJHfBW1783iP/idKzqNTslWbRZfBu5SwsUoMMUOItgktpLoiiNizd7yKgt282612h79vbab56RdAcE2pAUdtXv9C39WMXxoEaTOuRyiMKcyJDYBeAzKFZCebUCXykoTjBUcU5QGVL31GrKVKrYKvGU2ZXUDW3P3q7+J6/Q4OW/+i4u/kwBSplMMPsJDFEMI+XDwkX9tdPimwgAHL11G7BtFr28spRDJtQDRMfF1FNVIiYDYlrkibcMo+5Bi0EPY/Cc22ud8Yqan6a5KUEl3coAESVWzEg/hvRfYpgDwFS/B/FcAIs99T9X1T0qGicQEyMboOYGThcFCpicHg6I4uIFxWuwvkf6aFYzOKn4ka6rSqh8Vq3SxVMuxuxBDwNE8PP/sSxE4fdVdbDCUkw9dci0CRm32xtdnvt83vGMRw8fog491gLbLrwJWVmd8xQ0zIGDuPrCYOOrQFUXRHnPRj12JzZ+t7pOOM+0XFFFPoogXqTJQXnadUBKpOKQwwZc5sF/WdROjqm/xkbpu2HrrqjW2/Zml3+8ZYhecNg9zVf9LZFpB0AFNlmP0ohS7UwS7ExWEzxmHK19av1dD9VWW2lB1tubvKi/EKDBRIZFxTrsGl/9YQb8FtnVxbc99ms4CiWaTvJW/r+a+SoDknE5h10QaEO5LV927rKb7fKT+lPXDwvqEOAUyNWWUVljKx1TJmYCf+Grvafcxl4Lt79qV+sGoOMLo1BcjmnDX6Pm21eCQPisaSssfXkDzljxq1ICrXu1+9OfujbnQ0N8u8vuRQSCr75qlaBTpl1QlQ+C1ni0dujYVQVYdtIq9Ft0tX2z67+WRTi8gVWPjSMOTyx8lQEi1HTA9Cd2K5ScVy6ZQc+/+zc46vZk4kPi6glA7KvAgVlBoDUA8EWLDXXGtAb9ZBJoqgrkPrRCVYmIGOZzT/0bV676fM4fJ98j7z13O23b5iLHXadHoiswLVPqD+ABbD56M97LWkRZm5robP764y6Hb702rv7OELvXMcFYlUTB1ZVfqf1A5VFA3dGWFhsBAKxYo8AKX+VYBTiuVkLkNibH9Hzu6Mc2vtJ7BnHTnc2oYaPskIIGOexCoEJgUiUbE7/ojBVXfAMAz6x8ps6qJWWMX6vbqrOaE2InQ2HO+jIu/uihyy+b1fWIlii9FfRpXivtt+A+PXJN12rLvAN3oNUXrXDqJ711x/eNZdCRm+iMlb8sZri3xcSbRmBKhkOqHR9Xtp615i6mtimJxekrfvlN1HpFCrIEQ6IQhx2o6pBGDRqEm+5sTtxn9kkWDhwftiAuwdpihhyEOLTFV10HAAv6vstzN86tM4ZtamhBCT9uWlCh0pYeHGAyNstE9pbZ8r+eueKyt5/o9gwP3nKV5GyFXvXqqP0u/3Q0R4/l18iy/IlmyIoRcSv2D6JYpQqGslYAl+44qcQPVThd6lqD526ciwV932UAsIp1IQ5tMeRAKVhgRhR9XA6bPrN7WQaAMLI7KuiIuPhQGLIAVOkzhawJbjmrThmupCVaMdSg1PH084LfJFA2e/2y989acfmjALC96KufpDv5y0bZovyJZtiqX35Vbr1Hs03uTiJOtb+Vb57UaACpoIQA8FBD7K5WaVaCB1kjSp8JCKTMUfEhwJHK1BFIjIMFODnC2RDAB4h9EeyV8k1tNtCXAPD6QreOG50MNx9Vbv4yPUgV+7I4stOKPAEAy/OfMw/igZ/M56RlmwUAzl0Vm1xi964VgBOesCqOj5oDI3VPSUyO2Uhflkn5Jl8ECOZi+xGTDYZzEpB0Var2TjLGZNTl0B4F1rfbe7kUty2mul7NJsOZX4PAKnmzhMlwid376bmrLp8DAF2WXVkrk8gn4SFdWDDLEK5WBV6JcGQvwFI9X9WDXtdNNACMw91a3LaYOpVcLgpa57K7h8hosuVToDcAMBCHKLr6YpMWLBlytkNpIwAUHVpUDwlSnLKkqze2MoEGSMIc8USCdmpB33GmNvO4Yt57CgBCPNcXKVbA1GTkVY121Q/AQAU2qtjE5GxH4H4lTyxU0QUA+NV2bzRVwtGe+oAyqQKiukOgmwHAC9X9PG1RhVTS3pqMLA1ciCxQz2csAgA/1LFW+Xnl/ZgCwC6UfV4u0Z2BZ4y0StQpw+CqAFnqo41GBTYC3SyqO4LwEFFcfSjQataJ05owQn5rhgNPRQEiXxVR8XY6arYCAEe4ztnNDLUFGiGVtLaSM4TLbdxn0CYA+MrZUqs8TsSjugu7cOXyq3wBfc1wkg1LNTHhykO5+tPgJDaOmq1R8XbaYNhOvooSHJQZac0gOjbEYSRCaETE6qtsPXvVyBIAGPD6gHoAOFNAmYZKlf5NAYav1vNjkWIA2Pz25lrnaS3WJlEqJjIa2C/VhxV/DnCBCmzOXjWyxKpuDVbNICjIhigMhbZhqzg2Ea5TgJXJKVfoNgB48aIXqT5ylCtbpTXFg5MBicQ1glCwLqSpg2HJLMxK5ohZJDI1pBqeAqpsQdcPyATCixe9mOyHtxlyyigReiViqHJrh8BHpYwXYhhyygDeAQBN9jSpu9BIJVYrBJdMwqvpzKSgFV44XmeSdBLz8iThaAt40hSPmRwFVNHV1B8lMVLoDgaXA5ytkKRNc5QjoBY2yN5AELXhclHdCQBZZVn1wmTlvheazLFME1jqI3BVqzK43K/+hrXJm1bW2oCScCfRJCRj2ajwetQDJTGy0J1EplwCAytYrVzpcEehh1pVaDBfk1QRFdVdqaeoN6qwkhNVMiMmF/ylRCVM7IzXPVfp9kEyzlXhWaME52lerfpU32ThAKC8SxVRKEg1MJaV6FBHFU19WCDxEgsBPIBLgLrp26ojoaDmJzMA04P+6ZT6m/ANUz3MNk1mSibLrMILMgGvzz4YqMDIkpYIEE+UT1YtVKmRo6DcID2WkxlpnpCWAcCH+mG9MKkWUENQquiHa6J0banPBmZ/qlKFJV1/apzEiJlLBfADI5TJBt1EQwegnCCDUmHAEMD6GjR+RzY9sl6YTJirSJ/Vn2yKk0BqYm8ycwKp/3XPXboBWF2lymyy6zK3siolMRJr4mqCVBRJVTONOAq4wampBk9csAcADv/oCg+1QimRKDI0WCt9A5Sxj+tBkBXu0cq8VHMigia9PgFOYuTD+ppIHKzAkkJOZeEp0sVYX2SQhKtqyenamtTq5L6G9cJd9X1rVU4zDMN6p8RIiCh49xsF0nKgFAchhNTghFlhHACwUvfDECBoUlICTM7rqdIKJ4dHAZeqwO56MLKSiQipzJ0Ub2mZPEntJapP5QVQgRFBXaQmpVHyhWGeo6ByBodEJZn2aUQ5BABrd35Vr8xmaHB1gtLkUCnZRP8MfCVrWfrBiiP13vYlMSIxIRg2mrBRCAyBlLISihOJ35pwWTpqbA4ANKOT6oXJA4m1Zvp862eYVFPCQXWu1PqKBycphRFTDkBuwtmiBANV3ctQ/MAUzGRIMBhWoTwA6LqvpW1qkSqGPukCyvT1Iv2c5Di4PpjTpMJWDYCk/86MV9cfJTGyijyAQon8MWUyAPFOR0HfBeGwuCIAOaxKjQDg23qqiJnaUZkyQa7Q2+SQpK5525cDgyr9C3zk9Qnyt4nCGHyIgsIIMFSCAZS+YxBtpaBvhoIgqhGAmgLA13ti9cQmZzR7+2rm0itDfdS/6m2CqhUyoR0Imsj6a6K/zk5gRNxUoJFky8LEEOg3jii+SDGrgA/JVvChAEDLP66XypgcB2va/wTXVc5NrkFGabpcl1Q55ptJFV1Hsn3RetZhMgFGqtTcqmQnpv0meOEvHBBtsIkBXBCBsBEi/gUAjMbvdSmWogd61CmT6UMkTdjKNVGQdxLwWn+Ojh93oSZh3Z9za4uWYil6vNkjaDeIWvhqI6ogEEGCHxtYgQ0xiUE1SMlLLAd4+D87/bcBABSfU1xftkxyo9RvTdufMnbS++C6o3jSb5/WFGcsCVFl27c7sy6oGAE2/85/PQ8wLawIKVRVyUQ1DoA2OI6ENvrwwGRIVIRhyCW3qe/bFgCKbZmtl7ZQNeGF0XRfMxLuy8SPlAAp4fComa07+t7B3dGdGqFRtU0mAdgLYDEIRnegcc5XOKLkKP32vW/RG711C1utcfgAAB8wSURBVDalopYVFSu5XGoy8K8ZvAaH6k+DbU9LWAL1PTk8i0NNffVgxVcmw1YsVHSjc+nqId8/33HGJkNuK1+jyiCAuJkwjgHwSTju1jmjopQWaKjJUZp5XIF9BjMfWFjzAp37QyNT7UT6OLhy65HJa4VdUD8uGDfbTfDExzC4WSLjVF1yoYh/ccXas3Ymogm83CG3VQwxUShbtc0J1BoA5n7Xre61N/Vd2TquGjVSIHDEQbGv130/0+7lVg6HTiDVbCJkJfQ9TEExcQCiolEYKoPavaxcDFCJYyN72jZqvbv7BxS80lY1CkpfkbByg5Ye60pWgvpZFrnbt92SBlZrX21zTcz6cciBr95yoGJB8EWiegEAEhWKq9dQldqNOe41c8/6BnYsRtNYjKt1podPH574ldCStKYwkyqnygS/bCVdn9BtAl9bdK1M6vB620Zu46dE5RRAbWCWZZICCqMIhKKqquKrpz7F4qtL1pX+48QZP6jSFgCd4hrnTNCq5y/lsFGblGuNq8D+VLoLo6nB+gb6/DFrWWhT27h4DQMeEi0c8SIgAbAqfVgu5QgWu4QwOZxFbqsjQntbAtiMvmcTFtYuwGPwJ+Y+A1jfKxOQTa58k+rVkppcXe9Z0RAGRy2sTsc0alq0Sv/RZRqrz6NL/D0FCkokitR8t7TIQRBnA4GJmxiYlsymsy8erGbO+K/pTmnDk2IAeDb/ceeuhnNgCwfKfQEvtUaUwCSa83nLPMpr5cOHr74Q2Cm15XCUPwASnYVH/hqAvnIoBIEKQFBCG2bqEDB+8LXwCTyBeb2DlyxOw2ReMuBdAwD34D4Z+05f/245XQA1Cg0HehUYWlWdHpm+4KAiBOFChaULMVwLcL+Kl31liLIuZnKTqBoE7+5NfFfeErHK1BKKqlZF4xKXcimzfgrcmnzOafsTBiERdX3h5Ldzr1l2q3934SA/Ce5HQ981ky/+b2opvE8uefWg5ZrExCXuCOD4xBhcHA6BQF9HyVsNAM6SIe+Y5V/u8kOOKTTs/lL9GAQWnspRUG4PYMbdC/vIwNYlmLsxb7+L/2+3T3Der4/Ef69/lRoyEwAZjkvkb1unu5M6zggr0bGuugVQGSTQXr5KYx82sGpqais00QRR2g4AjY/rQfgcmNThzZ5ZJnuUVZvrqS+UtHaqcXvV1DqkmhAiqpyHVR0/6b1HkOcGItBDXgnu/XuHmUuZaK5FfJ7ArFi6+Xu7eOaGGEC4Y/h83htk0uiYYdM1P9vHOVMu/jHBAgAGti7B3QtzEy2CaRdXr6Vo8OptQy4EskD8qL906DuGtzfZqXs2bYurYrYnPoiYrYoqiF0O509o/9rhAOG6zrN+VI0/6/oZlvVdgDsBNIscQ3R9Li4YcpkW7SrOnthhxi+eO3HmoBynwQMG7lKjvCrE4XEhEzndIbdxIDDSjAlclVecTVmtSQ0O/pl+Z9sJ7d5ozORcG5VYvhcsgU8EFgILUeIbLAQjlFgGmsCJFfs5sVVMEwVIA7uMVJUUmlg4LX3V20r/QQHIoqoEdkMmq3eII2NVzfsGZl22m/NU345dzp/UbubRR64rzVuw9HsQSPMOzaHsZrvpg1M+wPPtnv9RgAMsCM91mNHCoXA3VTJWRYmYffGhhDnFe4rj3zXZqc6Zk8/Ts0A6QV5f6lDoBya3sY+4JTIGoC5ETgcAW4/9pnX1pd0J/Gv9y8TbTsBx7nFKC9sAAI744a0GEzu81YS3mg6GeZCqDlbVY10KQyCIawxlUuorQAwiKHFSSkDF2LOyCiXHwIk/AAB+7zXHNZGLDDmXqWrSWSNEJJTym1Bi4UJAoZz8VlJSTaKb9CITKKHBYFUCqQYrDhEBKsjotCqsr9QYimDVqi/lokEGt+OQe5Rh50rPxq9Upu0OR+a4kaxZz3ScsZI/wLeD1l7/PQBMP+Z6mjjkIfzg98Lra5/Xxd9UBfzYbQEWAnQIMDKA+sJwjSfebs/Kktu3XaH6osIhkP55RCHr6tLviZ25hpwRHjz44oOJWzsUyn+mzavzj3O6+AvyN6Bg2bGJZ1H8ue8CundOgUbfII0cBuxpNyM8sf2bRxKZtg65fQEdpJAOBi6UFJ7EUaplwXq4SkQIEor2Ne7NbErTka0QcoidY5icngB/ENfyXSCKkUoZgCigcVX4BFgFbIAaOYCyglwKhk7ZCsoGkM3gbIfcLEMmzMRZCs0WlRxLfsTChlWVDDsgDYBWFUXqxR3p1j4RFMlprRrTuKofUwLYpVBzA+dSH96lLkJbjDFzn+s4e46v3pqd0C+vm3VWKd5U4Ky+VNh3PgoWVrxgbEH+BrSi1vpEp1cMSyjfV9taElXOkAsQzWNEd9xx0TamKSS07dZHMe+bzrzp/d04vEHDiwzRZAtfRUVDFGYimhe15Tdcu/aMTx/pPZc2L/oHzu37axqwcEDq3QpPdXijuYHT3iGnp4Ez0Kp3MpOTxUTwJA6B2gQsKd+EBs6gxOoWlHBA75ehrhQMTHcIpM21a87YPanTK7kioUP2ev7uslBu+ZiPBxxUIHtcmzlZYZYcdm0eiR4iQGOAmhPRL0BoSspHMXHzEIcPIaCJVdvEF7+hQCrxTopgTEqUjnryARLxFQKxSy6BAKvWMpllojLPV3+RiP/x9evO+jp5zdy+C/nlhX205Ukv484PL9QJ7d9uk2Wy/qbQgXGJC4HIIYcUuHx32Z7/NO15ng48DMH7q7pD6SOQPtX+rePDHHrdwBwf05g1wZu7S63Yq5utHfLSt0e9ZWZsOUNmJp5mQru3TiB2ujnkDADQR2CPdsiFVR82WHkeSLl1EkZqIjWNwOSwC1WFLx6IEq/BqdFmT2itUsIMqgD4jxhED2JORu14H0Dy3dkKxV/wFypDGQiEu3BX4o6kwK8A/HO/KsB4PMGhdu0bi4m3YKUjCXyEgo4koCuAXgAaJe4LJ7EarFUfApHEE1DSWgeQXNhNQACD2eUQfPVBoO0MXuhpfI6vUvSbtaevSj7Jq23W8KDPOsqLHWaONHCeVSDHwrchChuB/7kn3lnXrT3j044oo9XIVgcA7uu1SvNMjJbvmb9NQTMs9HiAyKqoQ26Ow3zGdx3eLrx+zenf3Zi/kM6MlnYHcd8I5wzyxOulqrlEDBHRGMUSAIITRpEmZEyGDDnsklUfouITeCMRrRfEtzswZxDR4Vb9KqvMpTd8yVBh+ji4CfrTv3E/1iEHffAZBuNsvIAXAPwSqHA2pCrA2IxX3XSkf0FxOYCZmImt2IrGAxvQZ9wInWNhLIr/QO3ZR3H5Dxi1bJTFOuwEsBPAxxPav90ahG4KHEVgmwj4WwDzmBxfVdpZ0NEOhZjB8OFB1Epq7B34X4J1UlQ0JjGFEjnsNFfocCZzTg5nL53QYdZcUS10Gy1YfO77/fwJ7d9s7lJoqAI5VjwBEUkgkRlK+s0Hp/hU4q/RwYtTslPccTTogS9In+kwc5CBM4WIG/niWYdcA+gPPvyrVe1OwJwTMTmnxKU837DDKgJf/cD41CBzgAAoaWJqJ7PDIfjiA9CoQ+4ahSz3JFYkwAZVfyORCYU4PJVhusY0Ksn7ZKBbEdtRIiZV2WHYa3P16rN234W7+G7cXffpHQCeaT/zOAV6OWR6uJzVSVWO8zXeXFQ4SH1SX9Re6MOudImPJ/DxLoc7Qam7p167RKsIXz0IJDFniCrNsg9kx8TssAtfPIQ5sqpcyhaJ2FeIqKHDzkQCN/XVsw45RlX3WPUvum7t0Fm3t1J6eFPQ6zlJsXU7+TnFF4AqVhM7swAdCYB89QGgMZNzV4izTVxj7X31AQU8G5dEN5PyxmvgKCGXwgwQRH1fVFcQ8Xu+xD/wxdtsFV/8dv3pPyQf5+kOM1spiDVhIWeob6VuOTVXCIRyJLmv2+jNuA4zfuGoe5oB+oY4ciKBWvkaP8xTL+hQg6FdwLoSgTj62zVDvwDwBYDZT7V/oxmR0wrgY426pyjkFCLuEELYCCx89STxHsJkd5bS6riNKYHJU78TgTtFTKS/r17cit80IRwiMiDCLF/8jwGgZ6+/KzZdBSDt5ZSO0xyTh99Bl0wb+s0z7ee+YcicyeTmWfWVQCQqJ8bJgyhg1UukVnNSY1WhwmAT4hCLKqz6XzLxTAXmxCX2iZJu/c3aoXsA4IuXgBtGKv593hRq0eYjfDaDKsYwqXFo9ZRuW9fl5MJpmMbDMVyeaj/z17nmkF9btUd7EmvhqUdEDFFRTY3Xgu41FULUQK4Lu23mPkVHC3VfvRPPn7gDwJK/tZ01ixlHGHLbC2SIVRnkcOhQhoGnMRUVodRyAokZn4CKeEIAeeQdr4nMdoWqIZdFsVdgX79+3dBtk0fcTo7TPMVYqikc9sIwfPJ1XwCAB+9DIlNYkasVmH1WbGIWUyI6EFhMPoEpzNkGxPDVXwjoKFF7ZlTK/zhqzYBXrl87ZF2PNduL5wB4p+879OGrLxEASM5eHfDQ41qRspMWXEem8lber/t0edUeKbivFdvbk/ihVgVWRa0k7QRKbmnnEyQRe+pTdLQCwJgvdmJMn3cIuUonXvHOD9evHbLq+1DeSzEbvcVX/wyB3uKrt5jJoTBnGyJDCvhIWKSKxPILAFmxwYg8KR9iEGiuZ+OLAOCTr/pj2AvDUvxkBC5N08P1utZP0I1rT9/iifeKKhUzuaQpBwESJiypAB6TQxGT61iIxNV7QUn7exI/P2ZL/nHd2sGrQ3383Xef8Uua0GkCfXtUY+zAZPRZ2EdHThupBEJ2NOlLBjL9uklKz0OuEGDS2KqfqCv5CoivPiV6j4SLq2q6bHKrbAzcs7Cf3vNOHx3StEy/+KgTZnX9lM6Qo7HlNPv9DWuHLIva8qc8jZ9lVYbENT7FqtUsznE4GPZ4SMw5SpSXdLGpIZdIqcRX/7Xfrj/9y+uOG0um6eEZtT5jdtnYN9pj2vkv4ZmNgC/RecbJm6eK8yoASDbHRLmmobvX7rZio+NUaGKMyreMXndGHAXAv7CGdb3igW0vayR6DK5dte+XVqpykPJC6WCnBJzxXeGgrB9KAzJl5lUlSjsXkBpeyzzrixzM+iJg/50TN+HQbXn4ffbV1Cav2B+6ZOROALMfb/PagnA4956YlF+jkN/kmIZuTMpQ3egiaER4flxtIQAUnPgnDP9vZtlVOBn+35H6yiX/pvMmn7ntr+3nTs+iSG8m09zTuACgwILV+F5b8sjuMvfhP20uKAGAe/rOM6+ve5HPXnCpSD8KnCCv7bccqwjrx0jrDWrNrGH7RT/uZ+nzcSvg46CAnnaIAsCrlz7LWbln+0Mn0HoANz/RbdEYLS8eDdAfAUQo+cpcQB0KkYHZEZXS6TetHfL1q5dMpnMnO1UEUm0r99HkSwEAETR8uVyjb8bVo6RlFyTmIZRF3mN/2lxQ8s+jCrN+i340ZuEAezYuFQD4VWH7/ZdFBiU1oYZIT43H6pIy03Uyy6/UrSQOHOh7sc4vOh8AcO6LV8vQCSQ3QGlh3w+dm4t6l9ywduC9RHSKIReBVUdKILLqIyqxt/3IIS8DwNLJ1UeiqgX4QZBOzH+ar1rbw1fxn4tw7kqHXAAEC/EjnIOYhj4FgF9t6RfdevjMA3uiakiRqjxICq1qP3cQylRLlGEnaHV9LyG1HONPpL+BtO/7J9lkqSo0nWEgFKxfbchFFud+rGon3VzUK/5c/tP8YA1pQjXaKaOWXSdoU0o3rR+yuNwWTwaoFCAikFMme72wyW721/bzngaAM4/4hCd1XXbQD5ThxU0XUGWWtb6190cmx2jat6bv+Gk0qesyPNd1DQOEv7af93TEyWkV06hPgEksVF5WJsUv3bh+8AfbGylduey6GtnchyFKGHv4UsIXQJmvf1dgPsMoKSkpu2V+ibgUvu7J9nMv/fWSTlYdMrcNnHmQ1bdS1mJCYOm/U5R6aSSBajcL5kd5zOArsavKOcCBt9FpdNvAmSSGzFVLO9jx7Wdf5lLWdaV+sZCygZJwAFmhaPmzAPBk54X7XKxunyONsQsK5G/n/Jtv/2zwrpiUP+BweD2RowCUgjEvHDhPjzthXq9RS7vanFgDvuYn1GJNCDFzumhyWk368g3JB6r7lN5keZVnD6aS3TV9+JIcuB7c6kR3QpEba8DXftTVju8wt5dB6CmrPpC4N5MDh8KfxGz0gdHrzv5+cud/8/0LCvZZy390KHnDykvlqTMX0+h1g5eUScmTDC4PptiDrYpluHlhE57waLu3j7v73d52GHDAb73OjCzUPAypqjLZB1TOwRAlQ71QZBpV1UUBE/sPQoEVikYAjX23t338hJnHOQhPZLh5FjbICg3SAaOltuSvo9cP+nDxmYvp4pWX/mgTth++AsIvcjdg8uAPafTaQZPiGnvBwCWFCgHG05gwmY7Z3ODJx9vNPuZMkK7BmgMCuSbvVfXnVmh5fQyTNIj6IN2K3+fZP3pOdVcpPgboNpA+3nZ2q4jJG89wOngaEygMoGLgkqexyfE9PZ+ZcuZi+jJ3w3754PfLGXT+lEt1745I4F40Mgagt0OczRpkSXBMosTg/hHOve/xE2a27IiOug7r9htkqaQVFVZpuqVaXRNdL6TpywdX8Fcdn3TAECsU6wasoE4gfazNzJbZJu8+Iu4fl2jSPWlDnM0AzbHQO2/f1lB/2OrS8CmX7lch++3tG7W8szzc8SG+efWgnWVScpOCPg5ztlGoVSjFJRYCcG62c8iYcSfMbtke7Q9Ak9MCDIGDNeNYehOdLuT6gFkzVLdyE12zx23/7h1obvt5XXVcu9kts0MNx6jquXGJuQmHhg1xxCiwrlz23HjLuoE7pvaawtevyN9v6/KA3Lm3r/6DjMEYvm390A1luvdSUdkVgAxfofAkHlGVi8NOgzGPJDT5LYCG/RjINbTNWu3v9Nn29dJEa9XWpaYuJXnOj4v1Tigew7fUCaSPtpvTMswN7lLViz2NZyUCOn6II0ZV95RqycW3rj/j0z/jzzxi8UUHNHQ4YH/9buyWqZjKt64duDpmoxdYtWUuZTkK9QUKTwOQc0zDBx4/fs4xZ4J05Lngt67ZBxjJ4YdWNHNVhpjIBLn+iGsAs4Iqjqe/3bBmum3gTHJP+9DchsP0kbazW+Vw3kOqerGvXiSIrKnvUpZj1cZjGr3wtrWDV03FVN6DPQc8LjxggMdjPA5BuYzpv8Dc/En/Qk+94QIRlyIJkAFPvQiILgy7uU890m72cSNfJflm1cdmQpel1d6zQnjpzRxV87+yU6ReqKqDv8r/yuPfmjmb1HUZjtvdnMe+e7J95ITZbbI57ykFLvA0npVYL8x3KcsRWFjxR9y8rv/cP/dfYA5BuYzH+ANm/qAiboNxBUhg7xi0wNy8rt9bvnoXWvgJkOErBHGJugQeHKGcaY8eP7fnVUs62VAoZEa22L3fuCRBz4iro6JCFB8M8wdBlY279DeepVjbD3BHtigj4xgz6qN8+3j7+SdlmZzpRDQoLjEnAFetS2FHIPDFXvTZ+h9e/+OghYYFdjCuOCjeDzqkeveCAjg+7B8DkF8ReGepSlmYshxRtQpQXMpB4M6uE57zeNvCS369pLN9adshOu3CaQYADm10KIAKkVTXt2U6FjJZt/Wwyk5lqtpdJHijqt1LOk27cJp5aVu2Xrm0s32i3fzLjTqzCXxiTKJIGVQUMQobt+Kf++n66NRrhjTiQ6zauxcUHDS/Pylmfk9hAVwf9s5BC83otf3fjkl0mEB/CHOOgapVBcc0ZqFoEOKsF59ou/ApABg+fbid1G2Z22dSHwIAS9UIpYaOLx3k+miiKy8Qs+/utYrJpQTQpG7L3OHTh1sAeKLdggkuRf6loLy4xiwAVlUbpohRlT2exM8cvb7gtUaDssxsj+zt8w8eXKAWkiLuKSyA46kd03+hue2TAfNjdm9fAB+HgiGUkMKIWolJTCIm9/pxbd/96pGOhSdeU5TvAdCnjpya8OsFQyVJe0169RZrhZbUm6mlgBJrtXwlx8da4YRJ4vxc9+UOQHpNUb43ru37+ePavftNhPNGxSQmqlYoWBdFwpxtAKwtR3mfW9YHfW7Iw08GF6ilrJe7FxSg9/wv7FRM5Vs/GbR6r5RcIJCZDoUZxKogYhCX2hLP5fARxudVT7R7d+yDbd4O/earEZY1GTVITe1DTfAFwqR6RDgZIkzOm6qJr6SbksAwBABXfZTvP9jmDfeJdu/fJ/CLXAr/otSWeBxkkBII6nKYFTKnTHad/7t1A1ZNxVQ+Zf6Wn9Qsp1OtpTUNxhVYhH/IGMzm29cP/Dxuiy/zNP6UQajUUCix+hq5MSnzFUCEc+4Km5w1T7ZddLYlzVOQrTq23ZdjoZ5IKJGlW3mGf/V8KQAxEnvoxBnZT7Z9/7ywabguwpE7FYqYlvkEcgGoIVcNQuVxiU8q0+ilv1s/9NMx+DMvwiI5WIOqOqrVFb/HYzaA2fJwx3v41tVDvgdwwyNtCz/O5rybAG0naqEQQ4CW2hIb4vBxAL3qaKhQIM00mLBEQM1ujOT+ekvZSb1IIjVnpqZSk9EkTy36hqXhKGZzPsGg1Bb7BDZQNQQO3g5JoU+jdu/44xCeOGz9yXJjryl8zwE6MQ6E/Vql21ePkYndVvK0Th/S79b3m1Rqd1+pwOuG3VImlxLqYOISE0/icOD2V9WWQWgsUIeaoatfTdZE05y2wMo+zhUAGgLoDodC5/sSV8/GRIOVBIgpRMxOGYFmlOqeK2/9pOCZsmNZJ3VZxuPrAFygDjNPRxV1FrNqI57Ce/T7TwYuVr/s8riNjnUpawVAcMglAKQQjWtMKqZf1rTVTIriWlflVM51KshQ2fGSvi8Zu05cCiAuUZHAy0lOkHoMl8Kr4jZ2b7lGL//9ugEfLD7jfeLcDbjmAHzLB0p1+lKG83GpAoq/dV7FN1wkxfhDl0cfOb7wPWa+ykHWWQo9lACyyblN1QeDE1Th5KjcTIaPOYv/s/kEeQfLMBETfxLYCsV7KKTPWuxlbEsbaGtl9vZhBCYGcwyHCARDznZfvJlltnjS7z4p+AAA/nrqB9zzrZOkV2oOZN1QPbx1g3DDSsjYRvN5bJud+rtPmy6ZcvL6oq27vp3vUtYFShjkKOWpKnz4mpiRX0PLkvAoJGTrxvZGAeCOzQWpPNVfYxMd1aOcNPs7JE8U9dG2aX8Y97/AFAFdlI1ofBA+//49MBkoAU32RHHY8u+T5Su2IfE+A/IoYR1Xy0/acwLBWtxMDgWWtO4lorkxLX/Z7om+fPs3Q+LbT9hO4w9bQ79dcLL89qeIdT+pns1SxcT8Ih61rLsAwCPHzz3MmKyBLrnnWJWBBOQqNDH3iYB9dyFlIL1fVNYC8gVgv/rd+sE/7OP8/aZxxy7O9dzyw0FoQUpjQxQ+1dP4vipeMJOSXE5MIS1jmEJfY6/4iM35/fpBWwHgH91W8K+KOsv+BOpri36GcQfwRyj1uOTfOHfy5QoAj7YtbMlwTzZkzhS1pxOZRgyGr3EViCRSKrhicnjw6ZC71+HQDqju8DS206r9BsA2QLcLZAdAP0C1GAZ72fpRH47nWk9iHHbY+GFVzjaKPAY1VkIzAM0BOoxhjghxuBkTN4nZaEuFjVTT7v+f5s4ntK4ijOK/M3PfM7GmFAP+SQ2VBGKhiP9AQlWqpELt4i3swlaLa8GVqOlCCyIIWhB14cJFBaWSUqlIXESpSlNIiQr+qWhLJImtxCK0hFQ0yXv3znFx3wtJ6zrJWV+YuXOY+WbON3O+pv+GQqbrZBKJYi4ojuQpH05ujL94bmAa4FOG9B6BEZ5YhW3/SqwJwS0c2zOksTMXeOe3AwY4tPWrWwLhzkqo7jTUhLZGZRTOyVMjJSWH0qhIgAKhLKMK2AXNeLcQFP8VcV5iwfaicQOcJ6eSFMUgiBAqAVURbcmpPbm4vnDRboqg8lEX5dGupVVRVnlEiqqETBmFGyQ8ITScu/5lUjoz+OvARQA/ZF4Lp/Ty6I5VJ7aFNSUY4JXaLxSXZnT3bR+y59iRckbfcaLDIdya0XafpFpy/mhU1pmFKkVqkLtOwq2aP6JkXM2Z7mUxs5X+AdwUo67y0mv5nzW/W2bobZOaeQQhlFVClUiF3HUK57NR2QmTPsvT4ndJvjh4ducVgONPPacfpx/jXEfuj7/YvWpj+X9Yc4JbGH76A/K8j+lv+zXVNce7pzb5pa7jYWPHpo0hVjszh/sRu5zyRyy62+IGROmBkTsnObdNsaJEaHkXsaU1smyntKQgu2R+SUaWQVIMispUISrDhvn0D0Hhj2CNEvR5o6h/I7g0vzB75eDvj6dnH/5bvSdv4PZdh51tvona4dq1P7kGWDcEt7AXc0//TxwY79PQk+2aSVO8cLQ3PcP72tLXXc2kLFLdpqjtNg+A7zXuiYpU1EZQoOmVhV1QUFDaDJUZVy1F8UBQIBKRIuVyL5ITDS9QlEv+tND3htNWfjoRfk71hWI2zS6+PrXXh/ZNhu7Qw76P5v1G/4R/GL+Lo+tsSNdXb67Cn8+brjdL84+v96PRy2N6deTBa57uvb3tZGfu2CPTZ1KvYAt4M+hmoFOow/IGvHRTvg7Mg+bAs8BfsmcszmMmrTCR0OTg2U8uw1sr2jq4eyzuuHG7B45gIbf6uF7xH8x+qII6qfVbAAAAAElFTkSuQmCC",downloadUrl:"https://chrome.google.com/webstore/detail/pontem-wallet/phkbamefinggmakgklpkljjmgibohnba"} - ,[t.WalletNames.Nightly]:{ - icon:"data:image/png; - base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAABHNCSVQICAgIfAhkiAAAHXlJREFUeJztnXl4HOWd5z9vVbVarfuWb8k2trFsY2xjbG5jsNcJIUCwB0MYpkOA5swmu8kkbHZmszub2c1mJjMJC0xnAvQD4QqBDRCHAAbMYYg5jAGf+LYsyZIlWbdV6q5694+3W63W2d3qUsuG7/O0j+6qet96v+/xe3/XKzgN4PWZbmAucCZwBlABTAbKgHwgD/D0u60baAt/GoBa4DCwH9gD7Az43Z1jUX8nIdJdgXjh9ZkCyAB0YBJwYfizFJgX/j7V2AV8CLwT/hwCbKAn4HfbDpSXcoxrgsOk5qJG4EXAamAhsChNVfos/NkIvAU0AW3jmexxSbDXZ+YAJSgivxb+lKW1UgPRCrwE/AH4AGgM+N1t6a3SQIwrgr0+sww4G7gENVrPSW+N4sZnwKvAG8DWgN9dm+b69GJcEOz1mROB5cDVwFdRo/dURCvwCvAc8G7A7z6S5vqkl2Cvz5wArAK+Ev77VCW2P9pQ6/QG4PWA330oXRVJG8Fen3ktsB41Feelqx4O4yTwGvAU8FTA77bGugJjTrDXZ14AXAdcA0wZ6/LThOPAiyiSXx3LgseMYK/PzAK+Hf4sHKtyxxl2A48DDwb87qaxKHBMCPb6zHOBHwGXcfpOx/HiJEra/nnA797kdGGOE+z1mTcD3wPmO13WKYZ9wIPA/QG/23SqEMcI9vrMQuC/Ad/iy1E7FEzgd8APA353nRMFOEKw12fOAf4VWOPE809DbAbuDvjd21L94JQT7PWZs4FHgPNT/ezTHDuAmwJ+99ZUPjSlBHt95sXACygT3ZdIHDawLuB3P5eqB6aMYK/PvAhFbkGqnvkFhQTWAn9IhZVKG319wOszrwRe5ktyUwEBPAt8y+szR83PqB8Q1kw9y0CPiS8xOvwGuGq0DxkVwV6fuRKlgnONtiJfYlA86/WZ143mAUmvweGt0EdA9kjXahqc7Abbhuws9fcXEZoGXSfVvz2ZIGXcty5KdguV1AgOb4UCxEGuENBtQn6e+pzsVi/6RYMQYJqqg5cUgdmjvosTT3l95pJkyk24qb0+MxelxFgez/VCwOFqybqrde681UVHu6T7C0ayEBAKQfMJG+83Da5fZ1BTJxMZwXOA+8OOEQkhmWb+7ygD/YgQAjo7oahQMH+exsIFgrXX6Bw8rF4ugR58ykIAQoNDRySrV+pccJ7G3DmCaVMEbW0JtcEy4Gden5mQvJMQwV6feStwa7zXCwHNLZLzlgrcbvXdNV83WH2pxu69NroTjq7jDIYBhw9L5ldp3PRNAyHA5RKcv1SjpU0m2snXAz9M5Ia4CQ6b/L4H5MR7j2VBMARLF2t4POpNcnPgu/cYFBYKjlRLDCOR6p5acLmg7piktUvwD39nUFSo2sDjgSWLNDQNgsHEHgnc5vWZcc2gECfB4Q3391HRA3FBTc+SCaWCM2ZqZPSZWAryBQ8/kEFzu6C2TuI6DUl2uaDhuGTrPnji310UF0WHqq7DpEmCGZWCtvaER/FU4Dtha92IiHcEf484190IhID2TjhrgSA3d+Dv5aWCZx5xUV0Px+pPL5JdLmhskmz7HF56zMWsmQMZzM2BcxZpvdumBHE58LfxXDgiwV6feT7w1yQwNYOanm1bsPwcjbzcwbtoZYXg2UAG2/ZDXf3pMV27DEXuHz6A3z/kYv68wZs4L0+wdImGbgh6EpumAQxgvddnjqjpimcErydBHyohoKtLUlgIU6cKXOHpedcemw+3xmo5Zp0hePnJDPbVQG2dxDiFBS/DgIZGyZYd8O4TLhYv1GK2gzt2SbbvjL5/Qb5gykTo6kx4mgaoBK4Mh/cMiWEJ9vrM9cC6hItGaWzmzhJkZ0XL338AfvCTgd117hzBy09loBuC6hqJpp16WyhNUwJVSzu8+mQGy5dqA/b6//iLINs+jW5+c3NhQZWgO3mHnRuBO4et11A/eH1mESrKYEKipUoJtoQzZghy+ui6NA02vSjZs3fgDn/aNMEDv3AxvUJQfVRiWacGyUKo962tkxQVCfz/mkFV1cCKNzfDE7+xkX0msOwswfQKDaGJZNW3buArXp85Y6gLhhvBVwN/lUyplgWaLpg0UfRujwCO1dvMPAsefCg06H1TJgv+/l4XKy7SaGqWnDyZ1NQ1ZoioH483wpKFGj/9exdzZg1e4fv/PcSUeXCiJdq53ZlQVqam9tDgTRIPrkAF5w2KQQkOB4FdhOohCSMUAncGFBeJXsFJSmhokMw7U/DMSza1dYPr6SZOENxxi4v139Dp6YGWVsad1isyatvaJR0dkivXaHznLoOpUwavZEsb/NuTFufMF9Qds2kNxyAKIC9XkJcDPcFRdebLvT5z+mA/DDWCL0BFHiQMIVRliwvUhj6CxibJ8UZJTrZg7lS4799ChIYI5CgshGuu1vneXQYzK6GxWRkphEg/0UIoQ0HzCZhULrjbZ3D9dQZlpUNXLPBoiOllkJsraGqG443Rzp2ZKSgvTVjh0R9XoCIyB2AAwV6fWRq+IWm/qlAISksEmZnRlz7RImlrUy9WMU3w6iabd94deuHJzhJceIHOHbe6WLNScLJLcqJFEgqlx1ChacrM2domaWuXXLhccKfPxarLdPKHcQr+dIfNk89azKwUSKCjQ9LaGiXY44HyMoFloZx1kqwesNbrMyv6/zDYzvNslE9QUpBSNURpCWRmRr/v6FCStQhvgyqmwCOPhag60zVs758xXXDDdQaLF9m8sMHmo08kBflqJog0+kgYatTHY83RhGr39nZJSxvMna1x1RUa86o0ysuGn05aWiW/fihEeYlSfpg96tPeEb3G4xGUlQhAqPokP0OtAZag8oxE69/3P16fmY3Ke5H06FWNJigujB3BnV1RG6htqz3gsQbJM89ZmD3DP7OoSHD+cp3bbzG4+1adYEhQe0zSGp4R+o7ovtO4ZSkhqLNL0t6hZpC2NvXvzk6JaarZJrLG971XC/+7vUNJyF3dgptv1LnndoOVK/QRyZXAhj9b7NkrKSlRI1QAlq10BBFkuqGoCNDASn4Eg8pRcll/FWb/EVwGfH00pdjhXpifrwStCExTYstoB5USykoFr22ymHWGYNVKfcT1tbJCMGmizhkzBVu32fz5NZsjNZKifEF2tiKzq0vSEwSJQNfVyHG7BZmZSsuEgFBQGUG6TAj2EG58pS71ZAk8mdDepZaV/DzBtV/XWH6uzswZGllZ8bXDlvdtXthgUdp3dgp37p4+HdrtVp1dF2BboI9u+bkK+L/AicgX/QmuQk3RSUPaqvfn5ogYA0OwJ3Y6lVI1uOGCRx+3KC0WLDp75LfLyIB5VRrTpmmce47N5r/YvLzR5uARSUmxYHqlRsVUweRJgvIyKCwQeLLUKNdEtGzbhpMn1TRafxxqayWHj0qqj0oOHZUU5guuvkLn0os1Jk0SFOTHP3fu3iN5+FElRGZnR5cCES47GIwdqpketdtIgSvTZGC512d+HolF7iXY6zPzgG+MtgTbVtYSj0cZuiOw5MA1T0rIyRa0tMJvnwqRnWMw+4z4unBuDsyZrTFposaF59kcqZZMnCgoKRa9ozbDRa+adCiEQmpEmT0yvC2TVFdLpkwWTJwgyE+AWFCG/cefDlHfCEUFYtB13u73naFDhoveaXx0MzXXo/zTmyB2BOeRpGKjL6RU04xh9GuYIWotpfLV2n9Q8ptHLHzfFsycEX+j5uZCbq5GZYUiM9FtlGGoT1ZYpVpeJpheAa6MxOWd6qOSxx4P8ckOSdEQHuKy948oNE2RHAqRCoZXobSPTRAWssIK6/NJ0GI0GKRUI7j/Vma4hhcCCgoEuz6XPPRoiMPVib9hRkbq9sgZSZBbd0zy26dC/OUjSUHe0Fs5wcB6ahroxqhHbl+s8fpMA6JStBu1900JhMaAFjKMoV9aSvVbcRF88pnN//p5iEOHU/i6DuNojeRf7gvx5mabkmL1rsNtwXQ9tnGECLdN6l75UsK+6pEm13E4rUJGhhhW8R0hubxMcPiozX/9HyE+3zf+Sa6tk/z0/4T4+DObieUCXRua3Mh2zJUx8LcUK+jOJZzaMdLmxaSQYMse+JJZHrVGDtezZVgQmzxR0NZms3JdDxtft0arxnMEtg0ffGRz+bU9HDpiM22K6NVRDwdDJ8YAA0roClmkkuVSYAFECR5Uj5kMRHg/11/kz8pSe754tEeWBeXlgvPmwV33Bnn86VCM9ifd6OqCFzZY3HR3kDnTlBXMHqRT90dEPsnqF8Vl21EJOoW4HKJS9IpUPVXTwt6U/UZdfp4gJ1twojW+54RCSgGwpAp+5bfYvkty920GlRXptTbUHZM8FAjxuxdtFs5WBoR4TX1SKnL7667tsPdpitfhiyE6guOKUogHEVXkyS5ltI+goEBQUBB/Y4CatjwewaIFgoefsnjk8THPIzYAL/7J5u/+t8WS+YKcnMTex7aVL1Z/pUkopAaEpqVUkl7m9ZlCCyfTrkrVUzVNrSlt7TLGmSwvF0qKGVHv3B9SquiIZQsFa69Kf7zLqpUa676u0daeUOgJAD1BZSMvLo4SLKXSlYeslFvJcoEpGiruJWXQwlJkSyv09PM1KikRmD3xN0ykGT4/KLnuGzrzqtJPcGWF4MbrNPYdTtytqLtb6d89faxspgmtrRLbdsQMerZGCkcvRCwykqZmSbcZy+SEcpGQICE0qG+AS5YL1lyu9+qS0wkh4OILddZ+TedobfxDWEoIhuQAK9TJbmhqBqQjBM/VUGccpBSagMYm1WP7orRE4IlTktY0ZUO2gb++waC8fBywG0Z+nmDdtQalxYLWVhm3BcjQYcKE2Pfo7laeLkI44n82W0P516YULgOON0m6u2OZnDxJrT8j7Ws1TRkADh6V3HGzzvwqLe2uOn0hhPIYve1bOvWNyio10uizbMjPFUzo11FPnoSG4455qUzTSHHGVynBlSFoaVP7xb4oLRFMmyZoaR26twqhpOf9hyU3X69x8QUaGYNoftINw4BlS3Xu+rbOviOyVwoeDEJAVydMniyomBr74qYpaWiUMabVFKJIw4Ek3IauRmDzCUmw3zZi7hyNltbBhZOIJqi6RvK11Rpf+6pBQcE4Grr9kJUFqy7XuWmdxoHDEis09Hs1NklmzxIx4TlSKh+v9k4VUpqoVB4HcjUgrii1RKDrYFmSY/WS7n7BVecs1sjKEjF7ZIg2zNFaycIqjWuvMpgyefySG0FJseDKKwxWXaJx8MjQge3BECxaGDvETROOH4dQyLG4rGyNFJgI+0MIJWjtP6h8n/qicprgrHmC+oboNB35u/YYnDlLcItXZ/bs8U9uBNOmCm68weDC5RqHqmNJFgJOtMKsmWIAwZ1dkkPVdq+hxQFkajiU38qTCXsPSE52D5x3VlyiceAIvTFIQkD1UZg6CXw3G8yr0sbHaSEJYOZ0wc1/Y7BkgWDfQdn7XroO+w5ILjxfGyBtd3bCnr04tf4CZAxiuR09pFQqxuONUN8gBxgeLj5fw9bDgomAPfskldPgP90zdLjlqYCZ0wXfucvFssUa23aojh0KQXuP5KurB4ZNdnZKjtRIsjyOrL+AMjY48mjDANuSbPnAZs5sjcI+wlJBvuDq1QbvbbGQEi67WOPuO4aPDjhVMG2q4Cc/djHhN0F+/4JNZib8hwt1Jk+KfbeOTtj6iU1Xl6Sk0DmCHRnBEWR5YMduONk18Lcb/kpj80bJ9Ws1/ssPh3d+P9WQkwPf/66LO2/ReXOLzZVfGTgrdXVKPt0uyUyhq9EgEAbqDIGUC1pSKsvJwSOS2mM2EyboMYLEogUaG9/I4LIVp+6UPBJuusFg8iSN5ecOfMeWVsn23ZL83KRDR+NBjwY4doSqywVWSPXUk/3UlghOa3IjuGyFRnY/Z/nubti+06azU8aE9ziAbo0+XvCphpSQlwNbP5G0t49//6qxQmeXZOs2SbbH8VNROjWg0amnSwn5+YLPdtocOWIPUG58ESElNDXB+9tUWEx/J/gUo11DnXztKFyGihX6EuF9vyZx6WMS69yioU61dgRCqPWmsEAwdYr4QqQujAdFBYKJ5dDlfIqKag11QJNjMHskxUXRXJVfAjQdykpETJShQ/hcQ51T7xiCQSgs+GKlDx4JuqZ8s/pb2hzAbscJtmzlcPclwVFoGmTnDIwydACfaAG/uwvY61QJlqUi98aDP9V4gRDRADcHOe4GDkbG1RbHipFha8mXBEchRDT5qnMMfxDwu+1IMW+h0uKlHhGT4Cgfs++AZOceyYlmO7y/1phzhqBqrrM9Z+9+ya7dkhMnbCRQUKAxZ5Zg7pzkyx0shNQBvA3R0JU3HCtGMqpe+tl2m6efs9jyoU17h0paAmCaFu5MWLpI48b1OgsXpHaR373H5olnLN7dYtPRGVuuJwsWn6Wx7hqdZUuTLFc6zvBGiBJchxK24k74HTekcldJ1hy2Y5dN4GmLFcs1KqZGg9oi2dK3brN54RWb/3mvwdprRk7kEg9e3mjx45+G8LhgRqVKCdG3XNOEZ/5oMe9MkRTBUkqCIUclrFbgA4jGJlnAJ06UpOkqP1ayEuPKFQZ/s1anpTXayFKG82FqML1SsKgKfuUP8fqm0etCN79n88sHQ1ROgjmzRG8wXSS01baVLfeqVYJLVySnuZFSOSVKHJuq30e5lPcS3AP82YmSDD0ampEMykrh+ut0JpYrZ/pIuEjfXFjZ2YKSIsFLr1gcOJi87a22TvL6JgtNCPLyoma8SHm2Da2tarr+5noXldOSY8eWqpM4uLN4C8WpIjh8yuUmIOWh1i4DTrSMLkXQ/CqNO28zqJgCNccknV0q5MM01afbVI3+8XbJvn3Jd6b9+23eed8mO1uNsO5wGd3dKpFbXb2kMB/uvt1Ifu1FdcqmZkePMdgQ8LtDEJtlpxX4PSoNT8rgzoTjzXLUarlFCzW+e4+LTz612fyexfFGpUSJOMoHgyoX1wdbbRYs0Jg4IbHhcaIFdu626exUniiCaK4NTUBpMay9ymBelaDqzNEJdLYF9cdxyqH/XeBo5D+OEiwluDMEdfWSY/U25WX6qDRaM6cLZk7XOXuhRmOjctpTBEtaW5TAdeCwSnGYOMGSXZ/DRcsEy87VKSwEl6F8pQxDHe4164zUzKntHSr1f26WI75YjwMtkf/0Ehzwu6XXZ34K7AbOTFVpuq5G1779kqq5sekNk8WMSnUkTX8sOlvjSLWMcfCLF3m5sO4a5RxXMU04tk8NheDgIZuODklx6qM2GoF3An5371LbfxWoB54nhQRH1HI7d0uuWAM4GGc0ZbJIOhqipFhQcp7z2odgSLUF4XwdKfbHegGo6ftFzIQZ8LvbURqQ5E7zGQL5eYLtu1V29C86QkHJtu3Km8OB6fkVwhnuIhhsRfwYNYpTApWPEmpqJTt3Jy/hng6QEg4ekuzZZ5Ofl7zyZwhsAj4K+GMN7wMIDvjdtSiC+/tBJg1NA7cL3nvf/kITbFnw7hYbK4QTwWZPAfv7fzlUMW+jSB7V8eIRSKky2L3xts0dt0JBn3TjDcclbW0qOYumKafxslKREmFsLBEMqXdpb1dEZmSojLhlpaJ35yAEbHzTprw05dPza8CbAb97wFMHJTjgd9d4feYmUkhwdrZSUjz/Yohl5+ps3WZTU2NTV6/OMYgEUHs8qlGmVwjmnqmxcIE2YkrgdMGyIqeZWRw8KKlvUEoY21YjNDtb5ayePFnjnEUa+/bb1DdIZs1IOcEvB/zu3YP9MKTY6PWZk4BfAdemsiaRs5Aam8CTBVkeld9RCKWbtW0V9d4ZVuWds1jjjttcTEr4eC5n0doG9/uDvPsXGzOojm73ZAo0PZr427Kg21SkFxcoA5LHo5wfUkjwJuDugN+9Y7Afh90XeH3mt4B/YRRnOPSHZaus8HocbqO2hCPVEhv4+T9kcO6S8eE1sHev5D/eG6StTTKjQoyYXTZCthBKN5/CwSuB7wf87l8MdcGweqWA3/0I8GTq6hNJFh6fFUUTKnC6MB+WrTB59fX0e85/vM1m9lITISVVc5Qr8EijUQj1znpqyQX4LfDAcBfEozj8A/B5SqqTBIJBKC0WrLtGsPorwQGnl44l9h+ULF4T5Oo16kyINGfBrQdeCfjdw+524przvD7zJ8CPSPKou1TAMNSJYRs+hRPvu8lJeTzk8AgG4exLe6gsl+OBXIAHAn73XSNdFK/q/5+AV0dXn9EhFFLS9aIy+OWDzjsU98ejj4eQps2U8UHum8DP4rkwLoIDfncHStg6lHydRo9gEKrmCF74k8X2nWOn9qyplTz2O4tFZ2lj4aw+EhqBBwN+95F4Lo7beBfwu18HHiTsKZAuGIZSfb64YewErj++ZBEMSrI8KVcvJgoLeCzgdz8d7w2JWmf/CWVvTBssSyU13bHLpiaBZKDJorUNtn5sM3liYrmhHcILwE8SuSEhgsOuPT9CeQ2kDRkuZTDfsSt+goMh5SbT2JSYd8mu3TbVNTLmqPo0YRfwtwG/uy2RmxJWeQf87gavz7wbeIIU2o0ThSdTsGOnzaqVwycqtW3lW33goE1NnbJmTZwgmFGpMX+eNmLU445ddvoPLYZjgC/gdyccCZp0zb0+82yUaTEtCAbB0ODeH7iYM0RWvFAINr1l8diTFo3N4HLJ8AHWgtwsuH6dxupVRkyC7r6oOyb56c+CNJ3A6VwaI+HSgN+9KZkbk/aQCvjd24D1hP1vxxqGAU0tks3vDS1sffqZzcOPhmjrkBQXqUD0gnxBSRH0hCSBJyy2fjz0/ZvfszhULdMd2/ydZMmFURAMEJbmUmqMiBdCQF6u4I23bLZ+PLCPSaky2bR2CPLzYrO8apryMrEswbZPBskABOzZK9n4uk1ujkhn6OsdjKCKHAmpqPrzwC0peE7CyMhQ/srP/zHE0ZpYgavbVAeDRFxTB9veuN0q5XF7e+z3TU2SFzeEqKtX/tZp2hr9GHg4ckxsshg1wWEj8yPAutE+K1EIIC8PPtwGv34oxJE+h1p6MlUujM6uwdmRqHRG5WVCncAdRn2D5JFHQ2zcJCkojD0idwxxF/DPAb971DqHlFQ/4HfbAb/798BaHIiOGAoSNd2WlsCWj2x+cV+IPXujhM6fr+HJkBxrUGa6vhlgW06A2a2uMcIhRtVHJfc9EOJPr9mUlzHsOYQO4k7g1wG/2xzxyjiQcvnf6zMXMcZbKCEAAQ0NkpoGuHGtzvq1ysf54CHJLx8I8dE2m/x8ZYJsaYPZMwX33G6wcIFGY5PkmecsHnnSojBPnZ0IY05uLeAN+N0p1fk7ssHz+szFwP2k8ES1eKDrKmapukaiG4LLL9G49iod25J8/JlSckgJRYWwcL5Obg48v8HipddsujokUycrN5s0JGzbAdwe8LvfSfWDHdvBe33mZJTFYx2OurvHIjINd3VJjh2H9k5YslBQNVuoZGwSNF2y/4DkLx9JPBlQXgY5OaI3RHQMYQEvAj9IRokRDxxV0Xh9ZhbwXZSUPd3JsvpDoAQk21bxyZ0dMhpUL9WBGtlZ4fN+SctaW4dayv4x4Hc3O1XImOjgvD5zNfCfUcfYjrnaQPT+EYs0bX9slFvyfQG/+1mnCxszJavXZ04A7kG54s4cq3LHGY6iLEL/HPC7D4xFgWOuRff6zCtQIapXAnkjXH664CTwR+AZ4Jn+4SVOIi1mkvDafD1qNK8kfN78aYp3UJ6pTwT87paRLk410moH8/rM2SiCrwQuxaEjftIAC+U3tQHYGPC7P01XRdJu6ATw+syZwIWoEb2CU5foEEqAehJ4e6hwkrHEuCAYwOszBVABLAFWAasZ463VKFCL8jr9M/AhcCDs/ZJ2jBuCIwgTXQhMAC4ArgHWMA7ripqG/x8qbVE10DxeiI1gPDZaL7w+00BJ2pWotfpi4BxgYpqqdBz4CNiMCtn8HGhPhdXHKYxrgvsiTLYLZQE7F7VmXwQsBoodKrYN5Zb0dvizGaX46onkoRrvOGUIHgpen6mh1u55QBUwC5gKFKGiIj3hT//NZw9qf3oSRWQzShGxH+XBuB3YP1qDe7rx/wE6BbqXqL0k3AAAAABJRU5ErkJggg==",downloadUrl:"https://chrome.google.com/webstore/detail/nightly/fiikommddbeccaoicoejoniammnalkfa/related?hl=en&authuser=0"} - ,[t.WalletNames.AptosGoole]:{ - icon:"",downloadUrl:""} - ,[t.WalletNames.AptosApple]:{ - icon:"",downloadUrl:""} - ,[t.WalletNames.MagicEden]:{ - icon:"data:image/png; - base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAABHNCSVQICAgIfAhkiAAACGdJREFUaIHtmnuMXFUdxz+/c18zs8u2MLO02Gntg26jKVA1hviPoUBsDBhiIn+YQNB/MEEQEQMGESpqozGCbxODAWKUYJr6SBMDEdMGq5AoCEGSLoLAbltImW07szuP+zg//5i77bKdndfOrpjsd3NyZ+89557v7/4e5/c798IKVrCCFaxgBe8ayGIGb8iPXZEg2wU9D7Dz7qfz5tD0t87pIy36LThWoALy4kTp8OP9cu5Z4A2jWzdbK98BPtXvpAPCfiNy+xtvHx7vZZDTS+difttuVfYB7++J2tJgTOGWkVxBy7XSwW4Hda3h9fltDyt6Q3/clhYCj0yUxj/TTd+uNLw+v+0eRb+4KFZLix0jubyUa6UDnTp21PCGwratVrUnP/lfQYxumTj+8qvt+phON7Gq9w+O0tJCm8G0LToKDFw9AC7LhY4rR1uB1+fHdg2Oy/KgmB+7ot31ThrePkAuywLpwLmtwArnDJbO0kPhvHbX3c7jW8MSE1LCMITPEL0mbRHKW5r0NKY5hzCKEMiC8y3IGToL3PKuEadwNcul9lamZYJD5iHWcCHSVQyEY8SMiMdufzNuOsVsoj3LWUVA55wTxTgh4oU8UCkxGSUUnd5LgZ41HFPlfPthrqp8l1XkcMwMHwyu4AH/Ot7DFkyHXGaKhJ0mzw/O2UnB7ZawABYnU8XNlvlsMc+eo6/zw1KVoulN6O5UMgdvyySX125nmBxq6ohYNkcXc0f0EEd5hYSFzdSiVHWae3M7GTY+kVoibPP4jpYQzvs/UiWyEFohKx43rctDZHul37vAMTCqeVxTwzUxjiSoCdlqt3Nf/DDHeI2YuOXYozrFg9lPcoGzikRTI1Y4y5BE5pjymdOqAtagVhgyzkLe2taHOwl8tr0o+E4d3zTwJcQ1Ea7EIHU26Ra+bX/Gm0wRz9P0JDVu9j7KR7zNxGmw0palMLgILgZXzJmjGBwcXAwihl++eRK8lubc1sY7+XBL+CbEE0FIELE4kuBIAiZiCxu5X7/Bl+Ru1lLAxaFCzIdkDZ/2L0XVIkYRUWT+dgDgYvhD7VU8MfOYCxJFuFGdv779Fj85eYKi21N125XALc0jkAaeKNAkbkhwTZJqOmKrbODH5mvcbL/Jas7lFAl3+1cxLD5IHUERFBdDIhadtweSFYfry/vB5OfNLKAGxPQlLPThwwC+08A3YdOsTfO3m5q3IzGYBttMkV+4d3KShD3ux9noFFBiDBbB4ouwr/oy0zZiri5jtXws816+P3wlYClKMKf5FI1LUfqi3ZXALf3BlwaBmRW62TImwZMIz0Q4EoE02GrWsD/4Apd570MlxEiCEUvGCIfCSW6a+TN7Kn8nRpkTpojUcm12jFuCrUxq1LdwrdBJ4NYmnWp29pgxMS/JP8FU8U2CJzGOxIiEFCSLL4pJ/dwzynFb4drKk1xgRnkkmuDBmRfPmkOAW4cv4RJnmFr7wNsT+jTpkMA5Y84ZE/EKh/me/TkqMwQmxpMIVyKc1MxdiXGNJSHitsoBMpLBQVgnAffVnueP9f/gimH2GVuUEfG53t9ISVsvc8smcGCay1LgzNGyCE/pc3wrfghrqgQmxjUxrjSXLUdicqI8XH2Wg0mJQpqRKQpi2OiOpMtUatrS3Ped1ohe8/R26F1gnfXh+ryglQDn8ZROsLvxa6zUCEyCZyJcE5E1ysHwVfY0XmCdBLO34qg2+OnQpWz3Cmky0oSD8FpcZnfjMBdIfxG5FfoIWgGBExKkPhyYBr5Tb0ZnoEiWA3qEe+r7iGSGnLEMOcoxO8V11UOMSvb0TY9ozI3+Rq7JbCFRezrxMiJUbMjny4cYxsEZoIb7WIf9plaxpy964uCSMPt8imR4wh6jNvN7rvEvREh4tDHOMEqQPuMqStEE3DK0Iy0NmjDSXJruqjzNP2yFdeKd9apiMeijPHTTtNKmi4ni4TQzrTndi/j8y5Z5qvYMIBTEY/Vpv4UprfGbkV2MOlliTcVVcMXw1emn2Rv+GyTHEU3f4KgBFZoZq7DWM3RdbPUgcAsNu2mQUmya+HviNH1Y5R2PKIchl/rrXBzRiHuyF3GxN0o4bxMgVstXhnZw19AHmidEcfwaJqjiBFX8TJXnwxPseukEa6FnoXvPpdUQOCFNQ1MUwReTmnRnNHUZ87ncRUSzws7JqRU45/RDUowb4fiK4yvGV1zPcvlqjz/5AVc+U6eYXeJ6mHRfw2DTPLqZKjZLws6Tl0i4wd+EL+aM+cyzI03/MAm4DXBCcELEDcGNSCRkbLWFqOV8Ay4PxeP5qIQnDqLginDc1vhR+AZrulg+zsXwSPwWMYqT1r1nmiDpOSOK40W4Xogz29xmC/yQF8oxeF1y7kHgs3C+ZLhx+mmei45TJ+H1uMId5b9R1hivCw27CNiIL5/6C+PxSaoaMT3bbNhsGjFjqsyYaWbMDFWpMSN1ZqhTocETx0OuflZZk+mVfR9By0cI1bLr1OMgAWiDIcmwrofkoCguj8Vv8quTr8OCaaMBdcCaZoS2Akl6dIU1mYXq//bobwMAoSg5LIqRXD+3YC0OSK6z2w8uyQI6m3Tb6/P3JP4f0OHNg0wtF5EBotLuYluBHfTsQvVdD2nLuaNNFvNjg6u+lwGTpfFFL0t7B8RlObC/U4eOAhv0zsFwWXoYlds79ekY9E/Vpk6M5AoCXDYIUksFQe6dmDq8r1O/rla5cq10YFWusAnYsWhmS4D0s6Xbuunb9bJerpV+typXUGBn38yWBl+fLI13/UlVT3lMuVY6uDpbeFSFTcBYz9QGi70G/cRE6eXf9jJoUanS+vy2XaDb008j3vlOe/AflxpFphz0xTdK408uhvcKVrCCFaxgBe8S/BenczprG54PsAAAAABJRU5ErkJggg==",downloadUrl:"https://chromewebstore.google.com/detail/magic-eden-wallet/mkpegjkblkkefacfnmkajcjmabijhclg"} - ,[t.WalletNames.BackPack]:{ - icon:"data:image/png; - base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAABHNCSVQICAgIfAhkiAAABBZJREFUaIHtmktoXFUYx3/fTEpNSoNaQYpzZ6hVwUdEs2nVeM+krYLBiotW8QWhmyyEgAsREXHjSlEwuBKxghYkvh9VEUzmXHVRC11YUIylJnOnlGLBByilOvdzkUayqMw595HEcX7b+/++7/+fe+fcOfeOUDDzdbOppOwR5Q7gWuBSYCMAwk8oLeAQwruBtZ8V7UeKanx8tN6/LtGXUe73KPtD4OFKZF8tylchgVthWFPkCHBxyhZvBpG9J09PS5TybvjDrvp6RQ6TPizA3mZoXsnL03JyP8NxaN4H7gJ+Bk4AvwCJwywFBoALgRqwDmF3YO1Hefrry7NZ69b6RQm8hzCpyOmanf3dt8fczl3l/nZ7I5psReWyPP31+D9Q2G1piV/HQin3dRijcGZwg15y4OOi7eQbOB4d6aPdNwx6t8I2gc3AJhYXpE60gVPAAjCjwidVa4/l6Q9yCjxvRgdLmkwKTACVPHqe4yjwIu3S/uCr2T/zaJg5cByafcBzLN5OiuKkwEQlsh9mbZQpcGzMGyj3ZjXhisCBSmQfzNgjHXFovgRuyTI8JUeDyF6ftjjVT8vYmGnShZ0WZLeWZDgRGUF4BJjz7DEUh+ZIitlAijMch+ZR4BnPssNJWcZqs43T5zvYNOYBUV7z8SPweiWyD3n68AvcrJtAEubxuzIOBZHd3kkUh/UdoJ/7+EHYG1j7lk+J3yWtPO9fI06LWhA1ZhCmPP1MNUdGL/ApcTbfMmaLKHu8DMF08EVjwVldlidZ3Fm5sllKyeM+hpwDJ8q4T+NzeF1uwUzjN+A7zxn7WrePOu/6nAML3meXNvK9b43Ccc+SSnImqbuKnQIvGBMA13gaQWCDbw3Qn2LOuKvWKbCo3OxrAqCMDvvWCNyYYtT2uR23lV2EboFFt6UwgcKkj75ZNzexuLvyZWt/+6zTMzS377ByZQoTAFfFoRl3FUvCSynnoBC46FwXrTSf+hL7T4RmrJOoacw7wHWppySyxUXmupynWXz+IYGDrdBMaYlng4ZtLT/WDE0o8ALKDVlmIAy6yJwCKwxk3TgrTJIwEYdmDuEYMIByNVDN2HrZiM44BRbHZg6sB4ZQhnLq503ubx7WOr3A3U4vcLfTC9ztuAYu/B3UStFNgfPbHgJvZzCyEqiU1LoInc9cbOoG1Sp+D9lWBJVSVLWz8Wr76NFjFfD4Dps6yhVFmkmBAGcV+bQaNU65FnQkDs3TwBNZnBWNlLi80rA/dtK53pbuy+incJJEdrroXAOvuVvRefjLReQaOK9HPKtOb/PQ7fQCdzu9wN1OL/C/8F944uGEa+Bc/sm6FnAN/E2hLnJA0G9ddE6BVXgsm53CORhE9msXoVPgqrULWpIawgesrcv7JPBUENk7XQv+Bqq6CqA/Q5ivAAAAAElFTkSuQmCC",downloadUrl:"https://chromewebstore.google.com/detail/backpack/aflkmfhebedbjioipglgcbcmnbpgliof"} - ,[t.WalletNames.Coin98]:{ - icon:"data:image/png; - base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAABHNCSVQICAgIfAhkiAAAAAZiS0dEAP8A/wD/oL2nkwAACxFJREFUaIHlm39wXNV1xz/nvvd2V6tda2XZli1Z8g9QbGMoxJAh7SgV0yGlU8qkoQ0lyZBpJ9BO0h/ATMo0jcmQyXTaTjtpaJsmqWdCJklDcQMNIdMfkGaiVElonAQDxrgGY2RbsmV7pdWP/fV+3Ns/3urHk1bSW2xLxXz/07nnnvs97/445567EpZAYaDvRuB9wC8Am5bS/X+AM8CPgMdzvf0/WExJ6gkLA313AH8JbL0k1C49hoA/yfX2f21+Q8ThwkBfM/AV4PYVInap8W3gg7ne/olpwYzDhYG+LPBd4IZVIHYp8QJwU663fwxAzWn4Zy4/ZwF+DvjG9B8KoDDQdw/wq6vFaAXwS4WBvvsApDDQJ0AeaF1dTpccJaBVAe/h8ncWIA28TwF3rTaTFcSHFPDO1WaxgniHAjauNosVRKsiGpoue7ylnIW3oMP2hXUPQE9g9ClgdI48i6gtIC0gDQ5hfIwZA30MqIbJrwFkG6LaQZIXxPgNOqwxwVmUvR5n00dw2t6JatoAygYToCt5vPwBvLNfQ7snEasdsOLZTGwmuWkvzto9SCKHiKC9IsHEq7hn9uNPPoOozY1/yBqkMNBnGuphPGCM5Oa9pLrfC6ppCV2X6tB/UDnxZ6AFJLWIng+Mkuz6JKnu20ESi5r08gcoH70fE3ggS4y9CBpz2FQRK036qr/DbrkqdregeJziSx/DuKfqkAzATJHe9QWcthtj2dPVEaae/z2Me2bxj7gIGji0AhBN89WfX9xZ49UVW83baL76YcTOLdTRZ0ht/4tFnNWAv5B0sp3m3Z8FKdd04iP2RjDBKZp69mFl3zZPXsQ98z380WfR3nnEzmHnrie56WbEyc3oWenNNF35KUov3wXSAQiYMtaa20h2vDs6WFCicuop/LFnMcbFyuwi2fkerHTXrL3mrSS79lJ5fS9ixa8+xVvSpoLVvIfMdQ+DOLO8ioMUX7oPXXkOkXW1tgCj8yhnC+mr/ha75eqIqakXPkYw8X2QNOiTpHf9E8662ezW+JNMHbyboPQ/4amMYMwUooTm3Y9i52btaXeUyZ/8CpgUcRdrLC2jz5PYeHvEWRNMMXXwVow7jFhbQWXCkCFpxOrCBGWKL74fXR6K2Ep23onRZ4EArC7slh2R9tIrnyMovRjalCaQFKLWgclQOvIRMO4s+UQrVvYWMJVYzsZ0WCNWDrv1moi0fOxLGG0WPyklCcam/Nq+iNjO7QjDlPFQiS2Is2amzfgF/NFvIlZbXXu6+kO8wuG5Qqzm7WDKy7tRw/IOmwBJ9KASLXNkVfzzjyFq7TLWM/jj38G4+VmKVhaVvCIMRZKIUDBBFUxpcVrSifEmoiKVwpj4B1fMGW4FNZvhaHccE4zF6K4gGEG780g66wGN0UUgCG1WRqiefJLwnk54mptKOHvGDXmoDtzT38QvHJqxZfwiIsslNbOIcUpLLZRoprMlURaIopbzLdPdXpgVGRfEwXgn0eVh3PxzVAf3hjOMIAokcR0q0QFYmGAMXT2MCUbwJ55m6oW/x2l7kKYr7yEoHWsoAYnhsML4Ixi/hNjZ0AenDZXcha4OLZkVYXzE2YlKzd2TBu0OAw4YoXjoj9GV5zFGo5JXktj02zhtP49KtSFWEhDQHtqbwh8/jHv6Cfzxs3ij/0Lw3H/XzpH4ycfyS1osjHeUoHIuIk50/S7G/9GSXY0+RWLjHYiVnpHp6gim+iqIBSh09RTGTJLYdB/ZPY+S6r4Dq7mr1ifUQSVRyTYSG95F5trPkN6xH1Ea40/Ulvsyq6whhxGMsfHP/TAiTW58N876T2D8lwmX9jxng5PYa24j1f2bEbl3/gCGgOlrkNEnaNr+BdI9H0WclgV26vFJtN9E5rqnwFK1PDw+YiYePmI3kb1+P+LMLXAayscfwT35YYxZC7KmFiJGSGz6a9I9fxSJ3egKEwfuxHjnwj0cDJHsepCmbR+qP6x7DqM9VHJd3a3jTx6lePBmUNuIO8uxLw9G50msv4v0zgcWtvnj+IUjaLeAOFmclrchiXUL9MrH/pHq8N+EGZSpoNK7ye7ZR3ShGapDT1E98RDafS4kaWVw1n2C1PZ7UIlojK6c+AaV1/8UsToursMAJjhKautnSXXfEbfLDKqnn6by6t0zs2GCQZp378dpe8ecAVymDj2IP/p5xLq2ts8hXPpjiCqSufYZrMz22S7+JJM//SDGG411R26oxCNWD5XX/5DysX0YHTOdMx6Vwcdqzm4lDHM+KtGDs/a6iGr52CP4Y48h9p45zkIYqtaC2UDxxTtBV2db7CxO221gorF+MTRY0xLE2kV16K+Y+tmHcc/9AONP1fczKOHlDzB58F4qgx+vzWxtOFPBavnFyP7WlTO4I19ErO4lhk+i3WGqp78TEdutbwfq85iPN1QnEasDXTlO6eUPoJLXYmVvRDV1IXYGghJBeRg9+WOCyo8R1bHACUMJqzl6afDHj2CCUcRaw1IQqxPv/DMkO2+dkalUey0WL58INeiwhpm8VSHWVow3ip//V6CKwQcshGR4y7G2gQnmhA4Jl6qpLghB2h0D4hToLIx3NiIRKwHSzEV2WCN2BlF2aFgU2psMM07JAJk6Q2lUci2zcVrQ7jhIYuElwGkB3PkG6vNwopcWoz0wxfCOvQwaqnikd3w9clkvv/YI7tBnQNW5zhkXldpO9obZn1kYb5SJA7chNBEU/zei7rTspKLShF9w8aPFBMM46345ItPls6DLYC0fixs4tBIE5eEoybYbMMGhutpG57HX3hQlVh2HIA+SJhj/PnPrVaqpg0T772OCU4tTMFXEaSPZcUtE7Bd+BpKN5UVsh0WtwS/8hLlppN1yDc6GT2P8o7V9agANehSV2LwgXvuFQ2FvsdHuUbzR5yPtTVfejd16J8Y/MnMlBBMW5/V5UJrMNfsjxXjjT+Hlvx1meRfTYaSJYPwJguLJiLh51wMku/8csZvBnAKK2K2/TubtjyL2HBLGxT37JCJhaiqqncrgPiJVSUmQuebTNF3xRVTqCmAczDnEzpLYcDfZPd/CyvZExq+e/k905aXYhfnG6tJ6EnvtrTTv/hTzT0PjTaDdccROoZLrF3StDv8b5WP3Iqpzto8+Tar7IVJb3l9nrEpYaDAByslEP14N/sTRMBEhQ9y5aywsqSxe/qtUBneS2vKBSJM4a7Cc+svKH3ueyvFPIir6FC1qI9UTDyF2lmTnr80bK4VKLX7PDYrHKR3+g7BiKfEXasOvh2J1Uxn8OKVX/oF6RfL5cEe+R/Hw74BJsvB9SUC1U3ntfkqvfA4TxMuW3JHvMnXwtzD+5NIFiHr8G35bqsEEZ1HJ7aS678VZd300NuoK/vgRKicewR//FmJtZunHNAN6FLFbSXR8lET7u1CpWrF+WsMv4I0donryywRTT9deJ+PXsqbxhh0OWXgYPQwMopwbEacTdAFd/SlGC2L1NPjgFWCCPJiXEXsnKtEDKhXWvtxnwXQiVtcFPZlemMPzyIZpp6rtqfhll/qYTmNNzWbjs1kPF/ggPhfWRSMVQjV0GDVg9a2Ft6TD8UoFlweqCnhxtVmsII4o4PHVZrGCeFwBX11tFiuIL6lcb/95YN+yqm9+fD3X2z80fUo/QPhvMJcr8sC9UAtLud7+AvBeoLpEpzcrAuA3ait5Ng7nevufBW4m+hvCNzsmgFtyvf3904JI4pHr7R8ArgKeXGFilwL/DuzO9fb/11zhohl+YaBvB3A/4VLfcGm5XTTkgSeAh3O9/S/VU/g/Ug9BgiKWjjgAAAAASUVORK5CYII=",downloadUrl:"https://chromewebstore.google.com/detail/coin98-wallet-extension-c/aeachknmefphepccionboohckonoeemg"} - ,[t.WalletNames.Phantom]:{ - icon:"data:image/png; - base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAABHNCSVQICAgIfAhkiAAABWxJREFUaIHtmltsFFUYx39nWkCigtxEmG4JF43WSzSAMTXEUHnQgBhvCRqNQZTOghgNGthZGyHiTqFRHtR2FpCYmICoiBGiEnkyTbzgJZaAKEhIYKdcQzByk+58PjQr2+3Odre7M1tMf097vvPN/3z/nLOzs3MO9NNPP5czqtwF5KIl5oxSSkaAGoHIVYCGUheBv4FjtdPHHLjtrsIs9CnD8cb2GnHd6ShVh0gtMAS4AtCypHcAp4HdwCYR2RiOVp3qaYyyG15rtVcnxV0EPAlcV6TcFqUNmFe/9FpP42Uz3GI5M5VII3BLycUVzxsR/d3sXQETjyWeFlgNDPN5qM2GqT+aGQzMsB1zZoC0AJOCGhPYZJj6nPSA74Ztq70acZuBmX6PlRVFgxHRV1xq+kg8lnhR4E2y32UDQ8Ht9ab+K0ClHwPYK48MIel+Jsh0P/QLRaAZuBt8mGHbcqYh8iVwZam1i+ROw9R3lnSp2ZazFJFv6HtmASJQwiVtx5wNiDxeKj0feAhKsKTtVU4lHbIDuKfoknxHaiuKuXxNLDFUXHYBd5SoonTWgXwIqgO43iOnA+R9UB+hUMCEnIpK29vrGW5pPHKNcpP7gJG91fBGphhm1U+plh07/BKotzKSzoi408LR0C+X8hLLgNdyCH/aK8Nxq32YiLuH4h/2s7HGMPX6zKAdS+wGatJCyw1TX5Yl7xgwykO7reC79LrVTqWIuxN/zAJ84BH/IqO9zSPPKw5QVbDhjnOyA5hY6HX5Iso9kb1Htae3XNc97CFxKIf81QUZtmOJbfh9N3a1MR4dXZap0rzyZFwO9QF5G7YtZwUB/AFQGnM8emZ1acFjHnkP5NLPy3DccmYhEs0nt2iE+XGrvcvPnG05L9D9RcHLtpW4oUtezFkBDM+hfrTHu7Td2B7CdfcDA/MsuTQo1iO0AXXAbI+sf4D3gP10rr66HlT39vxo6brbCdosgPBMHlkDgXABqgdzLmnbcpqAmwoQ7OOofZ5LuqXRmaxc+THIcgLgOc8ZVq58HGQlAfF9VsO25USA8QEX4zdimPquboZtKzEakYZyVOQzX0O232GhARgcdDUB8DlkGLYtZxKwsCzl+IygPoHMGe6c3f8jrWFz7FFIM2xbzmiQJ8pXk6/EUx8uzbDIYnx6T11mjkuFbE41NIC1Kw9UAHPLVpK/rA8vqTqXamgAyeSgGfjybqrsnBeRpvRAakk/W4ZigmBVOFp1Mj2QMvxgGYrxm/aLoZHLMoOabR2uAQYEX4/vzF301CDJDGpKmFGOanxmvWHq27N1aIKa6uPAR0qgcQb4q4D8PYapz/Pq1ICbiy7JA9V5xKFIZDGdx5fy4azGhSm5EjRgbNE1ZUGQhwUVKlJmFUrL9WI9nZOum5w435xwLleShve2RDFsDJtVWyhud+Irw9SXCOosPS/pVldLhha8Wt3jV0ij9Ocv2gxTTz2TX+ilxreGqd8PEI6MOYXiFY+844BhmPq0BUurc85sCo3Oc4ul4k/XTaa/Km3rhcYGw9Rr0wNGRF+DohZoQqkNwEqQ+0TOhwxTj2eXyY6yY4mfKc3+bkLEnRqOhv7bA4q/fmikVGjH81YQWWhEq5pLUIsnGvBDCXQOIu7kdLMA9Q2hEwoW5XH9ViXueL/NAmgoNveclpPvNEneakRDR7N11pv6OyB1KFozun4HmnGT4wxTn10fDR0sso68UAB2LPEbcGMvrl5uRLpvSvdlNAAl7r10nj3Ol1aVvDj6cjMLaad4WhoTw5VLE/AIMDQj7wKdj4lbkeTbRrT6jwBrLCndtlpa3jgwWNMG1YgwHKhUSp1OIgcXRHSnDPX1008//XThX9DTrmAycJa1AAAAAElFTkSuQmCC",downloadUrl:"https://chromewebstore.google.com/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa"} - ,[t.WalletNames.Solflare]:{ - icon:"data:image/png; - base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAABHNCSVQICAgIfAhkiAAADWhJREFUaIHdm318VNWZx7/n3LmTF17CJCHhJQkiUN6F0PCyLch7EAFRFxYXRbqlrt39UKhuFfmsi1ZdXCkFqmjXqtW2KkqrwrIYIgWWAoKIQBBcEJNCCBBJYEJCkpm5M/fsH+dOQjAvM3nrZ/v7Y/64c889z+8+z3nezrmCJqC80zPAvhfUOGAY0B0QTY1rJyigCPgC2Anqd8Kz/WJjAxoUXHmnDQG1BpjaujK2OQ6BWCw8uZ/U96es76LyZq8G9Tn//8gCZIE6oLzZa+v7s46GlTfbBHKBie0hWTtgB8RMF54tVvjCjRrO4a+HLMBk8Odef6GGsGMCk9tdpLbHRL1ENQSA8k4bDerAX06m9oAYKjy5xx0Nq/VtPx9giAbcZHtArQUQyju1O4gLbTaP1CSrKoIcPFzB8CEd6dLFBBcQApTS0bRdIHq5QCxom2cDhqDk6wAb/nCRpY+dcv5QPLAwnelTkhj3HQ+JHhPpFtGTFzTnRd0rlDd7GzAt6qGNwRBYPpvfvHOBB5acdKRzI02HUzAEBIEQ37s3jRnZSYwb46FrshsZIyGkwG6AjUO02mcTF280fF/9yBHKm10IpLeM4XVwS/JPVbJoyf+ye+8VIAZp1p/Q2TYQCpOHhfO7MenWRCbfmkjPHrHgEnXJS4EKKVaszOfo8Uo2vj4kWtIXhPJm27RWbuyW7N51mQkz8wCBNI2Ih9qh8E8IUMyfm8qM7GTGjulCxk1xIAX+iiBLHvuSX71RBEgWLejGiz8bQEysjNS8lVDe7NZxGaZk69ZLzJx3BHA7gruQZvRuWZO30ZoX3DY1kR8s6M5vN1zkv3KuIE0T2woyfFgndm8ZTufORsTruXUIuwRHj1aQOW4/4Gb+33Vl3l1dWbDkDOUlXrRLdoGQSFd0j7YtgDB5/QLDZPd9mEl8x+jWccsJC6isDNGx535HMKBjHOryGLAVF8742PeJlzUvnefAQa8zyAQk0ox+OtuyyPp2Anu3ZhITJ6N1Wq2QBhiCjZu+BvxIU2oTvual/OsABGx69Ihh7pxu7N+ZReHxsWx8YwjTp3YGgtiWH9uyHS02DdsKMGt6EvtymkcWWqphAVZA4U7ZB6gab2xbFuue7cPSH98Efrt2fUkBBmDD2bPVHPj0Ku9vucTGD0r1RVwgDWQ9vs62/DywsCcvPNe/2WShpYSloKjIR/rg3UgzvlY4Gwj5yH0/k+zJydqOQjckFQ55ZSmKzvv5+GAZ2/5Yyhtve0FSS1qBHfSx4tHePLGsD9Ilmk0WWsGkq332Nx8qARHLtLuPsvgnJ8k7Wk5lZQhipM6nBVpoSyEEpKfHMm9ed159fjD/9kh3sHVcDpNd9VQ/Vizrox1eC8hCSzXslpQW++naZ1cdDYehNR0Eggwa0Jm7ZyUxZ3YKA/p1JKaTAcHrMyrBf6z9M8t/WoBwufU7Cfp49sm+LFtyE0LSKjl38wgLINZgz87LzLzvJOVX/CCMBkOOTicVOjYHwYxj+ZJuzLszlWFDOoIULFtxmlW/OAtGDEKAClbz9ON9efwnNwOtV2BET1gAQvDc2jM89uQpwM2orM4cPHQNnV01nrR9gzwmw4Z1Ii/vKrhMnSoHA6xZ2YeHlvYGy27Vaio6wgKUDY8/k8/KNQVADMmpMRTljWLfQS+T7zgMmOAykBEkq7XkVU1GZlshFt2fyqsvDaqtnuzW03B0TssQrH/lHCvXFCDNOCDEk4/0JKazwaQpyXxx4G+YNb0LBH3YVhDbalxKIUCaok76KU2D135bjOi4i3Xrz/DZ4XL8fhtMoR1eCxG5hqXgwgUfPQd+jE7xBLblZ8s7w5g5sytYSgsUUhw6Us47HxTz8xcuAdXozMpo0tyvh35ZQcACOrHm33twx+0p9OmtCwlCzVN55BqWsP/gVSB0neAu3vx9sc4ZBFoIAVlZCax+dgCl+aPZtSWL5Q/3BBS2FUBFKKfWvOl4/yAP/2sBfTP38cOHTnLmTLXWeDMQOWEhKDzvQ6dKDlwG775Xws/WncGylBYiTNyySUo2mTAhkZVPfItr57/L268ORgWDNaSVciqjpoR0yCNjefn1Ynrfspc/vFdcG9OjQFRr2G3WDYZSAIbJoysKGD/zCB9uLaGkxNIJhkvoW4Na67YNm/77EiARQhNVwQDYFrZVrdd8E+SlAdJ0ATHMXXiMNzdcJCLv2CzCtmLEsE6EuxM1D5AgXCb7P7nGjHl5pPTdw+w5eeR+VEpZWQjiDa6VB5kxL4+Nmy475Z0Cu4rc94ajyiZxYPtolj+cDnZVLflGHJ5eUnEsePAYJ05ci8qZRe60BPj9iomzDrP/4LUGuxm68gmhnY3NrWNTOXfBx58LfEjT0Fmj8rEnZyRjJ3h0cSGFtgi/zeG8CjZ9WMLTqwrRzsFsuEVkBXl0aQ+ee6a/tqRWJQzgEhw5XM6I8YfQXrdpA7Et7dFqK6kAW969hZm3p9Su93C8FdSQr/IG+f3mYr73z6ed8d+cS1uBSdnZLBISXBHF6ujicFCRmZXA0b0jGTgwHtvyYVt2o55X18i1GhIuN7PmHWP63UfYsOECRUU+rIACU+rAHFLgt4nvIFm4MI2vjoyiX79Y58XdACEAH0HHT0SC5uXSLkFVRYhtO0p58dXz7NxdQriNI1zaKTUGnWGF2zYhZt6WwozsJGZkJ5OeHlereQBTkH+6ir6ZB9FdktqH695XgJL8cSQnuyOqpJpfLQnAJfBX2hQWVfM/e71s2XaZLTlXES7RJOkaoRVQQ97mwX9I45ElvejzrQ4QcLTqlryw/ixLln2lw1N4rKUAF2VnR0Zs0q3S00IKiJV88icvY6YcrWnWaYEsIu1eao1pre/YPIJJU5I0aUNw6uQ1Bow6AK6YmkhkWyF+9I+pPL9qIJFmNC3vaSlACo7sL2PMlMOAcMiGQJhsfnsISalx2FZVbQ+rgXhbG2fdTJ59iPwvK3XIUZCQYAIxN3hjiwnjEvVqihAtJ+yW7PnTZUaM3084X7atEOCm7EwWd8zuRmnBaM6dGM+mt4bSIz0e7OpGyet1arLul4U6XAGGFFzvmWzLJqNXJ7InJkUckqClhE3Jju2l3Hr7pyDiHbI2N98cT0XRKBI8pjbJgE1aWiyz70jl/OnRnP38Vj54cyhDh8SDHajfA2OweZuXqyWW3n2sDgEBEMKx3gBrnu5NR48ZVenYfMJuSU5OCVPuPARGvDZjG8Bm1+ahdOxiOs0C535baU1Uh8jIiOXOO1M5tmcke7Z9m8Rkd72kzxVaVFaFwBCczq8CbKQLVNDih99P4+6ZKbpBEAWaR9iU5OaUcPvczxCueN20w2neYdBr6AEef/JLPv30qm7euUTdRN9p4CEUY8d5OLJrOEhXPemk0M8MKH756yJAb7GMyOzE6qf7IZz1HQ2i7nhgCDZtvsRd9x0BGV9/DzkIqCAQID2jC4sXpXDXjBR6ZcTh7nBj8w5wS379ehGLFp9Emm79DEuRkWHyxf5RbNtRypz7j6MrNZPS/FEkdTWbVRNHlUuD4N33irln0ec0tg16PbSp6l3BKROT+Pu/TWXK+EQyesXVtmuFIP+rSvqO2Od0UvS4RQsSWfLgTQwbewiAhMRYvjwwgpTuN3rryBEZYSfWrv/PQn706EkgLup9Id2yrd0RnDEtkcUPpJGV2ZnktFjOna4kY8jHYLiRUmt49Mh4LEtx+OhVBg1KYM/W4SQmNU+zNVSaJOyY8VPPFvDEynyQsY45+tEuwAWGrFnHkaB2R9ACJP+0qAfjv5PAPYtOIlyumixNr+lqvn9fOi+u7k9svNEishChhh97Kp/n1hYgXHHOcQXJ3m23cLHYx/1Lz1B9tQK9voxmkFdo8iHdgK8hawM+Xnl+MD+4P63W/FuIxnMUAb5qm/yCKsCFCgZJSonjxN5MUnvGglLMmdud48cq2L7zMq+9VcyJL8qxQy4ibdrpe5yX5cC29F7w3m2j+e44jw490UWfhikpb7ZWWYMSCcq8FrfNPUZcrODd1wZ/02kYOuz4r4U4dbqSd94v5hevlFBVUYl+p5GR19r2seCenvz8mX507RYTdZxtAkoob/Z5oEejtxmC0ksBDEPgacxpXFfAl10KcPJ0JR9svcSqdRfQ69VsZDtU70S8+avBzJ/TDRE+0NK6KBLKm/0hML3JW8MKiuYclZMYlJYE+OxoOVs/KuWFlwvRBmXq/lYIsH1Mm5zMS6v7c3O/DrpcbJvDarlCebOXAyvb5PFhOKfxCCouX7HYtfcKz798kT0fXwLg9ReHMH9Od9xxsi20ej2WCeWdmgHibFvOUgfhUwCWorDIR7XPpv/ADtontPkRRNnDOU2bvR2Y0tbT1YGzCwm0SriJAIeE56OR4dO0D7XHjHUQ3hVsH7IgxGJwwpHwbD+OYk37zPwXgBDrRBf90ccN3zxM2wnqr+kTAEDsEJ7cmuV6Q8IRmgZiR3uL1IbYBaE6Ibfe9Mf5/uHH7SJS22GN8Hz0LzdebOxDrdHOpwFZbSpW6+OPIB4Sntzj9f3ZZIKrvLd1B3sBMAkYBKRFMq6doICLQB6IPSDfEp6cwsYG/B9N1rbFqj5FHQAAAABJRU5ErkJggg==",downloadUrl:"https://chromewebstore.google.com/detail/solflare-wallet/bhhhlbepdkbapadjdnnojkbgioiodbic"} - ,[t.WalletNames.Trust]:{ - icon:"data:image/png; - base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAABHNCSVQICAgIfAhkiAAABoNJREFUaIHtml1oHNcVx3937ux6tZJqtxLpFyVJwTVWDMUmpY0TSu3QQnFtmjZpmvah0Le+FAp1HKW0FBq/+LWlT3FLW2L3w7SVS6B5aF0IOMQUSkDSJowX6yUga0aW7d0d7cedOX2YWe1qLY3WO+NIgv3DZb7vOb97ztz5uBeGGmqooYYaasdIpa1gfn7+mWKxeKJQKBy1bfuAUsrKwrG2RKRljFnwff8t3/cvHTp06B9Z1t+vlOM45zzPM41GQz4oNRoN8TxPyuXyNJBpw26qUql0bGlpyTXGfGCgvTLGiOu6K6VS6fgDhXUc53SlUtk20F5VKhVxHOfMg4J9sVarbTfjParVauI4zulMYUul0vGdFNleVSoVKZVKx7LitVzXXcnSwWVX5K7Us6xSXNf1yOCpQ7lcns6ig1r2RK78W+SF50VA5AvyivzEzMib5j2phs3U9RtjxHGcc1vxbNkinufJxMTEQI21sgJvXYWzv4Crb68/dqz5S+omzx27Tkk1+T6f4rvqszxufZpxtWcge8vLy8Hk5KSddE4i8Ozs7Mn9+/dfzufzfRkMQ/A8uHYNfnse/vr3zjG7y1gLeHLl92ByWLbB0obAbrGiVylbhh+oh/maOsgR9Sh7VbHvPG02m5TL5W9MTU39bbNzElujWCw+uxWsacHNJfjPFfjLn2Gm6z0ol3BdvTYGxkbbBksHaNvwEV1kUhvetm/xhv0vlq2A59Un+LI6wGH1MB9T+9AJ+Pl8nmKxeAIYDHh0dPSJpOPvvAMvnYF/vtHZp+nvFaheG0cZC20HWNpg2QFamzjiBSZ0kUnb8F/7Llf0m9y2rnDCeogfWl/ioPrkpvUWCoWjSXYTgbXWjyQdf//9CLY7XfuRAhrVMVSgukB7weOlNuy1i3zYNlzSd3huz20O2psD27Z9IMl28g2uVFJWYlkdgPuRRRRhKxQsHayDa4N3Im/QOsDSAaHWYOUSvd7q4yUR+EFJAY3aGCqUdXDrIt3e35XqtyyNjNgwMrjtbQEGqFfHsCRE6wClTdR59YBrHaz14pYdgMoh+xKTbkttW4TrtXF0GAOtpW13Spu1dG9vo3JIK53L2xbhVm0PRgSlw3Vp2x3VznoEjcojZhdGGECtAqIQSxNoTaBzKDtc14npLljLDkBasFuBWQUJQWmih7dWiG7Dg9Ft+E4HhrSQ1m4F9kEJMWxURHcaQLRFoC0CqxN5QoOYXXoP48fLLmBlxR5ZrGsEYniCHASSymwqYElhW1bvjfBGRXVvt4Ag3SdvKuBiiheAjSK8ltLWBvs00IA9g305rikV8GOHoqVw/6+Xqhu4J403irBo4A48tvlrdF9K9W93chIePwxmgGvFB1bjEq+r1Xv3rZUKPPkoPDSWxuMMfmb/9OcDXtgL5ceNsEFD4AMu/OiptN5m0Es//XS0bJH8wd8rVY9XulJZbdJxSXy/fOVzab3NIMKjo3DxwgAXNrpKnfXp21sW4Dffg/E0nWSsTMZnvv4MTH0minK/Ug2gGS1VM1rfCF5uweGD8O2vZuFpRsCFAvzhYrTeN3QjTusmUI8boKdIDbgG51+Gkf7+I26pzEbgjhyBC69F62Ef57cj2440jXhfXKQO/A/+NAOHp7LyMuMhxxe+A9MvQUD0bE5Sd0TXQNup3QTm4eWz8K1TWXq4hTzPC+53BCAMRV78cTS6YCOS26TY4yL2h0TsfSL2hIieFLE/KqI/Hl17+mci4QAjEJ7nNQcGXlxcnB/ApoiInH0lcpzNoPMiuYKIXRSxxyJ4xqLzz54b1KrI4uKiMzDwwsLCq4ObFrk8kwCtRHKWSE6L5HKd82Yup7EocuPGjd8lMSXew77vv95sDp4hJ0/Bu+/C0c9HvXd3D64AQmgF0GrBF5+CchlOnRzYHM1mE9/3Lw1eA+B5Xuqhw1ZL5I8XO1HsLRdei+79tPI8L93HMoDjOOeyms9x947Ir3/VAT3/qojvZ1K1GGPk+vXr06mBAbW0tORl41Yk3xe5fTvLGkVc112hj8dsP89hcV33uWq1mr7pYo2MwN69mVVHtVrl5s2b36S/d57+5DjO6R08qeWBzeQ5s5Mmt8TTlrKdwdOr2dnZ467rruyAiWne3NxcZjN3tpLlOM6053myDVMPTTx5ZaDfl6mn+czNzZ0cGRl5dnR09Amt9SNbjSnfr0QkNMa8V6/Xr/q+/3rS/I2hhhpqqKGG2mX6P5N27g+5ExmzAAAAAElFTkSuQmCC",downloadUrl:"https://chromewebstore.google.com/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph"} - } - } - (YTt),function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),s(zEt,t),s(XEt,t),s(hAt,t),s(aAt,t),s(YTt,t)} - (KEt); - var qTt={ - } - ,XTt={ - } - ,JTt={ - } - ,QTt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(JTt,"__esModule",{ - value:!0} - ),JTt.WsConnector=void 0; - const ZTt=dbt(),tCt=ubt(),iCt=class{ - constructor(){ - this.disconnectListener=[],this.walletName="",this.walletNameKey="",this.enable=!0,this.icon="",this.pendingRequests=new Map,(0,tCt.getDefaultReporter)().beginReport()} - setOpenWalletCalled(t){ - this.openWalletCalledListener=t} - setAccountChangeListener(t){ - this.accountChangeListener=t} - setConnectionManager(t){ - this.connectionManager=t} - addConnectionListener(){ - var t; - null===(t=this.connectionManager)||void 0===t||t.addListener("sdk_response",(t,i)=>{ - var s=(0,ZTt.safeJsonParse)(i); - (0,tCt.logDebug)(`Engine ==>> addListener ==> success ==> ${ - s} - `),this.handleResponse(t,s)} - ,function(){ - } - )} - addDisconnectListener(t){ - this.disconnectListener.push(t)} - connectManagerDisconnect(){ - return QTt(this,arguments,void 0,function*(t=!1){ - var i; - yield null===(i=this.connectionManager)||void 0===i?void 0:i.disconnect(t)} - )} - openWallet(t,i){ - var s; - null===(s=this.openWalletCalledListener)||void 0===s||s.call(this,this)} - bindRequestForPromise(t,i){ - this.pendingRequests.set(t,i)} - send(t,i,s){ - return QTt(this,void 0,void 0,function*(){ - var e,n; - try{ - delete t.injectParams} - catch(frt){ - } - (0,tCt.logDebug)("Engine ==>> send request==>",JSON.stringify(t)); - const h=this.getRequestId(); - try{ - let r=yield null===(e=this.connectionManager)||void 0===e?void 0:e.send(JSON.stringify(Object.assign(Object.assign({ - } - ,t),{ - requestId:h} - )),s); - r&&(null===(n=this.connectionManager)||void 0===n||n.events.once(r.toString(),t=>{ - var s; - (0,tCt.logDebug)(`Engine ==> send => onAck => ${ - (0,ZTt.safeJsonStringify)(t)} - `),t&&t.result&&(null===(s=i.onAck)||void 0===s||s.call(i))} - )),i.resolve&&this.bindRequestForPromise(h,i.resolve)} - catch(frt){ - return Promise.reject(frt)} - } - )} - restoreconnect(t,i){ - return QTt(this,void 0,void 0,function*(){ - var s; - yield null===(s=this.connectionManager)||void 0===s?void 0:s.restoreConnect(t.topic),i(t)} - )} - restoreconnectFromTopic(t){ - return QTt(this,void 0,void 0,function*(){ - var i; - yield null===(i=this.connectionManager)||void 0===i?void 0:i.restoreConnect(t)} - )} - getRequestId(){ - const t=Date.now().toString(); - return(0,tCt.logDebug)("Engine ==>> getRequestId ==>",t),t} - handleResponse(t,i){ - if((0,tCt.logDebug)(`Engine ==>> handleResponse_1 ======>response: ${ - (0,ZTt.safeJsonStringify)(i)} - `,t),"requestId"in i){ - (0,tCt.logDebug)("Engine ==>> handleResponse_2 ===> in response"); - let t=i.requestId; - const s=this.pendingRequests.get(t); - s?((0,tCt.logDebug)("Engine ==>> handleResponse_3 ===> find resolve:",s),s(i),this.pendingRequests.delete(t)):((0,tCt.logDebug)("Engine ==>> handleResponse_3 ===> not find resolve:"),"disconnect"===i.method&&(this.disconnectListener.forEach(t=>t()),this.disconnectListener=[],this.clearData()))} - } - getCurrentConnectionReady(){ - var t; - return!!(null===(t=this.connectionManager)||void 0===t?void 0:t.getCurrentConnectionReady())} - saveSessionContent(t,i){ - var s; - null===(s=this.connectionManager)||void 0===s||s.saveSessionContent(t,i)} - getSessionContent(t){ - var i; - return null===(i=this.connectionManager)||void 0===i?void 0:i.getSessionContent(t)} - setOnConnectResultListener(t){ - this.connectResultListener=t} - getTag(){ - return""} - toJSON(){ - return"ws-connector"} - clearData(){ - this.pendingRequests.clear()} - } - ; - Qt(iCt,"WsConnector"); - let sCt=iCt; - JTt.WsConnector=sCt,Object.defineProperty(XTt,"__esModule",{ - value:!0} - ),XTt.OKXAppConnector=void 0; - const eCt=OEt,nCt=rbt(),hCt=j_t,rCt=U_t,oCt=JTt,aCt=class extends oCt.WsConnector{ - getType(){ - return eCt.CONNECTOR_TYPE.WS.OKX_APP_WALLET} - constructor(){ - super(),this.walletName="OKX App",this.walletNameKey=""} - getTag(){ - return eCt.OKX_APP_WALLET} - openWallet(t,i){ - super.openWallet(t); - let s=null!=i?i:rCt.OpenAppLinkType.UniversalLink; - if(t&&t.connectRequest||!(0,nCt.isOS)("android")){ - (0,nCt.logDebug)(`appwallet-connector openwallet before useSHortLink engineConnectInfo.connectRequest JSON ${ - JSON.stringify(t)} - `); - let i=null==t?void 0:t.connectRequest,{ - universalLink:e,deepLink:n} - =(0,nCt.getOKXLink)(i,rCt.ConnectWalletType.OKX_APP); - (0,nCt.openOKXDeeplinkWithFallback)(n,e,s)} - else(0,nCt.openDeeplinkWithFallback)(hCt.okxAppStackDeepLink,()=>{ - } - )} - } - ; - Qt(aCt,"OKXAppConnector"); - let cCt=aCt; - XTt.OKXAppConnector=cCt; - var lCt={ - } - ,uCt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(lCt,"__esModule",{ - value:!0} - ),lCt.InjectConnector=void 0; - const dCt=U_t,fCt=rbt(),pCt=OEt,wCt=class{ - constructor(){ - this.disconnectListener=[],this.providerMap=new Map,this.disconnectHandler=null,this.walletName="",this.icon="",this.walletNameKey="",this.enable=!0} - setAccountChangeListener(t){ - (0,fCt.logDebug)("setAccountChangeListener: inject",t),this.accountChangeListener=t} - setConnectionManager(t){ - this.connectionManager=t} - getInjectProvider(t){ - if(t)for(const[i,s]of this.providerMap.entries())if(t.includes(i))return s} - send(t,i){ - return uCt(this,void 0,void 0,function*(){ - var s; - try{ - (0,fCt.logDebug)("InjectEngine send > request:",(0,fCt.safeJsonStringify)(t)); - let e=t; - if("disconnect"===e.method)return yield this.disconnect(),this.disconnectListener.forEach(t=>t()),this.disconnectListener=[],void(null===(s=i.onAck)||void 0===s||s.call(i)); - yield this.checkWalletMatch(); - const n=this.getInjectProvider((0,fCt.getNamespaceKeyByChain)(e.chainId)); - if(n)return void n.send(e).then(t=>{ - var s; - (0,fCt.logDebug)("InjectEngine ==>> send > result:",t),null===(s=i.resolve)||void 0===s||s.call(i,t)} - ).catch(s=>{ - var e; - let n=dCt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,h=""; - s&&(n=s.code,h=s.message),4001===n&&(n=dCt.OKX_CONNECT_ERROR_CODES.USER_REJECTS_ERROR); - let r={ - requestId:Date.now().toString(),method:t.method,error:{ - code:n,message:h} - } - ; - (0,fCt.logDebug)("InjectEngine ==>> send > errorResponse:",JSON.stringify(r)),null===(e=i.resolve)||void 0===e||e.call(i,r)} - ); - throw new dCt.OKXConnectError(dCt.OKX_CONNECT_ERROR_CODES.CHAIN_NOT_SUPPORTED)} - catch(e){ - return(0,fCt.logDebug)("InjectEngine ==>> send ===> error:",e),Promise.reject(e)} - } - )} - checkWalletMatch(){ - return uCt(this,void 0,void 0,function*(){ - return new Promise((t,i)=>{ - var s; - let e=null===(s=this.connectionManager)||void 0===s?void 0:s.getSessionContent("connectSession"); - e||i(new dCt.OKXConnectError(dCt.OKX_CONNECT_ERROR_CODES.WALLET_NOT_SUPPORTED)),this.restoreconnect(e,s=>{ - s?t():i(new dCt.OKXConnectError(dCt.OKX_CONNECT_ERROR_CODES.WALLET_NOT_SUPPORTED))} - )} - )} - )} - clearData(){ - this.connectResultListener=void 0} - addDisconnectListener(t){ - this.disconnectListener.push(t)} - setOnConnectResultListener(t){ - this.connectResultListener=t} - connectManagerDisconnect(){ - return uCt(this,arguments,void 0,function*(t=!1){ - } - )} - getCurrentConnectionReady(t){ - return!!t} - getTag(){ - return pCt.OKX_INJECT_WALLET} - toJSON(){ - return"inject-connector"} - getSupportNameSpaces(){ - return Array.from(this.providerMap.keys())} - } - ; - Qt(wCt,"InjectConnector"); - let gCt=wCt; - lCt.InjectConnector=gCt; - var mCt={ - } - ; - Object.defineProperty(mCt,"__esModule",{ - value:!0} - ),mCt.TgwalletConnector=void 0; - const vCt=JTt,_Ct=OEt,MCt=U_t,bCt=rbt(),yCt=class extends vCt.WsConnector{ - getType(){ - return _Ct.CONNECTOR_TYPE.WS.OKX_TG_WALLET} - constructor(){ - super(),this.walletName="OKX Mini Wallet",this.walletNameKey=""} - getTag(){ - return _Ct.OKX_TG_WALLET} - openWallet(t,i){ - var s; - super.openWallet(t); - var e=(0,bCt.getOKXLink)(null==t?void 0:t.connectRequest,MCt.ConnectWalletType.OKX_MINI,null!==(s=null==t?void 0:t.tmaReturnUrl)&&void 0!==s?s:"back"); - (0,bCt.openOKXTMAWalletlinkWithFallback)(e.universalLink)} - } - ; - Qt(yCt,"TgwalletConnector"); - let ECt=yCt; - mCt.TgwalletConnector=ECt; - var ACt={ - } - ,SCt={ - } - ; - function TCt(t){ - if(t.length>=255)throw new TypeError("Alphabet too long"); - for(var i=new Uint8Array(256),s=0; - s<i.length; - s++)i[s]=255; - for(var e=0; - e<t.length; - e++){ - var n=t.charAt(e),h=n.charCodeAt(0); - if(255!==i[h])throw new TypeError(n+" is ambiguous"); - i[h]=e} - var r=t.length,o=t.charAt(0),a=Math.log(r)/Math.log(256),c=Math.log(256)/Math.log(r); - function l(i){ - if(i instanceof Uint8Array||(ArrayBuffer.isView(i)?i=new Uint8Array(i.buffer,i.byteOffset,i.byteLength):Array.isArray(i)&&(i=Uint8Array.from(i))),!(i instanceof Uint8Array))throw new TypeError("Expected Uint8Array"); - if(0===i.length)return""; - for(var s=0,e=0,n=0,h=i.length; - n!==h&&0===i[n]; - )n++,s++; - for(var a=(h-n)*c+1>>>0,l=new Uint8Array(a); - n!==h; - ){ - for(var u=i[n],d=0,f=a-1; - (0!==u||d<e)&&-1!==f; - f--,d++)u+=256*l[f]>>>0,l[f]=u%r>>>0,u=u/r>>>0; - if(0!==u)throw new Error("Non-zero carry"); - e=d,n++} - for(var p=a-e; - p!==a&&0===l[p]; - )p++; - for(var w=o.repeat(s); - p<a; - ++p)w+=t.charAt(l[p]); - return w} - function u(t){ - if("string"!=typeof t)throw new TypeError("Expected String"); - if(0===t.length)return new Uint8Array; - for(var s=0,e=0,n=0; - t[s]===o; - )e++,s++; - for(var h=(t.length-s)*a+1>>>0,c=new Uint8Array(h); - t[s]; - ){ - var l=t.charCodeAt(s); - if(l>255)return; - var u=i[l]; - if(255===u)return; - for(var d=0,f=h-1; - (0!==u||d<n)&&-1!==f; - f--,d++)u+=r*c[f]>>>0,c[f]=u%256>>>0,u=u/256>>>0; - if(0!==u)throw new Error("Non-zero carry"); - n=d,s++} - for(var p=h-n; - p!==h&&0===c[p]; - )p++; - for(var w=new Uint8Array(e+(h-p)),g=e; - p!==h; - )w[g++]=c[p++]; - return w} - function d(t){ - var i=u(t); - if(i)return i; - throw new Error("Non-base"+r+" character")} - return Qt(l,"encode"),Qt(u,"decodeUnsafe"),Qt(d,"decode"),{ - encode:l,decodeUnsafe:u,decode:d} - } - Qt(TCt,"base$1"); - var CCt=TCt("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),OCt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ,ICt=pi&&pi.__importDefault||function(t){ - return t&&t.__esModule?t:{ - default:t} - } - ; - Object.defineProperty(SCt,"__esModule",{ - value:!0} - ),SCt.SolProvider=void 0; - const kCt=U_t,xCt=rbt(),RCt=ICt(CCt),PCt=QEt,NCt=zEt,LCt=class{ - constructor(){ - this.accountChangedSolanaPublicKeyHandler=null} - send(t){ - return OCt(this,void 0,void 0,function*(){ - var i; - try{ - yield this.restoreConnect(),(0,xCt.logDebug)("SolProvider send request:",JSON.stringify(t)); - const n=t.method; - let h; - if(t.injectParams){ - switch(n){ - case"solana_signMessage":if(t.injectParams&&"object"==typeof t.injectParams&&"message"in t.injectParams){ - var s=null===(i=t.injectParams)||void 0===i?void 0:i.message; - const e=(new TextEncoder).encode(s),n=yield window.okxwallet.solana.signMessage(e,"utf8"); - return h={ - method:t.method,result:RCt.default.encode(n.signature)} - ,(0,xCt.logDebug)("SolProvider send result:",JSON.stringify(n)),h} - throw new kCt.OKXConnectError(kCt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`param is error method: '${ - n} - '`); - case"solana_signTransaction":if(t.injectParams&&"transaction"in t.injectParams){ - let i=yield window.okxwallet.solana.signTransaction(t.injectParams.transaction); - return(0,xCt.logDebug)("SolProvider send bufferResult:",JSON.stringify(i)),h={ - method:t.method,injectResult:i} - ,(0,xCt.logDebug)("SolProvider send result:",(0,xCt.safeJsonStringify)(h)),h} - break; - case"solana_signAllTransactions":if(t.injectParams&&"transactions"in t.injectParams){ - let i=yield window.okxwallet.solana.signAllTransactions(t.injectParams.transactions); - return(0,xCt.logDebug)("SolProvider send result:",(0,xCt.safeJsonStringify)(i)),h={ - method:t.method,injectResult:i} - ,h} - break; - case"solana_signAndSendTransaction":if(t.injectParams&&"transaction"in t.injectParams){ - var e=yield window.okxwallet.solana.signAndSendTransaction(t.injectParams.transaction); - return(0,xCt.logDebug)("SolProvider send result:",(0,xCt.safeJsonStringify)(e)),h={ - method:t.method,injectResult:e} - ,h} - break; - default:throw new kCt.OKXConnectError(kCt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED,`method: '${ - n} - '`)} - throw new kCt.OKXConnectError(kCt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED,`method: '${ - n} - '`)} - throw new kCt.OKXConnectError(kCt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`param is error method: '${ - n} - '`)} - catch(n){ - throw(0,xCt.logDebug)("SolProvider send error:",n),n} - } - )} - disconnect(){ - } - restoreConnect(){ - return(0,PCt.isDevice)("mobile")?this.connect():Promise.resolve()} - parseConnectResponse(t,i,s,e,n,h){ - return OCt(this,void 0,void 0,function*(){ - let t=[]; - e.forEach(i=>{ - i.namespace===kCt.NameSpaceKeySOL&&t.push(...i.chains)} - ); - let i=[],s={ - } - ,h={ - } - ; - if(t.forEach(t=>{ - let e=n.address.find(i=>"501"===i.chainId&&501===i.coinType||i.namespaceChainId===t); - e&&(i.push(t+":"+e.address),s[t]=h&&"publicKey"in h?h:{ - publicKey:e.publicKey} - )} - ),i&&i.length>0){ - let t={ - namespace:kCt.NameSpaceKeySOL,addresses:i,methods:[...NCt.SOLANAMethods],extra:s} - ; - return(0,xCt.logDebug)("parseConnectResponse nameSpaceResponse :",JSON.stringify(t)),t} - } - )} - connect(){ - return OCt(this,void 0,void 0,function*(){ - return window.okxwallet.solana.connect()} - )} - singleConnect(){ - return this.connect()} - addAccountChangedListener(t){ - this.accountChangedSolanaPublicKeyHandler=i=>{ - i&&t()} - ,window.okxwallet.solana.on("accountChanged",this.accountChangedSolanaPublicKeyHandler)} - removeListener(){ - this.accountChangedSolanaPublicKeyHandler&&window.okxwallet.solana.removeListener("accountChanged",this.accountChangedSolanaPublicKeyHandler)} - } - ; - Qt(LCt,"SolProvider"); - let DCt=LCt; - SCt.SolProvider=DCt; - var GCt={ - } - ,BCt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(GCt,"__esModule",{ - value:!0} - ),GCt.AptosProvider=void 0; - const UCt=U_t,FCt=rbt(),$Ct=zEt,HCt=QEt,WCt=Object.freeze(["637","70000060","70000066"]),VCt=new Map; - VCt.set("aptos:637","Mainnet"),VCt.set("aptos:70000060","Movement Testnet"),VCt.set("aptos:70000066","Movement Mainnet"); - let jCt=(Qt(Ot=class{ - send(t){ - return BCt(this,void 0,void 0,function*(){ - try{ - (0,FCt.logDebug)("AptosProvider send request:",(0,FCt.safeJsonStringify)(t)),yield this.restoreConnect(); - let i=yield window.okxwallet.aptos.network(),s=this.searchChainIdToInjectChainName(t.chainId); - if((0,FCt.logDebug)("AptosProvider send network and searchNetwork:",i,"-----",s),!i||!s||i.toLowerCase()!==s.toLowerCase())throw new UCt.OKXConnectError(UCt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Please switch your wallet link to '${ - s} - '`); - const e=t.method; - let n; - switch(e){ - case"aptos_signMessage":if(t.injectParams){ - let i=yield window.okxwallet.aptos.signMessage(t.injectParams); - return n={ - method:t.method,result:i.signature,injectResult:i} - ,(0,FCt.logDebug)("AptosProvider send result:",(0,FCt.safeJsonStringify)(n)),n} - throw new UCt.OKXConnectError(UCt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`param is error method: '${ - e} - '`); - case"aptos_signTransaction":{ - (0,FCt.logDebug)("AptosProvider Method>>>> :",e); - let i=yield window.okxwallet.aptos.signTransaction(t.params); - return n={ - method:t.method,result:i} - ,(0,FCt.logDebug)("AptosProvider send result:",(0,FCt.safeJsonStringify)(n)),n} - case"aptos_signAndSubmitTransaction":{ - (0,FCt.logDebug)("AptosProvider Method>>>> :",e); - let i=yield window.okxwallet.aptos.signAndSubmitTransaction(t.params); - return n={ - method:t.method,result:i.hash} - ,(0,FCt.logDebug)("AptosProvider send result:",(0,FCt.safeJsonStringify)(n)),n} - default:throw new UCt.OKXConnectError(UCt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED,` method: '${ - e} - '`)} - } - catch(i){ - throw(0,FCt.logDebug)("AptosProvider send error:",i),i} - } - )} - searchChainIdToInjectChainName(t){ - let i=t; - return VCt.forEach((s,e)=>{ - t.includes(e)&&(i=s)} - ),i} - disconnect(){ - } - restoreConnect(){ - return(0,HCt.isDevice)("mobile")?this.connect():Promise.resolve()} - parseConnectResponse(t,i,s,e,n,h){ - return BCt(this,void 0,void 0,function*(){ - let t=[]; - e.forEach(i=>{ - i.namespace===UCt.NameSpaceKeyAptos&&t.push(...i.chains)} - ); - let i,s=[],h={ - } - ; - if((0,FCt.logDebug)("AptosProvider parseConnectResponse connectChain",JSON.stringify(t)),!(0,HCt.isDevice)("mobile")&&t&&t.length>0){ - let t=yield window.okxwallet.aptos.connect(); - i=t.publicKey} - if(t.forEach(t=>{ - let e=n.address.find(i=>WCt.includes(i.chainId)&&637===i.coinType||i.namespaceChainId===t); - e&&(s.push(t+":"+e.address),h[t]={ - publicKey:e.publicKey?e.publicKey:i} - )} - ),(0,FCt.logDebug)("AptosProvider parseConnectResponse addresses",JSON.stringify(s)),s&&s.length>0)return{ - namespace:UCt.NameSpaceKeyAptos,addresses:s,methods:[...$Ct.AptosMethods],extra:h} - } - )} - connect(){ - return BCt(this,void 0,void 0,function*(){ - return window.okxwallet.aptos.connect()} - )} - singleConnect(){ - return this.connect()} - addAccountChangedListener(t){ - window.okxwallet.aptos.onAccountChange(i=>{ - i&&t()} - )} - removeListener(){ - } - } - ,"AptosProvider"),Ot); - GCt.AptosProvider=jCt; - var KCt={ - } - ,zCt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(KCt,"__esModule",{ - value:!0} - ),KCt.TONProvider=void 0; - const YCt=U_t,qCt=rbt(),XCt=QEt,JCt=zEt; - let QCt=(Qt(It=class{ - constructor(){ - this.signalChainConnectResult=void 0,this.accountChangedTONHandler=null} - send(t){ - return zCt(this,void 0,void 0,function*(){ - try{ - (0,qCt.logDebug)("TONProvider send request:",(0,qCt.safeJsonStringify)(t)); - let i=null; - if("ton_sendTransaction"!==t.method)throw new YCt.OKXConnectError(YCt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED); - if(t.params&&(i={ - method:"sendTransaction",params:[JSON.stringify(t.params)],id:Date.now().toString()} - ,(0,qCt.logDebug)("TONProvider tonParams first:",JSON.stringify(i))),i){ - const s=yield window.okxTonWallet.tonconnect.send(i); - if((0,qCt.logDebug)("TONProvider send request result:",(0,qCt.safeJsonStringify)(s)),s.error)throw new YCt.OKXConnectError(s.error.code,s.error.message); - return{ - result:s.result,method:t.method} - } - throw new YCt.OKXConnectError(YCt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED)} - catch(i){ - throw(0,qCt.logDebug)("TONProvider encountered an error:",i),i} - } - )} - restoreConnect(){ - return Promise.resolve()} - parseConnectResponse(t,i,s,e,n,h){ - return zCt(this,void 0,void 0,function*(){ - try{ - let r=[]; - e.forEach(t=>{ - t.namespace===YCt.NameSpaceKeyTON&&r.push(...t.chains)} - ); - let o=[],a={ - } - ; - if(r.forEach(t=>{ - (0,qCt.getChainId)(t); - let i=n.address.find(i=>"607"===i.chainId&&607===i.coinType||i.namespaceChainId===t); - i&&(o.push(t+":"+i.address),a[t]={ - publicKey:i.publicKey} - )} - ),(0,qCt.logDebug)("tonprovider parseConnectResponse needPop and addresses: ",t,JSON.stringify(o)),o&&o.length>0){ - let n,r=e.find(t=>t.namespace===YCt.NameSpaceKeyTON); - if((0,qCt.logDebug)("tonprovider parseConnectResponse ton: ",JSON.stringify(r)),!(r&&r.params&&h&&h.manifestUrl))throw new YCt.OKXConnectError(YCt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"manifestUrl is nil"); - { - this.dappInfo=h; - let s=[r.params.ton_addr],e={ - manifestUrl:h.manifestUrl,items:s} - ; - (t||i)&&r.params.ton_proof&&s.push(r.params.ton_proof),(0,qCt.logDebug)("parseConnectResponse ton connect params: ",JSON.stringify(e)),n=(0,XCt.isDevice)("mobile")||t||i?yield window.okxTonWallet.tonconnect.connect(2,e):yield window.okxTonWallet.tonconnect.restoreConnection()} - if(s&&this.signalChainConnectResult&&(n=this.signalChainConnectResult,this.signalChainConnectResult=void 0),(0,qCt.logDebug)("parseConnectResponse ton connect result: ",JSON.stringify(n)),n&&r){ - if("connect_error"===n.event)throw new YCt.OKXConnectError(n.payload.code,n.payload.message); - { - let t=n.payload.items.find(t=>"ton_addr"===t.name),i=n.payload.items.find(t=>"ton_proof"===t.name); - return(0,qCt.logDebug)("tonprovider connect isSignalChain: ",s),{ - namespace:YCt.NameSpaceKeyTON,addresses:o,methods:[...JCt.TONMethods],extra:a,data:{ - ton_addr:t,ton_proof:i,manifestUrl:h.manifestUrl} - } - } - } - } - return} - catch(r){ - throw(0,qCt.logDebug)("tonprovider parseConnectResponse error: ",JSON.stringify(r)),r} - } - )} - connect(t,i){ - return zCt(this,void 0,void 0,function*(){ - if(!(t&&i&&i.manifestUrl&&t.params))throw new YCt.OKXConnectError(YCt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"manifestUrl or params is nil"); - { - this.dappInfo=i; - let e=[t.params.ton_addr],n={ - manifestUrl:i.manifestUrl,items:e} - ; - t.params.ton_proof&&e.push(t.params.ton_proof),(0,qCt.logDebug)("tonprovider connect params: ",JSON.stringify(n)); - try{ - let t=yield window.okxTonWallet.tonconnect.connect(2,n); - return(0,qCt.logDebug)("tonprovider connect tonResult: ",JSON.stringify(t)),this.signalChainConnectResult=t,t} - catch(s){ - throw(0,qCt.logDebug)("tonprovider connect error: ",JSON.stringify(s)),new YCt.OKXConnectError(YCt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"tonconnect error")} - } - } - )} - singleConnect(t,i){ - return this.connect(t,i)} - addAccountChangedListener(t){ - this.accountChangedTONHandler=()=>{ - t()} - ,window.okxTonWallet.tonconnect.on("accountChanged",this.accountChangedTONHandler)} - removeListener(){ - this.accountChangedTONHandler&&window.okxTonWallet.tonconnect.off("accountChanged",this.accountChangedTONHandler)} - } - ,"TONProvider"),It); - KCt.TONProvider=QCt; - var ZCt={ - } - ,tOt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(ZCt,"__esModule",{ - value:!0} - ),ZCt.SuiProvider=void 0; - const iOt=U_t,sOt=rbt(),eOt=QEt,nOt=zEt; - let hOt=(kt=class{ - constructor(t=window.okxwallet.sui){ - this.accountChangedHandler=null,this.wallet=t} - getSuiPublicKey(){ - return tOt(this,void 0,void 0,function*(){ - return(yield this.connect()).accounts[0].publicKey} - )} - parseConnectResponse(t,i,s,e,n,h){ - return tOt(this,void 0,void 0,function*(){ - try{ - let t=[]; - e.forEach(i=>{ - i.namespace===iOt.NameSpaceKeySui&&t.push(...i.chains)} - ); - let i=[],s={ - } - ; - if(0==t.length)return; - const h=yield this.getSuiPublicKey(); - return t.forEach(t=>{ - var e; - (0,sOt.getChainId)(t); - let r=n.address.find(i=>784===i.coinType||i.namespaceChainId===t); - r&&(i.push(t+":"+r.address),s[t]={ - publicKey:null!==(e=r.publicKey)&&void 0!==e?e:h} - )} - ),i&&i.length>0?{ - namespace:iOt.NameSpaceKeySui,addresses:i,methods:[...nOt.SuiMethods],extra:s} - :void 0} - catch(t){ - throw t} - } - )} - restoreConnect(){ - return(0,eOt.isDevice)("mobile")?this.connect():Promise.resolve()} - getSuiWallet(){ - return this.wallet} - send(t){ - return tOt(this,void 0,void 0,function*(){ - try{ - yield this.restoreConnect(),(0,sOt.logDebug)("suiProvider send request:",JSON.stringify(t)); - const i=t.method; - let s; - if(t.injectParams&&this.getSuiWallet()){ - let e=t.injectParams; - switch(i){ - case"sui_signTransactionBlock":const t=yield this.getSuiWallet().features["sui:signTransactionBlock"].signTransactionBlock(e); - s={ - method:"sui_signTransactionBlock",result:null==t?void 0:t.signature} - ; - break; - case"sui_signAndExecuteTransactionBlock":s={ - method:"sui_signAndExecuteTransactionBlock",result:(yield this.getSuiWallet().features["sui:signAndExecuteTransactionBlock"].signAndExecuteTransactionBlock(e)).digest} - ; - break; - case"sui_signMessage":s={ - method:"sui_signMessage",result:(yield this.getSuiWallet().features["sui:signMessage"].signMessage(e)).signature} - ; - break; - case"sui_signPersonalMessage":s={ - method:"sui_signPersonalMessage",result:(yield this.getSuiWallet().features["sui:signPersonalMessage"].signPersonalMessage(e)).signature} - } - } - return s} - catch(frt){ - throw(0,sOt.logDebug)("suiProvider send error:",frt),frt} - } - )} - connect(){ - return tOt(this,void 0,void 0,function*(){ - var t; - return null===(t=this.getSuiWallet())||void 0===t?void 0:t.features["standard:connect"].connect()} - )} - singleConnect(){ - return this.connect()} - addStandardEventListener(t){ - var i,s; - (null===(i=this.getSuiWallet())||void 0===i?void 0:i.features["standard:events"])?((0,sOt.logDebug)("sui-provider standard:events change"),null===(s=this.getSuiWallet())||void 0===s||s.features["standard:events"].on("change",i=>{ - t(i)} - )):(0,sOt.logDebug)("sui-provider standard:events null")} - addAccountChangedListener(t){ - var i; - this.getSuiWallet().on&&(this.accountChangedHandler=i=>{ - i&&t()} - ,null===(i=this.getSuiWallet())||void 0===i||i.on("accountChanged",this.accountChangedHandler))} - removeListener(){ - var t; - this.accountChangedHandler&&(null===(t=this.getSuiWallet())||void 0===t||t.removeListener("accountChanged",this.accountChangedHandler))} - } - ,Qt(kt,"SuiProvider"),kt); - ZCt.SuiProvider=hOt; - var rOt={ - } - ,oOt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(rOt,"__esModule",{ - value:!0} - ),rOt.BtcProvider=void 0; - const aOt=U_t,cOt=rbt(),lOt=zEt,uOt=QEt; - let dOt=(Qt(xt=class{ - constructor(){ - this.accountChangedBtcHandler=null} - connect(){ - return window.okxwallet.unisat.connect()} - switchChain(t){ - return oOt(this,void 0,void 0,function*(){ - let i=window.okxwallet.unisat; - switch(t){ - case aOt.BTC_CHAINS.MAINNET:yield i.switchChain("BITCOIN_MAINNET"); - break; - case aOt.BTC_CHAINS.FRACTAL:yield i.switchChain("FRACTAL_BITCOIN_MAINNET")} - } - )} - parseConnectResponse(t,i,s,e,n){ - return oOt(this,void 0,void 0,function*(){ - try{ - let t=[]; - e.forEach(i=>{ - i.namespace===aOt.NameSpaceKeyBtc&&t.push(...i.chains)} - ); - let i=[],s={ - } - ; - if(0==t.length)return; - const h=Qt((t,i)=>t.find(t=>{ - const s="bitcoin"===t.name&&i===aOt.BTC_CHAINS.MAINNET||"fractalbitcoin"===t.name&&i===aOt.BTC_CHAINS.FRACTAL; - return 0===t.coinType&&s||t.namespaceChainId===i} - ),"findAddress"),r=Qt(t=>oOt(this,void 0,void 0,function*(){ - let e=h(n.address,t); - if(!e)return; - i.push(t+":"+e.address); - let r=yield this.connect(); - s[t]={ - publicKey:r.publicKey,compressedPublicKey:r.compressedPublicKey} - } - ),"processChain"),o=t.map(r); - return yield Promise.all(o),i&&i.length>0?{ - namespace:aOt.NameSpaceKeyBtc,addresses:i,methods:[...lOt.BtcMethods],extra:s} - :void 0} - catch(t){ - throw t} - } - )} - restoreConnect(){ - return oOt(this,void 0,void 0,function*(){ - return(0,uOt.isDevice)("mobile")?this.connect():Promise.resolve()} - )} - send(t){ - return oOt(this,void 0,void 0,function*(){ - try{ - (0,cOt.logDebug)("btcProvider send request:",JSON.stringify(t)); - const i=t.method,s=t.chainId; - if(yield this.restoreConnect(),yield this.switchChain(s),!t.params)throw new aOt.OKXConnectError(aOt.OKX_CONNECT_ERROR_CODES.BAD_REQUEST_ERROR,`param is error method: '${ - i} - '`); - switch(i){ - case"btc_signMessage":{ - const{ - signStr:i,type:s} - =t.params||{ - } - ,e=yield window.okxwallet.unisat.signMessage(i,s); - return{ - method:t.method,result:e} - } - case"btc_send":{ - const{ - from:i,to:s,value:e,satBytes:n} - =t.params||{ - } - ,h=yield window.okxwallet.unisat.send({ - from:i,to:s,value:e,satBytes:n} - ); - return{ - method:t.method,result:h} - } - case"btc_signPsbts":{ - const{ - psbtHexs:i,options:s} - =t.params||{ - } - ; - let e; - if(Array.isArray(i)&&1===i.length){ - let t; - t=Array.isArray(s)?yield window.okxwallet.unisat.signPsbt(i[0],s.length>0&&"object"==typeof s[0]?s[0]:void 0):yield window.okxwallet.unisat.signPsbt(i[0]),e=[t]} - else e=yield window.okxwallet.unisat.signPsbts(i,s); - return{ - method:t.method,result:(0,cOt.safeJsonStringify)(e)} - } - case"btc_signAndPushPsbt":{ - const{ - psbtHex:i,options:s} - =t.params||{ - } - ,e=yield window.okxwallet.unisat.signPsbt(i,s),n=yield window.okxwallet.unisat.pushPsbt(e); - return{ - method:t.method,result:(0,cOt.safeJsonStringify)({ - signedPsbt:e,txHash:n} - )} - } - case"btc_sendInscription":{ - const{ - address:i,inscriptionId:s,options:e} - =t.injectParams||{ - } - ,n=yield window.okxwallet.unisat.sendInscription(i,s,e); - return{ - method:t.method,result:n} - } - case"btc_inscribeTransfer":if(this.hasFunction("inscribeTransfer")){ - const{ - ticker:i,amount:s} - =t.params||{ - } - ,e=yield window.okxwallet.unisat.inscribeTransfer(i,s); - return{ - method:t.method,result:e} - } - case"btc_sendRunes":if(this.hasFunction("sendRunes")){ - const{ - address:i,runeid:s,amount:e,options:n} - =t.injectParams||{ - } - ,h=yield window.okxwallet.unisat.sendRunes(i,s,e,n); - return{ - method:t.method,result:h} - } - default:throw new aOt.OKXConnectError(aOt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED,`method: '${ - i} - ' not support`)} - } - catch(i){ - throw(0,cOt.logDebug)("BtcProvider send error:",i),i} - } - )} - hasFunction(t){ - return!(!window.okxwallet||!window.okxwallet.unisat||"function"!=typeof window.okxwallet.unisat[t])} - singleConnect(t){ - return oOt(this,void 0,void 0,function*(){ - return 1==t.chains.length&&this.connect()} - )} - addAccountChangedListener(t){ - this.accountChangedBtcHandler=i=>{ - i&&i.length>0&&t()} - ,window.okxwallet.unisat.on("accountsChanged",this.accountChangedBtcHandler)} - removeListener(){ - window.okxwallet.unisat.removeListener("accountsChanged",this.accountChangedBtcHandler)} - } - ,"BtcProvider"),xt); - rOt.BtcProvider=dOt; - var fOt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(ACt,"__esModule",{ - value:!0} - ),ACt.OkxwalletInjectConnector=void 0; - const pOt=lCt,wOt=U_t,gOt=KEt,mOt=SCt,vOt=GCt,_Ot=KCt,MOt=ZCt,bOt=rOt,yOt=rbt(),EOt=DMt,AOt=QEt,SOt=xEt,TOt=OEt,COt=class extends pOt.InjectConnector{ - getType(){ - return TOt.CONNECTOR_TYPE.INJECT.OKX_INJECT_WALLET} - constructor(){ - super(),this.walletName="OKX Wallet",this.walletNameKey="walletModal.mobileConnectionModal.connectInjected",this.providerMap.set(wOt.NameSpaceKeyEip155,new gOt.Eip155Provider),this.providerMap.set(wOt.NameSpaceKeySOL,new mOt.SolProvider),this.providerMap.set(wOt.NameSpaceKeyAptos,new vOt.AptosProvider),this.providerMap.set(wOt.NameSpaceKeyTON,new _Ot.TONProvider),this.providerMap.set(wOt.NameSpaceKeySui,new MOt.SuiProvider),this.providerMap.set(wOt.NameSpaceKeyBtc,new bOt.BtcProvider)} - openWallet(t,i){ - return fOt(this,void 0,void 0,function*(){ - var i,s,e; - if((0,yOt.logDebug)("InjectEngine connect begin:",JSON.stringify(t)),!t)throw new wOt.OKXConnectError(wOt.OKX_CONNECT_ERROR_CODES.BAD_REQUEST_ERROR); - this.dappInfo=t.connectRequest.dAppInfo; - var n=t.connectRequest; - try{ - if(!window||!window.okxwallet)throw new wOt.OKXConnectError(wOt.OKX_CONNECT_ERROR_CODES.BAD_REQUEST_ERROR); - if(n.requests){ - let t=n.requests.find(t=>"requestAccounts"===t.name),r=yield window.okxwallet.getVersion(),o={ - method:"connect",requestId:n.requestId,payload:{ - wallet:{ - platform:null!==(i=navigator.platform)&&void 0!==i?i:"/",appName:EOt.OKXInjectWalletName,appVersion:null!=r?r:"1.0.0",maxProtocolVersion:1} - ,responses:[]} - } - ,a={ - name:"requestAccounts",accounts:[]} - ; - o.payload.responses.push(a),yield this.disconnect(); - const c=null!==(s=t.requiredNamespaces)&&void 0!==s?s:[],l=null!==(e=t.optionalNamespaces)&&void 0!==e?e:[]; - let u=!0,d=!1; - if(c.length+l.length===1&&!(0,AOt.isDevice)("mobile")){ - const t=1===c.length?c[0]:l[0],i=this.getInjectProvider(t.namespace); - (yield null==i?void 0:i.singleConnect(t,this.dappInfo))&&(d=!0,u=!1)} - var h=yield this.getAccountByRequestWallets(u,!1,d,c,l); - if(!h)throw new wOt.OKXConnectError(wOt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"connect requestWallets is null"); - if(a.accounts.push(...h),0===a.accounts.length)throw new wOt.OKXConnectError(wOt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"connect connectAccounts is null"); - this.connectResultListener&&(this.disconnectHandler&&window.okxwallet.removeListener("disconnect",this.disconnectHandler),this.disconnectHandler=()=>{ - this.disconnectListener.forEach(t=>t()),this.disconnectListener=[]} - ,window.okxwallet.on("disconnect",this.disconnectHandler),this.connectResultListener(o,this))} - } - catch(o){ - var r=wOt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR; - o instanceof wOt.OKXConnectError&&(r=o.code,o.message),this.connectResultListener&&this.connectResultListener({ - requestId:"-1",method:"connect_error",payload:{ - code:r} - } - ,this)} - } - )} - checkAccountChanged(){ - return fOt(this,void 0,void 0,function*(){ - var t; - try{ - let i=null===(t=this.connectionManager)||void 0===t?void 0:t.getSessionContent("connectSession"); - if(!i)throw new wOt.OKXConnectError(wOt.OKX_CONNECT_ERROR_CODES.WALLET_NOT_SUPPORTED); - (0,yOt.logDebug)("inject-connector checkAccountChanged --sessionInfo:",JSON.stringify(i)); - let s=this.getRequireNameSpaceFromSession(i); - (0,yOt.logDebug)("inject-connector checkAccountChanged --requiredNamespaces:",JSON.stringify(s)); - let e=yield this.getAccountByRequestWallets(!1,!0,!1,s,[]); - if((0,yOt.logDebug)("inject-connector checkAccountChanged --accounts:",JSON.stringify(e)),!e)throw new wOt.OKXConnectError(wOt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"connect requestWallets is null"); - { - let t={ - } - ; - (0,SOt.buildAccountNameSpaces)(e,t),this.compareAndModifyNamespaces(i.namespaces,t)||((0,yOt.logDebug)("inject-connector checkAccountChanged --result sessionLocal:",JSON.stringify(i)),this.accountChangeListener?((0,yOt.logDebug)("inject-connector checkAccountChanged -accountChangeListener:",this.accountChangeListener),this.accountChangeListener(i)):((0,yOt.logDebug)("inject-connector checkAccountChanged disconnect:"),yield this.disconnect()))} - } - catch(frt){ - throw(0,yOt.logDebug)("inject-connector restoreconnect catch error",JSON.stringify(frt)),frt} - } - )} - compareAndModifyNamespaces(t,i){ - let s=!0; - for(const e in t)if(i[e]){ - const n=t[e],h=i[e]; - (0,yOt.logDebug)("inject-connector checkAccountChanged ns1:",JSON.stringify(n)),(0,yOt.logDebug)("inject-connector checkAccountChanged ns2:",JSON.stringify(h)),JSON.stringify([...n.accounts].sort())===JSON.stringify([...h.accounts].sort())||(s=!1,n.accounts=[...h.accounts],n.extra=Object.assign({ - } - ,h.extra),n.payload=Object.assign({ - } - ,h.payload)),(0,yOt.logDebug)("inject-connector checkAccountChanged new ns1:",JSON.stringify(n))} - return(0,yOt.logDebug)(`inject-connector checkAccountChanged compareAndModifyNamespaces ===> ${ - s} - `),s} - restoreconnect(t,i){ - var s; - if(window.okxwallet){ - this.dappInfo=null===(s=t.sessionConfig)||void 0===s?void 0:s.dappInfo,(0,yOt.logDebug)("inject-connector restoreconnect --sessionInfo:",JSON.stringify(t)); - var e=this.getRequireNameSpaceFromSession(t); - (0,yOt.logDebug)("inject-connector restoreconnect --requiredNamespaces:",JSON.stringify(e)),this.getAccountByRequestWallets(!1,!1,!1,e,[]).then(s=>{ - (0,yOt.logDebug)("inject-connector restoreconnect --accounts:",JSON.stringify(s)); - let e=!0; - for(let i in t.namespaces){ - var n=s.find(t=>t.namespace===i),h=t.namespaces[i].accounts; - if(!n)throw new wOt.OKXConnectError(wOt.OKX_CONNECT_ERROR_CODES.BAD_REQUEST_ERROR,"resotreconnect error: accountItem error"); - let r=h; - i===wOt.NameSpaceKeyAptos&&r&&r.length>0&&(r=h.map(t=>(0,yOt.replaceChainNameToChainId)(t))),n.addresses.length===r.length&&n.addresses.slice().sort().every((t,s)=>{ - if(i===wOt.NameSpaceKeyAptos){ - let i=r.slice().sort()[s]; - return(0,yOt.logDebug)("check aptos address -value and aptosAdd--",t,i),i===t} - return t===r.slice().sort()[s]} - )||(e=!1)} - if(!e)throw new wOt.OKXConnectError(wOt.OKX_CONNECT_ERROR_CODES.BAD_REQUEST_ERROR,"resotreconnect error: address not as same as session"); - i(t)} - ).catch(t=>{ - (0,yOt.logDebug)("inject-connector restoreconnect catch error",JSON.stringify(t)),i(null)} - )} - else i(null)} - getRequireNameSpaceFromSession(t){ - var i,s,e=[]; - for(let n in t.namespaces){ - let h=t.namespaces[n],r={ - namespace:n,chains:h.chains} - ; - if(n===wOt.NameSpaceKeyAptos){ - let t=[]; - h.chains.forEach(i=>{ - let s=(0,yOt.replaceChainNameToChainId)(i); - t.push(s)} - ),r={ - namespace:n,chains:t} - } - else if(n===wOt.NameSpaceKeyTON){ - let t,e; - (null===(i=h.payload)||void 0===i?void 0:i.ton_proof)&&(t=null===(s=h.payload)||void 0===s?void 0:s.ton_proof,t.proof.payload&&(e={ - name:"ton_proof",payload:t.proof.payload} - )),r={ - namespace:n,chains:h.chains,params:{ - ton_addr:{ - name:"ton_addr"} - ,ton_proof:e} - } - } - e.push(r)} - return e} - getAccountByRequestWallets(t,i,s,e,n){ - return fOt(this,void 0,void 0,function*(){ - try{ - var h=[],r=[]; - if((0,AOt.isDevice)("mobile")){ - var o=yield window.okxwallet.connectWallet(t,{ - requiredNamespaces:e,optionalNamespaces:n} - ); - h.push(o)} - else h=yield window.okxwallet.requestWallets(t); - var a=[...null!=e?e:[],...null!=n?n:[]]; - let c,l=h[0]; - if((0,yOt.logDebug)(" InjectEngine connect connectAccounts:",JSON.stringify(l)),a&&l&&l.address)for(const[e,n]of this.providerMap.entries()){ - let h=yield n.parseConnectResponse(t,i,s,a,l,this.dappInfo); - h&&(c=e,r.push(h))} - let u=e.every(t=>{ - let i=r.find(i=>i.namespace===t.namespace); - return!!i&&t.chains.every(t=>!!i.addresses.find(i=>i.startsWith(t+":")))} - ); - if((0,yOt.logDebug)("InjectEngine connect requiredNamespaces:",JSON.stringify(e)),(0,yOt.logDebug)("InjectEngine connect accountResult:",JSON.stringify(r)),!u)throw yield this.disconnect(),new wOt.OKXConnectError(wOt.OKX_CONNECT_ERROR_CODES.CHAIN_NOT_SUPPORTED); - return(0,AOt.isDevice)("mobile")||(this.configEventWithKey(c),yield window.okxwallet.requestWallets(t)),r} - catch(frt){ - if(frt&&"object"==typeof frt&&"code"in frt&&4001===frt.code)throw new wOt.OKXConnectError(wOt.OKX_CONNECT_ERROR_CODES.USER_REJECTS_ERROR); - throw new wOt.OKXConnectError(wOt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR)} - } - )} - configEventWithKey(t){ - var i,s; - for(let e in this.providerMap)null===(i=this.providerMap.get(e))||void 0===i||i.removeListener(); - null===(s=this.getInjectProvider(t))||void 0===s||s.addAccountChangedListener(()=>{ - this.checkAccountChanged().catch(t=>{ - } - )} - )} - disconnect(){ - return fOt(this,void 0,void 0,function*(){ - (0,yOt.logDebug)("InjectEngine ==>> disconnect okxwallet.disconnect()"),window.okxwallet&&(yield window.okxwallet.disconnect(),(0,yOt.logDebug)("InjectEngine ==>> disconnect end okxwallet.disconnect()"))} - )} - } - ; - Qt(COt,"OkxwalletInjectConnector"); - let OOt=COt; - ACt.OkxwalletInjectConnector=OOt; - var IOt={ - } - ,kOt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(IOt,"__esModule",{ - value:!0} - ),IOt.OkxwalletInjectTonsdkConnector=void 0; - const xOt=U_t,ROt=rbt(),POt=QEt,NOt=ACt,LOt=OEt,DOt=class extends NOt.OkxwalletInjectConnector{ - getType(){ - return LOt.CONNECTOR_TYPE.INJECT.OKX_INJECT_WALLET} - constructor(){ - super(),this.walletName="OKX Wallet extension",this.walletNameKey="walletModal.mobileConnectionModal.connectInjected"} - checkWalletMatch(){ - return kOt(this,void 0,void 0,function*(){ - var t,i,s; - null===(t=this.connectionManager)||void 0===t||t.tonsdkConnectStorage.synchronizedCache(); - let e=null===(i=this.connectionManager)||void 0===i?void 0:i.tonsdkConnectStorage.getItem("ton_connect_info_adapter_universal"); - if(!e||!(null==e?void 0:e.content))throw new xOt.OKXConnectError(xOt.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR); - const n=null==e?void 0:e.content; - let h,r=JSON.parse(n),o=r.connectEvent.payload.items.find(t=>"name"in t&&"ton_addr"===t.name); - if(this.dappInfo=r.dappInfo,o&&"address"in o&&(h=o.address),!h)throw new xOt.OKXConnectError(xOt.OKX_CONNECT_ERROR_CODES.WALLET_NOT_SUPPORTED); - if((0,ROt.logDebug)(`inject-connector localTonaddress : ${ - h} - `),(0,POt.isDevice)("mobile")){ - let t; - t={ - namespace:xOt.NameSpaceKeyTON,chains:[xOt.TON_CHAINS.MAINNET],params:{ - ton_addr:{ - name:"ton_addr"} - } - } - ; - let i=yield this.getAccountByRequestWallets(!1,!1,!1,[t],[]); - if(i&&1==i.length){ - let t=null===(s=i[0].data)||void 0===s?void 0:s.ton_addr; - if(h===(null==t?void 0:t.address))return} - } - else{ - let t=yield window.okxTonWallet.tonconnect.restoreConnection(); - if("connect"===t.event&&t.payload.items.find(t=>"ton_addr"===t.name).address==h)return} - throw new xOt.OKXConnectError(xOt.OKX_CONNECT_ERROR_CODES.WALLET_NOT_SUPPORTED)} - )} - } - ; - Qt(DOt,"OkxwalletInjectTonsdkConnector"); - let GOt=DOt; - IOt.OkxwalletInjectTonsdkConnector=GOt; - var BOt={ - } - ,UOt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(BOt,"__esModule",{ - value:!0} - ),BOt.ThirdpartInjectConnector=void 0; - const FOt=lCt,$Ot=U_t,HOt=OEt,WOt=rbt(),VOt=class extends FOt.InjectConnector{ - getType(){ - return this.walletName===$Ot.AptosGoogleWalletName?HOt.CONNECTOR_TYPE.KEYLESS.GOOGLE_WALLET:this.walletName===$Ot.AptosAppleWalletName?HOt.CONNECTOR_TYPE.KEYLESS.APPLE_WALLET:HOt.CONNECTOR_TYPE.INJECT.STANDARD_INJECT_WALLET} - constructor(t){ - super(),this.walletName=t.walletName,t.wallets.forEach((t,i)=>{ - this.providerMap.set(i,t)} - ),this.icon=t.icon} - registerWallet(t,i){ - this.providerMap.set(t,i)} - getTag(){ - var t; - return HOt.STANDARD_INJECT_WALLET+(null!==(t=this.walletName)&&void 0!==t?t:"")} - getWalletVersion(){ - return UOt(this,void 0,void 0,function*(){ - const t=this.providerMap.values().next().value; - if(!t)throw new $Ot.OKXConnectError($Ot.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR); - return t.getVersion()} - )} - openWallet(t,i){ - return UOt(this,void 0,void 0,function*(){ - var i,s; - if((0,WOt.logDebug)("InjectEngine connect begin:",JSON.stringify(t)),!t)throw new $Ot.OKXConnectError($Ot.OKX_CONNECT_ERROR_CODES.BAD_REQUEST_ERROR); - this.dappInfo=t.connectRequest.dAppInfo; - var e=t.connectRequest; - try{ - if(e.requests){ - let t=e.requests.find(t=>"requestAccounts"===t.name); - const n=null!==(i=t.requiredNamespaces)&&void 0!==i?i:[],h=null!==(s=t.optionalNamespaces)&&void 0!==s?s:[]; - let r; - if(n.length+h.length===1){ - const t=1===n.length?n[0]:h[0],i=this.providerMap.get(t.namespace); - if(this.addListener(t.namespace),!i)throw new $Ot.OKXConnectError($Ot.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"openWallet: provider not found"); - r=yield this.getResponseByConnect(i)} - this.connectResultListener&&r&&this.connectResultListener(r,this)} - } - catch(h){ - var n=$Ot.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR; - h instanceof $Ot.OKXConnectError&&(n=h.code,h.message),this.connectResultListener&&this.connectResultListener({ - requestId:"-1",method:"connect_error",payload:{ - code:n} - } - ,this)} - } - )} - getResponseByConnect(t){ - return UOt(this,void 0,void 0,function*(){ - var i,s; - let e={ - method:"connect",requestId:Date.now().toString(),payload:{ - wallet:{ - platform:null!==(i=navigator.platform)&&void 0!==i?i:"/",appName:HOt.STANDARD_INJECT_WALLET+this.walletName,appVersion:null!==(s=this.getWalletVersion())&&void 0!==s?s:"1.0.0",maxProtocolVersion:1} - ,responses:[]} - } - ,n={ - name:"requestAccounts",accounts:[]} - ; - return e.payload.responses.push(n),n.accounts.push(yield this.getAccount(t)),e} - )} - getAccount(t){ - return UOt(this,void 0,void 0,function*(){ - return t.getAccount()} - )} - disconnect(){ - return UOt(this,void 0,void 0,function*(){ - yield Promise.all([...this.providerMap.values()].map(t=>t.disconnect()))} - )} - onDisconnect(){ - this.disconnectListener.forEach(t=>t()),this.disconnectListener=[]} - restoreconnect(t,i){ - const s=Object.keys(t.namespaces); - if(1!==s.length)return void i(null); - this.addListener(s[0]); - const e=this.getInjectProvider(s[0]); - if(!e)return i(null); - e.getAccount({ - silent:!0} - ).then(e=>{ - var n; - let h=null!==(n=null==e?void 0:e.addresses)&&void 0!==n?n:[""]; - t.namespaces[s[0]].accounts[0].includes(h[0])?i(t):i(null)} - ).catch(t=>{ - i(null)} - )} - checkAccountChanged(t,i){ - return UOt(this,void 0,void 0,function*(){ - var s,e; - try{ - let n=null===(s=this.connectionManager)||void 0===s?void 0:s.getSessionContent("connectSession"); - if(!n)return; - if(i&&n.namespaces[t].accounts.some(t=>t.includes(i)))return; - let h=this.getInjectProvider(t); - if(h){ - let i=yield this.getResponseByConnect(h); - if(i&&n){ - let s=i.payload.responses[0].accounts[0]; - n.namespaces[t].accounts=s.addresses,n.namespaces[t].extra=s.extra,n.namespaces[t].rpcMap=void 0,n.namespaces[t].methods=s.methods,null===(e=this.accountChangeListener)||void 0===e||e.call(this,n)} - } - } - catch(n){ - yield this.disconnect()} - } - )} - addListener(t){ - var i,s; - for(let e in this.providerMap)null===(i=this.providerMap.get(e))||void 0===i||i.removeListener(); - null===(s=this.getInjectProvider(t))||void 0===s||s.addAccountChangedListener(i=>{ - i?this.checkAccountChanged(t,i).catch(t=>{ - } - ):this.onDisconnect()} - )} - supportNamespaceAndChains(t,i){ - let s=this.providerMap.get(t); - return!!s&&s.supportChains(i)} - } - ; - Qt(VOt,"ThirdpartInjectConnector"); - let jOt=VOt; - BOt.ThirdpartInjectConnector=jOt; - var KOt={ - } - ; - Object.defineProperty(KOt,"__esModule",{ - value:!0} - ),KOt.OKXWalletAppConnector=void 0; - const zOt=OEt,YOt=rbt(),qOt=j_t,XOt=U_t,JOt=JTt,QOt=class extends JOt.WsConnector{ - getType(){ - return zOt.CONNECTOR_TYPE.WS.OKX_WALLET_APP_WALLET} - constructor(){ - super(),this.walletName="OKX Wallet App"} - getTag(){ - return zOt.OKX_WALLET_APP_WALLET} - openWallet(t,i){ - super.openWallet(t); - let s=null!=i?i:XOt.OpenAppLinkType.UniversalLink; - if(t&&t.connectRequest||!(0,YOt.isOS)("android")){ - (0,YOt.logDebug)(`appwallet-connector openwallet before useSHortLink engineConnectInfo.connectRequest JSON ${ - JSON.stringify(t)} - `); - let i=null==t?void 0:t.connectRequest,{ - universalLink:e,deepLink:n} - =(0,YOt.getOKXLink)(i,XOt.ConnectWalletType.OKX_WALLET); - (0,YOt.openOKXDeeplinkWithFallback)(n,e,s)} - else(0,YOt.openDeeplinkWithFallback)(qOt.okxWalletStackDeepLink,()=>{ - } - )} - } - ; - Qt(QOt,"OKXWalletAppConnector"); - let ZOt=QOt; - KOt.OKXWalletAppConnector=ZOt; - var tIt={ - } - ; - Object.defineProperty(tIt,"__esModule",{ - value:!0} - ),tIt.OKXAppCommonConnector=void 0; - const iIt=OEt,sIt=rbt(),eIt=j_t,nIt=U_t,hIt=JTt,rIt=class extends hIt.WsConnector{ - getType(){ - return iIt.CONNECTOR_TYPE.WS.OKX_APP_COMMON} - constructor(){ - super(),this.walletName=""} - getTag(){ - return iIt.OKX_APP_COMMON_WALLET} - openWallet(t,i){ - super.openWallet(t); - let s=null!=i?i:nIt.OpenAppLinkType.UniversalLink; - if(t&&t.connectRequest||!(0,sIt.isOS)("android")){ - (0,sIt.logDebug)(`okxAppCommonConnector openwallet before useSHortLink engineConnectInfo.connectRequest JSON ${ - JSON.stringify(t)} - `); - let i=null==t?void 0:t.connectRequest,{ - universalLink:e,deepLink:n} - =(0,sIt.getOKXLink)(i,nIt.ConnectWalletType.OKX_APP_COMMON); - (0,sIt.openOKXDeeplinkWithFallback)(n,e,s)} - else(0,sIt.openDeeplinkWithFallback)(eIt.okxCommonStackDeepLink,()=>{ - } - )} - } - ; - Qt(rIt,"OKXAppCommonConnector"); - let oIt=rIt; - tIt.OKXAppCommonConnector=oIt,function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.OKXAppCommonConnector=t.OKXWalletAppConnector=t.ThirdpartInjectConnector=t.OkxwalletInjectTonsdkConnector=t.OkxwalletInjectConnector=t.WsConnector=t.TgwalletConnector=t.InjectConnector=t.OKXAppConnector=void 0; - var e=XTt; - Object.defineProperty(t,"OKXAppConnector",{ - enumerable:!0,get:Qt(function(){ - return e.OKXAppConnector} - ,"get")} - ),s(OEt,t); - var n=lCt; - Object.defineProperty(t,"InjectConnector",{ - enumerable:!0,get:Qt(function(){ - return n.InjectConnector} - ,"get")} - ); - var h=mCt; - Object.defineProperty(t,"TgwalletConnector",{ - enumerable:!0,get:Qt(function(){ - return h.TgwalletConnector} - ,"get")} - ); - var r=JTt; - Object.defineProperty(t,"WsConnector",{ - enumerable:!0,get:Qt(function(){ - return r.WsConnector} - ,"get")} - ); - var o=ACt; - Object.defineProperty(t,"OkxwalletInjectConnector",{ - enumerable:!0,get:Qt(function(){ - return o.OkxwalletInjectConnector} - ,"get")} - ); - var a=IOt; - Object.defineProperty(t,"OkxwalletInjectTonsdkConnector",{ - enumerable:!0,get:Qt(function(){ - return a.OkxwalletInjectTonsdkConnector} - ,"get")} - ); - var c=BOt; - Object.defineProperty(t,"ThirdpartInjectConnector",{ - enumerable:!0,get:Qt(function(){ - return c.ThirdpartInjectConnector} - ,"get")} - ); - var l=KOt; - Object.defineProperty(t,"OKXWalletAppConnector",{ - enumerable:!0,get:Qt(function(){ - return l.OKXWalletAppConnector} - ,"get")} - ); - var u=tIt; - Object.defineProperty(t,"OKXAppCommonConnector",{ - enumerable:!0,get:Qt(function(){ - return u.OKXAppCommonConnector} - ,"get")} - )} - (qTt),function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),s(bgt,t),s(U_t,t),s(rbt(),t),s(KEt,t),s(qTt,t)} - (Mgt); - var aIt={ - } - ,cIt={ - } - ,lIt={ - } - ,uIt={ - } - ,dIt={ - } - ; - function fIt(t){ - return!("connectEvent"in t)} - Object.defineProperty(dIt,"__esModule",{ - value:!0} - ),dIt.isPendingConnectionHttp=fIt,Qt(fIt,"isPendingConnectionHttp"); - var pIt={ - } - ,wIt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(pIt,"__esModule",{ - value:!0} - ),pIt.BridgeConnectionStorage=void 0; - const gIt=Mgt,mIt=class{ - constructor(t){ - this.storage=t,this.storeKey="ton_connect_info_adapter_universal"} - storeConnection(t){ - return wIt(this,void 0,void 0,function*(){ - return(0,gIt.logDebug)("BridgeConnectionStorage ==>> storeConnection ==>> connection:",t),this.storage.saveContent(JSON.stringify(t),this.storeKey)} - )} - removeConnection(){ - return wIt(this,void 0,void 0,function*(){ - return(0,gIt.logDebug)("BridgeConnectionStorage ==>> removeConnection"),this.storage.clearCache(this.storeKey)} - )} - getConnection(){ - return wIt(this,void 0,void 0,function*(){ - const t=this.storage.getItem(this.storeKey); - if((0,gIt.logDebug)("BridgeConnectionStorage ==>> getConnection ==>>this.storage: ",this.storage),!t||!(null==t?void 0:t.content))return null; - try{ - const i=null==t?void 0:t.content; - if(i){ - let t; - return t=JSON.parse(i),(0,gIt.logDebug)("BridgeConnectionStorage ==>> getConnection ==>>connection: ",t),t} - return null} - catch(i){ - return null} - } - )} - getHttpConnection(){ - return wIt(this,void 0,void 0,function*(){ - const t=yield this.getConnection(); - if(!t)throw new gIt.OKXConnectError(gIt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"Trying to read HTTP connection source while nothing is stored"); - return t} - )} - storeLastWalletEventId(t){ - return wIt(this,void 0,void 0,function*(){ - const i=yield this.getConnection(); - if(i&&"connectEvent"in i)return i.lastWalletEventId=t,this.storeConnection(i)} - )} - getLastWalletEventId(){ - return wIt(this,void 0,void 0,function*(){ - const t=yield this.getConnection(); - if(t&&"lastWalletEventId"in t)return t.lastWalletEventId} - )} - } - ; - Qt(mIt,"BridgeConnectionStorage"); - let vIt=mIt; - pIt.BridgeConnectionStorage=vIt; - var _It={ - } - ; - Object.defineProperty(_It,"__esModule",{ - value:!0} - ),_It.OKXTON_STORAGE_PREFIX=_It.OKXCONNECTOR_TON_KEY=_It.OKXtonConnectSdkVersion=void 0,_It.OKXtonConnectSdkVersion="1",_It.OKXCONNECTOR_TON_KEY="OKXStorage_ctc",_It.OKXTON_STORAGE_PREFIX="_okxton"; - var MIt={ - } - ,bIt={ - } - ; - function yIt(){ - return{ - type:"request-version"} - } - function EIt(t){ - return{ - type:"response-version",version:t} - } - function AIt(t){ - return{ - okx_ton_connect_sdk_lib:t.okx_ton_connect_sdk_lib,okx_connect_ui_lib:t.okx_connect_ui_lib} - } - function SIt(t,i){ - var s,e,n,h,r,o,a,c; - const l=(null===(s=null==i?void 0:i.connectItems)||void 0===s?void 0:s.tonProof)&&"proof"in i.connectItems.tonProof?"ton_proof":"ton_addr"; - return{ - wallet_address:null!==(n=null===(e=null==i?void 0:i.account)||void 0===e?void 0:e.address)&&void 0!==n?n:null,wallet_type:null!==(h=null==i?void 0:i.device.appName)&&void 0!==h?h:null,wallet_version:null!==(r=null==i?void 0:i.device.appVersion)&&void 0!==r?r:null,auth_type:l,custom_data:Object.assign({ - chain_id:null!==(a=null===(o=null==i?void 0:i.account)||void 0===o?void 0:o.chain)&&void 0!==a?a:null,provider:null!==(c=null==i?void 0:i.provider)&&void 0!==c?c:null} - ,AIt(t))} - } - function TIt(t){ - return{ - type:"connection-started",custom_data:AIt(t)} - } - function CIt(t){ - return{ - type:"connection-get-deeplink",deeplinkUrl:t} - } - function OIt(t){ - return{ - type:"connection-info-before-jump",connectInfo:t} - } - function IIt(t,i){ - return Object.assign({ - type:"connection-completed",is_success:!0} - ,SIt(t,i))} - function kIt(t,i,s){ - return{ - type:"connection-error",is_success:!1,error_message:i,error_code:null!=s?s:null,custom_data:AIt(t)} - } - function xIt(t){ - return{ - type:"connection-restoring-started",custom_data:AIt(t)} - } - function RIt(t,i){ - return Object.assign({ - type:"connection-restoring-completed",is_success:!0} - ,SIt(t,i))} - function PIt(t,i){ - return{ - type:"connection-restoring-error",is_success:!1,error_message:i,custom_data:AIt(t)} - } - function NIt(t,i){ - var s,e,n,h; - return{ - valid_until:null!==(s=String(i.validUntil))&&void 0!==s?s:null,from:null!==(h=null!==(e=i.from)&&void 0!==e?e:null===(n=null==t?void 0:t.account)||void 0===n?void 0:n.address)&&void 0!==h?h:null,messages:i.messages.map(t=>{ - var i,s; - return{ - address:null!==(i=t.address)&&void 0!==i?i:null,amount:null!==(s=t.amount)&&void 0!==s?s:null} - } - )} - } - function LIt(t,i,s){ - return Object.assign(Object.assign({ - type:"transaction-sent-for-signature"} - ,SIt(t,i)),NIt(i,s))} - function DIt(t,i,s,e){ - return Object.assign(Object.assign({ - type:"transaction-signed",is_success:!0,signed_transaction:e.boc} - ,SIt(t,i)),NIt(i,s))} - function GIt(t,i,s,e,n){ - return Object.assign(Object.assign({ - type:"transaction-signing-failed",is_success:!1,error_message:e,error_code:null!=n?n:null} - ,SIt(t,i)),NIt(i,s))} - function BIt(t,i,s){ - return Object.assign({ - type:"disconnection",scope:s} - ,SIt(t,i))} - Object.defineProperty(bIt,"__esModule",{ - value:!0} - ),bIt.createRequestVersionEvent=yIt,bIt.createResponseVersionEvent=EIt,bIt.createVersionInfo=AIt,bIt.createConnectionStartedEvent=TIt,bIt.createConnectionDeepLinkEvent=CIt,bIt.createConnectionInfoBeforeJumpEvent=OIt,bIt.createConnectionCompletedEvent=IIt,bIt.createConnectionErrorEvent=kIt,bIt.createConnectionRestoringStartedEvent=xIt,bIt.createConnectionRestoringCompletedEvent=RIt,bIt.createConnectionRestoringErrorEvent=PIt,bIt.createTransactionSentForSignatureEvent=LIt,bIt.createTransactionSignedEvent=DIt,bIt.createTransactionSigningFailedEvent=GIt,bIt.createDisconnectionEvent=BIt,Qt(yIt,"createRequestVersionEvent"),Qt(EIt,"createResponseVersionEvent"),Qt(AIt,"createVersionInfo"),Qt(SIt,"createConnectionInfo"),Qt(TIt,"createConnectionStartedEvent"),Qt(CIt,"createConnectionDeepLinkEvent"),Qt(OIt,"createConnectionInfoBeforeJumpEvent"),Qt(IIt,"createConnectionCompletedEvent"),Qt(kIt,"createConnectionErrorEvent"),Qt(xIt,"createConnectionRestoringStartedEvent"),Qt(RIt,"createConnectionRestoringCompletedEvent"),Qt(PIt,"createConnectionRestoringErrorEvent"),Qt(NIt,"createTransactionInfo"),Qt(LIt,"createTransactionSentForSignatureEvent"),Qt(DIt,"createTransactionSignedEvent"),Qt(GIt,"createTransactionSigningFailedEvent"),Qt(BIt,"createDisconnectionEvent"); - var UIt={ - } - ,FIt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(UIt,"__esModule",{ - value:!0} - ),UIt.BrowserEventDispatcher=void 0; - const $It=class{ - constructor(){ - this.window=window} - dispatchEvent(t,i){ - return FIt(this,void 0,void 0,function*(){ - var s; - const e=new CustomEvent(t,{ - detail:i} - ); - null===(s=this.window)||void 0===s||s.dispatchEvent(e)} - )} - addEventListener(t,i,s){ - return FIt(this,void 0,void 0,function*(){ - var e; - return null===(e=this.window)||void 0===e||e.addEventListener(t,i,s),()=>{ - var s; - return null===(s=this.window)||void 0===s?void 0:s.removeEventListener(t,i)} - } - )} - } - ; - Qt($It,"BrowserEventDispatcher"); - let HIt=$It; - UIt.BrowserEventDispatcher=HIt; - var WIt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(MIt,"__esModule",{ - value:!0} - ),MIt.TonConnectTracker=void 0; - const VIt=bIt,jIt=UIt,KIt=class{ - get version(){ - return(0,VIt.createVersionInfo)({ - okx_ton_connect_sdk_lib:this.OKXtonConnectSdkVersion,okx_connect_ui_lib:this.OKXConnectUiVersion} - )} - constructor(t){ - this.eventPrefix="okx-ton-connect-",this.OKXConnectUiVersion=null,this.eventDispatcher=new jIt.BrowserEventDispatcher,this.OKXtonConnectSdkVersion=t.OKXtonConnectSdkVersion,this.init().catch()} - init(){ - return WIt(this,void 0,void 0,function*(){ - try{ - yield this.setRequestVersionHandler(),this.OKXConnectUiVersion=yield this.requestTonConnectUiVersion()} - catch(frt){ - } - } - )} - setRequestVersionHandler(){ - return WIt(this,void 0,void 0,function*(){ - yield this.eventDispatcher.addEventListener("okx-ton-connect-request-version",()=>WIt(this,void 0,void 0,function*(){ - yield this.eventDispatcher.dispatchEvent("okx-ton-connect-response-version",(0,VIt.createResponseVersionEvent)(this.OKXtonConnectSdkVersion))} - ))} - )} - requestTonConnectUiVersion(){ - return WIt(this,void 0,void 0,function*(){ - return new Promise((t,i)=>WIt(this,void 0,void 0,function*(){ - try{ - yield this.eventDispatcher.addEventListener("okx-connect-ui-response-version",i=>{ - t(i.detail.version)} - ,{ - once:!0} - ),yield this.eventDispatcher.dispatchEvent("okx-connect-ui-request-version",(0,VIt.createRequestVersionEvent)())} - catch(frt){ - i(frt)} - } - ))} - )} - dispatchUserActionEvent(t){ - try{ - this.eventDispatcher.dispatchEvent(`${ - this.eventPrefix} - ${ - t.type} - `,t).catch()} - catch(frt){ - } - } - trackConnectionStarted(...t){ - try{ - const i=(0,VIt.createConnectionStartedEvent)(this.version,...t); - this.dispatchUserActionEvent(i)} - catch(frt){ - } - } - trackConnectionDeepLink(...t){ - try{ - const i=(0,VIt.createConnectionDeepLinkEvent)(...t); - this.dispatchUserActionEvent(i)} - catch(frt){ - } - } - trackConnectionCompleted(...t){ - try{ - const i=(0,VIt.createConnectionCompletedEvent)(this.version,...t); - this.dispatchUserActionEvent(i)} - catch(frt){ - } - } - trackConnectionInfoBeforeJump(t){ - try{ - const i=(0,VIt.createConnectionInfoBeforeJumpEvent)(t); - this.dispatchUserActionEvent(i)} - catch(frt){ - } - } - trackConnectionError(...t){ - try{ - const i=(0,VIt.createConnectionErrorEvent)(this.version,...t); - this.dispatchUserActionEvent(i)} - catch(frt){ - } - } - trackConnectionRestoringStarted(...t){ - try{ - const i=(0,VIt.createConnectionRestoringStartedEvent)(this.version,...t); - this.dispatchUserActionEvent(i)} - catch(frt){ - } - } - trackConnectionRestoringCompleted(...t){ - try{ - const i=(0,VIt.createConnectionRestoringCompletedEvent)(this.version,...t); - this.dispatchUserActionEvent(i)} - catch(frt){ - } - } - trackConnectionRestoringError(...t){ - try{ - const i=(0,VIt.createConnectionRestoringErrorEvent)(this.version,...t); - this.dispatchUserActionEvent(i)} - catch(frt){ - } - } - trackDisconnection(...t){ - try{ - const i=(0,VIt.createDisconnectionEvent)(this.version,...t); - this.dispatchUserActionEvent(i)} - catch(frt){ - } - } - trackTransactionSentForSignature(...t){ - try{ - const i=(0,VIt.createTransactionSentForSignatureEvent)(this.version,...t); - this.dispatchUserActionEvent(i)} - catch(frt){ - } - } - trackTransactionSigned(...t){ - try{ - const i=(0,VIt.createTransactionSignedEvent)(this.version,...t); - this.dispatchUserActionEvent(i)} - catch(frt){ - } - } - trackTransactionSigningFailed(...t){ - try{ - const i=(0,VIt.createTransactionSigningFailedEvent)(this.version,...t); - this.dispatchUserActionEvent(i)} - catch(frt){ - } - } - } - ; - Qt(KIt,"TonConnectTracker"); - let zIt=KIt; - MIt.TonConnectTracker=zIt; - var YIt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(uIt,"__esModule",{ - value:!0} - ),uIt.BridgeProvider=void 0; - const qIt=dIt,XIt=Mgt,JIt=pIt,QIt=_It,ZIt=MIt,tkt=class t{ - constructor(t,i=void 0,s){ - this.storage=t,this.type="http",this.listeners=[],this.openUniversalLink=!1,this.engine=new XIt.Engine(i+QIt.OKXTON_STORAGE_PREFIX),this.engine.registerConnector(s),this.connectionStorage=new JIt.BridgeConnectionStorage(t),this.tracker=new ZIt.TonConnectTracker({ - OKXtonConnectSdkVersion:QIt.OKXtonConnectSdkVersion} - ),(0,XIt.getDefaultReporter)().configVersionAndSide("tonsdk-1.5.2","dapp",i)} - static fromStorage(i){ - return YIt(this,arguments,void 0,function*(i,s=void 0,e){ - (0,XIt.logDebug)("bridge-provider ==>> fromStorage ==>>storage:",i),(0,XIt.reportLog)("bridge-provider ==>> fromStorage"); - const n=new JIt.BridgeConnectionStorage(i),h=yield n.getHttpConnection(); - if((0,qIt.isPendingConnectionHttp)(h))return null; - const r=new t(i,s,e); - return r.openUniversalLink=h.openUniversalLink,r} - )} - isCryptoEnable(){ - return this.engine.connectionManager.getCryptoKeyEnable()} - connect(t,i,s,e,n){ - return YIt(this,void 0,void 0,function*(){ - return(0,XIt.logDebug)("bridge-provider ==>> connect_1 ==>>message:",t),(0,XIt.logDebug)("bridge-provider ==>> connect_1 ==>>redirect:",i),(0,XIt.logDebug)("bridge-provider ==>> connect_1 ==>>openUniversalLink:",s),(0,XIt.logDebug)("bridge-provider ==>> connect_1 ==>>tmaReturnUrl:",e),(0,XIt.reportLog)("bridge-provider ==>> connect"),new Promise((h,r)=>{ - try{ - this.openUniversalLink=s,void 0===this.openUniversalLink&&(this.openUniversalLink=(0,XIt.isMobileUserAgent)()); - let o={ - name:"requestAccounts",requiredNamespaces:[{ - namespace:"ton",chains:["ton:-239"],params:t.params} - ]} - ,a=[]; - t.params.ton_addr&&a.push(t.params.ton_addr),t.params.ton_proof&&a.push(t.params.ton_proof),a.push(o); - let c={ - dappInfo:t.dappInfo,openUniversalUrl:this.openUniversalLink,redirect:i,tmaReturnUrl:e,connectWalletType:n} - ; - this.engine.universalConnect(a,c,t=>{ - (0,XIt.logDebug)(`bridge-provider: connect: info>>>> ${ - JSON.stringify(t)} - `); - try{ - const{ - universalLink:i,deepLink:s} - =(0,XIt.getOKXLink)(t.connectRequest); - this.tracker.trackConnectionInfoBeforeJump(t),h(i)} - catch(i){ - r(i)} - } - ).then(t=>{ - (0,XIt.logDebug)(`bridge-provider: connect: success>>>> ${ - JSON.stringify(t)} - `),this.connectSuccessHandle(t)} - ).catch(t=>{ - (0,XIt.logDebug)(`bridge-provider: connect: catch>>>> ${ - JSON.stringify(t)} - `); - const i={ - event:"connect_error",requestId:Number(Date.now()),payload:{ - code:t.code,message:t.message} - } - ; - (0,XIt.logDebug)("bridge-provider ==>> connectListener_4 ==>>connect_error:",i),this.listeners.forEach(t=>t(i)),r(t)} - )} - catch(o){ - r(o)} - } - )} - )} - listen(t){ - return this.listeners.push(t),()=>this.listeners=this.listeners.filter(i=>i!==t)} - disconnectListener(){ - return YIt(this,void 0,void 0,function*(){ - (0,XIt.logDebug)("bridge-provider ==>> disconnectListener"),(0,XIt.reportLog)("bridge-provider ==>> disconnectListener"); - const t={ - event:"disconnect",requestId:Number(1),payload:{ - } - } - ; - this.listeners.forEach(i=>i(t)),yield this.closeConnection()} - )} - connectSuccessHandle(t){ - return YIt(this,void 0,void 0,function*(){ - var i,s; - try{ - const e=null===(i=t.namespaces)||void 0===i?void 0:i.ton,n=e.payload,h=t.wallet; - if(!(e&&n&&h&&n.ton_addr))throw new XIt.OKXConnectError(XIt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR); - n.ton_addr; - const r=t.sessionConfig; - let o=[]; - n.ton_addr&&o.push(n.ton_addr),n.ton_proof&&o.push(n.ton_proof); - const a={ - platform:h.platform,appName:h.appName,appVersion:h.appVersion,maxProtocolVersion:h.maxProtocolVersion,features:["ton_sendTransaction"]} - ,c={ - type:"http",lastWalletEventId:Number(Date.now()),connectEvent:{ - event:"connect",payload:{ - items:o,device:a} - } - ,channelId:t.topic,openUniversalLink:null==r?void 0:r.openUniversalUrl,dappInfo:null==r?void 0:r.dappInfo,connectWalletType:null==r?void 0:r.connectWalletType} - ; - (0,XIt.logDebug)("bridge-provider ==>> connectSuccessHandle_2 ==>>storeConnection:",c),yield this.connectionStorage.storeConnection(c),null===(s=this.engine)||void 0===s||s.addDisconnectListener(this.disconnectListener.bind(this)); - const l={ - event:"connect",requestId:c.lastWalletEventId,payload:c.connectEvent.payload} - ; - (0,XIt.logDebug)("bridge-provider ==>> connectSuccessHandle_3 ==>>listeners.forEach:",l),this.listeners.forEach(t=>t(l))} - catch(e){ - (0,XIt.logDebug)("bridge-provider ==>> connectSuccessHandle_4 ==>>error:",e); - const t={ - event:"connect_error",requestId:Number(Date.now()),payload:{ - code:XIt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,message:"Connect success connectSuccessHandle response error"} - } - ; - (0,XIt.logDebug)("bridge-provider ==>> connectSuccessHandle_4 ==>>connect_error:",t),this.listeners.forEach(i=>i(t))} - } - )} - closeConnection(){ - return YIt(this,arguments,void 0,function*(t=!1,i=!1){ - var s,e; - (0,XIt.logDebug)("bridge-provider ==>> closeConnection ==>>fromRestore:",t," needOpenUrl:",i),(0,XIt.reportLog)("bridge-provider ==>> closeConnection"),this.listeners=[],i||(yield null===(s=this.engine)||void 0===s?void 0:s.connectManagerDisconnect(t)),t||(null===(e=this.engine)||void 0===e||e.clearData(),yield this.connectionStorage.removeConnection())} - )} - restoreConnection(){ - return YIt(this,void 0,void 0,function*(){ - var t,i,s; - (0,XIt.logDebug)("bridge-provider ==>> restoreConnection_1"),(0,XIt.reportLog)("bridge-provider ==>> restoreConnection"); - const e=yield this.connectionStorage.getHttpConnection(); - if((0,qIt.isPendingConnectionHttp)(e))return; - const n=e.connectEvent.payload.device.appName===XIt.OKX_INJECT_WALLET,h=this.engine.connectionManager.getCryptoKeyEnable(); - if(e&&(h||n))if((0,XIt.logDebug)("bridge-provider ==>> restoreConnection_2 ==>>storedConnection.channelId:",e.channelId),e.channelId&&e.dappInfo)try{ - const n={ - event:"connect",requestId:Number(0),payload:e.connectEvent.payload} - ; - this.listeners.forEach(t=>t(n)),this.engine.setConnectConnector(e.connectEvent.payload.device,{ - dappInfo:e.dappInfo,connectWalletType:e.connectWalletType} - ); - const h=e.channelId; - (0,XIt.logDebug)("bridge-provider ==>> restoreConnection_3 ==>>this.engine.restoreConnect:",h),null===(t=this.engine)||void 0===t||t.addDisconnectListener(this.disconnectListener.bind(this)),yield this.engine.restoreconnectFromTopic(h),this.engine.deviceInfo=e.connectEvent.payload.device,(0,XIt.reportEvent)(XIt.OKXReportType.PAGE_IN,XIt.Report_OKXConnectSDKExtension_ConnectDapp_ConnectSuccess_View,null!==(s=null===(i=this.engine.getConnector())||void 0===i?void 0:i.getTag())&&void 0!==s?s:"")} - catch(frt){ - (0,XIt.logDebug)("bridge-provider ==>> restoreConnection_4 ==>>closeConnection_1"),yield this.closeConnection()} - else(0,XIt.logDebug)("bridge-provider ==>> restoreConnection_4 ==>>closeConnection_2"),yield this.closeConnection()} - )} - openOKXWallet(){ - (0,XIt.logDebug)("bridge-provider ==>> openOKXWallet",this.openUniversalLink),(0,XIt.reportLog)("bridge-provider ==>> openOKXWallet"),this.openUniversalLink&&this.engine.openWallet(void 0,void 0,XIt.OpenAppLinkType.UniversalLink)} - disconnect(){ - return YIt(this,void 0,void 0,function*(){ - return(0,XIt.logDebug)("bridge-provider ==>> disconnect_1"),(0,XIt.reportLog)("bridge-provider ==>> disconnect"),new Promise(t=>YIt(this,void 0,void 0,function*(){ - let i=!1; - const s=Qt(()=>{ - i||(i=!0,this.closeConnection().then(t))} - ,"onRequestSent"); - try{ - yield this.sendRequest({ - method:"disconnect"} - ,{ - onRequestSent:s,attempts:1} - )} - catch(frt){ - i||this.closeConnection().then(t)} - finally{ - s()} - } - ))} - )} - sendRequest(t,i,s){ - return(0,XIt.logDebug)("bridge-provider ==>> sendRequest"),(0,XIt.reportLog)("bridge-provider ==>> sendRequest"),new Promise((e,n)=>YIt(this,void 0,void 0,function*(){ - var h; - try{ - yield null===(h=this.engine)||void 0===h?void 0:h.send(Object.assign(Object.assign({ - } - ,t),{ - chainId:XIt.TON_CHAINS.MAINNET} - ),{ - resolve:Qt(function(t){ - e(t)} - ,"resolve"),onAck:Qt(function(){ - var t; - null===(t=null==i?void 0:i.onRequestSent)||void 0===t||t.call(i)} - ,"onAck")} - ,s)} - catch(frt){ - n(frt)} - } - ))} - connectorOpenWallet(){ - this.engine.openWallet()} - } - ; - Qt(tkt,"BridgeProvider"); - let ikt=tkt; - uIt.BridgeProvider=ikt; - var skt={ - } - ; - Object.defineProperty(skt,"__esModule",{ - value:!0} - ),skt.checkSendTransactionSupport=nkt; - const ekt=Mgt; - function nkt(t,i){ - if(!t.includes("ton_sendTransaction"))throw new ekt.OKXConnectError(ekt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED,"Wallet doesn't support SendTransaction feature."); - if(4<i.requiredMessagesNumber)throw new ekt.OKXConnectError(ekt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED,`Wallet is not able to handle such SendTransaction request. Max support messages number is 4, but ${ - i.requiredMessagesNumber} - is required.`)} - Qt(nkt,"checkSendTransactionSupport"); - var hkt={ - } - ,rkt={ - } - ; - Object.defineProperty(rkt,"__esModule",{ - value:!0} - ),rkt.RpcParser=void 0; - const okt=class{ - isError(t){ - return"error"in t} - } - ; - Qt(okt,"RpcParser"); - let akt=okt; - rkt.RpcParser=akt; - var ckt=pi&&pi.__rest||function(t,i){ - var s={ - } - ; - for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&i.indexOf(e)<0&&(s[e]=t[e]); - if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){ - var n=0; - for(e=Object.getOwnPropertySymbols(t); - n<e.length; - n++)i.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(t,e[n])&&(s[e[n]]=t[e[n]])} - return s} - ; - Object.defineProperty(hkt,"__esModule",{ - value:!0} - ),hkt.sendTransactionParser=void 0; - const lkt=rkt,ukt=class extends lkt.RpcParser{ - convertToRpcRequest(t){ - const{ - redirect:i} - =t; - return{ - method:"ton_sendTransaction",redirect:i,params:ckt(t,["redirect"])} - } - convertFromRpcResponse(t){ - return{ - boc:t.result.toString()} - } - } - ; - Qt(ukt,"SendTransactionParser"); - let dkt=ukt; - hkt.sendTransactionParser=new dkt; - var fkt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ,pkt=pi&&pi.__rest||function(t,i){ - var s={ - } - ; - for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&i.indexOf(e)<0&&(s[e]=t[e]); - if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){ - var n=0; - for(e=Object.getOwnPropertySymbols(t); - n<e.length; - n++)i.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(t,e[n])&&(s[e[n]]=t[e[n]])} - return s} - ; - Object.defineProperty(lIt,"__esModule",{ - value:!0} - ),lIt.OKXTonConnectInner=void 0; - const wkt=uIt,gkt=Mgt,mkt=skt,vkt=MIt,_kt=hkt,Mkt=pIt,bkt=_It,ykt=class{ - constructor(t){ - if(this._wallet=null,this.provider=null,this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[],this.openUniversalLink=!!this.provider&&this.provider.openUniversalLink,(0,gkt.checkMetaData)(t.metaData),!t.metaData)throw(0,gkt.logDebug)("OKXTonConnect constructor error: options.metaData is nil"),new gkt.OKXConnectError(gkt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"dapp metaData can not be null"); - (0,gkt.logDebug)("OKXTonConnect constructor options:",JSON.stringify(t)),this.dappSettings={ - metaData:Object.assign(Object.assign({ - } - ,t.metaData),{ - url:window.location.hostname,origin:window.location.origin} - )} - ,t.connectors&&0!=t.connectors.length||(t.connectors=[new gkt.OKXAppConnector,new gkt.OKXWalletAppConnector]),this.connectors=t.connectors,this.tracker=new vkt.TonConnectTracker({ - OKXtonConnectSdkVersion:bkt.OKXtonConnectSdkVersion} - ),this.storage=new gkt.Storage(bkt.OKXCONNECTOR_TON_KEY+this.dappSettings.metaData.name+bkt.OKXTON_STORAGE_PREFIX,bkt.OKXCONNECTOR_TON_KEY),this.bridgeConnectionStorage=new Mkt.BridgeConnectionStorage(this.storage)} - get connected(){ - return null!==this._wallet} - get account(){ - var t; - return(null===(t=this._wallet)||void 0===t?void 0:t.account)||null} - get wallet(){ - return this._wallet} - set wallet(t){ - this._wallet=t,this.statusChangeSubscriptions.forEach(t=>t(this._wallet))} - connect(t){ - return fkt(this,void 0,void 0,function*(){ - var i; - return(0,gkt.logDebug)("ton-Connect ==>> connect_1 >> request:",t),this.connected&&(0,gkt.logError)("It's already connected to OKX Wallet, please call disconnect() first"),yield null===(i=this.provider)||void 0===i?void 0:i.closeConnection(!1,!0),this.provider||(this.provider=new wkt.BridgeProvider(this.storage,this.dappSettings.metaData.name,this.connectors)),this.provider.listen(this.walletEventsListener.bind(this)),this.tracker.trackConnectionStarted(),yield this.provider.connect(this.createConnectRequest(t),null==t?void 0:t.redirect,null==t?void 0:t.openUniversalLink,null==t?void 0:t.tmaReturnUrl,null==t?void 0:t.connectWalletType)} - )} - walletEventsListener(t){ - switch((0,gkt.logDebug)("ton-Connect ==>> walletEventsListener_1 >> e:",t),t.event){ - case"connect":this.onWalletConnected(t.payload); - break; - case"connect_error":this.onWalletConnectError(t.payload); - break; - case"disconnect":this.onWalletDisconnected("wallet")} - } - onWalletConnected(t){ - (0,gkt.logDebug)("ton-Connect ==>> onWalletConnected_1 >> connectEvent:",t); - const i=t.items.find(t=>"ton_addr"===t.name),s=t.items.find(t=>"ton_proof"===t.name); - if(!i)throw new gkt.OKXConnectError(gkt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"ton_addr connection item was not found"); - const e={ - device:t.device,provider:this.provider.type,account:{ - address:i.address,chain:i.network,walletStateInit:i.walletStateInit,publicKey:i.publicKey} - } - ; - s&&(e.connectItems={ - tonProof:s} - ),this.wallet=e,(0,gkt.logDebug)("ton-Connect ==>> onWalletConnected_2 >> wallet:",e),this.tracker.trackConnectionCompleted(e)} - onWalletConnectError(t){ - var i; - (0,gkt.logDebug)("ton-Connect ==>> onWalletConnectError_1 >> connectEventError:",t); - const s=new gkt.OKXConnectError(t.code,t.message); - (0,gkt.logDebug)("ton-Connect ==>> onWalletConnectError_1 >> error:",s),this.statusChangeErrorSubscriptions.forEach(t=>t(s)),this.tracker.trackConnectionError(null!==(i=t.message)&&void 0!==i?i:"",t.code)} - onWalletDisconnected(t){ - this.tracker.trackDisconnection(this.wallet,t),this.wallet=null} - disconnect(){ - return fkt(this,void 0,void 0,function*(){ - var t; - if((0,gkt.logDebug)("ton-Connect ==>> disconnect_1"),!this.connected)throw new gkt.OKXConnectError(gkt.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR,"wallet is not connected"); - (0,gkt.logDebug)("ton-Connect ==>> disconnect_222"),this.onWalletDisconnected("dapp"),yield null===(t=this.provider)||void 0===t?void 0:t.disconnect()} - )} - onStatusChange(t,i){ - return this.statusChangeSubscriptions.push(t),i&&this.statusChangeErrorSubscriptions.push(i),()=>{ - this.statusChangeSubscriptions=this.statusChangeSubscriptions.filter(i=>i!==t),i&&(this.statusChangeErrorSubscriptions=this.statusChangeErrorSubscriptions.filter(t=>t!==i))} - } - restoreConnection(){ - return fkt(this,void 0,void 0,function*(){ - var t; - (0,gkt.logDebug)("ton-Connect ==>> restoreConnection_1"),this.tracker.trackConnectionRestoringStarted(); - let i=null; - try{ - i=yield wkt.BridgeProvider.fromStorage(this.storage,this.dappSettings.metaData.name,this.connectors)} - catch(s){ - return this.tracker.trackConnectionRestoringError("Provider is not restored"),yield this.bridgeConnectionStorage.removeConnection(),null==i||i.closeConnection(),void(i=null)} - if(!i)return(0,gkt.logError)("Provider is not restored"),void this.tracker.trackConnectionRestoringError("Provider is not restored"); - (0,gkt.logDebug)("ton-Connect ==>> restoreConnection_2 ==>> Provider is restored "),null===(t=this.provider)||void 0===t||t.closeConnection(!0,!1),this.provider=i,i.listen(this.walletEventsListener.bind(this)),yield this.provider.restoreConnection(),this.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):this.tracker.trackConnectionRestoringError("Connection restoring failed")} - )} - sendTransaction(t,i){ - return fkt(this,void 0,void 0,function*(){ - var s; - (0,gkt.logDebug)("ton-Connect ==>> sendTransaction_1",t),this.checkConnection(),(0,mkt.checkSendTransactionSupport)(this.wallet.device.features,{ - requiredMessagesNumber:t.messages.length} - ),this.tracker.trackTransactionSentForSignature(this.wallet,t),(0,gkt.logDebug)("ton-Connect ==>> sendTransaction_2 ==>> check params"); - const{ - validUntil:e} - =t,n=pkt(t,["validUntil"]),h=t.from||this.account.address; - let r=this.account.chain; - (0,gkt.logDebug)("ton-Connect ==>> sendTransaction_2 ==>> await sendRequest",r),(0,gkt.isIos)()&&!(null==i?void 0:i.doNotOpenWallet)&&(null===(s=this.provider)||void 0===s||s.openOKXWallet()); - const o=yield this.provider.sendRequest(_kt.sendTransactionParser.convertToRpcRequest(Object.assign(Object.assign({ - } - ,n),{ - valid_until:e,from:h,network:r} - )),{ - onRequestSent:Qt(()=>{ - var t,s; - (0,gkt.isIos)()||(null==i?void 0:i.doNotOpenWallet)||null===(t=this.provider)||void 0===t||t.openOKXWallet(),null===(s=null==i?void 0:i.onRequestSent)||void 0===s||s.call(i)} - ,"onRequestSent")} - ); - if((0,gkt.logDebug)("ton-Connect ==>> sendTransaction_3 ==>>sendRequest response:",o),_kt.sendTransactionParser.isError(o))throw this.tracker.trackTransactionSigningFailed(this.wallet,t,o.error.message,o.error.code),new gkt.OKXConnectError(o.error.code,o.error.message); - const a=_kt.sendTransactionParser.convertFromRpcResponse(o); - return this.tracker.trackTransactionSigned(this.wallet,t,a),a} - )} - checkConnection(){ - if((0,gkt.logDebug)("ton-Connect ==>> checkConnection"),!this.connected)throw new gkt.OKXConnectError(gkt.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR,"Wallet not connected")} - createConnectRequest(t){ - (0,gkt.logDebug)("ton-Connect ==>> createConnectRequest"); - const i={ - ton_addr:{ - name:"ton_addr"} - } - ; - return(null==t?void 0:t.tonProof)&&(i.ton_proof={ - name:"ton_proof",payload:t.tonProof} - ),{ - dappInfo:this.dappSettings.metaData,params:i} - } - static getWallets(){ - return this.walletsList} - } - ; - Qt(ykt,"OKXTonConnectInner"); - let Ekt=ykt; - lIt.OKXTonConnectInner=Ekt,Ekt.walletsList=[(0,gkt.creatOKXWalletInfo)()]; - var Akt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(cIt,"__esModule",{ - value:!0} - ),cIt.OKXTonConnect=void 0; - const Skt=Mgt,Tkt=lIt,Ckt=class{ - constructor(t){ - try{ - (0,Skt.logDebug)("OKXTonConnect constructor called"),window&&window.okxConnectTonsdkinwindow&&window.okxConnectTonsdkinwindow instanceof Tkt.OKXTonConnectInner?(this.tonInner=window.okxConnectTonsdkinwindow,(0,Skt.logDebug)("OKXTonConnect constructor old called")):(this.tonInner=new Tkt.OKXTonConnectInner(t),(0,Skt.logDebug)("OKXTonConnect constructor new called"),window&&(window.okxConnectTonsdkinwindow=this.tonInner))} - catch(i){ - throw i} - } - get connected(){ - return this.tonInner.connected} - get openUniversalLink(){ - return this.tonInner.openUniversalLink} - get provider(){ - return this.tonInner.provider} - get account(){ - return this.tonInner.account} - get wallet(){ - return this.tonInner.wallet} - set wallet(t){ - this.tonInner.wallet=t} - connect(t){ - return Akt(this,void 0,void 0,function*(){ - return this.tonInner.connect(t)} - )} - disconnect(){ - return Akt(this,void 0,void 0,function*(){ - return this.tonInner.disconnect()} - )} - onStatusChange(t,i){ - return this.tonInner.onStatusChange(t,i)} - restoreConnection(){ - return Akt(this,void 0,void 0,function*(){ - return this.tonInner.restoreConnection()} - )} - sendTransaction(t,i){ - return Akt(this,void 0,void 0,function*(){ - return this.tonInner.sendTransaction(t,i)} - )} - static getWallets(){ - return Tkt.OKXTonConnectInner.getWallets()} - } - ; - Qt(Ckt,"OKXTonConnect"); - let Okt=Ckt; - cIt.OKXTonConnect=Okt; - var Ikt,kkt,xkt={ - } - ,Rkt={ - } - ; - Object.defineProperty(Rkt,"__esModule",{ - value:!0} - ),Rkt.OKX_TON_CONNECTION_AND_TRANSACTION_EVENT=void 0,(kkt=Ikt||(Rkt.OKX_TON_CONNECTION_AND_TRANSACTION_EVENT=Ikt={ - } - )).OKX_TON_CONNECTION_STARTED="okx-ton-connect-connection-started",kkt.OKX_TON_CONNECTION_COMPLETED="okx-ton-connect-connection-completed",kkt.OKX_TON_CONNECTION_ERROR="okx-ton-connect-connection-error",kkt.OKX_TON_CONNECTION_RESTORING_STARTED="okx-ton-connect-connection-restoring-started",kkt.OKX_TON_CONNECTION_RESTORING_COMPLETED="okx-ton-connect-connection-restoring-completed",kkt.OKX_TON_CONNECTION_RESTORING_ERROR="okx-ton-connect-connection-restoring-error",kkt.OKX_TON_DISCONNECTION="okx-ton-connect-disconnection",kkt.OKX_TON_TRANSACTION_SENT_FOR_SIGNATURE="okx-ton-connect-transaction-sent-for-signature",kkt.OKX_TON_TRANSACTION_SIGNED="okx-ton-connect-transaction-signed",kkt.OKX_TON_TRANSACTION_SIGNING_FAILED="okx-ton-connect-transaction-signing-failed",function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.BrowserEventDispatcher=t.createVersionInfo=t.createTransactionSigningFailedEvent=t.createTransactionSignedEvent=t.createTransactionSentForSignatureEvent=t.createDisconnectionEvent=t.createConnectionStartedEvent=t.createConnectionRestoringStartedEvent=t.createConnectionRestoringErrorEvent=t.createConnectionRestoringCompletedEvent=t.createConnectionErrorEvent=t.createConnectionCompletedEvent=t.createResponseVersionEvent=t.createRequestVersionEvent=t.OKX_TON_CONNECTION_AND_TRANSACTION_EVENT=void 0; - var i=Rkt; - Object.defineProperty(t,"OKX_TON_CONNECTION_AND_TRANSACTION_EVENT",{ - enumerable:!0,get:Qt(function(){ - return i.OKX_TON_CONNECTION_AND_TRANSACTION_EVENT} - ,"get")} - ); - var s=bIt; - Object.defineProperty(t,"createRequestVersionEvent",{ - enumerable:!0,get:Qt(function(){ - return s.createRequestVersionEvent} - ,"get")} - ),Object.defineProperty(t,"createResponseVersionEvent",{ - enumerable:!0,get:Qt(function(){ - return s.createResponseVersionEvent} - ,"get")} - ),Object.defineProperty(t,"createConnectionCompletedEvent",{ - enumerable:!0,get:Qt(function(){ - return s.createConnectionCompletedEvent} - ,"get")} - ),Object.defineProperty(t,"createConnectionErrorEvent",{ - enumerable:!0,get:Qt(function(){ - return s.createConnectionErrorEvent} - ,"get")} - ),Object.defineProperty(t,"createConnectionRestoringCompletedEvent",{ - enumerable:!0,get:Qt(function(){ - return s.createConnectionRestoringCompletedEvent} - ,"get")} - ),Object.defineProperty(t,"createConnectionRestoringErrorEvent",{ - enumerable:!0,get:Qt(function(){ - return s.createConnectionRestoringErrorEvent} - ,"get")} - ),Object.defineProperty(t,"createConnectionRestoringStartedEvent",{ - enumerable:!0,get:Qt(function(){ - return s.createConnectionRestoringStartedEvent} - ,"get")} - ),Object.defineProperty(t,"createConnectionStartedEvent",{ - enumerable:!0,get:Qt(function(){ - return s.createConnectionStartedEvent} - ,"get")} - ),Object.defineProperty(t,"createDisconnectionEvent",{ - enumerable:!0,get:Qt(function(){ - return s.createDisconnectionEvent} - ,"get")} - ),Object.defineProperty(t,"createTransactionSentForSignatureEvent",{ - enumerable:!0,get:Qt(function(){ - return s.createTransactionSentForSignatureEvent} - ,"get")} - ),Object.defineProperty(t,"createTransactionSignedEvent",{ - enumerable:!0,get:Qt(function(){ - return s.createTransactionSignedEvent} - ,"get")} - ),Object.defineProperty(t,"createTransactionSigningFailedEvent",{ - enumerable:!0,get:Qt(function(){ - return s.createTransactionSigningFailedEvent} - ,"get")} - ),Object.defineProperty(t,"createVersionInfo",{ - enumerable:!0,get:Qt(function(){ - return s.createVersionInfo} - ,"get")} - ); - var e=UIt; - Object.defineProperty(t,"BrowserEventDispatcher",{ - enumerable:!0,get:Qt(function(){ - return e.BrowserEventDispatcher} - ,"get")} - )} - (xkt); - var Pkt={ - } - ,Nkt={ - } - ; - function Lkt(t){ - return"/"===t.slice(-1)?t.slice(0,-1):t} - function Dkt(t,i){ - return Lkt(t)+"/"+i} - Object.defineProperty(Nkt,"__esModule",{ - value:!0} - ),Nkt.removeUrlLastSlash=Lkt,Nkt.addPathToUrl=Dkt,Qt(Lkt,"removeUrlLastSlash"),Qt(Dkt,"addPathToUrl"); - var Gkt={ - } - ; - Object.defineProperty(Gkt,"__esModule",{ - value:!0} - ),Gkt.toUserFriendlyAddress=$kt; - const Bkt=Mgt,Ukt=81,Fkt=128; - function $kt(t,i=!1){ - const{ - wc:s,hex:e} - =Hkt(t); - let n=Ukt; - i&&(n|=Fkt); - const h=new Int8Array(34); - h[0]=n,h[1]=s,h.set(e,2); - const r=new Uint8Array(36); - return r.set(h),r.set(Wkt(h),34),(0,Bkt.base64encode)(r,!1).replace(/\+/g,"-").replace(/\//g,"_")} - function Hkt(t){ - if(!t.includes(":"))throw new Error(`Wrong address ${ - t} - . Address must include ":".`); - const i=t.split(":"); - if(2!==i.length)throw new Error(`Wrong address ${ - t} - . Address must include ":" only once.`); - const s=parseInt(i[0]); - if(0!==s&&-1!==s)throw new Error(`Wrong address ${ - t} - . WC must be eq 0 or -1, but ${ - s} - received.`); - const e=i[1]; - if(64!==(null==e?void 0:e.length))throw new Error(`Wrong address ${ - t} - . Hex part must be 64bytes length, but ${ - null==e?void 0:e.length} - received.`); - return{ - wc:s,hex:jkt(e)} - } - function Wkt(t){ - let i=0; - const s=new Uint8Array(t.length+2); - s.set(t); - for(let e of s){ - let t=128; - for(; - t>0; - )i<<=1,e&t&&(i+=1),t>>=1,i>65535&&(i&=65535,i^=4129)} - return new Uint8Array([Math.floor(i/256),i%256])} - Qt($kt,"toUserFriendlyAddress"),Qt(Hkt,"parseHexAddress"),Qt(Wkt,"crc16"); - const Vkt={ - } - ; - for(let Set=0; - Set<=255; - Set++){ - let t=Set.toString(16); - t.length<2&&(t="0"+t),Vkt[t]=Set} - function jkt(t){ - const i=(t=t.toLowerCase()).length; - if(i%2!=0)throw new Error("Hex string must have length a multiple of 2: "+t); - const s=i/2,e=new Uint8Array(s); - for(let n=0; - n<s; - n++){ - const i=2*n,s=t.substring(i,i+2); - if(!Vkt.hasOwnProperty(s))throw new Error("Invalid hex character: "+s); - e[n]=Vkt[s]} - return e} - Qt(jkt,"hexToBytes"),function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.toUserFriendlyAddress=t.removeUrlLastSlash=t.addPathToUrl=void 0; - var i=Nkt; - Object.defineProperty(t,"addPathToUrl",{ - enumerable:!0,get:Qt(function(){ - return i.addPathToUrl} - ,"get")} - ),Object.defineProperty(t,"removeUrlLastSlash",{ - enumerable:!0,get:Qt(function(){ - return i.removeUrlLastSlash} - ,"get")} - ); - var s=Gkt; - Object.defineProperty(t,"toUserFriendlyAddress",{ - enumerable:!0,get:Qt(function(){ - return s.toUserFriendlyAddress} - ,"get")} - )} - (Pkt),function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.toUserFriendlyAddress=t.removeUrlLastSlash=t.addPathToUrl=t.createVersionInfo=t.BrowserEventDispatcher=t.createTransactionSigningFailedEvent=t.createTransactionSignedEvent=t.createTransactionSentForSignatureEvent=t.createDisconnectionEvent=t.createConnectionStartedEvent=t.createConnectionRestoringStartedEvent=t.createConnectionRestoringErrorEvent=t.createConnectionRestoringCompletedEvent=t.createConnectionErrorEvent=t.createConnectionCompletedEvent=t.createResponseVersionEvent=t.createRequestVersionEvent=t.OKX_TON_CONNECTION_AND_TRANSACTION_EVENT=t.OKXTonConnect=void 0; - var e=cIt; - Object.defineProperty(t,"OKXTonConnect",{ - enumerable:!0,get:Qt(function(){ - return e.OKXTonConnect} - ,"get")} - ),s(Mgt,t); - var n=xkt; - Object.defineProperty(t,"OKX_TON_CONNECTION_AND_TRANSACTION_EVENT",{ - enumerable:!0,get:Qt(function(){ - return n.OKX_TON_CONNECTION_AND_TRANSACTION_EVENT} - ,"get")} - ),Object.defineProperty(t,"createRequestVersionEvent",{ - enumerable:!0,get:Qt(function(){ - return n.createRequestVersionEvent} - ,"get")} - ),Object.defineProperty(t,"createResponseVersionEvent",{ - enumerable:!0,get:Qt(function(){ - return n.createResponseVersionEvent} - ,"get")} - ),Object.defineProperty(t,"createConnectionCompletedEvent",{ - enumerable:!0,get:Qt(function(){ - return n.createConnectionCompletedEvent} - ,"get")} - ),Object.defineProperty(t,"createConnectionErrorEvent",{ - enumerable:!0,get:Qt(function(){ - return n.createConnectionErrorEvent} - ,"get")} - ),Object.defineProperty(t,"createConnectionRestoringCompletedEvent",{ - enumerable:!0,get:Qt(function(){ - return n.createConnectionRestoringCompletedEvent} - ,"get")} - ),Object.defineProperty(t,"createConnectionRestoringErrorEvent",{ - enumerable:!0,get:Qt(function(){ - return n.createConnectionRestoringErrorEvent} - ,"get")} - ),Object.defineProperty(t,"createConnectionRestoringStartedEvent",{ - enumerable:!0,get:Qt(function(){ - return n.createConnectionRestoringStartedEvent} - ,"get")} - ),Object.defineProperty(t,"createConnectionStartedEvent",{ - enumerable:!0,get:Qt(function(){ - return n.createConnectionStartedEvent} - ,"get")} - ),Object.defineProperty(t,"createDisconnectionEvent",{ - enumerable:!0,get:Qt(function(){ - return n.createDisconnectionEvent} - ,"get")} - ),Object.defineProperty(t,"createTransactionSentForSignatureEvent",{ - enumerable:!0,get:Qt(function(){ - return n.createTransactionSentForSignatureEvent} - ,"get")} - ),Object.defineProperty(t,"createTransactionSignedEvent",{ - enumerable:!0,get:Qt(function(){ - return n.createTransactionSignedEvent} - ,"get")} - ),Object.defineProperty(t,"createTransactionSigningFailedEvent",{ - enumerable:!0,get:Qt(function(){ - return n.createTransactionSigningFailedEvent} - ,"get")} - ),Object.defineProperty(t,"BrowserEventDispatcher",{ - enumerable:!0,get:Qt(function(){ - return n.BrowserEventDispatcher} - ,"get")} - ),Object.defineProperty(t,"createVersionInfo",{ - enumerable:!0,get:Qt(function(){ - return n.createVersionInfo} - ,"get")} - ); - var h=Pkt; - Object.defineProperty(t,"addPathToUrl",{ - enumerable:!0,get:Qt(function(){ - return h.addPathToUrl} - ,"get")} - ),Object.defineProperty(t,"removeUrlLastSlash",{ - enumerable:!0,get:Qt(function(){ - return h.removeUrlLastSlash} - ,"get")} - ),Object.defineProperty(t,"toUserFriendlyAddress",{ - enumerable:!0,get:Qt(function(){ - return h.toUserFriendlyAddress} - ,"get")} - )} - (aIt); - var Kkt={ - exports:{ - } - } - ; - !function(t){ - !function(){ - var i={ - } - .hasOwnProperty; - function s(){ - for(var t="",i=0; - i<arguments.length; - i++){ - var s=arguments[i]; - s&&(t=n(t,e(s)))} - return t} - function e(t){ - if("string"==typeof t||"number"==typeof t)return t; - if("object"!=typeof t)return""; - if(Array.isArray(t))return s.apply(null,t); - if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString(); - var e=""; - for(var h in t)i.call(t,h)&&t[h]&&(e=n(e,h)); - return e} - function n(t,i){ - return i?t?t+" "+i:t+i:t} - Qt(s,"classNames"),Qt(e,"parseValue"),Qt(n,"appendClass"),t.exports?(s.default=s,t.exports=s):window.classNames=s} - ()} - (Kkt); - const zkt=wi(Kkt.exports); - var Ykt=Qt(function(t){ - return qkt(t)&&!Xkt(t)} - ,"isMergeableObject"); - function qkt(t){ - return!!t&&"object"==typeof t} - function Xkt(t){ - var i=Object.prototype.toString.call(t); - return"[object RegExp]"===i||"[object Date]"===i||Qkt(t)} - Qt(qkt,"isNonNullObject"),Qt(Xkt,"isSpecial"); - var Jkt="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103; - function Qkt(t){ - return t.$$typeof===Jkt} - function Zkt(t){ - return Array.isArray(t)?[]:{ - } - } - function txt(t,i){ - return!1!==i.clone&&i.isMergeableObject(t)?axt(Zkt(t),t,i):t} - function ixt(t,i,s){ - return t.concat(i).map(function(t){ - return txt(t,s)} - )} - function sxt(t,i){ - if(!i.customMerge)return axt; - var s=i.customMerge(t); - return"function"==typeof s?s:axt} - function ext(t){ - return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(i){ - return Object.propertyIsEnumerable.call(t,i)} - ):[]} - function nxt(t){ - return Object.keys(t).concat(ext(t))} - function hxt(t,i){ - try{ - return i in t} - catch(s){ - return!1} - } - function rxt(t,i){ - return hxt(t,i)&&!(Object.hasOwnProperty.call(t,i)&&Object.propertyIsEnumerable.call(t,i))} - function oxt(t,i,s){ - var e={ - } - ; - return s.isMergeableObject(t)&&nxt(t).forEach(function(i){ - e[i]=txt(t[i],s)} - ),nxt(i).forEach(function(n){ - rxt(t,n)||(hxt(t,n)&&s.isMergeableObject(i[n])?e[n]=sxt(n,s)(t[n],i[n],s):e[n]=txt(i[n],s))} - ),e} - function axt(t,i,s){ - (s=s||{ - } - ).arrayMerge=s.arrayMerge||ixt,s.isMergeableObject=s.isMergeableObject||Ykt,s.cloneUnlessOtherwiseSpecified=txt; - var e=Array.isArray(i); - return e===Array.isArray(t)?e?s.arrayMerge(t,i,s):oxt(t,i,s):txt(i,s)} - Qt(Qkt,"isReactElement"),Qt(Zkt,"emptyTarget"),Qt(txt,"cloneUnlessOtherwiseSpecified"),Qt(ixt,"defaultArrayMerge"),Qt(sxt,"getMergeFunction"),Qt(ext,"getEnumerableOwnPropertySymbols"),Qt(nxt,"getKeys"),Qt(hxt,"propertyIsOnObject"),Qt(rxt,"propertyIsUnsafe"),Qt(oxt,"mergeObject"),Qt(axt,"deepmerge"),axt.all=Qt(function(t,i){ - if(!Array.isArray(t))throw new Error("first argument should be an array"); - return t.reduce(function(t,s){ - return axt(t,s,i)} - ,{ - } - )} - ,"deepmergeAll"); - const cxt=wi(axt); - var lxt={ - } - ,uxt={ - } - ,dxt={ - } - ; - Object.defineProperty(dxt,"__esModule",{ - value:!0} - ),dxt.IJSONRpcProvider=dxt.IJSONRpcConnection=void 0; - const fxt=class{ - } - ; - Qt(fxt,"IJSONRpcConnection"); - let pxt=fxt; - dxt.IJSONRpcConnection=pxt; - const wxt=class{ - constructor(t){ - } - } - ; - Qt(wxt,"IJSONRpcProvider"); - let gxt=wxt; - dxt.IJSONRpcProvider=gxt; - var mxt={ - } - ; - Object.defineProperty(mxt,"__esModule",{ - value:!0} - ),function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),s(dxt,t),s(mxt,t)} - (uxt); - var vxt={ - } - ,_xt={ - } - ,Mxt={ - } - ,bxt={ - } - ,yxt={ - } - ,Ext={ - } - ; - Object.defineProperty(Ext,"__esModule",{ - value:!0} - ),Ext.getRpcUrl=Sxt,Ext.getChainId=Txt,Ext.fromAccountToAddress=Cxt,Ext.convertChainIdToNumber=Oxt,Ext.parseChainId=kxt,Ext.mergeArrays=xxt,Ext.syncAddressAvailable=Rxt,Ext.syncAddressHostAvailable=Pxt; - const Axt=Mgt; - function Sxt(t,i,s){ - var e; - const n=kxt(t); - return(null===(e=i.rpcMap)||void 0===e?void 0:e[n.reference])||""} - function Txt(t){ - return t.includes(":")?t.split(":")[1]:t} - function Cxt(t){ - if(!t)return""; - try{ - let i=t.split(":").slice(2),s=i.length>0?i.join(":"):""; - return(0,Axt.logDebug)("fromAccountToAddress address and account:",s,t),s} - catch(frt){ - return(0,Axt.logError)("fromAccountToAddress error:",t),""} - } - function Oxt(t){ - return"number"==typeof t?t:t.includes("0x")?parseInt(t,16):(t=t.includes(":")?t.split(":")[1]:t,isNaN(Number(t))?t:Number(t))} - Qt(Sxt,"getRpcUrl"),Qt(Txt,"getChainId"),Qt(Cxt,"fromAccountToAddress"),Qt(Oxt,"convertChainIdToNumber"); - const Ixt=":"; - function kxt(t){ - const[i,s]=t.split(Ixt); - return{ - namespace:i,reference:s} - } - function xxt(t=[],i=[]){ - return[...new Set([...t,...i])]} - function Rxt(t){ - return!!t&&"OKX Wallet"===t.appName&&!((0,Axt.versionCompare)("6.97.0",t.appVersion)>0)&&Pxt()} - function Pxt(){ - try{ - return!!window.okxGlobal} - catch(frt){ - return!1} - } - Qt(kxt,"parseChainId"),Qt(xxt,"mergeArrays"),Qt(Rxt,"syncAddressAvailable"),Qt(Pxt,"syncAddressHostAvailable"); - var Nxt={ - } - ; - Object.defineProperty(Nxt,"__esModule",{ - value:!0} - ),Nxt.setGlobal=Nxt.getGlobal=void 0; - const Lxt={ - } - ,Dxt=Qt(t=>Lxt[t],"getGlobal$1"); - Nxt.getGlobal=Dxt; - const Gxt=Qt((t,i)=>{ - Lxt[t]=i} - ,"setGlobal"); - Nxt.setGlobal=Gxt,function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),s(Ext,t),s(Nxt,t)} - (yxt),function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),s(uxt,t),s(yxt,t)} - (bxt),function(t){ - var i=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ,s=pi&&pi.__importDefault||function(t){ - return t&&t.__esModule?t:{ - default:t} - } - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.connectSupportMethods=void 0,t.creatNotSupportMethodItemReplay=a,t.isMobileDiscover=c,t.connectMethodsAdaptOldVersion=l,t.connectMethodsResponseUpdate=u,t.connectMethodsToConnectWalletMethods=d,t.syncResoonseToRequire=p; - const e=Mgt,n=s(CCt),h=bxt; - function r(t){ - return"object"==typeof t&&null!==t&&Array.isArray(t)} - function o(t){ - return"object"==typeof t&&null!==t&&!Array.isArray(t)} - function a(t){ - let i=new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED); - return{ - method:t.method,chainId:t.chainId,error:{ - code:i.code,message:i.message} - } - } - function c(){ - return!!window.okxwallet&&window.okxwallet.mobileDiscoverWallet} - function l(t,s){ - return i(this,void 0,void 0,function*(){ - var i,r,o,a,c; - try{ - (0,e.logDebug)("connectMethodsAdaptOldVersion start params :",JSON.stringify(t)); - let u={ - } - ; - if("solana_signMessage"===t.method){ - let o=null===(i=s.namespaces[e.NameSpaceKeySOL])||void 0===i?void 0:i.accounts.filter(function(i){ - return i.startsWith(t.chainId)} - )[0]; - const a=(0,h.fromAccountToAddress)(o); - if(t.params&&a&&"message"in t.params){ - let i=t.params.message; - if("OKX Wallet"==(null===(r=s.wallet)||void 0===r?void 0:r.appName)){ - let t=(new TextEncoder).encode(i); - i=n.default.encode(t)} - return t.params={ - message:i,pubkey:a} - ,t.injectParams=t.params,u={ - publicKey:a} - ,(0,e.logDebug)("solana_signMessage account and address:",JSON.stringify(o),a),(0,e.logDebug)("solana_signMessage callBackParams:",JSON.stringify(u)),u} - throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED)} - if("sui_signMessage"===t.method||"sui_signPersonalMessage"===t.method){ - if("message"in t.params&&t.params.message){ - let i=JSON.parse(JSON.stringify(t.params.message)),s=Object.values(i),n=new Uint8Array(s),h=new TextDecoder("utf8"),r=btoa(h.decode(n)); - return t.params={ - message:atob(r)} - ,t.injectParams={ - message:n} - ,"sui_signMessage"===t.method?u={ - messageBytes:r,signature:""} - :"sui_signPersonalMessage"===t.method&&(u={ - bytes:r,signature:""} - ),(0,e.logDebug)("sui_signMessage/sui_signPersonalMessage callBackParams:",JSON.stringify(u)),u} - throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED)} - if("btc_signMessage"===t.method){ - let i=(null===(o=s.namespaces[e.NameSpaceKeyBtc])||void 0===o?void 0:o.accounts.filter(function(i){ - return i.startsWith(t.chainId)} - ))[0]; - const n=(0,h.fromAccountToAddress)(i); - if((0,e.logDebug)("btc_signMessage account and address:",JSON.stringify(i),n),n){ - if(!("message"in t.params)||!t.params.message||"string"!=typeof t.params.message)throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED); - return t.params={ - from:n,signStr:t.params.message} - ,t.params.from=n,(0,e.logDebug)("btc_signMessage callBackParams:",JSON.stringify(u)),u} - throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED)} - if("aptos_signMessage"===t.method){ - let i=t.params,n=null===(a=s.namespaces[e.NameSpaceKeyAptos])||void 0===a?void 0:a.accounts.filter(function(i){ - return i.startsWith(t.chainId)} - )[0],r=(0,h.fromAccountToAddress)(n); - if(i&&r){ - let s="APTOS",n="",h=""; - var l=s; - let o=window.location.protocol+"//"+window.location.hostname; - "address"in i&&i.address&&(l+="\naddress: "+r),"application"in i&&i.application&&(l+="\napplication: "+o); - let a=1; - "chainId"in i&&i.chainId&&("aptos:mainnet"==i.chainId?a=1:"movement:testnet"==i.chainId&&(a=2),l+="\nchainId: "+a),"message"in i&&(l+="\nmessage: "+i.message,n=i.message),"nonce"in i&&(l+="\nnonce: "+i.nonce,h=i.nonce); - const c=(new TextEncoder).encode(l),d=Array.from(c).map(t=>t.toString(16).padStart(2,"0")).join(""); - return t.params={ - message:d} - ,t.injectParams=i,(0,e.logDebug)("aptos_signMessage requestParams:",JSON.stringify(t)),u={ - address:r,application:o,chainId:a,fullMessage:l,message:n,nonce:h,prefix:s,signature:""} - ,(0,e.logDebug)("aptos_signMessage callBackParams:",JSON.stringify(u)),u} - throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED)} - if("cosmos_signArbitrary"===t.method){ - let i=null===(c=null==s?void 0:s.namespaces[e.NameSpaceKeyCosmos])||void 0===c?void 0:c.accounts.filter(function(i){ - return i.startsWith(t.chainId)} - )[0]; - const n=(0,h.fromAccountToAddress)(i); - let r=t.params.message; - const o=btoa(r); - if((0,e.logDebug)("cosmos_signArbitrary account and address:",JSON.stringify(i),n),(0,e.logDebug)("cosmos_signArbitrary cosmosBase64Encoded:",o),r&&n){ - const i={ - chain_id:"",account_number:"0",sequence:"0",fee:{ - gas:"0",amount:[]} - ,msgs:[{ - type:"sign/MsgSignData",value:{ - signer:n,data:o} - } - ],memo:""} - ; - return t.params={ - signer:n,chain_id:t.chainId.split(":")[1],data:i} - ,(0,e.logDebug)("cosmos_signArbitrary callBackParams:",JSON.stringify(u)),u} - throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED)} - (0,e.logDebug)("sol_handleSignatureData end params:",JSON.stringify(t))} - catch(u){ - throw u} - } - )} - function u(t,s){ - return i(this,void 0,void 0,function*(){ - var i; - try{ - if(t.signResponse){ - (0,e.logDebug)("connectMethodsResponseUpdate signResponse:",JSON.stringify(t.signResponse)),(0,e.logDebug)("connectMethodsResponseUpdate session.namespaces:",JSON.stringify(t.namespaces)); - for(const r of t.signResponse)if((0,e.logDebug)("connectMethodsResponseUpdate methodItem:",JSON.stringify(r)),"result"in r)if("solana_signMessage"===r.method){ - let s=r.result; - (0,e.logDebug)("solana_signMessage methodItem.chainId:",r.chainId); - let o=null===(i=t.namespaces[e.NameSpaceKeySOL])||void 0===i?void 0:i.accounts.filter(function(t){ - return(0,e.logDebug)("solana_signMessage account:",t),t.startsWith(r.chainId)} - )[0]; - (0,e.logDebug)("solana_signMessage result account:",s,o),s&&o&&(r.result={ - signature:n.default.decode(s),publicKey:(0,h.fromAccountToAddress)(o)} - )} - else if("sui_signMessage"===r.method||"sui_signPersonalMessage"===r.method){ - let t=s.filter(function(t){ - return t.method===r.method} - )[0]; - if(t&&t.params&&"message"in t.params){ - let i=t.params.message,s=btoa(i); - "sui_signMessage"===r.method?r.result={ - messageBytes:s,signature:r.result} - :"sui_signPersonalMessage"===r.method&&(r.result={ - bytes:s,signature:r.result} - )} - } - else if("aptos_signMessage"===r.method){ - if(r.chainId=(0,e.replaceChainIdToChainName)(r.chainId),r.result=JSON.parse(r.result),r.result&&"signature"in r.result){ - let t=r.result.signature; - t&&t.startsWith("0x")&&(t=t.slice(2,t.length),r.result.signature=t)} - } - else if("cosmos_signArbitrary"===r.method)r.result=JSON.parse(r.result); - else if("starknet_signMessage"==r.method){ - let t=r.result; - "string"==typeof t&&(t=JSON.parse(t)),r.result=[t.signedDataR,t.signedDataS]} - else"sync_all_addresses"==r.method&&(r.result=p(r.result))} - } - catch(r){ - throw(0,e.logDebug)("connectMethodsResponseUpdate signResponse Error:",JSON.stringify(r)),r} - } - )} - function d(s,a){ - return i(this,void 0,void 0,function*(){ - try{ - (0,e.logDebug)("connectMethodsToConnectWalletMethods requestMethods:",JSON.stringify(s)); - const l=[]; - if(s&&s.length>1)throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"connectAndSign/openModalAndSign signRequest only support one data"); - if(!a&&s&&s.length>0)throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"Connect request params error , RequestMethods cannot be added when the NameSpace is empty"); - for(const t of s)if("aptos_signMessage"===t.method&&(t.chainId=(0,e.replaceChainNameToChainId)(t.chainId)),"wallet_addEthereumChain"===t.method){ - if(!(null==a?void 0:a.some(t=>t.namespace.includes("eip155"))))throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Connect request params error, When using '${ - t.method} - ', the EVM chain needs to be included in the NameSpace`)} - else if("sync_all_addresses"===t.method){ - if(!(0,h.syncAddressHostAvailable)())throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED); - t.chainId=""} - else if(!(null==a?void 0:a.some(i=>i.chains.some(i=>i.includes(`${ - t.chainId} - `)))))throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Connect request params error, When using '${ - t.method} - ', NameSpace must contain '${ - t.chainId} - '`); - for(const h of s){ - if(!t.connectSupportMethods.includes(h.method))throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect requestMethods not support method, method: '${ - h.method} - '`); - if("wallet_addEthereumChain"===h.method){ - if(Array.isArray(h.params)){ - const t=h.params; - if(!t||1!==t.length)throw t&&t.length>1?new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params only support one data, method: '${ - h.method} - '`):new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params is nil, method: '${ - h.method} - '`); - { - const i=t[0]; - o(i)&&(h.params=i)} - } - } - else if("personal_sign"===h.method){ - if(r(h.params)){ - if(h.params&&1!==h.params.length)throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params error, method: '${ - h.method} - ' `); - let t=h.params[0]; - if(!t||"string"!=typeof t)throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params is error, method: '${ - h.method} - ' `); - h.params={ - message:t} - } - } - else if("sui_signMessage"===h.method||"sui_signPersonalMessage"===h.method){ - if(!o(h.params)||!("message"in h.params))throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params is error, method: '${ - h.method} - ' `); - if(!h.params.message)throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params is error, method: '${ - h.method} - ' `); - { - (0,e.logDebug)("sui_signMessage item.params.message :",h.params.message); - let t=JSON.parse(JSON.stringify(h.params.message)),i=Object.values(t),s=new Uint8Array(i),n=new TextDecoder("utf8"),r=btoa(n.decode(s)); - h.params.message=atob(r)} - } - else if("solana_signMessage"===h.method){ - if(!o(h.params)||!("message"in h.params))throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params is error, method: '${ - h.method} - ' `); - if(!h.params.message||"string"!=typeof h.params.message)throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params is error, method: '${ - h.method} - ' `); - { - let t=(new TextEncoder).encode(h.params.message); - h.params.bs58Message=n.default.encode(t)} - } - else if("aptos_signMessage"===h.method){ - if(!o(h.params))throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params is error, method: '${ - h.method} - ' `); - if(!h.chainId)throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params chainId is error, method: '${ - h.method} - ' `); - { - var i=h.params,c=window.location.protocol+"//"+window.location.hostname; - let t=1; - "aptos:637"===h.chainId||"aptos:70000060"===h.chainId&&(t=2),h.params={ - data:i,applicationUrl:c,prefix:"APTOS",aptosChainId:t} - } - } - else if("cosmos_signArbitrary"===h.method){ - if(!o(h.params))throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params is error, method: '${ - h.method} - ' `); - if(!h.params.message||"string"!=typeof h.params.message)throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params message is error, method: '${ - h.method} - ' `); - { - const t=btoa(h.params.message); - let i=h.chainId.split(":")[1]; - if(!i)throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params chainId is error, method: '${ - h.method} - ' `); - h.params={ - chain_id:i,data:{ - chain_id:"",account_number:"0",sequence:"0",fee:{ - gas:"0",amount:[]} - ,msgs:[{ - type:"sign/MsgSignData",value:{ - signer:"",data:t} - } - ],memo:""} - } - } - } - else if("tron_signMessage"==h.method){ - if(!o(h.params))throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params is error, method: '${ - h.method} - ' `); - if(!("message"in h.params)||!h.params.message||"string"!=typeof h.params.message)throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params is error, method: '${ - h.method} - ' `); - h.params.message=f(h.params.message)} - else if("btc_signMessage"==h.method){ - if(!o(h.params))throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params is error, method: '${ - h.method} - ' `); - if(!("message"in h.params)||!h.params.message||"string"!=typeof h.params.message)throw new e.OKXConnectError(e.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`connect request params is error, method: '${ - h.method} - ' `); - h.params={ - signStr:h.params.message} - } - (0,e.logDebug)("connectMethodsToConnectWalletMethods item:",JSON.stringify(h)),l.push(h)} - return l} - catch(l){ - throw l} - } - )} - function f(t){ - let i=""; - for(let s=0; - s<t.length; - s++)i+=t.charCodeAt(s).toString(16).padStart(2,"0"); - return i} - function p(t){ - const i=JSON.parse(t); - return{ - type:i.type,isEvm:i.isEvm,walletName:i.walletName,deriveName:i.deriveName,addresses:i.addresses.map(t=>({ - coinId:t.ci,address:t.a&&"null"!==t.a?t.a:i.evmAddress} - ))} - } - Qt(r,"isArray"),Qt(o,"isRecord"),t.connectSupportMethods=Object.freeze(["personal_sign","sui_signMessage","sui_signPersonalMessage","btc_signMessage","aptos_signMessage","cosmos_signArbitrary","tron_signMessage","tron_signMessageV2","starknet_signMessage","sync_all_addresses"]),Qt(a,"creatNotSupportMethodItemReplay"),Qt(c,"isMobileDiscover"),Qt(l,"connectMethodsAdaptOldVersion"),Qt(u,"connectMethodsResponseUpdate"),Qt(d,"connectMethodsToConnectWalletMethods"),Qt(f,"stringToHex"),Qt(p,"syncResoonseToRequire")} - (Mxt),function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.isMobileDiscover=t.creatNotSupportMethodItemReplay=t.connectMethodsAdaptOldVersion=void 0; - var i=Mxt; - Object.defineProperty(t,"connectMethodsAdaptOldVersion",{ - enumerable:!0,get:Qt(function(){ - return i.connectMethodsAdaptOldVersion} - ,"get")} - ),Object.defineProperty(t,"creatNotSupportMethodItemReplay",{ - enumerable:!0,get:Qt(function(){ - return i.creatNotSupportMethodItemReplay} - ,"get")} - ),Object.defineProperty(t,"isMobileDiscover",{ - enumerable:!0,get:Qt(function(){ - return i.isMobileDiscover} - ,"get")} - )} - (_xt),function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),s(_xt,t)} - (vxt); - var Bxt={ - } - ,Uxt={ - } - ,Fxt={ - } - ,$xt={ - } - ; - !function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.GENERIC_SUBPROVIDER_NAME=t.RPC_URL=t.STORAGE=t.CONTEXT=t.WC_VERSION=t.PROTOCOL=t.RELAY_URL=t.LOGGER=void 0,t.LOGGER="error",t.RELAY_URL="wss://relay.walletconnect.com",t.PROTOCOL="wc",t.WC_VERSION=2,t.CONTEXT="universal_provider",t.STORAGE=`${ - t.PROTOCOL} - @${ - t.WC_VERSION} - :${ - t.CONTEXT} - :`,t.RPC_URL="https://rpc.walletconnect.com/v1/",t.GENERIC_SUBPROVIDER_NAME="generic"} - ($xt); - var Hxt={ - } - ; - Object.defineProperty(Hxt,"__esModule",{ - value:!0} - ),Hxt.PROVIDER_EVENTS=void 0,Hxt.PROVIDER_EVENTS={ - DEFAULT_CHAIN_CHANGED:"default_chain_changed",UPDATE_NAMESPACES:"update_name_spaces",SESSION_CONNECTING:"session_connecting"} - ,function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),s($xt,t),s(Hxt,t)} - (Fxt); - var Wxt={ - } - ,Vxt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(Wxt,"__esModule",{ - value:!0} - ),Wxt.JsonRpcProvider=void 0; - const jxt=MMt,Kxt=uxt,zxt=Mgt,Yxt=Mgt,qxt=class extends Kxt.IJSONRpcProvider{ - constructor(t){ - super(t),this.events=new jxt.EventEmitter,this.connected=!1,this.connecting=!1,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(t),this.connection.connected&&this.registerEventListeners()} - connect(){ - return Vxt(this,arguments,void 0,function*(t=this.connection){ - yield this.open(t)} - )} - disconnect(){ - return Vxt(this,void 0,void 0,function*(){ - yield this.close()} - )} - on(t,i){ - this.events.on(t,i)} - once(t,i){ - this.events.once(t,i)} - off(t,i){ - this.events.off(t,i)} - removeListener(t,i){ - this.events.removeListener(t,i)} - request(t,i){ - return Vxt(this,void 0,void 0,function*(){ - return this.requestStrict((0,zxt.formatJsonRpcRequest)(t.method,t.params||[],(0,zxt.getBigIntRpcId)().toString()),i)} - )} - requestStrict(t,i){ - return Vxt(this,void 0,void 0,function*(){ - return new Promise((s,e)=>Vxt(this,void 0,void 0,function*(){ - if(!this.connection.connected)try{ - yield this.open()} - catch(frt){ - e(frt)} - this.events.on(`${ - t.id} - `,t=>{ - (0,zxt.isJsonRpcError)(t)?e(t.error):s(t.result)} - ); - try{ - (0,Yxt.logDebug)("[RPC] >>> send request",t,i),yield this.connection.send(t,i)} - catch(frt){ - e(frt)} - } - ))} - )} - setConnection(t=this.connection){ - return t} - onPayload(t){ - this.events.emit("payload",t),(0,zxt.isJsonRpcResponse)(t)?this.events.emit(`${ - t.id} - `,t):this.events.emit("message",{ - type:t.method,data:t.params} - )} - onClose(t){ - t&&3e3===t.code&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${ - t.code} - ${ - t.reason?`(${ - t.reason} - )`:""} - `)),this.events.emit("disconnect")} - open(){ - return Vxt(this,arguments,void 0,function*(t=this.connection){ - this.connection===t&&this.connection.connected||(this.connection.connected&&this.close(),"string"==typeof t&&(yield this.connection.open(t),t=this.connection),this.connection=this.setConnection(t),yield this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))} - )} - close(){ - return Vxt(this,void 0,void 0,function*(){ - yield this.connection.close()} - )} - registerEventListeners(){ - this.hasRegisteredEventListeners||(this.connection.on("payload",t=>this.onPayload(t)),this.connection.on("close",t=>this.onClose(t)),this.connection.on("error",t=>this.events.emit("error",t)),this.connection.on("register_error",t=>this.onClose()),this.hasRegisteredEventListeners=!0)} - } - ; - Qt(qxt,"JsonRpcProvider"); - let Xxt=qxt; - Wxt.JsonRpcProvider=Xxt; - var Jxt={ - } - ,Qxt={ - exports:{ - } - } - ; - !function(t,i){ - var s,e="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==pi&&pi,n=function(){ - function t(){ - this.fetch=!1,this.DOMException=e.DOMException} - return Qt(t,"F"),t.prototype=e,new t} - (); - s=n,function(t){ - var i=void 0!==s&&s||"undefined"!=typeof self&&self||void 0!==pi&&pi||{ - } - ,e="URLSearchParams"in i,n="Symbol"in i&&"iterator"in Symbol,h="FileReader"in i&&"Blob"in i&&function(){ - try{ - return new Blob,!0} - catch(frt){ - return!1} - } - (),r="FormData"in i,o="ArrayBuffer"in i; - function a(t){ - return t&&DataView.prototype.isPrototypeOf(t)} - if(Qt(a,"isDataView"),o)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(t){ - return t&&c.indexOf(Object.prototype.toString.call(t))>-1} - ; - function u(t){ - if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"'); - return t.toLowerCase()} - function d(t){ - return"string"!=typeof t&&(t=String(t)),t} - function f(t){ - var i={ - next:Qt(function(){ - var i=t.shift(); - return{ - done:void 0===i,value:i} - } - ,"next")} - ; - return n&&(i[Symbol.iterator]=function(){ - return i} - ),i} - function p(t){ - this.map={ - } - ,t instanceof p?t.forEach(function(t,i){ - this.append(i,t)} - ,this):Array.isArray(t)?t.forEach(function(t){ - if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length); - this.append(t[0],t[1])} - ,this):t&&Object.getOwnPropertyNames(t).forEach(function(i){ - this.append(i,t[i])} - ,this)} - function w(t){ - if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)} - function g(t){ - return new Promise(function(i,s){ - t.onload=function(){ - i(t.result)} - ,t.onerror=function(){ - s(t.error)} - } - )} - function m(t){ - var i=new FileReader,s=g(i); - return i.readAsArrayBuffer(t),s} - function v(t){ - var i=new FileReader,s=g(i),e=/charset=([A-Za-z0-9_-]+)/.exec(t.type),n=e?e[1]:"utf-8"; - return i.readAsText(t,n),s} - function _(t){ - for(var i=new Uint8Array(t),s=new Array(i.length),e=0; - e<i.length; - e++)s[e]=String.fromCharCode(i[e]); - return s.join("")} - function M(t){ - if(t.slice)return t.slice(0); - var i=new Uint8Array(t.byteLength); - return i.set(new Uint8Array(t)),i.buffer} - function b(){ - return this.bodyUsed=!1,this._initBody=function(t){ - this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:h&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:r&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:e&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o&&h&&a(t)?(this._bodyArrayBuffer=M(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(t)||l(t))?this._bodyArrayBuffer=M(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain; - charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):e&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded; - charset=UTF-8"))} - ,h&&(this.blob=function(){ - var t=w(this); - if(t)return t; - if(this._bodyBlob)return Promise.resolve(this._bodyBlob); - if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer])); - if(this._bodyFormData)throw new Error("could not read FormData body as blob"); - return Promise.resolve(new Blob([this._bodyText]))} - ),this.arrayBuffer=function(){ - if(this._bodyArrayBuffer)return w(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)); - if(h)return this.blob().then(m); - throw new Error("could not read as ArrayBuffer")} - ,this.text=function(){ - var t=w(this); - if(t)return t; - if(this._bodyBlob)return v(this._bodyBlob); - if(this._bodyArrayBuffer)return Promise.resolve(_(this._bodyArrayBuffer)); - if(this._bodyFormData)throw new Error("could not read FormData body as text"); - return Promise.resolve(this._bodyText)} - ,r&&(this.formData=function(){ - return this.text().then(S)} - ),this.json=function(){ - return this.text().then(JSON.parse)} - ,this} - Qt(u,"normalizeName"),Qt(d,"normalizeValue"),Qt(f,"iteratorFor"),Qt(p,"Headers"),p.prototype.append=function(t,i){ - t=u(t),i=d(i); - var s=this.map[t]; - this.map[t]=s?s+", "+i:i} - ,p.prototype.delete=function(t){ - delete this.map[u(t)]} - ,p.prototype.get=function(t){ - return t=u(t),this.has(t)?this.map[t]:null} - ,p.prototype.has=function(t){ - return this.map.hasOwnProperty(u(t))} - ,p.prototype.set=function(t,i){ - this.map[u(t)]=d(i)} - ,p.prototype.forEach=function(t,i){ - for(var s in this.map)this.map.hasOwnProperty(s)&&t.call(i,this.map[s],s,this)} - ,p.prototype.keys=function(){ - var t=[]; - return this.forEach(function(i,s){ - t.push(s)} - ),f(t)} - ,p.prototype.values=function(){ - var t=[]; - return this.forEach(function(i){ - t.push(i)} - ),f(t)} - ,p.prototype.entries=function(){ - var t=[]; - return this.forEach(function(i,s){ - t.push([s,i])} - ),f(t)} - ,n&&(p.prototype[Symbol.iterator]=p.prototype.entries),Qt(w,"consumed"),Qt(g,"fileReaderReady"),Qt(m,"readBlobAsArrayBuffer"),Qt(v,"readBlobAsText"),Qt(_,"readArrayBufferAsText"),Qt(M,"bufferClone"),Qt(b,"Body"); - var y=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]; - function E(t){ - var i=t.toUpperCase(); - return y.indexOf(i)>-1?i:t} - function A(t,s){ - if(!(this instanceof A))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.'); - var e=(s=s||{ - } - ).body; - if(t instanceof A){ - if(t.bodyUsed)throw new TypeError("Already read"); - this.url=t.url,this.credentials=t.credentials,s.headers||(this.headers=new p(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,e||null==t._bodyInit||(e=t._bodyInit,t.bodyUsed=!0)} - else this.url=String(t); - if(this.credentials=s.credentials||this.credentials||"same-origin",!s.headers&&this.headers||(this.headers=new p(s.headers)),this.method=E(s.method||this.method||"GET"),this.mode=s.mode||this.mode||null,this.signal=s.signal||this.signal||function(){ - if("AbortController"in i)return(new AbortController).signal} - (),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&e)throw new TypeError("Body not allowed for GET or HEAD requests"); - if(this._initBody(e),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==s.cache&&"no-cache"!==s.cache)){ - var n=/([?&])_=[^&]*/; - n.test(this.url)?this.url=this.url.replace(n,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()} - } - function S(t){ - var i=new FormData; - return t.trim().split("&").forEach(function(t){ - if(t){ - var s=t.split("="),e=s.shift().replace(/\+/g," "),n=s.join("=").replace(/\+/g," "); - i.append(decodeURIComponent(e),decodeURIComponent(n))} - } - ),i} - function T(t){ - var i=new p; - return t.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(t){ - return 0===t.indexOf("\n")?t.substr(1,t.length):t} - ).forEach(function(t){ - var s=t.split(":"),e=s.shift().trim(); - if(e){ - var n=s.join(":").trim(); - try{ - i.append(e,n)} - catch(h){ - } - } - } - ),i} - function C(t,i){ - if(!(this instanceof C))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.'); - if(i||(i={ - } - ),this.type="default",this.status=void 0===i.status?200:i.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599]."); - this.ok=this.status>=200&&this.status<300,this.statusText=void 0===i.statusText?"":""+i.statusText,this.headers=new p(i.headers),this.url=i.url||"",this._initBody(t)} - Qt(E,"normalizeMethod"),Qt(A,"Request"),A.prototype.clone=function(){ - return new A(this,{ - body:this._bodyInit} - )} - ,Qt(S,"decode"),Qt(T,"parseHeaders"),b.call(A.prototype),Qt(C,"Response"),b.call(C.prototype),C.prototype.clone=function(){ - return new C(this._bodyInit,{ - status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url} - )} - ,C.error=function(){ - var t=new C(null,{ - status:200,statusText:""} - ); - return t.ok=!1,t.status=0,t.type="error",t} - ; - var O=[301,302,303,307,308]; - C.redirect=function(t,i){ - if(-1===O.indexOf(i))throw new RangeError("Invalid status code"); - return new C(null,{ - status:i,headers:{ - location:t} - } - )} - ,t.DOMException=i.DOMException; - try{ - new t.DOMException} - catch(h6i){ - t.DOMException=function(t,i){ - this.message=t,this.name=i; - var s=Error(t); - this.stack=s.stack} - ,t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException} - function I(s,e){ - return new Promise(function(n,r){ - var a=new A(s,e); - if(a.signal&&a.signal.aborted)return r(new t.DOMException("Aborted","AbortError")); - var c=new XMLHttpRequest; - function l(){ - c.abort()} - function f(t){ - try{ - return""===t&&i.location.href?i.location.href:t} - catch(frt){ - return t} - } - if(Qt(l,"abortXhr"),c.onload=function(){ - var t={ - statusText:c.statusText,headers:T(c.getAllResponseHeaders()||"")} - ; - 0===a.url.indexOf("file://")&&(c.status<200||c.status>599)?t.status=200:t.status=c.status,t.url="responseURL"in c?c.responseURL:t.headers.get("X-Request-URL"); - var i="response"in c?c.response:c.responseText; - setTimeout(function(){ - n(new C(i,t))} - ,0)} - ,c.onerror=function(){ - setTimeout(function(){ - r(new TypeError("Network request failed"))} - ,0)} - ,c.ontimeout=function(){ - setTimeout(function(){ - r(new TypeError("Network request timed out"))} - ,0)} - ,c.onabort=function(){ - setTimeout(function(){ - r(new t.DOMException("Aborted","AbortError"))} - ,0)} - ,Qt(f,"fixUrl"),c.open(a.method,f(a.url),!0),"include"===a.credentials?c.withCredentials=!0:"omit"===a.credentials&&(c.withCredentials=!1),"responseType"in c&&(h?c.responseType="blob":o&&(c.responseType="arraybuffer")),e&&"object"==typeof e.headers&&!(e.headers instanceof p||i.Headers&&e.headers instanceof i.Headers)){ - var w=[]; - Object.getOwnPropertyNames(e.headers).forEach(function(t){ - w.push(u(t)),c.setRequestHeader(t,d(e.headers[t]))} - ),a.headers.forEach(function(t,i){ - -1===w.indexOf(i)&&c.setRequestHeader(i,t)} - )} - else a.headers.forEach(function(t,i){ - c.setRequestHeader(i,t)} - ); - a.signal&&(a.signal.addEventListener("abort",l),c.onreadystatechange=function(){ - 4===c.readyState&&a.signal.removeEventListener("abort",l)} - ),c.send(void 0===a._bodyInit?null:a._bodyInit)} - )} - Qt(I,"fetch"),I.polyfill=!0,i.fetch||(i.fetch=I,i.Headers=p,i.Request=A,i.Response=C),t.Headers=p,t.Request=A,t.Response=C,t.fetch=I,Object.defineProperty(t,"__esModule",{ - value:!0} - )} - ({ - } - ),n.fetch.ponyfill=!0,delete n.fetch.polyfill; - var h=e.fetch?e:n; - (i=h.fetch).default=h.fetch,i.fetch=h.fetch,i.Headers=h.Headers,i.Request=h.Request,i.Response=h.Response,t.exports=i} - (Qxt,Qxt.exports); - var Zxt=Qxt.exports,tRt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ,iRt=pi&&pi.__importDefault||function(t){ - return t&&t.__esModule?t:{ - default:t} - } - ; - Object.defineProperty(Jxt,"__esModule",{ - value:!0} - ),Jxt.JsonRpcConnection=void 0; - const sRt=MMt,eRt=iRt(Zxt),nRt=Mgt,hRt=Mgt,rRt={ - headers:{ - Accept:"application/json","Content-Type":"application/json"} - ,method:"POST"} - ,oRt=class{ - constructor(t,i=!1){ - if(this.url=t,this.disableProviderPing=i,this.events=new sRt.EventEmitter,this.isAvailable=!1,this.registering=!1,!(0,hRt.isHttpUrl)(t))throw new Error(`Provided URL is not compatible with HTTP connection: ${ - t} - `); - this.url=t,this.disableProviderPing=i} - get connected(){ - return this.isAvailable} - get connecting(){ - return this.registering} - on(t,i){ - this.events.on(t,i)} - once(t,i){ - this.events.once(t,i)} - off(t,i){ - this.events.off(t,i)} - removeListener(t,i){ - this.events.removeListener(t,i)} - open(){ - return tRt(this,arguments,void 0,function*(t=this.url){ - yield this.register(t)} - )} - close(){ - return tRt(this,void 0,void 0,function*(){ - if(!this.isAvailable)throw new Error("Connection already closed"); - this.onClose()} - )} - send(t){ - return tRt(this,void 0,void 0,function*(){ - this.isAvailable||(yield this.register()); - try{ - const i=(0,nRt.safeJsonStringify)(t),s=yield(0,eRt.default)(this.url,Object.assign(Object.assign({ - } - ,rRt),{ - body:i} - )),e=yield s.json(); - this.onPayload({ - data:e} - )} - catch(frt){ - this.onError(t.id,frt)} - } - )} - register(){ - return tRt(this,arguments,void 0,function*(t=this.url){ - if(!(0,hRt.isHttpUrl)(t))throw new Error(`Provided URL is not compatible with HTTP connection: ${ - t} - `); - if(this.registering)return new Promise((t,i)=>{ - this.events.once("register_error",t=>{ - i(t)} - ),this.events.once("open",()=>{ - if(void 0===this.isAvailable)return i(new Error("HTTP connection is missing or invalid")); - t()} - )} - ); - this.url=t,this.registering=!0; - try{ - if(!this.disableProviderPing){ - const i=(0,nRt.safeJsonStringify)({ - id:1,jsonrpc:"2.0",method:"test",params:[]} - ); - yield(0,eRt.default)(t,Object.assign(Object.assign({ - } - ,rRt),{ - body:i} - ))} - this.onOpen()} - catch(frt){ - const i=this.parseError(frt); - throw this.events.emit("register_error",i),this.onClose(),i} - } - )} - onOpen(){ - this.isAvailable=!0,this.registering=!1,this.events.emit("open")} - onClose(){ - this.isAvailable=!1,this.registering=!1,this.events.emit("close")} - onPayload(t){ - if(void 0===t.data)return; - const i="string"==typeof t.data?(0,nRt.safeJsonParse)(t.data):t.data; - this.events.emit("payload",i)} - onError(t,i){ - const s=this.parseError(i),e=s.message||s.toString(),n=(0,hRt.formatJsonRpcError)(t,e); - this.events.emit("payload",n)} - parseError(t,i=this.url){ - return(0,hRt.parseConnectionError)(t,i,"HTTP")} - } - ; - Qt(oRt,"JsonRpcConnection"); - let aRt=oRt; - Jxt.JsonRpcConnection=aRt; - var cRt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(Uxt,"__esModule",{ - value:!0} - ),Uxt.Eip155Provider=void 0; - const lRt=yxt,uRt=Fxt,dRt=Mgt,fRt=Wxt,pRt=Jxt,wRt=class{ - constructor(t,i,s){ - this.name="eip155",this.namespace=t.namespace,this.events=s,this.client=i,this.chainId=parseInt(this.getDefaultChain()),this.httpProviders=this.createHttpProviders(),(0,dRt.logDebug)("eip155 constructor --opts.namespace--\x3e",t.namespace)} - isRecord(t){ - return"object"==typeof t&&null!==t&&!Array.isArray(t)} - isArray(t){ - return"object"==typeof t&&null!==t&&Array.isArray(t)} - updateRequestParams(t){ - let i=t.params&&"object"==typeof t.params&&!Array.isArray(t.params); - if("wallet_switchEthereumChain"===t.method){ - const s=t.chainId.split(":")[1],e=parseInt(s,10); - if(isNaN(e))throw new dRt.OKXConnectError(dRt.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR,`Invalid decimal number, chainId: '${ - s} - ' `); - if(t.params){ - if(!i)throw new dRt.OKXConnectError(dRt.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR,`Request params error , method: '${ - t.method} - ' `); - { - let i=t.params; - "chainId"in i||(i.chainId="0x"+e.toString(16),t.params=i)} - } - else t.params={ - chainId:"0x"+e.toString(16)} - } - else if("personal_sign"===t.method||"eth_signTypedData_v4"===t.method||"eth_sendTransaction"===t.method||"wallet_watchAsset"===t.method){ - if(!t.params)throw new dRt.OKXConnectError(dRt.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR,`Request params is nil, method: '${ - t.method} - '`); - if(!this.isRecord(t.params))throw new dRt.OKXConnectError(dRt.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR,`Invalid request params type, method: '${ - t.method} - '`); - { - let i=t.params; - if((0,dRt.logDebug)("eip155 updateRequestParams params>",JSON.stringify(i)),"chainId"in i){ - const s=t.chainId.split(":")[1],e=parseInt(s,10); - let n,h=String(i.chainId); - if(h.startsWith(this.name)&&t.chainId===h)n=e; - else if(h.startsWith("0x"))n=parseInt(h,16); - else{ - if(isNaN(Number(h)))throw new dRt.OKXConnectError(dRt.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR,`Invalid params.chainId format, method: '${ - t.method} - '`); - n=parseInt(h,10)} - if(e!==n)throw new dRt.OKXConnectError(dRt.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR,`Request params.chainId not equal chain, method: '${ - t.method} - ' `)} - } - } - } - adaptArray(t){ - if("wallet_switchEthereumChain"===t.method||"wallet_addEthereumChain"===t.method||"wallet_watchAsset"===t.method||"eth_sendTransaction"===t.method||"kaia_signTransaction"===t.method||"klay_signTransaction"===t.method){ - if(this.isArray(t.params)){ - let i=t.params; - if(i){ - if(1!==i.length)throw i.length>1?new dRt.OKXConnectError(dRt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params only Support one data, method: '${ - t.method} - ' `):new dRt.OKXConnectError(dRt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params is nil, method: '${ - t.method} - ' `); - { - let i=t.params[0]; - this.isRecord(i)&&(t.params=i)} - } - } - } - else if("eth_signTypedData_v4"===t.method){ - if(this.isArray(t.params)){ - let i=t.params; - if(i&&i.length>2)throw new dRt.OKXConnectError(dRt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params only Support one data, method: '${ - t.method} - ' `); - if(i&&0===i.length)throw new dRt.OKXConnectError(dRt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params is nil, method: '${ - t.method} - ' `); - let s={ - } - ; - if(i&&2===i.length){ - let i=t.params[0]; - if(!i||"string"!=typeof i)throw new dRt.OKXConnectError(dRt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params address error , not string, method: '${ - t.method} - ' `); - { - let e=!1; - if(this.namespace.accounts.forEach(t=>{ - (0,lRt.fromAccountToAddress)(t).toLowerCase()===i.toLowerCase()&&(e=!0)} - ),(0,dRt.logDebug)("eip155 adaptArray eth_signTypedData_v4 >>>isEqual: ",e),!e)throw new dRt.OKXConnectError(dRt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params address error, not equal, method: '${ - t.method} - ' `); - if(!this.isRecord(t.params[1]))throw new dRt.OKXConnectError(dRt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params message data error, method: '${ - t.method} - ' `); - s=t.params[1]} - } - else if(i&&1===i.length){ - if(!this.isRecord(t.params[0]))throw new dRt.OKXConnectError(dRt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params message data error, method: '${ - t.method} - ' `); - s=t.params[0]} - try{ - let i=JSON.stringify(s); - t.params={ - typedDataJson:i} - } - catch(h6i){ - throw new dRt.OKXConnectError(dRt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params call JSON.stringify() failed, method: '${ - t.method} - ' `)} - } - } - else if("personal_sign"===t.method&&this.isArray(t.params)){ - if(t.params&&t.params.length>2)throw new dRt.OKXConnectError(dRt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params error, method: '${ - t.method} - ' `); - if(t.params&&0===t.params.length)throw new dRt.OKXConnectError(dRt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params is nil, method: '${ - t.method} - ' `); - let i=t.params[0],s=t.params[1]; - if(s&&"string"==typeof s){ - let i=!1; - if(this.namespace.accounts.forEach(t=>{ - (0,lRt.fromAccountToAddress)(t).toLowerCase()===s.toLowerCase()&&(i=!0)} - ),(0,dRt.logDebug)("eip155 adaptArray personal_sign >>>isEqual: ",i),!i)throw new dRt.OKXConnectError(dRt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params address error, method: '${ - t.method} - ' `)} - if(!i||"string"!=typeof i)throw new dRt.OKXConnectError(dRt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`Request params is error, method: '${ - t.method} - ' `); - t.params={ - message:i} - } - } - showRequestModal(t){ - switch(t.method){ - case"eth_requestAccounts":case"eth_accounts":case"eth_chainId":default:return!1; - case"eth_sendTransaction":case"eth_signTransaction":case"eth_sign":case"personal_sign":case"eth_signTypedData":case"wallet_addEthereumChain":case"wallet_watchAsset":case"eth_signTypedData_v4":return!0; - case"wallet_switchEthereumChain":{ - this.adaptArray(t),this.updateRequestParams(t); - const{ - parsedChainId:i,hexChainId:s} - =this.getHexChainIdFromRequest(t); - return!this.isChainApproved(i)} - } - return!1} - configAddressAdaptInjectWallet(t){ - this.namespace.accounts.forEach(i=>{ - i.includes(t.chainId)&&(t.address=(0,lRt.fromAccountToAddress)(i))} - )} - request(t){ - return cRt(this,void 0,void 0,function*(){ - if("eth_signLegacy"===t.method||"eth_sign"===t.method)throw new dRt.OKXConnectError(dRt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED,`${ - t.method} - method not supported`); - switch(t.injectParams=t.params,this.adaptArray(t),this.client.needCheckRequestMethod()&&"klay_signTransaction"===t.method&&(t.method="kaia_signTransaction"),(0,dRt.logDebug)("eip155 request --args--string>",JSON.stringify(t)),this.updateRequestParams(t),(0,dRt.logDebug)("eip155 request --params--string>",JSON.stringify(t)),this.configAddressAdaptInjectWallet(t),t.method){ - case"eth_requestAccounts":case"eth_accounts":return this.getAccounts(); - case"eth_chainId":return parseInt(this.getDefaultChain()); - case"wallet_switchEthereumChain":return yield this.handleSwitchChain(t); - case"wallet_addEthereumChain":return this.addEthereumChain(t)} - if(this.client.needCheckRequestMethod()&&!this.namespace.methods.includes(t.method))return(0,dRt.logDebug)("[RPC] request begin"),yield this.getHttpProvider().request(t); - if(this.client.needCheckRequestMethod()&&("eth_sendTransaction"===t.method||"kaia_signTransaction"===t.method))try{ - if(t.params&&"object"==typeof t.params&&!Array.isArray(t.params)){ - const i=t.params; - "string"==typeof i.input&&""!==i.input.trim()?!i.data||"string"==typeof i.data&&""===i.data.trim()?(i.data=i.input,(0,dRt.logDebug)("eip155 sendTransaction: replace data with input")):(0,dRt.logDebug)("eip155 sendTransaction: data not empty"):(0,dRt.logDebug)("eip155 sendTransaction: input empty")} - } - catch(frt){ - (0,dRt.logDebug)("eip155 sendTransaction: replace error")} - try{ - const i=yield this.client.request(t); - if((0,dRt.logDebug)("eip155 request --response----string>",JSON.stringify(i)),this.isRecord(i)&&"result"in i){ - let t=i.result; - return!t||"string"!=typeof t||"true"!==t&&"false"!==t?i.result:((0,dRt.logDebug)("eip155 request --wallet_watchAsset>>>>","true"===t),"true"===t)} - return i} - catch(frt){ - throw(0,dRt.logDebug)(`eip155 request --response --error--string> e instanceof OKXConnectError ${ - frt instanceof dRt.OKXConnectError} - `,JSON.stringify(frt)),frt} - } - )} - addEthereumChain(t){ - return cRt(this,void 0,void 0,function*(){ - let i=yield this.client.request(t); - try{ - if("result"in i){ - let s=i.result; - if(s){ - const i=s.split(":")[0],e=s.split(":")[1],n=i+":"+e; - if(this.namespace,this.namespace.accounts.push(s),this.namespace.chains.push(n),this.isRecord(t.params)&&"rpcUrls"in t.params){ - let i=t.params.rpcUrls,s=i?i[0]:void 0; - s&&(this.namespace.rpcMap?this.namespace.rpcMap[e]=s:this.namespace.rpcMap={ - [e]:s} - ,this.setHttpProvider(e,s))} - this.events.emit(uRt.PROVIDER_EVENTS.UPDATE_NAMESPACES,{ - eip155:this.namespace} - )} - } - else new dRt.OKXConnectError(dRt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`the method ${ - t.method} - request error`)} - catch(s){ - throw new dRt.OKXConnectError(dRt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`the method ${ - t.method} - request error`)} - return null} - )} - updateNamespace(t){ - this.namespace=Object.assign(this.namespace,t)} - setDefaultChain(t,i){ - if(this.chainId=parseInt(t),!this.httpProviders[t]){ - const s=i||(0,lRt.getRpcUrl)(`${ - this.name} - :${ - t} - `,this.namespace); - s?this.setHttpProvider(t,s):(0,dRt.logDebug)(`No RPC url provided for chainId: ${ - t} - `)} - this.events.emit(uRt.PROVIDER_EVENTS.DEFAULT_CHAIN_CHANGED,`${ - this.name} - :${ - t} - `)} - requestAccounts(){ - return this.getAccounts()} - getDefaultChain(){ - if(this.chainId)return this.chainId.toString(); - if(this.namespace.defaultChain)return this.namespace.defaultChain; - const t=this.namespace.chains[0]; - if(!t)throw new Error("ChainId not found"); - return t.split(":")[1]} - getAccounts(){ - const t=this.namespace.accounts; - return(0,dRt.logDebug)("eip155 getAccounts ",t,this.chainId),t?[...new Set(t.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>(0,lRt.fromAccountToAddress)(t)))]:[]} - getHexChainIdFromRequest(t){ - let i=t.params,s="0x0"; - i&&"chainId"in i&&(s=i.chainId),s=s.startsWith("0x")?s:`0x${ - s} - `,(0,dRt.logDebug)("handleSwitchChain --\x3eargs ",t),(0,dRt.logDebug)("handleSwitchChain --\x3ehexChainId ",s); - const e=parseInt(s,16); - return(0,dRt.logDebug)("handleSwitchChain --\x3eparsedChainId ",e),{ - parsedChainId:e,hexChainId:s} - } - handleSwitchChain(t){ - return cRt(this,void 0,void 0,function*(){ - const{ - parsedChainId:i,hexChainId:s} - =this.getHexChainIdFromRequest(t); - if(!this.isChainApproved(i))throw new dRt.OKXConnectError(dRt.OKX_CONNECT_ERROR_CODES.CHAIN_NOT_SUPPORTED,`the method ${ - t.method} - request error`); - this.setDefaultChain(`${ - i} - `)} - )} - isChainApproved(t){ - return this.namespace.chains.includes(`${ - this.name} - :${ - t} - `)} - createHttpProvider(t,i){ - const s=i; - if(s)return new fRt.JsonRpcProvider(new pRt.JsonRpcConnection(s,(0,lRt.getGlobal)("disableProviderPing"))); - (0,dRt.logDebug)(`No RPC url provided for chainId: ${ - t} - `)} - createHttpProviders(){ - const t={ - } - ; - return this.namespace.chains.forEach(i=>{ - const s=(0,lRt.getChainId)(i),e=(0,lRt.getRpcUrl)(i,this.namespace); - (0,dRt.logDebug)("get parsed chain and rpc:",s,e); - let n=this.createHttpProvider(s,e); - n&&(t[s]=n)} - ),(0,dRt.logDebug)("get http providermap:",t),t} - setHttpProvider(t,i){ - const s=this.createHttpProvider(t,i); - s&&(this.httpProviders[t]=s)} - getHttpProvider(){ - const t=`${ - this.chainId} - `,i=this.httpProviders[t]; - if((0,dRt.logDebug)("[RPC] get http provider:",t,i),void 0===i)throw new Error(`JSON-RPC provider for ${ - t} - not found`); - return i} - } - ; - Qt(wRt,"Eip155Provider"); - let gRt=wRt; - Uxt.Eip155Provider=gRt,Uxt.default=gRt; - var mRt={ - } - ,vRt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(mRt,"__esModule",{ - value:!0} - ),mRt.SuiProvider=void 0; - const _Rt=Fxt,MRt=Mgt,bRt=yxt,yRt=Jxt,ERt=Wxt,ARt=class{ - constructor(t,i,s){ - this.name=MRt.NameSpaceKeySui,this.namespace=t.namespace,this.events=s,this.client=i,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()} - updateNamespace(t){ - this.namespace=Object.assign(this.namespace,t)} - request(t){ - return vRt(this,void 0,void 0,function*(){ - if((0,MRt.logDebug)("sui request --args--string>",JSON.stringify(t)),(0,MRt.logDebug)("sui provider namespace: ",this.namespace),t.injectParams){ - if("chain"in t&&MRt.SUI_CHAINS.MAINNET!=t.chain)throw new MRt.OKXConnectError(MRt.OKX_CONNECT_ERROR_CODES.CHAIN_NOT_SUPPORTED); - if(t.injectParams.chain=MRt.SUI_CHAINS.MAINNET,"account"in t&&t.account.address!=this.getAccounts[0])throw new MRt.OKXConnectError(MRt.OKX_CONNECT_ERROR_CODES.BAD_REQUEST_ERROR); - t.injectParams.account={ - address:this.getAccounts()[0]} - } - return!this.client.needCheckRequestMethod()||this.namespace.methods.includes(t.method)?this.client.request(t):this.getHttpProvider().request(t)} - )} - requestAccounts(){ - return this.getAccounts()} - setDefaultChain(t,i){ - this.httpProviders[t]||this.setHttpProvider(t,i),this.chainId=t,this.events.emit(_Rt.PROVIDER_EVENTS.DEFAULT_CHAIN_CHANGED,`${ - this.name} - :${ - t} - `)} - getDefaultChain(){ - if(this.chainId)return this.chainId; - if(this.namespace.defaultChain)return this.namespace.defaultChain; - const t=this.namespace.chains[0]; - if(!t)throw new Error("ChainId not found"); - return t.split(":")[1]} - getAccounts(){ - const t=this.namespace.accounts; - return t?[...new Set(t.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]} - createHttpProviders(){ - const t={ - } - ; - return this.namespace.chains.forEach(i=>{ - const s=(0,bRt.getChainId)(i),e=(0,bRt.getRpcUrl)(i,this.namespace); - let n=this.createHttpProvider(s,e); - n&&(t[s]=n)} - ),t} - getHttpProvider(){ - const t=`${ - this.chainId} - `,i=this.httpProviders[t]; - if((0,MRt.logDebug)("[RPC] get http provider:",t,i),void 0===i)throw new Error(`JSON-RPC provider for ${ - t} - not found`); - return i} - setHttpProvider(t,i){ - const s=this.createHttpProvider(t,i); - s&&((0,MRt.logDebug)("setHttpProvider",t,i),this.httpProviders[t]=s)} - createHttpProvider(t,i){ - const s=i; - if(s)return new ERt.JsonRpcProvider(new yRt.JsonRpcConnection(s,(0,bRt.getGlobal)("disableProviderPing"))); - (0,MRt.logDebug)(`No RPC url provided for chainId: ${ - t} - `)} - getPubkey(t){ - return this.getWalletAddress(t)} - getWalletAddress(t){ - return t||(null==(t=this.namespace.defaultChain)?void 0:t.startsWith("sui"))||(t=`sui:${ - t} - `),this.namespace.accounts.filter(function(i){ - return i.split(":").length>2&&i.startsWith(t)} - ).map(function(t){ - return t.split(":")[2]} - )[0]} - showRequestModal(t){ - switch(t.method){ - case"sui_signMessage":case"sui_signPersonalMessage":case"sui_signTransactionBlock":case"sui_signAndExecuteTransactionBlock":return!0; - default:return!1} - return!1} - } - ; - Qt(ARt,"SuiProvider"); - let SRt=ARt; - mRt.SuiProvider=SRt,mRt.default=SRt; - var TRt={ - } - ,CRt={ - } - ; - Object.defineProperty(CRt,"__esModule",{ - value:!0} - ),CRt.getAccountsChains=IRt,CRt.nameSpaceToConnectWalletNameSpace=kRt,CRt.fillParamsToSession=xRt,CRt.isCaipNamespace=PRt,CRt.parseNamespaceKey=NRt; - const ORt=Mgt; - function IRt(t){ - const i=[]; - return t.forEach(t=>{ - const[s,e]=t.split(":"); - i.push(`${ - s} - :${ - e} - `)} - ),i} - function kRt(t){ - var i=[]; - return t?(Object.keys(t).forEach(s=>{ - s!==ORt.NameSpaceKeyEip155&&s!==ORt.NameSpaceKeySOL&&s!==ORt.NameSpaceKeySui&&s!==ORt.NameSpaceKeyAptos&&s!=ORt.NameSpaceKeyBtc&&s!==ORt.NameSpaceKeyTON&&s!==ORt.NameSpaceKeyCosmos&&s!==ORt.NameSpaceKeyTron&&s!==ORt.NameSpaceKeyStarknet||t[s].chains&&i.push({ - namespace:s,chains:t[s].chains,params:t[s].params} - )} - ),i):i} - function xRt(t,i,s,e){ - const n=Qt((t,i)=>{ - Object.assign(t,i)} - ,"mergeRpcMap"),h=Qt((t,i)=>{ - for(const s in i)i.hasOwnProperty(s)&&i[s].rpcMap&&(i[s].rpcMap&&(t[s].rpcMap||(t[s].rpcMap={ - } - ),n(t[s].rpcMap,i[s].rpcMap)),i[s].defaultChain&&void 0===t[s].defaultChain&&t[s].chains.some(t=>t.split(":")[1]===i[s].defaultChain)&&(t[s].defaultChain=i[s].defaultChain))} - ,"mergeNamespaces"); - i&&h(t.namespaces,i),s&&h(t.namespaces,s); - for(const r in t.namespaces){ - const i=t.namespaces[r]; - (null==i?void 0:i.accounts)&&0!==i.accounts.length||delete t.namespaces[r]} - t.namespaces[ORt.NameSpaceKeyBtc]&&t.wallet.appName===ORt.OKXWalletName&&RRt(t.namespaces[ORt.NameSpaceKeyBtc]),null==e.connectWalletType&&null!=t.sessionConfig.connectWalletType&&(e.connectWalletType=t.sessionConfig.connectWalletType),t.sessionConfig=e} - function RRt(t){ - try{ - if(t&&t.extra){ - var i=t.extra; - Object.keys(i).forEach(t=>{ - const s=i[t]; - 6===Number(s.addressType)?s.publicKey=s.compressedPublicKey.slice(2):s.publicKey=s.compressedPublicKey} - )} - } - catch(frt){ - (0,ORt.logDebug)("namespaces fixMobileBtcSession error")} - } - function PRt(t){ - return t.includes(":")} - function NRt(t){ - return PRt(t)?t.split(":")[0]:t} - Qt(IRt,"getAccountsChains"),Qt(kRt,"nameSpaceToConnectWalletNameSpace"),Qt(xRt,"fillParamsToSession"),Qt(RRt,"fixMobileBtcSession"),Qt(PRt,"isCaipNamespace"),Qt(NRt,"parseNamespaceKey"); - var LRt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(TRt,"__esModule",{ - value:!0} - ),TRt.SignClient=void 0; - const DRt=Mgt,GRt=CRt,BRt=Mxt,URt=Fxt,FRt=class extends DRt.ISignClient{ - constructor(t,i,s){ - super(t),this.connect=t=>LRt(this,void 0,void 0,function*(){ - return new Promise((i,s)=>LRt(this,void 0,void 0,function*(){ - try{ - var e=[]; - (0,DRt.logDebug)("client connect params >>>",JSON.stringify(t)); - var n={ - name:"requestAccounts",requiredNamespaces:(0,GRt.nameSpaceToConnectWalletNameSpace)(t.namespaces),optionalNamespaces:(0,GRt.nameSpaceToConnectWalletNameSpace)(t.optionalNamespaces)} - ; - this.engine.setSessionConnectingListener(()=>{ - (0,DRt.logDebug)("sessionConnectingListener >>>"),this.events.emit(URt.PROVIDER_EVENTS.SESSION_CONNECTING)} - ),t.signRequest&&(n.connectRequestMethods=yield(0,BRt.connectMethodsToConnectWalletMethods)(t.signRequest,n.requiredNamespaces)),e.push(n),(0,DRt.logDebug)("client connect connectRequest >>>",JSON.stringify(e)),this.engine.universalConnect(e,Object.assign({ - dappInfo:this.metadata} - ,t.sessionConfig),t=>{ - if(t&&t.connectRequest){ - (0,DRt.logDebug)("universalConect info.connectRequest :",t.connectRequest); - let i=(0,DRt.getOKXLink)(t.connectRequest,this.sessionConfig.connectWalletType).universalLink; - (0,DRt.logDebug)("universalConect url:",i),this.events.emit("display_uri",i),this.events.emit("short_display_uri",i),(0,DRt.logDebug)(`universalConect EngineConnectInfo ${ - JSON.stringify(t)} - `),this.events.emit("okx_engine_connect_params",t)} - } - ).then(s=>LRt(this,void 0,void 0,function*(){ - (0,GRt.fillParamsToSession)(s,t.namespaces,t.optionalNamespaces,this.sessionConfig),(0,DRt.logDebug)(`signClient: connect: session ${ - JSON.stringify(s)} - `),t.signRequest&&(yield(0,BRt.connectMethodsResponseUpdate)(s,t.signRequest)),i(s)} - )).catch(t=>{ - (0,DRt.logDebug)(`signClient: connect: catch ${ - JSON.stringify(t)} - `),this.events.emit("connect_error",t),s(t)} - )} - catch(h){ - (0,DRt.logDebug)(`signClient: connect: ${ - JSON.stringify(h)} - `),s(h)} - } - ))} - ),this.restoreconnect=t=>LRt(this,void 0,void 0,function*(){ - return new Promise((i,s)=>{ - this.engine.restoreconnect(t,t=>{ - t?i(t):s()} - )} - )} - ),this.reject=t=>LRt(this,void 0,void 0,function*(){ - } - ),this.request=t=>LRt(this,void 0,void 0,function*(){ - return new Promise((i,s)=>LRt(this,void 0,void 0,function*(){ - var e,n; - (0,DRt.logDebug)("clint request --params>>>> >",null===(e=this.sessionConfig)||void 0===e?void 0:e.openUniversalUrl,(0,DRt.safeJsonStringify)(t)); - try{ - (null===(n=this.sessionConfig)||void 0===n?void 0:n.openUniversalUrl)&&(0,DRt.isIos)()&&this.openOKXWallet(),yield this.engine.send(t,{ - resolve:Qt(t=>{ - if(delete t.requestId,(0,DRt.logDebug)("clint request --response >",(0,DRt.safeJsonStringify)(t)),"error"in t&&t.error){ - let i=t.error; - s(new DRt.OKXConnectError(t.error.code,t.method+":"+i.message))} - else i(t)} - ,"resolve"),onAck:Qt(()=>{ - var t; - !(0,DRt.isIos)()&&(null===(t=this.sessionConfig)||void 0===t?void 0:t.openUniversalUrl)&&this.openOKXWallet()} - ,"onAck")} - )} - catch(frt){ - (0,DRt.logDebug)("clint request --error:",frt),s(frt)} - } - ))} - ),this.disconnect=()=>LRt(this,void 0,void 0,function*(){ - return new Promise((t,i)=>{ - this.engine.send({ - method:"disconnect"} - ,{ - onAck:Qt(()=>{ - t()} - ,"onAck")} - ,864e5).catch(t=>{ - i(t)} - )} - )} - ),this.engine=new DRt.Engine(t.name),this.events=i,this.metadata=t,this.openAppLineType=null!=s?s:DRt.OpenAppLinkType.UniversalLink} - setAccountChangeListener(t){ - this.engine.setAccountChangeListener(t)} - openOKXWallet(){ - (0,DRt.logDebug)("bridge-provider ==>> connect_5"),this.engine.openWallet({ - tmaReturnUrl:this.sessionConfig.tmaReturnUrl} - ,null,this.openAppLineType)} - syncAllAddress(){ - return LRt(this,void 0,void 0,function*(){ - return new Promise((t,i)=>{ - this.engine.send({ - method:"sync_all_addresses"} - ,{ - resolve:Qt(s=>{ - if(delete s.requestId,(0,DRt.logDebug)("clint syncAllAddress --response >",JSON.stringify(s)),"error"in s&&s.error){ - let t=s.error; - i(new DRt.OKXConnectError(s.error.code,s.method+":"+t.message))} - else{ - let i=s.result; - t((0,BRt.syncResoonseToRequire)(i))} - } - ,"resolve")} - ).catch(t=>{ - i(t)} - )} - )} - )} - registerConnector(t){ - this.engine.registerConnector(t)} - openWallet(t,i){ - this.engine.openWallet(t,i,this.openAppLineType)} - setConnectConnector(t){ - this.engine.setConnectConnector(null==t?void 0:t.wallet,null==t?void 0:t.sessionConfig)} - needCheckRequestMethod(){ - try{ - return!Object.values(DRt.CONNECTOR_TYPE.INJECT).includes(this.engine.getConnector().getType())&&!Object.values(DRt.CONNECTOR_TYPE.KEYLESS).includes(this.engine.getConnector().getType())} - catch(t){ - return!0} - } - } - ; - Qt(FRt,"SignClient"); - let $Rt=FRt; - TRt.SignClient=$Rt; - var HRt={ - } - ,WRt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(HRt,"__esModule",{ - value:!0} - ),HRt.SolanaProvider=void 0; - const VRt=Fxt,jRt=Mgt,KRt=yxt,zRt=Jxt,YRt=Wxt,qRt=class{ - constructor(t,i,s,e){ - this.name="solana",this.namespace=t.namespace,this.events=e,this.client=s,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders(),this.name=i} - updateNamespace(t){ - this.namespace=Object.assign(this.namespace,t)} - requestAccounts(){ - return this.getAccounts()} - request(t){ - return WRt(this,void 0,void 0,function*(){ - if((0,jRt.logDebug)("solana request --args--string>",JSON.stringify(t)),(0,jRt.logDebug)("solana provider namespace: ",this.namespace),!this.client.needCheckRequestMethod()||this.namespace.methods.includes(t.method))return this.client.request(t); - throw new jRt.OKXConnectError(jRt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED,"Please upgrade OKX APP")} - )} - setDefaultChain(t,i){ - this.httpProviders[t]||this.setHttpProvider(t,i),this.chainId=t,this.events.emit(VRt.PROVIDER_EVENTS.DEFAULT_CHAIN_CHANGED,`${ - this.name} - :${ - t} - `)} - getDefaultChain(){ - if(this.chainId)return this.chainId; - if(this.namespace.defaultChain)return this.namespace.defaultChain; - const t=this.namespace.chains[0]; - if(!t)throw new Error("ChainId not found"); - return t.split(":")[1]} - getAccounts(){ - const t=this.namespace.accounts; - return t?[...new Set(t.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]} - createHttpProviders(){ - const t={ - } - ; - return this.namespace.chains.forEach(i=>{ - const s=(0,KRt.getChainId)(i),e=(0,KRt.getRpcUrl)(i,this.namespace); - let n=this.createHttpProvider(s,e); - n&&(t[s]=n)} - ),t} - getHttpProvider(){ - const t=`${ - this.chainId} - `,i=this.httpProviders[t]; - if(void 0===i)throw new Error(`JSON-RPC provider for ${ - t} - not found`); - return i} - setHttpProvider(t,i){ - const s=this.createHttpProvider(t,i); - s&&(this.httpProviders[t]=s)} - createHttpProvider(t,i){ - const s=i; - if(s)return new YRt.JsonRpcProvider(new zRt.JsonRpcConnection(s,(0,KRt.getGlobal)("disableProviderPing")))} - getPubkey(t){ - return this.getWalletAddress(t)} - getWalletAddress(t){ - return t||(null==(t=this.namespace.defaultChain)?void 0:t.startsWith("solana"))||(t=`solana:${ - t} - `),this.namespace.accounts.filter(function(i){ - return i.split(":").length>2&&i.startsWith(t)} - ).map(function(t){ - return t.split(":")[2]} - )[0]} - showRequestModal(t){ - return!0} - } - ; - Qt(qRt,"SolanaProvider"); - let XRt=qRt; - HRt.SolanaProvider=XRt,HRt.default=XRt; - var JRt={ - } - ,QRt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(JRt,"__esModule",{ - value:!0} - ); - const ZRt=Fxt,tPt=Mgt,iPt=yxt,sPt=Jxt,ePt=Wxt,nPt=class{ - constructor(t,i,s,e){ - this.name=tPt.NameSpaceKeyBtc,this.namespace=t.namespace,this.events=e,this.client=s,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders(),this.name=i} - updateNamespace(t){ - this.namespace=Object.assign(this.namespace,t)} - requestAccounts(){ - return this.getAccounts()} - request(t){ - return QRt(this,void 0,void 0,function*(){ - return(0,tPt.logDebug)("btc request --args--string>",JSON.stringify(t)),(0,tPt.logDebug)("btc provider namespace: ",JSON.stringify(this.namespace)),!this.client.needCheckRequestMethod()||this.namespace.methods.includes(t.method)?this.client.request(t):this.getHttpProvider().request(t)} - )} - setDefaultChain(t,i){ - this.httpProviders[t]||this.setHttpProvider(t,i),this.chainId=t,this.events.emit(ZRt.PROVIDER_EVENTS.DEFAULT_CHAIN_CHANGED,`${ - this.name} - :${ - t} - `)} - getDefaultChain(){ - if(this.chainId)return this.chainId; - if(this.namespace.defaultChain)return this.namespace.defaultChain; - const t=this.namespace.chains[0]; - if(!t)throw new Error("ChainId not found"); - return t.split(":")[1]} - getAccounts(){ - const t=this.namespace.accounts; - return t?[...new Set(t.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]} - createHttpProviders(){ - const t={ - } - ; - return this.namespace.chains.forEach(i=>{ - const s=(0,iPt.getChainId)(i),e=(0,iPt.getRpcUrl)(i,this.namespace); - let n=this.createHttpProvider(s,e); - n&&(t[s]=n)} - ),t} - getHttpProvider(){ - const t=`${ - this.chainId} - `,i=this.httpProviders[t]; - if(void 0===i)throw new Error(`JSON-RPC provider for ${ - t} - not found`); - return i} - setHttpProvider(t,i){ - const s=this.createHttpProvider(t,i); - s&&(this.httpProviders[t]=s)} - createHttpProvider(t,i){ - const s=i; - if(s)return new ePt.JsonRpcProvider(new sPt.JsonRpcConnection(s,(0,iPt.getGlobal)("disableProviderPing"))); - (0,tPt.logDebug)(`No RPC url provided for chainId: ${ - t} - `)} - showRequestModal(t){ - return!0} - } - ; - Qt(nPt,"BtcProvider"); - let hPt=nPt; - JRt.default=hPt; - var rPt={ - } - ,oPt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(rPt,"__esModule",{ - value:!0} - ); - const aPt=Fxt,cPt=Mgt,lPt=yxt,uPt=Jxt,dPt=Wxt,fPt=class{ - constructor(t,i,s,e){ - this.name="aptos",this.namespace=t.namespace,this.events=e,this.client=s,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders(),this.name=i} - updateNamespace(t){ - this.namespace=Object.assign(this.namespace,t)} - requestAccounts(){ - return this.getAccounts()} - request(t){ - return oPt(this,void 0,void 0,function*(){ - if((0,cPt.logDebug)("aptos request --args--string>",(0,cPt.safeJsonStringify)(t)),(0,cPt.logDebug)("aptos provider namespace: ",this.namespace),!this.client.needCheckRequestMethod()||this.namespace.methods.includes(t.method))return this.client.request(t); - throw new cPt.OKXConnectError(cPt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED,"Please upgrade OKX APP")} - )} - setDefaultChain(t,i){ - this.httpProviders[t]||this.setHttpProvider(t,i),this.chainId=t,this.events.emit(aPt.PROVIDER_EVENTS.DEFAULT_CHAIN_CHANGED,`${ - this.name} - :${ - t} - `)} - getDefaultChain(){ - if(this.chainId)return this.chainId; - if(this.namespace.defaultChain)return this.namespace.defaultChain; - const t=this.namespace.chains[0]; - if(!t)throw new Error("ChainId not found"); - return t.split(":")[1]} - getAccounts(){ - const t=this.namespace.accounts; - return t?[...new Set(t.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]} - createHttpProviders(){ - const t={ - } - ; - return this.namespace.chains.forEach(i=>{ - const s=(0,lPt.getChainId)(i),e=(0,lPt.getRpcUrl)(i,this.namespace); - let n=this.createHttpProvider(s,e); - n&&(t[s]=n)} - ),t} - getHttpProvider(){ - const t=`${ - this.chainId} - `,i=this.httpProviders[t]; - if(void 0===i)throw new Error(`JSON-RPC provider for ${ - t} - not found`); - return i} - setHttpProvider(t,i){ - const s=this.createHttpProvider(t,i); - s&&(this.httpProviders[t]=s)} - createHttpProvider(t,i){ - const s=i; - if(s)return new dPt.JsonRpcProvider(new uPt.JsonRpcConnection(s,(0,lPt.getGlobal)("disableProviderPing")))} - showRequestModal(t){ - return!0} - } - ; - Qt(fPt,"AptosProvider"); - let pPt=fPt; - rPt.default=pPt; - var wPt={ - } - ,gPt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ,mPt=pi&&pi.__rest||function(t,i){ - var s={ - } - ; - for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&i.indexOf(e)<0&&(s[e]=t[e]); - if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){ - var n=0; - for(e=Object.getOwnPropertySymbols(t); - n<e.length; - n++)i.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(t,e[n])&&(s[e[n]]=t[e[n]])} - return s} - ; - Object.defineProperty(wPt,"__esModule",{ - value:!0} - ); - const vPt=Fxt,_Pt=Mgt,MPt=yxt,bPt=Jxt,yPt=Wxt,EPt=class{ - constructor(t,i,s){ - this.name=_Pt.NameSpaceKeyTON,this.namespace=t.namespace,this.events=s,this.client=i,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()} - updateNamespace(t){ - this.namespace=Object.assign(this.namespace,t)} - isRecord(t){ - return"object"==typeof t&&null!==t&&!Array.isArray(t)} - request(t){ - return gPt(this,void 0,void 0,function*(){ - var i,s,e,n; - if((0,_Pt.logDebug)("TONProvider request --args--string>",JSON.stringify(t)),(0,_Pt.logDebug)("TONProvider request provider namespace: ",this.namespace),!this.client.needCheckRequestMethod()||this.namespace.methods.includes(t.method)){ - if(!t.params)throw new _Pt.OKXConnectError(_Pt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"ton request params is nil"); - if(this.isRecord(t.params)){ - const h=t.params,{ - validUntil:r} - =h,o=mPt(h,["validUntil"]); - let a=null===(s=null===(i=this.namespace.payload)||void 0===i?void 0:i.ton_addr)||void 0===s?void 0:s.address; - "from"in o&&(a=o.from||(null===(n=null===(e=this.namespace.payload)||void 0===e?void 0:e.ton_addr)||void 0===n?void 0:n.address)),t.params.from=a,t.params.network=this.getDefaultChain(),t.params.valid_until=r; - let c=yield this.client.request(t); - if(this.isRecord(c)&&"result"in c){ - const t={ - boc:c.result.toString()} - ; - return(0,_Pt.logDebug)("TONProvider request provider response: ",JSON.stringify(c)),(0,_Pt.logDebug)("TONProvider request provider result: ",JSON.stringify(t)),t} - throw new _Pt.OKXConnectError(_Pt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"ton_send request response is nil")} - throw new _Pt.OKXConnectError(_Pt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"ton request params type add nil")} - return this.getHttpProvider().request(t)} - )} - requestAccounts(){ - return this.getAccounts()} - setDefaultChain(t,i){ - this.httpProviders[t]||this.setHttpProvider(t,i),this.chainId=t,this.events.emit(vPt.PROVIDER_EVENTS.DEFAULT_CHAIN_CHANGED,`${ - this.name} - :${ - t} - `)} - getDefaultChain(){ - if(this.chainId)return this.chainId; - if(this.namespace.defaultChain)return this.namespace.defaultChain; - const t=this.namespace.chains[0]; - if(!t)throw new Error("ChainId not found"); - return t.split(":")[1]} - getAccounts(){ - var t,i; - const s=this.namespace.accounts; - if((0,_Pt.logDebug)("ton getAccounts accounts :",s),(0,_Pt.logDebug)("ton getAccounts .namespace :",JSON.stringify(this.namespace)),!s)return[]; - let e=null===(i=null===(t=this.namespace.payload)||void 0===t?void 0:t.ton_addr)||void 0===i?void 0:i.address; - return(0,_Pt.logDebug)("ton getAccounts address :",e),e?[e]:[]} - createHttpProviders(){ - const t={ - } - ; - return this.namespace.chains.forEach(i=>{ - const s=(0,MPt.getChainId)(i),e=(0,MPt.getRpcUrl)(i,this.namespace); - let n=this.createHttpProvider(s,e); - n&&(t[s]=n)} - ),t} - getHttpProvider(){ - const t=`${ - this.chainId} - `,i=this.httpProviders[t]; - if((0,_Pt.logDebug)("[RPC] get http provider:",t,i),void 0===i)throw new Error(`JSON-RPC provider for ${ - t} - not found`); - return i} - setHttpProvider(t,i){ - const s=this.createHttpProvider(t,i); - s&&((0,_Pt.logDebug)("setHttpProvider",t,i),this.httpProviders[t]=s)} - createHttpProvider(t,i){ - const s=i; - if(s)return new yPt.JsonRpcProvider(new bPt.JsonRpcConnection(s,(0,MPt.getGlobal)("disableProviderPing"))); - (0,_Pt.logDebug)(`No RPC url provided for chainId: ${ - t} - `)} - showRequestModal(t){ - return"ton_sendTransaction"===t.method} - } - ; - Qt(EPt,"TONProvider"); - let APt=EPt; - wPt.default=APt; - var SPt={ - } - ,TPt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(SPt,"__esModule",{ - value:!0} - ); - const CPt=Fxt,OPt=Mgt,IPt=yxt,kPt=Jxt,xPt=Wxt,RPt=class{ - constructor(t,i,s){ - this.name=OPt.NameSpaceKeyCosmos,this.namespace=t.namespace,this.events=s,this.client=i,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()} - updateNamespace(t){ - this.namespace=Object.assign(this.namespace,t)} - requestAccounts(){ - return this.getAccounts()} - request(t){ - return TPt(this,void 0,void 0,function*(){ - if((0,OPt.logDebug)("cosmos request --args--string>",JSON.stringify(t)),(0,OPt.logDebug)("cosmos provider namespace: ",JSON.stringify(this.namespace)),!this.client.needCheckRequestMethod()||this.namespace.methods.includes(t.method))return this.client.request(t); - throw new OPt.OKXConnectError(OPt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED,"Please upgrade OKX APP")} - )} - setDefaultChain(t,i){ - this.httpProviders[t]||this.setHttpProvider(t,i),this.chainId=t,this.events.emit(CPt.PROVIDER_EVENTS.DEFAULT_CHAIN_CHANGED,`${ - this.name} - :${ - t} - `)} - getDefaultChain(){ - if(this.chainId)return this.chainId; - if(this.namespace.defaultChain)return this.namespace.defaultChain; - const t=this.namespace.chains[0]; - if(!t)throw new Error("ChainId not found"); - return t.split(":")[1]} - getAccounts(){ - const t=this.namespace.accounts; - return t?[...new Set(t.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]} - createHttpProviders(){ - const t={ - } - ; - return this.namespace.chains.forEach(i=>{ - const s=(0,IPt.getChainId)(i),e=(0,IPt.getRpcUrl)(i,this.namespace); - let n=this.createHttpProvider(s,e); - n&&(t[s]=n)} - ),t} - getHttpProvider(){ - const t=`${ - this.chainId} - `,i=this.httpProviders[t]; - if(void 0===i)throw new Error(`JSON-RPC provider for ${ - t} - not found`); - return i} - setHttpProvider(t,i){ - const s=this.createHttpProvider(t,i); - s&&(this.httpProviders[t]=s)} - createHttpProvider(t,i){ - const s=i; - if(s)return new xPt.JsonRpcProvider(new kPt.JsonRpcConnection(s,(0,IPt.getGlobal)("disableProviderPing")))} - showRequestModal(t){ - return!0} - } - ; - Qt(RPt,"CosmosProvider"); - let PPt=RPt; - SPt.default=PPt; - var NPt={ - } - ,LPt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(NPt,"__esModule",{ - value:!0} - ); - const DPt=Fxt,GPt=Mgt,BPt=yxt,UPt=Jxt,FPt=Wxt,$Pt=class{ - constructor(t,i,s){ - this.name=GPt.NameSpaceKeyTron,this.namespace=t.namespace,this.events=s,this.client=i,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()} - updateNamespace(t){ - this.namespace=Object.assign(this.namespace,t)} - requestAccounts(){ - return this.getAccounts()} - request(t){ - return LPt(this,void 0,void 0,function*(){ - if((0,GPt.logDebug)("tron request --args--string>",JSON.stringify(t)),(0,GPt.logDebug)("tron provider namespace: ",JSON.stringify(this.namespace)),!this.client.needCheckRequestMethod()||this.namespace.methods.includes(t.method))return this.client.request(t); - throw new GPt.OKXConnectError(GPt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED,"Please upgrade OKX APP")} - )} - setDefaultChain(t,i){ - this.httpProviders[t]||this.setHttpProvider(t,i),this.chainId=t,this.events.emit(DPt.PROVIDER_EVENTS.DEFAULT_CHAIN_CHANGED,`${ - this.name} - :${ - t} - `)} - getDefaultChain(){ - if(this.chainId)return this.chainId; - if(this.namespace.defaultChain)return this.namespace.defaultChain; - const t=this.namespace.chains[0]; - if(!t)throw new Error("ChainId not found"); - return t.split(":")[1]} - getAccounts(){ - const t=this.namespace.accounts; - return t?[...new Set(t.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]} - createHttpProviders(){ - const t={ - } - ; - return this.namespace.chains.forEach(i=>{ - const s=(0,BPt.getChainId)(i),e=(0,BPt.getRpcUrl)(i,this.namespace); - let n=this.createHttpProvider(s,e); - n&&(t[s]=n)} - ),t} - getHttpProvider(){ - const t=`${ - this.chainId} - `,i=this.httpProviders[t]; - if(void 0===i)throw new Error(`JSON-RPC provider for ${ - t} - not found`); - return i} - setHttpProvider(t,i){ - const s=this.createHttpProvider(t,i); - s&&(this.httpProviders[t]=s)} - createHttpProvider(t,i){ - const s=i; - if(s)return new FPt.JsonRpcProvider(new UPt.JsonRpcConnection(s,(0,BPt.getGlobal)("disableProviderPing")))} - showRequestModal(t){ - return!0} - } - ; - Qt($Pt,"TronProvider"); - let HPt=$Pt; - NPt.default=HPt; - var WPt={ - } - ,VPt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(WPt,"__esModule",{ - value:!0} - ); - const jPt=Fxt,KPt=Mgt,zPt=yxt,YPt=Jxt,qPt=Wxt,XPt=class{ - constructor(t,i,s,e){ - this.name="starknet",this.namespace=t.namespace,this.events=e,this.client=s,this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders(),this.name=i} - updateNamespace(t){ - this.namespace=Object.assign(this.namespace,t)} - requestAccounts(){ - return this.getAccounts()} - request(t){ - return VPt(this,void 0,void 0,function*(){ - if((0,KPt.logDebug)("starknet request --args--string>",JSON.stringify(t)),(0,KPt.logDebug)("starknet provider namespace: ",this.namespace),!this.client.needCheckRequestMethod()||this.namespace.methods.includes(t.method))return this.client.request(t); - throw new KPt.OKXConnectError(KPt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED,"Wallet doesn't support"+t.method)} - )} - setDefaultChain(t,i){ - this.httpProviders[t]||this.setHttpProvider(t,i),this.chainId=t,this.events.emit(jPt.PROVIDER_EVENTS.DEFAULT_CHAIN_CHANGED,`${ - this.name} - :${ - t} - `)} - getDefaultChain(){ - if(this.chainId)return this.chainId; - if(this.namespace.defaultChain)return this.namespace.defaultChain; - const t=this.namespace.chains[0]; - if(!t)throw new Error("ChainId not found"); - return t.split(":")[1]} - getAccounts(){ - const t=this.namespace.accounts; - return t?[...new Set(t.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]} - createHttpProviders(){ - const t={ - } - ; - return this.namespace.chains.forEach(i=>{ - const s=(0,zPt.getChainId)(i),e=(0,zPt.getRpcUrl)(i,this.namespace); - let n=this.createHttpProvider(s,e); - n&&(t[s]=n)} - ),t} - getHttpProvider(){ - const t=`${ - this.chainId} - `,i=this.httpProviders[t]; - if(void 0===i)throw new Error(`JSON-RPC provider for ${ - t} - not found`); - return i} - setHttpProvider(t,i){ - const s=this.createHttpProvider(t,i); - s&&(this.httpProviders[t]=s)} - createHttpProvider(t,i){ - const s=i; - if(s)return new qPt.JsonRpcProvider(new YPt.JsonRpcConnection(s,(0,zPt.getGlobal)("disableProviderPing")))} - showRequestModal(t){ - return!0} - } - ; - Qt(XPt,"StarknetProvider"); - let JPt=XPt; - WPt.default=JPt; - var QPt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ,ZPt=pi&&pi.__importDefault||function(t){ - return t&&t.__esModule?t:{ - default:t} - } - ; - Object.defineProperty(Bxt,"__esModule",{ - value:!0} - ),Bxt.OKXUniversalProvider=void 0; - const tNt=Uxt,iNt=mRt,sNt=Fxt,eNt=ZPt(MMt),nNt=TRt,hNt=Mgt,rNt=CRt,oNt=ZPt(HRt),aNt=ZPt(JRt),cNt=ZPt(rPt),lNt=ZPt(wPt),uNt=ZPt(SPt),dNt=ZPt(NPt),fNt=yxt,pNt=vxt,wNt=bxt,gNt=ZPt(WPt),mNt=class t{ - static init(i){ - return QPt(this,void 0,void 0,function*(){ - let s; - return(0,hNt.logDebug)("OKXUniversalProvider init() called"),(0,hNt.checkMetaData)(i.dappMetaData),(0,fNt.setGlobal)("disableProviderPing",!0),(0,hNt.getDefaultReporter)().configVersionAndSide("universalprovider","dapp",i.dappMetaData.name),window&&window.okxConnectUniversalinwindow&&window.okxConnectUniversalinwindow instanceof t?((0,hNt.logDebug)("OKXUniversalConnect init() old called"),s=window.okxConnectUniversalinwindow):((0,hNt.logDebug)("OKXUniversalConnect init() new called"),s=new t(i),window&&(window.okxConnectUniversalinwindow=s),yield s.initialize()),s} - )} - constructor(t){ - this.rpcProviders={ - } - ,this.events=new eNt.default,t.connector&&0!=t.connector.length||((0,pNt.isMobileDiscover)()?t.connector=[new hNt.OkxwalletInjectConnector]:t.connector=[new hNt.OKXAppConnector,new hNt.OKXWalletAppConnector,new hNt.OKXAppCommonConnector]),this.providerOpts=t,this.specialDAppLineType(this.providerOpts),(0,hNt.logDebug)("constructor this.providerOpts>>",JSON.stringify(this.providerOpts)); - let i=hNt.OpenAppLinkType.UniversalLink; - switch(t.openAppLinkType){ - case"universallink":default:i=hNt.OpenAppLinkType.UniversalLink; - break; - case"deeplink":i=hNt.OpenAppLinkType.DeepLink} - this.providerOpts.openAppLinkType=i,(0,hNt.logDebug)("OKXUniversalProvider constructor() linkType:",i)} - specialDAppLineType(t){ - let i=window.location.host; - i&&(i.includes("dappportal.io")||i.includes("connect.oker.vip"))&&!t.openAppLinkType&&((0,hNt.logDebug)("specialDAppLineType --\x3e host:",i),t.openAppLinkType=hNt.OpenAppLinkType.DeepLink)} - getOpenAppLinkType(){ - var t; - return null!==(t=this.providerOpts.openAppLinkType)&&void 0!==t?t:hNt.OpenAppLinkType.UniversalLink} - request(t,i){ - return QPt(this,void 0,void 0,function*(){ - if((0,hNt.logDebug)("OKXUniversalProvider request() called"),(0,hNt.reportLog)("OKXUniversalProvider request() called"),!this.connected())throw new hNt.OKXConnectError(hNt.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR); - (0,hNt.logDebug)("OKXUniversalProvider request() connected "); - const{ - namespace:s,requestParam:e} - =this.buildRequestParamFromRequest(t,i); - return yield this.getProvider(s).request(e)} - )} - buildRequestParamFromRequest(t,i){ - var s; - (0,hNt.logDebug)("UniversalProvider request args >>>>>>>: ",i,(0,hNt.safeJsonStringify)(t)); - let[e,n]=this.validateChain(i); - if(!this.session)throw new hNt.OKXConnectError(hNt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"Please call connect() before request()"); - let h=Object.keys(this.session.namespaces); - if(!i&&h&&h.length>1)throw new hNt.OKXConnectError(hNt.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR,"Multiple chains have been linked, the request method requires chain"); - let r=(0,hNt.replaceChainNameToChainId)(`${ - e} - :${ - n} - `); - return null!=r&&(e=r.split(":")[0],n=r.split(":")[1]),{ - namespace:e,requestParam:Object.assign(Object.assign({ - } - ,t),{ - chainId:`${ - e} - :${ - n} - `,redirect:null!==(s=t.redirect)&&void 0!==s?s:this.sessionConfig.redirect} - )} - } - enable(){ - return QPt(this,void 0,void 0,function*(){ - if(!this.client)throw new hNt.OKXConnectError(hNt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"Sign Client not initialized"); - if(!this.session){ - if(!this.connectOpts)throw new hNt.OKXConnectError(hNt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"Sign Client not initialized"); - yield this.connect(this.connectOpts)} - return yield this.requestAccounts()} - )} - disconnect(){ - return QPt(this,void 0,void 0,function*(){ - return(0,hNt.logDebug)("OKXUniversalProvider disconnect() called"),(0,hNt.reportLog)("provider disconnect called"),new Promise(t=>QPt(this,void 0,void 0,function*(){ - let i=!1; - const s=Qt(()=>QPt(this,void 0,void 0,function*(){ - i||(i=!0,yield this.disconnectAndEmit(),yield this.cleanup(),t(),(0,hNt.logDebug)("UniversalProvider disconnect Disconnected"),(0,hNt.reportLog)("provider disconnect disconnected"))} - ),"onRequestSent"); - try{ - yield this.client.disconnect(),yield s()} - catch(frt){ - yield s()} - } - ))} - )} - disconnectAndEmit(){ - var t,i,s; - this.client.engine.connectManagerDisconnect(),(null===(t=this.session)||void 0===t?void 0:t.topic)&&(this.events.emit("disconnect",{ - topic:null===(i=this.session)||void 0===i?void 0:i.topic} - ),this.events.emit("session_delete",{ - topic:null===(s=this.session)||void 0===s?void 0:s.topic} - ))} - replaceNamespace(t,i){ - var s,e; - let n=null===(s=t.namespaces)||void 0===s?void 0:s[i]; - if(null!=n){ - let s=this.replaceNamespaceInner(n); - null!=t.namespaces&&i in t.namespaces&&null!=s&&(t.namespaces[i]=s)} - let h=null===(e=t.optionalNamespaces)||void 0===e?void 0:e[i]; - if(null!=h){ - let s=this.replaceNamespaceInner(h); - null!=t.optionalNamespaces&&i in t.optionalNamespaces&&null!=s&&(t.optionalNamespaces[i]=s)} - return t} - replaceNamespaceInner(t){ - var i; - return null!=t&&(t.chains=null===(i=t.chains)||void 0===i?void 0:i.map(t=>(0,hNt.replaceChainNameToChainId)(t)),null!=t.defaultChain&&(t.defaultChain=(0,hNt.replaceChainNameToChainId)(t.defaultChain))),t} - replaceSessionAptos(t,i){ - var s; - let e=null===(s=null==t?void 0:t.namespaces)||void 0===s?void 0:s[i]; - if(null!=e&&null!=e.chains){ - e.chains=e.chains.map(t=>(0,hNt.replaceChainIdToChainName)(t)),e.accounts=e.accounts.map(t=>(0,hNt.replaceChainIdToChainName)(t)); - let s={ - } - ; - Object.keys(e.extra||{ - } - ).forEach((e,n)=>{ - (0,hNt.replaceChainIdToChainName)(e),s[(0,hNt.replaceChainIdToChainName)(e)]=Object.values((null==t?void 0:t.namespaces[i].extra)||{ - } - )[n]} - ),e.extra=s} - (0,hNt.logDebug)("replaceSessionAptos",t)} - connected(){ - (0,hNt.logDebug)("OKXUniversalProvider connected() called"),(0,hNt.reportLog)("provider connected called"); - let t=Qt(()=>{ - try{ - this.cleanup(),this.client.engine.connectManagerDisconnect()} - catch(frt){ - (0,hNt.logDebug)("Error during disconnect:",frt)} - } - ,"disconnectInner"); - try{ - return!(!this.session||!this.client.engine.getCurrentConnectionReady(Object.keys(this.session.namespaces))&&(t(),1))} - catch(frt){ - return t(),!1} - } - connectAndSign(t,i){ - return QPt(this,void 0,void 0,function*(){ - (0,hNt.logDebug)("OKXUniversalProvider connectAndSign() called"); - const s=Object.assign(Object.assign({ - } - ,t),i); - return(0,hNt.logDebug)("OKXUniversalProvider connectAndSign() opts:",JSON.stringify(t)),(0,hNt.logDebug)("OKXUniversalProvider connectAndSign() signRequest:",JSON.stringify(i)),yield this.connect(s)} - )} - connect(t){ - return QPt(this,void 0,void 0,function*(){ - if((0,hNt.logDebug)("OKXUniversalProvider connect() called"),(0,hNt.reportLog)("provider connect called"),null==t.sessionConfig&&(t.sessionConfig={ - } - ),!this.client)throw new hNt.OKXConnectError(hNt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"Sign Client not initialized"); - if(this.connected())return this.session; - t=this.replaceNamespace(t,"aptos"),(t=this.replaceNamespace(t,"solana")).sessionConfig.useMini&&(t.sessionConfig.useMini=void 0),null==t.sessionConfig.connectWalletType&&(t.sessionConfig.connectWalletType=hNt.ConnectWalletType.OKX_APP_COMMON),t.sessionConfig.connectWalletType==hNt.ConnectWalletType.OKX_MINI&&(t.sessionConfig.connectWalletType=hNt.ConnectWalletType.OKX_APP_COMMON),(0,hNt.logDebug)("OKXUniversalProvider connect >>>>",JSON.stringify(t)),void 0===t.sessionConfig.openUniversalUrl&&(t.sessionConfig.openUniversalUrl=(0,hNt.isMobileUserAgent)()),t.sessionConfig.openAppLinkType=this.providerOpts.openAppLinkType,this.setNamespaces(t); - try{ - (0,hNt.logDebug)(`UniversalProvider connect opts.stringify ====> ${ - JSON.stringify(t)} - `); - let i=yield this.client.connect(t); - if((0,hNt.logDebug)(`UniversalProvider connect success ====> ${ - JSON.stringify(i)} - `),i){ - if(this.replaceSessionAptos(i,"aptos"),this.replaceSessionAptos(i,"solana"),this.session=i,this.client.session=i,this.setConnectConnector(),(0,hNt.logDebug)("OKXUniversalProvider connect success opts>>>>",JSON.stringify(t)),this.onConnect(),t.signRequest&&t.signRequest.length>0){ - let i=t.signRequest[0],s=[]; - "undefined"!=typeof window&&window&&window.okxConnectUniversalUIinwindow?((0,hNt.logDebug)("OKXUniversalProvider connect success, us UI SDK>>>>"),this.session.signResponse&&this.session.signResponse.length>0&&(s=this.session.signResponse)):((0,hNt.logDebug)("OKXUniversalProvider connect success, us Universal SDK>>>>"),this.session.signResponse&&this.session.signResponse.length>0?s=this.session.signResponse:s.push((0,pNt.creatNotSupportMethodItemReplay)(i))),(0,hNt.logDebug)(`UniversalProvider connect success connectRequestReply ====> ${ - JSON.stringify(s)} - `),setTimeout(()=>{ - this.events.emit("connect_signResponse",s)} - ,100)} - return i} - return} - catch(i){ - throw(0,hNt.logDebug)("UniversalProvider connect error ====> ",JSON.stringify(i)),i} - } - )} - syncAllAddresses(){ - return QPt(this,void 0,void 0,function*(){ - if((0,wNt.syncAddressAvailable)(this.session.wallet))return this.client.syncAllAddress(); - throw new hNt.OKXConnectError(hNt.OKX_CONNECT_ERROR_CODES.METHOD_NOT_SUPPORTED)} - )} - setConnectConnector(){ - this.client.setConnectConnector(this.session)} - on(t,i){ - this.events.on(t,i)} - once(t,i){ - this.events.once(t,i)} - removeListener(t,i){ - this.events.removeListener(t,i)} - off(t,i){ - this.events.off(t,i)} - setDefaultChain(t,i){ - (0,hNt.logDebug)("OKXUniversalProvider setDefaultChain() called"); - try{ - if(!this.connected())return; - const[s,e]=this.validateChain(t); - this.getProvider(s).setDefaultChain(e,i)} - catch(s){ - if(!/Please call connect/.test(s.message))throw s} - } - tryToReconnect(){ - return QPt(this,void 0,void 0,function*(){ - yield this.checkStorage()} - )} - checkStorage(){ - return QPt(this,void 0,void 0,function*(){ - if(this.connected())return; - let t=yield this.getFromStore("connectSession"); - if((0,hNt.logDebug)(t),t){ - (0,hNt.logDebug)("checkStorage error start"); - try{ - let i=t; - if(this.session=i,this.client.session=this.session,this.setConnectConnector(),yield this.client.restoreconnect(i),!this.connected())throw new hNt.OKXConnectError(hNt.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR); - this.sessionConfig=i.sessionConfig,this.client.sessionConfig=this.sessionConfig,(0,hNt.logDebug)("[evm u-provider] do reconnection",this.session),this.createProviders(),this.registerEventListeners(),setTimeout(()=>{ - this.events.emit("reconnect",{ - session:this.session} - )} - ,100)} - catch(frt){ - yield this.cleanup(!1),(0,hNt.logDebug)(`checkStorage error ${ - JSON.stringify(frt)} - `)} - } - } - )} - initialize(){ - return QPt(this,void 0,void 0,function*(){ - (0,hNt.logDebug)("OKXUniversalProvider initialize() called"),(0,hNt.reportLog)("provider initialize called"); - const t=Object.assign({ - url:window.location.hostname,origin:window.location.origin} - ,this.providerOpts.dappMetaData); - this.client=new nNt.SignClient(t,this.events,this.providerOpts.openAppLinkType),this.registerConnector(this.providerOpts.connector),yield this.tryToReconnect()} - )} - createProviders(){ - if(!this.client)throw new hNt.OKXConnectError(hNt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"Sign Client not initialized"); - if(!this.connected())throw new hNt.OKXConnectError(hNt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"Session not initialized. Please call connect() before enable()"); - const t=[...new Set(Object.keys(this.session.namespaces).filter(t=>{ - var i,s; - return(null===(s=null===(i=this.session.namespaces[t])||void 0===i?void 0:i.accounts)||void 0===s?void 0:s.length)>0} - ).map(t=>(0,rNt.parseNamespaceKey)(t)))]; - this.rpcProviders={ - } - ,t.forEach(t=>{ - if(!this.session)return; - const i=this.session.namespaces[t]; - switch((0,hNt.logDebug)("init eip155 >> ",i),t){ - case"eip155":const s={ - namespace:i} - ; - this.rpcProviders[t]=new tNt.Eip155Provider(s,this.client,this.events); - break; - case"solana":const e={ - namespace:i} - ; - let n=new oNt.default(e,"solana",this.client,this.events); - this.rpcProviders[t]=n; - let h=new oNt.default(e,"sonic",this.client,this.events); - this.rpcProviders.sonic=h; - let r=new oNt.default(e,"svm",this.client,this.events); - this.rpcProviders.svm=r; - let o=new oNt.default(e,"soon",this.client,this.events); - this.rpcProviders.soon=o; - let a=new oNt.default(e,"eclipse",this.client,this.events); - this.rpcProviders.eclipse=a; - break; - case"ton":const c={ - namespace:i} - ; - let l=new lNt.default(c,this.client,this.events); - this.rpcProviders[t]=l; - break; - case"sui":const u={ - namespace:i} - ; - let d=new iNt.SuiProvider(u,this.client,this.events); - d.name="sui",this.rpcProviders[t]=d; - break; - case"btc":const f={ - namespace:i} - ; - let p=new aNt.default(f,"btc",this.client,this.events); - this.rpcProviders.btc=p; - let w=new aNt.default(f,"fractal",this.client,this.events); - this.rpcProviders.fractal=w; - break; - case"aptos":let g=new cNt.default({ - namespace:i} - ,"aptos",this.client,this.events); - this.rpcProviders[t]=g; - let m=new cNt.default({ - namespace:i} - ,"movement",this.client,this.events); - this.rpcProviders.movement=m; - break; - case"cosmos":let v=new uNt.default({ - namespace:i} - ,this.client,this.events); - this.rpcProviders[t]=v; - break; - case"tron":let _=new dNt.default({ - namespace:i} - ,this.client,this.events); - this.rpcProviders[t]=_; - break; - case"starknet":let M=new gNt.default({ - namespace:i} - ,"starknet",this.client,this.events); - this.rpcProviders[t]=M} - } - )} - registerEventListeners(){ - if(void 0===this.client)throw new hNt.OKXConnectError(hNt.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"Sign Client is not initialized"); - this.client.engine.addDisconnectListener(()=>{ - this.disconnectAndEmit(),this.cleanup()} - ),this.on(sNt.PROVIDER_EVENTS.DEFAULT_CHAIN_CHANGED,t=>{ - this.onChainChanged(t)} - ),this.on(sNt.PROVIDER_EVENTS.UPDATE_NAMESPACES,t=>{ - if(t){ - const i=Object.keys(t)[0]; - this.session&&(this.session.namespaces[i]=t[i],this.session&&(this.persist("connectSession",this.session),this.events.emit("session_update",this.session)),(0,hNt.logDebug)("PROVIDER_EVENTS.UPDATE_NAMESPACES this.session... ->>>",JSON.stringify(this.session)))} - } - )} - getProvider(t){ - return(0,hNt.logDebug)("current get providers",this.rpcProviders),(0,hNt.logDebug)("query namespace: ",t),this.rpcProviders[t]} - setNamespaces(t){ - this.connectOpts=t; - const{ - namespaces:i,sessionConfig:s} - =t,e={ - origin:window.location.origin,url:window.location.hostname,name:this.providerOpts.dappMetaData.name,icon:this.providerOpts.dappMetaData.icon,manifestUrl:this.providerOpts.dappMetaData.manifestUrl} - ; - this.sessionConfig=Object.assign({ - dappInfo:e} - ,s),(0,hNt.logDebug)("setNamespaces sessionConfig>>>",this.sessionConfig),this.client.sessionConfig=this.sessionConfig,this.persist("sessionConfig",s)} - validateChain(t){ - var i; - let[s,e]=(null==t?void 0:t.split(":"))||["",""]; - if(!this.session||!this.session.namespaces||!Object.keys(this.session.namespaces).length)return(0,hNt.logDebug)("get name & chain",s,e),[s,e]; - if(s){ - if(!this.isChainNamespaceInSession(s))throw new hNt.OKXConnectError(hNt.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR,`Namespace '${ - s} - ' is not configured. Please call connect() first with namespace config.`); - if(e&&t){ - (0,hNt.logDebug)("this.session.namespaces --\x3e> ",s,JSON.stringify(this.session.namespaces)); - const e=null===(i=this.session.namespaces[s])||void 0===i?void 0:i.chains; - if((0,hNt.logDebug)("get chainsArr & chain",JSON.stringify(e),t),e&&!e.includes(t))throw new hNt.OKXConnectError(hNt.OKX_CONNECT_ERROR_CODES.NOT_CONNECTED_ERROR,`Namespace not include the chain '${ - t} - '`)} - } - if(s&&e)return(0,hNt.logDebug)("get name & chain",s,e),[s,e]; - let n=(0,rNt.parseNamespaceKey)(Object.keys(this.session.namespaces)[0]); - const h=this.rpcProviders[n].getDefaultChain(); - return(0,hNt.logDebug)("get default chain:",h),[n,h]} - isChainNamespaceInSession(t){ - var i,s; - if(Object.keys((null===(i=this.session)||void 0===i?void 0:i.namespaces)||{ - } - ).map(t=>(0,rNt.parseNamespaceKey)(t)).includes(t))return!0; - let e=!1; - return Object.values((null===(s=this.session)||void 0===s?void 0:s.namespaces)||{ - } - ).forEach(i=>{ - i.chains.forEach(i=>{ - i.split(":")[0]==t&&(e=!0)} - )} - ),e} - requestAccountsWithNamespace(t){ - return this.getProvider(t).requestAccounts()} - requestDefaultChainWithNamespace(t){ - return this.getProvider(t).getDefaultChain()} - requestAccounts(){ - return QPt(this,void 0,void 0,function*(){ - const[t]=this.validateChain(); - return yield this.getProvider(t).requestAccounts()} - )} - onChainChanged(t){ - var i; - if(!(null===(i=this.session)||void 0===i?void 0:i.namespaces))return; - const[s,e]=this.validateChain(t); - e&&(this.session.namespaces[s]&&(this.session.namespaces[s].defaultChain=e,this.persist("connectSession",this.session)),this.events.emit("chainChanged",e))} - onConnect(){ - this.createProviders(),this.session&&this.persist("connectSession",this.session),this.events.emit("connect",{ - session:this.session} - ),this.registerEventListeners()} - cleanup(){ - return QPt(this,arguments,void 0,function*(t=!0){ - this.session=void 0,this.client.session=void 0,this.setConnectConnector(),this.sessionProperties=void 0,this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),t&&this.persist("connectSession",void 0)} - )} - persist(t,i){ - return(0,hNt.logDebug)("[evm u-provider] persisit data",t,i),this.client.engine.saveSessionContent(t,i)} - getFromStore(t){ - return QPt(this,void 0,void 0,function*(){ - return this.client.engine.getSessionContent(t)} - )} - showRequestModal(t,i){ - try{ - const{ - namespace:s,requestParam:e} - =this.buildRequestParamFromRequest(t,i); - return this.getProvider(s).showRequestModal(e)} - catch(frt){ - return!1} - } - openWallet(t,i){ - this.client.openWallet(t,i)} - registerConnector(t){ - this.client.registerConnector(t),this.client.setAccountChangeListener(t=>{ - (0,hNt.logDebug)("accountChangeListener session:",this.events.listenerCount("accountChanged"),JSON.stringify(t)); - try{ - t&&this.events.listenerCount("accountChanged")&&(this.replaceSessionAptos(t,"aptos"),this.replaceSessionAptos(t,"solana"),this.session=t,this.client.session=t,this.session&&this.persist("connectSession",this.session),this.setConnectConnector(),this.createProviders(),this.events.emit("accountChanged",this.session))} - catch(i){ - (0,hNt.logDebug)("setAccountChangeListener error:",JSON.stringify(i))} - } - )} - getEngine(){ - return this.client.engine} - } - ; - Qt(mNt,"OKXUniversalProvider"); - let vNt=mNt; - Bxt.OKXUniversalProvider=vNt,Bxt.default=vNt; - var _Nt,MNt={ - } - ; - function bNt(){ - var t; - if(_Nt)return MNt; - _Nt=1; - var i=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(MNt,"__esModule",{ - value:!0} - ),MNt.OKXBtcProvider=void 0; - const s=$Nt(),e=Mgt; - let n=(Qt(t=class{ - constructor(t){ - this.caip=["btc:mainnet","fractal:mainnet"],this.provider=t} - getAddressForChainId(t){ - var i,e; - if(null==this.checkChainId(t))throw new s.OKXConnectError(s.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"invalid chainId"); - let n=null===(e=null===(i=this.provider.session)||void 0===i?void 0:i.namespaces.btc)||void 0===e?void 0:e.accounts.filter(function(i){ - return i.startsWith(t)} - ); - if(null==n||n.length<0)throw new s.OKXConnectError(s.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"no connected account"); - return n[0].split(":")[2]} - getAccount(t){ - var i,e,n; - if(null==this.checkChainId(t))throw new s.OKXConnectError(s.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"invalid chainId"); - let h=null===(n=null===(e=null===(i=this.provider.session)||void 0===i?void 0:i.namespaces.btc)||void 0===e?void 0:e.extra)||void 0===n?void 0:n[t],r=""; - return null!=h&&(r=h.compressedPublicKey),{ - address:this.getAddressForChainId(t),publicKey:r} - } - signMessage(t,e,n){ - return i(this,void 0,void 0,function*(){ - if(null==this.checkChainId(t))throw new s.OKXConnectError(s.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"invalid chainId"); - if("undefined"===e)throw new s.OKXConnectError(s.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"the method signMessage parmas error"); - let i={ - signStr:e,from:this.getAddressForChainId(t)} - ; - n&&(i.type=n); - try{ - const s=yield this.provider.request({ - method:"btc_signMessage",params:i} - ,t); - return"result"in s?s.result:s.error} - catch(h){ - if(h instanceof s.OKXConnectError)throw h; - throw new s.OKXConnectError(s.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"the method signTransaction request error")} - } - )} - sendBitcoin(t,e,n,h){ - return i(this,void 0,void 0,function*(){ - if(null==this.checkChainId(t))throw new s.OKXConnectError(s.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"invalid chainId"); - let i={ - from:this.getAddressForChainId(t),to:e,value:(n/1e8).toString()} - ; - (null==h?void 0:h.feeRate)&&(i.satBytes=h.feeRate.toString()); - let r=yield this.send(t,i); - return void 0!==r&&"txhash"in r?r.txhash:r} - )} - send(t,e){ - return i(this,void 0,void 0,function*(){ - if(null==this.checkChainId(t))throw new s.OKXConnectError(s.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"invalid chainId"); - if(!this.checkParameters(e,"to","value"))throw new s.OKXConnectError(s.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"the method send parmas error"); - e.from=this.getAddressForChainId(t); - try{ - const i=yield this.provider.request({ - method:"btc_send",params:e} - ,t); - return"result"in i?{ - txhash:i.result} - :i.error} - catch(i){ - if(i instanceof s.OKXConnectError)throw i; - throw new s.OKXConnectError(s.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`the method send request error: ${ - i} - `)} - } - )} - signPsbt(t,s,e){ - return i(this,void 0,void 0,function*(){ - return new Promise((i,n)=>{ - this.signPsbts(t,[s],[e]).then(t=>{ - let s=JSON.parse(t); - i(s[0])} - ).catch(t=>{ - n(t)} - )} - )} - )} - signPsbts(t,e,n){ - return i(this,void 0,void 0,function*(){ - if(null==this.checkChainId(t))throw new s.OKXConnectError(s.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"invalid chainId"); - if(void 0===e)throw new s.OKXConnectError(s.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"the method signPsbts params error"); - let i={ - psbtHexs:e,options:n} - ; - i.from=this.getAddressForChainId(t); - try{ - const s=yield this.provider.request({ - method:"btc_signPsbts",params:i} - ,t); - if("result"in s)return s.result} - catch(h){ - if(h instanceof s.OKXConnectError)throw h; - throw new s.OKXConnectError(s.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`the method send request error: ${ - h} - `)} - } - )} - signAndPushPsbt(t,e,n){ - return i(this,void 0,void 0,function*(){ - if(null==this.checkChainId(t))throw new s.OKXConnectError(s.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"invalid chainId"); - if(void 0===e)throw new s.OKXConnectError(s.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"the method signPsbts params error"); - let i={ - psbtHex:e,options:n} - ; - i.from=this.getAddressForChainId(t); - try{ - const s=yield this.provider.request({ - method:"btc_signAndPushPsbt",params:i} - ,t); - return"result"in s?JSON.parse(s.result):s.error} - catch(h){ - if(h instanceof s.OKXConnectError)throw h; - throw new s.OKXConnectError(s.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,`the method send request error: ${ - h} - `)} - } - )} - sendInscription(t,e,n,h){ - return i(this,void 0,void 0,function*(){ - let i={ - address:e,inscriptionId:n,options:h} - ; - if(null==this.checkChainId(t))throw new s.OKXConnectError(s.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"invalid chainId"); - if("undefined"===e)throw new s.OKXConnectError(s.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"the method sendInscription params error"); - var r=0; - h&&"feeRate"in h&&(r=h.feeRate); - let o=this.getAddressForChainId(t); - var a=7; - if("undefined"!==n){ - let t="-Atomicals",i="-Ordinals"; - (null==n?void 0:n.toLowerCase().endsWith(t.toLowerCase()))?(a=8,n=this.removeSuffix(n,t)):(null==n?void 0:n.toLowerCase().endsWith(i.toLowerCase()))&&(n=this.removeSuffix(n,i))} - let c={ - scenario:5,feeRate:r,txType:"20",to:e,batchBean:[{ - coinAmount:"1",nftId:n,protocolId:a,coinId:"",inscriptionId:"",from:o} - ],extension:i} - ; - try{ - const i=yield this.provider.request({ - method:"btc_sendInscription",params:c,injectParams:{ - address:e,inscriptionId:n,options:h} - } - ,t); - return"result"in i?i.result:i.error} - catch(l){ - if(l instanceof s.OKXConnectError)throw l; - throw new s.OKXConnectError(s.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"the method signTransaction request error")} - } - )} - sendRunes(t,n,h,r,o){ - return i(this,void 0,void 0,function*(){ - try{ - if(!(t&&n&&h&&r))throw new s.OKXConnectError(s.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"The parameter is empty. Please check"); - let i,a=this.checkChainId(t); - if(null!=a&&(a.startsWith("btc")?i=13:a.startsWith("fractal")&&(i=16)),null==a||null==i)throw new s.OKXConnectError(s.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"invalid chainId"); - let c={ - fromAddress:this.getAddressForChainId(t),protocolId:i,address:n,runeid:h,amount:r,options:o} - ; - return(0,e.logDebug)("OKXBtcProvider sendRunes --\x3e",JSON.stringify(c)),(yield this.provider.request({ - method:"btc_sendRunes",params:c,injectParams:{ - address:n,runeid:h,amount:r,options:o} - } - ,t)).result} - catch(h6i){ - throw h6i} - } - )} - inscribeTransfer(t,n,h){ - return i(this,void 0,void 0,function*(){ - try{ - if(!t||!n||!h)throw new s.OKXConnectError(s.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"The parameter is empty. Please check"); - let i,r=this.checkChainId(t); - if(null!=r&&(r.startsWith("btc")?i=1:r.startsWith("fractal")&&(i=14)),null==r||null==i)throw new s.OKXConnectError(s.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"invalid chainId"); - let o={ - fromAddress:this.getAddressForChainId(t),protocolId:i,ticker:n,amount:h} - ; - (0,e.logDebug)("OKXBtcProvider inscribeTransfer --\x3e",JSON.stringify(o)),yield this.provider.request({ - method:"btc_inscribeTransfer",params:o} - ,t)} - catch(h6i){ - throw h6i} - } - )} - removeSuffix(t,i){ - return t.endsWith(i)?t.slice(0,t.length-i.length):t} - checkParameters(t,...i){ - var s=[]; - return i.forEach(i=>{ - `${ - i} - `in t||s.push(i)} - ),!(s.length>0)} - checkChainId(t){ - if(this.caip.includes(t)){ - let[i,s]=t.split(":"); - return i} - } - } - ,"OKXBtcProvider"),t); - return MNt.OKXBtcProvider=n,MNt.default=n,MNt} - Qt(bNt,"requireOKXBtcProvider"); - var yNt={ - } - ,ENt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(yNt,"__esModule",{ - value:!0} - ),yNt.OKXCosmosProvider=void 0; - const ANt=Mgt,SNt=class{ - constructor(t){ - this.provider=t} - getAccount(t){ - var i,s,e,n,h,r; - (0,ANt.logDebug)("OKXCosmosProvider getAccount chainId:",t),(0,ANt.logDebug)("OKXCosmosProvider getAccount namespaces:",JSON.stringify(null===(i=this.provider.session)||void 0===i?void 0:i.namespaces)); - let o=null===(e=null===(s=this.provider.session)||void 0===s?void 0:s.namespaces[ANt.NameSpaceKeyCosmos])||void 0===e?void 0:e.accounts.filter(function(i){ - return i.startsWith(t)} - )[0]; - if((0,ANt.logDebug)("OKXCosmosProvider getAccount account:",JSON.stringify(o)),!o)return; - const a=o.split(":"),c=o.split(":")[2]; - (0,ANt.logDebug)("OKXCosmosProvider getAccount address:",c); - let l=null===(r=null===(h=null===(n=this.provider.session)||void 0===n?void 0:n.namespaces[ANt.NameSpaceKeyCosmos])||void 0===h?void 0:h.extra)||void 0===r?void 0:r[`${ - a[0]} - :${ - a[1]} - `],u=""; - return null!=l&&(u=l.publicKey),c?{ - algo:"secp256k1",address:c,bech32Address:c,pubKey:this.hexToUint8Array(u)} - :void 0} - signArbitrary(t,i,s){ - return ENt(this,void 0,void 0,function*(){ - const e=window.btoa(s),n={ - chain_id:"",account_number:"0",sequence:"0",fee:{ - gas:"0",amount:[]} - ,msgs:[{ - type:"sign/MsgSignData",value:{ - signer:i,data:e} - } - ],memo:""} - ; - let h={ - chainId:t,method:"cosmos_signArbitrary",params:{ - signer:i,chain_id:t.split(":")[1],data:n} - } - ; - try{ - const i=yield this.provider.request(h,t); - return"result"in i?"string"==typeof i.result?JSON.parse(i.result):i.result:i.error} - catch(r){ - return r} - } - )} - signAmino(t,i,s,e){ - return ENt(this,void 0,void 0,function*(){ - if("sign/MsgSignData"==s.msgs[0].type){ - let e={ - chainId:t,method:"cosmos_signArbitrary",params:{ - signer:i,chain_id:t.split(":")[1],data:s} - } - ; - try{ - const i=yield this.provider.request(e,t); - return"result"in i?i.result:i.error} - catch(n){ - return n} - } - else{ - let h={ - chainId:t,method:"cosmos_signAmino",params:{ - signer:i,chainId:t.split(":")[1],sign_doc:s,signOptions:e} - } - ; - try{ - const i=yield this.provider.request(h,t); - if("result"in i){ - const t=JSON.parse(i.result); - return s.fee=t.signDoc.fee,{ - signed:s,signature:t.signature} - } - return i.error} - catch(n){ - return n} - } - } - )} - signDirect(t,i,s,e){ - return ENt(this,void 0,void 0,function*(){ - const n={ - bodyBytes:this.bufferToHex(s.bodyBytes),authInfoBytes:this.bufferToHex(s.authInfoBytes),chainId:s.chainId,accountNumber:s.accountNumber?s.accountNumber.toString():null,signOptions:e||null} - ; - let h={ - chainId:t,method:"cosmos_signDirect",params:{ - signer:i,chainId:t.split(":")[1],sign_doc:n} - } - ; - try{ - const i=yield this.provider.request(h,t); - if("result"in i){ - const t=JSON.parse(i.result); - return s.authInfoBytes=this.messageToBuffer(t.signDoc.authInfoBytes),{ - signed:s,signature:t.signature} - } - } - catch(r){ - return r} - } - )} - messageToBuffer(t){ - var i=Uint8Array.from([]); - try{ - i="string"==typeof t?this.hexToUint8Array(t.replace("0x","")):Uint8Array.from(t)} - catch(h6i){ - } - return i} - bufferToHex(t){ - return"0x"+[...new Uint8Array(t)].map(t=>t.toString(16).padStart(2,"0")).join("")} - hexToUint8Array(t){ - if(t.length%2!=0)throw"Invalid hexString"; - for(var i=new Uint8Array(t.length/2),s=0; - s<t.length; - s+=2){ - var e=parseInt(t.substr(s,2),16); - if(isNaN(e))throw"Invalid hexString"; - i[s/2]=e} - return i} - } - ; - Qt(SNt,"OKXCosmosProvider"); - let TNt=SNt; - yNt.OKXCosmosProvider=TNt; - var CNt,ONt={ - } - ; - function INt(){ - var t; - if(CNt)return ONt; - CNt=1; - var i=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(ONt,"__esModule",{ - value:!0} - ),ONt.OKXTonProvider=void 0; - const s=$Nt(),e=Mgt; - let n=(t=class{ - constructor(t){ - this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[],this.provider=t,this.provider.on("connect",()=>{ - let t=this.wallet(); - (0,e.logDebug)("OKXTONProvider event connect:",JSON.stringify(t)),this.statusChangeSubscriptions.forEach(i=>i(t))} - ),this.provider.on("reconnect",()=>{ - let t=this.wallet(); - (0,e.logDebug)("OKXTONProvider event reconnect:",JSON.stringify(t)),this.statusChangeSubscriptions.forEach(i=>i(t))} - ),this.provider.on("disconnect",()=>{ - (0,e.logDebug)("OKXTONProvider event disconnect:"),this.statusChangeSubscriptions.forEach(t=>t(null))} - ),this.provider.on("connect_error",t=>{ - (0,e.logDebug)("OKXTONProvider event connect_error:",JSON.stringify(t)),this.statusChangeErrorSubscriptions.forEach(i=>i(t))} - )} - connected(){ - return!!this.provider.connected()&&!!this.provider.session.namespaces.ton} - account(){ - try{ - if(!this.provider.session)return null; - let t=this.provider.session.namespaces.ton; - if(!t||!t.payload||!t.payload.ton_addr)return null; - let i=t.payload.ton_addr; - return{ - address:i.address,chain:i.network,walletStateInit:i.walletStateInit,publicKey:i.publicKey} - } - catch(frt){ - return(0,e.logDebug)("OKXTONProvider account error:",JSON.stringify(frt)),null} - } - wallet(){ - if(this.connected())try{ - let t=this.provider.session.wallet; - const i={ - device:{ - platform:t.platform,appName:t.appName,appVersion:t.appVersion,maxProtocolVersion:t.maxProtocolVersion,features:["ton_sendTransaction"]} - ,provider:"http",account:this.account()} - ; - let s=this.provider.session.namespaces.ton; - return s&&s.payload&&s.payload.ton_proof&&(i.connectItems={ - tonProof:s.payload.ton_proof} - ),(0,e.logDebug)("OKXTONProvider wallet :",JSON.stringify(i)),i} - catch(frt){ - return(0,e.logDebug)("OKXTONProvider wallet error:",JSON.stringify(frt)),null} - return null} - onStatusChange(t,i){ - return this.statusChangeSubscriptions.push(t),i&&this.statusChangeErrorSubscriptions.push(i),()=>{ - this.statusChangeSubscriptions=this.statusChangeSubscriptions.filter(i=>i!==t),i&&(this.statusChangeErrorSubscriptions=this.statusChangeErrorSubscriptions.filter(t=>t!==i))} - } - sendTransaction(t){ - return i(this,void 0,void 0,function*(){ - if(t.network&&t.network!==e.TONCHAIN.MAINNET)throw new s.OKXConnectError(s.OKX_CONNECT_ERROR_CODES.UNKNOWN_ERROR,"OKXTONProvider sendTransaction network error"); - if(t.network||(t.network=e.TONCHAIN.MAINNET),this.provider.session&&!t.from){ - const i=this.provider.requestAccountsWithNamespace("ton"); - t.from=i[0]} - const i={ - method:"ton_sendTransaction",params:t} - ; - let n="ton:"+e.TONCHAIN.MAINNET; - return(0,e.logDebug)("OKXTONProvider sendTransaction transaction----:",n,JSON.stringify(i)),this.provider.request(i,n)} - )} - } - ,Qt(t,"OKXTonProvider"),t); - return ONt.OKXTonProvider=n,ONt.default=n,ONt} - Qt(INt,"requireOKXTonProvider"); - var kNt={ - } - ,xNt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(kNt,"__esModule",{ - value:!0} - ),kNt.OKXTronProvider=void 0; - const RNt=Mgt,PNt=class{ - constructor(t){ - this.TRON_CHAIN_ID="tron:mainnet",this.provider=t} - getChain(t){ - if(null==t&&(t=this.TRON_CHAIN_ID),t!=this.TRON_CHAIN_ID)throw new RNt.OKXConnectError(RNt.OKX_CONNECT_ERROR_CODES.CHAIN_NOT_SUPPORTED,"The chainId:"+t+"is wrong for OKXTronProvider"); - return t} - getAccount(t){ - var i,s,e,n,h; - t=this.getChain(t); - let r=null===(s=null===(i=this.provider.session)||void 0===i?void 0:i.namespaces[RNt.NameSpaceKeyTron])||void 0===s?void 0:s.accounts.filter(function(i){ - return i.startsWith(t)} - )[0]; - if(!r)return; - const o=r.split(":"),a=r.split(":")[2]; - let c=null===(h=null===(n=null===(e=this.provider.session)||void 0===e?void 0:e.namespaces[RNt.NameSpaceKeyTron])||void 0===n?void 0:n.extra)||void 0===h?void 0:h[`${ - o[0]} - :${ - o[1]} - `]; - return null!=c&&c.publicKey,a?{ - address:a} - :void 0} - stringToHex(t){ - let i=""; - for(let s=0; - s<t.length; - s++)i+=t.charCodeAt(s).toString(16).padStart(2,"0"); - return i} - signMessage(t,i){ - return xNt(this,void 0,void 0,function*(){ - let s={ - chainId:i=this.getChain(i),method:"tron_signMessage",params:{ - message:this.stringToHex(t)} - } - ; - try{ - const t=yield this.provider.request(s,i); - return"result"in t?t.result:t.error} - catch(e){ - return e} - } - )} - signMessageV2(t,i){ - return xNt(this,void 0,void 0,function*(){ - let s={ - chainId:i=this.getChain(i),method:"tron_signMessageV2",params:{ - message:t} - } - ; - try{ - const t=yield this.provider.request(s,i); - return"result"in t?t.result:t.error} - catch(e){ - return e} - } - )} - signTransaction(t,i){ - return xNt(this,void 0,void 0,function*(){ - i=this.getChain(i); - let s={ - method:"tron_signTransaction",params:t} - ; - try{ - const t=yield this.provider.request(s,i); - if("result"in t){ - let i; - i="string"==typeof t.result?JSON.parse(t.result):t.result; - let s={ - } - ; - s.visible=i.visible,s.txID=i.txID; - let e={ - } - ; - return e.contract=i.raw_data.contract,e.expiration=i.raw_data.expiration,e.ref_block_bytes=i.raw_data.ref_block_bytes,e.fee_limit=i.raw_data.fee_limit,e.ref_block_hash=i.raw_data.ref_block_hash,e.timestamp=i.raw_data.timestamp,s.raw_data=e,s.raw_data_hex=i.raw_data_hex,s.signature=i.signature,s} - } - catch(e){ - return e} - } - )} - signAndSendTransaction(t,i){ - return xNt(this,void 0,void 0,function*(){ - i=this.getChain(i); - let s={ - method:"tron_signAndSendTransaction",params:t} - ; - try{ - const t=yield this.provider.request(s,i); - if("result"in t)return t.result} - catch(e){ - return e} - } - )} - } - ; - Qt(PNt,"OKXTronProvider"); - let NNt=PNt; - kNt.OKXTronProvider=NNt; - var LNt={ - } - ,DNt=pi&&pi.__awaiter||function(t,i,s,e){ - function n(t){ - return t instanceof s?t:new s(function(i){ - i(t)} - )} - return Qt(n,"adopt"),new(s||(s=Promise))(function(s,h){ - function r(t){ - try{ - a(e.next(t))} - catch(frt){ - h(frt)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(frt){ - h(frt)} - } - function a(t){ - t.done?s(t.value):n(t.value).then(r,o)} - Qt(r,"fulfilled"),Qt(o,"rejected"),Qt(a,"step"),a((e=e.apply(t,i||[])).next())} - )} - ; - Object.defineProperty(LNt,"__esModule",{ - value:!0} - ),LNt.OKXStarknetProvider=void 0; - const GNt=Mgt,BNt=class{ - constructor(t){ - this.STARKNET_CHAIN_ID="starknet:mainnet",this.provider=t} - getChain(t){ - if(null==t&&(t=this.STARKNET_CHAIN_ID),t!=this.STARKNET_CHAIN_ID)throw new GNt.OKXConnectError(GNt.OKX_CONNECT_ERROR_CODES.CHAIN_NOT_SUPPORTED,"The chainId:"+t+"is wrong for OKXStarknetProvider"); - return t} - getAccount(t){ - var i,s,e,n,h; - let r=null===(s=null===(i=this.provider.session)||void 0===i?void 0:i.namespaces[GNt.NameSpaceKeyStarknet])||void 0===s?void 0:s.accounts.filter(function(i){ - return i.startsWith(t)} - )[0]; - if(!r)return; - const o=r.split(":"),a=r.split(":")[2]; - let c=null===(h=null===(n=null===(e=this.provider.session)||void 0===e?void 0:e.namespaces[GNt.NameSpaceKeyStarknet])||void 0===n?void 0:n.extra)||void 0===h?void 0:h[`${ - o[0]} - :${ - o[1]} - `],l=""; - return null!=c&&(l=c.publicKey),a?{ - address:a,pubKey:l} - :void 0} - signMessage(t,i,s){ - return DNt(this,void 0,void 0,function*(){ - s=this.getChain(s),0==t.length&&(t=this.getAccount(s).address); - let e={ - chainId:s,method:"starknet_signMessage",params:{ - accountAddress:t,typedData:i} - } - ; - try{ - const t=yield this.provider.request(e,s); - if("result"in t){ - let i=t.result; - return"string"==typeof i&&(i=JSON.parse(i)),[i.signedDataR,i.signedDataS]} - return t.error} - catch(n){ - return n} - } - )} - sendTransaction(t,i,s){ - return DNt(this,void 0,void 0,function*(){ - s=this.getChain(s); - let e={ - accountAddress:t,executionRequest:i} - ,n={ - method:"starknet_sendTransaction",params:{ - data:JSON.stringify(e),from:t} - } - ; - try{ - const t=yield this.provider.request(n,s); - return"result"in t?{ - transaction_hash:t.result} - :t.error} - catch(h){ - return h} - } - )} - signMessageDeclareContractPayload(t,i){ - return DNt(this,void 0,void 0,function*(){ - i=this.getChain(i); - try{ - let s={ - method:"starknet_signMessage",params:t} - ; - const e=yield this.provider.request(s,i); - return"result"in e?{ - transaction_hash:e.result.txHash,class_hash:e.result.classHash} - :e.error} - catch(s){ - return s} - } - )} - sendMessageExecuteTransactionDetail(t,i,s,e,n){ - return DNt(this,void 0,void 0,function*(){ - n=this.getChain(n); - const h={ - calls:Array.isArray(i)?i:[i],abis:s,transactionsDetail:{ - nonce:null==e?void 0:e.nonce,maxFee:null==e?void 0:e.nonce,version:null==e?void 0:e.version} - } - ; - return this.sendTransaction(t,h,n)} - )} - } - ; - Qt(BNt,"OKXStarknetProvider"); - let UNt=BNt; - var FNt; - function $Nt(){ - return FNt||(FNt=1,function(t){ - var i=pi&&pi.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=pi&&pi.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.OKXStarknetProvider=t.OKXTronProvider=t.OKXTonProvider=t.OKXCosmosProvider=t.OKXBtcProvider=t.OKXUniversalProvider=void 0,s(uxt,t),s(vxt,t); - var e=Bxt; - Object.defineProperty(t,"OKXUniversalProvider",{ - enumerable:!0,get:Qt(function(){ - return e.OKXUniversalProvider} - ,"get")} - ); - var n=bNt(); - Object.defineProperty(t,"OKXBtcProvider",{ - enumerable:!0,get:Qt(function(){ - return n.OKXBtcProvider} - ,"get")} - ); - var h=yNt; - Object.defineProperty(t,"OKXCosmosProvider",{ - enumerable:!0,get:Qt(function(){ - return h.OKXCosmosProvider} - ,"get")} - ); - var r=INt(); - Object.defineProperty(t,"OKXTonProvider",{ - enumerable:!0,get:Qt(function(){ - return r.OKXTonProvider} - ,"get")} - ); - var o=kNt; - Object.defineProperty(t,"OKXTronProvider",{ - enumerable:!0,get:Qt(function(){ - return o.OKXTronProvider} - ,"get")} - ); - var a=LNt; - Object.defineProperty(t,"OKXStarknetProvider",{ - enumerable:!0,get:Qt(function(){ - return a.OKXStarknetProvider} - ,"get")} - ),s(Mgt,t)} - (lxt)),lxt} - LNt.OKXStarknetProvider=UNt,Qt($Nt,"requireSrc"); - var HNt,WNt,VNt,jNt,KNt,zNt,YNt,qNt,XNt,JNt,QNt,ZNt=$Nt(),tLt=Object.defineProperty,iLt=Object.defineProperties,sLt=Object.getOwnPropertyDescriptors,eLt=Object.getOwnPropertySymbols,nLt=Object.prototype.hasOwnProperty,hLt=Object.prototype.propertyIsEnumerable,rLt=Qt((t,i,s)=>i in t?tLt(t,i,{ - enumerable:!0,configurable:!0,writable:!0,value:s} - ):t[i]=s,"__defNormalProp$2"),oLt=Qt((t,i)=>{ - for(var s in i||(i={ - } - ))nLt.call(i,s)&&rLt(t,s,i[s]); - if(eLt)for(var s of eLt(i))hLt.call(i,s)&&rLt(t,s,i[s]); - return t} - ,"__spreadValues"),aLt=Qt((t,i)=>iLt(t,sLt(i)),"__spreadProps"),cLt=Qt((t,i,s)=>(rLt(t,"symbol"!=typeof i?i+"":i,s),s),"__publicField$2"),lLt=Qt((t,i,s)=>{ - if(!i.has(t))throw TypeError("Cannot "+s)} - ,"__accessCheck"),uLt=Qt((t,i,s)=>(lLt(t,i,"read from private field"),s?s.call(t):i.get(t)),"__privateGet"),dLt=Qt((t,i,s)=>{ - if(i.has(t))throw TypeError("Cannot add the same private member more than once"); - i instanceof WeakSet?i.add(t):i.set(t,s)} - ,"__privateAdd"),fLt=Qt((t,i,s,e)=>(lLt(t,i,"write to private field"),i.set(t,s),s),"__privateSet"),pLt=Qt((t,i,s,e)=>({ - set _(s){ - fLt(t,i,s)} - ,get _(){ - return uLt(t,i,e)} - } - ),"__privateWrapper"),wLt=Qt((t,i,s)=>new Promise((e,n)=>{ - var h=Qt(t=>{ - try{ - o(s.next(t))} - catch(i){ - n(i)} - } - ,"fulfilled"),r=Qt(t=>{ - try{ - o(s.throw(t))} - catch(i){ - n(i)} - } - ,"rejected"),o=Qt(t=>t.done?e(t.value):Promise.resolve(t.value).then(h,r),"step"); - o((s=s.apply(t,i)).next())} - ),"__async"),gLt=(t=>(t.DARK="DARK",t.LIGHT="LIGHT",t))(gLt||{ - } - ); - const mLt=class extends Mgt.OKXConnectError{ - constructor(t){ - super(1,t)} - } - ; - Qt(mLt,"OKXConnectUiError"); - let vLt=mLt; - const _Lt=Qt((t,i)=>t===i,"equalFn"),MLt=Symbol("solid-proxy"),bLt="function"==typeof Proxy,yLt=Symbol("solid-track"),ELt={ - equals:_Lt} - ; - let ALt=sDt; - const SLt=1,TLt=2,CLt={ - owned:null,cleanups:null,context:null,owner:null} - ; - var OLt=null; - let ILt=null,kLt=null,xLt=null,RLt=null,PLt=0; - function NLt(t,i){ - const s=kLt,e=OLt,n=0===t.length,h=void 0===i?e:i,r=n?CLt:{ - owned:null,cleanups:null,context:h?h.context:null,owner:h} - ,o=n?t:()=>t(()=>$Lt(()=>rDt(r))); - OLt=r,kLt=null; - try{ - return tDt(o,!0)} - finally{ - kLt=s,OLt=e} - } - function LLt(t,i){ - const s={ - value:t,observers:null,observerSlots:null,comparator:(i=i?Object.assign({ - } - ,ELt,i):ELt).equals||void 0} - ,e=Qt(t=>("function"==typeof t&&(t=t(s.value)),qLt(s,t)),"setter"); - return[YLt.bind(s),e]} - function DLt(t,i,s){ - XLt(QLt(t,i,!0,SLt))} - function GLt(t,i,s){ - XLt(QLt(t,i,!1,SLt))} - function BLt(t,i,s){ - ALt=eDt; - const e=QLt(t,i,!1,SLt); - s&&s.render||(e.user=!0),RLt?RLt.push(e):XLt(e)} - function ULt(t,i,s){ - s=s?Object.assign({ - } - ,ELt,s):ELt; - const e=QLt(t,i,!0,0); - return e.observers=null,e.observerSlots=null,e.comparator=s.equals||void 0,XLt(e),YLt.bind(e)} - function FLt(t){ - return tDt(t,!1)} - function $Lt(t){ - if(null===kLt)return t(); - const i=kLt; - kLt=null; - try{ - return t()} - finally{ - kLt=i} - } - function HLt(t){ - BLt(()=>$Lt(t))} - function WLt(t){ - return null===OLt||(null===OLt.cleanups?OLt.cleanups=[t]:OLt.cleanups.push(t)),t} - function VLt(){ - return kLt} - function jLt(t,i){ - const s=Symbol("context"); - return{ - id:s,Provider:lDt(s),defaultValue:t} - } - function KLt(t){ - let i; - return OLt&&OLt.context&&void 0!==(i=OLt.context[t.id])?i:t.defaultValue} - function zLt(t){ - const i=ULt(t),s=ULt(()=>cDt(i())); - return s.toArray=()=>{ - const t=s(); - return Array.isArray(t)?t:null!=t?[t]:[]} - ,s} - function YLt(){ - if(this.sources&&this.state)if(this.state===SLt)XLt(this); - else{ - const t=xLt; - xLt=null,tDt(()=>nDt(this),!1),xLt=t} - if(kLt){ - const t=this.observers?this.observers.length:0; - kLt.sources?(kLt.sources.push(this),kLt.sourceSlots.push(t)):(kLt.sources=[this],kLt.sourceSlots=[t]),this.observers?(this.observers.push(kLt),this.observerSlots.push(kLt.sources.length-1)):(this.observers=[kLt],this.observerSlots=[kLt.sources.length-1])} - return this.value} - function qLt(t,i,s){ - let e=t.value; - return t.comparator&&t.comparator(e,i)||(t.value=i,t.observers&&t.observers.length&&tDt(()=>{ - for(let i=0; - i<t.observers.length; - i+=1){ - const s=t.observers[i],e=ILt&&ILt.running; - e&&ILt.disposed.has(s),(e?s.tState:s.state)||(s.pure?xLt.push(s):RLt.push(s),s.observers&&hDt(s)),e||(s.state=SLt)} - if(xLt.length>1e6)throw xLt=[],new Error} - ,!1)),i} - function XLt(t){ - if(!t.fn)return; - rDt(t); - const i=PLt; - JLt(t,t.value,i)} - function JLt(t,i,s){ - let e; - const n=OLt,h=kLt; - kLt=OLt=t; - try{ - e=t.fn(i)} - catch(h6i){ - return t.pure&&(t.state=SLt,t.owned&&t.owned.forEach(rDt),t.owned=null),t.updatedAt=s+1,aDt(h6i)} - finally{ - kLt=h,OLt=n} - (!t.updatedAt||t.updatedAt<=s)&&(null!=t.updatedAt&&"observers"in t?qLt(t,e):t.value=e,t.updatedAt=s)} - function QLt(t,i,s,e=SLt,n){ - const h={ - fn:t,state:e,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:i,owner:OLt,context:OLt?OLt.context:null,pure:s} - ; - return null===OLt||OLt!==CLt&&(OLt.owned?OLt.owned.push(h):OLt.owned=[h]),h} - function ZLt(t){ - if(0===t.state)return; - if(t.state===TLt)return nDt(t); - if(t.suspense&&$Lt(t.suspense.inFallback))return t.suspense.effects.push(t); - const i=[t]; - for(; - (t=t.owner)&&(!t.updatedAt||t.updatedAt<PLt); - )t.state&&i.push(t); - for(let s=i.length-1; - s>=0; - s--)if((t=i[s]).state===SLt)XLt(t); - else if(t.state===TLt){ - const s=xLt; - xLt=null,tDt(()=>nDt(t,i[0]),!1),xLt=s} - } - function tDt(t,i){ - if(xLt)return t(); - let s=!1; - i||(xLt=[]),RLt?s=!0:RLt=[],PLt++; - try{ - const i=t(); - return iDt(s),i} - catch(h6i){ - s||(RLt=null),xLt=null,aDt(h6i)} - } - function iDt(t){ - if(xLt&&(sDt(xLt),xLt=null),t)return; - const i=RLt; - RLt=null,i.length&&tDt(()=>ALt(i),!1)} - function sDt(t){ - for(let i=0; - i<t.length; - i++)ZLt(t[i])} - function eDt(t){ - let i,s=0; - for(i=0; - i<t.length; - i++){ - const e=t[i]; - e.user?t[s++]=e:ZLt(e)} - for(i=0; - i<s; - i++)ZLt(t[i])} - function nDt(t,i){ - t.state=0; - for(let s=0; - s<t.sources.length; - s+=1){ - const e=t.sources[s]; - if(e.sources){ - const t=e.state; - t===SLt?e!==i&&(!e.updatedAt||e.updatedAt<PLt)&&ZLt(e):t===TLt&&nDt(e,i)} - } - } - function hDt(t){ - for(let i=0; - i<t.observers.length; - i+=1){ - const s=t.observers[i]; - s.state||(s.state=TLt,s.pure?xLt.push(s):RLt.push(s),s.observers&&hDt(s))} - } - function rDt(t){ - let i; - if(t.sources)for(; - t.sources.length; - ){ - const i=t.sources.pop(),s=t.sourceSlots.pop(),e=i.observers; - if(e&&e.length){ - const t=e.pop(),n=i.observerSlots.pop(); - s<e.length&&(t.sourceSlots[n]=s,e[s]=t,i.observerSlots[s]=n)} - } - if(t.tOwned){ - for(i=t.tOwned.length-1; - i>=0; - i--)rDt(t.tOwned[i]); - delete t.tOwned} - if(t.owned){ - for(i=t.owned.length-1; - i>=0; - i--)rDt(t.owned[i]); - t.owned=null} - if(t.cleanups){ - for(i=t.cleanups.length-1; - i>=0; - i--)t.cleanups[i](); - t.cleanups=null} - t.state=0} - function oDt(t){ - return t instanceof Error?t:new Error("string"==typeof t?t:"Unknown error",{ - cause:t} - )} - function aDt(t,i=OLt){ - throw oDt(t)} - function cDt(t){ - if("function"==typeof t&&!t.length)return cDt(t()); - if(Array.isArray(t)){ - const i=[]; - for(let s=0; - s<t.length; - s++){ - const e=cDt(t[s]); - Array.isArray(e)?i.push.apply(i,e):i.push(e)} - return i} - return t} - function lDt(t,i){ - return Qt(function(i){ - let s; - return GLt(()=>s=$Lt(()=>(OLt.context=aLt(oLt({ - } - ,OLt.context),{ - [t]:i.value} - ),zLt(()=>i.children))),void 0),s} - ,"provider")} - Qt(NLt,"createRoot"),Qt(LLt,"createSignal"),Qt(DLt,"createComputed"),Qt(GLt,"createRenderEffect"),Qt(BLt,"createEffect"),Qt(ULt,"createMemo"),Qt(FLt,"batch"),Qt($Lt,"untrack"),Qt(HLt,"onMount"),Qt(WLt,"onCleanup"),Qt(VLt,"getListener"),Qt(jLt,"createContext"),Qt(KLt,"useContext"),Qt(zLt,"children"),Qt(YLt,"readSignal"),Qt(qLt,"writeSignal"),Qt(XLt,"updateComputation"),Qt(JLt,"runComputation"),Qt(QLt,"createComputation"),Qt(ZLt,"runTop"),Qt(tDt,"runUpdates"),Qt(iDt,"completeUpdates"),Qt(sDt,"runQueue"),Qt(eDt,"runUserEffects"),Qt(nDt,"lookUpstream"),Qt(hDt,"markDownstream"),Qt(rDt,"cleanNode"),Qt(oDt,"castError"),Qt(aDt,"handleError"),Qt(cDt,"resolveChildren"),Qt(lDt,"createProvider"); - const uDt=Symbol("fallback"); - function dDt(t){ - for(let i=0; - i<t.length; - i++)t[i]()} - function fDt(t,i,s={ - } - ){ - let e=[],n=[],h=[],r=0,o=i.length>1?[]:null; - return WLt(()=>dDt(h)),()=>{ - let a,c,l=t()||[],u=l.length; - return l[yLt],$Lt(()=>{ - let t,i,f,p,w,g,m,v,_; - if(0===u)0!==r&&(dDt(h),h=[],e=[],n=[],r=0,o&&(o=[])),s.fallback&&(e=[uDt],n[0]=NLt(t=>(h[0]=t,s.fallback())),r=1); - else if(0===r){ - for(n=new Array(u),c=0; - c<u; - c++)e[c]=l[c],n[c]=NLt(d); - r=u} - else{ - for(f=new Array(u),p=new Array(u),o&&(w=new Array(u)),g=0,m=Math.min(r,u); - g<m&&e[g]===l[g]; - g++); - for(m=r-1,v=u-1; - m>=g&&v>=g&&e[m]===l[v]; - m--,v--)f[v]=n[m],p[v]=h[m],o&&(w[v]=o[m]); - for(t=new Map,i=new Array(v+1),c=v; - c>=g; - c--)_=l[c],a=t.get(_),i[c]=void 0===a?-1:a,t.set(_,c); - for(a=g; - a<=m; - a++)_=e[a],c=t.get(_),void 0!==c&&-1!==c?(f[c]=n[a],p[c]=h[a],o&&(w[c]=o[a]),c=i[c],t.set(_,c)):h[a](); - for(c=g; - c<u; - c++)c in f?(n[c]=f[c],h[c]=p[c],o&&(o[c]=w[c],o[c](c))):n[c]=NLt(d); - n=n.slice(0,r=u),e=l.slice(0)} - return n} - ); - function d(t){ - if(h[c]=t,o){ - const[t,s]=LLt(c); - return o[c]=s,i(l[c],t)} - return i(l[c])} - } - } - function pDt(t,i){ - return $Lt(()=>t(i||{ - } - ))} - function wDt(){ - return!0} - Qt(dDt,"dispose"),Qt(fDt,"mapArray"),Qt(pDt,"createComponent"),Qt(wDt,"trueFn"); - const gDt={ - get:(t,i,s)=>i===MLt?s:t.get(i),has:(t,i)=>i===MLt||t.has(i),set:wDt,deleteProperty:wDt,getOwnPropertyDescriptor:(t,i)=>({ - configurable:!0,enumerable:!0,get:()=>t.get(i),set:wDt,deleteProperty:wDt} - ),ownKeys:t=>t.keys()} - ; - function mDt(t){ - return(t="function"==typeof t?t():t)?t:{ - } - } - function vDt(){ - for(let t=0,i=this.length; - t<i; - ++t){ - const i=this[t](); - if(void 0!==i)return i} - } - function _Dt(...t){ - let i=!1; - for(let r=0; - r<t.length; - r++){ - const s=t[r]; - i=i||!!s&&MLt in s,t[r]="function"==typeof s?(i=!0,ULt(s)):s} - if(bLt&&i)return new Proxy({ - get(i){ - for(let s=t.length-1; - s>=0; - s--){ - const e=mDt(t[s])[i]; - if(void 0!==e)return e} - } - ,has(i){ - for(let s=t.length-1; - s>=0; - s--)if(i in mDt(t[s]))return!0; - return!1} - ,keys(){ - const i=[]; - for(let s=0; - s<t.length; - s++)i.push(...Object.keys(mDt(t[s]))); - return[...new Set(i)]} - } - ,gDt); - const s={ - } - ,e=Object.create(null); - for(let r=t.length-1; - r>=0; - r--){ - const i=t[r]; - if(!i)continue; - const n=Object.getOwnPropertyNames(i); - for(let t=n.length-1; - t>=0; - t--){ - const h=n[t]; - if("__proto__"===h||"constructor"===h)continue; - const r=Object.getOwnPropertyDescriptor(i,h); - if(e[h]){ - const t=s[h]; - t&&(r.get?t.push(r.get.bind(i)):void 0!==r.value&&t.push(()=>r.value))} - else e[h]=r.get?{ - enumerable:!0,configurable:!0,get:vDt.bind(s[h]=[r.get.bind(i)])} - :void 0!==r.value?r:void 0} - } - const n={ - } - ,h=Object.keys(e); - for(let r=h.length-1; - r>=0; - r--){ - const t=h[r],i=e[t]; - i&&i.get?Object.defineProperty(n,t,i):n[t]=i?i.value:void 0} - return n} - function MDt(t,...i){ - if(bLt&&MLt in t){ - const s=new Set(i.length>1?i.flat():i[0]),e=i.map(i=>new Proxy({ - get:s=>i.includes(s)?t[s]:void 0,has:s=>i.includes(s)&&s in t,keys:()=>i.filter(i=>i in t)} - ,gDt)); - return e.push(new Proxy({ - get:i=>s.has(i)?void 0:t[i],has:i=>!s.has(i)&&i in t,keys:()=>Object.keys(t).filter(t=>!s.has(t))} - ,gDt)),e} - const s={ - } - ,e=i.map(()=>({ - } - )); - for(const n of Object.getOwnPropertyNames(t)){ - const h=Object.getOwnPropertyDescriptor(t,n),r=!h.get&&!h.set&&h.enumerable&&h.writable&&h.configurable; - let o=!1,a=0; - for(const t of i)t.includes(n)&&(o=!0,r?e[a][n]=h.value:Object.defineProperty(e[a],n,h)),++a; - o||(r?s[n]=h.value:Object.defineProperty(s,n,h))} - return[...e,s]} - Qt(mDt,"resolveSource"),Qt(vDt,"resolveSources"),Qt(_Dt,"mergeProps"),Qt(MDt,"splitProps"); - const bDt=Qt(t=>`Stale read from <${ - t} - >.`,"narrowedError"); - function yDt(t){ - const i="fallback"in t&&{ - fallback:Qt(()=>t.fallback,"fallback")} - ; - return ULt(fDt(()=>t.each,t.children,i||void 0))} - function EDt(t){ - const i=t.keyed,s=ULt(()=>t.when,void 0,void 0),e=i?s:ULt(s,void 0,{ - equals:Qt((t,i)=>!t==!i,"equals")} - ); - return ULt(()=>{ - const n=e(); - if(n){ - const h=t.children; - return"function"==typeof h&&h.length>0?$Lt(()=>h(i?n:()=>{ - if(!$Lt(e))throw bDt("Show"); - return s()} - )):h} - return t.fallback} - ,void 0,void 0)} - function ADt(t){ - const i=zLt(()=>t.children),s=ULt(()=>{ - const t=i(),s=Array.isArray(t)?t:[t]; - let e=Qt(()=>{ - } - ,"func"); - for(let i=0; - i<s.length; - i++){ - const t=i,n=s[i],h=e,r=ULt(()=>h()?void 0:n.when,void 0,void 0),o=n.keyed?r:ULt(r,void 0,{ - equals:Qt((t,i)=>!t==!i,"equals")} - ); - e=Qt(()=>h()||(o()?[t,r,n]:void 0),"func")} - return e} - ); - return ULt(()=>{ - const i=s()(); - if(!i)return t.fallback; - const[e,n,h]=i,r=h.children; - return"function"==typeof r&&r.length>0?$Lt(()=>r(h.keyed?n():()=>{ - var t; - if((null==(t=$Lt(s)())?void 0:t[0])!==e)throw bDt("Match"); - return n()} - )):r} - ,void 0,void 0)} - function SDt(t){ - return t} - Qt(yDt,"For"),Qt(EDt,"Show"),Qt(ADt,"Switch"),Qt(SDt,"Match"); - const TDt=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline","allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"]),CDt=new Set(["innerHTML","textContent","innerText","children"]),ODt=Object.assign(Object.create(null),{ - className:"class",htmlFor:"for"} - ),IDt=Object.assign(Object.create(null),{ - class:"className",formnovalidate:{ - $:"formNoValidate",BUTTON:1,INPUT:1} - ,ismap:{ - $:"isMap",IMG:1} - ,nomodule:{ - $:"noModule",SCRIPT:1} - ,playsinline:{ - $:"playsInline",VIDEO:1} - ,readonly:{ - $:"readOnly",INPUT:1,TEXTAREA:1} - } - ); - function kDt(t,i){ - const s=IDt[t]; - return"object"==typeof s?s[i]?s.$:void 0:s} - Qt(kDt,"getPropAlias"); - const xDt=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),RDt=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),PDt={ - xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"} - ; - function NDt(t,i,s){ - let e=s.length,n=i.length,h=e,r=0,o=0,a=i[n-1].nextSibling,c=null; - for(; - r<n||o<h; - )if(i[r]!==s[o]){ - for(; - i[n-1]===s[h-1]; - )n--,h--; - if(n===r){ - const i=h<e?o?s[o-1].nextSibling:s[h-o]:a; - for(; - o<h; - )t.insertBefore(s[o++],i)} - else if(h===o)for(; - r<n; - )c&&c.has(i[r])||i[r].remove(),r++; - else if(i[r]===s[h-1]&&s[o]===i[n-1]){ - const e=i[--n].nextSibling; - t.insertBefore(s[o++],i[r++].nextSibling),t.insertBefore(s[--h],e),i[n]=s[h]} - else{ - if(!c){ - c=new Map; - let t=o; - for(; - t<h; - )c.set(s[t],t++)} - const e=c.get(i[r]); - if(null!=e)if(o<e&&e<h){ - let a,l=r,u=1; - for(; - ++l<n&&l<h&&null!=(a=c.get(i[l]))&&a===e+u; - )u++; - if(u>e-o){ - const n=i[r]; - for(; - o<e; - )t.insertBefore(s[o++],n)} - else t.replaceChild(s[o++],i[r++])} - else r++; - else i[r++].remove()} - } - else r++,o++} - Qt(NDt,"reconcileArrays"); - const LDt="_$DX_DELEGATE"; - function DDt(t,i,s,e={ - } - ){ - let n; - return NLt(e=>{ - n=e,i===document?t():YDt(i,t(),i.firstChild?null:void 0,s)} - ,e.owner),()=>{ - n(),i.textContent=""} - } - function GDt(t,i,s,e){ - let n; - const h=Qt(()=>{ - const i=e?document.createElementNS("http://www.w3.org/1998/Math/MathML","template"):document.createElement("template"); - return i.innerHTML=t,s?i.content.firstChild.firstChild:e?i.firstChild:i.content.firstChild} - ,"create"),r=i?()=>$Lt(()=>document.importNode(n||(n=h()),!0)):()=>(n||(n=h())).cloneNode(!0); - return r.cloneNode=r,r} - function BDt(t,i=window.document){ - const s=i[LDt]||(i[LDt]=new Set); - for(let e=0,n=t.length; - e<n; - e++){ - const n=t[e]; - s.has(n)||(s.add(n),i.addEventListener(n,ZDt))} - } - function UDt(t,i,s){ - null==s?t.removeAttribute(i):t.setAttribute(i,s)} - function FDt(t,i,s,e){ - null==e?t.removeAttributeNS(i,s):t.setAttributeNS(i,s,e)} - function $Dt(t,i,s){ - s?t.setAttribute(i,""):t.removeAttribute(i)} - function HDt(t,i){ - null==i?t.removeAttribute("class"):t.className=i} - function WDt(t,i,s,e){ - if(e)Array.isArray(s)?(t[`$$${ - i} - `]=s[0],t[`$$${ - i} - Data`]=s[1]):t[`$$${ - i} - `]=s; - else if(Array.isArray(s)){ - const e=s[0]; - t.addEventListener(i,s[0]=i=>e.call(t,s[1],i))} - else t.addEventListener(i,s,"function"!=typeof s&&s)} - function VDt(t,i,s={ - } - ){ - const e=Object.keys(i||{ - } - ),n=Object.keys(s); - let h,r; - for(h=0,r=n.length; - h<r; - h++){ - const e=n[h]; - e&&"undefined"!==e&&!i[e]&&(JDt(t,e,!1),delete s[e])} - for(h=0,r=e.length; - h<r; - h++){ - const n=e[h],r=!!i[n]; - n&&"undefined"!==n&&s[n]!==r&&r&&(JDt(t,n,!0),s[n]=r)} - return s} - function jDt(t,i,s){ - if(!i)return s?UDt(t,"style"):i; - const e=t.style; - if("string"==typeof i)return e.cssText=i; - let n,h; - for(h in"string"==typeof s&&(e.cssText=s=void 0),s||(s={ - } - ),i||(i={ - } - ),s)null==i[h]&&e.removeProperty(h),delete s[h]; - for(h in i)n=i[h],n!==s[h]&&(e.setProperty(h,n),s[h]=n); - return s} - function KDt(t,i={ - } - ,s,e){ - const n={ - } - ; - return GLt(()=>n.children=tGt(t,i.children,n.children)),GLt(()=>"function"==typeof i.ref&&zDt(i.ref,t)),GLt(()=>qDt(t,i,s,0,n,!0)),n} - function zDt(t,i,s){ - return $Lt(()=>t(i,s))} - function YDt(t,i,s,e){ - if(void 0===s||e||(e=[]),"function"!=typeof i)return tGt(t,i,e,s); - GLt(e=>tGt(t,i(),e,s),e)} - function qDt(t,i,s,e,n={ - } - ,h=!1){ - i||(i={ - } - ); - for(const r in n)if(!(r in i)){ - if("children"===r)continue; - n[r]=QDt(t,r,null,n[r],s,h,i)} - for(const r in i){ - if("children"===r)continue; - const e=i[r]; - n[r]=QDt(t,r,e,n[r],s,h,i)} - } - function XDt(t){ - return t.toLowerCase().replace(/-([a-z])/g,(t,i)=>i.toUpperCase())} - function JDt(t,i,s){ - const e=i.trim().split(/\s+/); - for(let n=0,h=e.length; - n<h; - n++)t.classList.toggle(e[n],s)} - function QDt(t,i,s,e,n,h,r){ - let o,a,c,l,u; - if("style"===i)return jDt(t,s,e); - if("classList"===i)return VDt(t,s,e); - if(s===e)return e; - if("ref"===i)h||s(t); - else if("on:"===i.slice(0,3)){ - const n=i.slice(3); - e&&t.removeEventListener(n,e,"function"!=typeof e&&e),s&&t.addEventListener(n,s,"function"!=typeof s&&s)} - else if("oncapture:"===i.slice(0,10)){ - const n=i.slice(10); - e&&t.removeEventListener(n,e,!0),s&&t.addEventListener(n,s,!0)} - else if("on"===i.slice(0,2)){ - const n=i.slice(2).toLowerCase(),h=xDt.has(n); - if(!h&&e){ - const i=Array.isArray(e)?e[0]:e; - t.removeEventListener(n,i)} - (h||s)&&(WDt(t,n,s,h),h&&BDt([n]))} - else if("attr:"===i.slice(0,5))UDt(t,i.slice(5),s); - else if("bool:"===i.slice(0,5))$Dt(t,i.slice(5),s); - else if((u="prop:"===i.slice(0,5))||(c=CDt.has(i))||!n&&((l=kDt(i,t.tagName))||(a=TDt.has(i)))||(o=t.nodeName.includes("-")||"is"in r))u&&(i=i.slice(5),a=!0),"class"===i||"className"===i?HDt(t,s):!o||a||c?t[l||i]=s:t[XDt(i)]=s; - else{ - const e=n&&i.indexOf(":")>-1&&PDt[i.split(":")[0]]; - e?FDt(t,e,i,s):UDt(t,ODt[i]||i,s)} - return s} - function ZDt(t){ - let i=t.target; - const s=`$$${ - t.type} - `,e=t.target,n=t.currentTarget,h=Qt(i=>Object.defineProperty(t,"target",{ - configurable:!0,value:i} - ),"retarget"),r=Qt(()=>{ - const e=i[s]; - if(e&&!i.disabled){ - const n=i[`${ - s} - Data`]; - if(void 0!==n?e.call(i,n,t):e.call(i,t),t.cancelBubble)return} - return i.host&&"string"!=typeof i.host&&!i.host._$host&&i.contains(t.target)&&h(i.host),!0} - ,"handleNode"),o=Qt(()=>{ - for(; - r()&&(i=i._$host||i.parentNode||i.host); - ); - } - ,"walkUpTree"); - if(Object.defineProperty(t,"currentTarget",{ - configurable:!0,get:()=>i||document} - ),t.composedPath){ - const s=t.composedPath(); - h(s[0]); - for(let t=0; - t<s.length-2&&(i=s[t],r()); - t++){ - if(i._$host){ - i=i._$host,o(); - break} - if(i.parentNode===n)break} - } - else o(); - h(e)} - function tGt(t,i,s,e,n){ - for(; - "function"==typeof s; - )s=s(); - if(i===s)return s; - const h=typeof i,r=void 0!==e; - if(t=r&&s[0]&&s[0].parentNode||t,"string"===h||"number"===h){ - if("number"===h&&(i=i.toString())===s)return s; - if(r){ - let n=s[0]; - n&&3===n.nodeType?n.data!==i&&(n.data=i):n=document.createTextNode(i),s=eGt(t,s,e,n)} - else s=""!==s&&"string"==typeof s?t.firstChild.data=i:t.textContent=i} - else if(null==i||"boolean"===h)s=eGt(t,s,e); - else{ - if("function"===h)return GLt(()=>{ - let n=i(); - for(; - "function"==typeof n; - )n=n(); - s=tGt(t,n,s,e)} - ),()=>s; - if(Array.isArray(i)){ - const h=[],o=s&&Array.isArray(s); - if(iGt(h,i,s,n))return GLt(()=>s=tGt(t,h,s,e,!0)),()=>s; - if(0===h.length){ - if(s=eGt(t,s,e),r)return s} - else o?0===s.length?sGt(t,h,e):NDt(t,s,h):(s&&eGt(t),sGt(t,h)); - s=h} - else if(i.nodeType){ - if(Array.isArray(s)){ - if(r)return s=eGt(t,s,e,i); - eGt(t,s,null,i)} - else null!=s&&""!==s&&t.firstChild?t.replaceChild(i,t.firstChild):t.appendChild(i); - s=i} - } - return s} - function iGt(t,i,s,e){ - let n=!1; - for(let h=0,r=i.length; - h<r; - h++){ - let r,o=i[h],a=s&&s[t.length]; - if(null==o||!0===o||!1===o); - else if("object"==(r=typeof o)&&o.nodeType)t.push(o); - else if(Array.isArray(o))n=iGt(t,o,a)||n; - else if("function"===r)if(e){ - for(; - "function"==typeof o; - )o=o(); - n=iGt(t,Array.isArray(o)?o:[o],Array.isArray(a)?a:[a])||n} - else t.push(o),n=!0; - else{ - const i=String(o); - a&&3===a.nodeType&&a.data===i?t.push(a):t.push(document.createTextNode(i))} - } - return n} - function sGt(t,i,s=null){ - for(let e=0,n=i.length; - e<n; - e++)t.insertBefore(i[e],s)} - function eGt(t,i,s,e){ - if(void 0===s)return t.textContent=""; - const n=e||document.createTextNode(""); - if(i.length){ - let e=!1; - for(let h=i.length-1; - h>=0; - h--){ - const r=i[h]; - if(n!==r){ - const i=r.parentNode===t; - e||h?i&&r.remove():i?t.replaceChild(n,r):t.insertBefore(n,s)} - else e=!0} - } - else t.insertBefore(n,s); - return[n]} - function nGt(t,i=!1){ - return i?document.createElementNS("http://www.w3.org/2000/svg",t):document.createElement(t)} - function hGt(t,i){ - const s=ULt(t); - return ULt(()=>{ - const t=s(); - switch(typeof t){ - case"function":return $Lt(()=>t(i)); - case"string":const s=RDt.has(t),e=nGt(t,s); - return KDt(e,i,s),e} - } - )} - function rGt(t){ - const[,i]=MDt(t,["component"]); - return hGt(()=>t.component,i)} - Qt(DDt,"render"),Qt(GDt,"template$1"),Qt(BDt,"delegateEvents"),Qt(UDt,"setAttribute"),Qt(FDt,"setAttributeNS"),Qt($Dt,"setBoolAttribute"),Qt(HDt,"className"),Qt(WDt,"addEventListener$1"),Qt(VDt,"classList"),Qt(jDt,"style"),Qt(KDt,"spread"),Qt(zDt,"use"),Qt(YDt,"insert"),Qt(qDt,"assign"),Qt(XDt,"toPropertyName"),Qt(JDt,"toggleClassKey"),Qt(QDt,"assignProp"),Qt(ZDt,"eventHandler"),Qt(tGt,"insertExpression"),Qt(iGt,"normalizeIncomingArray"),Qt(sGt,"appendNodes"),Qt(eGt,"cleanChildren"),Qt(nGt,"createElement"),Qt(hGt,"createDynamic"),Qt(rGt,"Dynamic"); - let oGt={ - data:""} - ,aGt=Qt(t=>"object"==typeof window?((t?t.querySelector("#_goober"):window._goober)||Object.assign((t||document.head).appendChild(document.createElement("style")),{ - innerHTML:" ",id:"_goober"} - )).firstChild:t||oGt,"t"),cGt=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{ - ; - ]+?); - |([^; - } - { - ]*?) *{ - )|(} - \s*)/g,lGt=/\/\*[^]*?\*\/| +/g,uGt=/\n+/g,dGt=Qt((t,i)=>{ - let s="",e="",n=""; - for(let h in t){ - let r=t[h]; - "@"==h[0]?"i"==h[1]?s=h+" "+r+"; - ":e+="f"==h[1]?dGt(r,h):h+"{ - "+dGt(r,"k"==h[1]?"":i)+"} - ":"object"==typeof r?e+=dGt(r,i?i.replace(/([^,])+/g,t=>h.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,i=>/&/.test(i)?i.replace(/&/g,t):t?t+" "+i:i)):h):null!=r&&(h=/^--/.test(h)?h:h.replace(/[A-Z]/g,"-$&").toLowerCase(),n+=dGt.p?dGt.p(h,r):h+":"+r+"; - ")} - return s+(i&&n?i+"{ - "+n+"} - ":n)+e} - ,"o"),fGt={ - } - ,pGt=Qt(t=>{ - if("object"==typeof t){ - let i=""; - for(let s in t)i+=s+pGt(t[s]); - return i} - return t} - ,"s"),wGt=Qt((t,i,s,e,n)=>{ - let h=pGt(t),r=fGt[h]||(fGt[h]=(t=>{ - let i=0,s=11; - for(; - i<t.length; - )s=101*s+t.charCodeAt(i++)>>>0; - return"go"+s} - )(h)); - if(!fGt[r]){ - let i=h!==t?t:(t=>{ - let i,s,e=[{ - } - ]; - for(; - i=cGt.exec(t.replace(lGt,"")); - )i[4]?e.shift():i[3]?(s=i[3].replace(uGt," ").trim(),e.unshift(e[0][s]=e[0][s]||{ - } - )):e[0][i[1]]=i[2].replace(uGt," ").trim(); - return e[0]} - )(t); - fGt[r]=dGt(n?{ - ["@keyframes "+r]:i} - :i,s?"":"."+r)} - let o=s&&fGt.g?fGt.g:null; - return s&&(fGt.g=fGt[r]),a=fGt[r],c=i,l=e,(u=o)?c.data=c.data.replace(u,a):-1===c.data.indexOf(a)&&(c.data=l?a+c.data:c.data+a),r; - var a,c,l,u} - ,"i"),gGt=Qt((t,i,s)=>t.reduce((t,e,n)=>{ - let h=i[n]; - if(h&&h.call){ - let t=h(s),i=t&&t.props&&t.props.className||/^go/.test(t)&&t; - h=i?"."+i:t&&"object"==typeof t?t.props?"":dGt(t,""):!1===t?"":t} - return t+e+(null==h?"":h)} - ,""),"p"); - function mGt(t){ - let i=this||{ - } - ,s=t.call?t(i.p):t; - return wGt(s.unshift?s.raw?gGt(s,[].slice.call(arguments,1),i.p):s.reduce((t,s)=>Object.assign(t,s&&s.call?s(i.p):s),{ - } - ):s,aGt(i.target),i.g,i.o,i.k)} - Qt(mGt,"u"),mGt.bind({ - g:1} - ); - let vGt=mGt.bind({ - k:1} - ); - const _Gt=jLt(); - function MGt(t){ - return pDt(_Gt.Provider,{ - value:t.theme,get children(){ - return t.children} - } - )} - function bGt(){ - return KLt(_Gt)} - function yGt(t){ - let i=this||{ - } - ; - return(...s)=>{ - const e=Qt(e=>{ - const n=_Dt(e,{ - theme:KLt(_Gt)} - ),h=_Dt(n,{ - get class(){ - const t=n.class,e="class"in n&&/^go[0-9]+/.test(t); - return[t,mGt.apply({ - target:i.target,o:e,p:n,g:i.g} - ,s)].filter(Boolean).join(" ")} - } - ),[r,o]=MDt(h,["as","theme"]),a=o,c=r.as||t; - let l; - return"function"==typeof c?l=c(a):1==i.g?(l=document.createElement(c),KDt(l,a)):l=rGt(_Dt({ - component:c} - ,a)),l} - ,"Styled"); - return e.class=t=>$Lt(()=>mGt.apply({ - target:i.target,p:t,g:i.g} - ,s)),e} - } - Qt(MGt,"ThemeProvider"),Qt(bGt,"useTheme"),Qt(yGt,"makeStyled"); - const EGt=new Proxy(yGt,{ - get:(t,i)=>t(i)} - ); - function AGt(){ - const t=yGt.call({ - g:1} - ,"div").apply(null,arguments); - return Qt(function(i){ - return t(i),null} - ,"GlobalStyles2")} - Qt(AGt,"createGlobalStyles"); - const SGt="okxc-root",TGt="okxc-disable-scroll",CGt="okxc-using-mouse",OGt=Qt(()=>(document.body.addEventListener("mousedown",()=>document.body.classList.add(CGt)),document.body.addEventListener("keydown",t=>{ - "Tab"===t.key&&document.body.classList.remove(CGt)} - ),pDt(AGt` - ${ - SGt} - * { - - margin: 0; - - padding: 0; - - box-sizing: border-box; - - - font-family: -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, Tahoma, Verdana, sans-serif; - - -webkit-font-smoothing: antialiased; - - -moz-osx-font-smoothing: grayscale; - - -webkit-tap-highlight-color: transparent; - - } - - - ${ - SGt} - img { - - -webkit-user-select: none; - - -webkit-touch-callout: none; - - } - - - ${ - SGt} - *:focus { - - outline: #08f auto 2px; - - } - - - ${ - SGt} - li { - - list-style: none; - - } - - - ${ - SGt} - button { - - outline: none; - - } - - - body.${ - TGt} - { - - position: fixed; - - overflow-y: scroll; - - right: 0; - - left: 0; - - } - - - body.${ - CGt} - ${ - SGt} - *:focus { - - outline: none; - - } - - `,{ - } - )),"GlobalStyles"); - function IGt(t){ - "#"===t[0]&&(t=t.slice(1)); - const i=parseInt(t,16); - return[i>>16&255,i>>8&255,255&i].join(",")} - function kGt(t,i){ - return"#"===t[0]&&(t=IGt(t)),`rgba(${ - t} - , ${ - i} - )`} - function xGt(t){ - return t.toString()+"px"} - Qt(IGt,"hexToRgb"),Qt(kGt,"rgba"),Qt(xGt,"toPx"); - const RGt=(Qt(Rt=class{ - constructor(){ - cLt(this,"storage",{ - } - )} - static getInstance(){ - return RGt.instance||(RGt.instance=new RGt),RGt.instance} - get length(){ - return Object.keys(this.storage).length} - clear(){ - this.storage={ - } - } - getItem(t){ - var i; - return null!=(i=this.storage[t])?i:null} - key(t){ - var i; - const s=Object.keys(this.storage); - return t<0||t>=s.length?null:null!=(i=s[t])?i:null} - removeItem(t){ - delete this.storage[t]} - setItem(t,i){ - this.storage[t]=i} - } - ,"_InMemoryStorage"),Rt); - let PGt=RGt; - function NGt(...t){ - Mgt.logDebug(t)} - function LGt(...t){ - Mgt.logError(t)} - function DGt(...t){ - Mgt.logWarning(t)} - cLt(PGt,"instance"),Qt(NGt,"logDebug"),Qt(LGt,"logError"),Qt(DGt,"logWarning"); - let GGt={ - } - ; - try{ - GGt=KGt(location.hash.toString())} - catch(r6i){ - } - let BGt="unknown"; - if((null==GGt?void 0:GGt.tgWebAppPlatform)&&(BGt=null!=(HNt=GGt.tgWebAppPlatform)?HNt:"unknown"),"unknown"===BGt){ - const t=mUt(); - BGt=null!=(jNt=null==(VNt=null==(WNt=null==t?void 0:t.Telegram)?void 0:WNt.WebApp)?void 0:VNt.platform)?jNt:"unknown"} - let UGt="6.0"; - if((null==GGt?void 0:GGt.tgWebAppVersion)&&(UGt=GGt.tgWebAppVersion),!UGt){ - const t=mUt(); - UGt=null!=(YNt=null==(zNt=null==(KNt=null==t?void 0:t.Telegram)?void 0:KNt.WebApp)?void 0:zNt.version)?YNt:"6.0"} - function FGt(...t){ - return t.includes(BGt)} - function $Gt(){ - var t; - return"unknown"!==BGt||!!(null==(t=mUt())?void 0:t.TelegramWebviewProxy)} - function HGt(){ - var t; - const i=!!(null==(t=mUt())?void 0:t.TelegramWebview); - return($Gt()||i)&&"unknown"===BGt} - function WGt(){ - jGt("web_app_expand",{ - } - )} - function VGt(){ - try{ - const t=mUt(); - return!!t&&null!=t.parent&&t!==t.parent} - catch(r6i){ - return!1} - } - function jGt(t,i){ - try{ - const s=mUt(); - if(!s)throw new vLt("Can't post event to parent window: window is not defined"); - if(void 0!==s.TelegramWebviewProxy)NGt("postEvent",t,i),s.TelegramWebviewProxy.postEvent(t,JSON.stringify(i)); - else if(s.external&&"notify"in s.external)NGt("postEvent",t,i),s.external.notify(JSON.stringify({ - eventType:t,eventData:i} - )); - else{ - if(!VGt())throw new vLt("Can't post event to TMA"); - { - const e="*",n=JSON.stringify({ - eventType:t,eventData:i} - ); - NGt("postEvent",t,i),s.parent.postMessage(n,e)} - } - } - catch(r6i){ - LGt(`Can't post event to parent window: ${ - r6i} - `)} - } - function KGt(t){ - let i={ - } - ; - if(!(t=t.replace(/^#/,"")).length)return i; - if(t.indexOf("=")<0&&t.indexOf("?")<0)return i._path=zGt(t),i; - let s=t.indexOf("?"); - if(s>=0){ - let e=t.substr(0,s); - i._path=zGt(e),t=t.substr(s+1)} - let e=YGt(t); - for(let n in e)i[n]=e[n]; - return i} - function zGt(t){ - try{ - return t=t.replace(/\+/g,"%20"),decodeURIComponent(t)} - catch(r6i){ - return t} - } - function YGt(t){ - let i={ - } - ; - if(!t.length)return i; - let s,e,n,h,r=t.split("&"); - for(s=0; - s<r.length; - s++)e=r[s].split("="),n=zGt(e[0]),h=null==e[1]?null:zGt(e[1]),i[n]=h; - return i} - Qt(FGt,"isTmaPlatform"),Qt($Gt,"isInTMA"),Qt(HGt,"isInTelegramBrowser"),Qt(WGt,"sendExpand"),Qt(VGt,"isIframe"),Qt(jGt,"postEvent"),Qt(KGt,"urlParseHashParams"),Qt(zGt,"urlSafeDecode"),Qt(YGt,"urlParseQueryString"); - const qGt=440,XGt=1020; - function JGt(t){ - var i; - const s=mUt(); - if(!s)return"desktop"===t; - if(FGt("weba"))return!0; - const e=s.innerWidth; - switch(t){ - case"desktop":return e>XGt; - case"tablet":return e>qGt; - default:let t=e<=qGt||yUt("ios","android","ipad"); - if(t){ - const s=!!(null==(i=mUt())?void 0:i.TelegramWebviewProxy),e=navigator.maxTouchPoints||0; - s&&0===e&&(t=!1),Mgt.logDebug("isDevice mobile isTelegram and maxTouchPoints:",t,s,e)} - return t} - } - function QGt(t){ - switch(t){ - case"mobile":return"@media (max-width: 440px)"; - case"tablet":return"@media (max-width: 1020px) (min-width: 440px)"; - default:return"@media (min-width: 1020px)"} - } - Qt(JGt,"isDevice"),Qt(QGt,"media"); - const ZGt="@media (hover: none)",tBt="@media not all and (hover: none)",[iBt,sBt]=LLt(JGt("mobile")),eBt=Qt(()=>sBt(JGt("mobile")),"updateIsMobile"); - mUt()&&(window.addEventListener("resize",()=>eBt()),window.addEventListener("load",()=>eBt(),{ - once:!0} - )); - const nBt=Symbol("store-raw"),hBt=Symbol("store-node"),rBt=Symbol("store-has"),oBt=Symbol("store-self"); - function aBt(t){ - let i=t[MLt]; - if(!i&&(Object.defineProperty(t,MLt,{ - value:i=new Proxy(t,gBt)} - ),!Array.isArray(t))){ - const s=Object.keys(t),e=Object.getOwnPropertyDescriptors(t); - for(let n=0,h=s.length; - n<h; - n++){ - const h=s[n]; - e[h].get&&Object.defineProperty(t,h,{ - enumerable:e[h].enumerable,get:e[h].get.bind(i)} - )} - } - return i} - function cBt(t){ - let i; - return null!=t&&"object"==typeof t&&(t[MLt]||!(i=Object.getPrototypeOf(t))||i===Object.prototype||Array.isArray(t))} - function lBt(t,i=new Set){ - let s,e,n,h; - if(s=null!=t&&t[nBt])return s; - if(!cBt(t)||i.has(t))return t; - if(Array.isArray(t)){ - Object.isFrozen(t)?t=t.slice(0):i.add(t); - for(let s=0,h=t.length; - s<h; - s++)n=t[s],(e=lBt(n,i))!==n&&(t[s]=e)} - else{ - Object.isFrozen(t)?t=Object.assign({ - } - ,t):i.add(t); - const s=Object.keys(t),r=Object.getOwnPropertyDescriptors(t); - for(let o=0,a=s.length; - o<a; - o++)h=s[o],r[h].get||(n=t[h],(e=lBt(n,i))!==n&&(t[h]=e))} - return t} - function uBt(t,i){ - let s=t[i]; - return s||Object.defineProperty(t,i,{ - value:s=Object.create(null)} - ),s} - function dBt(t,i,s){ - if(t[i])return t[i]; - const[e,n]=LLt(s,{ - equals:!1,internal:!0} - ); - return e.$=n,t[i]=e} - function fBt(t,i){ - const s=Reflect.getOwnPropertyDescriptor(t,i); - return s&&!s.get&&s.configurable&&i!==MLt&&i!==hBt?(delete s.value,delete s.writable,s.get=()=>t[MLt][i],s):s} - function pBt(t){ - VLt()&&dBt(uBt(t,hBt),oBt)()} - function wBt(t){ - return pBt(t),Reflect.ownKeys(t)} - Qt(aBt,"wrap$1"),Qt(cBt,"isWrappable"),Qt(lBt,"unwrap$1"),Qt(uBt,"getNodes"),Qt(dBt,"getNode"),Qt(fBt,"proxyDescriptor$1"),Qt(pBt,"trackSelf"),Qt(wBt,"ownKeys"); - const gBt={ - get(t,i,s){ - if(i===nBt)return t; - if(i===MLt)return s; - if(i===yLt)return pBt(t),s; - const e=uBt(t,hBt),n=e[i]; - let h=n?n():t[i]; - if(i===hBt||i===rBt||"__proto__"===i)return h; - if(!n){ - const s=Object.getOwnPropertyDescriptor(t,i); - !VLt()||"function"==typeof h&&!t.hasOwnProperty(i)||s&&s.get||(h=dBt(e,i,h)())} - return cBt(h)?aBt(h):h} - ,has:(t,i)=>i===nBt||i===MLt||i===yLt||i===hBt||i===rBt||"__proto__"===i||(VLt()&&dBt(uBt(t,rBt),i)(),i in t),set:()=>!0,deleteProperty:()=>!0,ownKeys:wBt,getOwnPropertyDescriptor:fBt} - ; - function mBt(t,i,s,e=!1){ - if(!e&&t[i]===s)return; - const n=t[i],h=t.length; - void 0===s?(delete t[i],t[rBt]&&t[rBt][i]&&void 0!==n&&t[rBt][i].$()):(t[i]=s,t[rBt]&&t[rBt][i]&&void 0===n&&t[rBt][i].$()); - let r,o=uBt(t,hBt); - if((r=dBt(o,i,n))&&r.$(()=>s),Array.isArray(t)&&t.length!==h){ - for(let i=t.length; - i<h; - i++)(r=o[i])&&r.$(); - (r=dBt(o,"length",h))&&r.$(t.length)} - (r=o[oBt])&&r.$()} - function vBt(t,i){ - const s=Object.keys(i); - for(let e=0; - e<s.length; - e+=1){ - const n=s[e]; - mBt(t,n,i[n])} - } - function _Bt(t,i){ - if("function"==typeof i&&(i=i(t)),i=lBt(i),Array.isArray(i)){ - if(t===i)return; - let s=0,e=i.length; - for(; - s<e; - s++){ - const e=i[s]; - t[s]!==e&&mBt(t,s,e)} - mBt(t,"length",e)} - else vBt(t,i)} - function MBt(t,i,s=[]){ - let e,n=t; - if(i.length>1){ - e=i.shift(); - const h=typeof e,r=Array.isArray(t); - if(Array.isArray(e)){ - for(let n=0; - n<e.length; - n++)MBt(t,[e[n]].concat(i),s); - return} - if(r&&"function"===h){ - for(let n=0; - n<t.length; - n++)e(t[n],n)&&MBt(t,[n].concat(i),s); - return} - if(r&&"object"===h){ - const{ - from:n=0,to:h=t.length-1,by:r=1} - =e; - for(let e=n; - e<=h; - e+=r)MBt(t,[e].concat(i),s); - return} - if(i.length>1)return void MBt(t[e],i,[e].concat(s)); - n=t[e],s=[e].concat(s)} - let h=i[0]; - "function"==typeof h&&(h=h(n,s),h===n)||void 0===e&&null==h||(h=lBt(h),void 0===e||cBt(n)&&cBt(h)&&!Array.isArray(h)?vBt(n,h):mBt(t,e,h))} - function bBt(...[t,i]){ - const s=lBt(t||{ - } - ),e=Array.isArray(s),n=aBt(s); - function h(...t){ - FLt(()=>{ - e&&1===t.length?_Bt(s,t[0]):MBt(s,t)} - )} - return Qt(h,"setStore"),[n,h]} - Qt(mBt,"setProperty"),Qt(vBt,"mergeStoreNode"),Qt(_Bt,"updateArray"),Qt(MBt,"updatePath"),Qt(bBt,"createStore"); - const[yBt,EBt]=bBt({ - language:"en_US"} - ),[ABt]=bBt({ - buttonRootId:null,language:"en_US"} - ),SBt=class{ - constructor(t){ - cLt(this,"value"),cLt(this,"next"),this.value=t} - } - ; - Qt(SBt,"Node$1"); - let TBt=SBt; - const CBt=class{ - constructor(){ - dLt(this,qNt,void 0),dLt(this,XNt,void 0),dLt(this,JNt,void 0),this.clear()} - enqueue(t){ - const i=new TBt(t); - uLt(this,qNt)?(uLt(this,XNt).next=i,fLt(this,XNt,i)):(fLt(this,qNt,i),fLt(this,XNt,i)),pLt(this,JNt)._++} - dequeue(){ - const t=uLt(this,qNt); - if(t)return fLt(this,qNt,uLt(this,qNt).next),pLt(this,JNt)._--,t.value} - peek(){ - if(uLt(this,qNt))return uLt(this,qNt).value} - clear(){ - fLt(this,qNt,void 0),fLt(this,XNt,void 0),fLt(this,JNt,0)} - get size(){ - return uLt(this,JNt)} - *[Symbol.iterator](){ - let t=uLt(this,qNt); - for(; - t; - )yield t.value,t=t.next} - *drain(){ - for(; - uLt(this,qNt); - )yield this.dequeue()} - } - ; - Qt(CBt,"Queue"); - let OBt=CBt; - function IBt(t){ - kBt(t); - const i=new OBt; - let s=0; - const e=Qt(()=>{ - s<t&&i.size>0&&(i.dequeue()(),s++)} - ,"resumeNext"),n=Qt(()=>{ - s--,e()} - ,"next"),h=Qt((t,i,s)=>wLt(this,null,function*(){ - const e=(()=>wLt(this,null,function*(){ - return t(...s)} - ))(); - i(e); - try{ - yield e} - catch(r6i){ - } - n()} - ),"run"),r=Qt((n,r,o)=>{ - new Promise(t=>{ - i.enqueue(t)} - ).then(h.bind(void 0,n,r,o)),(()=>{ - wLt(this,null,function*(){ - yield Promise.resolve(),s<t&&e()} - )} - )()} - ,"enqueue"),o=Qt((t,...i)=>new Promise(s=>{ - r(t,s,i)} - ),"generator"); - return Object.defineProperties(o,{ - activeCount:{ - get:Qt(()=>s,"get")} - ,pendingCount:{ - get:Qt(()=>i.size,"get")} - ,clearQueue:{ - value(){ - i.clear()} - } - ,concurrency:{ - get:Qt(()=>t,"get"),set(n){ - kBt(n),t=n,queueMicrotask(()=>{ - for(; - s<t&&i.size>0; - )e()} - )} - } - } - ),o} - function kBt(t){ - if(!Number.isInteger(t)&&t!==Number.POSITIVE_INFINITY||!(t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")} - qNt=new WeakMap,XNt=new WeakMap,JNt=new WeakMap,Qt(IBt,"pLimit"),Qt(kBt,"validateConcurrency"); - const xBt={ - [Mgt.NameSpaceKeyAptos]:[Mgt.APTOS_CHAINS.MAINNET],[Mgt.NameSpaceKeySOL]:[Mgt.SOLANA_CHAINS.MAINNET,Mgt.SOLANA_CHAINS_STANDARD.MAINNET]} - ,RBt=new Map([[Mgt.NameSpaceKeyAptos,Mgt.AptosStandardProvider],[Mgt.NameSpaceKeySui,Mgt.SuiStandardProvider],[Mgt.NameSpaceKeySOL,Mgt.SolanaStandardProvider]]); - function PBt(){ - window.okxGlobalWallet||(window.okxGlobalWallet={ - okxConnectStandardWallets:[],register:Qt(t=>{ - var i,s; - if(Mgt.logDebug(`walletStandardWallet regist => ${ - t.name} - `),t.name.toLowerCase().includes("okx")&&!t.chains.includes(Mgt.APTOS_CHAINS.MAINNET))return; - let e=window.okxGlobalWallet.okxConnectStandardWallets,n=e.find(i=>t.name===i.walletName); - if(n||(n={ - wallets:new Map,walletName:t.name,icon:t.icon} - ,e.push(n)),"undefined"!=typeof window&&"undefined"!=typeof document)for(const[h,r]of Object.entries(xBt))r.some(i=>t.chains.includes(i))&&!n.wallets.has(h)&&(n.wallets.set(h,t),Mgt.logDebug(`walletStandardWallet walletItem.wallets.set => ${ - t.name} - . ${ - h} - `),null==(s=(i=window.okxGlobalWallet).standardWalletChangedListener)||s.call(i,t,h))} - ,"register")} - )} - function NBt(){ - LBt(); - const t=new CustomEvent("wallet-standard:app-ready",{ - detail:window.okxGlobalWallet} - ); - window.dispatchEvent(t)} - Qt(PBt,"initOkxGlobalWallet"),Qt(NBt,"sendStandardWalletsEvent"); - const LBt=Qt(()=>wLt(void 0,null,function*(){ - try{ - if(!nUt()){ - const t=new CustomEvent("okxConnect:aptos:registerConnect"); - window.dispatchEvent(t)} - } - catch(t){ - } - } - ),"useAptosConnect"),DBt=IBt(1); - function GBt(t,i){ - let s=new Map; - (new Map).set(i,t); - const e=RBt.get(i); - if(e&&t&&!s.get(i))return new e(t)} - function BBt(t){ - window.okxGlobalWallet.standardWalletChangedListener=(i,s)=>{ - t&&DBt(()=>wLt(this,null,function*(){ - Mgt.logDebug(`standardWalletChangedListener => ${ - i.name} - with nameSpace: ${ - s} - `); - let e=t.getEngine(),n=e.getAllConnectors(),h=n.find(t=>t.getType()===Mgt.CONNECTOR_TYPE.INJECT.STANDARD_INJECT_WALLET&&t.walletName===i.name),r=GBt(i,s); - if(r){ - if(h)(null==h?void 0:h.getType())===Mgt.CONNECTOR_TYPE.INJECT.STANDARD_INJECT_WALLET&&(h.getSupportNameSpaces().includes(s)||h.registerWallet(s,r)); - else{ - let t=new Mgt.ThirdpartInjectConnector({ - wallets:(new Map).set(s,r),walletName:i.name,icon:i.icon} - ); - n.push(t),e.registerConnector(n)} - EBt({ - walletConnector:n} - ),t.connected()||(Mgt.logDebug("standardWalletChangedListener tryToReconnect start"),yield t.tryToReconnect(),Mgt.logDebug("standardWalletChangedListener tryToReconnect end")),Mgt.logDebug("standardWalletChangedListener function end")} - } - ))} - } - function UBt(t,i){ - return!!i&&(t.name.toLowerCase()===i.toLowerCase()||t.appName.toLowerCase()===i.toLowerCase())} - function FBt(){ - return HGt()||$Gt()} - Qt(GBt,"getThirdpardInjectProvider"),Qt(BBt,"addStandardWalletChangedForConnector"),Qt(UBt,"eqWalletName"),Qt(FBt,"inTg"); - const $Bt=[Mgt.NameSpaceKeyEip155,Mgt.NameSpaceKeySOL,Mgt.NameSpaceKeyTON,Mgt.NameSpaceKeySui,Mgt.NameSpaceKeyAptos,Mgt.NameSpaceKeyBtc],HBt=[Mgt.NameSpaceKeySOL,Mgt.NameSpaceKeyAptos],WBt=[Mgt.SOLANA_CHAINS.MAINNET,Mgt.APTOS_CHAINS.MAINNET,Mgt.APTOS_CHAINS.MOVEMENT_MAINNET,Mgt.APTOS_CHAINS.MOVEMENT_TESTNET],VBt=[Mgt.SOLANA_CHAINS.MAINNET,Mgt.APTOS_CHAINS.MAINNET],jBt=iBt()?VBt:WBt; - function KBt(t,i){ - return!1} - function zBt(t){ - const i=Object.keys(t); - return 1===i.length&&i[0]===Mgt.NameSpaceKeyAptos} - function YBt(t,i){ - if(!t)return!0; - if(zBt(t))return!1; - for(const[s,e]of Object.entries(t)){ - if(HBt.includes(s)){ - if(e.chains.some(t=>!jBt.includes(t)))return!1} - else if(!$Bt.includes(s))return!1; - if(!qBt(s,i))return!1} - return!0} - function qBt(t,i){ - return!!(t!==Mgt.NameSpaceKeyTON||i&&i.manifestUrl)&&(!iBt()||eUt("6.103.0"))} - function XBt(t=!0){ - var i,s,e,n,h,r; - let o=t?yBt.walletConnector:ABt.walletConnector; - if(o)for(let u of o)switch(u.getTag()){ - case Mgt.OKX_TG_WALLET:if(t){ - var a=null==(i=yBt.connectRequestParameters)?void 0:i.namespaces,c=null==(s=yBt.connectRequestParameters)?void 0:s.optionalNamespaces; - u.enable=KBt()} - else u.enable=!0; - break; - case Mgt.OKX_APP_WALLET:u.enable=!0; - break; - case Mgt.OKX_INJECT_WALLET:if(t)a=null==(e=yBt.connectRequestParameters)?void 0:e.namespaces,c=null==(n=yBt.connectRequestParameters)?void 0:n.optionalNamespaces,u.enable=YBt(a,yBt.dappMetaData)&&YBt(c,yBt.dappMetaData); - else{ - u.enable=!0; - var l=ABt.dappMetaData; - u.enable=!!(null==l?void 0:l.manifestUrl)} - break; - default:if(u instanceof Mgt.ThirdpartInjectConnector)if(t){ - let t=null==(h=yBt.connectRequestParameters)?void 0:h.namespaces,i=null==(r=yBt.connectRequestParameters)?void 0:r.optionalNamespaces; - const s=[...t?Object.keys(t):[],...i?Object.keys(i):[]]; - u.enable=s.every(s=>{ - const e=s,n=(null==t?void 0:t[e])||(null==i?void 0:i[e]),h=null==n?void 0:n.chains; - return!(!e||!h)&&u.supportNamespaceAndChains(e,h)} - ),Mgt.logDebug(`checkIconnectorEnable ${ - u.walletName} - . enable ==> ${ - u.enable} - `)} - else u.enable=!1; - else u.enable=!1} - else Mgt.logWarning("not find connector yet")} - function JBt(t,i){ - return!aUt(oLt(oLt({ - } - ,t),i))&&!sUt()&&iBt()} - function QBt(t){ - return!!t&&t.name===Mgt.creatOKXWalletInfo().name} - function ZBt(t){ - return!!t&&t.name===Mgt.creatOKXMiniAppWalletInfo().name} - function tUt(t,i){ - return!("qrcode"===i||!iUt(t)||iUt(t)&&!iBt())} - function iUt(t){ - return!!t&&(t.name===Mgt.creatOKXWalletInfo().name||t.name===Mgt.creatOKXMiniAppWalletInfo().name)} - function sUt(){ - try{ - return iBt()?eUt("6.102.0"):!!window.okxwallet} - catch(r6i){ - return!1} - } - function eUt(t){ - let i=window.okxwallet; - if(i){ - let s=i.appVersion; - return Mgt.versionCompare(s,t)>=0} - return!1} - function nUt(){ - return iBt()&&!!window.okxwallet&&window.okxwallet.mobileDiscoverWallet} - function hUt(){ - let t=[]; - return nUt()||(t.push(new Mgt.OKXAppConnector),t.push(new Mgt.OKXWalletAppConnector)),sUt()&&t.push(new Mgt.OkxwalletInjectConnector),t.push(...rUt()),t} - function rUt(){ - var t; - let i=new Map; - const s=(null==(t=window.okxGlobalWallet)?void 0:t.okxConnectStandardWallets)||[]; - for(let e of s)if(e.wallets&&e.wallets.size>0){ - let t=new Map; - e.wallets.forEach((i,s)=>{ - let e=GBt(i,s); - e&&t.set(s,e)} - ); - const s=new Mgt.ThirdpartInjectConnector({ - walletName:e.walletName,icon:e.icon,wallets:t} - ); - i.has(s.walletName)||i.set(s.walletName,s)} - return Array.from(i.values())} - function oUt(t,i){ - return!(!i||"qrcode"==i)&&!!t&&(QBt(t)?iBt():!!ZBt(t)&&FBt())} - function aUt(t){ - var i; - if(iBt())return!0; - try{ - let s=t; - if(!t){ - const t=yBt.connectRequestParameters,i=t.namespaces,e=t.optionalNamespaces; - s=oLt(oLt({ - } - ,i),e)} - if(!s)return!1; - const e=Object.keys(s); - if(1!==e.length)return!1; - const n=e[0],h=s[n]; - if(!h||1!==h.chains.length)return!1; - const r=h.chains[0],o=xBt[n]; - return null!=(i=null==o?void 0:o.includes(r))&&i} - catch(s){ - return!1} - } - function cUt(t){ - return t.getType()===Mgt.CONNECTOR_TYPE.INJECT.OKX_INJECT_WALLET||t.getType()===Mgt.CONNECTOR_TYPE.INJECT.STANDARD_INJECT_WALLET&&t.walletName.toLowerCase().includes("okx")} - function lUt(){ - return window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?gLt.LIGHT:gLt.DARK} - function uUt(t){ - const i=Qt(i=>t(i.matches?gLt.DARK:gLt.LIGHT),"handler"); - return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",i),()=>window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",i)} - function dUt(){ - document.documentElement.scrollHeight!==document.documentElement.clientHeight&&(document.body.style.top=xGt(-document.documentElement.scrollTop),document.body.classList.add(TGt))} - function fUt(){ - document.body.classList.remove(TGt),document.documentElement.scrollTo({ - top:-parseFloat(getComputedStyle(document.body).top)} - ),document.body.style.top="auto"} - function pUt(){ - document.body.hasAttribute("ontouchstart")||document.body.setAttribute("ontouchstart","")} - function wUt(){ - var t; - document.body.getElementsByTagName(SGt)||customElements.define(SGt,(t=class extends HTMLElement{ - } - ,Qt(t,"TcRootElement"),t))} - function gUt(t){ - return wLt(this,null,function*(){ - yield new Promise(t=>requestAnimationFrame(t)),t()} - )} - function mUt(){ - if("undefined"!=typeof window)return window} - function vUt(){ - if(_Ut())return localStorage; - if(MUt())throw new vLt("`localStorage` is unavailable, but it is required for TonConnect"); - return PGt.getInstance()} - function _Ut(){ - try{ - return"undefined"!=typeof localStorage} - catch(r6i){ - return!1} - } - function MUt(){ - return"undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node} - function bUt(){ - var t,i,s; - const e=(new HMt).getResult(),n=null==(t=e.os.name)?void 0:t.toLowerCase(); - let h; - switch(!0){ - case"ipad"===(null==(i=e.device.model)?void 0:i.toLowerCase()):h="ipad"; - break; - case"ios"===n:h="ios"; - break; - case"android"===n:h="android"; - break; - case"mac os"===n:h="macos"; - break; - case"linux"===n:h="linux"; - break; - case null==n?void 0:n.includes("windows"):h="windows"} - const r=null==(s=e.browser.name)?void 0:s.toLowerCase(); - let o; - switch(!0){ - case"chrome"===r:o="chrome"; - break; - case"firefox"===r:o="firefox"; - break; - case null==r?void 0:r.includes("safari"):o="safari"; - break; - case null==r?void 0:r.includes("opera"):o="opera"} - return{ - os:h,browser:o} - } - function yUt(...t){ - return t.includes(bUt().os)} - Qt(KBt,"showUniversalTgWalletByRequestNameSpaces"),Qt(zBt,"isOnlyAptos"),Qt(YBt,"injectWalletEnable"),Qt(qBt,"checkNameSpaceEnable"),Qt(XBt,"checkIconnectorEnable"),Qt(JBt,"defaultOpenUniversalLink"),Qt(QBt,"isAppWallet"),Qt(ZBt,"isTgWallet"),Qt(tUt,"openWalletForUIRequest"),Qt(iUt,"isAppOrMiniWallet"),Qt(sUt,"showInjectWallet"),Qt(eUt,"appVersionAtLeast"),Qt(nUt,"isMobileDiscover"),Qt(hUt,"getDefaultConnector"),Qt(rUt,"getOtherInjectWalletConnector"),Qt(oUt,"showActionButton"),Qt(aUt,"showAllWallets"),Qt(cUt,"onlyDiscoverOkxWallet"),Qt(lUt,"getSystemTheme"),Qt(uUt,"subscribeToThemeChange"),Qt(dUt,"disableScroll"),Qt(fUt,"enableScroll"),Qt(pUt,"fixMobileSafariActiveTransition"),Qt(wUt,"defineStylesRoot"),Qt(gUt,"createMacrotask"),Qt(mUt,"getWindow$1"),Qt(vUt,"tryGetLocalStorage"),Qt(_Ut,"isLocalStorageAvailable"),Qt(MUt,"isNodeJs"),Qt(bUt,"getUserAgent"),Qt(yUt,"isOS"); - const EUt=class{ - constructor(){ - cLt(this,"localStorage"),cLt(this,"storageKey","okx_wallet_connect_ui_last-selected-wallet-info"),this.localStorage=vUt()} - setLastSelectedWalletInfo(t){ - this.localStorage.setItem(this.storageKey,JSON.stringify(t))} - getLastSelectedWalletInfo(){ - const t=this.localStorage.getItem(this.storageKey); - return t?JSON.parse(t):null} - removeLastSelectedWalletInfo(){ - this.localStorage.removeItem(this.storageKey)} - } - ; - Qt(EUt,"LastSelectedWalletInfoStorage"); - let AUt=EUt; - const[SUt]=LLt({ - status:"closed",closeReason:null} - ); - ULt(()=>"opened"===SUt().status); - const[TUt]=LLt({ - status:"closed",closeReason:null} - ); - ULt(()=>"opened"===TUt().status),ULt(()=>{ - const t=TUt(); - return"opened"===t.status?t.walletInfo:null} - ); - let CUt="undefined"!=typeof window?new AUt:void 0; - LLt((null==CUt?void 0:CUt.getLastSelectedWalletInfo())||null),LLt(null); - const OUt=EGt.div` - background-color: ${ - t=>t.theme.colors.background.secondary} - ; - - `,IUt=Qt(t=>{ - let i; - const[s,e]=LLt(null); - return BLt(()=>{ - const i=new window.Image; - return i.src=t.src,i.alt=t.alt||"",i.setAttribute("draggable","false"),t.class&&i.classList.add(t.class),i.complete?e(i):(i.addEventListener("load",()=>e(i)),()=>i.removeEventListener("load",()=>e(i)))} - ),[pDt(EDt,{ - get when(){ - return s()} - ,get children(){ - return s()} - } - ),pDt(EDt,{ - get when(){ - return!s()} - ,get children(){ - return pDt(OUt,{ - get class(){ - return t.class} - ,ref(t){ - "function"==typeof i?i(t):i=t} - } - )} - } - )]} - ,"Image$1"),kUt={ - m:"100vh",s:"8px",none:"0"} - ,xUt={ - s:.02,m:.04} - ,RUt=EGt.button` - display: ${ - t=>t.leftIcon||t.rightIcon?"flex":"inline-block"} - ; - - gap: ${ - t=>t.leftIcon||t.rightIcon?"4px":"unset"} - ; - - align-items: ${ - t=>t.leftIcon||t.rightIcon?"center":"unset"} - ; - - justify-content: ${ - t=>t.leftIcon||t.rightIcon?"space-between":"unset"} - ; - - background-color: ${ - t=>"flat"===t.appearance?"transparent":"secondary"===t.appearance?t.theme.colors.background.tint:kGt(t.theme.colors.accent,.12)} - ; - - color: ${ - t=>"secondary"===t.appearance?t.theme.colors.text.primary:t.theme.colors.accent} - ; - - - padding: ${ - t=>"flat"===t.appearance?"0":"9px 16px"} - ; - - padding-left: ${ - t=>t.leftIcon&&"flat"!==t.appearance?"12px":"16px"} - ; - - padding-right: ${ - t=>t.rightIcon&&"flat"!==t.appearance?"12px":"16px"} - ; - - border: none; - - border-radius: ${ - t=>kUt[t.theme.borderRadius]} - ; - - cursor: ${ - t=>t.disabled?"not-allowed":"pointer"} - ; - - - font-size: 14px; - - font-weight: 510; - - line-height: 18px; - - - transition: transform 0.125s ease-in-out; - - - ${ - tBt} - { - - &:hover { - - transform: ${ - t=>t.disabled?"unset":`scale(${ - 1+xUt[t.scale]} - )`} - ; - - } - - } - - - &:active { - - transform: ${ - t=>t.disabled?"unset":`scale(${ - 1-xUt[t.scale]} - )`} - ; - - } - - - ${ - ZGt} - { - - &:active { - - transform: ${ - t=>t.disabled?"unset":`scale(${ - 1-2*xUt[t.scale]} - )`} - ; - - } - - } - - `; - function PUt(t){ - const i=$Lt(()=>Object.keys(t).filter(t=>t.startsWith("data-"))),[s]=MDt(t,i); - return s} - Qt(PUt,"useDataAttributes"); - const NUt=Qt(t=>{ - const i=PUt(t); - return pDt(RUt,_Dt({ - get appearance(){ - return t.appearance||"primary"} - ,get class(){ - return t.class} - ,onClick:Qt(i=>{ - var s; - return null==(s=t.onClick)?void 0:s.call(t,i)} - ,"onClick"),onMouseEnter:Qt(i=>{ - var s; - return null==(s=t.onMouseEnter)?void 0:s.call(t,i)} - ,"onMouseEnter"),onMouseLeave:Qt(i=>{ - var s; - return null==(s=t.onMouseLeave)?void 0:s.call(t,i)} - ,"onMouseLeave"),ref(i){ - var s=t.ref; - "function"==typeof s?s(i):t.ref=i} - ,get disabled(){ - return t.disabled} - ,get scale(){ - return t.scale||"m"} - ,get leftIcon(){ - return!!t.leftIcon} - ,get rightIcon(){ - return!!t.rightIcon} - ,"data-tc-button":"true"} - ,i,{ - get children(){ - return[ULt(()=>t.leftIcon),ULt(()=>t.children),ULt(()=>t.rightIcon)]} - } - ))} - ,"Button"); - function LUt(t){ - requestAnimationFrame(()=>{ - requestAnimationFrame(t)} - )} - Qt(LUt,"nextFrame"); - const DUt=Qt(t=>{ - let i,s=!0; - const[e,n]=LLt(),[h,r]=LLt(),o=zLt(()=>t.children),{ - onBeforeEnter:a,onEnter:c,onAfterEnter:l,onBeforeExit:u,onExit:d,onAfterExit:f} - =t,p=ULt(()=>{ - const i=t.name||"s"; - return{ - enterActiveClass:t.enterActiveClass||i+"-enter-active",enterClass:t.enterClass||i+"-enter",enterToClass:t.enterToClass||i+"-enter-to",exitActiveClass:t.exitActiveClass||i+"-exit-active",exitClass:t.exitClass||i+"-exit",exitToClass:t.exitToClass||i+"-exit-to"} - } - ); - function w(i,o){ - if(!s||t.appear){ - let s=Qt(function(a){ - !i||a&&a.target!==i||(i.removeEventListener("transitionend",s),i.removeEventListener("animationend",s),i.classList.remove(...d),i.classList.remove(...f),FLt(()=>{ - e()!==i&&n(i),h()===i&&r(void 0)} - ),l&&l(i),"inout"===t.mode&&g(i,o))} - ,"endTransition"); - const u=p().enterClass.split(" "),d=p().enterActiveClass.split(" "),f=p().enterToClass.split(" "); - a&&a(i),i.classList.add(...u),i.classList.add(...d),LUt(()=>{ - i.classList.remove(...u),i.classList.add(...f),c&&c(i,()=>s()),(!c||c.length<2)&&(i.addEventListener("transitionend",s),i.addEventListener("animationend",s))} - )} - o&&!t.mode?r(i):n(i)} - function g(i,s){ - const h=p().exitClass.split(" "),r=p().exitActiveClass.split(" "),o=p().exitToClass.split(" "); - if(!s.parentNode)return a(); - function a(h){ - h&&h.target!==s||(s.removeEventListener("transitionend",a),s.removeEventListener("animationend",a),s.classList.remove(...r),s.classList.remove(...o),e()===s&&n(void 0),f&&f(s),"outin"===t.mode&&w(i,s))} - u&&u(s),s.classList.add(...h),s.classList.add(...r),LUt(()=>{ - s.classList.remove(...h),s.classList.add(...o)} - ),d&&d(s,()=>a()),(!d||d.length<2)&&(s.addEventListener("transitionend",a),s.addEventListener("animationend",a)),Qt(a,"endTransition")} - return Qt(w,"enterTransition"),Qt(g,"exitTransition"),DLt(e=>{ - for(i=o(); - "function"==typeof i; - )i=i(); - return $Lt(()=>(i&&i!==e&&("outin"!==t.mode?w(i,e):s&&n(i)),e&&e!==i&&"inout"!==t.mode&&g(i,e),s=!1,i))} - ),[e,h]} - ,"Transition"); - function GUt(t,i){ - const s=Qt(t=>{ - var s,e; - "Escape"===t.key&&(null==(s=document.activeElement)||s.blur(),null==(e=i())||e())} - ,"onKeyPress"); - document.body.addEventListener("keydown",s),WLt(()=>document.body.removeEventListener("keydown",s))} - function BUt(t,i){ - const{ - isEnabled:s,onClose:e} - =i(); - if(!s)return; - if("android"!==bUt().os)return; - window.history.pushState(FUt,""); - const n=Qt(t=>{ - t.preventDefault(),e()} - ,"popstateHandler"); - window.addEventListener("popstate",n,{ - once:!0} - ),WLt(()=>{ - window.removeEventListener("popstate",n),gUt(()=>{ - var t; - !0===(null==(t=window.history.state)?void 0:t[UUt])&&window.history.back()} - )} - )} - Qt(GUt,"escPressed"),Qt(BUt,"androidBackHandler$1"); - const UUt="androidBackHandler",FUt={ - [UUt]:!0} - ; - var $Ut=GDt('<svg><path fill-rule=evenodd clip-rule=evenodd d="M10.2122 14.3407C10.5384 14.0854 10.5959 13.614 10.3406 13.2878L6.20237 8.00003L10.3406 2.71227C10.5959 2.38607 10.5384 1.91469 10.2122 1.6594C9.88604 1.40412 9.41465 1.46161 9.15937 1.7878L4.65937 7.5378C4.44688 7.80932 4.44688 8.19074 4.65937 8.46226L9.15937 14.2123C9.41465 14.5385 9.88604 14.5959 10.2122 14.3407Z"></svg>',!1,!0,!1); - const HUt={ - left:0,top:90,right:180,bottom:270} - ,WUt=Qt(t=>{ - const i=bGt(),s=Qt(()=>t.fill||i.colors.icon.secondary,"fill"),e=Qt(()=>t.direction||"left","direction"); - return pDt(EGt("svg")` - transform: rotate(${ - t=>HUt[t.svgDirection]} - deg); - - transition: transform 0.1s ease-in-out; - - `,{ - xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",get svgDirection(){ - return e()} - ,get children(){ - var t=$Ut(); - return GLt(()=>UDt(t,"fill",s())),t} - } - )} - ,"ArrowIcon"); - var VUt=GDt('<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M18.5303 6.53033C18.8232 6.23744 18.8232 5.76256 18.5303 5.46967C18.2374 5.17678 17.7626 5.17678 17.4697 5.46967L12 10.9393L6.53033 5.46967C6.23744 5.17678 5.76256 5.17678 5.46967 5.46967C5.17678 5.76256 5.17678 6.23744 5.46967 6.53033L10.9393 12L5.46967 17.4697C5.17678 17.7626 5.17678 18.2374 5.46967 18.5303C5.76256 18.8232 6.23744 18.8232 6.53033 18.5303L12 13.0607L17.4697 18.5303C17.7626 18.8232 18.2374 18.8232 18.5303 18.5303C18.8232 18.2374 18.8232 17.7626 18.5303 17.4697L13.0607 12L18.5303 6.53033Z">'); - const jUt=Qt(t=>{ - const i=bGt(); - NGt(`CloseIcon ${ - i} - `); - const s=Qt(()=>t.fill||i.colors.icon.secondary,"fill"); - return e=VUt(),n=e.firstChild,GLt(()=>UDt(n,"fill",s())),e; - var e,n} - ,"CloseIcon"); - var KUt=GDt('<svg xmlns=http://www.w3.org/2000/svg width=16 height=16 viewBox="0 0 16 16"fill=none><g clip-path=url(#clip0_3783_2045)><circle cx=8 cy=8.00098 r=8></circle><path d="M4.75 8.50098L7 10.751L11.75 6.00098"stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path></g><defs><clipPath id=clip0_3783_2045><rect width=16 height=16 fill=white transform="translate(0 0.000976562)">'),zUt=GDt('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><circle cx=12 cy=12 r=11></circle><path d="M17.1364 9.6364C17.4879 9.28493 17.4879 8.71508 17.1364 8.36361C16.7849 8.01214 16.2151 8.01214 15.8636 8.36361L10 14.2272L8.1364 12.3636C7.78493 12.0121 7.21508 12.0121 6.86361 12.3636C6.51214 12.7151 6.51214 13.2849 6.86361 13.6364L9.36361 16.1364C9.71508 16.4879 10.2849 16.4879 10.6364 16.1364L17.1364 9.6364Z">'),YUt=GDt('<svg width=72 height=72 viewBox="0 0 72 72"fill=none xmlns=http://www.w3.org/2000/svg><circle cx=36 cy=36 r=33></circle><path d="M50.9142 28.4142C51.6953 27.6332 51.6953 26.3668 50.9142 25.5858C50.1332 24.8047 48.8668 24.8047 48.0858 25.5858L30 43.6716L23.9142 37.5858C23.1332 36.8047 21.8668 36.8047 21.0858 37.5858C20.3047 38.3668 20.3047 39.6332 21.0858 40.4142L28.5858 47.9142C29.3668 48.6953 30.6332 48.6953 31.4142 47.9142L50.9142 28.4142Z">'); - const qUt=Qt(t=>{ - const i=bGt(),s=Qt(()=>t.size||"s","size2"),e=Qt(()=>t.fill||i.colors.icon.success,"fill"); - return ULt(()=>{ - return ULt(()=>"xs"===s())()?(l=KUt(),u=l.firstChild.firstChild,d=u.nextSibling,GLt(s=>{ - var n=t.class,h=e(),r=i.colors.constant.white; - return n!==s.e&&UDt(l,"class",s.e=n),h!==s.t&&UDt(u,"fill",s.t=h),r!==s.a&&UDt(d,"stroke",s.a=r),s} - ,{ - e:void 0,t:void 0,a:void 0} - ),l):ULt(()=>"s"===s())()?(o=zUt(),a=o.firstChild,c=a.nextSibling,GLt(s=>{ - var n=t.class,h=e(),r=i.colors.constant.white; - return n!==s.e&&UDt(o,"class",s.e=n),h!==s.t&&UDt(a,"fill",s.t=h),r!==s.a&&UDt(c,"fill",s.a=r),s} - ,{ - e:void 0,t:void 0,a:void 0} - ),o):(n=YUt(),h=n.firstChild,r=h.nextSibling,GLt(s=>{ - var o=t.class,a=e(),c=i.colors.constant.white; - return o!==s.e&&UDt(n,"class",s.e=o),a!==s.t&&UDt(h,"fill",s.t=a),c!==s.a&&UDt(r,"fill",s.a=c),s} - ,{ - e:void 0,t:void 0,a:void 0} - ),n); - var n,h,r,o,a,c,l,u,d} - )} - ,"SuccessIcon"); - var XUt=GDt('<svg xmlns=http://www.w3.org/2000/svg width=103 height=102 viewBox="0 0 103 102"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M51.5 14.8747C31.5487 14.8747 15.375 31.0485 15.375 50.9997C15.375 70.951 31.5487 87.1247 51.5 87.1247C71.4513 87.1247 87.625 70.951 87.625 50.9997C87.625 31.0485 71.4513 14.8747 51.5 14.8747ZM9 50.9997C9 27.5276 28.0279 8.49974 51.5 8.49974C74.9721 8.49974 94 27.5276 94 50.9997C94 74.4718 74.9721 93.4997 51.5 93.4997C28.0279 93.4997 9 74.4718 9 50.9997ZM65.0234 37.4765C66.2682 38.7213 66.2682 40.7395 65.0234 41.9843L56.0078 50.9999L65.0234 60.0155C66.2682 61.2603 66.2682 63.2785 65.0234 64.5233C63.7786 65.7681 61.7604 65.7681 60.5156 64.5233L51.5 55.5077L42.4844 64.5233C41.2396 65.7681 39.2214 65.7681 37.9766 64.5233C36.7318 63.2785 36.7318 61.2603 37.9766 60.0155L46.9922 50.9999L37.9766 41.9843C36.7318 40.7395 36.7318 38.7213 37.9766 37.4765C39.2214 36.2317 41.2396 36.2317 42.4844 37.4765L51.5 46.4921L60.5156 37.4765C61.7604 36.2317 63.7787 36.2317 65.0234 37.4765Z"fill=#909090>'),JUt=GDt('<svg xmlns=http://www.w3.org/2000/svg width=72 height=72 viewBox="0 0 103 102"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M51.5 14.8747C31.5487 14.8747 15.375 31.0485 15.375 50.9997C15.375 70.951 31.5487 87.1247 51.5 87.1247C71.4513 87.1247 87.625 70.951 87.625 50.9997C87.625 31.0485 71.4513 14.8747 51.5 14.8747ZM9 50.9997C9 27.5276 28.0279 8.49974 51.5 8.49974C74.9721 8.49974 94 27.5276 94 50.9997C94 74.4718 74.9721 93.4997 51.5 93.4997C28.0279 93.4997 9 74.4718 9 50.9997ZM65.0234 37.4765C66.2682 38.7213 66.2682 40.7395 65.0234 41.9843L56.0078 50.9999L65.0234 60.0155C66.2682 61.2603 66.2682 63.2785 65.0234 64.5233C63.7786 65.7681 61.7604 65.7681 60.5156 64.5233L51.5 55.5077L42.4844 64.5233C41.2396 65.7681 39.2214 65.7681 37.9766 64.5233C36.7318 63.2785 36.7318 61.2603 37.9766 60.0155L46.9922 50.9999L37.9766 41.9843C36.7318 40.7395 36.7318 38.7213 37.9766 37.4765C39.2214 36.2317 41.2396 36.2317 42.4844 37.4765L51.5 46.4921L60.5156 37.4765C61.7604 36.2317 63.7787 36.2317 65.0234 37.4765Z"fill=#909090>'),QUt=GDt('<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 103 102"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M51.5 14.8747C31.5487 14.8747 15.375 31.0485 15.375 50.9997C15.375 70.951 31.5487 87.1247 51.5 87.1247C71.4513 87.1247 87.625 70.951 87.625 50.9997C87.625 31.0485 71.4513 14.8747 51.5 14.8747ZM9 50.9997C9 27.5276 28.0279 8.49974 51.5 8.49974C74.9721 8.49974 94 27.5276 94 50.9997C94 74.4718 74.9721 93.4997 51.5 93.4997C28.0279 93.4997 9 74.4718 9 50.9997ZM65.0234 37.4765C66.2682 38.7213 66.2682 40.7395 65.0234 41.9843L56.0078 50.9999L65.0234 60.0155C66.2682 61.2603 66.2682 63.2785 65.0234 64.5233C63.7786 65.7681 61.7604 65.7681 60.5156 64.5233L51.5 55.5077L42.4844 64.5233C41.2396 65.7681 39.2214 65.7681 37.9766 64.5233C36.7318 63.2785 36.7318 61.2603 37.9766 60.0155L46.9922 50.9999L37.9766 41.9843C36.7318 40.7395 36.7318 38.7213 37.9766 37.4765C39.2214 36.2317 41.2396 36.2317 42.4844 37.4765L51.5 46.4921L60.5156 37.4765C61.7604 36.2317 63.7787 36.2317 65.0234 37.4765Z"fill=#909090>'); - const ZUt=Qt(t=>{ - bGt(); - const i=Qt(()=>t.size||"m","size2"); - return ULt(()=>ULt(()=>"m"===i())()?XUt():ULt(()=>"s"===i())()?JUt():QUt())} - ,"ErrorIcon"); - var tFt=GDt('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M15.55 5.85123C18.9459 7.81184 20.1094 12.1541 18.1488 15.55C16.1882 18.9459 11.8459 20.1094 8.44998 18.1488C8.01952 17.9003 7.46909 18.0478 7.22056 18.4782C6.97203 18.9087 7.11952 19.4591 7.54998 19.7076C11.8068 22.1653 17.2499 20.7068 19.7076 16.45C22.1653 12.1932 20.7068 6.75005 16.45 4.29239C12.1932 1.83472 6.75003 3.29321 4.29236 7.55001C4.04383 7.98047 4.19132 8.53091 4.62178 8.77943C5.05224 9.02796 5.60268 8.88048 5.8512 8.45001C7.81181 5.05413 12.1541 3.89062 15.55 5.85123Z">'),iFt=GDt('<svg xmlns=http://www.w3.org/2000/svg width=44 height=44 viewBox="0 0 44 44"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M22 2.99951C11.5066 2.99951 3 11.5061 3 21.9995C3 32.4929 11.5066 40.9995 22 40.9995C22.8284 40.9995 23.5 41.6711 23.5 42.4995C23.5 43.3279 22.8284 43.9995 22 43.9995C9.84974 43.9995 0 34.1498 0 21.9995C0 9.84925 9.84974 -0.000488281 22 -0.000488281C34.1503 -0.000488281 44 9.84925 44 21.9995C44 22.8279 43.3284 23.4995 42.5 23.4995C41.6716 23.4995 41 22.8279 41 21.9995C41 11.5061 32.4934 2.99951 22 2.99951Z">'),sFt=GDt('<svg width=72 height=72 viewBox="0 0 72 72"fill=none xmlns=http://www.w3.org/2000/svg><path d="M24 56.7846C35.479 63.412 50.1572 59.479 56.7846 47.9999C63.412 36.5209 59.479 21.8427 48 15.2153C36.521 8.58791 21.8428 12.5209 15.2154 23.9999"stroke-width=4 stroke-linecap=round stroke-linejoin=round>'); - const eFt=Qt(t=>{ - const i=bGt(),s=Qt(()=>t.size||"xs","size2"),e=Qt(()=>t.fill||i.colors.icon.tertiary,"fill"),n=mGt` - animation: ${ - vGt` - 0% { - - transform: rotate(0deg); - - } - - 100% { - - transform: rotate(360deg); - - } - - `} - 1s linear infinite; - - `; - return ULt(()=>{ - return ULt(()=>"xs"===s())()?(a=tFt(),c=a.firstChild,GLt(i=>{ - var s=zkt(n,t.class),h=e(); - return s!==i.e&&UDt(a,"class",i.e=s),h!==i.t&&UDt(c,"fill",i.t=h),i} - ,{ - e:void 0,t:void 0} - ),a):ULt(()=>"s"===s())()?(r=iFt(),o=r.firstChild,GLt(i=>{ - var s=zkt(n,t.class),h=e(); - return s!==i.e&&UDt(r,"class",i.e=s),h!==i.t&&UDt(o,"fill",i.t=h),i} - ,{ - e:void 0,t:void 0} - ),r):(i=sFt(),h=i.firstChild,GLt(s=>{ - var r=zkt(n,t.class),o=e(); - return r!==s.e&&UDt(i,"class",s.e=r),o!==s.t&&UDt(h,"stroke",s.t=o),s} - ,{ - e:void 0,t:void 0} - ),i); - var i,h,r,o,a,c} - )} - ,"LoaderIcon"); - var nFt=GDt('<svg xmlns=http://www.w3.org/2000/svg width=16 height=16 viewBox="0 0 16 16"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M5.56608 4.42584C5.82527 3.32158 6.8176 2.5 8.00001 2.5C9.38072 2.5 10.5 3.61929 10.5 5C10.5 5.63026 10.3391 6.0386 10.1264 6.34455C9.90018 6.66993 9.58561 6.92478 9.18864 7.20877C9.12579 7.25372 9.05873 7.30025 8.9887 7.34883C8.27392 7.84472 7.25001 8.55507 7.25001 10V10.25C7.25001 10.6642 7.5858 11 8.00001 11C8.41422 11 8.75001 10.6642 8.75001 10.25V10C8.75001 9.36502 9.10777 9.1096 9.94554 8.51149L10.0614 8.42873C10.4769 8.13147 10.9748 7.75194 11.358 7.20076C11.7547 6.63015 12 5.91973 12 5C12 2.79086 10.2091 1 8.00001 1C6.10564 1 4.5205 2.31615 4.10577 4.08308C4.01112 4.48634 4.26129 4.88997 4.66454 4.98462C5.0678 5.07927 5.47143 4.8291 5.56608 4.42584ZM8.00001 15C8.60752 15 9.10001 14.5075 9.10001 13.9C9.10001 13.2925 8.60752 12.8 8.00001 12.8C7.39249 12.8 6.90001 13.2925 6.90001 13.9C6.90001 14.5075 7.39249 15 8.00001 15Z">'); - const hFt=Qt(t=>{ - const i=bGt(),s=Qt(()=>t.fill||i.colors.icon.secondary,"fill"); - return e=nFt(),n=e.firstChild,GLt(()=>UDt(n,"fill",s())),e; - var e,n} - ,"QuestionIcon"); - var rFt=GDt('<svg xmlns=http://www.w3.org/2000/svg width=16 height=16 viewBox="0 0 16 16"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M3.56176 1.87482C3.8379 1.87482 4.06176 2.09867 4.06176 2.37482V3.69674C5.09916 2.7469 6.48174 2.16666 7.99996 2.16666C11.2216 2.16666 13.8333 4.77834 13.8333 8C13.8333 11.2217 11.2216 13.8333 7.99996 13.8333C4.7783 13.8333 2.16663 11.2217 2.16663 8C2.16663 7.72385 2.39048 7.5 2.66663 7.5C2.94277 7.5 3.16663 7.72385 3.16663 8C3.16663 10.6694 5.33058 12.8333 7.99996 12.8333C10.6693 12.8333 12.8333 10.6694 12.8333 8C12.8333 5.33062 10.6693 3.16666 7.99996 3.16666C6.68645 3.16666 5.49513 3.69037 4.62354 4.54148H6.22843C6.50457 4.54148 6.72843 4.76534 6.72843 5.04148C6.72843 5.31763 6.50457 5.54148 6.22843 5.54148H3.56176C3.28562 5.54148 3.06176 5.31763 3.06176 5.04148V2.37482C3.06176 2.09867 3.28562 1.87482 3.56176 1.87482Z">'); - const oFt=Qt(t=>{ - const i=bGt(); - return s=rFt(),e=s.firstChild,GLt(()=>UDt(e,"fill",i.colors.text.primary)),s; - var s,e} - ,"RetryIcon"); - var aFt=GDt('<svg xmlns=http://www.w3.org/2000/svg width=16 height=17 viewBox="0 0 16 17"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M1 4.12695C1 3.07754 1 2.55284 1.19202 2.14684C1.38986 1.72856 1.7266 1.39181 2.14489 1.19397C2.55088 1.00195 3.07559 1.00195 4.125 1.00195C5.17441 1.00195 5.69912 1.00195 6.10511 1.19397C6.5234 1.39181 6.86014 1.72856 7.05798 2.14684C7.25 2.55284 7.25 3.07754 7.25 4.12695C7.25 5.17636 7.25 5.70107 7.05798 6.10706C6.86014 6.52535 6.5234 6.8621 6.10511 7.05993C5.69912 7.25195 5.17441 7.25195 4.125 7.25195C3.07559 7.25195 2.55088 7.25195 2.14489 7.05993C1.7266 6.8621 1.38986 6.52535 1.19202 6.10706C1 5.70107 1 5.17636 1 4.12695ZM2.5 3.30195C2.5 3.02193 2.5 2.88191 2.5545 2.77496C2.60243 2.68088 2.67892 2.60439 2.773 2.55645C2.87996 2.50195 3.01997 2.50195 3.3 2.50195H4.95C5.23003 2.50195 5.37004 2.50195 5.477 2.55645C5.57108 2.60439 5.64757 2.68088 5.6955 2.77496C5.75 2.88191 5.75 3.02193 5.75 3.30195V4.95195C5.75 5.23198 5.75 5.37199 5.6955 5.47895C5.64757 5.57303 5.57108 5.64952 5.477 5.69746C5.37004 5.75195 5.23003 5.75195 4.95 5.75195H3.3C3.01997 5.75195 2.87996 5.75195 2.773 5.69746C2.67892 5.64952 2.60243 5.57303 2.5545 5.47895C2.5 5.37199 2.5 5.23198 2.5 4.95195V3.30195ZM1 11.877C1 10.8275 1 10.3028 1.19202 9.89684C1.38986 9.47856 1.7266 9.14181 2.14489 8.94397C2.55088 8.75195 3.07559 8.75195 4.125 8.75195C5.17441 8.75195 5.69912 8.75195 6.10511 8.94397C6.5234 9.14181 6.86014 9.47856 7.05798 9.89684C7.25 10.3028 7.25 10.8275 7.25 11.877C7.25 12.9264 7.25 13.4511 7.05798 13.8571C6.86014 14.2753 6.5234 14.6121 6.10511 14.8099C5.69912 15.002 5.17441 15.002 4.125 15.002C3.07559 15.002 2.55088 15.002 2.14489 14.8099C1.7266 14.6121 1.38986 14.2753 1.19202 13.8571C1 13.4511 1 12.9264 1 11.877ZM2.5 11.052C2.5 10.7719 2.5 10.6319 2.5545 10.525C2.60243 10.4309 2.67892 10.3544 2.773 10.3064C2.87996 10.252 3.01997 10.252 3.3 10.252H4.95C5.23003 10.252 5.37004 10.252 5.477 10.3064C5.57108 10.3544 5.64757 10.4309 5.6955 10.525C5.75 10.6319 5.75 10.7719 5.75 11.052V12.702C5.75 12.982 5.75 13.122 5.6955 13.2289C5.64757 13.323 5.57108 13.3995 5.477 13.4475C5.37004 13.502 5.23003 13.502 4.95 13.502H3.3C3.01997 13.502 2.87996 13.502 2.773 13.4475C2.67892 13.3995 2.60243 13.323 2.5545 13.2289C2.5 13.122 2.5 12.982 2.5 12.702V11.052ZM8.94202 2.14684C8.75 2.55284 8.75 3.07754 8.75 4.12695C8.75 5.17636 8.75 5.70107 8.94202 6.10706C9.13986 6.52535 9.4766 6.8621 9.89489 7.05993C10.3009 7.25195 10.8256 7.25195 11.875 7.25195C12.9244 7.25195 13.4491 7.25195 13.8551 7.05993C14.2734 6.8621 14.6101 6.52535 14.808 6.10706C15 5.70107 15 5.17636 15 4.12695C15 3.07754 15 2.55284 14.808 2.14684C14.6101 1.72856 14.2734 1.39181 13.8551 1.19397C13.4491 1.00195 12.9244 1.00195 11.875 1.00195C10.8256 1.00195 10.3009 1.00195 9.89489 1.19397C9.4766 1.39181 9.13986 1.72856 8.94202 2.14684ZM10.3045 2.77496C10.25 2.88191 10.25 3.02193 10.25 3.30195V4.95195C10.25 5.23198 10.25 5.37199 10.3045 5.47895C10.3524 5.57303 10.4289 5.64952 10.523 5.69746C10.63 5.75195 10.77 5.75195 11.05 5.75195H12.7C12.98 5.75195 13.12 5.75195 13.227 5.69746C13.3211 5.64952 13.3976 5.57303 13.4455 5.47895C13.5 5.37199 13.5 5.23198 13.5 4.95195V3.30195C13.5 3.02193 13.5 2.88191 13.4455 2.77496C13.3976 2.68088 13.3211 2.60439 13.227 2.55645C13.12 2.50195 12.98 2.50195 12.7 2.50195H11.05C10.77 2.50195 10.63 2.50195 10.523 2.55645C10.4289 2.60439 10.3524 2.68088 10.3045 2.77496ZM8.80727 9.13518C8.75 9.26242 8.75 9.4256 8.75 9.75195C8.75 10.0783 8.75 10.2415 8.80727 10.3687C8.87245 10.5136 8.9884 10.6295 9.13323 10.6947C9.26047 10.752 9.42365 10.752 9.75 10.752C10.0764 10.752 10.2395 10.752 10.3668 10.6947C10.5116 10.6295 10.6276 10.5136 10.6927 10.3687C10.75 10.2415 10.75 10.0783 10.75 9.75195C10.75 9.4256 10.75 9.26242 10.6927 9.13518C10.6276 8.99035 10.5116 8.8744 10.3668 8.80922C10.2395 8.75195 10.0764 8.75195 9.75 8.75195C9.42365 8.75195 9.26047 8.75195 9.13323 8.80922C8.9884 8.8744 8.87245 8.99035 8.80727 9.13518ZM10.87 11.8771C10.87 11.546 10.87 11.3805 10.9289 11.2517C10.9938 11.1098 11.1077 10.9959 11.2497 10.931C11.3784 10.8721 11.5439 10.8721 11.875 10.8721C12.2061 10.8721 12.3716 10.8721 12.5003 10.931C12.6423 10.9959 12.7562 11.1098 12.8211 11.2517C12.88 11.3805 12.88 11.546 12.88 11.8771C12.88 12.2081 12.88 12.3737 12.8211 12.5024C12.7562 12.6444 12.6423 12.7583 12.5003 12.8232C12.3716 12.8821 12.2061 12.8821 11.875 12.8821C11.5439 12.8821 11.3784 12.8821 11.2497 12.8232C11.1077 12.7583 10.9938 12.6444 10.9289 12.5024C10.87 12.3737 10.87 12.2081 10.87 11.8771ZM8.80727 13.3852C8.75 13.5124 8.75 13.6756 8.75 14.002C8.75 14.3283 8.75 14.4915 8.80727 14.6187C8.87245 14.7636 8.9884 14.8795 9.13323 14.9447C9.26047 15.002 9.42365 15.002 9.75 15.002C10.0764 15.002 10.2395 15.002 10.3668 14.9447C10.5116 14.8795 10.6276 14.7636 10.6927 14.6187C10.75 14.4915 10.75 14.3283 10.75 14.002C10.75 13.6756 10.75 13.5124 10.6927 13.3852C10.6276 13.2404 10.5116 13.1244 10.3668 13.0592C10.2395 13.002 10.0764 13.002 9.75 13.002C9.42365 13.002 9.26047 13.002 9.13323 13.0592C8.9884 13.1244 8.87245 13.2404 8.80727 13.3852ZM13 9.75195C13 9.4256 13 9.26242 13.0573 9.13518C13.1224 8.99035 13.2384 8.8744 13.3832 8.80922C13.5105 8.75195 13.6736 8.75195 14 8.75195C14.3264 8.75195 14.4895 8.75195 14.6168 8.80922C14.7616 8.8744 14.8776 8.99035 14.9427 9.13518C15 9.26242 15 9.4256 15 9.75195C15 10.0783 15 10.2415 14.9427 10.3687C14.8776 10.5136 14.7616 10.6295 14.6168 10.6947C14.4895 10.752 14.3264 10.752 14 10.752C13.6736 10.752 13.5105 10.752 13.3832 10.6947C13.2384 10.6295 13.1224 10.5136 13.0573 10.3687C13 10.2415 13 10.0783 13 9.75195ZM13.0573 13.3852C13 13.5124 13 13.6756 13 14.002C13 14.3283 13 14.4915 13.0573 14.6187C13.1224 14.7636 13.2384 14.8795 13.3832 14.9447C13.5105 15.002 13.6736 15.002 14 15.002C14.3264 15.002 14.4895 15.002 14.6168 14.9447C14.7616 14.8795 14.8776 14.7636 14.9427 14.6187C15 14.4915 15 14.3283 15 14.002C15 13.6756 15 13.5124 14.9427 13.3852C14.8776 13.2404 14.7616 13.1244 14.6168 13.0592C14.4895 13.002 14.3264 13.002 14 13.002C13.6736 13.002 13.5105 13.002 13.3832 13.0592C13.2384 13.1244 13.1224 13.2404 13.0573 13.3852Z">'); - const cFt=Qt(t=>{ - const i=bGt(),s=Qt(()=>t.fill||i.colors.icon.secondary,"fill"); - return e=aFt(),n=e.firstChild,GLt(()=>UDt(n,"fill",s())),e; - var e,n} - ,"QRIcon"),lFt="data:image/png; - base64,iVBORw0KGgoAAAANSUhEUgAAAGEAAABgCAYAAAANWhwGAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAB55SURBVHgBtV1f7GVXVV7r/qYoNMI0Sg0q9MeTRIPUmBhDCLQ+kIgRSowv/qNFiMFoeDRqYvHRN5poUBNTqi8+OcU/kfjSUl+NTqkSHoxMMfrQEDpV20pnepbnnL2+b33r3DtDhznsycy955x99l5/v7X22ufccfsW2t/FA+evTNOH3A73hk33WfhFs7jobhFhjk/0x4kbtaP+OQyuLZ96/fh+X3uMm5IEDiL/5ljLHaCn5l7HWGcXatfzS++1p9Un6JmPng/3Z32yKweLx6+dHb7wYX/8it1C81vpfOn6zzx4ZvaRef77ioEY3062wdQ3JWKjhDyXLC9T9PGXS+ZhOK99VOEpdA8V/XasnOdmtJzmKfKLH8vB7fI81SMfvPDXn7XX0F6TEi5de+A+91cfPbjfsxAxTWl8TcogbGXLbn7uiKE2jHqNt84q9PEtx40yhJCJMLaONOgp4cexOBa1RbN8ubPP4uK/mI70zR5iB/vUh/yvHrObtJsq4VI8cPEwTQ/PM34y3dkw05ZVHEQS7MqxEaZsAzamQoAxEYHo8nV7qiu2CtB51VbXuxKthG3fzoszvlFWzTEuNEWQa/CksHVwyOlwsE+/ejj7vRmmrtqJ5jdRwLlfv35pHvPeImue6DD4XfxaUagg2I4N8IQxDtiwMqAwAXTDmRELPL8N9QCUF3MWwS5kucMS0XcdJ9zL0WD/dAaYQ+hcIfcY6dyYTw83aQxFa3nQfP1gX5kOZz95Kl6cVMKll2cF3PHqE/MY55Qg+CfZybUGXU+bqKBFUzVCpsAHI6nYoRczQ4DCoWEup3eYRGP0gBoKuq1HbFOBjjk2Ttn03a4XqaSvS9QFq6AFg8FeibOz+7eKONhWATME2R3XZgXEeVPAEgq7gqGJUKBMBIi6bhUeKRnocFwPdo/KghQ9ighiTpRRG4Sb86eiwsp5xmzrnxjnJ2gwyhMwqSu/ptdBVxwL2vU6xeGpwPWG+eMev37t0irjmynhcP3awx5+jpxiYM8y0DqIBVAiUngrE1MJJ9YjwiRoYlYSUzK+jDfOuLdIHPSsnGMIduoKisbqcj1SyE66cwzM4kMkUN1MZ9CKp5GmOkd0Y9YTeU7FC95xPkirGk/da8E57l1kLJ26K1165QMPzjM/6hXJMkxCxnRlBrE+6SYgS7qn+Iueld4zMtjpvmbHawmwWddF7jTcihLKQ9T8cB8J7setuz+xSTDNcEb661ywBhnl/g/f8TdPLt+6Jxz8Yciwos0UTgAcU4VGWLOGDYLApgRu+1l6VQl2060xvDiQ3DouNMBKi/QQ5MB9MUXdJLOs80+8J3I2YFDk30bb1jtwY5jyWpLCsXcBLXc9ijGphNUL1kCcQhi5rgfhJsbnCgWTCKuyjRJIwLNVoMkhwHtAiqSWArQ6ErA3aroI4H5x2aRPDKyLmHMBIZ0lg3eAP9sOuR1ixrVDjcA+iIdlZJEgHCRldYpERLfzv7z+0x9pSphv/+Qm6BC3OVRGebIGS87FiS72Q+SDviIYpDHM/qMMUHXhvBfzjLOAJodglmuK8UCZBYjSpWlYFUMhGcpzeBM9NKqPR8Pa4m0CoC4xM6aMUAjKkiS4IYFFbhf2YDI5UlK78I1/N+iIekndbeyzrmnpoB/j3BbHFQ48zbtldSJG3NZQyLUscVyGwBhiDy1uAGZBK9cUNyibnKIb8URo1gXERg6VY5ecjPP5HdPbL4wr1x4QYRpycVjDmDSaQHt/G9ZI4sBe9/voTKZAomJmB3pRZqSVMkkmDSoMY3zM+ysJXU08yTIoQjJr5xxhymugPlOrC4RzUQu4Xa3fVQ6mPFEiUjCcvuEPDCWcxfsSHBbnMm8MebqlbSxuXJ+SKkwXXIrKUshUNozyRbhDukEFgbmaO/EwV2NCIUaa84oh4JA82qA9zkvLREw94k++M1EfiU5w3oOk4FsDzfH6aCVWAbU5vBzsXYcc9HzQPHURF6sm6Am7HTqXZTH7hqm1uP5V56BdrAI0htoBl+5Yf3SrK6oQVhC1VkTOgFpBg4hOLU+UbOI+yRkYn0TljBPo6rAaHHP1sBDuK5lYbXDEhiNDHqPOo993yPvOLcG5Fk6RE0E0pYpVUHPmOq2WgNxRlRVdcOufKc1SychAOH+OoJohKyegA8MPopxcJDeYy0+siCFGdg6kowH3dAhsGDWtXGA0ogv+yCANjombo8qved11hJQUx1lEfjGzo3gTRAXBjxw5QPNqaEQZKCplH9ZSjuYy5c26sBuig+SsgoJ8EV4oTYEmV+gqqOo8BySTfYNrJ7eh5Ly8LkpxvZzbvaCvvJIaTxSF4ayZGGJp8qVZYkUdwNdK35sOOfBYD0RJbrAZhYq5ZlBMLnRzL6+BEIY2CqWDSM8lf1OeitaMfFZtBkJvNPLepMHUATWKeRlLmoATOGIIWWDUVYEZYMkz6KI3yX2VpifPtgDaJDQsAx0oueVeWTETSCqEZa6bmTP/pF6TuszNaiMkiR8RA8ozpm5rFsXgXIoOrL9EkKnHcZ9VJpV0RNFtVueDNBQvVvDlVXYYUkoPcCxNm97ARdQ8aUvlECW3wq/MksY4bl1sk/BmdsFM8c0kaR9+C7/k2FGwXpa49sKKLp579v/8iT/7z8rpk5YyazVxqxKSBIy73/ad9uMfvDvuvOuOnNOt4oatCs/Yg/zQEYhFhaTtS0993f71qa97ZUcDSKAOh4Lqmlnxt+acd9/zerv/l7+PY6/wE4dNzamORJYBsGxLiuGVfsGOiJ5qiJGWMcWIJlaYoQtCDNJ+/+cu25Wn/9tusfn2xEdfeId/4DfeNsSQgnCxahBNezdIb3hi8rga4h987Bl77tmX7fZb2H2/9P1FMrzIooVxTJ698my3NPQ/bCcYDI4gNU0xAlPUSMDBPFGuGCWNl65esz3a/76AcVx2vBA3ADeZhG/W9cOyx33LTfsooFDFpbbmCh2pjSV7HF0rNQ1TuM6wP39BdpT5ikAXVAbZrhemogEYbjK9MwffpxGGCSwI3OnObijIrZmyxIfcXUhm3XZrsLfA+kQAd0zvBczR/BsyTg4gwArM7vU3wyQEO0JJLbWj4ozV3GEMnrZXcxDLI1OtQOG9QBK0DkcJbU/D4CxDEtNUGZIkGb0nc3vmWIjt65ULRbgxWFjlR+MUMxv0QX9ICJBgTVz7MBvtSa6Mpa7hLQI5vLnmsKB3T3oIKk3tkv7UOsrr2JIeyKnMhilqBTYwsp22AGncCFCYohZLxpRzL8srQkvIw6VRprCew6+dJgVJDGR7tr4ekgNm/yLB1WBBE/gp6174OCjdsCELnSzwoaqBU7XMOpiV7NN6KpzLMava0JHbj7uQF8ILdtUAoLdVCHAFixgrmDTJnKVigLXPWgC9QLITTjyO91qj8j4zSVgRIsy6IvbiusXlJehPWYI2VBcyuzcuKkFs8dBWH7ffgDHhJEtWyTZsJdPTFYoOVaKADAtXRl9kR5FF1CzIiSCisE3CzsDlqaALQcX3BWDzMi/srDnCAZkPWN2aapSLlBZ384ZajUumAFsnfEbFotB7uRdt8I+Fl1wxV8mKWS8XITXQeO5lYDACZUwuilj+nWzPBuFbhmXhKkNgSH0p0oa8opzvjEdZJIyC5xQ4NWG5WBspKUDEjWF5hGgmM4ZStlUgiKYALLbHpQAJEsSBkmbmti/DVmNjG0aDH7NXxqbIjonPueJvgfL2SXLJugD+mSdGoX9W3sYe97AG7D9b1DNb4gnVyvQH8mJ3a2gkeQ59NrgQz4+C5Q48R2VuGQtYgNmkoMEtVya0o67k1uPW7TYmDLXBMWAmS1jMqGPgwrD5gd2BbeCoinEGZpbP0n5S8F6IHFZxB8cWrMJb77Vng5PJ7AJLnpqp+At7jCYo26vlStwRiWxky1hN1d4CN/cglQznAKIg7bmfgM6usSY0DXTavOThEQVMO3uANnF2yxVqRTGua7gJcByWd7SMAD1b8I1KGgCeLpQMcFoOpqh9jeFBup+wOE+0bKTGH2Xk4dUusqloECi572x0grVtTVI5ORMzLhRpf7u75Zg7KUufDGQ9pCw3ISGzJWMDjBpCNpOeMClbjILAFKzcpVfpMzZw8TbguODe08Z9mgPhzaxZvy79O73w/v5emu2qEMKx96yG1TerZ5qwjkCMHf34JoMJHLkUurCqNhNEds1VYJXRvlc9Z0d2m1KlLKxPhogcsqyxoWXfMmqwPsTqc+4gaskG32uxVp6cFevseyhGuqXUQmjCRO1q9onK3llWiPf94lvsdtudFy/YPT9yZ3TmU5h+rG15mk4gC/dF/NSv/8Btu+hC0w+/967oS48NIa2KnOuYo1bS9txitb946T6YkjzOTnCVCO9WKzi3intNgSdcn32TgoQNzbc55wFz+9e++nL85k/8o7949brdTvuh91603/38vYApklmE1jnlSwVwzBTBd7XBAeUm+bzxGxjG+ksFsLQDhIAJJ9GRmSzF0uUZTYRQ5keJXQKSOVQQFhlIQjQTpNmNoTXmPeGrt62ApX3pqauSaARCvUSbNe/i9yiEJ5Nm9a36sZhbpWnDkys18iilJGytA1uluYGYMOVgjAnjX2KtZ0rVogKm2B4bH0NgApuvOIC4tbjVMLJ0mzE/ZLx9WpTwSx24lLkLvCMfV0EZzZEeRFVvQzTFLzG4z+kqnZnCYbie8smke53zMG7PvBfAg00b2iry3lHDGBqlqh2KGofCaIw7uecQISVgG0llVACD8yabtm8bcODis4UVOV+SoQEU/SEPR4bC6kHx7fqsVcoso3iOmRlSynBQ4MiOQhAm5wbBAlLR3DbF5qAhhY36UoJoKix7V34sT8OJs4OHikO7NV+fuLOp6kwJnpbuzuPSzkjZUSTMXqBK9JQuPIV4PKiH3NqzS/qMbdRzR4hAkNKa6wgLUtqo7brlQsDk8+FnKGL95DZEZsUV2iYuR6r2jzq8V7HHba92tE+SdZykcyF/Sm9w14jliMEJVfRkyie3MUxWSiidDoni0WkWNiorWq6N2lE+EJ8eVo+UKA9MCr2FgVC8wryZ7SjTlXXV2Bvhr0w4id65+dhlkaWoZoJm0VJb9VbXQB1SjvCNkHR9BYOWtyA0Bhr0vXw9YHSzWnqjJOeKnQbESnAxzX+RNWS8mKrG740xuGN9lCAQa7QSul9rY2vdCdeNaBRHdzJVQV2OGSBem/Xqm5+Ic8mzyDJlhbmnhKPg0wsIORqiJXcZwZl0w0GR0LC+bliklPW7RIAR3yUMew1voej8bWhhFRSjFtYDSsgAVsK0ftd7x/cMIKI3Z3oPFXhhBUZIvlkGrIe/en2FdhhVzjZ59KWW6jiGqBH0IFKrfFNif8hfGofEBgYm26tJaSNo1+CpP5vkm4lpLMxfiiMzPRst27O0d1aYMIZlhAJ+62OQXhMFg2So2AasduaE7PSLoNsGsFcYTr5KENG0EcTthqA7NAhM/NZgVI1eK8uHqiQgQx6EG3NuWSSoij+w+uCbMSAbY3YULUAyQdNjIg/TBEuoMxN+rFIEJtRWKZ4Gw0qAjQ5q5HxAoe3cNs/qVRANZia6WskEo5JGr1Eihc9K6RgxGjxpiBH/kX2m5Wx7IHhre+3Yob7MpCWdgtsNLU6bLJ+xKlQBvCcnwoe7Ru/9Wnoyzabz1Z9xJV8rj97jgCpMlIY5TpEegOlNdgjGD3IzdSnlCRQazES0JdZNnSjE8gVXkbrR8hCsqMhgKWXCyt7Udm6/OYnDM6OkzeGFAvWu94k8oJAhEkbX4PomOQ0Rewh0iawrz7mAc3ztHekb0tWkIbgiGYEedwA6AEtRO93lim4wN6AceGT25MDUuLFF7dFguh2CDbyLN7ofx4dA/KuXMuA3y/mpXj4cY0eYYoXRDhyaXoADVVRIogZg0OKLDqgBBbdBo/qPT3m5DmrphIhhCCbjwmQuq6ddl2yRRQhw4LDmqQFOjIpnCqmS9YQg0sqAXZlhjHvRJ8dGjsO94CjsyBVHtMBslD6jsDAxnhQom8EFY5of7iR0qaMctE4Fqykei5NFPFO+0cEVi+/rC8y3CAj55k9hfCM2SgZhJm/CRlgzj7B8iCKFLL9+wKqN0cUIvVgroWxhW2mCTHQeNfLCHMF7dc/u19Z2lTQtDLxCk+sOksN4NARx5xvPbI/25nu+Y/X7YP0GLIfLWtc7TLk1ORDXJfvJUMmEWuOni5hE+QBE59DpSH/+P+8O76IlUBOz6ZaVeuKz8HEQ+ewzL9rn//C/zPtot9Te8KYze/+vvcX+45mX7MUXths7YnnpPVqjWQkfT2yuT36dv/NOf/aLL9mX/+GqdVpCjk99j9b/9TNNP/vbb403XDwzhD6jF7mk3xJrQDGrESKz1EJ5Qk9FpOqpQZTLEKuJpkEQQ6vZH//qv9lXZ0XcbnvDvKf74d96K2nwo5rPoE/QjqTKMKvV/M67n751SzjR5n1vf+8vvDlKLk6YC+YhqDikcwyAYhUVfbOiUM+iBvJ/ok7TC4MmwNwpDFZV6HMvvfCq7dcEPSaTIJOE20AzI65F3HiEHaiRbBBvrLGwRIBlnM8YPfHXENRAwI/sMSsWYTeMuYEjTGVtxKeoWooBjEwVtQvDbaCQrAJrDxwXXLYAHFDTXg2YYxWyl6SCtDAJMi75VmnmZtJmsPHBn1XA2BKWlUHlyFDIq2dvChH2TCutWNV5BQoiIqqukOcqUKYdxo5UafGhjEG2aOEfOE+aIhdK6RRRBnWhBrd80yVD8vpqqvfK9RFBxmCoQWi3BuHWCtJ1lbR2qS3TnjYKfVwt70XWJujmOWSJPSAbAFwD6XhWO/JHTrhYA+2r4/RoIAPwVO2a0ens29SW4adcuo5fPxXSvKy8nH/7ubeBFO8tHziBFnj8N5vs24/OI5/h61L4JHaJ5mR2Qx0DD4JhoaNJ1G4spwFD6dFEkKjb8iDmHKTVYs+I0IkLlPpDDHPkPmKoXGSsXyMrSrUmwiu0ZdksnxDR8Mu7+BPWLC/LEKkanLKdWtYyYGoKfzyGra079UpHkoi/+7Uhr142CIHAIcOKpVbAanxaxeu1x17KtkQkyXvIOE5F2eH4ROWPDO/IMeLBBE6aPF3yIga/YOGS9NmOTZbPmh4gtx8FTbxGEFIsFChfz0wTTYnbmyZ+O26R5XmyvP6LJ2EqM5CaSylnn+YtXUs/Mwqa/aLyd9ZtKv/Y0xFyeej0sgz5E+dHxyCirFRMfKPHEs0h9gzMUTdCuFw6JNOVcURfVeSAI7+1XT3/WHrpiW4NjkAn/ByZlLHPjkTloOZquUQNzIj1WtSDcw1EmfwsmqkXBxHUsfbMifCSIPWUB4V3fZNg92eGUBcCEdhIxK9cGCAiq0fMV6pAvacKaIo5/yAJpe8hL7jHmNydiQxcKOsVPkwIVdTQWWJYU6zvPaoGCmtTMK25d6TcienQeZ0WXs+xweILPrHSAdd6egeKhoBc406SGjxveB6ResIPH8pCElUJeUlEA27CErGWzoQxtwuVWJPbPWPyIApcSPA17lVzWSrXzAAQ499pMt+ZKpKmh4aAO8pq3E8u2jXDizZG/axCK03ABWRKYh8GUyxkUOS5XRryLvjxCAmOc2bJsKKxVUlguXY4GASzYyt5lLxCkqFM5uu6VRTbyiezIzCW1mTG3AP/O0cFuS58EwiIvf2AxOdKOZdB4pOg4mirbtw7xLDvzzwwWib8SNgPLVlkZsS3Dmg8U+ZSqZyI/stfXbzJPvHV5P202OJrqC/Zfuzic7tsNwViTUY9Nh13TxTEILl/HmrII1LVJtswZt7sIaFiFPvaK7TEKi79A3uOWqOh4TEUwyNSDe//xN3293/0nBI+mqZZp46lLTtr7/n576YimKhxrKiAixRZ5gpZuywn3/+J77V/+turpye7EV2b89/zttfZD77nu8wkczx14xBKXuuGwWgwjNkr03j06o9FuXWff2j7oNFcXpBjxpW/Hp+60xQtjw9pAoIXRnGdXtUiD/PDOj6ctd6bgJcuZw+1jG1zNF7sxu309RzZanKRed6CNAwUb6bsDwYAK8SiNTvCDexqgFg3F3cPqZDlT4ZN9bwNxUMVExOl8IZ/vSL9iYiSGUbk+EnLRnCtnk84sKotmFYxB3AE7zXbBspodywKHzFlUtgD9Y4cMvE+b8qw7fSIAurxYyA159rnAgb1EcOG+fKHYHz8p0BOg9N6OUO4VZh0dkqTZWaSahrl9Gh198p+wtdnd/iWUJqWVkdb8N34FO4J2mZasMACSgYGF7Mysj5aWr63aWif65jusodcC1iI3dNLgu6B7/Lmk2OP2a5GwHXKbrylrkn6JC45DKKWrorIkdbpEVuBkwnOlOOnE2v6HzkH7o2mgIYNwGC1/HbVq3S5np2mqaiOPhyTD27kFl81Wf1fC+vvV1SWGdLde3ZpXm64TnR1vL1pcbVcJ7QSLM+P2kZ42OaeAr+KDkHWI8HDWiY8Ht8EaqXeJKIJ0GhVpsoqYY0EdCjN6sZ8SBeDDRgZDjvhF2w3TwUaAYXjS3jbrMoHUmAF7/gRkcgISf9zi7bBFNgMyPuN7/xcwQPBXzCr/YJuSeodSPhGv0lTVX4P/UUk+TSnBB0Uw1KSNMsy8LBWlyotZc5RUgiFwKDVfesJhQ5OpYS6MzLASHpdvNHzFUpYTXR3oZBtrGUiQuKUe4NC0zBOSHh2VcJc2f7n1B8Jw2BQSi3asvpn2gaFqOeDOvThCxjVe0jZ+nzKHIQGMwdb4z6Yfvs/DwyQOrZoh1hKSOtxp3nT8NscReFQNBluGVjoGPSWlGMLETqRKn9ddx3iiVUJZ2afS0EcEdaHKPKiMBuEjscePV8EMgjSAv6z+SUZbv/VPPxLIYa1XNx7lgWA1/vC9F0Zo/GY9TiyyfEFYpBMDBuoh5y3SYZVgG0SKmON2CobT6gMp5rHm+xzqxIeuuvylfmuJ4toFYhthZOoWCoBkUmB2nwKQP8nP56HXGqdVV0kJQ0dn6IJIARfQLSENixhqPDI+QPW16U2hAtYFCNBRz/uL0chkMgrTCCgVCs+0GNFmMuL7HWd8Bh8HygQwjzDJ+CooCuMOMqwhTHbv1LRpNgLTigQs1ZMtNgIBkGwjpMeWpk18zCFikC5of0yQTT/wGcKyirabXvn9yjzDIRdGIrwL8pYvxzO7NMy/Gh/+vy9X4nl/9/MDKOt69bhnbOxsFEBOQNcLu7UeBIGWlbdIMI2iWfQEQA4nBrjmEA000mSCWgpxLJ6ULoeXozqZ0KXu8I/qwL9TrnKwfL3yOpFwlyCCXFUtl/5lbsuv3353jb657D1kKe8qPoIq5fL0ZBJRWU8hvsgQMq/rDNhKSoFtH5/GI3FcTxOdJcedAUVMF4tw31qGBBXfypOFQA6oQDSUTl/XlOPRO2Angy5QAYQgUd3fkx3Zp/C96aEj991+ck5gXhEVn42ED3/M7dItiGxVr/MN3kqYkQpBkLtZQdta+ayXp3o4riv8u+iSUa1ptgNyyIkeVdtOooL/evgBw68SXvLIGWMOLFnsc0jCyH9kY++8fJjODz6n8nPDvapufPTAetL7gp9Mi5Mg7gCGKwG06J0vUFEDMFX8QAs1LKHK+FBOjaBAf2jcJcWCjSWP1FBObDGkHsNrw6DxuQdKO/qsVCT8OV0RQgtAIw5ZsCyriwyVpmftMzPPH/v+R0WT8zDnwukHjc5z35mtTFEYzLNnWOpTMbGPe3EHHVvplA36SPHCCENk8OsexfJyVMH8YGb0ITzJXSNQaf6gZ6V0itnfrh/yYi02+HEFPaJudM18/vn266kZnPQcvJkUuYrqxmWh1JGWukEYeDpgzLCgps4Tq2Xw6XGA38TGhS1cH6bjcBbHHw4wwajx/ptCi9ICQF1K5DHwMJX9vYThDQAnE9cPqWApZ1UwtIWRcw3/eis8Ueajlde3Lv1BblrNifhg66aQp4qqKsVAemDwZjVq+H0pvlSKs67/XqbOxOVRFXxhUQRq4eMI0is0FaVAosyMgwq8GPi85TWSl9Mj9xIAUXwN2l/8rV3PjgjyMO2wNPq6OOxeUZ/1EjM01qd6vCjz+HGtVFDaiUNtZb6WWWupWYzwy845AAnN3PwTw/EyJbcXfFr3MR/2xhRNJoV/GzoDymCLoNfiVenhz7+5n950m7SXpMS0BZlzDX4T85KeJfW/JEiRtR/jG0VsJtYoLj28Jb0cTGkvjYgIDXBGD/KyLdxorc+R6ONOX7Nidx/KKGUduo++Xxy3hj57Mfu+uJj9hraLSkB7TPPv+P8ML3ugdnN3jcTdT6Tcj6fvujeeR/EovSQSOOqnBuKKm/APQlahpIEgqj7UVi2Nq46x8lzGlT7ggvz3iitpqUsezFXz2x68lU7e/p1r7zy+ENv+fIVu4X2/+inPaZQPbxOAAAAAElFTkSuQmCC"; - var uFt=GDt('<svg width=20 height=20 viewBox="0 0 24 25"fill=none xmlns=http://www.w3.org/2000/svg><path d="M17.5172 12.8844C17.5078 11.286 18.232 10.0813 19.6945 9.19303C18.8766 8.02116 17.6391 7.37662 16.0078 7.2524C14.4633 7.13053 12.7734 8.1524 12.1547 8.1524C11.5008 8.1524 10.0055 7.29459 8.82891 7.29459C6.40078 7.33209 3.82031 9.23053 3.82031 13.093C3.82031 14.2344 4.02891 15.4133 4.44609 16.6274C5.00391 18.2258 7.01484 22.1422 9.1125 22.079C10.2094 22.0532 10.9852 21.3008 12.4125 21.3008C13.7977 21.3008 14.5148 22.079 15.7383 22.079C17.8547 22.0485 19.6734 18.4883 20.2031 16.8852C17.3648 15.5469 17.5172 12.9665 17.5172 12.8844Z"></path><path d="M15.0539 5.74083C16.2422 4.32989 16.1344 3.04552 16.0992 2.5838C15.0492 2.64474 13.8352 3.29865 13.1438 4.10255C12.382 4.96505 11.9344 6.03146 12.0305 7.2338C13.1649 7.32052 14.2008 6.73693 15.0539 5.74083Z">'); - const dFt=Qt(t=>{ - const i=bGt(),s=Qt(()=>t.fill||i.colors.text.primary,"fill"); - return e=uFt(),n=e.firstChild,h=n.nextSibling,GLt(t=>{ - var i=s(),e=s(); - return i!==t.e&&UDt(n,"fill",t.e=i),e!==t.t&&UDt(h,"fill",t.t=e),t} - ,{ - e:void 0,t:void 0} - ),e; - var e,n,h} - ,"AppleIcon"); - var fFt=GDt("<div>"); - const pFt=Qt(t=>{ - let i,s,e="60px",n="60px",h=t.borderRadius; - switch(t.connector.getType()){ - case Mgt.CONNECTOR_TYPE.WS.OKX_APP_WALLET:i=pDt(gFt,{ - src:"data:image/png; - base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAKuSURBVHgB7d3RcdpAFIXhYyfvUIKowHQQUkFEBQwVABXIVAAd4BJIBXIqEOlAHSAqUPYCiZmMsfHo4rNozjdzkzxkPGt+Wxit177D2wZhfhz/TsJ0IZeowmyO8zPMMz5oECYPU2tcpsDhA/giGUBfcFsnwztWESyy7bPCGVlkC23zZP899vvr060svi0zOA1QRL7YNk5uD/wdXr7ikc/3/T78kUJYUgvwAGH5ZpegLfQKl6WyADWE5h5CpQBkCkCmAGQKQKYAZApApgBkX+Gs3+8jyzJ0u81eXM9mM2w2G3hI0xSj0ajRmqqq2q+pLEt4c73Nmud57WG9XrutqSiK2sNqtXK/LR3tJajT6cBL08/Ga9JzAJkCkCkAmQKQKQCZApApAJkCkCkAmQKQKQCZApApAJkCkLkHsI2LttrtdvDm/q2JtiO2WCzQhEWcz+f7fze9l287WLamyWSCJm5mR8xrkiSpPWy32zpEjPJ9RMw7YiEAPNhnkHbE5CwFIFMAMgUgUwAyBSBTADIFIFMAMgUgUwAyBSBTADIFIFMAsmgD2Pkwj+1N28GKeZvU/ZCeHYjz2JJcLpfo9XqNN1PsbdkBvel0iibs7YzHY7eDg6dct9h0SK8lW5I6pCefQgHIFIBMAcgUgEwByBSATAHIFIBMAcgUgEwByBSATAHIdEjvA65xSM99R8wOsnlE+HtIz8NwOGx8SM/YLp03/QIHMj0HkCkAmQKQKQCZApApAJkCkCkAmQVo772D+FUWoISwbCzALwjLbwuwhrD8e+xzXPGnQmleneK0xCDihbZ1EnvgvxwDlHj5/fJyfbbZ8eql/wm39VF0i/OEdzyCv8i2ziMulODwJHFL71zMk+PM5f0ObxuEScM8hOmHifewVVzs7kKJw2ssu9Y/n/uPfwA3U3U3Q3Ht+AAAAABJRU5ErkJggg==",get width(){ - return t.innerWidth||n} - ,get height(){ - return t.innerHeight||e} - } - ); - break; - case Mgt.CONNECTOR_TYPE.WS.OKX_WALLET_APP_WALLET:case Mgt.CONNECTOR_TYPE.INJECT.OKX_INJECT_WALLET:i=pDt(gFt,{ - src:lFt,get width(){ - return t.innerWidth||n} - ,get height(){ - return t.innerHeight||e} - } - ); - break; - case Mgt.CONNECTOR_TYPE.WS.OKX_TG_WALLET:s="#00000000",h="0px",i=pDt(gFt,{ - src:"data:image/png; - base64,iVBORw0KGgoAAAANSUhEUgAAAJEAAAB4CAYAAADykxBpAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAADY+SURBVHgBzX0L0F1Xdd637v+Q9Ov1S5blt/37gTHYYJlgHhNjyyFpGLCReTQdIAnmkTS0zZRHZ8KUTmW3nWSmkzbxtCG84kdahxDa2ISG11Asg4kzTKgFGGwcY8uyQZZtSb/e0v84q/ucvV773Cvpl6xz8Zbuf+89j33W3nutb31r7X3OJZyk8rczN6yrRqprGLSOwevSpkkwpup9RARmtvd20d32HaiPIt1Xv/t+Qr2Ji/OpOSJfon4nr4tyVbovV9sc1bp2U0euv6mjqTefEf7Wx5AKQF5PrMtaK82l3KCiGwZ04XTa+ESqcDodsTkdee/8yMimt9Dd03iBF8LzKLXizI1UG1KXfDBVNYm+vsmDcoRiO9tKJNsQB1BOaRTEBoEZLEOtipNHKlffp5wtBYvXOYFSyF9/bdfduo4Zg+maNiKbQWE4qoXprE2p5ts3jP7NHXiBlhNSoi/O3rB+HvMbUyOvyXVYf3LrO9wG5YIDFKa/8GDxBCwUKYLGNBvBCCoRB7Qlj44Pt/f1yXh0K5CmOYK54ue6ifqrGFSlbnOD8bpNpi1p481vHv3i7XiBleNSorv4hsmRav6PUvturL9L1yGPng1SPMW+eJ/o8fmz1hL/6hmqbNENSZUBnar0uddW3HB9VZiIN1ZPUQwTwjf/bC5PHZQomw+61gxX9aDK2laoeraVlEu56suxdJWckL3yE+njTS8kZFqwEt01d/0NPeDWdMZkA96iFG61rIPZdEzs9lJxMHBwcodzW9eC8jnaA/3cQnlHBigjTYV5O0zKUQhuo7525ddqlIP6OqgYaAMyqKKrMqus7vHQBy4ljkWkbvrPrxaMSfuhV2++PXGmmxNn2oKfc1mQEn1h/rqNXNFNYtF9o9rqALCASrRFUqBvfY7DIpX5PhNS9KD+UEEH1zq7FAumxI5bjhpxEFX1GAZWpPptnsl5WHA6oQ84uG9CG17y/rAdsc1BAnWHpXSB3ZV9Aal3C4+MXPvzVqRjKtHdc9fflkR+d+7IUhHcQkIYEvZFuFdSGz0+xA1y20PJV/tAapP5e1sTtCFtxcnXhV4roROVXrdwJOKQrJ1AqTwaeLlcVneAEt/mltWi+n1dLxzKmUHLc9r5ts/0u948nSzr2reMf2kzfk7lqEp099ybbkudeqMcaR4pBkBustFDlTDsVyNXPidAmYI6brn+xdC78Ij5jPxNOFGb8kjoplrlSpLPKhwNBoeH0VCKNhkNJBTXjddvb2/OIWolF8Ip9QGVKXpdQ8VFBIA4DkRFq36uinREJfrCbHJhhI0QHMhH9zXIEKOwL+faJbccLEFLOZAtrR0uD+LjcR8isOQBkt4W9xbJf+ta2SNRBKfWtcvr+cUCpDJM5tJXFadxq0o6UnuBgDj5Uqo6gffFc6Z5dPSKn4dr6w3amDjQv04Sbszfgi2GDmFrmQyWO6W6UGbFcMvTA0J6To9h+eyeIsa2sB63I5qhU4POl5ctVDGCrWcfylHFWh5Tz/MRifDAMYZq2mrX5Sy1tI8ygjBrNGDuaEBR6kZRhsEHQdvCagj1lfJ2MhlzmaT5+XvqCBpDLn1KdNfBG6aqCjfJV2qILNiUxZUGSniYzMs58axL7iDLJ6uTEcXSY2QwjB2xK1RjoSz1iSB5n1hnJWSY2TmJfG70h81ZuRvRHJNKWLwLTWY9zgdK3aAonLpGC/GbP+p8OCi6ttV7xQ0mC0hQx6THZUVUlOOgjFVtFM15Gr4S2ahU1VSvmt+IIZc+JaLRuT9Kkk3mLqg0ePfByL2snajdzoomqhBeIsb4wZEQCEg3mwu4DxbKgRSrs1BPmRVdatDBrgr+RDl8Z4nupAHBWXiSwdSLdGuBgkXL6lLJRSv2KkW+AmE8kKB4OgquphhWqjWFvoIgb2GEoWOq6oN3zV63HkMshRLdNfPGG5NQN6hAKOIgAW+wuwRSy80khAplCooSkUkMjzV1w6YsBER3WZWjRlkxlGaLBbPL2iqF22KYMVjY7AYSIjhDQ1ijixab/wkX0hSVicORqwgaupszXCExmqg0R+ZFfnlFXvYO8/6W1m3EEEsLiai4uDkxtVH5bN/ZYalxGChDNIPlYkRFlTJeW4fksYsM1qLroCxmtVpDm5CD1XUN4CPix6iwA3NbUrVSFRaFyhzEtEl8j7ZB+kM9rRuLyxRsQxWZOXSB1wOVgAMOafPDsXkbkQI6+WkNyqbv64eJRqZEf81v3JCuPiWCCu6I4pN8C6WqLPqCu6zKO6DoUKvT2CSH6K05ROMpdWzq3nLnkXYgqWqzXjOinVNjzV1xkEfzBjaY4IggJkfz12QjqgxNYINJsL7JVF4DBDM4PzaGDHJacEi5kHExQHMJrq2k1J2lF/0PmcYHHG3+bsSQiikRzdXzYZVZow+5bBKhLcjSmMejTlMMGC3ybjJl4dJpxQC2FK3uwIqLzm2Yhzra3KkI9p2JtkZqQe25HDBVT6jqcmxjUPfm/MpGlhDZnSq4xXASOXHUMXYXx6FfM+QSBe3iwAOj7DD00fO0K1xd2J20HpdeCY3esB5DKI0S3XXwDVPpbcOgpQwBQqVjFe2VhFYOAaCAMD5secDzoLmzgtURlNWtuFEIT0B6XRycQ8Q37lNEAyE5L+6Xa0MdnA4QM8KcnBoK2ogS97FnuDPXo4DQ9RftVa/XPSYF0+qvPfeBe4acktWkp+xTgyqaLtfZgCGURomqkd56H0hxG+RhMUtYTjaRpBaWlUltwTuTi7wHw6Fehz5X5PVk1+ADzZEEm5IwlbPmhZV6pEVRfVpyOpZYcM4y8r7fjSZYudXpcubLucIYH4sk21xc7js9RjGW+/q0JXNLjty/nlggc/fRwPJY0Q0YQunJn2vUI4kM2VLhEZY2RIQrYh+olw+o1QRTrpjGrkP0U6cQrAJ2JOEC+RCtVw/X/VTkcFsMgRkDC3sWyhWKOao4Ahtu1+Rc1klWRDgXNMgj2ylim/dL4IYRrQzOxPUFI+Moe3ntwqVN3cWNl+m0ZE5EfLlIq9EVlF9oeGk2GhUD0Wc1p2uUI14CWp1uR1GnTWyFuCyoJxVvBX8CB2VC+CQ23NTsVUUEQr/PJhs/tQB2N2fIJorDBZFhcHCrpUtqN0RbWAXA8D7NpdKcl4yG/q2PUT7IiMZV9kHUd+qlr/M1QHRbsjtjXJE1RrQYLpZGOBa8+zFGYJsOrLiFTiVNdQ4S3A9UhbKSKSnV6MuHJtdZNdeQmjjT3LzN0ctDrECCQ+e7SxD0y6eK+1WGwtZ2T1pwgdW6laylbEYh31r8rGiTtS0L169+FAW3bewIpFhLUbb4Xdy0rHPvsvQyqXbl0RhSUcmjoNx4Eigl4TCOK9YYb39G6yafoSqUjavyABtadz7HAq7cU5G8Fz1KhS0yaWxjQ8iKLK5KcVqlD46s41kVG67Q/ZFlcHHsYKkH6MU5XNeQjcRuKJxG2g9G4pU7AGYQuR8lAK4yj9L1Vd4nQrRd4Cl0XHpzo/VFghcTacyZtxxM02Myz2PUuPBqLQOSjg3bqI3DimoFzsEhXZWJwjDqNT2TIsMfRM5KkA9gjQJ1lwGCNxTByPUDZZwSJajfZJpD3LfZgQb6kgewqRh4Vlo71pgACwcimHzW5qbWShRQPa32u/ab1gcFNWV6zda6ivkKq9Bx6Y02b5V2ktK2QARzVAQ7rnElzYBaNOBRgXSxjI401YyVBI09MoE5CV+SYZ1h1bCdS0L41WtJl2YZg+YGFa0YavyAA6qpNAzjDMUgg6ttEQLP6m4FrfqouwKPb7AKc9bLFYfMEIPBUew6diW1/iD/3DSp4vg9WmXmUEmWHlai49Kbay6q5DkyHx34bCpcTlc3/yqDeYMukPIEvYKAF6JDivNBuTsp23kemmJKRbM5MvDqIowTZO/H1vekJukpB/UU3tHCT8hdXL6uuI/0sTJl0FuSWGEY3g/eW4J3QKgv7wyKaV3RagUrlIQ2WirSYSdTB+sb5tiXom1cGMQR1vqc5DKKWotG2ENMbS9gnEU9hrgUww4VVhGaYlLQrDgn1PbvmsV3vrgd5F0piiTEiSzVTd77GgrLVQUihABhYuUoLr16NS1dNcpOB+ywYOUKK0LUbEF9ZmdKz4ooTNp2YNdckvuZ3DfwhWvxQNaL5G/aC2IwZAqm6fylK8dp6vJlWHveErMmdkojKFhpFdJXzU6qAKKQEigk8M7XYUHV3tdBGc2yOXFEjwtEZrVzT626rFDAtzSARsWc2yp1pA75N6/6OzzzxEGUpxfv7XKs/U1JSoT/8PUrVbSwdETJtu6yaikovo6HyR/bVjdigNwnpSQFwscfudrvioVxmezcSx1pr64p+qStVAYI9ecKnZeeqJFIAxQJdDbQ5TgQloAEExeZe1MoMjaVXs8+caiTgajLD7+5Uzq96HVLGRfoaIzWnIFi7gAXlTd1JXddb9NHFftyBb92/GbsVC1aXTL5XJ2NidXAPAQMyqXXuDMTSnOkwjCUvoYQtN6gAXoI/RnmZIykkMBXPwE9yYVNN5ST+DIJDwo83WBtY9YoijW3AgtzKga6lhs2z+hIEq5tlI712NKUKy6z9N7P9qE3BFLUs4uaOvQptDbLpjaUaEh2tVjX3JzGRaje+WDk9DRboOe2arjTEkXGg0o+Q+EvikxUd4XdICP1cfONIOm+2g/WvVTQbdteVd37M1Ui5zQaHRTqZMikc/dcOHK1IQbK7zJiR6c1J6HIcg2b2PRCFiIgsI6KfUmJD0aJs4psHRaKEaT2u3zKl7eINW+t8llytsvcdf8evQixzi5IhXeipoxH2QTHW0hN6bR4trXgIjQUtwC9plpzQTjt9q1ov9ZK7mMh6J9o7kJusj5mg0zEJVpZkdhZkzhrS2iXUWhJsiMf7LIkJapJUYncJdNnE062qPLoPJfcUtG6La/w8cOxlHBN6WrY2iCP1oK157ciZNZQP3OQrseg8E/BIMMiHJE5GnaU1esyEHAOyNStFUjRWXzv2ViKeKcUXBsESdcjwD+zzXUzUfecqL92KsJdPtKRFLSKWnA0hPDGc5uGlJLHrswaTZrA3sQFcsG8y/iObfCGRazD7TVUIpJag6bomaLg7q9DUIcCe0Lmt+sS5Sgs3PXBnUI+Kvc1aTY6D1XOxPMQ4LOy2850Ks9dWM5Ms3MivTlSIjXZSp7954gEthKCq+49WqNEYVWfqDgHkhdcW/huiFSJbWhoDw0q9GAKp3ZTJIgxCu3t8dhFcjKIKi6+gaPy+x9C16mJfCWdYKrsymwpEjmmUtQnsv40ThEjS28IydHDKL3MrWUmSbTAqTQQNlmbOC+g19tL0Syobz6zWT3Z6FSNGaHjYgFjEFwNAmLlcWYwv7s2AZYlBcq93RcupYPFxy5LNG42Q9ZUNrPFCKpBJRB0Wno1sS7cVGHPtWyVbdaBQoT77CdsTklBwJGh+xjBu12URVYbGAsVbqqmHr2atl1zW+7CoyF1LDzBZC15DrR/C1lCKpfjTZ5csCgiDEN+SIhvF7XYVnXZE9XO9BSvODwHw32yRmrqTdqTmp0U4TZ6G1DbgqNrs3ZxNAMNoVm9MbVD527kFmklEKEy5yzhv0bBBjRkkbB0dmRDthpNM9xD0CPn7srAClLqAmSDsKbIrE24iwOGUEHpNF3f/ViYvE7GygEhtfQQ8QQC4qGAnlINhxFZ9KhTYFAFZ5nOdx1v5CNzY+LISqBXf6ITu0PgRRLiw92PyaLfA4PInR5MgrmlSO42pF7Z2Ol4GKzkdU3iFOSJJZYnivmTmBvWSgq3gIyinTtiv83K1Vedmqxfj88LyQRcYkhfz5XFFVNmT4DFqKHDYhlrUqcAirGJdbwoDrlxeJvzGiCNkTz/6Myie2LNIW+Vr6rOooWm7RhBl4awR5jG/Tr3ZtTOr5nopsAcFSxEYzZeem58ulwmGkQ8FG6dQ/xWBBY9bhRezFxyFOY6SGOH3JggdUbl8PSKbkrsTEc9ophogIC/3zCQoSosawH8U4iUui1hoRD7o5ZVUmovcclnZME1kGHfFzuCu+d0UnJ0FjorP8Onda+46bwiL1oWktk3KYh5Zc0xwwo1yUlyaYJNhFmx4SvQcmciO5nY6NoFy2WFAefeVD9mkrVE0Ox/TV/rFRQcFIV8wRHgOYvU8qHM4o8WG4wI14ijmexm6Zm518LfSSEg3JGuNQXGgU5LQBOElInu0wyQruWWnmdGcdOTKdgQsrxNcbyTgB2kDDPv58LP5YAGcEcrhEH8GDgu2dd+6L705poJWLmLIwx8TFbVW6sqEP1AwY0GBt+uXEM/oWt3xqX78fCcDZnCEOisLHl7IwfispZu5YYS/axK6s5I6YIYsQYHgutyvLaR7UaHLH/cNwwnIDBUptk1txOWHIBVT7xQ4RSae3a55FUSYg7HIpq+jI/k0K0iq21BXCISpLUDqLWGsLviy2a0n4PMgvZMnoXLewEqH5gRWQYbT3Lv3nHJE7AWEZhDCsogBkCFe0KgfqzhKBEXj1nRJ5YtnRxFV+XU8xajWNjVLFo2G6XoaP0Y5REZoVg9HiKW5gnnpSu7k92u5MZn/RjldIRljrd16TH6xJaiPhKmN4QyqpIEqgAVkiUYMHikwAPLoYMLnd1DzPhOTI7yR/7qMnz5vz9VRHwwHh7fF16WTo7h7R87j/dPz2HL9/fFilVEaZyHyBokWDRftynfnaPHmYwvfd0kPvCpS/ClP3kK/XIfb/GLLl05gmt+/XTY7LwIrM4nLkKjADqlcUv21GJMf6CsVBZ9c6fF3BkkiqKYkmCL9jWAsNtt+joyYCrD1I3VHK68bg1def0aOZ3iUVIMtCmqlVdVDJ5+aHDmd19yP+o7So5QjmWNdKTjXnr1JP79V9bhldefipa7gItGNmUBIyVksazfN11vq1jnJMUIqdRdfTZ1/iidIx+0a5na7rjiQc+4Ih+3jktPL+qhr/wLrY2CSATJMVS2F1vqIreCtZFQki2dzMXx+VUNYE45VNfQNlwvIEbFR1Gg51V+9M3pIAfycGpLsjBk67vZsmWSafb+tK3mdOKYM2uv5wPrFEtOSeRLVUKnrd3RzbHgFsNxLPcYDUeB6hLWvWUxo1m2CDFbZ9p8mLNtgj/DTGsrgd8fEwe/hvFFVRXtENJtIocotsnIeqUhuH12F2kcWK7eF0ZT+OPTd/k52qr6anQG9vIZyMkUbZMbWotnyFgY4lWShNHzRYlb2bLOii/UF1yNkUF+g/Ih0o5hJl+HbC2TpWAhlR85YD4F5jTFcCjaZtPR7BfN3sq0zCK++DC/zhfT54vkz9rASHzJp0kiS6SgSN6RfjzgRpKpDWziVaaRqDCtoDR6BXGYYU24XIiCVx2CGuV78XtQLfDl7Izi4fkOlQaUTrSl8doFMTUjDQaCoqptF1thfpDQoj5Zf6UTFZs40I1OS+UThiJlZeE4K9603IwqHDulsx1hWsUfrSW/KASZxoMrmihnpbRLlVFcJMSoyAIjDgAwHCTyRxBrAq4Fz2w3c4B1PTWbhhg74YA5aBayUXzErjEDRBJlnQ9zbcEDhNiPLRetl3W8p277SeavIFGQPU3COI8jt+acS4E4P/DdqXa5E4gZBrbt9baKnTj3dFojxD5gCs8eUMWUerj7e1W0GLHWZ+dEgVhdCkSZ2NpK2qmaWa3yYneDVNZGBLcIlMtElOdkS2QKqmFI6BoGI5OuUkGhOio5wGRyA8iqTvCJxZY8kEX23hioMwrYoOG9KIIrqpFMo3vhiSlGNL1TZbmIylAY4XDUyB7nELOixuQ4ZK2zuCH14qQyJCfUEAt4V71CQB7ry9ISGdRv5f7wa/j0BEkfdb9ykgl6J2omeqGfwJb+sLw+UPaXuZmwPJGoGOJC4WwFhzEa1s+MwvW7YdmYGRA2Wtvr1MC0mDtjLppEg/y8E0JrF3yfgDwHLPL6DJnaNDjWw+zXRT62WKFtPh88kId0UqJ7asAgLm1R35qVp+iTON8FxWYBKk0UNWF81bcKPXxhyYdyu7/d8Owc0v5Twh/HtMvinEhZCooIgws/DeobZO1IRSkPyh2y8un+KSqY1g11+eoO4EqVlc/JBxVydttRBVnOXooYLVflESkDLRQNxzjCwjJwoPa8ZdRZnW4lfXCqXxJiSrmrWVIs3C/30B7owOFGOk+WxUk/RljIGfwZSiTRl9wVK87J7Cg/MpgBarmsjPSZZcFoKAvmNceFQcgaKvyha8RWxRB35s4f3jMIrk7PyZLmD+HuE91d41Dly220rfKYZb029EnXVeWuC9C7c3K+oDmHtN+jng0Hi3qQBxRRcEJ1V/R66pbJhMsDHN2KKok2uHxXDkNCfKTZ7NcrMJnFtoAWUplVG5E0baZhIFHQ92BIIhLVy2REscrV5UaLBUdJf2EgSsxQrIkjTihQq99SjGdp/1byw5TmCZRaDOFJaXGKmpufyMxrL0meuRowKDgUzdmUSBCsBap+lr/QpZ8Ks8akGcXtOaaA6tYRLTAqoIuHTkuWReVUoVWsVnxlxhhAR9pVn9Qjzj8BWWCEpcFtPVFhXBY6hLaaqmjfKfVg1SWi7N6GgEU9FYbDqj8bbsUcpr4F78oPUA4yBIEA2y9soJiZZi4RLbuMsN3IuNAGvWZwt/la7WUeJ7u0ZtEB4x5ZcZrwnzUgt6GX9dGykM+Wy1Sw2fcgO9uNDXa0E2TtUzXjoEa+2lS5GgLZEqo/hAc6jKpATmpVo+ttVLoLv4e0IZeWAIOn0zI3CE+4Dx3BObrRd019KL7ls9XuGEZF1fMhXK/Z1Javg8J2G0UxvdB3K1L8TXu4eyKXFgWyxjr1OmZ9+S1wcqMNftsiq7kG/gTDP0et7oFI9FSHivxH56DwHQNJkze3sDJrYTWV3BgKndHOKJuKqB8L64LFQOHWFfYHZZLi8N9dUURsDUwzlPYrss22MunM0UAiv5E2xjojGebosGGPOXQYZP9S9K1MnYALZjYEFZKHobNBM5lCMDSLnW+Ws/DRXJiNeDOSFp979rSxJmZP7rpfyMhVcaWgC3OqQNgWojiEJSVZOnAcxI4K+YAN2KdoAIQ2+pFOIpHbpkTAi06iouBAlSUNeuRmBf2VFISZAwDuZVGK2jlfzEUeLaNuwhJm+uO5gi+eTtMBz/5evI5k82PqPTfUcLgV0ou9QW8Gzp3PKIM1dQVFzoV0foSEa3R9Y6Rkoiu29iEYjrIPBER2XImDGONRtn9qBWx/WUE5rJQQRRM7DYxHLhQMkWSkOL+GEJwZsQ7AR9p48uQV2zGKPCQdS65p8EABkgez07VmjtMAkMYGYoE48UqQ3Ar5NJo8qycPVviFna6KwS95cgYeqKnL1eEnNz727RXbFLu2k9yDU5gJiD1uEJNdlBq49muWRtMDioqsdZPz266LcCLAR4ldszl0FOwztd9ZIyYY9bXB5aCMija6g9vQI/kk7Tw/3lBAqSQ5mnXrzuzHiSVqUsly9MASl7H+HomhC0S4MsfvKKyP7EEgylaEUqoxczxd9wecEx6rx+TQpcDEbkvPhQ7ODMGHt+Vwx2uPIy4GtDDR8O4dWdQoqiLXymmGMmxvK4m4E7lS1bXfbyIu9yhNkRl4NiJAITigrGxiNhxisorDRK7dJibzHmrEKIkeF/3Y6pZs/A730pfO56ljnM6lp4JGtqPuizm6C3ZXU5NtzY/oO+WeyS2rAvdr6iRzb8FQ3Spzt4ZztO4A6d6BpqoiW1e39dQ/QKNrqBDcC0uKohhghcQ4DcqB0cXbatk8teGFhxS5v3pFopCDCokRSUWO0h60VnrzQFNF96yo6X3LmPp2l0o7SJiy+GOPCsCSkLMUPCxfIr9rX5f90/O09QcHIjKxKY76NQ5IyOZjHQkUDsglvOSqFfjtT1yIr3z8aZzMUivmL7xpVZJ7jp7bOoMDu+dUBirmiEyYgNHOmBByR3Z7ev3nktetbBZE5xYR1G3GRVXBjXnvSF8Fh+GdKUldvfm0RRc6K/Q/9l61PgXb33DliI5XXbsPb9xnq6ZDawGgTM7lZnz4sv+HLu7KeEkajI996aWiv3kwjOG7gzD2kEeDnLFFjUS7hcDvv/FBPPStPTjZpZb7337pUtWKyHD6ZVFUUp9nKxrzsfXmCb4Iswcvx2O7pvDDZ6aw8+AEntm7FvvmGaPpgJVjmE4ftly8tDd9xanjm1+2euTe9WeMb0q9No3nWcqfqiqoLgcpgRibKLRzWI2o0UGuxRWofn/uicO1AnViEw99a7e7UQ2J9ZlzlqPKKiaOqWUoWgpUgQbvXSiQyg1joeqtyDW6FrSXvaEilM1xiIwT/CL84zOvxme++0Zs3TOByUVJWcapURodp/ptPp23cwaTNMPrvr2/wj3bZtfvPFR9cD55ulffvXPTRy9fcsdbzl9yO06wiDszomp4y9CJUfKOJ+3pxrEVFUXKRxQystUQ1vqyDYVFTzbvq3mZKreofZdK8Jsw4wAQbhvv0iHY1ewrrK+lJRarmbtcxuvwl5v/Gf7XQ5fg3OUjmBgjXLiAH+msax9JtSwZJZy1bKSpeN9Mtf699+xZv/rPtm/8yCuW3vyxK5bdjuMsRqztQh5ayqAUP9lEzC1v7SZM7i6C2nQ5BAOuEeiV3ZHBHAaFQ/4Kfeqdccxoe7eMgi1BMHh/VdljPJv38aQ+3330w/i1Ozfi+09fihevHsXiUcKJPgmnCYHS6/SkUGeuGJm65QcHblv1macf/5vHD954PPXII4gNUnPlWVE4bssXlYDV9hczzSzZEopnloPWTfFQxaK98toSOeigla1FeCKQG0hZUzelmIWHZ5m9fwk6GhNzV+EDn/8EffHh9XjRmtqBnNwMWaJOOGVxD2evHJt659f33PYrf7vjtnTlqYWca0/UV0XSXCxzeetuc1wGnBh9sC7gLLkGm33RUCYBs6TZYTXcqMQQVsIv6q0DJ4NFHmqLETAGrwg/2VJLuNa8UdFX0pZGiKeefhfe8ZcfwllLV2A8jRgXj5M6ua+5qsK5K3r4yZ7qxslPb79n28FjK1KegGX2pQsx1LJUYstKOOSRTHPUdiuxfFv3MwyHhjDnFDAJnrcBosx5l8npiQXdS65tHQrtKOlKXeym+x75CP7wvrfjRaeMYW4I5thcN70WJWU9d3Jk6oxbtz3ww10z6452fG/UTyRqJ9+pXIDllwi+AIhPUIu+wG27Y7dgmV+5ql+vfHOymttQSSIuY45GdvnQyhO/3ZaMeoaV+S1zt2/++MP4woNX4/SlIyfMe55PqZX28rVjk5fe+ew9jxxFkWyhfkYXLtmCzfyQJfhNhUhdALM+NpxlYZUelcMi8vmyjsoAsl/cGdoMU4CnEP5oPB0ZoR6DrldNsis5Fcqf+uwfn/oN3PXg67B6MYVeH/5rJmnvy08bm7zkL569Z9cROJKsJ4qvmHCEKwuT7ZCY0+8KhSCZp2a1PurcJcCu7xLLFgOgAJWyP/A8O53C5E+BZ12WMGkhTDq97X8b/us334rTJkbRIf1Z8GtmPiVH14xPXnzr0/ckg51st6FYgUvWLAV9yfMIAY1zYFScp7fDaDqgsvuPmv3DcQyCizCG38yuNzvkZ6C4goOW/jQUh3YIXFHpALsqDZ221Gi+1kTvDPrA/3kzLlg1Iu6WXxCv+STL4nGa2vC1nRvb7fClIFDlaPEJwRgWn2bLOpj9PEhMpHkPSfU1FkZ9OtdNEdmp50sr9GEMdn1JCGsiEgXWaDapfpaQLfvpVmT48mJV5ju/+16cvXxyaCT6eMrylA3/8qOHPvitbQfXx+2yUJ8zomq0Ai6mWPXdKIXGZGFuzBc9NMplXsKX3HapSFmwYu1AnOAltmkZU2rRJ8EiXYIpDYQ6l67lzgvOJEycmH0DvvajK3DOZNW5Ap9IqXNJF68ZwTu+uqNGo026XZFIVsQ1KmSP1gEHa5QRMN4s5ylnIj+uXERVkt5uilQ/iAhnxCTjb4KaiEskONahf0zJOiymzLnz/+Det+L8VePIOj2cfz3Ud+ISdhzMTz/tHeP4er5t92Faf9tDe9drM3xRGsLdG+QLl7WN4sOaCIxDRxeuisuVLaz/uh4MW18anK0+fljlULkFMRVmnErDnbDqfcfRGSz7n6Y0Zq6iHz+zOrmx4fGgrXvmsf3AHH753DHc+fo1OHOCMMvHPu/clSP4T9/dt1GbMZqnPYjjOiAO7ihbRfYMzf+89pKkB6QzbJlLUCSjIVGvOinsbskSiBTlUznYFFrTFsaKZDypuDu165WBaqtJWb/08NV0zuRop5hdLwrYO8t4es8cfnVqCf78l1bgyrXjIgpw9ZmnYvlnnsKFk2NHrWeOawWcXf/AswfXX3Hqkk26KC1X1PZfRUczImWQnhb6oNEPWZiPvE7N8kzdFhYO7woQAnyVvSVEf24o16Q+mIi6FlvUdAJn0Od+8Atp8NBJqd3Nk3vnMTYC/N4rluNfXroMS8d6UMyTySwcmmdoouZY5ZwVo7jjkUM3pI+bWuuJ2oXRAnQZLI1utFCgRHnNRWlS3XoFmDKz/DqEbyuXfkSCXzaZY+6ItLpub0fKRktUzV7OEyPNraM4WaVuwkxSiq2753Dl6eP45HWn4KozFptTqkv7DuvtB5OiYWET5vW0yGcf2b8hffxgWJxsDgloeSBdmVO3mNVnICy2K8AJxYMPhmLOnBMLApgwqUgVQdEoTHjqWdJh8hQUDS1MKbsvjEeeuZTWJC06GaV2WbsSSZ5OCvG+ly/HTa9ciTWLW6hzhHO3JLRaNLqw8arr23VwfuqBbQen5Omxgh7KLvR32MkSd0FpdADgSyrCs+N84OSsIQxEkUq3wpZxVTJNFhKI1EHJbe0ONMrr3p3J5fkffnoOjVCFE+2qWswaVZ5IXGdlgojff+0q/MbFSzHaowJ1dJT3zlZYNtbrU6bv7ZjB0lFgoYv7FyW9f2z//Hr9WQayRonVthpqRynagOKZHuyLpReTmd0rEsesb1B4R1QOYhGofUeuHWfrwskSr50HBY/uuAAnorD1OfNJMx6fnsUVyWX939efitecNl64rLramurUKxof3zuHdZ/cik9tWIt3XLysr77vPTeDibHRBcuyegnhgR2zU8qJvFEGKWwhWXB0kr5TnkGICUc725N5TZlYeXKgelBZc+4i4xblHnVfgLbCHwRcaJTrkOqMbKuPqmU/sHse3ZR8vYPz8ylMXhihrUvifdhzaB479s3jXZctw7duWJvm2UYGuqxKFOgD9+7EJ761E5982+mNAg2yjod2zdjPTi2kjPYY39s5e154tEzlC9IE/HWfUxydpfetluHWXrHbhRSsuVGiGz56Jh6+b2+rN9AvcNw2aH+r/OI7TwGKlISeqF2Uu6sIHrIZuLOOh6liyY53/sG5uO8vnsNxl2PI/oo3TVqGf0TRE0evruY7TyXeMppGeuOrJvE7ly5PLsUfhhaJsqLPo3tmceXnfoY9Byp8OinQ+1+yrFGsQc+V3ZqQas3ikYXqUJZn+vAq/6kq6M1jsWcdpVijHc3HgAcQNYYllbJlK9fChqREG+L+AdoSraOwlKYK8ehlBihrNLUjKZ+3gyyOI6s1Hst2TNFSwyGqlZR+8Z2rcQztFo6YqwlhM7eVN+YVnK8cXYHG0mg9tmsWF60awxfetBbXnnX0KEvR55/fuwN3PLinkebz15+Gt184cUQF2j2TyPihqlkiu9BSV7NvnlbKc6ylD+J66TANpZZpCcT8h/V471qSJWz1jp67jmYny4Ci744LJU/Ux2SM1Ad52PVG2E3lv95EKmepHEWdzVvNOePzfMhwSGdnSX96WISoLAZUlZfbYZSFM8qUgGajOfpHa1Q+VUwCRy01+nzjLWfgNacvOmqUVU9JjCQd+EmNPp/9KVYnFzefZnK//LYz8MtnLz6iAtXlp8k1Luphwa4stLJWYpp2b1zMvUv/QzlHPkKP0tlnIaYUz25OqYq0nx5P9jkXuZJalgw6h+/xeHb7tRvJdAJYYzRflM82fiaJLl8MsrHhCnN8+BTrGfBnVkYMFnE83tBlVPA127riu9HR1tqq3Ke8gFFbuYgaBapLD/3KU5fGfaWdv5t4z6V3PInzU/b78Z2zuP8dZ+P1tQLhyApUl80pMlsydpQDBpS6lRMpJZCQaHaam2m32Brxb70Ix6YeFuazgI/9DAGZyhlqyFyI12zsVbWwPqDSH9kJC8Zy4lBByuSTkzKG2AK0ErzCVAsXn5qoi9nBT8aSHdrcUSJc2RXSqm5U1ZVc0hye/FAQtCSI9xkrGuXeneGKjjbRUCPEko8/hl9/6Qr8i8tW4Io146E/szRP7ktJxc8+ibE0qC9eM4rN2w7iJ+87H1PLM2M5lpO6f/tBrBhlHM+9+/PNov6JLaPvWbV5y627XgEOwYGpQ8TZ8J11OM35wR50ZVtATlAF1dkmttRWVXeJeAA+6wy86i4C92BZA03UQgOTjBEQIm+1J7eizC2xKmYW2NBS5DdFNL/NGVTrMImD2nvTSLCRiydzkAcrjWKKX5wYGcHcMRZRn7dyHJu2HsTnHtrbQMqrUvb5V86dSJOmI/ifj+zHPVv2N4v5a9EefHYGT/72+ThjYhQL/WGGf9g+mxTw+B6MkabhcPnq0SfkLN6Sum5Kb0Pu2fOCW8MaLbohJ+QWaOiDfg6qtw/lzXKTkWiZGGysQMevuYrRiewTcrX+dCu7u6SFEyJp8NRRAvlBGjuWXKvI3JBX6LXB2m7kSZqihqL3/9bTGfIrb/VputbJ/Z7nF85ZuT25njVHdWyNPElnT1+e71x9cs8M/tsDh5tZ95XjveS+RjCbSNHPEiI98K6zGwUaWaAC1eUnuw5j1eLeApyrl90H5/Di1Ys3K8rd23SPCqy3YukiM0EJ4xqRc+gWjp9VC4RYGW+BWrshfvNZn6ljPiu7gegESerLyqUnAuqHtKifUlaSZXUt1d+qjsDL4oec67DUw+xtD/ekSWrVJlcgbXVd8pY0S1Dy9Q0qSdSOs9Jdee6P+VhIFIu0prl9ulYg3VaXFGRhbUInPg5t2JtO2nl4/rgUqC775ipcde7EZskt8aa6oVWMtgpewcGHefEQ1jPeHCI8QTLSNUWqaKpkOsDxu5Zi0FRRbKBVWSu2c1hoPXmQVbSYNAqQzZZfd2dn1wUii9PwS7JnhXqVbYCtoGzqC3GX6o6wej0+Y+xL1j5Izx7ov2XiRF4XpYB76tbH8aOdh5sLzy2A4mxNkdm4jfzCXnUvnD4xuuX8JbSlUaL05+7Y19qZGKDPER2MAwwgYzYYA2toCJztKcGEB9Sl+CQZZ30qbZjfknE2dlygk4X7hUOSz4JZ0paofKKqek35XvXJFb4bAjWcR+Rz+aORucxz4/fh8GzQ3ufxqhHtRavG8co7t+K933i2SUzO93dpUb69/VCzfvp4rjOT5H3zhcs31ec3SpTIdQrzeZMMQYDiosHwAVaQYkUiuLooCiju+/Y8GEY0bRBbCutooehXWEkhiEqsipCv4VQXpnTeAwUiZXmsma07ZANrRgEqRygeXbAb44AStzLPYy82XPbocbmgo5XZpEgXnDKOryWyvfpPH8Mju2ea7UdSpvt+ejAp0fE9ev+nabL3rRetuKX+bGem2aGbEViJl6gEcGBW0PbjyW7D4chtUTyDMS7YqN+K3wOxOo3zBOUQr2MxmVUvCGCy6gUIpRhBzvymPEsVPz+xW8825YY8xSzUxfEd9p2Kvgqm3bTDcmphX/N7KPVVr7vsr7B192HwSfpXP5NoyVhNxHt42e1b8KFv72iI9iBF+m4K731W8dj/eknis1b0Nv+Ts8c31+ebEv3Wqs2bUj2bgrsKCuGc0XVAYw3b2Awx+5k2YM4fDLNMC/M6nqAlUl9zj5gFSIx4P31UdG6BEoKa+15N9BmNab5XlUsvgMaDoDc/rKstibfBvrPdpOCiy/Xlr0ChqCBr9p4xN/YAXnnuw2mgj4Z0x1/qMPzClFf67MO7seYTP8GWPflXpeqm16+aiD+8c+a46ty2ew7/5erTbtHvBYbVaFRkc2XUteW54RV8P1nirC+nZE6N4YoV3Y9Q6Wi/eg14BKZYg0DMo8zqSJ2fFcf4ILNYmj74RB13ZQlDkVldnt8TRiGQI+haAJhCFQRALsaqcMh9puKyRa4qnqPq+197F56oCXHQspPxqo1leYrkTl02gov/7FH8u/t3NOuk6xzS+7/xNM5c2ltwXXVOaHKct7ztIn8YVp/af2bX5fekjdewPbBSeUtIGhcTi3oQlLyKGyIKnEaHjMknp2QbHAbC9ygdiRSwnWS/qMPs7FqV3nNI2dTzoFJYHtSSN7TJEBe+VtLRs7W4nwJgactEHjaADUUZvUYSfTNnRJ+//z/i0WcvRVelRo16sX59l8ey5N8mxkewYnxhP4tWS7tlxyHced05V/zaxcs2xzqLklJZ70nN2m0mDnYXooMVCIrxHbEwi4RMgWQZhpi6L+qXUWWz4aBAVifgj/uTorkaLtBHFQgI36US9ophI8ulAbG7XEc8aQJb2yxGgyE1s6qZ/nqle3w9W3pAzVkVCLE2ue5vvvZP8LPpHU1UZXh3El+1H1mauNIFKRVwWkKmZeNAtcBz98/O4ZfOX3ZLVCAMUqJ6GiT1xc0RDYx3qCvTryw/0qLHcBgMcw7B0gShWOtllM9ztEPDZKXMplVliM6BC7ky5LZS+TVvI0Rg0JwSsyMPDIYYIUpjP0O+UxnaM7QVunogRKQcfvpdZvtCUsKbbQh+gLfhlrd+FY8/dxgnlx31Fz6OY2tSfuhQteUrN5x9U9++QSd88T8//fcbPnpavWrq1RDfyTGqEQGyeeaO8vWy2WeQ+TQKi9bss41tdEQh4Rv6L0M+ufMQHYxL86m1LFAHVcGq2UbOhSlMuQXyjvzbiNwO5UieY9b8s5X/wXvLQS4aVHuC37R6SbvP6s59YzKO/yghxWp8+/GplJU+vqmILko9uf/j7Ye2/Ox3Lrk2zfT3PTD8iMmB9636/oeS5/lzwJdA5H+snQKF4XyG2b14Lu244Jn8s/2ikNSWB6UCaZ6qNemFfuTJMuW6GOp6NRxXRFFc4Xgy2x5DWmsZO6dSFqXuvHRmLlsfGIYHELDXExGSUPZf0LEMWZec/0lcf9l9mD40C1qAq+nqVSvQw0/vn/7hjS96y6qUncaActQM02+d8v0bU4fcwYYCYYKHFJ+zothl3fTRBkzlm4Y4OtrFcaqgLL1NhdrIKT5pIW82sETwJynpsHgNbHKIWkuFpYKzkXaTKoio7sqgkcu+cRQWc6rcDQeRi7qY7flI9tyAqy+7JeWP/g7P7Z9d8Gz8ySz1isqHtx+YfuA9l1x76drxzUc6bkGifXrHy29KbxsNfgQFYi0a3FgEZMGv7nNtkIGViMiWYDRbJYZzpkIxFgL6IrlY/JKt7fJHnUn7eJN5cGVlNBraz/BYM5xH8AdIWGOD63cmGHtC2pp5E7zfiB576l34w6++EReuXZyy0ei81Fevn5D27O7ZLY994KXXnnEEBIrHL6h86rmX3ZjMYWNq55SpEIUu8AX6+QSx1eysXEmA6KeCkjltgnWo+Csb6FAPW2gfPZV8Z5fEWVDwWnmnfc5aQLD754rr5UPE0WRXS+qxYgnpTOE5dTDQoxiiuLxWHwUpVVCF82x6jdxL5t6ED/31r2Lx+FlYFO4nO9mlvnfxiV0zuPKspXd/85+e956F/GzDcYHkn+5aNzVaVTels94do/DAjm0wIgloDSaML0jGFvBVOdyKpCicDwqWa4qUOzkerxXpR0QqpI6t+awQk1FCFZkK5fI25PpdGxXdIlYW7DleI8oUOzUorAoQFSTWtWLkTP76g7+5+9b7Xz55wZrFhVzPt9Tusr5r9sCh+S13XH/Oh95+0Yq7F3ruCXlaVaaUdXh3mA+gtomTwHf780BB2sk+hk1VREXzwn3nC8Mwwi5DzkKUEOauCjQJzkT3wYMJmGtuOVYTowCvIJl0TZGoRQRcLurS3KjoUnlcKtOpTbeM90b/eGr6/snf+/ttN33nqf3vPmvVIkyM0An9TKcwemzbNweer6Y/8uq1t9z8mjV/TMf5ozEnpERasjLNJ2XCNampUzD7VBsE4pxXm1uUbsEVprxnPp/t7ssgLyBY3yBnriVNjNU0x8EQIVzE+EqRjXdwjCzHVUXr8Guzz6xYTzkW04Bsv/dDqWhS3yaq6JaRkZFN9WoLhFLfB/+Zh6Zv+t+P7L7mmf1zU5NLRrFiUQ8jR2DhdRRVP8ZvZr7CjoQ6nGZjX3Lakk3/6rJVt7zvZZOb6AR/ceh5KVEsn3rm0nU0NrI+JSCvSWYxmfBxCvmRtep+WhdWvtQmreX+I4vt+2Id/rntGNrnHYmF9ynOwIH3z7EuLvaXHqpUxL52E+1Kf3en3ZtT/z2Rdm0aH6A4RyrfeWbfusd2zq6/b9vBa36w4/Dkvlme2nd4fmpWRF0x2pseG6PpC5aPbV532qInXrF26aaLz5nYdP5J+Kmq/w80mJHxU79CJAAAAABJRU5ErkJggg==",get width(){ - return t.width||n} - ,get height(){ - return t.height||e} - ,borderRadius:"0px"} - ); - break; - case Mgt.CONNECTOR_TYPE.KEYLESS.APPLE_WALLET:e="20px",n="20px",i=pDt(dFt,{ - } - ); - break; - case Mgt.CONNECTOR_TYPE.KEYLESS.GOOGLE_WALLET:e="20px",n="20px"; - break; - case Mgt.CONNECTOR_TYPE.INJECT.STANDARD_INJECT_WALLET:t.connector.walletName.includes("Bitget")&&(i=pDt(gFt,{ - src:"data:image/png; - base64,iVBORw0KGgoAAAANSUhEUgAAALUAAAC0CAYAAADSD20MAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAFuWSURBVHgBzb0JuGZXWSb6fvucU6mkMlQmIGpMMc9QARkdCN0qAjIjOJN4r9pqK9Berw/YAqEdnm76arjea/e9dpsgIiAXEBm0r0MSlEHGIMiQxKRCZMpURVKpSuqcs1evvff61nq/b639n1Mh+YuV/LX3XvPwrne/61t77yP4JndPPHx4T7e5eR4k7BF05wxHBEQ/IAii3+Skjz9MVxIDYpzpajiGFCeE7K9xNG06y+djmkYe6IvfFC6jH6eB5u3STSVEby1Pw3Nd4j+95LBcfkofUnrk+tp28HEsx/vD1kHQcFTuWF4X9sX6HYin8Sf7Yh9eF0Su6Pp+39u+f8cV+CZ0gm8y98TDt53Xd91Tuj6cFwdlr4jsljQ6GZwprqSBER2CBOwJdEIARvPcgA4KbsnAzSB15+htHcZSM6BT2SleiVPOA+fBZfRlOAzoUvrg8oIBphiwa9t0IgRqc54csHmxawFD6pAD8fKKmPnlqx0ue8tT1y7DN4H7pgD1E9dviwCW5/QhnN9BdhfQaTcGC8Tk2w2HPLAhs1iLsaXBfNU5TxJiViFm9exewD4BW4EEBXsDhKEBaNDdgsuGS986NxNuzNfeqbTuE5gTpD2rg8r0zC6uriAmHy667Lsv/nPZCsIbjiXAjxmoI4p3H9w4+NJ4+rKuj0BO1ckMyAyZABtYOkABiASW0uMD4+WwICYvw/abacByHpo+1aUBYiMLes/4UgE1t6h35TQArYBHqjdLkjxQbnIaRuf6mjzIxU7ku1Nw7eSsPDj4Wpp0XyLGO+w+dOGSbmM1AnwE+9Lc0kH9HQMri7wkSorzSwW6wnygI2thMFNLU4pogoldLbAzYw/XLZYewjanCF6TM4ihdWiFO+lR0jhga309W7r8i9yY19lonHuGH9oTMiOHPAHH/CvQTxkEaqPHbwWabgG+h4BOLpGVlQvf8qTlgHtpoH5iOLxnfXP94nh6njItV0BCZ4GsEcLU/dJgIDHpMbFQvhbH9lKAOLjeglzzbrJ0xb6odTkBNMsRAzrJeYVGmixbKkCnmvGkN8waitRRn972SwY0Tz5Q3orahiRpgpnjSx0ndDMsL3IJlgDuexzUg8y4tT/46tijLyudIpaRkdhRByawf+ppA2KZZfbC6lIvClEztqYtLO3iBlKbleUDBdSpXUgWlpxHT+OfwBdMGlR3handyNaLvLjkOlDZGaPeouGvCeDFuQlDcY0n11mDtGFdicoTIefXwciV2C+X9N09B+57FNSP2bj1/Njy340t3Q2WBqSJTUUU2Iatg73Vax40wIatZ44lfxjGFrcoqydNKMAMMsPO9q4QQoCXHhmYobSfAW3Ym4FHbF/iiOkLE6dqCyrLhvfLYAxT1l2Y2ponOeq4eg5/7gDMYfk4TgLZF9Bf+CdP2nEJ7mZ3j4B6b2RnCQffGVt/XgGjlQa+ArQUslYLEFOn045SMiiZ5cXdSq2/mzhukZinXN8on/V29hcH0GAZPaTWVwxdJplnaANWM4HonCY2p6VQuwhtXaOeGDXl2DCdADmWuDCNKygL8VaO3SC35ZKVzZULL7kbWftuB/XecNt5UT9eHMGwxxSQgT35dKFVmWJjLkB0DB+CmwCOeXNZMAxvgJ3KmJUiPQ2r0bIB4EkRbF6l3GCvx3wsO5dzsRMAMPKkJVX0XBy4TV/2BWCs1ykFSSKXNtj+NWFYwNQMYLFxTFyBmQhxjPd1nVxwyePuHjNgh7vRPSbc9urYSZciAZrdOGtRLBLe2kTthEVDCZ3UiaCaDy6v8bYJ6lipChhHi1nErODTjBsx1FH+IjQ7gqVIzY9/nc0/N4XPzc6Qae7Y3iHPceGVzrN+lVK3Mf1QZ9OG0v6k6qbbfvLPjNrRbyxDTBsChQsdhdoodGR2VqDztaZNIzrsWA50vSf+e+n5H19/Ne4GJ7ib3N5w68Wx985vzWw+r8IJv4aBh3+ICcX7Z+ZHlhQdpwEqCZL9zcJIisUDAZgz5wWuayAGF2eqY0YOuYym+c3lD9LaLXbWO0eArV+VLwBxujtoWeLSpHSZuUuNbTzPM6jB48HMcexxIIAwItxMwul40SXnrr0c34D7hkE96GeEg5fGiu7N29XmNkedBNtZHnw+bpYrwWngDIRQSCU0Nm5QAzvnYRaZYuzBLXOeBXkKZGBXaSSXY5za0/syYbXLzO4krPSo8mrtVJo6artL3+XJ4PKowMmmRLSBnHW/1MA1cVPhwsTSubF2d5jorghYfeol547PnBy1+4ZAvTfanhE23jkA2mToQJr9q3Dr10Go43lhmZaGFbADsbDMgzjYcgenW+zK8AyqYs6jvAy4SkZ58ejiGb2cy5rq3NwmpztE4HpoOQsArfUK/SLQCtWrRDEgDW1AiJ8og98oA93+wehfMvaToQSJlYbqb+3bV6xh9Xn/9dyjX0DeZVBPDH37J5EXhMFmG9oz2DCtCy9sG2x4kDKzeUBCMCzvJ0mLsds7kRZ8nuXMhNC7w8yOneaRy6BFZ8iACpjdsHGgM1vtlHddTsmqBcIWmP0WuZ8QLFX8eDHrz44ziM01n670R47T+QmDSZ4A+3b1a+dedJSMfZdAPQIat18aR2mvZhJA+lEzbzEy0AQ8A9uwdPpXmLkMC4fMiHVebhI4/8KWbkIYiwfboIMpv8iDVEsDdFgQ9Trtw7ZYd/y3sXHTSiczUqS6G1D7AjwIxUgXA1q64H4KdOQ1sZA0sWlkHsj6Swuj8VzG7r/ihBPXnnrRfbcP7Ltk/Qg4ePEoOfjWQf/ms7kpMzuVBNVK0iQJNXhjy6Wbzy6v/CmNrtwzHj2ldeZ2gMpCwbfOloUDpdx83YXxbiZopJFyLnl3LlkGOF5HCO1KPoHOjaVCSh2F8jaWDOqbMX6HbG3xLOGHjapt/ajP9TpbVToL6NFrLHdq79DuseopcTzfe+fBIxfjKNxRg/pRg9kOeO5wTiTlxUc5bwBYGvGm62DSGFaQRgbsupkyKBNpUQPcAGpw524njfhCZfN5vibQiwkTY0bjwZ7KBoE02EnrwC0zkwJcvotTobATN6GQ+0toApjJQeetH5v+OpFi7htLCClemrgSbBdrOvXr5Lm/8Nkjv4ttOsFRuEeFgy+NwLuoAmNoZyqNOHzbkkYYZv35gSSpZEWVJtR5NfMlTZ0nldldE/vMB1x7/Q5j49kMUBgozKfLZVYWE9vj5jFYrUO6Hre4Qf3ctL7YOo53u2pHkfJojY/zq8LTUTJDTRXriLAygAHPG8zUKf4wMTZf/nsP23kRtnDbBvVo6cDGJ2O9dstcBjPgzOeNcAMALAK2mHw8uGcnSagHo/JPoOnGlUEBe8lP7K0okE0bPDmonU7B1IvCdtiiXUI/KepHAehJPT+hxna6/PyagOOm8jxAFoFYz5vjiwmoyTxtwqv4nQd4ZvoDXVg996KHLraIbF9+hPW4MLSArpy0Z4k0wnPn+zizid0s1utWmY2e9wxg0nTpJQROmm/T005m8LMm3UtNfG4c61WB2QmswsSG5Xy8VKB0HeejeXQTVY+LdrHpM1i60n4Th2RTbgbJiEpuiGlWPmf/LF8Gxu3KNTdb/ToqJ8uOGBi3z1UdDX67pdt458uuDbuxwG0L1Hujjo6HPaONI9ulQgs7C9BJgziTTtAOk9mZEgqwG+DljqscD/Z4nwumN9RfGAA84osWji0wYxq00AAzaLBzRmnBluvq0BMMmEt4gIKjUDVr4txXBshhvEtJ0i9eRwONsRECoQe75iul3fko9eSo8hyPYsZwevhp3Incu7q+eDtdsIUbZUe/fq0ZjJxY2pn5W75Npnhsx2n4d3rVWLshmwCn8A5Os1Ma1ptjHmGmHgkPk6lKynPN6hdYa4rJi9thzGNOduSdRciM7hV3TfnmshvXVDa4XfyQFmz7TbwcvzFmsK+V6Q1Lw7WtHR2ZrDwvsOXFPnIihowGMI/5CcULOPd1D2q/zb4Npo6yoyuA9osG2+h2GPtzIzgus6ppLKRYwMXlMfppaFC7ph0cKieIrYvJzFVU8wl59EIeIMOSkhhO2a8xgrksJyWCotTdJZAsA7mzSTbkX+M6EJsLS5MxD33egkyLmk/X6AYnOZTRdSaM/a6WCyl9lBd41HYeW84XFDeHJxPtFB4SO093gyxDpnxmrSELQb033Hp+POxJC2SkIZid4XPnLdwQyeXwYGLonIVhAQNSipqBncCt4Qa8abBNCa4OrngzMGbgtNw0UEJlGyD7iZOBH+h2KyWs83kn0Gh+LAncRJJGHgxwMyE61zavmTlfoTgCKzWk1JV/2c9Jjc5Xg4A9mP46UVt1SPbrkm6si4JbcN4rrz5yPhquhbfsHh1uvTZG2MORg2FqsZpITxbIjybo6TatUiORoIlr8gg1VoIp15r9OlPm8KKvWjpCZUXgupjtb7IyAO126rb2lC6Y9wIn/5DTatvzE+IzEgbUJu8HV/emxYKlkJJtev602acqK8qNopQhpV5eepTetWM7Hjs7hm7eFT+dDMlfTYDeFJgmz74dWDv3NW63cZapB5aOnbgHmTFLrqXTgqfXXHDLaX+I+4GISoG2KC3Q6lDUBn7Kl4rBOPJp94rbpOnHV5pAdwaxZTIL2f4AmIU1Xk6bWN4wWlfnazqHqQ18q0dV9/GSmRq2XSVc8i3dSA+tc1eOXB+hOwTvWLLk6JxftmxQczquVzoqK6vEUBbPYSjSQ6VI/H9P32+8DM7N4S+C+uC1oIf9Gch5xmOCO+GdFlCwLGD7rRlubc6SF2UL04VF/mLyHVzn4zTuBqVt5TxsrGPnSSdjp0hhcU7j8g9A87kT4wJmnY8/9MNtt96JzUObGV2Z5bkcv4lCd4TJL+XcXAiWc5aYHeo81eY85S0lXTrJ/Sz12PFvyGLFh3U1kyu41a9LBQ2269ees3YqfB29Syx9cStsqgiZ84K1gXg5MrtbOHd0ne/B44GsaVqgL/HESAu4vNCYODn9AJyNDew++WR87MLX4gu//dtY3XUCx8ppQuva3cq3cnw3yi5S05H9t+Bfvff9uNd3PQkbtx0pkXM7xUoVt3OYJ6h/PzS0J1/VT/1M/6GMlV7PSgu4cUSRHF5eGDYXl06S/tY8JFzwqm8vL/CuouFiJV+KBU78hdd4QgMrmHtGqcpPK+y31BnYo38KkEYdfF6KrHFXqgXe1GnjqdezA042N3BqBPTHf+u38LnXvBqyuoojt9yCZbmhvGFSff/lH8JZj388br/lUGSyFYDvQrnC2g4h/YSsEs0ilttKgAIs2LNfNwfodFTm7+qwzh2bwCY/L1c0rEso76jeE+DlJfHqErhys4uyY2+8wX4SM64kmJY3ihsz28XGL2AZqtO3OwWeVaTJDPrTMqt8WuDmeP7OsiB9v76B006MgI7s/JlXvjIDbCluNG1FG8DmJp79j5/DKQ98EA4fODz5hUGOTDU2fU8LPSO/1I/jQmzfNPqtNUb6nLWOqyJAKE8PWK2pHUMblxeSDOiE43SkNOmEpNFTf/3s6cXdiqljpJfOEavMXOVZM9UdVUe4hm2d9zQrQ2h18iR+9LZVyQrHutlP89JdNncbNsydJMepEdAfiwz9T7/2a+gioPtjAOjnfeFanHD22bjj1jsig61ocG77uBEkVH+9U+pgqLxKgCjjFMA2z0xEofShef4FBXz5esxL+xPTIjaQlAighXsBqsmP4hgwk5/qZ7Z+8iJzShOGJ0cvAxrWj1jGefAFAxW7CRoLCC1EmSIUv9yChquBO9WEdZb66TURTrZYaAYCd051yGVIMB3O8maUHLsiQ/+H1x5TQL/o+q9EQH8b7rztzrTkx7jBEhxKvA3a25jZpGAmL21yKPqlC5Y93U/7W6p6U3mogclja1g6VU2tJLrlbi0fkq+R/abjyng9YuUlWhUD6u8YvtmB4ePmbRDbilkp3Yo//usWIX7m+rKqvB2w5+ph8qEMk+YynVjkUciDlCXoxiZ2n3AyPjoA+lWvRre2dkwA/eLrvoTV08/AkduPoFvprAlTJyh1AvdtPk9A1nSjU3BThwlNhmx6zDuaugMZclwTf+YHAmaeCOOvPFvNDzl1oF/H4ULPZZNZL4F5JL+pgbtf95X18wAH6lj1l7QAhgV+2jeG6VKIQAHV1setfIX6PpcldbkcvzXpOp48aZS5rpkJQFvGA0OfcBI+FgH92QhoGQC9vo6luAToQRa8eN+/YPXMe2H90JHJT4HROUAruKjxhqWR+l+BzACXAijx6ehoGVq/0wGzo9gag8zUAmO7Nj8Q69KEKCwv9q6QgLyCkABdbONjPmGUIB7URXo0+30b14K6oZbT0QS3zIRxnjpFtOI+rjep2fyKQO9cZcawAdDHn4xP/M7rMqDDkgAtCui+x49c/2Ws3utMrB8ugOb22OdOaNKrP5CZ1AN5/DmmzgBH2QBpyQy+wzHIQGkY6IHrlIEtFcA1vakjppHOceNE6rryHAjEgVmm5kYp8hxTv+FTu0ewca3x9J0/c90+pn/p87oQy8ABHvwwT9Lx6j3nHWrQztYjoXz69AK93+gWoCFKjlN2nozPv/lN+MiP/vhSrRySRldWVvCjN9yEcNxOrN+5ASE6KNvupe5syTOLYpXHsC8TZ2tRKB6eFPyGTEd5ln52Fg5d6IW26a6c27t1B9TM3tVkxXkmmVGeGeFwnXFh9b7Z+rGO9b3SgHML4NI4L2wpJow3HoSo1IKxgFe/ugmXr2GHwOXN16/UxL2wSwkHQJ8cAf2Ft775mAL6J2+9DXfGxvdHNqCfESjmtjAOGuFxao9bTIh+1kBoDBLIFRC57zUKWzi6xqQPJjs3bsggU0+/A2yAj/rXuXw8oD3gAQYyDKsPbrXbPI9MenIenNMCAjDLhuVcTLySMlXYsYnuD2g8Y1MVVDboUQfrdQpnP43Xqmdd1ymPzNB/8kf4yI+9ZOmSYwR0LPP8r9+KwxG4g118AHTwOmqoa/rGiWpN4xJox0dPk2kk3/EIyBpXj6NfR2G6CymleGZWLjkDKw16x6bE4MZFZOEGTC6Hge/q0JE/g1o/XJbL68PeDGoZHsqDB6XNGI1wWXDeAlTuaJNG6vxTZN+JHM6sgFZ5Cfw+zugGK8dxJ+Ozb3oDPvrj5x8TQK/u2oXz4+7koViXsL6ZGTpbYgCzUCjADCUfiibpH3EEIymJYr6ZP6bFmvpJzrQeI7+IN8dgAdmRET3LGGmwtaBiaS2Lw+05AVoU5Hg0b77snQM0n7dYG2gB2H2QRpwOJHS2QJlJJ9QThNl2q+cWMutTXiNDR0B/7o8vwUd/4oJjA+gTT8T5N9+M26PU6Tf6zNBaZzpMLlj/Cb/TSsGQRJgiG0anDRHD4Ej+Tpfn/YGcRjL4O4HR2P7HbNuli+m8DWagJi7W22ySzLoaYsEtJt2E471h/+5VrO6Hc2amowaxPWdwhuzfAqxu4bKcgGtYOZ+0iszmV5ZUOSw0ykz59QOgd0TJ8aY/wj/8+CA5ooZeX66GXt01APpG3L7ZI/R9aUmAeV6dNXS1IITUH5DUeBrHhLltcfhF+Vza+a3v/Avt8GHcKqCmSeFBrnGqBSHqSTBMFn7O2k+skanXsLYn0H1I3HGrc8/Q3jXj59ECMXfxrG5xoa6X0eHp37xoCXV7BobePQD6rW+aAL26fECvnHA8Lrj5JtzeR8mR/hxXts1I6gf3hB1J5dS01GKNnxaDQok8Aeg3AEOKpOcjwIi981gJAdaRhIgDsgNWySK0F4ji6yf58dMKxIImSzPo9VzzHkEdu3T+Wx4L/G0jQsWKc278YiZ3lBuIGrx2gDETx5fBzIPNxNB/+mZ8+IePjZVj9fjj8VP7D0SG3kx/QiOkvrDmrumvWyW08guz3E/MwprYsTmDTaXc2H/8V8xEyqK98ayHTrQKsB7Ybv3jwStoMDzqO7OmazE0RCp//2bM4Fc90CRHcd06942vQSh5R2+8VpaRNLNN/GAlirv9tsozfmPHy6Shd5yEq//8Hfjwi3/0mEiOlZ078b/e+nUcjBNpAPRoO5f0gJLGrSw6Yld1CmRuNP9ZD+oIzhOwrKfh+spZTpMiCZcVQgVESaNYPTUXSA4EO/YtQOsI+jC/MGSGtpYPWMbGDKjZzQGYr30cmTnXzqryIXC3J0ZKTffGmeeimmWiHwB9Iv753e/C3z/nBcdGQ59wAn7661+Pi8L1qKFDXpxxxQ3YUADuw0fHd6CuMKVdgJMUG1yPag1j5EZfiGQcK7ETIf/MRAi0mTO0qzMgb4GYgat1XBRnCp+wMwI5UL0bgB7ijKBexfSUswecOmnobQBtkDbTiwkTtCeAB7Ng5tlngXlZV1y4zuxBcpy0OgD6z/B3z37eMdHQg5XjZ2+5GbdtHJmU8/hMLQpQ+e4jINPc0I5QFokpAS/sspkOqCwgvk+EzHUhNMYgWxmk3D0pjxxXfD+jWFoS6DSM5YlnbaOPYcGZ44vWiMI7n4ezfggxdRuM9qw0cjjrm4ADVbLl7yeC7dx58Hu/IGi+xpXDI6BPjoC++t3vjIB+/jEz2/3ssCgcNHSiDUl0yhssCtDBlUVhsiDRrBW3GMzmOB8v1wPVa1gMymzmdAtBA1yXhwd0fnBM7AKO81sEaB/HWEBQgOrzE1dWliPRc+Z1rq3Oe8eoHBaM+C+ACzkuVzDn4EFKA4ZGGt9xZvJEU9kA6Gve+64J0CNDLxnQUXL8m5tuxMEof3q6D6ZmGdllLA+sOcikwaAFgdAD2W9+sDzJdzdxAM7XUv6CAKiPO6BFHJVVhPxYF2scXiv48ePyjOkO9o7QAnwB+tTLFVPnTgfgw4D6C/8+rZcaWey59Bqjo/i+E6przIfnHEeGPgnX/OV7cPkPPveYWTl+bv8to9luQIk+bJOlhdMcDEhwm/jtHLFxQNkwuM0d0oVn8Gg5AdVojQAODtgzUoQnQ2u3sPUlgEoDU7g10bkFpJS47QVo0d1ZU2+iuBrQwfj7cL6u4wnKJ3LLaJSKhRSn1scGxKENao47SI5TVk7CP/+P9+Cypz/rGAF6J37h1gORoaOVo+srcGWWDCqh0q7gGFa+vqooFNLAJRPOKxTNXZJZkgoO2CnfiaWlMscBbowpTwlwWlmqOCwPGIQdxc+ADhawHNaaAGhc686l+i2QH6EB7tynFfgw46c52duN54dS0Vb6zAABKXWoQD88y3FKZOir3/cuXP7MY8PQKxHQ//a2W3Fwc33U0DpRCamUhgFWSIMXguqZzwnMg+vyNvlk89bJoROpkhGAMQu2JoIfz+bGixT9yovKDvO44HFvSQqeEJ22w02Uwa3ATxT+VIIDdWa71HseqKBwZtngAFo3xnCPa6RWDLPhJm5iJtZtIwhGK8dJo5XjcrVyLBXQwI5TTsEv3HRDXBROgM6LsNQDvVD7gpN4ehJ8b1J4KMdsyJDpLtj8Q065fFizqagMKgCr+l1oAhDotGw/Js08QDInpc2TwTB9DWiz9S0LZApai83AoA6mUt5tB4DZPyh7SJVnaxHZKqNiLFgQZD04aOgoOa56zzsioI+BHTq6nWeciV/62lexf+POAmiI0cGm3wjghsEVcSZAyoHYtwBD6i+9EhuPR8PwQgCgopNfmNHh5bHXUm6loylOl9gvf9BVpDwMJXOAhvnEWAtrdrEZSM6EPAGK/AiLweyPBlitOPp9DQmm8TowrZUz59FRHP+Wg+Y1PN22e2Do90SGftYLlm+2i+64M87AL331KxHQd6D8Na2yK6fyQ9xD0qkrMnDy+pFAOwVQupSpsPkk1IPPup0DugREUPLc99TXes1jUwGawxy4y2IP5vMG5TqdU5mZpWHrlUEvnrFDui5krM+PNO3U2smt2ZzPHaA7ilFAat848R3FE6MCdrDp/GepwgjouLHyF+/G3z7recfAbBcBfeppeOkNX8XXI0N3XfowOPVKJt7AhFyQm8GMxJLUxhxLscu6m0HLgxBsH9ptc7FMDzuGhm1Rg74A2G6NdyRRtB181HNzTQtXvyg06WmSqPnOLxwz6MnfLBRrkNZhraOQTwXo4OOR3wyg5/xyKZvTonAw2/3tM559TBaFx526Gy+PdugDxNDSip/+YdLNjAortTiNMOLddQFigDf7jXmGekxyHoDZxMl9GyzDmnQkdRj8DDygBtx0Xu8a5uvAgJVyt+gKUAWNSQGLB58/mfSmXvOdy8far7FAgQVhqxJCDQ5od4qPm/OLgN4dNfTVkaH/5hgC+pdvujkC+jDMH/D0dSUXxL+P0pjkrYzCTMa6qBTL/K1xyWHpjuHvelkSAu0NlTQDsgkOWGiP9oBmfy9NulRbQUtitK+1/C7ALCo1zFk/fC/WAC3+9XMZ069t6fDnKylm9RnXRvx8nezQV0UNnSXHxpIXhaefhl+54UbcEgE9feXfY628TpXTQpmRYroIwfnlkSCWVz/RCJTGjIXQGJAFBjPAZcYe25Oe/CvkQpOG8hCqrGH3UC/0OplhaMCA16Tx6Xwaad8djnqbvDABM07YEszsx/ZK69/F//oq/RBveGNlWBReGa0cfzssCpcM6KF1J3372Xj5vn1xUaiAlmrC69dVQysf0KsYibkZzKzBPZlkaaHXQTLo9SCcF6Ur37tL9wpOExrj0zH45xeFXqZkgAngN1laYGSznALdgLwxEQA7CXhxWoGaJUJT45kr728Ht6MhrfQZio70lYQzK+b6bE5Wjqve884J0Eu2cgy1OvVBD8Qvf/4LuGHU0AC/9DrXbz7c95Ne68NZuU8yTc/lg8yOwU8AcWNnGDXt5JLm5jsNh0lqewvMY9xgAQjKo6OJMMfIyH7BgFOgsiXQhJDcXmPvbuQ5xF3lxqdmwm++BJThYH+gBmBm4txZwTS8HV/PQ+6YXEY/PJy0C9f+1V/gb551DB5Oiu7UBzwA/y4C+saNQ5CVMoQewLxD1wVrafbn3m/4J3jNEtrpQXl4+QPPvC4fAMTUPM5SvaBsflKDew7QHvBz8qGFiw4F6Lmy1CbL8p7RpSwUgRqUZdu1GLgNA6C9ucIzW31WUP48sgK9c2mrzhsCI6BPWtmFf/n79+P///5nHBMNfcr974dfufJK3LB5OH/rjtl1nLxsi0vOb4jkoOD7kQBLFywTwkwePEFy8cJ9X/L1i9G6bml9ENjCEWpcCKoFvQFYunUwoCsApxdyjc06p2d/F8/1XQvgg8vWj6pzCLJ+ELgzWgPH5yw1xBUurXyULfphp/BEXP/B9+O9333eMQL0ffGrV10dJcchdCsJGb0zm5U/uJhB3pIhQietN8Y5oubPcUw+Yu3boxcvMqXtx32sdxPON08K1OOi8tC8BAC7O2ksG6glQgY3TYwV9kcpcPgsA3/ks3PpeAIYbY4ZpgYslHk222sbLq4RrfO5ScFxBw19StxYue79l+J9T/nXx2RReOoD7odXXnk1vpoAPQEY1WfRkPwNizqGBdBkZA5nSSIuQYdaflREI6gXmILmnSEzscDITiYfoULMIk14TFWjS8WYPL5e8/p4TYkidjJ4UlSQK/Fy+MTUES+bne8wVtIlcQuEwDxYBTqjWS+LYwBK0w+A3oXrLv9bvO+8713uonD80xMBp8VF4Sujhh4APfip9vSsWi/7alffAW2Yv2YAMyhDI+8WsM3kSn6ar8bzY6NuxUkUtmaYaz2GCaSDh/FzmtqDkc9bmtpvl3cL0mZJRGUWpu7nWYAH1IOXz/0bEl0jH/FPlIkF9EkR0F+87G/wvqd+33IXhQOgY/lnPPzheMVnPjMCeqXrDJUKU6CyXKq82nZbJjplec0rLJAWDMAxrsxPipwuNMKJhVtyb7oWbUquXwagA6bmw+n15QfDzFLKru7WpNc7zIFVakaGn0hI2p7Kp3yN/OjQZhbfGcBMR/VwD74U5x+C8R03AnptF66//FK8NwJ6mX+SYpQcsfx7PfpReMUVn8JXBkCvFMNklhtp9Sb+9oRpQue+6wu4zcSuJEf6VIJeM8DqIpqgrhgaJQ+WORZgUucpVlaZl1lDCwvSBL0eeXHHjCouHJwGdoL4a0npOiKYrlF+pakb41U1CFUDy7UWyBrQvLdm0kpeYe9aOwFf+tAH8O7z/vVyAZ0Y+sxHPgKvJECXOiJXWkLNpCYvLNa+oPxCtiwkmSe17ADsgtCzepkcDUKiPMqYSrNeHWXqn8dR9jXACVIt/HJeoQZ3Wza0GFty3eaZHPkFhwrwKR59IsEOhJ/drSNQd8DoQj3DADR1XZeqd8dNN+JdT/7u8VvNSwf0Ix6Bf/+Pn8ZX1uOicLVr37ESS7cmvWVfyh/1AlAZXB/gGftZ0LaChDaYffnNMQDKBlGwoJ8jJ8ABlNLma4j9YA0zOmAnQKA0WMzEmobfbPHYKX7zgDbyowtlanv2BeYZ3JiKGoVwejtRyu3r1NXj8JYfevGY2fCe4TJcAfTD8epPfxpfXp8YWnLtkJlUtWeuOSFQfMbJQlJu+2WBbP5QKtFraOUDmK++zrYjp+WpQ+FufBSoEHvHyf5w/lKApGEZ7ARo/VxDzeAyLkA9bpiBNf8WdhjgPq0PU//q0VNbeLGA6M/ffvM7ap2f0TWDZG2VOkU7fL3fwA0f/vCkbc222j3nhnLuHTX0a6Lk+JcR0O4TYMSP/mF7rb8eBEVODB993LGyM/8Ncw+1IPV1s35apJS76PDzd1R2w5Q82A8fzbGfJsrAVub0bIxCUNnPALz+aLqXFZWfWkZQ2JuBbyWFVGBtAZ/jAg2WTpgiptZolqE80P2syY3iD56IA3TKO6eT4j8Aef3Q7eiPrKfP2i7HDeX/ZgT0viOHsbJaAK1tz/F4jiV2UmANQUPKQOaM47rj8KV//AQ+9t8uxhnRNDhJKbGdGGD/FuJdaba485jHHbfsx9Ne+UpsDGuSbv6DnQYMDuD28dT6TRS7+eJAxX4ijsxSHEFzG30Rk5c4YsKr9hHu8Nz1284LfXepBzCAalYIalCzX9c82p0n3wEnrqzh/zz5FGzeccfSgD3IjxPOOB2v+9oNccfwzmLRGAOTZGjeNMSY6qYo5UGhPv5zWnc8LvqB78NV/+OvsWy3Y9cu/O6B/bg11mOzC80xYsauJIie0y3EA8zr7HrMF399yU4Qq7dbYFaGbuYxEx9xao+NkPRTA7r+fUh7LeY3bmcmTm8d+Ss74grW67WVVZz9fd+7NOmh7tCNN+FXz7oPzoqavuvLO28rwTKSdioP1iodV7XDh1tfRPz+Iwfxqr/8Kzzihc+f/FdWsBQXy944fBgvO+lknBYv13qZf6RT2mDTdkJKvIqwpA3AnD4lENTjbushsb9g/nyc/lbcNQTVSwQG9BRvLP6Fhw+f10u4tMzqovqEr8M8Y5tfsifpTqJqKt85nMcJmwG/c+JJI4Mu0/oxmBhOvM998Dtf/jK+tn44Wl/svUrvNDkNYN4lZPbjqBuxDXui3f23X/gCfObt7xiB3S9jETxYaOJvZccafv+2W/H16LW5EhrmPT9+MuMPo1l9Hp2JIzPMXTP03PPWTcBS3FYaMedFMhlmZrY21y6j1gzURxi7nGZY/ZY7QD7v0w+YnuKL2+G/cO01I6AHO/UynEqdg1/9Kl7x4AfinLXjx+/waZtWocyF6rfK19w36XxHbMP167fj1/+/t+Ohz3jGCOilMPbwV77ibzOuUX4+SrrTh7r00/PJzIp58ZbvqnUbGSxjzaXNvMq6HYcz07o0Pkzrs2LqpekKoH258Pm6SdUEafOW4X+Bw6QdrhMkA57yHsHdRWZbx65v/Va89IvXLRfYYVoy33Tl1fjlhz40susJkAxsuypXG+pKoOtg27tC52uxDV+Mmzmvfu97cf/v+e7lA/vOI/iZk07BSes9jgvduNGl7VrFxOhzQOaJq+0erxsSALxd3gAmA1slCijMTx4FOSCzmPS/MS5NlEkf9u1fx79Q+40FjedSxw2uIqGeLMXY3uHInes48axvwb+77rqlM/YgRW74/Ofxsgc/CPclYK/M1Fcnpw8HHMgjiP8lAvs/Xv5+3P8p3zMBO/9tt3uyUcrYR/Bvdu/GrtieHWElP8tcGLYGDICKqc0xgWdVpQ4wS4Ydp8H0bqpna3E/r6n1eZICdjjJgYaJcaNded9ACY0KJ4nBBWTdFCZW48XmSgvs+os1uyPeNk/8lm/Fr+w7NsC+8cqr8IsJ2NgIeSG8SgviVfiFcPm1woaF8MDY//myyyfGjmUtE9j9+jp+NjL2ibE/jxvqFEIlB1ZICihDz4Fa2R4LwqXlnyQKBAvZd3JiFqomfjUR6CEoAnezAcpMGi4OkAre8rWcurJitDkBXJm+B8kRGZ+MuzMOwolRivzqNdcuHdgD2G6IwP63D3so7rdj56SxdYHkLEK+z7I8oX7IXw2KwL4uauzfHRj7O79zAvaypEgsa+jH/2UA9pEN7BjuiyHU4yUwLycw6IWYs2XRkpnzkpe1W8/LCEuSAGoLiJD+TpseWj9oPiw/MtCinJD0U2mRB5MlStA0YTKL9ahZu/HjgR/NiT0vHgV3Dox99rfhldcmYC/JLNYnxv7a5z6Pn3/4w0dgD1KkeYtNu6k88VdQD/Zk/osLtdU1XBuB/fq//3vc70lPXJ7GHto1fCE1lveSaGE6KfbtzqF2BGw/TtoOZlX9iy6dkwOcHu5c03k85EdUiY2BGWKkMGlcz02OZkbjR/dGFg7VrWdkVXhbdKp8mhwr6ZeZGWVi+AZ3qbzxF6aPJaxHVjnp287Gq7/4xekvWi0JACpFvvLZz+LnHqHA3jTAHoC6gnKr1msFu56vmPAQF49r2BdNh7/3wQ/hfk9+0tI19uB+YmTsCdi6eMx1VxbUc+gYyTzDiu0Xey41+BqSgq0xdkLU65YC7HpTL18rU5uFnrJutfgrC0KWFlqZFfrlSuitukfe2FBGHv3gb9nptfn47513bOD4e5+F1928f2KWJQP7y//0Wfz8Yx+L+++I5r6Nfqz/wnUBCrC70CICjNvy10WN/V8+8EHc9wmPX67GjmUNBPFjp5yKkyNpHBdq0E0gEwMyz4KLgG3bjGrS+PQlrAb0PCu3beIG5EJHaWYCsj3bgVsJRYrkY/opCDqTd6oQWU/EW1gU2LEX1iOY+uOPx/+x/8Cke5cI7AFsX/zEJ/AzjzkXDzxu5/jZsxVsAWi4PoIdpJHho8a+duMw/uuH/wF7HvcdywV2bEO/uYEX747A3hjMfSBrhNBOn9S7fagXkgxspHRCacXJDM+6QMEEm+X8r6SVCqMs/aZe3CAGbSzqzGaKWyjxJFhJt90MZF5Q5WvJFeAG8q17rCTfLeL1etxx7COoLtr/9eVqUQX2J6/AT+3diwcdd/wI7FWUyXo0wF6htq+uDIx9GH/wkY8uF9hjuyaryA+dEu3YEdg7e9neRG0ADuD2lTu2+vtxNndxFEA37xiNMtAI91ic5Eeofx7Q4oCf9XJjMpiZlPOQrK9Zd/OturlgSfE21uNiZ+fx+L9uWS5jK9iu/9SncEFkbAX2HBtX9QeqQVO2W0vAvngA9mMfs3xz38YmXjBs0BzZxPH9ZO4zu6WYZ8zWOqs1MTQ/dmLSeT+URSSKvucnB7l8NOo2eToWbrK2L3hBOqvFxeTBg501dysP1CBfj7tj4YRd+P2blquxFWzXRcY+/3GPG4HdDX7Jfp2PmLFZhxrkxdy3EqXIHfijj30c5+x99NI19mBdes5Jg1VkAzuD0M5jg5Gba4naXAeU8QPqic4MzXF9fAW3Lgy9eQ8kcXgipAbWYC4MC7ObqOa8lZ5YOVizDd9a8u4bgb21kVOBOgybHnVHbiRg/z8jsDEBu7zqfY85Bdu1H/sYXvL4x+GBg1VkQxk7MlwIpZ3pNz3FhwL8UAN/PMY2XBOB/aY4ab592cAezH3x94wI7JMbwDbyER7MbengJcHg7O5gbRpk7Y2ZML+72LnzAuoNZtPy8JEEmd1oMI3VRxzVnq3b5gpoKOjLrpxk23SLnQu7SYv5MS0eN48/AX8YNfYA6k6YF+45p2C75qMfw49Hxn7wzsncp/BbTQvcVe4fMLjRlCsDe60lYL8lAnvPYx6zdMYeCOLpJ59SgJ3aMhoCxBEQaWcPZFCb8lEs0bWwNKefMznCThLP7Cbd2NkJxIWp3cKw9WwI2mDPtxe2ZoRgdhDt5guM7rYsznbw9EuTZjMy9vraDrwxWkWGDzd2w1vgS2TsayJj/3DUwQ9Odmz/AFC1+EUNAg8MBfZbP/5x3P9xj10ysDfH8r7/lN04JWlsBvZU12Ka7Bb8DNiE2ylbgriWMNba0ToHLA4B1LeOlRk/05gsR6bdROkVuGIsH2OasVN0cyVkKZNljwLXMDMxOfi2rRNRxsXjYVnDmyNjT88SLxfY137ik/ihaBV5aLRjh5Gx2wxWgTrMAyIz9kc+FoH9uCUCG1lj/6soRY67/TBO6CV/OEZfABjrqbd+2KNiZsRKilMWng27NdBcmAql8W+Y+zho+Q2fHTNP3qXtaj5KY9u86wW1HbaA0zC8nmewp9t0Ymi2U2tjcgNSWlB4aUgXgQ0cXlnD2w7cOvZil8XXPesUbPuiVeT5EdgP3+GsIvwLqa2ggWzq1BSegP22j3wE9/+Oxx4Tjf390Y69dvBQBPb0yZ0KxCBZomycgAzxoLNsC9jwNgNbywgoPlzc4Rcww9T85kCHeob4ePrchgE7M68riME+MbXTVypD1NxHdVnh9BoP0w7kxpGAQ90a3r7/tqSxlwvsayOwnxd3Hh+2Y+c8sFP9WabkNqMN7KsjsN8R9fv9HrN36Rs0Q//96wHYh27HLrd4BNBkTn93V/kIWAB6cHut7L8i5VnZh7XiJSYszLzSS/VctRgmt2GmUUHDJGto8I4hCPTB5sHmL9XlK73rKNbeyeIw+A8a+464U/fOW26NW9FrSwf21XHn8blRLjw8ArvbDCjPx9TAVlDrMyNzGnWQIldt3Il3ffyTuO+jH73cDZoI7OFRgadEO/aOQ4exa6hRWPBEJmrik5m4gGVp9vOPtTJwFwHbxFlNFcjPfIwtKhsjCq4y8xKwQHZYI1e0cqFsnoAGNE0KeN3NEqR3nZS1Okue4MyQMpr7DkVgv+vmrxdgL8Ep2K6Ki8dnP+7xeMiOHRHY+qJBbcP2v6Hu9QNiCuyYb2Ts915xBe5/7t6lA3u4831XtIrsvP1QZOzyEJQHrGdnD3LAg7cG+xygFwHbMrWQ/OgpsC9P5unOYQa22qiDvc4sniqmZj0kICrg0YtlLNbaQ+HEvEXni2H21Wz3JoCP/jK9GnYEEdgreG/ceewiwJdtx77yYx/Fc57wBDwiAhv0dF/T4oPC2OpXrATlN7xoMDD2e+LC9P7J3CdLZuwnRavIcYcnYA93yPbdRRYA1v5QxZkHNMcDFjP3dO4Wih6oYIASeJu3lhyfjr5BZNqTwAye/PphGR5MJ/FCEim+TgAkDc+6fPNO4HZZxV8O5r5oERmZbYnA/nxc4P3gk78zAvu4aBXZKHZr/yM9reCW0LYITBr7TrwvmvvOecTD8wNXy3CqsZ9wyqnYcdutOGmoUd8T0Cw7wx1lwXGKsxjQVm+3mZvlTuzAVQPMuvNrO6G3jCjwWwO3SpNlhfS3Nd8B/iXWbC4MTr54q0Fopx8ZO5r7/now9w1+y9TYEYD/9KEP4hlPfjIeFTV2SHbs5nMVrt76Qu8csK+JDbv005/BOQ9/2PI1duy+x+4+Dbd96UvYHRfmSJth9UNKDcKbOS6yQ3PL+NpLEs0DnEaIWaUlKwyTu4UikBl1hd9gUe3sKoy+BvIkdYRYXAz4hVk/W1AkW1rUv9xJJuZYj8C+PXb+pQcOjl9UXZrGTlr0sx/6EJ7+Xd+FR46MvZlB2y34MUCa8UeNfSfe/5l/wtkPfchSgb25EeXU6iqeevY5OHD9F3FatzLeVWVBfefZu2zkyJZx4bQz+zWePVndIIbwmTkANrVOX1gVabGJtNEy3paMjZsKhgK2hA3NHP9TiwktJnNZfE0vLXSpgVnTJ3kyAPtQt4rLbrp1HJClSZH0VsunP/ABPP17vmcE9vAcs9eIY01CGTSof0D+Yqi5Sw3nccJcGYH9wc9+Dmc/6EFLBvbG2I9P+fY9OBAZewB2+cLV5FqAtKCVpoSYO8rMDygLw+DSGKZmXc0VUcuF/XyC6l995SsQ0KWRl7WUWMkidqcxlalWEnj93ZcGT2nFAB55QRmlSNTYh+JAvP8mtoosT2P/49/9HX7gKeeNUiSiomJl1dL1ZhbacgsTsL8QG/bhL3zhmAH7O7/tbHz9y1/CqbKSDAyYlR0F3LKQxWtpsTWgm5LFvPUNuAVjcDbr6d3F/FwAGpOhrxcNLGPq7faky7ViwUqXbPVgSwlSOc4Kks2C2tDUpmgVw8FoRfjgzQcmYA9/pGiJGvtT778cT4uMPdixh7825ge/9Y5jpalhgb2SgP2RCOxzHvKQYwLsJ37r2TgwArvLC3wAFUurJUfDOM4cI3eYA7VUeYDzWk1P6eUn83opCbOfZhYM6NFbljeVccwPlh7GT4y8MOZBlTVJjuhtOdusQe8M0qSEmwB6HBj71giNT349/rtjbfpmxLKkSATgFZGxn//MZ+Lc43aiX9+oNCVPxNamDBp+K0mKfOxzgxR54PSt7CWtHRTYj/+2AdhfHq0inoXzXRg1o3oJshVzKy4xE4f9EjjFLAanZzZoh8+BtAVWobRsutPCGLQtvy6zdbDPg6ieV1mjfj0ab+oA+l0L8cw9qKV14MYjHT6xfwD2jqUD+4Pvex+e94IX4tydO8dXqrI9Wj+cg2kjRv9btGmjz2MP9vgvbKzjH75wJU4/66yxPFkyYz/+nD04YXgQpw8OzNKUI57JgXlAA0VyeHkCFze3mq0ZIAb2W+WsjwEYCQHS0azHzbMeWgZQNHWSNEVSBLv9HsgPCfAhFBkUQloUTr9sv+Z6sj07gqffENxyRHBFBPbakoE9MOtl73g7nv/CF2JvAja/7wjUzO2lCp9nU+Fqh+siwD43LN7ufe+xH5YJ7MFu/pMvehH2dKsZzGi0aU5WtJjaAlVmwS5V3I35zD0D5ko62VE2aEpBcBPCa+E8kTCBjTd2rEyR3CBxk0o4X2Zs0J1D8wt2IbkZgX3zuuAf99+GHccfv7TvY2+mT/r+7dvfjqc97Wk4Z3jRQD8FFmiHcRu/islWBf8c2fLKr3wFu+91JrDMb35HUvjQX/01NobdTthJ6kEM1GCsgcnxpZmulW/+61wGjKYyVguV7xyHqiJDhMzaw1Gm+ANZmJ1AnXFdyrcvhU5AlsLI6UMRWa93BPZUcGZhuh79UiN00Tq+HKNhKW4fQX1T9Py7L92I//u3fxsn7z7V/IHL8Qhyeu39ufPsafvvusighVdx3ZVX4u8/eQUetncv7kxg13JzPRe41MVmwENk7KvjBs31X/0aTo53haX9HZ0I5jvvuAO33HEY3QknICBgkeadAzhcPEAqWeId5zPieWCGvpdmgX7m5KN+vlXIn2/3ggK8PlWM7dxdkSFjfLrWCTLewBTMMv3yhHEA7RIIp78jM/kJgXk8DtdpduVJJpPGPtIdh1/9jdcO86mUh3anaXvT/GzG4+vQCqB8DsYIh+OicaXjP5+0JZ5NHmO61PZB4jxqdQceFSfKMv86wyB1VtfWcNrO43EjwkJ9zH4cVoc3dgob6UHX05cXN5D/5knOuG8AOUUw16ERbwDRJjOjMq8kcBZ9DGJeBqDuCuYXMRNgNX+dMCJFckzglrSRUf6CwRhX26dvcuhf7AkpTdTn+2/dBJuvhVg5X9ModBQGOtc/dgSXVm8eDHJl8ZVO4LObIoBmhs2TKVqrPez4PToC+uGPfCSu/sxnRvPe0oAdyzn3yU/GrljmTeibIGS/OaYuflKRCRppfBnlL95u2gRdoqApYjALrjGz4GaWFBBknawMjQKI/HJvmg2GeVPaCSwJfHmBBzMB8oucRnbw3UamRaOUu0Vm+zHPibVlal5mZxCDw8sAF28Eaih3KwZgy08nSMdBijePZtYUYT4IJfvM0I8gQPdL+sNQw+J3WCv8ydv+FP8y2spL3Qqm7NGH27hSxWnlBdRdl5laK5EBMRwycP2qMyQAS5EfIVB8W/jIvmmRBr2GBTS/yKsD3zEzp/hZi+uikO4GLBnyXcUBUbV21u46Oz2Y3bkFvZS7B4MfMy5oRDoPodqp34aEntg+oPwdc/WPgHrkwNCPeiSuGgC9rL8xE90gOTaiBefPP/ABnHr6Gbg5bDZlwxyYOUxcD7Rkxhxra/zyZ5z7ehZowVVlRIp2DW4iwOnqofN7si2qdMBE2yPjEqCHhWFe6IGkBrVSiHV1UalAV9DqHWHwyHeHrK1RgK3sLqHB2JIlTGiwORyLM0v3qX9EI+Y0k0/wwxdKNJUpuVCK0rkk08uym3jEwNBRQ1/16cTQywJ0tE8PgH7nZZfiqVF6fLXfyDuac2w6x85ebsydYwt/+8dBQ9GkGdh821VQkATJ6fVIenfKtwXoKcEoF0IwgOY/lDmBllg3XWeZE6RIj55ayfo8rfxEJw+xfs7TAFZy2SwN8gCFOixbSbz8aEiL0TuFB02HIkVUe09+UvJ0Tr3CZo+Hru3Awx6ZGHqZkmMAdLRPv/3SS/F9TzkPX+k3xo/me6C1wKlri60A3dLlPg77Da4sFGlQWD9nQMAxqvuNmQqKlCG21cnAgM4bMDp8nX3WQwe74zoNmypj3pKZ10iKPDFT+r74j4DxLB9KvSVNPgUnn5c4FC5EpIpUSRM1ozR1DIE7EOBZuuQBIqXCfiaOxosM/eB463/ggx+CfVdduVRAryqgI0M/LQL6q9sENLdhupbZ8O0yvT+WhSKZ3XKGOoBhBsT0yzZpZleIkReZoQm8E+CFQI4MYiEpMdm7ZdqCJeat8iS9zWbDDOiuBi3Xf/Qmf3OnEqsIysQIeWKMkioe0+noAoG7Wlwm/2xKTNcVDdnoI0M/ZMca7vfAB+KL//zPoyRcNqDf+f7L8X3f/T34WgL04Py6Yp5p25YNvW5hLKANdJ+eTHoNYR/qjMVXSJIe7QnYKZUOXAYRMzSxqZksUgZWeAHJWryDs0enPFOc/CeZSTtnQCem5nZmIDHbd8ibcRXgU5sCSl7QhWpiaiMlWIYQE3eko8e/30kMzbJDtbPmN/wdmgfvWMV9H/AAXH/NNccE0O+Ji8JRQ2+uj2/jeMd9G2AXgkfDulsx9yxT644iZ9Jto9BpwyPk84nR0u1EAaYD1bkyBHkDZwI8mdeCjT8BtyBBz5l1DaC9zHEgr6wgQGZ+pLsAiNW1knyeMZfa3DTzEYAr56UMLJCJ3IsJcLiI4H1gBPTA0McK0O+ODD0A+obI0AOgPUj5vEWEHG87APbsL1sczeZLxdSNjKdjsLfPyas0gBk2OKAB2Rxo7M+8o9kFs9uo2lmngLL+kGcATQAqN1tJ0uJz2nJHLVmcHOGt6Y4nQQqH0dGoWBduEWg0spcZsAtE71Ly4qKGvl+UHA940IOOmeR403vfg++NkmPQ0KvuYSkPLnWd81lElIvOga0nQ2bq8YI1LRYAWkhmBBueN1h4N5IZFyBJEgh8fN9VgIdqUSkERLZeZDameCBAd6ni43PZjrWVnUcXSj4dxRulCGCsG7m9rQnhFoGskbsZ5udFqP/b51PZPfbsmBaF11199XIBnezQb3z3u/CCZzwTX904MoK8qmNOQXdg44Mmk6trMfIi0M8B3tipfaZjQToYQNaaxuTn4jG16G3cVHBkxmlHMZvZUoSO02uGTi9PoCc/J1U8oI2M6RKwdWI6ps4mxA5Gj5e7BMUjYI9HB2jdY1H/kMCa+1hBjNrxA03D/F6LlbnX2irOPuccfOX665fP0AOg//xdeNEPPnvS0KurDUBJBdISthjMc+CcOy7yG7quyA9fIIGs41R9o8IKrkC6iaZv9hvBMsUJkrbKdWGVyhJXTpfTIUuBwEA2oB3Ou2n7m+QI6A4ygt1YLKiuoInId4Vg28RSJNeRWZY0NRzrcnPEMTpvPGrea5Gh7xM19H3udSb233TzMWHoP373u/FDP/iDjUWhNNlVm90C63YALEeZxpdb5EfgDMQOZHJsDcnHAUCbyMDMv46AmjzLcx3Iu3mG6YBao6Z0bLYTBrnxGwDdJ8RIYfZUjywthLsBxfzHUsIBe852jZR3h8TEjrHHOeJYO4Me9YB0Jct4PgH63nHr+cCB/aP/sgH95r94H17wA0/H1zY3xq9ETY+TShV/DpSDS1x0VAw8l5fMxGc/u/mSgo3lQ0HmMs0PB22KGWhFUejLHxQtbCdgu7Oya376jgEublL01EN98dMJNN4BEqAlJcwr7gRoIbaf6izTE4NAYf1gmVePwjutZT44EBJLSWFjZu16oIJps7Z3ZZAcA6DPKIBe1tN2Cui3/cVf4Dk/8AMjoJWh/fuBVkvPnzN+fBqO3wIpFsRv1j9HSKBjzcfa0WREgMtxwQCjFe94nQaOpYI4sIorF7BbxAk1HUuN5BfS46S86BNuFwFaHANDF6W8QGz8/ZqxSOqP5la5+qf6dlQRr6VL/4qp81CtFWzi9Kih733mmTiwf//kv2QN/bb3vQ/PjYC+YXN7Zjud1GjEkwX+22HrRXm2gD0tFDfGO3fFxkZPo4CpY6ZFAWlIwKorkti8AeDx0l1n9maAZCGabvOZrcsDTVNJoZSJUic4DZ5NfolWxz8TTVuG/nkOD2Bts4LU9BNraZcuZOaHsXVPeQWsxUqdFoH1bfe+Nw7cfPMYcdmS4y1RQz/36U/HDeMLtcrQxbWA1gonDjDXW4G9dd0CLxrxy0Jx8OhlPgMhLdyjjqebKE5zdywVXGt0UFlyjFFIJzO4jfzgez1p5ZG1veTw0oOOIYV3ptZSnvRj8Gt5QPXMhtHKmMjfmO5SfYyuhp24g1xbWelxRpQc33Kf++Dmm24c44QlM/Sb//zP8cK4KBwAvZYATc2rAAzUYAWdt/T0VmDGNsIXpbF2asc4+am45JmBB2J1EcuqqcRKWviWp0EPajkB7CteCjwGhdPTWuGQ6hiyfACZGMpR2CSobG80NjGwnwTKyNxW1uHULjaDmoeeuBtI3vXxn7VYmVMiiM48/TTcemD6oOXSNHTaWHlLBPQPPetZo+QYAO1BvAiMXSPfRUBm/7kJsQjMi3T5Knt0myUk22c7sbt7XKgEY1Md82AWwvzib/QjSTAGk17mDRc4tp4YVipJYfLLC8bC1r7xDF6ziASKRqeFLKcJTq7BtU8BqxZE7Z/gJsZgTTguepy8toLTTjkJdxw+PPkueVH4p+95D17wzGfipr4sCqk7mqBrOdlmnK1AvBU7L5pgbTu1MhvEvAybf+KyopYrC6kLBArupdDB6G+B9c/59WViqH16lEpOSjAja5oMNo6rVSDQVvlw85wmRiOtYftUQACqBa+CO5Dk2LEacNKqZECHsHxAvzNaOZ4dF4U3JQ3t2XAOoC2WBdpduJ2JgC3yWuQHKqd68dbEaGSUQUcDnoHZWUCzHZmZNoPCxEkUlrR9yG+sIE8GYUlCdw9+tWkcBGZmZtwEQJUOcItG1vB+R5CZ3Fg4iO07mjhCdQkE7gzoMAC6x64Vwem7T14+oJOGfgcDeoGVg/1aYF8EPsHRgxvbTOPjmYUiP3A0RtSBE5tp3gAJrjAGMBzjghjb0wBpY91tzKut8TwUKZE2VcqNIpQHmfiuwQwKawEJC4CdF48zkqY1ARSkZkFL4Oc7V36Sb7ByRECfEK/PPO1UHD4WgB4e8I+SY7BD37KxYXYKW2DiYesa/tjCDzh6Rt4qDahO7FbzIa6y8wDxrXaLfjbPLqvzDO2YDl6OOIuHPU8MPvyvb7twa1Ru6H3dLRwzgB3gcv0dYLMVJcBsmcMxOVx4y6phFtnQNCECqMeJUXLc68zTcOjQ7WNhS99YiYvC50YN7QHNTo7Cj26oWzKsLMhrUTnbzbOxowg76GhUoqN43uKkzKbnCmLH5EZ2oMQPnDZLDbFpxFUMBcBwjMymO6+tx3Q84ZhlOZyBDOekwdKwfakv4g5ftRoAfdKODmeecSpuP3hwuYDWjZUI6OdHK8fRAFq2yLtz8RaBT0E/Fx4afurmgM1p8lN6IYFPZhLB6UseNOFEvWNGfz64BjMbnew1LgOSgYyy2TKe92kTqSErDPsG6pwEerPgs80u7Qkwmye5HnRtZFkiiumlgQjoKDlO2rmC0089GYcPHTomkuNtcWPl+dEOXQFatgeellsE4BZzL8q7FRZm8pxz1fPUnLq1Ta7MmzPmmqrLDK0aOVjJkcErFqjEeKptRy8CNBkgqrMR+5y2dYTrYIHZXGmyAAOZRikvmFymWUfn/ouAXotWjuOi2W73sbNy/Mk734EXREDv3+BnOdBsNEuJu+J8P4sLW+TmyvWTDjPxsvxA5yIQc4+JPYO1SgBIQkwRgprgxrBgbc0EWjXX5c0Kz+TOsmLid6bKTWAb5iZQdk6uVB0qMC/QdsH1gdPYbPZTdK+tRQ0dJcdppx47QP/RW9+KH3nu80aG7nhRuABhW4Fvjonn0t/VCaIubMNvKGOEw0q/fmAc8B7587x6bP5CkSt6nXPntKA047mMDx+pvwI4KND74o8EeHBYKGFwYSG4urk4+RhKebpDymH8E5T8xkHrM/GadFmOcT7jMVk51oAzTlu+2W4tAfoNb3kLfuJFL8It68Vs1wF+P6rpFgFxjolbeRwNoOUo/X2dxnbdfmRtnzSAXAGbUxLAEaxfHjJKF8y5jADPAOO8UlwFTQhtsAcH+pw31Yfj9KnegSZfcEfTFs5L09LRW4cIxyn/yQ59wg7gPvc6HYeOAaDXI6D/8I/fhJ988Ytxy5H0tF1o3JGPwjGItwtU7sajie/T9I14rbQjqF9+gRyIVwc4ktdAmYkyACX9UIFe/CRgsHsWDxbAGVwEsjDDutICuDJrsJPAADqUdJrfeO3jEJAZ6Lr447w0j9F0HqZF4YnHdzjr3qfj4O3LtXIooP/7G/8YF/zYj2L/AOhVWhSyhEINVFngD2wfzHdlAnjnwd26dv4H6A4kVzAzh5nzMQMDvsS6EBPfAJjByAzp2DcDO5QwA7xgjz1s3hmowf6MH08aUP4OuAa8oYBe5ZIH9tiDCdDH7Qg4eddgttuNgwePFaDfhJ/68R+LgF7Pj496JzPnd4fLa+S7yYUF1y7sigLqzfAplh2SBr96Pnq4Zoam23kGdzKvZeCkcANQByqvmZn9DNiDjcd58KRrxidwBtj6hVCztZcfWYODGBwcP2DncQHHR1CfcvIJ48bKsZAcl/zJmyOgf3SSHOkl2ernqnRXAX40pjksiHt3xJsgET6VQR36cAVQ662KcUfwhWIRIHCB42p4b8ODAzr4GFDdzrOubvyYhYNn8lCD29xhAgo5e7YOFtDB1YvrrO3po4beuXPS0afuPiHahNeXboceAP1Hb3krXvIjP4z9d85vrLBTkDMI7y5AMgE4fjBxpBG+KO2in6C7jOTHymUFuFL9AiujlpZmqQICkAtvnTN4QUxpAKi1dn5ziznPznlyAE1Lionr8go0QQOF5WIjoE/cFS2j64dxxhm7xk/rHouNlTdEhv6JF0crxx2TlSNVdVuO5cLdLR3YeXD6svx5WJDW/wa3yfLj5y6QfTFkH5zLYt8AvoA3m+To2sgSoMnUfB4csDLzArWUQGFlw8IUf5h0TXZtlZXOZW5CtABNcQeGPulE4LZb9+Nbzjp5fPVq6XboCOjf+I//GT8ZGXoE9KChiWqPtiYh3IVEWAzCRWk4bZjJZzt5RbfvVJF9xlQZ++Fdqqkx8zMr4Ia0qJgasBIGxJSAZW9i48yuKQMjNyh+aLD4BCoxefiyvCwxgKYyldlzpzpAn3yy4OZbbsD97nev/CndZduhX/0ffgu/9r//cgT0EWvl0DZhexgVHzFs3zbsrxmELC/mftvN15fRmzzCZcO/FtSb3Z+hX9yMyhICVOD2pjoQKIx+bYCsD+THRw84PRLbFqbW/MWUa/IDxYcDN7eNQMGWkgHQp0RA74+AftADz8ofmVn2ovBVr/0NvObfvwK3HI5WjpW1EqFRje0AKMyct7L0cbFF3ttxWwGfl2y+nj26NwzXFYL/3z/o90fP3eyX2TnJam+v5I9LSrrO4Z2zcXa1v/pp/h2Vk8MWHPV71Zp2+iaJpLD0JaZO/TH9XUetZzf9yb2xPpwXnas/NCx24WmnCQ4cuBEPeMC9R/26TECrhn7Va38TF/76K3HTofUoQ1bLU7U0GMLX7MhvTCdlgvt4vJDcbgs1vj/Xa6DW8T22X0ajPvtOk+6+w0m9UxrCGzimAfA0HdrM7HVrg6lVsoznrLs9G7tpaBi2r1nT6GvQ4IwXYvJW/1x8oKozW1N+uU5juQGnnir48pevP0aAnjT0hb/1nwqgh481unaMh5CNVQuBsokZQNvstgRbK17NpjaMGdinbeXv0xS/SXoMrgL1KEE8ePuZwhrSIrTkBRrxuJbpPIT2kcHVA2bQ4AGdNX2YBlWBTfF6St+UH9SEXLeh2ps9zjyzwzXXXIVHPeqc9GfWlg3o9Qjo1+FVr/gV3HT78G27VVNhrok4v2ACbDwfh4em5Xy8FqD7mfwWpeFrt8wy6XzaDt3rkc+d++mfk8tizMu8f7XbCFv7MANg+8xHDewwA2LMARyoJ4J6OctGjubA6+MwoPN5KHmOnRrZ+D73WcE/fPQjeMITHjz+Cebpb4wvC9CrE6B/8z9FQP9vuOHgkfEPCfEk11M/8BrQAhYWHLHFtS9jK/+5PHo68nmrnnxNca+IVo8rNO9VtAoM8gYJ4bzs0XqcS2VEZ/2gj2+qQJLkncKqOPy4aTJ/6xY0fxJ3HBRBfpxU88mtBTLljPpMymPc+nmvkAriR0mzKU8oixSuH0kfijlp1wr++m8+ihe/+ElRfpwR49AsFmx7s+KuukOHD+EVv34hXvXKX8HXIqDXImuH1Fm5zxakNyDTBCgg8elb9uOwnbxnwsJMnnPpWmnm0/av53SzY/EHv98PH3Hb7ReF4EUcZ8SLQ120NcL4ncH8CtncQpHi5D8Vx0eKa460yOvS9xXGP3DUBbP4E3fe8Xlnw0LYxK4TQ7RFr1kQu3NzajqoirLQr+U240juHxh6bc2UkScu10fqeoSZui50C+Ix6BYBdjtO8+iPIn467rt3WiCqW51PFSL65dXjuV+6MtNpmGfOgPKmSV8Am98dJIbM7BtmOild8PfnxuICxVUGpvwmMIbREqJ3hj5ZOzIbS7lTBCon/9GBFK/rVjB8Z+baa6eAbElJk0jE/iBl4o3pNR5KOFx8H2bIQydzNNtth5Fli3Bt58L0C8L99dGC0Z+3rtnP3Yyz69Ff6NPMPie+eqS7KAw7jAHlPUGn3WZFDuiaE+hkYMuFD9cJ4fIOPm1vi87PYFCeRluPRwHXPbg4WkZeSHq/4NqNsnA1mhxUF8pL07Plxeh9cd0cyjW3i+3o/kdJbf9Q3YJrWy7Dp2+Ehy3K5fS+Hi2d3ErDNopWuyiPfWfJ6iU+n1lQX/ByORDhPM6CsFXv0dFsPwN2W7wF7N6BrJG9B7R/XNRUwYG1TyFsqmude0DDtYO9xp/YQcjtS8zvjUAemOO1oDyWHmwfeIBV5S8Iz3Vx5aMRzwPHl9ECVqtMZyyr0lZ9hcULRF9GK//QYOnBbams/tvv95fG1OeZyDO6zR/NLRXzt1phGZM2Riqd7TS1avOmtqY8Oto4Kfo6VJsqXkPnjZiG9jbHVJdqLaBxqC2mrZwvhYH7QkhyiZMLXaO/gUo3pyzzJPSSQ689aIXyCrC3fR+X3aK4siDtdvOm475vdVpaXYctXB/k5ZVgIqZjv+rYqKlhazqGRt4me8/wzKyhyIDepw2Ffft0Yp7f8OW661azcvM4TmiwnauPYXj2c7+xro3ymKWa5dnqm3TM4GEmvGLoUO4uixg7oGbeubhwbVwkM0q+Yfzpf4NvB3kqZtyWoP6ZXxjsf+H10rqHoe0XXG/nQQiFRUKjhcHnGxbkBeukFQ8EaK3b+J+YvFLxuV4efKSUcpxGVS1YqIK9z1/qycDpuDwz2FquzAOA61mVi/YPc8dE8600HoyLADwHfF9/BS8DOFDOZRL0F54lsg8zbktQD25lo3tNzPqKuZ7wg1y54E75upHW7+xVA69+yTOziivOL9LKebAd3ahf1tiwBZsuCDUwW6CsQBqSng5OTwZ7nAMRgmU5wJbPVTbloh6jlgZO70SP9WixuB8LX8c5Td2bcifA9g3wtvKjdu47W9ZegwVuW6AeFo0rG/K8mOEB9vcABV/7YzpvPofgQLPVdTVwvgw9bU06B0ADxmA7nydN79OEBpCo7N6VzZPKS6TtgIXz7V28Fnh6H1faE4Wd7xdIuy5zoG3VybOvnqOR16IFYwo7sIluVnao2xaoBxeBvS/afC+sWsCl0rUbyyaQq9t4IHlCUQ0De4AGKi9sLRE4rh7FhWt6bmYf0NSj41HcgIZSbw8Gzr9iaXGAC3bCNMEbGuDXytDikcHdAlJTV4e6Db4/Gbieebdi32ps0AZ6Sbt54X0XyA512wb14H76l1YuihV9vdZEfIQwcx1qPxMUGlkEB7KEVl4w+kFgHWvY0wMZ9joDY8ERsMA3Wt3lM/oDtSZGLZF6F9YEF1xfOH+uYwuwgE2HxrGfy9dchxR3a+C2ANwCL4dvNvLR32bU0feVHRdhG05wF9x//73+nfHw3DED3h4f3IypSShuayeN06lpbDxPYeOhK2V0/tjYPjfPXvPz1xy3s1vr/jnq8bhCZkbaUq92EtncKKXebMZjcyUfTTxuu5SwgBLGfZNNZUIsJSjmPR5lP+JbMZPYkOGyx7x5jm8SPebdojw4rylc/uz+0j0P23RHxdQ50YZcIMPCUUtGm2FDs4LOs3EeWvlicScGFzEzrdhzjqudXmncQMxCC7qKEYNjtDTqAZaRK4YKlo24rXzdUx1Gf3H9LKjWKBOzBdO2Ugf91+pb+8O2tO4ixmXWRSMfn8dcnAToK6L57gIchbtLoB4WjrIR7YRpG71C2wIkMuA9+FuTgbMI7rx1NB1GVODLbU24DFpncuM8MnhhQdU7sAOodxCpUA9eI0MEdqs+pw+j7XIa8JCAYEE5glUKdBnECpxWP/rzqmzMg5PjtybEVuD1+rpIDuwb7NFRRx/AUbi7BOrBDcDuNkcDuGHsFohGJzDPOJh4sPGa/s4zYD6PDPDQBrAeFWj8JnmgdMM/nqFA18YEJ5a9exRQsQadOx/jhekt9D600yHXIxSQU725XVofz4wtwNULsvQT23/NOGgD867GKRNJrhgsHUcL6MEJvkF38e+G3VgNl8ZO3NvaIvfnvGVeaWt3nuO5LXPzJBzrYZnZTifNy1vflZ6msKzN3TFrZ799DpAeD3nr3NfXbKen+gW49qT4IV2bre8Odhtcyjmk9h/y1j97p2Og530K6ykLdZ5kWq5JPM4t0tWatr5DyBXH3QWGVie4m9wf/t7mRbGHXjpmSh1sFoM8mAzeFqApvbiFlHl+AjVwvR8vHKsJ4CYGP9cBd+0XlIPTxWZVpj5f0mhnBXQUcHed6zcC6hDUa7nUnxrOi0kNzxOGHV1r/BYQ+m2iowXMrcLyJIMHfnjDQ2X1fHwD7i7LD+9+6hdXXhb6aMf2rjn927M8+7leCI1eCds4hsb1eKtOnn0rjZMsbNZTHWx0s+YJe0v1t9dWfXp3BJXD8og0ZpFIjbw3ixoZ4/aNPHp3PSsVpO7Hfhu/Vt0w45/blP37C79RQA/ubmNqdRf/XjgvypGL4+me0aMzZNI0X/nbs3A6aTC0WAb3bJn9fFrP6F1tquMwc0dwrN0045m7QyhMn8pgUyVLkcD1FpSXL6T0QZA2O3emc+tjZm8O4/AUp6fgsAAVi+TEIsYGFsqVfRHQFzxS1i7D3eDuNqZWd8EvymUYn6AKb9gqbpg7dwNTsW2Kw5YKhDruojuDHpts3foJmlvkbMYzjK75UR08k7FfxfIBdqEb5hd+WzGnqSvVi8vUuuTnPhq/zZl2tMpaFO4sNpcdQXfu3QXowQnuQXfxfwnnR2356ni6h1l3PCXGbbH1GKezrG1YEYUZ4dlY4zJL6tGFz+rr1sIQqDZyxMXL9U1MndmZ6lCxdTyExp0pUD9xn82xtsYJmg9fo8RjRhbY9IHSLGJdZfYwEzbq/wU5xDgHYvqXP0pWL8Hd7O52pmZ3wc/JJXHqP3Vg7dyRwz80GIZ5QcwmhSGBmr01bYuBW/5cXnlWIzSZm1mGn5to5d0KCy6/rGOFzgEy/9V5bfp6NPL1bOjrNpf3nP7tqexNLL4TTHVob+AMKTcRZtNuILy+x8p97wlAD06wJBdZew9W+9cI5CUVSw8RiIX90bC1nlN6s63udLZh35S2mPtCySPHlSYDYwuGr/S109RZJ/O13mlA9aO2AJQ3hTGL818p1vgA2lvk/nouLBPApK34+Q52FXE0nNPglwErF5y7jYeSvhG3NFCrG8DdrfWviaPwEr61tp6HUBCZaz8hWoBqTAgG+xQezHMgLSB3iqaGHLFSA9WzHZDapBfETsYsRVDqwZPUyw8P6s6HLTqiTKbiApogz6AuEsMD14dNcqMdJ/pf0sW79bl3o25e5JYOanUXXxzB3ffnSycvibXYw4zNYMnaUMHnGK+lZxmoJrw6D7WN2bG7t3jAnAuqjZtUhwHU5g4ik/zwd5XQaB8aQAa3VZJubYI6QUlfBaIRHoHnR3wBqNUt0s8a3nAHohR5/SpWLzr3Lm6i3FV3zEDN7o0Xh/P6LgJc5CkyALyzA8234LY8SeDspIpjGDUx6SQhQonbAD5PjubCMQE0uMmSy50DNN0xzHdTxrqFlFFhUGV4PWfJ0WRlngCwzKzXBqB0zYtM77YCNqawA8P6KR7/7HFLYuWW+6YANbs3vjHaubv+vAHgETB7I/Z2L5IeE0MGJwWkaR9mYILSVOEdAZtZmEGOBGintbkezKzgtAw+rjsAlhhI1wrMipkXgFoWgHpweT0uJCV8fuRISrAbGHh4h/XyeLzsWAKZ3TcdqL1705+GvdFasKdDv7dbwTkSZE+s9e7x1yVTIW1JW4kgVq4wYNPzGXNsrSA3d4bGXcJPAs6P2VwnQdbLGiZ0x0BJB3Eg5zBgHtxSCKBHAXd24lhXStLQmAixdvvS2XDcFxeN18Ve3beGlcvu6QXfXXX/E3taR/ysiX8NAAAAAElFTkSuQmCC",get width(){ - return t.innerWidth||n} - ,get height(){ - return t.innerHeight||e} - ,borderRadius:h||"16px"} - )),t.connector.walletName.toLowerCase().includes("okx")&&(i=pDt(gFt,{ - src:lFt,get width(){ - return t.innerWidth||n} - ,get height(){ - return t.innerHeight||e} - } - ))} - return t.innerHeight=t.innerHeight||e,t.innerWidth=t.innerWidth||n,pDt(wFt,{ - get width(){ - return t.width||"60px"} - ,get height(){ - return t.height||"60px"} - ,background:s,borderRadius:h,get children(){ - return ULt(()=>!(!t.connector.icon||"string"!=typeof t.connector.icon||i))()?pDt(gFt,{ - get src(){ - return t.connector.icon} - ,get width(){ - return t.innerWidth} - ,get height(){ - return t.innerHeight} - ,borderRadius:h} - ):(s=fFt(),null!=(h||"16px")?s.style.setProperty("border-radius",h||"16px"):s.style.removeProperty("border-radius"),s.style.setProperty("position","absolute"),s.style.setProperty("top","50%"),s.style.setProperty("left","50%"),s.style.setProperty("transform","translate(-50%, -50%)"),YDt(s,i),GLt(i=>{ - var e=t.innerWidth,n=t.innerHeight; - return e!==i.e&&(null!=(i.e=e)?s.style.setProperty("width",e):s.style.removeProperty("width")),n!==i.t&&(null!=(i.t=n)?s.style.setProperty("height",n):s.style.removeProperty("height")),i} - ,{ - e:void 0,t:void 0} - ),s); - var s} - } - )} - ,"ConnectorLogo"),wFt=EGt.div` - width: ${ - ({ - width:t} - )=>t} - ; - - height: ${ - ({ - height:t} - )=>t} - ; - - position: relative; - - border-radius: ${ - ({ - borderRadius:t} - )=>t||"16px"} - ; - ; - - background-color: ${ - t=>t.background||t.theme.colors.background.tint} - ; - - `,gFt=EGt(IUt)` - width: ${ - ({ - width:t} - )=>t} - ; - - height: ${ - ({ - height:t} - )=>t} - ; - - position: absolute; - - border-radius: ${ - ({ - borderRadius:t} - )=>t||"16px"} - ; - ; - - top: 50%; - - left: 50%; - - transform: translate(-50%, -50%); - - `,mFt=EGt.button` - padding: 0; - - display: flex; - - justify-content: center; - - align-items: center; - - width: 32px; - - height: 32px; - - border-radius: 50%; - - background-color: transparent; - - border: none; - - cursor: pointer; - - - transition: transform 0.125s ease-in-out; - - - ${ - tBt} - { - - &:hover { - - transform: scale(1.04); - - } - - } - - - &:active { - - transform: scale(0.96); - - } - - - ${ - ZGt} - { - - &:active { - - transform: scale(0.92); - - } - - } - - `,vFt=Qt(t=>{ - const i=PUt(t),s=Qt(()=>t.icon||"close","icon"); - return pDt(mFt,_Dt({ - get class(){ - return t.class} - ,onClick:Qt(()=>t.onClick(),"onClick"),"data-tc-icon-button":"true"} - ,i,{ - get children(){ - return[pDt(EDt,{ - get when(){ - return!!t.children} - ,get children(){ - return t.children} - } - ),pDt(EDt,{ - get when(){ - return!t.children} - ,get children(){ - return pDt(ADt,{ - get children(){ - return[pDt(SDt,{ - get when(){ - return"close"===s()} - ,get children(){ - return pDt(jUt,{ - get fill(){ - return t.fill} - } - )} - } - ),pDt(SDt,{ - get when(){ - return"arrow"===s()} - ,get children(){ - return pDt(WUt,{ - get fill(){ - return t.fill} - } - )} - } - ),pDt(SDt,{ - get when(){ - return"question"===s()} - ,get children(){ - return pDt(hFt,{ - get fill(){ - return t.fill} - } - )} - } - ),pDt(SDt,{ - get when(){ - return"string"!=typeof s()} - ,get children(){ - return s()} - } - )]} - } - )} - } - )]} - } - ))} - ,"IconButton$1"),_Ft={ - m:"24px",s:"16px",none:"0"} - ,MFt=EGt.div` - display: flex; - - position: fixed; - - z-index: 1000; - - left: 0; - - top: 0; - - width: 100%; - - height: 100%; - - background-color: rgba(0, 0, 0, 0.4); - - padding: 20px 0; - - overflow-y: auto; - - - ${ - QGt("mobile")} - { - - padding-bottom: 0; - - } - - `,bFt=mGt` - box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 16px 64px rgba(0, 0, 0, 0.16); - - width: fit-content; - - margin: auto; - - - ${ - QGt("mobile")} - { - - width: 100%; - - height: fit-content; - - margin: auto 0 0 0; - - } - - `,yFt=EGt.div` - position: relative; - - min-height: 100px; - - width: 416px; - - padding: 44px 56px 24px; - - - box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.04); - - - background-color: ${ - t=>t.theme.colors.background.primary} - ; - - border-radius: ${ - t=>_Ft[t.theme.borderRadius]} - ; - - - ${ - QGt("mobile")} - { - - width: 100%; - - border-radius: 24px 24px 0px 0px; - - } - - `,EFt=EGt(vFt)` - position: absolute; - - right: 16px; - - top: 12px; - - `; - EGt.div` - display: flex; - - justify-content: space-between; - - align-items: center; - - padding: 16px 16px 16px 18px; - - border-radius: 0 0 ${ - t=>_Ft[t.theme.borderRadius]} - - ${ - t=>_Ft[t.theme.borderRadius]} - ; - - `,EGt(vFt)` - background-color: ${ - t=>kGt(t.theme.colors.icon.secondary,.12)} - ; - - `; - const AFt=class{ - constructor(){ - cLt(this,"currentTime",0)} - } - ; - Qt(AFt,"AnimationTimelineNoop"); - let SFt=AFt; - const TFt=(Qt(Pt=class{ - constructor(){ - cLt(this,"currentTime",0),cLt(this,"playbackRate",1),cLt(this,"startTime",null),cLt(this,"timeline",new SFt),cLt(this,"finished",Promise.resolve(this)),cLt(this,"effect",null),cLt(this,"id",""),cLt(this,"pending",!1),cLt(this,"playState","finished"),cLt(this,"replaceState","active"),cLt(this,"ready",Promise.resolve(this)),cLt(this,"oncancel",null),cLt(this,"onfinish",null),cLt(this,"onremove",null)} - static create(){ - return TFt._instance||(DGt("Animation is not supported in this environment: please consider using the `web-animations-js` polyfill to provide a fallback implementation of the Web Animations API."),TFt._instance=new TFt),TFt._instance} - cancel(){ - } - finish(){ - } - pause(){ - } - play(){ - } - reverse(){ - } - addEventListener(t,i,s){ - } - dispatchEvent(t){ - return!1} - removeEventListener(t,i,s){ - } - updatePlaybackRate(t){ - } - commitStyles(){ - } - persist(){ - } - } - ,"_AnimationNoop"),Pt); - let CFt=TFt; - function OFt(t,i,s){ - return"animate"in t?t.animate(i,s):CFt.create()} - cLt(CFt,"_instance",null),Qt(OFt,"animate"); - var IFt=GDt("<div>"); - const kFt=GUt,xFt=BUt,RFt=Qt(t=>{ - const i=bGt(),s=PUt(t); - return BLt(()=>{ - t.opened?dUt():fUt()} - ),pDt(DUt,{ - onBeforeEnter:Qt(t=>{ - const i=JGt("mobile")?200:100; - OFt(t,[{ - opacity:0} - ,{ - opacity:1} - ],{ - duration:i} - ),JGt("mobile")&&OFt(t.firstElementChild,[{ - transform:"translateY(390px)"} - ,{ - transform:"translateY(0)"} - ],{ - duration:i} - )} - ,"onBeforeEnter"),onExit:Qt((t,i)=>{ - const s=JGt("mobile")?200:100,e=OFt(t,[{ - opacity:1} - ,{ - opacity:0} - ],{ - duration:s} - ); - if(JGt("mobile")){ - const n=OFt(t.firstElementChild,[{ - transform:"translateY(0)"} - ,{ - transform:"translateY(390px)"} - ],{ - duration:s} - ); - Promise.all([e.finished,n.finished]).then(i)} - else e.finished.then(i)} - ,"onExit"),get children(){ - return pDt(EDt,{ - get when(){ - return t.opened} - ,get children(){ - return pDt(MFt,_Dt({ - "data-tc-modal":"true"} - ,s,{ - get children(){ - var s=IFt(); - return zDt(xFt,s,()=>({ - isEnabled:!0,onClose:Qt(()=>t.onClose(),"onClose")} - )),zDt(kFt,s,()=>()=>t.onClose()),YDt(s,pDt(yFt,{ - get class(){ - return t.class} - ,get children(){ - return[pDt(EFt,{ - icon:"close",onClick:Qt(()=>t.onClose(),"onClick")} - ),ULt(()=>t.children)]} - } - )),GLt(()=>HDt(s,zkt(bFt,mGt` - border-radius: ${ - _Ft[i.borderRadius]} - ; - - background-color: ${ - i.colors.background.tint} - ; - - - ${ - QGt("mobile")} - { - - border-radius: ${ - _Ft[i.borderRadius]} - - ${ - _Ft[i.borderRadius]} - 0 0; - - } - - `))),s} - } - ))} - } - )} - } - )} - ,"Modal"),PFt=EGt.div` - width: 52px; - - height: 52px; - - background: transparent; - - position: absolute; - - right: 0; - - bottom: 0; - - - display: flex; - - align-items: center; - - justify-content: center; - - transition: transform 0.125s ease-in-out; - - `,NFt=EGt.button` - display: flex; - - align-items: center; - - justify-content: center; - - position: relative; - - background-color: ${ - t=>t.theme.colors.background.qr} - ; - - border-radius: 0; - - padding: ${ - xGt(0)} - 0; - - height: ${ - xGt(270)} - ; - - width: ${ - xGt(270)} - ; - - - overflow: hidden; - - cursor: pointer; - - border: none; - - - ${ - tBt} - { - - &:hover { - - ${ - PFt.class} - { - - transform: scale(1.04); - - } - - } - - } - - - &:active { - - ${ - PFt.class} - { - - transform: scale(0.96); - - } - - } - - - ${ - ZGt} - { - - &:active { - - ${ - PFt.class} - { - - transform: scale(0.92); - - } - - } - - } - - `,LFt=EGt.div` - position: relative; - - - width: fit-content; - - margin: 0 auto; - - - > div:first-child { - - display: flex; - - align-items: center; - - justify-content: center; - - } - - `,DFt=EGt.div` - position: absolute; - - width: ${ - xGt(56)} - ; - - height: ${ - xGt(56)} - ; - - background: transparent; - - - display: flex; - - align-items: center; - - justify-content: center; - - `,GFt=EGt(IUt)` - width: ${ - t=>xGt(t.size)} - ; - - height: ${ - t=>xGt(t.size)} - ; - - background-color: transparent; - - `; - EGt.div` - position: absolute; - - bottom: 14px; - - left: 50%; - - transform: translate(-50%, 0); - - - display: flex; - - gap: 6px; - - align-items: center; - - border-radius: 18px; - - min-width: 126px; - - padding: 9px 16px 9px 10px; - - - filter: drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.08)); - - background-color: ${ - t=>t.theme.colors.background.segment} - ; - - `; - var BFt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{ - } - ; - function UFt(t){ - var i=t.default; - if("function"==typeof i){ - var s=Qt(function(){ - return i.apply(this,arguments)} - ,"a2"); - s.prototype=i.prototype} - else s={ - } - ; - return Object.defineProperty(s,"__esModule",{ - value:!0} - ),Object.keys(t).forEach(function(i){ - var e=Object.getOwnPropertyDescriptor(t,i); - Object.defineProperty(s,i,e.get?e:{ - enumerable:!0,get:Qt(function(){ - return t[i]} - ,"get")} - )} - ),s} - Qt(UFt,"getAugmentedNamespace"); - var FFt={ - exports:{ - } - } - ; - !function(t){ - var i=function(){ - var t=Qt(function(t,i){ - var s=t,e=r[i],n=null,h=0,a=null,g=[],m={ - } - ,v=Qt(function(t,i){ - n=function(t){ - for(var i=new Array(t),s=0; - s<t; - s+=1){ - i[s]=new Array(t); - for(var e=0; - e<t; - e+=1)i[s][e]=null} - return i} - (h=4*s+17),_(0,0),_(h-7,0),_(0,h-7),E(),y(),S(t,i),s>=7&&A(t),null==a&&(a=O(s,e,g)),T(a,i)} - ,"makeImpl"),_=Qt(function(t,i){ - for(var s=-1; - s<=7; - s+=1)if(!(t+s<=-1||h<=t+s))for(var e=-1; - e<=7; - e+=1)i+e<=-1||h<=i+e||(n[t+s][i+e]=0<=s&&s<=6&&(0==e||6==e)||0<=e&&e<=6&&(0==s||6==s)||2<=s&&s<=4&&2<=e&&e<=4)} - ,"setupPositionProbePattern"),b=Qt(function(){ - for(var t=0,i=0,s=0; - s<8; - s+=1){ - v(!0,s); - var e=o.getLostPoint(m); - (0==s||t>e)&&(t=e,i=s)} - return i} - ,"getBestMaskPattern"),y=Qt(function(){ - for(var t=8; - t<h-8; - t+=1)null==n[t][6]&&(n[t][6]=t%2==0); - for(var i=8; - i<h-8; - i+=1)null==n[6][i]&&(n[6][i]=i%2==0)} - ,"setupTimingPattern"),E=Qt(function(){ - for(var t=o.getPatternPosition(s),i=0; - i<t.length; - i+=1)for(var e=0; - e<t.length; - e+=1){ - var h=t[i],r=t[e]; - if(null==n[h][r])for(var a=-2; - a<=2; - a+=1)for(var c=-2; - c<=2; - c+=1)n[h+a][r+c]=-2==a||2==a||-2==c||2==c||0==a&&0==c} - } - ,"setupPositionAdjustPattern"),A=Qt(function(t){ - for(var i=o.getBCHTypeNumber(s),e=0; - e<18; - e+=1){ - var r=!t&&1==(i>>e&1); - n[Math.floor(e/3)][e%3+h-8-3]=r} - for(e=0; - e<18; - e+=1)r=!t&&1==(i>>e&1),n[e%3+h-8-3][Math.floor(e/3)]=r} - ,"setupTypeNumber"),S=Qt(function(t,i){ - for(var s=e<<3|i,r=o.getBCHTypeInfo(s),a=0; - a<15; - a+=1){ - var c=!t&&1==(r>>a&1); - a<6?n[a][8]=c:a<8?n[a+1][8]=c:n[h-15+a][8]=c} - for(a=0; - a<15; - a+=1)c=!t&&1==(r>>a&1),a<8?n[8][h-a-1]=c:a<9?n[8][15-a-1+1]=c:n[8][15-a-1]=c; - n[h-8][8]=!t} - ,"setupTypeInfo"),T=Qt(function(t,i){ - for(var s=-1,e=h-1,r=7,a=0,c=o.getMaskFunction(i),l=h-1; - l>0; - l-=2)for(6==l&&(l-=1); - ; - ){ - for(var u=0; - u<2; - u+=1)if(null==n[e][l-u]){ - var d=!1; - a<t.length&&(d=1==(t[a]>>>r&1)),c(e,l-u)&&(d=!d),n[e][l-u]=d,-1==(r-=1)&&(a+=1,r=7)} - if((e+=s)<0||h<=e){ - e-=s,s=-s; - break} - } - } - ,"mapData"),C=Qt(function(t,i){ - for(var s=0,e=0,n=0,h=new Array(i.length),r=new Array(i.length),a=0; - a<i.length; - a+=1){ - var l=i[a].dataCount,u=i[a].totalCount-l; - e=Math.max(e,l),n=Math.max(n,u),h[a]=new Array(l); - for(var d=0; - d<h[a].length; - d+=1)h[a][d]=255&t.getBuffer()[d+s]; - s+=l; - var f=o.getErrorCorrectPolynomial(u),p=c(h[a],f.getLength()-1).mod(f); - for(r[a]=new Array(f.getLength()-1),d=0; - d<r[a].length; - d+=1){ - var w=d+p.getLength()-r[a].length; - r[a][d]=w>=0?p.getAt(w):0} - } - var g=0; - for(d=0; - d<i.length; - d+=1)g+=i[d].totalCount; - var m=new Array(g),v=0; - for(d=0; - d<e; - d+=1)for(a=0; - a<i.length; - a+=1)d<h[a].length&&(m[v]=h[a][d],v+=1); - for(d=0; - d<n; - d+=1)for(a=0; - a<i.length; - a+=1)d<r[a].length&&(m[v]=r[a][d],v+=1); - return m} - ,"createBytes"),O=Qt(function(t,i,s){ - for(var e=l.getRSBlocks(t,i),n=u(),h=0; - h<s.length; - h+=1){ - var r=s[h]; - n.put(r.getMode(),4),n.put(r.getLength(),o.getLengthInBits(r.getMode(),t)),r.write(n)} - var a=0; - for(h=0; - h<e.length; - h+=1)a+=e[h].dataCount; - if(n.getLengthInBits()>8*a)throw"code length overflow. ("+n.getLengthInBits()+">"+8*a+")"; - for(n.getLengthInBits()+4<=8*a&&n.put(0,4); - n.getLengthInBits()%8!=0; - )n.putBit(!1); - for(; - !(n.getLengthInBits()>=8*a||(n.put(236,8),n.getLengthInBits()>=8*a)); - )n.put(17,8); - return C(n,e)} - ,"createData"); - m.addData=function(t,i){ - var s=null; - switch(i=i||"Byte"){ - case"Numeric":s=d(t); - break; - case"Alphanumeric":s=f(t); - break; - case"Byte":s=p(t); - break; - case"Kanji":s=w(t); - break; - default:throw"mode:"+i} - g.push(s),a=null} - ,m.isDark=function(t,i){ - if(t<0||h<=t||i<0||h<=i)throw t+","+i; - return n[t][i]} - ,m.getModuleCount=function(){ - return h} - ,m.make=function(){ - if(s<1){ - for(var t=1; - t<40; - t++){ - for(var i=l.getRSBlocks(t,e),n=u(),h=0; - h<g.length; - h++){ - var r=g[h]; - n.put(r.getMode(),4),n.put(r.getLength(),o.getLengthInBits(r.getMode(),t)),r.write(n)} - var a=0; - for(h=0; - h<i.length; - h++)a+=i[h].dataCount; - if(n.getLengthInBits()<=8*a)break} - s=t} - v(!1,b())} - ,m.createTableTag=function(t,i){ - t=t||2; - var s=""; - s+='<table style="',s+=" border-width: 0px; - border-style: none; - ",s+=" border-collapse: collapse; - ",s+=" padding: 0px; - margin: "+(i=void 0===i?4*t:i)+"px; - ",s+='">',s+="<tbody>"; - for(var e=0; - e<m.getModuleCount(); - e+=1){ - s+="<tr>"; - for(var n=0; - n<m.getModuleCount(); - n+=1)s+='<td style="',s+=" border-width: 0px; - border-style: none; - ",s+=" border-collapse: collapse; - ",s+=" padding: 0px; - margin: 0px; - ",s+=" width: "+t+"px; - ",s+=" height: "+t+"px; - ",s+=" background-color: ",s+=m.isDark(e,n)?"#000000":"#ffffff",s+="; - ",s+='"/>'; - s+="</tr>"} - return(s+="</tbody>")+"</table>"} - ,m.createSvgTag=function(t,i,s,e){ - var n={ - } - ; - "object"==typeof arguments[0]&&(t=(n=arguments[0]).cellSize,i=n.margin,s=n.alt,e=n.title),t=t||2,i=void 0===i?4*t:i,(s="string"==typeof s?{ - text:s} - :s||{ - } - ).text=s.text||null,s.id=s.text?s.id||"qrcode-description":null,(e="string"==typeof e?{ - text:e} - :e||{ - } - ).text=e.text||null,e.id=e.text?e.id||"qrcode-title":null; - var h,r,o,a,c=m.getModuleCount()*t+2*i,l=""; - for(a="l"+t+",0 0,"+t+" -"+t+",0 0,-"+t+"z ",l+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',l+=n.scalable?"":' width="'+c+'px" height="'+c+'px"',l+=' viewBox="0 0 '+c+" "+c+'" ',l+=' preserveAspectRatio="xMinYMin meet"',l+=e.text||s.text?' role="img" aria-labelledby="'+I([e.id,s.id].join(" ").trim())+'"':"",l+=">",l+=e.text?'<title id="'+I(e.id)+'">'+I(e.text)+"</title>":"",l+=s.text?'<description id="'+I(s.id)+'">'+I(s.text)+"</description>":"",l+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',l+='<path d="',r=0; - r<m.getModuleCount(); - r+=1)for(o=r*t+i,h=0; - h<m.getModuleCount(); - h+=1)m.isDark(r,h)&&(l+="M"+(h*t+i)+","+o+a); - return(l+='" stroke="transparent" fill="black"/>')+"</svg>"} - ,m.createDataURL=function(t,i){ - t=t||2,i=void 0===i?4*t:i; - var s=m.getModuleCount()*t+2*i,e=i,n=s-i; - return M(s,s,function(i,s){ - if(e<=i&&i<n&&e<=s&&s<n){ - var h=Math.floor((i-e)/t),r=Math.floor((s-e)/t); - return m.isDark(r,h)?0:1} - return 1} - )} - ,m.createImgTag=function(t,i,s){ - t=t||2,i=void 0===i?4*t:i; - var e=m.getModuleCount()*t+2*i,n=""; - return n+="<img",n+=' src="',n+=m.createDataURL(t,i),n+='"',n+=' width="',n+=e,n+='"',n+=' height="',n+=e,n+='"',s&&(n+=' alt="',n+=I(s),n+='"'),n+"/>"} - ; - var I=Qt(function(t){ - for(var i="",s=0; - s<t.length; - s+=1){ - var e=t.charAt(s); - switch(e){ - case"<":i+="< - "; - break; - case">":i+="> - "; - break; - case"&":i+="& - "; - break; - case'"':i+="" - "; - break; - default:i+=e} - } - return i} - ,"escapeXml"),k=Qt(function(t){ - t=void 0===t?2:t; - var i,s,e,n,h,r=1*m.getModuleCount()+2*t,o=t,a=r-t,c={ - "██":"█","█ ":"▀"," █":"▄"," ":" "} - ,l={ - "██":"▀","█ ":"▀"," █":" "," ":" "} - ,u=""; - for(i=0; - i<r; - i+=2){ - for(e=Math.floor((i-o)/1),n=Math.floor((i+1-o)/1),s=0; - s<r; - s+=1)h="█",o<=s&&s<a&&o<=i&&i<a&&m.isDark(e,Math.floor((s-o)/1))&&(h=" "),o<=s&&s<a&&o<=i+1&&i+1<a&&m.isDark(n,Math.floor((s-o)/1))?h+=" ":h+="█",u+=t<1&&i+1>=a?l[h]:c[h]; - u+="\n"} - return r%2&&t>0?u.substring(0,u.length-r-1)+Array(r+1).join("▀"):u.substring(0,u.length-1)} - ,"_createHalfASCII"); - return m.createASCII=function(t,i){ - if((t=t||1)<2)return k(i); - t-=1,i=void 0===i?2*t:i; - var s,e,n,h,r=m.getModuleCount()*t+2*i,o=i,a=r-i,c=Array(t+1).join("██"),l=Array(t+1).join(" "),u="",d=""; - for(s=0; - s<r; - s+=1){ - for(n=Math.floor((s-o)/t),d="",e=0; - e<r; - e+=1)h=1,o<=e&&e<a&&o<=s&&s<a&&m.isDark(n,Math.floor((e-o)/t))&&(h=0),d+=h?c:l; - for(n=0; - n<t; - n+=1)u+=d+"\n"} - return u.substring(0,u.length-1)} - ,m.renderTo2dContext=function(t,i){ - i=i||2; - for(var s=m.getModuleCount(),e=0; - e<s; - e++)for(var n=0; - n<s; - n++)t.fillStyle=m.isDark(e,n)?"black":"white",t.fillRect(e*i,n*i,i,i)} - ,m} - ,"qrcode3"); - t.stringToBytesFuncs={ - default:Qt(function(t){ - for(var i=[],s=0; - s<t.length; - s+=1){ - var e=t.charCodeAt(s); - i.push(255&e)} - return i} - ,"default")} - ,t.stringToBytes=t.stringToBytesFuncs.default,t.createStringToBytes=function(t,i){ - var s=function(){ - for(var s=v(t),e=Qt(function(){ - var t=s.read(); - if(-1==t)throw"eof"; - return t} - ,"read"),n=0,h={ - } - ; - ; - ){ - var r=s.read(); - if(-1==r)break; - var o=e(),a=e()<<8|e(); - h[String.fromCharCode(r<<8|o)]=a,n+=1} - if(n!=i)throw n+" != "+i; - return h} - (),e="?".charCodeAt(0); - return function(t){ - for(var i=[],n=0; - n<t.length; - n+=1){ - var h=t.charCodeAt(n); - if(h<128)i.push(h); - else{ - var r=s[t.charAt(n)]; - "number"==typeof r?(255&r)==r?i.push(r):(i.push(r>>>8),i.push(255&r)):i.push(e)} - } - return i} - } - ; - var i,s,e,n,h,r={ - L:1,M:0,Q:3,H:2} - ,o=(i=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],s=1335,e=7973,n={ - } - ,h=Qt(function(t){ - for(var i=0; - 0!=t; - )i+=1,t>>>=1; - return i} - ,"getBCHDigit"),n.getBCHTypeInfo=function(t){ - for(var i=t<<10; - h(i)-h(s)>=0; - )i^=s<<h(i)-h(s); - return 21522^(t<<10|i)} - ,n.getBCHTypeNumber=function(t){ - for(var i=t<<12; - h(i)-h(e)>=0; - )i^=e<<h(i)-h(e); - return t<<12|i} - ,n.getPatternPosition=function(t){ - return i[t-1]} - ,n.getMaskFunction=function(t){ - switch(t){ - case 0:return function(t,i){ - return(t+i)%2==0} - ; - case 1:return function(t,i){ - return t%2==0} - ; - case 2:return function(t,i){ - return i%3==0} - ; - case 3:return function(t,i){ - return(t+i)%3==0} - ; - case 4:return function(t,i){ - return(Math.floor(t/2)+Math.floor(i/3))%2==0} - ; - case 5:return function(t,i){ - return t*i%2+t*i%3==0} - ; - case 6:return function(t,i){ - return(t*i%2+t*i%3)%2==0} - ; - case 7:return function(t,i){ - return(t*i%3+(t+i)%2)%2==0} - ; - default:throw"bad maskPattern:"+t} - } - ,n.getErrorCorrectPolynomial=function(t){ - for(var i=c([1],0),s=0; - s<t; - s+=1)i=i.multiply(c([1,a.gexp(s)],0)); - return i} - ,n.getLengthInBits=function(t,i){ - if(1<=i&&i<10)switch(t){ - case 1:return 10; - case 2:return 9; - case 4:case 8:return 8; - default:throw"mode:"+t} - else if(i<27)switch(t){ - case 1:return 12; - case 2:return 11; - case 4:return 16; - case 8:return 10; - default:throw"mode:"+t} - else{ - if(!(i<41))throw"type:"+i; - switch(t){ - case 1:return 14; - case 2:return 13; - case 4:return 16; - case 8:return 12; - default:throw"mode:"+t} - } - } - ,n.getLostPoint=function(t){ - for(var i=t.getModuleCount(),s=0,e=0; - e<i; - e+=1)for(var n=0; - n<i; - n+=1){ - for(var h=0,r=t.isDark(e,n),o=-1; - o<=1; - o+=1)if(!(e+o<0||i<=e+o))for(var a=-1; - a<=1; - a+=1)n+a<0||i<=n+a||0==o&&0==a||r==t.isDark(e+o,n+a)&&(h+=1); - h>5&&(s+=3+h-5)} - for(e=0; - e<i-1; - e+=1)for(n=0; - n<i-1; - n+=1){ - var c=0; - t.isDark(e,n)&&(c+=1),t.isDark(e+1,n)&&(c+=1),t.isDark(e,n+1)&&(c+=1),t.isDark(e+1,n+1)&&(c+=1),0!=c&&4!=c||(s+=3)} - for(e=0; - e<i; - e+=1)for(n=0; - n<i-6; - n+=1)t.isDark(e,n)&&!t.isDark(e,n+1)&&t.isDark(e,n+2)&&t.isDark(e,n+3)&&t.isDark(e,n+4)&&!t.isDark(e,n+5)&&t.isDark(e,n+6)&&(s+=40); - for(n=0; - n<i; - n+=1)for(e=0; - e<i-6; - e+=1)t.isDark(e,n)&&!t.isDark(e+1,n)&&t.isDark(e+2,n)&&t.isDark(e+3,n)&&t.isDark(e+4,n)&&!t.isDark(e+5,n)&&t.isDark(e+6,n)&&(s+=40); - var l=0; - for(n=0; - n<i; - n+=1)for(e=0; - e<i; - e+=1)t.isDark(e,n)&&(l+=1); - return s+Math.abs(100*l/i/i-50)/5*10} - ,n),a=function(){ - for(var t=new Array(256),i=new Array(256),s=0; - s<8; - s+=1)t[s]=1<<s; - for(s=8; - s<256; - s+=1)t[s]=t[s-4]^t[s-5]^t[s-6]^t[s-8]; - for(s=0; - s<255; - s+=1)i[t[s]]=s; - var e={ - glog:function(t){ - if(t<1)throw"glog("+t+")"; - return i[t]} - ,gexp:function(i){ - for(; - i<0; - )i+=255; - for(; - i>=256; - )i-=255; - return t[i]} - } - ; - return e} - (); - function c(t,i){ - if(void 0===t.length)throw t.length+"/"+i; - var s=function(){ - for(var s=0; - s<t.length&&0==t[s]; - )s+=1; - for(var e=new Array(t.length-s+i),n=0; - n<t.length-s; - n+=1)e[n]=t[n+s]; - return e} - (),e={ - getAt:function(t){ - return s[t]} - ,getLength:function(){ - return s.length} - ,multiply:function(t){ - for(var i=new Array(e.getLength()+t.getLength()-1),s=0; - s<e.getLength(); - s+=1)for(var n=0; - n<t.getLength(); - n+=1)i[s+n]^=a.gexp(a.glog(e.getAt(s))+a.glog(t.getAt(n))); - return c(i,0)} - ,mod:function(t){ - if(e.getLength()-t.getLength()<0)return e; - for(var i=a.glog(e.getAt(0))-a.glog(t.getAt(0)),s=new Array(e.getLength()),n=0; - n<e.getLength(); - n+=1)s[n]=e.getAt(n); - for(n=0; - n<t.getLength(); - n+=1)s[n]^=a.gexp(a.glog(t.getAt(n))+i); - return c(s,0).mod(t)} - } - ; - return e} - Qt(c,"qrPolynomial"); - var l=function(){ - var t=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],i=Qt(function(t,i){ - var s={ - } - ; - return s.totalCount=t,s.dataCount=i,s} - ,"qrRSBlock"),s={ - } - ,e=Qt(function(i,s){ - switch(s){ - case r.L:return t[4*(i-1)+0]; - case r.M:return t[4*(i-1)+1]; - case r.Q:return t[4*(i-1)+2]; - case r.H:return t[4*(i-1)+3]; - default:return} - } - ,"getRsBlockTable"); - return s.getRSBlocks=function(t,s){ - var n=e(t,s); - if(void 0===n)throw"bad rs block @ typeNumber:"+t+"/errorCorrectionLevel:"+s; - for(var h=n.length/3,r=[],o=0; - o<h; - o+=1)for(var a=n[3*o+0],c=n[3*o+1],l=n[3*o+2],u=0; - u<a; - u+=1)r.push(i(c,l)); - return r} - ,s} - (),u=Qt(function(){ - var t=[],i=0,s={ - getBuffer:function(){ - return t} - ,getAt:function(i){ - var s=Math.floor(i/8); - return 1==(t[s]>>>7-i%8&1)} - ,put:function(t,i){ - for(var e=0; - e<i; - e+=1)s.putBit(1==(t>>>i-e-1&1))} - ,getLengthInBits:function(){ - return i} - ,putBit:function(s){ - var e=Math.floor(i/8); - t.length<=e&&t.push(0),s&&(t[e]|=128>>>i%8),i+=1} - } - ; - return s} - ,"qrBitBuffer"),d=Qt(function(t){ - var i=t,s={ - getMode:function(){ - return 1} - ,getLength:function(t){ - return i.length} - ,write:function(t){ - for(var s=i,n=0; - n+2<s.length; - )t.put(e(s.substring(n,n+3)),10),n+=3; - n<s.length&&(s.length-n==1?t.put(e(s.substring(n,n+1)),4):s.length-n==2&&t.put(e(s.substring(n,n+2)),7))} - } - ,e=Qt(function(t){ - for(var i=0,s=0; - s<t.length; - s+=1)i=10*i+n(t.charAt(s)); - return i} - ,"strToNum"),n=Qt(function(t){ - if("0"<=t&&t<="9")return t.charCodeAt(0)-"0".charCodeAt(0); - throw"illegal char :"+t} - ,"chatToNum"); - return s} - ,"qrNumber"),f=Qt(function(t){ - var i=t,s={ - getMode:function(){ - return 2} - ,getLength:function(t){ - return i.length} - ,write:function(t){ - for(var s=i,n=0; - n+1<s.length; - )t.put(45*e(s.charAt(n))+e(s.charAt(n+1)),11),n+=2; - n<s.length&&t.put(e(s.charAt(n)),6)} - } - ,e=Qt(function(t){ - if("0"<=t&&t<="9")return t.charCodeAt(0)-"0".charCodeAt(0); - if("A"<=t&&t<="Z")return t.charCodeAt(0)-"A".charCodeAt(0)+10; - switch(t){ - case" ":return 36; - case"$":return 37; - case"%":return 38; - case"*":return 39; - case"+":return 40; - case"-":return 41; - case".":return 42; - case"/":return 43; - case":":return 44; - default:throw"illegal char :"+t} - } - ,"getCode"); - return s} - ,"qrAlphaNum"),p=Qt(function(i){ - var s=t.stringToBytes(i); - return{ - getMode:function(){ - return 4} - ,getLength:function(t){ - return s.length} - ,write:function(t){ - for(var i=0; - i<s.length; - i+=1)t.put(s[i],8)} - } - } - ,"qr8BitByte"),w=Qt(function(i){ - var s=t.stringToBytesFuncs.SJIS; - if(!s)throw"sjis not supported."; - !function(){ - var t=s("友"); - if(2!=t.length||38726!=(t[0]<<8|t[1]))throw"sjis not supported."} - (); - var e=s(i),n={ - getMode:function(){ - return 8} - ,getLength:function(t){ - return~~(e.length/2)} - ,write:function(t){ - for(var i=e,s=0; - s+1<i.length; - ){ - var n=(255&i[s])<<8|255&i[s+1]; - if(33088<=n&&n<=40956)n-=33088; - else{ - if(!(57408<=n&&n<=60351))throw"illegal char at "+(s+1)+"/"+n; - n-=49472} - n=192*(n>>>8&255)+(255&n),t.put(n,13),s+=2} - if(s<i.length)throw"illegal char at "+(s+1)} - } - ; - return n} - ,"qrKanji"),g=Qt(function(){ - var t=[],i={ - writeByte:function(i){ - t.push(255&i)} - ,writeShort:function(t){ - i.writeByte(t),i.writeByte(t>>>8)} - ,writeBytes:function(t,s,e){ - s=s||0,e=e||t.length; - for(var n=0; - n<e; - n+=1)i.writeByte(t[n+s])} - ,writeString:function(t){ - for(var s=0; - s<t.length; - s+=1)i.writeByte(t.charCodeAt(s))} - ,toByteArray:function(){ - return t} - ,toString:function(){ - var i=""; - i+="["; - for(var s=0; - s<t.length; - s+=1)s>0&&(i+=","),i+=t[s]; - return i+"]"} - } - ; - return i} - ,"byteArrayOutputStream"),m=Qt(function(){ - var t=0,i=0,s=0,e="",n={ - } - ,h=Qt(function(t){ - e+=String.fromCharCode(r(63&t))} - ,"writeEncoded"),r=Qt(function(t){ - if(t<0); - else{ - if(t<26)return 65+t; - if(t<52)return t-26+97; - if(t<62)return t-52+48; - if(62==t)return 43; - if(63==t)return 47} - throw"n:"+t} - ,"encode"); - return n.writeByte=function(e){ - for(t=t<<8|255&e,i+=8,s+=1; - i>=6; - )h(t>>>i-6),i-=6} - ,n.flush=function(){ - if(i>0&&(h(t<<6-i),t=0,i=0),s%3!=0)for(var n=3-s%3,r=0; - r<n; - r+=1)e+="="} - ,n.toString=function(){ - return e} - ,n} - ,"base64EncodeOutputStream"),v=Qt(function(t){ - var i=t,s=0,e=0,n=0,h={ - read:function(){ - for(; - n<8; - ){ - if(s>=i.length){ - if(0==n)return-1; - throw"unexpected end of file./"+n} - var t=i.charAt(s); - if(s+=1,"="==t)return n=0,-1; - t.match(/^\s$/)||(e=e<<6|r(t.charCodeAt(0)),n+=6)} - var h=e>>>n-8&255; - return n-=8,h} - } - ,r=Qt(function(t){ - if(65<=t&&t<=90)return t-65; - if(97<=t&&t<=122)return t-97+26; - if(48<=t&&t<=57)return t-48+52; - if(43==t)return 62; - if(47==t)return 63; - throw"c:"+t} - ,"decode"); - return h} - ,"base64DecodeInputStream"),_=Qt(function(t,i){ - var s=t,e=i,n=new Array(t*i),h={ - setPixel:function(t,i,e){ - n[i*s+t]=e} - ,write:function(t){ - t.writeString("GIF87a"),t.writeShort(s),t.writeShort(e),t.writeByte(128),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(255),t.writeByte(255),t.writeByte(255),t.writeString(","),t.writeShort(0),t.writeShort(0),t.writeShort(s),t.writeShort(e),t.writeByte(0); - var i=o(2); - t.writeByte(2); - for(var n=0; - i.length-n>255; - )t.writeByte(255),t.writeBytes(i,n,255),n+=255; - t.writeByte(i.length-n),t.writeBytes(i,n,i.length-n),t.writeByte(0),t.writeString("; - ")} - } - ,r=Qt(function(t){ - var i=t,s=0,e=0; - return{ - write:function(t,n){ - if(t>>>n!=0)throw"length over"; - for(; - s+n>=8; - )i.writeByte(255&(t<<s|e)),n-=8-s,t>>>=8-s,e=0,s=0; - e|=t<<s,s+=n} - ,flush:function(){ - s>0&&i.writeByte(e)} - } - } - ,"bitOutputStream"),o=Qt(function(t){ - for(var i=1<<t,s=1+(1<<t),e=t+1,h=a(),o=0; - o<i; - o+=1)h.add(String.fromCharCode(o)); - h.add(String.fromCharCode(i)),h.add(String.fromCharCode(s)); - var c=g(),l=r(c); - l.write(i,e); - var u=0,d=String.fromCharCode(n[u]); - for(u+=1; - u<n.length; - ){ - var f=String.fromCharCode(n[u]); - u+=1,h.contains(d+f)?d+=f:(l.write(h.indexOf(d),e),h.size()<4095&&(h.size()==1<<e&&(e+=1),h.add(d+f)),d=f)} - return l.write(h.indexOf(d),e),l.write(s,e),l.flush(),c.toByteArray()} - ,"getLZWRaster"),a=Qt(function(){ - var t={ - } - ,i=0,s={ - add:function(e){ - if(s.contains(e))throw"dup key:"+e; - t[e]=i,i+=1} - ,size:function(){ - return i} - ,indexOf:function(i){ - return t[i]} - ,contains:function(i){ - return void 0!==t[i]} - } - ; - return s} - ,"lzwTable"); - return h} - ,"gifImage"),M=Qt(function(t,i,s){ - for(var e=_(t,i),n=0; - n<i; - n+=1)for(var h=0; - h<t; - h+=1)e.setPixel(h,n,s(h,n)); - var r=g(); - e.write(r); - for(var o=m(),a=r.toByteArray(),c=0; - c<a.length; - c+=1)o.writeByte(a[c]); - return o.flush(),"data:image/gif; - base64,"+o} - ,"createDataURL"); - return t} - (); - i.stringToBytesFuncs["UTF-8"]=function(t){ - function i(t){ - for(var i=[],s=0; - s<t.length; - s++){ - var e=t.charCodeAt(s); - e<128?i.push(e):e<2048?i.push(192|e>>6,128|63&e):e<55296||e>=57344?i.push(224|e>>12,128|e>>6&63,128|63&e):(s++,e=65536+((1023&e)<<10|1023&t.charCodeAt(s)),i.push(240|e>>18,128|e>>12&63,128|e>>6&63,128|63&e))} - return i} - return Qt(i,"toUTF8Array"),i(t)} - ,t.exports=i} - (FFt); - const $Ft=FFt.exports; - var HFt=GDt("<div>"); - const WFt=Qt(t=>{ - let i,s,e; - LLt(!1); - const[n,h]=LLt(54); - return BLt(()=>{ - const n=$Ft(0,"M"); - if(n.addData(t.sourceUrl),n.make(),i){ - const t=n.getModuleCount(),r=5*t,o=bGt().theme==gLt.DARK?"white":"black",a=Qt((i,s)=>i<7&&s<7||i<7&&s>=t-7||i>=t-7&&s<7,"isPositioningPoint"),c=5*t,l=Math.round(270/c*1e5)/1e5,u=Qt(i=>{ - const s=Math.ceil(56/(5*i)); - return{ - sizeCells:s,offsetCells:Math.ceil((t-s)/2)} - } - ,"calculateImageCells"),d=Qt((i,s)=>{ - const{ - sizeCells:e} - =u(l),n=Math.floor(t/2),h=(e+3)/2; - return Math.sqrt(Math.pow(i-n,2)+Math.pow(s-n,2))<=h} - ,"isNearCenterImage"); - let f=`<svg width="${ - r} - " height="${ - r} - " viewBox="0 0 ${ - r} - ${ - r} - " fill="none" xmlns="http://www.w3.org/2000/svg">`; - const p=Qt((t,i)=>{ - f+=`<rect \n x="${ - 5*i} - " \n y="${ - 5*t} - " \n width="35" \n height="5" \n fill="${ - o} - "\n rx="4"\n />`,f+=`<rect \n x="${ - 5*i} - " \n y="${ - 5*(t+6)} - " \n width="35" \n height="5" \n fill="${ - o} - "\n rx="4"\n />`,f+=`<rect \n x="${ - 5*i} - " \n y="${ - 5*t} - " \n width="5" \n height="35" \n fill="${ - o} - "\n rx="4"\n />`,f+=`<rect \n x="${ - 5*(i+6)} - " \n y="${ - 5*t} - " \n width="5" \n height="35" \n fill="${ - o} - "\n rx="4"\n />`,f+=`<rect \n x="${ - 5*(i+2)} - " \n y="${ - 5*(t+2)} - " \n width="15" \n height="15" \n rx="4"\n fill="${ - o} - "\n />`} - ,"drawPositioningPattern"); - p(0,0),p(0,t-7),p(t-7,0); - const w=Qt((t,i)=>`<rect \n x="${ - t+.375} - " \n y="${ - i+.375} - " \n width="4.25" \n height="4.25" \n rx="${ - 4.25/3} - "\n fill="${ - o} - "\n />`,"drawDataPoint"); - for(let i=0; - i<t; - i++)for(let s=0; - s<t; - s++)!n.isDark(i,s)||a(i,s)||d(i,s)||(f+=w(5*s,5*i)); - if(f+="</svg>",i.innerHTML=f,e){ - const{ - sizeCells:t,offsetCells:i} - =u(l),s=5*t,n=5*i; - e.style.top=xGt(n),e.style.left=xGt(n),e.style.height=xGt(s),e.style.width=xGt(s),h(Math.round(54/l))} - s&&(s.style.transform=`scale(${ - l} - )`)} - } - ),pDt(NFt,{ - get class(){ - return t.class} - ,get children(){ - return[pDt(LFt,{ - ref(t){ - "function"==typeof s?s(t):s=t} - ,get children(){ - return[(s=HFt(),"function"==typeof i?zDt(i,s):i=s,s),pDt(EDt,{ - get when(){ - return t.imageUrl} - ,get children(){ - return pDt(DFt,{ - ref(t){ - "function"==typeof e?e(t):e=t} - ,get children(){ - return pDt(GFt,{ - get src(){ - return t.imageUrl} - ,alt:"",get size(){ - return n()} - } - )} - } - )} - } - )]; - var s} - } - ),pDt(DUt,{ - onBeforeEnter:Qt(t=>{ - OFt(t,[{ - opacity:0,transform:"translate(-50%, 44px)"} - ,{ - opacity:1,transform:"translate(-50%, 0)"} - ],{ - duration:150,easing:"ease-out"} - )} - ,"onBeforeEnter"),onExit:Qt((t,i)=>{ - OFt(t,[{ - opacity:1,transform:"translate(-50%, 0)"} - ,{ - opacity:0,transform:"translate(-50%, 44px)"} - ],{ - duration:150,easing:"ease-out"} - ).finished.then(()=>{ - i()} - )} - ,"onExit")} - )]} - } - )} - ,"QRCode"); - function VFt(t,i,s){ - const e=t[i]||i.trim().split(".").reduce((t,i)=>t?t[i]:void 0,t); - return void 0!==e?e:s} - Qt(VFt,"deepReadObject"); - var jFt=Qt((t,i,s=/{ - { - ([^{ - } - ]+)} - } - /g)=>t.replace(s,(t,s)=>VFt(i,s,"")),"template"),KFt=Qt((t={ - } - ,i=("undefined"!=typeof navigator&&navigator.language in t?navigator.language:(i=>null!=(i=Object.keys(t)[0])?i:"")()))=>{ - const[s,e]=LLt(i),[n,h]=bBt(t),r=Qt((t,i,e)=>{ - const h=VFt(n[s()],t,e||""); - return"function"==typeof h?h(i):"string"==typeof h?jFt(h,i||{ - } - ):h} - ,"translate"),o={ - add(t,i){ - h(t,t=>Object.assign(t||{ - } - ,i))} - ,locale:Qt(t=>t?e(t):s(),"locale"),dict:Qt(t=>VFt(n,t),"dict")} - ; - return[r,o]} - ,"createI18nContext"),zFt=jLt({ - } - ),YFt=Qt(()=>KLt(zFt),"useI18n"); - const qFt=EGt.div` - font-style: normal; - - font-weight: ${ - t=>t.fontWeight} - ; - - font-size: ${ - t=>t.fontSize} - ; - - line-height: ${ - t=>t.lineHeight} - ; - - - color: ${ - t=>t.color} - ; - - `,XFt=Qt(t=>{ - const i=bGt(),[s]=YFt(); - let e; - const n=Qt(()=>t.color||i.colors.text.primary,"color"),h=_Dt({ - fontSize:"14px",fontWeight:"510",lineHeight:"130%"} - ,t); - return BLt(()=>{ - e&&"unset"!==h.cursor&&"pointer"!==getComputedStyle(e).cursor&&(e.style.cursor="default")} - ),pDt(qFt,{ - get fontSize(){ - return h.fontSize} - ,get fontWeight(){ - return h.fontWeight} - ,get lineHeight(){ - return h.lineHeight} - ,get color(){ - return n()} - ,get class(){ - return h.class} - ,ref(t){ - "function"==typeof e?e(t):e=t} - ,"data-tc-text":"true",get children(){ - var t; - return ULt(()=>!!h.translationKey)()?s(h.translationKey,h.translationValues,null==(t=h.children)?void 0:t.toString()):h.children} - } - )} - ,"Text"),JFt=EGt.div` - position: relative; - - - &::after { - - content: ''; - - display: block; - - position: absolute; - - top: 0; - - bottom: 0; - - left: 0; - - right: 0; - - border: 0.5px solid rgba(0, 0, 0, 0.08); - - - border-radius: inherit; - - } - - `,QFt=EGt(IUt)` - width: 100%; - - height: 100%; - - border-radius: inherit; - - `,ZFt=Qt(t=>pDt(JFt,{ - get class(){ - return t.class} - ,get children(){ - return pDt(QFt,{ - get src(){ - return t.src} - } - )} - } - ),"WalletImage"),t$t={ - m:"16px",s:"12px",none:"0"} - ,i$t={ - m:"6px",s:"6px",none:"0"} - ,s$t=EGt.button` - position: relative; - - cursor: pointer; - - border: none; - - background-color: unset; - - padding: 8px 4px; - - width: 92px; - - display: flex; - - flex-direction: column; - - align-items: center; - - - transition: transform 0.125s ease-in-out; - - - ${ - tBt} - { - - &:hover { - - transform: scale(1.04); - - } - - } - - - &:active { - - transform: scale(0.96); - - } - - - ${ - QGt("mobile")} - { - - padding: 8px 4px; - - width: 82px; - - } - - - ${ - ZGt} - { - - &:active { - - transform: scale(0.92); - - } - - } - - `,e$t=EGt.div` - width: 60px; - - height: 60px; - - position: relative; - - margin-bottom: 8px; - - border-radius: ${ - t=>t$t[t.theme.borderRadius]} - ; - - background-color: ${ - t=>t.theme.colors.background.tint} - ; - - `,n$t=EGt(ZFt)` - width: 60px; - - height: 60px; - - border-radius: ${ - t=>t$t[t.theme.borderRadius]} - ; - - margin-bottom: 8px; - - `,h$t=EGt(IUt)` - position: absolute; - - right: 10px; - - top: 50px; - - width: 24px; - - height: 24px; - - border-radius: ${ - t=>i$t[t.theme.borderRadius]} - ; - - box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.08); - - `,r$t=EGt(XFt)` - max-width: 90px; - - font-weight: 500; - - font-size: 12px; - - white-space: ${ - ({ - allowWrap:t} - )=>t?"normal":"nowrap"} - ; - - text-overflow: ellipsis; - - overflow: hidden; - - word-break: normal; - - overflow-wrap: normal; - - - display: -webkit-box; - - -webkit-line-clamp: 2; - - -webkit-box-orient: vertical; - - - `,o$t=EGt(XFt)` - font-weight: ${ - t=>"500"} - ; - - max-width: 90px; - - font-size: 12px; - - white-space: nowrap; - - text-overflow: ellipsis; - - overflow: hidden; - - color: ${ - t=>t.color} - ; - - - ${ - QGt("mobile")} - { - - max-width: 80px; - - } - - `,a$t=EGt(IUt)` - width: 27px; - - height: 21px; - - object-fit: contain; - - `,c$t=EGt(IUt)` - width: ${ - ({ - width:t} - )=>t} - ; - - height: ${ - ({ - height:t} - )=>t} - ; - - object-fit: contain; - - `; - var l$t=GDt("<div>"); - const u$t=Qt(t=>{ - let i=bGt(); - return pDt(s$t,{ - get class(){ - return t.class} - ,onClick:Qt(()=>t.onClick(),"onClick"),"data-tc-wallet-item":"true",get children(){ - return[ULt(()=>ULt(()=>"string"==typeof t.icon)()?pDt(n$t,{ - get src(){ - return t.icon} - } - ):t.icon),ULt(()=>ULt(()=>!!t.badgeUrl)()&&pDt(h$t,{ - get src(){ - return t.badgeUrl} - } - )),(s=l$t(),zDt(t=>t,s),YDt(s,pDt(r$t,{ - get allowWrap(){ - return t.allowWrap} - ,get children(){ - return t.name} - } - )),s),ULt(()=>ULt(()=>!!t.secondLine)()&&pDt(o$t,{ - get color(){ - return t.secondLineColor||(!1!==t.secondLineColorPrimary?i.colors.text.primary:i.colors.text.secondary)} - ,get children(){ - return t.secondLine} - } - ))]; - var s} - } - )} - ,"WalletItem"),d$t=EGt.h1` - font-style: normal; - - font-weight: 590; - - font-size: 20px; - - line-height: 28px; - - - text-align: center; - - - color: ${ - t=>t.theme.colors.text.primary} - ; - - - margin-top: 0; - - margin-bottom: 0; - - - cursor: default; - - `,f$t=Qt(t=>{ - const[i]=YFt(); - return pDt(d$t,{ - get class(){ - return t.class} - ,"data-tc-h1":"true",get children(){ - var s; - return ULt(()=>!!t.translationKey)()?i(t.translationKey,t.translationValues,null==(s=t.children)?void 0:s.toString()):t.children} - } - )} - ,"H1"),p$t=EGt.h2` - font-style: normal; - - font-weight: 400; - - font-size: 16px; - - line-height: 22px; - - - text-align: center; - - - color: ${ - t=>t.theme.colors.text.secondary} - ; - - - margin-top: 0; - - margin-bottom: 32px; - - - cursor: default; - - `,w$t=Qt(t=>{ - const[i]=YFt(); - return pDt(p$t,{ - get class(){ - return t.class} - ,"data-tc-h2":"true",get children(){ - var s; - return ULt(()=>!!t.translationKey)()?i(t.translationKey,t.translationValues,null==(s=t.children)?void 0:s.toString()):t.children} - } - )} - ,"H2"),g$t=EGt.h3` - font-style: normal; - - font-weight: 510; - - font-size: 16px; - - line-height: 20px; - - - color: ${ - t=>t.theme.colors.text.primary} - ; - - - margin-top: 0; - - margin-bottom: 0; - - - cursor: default; - - `,m$t=Qt(t=>{ - const[i]=YFt(); - return pDt(g$t,{ - "data-tc-h3":"true",get class(){ - return t.class} - ,get children(){ - var s; - return ULt(()=>!!t.translationKey)()?i(t.translationKey,t.translationValues,null==(s=t.children)?void 0:s.toString()):t.children} - } - )} - ,"H3"),v$t={ - m:"16px",s:"12px",none:"0"} - ,_$t=EGt.div` - width: 60px; - - height: 60px; - - padding: 8px; - - margin-bottom: 8px; - - border-radius: ${ - t=>v$t[t.theme.borderRadius]} - ; - - background-color: ${ - t=>t.theme.colors.background.tint} - ; - - display: grid; - - grid-template: 1fr 1fr / 1fr 1fr; - - gap: 4px; - - `; - EGt(ZFt)` - width: 20px; - - height: 20px; - - border-radius: 10px; - - `; - var M$t=GDt('<svg width=100% height=100% viewBox="0 0 21 21"fill=none xmlns=http://www.w3.org/2000/svg><rect x=0.5 y=0.33313 width=20 height=20 rx=10></rect><rect x=4.5 y=4.33313 width=12 height=12 rx=6></rect><path fill-rule=evenodd clip-rule=evenodd d="M7.75 10.3331C7.75 10.8164 7.35825 11.2081 6.875 11.2081C6.39175 11.2081 6 10.8164 6 10.3331C6 9.84988 6.39175 9.45813 6.875 9.45813C7.35825 9.45813 7.75 9.84988 7.75 10.3331ZM11.375 10.3331C11.375 10.8164 10.9832 11.2081 10.5 11.2081C10.0168 11.2081 9.625 10.8164 9.625 10.3331C9.625 9.84988 10.0168 9.45813 10.5 9.45813C10.9832 9.45813 11.375 9.84988 11.375 10.3331ZM14.125 11.2081C14.6082 11.2081 15 10.8164 15 10.3331C15 9.84988 14.6082 9.45813 14.125 9.45813C13.6418 9.45813 13.25 9.84988 13.25 10.3331C13.25 10.8164 13.6418 11.2081 14.125 11.2081Z">'); - const b$t=Qt(t=>{ - const i=bGt(); - NGt(`MoreIcon ${ - i} - `); - const s=Qt(()=>t.fill||i.colors.icon.primary,"fill"),e=Qt(()=>i.theme==gLt.DARK?"#5B5B5B":"#D9D9D9","bgColor"); - return n=M$t(),h=n.firstChild,r=h.nextSibling,o=r.nextSibling,GLt(t=>{ - var i=e(),n=e(),a=s(); - return i!==t.e&&UDt(h,"fill",t.e=i),n!==t.t&&UDt(r,"fill",t.t=n),a!==t.a&&UDt(o,"fill",t.a=a),t} - ,{ - e:void 0,t:void 0,a:void 0} - ),n; - var n,h,r,o} - ,"MoreIcon"); - var y$t=GDt("<div>"); - const E$t=Qt(t=>pDt(u$t,{ - get name(){ - return t.labelLine1} - ,get secondLine(){ - return t.labelLine2} - ,get icon(){ - return pDt(_$t,{ - get children(){ - return pDt(yDt,{ - get each(){ - return t.connectors} - ,children:Qt((i,s)=>{ - const e=s(); - return 3===e&&t.connectors.length>4?((n=y$t()).style.setProperty("width","20px"),n.style.setProperty("height","20px"),YDt(n,pDt(b$t,{ - } - )),n):e>3?null:i.getType()===Mgt.CONNECTOR_TYPE.WS.OKX_TG_WALLET?pDt(pFt,{ - connector:i,height:"20px",width:"20px",innerHeight:"16px",innerWidth:"20px"} - ):pDt(pFt,{ - connector:i,height:"20px",width:"20px",innerHeight:"20px",innerWidth:"20px",borderRadius:"2px"} - ); - var n} - ,"children")} - )} - } - )} - ,allowWrap:!1,onClick:Qt(()=>t.onClick(),"onClick")} - ),"FourWalletsItem"); - var A$t=GDt("<div>"); - const S$t=Qt(t=>{ - if(YFt(),t.wallet.getType()===Mgt.CONNECTOR_TYPE.INJECT.OKX_INJECT_WALLET)return pDt(u$t,{ - get icon(){ - return(i=A$t()).style.setProperty("margin-bottom","8px"),YDt(i,pDt(pFt,{ - get connector(){ - return t.wallet} - } - )),i; - var i} - ,get name(){ - return t.wallet.walletName} - ,secondLine:"Installed",secondLineColorPrimary:!1,onClick:Qt(()=>t.onClick(),"onClick"),get class(){ - return t.class} - } - ); - if(t.wallet.getType()===Mgt.CONNECTOR_TYPE.WS.OKX_TG_WALLET)return pDt(u$t,{ - get icon(){ - return(i=A$t()).style.setProperty("margin-bottom","8px"),YDt(i,pDt(pFt,{ - get connector(){ - return t.wallet} - ,height:"60px",width:"72px",innerHeight:"60px",innerWidth:"72px"} - )),i; - var i} - ,get name(){ - return t.wallet.walletName} - ,allowWrap:!1,onClick:Qt(()=>t.onClick(),"onClick"),get class(){ - return t.class} - } - ); - { - let i=t.wallet.getType()===Mgt.CONNECTOR_TYPE.NOT_INSTALLED?"Download >":"Installed",s=Object.values(Mgt.CONNECTOR_TYPE.INJECT).includes(t.wallet.getType()); - return pDt(u$t,{ - get icon(){ - return(i=A$t()).style.setProperty("margin-bottom","8px"),YDt(i,pDt(pFt,{ - get connector(){ - return t.wallet} - } - )),i; - var i} - ,secondLine:s?i:"",get name(){ - return t.wallet.walletName} - ,secondLineColorPrimary:!1,onClick:Qt(()=>t.onClick(),"onClick"),allowWrap:!s,get class(){ - return t.class} - } - )} - } - ,"WalletLabeledItem"),T$t=EGt.a` - display: block; - - text-decoration: unset; - - `,C$t=Qt(t=>{ - const i=Qt(()=>t.blank?{ - rel:"noreferrer noopener"} - :{ - } - ,"attributes"); - return pDt(T$t,_Dt({ - get href(){ - return t.href} - ,get target(){ - return t.blank?"_blank":"_self"} - ,get class(){ - return t.class} - ,get onClick(){ - return t.onClick} - } - ,i,{ - get children(){ - return t.children} - } - ))} - ,"Link"); - var O$t=GDt('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path fill-rule=evenodd clip-rule=evenodd d="M7.76228 2.09998H10.2378C11.0458 2.09997 11.7067 2.09996 12.2438 2.14384C12.7997 2.18926 13.3017 2.28614 13.7706 2.52505C14.5045 2.89896 15.1011 3.49558 15.475 4.22941C15.7139 4.6983 15.8108 5.20038 15.8562 5.75629C15.9001 6.29337 15.9001 6.95422 15.9001 7.76227V8.1H16.2377C17.0457 8.09999 17.7066 8.09998 18.2437 8.14386C18.7996 8.18928 19.3017 8.28616 19.7705 8.52507C20.5044 8.89898 21.101 9.4956 21.4749 10.2294C21.7138 10.6983 21.8107 11.2004 21.8561 11.7563C21.9 12.2934 21.9 12.9542 21.9 13.7623V16.2377C21.9 17.0458 21.9 17.7066 21.8561 18.2437C21.8107 18.7996 21.7138 19.3017 21.4749 19.7706C21.101 20.5044 20.5044 21.101 19.7705 21.4749C19.3017 21.7138 18.7996 21.8107 18.2437 21.8561C17.7066 21.9 17.0458 21.9 16.2378 21.9H13.7623C12.9543 21.9 12.2934 21.9 11.7563 21.8561C11.2004 21.8107 10.6983 21.7138 10.2294 21.4749C9.49561 21.101 8.89898 20.5044 8.52508 19.7706C8.28616 19.3017 8.18928 18.7996 8.14386 18.2437C8.09998 17.7066 8.09999 17.0458 8.1 16.2377V15.9H7.76227C6.95426 15.9 6.29335 15.9 5.75629 15.8561C5.20038 15.8107 4.6983 15.7138 4.22941 15.4749C3.49558 15.101 2.89896 14.5044 2.52505 13.7705C2.28614 13.3017 2.18926 12.7996 2.14384 12.2437C2.09996 11.7066 2.09997 11.0458 2.09998 10.2377V7.76228C2.09997 6.95424 2.09996 6.29336 2.14384 5.75629C2.18926 5.20038 2.28614 4.6983 2.52505 4.22941C2.89896 3.49558 3.49558 2.89896 4.22941 2.52505C4.6983 2.28614 5.20038 2.18926 5.75629 2.14384C6.29336 2.09996 6.95425 2.09997 7.76228 2.09998ZM8.1 14.1V13.7623C8.09999 12.9542 8.09998 12.2934 8.14386 11.7563C8.18928 11.2004 8.28616 10.6983 8.52508 10.2294C8.89898 9.4956 9.49561 8.89898 10.2294 8.52507C10.6983 8.28616 11.2004 8.18928 11.7563 8.14386C12.2934 8.09998 12.9542 8.09999 13.7623 8.1H14.1001V7.79998C14.1001 6.94505 14.0994 6.35798 14.0622 5.90287C14.0259 5.45827 13.9593 5.21944 13.8712 5.0466C13.6699 4.65146 13.3486 4.3302 12.9535 4.12886C12.7806 4.04079 12.5418 3.97419 12.0972 3.93786C11.6421 3.90068 11.055 3.89998 10.2001 3.89998H7.79998C6.94505 3.89998 6.35798 3.90068 5.90287 3.93786C5.45827 3.97419 5.21944 4.04079 5.0466 4.12886C4.65146 4.3302 4.3302 4.65146 4.12886 5.0466C4.04079 5.21944 3.97419 5.45827 3.93786 5.90287C3.90068 6.35798 3.89998 6.94505 3.89998 7.79998V10.2C3.89998 11.0549 3.90068 11.642 3.93786 12.0971C3.97419 12.5417 4.04079 12.7805 4.12886 12.9534C4.3302 13.3485 4.65146 13.6698 5.0466 13.8711C5.21944 13.9592 5.45827 14.0258 5.90287 14.0621C6.35798 14.0993 6.94505 14.1 7.79998 14.1H8.1ZM11.0466 10.1289C11.2195 10.0408 11.4583 9.97421 11.9029 9.93788C12.358 9.9007 12.9451 9.9 13.8 9.9H16.2C17.0549 9.9 17.642 9.9007 18.0971 9.93788C18.5417 9.97421 18.7805 10.0408 18.9534 10.1289C19.3485 10.3302 19.6698 10.6515 19.8711 11.0466C19.9592 11.2195 20.0258 11.4583 20.0621 11.9029C20.0993 12.358 20.1 12.9451 20.1 13.8V16.2C20.1 17.0549 20.0993 17.642 20.0621 18.0971C20.0258 18.5417 19.9592 18.7805 19.8711 18.9534C19.6698 19.3485 19.3485 19.6698 18.9534 19.8711C18.7805 19.9592 18.5417 20.0258 18.0971 20.0621C17.642 20.0993 17.0549 20.1 16.2 20.1H13.8C12.9451 20.1 12.358 20.0993 11.9029 20.0621C11.4583 20.0258 11.2195 19.9592 11.0466 19.8711C10.6515 19.6698 10.3302 19.3485 10.1289 18.9534C10.0408 18.7805 9.97421 18.5417 9.93788 18.0971C9.9007 17.642 9.9 17.0549 9.9 16.2V13.8C9.9 12.9451 9.9007 12.358 9.93788 11.9029C9.97421 11.4583 10.0408 11.2195 10.1289 11.0466C10.3302 10.6515 10.6515 10.3302 11.0466 10.1289Z">'); - const I$t=Qt(t=>{ - const i=bGt(),s=Qt(()=>t.fill||i.colors.icon.primary,"fill"); - return e=O$t(),n=e.firstChild,GLt(i=>{ - var h=t.class,r=s(); - return h!==i.e&&UDt(e,"class",i.e=h),r!==i.t&&UDt(n,"fill",i.t=r),i} - ,{ - e:void 0,t:void 0} - ),e; - var e,n} - ,"CopyIcon"); - var k$t=GDt('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8.7624 3.10001C7.95435 3.1 7.29349 3.09999 6.75642 3.14387C6.2005 3.18929 5.69842 3.28617 5.22954 3.52508C4.4957 3.89899 3.89908 4.49561 3.52517 5.22944C3.28626 5.69833 3.18938 6.20041 3.14396 6.75632C3.10008 7.2934 3.10009 7.95424 3.1001 8.76229V15.2377C3.10009 16.0458 3.10008 16.7066 3.14396 17.2437C3.18938 17.7996 3.28626 18.3017 3.52517 18.7706C3.89908 19.5044 4.4957 20.101 5.22954 20.4749C5.69842 20.7138 6.2005 20.8107 6.75642 20.8561C7.29349 20.9 7.95434 20.9 8.76239 20.9H12.0001C12.4972 20.9 12.9001 20.4971 12.9001 20C12.9001 19.503 12.4972 19.1 12.0001 19.1H8.8001C7.94517 19.1 7.3581 19.0993 6.90299 19.0621C6.45839 19.0258 6.21956 18.9592 6.04672 18.8711C5.65158 18.6698 5.33032 18.3485 5.12898 17.9534C5.04092 17.7805 4.97431 17.5417 4.93798 17.0971C4.9008 16.642 4.9001 16.0549 4.9001 15.2V8.80001C4.9001 7.94508 4.9008 7.35801 4.93798 6.9029C4.97431 6.4583 5.04092 6.21947 5.12898 6.04663C5.33032 5.65149 5.65158 5.33023 6.04672 5.12889C6.21956 5.04082 6.45839 4.97422 6.90299 4.93789C7.3581 4.90071 7.94517 4.90001 8.8001 4.90001H12.0001C12.4972 4.90001 12.9001 4.49706 12.9001 4.00001C12.9001 3.50295 12.4972 3.10001 12.0001 3.10001H8.7624Z"></path><path d="M17.6364 7.3636C17.2849 7.01212 16.7151 7.01212 16.3636 7.3636C16.0121 7.71507 16.0121 8.28492 16.3636 8.63639L18.8272 11.1H9.00001C8.50295 11.1 8.10001 11.5029 8.10001 12C8.10001 12.497 8.50295 12.9 9.00001 12.9H18.8272L16.3636 15.3636C16.0121 15.7151 16.0121 16.2849 16.3636 16.6364C16.7151 16.9879 17.2849 16.9879 17.6364 16.6364L21.6364 12.6364C21.9879 12.2849 21.9879 11.7151 21.6364 11.3636L17.6364 7.3636Z">'); - const x$t=Qt(t=>{ - const i=bGt(),s=Qt(()=>t.fill||i.colors.icon.primary,"fill"); - return e=k$t(),n=e.firstChild,h=n.nextSibling,GLt(t=>{ - var i=s(),e=s(); - return i!==t.e&&UDt(n,"fill",t.e=i),e!==t.t&&UDt(h,"fill",t.t=e),t} - ,{ - e:void 0,t:void 0} - ),e; - var e,n,h} - ,"DisconnectIcon"); - function R$t(t){ - return wLt(this,null,function*(){ - try{ - if(!(null==navigator?void 0:navigator.clipboard))throw new vLt("Clipboard API not available"); - return yield navigator.clipboard.writeText(t)} - catch(r6i){ - } - P$t(t)} - )} - function P$t(t){ - const i=document.createElement("textarea"); - i.value=t,i.style.top="0",i.style.left="0",i.style.position="fixed",document.body.appendChild(i),i.focus(),i.select(); - try{ - document.execCommand("copy")} - finally{ - document.body.removeChild(i)} - } - Qt(R$t,"copyToClipboard$1"),Qt(P$t,"fallbackCopyTextToClipboard"); - const N$t={ - m:"8px",s:"4px",none:"0"} - ,L$t={ - m:"16px",s:"8px",none:"0"} - ,D$t=EGt.div` - width: 256px; - - box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16); - - border-radius: ${ - t=>L$t[t.theme.borderRadius]} - ; - - - background-color: ${ - t=>t.theme.colors.background.primary} - - - color: ${ - t=>t.theme.colors.text.primary} - - `,G$t=EGt.ul` - background-color: ${ - t=>t.theme.colors.background.primary} - ; - - padding: 8px; - - `,B$t=EGt.button` - display: flex; - - align-items: center; - - gap: 8px; - - height: 40px; - - padding-left: 8px; - - width: 100%; - - - background-color: ${ - t=>t.theme.colors.background.primary} - ; - - border: none; - - border-radius: ${ - t=>N$t[t.theme.borderRadius]} - ; - - cursor: pointer; - - - transition: background-color, transform 0.1s ease-in-out; - - - &:hover { - - background-color: ${ - t=>t.theme.colors.background.secondary} - ; - - } - - - &:active { - - transform: scale(0.96); - - } - - `,U$t=jLt(); - var F$t=GDt("<li>"); - const $$t=Qt(t=>pDt(XFt,{ - get translationKey(){ - return t.translationKey} - ,fontSize:"15px",fontWeight:"590",get children(){ - return t.children} - } - ),"MenuItemText"),H$t=Qt(t=>{ - const i=KLt(U$t),[s,e]=LLt(!1),n=Qt(()=>wLt(void 0,null,function*(){ - const t=aIt.toUserFriendlyAddress(i.account.address); - yield R$t(t),e(!0),setTimeout(()=>e(!1),1e3)} - ),"onCopy"),h=Qt(()=>{ - i.disconnect(),t.onClose()} - ,"onDisconnect"); - return pDt(D$t,{ - ref(i){ - var s=t.ref; - "function"==typeof s?s(i):t.ref=i} - ,get class(){ - return t.class} - ,"data-tc-dropdown":"true",get children(){ - return pDt(G$t,{ - get children(){ - return[(i=F$t(),YDt(i,pDt(B$t,{ - onClick:Qt(()=>n(),"onClick"),get children(){ - return[pDt(I$t,{ - } - ),pDt(EDt,{ - get when(){ - return!s()} - ,get children(){ - return pDt($$t,{ - translationKey:"button.dropdown.copy",children:"Copy address"} - )} - } - ),pDt(EDt,{ - get when(){ - return s()} - ,get children(){ - return pDt($$t,{ - translationKey:"button.dropdown.copied",children:"Address copied!"} - )} - } - )]} - } - )),i),(t=F$t(),YDt(t,pDt(B$t,{ - onClick:Qt(()=>h(),"onClick"),get children(){ - return[pDt(x$t,{ - } - ),pDt($$t,{ - translationKey:"button.dropdown.disconnect",children:"Disconnect"} - )]} - } - )),t)]; - var t,i} - } - )} - } - )} - ,"AccountButtonDropdown"),W$t=EGt(NUt)` - background-color: ${ - t=>t.theme.colors.connectButton.background} - ; - - color: ${ - t=>t.theme.colors.connectButton.foreground} - ; - - box-shadow: ${ - t=>`0 4px 24px ${ - kGt(t.theme.colors.constant.black,.16)} - `} - ; - - padding: 8px 16px 8px 12px; - - - display: flex; - - align-items: center; - - gap: 4px; - - height: 40px; - - `; - EGt(W$t)` - padding: 12px 16px; - - min-width: 148px; - - justify-content: center; - - background-color: ${ - t=>t.theme.colors.background.primary} - ; - - `,EGt(NUt)` - min-width: 148px; - - height: 40px; - - - background-color: ${ - t=>t.theme.colors.background.primary} - ; - - color: ${ - t=>t.theme.colors.connectButton.foreground} - ; - - box-shadow: ${ - t=>`0 4px 24px ${ - kGt(t.theme.colors.constant.black,.16)} - `} - ; - - - display: flex; - - align-items: center; - - justify-content: center; - - `,EGt(eFt)` - height: 18px; - - width: 18px; - - `,EGt.div` - width: fit-content; - - display: flex; - - flex-direction: column; - - align-items: flex-end; - - `,EGt(H$t)` - box-sizing: border-box; - - overflow: hidden; - - margin-top: 12px; - - `; - const V$t=jLt(),j$t=EGt(RFt)` - padding-left: 0; - - padding-right: 0; - - padding-top: 0; - - - ${ - QGt("mobile")} - { - - padding-left: 0; - - padding-right: 0; - - min-height: 364px; - - } - - `,K$t=EGt(f$t)` - padding: 12px 24px; - - text-align: left; - - `,z$t=EGt.div``,Y$t=EGt.div` - flex: 1; - - display: flex; - - flex-direction: column; - - align-items: center; - - justify-content: center; - - min-height: ${ - t=>t.isDeclined?"200px":"325px"} - ; - ; - - gap: 24px; - - `,q$t=EGt(vFt)` - position: absolute; - - top: 12px; - - left: 16px; - - `,X$t=EGt(w$t)` - margin-bottom: 0; - - padding: 16px 24px 24px 24px; - - min-height: 44px; - - font-color: ${ - t=>t.theme.colors.text.contrast} - ; - - `,J$t=EGt.div` - margin-top: 24px; - - margin-left: 24px; - - margin-right: 24px; - - display: flex; - - justify-content: center; - - `,Q$t=EGt.div` - display: flex; - - justify-content: center; - - align-items: center; - - `; - function Z$t(t,i){ - let s; - s=i; - const e=tHt(t,"ret",s); - if(!Mgt.isTelegramUrl(t))return e; - const n=e.slice(e.lastIndexOf("&")+1); - return e.slice(0,e.lastIndexOf("&"))+"-"+Mgt.encodeTelegramUrlParameters(n)} - function tHt(t,i,s){ - const e=new URL(t); - return e.searchParams.append(i,s),e.toString()} - Qt(Z$t,"addReturnStrategy"),Qt(tHt,"addQueryParameter"); - const iHt="data:image/png; - base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABx3SURBVHgBzV1bjJ3XVV7rnHHaNCSZUUnErfjwVFTRZgKiolJLJqiBFAqxi8QDUNlOVURFUS7iAfqA43ekuEgIKSq1LSFARKmdIiC8NOMgpFLSZJJWFQ9IOeYFiQIehyZOMj57de9/r2+ttf9zxp7x/L5se+ac/7b32uvyrcve5wzTTdpOy4FlukSrY5mt0pj3k/BEWCZEvEwiy/mWZdzLzPm3nBeiC5xkSjzaJM6vMznHPN64tEQbB/nMJt2EjekmaYXh49nsQGbefUKylgmbiBTmSm4dh+19PpDMYCrXO/Y393A+310gfVvnyLSRb9vIh+tpPDqbBTKlm6DdUAF0TN+aHaYRPZQZs4bzQhII67SbIqmV4fVdvaaP1WOc4NIL23U8X8XKI16fpXSKxuP1GymMGyKA01sH1sY8O5o5sYZzEnjMlemmvYXh9SKzCkeZXVrK70d6HsKyVu/T7vx0I7jy7kz+OXVw6e/O0HVu100ARdtHKR3KfHi0wIueFnCygRuu8FE4I8pXrne4mktFmziT7l7RZ6lyvztbYIthR6LX2Pqp/XcXzuWDJx5a+uopuk7tugjg2dmvPUKSssbzSj2jfDesVtzueK+iqPdBh3G1k1BnI1xlQPjdMbI+LxABJEvuD1xq4pAFrDJ/wdPrJYhrKoDTW59cyxM+kec4sQlC3905EgCmJStCSWHdyAQWbrZ+XIjtoy4cc+D6IEwv3lfPQkaJ+Fx+OZah6SRdo3ZNBHD64oEJL116Mr894Oqlg5kgKjTUS8oOxQgKMFMeAXQIAk5qZGBgBKupmKL9+0y7O8TO1V6UJnURHJ7XzqvUTsp437Fr4awHF8Czl34l4zw9maez0oSB2wwf9DacDb7BUAFOmcEb+934gu6kQxirV7DQVDWAPEIyGxDCPa39qdinkuTYwVv+4SQN2AYTQOdkL20dTUSPVrYmBCDSd5xwfDsjEB5SOvXV4EfUkHghgtmztEC4EIA2V3xyH+KGQV042/R1nJY6axgksRtEAAVyaLz1fO5tsrMnxGIVY2M8v+C+DlIqySEgqsdc5W3Rk1pdEFjFEfjrJCUNiBmEiUnU6kxvON5hPoantG/f/UNA0p4FcPqdX17NdH4t09ZFOE6xmjlQ3L1emLdOkD15Ir09esiG9R5+2r0L4CI8Y2BOxY0nIaTMdk7MTdVg1U3A9F7H876zBKc5BTmYIWmD9tBGtIf2lYL3RC/nGWS8L3qVFCkQ+okdV7TtiGf8VGSuKa2eq431ZorigrutmoxT81SF1AABl3aSbEw90nPw8PWKSKABXqKjrc7FiJmUuRefR3toVy2ArPmPUEonyegpU4sWCytolFV/C4SjdRzxGEYnaTBCVVnVkiAwv6exYdFYUgTMqx3MmRZpv8GqKvWmGCqMLgvvxpdG2JhbLmecfOatTzxKV9muCoKezcyfkRynJloxkIxJTd+h6Vt9w41jtmvlbYWGtmQQsZxsTEIPik1Q01GIagzZLZKqGR61ZSckeDFYWHBvj76qbIke//V3/+Nx2mXbtQC+cunBQ5T4ZI8Z5qQYZRllGGlW2wTfFARmcwiho3rTDrEt5+Xm+RDMhMAm9CM9d05BQQJt9Z2pPVvYSlZbku3ChEZ7it6N5PCnlp47RbtouxLA6e89sCrvGr+EiKOJ4401es70koIacw8w4oGQR5zuaKvDI7EydBM3iT2FMduZeSAJdOkFBLi1b7oL6W4jgDjFqo7ldcZ872/swjHv2AecvvjgJO0bny7MZ2hcRWTW4QUhhPTMOk6ge82ur8aIDviR+eAWkfluvVVYxzP1h+aLQgxCUdIHwXBB/GrxTBejhmtsE0LrHDPVPEDUaYsSI2LSDUmfyBKnrxVe0Q7bjiygJFnpnbdezm8nTRTu4E+mr3DEXmoIBLNzobsm4GfUXMFvVVSHHZmn3IQ2P7P5ZQVDSiXMrkEzYpmCiFqbm6t4W9DaWzDKb6ejW959706StR1ZQNq6eDSPMhEK2s2I76RlPgJKcaZJqPkIdJSg5aIMkJbz9r4aiiKz67sIOe5DMmL/PE/TkfwWbrloTklpdwty70TVYGFYGCtYO2xSe50UntEO2hUt4JmLDx6WkZwIJNNcOh86m776uvzrV7/rUQl4hmKxTaFVTr+P+e79t9KHf/Uuum15X+NP9Skx0NMps9WmyXu3ujTTt1/4P/pO/iFa4DgpGrEErxY9gdDdk/fQ2qd/JORmZFYm2/BuNOYrOuXLCqDDfU7PZzvZXxWTQ+So+kwcc1b6gw9/naavvE57bUf+5Cfpk7+/n0J4QxSdHpkfNt9uPFeWIgb43PtfoP+eXqS9ts9/6aeyEH7UjmEpwR+QjV2JuTBOfO/BW5+bbtfnZSFoNpKjWdEmjWNSHRCQAOPTM29ubtEQ7Y3cj1sZqyeXIA2hmIV4htvdX+/QqugQzPcmYuPV7DmQ5a+l4JTfL2cePnm53rYVwDMXHzicOy4/JWaxyFfxVJlh2Co7c+e7aPMBq2hEwna1Y36q7iBRcKAof2ioNlDTGTNerWtuSFWfYE889PTFB9e263NbAWTlOepT5Voz0REsEGxDRpLh5uoOh6TNksWZ2tSc7CHRJKSGxkQD0kTOa8QA4savvqMeMdsdNBqlE9v1t1AAf5u1v4t6dLLorIvDtWgVmc6WPQ03WyGRBuiMFiay7FjdrT3RpVymj6CXBmxi3keaHzGUIIuO7CdHRX/z1i8trBctFECucxz1zhTnFjUWqJzfO5AMWANvCDzQYsKu2mcw4FZPbpXDNgm/FxEdryFRqcXGMaej3W6/XpsTQNV+mtSBzNx7pmyzdDymkJ0O0CwlDnRwyBdSG5dz64UCMAxqlWp7KQVrNwByXKoUVhiq4XJ5avntt793uN/nnACK9ktgZnB84thryC8tChLteK3xyk3BlEz2qTraEHZoBiF9p8taQmihYSCiQuJVKVTIARhZWtPRa7v4Mm9FHun31wjg6bc//lCSNGlHJLC+TkrghPP7hHO+mDKgFTBTkuBerbiHBEuDsO591TalACERIHqwZuqtZqdaAhxQKRj8hSyvJpA8efrix9dij40ApISdSPVIxRocTe3Ei2g26ZiCDtjcrILlIRhFXNaRkAT3SRsG7iDX303TCoAuJom4duJ6xx+4fgQrYFc9Ohp7NAF0FTyhA5pney1Hl40qA7pdaV4hrPUTMiENOVkXviKRuB9SLfPVCFRxjO3k8xhSK5L4WNo0RWQFQUIkpmVTKsu0el+qQcp90RmbALZm76yFKTvOKb7WzjpkQ6kEjjj4hgEn65WGbsKp0Wx1c+JlPHPTRMTRVw3ohEnrG+6DRF2QtOvNCo2KFwynoK+89fb/H0KHDkFjPhS1zJc91LWoMxNfndUiVF2xDbo3UEOuYfBHHgnV6xVWRfqpKBxwpHsoosKahC2fGVfEEjDxDQdWnXW8LkijrRPAX19cm+SLazGJ0dF8pgTLSGJ2Apdo3ocGbWy+jC3K6ZcYgpBMMwMdg+KiggrZmkgI1DQb8uRL81N2z6222C1GrZ2WtQ6GOgGMabRWO0tBuwIfKNbfQy2fa6iFWQ6q/91wnbAlieuZCLfqHjwgBASOUC812mtjjXa68FLIE0IP1YlM00s9TnT7DQXYrlHO1lujzgo6ASSi+3RioabopQAKyRYEFRIRMk0Y0Ng1GDPnitKDbxlhlsYhipX60YP5r4GaGNPVDi3ekaAIrqBY/fNQGu/zlRHdV84tdY+IrJIvpxG0h0NYZ8jf3YP/pnztisggk3UPY0GBnqrvE95SHBsMqs9anDRoE3HeCHS7Xol3gdnkSgRryJYxq58OGp04v7acb1uNpi1Wc2EP7cRcDemSI8ThPiH/3PfbP0R7bbctL9HkQ7eTWmFvcmKpWDvZyhTSOmjQTvrE539sz2ZQaPrAx5Y15Iic7qkdS+9aO7T5DqZJ8QOcHfBatuznKwO5V09RbSf4b6/NhHVVxdo4BnF70u6161GzkXcw1svzy3f/8y3+w597MS/MXKK9tA/8/DL98XOrgU7PGp1GPee1G2NAuLqIdjDJijN4T421kkaU2OeknbDcX7ZRKXXcOFI/RkKMYEi8CEDmgCjI3TZGhTPuw4masJjCvZqodFrynRc298z80ko/OoRZkrlJigSkUMpQQjXxjcE56MTTvi/KcH4uKSz7mlRtTd56dE9xwvs1aZNQ9g3HlcVwKCCHrXtnvYWtKhYLGJNwEyN0sbREfG40jWlAzwm6JDA+gi2udy5eGO69o9G3vBO21oAnWoBjBw3s3fME0vrvlifFoJoRMieaFAFMEB+ZJQbnG1iiCXcoyoWLxO7pg5V3F4Of6PmrkGmDPYIehpSBxo/se1wqEwKrgisTICzUX5lfhcGYRhAeZud9O8/8N/gjiOCIfmKUD5cp2BnXuJutqIRBQCS7/bYYrozu5qgUmcAwMzKDsYw2ODQT6qD6X7orn9ZJAmdD0h8iLC6oxgMkraStgBlQAlDLkBqE1EAQ3ge+Id/Kp/Yv5ZMTc0ZcFzrq+HFTrcmhs0Y3U9IaBLMCphCEYAW9qhTeF3mP6vQCZcBGERoufFRosK1t9qrK4R9EroQmghAQBrMXfq0GxlBJ2xjkVR+n3QML+GeP1TIyLWcIkju7ujvwgKL7EIqShLozSWN6hLq9eS8yxsIQwFz7p2k96eI5sko23Ru0CeBHbD7CYRXDcw080PFKgh30chLVroCVbgVx4N52R/OrlSPLGYJoRVlr6bQlMhSQnoBSpq/uynyWFduS+FdpENFChgLxIAzDRce3oZoCgC3Yc7OhSq87AvUGds0SaZNT8VADtBvxtm1HlbgfWCivl5fQsdU1BB4r6D7FmDfyPVqHOJ4zlIMazYJZE5O7OYkTRbVF+oi1x2Z961H9tL2NbtGMiwFRjtdv6o2BV6TOHRhPfh9raC7wOiHEAc/qkEswP9UKfGqOwiCIePBxaIYkmmkpPgHf4IDrg5CGuZrYdEIcPtkxpAfQaTuGqnBdsUL2CgWYo2+7Xil2qbzpHgoxNZOt6RkNebbdA6Nw0heXzRoQv4JkCajpQ5NHvMIBN7kp2FH8cg1fZCTf7cCqDfHJYZr5syaDpWDFqt0UalA+T+73ZfPVuXCw8qaogyhI3bDnVjoWL+XrF/LxciREB7DCEWlpEq9NGUG4eQam7XUktvCM8KkmMfhhn23c2eRgMERDhQBwETG8jl+DBmyrlyaYCLMHMFghDjiAZziM5aPra5i33bNZShGbtGiyIXlQffEoyZyqRxU2dpxeJEAQ7RDbJ644qJMYpIkr6EBNJOp/O9kYLvcjZfUNjcKYAlURGGrao/2whSwIiF3rI+dLIrbZGJVonCMJXtzgiwBE3juHPuHoWWzHQDucTySm8hot1Dic694fYRoWg9CYPHl0uqmJv/W0Kx/+Ke3qN7hVRDuP+YgrpMbo0gBwV485V8pEUzV4YJV4IsROBH7IPhtg9hxT3GqI8HYxX0BcIDY9RTgW2A/307KhmjQL6aALyiZmAaBXfHcVeEKwTBVCiCwBsagfQeMF6+gI8RnjMso5F0Y56ztHyjS7UXlkaXi5PkIdvFqGJTWsYQObpKjbGMVBjSvEBDQkTIf9AnA12uNwrY6VoA3hgjpOSMCCSvGaGHTafQbVLyNRIQGERuSL8+RzrHUnDpNSMpheG9F49ppZSXjIYgVoc/KdxpVATa9VDHZdA81aWibHeXd3ZJMA87mun/buGKyJzR+2bbBnQbApm3kgkYQsuNlZAWHBr4vmX1A+7VNcCoLf7AFLHSWdW6KZvKIVClNGyxTJPX70rwIKxetW2qmR5YdOOZHXhCSALPrh4OVvu3NPX2Nh7a7974KMLZIxgixsU99lZEJzNYIXar4sMEmYmEd7ABiiwK/Gydsk9UPPMt7gsiS5tPTO+Sibjpr+MTjdOh9yxK9kn/vWm/xPf/ZfJA33mXbTbr1zTA/+3g/TuW+9IW9upmCNferM12hqCywwx8OTe26T6Stv8r//84XmmUj/9u/9XKHpU194X1maFB0R5mRfh0Ytv2JxISyX+rUfuHTLytKRlfXNv3z9I9M8zv74fJUpSzA/yLM3iHuCQsJTv/sfdO7VN2ivrazBHvyj95mgrSpppOhZFTRwriJtPEf8hY+8QkO0/R+6jT72W3cxm4c0a4YVKYDAllUtor+r18pjGwcz70f61FmxMFP1RyK0kDpIjIEoQWetTCr/37gwoyGaRm4UIYEshmLbnUZkghB4J6NqYG8S3CRHOpvvseio8P1V4sfNR6byM93XGagAZN0jWo0KRm5/4kkSIX63EhPF+JZoqPAlgrX1CKcGp2f0oYIviLgZAe+QjXluero5DbzAbxQVcaZWelMyfpbNXWfL+04As9m7z6gG2Yfuk+0FFfLv0oH0TBdcJ0qglHYJ9pdpFga60pDTCOZLkH5Di1pFY8V7p0kkKmHIE2Cu8z+4N/KwvM5mab302Qmg+IF8/iyR7yazejbDAqQhxC0hOuQBdc5GJ6uuYDybnvoGODX8KJHkYhiySQMlYcy4RdNpgRqAh1UI60dWvj4tV0ah32fhtlGAFulF5RpGachVLcEjx8GnirpQh6ESWQ8mx0Wc1gKcQcMCkeiODqzk2XmCsYqFP3qBPBzQe0Z0Es+ZAGbp1pMdmuZ+uwQEXyjSj9rMCVuyxcNPE1MSuK7g9MzNNuGmHXuyIx5ODNk08BL7oGCgQeMAcuyInghKmrYq/pdmAigwlF/OejwFBiSBxFE3kRCBIMEZHILU1LAHFJBnkT9JmCRVChIA0/FhaP6Hshx+I8ly1ND7XPONmPJ6BvBTWpNuzmZ8TAi1C0XZmO1K4w1V19i/qo2uQeuoSTHNssSkWVso5acR1c/nSWTEkF6g+saQY9WzlVWWohqrm6UZ9Wckp2KPjQCyZNbzndNO84g5ZhcOAyJkGxmqzMXFMagX9kAAem8YXP93O+7gbEX9RGexfC3KeqrTtrgfw25PSKs0zPoqiECfp5++4xvN3yiYL7iM03FlrEX6zRyAYxI3Jul0B3TEAjg1bMX0deo9BlfWq52I3mPPD9OiI9LKqo6kMY5RYhQIqKq8lCf6fc4JIG1tFRPZhF0pIxxelAqEf2bwitg0WFNMYwk5v57XsE6P2Gv4Ri0SMhocGJUG+0BLd8hhsYnrghRu1pgyX5weuuMbp/rdzQngyMpGXiGTY4KYIqKYhVrdRiz2H3UEMiDe+ndFkMOcUhLyA6NOw9Eae4dVz4HL2xqacLPAHkIgg01TEoE1PLGov4U13yN3vnicupUyImTCeonFN+4pRSiU4cN7AzXQzWLAU1JteAQUAhc/KhQcFA3VejFNUy1BUij6WWoOSVn+v1D7S9v++4LGcsQz3irpJA5JcPsoUxLRoIuJoe4ZdinUc3VNTkLoG28wDeRBFaJSg9eKAyl8Wr74oLoNXzR1xH0FF57YrsdtBXDk9hfXeSSnF4KKCiIlAdMbNzFEs1wcx2TLHUSO7IIpIhtWjUMBYFghdF3hM5sUaKvHMSwms1w5tZ32l3bZZSeZ7XucikOmuGVkEVES3g/XBOvRzbKmWp7AF1TZe/YZhTewX4KPCWPpabVU+CYNCISnkmbHLtfj0uUuloztxPmffiyvNp9gDhOGpXPYcqjB6AOfu5v+5a/+l998fRbprq3RmwXH2t6TV58++pvv9UfjglcFF7boSEvCBlNmGmR7+n8x0/TS31+gbdt2dIXzP/jjt9D7P3q7dU7YzLXgQdXJfMfsWA5qpkSXH/qK7cvnf+Z4Hqr7rhtm/BGEQkX8OxRqIxT4zWz+Y6TRmM5LIFChppzao0diIKbehznKM6796V3NZxEiH684WSaJthYfw/pj4LdGQ2H8tmb1xYdXvnnFr7Xf0co30+yJ/GuqHbPHgOpqSKtF9WbMRQwuUDGyOWl6Esu6JDxvDF6IBrYblwlXEpGnIhxIaP1FZaUYQNW5aLBt8bV90RMIwPsUFnkw3xiJSSwSEr3W8WwHbUcCKLkBpdn9orvoNDLyohxmSkKSjDmV4OS7OJSlorwQCYs+zhEKbIu4AtUU8ettc+Z45NZZG7IEiV/iJ2UfT1dDEtsSE/afKLu3/wYwrZOxTUIpSK9l6PmFjmc7aLtyUCfO/+yq0Ozl+KTvgksqD+IGU61kzAvOc+PIUEiQOO9FeHK5Bq22tT1LqRmf7QGNcSDGzgYbC+Qh6IGytf1iQ5vWDPNLujczf/ivry/tyMq/beTRj5i6diSkrOQJNIcNYGKMqOcFpVWxew07yPC3hVhqGQ7T0htgfR6Kk4+ph/jCjEpuCnRZJ2T2ZLhGpLuCGkcr6Bc75rB0KzqfMR/eDfNL2/XupyMrL53MYz3Wwzxyb+mbr9XwMVMkKYxaKyABFX2FDlgKNyXwwGWYVOVSxS8fh8MHZlWGkLruYpHgLHX5XPQ8GcoLkD4BMXUSEhRNx6wCeezhO755inbZrmr72WdWXjqeh3/Mz9g6qZD7OZtlzZhFehYS9/tRLBmIgYYeiTlSqaUQ1IiSSBN5aF1GYY85fGyaqsN29+p/kMFO+ZbFYE/4+IjClA0W+5XHK09233blA/rtL86vHs7a9eXGsbG7yc5DhOzQPz3TH1b66F5hFbhs4G/YxlXoiK5UtQ3e+slX35F4H4gkq1B5LiK2INNl0tCcjw4/vLKxa82nXm9X3U6cX13Nvud0JnMSMmVuh0hCcytTBuiifxaFZO6uRUyzY4LXVndUzwS3LlqlJQQIikbd965yjAjwgPehtATJAacwiGzmVPP+39kl5vfbngVQWhbCJAPD8/ntfiLsN47Ue6rksMLt310wqyH7S0z6vHWHh4iahIfcphoRSg/r7U7LBBCY4bGeAkS7s3ioWuW5MdP9V8pyd9IG2YJcCMkd3Zs17YsSuFY104KfWB0ngjOLNsMcnLOjtb/2r1WERj4k5BtqBBtJGWOJba20L/oT5AtgvvubGmKKeCCgYJj4TzPz7x2C+XFyg7Wnsl8YU/f1xxNVHUvRg3tocwK96K5AiOYRYhH12ne4uVHZpnsfe9GY7PnB3LhVYBfyxcc+s7JxkgZsgwugNIWko1K+iRcDcfhDmjqySER551oDBhxuhUANcQhCqHcG5jU4FcbgxujmIV7vhHOGfM6MM/OH0vrYrokA0EqUlKdQBDEpx+BTbVY4V0fs3ykUv1BD70VAHzCs/TSZPdMmelYkM2SENzYqouTaPnIQey7jzpHPrmys0zVq11QAaAWWsv4fzYNNFsU62zVjC8LNxuHSNsFrGMBjyOjj562qnBpFwXHZlHDss+999api+9206yIAtKf+54OHRyPO/oEmiG6ampC0oM12CjlFiJpQl5mbQRSw4zqbDDzitaHIQq1pPjg+ptGpnRbT9tquqwDQvnT+gweyPziUOXOgxzCoPDmDJWiuspF7z7gHZjMT6HfdJaEdKLaT+pz6LQ7lwjrNssbf9e11us7thggA7c+zsx7PZmvZ/A9l1qzZFx5Z3N+kE8bMtnygUhPefiEmJCPhufXsdp69ZTQ6eb20fVG7oQKIzYTBtJa5c0/m1qr7XKw4aRqnz8xHjK1LRVO7mI4kZaaPzu4bj8/cSKbHdtMIoN9yKLt86dKl1TQarY4pTTJk7c8ZcvmS2Um+fGeWx7J/nqdT7rLou5nZv5koZWbnBfGRTPkSvbK0tLRxszC8374PCjm2qc8CICsAAAAASUVORK5CYII="; - var sHt=GDt('<svg><path fill-rule=evenodd clip-rule=evenodd d="M96 51C96 75.8528 75.8528 96 51 96C26.1472 96 6 75.8528 6 51C6 26.1472 26.1472 6 51 6C75.8528 6 96 26.1472 96 51ZM102 51C102 79.1665 79.1665 102 51 102C22.8335 102 0 79.1665 0 51C0 22.8335 22.8335 0 51 0C79.1665 0 102 22.8335 102 51Z"fill-opacity=0.2></svg>',!1,!0,!1),eHt=GDt('<svg><path fill-rule=evenodd clip-rule=evenodd d="M6 51H0C0 79.1665 22.8335 102 51 102V96C26.1472 96 6 75.8528 6 51Z"></svg>',!1,!0,!1); - const nHt=Qt(t=>pDt(oHt,{ - get children(){ - return[pDt(aHt,{ - } - ),pDt(cHt,{ - src:iHt} - )]} - } - ),"OKXLoaderIconWithLogo"),hHt=Qt(t=>pDt(oHt,{ - get children(){ - return pDt(cHt,{ - src:iHt} - )} - } - ),"OKXIconWithLogo"),rHt=Qt(t=>{ - const i=bGt(),s=vGt` - 0% { - - transform: rotate(0deg); - - } - - 100% { - - transform: rotate(360deg); - - } - - `; - return pDt(EGt.svg` - animation: ${ - s} - 2s linear infinite; - - transform-origin: center; - - `,{ - xmlns:"http://www.w3.org/2000/svg",width:"102",height:"102",viewBox:"0 0 102 102",fill:"none",get children(){ - return[(s=sHt(),GLt(()=>UDt(s,"fill",i.colors.text.primary)),s),(t=eHt(),GLt(()=>UDt(t,"fill",i.colors.text.primary)),t)]; - var t,s} - } - )} - ,"OKXLoaderIcon"),oHt=EGt.div` - position: relative; - - height: 102px; - - width: 102px; - - `,aHt=EGt(rHt)` - height: 102px; - - width: 102px; - - position: absolute; - - top: 50%; - - left: 50%; - - transform: translate(-50%, -50%); - - `,cHt=EGt(IUt)` - position: absolute; - - width: 86px; - - height: 86px; - - border-radius: 44px; - - top: 50%; - - left: 50%; - - transform: translate(-50%, -50%); - - `,lHt=Qt(t=>[pDt(K$t,{ - translationKey:"walletModal.mobileConnectionModal.OKXConnect"} - ),pDt(J$t,{ - get children(){ - return[pDt(EDt,{ - get when(){ - return t.sessionConnecting()} - ,get children(){ - return pDt(Q$t,{ - get children(){ - return pDt(nHt,{ - } - )} - } - )} - } - ),pDt(EDt,{ - get when(){ - return ULt(()=>null!==t.universalLink)()&&!t.sessionConnecting()} - ,get children(){ - return pDt(WFt,{ - imageUrl:lFt,get sourceUrl(){ - return Z$t(t.universalLink,"none")} - ,disableCopy:!0} - )} - } - )]} - } - ),pDt(X$t,{ - translationKey:"walletModal.mobileConnectionModal.scanQR",get translationValues(){ - return{ - name:t.walletInfo.name} - } - ,get children(){ - return["Scan the QR code below with your phone’s or ",ULt(()=>t.walletInfo.name),"’s camera"]} - } - )],"MobileConnectionQR"); - EGt(f$t)` - padding: 12px 64px; - - `; - const uHt=EGt(f$t)` - max-width: 262px; - - `,dHt=EGt(uHt)` - font-size: 14px; - - color: ${ - t=>t.theme.colors.text.primary} - ; - - `,fHt=EGt(NUt)` - background-color: transparent; - - color: ${ - t=>t.theme.colors.text.primary} - ; - - padding: 0px; - - `,pHt=EGt.div` - margin: 30px 0; - - width: 100%; - - display: flex; - - flex-direction: column; - - justify-content: center; - - align-items: center; - - gap: 16px; - - - ${ - QGt("mobile")} - { - - height: 160px; - - align-items: center; - - } - - `,wHt=EGt(ZUt)` - margin-bottom: 16px; - - `,gHt=EGt.div` - display: flex; - - flex-direction: column; - - justify-content: center; - - align-items: center; - - gap: 12px; - - width: 100%; - - `,mHt=EGt.div` - background-color: ${ - t=>t.theme.colors.text.primary} - ; - - height: 48px; - - width: calc(100% - 48px); - - justify-content: center; - - border-radius: 24px; - - display: flex; - - align-items: center; - - gap: 8px; - - `; - EGt(XFt)` - max-width: 262px; - - font-weight: 400; - - font-size: 16px; - - line-height: 20px; - - text-align: center; - - margin-top: 10px; - - color: ${ - t=>t.theme.colors.text.contrast} - ; - - `; - const vHt=EGt(NUt)` - height: 48px; - - width: 262px; - - border-radius: 999px; - - display: flex; - - justify-content: center; - - align-items: center; - - padding: 12px 24px; - - `; - EGt(vHt)` - background-color: ${ - t=>t.theme.colors.text.primary} - ; - - `,EGt(vHt)` - background-color: transparent; - - border-color: ${ - t=>t.theme.colors.border.secondary} - ; - - border-width: 0.5px; - - border-style: solid; - - `; - const _Ht=EGt(uHt)` - font-size: 14px; - - color: ${ - t=>t.theme.colors.background.primary} - ; - - `; - EGt(uHt)` - font-size: 14px; - - color: ${ - t=>t.theme.colors.text.primary} - ; - - `; - const MHt=EGt.div` - padding-top: 16px; - - padding-left: 16px; - - padding-right: 16px; - - display: flex; - - align-items: center; - - gap: 12px; - - border-top: 0.5px solid - ${ - t=>kGt(t.theme.colors.icon.secondary,.2)} - ; - - margin-top: 24px; - - `,bHt=EGt(IUt)` - width: 32px; - - height: 32px; - - border-radius: 16px; - - `,yHt=EGt(C$t)` - margin-left: auto; - - display: flex; - - `,EHt=EGt.div` - display: flex; - - margin-top: 24px; - - gap: 8px; - - align-items: center; - - justify-content: center; - - `,AHt=Qt(t=>(HLt(()=>{ - Mgt.logDebug("LoadingModalPage onMount"),Mgt.reportEvent(Mgt.OKXReportType.PAGE_IN,Mgt.Report_Loading_ConnectWallet_View,"")} - ),WLt(()=>{ - Mgt.logDebug("LoadingModalPage onCleanup"),Mgt.reportEvent(Mgt.OKXReportType.PAGE_OUT,Mgt.Report_Loading_ConnectWallet_View,"")} - ),pDt(pHt,{ - get children(){ - return[pDt(nHt,{ - } - ),pDt(EDt,{ - get when(){ - return t.loadingTextTranslationKey||t.loadingTextTranslationKey} - ,get children(){ - return pDt(uHt,{ - get translationKey(){ - return t.loadingTextTranslationKey} - ,get children(){ - return t.loadingText} - } - )} - } - )]} - } - )),"LoadingModalPage"),SHt=Qt(t=>{ - const[i]=YFt(); - return ULt(()=>{ - var s; - return i(t.translationKey,t.translationValues,null==(s=t.children)?void 0:s.toString())} - )} - ,"Translation"); - var THt=GDt('<svg width=40 height=12 viewBox="0 0 40 12"fill=none xmlns=http://www.w3.org/2000/svg><g clip-path=url(#clip0_4356_43883)><path d="M11.7336 0H0.269322C0.198282 0 0.130151 0.0282212 0.0799182 0.0784542C0.0296852 0.128687 0.00146484 0.196817 0.00146484 0.267857V11.7321C0.00146484 11.8032 0.0296852 11.8713 0.0799182 11.9215C0.130151 11.9718 0.198282 12 0.269322 12H11.7336C11.8046 12 11.8728 11.9718 11.923 11.9215C11.9732 11.8713 12.0015 11.8032 12.0015 11.7321V0.267857C12.0015 0.196817 11.9732 0.128687 11.923 0.0784542C11.8728 0.0282212 11.8046 0 11.7336 0ZM8.00129 7.73303C8.00129 7.80407 7.97307 7.87221 7.92283 7.92244C7.8726 7.97267 7.80447 8.00089 7.73343 8.00089H4.26736C4.19632 8.00089 4.12819 7.97267 4.07795 7.92244C4.02772 7.87221 3.9995 7.80407 3.9995 7.73303V4.26643C3.9995 4.19539 4.02772 4.12726 4.07795 4.07702C4.12819 4.02679 4.19632 3.99857 4.26736 3.99857H7.73343C7.80447 3.99857 7.8726 4.02679 7.92283 4.07702C7.97307 4.12726 8.00129 4.19539 8.00129 4.26643V7.73303Z"></path><path d="M35.7391 4.00018H32.2725C32.2015 4.00018 32.1333 4.0284 32.0831 4.07864C32.0329 4.12887 32.0046 4.197 32.0046 4.26804V7.73465C32.0046 7.80569 32.0329 7.87382 32.0831 7.92405C32.1333 7.97428 32.2015 8.0025 32.2725 8.0025H35.7391C35.8101 8.0025 35.8783 7.97428 35.9285 7.92405C35.9787 7.87382 36.007 7.80569 36.007 7.73465V4.26697C36.0067 4.19611 35.9783 4.12826 35.9281 4.07826C35.8779 4.02825 35.81 4.00018 35.7391 4.00018Z"></path><path d="M31.7379 0H28.2713C28.2002 0 28.1321 0.0282212 28.0819 0.0784542C28.0316 0.128687 28.0034 0.196817 28.0034 0.267857V3.73446C28.0034 3.8055 28.0316 3.87364 28.0819 3.92387C28.1321 3.9741 28.2002 4.00232 28.2713 4.00232H31.7379C31.8089 4.00232 31.8771 3.9741 31.9273 3.92387C31.9775 3.87364 32.0057 3.8055 32.0057 3.73446V0.267857C32.0057 0.196817 31.9775 0.128687 31.9273 0.0784542C31.8771 0.0282212 31.8089 0 31.7379 0Z"></path><path d="M39.7376 0H36.271C36.2 0 36.1319 0.0282212 36.0816 0.0784542C36.0314 0.128687 36.0032 0.196817 36.0032 0.267857V3.73446C36.0032 3.8055 36.0314 3.87364 36.0816 3.92387C36.1319 3.9741 36.2 4.00232 36.271 4.00232H39.7376C39.8087 4.00232 39.8768 3.9741 39.927 3.92387C39.9773 3.87364 40.0055 3.8055 40.0055 3.73446V0.267857C40.0055 0.232682 39.9986 0.19785 39.9851 0.165352C39.9716 0.132854 39.9519 0.103327 39.927 0.0784542C39.9022 0.0535813 39.8726 0.0338512 39.8401 0.0203901C39.8076 0.00692902 39.7728 0 39.7376 0Z"></path><path d="M31.7379 7.99982H28.2713C28.2002 7.99982 28.1321 8.02804 28.0819 8.07827C28.0316 8.1285 28.0034 8.19663 28.0034 8.26767V11.7321C28.0034 11.8032 28.0316 11.8713 28.0819 11.9215C28.1321 11.9718 28.2002 12 28.2713 12H31.7379C31.8089 12 31.8771 11.9718 31.9273 11.9215C31.9775 11.8713 32.0057 11.8032 32.0057 11.7321V8.2666C32.0055 8.19575 31.9771 8.12789 31.9269 8.07789C31.8767 8.02789 31.8087 7.99982 31.7379 7.99982Z"></path><path d="M39.7376 7.99982H36.271C36.2 7.99982 36.1319 8.02804 36.0816 8.07827C36.0314 8.1285 36.0032 8.19663 36.0032 8.26767V11.7321C36.0032 11.8032 36.0314 11.8713 36.0816 11.9215C36.1319 11.9718 36.2 12 36.271 12H39.7376C39.8087 12 39.8768 11.9718 39.927 11.9215C39.9773 11.8713 40.0055 11.8032 40.0055 11.7321V8.2666C40.0052 8.19575 39.9769 8.12789 39.9267 8.07789C39.8765 8.02789 39.8085 7.99982 39.7376 7.99982Z"></path><path d="M25.733 0H22.2664C22.1954 0 22.1272 0.0282212 22.077 0.0784542C22.0268 0.128687 21.9985 0.196817 21.9985 0.267857V3.73446C21.9985 3.8055 22.0268 3.87364 22.077 3.92387C22.1272 3.9741 22.1954 4.00232 22.2664 4.00232H25.733C25.804 4.00232 25.8722 3.9741 25.9224 3.92387C25.9726 3.87364 26.0009 3.8055 26.0009 3.73446V0.267857C26.0009 0.196817 25.9726 0.128687 25.9224 0.0784542C25.8722 0.0282212 25.804 0 25.733 0Z"></path><path d="M25.733 7.99982H22.2664C22.1954 7.99982 22.1272 8.02804 22.077 8.07827C22.0268 8.1285 21.9985 8.19663 21.9985 8.26767V11.7321C21.9985 11.8032 22.0268 11.8713 22.077 11.9215C22.1272 11.9718 22.1954 12 22.2664 12H25.733C25.804 12 25.8722 11.9718 25.9224 11.9215C25.9726 11.8713 26.0009 11.8032 26.0009 11.7321V8.2666C26.0006 8.19575 25.9722 8.12789 25.922 8.07789C25.8718 8.02789 25.8039 7.99982 25.733 7.99982Z"></path><path d="M21.9996 4.26375C21.9996 4.19271 21.9714 4.12458 21.9212 4.07435C21.8709 4.02411 21.8028 3.99589 21.7317 3.99589H17.9994V0.267857C17.9994 0.196817 17.9712 0.128687 17.921 0.0784542C17.8707 0.0282212 17.8026 0 17.7316 0H14.2687C14.1977 0 14.1295 0.0282212 14.0793 0.0784542C14.0291 0.128687 14.0009 0.196817 14.0009 0.267857V11.7273C14.0009 11.7984 14.0291 11.8665 14.0793 11.9167C14.1295 11.967 14.1977 11.9952 14.2687 11.9952H17.7353C17.8064 11.9952 17.8745 11.967 17.9247 11.9167C17.975 11.8665 18.0032 11.7984 18.0032 11.7273V7.99661H21.7366C21.8076 7.99661 21.8757 7.96839 21.926 7.91815C21.9762 7.86792 22.0044 7.79979 22.0044 7.72875L21.9996 4.26375Z"></path></g><defs><clipPath id=clip0_4356_43883><rect width=40.0039 height=12 fill=white>'); - const CHt=Qt(t=>{ - const i=bGt(),s=Qt(()=>t.fill||i.colors.disable,"fill"); - return e=THt(),n=e.firstChild.firstChild,h=n.nextSibling,r=h.nextSibling,o=r.nextSibling,a=o.nextSibling,c=a.nextSibling,l=c.nextSibling,u=l.nextSibling,d=u.nextSibling,GLt(t=>{ - var i=s(),e=s(),f=s(),p=s(),w=s(),g=s(),m=s(),v=s(),_=s(); - return i!==t.e&&UDt(n,"fill",t.e=i),e!==t.t&&UDt(h,"fill",t.t=e),f!==t.a&&UDt(r,"fill",t.a=f),p!==t.o&&UDt(o,"fill",t.o=p),w!==t.i&&UDt(a,"fill",t.i=w),g!==t.n&&UDt(c,"fill",t.n=g),m!==t.s&&UDt(l,"fill",t.s=m),v!==t.h&&UDt(u,"fill",t.h=v),_!==t.r&&UDt(d,"fill",t.r=_),t} - ,{ - e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0} - ),e; - var e,n,h,r,o,a,c,l,u,d} - ,"OKXLogo"),OHt=Qt(t=>{ - const i=bGt(),s=Qt(()=>{ - Mgt.reportEvent(Mgt.OKXReportType.CLICK,Mgt.Report_ChooseType_Download_Click,"")} - ,"onDownloadClick"),e=Mgt.isBrowser("chrome"); - return[pDt(EDt,{ - get when(){ - return!t.showAllWallet()&&!sUt()&&e} - ,get children(){ - return pDt(MHt,{ - get children(){ - return[pDt(bHt,{ - src:iHt} - ),pDt(m$t,{ - children:"OKX Wallet"} - ),pDt(yHt,{ - href:Mgt.downloadUrl,onClick:s,blank:!0,get children(){ - return[pDt(XFt,{ - get color(){ - return i.colors.text.contrast} - ,get children(){ - return pDt(SHt,{ - translationKey:"common.get",children:"GET"} - )} - } - ),pDt(WUt,{ - direction:"right"} - )]} - } - )]} - } - )} - } - ),pDt(EHt,{ - get children(){ - return[pDt(XFt,{ - get color(){ - return i.colors.disable} - ,get children(){ - return pDt(SHt,{ - translationKey:"walletModal.mobileConnectionModal.PoweredBy",children:"PoweredBy"} - )} - } - ),pDt(CHt,{ - } - )]} - } - )]} - ,"ModalFooter"),IHt=Qt(t=>pDt(fHt,{ - get leftIcon(){ - return pDt(oFt,{ - } - )} - ,get onClick(){ - return t.onRetry} - ,get children(){ - return pDt(dHt,{ - translationKey:"common.retry",children:"Retry"} - )} - } - ),"ModalRetryButton"),kHt=Qt(t=>{ - var i; - const s=null==(i=t.errorInfo)?void 0:i.call(t); - return[pDt(wHt,{ - size:"s"} - ),pDt(uHt,{ - translationKey:s?void 0:"walletModal.mobileConnectionModal.connectionDeclined",children:s||"Connection declined"} - ),pDt(EDt,{ - get when(){ - return t.showRetry} - ,get children(){ - return pDt(gHt,{ - get children(){ - return pDt(IHt,{ - get onRetry(){ - return t.onRetry} - } - )} - } - )} - } - )]} - ,"ConnectionDeclinedModalPage"),xHt=Qt(t=>{ - const i=bGt(); - return[pDt(gHt,{ - get children(){ - return[pDt(nHt,{ - } - ),pDt(uHt,{ - translationKey:"walletModal.mobileConnectionModal.continueIn",children:"Continue the transaction in OKX Wallet"} - )]} - } - ),pDt(gHt,{ - get children(){ - return[pDt(mHt,{ - get onClick(){ - return t.onOpenQR} - ,get children(){ - return[pDt(cFt,{ - get fill(){ - return i.colors.background.primary} - } - ),pDt(_Ht,{ - translationKey:"walletModal.mobileConnectionModal.showQR",children:"Show QR Codes"} - )]} - } - ),pDt(IHt,{ - get onRetry(){ - return t.onRetry} - } - )]} - } - )]} - ,"ContinueInWalletModalPage"),RHt=EGt.div` - display: flex; - - flex-direction: column; - - justify-content: center; - - align-items: center; - - width: 100%; - - gap: 12px; - - `,PHt=EGt(XFt)` - max-width: 262px; - - font-weight: 400; - - font-size: 16px; - - line-height: 20px; - - text-align: center; - - margin-top: 10px; - - color: ${ - t=>t.theme.colors.text.contrast} - ; - - `,NHt=EGt(vHt)` - background-color: ${ - t=>t.theme.colors.text.primary} - ; - - margin-left: 24px; - - width: calc(100% - 48px); - - margin-right: 24px; - - `,LHt=EGt(uHt)` - font-size: 14px; - - color: ${ - t=>t.theme.colors.background.primary} - ; - - `,DHt=Qt(t=>{ - const i=Qt(t=>{ - switch(t.getTag()){ - case Mgt.OKX_APP_WALLET:return pDt(a$t,{ - src:lFt} - ); - case Mgt.OKX_INJECT_WALLET:return pDt(a$t,{ - src:"data:image/png; - base64,iVBORw0KGgoAAAANSUhEUgAAADUAAAAoCAYAAABerrI1AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAZOSURBVHgB7VlrbFNVHP/dR2/XPVv26tYyOwmogGE8RMg06xJjIDzcEKOEKOOLiR/c+GIiH8zYF1ATw5QYjY8wEyJiEDcfkcSEbfrFYLKNx4cJCW0GOMbG7LDr+rr3+D+37Vbm2nU41mL4Jb/d2557zs7v/F/n3AIzw0k8THQR2QKxl3iU6MA8wxwVw9LMw9G5zIugXgAsQ9iLeRCWCRaayWJ3DQcAlqF0Yo4Qo9dmZC7qcJfIpFiaThfmCCF6ZchsCHN5WE7loaqqKtTVzewFbrcbbW1tCfs6HA40NDQkbOd9+Rj3AkldgP4xSwaaeMK+TqczaV8SnIoLzgki/od4IOp+wQNR9wvmRZTH40EmIaXiy2sN50zggpqamhK2d3d3o6urC4nQ19d3x6LkyxL2lizCkxVWVIxP4KFF+YCqQcjP8Ughrc/HQh3lI952U1+/G/9F1GxwuVwJRXFBtbW1mA12iwXvlhej2myCGgrrM5NEPj0RgsCIdE/kV0kVEDQIbfljvhbLDOIyIqZetlvxXUUJ1mfLCIeCsz6vSQyKxhq8RXm917Y9s296e9pFNVaU460yC/KUuU2FkeHkkGoWx4YPD9Y91RzfllZRr9isaCyKxsxdBoAoyhA94wdcW5yTFkubKLssorG4ACrTIvGSCBq1a2QZJuqRz+gzv6FtI/8LjfHPInK8480Thw45eJeUdun3AtZdK1FwMUBudKcgSgWQ8nKRvXUr8ra/BBSVQDSSNt8lCENfQbzRRpb1kyj+dPx+VzWr0uWjdFObkiiz2axzJvB0nOzowNumZ8ZxKQi2ZSnac25g+9mRqcMSzVQpK0PhkU8wnGPDsZ4wLvzih9cno/qRR1G/qhk2+6sIX6yHODEwNaCuUIQsMifrNJtTSumtra16LUoEC6XjRAWYjh7o7Oy847uTl0/j4O+fIscfxoefXYEpGIIoUOpWDCg//i16/GXYd9KP66PhuKkx2CwyPtiVjXXFV4HzNUDQO9kWEaYhCKUlpZhKZKVU26fjzOBZPSbGFQltzqJJF8yt24mbWVa8fsKH63/FC+IQ6DsVrx334UbIDsG6h2cJ+ppLiF6JRsVWk5ZEcfXWoC5KI/68ogBXi7N0F8zetA0dF0MYvK1GV/7fGCax3/TQTemeSF7ngsRIYebCtfCAIz2ifEOR7MUnrjF8UV0ETQ3D8PBS/PpHMGl6p70FLgxMUPKwQdNnL0TE6bsNcmGY0iPKSKsbS8kCiTpnM+HMCqpXgQCyjdKs/f8OcOtQfWJGEiIRDSRGJm3UV2TpqVMFxmgMamzSDY+tL8SY34NVdpG8KUndorpU85iEsK8/aiRBtx6XQsUATLJ40iJqZWGlXkR191NJGO0oRk0yjvf/iB1rslCal9j/ShcZsG2FAuHmCUT2DuJkPHGSD/SlVKfa29sjE0iAZHWKHy2mv0Ib8FCNyWdTcQXo12PXOrFjbT1adxej8esJDN0KIHaQYGQhq0XCRy9mozhnEOFLp2CIitHHECLuHBLVjrS8zJSyDXj8yGYEtVCkxGBKWFluKT7fehBCYBF+OB9A9yUVuSYJq+0Snl8jIyiO4lrPbmxUXHo86gMIalQEgzzuqYyJcuEe/NiVDEvffBrKklw9nqa8ILLqCpNRv/xZvLBsE5ZY7JhgQdzy38aXPacwcrMT7y0+R/mAXC1acFk0qsJU9ozV1/fGRLUSm7CAyC01w7Z/HYSsSNFk+qoL+gRjIrngEFQ97iipUX4TcGblMMqMPsR2ESK0iJ+JWZ5gSFhtqu13xxJFOxYY3iEPxr53Q99za7GtaVQQi7giX3FZo2RNolXizhIvbFl+vR7psUZXjS8IxZYqyy1cEB87VhT4BwtxAxYQXtcoFFmBcZlFL7jcWjFhOrWp+0KDhvcrPciRo64aTfuMLKkppS3GDX1vx8aNr3S/ETcRrVhAePtHYAgIyKqks5UQZ6k4NwSdpd5YHMRGc4DERzKeIOqW9KiyaX9WnCCOeFF+Ik/+Jiy0xa6MwnP2T9r8iTAtLpi0WMQnGZaIfryzzAeJm1O3kBFhg9ZlMNZuNjzx0+np4yUq3Q7iAeIqYhUWBm5ih7K2pOvRvWsdQUV6zhhiVd7ghPnj5T7U5I+7BbnArYVHuhW/v1WodSd82fgPHg20OjkMhvcAAAAASUVORK5CYII="} - ); - case Mgt.OKX_TG_WALLET:return pDt(a$t,{ - src:"data:image/png; - base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAAoCAYAAACxbNkLAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAnUSURBVHgBrVlrbFxHFT5z967tddx4/Urc4LrrVirETogJBCFBGic/UqAVsSXUCNFAgtQKCQmFfwUJjIVUIfGjEVRFqIi2ilBDEbFDS6GAlKSlaoJ4mMY0CaHOJrZSnMTxOvF7d+cwrzMz17vr9RpOctf3zp3HeX7nzFwGy+iVbG8PD/L7AFgvIKYYY4gIDAoJGQPx0jWIZ9VXDZFvbbt+UZIYDDNkw/kYG+hjQ2n4H8guOoi9yYDn+8W6h2WzZAo8QdB1tgKyQDTrbqyoxKiEBH8OmojRM2hFyEnkc8DgSD6IScEysFaBpDCM506KGbeh1rNdSGmacWSekazFDCPebGh/I21uTrcqg4I2tNYcxjDcvRahAvUjLcOxmwvutcZBcYpKa1wtJN/pS7aZf+KZ7lUn+Q7tWyW67KNG2zZtYkSu72k11O2mZzfksv2wBmKD870piC1dVg+BWsdonxn3cM4mFwyMrjHiZwysg1F31MyqTmQJ5uax7dZaZEdkbr5gT1/81VNQAQVCmH6jX+BGGK19TlYyAc0VV9JKih9wca76qnbJleihxnIjHkeaX1sGTXxGrKjulYfoFZXCOEhwqowCZV7nZGpax6vHinInboapfvovchvrxAhhn3NbrRBEci/0lKXdFJzrMbs2sooFCsVk3VKTXEc/WCeQmiYXMrEq/6Jp1cCgejNtPe1PhjcN3TyCksxEH4IBGuO04kk7p3U7iUFqVeyACikEbRMPkZ17y2XS79yBP//6umyQWG7BSPbeeG8Cdh3YpJam8DYhoQS+fmUeTh69RlODGU9RyXoOfAA2pKpB5yzyX2A2yhAqphAVp8b0BpuNRyir/OaHackUKzXB5p1JaBGCWQuqCXQ2lgK9/L1/l1y8ub0GdrdvUpYjbaCHEmuQR1gIVTQwFkkVyLQbAis7A9POrmPHWJBiDcuzhBoOrXNrmNcTM4YVyxQimKD107jydAtkKwqFOufqBKvQjXmsluPHvdfAQImA8tUqFFogkNKm4IVx63p2Ura6GaVQpE1fw+UspIAe0cQsGjAicQgZKhTITK2zvJrR5AoV2QS5KxBzVQOzRRq6eFqJ1DIcNQAZUSw2wFrkUaAQbeFoq0Wj4hUn5px7KGLgCahKKDNejuMmb5mecnlZjRikXYvL+YWorXGorWxc1yXjNlZssjTQz8t4DWq3NouhXV9lKFv+VEbs2FwP+rUY7WV0lDO4IaD3xtUFW1Vrt9Q3UpjXnhmT74nDiD06BaR3PthgRWVUCRrvSn24DmqTMdt/IbcOzow+DJnbW+DKdDPML26EnOhXG0JGjB/O59iJ0VwwlPlCQ7qkQC8JgQiwfb+l2LR7H+aerTXFm69vPiuEXig6eeeDSfj277rNIC+1+glCvFpY2giDw1+Dq5NbYJGvbBRVmDF4IYjHBi70FQoWyC60NSB/Ibchl6CaTPUxrmFRfiWyKkDU8+u6xG49xN1f0g/D0yd/AJeud8JingMVeKUuuaeMIR6MZ3N/7/rljcOFAvmFofp1RSfayhpRwztaANA5h5cHMjkHp3KGqnKtkLff289eGzkI2WwtVErCFZMCj57+2OBkf0QgTpsyKxg4AVFnfW4YkM8cXVlSHoVMla0E0eFP6/xVWOb3734eaLO31mtmMffdzcecpYLl2dpdumIG5liBZdsA2uusJI6LQXJkwFuzTfjGvx6F/xflgPcf/O1UigSiXQolSFt4SNhVDKGNKBNbKjRXlSci23WTQU9f3M/uLCTKxstqLxFTybOZhefleiGdC/hk8pxys7lMDuan8/aswey71U+iPgYt7dUlhWm5txpupOfBP/pZiLfC8FiPAPCy4Reh2jiDR9oT0LOpGt76zyL8/NJc5H0YsJ7U4OVkSPmH9Ol+Nd/HnxrD1599v6QlfjL+caitD/1RNhudf/M2fGPL3yL9Wz77BDQ+huUR0lBXQxV87r4a6E0loL5KnenApelsQc7N5sXzTNXhEE3Bod2HSnZmt8Vz07kV3Wo2k4XE+hiYaswANaP9a0H/+h0PQTlpQjF4W0scDm9dDzs2VKk2H09Hp3NF52hNBLtC9LfP6siKMVdWllejCXZmY0pnG62gIsPX39cFsyWmXScssP/+WvjSB9dBa62uIMZmcvDc+Rl4orMO2tbpWvrynVxR1iYWeSpEs4/xj5gsRaC8OPkwbrp6x4iFtdxcvA7cYYum9roQHu+8C/aKGEkat5L04sUZOD46B099osEKI+nmXM7kyyglGEuFlmHKoKy4ZksTRhl34VHUVePi5aLHy862BPy0pynS5+Z8Hp58+xZcyOThpYea4R5PmJwYOz6bK7o3yYvG0PgGoTMrZBfKCeRZ1cQOmhOjIprJXL8CieY2+/zm+Cwc+EMePnl3DWxtroZ/Ti3B0fN3oDrG4NjelohlJP1jchEY8qKc1MaDTGiczEK3fwa6qjxjtghIZRGaA4qIoI7WT1+DJU8gSWcnFtTl03N7NkBbXVgwflQgXCkdZzkMh27LbBiEqDAfeaTeBH1xahK5RgGLOSRBk+zk7T1bE/CpLzZF3DF/1ztwE3dAOfrOmUl4dlcLdDVVRdpHJpdKuk02z0+wn2W2o90sGF3TSbM9PDFh7rYZXnYFf+vBXCzaGLJneep3MbsOf/T6UbZUvq5VYf+VzevhWx9ttJny4B8n4K335wv7iumu8ZqOQGg0Dbb85OacOXqW4BevSPKqolX3peMufaYNrsxRGGO3C+qqCmdZW+M5tVy5KyauF9+9DTuPj8HIrSUYFxA+cnOxaF/BwwsLh+5OB0GAQ8QAWsZ84UxsqT2NruPM4ZacxvgmFazaCvbO7KGWV/L7tj8DYTijoHc118RsFvpeHYddv7oK00u5gveCt4zY0g7I2QMBgyec0fRBvUqx3JWjagvBiTFtITov8C3qFEDjyF+NLc1VUz0Buz/0i4rrUAKs5VcuwIHMoY60EujxhuFT4u8Rt1GgzyKIVJCSZrX2kXDRMknHyWCRzh2XIOQR3XiyOm7veAX2dL2M4Am6lisRg4HRx+4/Qlyq+qLvydazwnifFret9IJ552rMiyV6RnM+YET2cg612TzEwB0gMX/KtsYRVlM1ixNTD7BsPg6VkAAM8bky/82LX37g+367hdTnp7qTwrH6ufxoTFsFD598ScD7Tqeblh940UE5o70Ii3yWsF/LtRNNz22ANy48ys5d3SPPhVakULwXwH1q28bw0NBntJsVFYjox1PdqZj45ioLXvntyO8T/TxvRCGgtuBRmJDdOF3No39ypP+nxfPQmff2nv7Tua+mauKxfaK1ezaXT8rKbkkgcWN1mJ6cz56GoOpI+lBHyY/J/wUwVKGzeWclZQAAAABJRU5ErkJggg=="} - ); - default:return pDt(a$t,{ - src:lFt} - )} - } - ,"okxwalletIcon"); - return[pDt(RHt,{ - get children(){ - return[pDt(hHt,{ - } - ),pDt(PHt,{ - translationKey:"walletModal.mobileConnectionModal.appAndTelegram.text",children:"OKX Wallet supports OKX app and Telegram Mini Apps"} - )]} - } - ),pDt(RHt,{ - get children(){ - return pDt(yDt,{ - get each(){ - return t.connector} - ,children:Qt(s=>pDt(NHt,{ - get leftIcon(){ - return i(s)} - ,onClick:Qt(()=>t.walletConnectClick(s),"onClick"),get children(){ - return pDt(LHt,{ - get translationKey(){ - return s.walletNameKey} - ,get children(){ - return s.walletName} - } - )} - } - ),"children")} - )} - } - )]} - ,"MobileConnectAppTgModalPage"),GHt=Qt(t=>{ - bGt(); - const[i,s]=LLt(!1),[e,n]=LLt(!1),h=ULt(()=>(t.walletConnector.length>1||1==t.walletConnector.length&&t.walletConnector[0].getTag()!==Mgt.OKX_APP_WALLET)&&!e()),[r,o]=LLt(null),a=KLt(U$t); - var c,l; - let u=Qt(()=>null===t.universalLinkParams()&&!t.connectError(),"showLoading"); - var d; - BLt(()=>{ - var e=t.universalLinkParams(); - const n=h(),r=i(),a=u(); - if(n==c||r||a||(n?(Mgt.reportEvent(Mgt.OKXReportType.PAGE_IN,Mgt.Report_Proceed_Proceed_View,""),Mgt.reportEvent(Mgt.OKXReportType.PAGE_OUT,Mgt.Report_ChooseType_ConnectWallet_View,"")):(Mgt.reportEvent(Mgt.OKXReportType.PAGE_OUT,Mgt.Report_Proceed_Proceed_View,""),Mgt.reportEvent(Mgt.OKXReportType.PAGE_IN,Mgt.Report_ChooseType_ConnectWallet_View,"")),c=n),r==l||a||(r?Mgt.reportEvent(Mgt.OKXReportType.PAGE_IN,Mgt.Report_Proceed_QRCode_View,""):Mgt.reportEvent(Mgt.OKXReportType.PAGE_OUT,Mgt.Report_Proceed_QRCode_View,""),l=r),a!=d&&(a?Mgt.reportEvent(Mgt.OKXReportType.PAGE_IN,Mgt.Report_Loading_ConnectWallet_View,""):Mgt.reportEvent(Mgt.OKXReportType.PAGE_OUT,Mgt.Report_Loading_ConnectWallet_View,""),d=a),e){ - t.setLastSelectedWalletInfo(aLt(oLt({ - } - ,t.wallet),{ - openMethod:"universal-link"} - )),Mgt.logDebug(`createEffect ${ - JSON.stringify(e)} - `); - var f=e.connectRequest; - if(f){ - var p=Mgt.getOKXLink(f).universalLink; - o(p)} - } - t.connectError()&&s(!1)} - ),HLt(()=>wLt(void 0,null,function*(){ - try{ - yield t.connect().catch(t=>Mgt.logDebug(`MobileConnectionModal onMount error ${ - JSON.stringify(t)} - `))} - catch(i){ - } - } - )); - const f=Qt(()=>{ - n(!1),Mgt.reportEvent(Mgt.OKXReportType.CLICK,Mgt.Report_Proceed_Retry_Click,""); - try{ - t.connect()} - catch(i){ - } - } - ,"onRetry"),p=Qt(()=>{ - Mgt.reportEvent(Mgt.OKXReportType.CLICK,Mgt.Report_Proceed_QRCode_Click,""),s(!0),t.setLastSelectedWalletInfo(aLt(oLt({ - } - ,t.wallet),{ - openMethod:"qrcode"} - ))} - ,"onOpenQR"),w=Qt(()=>{ - s(!1),t.setLastSelectedWalletInfo(aLt(oLt({ - } - ,t.wallet),{ - openMethod:"universal-link"} - ))} - ,"onCloseQR"),g=Qt(()=>{ - i()?w():t.onBackClick()} - ,"onBack"),m=Qt(i=>{ - var s=t.universalLinkParams(); - switch(i.getTag()){ - case Mgt.OKX_APP_WALLET:return Mgt.reportEvent(Mgt.OKXReportType.CLICK,Mgt.Report_ChooseType_ConnectWallet_Click,btoa(JSON.stringify({ - Report_WalletType_Key:"app"} - ))),void(iBt()?(n(!0),s&&i.openWallet(s)):p()); - case Mgt.OKX_TG_WALLET:Mgt.reportEvent(Mgt.OKXReportType.CLICK,Mgt.Report_ChooseType_ConnectWallet_Click,btoa(JSON.stringify({ - Report_WalletType_Key:"tgminiwallet"} - ))),null==a||a.closeModal(),s&&i.openWallet(s); - break; - case Mgt.OKX_INJECT_WALLET:Mgt.reportEvent(Mgt.OKXReportType.CLICK,Mgt.Report_OKXConnectSDKExtension_ConnectDapp_Button_Click,btoa(JSON.stringify({ - Report_WalletType_Key:"tgminiwallet"} - ))),null==a||a.closeModal(),s&&i.openWallet(s)} - } - ,"walletConnectClick"); - return LLt(!1),BLt(()=>{ - } - ),pDt(z$t,{ - "data-tc-wallets-modal-connection-mobile":"true",get children(){ - return[pDt(EDt,{ - get when(){ - return!t.backDisabled} - ,get children(){ - return pDt(q$t,{ - icon:"arrow",onClick:g} - )} - } - ),pDt(EDt,{ - get when(){ - return ULt(()=>null===t.universalLinkParams())()&&!t.connectError()} - ,get children(){ - return[pDt(K$t,{ - children:"OKX Connect"} - ),pDt(AHt,{ - } - ),pDt(OHt,{ - showAllWallet:Qt(()=>!1,"showAllWallet")} - )]} - } - ),pDt(EDt,{ - get when(){ - return null!==t.universalLinkParams()||t.connectError()} - ,get children(){ - return[pDt(EDt,{ - get when(){ - return ULt(()=>!!i())()&&!t.connectError()} - ,get children(){ - return pDt(lHt,{ - get universalLink(){ - return r()} - ,get walletInfo(){ - return t.wallet} - ,get sessionConnecting(){ - return t.sessionConnecting} - } - )} - } - ),pDt(EDt,{ - get when(){ - return!i()} - ,get children(){ - return[pDt(K$t,{ - children:"OKX Connect"} - ),pDt(Y$t,{ - get isDeclined(){ - return t.connectError()} - ,get children(){ - return[pDt(EDt,{ - get when(){ - return t.connectError()} - ,get children(){ - return pDt(kHt,{ - onRetry:f,get showRetry(){ - return t.showRetry} - } - )} - } - ),pDt(EDt,{ - get when(){ - return!t.connectError()} - ,get children(){ - return[pDt(EDt,{ - get when(){ - return h()} - ,get children(){ - return pDt(DHt,{ - get connector(){ - return t.walletConnector} - ,walletConnectClick:m} - )} - } - ),pDt(EDt,{ - get when(){ - return!h()} - ,get children(){ - return pDt(xHt,{ - onOpenQR:p,onRetry:f} - )} - } - )]} - } - )]} - } - ),pDt(OHt,{ - showAllWallet:Qt(()=>!1,"showAllWallet")} - )]} - } - )]} - } - )]} - } - )} - ,"MobileConnectionModal"),BHt=EGt.div``,UHt=EGt.div` - flex: 1; - - display: flex; - - flex-direction: column; - - align-items: center; - - justify-content: center; - - min-height: 200px; - - margin-bottom: 16px; - - `,FHt=EGt(w$t)` - margin-bottom: 0; - - padding: 10px 24px 0px 24px; - - font-size: 14px; - - font-color: ${ - t=>t.theme.colors.text.contrast} - ; - - `,$Ht=EGt.div` - margin-top: 24px; - - margin-left: 24px; - - margin-right: 24px; - - margin-bottom: 10px; - - `,HHt=EGt.div` - display: flex; - - justify-content: center; - - align-items: center; - - `,WHt=EGt.div` - display: flex; - - flex-direction: column; - - width: 270px; - - height: 270px; - - justify-content: center; - - align-items: center; - - aspect-ratio: 1/1; - - border-radius: 16px; - - background: ${ - t=>t.theme.colors.background.secondary} - ; - - `; - var VHt=GDt('<svg><path fill-rule=evenodd clip-rule=evenodd d="M96 51C96 75.8528 75.8528 96 51 96C26.1472 96 6 75.8528 6 51C6 26.1472 26.1472 6 51 6C75.8528 6 96 26.1472 96 51ZM102 51C102 79.1665 79.1665 102 51 102C22.8335 102 0 79.1665 0 51C0 22.8335 22.8335 0 51 0C79.1665 0 102 22.8335 102 51Z"fill-opacity=0.2></svg>',!1,!0,!1),jHt=GDt('<svg><path fill-rule=evenodd clip-rule=evenodd d="M6 51H0C0 79.1665 22.8335 102 51 102V96C26.1472 96 6 75.8528 6 51Z"></svg>',!1,!0,!1); - const KHt=EGt(Qt(t=>{ - const i=bGt(),s=vGt` - 0% { - - transform: rotate(0deg); - - } - - 100% { - - transform: rotate(360deg); - - } - - `; - return pDt(EGt.svg` - animation: ${ - s} - 2s linear infinite; - - transform-origin: center; - - `,{ - xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 102 102",fill:"none",get children(){ - return[(s=VHt(),GLt(()=>UDt(s,"fill",i.colors.text.primary)),s),(t=jHt(),GLt(()=>UDt(t,"fill",i.colors.text.primary)),t)]; - var t,s} - } - )} - ,"LoadingIcon"))` - height: 16px; - - width: 16px; - - position: absolute; - - top: 50%; - - left: 50%; - - transform: translate(-50%, -50%); - - `,zHt=Qt(t=>(HLt(()=>{ - Mgt.reportEvent(Mgt.OKXReportType.PAGE_IN,Mgt.Report_Proceed_QRCode_View,"")} - ),WLt(()=>{ - Mgt.reportEvent(Mgt.OKXReportType.PAGE_OUT,Mgt.Report_Proceed_QRCode_View,"")} - ),[pDt($Ht,{ - get children(){ - return[pDt(EDt,{ - get when(){ - return t.sessionConnecting()} - ,get children(){ - return pDt(HHt,{ - get children(){ - return pDt(nHt,{ - } - )} - } - )} - } - ),pDt(EDt,{ - get when(){ - return!t.sessionConnecting()} - ,get children(){ - return[pDt(EDt,{ - get when(){ - return null!==t.universalLink} - ,get children(){ - return pDt(WFt,{ - imageUrl:lFt,get sourceUrl(){ - return Z$t(t.universalLink,"none")} - ,disableCopy:!0} - )} - } - ),pDt(EDt,{ - get when(){ - return null===t.universalLink} - ,get children(){ - return pDt(WHt,{ - get children(){ - return[pDt(KHt,{ - } - ),pDt(FHt,{ - translationKey:"common.loading",children:"Loading"} - )]} - } - )} - } - )]} - } - )]} - } - ),pDt(FHt,{ - translationKey:"walletModal.mobileConnectionModal.scanQR",get translationValues(){ - return{ - name:t.walletInfo.name} - } - ,get children(){ - return["Scan the QR code below with your phone’s or ",ULt(()=>t.walletInfo.name),"’s camera"]} - } - )]),"DesktopConnectionQR"),YHt=EGt.div` - display: flex; - - flex-direction: row; - - justify-content: center; - - align-items: center; - - padding-bottom: 20px; - - margin-top: 10px; - - border-bottom: 0.5px solid ${ - t=>kGt(t.theme.colors.icon.secondary,.2)} - ; - - width: 100%; - - `,qHt=EGt.div` - flex: 1; - - margin-left: 16px; - - display: flex; - - flex-direction: column; - - `,XHt=EGt(f$t)` - font-weight: 500; - - font-size: 18px; - - text-align: left; - - `,JHt=EGt(XFt)` - font-weight: 500; - - font-size: 14px; - - margin-top: 5px; - - color: ${ - t=>t.theme.colors.text.contrast} - ; - - `,QHt=EGt(IUt)` - width: 48px; - - height: 48px; - - margin-left: 24px; - - `,ZHt=EGt(NUt)` - border-radius: 20px; - - padding: 6px 14px; - - margin-right: 24px; - - display: inline-flex; - - background-color: transparent; - - border: 0.5px solid ${ - t=>t.theme.colors.text.secondary} - ; - ; - - white-space: nowrap; - - cursor: pointer; - - `,tWt=EGt(XFt)` - font-size: 12px; - - font-weight: 400; - - color: ${ - t=>t.theme.colors.text.primary} - ; - - `,iWt=Qt(t=>(HLt(()=>{ - Mgt.reportEvent(Mgt.OKXReportType.PAGE_IN,Mgt.Report_OKXConnectSDKExtension_ConnectDapp_Page_View,"")} - ),WLt(()=>{ - Mgt.reportEvent(Mgt.OKXReportType.PAGE_OUT,Mgt.Report_OKXConnectSDKExtension_ConnectDapp_Page_View,"")} - ),pDt(YHt,{ - get children(){ - return[pDt(QHt,{ - src:lFt} - ),pDt(qHt,{ - get children(){ - return[pDt(XHt,{ - translationKey:"walletModal.mobileConnectionModal.connectInjectedOpening",children:"Opening OKX Wallet..."} - ),pDt(JHt,{ - translationKey:"walletModal.mobileConnectionModal.connectInjectedConfirm",children:"Confirm in OKX Wallet extension"} - )]} - } - ),pDt(ZHt,{ - get onClick(){ - return t.injectedRetry} - ,get children(){ - return pDt(tWt,{ - translationKey:"common.retry",children:"Retry"} - )} - } - )]} - } - )),"DesktopOpenInjectedModal"),sWt=Qt(t=>{ - const i=t.connector.some(t=>t.getTag()===Mgt.OKX_APP_WALLET); - return t.connector.filter(t=>Mgt.CONNECTOR_TYPE.INJECT.STANDARD_INJECT_WALLET==t.getType()),[pDt(EDt,{ - get when(){ - return t.injectedOpen()} - ,get children(){ - return pDt(iWt,{ - get injectedRetry(){ - return t.injectedRetry} - } - )} - } - ),pDt(EDt,{ - when:i,get children(){ - return pDt(zHt,{ - get universalLink(){ - return t.qrLink()} - ,get walletInfo(){ - return t.wallet} - ,get sessionConnecting(){ - return t.sessionConnecting} - } - )} - } - )]} - ,"DesktopConnectAppTgModalPage"),eWt=Qt(t=>{ - bGt(),KLt(U$t); - const[i,s]=LLt(!1); - t.setLastSelectedWalletInfo(aLt(oLt({ - } - ,t.wallet),{ - openMethod:"qrcode"} - )),HLt(()=>{ - Mgt.reportEvent(Mgt.OKXReportType.PAGE_IN,Mgt.Report_ChooseType_ConnectWallet_View,"")} - ),WLt(()=>{ - Mgt.reportEvent(Mgt.OKXReportType.PAGE_OUT,Mgt.Report_ChooseType_ConnectWallet_View,"")} - ); - const e=ULt(()=>null===t.universalLinkParams()&&!t.connectError()),n=ULt(()=>null!==t.universalLinkParams()||t.connectError()),h=ULt(()=>n()&&t.connectError()),r=ULt(()=>n()&&!t.connectError()); - BLt(()=>{ - Mgt.logDebug("TON customEvent.detail :::",BLt); - var i=t.universalLinkParams(); - if(Mgt.logDebug("TON customEvent.detail :::",JSON.stringify(i)),i){ - t.setLastSelectedWalletInfo(aLt(oLt({ - } - ,t.wallet),{ - openMethod:"universal-link"} - )); - var e=i.connectRequest; - if(e){ - var n=Mgt.getOKXLink(e).universalLink; - a(n)} - var h=t.walletConnector.find(t=>t.getTag()===Mgt.OKX_INJECT_WALLET); - h&&!aUt()&&(h.openWallet(i),s(!0),t.setLastSelectedWalletInfo(aLt(oLt({ - } - ,t.wallet),{ - openMethod:"inject"} - )))} - } - ); - const[o,a]=LLt(null); - HLt(()=>wLt(void 0,null,function*(){ - try{ - yield t.connect().catch(t=>Mgt.logDebug("DesktopConnectionModal connect catch error ",JSON.stringify(t)))} - catch(i){ - Mgt.logDebug("DesktopConnectionModal connect error ",JSON.stringify(i))} - } - )); - const c=Qt(()=>{ - Mgt.reportEvent(Mgt.OKXReportType.CLICK,Mgt.Report_Proceed_Retry_Click,""); - try{ - t.connect()} - catch(i){ - } - } - ,"onRetry"),l=Qt(()=>{ - var i=t.walletConnector.find(t=>t.getTag()===Mgt.OKX_INJECT_WALLET); - i&&(u(i),Mgt.reportEvent(Mgt.OKXReportType.CLICK,Mgt.Report_OKXConnectSDKExtension_Module_Retry_Click,""))} - ,"injectedRetry"),u=Qt(i=>{ - var s=t.universalLinkParams(); - s&&(i.openWallet(s),t.setLastSelectedWalletInfo(aLt(oLt({ - } - ,t.wallet),{ - openMethod:"inject"} - )))} - ,"injectedWalletClick"); - return pDt(BHt,{ - "data-tc-wallets-modal-connection-mobile":"true",get children(){ - return[pDt(K$t,{ - children:"OKX Connect"} - ),pDt(EDt,{ - get when(){ - return e()} - ,get children(){ - return[pDt(AHt,{ - } - ),pDt(OHt,{ - showAllWallet:Qt(()=>aUt(),"showAllWallet")} - )]} - } - ),pDt(EDt,{ - get when(){ - return n()} - ,get children(){ - return[pDt(EDt,{ - get when(){ - return h()} - ,get children(){ - return pDt(UHt,{ - get children(){ - return pDt(kHt,{ - onRetry:c,get showRetry(){ - return t.showRetry} - } - )} - } - )} - } - ),pDt(EDt,{ - get when(){ - return r()} - ,get children(){ - return pDt(UHt,{ - get children(){ - return pDt(sWt,{ - get connector(){ - return t.walletConnector} - ,get wallet(){ - return t.wallet} - ,get sessionConnecting(){ - return t.sessionConnecting} - ,qrLink:Qt(()=>o(),"qrLink"),injectedRetry:l,injectedOpen:i,openWallet:u} - )} - } - )} - } - ),pDt(OHt,{ - showAllWallet:Qt(()=>aUt(),"showAllWallet")} - )]} - } - )]} - } - )} - ,"DesktopConnectionModal"),nWt=Qt(t=>{ - const{ - locale:i} - =YFt()[1]; - BLt(()=>i(t.language)); - const s=ULt(()=>iBt()); - return BLt(()=>{ - t.opened&&eBt()} - ),pDt(j$t,{ - get opened(){ - return t.opened} - ,onClose:Qt(()=>{ - var i; - t.onClose("action-cancelled"),null==(i=t.disconnect)||i.call(t)} - ,"onClose"),"data-tc-wallets-modal-container":"true",get children(){ - return[pDt(EDt,{ - get when(){ - return t.loadingBeforeConnect()} - ,get children(){ - return[pDt(K$t,{ - get children(){ - var i; - return null==(i=t.walletInfo)?void 0:i.name} - } - ),pDt(AHt,{ - } - )]} - } - ),pDt(EDt,{ - get when(){ - return!t.loadingBeforeConnect()} - ,get children(){ - return pDt(EDt,{ - when:!0,get children(){ - return pDt(rGt,{ - get component(){ - return s()?GHt:eWt} - ,get wallet(){ - return t.walletInfo} - ,onBackClick:Qt(()=>{ - } - ,"onBackClick"),backDisabled:!0,get connect(){ - return t.connect} - ,get universalLinkParams(){ - return t.universalLinkParams} - ,get lastSelectedWalletInfo(){ - return t.lastSelectedWalletInfo} - ,get setLastSelectedWalletInfo(){ - return t.setLastSelectedWalletInfo} - ,get connectError(){ - return t.connectError} - ,get showRetry(){ - return t.showRetry} - ,get sessionConnecting(){ - return t.sessionConnecting} - ,get walletConnector(){ - return t.walletConnector()} - } - )} - } - )} - } - )]} - } - )} - ,"SingleWalletModal"),hWt={ - common:{ - openWallet:"打开钱包",get:"获取",close:"关闭",retry:"再试一次",loading:"载入中",walletOpening:"正在打开 { - { - name } - } - ",confirmInWallet:"请在钱包中确认"} - ,button:{ - connectWallet:"连接钱包",dropdown:{ - copy:"复制地址",copied:"地址已复制",disconnect:"断开连接"} - } - ,notifications:{ - confirm:{ - header:"打开 { - { - name } - } - 进行确认"} - ,transactionSent:{ - header:"已发送",text:"即将完成,请稍候"} - ,transactionCanceled:{ - header:"已取消",text:"账户未发生任何更改"} - } - ,walletModal:{ - mobileConnectionModal:{ - OKXConnect:"OKX Connect",showQR:"展示二维码",scanQR:"使用手机或 OKX Wallet App 扫描二维码",continueIn:"在欧易钱包中继续完成",connectionDeclined:"连接失败",PoweredBy:"Powered by",appAndTelegram:{ - header:"连接欧易钱包",text:"欧易钱包可在欧易 App 和 Telegram 使用"} - ,connectApp:"欧易 App",connectMini:"欧易 Mini Wallet",connectInjected:"欧易钱包插件",connectInjectedOpening:"正在打开欧易钱包...",connectInjectedConfirm:"请在钱包插件确认连接"} - } - ,actionModal:{ - confirmTransaction:{ - header:"在 { - { - name } - } - 中确认",text:"请稍候"} - ,transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"} - } - ,rWt={ - en_US:oWt({ - common:{ - openWallet:"Open wallet",get:"Get",close:"Close",retry:"Retry",loading:"Loading",walletOpening:"Opening { - { - name } - } - ",confirmInWallet:"Confirm in wallet to continue."} - ,button:{ - connectWallet:"Connect wallet",dropdown:{ - copy:"Copy address",copied:"Address copied",disconnect:"Disconnect"} - } - ,notifications:{ - confirm:{ - header:"Open { - { - name } - } - to confirm."} - ,transactionSent:{ - header:"Sent",text:"This action will be completed in a few seconds."} - ,transactionCanceled:{ - header:"Canceled",text:"There’ll be no changes to your account."} - ,transactionError:{ - header:"Error",text:"There’ll be no changes to your account."} - } - ,walletModal:{ - mobileConnectionModal:{ - OKXConnect:"OKX Connect",showQR:"Show QR Code",scanQR:"Scan the QR code with your phone or OKX Wallet app",continueIn:"Proceed in OKX Wallet",connectionDeclined:"Connection failed",PoweredBy:"Powered by",appAndTelegram:{ - header:"Connect to OKX Wallet",text:"OKX Wallet is available on OKX App and Telegram"} - ,connectApp:"OKX App",connectMini:"OKX Mini Wallet",connectInjected:"OKX Wallet extension",connectInjectedOpening:"Opening OKX Wallet...",connectInjectedConfirm:"Confirm in OKX Wallet extension"} - } - ,actionModal:{ - confirmTransaction:{ - header:"Confirm in { - { - name } - } - ",text:"It’ll only take a moment."} - ,transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"} - } - ),ru_RU:oWt({ - common:{ - openWallet:"Открыть кошелек",get:"ПОЛУЧИТЬ",close:"Закрыть",retry:"Повторить попытку",loading:"Загрузка",walletOpening:"Открываем { - { - name } - } - ",confirmInWallet:"Подтвердите в кошельке, чтобы продолжить."} - ,button:{ - connectWallet:"Подключить кошелек",dropdown:{ - copy:"Скопировать адрес",copied:"Адрес скопирован.",disconnect:"Отключить"} - } - ,notifications:{ - confirm:{ - header:"Откройте { - { - name } - } - для подтверждения транзакции."} - ,transactionSent:{ - header:"Транзакция отправлена",text:"Транзакция будет обработана через несколько секунд."} - ,transactionCanceled:{ - header:"Транзакция отменена",text:"Изменений в аккаунте не будет."} - } - ,walletModal:{ - mobileConnectionModal:{ - showQR:"Показать QR-код",scanQR:"Сканируйте QR-код с помощью телефона или в приложении OKX Wallet",continueIn:"Продолжить выполнение транзакции в Кошельке OKX",connectionDeclined:"Подключение отклонено",PoweredBy:"Powered by",appAndTelegram:{ - header:"Connect to OKX Wallet",text:"Кошелек OKX доступен в приложении OKX и в Telegram"} - ,connectApp:"Подключиться к приложению OKX",connectMini:"Подключиться к мини-Кошельку OKX"} - } - ,actionModal:{ - confirmTransaction:{ - header:"Подтвердите транзакцию в { - { - name } - } - ",text:"Это займет всего несколько секунд."} - ,transactionSent:"$notifications.transactionSent",transactionCanceled:"$notifications.transactionCanceled"} - } - ),zh_CN:oWt(hWt),zh:oWt(hWt),ar_AE:oWt({ - common:{ - openWallet:"فتح محفظة",get:"حصول",close:"إغلاق",retry:"إعادة المحاولة",loading:"جار التحميل",walletOpening:"جار فتح { - { - name } - } - ",confirmInWallet:"أكد داخل المحفظة للمتابعة."} - ,button:{ - connectWallet:"ربط المحفظة",dropdown:{ - copy:"نسخ العنوان",copied:"تم نسخ العنوان",disconnect:"إلغاء الربط"} - } - ,notifications:{ - confirm:{ - header:"افتح { - { - name } - } - لتأكيد المعاملة."} - ,transactionSent:{ - header:"أُرسلت المعاملة",text:"ستتم معالجة معاملتك في غضون ثوانٍ قليلة."} - ,transactionCanceled:{ - header:"أُلغيت المعاملة",text:"لن تطرأ أية تغييرات على حسابك."} - } - ,walletModal:{ - mobileConnectionModal:{ - showQR:"عرض رمز QR",scanQR:"امسح كود الـ QR باستخدام هاتفك أو تطبيق محفظة OKX Wallet",continueIn:"متابعة المعاملة في محفظة OKX",connectionDeclined:"فشل الاتصال",PoweredBy:"Powered by",appAndTelegram:{ - header:"Connect to OKX Wallet",text:"محفظة OKX متاحة على تطبيق OKX وTelegram"} - ,connectApp:"الربط بتطبيق OKX",connectMini:"الربط بمحفظة OKX المصغرة"} - } - ,actionModal:{ - confirmTransaction:{ - header:"تأكيد المعاملة في { - { - name } - } - ",text:"لن يستغرق الأمر سوى لحظات."} - } - } - ),cs_CZ:oWt({ - common:{ - openWallet:"Otevřít peněženku",get:"Získat",close:"Zavřít",retry:"Zkusit znovu"} - ,button:{ - connectWallet:"Připojit peněženku",dropdown:{ - copy:"Kopírovat adresu",copied:"Adresa zkopírována",disconnect:"Odpojit"} - } - ,notifications:{ - confirm:{ - header:"Otevřete { - { - name } - } - a potvrďte transakci."} - ,transactionSent:{ - header:"Transakce odeslána",text:"Vaše transakce bude zrušena během několika sekund."} - ,transactionCanceled:{ - header:"Transakce zrušena",text:"Na vašem účtu nedojde k žádným změnám."} - } - ,walletModal:{ - mobileConnectionModal:{ - showQR:"Zobrazit QR kód",scanQR:"Naskenujte níže uvedený QR kód pomocí kamery telefonu nebo { - { - name } - } - ",continueIn:"Potvrďte transakci v OKX Peněžence.",connectionDeclined:"Připojení selhalo",PoweredBy:"Powered by",appAndTelegram:{ - header:"Connect to OKX Wallet",text:"OKX Peněženka je k dispozici v aplikaci OKX a na síti Telegram."} - ,connectApp:"Připojit k aplikaci OKX",connectMini:"Připojit k minipeněžence OKX"} - } - ,actionModal:{ - confirmTransaction:{ - header:"Potvrďte transakci na { - { - name } - } - .",text:"Zabere to jen chvilku."} - } - } - ),de_DE:oWt({ - common:{ - openWallet:"Wallet öffnen",get:"Erhalten",close:"Schließen",retry:"Wiederholen",loading:"Wird geladen",walletOpening:"{ - { - name } - } - wird geöffnet",confirmInWallet:"Zum Fortfahren in der Wallet bestätigen."} - ,button:{ - connectWallet:"Wallet verknüpfen",dropdown:{ - copy:"Adresse kopieren",copied:"Adresse kopiert",disconnect:"Trennen"} - } - ,notifications:{ - confirm:{ - header:"{ - { - name } - } - öffnen und Transaktion bestätigen."} - ,transactionSent:{ - header:"Transaktion gesendet",text:"Ihre Transaktion wird in wenigen Sekunden bearbeitet."} - ,transactionCanceled:{ - header:"Transaktion storniert",text:"Es werden keine Änderungen an Ihrem Konto vorgenommen."} - } - ,walletModal:{ - mobileConnectionModal:{ - showQR:"QR-Code anzeigen",scanQR:"Scanne den QR-Code mit deinem Smartphone oder deiner OKX Wallet",continueIn:"Setzen Sie die Transaktion in der OKX Wallet fort",connectionDeclined:"Verbindung fehlgeschlagen",PoweredBy:"Powered by",appAndTelegram:{ - header:"Connect to OKX Wallet",text:"OKX Wallet ist in der OKX App und auf Telegram verfügbar"} - ,connectApp:"Mit der OKX-App verbinden",connectMini:"Mit der OKX-Mini-Wallet verbinden"} - } - ,actionModal:{ - confirmTransaction:{ - header:"Transaktion in { - { - name } - } - bestätigen",text:"Es dauert nur einen Augenblick."} - } - } - ),es_ES:oWt({ - common:{ - openWallet:"Abrir wallet",get:"Consigue",close:"Cerrar",retry:"Volver a intentar",loading:"Cargando",walletOpening:"Abriendo { - { - name } - } - ",confirmInWallet:"Confirmar en la billetera para continuar."} - ,button:{ - connectWallet:"Conectar billetera",dropdown:{ - copy:"Copiar dirección",copied:"Dirección copiada",disconnect:"Desconectar"} - } - ,notifications:{ - confirm:{ - header:"Abre { - { - name } - } - para confirmar la transacción."} - ,transactionSent:{ - header:"Transacción enviada",text:"Tu transacción se procesará en unos segundos."} - ,transactionCanceled:{ - header:"Transacción cancelada",text:"No se realizarán cambios en tu cuenta."} - } - ,walletModal:{ - mobileConnectionModal:{ - showQR:"Mostrar código QR",scanQR:"Escanea el código QR con tu teléfono o la aplicación OKX Wallet",continueIn:"Continuar con la transacción en OKX Wallet",connectionDeclined:"Error de conexión",PoweredBy:"Powered by",appAndTelegram:{ - header:"Connect to OKX Wallet",text:"OKX Wallet está disponible en la OKX app y en Telegram"} - ,connectApp:"Conectarse a la OKX app",connectMini:"Conectarse a la OKX Mini Wallet"} - } - ,actionModal:{ - confirmTransaction:{ - header:"Confirma la transacción de { - { - name } - } - ",text:"Solo te llevará un momento."} - } - } - ),es_LAT:oWt({ - common:{ - openWallet:"Abrir billetera",get:"Obtener",close:"Cerrar",retry:"Reintentar",loading:"Cargando",walletOpening:"Abriendo { - { - name } - } - ",confirmInWallet:"Confirma en la billetera para continuar."} - ,button:{ - connectWallet:"Conectar billetera",dropdown:{ - copy:"Copiar dirección",copied:"Dirección copiada",disconnect:"Desconectar"} - } - ,notifications:{ - confirm:{ - header:"Abre { - { - name } - } - para confirmar la transacción."} - ,transactionSent:{ - header:"Transacción enviada",text:"Tu transacción se procesará en unos segundos."} - ,transactionCanceled:{ - header:"Transacción cancelada",text:"No habrá cambios en tu cuenta."} - } - ,walletModal:{ - mobileConnectionModal:{ - showQR:"Mostrar código QR",scanQR:"Escanea el código QR con tu teléfono o la app de OKX Wallet",continueIn:"Continúa la transacción en OKX Wallet",connectionDeclined:"Error de conexión",PoweredBy:"Powered by",appAndTelegram:{ - header:"Connect to OKX Wallet",text:"OKX Wallet está disponible en la aplicación de OKX y Telegram"} - ,connectApp:"Conéctate a la aplicación de OKX",connectMini:"Conéctate a la OKX Mini Wallet"} - } - ,actionModal:{ - confirmTransaction:{ - header:"Confirmar la transacción en { - { - name } - } - ",text:"Solo tomará un momento."} - } - } - ),fr_FR:oWt({ - common:{ - openWallet:"Portefeuille ouvert",get:"Obtenir",close:"Fermer",retry:"Réessayer",loading:"Chargement en cours",walletOpening:"Ouverture de { - { - name } - } - en cours",confirmInWallet:"Confirmez dans le portefeuille pour continuer."} - ,button:{ - connectWallet:"Connecter le portefeuille",dropdown:{ - copy:"Copier l’adresse",copied:"Adresse copiée",disconnect:"Déconnecter"} - } - ,notifications:{ - confirm:{ - header:"Ouvrir { - { - name } - } - pour confirmer la transaction."} - ,transactionSent:{ - header:"Transaction envoyée",text:"Votre transaction sera traitée en quelques secondes."} - ,transactionCanceled:{ - header:"Transaction annulée",text:"Aucun changement ne sera apporté à votre compte."} - } - ,walletModal:{ - mobileConnectionModal:{ - showQR:"Afficher le code QR",scanQR:"Scannez le code QR avec votre téléphone ou depuis l’appli OKX Wallet",continueIn:"Poursuivre la transaction dans OKX Wallet",connectionDeclined:"Échec de la connexion",PoweredBy:"Powered by",appAndTelegram:{ - header:"Connect to OKX Wallet",text:"OKX Wallet est disponible sur OKX App et Telegram"} - ,connectApp:"Se connecter à l’appli OKX",connectMini:"Se connecter à OKX Mini Wallet"} - } - ,actionModal:{ - confirmTransaction:{ - header:"Confirmer la transaction dans { - { - name } - } - ",text:"Cela ne prendra qu'un instant."} - } - } - ),id_ID:oWt({ - common:{ - openWallet:"Buka wallet",get:"Dapatkan",close:"Tutup",retry:"Coba lagi",loading:"Memuat",walletOpening:"Membuka { - { - nama } - } - ",confirmInWallet:"Konfirmasi di wallet untuk melanjutkan."} - ,button:{ - connectWallet:"Hubungkan wallet",dropdown:{ - copy:"Salin alamat",copied:"Alamat disalin",disconnect:"Putuskan sambungan"} - } - ,notifications:{ - confirm:{ - header:"Buka { - { - name } - } - untuk mengonfirmasi transaksi."} - ,transactionSent:{ - header:"Transaksi terkirim",text:"Transaksi Anda akan diproses dalam beberapa detik."} - ,transactionCanceled:{ - header:"Transaksi dibatalkan",text:"Tidak akan ada perubahan pada akun Anda."} - } - ,walletModal:{ - mobileConnectionModal:{ - showQR:"Tampilkan Kode QR",scanQR:"Pindai kode QR dengan aplikasi OKX Wallet atau ponsel Anda",continueIn:"Lanjutkan transaksi di OKX Wallet",connectionDeclined:"Koneksi gagal",PoweredBy:"Powered by",appAndTelegram:{ - header:"Connect to OKX Wallet",text:"OKX Wallet tersedia di OKX App dan Telegram"} - ,connectApp:"Hubungkan ke OKX App",connectMini:"Hubungkan ke OKX Mini Wallet"} - } - ,actionModal:{ - confirmTransaction:{ - header:"Konfirmasi transaksi pada { - { - name } - } - ",text:"Hanya perlu beberapa saat."} - } - } - ),it_IT:oWt({ - common:{ - openWallet:"Apri portafoglio",get:"Ottieni",close:"Chiudi",retry:"Riprova",loading:"Caricamento in corso",walletOpening:"Apertura { - { - name } - } - in corso",confirmInWallet:"Conferma nel wallet per continuare."} - ,button:{ - connectWallet:"Connetti il portafoglio",dropdown:{ - copy:"Copia indirizzo",copied:"Indirizzo copiato",disconnect:"Disconnetti"} - } - ,notifications:{ - confirm:{ - header:"Apri { - { - name } - } - per confermare la transazione."} - ,transactionSent:{ - header:"Transazione inviata",text:"La transazione verrà elaborata in pochi secondi."} - ,transactionCanceled:{ - header:"Transazione annullata",text:"Il tuo conto non subirà modifiche."} - } - ,walletModal:{ - mobileConnectionModal:{ - showQR:"Mostra il codice QR",scanQR:"Scansiona il codice QR con il tuo telefono o l'app OKX Wallet",continueIn:"Continua la transazione in OKX Wallet",connectionDeclined:"Collegamento non riuscito",PoweredBy:"Powered by",appAndTelegram:{ - header:"Connect to OKX Wallet",text:"OKX Wallet è disponibile sull'app OKX e Telegram"} - ,connectApp:"Connettiti all'app OKX",connectMini:"Connettiti a OKX Mini Wallet"} - } - ,actionModal:{ - confirmTransaction:{ - header:"Conferma la transazione in { - { - name } - } - ",text:"Ci vorrà solo un secondo."} - } - } - ),nl_NL:oWt({ - common:{ - openWallet:"Wallet openen",get:"Krijgen",close:"Sluiten",retry:"Opnieuw proberen",loading:"Laden...",walletOpening:"{ - { - name } - } - wordt geopend",confirmInWallet:"Bevestig in de wallet om door te gaan."} - ,button:{ - connectWallet:"Wallet koppelen",dropdown:{ - copy:"Adres kopiëren",copied:"Adres gekopieerd",disconnect:"Verbinding verbreken"} - } - ,notifications:{ - confirm:{ - header:"Open { - { - name } - } - om de transactie te bevestigen."} - ,transactionSent:{ - header:"Transactie verstuurd",text:"Je transactie wordt binnen een paar seconden verwerkt."} - ,transactionCanceled:{ - header:"Transactie geannuleerd",text:"Er verandert niets aan je account."} - } - ,walletModal:{ - mobileConnectionModal:{ - showQR:"QR-code weergeven",scanQR:"Scan de QR-code met je telefoon of de OKX Wallet-app",continueIn:"Ga verder met de transactie in OKX Wallet",connectionDeclined:"Koppelen mislukt",PoweredBy:"Powered by",appAndTelegram:{ - header:"Connect to OKX Wallet",text:"OKX Wallet is beschikbaar op OKX App en Telegram"} - ,connectApp:"Koppelen met de OKX-app",connectMini:"Koppelen met OKX Mini Wallet"} - } - ,actionModal:{ - confirmTransaction:{ - header:"De transactie in { - { - name } - } - bevestigen",text:"Het is zo gebeurd."} - } - } - ),pl_PL:oWt({ - common:{ - openWallet:"Otwórz portfel",get:"Otrzymaj",close:"Zamknij",retry:"Spróbuj ponownie",loading:"Wczytywanie",walletOpening:"Otwieranie { - { - name } - } - ",confirmInWallet:"Potwierdź w portfelu, aby kontynuować."} - ,button:{ - connectWallet:"Połącz portfel",dropdown:{ - copy:"Kopiuj adres",copied:"Adres skopiowany",disconnect:"Rozłącz"} - } - ,notifications:{ - confirm:{ - header:"Otwórz { - { - name } - } - , aby potwierdzić transakcję."} - ,transactionSent:{ - header:"Wysłano transakcję",text:"Transakcja zostanie przetworzona w ciągu kilku sekund."} - ,transactionCanceled:{ - header:"Anulowano transakcję",text:"Na koncie nie zostaną wprowadzone żadne zmiany."} - } - ,walletModal:{ - mobileConnectionModal:{ - showQR:"Pokaż kod QR",scanQR:"Zeskanuj kod QR telefonem lub aplikacją OKX Wallet",continueIn:"Kontynuuj transakcję w OKX Wallet",connectionDeclined:"Połączenie nieudane",PoweredBy:"Powered by",appAndTelegram:{ - header:"Connect to OKX Wallet",text:"OKX Wallet jest dostępny w aplikacji OKX i Telegramie"} - ,connectApp:"Połącz z aplikacją OKX",connectMini:"Połącz z OKX Mini Wallet"} - } - ,actionModal:{ - confirmTransaction:{ - header:"Potwierdź transakcję w { - { - name } - } - ",text:"To zajmie tylko chwilę."} - } - } - ),pt_BR:oWt({ - common:{ - openWallet:"Abrir carteira",get:"Receber",close:"Fechar",retry:"Tentar novamente",loading:"Carregando",walletOpening:"Abrindo { - { - name } - } - ",confirmInWallet:"Confirme na carteira para continuar."} - ,button:{ - connectWallet:"Conectar carteira",dropdown:{ - copy:"Copiar endereço",copied:"Endereço copiado",disconnect:"Desconectar"} - } - ,notifications:{ - confirm:{ - header:"Abrir { - { - name } - } - para confirmar a transação."} - ,transactionSent:{ - header:"Transação enviada",text:"Sua transação será processada em alguns segundos."} - ,transactionCanceled:{ - header:"Transação cancelada",text:"Não haverá alterações em sua conta."} - } - ,walletModal:{ - mobileConnectionModal:{ - showQR:"Mostrar Código QR",scanQR:"Escaneie o código QR com seu telefone ou com o aplicativo OKX Wallet",continueIn:"Continuar a transação na OKX Wallet",connectionDeclined:"Falha na conexão",PoweredBy:"Powered by",appAndTelegram:{ - header:"Connect to OKX Wallet",text:"A OKX Wallet está disponível na OKX App e no Telegram"} - ,connectApp:"Conecte-se à OKX App",connectMini:"Conecte-se à OKX Mini Wallet"} - } - ,actionModal:{ - confirmTransaction:{ - header:"Confirmar a transação em { - { - name } - } - ",text:"Isso levará apenas um momento."} - } - } - ),pt_PT:oWt({ - common:{ - openWallet:"Abrir carteira",get:"Receber",close:"Fechar",retry:"Tentar novamente",loading:"A carregar",walletOpening:"A abrir { - { - name } - } - ",confirmInWallet:"Confirmar na carteira para continuar."} - ,button:{ - connectWallet:"Associar carteira",dropdown:{ - copy:"Copiar endereço",copied:"Endereço copiado",disconnect:"Desassociar"} - } - ,notifications:{ - confirm:{ - header:"Abra { - { - name } - } - para confirmar a transação."} - ,transactionSent:{ - header:"Transação efetuada",text:"A sua transação será processada dentro de poucos segundos."} - ,transactionCanceled:{ - header:"Transação cancelada",text:"Não serão feitas alterações à sua conta."} - } - ,walletModal:{ - mobileConnectionModal:{ - showQR:"Mostrar código QR",scanQR:"Digitaliza o código QR com o teu telemóvel ou com a aplicação OKX Wallet",continueIn:"Continuar a transação na OKX Wallet",connectionDeclined:"Falha na ligação",PoweredBy:"Powered by",appAndTelegram:{ - header:"Connect to OKX Wallet",text:"A OKX Wallet está disponível na Aplicação da OKX e no Telegram"} - ,connectApp:"Associar à Aplicação da OKX",connectMini:"Associar à OKX Mini Wallet"} - } - ,actionModal:{ - confirmTransaction:{ - header:"Confirmar a transação na { - { - name } - } - ",text:"Demora apenas um momento."} - } - } - ),ro_RO:oWt({ - common:{ - openWallet:"Deschideți portofelul",get:"Primiți",close:"Închideți",retry:"Reîncercați",loading:"Încărcare",walletOpening:"Deschidere”{ - { - nume } - } - ",confirmInWallet:"Confirmă în portofel pentru a continua."} - ,button:{ - connectWallet:"Conectați portofelul",dropdown:{ - copy:"Copiați adresa",copied:"Adresă copiată",disconnect:"Deconectați"} - } - ,notifications:{ - confirm:{ - header:"Deschideți { - { - name } - } - pentru a confirma tranzacția."} - ,transactionSent:{ - header:"Tranzacție trimisă",text:"Tranzacția dvs. va fi procesată în câteva secunde."} - ,transactionCanceled:{ - header:"Tranzacție anulată",text:"Nu va exista nicio modificare în cont."} - } - ,walletModal:{ - mobileConnectionModal:{ - showQR:"Scanați codul QR",scanQR:"Scanează codul QR cu telefonul sau cu aplicația OKX Wallet",continueIn:"Continuați tranzacția în OKX Wallet",connectionDeclined:"Conexiunea a eșuat",PoweredBy:"Powered by",appAndTelegram:{ - header:"Connect to OKX Wallet",text:"OKX Wallet este disponibil din aplicația OKX și Telegram"} - ,connectApp:"Conectați-vă la aplicația OKX",connectMini:"Conectați-vă la OKX Mini Wallet"} - } - ,actionModal:{ - confirmTransaction:{ - header:"Confirmați tranzacția în { - { - name } - } - ",text:"Va dura doar un moment."} - } - } - ),tr_TR:oWt({ - common:{ - openWallet:"Cüzdanı aç",get:"Al",close:"Kapat",retry:"Tekrar Dene",loading:"Yükleniyor",walletOpening:"{ - { - name } - } - Açılıyor",confirmInWallet:"Devam etmek için cüzdanda onaylayın."} - ,button:{ - connectWallet:"Cüzdanı bağla",dropdown:{ - copy:"Adresi kopyala",copied:"Adres kopyalandı!",disconnect:"Bağlantıyı kes"} - } - ,notifications:{ - confirm:{ - header:"İşlemi onaylamak için { - { - name } - } - ögesini açın."} - ,transactionSent:{ - header:"İşlem gönderildi.",text:"İşleminiz birkaç saniye içinde gerçekleştirilecek."} - ,transactionCanceled:{ - header:"İşlem iptal edildi!",text:"Hesabınızda değişiklik olmayacak."} - } - ,walletModal:{ - mobileConnectionModal:{ - showQR:"QR Kodunu Göster",scanQR:"Telefonunuz veya OKX Wallet uygulamanızla QR kodunu tarayın",continueIn:"İşleme OKX Web3 Cüzdan’da devam edin.",connectionDeclined:"Bağlantı başarısız.",PoweredBy:"Powered by",appAndTelegram:{ - header:"Connect to OKX Wallet",text:"OKX Web3 Cüzdan, OKX Uygulamasında ve Telegram’da kullanıma sunuldu"} - ,connectApp:"OKX Uygulamasına Bağlan",connectMini:"OKX Mini Cüzdanına Bağlan"} - } - ,actionModal:{ - confirmTransaction:{ - header:"{ - { - name } - } - Konumunda İşlemi Onaylayın",text:"Bu yalnızca bir dakikanızı alacak."} - } - } - ),uk_UA:oWt({ - common:{ - openWallet:"Відкритий гаманець",get:"Отримати",close:"Закрити",retry:"Повторити спробу",loading:"Завантаження",walletOpening:"Відкривається { - { - name } - } - ",confirmInWallet:"Підтвердіть у гаманці, щоб продовжити."} - ,button:{ - connectWallet:"Підключити гаманець",dropdown:{ - copy:"Копіювати адресу",copied:"Адресу скопійовано",disconnect:"Відключити"} - } - ,notifications:{ - confirm:{ - header:"Відкрийте { - { - name } - } - , щоб підтвердити транзакцію."} - ,transactionSent:{ - header:"Транзакцію надіслано",text:"Вашу транзакцію буде оброблено через кілька секунд."} - ,transactionCanceled:{ - header:"Транзакцію скасовано",text:"У вашому акаунті не буде змін."} - } - ,walletModal:{ - mobileConnectionModal:{ - showQR:"Показати QR-код",scanQR:"Зіскануйте QR-код телефоном або застосунком OKX Wallet",continueIn:"Продовжте транзакцію в OKX Wallet",connectionDeclined:"Помилка підключення",PoweredBy:"Powered by",appAndTelegram:{ - header:"Connect to OKX Wallet",text:"OKX Гаманець доступний у застосунку OKX і Telegram"} - ,connectApp:"Підключитися до застосунка OKX",connectMini:"Підключитися до мінігаманця OKX"} - } - ,actionModal:{ - confirmTransaction:{ - header:"Підтвердьте транзакцію в { - { - name } - } - ",text:"Це займе лише мить."} - } - } - ),vi_VN:oWt({ - common:{ - openWallet:"Mở ví",get:"Nhận",close:"Đóng",retry:"Thử lại",loading:"Đang tải",walletOpening:"Mở { - { - name } - } - ",confirmInWallet:"Xác nhận trong ví để tiếp tục."} - ,button:{ - connectWallet:"Kết nối ví",dropdown:{ - copy:"Sao chép địa chỉ",copied:"Đã sao chép địa chỉ",disconnect:"Ngắt kết nối"} - } - ,notifications:{ - confirm:{ - header:"Mở { - { - name } - } - để xác nhận giao dịch."} - ,transactionSent:{ - header:"Đã gửi giao dịch",text:"Giao dịch của bạn sẽ được xử lý trong vài giây."} - ,transactionCanceled:{ - header:"Đã hủy giao dịch",text:"Không có thay đổi nào với tài khoản của bạn."} - } - ,walletModal:{ - mobileConnectionModal:{ - showQR:"Hiển thị mã QR",scanQR:"Quét mã QR bằng điện thoại hoặc ứng dụng OKX Wallet",continueIn:"Tiếp tục giao dịch trên Ví Web3 OKX",connectionDeclined:"Kết nối không thành công",PoweredBy:"Powered by",appAndTelegram:{ - header:"Connect to OKX Wallet",text:"Ví Web3 OKX hiện có trên cả Ứng dụng OKX và Telegram"} - ,connectApp:"Kết nối Ứng dụng OKX",connectMini:"Kết nối Ví Web3 OKX Mini"} - } - ,actionModal:{ - confirmTransaction:{ - header:"Xác nhận giao dịch trong { - { - name } - } - ",text:"Nó chỉ mất chút thời gian."} - } - } - ),zh_TW:oWt({ - common:{ - openWallet:"打開錢包",get:"獲取",close:"關閉",retry:"重試",loading:"載入中",walletOpening:"正在打開 { - { - name } - } - ",confirmInWallet:"請在錢包中確認"} - ,button:{ - connectWallet:"連接錢包",dropdown:{ - copy:"複製地址",copied:"地址已複製",disconnect:"斷開連接"} - } - ,notifications:{ - confirm:{ - header:"打開 { - { - name } - } - 以確認交易"} - ,transactionSent:{ - header:"交易已發送",text:"交易即將完成,請稍候"} - ,transactionCanceled:{ - header:"交易已取消",text:"賬戶未發生任何更改"} - } - ,walletModal:{ - mobileConnectionModal:{ - OKXConnect:"OKX Connect",showQR:"展示二維碼",scanQR:"使用手機或 OKX Wallet App 掃描二維碼",continueIn:"在 OKX 錢包中繼續完成",connectionDeclined:"連接失敗",PoweredBy:"Powered by",appAndTelegram:{ - header:"連接 OKX 錢包",text:" OKX 錢包可在 OKX App 和 Telegram 使用"} - ,connectApp:"連接 OKX App",connectMini:"連接 OKX Mini Wallet"} - } - ,actionModal:{ - confirmTransaction:{ - header:"在 { - { - name } - } - 中確認交易",text:"請稍候"} - } - } - )} - ; - function oWt(t){ - const i=Qt(s=>{ - Object.entries(s).forEach(([e,n])=>{ - if("object"==typeof n&&n)return i(n); - if("string"==typeof n){ - if("$"===n[0]){ - const i=n.slice(1).split("."); - let h=t; - i.forEach(t=>{ - if(!(t in h))throw new Error(`Cannot parse translations: there is no property ${ - t} - in translation`); - h=h[t]} - ),s[e]=h} - "\\$"===n.slice(0,2)&&(s[e]=n.slice(1))} - } - )} - ,"iterate"); - return i(t),t} - Qt(oWt,"parseDictionary"); - const aWt=EGt.div` - display: flex; - - flex-direction: column; - - align-items: center; - - padding-bottom: 8px; - - `,cWt=EGt(f$t)` - margin-top: 16px; - - `,lWt=EGt(XFt)` - font-weight: 400; - - font-size: 16px; - - line-height: 20px; - - text-align: center; - - max-width: 250px; - - margin-top: 10px; - - color: ${ - t=>t.theme.colors.text.contrast} - ; - - `; - EGt(NUt)` - min-width: 112px; - - margin-top: 32px; - - `,EGt(eFt)` - height: 16px; - - width: 16px; - - `; - const uWt=EGt.div` - margin-top: 24px; - - background-color: ${ - t=>t.theme.colors.text.primary} - ; - - height: 48px; - - width: 262px; - - justify-content: center; - - border-radius: 24px; - - display: flex; - - align-items: center; - - gap: 8px; - - `,dWt=Qt(t=>{ - const i=PUt(t),s=KLt(U$t); - LLt(!0); - const[e,n]=LLt(!1),h=bGt(),{ - action:r} - =KLt(mWt); - BLt(()=>{ - n(!!r&&"sent"in r&&r.sent)} - ); - const o=Qt(()=>{ - Mgt.logDebug("ActionModal ====> onOpenWallet "),null==s||s.openWallet()} - ,"onOpenWallet"); - return pDt(aWt,_Dt(i,{ - get children(){ - return[ULt(()=>t.icon),pDt(cWt,{ - get translationKey(){ - return t.headerTranslationKey} - ,get translationValues(){ - return t.headerTranslationValues} - ,get children(){ - return t.headDefaultString} - } - ),pDt(lWt,{ - get translationKey(){ - return t.textTranslationKey} - ,get translationValues(){ - return t.textTranslationValues} - } - ),pDt(EDt,{ - get when(){ - return null==s?void 0:s.showActionButton()} - ,get children(){ - return[pDt(EDt,{ - get when(){ - return"close"===t.showButton} - ,get children(){ - return pDt(uWt,{ - onClick:Qt(()=>t.onClose(),"onClick"),get children(){ - return pDt(XFt,{ - fontWeight:700,fontSize:"16px",get color(){ - return h.colors.background.primary} - ,get children(){ - return pDt(SHt,{ - translationKey:"common.close",children:"Close"} - )} - } - )} - } - )} - } - ),pDt(EDt,{ - get when(){ - return"open-wallet"===t.showButton} - ,get children(){ - return pDt(uWt,{ - onClick:o,get children(){ - return pDt(XFt,{ - fontWeight:700,fontSize:"16px",get color(){ - return h.colors.background.primary} - ,get children(){ - return pDt(SHt,{ - translationKey:"common.openWallet",children:"Open wallet"} - )} - } - )} - } - )} - } - )]} - } - )]} - } - ))} - ,"ActionModal"),fWt=Qt(t=>{ - const i=KLt(U$t),[s]=YFt(),e=Qt(()=>i.walletName?i.walletName:s("common.yourWallet",{ - } - ,"Your wallet"),"name"); - return pDt(dWt,{ - headerTranslationKey:"actionModal.confirmTransaction.header",get headerTranslationValues(){ - return{ - name:e()} - } - ,textTranslationKey:"actionModal.confirmTransaction.text",get icon(){ - return pDt(nHt,{ - } - )} - ,onClose:Qt(()=>t.onClose(),"onClose"),get showButton(){ - return iBt()?"open-wallet":void 0} - ,"data-tc-confirm-modal":"true"} - )} - ,"ConfirmTransactionModal"),pWt=Qt(t=>pDt(dWt,{ - headerTranslationKey:"actionModal.transactionCanceled.header",textTranslationKey:"actionModal.transactionCanceled.text",get icon(){ - return pDt(ZUt,{ - size:"m"} - )} - ,onClose:Qt(()=>t.onClose(),"onClose"),get showButton(){ - return iBt()?"close":void 0} - ,"data-tc-transaction-canceled-modal":"true"} - ),"TransactionCanceledModal"),wWt=Qt(t=>pDt(dWt,{ - headerTranslationKey:"actionModal.transactionSent.header",textTranslationKey:"actionModal.transactionSent.text",get icon(){ - return pDt(qUt,{ - size:"m"} - )} - ,onClose:Qt(()=>t.onClose(),"onClose"),get showButton(){ - return iBt()?"close":void 0} - ,"data-tc-transaction-sent-modal":"true"} - ),"TransactionSentModal"),gWt=Qt(t=>pDt(dWt,{ - headerTranslationKey:"actionModal.transactionError.header",textTranslationKey:"actionModal.transactionCanceled.text",headDefaultString:"Error",get icon(){ - return pDt(ZUt,{ - size:"m"} - )} - ,onClose:Qt(()=>t.onClose(),"onClose"),get showButton(){ - return iBt()?"close":void 0} - ,"data-tc-transaction-error-modal":"true"} - ),"TransactionErrorModal"),mWt=jLt({ - action:null} - ),vWt=Qt(t=>(BLt(()=>{ - } - ),pDt(mWt.Provider,{ - get value(){ - return{ - action:t.action} - } - ,get children(){ - return pDt(RFt,{ - get opened(){ - var i; - return null!==t.action&&!0===(null==(i=t.action)?void 0:i.openModal)} - ,onClose:Qt(()=>t.setAction(null),"onClose"),"data-tc-actions-modal-container":"true",get children(){ - return pDt(ADt,{ - get children(){ - return[pDt(SDt,{ - get when(){ - return"transaction-sent"===t.action.name} - ,get children(){ - return pDt(wWt,{ - onClose:Qt(()=>t.setAction(null),"onClose")} - )} - } - ),pDt(SDt,{ - get when(){ - return"transaction-canceled"===t.action.name} - ,get children(){ - return pDt(pWt,{ - onClose:Qt(()=>t.setAction(null),"onClose")} - )} - } - ),pDt(SDt,{ - get when(){ - return"confirm-transaction"===t.action.name} - ,get children(){ - return pDt(fWt,{ - onClose:Qt(()=>t.setAction(null),"onClose")} - )} - } - ),pDt(SDt,{ - get when(){ - return"transaction-error"===t.action.name} - ,get children(){ - return pDt(gWt,{ - onClose:Qt(()=>t.setAction(null),"onClose")} - )} - } - )]} - } - )} - } - )} - } - )),"ActionsModal"),_Wt={ - constant:{ - black:"#000000",white:"#FFFFFF"} - ,connectButton:{ - background:"#0098EA",foreground:"#FFFFFF"} - ,accent:"#0098EA",telegramButton:"#0098EA",qrFill:"#000000",icon:{ - primary:"#0F0F0F",secondary:"#7A8999",tertiary:"#C1CAD2",success:"#29CC6A",error:"#F5A73B"} - ,background:{ - primary:"#FFFFFF",secondary:"#F1F3F5",segment:"#FFFFFF",tint:"#F1F3F5",qr:"#FFFFFF"} - ,text:{ - primary:"#000000",secondary:"#6A7785",contrast:"#909090"} - ,border:{ - primary:"#00000014",secondary:"#00000024"} - ,disable:"#B3B3B3"} - ; - function MWt(t){ - return"[object Object]"===Object.prototype.toString.call(t)} - function bWt(t){ - var i,s; - return!1!==MWt(t)&&(void 0===(i=t.constructor)||!1!==MWt(s=i.prototype)&&!1!==s.hasOwnProperty("isPrototypeOf"))} - function yWt(t,i){ - return t?cxt(i,t,{ - arrayMerge:Qt((t,i,s)=>i,"overwriteMerge"),isMergeableObject:bWt} - ):i} - bBt({ - theme:gLt.LIGHT,colors:_Wt,borderRadius:"m"} - ),Qt(MWt,"isObject$1"),Qt(bWt,"isPlainObject"),Qt(yWt,"mergeOptions"); - const EWt=["en_US","ru_RU","zh_CN","zh","ar_AE","cs_CZ","de_DE","es_ES","es_LAT","fr_FR","id_ID","it_IT","nl_NL","pl_PL","pt_BR","pt_PT","ro_RO","tr_TR","uk_UA","vi_VN","zh_TW"]; - function AWt(t){ - return EWt.includes(t)} - Qt(AWt,"isValidLocale"); - const[SWt]=LLt({ - status:"closed",closeReason:null} - ); - ULt(()=>"opened"===SWt().status); - const[TWt,CWt]=LLt({ - status:"closed",closeReason:null} - ),OWt=ULt(()=>"opened"===TWt().status),IWt=ULt(()=>{ - const t=TWt(); - return"opened"===t.status?t.walletInfo:null} - ); - let kWt="undefined"!=typeof window?new AUt:void 0; - const[xWt,RWt]=LLt((null==kWt?void 0:kWt.getLastSelectedWalletInfo())||null),PWt=Qt(t=>{ - kWt||(kWt=new AUt),t?(NGt(`modals-state.ts: setLastSelectedWalletInfo ${ - JSON.stringify(t)} - `),kWt.setLastSelectedWalletInfo(t)):(NGt("modals-state.ts: setLastSelectedWalletInfo removeLastSelectedWalletInfo"),kWt.removeLastSelectedWalletInfo()),RWt(t)} - ,"setLastUniversalSelectedWalletInfo"),[NWt,LWt]=LLt(null),DWt=EGt.div` - display: flex; - - flex-direction: column; - - align-items: center; - - height: 510px; - - `,GWt=EGt(f$t)` - margin-bottom: 18px; - - position: absolute; - - text-align: center; - - left: 46px; - - margin-top: 18px; - - `,BWt=EGt.ul` - display: grid; - - grid-template-columns: repeat(4, 1fr); - - grid-template-rows: auto; - - align-content: flex-start; - - row-gap: 8px; - - width: 100%; - - align-self: flex-start; - - list-style: none; - - margin: 56px auto 0; - - padding: 0 16px; - - - > li { - - display: block; - - height: fit-content; - - } - - - ${ - QGt("mobile")} - { - - display: grid; - - grid-template-columns: repeat(4, 1fr); - - gap: 0; - - padding: 8px 12px 16px; - - max-width: none; - - - > li { - - min-width: 78px; - - display: flex; - - } - - - > li > * { - - width: 100%; - - } - - } - - `; - EGt(NUt)` - display: block; - - margin: 0 auto 1px; - - font-size: 15px; - - `; - const UWt=EGt(vFt)` - position: absolute; - - top: 16px; - - left: 16px; - - `,FWt=EGt(S$t)` - opacity: ${ - t=>t.withOpacity?"0.4":"1"} - ; - - `,$Wt=EGt.div` - width: 100%; - - overflow-y: auto; - - max-height: ${ - t=>t.maxHeight} - ; - - - scrollbar-width: none; - - &&::-webkit-scrollbar { - - display: none; - - } - - - &&::-webkit-scrollbar-track { - - background: transparent; - - } - - - &&::-webkit-scrollbar-thumb { - - display: none; - - } - - `,HWt=EGt.div` - height: 1px; - - margin: 0 -24px; - - width: calc(100% + 48px); - - opacity: 0.08; - - background: ${ - t=>t.isShown?t.theme.colors.icon.secondary:"transparent"} - ; - - transition: background 0.15s ease-in-out; - - - ${ - QGt("mobile")} - { - - width: 100%; - - margin: 0; - - } - - `,[WWt,VWt]=LLt((null==(QNt=mUt())?void 0:QNt.innerHeight)||0); - mUt()&&window.addEventListener("resize",()=>VWt(window.innerHeight)); - const jWt=Qt(t=>{ - const[i,s]=LLt(!1),e=Qt(t=>{ - s(t.target.scrollTop>0)} - ,"onScroll"),n=Qt(()=>iBt()?150:200,"offset2"),h=Qt(()=>void 0!==t.maxHeight?`${ - t.maxHeight} - px`:WWt()-n()+"px","maxHeight"); - return[pDt(HWt,{ - get isShown(){ - return i()} - } - ),pDt($Wt,{ - get maxHeight(){ - return h()} - ,onScroll:e,get class(){ - return t.class} - ,get children(){ - return t.children} - } - )]} - ,"ScrollContainer"); - var KWt=GDt("<li>"); - const zWt=Qt(t=>{ - const i=Qt(()=>iBt()?void 0:510,"maxHeight"),s=bGt(); - return pDt(DWt,{ - "data-tc-wallets-modal-list":"true",get children(){ - return[pDt(UWt,{ - icon:"arrow",onClick:Qt(()=>t.onBack(),"onClick")} - ),pDt(GWt,{ - translationKey:"walletModal.wallets",children:"Wallets"} - ),pDt(jWt,{ - get maxHeight(){ - return i()} - ,get children(){ - return pDt(BWt,{ - get children(){ - return pDt(yDt,{ - get each(){ - var i; - return(null==(i=t.otherConnectors)?void 0:i.call(t))||[]} - ,children:Qt(i=>{ - return YDt(s=KWt(),pDt(FWt,{ - wallet:i,onClick:Qt(()=>{ - var s; - t.universalLinkParams()&&(i.openWallet(null==t?void 0:t.universalLinkParams()),i.getType()!=Mgt.CONNECTOR_TYPE.NOT_INSTALLED&&(null==(s=t.setSelectedOtherConnector)||s.call(t,i)))} - ,"onClick")} - )),s; - var s} - ,"children")} - )} - } - )} - } - ),pDt(EHt,{ - style:{ - "margin-top":"auto"} - ,get children(){ - return[pDt(XFt,{ - get color(){ - return s.colors.disable} - ,get children(){ - return pDt(SHt,{ - translationKey:"walletModal.mobileConnectionModal.PoweredBy",children:"PoweredBy"} - )} - } - ),pDt(CHt,{ - } - )]} - } - )]} - } - )} - ,"AllWalletsListModal"),YWt=EGt.div` - display: flex; - - flex-direction: column; - - align-items: center; - - height: 510px; - - `,qWt=EGt(f$t)` - margin-bottom: 18px; - - position: absolute; - - text-align: center; - - left: 46px; - - margin-top: 18px; - - `,XWt=EGt(f$t)` - margin-bottom: 18px; - - text-align: center; - - `,JWt=EGt(vFt)` - position: absolute; - - top: 16px; - - left: 16px; - - `,QWt=EGt.div` - display: flex; - - flex-direction: column; - - align-items: center; - - gap: 12px; - - margin-top: 140px; - - `,ZWt=EGt(NUt)` - color: ${ - t=>t.theme.colors.text.primary} - ; - - display: flex; - - padding: 12px 24px; - - justify-content: center; - - align-items: center; - - border-radius: 999px; - - width: 160px; - - height: 48px; - - margin-top: 30px; - - background-color: ${ - t=>t.theme.colors.background.secondary} - ; - - `; - var tVt=GDt("<div>"); - const iVt=Qt(t=>{ - const i=bGt(); - let s=t.connector.walletName; - switch(t.connector.getType()){ - case Mgt.CONNECTOR_TYPE.INJECT.OKX_INJECT_WALLET:case Mgt.CONNECTOR_TYPE.WS.OKX_APP_WALLET:s="OKX Wallet"; - break; - case Mgt.CONNECTOR_TYPE.KEYLESS.APPLE_WALLET:s="Apple"; - break; - case Mgt.CONNECTOR_TYPE.KEYLESS.GOOGLE_WALLET:s="Google"} - return pDt(YWt,{ - "data-tc-wallets-modal-list":"true",get children(){ - return[pDt(JWt,{ - icon:"arrow",onClick:Qt(()=>t.onBack(),"onClick")} - ),pDt(qWt,{ - translationKey:"walletModal.wallets",children:s} - ),pDt(QWt,{ - get children(){ - return[(e=tVt(),e.style.setProperty("margin-bottom","8px"),YDt(e,pDt(pFt,{ - get connector(){ - return t.connector} - } - )),e),pDt(XWt,{ - translationKey:"common.walletOpening",translationValues:{ - name:s} - ,children:`正在打开${ - s} - ...`} - ),pDt(XFt,{ - get color(){ - return i.colors.disable} - ,get children(){ - return pDt(SHt,{ - translationKey:"common.confirmInWallet",children:"请在插件确认"} - )} - } - ),pDt(ZWt,{ - get leftIcon(){ - return pDt(oFt,{ - } - )} - ,onClick:Qt(()=>{ - t.connector.getType()==Mgt.CONNECTOR_TYPE.WS.OKX_APP_WALLET||t.connector.getType()==Mgt.CONNECTOR_TYPE.WS.OKX_WALLET_APP_WALLET?t.connector.openWallet():t.connector.openWallet(null==t?void 0:t.universalLinkParams())} - ,"onClick"),get children(){ - return pDt(dHt,{ - translationKey:"common.retry",children:"Retry"} - )} - } - )]; - var e} - } - ),pDt(EHt,{ - style:{ - "margin-top":"auto"} - ,get children(){ - return[pDt(XFt,{ - get color(){ - return i.colors.disable} - ,get children(){ - return pDt(SHt,{ - translationKey:"walletModal.mobileConnectionModal.PoweredBy",children:"PoweredBy"} - )} - } - ),pDt(CHt,{ - } - )]} - } - )]} - } - )} - ,"OpeningWalletModal"),sVt=EGt.div``,eVt=EGt.div` - flex: 1; - - display: flex; - - flex-direction: column; - - align-items: center; - - justify-content: center; - - min-height: 200px; - - margin-bottom: 16px; - - `,nVt=EGt.ul` - display: flex; - - width: 328px; - - `,hVt=Qt(t=>{ - const i=bGt().theme==gLt.DARK?"#BCFF2F":void 0; - return pDt(u$t,{ - get icon(){ - return pDt(e$t,{ - get children(){ - return pDt(c$t,{ - src:lFt,width:"60px",height:"60px"} - )} - } - )} - ,name:"OKX Wallet",secondLine:"Download >",secondLineColorPrimary:!1,onClick:Qt(()=>window.open("https://web3.okx.com/download","_blank"),"onClick"),secondLineColor:i} - )} - ,"OkxWalletNotInstall"); - var rVt={ - } - ,oVt={ - } - ,aVt={ - } - ,cVt={ - } - ,lVt={ - } - ; - !function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.DEFAULT_ERROR=t.STANDARD_ERROR_MAP=t.SERVER_ERROR_CODE_RANGE=t.RESERVED_ERROR_CODES=t.SERVER_ERROR=t.INTERNAL_ERROR=t.INVALID_PARAMS=t.METHOD_NOT_FOUND=t.INVALID_REQUEST=t.PARSE_ERROR=t.OKX_CONNECT_ERROR_CODES=t.OKXConnectError=void 0; - const i=class t extends Error{ - constructor(i,s){ - null==s&&(s=e(i)),super(s),this.code=i,this.message=`${ - t.prefix} - ${ - s?"\n"+s:""} - `,Object.setPrototypeOf(this,t.prototype)} - toJSON(){ - return{ - message:this.message,code:this.code} - } - } - ; - Qt(i,"OKXConnectError2"); - let s=i; - function e(t){ - return t==n.UNKNOWN_ERROR?"unknown error":t==n.BAD_REQUEST_ERROR?"bad request error":t==n.ALREADY_CONNECTED_ERROR?"already connected error":t==n.NOT_CONNECTED_ERROR?"not connected error":t==n.UNKNOWN_APP_ERROR?"unknown app error":t==n.USER_REJECTS_ERROR?"user rejects error":t==n.USER_REJECTS_ERROR_CAUSE_REGISTER?"wallet address are registering":t==n.METHOD_NOT_SUPPORTED?"method not supported":t==n.CONNECTION_ERROR?"connect error":t==n.CHAIN_NOT_SUPPORTED?"chain not supported":"unknown error"} - var n,h; - t.OKXConnectError=s,s.prefix="[OKX_CONNECT_SDK_ERROR]",Qt(e,"getDefaultMessageByCode"),(h=n||(t.OKX_CONNECT_ERROR_CODES=n={ - } - ))[h.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",h[h.BAD_REQUEST_ERROR=1]="BAD_REQUEST_ERROR",h[h.ALREADY_CONNECTED_ERROR=11]="ALREADY_CONNECTED_ERROR",h[h.NOT_CONNECTED_ERROR=12]="NOT_CONNECTED_ERROR",h[h.UNKNOWN_APP_ERROR=100]="UNKNOWN_APP_ERROR",h[h.USER_REJECTS_ERROR=300]="USER_REJECTS_ERROR",h[h.USER_REJECTS_ERROR_CAUSE_REGISTER=301]="USER_REJECTS_ERROR_CAUSE_REGISTER",h[h.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED",h[h.CHAIN_NOT_SUPPORTED=500]="CHAIN_NOT_SUPPORTED",h[h.WALLET_NOT_SUPPORTED=600]="WALLET_NOT_SUPPORTED",h[h.CONNECTION_ERROR=700]="CONNECTION_ERROR",t.PARSE_ERROR="PARSE_ERROR",t.INVALID_REQUEST="INVALID_REQUEST",t.METHOD_NOT_FOUND="METHOD_NOT_FOUND",t.INVALID_PARAMS="INVALID_PARAMS",t.INTERNAL_ERROR="INTERNAL_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.RESERVED_ERROR_CODES=[-32700,-32600,-32601,-32602,-32603],t.SERVER_ERROR_CODE_RANGE=[-32e3,-32099],t.STANDARD_ERROR_MAP={ - [t.PARSE_ERROR]:{ - code:-32700,message:"Parse error"} - ,[t.INVALID_REQUEST]:{ - code:-32600,message:"Invalid Request"} - ,[t.METHOD_NOT_FOUND]:{ - code:-32601,message:"Method not found"} - ,[t.INVALID_PARAMS]:{ - code:-32602,message:"Invalid params"} - ,[t.INTERNAL_ERROR]:{ - code:-32603,message:"Internal error"} - ,[t.SERVER_ERROR]:{ - code:-32e3,message:"Server error"} - } - ,t.DEFAULT_ERROR=t.SERVER_ERROR} - (lVt),function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.OKX_CONNECT_ERROR_CODES=t.OKXConnectError=void 0; - var i=lVt; - Object.defineProperty(t,"OKXConnectError",{ - enumerable:!0,get:Qt(function(){ - return i.OKXConnectError} - ,"get")} - ),Object.defineProperty(t,"OKX_CONNECT_ERROR_CODES",{ - enumerable:!0,get:Qt(function(){ - return i.OKX_CONNECT_ERROR_CODES} - ,"get")} - )} - (cVt); - var uVt,dVt={ - } - ; - Object.defineProperty(dVt,"__esModule",{ - value:!0} - ),dVt.NameSpaceKeyStarknet=dVt.NameSpaceKeyTron=dVt.NameSpaceKeyCosmos=dVt.NameSpaceKeyAptos=dVt.NameSpaceKeyBtc=dVt.NameSpaceKeySui=dVt.NameSpaceKeyTON=dVt.NameSpaceKeySOL=dVt.NameSpaceKeyEip155=dVt.OpenAppLinkType=void 0,function(t){ - t.UniversalLink="universallink",t.DeepLink="deeplink"} - (uVt||(dVt.OpenAppLinkType=uVt={ - } - )),dVt.NameSpaceKeyEip155="eip155",dVt.NameSpaceKeySOL="solana",dVt.NameSpaceKeyTON="ton",dVt.NameSpaceKeySui="sui",dVt.NameSpaceKeyBtc="btc",dVt.NameSpaceKeyAptos="aptos",dVt.NameSpaceKeyCosmos="cosmos",dVt.NameSpaceKeyTron="tron",dVt.NameSpaceKeyStarknet="starknet"; - var fVt={ - } - ; - !function(t){ - function i(){ - return window.okxTesttwaUrl} - function s(){ - return window.okxTestTgtwaUrl} - function e(t){ - const i=new URL(t).pathname.split("/").filter(Boolean); - if(i.length>=2)return{ - botName:i[0],appName:i[1]} - } - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.tgwalletAppName=t.tgwalletName=t.tonConnectSdkVersion=t.standardDeeplink=t.okxCommonStackDeepLink=t.okxWalletStackDeepLink=t.okxAppStackDeepLink=t.okxCommonDeepLink=t.okxWalletDeepLink=t.okxAppDeepLink=t.downloadUrl=t.okxCommonUniversalLink=t.okxWalletUniversalLink=t.okxAppUniversalLink=void 0,t.getTestTwaUrl=i,t.getTestTgTwaUrl=s,t.getBotNameAndAppName=e,t.okxAppUniversalLink="https://link.okx.com/ul/connect",t.okxWalletUniversalLink="https://web3link.okx.com/ul/connect",t.okxCommonUniversalLink="https://web3.okx.com/ul/connect",t.downloadUrl="https://www.okx.com/download",t.okxAppDeepLink="okx://web3/wallet/connect",t.okxWalletDeepLink="okxwallet://web3/wallet/connect",t.okxCommonDeepLink="okxweb3://web3/wallet/connect",t.okxAppStackDeepLink="okx://web3?stack=true",t.okxWalletStackDeepLink="okxwallet://web3?stack=true",t.okxCommonStackDeepLink="okxweb3://web3?stack=true",t.standardDeeplink=t.okxAppStackDeepLink,t.tonConnectSdkVersion="1",t.tgwalletName="OKX_WALLET_BOT",t.tgwalletAppName="start",Qt(i,"getTestTwaUrl"),Qt(s,"getTestTgTwaUrl"),Qt(e,"getBotNameAndAppName")} - (fVt); - var pVt={ - } - ,wVt={ - } - ; - function gVt(t){ - throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')} - Qt(gVt,"commonjsRequire"); - var mVt={ - exports:{ - } - } - ; - const vVt=UFt(Object.freeze(Object.defineProperty({ - __proto__:null,default:{ - } - } - ,Symbol.toStringTag,{ - value:"Module"} - ))); - !function(t){ - var i=Qt(function(t){ - var i,s=new Float64Array(16); - if(t)for(i=0; - i<t.length; - i++)s[i]=t[i]; - return s} - ,"gf"),s=Qt(function(){ - throw new Error("no PRNG")} - ,"randombytes"),e=new Uint8Array(16),n=new Uint8Array(32); - n[0]=9; - var h=i(),r=i([1]),o=i([56129,1]),a=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),c=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),l=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),u=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),d=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]); - function f(t,i,s,e){ - t[i]=s>>24&255,t[i+1]=s>>16&255,t[i+2]=s>>8&255,t[i+3]=255&s,t[i+4]=e>>24&255,t[i+5]=e>>16&255,t[i+6]=e>>8&255,t[i+7]=255&e} - function p(t,i,s,e,n){ - var h,r=0; - for(h=0; - h<n; - h++)r|=t[i+h]^s[e+h]; - return(1&r-1>>>8)-1} - function w(t,i,s,e){ - return p(t,i,s,e,16)} - function g(t,i,s,e){ - return p(t,i,s,e,32)} - function m(t,i,s,e){ - for(var n,h=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,r=255&s[0]|(255&s[1])<<8|(255&s[2])<<16|(255&s[3])<<24,o=255&s[4]|(255&s[5])<<8|(255&s[6])<<16|(255&s[7])<<24,a=255&s[8]|(255&s[9])<<8|(255&s[10])<<16|(255&s[11])<<24,c=255&s[12]|(255&s[13])<<8|(255&s[14])<<16|(255&s[15])<<24,l=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,u=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,d=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,f=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,p=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,g=255&s[16]|(255&s[17])<<8|(255&s[18])<<16|(255&s[19])<<24,m=255&s[20]|(255&s[21])<<8|(255&s[22])<<16|(255&s[23])<<24,v=255&s[24]|(255&s[25])<<8|(255&s[26])<<16|(255&s[27])<<24,_=255&s[28]|(255&s[29])<<8|(255&s[30])<<16|(255&s[31])<<24,M=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,b=h,y=r,E=o,A=a,S=c,T=l,C=u,O=d,I=f,k=p,x=w,R=g,P=m,N=v,L=_,D=M,G=0; - G<20; - G+=2)b^=(n=(P^=(n=(I^=(n=(S^=(n=b+P|0)<<7|n>>>25)+b|0)<<9|n>>>23)+S|0)<<13|n>>>19)+I|0)<<18|n>>>14,T^=(n=(y^=(n=(N^=(n=(k^=(n=T+y|0)<<7|n>>>25)+T|0)<<9|n>>>23)+k|0)<<13|n>>>19)+N|0)<<18|n>>>14,x^=(n=(C^=(n=(E^=(n=(L^=(n=x+C|0)<<7|n>>>25)+x|0)<<9|n>>>23)+L|0)<<13|n>>>19)+E|0)<<18|n>>>14,D^=(n=(R^=(n=(O^=(n=(A^=(n=D+R|0)<<7|n>>>25)+D|0)<<9|n>>>23)+A|0)<<13|n>>>19)+O|0)<<18|n>>>14,b^=(n=(A^=(n=(E^=(n=(y^=(n=b+A|0)<<7|n>>>25)+b|0)<<9|n>>>23)+y|0)<<13|n>>>19)+E|0)<<18|n>>>14,T^=(n=(S^=(n=(O^=(n=(C^=(n=T+S|0)<<7|n>>>25)+T|0)<<9|n>>>23)+C|0)<<13|n>>>19)+O|0)<<18|n>>>14,x^=(n=(k^=(n=(I^=(n=(R^=(n=x+k|0)<<7|n>>>25)+x|0)<<9|n>>>23)+R|0)<<13|n>>>19)+I|0)<<18|n>>>14,D^=(n=(L^=(n=(N^=(n=(P^=(n=D+L|0)<<7|n>>>25)+D|0)<<9|n>>>23)+P|0)<<13|n>>>19)+N|0)<<18|n>>>14; - b=b+h|0,y=y+r|0,E=E+o|0,A=A+a|0,S=S+c|0,T=T+l|0,C=C+u|0,O=O+d|0,I=I+f|0,k=k+p|0,x=x+w|0,R=R+g|0,P=P+m|0,N=N+v|0,L=L+_|0,D=D+M|0,t[0]=b>>>0&255,t[1]=b>>>8&255,t[2]=b>>>16&255,t[3]=b>>>24&255,t[4]=y>>>0&255,t[5]=y>>>8&255,t[6]=y>>>16&255,t[7]=y>>>24&255,t[8]=E>>>0&255,t[9]=E>>>8&255,t[10]=E>>>16&255,t[11]=E>>>24&255,t[12]=A>>>0&255,t[13]=A>>>8&255,t[14]=A>>>16&255,t[15]=A>>>24&255,t[16]=S>>>0&255,t[17]=S>>>8&255,t[18]=S>>>16&255,t[19]=S>>>24&255,t[20]=T>>>0&255,t[21]=T>>>8&255,t[22]=T>>>16&255,t[23]=T>>>24&255,t[24]=C>>>0&255,t[25]=C>>>8&255,t[26]=C>>>16&255,t[27]=C>>>24&255,t[28]=O>>>0&255,t[29]=O>>>8&255,t[30]=O>>>16&255,t[31]=O>>>24&255,t[32]=I>>>0&255,t[33]=I>>>8&255,t[34]=I>>>16&255,t[35]=I>>>24&255,t[36]=k>>>0&255,t[37]=k>>>8&255,t[38]=k>>>16&255,t[39]=k>>>24&255,t[40]=x>>>0&255,t[41]=x>>>8&255,t[42]=x>>>16&255,t[43]=x>>>24&255,t[44]=R>>>0&255,t[45]=R>>>8&255,t[46]=R>>>16&255,t[47]=R>>>24&255,t[48]=P>>>0&255,t[49]=P>>>8&255,t[50]=P>>>16&255,t[51]=P>>>24&255,t[52]=N>>>0&255,t[53]=N>>>8&255,t[54]=N>>>16&255,t[55]=N>>>24&255,t[56]=L>>>0&255,t[57]=L>>>8&255,t[58]=L>>>16&255,t[59]=L>>>24&255,t[60]=D>>>0&255,t[61]=D>>>8&255,t[62]=D>>>16&255,t[63]=D>>>24&255} - function v(t,i,s,e){ - for(var n,h=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,r=255&s[0]|(255&s[1])<<8|(255&s[2])<<16|(255&s[3])<<24,o=255&s[4]|(255&s[5])<<8|(255&s[6])<<16|(255&s[7])<<24,a=255&s[8]|(255&s[9])<<8|(255&s[10])<<16|(255&s[11])<<24,c=255&s[12]|(255&s[13])<<8|(255&s[14])<<16|(255&s[15])<<24,l=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,u=255&i[0]|(255&i[1])<<8|(255&i[2])<<16|(255&i[3])<<24,d=255&i[4]|(255&i[5])<<8|(255&i[6])<<16|(255&i[7])<<24,f=255&i[8]|(255&i[9])<<8|(255&i[10])<<16|(255&i[11])<<24,p=255&i[12]|(255&i[13])<<8|(255&i[14])<<16|(255&i[15])<<24,w=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,g=255&s[16]|(255&s[17])<<8|(255&s[18])<<16|(255&s[19])<<24,m=255&s[20]|(255&s[21])<<8|(255&s[22])<<16|(255&s[23])<<24,v=255&s[24]|(255&s[25])<<8|(255&s[26])<<16|(255&s[27])<<24,_=255&s[28]|(255&s[29])<<8|(255&s[30])<<16|(255&s[31])<<24,M=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,b=0; - b<20; - b+=2)h^=(n=(m^=(n=(f^=(n=(c^=(n=h+m|0)<<7|n>>>25)+h|0)<<9|n>>>23)+c|0)<<13|n>>>19)+f|0)<<18|n>>>14,l^=(n=(r^=(n=(v^=(n=(p^=(n=l+r|0)<<7|n>>>25)+l|0)<<9|n>>>23)+p|0)<<13|n>>>19)+v|0)<<18|n>>>14,w^=(n=(u^=(n=(o^=(n=(_^=(n=w+u|0)<<7|n>>>25)+w|0)<<9|n>>>23)+_|0)<<13|n>>>19)+o|0)<<18|n>>>14,M^=(n=(g^=(n=(d^=(n=(a^=(n=M+g|0)<<7|n>>>25)+M|0)<<9|n>>>23)+a|0)<<13|n>>>19)+d|0)<<18|n>>>14,h^=(n=(a^=(n=(o^=(n=(r^=(n=h+a|0)<<7|n>>>25)+h|0)<<9|n>>>23)+r|0)<<13|n>>>19)+o|0)<<18|n>>>14,l^=(n=(c^=(n=(d^=(n=(u^=(n=l+c|0)<<7|n>>>25)+l|0)<<9|n>>>23)+u|0)<<13|n>>>19)+d|0)<<18|n>>>14,w^=(n=(p^=(n=(f^=(n=(g^=(n=w+p|0)<<7|n>>>25)+w|0)<<9|n>>>23)+g|0)<<13|n>>>19)+f|0)<<18|n>>>14,M^=(n=(_^=(n=(v^=(n=(m^=(n=M+_|0)<<7|n>>>25)+M|0)<<9|n>>>23)+m|0)<<13|n>>>19)+v|0)<<18|n>>>14; - t[0]=h>>>0&255,t[1]=h>>>8&255,t[2]=h>>>16&255,t[3]=h>>>24&255,t[4]=l>>>0&255,t[5]=l>>>8&255,t[6]=l>>>16&255,t[7]=l>>>24&255,t[8]=w>>>0&255,t[9]=w>>>8&255,t[10]=w>>>16&255,t[11]=w>>>24&255,t[12]=M>>>0&255,t[13]=M>>>8&255,t[14]=M>>>16&255,t[15]=M>>>24&255,t[16]=u>>>0&255,t[17]=u>>>8&255,t[18]=u>>>16&255,t[19]=u>>>24&255,t[20]=d>>>0&255,t[21]=d>>>8&255,t[22]=d>>>16&255,t[23]=d>>>24&255,t[24]=f>>>0&255,t[25]=f>>>8&255,t[26]=f>>>16&255,t[27]=f>>>24&255,t[28]=p>>>0&255,t[29]=p>>>8&255,t[30]=p>>>16&255,t[31]=p>>>24&255} - function _(t,i,s,e){ - m(t,i,s,e)} - function M(t,i,s,e){ - v(t,i,s,e)} - Qt(f,"ts64"),Qt(p,"vn"),Qt(w,"crypto_verify_16"),Qt(g,"crypto_verify_32"),Qt(m,"core_salsa20"),Qt(v,"core_hsalsa20"),Qt(_,"crypto_core_salsa20"),Qt(M,"crypto_core_hsalsa20"); - var b=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]); - function y(t,i,s,e,n,h,r){ - var o,a,c=new Uint8Array(16),l=new Uint8Array(64); - for(a=0; - a<16; - a++)c[a]=0; - for(a=0; - a<8; - a++)c[a]=h[a]; - for(; - n>=64; - ){ - for(_(l,c,r,b),a=0; - a<64; - a++)t[i+a]=s[e+a]^l[a]; - for(o=1,a=8; - a<16; - a++)o=o+(255&c[a])|0,c[a]=255&o,o>>>=8; - n-=64,i+=64,e+=64} - if(n>0)for(_(l,c,r,b),a=0; - a<n; - a++)t[i+a]=s[e+a]^l[a]; - return 0} - function E(t,i,s,e,n){ - var h,r,o=new Uint8Array(16),a=new Uint8Array(64); - for(r=0; - r<16; - r++)o[r]=0; - for(r=0; - r<8; - r++)o[r]=e[r]; - for(; - s>=64; - ){ - for(_(a,o,n,b),r=0; - r<64; - r++)t[i+r]=a[r]; - for(h=1,r=8; - r<16; - r++)h=h+(255&o[r])|0,o[r]=255&h,h>>>=8; - s-=64,i+=64} - if(s>0)for(_(a,o,n,b),r=0; - r<s; - r++)t[i+r]=a[r]; - return 0} - function A(t,i,s,e,n){ - var h=new Uint8Array(32); - M(h,e,n,b); - for(var r=new Uint8Array(8),o=0; - o<8; - o++)r[o]=e[o+16]; - return E(t,i,s,r,h)} - function S(t,i,s,e,n,h,r){ - var o=new Uint8Array(32); - M(o,h,r,b); - for(var a=new Uint8Array(8),c=0; - c<8; - c++)a[c]=h[c+16]; - return y(t,i,s,e,n,a,o)} - Qt(y,"crypto_stream_salsa20_xor"),Qt(E,"crypto_stream_salsa20"),Qt(A,"crypto_stream"),Qt(S,"crypto_stream_xor"); - var T=Qt(function(t){ - var i,s,e,n,h,r,o,a; - this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,i=255&t[0]|(255&t[1])<<8,this.r[0]=8191&i,s=255&t[2]|(255&t[3])<<8,this.r[1]=8191&(i>>>13|s<<3),e=255&t[4]|(255&t[5])<<8,this.r[2]=7939&(s>>>10|e<<6),n=255&t[6]|(255&t[7])<<8,this.r[3]=8191&(e>>>7|n<<9),h=255&t[8]|(255&t[9])<<8,this.r[4]=255&(n>>>4|h<<12),this.r[5]=h>>>1&8190,r=255&t[10]|(255&t[11])<<8,this.r[6]=8191&(h>>>14|r<<2),o=255&t[12]|(255&t[13])<<8,this.r[7]=8065&(r>>>11|o<<5),a=255&t[14]|(255&t[15])<<8,this.r[8]=8191&(o>>>8|a<<8),this.r[9]=a>>>5&127,this.pad[0]=255&t[16]|(255&t[17])<<8,this.pad[1]=255&t[18]|(255&t[19])<<8,this.pad[2]=255&t[20]|(255&t[21])<<8,this.pad[3]=255&t[22]|(255&t[23])<<8,this.pad[4]=255&t[24]|(255&t[25])<<8,this.pad[5]=255&t[26]|(255&t[27])<<8,this.pad[6]=255&t[28]|(255&t[29])<<8,this.pad[7]=255&t[30]|(255&t[31])<<8} - ,"poly1305"); - function C(t,i,s,e,n,h){ - var r=new T(h); - return r.update(s,e,n),r.finish(t,i),0} - function O(t,i,s,e,n,h){ - var r=new Uint8Array(16); - return C(r,0,s,e,n,h),w(t,i,r,0)} - function I(t,i,s,e,n){ - var h; - if(s<32)return-1; - for(S(t,0,i,0,s,e,n),C(t,16,t,32,s-32,t),h=0; - h<16; - h++)t[h]=0; - return 0} - function k(t,i,s,e,n){ - var h,r=new Uint8Array(32); - if(s<32)return-1; - if(A(r,0,32,e,n),0!==O(i,16,i,32,s-32,r))return-1; - for(S(t,0,i,0,s,e,n),h=0; - h<32; - h++)t[h]=0; - return 0} - function x(t,i){ - var s; - for(s=0; - s<16; - s++)t[s]=0|i[s]} - function R(t){ - var i,s,e=1; - for(i=0; - i<16; - i++)s=t[i]+e+65535,e=Math.floor(s/65536),t[i]=s-65536*e; - t[0]+=e-1+37*(e-1)} - function P(t,i,s){ - for(var e,n=~(s-1),h=0; - h<16; - h++)e=n&(t[h]^i[h]),t[h]^=e,i[h]^=e} - function N(t,s){ - var e,n,h,r=i(),o=i(); - for(e=0; - e<16; - e++)o[e]=s[e]; - for(R(o),R(o),R(o),n=0; - n<2; - n++){ - for(r[0]=o[0]-65517,e=1; - e<15; - e++)r[e]=o[e]-65535-(r[e-1]>>16&1),r[e-1]&=65535; - r[15]=o[15]-32767-(r[14]>>16&1),h=r[15]>>16&1,r[14]&=65535,P(o,r,1-h)} - for(e=0; - e<16; - e++)t[2*e]=255&o[e],t[2*e+1]=o[e]>>8} - function L(t,i){ - var s=new Uint8Array(32),e=new Uint8Array(32); - return N(s,t),N(e,i),g(s,0,e,0)} - function D(t){ - var i=new Uint8Array(32); - return N(i,t),1&i[0]} - function G(t,i){ - var s; - for(s=0; - s<16; - s++)t[s]=i[2*s]+(i[2*s+1]<<8); - t[15]&=32767} - function B(t,i,s){ - for(var e=0; - e<16; - e++)t[e]=i[e]+s[e]} - function U(t,i,s){ - for(var e=0; - e<16; - e++)t[e]=i[e]-s[e]} - function F(t,i,s){ - var e,n,h=0,r=0,o=0,a=0,c=0,l=0,u=0,d=0,f=0,p=0,w=0,g=0,m=0,v=0,_=0,M=0,b=0,y=0,E=0,A=0,S=0,T=0,C=0,O=0,I=0,k=0,x=0,R=0,P=0,N=0,L=0,D=s[0],G=s[1],B=s[2],U=s[3],F=s[4],$=s[5],H=s[6],W=s[7],V=s[8],j=s[9],K=s[10],z=s[11],Y=s[12],q=s[13],X=s[14],J=s[15]; - h+=(e=i[0])*D,r+=e*G,o+=e*B,a+=e*U,c+=e*F,l+=e*$,u+=e*H,d+=e*W,f+=e*V,p+=e*j,w+=e*K,g+=e*z,m+=e*Y,v+=e*q,_+=e*X,M+=e*J,r+=(e=i[1])*D,o+=e*G,a+=e*B,c+=e*U,l+=e*F,u+=e*$,d+=e*H,f+=e*W,p+=e*V,w+=e*j,g+=e*K,m+=e*z,v+=e*Y,_+=e*q,M+=e*X,b+=e*J,o+=(e=i[2])*D,a+=e*G,c+=e*B,l+=e*U,u+=e*F,d+=e*$,f+=e*H,p+=e*W,w+=e*V,g+=e*j,m+=e*K,v+=e*z,_+=e*Y,M+=e*q,b+=e*X,y+=e*J,a+=(e=i[3])*D,c+=e*G,l+=e*B,u+=e*U,d+=e*F,f+=e*$,p+=e*H,w+=e*W,g+=e*V,m+=e*j,v+=e*K,_+=e*z,M+=e*Y,b+=e*q,y+=e*X,E+=e*J,c+=(e=i[4])*D,l+=e*G,u+=e*B,d+=e*U,f+=e*F,p+=e*$,w+=e*H,g+=e*W,m+=e*V,v+=e*j,_+=e*K,M+=e*z,b+=e*Y,y+=e*q,E+=e*X,A+=e*J,l+=(e=i[5])*D,u+=e*G,d+=e*B,f+=e*U,p+=e*F,w+=e*$,g+=e*H,m+=e*W,v+=e*V,_+=e*j,M+=e*K,b+=e*z,y+=e*Y,E+=e*q,A+=e*X,S+=e*J,u+=(e=i[6])*D,d+=e*G,f+=e*B,p+=e*U,w+=e*F,g+=e*$,m+=e*H,v+=e*W,_+=e*V,M+=e*j,b+=e*K,y+=e*z,E+=e*Y,A+=e*q,S+=e*X,T+=e*J,d+=(e=i[7])*D,f+=e*G,p+=e*B,w+=e*U,g+=e*F,m+=e*$,v+=e*H,_+=e*W,M+=e*V,b+=e*j,y+=e*K,E+=e*z,A+=e*Y,S+=e*q,T+=e*X,C+=e*J,f+=(e=i[8])*D,p+=e*G,w+=e*B,g+=e*U,m+=e*F,v+=e*$,_+=e*H,M+=e*W,b+=e*V,y+=e*j,E+=e*K,A+=e*z,S+=e*Y,T+=e*q,C+=e*X,O+=e*J,p+=(e=i[9])*D,w+=e*G,g+=e*B,m+=e*U,v+=e*F,_+=e*$,M+=e*H,b+=e*W,y+=e*V,E+=e*j,A+=e*K,S+=e*z,T+=e*Y,C+=e*q,O+=e*X,I+=e*J,w+=(e=i[10])*D,g+=e*G,m+=e*B,v+=e*U,_+=e*F,M+=e*$,b+=e*H,y+=e*W,E+=e*V,A+=e*j,S+=e*K,T+=e*z,C+=e*Y,O+=e*q,I+=e*X,k+=e*J,g+=(e=i[11])*D,m+=e*G,v+=e*B,_+=e*U,M+=e*F,b+=e*$,y+=e*H,E+=e*W,A+=e*V,S+=e*j,T+=e*K,C+=e*z,O+=e*Y,I+=e*q,k+=e*X,x+=e*J,m+=(e=i[12])*D,v+=e*G,_+=e*B,M+=e*U,b+=e*F,y+=e*$,E+=e*H,A+=e*W,S+=e*V,T+=e*j,C+=e*K,O+=e*z,I+=e*Y,k+=e*q,x+=e*X,R+=e*J,v+=(e=i[13])*D,_+=e*G,M+=e*B,b+=e*U,y+=e*F,E+=e*$,A+=e*H,S+=e*W,T+=e*V,C+=e*j,O+=e*K,I+=e*z,k+=e*Y,x+=e*q,R+=e*X,P+=e*J,_+=(e=i[14])*D,M+=e*G,b+=e*B,y+=e*U,E+=e*F,A+=e*$,S+=e*H,T+=e*W,C+=e*V,O+=e*j,I+=e*K,k+=e*z,x+=e*Y,R+=e*q,P+=e*X,N+=e*J,M+=(e=i[15])*D,r+=38*(y+=e*B),o+=38*(E+=e*U),a+=38*(A+=e*F),c+=38*(S+=e*$),l+=38*(T+=e*H),u+=38*(C+=e*W),d+=38*(O+=e*V),f+=38*(I+=e*j),p+=38*(k+=e*K),w+=38*(x+=e*z),g+=38*(R+=e*Y),m+=38*(P+=e*q),v+=38*(N+=e*X),_+=38*(L+=e*J),h=(e=(h+=38*(b+=e*G))+(n=1)+65535)-65536*(n=Math.floor(e/65536)),r=(e=r+n+65535)-65536*(n=Math.floor(e/65536)),o=(e=o+n+65535)-65536*(n=Math.floor(e/65536)),a=(e=a+n+65535)-65536*(n=Math.floor(e/65536)),c=(e=c+n+65535)-65536*(n=Math.floor(e/65536)),l=(e=l+n+65535)-65536*(n=Math.floor(e/65536)),u=(e=u+n+65535)-65536*(n=Math.floor(e/65536)),d=(e=d+n+65535)-65536*(n=Math.floor(e/65536)),f=(e=f+n+65535)-65536*(n=Math.floor(e/65536)),p=(e=p+n+65535)-65536*(n=Math.floor(e/65536)),w=(e=w+n+65535)-65536*(n=Math.floor(e/65536)),g=(e=g+n+65535)-65536*(n=Math.floor(e/65536)),m=(e=m+n+65535)-65536*(n=Math.floor(e/65536)),v=(e=v+n+65535)-65536*(n=Math.floor(e/65536)),_=(e=_+n+65535)-65536*(n=Math.floor(e/65536)),M=(e=M+n+65535)-65536*(n=Math.floor(e/65536)),h=(e=(h+=n-1+37*(n-1))+(n=1)+65535)-65536*(n=Math.floor(e/65536)),r=(e=r+n+65535)-65536*(n=Math.floor(e/65536)),o=(e=o+n+65535)-65536*(n=Math.floor(e/65536)),a=(e=a+n+65535)-65536*(n=Math.floor(e/65536)),c=(e=c+n+65535)-65536*(n=Math.floor(e/65536)),l=(e=l+n+65535)-65536*(n=Math.floor(e/65536)),u=(e=u+n+65535)-65536*(n=Math.floor(e/65536)),d=(e=d+n+65535)-65536*(n=Math.floor(e/65536)),f=(e=f+n+65535)-65536*(n=Math.floor(e/65536)),p=(e=p+n+65535)-65536*(n=Math.floor(e/65536)),w=(e=w+n+65535)-65536*(n=Math.floor(e/65536)),g=(e=g+n+65535)-65536*(n=Math.floor(e/65536)),m=(e=m+n+65535)-65536*(n=Math.floor(e/65536)),v=(e=v+n+65535)-65536*(n=Math.floor(e/65536)),_=(e=_+n+65535)-65536*(n=Math.floor(e/65536)),M=(e=M+n+65535)-65536*(n=Math.floor(e/65536)),h+=n-1+37*(n-1),t[0]=h,t[1]=r,t[2]=o,t[3]=a,t[4]=c,t[5]=l,t[6]=u,t[7]=d,t[8]=f,t[9]=p,t[10]=w,t[11]=g,t[12]=m,t[13]=v,t[14]=_,t[15]=M} - function $(t,i){ - F(t,i,i)} - function H(t,s){ - var e,n=i(); - for(e=0; - e<16; - e++)n[e]=s[e]; - for(e=253; - e>=0; - e--)$(n,n),2!==e&&4!==e&&F(n,n,s); - for(e=0; - e<16; - e++)t[e]=n[e]} - function W(t,s){ - var e,n=i(); - for(e=0; - e<16; - e++)n[e]=s[e]; - for(e=250; - e>=0; - e--)$(n,n),1!==e&&F(n,n,s); - for(e=0; - e<16; - e++)t[e]=n[e]} - function V(t,s,e){ - var n,h,r=new Uint8Array(32),a=new Float64Array(80),c=i(),l=i(),u=i(),d=i(),f=i(),p=i(); - for(h=0; - h<31; - h++)r[h]=s[h]; - for(r[31]=127&s[31]|64,r[0]&=248,G(a,e),h=0; - h<16; - h++)l[h]=a[h],d[h]=c[h]=u[h]=0; - for(c[0]=d[0]=1,h=254; - h>=0; - --h)P(c,l,n=r[h>>>3]>>>(7&h)&1),P(u,d,n),B(f,c,u),U(c,c,u),B(u,l,d),U(l,l,d),$(d,f),$(p,c),F(c,u,c),F(u,l,f),B(f,c,u),U(c,c,u),$(l,c),U(u,d,p),F(c,u,o),B(c,c,d),F(u,u,c),F(c,d,p),F(d,l,a),$(l,f),P(c,l,n),P(u,d,n); - for(h=0; - h<16; - h++)a[h+16]=c[h],a[h+32]=u[h],a[h+48]=l[h],a[h+64]=d[h]; - var w=a.subarray(32),g=a.subarray(16); - return H(w,w),F(g,g,w),N(t,g),0} - function j(t,i){ - return V(t,i,n)} - function K(t,i){ - return s(i,32),j(t,i)} - function z(t,i,s){ - var n=new Uint8Array(32); - return V(n,s,i),M(t,e,n,b)} - T.prototype.blocks=function(t,i,s){ - for(var e,n,h,r,o,a,c,l,u,d,f,p,w,g,m,v,_,M,b,y=this.fin?0:2048,E=this.h[0],A=this.h[1],S=this.h[2],T=this.h[3],C=this.h[4],O=this.h[5],I=this.h[6],k=this.h[7],x=this.h[8],R=this.h[9],P=this.r[0],N=this.r[1],L=this.r[2],D=this.r[3],G=this.r[4],B=this.r[5],U=this.r[6],F=this.r[7],$=this.r[8],H=this.r[9]; - s>=16; - )d=u=0,d+=(E+=8191&(e=255&t[i+0]|(255&t[i+1])<<8))*P,d+=(A+=8191&(e>>>13|(n=255&t[i+2]|(255&t[i+3])<<8)<<3))*(5*H),d+=(S+=8191&(n>>>10|(h=255&t[i+4]|(255&t[i+5])<<8)<<6))*(5*$),d+=(T+=8191&(h>>>7|(r=255&t[i+6]|(255&t[i+7])<<8)<<9))*(5*F),u=(d+=(C+=8191&(r>>>4|(o=255&t[i+8]|(255&t[i+9])<<8)<<12))*(5*U))>>>13,d&=8191,d+=(O+=o>>>1&8191)*(5*B),d+=(I+=8191&(o>>>14|(a=255&t[i+10]|(255&t[i+11])<<8)<<2))*(5*G),d+=(k+=8191&(a>>>11|(c=255&t[i+12]|(255&t[i+13])<<8)<<5))*(5*D),d+=(x+=8191&(c>>>8|(l=255&t[i+14]|(255&t[i+15])<<8)<<8))*(5*L),f=u+=(d+=(R+=l>>>5|y)*(5*N))>>>13,f+=E*N,f+=A*P,f+=S*(5*H),f+=T*(5*$),u=(f+=C*(5*F))>>>13,f&=8191,f+=O*(5*U),f+=I*(5*B),f+=k*(5*G),f+=x*(5*D),u+=(f+=R*(5*L))>>>13,f&=8191,p=u,p+=E*L,p+=A*N,p+=S*P,p+=T*(5*H),u=(p+=C*(5*$))>>>13,p&=8191,p+=O*(5*F),p+=I*(5*U),p+=k*(5*B),p+=x*(5*G),w=u+=(p+=R*(5*D))>>>13,w+=E*D,w+=A*L,w+=S*N,w+=T*P,u=(w+=C*(5*H))>>>13,w&=8191,w+=O*(5*$),w+=I*(5*F),w+=k*(5*U),w+=x*(5*B),g=u+=(w+=R*(5*G))>>>13,g+=E*G,g+=A*D,g+=S*L,g+=T*N,u=(g+=C*P)>>>13,g&=8191,g+=O*(5*H),g+=I*(5*$),g+=k*(5*F),g+=x*(5*U),m=u+=(g+=R*(5*B))>>>13,m+=E*B,m+=A*G,m+=S*D,m+=T*L,u=(m+=C*N)>>>13,m&=8191,m+=O*P,m+=I*(5*H),m+=k*(5*$),m+=x*(5*F),v=u+=(m+=R*(5*U))>>>13,v+=E*U,v+=A*B,v+=S*G,v+=T*D,u=(v+=C*L)>>>13,v&=8191,v+=O*N,v+=I*P,v+=k*(5*H),v+=x*(5*$),_=u+=(v+=R*(5*F))>>>13,_+=E*F,_+=A*U,_+=S*B,_+=T*G,u=(_+=C*D)>>>13,_&=8191,_+=O*L,_+=I*N,_+=k*P,_+=x*(5*H),M=u+=(_+=R*(5*$))>>>13,M+=E*$,M+=A*F,M+=S*U,M+=T*B,u=(M+=C*G)>>>13,M&=8191,M+=O*D,M+=I*L,M+=k*N,M+=x*P,b=u+=(M+=R*(5*H))>>>13,b+=E*H,b+=A*$,b+=S*F,b+=T*U,u=(b+=C*B)>>>13,b&=8191,b+=O*G,b+=I*D,b+=k*L,b+=x*N,E=d=8191&(u=(u=((u+=(b+=R*P)>>>13)<<2)+u|0)+(d&=8191)|0),A=f+=u>>>=13,S=p&=8191,T=w&=8191,C=g&=8191,O=m&=8191,I=v&=8191,k=_&=8191,x=M&=8191,R=b&=8191,i+=16,s-=16; - this.h[0]=E,this.h[1]=A,this.h[2]=S,this.h[3]=T,this.h[4]=C,this.h[5]=O,this.h[6]=I,this.h[7]=k,this.h[8]=x,this.h[9]=R} - ,T.prototype.finish=function(t,i){ - var s,e,n,h,r=new Uint16Array(10); - if(this.leftover){ - for(h=this.leftover,this.buffer[h++]=1; - h<16; - h++)this.buffer[h]=0; - this.fin=1,this.blocks(this.buffer,0,16)} - for(s=this.h[1]>>>13,this.h[1]&=8191,h=2; - h<10; - h++)this.h[h]+=s,s=this.h[h]>>>13,this.h[h]&=8191; - for(this.h[0]+=5*s,s=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=s,s=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=s,r[0]=this.h[0]+5,s=r[0]>>>13,r[0]&=8191,h=1; - h<10; - h++)r[h]=this.h[h]+s,s=r[h]>>>13,r[h]&=8191; - for(r[9]-=8192,e=(1^s)-1,h=0; - h<10; - h++)r[h]&=e; - for(e=~e,h=0; - h<10; - h++)this.h[h]=this.h[h]&e|r[h]; - for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),n=this.h[0]+this.pad[0],this.h[0]=65535&n,h=1; - h<8; - h++)n=(this.h[h]+this.pad[h]|0)+(n>>>16)|0,this.h[h]=65535&n; - t[i+0]=this.h[0]>>>0&255,t[i+1]=this.h[0]>>>8&255,t[i+2]=this.h[1]>>>0&255,t[i+3]=this.h[1]>>>8&255,t[i+4]=this.h[2]>>>0&255,t[i+5]=this.h[2]>>>8&255,t[i+6]=this.h[3]>>>0&255,t[i+7]=this.h[3]>>>8&255,t[i+8]=this.h[4]>>>0&255,t[i+9]=this.h[4]>>>8&255,t[i+10]=this.h[5]>>>0&255,t[i+11]=this.h[5]>>>8&255,t[i+12]=this.h[6]>>>0&255,t[i+13]=this.h[6]>>>8&255,t[i+14]=this.h[7]>>>0&255,t[i+15]=this.h[7]>>>8&255} - ,T.prototype.update=function(t,i,s){ - var e,n; - if(this.leftover){ - for((n=16-this.leftover)>s&&(n=s),e=0; - e<n; - e++)this.buffer[this.leftover+e]=t[i+e]; - if(s-=n,i+=n,this.leftover+=n,this.leftover<16)return; - this.blocks(this.buffer,0,16),this.leftover=0} - if(s>=16&&(n=s-s%16,this.blocks(t,i,n),i+=n,s-=n),s){ - for(e=0; - e<s; - e++)this.buffer[this.leftover+e]=t[i+e]; - this.leftover+=s} - } - ,Qt(C,"crypto_onetimeauth"),Qt(O,"crypto_onetimeauth_verify"),Qt(I,"crypto_secretbox"),Qt(k,"crypto_secretbox_open"),Qt(x,"set25519"),Qt(R,"car25519"),Qt(P,"sel25519"),Qt(N,"pack25519"),Qt(L,"neq25519"),Qt(D,"par25519"),Qt(G,"unpack25519"),Qt(B,"A"),Qt(U,"Z"),Qt(F,"M"),Qt($,"S"),Qt(H,"inv25519"),Qt(W,"pow2523"),Qt(V,"crypto_scalarmult"),Qt(j,"crypto_scalarmult_base"),Qt(K,"crypto_box_keypair"),Qt(z,"crypto_box_beforenm"); - var Y=I,q=k; - function X(t,i,s,e,n,h){ - var r=new Uint8Array(32); - return z(r,n,h),Y(t,i,s,e,r)} - function J(t,i,s,e,n,h){ - var r=new Uint8Array(32); - return z(r,n,h),q(t,i,s,e,r)} - Qt(X,"crypto_box"),Qt(J,"crypto_box_open"); - var Q=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]; - function Z(t,i,s,e){ - for(var n,h,r,o,a,c,l,u,d,f,p,w,g,m,v,_,M,b,y,E,A,S,T,C,O,I,k=new Int32Array(16),x=new Int32Array(16),R=t[0],P=t[1],N=t[2],L=t[3],D=t[4],G=t[5],B=t[6],U=t[7],F=i[0],$=i[1],H=i[2],W=i[3],V=i[4],j=i[5],K=i[6],z=i[7],Y=0; - e>=128; - ){ - for(y=0; - y<16; - y++)E=8*y+Y,k[y]=s[E+0]<<24|s[E+1]<<16|s[E+2]<<8|s[E+3],x[y]=s[E+4]<<24|s[E+5]<<16|s[E+6]<<8|s[E+7]; - for(y=0; - y<80; - y++)if(n=R,h=P,r=N,o=L,a=D,c=G,l=B,d=F,f=$,p=H,w=W,g=V,m=j,v=K,T=65535&(S=z),C=S>>>16,O=65535&(A=U),I=A>>>16,T+=65535&(S=(V>>>14|D<<18)^(V>>>18|D<<14)^(D>>>9|V<<23)),C+=S>>>16,O+=65535&(A=(D>>>14|V<<18)^(D>>>18|V<<14)^(V>>>9|D<<23)),I+=A>>>16,T+=65535&(S=V&j^~V&K),C+=S>>>16,O+=65535&(A=D&G^~D&B),I+=A>>>16,T+=65535&(S=Q[2*y+1]),C+=S>>>16,O+=65535&(A=Q[2*y]),I+=A>>>16,A=k[y%16],C+=(S=x[y%16])>>>16,O+=65535&A,I+=A>>>16,O+=(C+=(T+=65535&S)>>>16)>>>16,T=65535&(S=b=65535&T|C<<16),C=S>>>16,O=65535&(A=M=65535&O|(I+=O>>>16)<<16),I=A>>>16,T+=65535&(S=(F>>>28|R<<4)^(R>>>2|F<<30)^(R>>>7|F<<25)),C+=S>>>16,O+=65535&(A=(R>>>28|F<<4)^(F>>>2|R<<30)^(F>>>7|R<<25)),I+=A>>>16,C+=(S=F&$^F&H^$&H)>>>16,O+=65535&(A=R&P^R&N^P&N),I+=A>>>16,u=65535&(O+=(C+=(T+=65535&S)>>>16)>>>16)|(I+=O>>>16)<<16,_=65535&T|C<<16,T=65535&(S=w),C=S>>>16,O=65535&(A=o),I=A>>>16,C+=(S=b)>>>16,O+=65535&(A=M),I+=A>>>16,P=n,N=h,L=r,D=o=65535&(O+=(C+=(T+=65535&S)>>>16)>>>16)|(I+=O>>>16)<<16,G=a,B=c,U=l,R=u,$=d,H=f,W=p,V=w=65535&T|C<<16,j=g,K=m,z=v,F=_,y%16==15)for(E=0; - E<16; - E++)A=k[E],T=65535&(S=x[E]),C=S>>>16,O=65535&A,I=A>>>16,A=k[(E+9)%16],T+=65535&(S=x[(E+9)%16]),C+=S>>>16,O+=65535&A,I+=A>>>16,M=k[(E+1)%16],T+=65535&(S=((b=x[(E+1)%16])>>>1|M<<31)^(b>>>8|M<<24)^(b>>>7|M<<25)),C+=S>>>16,O+=65535&(A=(M>>>1|b<<31)^(M>>>8|b<<24)^M>>>7),I+=A>>>16,M=k[(E+14)%16],C+=(S=((b=x[(E+14)%16])>>>19|M<<13)^(M>>>29|b<<3)^(b>>>6|M<<26))>>>16,O+=65535&(A=(M>>>19|b<<13)^(b>>>29|M<<3)^M>>>6),I+=A>>>16,I+=(O+=(C+=(T+=65535&S)>>>16)>>>16)>>>16,k[E]=65535&O|I<<16,x[E]=65535&T|C<<16; - T=65535&(S=F),C=S>>>16,O=65535&(A=R),I=A>>>16,A=t[0],C+=(S=i[0])>>>16,O+=65535&A,I+=A>>>16,I+=(O+=(C+=(T+=65535&S)>>>16)>>>16)>>>16,t[0]=R=65535&O|I<<16,i[0]=F=65535&T|C<<16,T=65535&(S=$),C=S>>>16,O=65535&(A=P),I=A>>>16,A=t[1],C+=(S=i[1])>>>16,O+=65535&A,I+=A>>>16,I+=(O+=(C+=(T+=65535&S)>>>16)>>>16)>>>16,t[1]=P=65535&O|I<<16,i[1]=$=65535&T|C<<16,T=65535&(S=H),C=S>>>16,O=65535&(A=N),I=A>>>16,A=t[2],C+=(S=i[2])>>>16,O+=65535&A,I+=A>>>16,I+=(O+=(C+=(T+=65535&S)>>>16)>>>16)>>>16,t[2]=N=65535&O|I<<16,i[2]=H=65535&T|C<<16,T=65535&(S=W),C=S>>>16,O=65535&(A=L),I=A>>>16,A=t[3],C+=(S=i[3])>>>16,O+=65535&A,I+=A>>>16,I+=(O+=(C+=(T+=65535&S)>>>16)>>>16)>>>16,t[3]=L=65535&O|I<<16,i[3]=W=65535&T|C<<16,T=65535&(S=V),C=S>>>16,O=65535&(A=D),I=A>>>16,A=t[4],C+=(S=i[4])>>>16,O+=65535&A,I+=A>>>16,I+=(O+=(C+=(T+=65535&S)>>>16)>>>16)>>>16,t[4]=D=65535&O|I<<16,i[4]=V=65535&T|C<<16,T=65535&(S=j),C=S>>>16,O=65535&(A=G),I=A>>>16,A=t[5],C+=(S=i[5])>>>16,O+=65535&A,I+=A>>>16,I+=(O+=(C+=(T+=65535&S)>>>16)>>>16)>>>16,t[5]=G=65535&O|I<<16,i[5]=j=65535&T|C<<16,T=65535&(S=K),C=S>>>16,O=65535&(A=B),I=A>>>16,A=t[6],C+=(S=i[6])>>>16,O+=65535&A,I+=A>>>16,I+=(O+=(C+=(T+=65535&S)>>>16)>>>16)>>>16,t[6]=B=65535&O|I<<16,i[6]=K=65535&T|C<<16,T=65535&(S=z),C=S>>>16,O=65535&(A=U),I=A>>>16,A=t[7],C+=(S=i[7])>>>16,O+=65535&A,I+=A>>>16,I+=(O+=(C+=(T+=65535&S)>>>16)>>>16)>>>16,t[7]=U=65535&O|I<<16,i[7]=z=65535&T|C<<16,Y+=128,e-=128} - return e} - function tt(t,i,s){ - var e,n=new Int32Array(8),h=new Int32Array(8),r=new Uint8Array(256),o=s; - for(n[0]=1779033703,n[1]=3144134277,n[2]=1013904242,n[3]=2773480762,n[4]=1359893119,n[5]=2600822924,n[6]=528734635,n[7]=1541459225,h[0]=4089235720,h[1]=2227873595,h[2]=4271175723,h[3]=1595750129,h[4]=2917565137,h[5]=725511199,h[6]=4215389547,h[7]=327033209,Z(n,h,i,s),s%=128,e=0; - e<s; - e++)r[e]=i[o-s+e]; - for(r[s]=128,r[(s=256-128*(s<112?1:0))-9]=0,f(r,s-8,o/536870912|0,o<<3),Z(n,h,r,s),e=0; - e<8; - e++)f(t,8*e,n[e],h[e]); - return 0} - function it(t,s){ - var e=i(),n=i(),h=i(),r=i(),o=i(),a=i(),l=i(),u=i(),d=i(); - U(e,t[1],t[0]),U(d,s[1],s[0]),F(e,e,d),B(n,t[0],t[1]),B(d,s[0],s[1]),F(n,n,d),F(h,t[3],s[3]),F(h,h,c),F(r,t[2],s[2]),B(r,r,r),U(o,n,e),U(a,r,h),B(l,r,h),B(u,n,e),F(t[0],o,a),F(t[1],u,l),F(t[2],l,a),F(t[3],o,u)} - function st(t,i,s){ - var e; - for(e=0; - e<4; - e++)P(t[e],i[e],s)} - function et(t,s){ - var e=i(),n=i(),h=i(); - H(h,s[2]),F(e,s[0],h),F(n,s[1],h),N(t,n),t[31]^=D(e)<<7} - function nt(t,i,s){ - var e,n; - for(x(t[0],h),x(t[1],r),x(t[2],r),x(t[3],h),n=255; - n>=0; - --n)st(t,i,e=s[n/8|0]>>(7&n)&1),it(i,t),it(t,t),st(t,i,e)} - function ht(t,s){ - var e=[i(),i(),i(),i()]; - x(e[0],l),x(e[1],u),x(e[2],r),F(e[3],l,u),nt(t,e,s)} - function rt(t,e,n){ - var h,r=new Uint8Array(64),o=[i(),i(),i(),i()]; - for(n||s(e,32),tt(r,e,32),r[0]&=248,r[31]&=127,r[31]|=64,ht(o,r),et(t,o),h=0; - h<32; - h++)e[h+32]=t[h]; - return 0} - Qt(Z,"crypto_hashblocks_hl"),Qt(tt,"crypto_hash"),Qt(it,"add"),Qt(st,"cswap"),Qt(et,"pack"),Qt(nt,"scalarmult"),Qt(ht,"scalarbase"),Qt(rt,"crypto_sign_keypair"); - var ot=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]); - function at(t,i){ - var s,e,n,h; - for(e=63; - e>=32; - --e){ - for(s=0,n=e-32,h=e-12; - n<h; - ++n)i[n]+=s-16*i[e]*ot[n-(e-32)],s=Math.floor((i[n]+128)/256),i[n]-=256*s; - i[n]+=s,i[e]=0} - for(s=0,n=0; - n<32; - n++)i[n]+=s-(i[31]>>4)*ot[n],s=i[n]>>8,i[n]&=255; - for(n=0; - n<32; - n++)i[n]-=s*ot[n]; - for(e=0; - e<32; - e++)i[e+1]+=i[e]>>8,t[e]=255&i[e]} - function ct(t){ - var i,s=new Float64Array(64); - for(i=0; - i<64; - i++)s[i]=t[i]; - for(i=0; - i<64; - i++)t[i]=0; - at(t,s)} - function lt(t,s,e,n){ - var h,r,o=new Uint8Array(64),a=new Uint8Array(64),c=new Uint8Array(64),l=new Float64Array(64),u=[i(),i(),i(),i()]; - tt(o,n,32),o[0]&=248,o[31]&=127,o[31]|=64; - var d=e+64; - for(h=0; - h<e; - h++)t[64+h]=s[h]; - for(h=0; - h<32; - h++)t[32+h]=o[32+h]; - for(tt(c,t.subarray(32),e+32),ct(c),ht(u,c),et(t,u),h=32; - h<64; - h++)t[h]=n[h]; - for(tt(a,t,e+64),ct(a),h=0; - h<64; - h++)l[h]=0; - for(h=0; - h<32; - h++)l[h]=c[h]; - for(h=0; - h<32; - h++)for(r=0; - r<32; - r++)l[h+r]+=a[h]*o[r]; - return at(t.subarray(32),l),d} - function ut(t,s){ - var e=i(),n=i(),o=i(),c=i(),l=i(),u=i(),f=i(); - return x(t[2],r),G(t[1],s),$(o,t[1]),F(c,o,a),U(o,o,t[2]),B(c,t[2],c),$(l,c),$(u,l),F(f,u,l),F(e,f,o),F(e,e,c),W(e,e),F(e,e,o),F(e,e,c),F(e,e,c),F(t[0],e,c),$(n,t[0]),F(n,n,c),L(n,o)&&F(t[0],t[0],d),$(n,t[0]),F(n,n,c),L(n,o)?-1:(D(t[0])===s[31]>>7&&U(t[0],h,t[0]),F(t[3],t[0],t[1]),0)} - function dt(t,s,e,n){ - var h,r=new Uint8Array(32),o=new Uint8Array(64),a=[i(),i(),i(),i()],c=[i(),i(),i(),i()]; - if(e<64)return-1; - if(ut(c,n))return-1; - for(h=0; - h<e; - h++)t[h]=s[h]; - for(h=0; - h<32; - h++)t[h+32]=n[h]; - if(tt(o,t,e),ct(o),nt(a,c,o),ht(c,s.subarray(32)),it(a,c),et(r,a),e-=64,g(s,0,r,0)){ - for(h=0; - h<e; - h++)t[h]=0; - return-1} - for(h=0; - h<e; - h++)t[h]=s[h+64]; - return e} - Qt(at,"modL"),Qt(ct,"reduce"),Qt(lt,"crypto_sign"),Qt(ut,"unpackneg"),Qt(dt,"crypto_sign_open"); - var ft,pt=64,wt=32,gt=64; - function mt(t,i){ - if(32!==t.length)throw new Error("bad key size"); - if(24!==i.length)throw new Error("bad nonce size")} - function vt(t,i){ - if(32!==t.length)throw new Error("bad public key size"); - if(32!==i.length)throw new Error("bad secret key size")} - function _t(){ - for(var t=0; - t<arguments.length; - t++)if(!(arguments[t]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")} - function Mt(t){ - for(var i=0; - i<t.length; - i++)t[i]=0} - t.lowlevel={ - crypto_core_hsalsa20:M,crypto_stream_xor:S,crypto_stream:A,crypto_stream_salsa20_xor:y,crypto_stream_salsa20:E,crypto_onetimeauth:C,crypto_onetimeauth_verify:O,crypto_verify_16:w,crypto_verify_32:g,crypto_secretbox:I,crypto_secretbox_open:k,crypto_scalarmult:V,crypto_scalarmult_base:j,crypto_box_beforenm:z,crypto_box_afternm:Y,crypto_box:X,crypto_box_open:J,crypto_box_keypair:K,crypto_hash:tt,crypto_sign:lt,crypto_sign_keypair:rt,crypto_sign_open:dt,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:pt,crypto_sign_PUBLICKEYBYTES:wt,crypto_sign_SECRETKEYBYTES:gt,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:i,D:a,L:ot,pack25519:N,unpack25519:G,M:F,A:B,S:$,Z:U,pow2523:W,add:it,set25519:x,modL:at,scalarmult:nt,scalarbase:ht} - ,Qt(mt,"checkLengths"),Qt(vt,"checkBoxLengths"),Qt(_t,"checkArrayTypes"),Qt(Mt,"cleanup"),t.randomBytes=function(t){ - var i=new Uint8Array(t); - return s(i,t),i} - ,t.secretbox=function(t,i,s){ - _t(t,i,s),mt(s,i); - for(var e=new Uint8Array(32+t.length),n=new Uint8Array(e.length),h=0; - h<t.length; - h++)e[h+32]=t[h]; - return I(n,e,e.length,i,s),n.subarray(16)} - ,t.secretbox.open=function(t,i,s){ - _t(t,i,s),mt(s,i); - for(var e=new Uint8Array(16+t.length),n=new Uint8Array(e.length),h=0; - h<t.length; - h++)e[h+16]=t[h]; - return e.length<32||0!==k(n,e,e.length,i,s)?null:n.subarray(32)} - ,t.secretbox.keyLength=32,t.secretbox.nonceLength=24,t.secretbox.overheadLength=16,t.scalarMult=function(t,i){ - if(_t(t,i),32!==t.length)throw new Error("bad n size"); - if(32!==i.length)throw new Error("bad p size"); - var s=new Uint8Array(32); - return V(s,t,i),s} - ,t.scalarMult.base=function(t){ - if(_t(t),32!==t.length)throw new Error("bad n size"); - var i=new Uint8Array(32); - return j(i,t),i} - ,t.scalarMult.scalarLength=32,t.scalarMult.groupElementLength=32,t.box=function(i,s,e,n){ - var h=t.box.before(e,n); - return t.secretbox(i,s,h)} - ,t.box.before=function(t,i){ - _t(t,i),vt(t,i); - var s=new Uint8Array(32); - return z(s,t,i),s} - ,t.box.after=t.secretbox,t.box.open=function(i,s,e,n){ - var h=t.box.before(e,n); - return t.secretbox.open(i,s,h)} - ,t.box.open.after=t.secretbox.open,t.box.keyPair=function(){ - var t=new Uint8Array(32),i=new Uint8Array(32); - return K(t,i),{ - publicKey:t,secretKey:i} - } - ,t.box.keyPair.fromSecretKey=function(t){ - if(_t(t),32!==t.length)throw new Error("bad secret key size"); - var i=new Uint8Array(32); - return j(i,t),{ - publicKey:i,secretKey:new Uint8Array(t)} - } - ,t.box.publicKeyLength=32,t.box.secretKeyLength=32,t.box.sharedKeyLength=32,t.box.nonceLength=24,t.box.overheadLength=t.secretbox.overheadLength,t.sign=function(t,i){ - if(_t(t,i),i.length!==gt)throw new Error("bad secret key size"); - var s=new Uint8Array(pt+t.length); - return lt(s,t,t.length,i),s} - ,t.sign.open=function(t,i){ - if(_t(t,i),i.length!==wt)throw new Error("bad public key size"); - var s=new Uint8Array(t.length),e=dt(s,t,t.length,i); - if(e<0)return null; - for(var n=new Uint8Array(e),h=0; - h<n.length; - h++)n[h]=s[h]; - return n} - ,t.sign.detached=function(i,s){ - for(var e=t.sign(i,s),n=new Uint8Array(pt),h=0; - h<n.length; - h++)n[h]=e[h]; - return n} - ,t.sign.detached.verify=function(t,i,s){ - if(_t(t,i,s),i.length!==pt)throw new Error("bad signature size"); - if(s.length!==wt)throw new Error("bad public key size"); - var e,n=new Uint8Array(pt+t.length),h=new Uint8Array(pt+t.length); - for(e=0; - e<pt; - e++)n[e]=i[e]; - for(e=0; - e<t.length; - e++)n[e+pt]=t[e]; - return dt(h,n,n.length,s)>=0} - ,t.sign.keyPair=function(){ - var t=new Uint8Array(wt),i=new Uint8Array(gt); - return rt(t,i),{ - publicKey:t,secretKey:i} - } - ,t.sign.keyPair.fromSecretKey=function(t){ - if(_t(t),t.length!==gt)throw new Error("bad secret key size"); - for(var i=new Uint8Array(wt),s=0; - s<i.length; - s++)i[s]=t[32+s]; - return{ - publicKey:i,secretKey:new Uint8Array(t)} - } - ,t.sign.keyPair.fromSeed=function(t){ - if(_t(t),32!==t.length)throw new Error("bad seed size"); - for(var i=new Uint8Array(wt),s=new Uint8Array(gt),e=0; - e<32; - e++)s[e]=t[e]; - return rt(i,s,!0),{ - publicKey:i,secretKey:s} - } - ,t.sign.publicKeyLength=wt,t.sign.secretKeyLength=gt,t.sign.seedLength=32,t.sign.signatureLength=pt,t.hash=function(t){ - _t(t); - var i=new Uint8Array(64); - return tt(i,t,t.length),i} - ,t.hash.hashLength=64,t.verify=function(t,i){ - return _t(t,i),0!==t.length&&0!==i.length&&t.length===i.length&&0===p(t,0,i,0,t.length)} - ,t.setPRNG=function(t){ - s=t} - ,(ft="undefined"!=typeof self?self.crypto||self.msCrypto:null)&&ft.getRandomValues?t.setPRNG(function(t,i){ - var s,e=new Uint8Array(i); - for(s=0; - s<i; - s+=65536)ft.getRandomValues(e.subarray(s,s+Math.min(i-s,65536))); - for(s=0; - s<i; - s++)t[s]=e[s]; - Mt(e)} - ):void 0!==gVt&&(ft=vVt)&&ft.randomBytes&&t.setPRNG(function(t,i){ - var s,e=ft.randomBytes(i); - for(s=0; - s<i; - s++)t[s]=e[s]; - Mt(e)} - )} - (mVt.exports?mVt.exports:self.nacl=self.nacl||{ - } - ); - var _Vt=BFt&&BFt.__importDefault||function(t){ - return t&&t.__esModule?t:{ - default:t} - } - ; - function MVt(t){ - return"object"==typeof t&&"id"in t&&"jsonrpc"in t&&"2.0"===t.jsonrpc} - function bVt(t){ - return MVt(t)&&"method"in t} - function yVt(t){ - return MVt(t)&&(EVt(t)||AVt(t))} - function EVt(t){ - return"result"in t} - function AVt(t){ - return"error"in t} - Object.defineProperty(wVt,"__esModule",{ - value:!0} - ),wVt.isJsonRpcPayload=MVt,wVt.isJsonRpcRequest=bVt,wVt.isJsonRpcResponse=yVt,wVt.isJsonRpcResult=EVt,wVt.isJsonRpcError=AVt,wVt.payloadId=xVt,wVt.getBigIntRpcId=RVt,wVt.formatJsonRpcRequest=PVt,wVt.formatJsonRpcResult=NVt,wVt.formatJsonRpcError=LVt,wVt.isReservedErrorCode=DVt,wVt.getError=GVt,wVt.getErrorByCode=BVt,wVt.formatErrorMessage=UVt,wVt.isHttpUrl=HVt,wVt.isWsUrl=WVt,wVt.parseConnectionError=VVt,Qt(MVt,"isJsonRpcPayload"),Qt(bVt,"isJsonRpcRequest"),Qt(yVt,"isJsonRpcResponse"),Qt(EVt,"isJsonRpcResult"),Qt(AVt,"isJsonRpcError"); - const SVt=lVt,TVt=_Vt(mVt.exports),CVt=class{ - constructor(t){ - this.i=1,this.initialValue=t?TVt.default.randomBytes(t/8)[0]:0} - getNextValue(){ - return this.initialValue+this.i++} - } - ; - Qt(CVt,"IncrementalRandomGenerator"); - let OVt=CVt; - const IVt=new OVt(8),kVt=new OVt(16); - function xVt(){ - return 1e3*Date.now()+IVt.getNextValue()} - function RVt(){ - return BigInt(Date.now())*BigInt(1e6)+BigInt(kVt.getNextValue())} - function PVt(t,i,s){ - return{ - id:s||xVt(),jsonrpc:"2.0",method:t,params:i} - } - function NVt(t,i){ - return{ - id:t,jsonrpc:"2.0",result:i} - } - function LVt(t,i,s){ - return{ - id:t,jsonrpc:"2.0",error:UVt(i,s)} - } - function DVt(t){ - return SVt.RESERVED_ERROR_CODES.includes(t)} - function GVt(t){ - return Object.keys(SVt.STANDARD_ERROR_MAP).includes(t)?SVt.STANDARD_ERROR_MAP[t]:SVt.STANDARD_ERROR_MAP[SVt.DEFAULT_ERROR]} - function BVt(t){ - return Object.values(SVt.STANDARD_ERROR_MAP).find(i=>i.code===t)||SVt.STANDARD_ERROR_MAP[SVt.DEFAULT_ERROR]} - function UVt(t,i){ - return void 0===t?GVt(SVt.INTERNAL_ERROR):("string"==typeof t&&(t=Object.assign(Object.assign({ - } - ,GVt(SVt.SERVER_ERROR)),{ - message:t} - )),void 0!==i&&(t.data=i),DVt(t.code)&&(t=BVt(t.code)),t)} - function FVt(t){ - const i=t.match(new RegExp(/^\w+:/,"gi")); - if(i&&i.length)return i[0]} - function $Vt(t,i){ - const s=FVt(t); - return void 0!==s&&new RegExp(i).test(s)} - function HVt(t){ - return $Vt(t,"^https?:")} - function WVt(t){ - return $Vt(t,"^wss?:")} - function VVt(t,i,s){ - return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${ - s} - RPC url at ${ - i} - `):t} - Qt(xVt,"payloadId"),Qt(RVt,"getBigIntRpcId"),Qt(PVt,"formatJsonRpcRequest"),Qt(NVt,"formatJsonRpcResult"),Qt(LVt,"formatJsonRpcError"),Qt(DVt,"isReservedErrorCode"),Qt(GVt,"getError"),Qt(BVt,"getErrorByCode"),Qt(UVt,"formatErrorMessage"),Qt(FVt,"getUrlProtocol"),Qt($Vt,"matchRegexProtocol"),Qt(HVt,"isHttpUrl"),Qt(WVt,"isWsUrl"),Qt(VVt,"parseConnectionError"); - var jVt={ - } - ,KVt={ - exports:{ - } - } - ; - !function(t){ - var i=Object.prototype.hasOwnProperty,s="~"; - function e(){ - } - function n(t,i,s){ - this.fn=t,this.context=i,this.once=s||!1} - function h(t,i,e,h,r){ - if("function"!=typeof e)throw new TypeError("The listener must be a function"); - var o=new n(e,h||t,r),a=s?s+i:i; - return t._events[a]?t._events[a].fn?t._events[a]=[t._events[a],o]:t._events[a].push(o):(t._events[a]=o,t._eventsCount++),t} - function r(t,i){ - 0===--t._eventsCount?t._events=new e:delete t._events[i]} - function o(){ - this._events=new e,this._eventsCount=0} - Qt(e,"Events"),Object.create&&(e.prototype=Object.create(null),(new e).__proto__||(s=!1)),Qt(n,"EE"),Qt(h,"addListener"),Qt(r,"clearEvent"),Qt(o,"EventEmitter"),o.prototype.eventNames=Qt(function(){ - var t,e,n=[]; - if(0===this._eventsCount)return n; - for(e in t=this._events)i.call(t,e)&&n.push(s?e.slice(1):e); - return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n} - ,"eventNames"),o.prototype.listeners=Qt(function(t){ - var i=s?s+t:t,e=this._events[i]; - if(!e)return[]; - if(e.fn)return[e.fn]; - for(var n=0,h=e.length,r=new Array(h); - n<h; - n++)r[n]=e[n].fn; - return r} - ,"listeners"),o.prototype.listenerCount=Qt(function(t){ - var i=s?s+t:t,e=this._events[i]; - return e?e.fn?1:e.length:0} - ,"listenerCount"),o.prototype.emit=Qt(function(t,i,e,n,h,r){ - var o=s?s+t:t; - if(!this._events[o])return!1; - var a,c,l=this._events[o],u=arguments.length; - if(l.fn){ - switch(l.once&&this.removeListener(t,l.fn,void 0,!0),u){ - case 1:return l.fn.call(l.context),!0; - case 2:return l.fn.call(l.context,i),!0; - case 3:return l.fn.call(l.context,i,e),!0; - case 4:return l.fn.call(l.context,i,e,n),!0; - case 5:return l.fn.call(l.context,i,e,n,h),!0; - case 6:return l.fn.call(l.context,i,e,n,h,r),!0} - for(c=1,a=new Array(u-1); - c<u; - c++)a[c-1]=arguments[c]; - l.fn.apply(l.context,a)} - else{ - var d,f=l.length; - for(c=0; - c<f; - c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),u){ - case 1:l[c].fn.call(l[c].context); - break; - case 2:l[c].fn.call(l[c].context,i); - break; - case 3:l[c].fn.call(l[c].context,i,e); - break; - case 4:l[c].fn.call(l[c].context,i,e,n); - break; - default:if(!a)for(d=1,a=new Array(u-1); - d<u; - d++)a[d-1]=arguments[d]; - l[c].fn.apply(l[c].context,a)} - } - return!0} - ,"emit"),o.prototype.on=Qt(function(t,i,s){ - return h(this,t,i,s,!1)} - ,"on"),o.prototype.once=Qt(function(t,i,s){ - return h(this,t,i,s,!0)} - ,"once"),o.prototype.removeListener=Qt(function(t,i,e,n){ - var h=s?s+t:t; - if(!this._events[h])return this; - if(!i)return r(this,h),this; - var o=this._events[h]; - if(o.fn)o.fn!==i||n&&!o.once||e&&o.context!==e||r(this,h); - else{ - for(var a=0,c=[],l=o.length; - a<l; - a++)(o[a].fn!==i||n&&!o[a].once||e&&o[a].context!==e)&&c.push(o[a]); - c.length?this._events[h]=1===c.length?c[0]:c:r(this,h)} - return this} - ,"removeListener"),o.prototype.removeAllListeners=Qt(function(t){ - var i; - return t?(i=s?s+t:t,this._events[i]&&r(this,i)):(this._events=new e,this._eventsCount=0),this} - ,"removeAllListeners"),o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=s,o.EventEmitter=o,t.exports=o} - (KVt); - var zVt=BFt&&BFt.__importDefault||function(t){ - return t&&t.__esModule?t:{ - default:t} - } - ; - Object.defineProperty(jVt,"__esModule",{ - value:!0} - ),jVt.IEngine=jVt.ISignClient=jVt.ISignClientEvents=jVt.IEngineEvents=void 0; - const YVt=zVt(KVt.exports),qVt=class extends YVt.default{ - constructor(){ - super()} - } - ; - Qt(qVt,"IEngineEvents"); - let XVt=qVt; - jVt.IEngineEvents=XVt; - const JVt=class extends YVt.default{ - constructor(){ - super()} - } - ; - Qt(JVt,"ISignClientEvents"); - let QVt=JVt; - jVt.ISignClientEvents=QVt; - const ZVt=class{ - constructor(t){ - this.data=t} - } - ; - Qt(ZVt,"ISignClient"); - let tjt=ZVt; - jVt.ISignClient=tjt; - const ijt=class{ - constructor(t){ - this.client=t} - } - ; - Qt(ijt,"IEngine"); - let sjt=ijt; - jVt.IEngine=sjt; - var ejt,njt={ - } - ; - Object.defineProperty(njt,"__esModule",{ - value:!0} - ),njt.ConnectWalletType=void 0,function(t){ - t[t.OKX_MINI=110]="OKX_MINI",t[t.OKX_APP=100]="OKX_APP",t[t.OKX_WALLET=120]="OKX_WALLET",t[t.OKX_APP_COMMON=130]="OKX_APP_COMMON"} - (ejt||(njt.ConnectWalletType=ejt={ - } - )); - var hjt,rjt={ - } - ,ojt={ - } - ; - Object.defineProperty(ojt,"__esModule",{ - value:!0} - ),ojt.TONCHAIN=void 0,(hjt||(ojt.TONCHAIN=hjt={ - } - )).MAINNET="-239"; - var ajt,cjt={ - } - ; - Object.defineProperty(cjt,"__esModule",{ - value:!0} - ),cjt.CONNECT_ITEM_ERROR_CODES=void 0,function(t){ - t[t.UNKNOWN_ERROR=0]="UNKNOWN_ERROR",t[t.METHOD_NOT_SUPPORTED=400]="METHOD_NOT_SUPPORTED"} - (ajt||(cjt.CONNECT_ITEM_ERROR_CODES=ajt={ - } - )),function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.CONNECT_ITEM_ERROR_CODES=t.TONCHAIN=void 0; - var i=ojt; - Object.defineProperty(t,"TONCHAIN",{ - enumerable:!0,get:Qt(function(){ - return i.TONCHAIN} - ,"get")} - ); - var s=cjt; - Object.defineProperty(t,"CONNECT_ITEM_ERROR_CODES",{ - enumerable:!0,get:Qt(function(){ - return s.CONNECT_ITEM_ERROR_CODES} - ,"get")} - )} - (rjt); - var ljt={ - } - ; - !function(t){ - function i(){ - return{ - appName:"okxAppWallet",name:t.OKXWalletName,imageUrl:"https://static.okx.com/cdn/assets/imgs/247/58E63FEA47A2B7D7.png"} - } - function s(){ - return{ - appName:"okxMiniApp",name:t.OKXMiniWalletName,imageUrl:"https://static.okx.com/cdn/assets/imgs/247/58E63FEA47A2B7D7.png"} - } - function e(){ - return{ - appName:"okxInjectWallet",name:t.OKXInjectWalletName,imageUrl:""} - } - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.AptosAppleWalletName=t.AptosGoogleWalletName=t.OKXInjectWalletName=t.OKXMiniWalletName=t.OKXWalletName=void 0,t.creatOKXWalletInfo=i,t.creatOKXMiniAppWalletInfo=s,t.creatOKXInjectWalletInfo=e,t.OKXWalletName="OKX Wallet",t.OKXMiniWalletName="OKX Mini Wallet",t.OKXInjectWalletName="OKX Inject Wallet",t.AptosGoogleWalletName="Continue with Google",t.AptosAppleWalletName="Continue with Apple",Qt(i,"creatOKXWalletInfo2"),Qt(s,"creatOKXMiniAppWalletInfo2"),Qt(e,"creatOKXInjectWalletInfo2")} - (ljt),function(t){ - var i=BFt&&BFt.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=BFt&&BFt.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.ConnectWalletType=t.ISignClientEvents=t.IEngine=t.IEngineEvents=t.ISignClient=t.getBigIntRpcId=t.formatJsonRpcRequest=t.isJsonRpcError=t.isJsonRpcResponse=t.parseConnectionError=t.isHttpUrl=t.formatJsonRpcError=void 0; - var e=wVt; - Object.defineProperty(t,"formatJsonRpcError",{ - enumerable:!0,get:Qt(function(){ - return e.formatJsonRpcError} - ,"get")} - ),Object.defineProperty(t,"isHttpUrl",{ - enumerable:!0,get:Qt(function(){ - return e.isHttpUrl} - ,"get")} - ),Object.defineProperty(t,"parseConnectionError",{ - enumerable:!0,get:Qt(function(){ - return e.parseConnectionError} - ,"get")} - ),Object.defineProperty(t,"isJsonRpcResponse",{ - enumerable:!0,get:Qt(function(){ - return e.isJsonRpcResponse} - ,"get")} - ),Object.defineProperty(t,"isJsonRpcError",{ - enumerable:!0,get:Qt(function(){ - return e.isJsonRpcError} - ,"get")} - ),Object.defineProperty(t,"formatJsonRpcRequest",{ - enumerable:!0,get:Qt(function(){ - return e.formatJsonRpcRequest} - ,"get")} - ),Object.defineProperty(t,"getBigIntRpcId",{ - enumerable:!0,get:Qt(function(){ - return e.getBigIntRpcId} - ,"get")} - ); - var n=jVt; - Object.defineProperty(t,"ISignClient",{ - enumerable:!0,get:Qt(function(){ - return n.ISignClient} - ,"get")} - ),Object.defineProperty(t,"IEngineEvents",{ - enumerable:!0,get:Qt(function(){ - return n.IEngineEvents} - ,"get")} - ),Object.defineProperty(t,"IEngine",{ - enumerable:!0,get:Qt(function(){ - return n.IEngine} - ,"get")} - ),Object.defineProperty(t,"ISignClientEvents",{ - enumerable:!0,get:Qt(function(){ - return n.ISignClientEvents} - ,"get")} - ); - var h=njt; - Object.defineProperty(t,"ConnectWalletType",{ - enumerable:!0,get:Qt(function(){ - return h.ConnectWalletType} - ,"get")} - ),s(rjt,t),s(ljt,t)} - (pVt); - var ujt={ - } - ; - !function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.NAMES_CHAINS=t.TON_CHAINS=t.COSMOS_CHAINS=t.APTOS_CHAINS=t.SUI_CHAINS=t.SOLANA_CHAINS_STANDARD=t.SOLANA_CHAINS=t.BTC_CHAINS=void 0; - const i=dVt; - t.BTC_CHAINS={ - MAINNET:"btc:mainnet",FRACTAL:"fractal:mainnet"} - ,t.SOLANA_CHAINS={ - MAINNET:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",TESTNET:"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z",SONIC_TESTNET:"sonic:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z"} - ,t.SOLANA_CHAINS_STANDARD={ - MAINNET:"solana:mainnet",TESTNET:"solana:testnet"} - ,t.SUI_CHAINS={ - MAINNET:"sui:mainnet"} - ,t.APTOS_CHAINS={ - MAINNET:"aptos:mainnet",MOVEMENT_MAINNET:"movement:mainnet",MOVEMENT_TESTNET:"movement:testnet"} - ,t.COSMOS_CHAINS={ - COSMOS_MAINNET:"cosmos:cosmoshub-4"} - ,t.TON_CHAINS={ - MAINNET:"ton:-239"} - ,t.NAMES_CHAINS={ - [i.NameSpaceKeyBtc]:Object.values(t.BTC_CHAINS),[i.NameSpaceKeySOL]:Object.values(t.SOLANA_CHAINS),[i.NameSpaceKeyTON]:Object.values(t.TON_CHAINS),[i.NameSpaceKeySui]:Object.values(t.SUI_CHAINS),[i.NameSpaceKeyAptos]:Object.values(t.APTOS_CHAINS),[i.NameSpaceKeyCosmos]:Object.values(t.COSMOS_CHAINS)} - } - (ujt),function(t){ - var i=BFt&&BFt.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),s=BFt&&BFt.__exportStar||function(t,s){ - for(var e in t)"default"===e||Object.prototype.hasOwnProperty.call(s,e)||i(s,t,e)} - ; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.okxWalletUniversalLink=t.okxAppUniversalLink=t.okxWalletDeepLink=t.okxAppDeepLink=t.okxWalletStackDeepLink=t.okxAppStackDeepLink=t.standardDeeplink=t.downloadUrl=t.tonConnectSdkVersion=t.OpenAppLinkType=t.NameSpaceKeyStarknet=t.NameSpaceKeyTron=t.NameSpaceKeyCosmos=t.NameSpaceKeyAptos=t.NameSpaceKeyBtc=t.NameSpaceKeySui=t.NameSpaceKeyTON=t.NameSpaceKeySOL=t.NameSpaceKeyEip155=void 0,s(cVt,t); - var e=dVt; - Object.defineProperty(t,"NameSpaceKeyEip155",{ - enumerable:!0,get:Qt(function(){ - return e.NameSpaceKeyEip155} - ,"get")} - ),Object.defineProperty(t,"NameSpaceKeySOL",{ - enumerable:!0,get:Qt(function(){ - return e.NameSpaceKeySOL} - ,"get")} - ),Object.defineProperty(t,"NameSpaceKeyTON",{ - enumerable:!0,get:Qt(function(){ - return e.NameSpaceKeyTON} - ,"get")} - ),Object.defineProperty(t,"NameSpaceKeySui",{ - enumerable:!0,get:Qt(function(){ - return e.NameSpaceKeySui} - ,"get")} - ),Object.defineProperty(t,"NameSpaceKeyBtc",{ - enumerable:!0,get:Qt(function(){ - return e.NameSpaceKeyBtc} - ,"get")} - ),Object.defineProperty(t,"NameSpaceKeyAptos",{ - enumerable:!0,get:Qt(function(){ - return e.NameSpaceKeyAptos} - ,"get")} - ),Object.defineProperty(t,"NameSpaceKeyCosmos",{ - enumerable:!0,get:Qt(function(){ - return e.NameSpaceKeyCosmos} - ,"get")} - ),Object.defineProperty(t,"NameSpaceKeyTron",{ - enumerable:!0,get:Qt(function(){ - return e.NameSpaceKeyTron} - ,"get")} - ),Object.defineProperty(t,"NameSpaceKeyStarknet",{ - enumerable:!0,get:Qt(function(){ - return e.NameSpaceKeyStarknet} - ,"get")} - ),Object.defineProperty(t,"OpenAppLinkType",{ - enumerable:!0,get:Qt(function(){ - return e.OpenAppLinkType} - ,"get")} - ); - var n=fVt; - Object.defineProperty(t,"tonConnectSdkVersion",{ - enumerable:!0,get:Qt(function(){ - return n.tonConnectSdkVersion} - ,"get")} - ),Object.defineProperty(t,"downloadUrl",{ - enumerable:!0,get:Qt(function(){ - return n.downloadUrl} - ,"get")} - ),Object.defineProperty(t,"standardDeeplink",{ - enumerable:!0,get:Qt(function(){ - return n.standardDeeplink} - ,"get")} - ),Object.defineProperty(t,"okxAppStackDeepLink",{ - enumerable:!0,get:Qt(function(){ - return n.okxAppStackDeepLink} - ,"get")} - ),Object.defineProperty(t,"okxWalletStackDeepLink",{ - enumerable:!0,get:Qt(function(){ - return n.okxWalletStackDeepLink} - ,"get")} - ),Object.defineProperty(t,"okxAppDeepLink",{ - enumerable:!0,get:Qt(function(){ - return n.okxAppDeepLink} - ,"get")} - ),Object.defineProperty(t,"okxWalletDeepLink",{ - enumerable:!0,get:Qt(function(){ - return n.okxWalletDeepLink} - ,"get")} - ),Object.defineProperty(t,"okxAppUniversalLink",{ - enumerable:!0,get:Qt(function(){ - return n.okxAppUniversalLink} - ,"get")} - ),Object.defineProperty(t,"okxWalletUniversalLink",{ - enumerable:!0,get:Qt(function(){ - return n.okxWalletUniversalLink} - ,"get")} - ),s(pVt,t),s(ujt,t)} - (aVt),Object.defineProperty(oVt,"__esModule",{ - value:!0} - ),oVt.CONNECTOR_TYPE=oVt.STANDARD_INJECT_WALLET=oVt.OKX_TG_WALLET=oVt.OKX_APP_COMMON_WALLET=oVt.OKX_WALLET_APP_WALLET=oVt.OKX_APP_WALLET=oVt.OKX_INJECT_WALLET=void 0; - const djt=aVt,fjt=ljt; - oVt.OKX_INJECT_WALLET=fjt.OKXInjectWalletName,oVt.OKX_APP_WALLET=djt.OKXWalletName,oVt.OKX_WALLET_APP_WALLET=djt.OKXWalletName,oVt.OKX_APP_COMMON_WALLET=djt.OKXWalletName,oVt.OKX_TG_WALLET=fjt.OKXMiniWalletName,oVt.STANDARD_INJECT_WALLET="standard_inject_wallet",oVt.CONNECTOR_TYPE={ - NOT_INSTALLED:-1,WS:{ - OKX_APP_WALLET:100,OKX_TG_WALLET:110,OKX_WALLET_APP_WALLET:120,OKX_APP_COMMON:130} - ,INJECT:{ - OKX_INJECT_WALLET:200,STANDARD_INJECT_WALLET:210} - ,KEYLESS:{ - APPLE_WALLET:300,GOOGLE_WALLET:310} - } - ,Object.defineProperty(rVt,"__esModule",{ - value:!0} - ); - var pjt=rVt.NotAvailableConnector=void 0; - const wjt=oVt,gjt=class{ - constructor(t,i,s){ - this.downLoadUrl=s,this.walletNameKey="",this.enable=!0,this.walletName=t,this.icon=i} - getTag(){ - throw new Error("Method not implemented.")} - send(t,i,s){ - throw new Error("Method not implemented.")} - openWallet(t,i){ - window.open(this.downLoadUrl,"_blank")} - setOnConnectResultListener(t){ - throw new Error("Method not implemented.")} - setAccountChangeListener(t){ - throw new Error("Method not implemented.")} - setConnectionManager(t){ - throw new Error("Method not implemented.")} - clearData(){ - throw new Error("Method not implemented.")} - addDisconnectListener(t){ - throw new Error("Method not implemented.")} - connectManagerDisconnect(t){ - throw new Error("Method not implemented.")} - getCurrentConnectionReady(t){ - throw new Error("Method not implemented.")} - restoreconnect(t,i){ - throw new Error("Method not implemented.")} - getType(){ - return wjt.CONNECTOR_TYPE.NOT_INSTALLED} - } - ; - Qt(gjt,"NotAvailableConnector"); - let mjt=gjt; - pjt=rVt.NotAvailableConnector=mjt; - const vjt=Qt(t=>{ - var i,s,e; - const{ - sortedIds:n=[]} - =null!=(s=null==(i=yBt.connectRequestParameters)?void 0:i.sessionConfig)?s:{ - } - ; - let h=[]; - !iBt()&&Mgt.isBrowser("chrome")&&(h=[...n]); - const r=t.connector.filter(t=>Mgt.CONNECTOR_TYPE.INJECT.STANDARD_INJECT_WALLET==t.getType()&&!t.walletName.toLowerCase().includes("okx")||Mgt.CONNECTOR_TYPE.KEYLESS.GOOGLE_WALLET==t.getType()||Mgt.CONNECTOR_TYPE.KEYLESS.APPLE_WALLET==t.getType()); - let o,a,c,l; - r.sort((t,i)=>t.walletName.localeCompare(i.walletName)),r.find(t=>t.getType()==Mgt.CONNECTOR_TYPE.KEYLESS.GOOGLE_WALLET)&&(h.push(Mgt.AptosGoogleWalletName),h.push(Mgt.AptosAppleWalletName)); - const u=new Map(r.map(t=>[t.walletName,t])),d=new Set,f=h.flatMap(t=>{ - const i=u.get(t); - return i?(d.add(t),[i]):[]} - ),p=r.filter(t=>!d.has(t.walletName)); - let w=[...f,...p,...h.filter(t=>!d.has(t)).map(t=>{ - let i=Mgt.wallets[t]; - return new pjt(t,i.icon,i.downloadUrl)} - )]; - if(iBt()){ - const i=t.connector.find(t=>t.getType()===Mgt.CONNECTOR_TYPE.WS.OKX_APP_WALLET); - i&&(o=pDt(S$t,{ - wallet:i,onClick:Qt(()=>{ - t.openWallet(i)} - ,"onClick")} - )); - const s=t.connector.find(t=>t.getType()===Mgt.CONNECTOR_TYPE.WS.OKX_WALLET_APP_WALLET); - s&&(a=pDt(S$t,{ - wallet:s,onClick:Qt(()=>{ - t.openWallet(s)} - ,"onClick")} - ))} - else{ - const i=t.connector.find(t=>t.getType()===Mgt.CONNECTOR_TYPE.INJECT.OKX_INJECT_WALLET||Mgt.CONNECTOR_TYPE.INJECT.STANDARD_INJECT_WALLET==t.getType()&&t.walletName.toLowerCase().includes("okx")); - FBt()?i&&(o=pDt(S$t,{ - wallet:i,onClick:Qt(()=>{ - t.openWallet(i)} - ,"onClick")} - )):o=i?pDt(S$t,{ - wallet:i,onClick:Qt(()=>{ - t.openWallet(i)} - ,"onClick")} - ):pDt(hVt,{ - } - ); - let[s]=w.splice(0,1); - s&&(a=pDt(S$t,{ - wallet:s,onClick:Qt(()=>{ - t.openWallet(s)} - ,"onClick")} - ))} - let[g]=w.splice(0,1); - if(g&&(c=pDt(S$t,{ - wallet:g,onClick:Qt(()=>{ - t.openWallet(g)} - ,"onClick")} - )),w.length>1)l=pDt(EDt,{ - get when(){ - return w.length>0} - ,get children(){ - return pDt(E$t,{ - labelLine1:"View all wallets",labelLine2:"",connectors:w,onClick:Qt(()=>{ - t.setSelectTab("all-wallets")} - ,"onClick")} - )} - } - ); - else if(w.length=1){ - let i=w[0]; - i&&(l=pDt(S$t,{ - wallet:i,onClick:Qt(()=>{ - t.openWallet(i)} - ,"onClick")} - ))} - return null==(e=t.setOtherConnectors)||e.call(t,w),pDt(nVt,{ - get children(){ - return[o,a,c,l]} - } - )} - ,"DesktopMultiWalletListModalPage"),_jt=Qt(t=>{ - KLt(U$t),t.setLastSelectedWalletInfo(aLt(oLt({ - } - ,t.wallet),{ - openMethod:"qrcode"} - )),HLt(()=>{ - Mgt.reportEvent(Mgt.OKXReportType.PAGE_IN,Mgt.Report_ChooseType_ConnectWallet_View,"")} - ),WLt(()=>{ - Mgt.reportEvent(Mgt.OKXReportType.PAGE_OUT,Mgt.Report_ChooseType_ConnectWallet_View,"")} - ); - let i=!!t.walletConnector.find(t=>t.getType()===Mgt.CONNECTOR_TYPE.WS.OKX_TG_WALLET&&t.enable)||iBt(); - const s=ULt(()=>null===t.universalLinkParams()&&!t.connectError()&&i),e=ULt(()=>!s()&&t.connectError()),n=ULt(()=>!s()&&!t.connectError()); - BLt(()=>{ - Mgt.logDebug("TON customEvent.detail :::",BLt); - var i=t.universalLinkParams(); - if(Mgt.logDebug("TON customEvent.detail :::",JSON.stringify(i)),i){ - var s=i.connectRequest; - if(s){ - var e=Mgt.getOKXLink(s).universalLink; - r(e)} - } - } - ); - const[h,r]=LLt(null); - HLt(()=>wLt(void 0,null,function*(){ - try{ - yield t.connect().catch(t=>Mgt.logDebug("DesktopConnectionModal connect catch error ",JSON.stringify(t)))} - catch(i){ - Mgt.logDebug("DesktopConnectionModal connect error ",JSON.stringify(i))} - } - )); - const o=Qt(()=>{ - Mgt.reportEvent(Mgt.OKXReportType.CLICK,Mgt.Report_Proceed_Retry_Click,""); - try{ - t.connect()} - catch(i){ - } - } - ,"onRetry"),a=Qt(i=>{ - var s,e=t.universalLinkParams(); - e&&(i.openWallet(e),i.getType()!=Mgt.CONNECTOR_TYPE.NOT_INSTALLED&&(null==(s=t.setSelectedOtherConnector)||s.call(t,i),i.getType()===Mgt.CONNECTOR_TYPE.WS.OKX_WALLET_APP_WALLET||i.getType()===Mgt.CONNECTOR_TYPE.WS.OKX_APP_WALLET||i.getType()===Mgt.CONNECTOR_TYPE.WS.OKX_TG_WALLET?t.setLastSelectedWalletInfo(aLt(oLt({ - } - ,t.wallet),{ - openMethod:"universal-link"} - )):t.setLastSelectedWalletInfo(aLt(oLt({ - } - ,t.wallet),{ - openMethod:"inject"} - ))))} - ,"injectedWalletClick"); - return pDt(sVt,{ - "data-tc-wallets-modal-connection-mobile":"true",get children(){ - return[pDt(K$t,{ - children:"OKX Connect"} - ),pDt(EDt,{ - get when(){ - return s()} - ,get children(){ - return[pDt(AHt,{ - } - ),pDt(OHt,{ - showAllWallet:Qt(()=>aUt(),"showAllWallet")} - )]} - } - ),pDt(EDt,{ - get when(){ - return e()} - ,get children(){ - return pDt(eVt,{ - get children(){ - return pDt(kHt,{ - onRetry:o,get showRetry(){ - return t.showRetry} - ,get errorInfo(){ - return t.connectionDeclineInfo} - } - )} - } - )} - } - ),pDt(EDt,{ - get when(){ - return n()} - ,get children(){ - return pDt(eVt,{ - get children(){ - return[pDt(zHt,{ - get universalLink(){ - return h()} - ,get walletInfo(){ - return t.wallet} - ,get sessionConnecting(){ - return t.sessionConnecting} - } - ),pDt(vjt,{ - get connector(){ - return t.walletConnector} - ,openWallet:a,get setSelectTab(){ - return t.setSelectTab} - ,get setOtherConnectors(){ - return t.setOtherConnectors} - } - )]} - } - )} - } - ),pDt(EDt,{ - get when(){ - return!s()} - ,get children(){ - return pDt(OHt,{ - showAllWallet:Qt(()=>aUt(),"showAllWallet")} - )} - } - )]} - } - )} - ,"NewConnectionModal"); - var Mjt=GDt("<div>"); - const bjt=Qt(t=>{ - const{ - locale:i} - =YFt()[1]; - BLt(()=>i(t.language)),ULt(()=>iBt()||FBt()); - const[s,e]=LLt("connect"),[n,h]=LLt(null),[r,o]=LLt([]); - return BLt(()=>{ - t.opened?eBt():(h(null),e("connect")),t.connectError()&&(h(null),e("connect"))} - ),pDt(j$t,{ - get opened(){ - return t.opened} - ,onClose:Qt(()=>{ - t.onClose("action-cancelled"),t.disconnect()} - ,"onClose"),"data-tc-wallets-modal-container":"true",get children(){ - return[pDt(EDt,{ - get when(){ - return n()} - ,get children(){ - return pDt(iVt,{ - get connector(){ - return n()} - ,onBack:Qt(()=>{ - h(null)} - ,"onBack"),get universalLinkParams(){ - return t.universalLinkParams} - } - )} - } - ),pDt(EDt,{ - when:!0,get children(){ - var i=Mjt(); - return YDt(i,pDt(_jt,{ - get wallet(){ - return t.walletInfo} - ,onBackClick:Qt(()=>{ - } - ,"onBackClick"),backDisabled:!0,get connect(){ - return t.connect} - ,get universalLinkParams(){ - return t.universalLinkParams} - ,get lastSelectedWalletInfo(){ - return t.lastSelectedWalletInfo} - ,get setLastSelectedWalletInfo(){ - return t.setLastSelectedWalletInfo} - ,get connectError(){ - return t.connectError} - ,get showRetry(){ - return t.showRetry} - ,get sessionConnecting(){ - return t.sessionConnecting} - ,get walletConnector(){ - return t.walletConnector()} - ,setSelectedOtherConnector:h,setSelectTab:e,get connectionDeclineInfo(){ - return t.connectionDeclineInfo} - ,setOtherConnectors:o} - )),GLt(t=>null!=(t="connect"!==s()||n()?"none":"block")?i.style.setProperty("display",t):i.style.removeProperty("display")),i} - } - ),pDt(EDt,{ - get when(){ - return ULt(()=>"all-wallets"===s())()&&!n()} - ,get children(){ - return pDt(zWt,{ - onBack:Qt(()=>{ - h(null),e("connect")} - ,"onBack"),get universalLinkParams(){ - return t.universalLinkParams} - ,setSelectedOtherConnector:h,otherConnectors:r} - )} - } - )]} - } - )} - ,"NewSingleWalletModal"),yjt=Qt(()=>{ - const t=KLt(U$t),i=KLt(V$t),[s,e]=LLt(null),[n,h]=LLt(!1),[r,o]=LLt(""),[a,c]=LLt(!1),l=Qt(i=>{ - t.closeModal(i)} - ,"onClose"),u=Qt(()=>{ - try{ - i.disconnect()} - catch(r6i){ - } - } - ,"disconnect"); - return null==i||i.on("okx_engine_connect_params",t=>{ - Mgt.logDebug(`UniversalSigneWalletModal okx_engine_connect_params ${ - JSON.stringify(t)} - `),e(t)} - ),null==i||i.on("session_connecting",()=>{ - Mgt.logDebug("UniversalSigneWalletModal session_connecting } - "),c(!0)} - ),BLt(()=>{ - OWt()||(h(!1),e(null),c(!1))} - ),pDt(rGt,{ - get component(){ - return aUt()?bjt:nWt} - ,get opened(){ - return OWt()} - ,get walletInfo(){ - return IWt()} - ,loadingBeforeConnect:Qt(()=>!1,"loadingBeforeConnect"),connect:Qt(()=>new Promise((s,n)=>{ - var r,a; - yBt.connectRequestParameters&&new vLt("connect params is nil"); - let u=oLt({ - } - ,JSON.parse(JSON.stringify(yBt.connectRequestParameters))); - u.sessionConfig={ - } - ,u.sessionConfig.openUniversalUrl=JBt(null==(r=yBt.connectRequestParameters)?void 0:r.namespaces,null==(a=yBt.connectRequestParameters)?void 0:a.optionalNamespaces),h(!1),e(null),c(!1),o(""),t.handleConnect(t=>(u.sessionConfig.tmaReturnUrl=null==t?void 0:t.tmaReturnUrl,u.sessionConfig.redirect=null==t?void 0:t.returnStrategy,i.connect(u))).then(t=>{ - t?(l("wallet-selected"),s(t)):(h(!0),l("action-cancelled"))} - ).catch(t=>{ - h(!0),Mgt.logDebug("UniversalSingleWalletModal connect error",JSON.stringify(t)),n(t)} - )} - ),"connect"),onClose:l,universalLinkParams:s,get lastSelectedWalletInfo(){ - return xWt()} - ,setLastSelectedWalletInfo:PWt,connectError:n,showRetry:!1,walletConnector:Qt(()=>(XBt(),yBt.walletConnector.filter(t=>t.enable)),"walletConnector"),get language(){ - return yBt.language} - ,sessionConnecting:a,connectionDeclineInfo:r,disconnect:u} - )} - ,"UniversalSingleWalletModal"),[Ejt,Ajt]=bBt({ - theme:gLt.LIGHT,colors:_Wt,borderRadius:"m"} - ),Sjt={ - [gLt.LIGHT]:_Wt,[gLt.DARK]:{ - constant:{ - black:"#000000",white:"#FFFFFF"} - ,connectButton:{ - background:"#0098EA",foreground:"#FFFFFF"} - ,accent:"#E5E5EA",telegramButton:"#31A6F5",qrFill:"#FFFFFF",icon:{ - primary:"#E5E5EA",secondary:"#909099",tertiary:"#434347",success:"#29CC6A",error:"#F5A73B"} - ,background:{ - primary:"#121214",secondary:"#18181A",segment:"#262629",tint:"#222224",qr:"#121214"} - ,text:{ - primary:"#FFFFFF",secondary:"#7D7D85",contrast:"#909090"} - ,border:{ - primary:"#FFFFFF1F",secondary:"#FFFFFF30"} - ,disable:"#5B5B5B"} - } - ; - function Tjt(t){ - Ajt({ - theme:t,colors:Sjt[t]} - )} - Qt(Tjt,"setUniversalTheme"); - const Cjt=Qt(t=>{ - const i=KFt(rWt,yBt.language); - return wUt(),pUt(),pDt(zFt.Provider,{ - value:i,get children(){ - return pDt(U$t.Provider,{ - get value(){ - return t.connectUI} - ,get children(){ - return pDt(V$t.Provider,{ - get value(){ - return yBt.connector} - ,get children(){ - return[pDt(OGt,{ - } - ),pDt(MGt,{ - theme:Ejt,get children(){ - return pDt(rGt,{ - component:SGt,style:{ - position:"relative","z-index":3001} - ,get children(){ - return[pDt(yjt,{ - } - ),pDt(vWt,{ - get action(){ - return NWt()} - ,setAction:LWt} - )]} - } - )} - } - )]} - } - )} - } - )} - } - )} - ,"UniversalApp"),Ojt={ - openSingleWalletModal:Qt(t=>{ - Mgt.logDebug(`universalWidgetController : openSingleWalletModal : ${ - JSON.stringify(t)} - `),setTimeout(()=>CWt({ - status:"opened",closeReason:null,walletInfo:t} - ))} - ,"openSingleWalletModal"),closeSingleWalletModal:Qt(t=>{ - setTimeout(()=>CWt({ - status:"closed",closeReason:t} - ))} - ,"closeSingleWalletModal"),setAction:Qt(t=>{ - setTimeout(()=>LWt(t))} - ,"setAction"),clearAction:Qt(()=>{ - setTimeout(()=>{ - LWt(null)} - )} - ,"clearAction"),getSelectedWalletInfo:Qt(()=>xWt(),"getSelectedWalletInfo"),removeSelectedWalletInfo:Qt(()=>PWt(null),"removeSelectedWalletInfo"),renderUniversalApp:Qt((t,i)=>DDt(()=>pDt(Cjt,{ - connectUI:i} - ),document.getElementById(t)),"renderUniversalApp")} - ,Ijt=class{ - constructor(){ - cLt(this,"listeners",[])} - listen(t){ - this.listeners.push(t)} - trigger(t){ - this.listeners.forEach(i=>i(t))} - } - ; - Qt(Ijt,"Signal"); - let kjt=Ijt; - const xjt=class{ - constructor(t){ - cLt(this,"consumers",[]),cLt(this,"getWalltsInfo"),cLt(this,"connectSignal",new kjt),cLt(this,"state",TWt()),this.getWalltsInfo=t.getWalltsInfo,BLt(()=>{ - const t=TWt(); - this.state=t,this.consumers.forEach(i=>i(t))} - )} - open(t,i){ - return wLt(this,null,function*(){ - Mgt.logDebug(`UniversalSingleWalletModalManager : open : ${ - JSON.stringify(i)} - `); - const s=this.getWalltsInfo().find(i=>UBt(i,t)); - if(s)return this.openSingleWalletModal(s,i); - throw new vLt(`Trying to open modal window with unknown wallet "${ - t} - ".`)} - )} - close(t="action-cancelled"){ - Ojt.closeSingleWalletModal(t)} - onStateChange(t){ - return this.consumers.push(t),()=>{ - this.consumers=this.consumers.filter(i=>i!==t)} - } - handleConnect(t,i){ - return wLt(this,null,function*(){ - return new Promise((s,e)=>{ - try{ - t(i).then(t=>{ - s(t),Mgt.logDebug("UniversalSingleWalletModalManager result >>>",JSON.stringify(t)),this.connectSignal.trigger(t)} - ).catch(t=>{ - e(t),Mgt.logDebug("UniversalSingleWalletModalManager error >>>",JSON.stringify(t)),this.connectSignal.trigger(t)} - )} - catch(n){ - e(n),Mgt.logDebug("UniversalSingleWalletModalManager catch error >>>",JSON.stringify(n)),this.connectSignal.trigger(n)} - } - )} - )} - openSingleWalletModal(t,i){ - return wLt(this,null,function*(){ - if(Mgt.logDebug(`UniversalSingleWalletModalManager : openSingleWalletModal : ${ - JSON.stringify(i)} - `),$Gt()&&WGt(),EBt({ - connectRequestParameters:i} - ),XBt(),!yBt.walletConnector.some(t=>t.enable))throw new Mgt.OKXConnectError(Mgt.OKX_CONNECT_ERROR_CODES.CHAIN_NOT_SUPPORTED); - const s=new Promise((t,i)=>{ - this.connectSignal.listen(s=>{ - s instanceof Error?i(s):t(s)} - )} - ); - let e=yBt.walletConnector.filter(t=>t.enable); - if(1!=e.length||!cUt(e[0]))return Ojt.openSingleWalletModal(t),s; - { - let t=e[0]; - i.sessionConfig={ - openUniversalUrl:!1} - ; - const s=yBt.connector; - if(s)return null==s||s.once("okx_engine_connect_params",i=>{ - null==t||t.openWallet(i)} - ),null==s?void 0:s.connect(i)} - } - )} - } - ; - Qt(xjt,"UniversalSingleWalletModalManager"); - let Rjt=xjt; - function Pjt(t){ - if(t.length>=255)throw new TypeError("Alphabet too long"); - for(var i=new Uint8Array(256),s=0; - s<i.length; - s++)i[s]=255; - for(var e=0; - e<t.length; - e++){ - var n=t.charAt(e),h=n.charCodeAt(0); - if(255!==i[h])throw new TypeError(n+" is ambiguous"); - i[h]=e} - var r=t.length,o=t.charAt(0),a=Math.log(r)/Math.log(256),c=Math.log(256)/Math.log(r); - function l(i){ - if(i instanceof Uint8Array||(ArrayBuffer.isView(i)?i=new Uint8Array(i.buffer,i.byteOffset,i.byteLength):Array.isArray(i)&&(i=Uint8Array.from(i))),!(i instanceof Uint8Array))throw new TypeError("Expected Uint8Array"); - if(0===i.length)return""; - for(var s=0,e=0,n=0,h=i.length; - n!==h&&0===i[n]; - )n++,s++; - for(var a=(h-n)*c+1>>>0,l=new Uint8Array(a); - n!==h; - ){ - for(var u=i[n],d=0,f=a-1; - (0!==u||d<e)&&-1!==f; - f--,d++)u+=256*l[f]>>>0,l[f]=u%r>>>0,u=u/r>>>0; - if(0!==u)throw new Error("Non-zero carry"); - e=d,n++} - for(var p=a-e; - p!==a&&0===l[p]; - )p++; - for(var w=o.repeat(s); - p<a; - ++p)w+=t.charAt(l[p]); - return w} - function u(t){ - if("string"!=typeof t)throw new TypeError("Expected String"); - if(0===t.length)return new Uint8Array; - for(var s=0,e=0,n=0; - t[s]===o; - )e++,s++; - for(var h=(t.length-s)*a+1>>>0,c=new Uint8Array(h); - t[s]; - ){ - var l=t.charCodeAt(s); - if(l>255)return; - var u=i[l]; - if(255===u)return; - for(var d=0,f=h-1; - (0!==u||d<n)&&-1!==f; - f--,d++)u+=r*c[f]>>>0,c[f]=u%256>>>0,u=u/256>>>0; - if(0!==u)throw new Error("Non-zero carry"); - n=d,s++} - for(var p=h-n; - p!==h&&0===c[p]; - )p++; - for(var w=new Uint8Array(e+(h-p)),g=e; - p!==h; - )w[g++]=c[p++]; - return w} - function d(t){ - var i=u(t); - if(i)return i; - throw new Error("Non-base"+r+" character")} - return Qt(l,"encode"),Qt(u,"decodeUnsafe"),Qt(d,"decode"),{ - encode:l,decodeUnsafe:u,decode:d} - } - Qt(Pjt,"base"); - var Njt=Pjt("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"); - const Ljt=(Qt(Nt=class{ - constructor(t,i){ - cLt(this,"singleWalletModal"),cLt(this,"actionsConfiguration"),cLt(this,"systemThemeChangeUnsubscribe",null),cLt(this,"universalProvider"),Mgt.logDebug("OKXUniversalConnectUI constructor options:",JSON.stringify(t)),this.singleWalletModal=new Rjt({ - getWalltsInfo:Qt(()=>Ljt.getWallets(),"getWalltsInfo")} - ); - const s=this.normalizeWidgetRoot(void 0); - this.universalProvider=i,this.uiOptions=yWt(t,{ - uiPreferences:{ - theme:"SYSTEM"} - ,dappMetaData:t.dappMetaData} - ),EBt({ - connector:i,walletConnector:t.connector,dappMetaData:t.dappMetaData} - ),Ojt.renderUniversalApp(s,this)} - static getWallets(){ - return[Mgt.creatOKXWalletInfo(),Mgt.creatOKXMiniAppWalletInfo(),Mgt.creatOKXInjectWalletInfo()]} - set uiOptions(t){ - var i,s,e; - Mgt.logDebug("OKXUniversalConnectUI uiOptions() called"),this.actionsConfiguration=t.actionsConfiguration,(null==(i=t.uiPreferences)?void 0:i.theme)&&("SYSTEM"!==(null==(s=t.uiPreferences)?void 0:s.theme)?(null==(e=this.systemThemeChangeUnsubscribe)||e.call(this),Tjt(t.uiPreferences.theme)):(Tjt(lUt()),this.systemThemeChangeUnsubscribe||(this.systemThemeChangeUnsubscribe=uUt(Tjt)))),t.language&&!AWt(t.language.toString())&&(t.language="en_US"),EBt(i=>{ - var s; - return yWt(oLt(oLt({ - } - ,t.language&&{ - language:t.language} - ),!!(null==(s=t.actionsConfiguration)?void 0:s.returnStrategy)&&{ - returnStrategy:t.actionsConfiguration.returnStrategy} - ),lBt(i))} - )} - request(t,i,s){ - return wLt(this,null,function*(){ - var e,n,h,r,o; - if(Mgt.logDebug("OKXUniversalConnectUI request() called"),!this.session)throw new vLt("Connect wallet to send a transaction."); - const a={ - returnStrategy:JGt("mobile")&&"qrcode"!==(null==(e=xWt())?void 0:e.openMethod)?null==s?void 0:s.returnStrategy:"none",modals:null==s?void 0:s.modals,tmaReturnUrl:null!=(n=null==s?void 0:s.tmaReturnUrl)?n:"back"} - ,{ - modals:c,returnStrategy:l,tmaReturnUrl:u} - =this.getModalsAndNotificationsConfiguration(a),d=aLt(oLt({ - } - ,t),{ - redirect:l} - ),f=this.universalProvider.showRequestModal(d,i); - iUt(this.getConnectWallet())&&f&&Ojt.setAction({ - name:"confirm-transaction",openModal:c.includes("before")&&f,sent:!1} - ),!(null==(h=this.session.sessionConfig)?void 0:h.openUniversalUrl)&&f&&tUt(this.getConnectWallet(),null==(r=xWt())?void 0:r.openMethod)&&this.openWallet(),this.session.sessionConfig&&(this.session.sessionConfig.openUniversalUrl=this.session.sessionConfig.openUniversalUrl&&iBt()&&"qrcode"!==(null==(o=xWt())?void 0:o.openMethod)); - try{ - const t=yield this.universalProvider.request(d,i); - return this.showRequestModal()&&Ojt.setAction({ - name:"transaction-sent",openModal:c.includes("success")&&f} - ),t} - catch(r6i){ - throw Mgt.logDebug(`OKXUniversalConnectUI request ==> ${ - typeof r6i} - ==> is core OKXConnectError: ${ - r6i instanceof Mgt.OKXConnectError} - ==> is universal-provider OKXConnectError: ${ - r6i instanceof ZNt.OKXConnectError} - ==> ${ - JSON.stringify(r6i)} - `),r6i instanceof Mgt.OKXConnectError||r6i instanceof ZNt.OKXConnectError?(Mgt.logDebug(`OKXUniversalConnectUI request ==> ${ - JSON.stringify(r6i)} - `),this.showRequestModal()&&(r6i.code===Mgt.OKX_CONNECT_ERROR_CODES.USER_REJECTS_ERROR?Ojt.setAction({ - name:"transaction-canceled",openModal:c.includes("error")&&f} - ):Ojt.setAction({ - name:"transaction-error",openModal:c.includes("error")&&f} - )),r6i):(this.showRequestModal()&&Ojt.setAction({ - name:"transaction-error",openModal:c.includes("error")&&f} - ),new vLt("Unhandled error:"+r6i))} - } - )} - showRequestModal(){ - var t; - return!aUt(null==(t=this.session)?void 0:t.namespaces)||iUt(this.getConnectWallet())} - getModalsAndNotificationsConfiguration(t){ - var i,s,e; - const n=["before","success","error"]; - let h=["before"]; - (null==(i=this.actionsConfiguration)?void 0:i.modals)&&(h="all"===this.actionsConfiguration.modals?n:this.actionsConfiguration.modals),(null==t?void 0:t.modals)&&(h="all"===t.modals?n:t.modals); - const r=(null==t?void 0:t.returnStrategy)||(null==(s=this.actionsConfiguration)?void 0:s.returnStrategy)||"back"; - return{ - modals:h,tmaReturnUrl:(null==t?void 0:t.tmaReturnUrl)||(null==(e=this.actionsConfiguration)?void 0:e.tmaReturnUrl)||"back",returnStrategy:r} - } - static init(t){ - return wLt(this,null,function*(){ - if(Mgt.logDebug("OKXUniversalConnectUI init() called"),PBt(),window&&window.okxConnectUniversalUIinwindow instanceof Ljt)return Mgt.logDebug("OKXUniversalConnectUI init() old called"),window.okxConnectUniversalUIinwindow; - if(this.initPromise)return Mgt.logDebug("OKXUniversalConnectUI init() is waiting for ongoing initialization"),this.initPromise; - let i=0; - this.initPromise=(()=>wLt(this,null,function*(){ - if(!t||!t.dappMetaData)throw new vLt("You have to specify a `dappMetaData` in the options."); - NBt(),Mgt.logDebug("OKXUniversalConnectUI init() new called"),t.connector&&0!==t.connector.length||(t.connector=hUt()); - const s=yield ZNt.OKXUniversalProvider.init({ - dappMetaData:t.dappMetaData,connector:t.connector,openAppLinkType:t.openAppLinkType} - ),e=new Ljt(t,s); - window&&(window.okxConnectUniversalUIinwindow=e),BBt(s); - const n=setInterval(()=>{ - NBt(),i++,i>=4&&clearInterval(n)} - ,500); - return e} - ))(); - try{ - return yield this.initPromise} - finally{ - this.initPromise=null} - } - )} - normalizeWidgetRoot(t){ - if(!t||!document.getElementById(t)){ - t="universal-widget-root"; - const i=document.createElement("div"); - i.id=t,document.body.appendChild(i)} - return t} - getWallets(){ - return Ljt.getWallets()} - handleConnect(t){ - return wLt(this,null,function*(){ - return this.singleWalletModal.handleConnect(t,this.actionsConfiguration)} - )} - checkConnectMethods(t,i){ - return wLt(this,null,function*(){ - if(Mgt.logDebug("checkConnectMethods connectParams111 >>>>",JSON.stringify(t)),Mgt.logDebug("checkConnectMethods responseItems>>>>",JSON.stringify(i)),this.universalProvider.session&&t&&t.length>0&&(!i||0===i.length)){ - var s=t[0]; - if(s){ - if("sync_all_addresses"===s.method)return; - let t=[]; - try{ - let i=yield ZNt.connectMethodsAdaptOldVersion(s,this.universalProvider.session); - Mgt.logDebug("checkConnectMethods callBackParams111>>>>",JSON.stringify(i)); - let e={ - } - ; - $Gt()&&(e.returnStrategy="tg://resolve"),Mgt.logDebug("checkConnectMethods requestItem>>>>",JSON.stringify(s)),Mgt.logDebug("checkConnectMethods callBackParams222>>>>",JSON.stringify(i)),this.request(s,s.chainId,e).then(e=>{ - let n=e; - if(Mgt.logDebug(`checkConnectMethods then resultItem ====> ${ - JSON.stringify(n)} - `),"wallet_addEthereumChain"===s.method)n={ - method:s.method,chainId:s.chainId,result:""} - ; - else if("personal_sign"===s.method)n={ - method:s.method,chainId:s.chainId,result:n} - ; - else if("btc_signMessage"===s.method)n.chainId=s.chainId; - else if("solana_signMessage"===s.method){ - let t=n.result; - n.chainId=s.chainId,n.result=aLt(oLt({ - } - ,i),{ - signature:Njt.decode(t)} - )} - else if("sui_signMessage"===s.method||"sui_signPersonalMessage"===s.method){ - const t=n.result; - n.chainId=s.chainId,n.result=aLt(oLt({ - } - ,i),{ - signature:t} - )} - else if("aptos_signMessage"===s.method){ - let t=n.result; - t.startsWith("0x")&&(t=t.slice(2,t.length)),n.chainId=s.chainId,n.result="injectResult"in n?n.injectResult:aLt(oLt({ - } - ,i),{ - signature:t} - )} - else"cosmos_signArbitrary"===s.method&&"string"==typeof n.result&&(n.chainId=s.chainId,n.result=JSON.parse(n.result)); - t.push(n),Mgt.logDebug(`OKXUniversalConnectUI checkConnectMethods success result ====> ${ - JSON.stringify(t)} - `),this.universalProvider.events.emit("connect_signResponse",t)} - ).catch(i=>{ - let e=ZNt.creatNotSupportMethodItemReplay(s); - t.push(e),Mgt.logDebug(`OKXUniversalConnectUI checkConnectMethods error ====> ${ - JSON.stringify(i)} - `),this.universalProvider.events.emit("connect_signResponse",t)} - )} - catch(h6i){ - let e=ZNt.creatNotSupportMethodItemReplay(s); - t.push(e),Mgt.logDebug(`OKXUniversalConnectUI checkConnectMethods error ====> ${ - JSON.stringify(h6i)} - `),this.universalProvider.events.emit("connect_signResponse",t)} - } - } - } - )} - openModalAndSign(t,i){ - return wLt(this,null,function*(){ - Mgt.logDebug("OKXUniversalConnectUI openModalAndSign() called"); - const s=aLt(oLt({ - } - ,t),{ - signRequest:i} - ); - return Mgt.logDebug("OKXUniversalConnectUI openModalAndSign() opts:",JSON.stringify(t)),Mgt.reportEvent(Mgt.OKXReportType.CLICK,Mgt.Report_ConnectDapp_ConnectAndSign_Click,this.universalProvider.providerOpts.dappMetaData.name),yield this.openModal(s)} - )} - openModal(t){ - return wLt(this,null,function*(){ - var i; - NBt(),Mgt.logDebug("OKXUniversalConnectUI openModal() called"); - try{ - if(this.connected())return this.session; - null==(i=this.session)||i.namespaces; - let e=t.signRequest?JSON.parse(JSON.stringify(t.signRequest)):[]; - Mgt.logDebug("OKXUniversalConnectUI openModal signRequest:",JSON.stringify(e)); - var s=yield this.singleWalletModal.open("okxAppWallet",t); - return this.checkConnectMethods(e,null==s?void 0:s.signResponse),s} - catch(e){ - throw e} - } - )} - closeModal(t){ - this.singleWalletModal.close(t)} - openWallet(t,i){ - this.universalProvider.openWallet(t,i)} - onSingleWalletModalStateChange(t){ - return this.singleWalletModal.onStateChange(t)} - onModalStateChange(t){ - return this.onSingleWalletModalStateChange(t)} - showActionButton(){ - var t; - return oUt(this.getConnectWallet(),null==(t=xWt())?void 0:t.openMethod)} - getUniversalProvider(){ - return this.universalProvider} - getConnectWallet(){ - var t,i; - return Mgt.logDebug(`this.session?.wallet?.appName ${ - null==(i=null==(t=this.universalProvider.session)?void 0:t.wallet)?void 0:i.appName} - `),this.getWallets().find(t=>{ - var i,s; - return UBt(t,null==(s=null==(i=this.universalProvider.session)?void 0:i.wallet)?void 0:s.appName)} - )} - get session(){ - return this.universalProvider.session} - setDefaultChain(t,i){ - this.universalProvider.setDefaultChain(t,i)} - on(t,i){ - this.universalProvider.on(t,i)} - once(t,i){ - this.universalProvider.once(t,i)} - removeListener(t,i){ - this.universalProvider.removeListener(t,i)} - off(t,i){ - this.universalProvider.off(t,i)} - get walletName(){ - var t,i; - return Mgt.logDebug(`this.getConnectWallet()?.walletName ${ - null==(t=this.getConnectWallet())?void 0:t.name} - `),null==(i=this.getConnectWallet())?void 0:i.name} - disconnect(){ - return this.universalProvider.disconnect()} - connected(){ - return this.universalProvider.connected()} - requestAccountsWithNamespace(t){ - return this.universalProvider.requestAccountsWithNamespace(t)} - requestDefaultChainWithNamespace(t){ - return this.universalProvider.requestDefaultChainWithNamespace(t)} - } - ,"_OKXUniversalConnectUI"),Nt); - let Djt=Ljt; - cLt(Djt,"initPromise",null);
Headers 1 hunks, 17317 statements
- var O4={ - exports:{ - } - } - ; - !function(t,i){ - var s,e="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==pi&&pi,n=function(){ - function t(){ - this.fetch=!1,this.DOMException=e.DOMException} - return Qt(t,"F"),t.prototype=e,new t} - (); - s=n,function(t){ - var i=void 0!==s&&s||"undefined"!=typeof self&&self||void 0!==pi&&pi||{ - } - ,e="URLSearchParams"in i,n="Symbol"in i&&"iterator"in Symbol,h="FileReader"in i&&"Blob"in i&&function(){ - try{ - return new Blob,!0} - catch(frt){ - return!1} - } - (),r="FormData"in i,o="ArrayBuffer"in i; - function a(t){ - return t&&DataView.prototype.isPrototypeOf(t)} - if(Qt(a,"isDataView"),o)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(t){ - return t&&c.indexOf(Object.prototype.toString.call(t))>-1} - ; - function u(t){ - if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"'); - return t.toLowerCase()} - function d(t){ - return"string"!=typeof t&&(t=String(t)),t} - function f(t){ - var i={ - next:Qt(function(){ - var i=t.shift(); - return{ - done:void 0===i,value:i} - } - ,"next")} - ; - return n&&(i[Symbol.iterator]=function(){ - return i} - ),i} - function p(t){ - this.map={ - } - ,t instanceof p?t.forEach(function(t,i){ - this.append(i,t)} - ,this):Array.isArray(t)?t.forEach(function(t){ - if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length); - this.append(t[0],t[1])} - ,this):t&&Object.getOwnPropertyNames(t).forEach(function(i){ - this.append(i,t[i])} - ,this)} - function w(t){ - if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)} - function g(t){ - return new Promise(function(i,s){ - t.onload=function(){ - i(t.result)} - ,t.onerror=function(){ - s(t.error)} - } - )} - function m(t){ - var i=new FileReader,s=g(i); - return i.readAsArrayBuffer(t),s} - function v(t){ - var i=new FileReader,s=g(i),e=/charset=([A-Za-z0-9_-]+)/.exec(t.type),n=e?e[1]:"utf-8"; - return i.readAsText(t,n),s} - function _(t){ - for(var i=new Uint8Array(t),s=new Array(i.length),e=0; - e<i.length; - e++)s[e]=String.fromCharCode(i[e]); - return s.join("")} - function M(t){ - if(t.slice)return t.slice(0); - var i=new Uint8Array(t.byteLength); - return i.set(new Uint8Array(t)),i.buffer} - function b(){ - return this.bodyUsed=!1,this._initBody=function(t){ - this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:h&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:r&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:e&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o&&h&&a(t)?(this._bodyArrayBuffer=M(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(t)||l(t))?this._bodyArrayBuffer=M(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain; - charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):e&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded; - charset=UTF-8"))} - ,h&&(this.blob=function(){ - var t=w(this); - if(t)return t; - if(this._bodyBlob)return Promise.resolve(this._bodyBlob); - if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer])); - if(this._bodyFormData)throw new Error("could not read FormData body as blob"); - return Promise.resolve(new Blob([this._bodyText]))} - ),this.arrayBuffer=function(){ - if(this._bodyArrayBuffer)return w(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)); - if(h)return this.blob().then(m); - throw new Error("could not read as ArrayBuffer")} - ,this.text=function(){ - var t=w(this); - if(t)return t; - if(this._bodyBlob)return v(this._bodyBlob); - if(this._bodyArrayBuffer)return Promise.resolve(_(this._bodyArrayBuffer)); - if(this._bodyFormData)throw new Error("could not read FormData body as text"); - return Promise.resolve(this._bodyText)} - ,r&&(this.formData=function(){ - return this.text().then(S)} - ),this.json=function(){ - return this.text().then(JSON.parse)} - ,this} - Qt(u,"normalizeName"),Qt(d,"normalizeValue"),Qt(f,"iteratorFor"),Qt(p,"Headers"),p.prototype.append=function(t,i){ - t=u(t),i=d(i); - var s=this.map[t]; - this.map[t]=s?s+", "+i:i} - ,p.prototype.delete=function(t){ - delete this.map[u(t)]} - ,p.prototype.get=function(t){ - return t=u(t),this.has(t)?this.map[t]:null} - ,p.prototype.has=function(t){ - return this.map.hasOwnProperty(u(t))} - ,p.prototype.set=function(t,i){ - this.map[u(t)]=d(i)} - ,p.prototype.forEach=function(t,i){ - for(var s in this.map)this.map.hasOwnProperty(s)&&t.call(i,this.map[s],s,this)} - ,p.prototype.keys=function(){ - var t=[]; - return this.forEach(function(i,s){ - t.push(s)} - ),f(t)} - ,p.prototype.values=function(){ - var t=[]; - return this.forEach(function(i){ - t.push(i)} - ),f(t)} - ,p.prototype.entries=function(){ - var t=[]; - return this.forEach(function(i,s){ - t.push([s,i])} - ),f(t)} - ,n&&(p.prototype[Symbol.iterator]=p.prototype.entries),Qt(w,"consumed"),Qt(g,"fileReaderReady"),Qt(m,"readBlobAsArrayBuffer"),Qt(v,"readBlobAsText"),Qt(_,"readArrayBufferAsText"),Qt(M,"bufferClone"),Qt(b,"Body"); - var y=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]; - function E(t){ - var i=t.toUpperCase(); - return y.indexOf(i)>-1?i:t} - function A(t,s){ - if(!(this instanceof A))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.'); - var e=(s=s||{ - } - ).body; - if(t instanceof A){ - if(t.bodyUsed)throw new TypeError("Already read"); - this.url=t.url,this.credentials=t.credentials,s.headers||(this.headers=new p(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,e||null==t._bodyInit||(e=t._bodyInit,t.bodyUsed=!0)} - else this.url=String(t); - if(this.credentials=s.credentials||this.credentials||"same-origin",!s.headers&&this.headers||(this.headers=new p(s.headers)),this.method=E(s.method||this.method||"GET"),this.mode=s.mode||this.mode||null,this.signal=s.signal||this.signal||function(){ - if("AbortController"in i)return(new AbortController).signal} - (),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&e)throw new TypeError("Body not allowed for GET or HEAD requests"); - if(this._initBody(e),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==s.cache&&"no-cache"!==s.cache)){ - var n=/([?&])_=[^&]*/; - n.test(this.url)?this.url=this.url.replace(n,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()} - } - function S(t){ - var i=new FormData; - return t.trim().split("&").forEach(function(t){ - if(t){ - var s=t.split("="),e=s.shift().replace(/\+/g," "),n=s.join("=").replace(/\+/g," "); - i.append(decodeURIComponent(e),decodeURIComponent(n))} - } - ),i} - function T(t){ - var i=new p; - return t.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(t){ - return 0===t.indexOf("\n")?t.substr(1,t.length):t} - ).forEach(function(t){ - var s=t.split(":"),e=s.shift().trim(); - if(e){ - var n=s.join(":").trim(); - try{ - i.append(e,n)} - catch(h){ - } - } - } - ),i} - function C(t,i){ - if(!(this instanceof C))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.'); - if(i||(i={ - } - ),this.type="default",this.status=void 0===i.status?200:i.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599]."); - this.ok=this.status>=200&&this.status<300,this.statusText=void 0===i.statusText?"":""+i.statusText,this.headers=new p(i.headers),this.url=i.url||"",this._initBody(t)} - Qt(E,"normalizeMethod"),Qt(A,"Request"),A.prototype.clone=function(){ - return new A(this,{ - body:this._bodyInit} - )} - ,Qt(S,"decode"),Qt(T,"parseHeaders"),b.call(A.prototype),Qt(C,"Response"),b.call(C.prototype),C.prototype.clone=function(){ - return new C(this._bodyInit,{ - status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url} - )} - ,C.error=function(){ - var t=new C(null,{ - status:200,statusText:""} - ); - return t.ok=!1,t.status=0,t.type="error",t} - ; - var O=[301,302,303,307,308]; - C.redirect=function(t,i){ - if(-1===O.indexOf(i))throw new RangeError("Invalid status code"); - return new C(null,{ - status:i,headers:{ - location:t} - } - )} - ,t.DOMException=i.DOMException; - try{ - new t.DOMException} - catch(k){ - t.DOMException=function(t,i){ - this.message=t,this.name=i; - var s=Error(t); - this.stack=s.stack} - ,t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException} - function I(s,e){ - return new Promise(function(n,r){ - var a=new A(s,e); - if(a.signal&&a.signal.aborted)return r(new t.DOMException("Aborted","AbortError")); - var c=new XMLHttpRequest; - function l(){ - c.abort()} - function f(t){ - try{ - return""===t&&i.location.href?i.location.href:t} - catch(frt){ - return t} - } - if(Qt(l,"abortXhr"),c.onload=function(){ - var t={ - statusText:c.statusText,headers:T(c.getAllResponseHeaders()||"")} - ; - 0===a.url.indexOf("file://")&&(c.status<200||c.status>599)?t.status=200:t.status=c.status,t.url="responseURL"in c?c.responseURL:t.headers.get("X-Request-URL"); - var i="response"in c?c.response:c.responseText; - setTimeout(function(){ - n(new C(i,t))} - ,0)} - ,c.onerror=function(){ - setTimeout(function(){ - r(new TypeError("Network request failed"))} - ,0)} - ,c.ontimeout=function(){ - setTimeout(function(){ - r(new TypeError("Network request timed out"))} - ,0)} - ,c.onabort=function(){ - setTimeout(function(){ - r(new t.DOMException("Aborted","AbortError"))} - ,0)} - ,Qt(f,"fixUrl"),c.open(a.method,f(a.url),!0),"include"===a.credentials?c.withCredentials=!0:"omit"===a.credentials&&(c.withCredentials=!1),"responseType"in c&&(h?c.responseType="blob":o&&(c.responseType="arraybuffer")),e&&"object"==typeof e.headers&&!(e.headers instanceof p||i.Headers&&e.headers instanceof i.Headers)){ - var w=[]; - Object.getOwnPropertyNames(e.headers).forEach(function(t){ - w.push(u(t)),c.setRequestHeader(t,d(e.headers[t]))} - ),a.headers.forEach(function(t,i){ - -1===w.indexOf(i)&&c.setRequestHeader(i,t)} - )} - else a.headers.forEach(function(t,i){ - c.setRequestHeader(i,t)} - ); - a.signal&&(a.signal.addEventListener("abort",l),c.onreadystatechange=function(){ - 4===c.readyState&&a.signal.removeEventListener("abort",l)} - ),c.send(void 0===a._bodyInit?null:a._bodyInit)} - )} - Qt(I,"fetch"),I.polyfill=!0,i.fetch||(i.fetch=I,i.Headers=p,i.Request=A,i.Response=C),t.Headers=p,t.Request=A,t.Response=C,t.fetch=I} - ({ - } - ),n.fetch.ponyfill=!0,delete n.fetch.polyfill; - var h=e.fetch?e:n; - (i=h.fetch).default=h.fetch,i.fetch=h.fetch,i.Headers=h.Headers,i.Request=h.Request,i.Response=h.Response,t.exports=i} - (O4,O4.exports); - var I4=O4.exports; - const k4=wi(I4); - var x4,R4,P4={ - exports:{ - } - } - ; - function N4(){ - if(R4)return x4; - R4=1; - var t=1e3,i=6e4,s=60*i,e=24*s,n=7*e; - function h(h){ - if(!((h=String(h)).length>100)){ - var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(h); - if(r){ - var o=parseFloat(r[1]); - switch((r[2]||"ms").toLowerCase()){ - case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*o; - case"weeks":case"week":case"w":return o*n; - case"days":case"day":case"d":return o*e; - case"hours":case"hour":case"hrs":case"hr":case"h":return o*s; - case"minutes":case"minute":case"mins":case"min":case"m":return o*i; - case"seconds":case"second":case"secs":case"sec":case"s":return o*t; - case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o; - default:return} - } - } - } - function r(n){ - var h=Math.abs(n); - return h>=e?Math.round(n/e)+"d":h>=s?Math.round(n/s)+"h":h>=i?Math.round(n/i)+"m":h>=t?Math.round(n/t)+"s":n+"ms"} - function o(n){ - var h=Math.abs(n); - return h>=e?a(n,h,e,"day"):h>=s?a(n,h,s,"hour"):h>=i?a(n,h,i,"minute"):h>=t?a(n,h,t,"second"):n+" ms"} - function a(t,i,s,e){ - var n=i>=1.5*s; - return Math.round(t/s)+" "+e+(n?"s":"")} - return x4=Qt(function(t,i){ - i=i||{ - } - ; - var s=typeof t; - if("string"===s&&t.length>0)return h(t); - if("number"===s&&isFinite(t))return i.long?o(t):r(t); - throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))} - ,"ms$1"),Qt(h,"parse"),Qt(r,"fmtShort"),Qt(o,"fmtLong"),Qt(a,"plural"),x4} - function L4(t){ - function i(t){ - let i=0; - for(let s=0; - s<t.length; - s++)i=(i<<5)-i+t.charCodeAt(s),i|=0; - return s.colors[Math.abs(i)%s.colors.length]} - function s(t){ - let i,n,h,r=null; - function o(...t){ - if(!o.enabled)return; - const e=o,n=Number(new Date),h=n-(i||n); - e.diff=h,e.prev=i,e.curr=n,i=n,t[0]=s.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O"); - let r=0; - t[0]=t[0].replace(/%([a-zA-Z%])/g,(i,n)=>{ - if("%%"===i)return"%"; - r++; - const h=s.formatters[n]; - if("function"==typeof h){ - const s=t[r]; - i=h.call(e,s),t.splice(r,1),r--} - return i} - ),s.formatArgs.call(e,t),(e.log||s.log).apply(e,t)} - return Qt(o,"debug"),o.namespace=t,o.useColors=s.useColors(),o.color=s.selectColor(t),o.extend=e,o.destroy=s.destroy,Object.defineProperty(o,"enabled",{ - enumerable:!0,configurable:!1,get:Qt(()=>null!==r?r:(n!==s.namespaces&&(n=s.namespaces,h=s.enabled(t)),h),"get"),set:Qt(t=>{ - r=t} - ,"set")} - ),"function"==typeof s.init&&s.init(o),o} - function e(t,i){ - const e=s(this.namespace+(void 0===i?":":i)+t); - return e.log=this.log,e} - function n(t){ - let i; - s.save(t),s.namespaces=t,s.names=[],s.skips=[]; - const e=("string"==typeof t?t:"").split(/[\s,]+/),n=e.length; - for(i=0; - i<n; - i++)e[i]&&("-"===(t=e[i].replace(/\*/g,".*?"))[0]?s.skips.push(new RegExp("^"+t.slice(1)+"$")):s.names.push(new RegExp("^"+t+"$")))} - function h(){ - const t=[...s.names.map(o),...s.skips.map(o).map(t=>"-"+t)].join(","); - return s.enable(""),t} - function r(t){ - if("*"===t[t.length-1])return!0; - let i,e; - for(i=0,e=s.skips.length; - i<e; - i++)if(s.skips[i].test(t))return!1; - for(i=0,e=s.names.length; - i<e; - i++)if(s.names[i].test(t))return!0; - return!1} - function o(t){ - return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")} - function a(t){ - return t instanceof Error?t.stack||t.message:t} - function c(){ - } - return s.debug=s,s.default=s,s.coerce=a,s.disable=h,s.enable=n,s.enabled=r,s.humanize=N4(),s.destroy=c,Object.keys(t).forEach(i=>{ - s[i]=t[i]} - ),s.names=[],s.skips=[],s.formatters={ - } - ,Qt(i,"selectColor"),s.selectColor=i,Qt(s,"createDebug"),Qt(e,"extend"),Qt(n,"enable"),Qt(h,"disable"),Qt(r,"enabled"),Qt(o,"toNamespace"),Qt(a,"coerce"),Qt(c,"destroy"),s.enable(s.load()),s} - Qt(N4,"requireMs"),Qt(L4,"setup"); - var D4=L4; - !function(t,i){ - var s={ - } - ; - function e(){ - return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))} - function n(i){ - if(i[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+i[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return; - const s="color: "+this.color; - i.splice(1,0,s,"color: inherit"); - let e=0,n=0; - i[0].replace(/%[a-zA-Z%]/g,t=>{ - "%%"!==t&&(e++,"%c"===t&&(n=e))} - ),i.splice(n,0,s)} - function h(t){ - try{ - t?i.storage.setItem("debug",t):i.storage.removeItem("debug")} - catch(s){ - } - } - function r(){ - let t; - try{ - t=i.storage.getItem("debug")} - catch(e){ - } - return!t&&"undefined"!=typeof process&&"env"in process&&(t=s.DEBUG),t} - function o(){ - try{ - return localStorage} - catch(t){ - } - } - i.formatArgs=n,i.save=h,i.load=r,i.useColors=e,i.storage=o(),i.destroy=(()=>{ - let t=!1; - return()=>{ - t||(t=!0)} - } - )(),i.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"],Qt(e,"useColors"),Qt(n,"formatArgs"),i.log=console.debug||console.log||(()=>{ - } - ),Qt(h,"save"),Qt(r,"load"),Qt(o,"localstorage"),t.exports=D4(i); - const{ - formatters:a} - =t.exports; - a.j=function(t){ - try{ - return JSON.stringify(t)} - catch(i){ - return"[UnexpectedJSONParseError]: "+i.message} - } - } - (P4,P4.exports); - const G4=wi(P4.exports); - var B4=Object.defineProperty,U4=Object.getOwnPropertyDescriptor,F4=Object.getOwnPropertyNames,$4=Object.prototype.hasOwnProperty,H4=Qt((t,i)=>{ - for(var s in i)B4(t,s,{ - get:i[s],enumerable:!0} - )} - ,"__export$1"),W4=Qt((t,i,s,e)=>{ - if(i&&"object"==typeof i||"function"==typeof i)for(let n of F4(i))$4.call(t,n)||n===s||B4(t,n,{ - get:Qt(()=>i[n],"get"),enumerable:!(e=U4(i,n))||e.enumerable} - ); - return t} - ,"__copyProps$1"),V4=Qt(t=>W4(B4({ - } - ,"__esModule",{ - value:!0} - ),t),"__toCommonJS$1"),j4={ - } - ; - H4(j4,{ - createFinalURL:Qt(()=>o8,"createFinalURL"),createPathBasedClient:Qt(()=>t8,"createPathBasedClient"),createQuerySerializer:Qt(()=>n8,"createQuerySerializer"),default:Qt(()=>X4,"default"),defaultBodySerializer:Qt(()=>r8,"defaultBodySerializer"),defaultPathSerializer:Qt(()=>h8,"defaultPathSerializer"),mergeHeaders:Qt(()=>a8,"mergeHeaders"),randomID:Qt(()=>q4,"randomID"),removeTrailingSlash:Qt(()=>c8,"removeTrailingSlash"),serializeArrayParam:Qt(()=>e8,"serializeArrayParam"),serializeObjectParam:Qt(()=>s8,"serializeObjectParam"),serializePrimitiveParam:Qt(()=>i8,"serializePrimitiveParam"),wrapAsPathBasedClient:Qt(()=>Z4,"wrapAsPathBasedClient")} - ); - var K4=V4(j4),z4=/\{ - [^{ - } - ]+\} - /g,Y4=Qt(()=>{ - var t,i; - return"object"==typeof process&&Number.parseInt(null==(i=null==(t=null==process?void 0:process.versions)?void 0:t.node)?void 0:i.substring(0,2))>=18&&process.versions.undici} - ,"supportsRequestInitExt"); - function q4(){ - return Math.random().toString(36).slice(2,11)} - function X4(t){ - let{ - baseUrl:i="",Request:s=globalThis.Request,fetch:e=globalThis.fetch,querySerializer:n,bodySerializer:h,headers:r,requestInitExt:o,...a} - ={ - ...t} - ; - o=Y4()?o:void 0,i=c8(i); - const c=[]; - async function l(t,l){ - const{ - baseUrl:u,fetch:d=e,Request:f=s,headers:p,params:w={ - } - ,parseAs:g="json",querySerializer:m,bodySerializer:v=h??r8,body:_,...M} - =l||{ - } - ; - let b=i; - u&&(b=c8(u)??i); - let y="function"==typeof n?n:n8(n); - m&&(y="function"==typeof m?m:n8({ - ..."object"==typeof n?n:{ - } - ,...m} - )); - const E=void 0===_?void 0:v(_,a8(r,p,w.header)),A=a8(void 0===E||E instanceof FormData?{ - } - :{ - "Content-Type":"application/json"} - ,r,p,w.header),S={ - redirect:"follow",...a,...M,body:E,headers:A} - ; - let T,C,O,I=new s(o8(t,{ - baseUrl:b,params:w,querySerializer:y} - ),S); - for(const i in M)i in I||(I[i]=M[i]); - if(c.length){ - T=q4(),C=Object.freeze({ - baseUrl:b,fetch:d,parseAs:g,querySerializer:y,bodySerializer:v} - ); - for(const i of c)if(i&&"object"==typeof i&&"function"==typeof i.onRequest){ - const e=await i.onRequest({ - request:I,schemaPath:t,params:w,options:C,id:T} - ); - if(e){ - if(!(e instanceof s)){ - if(e instanceof Response){ - O=e; - break} - throw new Error("onRequest: must return new Request() or Response() when modifying the request")} - I=e} - } - } - if(!O){ - try{ - O=await d(I,o)} - catch(x){ - let i=x; - if(c.length)for(let s=c.length-1; - s>=0; - s--){ - const e=c[s]; - if(e&&"object"==typeof e&&"function"==typeof e.onError){ - const s=await e.onError({ - request:I,error:i,schemaPath:t,params:w,options:C,id:T} - ); - if(s){ - if(s instanceof Response){ - i=void 0,O=s; - break} - if(s instanceof Error){ - i=s; - continue} - throw new Error("onError: must return new Response() or instance of Error")} - } - } - if(i)throw i} - if(c.length)for(let i=c.length-1; - i>=0; - i--){ - const s=c[i]; - if(s&&"object"==typeof s&&"function"==typeof s.onResponse){ - const i=await s.onResponse({ - request:I,response:O,schemaPath:t,params:w,options:C,id:T} - ); - if(i){ - if(!(i instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response"); - O=i} - } - } - } - if(204===O.status||"HEAD"===I.method||"0"===O.headers.get("Content-Length"))return O.ok?{ - data:void 0,response:O} - :{ - error:void 0,response:O} - ; - if(O.ok)return"stream"===g?{ - data:O.body,response:O} - :{ - data:await O[g](),response:O} - ; - let k=await O.text(); - try{ - k=JSON.parse(k)} - catch{ - } - return{ - error:k,response:O} - } - return Qt(l,"coreFetch"),{ - request:(t,i,s)=>l(i,{ - ...s,method:t.toUpperCase()} - ),GET:(t,i)=>l(t,{ - ...i,method:"GET"} - ),PUT:(t,i)=>l(t,{ - ...i,method:"PUT"} - ),POST:(t,i)=>l(t,{ - ...i,method:"POST"} - ),DELETE:(t,i)=>l(t,{ - ...i,method:"DELETE"} - ),OPTIONS:(t,i)=>l(t,{ - ...i,method:"OPTIONS"} - ),HEAD:(t,i)=>l(t,{ - ...i,method:"HEAD"} - ),PATCH:(t,i)=>l(t,{ - ...i,method:"PATCH"} - ),TRACE:(t,i)=>l(t,{ - ...i,method:"TRACE"} - ),use(...t){ - for(const i of t)if(i){ - if("object"!=typeof i||!("onRequest"in i||"onResponse"in i||"onError"in i))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`"); - c.push(i)} - } - ,eject(...t){ - for(const i of t){ - const t=c.indexOf(i); - -1!==t&&c.splice(t,1)} - } - } - } - Qt(q4,"randomID"),Qt(X4,"createClient"); - var J4=(Qt(it=class{ - constructor(t,i){ - Zt(this,"GET",Qt(t=>this.client.GET(this.url,t),"GET")),Zt(this,"PUT",Qt(t=>this.client.PUT(this.url,t),"PUT")),Zt(this,"POST",Qt(t=>this.client.POST(this.url,t),"POST")),Zt(this,"DELETE",Qt(t=>this.client.DELETE(this.url,t),"DELETE")),Zt(this,"OPTIONS",Qt(t=>this.client.OPTIONS(this.url,t),"OPTIONS")),Zt(this,"HEAD",Qt(t=>this.client.HEAD(this.url,t),"HEAD")),Zt(this,"PATCH",Qt(t=>this.client.PATCH(this.url,t),"PATCH")),Zt(this,"TRACE",Qt(t=>this.client.TRACE(this.url,t),"TRACE")),this.client=t,this.url=i} - } - ,"PathCallForwarder"),it),Q4=(Qt(st=class{ - constructor(){ - this.client=null} - get(t,i){ - const s=new J4(t,i); - return this.client[i]=s,s} - } - ,"PathClientProxyHandler"),st); - function Z4(t){ - const i=new Q4,s=new Proxy(t,i); - function e(){ - } - Qt(e,"Client"),e.prototype=s; - const n=new e; - return i.client=n,n} - function t8(t){ - return Z4(X4(t))} - function i8(t,i,s){ - if(null==i)return""; - if("object"==typeof i)throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these."); - return`${ - t} - =${ - !0===(null==s?void 0:s.allowReserved)?i:encodeURIComponent(i)} - `} - function s8(t,i,s){ - if(!i||"object"!=typeof i)return""; - const e=[],n={ - simple:",",label:".",matrix:"; - "} - [s.style]||"&"; - if("deepObject"!==s.style&&!1===s.explode){ - for(const t in i)e.push(t,!0===s.allowReserved?i[t]:encodeURIComponent(i[t])); - const n=e.join(","); - switch(s.style){ - case"form":return`${ - t} - =${ - n} - `; - case"label":return`.${ - n} - `; - case"matrix":return`; - ${ - t} - =${ - n} - `; - default:return n} - } - for(const r in i){ - const n="deepObject"===s.style?`${ - t} - [${ - r} - ]`:r; - e.push(i8(n,i[r],s))} - const h=e.join(n); - return"label"===s.style||"matrix"===s.style?`${ - n} - ${ - h} - `:h} - function e8(t,i,s){ - if(!Array.isArray(i))return""; - if(!1===s.explode){ - const e={ - form:",",spaceDelimited:"%20",pipeDelimited:"|"} - [s.style]||",",n=(!0===s.allowReserved?i:i.map(t=>encodeURIComponent(t))).join(e); - switch(s.style){ - case"simple":return n; - case"label":return`.${ - n} - `; - case"matrix":return`; - ${ - t} - =${ - n} - `; - default:return`${ - t} - =${ - n} - `} - } - const e={ - simple:",",label:".",matrix:"; - "} - [s.style]||"&",n=[]; - for(const h of i)"simple"===s.style||"label"===s.style?n.push(!0===s.allowReserved?h:encodeURIComponent(h)):n.push(i8(t,h,s)); - return"label"===s.style||"matrix"===s.style?`${ - e} - ${ - n.join(e)} - `:n.join(e)} - function n8(t){ - return Qt(function(i){ - const s=[]; - if(i&&"object"==typeof i)for(const e in i){ - const n=i[e]; - if(null!=n)if(Array.isArray(n)){ - if(0===n.length)continue; - s.push(e8(e,n,{ - style:"form",explode:!0,...null==t?void 0:t.array,allowReserved:(null==t?void 0:t.allowReserved)||!1} - ))} - else"object"!=typeof n?s.push(i8(e,n,t)):s.push(s8(e,n,{ - style:"deepObject",explode:!0,...null==t?void 0:t.object,allowReserved:(null==t?void 0:t.allowReserved)||!1} - ))} - return s.join("&")} - ,"querySerializer")} - function h8(t,i){ - let s=t; - for(const e of t.match(z4)??[]){ - let t=e.substring(1,e.length-1),n=!1,h="simple"; - if(t.endsWith("*")&&(n=!0,t=t.substring(0,t.length-1)),t.startsWith(".")?(h="label",t=t.substring(1)):t.startsWith("; - ")&&(h="matrix",t=t.substring(1)),!i||void 0===i[t]||null===i[t])continue; - const r=i[t]; - s=Array.isArray(r)?s.replace(e,e8(t,r,{ - style:h,explode:n} - )):"object"!=typeof r?"matrix"!==h?s.replace(e,"label"===h?`.${ - encodeURIComponent(r)} - `:encodeURIComponent(r)):s.replace(e,`; - ${ - i8(t,r)} - `):s.replace(e,s8(t,r,{ - style:h,explode:n} - ))} - return s} - function r8(t,i){ - return t instanceof FormData?t:i&&"application/x-www-form-urlencoded"===(i.get instanceof Function?i.get("Content-Type")??i.get("content-type"):i["Content-Type"]??i["content-type"])?new URLSearchParams(t).toString():JSON.stringify(t)} - function o8(t,i){ - var s; - let e=`${ - i.baseUrl} - ${ - t} - `; - (null==(s=i.params)?void 0:s.path)&&(e=h8(e,i.params.path)); - let n=i.querySerializer(i.params.query??{ - } - ); - return n.startsWith("?")&&(n=n.substring(1)),n&&(e+=`?${ - n} - `),e} - function a8(...t){ - const i=new Headers; - for(const s of t){ - if(!s||"object"!=typeof s)continue; - const t=s instanceof Headers?s.entries():Object.entries(s); - for(const[s,e]of t)if(null===e)i.delete(s); - else if(Array.isArray(e))for(const t of e)i.append(s,t); - else void 0!==e&&i.set(s,e)} - return i} - function c8(t){ - return t.endsWith("/")?t.substring(0,t.length-1):t} - Qt(Z4,"wrapAsPathBasedClient"),Qt(t8,"createPathBasedClient"),Qt(i8,"serializePrimitiveParam"),Qt(s8,"serializeObjectParam"),Qt(e8,"serializeArrayParam"),Qt(n8,"createQuerySerializer"),Qt(h8,"defaultPathSerializer"),Qt(r8,"defaultBodySerializer"),Qt(o8,"createFinalURL"),Qt(a8,"mergeHeaders"),Qt(c8,"removeTrailingSlash"); - var l8={ - } - ,u8=Object.create,d8=Object.defineProperty,f8=Object.getOwnPropertyDescriptor,p8=Object.getOwnPropertyNames,w8=Object.getPrototypeOf,g8=Object.prototype.hasOwnProperty,m8=Qt((t,i)=>{ - for(var s in i)d8(t,s,{ - get:i[s],enumerable:!0} - )} - ,"__export"),v8=Qt((t,i,s,e)=>{ - if(i&&"object"==typeof i||"function"==typeof i)for(let n of p8(i))g8.call(t,n)||n===s||d8(t,n,{ - get:Qt(()=>i[n],"get"),enumerable:!(e=f8(i,n))||e.enumerable} - ); - return t} - ,"__copyProps"),_8=Qt((t,i,s)=>(s=null!=t?u8(w8(t)):{ - } - ,v8(t&&t.__esModule?s:d8(s,"default",{ - value:t,enumerable:!0} - ),t)),"__toESM"),M8=Qt(t=>v8(d8({ - } - ,"__esModule",{ - value:!0} - ),t),"__toCommonJS"),b8={ - } - ; - m8(b8,{ - analytics:Qt(()=>I8,"analytics")} - ); - var y8,E8,A8=M8(b8),S8=_8(K4),T8=(Qt(et=class{ - constructor(t){ - this.batch=[],this.maxTimeoutMs=3e4,this.timeoutId=null,this.isSending=!1,this.batchSize=t.batchSize,this.baseTimeoutMs=t.baseTimeoutMs,this.currentTimeoutMs=t.baseTimeoutMs,this.sendFn=t.sendFn} - enqueue(t){ - this.batch.push(t),this.schedule()} - schedule(){ - this.batch.length>0&&!this.timeoutId&&(this.timeoutId=setTimeout(()=>{ - this.timeoutId=null,this.flush()} - ,this.currentTimeoutMs))} - async flush(){ - if(this.isSending||0===this.batch.length)return; - this.isSending=!0; - const t=[...this.batch.slice(0,this.batchSize)]; - this.batch=this.batch.slice(this.batchSize); - try{ - await this.sendFn(t),this.currentTimeoutMs=this.baseTimeoutMs} - catch(i){ - this.batch=[...t,...this.batch],this.currentTimeoutMs=Math.min(2*this.currentTimeoutMs,this.maxTimeoutMs)} - finally{ - this.isSending=!1,this.schedule()} - } - } - ,"Sender"),et),C8=(Qt(nt=class{ - constructor(t){ - this.enabled=!1,this.properties={ - } - ; - const i=(0,S8.default)({ - baseUrl:t} - ),s=Qt(async t=>{ - const s=await i.POST("/v1/events",{ - body:t} - ); - if(200!==s.response.status)throw new Error(s.error)} - ,"sendFn"); - this.sender=new T8({ - batchSize:100,baseTimeoutMs:200,sendFn:s} - )} - enable(){ - this.enabled=!0} - setGlobalProperty(t,i){ - this.properties[t]=i} - track(t,i){ - if(!this.enabled)return; - const s={ - name:t,...this.properties,...i} - ; - this.sender.enqueue(s)} - } - ,"Analytics"),nt); - "undefined"!=typeof process&&l8&&(y8=null!=(E8=l8.METAMASK_ANALYTICS_ENDPOINT)?E8:l8.NEXT_PUBLIC_METAMASK_ANALYTICS_ENDPOINT); - var O8,I8=new C8(null!=y8?y8:"https://mm-sdk-analytics.api.cx.metamask.io/"),k8={ - exports:{ - } - } - ; - O8=k8,function(t){ - var i=Object.hasOwnProperty,s=Array.isArray?Array.isArray:Qt(function(t){ - return"[object Array]"===Object.prototype.toString.call(t)} - ,"_isArray"),e="object"==typeof process&&"function"==typeof process.nextTick,n="function"==typeof Symbol,h="object"==typeof Reflect,r="function"==typeof setImmediate?setImmediate:setTimeout,o=n?h&&"function"==typeof Reflect.ownKeys?Reflect.ownKeys:function(t){ - var i=Object.getOwnPropertyNames(t); - return i.push.apply(i,Object.getOwnPropertySymbols(t)),i} - :Object.keys; - function a(){ - this._events={ - } - ,this._conf&&c.call(this,this._conf)} - function c(i){ - i&&(this._conf=i,i.delimiter&&(this.delimiter=i.delimiter),i.maxListeners!==t&&(this._maxListeners=i.maxListeners),i.wildcard&&(this.wildcard=i.wildcard),i.newListener&&(this._newListener=i.newListener),i.removeListener&&(this._removeListener=i.removeListener),i.verboseMemoryLeak&&(this.verboseMemoryLeak=i.verboseMemoryLeak),i.ignoreErrors&&(this.ignoreErrors=i.ignoreErrors),this.wildcard&&(this.listenerTree={ - } - ))} - function l(t,i){ - var s="(node) warning: possible EventEmitter memory leak detected. "+t+" listeners added. Use emitter.setMaxListeners() to increase limit."; - if(this.verboseMemoryLeak&&(s+=" Event name: "+i+"."),"undefined"!=typeof process&&process.emitWarning){ - var e=new Error(s); - e.name="MaxListenersExceededWarning",e.emitter=this,e.count=t,process.emitWarning(e)} - else console.trace} - Qt(a,"init"),Qt(c,"configure"),Qt(l,"logPossibleMemoryLeak"); - var u=Qt(function(t,i,s){ - var e=arguments.length; - switch(e){ - case 0:return[]; - case 1:return[t]; - case 2:return[t,i]; - case 3:return[t,i,s]; - default:for(var n=new Array(e); - e--; - )n[e]=arguments[e]; - return n} - } - ,"toArray"); - function d(i,s){ - for(var e={ - } - ,n=i.length,h=0; - h<n; - h++)e[i[h]]=h<0?s[h]:t; - return e} - function f(t,i,s){ - var e,n; - if(this._emitter=t,this._target=i,this._listeners={ - } - ,this._listenersCount=0,(s.on||s.off)&&(e=s.on,n=s.off),i.addEventListener?(e=i.addEventListener,n=i.removeEventListener):i.addListener?(e=i.addListener,n=i.removeListener):i.on&&(e=i.on,n=i.off),!e&&!n)throw Error("target does not implement any known event API"); - if("function"!=typeof e)throw TypeError("on method must be a function"); - if("function"!=typeof n)throw TypeError("off method must be a function"); - this._on=e,this._off=n; - var h=t._observers; - h?h.push(this):t._observers=[this]} - function p(s,e,n,h){ - var r=Object.assign({ - } - ,e); - if(!s)return r; - if("object"!=typeof s)throw TypeError("options must be an object"); - var o,a,c,l=Object.keys(s),u=l.length; - function d(t){ - throw Error('Invalid "'+o+'" option value'+(t?". Reason: "+t:""))} - Qt(d,"reject"); - for(var f=0; - f<u; - f++){ - if(o=l[f],!i.call(e,o))throw Error('Unknown "'+o+'" option'); - (a=s[o])!==t&&(c=n[o],r[o]=c?c(a,d):a)} - return r} - function w(t,i){ - return"function"==typeof t&&t.hasOwnProperty("prototype")||i("value must be a constructor"),t} - function g(t){ - var i="value must be type of "+t.join("|"),s=t.length,e=t[0],n=t[1]; - return 1===s?function(t,s){ - if(typeof t===e)return t; - s(i)} - :2===s?function(t,s){ - var h=typeof t; - if(h===e||h===n)return t; - s(i)} - :function(e,n){ - for(var h=typeof e,r=s; - r-- >0; - )if(h===t[r])return e; - n(i)} - } - Qt(d,"toObject"),Qt(f,"TargetObserver"),Object.assign(f.prototype,{ - subscribe:Qt(function(t,i,s){ - var e=this,n=this._target,h=this._emitter,r=this._listeners,o=Qt(function(){ - var e=u.apply(null,arguments),r={ - data:e,name:i,original:t} - ; - s?!1!==s.call(n,r)&&h.emit.apply(h,[r.name].concat(e)):h.emit.apply(h,[i].concat(e))} - ,"handler"); - if(r[t])throw Error("Event '"+t+"' is already listening"); - this._listenersCount++,h._newListener&&h._removeListener&&!e._onNewListener?(this._onNewListener=function(s){ - s===i&&null===r[t]&&(r[t]=o,e._on.call(n,t,o))} - ,h.on("newListener",this._onNewListener),this._onRemoveListener=function(s){ - s===i&&!h.hasListeners(s)&&r[t]&&(r[t]=null,e._off.call(n,t,o))} - ,r[t]=null,h.on("removeListener",this._onRemoveListener)):(r[t]=o,e._on.call(n,t,o))} - ,"subscribe"),unsubscribe:Qt(function(t){ - var i,s,e,n=this,h=this._listeners,r=this._emitter,a=this._off,c=this._target; - if(t&&"string"!=typeof t)throw TypeError("event must be a string"); - function l(){ - n._onNewListener&&(r.off("newListener",n._onNewListener),r.off("removeListener",n._onRemoveListener),n._onNewListener=null,n._onRemoveListener=null); - var t=M.call(r,n); - r._observers.splice(t,1)} - if(Qt(l,"clearRefs"),t){ - if(!(i=h[t]))return; - a.call(c,t,i),delete h[t],--this._listenersCount||l()} - else{ - for(e=(s=o(h)).length; - e-- >0; - )t=s[e],a.call(c,t,h[t]); - this._listeners={ - } - ,this._listenersCount=0,l()} - } - ,"unsubscribe")} - ),Qt(p,"resolveOptions"),Qt(w,"constructorReducer"),Qt(g,"makeTypeReducer"); - var m=g(["function"]),v=g(["object","function"]); - function _(t,i,s){ - var e,n,h,r=0,o=new t(function(a,c,l){ - function u(){ - n&&(n=null),r&&(clearTimeout(r),r=0)} - s=p(s,{ - timeout:0,overload:!1} - ,{ - timeout:Qt(function(t,i){ - return("number"!=typeof(t*=1)||t<0||!Number.isFinite(t))&&i("timeout must be a positive number"),t} - ,"timeout")} - ),e=!s.overload&&"function"==typeof t.prototype.cancel&&"function"==typeof l,Qt(u,"cleanup"); - var d=Qt(function(t){ - u(),a(t)} - ,"_resolve"),f=Qt(function(t){ - u(),c(t)} - ,"_reject"); - e?i(d,f,l):(n=[function(t){ - f(t||Error("canceled"))} - ],i(d,f,function(t){ - if(h)throw Error("Unable to subscribe on cancel event asynchronously"); - if("function"!=typeof t)throw TypeError("onCancel callback must be a function"); - n.push(t)} - ),h=!0),s.timeout>0&&(r=setTimeout(function(){ - var t=Error("timeout"); - t.code="ETIMEDOUT",r=0,o.cancel(t),c(t)} - ,s.timeout))} - ); - return e||(o.cancel=function(t){ - if(n){ - for(var i=n.length,s=1; - s<i; - s++)n[s](t); - n[0](t),n=null} - } - ),o} - function M(t){ - var i=this._observers; - if(!i)return-1; - for(var s=i.length,e=0; - e<s; - e++)if(i[e]._target===t)return e; - return-1} - function b(t,i,s,e,n){ - if(!s)return null; - if(0===e){ - var h=typeof i; - if("string"===h){ - var r,a,c=0,l=0,u=this.delimiter,d=u.length; - if(-1!==(a=i.indexOf(u))){ - r=new Array(5); - do{ - r[c++]=i.slice(l,a),l=a+d} - while(-1!==(a=i.indexOf(u,l))); - r[c++]=i.slice(l),i=r,n=c} - else i=[i],n=1} - else"object"===h?n=i.length:(i=[i],n=1)} - var f,p,w,g,m,v,_,M=null,y=i[e],E=i[e+1]; - if(e===n)s._listeners&&("function"==typeof s._listeners?(t&&t.push(s._listeners),M=[s]):(t&&t.push.apply(t,s._listeners),M=[s])); - else{ - if("*"===y){ - for(a=(v=o(s)).length; - a-- >0; - )"_listeners"!==(f=v[a])&&(_=b(t,i,s[f],e+1,n))&&(M?M.push.apply(M,_):M=_); - return M} - if("**"===y){ - for((m=e+1===n||e+2===n&&"*"===E)&&s._listeners&&(M=b(t,i,s,n,n)),a=(v=o(s)).length; - a-- >0; - )"_listeners"!==(f=v[a])&&("*"===f||"**"===f?(s[f]._listeners&&!m&&(_=b(t,i,s[f],n,n))&&(M?M.push.apply(M,_):M=_),_=b(t,i,s[f],e,n)):_=b(t,i,s[f],f===E?e+2:e,n),_&&(M?M.push.apply(M,_):M=_)); - return M} - s[y]&&(M=b(t,i,s[y],e+1,n))} - if((p=s["*"])&&b(t,i,p,e+1,n),w=s["**"])if(e<n)for(w._listeners&&b(t,i,w,n,n),a=(v=o(w)).length; - a-- >0; - )"_listeners"!==(f=v[a])&&(f===E?b(t,i,w[f],e+2,n):f===y?b(t,i,w[f],e+1,n):((g={ - } - )[f]=w[f],b(t,i,{ - "**":g} - ,e+1,n))); - else w._listeners?b(t,i,w,n,n):w["*"]&&w["*"]._listeners&&b(t,i,w["*"],n,n); - return M} - function y(t,i,s){ - var e,n,h=0,r=0,o=this.delimiter,a=o.length; - if("string"==typeof t)if(-1!==(e=t.indexOf(o))){ - n=new Array(5); - do{ - n[h++]=t.slice(r,e),r=e+a} - while(-1!==(e=t.indexOf(o,r))); - n[h++]=t.slice(r)} - else n=[t],h=1; - else n=t,h=t.length; - if(h>1)for(e=0; - e+1<h; - e++)if("**"===n[e]&&"**"===n[e+1])return; - var c,u=this.listenerTree; - for(e=0; - e<h; - e++)if(u=u[c=n[e]]||(u[c]={ - } - ),e===h-1)return u._listeners?("function"==typeof u._listeners&&(u._listeners=[u._listeners]),s?u._listeners.unshift(i):u._listeners.push(i),!u._listeners.warned&&this._maxListeners>0&&u._listeners.length>this._maxListeners&&(u._listeners.warned=!0,l.call(this,u._listeners.length,c))):u._listeners=i,!0; - return!0} - function E(t,i,s,e){ - for(var n,h,r,a,c=o(t),l=c.length,u=t._listeners; - l-- >0; - )n=t[h=c[l]],r="_listeners"===h?s:s?s.concat(h):[h],a=e||"symbol"==typeof h,u&&i.push(a?r:r.join(this.delimiter)),"object"==typeof n&&E.call(this,n,i,r,a); - return i} - function A(t){ - for(var i,s,e,n=o(t),h=n.length; - h-- >0; - )(i=t[s=n[h]])&&(e=!0,"_listeners"===s||A(i)||delete t[s]); - return e} - function S(t,i,s){ - this.emitter=t,this.event=i,this.listener=s} - function T(i,s,n){ - if(!0===n)o=!0; - else if(!1===n)h=!0; - else{ - if(!n||"object"!=typeof n)throw TypeError("options should be an object or true"); - var h=n.async,o=n.promisify,a=n.nextTick,c=n.objectify} - if(h||a||o){ - var l=s,u=s._origin||s; - if(a&&!e)throw Error("process.nextTick is not supported"); - o===t&&(o="AsyncFunction"===s.constructor.name),s=Qt(function(){ - var t=arguments,i=this,s=this.event; - return o?a?Promise.resolve():new Promise(function(t){ - r(t)} - ).then(function(){ - return i.event=s,l.apply(i,t)} - ):(a?process.nextTick:r)(function(){ - i.event=s,l.apply(i,t)} - )} - ,"listener"),s._async=!0,s._origin=u} - return[s,c?new S(this,i,s):this]} - function C(t){ - this._events={ - } - ,this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,c.call(this,t)} - function O(t,i,s){ - return _((s=p(s,{ - Promise,timeout:0,overload:!1} - ,{ - Promise:w} - )).Promise,function(s,e,n){ - var h; - if("function"==typeof t.addEventListener)return h=Qt(function(){ - s(u.apply(null,arguments))} - ,"handler"),n(function(){ - t.removeEventListener(i,h)} - ),void t.addEventListener(i,h,{ - once:!0} - ); - var r,o=Qt(function(){ - r&&t.removeListener("error",r),s(u.apply(null,arguments))} - ,"eventListener"); - "error"!==i&&(r=Qt(function(s){ - t.removeListener(i,o),e(s)} - ,"errorListener"),t.once("error",r)),n(function(){ - r&&t.removeListener("error",r),t.removeListener(i,o)} - ),t.once(i,o)} - ,{ - timeout:s.timeout,overload:s.overload} - )} - Qt(_,"makeCancelablePromise"),Qt(M,"findTargetIndex"),Qt(b,"searchListenerTree"),Qt(y,"growListenerTree"),Qt(E,"collectTreeEvents"),Qt(A,"recursivelyGarbageCollect"),Qt(S,"Listener"),S.prototype.off=function(){ - return this.emitter.off(this.event,this.listener),this} - ,Qt(T,"setupListener"),Qt(C,"EventEmitter"),C.EventEmitter2=C,C.prototype.listenTo=function(i,e,n){ - if("object"!=typeof i)throw TypeError("target musts be an object"); - var h=this; - function r(t){ - if("object"!=typeof t)throw TypeError("events must be an object"); - var s,e=n.reducers,r=M.call(h,i); - s=-1===r?new f(h,i,n):h._observers[r]; - for(var a,c=o(t),l=c.length,u="function"==typeof e,d=0; - d<l; - d++)a=c[d],s.subscribe(a,t[a]||a,u?e:e&&e[a])} - return n=p(n,{ - on:t,off:t,reducers:t} - ,{ - on:m,off:m,reducers:v} - ),Qt(r,"listen"),s(e)?r(d(e)):r("string"==typeof e?d(e.split(/\s+/)):e),this} - ,C.prototype.stopListeningTo=function(t,i){ - var s=this._observers; - if(!s)return!1; - var e,n=s.length,h=!1; - if(t&&"object"!=typeof t)throw TypeError("target should be an object"); - for(; - n-- >0; - )e=s[n],t&&e._target!==t||(e.unsubscribe(i),h=!0); - return h} - ,C.prototype.delimiter=".",C.prototype.setMaxListeners=function(i){ - i!==t&&(this._maxListeners=i,this._conf||(this._conf={ - } - ),this._conf.maxListeners=i)} - ,C.prototype.getMaxListeners=function(){ - return this._maxListeners} - ,C.prototype.event="",C.prototype.once=function(t,i,s){ - return this._once(t,i,!1,s)} - ,C.prototype.prependOnceListener=function(t,i,s){ - return this._once(t,i,!0,s)} - ,C.prototype._once=function(t,i,s,e){ - return this._many(t,1,i,s,e)} - ,C.prototype.many=function(t,i,s,e){ - return this._many(t,i,s,!1,e)} - ,C.prototype.prependMany=function(t,i,s,e){ - return this._many(t,i,s,!0,e)} - ,C.prototype._many=function(t,i,s,e,n){ - var h=this; - if("function"!=typeof s)throw new Error("many only accepts instances of Function"); - function r(){ - return 0===--i&&h.off(t,r),s.apply(this,arguments)} - return Qt(r,"listener"),r._origin=s,this._on(t,r,e,n)} - ,C.prototype.emit=function(){ - if(!this._events&&!this._all)return!1; - this._events||a.call(this); - var t,i,s,e,h,r,o=arguments[0],c=this.wildcard; - if("newListener"===o&&!this._newListener&&!this._events.newListener)return!1; - if(c&&(t=o,"newListener"!==o&&"removeListener"!==o&&"object"==typeof o)){ - if(s=o.length,n)for(e=0; - e<s; - e++)if("symbol"==typeof o[e]){ - r=!0; - break} - r||(o=o.join(this.delimiter))} - var l,u=arguments.length; - if(this._all&&this._all.length)for(e=0,s=(l=this._all.slice()).length; - e<s; - e++)switch(this.event=o,u){ - case 1:l[e].call(this,o); - break; - case 2:l[e].call(this,o,arguments[1]); - break; - case 3:l[e].call(this,o,arguments[1],arguments[2]); - break; - default:l[e].apply(this,arguments)} - if(c)l=[],b.call(this,l,t,this.listenerTree,0,s); - else{ - if("function"==typeof(l=this._events[o])){ - switch(this.event=o,u){ - case 1:l.call(this); - break; - case 2:l.call(this,arguments[1]); - break; - case 3:l.call(this,arguments[1],arguments[2]); - break; - default:for(i=new Array(u-1),h=1; - h<u; - h++)i[h-1]=arguments[h]; - l.apply(this,i)} - return!0} - l&&(l=l.slice())} - if(l&&l.length){ - if(u>3)for(i=new Array(u-1),h=1; - h<u; - h++)i[h-1]=arguments[h]; - for(e=0,s=l.length; - e<s; - e++)switch(this.event=o,u){ - case 1:l[e].call(this); - break; - case 2:l[e].call(this,arguments[1]); - break; - case 3:l[e].call(this,arguments[1],arguments[2]); - break; - default:l[e].apply(this,i)} - return!0} - if(!this.ignoreErrors&&!this._all&&"error"===o)throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event."); - return!!this._all} - ,C.prototype.emitAsync=function(){ - if(!this._events&&!this._all)return!1; - this._events||a.call(this); - var t,i,s,e,h,r,o=arguments[0],c=this.wildcard; - if("newListener"===o&&!this._newListener&&!this._events.newListener)return Promise.resolve([!1]); - if(c&&(t=o,"newListener"!==o&&"removeListener"!==o&&"object"==typeof o)){ - if(e=o.length,n)for(h=0; - h<e; - h++)if("symbol"==typeof o[h]){ - i=!0; - break} - i||(o=o.join(this.delimiter))} - var l,u=[],d=arguments.length; - if(this._all)for(h=0,e=this._all.length; - h<e; - h++)switch(this.event=o,d){ - case 1:u.push(this._all[h].call(this,o)); - break; - case 2:u.push(this._all[h].call(this,o,arguments[1])); - break; - case 3:u.push(this._all[h].call(this,o,arguments[1],arguments[2])); - break; - default:u.push(this._all[h].apply(this,arguments))} - if(c?(l=[],b.call(this,l,t,this.listenerTree,0)):l=this._events[o],"function"==typeof l)switch(this.event=o,d){ - case 1:u.push(l.call(this)); - break; - case 2:u.push(l.call(this,arguments[1])); - break; - case 3:u.push(l.call(this,arguments[1],arguments[2])); - break; - default:for(s=new Array(d-1),r=1; - r<d; - r++)s[r-1]=arguments[r]; - u.push(l.apply(this,s))} - else if(l&&l.length){ - if(l=l.slice(),d>3)for(s=new Array(d-1),r=1; - r<d; - r++)s[r-1]=arguments[r]; - for(h=0,e=l.length; - h<e; - h++)switch(this.event=o,d){ - case 1:u.push(l[h].call(this)); - break; - case 2:u.push(l[h].call(this,arguments[1])); - break; - case 3:u.push(l[h].call(this,arguments[1],arguments[2])); - break; - default:u.push(l[h].apply(this,s))} - } - else if(!this.ignoreErrors&&!this._all&&"error"===o)return arguments[1]instanceof Error?Promise.reject(arguments[1]):Promise.reject("Uncaught, unspecified 'error' event."); - return Promise.all(u)} - ,C.prototype.on=function(t,i,s){ - return this._on(t,i,!1,s)} - ,C.prototype.prependListener=function(t,i,s){ - return this._on(t,i,!0,s)} - ,C.prototype.onAny=function(t){ - return this._onAny(t,!1)} - ,C.prototype.prependAny=function(t){ - return this._onAny(t,!0)} - ,C.prototype.addListener=C.prototype.on,C.prototype._onAny=function(t,i){ - if("function"!=typeof t)throw new Error("onAny only accepts instances of Function"); - return this._all||(this._all=[]),i?this._all.unshift(t):this._all.push(t),this} - ,C.prototype._on=function(i,s,e,n){ - if("function"==typeof i)return this._onAny(i,s),this; - if("function"!=typeof s)throw new Error("on only accepts instances of Function"); - this._events||a.call(this); - var h,r=this; - return n!==t&&(s=(h=T.call(this,i,s,n))[0],r=h[1]),this._newListener&&this.emit("newListener",i,s),this.wildcard?(y.call(this,i,s,e),r):(this._events[i]?("function"==typeof this._events[i]&&(this._events[i]=[this._events[i]]),e?this._events[i].unshift(s):this._events[i].push(s),!this._events[i].warned&&this._maxListeners>0&&this._events[i].length>this._maxListeners&&(this._events[i].warned=!0,l.call(this,this._events[i].length,i))):this._events[i]=s,r)} - ,C.prototype.off=function(t,i){ - if("function"!=typeof i)throw new Error("removeListener only takes instances of Function"); - var e,n=[]; - if(this.wildcard){ - var h="string"==typeof t?t.split(this.delimiter):t.slice(); - if(!(n=b.call(this,null,h,this.listenerTree,0)))return this} - else{ - if(!this._events[t])return this; - e=this._events[t],n.push({ - _listeners:e} - )} - for(var r=0; - r<n.length; - r++){ - var o=n[r]; - if(e=o._listeners,s(e)){ - for(var a=-1,c=0,l=e.length; - c<l; - c++)if(e[c]===i||e[c].listener&&e[c].listener===i||e[c]._origin&&e[c]._origin===i){ - a=c; - break} - if(a<0)continue; - return this.wildcard?o._listeners.splice(a,1):this._events[t].splice(a,1),0===e.length&&(this.wildcard?delete o._listeners:delete this._events[t]),this._removeListener&&this.emit("removeListener",t,i),this} - (e===i||e.listener&&e.listener===i||e._origin&&e._origin===i)&&(this.wildcard?delete o._listeners:delete this._events[t],this._removeListener&&this.emit("removeListener",t,i))} - return this.listenerTree&&A(this.listenerTree),this} - ,C.prototype.offAny=function(t){ - var i,s=0,e=0; - if(t&&this._all&&this._all.length>0){ - for(s=0,e=(i=this._all).length; - s<e; - s++)if(t===i[s])return i.splice(s,1),this._removeListener&&this.emit("removeListenerAny",t),this} - else{ - if(i=this._all,this._removeListener)for(s=0,e=i.length; - s<e; - s++)this.emit("removeListenerAny",i[s]); - this._all=[]} - return this} - ,C.prototype.removeListener=C.prototype.off,C.prototype.removeAllListeners=function(i){ - if(i===t)return!this._events||a.call(this),this; - if(this.wildcard){ - var s,e=b.call(this,null,i,this.listenerTree,0); - if(!e)return this; - for(s=0; - s<e.length; - s++)e[s]._listeners=null; - this.listenerTree&&A(this.listenerTree)} - else this._events&&(this._events[i]=null); - return this} - ,C.prototype.listeners=function(i){ - var s,e,n,h,r,a=this._events; - if(i===t){ - if(this.wildcard)throw Error("event name required for wildcard emitter"); - if(!a)return[]; - for(h=(s=o(a)).length,n=[]; - h-- >0; - )"function"==typeof(e=a[s[h]])?n.push(e):n.push.apply(n,e); - return n} - if(this.wildcard){ - if(!(r=this.listenerTree))return[]; - var c=[],l="string"==typeof i?i.split(this.delimiter):i.slice(); - return b.call(this,c,l,r,0),c} - return a&&(e=a[i])?"function"==typeof e?[e]:e:[]} - ,C.prototype.eventNames=function(t){ - var i=this._events; - return this.wildcard?E.call(this,this.listenerTree,[],null,t):i?o(i):[]} - ,C.prototype.listenerCount=function(t){ - return this.listeners(t).length} - ,C.prototype.hasListeners=function(i){ - if(this.wildcard){ - var s=[],e="string"==typeof i?i.split(this.delimiter):i.slice(); - return b.call(this,s,e,this.listenerTree,0),s.length>0} - var n=this._events,h=this._all; - return!!(h&&h.length||n&&(i===t?o(n).length:n[i]))} - ,C.prototype.listenersAny=function(){ - return this._all?this._all:[]} - ,C.prototype.waitFor=function(i,s){ - var e=this,n=typeof s; - return"number"===n?s={ - timeout:s} - :"function"===n&&(s={ - filter:s} - ),_((s=p(s,{ - timeout:0,filter:t,handleError:!1,Promise,overload:!1} - ,{ - filter:m,Promise:w} - )).Promise,function(t,n,h){ - function r(){ - var h=s.filter; - if(!h||h.apply(e,arguments))if(e.off(i,r),s.handleError){ - var o=arguments[0]; - o?n(o):t(u.apply(null,arguments).slice(1))} - else t(u.apply(null,arguments))} - Qt(r,"listener"),h(function(){ - e.off(i,r)} - ),e._on(i,r,!1)} - ,{ - timeout:s.timeout,overload:s.overload} - )} - ,Qt(O,"once"); - var I=C.prototype; - Object.defineProperties(C,{ - defaultMaxListeners:{ - get:Qt(function(){ - return I._maxListeners} - ,"get"),set:Qt(function(t){ - if("number"!=typeof t||t<0||Number.isNaN(t))throw TypeError("n must be a non-negative number"); - I._maxListeners=t} - ,"set"),enumerable:!0} - ,once:{ - value:O,writable:!0,configurable:!0} - } - ),Object.defineProperties(I,{ - _maxListeners:{ - value:10,writable:!0,configurable:!0} - ,_observers:{ - value:null,writable:!0,configurable:!0} - } - ),O8.exports=C} - (); - var x8=k8.exports; - const R8=wi(x8); - var P8,N8=new Uint8Array(16); - function L8(){ - if(!P8&&!(P8="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported"); - return P8(N8)} - Qt(L8,"rng$1"); - const D8=/^(?:[0-9a-f]{ - 8} - -[0-9a-f]{ - 4} - -[1-5][0-9a-f]{ - 3} - -[89ab][0-9a-f]{ - 3} - -[0-9a-f]{ - 12} - |00000000-0000-0000-0000-000000000000)$/i; - function G8(t){ - return"string"==typeof t&&D8.test(t)} - Qt(G8,"validate"); - for(var B8=[],U8=0; - U8<256; - ++U8)B8.push((U8+256).toString(16).substr(1)); - function F8(t){ - var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=(B8[t[i+0]]+B8[t[i+1]]+B8[t[i+2]]+B8[t[i+3]]+"-"+B8[t[i+4]]+B8[t[i+5]]+"-"+B8[t[i+6]]+B8[t[i+7]]+"-"+B8[t[i+8]]+B8[t[i+9]]+"-"+B8[t[i+10]]+B8[t[i+11]]+B8[t[i+12]]+B8[t[i+13]]+B8[t[i+14]]+B8[t[i+15]]).toLowerCase(); - if(!G8(s))throw TypeError("Stringified UUID is invalid"); - return s} - function $8(t,i,s){ - var e=(t=t||{ - } - ).random||(t.rng||L8)(); - return e[6]=15&e[6]|64,e[8]=63&e[8]|128,F8(e)} - Qt(F8,"stringify"),Qt($8,"v4"); - const H8=Object.create(null); - H8.open="0",H8.close="1",H8.ping="2",H8.pong="3",H8.message="4",H8.upgrade="5",H8.noop="6"; - const W8=Object.create(null); - Object.keys(H8).forEach(t=>{ - W8[H8[t]]=t} - ); - const V8={ - type:"error",data:"parser error"} - ,j8="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),K8="function"==typeof ArrayBuffer,z8=Qt(t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,"isView$1"),Y8=Qt(({ - type:t,data:i} - ,s,e)=>j8&&i instanceof Blob?s?e(i):q8(i,e):K8&&(i instanceof ArrayBuffer||z8(i))?s?e(i):q8(new Blob([i]),e):e(H8[t]+(i||"")),"encodePacket"),q8=Qt((t,i)=>{ - const s=new FileReader; - return s.onload=function(){ - const t=s.result.split(",")[1]; - i("b"+(t||""))} - ,s.readAsDataURL(t)} - ,"encodeBlobAsBase64"); - function X8(t){ - return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)} - let J8; - function Q8(t,i){ - return j8&&t.data instanceof Blob?t.data.arrayBuffer().then(X8).then(i):K8&&(t.data instanceof ArrayBuffer||z8(t.data))?i(X8(t.data)):void Y8(t,!1,t=>{ - J8||(J8=new TextEncoder),i(J8.encode(t))} - )} - Qt(X8,"toArray"),Qt(Q8,"encodePacketToBinary"); - const Z8="undefined"==typeof Uint8Array?[]:new Uint8Array(256); - for(let Set=0; - Set<64; - Set++)Z8["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(Set)]=Set; - const t7=Qt(t=>{ - let i,s,e,n,h,r=.75*t.length,o=t.length,a=0; - "="===t[t.length-1]&&(r--,"="===t[t.length-2]&&r--); - const c=new ArrayBuffer(r),l=new Uint8Array(c); - for(i=0; - i<o; - i+=4)s=Z8[t.charCodeAt(i)],e=Z8[t.charCodeAt(i+1)],n=Z8[t.charCodeAt(i+2)],h=Z8[t.charCodeAt(i+3)],l[a++]=s<<2|e>>4,l[a++]=(15&e)<<4|n>>2,l[a++]=(3&n)<<6|63&h; - return c} - ,"decode$8"),i7="function"==typeof ArrayBuffer,s7=Qt((t,i)=>{ - if("string"!=typeof t)return{ - type:"message",data:n7(t,i)} - ; - const s=t.charAt(0); - return"b"===s?{ - type:"message",data:e7(t.substring(1),i)} - :W8[s]?t.length>1?{ - type:W8[s],data:t.substring(1)} - :{ - type:W8[s]} - :V8} - ,"decodePacket"),e7=Qt((t,i)=>{ - if(i7){ - const s=t7(t); - return n7(s,i)} - return{ - base64:!0,data:t} - } - ,"decodeBase64Packet"),n7=Qt((t,i)=>"blob"===i?t instanceof Blob?t:new Blob([t]):t instanceof ArrayBuffer?t:t.buffer,"mapBinary"),h7=String.fromCharCode(30),r7=Qt((t,i)=>{ - const s=t.length,e=new Array(s); - let n=0; - t.forEach((t,h)=>{ - Y8(t,!1,t=>{ - e[h]=t,++n===s&&i(e.join(h7))} - )} - )} - ,"encodePayload"),o7=Qt((t,i)=>{ - const s=t.split(h7),e=[]; - for(let n=0; - n<s.length; - n++){ - const t=s7(s[n],i); - if(e.push(t),"error"===t.type)break} - return e} - ,"decodePayload"); - function a7(){ - return new TransformStream({ - transform(t,i){ - Q8(t,s=>{ - const e=s.length; - let n; - if(e<126)n=new Uint8Array(1),new DataView(n.buffer).setUint8(0,e); - else if(e<65536){ - n=new Uint8Array(3); - const t=new DataView(n.buffer); - t.setUint8(0,126),t.setUint16(1,e)} - else{ - n=new Uint8Array(9); - const t=new DataView(n.buffer); - t.setUint8(0,127),t.setBigUint64(1,BigInt(e))} - t.data&&"string"!=typeof t.data&&(n[0]|=128),i.enqueue(n),i.enqueue(s)} - )} - } - )} - let c7; - function l7(t){ - return t.reduce((t,i)=>t+i.length,0)} - function u7(t,i){ - if(t[0].length===i)return t.shift(); - const s=new Uint8Array(i); - let e=0; - for(let n=0; - n<i; - n++)s[n]=t[0][e++],e===t[0].length&&(t.shift(),e=0); - return t.length&&e<t[0].length&&(t[0]=t[0].slice(e)),s} - function d7(t,i){ - c7||(c7=new TextDecoder); - const s=[]; - let e=0,n=-1,h=!1; - return new TransformStream({ - transform(r,o){ - for(s.push(r); - ; - ){ - if(0===e){ - if(l7(s)<1)break; - const t=u7(s,1); - h=!(128&~t[0]),n=127&t[0],e=n<126?3:126===n?1:2} - else if(1===e){ - if(l7(s)<2)break; - const t=u7(s,2); - n=new DataView(t.buffer,t.byteOffset,t.length).getUint16(0),e=3} - else if(2===e){ - if(l7(s)<8)break; - const t=u7(s,8),i=new DataView(t.buffer,t.byteOffset,t.length),h=i.getUint32(0); - if(h>Math.pow(2,21)-1){ - o.enqueue(V8); - break} - n=h*Math.pow(2,32)+i.getUint32(4),e=3} - else{ - if(l7(s)<n)break; - const t=u7(s,n); - o.enqueue(s7(h?t:c7.decode(t),i)),e=0} - if(0===n||n>t){ - o.enqueue(V8); - break} - } - } - } - )} - function f7(t){ - if(t)return p7(t)} - function p7(t){ - for(var i in f7.prototype)t[i]=f7.prototype[i]; - return t} - Qt(a7,"createPacketEncoderStream"),Qt(l7,"totalLength"),Qt(u7,"concatChunks"),Qt(d7,"createPacketDecoderStream"),Qt(f7,"Emitter"),Qt(p7,"mixin"),f7.prototype.on=f7.prototype.addEventListener=function(t,i){ - return this._callbacks=this._callbacks||{ - } - ,(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(i),this} - ,f7.prototype.once=function(t,i){ - function s(){ - this.off(t,s),i.apply(this,arguments)} - return Qt(s,"on"),s.fn=i,this.on(t,s),this} - ,f7.prototype.off=f7.prototype.removeListener=f7.prototype.removeAllListeners=f7.prototype.removeEventListener=function(t,i){ - if(this._callbacks=this._callbacks||{ - } - ,0==arguments.length)return this._callbacks={ - } - ,this; - var s,e=this._callbacks["$"+t]; - if(!e)return this; - if(1==arguments.length)return delete this._callbacks["$"+t],this; - for(var n=0; - n<e.length; - n++)if((s=e[n])===i||s.fn===i){ - e.splice(n,1); - break} - return 0===e.length&&delete this._callbacks["$"+t],this} - ,f7.prototype.emit=function(t){ - this._callbacks=this._callbacks||{ - } - ; - for(var i=new Array(arguments.length-1),s=this._callbacks["$"+t],e=1; - e<arguments.length; - e++)i[e-1]=arguments[e]; - if(s){ - e=0; - for(var n=(s=s.slice(0)).length; - e<n; - ++e)s[e].apply(this,i)} - return this} - ,f7.prototype.emitReserved=f7.prototype.emit,f7.prototype.listeners=function(t){ - return this._callbacks=this._callbacks||{ - } - ,this._callbacks["$"+t]||[]} - ,f7.prototype.hasListeners=function(t){ - return!!this.listeners(t).length} - ; - const w7="function"==typeof Promise&&"function"==typeof Promise.resolve?t=>Promise.resolve().then(t):(t,i)=>i(t,0),g7="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")(); - function m7(t,...i){ - return i.reduce((i,s)=>(t.hasOwnProperty(s)&&(i[s]=t[s]),i),{ - } - )} - Qt(function(){ - } - ,"createCookieJar"),Qt(m7,"pick$1"); - const v7=g7.setTimeout,_7=g7.clearTimeout; - function M7(t,i){ - i.useNativeTimers?(t.setTimeoutFn=v7.bind(g7),t.clearTimeoutFn=_7.bind(g7)):(t.setTimeoutFn=g7.setTimeout.bind(g7),t.clearTimeoutFn=g7.clearTimeout.bind(g7))} - function b7(t){ - return"string"==typeof t?y7(t):Math.ceil(1.33*(t.byteLength||t.size))} - function y7(t){ - let i=0,s=0; - for(let e=0,n=t.length; - e<n; - e++)i=t.charCodeAt(e),i<128?s+=1:i<2048?s+=2:i<55296||i>=57344?s+=3:(e++,s+=4); - return s} - function E7(){ - return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)} - function A7(t){ - let i=""; - for(let s in t)t.hasOwnProperty(s)&&(i.length&&(i+="&"),i+=encodeURIComponent(s)+"="+encodeURIComponent(t[s])); - return i} - function S7(t){ - let i={ - } - ,s=t.split("&"); - for(let e=0,n=s.length; - e<n; - e++){ - let t=s[e].split("="); - i[decodeURIComponent(t[0])]=decodeURIComponent(t[1])} - return i} - Qt(M7,"installTimerFunctions"),Qt(b7,"byteLength"),Qt(y7,"utf8Length"),Qt(E7,"randomString"),Qt(A7,"encode$6"),Qt(S7,"decode$7"); - const T7=class extends Error{ - constructor(t,i,s){ - super(t),this.description=i,this.context=s,this.type="TransportError"} - } - ; - Qt(T7,"TransportError"); - let C7=T7; - const O7=class extends f7{ - constructor(t){ - super(),this.writable=!1,M7(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64} - onError(t,i,s){ - return super.emitReserved("error",new C7(t,i,s)),this} - open(){ - return this.readyState="opening",this.doOpen(),this} - close(){ - return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this} - send(t){ - "open"===this.readyState&&this.write(t)} - onOpen(){ - this.readyState="open",this.writable=!0,super.emitReserved("open")} - onData(t){ - const i=s7(t,this.socket.binaryType); - this.onPacket(i)} - onPacket(t){ - super.emitReserved("packet",t)} - onClose(t){ - this.readyState="closed",super.emitReserved("close",t)} - pause(t){ - } - createUri(t,i={ - } - ){ - return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)} - _hostname(){ - const t=this.opts.hostname; - return-1===t.indexOf(":")?t:"["+t+"]"} - _port(){ - return this.opts.port&&(this.opts.secure&&443!==Number(this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""} - _query(t){ - const i=A7(t); - return i.length?"?"+i:""} - } - ; - Qt(O7,"Transport"); - let I7=O7; - const k7=class extends I7{ - constructor(){ - super(...arguments),this._polling=!1} - get name(){ - return"polling"} - doOpen(){ - this._poll()} - pause(t){ - this.readyState="pausing"; - const i=Qt(()=>{ - this.readyState="paused",t()} - ,"pause"); - if(this._polling||!this.writable){ - let t=0; - this._polling&&(t++,this.once("pollComplete",function(){ - --t||i()} - )),this.writable||(t++,this.once("drain",function(){ - --t||i()} - ))} - else i()} - _poll(){ - this._polling=!0,this.doPoll(),this.emitReserved("poll")} - onData(t){ - const i=Qt(t=>{ - if("opening"===this.readyState&&"open"===t.type&&this.onOpen(),"close"===t.type)return this.onClose({ - description:"transport closed by the server"} - ),!1; - this.onPacket(t)} - ,"callback"); - o7(t,this.socket.binaryType).forEach(i),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this._poll())} - doClose(){ - const t=Qt(()=>{ - this.write([{ - type:"close"} - ])} - ,"close"); - "open"===this.readyState?t():this.once("open",t)} - write(t){ - this.writable=!1,r7(t,t=>{ - this.doWrite(t,()=>{ - this.writable=!0,this.emitReserved("drain")} - )} - )} - uri(){ - const t=this.opts.secure?"https":"http",i=this.query||{ - } - ; - return!1!==this.opts.timestampRequests&&(i[this.opts.timestampParam]=E7()),this.supportsBinary||i.sid||(i.b64=1),this.createUri(t,i)} - } - ; - Qt(k7,"Polling"); - let x7=k7,R7=!1; - try{ - R7="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest} - catch(h6i){ - } - const P7=R7; - function N7(){ - } - Qt(N7,"empty$1"); - const L7=class extends x7{ - constructor(t){ - if(super(t),"undefined"!=typeof location){ - const i="https:"===location.protocol; - let s=location.port; - s||(s=i?"443":"80"),this.xd="undefined"!=typeof location&&t.hostname!==location.hostname||s!==t.port} - } - doWrite(t,i){ - const s=this.request({ - method:"POST",data:t} - ); - s.on("success",i),s.on("error",(t,i)=>{ - this.onError("xhr post error",t,i)} - )} - doPoll(){ - const t=this.request(); - t.on("data",this.onData.bind(this)),t.on("error",(t,i)=>{ - this.onError("xhr poll error",t,i)} - ),this.pollXhr=t} - } - ; - Qt(L7,"BaseXHR"); - let D7=L7; - const G7=class t extends f7{ - constructor(t,i,s){ - super(),this.createRequest=t,M7(this,s),this._opts=s,this._method=s.method||"GET",this._uri=i,this._data=void 0!==s.data?s.data:null,this._create()} - _create(){ - var i; - const s=m7(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref"); - s.xdomain=!!this._opts.xd; - const e=this._xhr=this.createRequest(s); - try{ - e.open(this._method,this._uri,!0); - try{ - if(this._opts.extraHeaders){ - e.setDisableHeaderCheck&&e.setDisableHeaderCheck(!0); - for(let t in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(t)&&e.setRequestHeader(t,this._opts.extraHeaders[t])} - } - catch(frt){ - } - if("POST"===this._method)try{ - e.setRequestHeader("Content-type","text/plain; - charset=UTF-8")} - catch(frt){ - } - try{ - e.setRequestHeader("Accept","*/*")} - catch(frt){ - } - null===(i=this._opts.cookieJar)||void 0===i||i.addCookies(e),"withCredentials"in e&&(e.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(e.timeout=this._opts.requestTimeout),e.onreadystatechange=()=>{ - var t; - 3===e.readyState&&(null===(t=this._opts.cookieJar)||void 0===t||t.parseCookies(e.getResponseHeader("set-cookie"))),4===e.readyState&&(200===e.status||1223===e.status?this._onLoad():this.setTimeoutFn(()=>{ - this._onError("number"==typeof e.status?e.status:0)} - ,0))} - ,e.send(this._data)} - catch(frt){ - return void this.setTimeoutFn(()=>{ - this._onError(frt)} - ,0)} - "undefined"!=typeof document&&(this._index=t.requestsCount++,t.requests[this._index]=this)} - _onError(t){ - this.emitReserved("error",t,this._xhr),this._cleanup(!0)} - _cleanup(i){ - if(void 0!==this._xhr&&null!==this._xhr){ - if(this._xhr.onreadystatechange=N7,i)try{ - this._xhr.abort()} - catch(frt){ - } - "undefined"!=typeof document&&delete t.requests[this._index],this._xhr=null} - } - _onLoad(){ - const t=this._xhr.responseText; - null!==t&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())} - abort(){ - this._cleanup()} - } - ; - Qt(G7,"Request"); - let B7=G7; - function U7(){ - for(let t in B7.requests)B7.requests.hasOwnProperty(t)&&B7.requests[t].abort()} - B7.requestsCount=0,B7.requests={ - } - ,"undefined"!=typeof document&&("function"==typeof attachEvent?attachEvent("onunload",U7):"function"==typeof addEventListener&&addEventListener("onpagehide"in g7?"pagehide":"unload",U7,!1)),Qt(U7,"unloadHandler"); - const F7=function(){ - const t=W7({ - xdomain:!1} - ); - return t&&null!==t.responseType} - (),$7=class extends D7{ - constructor(t){ - super(t); - const i=t&&t.forceBase64; - this.supportsBinary=F7&&!i} - request(t={ - } - ){ - return Object.assign(t,{ - xd:this.xd} - ,this.opts),new B7(W7,this.uri(),t)} - } - ; - Qt($7,"XHR"); - let H7=$7; - function W7(t){ - const i=t.xdomain; - try{ - if("undefined"!=typeof XMLHttpRequest&&(!i||P7))return new XMLHttpRequest} - catch(frt){ - } - if(!i)try{ - return new(g7[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")} - catch(frt){ - } - } - Qt(W7,"newRequest"); - const V7="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),j7=class extends I7{ - get name(){ - return"websocket"} - doOpen(){ - const t=this.uri(),i=this.opts.protocols,s=V7?{ - } - :m7(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity"); - this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders); - try{ - this.ws=this.createSocket(t,i,s)} - catch(h6i){ - return this.emitReserved("error",h6i)} - this.ws.binaryType=this.socket.binaryType,this.addEventListeners()} - addEventListeners(){ - this.ws.onopen=()=>{ - this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()} - ,this.ws.onclose=t=>this.onClose({ - description:"websocket connection closed",context:t} - ),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)} - write(t){ - this.writable=!1; - for(let i=0; - i<t.length; - i++){ - const s=t[i],e=i===t.length-1; - Y8(s,this.supportsBinary,t=>{ - try{ - this.doWrite(s,t)} - catch(frt){ - } - e&&w7(()=>{ - this.writable=!0,this.emitReserved("drain")} - ,this.setTimeoutFn)} - )} - } - doClose(){ - void 0!==this.ws&&(this.ws.onerror=()=>{ - } - ,this.ws.close(),this.ws=null)} - uri(){ - const t=this.opts.secure?"wss":"ws",i=this.query||{ - } - ; - return this.opts.timestampRequests&&(i[this.opts.timestampParam]=E7()),this.supportsBinary||(i.b64=1),this.createUri(t,i)} - } - ; - Qt(j7,"BaseWS"); - let K7=j7; - const z7=g7.WebSocket||g7.MozWebSocket; - let Y7=(Qt(ht=class extends K7{ - createSocket(t,i,s){ - return V7?new z7(t,i,s):i?new z7(t,i):new z7(t)} - doWrite(t,i){ - this.ws.send(i)} - } - ,"WS"),ht); - const q7=class extends I7{ - get name(){ - return"webtransport"} - doOpen(){ - try{ - this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])} - catch(h6i){ - return this.emitReserved("error",h6i)} - this._transport.closed.then(()=>{ - this.onClose()} - ).catch(t=>{ - this.onError("webtransport error",t)} - ),this._transport.ready.then(()=>{ - this._transport.createBidirectionalStream().then(t=>{ - const i=d7(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=t.readable.pipeThrough(i).getReader(),e=a7(); - e.readable.pipeTo(t.writable),this._writer=e.writable.getWriter(); - const n=Qt(()=>{ - s.read().then(({ - done:t,value:i} - )=>{ - t||(this.onPacket(i),n())} - ).catch(t=>{ - } - )} - ,"read"); - n(); - const h={ - type:"open"} - ; - this.query.sid&&(h.data=`{ - "sid":"${ - this.query.sid} - "} - `),this._writer.write(h).then(()=>this.onOpen())} - )} - )} - write(t){ - this.writable=!1; - for(let i=0; - i<t.length; - i++){ - const s=t[i],e=i===t.length-1; - this._writer.write(s).then(()=>{ - e&&w7(()=>{ - this.writable=!0,this.emitReserved("drain")} - ,this.setTimeoutFn)} - )} - } - doClose(){ - var t; - null===(t=this._transport)||void 0===t||t.close()} - } - ; - Qt(q7,"WT"); - const X7={ - websocket:Y7,webtransport:q7,polling:H7} - ,J7=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{ - 0,4} - :){ - 2,7} - [a-f0-9]{ - 0,4} - |[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Q7=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"]; - function Z7(t){ - if(t.length>8e3)throw"URI too long"; - const i=t,s=t.indexOf("["),e=t.indexOf("]"); - -1!=s&&-1!=e&&(t=t.substring(0,s)+t.substring(s,e).replace(/:/g,"; - ")+t.substring(e,t.length)); - let n=J7.exec(t||""),h={ - } - ,r=14; - for(; - r--; - )h[Q7[r]]=n[r]||""; - return-1!=s&&-1!=e&&(h.source=i,h.host=h.host.substring(1,h.host.length-1).replace(/; - /g,":"),h.authority=h.authority.replace("[","").replace("]","").replace(/; - /g,":"),h.ipv6uri=!0),h.pathNames=t9(0,h.path),h.queryKey=i9(0,h.query),h} - function t9(t,i){ - const s=i.replace(/\/{ - 2,9} - /g,"/").split("/"); - return"/"!=i.slice(0,1)&&0!==i.length||s.splice(0,1),"/"==i.slice(-1)&&s.splice(s.length-1,1),s} - function i9(t,i){ - const s={ - } - ; - return i.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(t,i,e){ - i&&(s[i]=e)} - ),s} - Qt(Z7,"parse"),Qt(t9,"pathNames"),Qt(i9,"queryKey"); - const s9="function"==typeof addEventListener&&"function"==typeof removeEventListener,e9=[]; - s9&&addEventListener("offline",()=>{ - e9.forEach(t=>t())} - ,!1); - const n9=class t extends f7{ - constructor(t,i){ - if(super(),this.binaryType="arraybuffer",this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&"object"==typeof t&&(i=t,t=null),t){ - const s=Z7(t); - i.hostname=s.host,i.secure="https"===s.protocol||"wss"===s.protocol,i.port=s.port,s.query&&(i.query=s.query)} - else i.host&&(i.hostname=Z7(i.host).host); - M7(this,i),this.secure=null!=i.secure?i.secure:"undefined"!=typeof location&&"https:"===location.protocol,i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=i.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={ - } - ,i.transports.forEach(t=>{ - const i=t.prototype.name; - this.transports.push(i),this._transportsByName[i]=t} - ),this.opts=Object.assign({ - path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{ - threshold:1024} - ,transportOptions:{ - } - ,closeOnBeforeunload:!1} - ,i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=S7(this.opts.query)),s9&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{ - this.transport&&(this.transport.removeAllListeners(),this.transport.close())} - ,addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this._offlineEventListener=()=>{ - this._onClose("transport close",{ - description:"network connection lost"} - )} - ,e9.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()} - createTransport(t){ - const i=Object.assign({ - } - ,this.opts.query); - i.EIO=4,i.transport=t,this.id&&(i.sid=this.id); - const s=Object.assign({ - } - ,this.opts,{ - query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port} - ,this.opts.transportOptions[t]); - return new this._transportsByName[t](s)} - _open(){ - if(0===this.transports.length)return void this.setTimeoutFn(()=>{ - this.emitReserved("error","No transports available")} - ,0); - const i=this.opts.rememberUpgrade&&t.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0]; - this.readyState="opening"; - const s=this.createTransport(i); - s.open(),this.setTransport(s)} - setTransport(t){ - this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))} - onOpen(){ - this.readyState="open",t.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()} - _onPacket(t){ - if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){ - case"open":this.onHandshake(JSON.parse(t.data)); - break; - case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout(); - break; - case"error":const i=new Error("server error"); - i.code=t.data,this._onError(i); - break; - case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data)} - } - onHandshake(t){ - this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()} - _resetPingTimeout(){ - this.clearTimeoutFn(this._pingTimeoutTimer); - const t=this._pingInterval+this._pingTimeout; - this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{ - this._onClose("ping timeout")} - ,t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()} - _onDrain(){ - this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()} - flush(){ - if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){ - const t=this._getWritablePackets(); - this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")} - } - _getWritablePackets(){ - if(!(this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer; - let t=1; - for(let i=0; - i<this.writeBuffer.length; - i++){ - const s=this.writeBuffer[i].data; - if(s&&(t+=b7(s)),i>0&&t>this._maxPayload)return this.writeBuffer.slice(0,i); - t+=2} - return this.writeBuffer} - _hasPingExpired(){ - if(!this._pingTimeoutTime)return!0; - const t=Date.now()>this._pingTimeoutTime; - return t&&(this._pingTimeoutTime=0,w7(()=>{ - this._onClose("ping timeout")} - ,this.setTimeoutFn)),t} - write(t,i,s){ - return this._sendPacket("message",t,i,s),this} - send(t,i,s){ - return this._sendPacket("message",t,i,s),this} - _sendPacket(t,i,s,e){ - if("function"==typeof i&&(e=i,i=void 0),"function"==typeof s&&(e=s,s=null),"closing"===this.readyState||"closed"===this.readyState)return; - (s=s||{ - } - ).compress=!1!==s.compress; - const n={ - type:t,data:i,options:s} - ; - this.emitReserved("packetCreate",n),this.writeBuffer.push(n),e&&this.once("flush",e),this.flush()} - close(){ - const t=Qt(()=>{ - this._onClose("forced close"),this.transport.close()} - ,"close"),i=Qt(()=>{ - this.off("upgrade",i),this.off("upgradeError",i),t()} - ,"cleanupAndClose"),s=Qt(()=>{ - this.once("upgrade",i),this.once("upgradeError",i)} - ,"waitForUpgrade"); - return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{ - this.upgrading?s():t()} - ):this.upgrading?s():t()),this} - _onError(i){ - if(t.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this._open(); - this.emitReserved("error",i),this._onClose("transport error",i)} - _onClose(t,i){ - if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){ - if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),s9&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){ - const t=e9.indexOf(this._offlineEventListener); - -1!==t&&e9.splice(t,1)} - this.readyState="closed",this.id=null,this.emitReserved("close",t,i),this.writeBuffer=[],this._prevBufferLen=0} - } - } - ; - Qt(n9,"SocketWithoutUpgrade"); - let h9=n9; - h9.protocol=4; - const r9=class extends h9{ - constructor(){ - super(...arguments),this._upgrades=[]} - onOpen(){ - if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade)for(let t=0; - t<this._upgrades.length; - t++)this._probe(this._upgrades[t])} - _probe(t){ - let i=this.createTransport(t),s=!1; - h9.priorWebsocketSuccess=!1; - const e=Qt(()=>{ - s||(i.send([{ - type:"ping",data:"probe"} - ]),i.once("packet",t=>{ - if(!s)if("pong"===t.type&&"probe"===t.data){ - if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return; - h9.priorWebsocketSuccess="websocket"===i.name,this.transport.pause(()=>{ - s||"closed"!==this.readyState&&(c(),this.setTransport(i),i.send([{ - type:"upgrade"} - ]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())} - )} - else{ - const t=new Error("probe error"); - t.transport=i.name,this.emitReserved("upgradeError",t)} - } - ))} - ,"onTransportOpen"); - function n(){ - s||(s=!0,c(),i.close(),i=null)} - Qt(n,"freezeTransport"); - const h=Qt(t=>{ - const s=new Error("probe error: "+t); - s.transport=i.name,n(),this.emitReserved("upgradeError",s)} - ,"onerror"); - function r(){ - h("transport closed")} - function o(){ - h("socket closed")} - function a(t){ - i&&t.name!==i.name&&n()} - Qt(r,"onTransportClose"),Qt(o,"onclose"),Qt(a,"onupgrade"); - const c=Qt(()=>{ - i.removeListener("open",e),i.removeListener("error",h),i.removeListener("close",r),this.off("close",o),this.off("upgrading",a)} - ,"cleanup"); - i.once("open",e),i.once("error",h),i.once("close",r),this.once("close",o),this.once("upgrading",a),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==t?this.setTimeoutFn(()=>{ - s||i.open()} - ,200):i.open()} - onHandshake(t){ - this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)} - _filterUpgrades(t){ - const i=[]; - for(let s=0; - s<t.length; - s++)~this.transports.indexOf(t[s])&&i.push(t[s]); - return i} - } - ; - Qt(r9,"SocketWithUpgrade"); - let o9=r9,a9=(rt=class extends o9{ - constructor(t,i={ - } - ){ - const s="object"==typeof t?t:i; - (!s.transports||s.transports&&"string"==typeof s.transports[0])&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(t=>X7[t]).filter(t=>!!t)),super(t,s)} - } - ,Qt(rt,"Socket"),rt); - function c9(t,i="",s){ - let e=t; - s=s||"undefined"!=typeof location&&location,null==t&&(t=s.protocol+"//"+s.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?s.protocol+t:s.host+t),/^(https?|wss?):\/\//.test(t)||(t=void 0!==s?s.protocol+"//"+t:"https://"+t),e=Z7(t)),e.port||(/^(http|ws)$/.test(e.protocol)?e.port="80":/^(http|ws)s$/.test(e.protocol)&&(e.port="443")),e.path=e.path||"/"; - const n=-1!==e.host.indexOf(":")?"["+e.host+"]":e.host; - return e.id=e.protocol+"://"+n+":"+e.port+i,e.href=e.protocol+"://"+n+(s&&s.port===e.port?"":":"+e.port),e} - Qt(c9,"url$2"); - const l9="function"==typeof ArrayBuffer,u9=Qt(t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,"isView"),d9=Object.prototype.toString,f9="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===d9.call(Blob),p9="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===d9.call(File); - function w9(t){ - return l9&&(t instanceof ArrayBuffer||u9(t))||f9&&t instanceof Blob||p9&&t instanceof File} - function g9(t,i){ - if(!t||"object"!=typeof t)return!1; - if(Array.isArray(t)){ - for(let i=0,s=t.length; - i<s; - i++)if(g9(t[i]))return!0; - return!1} - if(w9(t))return!0; - if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return g9(t.toJSON(),!0); - for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&g9(t[s]))return!0; - return!1} - function m9(t){ - const i=[],s=t.data,e=t; - return e.data=v9(s,i),e.attachments=i.length,{ - packet:e,buffers:i} - } - function v9(t,i){ - if(!t)return t; - if(w9(t)){ - const s={ - _placeholder:!0,num:i.length} - ; - return i.push(t),s} - if(Array.isArray(t)){ - const s=new Array(t.length); - for(let e=0; - e<t.length; - e++)s[e]=v9(t[e],i); - return s} - if("object"==typeof t&&!(t instanceof Date)){ - const s={ - } - ; - for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(s[e]=v9(t[e],i)); - return s} - return t} - function _9(t,i){ - return t.data=M9(t.data,i),delete t.attachments,t} - function M9(t,i){ - if(!t)return t; - if(t&&!0===t._placeholder){ - if("number"==typeof t.num&&t.num>=0&&t.num<i.length)return i[t.num]; - throw new Error("illegal attachments")} - if(Array.isArray(t))for(let s=0; - s<t.length; - s++)t[s]=M9(t[s],i); - else if("object"==typeof t)for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(t[s]=M9(t[s],i)); - return t} - Qt(w9,"isBinary$1"),Qt(g9,"hasBinary"),Qt(m9,"deconstructPacket"),Qt(v9,"_deconstructPacket"),Qt(_9,"reconstructPacket"),Qt(M9,"_reconstructPacket"); - const b9=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"]; - var y9,E9; - (E9=y9||(y9={ - } - ))[E9.CONNECT=0]="CONNECT",E9[E9.DISCONNECT=1]="DISCONNECT",E9[E9.EVENT=2]="EVENT",E9[E9.ACK=3]="ACK",E9[E9.CONNECT_ERROR=4]="CONNECT_ERROR",E9[E9.BINARY_EVENT=5]="BINARY_EVENT",E9[E9.BINARY_ACK=6]="BINARY_ACK"; - let A9=(Qt(ot=class{ - constructor(t){ - this.replacer=t} - encode(t){ - return t.type!==y9.EVENT&&t.type!==y9.ACK||!g9(t)?[this.encodeAsString(t)]:this.encodeAsBinary({ - type:t.type===y9.EVENT?y9.BINARY_EVENT:y9.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id} - )} - encodeAsString(t){ - let i=""+t.type; - return t.type!==y9.BINARY_EVENT&&t.type!==y9.BINARY_ACK||(i+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(i+=t.nsp+","),null!=t.id&&(i+=t.id),null!=t.data&&(i+=JSON.stringify(t.data,this.replacer)),i} - encodeAsBinary(t){ - const i=m9(t),s=this.encodeAsString(i.packet),e=i.buffers; - return e.unshift(s),e} - } - ,"Encoder"),ot),S9=(at=class extends f7{ - constructor(t){ - super(),this.reviver=t} - add(t){ - let i; - if("string"==typeof t){ - if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet"); - i=this.decodeString(t); - const s=i.type===y9.BINARY_EVENT; - s||i.type===y9.BINARY_ACK?(i.type=s?y9.EVENT:y9.ACK,this.reconstructor=new C9(i),0===i.attachments&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)} - else{ - if(!w9(t)&&!t.base64)throw new Error("Unknown type: "+t); - if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet"); - i=this.reconstructor.takeBinaryData(t),i&&(this.reconstructor=null,super.emitReserved("decoded",i))} - } - decodeString(t){ - let i=0; - const s={ - type:Number(t.charAt(0))} - ; - if(void 0===y9[s.type])throw new Error("unknown packet type "+s.type); - if(s.type===y9.BINARY_EVENT||s.type===y9.BINARY_ACK){ - const e=i+1; - for(; - "-"!==t.charAt(++i)&&i!=t.length; - ); - const n=t.substring(e,i); - if(n!=Number(n)||"-"!==t.charAt(i))throw new Error("Illegal attachments"); - s.attachments=Number(n)} - if("/"===t.charAt(i+1)){ - const e=i+1; - for(; - ++i&&","!==t.charAt(i)&&i!==t.length; - ); - s.nsp=t.substring(e,i)} - else s.nsp="/"; - const e=t.charAt(i+1); - if(""!==e&&Number(e)==e){ - const e=i+1; - for(; - ++i; - ){ - const s=t.charAt(i); - if(null==s||Number(s)!=s){ - --i; - break} - if(i===t.length)break} - s.id=Number(t.substring(e,i+1))} - if(t.charAt(++i)){ - const e=this.tryParse(t.substr(i)); - if(!at.isPayloadValid(s.type,e))throw new Error("invalid payload"); - s.data=e} - return s} - tryParse(t){ - try{ - return JSON.parse(t,this.reviver)} - catch(frt){ - return!1} - } - static isPayloadValid(t,i){ - switch(t){ - case y9.CONNECT:return O9(i); - case y9.DISCONNECT:return void 0===i; - case y9.CONNECT_ERROR:return"string"==typeof i||O9(i); - case y9.EVENT:case y9.BINARY_EVENT:return Array.isArray(i)&&("number"==typeof i[0]||"string"==typeof i[0]&&-1===b9.indexOf(i[0])); - case y9.ACK:case y9.BINARY_ACK:return Array.isArray(i)} - } - destroy(){ - this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)} - } - ,Qt(at,"Decoder"),at); - const T9=class{ - constructor(t){ - this.packet=t,this.buffers=[],this.reconPack=t} - takeBinaryData(t){ - if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){ - const t=_9(this.reconPack,this.buffers); - return this.finishedReconstruction(),t} - return null} - finishedReconstruction(){ - this.reconPack=null,this.buffers=[]} - } - ; - Qt(T9,"BinaryReconstructor"); - let C9=T9; - function O9(t){ - return"[object Object]"===Object.prototype.toString.call(t)} - Qt(O9,"isObject$2"); - const I9=Object.freeze(Object.defineProperty({ - __proto__:null,Decoder:S9,Encoder:A9,get PacketType(){ - return y9} - } - ,Symbol.toStringTag,{ - value:"Module"} - )); - function k9(t,i,s){ - return t.on(i,s),Qt(function(){ - t.off(i,s)} - ,"subDestroy")} - Qt(k9,"on$3"); - const x9=Object.freeze({ - connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1} - ),R9=class extends f7{ - constructor(t,i,s){ - super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={ - } - ,this.flags={ - } - ,this.io=t,this.nsp=i,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({ - } - ,s),this.io._autoConnect&&this.open()} - get disconnected(){ - return!this.connected} - subEvents(){ - if(this.subs)return; - const t=this.io; - this.subs=[k9(t,"open",this.onopen.bind(this)),k9(t,"packet",this.onpacket.bind(this)),k9(t,"error",this.onerror.bind(this)),k9(t,"close",this.onclose.bind(this))]} - get active(){ - return!!this.subs} - connect(){ - return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this} - open(){ - return this.connect()} - send(...t){ - return t.unshift("message"),this.emit.apply(this,t),this} - emit(t,...i){ - var s,e,n; - if(x9.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name'); - if(i.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this; - const h={ - type:y9.EVENT,data:i,options:{ - } - } - ; - if(h.options.compress=!1!==this.flags.compress,"function"==typeof i[i.length-1]){ - const t=this.ids++,s=i.pop(); - this._registerAckCallback(t,s),h.id=t} - const r=null===(e=null===(s=this.io.engine)||void 0===s?void 0:s.transport)||void 0===e?void 0:e.writable,o=this.connected&&!(null===(n=this.io.engine)||void 0===n?void 0:n._hasPingExpired()); - return this.flags.volatile&&!r||(o?(this.notifyOutgoingListeners(h),this.packet(h)):this.sendBuffer.push(h)),this.flags={ - } - ,this} - _registerAckCallback(t,i){ - var s; - const e=null!==(s=this.flags.timeout)&&void 0!==s?s:this._opts.ackTimeout; - if(void 0===e)return void(this.acks[t]=i); - const n=this.io.setTimeoutFn(()=>{ - delete this.acks[t]; - for(let i=0; - i<this.sendBuffer.length; - i++)this.sendBuffer[i].id===t&&this.sendBuffer.splice(i,1); - i.call(this,new Error("operation has timed out"))} - ,e),h=Qt((...t)=>{ - this.io.clearTimeoutFn(n),i.apply(this,t)} - ,"fn"); - h.withError=!0,this.acks[t]=h} - emitWithAck(t,...i){ - return new Promise((s,e)=>{ - const n=Qt((t,i)=>t?e(t):s(i),"fn"); - n.withError=!0,i.push(n),this.emit(t,...i)} - )} - _addToQueue(t){ - let i; - "function"==typeof t[t.length-1]&&(i=t.pop()); - const s={ - id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({ - fromQueue:!0} - ,this.flags)} - ; - t.push((t,...e)=>(this._queue[0],null!==t?s.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(t)):(this._queue.shift(),i&&i(null,...e)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()} - _drainQueue(t=!1){ - if(!this.connected||0===this._queue.length)return; - const i=this._queue[0]; - i.pending&&!t||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))} - packet(t){ - t.nsp=this.nsp,this.io._packet(t)} - onopen(){ - "function"==typeof this.auth?this.auth(t=>{ - this._sendConnectPacket(t)} - ):this._sendConnectPacket(this.auth)} - _sendConnectPacket(t){ - this.packet({ - type:y9.CONNECT,data:this._pid?Object.assign({ - pid:this._pid,offset:this._lastOffset} - ,t):t} - )} - onerror(t){ - this.connected||this.emitReserved("connect_error",t)} - onclose(t,i){ - this.connected=!1,delete this.id,this.emitReserved("disconnect",t,i),this._clearAcks()} - _clearAcks(){ - Object.keys(this.acks).forEach(t=>{ - if(!this.sendBuffer.some(i=>String(i.id)===t)){ - const i=this.acks[t]; - delete this.acks[t],i.withError&&i.call(this,new Error("socket has been disconnected"))} - } - )} - onpacket(t){ - if(t.nsp===this.nsp)switch(t.type){ - case y9.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)")); - break; - case y9.EVENT:case y9.BINARY_EVENT:this.onevent(t); - break; - case y9.ACK:case y9.BINARY_ACK:this.onack(t); - break; - case y9.DISCONNECT:this.ondisconnect(); - break; - case y9.CONNECT_ERROR:this.destroy(); - const i=new Error(t.data.message); - i.data=t.data.data,this.emitReserved("connect_error",i)} - } - onevent(t){ - const i=t.data||[]; - null!=t.id&&i.push(this.ack(t.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))} - emitEvent(t){ - if(this._anyListeners&&this._anyListeners.length){ - const i=this._anyListeners.slice(); - for(const s of i)s.apply(this,t)} - super.emit.apply(this,t),this._pid&&t.length&&"string"==typeof t[t.length-1]&&(this._lastOffset=t[t.length-1])} - ack(t){ - const i=this; - let s=!1; - return function(...e){ - s||(s=!0,i.packet({ - type:y9.ACK,id:t,data:e} - ))} - } - onack(t){ - const i=this.acks[t.id]; - "function"==typeof i&&(delete this.acks[t.id],i.withError&&t.data.unshift(null),i.apply(this,t.data))} - onconnect(t,i){ - this.id=t,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")} - emitBuffered(){ - this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{ - this.notifyOutgoingListeners(t),this.packet(t)} - ),this.sendBuffer=[]} - ondisconnect(){ - this.destroy(),this.onclose("io server disconnect")} - destroy(){ - this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)} - disconnect(){ - return this.connected&&this.packet({ - type:y9.DISCONNECT} - ),this.destroy(),this.connected&&this.onclose("io client disconnect"),this} - close(){ - return this.disconnect()} - compress(t){ - return this.flags.compress=t,this} - get volatile(){ - return this.flags.volatile=!0,this} - timeout(t){ - return this.flags.timeout=t,this} - onAny(t){ - return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this} - prependAny(t){ - return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this} - offAny(t){ - if(!this._anyListeners)return this; - if(t){ - const i=this._anyListeners; - for(let s=0; - s<i.length; - s++)if(t===i[s])return i.splice(s,1),this} - else this._anyListeners=[]; - return this} - listenersAny(){ - return this._anyListeners||[]} - onAnyOutgoing(t){ - return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this} - prependAnyOutgoing(t){ - return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this} - offAnyOutgoing(t){ - if(!this._anyOutgoingListeners)return this; - if(t){ - const i=this._anyOutgoingListeners; - for(let s=0; - s<i.length; - s++)if(t===i[s])return i.splice(s,1),this} - else this._anyOutgoingListeners=[]; - return this} - listenersAnyOutgoing(){ - return this._anyOutgoingListeners||[]} - notifyOutgoingListeners(t){ - if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){ - const i=this._anyOutgoingListeners.slice(); - for(const s of i)s.apply(this,t.data)} - } - } - ; - Qt(R9,"Socket"); - let P9=R9; - function N9(t){ - t=t||{ - } - ,this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0} - Qt(N9,"Backoff"),N9.prototype.duration=function(){ - var t=this.ms*Math.pow(this.factor,this.attempts++); - if(this.jitter){ - var i=Math.random(),s=Math.floor(i*this.jitter*t); - t=1&Math.floor(10*i)?t+s:t-s} - return 0|Math.min(t,this.max)} - ,N9.prototype.reset=function(){ - this.attempts=0} - ,N9.prototype.setMin=function(t){ - this.ms=t} - ,N9.prototype.setMax=function(t){ - this.max=t} - ,N9.prototype.setJitter=function(t){ - this.jitter=t} - ; - const L9=class extends f7{ - constructor(t,i){ - var s; - super(),this.nsps={ - } - ,this.subs=[],t&&"object"==typeof t&&(i=t,t=void 0),(i=i||{ - } - ).path=i.path||"/socket.io",this.opts=i,M7(this,i),this.reconnection(!1!==i.reconnection),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(s=i.randomizationFactor)&&void 0!==s?s:.5),this.backoff=new N9({ - min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()} - ),this.timeout(null==i.timeout?2e4:i.timeout),this._readyState="closed",this.uri=t; - const e=i.parser||I9; - this.encoder=new e.Encoder,this.decoder=new e.Decoder,this._autoConnect=!1!==i.autoConnect,this._autoConnect&&this.open()} - reconnection(t){ - return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection} - reconnectionAttempts(t){ - return void 0===t?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)} - reconnectionDelay(t){ - var i; - return void 0===t?this._reconnectionDelay:(this._reconnectionDelay=t,null===(i=this.backoff)||void 0===i||i.setMin(t),this)} - randomizationFactor(t){ - var i; - return void 0===t?this._randomizationFactor:(this._randomizationFactor=t,null===(i=this.backoff)||void 0===i||i.setJitter(t),this)} - reconnectionDelayMax(t){ - var i; - return void 0===t?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,null===(i=this.backoff)||void 0===i||i.setMax(t),this)} - timeout(t){ - return arguments.length?(this._timeout=t,this):this._timeout} - maybeReconnectOnOpen(){ - !this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()} - open(t){ - if(~this._readyState.indexOf("open"))return this; - this.engine=new a9(this.uri,this.opts); - const i=this.engine,s=this; - this._readyState="opening",this.skipReconnect=!1; - const e=k9(i,"open",function(){ - s.onopen(),t&&t()} - ),n=Qt(i=>{ - this.cleanup(),this._readyState="closed",this.emitReserved("error",i),t?t(i):this.maybeReconnectOnOpen()} - ,"onError"),h=k9(i,"error",n); - if(!1!==this._timeout){ - const t=this._timeout,s=this.setTimeoutFn(()=>{ - e(),n(new Error("timeout")),i.close()} - ,t); - this.opts.autoUnref&&s.unref(),this.subs.push(()=>{ - this.clearTimeoutFn(s)} - )} - return this.subs.push(e),this.subs.push(h),this} - connect(t){ - return this.open(t)} - onopen(){ - this.cleanup(),this._readyState="open",this.emitReserved("open"); - const t=this.engine; - this.subs.push(k9(t,"ping",this.onping.bind(this)),k9(t,"data",this.ondata.bind(this)),k9(t,"error",this.onerror.bind(this)),k9(t,"close",this.onclose.bind(this)),k9(this.decoder,"decoded",this.ondecoded.bind(this)))} - onping(){ - this.emitReserved("ping")} - ondata(t){ - try{ - this.decoder.add(t)} - catch(frt){ - this.onclose("parse error",frt)} - } - ondecoded(t){ - w7(()=>{ - this.emitReserved("packet",t)} - ,this.setTimeoutFn)} - onerror(t){ - this.emitReserved("error",t)} - socket(t,i){ - let s=this.nsps[t]; - return s?this._autoConnect&&!s.active&&s.connect():(s=new P9(this,t,i),this.nsps[t]=s),s} - _destroy(t){ - const i=Object.keys(this.nsps); - for(const s of i)if(this.nsps[s].active)return; - this._close()} - _packet(t){ - const i=this.encoder.encode(t); - for(let s=0; - s<i.length; - s++)this.engine.write(i[s],t.options)} - cleanup(){ - this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()} - _close(){ - this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")} - disconnect(){ - return this._close()} - onclose(t,i){ - var s; - this.cleanup(),null===(s=this.engine)||void 0===s||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,i),this._reconnection&&!this.skipReconnect&&this.reconnect()} - reconnect(){ - if(this._reconnecting||this.skipReconnect)return this; - const t=this; - if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1; - else{ - const i=this.backoff.duration(); - this._reconnecting=!0; - const s=this.setTimeoutFn(()=>{ - t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),t.skipReconnect||t.open(i=>{ - i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()} - ))} - ,i); - this.opts.autoUnref&&s.unref(),this.subs.push(()=>{ - this.clearTimeoutFn(s)} - )} - } - onreconnect(){ - const t=this.backoff.attempts; - this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)} - } - ; - Qt(L9,"Manager"); - let D9=L9; - const G9={ - } - ; - function B9(t,i){ - "object"==typeof t&&(i=t,t=void 0); - const s=c9(t,(i=i||{ - } - ).path||"/socket.io"),e=s.source,n=s.id,h=s.path,r=G9[n]&&h in G9[n].nsps; - let o; - return i.forceNew||i["force new connection"]||!1===i.multiplex||r?o=new D9(e,i):(G9[n]||(G9[n]=new D9(e,i)),o=G9[n]),s.query&&!i.query&&(i.query=s.queryKey),o.socket(s.path,i)} - function U9(t,i,s,e){ - return new(s||(s=Promise))(function(n,h){ - function r(t){ - try{ - a(e.next(t))} - catch(i){ - h(i)} - } - function o(t){ - try{ - a(e.throw(t))} - catch(i){ - h(i)} - } - function a(t){ - var i; - t.done?n(t.value):(i=t.value,i instanceof s?i:new s(function(t){ - t(i)} - )).then(r,o)} - Qt(r,"s"),Qt(o,"a"),Qt(a,"c"),a((e=e.apply(t,i||[])).next())} - )} - Qt(B9,"lookup"),Object.assign(B9,{ - Manager:D9,Socket:P9,io:B9,connect:B9} - ),Qt(U9,"c$1"),"function"==typeof SuppressedError&&SuppressedError; - var F9="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{ - } - ,$9=[],H9=[],W9="undefined"!=typeof Uint8Array?Uint8Array:Array,V9=!1; - function j9(){ - V9=!0; - for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0; - i<64; - ++i)$9[i]=t[i],H9[t.charCodeAt(i)]=i; - H9["-".charCodeAt(0)]=62,H9["_".charCodeAt(0)]=63} - function K9(t,i,s){ - for(var e,n,h=[],r=i; - r<s; - r+=3)e=(t[r]<<16)+(t[r+1]<<8)+t[r+2],h.push($9[(n=e)>>18&63]+$9[n>>12&63]+$9[n>>6&63]+$9[63&n]); - return h.join("")} - function z9(t){ - var i; - V9||j9(); - for(var s=t.length,e=s%3,n="",h=[],r=16383,o=0,a=s-e; - o<a; - o+=r)h.push(K9(t,o,o+r>a?a:o+r)); - return 1===e?(i=t[s-1],n+=$9[i>>2],n+=$9[i<<4&63],n+="=="):2===e&&(i=(t[s-2]<<8)+t[s-1],n+=$9[i>>10],n+=$9[i>>4&63],n+=$9[i<<2&63],n+="="),h.push(n),h.join("")} - function Y9(t,i,s,e,n){ - var h,r,o=8*n-e-1,a=(1<<o)-1,c=a>>1,l=-7,u=s?n-1:0,d=s?-1:1,f=t[i+u]; - for(u+=d,h=f&(1<<-l)-1,f>>=-l,l+=o; - l>0; - h=256*h+t[i+u],u+=d,l-=8); - for(r=h&(1<<-l)-1,h>>=-l,l+=e; - l>0; - r=256*r+t[i+u],u+=d,l-=8); - if(0===h)h=1-c; - else{ - if(h===a)return r?NaN:1/0*(f?-1:1); - r+=Math.pow(2,e),h-=c} - return(f?-1:1)*r*Math.pow(2,h-e)} - function q9(t,i,s,e,n,h){ - var r,o,a,c=8*h-n-1,l=(1<<c)-1,u=l>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=e?0:h-1,p=e?1:-1,w=i<0||0===i&&1/i<0?1:0; - for(i=Math.abs(i),isNaN(i)||i===1/0?(o=isNaN(i)?1:0,r=l):(r=Math.floor(Math.log(i)/Math.LN2),i*(a=Math.pow(2,-r))<1&&(r--,a*=2),(i+=r+u>=1?d/a:d*Math.pow(2,1-u))*a>=2&&(r++,a/=2),r+u>=l?(o=0,r=l):r+u>=1?(o=(i*a-1)*Math.pow(2,n),r+=u):(o=i*Math.pow(2,u-1)*Math.pow(2,n),r=0)); - n>=8; - t[s+f]=255&o,f+=p,o/=256,n-=8); - for(r=r<<n|o,c+=n; - c>0; - t[s+f]=255&r,f+=p,r/=256,c-=8); - t[s+f-p]|=128*w} - Qt(j9,"p$1"),Qt(K9,"g"),Qt(z9,"m"),Qt(Y9,"y"),Qt(q9,"v"); - var X9={ - } - .toString,J9=Array.isArray||function(t){ - return"[object Array]"==X9.call(t)} - ; - itt.TYPED_ARRAY_SUPPORT=void 0===F9.TYPED_ARRAY_SUPPORT||F9.TYPED_ARRAY_SUPPORT; - var Q9=Z9(); - function Z9(){ - return itt.TYPED_ARRAY_SUPPORT?2147483647:1073741823} - function ttt(t,i){ - if(Z9()<i)throw new RangeError("Invalid typed array length"); - return itt.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(i)).__proto__=itt.prototype:(null===t&&(t=new itt(i)),t.length=i),t} - function itt(t,i,s){ - if(!(itt.TYPED_ARRAY_SUPPORT||this instanceof itt))return new itt(t,i,s); - if("number"==typeof t){ - if("string"==typeof i)throw new Error("If encoding is specified then the first argument must be a string"); - return ntt(this,t)} - return stt(this,t,i,s)} - function stt(t,i,s,e){ - if("number"==typeof i)throw new TypeError('"value" argument must not be a number'); - return"undefined"!=typeof ArrayBuffer&&i instanceof ArrayBuffer?function(t,i,s,e){ - if(i.byteLength,s<0||i.byteLength<s)throw new RangeError("'offset' is out of bounds"); - if(i.byteLength<s+(e||0))throw new RangeError("'length' is out of bounds"); - return i=void 0===s&&void 0===e?new Uint8Array(i):void 0===e?new Uint8Array(i,s):new Uint8Array(i,s,e),itt.TYPED_ARRAY_SUPPORT?(t=i).__proto__=itt.prototype:t=htt(t,i),t} - (t,i,s,e):"string"==typeof i?function(t,i,s){ - if("string"==typeof s&&""!==s||(s="utf8"),!itt.isEncoding(s))throw new TypeError('"encoding" must be a valid string encoding'); - var e=0|att(i,s),n=(t=ttt(t,e)).write(i,s); - return n!==e&&(t=t.slice(0,n)),t} - (t,i,s):function(t,i){ - if(ott(i)){ - var s=0|rtt(i.length); - return 0===(t=ttt(t,s)).length||i.copy(t,0,0,s),t} - if(i){ - if("undefined"!=typeof ArrayBuffer&&i.buffer instanceof ArrayBuffer||"length"in i)return"number"!=typeof i.length||(e=i.length)!=e?ttt(t,0):htt(t,i); - if("Buffer"===i.type&&J9(i.data))return htt(t,i.data)} - var e; - throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")} - (t,i)} - function ett(t){ - if("number"!=typeof t)throw new TypeError('"size" argument must be a number'); - if(t<0)throw new RangeError('"size" argument must not be negative')} - function ntt(t,i){ - if(ett(i),t=ttt(t,i<0?0:0|rtt(i)),!itt.TYPED_ARRAY_SUPPORT)for(var s=0; - s<i; - ++s)t[s]=0; - return t} - function htt(t,i){ - var s=i.length<0?0:0|rtt(i.length); - t=ttt(t,s); - for(var e=0; - e<s; - e+=1)t[e]=255&i[e]; - return t} - function rtt(t){ - if(t>=Z9())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Z9().toString(16)+" bytes"); - return 0|t} - function ott(t){ - return!(null==t||!t._isBuffer)} - function att(t,i){ - if(ott(t))return t.length; - if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength; - "string"!=typeof t&&(t=""+t); - var s=t.length; - if(0===s)return 0; - for(var e=!1; - ; - )switch(i){ - case"ascii":case"latin1":case"binary":return s; - case"utf8":case"utf-8":case void 0:return Ltt(t).length; - case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*s; - case"hex":return s>>>1; - case"base64":return Dtt(t).length; - default:if(e)return Ltt(t).length; - i=(""+i).toLowerCase(),e=!0} - } - function ctt(t,i,s){ - var e=!1; - if((void 0===i||i<0)&&(i=0),i>this.length)return""; - if((void 0===s||s>this.length)&&(s=this.length),s<=0)return""; - if((s>>>=0)<=(i>>>=0))return""; - for(t||(t="utf8"); - ; - )switch(t){ - case"hex":return Att(this,i,s); - case"utf8":case"utf-8":return Mtt(this,i,s); - case"ascii":return ytt(this,i,s); - case"latin1":case"binary":return Ett(this,i,s); - case"base64":return _tt(this,i,s); - case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Stt(this,i,s); - default:if(e)throw new TypeError("Unknown encoding: "+t); - t=(t+"").toLowerCase(),e=!0} - } - function ltt(t,i,s){ - var e=t[i]; - t[i]=t[s],t[s]=e} - function utt(t,i,s,e,n){ - if(0===t.length)return-1; - if("string"==typeof s?(e=s,s=0):s>2147483647?s=2147483647:s<-2147483648&&(s=-2147483648),s=+s,isNaN(s)&&(s=n?0:t.length-1),s<0&&(s=t.length+s),s>=t.length){ - if(n)return-1; - s=t.length-1} - else if(s<0){ - if(!n)return-1; - s=0} - if("string"==typeof i&&(i=itt.from(i,e)),ott(i))return 0===i.length?-1:dtt(t,i,s,e,n); - if("number"==typeof i)return i&=255,itt.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,i,s):Uint8Array.prototype.lastIndexOf.call(t,i,s):dtt(t,[i],s,e,n); - throw new TypeError("val must be string, number or Buffer")} - function dtt(t,i,s,e,n){ - var h,r=1,o=t.length,a=i.length; - if(void 0!==e&&("ucs2"===(e=String(e).toLowerCase())||"ucs-2"===e||"utf16le"===e||"utf-16le"===e)){ - if(t.length<2||i.length<2)return-1; - r=2,o/=2,a/=2,s/=2} - function c(t,i){ - return 1===r?t[i]:t.readUInt16BE(i*r)} - if(Qt(c,"l"),n){ - var l=-1; - for(h=s; - h<o; - h++)if(c(t,h)===c(i,-1===l?0:h-l)){ - if(-1===l&&(l=h),h-l+1===a)return l*r} - else-1!==l&&(h-=h-l),l=-1} - else for(s+a>o&&(s=o-a),h=s; - h>=0; - h--){ - for(var u=!0,d=0; - d<a; - d++)if(c(t,h+d)!==c(i,d)){ - u=!1; - break} - if(u)return h} - return-1} - function ftt(t,i,s,e){ - s=Number(s)||0; - var n=t.length-s; - e?(e=Number(e))>n&&(e=n):e=n; - var h=i.length; - if(h%2!=0)throw new TypeError("Invalid hex string"); - e>h/2&&(e=h/2); - for(var r=0; - r<e; - ++r){ - var o=parseInt(i.substr(2*r,2),16); - if(isNaN(o))return r; - t[s+r]=o} - return r} - function ptt(t,i,s,e){ - return Gtt(Ltt(i,t.length-s),t,s,e)} - function wtt(t,i,s,e){ - return Gtt(function(t){ - for(var i=[],s=0; - s<t.length; - ++s)i.push(255&t.charCodeAt(s)); - return i} - (i),t,s,e)} - function gtt(t,i,s,e){ - return wtt(t,i,s,e)} - function mtt(t,i,s,e){ - return Gtt(Dtt(i),t,s,e)} - function vtt(t,i,s,e){ - return Gtt(function(t,i){ - for(var s,e,n,h=[],r=0; - r<t.length&&!((i-=2)<0); - ++r)e=(s=t.charCodeAt(r))>>8,n=s%256,h.push(n),h.push(e); - return h} - (i,t.length-s),t,s,e)} - function _tt(t,i,s){ - return 0===i&&s===t.length?z9(t):z9(t.slice(i,s))} - function Mtt(t,i,s){ - s=Math.min(t.length,s); - for(var e=[],n=i; - n<s; - ){ - var h,r,o,a,c=t[n],l=null,u=c>239?4:c>223?3:c>191?2:1; - if(n+u<=s)switch(u){ - case 1:c<128&&(l=c); - break; - case 2:128==(192&(h=t[n+1]))&&(a=(31&c)<<6|63&h)>127&&(l=a); - break; - case 3:h=t[n+1],r=t[n+2],128==(192&h)&&128==(192&r)&&(a=(15&c)<<12|(63&h)<<6|63&r)>2047&&(a<55296||a>57343)&&(l=a); - break; - case 4:h=t[n+1],r=t[n+2],o=t[n+3],128==(192&h)&&128==(192&r)&&128==(192&o)&&(a=(15&c)<<18|(63&h)<<12|(63&r)<<6|63&o)>65535&&a<1114112&&(l=a)} - null===l?(l=65533,u=1):l>65535&&(l-=65536,e.push(l>>>10&1023|55296),l=56320|1023&l),e.push(l),n+=u} - return function(t){ - var i=t.length; - if(i<=btt)return String.fromCharCode.apply(String,t); - for(var s="",e=0; - e<i; - )s+=String.fromCharCode.apply(String,t.slice(e,e+=btt)); - return s} - (e)} - Qt(Z9,"S$1"),Qt(ttt,"_"),Qt(itt,"C"),Qt(stt,"k"),Qt(ett,"A"),Qt(ntt,"x"),Qt(htt,"M"),Qt(rtt,"I"),Qt(ott,"T$1"),Qt(att,"R"),Qt(ctt,"P"),Qt(ltt,"O"),Qt(utt,"N"),Qt(dtt,"L"),Qt(ftt,"D"),Qt(ptt,"$"),Qt(wtt,"B"),Qt(gtt,"K"),Qt(mtt,"j"),Qt(vtt,"U"),Qt(_tt,"H"),Qt(Mtt,"F$1"),itt.poolSize=8192,itt._augment=function(t){ - return t.__proto__=itt.prototype,t} - ,itt.from=function(t,i,s){ - return stt(null,t,i,s)} - ,itt.TYPED_ARRAY_SUPPORT&&(itt.prototype.__proto__=Uint8Array.prototype,itt.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&itt[Symbol.species]),itt.alloc=function(t,i,s){ - return function(t,i,s,e){ - return ett(i),i<=0?ttt(t,i):void 0!==s?"string"==typeof e?ttt(t,i).fill(s,e):ttt(t,i).fill(s):ttt(t,i)} - (null,t,i,s)} - ,itt.allocUnsafe=function(t){ - return ntt(null,t)} - ,itt.allocUnsafeSlow=function(t){ - return ntt(null,t)} - ,itt.isBuffer=Btt,itt.compare=function(t,i){ - if(!ott(t)||!ott(i))throw new TypeError("Arguments must be Buffers"); - if(t===i)return 0; - for(var s=t.length,e=i.length,n=0,h=Math.min(s,e); - n<h; - ++n)if(t[n]!==i[n]){ - s=t[n],e=i[n]; - break} - return s<e?-1:e<s?1:0} - ,itt.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} - } - ,itt.concat=function(t,i){ - if(!J9(t))throw new TypeError('"list" argument must be an Array of Buffers'); - if(0===t.length)return itt.alloc(0); - var s; - if(void 0===i)for(i=0,s=0; - s<t.length; - ++s)i+=t[s].length; - var e=itt.allocUnsafe(i),n=0; - for(s=0; - s<t.length; - ++s){ - var h=t[s]; - if(!ott(h))throw new TypeError('"list" argument must be an Array of Buffers'); - h.copy(e,n),n+=h.length} - return e} - ,itt.byteLength=att,itt.prototype._isBuffer=!0,itt.prototype.swap16=function(){ - var t=this.length; - if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits"); - for(var i=0; - i<t; - i+=2)ltt(this,i,i+1); - return this} - ,itt.prototype.swap32=function(){ - var t=this.length; - if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits"); - for(var i=0; - i<t; - i+=4)ltt(this,i,i+3),ltt(this,i+1,i+2); - return this} - ,itt.prototype.swap64=function(){ - var t=this.length; - if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits"); - for(var i=0; - i<t; - i+=8)ltt(this,i,i+7),ltt(this,i+1,i+6),ltt(this,i+2,i+5),ltt(this,i+3,i+4); - return this} - ,itt.prototype.toString=function(){ - var t=0|this.length; - return 0===t?"":0===arguments.length?Mtt(this,0,t):ctt.apply(this,arguments)} - ,itt.prototype.equals=function(t){ - if(!ott(t))throw new TypeError("Argument must be a Buffer"); - return this===t||0===itt.compare(this,t)} - ,itt.prototype.inspect=function(){ - var t=""; - return this.length>0&&(t=this.toString("hex",0,50).match(/.{ - 2} - /g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"} - ,itt.prototype.compare=function(t,i,s,e,n){ - if(!ott(t))throw new TypeError("Argument must be a Buffer"); - if(void 0===i&&(i=0),void 0===s&&(s=t?t.length:0),void 0===e&&(e=0),void 0===n&&(n=this.length),i<0||s>t.length||e<0||n>this.length)throw new RangeError("out of range index"); - if(e>=n&&i>=s)return 0; - if(e>=n)return-1; - if(i>=s)return 1; - if(this===t)return 0; - for(var h=(n>>>=0)-(e>>>=0),r=(s>>>=0)-(i>>>=0),o=Math.min(h,r),a=this.slice(e,n),c=t.slice(i,s),l=0; - l<o; - ++l)if(a[l]!==c[l]){ - h=a[l],r=c[l]; - break} - return h<r?-1:r<h?1:0} - ,itt.prototype.includes=function(t,i,s){ - return-1!==this.indexOf(t,i,s)} - ,itt.prototype.indexOf=function(t,i,s){ - return utt(this,t,i,s,!0)} - ,itt.prototype.lastIndexOf=function(t,i,s){ - return utt(this,t,i,s,!1)} - ,itt.prototype.write=function(t,i,s,e){ - if(void 0===i)e="utf8",s=this.length,i=0; - else if(void 0===s&&"string"==typeof i)e=i,s=this.length,i=0; - else{ - if(!isFinite(i))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported"); - i|=0,isFinite(s)?(s|=0,void 0===e&&(e="utf8")):(e=s,s=void 0)} - var n=this.length-i; - if((void 0===s||s>n)&&(s=n),t.length>0&&(s<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds"); - e||(e="utf8"); - for(var h=!1; - ; - )switch(e){ - case"hex":return ftt(this,t,i,s); - case"utf8":case"utf-8":return ptt(this,t,i,s); - case"ascii":return wtt(this,t,i,s); - case"latin1":case"binary":return gtt(this,t,i,s); - case"base64":return mtt(this,t,i,s); - case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vtt(this,t,i,s); - default:if(h)throw new TypeError("Unknown encoding: "+e); - e=(""+e).toLowerCase(),h=!0} - } - ,itt.prototype.toJSON=function(){ - return{ - type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)} - } - ; - var btt=4096; - function ytt(t,i,s){ - var e=""; - s=Math.min(t.length,s); - for(var n=i; - n<s; - ++n)e+=String.fromCharCode(127&t[n]); - return e} - function Ett(t,i,s){ - var e=""; - s=Math.min(t.length,s); - for(var n=i; - n<s; - ++n)e+=String.fromCharCode(t[n]); - return e} - function Att(t,i,s){ - var e=t.length; - (!i||i<0)&&(i=0),(!s||s<0||s>e)&&(s=e); - for(var n="",h=i; - h<s; - ++h)n+=Ntt(t[h]); - return n} - function Stt(t,i,s){ - for(var e=t.slice(i,s),n="",h=0; - h<e.length; - h+=2)n+=String.fromCharCode(e[h]+256*e[h+1]); - return n} - function Ttt(t,i,s){ - if(t%1!=0||t<0)throw new RangeError("offset is not uint"); - if(t+i>s)throw new RangeError("Trying to access beyond buffer length")} - function Ctt(t,i,s,e,n,h){ - if(!ott(t))throw new TypeError('"buffer" argument must be a Buffer instance'); - if(i>n||i<h)throw new RangeError('"value" argument is out of bounds'); - if(s+e>t.length)throw new RangeError("Index out of range")} - function Ott(t,i,s,e){ - i<0&&(i=65535+i+1); - for(var n=0,h=Math.min(t.length-s,2); - n<h; - ++n)t[s+n]=(i&255<<8*(e?n:1-n))>>>8*(e?n:1-n)} - function Itt(t,i,s,e){ - i<0&&(i=4294967295+i+1); - for(var n=0,h=Math.min(t.length-s,4); - n<h; - ++n)t[s+n]=i>>>8*(e?n:3-n)&255} - function ktt(t,i,s,e,n,h){ - if(s+e>t.length)throw new RangeError("Index out of range"); - if(s<0)throw new RangeError("Index out of range")} - function xtt(t,i,s,e,n){ - return n||ktt(t,0,s,4),q9(t,i,s,e,23,4),s+4} - function Rtt(t,i,s,e,n){ - return n||ktt(t,0,s,8),q9(t,i,s,e,52,8),s+8} - Qt(ytt,"q"),Qt(Ett,"W$a"),Qt(Att,"V"),Qt(Stt,"G"),Qt(Ttt,"Y"),Qt(Ctt,"Z"),Qt(Ott,"J"),Qt(Itt,"Q"),Qt(ktt,"X"),Qt(xtt,"ee"),Qt(Rtt,"te"),itt.prototype.slice=function(t,i){ - var s,e=this.length; - if((t=~~t)<0?(t+=e)<0&&(t=0):t>e&&(t=e),(i=void 0===i?e:~~i)<0?(i+=e)<0&&(i=0):i>e&&(i=e),i<t&&(i=t),itt.TYPED_ARRAY_SUPPORT)(s=this.subarray(t,i)).__proto__=itt.prototype; - else{ - var n=i-t; - s=new itt(n,void 0); - for(var h=0; - h<n; - ++h)s[h]=this[h+t]} - return s} - ,itt.prototype.readUIntLE=function(t,i,s){ - t|=0,i|=0,s||Ttt(t,i,this.length); - for(var e=this[t],n=1,h=0; - ++h<i&&(n*=256); - )e+=this[t+h]*n; - return e} - ,itt.prototype.readUIntBE=function(t,i,s){ - t|=0,i|=0,s||Ttt(t,i,this.length); - for(var e=this[t+--i],n=1; - i>0&&(n*=256); - )e+=this[t+--i]*n; - return e} - ,itt.prototype.readUInt8=function(t,i){ - return i||Ttt(t,1,this.length),this[t]} - ,itt.prototype.readUInt16LE=function(t,i){ - return i||Ttt(t,2,this.length),this[t]|this[t+1]<<8} - ,itt.prototype.readUInt16BE=function(t,i){ - return i||Ttt(t,2,this.length),this[t]<<8|this[t+1]} - ,itt.prototype.readUInt32LE=function(t,i){ - return i||Ttt(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]} - ,itt.prototype.readUInt32BE=function(t,i){ - return i||Ttt(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])} - ,itt.prototype.readIntLE=function(t,i,s){ - t|=0,i|=0,s||Ttt(t,i,this.length); - for(var e=this[t],n=1,h=0; - ++h<i&&(n*=256); - )e+=this[t+h]*n; - return e>=(n*=128)&&(e-=Math.pow(2,8*i)),e} - ,itt.prototype.readIntBE=function(t,i,s){ - t|=0,i|=0,s||Ttt(t,i,this.length); - for(var e=i,n=1,h=this[t+--e]; - e>0&&(n*=256); - )h+=this[t+--e]*n; - return h>=(n*=128)&&(h-=Math.pow(2,8*i)),h} - ,itt.prototype.readInt8=function(t,i){ - return i||Ttt(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]} - ,itt.prototype.readInt16LE=function(t,i){ - i||Ttt(t,2,this.length); - var s=this[t]|this[t+1]<<8; - return 32768&s?4294901760|s:s} - ,itt.prototype.readInt16BE=function(t,i){ - i||Ttt(t,2,this.length); - var s=this[t+1]|this[t]<<8; - return 32768&s?4294901760|s:s} - ,itt.prototype.readInt32LE=function(t,i){ - return i||Ttt(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24} - ,itt.prototype.readInt32BE=function(t,i){ - return i||Ttt(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]} - ,itt.prototype.readFloatLE=function(t,i){ - return i||Ttt(t,4,this.length),Y9(this,t,!0,23,4)} - ,itt.prototype.readFloatBE=function(t,i){ - return i||Ttt(t,4,this.length),Y9(this,t,!1,23,4)} - ,itt.prototype.readDoubleLE=function(t,i){ - return i||Ttt(t,8,this.length),Y9(this,t,!0,52,8)} - ,itt.prototype.readDoubleBE=function(t,i){ - return i||Ttt(t,8,this.length),Y9(this,t,!1,52,8)} - ,itt.prototype.writeUIntLE=function(t,i,s,e){ - t=+t,i|=0,s|=0,e||Ctt(this,t,i,s,Math.pow(2,8*s)-1,0); - var n=1,h=0; - for(this[i]=255&t; - ++h<s&&(n*=256); - )this[i+h]=t/n&255; - return i+s} - ,itt.prototype.writeUIntBE=function(t,i,s,e){ - t=+t,i|=0,s|=0,e||Ctt(this,t,i,s,Math.pow(2,8*s)-1,0); - var n=s-1,h=1; - for(this[i+n]=255&t; - --n>=0&&(h*=256); - )this[i+n]=t/h&255; - return i+s} - ,itt.prototype.writeUInt8=function(t,i,s){ - return t=+t,i|=0,s||Ctt(this,t,i,1,255,0),itt.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[i]=255&t,i+1} - ,itt.prototype.writeUInt16LE=function(t,i,s){ - return t=+t,i|=0,s||Ctt(this,t,i,2,65535,0),itt.TYPED_ARRAY_SUPPORT?(this[i]=255&t,this[i+1]=t>>>8):Ott(this,t,i,!0),i+2} - ,itt.prototype.writeUInt16BE=function(t,i,s){ - return t=+t,i|=0,s||Ctt(this,t,i,2,65535,0),itt.TYPED_ARRAY_SUPPORT?(this[i]=t>>>8,this[i+1]=255&t):Ott(this,t,i,!1),i+2} - ,itt.prototype.writeUInt32LE=function(t,i,s){ - return t=+t,i|=0,s||Ctt(this,t,i,4,4294967295,0),itt.TYPED_ARRAY_SUPPORT?(this[i+3]=t>>>24,this[i+2]=t>>>16,this[i+1]=t>>>8,this[i]=255&t):Itt(this,t,i,!0),i+4} - ,itt.prototype.writeUInt32BE=function(t,i,s){ - return t=+t,i|=0,s||Ctt(this,t,i,4,4294967295,0),itt.TYPED_ARRAY_SUPPORT?(this[i]=t>>>24,this[i+1]=t>>>16,this[i+2]=t>>>8,this[i+3]=255&t):Itt(this,t,i,!1),i+4} - ,itt.prototype.writeIntLE=function(t,i,s,e){ - if(t=+t,i|=0,!e){ - var n=Math.pow(2,8*s-1); - Ctt(this,t,i,s,n-1,-n)} - var h=0,r=1,o=0; - for(this[i]=255&t; - ++h<s&&(r*=256); - )t<0&&0===o&&0!==this[i+h-1]&&(o=1),this[i+h]=(t/r|0)-o&255; - return i+s} - ,itt.prototype.writeIntBE=function(t,i,s,e){ - if(t=+t,i|=0,!e){ - var n=Math.pow(2,8*s-1); - Ctt(this,t,i,s,n-1,-n)} - var h=s-1,r=1,o=0; - for(this[i+h]=255&t; - --h>=0&&(r*=256); - )t<0&&0===o&&0!==this[i+h+1]&&(o=1),this[i+h]=(t/r|0)-o&255; - return i+s} - ,itt.prototype.writeInt8=function(t,i,s){ - return t=+t,i|=0,s||Ctt(this,t,i,1,127,-128),itt.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[i]=255&t,i+1} - ,itt.prototype.writeInt16LE=function(t,i,s){ - return t=+t,i|=0,s||Ctt(this,t,i,2,32767,-32768),itt.TYPED_ARRAY_SUPPORT?(this[i]=255&t,this[i+1]=t>>>8):Ott(this,t,i,!0),i+2} - ,itt.prototype.writeInt16BE=function(t,i,s){ - return t=+t,i|=0,s||Ctt(this,t,i,2,32767,-32768),itt.TYPED_ARRAY_SUPPORT?(this[i]=t>>>8,this[i+1]=255&t):Ott(this,t,i,!1),i+2} - ,itt.prototype.writeInt32LE=function(t,i,s){ - return t=+t,i|=0,s||Ctt(this,t,i,4,2147483647,-2147483648),itt.TYPED_ARRAY_SUPPORT?(this[i]=255&t,this[i+1]=t>>>8,this[i+2]=t>>>16,this[i+3]=t>>>24):Itt(this,t,i,!0),i+4} - ,itt.prototype.writeInt32BE=function(t,i,s){ - return t=+t,i|=0,s||Ctt(this,t,i,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),itt.TYPED_ARRAY_SUPPORT?(this[i]=t>>>24,this[i+1]=t>>>16,this[i+2]=t>>>8,this[i+3]=255&t):Itt(this,t,i,!1),i+4} - ,itt.prototype.writeFloatLE=function(t,i,s){ - return xtt(this,t,i,!0,s)} - ,itt.prototype.writeFloatBE=function(t,i,s){ - return xtt(this,t,i,!1,s)} - ,itt.prototype.writeDoubleLE=function(t,i,s){ - return Rtt(this,t,i,!0,s)} - ,itt.prototype.writeDoubleBE=function(t,i,s){ - return Rtt(this,t,i,!1,s)} - ,itt.prototype.copy=function(t,i,s,e){ - if(s||(s=0),e||0===e||(e=this.length),i>=t.length&&(i=t.length),i||(i=0),e>0&&e<s&&(e=s),e===s)return 0; - if(0===t.length||0===this.length)return 0; - if(i<0)throw new RangeError("targetStart out of bounds"); - if(s<0||s>=this.length)throw new RangeError("sourceStart out of bounds"); - if(e<0)throw new RangeError("sourceEnd out of bounds"); - e>this.length&&(e=this.length),t.length-i<e-s&&(e=t.length-i+s); - var n,h=e-s; - if(this===t&&s<i&&i<e)for(n=h-1; - n>=0; - --n)t[n+i]=this[n+s]; - else if(h<1e3||!itt.TYPED_ARRAY_SUPPORT)for(n=0; - n<h; - ++n)t[n+i]=this[n+s]; - else Uint8Array.prototype.set.call(t,this.subarray(s,s+h),i); - return h} - ,itt.prototype.fill=function(t,i,s,e){ - if("string"==typeof t){ - if("string"==typeof i?(e=i,i=0,s=this.length):"string"==typeof s&&(e=s,s=this.length),1===t.length){ - var n=t.charCodeAt(0); - n<256&&(t=n)} - if(void 0!==e&&"string"!=typeof e)throw new TypeError("encoding must be a string"); - if("string"==typeof e&&!itt.isEncoding(e))throw new TypeError("Unknown encoding: "+e)} - else"number"==typeof t&&(t&=255); - if(i<0||this.length<i||this.length<s)throw new RangeError("Out of range index"); - if(s<=i)return this; - var h; - if(i>>>=0,s=void 0===s?this.length:s>>>0,t||(t=0),"number"==typeof t)for(h=i; - h<s; - ++h)this[h]=t; - else{ - var r=ott(t)?t:Ltt(new itt(t,e).toString()),o=r.length; - for(h=0; - h<s-i; - ++h)this[h+i]=r[h%o]} - return this} - ; - var Ptt=/[^+\/0-9A-Za-z-_]/g; - function Ntt(t){ - return t<16?"0"+t.toString(16):t.toString(16)} - function Ltt(t,i){ - var s; - i=i||1/0; - for(var e=t.length,n=null,h=[],r=0; - r<e; - ++r){ - if((s=t.charCodeAt(r))>55295&&s<57344){ - if(!n){ - if(s>56319){ - (i-=3)>-1&&h.push(239,191,189); - continue} - if(r+1===e){ - (i-=3)>-1&&h.push(239,191,189); - continue} - n=s; - continue} - if(s<56320){ - (i-=3)>-1&&h.push(239,191,189),n=s; - continue} - s=65536+(n-55296<<10|s-56320)} - else n&&(i-=3)>-1&&h.push(239,191,189); - if(n=null,s<128){ - if((i-=1)<0)break; - h.push(s)} - else if(s<2048){ - if((i-=2)<0)break; - h.push(s>>6|192,63&s|128)} - else if(s<65536){ - if((i-=3)<0)break; - h.push(s>>12|224,s>>6&63|128,63&s|128)} - else{ - if(!(s<1114112))throw new Error("Invalid code point"); - if((i-=4)<0)break; - h.push(s>>18|240,s>>12&63|128,s>>6&63|128,63&s|128)} - } - return h} - function Dtt(t){ - return function(t){ - var i,s,e,n,h,r; - V9||j9(); - var o=t.length; - if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4"); - h="="===t[o-2]?2:"="===t[o-1]?1:0,r=new W9(3*o/4-h),e=h>0?o-4:o; - var a=0; - for(i=0,s=0; - i<e; - i+=4,s+=3)n=H9[t.charCodeAt(i)]<<18|H9[t.charCodeAt(i+1)]<<12|H9[t.charCodeAt(i+2)]<<6|H9[t.charCodeAt(i+3)],r[a++]=n>>16&255,r[a++]=n>>8&255,r[a++]=255&n; - return 2===h?(n=H9[t.charCodeAt(i)]<<2|H9[t.charCodeAt(i+1)]>>4,r[a++]=255&n):1===h&&(n=H9[t.charCodeAt(i)]<<10|H9[t.charCodeAt(i+1)]<<4|H9[t.charCodeAt(i+2)]>>2,r[a++]=n>>8&255,r[a++]=255&n),r} - (function(t){ - if((t=(i=t,i.trim?i.trim():i.replace(/^\s+|\s+$/g,"")).replace(Ptt,"")).length<2)return""; - for(var i; - t.length%4!=0; - )t+="="; - return t} - (t))} - function Gtt(t,i,s,e){ - for(var n=0; - n<e&&!(n+s>=i.length||n>=t.length); - ++n)i[n+s]=t[n]; - return n} - function Btt(t){ - return null!=t&&(!!t._isBuffer||Utt(t)||"function"==typeof(i=t).readFloatLE&&"function"==typeof i.slice&&Utt(i.slice(0,0))); - var i} - function Utt(t){ - return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)} - Qt(Ntt,"re"),Qt(Ltt,"ie"),Qt(Dtt,"oe"),Qt(Gtt,"se"),Qt(Btt,"ae"),Qt(Utt,"ce"); - var Ftt=Object.freeze({ - __proto__:null,Buffer:itt,INSPECT_MAX_BYTES:50,SlowBuffer:Qt(function(t){ - return+t!=t&&(t=0),itt.alloc(+t)} - ,"SlowBuffer"),isBuffer:Btt,kMaxLength:Q9} - ),$tt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{ - } - ; - function Htt(t){ - return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t} - function Wtt(t){ - if(t.__esModule)return t; - var i=t.default; - if("function"==typeof i){ - var s=Qt(function t(){ - return this instanceof t?Reflect.construct(i,arguments,this.constructor):i.apply(this,arguments)} - ,"e"); - s.prototype=i.prototype} - else s={ - } - ; - return Object.defineProperty(s,"__esModule",{ - value:!0} - ),Object.keys(t).forEach(function(i){ - var e=Object.getOwnPropertyDescriptor(t,i); - Object.defineProperty(s,i,e.get?e:{ - enumerable:!0,get:Qt(function(){ - return t[i]} - ,"get")} - )} - ),s} - Qt(Htt,"ue"),Qt(Wtt,"he"); - var Vtt={ - } - ,jtt={ - } - ,Ktt={ - } - ; - function ztt(t){ - if(!Number.isSafeInteger(t)||t<0)throw new Error(`positive integer expected, not ${ - t} - `)} - function Ytt(t){ - if("boolean"!=typeof t)throw new Error(`boolean expected, not ${ - t} - `)} - function qtt(t){ - return t instanceof Uint8Array||null!=t&&"object"==typeof t&&"Uint8Array"===t.constructor.name} - function Xtt(t,...i){ - if(!qtt(t))throw new Error("Uint8Array expected"); - if(i.length>0&&!i.includes(t.length))throw new Error(`Uint8Array expected of length ${ - i} - , not of length=${ - t.length} - `)} - function Jtt(t){ - if("function"!=typeof t||"function"!=typeof t.create)throw new Error("hash must be wrapped by utils.wrapConstructor"); - ztt(t.outputLen),ztt(t.blockLen)} - function Qtt(t,i=!0){ - if(t.destroyed)throw new Error("Hash instance has been destroyed"); - if(i&&t.finished)throw new Error("Hash#digest() has already been called")} - function Ztt(t,i){ - Xtt(t); - const s=i.outputLen; - if(t.length<s)throw new Error(`digestInto() expects output buffer of length at least ${ - s} - `)} - Qt(ztt,"me"),Qt(Ytt,"ye"),Qt(qtt,"ve"),Qt(Xtt,"be"),Qt(Jtt,"we"),Qt(Qtt,"Ee"),Qt(Ztt,"Se"),Object.defineProperty(Ktt,"__esModule",{ - value:!0} - ),Ktt.isBytes=qtt,Ktt.number=ztt,Ktt.bool=Ytt,Ktt.bytes=Xtt,Ktt.hash=Jtt,Ktt.exists=Qtt,Ktt.output=Ztt; - const tit={ - number:ztt,bool:Ytt,bytes:Xtt,hash:Jtt,exists:Qtt,output:Ztt} - ; - Ktt.default=tit,function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.wrapCipher=t.Hash=t.nextTick=t.isLE=t.createView=t.u32=t.u16=t.u8=void 0,t.bytesToHex=e,t.hexToBytes=r,t.hexToNumber=o,t.bytesToNumberBE=function(t){ - return o(e(t))} - ,t.numberToBytesBE=function(t,i){ - return r(t.toString(16).padStart(2*i,"0"))} - ,t.asyncLoop=async function(i,s,e){ - let n=Date.now(); - for(let h=0; - h<i; - h++){ - e(h); - const i=Date.now()-n; - i>=0&&i<s||(await(0,t.nextTick)(),n+=i)} - } - ,t.utf8ToBytes=a,t.bytesToUtf8=function(t){ - return(new TextDecoder).decode(t)} - ,t.toBytes=function(t){ - if("string"==typeof t)t=a(t); - else{ - if(!(0,i.isBytes)(t))throw new Error("Uint8Array expected, got "+typeof t); - t=l(t)} - return t} - ,t.concatBytes=function(...t){ - let s=0; - for(let n=0; - n<t.length; - n++){ - const e=t[n]; - (0,i.bytes)(e),s+=e.length} - const e=new Uint8Array(s); - for(let i=0,n=0; - i<t.length; - i++){ - const s=t[i]; - e.set(s,n),n+=s.length} - return e} - ,t.checkOpts=function(t,i){ - if(null==i||"object"!=typeof i)throw new Error("options must be defined"); - return Object.assign(t,i)} - ,t.equalBytes=function(t,i){ - if(t.length!==i.length)return!1; - let s=0; - for(let e=0; - e<t.length; - e++)s|=t[e]^i[e]; - return 0===s} - ,t.setBigUint64=c,t.u64Lengths=function(i,s){ - const e=new Uint8Array(16),n=(0,t.createView)(e); - return c(n,0,BigInt(s?s.length:0),!0),c(n,8,BigInt(i.length),!0),e} - ,t.isAligned32=function(t){ - return t.byteOffset%4==0} - ,t.copyBytes=l,t.clean=function(...t){ - for(let i=0; - i<t.length; - i++)t[i].fill(0)} - ; - const i=Ktt; - if(t.u8=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),t.u16=t=>new Uint16Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/2)),t.u32=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),t.createView=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported"); - const s=Array.from({ - length:256} - ,(t,i)=>i.toString(16).padStart(2,"0")); - function e(t){ - (0,i.bytes)(t); - let e=""; - for(let i=0; - i<t.length; - i++)e+=s[t[i]]; - return e} - Qt(e,"r"); - const n={ - _0:48,_9:57,_A:65,_F:70,_a:97,_f:102} - ; - function h(t){ - return t>=n._0&&t<=n._9?t-n._0:t>=n._A&&t<=n._F?t-(n._A-10):t>=n._a&&t<=n._f?t-(n._a-10):void 0} - function r(t){ - if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t); - const i=t.length,s=i/2; - if(i%2)throw new Error("padded hex string expected, got unpadded hex of length "+i); - const e=new Uint8Array(s); - for(let n=0,r=0; - n<s; - n++,r+=2){ - const i=h(t.charCodeAt(r)),s=h(t.charCodeAt(r+1)); - if(void 0===i||void 0===s){ - const i=t[r]+t[r+1]; - throw new Error('hex string expected, got non-hex character "'+i+'" at index '+r)} - e[n]=16*i+s} - return e} - function o(t){ - if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t); - return BigInt(""===t?"0":`0x${ - t} - `)} - function a(t){ - if("string"!=typeof t)throw new Error("string expected, got "+typeof t); - return new Uint8Array((new TextEncoder).encode(t))} - function c(t,i,s,e){ - if("function"==typeof t.setBigUint64)return t.setBigUint64(i,s,e); - const n=BigInt(32),h=BigInt(4294967295),r=Number(s>>n&h),o=Number(s&h),a=e?4:0,c=e?0:4; - t.setUint32(i+a,r,e),t.setUint32(i+c,o,e)} - function l(t){ - return Uint8Array.from(t)} - Qt(h,"o"),Qt(r,"s"),Qt(o,"a"),Qt(a,"c"),t.nextTick=async()=>{ - } - ,t.Hash=class{ - } - ,Qt(c,"l"),Qt(l,"d"),t.wrapCipher=(t,i)=>(Object.assign(i,t),i)} - (jtt); - var iit={ - } - ,sit={ - } - ; - Object.defineProperty(sit,"__esModule",{ - value:!0} - ),sit.AEAD_TAG_LENGTH=sit.XCHACHA20_NONCE_LENGTH=sit.CURVE25519_PUBLIC_KEY_SIZE=sit.ETH_PUBLIC_KEY_SIZE=sit.UNCOMPRESSED_PUBLIC_KEY_SIZE=sit.COMPRESSED_PUBLIC_KEY_SIZE=sit.SECRET_KEY_LENGTH=void 0,sit.SECRET_KEY_LENGTH=32,sit.COMPRESSED_PUBLIC_KEY_SIZE=33,sit.UNCOMPRESSED_PUBLIC_KEY_SIZE=65,sit.ETH_PUBLIC_KEY_SIZE=64,sit.CURVE25519_PUBLIC_KEY_SIZE=32,sit.XCHACHA20_NONCE_LENGTH=24,sit.AEAD_TAG_LENGTH=16,function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.ephemeralKeySize=t.symmetricNonceLength=t.symmetricAlgorithm=t.isHkdfKeyCompressed=t.isEphemeralKeyCompressed=t.ellipticCurve=t.ECIES_CONFIG=void 0; - var i=sit,s=Qt(function(){ - this.ellipticCurve="secp256k1",this.isEphemeralKeyCompressed=!1,this.isHkdfKeyCompressed=!1,this.symmetricAlgorithm="aes-256-gcm",this.symmetricNonceLength=16} - ,"n"); - t.ECIES_CONFIG=new s,t.ellipticCurve=function(){ - return t.ECIES_CONFIG.ellipticCurve} - ,t.isEphemeralKeyCompressed=function(){ - return t.ECIES_CONFIG.isEphemeralKeyCompressed} - ,t.isHkdfKeyCompressed=function(){ - return t.ECIES_CONFIG.isHkdfKeyCompressed} - ,t.symmetricAlgorithm=function(){ - return t.ECIES_CONFIG.symmetricAlgorithm} - ,t.symmetricNonceLength=function(){ - return t.ECIES_CONFIG.symmetricNonceLength} - ,t.ephemeralKeySize=function(){ - var s={ - secp256k1:t.ECIES_CONFIG.isEphemeralKeyCompressed?i.COMPRESSED_PUBLIC_KEY_SIZE:i.UNCOMPRESSED_PUBLIC_KEY_SIZE,x25519:i.CURVE25519_PUBLIC_KEY_SIZE,ed25519:i.CURVE25519_PUBLIC_KEY_SIZE} - ; - if(t.ECIES_CONFIG.ellipticCurve in s)return s[t.ECIES_CONFIG.ellipticCurve]; - throw new Error("Not implemented")} - } - (iit); - var eit={ - } - ,nit={ - } - ,hit={ - } - ,rit={ - } - ,oit={ - } - ,ait={ - } - ; - Object.defineProperty(ait,"__esModule",{ - value:!0} - ),ait.crypto=void 0,ait.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.gcm=t.ctr=t.cbc=t.utils=void 0,t.randomBytes=n,t.getWebcryptoSubtle=h,t.managedNonce=function(t){ - return(0,s.number)(t.nonceLength),(i,...s)=>({ - encrypt(h,...r){ - const{ - nonceLength:o} - =t,a=n(o),c=t(i,a,...s).encrypt(h,...r),l=(0,e.concatBytes)(a,c); - return c.fill(0),l} - ,decrypt(e,...n){ - const{ - nonceLength:h} - =t,r=e.subarray(0,h),o=e.subarray(h); - return t(i,r,...s).decrypt(o,...n)} - } - )} - ; - const i=ait,s=Ktt,e=jtt; - function n(t=32){ - if(i.crypto&&"function"==typeof i.crypto.getRandomValues)return i.crypto.getRandomValues(new Uint8Array(t)); - if(i.crypto&&"function"==typeof i.crypto.randomBytes)return i.crypto.randomBytes(t); - throw new Error("crypto.getRandomValues must be defined")} - function h(){ - if(i.crypto&&"object"==typeof i.crypto.subtle&&null!=i.crypto.subtle)return i.crypto.subtle; - throw new Error("crypto.subtle must be defined")} - Qt(n,"i"),Qt(h,"o"),t.utils={ - async encrypt(t,i,s,e){ - const n=h(),r=await n.importKey("raw",t,i,!0,["encrypt"]),o=await n.encrypt(s,r,e); - return new Uint8Array(o)} - ,async decrypt(t,i,s,e){ - const n=h(),r=await n.importKey("raw",t,i,!0,["decrypt"]),o=await n.decrypt(s,r,e); - return new Uint8Array(o)} - } - ; - const r="AES-CBC",o="AES-CTR",a="AES-GCM"; - function c(i){ - return(e,n,h)=>{ - (0,s.bytes)(e),(0,s.bytes)(n); - const c={ - name:i,length:8*e.length} - ,l=function(t,i,s){ - if(t===r)return{ - name:r,iv:i} - ; - if(t===o)return{ - name:o,counter:i,length:64} - ; - if(t===a)return s?{ - name:a,iv:i,additionalData:s} - :{ - name:a,iv:i} - ; - throw new Error("unknown aes block mode")} - (i,n,h); - return{ - encrypt:Qt(i=>((0,s.bytes)(i),t.utils.encrypt(e,c,l,i)),"encrypt"),decrypt:Qt(i=>((0,s.bytes)(i),t.utils.decrypt(e,c,l,i)),"decrypt")} - } - } - Qt(c,"a"),t.cbc=c(r),t.ctr=c(o),t.gcm=c(a)} - (oit); - var cit={ - } - ,lit={ - } - ,uit={ - } - ,dit={ - } - ; - function fit(t){ - if(!Number.isSafeInteger(t)||t<0)throw new Error(`positive integer expected, not ${ - t} - `)} - function pit(t){ - if("boolean"!=typeof t)throw new Error(`boolean expected, not ${ - t} - `)} - function wit(t){ - return t instanceof Uint8Array||null!=t&&"object"==typeof t&&"Uint8Array"===t.constructor.name} - function git(t,...i){ - if(!wit(t))throw new Error("Uint8Array expected"); - if(i.length>0&&!i.includes(t.length))throw new Error(`Uint8Array expected of length ${ - i} - , not of length=${ - t.length} - `)} - function mit(t){ - if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.wrapConstructor"); - fit(t.outputLen),fit(t.blockLen)} - function vit(t,i=!0){ - if(t.destroyed)throw new Error("Hash instance has been destroyed"); - if(i&&t.finished)throw new Error("Hash#digest() has already been called")} - function _it(t,i){ - git(t); - const s=i.outputLen; - if(t.length<s)throw new Error(`digestInto() expects output buffer of length at least ${ - s} - `)} - Qt(fit,"De"),Qt(pit,"$e"),Qt(wit,"Be"),Qt(git,"Ke"),Qt(mit,"je"),Qt(vit,"Ue"),Qt(_it,"He"),Object.defineProperty(dit,"__esModule",{ - value:!0} - ),dit.isBytes=wit,dit.number=fit,dit.bool=pit,dit.bytes=git,dit.hash=mit,dit.exists=vit,dit.output=_it; - const Mit={ - number:fit,bool:pit,bytes:git,hash:mit,exists:vit,output:_it} - ; - dit.default=Mit; - var bit={ - } - ,yit={ - } - ; - Object.defineProperty(yit,"__esModule",{ - value:!0} - ),yit.crypto=void 0,yit.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.Hash=t.nextTick=t.byteSwapIfBE=t.byteSwap=t.isLE=t.rotl=t.rotr=t.createView=t.u32=t.u8=void 0,t.isBytes=function(t){ - return t instanceof Uint8Array||null!=t&&"object"==typeof t&&"Uint8Array"===t.constructor.name} - ,t.byteSwap32=function(i){ - for(let s=0; - s<i.length; - s++)i[s]=(0,t.byteSwap)(i[s])} - ,t.bytesToHex=function(t){ - (0,s.bytes)(t); - let i=""; - for(let s=0; - s<t.length; - s++)i+=e[t[s]]; - return i} - ,t.hexToBytes=function(t){ - if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t); - const i=t.length,s=i/2; - if(i%2)throw new Error("padded hex string expected, got unpadded hex of length "+i); - const e=new Uint8Array(s); - for(let n=0,r=0; - n<s; - n++,r+=2){ - const i=h(t.charCodeAt(r)),s=h(t.charCodeAt(r+1)); - if(void 0===i||void 0===s){ - const i=t[r]+t[r+1]; - throw new Error('hex string expected, got non-hex character "'+i+'" at index '+r)} - e[n]=16*i+s} - return e} - ,t.asyncLoop=async function(i,s,e){ - let n=Date.now(); - for(let h=0; - h<i; - h++){ - e(h); - const i=Date.now()-n; - i>=0&&i<s||(await(0,t.nextTick)(),n+=i)} - } - ,t.utf8ToBytes=r,t.toBytes=o,t.concatBytes=function(...t){ - let i=0; - for(let n=0; - n<t.length; - n++){ - const e=t[n]; - (0,s.bytes)(e),i+=e.length} - const e=new Uint8Array(i); - for(let s=0,n=0; - s<t.length; - s++){ - const i=t[s]; - e.set(i,n),n+=i.length} - return e} - ,t.checkOpts=function(t,i){ - if(void 0!==i&&"[object Object]"!==a.call(i))throw new Error("Options should be object or undefined"); - return Object.assign(t,i)} - ,t.wrapConstructor=function(t){ - const i=Qt(i=>t().update(o(i)).digest(),"t"),s=t(); - return i.outputLen=s.outputLen,i.blockLen=s.blockLen,i.create=()=>t(),i} - ,t.wrapConstructorWithOpts=function(t){ - const i=Qt((i,s)=>t(s).update(o(i)).digest(),"t"),s=t({ - } - ); - return i.outputLen=s.outputLen,i.blockLen=s.blockLen,i.create=i=>t(i),i} - ,t.wrapXOFConstructorWithOpts=function(t){ - const i=Qt((i,s)=>t(s).update(o(i)).digest(),"t"),s=t({ - } - ); - return i.outputLen=s.outputLen,i.blockLen=s.blockLen,i.create=i=>t(i),i} - ,t.randomBytes=function(t=32){ - if(i.crypto&&"function"==typeof i.crypto.getRandomValues)return i.crypto.getRandomValues(new Uint8Array(t)); - if(i.crypto&&"function"==typeof i.crypto.randomBytes)return i.crypto.randomBytes(t); - throw new Error("crypto.getRandomValues must be defined")} - ; - const i=yit,s=dit; - t.u8=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),t.u32=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),t.createView=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),t.rotr=(t,i)=>t<<32-i|t>>>i,t.rotl=(t,i)=>t<<i|t>>>32-i>>>0,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],t.byteSwap=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255,t.byteSwapIfBE=t.isLE?t=>t:i=>(0,t.byteSwap)(i); - const e=Array.from({ - length:256} - ,(t,i)=>i.toString(16).padStart(2,"0")),n={ - _0:48,_9:57,_A:65,_F:70,_a:97,_f:102} - ; - function h(t){ - return t>=n._0&&t<=n._9?t-n._0:t>=n._A&&t<=n._F?t-(n._A-10):t>=n._a&&t<=n._f?t-(n._a-10):void 0} - function r(t){ - if("string"!=typeof t)throw new Error("utf8ToBytes expected string, got "+typeof t); - return new Uint8Array((new TextEncoder).encode(t))} - function o(t){ - return"string"==typeof t&&(t=r(t)),(0,s.bytes)(t),t} - Qt(h,"o"),Qt(r,"s"),Qt(o,"a"),t.nextTick=async()=>{ - } - ,t.Hash=class{ - clone(){ - return this._cloneInto()} - } - ; - const a={ - } - .toString} - (bit),Object.defineProperty(uit,"__esModule",{ - value:!0} - ),uit.HashMD=uit.Maj=uit.Chi=void 0; - const Eit=dit,Ait=bit; - uit.Chi=(t,i,s)=>t&i^~t&s,uit.Maj=(t,i,s)=>t&i^t&s^i&s,uit.HashMD=class extends Ait.Hash{ - constructor(t,i,s,e){ - super(),this.blockLen=t,this.outputLen=i,this.padOffset=s,this.isLE=e,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=(0,Ait.createView)(this.buffer)} - update(t){ - (0,Eit.exists)(this); - const{ - view:i,buffer:s,blockLen:e} - =this,n=(t=(0,Ait.toBytes)(t)).length; - for(let h=0; - h<n; - ){ - const r=Math.min(e-this.pos,n-h); - if(r!==e)s.set(t.subarray(h,h+r),this.pos),this.pos+=r,h+=r,this.pos===e&&(this.process(i,0),this.pos=0); - else{ - const i=(0,Ait.createView)(t); - for(; - e<=n-h; - h+=e)this.process(i,h)} - } - return this.length+=t.length,this.roundClean(),this} - digestInto(t){ - (0,Eit.exists)(this),(0,Eit.output)(t,this),this.finished=!0; - const{ - buffer:i,view:s,blockLen:e,isLE:n} - =this; - let{ - pos:h} - =this; - i[h++]=128,this.buffer.subarray(h).fill(0),this.padOffset>e-h&&(this.process(s,0),h=0); - for(let l=h; - l<e; - l++)i[l]=0; - !function(t,i,s,e){ - if("function"==typeof t.setBigUint64)return t.setBigUint64(i,s,e); - const n=BigInt(32),h=BigInt(4294967295),r=Number(s>>n&h),o=Number(s&h),a=e?4:0,c=e?0:4; - t.setUint32(i+a,r,e),t.setUint32(i+c,o,e)} - (s,e-8,BigInt(8*this.length),n),this.process(s,0); - const r=(0,Ait.createView)(t),o=this.outputLen; - if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit"); - const a=o/4,c=this.get(); - if(a>c.length)throw new Error("_sha2: outputLen bigger than state"); - for(let l=0; - l<a; - l++)r.setUint32(4*l,c[l],n)} - digest(){ - const{ - buffer:t,outputLen:i} - =this; - this.digestInto(t); - const s=t.slice(0,i); - return this.destroy(),s} - _cloneInto(t){ - t||(t=new this.constructor),t.set(...this.get()); - const{ - blockLen:i,buffer:s,length:e,finished:n,destroyed:h,pos:r} - =this; - return t.length=e,t.pos=r,t.finished=n,t.destroyed=h,e%i&&t.buffer.set(s),t} - } - ; - var Sit={ - } - ; - Object.defineProperty(Sit,"__esModule",{ - value:!0} - ),Sit.add5L=Sit.add5H=Sit.add4H=Sit.add4L=Sit.add3H=Sit.add3L=Sit.rotlBL=Sit.rotlBH=Sit.rotlSL=Sit.rotlSH=Sit.rotr32L=Sit.rotr32H=Sit.rotrBL=Sit.rotrBH=Sit.rotrSL=Sit.rotrSH=Sit.shrSL=Sit.shrSH=Sit.toBig=void 0,Sit.fromBig=Oit,Sit.split=Iit,Sit.add=Wit; - const Tit=BigInt(2**32-1),Cit=BigInt(32); - function Oit(t,i=!1){ - return i?{ - h:Number(t&Tit),l:Number(t>>Cit&Tit)} - :{ - h:0|Number(t>>Cit&Tit),l:0|Number(t&Tit)} - } - function Iit(t,i=!1){ - let s=new Uint32Array(t.length),e=new Uint32Array(t.length); - for(let n=0; - n<t.length; - n++){ - const{ - h,l:r} - =Oit(t[n],i); - [s[n],e[n]]=[h,r]} - return[s,e]} - Qt(Oit,"Je"),Qt(Iit,"Qe"); - const kit=Qt((t,i)=>BigInt(t>>>0)<<Cit|BigInt(i>>>0),"Xe"); - Sit.toBig=kit; - const xit=Qt((t,i,s)=>t>>>s,"et"); - Sit.shrSH=xit; - const Rit=Qt((t,i,s)=>t<<32-s|i>>>s,"tt"); - Sit.shrSL=Rit; - const Pit=Qt((t,i,s)=>t>>>s|i<<32-s,"nt"); - Sit.rotrSH=Pit; - const Nit=Qt((t,i,s)=>t<<32-s|i>>>s,"rt"); - Sit.rotrSL=Nit; - const Lit=Qt((t,i,s)=>t<<64-s|i>>>s-32,"it"); - Sit.rotrBH=Lit; - const Dit=Qt((t,i,s)=>t>>>s-32|i<<64-s,"ot"); - Sit.rotrBL=Dit; - const Git=Qt((t,i)=>i,"st"); - Sit.rotr32H=Git; - const Bit=Qt((t,i)=>t,"at$1"); - Sit.rotr32L=Bit; - const Uit=Qt((t,i,s)=>t<<s|i>>>32-s,"ct"); - Sit.rotlSH=Uit; - const Fit=Qt((t,i,s)=>i<<s|t>>>32-s,"lt"); - Sit.rotlSL=Fit; - const $it=Qt((t,i,s)=>i<<s-32|t>>>64-s,"dt"); - Sit.rotlBH=$it; - const Hit=Qt((t,i,s)=>t<<s-32|i>>>64-s,"ut"); - function Wit(t,i,s,e){ - const n=(i>>>0)+(e>>>0); - return{ - h:t+s+(n/2**32|0)|0,l:0|n} - } - Qt(Wit,"ht"),Sit.rotlBL=Hit; - const Vit=Qt((t,i,s)=>(t>>>0)+(i>>>0)+(s>>>0),"ft"); - Sit.add3L=Vit; - const jit=Qt((t,i,s,e)=>i+s+e+(t/2**32|0)|0,"pt"); - Sit.add3H=jit; - const Kit=Qt((t,i,s,e)=>(t>>>0)+(i>>>0)+(s>>>0)+(e>>>0),"gt"); - Sit.add4L=Kit; - const zit=Qt((t,i,s,e,n)=>i+s+e+n+(t/2**32|0)|0,"mt"); - Sit.add4H=zit; - const Yit=Qt((t,i,s,e,n)=>(t>>>0)+(i>>>0)+(s>>>0)+(e>>>0)+(n>>>0),"yt"); - Sit.add5L=Yit; - const qit=Qt((t,i,s,e,n,h)=>i+s+e+n+h+(t/2**32|0)|0,"vt"); - Sit.add5H=qit; - const Xit={ - fromBig:Oit,split:Iit,toBig:kit,shrSH:xit,shrSL:Rit,rotrSH:Pit,rotrSL:Nit,rotrBH:Lit,rotrBL:Dit,rotr32H:Git,rotr32L:Bit,rotlSH:Uit,rotlSL:Fit,rotlBH:$it,rotlBL:Hit,add:Wit,add3L:Vit,add3H:jit,add4L:Kit,add4H:zit,add5H:qit,add5L:Yit} - ; - Sit.default=Xit,Object.defineProperty(lit,"__esModule",{ - value:!0} - ),lit.sha384=lit.sha512_256=lit.sha512_224=lit.sha512=lit.SHA384=lit.SHA512_256=lit.SHA512_224=lit.SHA512=void 0; - const Jit=uit,Qit=Sit,Zit=bit,[tst,ist]=Qit.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),sst=new Uint32Array(80),est=new Uint32Array(80),nst=class extends Jit.HashMD{ - constructor(){ - super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209} - get(){ - const{ - Ah:t,Al:i,Bh:s,Bl:e,Ch:n,Cl:h,Dh:r,Dl:o,Eh:a,El:c,Fh:l,Fl:u,Gh:d,Gl:f,Hh:p,Hl:w} - =this; - return[t,i,s,e,n,h,r,o,a,c,l,u,d,f,p,w]} - set(t,i,s,e,n,h,r,o,a,c,l,u,d,f,p,w){ - this.Ah=0|t,this.Al=0|i,this.Bh=0|s,this.Bl=0|e,this.Ch=0|n,this.Cl=0|h,this.Dh=0|r,this.Dl=0|o,this.Eh=0|a,this.El=0|c,this.Fh=0|l,this.Fl=0|u,this.Gh=0|d,this.Gl=0|f,this.Hh=0|p,this.Hl=0|w} - process(t,i){ - for(let v=0; - v<16; - v++,i+=4)sst[v]=t.getUint32(i),est[v]=t.getUint32(i+=4); - for(let v=16; - v<80; - v++){ - const t=0|sst[v-15],i=0|est[v-15],s=Qit.default.rotrSH(t,i,1)^Qit.default.rotrSH(t,i,8)^Qit.default.shrSH(t,i,7),e=Qit.default.rotrSL(t,i,1)^Qit.default.rotrSL(t,i,8)^Qit.default.shrSL(t,i,7),n=0|sst[v-2],h=0|est[v-2],r=Qit.default.rotrSH(n,h,19)^Qit.default.rotrBH(n,h,61)^Qit.default.shrSH(n,h,6),o=Qit.default.rotrSL(n,h,19)^Qit.default.rotrBL(n,h,61)^Qit.default.shrSL(n,h,6),a=Qit.default.add4L(e,o,est[v-7],est[v-16]),c=Qit.default.add4H(a,s,r,sst[v-7],sst[v-16]); - sst[v]=0|c,est[v]=0|a} - let{ - Ah:s,Al:e,Bh:n,Bl:h,Ch:r,Cl:o,Dh:a,Dl:c,Eh:l,El:u,Fh:d,Fl:f,Gh:p,Gl:w,Hh:g,Hl:m} - =this; - for(let v=0; - v<80; - v++){ - const t=Qit.default.rotrSH(l,u,14)^Qit.default.rotrSH(l,u,18)^Qit.default.rotrBH(l,u,41),i=Qit.default.rotrSL(l,u,14)^Qit.default.rotrSL(l,u,18)^Qit.default.rotrBL(l,u,41),_=l&d^~l&p,M=u&f^~u&w,b=Qit.default.add5L(m,i,M,ist[v],est[v]),y=Qit.default.add5H(b,g,t,_,tst[v],sst[v]),E=0|b,A=Qit.default.rotrSH(s,e,28)^Qit.default.rotrBH(s,e,34)^Qit.default.rotrBH(s,e,39),S=Qit.default.rotrSL(s,e,28)^Qit.default.rotrBL(s,e,34)^Qit.default.rotrBL(s,e,39),T=s&n^s&r^n&r,C=e&h^e&o^h&o; - g=0|p,m=0|w,p=0|d,w=0|f,d=0|l,f=0|u,({ - h:l,l:u} - =Qit.default.add(0|a,0|c,0|y,0|E)),a=0|r,c=0|o,r=0|n,o=0|h,n=0|s,h=0|e; - const O=Qit.default.add3L(E,S,C); - s=Qit.default.add3H(O,y,A,T),e=0|O} - ({ - h:s,l:e} - =Qit.default.add(0|this.Ah,0|this.Al,0|s,0|e)),({ - h:n,l:h} - =Qit.default.add(0|this.Bh,0|this.Bl,0|n,0|h)),({ - h:r,l:o} - =Qit.default.add(0|this.Ch,0|this.Cl,0|r,0|o)),({ - h:a,l:c} - =Qit.default.add(0|this.Dh,0|this.Dl,0|a,0|c)),({ - h:l,l:u} - =Qit.default.add(0|this.Eh,0|this.El,0|l,0|u)),({ - h:d,l:f} - =Qit.default.add(0|this.Fh,0|this.Fl,0|d,0|f)),({ - h:p,l:w} - =Qit.default.add(0|this.Gh,0|this.Gl,0|p,0|w)),({ - h:g,l:m} - =Qit.default.add(0|this.Hh,0|this.Hl,0|g,0|m)),this.set(s,e,n,h,r,o,a,c,l,u,d,f,p,w,g,m)} - roundClean(){ - sst.fill(0),est.fill(0)} - destroy(){ - this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)} - } - ; - Qt(nst,"xt"); - let hst=nst; - lit.SHA512=hst; - const rst=class extends hst{ - constructor(){ - super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28} - } - ; - Qt(rst,"Mt"); - let ost=rst; - lit.SHA512_224=ost; - const ast=class extends hst{ - constructor(){ - super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32} - } - ; - Qt(ast,"It"); - let cst=ast; - lit.SHA512_256=cst; - const lst=class extends hst{ - constructor(){ - super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48} - } - ; - Qt(lst,"Tt"); - let ust=lst; - lit.SHA384=ust,lit.sha512=(0,Zit.wrapConstructor)(()=>new hst),lit.sha512_224=(0,Zit.wrapConstructor)(()=>new ost),lit.sha512_256=(0,Zit.wrapConstructor)(()=>new cst),lit.sha384=(0,Zit.wrapConstructor)(()=>new ust); - var dst={ - } - ,fst={ - } - ,pst={ - } - ,wst={ - } - ; - Object.defineProperty(wst,"__esModule",{ - value:!0} - ),wst.notImplemented=wst.bitMask=void 0,wst.isBytes=_st,wst.abytes=Mst,wst.abool=function(t,i){ - if("boolean"!=typeof i)throw new Error(`${ - t} - must be valid boolean, got "${ - i} - ".`)} - ,wst.bytesToHex=yst,wst.numberToHexUnpadded=Est,wst.hexToNumber=Ast,wst.hexToBytes=Cst,wst.bytesToNumberBE=function(t){ - return Ast(yst(t))} - ,wst.bytesToNumberLE=function(t){ - return Mst(t),Ast(yst(Uint8Array.from(t).reverse()))} - ,wst.numberToBytesBE=Ost,wst.numberToBytesLE=function(t,i){ - return Ost(t,i).reverse()} - ,wst.numberToVarBytesBE=function(t){ - return Cst(Est(t))} - ,wst.ensureBytes=function(t,i,s){ - let e; - if("string"==typeof i)try{ - e=Cst(i)} - catch(AT){ - throw new Error(`${ - t} - must be valid hex string, got "${ - i} - ". Cause: ${ - AT} - `)} - else{ - if(!_st(i))throw new Error(`${ - t} - must be hex string or Uint8Array`); - e=Uint8Array.from(i)} - const n=e.length; - if("number"==typeof s&&n!==s)throw new Error(`${ - t} - expected ${ - s} - bytes, got ${ - n} - `); - return e} - ,wst.concatBytes=Ist,wst.equalBytes=function(t,i){ - if(t.length!==i.length)return!1; - let s=0; - for(let e=0; - e<t.length; - e++)s|=t[e]^i[e]; - return 0===s} - ,wst.utf8ToBytes=function(t){ - if("string"!=typeof t)throw new Error("utf8ToBytes expected string, got "+typeof t); - return new Uint8Array((new TextEncoder).encode(t))} - ,wst.inRange=xst,wst.aInRange=function(t,i,s,e){ - if(!xst(i,s,e))throw new Error(`expected valid ${ - t} - : ${ - s} - <= n < ${ - e} - , got ${ - typeof i} - ${ - i} - `)} - ,wst.bitLen=function(t){ - let i; - for(i=0; - t>gst; - t>>=mst,i+=1); - return i} - ,wst.bitGet=function(t,i){ - return t>>BigInt(i)&mst} - ,wst.bitSet=function(t,i,s){ - return t|(s?mst:gst)<<BigInt(i)} - ,wst.createHmacDrbg=function(t,i,s){ - if("number"!=typeof t||t<2)throw new Error("hashLen must be a number"); - if("number"!=typeof i||i<2)throw new Error("qByteLen must be a number"); - if("function"!=typeof s)throw new Error("hmacFn must be a function"); - let e=Rst(t),n=Rst(t),h=0; - const r=Qt(()=>{ - e.fill(1),n.fill(0),h=0} - ,"s"),o=Qt((...t)=>s(n,e,...t),"a"),a=Qt((t=Rst())=>{ - n=o(Pst([0]),t),e=o(),0!==t.length&&(n=o(Pst([1]),t),e=o())} - ,"c"),c=Qt(()=>{ - if(h++>=1e3)throw new Error("drbg: tried 1000 values"); - let t=0; - const s=[]; - for(; - t<i; - ){ - e=o(); - const i=e.slice(); - s.push(i),t+=e.length} - return Ist(...s)} - ,"l"); - return(t,i)=>{ - let s; - for(r(),a(t); - !(s=i(c())); - )a(); - return r(),s} - } - ,wst.validateObject=function(t,i,s={ - } - ){ - const e=Qt((i,s,e)=>{ - const n=Nst[s]; - if("function"!=typeof n)throw new Error(`Invalid validator "${ - s} - ", expected function`); - const h=t[i]; - if(!(e&&void 0===h||n(h,t)))throw new Error(`Invalid param ${ - String(i)} - =${ - h} - (${ - typeof h} - ), expected ${ - s} - `)} - ,"r"); - for(const[n,h]of Object.entries(i))e(n,h,!1); - for(const[n,h]of Object.entries(s))e(n,h,!0); - return t} - ,wst.memoized=function(t){ - const i=new WeakMap; - return(s,...e)=>{ - const n=i.get(s); - if(void 0!==n)return n; - const h=t(s,...e); - return i.set(s,h),h} - } - ; - const gst=BigInt(0),mst=BigInt(1),vst=BigInt(2); - function _st(t){ - return t instanceof Uint8Array||null!=t&&"object"==typeof t&&"Uint8Array"===t.constructor.name} - function Mst(t){ - if(!_st(t))throw new Error("Uint8Array expected")} - Qt(_st,"Bt"),Qt(Mst,"Kt"); - const bst=Array.from({ - length:256} - ,(t,i)=>i.toString(16).padStart(2,"0")); - function yst(t){ - Mst(t); - let i=""; - for(let s=0; - s<t.length; - s++)i+=bst[t[s]]; - return i} - function Est(t){ - const i=t.toString(16); - return 1&i.length?`0${ - i} - `:i} - function Ast(t){ - if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t); - return BigInt(""===t?"0":`0x${ - t} - `)} - Qt(yst,"Ut"),Qt(Est,"Ht"),Qt(Ast,"Ft"); - const Sst={ - _0:48,_9:57,_A:65,_F:70,_a:97,_f:102} - ; - function Tst(t){ - return t>=Sst._0&&t<=Sst._9?t-Sst._0:t>=Sst._A&&t<=Sst._F?t-(Sst._A-10):t>=Sst._a&&t<=Sst._f?t-(Sst._a-10):void 0} - function Cst(t){ - if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t); - const i=t.length,s=i/2; - if(i%2)throw new Error("padded hex string expected, got unpadded hex of length "+i); - const e=new Uint8Array(s); - for(let n=0,h=0; - n<s; - n++,h+=2){ - const i=Tst(t.charCodeAt(h)),s=Tst(t.charCodeAt(h+1)); - if(void 0===i||void 0===s){ - const i=t[h]+t[h+1]; - throw new Error('hex string expected, got non-hex character "'+i+'" at index '+h)} - e[n]=16*i+s} - return e} - function Ost(t,i){ - return Cst(t.toString(16).padStart(2*i,"0"))} - function Ist(...t){ - let i=0; - for(let e=0; - e<t.length; - e++){ - const s=t[e]; - Mst(s),i+=s.length} - const s=new Uint8Array(i); - for(let e=0,n=0; - e<t.length; - e++){ - const i=t[e]; - s.set(i,n),n+=i.length} - return s} - Qt(Tst,"qt"),Qt(Cst,"Wt"),Qt(Ost,"Vt"),Qt(Ist,"Gt"); - const kst=Qt(t=>"bigint"==typeof t&&gst<=t,"Yt"); - function xst(t,i,s){ - return kst(t)&&kst(i)&&kst(s)&&i<=t&&t<s} - Qt(xst,"Zt"),wst.bitMask=t=>(vst<<BigInt(t-1))-mst; - const Rst=Qt(t=>new Uint8Array(t),"Jt"),Pst=Qt(t=>Uint8Array.from(t),"Qt"),Nst={ - bigint:Qt(t=>"bigint"==typeof t,"bigint"),function:Qt(t=>"function"==typeof t,"function"),boolean:Qt(t=>"boolean"==typeof t,"boolean"),string:Qt(t=>"string"==typeof t,"string"),stringOrUint8Array:Qt(t=>"string"==typeof t||_st(t),"stringOrUint8Array"),isSafeInteger:Qt(t=>Number.isSafeInteger(t),"isSafeInteger"),array:Qt(t=>Array.isArray(t),"array"),field:Qt((t,i)=>i.Fp.isValid(t),"field"),hash:Qt(t=>"function"==typeof t&&Number.isSafeInteger(t.outputLen),"hash")} - ; - wst.notImplemented=()=>{ - throw new Error("not implemented")} - ,Object.defineProperty(pst,"__esModule",{ - value:!0} - ),pst.isNegativeLE=void 0,pst.mod=Wst,pst.pow=Vst,pst.pow2=function(t,i,s){ - let e=t; - for(; - i-- >Dst; - )e*=e,e%=s; - return e} - ,pst.invert=jst,pst.tonelliShanks=Kst,pst.FpSqrt=zst,pst.validateField=function(t){ - const i=Yst.reduce((t,i)=>(t[i]="function",t),{ - ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"} - ); - return(0,Lst.validateObject)(t,i)} - ,pst.FpPow=qst,pst.FpInvertBatch=Xst,pst.FpDiv=function(t,i,s){ - return t.mul(i,"bigint"==typeof s?jst(s,t.ORDER):t.inv(s))} - ,pst.FpLegendre=Jst,pst.FpIsSquare=function(t){ - const i=Jst(t.ORDER); - return s=>{ - const e=i(t,s); - return t.eql(e,t.ZERO)||t.eql(e,t.ONE)} - } - ,pst.nLength=Qst,pst.Field=function(t,i,s=!1,e={ - } - ){ - if(t<=Dst)throw new Error(`Expected Field ORDER > 0, got ${ - t} - `); - const{ - nBitLength:n,nByteLength:h} - =Qst(t,i); - if(h>2048)throw new Error("Field lengths over 2048 bytes are not supported"); - const r=zst(t),o=Object.freeze({ - ORDER:t,BITS:n,BYTES:h,MASK:(0,Lst.bitMask)(n),ZERO:Dst,ONE:Gst,create:Qt(i=>Wst(i,t),"create"),isValid:Qt(i=>{ - if("bigint"!=typeof i)throw new Error("Invalid field element: expected bigint, got "+typeof i); - return Dst<=i&&i<t} - ,"isValid"),is0:Qt(t=>t===Dst,"is0"),isOdd:Qt(t=>(t&Gst)===Gst,"isOdd"),neg:Qt(i=>Wst(-i,t),"neg"),eql:Qt((t,i)=>t===i,"eql"),sqr:Qt(i=>Wst(i*i,t),"sqr"),add:Qt((i,s)=>Wst(i+s,t),"add"),sub:Qt((i,s)=>Wst(i-s,t),"sub"),mul:Qt((i,s)=>Wst(i*s,t),"mul"),pow:Qt((t,i)=>qst(o,t,i),"pow"),div:Qt((i,s)=>Wst(i*jst(s,t),t),"div"),sqrN:Qt(t=>t*t,"sqrN"),addN:Qt((t,i)=>t+i,"addN"),subN:Qt((t,i)=>t-i,"subN"),mulN:Qt((t,i)=>t*i,"mulN"),inv:Qt(i=>jst(i,t),"inv"),sqrt:e.sqrt||(t=>r(o,t)),invertBatch:Qt(t=>Xst(o,t),"invertBatch"),cmov:Qt((t,i,s)=>s?i:t,"cmov"),toBytes:Qt(t=>s?(0,Lst.numberToBytesLE)(t,h):(0,Lst.numberToBytesBE)(t,h),"toBytes"),fromBytes:Qt(t=>{ - if(t.length!==h)throw new Error(`Fp.fromBytes: expected ${ - h} - , got ${ - t.length} - `); - return s?(0,Lst.bytesToNumberLE)(t):(0,Lst.bytesToNumberBE)(t)} - ,"fromBytes")} - ); - return Object.freeze(o)} - ,pst.FpSqrtOdd=function(t,i){ - if(!t.isOdd)throw new Error("Field doesn't have isOdd"); - const s=t.sqrt(i); - return t.isOdd(s)?s:t.neg(s)} - ,pst.FpSqrtEven=function(t,i){ - if(!t.isOdd)throw new Error("Field doesn't have isOdd"); - const s=t.sqrt(i); - return t.isOdd(s)?t.neg(s):s} - ,pst.hashToPrivateScalar=function(t,i,s=!1){ - const e=(t=(0,Lst.ensureBytes)("privateHash",t)).length,n=Qst(i).nByteLength+8; - if(n<24||e<n||e>1024)throw new Error(`hashToPrivateScalar: expected ${ - n} - -1024 bytes of input, got ${ - e} - `); - return Wst(s?(0,Lst.bytesToNumberLE)(t):(0,Lst.bytesToNumberBE)(t),i-Gst)+Gst} - ,pst.getFieldBytesLength=Zst,pst.getMinHashLength=tet,pst.mapHashToField=function(t,i,s=!1){ - const e=t.length,n=Zst(i),h=tet(i); - if(e<16||e<h||e>1024)throw new Error(`expected ${ - h} - -1024 bytes of input, got ${ - e} - `); - const r=Wst(s?(0,Lst.bytesToNumberBE)(t):(0,Lst.bytesToNumberLE)(t),i-Gst)+Gst; - return s?(0,Lst.numberToBytesLE)(r,n):(0,Lst.numberToBytesBE)(r,n)} - ; - const Lst=wst,Dst=BigInt(0),Gst=BigInt(1),Bst=BigInt(2),Ust=BigInt(3),Fst=BigInt(4),$st=BigInt(5),Hst=BigInt(8); - function Wst(t,i){ - const s=t%i; - return s>=Dst?s:i+s} - function Vst(t,i,s){ - if(s<=Dst||i<Dst)throw new Error("Expected power/modulo > 0"); - if(s===Gst)return Dst; - let e=Gst; - for(; - i>Dst; - )i&Gst&&(e=e*t%s),t=t*t%s,i>>=Gst; - return e} - function jst(t,i){ - if(t===Dst||i<=Dst)throw new Error(`invert: expected positive integers, got n=${ - t} - mod=${ - i} - `); - let s=Wst(t,i),e=i,n=Dst,h=Gst; - for(; - s!==Dst; - ){ - const t=e%s,i=n-h*(e/s); - e=s,s=t,n=h,h=i} - if(e!==Gst)throw new Error("invert: does not exist"); - return Wst(n,i)} - function Kst(t){ - const i=(t-Gst)/Bst; - let s,e,n; - for(s=t-Gst,e=0; - s%Bst===Dst; - s/=Bst,e++); - for(n=Bst; - n<t&&Vst(n,i,t)!==t-Gst; - n++); - if(1===e){ - const i=(t+Gst)/Fst; - return function(t,s){ - const e=t.pow(s,i); - if(!t.eql(t.sqr(e),s))throw new Error("Cannot find square root"); - return e} - } - const h=(s+Gst)/Bst; - return function(t,r){ - if(t.pow(r,i)===t.neg(t.ONE))throw new Error("Cannot find square root"); - let o=e,a=t.pow(t.mul(t.ONE,n),s),c=t.pow(r,h),l=t.pow(r,s); - for(; - !t.eql(l,t.ONE); - ){ - if(t.eql(l,t.ZERO))return t.ZERO; - let i=1; - for(let e=t.sqr(l); - i<o&&!t.eql(e,t.ONE); - i++)e=t.sqr(e); - const s=t.pow(a,Gst<<BigInt(o-i-1)); - a=t.sqr(s),c=t.mul(c,s),l=t.mul(l,a),o=i} - return c} - } - function zst(t){ - if(t%Fst===Ust){ - const i=(t+Gst)/Fst; - return function(t,s){ - const e=t.pow(s,i); - if(!t.eql(t.sqr(e),s))throw new Error("Cannot find square root"); - return e} - } - if(t%Hst===$st){ - const i=(t-$st)/Hst; - return function(t,s){ - const e=t.mul(s,Bst),n=t.pow(e,i),h=t.mul(s,n),r=t.mul(t.mul(h,Bst),n),o=t.mul(h,t.sub(r,t.ONE)); - if(!t.eql(t.sqr(o),s))throw new Error("Cannot find square root"); - return o} - } - return Kst(t)} - Qt(Wst,"ln"),Qt(Vst,"dn"),Qt(jst,"un"),Qt(Kst,"hn"),Qt(zst,"fn"),BigInt(9),BigInt(16),pst.isNegativeLE=(t,i)=>(Wst(t,i)&Gst)===Gst; - const Yst=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"]; - function qst(t,i,s){ - if(s<Dst)throw new Error("Expected power > 0"); - if(s===Dst)return t.ONE; - if(s===Gst)return i; - let e=t.ONE,n=i; - for(; - s>Dst; - )s&Gst&&(e=t.mul(e,n)),n=t.sqr(n),s>>=Gst; - return e} - function Xst(t,i){ - const s=new Array(i.length),e=i.reduce((i,e,n)=>t.is0(e)?i:(s[n]=i,t.mul(i,e)),t.ONE),n=t.inv(e); - return i.reduceRight((i,e,n)=>t.is0(e)?i:(s[n]=t.mul(i,s[n]),t.mul(i,e)),n),s} - function Jst(t){ - const i=(t-Gst)/Bst; - return(t,s)=>t.pow(s,i)} - function Qst(t,i){ - const s=void 0!==i?i:t.toString(2).length; - return{ - nBitLength:s,nByteLength:Math.ceil(s/8)} - } - function Zst(t){ - if("bigint"!=typeof t)throw new Error("field order must be bigint"); - const i=t.toString(2).length; - return Math.ceil(i/8)} - function tet(t){ - const i=Zst(t); - return i+Math.ceil(i/2)} - Qt(qst,"gn"),Qt(Xst,"mn"),Qt(Jst,"yn"),Qt(Qst,"vn"),Qt(Zst,"bn"),Qt(tet,"wn"),Object.defineProperty(fst,"__esModule",{ - value:!0} - ),fst.wNAF=function(t,i){ - const s=Qt((t,i)=>{ - const s=i.negate(); - return t?s:i} - ,"n"),e=Qt(t=>{ - if(!Number.isSafeInteger(t)||t<=0||t>i)throw new Error(`Wrong window size=${ - t} - , should be [1..${ - i} - ]`)} - ,"r"),n=Qt(t=>(e(t),{ - windows:Math.ceil(i/t)+1,windowSize:2**(t-1)} - ),"i"); - return{ - constTimeNegate:s,unsafeLadder(i,s){ - let e=t.ZERO,n=i; - for(; - s>eet; - )s&net&&(e=e.add(n)),n=n.double(),s>>=net; - return e} - ,precomputeWindow(t,i){ - const{ - windows:s,windowSize:e} - =n(i),h=[]; - let r=t,o=r; - for(let n=0; - n<s; - n++){ - o=r,h.push(o); - for(let t=1; - t<e; - t++)o=o.add(r),h.push(o); - r=o.double()} - return h} - ,wNAF(i,e,h){ - const{ - windows:r,windowSize:o} - =n(i); - let a=t.ZERO,c=t.BASE; - const l=BigInt(2**i-1),u=2**i,d=BigInt(i); - for(let t=0; - t<r; - t++){ - const i=t*o; - let n=Number(h&l); - h>>=d,n>o&&(n-=u,h+=net); - const r=i,f=i+Math.abs(n)-1,p=t%2!=0,w=n<0; - 0===n?c=c.add(s(p,e[r])):a=a.add(s(w,e[f]))} - return{ - p:a,f:c} - } - ,wNAFCached(t,i,s){ - const e=ret.get(t)||1; - let n=het.get(t); - return n||(n=this.precomputeWindow(t,e),1!==e&&het.set(t,s(n))),this.wNAF(e,n,i)} - ,setWindowSize(t,i){ - e(i),ret.set(t,i),het.delete(t)} - } - } - ,fst.pippenger=function(t,i,s,e){ - if(!Array.isArray(s)||!Array.isArray(e)||e.length!==s.length)throw new Error("arrays of points and scalars must have equal length"); - e.forEach((t,s)=>{ - if(!i.isValid(t))throw new Error(`wrong scalar at index ${ - s} - `)} - ),s.forEach((i,s)=>{ - if(!(i instanceof t))throw new Error(`wrong point at index ${ - s} - `)} - ); - const n=(0,set.bitLen)(BigInt(s.length)),h=n>12?n-3:n>4?n-2:n?2:1,r=(1<<h)-1,o=new Array(r+1).fill(t.ZERO),a=Math.floor((i.BITS-1)/h)*h; - let c=t.ZERO; - for(let l=a; - l>=0; - l-=h){ - o.fill(t.ZERO); - for(let t=0; - t<e.length; - t++){ - const i=e[t],n=Number(i>>BigInt(l)&BigInt(r)); - o[n]=o[n].add(s[t])} - let i=t.ZERO; - for(let s=o.length-1,e=t.ZERO; - s>0; - s--)e=e.add(o[s]),i=i.add(e); - if(c=c.add(i),0!==l)for(let t=0; - t<h; - t++)c=c.double()} - return c} - ,fst.validateBasic=function(t){ - return(0,iet.validateField)(t.Fp),(0,set.validateObject)(t,{ - n:"bigint",h:"bigint",Gx:"field",Gy:"field"} - ,{ - nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"} - ),Object.freeze({ - ...(0,iet.nLength)(t.n,t.nBitLength),...t,p:t.Fp.ORDER} - )} - ; - const iet=pst,set=wst,eet=BigInt(0),net=BigInt(1),het=new WeakMap,ret=new WeakMap; - Object.defineProperty(dst,"__esModule",{ - value:!0} - ),dst.twistedEdwards=function(t){ - const i=function(t){ - const i=(0,oet.validateBasic)(t); - return cet.validateObject(t,{ - hash:"function",a:"bigint",d:"bigint",randomBytes:"function"} - ,{ - adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"} - ),Object.freeze({ - ...i} - )} - (t),{ - Fp:s,n:e,prehash:n,hash:h,randomBytes:r,nByteLength:o,h:a} - =i,c=pet<<BigInt(8*o)-fet,l=s.create,u=(0,aet.Field)(i.n,i.nBitLength),d=i.uvRatio||((t,i)=>{ - try{ - return{ - isValid:!0,value:s.sqrt(t*s.inv(i))} - } - catch(e){ - return{ - isValid:!1,value:det} - } - } - ),f=i.adjustScalarBytes||(t=>t),p=i.domain||((t,i,s)=>{ - if((0,uet.abool)("phflag",s),i.length||s)throw new Error("Contexts/pre-hash are not supported"); - return t} - ); - function w(t,i){ - cet.aInRange("coordinate "+t,i,det,c)} - function g(t){ - if(!(t instanceof M))throw new Error("ExtendedPoint expected")} - Qt(w,"g"),Qt(g,"m"); - const m=(0,uet.memoized)((t,i)=>{ - const{ - ex:e,ey:n,ez:h} - =t,r=t.is0(); - null==i&&(i=r?wet:s.inv(h)); - const o=l(e*i),a=l(n*i),c=l(h*i); - if(r)return{ - x:det,y:fet} - ; - if(c!==fet)throw new Error("invZ was invalid"); - return{ - x:o,y:a} - } - ),v=(0,uet.memoized)(t=>{ - const{ - a:s,d:e} - =i; - if(t.is0())throw new Error("bad point: ZERO"); - const{ - ex:n,ey:h,ez:r,et:o} - =t,a=l(n*n),c=l(h*h),u=l(r*r),d=l(u*u),f=l(a*s); - if(l(u*l(f+c))!==l(d+l(e*l(a*c))))throw new Error("bad point: equation left != right (1)"); - if(l(n*h)!==l(r*o))throw new Error("bad point: equation left != right (2)"); - return!0} - ),_=class t{ - constructor(t,i,s,e){ - this.ex=t,this.ey=i,this.ez=s,this.et=e,w("x",t),w("y",i),w("z",s),w("t",e),Object.freeze(this)} - get x(){ - return this.toAffine().x} - get y(){ - return this.toAffine().y} - static fromAffine(i){ - if(i instanceof t)throw new Error("extended point not allowed"); - const{ - x:s,y:e} - =i||{ - } - ; - return w("x",s),w("y",e),new t(s,e,fet,l(s*e))} - static normalizeZ(i){ - const e=s.invertBatch(i.map(t=>t.ez)); - return i.map((t,i)=>t.toAffine(e[i])).map(t.fromAffine)} - static msm(i,s){ - return(0,oet.pippenger)(t,u,i,s)} - _setWindowSize(t){ - E.setWindowSize(this,t)} - assertValidity(){ - v(this)} - equals(t){ - g(t); - const{ - ex:i,ey:s,ez:e} - =this,{ - ex:n,ey:h,ez:r} - =t,o=l(i*r),a=l(n*e),c=l(s*r),u=l(h*e); - return o===a&&c===u} - is0(){ - return this.equals(t.ZERO)} - negate(){ - return new t(l(-this.ex),this.ey,this.ez,l(-this.et))} - double(){ - const{ - a:s} - =i,{ - ex:e,ey:n,ez:h} - =this,r=l(e*e),o=l(n*n),a=l(pet*l(h*h)),c=l(s*r),u=e+n,d=l(l(u*u)-r-o),f=c+o,p=f-a,w=c-o,g=l(d*p),m=l(f*w),v=l(d*w),_=l(p*f); - return new t(g,m,_,v)} - add(s){ - g(s); - const{ - a:e,d:n} - =i,{ - ex:h,ey:r,ez:o,et:a} - =this,{ - ex:c,ey:u,ez:d,et:f} - =s; - if(e===BigInt(-1)){ - const i=l((r-h)*(u+c)),s=l((r+h)*(u-c)),e=l(s-i); - if(e===det)return this.double(); - const n=l(o*pet*f),p=l(a*pet*d),w=p+n,g=s+i,m=p-n,v=l(w*e),_=l(g*m),M=l(w*m),b=l(e*g); - return new t(v,_,b,M)} - const p=l(h*c),w=l(r*u),m=l(a*n*f),v=l(o*d),_=l((h+r)*(c+u)-p-w),M=v-m,b=v+m,y=l(w-e*p),E=l(_*M),A=l(b*y),S=l(_*y),T=l(M*b); - return new t(E,A,T,S)} - subtract(t){ - return this.add(t.negate())} - wNAF(i){ - return E.wNAFCached(this,i,t.normalizeZ)} - multiply(i){ - const s=i; - cet.aInRange("scalar",s,fet,e); - const{ - p:n,f:h} - =this.wNAF(s); - return t.normalizeZ([n,h])[0]} - multiplyUnsafe(t){ - const i=t; - return cet.aInRange("scalar",i,det,e),i===det?y:this.equals(y)||i===fet?this:this.equals(b)?this.wNAF(i).p:E.unsafeLadder(this,i)} - isSmallOrder(){ - return this.multiplyUnsafe(a).is0()} - isTorsionFree(){ - return E.unsafeLadder(this,e).is0()} - toAffine(t){ - return m(this,t)} - clearCofactor(){ - const{ - h:t} - =i; - return t===fet?this:this.multiplyUnsafe(t)} - static fromHex(e,n=!1){ - const{ - d:h,a:r} - =i,o=s.BYTES; - e=(0,uet.ensureBytes)("pointHex",e,o),(0,uet.abool)("zip215",n); - const a=e.slice(),u=e[o-1]; - a[o-1]=-129&u; - const f=cet.bytesToNumberLE(a),p=n?c:s.ORDER; - cet.aInRange("pointHex.y",f,det,p); - const w=l(f*f),g=l(w-fet),m=l(h*w-r); - let{ - isValid:v,value:_} - =d(g,m); - if(!v)throw new Error("Point.fromHex: invalid y coordinate"); - const M=(_&fet)===fet,b=!!(128&u); - if(!n&&_===det&&b)throw new Error("Point.fromHex: x=0 and x_0=1"); - return b!==M&&(_=l(-_)),t.fromAffine({ - x:_,y:f} - )} - static fromPrivateKey(t){ - return T(t).point} - toRawBytes(){ - const{ - x:t,y:i} - =this.toAffine(),e=cet.numberToBytesLE(i,s.BYTES); - return e[e.length-1]|=t&fet?128:0,e} - toHex(){ - return cet.bytesToHex(this.toRawBytes())} - } - ; - Qt(_,"b"); - let M=_; - M.BASE=new M(i.Gx,i.Gy,fet,l(i.Gx*i.Gy)),M.ZERO=new M(det,fet,fet,det); - const{ - BASE:b,ZERO:y} - =M,E=(0,oet.wNAF)(M,8*o); - function A(t){ - return(0,aet.mod)(t,e)} - function S(t){ - return A(cet.bytesToNumberLE(t))} - function T(t){ - const i=o; - t=(0,uet.ensureBytes)("private key",t,i); - const s=(0,uet.ensureBytes)("hashed private key",h(t),2*i),e=f(s.slice(0,i)),n=s.slice(i,2*i),r=S(e),a=b.multiply(r),c=a.toRawBytes(); - return{ - head:e,prefix:n,scalar:r,point:a,pointBytes:c} - } - function C(t=new Uint8Array,...i){ - const s=cet.concatBytes(...i); - return S(h(p(s,(0,uet.ensureBytes)("context",t),!!n)))} - Qt(A,"_"),Qt(S,"C"),Qt(T,"k"),Qt(C,"A"); - const O=get; - b._setWindowSize(8); - const I={ - getExtendedPublicKey:T,randomPrivateKey:Qt(()=>r(s.BYTES),"randomPrivateKey"),precompute:Qt((t=8,i=M.BASE)=>(i._setWindowSize(t),i.multiply(BigInt(3)),i),"precompute")} - ; - return{ - CURVE:i,getPublicKey:Qt(function(t){ - return T(t).pointBytes} - ,"getPublicKey"),sign:Qt(function(t,i,h={ - } - ){ - t=(0,uet.ensureBytes)("message",t),n&&(t=n(t)); - const{ - prefix:r,scalar:a,pointBytes:c} - =T(i),l=C(h.context,r,t),u=b.multiply(l).toRawBytes(),d=A(l+C(h.context,u,c,t)*a); - cet.aInRange("signature.s",d,det,e); - const f=cet.concatBytes(u,cet.numberToBytesLE(d,s.BYTES)); - return(0,uet.ensureBytes)("result",f,2*o)} - ,"sign"),verify:Qt(function(t,i,e,h=O){ - const{ - context:r,zip215:o} - =h,a=s.BYTES; - t=(0,uet.ensureBytes)("signature",t,2*a),i=(0,uet.ensureBytes)("message",i),void 0!==o&&(0,uet.abool)("zip215",o),n&&(i=n(i)); - const c=cet.bytesToNumberLE(t.slice(a,2*a)); - let l,u,d; - try{ - l=M.fromHex(e,o),u=M.fromHex(t.slice(0,a),o),d=b.multiplyUnsafe(c)} - catch(p){ - return!1} - if(!o&&l.isSmallOrder())return!1; - const f=C(r,u.toRawBytes(),l.toRawBytes(),i); - return u.add(l.multiplyUnsafe(f)).subtract(d).clearCofactor().equals(M.ZERO)} - ,"verify"),ExtendedPoint:M,utils:I} - } - ; - const oet=fst,aet=pst,cet=wst,uet=wst,det=BigInt(0),fet=BigInt(1),pet=BigInt(2),wet=BigInt(8),get={ - zip215:!0} - ; - var met={ - } - ; - Object.defineProperty(met,"__esModule",{ - value:!0} - ),met.expand_message_xmd=Aet,met.expand_message_xof=Tet,met.hash_to_field=Cet,met.isogenyMap=function(t,i){ - const s=i.map(t=>Array.from(t).reverse()); - return(i,e)=>{ - const[n,h,r,o]=s.map(s=>s.reduce((s,e)=>t.add(t.mul(s,i),e))); - return i=t.div(n,h),e=t.mul(e,t.div(r,o)),{ - x:i,y:e} - } - } - ,met.createHasher=function(t,i,s){ - if("function"!=typeof i)throw new Error("mapToCurve() must be defined"); - return{ - hashToCurve(e,n){ - const h=Cet(e,2,{ - ...s,DST:s.DST,...n} - ),r=t.fromAffine(i(h[0])),o=t.fromAffine(i(h[1])),a=r.add(o).clearCofactor(); - return a.assertValidity(),a} - ,encodeToCurve(e,n){ - const h=Cet(e,1,{ - ...s,DST:s.encodeDST,...n} - ),r=t.fromAffine(i(h[0])).clearCofactor(); - return r.assertValidity(),r} - ,mapToCurve(s){ - if(!Array.isArray(s))throw new Error("mapToCurve: expected array of bigints"); - for(const t of s)if("bigint"!=typeof t)throw new Error(`mapToCurve: expected array of bigints, got ${ - t} - in array`); - const e=t.fromAffine(i(s)).clearCofactor(); - return e.assertValidity(),e} - } - } - ; - const vet=pst,_et=wst,Met=_et.bytesToNumberBE; - function bet(t,i){ - if(Eet(t),Eet(i),t<0||t>=1<<8*i)throw new Error(`bad I2OSP call: value=${ - t} - length=${ - i} - `); - const s=Array.from({ - length:i} - ).fill(0); - for(let e=i-1; - e>=0; - e--)s[e]=255&t,t>>>=8; - return new Uint8Array(s)} - function yet(t,i){ - const s=new Uint8Array(t.length); - for(let e=0; - e<t.length; - e++)s[e]=t[e]^i[e]; - return s} - function Eet(t){ - if(!Number.isSafeInteger(t))throw new Error("number expected")} - function Aet(t,i,s,e){ - (0,_et.abytes)(t),(0,_et.abytes)(i),Eet(s),i.length>255&&(i=e((0,_et.concatBytes)((0,_et.utf8ToBytes)("H2C-OVERSIZE-DST-"),i))); - const{ - outputLen:n,blockLen:h} - =e,r=Math.ceil(s/n); - if(s>65535||r>255)throw new Error("expand_message_xmd: invalid lenInBytes"); - const o=(0,_et.concatBytes)(i,bet(i.length,1)),a=bet(0,h),c=bet(s,2),l=new Array(r),u=e((0,_et.concatBytes)(a,t,c,bet(0,1),o)); - l[0]=e((0,_et.concatBytes)(u,bet(1,1),o)); - for(let d=1; - d<=r; - d++){ - const t=[yet(u,l[d-1]),bet(d+1,1),o]; - l[d]=e((0,_et.concatBytes)(...t))} - return(0,_et.concatBytes)(...l).slice(0,s)} - function Tet(t,i,s,e,n){ - if((0,_et.abytes)(t),(0,_et.abytes)(i),Eet(s),i.length>255){ - const t=Math.ceil(2*e/8); - i=n.create({ - dkLen:t} - ).update((0,_et.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(i).digest()} - if(s>65535||i.length>255)throw new Error("expand_message_xof: invalid lenInBytes"); - return n.create({ - dkLen:s} - ).update(t).update(bet(s,2)).update(i).update(bet(i.length,1)).digest()} - function Cet(t,i,s){ - (0,_et.validateObject)(s,{ - DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"} - ); - const{ - p:e,k:n,m:h,hash:r,expand:o,DST:a} - =s; - (0,_et.abytes)(t),Eet(i); - const c="string"==typeof a?(0,_et.utf8ToBytes)(a):a,l=e.toString(2).length,u=Math.ceil((l+n)/8),d=i*h*u; - let f; - if("xmd"===o)f=Aet(t,c,d,r); - else if("xof"===o)f=Tet(t,c,d,n,r); - else{ - if("_internal_pass"!==o)throw new Error('expand must be "xmd" or "xof"'); - f=t} - const p=new Array(i); - for(let w=0; - w<i; - w++){ - const t=new Array(h); - for(let i=0; - i<h; - i++){ - const s=u*(i+w*h),n=f.subarray(s,s+u); - t[i]=(0,vet.mod)(Met(n),e)} - p[w]=t} - return p} - Qt(bet,"jn"),Qt(yet,"Un"),Qt(Eet,"Hn"),Qt(Aet,"Fn"),Qt(Tet,"zn"),Qt(Cet,"qn"); - var Oet={ - } - ; - Object.defineProperty(Oet,"__esModule",{ - value:!0} - ),Oet.montgomery=function(t){ - const i=(c=t,(0,ket.validateObject)(c,{ - a:"bigint"} - ,{ - montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"} - ),Object.freeze({ - ...c} - )),{ - P:s} - =i,e=Qt(t=>(0,Iet.mod)(t,s),"r"),n=i.montgomeryBits,h=Math.ceil(n/8),r=i.nByteLength,o=i.adjustScalarBytes||(t=>t),a=i.powPminus2||(t=>(0,Iet.pow)(t,s-BigInt(2),s)); - var c; - function l(t,i,s){ - const n=e(t*(i-s)); - return[i=e(i-n),s=e(s+n)]} - Qt(l,"l"); - const u=(i.a-BigInt(2))/BigInt(4); - function d(t){ - return(0,ket.numberToBytesLE)(e(t),h)} - function f(t,i){ - const c=function(t){ - const i=(0,ket.ensureBytes)("u coordinate",t,h); - return 32===r&&(i[31]&=127),(0,ket.bytesToNumberLE)(i)} - (i),f=function(t){ - const i=(0,ket.ensureBytes)("scalar",t),s=i.length; - if(s!==h&&s!==r)throw new Error(`Expected ${ - h} - or ${ - r} - bytes, got ${ - s} - `); - return(0,ket.bytesToNumberLE)(o(i))} - (t),p=function(t,i){ - (0,ket.aInRange)("u",t,xet,s),(0,ket.aInRange)("scalar",i,xet,s); - const h=i,r=t; - let o,c=Ret,d=xet,f=t,p=Ret,w=xet; - for(let s=BigInt(n-1); - s>=xet; - s--){ - const t=h>>s&Ret; - w^=t,o=l(w,c,f),c=o[0],f=o[1],o=l(w,d,p),d=o[0],p=o[1],w=t; - const i=c+d,n=e(i*i),a=c-d,g=e(a*a),m=n-g,v=f+p,_=e((f-p)*i),M=e(v*a),b=_+M,y=_-M; - f=e(b*b),p=e(r*e(y*y)),c=e(n*g),d=e(m*(n+e(u*m)))} - o=l(w,c,f),c=o[0],f=o[1],o=l(w,d,p),d=o[0],p=o[1]; - const g=a(d); - return e(c*g)} - (c,f); - if(p===xet)throw new Error("Invalid private or public key received"); - return d(p)} - Qt(d,"u"),Qt(f,"h"); - const p=d(i.Gu); - function w(t){ - return f(t,p)} - return Qt(w,"p"),{ - scalarMult:f,scalarMultBase:w,getSharedSecret:Qt((t,i)=>f(t,i),"getSharedSecret"),getPublicKey:Qt(t=>w(t),"getPublicKey"),utils:{ - randomPrivateKey:Qt(()=>i.randomBytes(i.nByteLength),"randomPrivateKey")} - ,GuBytes:p} - } - ; - const Iet=pst,ket=wst,xet=BigInt(0),Ret=BigInt(1); - !function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.hash_to_ristretto255=t.hashToRistretto255=t.RistrettoPoint=t.encodeToCurve=t.hashToCurve=t.edwardsToMontgomery=t.x25519=t.ed25519ph=t.ed25519ctx=t.ed25519=t.ED25519_TORSION_SUBGROUP=void 0,t.edwardsToMontgomeryPub=y,t.edwardsToMontgomeryPriv=function(t){ - const i=M.hash(t.subarray(0,32)); - return M.adjustScalarBytes(i).subarray(0,32)} - ; - const i=lit,s=bit,e=dst,n=met,h=pst,r=Oet,o=wst,a=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),c=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),l=BigInt(0),u=BigInt(1),d=BigInt(2),f=BigInt(3),p=BigInt(5),w=BigInt(8); - function g(t){ - const i=BigInt(10),s=BigInt(20),e=BigInt(40),n=BigInt(80),r=a,o=t*t%r*t%r,c=(0,h.pow2)(o,d,r)*o%r,l=(0,h.pow2)(c,u,r)*t%r,f=(0,h.pow2)(l,p,r)*l%r,w=(0,h.pow2)(f,i,r)*f%r,g=(0,h.pow2)(w,s,r)*w%r,m=(0,h.pow2)(g,e,r)*g%r,v=(0,h.pow2)(m,n,r)*m%r,_=(0,h.pow2)(v,n,r)*m%r,M=(0,h.pow2)(_,i,r)*f%r; - return{ - pow_p_5_8:(0,h.pow2)(M,d,r)*t%r,b2:o} - } - function m(t){ - return t[0]&=248,t[31]&=127,t[31]|=64,t} - function v(t,i){ - const s=a,e=(0,h.mod)(i*i*i,s),n=g(t*(0,h.mod)(e*e*i,s)).pow_p_5_8; - let r=(0,h.mod)(t*e*n,s); - const o=(0,h.mod)(i*r*r,s),l=r,u=(0,h.mod)(r*c,s),d=o===t,f=o===(0,h.mod)(-t,s),p=o===(0,h.mod)(-t*c,s); - return d&&(r=l),(f||p)&&(r=u),(0,h.isNegativeLE)(r,s)&&(r=(0,h.mod)(-r,s)),{ - isValid:d||f,value:r} - } - Qt(g,"m"),Qt(m,"y"),Qt(v,"v"),t.ED25519_TORSION_SUBGROUP=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"]; - const _=(0,h.Field)(a,void 0,!0),M={ - a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:_,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:w,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:i.sha512,randomBytes:s.randomBytes,adjustScalarBytes:m,uvRatio:v} - ; - function b(t,i,e){ - if(i.length>255)throw new Error("Context is too big"); - return(0,s.concatBytes)((0,s.utf8ToBytes)("SigEd25519 no Ed25519 collisions"),new Uint8Array([e?1:0,i.length]),i,t)} - function y(i){ - const{ - y:s} - =t.ed25519.ExtendedPoint.fromHex(i),e=BigInt(1); - return _.toBytes(_.create((e+s)*_.inv(e-s)))} - Qt(b,"E"),Qt(y,"S"),t.ed25519=(0,e.twistedEdwards)(M),t.ed25519ctx=(0,e.twistedEdwards)({ - ...M,domain:b} - ),t.ed25519ph=(0,e.twistedEdwards)(Object.assign({ - } - ,M,{ - domain:b,prehash:i.sha512} - )),t.x25519=(0,r.montgomery)({ - P:a,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:Qt(t=>{ - const i=a,{ - pow_p_5_8:s,b2:e} - =g(t); - return(0,h.mod)((0,h.pow2)(s,f,i)*e,i)} - ,"powPminus2"),adjustScalarBytes:m,randomBytes:s.randomBytes} - ),t.edwardsToMontgomery=y; - const E=(_.ORDER+f)/w,A=_.pow(d,E),S=_.sqrt(_.neg(_.ONE)),T=(0,h.FpSqrtEven)(_,_.neg(BigInt(486664))); - function C(t){ - const{ - xMn:i,xMd:s,yMn:e,yMd:n} - =function(t){ - const i=(_.ORDER-p)/w,s=BigInt(486662); - let e=_.sqr(t); - e=_.mul(e,d); - let n=_.add(e,_.ONE),h=_.neg(s),r=_.sqr(n),o=_.mul(r,n),a=_.mul(e,s); - a=_.mul(a,h),a=_.add(a,r),a=_.mul(a,h); - let c=_.sqr(o); - r=_.sqr(c),c=_.mul(c,o),c=_.mul(c,a),r=_.mul(r,c); - let l=_.pow(r,i); - l=_.mul(l,c); - let f=_.mul(l,S); - r=_.sqr(l),r=_.mul(r,o); - let g=_.eql(r,a),m=_.cmov(f,l,g),v=_.mul(h,e),M=_.mul(l,t); - M=_.mul(M,A); - let b=_.mul(M,S),y=_.mul(a,e); - r=_.sqr(M),r=_.mul(r,o); - let E=_.eql(r,y),T=_.cmov(b,M,E); - r=_.sqr(m),r=_.mul(r,o); - let C=_.eql(r,a),O=_.cmov(v,h,C),I=_.cmov(T,m,C),k=_.isOdd(I); - return I=_.cmov(I,_.neg(I),C!==k),{ - xMn:O,xMd:n,yMn:I,yMd:u} - } - (t); - let h=_.mul(i,n); - h=_.mul(h,T); - let r=_.mul(s,e),o=_.sub(i,s),a=_.add(i,s),c=_.mul(r,a),l=_.eql(c,_.ZERO); - h=_.cmov(h,_.ZERO,l),r=_.cmov(r,_.ONE,l),o=_.cmov(o,_.ONE,l),a=_.cmov(a,_.ONE,l); - const f=_.invertBatch([r,a]); - return{ - x:_.mul(h,f[0]),y:_.mul(o,f[1])} - } - Qt(C,"x"); - const O=(0,n.createHasher)(t.ed25519.ExtendedPoint,t=>C(t[0]),{ - DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:_.ORDER,m:1,k:128,expand:"xmd",hash:i.sha512} - ); - function I(t){ - if(!(t instanceof F))throw new Error("RistrettoPoint expected")} - Qt(I,"I"),t.hashToCurve=O.hashToCurve,t.encodeToCurve=O.encodeToCurve; - const k=c,x=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),R=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),P=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),N=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),L=Qt(t=>v(u,t),"L"),D=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),G=Qt(i=>t.ed25519.CURVE.Fp.create((0,o.bytesToNumberLE)(i)&D),"$"); - function B(i){ - const{ - d:s} - =t.ed25519.CURVE,e=t.ed25519.CURVE.Fp.ORDER,n=t.ed25519.CURVE.Fp.create,r=n(k*i*i),o=n((r+u)*P); - let a=BigInt(-1); - const c=n((a-s*r)*n(r+s)); - let{ - isValid:l,value:d} - =v(o,c),f=n(d*i); - (0,h.isNegativeLE)(f,e)||(f=n(-f)),l||(d=f),l||(a=r); - const p=n(a*(r-u)*N-c),w=d*d,g=n((d+d)*c),m=n(p*x),_=n(u-w),M=n(u+w); - return new t.ed25519.ExtendedPoint(n(g*M),n(_*m),n(m*M),n(g*_))} - Qt(B,"B"); - const U=class i{ - constructor(t){ - this.ep=t} - static fromAffine(s){ - return new i(t.ed25519.ExtendedPoint.fromAffine(s))} - static hashToCurve(t){ - t=(0,o.ensureBytes)("ristrettoHash",t,64); - const s=B(G(t.slice(0,32))),e=B(G(t.slice(32,64))); - return new i(s.add(e))} - static fromHex(s){ - s=(0,o.ensureBytes)("ristrettoHex",s,32); - const{ - a:e,d:n} - =t.ed25519.CURVE,r=t.ed25519.CURVE.Fp.ORDER,a=t.ed25519.CURVE.Fp.create,c="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",d=G(s); - if(!(0,o.equalBytes)((0,o.numberToBytesLE)(d,32),s)||(0,h.isNegativeLE)(d,r))throw new Error(c); - const f=a(d*d),p=a(u+e*f),w=a(u-e*f),g=a(p*p),m=a(w*w),v=a(e*n*g-m),{ - isValid:_,value:M} - =L(a(v*m)),b=a(M*w),y=a(M*b*v); - let E=a((d+d)*b); - (0,h.isNegativeLE)(E,r)&&(E=a(-E)); - const A=a(p*y),S=a(E*A); - if(!_||(0,h.isNegativeLE)(S,r)||A===l)throw new Error(c); - return new i(new t.ed25519.ExtendedPoint(E,A,u,S))} - toRawBytes(){ - let{ - ex:i,ey:s,ez:e,et:n} - =this.ep; - const r=t.ed25519.CURVE.Fp.ORDER,a=t.ed25519.CURVE.Fp.create,c=a(a(e+s)*a(e-s)),l=a(i*s),u=a(l*l),{ - value:d} - =L(a(c*u)),f=a(d*c),p=a(d*l),w=a(f*p*n); - let g; - if((0,h.isNegativeLE)(n*w,r)){ - let t=a(s*k),e=a(i*k); - i=t,s=e,g=a(f*R)} - else g=p; - (0,h.isNegativeLE)(i*w,r)&&(s=a(-s)); - let m=a((e-s)*g); - return(0,h.isNegativeLE)(m,r)&&(m=a(-m)),(0,o.numberToBytesLE)(m,32)} - toHex(){ - return(0,o.bytesToHex)(this.toRawBytes())} - toString(){ - return this.toHex()} - equals(i){ - I(i); - const{ - ex:s,ey:e} - =this.ep,{ - ex:n,ey:h} - =i.ep,r=t.ed25519.CURVE.Fp.create,o=r(s*h)===r(e*n),a=r(e*h)===r(s*n); - return o||a} - add(t){ - return I(t),new i(this.ep.add(t.ep))} - subtract(t){ - return I(t),new i(this.ep.subtract(t.ep))} - multiply(t){ - return new i(this.ep.multiply(t))} - multiplyUnsafe(t){ - return new i(this.ep.multiplyUnsafe(t))} - double(){ - return new i(this.ep.double())} - negate(){ - return new i(this.ep.negate())} - } - ; - Qt(U,"K"); - let F=U; - t.RistrettoPoint=(F.BASE||(F.BASE=new F(t.ed25519.ExtendedPoint.BASE)),F.ZERO||(F.ZERO=new F(t.ed25519.ExtendedPoint.ZERO)),F),t.hashToRistretto255=(t,e)=>{ - const h=e.DST,r="string"==typeof h?(0,s.utf8ToBytes)(h):h,o=(0,n.expand_message_xmd)(t,r,64,i.sha512); - return F.hashToCurve(o)} - ,t.hash_to_ristretto255=t.hashToRistretto255} - (cit); - var Pet={ - } - ,Net={ - } - ; - Object.defineProperty(Net,"__esModule",{ - value:!0} - ),Net.sha224=Net.sha256=Net.SHA256=void 0; - const Let=uit,Det=bit,Get=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Bet=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Uet=new Uint32Array(64),Fet=class extends Let.HashMD{ - constructor(){ - super(64,32,8,!1),this.A=0|Bet[0],this.B=0|Bet[1],this.C=0|Bet[2],this.D=0|Bet[3],this.E=0|Bet[4],this.F=0|Bet[5],this.G=0|Bet[6],this.H=0|Bet[7]} - get(){ - const{ - A:t,B:i,C:s,D:e,E:n,F:h,G:r,H:o} - =this; - return[t,i,s,e,n,h,r,o]} - set(t,i,s,e,n,h,r,o){ - this.A=0|t,this.B=0|i,this.C=0|s,this.D=0|e,this.E=0|n,this.F=0|h,this.G=0|r,this.H=0|o} - process(t,i){ - for(let l=0; - l<16; - l++,i+=4)Uet[l]=t.getUint32(i,!1); - for(let l=16; - l<64; - l++){ - const t=Uet[l-15],i=Uet[l-2],s=(0,Det.rotr)(t,7)^(0,Det.rotr)(t,18)^t>>>3,e=(0,Det.rotr)(i,17)^(0,Det.rotr)(i,19)^i>>>10; - Uet[l]=e+Uet[l-7]+s+Uet[l-16]|0} - let{ - A:s,B:e,C:n,D:h,E:r,F:o,G:a,H:c} - =this; - for(let l=0; - l<64; - l++){ - const t=c+((0,Det.rotr)(r,6)^(0,Det.rotr)(r,11)^(0,Det.rotr)(r,25))+(0,Let.Chi)(r,o,a)+Get[l]+Uet[l]|0,i=((0,Det.rotr)(s,2)^(0,Det.rotr)(s,13)^(0,Det.rotr)(s,22))+(0,Let.Maj)(s,e,n)|0; - c=a,a=o,o=r,r=h+t|0,h=n,n=e,e=s,s=t+i|0} - s=s+this.A|0,e=e+this.B|0,n=n+this.C|0,h=h+this.D|0,r=r+this.E|0,o=o+this.F|0,a=a+this.G|0,c=c+this.H|0,this.set(s,e,n,h,r,o,a,c)} - roundClean(){ - Uet.fill(0)} - destroy(){ - this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)} - } - ; - Qt(Fet,"ir"); - let $et=Fet; - Net.SHA256=$et; - const Het=class extends $et{ - constructor(){ - super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28} - } - ; - Qt(Het,"or"); - let Wet=Het; - Net.sha256=(0,Det.wrapConstructor)(()=>new $et),Net.sha224=(0,Det.wrapConstructor)(()=>new Wet); - var Vet={ - } - ,jet={ - } - ; - !function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.hmac=t.HMAC=void 0; - const i=dit,s=bit,e=class extends s.Hash{ - constructor(t,e){ - super(),this.finished=!1,this.destroyed=!1,(0,i.hash)(t); - const n=(0,s.toBytes)(e); - if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash"); - this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen; - const h=this.blockLen,r=new Uint8Array(h); - r.set(n.length>h?t.create().update(n).digest():n); - for(let i=0; - i<r.length; - i++)r[i]^=54; - this.iHash.update(r),this.oHash=t.create(); - for(let i=0; - i<r.length; - i++)r[i]^=106; - this.oHash.update(r),r.fill(0)} - update(t){ - return(0,i.exists)(this),this.iHash.update(t),this} - digestInto(t){ - (0,i.exists)(this),(0,i.bytes)(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()} - digest(){ - const t=new Uint8Array(this.oHash.outputLen); - return this.digestInto(t),t} - _cloneInto(t){ - t||(t=Object.create(Object.getPrototypeOf(this),{ - } - )); - const{ - oHash:i,iHash:s,finished:e,destroyed:n,blockLen:h,outputLen:r} - =this; - return t.finished=e,t.destroyed=n,t.blockLen=h,t.outputLen=r,t.oHash=i._cloneInto(t.oHash),t.iHash=s._cloneInto(t.iHash),t} - destroy(){ - this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()} - } - ; - Qt(e,"r"); - let n=e; - t.HMAC=n,t.hmac=(t,i,s)=>new n(t,i).update(s).digest(),t.hmac.create=(t,i)=>new n(t,i)} - (jet); - var Ket={ - } - ; - !function(t){ - var i; - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.DER=void 0,t.weierstrassPoints=p,t.weierstrass=function(i){ - const o=function(t){ - const i=(0,s.validateBasic)(t); - return n.validateObject(i,{ - hash:"hash",hmac:"function",randomBytes:"function"} - ,{ - bits2int:"function",bits2int_modN:"function",lowS:"boolean"} - ),Object.freeze({ - lowS:!0,...i} - )} - (i),{ - Fp:a,n:u} - =o,d=a.BYTES+1,f=2*a.BYTES+1; - function w(t){ - return e.mod(t,u)} - function g(t){ - return e.invert(t,u)} - Qt(w,"g"),Qt(g,"m"); - const{ - ProjectivePoint:m,normPrivateKeyToScalar:v,weierstrassEquation:_,isWithinCurveOrder:M} - =p({ - ...o,toBytes(t,i,s){ - const e=i.toAffine(),r=a.toBytes(e.x),o=n.concatBytes; - return(0,h.abool)("isCompressed",s),s?o(Uint8Array.from([i.hasEvenY()?2:3]),r):o(Uint8Array.from([4]),r,a.toBytes(e.y))} - ,fromBytes(t){ - const i=t.length,s=t[0],e=t.subarray(1); - if(i!==d||2!==s&&3!==s){ - if(i===f&&4===s)return{ - x:a.fromBytes(e.subarray(0,a.BYTES)),y:a.fromBytes(e.subarray(a.BYTES,2*a.BYTES))} - ; - throw new Error(`Point of length ${ - i} - was invalid. Expected ${ - d} - compressed bytes or ${ - f} - uncompressed bytes`)} - { - const t=n.bytesToNumberBE(e); - if(!n.inRange(t,l,a.ORDER))throw new Error("Point is not on curve"); - const i=_(t); - let r; - try{ - r=a.sqrt(i)} - catch(h){ - const t=h instanceof Error?": "+h.message:""; - throw new Error("Point is not on curve"+t)} - return!(1&~s)!=((r&l)===l)&&(r=a.neg(r)),{ - x:t,y:r} - } - } - } - ),b=Qt(t=>n.bytesToHex(n.numberToBytesBE(t,o.nByteLength)),"E"); - function y(t){ - return t>u>>l} - Qt(y,"S"); - const E=Qt((t,i,s)=>n.bytesToNumberBE(t.slice(i,s)),"_"),A=class i{ - constructor(t,i,s){ - this.r=t,this.s=i,this.recovery=s,this.assertValidity()} - static fromCompact(t){ - const s=o.nByteLength; - return t=(0,h.ensureBytes)("compactSignature",t,2*s),new i(E(t,0,s),E(t,s,2*s))} - static fromDER(s){ - const{ - r:e,s:n} - =t.DER.toSig((0,h.ensureBytes)("DER",s)); - return new i(e,n)} - assertValidity(){ - n.aInRange("r",this.r,l,u),n.aInRange("s",this.s,l,u)} - addRecoveryBit(t){ - return new i(this.r,this.s,t)} - recoverPublicKey(t){ - const{ - r:i,s,recovery:e} - =this,n=I((0,h.ensureBytes)("msgHash",t)); - if(null==e||![0,1,2,3].includes(e))throw new Error("recovery id invalid"); - const r=2===e||3===e?i+o.n:i; - if(r>=a.ORDER)throw new Error("recovery id 2 or 3 invalid"); - const c=1&e?"03":"02",l=m.fromHex(c+b(r)),u=g(r),d=w(-n*u),f=w(s*u),p=m.BASE.multiplyAndAddUnsafe(l,d,f); - if(!p)throw new Error("point at infinify"); - return p.assertValidity(),p} - hasHighS(){ - return y(this.s)} - normalizeS(){ - return this.hasHighS()?new i(this.r,w(-this.s),this.recovery):this} - toDERRawBytes(){ - return n.hexToBytes(this.toDERHex())} - toDERHex(){ - return t.DER.hexFromSig({ - r:this.r,s:this.s} - )} - toCompactRawBytes(){ - return n.hexToBytes(this.toCompactHex())} - toCompactHex(){ - return b(this.r)+b(this.s)} - } - ; - Qt(A,"C"); - let S=A; - const T={ - isValidPrivateKey(t){ - try{ - return v(t),!0} - catch(i){ - return!1} - } - ,normPrivateKeyToScalar:v,randomPrivateKey:Qt(()=>{ - const t=e.getMinHashLength(o.n); - return e.mapHashToField(o.randomBytes(t),o.n)} - ,"randomPrivateKey"),precompute:Qt((t=8,i=m.BASE)=>(i._setWindowSize(t),i.multiply(BigInt(3)),i),"precompute")} - ; - function C(t){ - const i=n.isBytes(t),s="string"==typeof t,e=(i||s)&&t.length; - return i?e===d||e===f:s?e===2*d||e===2*f:t instanceof m} - Qt(C,"A"); - const O=o.bits2int||function(t){ - const i=n.bytesToNumberBE(t),s=8*t.length-o.nBitLength; - return s>0?i>>BigInt(s):i} - ,I=o.bits2int_modN||function(t){ - return w(O(t))} - ,k=n.bitMask(o.nBitLength); - function x(t){ - return n.aInRange(`num < 2^${ - o.nBitLength} - `,t,c,k),n.numberToBytesBE(t,o.nByteLength)} - function R(t,i,s=P){ - if(["recovered","canonical"].some(t=>t in s))throw new Error("sign() legacy options not supported"); - const{ - hash:e,randomBytes:u} - =o; - let{ - lowS:d,prehash:f,extraEntropy:p} - =s; - null==d&&(d=!0),t=(0,h.ensureBytes)("msgHash",t),r(s),f&&(t=(0,h.ensureBytes)("prehashed msgHash",e(t))); - const _=I(t),b=v(i),E=[x(b),x(_)]; - if(null!=p&&!1!==p){ - const t=!0===p?u(a.BYTES):p; - E.push((0,h.ensureBytes)("extraEntropy",t))} - const A=n.concatBytes(...E),T=_; - return{ - seed:A,k2sig:Qt(function(t){ - const i=O(t); - if(!M(i))return; - const s=g(i),e=m.BASE.multiply(i).toAffine(),n=w(e.x); - if(n===c)return; - const h=w(s*w(T+n*b)); - if(h===c)return; - let r=(e.x===n?0:2)|Number(e.y&l),o=h; - return d&&y(h)&&(o=y(a=h)?w(-a):a,r^=1),new S(n,o,r); - var a} - ,"k2sig")} - } - Qt(x,"T"),Qt(R,"R"); - const P={ - lowS:o.lowS,prehash:!1} - ,N={ - lowS:o.lowS,prehash:!1} - ; - return m.BASE._setWindowSize(8),{ - CURVE:o,getPublicKey:Qt(function(t,i=!0){ - return m.fromPrivateKey(t).toRawBytes(i)} - ,"getPublicKey"),getSharedSecret:Qt(function(t,i,s=!0){ - if(C(t))throw new Error("first arg must be private key"); - if(!C(i))throw new Error("second arg must be public key"); - return m.fromHex(i).multiply(v(t)).toRawBytes(s)} - ,"getSharedSecret"),sign:Qt(function(t,i,s=P){ - const{ - seed:e,k2sig:h} - =R(t,i,s),r=o; - return n.createHmacDrbg(r.hash.outputLen,r.nByteLength,r.hmac)(e,h)} - ,"sign"),verify:Qt(function(i,s,e,a=N){ - var c; - const l=i; - if(s=(0,h.ensureBytes)("msgHash",s),e=(0,h.ensureBytes)("publicKey",e),"strict"in a)throw new Error("options.strict was renamed to lowS"); - r(a); - const{ - lowS:u,prehash:d} - =a; - let f,p; - try{ - if("string"==typeof l||n.isBytes(l))try{ - f=S.fromDER(l)} - catch(T){ - if(!(T instanceof t.DER.Err))throw T; - f=S.fromCompact(l)} - else{ - if("object"!=typeof l||"bigint"!=typeof l.r||"bigint"!=typeof l.s)throw new Error("PARSE"); - { - const{ - r:t,s:i} - =l; - f=new S(t,i)} - } - p=m.fromHex(e)} - catch(C){ - if("PARSE"===C.message)throw new Error("signature must be Signature instance, Uint8Array or hex string"); - return!1} - if(u&&f.hasHighS())return!1; - d&&(s=o.hash(s)); - const{ - r:v,s:_} - =f,M=I(s),b=g(_),y=w(M*b),E=w(v*b),A=null==(c=m.BASE.multiplyAndAddUnsafe(p,y,E))?void 0:c.toAffine(); - return!!A&&w(A.x)===v} - ,"verify"),ProjectivePoint:m,Signature:S,utils:T} - } - ,t.SWUFpSqrtRatio=w,t.mapToCurveSimpleSWU=function(t,i){ - if(e.validateField(t),!t.isValid(i.A)||!t.isValid(i.B)||!t.isValid(i.Z))throw new Error("mapToCurveSimpleSWU: invalid opts"); - const s=w(t,i.Z); - if(!t.isOdd)throw new Error("Fp.isOdd is not implemented!"); - return e=>{ - let n,h,r,o,a,c,l,u; - n=t.sqr(e),n=t.mul(n,i.Z),h=t.sqr(n),h=t.add(h,n),r=t.add(h,t.ONE),r=t.mul(r,i.B),o=t.cmov(i.Z,t.neg(h),!t.eql(h,t.ZERO)),o=t.mul(o,i.A),h=t.sqr(r),c=t.sqr(o),a=t.mul(c,i.A),h=t.add(h,a),h=t.mul(h,r),c=t.mul(c,o),a=t.mul(c,i.B),h=t.add(h,a),l=t.mul(n,r); - const{ - isValid:d,value:f} - =s(h,c); - u=t.mul(n,e),u=t.mul(u,f),l=t.cmov(l,r,d),u=t.cmov(u,f,d); - const p=t.isOdd(e)===t.isOdd(u); - return u=t.cmov(t.neg(u),u,p),l=t.div(l,o),{ - x:l,y:u} - } - } - ; - const s=fst,e=pst,n=wst,h=wst; - function r(t){ - void 0!==t.lowS&&(0,h.abool)("lowS",t.lowS),void 0!==t.prehash&&(0,h.abool)("prehash",t.prehash)} - Qt(r,"o"); - const{ - bytesToNumberBE:o,hexToBytes:a} - =n; - t.DER={ - Err:(i=class extends Error{ - constructor(t=""){ - super(t)} - } - ,Qt(i,"Err"),i),_tlv:{ - encode:Qt((i,s)=>{ - const{ - Err:e} - =t.DER; - if(i<0||i>256)throw new e("tlv.encode: wrong tag"); - if(1&s.length)throw new e("tlv.encode: unpadded data"); - const h=s.length/2,r=n.numberToHexUnpadded(h); - if(r.length/2&128)throw new e("tlv.encode: long form length too big"); - const o=h>127?n.numberToHexUnpadded(r.length/2|128):""; - return`${ - n.numberToHexUnpadded(i)} - ${ - o} - ${ - r} - ${ - s} - `} - ,"encode"),decode(i,s){ - const{ - Err:e} - =t.DER; - let n=0; - if(i<0||i>256)throw new e("tlv.encode: wrong tag"); - if(s.length<2||s[n++]!==i)throw new e("tlv.decode: wrong tlv"); - const h=s[n++]; - let r=0; - if(128&h){ - const t=127&h; - if(!t)throw new e("tlv.decode(long): indefinite length not supported"); - if(t>4)throw new e("tlv.decode(long): byte length is too big"); - const i=s.subarray(n,n+t); - if(i.length!==t)throw new e("tlv.decode: length bytes not complete"); - if(0===i[0])throw new e("tlv.decode(long): zero leftmost byte"); - for(const s of i)r=r<<8|s; - if(n+=t,r<128)throw new e("tlv.decode(long): not minimal encoding")} - else r=h; - const o=s.subarray(n,n+r); - if(o.length!==r)throw new e("tlv.decode: wrong value length"); - return{ - v:o,l:s.subarray(n+r)} - } - } - ,_int:{ - encode(i){ - const{ - Err:s} - =t.DER; - if(i<c)throw new s("integer: negative integers are not allowed"); - let e=n.numberToHexUnpadded(i); - if(8&Number.parseInt(e[0],16)&&(e="00"+e),1&e.length)throw new s("unexpected assertion"); - return e} - ,decode(i){ - const{ - Err:s} - =t.DER; - if(128&i[0])throw new s("Invalid signature integer: negative"); - if(0===i[0]&&!(128&i[1]))throw new s("Invalid signature integer: unnecessary leading zero"); - return o(i)} - } - ,toSig(i){ - const{ - Err:s,_int:e,_tlv:h} - =t.DER,r="string"==typeof i?a(i):i; - n.abytes(r); - const{ - v:o,l:c} - =h.decode(48,r); - if(c.length)throw new s("Invalid signature: left bytes after parsing"); - const{ - v:l,l:u} - =h.decode(2,o),{ - v:d,l:f} - =h.decode(2,u); - if(f.length)throw new s("Invalid signature: left bytes after parsing"); - return{ - r:e.decode(l),s:e.decode(d)} - } - ,hexFromSig(i){ - const{ - _tlv:s,_int:e} - =t.DER,n=`${ - s.encode(2,e.encode(i.r))} - ${ - s.encode(2,e.encode(i.s))} - `; - return s.encode(48,n)} - } - ; - const c=BigInt(0),l=BigInt(1),u=BigInt(2),d=BigInt(3),f=BigInt(4); - function p(t){ - const i=function(t){ - const i=(0,s.validateBasic)(t); - n.validateObject(i,{ - a:"field",b:"field"} - ,{ - allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"} - ); - const{ - endo:e,Fp:h,a:r} - =i; - if(e){ - if(!h.eql(r,h.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0"); - if("object"!=typeof e||"bigint"!=typeof e.beta||"function"!=typeof e.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")} - return Object.freeze({ - ...i} - )} - (t),{ - Fp:r} - =i,o=e.Field(i.n,i.nBitLength),a=i.toBytes||((t,i,s)=>{ - const e=i.toAffine(); - return n.concatBytes(Uint8Array.from([4]),r.toBytes(e.x),r.toBytes(e.y))} - ),u=i.fromBytes||(t=>{ - const i=t.subarray(1); - return{ - x:r.fromBytes(i.subarray(0,r.BYTES)),y:r.fromBytes(i.subarray(r.BYTES,2*r.BYTES))} - } - ); - function f(t){ - const{ - a:s,b:e} - =i,n=r.sqr(t),h=r.mul(n,t); - return r.add(r.add(h,r.mul(t,s)),e)} - if(Qt(f,"f"),!r.eql(r.sqr(i.Gy),f(i.Gx)))throw new Error("bad generator point: equation left != right"); - function p(t){ - const{ - allowedPrivateKeyLengths:s,nByteLength:r,wrapPrivateKey:o,n:a} - =i; - if(s&&"bigint"!=typeof t){ - if(n.isBytes(t)&&(t=n.bytesToHex(t)),"string"!=typeof t||!s.includes(t.length))throw new Error("Invalid key"); - t=t.padStart(2*r,"0")} - let c; - try{ - c="bigint"==typeof t?t:n.bytesToNumberBE((0,h.ensureBytes)("private key",t,r))} - catch(u){ - throw new Error(`private key must be ${ - r} - bytes, hex or bigint, not ${ - typeof t} - `)} - return o&&(c=e.mod(c,a)),n.aInRange("private key",c,l,a),c} - function w(t){ - if(!(t instanceof _))throw new Error("ProjectivePoint expected")} - Qt(p,"p"),Qt(w,"g"); - const g=(0,h.memoized)((t,i)=>{ - const{ - px:s,py:e,pz:n} - =t; - if(r.eql(n,r.ONE))return{ - x:s,y:e} - ; - const h=t.is0(); - null==i&&(i=h?r.ONE:r.inv(n)); - const o=r.mul(s,i),a=r.mul(e,i),c=r.mul(n,i); - if(h)return{ - x:r.ZERO,y:r.ZERO} - ; - if(!r.eql(c,r.ONE))throw new Error("invZ was invalid"); - return{ - x:o,y:a} - } - ),m=(0,h.memoized)(t=>{ - if(t.is0()){ - if(i.allowInfinityPoint&&!r.is0(t.py))return; - throw new Error("bad point: ZERO")} - const{ - x:s,y:e} - =t.toAffine(); - if(!r.isValid(s)||!r.isValid(e))throw new Error("bad point: x or y not FE"); - const n=r.sqr(e),h=f(s); - if(!r.eql(n,h))throw new Error("bad point: equation left != right"); - if(!t.isTorsionFree())throw new Error("bad point: not in prime-order subgroup"); - return!0} - ),v=class t{ - constructor(t,i,s){ - if(this.px=t,this.py=i,this.pz=s,null==t||!r.isValid(t))throw new Error("x required"); - if(null==i||!r.isValid(i))throw new Error("y required"); - if(null==s||!r.isValid(s))throw new Error("z required"); - Object.freeze(this)} - static fromAffine(i){ - const{ - x:s,y:e} - =i||{ - } - ; - if(!i||!r.isValid(s)||!r.isValid(e))throw new Error("invalid affine point"); - if(i instanceof t)throw new Error("projective point not allowed"); - const n=Qt(t=>r.eql(t,r.ZERO),"r"); - return n(s)&&n(e)?t.ZERO:new t(s,e,r.ONE)} - get x(){ - return this.toAffine().x} - get y(){ - return this.toAffine().y} - static normalizeZ(i){ - const s=r.invertBatch(i.map(t=>t.pz)); - return i.map((t,i)=>t.toAffine(s[i])).map(t.fromAffine)} - static fromHex(i){ - const s=t.fromAffine(u((0,h.ensureBytes)("pointHex",i))); - return s.assertValidity(),s} - static fromPrivateKey(i){ - return t.BASE.multiply(p(i))} - static msm(i,e){ - return(0,s.pippenger)(t,o,i,e)} - _setWindowSize(t){ - b.setWindowSize(this,t)} - assertValidity(){ - m(this)} - hasEvenY(){ - const{ - y:t} - =this.toAffine(); - if(r.isOdd)return!r.isOdd(t); - throw new Error("Field doesn't support isOdd")} - equals(t){ - w(t); - const{ - px:i,py:s,pz:e} - =this,{ - px:n,py:h,pz:o} - =t,a=r.eql(r.mul(i,o),r.mul(n,e)),c=r.eql(r.mul(s,o),r.mul(h,e)); - return a&&c} - negate(){ - return new t(this.px,r.neg(this.py),this.pz)} - double(){ - const{ - a:s,b:e} - =i,n=r.mul(e,d),{ - px:h,py:o,pz:a} - =this; - let c=r.ZERO,l=r.ZERO,u=r.ZERO,f=r.mul(h,h),p=r.mul(o,o),w=r.mul(a,a),g=r.mul(h,o); - return g=r.add(g,g),u=r.mul(h,a),u=r.add(u,u),c=r.mul(s,u),l=r.mul(n,w),l=r.add(c,l),c=r.sub(p,l),l=r.add(p,l),l=r.mul(c,l),c=r.mul(g,c),u=r.mul(n,u),w=r.mul(s,w),g=r.sub(f,w),g=r.mul(s,g),g=r.add(g,u),u=r.add(f,f),f=r.add(u,f),f=r.add(f,w),f=r.mul(f,g),l=r.add(l,f),w=r.mul(o,a),w=r.add(w,w),f=r.mul(w,g),c=r.sub(c,f),u=r.mul(w,p),u=r.add(u,u),u=r.add(u,u),new t(c,l,u)} - add(s){ - w(s); - const{ - px:e,py:n,pz:h} - =this,{ - px:o,py:a,pz:c} - =s; - let l=r.ZERO,u=r.ZERO,f=r.ZERO; - const p=i.a,g=r.mul(i.b,d); - let m=r.mul(e,o),v=r.mul(n,a),_=r.mul(h,c),M=r.add(e,n),b=r.add(o,a); - M=r.mul(M,b),b=r.add(m,v),M=r.sub(M,b),b=r.add(e,h); - let y=r.add(o,c); - return b=r.mul(b,y),y=r.add(m,_),b=r.sub(b,y),y=r.add(n,h),l=r.add(a,c),y=r.mul(y,l),l=r.add(v,_),y=r.sub(y,l),f=r.mul(p,b),l=r.mul(g,_),f=r.add(l,f),l=r.sub(v,f),f=r.add(v,f),u=r.mul(l,f),v=r.add(m,m),v=r.add(v,m),_=r.mul(p,_),b=r.mul(g,b),v=r.add(v,_),_=r.sub(m,_),_=r.mul(p,_),b=r.add(b,_),m=r.mul(v,b),u=r.add(u,m),m=r.mul(y,b),l=r.mul(M,l),l=r.sub(l,m),m=r.mul(M,v),f=r.mul(y,f),f=r.add(f,m),new t(l,u,f)} - subtract(t){ - return this.add(t.negate())} - is0(){ - return this.equals(t.ZERO)} - wNAF(i){ - return b.wNAFCached(this,i,t.normalizeZ)} - multiplyUnsafe(s){ - n.aInRange("scalar",s,c,i.n); - const e=t.ZERO; - if(s===c)return e; - if(s===l)return this; - const{ - endo:h} - =i; - if(!h)return b.unsafeLadder(this,s); - let{ - k1neg:o,k1:a,k2neg:u,k2:d} - =h.splitScalar(s),f=e,p=e,w=this; - for(; - a>c||d>c; - )a&l&&(f=f.add(w)),d&l&&(p=p.add(w)),w=w.double(),a>>=l,d>>=l; - return o&&(f=f.negate()),u&&(p=p.negate()),p=new t(r.mul(p.px,h.beta),p.py,p.pz),f.add(p)} - multiply(s){ - const{ - endo:e,n:h} - =i; - let o,a; - if(n.aInRange("scalar",s,l,h),e){ - const{ - k1neg:i,k1:n,k2neg:h,k2:c} - =e.splitScalar(s); - let{ - p:l,f:u} - =this.wNAF(n),{ - p:d,f} - =this.wNAF(c); - l=b.constTimeNegate(i,l),d=b.constTimeNegate(h,d),d=new t(r.mul(d.px,e.beta),d.py,d.pz),o=l.add(d),a=u.add(f)} - else{ - const{ - p:t,f:i} - =this.wNAF(s); - o=t,a=i} - return t.normalizeZ([o,a])[0]} - multiplyAndAddUnsafe(i,s,e){ - const n=t.BASE,h=Qt((t,i)=>i!==c&&i!==l&&t.equals(n)?t.multiply(i):t.multiplyUnsafe(i),"i"),r=h(this,s).add(h(i,e)); - return r.is0()?void 0:r} - toAffine(t){ - return g(this,t)} - isTorsionFree(){ - const{ - h:s,isTorsionFree:e} - =i; - if(s===l)return!0; - if(e)return e(t,this); - throw new Error("isTorsionFree() has not been declared for the elliptic curve")} - clearCofactor(){ - const{ - h:s,clearCofactor:e} - =i; - return s===l?this:e?e(t,this):this.multiplyUnsafe(i.h)} - toRawBytes(i=!0){ - return(0,h.abool)("isCompressed",i),this.assertValidity(),a(t,this,i)} - toHex(t=!0){ - return(0,h.abool)("isCompressed",t),n.bytesToHex(this.toRawBytes(t))} - } - ; - Qt(v,"v"); - let _=v; - _.BASE=new _(i.Gx,i.Gy,r.ONE),_.ZERO=new _(r.ZERO,r.ONE,r.ZERO); - const M=i.nBitLength,b=(0,s.wNAF)(_,i.endo?Math.ceil(M/2):M); - return{ - CURVE:i,ProjectivePoint:_,normPrivateKeyToScalar:p,weierstrassEquation:f,isWithinCurveOrder:Qt(function(t){ - return n.inRange(t,l,i.n)} - ,"isWithinCurveOrder")} - } - function w(t,i){ - const s=t.ORDER; - let e=c; - for(let d=s-l; - d%u===c; - d/=u)e+=l; - const n=e,h=u<<n-l-l,r=h*u,o=(s-l)/r,a=(o-l)/u,p=r-l,w=h,g=t.pow(i,o),m=t.pow(i,(o+l)/u); - let v=Qt((i,s)=>{ - let e=g,h=t.pow(s,p),r=t.sqr(h); - r=t.mul(r,s); - let o=t.mul(i,r); - o=t.pow(o,a),o=t.mul(o,h),h=t.mul(o,s),r=t.mul(o,i); - let c=t.mul(r,h); - o=t.pow(c,w); - let d=t.eql(o,t.ONE); - h=t.mul(r,m),o=t.mul(c,e),r=t.cmov(h,r,d),c=t.cmov(o,c,d); - for(let a=n; - a>l; - a--){ - let i=a-u; - i=u<<i-l; - let s=t.pow(c,i); - const n=t.eql(s,t.ONE); - h=t.mul(r,e),e=t.mul(e,e),s=t.mul(c,e),r=t.cmov(h,r,n),c=t.cmov(s,c,n)} - return{ - isValid:d,value:r} - } - ,"v"); - if(t.ORDER%f===d){ - const s=(t.ORDER-d)/f,e=t.sqrt(t.neg(i)); - v=Qt((i,n)=>{ - let h=t.sqr(n); - const r=t.mul(i,n); - h=t.mul(h,r); - let o=t.pow(h,s); - o=t.mul(o,r); - const a=t.mul(o,e),c=t.mul(t.sqr(o),n),l=t.eql(c,i); - return{ - isValid:l,value:t.cmov(a,o,l)} - } - ,"v")} - return v} - Qt(p,"f"),Qt(w,"p")} - (Ket),Object.defineProperty(Vet,"__esModule",{ - value:!0} - ),Vet.getHash=Xet,Vet.createCurve=function(t,i){ - const s=Qt(i=>(0,qet.weierstrass)({ - ...t,...Xet(i)} - ),"n"); - return Object.freeze({ - ...s(i),create:s} - )} - ; - const zet=jet,Yet=bit,qet=Ket; - function Xet(t){ - return{ - hash:t,hmac:Qt((i,...s)=>(0,zet.hmac)(t,i,(0,Yet.concatBytes)(...s)),"hmac"),randomBytes:Yet.randomBytes} - } - Qt(Xet,"hr"),function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.encodeToCurve=t.hashToCurve=t.schnorr=t.secp256k1=void 0; - const i=Net,s=bit,e=Vet,n=met,h=pst,r=wst,o=Ket,a=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),c=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),l=BigInt(1),u=BigInt(2),d=Qt((t,i)=>(t+i/u)/i,"h"); - function f(t){ - const i=a,s=BigInt(3),e=BigInt(6),n=BigInt(11),r=BigInt(22),o=BigInt(23),c=BigInt(44),l=BigInt(88),d=t*t*t%i,f=d*d*t%i,w=(0,h.pow2)(f,s,i)*f%i,g=(0,h.pow2)(w,s,i)*f%i,m=(0,h.pow2)(g,u,i)*d%i,v=(0,h.pow2)(m,n,i)*m%i,_=(0,h.pow2)(v,r,i)*v%i,M=(0,h.pow2)(_,c,i)*_%i,b=(0,h.pow2)(M,l,i)*M%i,y=(0,h.pow2)(b,c,i)*_%i,E=(0,h.pow2)(y,s,i)*f%i,A=(0,h.pow2)(E,o,i)*v%i,S=(0,h.pow2)(A,e,i)*d%i,T=(0,h.pow2)(S,u,i); - if(!p.eql(p.sqr(T),t))throw new Error("Cannot find square root"); - return T} - Qt(f,"f"); - const p=(0,h.Field)(a,void 0,void 0,{ - sqrt:f} - ); - t.secp256k1=(0,e.createCurve)({ - a:BigInt(0),b:BigInt(7),Fp:p,n:c,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{ - beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:Qt(t=>{ - const i=c,s=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),e=-l*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),r=s,o=BigInt("0x100000000000000000000000000000000"),a=d(r*t,i),u=d(-e*t,i); - let f=(0,h.mod)(t-a*s-u*n,i),p=(0,h.mod)(-a*e-u*r,i); - const w=f>o,g=p>o; - if(w&&(f=i-f),g&&(p=i-p),f>o||p>o)throw new Error("splitScalar: Endomorphism failed, k="+t); - return{ - k1neg:w,k1:f,k2neg:g,k2:p} - } - ,"splitScalar")} - } - ,i.sha256); - const w=BigInt(0),g={ - } - ; - function m(t,...s){ - let e=g[t]; - if(void 0===e){ - const s=(0,i.sha256)(Uint8Array.from(t,t=>t.charCodeAt(0))); - e=(0,r.concatBytes)(s,s),g[t]=e} - return(0,i.sha256)((0,r.concatBytes)(e,...s))} - Qt(m,"y"); - const v=Qt(t=>t.toRawBytes(!0).slice(1),"v"),_=Qt(t=>(0,r.numberToBytesBE)(t,32),"b"),M=Qt(t=>(0,h.mod)(t,a),"w"),b=Qt(t=>(0,h.mod)(t,c),"E"),y=t.secp256k1.ProjectivePoint,E=Qt((t,i,s)=>y.BASE.multiplyAndAddUnsafe(t,i,s),"_"); - function A(i){ - let s=t.secp256k1.utils.normPrivateKeyToScalar(i),e=y.fromPrivateKey(s); - return{ - scalar:e.hasEvenY()?s:b(-s),bytes:v(e)} - } - function S(t){ - (0,r.aInRange)("x",t,l,a); - const i=M(t*t); - let s=f(M(i*t+BigInt(7))); - s%u!==w&&(s=M(-s)); - const e=new y(t,s,l); - return e.assertValidity(),e} - Qt(A,"C"),Qt(S,"k"); - const T=r.bytesToNumberBE; - function C(...t){ - return b(T(m("BIP0340/challenge",...t)))} - function O(t){ - return A(t).bytes} - function I(t,i,e=(0,s.randomBytes)(32)){ - const n=(0,r.ensureBytes)("message",t),{ - bytes:h,scalar:o} - =A(i),a=(0,r.ensureBytes)("auxRand",e,32),c=_(o^T(m("BIP0340/aux",a))),l=m("BIP0340/nonce",c,h,n),u=b(T(l)); - if(u===w)throw new Error("sign failed: k is zero"); - const{ - bytes:d,scalar:f} - =A(u),p=C(d,h,n),g=new Uint8Array(64); - if(g.set(d,0),g.set(_(b(f+p*o)),32),!k(g,n,h))throw new Error("sign: Invalid signature produced"); - return g} - function k(t,i,s){ - const e=(0,r.ensureBytes)("signature",t,64),n=(0,r.ensureBytes)("message",i),h=(0,r.ensureBytes)("publicKey",s,32); - try{ - const t=S(T(h)),i=T(e.subarray(0,32)); - if(!(0,r.inRange)(i,l,a))return!1; - const s=T(e.subarray(32,64)); - if(!(0,r.inRange)(s,l,c))return!1; - const o=C(_(i),v(t),n),u=E(t,s,b(-o)); - return!(!u||!u.hasEvenY()||u.toAffine().x!==i)} - catch(o){ - return!1} - } - Qt(C,"x"),Qt(O,"M"),Qt(I,"I"),Qt(k,"T"),t.schnorr={ - getPublicKey:O,sign:I,verify:k,utils:{ - randomPrivateKey:t.secp256k1.utils.randomPrivateKey,lift_x:S,pointToBytes:v,numberToBytesBE:r.numberToBytesBE,bytesToNumberBE:r.bytesToNumberBE,taggedHash:m,mod:h.mod} - } - ; - const x=(0,n.isogenyMap)(p,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(t=>t.map(t=>BigInt(t)))),R=(0,o.mapToCurveSimpleSWU)(p,{ - A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:p.create(BigInt("-11"))} - ),P=(0,n.createHasher)(t.secp256k1.ProjectivePoint,t=>{ - const{ - x:i,y:s} - =R(p.create(t[0])); - return x(i,s)} - ,{ - DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:p.ORDER,m:1,k:128,expand:"xmd",hash:i.sha256} - ); - t.hashToCurve=P.hashToCurve,t.encodeToCurve=P.encodeToCurve} - (Pet); - var Jet={ - } - ; - !function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.decodeHex=t.remove0x=void 0; - var i=jtt; - t.remove0x=function(t){ - return t.startsWith("0x")||t.startsWith("0X")?t.slice(2):t} - ,t.decodeHex=function(s){ - return(0,i.hexToBytes)((0,t.remove0x)(s))} - } - (Jet),function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.hexToPublicKey=t.convertPublicKeyFormat=t.getSharedPoint=t.getPublicKey=t.isValidPrivateKey=t.getValidSecret=void 0; - var i=oit,s=cit,e=Pet,n=iit,h=sit,r=Jet; - function o(t,i,n,h){ - if("secp256k1"===t)return i(e.secp256k1); - if("x25519"===t)return n(s.x25519); - if("ed25519"===t)return h(s.ed25519); - throw new Error("Not implemented")} - t.getValidSecret=function(){ - var s; - do{ - s=(0,i.randomBytes)(h.SECRET_KEY_LENGTH)} - while(!(0,t.isValidPrivateKey)(s)); - return s} - ,t.isValidPrivateKey=function(t){ - return o((0,n.ellipticCurve)(),function(i){ - return i.utils.isValidPrivateKey(t)} - ,function(){ - return!0} - ,function(){ - return!0} - )} - ,t.getPublicKey=function(t){ - return o((0,n.ellipticCurve)(),function(i){ - return i.getPublicKey(t)} - ,function(i){ - return i.getPublicKey(t)} - ,function(i){ - return i.getPublicKey(t)} - )} - ,t.getSharedPoint=function(t,i,s){ - return o((0,n.ellipticCurve)(),function(e){ - return e.getSharedSecret(t,i,s)} - ,function(s){ - return s.getSharedSecret(t,i)} - ,function(s){ - return c(s,t,i)} - )} - ,t.convertPublicKeyFormat=function(t,i){ - return o((0,n.ellipticCurve)(),function(s){ - return s.getSharedSecret(BigInt(1),t,i)} - ,function(){ - return t} - ,function(){ - return t} - )} - ,Qt(o,"a"),t.hexToPublicKey=function(t){ - var i=(0,r.decodeHex)(t); - return o((0,n.ellipticCurve)(),function(){ - return a(i)} - ,function(){ - return i} - ,function(){ - return i} - )} - ; - var a=Qt(function(t){ - if(t.length===h.ETH_PUBLIC_KEY_SIZE){ - var i=new Uint8Array(1+t.length); - return i.set([4]),i.set(t,1),i} - return t} - ,"c"),c=Qt(function(t,i,s){ - var e=t.utils.getExtendedPublicKey(i).scalar; - return t.ExtendedPoint.fromHex(s).multiply(e).toRawBytes()} - ,"l")} - (rit); - var Qet={ - } - ,Zet={ - } - ; - Object.defineProperty(Zet,"__esModule",{ - value:!0} - ),Zet.hkdf=void 0,Zet.extract=ent,Zet.expand=rnt; - const tnt=dit,int=bit,snt=jet; - function ent(t,i,s){ - return(0,tnt.hash)(t),void 0===s&&(s=new Uint8Array(t.outputLen)),(0,snt.hmac)(t,(0,int.toBytes)(s),(0,int.toBytes)(i))} - Qt(ent,"br"); - const nnt=new Uint8Array([0]),hnt=new Uint8Array; - function rnt(t,i,s,e=32){ - if((0,tnt.hash)(t),(0,tnt.number)(e),e>255*t.outputLen)throw new Error("Length should be <= 255*HashLen"); - const n=Math.ceil(e/t.outputLen); - void 0===s&&(s=hnt); - const h=new Uint8Array(n*t.outputLen),r=snt.hmac.create(t,i),o=r._cloneInto(),a=new Uint8Array(r.outputLen); - for(let c=0; - c<n; - c++)nnt[0]=c+1,o.update(0===c?hnt:a).update(s).update(nnt).digestInto(a),h.set(a,t.outputLen*c),r._cloneInto(o); - return r.destroy(),o.destroy(),a.fill(0),nnt.fill(0),h.slice(0,e)} - Qt(rnt,"Sr"),Zet.hkdf=(t,i,s,e,n)=>rnt(t,ent(t,i,s),e,n),function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.getSharedKey=t.deriveKey=void 0; - var i=jtt,s=Zet,e=Net; - t.deriveKey=function(t,i,n){ - return(0,s.hkdf)(e.sha256,t,i,n,32)} - ,t.getSharedKey=function(){ - for(var s=[],e=0; - e<arguments.length; - e++)s[e]=arguments[e]; - return(0,t.deriveKey)(i.concatBytes.apply(void 0,s))} - } - (Qet); - var ont={ - } - ,ant={ - } - ,cnt={ - } - ,lnt={ - } - ; - Object.defineProperty(lnt,"__esModule",{ - value:!0} - ),lnt.polyval=lnt.ghash=void 0,lnt._toGHASHKey=mnt; - const unt=Ktt,dnt=jtt,fnt=16,pnt=new Uint8Array(16),wnt=(0,dnt.u32)(pnt),gnt=Qt(t=>(t>>>0&255)<<24|(t>>>8&255)<<16|(t>>>16&255)<<8|t>>>24&255,"Pr"); - function mnt(t){ - t.reverse(); - const i=1&t[15]; - let s=0; - for(let e=0; - e<t.length; - e++){ - const i=t[e]; - t[e]=i>>>1|s,s=(1&i)<<7} - return t[0]^=225&-i,t} - Qt(mnt,"Or"); - const vnt=class{ - constructor(t,i){ - this.blockLen=fnt,this.outputLen=fnt,this.s0=0,this.s1=0,this.s2=0,this.s3=0,this.finished=!1,t=(0,dnt.toBytes)(t),(0,unt.bytes)(t,16); - const s=(0,dnt.createView)(t); - let e=s.getUint32(0,!1),n=s.getUint32(4,!1),h=s.getUint32(8,!1),r=s.getUint32(12,!1); - const o=[]; - for(let m=0; - m<128; - m++)o.push({ - s0:gnt(e),s1:gnt(n),s2:gnt(h),s3:gnt(r)} - ),({ - s0:e,s1:n,s2:h,s3:r} - ={ - s3:(l=h)<<31|(u=r)>>>1,s2:(c=n)<<31|l>>>1,s1:(a=e)<<31|c>>>1,s0:a>>>1^225<<24&-(1&u)} - ); - var a,c,l,u; - const d=(f=i||1024)>65536?8:f>1024?4:2; - var f; - if(![1,2,4,8].includes(d))throw new Error(`ghash: wrong window size=${ - d} - , should be 2, 4 or 8`); - this.W=d; - const p=128/d,w=this.windowSize=2**d,g=[]; - for(let m=0; - m<p; - m++)for(let t=0; - t<w; - t++){ - let i=0,s=0,e=0,n=0; - for(let h=0; - h<d; - h++){ - if(!(t>>>d-h-1&1))continue; - const{ - s0:r,s1:a,s2:c,s3:l} - =o[d*m+h]; - i^=r,s^=a,e^=c,n^=l} - g.push({ - s0:i,s1:s,s2:e,s3:n} - )} - this.t=g} - _updateBlock(t,i,s,e){ - t^=this.s0,i^=this.s1,s^=this.s2,e^=this.s3; - const{ - W:n,t:h,windowSize:r} - =this; - let o=0,a=0,c=0,l=0; - const u=(1<<n)-1; - let d=0; - for(const f of[t,i,s,e])for(let t=0; - t<4; - t++){ - const i=f>>>8*t&255; - for(let t=8/n-1; - t>=0; - t--){ - const s=i>>>n*t&u,{ - s0:e,s1:f,s2:p,s3:w} - =h[d*r+s]; - o^=e,a^=f,c^=p,l^=w,d+=1} - } - this.s0=o,this.s1=a,this.s2=c,this.s3=l} - update(t){ - t=(0,dnt.toBytes)(t),(0,unt.exists)(this); - const i=(0,dnt.u32)(t),s=Math.floor(t.length/fnt),e=t.length%fnt; - for(let n=0; - n<s; - n++)this._updateBlock(i[4*n+0],i[4*n+1],i[4*n+2],i[4*n+3]); - return e&&(pnt.set(t.subarray(s*fnt)),this._updateBlock(wnt[0],wnt[1],wnt[2],wnt[3]),(0,dnt.clean)(wnt)),this} - destroy(){ - const{ - t} - =this; - for(const i of t)i.s0=0,i.s1=0,i.s2=0,i.s3=0} - digestInto(t){ - (0,unt.exists)(this),(0,unt.output)(t,this),this.finished=!0; - const{ - s0:i,s1:s,s2:e,s3:n} - =this,h=(0,dnt.u32)(t); - return h[0]=i,h[1]=s,h[2]=e,h[3]=n,t} - digest(){ - const t=new Uint8Array(fnt); - return this.digestInto(t),this.destroy(),t} - } - ; - Qt(vnt,"Nr"); - let _nt=vnt; - const Mnt=class extends _nt{ - constructor(t,i){ - t=(0,dnt.toBytes)(t); - const s=mnt((0,dnt.copyBytes)(t)); - super(s,i),(0,dnt.clean)(s)} - update(t){ - t=(0,dnt.toBytes)(t),(0,unt.exists)(this); - const i=(0,dnt.u32)(t),s=t.length%fnt,e=Math.floor(t.length/fnt); - for(let n=0; - n<e; - n++)this._updateBlock(gnt(i[4*n+3]),gnt(i[4*n+2]),gnt(i[4*n+1]),gnt(i[4*n+0])); - return s&&(pnt.set(t.subarray(e*fnt)),this._updateBlock(gnt(wnt[3]),gnt(wnt[2]),gnt(wnt[1]),gnt(wnt[0])),(0,dnt.clean)(wnt)),this} - digestInto(t){ - (0,unt.exists)(this),(0,unt.output)(t,this),this.finished=!0; - const{ - s0:i,s1:s,s2:e,s3:n} - =this,h=(0,dnt.u32)(t); - return h[0]=i,h[1]=s,h[2]=e,h[3]=n,t.reverse()} - } - ; - Qt(Mnt,"Lr"); - let bnt=Mnt; - function ynt(t){ - const i=Qt((i,s)=>t(s,i.length).update((0,dnt.toBytes)(i)).digest(),"t"),s=t(new Uint8Array(16),0); - return i.outputLen=s.outputLen,i.blockLen=s.blockLen,i.create=(i,s)=>t(i,s),i} - Qt(ynt,"Dr"),lnt.ghash=ynt((t,i)=>new _nt(t,i)),lnt.polyval=ynt((t,i)=>new bnt(t,i)),Object.defineProperty(cnt,"__esModule",{ - value:!0} - ),cnt.unsafe=cnt.aeskwp=cnt.aeskw=cnt.siv=cnt.gcm=cnt.cfb=cnt.cbc=cnt.ecb=cnt.ctr=void 0,cnt.expandKeyLE=Unt,cnt.expandKeyDecLE=Fnt; - const Ent=Ktt,Ant=lnt,Snt=jtt,Tnt=16,Cnt=new Uint8Array(Tnt); - function Ont(t){ - return t<<1^283&-(t>>7)} - function Int(t,i){ - let s=0; - for(; - i>0; - i>>=1)s^=t&-(1&i),t=Ont(t); - return s} - Qt(Ont,"Fr"),Qt(Int,"zr"); - const knt=(()=>{ - const t=new Uint8Array(256); - for(let s=0,e=1; - s<256; - s++,e^=Ont(e))t[s]=e; - const i=new Uint8Array(256); - i[0]=99; - for(let s=0; - s<255; - s++){ - let e=t[255-s]; - e|=e<<8,i[t[s]]=255&(e^e>>4^e>>5^e>>6^e>>7^99)} - return(0,Snt.clean)(t),i} - )(),xnt=knt.map((t,i)=>knt.indexOf(i)),Rnt=Qt(t=>t<<24|t>>>8,"Vr"),Pnt=Qt(t=>t<<8|t>>>24,"Gr"),Nnt=Qt(t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255,"Yr"); - function Lnt(t,i){ - if(256!==t.length)throw new Error("Wrong sbox length"); - const s=new Uint32Array(256).map((s,e)=>i(t[e])),e=s.map(Pnt),n=e.map(Pnt),h=n.map(Pnt),r=new Uint32Array(65536),o=new Uint32Array(65536),a=new Uint16Array(65536); - for(let c=0; - c<256; - c++)for(let i=0; - i<256; - i++){ - const l=256*c+i; - r[l]=s[c]^e[i],o[l]=n[c]^h[i],a[l]=t[c]<<8|t[i]} - return{ - sbox:t,sbox2:a,T0:s,T1:e,T2:n,T3:h,T01:r,T23:o} - } - Qt(Lnt,"Zr"); - const Dnt=Lnt(knt,t=>Int(t,3)<<24|t<<16|t<<8|Int(t,2)),Gnt=Lnt(xnt,t=>Int(t,11)<<24|Int(t,13)<<16|Int(t,9)<<8|Int(t,14)),Bnt=(()=>{ - const t=new Uint8Array(16); - for(let i=0,s=1; - i<16; - i++,s=Ont(s))t[i]=s; - return t} - )(); - function Unt(t){ - (0,Ent.bytes)(t); - const i=t.length; - if(![16,24,32].includes(i))throw new Error(`aes: wrong key size: should be 16, 24 or 32, got: ${ - i} - `); - const{ - sbox2:s} - =Dnt,e=[]; - (0,Snt.isAligned32)(t)||e.push(t=(0,Snt.copyBytes)(t)); - const n=(0,Snt.u32)(t),h=n.length,r=Qt(t=>Hnt(s,t,t,t,t),"s"),o=new Uint32Array(i+28); - o.set(n); - for(let a=h; - a<o.length; - a++){ - let t=o[a-1]; - a%h==0?t=r(Rnt(t))^Bnt[a/h-1]:h>6&&a%h==4&&(t=r(t)),o[a]=o[a-h]^t} - return(0,Snt.clean)(...e),o} - function Fnt(t){ - const i=Unt(t),s=i.slice(),e=i.length,{ - sbox2:n} - =Dnt,{ - T0:h,T1:r,T2:o,T3:a} - =Gnt; - for(let c=0; - c<e; - c+=4)for(let t=0; - t<4; - t++)s[c+t]=i[e-c-4+t]; - (0,Snt.clean)(i); - for(let c=4; - c<e-4; - c++){ - const t=s[c],i=Hnt(n,t,t,t,t); - s[c]=h[255&i]^r[i>>>8&255]^o[i>>>16&255]^a[i>>>24]} - return s} - function $nt(t,i,s,e,n,h){ - return t[s<<8&65280|e>>>8&255]^i[n>>>8&65280|h>>>24&255]} - function Hnt(t,i,s,e,n){ - return t[255&i|65280&s]|t[e>>>16&255|n>>>16&65280]<<16} - function Wnt(t,i,s,e,n){ - const{ - sbox2:h,T01:r,T23:o} - =Dnt; - let a=0; - i^=t[a++],s^=t[a++],e^=t[a++],n^=t[a++]; - const c=t.length/4-2; - for(let l=0; - l<c; - l++){ - const h=t[a++]^$nt(r,o,i,s,e,n),c=t[a++]^$nt(r,o,s,e,n,i),l=t[a++]^$nt(r,o,e,n,i,s),u=t[a++]^$nt(r,o,n,i,s,e); - i=h,s=c,e=l,n=u} - return{ - s0:t[a++]^Hnt(h,i,s,e,n),s1:t[a++]^Hnt(h,s,e,n,i),s2:t[a++]^Hnt(h,e,n,i,s),s3:t[a++]^Hnt(h,n,i,s,e)} - } - function Vnt(t,i,s,e,n){ - const{ - sbox2:h,T01:r,T23:o} - =Gnt; - let a=0; - i^=t[a++],s^=t[a++],e^=t[a++],n^=t[a++]; - const c=t.length/4-2; - for(let l=0; - l<c; - l++){ - const h=t[a++]^$nt(r,o,i,n,e,s),c=t[a++]^$nt(r,o,s,i,n,e),l=t[a++]^$nt(r,o,e,s,i,n),u=t[a++]^$nt(r,o,n,e,s,i); - i=h,s=c,e=l,n=u} - return{ - s0:t[a++]^Hnt(h,i,n,e,s),s1:t[a++]^Hnt(h,s,i,n,e),s2:t[a++]^Hnt(h,e,s,i,n),s3:t[a++]^Hnt(h,n,e,s,i)} - } - function jnt(t,i){ - if(void 0===i)return new Uint8Array(t); - if((0,Ent.bytes)(i),i.length<t)throw new Error(`aes: wrong destination length, expected at least ${ - t} - , got: ${ - i.length} - `); - if(!(0,Snt.isAligned32)(i))throw new Error("unaligned dst"); - return i} - function Knt(t,i,s,e){ - (0,Ent.bytes)(i,Tnt),(0,Ent.bytes)(s); - const n=s.length; - e=jnt(n,e); - const h=i,r=(0,Snt.u32)(h); - let{ - s0:o,s1:a,s2:c,s3:l} - =Wnt(t,r[0],r[1],r[2],r[3]); - const u=(0,Snt.u32)(s),d=(0,Snt.u32)(e); - for(let p=0; - p+4<=u.length; - p+=4){ - d[p+0]=u[p+0]^o,d[p+1]=u[p+1]^a,d[p+2]=u[p+2]^c,d[p+3]=u[p+3]^l; - let i=1; - for(let t=h.length-1; - t>=0; - t--)i=i+(255&h[t])|0,h[t]=255&i,i>>>=8; - ({ - s0:o,s1:a,s2:c,s3:l} - =Wnt(t,r[0],r[1],r[2],r[3]))} - const f=Tnt*Math.floor(u.length/4); - if(f<n){ - const t=new Uint32Array([o,a,c,l]),i=(0,Snt.u8)(t); - for(let h=f,r=0; - h<n; - h++,r++)e[h]=s[h]^i[r]; - (0,Snt.clean)(t)} - return e} - function znt(t,i,s,e,n){ - (0,Ent.bytes)(s,Tnt),(0,Ent.bytes)(e),n=jnt(e.length,n); - const h=s,r=(0,Snt.u32)(h),o=(0,Snt.createView)(h),a=(0,Snt.u32)(e),c=(0,Snt.u32)(n),l=i?0:12,u=e.length; - let d=o.getUint32(l,i),{ - s0:f,s1:p,s2:w,s3:g} - =Wnt(t,r[0],r[1],r[2],r[3]); - for(let v=0; - v+4<=a.length; - v+=4)c[v+0]=a[v+0]^f,c[v+1]=a[v+1]^p,c[v+2]=a[v+2]^w,c[v+3]=a[v+3]^g,d=d+1>>>0,o.setUint32(l,d,i),({ - s0:f,s1:p,s2:w,s3:g} - =Wnt(t,r[0],r[1],r[2],r[3])); - const m=Tnt*Math.floor(a.length/4); - if(m<u){ - const t=new Uint32Array([f,p,w,g]),i=(0,Snt.u8)(t); - for(let s=m,h=0; - s<u; - s++,h++)n[s]=e[s]^i[h]; - (0,Snt.clean)(t)} - return n} - function Ynt(t){ - if((0,Ent.bytes)(t),t.length%Tnt!=0)throw new Error("aes/(cbc-ecb).decrypt ciphertext should consist of blocks with size 16")} - function qnt(t,i,s){ - (0,Ent.bytes)(t); - let e=t.length; - const n=e%Tnt; - if(!i&&0!==n)throw new Error("aec/(cbc-ecb): unpadded plaintext with disabled padding"); - (0,Snt.isAligned32)(t)||(t=(0,Snt.copyBytes)(t)); - const h=(0,Snt.u32)(t); - if(i){ - let t=Tnt-n; - t||(t=Tnt),e+=t} - const r=jnt(e,s); - return{ - b:h,o:(0,Snt.u32)(r),out:r} - } - function Xnt(t,i){ - if(!i)return t; - const s=t.length; - if(!s)throw new Error("aes/pcks5: empty ciphertext not allowed"); - const e=t[s-1]; - if(e<=0||e>16)throw new Error("aes/pcks5: wrong padding"); - const n=t.subarray(0,-e); - for(let h=0; - h<e; - h++)if(t[s-h-1]!==e)throw new Error("aes/pcks5: wrong padding"); - return n} - function Jnt(t){ - const i=new Uint8Array(16),s=(0,Snt.u32)(i); - i.set(t); - const e=Tnt-t.length; - for(let n=Tnt-e; - n<Tnt; - n++)i[n]=e; - return s} - function Qnt(t,i,s,e,n){ - const h=null==n?0:n.length,r=t.create(s,e.length+h); - n&&r.update(n),r.update(e); - const o=new Uint8Array(16),a=(0,Snt.createView)(o); - n&&(0,Snt.setBigUint64)(a,0,BigInt(8*h),i),(0,Snt.setBigUint64)(a,8,BigInt(8*e.length),i),r.update(o); - const c=r.digest(); - return(0,Snt.clean)(o),c} - Qt(Unt,"ei"),Qt(Fnt,"ti"),Qt($nt,"ni"),Qt(Hnt,"ri"),Qt(Wnt,"ii"),Qt(Vnt,"oi"),Qt(jnt,"si"),Qt(Knt,"ai"),Qt(znt,"ci"),Qt(Ynt,"li"),Qt(qnt,"di"),Qt(Xnt,"ui"),Qt(Jnt,"hi"),Qt(Qnt,"fi"),cnt.ctr=(0,Snt.wrapCipher)({ - blockSize:16,nonceLength:16} - ,function(t,i){ - function s(s,e){ - if((0,Ent.bytes)(s),void 0!==e&&((0,Ent.bytes)(e),!(0,Snt.isAligned32)(e)))throw new Error("unaligned destination"); - const n=Unt(t),h=(0,Snt.copyBytes)(i),r=[n,h]; - (0,Snt.isAligned32)(s)||r.push(s=(0,Snt.copyBytes)(s)); - const o=Knt(n,h,s,e); - return(0,Snt.clean)(...r),o} - return Qt(s,"n"),(0,Ent.bytes)(t),(0,Ent.bytes)(i,Tnt),{ - encrypt:Qt((t,i)=>s(t,i),"encrypt"),decrypt:Qt((t,i)=>s(t,i),"decrypt")} - } - ),cnt.ecb=(0,Snt.wrapCipher)({ - blockSize:16} - ,function(t,i={ - } - ){ - (0,Ent.bytes)(t); - const s=!i.disablePadding; - return{ - encrypt(i,e){ - const{ - b:n,o:h,out:r} - =qnt(i,s,e),o=Unt(t); - let a=0; - for(; - a+4<=n.length; - ){ - const{ - s0:t,s1:i,s2:s,s3:e} - =Wnt(o,n[a+0],n[a+1],n[a+2],n[a+3]); - h[a++]=t,h[a++]=i,h[a++]=s,h[a++]=e} - if(s){ - const t=Jnt(i.subarray(4*a)),{ - s0:s,s1:e,s2:n,s3:r} - =Wnt(o,t[0],t[1],t[2],t[3]); - h[a++]=s,h[a++]=e,h[a++]=n,h[a++]=r} - return(0,Snt.clean)(o),r} - ,decrypt(i,e){ - Ynt(i); - const n=Fnt(t),h=jnt(i.length,e),r=[n]; - (0,Snt.isAligned32)(i)||r.push(i=(0,Snt.copyBytes)(i)); - const o=(0,Snt.u32)(i),a=(0,Snt.u32)(h); - for(let t=0; - t+4<=o.length; - ){ - const{ - s0:i,s1:s,s2:e,s3:h} - =Vnt(n,o[t+0],o[t+1],o[t+2],o[t+3]); - a[t++]=i,a[t++]=s,a[t++]=e,a[t++]=h} - return(0,Snt.clean)(...r),Xnt(h,s)} - } - } - ),cnt.cbc=(0,Snt.wrapCipher)({ - blockSize:16,nonceLength:16} - ,function(t,i,s={ - } - ){ - (0,Ent.bytes)(t),(0,Ent.bytes)(i,16); - const e=!s.disablePadding; - return{ - encrypt(s,n){ - const h=Unt(t),{ - b:r,o,out:a} - =qnt(s,e,n); - let c=i; - const l=[h]; - (0,Snt.isAligned32)(c)||l.push(c=(0,Snt.copyBytes)(c)); - const u=(0,Snt.u32)(c); - let d=u[0],f=u[1],p=u[2],w=u[3],g=0; - for(; - g+4<=r.length; - )d^=r[g+0],f^=r[g+1],p^=r[g+2],w^=r[g+3],({ - s0:d,s1:f,s2:p,s3:w} - =Wnt(h,d,f,p,w)),o[g++]=d,o[g++]=f,o[g++]=p,o[g++]=w; - if(e){ - const t=Jnt(s.subarray(4*g)); - d^=t[0],f^=t[1],p^=t[2],w^=t[3],({ - s0:d,s1:f,s2:p,s3:w} - =Wnt(h,d,f,p,w)),o[g++]=d,o[g++]=f,o[g++]=p,o[g++]=w} - return(0,Snt.clean)(...l),a} - ,decrypt(s,n){ - Ynt(s); - const h=Fnt(t); - let r=i; - const o=[h]; - (0,Snt.isAligned32)(r)||o.push(r=(0,Snt.copyBytes)(r)); - const a=(0,Snt.u32)(r),c=jnt(s.length,n); - (0,Snt.isAligned32)(s)||o.push(s=(0,Snt.copyBytes)(s)); - const l=(0,Snt.u32)(s),u=(0,Snt.u32)(c); - let d=a[0],f=a[1],p=a[2],w=a[3]; - for(let t=0; - t+4<=l.length; - ){ - const i=d,s=f,e=p,n=w; - d=l[t+0],f=l[t+1],p=l[t+2],w=l[t+3]; - const{ - s0:r,s1:o,s2:a,s3:c} - =Vnt(h,d,f,p,w); - u[t++]=r^i,u[t++]=o^s,u[t++]=a^e,u[t++]=c^n} - return(0,Snt.clean)(...o),Xnt(c,e)} - } - } - ),cnt.cfb=(0,Snt.wrapCipher)({ - blockSize:16,nonceLength:16} - ,function(t,i){ - function s(s,e,n){ - (0,Ent.bytes)(s); - const h=s.length; - n=jnt(h,n); - const r=Unt(t); - let o=i; - const a=[r]; - (0,Snt.isAligned32)(o)||a.push(o=(0,Snt.copyBytes)(o)),(0,Snt.isAligned32)(s)||a.push(s=(0,Snt.copyBytes)(s)); - const c=(0,Snt.u32)(s),l=(0,Snt.u32)(n),u=e?l:c,d=(0,Snt.u32)(o); - let f=d[0],p=d[1],w=d[2],g=d[3]; - for(let t=0; - t+4<=c.length; - ){ - const{ - s0:i,s1:s,s2:e,s3:n} - =Wnt(r,f,p,w,g); - l[t+0]=c[t+0]^i,l[t+1]=c[t+1]^s,l[t+2]=c[t+2]^e,l[t+3]=c[t+3]^n,f=u[t++],p=u[t++],w=u[t++],g=u[t++]} - const m=Tnt*Math.floor(c.length/4); - if(m<h){ - ({ - s0:f,s1:p,s2:w,s3:g} - =Wnt(r,f,p,w,g)); - const t=(0,Snt.u8)(new Uint32Array([f,p,w,g])); - for(let i=m,e=0; - i<h; - i++,e++)n[i]=s[i]^t[e]; - (0,Snt.clean)(t)} - return(0,Snt.clean)(...a),n} - return Qt(s,"n"),(0,Ent.bytes)(t),(0,Ent.bytes)(i,16),{ - encrypt:Qt((t,i)=>s(t,!0,i),"encrypt"),decrypt:Qt((t,i)=>s(t,!1,i),"decrypt")} - } - ),cnt.gcm=(0,Snt.wrapCipher)({ - blockSize:16,nonceLength:12,tagLength:16} - ,function(t,i,s){ - if((0,Ent.bytes)(t),(0,Ent.bytes)(i),void 0!==s&&(0,Ent.bytes)(s),i.length<8)throw new Error("aes/gcm: invalid nonce length"); - function e(t,i,e){ - const n=Qnt(Ant.ghash,!1,t,e,s); - for(let s=0; - s<i.length; - s++)n[s]^=i[s]; - return n} - function n(){ - const s=Unt(t),e=Cnt.slice(),n=Cnt.slice(); - if(znt(s,!1,n,n,e),12===i.length)n.set(i); - else{ - const t=Cnt.slice(),s=(0,Snt.createView)(t); - (0,Snt.setBigUint64)(s,8,BigInt(8*i.length),!1); - const h=Ant.ghash.create(e).update(i).update(t); - h.digestInto(n),h.destroy()} - return{ - xk:s,authKey:e,counter:n,tagMask:znt(s,!1,n,Cnt)} - } - return Qt(e,"i"),Qt(n,"o"),{ - encrypt(t){ - (0,Ent.bytes)(t); - const{ - xk:i,authKey:s,counter:h,tagMask:r} - =n(),o=new Uint8Array(t.length+16),a=[i,s,h,r]; - (0,Snt.isAligned32)(t)||a.push(t=(0,Snt.copyBytes)(t)),znt(i,!1,h,t,o); - const c=e(s,r,o.subarray(0,o.length-16)); - return a.push(c),o.set(c,t.length),(0,Snt.clean)(...a),o} - ,decrypt(t){ - if((0,Ent.bytes)(t),t.length<16)throw new Error("aes/gcm: ciphertext less than tagLen (16)"); - const{ - xk:i,authKey:s,counter:h,tagMask:r} - =n(),o=[i,s,r,h]; - (0,Snt.isAligned32)(t)||o.push(t=(0,Snt.copyBytes)(t)); - const a=t.subarray(0,-16),c=t.subarray(-16),l=e(s,r,a); - if(o.push(l),!(0,Snt.equalBytes)(l,c))throw new Error("aes/gcm: invalid ghash tag"); - const u=znt(i,!1,h,a); - return(0,Snt.clean)(...o),u} - } - } - ); - const Znt=Qt((t,i,s)=>e=>{ - if(!Number.isSafeInteger(e)||i>e||e>s)throw new Error(`${ - t} - : invalid value=${ - e} - , must be [${ - i} - ..${ - s} - ]`)} - ,"pi"); - function tht(t){ - return null!=t&&"object"==typeof t&&(t instanceof Uint32Array||"Uint32Array"===t.constructor.name)} - function iht(t,i){ - if((0,Ent.bytes)(i,16),!tht(t))throw new Error("_encryptBlock accepts result of expandKeyLE"); - const s=(0,Snt.u32)(i); - let{ - s0:e,s1:n,s2:h,s3:r} - =Wnt(t,s[0],s[1],s[2],s[3]); - return s[0]=e,s[1]=n,s[2]=h,s[3]=r,i} - function sht(t,i){ - if((0,Ent.bytes)(i,16),!tht(t))throw new Error("_decryptBlock accepts result of expandKeyLE"); - const s=(0,Snt.u32)(i); - let{ - s0:e,s1:n,s2:h,s3:r} - =Vnt(t,s[0],s[1],s[2],s[3]); - return s[0]=e,s[1]=n,s[2]=h,s[3]=r,i} - Qt(tht,"gi"),Qt(iht,"mi"),Qt(sht,"yi"),cnt.siv=(0,Snt.wrapCipher)({ - blockSize:16,nonceLength:12,tagLength:16} - ,function(t,i,s){ - const e=Znt("AAD",0,2**36),n=Znt("plaintext",0,2**36),h=Znt("nonce",12,12),r=Znt("ciphertext",16,2**36+16); - function o(){ - const s=Unt(t),e=new Uint8Array(t.length),n=new Uint8Array(16),h=[s,e]; - let r=i; - (0,Snt.isAligned32)(r)||h.push(r=(0,Snt.copyBytes)(r)); - const o=(0,Snt.u32)(r); - let a=0,c=o[0],l=o[1],u=o[2],d=0; - for(const t of[n,e].map(Snt.u32)){ - const i=(0,Snt.u32)(t); - for(let t=0; - t<i.length; - t+=2){ - const{ - s0:e,s1:n} - =Wnt(s,a,c,l,u); - i[t+0]=e,i[t+1]=n,a=++d} - } - const f={ - authKey:n,encKey:Unt(e)} - ; - return(0,Snt.clean)(...h),f} - function a(t,e,n){ - const h=Qnt(Ant.polyval,!0,e,n,s); - for(let s=0; - s<12; - s++)h[s]^=i[s]; - h[15]&=127; - const r=(0,Snt.u32)(h); - let o=r[0],a=r[1],c=r[2],l=r[3]; - return({ - s0:o,s1:a,s2:c,s3:l} - =Wnt(t,o,a,c,l)),r[0]=o,r[1]=a,r[2]=c,r[3]=l,h} - function c(t,i,s){ - let e=(0,Snt.copyBytes)(i); - e[15]|=128; - const n=znt(t,!0,e,s); - return(0,Snt.clean)(e),n} - return Qt(o,"a"),Qt(a,"c"),Qt(c,"l"),(0,Ent.bytes)(t,16,24,32),(0,Ent.bytes)(i),h(i.length),void 0!==s&&((0,Ent.bytes)(s),e(s.length)),{ - encrypt(t){ - (0,Ent.bytes)(t),n(t.length); - const{ - encKey:i,authKey:s} - =o(),e=a(i,s,t),h=[i,s,e]; - (0,Snt.isAligned32)(t)||h.push(t=(0,Snt.copyBytes)(t)); - const r=new Uint8Array(t.length+16); - return r.set(e,t.length),r.set(c(i,e,t)),(0,Snt.clean)(...h),r} - ,decrypt(t){ - (0,Ent.bytes)(t),r(t.length); - const i=t.subarray(-16),{ - encKey:s,authKey:e} - =o(),n=[s,e]; - (0,Snt.isAligned32)(t)||n.push(t=(0,Snt.copyBytes)(t)); - const h=c(s,i,t.subarray(0,-16)),l=a(s,e,h); - if(n.push(l),!(0,Snt.equalBytes)(i,l))throw(0,Snt.clean)(...n),new Error("invalid polyval tag"); - return(0,Snt.clean)(...n),h} - } - } - ); - const eht={ - encrypt(t,i){ - if(i.length>=2**32)throw new Error("plaintext should be less than 4gb"); - const s=Unt(t); - if(16===i.length)iht(s,i); - else{ - const t=(0,Snt.u32)(i); - let e=t[0],n=t[1]; - for(let i=0,h=1; - i<6; - i++)for(let r=2; - r<t.length; - r+=2,h++){ - const{ - s0:i,s1:o,s2:a,s3:c} - =Wnt(s,e,n,t[r],t[r+1]); - e=i,n=o^Nnt(h),t[r]=a,t[r+1]=c} - t[0]=e,t[1]=n} - s.fill(0)} - ,decrypt(t,i){ - if(i.length-8>=2**32)throw new Error("ciphertext should be less than 4gb"); - const s=Fnt(t),e=i.length/8-1; - if(1===e)sht(s,i); - else{ - const t=(0,Snt.u32)(i); - let n=t[0],h=t[1]; - for(let i=0,r=6*e; - i<6; - i++)for(let o=2*e; - o>=1; - o-=2,r--){ - h^=Nnt(r); - const{ - s0:i,s1:e,s2:a,s3:c} - =Vnt(s,n,h,t[o],t[o+1]); - n=i,h=e,t[o]=a,t[o+1]=c} - t[0]=n,t[1]=h} - s.fill(0)} - } - ,nht=new Uint8Array(8).fill(166); - cnt.aeskw=(0,Snt.wrapCipher)({ - blockSize:8} - ,t=>({ - encrypt(i){ - if((0,Ent.bytes)(i),!i.length||i.length%8!=0)throw new Error("invalid plaintext length"); - if(8===i.length)throw new Error("8-byte keys not allowed in AESKW, use AESKWP instead"); - const s=(0,Snt.concatBytes)(nht,i); - return eht.encrypt(t,s),s} - ,decrypt(i){ - if((0,Ent.bytes)(i),i.length%8!=0||i.length<24)throw new Error("invalid ciphertext length"); - const s=(0,Snt.copyBytes)(i); - if(eht.decrypt(t,s),!(0,Snt.equalBytes)(s.subarray(0,8),nht))throw new Error("integrity check failed"); - return s.subarray(0,8).fill(0),s.subarray(8)} - } - )); - const hht=2790873510; - cnt.aeskwp=(0,Snt.wrapCipher)({ - blockSize:8} - ,t=>({ - encrypt(i){ - if((0,Ent.bytes)(i),!i.length)throw new Error("invalid plaintext length"); - const s=8*Math.ceil(i.length/8),e=new Uint8Array(8+s); - e.set(i,8); - const n=(0,Snt.u32)(e); - return n[0]=hht,n[1]=Nnt(i.length),eht.encrypt(t,e),e} - ,decrypt(i){ - if((0,Ent.bytes)(i),i.length<16)throw new Error("invalid ciphertext length"); - const s=(0,Snt.copyBytes)(i),e=(0,Snt.u32)(s); - eht.decrypt(t,s); - const n=Nnt(e[1])>>>0,h=8*Math.ceil(n/8); - if(e[0]!==hht||s.length-8!==h)throw new Error("integrity check failed"); - for(let t=n; - t<h; - t++)if(0!==s[8+t])throw new Error("integrity check failed"); - return s.subarray(0,8).fill(0),s.subarray(8,8+n)} - } - )),cnt.unsafe={ - expandKeyLE:Unt,expandKeyDecLE:Fnt,encrypt:Wnt,decrypt:Vnt,encryptBlock:iht,decryptBlock:sht,ctrCounter:Knt,ctr32:znt} - ,Object.defineProperty(ant,"__esModule",{ - value:!0} - ),ant.aes256cbc=ant.aes256gcm=void 0; - var rht=cnt; - ant.aes256gcm=function(t,i,s){ - return(0,rht.gcm)(t,i,s)} - ,ant.aes256cbc=function(t,i,s){ - return(0,rht.cbc)(t,i)} - ; - var oht={ - } - ,aht={ - } - ,cht={ - } - ; - Object.defineProperty(cht,"__esModule",{ - value:!0} - ),cht.sigma=void 0,cht.rotl=function(t,i){ - return t<<i|t>>>32-i} - ,cht.createCipher=function(t,i){ - const{ - allowShortKeys:s,extendNonceFn:e,counterLength:n,counterRight:h,rounds:r} - =(0,uht.checkOpts)({ - allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20} - ,i); - if("function"!=typeof t)throw new Error("core must be a function"); - return(0,lht.number)(n),(0,lht.number)(r),(0,lht.bool)(h),(0,lht.bool)(s),(i,o,a,c,l=0)=>{ - (0,lht.bytes)(i),(0,lht.bytes)(o),(0,lht.bytes)(a); - const u=a.length; - if(void 0===c&&(c=new Uint8Array(u)),(0,lht.bytes)(c),(0,lht.number)(l),l<0||l>=Mht)throw new Error("arx: counter overflow"); - if(c.length<u)throw new Error(`arx: output (${ - c.length} - ) is shorter than data (${ - u} - )`); - const d=[]; - let f,p,w=i.length; - if(32===w)d.push(f=(0,uht.copyBytes)(i)),p=ght; - else{ - if(16!==w||!s)throw new Error(`arx: invalid 32-byte key, got length=${ - w} - `); - f=new Uint8Array(32),f.set(i),f.set(i,16),p=wht,d.push(f)} - mht(o)||d.push(o=(0,uht.copyBytes)(o)); - const g=(0,uht.u32)(f); - if(e){ - if(24!==o.length)throw new Error("arx: extended nonce must be 24 bytes"); - e(p,g,(0,uht.u32)(o.subarray(0,16)),g),o=o.subarray(16)} - const m=16-n; - if(m!==o.length)throw new Error(`arx: nonce must be ${ - m} - or 16 bytes`); - if(12!==m){ - const t=new Uint8Array(12); - t.set(o,h?0:12-o.length),o=t,d.push(o)} - const v=(0,uht.u32)(o); - return function(t,i,s,e,n,h,r,o){ - const a=n.length,c=new Uint8Array(vht),l=(0,uht.u32)(c),u=mht(n)&&mht(h),d=u?(0,uht.u32)(n):bht,f=u?(0,uht.u32)(h):bht; - for(let p=0; - p<a; - r++){ - if(t(i,s,e,l,r,o),r>=Mht)throw new Error("arx: counter overflow"); - const w=Math.min(vht,a-p); - if(u&&w===vht){ - const t=p/4; - if(p%4!=0)throw new Error("arx: invalid block position"); - for(let i,s=0; - s<_ht; - s++)i=t+s,f[i]=d[i]^l[s]; - p+=vht} - else{ - for(let t,i=0; - i<w; - i++)t=p+i,h[t]=n[t]^c[i]; - p+=w} - } - } - (t,p,g,v,a,c,l,r),(0,uht.clean)(...d),c} - } - ; - const lht=Ktt,uht=jtt,dht=Qt(t=>Uint8Array.from(t.split("").map(t=>t.charCodeAt(0))),"xi"),fht=dht("expand 16-byte k"),pht=dht("expand 32-byte k"),wht=(0,uht.u32)(fht),ght=(0,uht.u32)(pht); - function mht(t){ - return t.byteOffset%4==0} - Qt(mht,"Pi"),cht.sigma=ght.slice(); - const vht=64,_ht=16,Mht=2**32-1,bht=new Uint32Array; - var yht={ - } - ; - Object.defineProperty(yht,"__esModule",{ - value:!0} - ),yht.poly1305=void 0,yht.wrapConstructorWithKey=Oht; - const Eht=Ktt,Aht=jtt,Sht=Qt((t,i)=>255&t[i++]|(255&t[i++])<<8,"ji"),Tht=class{ - constructor(t){ - this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,t=(0,Aht.toBytes)(t),(0,Eht.bytes)(t,32); - const i=Sht(t,0),s=Sht(t,2),e=Sht(t,4),n=Sht(t,6),h=Sht(t,8),r=Sht(t,10),o=Sht(t,12),a=Sht(t,14); - this.r[0]=8191&i,this.r[1]=8191&(i>>>13|s<<3),this.r[2]=7939&(s>>>10|e<<6),this.r[3]=8191&(e>>>7|n<<9),this.r[4]=255&(n>>>4|h<<12),this.r[5]=h>>>1&8190,this.r[6]=8191&(h>>>14|r<<2),this.r[7]=8065&(r>>>11|o<<5),this.r[8]=8191&(o>>>8|a<<8),this.r[9]=a>>>5&127; - for(let c=0; - c<8; - c++)this.pad[c]=Sht(t,16+2*c)} - process(t,i,s=!1){ - const e=s?0:2048,{ - h:n,r:h} - =this,r=h[0],o=h[1],a=h[2],c=h[3],l=h[4],u=h[5],d=h[6],f=h[7],p=h[8],w=h[9],g=Sht(t,i+0),m=Sht(t,i+2),v=Sht(t,i+4),_=Sht(t,i+6),M=Sht(t,i+8),b=Sht(t,i+10),y=Sht(t,i+12),E=Sht(t,i+14); - let A=n[0]+(8191&g),S=n[1]+(8191&(g>>>13|m<<3)),T=n[2]+(8191&(m>>>10|v<<6)),C=n[3]+(8191&(v>>>7|_<<9)),O=n[4]+(8191&(_>>>4|M<<12)),I=n[5]+(M>>>1&8191),k=n[6]+(8191&(M>>>14|b<<2)),x=n[7]+(8191&(b>>>11|y<<5)),R=n[8]+(8191&(y>>>8|E<<8)),P=n[9]+(E>>>5|e),N=0,L=N+A*r+S*(5*w)+T*(5*p)+C*(5*f)+O*(5*d); - N=L>>>13,L&=8191,L+=I*(5*u)+k*(5*l)+x*(5*c)+R*(5*a)+P*(5*o),N+=L>>>13,L&=8191; - let D=N+A*o+S*r+T*(5*w)+C*(5*p)+O*(5*f); - N=D>>>13,D&=8191,D+=I*(5*d)+k*(5*u)+x*(5*l)+R*(5*c)+P*(5*a),N+=D>>>13,D&=8191; - let G=N+A*a+S*o+T*r+C*(5*w)+O*(5*p); - N=G>>>13,G&=8191,G+=I*(5*f)+k*(5*d)+x*(5*u)+R*(5*l)+P*(5*c),N+=G>>>13,G&=8191; - let B=N+A*c+S*a+T*o+C*r+O*(5*w); - N=B>>>13,B&=8191,B+=I*(5*p)+k*(5*f)+x*(5*d)+R*(5*u)+P*(5*l),N+=B>>>13,B&=8191; - let U=N+A*l+S*c+T*a+C*o+O*r; - N=U>>>13,U&=8191,U+=I*(5*w)+k*(5*p)+x*(5*f)+R*(5*d)+P*(5*u),N+=U>>>13,U&=8191; - let F=N+A*u+S*l+T*c+C*a+O*o; - N=F>>>13,F&=8191,F+=I*r+k*(5*w)+x*(5*p)+R*(5*f)+P*(5*d),N+=F>>>13,F&=8191; - let $=N+A*d+S*u+T*l+C*c+O*a; - N=$>>>13,$&=8191,$+=I*o+k*r+x*(5*w)+R*(5*p)+P*(5*f),N+=$>>>13,$&=8191; - let H=N+A*f+S*d+T*u+C*l+O*c; - N=H>>>13,H&=8191,H+=I*a+k*o+x*r+R*(5*w)+P*(5*p),N+=H>>>13,H&=8191; - let W=N+A*p+S*f+T*d+C*u+O*l; - N=W>>>13,W&=8191,W+=I*c+k*a+x*o+R*r+P*(5*w),N+=W>>>13,W&=8191; - let V=N+A*w+S*p+T*f+C*d+O*u; - N=V>>>13,V&=8191,V+=I*l+k*c+x*a+R*o+P*r,N+=V>>>13,V&=8191,N=(N<<2)+N|0,N=N+L|0,L=8191&N,N>>>=13,D+=N,n[0]=L,n[1]=D,n[2]=G,n[3]=B,n[4]=U,n[5]=F,n[6]=$,n[7]=H,n[8]=W,n[9]=V} - finalize(){ - const{ - h:t,pad:i} - =this,s=new Uint16Array(10); - let e=t[1]>>>13; - t[1]&=8191; - for(let r=2; - r<10; - r++)t[r]+=e,e=t[r]>>>13,t[r]&=8191; - t[0]+=5*e,e=t[0]>>>13,t[0]&=8191,t[1]+=e,e=t[1]>>>13,t[1]&=8191,t[2]+=e,s[0]=t[0]+5,e=s[0]>>>13,s[0]&=8191; - for(let r=1; - r<10; - r++)s[r]=t[r]+e,e=s[r]>>>13,s[r]&=8191; - s[9]-=8192; - let n=(1^e)-1; - for(let r=0; - r<10; - r++)s[r]&=n; - n=~n; - for(let r=0; - r<10; - r++)t[r]=t[r]&n|s[r]; - t[0]=65535&(t[0]|t[1]<<13),t[1]=65535&(t[1]>>>3|t[2]<<10),t[2]=65535&(t[2]>>>6|t[3]<<7),t[3]=65535&(t[3]>>>9|t[4]<<4),t[4]=65535&(t[4]>>>12|t[5]<<1|t[6]<<14),t[5]=65535&(t[6]>>>2|t[7]<<11),t[6]=65535&(t[7]>>>5|t[8]<<8),t[7]=65535&(t[8]>>>8|t[9]<<5); - let h=t[0]+i[0]; - t[0]=65535&h; - for(let r=1; - r<8; - r++)h=(t[r]+i[r]|0)+(h>>>16)|0,t[r]=65535&h; - (0,Aht.clean)(s)} - update(t){ - (0,Eht.exists)(this); - const{ - buffer:i,blockLen:s} - =this,e=(t=(0,Aht.toBytes)(t)).length; - for(let n=0; - n<e; - ){ - const h=Math.min(s-this.pos,e-n); - if(h!==s)i.set(t.subarray(n,n+h),this.pos),this.pos+=h,n+=h,this.pos===s&&(this.process(i,0,!1),this.pos=0); - else for(; - s<=e-n; - n+=s)this.process(t,n)} - return this} - destroy(){ - (0,Aht.clean)(this.h,this.r,this.buffer,this.pad)} - digestInto(t){ - (0,Eht.exists)(this),(0,Eht.output)(t,this),this.finished=!0; - const{ - buffer:i,h:s} - =this; - let{ - pos:e} - =this; - if(e){ - for(i[e++]=1; - e<16; - e++)i[e]=0; - this.process(i,0,!0)} - this.finalize(); - let n=0; - for(let h=0; - h<8; - h++)t[n++]=s[h]>>>0,t[n++]=s[h]>>>8; - return t} - digest(){ - const{ - buffer:t,outputLen:i} - =this; - this.digestInto(t); - const s=t.slice(0,i); - return this.destroy(),s} - } - ; - Qt(Tht,"Ui"); - let Cht=Tht; - function Oht(t){ - const i=Qt((i,s)=>t(s).update((0,Aht.toBytes)(i)).digest(),"t"),s=t(new Uint8Array(32)); - return i.outputLen=s.outputLen,i.blockLen=s.blockLen,i.create=i=>t(i),i} - Qt(Oht,"Hi"),yht.poly1305=Oht(t=>new Cht(t)),function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.xchacha20poly1305=t.chacha20poly1305=t._poly1305_aead=t.chacha12=t.chacha8=t.xchacha20=t.chacha20=t.chacha20orig=void 0,t.hchacha=r; - const i=cht,s=Ktt,e=yht,n=jtt; - function h(t,s,e,n,h,r=20){ - let o=t[0],a=t[1],c=t[2],l=t[3],u=s[0],d=s[1],f=s[2],p=s[3],w=s[4],g=s[5],m=s[6],v=s[7],_=h,M=e[0],b=e[1],y=e[2],E=o,A=a,S=c,T=l,C=u,O=d,I=f,k=p,x=w,R=g,P=m,N=v,L=_,D=M,G=b,B=y; - for(let F=0; - F<r; - F+=2)E=E+C|0,L=(0,i.rotl)(L^E,16),x=x+L|0,C=(0,i.rotl)(C^x,12),E=E+C|0,L=(0,i.rotl)(L^E,8),x=x+L|0,C=(0,i.rotl)(C^x,7),A=A+O|0,D=(0,i.rotl)(D^A,16),R=R+D|0,O=(0,i.rotl)(O^R,12),A=A+O|0,D=(0,i.rotl)(D^A,8),R=R+D|0,O=(0,i.rotl)(O^R,7),S=S+I|0,G=(0,i.rotl)(G^S,16),P=P+G|0,I=(0,i.rotl)(I^P,12),S=S+I|0,G=(0,i.rotl)(G^S,8),P=P+G|0,I=(0,i.rotl)(I^P,7),T=T+k|0,B=(0,i.rotl)(B^T,16),N=N+B|0,k=(0,i.rotl)(k^N,12),T=T+k|0,B=(0,i.rotl)(B^T,8),N=N+B|0,k=(0,i.rotl)(k^N,7),E=E+O|0,B=(0,i.rotl)(B^E,16),P=P+B|0,O=(0,i.rotl)(O^P,12),E=E+O|0,B=(0,i.rotl)(B^E,8),P=P+B|0,O=(0,i.rotl)(O^P,7),A=A+I|0,L=(0,i.rotl)(L^A,16),N=N+L|0,I=(0,i.rotl)(I^N,12),A=A+I|0,L=(0,i.rotl)(L^A,8),N=N+L|0,I=(0,i.rotl)(I^N,7),S=S+k|0,D=(0,i.rotl)(D^S,16),x=x+D|0,k=(0,i.rotl)(k^x,12),S=S+k|0,D=(0,i.rotl)(D^S,8),x=x+D|0,k=(0,i.rotl)(k^x,7),T=T+C|0,G=(0,i.rotl)(G^T,16),R=R+G|0,C=(0,i.rotl)(C^R,12),T=T+C|0,G=(0,i.rotl)(G^T,8),R=R+G|0,C=(0,i.rotl)(C^R,7); - let U=0; - n[U++]=o+E|0,n[U++]=a+A|0,n[U++]=c+S|0,n[U++]=l+T|0,n[U++]=u+C|0,n[U++]=d+O|0,n[U++]=f+I|0,n[U++]=p+k|0,n[U++]=w+x|0,n[U++]=g+R|0,n[U++]=m+P|0,n[U++]=v+N|0,n[U++]=_+L|0,n[U++]=M+D|0,n[U++]=b+G|0,n[U++]=y+B|0} - function r(t,s,e,n){ - let h=t[0],r=t[1],o=t[2],a=t[3],c=s[0],l=s[1],u=s[2],d=s[3],f=s[4],p=s[5],w=s[6],g=s[7],m=e[0],v=e[1],_=e[2],M=e[3]; - for(let y=0; - y<20; - y+=2)h=h+c|0,m=(0,i.rotl)(m^h,16),f=f+m|0,c=(0,i.rotl)(c^f,12),h=h+c|0,m=(0,i.rotl)(m^h,8),f=f+m|0,c=(0,i.rotl)(c^f,7),r=r+l|0,v=(0,i.rotl)(v^r,16),p=p+v|0,l=(0,i.rotl)(l^p,12),r=r+l|0,v=(0,i.rotl)(v^r,8),p=p+v|0,l=(0,i.rotl)(l^p,7),o=o+u|0,_=(0,i.rotl)(_^o,16),w=w+_|0,u=(0,i.rotl)(u^w,12),o=o+u|0,_=(0,i.rotl)(_^o,8),w=w+_|0,u=(0,i.rotl)(u^w,7),a=a+d|0,M=(0,i.rotl)(M^a,16),g=g+M|0,d=(0,i.rotl)(d^g,12),a=a+d|0,M=(0,i.rotl)(M^a,8),g=g+M|0,d=(0,i.rotl)(d^g,7),h=h+l|0,M=(0,i.rotl)(M^h,16),w=w+M|0,l=(0,i.rotl)(l^w,12),h=h+l|0,M=(0,i.rotl)(M^h,8),w=w+M|0,l=(0,i.rotl)(l^w,7),r=r+u|0,m=(0,i.rotl)(m^r,16),g=g+m|0,u=(0,i.rotl)(u^g,12),r=r+u|0,m=(0,i.rotl)(m^r,8),g=g+m|0,u=(0,i.rotl)(u^g,7),o=o+d|0,v=(0,i.rotl)(v^o,16),f=f+v|0,d=(0,i.rotl)(d^f,12),o=o+d|0,v=(0,i.rotl)(v^o,8),f=f+v|0,d=(0,i.rotl)(d^f,7),a=a+c|0,_=(0,i.rotl)(_^a,16),p=p+_|0,c=(0,i.rotl)(c^p,12),a=a+c|0,_=(0,i.rotl)(_^a,8),p=p+_|0,c=(0,i.rotl)(c^p,7); - let b=0; - n[b++]=h,n[b++]=r,n[b++]=o,n[b++]=a,n[b++]=m,n[b++]=v,n[b++]=_,n[b++]=M} - Qt(h,"o"),Qt(r,"s"),t.chacha20orig=(0,i.createCipher)(h,{ - counterRight:!1,counterLength:8,allowShortKeys:!0} - ),t.chacha20=(0,i.createCipher)(h,{ - counterRight:!1,counterLength:4,allowShortKeys:!1} - ),t.xchacha20=(0,i.createCipher)(h,{ - counterRight:!1,counterLength:8,extendNonceFn:r,allowShortKeys:!1} - ),t.chacha8=(0,i.createCipher)(h,{ - counterRight:!1,counterLength:4,rounds:8} - ),t.chacha12=(0,i.createCipher)(h,{ - counterRight:!1,counterLength:4,rounds:12} - ); - const o=new Uint8Array(16),a=Qt((t,i)=>{ - t.update(i); - const s=i.length%16; - s&&t.update(o.subarray(s))} - ,"c"),c=new Uint8Array(32); - function l(t,i,s,h,r){ - const o=t(i,s,c),l=e.poly1305.create(o); - r&&a(l,r),a(l,h); - const u=new Uint8Array(16),d=(0,n.createView)(u); - (0,n.setBigUint64)(d,0,BigInt(r?r.length:0),!0),(0,n.setBigUint64)(d,8,BigInt(h.length),!0),l.update(u); - const f=l.digest(); - return(0,n.clean)(o,u),f} - Qt(l,"d"),t._poly1305_aead=t=>(i,e,h)=>((0,s.bytes)(i,32),(0,s.bytes)(e),{ - encrypt(r,o){ - const a=r.length,c=a+16; - o?(0,s.bytes)(o,c):o=new Uint8Array(c),t(i,e,r,o,1); - const u=l(t,i,e,o.subarray(0,-16),h); - return o.set(u,a),(0,n.clean)(u),o} - ,decrypt(r,o){ - const a=r.length,c=a-16; - if(a<16)throw new Error("encrypted data must be at least 16 bytes"); - o?(0,s.bytes)(o,c):o=new Uint8Array(c); - const u=r.subarray(0,-16),d=r.subarray(-16),f=l(t,i,e,u,h); - if(!(0,n.equalBytes)(d,f))throw new Error("invalid tag"); - return t(i,e,u,o,1),(0,n.clean)(f),o} - } - ),t.chacha20poly1305=(0,n.wrapCipher)({ - blockSize:64,nonceLength:12,tagLength:16} - ,(0,t._poly1305_aead)(t.chacha20)),t.xchacha20poly1305=(0,n.wrapCipher)({ - blockSize:64,nonceLength:24,tagLength:16} - ,(0,t._poly1305_aead)(t.xchacha20))} - (aht),Object.defineProperty(oht,"__esModule",{ - value:!0} - ),oht.xchacha20=void 0; - var Iht,kht,xht,Rht=aht; - oht.xchacha20=function(t,i,s){ - return(0,Rht.xchacha20poly1305)(t,i,s)} - ,function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.aesDecrypt=t.aesEncrypt=t.symDecrypt=t.symEncrypt=void 0; - var i=jtt,s=oit,e=ant,n=oht,h=iit,r=sit; - function o(t,i,s,o){ - var a=(0,h.symmetricAlgorithm)(); - if("aes-256-gcm"===a)return t(e.aes256gcm,i,s,(0,h.symmetricNonceLength)(),r.AEAD_TAG_LENGTH,o); - if("xchacha20"===a)return t(n.xchacha20,i,s,r.XCHACHA20_NONCE_LENGTH,r.AEAD_TAG_LENGTH,o); - if("aes-256-cbc"===a)return t(e.aes256cbc,i,s,16,0); - throw new Error("Not implemented")} - function a(t,e,n,h,r,o){ - var a=(0,s.randomBytes)(h),c=t(e,a,o).encrypt(n); - if(0===r)return(0,i.concatBytes)(a,c); - var l=c.length-r,u=c.subarray(0,l),d=c.subarray(l); - return(0,i.concatBytes)(a,d,u)} - function c(t,s,e,n,h,r){ - var o=e.subarray(0,n),a=t(s,Uint8Array.from(o),r),c=e.subarray(n); - if(0===h)return a.decrypt(c); - var l=c.subarray(0,h),u=c.subarray(h); - return a.decrypt((0,i.concatBytes)(u,l))} - t.symEncrypt=function(t,i,s){ - return o(a,t,i,s)} - ,Qt(o,"a"),Qt(a,"c"),Qt(c,"l"),t.symDecrypt=function(t,i,s){ - return o(c,t,i,s)} - ,t.aesEncrypt=t.symEncrypt,t.aesDecrypt=t.symDecrypt} - (ont),Iht=hit,kht=$tt&&$tt.__createBinding||(Object.create?function(t,i,s,e){ - void 0===e&&(e=s); - var n=Object.getOwnPropertyDescriptor(i,s); - n&&!("get"in n?!i.__esModule:n.writable||n.configurable)||(n={ - enumerable:!0,get:Qt(function(){ - return i[s]} - ,"get")} - ),Object.defineProperty(t,e,n)} - :function(t,i,s,e){ - void 0===e&&(e=s),t[e]=i[s]} - ),xht=$tt&&$tt.__exportStar||function(t,i){ - for(var s in t)"default"===s||Object.prototype.hasOwnProperty.call(i,s)||kht(i,t,s)} - ,Object.defineProperty(Iht,"__esModule",{ - value:!0} - ),xht(rit,Iht),xht(Qet,Iht),xht(Jet,Iht),xht(ont,Iht); - var Pht={ - } - ; - Object.defineProperty(Pht,"__esModule",{ - value:!0} - ),Pht.PublicKey=void 0; - var Nht=jtt,Lht=hit,Dht=function(){ - function t(t){ - this.data=(0,Lht.convertPublicKeyFormat)(t,!0)} - return Qt(t,"e"),t.fromHex=function(i){ - return new t((0,Lht.hexToPublicKey)(i))} - ,Object.defineProperty(t.prototype,"uncompressed",{ - get:Qt(function(){ - return itt.from((0,Lht.convertPublicKeyFormat)(this.data,!1))} - ,"get"),enumerable:!1,configurable:!0} - ),Object.defineProperty(t.prototype,"compressed",{ - get:Qt(function(){ - return itt.from(this.data)} - ,"get"),enumerable:!1,configurable:!0} - ),t.prototype.toHex=function(t){ - return void 0===t&&(t=!0),(0,Nht.bytesToHex)(t?this.data:this.uncompressed)} - ,t.prototype.decapsulate=function(t,i){ - void 0===i&&(i=!1); - var s=i?this.data:this.uncompressed,e=t.multiply(this,i); - return(0,Lht.getSharedKey)(s,e)} - ,t.prototype.equals=function(t){ - return(0,Nht.equalBytes)(this.data,t.data)} - ,t} - (); - Pht.PublicKey=Dht,Object.defineProperty(nit,"__esModule",{ - value:!0} - ),nit.PrivateKey=void 0; - var Ght=jtt,Bht=hit,Uht=Pht,Fht=function(){ - function t(t){ - if(void 0===t)this.data=(0,Bht.getValidSecret)(); - else{ - if(!(0,Bht.isValidPrivateKey)(t))throw new Error("Invalid private key"); - this.data=t} - this.publicKey=new Uht.PublicKey((0,Bht.getPublicKey)(this.data))} - return Qt(t,"e"),t.fromHex=function(i){ - return new t((0,Bht.decodeHex)(i))} - ,Object.defineProperty(t.prototype,"secret",{ - get:Qt(function(){ - return itt.from(this.data)} - ,"get"),enumerable:!1,configurable:!0} - ),t.prototype.toHex=function(){ - return(0,Ght.bytesToHex)(this.data)} - ,t.prototype.encapsulate=function(t,i){ - void 0===i&&(i=!1); - var s=i?this.publicKey.compressed:this.publicKey.uncompressed,e=this.multiply(t,i); - return(0,Bht.getSharedKey)(s,e)} - ,t.prototype.multiply=function(t,i){ - return void 0===i&&(i=!1),(0,Bht.getSharedPoint)(this.data,t.compressed,i)} - ,t.prototype.equals=function(t){ - return(0,Ght.equalBytes)(this.data,t.data)} - ,t} - (); - nit.PrivateKey=Fht,function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.PublicKey=t.PrivateKey=void 0; - var i=nit; - Object.defineProperty(t,"PrivateKey",{ - enumerable:!0,get:Qt(function(){ - return i.PrivateKey} - ,"get")} - ); - var s=Pht; - Object.defineProperty(t,"PublicKey",{ - enumerable:!0,get:Qt(function(){ - return s.PublicKey} - ,"get")} - )} - (eit),function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.utils=t.PublicKey=t.PrivateKey=t.ECIES_CONFIG=void 0,t.encrypt=function(t,h){ - var r=new e.PrivateKey,o=t instanceof Uint8Array?new e.PublicKey(t):e.PublicKey.fromHex(t),a=r.encapsulate(o,(0,s.isHkdfKeyCompressed)()),c=(0,s.isEphemeralKeyCompressed)()?r.publicKey.compressed:r.publicKey.uncompressed,l=(0,n.symEncrypt)(a,h); - return itt.from((0,i.concatBytes)(c,l))} - ,t.decrypt=function(t,i){ - var h=t instanceof Uint8Array?new e.PrivateKey(t):e.PrivateKey.fromHex(t),r=(0,s.ephemeralKeySize)(),o=new e.PublicKey(i.subarray(0,r)),a=i.subarray(r),c=o.decapsulate(h,(0,s.isHkdfKeyCompressed)()); - return itt.from((0,n.symDecrypt)(c,a))} - ; - var i=jtt,s=iit,e=eit,n=hit,h=iit; - Object.defineProperty(t,"ECIES_CONFIG",{ - enumerable:!0,get:Qt(function(){ - return h.ECIES_CONFIG} - ,"get")} - ); - var r=eit; - Object.defineProperty(t,"PrivateKey",{ - enumerable:!0,get:Qt(function(){ - return r.PrivateKey} - ,"get")} - ),Object.defineProperty(t,"PublicKey",{ - enumerable:!0,get:Qt(function(){ - return r.PublicKey} - ,"get")} - ),t.utils={ - aesEncrypt:n.aesEncrypt,aesDecrypt:n.aesDecrypt,symEncrypt:n.symEncrypt,symDecrypt:n.symDecrypt,decodeHex:n.decodeHex,getValidSecret:n.getValidSecret,remove0x:n.remove0x} - } - (Vtt); - const $ht=G4("KeyExchange:Layer"),Hht=G4("SocketService:Layer"),Wht=G4("Ecies:Layer"),Vht=G4("RemoteCommunication:Layer"); - $ht.color="##95c44e",Hht.color="#f638d7",Wht.color="#465b9c",Vht.color="#47a2be"; - const jht={ - KeyExchange:$ht,SocketService:Hht,Ecies:Wht,RemoteCommunication:Vht} - ; - let Kht,zht=[],Yht=[]; - const qht=Qt((t,i)=>U9(void 0,void 0,void 0,function*(){ - Kht=i,Yht.push(t),function(t){ - return U9(this,void 0,void 0,function*(){ - if(!Kht||!t)return; - !function(){ - const t=Yht; - Yht=zht,zht=t} - (); - const i=Kht.endsWith("/")?`${ - Kht} - evt`:`${ - Kht} - /evt`,s=Object.assign({ - } - ,t); - if(delete s.params,t.params)for(const[h,r]of Object.entries(t.params))s[h]=r; - const e=JSON.stringify(s); - jht.RemoteCommunication(`[sendBufferedEvents] Sending ${ - zht.length} - analytics events to ${ - i} - `); - try{ - const t=yield k4(i,{ - method:"POST",headers:{ - Accept:"application/json","Content-Type":"application/json"} - ,body:e} - ),s=yield t.text(); - jht.RemoteCommunication(`[sendBufferedEvents] Response: ${ - s} - `),zht.length=0} - catch(n){ - } - } - )} - (t).catch(()=>{ - } - )} - ),"lo"),Xht=class{ - constructor(t){ - this.enabled=!0,(null==t?void 0:t.debug)&&G4.enable("Ecies:Layer"),this.ecies=(null==t?void 0:t.privateKey)?Vtt.PrivateKey.fromHex(t.privateKey):new Vtt.PrivateKey,jht.Ecies("[ECIES constructor()] initialized secret: ",this.ecies.toHex()),jht.Ecies("[ECIES constructor()] initialized public: ",this.ecies.publicKey.toHex()),jht.Ecies("[ECIES constructor()] init with",this)} - generateECIES(){ - this.ecies=new Vtt.PrivateKey} - getPublicKey(){ - return this.ecies.publicKey.toHex()} - encrypt(t,i){ - let s=t; - if(this.enabled)try{ - jht.Ecies("[ECIES: encrypt()] using otherPublicKey",i); - const e=itt.from(t),n=Vtt.encrypt(i,e); - s=itt.from(n).toString("base64")} - catch(AT){ - throw jht.Ecies("[ECIES: encrypt()] error encrypt:",AT),jht.Ecies("[ECIES: encrypt()] private: ",this.ecies.toHex()),jht.Ecies("[ECIES: encrypt()] data: ",t),jht.Ecies("[ECIES: encrypt()] otherkey: ",i),AT} - return s} - decrypt(t){ - let i=t; - if(this.enabled)try{ - jht.Ecies("[ECIES: decrypt()] using privateKey",this.ecies.toHex()); - const s=itt.from(t.toString(),"base64"); - i=Vtt.decrypt(this.ecies.toHex(),s).toString()} - catch(s){ - throw jht.Ecies("[ECIES: decrypt()] error decrypt",s),jht.Ecies("[ECIES: decrypt()] private: ",this.ecies.toHex()),jht.Ecies("[ECIES: decrypt()] encryptedData: ",t),s} - return i} - getKeyInfo(){ - return{ - private:this.ecies.toHex(),public:this.ecies.publicKey.toHex()} - } - toString(){ - jht.Ecies("[ECIES: toString()]",this.getKeyInfo())} - } - ; - Qt(Xht,"uo"); - let Jht=Xht; - var Qht="0.33.1"; - const Zht="https://metamask-sdk.api.cx.metamask.io/",trt=["websocket"],irt=6048e5,srt=3e3,ert=["metamask_connectSign","metamask_connectWith","metamask_open","metamask_batch","personal_sign","wallet_requestPermissions","wallet_revokePermissions","wallet_watchAsset","eth_sendTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_signTransaction","eth_sign","personal_ecRecover"]; - function nrt(t){ - return ert.includes(t)} - function hrt(t){ - const{ - context:i} - =t; - jht.RemoteCommunication(`[RemoteCommunication: clean()] context=${ - i} - `),t.channelConfig=void 0,t.ready=!1,t.originatorConnectStarted=!1} - var rrt,ort,art,crt,lrt,urt,drt,frt; - Qt(nrt,"bo"),Qt(hrt,"wo"),(drt=rrt||(rrt={ - } - )).DISCONNECTED="disconnected",drt.WAITING="waiting",drt.TIMEOUT="timeout",drt.LINKED="linked",drt.PAUSED="paused",drt.TERMINATED="terminated",(frt=ort||(ort={ - } - )).KEY_INFO="key_info",frt.SERVICE_STATUS="service_status",frt.PROVIDER_UPDATE="provider_update",frt.RPC_UPDATE="rpc_update",frt.KEYS_EXCHANGED="keys_exchanged",frt.JOIN_CHANNEL="join_channel",frt.PUBLIC_KEY="public_key",frt.CHANNEL_CREATED="channel_created",frt.CLIENTS_CONNECTED="clients_connected",frt.CLIENTS_DISCONNECTED="clients_disconnected",frt.CLIENTS_WAITING="clients_waiting",frt.CLIENTS_READY="clients_ready",frt.REJECTED="rejected",frt.WALLET_INIT="wallet_init",frt.CHANNEL_PERSISTENCE="channel_persistence",frt.CONFIG="config",frt.MESSAGE_ACK="ack",frt.SOCKET_DISCONNECTED="socket_disconnected",frt.SOCKET_RECONNECT="socket_reconnect",frt.OTP="otp",frt.SDK_RPC_CALL="sdk_rpc_call",frt.AUTHORIZED="authorized",frt.CONNECTION_STATUS="connection_status",frt.MESSAGE="message",frt.TERMINATE="terminate",(art||(art={ - } - )).KEY_EXCHANGE="key_exchange",function(t){ - t.KEY_HANDSHAKE_START="key_handshake_start",t.KEY_HANDSHAKE_CHECK="key_handshake_check",t.KEY_HANDSHAKE_SYN="key_handshake_SYN",t.KEY_HANDSHAKE_SYNACK="key_handshake_SYNACK",t.KEY_HANDSHAKE_ACK="key_handshake_ACK",t.KEY_HANDSHAKE_WALLET="key_handshake_wallet",t.KEY_HANDSHAKE_NONE="none"} - (crt||(crt={ - } - )); - const prt=class extends x8.EventEmitter2{ - constructor({ - communicationLayer:t,otherPublicKey:i,context:s,ecies:e,logging:n} - ){ - super(),this.keysExchanged=!1,this.step=crt.KEY_HANDSHAKE_NONE,this.debug=!1,this.context=s,this.communicationLayer=t,(null==e?void 0:e.privateKey)&&i&&(jht.KeyExchange(`[KeyExchange: constructor()] otherPubKey=${ - i} - set keysExchanged to true!`,e),this.keysExchanged=!0),this.myECIES=new Jht(Object.assign(Object.assign({ - } - ,e),{ - debug:null==n?void 0:n.eciesLayer} - )),this.communicationLayer.state.eciesInstance=this.myECIES,this.myPublicKey=this.myECIES.getPublicKey(),this.debug=!0===(null==n?void 0:n.keyExchangeLayer),i&&this.setOtherPublicKey(i),this.communicationLayer.on(art.KEY_EXCHANGE,this.onKeyExchangeMessage.bind(this))} - onKeyExchangeMessage(t){ - const{ - relayPersistence:i} - =this.communicationLayer.remote.state; - if(jht.KeyExchange(`[KeyExchange: onKeyExchangeMessage()] context=${ - this.context} - keysExchanged=${ - this.keysExchanged} - relayPersistence=${ - i} - `,t),i)return void jht.KeyExchange("[KeyExchange: onKeyExchangeMessage()] Ignoring key exchange message because relay persistence is activated"); - const{ - message:s} - =t; - this.keysExchanged&&jht.KeyExchange(`[KeyExchange: onKeyExchangeMessage()] context=${ - this.context} - received handshake while already exchanged. step=${ - this.step} - otherPubKey=${ - this.otherPublicKey} - `),this.emit(ort.KEY_INFO,s.type),s.type===crt.KEY_HANDSHAKE_SYN?(this.checkStep([crt.KEY_HANDSHAKE_NONE,crt.KEY_HANDSHAKE_ACK]),jht.KeyExchange("[KeyExchange: onKeyExchangeMessage()] KEY_HANDSHAKE_SYN",s),s.pubkey&&this.setOtherPublicKey(s.pubkey),this.communicationLayer.sendMessage({ - type:crt.KEY_HANDSHAKE_SYNACK,pubkey:this.myPublicKey} - ).catch(t=>{ - jht.KeyExchange("[KeyExchange: onKeyExchangeMessage()] Error sending KEY_HANDSHAKE_SYNACK",t)} - ),this.setStep(crt.KEY_HANDSHAKE_ACK)):s.type===crt.KEY_HANDSHAKE_SYNACK?(this.checkStep([crt.KEY_HANDSHAKE_SYNACK,crt.KEY_HANDSHAKE_ACK,crt.KEY_HANDSHAKE_NONE]),jht.KeyExchange("[KeyExchange: onKeyExchangeMessage()] KEY_HANDSHAKE_SYNACK"),s.pubkey&&this.setOtherPublicKey(s.pubkey),this.communicationLayer.sendMessage({ - type:crt.KEY_HANDSHAKE_ACK} - ).catch(t=>{ - jht.KeyExchange("[KeyExchange: onKeyExchangeMessage()] Error sending KEY_HANDSHAKE_ACK",t)} - ),this.keysExchanged=!0,this.setStep(crt.KEY_HANDSHAKE_ACK),this.emit(ort.KEYS_EXCHANGED)):s.type===crt.KEY_HANDSHAKE_ACK&&(jht.KeyExchange("[KeyExchange: onKeyExchangeMessage()] KEY_HANDSHAKE_ACK set keysExchanged to true!"),this.checkStep([crt.KEY_HANDSHAKE_ACK,crt.KEY_HANDSHAKE_NONE]),this.keysExchanged=!0,this.setStep(crt.KEY_HANDSHAKE_ACK),this.emit(ort.KEYS_EXCHANGED))} - resetKeys(t){ - this.clean(),this.myECIES=new Jht(t)} - clean(){ - jht.KeyExchange(`[KeyExchange: clean()] context=${ - this.context} - reset handshake state`),this.setStep(crt.KEY_HANDSHAKE_NONE),this.emit(ort.KEY_INFO,this.step),this.keysExchanged=!1} - start({ - isOriginator:t,force:i} - ){ - const{ - relayPersistence:s,protocolVersion:e} - =this.communicationLayer.remote.state,n=e>=2; - s?jht.KeyExchange("[KeyExchange: start()] Ignoring key exchange message because relay persistence is activated"):(jht.KeyExchange(`[KeyExchange: start()] context=${ - this.context} - protocolVersion=${ - e} - isOriginator=${ - t} - step=${ - this.step} - force=${ - i} - relayPersistence=${ - s} - keysExchanged=${ - this.keysExchanged} - `),t?!(this.keysExchanged||this.step!==crt.KEY_HANDSHAKE_NONE&&this.step!==crt.KEY_HANDSHAKE_SYNACK)||i?(jht.KeyExchange(`[KeyExchange: start()] context=${ - this.context} - -- start key exchange (force=${ - i} - ) -- step=${ - this.step} - `,this.step),this.clean(),this.setStep(crt.KEY_HANDSHAKE_SYNACK),this.communicationLayer.sendMessage({ - type:crt.KEY_HANDSHAKE_SYN,pubkey:this.myPublicKey,v:2} - ).catch(t=>{ - jht.KeyExchange("[KeyExchange: start()] Error sending KEY_HANDSHAKE_SYN",t)} - )):jht.KeyExchange(`[KeyExchange: start()] context=${ - this.context} - -- key exchange already ${ - this.keysExchanged?"done":"in progress"} - -- aborted.`,this.step):this.keysExchanged&&!0!==i?jht.KeyExchange("[KeyExchange: start()] don't send KEY_HANDSHAKE_START -- exchange already done."):n?this.communicationLayer.sendMessage({ - type:crt.KEY_HANDSHAKE_SYNACK,pubkey:this.myPublicKey,v:2} - ).catch(t=>{ - jht.KeyExchange("[KeyExchange: start()] Error sending KEY_HANDSHAKE_SYNACK",t)} - ):(this.communicationLayer.sendMessage({ - type:crt.KEY_HANDSHAKE_START} - ).catch(t=>{ - jht.KeyExchange("[KeyExchange: start()] Error sending KEY_HANDSHAKE_START",t)} - ),this.clean()))} - setStep(t){ - this.step=t,this.emit(ort.KEY_INFO,t)} - checkStep(t){ - t.length>0&&t.indexOf(this.step.toString())} - setRelayPersistence({ - localKey:t,otherKey:i} - ){ - this.otherPublicKey=i,this.myECIES=new Jht({ - privateKey:t,debug:this.debug} - ),this.keysExchanged=!0} - setKeysExchanged(t){ - this.keysExchanged=t} - areKeysExchanged(){ - return this.keysExchanged} - getMyPublicKey(){ - return this.myPublicKey} - getOtherPublicKey(){ - return this.otherPublicKey} - setOtherPublicKey(t){ - jht.KeyExchange("[KeyExchange: setOtherPubKey()]",t),this.otherPublicKey=t} - encryptMessage(t){ - if(!this.otherPublicKey)throw new Error("encryptMessage: Keys not exchanged - missing otherPubKey"); - return this.myECIES.encrypt(t,this.otherPublicKey)} - decryptMessage(t){ - if(!this.otherPublicKey)throw new Error("decryptMessage: Keys not exchanged - missing otherPubKey"); - return this.myECIES.decrypt(t)} - getKeyInfo(){ - return{ - ecies:Object.assign(Object.assign({ - } - ,this.myECIES.getKeyInfo()),{ - otherPubKey:this.otherPublicKey} - ),step:this.step,keysExchanged:this.areKeysExchanged()} - } - toString(){ - const t={ - keyInfo:this.getKeyInfo(),keysExchanged:this.keysExchanged,step:this.step} - ; - return JSON.stringify(t)} - } - ; - Qt(prt,"Mo"); - let wrt=prt; - !function(t){ - t.TERMINATE="terminate",t.ANSWER="answer",t.OFFER="offer",t.CANDIDATE="candidate",t.JSONRPC="jsonrpc",t.WALLET_INFO="wallet_info",t.WALLET_INIT="wallet_init",t.ORIGINATOR_INFO="originator_info",t.PAUSE="pause",t.OTP="otp",t.AUTHORIZED="authorized",t.PING="ping",t.READY="ready"} - (lrt||(lrt={ - } - )),function(t){ - t.REQUEST="sdk_connect_request_started",t.REQUEST_MOBILE="sdk_connect_request_started_mobile",t.RECONNECT="sdk_reconnect_request_started",t.CONNECTED="sdk_connection_established",t.CONNECTED_MOBILE="sdk_connection_established_mobile",t.AUTHORIZED="sdk_connection_authorized",t.REJECTED="sdk_connection_rejected",t.TERMINATED="sdk_connection_terminated",t.DISCONNECTED="sdk_disconnected",t.SDK_USE_EXTENSION="sdk_use_extension",t.SDK_RPC_REQUEST="sdk_rpc_request",t.SDK_RPC_REQUEST_RECEIVED="sdk_rpc_request_received",t.SDK_RPC_REQUEST_DONE="sdk_rpc_request_done",t.SDK_EXTENSION_UTILIZED="sdk_extension_utilized",t.SDK_USE_INAPP_BROWSER="sdk_use_inapp_browser"} - (urt||(urt={ - } - )); - const grt=Qt((t,i,s)=>U9(void 0,void 0,void 0,function*(){ - var e,n,h,r,o,a; - const{ - remote:c,state:l} - =t,{ - channelId:u,isOriginator:d} - =l; - if("error_terminated"===i)return jht.SocketService(`handleJoinChannelResults: Channel ${ - u} - terminated`),void t.emit(ort.TERMINATE); - if(!s)return void jht.SocketService(`handleJoinChannelResults: No result for channel ${ - u} - `); - const{ - persistence:f,walletKey:p,rejected:w} - =s; - if(jht.SocketService(`handleJoinChannelResults: Channel ${ - u} - persistence=${ - f} - walletKey=${ - p} - rejected=${ - w} - `),w)return jht.SocketService(`handleJoinChannelResults: Channel ${ - u} - rejected`),yield t.remote.disconnect({ - terminate:!0} - ),t.remote.emit(ort.REJECTED,{ - channelId:u} - ),void t.remote.emitServiceStatusEvent(); - if(p&&!(null===(e=c.state.channelConfig)||void 0===e?void 0:e.otherKey)){ - t.getKeyExchange().setOtherPublicKey(p),null===(n=t.state.keyExchange)||void 0===n||n.setKeysExchanged(!0),c.state.ready=!0,c.state.authorized=!0,c.emit(ort.AUTHORIZED); - const{ - communicationLayer:i,storageManager:s} - =c.state,e=Object.assign(Object.assign({ - } - ,c.state.channelConfig),{ - channelId:null!==(h=c.state.channelId)&&void 0!==h?h:"",validUntil:Date.now()+irt,localKey:null==i?void 0:i.getKeyInfo().ecies.private,otherKey:p} - ); - t.sendMessage({ - type:crt.KEY_HANDSHAKE_ACK} - ).catch(t=>{ - } - ),null===(r=t.state.socket)||void 0===r||r.emit(lrt.PING,{ - id:u,clientType:d?"dapp":"wallet",context:"on_channel_reconnect",message:""} - ),yield null==s?void 0:s.persistChannelConfig(e),c.emitServiceStatusEvent(),c.setConnectionStatus(rrt.LINKED)} - f&&(t.emit(ort.CHANNEL_PERSISTENCE),null===(o=t.state.keyExchange)||void 0===o||o.setKeysExchanged(!0),c.state.ready=!0,c.state.authorized=!0,c.emit(ort.AUTHORIZED),qht(Object.assign(Object.assign({ - id:null!=u?u:"",event:d?urt.CONNECTED:urt.CONNECTED_MOBILE} - ,t.remote.state.originatorInfo),{ - sdkVersion:t.remote.state.sdkVersion,commLayer:t.state.communicationLayerPreference,commLayerVersion:Qht,walletVersion:null===(a=t.remote.state.walletInfo)||void 0===a?void 0:a.version} - ),l.communicationServerUrl).catch(t=>{ - } - ))} - ),"Io"),mrt=Qt(t=>new Promise(i=>{ - setTimeout(i,t)} - ),"To"),vrt=Qt((t,i,...s)=>U9(void 0,[t,i,...s],void 0,function*(t,i,s=200){ - let e; - const n=Date.now(); - let h=!1; - for(; - !h; - ){ - if(h=Date.now()-n>3e5,e=i[t],void 0!==e.elapsedTime)return e; - yield mrt(s)} - throw new Error(`RPC ${ - t} - timed out`)} - ),"Ro"),_rt=Qt(t=>U9(void 0,void 0,void 0,function*(){ - const{ - state:i} - =t,{ - socket:s,channelId:e,context:n,isOriginator:h,isReconnecting:r} - =i; - if(r)return jht.SocketService("[SocketService: reconnectSocket()] Reconnection already in progress, skipping",t),!1; - if(!s)return jht.SocketService("[SocketService: reconnectSocket()] socket is not defined",t),!1; - if(!e)return!1; - const{ - connected:o} - =s; - i.isReconnecting=!0,i.reconnectionAttempts=0,jht.SocketService(`[SocketService: reconnectSocket()] connected=${ - o} - trying to reconnect after socketio disconnection`,t); - try{ - for(; - 3>i.reconnectionAttempts; - ){ - if(jht.SocketService(`[SocketService: reconnectSocket()] Attempt ${ - i.reconnectionAttempts+1} - of 3`,t),yield mrt(200),s.connected)return jht.SocketService("Socket already connected --- ping to retrieve messages"),s.emit(lrt.PING,{ - id:e,clientType:h?"dapp":"wallet",context:"on_channel_config",message:""} - ),!0; - i.resumed=!0,s.connect(),t.emit(ort.SOCKET_RECONNECT); - try{ - if(yield new Promise((i,r)=>{ - s.emit(ort.JOIN_CHANNEL,{ - channelId:e,context:`${ - n} - connect_again`,clientType:h?"dapp":"wallet"} - ,(s,e)=>U9(void 0,void 0,void 0,function*(){ - try{ - yield grt(t,s,e),i()} - catch(n){ - r(n)} - } - ))} - ),yield mrt(100),s.connected)return jht.SocketService(`Reconnection successful on attempt ${ - i.reconnectionAttempts+1} - `),!0} - catch(a){ - jht.SocketService(`Error during reconnection attempt ${ - i.reconnectionAttempts+1} - :`,a)} - i.reconnectionAttempts+=1,3>i.reconnectionAttempts&&(yield mrt(200))} - return jht.SocketService("Failed to reconnect after 3 attempts"),!1} - finally{ - i.isReconnecting=!1,i.reconnectionAttempts=0} - } - ),"Po"); - function Mrt(t,i){ - return U9(this,void 0,void 0,function*(){ - var s; - const e=null===(s=t.state.keyExchange)||void 0===s?void 0:s.encryptMessage(JSON.stringify(i)),n={ - id:t.state.channelId,context:t.state.context,clientType:t.state.isOriginator?"dapp":"wallet",message:e,plaintext:t.state.hasPlaintext?JSON.stringify(i):void 0} - ; - return jht.SocketService(`[SocketService: encryptAndSendMessage()] context=${ - t.state.context} - `,n),i.type===lrt.TERMINATE&&(t.state.manualDisconnect=!0),new Promise((i,s)=>{ - var e; - null===(e=t.state.socket)||void 0===e||e.emit(ort.MESSAGE,n,(t,e)=>{ - var n; - t&&(jht.SocketService(`[SocketService: encryptAndSendMessage()] error=${ - t} - `),s(t)),jht.SocketService("[encryptAndSendMessage] response",e),i(null!==(n=null==e?void 0:e.success)&&void 0!==n&&n)} - )} - )} - )} - var brt; - Qt(Mrt,"Oo"),function(t){ - t.RPC_CHECK="rpcCheck",t.SKIPPED_RPC="skippedRpc"} - (brt||(brt={ - } - )); - const yrt=["eth_sendTransaction","eth_signTypedData","eth_signTransaction","personal_sign","wallet_requestPermissions","wallet_switchEthereumChain","eth_signTypedData_v3","eth_signTypedData_v4","metamask_connectSign","metamask_connectWith","metamask_batch"].map(t=>t.toLowerCase()),Ert=[{ - event:ort.CLIENTS_CONNECTED,handler:Qt(function(t,i){ - return s=>U9(this,void 0,void 0,function*(){ - var s,e,n,h,r,o,a,c,l,u,d; - const f=null!==(e=null===(s=t.remote.state.channelConfig)||void 0===s?void 0:s.relayPersistence)&&void 0!==e&&e; - if(jht.SocketService(`[SocketService: handleClientsConnected()] context=${ - t.state.context} - on 'clients_connected-${ - i} - ' relayPersistence=${ - f} - resumed=${ - t.state.resumed} - clientsPaused=${ - t.state.clientsPaused} - keysExchanged=${ - null===(n=t.state.keyExchange)||void 0===n?void 0:n.areKeysExchanged()} - isOriginator=${ - t.state.isOriginator} - `),t.emit(ort.CLIENTS_CONNECTED,{ - isOriginator:t.state.isOriginator,keysExchanged:null===(h=t.state.keyExchange)||void 0===h?void 0:h.areKeysExchanged(),context:t.state.context} - ),t.state.resumed)t.state.isOriginator||(jht.SocketService(`[SocketService: handleClientsConnected()] context=${ - t.state.context} - 'clients_connected' / keysExchanged=${ - null===(r=t.state.keyExchange)||void 0===r?void 0:r.areKeysExchanged()} - -- backward compatibility`),null===(o=t.state.keyExchange)||void 0===o||o.start({ - isOriginator:null!==(a=t.state.isOriginator)&&void 0!==a&&a} - )),t.state.resumed=!1; - else if(t.state.clientsPaused)jht.SocketService("[SocketService: handleClientsConnected()] 'clients_connected' skip sending originatorInfo on pause"); - else if(!t.state.isOriginator){ - const i=!f; - jht.SocketService(`[SocketService: handleClientsConnected()] context=${ - t.state.context} - on 'clients_connected' / keysExchanged=${ - null===(c=t.state.keyExchange)||void 0===c?void 0:c.areKeysExchanged()} - -- force=${ - i} - -- backward compatibility`),jht.SocketService(`[SocketService: handleClientsConnected()] context=${ - t.state.context} - on 'clients_connected' / keysExchanged=${ - null===(l=t.state.keyExchange)||void 0===l?void 0:l.areKeysExchanged()} - -- force=${ - i} - -- backward compatibility`),null===(u=t.state.keyExchange)||void 0===u||u.start({ - isOriginator:null!==(d=t.state.isOriginator)&&void 0!==d&&d,force:i} - )} - t.state.clientsConnected=!0,t.state.clientsPaused=!1} - )} - ,"handler")} - ,{ - event:ort.CHANNEL_CREATED,handler:Qt(function(t,i){ - return s=>{ - jht.SocketService(`[SocketService: handleChannelCreated()] context=${ - t.state.context} - on 'channel_created-${ - i} - '`,s),t.emit(ort.CHANNEL_CREATED,s)} - } - ,"handler")} - ,{ - event:ort.CLIENTS_DISCONNECTED,handler:Qt(function(t,i){ - return()=>{ - var s; - t.state.clientsConnected=!1,jht.SocketService(`[SocketService: handlesClientsDisconnected()] context=${ - t.state.context} - on 'clients_disconnected-${ - i} - '`),t.remote.state.relayPersistence?jht.SocketService(`[SocketService: handlesClientsDisconnected()] context=${ - t.state.context} - on 'clients_disconnected-${ - i} - ' - relayPersistence enabled, skipping key exchange cleanup.`):(t.state.isOriginator&&!t.state.clientsPaused&&(null===(s=t.state.keyExchange)||void 0===s||s.clean()),t.emit(ort.CLIENTS_DISCONNECTED,i))} - } - ,"handler")} - ,{ - event:ort.CONFIG,handler:Qt(function(t,i){ - return s=>U9(this,void 0,void 0,function*(){ - var e,n,h; - jht.SocketService(`[SocketService: handleChannelConfig()] update relayPersistence on 'config-${ - i} - '`,s); - const{ - persistence:r,walletKey:o} - =s; - t.state.isOriginator&&t.remote.state.channelConfig?(s.walletKey&&!t.remote.state.channelConfig.otherKey&&(jht.SocketService(`Setting wallet key ${ - o} - `),t.remote.state.channelConfig.otherKey=o,t.getKeyExchange().setOtherPublicKey(s.walletKey),null===(e=t.state.keyExchange)||void 0===e||e.setKeysExchanged(!0),yield t.remote.sendMessage({ - type:crt.KEY_HANDSHAKE_ACK} - ),yield t.remote.sendMessage({ - type:lrt.PING} - ),yield null===(n=t.remote.state.storageManager)||void 0===n?void 0:n.persistChannelConfig(t.remote.state.channelConfig)),!0!==r||t.remote.state.channelConfig.relayPersistence||(jht.SocketService(`Setting relay persistence ${ - r} - `),t.remote.state.channelConfig.relayPersistence=r,t.remote.state.relayPersistence=!0,t.remote.emit(ort.CHANNEL_PERSISTENCE),t.remote.state.authorized=!0,t.remote.state.ready=!0,t.remote.emit(ort.AUTHORIZED),yield null===(h=t.remote.state.storageManager)||void 0===h?void 0:h.persistChannelConfig(t.remote.state.channelConfig))):t.state.isOriginator||s.persistence&&(t.remote.state.relayPersistence=!0,t.remote.emit(ort.CHANNEL_PERSISTENCE))} - )} - ,"handler")} - ,{ - event:ort.MESSAGE,handler:Qt(function(t,i){ - return s=>{ - var e,n,h,r,o,a,c,l,u,d,f,p,w,g,m,v,_,M; - const{ - ackId:b,message:y,error:E} - =s,A=null!==(e=t.remote.state.relayPersistence)&&void 0!==e&&e; - if(jht.SocketService(`[SocketService handleMessage()] relayPersistence=${ - A} - context=${ - t.state.context} - on 'message' ${ - i} - keysExchanged=${ - null===(n=t.state.keyExchange)||void 0===n?void 0:n.areKeysExchanged()} - `,s),E)throw jht.SocketService(`\n [SocketService handleMessage()] context=${ - t.state.context} - ::on 'message' error=${ - E} - `),new Error(E); - const S="string"==typeof y; - if(!S&&(null==y?void 0:y.type)===crt.KEY_HANDSHAKE_START){ - if(A)return; - return jht.SocketService(`[SocketService handleMessage()] context=${ - t.state.context} - ::on 'message' received HANDSHAKE_START isOriginator=${ - t.state.isOriginator} - `,y),void(null===(h=t.state.keyExchange)||void 0===h||h.start({ - isOriginator:null!==(r=t.state.isOriginator)&&void 0!==r&&r,force:!0} - ))} - if(!S&&(null===(o=null==y?void 0:y.type)||void 0===o?void 0:o.startsWith("key_handshake"))){ - if(A)return; - return jht.SocketService(`[SocketService handleMessage()] context=${ - t.state.context} - ::on 'message' emit KEY_EXCHANGE`,y),void t.emit(art.KEY_EXCHANGE,{ - message:y,context:t.state.context} - )} - if(S&&!(null===(a=t.state.keyExchange)||void 0===a?void 0:a.areKeysExchanged())){ - let i=!1; - try{ - jht.SocketService(`[SocketService handleMessage()] context=${ - t.state.context} - ::on 'message' trying to decrypt message`),null===(c=t.state.keyExchange)||void 0===c||c.decryptMessage(y),i=!0} - catch(O){ - jht.SocketService(`[SocketService handleMessage()] context=${ - t.state.context} - ::on 'message' error`,O)} - if(!i)return t.state.isOriginator?null===(u=t.state.keyExchange)||void 0===u||u.start({ - isOriginator:null!==(d=t.state.isOriginator)&&void 0!==d&&d} - ):t.sendMessage({ - type:crt.KEY_HANDSHAKE_START} - ).catch(t=>{ - } - ),void jht.SocketService(`Message ignored because invalid key exchange status. step=${ - null===(f=t.state.keyExchange)||void 0===f?void 0:f.getKeyInfo().step} - `,null===(p=t.state.keyExchange)||void 0===p?void 0:p.getKeyInfo(),y); - jht.SocketService("Invalid key exchange status detected --- updating it."),null===(l=t.state.keyExchange)||void 0===l||l.setKeysExchanged(!0)} - else if(!S&&(null==y?void 0:y.type))return void t.emit(ort.MESSAGE,y); - if(!S)return void t.emit(ort.MESSAGE,y); - const T=null===(w=t.state.keyExchange)||void 0===w?void 0:w.decryptMessage(y),C=JSON.parse(null!=T?T:"{ - } - "); - if(b&&(null==b?void 0:b.length)>0&&(jht.SocketService(`[SocketService handleMessage()] context=${ - t.state.context} - ::on 'message' ackid=${ - b} - channelId=${ - i} - `),null===(g=t.state.socket)||void 0===g||g.emit(ort.MESSAGE_ACK,{ - ackId:b,channelId:i,clientType:t.state.isOriginator?"dapp":"wallet"} - )),t.state.clientsPaused=(null==C?void 0:C.type)===lrt.PAUSE,t.state.isOriginator&&C.data){ - const i=C.data,s=t.state.rpcMethodTracker[i.id]; - if(s){ - const e=Date.now()-s.timestamp; - jht.SocketService(`[SocketService handleMessage()] context=${ - t.state.context} - ::on 'message' received answer for id=${ - i.id} - method=${ - s.method} - responseTime=${ - e} - `,C),t.remote.state.analytics&&yrt.includes(s.method.toLowerCase())&&qht(Object.assign(Object.assign({ - id:null!==(m=t.remote.state.channelId)&&void 0!==m?m:"",event:urt.SDK_RPC_REQUEST_DONE,sdkVersion:t.remote.state.sdkVersion,commLayerVersion:Qht} - ,t.remote.state.originatorInfo),{ - walletVersion:null===(v=t.remote.state.walletInfo)||void 0===v?void 0:v.version,params:{ - method:s.method,from:"mobile"} - } - ),t.remote.state.communicationServerUrl).catch(t=>{ - } - ),nrt(s.method)&&A8.analytics.track(i.error?4001===i.error.code?"sdk_action_rejected":"sdk_action_failed":"sdk_action_succeeded",{ - action:s.method} - ); - const n=Object.assign(Object.assign({ - } - ,s),{ - result:i.result,error:i.error?{ - code:null===(_=i.error)||void 0===_?void 0:_.code,message:null===(M=i.error)||void 0===M?void 0:M.message} - :void 0,elapsedTime:e} - ); - t.state.rpcMethodTracker[i.id]=n,t.emit(ort.RPC_UPDATE,n)} - } - t.emit(ort.MESSAGE,{ - message:C} - )} - } - ,"handler")} - ,{ - event:ort.REJECTED,handler:Qt(function(t,i){ - return s=>U9(this,void 0,void 0,function*(){ - var s; - t.state.isOriginator&&!t.remote.state.ready?(jht.SocketService(`[SocketService: handleChannelRejected()] context=${ - t.state.context} - channelId=${ - i} - isOriginator=${ - t.state.isOriginator} - ready=${ - t.remote.state.ready} - `,t.remote.state.originatorInfo),qht(Object.assign(Object.assign({ - id:i,event:urt.REJECTED} - ,t.remote.state.originatorInfo),{ - sdkVersion:t.remote.state.sdkVersion,commLayer:t.state.communicationLayerPreference,commLayerVersion:Qht,walletVersion:null===(s=t.remote.state.walletInfo)||void 0===s?void 0:s.version} - ),t.remote.state.communicationServerUrl).catch(t=>{ - } - ),A8.analytics.track("sdk_connection_rejected",{ - transport_type:"websocket"} - ),yield t.remote.disconnect({ - terminate:!0} - ),t.remote.emit(ort.REJECTED,{ - channelId:i} - ),t.remote.setConnectionStatus(rrt.DISCONNECTED)):jht.SocketService(`[SocketService: handleChannelRejected()] SKIP -- channelId=${ - i} - isOriginator=${ - t.state.isOriginator} - ready=${ - t.remote.state.ready} - `)} - )} - ,"handler")} - ,{ - event:"clients_waiting_to_join",handler:Qt(function(t,i){ - return s=>{ - jht.SocketService(`[SocketService: handleClientsWaitingToJoin()] context=${ - t.state.context} - on 'clients_waiting_to_join-${ - i} - '`,s),t.emit(ort.CLIENTS_WAITING,s)} - } - ,"handler")} - ],Art=[{ - event:ort.KEY_INFO,handler:Qt(function(t){ - return i=>{ - jht.SocketService("[SocketService: handleKeyInfo()] on 'KEY_INFO'",i),t.emit(ort.KEY_INFO,i)} - } - ,"handler")} - ,{ - event:ort.KEYS_EXCHANGED,handler:Qt(function(t){ - return()=>{ - var i,s,e; - jht.SocketService(`[SocketService: handleKeysExchanged()] on 'keys_exchanged' keyschanged=${ - null===(i=t.state.keyExchange)||void 0===i?void 0:i.areKeysExchanged()} - `); - const{ - channelConfig:n} - =t.remote.state; - if(n){ - const i=t.getKeyExchange().getKeyInfo().ecies; - n.localKey=i.private,n.otherKey=i.otherPubKey,t.remote.state.channelConfig=n,null===(s=t.remote.state.storageManager)||void 0===s||s.persistChannelConfig(n).catch(t=>{ - } - )} - t.emit(ort.KEYS_EXCHANGED,{ - keysExchanged:null===(e=t.state.keyExchange)||void 0===e?void 0:e.areKeysExchanged(),isOriginator:t.state.isOriginator} - ); - const h={ - keyInfo:t.getKeyInfo()} - ; - t.emit(ort.SERVICE_STATUS,h)} - } - ,"handler")} - ]; - function Srt(t,i){ - jht.SocketService(`[SocketService: setupChannelListener()] context=${ - t.state.context} - setting socket listeners for channel ${ - i} - ...`); - const{ - socket:s} - =t.state,{ - keyExchange:e} - =t.state; - s&&t.state.isOriginator&&(t.state.debug&&(null==s||s.io.on("error",i=>{ - jht.SocketService(`[SocketService: setupChannelListener()] context=${ - t.state.context} - socket event=error`,i)} - ),null==s||s.io.on("reconnect",i=>{ - jht.SocketService(`[SocketService: setupChannelListener()] context=${ - t.state.context} - socket event=reconnect`,i),_rt(t).catch(t=>{ - } - )} - ),null==s||s.io.on("reconnect_error",i=>{ - jht.SocketService(`[SocketService: setupChannelListener()] context=${ - t.state.context} - socket event=reconnect_error`,i)} - ),null==s||s.io.on("reconnect_failed",()=>{ - jht.SocketService(`[SocketService: setupChannelListener()] context=${ - t.state.context} - socket event=reconnect_failed`)} - )),null==s||s.on("disconnect",i=>(jht.SocketService(`[SocketService: setupChannelListener()] on 'disconnect' -- MetaMaskSDK socket disconnected '${ - i} - ' begin recovery...`),function(t){ - return i=>{ - jht.SocketService(`[SocketService: handleDisconnect()] on 'disconnect' manualDisconnect=${ - t.state.manualDisconnect} - `,i),t.state.manualDisconnect||(t.emit(ort.SOCKET_DISCONNECTED),_rt(t).catch(t=>{ - } - ))} - } - (t)(i)))),Ert.forEach(({ - event:e,handler:n} - )=>{ - null==s||s.on(`${ - e} - -${ - i} - `,n(t,i))} - ),Art.forEach(({ - event:i,handler:s} - )=>{ - null==e||e.on(i,s(t))} - ),t.state.setupChannelListeners=!0} - Qt(Srt,"Bo"); - const Trt=class extends x8.EventEmitter2{ - constructor(t){ - super(),this.state={ - clientsConnected:!1,clientsPaused:!1,manualDisconnect:!1,lastRpcId:void 0,rpcMethodTracker:{ - } - ,hasPlaintext:!1,communicationServerUrl:"",focusListenerAdded:!1,removeFocusListener:void 0,isReconnecting:!1,reconnectionAttempts:0} - ,this.options=t; - const{ - reconnect:i,communicationLayerPreference:s,communicationServerUrl:e,context:n,remote:h,logging:r} - =t; - this.state.resumed=i,this.state.context=n,this.state.isOriginator=h.state.isOriginator,this.state.communicationLayerPreference=s,this.state.debug=!0===(null==r?void 0:r.serviceLayer),this.remote=h,!0===(null==r?void 0:r.serviceLayer)&&G4.enable("SocketService:Layer"),this.state.communicationServerUrl=e,this.state.hasPlaintext=this.state.communicationServerUrl!==Zht&&!0===(null==r?void 0:r.plaintext),jht.SocketService(`[SocketService: constructor()] Socket IO url: ${ - this.state.communicationServerUrl} - `),this.initSocket()} - initSocket(){ - var t; - const{ - otherPublicKey:i,ecies:s,logging:e} - =this.options,n={ - autoConnect:!1,transports:trt,withCredentials:!0} - ,h=this.state.communicationServerUrl; - jht.SocketService(`[SocketService: initSocket()] Socket IO url: ${ - h} - `),this.state.socket=B9(h,n),function(t){ - if("undefined"!=typeof window&&"undefined"!=typeof document&&(jht.SocketService(`[SocketService: setupSocketFocusListener()] hasFocus=${ - document.hasFocus()} - `,t),!t.state.focusListenerAdded)){ - const i=Qt(()=>{ - jht.SocketService("Document has focus --- reconnecting socket"),_rt(t).catch(t=>{ - } - )} - ,"t"); - window.addEventListener("focus",i),t.state.focusListenerAdded=!0,t.state.removeFocusListener=()=>{ - window.removeEventListener("focus",i),t.state.focusListenerAdded=!1} - } - } - (this); - const r={ - communicationLayer:this,otherPublicKey:i,sendPublicKey:!1,context:null!==(t=this.state.context)&&void 0!==t?t:"",ecies:s,logging:e} - ; - this.state.keyExchange=new wrt(r)} - resetKeys(){ - return jht.SocketService("[SocketService: resetKeys()] Resetting keys."),void(null===(t=this.state.keyExchange)||void 0===t||t.resetKeys()); - var t} - createChannel(){ - return U9(this,void 0,void 0,function*(){ - return function(t){ - return U9(this,void 0,void 0,function*(){ - var i,s,e; - if(jht.SocketService(`[SocketService: createChannel()] context=${ - t.state.context} - `),t.state.socket||t.initSocket(),null===(i=t.state.socket)||void 0===i?void 0:i.connected)throw new Error("socket already connected"); - null===(s=t.state.socket)||void 0===s||s.connect(),t.state.manualDisconnect=!1,t.state.isOriginator=!0; - const n=$8(); - t.state.channelId=n,Srt(t,n),yield new Promise((i,s)=>{ - var e; - null===(e=t.state.socket)||void 0===e||e.emit(ort.JOIN_CHANNEL,{ - channelId:n,context:`${ - t.state.context} - createChannel`,clientType:"dapp"} - ,(e,n)=>U9(this,void 0,void 0,function*(){ - try{ - yield grt(t,e,n),i()} - catch(h){ - s(h)} - } - ))} - ); - const h=null===(e=t.state.keyExchange)||void 0===e?void 0:e.getKeyInfo(); - return{ - channelId:n,pubKey:(null==h?void 0:h.ecies.public)||"",privKey:(null==h?void 0:h.ecies.private)||""} - } - )} - (this)} - )} - connectToChannel({ - channelId:t,withKeyExchange:i=!1,authorized:s} - ){ - return function(t){ - return U9(this,arguments,void 0,function*({ - options:t,instance:i} - ){ - const{ - channelId:s,authorized:e,withKeyExchange:n} - =t,{ - state:h,remote:r} - =i,{ - isOriginator:o=!1,socket:a,keyExchange:c} - =h,{ - channelConfig:l} - =r.state; - if(null==a?void 0:a.connected)throw new Error("socket already connected"); - if(o&&(null==l?void 0:l.relayPersistence)){ - const{ - localKey:t,otherKey:i} - =l; - t&&i&&(null==c||c.setRelayPersistence({ - localKey:t,otherKey:i} - ))} - return Object.assign(h,{ - manualDisconnect:!1,withKeyExchange:n,isOriginator:o,channelId:s} - ),null==a||a.connect(),Srt(i,s),!o&&e&&(null==c||c.setKeysExchanged(!0),Object.assign(r.state,{ - ready:!0,authorized:!0} - )),new Promise(t=>{ - var n; - const r=null===(n=null==c?void 0:c.getKeyInfo())||void 0===n?void 0:n.ecies.public; - null==a||a.emit(ort.JOIN_CHANNEL,{ - channelId:s,context:`${ - h.context} - _connectToChannel`,clientType:o?"dapp":"wallet",publicKey:e&&!o?r:void 0} - ,(s,e)=>U9(this,void 0,void 0,function*(){ - yield grt(i,s,e),t()} - ))} - )} - )} - ({ - options:{ - channelId:t,withKeyExchange:i,authorized:s} - ,instance:this} - )} - getKeyInfo(){ - return this.state.keyExchange.getKeyInfo()} - keyCheck(){ - var t,i; - null===(i=(t=this).state.socket)||void 0===i||i.emit(ort.MESSAGE,{ - id:t.state.channelId,context:t.state.context,message:{ - type:crt.KEY_HANDSHAKE_CHECK,pubkey:t.getKeyInfo().ecies.otherPubKey} - } - )} - getKeyExchange(){ - return this.state.keyExchange} - sendMessage(t){ - return U9(this,void 0,void 0,function*(){ - return function(t,i){ - return U9(this,void 0,void 0,function*(){ - var s,e,n; - if(!t.state.channelId)throw jht.SocketService("handleSendMessage: no channelId - Create a channel first"),new Error("Create a channel first"); - if(jht.SocketService(`[SocketService: handleSendMessage()] context=${ - t.state.context} - areKeysExchanged=${ - null===(s=t.state.keyExchange)||void 0===s?void 0:s.areKeysExchanged()} - `,i),null===(e=null==i?void 0:i.type)||void 0===e?void 0:e.startsWith("key_handshake"))return function(t,i){ - var s; - jht.SocketService(`[SocketService: handleKeyHandshake()] context=${ - t.state.context} - `,i),null===(s=t.state.socket)||void 0===s||s.emit(ort.MESSAGE,{ - id:t.state.channelId,context:t.state.context,clientType:t.state.isOriginator?"dapp":"wallet",message:i} - )} - (t,i),!0; - !function(t,i){ - var s; - if(!(null===(s=t.state.keyExchange)||void 0===s?void 0:s.areKeysExchanged())&&!t.remote.state.relayPersistence)throw jht.SocketService(`[SocketService: validateKeyExchange()] context=${ - t.state.context} - ERROR keys not exchanged`,i),new Error("Keys not exchanged BBB")} - (t,i),function(t,i){ - var s; - const e=null!==(s=null==i?void 0:i.method)&&void 0!==s?s:"",n=null==i?void 0:i.id; - t.state.isOriginator&&n&&(t.state.rpcMethodTracker[n]={ - id:n,timestamp:Date.now(),method:e} - ,t.emit(ort.RPC_UPDATE,t.state.rpcMethodTracker[n]))} - (t,i); - const h=yield Mrt(t,i); - return t.remote.state.analytics&&t.remote.state.isOriginator&&i.method&&yrt.includes(i.method.toLowerCase())&&qht({ - id:null!==(n=t.remote.state.channelId)&&void 0!==n?n:"",event:urt.SDK_RPC_REQUEST,params:{ - method:i.method,from:"mobile"} - } - ,t.remote.state.communicationServerUrl).catch(t=>{ - } - ),t.remote.state.isOriginator&&i.method&&nrt(i.method)&&A8.analytics.track("sdk_action_requested",{ - action:i.method} - ),function(t,i){ - return U9(this,void 0,void 0,function*(){ - var s; - const e=null==i?void 0:i.id,n=null!==(s=null==i?void 0:i.method)&&void 0!==s?s:""; - if(t.state.isOriginator&&e)try{ - const s=vrt(e,t.state.rpcMethodTracker,200).then(t=>({ - type:brt.RPC_CHECK,result:t} - )),h=(()=>U9(this,void 0,void 0,function*(){ - const i=yield(n={ - instance:t,rpcId:e} - ,U9(void 0,[n],void 0,function*({ - rpcId:t,instance:i} - ){ - for(; - i.state.lastRpcId===t||void 0===i.state.lastRpcId; - )yield mrt(200); - return i.state.lastRpcId} - )),s=yield vrt(i,t.state.rpcMethodTracker,200); - var n; - return{ - type:brt.SKIPPED_RPC,result:s} - } - ))(),r=yield Promise.race([s,h]); - if(r.type===brt.RPC_CHECK){ - const t=r.result; - jht.SocketService(`[SocketService:handleRpcReplies()] id=${ - i.id} - ${ - n} - ( ${ - t.elapsedTime} - ms)`,t.result)} - else{ - if(r.type!==brt.SKIPPED_RPC)throw new Error(`Error handling RPC replies for ${ - e} - `); - { - const i=Object.assign(Object.assign({ - } - ,t.state.rpcMethodTracker[e]),{ - error:new Error("SDK_CONNECTION_ISSUE")} - ); - t.emit(ort.RPC_UPDATE,i); - const s={ - data:Object.assign(Object.assign({ - } - ,i),{ - jsonrpc:"2.0"} - ),name:"metamask-provider"} - ; - t.emit(ort.MESSAGE,{ - message:s} - )} - } - } - catch(h){ - throw h} - } - )} - (t,i).catch(t=>{ - } - ),h} - )} - (this,t)} - )} - ping(){ - return function(t){ - return U9(this,void 0,void 0,function*(){ - var i,s; - jht.SocketService(`[SocketService: ping()] context=${ - t.state.context} - originator=${ - t.state.isOriginator} - keysExchanged=${ - null===(i=t.state.keyExchange)||void 0===i?void 0:i.areKeysExchanged()} - `),null===(s=t.state.socket)||void 0===s||s.emit(lrt.PING,{ - id:t.state.channelId,context:"ping",clientType:t.remote.state.isOriginator?"dapp":"wallet",message:""} - )} - )} - (this)} - pause(){ - return function(t){ - return U9(this,void 0,void 0,function*(){ - var i,s; - jht.SocketService(`[SocketService: pause()] context=${ - t.state.context} - `),t.state.manualDisconnect=!0,(null===(i=t.state.keyExchange)||void 0===i?void 0:i.areKeysExchanged())&&(yield t.sendMessage({ - type:lrt.PAUSE} - )),null===(s=t.state.socket)||void 0===s||s.disconnect()} - )} - (this)} - isConnected(){ - var t; - return null===(t=this.state.socket)||void 0===t?void 0:t.connected} - resume(){ - return function(t){ - return U9(this,void 0,void 0,function*(){ - const{ - state:i,remote:s} - =t,{ - socket:e,channelId:n,context:h,keyExchange:r,isOriginator:o} - =i,{ - isOriginator:a} - =s.state; - if(jht.SocketService(`[SocketService: resume()] channelId=${ - n} - context=${ - h} - connected=${ - null==e?void 0:e.connected} - manualDisconnect=${ - i.manualDisconnect} - resumed=${ - i.resumed} - keysExchanged=${ - null==r?void 0:r.areKeysExchanged()} - `),!n)throw jht.SocketService("[SocketService: resume()] channelId is not defined"),new Error("ChannelId is not defined"); - (null==e?void 0:e.connected)?(jht.SocketService("[SocketService: resume()] already connected."),e.emit(lrt.PING,{ - id:n,clientType:a?"dapp":"wallet",context:"on_channel_config",message:""} - ),s.hasRelayPersistence()||(null==r?void 0:r.areKeysExchanged())||(o?yield t.sendMessage({ - type:lrt.READY} - ):null==r||r.start({ - isOriginator:!1} - ))):(null==e||e.connect(),jht.SocketService(`[SocketService: resume()] after connecting socket --\x3e connected=${ - null==e?void 0:e.connected} - `),null==e||e.emit(ort.JOIN_CHANNEL,{ - channelId:n,context:`${ - h} - _resume`,clientType:a?"dapp":"wallet"} - ,(i,s)=>U9(this,void 0,void 0,function*(){ - try{ - yield grt(t,i,s)} - catch(e){ - } - } - ))),i.manualDisconnect=!1,i.resumed=!0} - )} - (this)} - getRPCMethodTracker(){ - return this.state.rpcMethodTracker} - disconnect(t){ - return function(t,i){ - var s,e,n,h,r; - jht.SocketService(`[SocketService: disconnect()] context=${ - t.state.context} - `,i),(null==i?void 0:i.terminate)&&(null===(e=(s=t.state).removeFocusListener)||void 0===e||e.call(s),t.state.channelId=i.channelId,null===(n=t.state.socket)||void 0===n||n.removeAllListeners(),null===(h=t.state.keyExchange)||void 0===h||h.clean(),t.remote.state.ready=!1,t.state.socket=void 0,t.state.rpcMethodTracker={ - } - ),t.state.manualDisconnect=!0,null===(r=t.state.socket)||void 0===r||r.disconnect()} - (this,t)} - } - ; - Qt(Trt,"Ko"); - let Crt=Trt; - var Ort,Irt,krt; - function xrt(t){ - return()=>U9(this,void 0,void 0,function*(){ - var i,s,e; - const{ - state:n} - =t; - if(n.authorized)return; - yield(()=>U9(this,void 0,void 0,function*(){ - for(; - !n.walletInfo; - )yield mrt(500)} - ))(); - const h="7.3".localeCompare((null===(i=n.walletInfo)||void 0===i?void 0:i.version)||""); - if(jht.RemoteCommunication(`[RemoteCommunication: handleAuthorizedEvent()] HACK 'authorized' version=${ - null===(s=n.walletInfo)||void 0===s?void 0:s.version} - compareValue=${ - h} - `),1!==h)return; - const r=n.platformType===Irt.MobileWeb||n.platformType===Irt.ReactNative||n.platformType===Irt.MetaMaskMobileWebview; - jht.RemoteCommunication(`[RemoteCommunication: handleAuthorizedEvent()] HACK 'authorized' platform=${ - n.platformType} - secure=${ - r} - channel=${ - n.channelId} - walletVersion=${ - null===(e=n.walletInfo)||void 0===e?void 0:e.version} - `),r&&(n.authorized=!0,t.emit(ort.AUTHORIZED))} - )} - function Rrt(t){ - return i=>{ - const{ - state:s} - =t; - jht.RemoteCommunication(`[RemoteCommunication: handleChannelCreatedEvent()] context=${ - s.context} - on 'channel_created' channelId=${ - i} - `),t.emit(ort.CHANNEL_CREATED,i)} - } - function Prt(t,i){ - return()=>{ - var s,e,n,h; - const{ - state:r} - =t; - jht.RemoteCommunication(`[RemoteCommunication: handleClientsConnectedEvent()] on 'clients_connected' channel=${ - r.channelId} - keysExchanged=${ - null===(e=null===(s=r.communicationLayer)||void 0===s?void 0:s.getKeyInfo())||void 0===e?void 0:e.keysExchanged} - `),r.analytics&&qht(Object.assign(Object.assign({ - id:null!==(n=r.channelId)&&void 0!==n?n:"",event:r.reconnection?urt.RECONNECT:r.isOriginator?urt.REQUEST:urt.REQUEST_MOBILE} - ,r.originatorInfo),{ - commLayer:i,sdkVersion:r.sdkVersion,walletVersion:null===(h=r.walletInfo)||void 0===h?void 0:h.version,commLayerVersion:Qht} - ),r.communicationServerUrl).catch(t=>{ - } - ),r.isOriginator&&!r.reconnection&&A8.analytics.track("sdk_connection_established",{ - transport_type:"websocket"} - ),r.clientsConnected=!0,r.originatorInfoSent=!1,t.emit(ort.CLIENTS_CONNECTED)} - } - function Nrt(t){ - return i=>{ - const{ - state:s} - =t; - jht.RemoteCommunication(`[RemoteCommunication: handleClientsDisconnectedEvent()] context=${ - s.context} - on 'clients_disconnected' channelId=${ - i} - `),s.relayPersistence||(s.clientsConnected=!1,s.ready=!1,s.authorized=!1),t.emit(ort.CLIENTS_DISCONNECTED,s.channelId),t.setConnectionStatus(rrt.DISCONNECTED)} - } - function Lrt(t){ - return i=>{ - var s; - const{ - state:e} - =t; - if(jht.RemoteCommunication(`[RemoteCommunication: handleClientsWaitingEvent()] context=${ - e.context} - on 'clients_waiting' numberUsers=${ - i} - ready=${ - e.ready} - autoStarted=${ - e.originatorConnectStarted} - `),t.setConnectionStatus(rrt.WAITING),t.emit(ort.CLIENTS_WAITING,i),e.originatorConnectStarted){ - jht.RemoteCommunication(`[RemoteCommunication: handleClientsWaitingEvent()] on 'clients_waiting' watch autoStarted=${ - e.originatorConnectStarted} - timeout`,e.autoConnectOptions); - const i=(null===(s=e.autoConnectOptions)||void 0===s?void 0:s.timeout)||3e3,n=setTimeout(()=>{ - jht.RemoteCommunication(`[RemoteCommunication: handleClientsWaitingEvent()] setTimeout(${ - i} - ) terminate channelConfig`,e.autoConnectOptions),e.originatorConnectStarted=!1,e.ready||t.setConnectionStatus(rrt.TIMEOUT),clearTimeout(n)} - ,i)} - } - } - function Drt(t,i){ - return s=>{ - var e,n,h,r,o,a,c,l; - const{ - state:u} - =t; - if(jht.RemoteCommunication(`[RemoteCommunication: handleKeysExchangedEvent()] context=${ - u.context} - on commLayer.'keys_exchanged' channel=${ - u.channelId} - `,s),null===(n=null===(e=u.communicationLayer)||void 0===e?void 0:e.getKeyInfo())||void 0===n?void 0:n.keysExchanged){ - const i=Object.assign(Object.assign({ - } - ,u.channelConfig),{ - channelId:null!==(h=u.channelId)&&void 0!==h?h:"",validUntil:(null===(r=u.channelConfig)||void 0===r?void 0:r.validUntil)||irt,localKey:u.communicationLayer.getKeyInfo().ecies.private,otherKey:u.communicationLayer.getKeyInfo().ecies.otherPubKey} - ); - null===(o=u.storageManager)||void 0===o||o.persistChannelConfig(i).catch(t=>{ - } - ),t.setConnectionStatus(rrt.LINKED)} - !function(t,i){ - var s,e,n,h,r,o,a,c; - const{ - state:l} - =t; - jht.RemoteCommunication(`[RemoteCommunication: setLastActiveDate()] channel=${ - l.channelId} - `,i); - const u=Object.assign(Object.assign({ - } - ,l.channelConfig),{ - channelId:null!==(s=l.channelId)&&void 0!==s?s:"",validUntil:null!==(n=null===(e=l.channelConfig)||void 0===e?void 0:e.validUntil)&&void 0!==n?n:0,relayPersistence:l.relayPersistence,localKey:null===(r=null===(h=l.communicationLayer)||void 0===h?void 0:h.state.keyExchange)||void 0===r?void 0:r.getKeyInfo().ecies.private,otherKey:null===(a=null===(o=l.communicationLayer)||void 0===o?void 0:o.state.keyExchange)||void 0===a?void 0:a.getKeyInfo().ecies.otherPubKey,lastActive:i.getTime()} - ); - null===(c=l.storageManager)||void 0===c||c.persistChannelConfig(u)} - (t,new Date),u.analytics&&u.channelId&&qht(Object.assign(Object.assign({ - id:u.channelId,event:s.isOriginator?urt.CONNECTED:urt.CONNECTED_MOBILE} - ,u.originatorInfo),{ - sdkVersion:u.sdkVersion,commLayer:i,commLayerVersion:Qht,walletVersion:null===(a=u.walletInfo)||void 0===a?void 0:a.version} - ),u.communicationServerUrl).catch(t=>{ - } - ),u.isOriginator=s.isOriginator,s.isOriginator||(null===(c=u.communicationLayer)||void 0===c||c.sendMessage({ - type:lrt.READY} - ),u.ready=!0,u.paused=!1),s.isOriginator&&!u.originatorInfoSent&&(null===(l=u.communicationLayer)||void 0===l||l.sendMessage({ - type:lrt.ORIGINATOR_INFO,originatorInfo:u.originatorInfo,originator:u.originatorInfo} - ),u.originatorInfoSent=!0)} - } - function Grt(t){ - return i=>{ - let s=i; - i.message&&(s=s.message),function(t,i){ - const{ - state:s} - =i; - if(jht.RemoteCommunication(`[RemoteCommunication: onCommunicationLayerMessage()] context=${ - s.context} - on 'message' typeof=${ - typeof t} - `,t),i.state.ready=!0,s.isOriginator||t.type!==lrt.ORIGINATOR_INFO)if(s.isOriginator&&t.type===lrt.WALLET_INFO)!function(t,i){ - const{ - state:s} - =t; - s.walletInfo=i.walletInfo,s.paused=!1} - (i,t); - else{ - if(s.isOriginator&&t.type===lrt.WALLET_INIT)(function(t,i){ - return U9(this,void 0,void 0,function*(){ - var s,e,n; - const{ - state:h} - =t; - if(h.isOriginator){ - const h=i.data||{ - } - ; - if("object"==typeof h&&"accounts"in h&&"chainId"in h&&"walletKey"in h)try{ - const{ - channelConfig:i} - =t.state; - if(jht.RemoteCommunication("WALLET_INIT: channelConfig",JSON.stringify(i,null,2)),i){ - const r=h.accounts,o=h.chainId,a=h.walletKey; - let c,l=!1; - "deeplinkProtocol"in h&&(l=Boolean(h.deeplinkProtocol),t.state.deeplinkProtocolAvailable=l),"walletVersion"in h&&(c=h.walletVersion),yield null===(s=t.state.storageManager)||void 0===s?void 0:s.persistChannelConfig(Object.assign(Object.assign({ - } - ,i),{ - otherKey:a,walletVersion:c,deeplinkProtocolAvailable:l,relayPersistence:!0} - )),yield null===(e=t.state.storageManager)||void 0===e?void 0:e.persistAccounts(r),yield null===(n=t.state.storageManager)||void 0===n?void 0:n.persistChainId(o)} - t.emit(ort.WALLET_INIT,{ - accounts:h.accounts,chainId:h.chainId} - )} - catch(r){ - } - } - } - )} - )(i,t).catch(t=>{ - jht.RemoteCommunication(`[RemoteCommunication: onCommunicationLayerMessage()] error=${ - t} - `)} - ); - else if(t.type===lrt.TERMINATE)(function(t){ - return U9(this,void 0,void 0,function*(){ - const{ - state:i} - =t; - i.isOriginator&&(yield Hrt({ - options:{ - terminate:!0,sendMessage:!1} - ,instance:t} - ),t.emit(ort.TERMINATE))} - )} - )(i).catch(t=>{ - jht.RemoteCommunication(`[RemoteCommunication: onCommunicationLayerMessage()] error=${ - t} - `)} - ); - else if(t.type===lrt.PAUSE)!function(t){ - const{ - state:i} - =t; - i.paused=!0,t.setConnectionStatus(rrt.PAUSED)} - (i); - else if(t.type===lrt.READY&&s.isOriginator)!function(t){ - const{ - state:i} - =t; - t.setConnectionStatus(rrt.LINKED); - const s=i.paused; - i.paused=!1,t.emit(ort.CLIENTS_READY,{ - isOriginator:i.isOriginator,walletInfo:i.walletInfo} - ),s&&(i.authorized=!0,t.emit(ort.AUTHORIZED))} - (i); - else{ - if(t.type===lrt.OTP&&s.isOriginator)return void function(t,i){ - var s; - const{ - state:e} - =t; - t.emit(ort.OTP,i.otpAnswer),1==="6.6".localeCompare((null===(s=e.walletInfo)||void 0===s?void 0:s.version)||"")&&t.emit(ort.SDK_RPC_CALL,{ - method:"eth_requestAccounts",params:[]} - )} - (i,t); - t.type===lrt.AUTHORIZED&&s.isOriginator&&function(t){ - const{ - state:i} - =t; - i.authorized=!0,t.emit(ort.AUTHORIZED)} - (i)} - i.emit(ort.MESSAGE,t)} - else!function(t,i){ - var s; - const{ - state:e} - =t; - null===(s=e.communicationLayer)||void 0===s||s.sendMessage({ - type:lrt.WALLET_INFO,walletInfo:e.walletInfo} - ),e.originatorInfo=i.originatorInfo||i.originator,t.emit(ort.CLIENTS_READY,{ - isOriginator:e.isOriginator,originatorInfo:e.originatorInfo} - ),e.paused=!1} - (i,t)} - (s,t)} - } - function Brt(t){ - return()=>{ - const{ - state:i} - =t; - jht.RemoteCommunication("[RemoteCommunication: handleSocketReconnectEvent()] on 'socket_reconnect' -- reset key exchange status / set ready to false"),i.ready=!1,i.authorized=!1,hrt(i),t.emitServiceStatusEvent({ - context:"socket_reconnect"} - )} - } - function Urt(t){ - return()=>{ - const{ - state:i} - =t; - jht.RemoteCommunication("[RemoteCommunication: handleSocketDisconnectedEvent()] on 'socket_Disconnected' set ready to false"),i.ready=!1} - } - function Frt(t){ - return()=>U9(this,void 0,void 0,function*(){ - var i,s,e,n,h,r,o; - const{ - state:a} - =t; - jht.RemoteCommunication(`[RemoteCommunication: handleFullPersistenceEvent()] context=${ - a.context} - `),t.state.ready=!0,t.state.clientsConnected=!0,t.state.authorized=!0,t.state.relayPersistence=!0,null===(i=t.state.communicationLayer)||void 0===i||i.getKeyExchange().setKeysExchanged(!0),t.emit(ort.KEYS_EXCHANGED,{ - keysExchanged:!0,isOriginator:!0} - ),t.emit(ort.AUTHORIZED),t.emit(ort.CLIENTS_READY),t.emit(ort.CHANNEL_PERSISTENCE); - try{ - a.channelConfig=Object.assign(Object.assign({ - } - ,a.channelConfig),{ - localKey:null===(s=a.communicationLayer)||void 0===s?void 0:s.getKeyExchange().getKeyInfo().ecies.private,otherKey:null===(e=a.communicationLayer)||void 0===e?void 0:e.getKeyExchange().getOtherPublicKey(),channelId:null!==(n=a.channelId)&&void 0!==n?n:"",validUntil:null!==(r=null===(h=a.channelConfig)||void 0===h?void 0:h.validUntil)&&void 0!==r?r:irt,relayPersistence:!0} - ),yield null===(o=a.storageManager)||void 0===o?void 0:o.persistChannelConfig(a.channelConfig)} - catch(c){ - } - } - )} - function $rt({ - communicationLayerPreference:t,otherPublicKey:i,reconnect:s,ecies:e,communicationServerUrl:n=Zht,instance:h} - ){ - var r,o,a,c,l,u,d,f,p,w,g; - const{ - state:m} - =h; - if(jht.RemoteCommunication("[initCommunicationLayer()] ",JSON.stringify(m,null,2)),t!==Ort.SOCKET)throw new Error("Invalid communication protocol"); - m.communicationLayer=new Crt({ - communicationLayerPreference:t,otherPublicKey:i,reconnect:s,transports:m.transports,communicationServerUrl:n,context:m.context,ecies:e,logging:m.logging,remote:h} - ); - let v="undefined"!=typeof document&&document.URL||"",_="undefined"!=typeof document&&document.title||""; - (null===(r=m.dappMetadata)||void 0===r?void 0:r.url)&&(v=m.dappMetadata.url),(null===(o=m.dappMetadata)||void 0===o?void 0:o.name)&&(_=m.dappMetadata.name); - const M=null!==(u=null!==(c=null===(a=m.dappMetadata)||void 0===a?void 0:a.name)&&void 0!==c?c:null===(l=m.dappMetadata)||void 0===l?void 0:l.url)&&void 0!==u?u:"N/A",b="undefined"!=typeof window&&void 0!==window.location&&null!==(d=window.location.hostname)&&void 0!==d?d:M,y={ - url:v,title:_,source:null===(f=m.dappMetadata)||void 0===f?void 0:f.source,dappId:b,anonId:m.anonId,icon:(null===(p=m.dappMetadata)||void 0===p?void 0:p.iconUrl)||(null===(w=m.dappMetadata)||void 0===w?void 0:w.base64Icon),platform:m.platformType,apiVersion:Qht,connector:null===(g=m.dappMetadata)||void 0===g?void 0:g.connector} - ; - m.originatorInfo=y; - const E={ - [ort.AUTHORIZED]:xrt(h),[ort.MESSAGE]:Grt(h),[ort.CHANNEL_PERSISTENCE]:Frt(h),[ort.CLIENTS_CONNECTED]:Prt(h,t),[ort.KEYS_EXCHANGED]:Drt(h,t),[ort.SOCKET_DISCONNECTED]:Urt(h),[ort.SOCKET_RECONNECT]:Brt(h),[ort.CLIENTS_DISCONNECTED]:Nrt(h),[ort.KEY_INFO]:()=>{ - } - ,[ort.CHANNEL_CREATED]:Rrt(h),[ort.CLIENTS_WAITING]:Lrt(h),[ort.RPC_UPDATE]:t=>{ - h.emit(ort.RPC_UPDATE,t)} - } - ; - for(const[S,T]of Object.entries(E))try{ - m.communicationLayer.on(S,T)} - catch(A){ - } - } - function Hrt(t){ - return U9(this,arguments,void 0,function*({ - options:t,instance:i} - ){ - const{ - state:s} - =i; - return jht.RemoteCommunication(`[RemoteCommunication: disconnect()] channel=${ - s.channelId} - `,t),new Promise((e,n)=>{ - var h,r,o,a,c,l; - (null==t?void 0:t.terminate)?(i.state.ready&&qht({ - id:null!==(h=i.state.channelId)&&void 0!==h?h:"",event:urt.TERMINATED} - ,i.state.communicationServerUrl).catch(t=>{ - } - ),s.ready=!1,s.paused=!1,null===(r=s.storageManager)||void 0===r||r.terminate(null!==(o=s.channelId)&&void 0!==o?o:""),i.state.terminated=!0,t.sendMessage?(null===(a=s.communicationLayer)||void 0===a?void 0:a.getKeyInfo().keysExchanged)&&i.state.communicationLayer&&Mrt(i.state.communicationLayer,{ - type:lrt.TERMINATE} - ).then(()=>{ - e(!0)} - ).catch(t=>{ - n(t)} - ):e(!0),s.authorized=!1,s.relayPersistence=!1,s.channelId=$8(),t.channelId=s.channelId,s.channelConfig=void 0,s.originatorConnectStarted=!1,null===(c=s.communicationLayer)||void 0===c||c.disconnect(t),i.setConnectionStatus(rrt.TERMINATED)):(null===(l=s.communicationLayer)||void 0===l||l.disconnect(t),i.setConnectionStatus(rrt.DISCONNECTED),e(!0))} - )} - )} - Qt(xrt,"Fo"),Qt(Rrt,"zo"),Qt(Prt,"qo"),Qt(Nrt,"Wo"),Qt(Lrt,"Vo"),Qt(Drt,"Go"),Qt(Grt,"Yo"),Qt(Brt,"Zo"),Qt(Urt,"Jo"),Qt(Frt,"Qo"),Qt($rt,"Xo"),Qt(Hrt,"es"),(Ort||(Ort={ - } - )).SOCKET="socket",function(t){ - t.NonBrowser="nodejs",t.MetaMaskMobileWebview="in-app-browser",t.DesktopWeb="web-desktop",t.MobileWeb="web-mobile",t.ReactNative="react-native"} - (Irt||(Irt={ - } - )); - const Wrt=class extends x8.EventEmitter2{ - constructor(t){ - super(),this.state={ - ready:!1,anonId:"",authorized:!1,isOriginator:!1,terminated:!1,protocolVersion:1,paused:!1,deeplinkProtocolAvailable:!1,platformType:"metamask-mobile",analytics:!1,reconnection:!1,originatorInfoSent:!1,communicationServerUrl:Zht,context:"",persist:!1,clientsConnected:!1,sessionDuration:irt,originatorConnectStarted:!1,debug:!1,_connectionStatus:rrt.DISCONNECTED} - ,this._options=t; - const{ - anonId:i,platformType:s,communicationLayerPreference:e,otherPublicKey:n,reconnect:h,walletInfo:r,dappMetadata:o,protocolVersion:a,transports:c,context:l,relayPersistence:u,ecies:d,analytics:f=!1,storage:p,sdkVersion:w,communicationServerUrl:g=Zht,logging:m,autoConnect:v={ - timeout:srt} - } - =t; - this.state.anonId=i,this.state.otherPublicKey=n,this.state.dappMetadata=o,this.state.walletInfo=r,this.state.transports=c,this.state.platformType=s,this.state.analytics=f,this.state.protocolVersion=null!=a?a:1,this.state.isOriginator=!n,this.state.relayPersistence=u,this.state.communicationServerUrl=g,this.state.context=l,this.state.terminated=!1,this.state.sdkVersion=w,this.setMaxListeners(50),this.setConnectionStatus(rrt.DISCONNECTED),(null==p?void 0:p.duration)&&(this.state.sessionDuration=irt),this.state.storageOptions=p,this.state.autoConnectOptions=v,this.state.debug=!0===(null==m?void 0:m.remoteLayer),!0===(null==m?void 0:m.remoteLayer)&&G4.enable("RemoteCommunication:Layer"),!0===(null==m?void 0:m.serviceLayer)&&G4.enable("SocketService:Layer"),!0===(null==m?void 0:m.eciesLayer)&&G4.enable("ECIES:Layer"),!0===(null==m?void 0:m.keyExchangeLayer)&&G4.enable("KeyExchange:Layer"),this.state.logging=m,(null==p?void 0:p.storageManager)&&(this.state.storageManager=p.storageManager),jht.RemoteCommunication(`[RemoteCommunication: constructor()] protocolVersion=${ - a} - relayPersistence=${ - u} - isOriginator=${ - this.state.isOriginator} - communicationLayerPreference=${ - e} - otherPublicKey=${ - n} - reconnect=${ - h} - `),this.state.isOriginator||$rt({ - communicationLayerPreference:e,otherPublicKey:n,reconnect:h,ecies:d,communicationServerUrl:g,instance:this} - ),this.emitServiceStatusEvent({ - context:"constructor"} - )} - initFromDappStorage(){ - return U9(this,void 0,void 0,function*(){ - var t; - if(this.state.storageManager){ - const i=yield this.state.storageManager.getPersistedChannelConfig({ - } - ); - i&&(this.state.channelConfig=i,this.state.channelId=i.channelId,this.state.deeplinkProtocolAvailable=null!==(t=i.deeplinkProtocolAvailable)&&void 0!==t&&t,i.relayPersistence&&(this.state.authorized=!0,this.state.ready=!0,this.setConnectionStatus(rrt.LINKED),yield this.connectToChannel({ - channelId:i.channelId} - )))} - $rt({ - communicationLayerPreference:Ort.SOCKET,otherPublicKey:this.state.otherPublicKey,reconnect:this._options.reconnect,ecies:this._options.ecies,communicationServerUrl:this.state.communicationServerUrl,instance:this} - )} - )} - originatorSessionConnect(){ - return U9(this,void 0,void 0,function*(){ - return yield function(t){ - return U9(this,void 0,void 0,function*(){ - var i; - const{ - state:s} - =t; - if(!s.storageManager)return void jht.RemoteCommunication("[RemoteCommunication: originatorSessionConnect()] no storage manager defined - skip"); - const e=yield s.storageManager.getPersistedChannelConfig({ - } - ); - if(jht.RemoteCommunication(`[RemoteCommunication: originatorSessionConnect()] autoStarted=${ - s.originatorConnectStarted} - channelConfig`,e),null===(i=s.communicationLayer)||void 0===i?void 0:i.isConnected())return jht.RemoteCommunication("[RemoteCommunication: originatorSessionConnect()] socket already connected - skip"),e; - if(e){ - if(e.validUntil>Date.now())return s.channelConfig=e,s.originatorConnectStarted=!0,s.channelId=null==e?void 0:e.channelId,s.reconnection=!0,e; - jht.RemoteCommunication("[RemoteCommunication: autoConnect()] Session has expired")} - s.originatorConnectStarted=!1} - )} - (this)} - )} - generateChannelIdConnect(){ - return U9(this,void 0,void 0,function*(){ - return function(t){ - return U9(this,void 0,void 0,function*(){ - var i,s,e,n,h,r; - if(!t.communicationLayer)throw new Error("communication layer not initialized"); - if(t.ready)throw new Error("Channel already connected"); - if(t.channelId&&(null===(i=t.communicationLayer)||void 0===i?void 0:i.isConnected()))return t.channelConfig=Object.assign(Object.assign({ - } - ,t.channelConfig),{ - channelId:t.channelId,validUntil:Date.now()+t.sessionDuration} - ),null===(s=t.storageManager)||void 0===s||s.persistChannelConfig(t.channelConfig),{ - channelId:t.channelId,privKey:null===(n=null===(e=t.communicationLayer)||void 0===e?void 0:e.getKeyInfo())||void 0===n?void 0:n.ecies.private,pubKey:null===(r=null===(h=t.communicationLayer)||void 0===h?void 0:h.getKeyInfo())||void 0===r?void 0:r.ecies.public} - ; - jht.RemoteCommunication("[RemoteCommunication: generateChannelId()]"); - const o=yield t.communicationLayer.createChannel(); - jht.RemoteCommunication("[RemoteCommunication: generateChannelId()] channel created",o); - const a=Object.assign(Object.assign({ - } - ,t.channelConfig),{ - channelId:o.channelId,localKey:o.privKey,validUntil:Date.now()+t.sessionDuration} - ); - return t.channelId=o.channelId,t.channelConfig=a,{ - channelId:t.channelId,pubKey:o.pubKey,privKey:o.privKey} - } - )} - (this.state)} - )} - clean(){ - return hrt(this.state)} - connectToChannel({ - channelId:t,withKeyExchange:i,authorized:s} - ){ - return function(t){ - return U9(this,arguments,void 0,function*({ - channelId:t,withKeyExchange:i,authorized:s,state:e} - ){ - var n,h,r; - if(!G8(t))throw jht.RemoteCommunication(`[RemoteCommunication: connectToChannel()] context=${ - e.context} - invalid channel channelId=${ - t} - `),new Error(`Invalid channel ${ - t} - `); - if(jht.RemoteCommunication(`[RemoteCommunication: connectToChannel()] context=${ - e.context} - channelId=${ - t} - withKeyExchange=${ - i} - `),null===(n=e.communicationLayer)||void 0===n?void 0:n.isConnected())return void jht.RemoteCommunication(`[RemoteCommunication: connectToChannel()] context=${ - e.context} - already connected - interrupt connection.`); - e.channelId=t,yield null===(h=e.communicationLayer)||void 0===h?void 0:h.connectToChannel({ - channelId:t,authorized:s,withKeyExchange:i} - ); - const o=Object.assign(Object.assign({ - } - ,e.channelConfig),{ - channelId:t,validUntil:Date.now()+e.sessionDuration} - ); - e.channelConfig=o,null===(r=e.storageManager)||void 0===r||r.persistChannelConfig(o)} - )} - ({ - channelId:t,authorized:s,withKeyExchange:i,state:this.state} - )} - sendMessage(t){ - return U9(this,void 0,void 0,function*(){ - const i=this.state.isOriginator&&t.method&&nrt(t.method); - i&&A8.analytics.track("sdk_action_requested",{ - action:t.method} - ); - try{ - return yield function(t,i){ - return U9(this,void 0,void 0,function*(){ - var s,e; - const{ - state:n} - =t; - jht.RemoteCommunication(`[RemoteCommunication: sendMessage()] context=${ - n.context} - paused=${ - n.paused} - ready=${ - n.ready} - relayPersistence=${ - n.relayPersistence} - authorized=${ - n.authorized} - socket=${ - null===(s=n.communicationLayer)||void 0===s?void 0:s.isConnected()} - clientsConnected=${ - n.clientsConnected} - status=${ - n._connectionStatus} - `,i),n.relayPersistence||n.ready&&(null===(e=n.communicationLayer)||void 0===e?void 0:e.isConnected())&&n.clientsConnected||(jht.RemoteCommunication(`[RemoteCommunication: sendMessage()] context=${ - n.context} - SKIP message waiting for MM mobile readiness.`),yield new Promise(i=>{ - t.once(ort.CLIENTS_READY,i)} - ),jht.RemoteCommunication(`[RemoteCommunication: sendMessage()] context=${ - n.context} - AFTER SKIP / READY -- sending pending message`)); - try{ - return yield function(t,i){ - return U9(this,void 0,void 0,function*(){ - return new Promise(s=>{ - var e; - const{ - state:n} - =t; - jht.RemoteCommunication(`[RemoteCommunication: handleAuthorization()] context=${ - n.context} - ready=${ - n.ready} - authorized=${ - n.authorized} - method=${ - i.method} - `),!n.isOriginator||n.authorized||n.relayPersistence?null===(e=n.communicationLayer)||void 0===e||e.sendMessage(i).then(t=>{ - s(t)} - ).catch(t=>{ - s(!1)} - ):t.once(ort.AUTHORIZED,()=>{ - var t; - jht.RemoteCommunication(`[RemoteCommunication: handleAuthorization()] context=${ - n.context} - AFTER SKIP / AUTHORIZED -- sending pending message`),null===(t=n.communicationLayer)||void 0===t||t.sendMessage(i).then(t=>{ - s(t)} - ).catch(t=>{ - s(!1)} - )} - )} - )} - )} - (t,i)} - catch(h){ - throw h} - } - )} - (this,t)} - catch(s){ - throw i&&A8.analytics.track("sdk_action_failed",{ - action:t.method} - ),s} - } - )} - testStorage(){ - return U9(this,void 0,void 0,function*(){ - return function(t){ - return U9(this,void 0,void 0,function*(){ - var i; - const s=yield null===(i=t.storageManager)||void 0===i?void 0:i.getPersistedChannelConfig(); - jht.RemoteCommunication("[RemoteCommunication: testStorage()] res",s)} - )} - (this.state)} - )} - hasDeeplinkProtocol(){ - return this.state.deeplinkProtocolAvailable} - getChannelConfig(){ - return this.state.channelConfig} - isReady(){ - return this.state.ready} - isConnected(){ - var t; - return null===(t=this.state.communicationLayer)||void 0===t?void 0:t.isConnected()} - isAuthorized(){ - return this.state.authorized} - isPaused(){ - return this.state.paused} - getCommunicationLayer(){ - return this.state.communicationLayer} - ping(){ - return U9(this,void 0,void 0,function*(){ - var t; - jht.RemoteCommunication(`[RemoteCommunication: ping()] channel=${ - this.state.channelId} - `),yield null===(t=this.state.communicationLayer)||void 0===t?void 0:t.ping()} - )} - testLogger(){ - jht.RemoteCommunication(`testLogger() channel=${ - this.state.channelId} - `),jht.SocketService(`testLogger() channel=${ - this.state.channelId} - `),jht.Ecies(`testLogger() channel=${ - this.state.channelId} - `),jht.KeyExchange(`testLogger() channel=${ - this.state.channelId} - `)} - keyCheck(){ - var t; - jht.RemoteCommunication(`[RemoteCommunication: keyCheck()] channel=${ - this.state.channelId} - `),null===(t=this.state.communicationLayer)||void 0===t||t.keyCheck()} - setConnectionStatus(t){ - this.state._connectionStatus!==t&&(this.state._connectionStatus=t,this.emit(ort.CONNECTION_STATUS,t),this.emitServiceStatusEvent({ - context:"setConnectionStatus"} - ))} - emitServiceStatusEvent(t={ - } - ){ - this.emit(ort.SERVICE_STATUS,this.getServiceStatus())} - getConnectionStatus(){ - return this.state._connectionStatus} - getServiceStatus(){ - return{ - originatorInfo:this.state.originatorInfo,keyInfo:this.getKeyInfo(),connectionStatus:this.state._connectionStatus,channelConfig:this.state.channelConfig,channelId:this.state.channelId} - } - getKeyInfo(){ - var t; - return null===(t=this.state.communicationLayer)||void 0===t?void 0:t.getKeyInfo()} - resetKeys(){ - var t; - null===(t=this.state.communicationLayer)||void 0===t||t.resetKeys()} - setOtherPublicKey(t){ - var i; - const s=null===(i=this.state.communicationLayer)||void 0===i?void 0:i.getKeyExchange(); - if(!s)throw new Error("KeyExchange is not initialized."); - s.getOtherPublicKey()!==t&&s.setOtherPublicKey(t)} - pause(){ - return U9(this,void 0,void 0,function*(){ - var t; - jht.RemoteCommunication(`[RemoteCommunication: pause()] channel=${ - this.state.channelId} - `),yield null===(t=this.state.communicationLayer)||void 0===t?void 0:t.pause(),this.setConnectionStatus(rrt.PAUSED)} - )} - getVersion(){ - return Qht} - hasRelayPersistence(){ - var t; - return null!==(t=this.state.relayPersistence)&&void 0!==t&&t} - resume(){ - return U9(this,void 0,void 0,function*(){ - return function(t){ - return U9(this,void 0,void 0,function*(){ - var i; - const{ - state:s} - =t; - jht.RemoteCommunication(`[RemoteCommunication: resume()] channel=${ - s.channelId} - `),yield null===(i=s.communicationLayer)||void 0===i?void 0:i.resume(),t.setConnectionStatus(rrt.LINKED)} - )} - (this)} - )} - encrypt(t){ - var i,s,e; - const n=null===(i=this.state.communicationLayer)||void 0===i?void 0:i.getKeyExchange(),h=null==n?void 0:n.getOtherPublicKey(); - if(!h)throw new Error("KeyExchange not completed"); - return null===(e=null===(s=this.state.communicationLayer)||void 0===s?void 0:s.state.eciesInstance)||void 0===e?void 0:e.encrypt(t,h)} - decrypt(t){ - var i,s,e; - if(!(null===(i=this.state.communicationLayer)||void 0===i?void 0:i.state.eciesInstance))throw new Error("ECIES instance is not initialized"); - return null===(e=null===(s=this.state.communicationLayer)||void 0===s?void 0:s.state.eciesInstance)||void 0===e?void 0:e.decrypt(t)} - getChannelId(){ - return this.state.channelId} - getRPCMethodTracker(){ - var t; - return null===(t=this.state.communicationLayer)||void 0===t?void 0:t.getRPCMethodTracker()} - reject({ - channelId:t} - ){ - return function(t){ - return U9(this,arguments,void 0,function*({ - channelId:t,state:i} - ){ - var s,e,n; - if(!G8(t))throw jht.RemoteCommunication(`[RemoteCommunication: connectToChannel()] context=${ - i.context} - invalid channel channelId=${ - t} - `),new Error(`Invalid channel ${ - t} - `); - if(i.isOriginator)return void jht.RemoteCommunication(`[RemoteCommunication: reject()] context=${ - i.context} - isOriginator=${ - i.isOriginator} - channelId=${ - t} - `); - const{ - socket:h} - =null!==(e=null===(s=i.communicationLayer)||void 0===s?void 0:s.state)&&void 0!==e?e:{ - } - ; - (null==h?void 0:h.connected)||(jht.RemoteCommunication(`[RemoteCommunication: reject()] context=${ - i.context} - socket already connected`),null==h||h.connect()),qht(Object.assign(Object.assign({ - id:t,event:urt.REJECTED} - ,i.originatorInfo),{ - sdkVersion:i.sdkVersion,commLayerVersion:Qht,walletVersion:null===(n=i.walletInfo)||void 0===n?void 0:n.version} - ),i.communicationServerUrl).catch(t=>{ - } - ),yield new Promise((s,e)=>{ - null==h||h.emit(ort.REJECTED,{ - channelId:t} - ,(t,n)=>{ - jht.RemoteCommunication(`[RemoteCommunication: reject()] context=${ - i.context} - socket=${ - null==h?void 0:h.id} - `,{ - error:t,response:n} - ),t?e(t):s(n)} - )} - )} - )} - ({ - channelId:t,state:this.state} - )} - disconnect(t){ - return U9(this,void 0,void 0,function*(){ - return Hrt({ - options:t,instance:this} - )} - )} - } - ; - Qt(Wrt,"ts"); - let Vrt=Wrt; - !function(t){ - t.RENEW="renew",t.LINK="link"} - (krt||(krt={ - } - )); - var jrt="ERC721",Krt="ERC1155",zrt={ - errors:{ - disconnected:Qt(()=>"MetaMask: Disconnected from chain. Attempting to connect.","disconnected"),permanentlyDisconnected:Qt(()=>"MetaMask: Disconnected from MetaMask background. Page reload required.","permanentlyDisconnected"),sendSiteMetadata:Qt(()=>"MetaMask: Failed to send site metadata. This is an internal error, please report this bug.","sendSiteMetadata"),unsupportedSync:Qt(t=>`MetaMask: The MetaMask Ethereum provider does not support synchronous methods like ${ - t} - without a callback parameter.`,"unsupportedSync"),invalidDuplexStream:Qt(()=>"Must provide a Node.js-style duplex stream.","invalidDuplexStream"),invalidNetworkParams:Qt(()=>"MetaMask: Received invalid network parameters. Please report this bug.","invalidNetworkParams"),invalidRequestArgs:Qt(()=>"Expected a single, non-array, object argument.","invalidRequestArgs"),invalidRequestMethod:Qt(()=>"'args.method' must be a non-empty string.","invalidRequestMethod"),invalidRequestParams:Qt(()=>"'args.params' must be an object or array if provided.","invalidRequestParams"),invalidLoggerObject:Qt(()=>"'args.logger' must be an object if provided.","invalidLoggerObject"),invalidLoggerMethod:Qt(t=>`'args.logger' must include required method '${ - t} - '.`,"invalidLoggerMethod")} - ,info:{ - connected:Qt(t=>`MetaMask: Connected to chain with ID "${ - t} - ".`,"connected")} - ,warnings:{ - chainIdDeprecation:"MetaMask: 'ethereum.chainId' is deprecated and may be removed in the future. Please use the 'eth_chainId' RPC method instead.\nFor more information, see: https://github.com/MetaMask/metamask-improvement-proposals/discussions/23",networkVersionDeprecation:"MetaMask: 'ethereum.networkVersion' is deprecated and may be removed in the future. Please use the 'net_version' RPC method instead.\nFor more information, see: https://github.com/MetaMask/metamask-improvement-proposals/discussions/23",selectedAddressDeprecation:"MetaMask: 'ethereum.selectedAddress' is deprecated and may be removed in the future. Please use the 'eth_accounts' RPC method instead.\nFor more information, see: https://github.com/MetaMask/metamask-improvement-proposals/discussions/23",enableDeprecation:"MetaMask: 'ethereum.enable()' is deprecated and may be removed in the future. Please use the 'eth_requestAccounts' RPC method instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1102",sendDeprecation:"MetaMask: 'ethereum.send(...)' is deprecated and may be removed in the future. Please use 'ethereum.sendAsync(...)' or 'ethereum.request(...)' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193",events:{ - close:"MetaMask: The event 'close' is deprecated and may be removed in the future. Please use 'disconnect' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#disconnect",data:"MetaMask: The event 'data' is deprecated and will be removed in the future. Use 'message' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message",networkChanged:"MetaMask: The event 'networkChanged' is deprecated and may be removed in the future. Use 'chainChanged' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#chainchanged",notification:"MetaMask: The event 'notification' is deprecated and may be removed in the future. Use 'message' instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message"} - ,rpc:{ - ethDecryptDeprecation:"MetaMask: The RPC method 'eth_decrypt' is deprecated and may be removed in the future.\nFor more information, see: https://medium.com/metamask/metamask-api-method-deprecation-2b0564a84686",ethGetEncryptionPublicKeyDeprecation:"MetaMask: The RPC method 'eth_getEncryptionPublicKey' is deprecated and may be removed in the future.\nFor more information, see: https://medium.com/metamask/metamask-api-method-deprecation-2b0564a84686",walletWatchAssetNFTExperimental:"MetaMask: The RPC method 'wallet_watchAsset' is experimental for ERC721/ERC1155 assets and may change in the future.\nFor more information, see: https://github.com/MetaMask/metamask-improvement-proposals/blob/main/MIPs/mip-1.md and https://github.com/MetaMask/metamask-improvement-proposals/blob/main/PROCESS-GUIDE.md#proposal-lifecycle"} - ,experimentalMethods:"MetaMask: 'ethereum._metamask' exposes non-standard, experimental methods. They may be removed or changed without warning."} - } - ; - function Yrt(t){ - const i={ - ethDecryptDeprecation:!1,ethGetEncryptionPublicKeyDeprecation:!1,walletWatchAssetNFTExperimental:!1} - ; - return(s,e,n)=>{ - var h; - i.ethDecryptDeprecation||"eth_decrypt"!==s.method?i.ethGetEncryptionPublicKeyDeprecation||"eth_getEncryptionPublicKey"!==s.method?!i.walletWatchAssetNFTExperimental&&"wallet_watchAsset"===s.method&&[jrt,Krt].includes((null==(h=s.params)?void 0:h.type)||"")&&(t.warn(zrt.warnings.rpc.walletWatchAssetNFTExperimental),i.walletWatchAssetNFTExperimental=!0):(t.warn(zrt.warnings.rpc.ethGetEncryptionPublicKeyDeprecation),i.ethGetEncryptionPublicKeyDeprecation=!0):(t.warn(zrt.warnings.rpc.ethDecryptDeprecation),i.ethDecryptDeprecation=!0),n()} - } - Qt(Yrt,"os"); - var qrt=4294967295,Xrt=Math.floor(Math.random()*qrt); - function Jrt(){ - return(t,i,s,e)=>{ - const n=t.id,h=Xrt=(Xrt+1)%qrt; - t.id=h,i.id=h,s(s=>{ - t.id=n,i.id=n,s()} - )} - } - Qt(Jrt,"cs"); - var Qrt=Qt((t,i,s)=>{ - if(!i.has(t))throw TypeError("Cannot "+s)} - ,"ls"),Zrt=Qt((t,i,s)=>(Qrt(t,i,"read from private field"),s?s.call(t):i.get(t)),"ds"),tot=Qt((t,i,s)=>{ - if(i.has(t))throw TypeError("Cannot add the same private member more than once"); - i instanceof WeakSet?i.add(t):i.set(t,s)} - ,"us"),iot=Qt((t,i,s,e)=>(Qrt(t,i,"write to private field"),i.set(t,s),s),"hs"),sot=Qt((t,i,s)=>(Qrt(t,i,"access private method"),s),"fs"),eot=-32600,not=-32603,hot={ - "-32700":{ - standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."} - ,"-32600":{ - standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."} - ,"-32601":{ - standard:"JSON RPC 2.0",message:"The method does not exist / is not available."} - ,"-32602":{ - standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."} - ,"-32603":{ - standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."} - ,"-32000":{ - standard:"EIP-1474",message:"Invalid input."} - ,"-32001":{ - standard:"EIP-1474",message:"Resource not found."} - ,"-32002":{ - standard:"EIP-1474",message:"Resource unavailable."} - ,"-32003":{ - standard:"EIP-1474",message:"Transaction rejected."} - ,"-32004":{ - standard:"EIP-1474",message:"Method not supported."} - ,"-32005":{ - standard:"EIP-1474",message:"Request limit exceeded."} - ,4001:{ - standard:"EIP-1193",message:"User rejected the request."} - ,4100:{ - standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."} - ,4200:{ - standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."} - ,4900:{ - standard:"EIP-1193",message:"The provider is disconnected from all chains."} - ,4901:{ - standard:"EIP-1193",message:"The provider is disconnected from the specified chain."} - } - ; - function rot(t){ - return Boolean(t)&&"object"==typeof t&&!Array.isArray(t)} - Qt(rot,"ms"); - var oot=Qt((t,i)=>Object.hasOwnProperty.call(t,i),"ys"); - const aot=class extends TypeError{ - constructor(t,i){ - let s; - const{ - message:e,explanation:n,...h} - =t,{ - path:r} - =t,o=0===r.length?e:`At path: ${ - r.join(".")} - -- ${ - e} - `; - super(n??o),null!=n&&(this.cause=o),Object.assign(this,h),this.name=this.constructor.name,this.failures=()=>s??(s=[t,...i()])} - } - ; - Qt(aot,"vs"); - let cot=aot; - function lot(t){ - return"object"==typeof t&&null!=t} - function uot(t){ - return"symbol"==typeof t?t.toString():"string"==typeof t?JSON.stringify(t):`${ - t} - `} - function dot(t,i,s,e){ - if(!0===t)return; - !1===t?t={ - } - :"string"==typeof t&&(t={ - message:t} - ); - const{ - path:n,branch:h} - =i,{ - type:r} - =s,{ - refinement:o,message:a=`Expected a value of type \`${ - r} - \`${ - o?` with refinement \`${ - o} - \``:""} - , but received: \`${ - uot(e)} - \``} - =t; - return{ - value:e,type:r,refinement:o,key:n[n.length-1],path:n,branch:h,...t,message:a} - } - function*fot(t,i,s,e){ - var n; - lot(n=t)&&"function"==typeof n[Symbol.iterator]||(t=[t]); - for(const h of t){ - const t=dot(h,i,s,e); - t&&(yield t)} - } - function*pot(t,i,s={ - } - ){ - const{ - path:e=[],branch:n=[t],coerce:h=!1,mask:r=!1} - =s,o={ - path:e,branch:n} - ; - if(h&&(t=i.coercer(t,o),r&&"type"!==i.type&&lot(i.schema)&&lot(t)&&!Array.isArray(t)))for(const c in t)void 0===i.schema[c]&&delete t[c]; - let a="valid"; - for(const c of i.validator(t,o))c.explanation=s.message,a="not_valid",yield[c,void 0]; - for(let[c,l,u]of i.entries(t,o)){ - const i=pot(l,u,{ - path:void 0===c?e:[...e,c],branch:void 0===c?n:[...n,l],coerce:h,mask:r,message:s.message} - ); - for(const s of i)s[0]?(a=null!=s[0].refinement?"not_refined":"not_valid",yield[s[0],void 0]):h&&(l=s[1],void 0===c?t=l:t instanceof Map?t.set(c,l):t instanceof Set?t.add(l):lot(t)&&(void 0!==l||c in t)&&(t[c]=l))} - if("not_valid"!==a)for(const c of i.refiner(t,o))c.explanation=s.message,a="not_refined",yield[c,void 0]; - "valid"===a&&(yield[void 0,t])} - Qt(lot,"bs"),Qt(uot,"ws"),Qt(dot,"Es"),Qt(fot,"Ss"),Qt(pot,"_s"); - const wot=class{ - constructor(t){ - const{ - type:i,schema:s,validator:e,refiner:n,coercer:h=Qt(t=>t,"o"),entries:r=Qt(function*(){ - } - ,"s")} - =t; - this.type=i,this.schema=s,this.entries=r,this.coercer=h,this.validator=e?(t,i)=>fot(e(t,i),i,this,t):()=>[],this.refiner=n?(t,i)=>fot(n(t,i),i,this,t):()=>[]} - assert(t,i){ - return mot(t,this,i)} - create(t,i){ - return vot(t,this,i)} - is(t){ - return _ot(t,this)} - mask(t,i){ - return function(t,i,s){ - const e=Mot(t,i,{ - coerce:!0,mask:!0,message:s} - ); - if(e[0])throw e[0]; - return e[1]} - (t,this,i)} - validate(t,i={ - } - ){ - return Mot(t,this,i)} - } - ; - Qt(wot,"Cs"); - let got=wot; - function mot(t,i,s){ - const e=Mot(t,i,{ - message:s} - ); - if(e[0])throw e[0]} - function vot(t,i,s){ - const e=Mot(t,i,{ - coerce:!0,message:s} - ); - if(e[0])throw e[0]; - return e[1]} - function _ot(t,i){ - return!Mot(t,i)[0]} - function Mot(t,i,s={ - } - ){ - const e=pot(t,i,s),n=function(t){ - const{ - done:i,value:s} - =t.next(); - return i?void 0:s} - (e); - return n[0]?[new cot(n[0],function*(){ - for(const t of e)t[0]&&(yield t[0])} - ),void 0]:[void 0,n[1]]} - function bot(t,i){ - return new got({ - type:t,schema:null,validator:i} - )} - function yot(t){ - let i; - return new got({ - type:"lazy",schema:null,*entries(s,e){ - i??(i=t()),yield*i.entries(s,e)} - ,validator:Qt((s,e)=>(i??(i=t()),i.validator(s,e)),"validator"),coercer:Qt((s,e)=>(i??(i=t()),i.coercer(s,e)),"coercer"),refiner:Qt((s,e)=>(i??(i=t()),i.refiner(s,e)),"refiner")} - )} - function Eot(t){ - return new got({ - type:"array",schema:t,*entries(i){ - if(t&&Array.isArray(i))for(const[s,e]of i.entries())yield[s,e,t]} - ,coercer:Qt(t=>Array.isArray(t)?t.slice():t,"coercer"),validator:Qt(t=>Array.isArray(t)||`Expected an array value, but received: ${ - uot(t)} - `,"validator")} - )} - function Aot(t){ - const i=uot(t),s=typeof t; - return new got({ - type:"literal",schema:"string"===s||"number"===s||"boolean"===s?t:null,validator:Qt(s=>s===t||`Expected the literal \`${ - i} - \`, but received: ${ - uot(s)} - `,"validator")} - )} - function Sot(){ - return bot("number",t=>"number"==typeof t&&!isNaN(t)||`Expected a number, but received: ${ - uot(t)} - `)} - function Tot(t){ - const i=t?Object.keys(t):[],s=bot("never",()=>!1); - return new got({ - type:"object",schema:t||null,*entries(e){ - if(t&&lot(e)){ - const n=new Set(Object.keys(e)); - for(const s of i)n.delete(s),yield[s,e[s],t[s]]; - for(const t of n)yield[t,e[t],s]} - } - ,validator:Qt(t=>lot(t)||`Expected an object, but received: ${ - uot(t)} - `,"validator"),coercer:Qt(t=>lot(t)?{ - ...t} - :t,"coercer")} - )} - function Cot(t){ - return new got({ - ...t,validator:Qt((i,s)=>void 0===i||t.validator(i,s),"validator"),refiner:Qt((i,s)=>void 0===i||t.refiner(i,s),"refiner")} - )} - function Oot(t,i){ - return new got({ - type:"record",schema:null,*entries(s){ - if(lot(s))for(const e in s){ - const n=s[e]; - yield[e,e,t],yield[e,n,i]} - } - ,validator:Qt(t=>lot(t)||`Expected an object, but received: ${ - uot(t)} - `,"validator")} - )} - function Iot(){ - return bot("string",t=>"string"==typeof t||`Expected a string, but received: ${ - uot(t)} - `)} - function kot(t){ - const i=t.map(t=>t.type).join(" | "); - return new got({ - type:"union",schema:null,coercer(i){ - for(const s of t){ - const[t,e]=s.validate(i,{ - coerce:!0} - ); - if(!t)return e} - return i} - ,validator(s,e){ - const n=[]; - for(const i of t){ - const[...t]=pot(s,i,e),[h]=t; - if(!h[0])return[]; - for(const[i]of t)i&&n.push(i)} - return[`Expected the value to satisfy a union of \`${ - i} - \`, but received: ${ - uot(s)} - `,...n]} - } - )} - function xot(t){ - return(i=t,"object"==typeof(s=i)&&null!==s&&"message"in s&&"string"==typeof i.message?i.message:null==i?"":String(i)).replace(/\.$/u,""); - var i,s} - function Rot(t,i){ - var s,e,n; - return n=t,Boolean("string"==typeof(null==(e=null==(s=null==n?void 0:n.prototype)?void 0:s.constructor)?void 0:e.name))?new t({ - message:i} - ):t({ - message:i} - )} - Qt(mot,"ks"),Qt(vot,"As"),Qt(_ot,"xs"),Qt(Mot,"Ms"),Qt(bot,"Is"),Qt(yot,"Ts"),Qt(Eot,"Rs"),Qt(Aot,"Ps"),Qt(Sot,"Os"),Qt(Tot,"Ns"),Qt(Cot,"Ls"),Qt(Oot,"Ds"),Qt(Iot,"$s"),Qt(kot,"Bs"),Qt(xot,"Ks"),Qt(Rot,"js"); - var Pot=(ct=class extends Error{ - constructor(t){ - super(t.message),this.code="ERR_ASSERTION"} - } - ,Qt(ct,"Us"),ct); - function Not(){ - throw new Error("setTimeout has not been defined")} - function Lot(){ - throw new Error("clearTimeout has not been defined")} - Qt(Not,"Hs"),Qt(Lot,"Fs"); - var Dot=Not,Got=Lot; - function Bot(t){ - if(Dot===setTimeout)return setTimeout(t,0); - if((Dot===Not||!Dot)&&setTimeout)return Dot=setTimeout,setTimeout(t,0); - try{ - return Dot(t,0)} - catch(Vut){ - try{ - return Dot.call(null,t,0)} - catch(i){ - return Dot.call(this,t,0)} - } - } - Qt(Bot,"Ws"),"function"==typeof F9.setTimeout&&(Dot=setTimeout),"function"==typeof F9.clearTimeout&&(Got=clearTimeout); - var Uot,Fot=[],$ot=!1,Hot=-1; - function Wot(){ - $ot&&Uot&&($ot=!1,Uot.length?Fot=Uot.concat(Fot):Hot=-1,Fot.length&&Vot())} - function Vot(){ - if(!$ot){ - var t=Bot(Wot); - $ot=!0; - for(var i=Fot.length; - i; - ){ - for(Uot=Fot,Fot=[]; - ++Hot<i; - )Uot&&Uot[Hot].run(); - Hot=-1,i=Fot.length} - Uot=null,$ot=!1,function(t){ - if(Got===clearTimeout)return clearTimeout(t); - if((Got===Lot||!Got)&&clearTimeout)return Got=clearTimeout,clearTimeout(t); - try{ - return Got(t)} - catch(i){ - try{ - return Got.call(null,t)} - catch(s){ - return Got.call(this,t)} - } - } - (t)} - } - function jot(t,i){ - this.fun=t,this.array=i} - function Kot(){ - } - Qt(Wot,"Js"),Qt(Vot,"Qs"),Qt(jot,"Xs"),jot.prototype.run=function(){ - this.fun.apply(null,this.array)} - ,Qt(Kot,"ea"); - var zot=Kot,Yot=Kot,qot=Kot,Xot=Kot,Jot=Kot,Qot=Kot,Zot=Kot,tat=F9.performance||{ - } - ,iat=tat.now||tat.mozNow||tat.msNow||tat.oNow||tat.webkitNow||function(){ - return(new Date).getTime()} - ,sat=new Date,eat={ - nextTick:Qt(function(t){ - var i=new Array(arguments.length-1); - if(arguments.length>1)for(var s=1; - s<arguments.length; - s++)i[s-1]=arguments[s]; - Fot.push(new jot(t,i)),1!==Fot.length||$ot||Bot(Vot)} - ,"nextTick"),title:"browser",browser:!0,env:{ - } - ,argv:[],version:"",versions:{ - } - ,on:zot,addListener:Yot,once:qot,off:Xot,removeListener:Jot,removeAllListeners:Qot,emit:Zot,binding:Qt(function(t){ - throw new Error("process.binding is not supported")} - ,"binding"),cwd:Qt(function(){ - return"/"} - ,"cwd"),chdir:Qt(function(t){ - throw new Error("process.chdir is not supported")} - ,"chdir"),umask:Qt(function(){ - return 0} - ,"umask"),hrtime:Qt(function(t){ - var i=.001*iat.call(tat),s=Math.floor(i),e=Math.floor(i%1*1e9); - return t&&(s-=t[0],(e-=t[1])<0&&(s--,e+=1e9)),[s,e]} - ,"hrtime"),platform:"browser",release:{ - } - ,config:{ - } - ,uptime:Qt(function(){ - return(new Date-sat)/1e3} - ,"uptime")} - ,nat=Qt(t=>Tot(t),"ha"); - function hat({ - path:t,branch:i} - ){ - const s=t[t.length-1]; - return oot(i[i.length-2],s)} - function rat(t){ - return new got({ - ...t,type:`optional ${ - t.type} - `,validator:Qt((i,s)=>!hat(s)||t.validator(i,s),"validator"),refiner:Qt((i,s)=>!hat(s)||t.refiner(i,s),"refiner")} - )} - Qt(hat,"fa"),Qt(rat,"pa"); - var oat,aat,cat,lat=kot([Aot(null),bot("boolean",t=>"boolean"==typeof t),bot("finite number",t=>_ot(t,Sot())&&Number.isFinite(t)),Iot(),Eot(yot(()=>lat)),Oot(Iot(),yot(()=>lat))]),uat=(oat=lat,aat=bot("any",()=>!0),cat=Qt(t=>(function(t,i,s="Assertion failed",e=Pot){ - try{ - mot(t,i)} - catch(n){ - throw Rot(e,`${ - s} - : ${ - xot(n)} - .`)} - } - (t,lat),JSON.parse(JSON.stringify(t,(t,i)=>{ - if("__proto__"!==t&&"constructor"!==t)return i} - ))),"ya"),new got({ - ...oat,coercer:Qt((t,i)=>_ot(t,aat)?oat.coercer(cat(t,i),i):oat.coercer(t,i),"coercer")} - )); - function dat(t){ - try{ - return vot(t,uat),!0} - catch{ - return!1} - } - Qt(dat,"wa"); - var fat=Aot("2.0"),pat=function(t){ - return new got({ - ...t,validator:Qt((i,s)=>null===i||t.validator(i,s),"validator"),refiner:Qt((i,s)=>null===i||t.refiner(i,s),"refiner")} - )} - (kot([Sot(),Iot()])),wat=nat({ - code:bot("integer",t=>"number"==typeof t&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${ - uot(t)} - `),message:Iot(),data:rat(uat),stack:rat(Iot())} - ),gat=kot([Oot(Iot(),uat),Eot(uat)]),mat=nat({ - id:pat,jsonrpc:fat,method:Iot(),params:rat(gat)} - ),vat=nat({ - jsonrpc:fat,method:Iot(),params:rat(gat)} - ); - function _at(t){ - return _ot(t,mat)} - function Mat(t){ - return _ot(t,wat)} - Qt(_at,"xa"),Qt(Mat,"Ma"),Tot({ - id:pat,jsonrpc:fat,result:Cot(bot("unknown",()=>!0)),error:Cot(wat)} - ),kot([nat({ - id:pat,jsonrpc:fat,result:uat} - ),nat({ - id:pat,jsonrpc:fat,error:wat} - )]); - var bat={ - code:not,message:Eat(not)} - ,yat="Unspecified server error."; - function Eat(t,i="Unspecified error message. This is a bug, please report it."){ - if(s=t,Number.isInteger(s)){ - const i=t.toString(); - if(oot(hot,i))return hot[i].message; - if(function(t){ - return t>=-32099&&t<=-32e3} - (t))return yat} - var s; - return i} - function Aat(t,{ - fallbackError:i=bat,shouldIncludeStack:s=!0} - ={ - } - ){ - if(!Mat(i))throw new Error("Must provide fallback error with integer number code and string message."); - const e=(h=i,(n=t)&&"object"==typeof n&&"serialize"in n&&"function"==typeof n.serialize?n.serialize():Mat(n)?n:{ - ...h,data:{ - cause:Sat(n)} - } - ); - var n,h; - return s||delete e.stack,e} - function Sat(t){ - return Array.isArray(t)?t.map(t=>dat(t)?t:rot(t)?Tat(t):null):rot(t)?Tat(t):dat(t)?t:null} - function Tat(t){ - return Object.getOwnPropertyNames(t).reduce((i,s)=>{ - const e=t[s]; - return dat(e)&&(i[s]=e),i} - ,{ - } - )} - Qt(Eat,"Oa"),Qt(Aat,"Na"),Qt(Sat,"La"),Qt(Tat,"Da"); - var Cat=Pat; - Pat.default=Pat,Pat.stable=Gat,Pat.stableStringify=Gat; - var Oat="[...]",Iat="[Circular]",kat=[],xat=[]; - function Rat(){ - return{ - depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER} - } - function Pat(t,i,s,e){ - var n; - void 0===e&&(e=Rat()),Lat(t,"",0,[],void 0,0,e); - try{ - n=0===xat.length?JSON.stringify(t,i,s):JSON.stringify(t,Uat(i),s)} - catch(r){ - return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")} - finally{ - for(; - 0!==kat.length; - ){ - var h=kat.pop(); - 4===h.length?Object.defineProperty(h[0],h[1],h[3]):h[0][h[1]]=h[2]} - } - return n} - function Nat(t,i,s,e){ - var n=Object.getOwnPropertyDescriptor(e,s); - void 0!==n.get?n.configurable?(Object.defineProperty(e,s,{ - value:t} - ),kat.push([e,s,i,n])):xat.push([i,s,t]):(e[s]=t,kat.push([e,s,i]))} - function Lat(t,i,s,e,n,h,r){ - var o; - if(h+=1,"object"==typeof t&&null!==t){ - for(o=0; - o<e.length; - o++)if(e[o]===t)return void Nat(Iat,t,i,n); - if(void 0!==r.depthLimit&&h>r.depthLimit)return void Nat(Oat,t,i,n); - if(void 0!==r.edgesLimit&&s+1>r.edgesLimit)return void Nat(Oat,t,i,n); - if(e.push(t),Array.isArray(t))for(o=0; - o<t.length; - o++)Lat(t[o],o,o,e,t,h,r); - else{ - var a=Object.keys(t); - for(o=0; - o<a.length; - o++){ - var c=a[o]; - Lat(t[c],c,o,e,t,h,r)} - } - e.pop()} - } - function Dat(t,i){ - return t<i?-1:t>i?1:0} - function Gat(t,i,s,e){ - void 0===e&&(e=Rat()); - var n,h=Bat(t,"",0,[],void 0,0,e)||t; - try{ - n=0===xat.length?JSON.stringify(h,i,s):JSON.stringify(h,Uat(i),s)} - catch(o){ - return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")} - finally{ - for(; - 0!==kat.length; - ){ - var r=kat.pop(); - 4===r.length?Object.defineProperty(r[0],r[1],r[3]):r[0][r[1]]=r[2]} - } - return n} - function Bat(t,i,s,e,n,h,r){ - var o; - if(h+=1,"object"==typeof t&&null!==t){ - for(o=0; - o<e.length; - o++)if(e[o]===t)return void Nat(Iat,t,i,n); - try{ - if("function"==typeof t.toJSON)return} - catch(u){ - return} - if(void 0!==r.depthLimit&&h>r.depthLimit)return void Nat(Oat,t,i,n); - if(void 0!==r.edgesLimit&&s+1>r.edgesLimit)return void Nat(Oat,t,i,n); - if(e.push(t),Array.isArray(t))for(o=0; - o<t.length; - o++)Bat(t[o],o,o,e,t,h,r); - else{ - var a={ - } - ,c=Object.keys(t).sort(Dat); - for(o=0; - o<c.length; - o++){ - var l=c[o]; - Bat(t[l],l,o,e,t,h,r),a[l]=t[l]} - if(void 0===n)return a; - kat.push([n,i,t]),n[i]=a} - e.pop()} - } - function Uat(t){ - return t=void 0!==t?t:function(t,i){ - return i} - ,function(i,s){ - if(xat.length>0)for(var e=0; - e<xat.length; - e++){ - var n=xat[e]; - if(n[1]===i&&n[0]===s){ - s=n[2],xat.splice(e,1); - break} - } - return t.call(this,i,s)} - } - Qt(Rat,"Ha"),Qt(Pat,"Fa"),Qt(Nat,"za"),Qt(Lat,"qa"),Qt(Dat,"Wa"),Qt(Gat,"Va"),Qt(Bat,"Ga"),Qt(Uat,"Ya"); - var Fat=Htt(Cat),$at=(lt=class extends Error{ - constructor(t,i,s){ - if(!Number.isInteger(t))throw new Error('"code" must be an integer.'); - if(!i||"string"!=typeof i)throw new Error('"message" must be a non-empty string.'); - super(i),this.code=t,void 0!==s&&(this.data=s)} - serialize(){ - const t={ - code:this.code,message:this.message} - ; - return void 0!==this.data&&(t.data=this.data,function(t){ - if("object"!=typeof t||null===t)return!1; - try{ - let i=t; - for(; - null!==Object.getPrototypeOf(i); - )i=Object.getPrototypeOf(i); - return Object.getPrototypeOf(t)===i} - catch(i){ - return!1} - } - (this.data)&&(t.data.cause=Sat(this.data.cause))),this.stack&&(t.stack=this.stack),t} - toString(){ - return Fat(this.serialize(),Hat,2)} - } - ,Qt(lt,"Ja"),lt); - function Hat(t,i){ - if("[Circular]"!==i)return i} - Qt(Hat,"Qa"); - var Wat=Qt(t=>Vat(eot,t),"Xa"); - function Vat(t,i){ - const[s,e]=function(t){ - if(t){ - if("string"==typeof t)return[t]; - if("object"==typeof t&&!Array.isArray(t)){ - const{ - message:i,data:s} - =t; - if(i&&"string"!=typeof i)throw new Error("Must specify string message."); - return[i??void 0,s]} - } - return[]} - (i); - return new $at(t,s??Eat(t),e)} - Qt(Vat,"ec"); - var jat={ - } - ; - function Kat(){ - } - function zat(){ - zat.init.call(this)} - function Yat(t){ - return void 0===t._maxListeners?zat.defaultMaxListeners:t._maxListeners} - function qat(t,i,s,e){ - var n,h,r; - if("function"!=typeof s)throw new TypeError('"listener" argument must be a function'); - if((h=t._events)?(h.newListener&&(t.emit("newListener",i,s.listener?s.listener:s),h=t._events),r=h[i]):(h=t._events=new Kat,t._eventsCount=0),r){ - if("function"==typeof r?r=h[i]=e?[s,r]:[r,s]:e?r.unshift(s):r.push(s),!r.warned&&(n=Yat(t))&&n>0&&r.length>n){ - r.warned=!0; - var o=new Error("Possible EventEmitter memory leak detected. "+r.length+" "+i+" listeners added. Use emitter.setMaxListeners() to increase limit"); - o.name="MaxListenersExceededWarning",o.emitter=t,o.type=i,o.count=r.length,console.warn} - } - else r=h[i]=s,++t._eventsCount; - return t} - function Xat(t,i,s){ - var e=!1; - function n(){ - t.removeListener(i,n),e||(e=!0,s.apply(t,arguments))} - return Qt(n,"i"),n.listener=s,n} - function Jat(t){ - var i=this._events; - if(i){ - var s=i[t]; - if("function"==typeof s)return 1; - if(s)return s.length} - return 0} - function Qat(t,i){ - for(var s=new Array(i); - i--; - )s[i]=t[i]; - return s} - Qt(Kat,"nc"),Qt(zat,"rc"),Qt(Yat,"ic"),Qt(qat,"oc"),Qt(Xat,"sc"),Qt(Jat,"ac"),Qt(Qat,"cc"),Kat.prototype=Object.create(null),zat.EventEmitter=zat,zat.usingDomains=!1,zat.prototype.domain=void 0,zat.prototype._events=void 0,zat.prototype._maxListeners=void 0,zat.defaultMaxListeners=10,zat.init=function(){ - this.domain=null,zat.usingDomains&&(void 0).active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new Kat,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0} - ,zat.prototype.setMaxListeners=function(t){ - if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number'); - return this._maxListeners=t,this} - ,zat.prototype.getMaxListeners=function(){ - return Yat(this)} - ,zat.prototype.emit=function(t){ - var i,s,e,n,h,r,o,a="error"===t; - if(r=this._events)a=a&&null==r.error; - else if(!a)return!1; - if(o=this.domain,a){ - if(i=arguments[1],!o){ - if(i instanceof Error)throw i; - var c=new Error('Uncaught, unspecified "error" event. ('+i+")"); - throw c.context=i,c} - return i||(i=new Error('Uncaught, unspecified "error" event')),i.domainEmitter=this,i.domain=o,i.domainThrown=!1,o.emit("error",i),!1} - if(!(s=r[t]))return!1; - var l="function"==typeof s; - switch(e=arguments.length){ - case 1:!function(t,i,s){ - if(i)t.call(s); - else for(var e=t.length,n=Qat(t,e),h=0; - h<e; - ++h)n[h].call(s)} - (s,l,this); - break; - case 2:!function(t,i,s,e){ - if(i)t.call(s,e); - else for(var n=t.length,h=Qat(t,n),r=0; - r<n; - ++r)h[r].call(s,e)} - (s,l,this,arguments[1]); - break; - case 3:!function(t,i,s,e,n){ - if(i)t.call(s,e,n); - else for(var h=t.length,r=Qat(t,h),o=0; - o<h; - ++o)r[o].call(s,e,n)} - (s,l,this,arguments[1],arguments[2]); - break; - case 4:!function(t,i,s,e,n,h){ - if(i)t.call(s,e,n,h); - else for(var r=t.length,o=Qat(t,r),a=0; - a<r; - ++a)o[a].call(s,e,n,h)} - (s,l,this,arguments[1],arguments[2],arguments[3]); - break; - default:for(n=new Array(e-1),h=1; - h<e; - h++)n[h-1]=arguments[h]; - !function(t,i,s,e){ - if(i)t.apply(s,e); - else for(var n=t.length,h=Qat(t,n),r=0; - r<n; - ++r)h[r].apply(s,e)} - (s,l,this,n)} - return!0} - ,zat.prototype.addListener=function(t,i){ - return qat(this,t,i,!1)} - ,zat.prototype.on=zat.prototype.addListener,zat.prototype.prependListener=function(t,i){ - return qat(this,t,i,!0)} - ,zat.prototype.once=function(t,i){ - if("function"!=typeof i)throw new TypeError('"listener" argument must be a function'); - return this.on(t,Xat(this,t,i)),this} - ,zat.prototype.prependOnceListener=function(t,i){ - if("function"!=typeof i)throw new TypeError('"listener" argument must be a function'); - return this.prependListener(t,Xat(this,t,i)),this} - ,zat.prototype.removeListener=function(t,i){ - var s,e,n,h,r; - if("function"!=typeof i)throw new TypeError('"listener" argument must be a function'); - if(!(e=this._events))return this; - if(!(s=e[t]))return this; - if(s===i||s.listener&&s.listener===i)0==--this._eventsCount?this._events=new Kat:(delete e[t],e.removeListener&&this.emit("removeListener",t,s.listener||i)); - else if("function"!=typeof s){ - for(n=-1,h=s.length; - h-- >0; - )if(s[h]===i||s[h].listener&&s[h].listener===i){ - r=s[h].listener,n=h; - break} - if(n<0)return this; - if(1===s.length){ - if(s[0]=void 0,0==--this._eventsCount)return this._events=new Kat,this; - delete e[t]} - else!function(t,i){ - for(var s=i,e=s+1,n=t.length; - e<n; - s+=1,e+=1)t[s]=t[e]; - t.pop()} - (s,n); - e.removeListener&&this.emit("removeListener",t,r||i)} - return this} - ,zat.prototype.off=function(t,i){ - return this.removeListener(t,i)} - ,zat.prototype.removeAllListeners=function(t){ - var i,s; - if(!(s=this._events))return this; - if(!s.removeListener)return 0===arguments.length?(this._events=new Kat,this._eventsCount=0):s[t]&&(0==--this._eventsCount?this._events=new Kat:delete s[t]),this; - if(0===arguments.length){ - for(var e,n=Object.keys(s),h=0; - h<n.length; - ++h)"removeListener"!==(e=n[h])&&this.removeAllListeners(e); - return this.removeAllListeners("removeListener"),this._events=new Kat,this._eventsCount=0,this} - if("function"==typeof(i=s[t]))this.removeListener(t,i); - else if(i)do{ - this.removeListener(t,i[i.length-1])} - while(i[0]); - return this} - ,zat.prototype.listeners=function(t){ - var i,s,e=this._events; - return s=e&&(i=e[t])?"function"==typeof i?[i.listener||i]:function(t){ - for(var i=new Array(t.length),s=0; - s<i.length; - ++s)i[s]=t[s].listener||t[s]; - return i} - (i):[],s} - ,zat.listenerCount=function(t,i){ - return"function"==typeof t.listenerCount?t.listenerCount(i):Jat.call(t,i)} - ,zat.prototype.listenerCount=Jat,zat.prototype.eventNames=function(){ - return this._eventsCount>0?Reflect.ownKeys(this._events):[]} - ; - var Zat=Wtt(Object.freeze({ - __proto__:null,EventEmitter:zat,default:zat} - )); - Object.defineProperty(jat,"__esModule",{ - value:!0} - ); - const tct=Zat; - function ict(t,i,s){ - try{ - Reflect.apply(t,i,s)} - catch(e){ - setTimeout(()=>{ - throw e} - )} - } - Qt(ict,"uc"); - let sct=(ut=class extends tct.EventEmitter{ - emit(t,...i){ - let s="error"===t; - const e=this._events; - if(void 0!==e)s=s&&void 0===e.error; - else if(!s)return!1; - if(s){ - let t; - if(i.length>0&&([t]=i),t instanceof Error)throw t; - const s=new Error("Unhandled error."+(t?` (${ - t.message} - )`:"")); - throw s.context=t,s} - const n=e[t]; - if(void 0===n)return!1; - if("function"==typeof n)ict(n,this,i); - else{ - const t=n.length,s=function(t){ - const i=t.length,s=new Array(i); - for(let e=0; - e<i; - e+=1)s[e]=t[e]; - return s} - (n); - for(let e=0; - e<t; - e+=1)ict(s[e],this,i)} - return!0} - } - ,Qt(ut,"hc"),ut); - var ect,nct,hct,rct,oct,act,cct,lct,uct,dct,fct,pct,wct,gct,mct,vct,_ct,Mct,bct,yct=jat.default=sct,Ect=(dt=class extends yct{ - constructor({ - notificationHandler:t} - ={ - } - ){ - super(),tot(this,rct),tot(this,act),tot(this,lct),tot(this,ect,!1),tot(this,nct,void 0),tot(this,hct,void 0),iot(this,nct,[]),iot(this,hct,t)} - destroy(){ - Zrt(this,nct).forEach(t=>{ - "destroy"in t&&"function"==typeof t.destroy&&t.destroy()} - ),iot(this,nct,[]),iot(this,ect,!0)} - push(t){ - sot(this,rct,oct).call(this),Zrt(this,nct).push(t)} - handle(t,i){ - if(sot(this,rct,oct).call(this),i&&"function"!=typeof i)throw new Error('"callback" must be a function if provided.'); - return Array.isArray(t)?i?sot(this,act,cct).call(this,t,i):sot(this,act,cct).call(this,t):i?sot(this,lct,uct).call(this,t,i):this._promiseHandle(t)} - asMiddleware(){ - return sot(this,rct,oct).call(this),async(t,i,s,e)=>{ - var n,h; - try{ - const[r,o,a]=await sot(n=dt,pct,wct).call(n,t,i,Zrt(this,nct)); - return o?(await sot(h=dt,vct,_ct).call(h,a),e(r)):s(async t=>{ - var i; - try{ - await sot(i=dt,vct,_ct).call(i,a)} - catch(frt){ - return t(frt)} - return t()} - )} - catch(frt){ - return e(frt)} - } - } - async _promiseHandle(t){ - return new Promise((i,s)=>{ - sot(this,lct,uct).call(this,t,(t,e)=>{ - t&&void 0===e?s(t):i(e)} - ).catch(s)} - )} - } - ,Qt(dt,"e"),dt); - ect=new WeakMap,nct=new WeakMap,hct=new WeakMap,rct=new WeakSet,oct=Qt(function(){ - if(Zrt(this,ect))throw new Error("This engine is destroyed and can no longer be used.")} - ,"yc"),act=new WeakSet,cct=Qt(async function(t,i){ - try{ - if(0===t.length){ - const t=[{ - id:null,jsonrpc:"2.0",error:new $at(eot,"Request batch must contain plain objects. Received an empty array")} - ]; - return i?i(null,t):t} - const s=(await Promise.all(t.map(this._promiseHandle.bind(this)))).filter(t=>void 0!==t); - return i?i(null,s):s} - catch(s){ - if(i)return i(s); - throw s} - } - ,"bc"),lct=new WeakSet,uct=Qt(async function(t,i){ - var s; - if(!t||Array.isArray(t)||"object"!=typeof t){ - const s=new $at(eot,"Requests must be plain objects. Received: "+typeof t,{ - request:t} - ); - return i(s,{ - id:null,jsonrpc:"2.0",error:s} - )} - if("string"!=typeof t.method){ - const s=new $at(eot,"Must specify a string method. Received: "+typeof t.method,{ - request:t} - ); - return Zrt(this,hct)&&!_at(t)?i(null):i(s,{ - id:t.id??null,jsonrpc:"2.0",error:s} - )} - if(Zrt(this,hct)&&_ot(t,vat)&&!_at(t)){ - try{ - await Zrt(this,hct).call(this,t)} - catch(r){ - return i(r)} - return i(null)} - let e=null; - const n={ - ...t} - ,h={ - id:n.id,jsonrpc:n.jsonrpc} - ; - try{ - await sot(s=Ect,dct,fct).call(s,n,h,Zrt(this,nct))} - catch(r){ - e=r} - return e&&(delete h.result,h.error||(h.error=Aat(e))),i(e,h)} - ,"Ec"),dct=new WeakSet,fct=Qt(async function(t,i,s){ - var e,n,h; - const[r,o,a]=await sot(e=Ect,pct,wct).call(e,t,i,s); - if(sot(n=Ect,Mct,bct).call(n,t,i,o),await sot(h=Ect,vct,_ct).call(h,a),r)throw r} - ,"_c$1"),pct=new WeakSet,wct=Qt(async function(t,i,s){ - var e; - const n=[]; - let h=null,r=!1; - for(const o of s)if([h,r]=await sot(e=Ect,gct,mct).call(e,t,i,o,n),r)break; - return[h,r,n.reverse()]} - ,"kc"),gct=new WeakSet,mct=Qt(async function(t,i,s,e){ - return new Promise(n=>{ - const h=Qt(t=>{ - const s=t||i.error; - s&&(i.error=Aat(s)),n([s,!0])} - ,"o"),r=Qt(s=>{ - i.error?h(i.error):(s&&("function"!=typeof s&&h(new $at(not,`JsonRpcEngine: "next" return handlers must be functions. Received "${ - typeof s} - " for request:\n${ - Sct(t)} - `,{ - request:t} - )),e.push(s)),n([null,!1]))} - ,"s"); - try{ - s(t,i,r,h)} - catch(o){ - h(o)} - } - )} - ,"xc"),vct=new WeakSet,_ct=Qt(async function(t){ - for(const i of t)await new Promise((t,s)=>{ - i(i=>i?s(i):t())} - )} - ,"Ic"),Mct=new WeakSet,bct=Qt(function(t,i,s){ - if(!oot(i,"result")&&!oot(i,"error"))throw new $at(not,`JsonRpcEngine: Response has no error or result for request:\n${ - Sct(t)} - `,{ - request:t} - ); - if(!s)throw new $at(not,`JsonRpcEngine: Nothing ended request:\n${ - Sct(t)} - `,{ - request:t} - )} - ,"Rc"),tot(Ect,dct),tot(Ect,pct),tot(Ect,gct),tot(Ect,vct),tot(Ect,Mct); - var Act=Ect; - function Sct(t){ - return JSON.stringify(t,null,2)} - Qt(Sct,"Lc"); - var Tct=Object.freeze(["eth_subscription"]),Cct=Qt((t=console)=>[Jrt(),Oct(t),Yrt(t)],"$c"); - function Oct(t){ - return(i,s,e)=>{ - "string"==typeof i.method&&i.method||(s.error=Wat({ - message:"The request 'method' must be a non-empty string.",data:i} - )),e(i=>{ - const{ - error:e} - =s; - return e?(t.error(`MetaMask - RPC Error: ${ - e.message} - `,e),i()):i()} - )} - } - Qt(Oct,"Bc"); - var Ict=Qt((t,i,s=!0)=>(e,n)=>{ - e||n.error?i(e||n.error):!s||Array.isArray(n)?t(n):t(n.result)} - ,"Kc"),kct=Qt(t=>Boolean(t)&&"string"==typeof t&&t.startsWith("0x"),"jc"),xct=Qt(()=>{ - } - ,"Uc"); - async function Rct(t,i){ - try{ - const i=await async function(){ - return{ - name:Pct(window),icon:await Nct(window)} - } - (); - t.handle({ - jsonrpc:"2.0",id:1,method:"metamask_sendDomainMetadata",params:i} - ,xct)} - catch(s){ - i.error({ - message:zrt.errors.sendSiteMetadata(),originalError:s} - )} - } - function Pct(t){ - const{ - document:i} - =t,s=i.querySelector('head > meta[property="og:site_name"]'); - if(s)return s.content; - const e=i.querySelector('head > meta[name="title"]'); - return e?e.content:i.title&&i.title.length>0?i.title:window.location.hostname} - async function Nct(t){ - const{ - document:i} - =t,s=i.querySelectorAll('head > link[rel~="icon"]'); - for(const e of Array.from(s))if(e&&await Lct(e.href))return e.href; - return null} - async function Lct(t){ - return new Promise((i,s)=>{ - try{ - const s=document.createElement("img"); - s.onload=()=>i(!0),s.onerror=()=>i(!1),s.src=t} - catch(e){ - s(e)} - } - )} - Qt(Rct,"Hc"),Qt(Pct,"Fc"),Qt(Nct,"zc"),Qt(Lct,"qc"); - var Dct=Qt((t,i,s)=>{ - if(!i.has(t))throw TypeError("Cannot "+s)} - ,"Wc"),Gct=Qt((t,i,s)=>(Dct(t,i,"read from private field"),s?s.call(t):i.get(t)),"Vc"),Bct=Qt((t,i,s)=>{ - if(i.has(t))throw TypeError("Cannot add the same private member more than once"); - i instanceof WeakSet?i.add(t):i.set(t,s)} - ,"Gc"),Uct=Qt((t,i,s,e)=>(Dct(t,i,"write to private field"),i.set(t,s),s),"Yc"); - function Fct(t,i,s){ - try{ - Reflect.apply(t,i,s)} - catch(e){ - setTimeout(()=>{ - throw e} - )} - } - Qt(Fct,"Zc"); - const $ct=class extends zat{ - emit(t,...i){ - let s="error"===t; - const e=this._events; - if(void 0!==e)s=s&&void 0===e.error; - else if(!s)return!1; - if(s){ - let t; - if(i.length>0&&([t]=i),t instanceof Error)throw t; - const s=new Error("Unhandled error."+(t?` (${ - t.message} - )`:"")); - throw s.context=t,s} - const n=e[t]; - if(void 0===n)return!1; - if("function"==typeof n)Fct(n,this,i); - else{ - const t=n.length,s=function(t){ - const i=t.length,s=new Array(i); - for(let e=0; - e<i; - e+=1)s[e]=t[e]; - return s} - (n); - for(let e=0; - e<t; - e+=1)Fct(s[e],this,i)} - return!0} - } - ; - Qt($ct,"Jc"); - let Hct=$ct; - var Wct,Vct,jct=Qt(function t(i,s){ - if(i===s)return!0; - if(i&&s&&"object"==typeof i&&"object"==typeof s){ - if(i.constructor!==s.constructor)return!1; - var e,n,h; - if(Array.isArray(i)){ - if((e=i.length)!=s.length)return!1; - for(n=e; - 0!=n--; - )if(!t(i[n],s[n]))return!1; - return!0} - if(i.constructor===RegExp)return i.source===s.source&&i.flags===s.flags; - if(i.valueOf!==Object.prototype.valueOf)return i.valueOf()===s.valueOf(); - if(i.toString!==Object.prototype.toString)return i.toString()===s.toString(); - if((e=(h=Object.keys(i)).length)!==Object.keys(s).length)return!1; - for(n=e; - 0!=n--; - )if(!Object.prototype.hasOwnProperty.call(s,h[n]))return!1; - for(n=e; - 0!=n--; - ){ - var r=h[n]; - if(!t(i[r],s[r]))return!1} - return!0} - return i!=i&&s!=s} - ,"e"),Kct=Htt(jct),zct=(ft=class extends Hct{ - constructor({ - logger:t=console,maxEventListeners:i=100,rpcMiddleware:s=[]} - ={ - } - ){ - super(),Bct(this,Wct,void 0),Bct(this,Vct,void 0),this._log=t,this.setMaxListeners(i),this._state={ - ...ft._defaultState} - ,Uct(this,Vct,null),Uct(this,Wct,null),this._handleAccountsChanged=this._handleAccountsChanged.bind(this),this._handleConnect=this._handleConnect.bind(this),this._handleChainChanged=this._handleChainChanged.bind(this),this._handleDisconnect=this._handleDisconnect.bind(this),this._handleUnlockStateChanged=this._handleUnlockStateChanged.bind(this),this._rpcRequest=this._rpcRequest.bind(this),this.request=this.request.bind(this); - const e=new Act; - s.forEach(t=>e.push(t)),this._rpcEngine=e} - get chainId(){ - return Gct(this,Wct)} - get selectedAddress(){ - return Gct(this,Vct)} - isConnected(){ - return this._state.isConnected} - async request(t){ - if(!t||"object"!=typeof t||Array.isArray(t))throw Wat({ - message:zrt.errors.invalidRequestArgs(),data:t} - ); - const{ - method:i,params:s} - =t; - if("string"!=typeof i||0===i.length)throw Wat({ - message:zrt.errors.invalidRequestMethod(),data:t} - ); - if(void 0!==s&&!Array.isArray(s)&&("object"!=typeof s||null===s))throw Wat({ - message:zrt.errors.invalidRequestParams(),data:t} - ); - const e=null==s?{ - method:i} - :{ - method:i,params:s} - ; - return new Promise((t,i)=>{ - this._rpcRequest(e,Ict(t,i))} - )} - _initializeState(t){ - if(this._state.initialized)throw new Error("Provider already initialized."); - if(t){ - const{ - accounts:i,chainId:s,isUnlocked:e,networkVersion:n} - =t; - this._handleConnect(s),this._handleChainChanged({ - chainId:s,networkVersion:n} - ),this._handleUnlockStateChanged({ - accounts:i,isUnlocked:e} - ),this._handleAccountsChanged(i)} - this._state.initialized=!0,this.emit("_initialized")} - _rpcRequest(t,i){ - let s=i; - return Array.isArray(t)||(t.jsonrpc||(t.jsonrpc="2.0"),"eth_accounts"!==t.method&&"eth_requestAccounts"!==t.method||(s=Qt((s,e)=>{ - this._handleAccountsChanged(e.result??[],"eth_accounts"===t.method),i(s,e)} - ,"n"))),this._rpcEngine.handle(t,s)} - _handleConnect(t){ - this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{ - chainId:t} - ),this._log.debug(zrt.info.connected(t)))} - _handleDisconnect(t,i){ - if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!t){ - let s; - this._state.isConnected=!1,t?(s=new $at(1013,i??zrt.errors.disconnected()),this._log.debug(s)):(s=new $at(1011,i??zrt.errors.permanentlyDisconnected()),this._log.error(s),Uct(this,Wct,null),this._state.accounts=null,Uct(this,Vct,null),this._state.isUnlocked=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",s)} - } - _handleChainChanged({ - chainId:t} - ={ - } - ){ - kct(t)?(this._handleConnect(t),t!==Gct(this,Wct)&&(Uct(this,Wct,t),this._state.initialized&&this.emit("chainChanged",Gct(this,Wct)))):this._log.error(zrt.errors.invalidNetworkParams(),{ - chainId:t} - )} - _handleAccountsChanged(t,i=!1){ - let s=t; - Array.isArray(t)||(this._log.error("MetaMask: Received invalid accounts parameter. Please report this bug.",t),s=[]); - for(const e of t)if("string"!=typeof e){ - this._log.error("MetaMask: Received non-string account. Please report this bug.",t),s=[]; - break} - if(!Kct(this._state.accounts,s)&&(i&&null!==this._state.accounts&&this._log.error("MetaMask: 'eth_accounts' unexpectedly updated accounts. Please report this bug.",s),this._state.accounts=s,Gct(this,Vct)!==s[0]&&Uct(this,Vct,s[0]||null),this._state.initialized)){ - const t=[...s]; - this.emit("accountsChanged",t)} - } - _handleUnlockStateChanged({ - accounts:t,isUnlocked:i} - ={ - } - ){ - "boolean"==typeof i?i!==this._state.isUnlocked&&(this._state.isUnlocked=i,this._handleAccountsChanged(t??[])):this._log.error("MetaMask: Received invalid isUnlocked parameter. Please report this bug.")} - } - ,Qt(ft,"e"),ft); - Wct=new WeakMap,Vct=new WeakMap,zct._defaultState={ - accounts:null,isConnected:!1,isUnlocked:!1,initialized:!1,isPermanentlyDisconnected:!1} - ; - var Yct,qct=zct,Xct={ - exports:{ - } - } - ,Jct=Zat.EventEmitter,Qct=Wtt(Ftt); - Yct="function"==typeof Object.create?function(t,i){ - t.super_=i,t.prototype=Object.create(i.prototype,{ - constructor:{ - value:t,enumerable:!1,writable:!0,configurable:!0} - } - )} - :function(t,i){ - t.super_=i; - var s=Qt(function(){ - } - ,"n"); - s.prototype=i.prototype,t.prototype=new s,t.prototype.constructor=t} - ; - var Zct=Object.getOwnPropertyDescriptors||function(t){ - for(var i=Object.keys(t),s={ - } - ,e=0; - e<i.length; - e++)s[i[e]]=Object.getOwnPropertyDescriptor(t,i[e]); - return s} - ,tlt=/%[sdj%]/g; - function ilt(t){ - if(!mlt(t)){ - for(var i=[],s=0; - s<arguments.length; - s++)i.push(rlt(arguments[s])); - return i.join(" ")} - s=1; - for(var e=arguments,n=e.length,h=String(t).replace(tlt,function(t){ - if("%%"===t)return"%"; - if(s>=n)return t; - switch(t){ - case"%s":return String(e[s++]); - case"%d":return Number(e[s++]); - case"%j":try{ - return JSON.stringify(e[s++])} - catch(i){ - return"[Circular]"} - default:return t} - } - ),r=e[s]; - s<n; - r=e[++s])plt(r)||!blt(r)?h+=" "+r:h+=" "+rlt(r); - return h} - function slt(t,i){ - if(_lt(F9.process))return function(){ - return slt(t,i).apply(this,arguments)} - ; - if(!0===eat.noDeprecation)return t; - var s=!1; - return function(){ - if(!s){ - if(eat.throwDeprecation)throw new Error(i); - eat.traceDeprecation,s=!0} - return t.apply(this,arguments)} - } - Qt(ilt,"dl"),Qt(slt,"ul"); - var elt,nlt={ - } - ; - function hlt(t){ - return _lt(elt)&&(elt=eat.env.NODE_DEBUG||""),t=t.toUpperCase(),nlt[t]||(new RegExp("\\b"+t+"\\b","i").test(elt)?nlt[t]=function(){ - ilt.apply(null,arguments)} - :nlt[t]=function(){ - } - ),nlt[t]} - function rlt(t,i){ - var s={ - seen:[],stylize:alt} - ; - return arguments.length>=3&&(s.depth=arguments[2]),arguments.length>=4&&(s.colors=arguments[3]),flt(i)?s.showHidden=i:i&&Ilt(s,i),_lt(s.showHidden)&&(s.showHidden=!1),_lt(s.depth)&&(s.depth=2),_lt(s.colors)&&(s.colors=!1),_lt(s.customInspect)&&(s.customInspect=!0),s.colors&&(s.stylize=olt),clt(s,t,s.depth)} - function olt(t,i){ - var s=rlt.styles[i]; - return s?"["+rlt.colors[s][0]+"m"+t+"["+rlt.colors[s][1]+"m":t} - function alt(t,i){ - return t} - function clt(t,i,s){ - if(t.customInspect&&i&&Alt(i.inspect)&&i.inspect!==rlt&&(!i.constructor||i.constructor.prototype!==i)){ - var e=i.inspect(s,t); - return mlt(e)||(e=clt(t,e,s)),e} - var n=function(t,i){ - if(_lt(i))return t.stylize("undefined","undefined"); - if(mlt(i)){ - var s="'"+JSON.stringify(i).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'"; - return t.stylize(s,"string")} - return glt(i)?t.stylize(""+i,"number"):flt(i)?t.stylize(""+i,"boolean"):plt(i)?t.stylize("null","null"):void 0} - (t,i); - if(n)return n; - var h,r=Object.keys(i),o=(h={ - } - ,r.forEach(function(t,i){ - h[t]=!0} - ),h); - if(t.showHidden&&(r=Object.getOwnPropertyNames(i)),Elt(i)&&(r.indexOf("message")>=0||r.indexOf("description")>=0))return llt(i); - if(0===r.length){ - if(Alt(i)){ - var a=i.name?": "+i.name:""; - return t.stylize("[Function"+a+"]","special")} - if(Mlt(i))return t.stylize(RegExp.prototype.toString.call(i),"regexp"); - if(ylt(i))return t.stylize(Date.prototype.toString.call(i),"date"); - if(Elt(i))return llt(i)} - var c,l="",u=!1,d=["{ - ","} - "]; - return dlt(i)&&(u=!0,d=["[","]"]),Alt(i)&&(l=" [Function"+(i.name?": "+i.name:"")+"]"),Mlt(i)&&(l=" "+RegExp.prototype.toString.call(i)),ylt(i)&&(l=" "+Date.prototype.toUTCString.call(i)),Elt(i)&&(l=" "+llt(i)),0!==r.length||u&&0!=i.length?s<0?Mlt(i)?t.stylize(RegExp.prototype.toString.call(i),"regexp"):t.stylize("[Object]","special"):(t.seen.push(i),c=u?function(t,i,s,e,n){ - for(var h=[],r=0,o=i.length; - r<o; - ++r)klt(i,String(r))?h.push(ult(t,i,s,e,String(r),!0)):h.push(""); - return n.forEach(function(n){ - n.match(/^\d+$/)||h.push(ult(t,i,s,e,n,!0))} - ),h} - (t,i,s,o,r):r.map(function(e){ - return ult(t,i,s,o,e,u)} - ),t.seen.pop(),function(t,i,s){ - return t.reduce(function(t,i){ - return i.indexOf("\n"),t+i.replace(/\u001b\[\d\d?m/g,"").length+1} - ,0)>60?s[0]+(""===i?"":i+"\n ")+" "+t.join(",\n ")+" "+s[1]:s[0]+i+" "+t.join(", ")+" "+s[1]} - (c,l,d)):d[0]+l+d[1]} - function llt(t){ - return"["+Error.prototype.toString.call(t)+"]"} - function ult(t,i,s,e,n,h){ - var r,o,a; - if((a=Object.getOwnPropertyDescriptor(i,n)||{ - value:i[n]} - ).get?o=a.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):a.set&&(o=t.stylize("[Setter]","special")),klt(e,n)||(r="["+n+"]"),o||(t.seen.indexOf(a.value)<0?(o=plt(s)?clt(t,a.value,null):clt(t,a.value,s-1)).indexOf("\n")>-1&&(o=h?o.split("\n").map(function(t){ - return" "+t} - ).join("\n").substr(2):"\n"+o.split("\n").map(function(t){ - return" "+t} - ).join("\n")):o=t.stylize("[Circular]","special")),_lt(r)){ - if(h&&n.match(/^\d+$/))return o; - (r=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(r=r.substr(1,r.length-2),r=t.stylize(r,"name")):(r=r.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),r=t.stylize(r,"string"))} - return r+": "+o} - function dlt(t){ - return Array.isArray(t)} - function flt(t){ - return"boolean"==typeof t} - function plt(t){ - return null===t} - function wlt(t){ - return null==t} - function glt(t){ - return"number"==typeof t} - function mlt(t){ - return"string"==typeof t} - function vlt(t){ - return"symbol"==typeof t} - function _lt(t){ - return void 0===t} - function Mlt(t){ - return blt(t)&&"[object RegExp]"===Clt(t)} - function blt(t){ - return"object"==typeof t&&null!==t} - function ylt(t){ - return blt(t)&&"[object Date]"===Clt(t)} - function Elt(t){ - return blt(t)&&("[object Error]"===Clt(t)||t instanceof Error)} - function Alt(t){ - return"function"==typeof t} - function Slt(t){ - return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t} - function Tlt(t){ - return itt.isBuffer(t)} - function Clt(t){ - return Object.prototype.toString.call(t)} - function Olt(){ - } - function Ilt(t,i){ - if(!i||!blt(i))return t; - for(var s=Object.keys(i),e=s.length; - e--; - )t[s[e]]=i[s[e]]; - return t} - function klt(t,i){ - return Object.prototype.hasOwnProperty.call(t,i)} - Qt(hlt,"pl"),Qt(rlt,"gl"),Qt(olt,"ml"),Qt(alt,"yl"),Qt(clt,"vl"),Qt(llt,"bl"),Qt(ult,"wl"),Qt(dlt,"El"),Qt(flt,"Sl"),Qt(plt,"_l"),Qt(wlt,"Cl"),Qt(glt,"kl"),Qt(mlt,"Al"),Qt(vlt,"xl"),Qt(_lt,"Ml"),Qt(Mlt,"Il"),Qt(blt,"Tl"),Qt(ylt,"Rl"),Qt(Elt,"Pl"),Qt(Alt,"Ol"),Qt(Slt,"Nl"),Qt(Tlt,"Ll"),Qt(Clt,"Dl"),Qt(function(t){ - return t<10?"0"+t.toString(10):t.toString(10)} - ,"$l"),rlt.colors={ - bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]} - ,rlt.styles={ - special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"} - ,Qt(Olt,"Kl"),Qt(Ilt,"jl"),Qt(klt,"Ul"); - var xlt="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0; - function Rlt(t){ - if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function'); - if(xlt&&t[xlt]){ - var i; - if("function"!=typeof(i=t[xlt]))throw new TypeError('The "util.promisify.custom" argument must be of type Function'); - return Object.defineProperty(i,xlt,{ - value:i,enumerable:!1,writable:!1,configurable:!0} - ),i} - function i(){ - for(var i,s,e=new Promise(function(t,e){ - i=t,s=e} - ),n=[],h=0; - h<arguments.length; - h++)n.push(arguments[h]); - n.push(function(t,e){ - t?s(t):i(e)} - ); - try{ - t.apply(this,n)} - catch(r){ - s(r)} - return e} - return Qt(i,"t"),Object.setPrototypeOf(i,Object.getPrototypeOf(t)),xlt&&Object.defineProperty(i,xlt,{ - value:i,enumerable:!1,writable:!1,configurable:!0} - ),Object.defineProperties(i,Zct(t))} - function Plt(t,i){ - if(!t){ - var s=new Error("Promise was rejected with a falsy value"); - s.reason=t,t=s} - return i(t)} - function Nlt(t){ - if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function'); - function i(){ - for(var i=[],s=0; - s<arguments.length; - s++)i.push(arguments[s]); - var e=i.pop(); - if("function"!=typeof e)throw new TypeError("The last argument must be of type Function"); - var n=this,h=Qt(function(){ - return e.apply(n,arguments)} - ,"o"); - t.apply(this,i).then(function(t){ - eat.nextTick(h.bind(null,null,t))} - ,function(t){ - eat.nextTick(Plt.bind(null,t,h))} - )} - return Qt(i,"t"),Object.setPrototypeOf(i,Object.getPrototypeOf(t)),Object.defineProperties(i,Zct(t)),i} - Qt(Rlt,"Fl"),Qt(Plt,"zl"),Qt(Nlt,"ql"),Rlt.custom=xlt; - var Llt,Dlt,Glt={ - inherits:Yct,_extend:Ilt,log:Olt,isBuffer:Tlt,isPrimitive:Slt,isFunction:Alt,isError:Elt,isDate:ylt,isObject:blt,isRegExp:Mlt,isUndefined:_lt,isSymbol:vlt,isString:mlt,isNumber:glt,isNullOrUndefined:wlt,isNull:plt,isBoolean:flt,isArray:dlt,inspect:rlt,deprecate:slt,format:ilt,debuglog:hlt,promisify:Rlt,callbackify:Nlt} - ,Blt=Wtt(Object.freeze({ - __proto__:null,_extend:Ilt,callbackify:Nlt,debuglog:hlt,default:Glt,deprecate:slt,format:ilt,inherits:Yct,inspect:rlt,isArray:dlt,isBoolean:flt,isBuffer:Tlt,isDate:ylt,isError:Elt,isFunction:Alt,isNull:plt,isNullOrUndefined:wlt,isNumber:glt,isObject:blt,isPrimitive:Slt,isRegExp:Mlt,isString:mlt,isSymbol:vlt,isUndefined:_lt,log:Olt,promisify:Rlt} - )); - function Ult(){ - if(Dlt)return Llt; - function t(t,i){ - var s=Object.keys(t); - if(Object.getOwnPropertySymbols){ - var e=Object.getOwnPropertySymbols(t); - i&&(e=e.filter(function(i){ - return Object.getOwnPropertyDescriptor(t,i).enumerable} - )),s.push.apply(s,e)} - return s} - function i(i){ - for(var e=1; - e<arguments.length; - e++){ - var n=null!=arguments[e]?arguments[e]:{ - } - ; - e%2?t(Object(n),!0).forEach(function(t){ - s(i,t,n[t])} - ):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach(function(t){ - Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(n,t))} - )} - return i} - function s(t,i,s){ - return(i=n(i))in t?Object.defineProperty(t,i,{ - value:s,enumerable:!0,configurable:!0,writable:!0} - ):t[i]=s,t} - function e(t,i,s){ - return i&&function(t,i){ - for(var s=0; - s<i.length; - s++){ - var e=i[s]; - e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,n(e.key),e)} - } - (t.prototype,i),Object.defineProperty(t,"prototype",{ - writable:!1} - ),t} - function n(t){ - var i=function(t){ - if("object"!=typeof t||null===t)return t; - var i=t[Symbol.toPrimitive]; - if(void 0!==i){ - var s=i.call(t,"string"); - if("object"!=typeof s)return s; - throw new TypeError("@@toPrimitive must return a primitive value.")} - return String(t)} - (t); - return"symbol"==typeof i?i:String(i)} - Qt(t,"e"),Qt(i,"t"),Qt(s,"n"),Qt(e,"r"),Qt(n,"i"),Dlt=1; - var h=Qct.Buffer,r=Blt.inspect,o=r&&r.custom||"inspect"; - return Llt=function(){ - function t(){ - !function(t,i){ - if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")} - (this,t),this.head=null,this.tail=null,this.length=0} - return Qt(t,"e"),e(t,[{ - key:"push",value:Qt(function(t){ - var i={ - data:t,next:null} - ; - this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length} - ,"value")} - ,{ - key:"unshift",value:Qt(function(t){ - var i={ - data:t,next:this.head} - ; - 0===this.length&&(this.tail=i),this.head=i,++this.length} - ,"value")} - ,{ - key:"shift",value:Qt(function(){ - if(0!==this.length){ - var t=this.head.data; - return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t} - } - ,"value")} - ,{ - key:"clear",value:Qt(function(){ - this.head=this.tail=null,this.length=0} - ,"value")} - ,{ - key:"join",value:Qt(function(t){ - if(0===this.length)return""; - for(var i=this.head,s=""+i.data; - i=i.next; - )s+=t+i.data; - return s} - ,"value")} - ,{ - key:"concat",value:Qt(function(t){ - if(0===this.length)return h.alloc(0); - for(var i,s,e,n=h.allocUnsafe(t>>>0),r=this.head,o=0; - r; - )i=r.data,s=n,e=o,h.prototype.copy.call(i,s,e),o+=r.data.length,r=r.next; - return n} - ,"value")} - ,{ - key:"consume",value:Qt(function(t,i){ - var s; - return t<this.head.data.length?(s=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):s=t===this.head.data.length?this.shift():i?this._getString(t):this._getBuffer(t),s} - ,"value")} - ,{ - key:"first",value:Qt(function(){ - return this.head.data} - ,"value")} - ,{ - key:"_getString",value:Qt(function(t){ - var i=this.head,s=1,e=i.data; - for(t-=e.length; - i=i.next; - ){ - var n=i.data,h=t>n.length?n.length:t; - if(h===n.length?e+=n:e+=n.slice(0,t),0===(t-=h)){ - h===n.length?(++s,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=n.slice(h)); - break} - ++s} - return this.length-=s,e} - ,"value")} - ,{ - key:"_getBuffer",value:Qt(function(t){ - var i=h.allocUnsafe(t),s=this.head,e=1; - for(s.data.copy(i),t-=s.data.length; - s=s.next; - ){ - var n=s.data,r=t>n.length?n.length:t; - if(n.copy(i,i.length-t,0,r),0===(t-=r)){ - r===n.length?(++e,s.next?this.head=s.next:this.head=this.tail=null):(this.head=s,s.data=n.slice(r)); - break} - ++e} - return this.length-=e,i} - ,"value")} - ,{ - key:o,value:Qt(function(t,s){ - return r(this,i(i({ - } - ,s),{ - } - ,{ - depth:0,customInspect:!1} - ))} - ,"value")} - ]),t} - (),Llt} - function Flt(t,i){ - Hlt(t,i),$lt(t)} - function $lt(t){ - t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")} - function Hlt(t,i){ - t.emit("error",i)} - Qt(Ult,"Zl"),Qt(Flt,"Jl"),Qt($lt,"Ql"),Qt(Hlt,"Xl"); - var Wlt={ - destroy:Qt(function(t,i){ - var s=this,e=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed; - return e||n?(i?i(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,eat.nextTick(Hlt,this,t)):eat.nextTick(Hlt,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){ - !i&&t?s._writableState?s._writableState.errorEmitted?eat.nextTick($lt,s):(s._writableState.errorEmitted=!0,eat.nextTick(Flt,s,t)):eat.nextTick(Flt,s,t):i?(eat.nextTick($lt,s),i(t)):eat.nextTick($lt,s)} - ),this)} - ,"destroy"),undestroy:Qt(function(){ - this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)} - ,"undestroy"),errorOrDestroy:Qt(function(t,i){ - var s=t._readableState,e=t._writableState; - s&&s.autoDestroy||e&&e.autoDestroy?t.destroy(i):t.emit("error",i)} - ,"errorOrDestroy")} - ,Vlt={ - } - ,jlt={ - } - ; - function Klt(t,i,s){ - s||(s=Error); - var e=function(t){ - var s,e; - function n(s,e,n){ - return t.call(this,"string"==typeof i?i:i(s,e,n))||this} - return Qt(n,"i"),e=t,(s=n).prototype=Object.create(e.prototype),s.prototype.constructor=s,s.__proto__=e,n} - (s); - e.prototype.name=s.name,e.prototype.code=t,jlt[t]=e} - function zlt(t,i){ - if(Array.isArray(t)){ - var s=t.length; - return t=t.map(function(t){ - return String(t)} - ),s>2?"one of ".concat(i," ").concat(t.slice(0,s-1).join(", "),", or ")+t[s-1]:2===s?"one of ".concat(i," ").concat(t[0]," or ").concat(t[1]):"of ".concat(i," ").concat(t[0])} - return"of ".concat(i," ").concat(String(t))} - Qt(Klt,"rd"),Qt(zlt,"id"),Klt("ERR_INVALID_OPT_VALUE",function(t,i){ - return'The value "'+i+'" is invalid for option "'+t+'"'} - ,TypeError),Klt("ERR_INVALID_ARG_TYPE",function(t,i,s){ - var e,n; - if("string"==typeof i&&"not "===i.substr(0,4)?(e="must not be",i=i.replace(/^not /,"")):e="must be",function(t,i,s){ - return(void 0===s||s>t.length)&&(s=t.length)," argument"===t.substring(s-9,s)} - (t))n="The ".concat(t," ").concat(e," ").concat(zlt(i,"type")); - else{ - var h=function(t,i,s){ - return"number"!=typeof s&&(s=0),!(s+1>t.length)&&-1!==t.indexOf(".",s)} - (t)?"property":"argument"; - n='The "'.concat(t,'" ').concat(h," ").concat(e," ").concat(zlt(i,"type"))} - return n+". Received type ".concat(typeof s)} - ,TypeError),Klt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),Klt("ERR_METHOD_NOT_IMPLEMENTED",function(t){ - return"The "+t+" method is not implemented"} - ),Klt("ERR_STREAM_PREMATURE_CLOSE","Premature close"),Klt("ERR_STREAM_DESTROYED",function(t){ - return"Cannot call "+t+" after a stream was destroyed"} - ),Klt("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),Klt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),Klt("ERR_STREAM_WRITE_AFTER_END","write after end"),Klt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),Klt("ERR_UNKNOWN_ENCODING",function(t){ - return"Unknown encoding: "+t} - ,TypeError),Klt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Vlt.codes=jlt; - var Ylt,qlt,Xlt,Jlt,Qlt=Vlt.codes.ERR_INVALID_OPT_VALUE,Zlt={ - getHighWaterMark:Qt(function(t,i,s,e){ - var n=function(t,i,s){ - return null!=t.highWaterMark?t.highWaterMark:i?t[s]:null} - (i,e,s); - if(null!=n){ - if(!isFinite(n)||Math.floor(n)!==n||n<0)throw new Qlt(e?s:"highWaterMark",n); - return Math.floor(n)} - return t.objectMode?16:16384} - ,"getHighWaterMark")} - ,tut="function"==typeof Object.create?function(t,i){ - t.super_=i,t.prototype=Object.create(i.prototype,{ - constructor:{ - value:t,enumerable:!1,writable:!0,configurable:!0} - } - )} - :function(t,i){ - t.super_=i; - var s=Qt(function(){ - } - ,"n"); - s.prototype=i.prototype,t.prototype=new s,t.prototype.constructor=t} - ,iut=Wtt(Object.freeze({ - __proto__:null,default:tut} - )),sut=Qt(function(t,i){ - if(eut("noDeprecation"))return t; - var s=!1; - return function(){ - if(!s){ - if(eut("throwDeprecation"))throw new Error(i); - eut("traceDeprecation"),s=!0} - return t.apply(this,arguments)} - } - ,"fd"); - function eut(t){ - try{ - if(!$tt.localStorage)return!1} - catch(s){ - return!1} - var i=$tt.localStorage[t]; - return null!=i&&"true"===String(i).toLowerCase()} - function nut(){ - if(qlt)return Ylt; - function t(t){ - var i=this; - this.next=null,this.entry=null,this.finish=function(){ - !function(t,i){ - var s=t.entry; - for(t.entry=null; - s; - ){ - var e=s.callback; - i.pendingcb--,e(void 0),s=s.next} - i.corkedRequestsFree.next=t} - (i,t)} - } - var i; - Qt(t,"e"),qlt=1,Ylt=b,b.WritableState=M; - var s,e={ - deprecate:sut} - ,n=Jct,h=Qct.Buffer,r=(void 0!==$tt?$tt:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{ - } - ).Uint8Array||function(){ - } - ,o=Wlt,a=Zlt.getHighWaterMark,c=Vlt.codes,l=c.ERR_INVALID_ARG_TYPE,u=c.ERR_METHOD_NOT_IMPLEMENTED,d=c.ERR_MULTIPLE_CALLBACK,f=c.ERR_STREAM_CANNOT_PIPE,p=c.ERR_STREAM_DESTROYED,w=c.ERR_STREAM_NULL_VALUES,g=c.ERR_STREAM_WRITE_AFTER_END,m=c.ERR_UNKNOWN_ENCODING,v=o.errorOrDestroy; - function _(){ - } - function M(s,e,n){ - i=i||hut(),s=s||{ - } - ,"boolean"!=typeof n&&(n=e instanceof i),this.objectMode=!!s.objectMode,n&&(this.objectMode=this.objectMode||!!s.writableObjectMode),this.highWaterMark=a(this,s,"writableHighWaterMark",n),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1; - var h=!1===s.decodeStrings; - this.decodeStrings=!h,this.defaultEncoding=s.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){ - !function(t,i){ - var s,e=t._writableState,n=e.sync,h=e.writecb; - if("function"!=typeof h)throw new d; - if((s=e).writing=!1,s.writecb=null,s.length-=s.writelen,s.writelen=0,i)!function(t,i,s,e,n){ - --i.pendingcb,s?(eat.nextTick(n,e),eat.nextTick(C,t,i),t._writableState.errorEmitted=!0,v(t,e)):(n(e),t._writableState.errorEmitted=!0,v(t,e),C(t,i))} - (t,e,n,i,h); - else{ - var r=S(e)||t.destroyed; - r||e.corked||e.bufferProcessing||!e.bufferedRequest||A(t,e),n?eat.nextTick(E,t,e,r,h):E(t,e,r,h)} - } - (e,t)} - ,this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==s.emitClose,this.autoDestroy=!!s.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)} - function b(t){ - var e=this instanceof(i=i||hut()); - if(!e&&!s.call(b,this))return new b(t); - this._writableState=new M(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),n.call(this)} - function y(t,i,s,e,n,h,r){ - i.writelen=e,i.writecb=r,i.writing=!0,i.sync=!0,i.destroyed?i.onwrite(new p("write")):s?t._writev(n,i.onwrite):t._write(n,h,i.onwrite),i.sync=!1} - function E(t,i,s,e){ - var n,h; - s||(n=t,0===(h=i).length&&h.needDrain&&(h.needDrain=!1,n.emit("drain"))),i.pendingcb--,e(),C(t,i)} - function A(i,s){ - s.bufferProcessing=!0; - var e=s.bufferedRequest; - if(i._writev&&e&&e.next){ - var n=s.bufferedRequestCount,h=new Array(n),r=s.corkedRequestsFree; - r.entry=e; - for(var o=0,a=!0; - e; - )h[o]=e,e.isBuf||(a=!1),e=e.next,o+=1; - h.allBuffers=a,y(i,s,!0,s.length,h,"",r.finish),s.pendingcb++,s.lastBufferedRequest=null,r.next?(s.corkedRequestsFree=r.next,r.next=null):s.corkedRequestsFree=new t(s),s.bufferedRequestCount=0} - else{ - for(; - e; - ){ - var c=e.chunk,l=e.encoding,u=e.callback; - if(y(i,s,!1,s.objectMode?1:c.length,c,l,u),e=e.next,s.bufferedRequestCount--,s.writing)break} - null===e&&(s.lastBufferedRequest=null)} - s.bufferedRequest=e,s.bufferProcessing=!1} - function S(t){ - return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing} - function T(t,i){ - t._final(function(s){ - i.pendingcb--,s&&v(t,s),i.prefinished=!0,t.emit("prefinish"),C(t,i)} - )} - function C(t,i){ - var s,e,n=S(i); - if(n&&(s=t,(e=i).prefinished||e.finalCalled||("function"!=typeof s._final||e.destroyed?(e.prefinished=!0,s.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,eat.nextTick(T,s,e))),0===i.pendingcb&&(i.finished=!0,t.emit("finish"),i.autoDestroy))){ - var h=t._readableState; - (!h||h.autoDestroy&&h.endEmitted)&&t.destroy()} - return n} - return Qt(_,"b"),Qt(M,"w"),Qt(b,"E"),Qt(y,"S"),Qt(E,"_"),Qt(A,"C"),Qt(S,"k"),Qt(T,"A"),Qt(C,"x"),iut(b,n),M.prototype.getBuffer=function(){ - for(var t=this.bufferedRequest,i=[]; - t; - )i.push(t),t=t.next; - return i} - ,function(){ - try{ - Object.defineProperty(M.prototype,"buffer",{ - get:e.deprecate(function(){ - return this.getBuffer()} - ,"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")} - )} - catch(t){ - } - } - (),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{ - value:Qt(function(t){ - return!!s.call(this,t)||this===b&&t&&t._writableState instanceof M} - ,"value")} - )):s=Qt(function(t){ - return t instanceof this} - ,"s"),b.prototype.pipe=function(){ - v(this,new f)} - ,b.prototype.write=function(t,i,s){ - var e,n,o=this._writableState,a=!1,c=!o.objectMode&&(e=t,h.isBuffer(e)||e instanceof r); - return c&&!h.isBuffer(t)&&(n=t,t=h.from(n)),"function"==typeof i&&(s=i,i=null),c?i="buffer":i||(i=o.defaultEncoding),"function"!=typeof s&&(s=_),o.ending?function(t,i){ - var s=new g; - v(t,s),eat.nextTick(i,s)} - (this,s):(c||function(t,i,s,e){ - var n; - return null===s?n=new w:"string"==typeof s||i.objectMode||(n=new l("chunk",["string","Buffer"],s)),!n||(v(t,n),eat.nextTick(e,n),!1)} - (this,o,t,s))&&(o.pendingcb++,a=function(t,i,s,e,n,r){ - if(!s){ - var o=(c=e,l=n,(a=i).objectMode||!1===a.decodeStrings||"string"!=typeof c||(c=h.from(c,l)),c); - e!==o&&(s=!0,n="buffer",e=o)} - var a,c,l,u=i.objectMode?1:e.length; - i.length+=u; - var d=i.length<i.highWaterMark; - if(d||(i.needDrain=!0),i.writing||i.corked){ - var f=i.lastBufferedRequest; - i.lastBufferedRequest={ - chunk:e,encoding:n,isBuf:s,callback:r,next:null} - ,f?f.next=i.lastBufferedRequest:i.bufferedRequest=i.lastBufferedRequest,i.bufferedRequestCount+=1} - else y(t,i,!1,u,e,n,r); - return d} - (this,o,c,t,i,s)),a} - ,b.prototype.cork=function(){ - this._writableState.corked++} - ,b.prototype.uncork=function(){ - var t=this._writableState; - t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||A(this,t))} - ,b.prototype.setDefaultEncoding=function(t){ - if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new m(t); - return this._writableState.defaultEncoding=t,this} - ,Object.defineProperty(b.prototype,"writableBuffer",{ - enumerable:!1,get:Qt(function(){ - return this._writableState&&this._writableState.getBuffer()} - ,"get")} - ),Object.defineProperty(b.prototype,"writableHighWaterMark",{ - enumerable:!1,get:Qt(function(){ - return this._writableState.highWaterMark} - ,"get")} - ),b.prototype._write=function(t,i,s){ - s(new u("_write()"))} - ,b.prototype._writev=null,b.prototype.end=function(t,i,s){ - var e,n,h,r=this._writableState; - return"function"==typeof t?(s=t,t=null,i=null):"function"==typeof i&&(s=i,i=null),null!=t&&this.write(t,i),r.corked&&(r.corked=1,this.uncork()),r.ending||(e=this,h=s,(n=r).ending=!0,C(e,n),h&&(n.finished?eat.nextTick(h):e.once("finish",h)),n.ended=!0,e.writable=!1),this} - ,Object.defineProperty(b.prototype,"writableLength",{ - enumerable:!1,get:Qt(function(){ - return this._writableState.length} - ,"get")} - ),Object.defineProperty(b.prototype,"destroyed",{ - enumerable:!1,get:Qt(function(){ - return void 0!==this._writableState&&this._writableState.destroyed} - ,"get"),set:Qt(function(t){ - this._writableState&&(this._writableState.destroyed=t)} - ,"set")} - ),b.prototype.destroy=o.destroy,b.prototype._undestroy=o.undestroy,b.prototype._destroy=function(t,i){ - i(t)} - ,Ylt} - function hut(){ - if(Jlt)return Xlt; - Jlt=1; - var t=Object.keys||function(t){ - var i=[]; - for(var s in t)i.push(s); - return i} - ; - Xlt=r; - var i=yut(),s=nut(); - iut(r,i); - for(var e=t(s.prototype),n=0; - n<e.length; - n++){ - var h=e[n]; - r.prototype[h]||(r.prototype[h]=s.prototype[h])} - function r(t){ - if(!(this instanceof r))return new r(t); - i.call(this,t),s.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",o)))} - function o(){ - this._writableState.ended||eat.nextTick(a,this)} - function a(t){ - t.end()} - return Qt(r,"s"),Qt(o,"a"),Qt(a,"c"),Object.defineProperty(r.prototype,"writableHighWaterMark",{ - enumerable:!1,get:Qt(function(){ - return this._writableState.highWaterMark} - ,"get")} - ),Object.defineProperty(r.prototype,"writableBuffer",{ - enumerable:!1,get:Qt(function(){ - return this._writableState&&this._writableState.getBuffer()} - ,"get")} - ),Object.defineProperty(r.prototype,"writableLength",{ - enumerable:!1,get:Qt(function(){ - return this._writableState.length} - ,"get")} - ),Object.defineProperty(r.prototype,"destroyed",{ - enumerable:!1,get:Qt(function(){ - return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed} - ,"get"),set:Qt(function(t){ - void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)} - ,"set")} - ),Xlt} - Qt(eut,"pd"),Qt(nut,"gd"),Qt(hut,"md"); - var rut=itt.isEncoding||function(t){ - switch(t&&t.toLowerCase()){ - case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0; - default:return!1} - } - ; - function out(t){ - switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),function(t){ - if(t&&!rut(t))throw new Error("Unknown encoding: "+t)} - (t),this.encoding){ - case"utf8":this.surrogateSize=3; - break; - case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=cut; - break; - case"base64":this.surrogateSize=3,this.detectIncompleteChar=lut; - break; - default:return void(this.write=aut)} - this.charBuffer=new itt(6),this.charReceived=0,this.charLength=0} - function aut(t){ - return t.toString(this.encoding)} - function cut(t){ - this.charReceived=t.length%2,this.charLength=this.charReceived?2:0} - function lut(t){ - this.charReceived=t.length%3,this.charLength=this.charReceived?3:0} - Qt(out,"vd"),Qt(aut,"bd"),Qt(cut,"wd"),Qt(lut,"Ed"),out.prototype.write=function(t){ - for(var i=""; - this.charLength; - ){ - var s=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length; - if(t.copy(this.charBuffer,this.charReceived,0,s),this.charReceived+=s,this.charReceived<this.charLength)return""; - if(t=t.slice(s,t.length),!((e=(i=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(i.length-1))>=55296&&e<=56319)){ - if(this.charReceived=this.charLength=0,0===t.length)return i; - break} - this.charLength+=this.surrogateSize,i=""} - this.detectIncompleteChar(t); - var e,n=t.length; - if(this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,n),n-=this.charReceived),n=(i+=t.toString(this.encoding,0,n)).length-1,(e=i.charCodeAt(n))>=55296&&e<=56319){ - var h=this.surrogateSize; - return this.charLength+=h,this.charReceived+=h,this.charBuffer.copy(this.charBuffer,h,0,h),t.copy(this.charBuffer,0,0,h),i.substring(0,n)} - return i} - ,out.prototype.detectIncompleteChar=function(t){ - for(var i=t.length>=3?3:t.length; - i>0; - i--){ - var s=t[t.length-i]; - if(1==i&&s>>5==6){ - this.charLength=2; - break} - if(i<=2&&s>>4==14){ - this.charLength=3; - break} - if(i<=3&&s>>3==30){ - this.charLength=4; - break} - } - this.charReceived=i} - ,out.prototype.end=function(t){ - var i=""; - if(t&&t.length&&(i=this.write(t)),this.charReceived){ - var s=this.charReceived,e=this.charBuffer,n=this.encoding; - i+=e.slice(0,s).toString(n)} - return i} - ; - var uut=Wtt(Object.freeze({ - __proto__:null,StringDecoder:out} - )),dut=Vlt.codes.ERR_STREAM_PREMATURE_CLOSE; - function fut(){ - } - Qt(fut,"Cd"); - var put,wut,gut,mut,vut,_ut,Mut=Qt(function t(i,s,e){ - if("function"==typeof s)return t(i,null,s); - s||(s={ - } - ),e=function(t){ - var i=!1; - return function(){ - if(!i){ - i=!0; - for(var s=arguments.length,e=new Array(s),n=0; - n<s; - n++)e[n]=arguments[n]; - t.apply(this,e)} - } - } - (e||fut); - var n=s.readable||!1!==s.readable&&i.readable,h=s.writable||!1!==s.writable&&i.writable,r=Qt(function(){ - i.writable||a()} - ,"s"),o=i._writableState&&i._writableState.finished,a=Qt(function(){ - h=!1,o=!0,n||e.call(i)} - ,"c"),c=i._readableState&&i._readableState.endEmitted,l=Qt(function(){ - n=!1,c=!0,h||e.call(i)} - ,"d"),u=Qt(function(t){ - e.call(i,t)} - ,"u"),d=Qt(function(){ - var t; - return n&&!c?(i._readableState&&i._readableState.ended||(t=new dut),e.call(i,t)):h&&!o?(i._writableState&&i._writableState.ended||(t=new dut),e.call(i,t)):void 0} - ,"h"),f=Qt(function(){ - i.req.on("finish",a)} - ,"f"); - return function(t){ - return t.setHeader&&"function"==typeof t.abort} - (i)?(i.on("complete",a),i.on("abort",d),i.req?f():i.on("request",f)):h&&!i._writableState&&(i.on("end",r),i.on("close",r)),i.on("end",l),i.on("finish",a),!1!==s.error&&i.on("error",u),i.on("close",d),function(){ - i.removeListener("complete",a),i.removeListener("abort",d),i.removeListener("request",f),i.req&&i.req.removeListener("finish",a),i.removeListener("end",r),i.removeListener("close",r),i.removeListener("finish",a),i.removeListener("end",l),i.removeListener("error",u),i.removeListener("close",d)} - } - ,"e"); - function but(){ - if(wut)return put; - var t; - function i(t,i,s){ - return(i="symbol"==typeof(e=function(t){ - if("object"!=typeof t||null===t)return t; - var i=t[Symbol.toPrimitive]; - if(void 0!==i){ - var s=i.call(t,"string"); - if("object"!=typeof s)return s; - throw new TypeError("@@toPrimitive must return a primitive value.")} - return String(t)} - (i))?e:String(e))in t?Object.defineProperty(t,i,{ - value:s,enumerable:!0,configurable:!0,writable:!0} - ):t[i]=s,t; - var e} - Qt(i,"t"),wut=1; - var s=Mut,e=Symbol("lastResolve"),n=Symbol("lastReject"),h=Symbol("error"),r=Symbol("ended"),o=Symbol("lastPromise"),a=Symbol("handlePromise"),c=Symbol("stream"); - function l(t,i){ - return{ - value:t,done:i} - } - function u(t){ - var i=t[e]; - if(null!==i){ - var s=t[c].read(); - null!==s&&(t[o]=null,t[e]=null,t[n]=null,i(l(s,!1)))} - } - function d(t){ - eat.nextTick(u,t)} - Qt(l,"d"),Qt(u,"u"),Qt(d,"h"); - var f=Object.getPrototypeOf(function(){ - } - ),p=Object.setPrototypeOf((i(t={ - get stream(){ - return this[c]} - ,next:Qt(function(){ - var t=this,i=this[h]; - if(null!==i)return Promise.reject(i); - if(this[r])return Promise.resolve(l(void 0,!0)); - if(this[c].destroyed)return new Promise(function(i,s){ - eat.nextTick(function(){ - t[h]?s(t[h]):i(l(void 0,!0))} - )} - ); - var s,e=this[o]; - if(e)s=new Promise(function(t,i){ - return function(s,e){ - t.then(function(){ - i[r]?s(l(void 0,!0)):i[a](s,e)} - ,e)} - } - (e,this)); - else{ - var n=this[c].read(); - if(null!==n)return Promise.resolve(l(n,!1)); - s=new Promise(this[a])} - return this[o]=s,s} - ,"next")} - ,Symbol.asyncIterator,function(){ - return this} - ),i(t,"return",function(){ - var t=this; - return new Promise(function(i,s){ - t[c].destroy(null,function(t){ - t?s(t):i(l(void 0,!0))} - )} - )} - ),t),f); - return put=Qt(function(t){ - var u,f=Object.create(p,(i(u={ - } - ,c,{ - value:t,writable:!0} - ),i(u,e,{ - value:null,writable:!0} - ),i(u,n,{ - value:null,writable:!0} - ),i(u,h,{ - value:null,writable:!0} - ),i(u,r,{ - value:t._readableState.endEmitted,writable:!0} - ),i(u,a,{ - value:Qt(function(t,i){ - var s=f[c].read(); - s?(f[o]=null,f[e]=null,f[n]=null,t(l(s,!1))):(f[e]=t,f[n]=i)} - ,"value"),writable:!0} - ),u)); - return f[o]=null,s(t,function(t){ - if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){ - var i=f[n]; - return null!==i&&(f[o]=null,f[e]=null,f[n]=null,i(t)),void(f[h]=t)} - var s=f[e]; - null!==s&&(f[o]=null,f[e]=null,f[n]=null,s(l(void 0,!0))),f[r]=!0} - ),t.on("readable",d.bind(null,f)),f} - ,"kd"),put} - function yut(){ - if(_ut)return vut; - var t; - _ut=1,vut=b,b.ReadableState=M,Zat.EventEmitter; - var i,s=Qt(function(t,i){ - return t.listeners(i).length} - ,"t"),e=Jct,n=Qct.Buffer,h=(void 0!==$tt?$tt:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{ - } - ).Uint8Array||function(){ - } - ,r=Blt; - i=r&&r.debuglog?r.debuglog("stream"):function(){ - } - ; - var o,a,c,l=Ult(),u=Wlt,d=Zlt.getHighWaterMark,f=Vlt.codes,p=f.ERR_INVALID_ARG_TYPE,w=f.ERR_STREAM_PUSH_AFTER_EOF,g=f.ERR_METHOD_NOT_IMPLEMENTED,m=f.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; - iut(b,e); - var v=u.errorOrDestroy,_=["error","close","destroy","pause","resume"]; - function M(i,s,e){ - t=t||hut(),i=i||{ - } - ,"boolean"!=typeof e&&(e=s instanceof t),this.objectMode=!!i.objectMode,e&&(this.objectMode=this.objectMode||!!i.readableObjectMode),this.highWaterMark=d(this,i,"readableHighWaterMark",e),this.buffer=new l,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==i.emitClose,this.autoDestroy=!!i.autoDestroy,this.destroyed=!1,this.defaultEncoding=i.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,i.encoding&&(o||(o=uut.StringDecoder),this.decoder=new o(i.encoding),this.encoding=i.encoding)} - function b(i){ - if(t=t||hut(),!(this instanceof b))return new b(i); - var s=this instanceof t; - this._readableState=new M(i,this,s),this.readable=!0,i&&("function"==typeof i.read&&(this._read=i.read),"function"==typeof i.destroy&&(this._destroy=i.destroy)),e.call(this)} - function y(t,s,e,r,o){ - i("readableAddChunk",s); - var a,c,l,u,d,f=t._readableState; - if(null===s)f.reading=!1,function(t,s){ - if(i("onEofChunk"),!s.ended){ - if(s.decoder){ - var e=s.decoder.end(); - e&&e.length&&(s.buffer.push(e),s.length+=s.objectMode?1:e.length)} - s.ended=!0,s.sync?T(t):(s.needReadable=!1,s.emittedReadable||(s.emittedReadable=!0,C(t)))} - } - (t,f); - else if(o||(c=f,d=l=s,n.isBuffer(d)||d instanceof h||"string"==typeof l||void 0===l||c.objectMode||(u=new p("chunk",["string","Buffer","Uint8Array"],l)),a=u),a)v(t,a); - else if(f.objectMode||s&&s.length>0)if("string"==typeof s||f.objectMode||Object.getPrototypeOf(s)===n.prototype||(s=function(t){ - return n.from(t)} - (s)),r)f.endEmitted?v(t,new m):E(t,f,s,!0); - else if(f.ended)v(t,new w); - else{ - if(f.destroyed)return!1; - f.reading=!1,f.decoder&&!e?(s=f.decoder.write(s),f.objectMode||0!==s.length?E(t,f,s,!1):O(t,f)):E(t,f,s,!1)} - else r||(f.reading=!1,O(t,f)); - return!f.ended&&(f.length<f.highWaterMark||0===f.length)} - function E(t,i,s,e){ - i.flowing&&0===i.length&&!i.sync?(i.awaitDrain=0,t.emit("data",s)):(i.length+=i.objectMode?1:s.length,e?i.buffer.unshift(s):i.buffer.push(s),i.needReadable&&T(t)),O(t,i)} - Qt(M,"w"),Qt(b,"E"),Qt(y,"S"),Qt(E,"_"),Object.defineProperty(b.prototype,"destroyed",{ - enumerable:!1,get:Qt(function(){ - return void 0!==this._readableState&&this._readableState.destroyed} - ,"get"),set:Qt(function(t){ - this._readableState&&(this._readableState.destroyed=t)} - ,"set")} - ),b.prototype.destroy=u.destroy,b.prototype._undestroy=u.undestroy,b.prototype._destroy=function(t,i){ - i(t)} - ,b.prototype.push=function(t,i){ - var s,e=this._readableState; - return e.objectMode?s=!0:"string"==typeof t&&((i=i||e.defaultEncoding)!==e.encoding&&(t=n.from(t,i),i=""),s=!0),y(this,t,i,!1,s)} - ,b.prototype.unshift=function(t){ - return y(this,t,null,!0,!1)} - ,b.prototype.isPaused=function(){ - return!1===this._readableState.flowing} - ,b.prototype.setEncoding=function(t){ - o||(o=uut.StringDecoder); - var i=new o(t); - this._readableState.decoder=i,this._readableState.encoding=this._readableState.decoder.encoding; - for(var s=this._readableState.buffer.head,e=""; - null!==s; - )e+=i.write(s.data),s=s.next; - return this._readableState.buffer.clear(),""!==e&&this._readableState.buffer.push(e),this._readableState.length=e.length,this} - ; - var A=1073741824; - function S(t,i){ - return t<=0||0===i.length&&i.ended?0:i.objectMode?1:t!=t?i.flowing&&i.length?i.buffer.head.data.length:i.length:(t>i.highWaterMark&&(i.highWaterMark=((s=t)>=A?s=A:(s--,s|=s>>>1,s|=s>>>2,s|=s>>>4,s|=s>>>8,s|=s>>>16,s++),s)),t<=i.length?t:i.ended?i.length:(i.needReadable=!0,0)); - var s} - function T(t){ - var s=t._readableState; - i("emitReadable",s.needReadable,s.emittedReadable),s.needReadable=!1,s.emittedReadable||(i("emitReadable",s.flowing),s.emittedReadable=!0,eat.nextTick(C,t))} - function C(t){ - var s=t._readableState; - i("emitReadable_",s.destroyed,s.length,s.ended),s.destroyed||!s.length&&!s.ended||(t.emit("readable"),s.emittedReadable=!1),s.needReadable=!s.flowing&&!s.ended&&s.length<=s.highWaterMark,P(t)} - function O(t,i){ - i.readingMore||(i.readingMore=!0,eat.nextTick(I,t,i))} - function I(t,s){ - for(; - !s.reading&&!s.ended&&(s.length<s.highWaterMark||s.flowing&&0===s.length); - ){ - var e=s.length; - if(i("maybeReadMore read 0"),t.read(0),e===s.length)break} - s.readingMore=!1} - function k(t){ - var i=t._readableState; - i.readableListening=t.listenerCount("readable")>0,i.resumeScheduled&&!i.paused?i.flowing=!0:t.listenerCount("data")>0&&t.resume()} - function x(t){ - i("readable nexttick read 0"),t.read(0)} - function R(t,s){ - i("resume",s.reading),s.reading||t.read(0),s.resumeScheduled=!1,t.emit("resume"),P(t),s.flowing&&!s.reading&&t.read(0)} - function P(t){ - var s=t._readableState; - for(i("flow",s.flowing); - s.flowing&&null!==t.read(); - ); - } - function N(t,i){ - return 0===i.length?null:(i.objectMode?s=i.buffer.shift():!t||t>=i.length?(s=i.decoder?i.buffer.join(""):1===i.buffer.length?i.buffer.first():i.buffer.concat(i.length),i.buffer.clear()):s=i.buffer.consume(t,i.decoder),s); - var s} - function L(t){ - var s=t._readableState; - i("endReadable",s.endEmitted),s.endEmitted||(s.ended=!0,eat.nextTick(D,s,t))} - function D(t,s){ - if(i("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,s.readable=!1,s.emit("end"),t.autoDestroy)){ - var e=s._writableState; - (!e||e.autoDestroy&&e.finished)&&s.destroy()} - } - function G(t,i){ - for(var s=0,e=t.length; - s<e; - s++)if(t[s]===i)return s; - return-1} - return Qt(S,"k"),Qt(T,"A"),Qt(C,"x"),Qt(O,"M"),Qt(I,"I"),Qt(k,"T"),Qt(x,"R"),Qt(R,"P"),Qt(P,"O"),Qt(N,"N"),Qt(L,"L"),Qt(D,"D"),Qt(G,"$"),b.prototype.read=function(t){ - i("read",t),t=parseInt(t,10); - var s=this._readableState,e=t; - if(0!==t&&(s.emittedReadable=!1),0===t&&s.needReadable&&((0!==s.highWaterMark?s.length>=s.highWaterMark:s.length>0)||s.ended))return i("read: emitReadable",s.length,s.ended),0===s.length&&s.ended?L(this):T(this),null; - if(0===(t=S(t,s))&&s.ended)return 0===s.length&&L(this),null; - var n,h=s.needReadable; - return i("need readable",h),(0===s.length||s.length-t<s.highWaterMark)&&i("length less than watermark",h=!0),s.ended||s.reading?i("reading or ended",h=!1):h&&(i("do read"),s.reading=!0,s.sync=!0,0===s.length&&(s.needReadable=!0),this._read(s.highWaterMark),s.sync=!1,s.reading||(t=S(e,s))),null===(n=t>0?N(t,s):null)?(s.needReadable=s.length<=s.highWaterMark,t=0):(s.length-=t,s.awaitDrain=0),0===s.length&&(s.ended||(s.needReadable=!0),e!==t&&s.ended&&L(this)),null!==n&&this.emit("data",n),n} - ,b.prototype._read=function(t){ - v(this,new g("_read()"))} - ,b.prototype.pipe=function(t,e){ - var n=this,h=this._readableState; - switch(h.pipesCount){ - case 0:h.pipes=t; - break; - case 1:h.pipes=[h.pipes,t]; - break; - default:h.pipes.push(t)} - h.pipesCount+=1,i("pipe count=%d opts=%j",h.pipesCount,e); - var r=e&&!1===e.end||t===eat.stdout||t===eat.stderr?w:a; - function o(s,e){ - i("onunpipe"),s===n&&e&&!1===e.hasUnpiped&&(e.hasUnpiped=!0,i("cleanup"),t.removeListener("close",f),t.removeListener("finish",p),t.removeListener("drain",c),t.removeListener("error",d),t.removeListener("unpipe",o),n.removeListener("end",a),n.removeListener("end",w),n.removeListener("data",u),l=!0,!h.awaitDrain||t._writableState&&!t._writableState.needDrain||c())} - function a(){ - i("onend"),t.end()} - Qt(o,"a"),Qt(a,"c"),h.endEmitted?eat.nextTick(r):n.once("end",r),t.on("unpipe",o); - var c=function(t){ - return function(){ - var e=t._readableState; - i("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,P(t))} - } - (n); - t.on("drain",c); - var l=!1; - function u(s){ - i("ondata"); - var e=t.write(s); - i("dest.write",e),!1===e&&((1===h.pipesCount&&h.pipes===t||h.pipesCount>1&&-1!==G(h.pipes,t))&&!l&&(i("false write response, pause",h.awaitDrain),h.awaitDrain++),n.pause())} - function d(e){ - i("onerror",e),w(),t.removeListener("error",d),0===s(t,"error")&&v(t,e)} - function f(){ - t.removeListener("finish",p),w()} - function p(){ - i("onfinish"),t.removeListener("close",f),w()} - function w(){ - i("unpipe"),n.unpipe(t)} - return Qt(u,"u"),Qt(d,"h"),Qt(f,"f"),Qt(p,"p"),Qt(w,"g"),n.on("data",u),function(t,i,s){ - if("function"==typeof t.prependListener)return t.prependListener(i,s); - t._events&&t._events[i]?Array.isArray(t._events[i])?t._events[i].unshift(s):t._events[i]=[s,t._events[i]]:t.on(i,s)} - (t,"error",d),t.once("close",f),t.once("finish",p),t.emit("pipe",n),h.flowing||(i("pipe resume"),n.resume()),t} - ,b.prototype.unpipe=function(t){ - var i=this._readableState,s={ - hasUnpiped:!1} - ; - if(0===i.pipesCount)return this; - if(1===i.pipesCount)return t&&t!==i.pipes||(t||(t=i.pipes),i.pipes=null,i.pipesCount=0,i.flowing=!1,t&&t.emit("unpipe",this,s)),this; - if(!t){ - var e=i.pipes,n=i.pipesCount; - i.pipes=null,i.pipesCount=0,i.flowing=!1; - for(var h=0; - h<n; - h++)e[h].emit("unpipe",this,{ - hasUnpiped:!1} - ); - return this} - var r=G(i.pipes,t); - return-1===r||(i.pipes.splice(r,1),i.pipesCount-=1,1===i.pipesCount&&(i.pipes=i.pipes[0]),t.emit("unpipe",this,s)),this} - ,b.prototype.on=function(t,s){ - var n=e.prototype.on.call(this,t,s),h=this._readableState; - return"data"===t?(h.readableListening=this.listenerCount("readable")>0,!1!==h.flowing&&this.resume()):"readable"===t&&(h.endEmitted||h.readableListening||(h.readableListening=h.needReadable=!0,h.flowing=!1,h.emittedReadable=!1,i("on readable",h.length,h.reading),h.length?T(this):h.reading||eat.nextTick(x,this))),n} - ,b.prototype.addListener=b.prototype.on,b.prototype.removeListener=function(t,i){ - var s=e.prototype.removeListener.call(this,t,i); - return"readable"===t&&eat.nextTick(k,this),s} - ,b.prototype.removeAllListeners=function(t){ - var i=e.prototype.removeAllListeners.apply(this,arguments); - return"readable"!==t&&void 0!==t||eat.nextTick(k,this),i} - ,b.prototype.resume=function(){ - var t,s=this._readableState; - return s.flowing||(i("resume"),s.flowing=!s.readableListening,(t=s).resumeScheduled||(t.resumeScheduled=!0,eat.nextTick(R,this,t))),s.paused=!1,this} - ,b.prototype.pause=function(){ - return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this} - ,b.prototype.wrap=function(t){ - var s=this,e=this._readableState,n=!1; - for(var h in t.on("end",function(){ - if(i("wrapped end"),e.decoder&&!e.ended){ - var t=e.decoder.end(); - t&&t.length&&s.push(t)} - s.push(null)} - ),t.on("data",function(h){ - i("wrapped data"),e.decoder&&(h=e.decoder.write(h)),e.objectMode&&null==h||(e.objectMode||h&&h.length)&&(s.push(h)||(n=!0,t.pause()))} - ),t)void 0===this[h]&&"function"==typeof t[h]&&(this[h]=function(i){ - return function(){ - return t[i].apply(t,arguments)} - } - (h)); - for(var r=0; - r<_.length; - r++)t.on(_[r],this.emit.bind(this,_[r])); - return this._read=function(s){ - i("wrapped _read",s),n&&(n=!1,t.resume())} - ,this} - ,"function"==typeof Symbol&&(b.prototype[Symbol.asyncIterator]=function(){ - return void 0===a&&(a=but()),a(this)} - ),Object.defineProperty(b.prototype,"readableHighWaterMark",{ - enumerable:!1,get:Qt(function(){ - return this._readableState.highWaterMark} - ,"get")} - ),Object.defineProperty(b.prototype,"readableBuffer",{ - enumerable:!1,get:Qt(function(){ - return this._readableState&&this._readableState.buffer} - ,"get")} - ),Object.defineProperty(b.prototype,"readableFlowing",{ - enumerable:!1,get:Qt(function(){ - return this._readableState.flowing} - ,"get"),set:Qt(function(t){ - this._readableState&&(this._readableState.flowing=t)} - ,"set")} - ),b._fromList=N,Object.defineProperty(b.prototype,"readableLength",{ - enumerable:!1,get:Qt(function(){ - return this._readableState.length} - ,"get")} - ),"function"==typeof Symbol&&(b.from=function(t,i){ - return void 0===c&&(c=mut?gut:(mut=1,gut=Qt(function(){ - throw new Error("Readable.from is not available in the browser")} - ,"xd"))),c(b,t,i)} - ),vut} - Qt(but,"Pd"),Qt(yut,"Od"); - var Eut=xut,Aut=Vlt.codes,Sut=Aut.ERR_METHOD_NOT_IMPLEMENTED,Tut=Aut.ERR_MULTIPLE_CALLBACK,Cut=Aut.ERR_TRANSFORM_ALREADY_TRANSFORMING,Out=Aut.ERR_TRANSFORM_WITH_LENGTH_0,Iut=hut(); - function kut(t,i){ - var s=this._transformState; - s.transforming=!1; - var e=s.writecb; - if(null===e)return this.emit("error",new Tut); - s.writechunk=null,s.writecb=null,null!=i&&this.push(i),e(t); - var n=this._readableState; - n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)} - function xut(t){ - if(!(this instanceof xut))return new xut(t); - Iut.call(this,t),this._transformState={ - afterTransform:kut.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null} - ,this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",Rut)} - function Rut(){ - var t=this; - "function"!=typeof this._flush||this._readableState.destroyed?Put(this,null,null):this._flush(function(i,s){ - Put(t,i,s)} - )} - function Put(t,i,s){ - if(i)return t.emit("error",i); - if(null!=s&&t.push(s),t._writableState.length)throw new Out; - if(t._transformState.transforming)throw new Cut; - return t.push(null)} - Qt(kut,"Ud"),Qt(xut,"Hd"),Qt(Rut,"Fd"),Qt(Put,"zd"),iut(xut,Iut),xut.prototype.push=function(t,i){ - return this._transformState.needTransform=!1,Iut.prototype.push.call(this,t,i)} - ,xut.prototype._transform=function(t,i,s){ - s(new Sut("_transform()"))} - ,xut.prototype._write=function(t,i,s){ - var e=this._transformState; - if(e.writecb=s,e.writechunk=t,e.writeencoding=i,!e.transforming){ - var n=this._readableState; - (e.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)} - } - ,xut.prototype._read=function(t){ - var i=this._transformState; - null===i.writechunk||i.transforming?i.needTransform=!0:(i.transforming=!0,this._transform(i.writechunk,i.writeencoding,i.afterTransform))} - ,xut.prototype._destroy=function(t,i){ - Iut.prototype._destroy.call(this,t,function(t){ - i(t)} - )} - ; - var Nut,Lut=Gut,Dut=Eut; - function Gut(t){ - if(!(this instanceof Gut))return new Gut(t); - Dut.call(this,t)} - Qt(Gut,"Gd"),iut(Gut,Dut),Gut.prototype._transform=function(t,i,s){ - s(null,t)} - ; - var But=Vlt.codes,Uut=But.ERR_MISSING_ARGS,Fut=But.ERR_STREAM_DESTROYED; - function $ut(t){ - if(t)throw t} - function Hut(t){ - t()} - function Wut(t,i){ - return t.pipe(i)} - Qt($ut,"Qd"),Qt(Hut,"Xd"),Qt(Wut,"eu"); - var Vut,jut=Qt(function(){ - for(var t=arguments.length,i=new Array(t),s=0; - s<t; - s++)i[s]=arguments[s]; - var e,n,h=(n=i).length?"function"!=typeof n[n.length-1]?$ut:n.pop():$ut; - if(Array.isArray(i[0])&&(i=i[0]),i.length<2)throw new Uut("streams"); - var r=i.map(function(t,s){ - var n=s<i.length-1; - return function(t,i,s,e){ - e=function(t){ - var i=!1; - return function(){ - i||(i=!0,t.apply(void 0,arguments))} - } - (e); - var n=!1; - t.on("close",function(){ - n=!0} - ),void 0===Nut&&(Nut=Mut),Nut(t,{ - readable:i,writable:s} - ,function(t){ - if(t)return e(t); - n=!0,e()} - ); - var h=!1; - return function(i){ - if(!n&&!h)return h=!0,(s=t).setHeader&&"function"==typeof s.abort?t.abort():"function"==typeof t.destroy?t.destroy():void e(i||new Fut("pipe")); - var s} - } - (t,n,s>0,function(t){ - e||(e=t),t&&r.forEach(Hut),n||(r.forEach(Hut),h(e))} - )} - ); - return i.reduce(Wut)} - ,"tu"); - Vut=Xct.exports,(Vut=Xct.exports=yut()).Stream=Vut,Vut.Readable=Vut,Vut.Writable=nut(),Vut.Duplex=hut(),Vut.Transform=Eut,Vut.PassThrough=Lut,Vut.finished=Mut,Vut.pipeline=jut; - var Kut=Xct.exports; - function zut(t={ - } - ){ - const i={ - } - ,s=new Kut.Duplex({ - objectMode:!0,read:Qt(()=>{ - } - ,"read"),write:Qt(function(s,h,r){ - let o=null; - try{ - s.id?function(t){ - const{ - id:s} - =t; - if(null===s)return; - const e=i[s]; - e&&(delete i[s],Object.assign(e.res,t),setTimeout(e.end))} - (s):(a=s,(null==t?void 0:t.retryOnMessage)&&a.method===t.retryOnMessage&&Object.values(i).forEach(({ - req:t,retryCount:s=0} - )=>{ - if(!t.id)return; - if(s>=3)throw new Error(`StreamMiddleware - Retry limit exceeded for request id "${ - t.id} - "`); - const e=i[t.id]; - e&&(e.retryCount=s+1),n(t)} - ),e.emit("notification",a))} - catch(c){ - o=c} - var a; - r(o)} - ,"write")} - ),e=new yct; - return{ - events:e,middleware:Qt((t,s,e,h)=>{ - i[t.id]={ - req:t,res:s,next:e,end:h} - ,n(t)} - ,"middleware"),stream:s} - ; - function n(t){ - s.push(t)} - } - Qt(zut,"ru$1"); - var Yut={ - } - ,qut={ - exports:{ - } - } - ,Xut=Qt(function t(i,s){ - if(i&&s)return t(i)(s); - if("function"!=typeof i)throw new TypeError("need wrapper function"); - return Object.keys(i).forEach(function(t){ - e[t]=i[t]} - ),e; - function e(){ - for(var t=new Array(arguments.length),s=0; - s<t.length; - s++)t[s]=arguments[s]; - var e=i.apply(this,t),n=t[t.length-1]; - return"function"==typeof e&&e!==n&&Object.keys(n).forEach(function(t){ - e[t]=n[t]} - ),e} - } - ,"e"),Jut=Xut; - function Qut(t){ - var i=Qt(function(){ - return i.called?i.value:(i.called=!0,i.value=t.apply(this,arguments))} - ,"t"); - return i.called=!1,i} - function Zut(t){ - var i=Qt(function(){ - if(i.called)throw new Error(i.onceError); - return i.called=!0,i.value=t.apply(this,arguments)} - ,"t"),s=t.name||"Function wrapped with `once`"; - return i.onceError=s+" shouldn't be called more than once",i.called=!1,i} - Qt(Qut,"cu"),Qt(Zut,"lu"),qut.exports=Jut(Qut),qut.exports.strict=Jut(Zut),Qut.proto=Qut(function(){ - Object.defineProperty(Function.prototype,"once",{ - value:Qt(function(){ - return Qut(this)} - ,"value"),configurable:!0} - ),Object.defineProperty(Function.prototype,"onceStrict",{ - value:Qt(function(){ - return Zut(this)} - ,"value"),configurable:!0} - )} - ); - var tdt=qut.exports,idt={ - } - ; - Object.defineProperty(idt,"__esModule",{ - value:!0} - ),idt.Substream=void 0; - const sdt=Kut,edt=class extends sdt.Duplex{ - constructor({ - parent:t,name:i} - ){ - super({ - objectMode:!0} - ),this._parent=t,this._name=i} - _read(){ - } - _write(t,i,s){ - this._parent.push({ - name:this._name,data:t} - ),s()} - } - ; - Qt(edt,"fu"); - let ndt=edt; - idt.Substream=ndt; - var hdt=$tt&&$tt.__importDefault||function(t){ - return t&&t.__esModule?t:{ - default:t} - } - ; - Object.defineProperty(Yut,"__esModule",{ - value:!0} - ),Yut.ObjectMultiplex=void 0; - const rdt=Kut,odt=hdt(tdt),adt=idt,cdt=Symbol("IGNORE_SUBSTREAM"); - let ldt=(pt=class extends rdt.Duplex{ - constructor(t={ - } - ){ - super(Object.assign(Object.assign({ - } - ,t),{ - objectMode:!0} - )),this._substreams={ - } - } - createStream(t){ - if(this.destroyed)throw new Error(`ObjectMultiplex - parent stream for name "${ - t} - " already destroyed`); - if(this._readableState.ended||this._writableState.ended)throw new Error(`ObjectMultiplex - parent stream for name "${ - t} - " already ended`); - if(!t)throw new Error("ObjectMultiplex - name must not be empty"); - if(this._substreams[t])throw new Error(`ObjectMultiplex - Substream for name "${ - t} - " already exists`); - const i=new adt.Substream({ - parent:this,name:t} - ); - return this._substreams[t]=i,function(t){ - const s=(0,odt.default)(t=>i.destroy(t||void 0)); - (0,rdt.finished)(t,{ - readable:!1} - ,s),(0,rdt.finished)(t,{ - writable:!1} - ,s)} - (this),i} - ignoreStream(t){ - if(!t)throw new Error("ObjectMultiplex - name must not be empty"); - if(this._substreams[t])throw new Error(`ObjectMultiplex - Substream for name "${ - t} - " already exists`); - this._substreams[t]=cdt} - _read(){ - } - _write(t,i,s){ - const{ - name:e,data:n} - =t; - if(!e)return s(); - const h=this._substreams[e]; - return h?(h!==cdt&&h.push(n),s()):s()} - } - ,Qt(pt,"bu"),pt); - Yut.ObjectMultiplex=ldt; - var udt=Htt(Yut.ObjectMultiplex); - const ddt=Qt(t=>null!==t&&"object"==typeof t&&"function"==typeof t.pipe,"Eu"); - ddt.writable=t=>ddt(t)&&!1!==t.writable&&"function"==typeof t._write&&"object"==typeof t._writableState,ddt.readable=t=>ddt(t)&&!1!==t.readable&&"function"==typeof t._read&&"object"==typeof t._readableState,ddt.duplex=t=>ddt.writable(t)&&ddt.readable(t),ddt.transform=t=>ddt.duplex(t)&&"function"==typeof t._transform; - var fdt,pdt=ddt,wdt=(wt=class extends qct{ - constructor(t,{ - jsonRpcStreamName:i,logger:s=console,maxEventListeners:e=100,rpcMiddleware:n=[]} - ){ - if(super({ - logger:s,maxEventListeners:e,rpcMiddleware:n} - ),!pdt.duplex(t))throw new Error(zrt.errors.invalidDuplexStream()); - this._handleStreamDisconnect=this._handleStreamDisconnect.bind(this); - const h=new udt; - Kut.pipeline(t,h,t,this._handleStreamDisconnect.bind(this,"MetaMask")),this._jsonRpcConnection=zut({ - retryOnMessage:"METAMASK_EXTENSION_CONNECT_CAN_RETRY"} - ),Kut.pipeline(this._jsonRpcConnection.stream,h.createStream(i),this._jsonRpcConnection.stream,this._handleStreamDisconnect.bind(this,"MetaMask RpcProvider")),this._rpcEngine.push(this._jsonRpcConnection.middleware),this._jsonRpcConnection.events.on("notification",i=>{ - const{ - method:s,params:e} - =i; - "metamask_accountsChanged"===s?this._handleAccountsChanged(e):"metamask_unlockStateChanged"===s?this._handleUnlockStateChanged(e):"metamask_chainChanged"===s?this._handleChainChanged(e):Tct.includes(s)?this.emit("message",{ - type:s,data:e} - ):"METAMASK_STREAM_FAILURE"===s&&t.destroy(new Error(zrt.errors.permanentlyDisconnected()))} - )} - async _initializeStateAsync(){ - let t; - try{ - t=await this.request({ - method:"metamask_getProviderState"} - )} - catch(i){ - this._log.error("MetaMask: Failed to get initial state. Please report this bug.",i)} - this._initializeState(t)} - _handleStreamDisconnect(t,i){ - let s=`MetaMask: Lost connection to "${ - t} - ".`; - (null==i?void 0:i.stack)&&(s+=`\n${ - i.stack} - `),this._log.warn(s),this.listenerCount("error")>0&&this.emit("error",s),this._handleDisconnect(!1,i?i.message:void 0)} - _handleChainChanged({ - chainId:t,networkVersion:i} - ={ - } - ){ - var s; - kct(t)&&(s=i,Boolean(s)&&"string"==typeof s)?"loading"===i?this._handleDisconnect(!0):super._handleChainChanged({ - chainId:t} - ):this._log.error(zrt.errors.invalidNetworkParams(),{ - chainId:t,networkVersion:i} - )} - } - ,Qt(wt,"Cu"),wt),gdt=(gt=class extends wdt{ - constructor(t,{ - jsonRpcStreamName:i="metamask-provider",logger:s=console,maxEventListeners:e=100,shouldSendMetadata:n} - ={ - } - ){ - if(super(t,{ - jsonRpcStreamName:i,logger:s,maxEventListeners:e,rpcMiddleware:Cct(s)} - ),this._sentWarnings={ - chainId:!1,networkVersion:!1,selectedAddress:!1,enable:!1,experimentalMethods:!1,send:!1,events:{ - close:!1,data:!1,networkChanged:!1,notification:!1} - } - ,Bct(this,fdt,void 0),this._initializeStateAsync(),Uct(this,fdt,null),this.isMetaMask=!0,this._sendSync=this._sendSync.bind(this),this.enable=this.enable.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this._warnOfDeprecation=this._warnOfDeprecation.bind(this),this._metamask=this._getExperimentalApi(),this._jsonRpcConnection.events.on("notification",t=>{ - const{ - method:i} - =t; - Tct.includes(i)&&(this.emit("data",t),this.emit("notification",t.params.result))} - ),n)if("complete"===document.readyState)Rct(this._rpcEngine,this._log); - else{ - const t=Qt(()=>{ - Rct(this._rpcEngine,this._log),window.removeEventListener("DOMContentLoaded",t)} - ,"e"); - window.addEventListener("DOMContentLoaded",t)} - } - get chainId(){ - return this._sentWarnings.chainId||(this._log.warn(zrt.warnings.chainIdDeprecation),this._sentWarnings.chainId=!0),super.chainId} - get networkVersion(){ - return this._sentWarnings.networkVersion||(this._log.warn(zrt.warnings.networkVersionDeprecation),this._sentWarnings.networkVersion=!0),Gct(this,fdt)} - get selectedAddress(){ - return this._sentWarnings.selectedAddress||(this._log.warn(zrt.warnings.selectedAddressDeprecation),this._sentWarnings.selectedAddress=!0),super.selectedAddress} - sendAsync(t,i){ - this._rpcRequest(t,i)} - addListener(t,i){ - return this._warnOfDeprecation(t),super.addListener(t,i)} - on(t,i){ - return this._warnOfDeprecation(t),super.on(t,i)} - once(t,i){ - return this._warnOfDeprecation(t),super.once(t,i)} - prependListener(t,i){ - return this._warnOfDeprecation(t),super.prependListener(t,i)} - prependOnceListener(t,i){ - return this._warnOfDeprecation(t),super.prependOnceListener(t,i)} - _handleDisconnect(t,i){ - super._handleDisconnect(t,i),Gct(this,fdt)&&!t&&Uct(this,fdt,null)} - _warnOfDeprecation(t){ - var i; - !1===(null==(i=this._sentWarnings)?void 0:i.events[t])&&(this._log.warn(zrt.warnings.events[t]),this._sentWarnings.events[t]=!0)} - async enable(){ - return this._sentWarnings.enable||(this._log.warn(zrt.warnings.enableDeprecation),this._sentWarnings.enable=!0),new Promise((t,i)=>{ - try{ - this._rpcRequest({ - method:"eth_requestAccounts",params:[]} - ,Ict(t,i))} - catch(s){ - i(s)} - } - )} - send(t,i){ - return this._sentWarnings.send||(this._log.warn(zrt.warnings.sendDeprecation),this._sentWarnings.send=!0),"string"!=typeof t||i&&!Array.isArray(i)?t&&"object"==typeof t&&"function"==typeof i?this._rpcRequest(t,i):this._sendSync(t):new Promise((s,e)=>{ - try{ - this._rpcRequest({ - method:t,params:i} - ,Ict(s,e,!1))} - catch(n){ - e(n)} - } - )} - _sendSync(t){ - let i; - switch(t.method){ - case"eth_accounts":i=this.selectedAddress?[this.selectedAddress]:[]; - break; - case"eth_coinbase":i=this.selectedAddress??null; - break; - case"eth_uninstallFilter":this._rpcRequest(t,xct),i=!0; - break; - case"net_version":i=Gct(this,fdt)??null; - break; - default:throw new Error(zrt.errors.unsupportedSync(t.method))} - return{ - id:t.id,jsonrpc:t.jsonrpc,result:i} - } - _getExperimentalApi(){ - return new Proxy({ - isUnlocked:Qt(async()=>(this._state.initialized||await new Promise(t=>{ - this.on("_initialized",()=>t())} - ),this._state.isUnlocked),"isUnlocked"),requestBatch:Qt(async t=>{ - if(!Array.isArray(t))throw Wat({ - message:"Batch requests must be made with an array of request objects.",data:t} - ); - return new Promise((i,s)=>{ - this._rpcRequest(t,Ict(i,s))} - )} - ,"requestBatch")} - ,{ - get:Qt((t,i,...s)=>(this._sentWarnings.experimentalMethods||(this._log.warn(zrt.warnings.experimentalMethods),this._sentWarnings.experimentalMethods=!0),Reflect.get(t,i,...s)),"get")} - )} - _handleChainChanged({ - chainId:t,networkVersion:i} - ={ - } - ){ - super._handleChainChanged({ - chainId:t,networkVersion:i} - ),this._state.isConnected&&i!==Gct(this,fdt)&&(Uct(this,fdt,i),this._state.initialized&&this.emit("networkChanged",Gct(this,fdt)))} - } - ,Qt(gt,"ku"),gt); - fdt=new WeakMap; - const mdt=G4("MM_SDK"); - let vdt; - mdt.color="#FFAC1C"; - var _dt={ - } - ,Mdt={ - } - ; - Object.defineProperty(Mdt,"__esModule",{ - value:!0} - ),Mdt.EthereumProviderError=Mdt.EthereumRpcError=void 0; - const bdt=Cat,ydt=class extends Error{ - constructor(t,i,s){ - if(!Number.isInteger(t))throw new Error('"code" must be an integer.'); - if(!i||"string"!=typeof i)throw new Error('"message" must be a nonempty string.'); - super(i),this.code=t,void 0!==s&&(this.data=s)} - serialize(){ - const t={ - code:this.code,message:this.message} - ; - return void 0!==this.data&&(t.data=this.data),this.stack&&(t.stack=this.stack),t} - toString(){ - return bdt.default(this.serialize(),Adt,2)} - } - ; - Qt(ydt,"Ru"); - let Edt=ydt; - function Adt(t,i){ - if("[Circular]"!==i)return i} - Mdt.EthereumRpcError=Edt,Qt(Adt,"Pu"),Mdt.EthereumProviderError=class extends Edt{ - constructor(t,i,s){ - if(e=t,!(Number.isInteger(e)&&e>=1e3&&e<=4999))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999'); - var e; - super(t,i,s)} - } - ; - var Sdt={ - } - ,Tdt={ - } - ; - Object.defineProperty(Tdt,"__esModule",{ - value:!0} - ),Tdt.errorValues=Tdt.errorCodes=void 0,Tdt.errorCodes={ - rpc:{ - invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603} - ,provider:{ - userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901} - } - ,Tdt.errorValues={ - "-32700":{ - standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."} - ,"-32600":{ - standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."} - ,"-32601":{ - standard:"JSON RPC 2.0",message:"The method does not exist / is not available."} - ,"-32602":{ - standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."} - ,"-32603":{ - standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."} - ,"-32000":{ - standard:"EIP-1474",message:"Invalid input."} - ,"-32001":{ - standard:"EIP-1474",message:"Resource not found."} - ,"-32002":{ - standard:"EIP-1474",message:"Resource unavailable."} - ,"-32003":{ - standard:"EIP-1474",message:"Transaction rejected."} - ,"-32004":{ - standard:"EIP-1474",message:"Method not supported."} - ,"-32005":{ - standard:"EIP-1474",message:"Request limit exceeded."} - ,4001:{ - standard:"EIP-1193",message:"User rejected the request."} - ,4100:{ - standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."} - ,4200:{ - standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."} - ,4900:{ - standard:"EIP-1193",message:"The provider is disconnected from all chains."} - ,4901:{ - standard:"EIP-1193",message:"The provider is disconnected from the specified chain."} - } - ,function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0; - const i=Tdt,s=Mdt,e=i.errorCodes.rpc.internal,n={ - code:e,message:h(e)} - ; - function h(s,e="Unspecified error message. This is a bug, please report it."){ - if(Number.isInteger(s)){ - const e=s.toString(); - if(c(i.errorValues,e))return i.errorValues[e].message; - if(o(s))return t.JSON_RPC_SERVER_ERROR_MESSAGE} - return e} - function r(t){ - if(!Number.isInteger(t))return!1; - const s=t.toString(); - return!!i.errorValues[s]||!!o(t)} - function o(t){ - return t>=-32099&&t<=-32e3} - function a(t){ - return t&&"object"==typeof t&&!Array.isArray(t)?Object.assign({ - } - ,t):t} - function c(t,i){ - return Object.prototype.hasOwnProperty.call(t,i)} - Qt(h,"s"),Qt(r,"a"),Qt(o,"c"),Qt(a,"l"),Qt(c,"d"),t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=h,t.isValidCode=r,t.serializeError=function(t,{ - fallbackError:i=n,shouldIncludeStack:e=!1} - ={ - } - ){ - var o,l; - if(!i||!Number.isInteger(i.code)||"string"!=typeof i.message)throw new Error("Must provide fallback error with integer number code and string message."); - if(t instanceof s.EthereumRpcError)return t.serialize(); - const u={ - } - ; - if(t&&"object"==typeof t&&!Array.isArray(t)&&c(t,"code")&&r(t.code)){ - const i=t; - u.code=i.code,i.message&&"string"==typeof i.message?(u.message=i.message,c(i,"data")&&(u.data=i.data)):(u.message=h(u.code),u.data={ - originalError:a(t)} - )} - else{ - u.code=i.code; - const s=null===(o=t)||void 0===o?void 0:o.message; - u.message=s&&"string"==typeof s?s:i.message,u.data={ - originalError:a(t)} - } - const d=null===(l=t)||void 0===l?void 0:l.stack; - return e&&t&&d&&"string"==typeof d&&(u.stack=d),u} - } - (Sdt); - var Cdt={ - } - ; - Object.defineProperty(Cdt,"__esModule",{ - value:!0} - ),Cdt.ethErrors=void 0; - const Odt=Mdt,Idt=Sdt,kdt=Tdt; - function xdt(t,i){ - const[s,e]=Pdt(i); - return new Odt.EthereumRpcError(t,s||Idt.getMessageFromCode(t),e)} - function Rdt(t,i){ - const[s,e]=Pdt(i); - return new Odt.EthereumProviderError(t,s||Idt.getMessageFromCode(t),e)} - function Pdt(t){ - if(t){ - if("string"==typeof t)return[t]; - if("object"==typeof t&&!Array.isArray(t)){ - const{ - message:i,data:s} - =t; - if(i&&"string"!=typeof i)throw new Error("Must specify string message."); - return[i||void 0,s]} - } - return[]} - Qt(xdt,"Ku"),Qt(Rdt,"ju"),Qt(Pdt,"Uu"),Cdt.ethErrors={ - rpc:{ - parse:Qt(t=>xdt(kdt.errorCodes.rpc.parse,t),"parse"),invalidRequest:Qt(t=>xdt(kdt.errorCodes.rpc.invalidRequest,t),"invalidRequest"),invalidParams:Qt(t=>xdt(kdt.errorCodes.rpc.invalidParams,t),"invalidParams"),methodNotFound:Qt(t=>xdt(kdt.errorCodes.rpc.methodNotFound,t),"methodNotFound"),internal:Qt(t=>xdt(kdt.errorCodes.rpc.internal,t),"internal"),server:Qt(t=>{ - if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument."); - const{ - code:i} - =t; - if(!Number.isInteger(i)||i>-32005||i<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005'); - return xdt(i,t)} - ,"server"),invalidInput:Qt(t=>xdt(kdt.errorCodes.rpc.invalidInput,t),"invalidInput"),resourceNotFound:Qt(t=>xdt(kdt.errorCodes.rpc.resourceNotFound,t),"resourceNotFound"),resourceUnavailable:Qt(t=>xdt(kdt.errorCodes.rpc.resourceUnavailable,t),"resourceUnavailable"),transactionRejected:Qt(t=>xdt(kdt.errorCodes.rpc.transactionRejected,t),"transactionRejected"),methodNotSupported:Qt(t=>xdt(kdt.errorCodes.rpc.methodNotSupported,t),"methodNotSupported"),limitExceeded:Qt(t=>xdt(kdt.errorCodes.rpc.limitExceeded,t),"limitExceeded")} - ,provider:{ - userRejectedRequest:Qt(t=>Rdt(kdt.errorCodes.provider.userRejectedRequest,t),"userRejectedRequest"),unauthorized:Qt(t=>Rdt(kdt.errorCodes.provider.unauthorized,t),"unauthorized"),unsupportedMethod:Qt(t=>Rdt(kdt.errorCodes.provider.unsupportedMethod,t),"unsupportedMethod"),disconnected:Qt(t=>Rdt(kdt.errorCodes.provider.disconnected,t),"disconnected"),chainDisconnected:Qt(t=>Rdt(kdt.errorCodes.provider.chainDisconnected,t),"chainDisconnected"),custom:Qt(t=>{ - if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument."); - const{ - code:i,message:s,data:e} - =t; - if(!s||"string"!=typeof s)throw new Error('"message" must be a nonempty string'); - return new Odt.EthereumProviderError(i,s,e)} - ,"custom")} - } - ,function(t){ - Object.defineProperty(t,"__esModule",{ - value:!0} - ),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0; - const i=Mdt; - Object.defineProperty(t,"EthereumRpcError",{ - enumerable:!0,get:Qt(function(){ - return i.EthereumRpcError} - ,"get")} - ),Object.defineProperty(t,"EthereumProviderError",{ - enumerable:!0,get:Qt(function(){ - return i.EthereumProviderError} - ,"get")} - ); - const s=Sdt; - Object.defineProperty(t,"serializeError",{ - enumerable:!0,get:Qt(function(){ - return s.serializeError} - ,"get")} - ),Object.defineProperty(t,"getMessageFromCode",{ - enumerable:!0,get:Qt(function(){ - return s.getMessageFromCode} - ,"get")} - ); - const e=Cdt; - Object.defineProperty(t,"ethErrors",{ - enumerable:!0,get:Qt(function(){ - return e.ethErrors} - ,"get")} - ); - const n=Tdt; - Object.defineProperty(t,"errorCodes",{ - enumerable:!0,get:Qt(function(){ - return n.errorCodes} - ,"get")} - )} - (_dt); - var Ndt={ - exports:{ - } - } - ; - Ndt.exports=function(t){ - var i={ - } - ; - function s(e){ - if(i[e])return i[e].exports; - var n=i[e]={ - i:e,l:!1,exports:{ - } - } - ; - return t[e].call(n.exports,n,n.exports,s),n.l=!0,n.exports} - return Qt(s,"n"),s.m=t,s.c=i,s.d=function(t,i,e){ - s.o(t,i)||Object.defineProperty(t,i,{ - enumerable:!0,get:e} - )} - ,s.r=function(t){ - "undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{ - value:"Module"} - ),Object.defineProperty(t,"__esModule",{ - value:!0} - )} - ,s.t=function(t,i){ - if(1&i&&(t=s(t)),8&i)return t; - if(4&i&&"object"==typeof t&&t&&t.__esModule)return t; - var e=Object.create(null); - if(s.r(e),Object.defineProperty(e,"default",{ - enumerable:!0,value:t} - ),2&i&&"string"!=typeof t)for(var n in t)s.d(e,n,function(i){ - return t[i]} - .bind(null,n)); - return e} - ,s.n=function(t){ - var i=t&&t.__esModule?function(){ - return t.default} - :function(){ - return t} - ; - return s.d(i,"a",i),i} - ,s.o=function(t,i){ - return Object.prototype.hasOwnProperty.call(t,i)} - ,s.p="",s(s.s=90)} - ({ - 17:function(t,i,s){ - i.__esModule=!0,i.default=void 0; - var e=s(18),n=function(){ - function t(){ - } - return Qt(t,"e"),t.getFirstMatch=function(t,i){ - var s=i.match(t); - return s&&s.length>0&&s[1]||""} - ,t.getSecondMatch=function(t,i){ - var s=i.match(t); - return s&&s.length>1&&s[2]||""} - ,t.matchAndReturnConst=function(t,i,s){ - if(t.test(i))return s} - ,t.getWindowsVersionName=function(t){ - switch(t){ - case"NT":return"NT"; - case"XP":case"NT 5.1":return"XP"; - case"NT 5.0":return"2000"; - case"NT 5.2":return"2003"; - case"NT 6.0":return"Vista"; - case"NT 6.1":return"7"; - case"NT 6.2":return"8"; - case"NT 6.3":return"8.1"; - case"NT 10.0":return"10"; - default:return} - } - ,t.getMacOSVersionName=function(t){ - var i=t.split(".").splice(0,2).map(function(t){ - return parseInt(t,10)||0} - ); - if(i.push(0),10===i[0])switch(i[1]){ - case 5:return"Leopard"; - case 6:return"Snow Leopard"; - case 7:return"Lion"; - case 8:return"Mountain Lion"; - case 9:return"Mavericks"; - case 10:return"Yosemite"; - case 11:return"El Capitan"; - case 12:return"Sierra"; - case 13:return"High Sierra"; - case 14:return"Mojave"; - case 15:return"Catalina"; - default:return} - } - ,t.getAndroidVersionName=function(t){ - var i=t.split(".").splice(0,2).map(function(t){ - return parseInt(t,10)||0} - ); - if(i.push(0),!(1===i[0]&&i[1]<5))return 1===i[0]&&i[1]<6?"Cupcake":1===i[0]&&i[1]>=6?"Donut":2===i[0]&&i[1]<2?"Eclair":2===i[0]&&2===i[1]?"Froyo":2===i[0]&&i[1]>2?"Gingerbread":3===i[0]?"Honeycomb":4===i[0]&&i[1]<1?"Ice Cream Sandwich":4===i[0]&&i[1]<4?"Jelly Bean":4===i[0]&&i[1]>=4?"KitKat":5===i[0]?"Lollipop":6===i[0]?"Marshmallow":7===i[0]?"Nougat":8===i[0]?"Oreo":9===i[0]?"Pie":void 0} - ,t.getVersionPrecision=function(t){ - return t.split(".").length} - ,t.compareVersions=function(i,s,e){ - void 0===e&&(e=!1); - var n=t.getVersionPrecision(i),h=t.getVersionPrecision(s),r=Math.max(n,h),o=0,a=t.map([i,s],function(i){ - var s=r-t.getVersionPrecision(i),e=i+new Array(s+1).join(".0"); - return t.map(e.split("."),function(t){ - return new Array(20-t.length).join("0")+t} - ).reverse()} - ); - for(e&&(o=r-Math.min(n,h)),r-=1; - r>=o; - ){ - if(a[0][r]>a[1][r])return 1; - if(a[0][r]===a[1][r]){ - if(r===o)return 0; - r-=1} - else if(a[0][r]<a[1][r])return-1} - } - ,t.map=function(t,i){ - var s,e=[]; - if(Array.prototype.map)return Array.prototype.map.call(t,i); - for(s=0; - s<t.length; - s+=1)e.push(i(t[s])); - return e} - ,t.find=function(t,i){ - var s,e; - if(Array.prototype.find)return Array.prototype.find.call(t,i); - for(s=0,e=t.length; - s<e; - s+=1){ - var n=t[s]; - if(i(n,s))return n} - } - ,t.assign=function(t){ - for(var i,s,e=t,n=arguments.length,h=new Array(n>1?n-1:0),r=1; - r<n; - r++)h[r-1]=arguments[r]; - if(Object.assign)return Object.assign.apply(Object,[t].concat(h)); - var o=Qt(function(){ - var t=h[i]; - "object"==typeof t&&null!==t&&Object.keys(t).forEach(function(i){ - e[i]=t[i]} - )} - ,"a"); - for(i=0,s=h.length; - i<s; - i+=1)o(); - return t} - ,t.getBrowserAlias=function(t){ - return e.BROWSER_ALIASES_MAP[t]} - ,t.getBrowserTypeByAlias=function(t){ - return e.BROWSER_MAP[t]||""} - ,t} - (); - i.default=n,t.exports=i.default} - ,18:function(t,i,s){ - i.__esModule=!0,i.ENGINE_MAP=i.OS_MAP=i.PLATFORMS_MAP=i.BROWSER_MAP=i.BROWSER_ALIASES_MAP=void 0,i.BROWSER_ALIASES_MAP={ - "Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"} - ,i.BROWSER_MAP={ - amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"} - ,i.PLATFORMS_MAP={ - tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"} - ,i.OS_MAP={ - WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"} - ,i.ENGINE_MAP={ - EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"} - } - ,90:function(t,i,s){ - i.__esModule=!0,i.default=void 0; - var e,n=(e=s(91))&&e.__esModule?e:{ - default:e} - ,h=s(18); - function r(t,i){ - for(var s=0; - s<i.length; - s++){ - var e=i[s]; - e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)} - } - Qt(r,"s"); - var o=function(){ - function t(){ - } - var i,s; - return Qt(t,"e"),t.getParser=function(t,i){ - if(void 0===i&&(i=!1),"string"!=typeof t)throw new Error("UserAgent should be a string"); - return new n.default(t,i)} - ,t.parse=function(t){ - return new n.default(t).getResult()} - ,i=t,(s=[{ - key:"BROWSER_MAP",get:Qt(function(){ - return h.BROWSER_MAP} - ,"get")} - ,{ - key:"ENGINE_MAP",get:Qt(function(){ - return h.ENGINE_MAP} - ,"get")} - ,{ - key:"OS_MAP",get:Qt(function(){ - return h.OS_MAP} - ,"get")} - ,{ - key:"PLATFORMS_MAP",get:Qt(function(){ - return h.PLATFORMS_MAP} - ,"get")} - ])&&r(i,s),t} - (); - i.default=o,t.exports=i.default} - ,91:function(t,i,s){ - i.__esModule=!0,i.default=void 0; - var e=a(s(92)),n=a(s(93)),h=a(s(94)),r=a(s(95)),o=a(s(17)); - function a(t){ - return t&&t.__esModule?t:{ - default:t} - } - Qt(a,"c"); - var c=function(){ - function t(t,i){ - if(void 0===i&&(i=!1),null==t||""===t)throw new Error("UserAgent parameter can't be empty"); - this._ua=t,this.parsedResult={ - } - ,!0!==i&&this.parse()} - Qt(t,"e"); - var i=t.prototype; - return i.getUA=function(){ - return this._ua} - ,i.test=function(t){ - return t.test(this._ua)} - ,i.parseBrowser=function(){ - var t=this; - this.parsedResult.browser={ - } - ; - var i=o.default.find(e.default,function(i){ - if("function"==typeof i.test)return i.test(t); - if(i.test instanceof Array)return i.test.some(function(i){ - return t.test(i)} - ); - throw new Error("Browser's test function is not valid")} - ); - return i&&(this.parsedResult.browser=i.describe(this.getUA())),this.parsedResult.browser} - ,i.getBrowser=function(){ - return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()} - ,i.getBrowserName=function(t){ - return t?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""} - ,i.getBrowserVersion=function(){ - return this.getBrowser().version} - ,i.getOS=function(){ - return this.parsedResult.os?this.parsedResult.os:this.parseOS()} - ,i.parseOS=function(){ - var t=this; - this.parsedResult.os={ - } - ; - var i=o.default.find(n.default,function(i){ - if("function"==typeof i.test)return i.test(t); - if(i.test instanceof Array)return i.test.some(function(i){ - return t.test(i)} - ); - throw new Error("Browser's test function is not valid")} - ); - return i&&(this.parsedResult.os=i.describe(this.getUA())),this.parsedResult.os} - ,i.getOSName=function(t){ - var i=this.getOS().name; - return t?String(i).toLowerCase()||"":i||""} - ,i.getOSVersion=function(){ - return this.getOS().version} - ,i.getPlatform=function(){ - return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()} - ,i.getPlatformType=function(t){ - void 0===t&&(t=!1); - var i=this.getPlatform().type; - return t?String(i).toLowerCase()||"":i||""} - ,i.parsePlatform=function(){ - var t=this; - this.parsedResult.platform={ - } - ; - var i=o.default.find(h.default,function(i){ - if("function"==typeof i.test)return i.test(t); - if(i.test instanceof Array)return i.test.some(function(i){ - return t.test(i)} - ); - throw new Error("Browser's test function is not valid")} - ); - return i&&(this.parsedResult.platform=i.describe(this.getUA())),this.parsedResult.platform} - ,i.getEngine=function(){ - return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()} - ,i.getEngineName=function(t){ - return t?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""} - ,i.parseEngine=function(){ - var t=this; - this.parsedResult.engine={ - } - ; - var i=o.default.find(r.default,function(i){ - if("function"==typeof i.test)return i.test(t); - if(i.test instanceof Array)return i.test.some(function(i){ - return t.test(i)} - ); - throw new Error("Browser's test function is not valid")} - ); - return i&&(this.parsedResult.engine=i.describe(this.getUA())),this.parsedResult.engine} - ,i.parse=function(){ - return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this} - ,i.getResult=function(){ - return o.default.assign({ - } - ,this.parsedResult)} - ,i.satisfies=function(t){ - var i=this,s={ - } - ,e=0,n={ - } - ,h=0; - if(Object.keys(t).forEach(function(i){ - var r=t[i]; - "string"==typeof r?(n[i]=r,h+=1):"object"==typeof r&&(s[i]=r,e+=1)} - ),e>0){ - var r=Object.keys(s),a=o.default.find(r,function(t){ - return i.isOS(t)} - ); - if(a){ - var c=this.satisfies(s[a]); - if(void 0!==c)return c} - var l=o.default.find(r,function(t){ - return i.isPlatform(t)} - ); - if(l){ - var u=this.satisfies(s[l]); - if(void 0!==u)return u} - } - if(h>0){ - var d=Object.keys(n),f=o.default.find(d,function(t){ - return i.isBrowser(t,!0)} - ); - if(void 0!==f)return this.compareVersion(n[f])} - } - ,i.isBrowser=function(t,i){ - void 0===i&&(i=!1); - var s=this.getBrowserName().toLowerCase(),e=t.toLowerCase(),n=o.default.getBrowserTypeByAlias(e); - return i&&n&&(e=n.toLowerCase()),e===s} - ,i.compareVersion=function(t){ - var i=[0],s=t,e=!1,n=this.getBrowserVersion(); - if("string"==typeof n)return">"===t[0]||"<"===t[0]?(s=t.substr(1),"="===t[1]?(e=!0,s=t.substr(2)):i=[],">"===t[0]?i.push(1):i.push(-1)):"="===t[0]?s=t.substr(1):"~"===t[0]&&(e=!0,s=t.substr(1)),i.indexOf(o.default.compareVersions(n,s,e))>-1} - ,i.isOS=function(t){ - return this.getOSName(!0)===String(t).toLowerCase()} - ,i.isPlatform=function(t){ - return this.getPlatformType(!0)===String(t).toLowerCase()} - ,i.isEngine=function(t){ - return this.getEngineName(!0)===String(t).toLowerCase()} - ,i.is=function(t,i){ - return void 0===i&&(i=!1),this.isBrowser(t,i)||this.isOS(t)||this.isPlatform(t)} - ,i.some=function(t){ - var i=this; - return void 0===t&&(t=[]),t.some(function(t){ - return i.is(t)} - )} - ,t} - (); - i.default=c,t.exports=i.default} - ,92:function(t,i,s){ - i.__esModule=!0,i.default=void 0; - var e,n=(e=s(17))&&e.__esModule?e:{ - default:e} - ,h=/version\/(\d+(\.?_?\d+)+)/i,r=[{ - test:[/googlebot/i],describe:Qt(function(t){ - var i={ - name:"Googlebot"} - ,s=n.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,t)||n.default.getFirstMatch(h,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/opera/i],describe:Qt(function(t){ - var i={ - name:"Opera"} - ,s=n.default.getFirstMatch(h,t)||n.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/opr\/|opios/i],describe:Qt(function(t){ - var i={ - name:"Opera"} - ,s=n.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,t)||n.default.getFirstMatch(h,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/SamsungBrowser/i],describe:Qt(function(t){ - var i={ - name:"Samsung Internet for Android"} - ,s=n.default.getFirstMatch(h,t)||n.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/Whale/i],describe:Qt(function(t){ - var i={ - name:"NAVER Whale Browser"} - ,s=n.default.getFirstMatch(h,t)||n.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/MZBrowser/i],describe:Qt(function(t){ - var i={ - name:"MZ Browser"} - ,s=n.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,t)||n.default.getFirstMatch(h,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/focus/i],describe:Qt(function(t){ - var i={ - name:"Focus"} - ,s=n.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,t)||n.default.getFirstMatch(h,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/swing/i],describe:Qt(function(t){ - var i={ - name:"Swing"} - ,s=n.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,t)||n.default.getFirstMatch(h,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/coast/i],describe:Qt(function(t){ - var i={ - name:"Opera Coast"} - ,s=n.default.getFirstMatch(h,t)||n.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/opt\/\d+(?:.?_?\d+)+/i],describe:Qt(function(t){ - var i={ - name:"Opera Touch"} - ,s=n.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,t)||n.default.getFirstMatch(h,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/yabrowser/i],describe:Qt(function(t){ - var i={ - name:"Yandex Browser"} - ,s=n.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,t)||n.default.getFirstMatch(h,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/ucbrowser/i],describe:Qt(function(t){ - var i={ - name:"UC Browser"} - ,s=n.default.getFirstMatch(h,t)||n.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/Maxthon|mxios/i],describe:Qt(function(t){ - var i={ - name:"Maxthon"} - ,s=n.default.getFirstMatch(h,t)||n.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/epiphany/i],describe:Qt(function(t){ - var i={ - name:"Epiphany"} - ,s=n.default.getFirstMatch(h,t)||n.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/puffin/i],describe:Qt(function(t){ - var i={ - name:"Puffin"} - ,s=n.default.getFirstMatch(h,t)||n.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/sleipnir/i],describe:Qt(function(t){ - var i={ - name:"Sleipnir"} - ,s=n.default.getFirstMatch(h,t)||n.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/k-meleon/i],describe:Qt(function(t){ - var i={ - name:"K-Meleon"} - ,s=n.default.getFirstMatch(h,t)||n.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/micromessenger/i],describe:Qt(function(t){ - var i={ - name:"WeChat"} - ,s=n.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,t)||n.default.getFirstMatch(h,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/qqbrowser/i],describe:Qt(function(t){ - var i={ - name:/qqbrowserlite/i.test(t)?"QQ Browser Lite":"QQ Browser"} - ,s=n.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,t)||n.default.getFirstMatch(h,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/msie|trident/i],describe:Qt(function(t){ - var i={ - name:"Internet Explorer"} - ,s=n.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/\sedg\//i],describe:Qt(function(t){ - var i={ - name:"Microsoft Edge"} - ,s=n.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/edg([ea]|ios)/i],describe:Qt(function(t){ - var i={ - name:"Microsoft Edge"} - ,s=n.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/vivaldi/i],describe:Qt(function(t){ - var i={ - name:"Vivaldi"} - ,s=n.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/seamonkey/i],describe:Qt(function(t){ - var i={ - name:"SeaMonkey"} - ,s=n.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/sailfish/i],describe:Qt(function(t){ - var i={ - name:"Sailfish"} - ,s=n.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/silk/i],describe:Qt(function(t){ - var i={ - name:"Amazon Silk"} - ,s=n.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/phantom/i],describe:Qt(function(t){ - var i={ - name:"PhantomJS"} - ,s=n.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/slimerjs/i],describe:Qt(function(t){ - var i={ - name:"SlimerJS"} - ,s=n.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:Qt(function(t){ - var i={ - name:"BlackBerry"} - ,s=n.default.getFirstMatch(h,t)||n.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/(web|hpw)[o0]s/i],describe:Qt(function(t){ - var i={ - name:"WebOS Browser"} - ,s=n.default.getFirstMatch(h,t)||n.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/bada/i],describe:Qt(function(t){ - var i={ - name:"Bada"} - ,s=n.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/tizen/i],describe:Qt(function(t){ - var i={ - name:"Tizen"} - ,s=n.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,t)||n.default.getFirstMatch(h,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/qupzilla/i],describe:Qt(function(t){ - var i={ - name:"QupZilla"} - ,s=n.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,t)||n.default.getFirstMatch(h,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/firefox|iceweasel|fxios/i],describe:Qt(function(t){ - var i={ - name:"Firefox"} - ,s=n.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/electron/i],describe:Qt(function(t){ - var i={ - name:"Electron"} - ,s=n.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/MiuiBrowser/i],describe:Qt(function(t){ - var i={ - name:"Miui"} - ,s=n.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/chromium/i],describe:Qt(function(t){ - var i={ - name:"Chromium"} - ,s=n.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,t)||n.default.getFirstMatch(h,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/chrome|crios|crmo/i],describe:Qt(function(t){ - var i={ - name:"Chrome"} - ,s=n.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/GSA/i],describe:Qt(function(t){ - var i={ - name:"Google Search"} - ,s=n.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:Qt(function(t){ - var i=!t.test(/like android/i),s=t.test(/android/i); - return i&&s} - ,"test"),describe:Qt(function(t){ - var i={ - name:"Android Browser"} - ,s=n.default.getFirstMatch(h,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/playstation 4/i],describe:Qt(function(t){ - var i={ - name:"PlayStation 4"} - ,s=n.default.getFirstMatch(h,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/safari|applewebkit/i],describe:Qt(function(t){ - var i={ - name:"Safari"} - ,s=n.default.getFirstMatch(h,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/.*/i],describe:Qt(function(t){ - var i=-1!==t.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /; - return{ - name:n.default.getFirstMatch(i,t),version:n.default.getSecondMatch(i,t)} - } - ,"describe")} - ]; - i.default=r,t.exports=i.default} - ,93:function(t,i,s){ - i.__esModule=!0,i.default=void 0; - var e,n=(e=s(17))&&e.__esModule?e:{ - default:e} - ,h=s(18),r=[{ - test:[/Roku\/DVP/],describe:Qt(function(t){ - var i=n.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t); - return{ - name:h.OS_MAP.Roku,version:i} - } - ,"describe")} - ,{ - test:[/windows phone/i],describe:Qt(function(t){ - var i=n.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t); - return{ - name:h.OS_MAP.WindowsPhone,version:i} - } - ,"describe")} - ,{ - test:[/windows /i],describe:Qt(function(t){ - var i=n.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,t),s=n.default.getWindowsVersionName(i); - return{ - name:h.OS_MAP.Windows,version:i,versionName:s} - } - ,"describe")} - ,{ - test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:Qt(function(t){ - var i={ - name:h.OS_MAP.iOS} - ,s=n.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/macintosh/i],describe:Qt(function(t){ - var i=n.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,t).replace(/[_\s]/g,"."),s=n.default.getMacOSVersionName(i),e={ - name:h.OS_MAP.MacOS,version:i} - ; - return s&&(e.versionName=s),e} - ,"describe")} - ,{ - test:[/(ipod|iphone|ipad)/i],describe:Qt(function(t){ - var i=n.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,t).replace(/[_\s]/g,"."); - return{ - name:h.OS_MAP.iOS,version:i} - } - ,"describe")} - ,{ - test:Qt(function(t){ - var i=!t.test(/like android/i),s=t.test(/android/i); - return i&&s} - ,"test"),describe:Qt(function(t){ - var i=n.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,t),s=n.default.getAndroidVersionName(i),e={ - name:h.OS_MAP.Android,version:i} - ; - return s&&(e.versionName=s),e} - ,"describe")} - ,{ - test:[/(web|hpw)[o0]s/i],describe:Qt(function(t){ - var i=n.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,t),s={ - name:h.OS_MAP.WebOS} - ; - return i&&i.length&&(s.version=i),s} - ,"describe")} - ,{ - test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:Qt(function(t){ - var i=n.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,t)||n.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,t)||n.default.getFirstMatch(/\bbb(\d+)/i,t); - return{ - name:h.OS_MAP.BlackBerry,version:i} - } - ,"describe")} - ,{ - test:[/bada/i],describe:Qt(function(t){ - var i=n.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t); - return{ - name:h.OS_MAP.Bada,version:i} - } - ,"describe")} - ,{ - test:[/tizen/i],describe:Qt(function(t){ - var i=n.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t); - return{ - name:h.OS_MAP.Tizen,version:i} - } - ,"describe")} - ,{ - test:[/linux/i],describe:Qt(function(){ - return{ - name:h.OS_MAP.Linux} - } - ,"describe")} - ,{ - test:[/CrOS/],describe:Qt(function(){ - return{ - name:h.OS_MAP.ChromeOS} - } - ,"describe")} - ,{ - test:[/PlayStation 4/],describe:Qt(function(t){ - var i=n.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t); - return{ - name:h.OS_MAP.PlayStation4,version:i} - } - ,"describe")} - ]; - i.default=r,t.exports=i.default} - ,94:function(t,i,s){ - i.__esModule=!0,i.default=void 0; - var e,n=(e=s(17))&&e.__esModule?e:{ - default:e} - ,h=s(18),r=[{ - test:[/googlebot/i],describe:Qt(function(){ - return{ - type:"bot",vendor:"Google"} - } - ,"describe")} - ,{ - test:[/huawei/i],describe:Qt(function(t){ - var i=n.default.getFirstMatch(/(can-l01)/i,t)&&"Nova",s={ - type:h.PLATFORMS_MAP.mobile,vendor:"Huawei"} - ; - return i&&(s.model=i),s} - ,"describe")} - ,{ - test:[/nexus\s*(?:7|8|9|10).*/i],describe:Qt(function(){ - return{ - type:h.PLATFORMS_MAP.tablet,vendor:"Nexus"} - } - ,"describe")} - ,{ - test:[/ipad/i],describe:Qt(function(){ - return{ - type:h.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"} - } - ,"describe")} - ,{ - test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:Qt(function(){ - return{ - type:h.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"} - } - ,"describe")} - ,{ - test:[/kftt build/i],describe:Qt(function(){ - return{ - type:h.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"} - } - ,"describe")} - ,{ - test:[/silk/i],describe:Qt(function(){ - return{ - type:h.PLATFORMS_MAP.tablet,vendor:"Amazon"} - } - ,"describe")} - ,{ - test:[/tablet(?! pc)/i],describe:Qt(function(){ - return{ - type:h.PLATFORMS_MAP.tablet} - } - ,"describe")} - ,{ - test:Qt(function(t){ - var i=t.test(/ipod|iphone/i),s=t.test(/like (ipod|iphone)/i); - return i&&!s} - ,"test"),describe:Qt(function(t){ - var i=n.default.getFirstMatch(/(ipod|iphone)/i,t); - return{ - type:h.PLATFORMS_MAP.mobile,vendor:"Apple",model:i} - } - ,"describe")} - ,{ - test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:Qt(function(){ - return{ - type:h.PLATFORMS_MAP.mobile,vendor:"Nexus"} - } - ,"describe")} - ,{ - test:[/[^-]mobi/i],describe:Qt(function(){ - return{ - type:h.PLATFORMS_MAP.mobile} - } - ,"describe")} - ,{ - test:Qt(function(t){ - return"blackberry"===t.getBrowserName(!0)} - ,"test"),describe:Qt(function(){ - return{ - type:h.PLATFORMS_MAP.mobile,vendor:"BlackBerry"} - } - ,"describe")} - ,{ - test:Qt(function(t){ - return"bada"===t.getBrowserName(!0)} - ,"test"),describe:Qt(function(){ - return{ - type:h.PLATFORMS_MAP.mobile} - } - ,"describe")} - ,{ - test:Qt(function(t){ - return"windows phone"===t.getBrowserName()} - ,"test"),describe:Qt(function(){ - return{ - type:h.PLATFORMS_MAP.mobile,vendor:"Microsoft"} - } - ,"describe")} - ,{ - test:Qt(function(t){ - var i=Number(String(t.getOSVersion()).split(".")[0]); - return"android"===t.getOSName(!0)&&i>=3} - ,"test"),describe:Qt(function(){ - return{ - type:h.PLATFORMS_MAP.tablet} - } - ,"describe")} - ,{ - test:Qt(function(t){ - return"android"===t.getOSName(!0)} - ,"test"),describe:Qt(function(){ - return{ - type:h.PLATFORMS_MAP.mobile} - } - ,"describe")} - ,{ - test:Qt(function(t){ - return"macos"===t.getOSName(!0)} - ,"test"),describe:Qt(function(){ - return{ - type:h.PLATFORMS_MAP.desktop,vendor:"Apple"} - } - ,"describe")} - ,{ - test:Qt(function(t){ - return"windows"===t.getOSName(!0)} - ,"test"),describe:Qt(function(){ - return{ - type:h.PLATFORMS_MAP.desktop} - } - ,"describe")} - ,{ - test:Qt(function(t){ - return"linux"===t.getOSName(!0)} - ,"test"),describe:Qt(function(){ - return{ - type:h.PLATFORMS_MAP.desktop} - } - ,"describe")} - ,{ - test:Qt(function(t){ - return"playstation 4"===t.getOSName(!0)} - ,"test"),describe:Qt(function(){ - return{ - type:h.PLATFORMS_MAP.tv} - } - ,"describe")} - ,{ - test:Qt(function(t){ - return"roku"===t.getOSName(!0)} - ,"test"),describe:Qt(function(){ - return{ - type:h.PLATFORMS_MAP.tv} - } - ,"describe")} - ]; - i.default=r,t.exports=i.default} - ,95:function(t,i,s){ - i.__esModule=!0,i.default=void 0; - var e,n=(e=s(17))&&e.__esModule?e:{ - default:e} - ,h=s(18),r=[{ - test:Qt(function(t){ - return"microsoft edge"===t.getBrowserName(!0)} - ,"test"),describe:Qt(function(t){ - if(/\sedg\//i.test(t))return{ - name:h.ENGINE_MAP.Blink} - ; - var i=n.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,t); - return{ - name:h.ENGINE_MAP.EdgeHTML,version:i} - } - ,"describe")} - ,{ - test:[/trident/i],describe:Qt(function(t){ - var i={ - name:h.ENGINE_MAP.Trident} - ,s=n.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:Qt(function(t){ - return t.test(/presto/i)} - ,"test"),describe:Qt(function(t){ - var i={ - name:h.ENGINE_MAP.Presto} - ,s=n.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:Qt(function(t){ - var i=t.test(/gecko/i),s=t.test(/like gecko/i); - return i&&!s} - ,"test"),describe:Qt(function(t){ - var i={ - name:h.ENGINE_MAP.Gecko} - ,s=n.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ,{ - test:[/(apple)?webkit\/537\.36/i],describe:Qt(function(){ - return{ - name:h.ENGINE_MAP.Blink} - } - ,"describe")} - ,{ - test:[/(apple)?webkit/i],describe:Qt(function(t){ - var i={ - name:h.ENGINE_MAP.WebKit} - ,s=n.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,t); - return s&&(i.version=s),i} - ,"describe")} - ]; - i.default=r,t.exports=i.default} - } - ); - var Ldt=Htt(Ndt.exports); - const Ddt="provider_update",Gdt="connectWithResponse",Bdt="connection_status",Udt="service_status",Fdt=class t{ - constructor({ - shouldSetOnWindow:t,connectionStream:i,shouldSendMetadata:s=!1,shouldShimWeb3:e,sdkInstance:n} - ){ - const h=new Kdt({ - connectionStream:i,shouldSendMetadata:s,shouldSetOnWindow:t,shouldShimWeb3:e,autoRequestAccounts:!1} - ),r=new Proxy(h,{ - deleteProperty:Qt(()=>!0,"deleteProperty")} - ); - if(this.provider=r,this.sdkInstance=n,t&&"undefined"!=typeof window)try{ - o=h,window.ethereum=o,window.dispatchEvent(new Event("ethereum#initialized"))} - catch(a){ - mdt("[Ethereum] Unable to set global provider - window.ethereum may be read-only",a)} - var o; - if(e&&"undefined"!=typeof window)try{ - !function(t,i=console){ - let s=!1,e=!1; - if(!window.web3){ - const n="__isMetaMaskShim__"; - let h={ - currentProvider:t} - ; - Object.defineProperty(h,n,{ - value:!0,enumerable:!0,configurable:!1,writable:!1} - ),h=new Proxy(h,{ - get:Qt((h,r,...o)=>("currentProvider"!==r||s?"currentProvider"===r||r===n||e||(e=!0,i.error("MetaMask no longer injects web3. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3"),t.request({ - method:"metamask_logWeb3ShimUsage"} - ).catch(t=>{ - i.debug("MetaMask: Failed to log web3 shim usage.",t)} - )):(s=!0,i.warn("You are accessing the MetaMask window.web3.currentProvider shim. This property is deprecated; - use window.ethereum instead. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3")),Reflect.get(h,r,...o)),"get"),set:Qt((...t)=>(i.warn("You are accessing the MetaMask window.web3 shim. This object is deprecated; - use window.ethereum instead. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3"),Reflect.set(...t)),"set")} - ),Object.defineProperty(window,"web3",{ - value:h,enumerable:!1,configurable:!0,writable:!0} - )} - } - (this.provider)} - catch(a){ - mdt("[Ethereum] Unable to shim web3 - window.web3 may be read-only",a)} - this.provider.on("display_uri",t=>{ - this.sdkInstance.emit("display_uri",t)} - ),this.provider.on("_initialized",()=>{ - const t={ - chainId:this.provider.getChainId(),isConnected:this.provider.isConnected(),isMetaMask:this.provider.isMetaMask,selectedAddress:this.provider.getSelectedAddress(),networkVersion:this.provider.getNetworkVersion()} - ; - this.sdkInstance.emit("initialized",t),mdt("[Ethereum: constructor()] provider initialized",t)} - )} - static init(i){ - var s; - return mdt("[Ethereum: init()] Initializing Ethereum service"),this.instance=new t(i),null===(s=this.instance)||void 0===s?void 0:s.provider} - static destroy(){ - } - static getInstance(){ - var t; - if(!(null===(t=this.instance)||void 0===t?void 0:t.provider))throw new Error("Ethereum instance not intiialized - call Ethereum.factory first."); - return this.instance} - static getProvider(){ - var t; - if(!(null===(t=this.instance)||void 0===t?void 0:t.provider))throw new Error("Ethereum instance not intiialized - call Ethereum.factory first."); - return this.instance.provider} - } - ; - Qt(Fdt,"qu"); - let $dt=Fdt; - const Hdt=class t{ - constructor({ - useDeepLink:t,preferredOpenLink:i,debug:s=!1} - ){ - this.state={ - platformType:void 0,useDeeplink:!1,preferredOpenLink:void 0,debug:!1} - ,this.state.platformType=this.getPlatformType(),this.state.useDeeplink=t,this.state.preferredOpenLink=i,this.state.debug=s} - openDeeplink(t,i,s){ - return function(t,i,s,e){ - const{ - state:n} - =t; - mdt(`[PlatfformManager: openDeeplink()] universalLink --\x3e ${ - i} - `),mdt(`[PlatfformManager: openDeeplink()] deepLink --\x3e ${ - s} - `); - try{ - if(n.preferredOpenLink)return void n.preferredOpenLink(n.useDeeplink?s:i,e); - if(mdt(`[PlatfformManager: openDeeplink()] open link now useDeepLink=${ - n.useDeeplink} - link=${ - n.useDeeplink?s:i} - `),n.useDeeplink)"undefined"!=typeof window&&(window.location.href=s); - else if("undefined"!=typeof document){ - const t=document.createElement("a"); - t.href=i,t.target="_self",t.rel="noreferrer noopener",t.click()} - } - catch(h){ - } - } - (this,t,i,s)} - isReactNative(){ - var t; - return this.isNotBrowser()&&"undefined"!=typeof window&&(null===window||void 0===window?void 0:window.navigator)&&"ReactNative"===(null===(t=window.navigator)||void 0===t?void 0:t.product)} - isMetaMaskInstalled(){ - return function(){ - const t=$dt.getProvider()||(null===window||void 0===window?void 0:window.ethereum); - return mdt(`[PlatfformManager: isMetaMaskInstalled()] isMetaMask=${ - null==t?void 0:t.isMetaMask} - isConnected=${ - null==t?void 0:t.isConnected()} - `),(null==t?void 0:t.isMetaMask)&&(null==t?void 0:t.isConnected())} - ()} - isDesktopWeb(){ - return this.isBrowser()&&!this.isMobileWeb()} - isMobile(){ - var t,i; - const s=Ldt.parse(window.navigator.userAgent); - return"mobile"===(null===(t=null==s?void 0:s.platform)||void 0===t?void 0:t.type)||"tablet"===(null===(i=null==s?void 0:s.platform)||void 0===i?void 0:i.type)} - isSecure(){ - return this.isReactNative()||this.isMobileWeb()} - isMetaMaskMobileWebView(){ - return"undefined"!=typeof window&&Boolean(window.ReactNativeWebView)&&Boolean(navigator.userAgent.endsWith("MetaMaskMobile"))} - isMobileWeb(){ - return this.state.platformType===Irt.MobileWeb} - static isNotBrowser(){ - var t; - return"undefined"==typeof window||!(null===window||void 0===window?void 0:window.navigator)||void 0!==F9&&"ReactNative"===(null===(t=null==F9?void 0:F9.navigator)||void 0===t?void 0:t.product)||"ReactNative"===(null===navigator||void 0===navigator?void 0:navigator.product)} - isNotBrowser(){ - return t.isNotBrowser()} - static isBrowser(){ - return!this.isNotBrowser()} - isBrowser(){ - return t.isBrowser()} - isNodeJS(){ - return this.isNotBrowser()&&!this.isReactNative()} - isUseDeepLink(){ - return this.state.useDeeplink} - getPlatformType(){ - return function(t){ - const{ - state:i} - =t; - return i.platformType?i.platformType:t.isReactNative()?Irt.ReactNative:t.isNotBrowser()?Irt.NonBrowser:t.isMetaMaskMobileWebView()?Irt.MetaMaskMobileWebview:t.isMobile()?Irt.MobileWeb:Irt.DesktopWeb} - (this)} - } - ; - Qt(Hdt,"Wu"); - let Wdt=Hdt; - const Vdt=Qt(t=>U9(void 0,void 0,void 0,function*(){ - if(Wdt.isBrowser()){ - const{ - StorageManagerWeb:i} - =yield Promise.resolve().then(function(){ - return cpt} - ); - return new i(t)} - const i={ - persistChannelConfig:Qt(()=>U9(void 0,void 0,void 0,function*(){ - } - ),"persistChannelConfig"),getPersistedChannelConfig:Qt(()=>U9(void 0,void 0,void 0,function*(){ - } - ),"getPersistedChannelConfig"),persistAccounts:Qt(()=>U9(void 0,void 0,void 0,function*(){ - } - ),"persistAccounts"),getCachedAccounts:Qt(()=>U9(void 0,void 0,void 0,function*(){ - return[]} - ),"getCachedAccounts"),persistChainId:Qt(()=>U9(void 0,void 0,void 0,function*(){ - } - ),"persistChainId"),getCachedChainId:Qt(()=>U9(void 0,void 0,void 0,function*(){ - } - ),"getCachedChainId"),terminate:Qt(()=>U9(void 0,void 0,void 0,function*(){ - } - ),"terminate")} - ; - return Promise.resolve(i)} - ),"Vu"),jdt=class extends gdt{ - constructor({ - connectionStream:t,shouldSendMetadata:i,autoRequestAccounts:s=!1} - ){ - super(t,{ - logger:console,maxEventListeners:100,shouldSendMetadata:i} - ),this.state={ - accounts:null,autoRequestAccounts:!1,providerStateRequested:!1,chainId:"",networkVersion:""} - ,mdt(`[SDKProvider: constructor()] autoRequestAccounts=${ - s} - `),this.state.autoRequestAccounts=s} - forceInitializeState(){ - return U9(this,void 0,void 0,function*(){ - return mdt(`[SDKProvider: forceInitializeState()] autoRequestAccounts=${ - this.state.autoRequestAccounts} - `),this._initializeStateAsync()} - )} - _setConnected(){ - mdt("[SDKProvider: _setConnected()] Setting connected state"),this._state.isConnected=!0} - getState(){ - return this._state} - getSDKProviderState(){ - return this.state} - getSelectedAddress(){ - var t; - const{ - accounts:i} - =this._state; - return i&&0!==i.length?(null===(t=i[0])||void 0===t?void 0:t.toLowerCase())||"":(mdt("[SDKProvider: getSelectedAddress] No accounts found"),null)} - getChainId(){ - return this.state.chainId} - getNetworkVersion(){ - return this.state.networkVersion} - setSDKProviderState(t){ - this.state=Object.assign(Object.assign({ - } - ,this.state),t)} - handleAccountsChanged(t,i){ - return this._handleAccountsChanged(t,i)} - handleDisconnect({ - terminate:t=!1} - ){ - !function({ - terminate:t=!1,instance:i} - ){ - const{ - state:s} - =i; - mdt(`[SDKProvider: handleDisconnect()] cleaning up provider state terminate=${ - t} - `,i),t&&(i._state.accounts=null,i._state.isUnlocked=!1,i._state.isPermanentlyDisconnected=!0,i._state.initialized=!1),i._handleAccountsChanged([]),i._state.isConnected=!1,i.emit("disconnect",_dt.ethErrors.provider.disconnected()),s.providerStateRequested=!1} - ({ - terminate:t,instance:this} - )} - _initializeStateAsync(){ - return U9(this,void 0,void 0,function*(){ - return function(t){ - var i,s; - return U9(this,void 0,void 0,function*(){ - void 0===t.state&&(t.state={ - accounts:null,autoRequestAccounts:!1,providerStateRequested:!1,chainId:""} - ); - const{ - state:e} - =t; - let n; - if(e.providerStateRequested)mdt("[SDKProvider: initializeStateAsync()] initialization already in progress"); - else{ - let r; - e.providerStateRequested=!0; - let o=null,a=!1,c=!1; - const l=yield Vdt({ - enabled:!0} - ); - if(l){ - const t=yield l.getPersistedChannelConfig({ - } - ); - a=null!==(i=null==t?void 0:t.relayPersistence)&&void 0!==i&&i,r=yield l.getCachedChainId(); - const s=yield l.getCachedAccounts(); - s.length>0&&(o=s[0])} - if(mdt(`[SDKProvider: initializeStateAsync()] relayPersistence=${ - a} - `,{ - relayPersistence:a,cachedChainId:r,cachedSelectedAddress:o} - ),a)if(r&&o)n={ - accounts:[o],chainId:r,isUnlocked:!1} - ,c=!0; - else try{ - n=yield t.request({ - method:"metamask_getProviderState"} - )} - catch(h){ - return t._log.error("MetaMask: Failed to get initial state. Please report this bug.",h),void(e.providerStateRequested=!1)} - if(0===(null===(s=null==n?void 0:n.accounts)||void 0===s?void 0:s.length))if(t.getSelectedAddress())n.accounts=[t.getSelectedAddress()]; - else{ - mdt("[SDKProvider: initializeStateAsync()] Fetch accounts remotely."); - const i=yield t.request({ - method:"eth_requestAccounts",params:[]} - ); - n.accounts=i} - t._initializeState(n),e.providerStateRequested=!1,c&&(t._state.isConnected=!0,t.emit("connect",{ - chainId:null==n?void 0:n.chainId} - ))} - } - )} - (this)} - )} - _initializeState(t){ - return mdt("[SDKProvider: _initializeState()]",t),function(t,i,s){ - return mdt("[SDKProvider: initializeState()] set state._initialized to false"),t._state.initialized=!1,i(s)} - (this,super._initializeState.bind(this),t)} - _handleChainChanged({ - chainId:t,networkVersion:i} - ={ - } - ){ - this.state.chainId=t,this.state.networkVersion=i,function({ - instance:t,chainId:i,networkVersion:s,superHandleChainChanged:e} - ){ - mdt(`[SDKProvider: handleChainChanged()] chainId=${ - i} - networkVersion=${ - s} - `); - let n=s; - s||(mdt("[SDKProvider: handleChainChanged()] forced network version to prevent provider error"),n="1"),i!==vdt&&(A8.analytics.track("sdk_used_chain",{ - caip_chain_id:`eip155:${ - parseInt(null!=i?i:"0x1",16)} - `} - ),vdt=i),t._state.isConnected=!0,t.emit("connect",{ - chainId:i} - ),e({ - chainId:i,networkVersion:n} - )} - ({ - instance:this,chainId:t,networkVersion:i,superHandleChainChanged:super._handleChainChanged.bind(this)} - )} - } - ; - Qt(jdt,"Gu"); - let Kdt=jdt; - var zdt,Ydt="0.34.0"; - !function(t){ - t.INPAGE="metamask-inpage",t.CONTENT_SCRIPT="metamask-contentscript",t.PROVIDER="metamask-provider"} - (zdt||(zdt={ - } - )); - const qdt="https://metamask.app.link/connect",Xdt="metamask://connect",Jdt={ - NAME:"MetaMask",RDNS:["io.metamask","io.metamask.flask"]} - ,Qdt=/(?:^[a-f0-9]{ - 8} - -[a-f0-9]{ - 4} - -4[a-f0-9]{ - 3} - -[a-f0-9]{ - 4} - -[a-f0-9]{ - 12} - $)|(?:^0{ - 8} - -0{ - 4} - -0{ - 4} - -0{ - 4} - -0{ - 12} - $)/u,Zdt={ - METAMASK_GETPROVIDERSTATE:"metamask_getProviderState",METAMASK_CONNECTSIGN:"metamask_connectSign",METAMASK_CONNECTWITH:"metamask_connectWith",METAMASK_OPEN:"metamask_open",METAMASK_BATCH:"metamask_batch",PERSONAL_SIGN:"personal_sign",WALLET_REQUESTPERMISSIONS:"wallet_requestPermissions",WALLET_REVOKEPERMISSIONS:"wallet_revokePermissions",WALLET_GETPERMISSIONS:"wallet_getPermissions",WALLET_WATCHASSET:"wallet_watchAsset",WALLET_ADDETHEREUMCHAIN:"wallet_addEthereumChain",WALLET_SWITCHETHETHEREUMCHAIN:"wallet_switchEthereumChain",ETH_REQUESTACCOUNTS:"eth_requestAccounts",ETH_ACCOUNTS:"eth_accounts",ETH_CHAINID:"eth_chainId",ETH_SENDTRANSACTION:"eth_sendTransaction",ETH_SIGNTYPEDDATA:"eth_signTypedData",ETH_SIGNTYPEDDATA_V3:"eth_signTypedData_v3",ETH_SIGNTYPEDDATA_V4:"eth_signTypedData_v4",ETH_SIGNTRANSACTION:"eth_signTransaction",ETH_SIGN:"eth_sign",PERSONAL_EC_RECOVER:"personal_ecRecover"} - ,tft={ - [Zdt.ETH_REQUESTACCOUNTS]:!0,[Zdt.ETH_SENDTRANSACTION]:!0,[Zdt.ETH_SIGNTRANSACTION]:!0,[Zdt.ETH_SIGN]:!0,[Zdt.PERSONAL_SIGN]:!0,[Zdt.ETH_ACCOUNTS]:!1,[Zdt.ETH_CHAINID]:!1,[Zdt.PERSONAL_SIGN]:!0,[Zdt.ETH_SIGNTYPEDDATA]:!0,[Zdt.ETH_SIGNTYPEDDATA_V3]:!0,[Zdt.ETH_SIGNTYPEDDATA_V4]:!0,[Zdt.WALLET_REQUESTPERMISSIONS]:!0,[Zdt.WALLET_GETPERMISSIONS]:!0,[Zdt.WALLET_WATCHASSET]:!0,[Zdt.WALLET_ADDETHEREUMCHAIN]:!0,[Zdt.WALLET_SWITCHETHETHEREUMCHAIN]:!0,[Zdt.METAMASK_CONNECTSIGN]:!0,[Zdt.METAMASK_CONNECTWITH]:!0,[Zdt.PERSONAL_EC_RECOVER]:!0,[Zdt.METAMASK_BATCH]:!0,[Zdt.METAMASK_OPEN]:!0} - ,ift=Object.keys(tft).filter(t=>!0===tft[t]).map(t=>t.toLowerCase()),sft=["eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sign"].map(t=>t.toLowerCase()),eft=".sdk-comm",nft="providerType",hft=".MMSDK_cached_address",rft=".MMSDK_cached_chainId",oft="chainChanged",aft="accountsChanged",cft="disconnect",lft="connect",uft="connected"; - var dft; - !function(t){ - t.TERMINATE="terminate",t.EXTENSION="extension",t.INITIALIZED="initialized"} - (dft||(dft={ - } - )); - const fft="undefined"!=typeof window&&window.localStorage; - function pft({ - instance:t,msg:i} - ){ - return U9(this,void 0,void 0,function*(){ - if(t._initialized||(mdt("[MetaMaskSDK: connectAndSign()] provider not ready -- wait for init()"),yield t.init()),mdt(`[MetaMaskSDK: connectAndSign()] activeProvider=${ - t.activeProvider} - `),!t.activeProvider)throw new Error("SDK state invalid -- undefined provider"); - const s=/^0x([0-9A-Fa-f]{ - 2} - )*$/u.test(i)?i:function(t){ - let i; - if(void 0!==itt)i=itt.from(t,"utf8").toString("hex"); - else if("undefined"!=typeof TextEncoder){ - const s=(new TextEncoder).encode(t); - i=Array.from(s).map(t=>t.toString(16).padStart(2,"0")).join("")} - else{ - if("object"!=typeof F9||!("Buffer"in F9))throw new Error("Unable to convert string to hex: No available method."); - i=F9.Buffer.from(t,"utf8").toString("hex")} - return`0x${ - i} - `} - (i); - return t.activeProvider.request({ - method:Zdt.METAMASK_CONNECTWITH,params:[{ - method:Zdt.PERSONAL_SIGN,params:[s]} - ]} - )} - )} - function wft(t){ - var i,s; - return U9(this,void 0,void 0,function*(){ - mdt("[MetaMaskSDK: connectWithExtensionProvider()] ",t),t.sdkProvider=t.activeProvider,t.activeProvider=window.extension,window.ethereum=window.extension; - try{ - const t=yield null===(i=window.extension)||void 0===i?void 0:i.request({ - method:"eth_requestAccounts"} - ); - mdt(`[MetaMaskSDK: connectWithExtensionProvider()] accounts=${ - t} - `)} - catch(e){ - return} - localStorage.setItem(nft,"extension"),t.extensionActive=!0,t.emit(Ddt,dft.EXTENSION),t.options.enableAnalytics&&(null===(s=t.analytics)||void 0===s||s.send({ - event:urt.SDK_USE_EXTENSION} - ))} - )} - function gft(t){ - let i; - if(void 0!==itt)i=itt.from(t,"utf8").toString("base64"); - else if("function"==typeof btoa)i=btoa(encodeURIComponent(t).replace(/%([0-9A-F]{ - 2} - )/gu,(t,i)=>String.fromCharCode(parseInt(i,16)))); - else{ - if("object"!=typeof F9||!("Buffer"in F9))throw new Error("Unable to base64 encode: No available method."); - i=F9.Buffer.from(t,"utf8").toString("base64")} - return i} - function mft(t,i,s,e){ - var n,h,r,o,a,c,l,u,d,f,p,w,g,m,v,_,M,b,y,E; - return U9(this,void 0,void 0,function*(){ - const s=null===(n=t.state.remote)||void 0===n?void 0:n.isReady(),A=null===(h=t.state.remote)||void 0===h?void 0:h.isConnected(),S=null===(r=t.state.remote)||void 0===r?void 0:r.isPaused(),T=$dt.getProvider(),C=null===(o=t.state.remote)||void 0===o?void 0:o.getChannelId(),O=null===(a=t.state.remote)||void 0===a?void 0:a.isAuthorized(),{ - deeplinkProtocol:I} - =t.state,{ - method:k,data:x,triggeredInstaller:R} - =(t=>{ - var i,s,e,n; - let h; - itt.isBuffer(t)?(h=t.toJSON(),h._isBuffer=!0):h=t; - const r=null===(i=null==h?void 0:h.data)||void 0===i?void 0:i.method; - let o=!1; - return"object"==typeof(null===(s=null==h?void 0:h.data)||void 0===s?void 0:s.params)&&!0===(null===(n=null===(e=null==h?void 0:h.data)||void 0===e?void 0:e.params)||void 0===n?void 0:n.__triggeredInstaller)&&(o=!0,h.data.params=h.data.params.wrappedParams),{ - method:r,data:h,triggeredInstaller:o} - } - )(i); - if(mdt(`[RCPMS: write()] method='${ - k} - ' isRemoteReady=${ - s} - channelId=${ - C} - isSocketConnected=${ - A} - isRemotePaused=${ - S} - providerConnected=${ - T.isConnected()} - `,i),!C)return k!==Zdt.METAMASK_GETPROVIDERSTATE&&mdt(`[RCPMS: write()] ${ - k} - --\x3e channelId is undefined`),e(new Error("disconnected")); - mdt(`[RCPMS: write()] remote.isPaused()=${ - null===(c=t.state.remote)||void 0===c?void 0:c.isPaused()} - authorized=${ - O} - ready=${ - s} - socketConnected=${ - A} - `,i); - const P=null===(l=t.state.platformManager)||void 0===l?void 0:l.isSecure(),N=null!==(d=null===(u=t.state.platformManager)||void 0===u?void 0:u.isMobileWeb())&&void 0!==d&&d,L=null!==(p=null===(f=t.state.remote)||void 0===f?void 0:f.hasDeeplinkProtocol())&&void 0!==p&&p&&N&&O; - try{ - if(!R){ - const i=JSON.stringify(null==x?void 0:x.data); - if(i.length>1e6)return e(new Error(`Message size ${ - i.length} - exceeds maximum allowed size of 1000000 bytes`)); - null===(w=t.state.remote)||void 0===w||w.sendMessage(null==x?void 0:x.data).then(()=>{ - mdt(`[RCPMS: _write()] ${ - k} - sent successfully`)} - ).catch(t=>{ - mdt("[RCPMS: _write()] error sending message",t)} - )} - if(!P)return mdt(`[RCPMS: _write()] unsecure platform for method ${ - k} - -- return callback`),e(); - if(R)return mdt("[RCPMS: _write()] prevent deeplink -- installation completed separately."),e(); - const i=null!==(v=null===(m=null===(g=t.state.remote)||void 0===g?void 0:g.getKeyInfo())||void 0===m?void 0:m.ecies.public)&&void 0!==v?v:""; - let s=encodeURI(`channelId=${ - C} - &pubkey=${ - i} - &comm=socket&t=d&v=2&hr=${ - t.state.hideReturnToAppNotification?1:0} - `); - if(L){ - const i=JSON.stringify(null==x?void 0:x.data),n=null===(_=t.state.remote)||void 0===_?void 0:_.encrypt(i); - if(!n)return mdt("[RCPMS: _write()] error encrypting message"),e(new Error("RemoteCommunicationPostMessageStream - disconnected")); - s+=`&scheme=${ - I} - &rpc=${ - gft(n)} - `} - if(!(null===(M=t.state.platformManager)||void 0===M?void 0:M.isMetaMaskInstalled()))return mdt("[RCPMS: _write()] prevent deeplink until installation is completed."),e(); - tft[k]?(mdt(`[RCPMS: _write()] redirect link for '${ - k} - ' socketConnected=${ - A} - connect?${ - s} - `),null===(b=t.state.platformManager)||void 0===b||b.openDeeplink(`${ - qdt} - ?${ - s} - `,`${ - Xdt} - ?${ - s} - `,"_self")):(null===(y=t.state.remote)||void 0===y?void 0:y.isPaused())?(mdt(`[RCPMS: _write()] MM is PAUSED! deeplink with connect! targetMethod=${ - k} - `),null===(E=t.state.platformManager)||void 0===E||E.openDeeplink(`${ - qdt} - ?redirect=true&${ - s} - `,`${ - Xdt} - ?redirect=true&${ - s} - `,"_self")):mdt(`[RCPMS: _write()] method ${ - k} - doesn't need redirect.`)} - catch(D){ - return mdt("[RCPMS: _write()] error sending message",D),e(new Error("RemoteCommunicationPostMessageStream - disconnected"))} - return e()} - )} - Qt(pft,"fh"),Qt(wft,"ph"),Qt(gft,"gh"),Qt(mft,"mh"); - const vft=class extends Kut.Duplex{ - constructor({ - name:t,remote:i,deeplinkProtocol:s,hideReturnToAppNotification:e,platformManager:n} - ){ - super({ - objectMode:!0} - ),this.state={ - _name:null,remote:null,deeplinkProtocol:!1,hideReturnToAppNotification:!1,platformManager:null} - ,this.state._name=t,this.state.remote=i,this.state.deeplinkProtocol=s,this.state.hideReturnToAppNotification=null!=e?e:this.state.hideReturnToAppNotification,this.state.platformManager=n,this._onMessage=this._onMessage.bind(this),this.state.remote.on(ort.MESSAGE,this._onMessage)} - _write(t,i,s){ - return U9(this,void 0,void 0,function*(){ - return mft(this,t,0,s)} - )} - _read(){ - } - _onMessage(t){ - return function(t,i){ - try{ - if(mdt("[RCPMS: onMessage()] message",i),!i||"object"!=typeof i)return; - if("object"!=typeof(null==i?void 0:i.data))return; - if(!(null==i?void 0:i.name))return void mdt("[RCPMS: onMessage()] ignore message without name",i); - if((null==i?void 0:i.name)!==zdt.PROVIDER)return void mdt(`[RCPMS: onMessage()] ignore message with wrong name message=${ - i} - `); - if(itt.isBuffer(i)){ - const s=itt.from(i); - t.push(s)} - else t.push(i)} - catch(s){ - mdt(`[RCPMS: onMessage()] ignore message error err=${ - s} - `)} - } - (this,t)} - start(){ - } - } - ; - Qt(vft,"yh"); - let _ft=vft,Mft=1; - const bft=Qt(t=>new Promise(i=>{ - setTimeout(()=>{ - i(!0)} - ,t)} - ),"bh"),yft=Qt(({ - checkInstallationOnAllCalls:t=!1,communicationLayerPreference:i,injectProvider:s,shouldShimWeb3:e,platformManager:n,installer:h,sdk:r,remoteConnection:o,debug:a} - )=>U9(void 0,void 0,void 0,function*(){ - var i,c; - const l=(({ - name:t,remoteConnection:i} - )=>{ - if(!i||!(null==i?void 0:i.getConnector()))throw new Error("Missing remote connection parameter"); - return new _ft({ - name:t,remote:null==i?void 0:i.getConnector(),deeplinkProtocol:null==i?void 0:i.state.deeplinkProtocol,hideReturnToAppNotification:null==i?void 0:i.state.hideReturnToAppNotification,platformManager:null==i?void 0:i.getPlatformManager()} - )} - )({ - name:zdt.INPAGE,target:zdt.CONTENT_SCRIPT,remoteConnection:o} - ),u=n.getPlatformType(),d=r.options.dappMetadata,f=`Sdk/Javascript SdkVersion/${ - Ydt} - Platform/${ - u} - dApp/${ - null!==(i=d.url)&&void 0!==i?i:d.name} - dAppTitle/${ - d.name} - `; - let p=null,w=null; - const g=null===(c=r.options.storage)||void 0===c?void 0:c.storageManager; - if(g){ - try{ - const t=yield g.getCachedAccounts(); - t.length>0&&(p=t[0])} - catch(frt){ - } - try{ - const t=yield g.getCachedChainId(); - t&&(w=t)} - catch(frt){ - } - } - mdt(`[initializeMobileProvider] cachedAccountAddress: ${ - p} - , cachedChainId: ${ - w} - `); - const m=!(!s||u===Irt.NonBrowser||u===Irt.ReactNative),v=$dt.init({ - shouldSetOnWindow:m,connectionStream:l,shouldShimWeb3:e,sdkInstance:r} - ); - let _=!1; - const M=Qt(t=>{ - _=t} - ,"_"),b=Qt(()=>_,"C"),y=Qt((i,s,e,a)=>U9(void 0,void 0,void 0,function*(){ - var c,l,u,d,m,v,y,E,A; - const S=$dt.getProvider(); - if(_){ - S.emit("display_uri",(null==o?void 0:o.state.qrcodeLink)||""),null==o||o.showActiveModal(); - let t=b(); - for(; - t; - ){ - const i=b(),s=null==o?void 0:o.isAuthorized(); - t=i&&!s,mdt(`[initializeMobileProvider: sendRequest()] waiting for initialization to complete - initializing: ${ - i} - authorized: ${ - s} - `),yield bft(1e3)} - return mdt("[initializeMobileProvider: sendRequest()] initial method completed -- prevent installation and call provider"),e(...s)} - const T=n.isMetaMaskInstalled(),C=null==o?void 0:o.isConnected(); - let O=null,I=null,k=null; - if(O=null!==(c=S.getSelectedAddress())&&void 0!==c?c:p,k=S.getChainId()||w,O&&g&&O!==p&&g.persistAccounts([O]).catch(t=>{ - } - ),k&&(w=k,g&&g.persistChainId(k).catch(t=>{ - } - )),mdt("[initializeMobileProvider: sendRequest()]",{ - selectedAddress:O,chainId:k} - ),a&&mdt(`[initializeMobileProvider: sendRequest()] method=${ - i} - ongoing=${ - _} - selectedAddress=${ - O} - isInstalled=${ - T} - checkInstallationOnAllCalls=${ - t} - socketConnected=${ - C} - `),O&&i.toLowerCase()===Zdt.ETH_ACCOUNTS.toLowerCase())return[O]; - if(k&&i.toLowerCase()===Zdt.ETH_CHAINID.toLowerCase())return k; - const x=[Zdt.ETH_REQUESTACCOUNTS,Zdt.WALLET_REQUESTPERMISSIONS,Zdt.METAMASK_CONNECTSIGN,Zdt.METAMASK_CONNECTWITH],R=!tft[i],P=null===(l=r.options.readonlyRPCMap)||void 0===l?void 0:l[k]; - if(P&&R)try{ - const t=null===(u=null==s?void 0:s[0])||void 0===u?void 0:u.params,e=yield(({ - rpcEndpoint:t,method:i,sdkInfo:s,params:e} - )=>U9(void 0,void 0,void 0,function*(){ - const n=JSON.stringify({ - jsonrpc:"2.0",method:i,params:e,id:(Mft+=1,Mft)} - ),h={ - Accept:"application/json","Content-Type":"application/json"} - ; - let r; - t.includes("infura")&&(h["Metamask-Sdk-Info"]=s); - try{ - r=yield k4(t,{ - method:"POST",headers:h,body:n} - )} - catch(frt){ - throw frt instanceof Error?new Error(`Failed to fetch from RPC: ${ - frt.message} - `):new Error(`Failed to fetch from RPC: ${ - frt} - `)} - if(!r.ok)throw new Error(`Server responded with a status of ${ - r.status} - `); - return(yield r.json()).result} - ))({ - rpcEndpoint:P,sdkInfo:f,method:i,params:t||[]} - ); - return a&&mdt(`initializeProvider::ReadOnlyRPCResponse ${ - e} - `),e} - catch(frt){ - } - if((!T||T&&!C)&&i!==Zdt.METAMASK_GETPROVIDERSTATE){ - const a=(null===(d=null==s?void 0:s[0])||void 0===d?void 0:d.params)||[]; - if(-1!==x.indexOf(i)||t){ - M(!0); - const t=i===Zdt.METAMASK_CONNECTWITH,n=`${ - Date.now()} - `; - try{ - yield h.start({ - wait:!1,connectWith:t?{ - method:i,id:n,params:a} - :void 0} - ),yield new Promise((t,i)=>{ - (null==o?void 0:o.isAuthorized())&&(mdt("[initializeMobileProvider: sendRequest()] already authorized"),t(!0)),null==o||o.getConnector().once(ort.AUTHORIZED,()=>{ - t(!0)} - ),r.once(ort.PROVIDER_UPDATE,t=>{ - mdt(`[initializeMobileProvider: sendRequest()] PROVIDER_UPDATE --- remote provider request interupted type=${ - t} - `),t===dft.EXTENSION?i(ort.PROVIDER_UPDATE):i(new Error("Connection Terminated"))} - )} - )} - catch(N){ - if(dft.EXTENSION===N){ - if(mdt(`[initializeMobileProvider: sendRequest()] extension provider detect: re-create ${ - i} - on the active provider`),i.toLowerCase()===Zdt.METAMASK_CONNECTSIGN.toLowerCase()){ - const t=yield null===(m=r.getProvider())||void 0===m?void 0:m.request({ - method:Zdt.ETH_REQUESTACCOUNTS,params:[]} - ); - if(!t.length)throw new Error("SDK state invalid -- undefined accounts"); - const i=yield null===(v=r.getProvider())||void 0===v?void 0:v.request({ - method:Zdt.PERSONAL_SIGN,params:[a[0],t[0]]} - ); - return r.emit(Gdt,i),i} - if(i.toLowerCase()===Zdt.METAMASK_CONNECTWITH.toLowerCase()){ - const[t]=a,i=yield(({ - method:t,sdk:i,params:s} - )=>U9(void 0,void 0,void 0,function*(){ - var e,n,h,r; - if(!i.isExtensionActive())throw new Error("SDK state invalid -- extension is not active"); - mdt("[MetaMaskProvider: extensionConnectWithOverwrite()] Overwriting request method",t,s); - const o=yield null===(e=i.getProvider())||void 0===e?void 0:e.request({ - method:Zdt.ETH_REQUESTACCOUNTS,params:[]} - ); - if(!o.length)throw new Error("SDK state invalid -- undefined accounts"); - if((null==t?void 0:t.toLowerCase())===Zdt.PERSONAL_SIGN.toLowerCase()){ - const e={ - method:t,params:[s[0],o[0]]} - ; - return yield null===(n=i.getProvider())||void 0===n?void 0:n.request(e)} - if((null==t?void 0:t.toLowerCase())===Zdt.ETH_SENDTRANSACTION.toLowerCase()){ - const e={ - method:t,params:[Object.assign(Object.assign({ - } - ,s[0]),{ - from:o[0]} - )]} - ; - return yield null===(h=i.getProvider())||void 0===h?void 0:h.request(e)} - return sft.includes(t.toLowerCase())?o:yield null===(r=i.getProvider())||void 0===r?void 0:r.request({ - method:t,params:s} - )} - ))({ - method:t.method,sdk:r,params:t.params} - ); - return r.emit(Gdt,i),i} - return mdt(`[initializeMobileProvider: sendRequest()] sending '${ - i} - ' on active provider`,a),yield null===(y=r.getProvider())||void 0===y?void 0:y.request({ - method:i,params:a} - )} - if(N===ort.REJECTED)throw null==o||o.closeModal(),null===(E=r.getProvider())||void 0===E||E.handleDisconnect({ - terminate:!1} - ),Object.assign(new Error("User rejected connection"),{ - code:4001} - ); - throw mdt(`[initializeMobileProvider: sendRequest()] failed to start installer: ${ - N} - `),N} - finally{ - M(!1)} - if(i===Zdt.ETH_REQUESTACCOUNTS)return I=yield new Promise(t=>{ - const i=setInterval(()=>{ - const{ - accounts:s} - =S.getState(); - s&&(clearInterval(i),t(s))} - ,100)} - ),mdt(`[initializeMobileProvider: sendRequest()] selectedAddress: ${ - O} - --- SKIP rpc call`),I; - if(i===Zdt.METAMASK_CONNECTWITH)try{ - let t=0; - const i=5,s=Qt(({ - resolve:s,reject:e} - )=>{ - t+=1; - const h=null==o?void 0:o.getConnector().getRPCMethodTracker(),a=null==h?void 0:h[n]; - return mdt(`TRACKER: update method ${ - n} - `,a),(null==a?void 0:a.result)?(mdt("[initializeMobileProvider: sendRequest()] found result",a.result),r.emit(Gdt,a.result),void s(a.result)):(null==a?void 0:a.error)?(mdt("[initializeMobileProvider: sendRequest()] found error",a.error),void e(a.error)):t>=i?(mdt("[initializeMobileProvider: sendRequest()] max message count reached without result"),void e(new Error("Max message count reached without result"))):void mdt("[initializeMobileProvider: sendRequest()] not found yet, need to wait for next update")} - ,"n"); - let e,h; - const a=yield new Promise((t,i)=>{ - const r=null==o?void 0:o.getConnector().getRPCMethodTracker(); - mdt(`TRACKER: method ${ - n} - `,r),(null==r?void 0:r[n].result)?(mdt("[initializeMobileProvider: sendRequest()] found result",null==r?void 0:r[n].result),t(null==r?void 0:r[n].result)):(null==r?void 0:r[n].error)&&(mdt("[initializeMobileProvider: sendRequest()] found error",null==r?void 0:r[n].error),i(null==r?void 0:r[n].error)),h=Qt(()=>s({ - resolve:t,reject:i} - ),"i"),e=null==o?void 0:o.getConnector().on(ort.RPC_UPDATE,h)} - ); - return h&&(null==e||e.off(ort.RPC_UPDATE,h)),mdt("TRACKER: result",a),a} - catch(L){ - throw mdt("[initializeMobileProvider: sendRequest()] error:",L),L} - return s[0]&&"object"==typeof s[0]&&(s[0].params={ - __triggeredInstaller:!0,wrappedParams:s[0].params} - ),e(...s)} - if(n.isSecure()&&tft[i])return e(...s); - if(r.isExtensionActive())return mdt(`[initializeMobileProvider: sendRequest()] EXTENSION active - redirect request '${ - i} - ' to it`,s,a),yield null===(A=r.getProvider())||void 0===A?void 0:A.request({ - method:i,params:a} - ); - throw mdt(`[initializeMobileProvider: sendRequest()] method=${ - i} - --- skip --- not connected/installed`),new Error("MetaMask is not connected/installed, please call eth_requestAccounts to connect first.")} - try{ - const t=yield e(...s); - if(mdt(`[initializeMobileProvider: sendRequest()] method=${ - i} - rpcResponse`,t),i===Zdt.WALLET_REQUESTPERMISSIONS){ - const i=t.reduce((t,i)=>{ - var s; - if("eth_accounts"===i.parentCapability){ - const e=null===(s=i.caveats.find(t=>"restrictReturnedAccounts"===t.type))||void 0===s?void 0:s.value; - e&&t.push(...e)} - return t} - ,[]); - mdt("[initializeMobileProvider: sendRequest()] accountsToPersist:",i),i.length>0&&(S.handleAccountsChanged(i,!1),null==g||g.persistAccounts(i))} - return t} - catch(frt){ - throw frt} - } - ),"k"),{ - request:E} - =v; - v.request=(...t)=>U9(void 0,void 0,void 0,function*(){ - return y(null==t?void 0:t[0].method,t,E,a)} - ); - const{ - send:A} - =v; - return v.send=(...t)=>U9(void 0,void 0,void 0,function*(){ - return y(null==t?void 0:t[0],t,A,a)} - ),mdt("[initializeMobileProvider: sendRequest()] metamaskStream.start()"),l.start(),v} - ),"wh"); - function Eft(t){ - var i,s,e,n; - return U9(this,void 0,void 0,function*(){ - const{ - options:h} - =t,r={ - communicationLayerPreference:null!==(i=h.communicationLayerPreference)&&void 0!==i?i:Ort.SOCKET,platformManager:t.platformManager,sdk:t,checkInstallationOnAllCalls:h.checkInstallationOnAllCalls,injectProvider:null===(s=h.injectProvider)||void 0===s||s,shouldShimWeb3:null===(e=h.shouldShimWeb3)||void 0===e||e,extensionOnly:null===(n=h.extensionOnly)||void 0===n||n,installer:t.installer,remoteConnection:t.remoteConnection,debug:t.debug} - ,o=yield yft(r); - t.activeProvider=o,function(t){ - var i,s,e,n; - null===(s=null===(i=t.remoteConnection)||void 0===i?void 0:i.getConnector())||void 0===s||s.on(Bdt,i=>{ - t.emit(Bdt,i)} - ),null===(n=null===(e=t.remoteConnection)||void 0===e?void 0:e.getConnector())||void 0===n||n.on(Udt,i=>{ - t.emit(Udt,i)} - )} - (t)} - )} - Qt(Eft,"Eh"); - const Aft=class{ - constructor({ - serverUrl:t,enabled:i,originatorInfo:s} - ){ - this.serverURL=Zht,this.serverURL=t,this.originatorInfo=s,this.enabled=null==i||i} - send({ - event:t,params:i} - ){ - if(!this.enabled)return; - const s=Object.assign(Object.assign({ - id:"sdk",event:t,sdkVersion:Ydt} - ,this.originatorInfo),{ - params:i} - ); - mdt(`[Analytics: send()] event: ${ - t} - `,s),qht(s,this.serverURL).catch(t=>{ - mdt(`[Analytics: send()] error: ${ - t} - `)} - )} - } - ; - Qt(Aft,"_h"); - let Sft=Aft; - const Tft=Qt(()=>{ - if("undefined"==typeof document)return; - let t; - const i=document.getElementsByTagName("link"); - for(let s=0; - s<i.length; - s++)"icon"!==i[s].getAttribute("rel")&&"shortcut icon"!==i[s].getAttribute("rel")||(t=i[s].getAttribute("href")); - return t} - ,"Ch"); - function Cft(t){ - var i,s,e; - const{ - dappMetadata:n} - =t,h=function({ - url:t,name:i} - ){ - var s; - const e=gft(t+i); - if(!localStorage)return""; - let n=null!==(s=localStorage.getItem(e))&&void 0!==s?s:""; - if(!n){ - n=$8(); - try{ - localStorage.setItem(e,n)} - catch(h){ - return""} - } - return n} - ({ - url:null!==(i=null==n?void 0:n.url)&&void 0!==i?i:"no_url",name:null!==(s=null==n?void 0:n.name)&&void 0!==s?s:"no_name"} - ),r=null===(e=t.platformManager)||void 0===e?void 0:e.getPlatformType(),o=r===Irt.DesktopWeb,a=r===Irt.MetaMaskMobileWebview; - let c="N/A"; - return o?c="extension":a&&(c="mobile"),{ - id:h,from:c} - } - Qt(Cft,"Ah"); - const Oft=Qt((t,i,s)=>{ - if(nrt(t))if(s||i&&"object"==typeof i&&null!==i&&"error"in i){ - const e=s||(null==i?void 0:i.error); - e&&4001===e.code?A8.analytics.track("sdk_action_rejected",{ - action:t} - ):A8.analytics.track("sdk_action_failed",{ - action:t} - )} - else A8.analytics.track("sdk_action_succeeded",{ - action:t} - )} - ,"xh"),Ift=Qt(({ - provider:t,sdkInstance:i} - )=>{ - if("state"in t)throw new Error("INVALID EXTENSION PROVIDER"); - return new Proxy(t,{ - get:Qt((s,e)=>"request"===e?function(t){ - var e,n; - return U9(this,void 0,void 0,function*(){ - mdt("[wrapExtensionProvider()] Overwriting request method",t); - const{ - method:h,params:r} - =t,o=ift.includes(h.toLowerCase()),{ - id:a,from:c} - =Cft(i); - if(o&&(null===(e=i.analytics)||void 0===e||e.send({ - event:urt.SDK_RPC_REQUEST,params:{ - method:h,from:c,id:a} - } - )),nrt(h)&&A8.analytics.track("sdk_action_requested",{ - action:h} - ),h===Zdt.METAMASK_BATCH&&Array.isArray(r))return(({ - target:t,args:i,trackEvent:s,sdkInstance:e} - )=>U9(void 0,void 0,void 0,function*(){ - var n,h; - if("metamask_batch"!==i.method)throw new Error("Invalid usage"); - const r=[],o=null!==(n=null==i?void 0:i.params)&&void 0!==n?n:[]; - for(const i of o){ - const s=yield null==t?void 0:t.request({ - method:i.method,params:i.params} - ); - r.push(s)} - const{ - id:a,from:c} - =Cft(e); - s&&(null===(h=e.analytics)||void 0===h||h.send({ - event:urt.SDK_RPC_REQUEST_DONE,params:{ - method:i.method,from:c,id:a} - } - )); - for(const t of r)Oft(i.method,t,null); - return r} - ))({ - target:s,args:t,trackEvent:o,sdkInstance:i} - ); - if(h.toLowerCase()===Zdt.METAMASK_CONNECTSIGN.toLowerCase()&&Array.isArray(r))return(({ - target:t,params:i} - )=>U9(void 0,void 0,void 0,function*(){ - let s,e=null; - try{ - const e=yield t.request({ - method:Zdt.ETH_REQUESTACCOUNTS,params:[]} - ); - if(!e.length)throw new Error("SDK state invalid -- undefined accounts"); - return s=yield t.request({ - method:Zdt.PERSONAL_SIGN,params:[i[0],e[0]]} - ),s} - catch(n){ - throw e=n,n} - finally{ - Oft(Zdt.PERSONAL_SIGN,s,e)} - } - ))({ - target:s,params:r} - ); - if(h.toLowerCase()===Zdt.METAMASK_CONNECTWITH.toLowerCase()&&Array.isArray(r))return(({ - target:t,params:i} - )=>U9(void 0,void 0,void 0,function*(){ - const[s]=i,e=s.method,n=s.params; - let h,r=null; - try{ - const i=yield t.request({ - method:Zdt.ETH_REQUESTACCOUNTS,params:[]} - ); - if(!Array.isArray(i)||!i.length)throw new Error("SDK state invalid -- undefined accounts"); - return(null==e?void 0:e.toLowerCase())===Zdt.PERSONAL_SIGN.toLowerCase()?(h=yield t.request({ - method:e,params:[n[0],i[0]]} - ),h):(null==e?void 0:e.toLowerCase())===Zdt.ETH_SENDTRANSACTION.toLowerCase()?(h=yield t.request({ - method:e,params:[Object.assign(Object.assign({ - } - ,n[0]),{ - from:i[0]} - )]} - ),h):sft.includes(e.toLowerCase())?(h=i,h):(h=yield t.request({ - method:e,params:n} - ),h)} - catch(o){ - throw r=o,o} - finally{ - Oft(e,h,r)} - } - ))({ - target:s,params:r} - ); - let l,u=null; - try{ - return l=yield s.request(t),l} - catch(d){ - throw u=d,d} - finally{ - o&&(null===(n=i.analytics)||void 0===n||n.send({ - event:urt.SDK_RPC_REQUEST_DONE,params:{ - method:h,from:c,id:a} - } - )),Oft(h,l,u)} - } - )} - :"getChainId"===e?function(){ - return t.chainId} - :"getNetworkVersion"===e?function(){ - return t.networkVersion} - :"getSelectedAddress"===e?function(){ - return t.selectedAddress} - :"isConnected"===e?function(){ - return t._state.isConnected} - :s[e],"get")} - )} - ,"Mh"); - var kft; - function xft({ - mustBeMetaMask:t,sdkInstance:i} - ){ - return U9(this,void 0,void 0,function*(){ - if("undefined"==typeof window)throw new Error("window not available"); - try{ - const t=yield new Promise((t,i)=>{ - const s=setTimeout(()=>{ - i(new Error("eip6963RequestProvider timed out"))} - ,500); - window.addEventListener(kft.Announce,i=>{ - const e=i,{ - detail:{ - info:n,provider:h} - ={ - } - } - =e,{ - name:r,rdns:o,uuid:a} - =null!=n?n:{ - } - ; - Qdt.test(a)&&r.startsWith(Jdt.NAME)&&Jdt.RDNS.includes(o)&&(clearTimeout(s),t(h))} - ),window.dispatchEvent(new Event(kft.Request))} - ); - return Ift({ - provider:t,sdkInstance:i} - )} - catch(MT){ - throw new Error("Provider not found")} - } - )} - Qt(xft,"Th"),function(t){ - t.Announce="eip6963:announceProvider",t.Request="eip6963:requestProvider"} - (kft||(kft={ - } - )); - const Rft=Qt(t=>U9(void 0,void 0,void 0,function*(){ - const{ - options:i} - =t,{ - infuraAPIKey:s} - =i; - if(!s)return; - const e={ - "0x1":`https://mainnet.infura.io/v3/${ - s} - `,"0x5":`https://goerli.infura.io/v3/${ - s} - `,"0xaa36a7":`https://sepolia.infura.io/v3/${ - s} - `,"0xe708":`https://linea-mainnet.infura.io/v3/${ - s} - `,"0xe704":`https://linea-goerli.infura.io/v3/${ - s} - `,"0x89":`https://polygon-mainnet.infura.io/v3/${ - s} - `,"0x13881":`https://polygon-mumbai.infura.io/v3/${ - s} - `,"0x45":`https://optimism-mainnet.infura.io/v3/${ - s} - `,"0x1a4":`https://optimism-goerli.infura.io/v3/${ - s} - `,"0xa4b1":`https://arbitrum-mainnet.infura.io/v3/${ - s} - `,"0x66eed":`https://arbitrum-goerli.infura.io/v3/${ - s} - `,"0x2a15c308d":`https://palm-mainnet.infura.io/v3/${ - s} - `,"0x2a15c3083":`https://palm-testnet.infura.io/v3/${ - s} - `,"0xa86a":`https://avalanche-mainnet.infura.io/v3/${ - s} - `,"0xa869":`https://avalanche-fuji.infura.io/v3/${ - s} - `,"0x4e454152":`https://aurora-mainnet.infura.io/v3/${ - s} - `,"0x4e454153":`https://aurora-testnet.infura.io/v3/${ - s} - `,"0x534e5f4d41494e":`https://starknet-mainnet.infura.io/v3/${ - s} - `,"0x534e5f474f45524c49":`https://starknet-goerli.infura.io/v3/${ - s} - `,"0x534e5f474f45524c4932":`https://starknet-goerli2.infura.io/v3/${ - s} - `,"0xa4ec":`https://celo-mainnet.infura.io/v3/${ - s} - `,"0xaef3":`https://celo-alfajores.infura.io/v3/${ - s} - `} - ; - t.options.readonlyRPCMap?t.options.readonlyRPCMap=Object.assign(Object.assign({ - } - ,t.options.readonlyRPCMap),e):t.options.readonlyRPCMap=e} - ),"Rh"),Pft=Qt(t=>U9(void 0,void 0,void 0,function*(){ - const{ - options:i} - =t,{ - readonlyRPCMap:s} - =i; - if(s)try{ - mdt("[MetaMaskSDK: setupReadOnlyRPCProviders()] Setting up Readonly RPC Providers",s),t.setReadOnlyRPCCalls(!0)} - catch(e){ - throw new Error("Invalid Infura Settings")} - } - ),"Ph"); - function Nft(t,i,s,e){ - return new(s||(s=Promise))(function(i,n){ - function h(t){ - try{ - o(e.next(t))} - catch(i){ - n(i)} - } - function r(t){ - try{ - o(e.throw(t))} - catch(i){ - n(i)} - } - function o(t){ - var e; - t.done?i(t.value):(e=t.value,e instanceof s?e:new s(function(t){ - t(e)} - )).then(h,r)} - Qt(h,"o"),Qt(r,"s"),Qt(o,"a"),o((e=e.apply(t,[])).next())} - )} - function Lft(t,i){ - var s,e,n,h,r={ - label:0,sent:Qt(function(){ - if(1&n[0])throw n[1]; - return n[1]} - ,"sent"),trys:[],ops:[]} - ; - return h={ - next:o(0),throw:o(1),return:o(2)} - ,"function"==typeof Symbol&&(h[Symbol.iterator]=function(){ - return this} - ),h; - function o(h){ - return function(o){ - return function(h){ - if(s)throw new TypeError("Generator is already executing."); - for(; - r; - )try{ - if(s=1,e&&(n=2&h[0]?e.return:h[0]?e.throw||((n=e.return)&&n.call(e),0):e.next)&&!(n=n.call(e,h[1])).done)return n; - switch(e=0,n&&(h=[2&h[0],n.value]),h[0]){ - case 0:case 1:n=h; - break; - case 4:return r.label++,{ - value:h[1],done:!1} - ; - case 5:r.label++,e=h[1],h=[0]; - continue; - case 7:h=r.ops.pop(),r.trys.pop(); - continue; - default:if(!((n=(n=r.trys).length>0&&n[n.length-1])||6!==h[0]&&2!==h[0])){ - r=0; - continue} - if(3===h[0]&&(!n||h[1]>n[0]&&h[1]<n[3])){ - r.label=h[1]; - break} - if(6===h[0]&&r.label<n[1]){ - r.label=n[1],n=h; - break} - if(n&&r.label<n[2]){ - r.label=n[2],r.ops.push(h); - break} - n[2]&&r.ops.pop(),r.trys.pop(); - continue} - h=i.call(t,r)} - catch(o){ - h=[6,o],e=0} - finally{ - s=n=0} - if(5&h[0])throw h[1]; - return{ - value:h[0]?h[1]:void 0,done:!0} - } - ([h,o])} - } - } - Qt(Nft,"Oh"),Qt(Lft,"Nh"); - var Dft="INSTALLED",Gft="NOT_INSTALLED",Bft="REGISTERED",Uft="REGISTERING",Fft="RELOADING",$ft={ - CHROME:"https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",FIREFOX:"https://addons.mozilla.org/firefox/addon/ether-metamask/",DEFAULT:"https://metamask.io"} - ,Hft="REGISTRATION_IN_PROGRESS",Wft="FORWARDER_ID",Vft=function(){ - function t(i){ - var s=void 0===i?{ - } - :i,e=s.forwarderOrigin,n=void 0===e?"https://fwd.metamask.io":e,h=s.forwarderMode,r=void 0===h?t.FORWARDER_MODE.INJECT:h; - this.forwarderOrigin=n,this.forwarderMode=r,this.state=t.isMetaMaskInstalled()?Dft:Gft; - var o=t._detectBrowser(); - this.downloadUrl=o?$ft[o]:$ft.DEFAULT,this._onMessage=this._onMessage.bind(this),this._onMessageFromForwarder=this._onMessageFromForwarder.bind(this),this._openForwarder=this._openForwarder.bind(this),this._openDownloadPage=this._openDownloadPage.bind(this),this.startOnboarding=this.startOnboarding.bind(this),this.stopOnboarding=this.stopOnboarding.bind(this),window.addEventListener("message",this._onMessage),r===t.FORWARDER_MODE.INJECT&&"true"===sessionStorage.getItem(Hft)&&t._injectForwarder(this.forwarderOrigin)} - return Qt(t,"e"),t.prototype._onMessage=function(t){ - if(t.origin===this.forwarderOrigin)return"metamask:reload"===t.data.type?this._onMessageFromForwarder(t):void 0} - ,t.prototype._onMessageUnknownStateError=function(t){ - throw new Error("Unknown state: '"+t+"'")} - ,t.prototype._onMessageFromForwarder=function(i){ - return Nft(this,0,void 0,function(){ - return Lft(this,function(s){ - switch(s.label){ - case 0:switch(this.state){ - case Fft:return[3,1]; - case Gft:return[3,2]; - case Dft:return[3,3]; - case Uft:return[3,5]; - case Bft:return[3,6]} - return[3,7]; - case 1:return[3,8]; - case 2:return this.state=Fft,location.reload(),[3,8]; - case 3:return this.state=Uft,[4,t._register()]; - case 4:return s.sent(),this.state=Bft,i.source.postMessage({ - type:"metamask:registrationCompleted"} - ,i.origin),this.stopOnboarding(),[3,8]; - case 5:case 6:return[3,8]; - case 7:this._onMessageUnknownStateError(this.state),s.label=8; - case 8:return[2]} - } - )} - )} - ,t.prototype.startOnboarding=function(){ - sessionStorage.setItem(Hft,"true"),this._openDownloadPage(),this._openForwarder()} - ,t.prototype.stopOnboarding=function(){ - "true"===sessionStorage.getItem(Hft)&&(this.forwarderMode===t.FORWARDER_MODE.INJECT&&t._removeForwarder(),sessionStorage.setItem(Hft,"false"))} - ,t.prototype._openForwarder=function(){ - this.forwarderMode===t.FORWARDER_MODE.OPEN_TAB?window.open(this.forwarderOrigin,"_blank"):t._injectForwarder(this.forwarderOrigin)} - ,t.prototype._openDownloadPage=function(){ - window.open(this.downloadUrl,"_blank")} - ,t.isMetaMaskInstalled=function(){ - return Boolean(window.ethereum&&window.ethereum.isMetaMask)} - ,t._register=function(){ - return window.ethereum.request({ - method:"wallet_registerOnboarding"} - )} - ,t._injectForwarder=function(t){ - var i=document.body,s=document.createElement("iframe"); - s.setAttribute("height","0"),s.setAttribute("width","0"),s.setAttribute("style","display: none; - "),s.setAttribute("src",t),s.setAttribute("id",Wft),i.insertBefore(s,i.children[0])} - ,t._removeForwarder=function(){ - var t; - null===(t=document.getElementById(Wft))||void 0===t||t.remove()} - ,t._detectBrowser=function(){ - var t=Ldt.parse(window.navigator.userAgent); - return"Firefox"===t.browser.name?"FIREFOX":["Chrome","Chromium"].includes(t.browser.name||"")?"CHROME":null} - ,t.FORWARDER_MODE={ - INJECT:"INJECT",OPEN_TAB:"OPEN_TAB"} - ,t} - (); - function jft(t,{ - wait:i=!1} - ){ - return U9(this,void 0,void 0,function*(){ - return mdt(`[MetamaskInstaller: startInstaller()] wait=${ - i} - `),i&&(yield bft(1e3)),yield t.checkInstallation()} - )} - Qt(jft,"zh"); - const Kft=class{ - constructor({ - remote:t,preferDesktop:i,platformManager:s,debug:e=!1} - ){ - this.state={ - isInstalling:!1,hasInstalled:!1,resendRequest:null,preferDesktop:!1,platformManager:null,remote:null,debug:!1,connectWith:void 0} - ,this.state.remote=t,this.state.preferDesktop=i,this.state.platformManager=s,this.state.debug=e} - startDesktopOnboarding(){ - return function(){ - return U9(this,void 0,void 0,function*(){ - mdt("[MetamaskInstaller: startDesktopOnboarding() starting desktop onboarding"),window.ethereum&&(window.ethereum=void 0),(new Vft).startOnboarding()} - )} - ()} - redirectToProperInstall(){ - return U9(this,void 0,void 0,function*(){ - return function(t){ - var i,s; - return U9(this,void 0,void 0,function*(){ - const{ - state:e} - =t,n=null===(i=e.platformManager)||void 0===i?void 0:i.getPlatformType(); - if(mdt(`[MetamaskInstaller: redirectToProperInstall()] platform=${ - n} - `),n===Irt.MetaMaskMobileWebview)return!1; - e.isInstalling=!0; - try{ - yield null===(s=e.remote)||void 0===s?void 0:s.startConnection({ - connectWith:e.connectWith} - ),e.isInstalling=!1,e.hasInstalled=!0} - catch(h){ - throw e.isInstalling=!1,h} - return!0} - )} - (this)} - )} - checkInstallation(){ - return U9(this,void 0,void 0,function*(){ - return function(t){ - var i; - return U9(this,void 0,void 0,function*(){ - const{ - state:s} - =t,e=null===(i=s.platformManager)||void 0===i?void 0:i.isMetaMaskInstalled(); - return mdt(`[MetamaskInstaller: checkInstallation()] isInstalled=${ - e} - `),!!e||(yield t.redirectToProperInstall())} - )} - (this)} - )} - start({ - wait:t=!1,connectWith:i} - ){ - return U9(this,void 0,void 0,function*(){ - this.state.connectWith=i,mdt(`[MetaMaskInstaller: start()] wait=${ - t} - `,i),yield jft(this,{ - wait:t} - )} - )} - } - ; - Qt(Kft,"qh"); - let zft=Kft; - const Yft=class{ - constructor({ - debug:t,sdkVersion:i} - ){ - this.containers={ - install:void 0,pending:void 0,select:void 0} - ,this.defined={ - install:!1,pending:!1,select:!1} - ,this.debug=null!=t&&t,this.sdkVersion=i} - loadComponent(t){ - return U9(this,void 0,void 0,function*(){ - if(!this.defined[t]){ - this.defined[t]=!0; - try{ - (yield Promise.resolve().then(function(){ - return kwt} - )).defineCustomElements()} - catch(Vut){ - } - } - } - )} - renderInstallModal(t){ - var i; - return U9(this,void 0,void 0,function*(){ - this.debug,this.containers.install=t.parentElement,yield this.loadComponent("install"); - const s=document.createElement("mm-install-modal"); - s.link=t.link,s.preferDesktop=t.preferDesktop,s.sdkVersion=null!==(i=t.sdkVersion)&&void 0!==i?i:this.sdkVersion,s.addEventListener("close",({ - detail:{ - shouldTerminate:i} - } - )=>t.onClose(i)),s.addEventListener("startDesktopOnboarding",t.metaMaskInstaller.startDesktopOnboarding),s.addEventListener("trackAnalytics",i=>{ - var s; - return null===(s=t.onAnalyticsEvent)||void 0===s?void 0:s.call(t,i.detail)} - ),t.parentElement.appendChild(s)} - )} - renderSelectModal(t){ - var i; - return U9(this,void 0,void 0,function*(){ - this.containers.select=t.parentElement,yield this.loadComponent("select"); - const s=document.createElement("mm-select-modal"); - s.link=t.link,s.sdkVersion=null!==(i=t.sdkVersion)&&void 0!==i?i:this.sdkVersion,s.preferDesktop=t.preferDesktop,s.addEventListener("close",({ - detail:{ - shouldTerminate:i} - } - )=>t.onClose(i)),s.addEventListener("connectWithExtension",t.connectWithExtension),t.parentElement.appendChild(s),setTimeout(()=>this.updateQRCode(t.link),100)} - )} - renderPendingModal(t){ - var i; - return U9(this,void 0,void 0,function*(){ - this.containers.pending=t.parentElement,yield this.loadComponent("pending"); - const s=document.createElement("mm-pending-modal"); - s.sdkVersion=null!==(i=t.sdkVersion)&&void 0!==i?i:this.sdkVersion,s.displayOTP=t.displayOTP,s.addEventListener("close",t.onClose),s.addEventListener("updateOTPValue",({ - detail:{ - otpValue:i} - } - )=>t.updateOTPValue(i)),t.onDisconnect&&s.addEventListener("disconnect",t.onDisconnect),t.parentElement.appendChild(s)} - )} - updateOTPValue(t){ - const i=Qt(()=>{ - var i; - const s=null===(i=this.containers.pending)||void 0===i?void 0:i.querySelector("mm-pending-modal"); - return!!s&&(s.otpCode=t,!0)} - ,"t"); - setTimeout(()=>{ - i()} - ,800)} - updateQRCode(t){ - var i,s; - const e=null===(i=this.containers.install)||void 0===i?void 0:i.querySelector("mm-install-modal"); - if(e)e.link=t; - else{ - const i=null===(s=this.containers.select)||void 0===s?void 0:s.querySelector("mm-select-modal"); - i&&(i.link=t)} - } - unmount(){ - Object.entries(this.containers).forEach(([t,i])=>{ - var s; - null===(s=null==i?void 0:i.parentNode)||void 0===s||s.removeChild(i),this.containers[t]=void 0} - )} - } - ; - Qt(Yft,"Wh"); - let qft=Yft; - const Xft=Qt(({ - link:t,debug:i,installer:s,terminate:e,connectWithExtension:n,preferDesktop:h,onAnalyticsEvent:r} - )=>{ - let o=null,a=null; - mdt("[UI: InstallModal-web: sdkWebInstallModal()] ################## Installing Modal #################"),mdt(`[UI: InstallModal-web: sdkWebInstallModal()] link=${ - t} - `),mdt(`[UI: InstallModal-web: sdkWebInstallModal()] npx uri-scheme open "${ - t} - " --ios`),mdt(`[UI: InstallModal-web: sdkWebInstallModal()] npx uri-scheme open "${ - t} - " --android`),mdt(`[UI: InstallModal-web: sdkWebInstallModal()] adb shell am start -a android.intent.action.VIEW -d "${ - t} - "`); - const c=Qt(t=>{ - var i; - mdt("[UI: InstallModal-web: sdkWebInstallModal()] installModal-web unmounting install modal -- shouldTerminate:",t,a),(null==a?void 0:a.parentNode)&&(null===(i=a.parentNode)||void 0===i||i.removeChild(a)),a=null,o=null,!0===t&&(null==e||e())} - ,"l"); - return{ - mount:Qt(e=>{ - if(mdt("[UI: InstallModal-web: sdkWebInstallModal()] installModal-web mounting install modal",a),a)return a.style.display="block",void(null==o||o.updateQRCode(e)); - o=new qft({ - debug:i,sdkVersion:Ydt} - ),a=document.createElement("div"),document.body.appendChild(a),window.extension?o.renderSelectModal({ - parentElement:a,connectWithExtension:Qt(()=>{ - c(),null==n||n()} - ,"connectWithExtension"),onClose:c,link:t,preferDesktop:null!=h&&h} - ).catch(t=>{ - } - ):o.renderInstallModal({ - parentElement:a,preferDesktop:null!=h&&h,link:t,metaMaskInstaller:s,onClose:c,onAnalyticsEvent:r} - ).catch(t=>{ - } - )} - ,"mount"),unmount:c} - } - ,"Vh"),Jft=Qt(({ - onDisconnect:t,debug:i} - )=>{ - let s=null,e=null; - const n=Qt(()=>{ - mdt("[UI: pendingModal-web: sdkWebPendingModal()] pendingModal-web unmount",s),(null==s?void 0:s.parentNode)&&s.parentNode.removeChild(s),s=null,e=null} - ,"i"),h=Qt(t=>{ - mdt("[UI: pendingModal-web: sdkWebPendingModal()] pendingModal-web updateOTPValue",t),e&&e.updateOTPValue(t)} - ,"o"),r=Qt(({ - displayOTP:r} - ={ - displayOTP:!0} - )=>{ - mdt("[UI: pendingModal-web: sdkWebPendingModal()] pendingModal-web mount",s),s?s.style.display="block":(e=new qft({ - debug:i,sdkVersion:Ydt} - ),s=document.createElement("div"),document.body.appendChild(s),e.renderPendingModal({ - parentElement:s,onClose:n,onDisconnect:t,updateOTPValue:h,displayOTP:r} - ).catch(t=>{ - } - ))} - ,"s"); - return r(),{ - mount:r,unmount:n,updateOTPValue:h} - } - ,"Gh"); - function Qft(t,i){ - var s,e,n,h; - t.connector||(mdt("[RemoteConnection: initializeConnector()] initialize connector"),t.connector=new Vrt({ - anonId:i.anonId,platformType:i.platformManager.getPlatformType(),communicationLayerPreference:i.communicationLayerPreference,transports:i.transports,dappMetadata:Object.assign(Object.assign({ - } - ,i.dappMetadata),{ - source:i._source} - ),analytics:i.enableAnalytics,communicationServerUrl:i.communicationServerUrl,sdkVersion:Ydt,context:"dapp",ecies:i.ecies,storage:i.storage,logging:i.logging} - ),i.timer&&(mdt("[RemoteConnection: initializeConnector()] reset background timer",i.timer),null===(e=null===(s=i.timer)||void 0===s?void 0:s.stopBackgroundTimer)||void 0===e||e.call(s),null===(h=null===(n=i.timer)||void 0===n?void 0:n.runBackgroundTimer)||void 0===h||h.call(n,()=>!1,1e4)))} - function Zft(t){ - t.listeners.forEach(({ - event:i,handler:s} - )=>{ - var e; - null===(e=t.connector)||void 0===e||e.off(i,s)} - ),t.listeners=[]} - function tpt(t,i,s){ - return U9(this,void 0,void 0,function*(){ - const e=setTimeout(()=>{ - A8.analytics.track("sdk_connection_failed",{ - transport_type:"websocket"} - )} - ,6e4); - return new Promise((n,h)=>{ - if(!t.connector)return void h(new Error("No connector available")); - mdt("[RemoteConnection: connectWithModalInstaller()]",{ - state:t,options:i,linkParams:s} - ); - const r=`${ - t.useDeeplink?Xdt:qdt} - ?${ - s} - `; - !function(t,i,s){ - var e,n,h,r; - t.installModal=null===(n=(e=i.modals).install)||void 0===n?void 0:n.call(e,{ - link:s,preferDesktop:t.preferDesktop,installer:i.getMetaMaskInstaller(),terminate:Qt(()=>{ - mdt("[RemoteConnection: showInstallModal() => terminate()] terminate connection"),i.sdk.terminate().catch(t=>{ - } - )} - ,"terminate"),debug:t.developerMode,connectWithExtension:Qt(()=>{ - var t; - return null===(t=i.connectWithExtensionProvider)||void 0===t||t.call(i),!1} - ,"connectWithExtension"),onAnalyticsEvent:Qt(({ - event:s,params:e} - )=>{ - var n,h,r; - const o=Object.assign(Object.assign({ - } - ,e),{ - sdkVersion:i.sdk.getVersion(),dappId:null===(n=i.dappMetadata)||void 0===n?void 0:n.name,source:i._source,url:null===(h=i.dappMetadata)||void 0===h?void 0:h.url} - ); - null===(r=t.analytics)||void 0===r||r.send({ - event:s,params:o} - )} - ,"onAnalyticsEvent")} - ),null===(r=null===(h=t.installModal)||void 0===h?void 0:h.mount)||void 0===r||r.call(h,s)} - (t,i,r),i.sdk.once(ort.PROVIDER_UPDATE,t=>U9(this,void 0,void 0,function*(){ - if(mdt("[RemoteConnection: connectWithModalInstaller()] once provider_update -- resolving startConnection promise"),t===dft.TERMINATE){ - const t={ - code:4001,message:"User rejected the request."} - ; - return clearTimeout(e),void h(t)} - h(t)} - )),t.connector.once(ort.AUTHORIZED,()=>{ - clearTimeout(e),n()} - ),t.connector.once(ort.REJECTED,()=>{ - clearTimeout(e),h(ort.REJECTED)} - ),t.connector.once(ort.CLIENTS_READY,()=>U9(this,void 0,void 0,function*(){ - mdt("[RemoteConnection: connectWithModalInstaller()] once clients_ready -- resolving startConnection promise"),clearTimeout(e),n()} - ))} - )} - )} - function ipt(t,i){ - function s(i,s){ - var e; - null===(e=t.connector)||void 0===e||e.on(i,s),t.listeners.push({ - event:i,handler:s} - )} - Qt(s,"n"),t.connector&&(Zft(t),s(ort.WALLET_INIT,({ - accounts:t,chainId:i} - )=>U9(this,void 0,void 0,function*(){ - mdt(`[RemoteConnection: setupListeners() => EventType.WALLET_INIT] 'wallet_init' accounts=${ - t} - chainId=${ - i} - `); - const s=$dt.getProvider(); - s._setConnected(); - const e={ - accounts:t,chainId:i,isUnlocked:!1} - ; - s._initializeState(e),s.emit("chainChanged",i),s.emit("accountsChanged",t)} - )),s(ort.AUTHORIZED,()=>U9(this,void 0,void 0,function*(){ - var i,s,e,n; - try{ - mdt("[RemoteConnection: setupListeners() => EventType.AUTHORIZED] 'authorized' closing modals",t.pendingModal,t.installModal); - const h=$dt.getProvider(); - h._setConnected(),null===(s=null===(i=t.pendingModal)||void 0===i?void 0:i.unmount)||void 0===s||s.call(i),null===(n=null===(e=t.installModal)||void 0===e?void 0:e.unmount)||void 0===n||n.call(e,!1),t.otpAnswer=void 0,t.authorized=!0,mdt("[RemoteConnection: setupListeners() => EventType.AUTHORIZED] 'authorized' provider.state",h.getState()),yield h.forceInitializeState()} - catch(h){ - } - } - )),s(ort.TERMINATE,()=>{ - var i,s,e,n,h; - null===(s=null===(i=t.pendingModal)||void 0===i?void 0:i.unmount)||void 0===s||s.call(i),null===(n=null===(e=t.installModal)||void 0===e?void 0:e.unmount)||void 0===n||n.call(e,!0),t.pendingModal=void 0,t.installModal=void 0,t.otpAnswer=void 0,null===(h=t.connector)||void 0===h||h.disconnect({ - terminate:!0} - ),t.authorized=!1,$dt.getProvider().handleDisconnect({ - terminate:!0} - ),Zft(t),mdt("[RemoteConnection: setupListeners()] All listeners cleaned up")} - ))} - function spt(t,i,{ - initialCheck:s,connectWith:e} - ={ - } - ){ - var n,h,r,o,a,c,l,u,d,f,p,w,g,m,v,_,M,b,y; - return U9(this,void 0,void 0,function*(){ - try{ - if(Qft(t,i),!t.connector)throw new Error("no connector defined"); - ipt(t); - const E=$dt.getProvider(); - t.authorized=!1,E.emit("connecting"); - const A=yield null===(n=t.connector)||void 0===n?void 0:n.originatorSessionConnect(); - mdt(`[RemoteConnection: startConnection()] after originatorSessionConnect initialCheck=${ - s} - `,A); - let S=null!==(h=null==A?void 0:A.channelId)&&void 0!==h?h:"",T=null!==(o=null===(r=t.connector.getKeyInfo())||void 0===r?void 0:r.ecies.public)&&void 0!==o?o:"",C=null!==(c=null===(a=t.connector.getKeyInfo())||void 0===a?void 0:a.ecies.private)&&void 0!==c?c:""; - if(s&&!A)return Promise.resolve(); - if(!A&&!s){ - const i=yield t.connector.generateChannelIdConnect(); - S=null!==(l=i.channelId)&&void 0!==l?l:"",T=null!==(u=i.pubKey)&&void 0!==u?u:"",C=null!==(d=i.privKey)&&void 0!==d?d:""; - const s=Date.now(); - null===(f=t.connector.state.storageManager)||void 0===f||f.persistChannelConfig({ - channelId:S,localKey:C,lastActive:s,validUntil:s+irt} - )} - if(s&&(null==A?void 0:A.channelId))return(null===(p=t.connector)||void 0===p?void 0:p.isConnected())||(mdt(`[RemoteConnection: startConnection()] reconnecting to channel initialCheck=${ - s} - `,A),yield null===(w=t.connector)||void 0===w?void 0:w.connectToChannel({ - channelId:S} - )),Promise.resolve(); - A&&!(null===(g=t.connector)||void 0===g?void 0:g.isConnected())&&(mdt("[RemoteConnection: startConnection()] reconnecting to channel",A),yield null===(m=t.connector)||void 0===m?void 0:m.connectToChannel({ - channelId:S} - )); - const O=(null===(v=t.platformManager)||void 0===v?void 0:v.isSecure())?"":"&t=q",I=Ydt,{ - iconUrl:k,name:x,url:R,scheme:P} - =i.dappMetadata||{ - } - ,N=null===(_=t.platformManager)||void 0===_?void 0:_.getPlatformType(); - let L="N/A"; - "undefined"!=typeof window&&window.location&&window.location.hostname?L=window.location.hostname:void 0!==x?L=x:void 0!==R&&(L=R); - const D={ - url:null!=R?R:"",title:null!=x?x:"",icon:k,scheme:null!=P?P:"",apiVersion:I,dappId:L||R||"N/A",anonId:i.anonId,platform:null!=N?N:"",source:null!==(M=i._source)&&void 0!==M?M:""} - ,G=gft(JSON.stringify(D)); - let B=`channelId=${ - S} - &v=2&comm=${ - null!==(b=t.communicationLayerPreference)&&void 0!==b?b:""} - &pubkey=${ - T} - ${ - O} - &originatorInfo=${ - G} - &hr=${ - t.hideReturnToAppNotification?1:0} - `; - if(e){ - B+=`&rpc=${ - gft(JSON.stringify(e))} - `; - const i=t.connector.getRPCMethodTracker(); - i&&(i[`${ - e.id} - `]=Object.assign(Object.assign({ - } - ,e),{ - id:`${ - e.id} - `,timestamp:Date.now()} - ))} - const U=encodeURI(B),F=`${ - t.useDeeplink?Xdt:qdt} - ?${ - B} - `; - if(t.qrcodeLink=F,t.developerMode&&mdt(`[RemoteConnection: startConnection()] qrcodeLink=${ - U} - `),E.emit("display_uri",F),A8.analytics.track("sdk_connection_initiated",{ - transport_type:"websocket"} - ),null===(y=t.platformManager)||void 0===y?void 0:y.isSecure()){ - const i=setTimeout(()=>{ - A8.analytics.track("sdk_connection_failed",{ - transport_type:"websocket"} - )} - ,6e4); - return yield function(t,i){ - var s,e; - return U9(this,void 0,void 0,function*(){ - const n=`${ - qdt} - ?${ - i} - `,h=`${ - Xdt} - ?${ - i} - `; - null===(e=null===(s=t.platformManager)||void 0===s?void 0:s.openDeeplink)||void 0===e||e.call(s,n,h,"_self")} - )} - (t,U),new Promise((s,e)=>{ - var n,h,r; - if(null===(n=t.connector)||void 0===n?void 0:n.isAuthorized())return clearTimeout(i),void s(); - null===(h=t.connector)||void 0===h||h.once(ort.AUTHORIZED,()=>{ - clearTimeout(i),s()} - ),null===(r=t.connector)||void 0===r||r.once(ort.REJECTED,()=>{ - clearTimeout(i),e(ort.REJECTED)} - )} - )} - return tpt(t,i,U)} - catch(E){ - throw E} - } - )} - Qt(Qft,"Yh"),Qt(Zft,"Zh"),Qt(tpt,"Jh"),Qt(ipt,"Qh"),Qt(spt,"Xh"); - const ept=class{ - constructor(t){ - var i,s,e; - this.state={ - connector:void 0,qrcodeLink:void 0,analytics:void 0,developerMode:!1,authorized:!1,reconnection:!1,preferDesktop:!1,deeplinkProtocol:!1,listeners:[],communicationLayerPreference:void 0,platformManager:void 0,pendingModal:void 0,installModal:void 0,otpAnswer:void 0} - ,this.options=t; - const n=!0===(null===(i=t.logging)||void 0===i?void 0:i.developerMode)||!0===(null===(s=t.logging)||void 0===s?void 0:s.sdk); - this.state.developerMode=n,this.state.analytics=t.analytics,this.state.preferDesktop=null!==(e=t.preferDesktop)&&void 0!==e&&e,this.state.useDeeplink=t.sdk.options.useDeeplink,this.state.hideReturnToAppNotification=t.sdk.options.hideReturnToAppNotification,this.state.communicationLayerPreference=t.communicationLayerPreference,this.state.platformManager=t.platformManager,t.modals.install||(t.modals.install=Xft),t.modals.otp||(t.modals.otp=Jft)} - startConnection(t){ - return U9(this,void 0,void 0,function*(){ - return spt(this.state,this.options,t)} - )} - initRemoteCommunication({ - sdkInstance:t} - ){ - var i,s,e; - return U9(this,void 0,void 0,function*(){ - const n=yield null===(s=null===(i=t.options.storage)||void 0===i?void 0:i.storageManager)||void 0===s?void 0:s.getPersistedChannelConfig(); - if(!this.options.ecies){ - const t={ - privateKey:null==n?void 0:n.localKey} - ; - this.options.ecies=t} - Qft(this.state,this.options),yield null===(e=this.getConnector())||void 0===e?void 0:e.initFromDappStorage(),ipt(this.state,this.options)} - )} - showActiveModal(){ - return function(t){ - var i,s,e,n; - t.authorized?mdt("[RemoteConnection: showActiveModal()] already authorized"):t.pendingModal?null===(s=(i=t.pendingModal).mount)||void 0===s||s.call(i):t.installModal&&(null===(n=(e=t.installModal).mount)||void 0===n||n.call(e,t.qrcodeLink||""))} - (this.state)} - closeModal(){ - var t,i,s,e; - null===(i=null===(t=this.state.pendingModal)||void 0===t?void 0:t.unmount)||void 0===i||i.call(t),null===(e=null===(s=this.state.installModal)||void 0===s?void 0:s.unmount)||void 0===e||e.call(s,!1)} - getUniversalLink(){ - if(!this.state.qrcodeLink)throw new Error("connection not started. run startConnection() first."); - return this.state.qrcodeLink} - getChannelConfig(){ - var t; - return null===(t=this.state.connector)||void 0===t?void 0:t.getChannelConfig()} - getKeyInfo(){ - var t; - return null===(t=this.state.connector)||void 0===t?void 0:t.getKeyInfo()} - getConnector(){ - if(!this.state.connector)throw new Error("invalid remote connector"); - return this.state.connector} - getPlatformManager(){ - if(!this.state.platformManager)throw new Error("PlatformManager not available"); - return this.state.platformManager} - isConnected(){ - var t; - return(null===(t=this.state.connector)||void 0===t?void 0:t.isReady())||!1} - isAuthorized(){ - var t; - return(null===(t=this.state.connector)||void 0===t?void 0:t.isAuthorized())||!1} - isPaused(){ - var t; - return null===(t=this.state.connector)||void 0===t?void 0:t.isPaused()} - disconnect(t){ - var i,s,e,n; - mdt("[RemoteConnection: disconnect()]",t),(null==t?void 0:t.terminate)&&($dt.getProvider().handleDisconnect({ - terminate:!0} - ),null===(s=null===(i=this.state.pendingModal)||void 0===i?void 0:i.unmount)||void 0===s||s.call(i),this.state.otpAnswer=void 0),null===(e=this.state.connector)||void 0===e||e.disconnect(t),n=this.state,mdt("[RemoteConnection: cleanupConnector()] cleaning up connector"),n.connector&&(Zft(n),n.connector.disconnect({ - terminate:!0} - ).catch(t=>{ - mdt("[RemoteConnection: cleanupConnector()] error disconnecting connector",t)} - ))} - } - ; - Qt(ept,"ef"); - let npt=ept; - function hpt(t){ - var i,s,e,n,h,r,o,a,c,l,u,d; - return U9(this,void 0,void 0,function*(){ - const{ - options:f} - =t; - if(f.logging=null!==(i=f.logging)&&void 0!==i?i:{ - } - ,f.communicationLayerPreference=null!==(s=f.communicationLayerPreference)&&void 0!==s?s:Ort.SOCKET,void 0!==f.enableDebug&&G4.enable("MM_SDK"),f.enableAnalytics=null===(e=f.enableAnalytics)||void 0===e||e,f.injectProvider=null===(n=f.injectProvider)||void 0===n||n,f.shouldShimWeb3=null===(h=f.shouldShimWeb3)||void 0===h||h,f.extensionOnly=null===(r=f.extensionOnly)||void 0===r||r,f.useDeeplink=null===(o=f.useDeeplink)||void 0===o||o,f.hideReturnToAppNotification=null!==(a=f.hideReturnToAppNotification)&&void 0!==a&&a,f.storage=null!==(c=f.storage)&&void 0!==c?c:{ - enabled:!0} - ,f.headless){ - G4("[MetaMaskSDK: performSDKInitialization()] headless mode enabled"); - const t=Qt(()=>{ - } - ,"e"),i={ - install:Qt(()=>({ - mount:t,unmount:t} - ),"install")} - ,s={ - installer:t} - ; - f.modals=i,f.ui=s} - const p=!0===(null===(l=f.logging)||void 0===l?void 0:l.developerMode); - t.debug=(null===(u=f.logging)||void 0===u?void 0:u.sdk)||p,mdt("[MetaMaskSDK: performSDKInitialization()] options",t.options); - const w=Object.assign({ - } - ,f.logging); - p&&(w.sdk=!0,w.eciesLayer=!0,w.keyExchangeLayer=!0,w.remoteLayer=!0,w.serviceLayer=!0,w.plaintext=!0),yield function(t){ - var i; - return U9(this,void 0,void 0,function*(){ - const{ - options:s} - =t; - t.platformManager=new Wdt({ - useDeepLink:null!==(i=s.useDeeplink)&&void 0!==i&&i,preferredOpenLink:s.openDeeplink,debug:t.debug} - )} - )} - (t),yield function(t){ - var i,s,e,n,h; - return U9(this,void 0,void 0,function*(){ - const{ - options:r} - =t,o=null===(i=t.platformManager)||void 0===i?void 0:i.getPlatformType(); - t.analytics=new Sft({ - serverUrl:null!==(s=r.communicationServerUrl)&&void 0!==s?s:Zht,enabled:r.enableAnalytics,originatorInfo:{ - url:null!==(e=r.dappMetadata.url)&&void 0!==e?e:"",title:null!==(n=r.dappMetadata.name)&&void 0!==n?n:"",dappId:t.getDappId(),platform:null!=o?o:"",source:null!==(h=r._source)&&void 0!==h?h:"",anonId:""} - } - )} - )} - (t),yield function(t){ - var i,s,e; - return U9(this,void 0,void 0,function*(){ - if(!t.options.enableAnalytics)return; - if(!(null===(i=t.platformManager)||void 0===i?void 0:i.isBrowser())&&!(null===(s=t.platformManager)||void 0===s?void 0:s.isReactNative()))return; - const n=t.getVersion(),h=t.getDappId(),r=yield t.getAnonId(),o=null===(e=t.platformManager)||void 0===e?void 0:e.getPlatformType(),a=t.options._source; - A8.analytics.setGlobalProperty("sdk_version",n),A8.analytics.setGlobalProperty("dapp_id",h),A8.analytics.setGlobalProperty("anon_id",r),A8.analytics.setGlobalProperty("platform",o),A8.analytics.setGlobalProperty("integration_type",a),A8.analytics.enable(),A8.analytics.track("sdk_initialized",{ - } - )} - )} - (t),yield function(t){ - var i; - return U9(this,void 0,void 0,function*(){ - const{ - options:s} - =t; - !0!==(null===(i=s.storage)||void 0===i?void 0:i.enabled)||s.storage.storageManager||(s.storage.storageManager=yield Vdt(s.storage))} - )} - (t),yield function(t){ - return U9(this,void 0,void 0,function*(){ - const{ - options:i} - =t,s=/^(http|https):\/\/[^\s]*$/; - if(i.dappMetadata){ - i.dappMetadata.iconUrl&&!s.test(i.dappMetadata.iconUrl)&&(i.dappMetadata.iconUrl=void 0),i.dappMetadata.base64Icon&&i.dappMetadata.base64Icon.length>163400&&(i.dappMetadata.base64Icon=void 0),i.dappMetadata.url&&s.test(i.dappMetadata.url); - const t=Tft(); - if(t&&!i.dappMetadata.iconUrl&&!i.dappMetadata.base64Icon){ - const s=`${ - window.location.protocol} - //${ - window.location.host} - ${ - t} - `; - i.dappMetadata.iconUrl=s} - } - t.dappMetadata=i.dappMetadata} - )} - (t),yield Rft(t),yield Pft(t); - const{ - metamaskBrowserExtension:g,preferExtension:m,shouldReturn:v} - =yield function(t){ - var i,s,e,n; - return U9(this,void 0,void 0,function*(){ - const{ - options:h} - =t; - let r,o=!1,a=!1; - if("undefined"!=typeof window&&window.ethereum&&!(null===(i=t.platformManager)||void 0===i?void 0:i.isMetaMaskMobileWebView())){ - o="extension"===localStorage.getItem(nft); - try{ - r=yield xft({ - mustBeMetaMask:!0,sdkInstance:t} - ),window.extension=r,r.on(oft,i=>{ - mdt(`[MetaMaskSDK: setupExtensionPreferences()] PROPAGATE chainChanged chainId=${ - i} - `),Boolean(t.sdkProvider)&&t.getMobileProvider().emit(oft,i)} - ),r.on(aft,i=>U9(this,void 0,void 0,function*(){ - var s; - mdt(`[MetaMaskSDK: setupExtensionPreferences()] PROPAGATE accountsChanged accounts=${ - i} - `); - const e=Boolean(t.sdkProvider),n=Boolean(t.extensionActive); - if(e&&t.getMobileProvider().emit(aft,i),n&&0===(null==i?void 0:i.length)&&0===(yield null===(s=t.getProvider())||void 0===s?void 0:s.request({ - method:Zdt.WALLET_GETPERMISSIONS,params:[]} - )).length)try{ - yield t.terminate()} - catch(h){ - mdt("[MetaMaskSDK: setupExtensionPreferences()] error terminating on permissions revoked",h)} - } - )),r.on(cft,i=>{ - mdt(`[MetaMaskSDK: setupExtensionPreferences()] PROPAGATE disconnect error=${ - i} - `),Boolean(t.sdkProvider)&&t.getMobileProvider().emit(cft,i)} - ),r.on(lft,i=>{ - mdt(`[MetaMaskSDK: setupExtensionPreferences()] PROPAGATE connect args=${ - i} - `),Boolean(t.sdkProvider)&&t.getMobileProvider().emit(lft,i)} - ),r.on(uft,i=>{ - mdt("[MetaMaskSDK: setupExtensionPreferences()] PROPAGATE connected",i),Boolean(t.sdkProvider)&&t.getMobileProvider().emit(uft,i)} - )} - catch(c){ - window.extension=void 0} - } - else(null===(s=t.platformManager)||void 0===s?void 0:s.isMetaMaskMobileWebView())&&(null===(e=t.analytics)||void 0===e||e.send({ - event:urt.SDK_USE_INAPP_BROWSER} - ),t.activeProvider=Ift({ - provider:window.ethereum,sdkInstance:t} - ),t._initialized=!0,a=!0); - return r&&h.extensionOnly&&(mdt("[MetaMaskSDK: setupExtensionPreferences()] EXTENSION ONLY --- prevent sdk initialization"),null===(n=t.analytics)||void 0===n||n.send({ - event:urt.SDK_USE_EXTENSION} - ),t.activeProvider=r,t.extensionActive=!0,t.extension=r,t._initialized=!0,a=!0),{ - preferExtension:o,shouldReturn:a,metamaskBrowserExtension:r} - } - )} - (t); - if(v)mdt("[MetaMaskSDK: performSDKInitialization()] shouldReturn=true --- prevent sdk initialization"); - else{ - yield function(t,i){ - var s,e,n,h,r; - return U9(this,void 0,void 0,function*(){ - const{ - options:o} - =t,a=Object.assign({ - } - ,o.logging); - t.remoteConnection=new npt({ - anonId:yield t.getAnonId(),preferDesktop:null!==(s=o.preferDesktop)&&void 0!==s&&s,communicationLayerPreference:null!==(e=o.communicationLayerPreference)&&void 0!==e?e:Ort.SOCKET,analytics:t.analytics,dappMetadata:o.dappMetadata,_source:o._source,enableAnalytics:null===(n=o.enableAnalytics)||void 0===n||n,timer:o.timer,sdk:t,platformManager:t.platformManager,transports:o.transports,communicationServerUrl:o.communicationServerUrl,storage:null!==(h=o.storage)&&void 0!==h?h:{ - enabled:!0} - ,getMetaMaskInstaller:Qt(()=>{ - if(!t.installer)throw new Error("Invalid SDK status -- installer not initialized"); - return t.installer} - ,"getMetaMaskInstaller"),logging:a,connectWithExtensionProvider:void 0===i?void 0:()=>wft(t),modals:Object.assign(Object.assign({ - } - ,o.modals),{ - onPendingModalDisconnect:t.terminate.bind(t)} - )} - ),yield t.remoteConnection.initRemoteCommunication({ - sdkInstance:t} - ),t.installer=new zft({ - remote:t.remoteConnection,preferDesktop:null!==(r=o.preferDesktop)&&void 0!==r&&r,platformManager:t.platformManager,debug:t.debug} - )} - )} - (t,g),yield Eft(t),yield function(t,i){ - var s,e; - return U9(this,void 0,void 0,function*(){ - const{ - options:n} - =t; - i?(mdt("[MetaMaskSDK: handleAutoAndExtensionConnections()] preferExtension is detected -- connect with it."),null===(s=t.analytics)||void 0===s||s.send({ - event:urt.SDK_EXTENSION_UTILIZED} - ),wft(t).catch(t=>{ - localStorage.removeItem(nft)} - )):n.checkInstallationImmediately&&(null===(e=t.platformManager)||void 0===e?void 0:e.isDesktopWeb())&&(mdt("[MetaMaskSDK: handleAutoAndExtensionConnections()] checkInstallationImmediately"),t.connect().catch(t=>{ - mdt(`[MetaMaskSDK: handleAutoAndExtensionConnections()] checkInstallationImmediately --- IGNORED --- error on autoconnect _err=${ - t} - `)} - )),t._initialized=!0} - )} - (t,m); - try{ - yield null===(d=t.remoteConnection)||void 0===d?void 0:d.startConnection({ - initialCheck:!0} - )} - catch(_){ - } - t.emit(Ddt,dft.INITIALIZED)} - } - )} - Qt(hpt,"tf"); - const rpt={ - storage:{ - enabled:!0} - ,injectProvider:!0,forceInjectProvider:!1,enableAnalytics:!0,shouldShimWeb3:!0,useDeeplink:!0,hideReturnToAppNotification:!1,extensionOnly:!0,headless:!1,dappMetadata:{ - name:"",url:"",iconUrl:""} - ,_source:"direct",i18nOptions:{ - enabled:!1} - } - ,opt=class extends R8{ - constructor(t){ - var i,s,e; - super(),this.extensionActive=!1,this._initialized=!1,this.sdkInitPromise=void 0,this.debug=!1,this.readonlyRPCCalls=!1,this.availableLanguages=["en"],this.ANON_ID_STORAGE_KEY="mm-sdk-anon-id",G4.disable(),this.options=Object.assign(Object.assign({ - } - ,rpt),t); - const n=!0===(null===(i=this.options.logging)||void 0===i?void 0:i.developerMode); - if(((null===(s=this.options.logging)||void 0===s?void 0:s.sdk)||n)&&G4.enable("MM_SDK"),mdt("[MetaMaskSDK: constructor()]: begin."),this.setMaxListeners(50),!(null===(e=this.options.dappMetadata)||void 0===e?void 0:e.url)){ - if("undefined"==typeof window||"undefined"==typeof document)throw new Error("You must provide dAppMetadata url"); - this.options.dappMetadata=Object.assign(Object.assign({ - } - ,this.options.dappMetadata),{ - url:`${ - window.location.protocol} - //${ - window.location.host} - `} - )} - this.init().then(()=>{ - mdt("[MetaMaskSDK: constructor()]: initialized successfully."),"undefined"!=typeof window&&(window.mmsdk=this)} - ).catch(t=>{ - } - )} - init(){ - return U9(this,void 0,void 0,function*(){ - return function(t){ - var i; - return U9(this,void 0,void 0,function*(){ - if("undefined"!=typeof window&&(null===(i=window.mmsdk)||void 0===i?void 0:i.isInitialized()))return mdt("[MetaMaskSDK: initializeMetaMaskSDK()] already initialized"),Promise.resolve(window.mmsdk); - if(t._initialized)return mdt("[MetaMaskSDK: initializeMetaMaskSDK()] already initialized"),t.sdkInitPromise; - if(t.sdkInitPromise)return mdt("[MetaMaskSDK: initializeMetaMaskSDK()] already initializing"),t.sdkInitPromise; - try{ - t.sdkInitPromise=hpt(t),yield t.sdkInitPromise} - catch(s){ - throw s} - return t.sdkInitPromise} - )} - (this)} - )} - isExtensionActive(){ - return this.extensionActive} - checkExtensionAvailability(){ - var t; - return"undefined"!=typeof window&&Boolean(null===(t=window.ethereum)||void 0===t?void 0:t.isMetaMask)} - connect(){ - return U9(this,void 0,void 0,function*(){ - return function(t){ - return U9(this,void 0,void 0,function*(){ - if(t._initialized||(mdt("[MetaMaskSDK: connect()] provider not ready -- wait for init()"),yield t.init()),mdt(`[MetaMaskSDK: connect()] isExtensionActive=${ - t.isExtensionActive()} - activeProvider`,t.activeProvider),!t.activeProvider)throw new Error("SDK state invalid -- undefined provider"); - const i=t.activeProvider.getSelectedAddress(); - return i?[i]:t.activeProvider.request({ - method:Zdt.ETH_REQUESTACCOUNTS,params:[]} - )} - )} - (this)} - )} - connectAndSign({ - msg:t} - ){ - return U9(this,void 0,void 0,function*(){ - return pft({ - instance:this,msg:t} - )} - )} - connectWith(t){ - return U9(this,void 0,void 0,function*(){ - return function({ - instance:t,rpc:i} - ){ - return U9(this,void 0,void 0,function*(){ - if(t._initialized||(mdt("[MetaMaskSDK: connectWith()] provider not ready -- wait for init()"),yield t.init()),mdt(`[MetaMaskSDK: connectWith()] method: ${ - i.method} - rpc=${ - i} - `),!t.activeProvider)throw new Error("SDK state invalid -- undefined provider"); - return t.activeProvider.request({ - method:Zdt.METAMASK_CONNECTWITH,params:[i]} - )} - )} - ({ - instance:this,rpc:t} - )} - )} - resume(){ - return function(t){ - var i,s,e; - return U9(this,void 0,void 0,function*(){ - if(!(null===(s=null===(i=t.remoteConnection)||void 0===i?void 0:i.getConnector())||void 0===s?void 0:s.isReady()))return mdt("[MetaMaskSDK: resume()] channel is not ready -- starting connection"),void(null===(e=t.remoteConnection)||void 0===e||e.startConnection()); - mdt("[MetaMaskSDK: resume()] channel is ready")} - )} - (this)} - disconnect(){ - return this.terminate()} - isAuthorized(){ - var t; - null===(t=this.remoteConnection)||void 0===t||t.isAuthorized()} - terminate(){ - return function(t){ - var i,s,e; - return U9(this,void 0,void 0,function*(){ - if(!(null===(i=t.platformManager)||void 0===i?void 0:i.isMetaMaskMobileWebView())){ - if(fft&&(window.localStorage.removeItem(nft),window.localStorage.removeItem(rft),window.localStorage.removeItem(hft)),t.extensionActive){ - try{ - yield null===(s=t.activeProvider)||void 0===s?void 0:s.request({ - method:Zdt.WALLET_REVOKEPERMISSIONS,params:[{ - eth_accounts:{ - } - } - ]} - )} - catch(n){ - mdt("[MetaMaskSDK: terminate()] error revoking permissions",n)} - return t.options.extensionOnly?(t.emit(Ddt,dft.TERMINATE),void mdt("[MetaMaskSDK: terminate()] extensionOnly --- prevent switching providers")):(t.activeProvider=t.sdkProvider,window.ethereum=t.activeProvider,t.extensionActive=!1,void t.emit(Ddt,dft.TERMINATE))} - t.emit(Ddt,dft.TERMINATE),mdt(`[MetaMaskSDK: terminate()] remoteConnection=${ - t.remoteConnection} - `),null===(e=t.remoteConnection)||void 0===e||e.disconnect({ - terminate:!0,sendMessage:!0} - )} - } - )} - (this)} - isInitialized(){ - return this._initialized} - setReadOnlyRPCCalls(t){ - this.readonlyRPCCalls=t} - hasReadOnlyRPCCalls(){ - return this.readonlyRPCCalls} - getProvider(){ - if(this.activeProvider)return this.activeProvider} - getMobileProvider(){ - if(!this.sdkProvider)throw new Error("SDK state invalid -- undefined mobile provider"); - return this.sdkProvider} - getUniversalLink(){ - var t; - const i=null===(t=this.remoteConnection)||void 0===t?void 0:t.getUniversalLink(); - if(!i)throw new Error("No Universal Link available, please call eth_requestAccounts first."); - return i} - getChannelId(){ - var t,i; - return null===(i=null===(t=this.remoteConnection)||void 0===t?void 0:t.getChannelConfig())||void 0===i?void 0:i.channelId} - getRPCHistory(){ - var t,i; - return null===(i=null===(t=this.remoteConnection)||void 0===t?void 0:t.getConnector())||void 0===i?void 0:i.getRPCMethodTracker()} - getVersion(){ - return Ydt} - getDappId(){ - var t,i,s,e; - return"undefined"==typeof window||void 0===window.location?null!==(e=null!==(i=null===(t=this.options.dappMetadata)||void 0===t?void 0:t.name)&&void 0!==i?i:null===(s=this.options.dappMetadata)||void 0===s?void 0:s.url)&&void 0!==e?e:"N/A":window.location.hostname} - getAnonId(){ - var t,i; - return U9(this,void 0,void 0,function*(){ - if(this._anonId)return this._anonId; - let s; - return s=(null===(t=this.platformManager)||void 0===t?void 0:t.isBrowser())?this.getBrowserAnonId():(null===(i=this.platformManager)||void 0===i?void 0:i.isReactNative())?yield this.getReactNativeAnonId():$8(),this._anonId=s,s} - )} - getBrowserAnonId(){ - const t=this.ANON_ID_STORAGE_KEY; - try{ - const i=localStorage.getItem(t); - if(i)return i; - const s=$8(); - return localStorage.setItem(t,s),s} - catch(i){ - return $8()} - } - getReactNativeAnonId(){ - return U9(this,void 0,void 0,function*(){ - const t=this.ANON_ID_STORAGE_KEY; - try{ - const i=require("@react-native-async-storage/async-storage").default,s=yield i.getItem(t); - if(s)return s; - const e=$8(); - return yield i.setItem(t,e),e} - catch(i){ - return $8()} - } - )} - getWalletStatus(){ - var t,i; - return null===(i=null===(t=this.remoteConnection)||void 0===t?void 0:t.getConnector())||void 0===i?void 0:i.getConnectionStatus()} - _getChannelConfig(){ - var t; - return null===(t=this.remoteConnection)||void 0===t?void 0:t.getChannelConfig()} - _ping(){ - var t,i; - null===(i=null===(t=this.remoteConnection)||void 0===t?void 0:t.getConnector())||void 0===i||i.ping()} - _keyCheck(){ - var t,i; - null===(i=null===(t=this.remoteConnection)||void 0===t?void 0:t.getConnector())||void 0===i||i.keyCheck()} - _getServiceStatus(){ - var t,i; - return null===(i=null===(t=this.remoteConnection)||void 0===t?void 0:t.getConnector())||void 0===i?void 0:i.getServiceStatus()} - _getRemoteConnection(){ - return this.remoteConnection} - _getDappMetadata(){ - return this.dappMetadata} - _getKeyInfo(){ - var t; - return null===(t=this.remoteConnection)||void 0===t?void 0:t.getKeyInfo()} - _resetKeys(){ - var t,i; - null===(i=null===(t=this.remoteConnection)||void 0===t?void 0:t.getConnector())||void 0===i||i.resetKeys()} - _getConnection(){ - return this.remoteConnection} - emit(t,i){ - return super.emit(t,i)} - on(t,i){ - return super.on(t,i)} - } - ; - Qt(opt,"rf"); - let apt=opt; - var cpt=Object.freeze({ - __proto__:null,StorageManagerWeb:(mt=class{ - constructor({ - enabled:t} - ={ - enabled:!1} - ){ - this.enabled=!1,this.enabled=t} - persistChannelConfig(t){ - return U9(this,void 0,void 0,function*(){ - const i=JSON.stringify(t); - mdt(`[StorageManagerWeb: persistChannelConfig()] enabled=${ - this.enabled} - `,t),localStorage.setItem(eft,i)} - )} - getPersistedChannelConfig(){ - return U9(this,void 0,void 0,function*(){ - let t; - try{ - if(mdt(`[StorageManagerWeb: getPersistedChannelConfig()] enabled=${ - this.enabled} - `),t=localStorage.getItem(eft),mdt("[StorageManagerWeb: getPersistedChannelConfig()]",t),!t)return; - const i=JSON.parse(t); - return mdt("[StorageManagerWeb: getPersistedChannelConfig()] channelConfig",i),i} - catch(i){ - return} - } - )} - persistAccounts(t){ - return U9(this,void 0,void 0,function*(){ - mdt(`[StorageManagerWeb: persistAccounts()] enabled=${ - this.enabled} - `,t); - const i=JSON.stringify(t); - localStorage.setItem(hft,i)} - )} - getCachedAccounts(){ - return U9(this,void 0,void 0,function*(){ - try{ - const t=localStorage.getItem(hft); - return t?JSON.parse(t):[]} - catch(frt){ - throw frt} - } - )} - persistChainId(t){ - return U9(this,void 0,void 0,function*(){ - mdt(`[StorageManagerWeb: persistChainId()] enabled=${ - this.enabled} - `,t),localStorage.setItem(rft,t)} - )} - getCachedChainId(){ - return U9(this,void 0,void 0,function*(){ - try{ - const t=localStorage.getItem(rft); - return null!=t?t:void 0} - catch(frt){ - throw frt} - } - )} - terminate(){ - return U9(this,void 0,void 0,function*(){ - mdt(`[StorageManagerWeb: terminate()] enabled=${ - this.enabled} - `),localStorage.removeItem(eft)} - )} - } - ,Qt(mt,"StorageManagerWeb"),mt)} - ),lpt=Object.defineProperty,upt=new WeakMap,dpt=Qt(t=>upt.get(t),"hf"),fpt=Qt((t,i)=>upt.set(i.$lazyInstance$=t,i),"ff"),ppt=Qt((t,i)=>i in t,"pf"),wpt=Qt((t,i)=>(0,console.error)(t,i),"gf"),gpt=new Map,mpt=new Map,vpt="slot-fb{ - display:contents} - slot-fb[hidden]{ - display:none} - ",_pt="undefined"!=typeof window?window:{ - } - ,Mpt=_pt.document||{ - head:{ - } - } - ,bpt={ - $flags$:0,$resourcesUrl$:"",jmp:Qt(t=>t(),"jmp"),raf:Qt(t=>requestAnimationFrame(t),"raf"),ael:Qt((t,i,s,e)=>t.addEventListener(i,s,e),"ael"),rel:Qt((t,i,s,e)=>t.removeEventListener(i,s,e),"rel"),ce:Qt((t,i)=>new CustomEvent(t,i),"ce")} - ,ypt=(()=>{ - try{ - return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync} - catch(frt){ - } - return!1} - )(),Ept=!1,Apt=[],Spt=[],Tpt=Qt((t,i)=>i=>{ - t.push(i),Ept||(Ept=!0,4&bpt.$flags$?Ipt(Opt):bpt.raf(Opt))} - ,"Af"),Cpt=Qt(t=>{ - for(let s=0; - s<t.length; - s++)try{ - t[s](performance.now())} - catch(i){ - wpt(i)} - t.length=0} - ,"xf"),Opt=Qt(()=>{ - Cpt(Apt),Cpt(Spt),(Ept=Apt.length>0)&&bpt.raf(Opt)} - ,"Mf"),Ipt=Qt(t=>Promise.resolve(void 0).then(t),"If"),kpt=Tpt(Spt),xpt={ - } - ,Rpt=Qt(t=>"object"==(t=typeof t)||"function"===t,"Pf"); - function Ppt(t){ - var i,s,e; - return null!=(e=null==(s=null==(i=t.head)?void 0:i.querySelector('meta[name="csp-nonce"]'))?void 0:s.getAttribute("content"))?e:void 0} - Qt(Ppt,"Of"),((t,i)=>{ - for(var s in i)lpt(t,s,{ - get:i[s],enumerable:!0} - )} - )({ - } - ,{ - err:Qt(()=>Lpt,"err"),map:Qt(()=>Dpt,"map"),ok:Qt(()=>Npt,"ok"),unwrap:Qt(()=>Bpt,"unwrap"),unwrapErr:Qt(()=>Upt,"unwrapErr")} - ); - var Npt=Qt(t=>({ - isOk:!0,isErr:!1,value:t} - ),"Nf"),Lpt=Qt(t=>({ - isOk:!1,isErr:!0,value:t} - ),"Lf"); - function Dpt(t,i){ - if(t.isOk){ - const s=i(t.value); - return s instanceof Promise?s.then(t=>Npt(t)):Npt(s)} - if(t.isErr){ - const i=t.value; - return Lpt(i)} - throw"should never get here"} - Qt(Dpt,"Df"); - var Gpt,Bpt=Qt(t=>{ - if(t.isOk)return t.value; - throw t.value} - ,"Kf"),Upt=Qt(t=>{ - if(t.isErr)return t.value; - throw t.value} - ,"jf"),Fpt=Qt((t,i,...s)=>{ - let e=null,n=!1,h=!1; - const r=[],o=Qt(i=>{ - for(let s=0; - s<i.length; - s++)e=i[s],Array.isArray(e)?o(e):null!=e&&"boolean"!=typeof e&&((n="function"!=typeof t&&!Rpt(e))&&(e=String(e)),n&&h?r[r.length-1].$text$+=e:r.push(n?$pt(null,e):e),h=n)} - ,"a"); - if(o(s),i){ - const t=i.className||i.class; - t&&(i.class="object"!=typeof t?t:Object.keys(t).filter(i=>t[i]).join(" "))} - if("function"==typeof t)return t(null===i?{ - } - :i,r,Wpt); - const a=$pt(t,null); - return a.$attrs$=i,r.length>0&&(a.$children$=r),a} - ,"Uf"),$pt=Qt((t,i)=>({ - $flags$:0,$tag$:t,$text$:i,$elm$:null,$children$:null,$attrs$:null} - ),"Hf"),Hpt={ - } - ,Wpt={ - forEach:Qt((t,i)=>t.map(Vpt).forEach(i),"forEach"),map:Qt((t,i)=>t.map(Vpt).map(i).map(jpt),"map")} - ,Vpt=Qt(t=>({ - vattrs:t.$attrs$,vchildren:t.$children$,vkey:t.$key$,vname:t.$name$,vtag:t.$tag$,vtext:t.$text$} - ),"qf"),jpt=Qt(t=>{ - if("function"==typeof t.vtag){ - const i={ - ...t.vattrs} - ; - return t.vkey&&(i.key=t.vkey),t.vname&&(i.name=t.vname),Fpt(t.vtag,i,...t.vchildren||[])} - const i=$pt(t.vtag,t.vtext); - return i.$attrs$=t.vattrs,i.$children$=t.vchildren,i.$key$=t.vkey,i.$name$=t.vname,i} - ,"Wf"),Kpt=Qt(t=>dpt(t).$hostElement$,"Vf"),zpt=Qt((t,i,s)=>{ - const e=Kpt(t); - return{ - emit:Qt(t=>Ypt(e,i,{ - bubbles:!0,composed:!0,cancelable:!0,detail:t} - ),"emit")} - } - ,"Gf"),Ypt=Qt((t,i,s)=>{ - const e=bpt.ce(i,s); - return t.dispatchEvent(e),e} - ,"Yf"),qpt=new WeakMap,Xpt=Qt(t=>{ - const i=t.$cmpMeta$,s=t.$hostElement$,e=i.$flags$; - i.$tagName$; - const n=((t,i)=>{ - var s; - const e=Jpt(i),n=mpt.get(e); - if(t=11===t.nodeType?t:Mpt,n)if("string"==typeof n){ - t=t.head||t; - let h,r=qpt.get(t); - if(r||qpt.set(t,r=new Set),!r.has(e)){ - { - h=Mpt.createElement("style"),h.innerHTML=n; - const e=null!=(s=bpt.$nonce$)?s:Ppt(Mpt); - if(null!=e&&h.setAttribute("nonce",e),!(1&i.$flags$))if("HEAD"===t.nodeName){ - const i=t.querySelectorAll("link[rel=preconnect]"),s=i.length>0?i[i.length-1].nextSibling:t.querySelector("style"); - t.insertBefore(h,s)} - else if("host"in t)if(ypt){ - const i=new CSSStyleSheet; - i.replaceSync(n),t.adoptedStyleSheets=[i,...t.adoptedStyleSheets]} - else{ - const i=t.querySelector("style"); - i?i.innerHTML=n+i.innerHTML:t.prepend(h)} - else t.append(h); - 1&i.$flags$&&"HEAD"!==t.nodeName&&t.insertBefore(h,null)} - 4&i.$flags$&&(h.innerHTML+=vpt),r&&r.add(e)} - } - else t.adoptedStyleSheets.includes(n)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,n]); - return e} - )(s.shadowRoot?s.shadowRoot:s.getRootNode(),i); - 10&e&&2&e&&(s["s-sc"]=n,s.classList.add(n+"-h"))} - ,"Jf"),Jpt=Qt((t,i)=>"sc-"+t.$tagName$,"Qf"),Qpt=Qt((t,i,s,e,n,h)=>{ - if(s!==e){ - let o=ppt(t,i),a=i.toLowerCase(); - if("class"===i){ - const i=t.classList,n=twt(s),h=twt(e); - i.remove(...n.filter(t=>t&&!h.includes(t))),i.add(...h.filter(t=>t&&!n.includes(t)))} - else if("style"===i){ - for(const i in s)e&&null!=e[i]||(i.includes("-")?t.style.removeProperty(i):t.style[i]=""); - for(const i in e)s&&e[i]===s[i]||(i.includes("-")?t.style.setProperty(i,e[i]):t.style[i]=e[i])} - else if(o||"o"!==i[0]||"n"!==i[1]){ - const a=Rpt(e); - if((o||a&&null!==e)&&!n)try{ - if(t.tagName.includes("-"))t[i]=e; - else{ - const n=null==e?"":e; - "list"===i?o=!1:null!=s&&t[i]==n||("function"==typeof t.__lookupSetter__(i)?t[i]=n:t.setAttribute(i,n))} - } - catch(r){ - } - null==e||!1===e?!1===e&&""!==t.getAttribute(i)||t.removeAttribute(i):(!o||4&h||n)&&!a&&(e=!0===e?"":e,t.setAttribute(i,e))} - else if(i="-"===i[2]?i.slice(3):ppt(_pt,a)?a.slice(2):a[2]+i.slice(3),s||e){ - const n=i.endsWith(iwt); - i=i.replace(swt,""),s&&bpt.rel(t,i,s,n),e&&bpt.ael(t,i,e,n)} - } - } - ,"Xf"),Zpt=/\s/,twt=Qt(t=>t?t.split(Zpt):[],"tp"),iwt="Capture",swt=new RegExp(iwt+"$"),ewt=Qt((t,i,s)=>{ - const e=11===i.$elm$.nodeType&&i.$elm$.host?i.$elm$.host:i.$elm$,n=t&&t.$attrs$||xpt,h=i.$attrs$||xpt; - for(const r of nwt(Object.keys(n)))r in h||Qpt(e,r,n[r],void 0,s,i.$flags$); - for(const r of nwt(Object.keys(h)))Qpt(e,r,n[r],h[r],s,i.$flags$)} - ,"ip"); - function nwt(t){ - return t.includes("ref")?[...t.filter(t=>"ref"!==t),"ref"]:t} - Qt(nwt,"op"); - var hwt=!1,rwt=Qt((t,i,s,e)=>{ - const n=i.$children$[s]; - let h,r,o=0; - if(null!==n.$text$)h=n.$elm$=Mpt.createTextNode(n.$text$); - else{ - if(hwt||(hwt="svg"===n.$tag$),h=n.$elm$=Mpt.createElementNS(hwt?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",n.$tag$),hwt&&"foreignObject"===n.$tag$&&(hwt=!1),ewt(null,n,hwt),h.getRootNode().querySelector("body"),n.$children$)for(o=0; - o<n.$children$.length; - ++o)r=rwt(t,n,o),r&&h.appendChild(r); - "svg"===n.$tag$?hwt=!1:"foreignObject"===h.tagName&&(hwt=!0)} - return h["s-hn"]=Gpt,h} - ,"cp"),owt=Qt((t,i,s,e,n,h)=>{ - let r,o=t; - for(o.shadowRoot&&o.tagName===Gpt&&(o=o.shadowRoot); - n<=h; - ++n)e[n]&&(r=rwt(null,s,n),r&&(e[n].$elm$=r,uwt(o,r,i)))} - ,"lp"),awt=Qt((t,i,s)=>{ - for(let e=i; - e<=s; - ++e){ - const i=t[e]; - if(i){ - const t=i.$elm$; - t&&t.remove()} - } - } - ,"dp"),cwt=Qt((t,i,s=!1)=>t.$tag$===i.$tag$,"up"),lwt=Qt((t,i,s=!1)=>{ - const e=i.$elm$=t.$elm$,n=t.$children$,h=i.$children$,r=i.$tag$,o=i.$text$; - null===o?(ewt(t,i,hwt="svg"===r||"foreignObject"!==r&&hwt),null!==n&&null!==h?((t,i,s,e,n=!1)=>{ - let h,r=0,o=0,a=i.length-1,c=i[0],l=i[a],u=e.length-1,d=e[0],f=e[u]; - for(; - r<=a&&o<=u; - )null==c?c=i[++r]:null==l?l=i[--a]:null==d?d=e[++o]:null==f?f=e[--u]:cwt(c,d,n)?(lwt(c,d,n),c=i[++r],d=e[++o]):cwt(l,f,n)?(lwt(l,f,n),l=i[--a],f=e[--u]):cwt(c,f,n)?(lwt(c,f,n),uwt(t,c.$elm$,l.$elm$.nextSibling),c=i[++r],f=e[--u]):cwt(l,d,n)?(lwt(l,d,n),uwt(t,l.$elm$,c.$elm$),l=i[--a],d=e[++o]):(h=rwt(i&&i[o],s,o),d=e[++o],h&&uwt(c.$elm$.parentNode,h,c.$elm$)); - r>a?owt(t,null==e[u+1]?null:e[u+1].$elm$,s,e,o,u):o>u&&awt(i,r,a)} - )(e,n,i,h,s):null!==h?(null!==t.$text$&&(e.textContent=""),owt(e,null,i,h,0,h.length-1)):!s&&null!==n&&awt(n,0,n.length-1),hwt&&"svg"===r&&(hwt=!1)):t.$text$!==o&&(e.data=o)} - ,"hp"),uwt=Qt((t,i,s)=>null==t?void 0:t.insertBefore(i,s),"fp"),dwt=Qt((t,i,s=!1)=>{ - const e=t.$hostElement$,n=t.$cmpMeta$,h=t.$vnode$||$pt(null,null),r=(o=i)&&o.$tag$===Hpt?i:Fpt(null,null,i); - var o; - if(Gpt=e.tagName,s&&r.$attrs$)for(const a of Object.keys(r.$attrs$))e.hasAttribute(a)&&!["key","ref","style","class"].includes(a)&&(r.$attrs$[a]=e[a]); - r.$tag$=null,r.$flags$|=4,t.$vnode$=r,r.$elm$=h.$elm$=e.shadowRoot||e,e["s-sc"],n.$flags$,lwt(h,r,s)} - ,"pp"),fwt=Qt((t,i)=>{ - i&&!t.$onRenderResolve$&&i["s-p"]&&i["s-p"].push(new Promise(i=>t.$onRenderResolve$=i))} - ,"gp"),pwt=Qt((t,i)=>{ - if(t.$flags$|=16,!(4&t.$flags$))return fwt(t,t.$ancestorComponent$),kpt(()=>wwt(t,i)); - t.$flags$|=512} - ,"mp"),wwt=Qt((t,i)=>{ - const s=t.$hostElement$; - t.$cmpMeta$.$tagName$; - const e=t.$lazyInstance$; - if(!e)throw new Error(`Can't render component <${ - s.tagName.toLowerCase()} - /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`); - return gwt(void 0,()=>vwt(t,e,i))} - ,"yp"),gwt=Qt((t,i)=>mwt(t)?t.then(i).catch(t=>{ - i()} - ):i(),"vp"),mwt=Qt(t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,"bp"),vwt=Qt(async(t,i,s)=>{ - var e; - const n=t.$hostElement$; - t.$cmpMeta$.$tagName$; - const h=n["s-rc"]; - s&&Xpt(t),t.$cmpMeta$.$tagName$,_wt(t,i,n,s),h&&(h.map(t=>t()),n["s-rc"]=void 0); - { - const i=null!=(e=n["s-p"])?e:[],s=Qt(()=>Mwt(t),"n"); - 0===i.length?s():(Promise.all(i).then(s),t.$flags$|=4,i.length=0)} - } - ,"wp"),_wt=Qt((t,i,s,e)=>{ - try{ - i=i.render(),t.$flags$&=-17,t.$flags$|=2,dwt(t,i,e)} - catch(n){ - wpt(n,t.$hostElement$)} - return null} - ,"Ep"),Mwt=Qt(t=>{ - t.$cmpMeta$.$tagName$; - const i=t.$hostElement$,s=Qt(()=>{ - } - ,"n"),e=t.$lazyInstance$,n=t.$ancestorComponent$; - 64&t.$flags$?s():(t.$flags$|=64,Ewt(i),ywt(e,"componentDidLoad"),t.$onReadyResolve$(i),n||bwt()),t.$onRenderResolve$&&(t.$onRenderResolve$(),t.$onRenderResolve$=void 0),512&t.$flags$&&Ipt(()=>pwt(t,!1)),t.$flags$&=-517} - ,"Sp"),bwt=Qt(t=>{ - Ewt(Mpt.documentElement),Ipt(()=>Ypt(_pt,"appload",{ - detail:{ - namespace:"sdk-install-modal-web"} - } - ))} - ,"_p"),ywt=Qt((t,i,s)=>{ - if(t&&t[i])try{ - return t[i](s)} - catch(e){ - wpt(e)} - } - ,"Cp"),Ewt=Qt(t=>t.classList.add("hydrated"),"kp"),Awt=Qt((t,i,s,e)=>{ - const n=dpt(t); - if(!n)throw new Error(`Couldn't find host element for "${ - e.$tagName$} - " as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`); - const h=n.$hostElement$,r=n.$instanceValues$.get(i),o=n.$flags$,a=n.$lazyInstance$; - var c,l; - c=s,l=e.$members$[i][0],s=null==c||Rpt(c)?c:4&l?"false"!==c&&(""===c||!!c):1&l?String(c):c; - const u=Number.isNaN(r)&&Number.isNaN(s); - if((!(8&o)||void 0===r)&&s!==r&&!u&&(n.$instanceValues$.set(i,s),a)){ - if(e.$watchers$&&128&o){ - const t=e.$watchers$[i]; - t&&t.map(t=>{ - try{ - a[t](s,r,i)} - catch(e){ - wpt(e,h)} - } - )} - 2==(18&o)&&pwt(n,!1)} - } - ,"Ap"),Swt=Qt((t,i,s)=>{ - var e,n; - const h=t.prototype; - if(i.$members$||i.$watchers$||t.watchers){ - t.watchers&&!i.$watchers$&&(i.$watchers$=t.watchers); - const r=Object.entries(null!=(e=i.$members$)?e:{ - } - ); - if(r.map(([t,[e]])=>{ - (31&e||2&s&&32&e)&&Object.defineProperty(h,t,{ - get(){ - return i=t,dpt(this).$instanceValues$.get(i); - var i} - ,set(s){ - Awt(this,t,s,i)} - ,configurable:!0,enumerable:!0} - )} - ),1&s){ - const s=new Map; - h.attributeChangedCallback=function(t,e,n){ - bpt.jmp(()=>{ - var r; - const o=s.get(t); - if(this.hasOwnProperty(o))n=this[o],delete this[o]; - else{ - if(h.hasOwnProperty(o)&&"number"==typeof this[o]&&this[o]==n)return; - if(null==o){ - const s=dpt(this),h=null==s?void 0:s.$flags$; - if(h&&!(8&h)&&128&h&&n!==e){ - const h=s.$lazyInstance$,o=null==(r=i.$watchers$)?void 0:r[t]; - null==o||o.forEach(i=>{ - null!=h[i]&&h[i].call(h,n,e,t)} - )} - return} - } - this[o]=(null!==n||"boolean"!=typeof this[o])&&n} - )} - ,t.observedAttributes=Array.from(new Set([...Object.keys(null!=(n=i.$watchers$)?n:{ - } - ),...r.filter(([t,i])=>15&i[0]).map(([t,i])=>{ - const e=i[1]||t; - return s.set(e,t),e} - )]))} - } - return t} - ,"xp"),Twt=Qt(async(t,i,s,e)=>{ - let n; - if(!(32&i.$flags$)){ - if(i.$flags$|=32,s.$lazyBundleId$){ - const t=(t=>{ - const i=t.$tagName$.replace(/-/g,"_"),s=t.$lazyBundleId$; - if(!s)return; - const e=gpt.get(s); - if(e)return e[i]; - { - const t=Qt(t=>(gpt.set(s,t),t[i]),"e"); - if("mm-install-modal_3"===s)return Promise.resolve().then(function(){ - return mgt} - ).then(t,wpt)} - return ei(()=>import(`./${ - s} - .entry.js`),[]).then(t=>(gpt.set(s,t),t[i]),wpt)} - )(s); - if(n=t&&"then"in t?await t:t,!n)throw new Error(`Constructor for "${ - s.$tagName$} - #${ - i.$modeName$} - " was not found`); - n.isProxied||(s.$watchers$=n.watchers,Swt(n,s,2),n.isProxied=!0),s.$tagName$,i.$flags$|=8; - try{ - new n(i)} - catch(o){ - wpt(o)} - i.$flags$&=-9,i.$flags$|=128,Cwt(i.$lazyInstance$)} - else{ - n=t.constructor; - const s=t.localName; - customElements.whenDefined(s).then(()=>i.$flags$|=128)} - if(n&&n.style){ - let t; - "string"==typeof n.style&&(t=n.style); - const i=Jpt(s); - mpt.has(i)||(s.$tagName$,((t,i,s)=>{ - let e=mpt.get(t); - ypt&&s?(e=e||new CSSStyleSheet,"string"==typeof e?e=i:e.replaceSync(i)):e=i,mpt.set(t,e)} - )(i,t,!!(1&s.$flags$)))} - } - const h=i.$ancestorComponent$,r=Qt(()=>pwt(i,!0),"s"); - h&&h["s-rc"]?h["s-rc"].push(r):r()} - ,"Mp"),Cwt=Qt(t=>{ - ywt(t,"connectedCallback")} - ,"Ip"),Owt=Qt(t=>{ - ywt(t,"disconnectedCallback")} - ,"Tp"),Iwt=Qt((t,i={ - } - )=>{ - var s; - const e=[],n=i.exclude||[],h=_pt.customElements,r=Mpt.head,o=r.querySelector("meta[charset]"),a=Mpt.createElement("style"),c=[]; - let l,u=!0; - Object.assign(bpt,i),bpt.$resourcesUrl$=new URL(i.resourcesUrl||"./",Mpt.baseURI).href; - let d=!1; - if(t.map(t=>{ - t[1].map(i=>{ - var s,r; - const o={ - $flags$:i[0],$tagName$:i[1],$members$:i[2],$listeners$:i[3]} - ; - 4&o.$flags$&&(d=!0),o.$members$=i[2],o.$watchers$=null!=(r=i[4])?r:{ - } - ; - const a=o.$tagName$,f=(s=class extends HTMLElement{ - constructor(t){ - if(super(t),this.hasRegisteredEventListeners=!1,((t,i)=>{ - const s={ - $flags$:0,$hostElement$:t,$cmpMeta$:i,$instanceValues$:new Map} - ; - s.$onReadyPromise$=new Promise(t=>s.$onReadyResolve$=t),t["s-p"]=[],t["s-rc"]=[],upt.set(t,s)} - )(t=this,o),1&o.$flags$)if(t.shadowRoot){ - if("open"!==t.shadowRoot.mode)throw new Error(`Unable to re-use existing shadow root for ${ - o.$tagName$} - ! Mode is set to ${ - t.shadowRoot.mode} - but Stencil only supports open shadow roots.`)} - else t.attachShadow({ - mode:"open"} - )} - connectedCallback(){ - dpt(this),this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),l&&(clearTimeout(l),l=null),u?c.push(this):bpt.jmp(()=>(t=>{ - if(!(1&bpt.$flags$)){ - const i=dpt(t),s=i.$cmpMeta$; - if(s.$tagName$,1&i.$flags$)(null==i?void 0:i.$lazyInstance$)?Cwt(i.$lazyInstance$):(null==i?void 0:i.$onReadyPromise$)&&i.$onReadyPromise$.then(()=>Cwt(i.$lazyInstance$)); - else{ - i.$flags$|=1; - { - let s=t; - for(; - s=s.parentNode||s.host; - )if(s["s-p"]){ - fwt(i,i.$ancestorComponent$=s); - break} - } - s.$members$&&Object.entries(s.$members$).map(([i,[s]])=>{ - if(31&s&&t.hasOwnProperty(i)){ - const s=t[i]; - delete t[i],t[i]=s} - } - ),Twt(t,i,s)} - } - } - )(this))} - disconnectedCallback(){ - bpt.jmp(()=>(async t=>{ - if(!(1&bpt.$flags$)){ - const i=dpt(t); - (null==i?void 0:i.$lazyInstance$)?Owt(i.$lazyInstance$):(null==i?void 0:i.$onReadyPromise$)&&i.$onReadyPromise$.then(()=>Owt(i.$lazyInstance$))} - } - )(this))} - componentOnReady(){ - return dpt(this).$onReadyPromise$} - } - ,Qt(s,"c"),s); - o.$lazyBundleId$=t[0],n.includes(a)||h.get(a)||(e.push(a),h.define(a,Swt(f,o,1)))} - )} - ),e.length>0&&(d&&(a.textContent+=vpt),a.textContent+=e.sort()+"{ - visibility:hidden} - .hydrated{ - visibility:inherit} - ",a.innerHTML.length)){ - a.setAttribute("data-styles",""); - const t=null!=(s=bpt.$nonce$)?s:Ppt(Mpt); - null!=t&&a.setAttribute("nonce",t),r.insertBefore(a,o?o.nextSibling:r.firstChild)} - u=!1,c.length?c.map(t=>t.connectedCallback()):bpt.jmp(()=>l=setTimeout(bwt,30))} - ,"Rp"); - !function(){ - if("undefined"!=typeof window&&void 0!==window.Reflect&&void 0!==window.customElements){ - var t=HTMLElement; - window.HTMLElement=function(){ - return Reflect.construct(t,[],this.constructor)} - ,HTMLElement.prototype=t.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,t)} - } - (); - var kwt=Object.freeze({ - __proto__:null,defineCustomElements:Qt(async(t,i)=>{ - if("undefined"!=typeof window)return await void 0,Iwt([["mm-install-modal_3",[[1,"mm-install-modal",{ - link:[1],sdkVersion:[1,"sdk-version"],preferDesktop:[4,"prefer-desktop"],tab:[32],isDefaultTab:[32],translationsLoaded:[32]} - ,null,{ - preferDesktop:["updatePreferDesktop"]} - ],[1,"mm-pending-modal",{ - displayOTP:[4,"display-o-t-p"],sdkVersion:[1,"sdk-version"],otpCode:[1,"otp-code"],translationsLoaded:[32]} - ],[1,"mm-select-modal",{ - link:[1],sdkVersion:[1,"sdk-version"],preferDesktop:[4,"prefer-desktop"],tab:[32],isDefaultTab:[32],translationsLoaded:[32]} - ,null,{ - preferDesktop:["updatePreferDesktop"]} - ]]]],i)} - ,"defineCustomElements"),setNonce:Qt(t=>bpt.$nonce$=t,"setNonce")} - ); - const xwt={ - fontFamily:"Roboto, sans-serif"} - ,Rwt=Qt(({ - className:t} - ,i)=>Fpt("div",{ - style:xwt,class:t} - ,i),"Np"),Pwt=Qt(({ - Icon:t,text:i} - )=>Fpt("div",{ - class:"flexContainer",style:{ - padding:"6",flexDirection:"row"} - } - ,Fpt("div",{ - class:"flexItem1"} - ,Fpt(t,null)),Fpt("div",{ - class:"flexItem11"} - ,Fpt("span",{ - style:{ - lineHeight:"2",color:"black"} - } - ,i))),"Lp"),Nwt=Qt(()=>Fpt("svg",{ - width:"20",height:"18",viewBox:"0 0 20 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"} - ,Fpt("path",{ - d:"M20.0002 7.9702V10.0302C20.0002 10.5802 19.5602 11.0302 19.0002 11.0502H17.0402C15.9602 11.0502 14.9702 10.2602 14.8802 9.1802C14.8202 8.5502 15.0602 7.9602 15.4802 7.5502C15.8502 7.1702 16.3602 6.9502 16.9202 6.9502H19.0002C19.5602 6.9702 20.0002 7.4202 20.0002 7.9702Z",fill:"#037DD6"} - ),Fpt("path",{ - d:"M18.47 12.55H17.04C15.14 12.55 13.54 11.12 13.38 9.3C13.29 8.26 13.67 7.22 14.43 6.48C15.07 5.82 15.96 5.45 16.92 5.45H18.47C18.76 5.45 19 5.21 18.97 4.92C18.75 2.49 17.14 0.83 14.75 0.55C14.51 0.51 14.26 0.5 14 0.5H5C4.72 0.5 4.45 0.52 4.19 0.56C1.64 0.88 0 2.78 0 5.5V12.5C0 15.26 2.24 17.5 5 17.5H14C16.8 17.5 18.73 15.75 18.97 13.08C19 12.79 18.76 12.55 18.47 12.55ZM11 6.75H5C4.59 6.75 4.25 6.41 4.25 6C4.25 5.59 4.59 5.25 5 5.25H11C11.41 5.25 11.75 5.59 11.75 6C11.75 6.41 11.41 6.75 11 6.75Z",fill:"#037DD6"} - )),"Dp"),Lwt=Qt(()=>Fpt("svg",{ - width:"20",height:"18",viewBox:"0 0 20 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"} - ,Fpt("path",{ - d:"M14.44 0.0999756C12.63 0.0999756 11.01 0.979976 10 2.32998C8.99 0.979976 7.37 0.0999756 5.56 0.0999756C2.49 0.0999756 0 2.59998 0 5.68998C0 6.87998 0.19 7.97998 0.52 8.99998C2.1 14 6.97 16.99 9.38 17.81C9.72 17.93 10.28 17.93 10.62 17.81C13.03 16.99 17.9 14 19.48 8.99998C19.81 7.97998 20 6.87998 20 5.68998C20 2.59998 17.51 0.0999756 14.44 0.0999756Z",fill:"#037DD6"} - )),"$p"),Dwt=Qt(()=>Fpt("svg",{ - width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"} - ,Fpt("path",{ - d:"M16.28 7.53V6.28C16.28 3.58 15.63 0 10 0C4.37 0 3.72 3.58 3.72 6.28V7.53C0.92 7.88 0 9.3 0 12.79V14.65C0 18.75 1.25 20 5.35 20H14.65C18.75 20 20 18.75 20 14.65V12.79C20 9.3 19.08 7.88 16.28 7.53ZM10 16.74C8.33 16.74 6.98 15.38 6.98 13.72C6.98 12.05 8.34 10.7 10 10.7C11.66 10.7 13.02 12.06 13.02 13.72C13.02 15.39 11.67 16.74 10 16.74ZM5.35 7.44C5.27 7.44 5.2 7.44 5.12 7.44V6.28C5.12 3.35 5.95 1.4 10 1.4C14.05 1.4 14.88 3.35 14.88 6.28V7.45C14.8 7.45 14.73 7.45 14.65 7.45H5.35V7.44Z",fill:"#037DD6"} - )),"Bp"),Gwt=Qt(()=>Fpt("svg",{ - width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"} - ,Fpt("path",{ - d:"M16.4405 8.8999C20.0405 9.2099 21.5105 11.0599 21.5105 15.1099V15.2399C21.5105 19.7099 19.7205 21.4999 15.2505 21.4999H8.74047C4.27047 21.4999 2.48047 19.7099 2.48047 15.2399V15.1099C2.48047 11.0899 3.93047 9.2399 7.47047 8.9099",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"} - ),Fpt("path",{ - d:"M12 2V14.88",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"} - ),Fpt("path",{ - d:"M15.3504 12.6499L12.0004 15.9999L8.65039 12.6499",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"} - )),"Kp"); - function Bwt({ - version:t} - ){ - return Fpt("div",{ - style:{ - textAlign:"center",color:"#BBC0C5",fontSize:"12"} - } - ,"SDK Version ",t?`v${ - t} - `:"unknown")} - Qt(Bwt,"jp"); - const Uwt=Qt(()=>Fpt("svg",{ - width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"} - ,Fpt("rect",{ - width:"16",height:"16",fill:"white"} - ),Fpt("path",{ - "fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.40554 2.40554C2.94627 1.86482 3.82296 1.86482 4.36369 2.40554L8 6.04186L11.6363 2.40554C12.177 1.86482 13.0537 1.86482 13.5945 2.40554C14.1352 2.94627 14.1352 3.82296 13.5945 4.36369L9.95814 8L13.5945 11.6363C14.1352 12.177 14.1352 13.0537 13.5945 13.5945C13.0537 14.1352 12.177 14.1352 11.6363 13.5945L8 9.95814L4.36369 13.5945C3.82296 14.1352 2.94627 14.1352 2.40554 13.5945C1.86482 13.0537 1.86482 12.177 2.40554 11.6363L6.04186 8L2.40554 4.36369C1.86482 3.82296 1.86482 2.94627 2.40554 2.40554Z",fill:"#BBC0C5"} - )),"Up"),Fwt=Qt(()=>Fpt("svg",{ - width:"120",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 127 63"} - ,Fpt("path",{ - fill:"currentColor",d:"M71.554 48.607v13.81h-7.072v-9.568l-8.059.945c-1.77.205-2.548.79-2.548 1.864 0 1.575 1.478 2.239 4.648 2.239 1.932 0 4.073-.29 5.963-.79l-3.66 5.225c-1.479.332-2.92.496-4.44.496-6.414 0-10.074-2.57-10.074-7.132 0-4.023 2.877-6.136 9.416-6.884l8.638-1.012c-.467-2.532-2.362-3.633-6.13-3.633-3.537 0-7.443.912-10.937 2.613l1.111-6.18c3.248-1.369 6.95-2.074 10.69-2.074 8.226 0 12.461 3.444 12.461 10.075l-.008.005ZM7.938 31.315.208 62.416h7.73l3.836-15.628 6.65 8.039h8.06l6.65-8.039 3.836 15.628h7.73l-7.73-31.105-14.518 17.388L7.934 31.311l.004.004ZM36.97.21 22.452 17.598 7.938.21.208 31.315h7.73l3.836-15.628 6.65 8.039h8.06l6.65-8.039 3.836 15.628h7.73L36.97.21Zm53.17 48.107-6.25-.912c-1.562-.247-2.178-.747-2.178-1.617 0-1.41 1.52-2.032 4.647-2.032 3.62 0 6.868.747 10.283 2.364l-.862-6.094c-2.757-.995-5.922-1.491-9.212-1.491-7.688 0-11.886 2.696-11.886 7.547 0 3.776 2.303 5.889 7.196 6.636l6.335.954c1.603.248 2.261.87 2.261 1.865 0 1.41-1.478 2.074-4.481 2.074-3.948 0-8.225-.953-11.72-2.654l.7 6.094c3.003 1.122 6.91 1.785 10.57 1.785 7.896 0 12.007-2.78 12.007-7.715 0-3.94-2.303-6.057-7.4-6.8l-.01-.004ZM100.3 34.09v28.325h7.071V34.091H100.3Zm15.334 15.595 9.833-10.744h-8.8l-9.296 11.114 9.912 12.356h8.925l-10.574-12.73v.004Zm-16.321-25.09c0 4.56 3.66 7.13 10.074 7.13 1.52 0 2.961-.167 4.44-.495l3.66-5.225c-1.89.496-4.031.79-5.963.79-3.166 0-4.648-.664-4.648-2.239 0-1.079.783-1.659 2.549-1.864l8.058-.945v9.567h7.072v-13.81c0-6.635-4.236-10.075-12.461-10.075-3.744 0-7.442.705-10.691 2.075l-1.112 6.178c3.495-1.701 7.401-2.613 10.937-2.613 3.769 0 5.664 1.1 6.13 3.633l-8.637 1.013c-6.539.747-9.417 2.86-9.417 6.883l.009-.004Zm-19.779-1.492c0 5.725 3.29 8.627 9.787 8.627 2.59 0 4.732-.416 6.785-1.37l.903-6.261c-1.974 1.2-3.99 1.822-6.005 1.822-3.044 0-4.402-1.243-4.402-4.023v-8.295h10.732V7.84H86.601V2.948l-13.448 7.174v3.482h6.372V23.1l.008.004Zm-6.95-2.612v1.411H53.47c.862 2.873 3.423 4.187 7.97 4.187 3.62 0 6.993-.747 9.992-2.196l-.862 6.056c-2.757 1.16-6.251 1.785-9.829 1.785-9.5 0-14.68-4.23-14.68-12.066 0-7.838 5.264-12.235 13.406-12.235s13.119 4.771 13.119 13.062l-.005-.004ZM53.378 17.09h12.086c-.637-2.751-2.732-4.188-6.08-4.188-3.349 0-5.335 1.399-6.006 4.188Z"} - )),"Hp"); - function $wt(t,i){ - return t.toString(2).padStart(i,"0")} - function Hwt(t,i){ - const s=t%i; - return s>=0?s:i+s} - function Wwt(t,i){ - return new Array(t).fill(i)} - function Vwt(...t){ - let i=0; - for(const e of t)i=Math.max(i,e.length); - const s=[]; - for(let e=0; - e<i; - e++)for(const i of t)e>=i.length||s.push(i[e]); - return new Uint8Array(s)} - function jwt(t,i,s){ - if(s<0||s+i.length>t.length)return!1; - for(let e=0; - e<i.length; - e++)if(i[e]!==t[s+e])return!1; - return!0} - function Kwt(t){ - return{ - has:Qt(i=>t.includes(i),"has"),decode:Qt(i=>{ - if(!Array.isArray(i)||i.length&&"string"!=typeof i[0])throw new Error("alphabet.decode input should be array of strings"); - return i.map(i=>{ - if("string"!=typeof i)throw new Error(`alphabet.decode: not string element=${ - i} - `); - const s=t.indexOf(i); - if(-1===s)throw new Error(`Unknown letter: "${ - i} - ". Allowed: ${ - t} - `); - return s} - )} - ,"decode"),encode:Qt(i=>{ - if(!Array.isArray(i)||i.length&&"number"!=typeof i[0])throw new Error("alphabet.encode input should be an array of numbers"); - return i.map(i=>{ - if(function(t){ - if(!Number.isSafeInteger(t))throw new Error(`Wrong integer: ${ - t} - `)} - (i),i<0||i>=t.length)throw new Error(`Digit index outside alphabet: ${ - i} - (alphabet: ${ - t.length} - )`); - return t[i]} - )} - ,"encode")} - } - Qt($wt,"Fp"),Qt(Hwt,"zp"),Qt(Wwt,"qp"),Qt(Vwt,"Wp"),Qt(jwt,"Vp"),Qt(Kwt,"Gp"); - const zwt=class t{ - static size(t,i){ - if("number"==typeof t&&(t={ - height:t,width:t} - ),!Number.isSafeInteger(t.height)&&t.height!==1/0)throw new Error(`Bitmap: wrong height=${ - t.height} - (${ - typeof t.height} - )`); - if(!Number.isSafeInteger(t.width)&&t.width!==1/0)throw new Error(`Bitmap: wrong width=${ - t.width} - (${ - typeof t.width} - )`); - return void 0!==i&&(t={ - width:Math.min(t.width,i.width),height:Math.min(t.height,i.height)} - ),t} - static fromString(i){ - const s=(i=i.replace(/^\n+/g,"").replace(/\n+$/g,"")).split("\n"),e=s.length,n=new Array(e); - let h; - for(const t of s){ - const i=t.split("").map(t=>{ - if("X"===t)return!0; - if(" "===t)return!1; - if("?"!==t)throw new Error(`Bitmap.fromString: unknown symbol=${ - t} - `)} - ); - if(h&&i.length!==h)throw new Error(`Bitmap.fromString different row sizes: width=${ - h} - cur=${ - i.length} - `); - h=i.length,n.push(i)} - return h||(h=0),new t({ - height:e,width:h} - ,n)} - constructor(i,s){ - const{ - height:e,width:n} - =t.size(i); - this.data=s||Array.from({ - length:e} - ,()=>Wwt(n,void 0)),this.height=e,this.width=n} - point(t){ - return this.data[t.y][t.x]} - isInside(t){ - return 0<=t.x&&t.x<this.width&&0<=t.y&&t.y<this.height} - size(t){ - if(!t)return{ - height:this.height,width:this.width} - ; - const{ - x:i,y:s} - =this.xy(t); - return{ - height:this.height-s,width:this.width-i} - } - xy(t){ - if("number"==typeof t&&(t={ - x:t,y:t} - ),!Number.isSafeInteger(t.x))throw new Error(`Bitmap: wrong x=${ - t.x} - `); - if(!Number.isSafeInteger(t.y))throw new Error(`Bitmap: wrong y=${ - t.y} - `); - return t.x=Hwt(t.x,this.width),t.y=Hwt(t.y,this.height),t} - rect(i,s,e){ - const{ - x:n,y:h} - =this.xy(i),{ - height:r,width:o} - =t.size(s,this.size({ - x:n,y:h} - )); - for(let t=0; - t<r; - t++)for(let i=0; - i<o; - i++)this.data[h+t][n+i]="function"==typeof e?e({ - x:i,y:t} - ,this.data[h+t][n+i]):e; - return this} - rectRead(t,i,s){ - return this.rect(t,i,(t,i)=>(s(t,i),i))} - hLine(t,i,s){ - return this.rect(t,{ - width:i,height:1} - ,s)} - vLine(t,i,s){ - return this.rect(t,{ - width:1,height:i} - ,s)} - border(i=2,s){ - const e=this.height+2*i,n=this.width+2*i,h=Wwt(i,s),r=Array.from({ - length:i} - ,()=>Wwt(n,s)); - return new t({ - height:e,width:n} - ,[...r,...this.data.map(t=>[...h,...t,...h]),...r])} - embed(t,i){ - return this.rect(t,i.size(),({ - x:t,y:s} - )=>i.data[s][t])} - rectSlice(i,s=this.size()){ - const e=new t(t.size(s,this.size(this.xy(i)))); - return this.rect(i,s,({ - x:t,y:i} - ,s)=>e.data[i][t]=s),e} - inverse(){ - const{ - height:i,width:s} - =this; - return new t({ - height:s,width:i} - ).rect({ - x:0,y:0} - ,1/0,({ - x:t,y:i} - )=>this.data[t][i])} - scale(i){ - if(!Number.isSafeInteger(i)||i>1024)throw new Error(`Wrong scale factor: ${ - i} - `); - const{ - height:s,width:e} - =this; - return new t({ - height:i*s,width:i*e} - ).rect({ - x:0,y:0} - ,1/0,({ - x:t,y:s} - )=>this.data[Math.floor(s/i)][Math.floor(t/i)])} - clone(){ - return new t(this.size()).rect({ - x:0,y:0} - ,this.size(),({ - x:t,y:i} - )=>this.data[i][t])} - assertDrawn(){ - this.rectRead(0,1/0,(t,i)=>{ - if("boolean"!=typeof i)throw new Error("Invalid color type="+typeof i)} - )} - toString(){ - return this.data.map(t=>t.map(t=>void 0===t?"?":t?"X":" ").join("")).join("\n")} - toASCII(){ - const{ - height:t,width:i,data:s} - =this; - let e=""; - for(let n=0; - n<t; - n+=2){ - for(let h=0; - h<i; - h++){ - const i=s[n][h],r=n+1>=t||s[n+1][h]; - i||r?!i&&r?e+="▀":i&&!r?e+="▄":i&&r&&(e+=" "):e+="█"} - e+="\n"} - return e} - toTerm(){ - const t="[0m",i=`[1; - 47m ${ - t} - `,s=`[40m ${ - t} - `; - return this.data.map(t=>t.map(t=>t?s:i).join("")).join("\n")} - toSVG(){ - let t=`<svg xmlns:svg="http://www.w3.org/2000/svg" viewBox="0 0 ${ - this.width} - ${ - this.height} - " version="1.1" xmlns="http://www.w3.org/2000/svg">`; - return this.rectRead(0,1/0,({ - x:i,y:s} - ,e)=>{ - e&&(t+=`<rect x="${ - i} - " y="${ - s} - " width="1" height="1" />`)} - ),t+="</svg>",t} - toGIF(){ - const t=Qt(t=>[255&t,t>>>8&255],"e"),i=[...t(this.width),...t(this.height)],s=[]; - this.rectRead(0,1/0,(t,i)=>s.push(+(!0===i))); - const e=126,n=[71,73,70,56,55,97,...i,246,0,0,255,255,255,...Wwt(381,0),44,0,0,0,0,...i,0,7],h=Math.floor(s.length/e); - for(let r=0; - r<h; - r++)n.push(127,128,...s.slice(e*r,e*(r+1)).map(t=>+t)); - return n.push(s.length%e+1,128,...s.slice(h*e).map(t=>+t)),n.push(1,129,0,59),new Uint8Array(n)} - toImage(t=!1){ - const{ - height:i,width:s} - =this.size(),e=new Uint8Array(i*s*(t?3:4)); - let n=0; - for(let h=0; - h<i; - h++)for(let i=0; - i<s; - i++){ - const s=this.data[h][i]?0:255; - e[n++]=s,e[n++]=s,e[n++]=s,t||(e[n++]=255)} - return{ - height:i,width:s,data:e} - } - } - ; - Qt(zwt,"Yp"); - let Ywt=zwt; - const qwt=["low","medium","quartile","high"],Xwt=["numeric","alphanumeric","byte","kanji","eci"],Jwt=[26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706],Qwt={ - low:[7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],medium:[10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],quartile:[13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],high:[17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]} - ,Zwt={ - low:[1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],medium:[1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],quartile:[1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],high:[1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]} - ,tgt={ - size:{ - encode:Qt(t=>21+4*(t-1),"encode"),decode:Qt(t=>(t-17)/4,"decode")} - ,sizeType:Qt(t=>Math.floor((t+7)/17),"sizeType"),alignmentPatterns(t){ - if(1===t)return[]; - const i=tgt.size.encode(t)-6-1,s=i-6,e=Math.ceil(s/28); - let n=Math.floor(s/e); - n%2?n+=1:s%e*2>=e&&(n+=2); - const h=[6]; - for(let r=1; - r<e; - r++)h.push(i-(e-r)*n); - return h.push(i),h} - ,ECCode:{ - low:1,medium:0,quartile:3,high:2} - ,formatMask:21522,formatBits(t,i){ - const s=tgt.ECCode[t]<<3|i; - let e=s; - for(let n=0; - n<10; - n++)e=e<<1^1335*(e>>9); - return(s<<10|e)^tgt.formatMask} - ,versionBits(t){ - let i=t; - for(let s=0; - s<12; - s++)i=i<<1^7973*(i>>11); - return t<<12|i} - ,alphabet:{ - numeric:Kwt("0123456789"),alphanumerc:Kwt("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:")} - ,lengthBits:Qt((t,i)=>({ - numeric:[10,12,14],alphanumeric:[9,11,13],byte:[8,16,16],kanji:[8,10,12],eci:[0,0,0]} - [i][tgt.sizeType(t)]),"lengthBits"),modeBits:{ - numeric:"0001",alphanumeric:"0010",byte:"0100",kanji:"1000",eci:"0111"} - ,capacity(t,i){ - const s=Jwt[t-1],e=Qwt[i][t-1],n=Zwt[i][t-1],h=Math.floor(s/n)-e,r=n-s%n; - return{ - words:e,numBlocks:n,shortBlocks:r,blockLen:h,capacity:8*(s-e*n),total:(e+h)*n+n-r} - } - } - ,igt=[(t,i)=>(t+i)%2==0,(t,i)=>i%2==0,(t,i)=>t%3==0,(t,i)=>(t+i)%3==0,(t,i)=>(Math.floor(i/2)+Math.floor(t/3))%2==0,(t,i)=>t*i%2+t*i%3==0,(t,i)=>(t*i%2+t*i%3)%2==0,(t,i)=>((t+i)%2+t*i%3)%2==0],sgt={ - tables:(()=>{ - const t=Wwt(256,0),i=Wwt(256,0); - for(let s=0,e=1; - s<256; - s++)t[s]=e,i[e]=s,e<<=1,256&e&&(e^=285); - return{ - exp:t,log:i} - } - )(),exp:Qt(t=>sgt.tables.exp[t],"exp"),log(t){ - if(0===t)throw new Error(`GF.log: wrong arg=${ - t} - `); - return sgt.tables.log[t]%255} - ,mul:Qt((t,i)=>0===t||0===i?0:sgt.tables.exp[(sgt.tables.log[t]+sgt.tables.log[i])%255],"mul"),add:Qt((t,i)=>t^i,"add"),pow:Qt((t,i)=>sgt.tables.exp[sgt.tables.log[t]*i%255],"pow"),inv(t){ - if(0===t)throw new Error(`GF.inverse: wrong arg=${ - t} - `); - return sgt.tables.exp[255-sgt.tables.log[t]]} - ,polynomial(t){ - if(0==t.length)throw new Error("GF.polymomial: wrong length"); - if(0!==t[0])return t; - let i=0; - for(; - i<t.length-1&&0==t[i]; - i++); - return t.slice(i)} - ,monomial(t,i){ - if(t<0)throw new Error(`GF.monomial: wrong degree=${ - t} - `); - if(0==i)return[0]; - let s=Wwt(t+1,0); - return s[0]=i,sgt.polynomial(s)} - ,degree:Qt(t=>t.length-1,"degree"),coefficient:Qt((t,i)=>t[sgt.degree(t)-i],"coefficient"),mulPoly(t,i){ - if(0===t[0]||0===i[0])return[0]; - const s=Wwt(t.length+i.length-1,0); - for(let e=0; - e<t.length; - e++)for(let n=0; - n<i.length; - n++)s[e+n]=sgt.add(s[e+n],sgt.mul(t[e],i[n])); - return sgt.polynomial(s)} - ,mulPolyScalar(t,i){ - if(0==i)return[0]; - if(1==i)return t; - const s=Wwt(t.length,0); - for(let e=0; - e<t.length; - e++)s[e]=sgt.mul(t[e],i); - return sgt.polynomial(s)} - ,mulPolyMonomial(t,i,s){ - if(i<0)throw new Error("GF.mulPolyMonomial: wrong degree"); - if(0==s)return[0]; - const e=Wwt(t.length+i,0); - for(let n=0; - n<t.length; - n++)e[n]=sgt.mul(t[n],s); - return sgt.polynomial(e)} - ,addPoly(t,i){ - if(0===t[0])return i; - if(0===i[0])return t; - let s=t,e=i; - s.length>e.length&&([s,e]=[e,s]); - let n=Wwt(e.length,0),h=e.length-s.length,r=e.slice(0,h); - for(let o=0; - o<r.length; - o++)n[o]=r[o]; - for(let o=h; - o<e.length; - o++)n[o]=sgt.add(s[o-h],e[o]); - return sgt.polynomial(n)} - ,remainderPoly(t,i){ - const s=Array.from(t); - for(let e=0; - e<t.length-i.length+1; - e++){ - const t=s[e]; - if(0!==t)for(let n=1; - n<i.length; - n++)0!==i[n]&&(s[e+n]=sgt.add(s[e+n],sgt.mul(i[n],t)))} - return s.slice(t.length-i.length+1,s.length)} - ,divisorPoly(t){ - let i=[1]; - for(let s=0; - s<t; - s++)i=sgt.mulPoly(i,[1,sgt.pow(2,s)]); - return i} - ,evalPoly(t,i){ - if(0==i)return sgt.coefficient(t,0); - let s=t[0]; - for(let e=1; - e<t.length; - e++)s=sgt.add(sgt.mul(i,s),t[e]); - return s} - ,euclidian(t,i,s){ - sgt.degree(t)<sgt.degree(i)&&([t,i]=[i,t]); - let e=t,n=i,h=[0],r=[1]; - for(; - 2*sgt.degree(n)>=s; - ){ - let t=e,i=h; - if(e=n,h=r,0===e[0])throw new Error("rLast[0] === 0"); - n=t; - let s=[0]; - const o=sgt.inv(e[0]); - for(; - sgt.degree(n)>=sgt.degree(e)&&0!==n[0]; - ){ - const t=sgt.degree(n)-sgt.degree(e),i=sgt.mul(n[0],o); - s=sgt.addPoly(s,sgt.monomial(t,i)),n=sgt.addPoly(n,sgt.mulPolyMonomial(e,t,i))} - if(s=sgt.mulPoly(s,h),r=sgt.addPoly(s,i),sgt.degree(n)>=sgt.degree(e))throw new Error(`Division failed r: ${ - n} - , rLast: ${ - e} - `)} - const o=sgt.coefficient(r,0); - if(0==o)throw new Error("sigmaTilde(0) was zero"); - const a=sgt.inv(o); - return[sgt.mulPolyScalar(r,a),sgt.mulPolyScalar(n,a)]} - } - ; - function egt(t,i){ - const{ - words:s,shortBlocks:e,numBlocks:n,blockLen:h,total:r} - =tgt.capacity(t,i),o=(a=s,{ - encode(t){ - const i=sgt.divisorPoly(a),s=Array.from(t); - return s.push(...i.slice(0,-1).fill(0)),Uint8Array.from(sgt.remainderPoly(s,i))} - ,decode(t){ - const i=t.slice(),s=sgt.polynomial(Array.from(t)); - let e=Wwt(a,0),n=!1; - for(let u=0; - u<a; - u++){ - const t=sgt.evalPoly(s,sgt.exp(u)); - e[e.length-1-u]=t,0!==t&&(n=!0)} - if(!n)return i; - e=sgt.polynomial(e); - const h=sgt.monomial(a,1),[r,o]=sgt.euclidian(h,e,a),c=Wwt(sgt.degree(r),0); - let l=0; - for(let a=1; - a<256&&l<c.length; - a++)0===sgt.evalPoly(r,a)&&(c[l++]=sgt.inv(a)); - if(l!==c.length)throw new Error("RS.decode: wrong errors number"); - for(let a=0; - a<c.length; - a++){ - const t=i.length-1-sgt.log(c[a]); - if(t<0)throw new Error("RS.decode: wrong error location"); - const s=sgt.inv(c[a]); - let e=1; - for(let i=0; - i<c.length; - i++)a!==i&&(e=sgt.mul(e,sgt.add(1,sgt.mul(c[i],s)))); - i[t]=sgt.add(i[t],sgt.mul(sgt.evalPoly(o,s),sgt.inv(e)))} - return i} - } - ); - var a; - return{ - encode(t){ - const i=[],s=[]; - for(let l=0; - l<n; - l++){ - const n=h+(l<e?0:1); - i.push(t.subarray(0,n)),s.push(o.encode(t.subarray(0,n))),t=t.subarray(n)} - const r=Vwt(...i),a=Vwt(...s),c=new Uint8Array(r.length+a.length); - return c.set(r),c.set(a,r.length),c} - ,decode(t){ - if(t.length!==r)throw new Error(`interleave.decode: len(data)=${ - t.length} - , total=${ - r} - `); - const i=[]; - for(let r=0; - r<n; - r++){ - const t=r<e; - i.push(new Uint8Array(s+h+(t?0:1)))} - let a=0; - for(let s=0; - s<h; - s++)for(let e=0; - e<n; - e++)i[e][s]=t[a++]; - for(let s=e; - s<n; - s++)i[s][h]=t[a++]; - for(let r=h; - r<h+s; - r++)for(let s=0; - s<n; - s++){ - const n=s<e; - i[s][r+(n?0:1)]=t[a++]} - const c=[]; - for(const e of i)c.push(...Array.from(o.decode(e)).slice(0,-s)); - return Uint8Array.from(c)} - } - } - function ngt(t,i,s,e){ - let n="",h=s.length; - if("numeric"===e){ - const t=tgt.alphabet.numeric.decode(s.split("")),i=t.length; - for(let s=0; - s<i-2; - s+=3)n+=$wt(100*t[s]+10*t[s+1]+t[s+2],10); - i%3==1?n+=$wt(t[i-1],4):i%3==2&&(n+=$wt(10*t[i-2]+t[i-1],7))} - else if("alphanumeric"===e){ - const t=tgt.alphabet.alphanumerc.decode(s.split("")),i=t.length; - for(let s=0; - s<i-1; - s+=2)n+=$wt(45*t[s]+t[s+1],11); - i%2==1&&(n+=$wt(t[i-1],6))} - else{ - if("byte"!==e)throw new Error("encode: unsupported type"); - { - const t=function(t){ - if("string"!=typeof t)throw new Error("utf8ToBytes expected string, got "+typeof t); - return new Uint8Array((new TextEncoder).encode(t))} - (s); - h=t.length,n=Array.from(t).map(t=>$wt(t,8)).join("")} - } - const{ - capacity:r} - =tgt.capacity(t,i),o=$wt(h,tgt.lengthBits(t,e)); - let a=tgt.modeBits[e]+o+n; - if(a.length>r)throw new Error("Capacity overflow"); - a+="0".repeat(Math.min(4,Math.max(0,r-a.length))),a.length%8&&(a+="0".repeat(8-a.length%8)); - for(let l=0; - a.length!==r; - l++)a+="1110110000010001"[l%16]; - const c=Uint8Array.from(a.match(/(.{ - 8} - )/g).map(t=>Number(`0b${ - t} - `))); - return egt(t,i).encode(c)} - function hgt(t,i,s,e,n=!1){ - const h=function(t,i,s,e=!1){ - const n=tgt.size.encode(t); - let h=new Ywt(n+2); - const r=new Ywt(3).rect(0,3,!0).border(1,!1).border(1,!0).border(1,!1); - h=h.embed(0,r).embed({ - x:-r.width,y:0} - ,r).embed({ - x:0,y:-r.height} - ,r),h=h.rectSlice(1,n); - const o=new Ywt(1).rect(0,1,!0).border(1,!1).border(1,!0),a=tgt.alignmentPatterns(t); - for(const c of a)for(const t of a)void 0===h.data[c][t]&&h.embed({ - x:t-2,y:c-2} - ,o); - h=h.hLine({ - x:0,y:6} - ,1/0,({ - x:t} - ,i)=>void 0===i?t%2==0:i).vLine({ - x:6,y:0} - ,1/0,({ - y:t} - ,i)=>void 0===i?t%2==0:i); - { - const t=tgt.formatBits(i,s),r=Qt(i=>!e&&1==(t>>i&1),"s"); - for(let i=0; - i<6; - i++)h.data[i][8]=r(i); - for(let i=6; - i<8; - i++)h.data[i+1][8]=r(i); - for(let i=8; - i<15; - i++)h.data[n-15+i][8]=r(i); - for(let i=0; - i<8; - i++)h.data[8][n-i-1]=r(i); - for(let i=8; - i<9; - i++)h.data[8][15-i-1+1]=r(i); - for(let i=9; - i<15; - i++)h.data[8][15-i-1]=r(i); - h.data[n-8][8]=!e} - if(t>=7){ - const i=tgt.versionBits(t); - for(let t=0; - t<18; - t+=1){ - const s=!e&&1==(i>>t&1),r=Math.floor(t/3),o=t%3+n-8-3; - h.data[r][o]=s,h.data[o][r]=s} - } - return h} - (t,i,e,n); - let r=0; - const o=8*s.length; - if(function(t,i,s){ - const e=t.height,n=igt[i]; - let h=-1,r=e-1; - for(let o=e-1; - o>0; - o-=2){ - for(6==o&&(o=5); - ; - r+=h){ - for(let i=0; - i<2; - i+=1){ - const e=o-i; - void 0===t.data[r][e]&&s(e,r,n(e,r))} - if(r+h<0||r+h>=e)break} - h=-h} - } - (h,e,(t,i,e)=>{ - let n=!1; - r<o&&(n=!!(s[r>>>3]>>(7-r&7)&1),r++),h.data[i][t]=n!==e} - ),r!==o)throw new Error("QR: bytes left after draw"); - return h} - function rgt(t){ - const i=t.inverse(),s=Qt(t=>{ - let i=0; - for(let s,e=0,n=1; - e<t.length; - e++)s===t[e]&&(n++,e!==t.length-1)||(n>=5&&(i+=n-5+3),s=t[e],n=1); - return i} - ,"n"); - let e=0; - t.data.forEach(t=>e+=s(t)),i.data.forEach(t=>e+=s(t)); - let n=0,h=t.data; - const r=t.width-1,o=t.height-1; - for(let f=0; - f<r; - f++)for(let t=0; - t<o; - t++){ - const i=f+1,s=t+1; - h[f][t]===h[i][t]&&h[i][t]===h[f][s]&&h[i][t]===h[i][s]&&(n+=3)} - const a=Qt(t=>{ - const i=[!0,!1,!0,!0,!0,!1,!0],s=[!1,!1,!1,!1],e=[...i,...s],n=[...s,...i]; - let h=0; - for(let r=0; - r<t.length; - r++)jwt(t,e,r)&&(h+=40),jwt(t,n,r)&&(h+=40); - return h} - ,"c"); - let c=0; - for(const f of t.data)c+=a(f); - for(const f of i.data)c+=a(f); - let l=0; - t.rectRead(0,1/0,(t,i)=>l+=i?1:0); - const u=l/(t.height*t.width)*100,d=10*Math.floor(Math.abs(u-50)/5); - return e+n+c+d} - function ogt(t,i="raw",s={ - } - ){ - const e=void 0!==s.ecc?s.ecc:"medium"; - !function(t){ - if(!qwt.includes(t))throw new Error(`Invalid error correction mode=${ - t} - . Expected: ${ - qwt} - `)} - (e); - const n=void 0!==s.encoding?s.encoding:function(t){ - let i="numeric"; - for(let s of t)if(!tgt.alphabet.numeric.has(s)&&(i="alphanumeric",!tgt.alphabet.alphanumerc.has(s)))return"byte"; - return i} - (t); - !function(t){ - if(!Xwt.includes(t))throw new Error(`Encoding: invalid mode=${ - t} - . Expected: ${ - Xwt} - `); - if("kanji"===t||"eci"===t)throw new Error(`Encoding: ${ - t} - is not supported (yet?).`)} - (n),void 0!==s.mask&&function(t){ - if(![0,1,2,3,4,5,6,7].includes(t)||!igt[t])throw new Error(`Invalid mask=${ - t} - . Expected number [0..7]`)} - (s.mask); - let h,r=s.version,o=new Error("Unknown error"); - if(void 0!==r)!function(t){ - if(!Number.isSafeInteger(t)||t<1||t>40)throw new Error(`Invalid version=${ - t} - . Expected number [1..40]`)} - (r),h=ngt(r,e,t,n); - else for(let u=1; - u<=40; - u++)try{ - h=ngt(u,e,t,n),r=u; - break} - catch(l){ - o=l} - if(!r||!h)throw o; - let a=function(t,i,s,e){ - if(void 0===e){ - const n=function(){ - let t,i=1/0; - return{ - add(s,e){ - s>=i||(t=e,i=s)} - ,get:Qt(()=>t,"get"),score:Qt(()=>i,"score")} - } - (); - for(let e=0; - e<igt.length; - e++)n.add(rgt(hgt(t,i,s,e,!0)),e); - e=n.get()} - if(void 0===e)throw new Error("Cannot find mask"); - return hgt(t,i,s,e)} - (r,e,h,s.mask); - a.assertDrawn(); - const c=void 0===s.border?2:s.border; - if(!Number.isSafeInteger(c))throw new Error("Wrong border type="+typeof c); - if(a=a.border(c,!1),void 0!==s.scale&&(a=a.scale(s.scale)),"raw"===i)return a.data; - if("ascii"===i)return a.toASCII(); - if("svg"===i)return a.toSVG(); - if("gif"===i)return a.toGIF(); - if("term"===i)return a.toTerm(); - throw new Error(`Unknown output: ${ - i} - `)} - Qt(egt,"ig"),Qt(ngt,"og"),Qt(hgt,"sg"),Qt(rgt,"ag"),Qt(ogt,"cg"); - const agt={ - DESKTOP:"Desktop",MOBILE:"Mobile",META_MASK_MOBILE_APP:"MetaMask mobile app",SCAN_TO_CONNECT:"Scan to connect and sign with",CONNECT_WITH_EXTENSION:"Connect With MetaMask Extension",INSTALL_MODAL:{ - TRUSTED_BY_USERS:"Trusted by over 30 million users to buy, store, send and swap crypto securely",LEADING_CRYPTO_WALLET:"The leading crypto wallet & gateway to blockchain apps built on Ethereum Mainnet, Polygon, Optimism, and many other networks",CONTROL_DIGITAL_INTERACTIONS:"Puts you in control of your digital interactions by making power of cryptography more accessible",INSTALL_META_MASK_EXTENSION:"Install MetaMask Extension"} - ,PENDING_MODAL:{ - OPEN_META_MASK_SELECT_CODE:"Please open the MetaMask wallet app and select the code on the screen OR disconnect",OPEN_META_MASK_CONTINUE:"Open the MetaMask app to continue with your session.",NUMBER_AFTER_OPEN_NOTICE:"If a number doesn't appear after opening MetaMask, please click disconnect and re-scan the QRCode.",DISCONNECT:"Disconnect"} - ,SELECT_MODAL:{ - CRYPTO_TAKE_CONTROL_TEXT:"Take control of your crypto and explore the blockchain with the wallet trusted by over 30 million people worldwide"} - ,META_MASK_MODAL:{ - ADDRESS_COPIED:"Address copied to clipboard!",DISCONNECT:"Disconnect",ACTIVE_NETWORK:"Active Network"} - } - ,cgt=class{ - constructor(t){ - var i; - this.translations=agt,this.supportedLocales=["es","fr","he","it","pt","tr"],this.baseUrl=null!==(i=null==t?void 0:t.baseUrl)&&void 0!==i?i:"https://raw.githubusercontent.com/MetaMask/metamask-sdk/refs/heads/gh-pages/locales"} - getBrowserLanguage(){ - if((navigator.languages||[navigator.language]).some(t=>t.toLowerCase().startsWith("en")))return"en"; - const t=navigator.language.toLowerCase().split("-")[0]; - return this.supportedLocales.includes(t)?t:"en"} - async init(t){ - const i=this.getBrowserLanguage()||t.fallbackLng; - await this.loadTranslations(i)} - async loadTranslations(t){ - const i=t.split("-")[0]; - if("en"!==i&&this.supportedLocales.includes(i))try{ - const t=`${ - this.baseUrl} - /${ - i} - .json`,s=await fetch(t); - if(!s.ok)throw new Error(`HTTP error! status: ${ - s.status} - `); - this.translations=await s.json()} - catch(s){ - this.translations=agt} - else this.translations=agt} - t(t){ - return this.getNestedTranslation(t,this.translations)||t} - getNestedTranslation(t,i){ - const s=t.split("."); - let e=i; - for(const n of s){ - if("object"!=typeof e)return""; - e=e[n]} - return"string"==typeof e?e:""} - } - ; - Qt(cgt,"dg"); - let lgt=cgt; - var ugt; - !function(t){ - t.SDK_MODAL_VIEWED="sdk_modal_viewed",t.SDK_MODAL_BUTTON_CLICKED="sdk_modal_button_clicked",t.SDK_MODAL_TOGGLE_CHANGED="sdk_modal_toggle_changed"} - (ugt||(ugt={ - } - )); - const dgt=(vt=class{ - constructor(t){ - fpt(this,t),this.close=zpt(this,"close"),this.startDesktopOnboarding=zpt(this,"startDesktopOnboarding"),this.trackAnalytics=zpt(this,"trackAnalytics"),this.link=void 0,this.sdkVersion=void 0,this.preferDesktop=void 0,this.tab=1,this.isDefaultTab=!0,this.translationsLoaded=!1,this.onClose=this.onClose.bind(this),this.onStartDesktopOnboardingHandler=this.onStartDesktopOnboardingHandler.bind(this),this.setTab=this.setTab.bind(this),this.render=this.render.bind(this),this.setTab(this.preferDesktop?1:2),this.i18nInstance=new lgt} - componentDidLoad(){ - this.trackAnalytics.emit({ - event:ugt.SDK_MODAL_VIEWED,params:{ - extensionInstalled:!1,tab:1===this.tab?"desktop":"mobile"} - } - )} - async connectedCallback(){ - await this.i18nInstance.init({ - fallbackLng:"en"} - ),this.translationsLoaded=!0} - updatePreferDesktop(t){ - t?this.setTab(1):this.setTab(2)} - onClose(t=!1){ - this.close.emit({ - shouldTerminate:t} - )} - onStartDesktopOnboardingHandler(){ - this.trackAnalytics.emit({ - event:ugt.SDK_MODAL_BUTTON_CLICKED,params:{ - button_type:"install_extension",tab:"desktop"} - } - ),this.startDesktopOnboarding.emit()} - setTab(t,i=!1){ - i&&this.trackAnalytics.emit({ - event:ugt.SDK_MODAL_TOGGLE_CHANGED,params:{ - toggle:1===this.tab?"desktop_to_mobile":"mobile_to_desktop"} - } - ),this.tab=t,this.isDefaultTab=!1} - render(){ - if(!this.translationsLoaded)return null; - const t=Qt(t=>this.i18nInstance.t(t),"e"),i=this.isDefaultTab?this.preferDesktop?1:2:this.tab,s=ogt(this.link,"svg",{ - ecc:"medium",scale:2} - ); - return Fpt(Rwt,{ - className:"install-model"} - ,Fpt("div",{ - class:"backdrop",onClick:Qt(()=>this.onClose(!0),"onClick")} - ),Fpt("div",{ - class:"modal"} - ,Fpt("div",{ - class:"closeButtonContainer"} - ,Fpt("div",{ - class:"right"} - ,Fpt("span",{ - class:"closeButton",onClick:Qt(()=>this.onClose(!0),"onClick")} - ,Fpt(Uwt,null)))),Fpt("div",{ - class:"logoContainer"} - ,Fpt(Fwt,null)),Fpt("div",null,Fpt("div",{ - class:"tabcontainer"} - ,Fpt("div",{ - class:"flexContainer"} - ,Fpt("div",{ - onClick:Qt(()=>this.setTab(1,!0),"onClick"),class:"tab flexItem "+(1===i?"tabactive":"")} - ,t("DESKTOP")),Fpt("div",{ - onClick:Qt(()=>this.setTab(2,!0),"onClick"),class:"tab flexItem "+(2===i?"tabactive":"")} - ,t("MOBILE")))),Fpt("div",{ - style:{ - display:1===i?"none":"block"} - } - ,Fpt("div",{ - class:"flexContainer"} - ,Fpt("div",{ - class:"flexItem",style:{ - textAlign:"center",marginTop:"4"} - } - ,s&&Fpt("div",{ - id:"sdk-mm-qrcode",class:"center",innerHTML:s} - ),Fpt("div",{ - class:"connectMobileText"} - ,t("SCAN_TO_CONNECT")," ",Fpt("br",null),Fpt("span",{ - class:"blue"} - ,Fpt("b",null,t("META_MASK_MOBILE_APP"))))))),Fpt("div",{ - style:{ - display:2===i?"none":"block"} - } - ,Fpt("div",{ - class:"item"} - ,Fpt(Pwt,{ - Icon:Lwt,text:t("INSTALL_MODAL.TRUSTED_BY_USERS")} - )),Fpt("div",{ - class:"item"} - ,Fpt(Pwt,{ - Icon:Nwt,text:t("INSTALL_MODAL.LEADING_CRYPTO_WALLET")} - )),Fpt("div",{ - class:"item"} - ,Fpt(Pwt,{ - Icon:Dwt,text:t("INSTALL_MODAL.CONTROL_DIGITAL_INTERACTIONS")} - )),Fpt("button",{ - class:"button",onClick:Qt(()=>this.onStartDesktopOnboardingHandler(),"onClick")} - ,Fpt(Gwt,null),Fpt("span",{ - class:"installExtensionText"} - ,t("INSTALL_MODAL.INSTALL_META_MASK_EXTENSION"))))),Fpt(Bwt,{ - version:this.sdkVersion} - )))} - get el(){ - return Kpt(this)} - static get watchers(){ - return{ - preferDesktop:["updatePreferDesktop"]} - } - } - ,Qt(vt,"hg"),vt); - dgt.style=".flexContainer { - \n display: flex; - \n justify-content: center; - \n align-items: center; - \n flex-direction: row; - \n} - \n\n.flexItem { - \n flex: 1; - \n justify-content: center; - \n align-items: center; - \n} - \n\n.flexItem11 { - \n flex: 11; - \n justify-content: center; - \n align-items: center; - \n} - \n\n.flexItem1 { - \n flex: 1; - \n justify-content: center; - \n align-items: center; - \n} - \n\n.tab { - \n padding: 8px; - \n cursor: pointer; - \n background-color: #F2F4F6; - \n font-size: 12px; - \n text-align: center; - \n color: #24292E; - \n} - \n\n.tabcontainer { - \n padding: 4px; - \n background-color: #F2F4F6; - \n border-radius: 8px; - \n margin-bottom: 30px; - \n margin-top: 30px; - \n} - \n\n.tabactive { - \n background-color: white; - \n -webkit-transition: background-color 300ms linear; - \n -ms-transition: background-color 300ms linear; - \n transition: background-color 300ms linear; - \n border-radius: 8px; - \n} - \n\n.item { - \n font-size: 12px; - \n margin-bottom: 16px; - \n border-radius: 8px; - \n padding: 10px; - \n border: 2px #F2F4F6 solid; - \n color: #24292E; - \n} - \n\n.extensionLabel { - \n font-style: normal; - \n font-weight: bold; - \n font-size: 14px; - \n text-align: cetner; - \n color: #24272A; - \n} - \n\n.notice { - \n font-size: 12px; - \n margin-left: 10px; - \n margin-right: 10px; - \n color: grey; - \n} - \n\n.button { - \n margin-top: 41.5px; - \n margin-bottom: 20px; - \n width: 100%; - \n display: flex; - \n flex-direction: row; - \n justify-content: center; - \n align-items: center; - \n padding: 12px 20px; - \n background: #037DD6; - \n border-radius: 32px; - \n color: white; - \n border: 0; - \n font-size: 14px; - \n cursor: pointer; - \n} - \n\n.backdrop { - \n visibility: visible; - \n position: fixed; - \n top: 0; - \n left: 0; - \n right: 0; - \n bottom: 0; - \n width: 100%; - \n z-index: 99998; - \n background: rgba(0, 0, 0, 0.87); - \n opacity: 0.3; - \n} - \n\n.modal { - \n visibility: visible; - \n position: fixed; - \n left: 50%; - \n transform: translate(-50%, -50%); - \n z-index: 99999; - \n background: white; - \n padding: 20px; - \n border-radius: 8px; - \n top: 50%; - \n max-width: 100%; - \n width: 460px; - \n min-width: 300px; - \n box-shadow: rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px; - \n -webkit-font-smoothing: antialiased; - \n} - \n\n.closeButton { - \n color: #BBC0C5; - \n cursor: pointer; - \n} - \n\n.logoContainer { - \n margin-left: 24px; - \n margin-right: 24px; - \n margin-top: 24px; - \n display: flex; - \n align-items: center; - \n justify-content: center; - \n} - \n\n.connectMobileText { - \n font-size: 14px; - \n color: black; - \n margin-top: 28px; - \n margin-bottom: 28px; - \n line-height: 2; - \n} - \n\n.blue { - \n color: #037DD6; - \n font-weight: 700; - \n} - \n\n.installExtensionText { - \n margin-left: 10px; - \n} - \n\n.center { - \n display: flex; - \n justify-content: center; - \n align-items: center; - \n} - \n\n.right { - \n display: flex; - \n align-items: center; - \n justify-content: right; - \n} - \n\n#sdk-mm-qrcode { - \n svg { - \n width: 50%; - \n } - \n} - "; - const fgt=(_t=class{ - constructor(t){ - fpt(this,t),this.close=zpt(this,"close"),this.disconnect=zpt(this,"disconnect"),this.updateOTPValue=zpt(this,"updateOTPValue"),this.displayOTP=void 0,this.sdkVersion=void 0,this.otpCode=void 0,this.translationsLoaded=!1,this.i18nInstance=new lgt} - async connectedCallback(){ - await this.i18nInstance.init({ - fallbackLng:"en"} - ),this.translationsLoaded=!0} - onClose(){ - this.close.emit()} - onDisconnect(){ - this.disconnect.emit()} - onUpdateOTPValueHandler(t){ - this.updateOTPValue.emit({ - otpValue:t} - )} - disconnectedCallback(){ - this.onClose()} - render(){ - var t; - if(!this.translationsLoaded)return null; - const i=null===(t=this.displayOTP)||void 0===t||t,s=this.sdkVersion,e=Qt(t=>this.i18nInstance.t(t),"r"); - return Fpt(Rwt,{ - className:"pending-modal"} - ,Fpt("div",{ - class:"backdrop",onClick:Qt(()=>this.onClose(),"onClick")} - ),Fpt("div",{ - class:"modal"} - ,Fpt("div",{ - class:"closeButtonContainer"} - ,Fpt("div",{ - class:"right"} - ,Fpt("span",{ - class:"closeButton",onClick:Qt(()=>this.onClose(),"onClick")} - ,Fpt(Uwt,null)))),Fpt("div",{ - class:"logoContainer"} - ,Fpt(Fwt,null)),Fpt("div",null,Fpt("div",{ - class:"flexContainer",style:{ - flexDirection:"column",color:"black"} - } - ,Fpt("div",{ - class:"flexItem",style:{ - textAlign:"center",marginTop:"30px",marginBottom:"30px",fontSize:"16px"} - } - ,e(i?"PENDING_MODAL.OPEN_META_MASK_SELECT_CODE":"PENDING_MODAL.OPEN_META_MASK_CONTINUE")),Fpt("div",{ - id:"sdk-mm-otp-value",style:{ - padding:"10px",fontSize:"32px",display:this.otpCode?"block":"none"} - } - ,this.otpCode),i&&Fpt("div",{ - class:"notice"} - ,"* ",e("PENDING_MODAL.NUMBER_AFTER_OPEN_NOTICE"))),Fpt("div",{ - style:{ - marginTop:"20px"} - } - ,Fpt("button",{ - class:"button blue",style:{ - marginTop:"5px",color:"#0376C9",borderColor:"#0376C9",borderWidth:"1px",borderStyle:"solid",backgroundColor:"white"} - ,onClick:Qt(()=>this.onDisconnect(),"onClick")} - ,e("PENDING_MODAL.DISCONNECT")))),Fpt(Bwt,{ - version:s} - )))} - get el(){ - return Kpt(this)} - } - ,Qt(_t,"fg"),_t); - fgt.style=".flexContainer { - \n display: flex; - \n justify-content: center; - \n align-items: center; - \n flex-direction: row; - \n} - \n\n.flexItem { - \n flex: 1; - \n justify-content: center; - \n align-items: center; - \n} - \n\n.flexItem11 { - \n flex: 11; - \n justify-content: center; - \n align-items: center; - \n} - \n\n.flexItem1 { - \n flex: 1; - \n justify-content: center; - \n align-items: center; - \n} - \n\n.tab { - \n padding: 8px; - \n cursor: pointer; - \n background-color: #F2F4F6; - \n font-size: 12px; - \n text-align: center; - \n color: #24292E; - \n} - \n\n.tabcontainer { - \n padding: 4px; - \n background-color: #F2F4F6; - \n border-radius: 8px; - \n margin-bottom: 30px; - \n margin-top: 30px; - \n} - \n\n.tabactive { - \n background-color: white; - \n -webkit-transition: background-color 300ms linear; - \n -ms-transition: background-color 300ms linear; - \n transition: background-color 300ms linear; - \n border-radius: 8px; - \n} - \n\n.item { - \n font-size: 12px; - \n margin-bottom: 16px; - \n border-radius: 8px; - \n padding: 10px; - \n border: 2px #F2F4F6 solid; - \n color: #24292E; - \n} - \n\n.extensionLabel { - \n font-style: normal; - \n font-weight: bold; - \n font-size: 14px; - \n text-align: cetner; - \n color: #24272A; - \n} - \n\n.notice { - \n font-size: 12px; - \n margin-left: 10px; - \n margin-right: 10px; - \n color: grey; - \n} - \n\n.button { - \n margin-top: 41.5px; - \n margin-bottom: 20px; - \n width: 100%; - \n display: flex; - \n flex-direction: row; - \n justify-content: center; - \n align-items: center; - \n padding: 12px 20px; - \n background: #037DD6; - \n border-radius: 32px; - \n color: white; - \n border: 0; - \n font-size: 14px; - \n cursor: pointer; - \n} - \n\n.backdrop { - \n visibility: visible; - \n position: fixed; - \n top: 0; - \n left: 0; - \n right: 0; - \n bottom: 0; - \n width: 100%; - \n z-index: 99998; - \n background: rgba(0, 0, 0, 0.87); - \n opacity: 0.3; - \n} - \n\n.modal { - \n visibility: visible; - \n position: fixed; - \n left: 50%; - \n transform: translate(-50%, -50%); - \n z-index: 99999; - \n background: white; - \n padding: 20px; - \n border-radius: 8px; - \n top: 50%; - \n max-width: 100%; - \n width: 460px; - \n min-width: 300px; - \n box-shadow: rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px; - \n -webkit-font-smoothing: antialiased; - \n} - \n\n.closeButton { - \n color: #BBC0C5; - \n cursor: pointer; - \n} - \n\n.logoContainer { - \n margin-left: 24px; - \n margin-right: 24px; - \n margin-top: 24px; - \n display: flex; - \n align-items: center; - \n justify-content: center; - \n} - \n\n.connectMobileText { - \n font-size: 14px; - \n color: black; - \n margin-top: 28px; - \n margin-bottom: 28px; - \n line-height: 2; - \n} - \n\n.blue { - \n color: #037DD6; - \n font-weight: 700; - \n} - \n\n.installExtensionText { - \n margin-left: 10px; - \n} - \n\n.center { - \n display: flex; - \n justify-content: center; - \n align-items: center; - \n} - \n\n.right { - \n display: flex; - \n align-items: center; - \n justify-content: right; - \n} - \n\n#sdk-mm-qrcode { - \n svg { - \n width: 50%; - \n } - \n} - "; - const pgt=Qt(()=>Fpt("svg",{ - width:"21",height:"15",viewBox:"0 0 21 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"} - ,Fpt("path",{ - d:"M14.1364 14.9851C13.5909 14.9851 13.2273 14.5851 13.2273 13.9851C13.2273 13.3851 13.5909 12.9851 14.1364 12.9851C16.6818 12.9851 18.6818 10.7851 18.6818 7.98508C18.6818 5.18508 16.6818 2.98508 14.1364 2.98508C11.5909 2.98508 9.59091 5.18508 9.59091 7.98508C9.59091 8.58508 9.22727 8.98508 8.68182 8.98508C8.13636 8.98508 7.77273 8.58508 7.77273 7.98508C7.77273 4.08508 10.5909 0.985077 14.1364 0.985077C17.6818 0.985077 20.5 4.08508 20.5 7.98508C20.5 11.8851 17.6818 14.9851 14.1364 14.9851ZM6.68182 14.7851C3.22727 14.7851 0.5 11.6851 0.5 7.98508C0.5 4.28508 3.22727 1.18508 6.68182 1.18508C7.22727 1.18508 7.59091 1.58508 7.59091 2.18508C7.59091 2.78508 7.22727 3.18508 6.68182 3.18508C4.22727 3.18508 2.31818 5.38508 2.31818 7.98508C2.31818 10.5851 4.22727 12.7851 6.68182 12.7851C9.13636 12.7851 11.0455 10.6851 11.0455 7.98508C11.0455 7.38508 11.4091 6.98508 11.9545 6.98508C12.5 6.98508 12.8636 7.38508 12.8636 7.98508C12.7727 11.6851 10.0455 14.7851 6.68182 14.7851Z",fill:"white"} - )),"pg"),wgt=Qt(()=>Fpt("svg",{ - width:"400",height:"300",viewBox:"0 0 400 300",fill:"none",xmlns:"http://www.w3.org/2000/svg"} - ,Fpt("rect",{ - width:"400",height:"300",fill:"white"} - ),Fpt("path",{ - d:"M300.116 242.46L250.485 227.681L213.057 250.055L186.944 250.045L149.493 227.681L99.8843 242.46L84.7939 191.518L99.8843 134.979L84.7939 87.1777L99.8843 27.9336L177.402 74.2466H222.598L300.116 27.9336L315.206 87.1777L300.116 134.979L315.206 191.518L300.116 242.46Z",fill:"#FF5C16"} - ),Fpt("path",{ - d:"M99.8955 27.9336L177.414 74.2792L174.331 106.085L99.8955 27.9336Z",fill:"#FF5C16"} - ),Fpt("path",{ - d:"M149.505 191.539L183.612 217.521L149.505 227.681V191.539Z",fill:"#FF5C16"} - ),Fpt("path",{ - d:"M180.886 148.585L174.33 106.107L132.369 134.991L132.348 134.98V135.001L132.477 164.732L149.493 148.585H149.504H180.886Z",fill:"#FF5C16"} - ),Fpt("path",{ - d:"M300.116 27.9336L222.598 74.2792L225.67 106.085L300.116 27.9336Z",fill:"#FF5C16"} - ),Fpt("path",{ - d:"M250.508 191.539L216.4 217.521L250.508 227.681V191.539Z",fill:"#FF5C16"} - ),Fpt("path",{ - d:"M267.652 135.001H267.663H267.652V134.98L267.641 134.991L225.68 106.107L219.125 148.585H250.507L267.533 164.732L267.652 135.001Z",fill:"#FF5C16"} - ),Fpt("path",{ - d:"M149.493 227.681L99.8843 242.46L84.7939 191.54H149.493V227.681Z",fill:"#E34807"} - ),Fpt("path",{ - d:"M180.875 148.574L190.351 209.98L177.219 175.838L132.456 164.732L149.483 148.574H180.864H180.875Z",fill:"#E34807"} - ),Fpt("path",{ - d:"M250.507 227.681L300.116 242.46L315.206 191.54H250.507V227.681Z",fill:"#E34807"} - ),Fpt("path",{ - d:"M219.126 148.574L209.649 209.98L222.782 175.838L267.545 164.732L250.507 148.574H219.126Z",fill:"#E34807"} - ),Fpt("path",{ - d:"M84.7939 191.517L99.8843 134.979H132.337L132.456 164.721L177.219 175.826L190.351 209.969L183.601 217.488L149.493 191.506H84.7939V191.517Z",fill:"#FF8D5D"} - ),Fpt("path",{ - d:"M315.206 191.517L300.116 134.979H267.664L267.545 164.721L222.782 175.826L209.649 209.969L216.4 217.488L250.507 191.506H315.206V191.517Z",fill:"#FF8D5D"} - ),Fpt("path",{ - d:"M222.598 74.2466H200H177.402L174.33 106.053L190.351 209.936H209.649L225.681 106.053L222.598 74.2466Z",fill:"#FF8D5D"} - ),Fpt("path",{ - d:"M99.8843 27.9336L84.7939 87.1777L99.8843 134.979H132.337L174.319 106.085L99.8843 27.9336Z",fill:"#661800"} - ),Fpt("path",{ - d:"M171.496 160.906H156.795L148.79 168.752L177.229 175.804L171.496 160.896V160.906Z",fill:"#661800"} - ),Fpt("path",{ - d:"M300.116 27.9336L315.206 87.1777L300.116 134.979H267.663L225.681 106.085L300.116 27.9336Z",fill:"#661800"} - ),Fpt("path",{ - d:"M228.525 160.906H243.248L251.253 168.763L222.781 175.826L228.525 160.896V160.906Z",fill:"#661800"} - ),Fpt("path",{ - d:"M213.046 229.789L216.399 217.51L209.649 209.991H190.34L183.59 217.51L186.943 229.789",fill:"#661800"} - ),Fpt("path",{ - d:"M213.047 229.789V250.066H186.944V229.789H213.047Z",fill:"#C0C4CD"} - ),Fpt("path",{ - d:"M149.504 227.66L186.965 250.056V229.779L183.611 217.5L149.504 227.66Z",fill:"#E7EBF6"} - ),Fpt("path",{ - d:"M250.506 227.66L213.045 250.056V229.779L216.398 217.5L250.506 227.66Z",fill:"#E7EBF6"} - )),"gg"),ggt=(Mt=class{ - constructor(t){ - fpt(this,t),this.close=zpt(this,"close"),this.connectWithExtension=zpt(this,"connectWithExtension"),this.link=void 0,this.sdkVersion=void 0,this.preferDesktop=void 0,this.tab=1,this.isDefaultTab=!0,this.translationsLoaded=!1,this.i18nInstance=new lgt,this.setTab(this.preferDesktop?1:2)} - async connectedCallback(){ - await this.i18nInstance.init({ - fallbackLng:"en"} - ),this.translationsLoaded=!0} - onClose(t=!1){ - this.close.emit({ - shouldTerminate:t} - )} - connectWithExtensionHandler(){ - this.connectWithExtension.emit()} - setTab(t){ - this.tab=t,this.isDefaultTab=!1} - disconnectedCallback(){ - this.onClose()} - updatePreferDesktop(t){ - t?this.setTab(1):this.setTab(2)} - render(){ - if(!this.translationsLoaded)return null; - const t=Qt(t=>this.i18nInstance.t(t),"e"),i=this.sdkVersion,s=this.isDefaultTab?this.preferDesktop?1:2:this.tab,e=ogt(this.link,"svg",{ - ecc:"medium",scale:2} - ); - return Fpt(Rwt,{ - className:"select-modal"} - ,Fpt("div",{ - class:"backdrop",onClick:Qt(()=>this.onClose(!0),"onClick")} - ),Fpt("div",{ - class:"modal"} - ,Fpt("div",{ - class:"closeButtonContainer"} - ,Fpt("div",{ - class:"right"} - ,Fpt("span",{ - class:"closeButton",onClick:Qt(()=>this.onClose(!0),"onClick")} - ,Fpt(Uwt,null)))),Fpt("div",{ - class:"logoContainer"} - ,Fpt(Fwt,null)),Fpt("div",null,Fpt("div",{ - class:"tabcontainer"} - ,Fpt("div",{ - class:"flexContainer"} - ,Fpt("div",{ - onClick:Qt(()=>this.setTab(1),"onClick"),class:"tab flexItem "+(1===s?"tabactive":"")} - ,t("DESKTOP")),Fpt("div",{ - onClick:Qt(()=>this.setTab(2),"onClick"),class:"tab flexItem "+(2===s?"tabactive":"")} - ,t("MOBILE")))),Fpt("div",{ - style:{ - display:1===s?"none":"block"} - } - ,Fpt("div",{ - class:"flexContainer"} - ,Fpt("div",{ - class:"flexItem",style:{ - textAlign:"center",marginTop:"4"} - } - ,Fpt("div",{ - class:"center",id:"sdk-mm-qrcode",innerHTML:e} - ),Fpt("div",{ - class:"connectMobileText"} - ,t("SCAN_TO_CONNECT"),Fpt("br",null),Fpt("span",{ - class:"blue"} - ,Fpt("b",null,t("META_MASK_MOBILE_APP"))))))),Fpt("div",{ - style:{ - display:2===s?"none":"block"} - } - ,Fpt("div",{ - style:{ - display:"flex",justifyContent:"center",height:"300",marginTop:"-20"} - } - ,Fpt(wgt,null)),Fpt("div",{ - class:"extensionLabel"} - ,t("SELECT_MODAL.CRYPTO_TAKE_CONTROL_TEXT")),Fpt("button",{ - class:"button",onClick:Qt(()=>this.connectWithExtensionHandler(),"onClick")} - ,Fpt(pgt,null),Fpt("span",{ - class:"installExtensionText"} - ,t("CONNECT_WITH_EXTENSION"))))),Fpt(Bwt,{ - version:i} - )))} - get el(){ - return Kpt(this)} - static get watchers(){ - return{ - preferDesktop:["updatePreferDesktop"]} - } - } - ,Qt(Mt,"mg"),Mt); - ggt.style=".flexContainer { - \n display: flex; - \n justify-content: center; - \n align-items: center; - \n flex-direction: row; - \n} - \n\n.flexItem { - \n flex: 1; - \n justify-content: center; - \n align-items: center; - \n} - \n\n.flexItem11 { - \n flex: 11; - \n justify-content: center; - \n align-items: center; - \n} - \n\n.flexItem1 { - \n flex: 1; - \n justify-content: center; - \n align-items: center; - \n} - \n\n.tab { - \n padding: 8px; - \n cursor: pointer; - \n background-color: #F2F4F6; - \n font-size: 12px; - \n text-align: center; - \n color: #24292E; - \n} - \n\n.tabcontainer { - \n padding: 4px; - \n background-color: #F2F4F6; - \n border-radius: 8px; - \n margin-bottom: 30px; - \n margin-top: 30px; - \n} - \n\n.tabactive { - \n background-color: white; - \n -webkit-transition: background-color 300ms linear; - \n -ms-transition: background-color 300ms linear; - \n transition: background-color 300ms linear; - \n border-radius: 8px; - \n} - \n\n.item { - \n font-size: 12px; - \n margin-bottom: 16px; - \n border-radius: 8px; - \n padding: 10px; - \n border: 2px #F2F4F6 solid; - \n color: #24292E; - \n} - \n\n.extensionLabel { - \n font-style: normal; - \n font-weight: bold; - \n font-size: 14px; - \n text-align: cetner; - \n color: #24272A; - \n} - \n\n.notice { - \n font-size: 12px; - \n margin-left: 10px; - \n margin-right: 10px; - \n color: grey; - \n} - \n\n.button { - \n margin-top: 41.5px; - \n margin-bottom: 20px; - \n width: 100%; - \n display: flex; - \n flex-direction: row; - \n justify-content: center; - \n align-items: center; - \n padding: 12px 20px; - \n background: #037DD6; - \n border-radius: 32px; - \n color: white; - \n border: 0; - \n font-size: 14px; - \n cursor: pointer; - \n} - \n\n.backdrop { - \n visibility: visible; - \n position: fixed; - \n top: 0; - \n left: 0; - \n right: 0; - \n bottom: 0; - \n width: 100%; - \n z-index: 99998; - \n background: rgba(0, 0, 0, 0.87); - \n opacity: 0.3; - \n} - \n\n.modal { - \n visibility: visible; - \n position: fixed; - \n left: 50%; - \n transform: translate(-50%, -50%); - \n z-index: 99999; - \n background: white; - \n padding: 20px; - \n border-radius: 8px; - \n top: 50%; - \n max-width: 100%; - \n width: 460px; - \n min-width: 300px; - \n box-shadow: rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px; - \n -webkit-font-smoothing: antialiased; - \n} - \n\n.closeButton { - \n color: #BBC0C5; - \n cursor: pointer; - \n} - \n\n.logoContainer { - \n margin-left: 24px; - \n margin-right: 24px; - \n margin-top: 24px; - \n display: flex; - \n align-items: center; - \n justify-content: center; - \n} - \n\n.connectMobileText { - \n font-size: 14px; - \n color: black; - \n margin-top: 28px; - \n margin-bottom: 28px; - \n line-height: 2; - \n} - \n\n.blue { - \n color: #037DD6; - \n font-weight: 700; - \n} - \n\n.installExtensionText { - \n margin-left: 10px; - \n} - \n\n.center { - \n display: flex; - \n justify-content: center; - \n align-items: center; - \n} - \n\n.right { - \n display: flex; - \n align-items: center; - \n justify-content: right; - \n} - \n\n#sdk-mm-qrcode { - \n svg { - \n width: 50%; - \n } - \n} - "; - var mgt=Object.freeze({ - __proto__:null,mm_install_modal:dgt,mm_pending_modal:fgt,mm_select_modal:ggt} - );
FederatedEvent 1 hunks, 15241 statements
- constructor(i){ - this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=t.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Ai,this.page=new Ai,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=i} - get layerX(){ - return this.layer.x} - get layerY(){ - return this.layer.y} - get pageX(){ - return this.page.x} - get pageY(){ - return this.page.y} - get data(){ - return this} - composedPath(){ - return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path} - initEvent(t,i,s){ - throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")} - initUIEvent(t,i,s,e,n){ - throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")} - preventDefault(){ - this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0} - stopImmediatePropagation(){ - this.propagationImmediatelyStopped=!0} - stopPropagation(){ - this.propagationStopped=!0} - } - ; - Qt(Qn,"FederatedEvent"); - let Zn=Qn; - var th=/iPhone/i,ih=/iPod/i,sh=/iPad/i,eh=/\biOS-universal(?:.+)Mac\b/i,nh=/\bAndroid(?:.+)Mobile\b/i,hh=/Android/i,rh=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,oh=/Silk/i,ah=/Windows Phone/i,ch=/\bWindows(?:.+)ARM\b/i,lh=/BlackBerry/i,uh=/BB10/i,dh=/Opera Mini/i,fh=/\b(CriOS|Chrome)(?:.+)Mobile/i,ph=/Mobile(?:.+)Firefox\b/i,wh=Qt(function(t){ - return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream} - ,"isAppleTabletOnIos13"); - function gh(t){ - return function(i){ - return i.test(t)} - } - function mh(t){ - var i={ - userAgent:"",platform:"",maxTouchPoints:0} - ; - t||"undefined"==typeof navigator?"string"==typeof t?i.userAgent=t:t&&t.userAgent&&(i={ - userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0} - ):i={ - userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0} - ; - var s=i.userAgent,e=s.split("[FBAN"); - void 0!==e[1]&&(s=e[0]),void 0!==(e=s.split("Twitter"))[1]&&(s=e[0]); - var n=gh(s),h={ - apple:{ - phone:n(th)&&!n(ah),ipod:n(ih),tablet:!n(th)&&(n(sh)||wh(i))&&!n(ah),universal:n(eh),device:(n(th)||n(ih)||n(sh)||n(eh)||wh(i))&&!n(ah)} - ,amazon:{ - phone:n(rh),tablet:!n(rh)&&n(oh),device:n(rh)||n(oh)} - ,android:{ - phone:!n(ah)&&n(rh)||!n(ah)&&n(nh),tablet:!n(ah)&&!n(rh)&&!n(nh)&&(n(oh)||n(hh)),device:!n(ah)&&(n(rh)||n(oh)||n(nh)||n(hh))||n(/\bokhttp\b/i)} - ,windows:{ - phone:n(ah),tablet:n(ch),device:n(ah)||n(ch)} - ,other:{ - blackberry:n(lh),blackberry10:n(uh),opera:n(dh),firefox:n(ph),chrome:n(fh),device:n(lh)||n(uh)||n(dh)||n(ph)||n(fh)} - ,any:!1,phone:!1,tablet:!1} - ; - return h.any=h.apple.device||h.android.device||h.windows.device||h.other.device,h.phone=h.apple.phone||h.android.phone||h.windows.phone,h.tablet=h.apple.tablet||h.android.tablet||h.windows.tablet,h} - Qt(gh,"createMatch"),Qt(mh,"isMobile$2"); - const vh=(mh.default??mh)(globalThis.navigator),_h=(c=class{ - constructor(t,i=vh){ - this._mobileInfo=i,this.debug=!1,this._activateOnTab=!0,this._deactivateOnMouseMove=!0,this._isActive=!1,this._isMobileAccessibility=!1,this._div=null,this._pools={ - } - ,this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._isRunningTests=!1,this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnMouseMove=this._onMouseMove.bind(this),this._hookDiv=null,(i.tablet||i.phone)&&this._createTouchHook(),this._renderer=t} - get isActive(){ - return this._isActive} - get isMobileAccessibility(){ - return this._isMobileAccessibility} - get hookDiv(){ - return this._hookDiv} - get div(){ - return this._div} - _createTouchHook(){ - const t=document.createElement("button"); - t.style.width="1px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.left="-1000px",t.style.zIndex=2..toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",()=>{ - this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()} - ),document.body.appendChild(t),this._hookDiv=t} - _destroyTouchHook(){ - this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)} - _activate(){ - if(this._isActive)return; - this._isActive=!0,this._div||(this._div=document.createElement("div"),this._div.style.position="absolute",this._div.style.top="0px",this._div.style.left="0px",this._div.style.pointerEvents="none",this._div.style.zIndex=2..toString(),this._canvasObserver=new Jn({ - domElement:this._div,renderer:this._renderer} - )),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._deactivateOnMouseMove&&globalThis.document.addEventListener("mousemove",this._boundOnMouseMove,!0); - const t=this._renderer.view.canvas; - if(t.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup(); - else{ - const i=new MutationObserver(()=>{ - t.parentNode&&(i.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup())} - ); - i.observe(document.body,{ - childList:!0,subtree:!0} - )} - } - _initAccessibilitySetup(){ - this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered)} - _deactivate(){ - var t,i; - if(this._isActive&&!this._isMobileAccessibility){ - this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._boundOnMouseMove,!0),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._renderer.runners.postrender.remove(this); - for(const i of this._children)(null==(t=i._accessibleDiv)?void 0:t.parentNode)&&(i._accessibleDiv.parentNode.removeChild(i._accessibleDiv),i._accessibleDiv=null),i._accessibleActive=!1; - for(const t in this._pools)this._pools[t].forEach(t=>{ - t.parentNode&&t.parentNode.removeChild(t)} - ),delete this._pools[t]; - (null==(i=this._div)?void 0:i.parentNode)&&this._div.parentNode.removeChild(this._div),this._pools={ - } - ,this._children=[]} - } - _updateAccessibleObjects(t){ - if(!t.visible||!t.accessibleChildren)return; - t.accessible&&(t._accessibleActive||this._addChild(t),t._renderId=this._renderId); - const i=t.children; - if(i)for(let s=0; - s<i.length; - s++)this._updateAccessibleObjects(i[s])} - init(t){ - const i={ - accessibilityOptions:{ - ...c.defaultOptions,...(null==t?void 0:t.accessibilityOptions)||{ - } - } - } - ; - this.debug=i.accessibilityOptions.debug,this._activateOnTab=i.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=i.accessibilityOptions.deactivateOnMouseMove,i.accessibilityOptions.enabledByDefault&&this._activate(),this._renderer.runners.postrender.remove(this)} - postrender(){ - const t=performance.now(); - if(this._mobileInfo.android.device&&t<this._androidUpdateCount)return; - if(this._androidUpdateCount=t+this._androidUpdateFrequency,!(this._renderer.renderingToScreen&&this._renderer.view.canvas||this._isRunningTests))return; - const i=new Set; - if(this._renderer.lastObjectRendered){ - this._updateAccessibleObjects(this._renderer.lastObjectRendered); - for(const t of this._children)t._renderId===this._renderId&&i.add(this._children.indexOf(t))} - for(let s=this._children.length-1; - s>=0; - s--){ - const t=this._children[s]; - i.has(s)||(t._accessibleDiv&&t._accessibleDiv.parentNode&&(t._accessibleDiv.parentNode.removeChild(t._accessibleDiv),this._getPool(t.accessibleType).push(t._accessibleDiv),t._accessibleDiv=null),t._accessibleActive=!1,se(this._children,s,1))} - this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached(); - for(let s=0; - s<this._children.length; - s++){ - const t=this._children[s]; - if(!t._accessibleActive||!t._accessibleDiv)continue; - const i=t._accessibleDiv,e=t.hitArea||t.getBounds().rectangle; - if(t.hitArea){ - const s=t.worldTransform; - i.style.left=`${ - s.tx+e.x*s.a} - px`,i.style.top=`${ - s.ty+e.y*s.d} - px`,i.style.width=e.width*s.a+"px",i.style.height=e.height*s.d+"px"} - else this._capHitArea(e),i.style.left=`${ - e.x} - px`,i.style.top=`${ - e.y} - px`,i.style.width=`${ - e.width} - px`,i.style.height=`${ - e.height} - px`} - this._renderId++} - _updateDebugHTML(t){ - t.innerHTML=`type: ${ - t.type} - </br> title : ${ - t.title} - </br> tabIndex: ${ - t.tabIndex} - `} - _capHitArea(t){ - t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0); - const{ - width:i,height:s} - =this._renderer; - t.x+t.width>i&&(t.width=i-t.x),t.y+t.height>s&&(t.height=s-t.y)} - _addChild(t){ - let i=this._getPool(t.accessibleType).pop(); - i?(i.innerHTML="",i.removeAttribute("title"),i.removeAttribute("aria-label"),i.tabIndex=0):("button"===t.accessibleType?i=document.createElement("button"):(i=document.createElement(t.accessibleType),i.style.cssText="\n color: transparent; - \n pointer-events: none; - \n padding: 0; - \n margin: 0; - \n border: 0; - \n outline: 0; - \n background: transparent; - \n box-sizing: border-box; - \n user-select: none; - \n -webkit-user-select: none; - \n -moz-user-select: none; - \n -ms-user-select: none; - \n ",t.accessibleText&&(i.innerText=t.accessibleText)),i.style.width="100px",i.style.height="100px",i.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",i.style.position="absolute",i.style.zIndex=2..toString(),i.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?i.setAttribute("aria-live","off"):i.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?i.setAttribute("aria-relevant","additions"):i.setAttribute("aria-relevant","text"),i.addEventListener("click",this._onClick.bind(this)),i.addEventListener("focus",this._onFocus.bind(this)),i.addEventListener("focusout",this._onFocusOut.bind(this))),i.style.pointerEvents=t.accessiblePointerEvents,i.type=t.accessibleType,t.accessibleTitle&&null!==t.accessibleTitle?i.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(i.title=`container ${ - t.tabIndex} - `),t.accessibleHint&&null!==t.accessibleHint&&i.setAttribute("aria-label",t.accessibleHint),t.interactive?i.tabIndex=t.tabIndex:i.tabIndex=0,this.debug&&this._updateDebugHTML(i),t._accessibleActive=!0,t._accessibleDiv=i,i.container=t,this._children.push(t),this._div.appendChild(t._accessibleDiv)} - _dispatchEvent(t,i){ - const{ - container:s} - =t.target,e=this._renderer.events.rootBoundary,n=Object.assign(new Zn(e),{ - target:s} - ); - e.rootTarget=this._renderer.lastObjectRendered,i.forEach(t=>e.dispatchEvent(n,t))} - _onClick(t){ - this._dispatchEvent(t,["click","pointertap","tap"])} - _onFocus(t){ - t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive"),this._dispatchEvent(t,["mouseover"])} - _onFocusOut(t){ - t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite"),this._dispatchEvent(t,["mouseout"])} - _onKeyDown(t){ - 9===t.keyCode&&this._activateOnTab&&this._activate()} - _onMouseMove(t){ - 0===t.movementX&&0===t.movementY||this._deactivate()} - destroy(){ - var t; - this._deactivate(),this._destroyTouchHook(),null==(t=this._canvasObserver)||t.destroy(),this._canvasObserver=null,this._div=null,this._pools=null,this._children=null,this._renderer=null,this._hookDiv=null,globalThis.removeEventListener("keydown",this._boundOnKeyDown),this._boundOnKeyDown=null,globalThis.document.removeEventListener("mousemove",this._boundOnMouseMove,!0),this._boundOnMouseMove=null} - setAccessibilityEnabled(t){ - t?this._activate():this._deactivate()} - _getPool(t){ - return this._pools[t]||(this._pools[t]=[]),this._pools[t]} - } - ,Qt(c,"_AccessibilitySystem"),c); - _h.extension={ - type:[ri.WebGLSystem,ri.WebGPUSystem],name:"accessibility"} - ,_h.defaultOptions={ - enabledByDefault:!1,debug:!1,activateOnTab:!0,deactivateOnMouseMove:!0} - ; - let Mh=_h; - const bh={ - accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,accessibleType:"button",accessibleText:null,accessiblePointerEvents:"auto",accessibleChildren:!0,_accessibleActive:!1,_accessibleDiv:null,_renderId:-1} - ,yh=Object.create(null),Eh=Object.create(null); - function Ah(t,i){ - let s=Eh[t]; - return void 0===s&&(void 0===yh[i]&&(yh[i]=1),Eh[t]=s=yh[i]++),s} - let Sh,Th; - function Ch(){ - if(!Sh||(null==Sh?void 0:Sh.isContextLost())){ - const t=ln.get().createCanvas(); - Sh=t.getContext("webgl",{ - } - )} - return Sh} - function Oh(){ - if(!Th){ - Th="mediump"; - const t=Ch(); - if(t&&t.getShaderPrecisionFormat){ - const i=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT); - Th=i.precision?"highp":"mediump"} - } - return Th} - function Ih(t,i,s){ - return i?t:s?`\n\n #ifdef GL_ES // This checks if it is WebGL1\n #define in varying\n #define finalColor gl_FragColor\n #define texture texture2D\n #endif\n ${ - t=t.replace("out vec4 finalColor; - ","")} - \n `:`\n\n #ifdef GL_ES // This checks if it is WebGL1\n #define in attribute\n #define out varying\n #endif\n ${ - t} - \n `} - function kh(t,i,s){ - const e=s?i.maxSupportedFragmentPrecision:i.maxSupportedVertexPrecision; - if("precision"!==t.substring(0,9)){ - let n=s?i.requestedFragmentPrecision:i.requestedVertexPrecision; - return"highp"===n&&"highp"!==e&&(n="mediump"),`precision ${ - n} - float; - \n${ - t} - `} - return"highp"!==e&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t} - function xh(t,i){ - return i?`#version 300 es\n${ - t} - `:t} - Qt(Ah,"createIdFromString"),Qt(Ch,"getTestContext"),Qt(Oh,"getMaxFragmentPrecision"),Qt(Ih,"addProgramDefines"),Qt(kh,"ensurePrecision"),Qt(xh,"insertVersion"); - const Rh={ - } - ,Ph={ - } - ; - function Nh(t,{ - name:i="pixi-program"} - ,s=!0){ - i=i.replace(/\s+/g,"-"); - const e=s?Rh:Ph; - return e[i+=s?"-fragment":"-vertex"]?(e[i]++,i+=`-${ - e[i]} - `):e[i]=1,-1!==t.indexOf("#define SHADER_NAME")?t:`#define SHADER_NAME ${ - i} - \n${ - t} - `} - function Lh(t,i){ - return i?t.replace("#version 300 es",""):t} - Qt(Nh,"setProgramName"),Qt(Lh,"stripVersion"); - const Dh={ - stripVersion:Lh,ensurePrecision:kh,addProgramDefines:Ih,setProgramName:Nh,insertVersion:xh} - ,Gh=Object.create(null),Bh=(Qt(l=class{ - constructor(t){ - const i=-1!==(t={ - ...l.defaultOptions,...t} - ).fragment.indexOf("#version 300 es"),s={ - stripVersion:i,ensurePrecision:{ - requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:Oh()} - ,setProgramName:{ - name:t.name} - ,addProgramDefines:i,insertVersion:i} - ; - let e=t.fragment,n=t.vertex; - Object.keys(Dh).forEach(t=>{ - const i=s[t]; - e=Dh[t](e,i,!0),n=Dh[t](n,i,!1)} - ),this.fragment=e,this.vertex=n,this.transformFeedbackVaryings=t.transformFeedbackVaryings,this._key=Ah(`${ - this.vertex} - :${ - this.fragment} - `,"gl-program")} - destroy(){ - this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,Gh[this._cacheKey]=null} - static from(t){ - const i=`${ - t.vertex} - :${ - t.fragment} - `; - return Gh[i]||(Gh[i]=new l(t),Gh[i]._cacheKey=i),Gh[i]} - } - ,"_GlProgram"),l); - Bh.defaultOptions={ - preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"} - ; - let Uh=Bh; - const Fh={ - uint8x2:{ - size:2,stride:2,normalised:!1} - ,uint8x4:{ - size:4,stride:4,normalised:!1} - ,sint8x2:{ - size:2,stride:2,normalised:!1} - ,sint8x4:{ - size:4,stride:4,normalised:!1} - ,unorm8x2:{ - size:2,stride:2,normalised:!0} - ,unorm8x4:{ - size:4,stride:4,normalised:!0} - ,snorm8x2:{ - size:2,stride:2,normalised:!0} - ,snorm8x4:{ - size:4,stride:4,normalised:!0} - ,uint16x2:{ - size:2,stride:4,normalised:!1} - ,uint16x4:{ - size:4,stride:8,normalised:!1} - ,sint16x2:{ - size:2,stride:4,normalised:!1} - ,sint16x4:{ - size:4,stride:8,normalised:!1} - ,unorm16x2:{ - size:2,stride:4,normalised:!0} - ,unorm16x4:{ - size:4,stride:8,normalised:!0} - ,snorm16x2:{ - size:2,stride:4,normalised:!0} - ,snorm16x4:{ - size:4,stride:8,normalised:!0} - ,float16x2:{ - size:2,stride:4,normalised:!1} - ,float16x4:{ - size:4,stride:8,normalised:!1} - ,float32:{ - size:1,stride:4,normalised:!1} - ,float32x2:{ - size:2,stride:8,normalised:!1} - ,float32x3:{ - size:3,stride:12,normalised:!1} - ,float32x4:{ - size:4,stride:16,normalised:!1} - ,uint32:{ - size:1,stride:4,normalised:!1} - ,uint32x2:{ - size:2,stride:8,normalised:!1} - ,uint32x3:{ - size:3,stride:12,normalised:!1} - ,uint32x4:{ - size:4,stride:16,normalised:!1} - ,sint32:{ - size:1,stride:4,normalised:!1} - ,sint32x2:{ - size:2,stride:8,normalised:!1} - ,sint32x3:{ - size:3,stride:12,normalised:!1} - ,sint32x4:{ - size:4,stride:16,normalised:!1} - } - ; - function $h(t){ - return Fh[t]??Fh.float32} - Qt($h,"getAttributeInfoFromFormat"); - const Hh={ - f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"} - ,Wh=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g; - function Vh(t,i){ - let s; - for(; - null!==(s=Wh.exec(t)); - ){ - const t=Hh[s[3]]??"float32"; - i[s[2]]={ - location:parseInt(s[1],10),format:t,stride:$h(t).stride,offset:0,instance:!1,start:0} - } - Wh.lastIndex=0} - function jh(t){ - return t.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")} - function Kh({ - source:t,entryPoint:i} - ){ - const s={ - } - ,e=jh(t),n=e.indexOf(`fn ${ - i} - (`); - if(-1===n)return s; - const h=e.indexOf("->",n); - if(-1===h)return s; - const r=e.substring(n,h); - if(Vh(r,s),0===Object.keys(s).length){ - const t=r.match(/\(\s*\w+\s*:\s*(\w+)/); - if(t){ - const i=t[1],n=new RegExp(`struct\\s+${ - i} - \\s*\\{ - ([^} - ]+)\\} - `,"s"),h=e.match(n); - h&&Vh(h[1],s)} - } - return s} - function zh(t){ - var i,s; - const e=/@group\((\d+)\)/,n=/@binding\((\d+)\)/,h=/var(<[^>]+>)? (\w+)/,r=/:\s*([\w<>]+)/,o=/(\w+)\s*:\s*([\w\<\>]+)/g,a=/struct\s+(\w+)/,c=null==(i=t.match(/(^|[^/])@(group|binding)\(\d+\)[^; - ]+; - /g))?void 0:i.map(t=>({ - group:parseInt(t.match(e)[1],10),binding:parseInt(t.match(n)[1],10),name:t.match(h)[2],isUniform:"<uniform>"===t.match(h)[1],type:t.match(r)[1]} - )); - if(!c)return{ - groups:[],structs:[]} - ; - const l=(null==(s=t.match(/struct\s+(\w+)\s*{ - ([^} - ]+)} - /g))?void 0:s.map(t=>{ - const i=t.match(a)[1],s=t.match(o).reduce((t,i)=>{ - const[s,e]=i.split(":"); - return t[s.trim()]=e.trim(),t} - ,{ - } - ); - return s?{ - name:i,members:s} - :null} - ).filter(({ - name:t} - )=>c.some(i=>i.type===t||i.type.includes(`<${ - t} - >`))))??[]; - return{ - groups:c,structs:l} - } - Qt(Vh,"parseLocations"),Qt(jh,"stripComments"),Qt(Kh,"extractAttributesFromGpuProgram"),Qt(zh,"extractStructAndGroups"); - var Yh=(t=>(t[t.VERTEX=1]="VERTEX",t[t.FRAGMENT=2]="FRAGMENT",t[t.COMPUTE=4]="COMPUTE",t))(Yh||{ - } - ); - function qh({ - groups:t} - ){ - const i=[]; - for(let s=0; - s<t.length; - s++){ - const e=t[s]; - i[e.group]||(i[e.group]=[]),e.isUniform?i[e.group].push({ - binding:e.binding,visibility:Yh.VERTEX|Yh.FRAGMENT,buffer:{ - type:"uniform"} - } - ):"sampler"===e.type?i[e.group].push({ - binding:e.binding,visibility:Yh.FRAGMENT,sampler:{ - type:"filtering"} - } - ):"texture_2d"===e.type||e.type.startsWith("texture_2d<")?i[e.group].push({ - binding:e.binding,visibility:Yh.FRAGMENT,texture:{ - sampleType:"float",viewDimension:"2d",multisampled:!1} - } - ):"texture_2d_array"===e.type||e.type.startsWith("texture_2d_array<")?i[e.group].push({ - binding:e.binding,visibility:Yh.FRAGMENT,texture:{ - sampleType:"float",viewDimension:"2d-array",multisampled:!1} - } - ):("texture_cube"===e.type||e.type.startsWith("texture_cube<"))&&i[e.group].push({ - binding:e.binding,visibility:Yh.FRAGMENT,texture:{ - sampleType:"float",viewDimension:"cube",multisampled:!1} - } - )} - for(let s=0; - s<i.length; - s++)i[s]||(i[s]=[]); - return i} - function Xh({ - groups:t} - ){ - const i=[]; - for(let s=0; - s<t.length; - s++){ - const e=t[s]; - i[e.group]||(i[e.group]={ - } - ),i[e.group][e.name]=e.binding} - return i} - function Jh(t,i){ - const s=new Set,e=new Set; - return{ - structs:[...t.structs,...i.structs].filter(t=>!s.has(t.name)&&(s.add(t.name),!0)),groups:[...t.groups,...i.groups].filter(t=>{ - const i=`${ - t.name} - -${ - t.binding} - `; - return!e.has(i)&&(e.add(i),!0)} - )} - } - Qt(qh,"generateGpuLayoutGroups"),Qt(Xh,"generateLayoutHash"),Qt(Jh,"removeStructAndGroupDuplicates"); - const Qh=Object.create(null),Zh=class t{ - constructor(t){ - var i,s; - this._layoutKey=0,this._attributeLocationsKey=0; - const{ - fragment:e,vertex:n,layout:h,gpuLayout:r,name:o} - =t; - if(this.name=o,this.fragment=e,this.vertex=n,e.source===n.source){ - const t=zh(e.source); - this.structsAndGroups=t} - else{ - const t=zh(n.source),i=zh(e.source); - this.structsAndGroups=Jh(t,i)} - this.layout=h??Xh(this.structsAndGroups),this.gpuLayout=r??qh(this.structsAndGroups),this.autoAssignGlobalUniforms=!(void 0===(null==(i=this.layout[0])?void 0:i.globalUniforms)),this.autoAssignLocalUniforms=!(void 0===(null==(s=this.layout[1])?void 0:s.localUniforms)),this._generateProgramKey()} - _generateProgramKey(){ - const{ - vertex:t,fragment:i} - =this,s=t.source+i.source+t.entryPoint+i.entryPoint; - this._layoutKey=Ah(s,"program")} - get attributeData(){ - return this._attributeData??(this._attributeData=Kh(this.vertex)),this._attributeData} - destroy(){ - this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,Qh[this._cacheKey]=null} - static from(i){ - const s=`${ - i.vertex.source} - :${ - i.fragment.source} - :${ - i.fragment.entryPoint} - :${ - i.vertex.entryPoint} - `; - return Qh[s]||(Qh[s]=new t(i),Qh[s]._cacheKey=s),Qh[s]} - } - ; - Qt(Zh,"GpuProgram"); - let tr=Zh; - const ir=["f32","i32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>"],sr=ir.reduce((t,i)=>(t[i]=!0,t),{ - } - ); - function er(t,i){ - switch(t){ - case"f32":return 0; - case"vec2<f32>":return new Float32Array(2*i); - case"vec3<f32>":return new Float32Array(3*i); - case"vec4<f32>":return new Float32Array(4*i); - case"mat2x2<f32>":return new Float32Array([1,0,0,1]); - case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]); - case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])} - return null} - Qt(er,"getDefaultUniformValue"); - const nr=(Qt(u=class{ - constructor(t,i){ - this._touched=0,this.uid=Wi("uniform"),this._resourceType="uniformGroup",this._resourceId=Wi("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,i={ - ...u.defaultOptions,...i} - ,this.uniformStructures=t; - const s={ - } - ; - for(const e in t){ - const i=t[e]; - if(i.name=e,i.size=i.size??1,!sr[i.type]){ - const t=i.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/); - if(t){ - const[,s,e]=t; - throw new Error(`Uniform type ${ - i.type} - is not supported. Use type: '${ - s} - ', size: ${ - e} - instead.`)} - throw new Error(`Uniform type ${ - i.type} - is not supported. Supported uniform types are: ${ - ir.join(", ")} - `)} - i.value??(i.value=er(i.type,i.size)),s[e]=i.value} - this.uniforms=s,this._dirtyId=1,this.ubo=i.ubo,this.isStatic=i.isStatic,this._signature=Ah(Object.keys(s).map(i=>`${ - i} - -${ - t[i].type} - `).join("-"),"uniform-group")} - update(){ - this._dirtyId++} - } - ,"_UniformGroup"),u); - nr.defaultOptions={ - ubo:!1,isStatic:!1} - ; - let hr=nr; - const rr=class{ - constructor(t){ - this.resources=Object.create(null),this._dirty=!0; - let i=0; - for(const s in t){ - const e=t[s]; - this.setResource(e,i++)} - this._updateKey()} - _updateKey(){ - if(!this._dirty)return; - this._dirty=!1; - const t=[]; - let i=0; - for(const s in this.resources)t[i++]=this.resources[s]._resourceId; - this._key=t.join("|")} - setResource(t,i){ - var s,e; - const n=this.resources[i]; - t!==n&&(null==(s=null==n?void 0:n.off)||s.call(n,"change",this.onResourceChange,this),null==(e=t.on)||e.call(t,"change",this.onResourceChange,this),this.resources[i]=t,this._dirty=!0)} - getResource(t){ - return this.resources[t]} - _touch(t,i){ - const s=this.resources; - for(const e in s)s[e]._gcLastUsed=t,s[e]._touched=i} - destroy(){ - var t; - const i=this.resources; - for(const s in i){ - const e=i[s]; - null==(t=null==e?void 0:e.off)||t.call(e,"change",this.onResourceChange,this)} - this.resources=null} - onResourceChange(t){ - this._dirty=!0,t.destroyed?this.destroy():this._updateKey()} - } - ; - Qt(rr,"BindGroup"); - let or=rr; - var ar=(t=>(t[t.WEBGL=1]="WEBGL",t[t.WEBGPU=2]="WEBGPU",t[t.CANVAS=4]="CANVAS",t[t.BOTH=3]="BOTH",t))(ar||{ - } - ); - const cr=class t extends vi{ - constructor(t){ - super(),this.uid=Wi("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1; - let{ - gpuProgram:i,glProgram:s,groups:e,resources:n,compatibleRenderers:h,groupMap:r} - =t; - this.gpuProgram=i,this.glProgram=s,void 0===h&&(h=0,i&&(h|=ar.WEBGPU),s&&(h|=ar.WEBGL)),this.compatibleRenderers=h; - const o={ - } - ; - if(n||e||(n={ - } - ),n&&e)throw new Error("[Shader] Cannot have both resources and groups"); - if(!i&&e&&!r)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead."); - if(!i&&e&&r)for(const a in r)for(const t in r[a]){ - const i=r[a][t]; - o[i]={ - group:a,binding:t,name:i} - } - else if(i&&e&&!r){ - const t=i.structsAndGroups.groups; - r={ - } - ,t.forEach(t=>{ - r[t.group]=r[t.group]||{ - } - ,r[t.group][t.binding]=t.name,o[t.name]=t} - )} - else if(n){ - e={ - } - ,r={ - } - ,i&&i.structsAndGroups.groups.forEach(t=>{ - r[t.group]=r[t.group]||{ - } - ,r[t.group][t.binding]=t.name,o[t.name]=t} - ); - let t=0; - for(const i in n)o[i]||(e[99]||(e[99]=new or,this._ownedBindGroups.push(e[99])),o[i]={ - group:99,binding:t,name:i} - ,r[99]=r[99]||{ - } - ,r[99][t]=i,t++); - for(const i in n){ - const t=i; - let s=n[i]; - s.source||s._resourceType||(s=new hr(s)); - const h=o[t]; - h&&(e[h.group]||(e[h.group]=new or,this._ownedBindGroups.push(e[h.group])),e[h.group].setResource(s,h.binding))} - } - this.groups=e,this._uniformBindMap=r,this.resources=this._buildResourceAccessor(e,o)} - addResource(t,i,s){ - var e,n; - (e=this._uniformBindMap)[i]||(e[i]={ - } - ),(n=this._uniformBindMap[i])[s]||(n[s]=t),this.groups[i]||(this.groups[i]=new or,this._ownedBindGroups.push(this.groups[i]))} - _buildResourceAccessor(t,i){ - const s={ - } - ; - for(const e in i){ - const n=i[e]; - Object.defineProperty(s,n.name,{ - get:()=>t[n.group].getResource(n.binding),set(i){ - t[n.group].setResource(i,n.binding)} - } - )} - return s} - destroy(t=!1){ - var i,s; - this._destroyed||(this._destroyed=!0,this.emit("destroy",this),t&&(null==(i=this.gpuProgram)||i.destroy(),null==(s=this.glProgram)||s.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(t=>{ - t.destroy()} - ),this._ownedBindGroups=null,this.resources=null,this.groups=null)} - static from(i){ - const{ - gpu:s,gl:e,...n} - =i; - let h,r; - return s&&(h=tr.from(s)),e&&(r=Uh.from(e)),new t({ - gpuProgram:h,glProgram:r,...n} - )} - } - ; - Qt(cr,"Shader"); - let lr=cr; - const ur={ - normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10} - ,dr=(Qt(d=class{ - constructor(){ - this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0} - get blend(){ - return!!(1&this.data)} - set blend(t){ - !!(1&this.data)!==t&&(this.data^=1)} - get offsets(){ - return!!(2&this.data)} - set offsets(t){ - !!(2&this.data)!==t&&(this.data^=2)} - set cullMode(t){ - "none"!==t?(this.culling=!0,this.clockwiseFrontFace="front"===t):this.culling=!1} - get cullMode(){ - return this.culling?this.clockwiseFrontFace?"front":"back":"none"} - get culling(){ - return!!(4&this.data)} - set culling(t){ - !!(4&this.data)!==t&&(this.data^=4)} - get depthTest(){ - return!!(8&this.data)} - set depthTest(t){ - !!(8&this.data)!==t&&(this.data^=8)} - get depthMask(){ - return!!(32&this.data)} - set depthMask(t){ - !!(32&this.data)!==t&&(this.data^=32)} - get clockwiseFrontFace(){ - return!!(16&this.data)} - set clockwiseFrontFace(t){ - !!(16&this.data)!==t&&(this.data^=16)} - get blendMode(){ - return this._blendMode} - set blendMode(t){ - this.blend="none"!==t,this._blendMode=t,this._blendModeId=ur[t]||0} - get polygonOffset(){ - return this._polygonOffset} - set polygonOffset(t){ - this.offsets=!!t,this._polygonOffset=t} - toString(){ - return`[pixi.js/core:State blendMode=${ - this.blendMode} - clockwiseFrontFace=${ - this.clockwiseFrontFace} - culling=${ - this.culling} - depthMask=${ - this.depthMask} - polygonOffset=${ - this.polygonOffset} - ]`} - static for2d(){ - const t=new d; - return t.depthTest=!1,t.blend=!0,t} - } - ,"_State"),d); - dr.default2d=dr.for2d(); - let fr=dr; - const pr=(Qt(f=class extends lr{ - constructor(t){ - super(t={ - ...f.defaultOptions,...t} - ),this.enabled=!0,this._state=fr.for2d(),this.blendMode=t.blendMode,this.padding=t.padding,"boolean"==typeof t.antialias?this.antialias=t.antialias?"on":"off":this.antialias=t.antialias,this.resolution=t.resolution,this.blendRequired=t.blendRequired,this.clipToViewport=t.clipToViewport,this.addResource("uTexture",0,1),t.blendRequired&&this.addResource("uBackTexture",0,3)} - apply(t,i,s,e){ - t.applyFilter(this,i,s,e)} - get blendMode(){ - return this._state.blendMode} - set blendMode(t){ - this._state.blendMode=t} - static from(t){ - const{ - gpu:i,gl:s,...e} - =t; - let n,h; - return i&&(n=tr.from(i)),s&&(h=Uh.from(s)),new f({ - gpuProgram:n,glProgram:h,...e} - )} - } - ,"_Filter"),f); - pr.defaultOptions={ - blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0} - ; - let wr=pr; - const gr=[]; - async function mr(t){ - if(!t)for(let i=0; - i<gr.length; - i++){ - const t=gr[i]; - if(t.value.test())return void(await t.value.load())} - } - let vr; - function _r(){ - if("boolean"==typeof vr)return vr; - try{ - const t=new Function("param1","param2","param3","return param1[param2] === param3; - "); - vr=!0===t({ - a:"b"} - ,"a","b")} - catch(t){ - vr=!1} - return vr} - function Mr(t,i,s=2){ - const e=i&&i.length,n=e?i[0]*s:t.length; - let h=br(t,0,n,s,!0); - const r=[]; - if(!h||h.next===h.prev)return r; - let o,a,c; - if(e&&(h=Or(t,i,h,s)),t.length>80*s){ - o=t[0],a=t[1]; - let i=o,e=a; - for(let h=s; - h<n; - h+=s){ - const s=t[h],n=t[h+1]; - s<o&&(o=s),n<a&&(a=n),s>i&&(i=s),n>e&&(e=n)} - c=Math.max(i-o,e-a),c=0!==c?32767/c:0} - return Er(h,r,s,o,a,c,0),r} - function br(t,i,s,e,n){ - let h; - if(n===Qr(t,i,s,e)>0)for(let r=i; - r<s; - r+=e)h=qr(r/e|0,t[r],t[r+1],h); - else for(let r=s-e; - r>=i; - r-=e)h=qr(r/e|0,t[r],t[r+1],h); - return h&&$r(h,h.next)&&(Xr(h),h=h.next),h} - function yr(t,i){ - if(!t)return t; - i||(i=t); - let s,e=t; - do{ - if(s=!1,e.steiner||!$r(e,e.next)&&0!==Fr(e.prev,e,e.next))e=e.next; - else{ - if(Xr(e),e=i=e.prev,e===e.next)break; - s=!0} - } - while(s||e!==i); - return i} - function Er(t,i,s,e,n,h,r){ - if(!t)return; - !r&&h&&Pr(t,e,n,h); - let o=t; - for(; - t.prev!==t.next; - ){ - const a=t.prev,c=t.next; - if(h?Sr(t,e,n,h):Ar(t))i.push(a.i,t.i,c.i),Xr(t),t=c.next,o=c.next; - else if((t=c)===o){ - r?1===r?Er(t=Tr(yr(t),i),i,s,e,n,h,2):2===r&&Cr(t,i,s,e,n,h):Er(yr(t),i,s,e,n,h,1); - break} - } - } - function Ar(t){ - const i=t.prev,s=t,e=t.next; - if(Fr(i,s,e)>=0)return!1; - const n=i.x,h=s.x,r=e.x,o=i.y,a=s.y,c=e.y,l=Math.min(n,h,r),u=Math.min(o,a,c),d=Math.max(n,h,r),f=Math.max(o,a,c); - let p=e.next; - for(; - p!==i; - ){ - if(p.x>=l&&p.x<=d&&p.y>=u&&p.y<=f&&Br(n,o,h,a,r,c,p.x,p.y)&&Fr(p.prev,p,p.next)>=0)return!1; - p=p.next} - return!0} - function Sr(t,i,s,e){ - const n=t.prev,h=t,r=t.next; - if(Fr(n,h,r)>=0)return!1; - const o=n.x,a=h.x,c=r.x,l=n.y,u=h.y,d=r.y,f=Math.min(o,a,c),p=Math.min(l,u,d),w=Math.max(o,a,c),g=Math.max(l,u,d),m=Lr(f,p,i,s,e),v=Lr(w,g,i,s,e); - let _=t.prevZ,M=t.nextZ; - for(; - _&&_.z>=m&&M&&M.z<=v; - ){ - if(_.x>=f&&_.x<=w&&_.y>=p&&_.y<=g&&_!==n&&_!==r&&Br(o,l,a,u,c,d,_.x,_.y)&&Fr(_.prev,_,_.next)>=0)return!1; - if(_=_.prevZ,M.x>=f&&M.x<=w&&M.y>=p&&M.y<=g&&M!==n&&M!==r&&Br(o,l,a,u,c,d,M.x,M.y)&&Fr(M.prev,M,M.next)>=0)return!1; - M=M.nextZ} - for(; - _&&_.z>=m; - ){ - if(_.x>=f&&_.x<=w&&_.y>=p&&_.y<=g&&_!==n&&_!==r&&Br(o,l,a,u,c,d,_.x,_.y)&&Fr(_.prev,_,_.next)>=0)return!1; - _=_.prevZ} - for(; - M&&M.z<=v; - ){ - if(M.x>=f&&M.x<=w&&M.y>=p&&M.y<=g&&M!==n&&M!==r&&Br(o,l,a,u,c,d,M.x,M.y)&&Fr(M.prev,M,M.next)>=0)return!1; - M=M.nextZ} - return!0} - function Tr(t,i){ - let s=t; - do{ - const e=s.prev,n=s.next.next; - !$r(e,n)&&Hr(e,s,s.next,n)&&Kr(e,n)&&Kr(n,e)&&(i.push(e.i,s.i,n.i),Xr(s),Xr(s.next),s=t=n),s=s.next} - while(s!==t); - return yr(s)} - function Cr(t,i,s,e,n,h){ - let r=t; - do{ - let t=r.next.next; - for(; - t!==r.prev; - ){ - if(r.i!==t.i&&Ur(r,t)){ - let o=Yr(r,t); - return r=yr(r,r.next),o=yr(o,o.next),Er(r,i,s,e,n,h,0),void Er(o,i,s,e,n,h,0)} - t=t.next} - r=r.next} - while(r!==t)} - function Or(t,i,s,e){ - const n=[]; - for(let h=0,r=i.length; - h<r; - h++){ - const s=br(t,i[h]*e,h<r-1?i[h+1]*e:t.length,e,!1); - s===s.next&&(s.steiner=!0),n.push(Dr(s))} - n.sort(Ir); - for(let h=0; - h<n.length; - h++)s=kr(n[h],s); - return s} - function Ir(t,i){ - let s=t.x-i.x; - return 0===s&&(s=t.y-i.y,0===s)&&(s=(t.next.y-t.y)/(t.next.x-t.x)-(i.next.y-i.y)/(i.next.x-i.x)),s} - function kr(t,i){ - const s=xr(t,i); - if(!s)return i; - const e=Yr(s,t); - return yr(e,e.next),yr(s,s.next)} - function xr(t,i){ - let s=i; - const e=t.x,n=t.y; - let h,r=-1/0; - if($r(t,s))return s; - do{ - if($r(t,s.next))return s.next; - if(n<=s.y&&n>=s.next.y&&s.next.y!==s.y){ - const t=s.x+(n-s.y)*(s.next.x-s.x)/(s.next.y-s.y); - if(t<=e&&t>r&&(r=t,h=s.x<s.next.x?s:s.next,t===e))return h} - s=s.next} - while(s!==i); - if(!h)return null; - const o=h,a=h.x,c=h.y; - let l=1/0; - s=h; - do{ - if(e>=s.x&&s.x>=a&&e!==s.x&&Gr(n<c?e:r,n,a,c,n<c?r:e,n,s.x,s.y)){ - const i=Math.abs(n-s.y)/(e-s.x); - Kr(s,t)&&(i<l||i===l&&(s.x>h.x||s.x===h.x&&Rr(h,s)))&&(h=s,l=i)} - s=s.next} - while(s!==o); - return h} - function Rr(t,i){ - return Fr(t.prev,t,i.prev)<0&&Fr(i.next,t,t.next)<0} - function Pr(t,i,s,e){ - let n=t; - do{ - 0===n.z&&(n.z=Lr(n.x,n.y,i,s,e)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next} - while(n!==t); - n.prevZ.nextZ=null,n.prevZ=null,Nr(n)} - function Nr(t){ - let i,s=1; - do{ - let e,n=t; - t=null; - let h=null; - for(i=0; - n; - ){ - i++; - let r=n,o=0; - for(let t=0; - t<s&&(o++,r=r.nextZ,r); - t++); - let a=s; - for(; - o>0||a>0&&r; - )0!==o&&(0===a||!r||n.z<=r.z)?(e=n,n=n.nextZ,o--):(e=r,r=r.nextZ,a--),h?h.nextZ=e:t=e,e.prevZ=h,h=e; - n=r} - h.nextZ=null,s*=2} - while(i>1); - return t} - function Lr(t,i,s,e,n){ - return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-s)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))|(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-e)*n|0)|i<<8))|i<<4))|i<<2))|i<<1))<<1} - function Dr(t){ - let i=t,s=t; - do{ - (i.x<s.x||i.x===s.x&&i.y<s.y)&&(s=i),i=i.next} - while(i!==t); - return s} - function Gr(t,i,s,e,n,h,r,o){ - return(n-r)*(i-o)>=(t-r)*(h-o)&&(t-r)*(e-o)>=(s-r)*(i-o)&&(s-r)*(h-o)>=(n-r)*(e-o)} - function Br(t,i,s,e,n,h,r,o){ - return!(t===r&&i===o)&&Gr(t,i,s,e,n,h,r,o)} - function Ur(t,i){ - return t.next.i!==i.i&&t.prev.i!==i.i&&!jr(t,i)&&(Kr(t,i)&&Kr(i,t)&&zr(t,i)&&(Fr(t.prev,t,i.prev)||Fr(t,i.prev,i))||$r(t,i)&&Fr(t.prev,t,t.next)>0&&Fr(i.prev,i,i.next)>0)} - function Fr(t,i,s){ - return(i.y-t.y)*(s.x-i.x)-(i.x-t.x)*(s.y-i.y)} - function $r(t,i){ - return t.x===i.x&&t.y===i.y} - function Hr(t,i,s,e){ - const n=Vr(Fr(t,i,s)),h=Vr(Fr(t,i,e)),r=Vr(Fr(s,e,t)),o=Vr(Fr(s,e,i)); - return n!==h&&r!==o||!(0!==n||!Wr(t,s,i))||!(0!==h||!Wr(t,e,i))||!(0!==r||!Wr(s,t,e))||!(0!==o||!Wr(s,i,e))} - function Wr(t,i,s){ - return i.x<=Math.max(t.x,s.x)&&i.x>=Math.min(t.x,s.x)&&i.y<=Math.max(t.y,s.y)&&i.y>=Math.min(t.y,s.y)} - function Vr(t){ - return t>0?1:t<0?-1:0} - function jr(t,i){ - let s=t; - do{ - if(s.i!==t.i&&s.next.i!==t.i&&s.i!==i.i&&s.next.i!==i.i&&Hr(s,s.next,t,i))return!0; - s=s.next} - while(s!==t); - return!1} - function Kr(t,i){ - return Fr(t.prev,t,t.next)<0?Fr(t,i,t.next)>=0&&Fr(t,t.prev,i)>=0:Fr(t,i,t.prev)<0||Fr(t,t.next,i)<0} - function zr(t,i){ - let s=t,e=!1; - const n=(t.x+i.x)/2,h=(t.y+i.y)/2; - do{ - s.y>h!=s.next.y>h&&s.next.y!==s.y&&n<(s.next.x-s.x)*(h-s.y)/(s.next.y-s.y)+s.x&&(e=!e),s=s.next} - while(s!==t); - return e} - function Yr(t,i){ - const s=Jr(t.i,t.x,t.y),e=Jr(i.i,i.x,i.y),n=t.next,h=i.prev; - return t.next=i,i.prev=t,s.next=n,n.prev=s,e.next=s,s.prev=e,h.next=e,e.prev=h,e} - function qr(t,i,s,e){ - const n=Jr(t,i,s); - return e?(n.next=e.next,n.prev=e,e.next.prev=n,e.next=n):(n.prev=n,n.next=n),n} - function Xr(t){ - t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)} - function Jr(t,i,s){ - return{ - i:t,x:i,y:s,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1} - } - function Qr(t,i,s,e){ - let n=0; - for(let h=i,r=s-e; - h<s; - h+=e)n+=(t[r]-t[h])*(t[h+1]+t[r+1]),r=h; - return n} - ci.handleByNamedList(ri.Environment,gr),Qt(mr,"loadEnvironmentExtensions"),Qt(_r,"unsafeEvalSupported"),Qt(Mr,"earcut$1"),Qt(br,"linkedList"),Qt(yr,"filterPoints"),Qt(Er,"earcutLinked"),Qt(Ar,"isEar"),Qt(Sr,"isEarHashed"),Qt(Tr,"cureLocalIntersections"),Qt(Cr,"splitEarcut"),Qt(Or,"eliminateHoles"),Qt(Ir,"compareXYSlope"),Qt(kr,"eliminateHole"),Qt(xr,"findHoleBridge"),Qt(Rr,"sectorContainsSector"),Qt(Pr,"indexCurve"),Qt(Nr,"sortLinked"),Qt(Lr,"zOrder"),Qt(Dr,"getLeftmost"),Qt(Gr,"pointInTriangle$1"),Qt(Br,"pointInTriangleExceptFirst"),Qt(Ur,"isValidDiagonal"),Qt(Fr,"area$1"),Qt($r,"equals$2"),Qt(Hr,"intersects"),Qt(Wr,"onSegment"),Qt(Vr,"sign"),Qt(jr,"intersectsPolygon"),Qt(Kr,"locallyInside"),Qt(zr,"middleInside"),Qt(Yr,"splitPolygon"),Qt(qr,"insertNode"),Qt(Xr,"removeNode"),Qt(Jr,"createNode"),Qt(Qr,"signedArea"); - const Zr=Mr.default||Mr; - var to=(t=>(t[t.NONE=0]="NONE",t[t.COLOR=16384]="COLOR",t[t.STENCIL=1024]="STENCIL",t[t.DEPTH=256]="DEPTH",t[t.COLOR_DEPTH=16640]="COLOR_DEPTH",t[t.COLOR_STENCIL=17408]="COLOR_STENCIL",t[t.DEPTH_STENCIL=1280]="DEPTH_STENCIL",t[t.ALL=17664]="ALL",t))(to||{ - } - ); - const io=class{ - constructor(t){ - this.items=[],this._name=t} - emit(t,i,s,e,n,h,r,o){ - const{ - name:a,items:c} - =this; - for(let l=0,u=c.length; - l<u; - l++)c[l][a](t,i,s,e,n,h,r,o); - return this} - add(t){ - return t[this._name]&&(this.remove(t),this.items.push(t)),this} - remove(t){ - const i=this.items.indexOf(t); - return-1!==i&&this.items.splice(i,1),this} - contains(t){ - return-1!==this.items.indexOf(t)} - removeAll(){ - return this.items.length=0,this} - destroy(){ - this.removeAll(),this.items=null,this._name=null} - get empty(){ - return 0===this.items.length} - get name(){ - return this._name} - } - ; - Qt(io,"SystemRunner"); - let so=io; - const eo=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],no=(Qt(p=class extends vi{ - constructor(t){ - super(),this.tick=0,this.uid=Wi("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={ - } - ,this._systemsHash=Object.create(null),this.type=t.type,this.name=t.name,this.config=t; - const i=[...eo,...this.config.runners??[]]; - this._addRunners(...i),this._unsafeEvalCheck()} - async init(t={ - } - ){ - const i=!0===t.skipExtensionImports||!1===t.manageImports; - await mr(i),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors); - for(const s in this._systemsHash)t={ - ...this._systemsHash[s].constructor.defaultOptions,...t} - ; - t={ - ...p.defaultOptions,...t} - ,this._roundPixels=t.roundPixels?1:0; - for(let s=0; - s<this.runners.init.items.length; - s++)await this.runners.init.items[s].init(t); - this._initOptions=t} - render(t,i){ - this.tick++; - let s=t; - if(s instanceof Ke&&(s={ - container:s} - ,i&&(Yi(ji,"passing a second argument is deprecated, please use render options instead"),s.target=i.renderTexture)),s.target||(s.target=this.view.renderTarget),s.target===this.view.renderTarget&&(this._lastObjectRendered=s.container,s.clearColor??(s.clearColor=this.background.colorRgba),s.clear??(s.clear=this.background.clearBeforeRender)),s.clearColor){ - const t=Array.isArray(s.clearColor)&&4===s.clearColor.length; - s.clearColor=t?s.clearColor:Ks.shared.setValue(s.clearColor).toArray()} - s.transform||(s.container.updateLocalTransform(),s.transform=s.container.localTransform),s.container.visible&&(s.container.enableRenderGroup(),this.runners.prerender.emit(s),this.runners.renderStart.emit(s),this.runners.render.emit(s),this.runners.renderEnd.emit(s),this.runners.postrender.emit(s))} - resize(t,i,s){ - const e=this.view.resolution; - this.view.resize(t,i,s),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),void 0!==s&&s!==e&&this.runners.resolutionChange.emit(s)} - clear(t={ - } - ){ - t.target||(t.target=this.renderTarget.renderTarget),t.clearColor||(t.clearColor=this.background.colorRgba),t.clear??(t.clear=to.ALL); - const{ - clear:i,clearColor:s,target:e,mipLevel:n,layer:h} - =t; - Ks.shared.setValue(s??this.background.colorRgba),this.renderTarget.clear(e,i,Ks.shared.toArray(),n??0,h??0)} - get resolution(){ - return this.view.resolution} - set resolution(t){ - this.view.resolution=t,this.runners.resolutionChange.emit(t)} - get width(){ - return this.view.texture.frame.width} - get height(){ - return this.view.texture.frame.height} - get canvas(){ - return this.view.canvas} - get lastObjectRendered(){ - return this._lastObjectRendered} - get renderingToScreen(){ - return this.renderTarget.renderingToScreen} - get screen(){ - return this.view.screen} - _addRunners(...t){ - t.forEach(t=>{ - this.runners[t]=new so(t)} - )} - _addSystems(t){ - let i; - for(i in t){ - const s=t[i]; - this._addSystem(s.value,s.name)} - } - _addSystem(t,i){ - const s=new t(this); - if(this[i])throw new Error(`Whoops! The name "${ - i} - " is already in use`); - this[i]=s,this._systemsHash[i]=s; - for(const e in this.runners)this.runners[e].add(s); - return this} - _addPipes(t,i){ - const s=i.reduce((t,i)=>(t[i.name]=i.value,t),{ - } - ); - t.forEach(t=>{ - const i=t.value,e=t.name,n=s[e]; - this.renderPipes[e]=new i(this,n?new n:null),this.runners.destroy.add(this.renderPipes[e])} - )} - destroy(t=!1){ - this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),(!0===t||"object"==typeof t&&t.releaseGlobalResources)&&Xs.release(),Object.values(this.runners).forEach(t=>{ - t.destroy()} - ),this._systemsHash=null,this.renderPipes=null,this.removeAllListeners()} - generateTexture(t){ - return this.textureGenerator.generateTexture(t)} - get roundPixels(){ - return!!this._roundPixels} - _unsafeEvalCheck(){ - if(!_r())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")} - resetState(){ - this.runners.resetState.emit()} - } - ,"_AbstractRenderer"),p); - no.defaultOptions={ - resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1} - ; - let ho,ro,oo=no; - function ao(t){ - return void 0!==ho||(ho=(()=>{ - var i; - const s={ - stencil:!0,failIfMajorPerformanceCaveat:t??oo.defaultOptions.failIfMajorPerformanceCaveat} - ; - try{ - if(!ln.get().getWebGLRenderingContext())return!1; - let t=ln.get().createCanvas().getContext("webgl",s); - const e=!!(null==(i=null==t?void 0:t.getContextAttributes())?void 0:i.stencil); - if(t){ - const i=t.getExtension("WEBGL_lose_context"); - i&&i.loseContext()} - return t=null,e} - catch(e){ - return!1} - } - )()),ho} - async function co(t={ - } - ){ - return void 0!==ro||(ro=await(async()=>{ - const i=ln.get().getNavigator().gpu; - if(!i)return!1; - try{ - const s=await i.requestAdapter(t); - return await s.requestDevice(),!0} - catch(s){ - return!1} - } - )()),ro} - Qt(ao,"isWebGLSupported"),Qt(co,"isWebGPUSupported"); - const lo=["webgl","webgpu","canvas"]; - async function uo(t){ - let i,s=[]; - t.preference?(s.push(t.preference),lo.forEach(i=>{ - i!==t.preference&&s.push(i)} - )):s=lo.slice(); - let e={ - } - ; - for(let h=0; - h<s.length; - h++){ - const n=s[h]; - if("webgpu"===n&&await co()){ - const{ - WebGPURenderer:s} - =await ei(async()=>{ - const{ - WebGPURenderer:t} - =await Promise.resolve().then(()=>$y); - return{ - WebGPURenderer:t} - } - ,void 0); - i=s,e={ - ...t,...t.webgpu} - ; - break} - if("webgl"===n&&ao(t.failIfMajorPerformanceCaveat??oo.defaultOptions.failIfMajorPerformanceCaveat)){ - const{ - WebGLRenderer:s} - =await ei(async()=>{ - const{ - WebGLRenderer:t} - =await Promise.resolve().then(()=>Sb); - return{ - WebGLRenderer:t} - } - ,void 0); - i=s,e={ - ...t,...t.webgl} - ; - break} - if("canvas"===n){ - const{ - CanvasRenderer:s} - =await ei(async()=>{ - const{ - CanvasRenderer:t} - =await Promise.resolve().then(()=>m_); - return{ - CanvasRenderer:t} - } - ,void 0); - i=s,e={ - ...t,...t.canvasOptions} - ; - break} - } - if(delete e.webgpu,delete e.webgl,delete e.canvasOptions,!i)throw new Error("No available renderer for the current environment"); - const n=new i; - return await n.init(e),n} - Qt(uo,"autoDetectRenderer"); - const fo="8.17.0",po=class{ - static init(){ - var t; - null==(t=globalThis.__PIXI_APP_INIT__)||t.call(globalThis,this,fo)} - static destroy(){ - } - } - ; - Qt(po,"ApplicationInitHook"); - let wo=po; - wo.extension=ri.Application; - const go=class{ - constructor(t){ - this._renderer=t} - init(){ - var t; - null==(t=globalThis.__PIXI_RENDERER_INIT__)||t.call(globalThis,this._renderer,fo)} - destroy(){ - this._renderer=null} - } - ; - Qt(go,"RendererInitHook"); - let mo=go; - mo.extension={ - type:[ri.WebGLSystem,ri.WebGPUSystem],name:"initHook",priority:-10} - ; - const vo=class{ - static init(t){ - Object.defineProperty(this,"resizeTo",{ - configurable:!0,set(t){ - globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())} - ,get(){ - return this._resizeTo} - } - ),this.queueResize=()=>{ - this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))} - ,this._cancelResize=()=>{ - this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)} - ,this.resize=()=>{ - if(!this._resizeTo)return; - let t,i; - if(this._cancelResize(),this._resizeTo===globalThis.window)t=globalThis.innerWidth,i=globalThis.innerHeight; - else{ - const{ - clientWidth:s,clientHeight:e} - =this._resizeTo; - t=s,i=e} - this.renderer.resize(t,i),this.render()} - ,this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null} - static destroy(){ - globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null} - } - ; - Qt(vo,"ResizePlugin"); - let _o=vo; - _o.extension=ri.Application; - const Mo=class{ - static init(t){ - t=Object.assign({ - autoStart:!0,sharedTicker:!1} - ,t),Object.defineProperty(this,"ticker",{ - configurable:!0,set(t){ - this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,wn.LOW)} - ,get(){ - return this._ticker} - } - ),this.stop=()=>{ - this._ticker.stop()} - ,this.start=()=>{ - this._ticker.start()} - ,this._ticker=null,this.ticker=t.sharedTicker?Mn.shared:new Mn,t.autoStart&&this.start()} - static destroy(){ - if(this._ticker){ - const t=this._ticker; - this.ticker=null,t.destroy()} - } - } - ; - Qt(Mo,"TickerPlugin"); - let bo=Mo; - bo.extension=ri.Application,ci.add(_o),ci.add(bo); - const yo=(Qt(w=class{ - constructor(...t){ - this.stage=new Ke,void 0!==t[0]&&Yi(ji,"Application constructor options are deprecated, please use Application.init() instead.")} - async init(t){ - t={ - ...t} - ,this.stage||(this.stage=new Ke),this.renderer=await uo(t),w._plugins.forEach(i=>{ - i.init.call(this,t)} - )} - render(){ - this.renderer.render({ - container:this.stage} - )} - get canvas(){ - return this.renderer.canvas} - get view(){ - return Yi(ji,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas} - get screen(){ - return this.renderer.screen} - destroy(t=!1,i=!1){ - const s=w._plugins.slice(0); - s.reverse(),s.forEach(t=>{ - t.destroy.call(this)} - ),this.stage.destroy(i),this.stage=null,this.renderer.destroy(t),this.renderer=null} - } - ,"_Application"),w); - yo._plugins=[]; - let Eo=yo; - ci.handleByList(ri.Application,Eo._plugins),ci.add(wo); - const Ao={ - test:t=>"string"==typeof t&&t.startsWith("info face="),parse(t){ - const i=t.match(/^[a-z]+\s+.+$/gm),s={ - info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]} - ; - for(const u in i){ - const t=i[u].match(/^[a-z]+/gm)[0],e=i[u].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),n={ - } - ; - for(const i in e){ - const t=e[i].split("="),s=t[0],h=t[1].replace(/"/gm,""),r=parseFloat(h),o=isNaN(r)?h:r; - n[s]=o} - s[t].push(n)} - const e={ - chars:{ - } - ,pages:[],lineHeight:0,fontSize:0,fontFamily:"",distanceField:null,baseLineOffset:0} - ,[n]=s.info,[h]=s.common,[r]=s.distanceField??[]; - r&&(e.distanceField={ - range:parseInt(r.distanceRange,10),type:r.fieldType} - ),e.fontSize=parseInt(n.size,10),e.fontFamily=n.face,e.lineHeight=parseInt(h.lineHeight,10); - const o=s.page; - for(let u=0; - u<o.length; - u++)e.pages.push({ - id:parseInt(o[u].id,10)||0,file:o[u].file} - ); - const a={ - } - ; - e.baseLineOffset=e.lineHeight-parseInt(h.base,10); - const c=s.char; - for(let u=0; - u<c.length; - u++){ - const t=c[u],i=parseInt(t.id,10); - let s=t.letter??t.char??String.fromCharCode(i); - "space"===s&&(s=" "),a[i]=s,e.chars[s]={ - id:i,page:parseInt(t.page,10)||0,x:parseInt(t.x,10),y:parseInt(t.y,10),width:parseInt(t.width,10),height:parseInt(t.height,10),xOffset:parseInt(t.xoffset,10),yOffset:parseInt(t.yoffset,10),xAdvance:parseInt(t.xadvance,10),kerning:{ - } - } - } - const l=s.kerning||[]; - for(let u=0; - u<l.length; - u++){ - const t=parseInt(l[u].first,10),i=parseInt(l[u].second,10),s=parseInt(l[u].amount,10); - e.chars[a[i]]&&(e.chars[a[i]].kerning[a[t]]=s)} - return e} - } - ,So={ - test(t){ - const i=t; - return"string"!=typeof i&&"getElementsByTagName"in i&&i.getElementsByTagName("page").length&&null!==i.getElementsByTagName("info")[0].getAttribute("face")} - ,parse(t){ - const i={ - chars:{ - } - ,pages:[],lineHeight:0,fontSize:0,fontFamily:"",distanceField:null,baseLineOffset:0} - ,s=t.getElementsByTagName("info")[0],e=t.getElementsByTagName("common")[0],n=t.getElementsByTagName("distanceField")[0]; - n&&(i.distanceField={ - type:n.getAttribute("fieldType"),range:parseInt(n.getAttribute("distanceRange"),10)} - ); - const h=t.getElementsByTagName("page"),r=t.getElementsByTagName("char"),o=t.getElementsByTagName("kerning"); - i.fontSize=parseInt(s.getAttribute("size"),10),i.fontFamily=s.getAttribute("face"),i.lineHeight=parseInt(e.getAttribute("lineHeight"),10); - for(let c=0; - c<h.length; - c++)i.pages.push({ - id:parseInt(h[c].getAttribute("id"),10)||0,file:h[c].getAttribute("file")} - ); - const a={ - } - ; - i.baseLineOffset=i.lineHeight-parseInt(e.getAttribute("base"),10); - for(let c=0; - c<r.length; - c++){ - const t=r[c],s=parseInt(t.getAttribute("id"),10); - let e=t.getAttribute("letter")??t.getAttribute("char")??String.fromCharCode(s); - "space"===e&&(e=" "),a[s]=e,i.chars[e]={ - id:s,page:parseInt(t.getAttribute("page"),10)||0,x:parseInt(t.getAttribute("x"),10),y:parseInt(t.getAttribute("y"),10),width:parseInt(t.getAttribute("width"),10),height:parseInt(t.getAttribute("height"),10),xOffset:parseInt(t.getAttribute("xoffset"),10),yOffset:parseInt(t.getAttribute("yoffset"),10),xAdvance:parseInt(t.getAttribute("xadvance"),10),kerning:{ - } - } - } - for(let c=0; - c<o.length; - c++){ - const t=parseInt(o[c].getAttribute("first"),10),s=parseInt(o[c].getAttribute("second"),10),e=parseInt(o[c].getAttribute("amount"),10); - i.chars[a[s]]&&(i.chars[a[s]].kerning[a[t]]=e)} - return i} - } - ,To={ - test:t=>!("string"!=typeof t||!t.match(/<font(\s|>)/))&&So.test(ln.get().parseXML(t)),parse:t=>So.parse(ln.get().parseXML(t))} - ,Co=[".xml",".fnt"],Oo={ - extension:{ - type:ri.CacheParser,name:"cacheBitmapFont"} - ,test:Qt(t=>!!(null==t?void 0:t.pages)&&!!(null==t?void 0:t.chars)&&"string"==typeof(null==t?void 0:t.fontFamily)&&""!==t.fontFamily,"test"),getCacheableAssets(t,i){ - const s={ - } - ; - return t.forEach(t=>{ - s[t]=i,s[`${ - t} - -bitmap`]=i} - ),s[`${ - i.fontFamily} - -bitmap`]=i,s} - } - ,Io={ - extension:{ - type:ri.LoadParser,priority:xn.Normal} - ,name:"loadBitmapFont",id:"bitmap-font",test:t=>Co.includes(Gn.extname(t).toLowerCase()),testParse:async t=>Ao.test(t)||To.test(t),async parse(t,i,s){ - const e=Ao.test(t)?Ao.parse(t):To.parse(t),{ - src:n} - =i,{ - pages:h} - =e,r=[],o=e.distanceField?{ - scaleMode:"linear",alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:!1,resolution:1} - :{ - } - ; - for(let l=0; - l<h.length; - ++l){ - const t=h[l].file; - let i=Gn.join(Gn.dirname(n),t); - i=Vn(i,n),r.push({ - src:i,data:o} - )} - const[a,{ - BitmapFont:c} - ]=await Promise.all([s.load(r),ei(()=>Promise.resolve().then(()=>aE),void 0)]); - return new c({ - data:e,textures:r.map(t=>a[t.src])} - ,n)} - ,async load(t,i){ - const s=await ln.get().fetch(t); - return await s.text()} - ,async unload(t,i,s){ - await Promise.all(t.pages.map(t=>s.unload(t.texture.source._sourceOrigin))),t.destroy()} - } - ,ko=class{ - constructor(t,i=!1){ - this._loader=t,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=i} - add(t){ - t.forEach(t=>{ - this._assetList.push(t)} - ),this.verbose,this._isActive&&!this._isLoading&&this._next()} - async _next(){ - if(this._assetList.length&&this._isActive){ - this._isLoading=!0; - const t=[],i=Math.min(this._assetList.length,this._maxConcurrent); - for(let s=0; - s<i; - s++)t.push(this._assetList.pop()); - await this._loader.load(t),this._isLoading=!1,this._next()} - } - get active(){ - return this._isActive} - set active(t){ - this._isActive!==t&&(this._isActive=t,t&&!this._isLoading&&this._next())} - } - ; - Qt(ko,"BackgroundLoader"); - let xo=ko; - const Ro={ - extension:{ - type:ri.CacheParser,name:"cacheTextureArray"} - ,test:Qt(t=>Array.isArray(t)&&t.every(t=>t instanceof ls),"test"),getCacheableAssets:Qt((t,i)=>{ - const s={ - } - ; - return t.forEach(t=>{ - i.forEach((i,e)=>{ - s[t+(0===e?"":e+1)]=i} - )} - ),s} - ,"getCacheableAssets")} - ; - async function Po(t){ - if("Image"in globalThis)return new Promise(i=>{ - const s=new Image; - s.onload=()=>{ - i(!0)} - ,s.onerror=()=>{ - i(!1)} - ,s.src=t} - ); - if("createImageBitmap"in globalThis&&"fetch"in globalThis){ - try{ - const i=await(await fetch(t)).blob(); - await createImageBitmap(i)} - catch(i){ - return!1} - return!0} - return!1} - Qt(Po,"testImageFormat"); - const No={ - extension:{ - type:ri.DetectionParser,priority:1} - ,test:Qt(async()=>Po("data:image/avif; - base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),"test"),add:Qt(async t=>[...t,"avif"],"add"),remove:Qt(async t=>t.filter(t=>"avif"!==t),"remove")} - ,Lo=["png","jpg","jpeg"],Do={ - extension:{ - type:ri.DetectionParser,priority:-1} - ,test:Qt(()=>Promise.resolve(!0),"test"),add:Qt(async t=>[...t,...Lo],"add"),remove:Qt(async t=>t.filter(t=>!Lo.includes(t)),"remove")} - ,Go="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope; - function Bo(t){ - return!Go&&""!==document.createElement("video").canPlayType(t)} - Qt(Bo,"testVideoFormat"); - const Uo={ - extension:{ - type:ri.DetectionParser,priority:0} - ,test:Qt(async()=>Bo("video/mp4"),"test"),add:Qt(async t=>[...t,"mp4","m4v"],"add"),remove:Qt(async t=>t.filter(t=>"mp4"!==t&&"m4v"!==t),"remove")} - ,Fo={ - extension:{ - type:ri.DetectionParser,priority:0} - ,test:Qt(async()=>Bo("video/ogg"),"test"),add:Qt(async t=>[...t,"ogv"],"add"),remove:Qt(async t=>t.filter(t=>"ogv"!==t),"remove")} - ,$o={ - extension:{ - type:ri.DetectionParser,priority:0} - ,test:Qt(async()=>Bo("video/webm"),"test"),add:Qt(async t=>[...t,"webm"],"add"),remove:Qt(async t=>t.filter(t=>"webm"!==t),"remove")} - ,Ho={ - extension:{ - type:ri.DetectionParser,priority:0} - ,test:Qt(async()=>Po("data:image/webp; - base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),"test"),add:Qt(async t=>[...t,"webp"],"add"),remove:Qt(async t=>t.filter(t=>"webp"!==t),"remove")} - ,Wo=(g=class{ - constructor(){ - this.loadOptions={ - ...g.defaultOptions} - ,this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{ - set:Qt((t,i,s)=>(this._parsersValidated=!1,t[i]=s,!0),"set")} - ),this.promiseCache={ - } - } - reset(){ - this._parsersValidated=!1,this.promiseCache={ - } - } - _getLoadPromiseAndParser(t,i){ - const s={ - promise:null,parser:null} - ; - return s.promise=(async()=>{ - var e,n; - let h=null,r=null; - if((i.parser||i.loadParser)&&(r=this._parserHash[i.parser||i.loadParser],i.loadParser&&qs(),r||qs(i.parser||i.loadParser)),!r){ - for(let s=0; - s<this.parsers.length; - s++){ - const n=this.parsers[s]; - if(n.load&&(null==(e=n.test)?void 0:e.call(n,t,i,this))){ - r=n; - break} - } - if(!r)return qs(),null} - h=await r.load(t,i,this),s.parser=r; - for(let t=0; - t<this.parsers.length; - t++){ - const e=this.parsers[t]; - e.parse&&e.parse&&await(null==(n=e.testParse)?void 0:n.call(e,h,i,this))&&(h=await e.parse(h,i,this)||h,s.parser=e)} - return h} - )(),s} - async load(t,i){ - this._parsersValidated||this._validateParsers(); - const s="function"==typeof i?{ - ...g.defaultOptions,...this.loadOptions,onProgress:i} - :{ - ...g.defaultOptions,...this.loadOptions,...i||{ - } - } - ,{ - onProgress:e,onError:n,strategy:h,retryCount:r,retryDelay:o} - =s; - let a=0; - const c={ - } - ,l=Fn(t),u=An(t,t=>({ - alias:[t],src:t,data:{ - } - } - )),d=u.reduce((t,i)=>t+(i.progressSize||1),0),f=u.map(async t=>{ - const i=Gn.toAbsolute(t.src); - c[t.src]||(await this._loadAssetWithRetry(i,t,{ - onProgress:e,onError:n,strategy:h,retryCount:r,retryDelay:o} - ,c),a+=t.progressSize||1,e&&e(a/d))} - ); - return await Promise.all(f),l?c[u[0].src]:c} - async unload(t){ - const i=An(t,t=>({ - alias:[t],src:t} - )).map(async t=>{ - var i,s; - const e=Gn.toAbsolute(t.src),n=this.promiseCache[e]; - if(n){ - const h=await n.promise; - delete this.promiseCache[e],await(null==(s=null==(i=n.parser)?void 0:i.unload)?void 0:s.call(i,h,t,this))} - } - ); - await Promise.all(i)} - _validateParsers(){ - this._parsersValidated=!0,this._parserHash=this._parsers.filter(t=>t.name||t.id).reduce((t,i)=>(i.name||i.id?(t[i.name]||t[i.id])&&qs(i.id):qs(),t[i.name]=i,i.id&&(t[i.id]=i),t),{ - } - )} - async _loadAssetWithRetry(t,i,s,e){ - let n=0; - const{ - onError:h,strategy:r,retryCount:o,retryDelay:a} - =s,c=Qt(t=>new Promise(i=>setTimeout(i,t)),"wait"); - for(; - ; - )try{ - return this.promiseCache[t]||(this.promiseCache[t]=this._getLoadPromiseAndParser(t,i)),void(e[i.src]=await this.promiseCache[t].promise)} - catch(frt){ - if(delete this.promiseCache[t],delete e[i.src],n++,"retry"===r&&!("retry"!==r||n>o)){ - h&&h(frt,i),await c(a); - continue} - if("skip"===r)return void(h&&h(frt,i)); - h&&h(frt,i); - const l=new Error(`[Loader.load] Failed to load ${ - t} - .\n${ - frt} - `); - throw frt instanceof Error&&frt.stack&&(l.stack=frt.stack),l} - } - } - ,Qt(g,"_Loader"),g); - Wo.defaultOptions={ - onProgress:void 0,onError:void 0,strategy:"throw",retryCount:3,retryDelay:250} - ; - let Vo=Wo; - function jo(t,i){ - if(Array.isArray(i)){ - for(const s of i)if(t.startsWith(`data:${ - s} - `))return!0; - return!1} - return t.startsWith(`data:${ - i} - `)} - function Ko(t,i){ - const s=t.split("?")[0],e=Gn.extname(s).toLowerCase(); - return Array.isArray(i)?i.includes(e):e===i} - Qt(jo,"checkDataUrl"),Qt(Ko,"checkExtension"); - const zo={ - extension:{ - type:ri.LoadParser,priority:xn.Low} - ,name:"loadJson",id:"json",test:t=>jo(t,"application/json")||Ko(t,".json"),async load(t){ - const i=await ln.get().fetch(t); - return await i.json()} - } - ,Yo={ - name:"loadTxt",id:"text",extension:{ - type:ri.LoadParser,priority:xn.Low,name:"loadTxt"} - ,test:t=>jo(t,"text/plain")||Ko(t,".txt"),async load(t){ - const i=await ln.get().fetch(t); - return await i.text()} - } - ,qo=["normal","bold","100","200","300","400","500","600","700","800","900"],Xo=[".ttf",".otf",".woff",".woff2"],Jo=["font/ttf","font/otf","font/woff","font/woff2"],Qo=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i; - function Zo(t){ - const i=Gn.extname(t),s=Gn.basename(t,i).replace(/(-|_)/g," ").toLowerCase().split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1)); - let e=s.length>0; - for(const h of s)if(!h.match(Qo)){ - e=!1; - break} - let n=s.join(" "); - return e||(n=`"${ - n.replace(/[\\"]/g,"\\$&")} - "`),n} - Qt(Zo,"getFontFamilyName"); - const ta=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,; - =\-._~]*$/; - function ia(t){ - return ta.test(t)?t:encodeURI(t)} - Qt(ia,"encodeURIWhenNeeded"); - const sa={ - extension:{ - type:ri.LoadParser,priority:xn.Low} - ,name:"loadWebFont",id:"web-font",test:t=>jo(t,Jo)||Ko(t,Xo),async load(t,i){ - var s,e,n; - const h=ln.get().getFontFaceSet(); - if(h){ - const r=[],o=(null==(s=i.data)?void 0:s.family)??Zo(t),a=(null==(n=null==(e=i.data)?void 0:e.weights)?void 0:n.filter(t=>qo.includes(t)))??["normal"],c=i.data??{ - } - ; - for(let i=0; - i<a.length; - i++){ - const s=a[i],e=new FontFace(o,`url('${ - ia(t)} - ')`,{ - ...c,weight:s} - ); - await e.load(),h.add(e),r.push(e)} - return Tn.has(`${ - o} - -and-url`)?Tn.get(`${ - o} - -and-url`).entries.push({ - url:t,faces:r} - ):Tn.set(`${ - o} - -and-url`,{ - entries:[{ - url:t,faces:r} - ]} - ),1===r.length?r[0]:r} - return qs(),null} - ,unload(t){ - const i=Array.isArray(t)?t:[t],s=i[0].family,e=Tn.get(`${ - s} - -and-url`),n=e.entries.find(t=>t.faces.some(t=>-1!==i.indexOf(t))); - n.faces=n.faces.filter(t=>-1===i.indexOf(t)),0===n.faces.length&&(e.entries=e.entries.filter(t=>t!==n)),i.forEach(t=>{ - ln.get().getFontFaceSet().delete(t)} - ),0===e.entries.length&&Tn.remove(`${ - s} - -and-url`)} - } - ; - var ea=ra,na={ - a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0} - ,ha=/([astvzqmhlc])([^astvzqmhlc]*)/gi; - function ra(t){ - var i=[]; - return t.replace(ha,function(t,s,e){ - var n=s.toLowerCase(); - for(e=aa(e),"m"==n&&e.length>2&&(i.push([s].concat(e.splice(0,2))),n="l",s="m"==s?"l":"L"); - ; - ){ - if(e.length==na[n])return e.unshift(s),i.push(e); - if(e.length<na[n])throw new Error("malformed path data"); - i.push([s].concat(e.splice(0,na[n])))} - } - ),i} - Qt(ra,"parse$1"); - var oa=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi; - function aa(t){ - var i=t.match(oa); - return i?i.map(Number):[]} - Qt(aa,"parseValues"); - const ca=wi(ea); - function la(t,i){ - const s=ca(t),e=[]; - let n=null,h=0,r=0; - for(let o=0; - o<s.length; - o++){ - const t=s[o],a=t[0],c=t; - switch(a){ - case"M":h=c[1],r=c[2],i.moveTo(h,r); - break; - case"m":h+=c[1],r+=c[2],i.moveTo(h,r); - break; - case"H":h=c[1],i.lineTo(h,r); - break; - case"h":h+=c[1],i.lineTo(h,r); - break; - case"V":r=c[1],i.lineTo(h,r); - break; - case"v":r+=c[1],i.lineTo(h,r); - break; - case"L":h=c[1],r=c[2],i.lineTo(h,r); - break; - case"l":h+=c[1],r+=c[2],i.lineTo(h,r); - break; - case"C":h=c[5],r=c[6],i.bezierCurveTo(c[1],c[2],c[3],c[4],h,r); - break; - case"c":i.bezierCurveTo(h+c[1],r+c[2],h+c[3],r+c[4],h+c[5],r+c[6]),h+=c[5],r+=c[6]; - break; - case"S":h=c[3],r=c[4],i.bezierCurveToShort(c[1],c[2],h,r); - break; - case"s":i.bezierCurveToShort(h+c[1],r+c[2],h+c[3],r+c[4]),h+=c[3],r+=c[4]; - break; - case"Q":h=c[3],r=c[4],i.quadraticCurveTo(c[1],c[2],h,r); - break; - case"q":i.quadraticCurveTo(h+c[1],r+c[2],h+c[3],r+c[4]),h+=c[3],r+=c[4]; - break; - case"T":h=c[1],r=c[2],i.quadraticCurveToShort(h,r); - break; - case"t":h+=c[1],r+=c[2],i.quadraticCurveToShort(h,r); - break; - case"A":h=c[6],r=c[7],i.arcToSvg(c[1],c[2],c[3],c[4],c[5],h,r); - break; - case"a":h+=c[6],r+=c[7],i.arcToSvg(c[1],c[2],c[3],c[4],c[5],h,r); - break; - case"Z":case"z":i.closePath(),e.length>0&&(n=e.pop(),n?(h=n.startX,r=n.startY):(h=0,r=0)),n=null; - break; - default:qs()} - "Z"!==a&&"z"!==a&&null===n&&(n={ - startX:h,startY:r} - ,e.push(n))} - return i} - Qt(la,"parseSVGPath"); - const ua=class t{ - constructor(t=0,i=0,s=0){ - this.type="circle",this.x=t,this.y=i,this.radius=s} - clone(){ - return new t(this.x,this.y,this.radius)} - contains(t,i){ - if(this.radius<=0)return!1; - const s=this.radius*this.radius; - let e=this.x-t,n=this.y-i; - return e*=e,n*=n,e+n<=s} - strokeContains(t,i,s,e=.5){ - if(0===this.radius)return!1; - const n=this.x-t,h=this.y-i,r=this.radius,o=(1-e)*s,a=Math.sqrt(n*n+h*h); - return a<=r+o&&a>r-(s-o)} - getBounds(t){ - return t||(t=new $i),t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=2*this.radius,t.height=2*this.radius,t} - copyFrom(t){ - return this.x=t.x,this.y=t.y,this.radius=t.radius,this} - copyTo(t){ - return t.copyFrom(this),t} - toString(){ - return`[pixi.js/math:Circle x=${ - this.x} - y=${ - this.y} - radius=${ - this.radius} - ]`} - } - ; - Qt(ua,"Circle"); - let da=ua; - const fa=class t{ - constructor(t=0,i=0,s=0,e=0){ - this.type="ellipse",this.x=t,this.y=i,this.halfWidth=s,this.halfHeight=e} - clone(){ - return new t(this.x,this.y,this.halfWidth,this.halfHeight)} - contains(t,i){ - if(this.halfWidth<=0||this.halfHeight<=0)return!1; - let s=(t-this.x)/this.halfWidth,e=(i-this.y)/this.halfHeight; - return s*=s,e*=e,s+e<=1} - strokeContains(t,i,s,e=.5){ - const{ - halfWidth:n,halfHeight:h} - =this; - if(n<=0||h<=0)return!1; - const r=s*(1-e),o=s-r,a=n-o,c=h-o,l=n+r,u=h+r,d=t-this.x,f=i-this.y; - return d*d/(a*a)+f*f/(c*c)>1&&d*d/(l*l)+f*f/(u*u)<=1} - getBounds(t){ - return t||(t=new $i),t.x=this.x-this.halfWidth,t.y=this.y-this.halfHeight,t.width=2*this.halfWidth,t.height=2*this.halfHeight,t} - copyFrom(t){ - return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this} - copyTo(t){ - return t.copyFrom(this),t} - toString(){ - return`[pixi.js/math:Ellipse x=${ - this.x} - y=${ - this.y} - halfWidth=${ - this.halfWidth} - halfHeight=${ - this.halfHeight} - ]`} - } - ; - Qt(fa,"Ellipse"); - let pa=fa; - function wa(t,i,s,e,n,h){ - const r=n-s,o=h-e,a=r*r+o*o; - let c,l,u=-1; - 0!==a&&(u=((t-s)*r+(i-e)*o)/a),u<0?(c=s,l=e):u>1?(c=n,l=h):(c=s+u*r,l=e+u*o); - const d=t-c,f=i-l; - return d*d+f*f} - Qt(wa,"squaredDistanceToLineSegment"); - const ga=class t{ - constructor(...t){ - this.type="polygon"; - let i=Array.isArray(t[0])?t[0]:t; - if("number"!=typeof i[0]){ - const t=[]; - for(let s=0,e=i.length; - s<e; - s++)t.push(i[s].x,i[s].y); - i=t} - this.points=i,this.closePath=!0} - isClockwise(){ - let t=0; - const i=this.points,s=i.length; - for(let e=0; - e<s; - e+=2){ - const n=i[e],h=i[e+1]; - t+=(i[(e+2)%s]-n)*(i[(e+3)%s]+h)} - return t<0} - containsPolygon(t){ - const i=this.getBounds(void 0),s=t.getBounds(void 0); - if(!i.containsRect(s))return!1; - const e=t.points; - for(let n=0; - n<e.length; - n+=2){ - const t=e[n],i=e[n+1]; - if(!this.contains(t,i))return!1} - return!0} - clone(){ - const i=this.points.slice(),s=new t(i); - return s.closePath=this.closePath,s} - contains(t,i){ - let s=!1; - const e=this.points.length/2; - for(let n=0,h=e-1; - n<e; - h=n++){ - const e=this.points[2*n],r=this.points[2*n+1],o=this.points[2*h],a=this.points[2*h+1]; - r>i!=a>i&&t<(i-r)/(a-r)*(o-e)+e&&(s=!s)} - return s} - strokeContains(t,i,s,e=.5){ - const n=s*s,h=n*(1-e),r=n-h,{ - points:o} - =this,a=o.length-(this.closePath?0:2); - for(let c=0; - c<a; - c+=2){ - const s=o[c],e=o[c+1],n=o[(c+2)%o.length],a=o[(c+3)%o.length]; - if(wa(t,i,s,e,n,a)<=(Math.sign((n-s)*(i-e)-(a-e)*(t-s))<0?r:h))return!0} - return!1} - getBounds(t){ - t||(t=new $i); - const i=this.points; - let s=1/0,e=-1/0,n=1/0,h=-1/0; - for(let r=0,o=i.length; - r<o; - r+=2){ - const t=i[r],o=i[r+1]; - s=t<s?t:s,e=t>e?t:e,n=o<n?o:n,h=o>h?o:h} - return t.x=s,t.width=e-s,t.y=n,t.height=h-n,t} - copyFrom(t){ - return this.points=t.points.slice(),this.closePath=t.closePath,this} - copyTo(t){ - return t.copyFrom(this),t} - toString(){ - return`[pixi.js/math:PolygoncloseStroke=${ - this.closePath} - points=${ - this.points.reduce((t,i)=>`${ - t} - , ${ - i} - `,"")} - ]`} - get lastX(){ - return this.points[this.points.length-2]} - get lastY(){ - return this.points[this.points.length-1]} - get x(){ - return Yi("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]} - get y(){ - return Yi("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]} - get startX(){ - return this.points[0]} - get startY(){ - return this.points[1]} - } - ; - Qt(ga,"Polygon"); - let ma=ga; - const va=Qt((t,i,s,e,n,h,r)=>{ - const o=t-s,a=i-e,c=Math.sqrt(o*o+a*a); - return c>=n-h&&c<=n+r} - ,"isCornerWithinStroke"),_a=class t{ - constructor(t=0,i=0,s=0,e=0,n=20){ - this.type="roundedRectangle",this.x=t,this.y=i,this.width=s,this.height=e,this.radius=n} - getBounds(t){ - return t||(t=new $i),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t} - clone(){ - return new t(this.x,this.y,this.width,this.height,this.radius)} - copyFrom(t){ - return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this} - copyTo(t){ - return t.copyFrom(this),t} - contains(t,i){ - if(this.width<=0||this.height<=0)return!1; - if(t>=this.x&&t<=this.x+this.width&&i>=this.y&&i<=this.y+this.height){ - const s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2)); - if(i>=this.y+s&&i<=this.y+this.height-s||t>=this.x+s&&t<=this.x+this.width-s)return!0; - let e=t-(this.x+s),n=i-(this.y+s); - const h=s*s; - if(e*e+n*n<=h)return!0; - if(e=t-(this.x+this.width-s),e*e+n*n<=h)return!0; - if(n=i-(this.y+this.height-s),e*e+n*n<=h)return!0; - if(e=t-(this.x+s),e*e+n*n<=h)return!0} - return!1} - strokeContains(t,i,s,e=.5){ - const{ - x:n,y:h,width:r,height:o,radius:a} - =this,c=s*(1-e),l=s-c,u=n+a,d=h+a,f=n+r,p=h+o; - return(t>=n-c&&t<=n+l||t>=f-l&&t<=f+c)&&i>=d&&i<=d+(o-2*a)||(i>=h-c&&i<=h+l||i>=p-l&&i<=p+c)&&t>=u&&t<=u+(r-2*a)||t<u&&i<d&&va(t,i,u,d,a,l,c)||t>f-a&&i<d&&va(t,i,f-a,d,a,l,c)||t>f-a&&i>p-a&&va(t,i,f-a,p-a,a,l,c)||t<u&&i>p-a&&va(t,i,u,p-a,a,l,c)} - toString(){ - return`[pixi.js/math:RoundedRectangle x=${ - this.x} - y=${ - this.y} - width=${ - this.width} - height=${ - this.height} - radius=${ - this.radius} - ]`} - } - ; - Qt(_a,"RoundedRectangle"); - let Ma=_a; - const ba={ - } - ; - function ya(t,i,s){ - let e=2166136261; - for(let n=0; - n<i; - n++)e^=t[n].uid,e=Math.imul(e,16777619),e>>>=0; - return ba[e]||Ea(t,i,e,s)} - function Ea(t,i,s,e){ - const n={ - } - ; - let h=0; - for(let o=0; - o<e; - o++){ - const s=o<i?t[o]:ls.EMPTY.source; - n[h++]=s.source,n[h++]=s.style} - const r=new or(n); - return ba[s]=r,r} - Qt(ya,"getTextureBatchBindGroup"),Qt(Ea,"generateTextureBatchBindGroup"); - const Aa=class{ - constructor(t){ - "number"==typeof t?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength} - get int8View(){ - return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View} - get uint8View(){ - return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View} - get int16View(){ - return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View} - get int32View(){ - return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View} - get float64View(){ - return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array} - get bigUint64View(){ - return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array} - view(t){ - return this[`${ - t} - View`]} - destroy(){ - this.rawBinaryData=null,this.uint32View=null,this.float32View=null,this.uint16View=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._int32View=null,this._float64Array=null,this._bigUint64Array=null} - static sizeOf(t){ - switch(t){ - case"int8":case"uint8":return 1; - case"int16":case"uint16":return 2; - case"int32":case"uint32":case"float32":return 4; - default:throw new Error(`${ - t} - isn't a valid view type`)} - } - } - ; - Qt(Aa,"ViewableBuffer"); - let Sa=Aa; - function Ta(t,i,s,e){ - if(s??(s=0),e??(e=Math.min(t.byteLength-s,i.byteLength)),7&s||7&e)if(3&s||3&e)new Uint8Array(i).set(new Uint8Array(t,s,e)); - else{ - const n=e/4; - new Float32Array(i,0,n).set(new Float32Array(t,s,n))} - else{ - const n=e/8; - new Float64Array(i,0,n).set(new Float64Array(t,s,n))} - } - Qt(Ta,"fastCopy"); - const Ca={ - normal:"normal-npm",add:"add-npm",screen:"screen-npm"} - ; - var Oa=(t=>(t[t.DISABLED=0]="DISABLED",t[t.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",t[t.MASK_ACTIVE=2]="MASK_ACTIVE",t[t.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",t[t.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",t[t.NONE=5]="NONE",t))(Oa||{ - } - ); - function Ia(t,i){ - return"no-premultiply-alpha"===i.alphaMode&&Ca[t]||t} - Qt(Ia,"getAdjustedBlendModeBlend"); - const ka=["precision mediump float; - ","void main(void){ - ","float test = 0.1; - ","%forloop%","gl_FragColor = vec4(0.0); - ","} - "].join("\n"); - function xa(t){ - let i=""; - for(let s=0; - s<t; - ++s)s>0&&(i+="\nelse "),s<t-1&&(i+=`if(test == ${ - s} - .0){ - } - `); - return i} - function Ra(t,i){ - if(0===t)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`"); - const s=i.createShader(i.FRAGMENT_SHADER); - try{ - for(; - ; - ){ - const e=ka.replace(/%forloop%/gi,xa(t)); - if(i.shaderSource(s,e),i.compileShader(s),i.getShaderParameter(s,i.COMPILE_STATUS))break; - t=t/2|0} - } - finally{ - i.deleteShader(s)} - return t} - Qt(xa,"generateIfTestSrc"),Qt(Ra,"checkMaxIfStatementsInShader"); - let Pa=null; - function Na(){ - var t; - if(Pa)return Pa; - const i=Ch(); - return Pa=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),Pa=Ra(Pa,i),null==(t=i.getExtension("WEBGL_lose_context"))||t.loseContext(),Pa} - Qt(Na,"getMaxTexturesPerBatch"); - const La=class{ - constructor(){ - this.ids=Object.create(null),this.textures=[],this.count=0} - clear(){ - for(let t=0; - t<this.count; - t++){ - const i=this.textures[t]; - this.textures[t]=null,this.ids[i.uid]=null} - this.count=0} - } - ; - Qt(La,"BatchTextureArray"); - let Da=La; - const Ga=class{ - constructor(){ - this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new Da,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=!0} - destroy(){ - this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null,this.elements=null} - } - ; - Qt(Ga,"Batch"); - let Ba=Ga; - const Ua=[]; - let Fa=0; - function $a(){ - return Fa>0?Ua[--Fa]:new Ba} - function Ha(t){ - t.elements=null,Ua[Fa++]=t} - Xs.register({ - clear:Qt(()=>{ - if(Ua.length>0)for(const t of Ua)t&&t.destroy(); - Ua.length=0,Fa=0} - ,"clear")} - ),Qt($a,"getBatchFromPool"),Qt(Ha,"returnBatchToPool"); - let Wa=0; - const Va=(Qt(m=class{ - constructor(t){ - this.uid=Wi("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],(t={ - ...m.defaultOptions,...t} - ).maxTextures||(Yi("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),t.maxTextures=Na()); - const{ - maxTextures:i,attributesInitialSize:s,indicesInitialSize:e} - =t; - this.attributeBuffer=new Sa(4*s),this.indexBuffer=new Uint16Array(e),this.maxTextures=i} - begin(){ - this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0; - for(let t=0; - t<this.batchIndex; - t++)Ha(this.batches[t]); - this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=!0} - add(t){ - this._elements[this.elementSize++]=t,t._indexStart=this.indexSize,t._attributeStart=this.attributeSize,t._batcher=this,this.indexSize+=t.indexSize,this.attributeSize+=t.attributeSize*this.vertexSize} - checkAndUpdateTexture(t,i){ - const s=t._batch.textures.ids[i._source.uid]; - return!(!s&&0!==s||(t._textureId=s,t.texture=i,0))} - updateElement(t){ - this.dirty=!0; - const i=this.attributeBuffer; - t.packAsQuad?this.packQuadAttributes(t,i.float32View,i.uint32View,t._attributeStart,t._textureId):this.packAttributes(t,i.float32View,i.uint32View,t._attributeStart,t._textureId)} - break(t){ - const i=this._elements; - if(!i[this.elementStart])return; - let s=$a(),e=s.textures; - e.clear(); - const n=i[this.elementStart]; - let h=Ia(n.blendMode,n.texture._source),r=n.topology; - 4*this.attributeSize>this.attributeBuffer.size&&this._resizeAttributeBuffer(4*this.attributeSize),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize); - const o=this.attributeBuffer.float32View,a=this.attributeBuffer.uint32View,c=this.indexBuffer; - let l=this._batchIndexSize,u=this._batchIndexStart,d="startBatch",f=[]; - const p=this.maxTextures; - for(let w=this.elementStart; - w<this.elementSize; - ++w){ - const n=i[w]; - i[w]=null; - const g=n.texture._source,m=Ia(n.blendMode,g),v=h!==m||r!==n.topology; - g._batchTick!==Wa||v?(g._batchTick=Wa,(e.count>=p||v)&&(this._finishBatch(s,u,l-u,e,h,r,t,d,f),d="renderBatch",u=l,h=m,r=n.topology,s=$a(),e=s.textures,e.clear(),f=[],++Wa),n._textureId=g._textureBindLocation=e.count,e.ids[g.uid]=e.count,e.textures[e.count++]=g,n._batch=s,f.push(n),l+=n.indexSize,n.packAsQuad?(this.packQuadAttributes(n,o,a,n._attributeStart,n._textureId),this.packQuadIndex(c,n._indexStart,n._attributeStart/this.vertexSize)):(this.packAttributes(n,o,a,n._attributeStart,n._textureId),this.packIndex(n,c,n._indexStart,n._attributeStart/this.vertexSize))):(n._textureId=g._textureBindLocation,l+=n.indexSize,n.packAsQuad?(this.packQuadAttributes(n,o,a,n._attributeStart,n._textureId),this.packQuadIndex(c,n._indexStart,n._attributeStart/this.vertexSize)):(this.packAttributes(n,o,a,n._attributeStart,n._textureId),this.packIndex(n,c,n._indexStart,n._attributeStart/this.vertexSize)),n._batch=s,f.push(n))} - e.count>0&&(this._finishBatch(s,u,l-u,e,h,r,t,d,f),u=l,++Wa),this.elementStart=this.elementSize,this._batchIndexStart=u,this._batchIndexSize=l} - _finishBatch(t,i,s,e,n,h,r,o,a){ - t.gpuBindGroup=null,t.bindGroup=null,t.action=o,t.batcher=this,t.textures=e,t.blendMode=n,t.topology=h,t.start=i,t.size=s,t.elements=a,++Wa,this.batches[this.batchIndex++]=t,r.add(t)} - finish(t){ - this.break(t)} - ensureAttributeBuffer(t){ - 4*t<=this.attributeBuffer.size||this._resizeAttributeBuffer(4*t)} - ensureIndexBuffer(t){ - t<=this.indexBuffer.length||this._resizeIndexBuffer(t)} - _resizeAttributeBuffer(t){ - const i=Math.max(t,2*this.attributeBuffer.size),s=new Sa(i); - Ta(this.attributeBuffer.rawBinaryData,s.rawBinaryData),this.attributeBuffer=s} - _resizeIndexBuffer(t){ - const i=this.indexBuffer; - let s=Math.max(t,1.5*i.length); - s+=s%2; - const e=s>65535?new Uint32Array(s):new Uint16Array(s); - if(e.BYTES_PER_ELEMENT!==i.BYTES_PER_ELEMENT)for(let n=0; - n<i.length; - n++)e[n]=i[n]; - else Ta(i.buffer,e.buffer); - this.indexBuffer=e} - packQuadIndex(t,i,s){ - t[i]=s+0,t[i+1]=s+1,t[i+2]=s+2,t[i+3]=s+0,t[i+4]=s+2,t[i+5]=s+3} - packIndex(t,i,s,e){ - const n=t.indices,h=t.indexSize,r=t.indexOffset,o=t.attributeOffset; - for(let a=0; - a<h; - a++)i[s++]=e+n[a+r]-o} - destroy(t={ - } - ){ - var i; - if(null!==this.batches){ - for(let t=0; - t<this.batchIndex; - t++)Ha(this.batches[t]); - this.batches=null,this.geometry.destroy(!0),this.geometry=null,t.shader&&(null==(i=this.shader)||i.destroy(),this.shader=null); - for(let t=0; - t<this._elements.length; - t++)this._elements[t]&&(this._elements[t]._batch=null); - this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null} - } - } - ,"_Batcher"),m); - Va.defaultOptions={ - maxTextures:null,attributesInitialSize:4,indicesInitialSize:6} - ; - let ja=Va; - var Ka=(t=>(t[t.MAP_READ=1]="MAP_READ",t[t.MAP_WRITE=2]="MAP_WRITE",t[t.COPY_SRC=4]="COPY_SRC",t[t.COPY_DST=8]="COPY_DST",t[t.INDEX=16]="INDEX",t[t.VERTEX=32]="VERTEX",t[t.UNIFORM=64]="UNIFORM",t[t.STORAGE=128]="STORAGE",t[t.INDIRECT=256]="INDIRECT",t[t.QUERY_RESOLVE=512]="QUERY_RESOLVE",t[t.STATIC=1024]="STATIC",t))(Ka||{ - } - ); - let za=(Qt(v=class extends vi{ - constructor(t){ - let{ - data:i,size:s} - =t; - const{ - usage:e,label:n,shrinkToFit:h} - =t; - super(),this._gpuData=Object.create(null),this._gcLastUsed=-1,this.autoGarbageCollect=!0,this.uid=Wi("buffer"),this._resourceType="buffer",this._resourceId=Wi("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,i instanceof Array&&(i=new Float32Array(i)),this._data=i,s??(s=null==i?void 0:i.byteLength); - const r=!!i; - this.descriptor={ - size:s,usage:e,mappedAtCreation:r,label:n} - ,this.shrinkToFit=h??!0} - get data(){ - return this._data} - set data(t){ - this.setDataWithSize(t,t.length,!0)} - get dataInt32(){ - return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32} - get static(){ - return!!(this.descriptor.usage&Ka.STATIC)} - set static(t){ - t?this.descriptor.usage|=Ka.STATIC:this.descriptor.usage&=~Ka.STATIC} - setDataWithSize(t,i,s){ - if(this._updateID++,this._updateSize=i*t.BYTES_PER_ELEMENT,this._data===t)return void(s&&this.emit("update",this)); - const e=this._data; - this._data=t,this._dataInt32=null,e&&e.length===t.length||!this.shrinkToFit&&e&&t.byteLength<e.byteLength?s&&this.emit("update",this):(this.descriptor.size=t.byteLength,this._resourceId=Wi("resource"),this.emit("change",this))} - update(t){ - this._updateSize=t??this._updateSize,this._updateID++,this.emit("update",this)} - unload(){ - var t; - this.emit("unload",this); - for(const i in this._gpuData)null==(t=this._gpuData[i])||t.destroy(); - this._gpuData=Object.create(null)} - destroy(){ - this.destroyed=!0,this.unload(),this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners()} - } - ,"Buffer"),v); - function Ya(t,i){ - if(!(t instanceof za)){ - let s=i?Ka.INDEX:Ka.VERTEX; - t instanceof Array&&(i?(t=new Uint32Array(t),s=Ka.INDEX|Ka.COPY_DST):(t=new Float32Array(t),s=Ka.VERTEX|Ka.COPY_DST)),t=new za({ - data:t,label:i?"index-mesh-buffer":"vertex-mesh-buffer",usage:s} - )} - return t} - function qa(t,i,s){ - const e=t.getAttribute(i); - if(!e)return s.minX=0,s.minY=0,s.maxX=0,s.maxY=0,s; - const n=e.buffer.data; - let h=1/0,r=1/0,o=-1/0,a=-1/0; - const c=n.BYTES_PER_ELEMENT,l=(e.offset||0)/c,u=(e.stride||8)/c; - for(let d=l; - d<n.length; - d+=u){ - const t=n[d],i=n[d+1]; - t>o&&(o=t),i>a&&(a=i),t<h&&(h=t),i<r&&(r=i)} - return s.minX=h,s.minY=r,s.maxX=o,s.maxY=a,s} - function Xa(t){ - return(t instanceof za||Array.isArray(t)||t.BYTES_PER_ELEMENT)&&(t={ - buffer:t} - ),t.buffer=Ya(t.buffer,!1),t} - Qt(Ya,"ensureIsBuffer"),Qt(qa,"getGeometryBounds"),Qt(Xa,"ensureIsAttribute"); - const Ja=class extends vi{ - constructor(t={ - } - ){ - super(),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=Wi("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new ps,this._boundsDirty=!0; - const{ - attributes:i,indexBuffer:s,topology:e} - =t; - if(this.buffers=[],this.attributes={ - } - ,i)for(const n in i)this.addAttribute(n,i[n]); - this.instanceCount=t.instanceCount??1,s&&this.addIndex(s),this.topology=e||"triangle-list"} - onBufferUpdate(){ - this._boundsDirty=!0,this.emit("update",this)} - getAttribute(t){ - return this.attributes[t]} - getIndex(){ - return this.indexBuffer} - getBuffer(t){ - return this.getAttribute(t).buffer} - getSize(){ - for(const t in this.attributes){ - const i=this.attributes[t]; - return i.buffer.data.length/(i.stride/4||i.size)} - return 0} - addAttribute(t,i){ - const s=Xa(i); - -1===this.buffers.indexOf(s.buffer)&&(this.buffers.push(s.buffer),s.buffer.on("update",this.onBufferUpdate,this),s.buffer.on("change",this.onBufferUpdate,this)),this.attributes[t]=s} - addIndex(t){ - this.indexBuffer=Ya(t,!0),this.buffers.push(this.indexBuffer)} - get bounds(){ - return this._boundsDirty?(this._boundsDirty=!1,qa(this,"aPosition",this._bounds)):this._bounds} - unload(){ - var t; - this.emit("unload",this); - for(const i in this._gpuData)null==(t=this._gpuData[i])||t.destroy(); - this._gpuData=Object.create(null)} - destroy(t=!1){ - var i; - this.emit("destroy",this),this.removeAllListeners(),t&&this.buffers.forEach(t=>t.destroy()),this.unload(),null==(i=this.indexBuffer)||i.destroy(),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null} - } - ; - Qt(Ja,"Geometry"); - let Qa=Ja; - const Za=new Float32Array(1),tc=new Uint32Array(1),ic=class extends Qa{ - constructor(){ - const t=new za({ - data:Za,label:"attribute-batch-buffer",usage:Ka.VERTEX|Ka.COPY_DST,shrinkToFit:!1} - ); - super({ - attributes:{ - aPosition:{ - buffer:t,format:"float32x2",stride:24,offset:0} - ,aUV:{ - buffer:t,format:"float32x2",stride:24,offset:8} - ,aColor:{ - buffer:t,format:"unorm8x4",stride:24,offset:16} - ,aTextureIdAndRound:{ - buffer:t,format:"uint16x2",stride:24,offset:20} - } - ,indexBuffer:new za({ - data:tc,label:"index-batch-buffer",usage:Ka.INDEX|Ka.COPY_DST,shrinkToFit:!1} - )} - )} - } - ; - Qt(ic,"BatchGeometry"); - let sc=ic; - function ec(t,i,s){ - if(t)for(const e in t){ - const n=i[e.toLocaleLowerCase()]; - if(n){ - let i=t[e]; - "header"===e&&(i=i.replace(/@in\s+[^; - ]+; - \s*/g,"").replace(/@out\s+[^; - ]+; - \s*/g,"")),s&&n.push(`//----${ - s} - ----//`),n.push(i)} - else qs()} - } - Qt(ec,"addBits"); - const nc=/\{ - \{ - (.*?)\} - \} - /g; - function hc(t){ - var i; - const s={ - } - ; - return((null==(i=t.match(nc))?void 0:i.map(t=>t.replace(/[{ - ()} - ]/g,"")))??[]).forEach(t=>{ - s[t]=[]} - ),s} - function rc(t,i){ - let s; - const e=/@in\s+([^; - ]+); - /g; - for(; - null!==(s=e.exec(t)); - )i.push(s[1])} - function oc(t,i,s=!1){ - const e=[]; - rc(i,e),t.forEach(t=>{ - t.header&&rc(t.header,e)} - ); - const n=e; - s&&n.sort(); - const h=n.map((t,i)=>` @location(${ - i} - ) ${ - t} - ,`).join("\n"); - let r=i.replace(/@in\s+[^; - ]+; - \s*/g,""); - return r=r.replace("{ - { - in} - } - ",`\n${ - h} - \n`),r} - function ac(t,i){ - let s; - const e=/@out\s+([^; - ]+); - /g; - for(; - null!==(s=e.exec(t)); - )i.push(s[1])} - function cc(t){ - const i=/\b(\w+)\s*:/g.exec(t); - return i?i[1]:""} - function lc(t){ - return t.replace(/@.*?\s+/g,"")} - function uc(t,i){ - const s=[]; - ac(i,s),t.forEach(t=>{ - t.header&&ac(t.header,s)} - ); - let e=0; - const n=s.sort().map(t=>t.indexOf("builtin")>-1?t:`@location(${ - e++} - ) ${ - t} - `).join(",\n"),h=s.sort().map(t=>` var ${ - lc(t)} - ; - `).join("\n"),r=`return VSOutput(\n ${ - s.sort().map(t=>` ${ - cc(t)} - `).join(",\n")} - ); - `; - let o=i.replace(/@out\s+[^; - ]+; - \s*/g,""); - return o=o.replace("{ - { - struct} - } - ",`\n${ - n} - \n`),o=o.replace("{ - { - start} - } - ",`\n${ - h} - \n`),o=o.replace("{ - { - return} - } - ",`\n${ - r} - \n`),o} - function dc(t,i){ - let s=t; - for(const e in i){ - const t=i[e]; - s=t.join("\n").length?s.replace(`{ - { - ${ - e} - } - } - `,`//-----${ - e} - START-----//\n${ - t.join("\n")} - \n//----${ - e} - FINISH----//`):s.replace(`{ - { - ${ - e} - } - } - `,"")} - return s} - Qt(hc,"compileHooks"),Qt(rc,"extractInputs"),Qt(oc,"compileInputs"),Qt(ac,"extractOutputs"),Qt(cc,"extractVariableName"),Qt(lc,"stripVariable"),Qt(uc,"compileOutputs"),Qt(dc,"injectBits"); - const fc=Object.create(null),pc=new Map; - let wc=0; - function gc({ - template:t,bits:i} - ){ - const s=_c(t,i); - if(fc[s])return fc[s]; - const{ - vertex:e,fragment:n} - =vc(t,i); - return fc[s]=Mc(e,n,i),fc[s]} - function mc({ - template:t,bits:i} - ){ - const s=_c(t,i); - return fc[s]||(fc[s]=Mc(t.vertex,t.fragment,i)),fc[s]} - function vc(t,i){ - const s=i.map(t=>t.vertex).filter(t=>!!t),e=i.map(t=>t.fragment).filter(t=>!!t); - let n=oc(s,t.vertex,!0); - return n=uc(s,n),{ - vertex:n,fragment:oc(e,t.fragment,!0)} - } - function _c(t,i){ - return i.map(t=>(pc.has(t)||pc.set(t,wc++),pc.get(t))).sort((t,i)=>t-i).join("-")+t.vertex+t.fragment} - function Mc(t,i,s){ - const e=hc(t),n=hc(i); - return s.forEach(t=>{ - ec(t.vertex,e,t.name),ec(t.fragment,n,t.name)} - ),{ - vertex:dc(t,e),fragment:dc(i,n)} - } - Qt(gc,"compileHighShader"),Qt(mc,"compileHighShaderGl"),Qt(vc,"compileInputsAndOutputs"),Qt(_c,"generateCacheId"),Qt(Mc,"compileBits"); - const bc="\n @in aPosition: vec2<f32>; - \n @in aUV: vec2<f32>; - \n\n @out @builtin(position) vPosition: vec4<f32>; - \n @out vUV : vec2<f32>; - \n @out vColor : vec4<f32>; - \n\n { - { - header} - } - \n\n struct VSOutput { - \n { - { - struct} - } - \n } - ; - \n\n @vertex\n fn main( { - { - in} - } - ) -> VSOutput { - \n\n var worldTransformMatrix = globalUniforms.uWorldTransformMatrix; - \n var modelMatrix = mat3x3<f32>(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n ); - \n var position = aPosition; - \n var uv = aUV; - \n\n { - { - start} - } - \n\n vColor = vec4<f32>(1., 1., 1., 1.); - \n\n { - { - main} - } - \n\n vUV = uv; - \n\n var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix; - \n\n vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0); - \n\n vColor *= globalUniforms.uWorldColorAlpha; - \n\n { - { - end} - } - \n\n { - { - return} - } - \n } - ; - \n",yc="\n @in vUV : vec2<f32>; - \n @in vColor : vec4<f32>; - \n\n { - { - header} - } - \n\n @fragment\n fn main(\n { - { - in} - } - \n ) -> @location(0) vec4<f32> { - \n\n { - { - start} - } - \n\n var outColor:vec4<f32>; - \n\n { - { - main} - } - \n\n var finalColor:vec4<f32> = outColor * vColor; - \n\n { - { - end} - } - \n\n return finalColor; - \n } - ; - \n",Ec="\n in vec2 aPosition; - \n in vec2 aUV; - \n\n out vec4 vColor; - \n out vec2 vUV; - \n\n { - { - header} - } - \n\n void main(void){ - \n\n mat3 worldTransformMatrix = uWorldTransformMatrix; - \n mat3 modelMatrix = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n ); - \n vec2 position = aPosition; - \n vec2 uv = aUV; - \n\n { - { - start} - } - \n\n vColor = vec4(1.); - \n\n { - { - main} - } - \n\n vUV = uv; - \n\n mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix; - \n\n gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); - \n\n vColor *= uWorldColorAlpha; - \n\n { - { - end} - } - \n } - \n",Ac="\n\n in vec4 vColor; - \n in vec2 vUV; - \n\n out vec4 finalColor; - \n\n { - { - header} - } - \n\n void main(void) { - \n\n { - { - start} - } - \n\n vec4 outColor; - \n\n { - { - main} - } - \n\n finalColor = outColor * vColor; - \n\n { - { - end} - } - \n } - \n",Sc={ - name:"global-uniforms-bit",vertex:{ - header:"\n struct GlobalUniforms { - \n uProjectionMatrix:mat3x3<f32>,\n uWorldTransformMatrix:mat3x3<f32>,\n uWorldColorAlpha: vec4<f32>,\n uResolution: vec2<f32>,\n } - \n\n @group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms; - \n "} - } - ,Tc={ - name:"global-uniforms-bit",vertex:{ - header:"\n uniform mat3 uProjectionMatrix; - \n uniform mat3 uWorldTransformMatrix; - \n uniform vec4 uWorldColorAlpha; - \n uniform vec2 uResolution; - \n "} - } - ; - function Cc({ - bits:t,name:i} - ){ - const s=gc({ - template:{ - fragment:yc,vertex:bc} - ,bits:[Sc,...t]} - ); - return tr.from({ - name:i,vertex:{ - source:s.vertex,entryPoint:"main"} - ,fragment:{ - source:s.fragment,entryPoint:"main"} - } - )} - function Oc({ - bits:t,name:i} - ){ - return new Uh({ - name:i,...mc({ - template:{ - vertex:Ec,fragment:Ac} - ,bits:[Tc,...t]} - )} - )} - Qt(Cc,"compileHighShaderGpuProgram"),Qt(Oc,"compileHighShaderGlProgram"); - const Ic={ - name:"color-bit",vertex:{ - header:"\n @in aColor: vec4<f32>; - \n ",main:"\n vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a); - \n "} - } - ,kc={ - name:"color-bit",vertex:{ - header:"\n in vec4 aColor; - \n ",main:"\n vColor *= vec4(aColor.rgb * aColor.a, aColor.a); - \n "} - } - ,xc={ - } - ; - function Rc(t){ - const i=[]; - if(1===t)i.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>; - "),i.push("@group(1) @binding(1) var textureSampler1: sampler; - "); - else{ - let s=0; - for(let e=0; - e<t; - e++)i.push(`@group(1) @binding(${ - s++} - ) var textureSource${ - e+1} - : texture_2d<f32>; - `),i.push(`@group(1) @binding(${ - s++} - ) var textureSampler${ - e+1} - : sampler; - `)} - return i.join("\n")} - function Pc(t){ - const i=[]; - if(1===t)i.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy); - "); - else{ - i.push("switch vTextureId { - "); - for(let s=0; - s<t; - s++)s===t-1?i.push(" default:{ - "):i.push(` case ${ - s} - :{ - `),i.push(` outColor = textureSampleGrad(textureSource${ - s+1} - , textureSampler${ - s+1} - , vUV, uvDx, uvDy); - `),i.push(" break; - } - "); - i.push("} - ")} - return i.join("\n")} - function Nc(t){ - return xc[t]||(xc[t]={ - name:"texture-batch-bit",vertex:{ - header:"\n @in aTextureIdAndRound: vec2<u32>; - \n @out @interpolate(flat) vTextureId : u32; - \n ",main:"\n vTextureId = aTextureIdAndRound.y; - \n ",end:"\n if(aTextureIdAndRound.x == 1)\n { - \n vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw); - \n } - \n "} - ,fragment:{ - header:`\n @in @interpolate(flat) vTextureId: u32; - \n\n ${ - Rc(t)} - \n `,main:`\n var uvDx = dpdx(vUV); - \n var uvDy = dpdy(vUV); - \n\n ${ - Pc(t)} - \n `} - } - ),xc[t]} - Qt(Rc,"generateBindingSrc"),Qt(Pc,"generateSampleSrc"),Qt(Nc,"generateTextureBatchBit"); - const Lc={ - } - ; - function Dc(t){ - const i=[]; - for(let s=0; - s<t; - s++)s>0&&i.push("else"),s<t-1&&i.push(`if(vTextureId < ${ - s} - .5)`),i.push("{ - "),i.push(`\toutColor = texture(uTextures[${ - s} - ], vUV); - `),i.push("} - "); - return i.join("\n")} - function Gc(t){ - return Lc[t]||(Lc[t]={ - name:"texture-batch-bit",vertex:{ - header:"\n in vec2 aTextureIdAndRound; - \n out float vTextureId; - \n\n ",main:"\n vTextureId = aTextureIdAndRound.y; - \n ",end:"\n if(aTextureIdAndRound.x == 1.)\n { - \n gl_Position.xy = roundPixels(gl_Position.xy, uResolution); - \n } - \n "} - ,fragment:{ - header:`\n in float vTextureId; - \n\n uniform sampler2D uTextures[${ - t} - ]; - \n\n `,main:`\n\n ${ - Dc(t)} - \n `} - } - ),Lc[t]} - Qt(Dc,"generateSampleGlSrc"),Qt(Gc,"generateTextureBatchBitGl"); - const Bc={ - name:"round-pixels-bit",vertex:{ - header:"\n fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>\n { - \n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0; - \n } - \n "} - } - ,Uc={ - name:"round-pixels-bit",vertex:{ - header:"\n vec2 roundPixels(vec2 position, vec2 targetSize)\n { - \n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0; - \n } - \n "} - } - ,Fc={ - } - ; - function $c(t){ - let i=Fc[t]; - if(i)return i; - const s=new Int32Array(t); - for(let e=0; - e<t; - e++)s[e]=e; - return i=Fc[t]=new hr({ - uTextures:{ - value:s,type:"i32",size:t} - } - ,{ - isStatic:!0} - ),i} - Qt($c,"getBatchSamplersUniformGroup"); - const Hc=class extends lr{ - constructor(t){ - super({ - glProgram:Oc({ - name:"batch",bits:[kc,Gc(t),Uc]} - ),gpuProgram:Cc({ - name:"batch",bits:[Ic,Nc(t),Bc]} - ),resources:{ - batchSamplers:$c(t)} - } - ),this.maxTextures=t} - } - ; - Qt(Hc,"DefaultShader"); - let Wc=Hc,Vc=null; - const jc=(_=class extends ja{ - constructor(t){ - super(t),this.geometry=new sc,this.name=_.extension.name,this.vertexSize=6,Vc??(Vc=new Wc(t.maxTextures)),this.shader=Vc} - packAttributes(t,i,s,e,n){ - const h=n<<16|65535&t.roundPixels,r=t.transform,o=r.a,a=r.b,c=r.c,l=r.d,u=r.tx,d=r.ty,{ - positions:f,uvs:p} - =t,w=t.color,g=t.attributeOffset,m=g+t.attributeSize; - for(let v=g; - v<m; - v++){ - const t=2*v,n=f[t],r=f[t+1]; - i[e++]=o*n+c*r+u,i[e++]=l*r+a*n+d,i[e++]=p[t],i[e++]=p[t+1],s[e++]=w,s[e++]=h} - } - packQuadAttributes(t,i,s,e,n){ - const h=t.texture,r=t.transform,o=r.a,a=r.b,c=r.c,l=r.d,u=r.tx,d=r.ty,f=t.bounds,p=f.maxX,w=f.minX,g=f.maxY,m=f.minY,v=h.uvs,_=t.color,M=n<<16|65535&t.roundPixels; - i[e+0]=o*w+c*m+u,i[e+1]=l*m+a*w+d,i[e+2]=v.x0,i[e+3]=v.y0,s[e+4]=_,s[e+5]=M,i[e+6]=o*p+c*m+u,i[e+7]=l*m+a*p+d,i[e+8]=v.x1,i[e+9]=v.y1,s[e+10]=_,s[e+11]=M,i[e+12]=o*p+c*g+u,i[e+13]=l*g+a*p+d,i[e+14]=v.x2,i[e+15]=v.y2,s[e+16]=_,s[e+17]=M,i[e+18]=o*w+c*g+u,i[e+19]=l*g+a*w+d,i[e+20]=v.x3,i[e+21]=v.y3,s[e+22]=_,s[e+23]=M} - _updateMaxTextures(t){ - this.shader.maxTextures!==t&&(Vc=new Wc(t),this.shader=Vc)} - destroy(){ - this.shader=null,super.destroy()} - } - ,Qt(_,"_DefaultBatcher"),_); - jc.extension={ - type:[ri.Batcher],name:"default"} - ; - let Kc=jc; - const zc=class{ - constructor(t){ - this.items=Object.create(null); - const{ - renderer:i,type:s,onUnload:e,priority:n,name:h} - =t; - this._renderer=i,i.gc.addResourceHash(this,"items",s,n??0),this._onUnload=e,this.name=h} - add(t){ - return!this.items[t.uid]&&(this.items[t.uid]=t,t.once("unload",this.remove,this),t._gcLastUsed=this._renderer.gc.now,!0)} - remove(t,...i){ - var s; - if(!this.items[t.uid])return; - const e=t._gpuData[this._renderer.uid]; - e&&(null==(s=this._onUnload)||s.call(this,t,...i),e.destroy(),t._gpuData[this._renderer.uid]=null,this.items[t.uid]=null)} - removeAll(...t){ - Object.values(this.items).forEach(i=>i&&this.remove(i,...t))} - destroy(...t){ - this.removeAll(...t),this.items=Object.create(null),this._renderer=null,this._onUnload=null} - } - ; - Qt(zc,"GCManagedHash"); - let Yc=zc; - function qc(t,i,s,e,n,h,r,o=null){ - let a=0; - s*=i,n*=h; - const c=o.a,l=o.b,u=o.c,d=o.d,f=o.tx,p=o.ty; - for(; - a<r; - ){ - const r=t[s],o=t[s+1]; - e[n]=c*r+u*o+f,e[n+1]=l*r+d*o+p,n+=h,s+=i,a++} - } - function Xc(t,i,s,e){ - let n=0; - for(i*=s; - n<e; - )t[i]=0,t[i+1]=0,i+=s,n++} - function Jc(t,i,s,e,n){ - const h=i.a,r=i.b,o=i.c,a=i.d,c=i.tx,l=i.ty; - s||(s=0),e||(e=2),n||(n=t.length/e-s); - let u=s*e; - for(let d=0; - d<n; - d++){ - const i=t[u],s=t[u+1]; - t[u]=h*i+o*s+c,t[u+1]=r*i+a*s+l,u+=e} - } - Qt(qc,"buildUvs"),Qt(Xc,"buildSimpleUvs"),Qt(Jc,"transformVertices"); - const Qc=new Ci,Zc=class{ - constructor(){ - this.packAsQuad=!1,this.batcherName="default",this.topology="triangle-list",this.applyTransform=!0,this.roundPixels=0,this._batcher=null,this._batch=null} - get uvs(){ - return this.geometryData.uvs} - get positions(){ - return this.geometryData.vertices} - get indices(){ - return this.geometryData.indices} - get blendMode(){ - return this.renderable&&this.applyTransform?this.renderable.groupBlendMode:"normal"} - get color(){ - const t=this.baseColor,i=t>>16|65280&t|(255&t)<<16,s=this.renderable; - return s?_e(i,s.groupColor)+(this.alpha*s.groupAlpha*255<<24):i+(255*this.alpha<<24)} - get transform(){ - var t; - return(null==(t=this.renderable)?void 0:t.groupTransform)||Qc} - copyTo(t){ - t.indexOffset=this.indexOffset,t.indexSize=this.indexSize,t.attributeOffset=this.attributeOffset,t.attributeSize=this.attributeSize,t.baseColor=this.baseColor,t.alpha=this.alpha,t.texture=this.texture,t.geometryData=this.geometryData,t.topology=this.topology} - reset(){ - this.applyTransform=!0,this.renderable=null,this.topology="triangle-list"} - destroy(){ - this.renderable=null,this.texture=null,this.geometryData=null,this._batcher=null,this._batch=null} - } - ; - Qt(Zc,"BatchableGraphics"); - let tl=Zc; - const il={ - extension:{ - type:ri.ShapeBuilder,name:"circle"} - ,build(t,i){ - let s,e,n,h,r,o; - if("circle"===t.type){ - const i=t; - if(r=o=i.radius,r<=0)return!1; - s=i.x,e=i.y,n=h=0} - else if("ellipse"===t.type){ - const i=t; - if(r=i.halfWidth,o=i.halfHeight,r<=0||o<=0)return!1; - s=i.x,e=i.y,n=h=0} - else{ - const i=t,a=i.width/2,c=i.height/2; - s=i.x+a,e=i.y+c,r=o=Math.max(0,Math.min(i.radius,Math.min(a,c))),n=a-r,h=c-o} - if(n<0||h<0)return!1; - const a=Math.ceil(2.3*Math.sqrt(r+o)),c=8*a+(n?4:0)+(h?4:0); - if(0===c)return!1; - if(0===a)return i[0]=i[6]=s+n,i[1]=i[3]=e+h,i[2]=i[4]=s-n,i[5]=i[7]=e-h,!0; - let l=0,u=4*a+(n?2:0)+2,d=u,f=c,p=n+r,w=h,g=s+p,m=s-p,v=e+w; - if(i[l++]=g,i[l++]=v,i[--u]=v,i[--u]=m,h){ - const t=e-w; - i[d++]=m,i[d++]=t,i[--f]=t,i[--f]=g} - for(let M=1; - M<a; - M++){ - const t=Math.PI/2*(M/a),c=n+Math.cos(t)*r,p=h+Math.sin(t)*o,w=s+c,g=s-c,m=e+p,v=e-p; - i[l++]=w,i[l++]=m,i[--u]=m,i[--u]=g,i[d++]=g,i[d++]=v,i[--f]=v,i[--f]=w} - p=n,w=h+o,g=s+p,m=s-p,v=e+w; - const _=e-w; - return i[l++]=g,i[l++]=v,i[--f]=_,i[--f]=g,n&&(i[l++]=m,i[l++]=v,i[--f]=_,i[--f]=m),!0} - ,triangulate(t,i,s,e,n,h){ - if(0===t.length)return; - let r=0,o=0; - for(let l=0; - l<t.length; - l+=2)r+=t[l],o+=t[l+1]; - r/=t.length/2,o/=t.length/2; - let a=e; - i[a*s]=r,i[a*s+1]=o; - const c=a++; - for(let l=0; - l<t.length; - l+=2)i[a*s]=t[l],i[a*s+1]=t[l+1],l>0&&(n[h++]=a,n[h++]=c,n[h++]=a-1),a++; - n[h++]=c+1,n[h++]=c,n[h++]=a-1} - } - ,sl={ - ...il,extension:{ - ...il.extension,name:"ellipse"} - } - ,el={ - ...il,extension:{ - ...il.extension,name:"roundedRectangle"} - } - ,nl=1e-4; - function hl(t){ - const i=t.length; - if(i<6)return 1; - let s=0; - for(let e=0,n=t[i-2],h=t[i-1]; - e<i; - e+=2){ - const i=t[e],r=t[e+1]; - s+=(i-n)*(r+h),n=i,h=r} - return s<0?-1:1} - function rl(t,i,s,e,n,h,r,o){ - let a,c; - r?(a=e,c=-s):(a=-e,c=s); - const l=t-s*n+a,u=i-e*n+c,d=t+s*h+a,f=i+e*h+c; - return o.push(l,u),o.push(d,f),2} - function ol(t,i,s,e,n,h,r,o){ - const a=s-t,c=e-i; - let l=Math.atan2(a,c),u=Math.atan2(n-t,h-i); - o&&l<u?l+=2*Math.PI:!o&&l>u&&(u+=2*Math.PI); - let d=l; - const f=u-l,p=Math.abs(f),w=Math.sqrt(a*a+c*c),g=1+(15*p*Math.sqrt(w)/Math.PI|0),m=f/g; - if(d+=m,o){ - r.push(t,i),r.push(s,e); - for(let s=1,e=d; - s<g; - s++,e+=m)r.push(t,i),r.push(t+Math.sin(e)*w,i+Math.cos(e)*w); - r.push(t,i),r.push(n,h)} - else{ - r.push(s,e),r.push(t,i); - for(let s=1,e=d; - s<g; - s++,e+=m)r.push(t+Math.sin(e)*w,i+Math.cos(e)*w),r.push(t,i); - r.push(n,h),r.push(t,i)} - return 2*g} - function al(t,i,s,e,n,h){ - const r=nl; - if(0===t.length)return; - const o=i; - let a=o.alignment; - .5!==i.alignment&&(a=(a-.5)*hl(t)+.5); - const c=new Ai(t[0],t[1]),l=new Ai(t[t.length-2],t[t.length-1]),u=e,d=Math.abs(c.x-l.x)<r&&Math.abs(c.y-l.y)<r; - if(u){ - t=t.slice(),d&&(t.pop(),t.pop(),l.set(t[t.length-2],t[t.length-1])); - const i=.5*(c.x+l.x),s=.5*(l.y+c.y); - t.unshift(i,s),t.push(i,s)} - const f=n,p=t.length/2; - let w=t.length; - const g=f.length/2,m=o.width/2,v=m*m,_=o.miterLimit*o.miterLimit; - let M=t[0],b=t[1],y=t[2],E=t[3],A=0,S=0,T=-(b-E),C=M-y,O=0,I=0,k=Math.sqrt(T*T+C*C); - T/=k,C/=k,T*=m,C*=m; - const x=2*(1-a),R=2*a; - u||("round"===o.cap?w+=ol(M-T*(x-R)*.5,b-C*(x-R)*.5,M-T*x,b-C*x,M+T*R,b+C*R,f,!0)+2:"square"===o.cap&&(w+=rl(M,b,T,C,x,R,!0,f))),f.push(M-T*x,b-C*x),f.push(M+T*R,b+C*R); - for(let P=1; - P<p-1; - ++P){ - M=t[2*(P-1)],b=t[2*(P-1)+1],y=t[2*P],E=t[2*P+1],A=t[2*(P+1)],S=t[2*(P+1)+1],T=-(b-E),C=M-y,k=Math.sqrt(T*T+C*C),T/=k,C/=k,T*=m,C*=m,O=-(E-S),I=y-A,k=Math.sqrt(O*O+I*I),O/=k,I/=k,O*=m,I*=m; - const i=y-M,s=b-E,e=y-A,n=S-E,h=i*e+s*n,r=s*e-n*i,a=r<0; - if(Math.abs(r)<.001*Math.abs(h)){ - f.push(y-T*x,E-C*x),f.push(y+T*R,E+C*R),h>=0&&("round"===o.join?w+=ol(y,E,y-T*x,E-C*x,y-O*x,E-I*x,f,!1)+4:w+=2,f.push(y-O*R,E-I*R),f.push(y+O*x,E+I*x)); - continue} - const c=(-T+M)*(-C+E)-(-T+y)*(-C+b),l=(-O+A)*(-I+E)-(-O+y)*(-I+S),u=(i*l-e*c)/r,d=(n*c-s*l)/r,p=(u-y)*(u-y)+(d-E)*(d-E),g=y+(u-y)*x,N=E+(d-E)*x,L=y-(u-y)*R,D=E-(d-E)*R,G=a?x:R; - p<=Math.min(i*i+s*s,e*e+n*n)+G*G*v?"bevel"===o.join||p/v>_?(a?(f.push(g,N),f.push(y+T*R,E+C*R),f.push(g,N),f.push(y+O*R,E+I*R)):(f.push(y-T*x,E-C*x),f.push(L,D),f.push(y-O*x,E-I*x),f.push(L,D)),w+=2):"round"===o.join?a?(f.push(g,N),f.push(y+T*R,E+C*R),w+=ol(y,E,y+T*R,E+C*R,y+O*R,E+I*R,f,!0)+4,f.push(g,N),f.push(y+O*R,E+I*R)):(f.push(y-T*x,E-C*x),f.push(L,D),w+=ol(y,E,y-T*x,E-C*x,y-O*x,E-I*x,f,!1)+4,f.push(y-O*x,E-I*x),f.push(L,D)):(f.push(g,N),f.push(L,D)):(f.push(y-T*x,E-C*x),f.push(y+T*R,E+C*R),"round"===o.join?w+=a?ol(y,E,y+T*R,E+C*R,y+O*R,E+I*R,f,!0)+2:ol(y,E,y-T*x,E-C*x,y-O*x,E-I*x,f,!1)+2:"miter"===o.join&&p/v<=_&&(a?(f.push(L,D),f.push(L,D)):(f.push(g,N),f.push(g,N)),w+=2),f.push(y-O*x,E-I*x),f.push(y+O*R,E+I*R),w+=2)} - M=t[2*(p-2)],b=t[2*(p-2)+1],y=t[2*(p-1)],E=t[2*(p-1)+1],T=-(b-E),C=M-y,k=Math.sqrt(T*T+C*C),T/=k,C/=k,T*=m,C*=m,f.push(y-T*x,E-C*x),f.push(y+T*R,E+C*R),u||("round"===o.cap?w+=ol(y-T*(x-R)*.5,E-C*(x-R)*.5,y-T*x,E-C*x,y+T*R,E+C*R,f,!1)+2:"square"===o.cap&&(w+=rl(y,E,T,C,x,R,!1,f))); - for(let P=g; - P<w+g-2; - ++P)M=f[2*P],b=f[2*P+1],y=f[2*(P+1)],E=f[2*(P+1)+1],A=f[2*(P+2)],S=f[2*(P+2)+1],Math.abs(M*(E-S)+y*(S-b)+A*(b-E))<1e-8||h.push(P,P+1,P+2)} - function cl(t,i,s,e){ - const n=nl; - if(0===t.length)return; - const h=t[0],r=t[1],o=t[t.length-2],a=t[t.length-1],c=i||Math.abs(h-o)<n&&Math.abs(r-a)<n,l=s,u=t.length/2,d=l.length/2; - for(let f=0; - f<u; - f++)l.push(t[2*f]),l.push(t[2*f+1]); - for(let f=0; - f<u-1; - f++)e.push(d+f,d+f+1); - c&&e.push(d+u-1,d)} - function ll(t,i,s,e,n,h,r){ - const o=Zr(t,i,2); - if(!o)return; - for(let c=0; - c<o.length; - c+=3)h[r++]=o[c]+n,h[r++]=o[c+1]+n,h[r++]=o[c+2]+n; - let a=n*e; - for(let c=0; - c<t.length; - c+=2)s[a]=t[c],s[a+1]=t[c+1],a+=e} - Qt(hl,"getOrientationOfPoints"),Qt(rl,"square"),Qt(ol,"round"),Qt(al,"buildLine"),Qt(cl,"buildPixelLine"),Qt(ll,"triangulateWithHoles"); - const ul=[],dl={ - extension:{ - type:ri.ShapeBuilder,name:"polygon"} - ,build(t,i){ - for(let s=0; - s<t.points.length; - s++)i[s]=t.points[s]; - return!0} - ,triangulate(t,i,s,e,n,h){ - ll(t,ul,i,s,e,n,h)} - } - ,fl={ - extension:{ - type:ri.ShapeBuilder,name:"rectangle"} - ,build(t,i){ - const s=t,e=s.x,n=s.y,h=s.width,r=s.height; - return h>0&&r>0&&(i[0]=e,i[1]=n,i[2]=e+h,i[3]=n,i[4]=e+h,i[5]=n+r,i[6]=e,i[7]=n+r,!0)} - ,triangulate(t,i,s,e,n,h){ - let r=0; - i[(e*=s)+r]=t[0],i[e+r+1]=t[1],r+=s,i[e+r]=t[2],i[e+r+1]=t[3],r+=s,i[e+r]=t[6],i[e+r+1]=t[7],r+=s,i[e+r]=t[4],i[e+r+1]=t[5],r+=s; - const o=e/s; - n[h++]=o,n[h++]=o+1,n[h++]=o+2,n[h++]=o+1,n[h++]=o+3,n[h++]=o+2} - } - ,pl={ - extension:{ - type:ri.ShapeBuilder,name:"triangle"} - ,build:(t,i)=>(i[0]=t.x,i[1]=t.y,i[2]=t.x2,i[3]=t.y2,i[4]=t.x3,i[5]=t.y3,!0),triangulate(t,i,s,e,n,h){ - let r=0; - i[(e*=s)+r]=t[0],i[e+r+1]=t[1],r+=s,i[e+r]=t[2],i[e+r+1]=t[3],r+=s,i[e+r]=t[4],i[e+r+1]=t[5]; - const o=e/s; - n[h++]=o,n[h++]=o+1,n[h++]=o+2} - } - ,wl=[{ - offset:0,color:"white"} - ,{ - offset:1,color:"black"} - ],gl=(Qt(M=class{ - constructor(...t){ - this.uid=Wi("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[]; - let i=Ml(t); - i={ - ..."radial"===i.type?M.defaultRadialOptions:M.defaultLinearOptions,...Qi(i)} - ,this._textureSize=i.textureSize,this._wrapMode=i.wrapMode,"radial"===i.type?(this.center=i.center,this.outerCenter=i.outerCenter??this.center,this.innerRadius=i.innerRadius,this.outerRadius=i.outerRadius,this.scale=i.scale,this.rotation=i.rotation):(this.start=i.start,this.end=i.end),this.textureSpace=i.textureSpace,this.type=i.type,i.colorStops.forEach(t=>{ - this.addColorStop(t.offset,t.color)} - )} - addColorStop(t,i){ - return this.colorStops.push({ - offset:t,color:Ks.shared.setValue(i).toHexa()} - ),this} - buildLinearGradient(){ - if(this.texture)return; - let{ - x:t,y:i} - =this.start,{ - x:s,y:e} - =this.end,n=s-t,h=e-i; - const r=n<0||h<0; - if("clamp-to-edge"===this._wrapMode){ - if(n<0){ - const i=t; - t=s,s=i,n*=-1} - if(h<0){ - const t=i; - i=e,e=t,h*=-1} - } - const o=this.colorStops.length?this.colorStops:wl,a=this._textureSize,{ - canvas:c,context:l} - =_l(a,1),u=r?l.createLinearGradient(this._textureSize,0,0,0):l.createLinearGradient(0,0,this._textureSize,0); - vl(u,o),l.fillStyle=u,l.fillRect(0,0,a,1),this.texture=new ls({ - source:new pn({ - resource:c,addressMode:this._wrapMode} - )} - ); - const d=Math.sqrt(n*n+h*h),f=Math.atan2(h,n),p=new Ci; - p.scale(d/a,1),p.rotate(f),p.translate(t,i),"local"===this.textureSpace&&p.scale(a,a),this.transform=p} - buildGradient(){ - this.texture||this._tick++,"linear"===this.type?this.buildLinearGradient():this.buildRadialGradient()} - buildRadialGradient(){ - if(this.texture)return; - const t=this.colorStops.length?this.colorStops:wl,i=this._textureSize,{ - canvas:s,context:e} - =_l(i,i),{ - x:n,y:h} - =this.center,{ - x:r,y:o} - =this.outerCenter,a=this.innerRadius,c=this.outerRadius,l=r-c,u=o-c,d=i/(2*c),f=(n-l)*d,p=(h-u)*d,w=e.createRadialGradient(f,p,a*d,(r-l)*d,(o-u)*d,c*d); - vl(w,t),e.fillStyle=t[t.length-1].color,e.fillRect(0,0,i,i),e.fillStyle=w,e.translate(f,p),e.rotate(this.rotation),e.scale(1,this.scale),e.translate(-f,-p),e.fillRect(0,0,i,i),this.texture=new ls({ - source:new pn({ - resource:s,addressMode:this._wrapMode} - )} - ); - const g=new Ci; - g.scale(1/d,1/d),g.translate(l,u),"local"===this.textureSpace&&g.scale(i,i),this.transform=g} - destroy(){ - var t; - null==(t=this.texture)||t.destroy(!0),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null} - get styleKey(){ - return`fill-gradient-${ - this.uid} - -${ - this._tick} - `} - } - ,"_FillGradient"),M); - gl.defaultLinearOptions={ - start:{ - x:0,y:0} - ,end:{ - x:0,y:1} - ,colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"} - ,gl.defaultRadialOptions={ - center:{ - x:.5,y:.5} - ,innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"} - ; - let ml=gl; - function vl(t,i){ - for(let s=0; - s<i.length; - s++){ - const e=i[s]; - t.addColorStop(e.offset,e.color)} - } - function _l(t,i){ - const s=ln.get().createCanvas(t,i),e=s.getContext("2d"); - return{ - canvas:s,context:e} - } - function Ml(t){ - let i=t[0]??{ - } - ; - return("number"==typeof i||t[1])&&(Yi("8.5.2","use options object instead"),i={ - type:"linear",start:{ - x:t[0],y:t[1]} - ,end:{ - x:t[2],y:t[3]} - ,textureSpace:t[4],textureSize:t[5]??ml.defaultLinearOptions.textureSize} - ),i} - Qt(vl,"addColorStops"),Qt(_l,"getCanvas"),Qt(Ml,"ensureGradientOptions"); - const bl=new Ci,yl=new $i; - function El(t,i,s,e){ - const n=i.matrix?t.copyFrom(i.matrix).invert():t.identity(); - if("local"===i.textureSpace){ - const t=s.getBounds(yl); - i.width&&t.pad(i.width); - const{ - x:e,y:h} - =t,r=1/t.width,o=1/t.height,a=-e*r,c=-h*o,l=n.a,u=n.b,d=n.c,f=n.d; - n.a*=r,n.b*=r,n.c*=o,n.d*=o,n.tx=a*l+c*d+n.tx,n.ty=a*u+c*f+n.ty} - else n.translate(i.texture.frame.x,i.texture.frame.y),n.scale(1/i.texture.source.width,1/i.texture.source.height); - const h=i.texture.source.style; - return i.fill instanceof ml||"clamp-to-edge"!==h.addressMode||(h.addressMode="repeat",h.update()),e&&n.append(bl.copyFrom(e).invert()),n} - Qt(El,"generateTextureMatrix"); - const Al={ - } - ; - ci.handleByMap(ri.ShapeBuilder,Al),ci.add(fl,dl,pl,il,sl,el); - const Sl=new $i,Tl=new Ci; - function Cl(t,i){ - const{ - geometryData:s,batches:e} - =i; - e.length=0,s.indices.length=0,s.vertices.length=0,s.uvs.length=0; - for(let n=0; - n<t.instructions.length; - n++){ - const i=t.instructions[n]; - if("texture"===i.action)Ol(i.data,e,s); - else if("fill"===i.action||"stroke"===i.action){ - const t="stroke"===i.action,n=i.data.path.shapePath,h=i.data.style,r=i.data.hole; - t&&r&&Il(r.shapePath,h,!0,e,s),r&&(n.shapePrimitives[n.shapePrimitives.length-1].holes=r.shapePath.shapePrimitives),Il(n,h,t,e,s)} - } - } - function Ol(t,i,s){ - const e=[],n=Al.rectangle,h=Sl; - h.x=t.dx,h.y=t.dy,h.width=t.dw,h.height=t.dh; - const r=t.transform; - if(!n.build(h,e))return; - const{ - vertices:o,uvs:a,indices:c} - =s,l=c.length,u=o.length/2; - r&&Jc(e,r),n.triangulate(e,o,2,u,c,l); - const d=t.image,f=d.uvs; - a.push(f.x0,f.y0,f.x1,f.y1,f.x3,f.y3,f.x2,f.y2); - const p=te.get(tl); - p.indexOffset=l,p.indexSize=c.length-l,p.attributeOffset=u,p.attributeSize=o.length/2-u,p.baseColor=t.style,p.alpha=t.alpha,p.texture=d,p.geometryData=s,i.push(p)} - function Il(t,i,s,e,n){ - const{ - vertices:h,uvs:r,indices:o} - =n; - t.shapePrimitives.forEach(({ - shape:t,transform:a,holes:c} - )=>{ - const l=[],u=Al[t.type]; - if(!u.build(t,l))return; - const d=o.length,f=h.length/2; - let p="triangle-list"; - if(a&&Jc(l,a),s){ - const s=t.closePath??!0,e=i; - e.pixelLine?(cl(l,s,h,o),p="line-list"):al(l,e,0,s,h,o)} - else if(c){ - const t=[],i=l.slice(); - kl(c).forEach(s=>{ - t.push(i.length/2),i.push(...s)} - ),ll(i,t,h,2,f,o,d)} - else u.triangulate(l,h,2,f,o,d); - const w=r.length/2,g=i.texture; - if(g!==ls.WHITE){ - const s=El(Tl,i,t,a); - qc(h,2,f,r,w,2,h.length/2-f,s)} - else Xc(r,w,2,h.length/2-f); - const m=te.get(tl); - m.indexOffset=d,m.indexSize=o.length-d,m.attributeOffset=f,m.attributeSize=h.length/2-f,m.baseColor=i.color,m.alpha=i.alpha,m.texture=g,m.geometryData=n,m.topology=p,e.push(m)} - )} - function kl(t){ - const i=[]; - for(let s=0; - s<t.length; - s++){ - const e=t[s].shape,n=[]; - Al[e.type].build(e,n)&&i.push(n)} - return i} - Qt(Cl,"buildContextBatches"),Qt(Ol,"addTextureToGeometryData"),Qt(Il,"addShapePathToGeometryData"),Qt(kl,"getHoleArrays"); - const xl=class{ - constructor(){ - this.batches=[],this.geometryData={ - vertices:[],uvs:[],indices:[]} - } - reset(){ - this.batches&&this.batches.forEach(t=>{ - te.return(t)} - ),this.graphicsData&&te.return(this.graphicsData),this.isBatchable=!1,this.context=null,this.batches.length=0,this.geometryData.indices.length=0,this.geometryData.vertices.length=0,this.geometryData.uvs.length=0,this.graphicsData=null} - destroy(){ - this.reset(),this.batches=null,this.geometryData=null} - } - ; - Qt(xl,"GpuGraphicsContext"); - let Rl=xl; - const Pl=class{ - constructor(){ - this.instructions=new Ne} - init(t){ - const i=t.maxTextures; - this.batcher?this.batcher._updateMaxTextures(i):this.batcher=new Kc({ - maxTextures:i} - ),this.instructions.reset()} - get geometry(){ - return Yi(Ki,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry} - destroy(){ - this.batcher.destroy(),this.instructions.destroy(),this.batcher=null,this.instructions=null} - } - ; - Qt(Pl,"GraphicsContextRenderData"); - let Nl=Pl; - const Ll=(Qt(b=class{ - constructor(t){ - this._renderer=t,this._managedContexts=new Yc({ - renderer:t,type:"resource",name:"graphicsContext"} - )} - init(t){ - b.defaultOptions.bezierSmoothness=(null==t?void 0:t.bezierSmoothness)??b.defaultOptions.bezierSmoothness} - getContextRenderData(t){ - return t._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(t)} - updateGpuContext(t){ - const i=!!t._gpuData[this._renderer.uid],s=t._gpuData[this._renderer.uid]||this._initContext(t); - if(t.dirty||!i){ - i&&s.reset(),Cl(t,s); - const e=t.batchMode; - t.customShader||"no-batch"===e?s.isBatchable=!1:s.isBatchable="auto"!==e||s.geometryData.vertices.length<400,t.dirty=!1} - return s} - getGpuContext(t){ - return t._gpuData[this._renderer.uid]||this._initContext(t)} - _initContextRenderData(t){ - const i=te.get(Nl,{ - maxTextures:this._renderer.limits.maxBatchableTextures} - ),s=t._gpuData[this._renderer.uid],{ - batches:e,geometryData:n} - =s; - s.graphicsData=i; - const h=n.vertices.length,r=n.indices.length; - for(let l=0; - l<e.length; - l++)e[l].applyTransform=!1; - const o=i.batcher; - o.ensureAttributeBuffer(h),o.ensureIndexBuffer(r),o.begin(); - for(let l=0; - l<e.length; - l++){ - const t=e[l]; - o.add(t)} - o.finish(i.instructions); - const a=o.geometry; - a.indexBuffer.setDataWithSize(o.indexBuffer,o.indexSize,!0),a.buffers[0].setDataWithSize(o.attributeBuffer.float32View,o.attributeSize,!0); - const c=o.batches; - for(let l=0; - l<c.length; - l++){ - const t=c[l]; - t.bindGroup=ya(t.textures.textures,t.textures.count,this._renderer.limits.maxBatchableTextures)} - return i} - _initContext(t){ - const i=new Rl; - return i.context=t,t._gpuData[this._renderer.uid]=i,this._managedContexts.add(t),i} - destroy(){ - this._managedContexts.destroy(),this._renderer=null} - } - ,"_GraphicsContextSystem"),b); - Ll.extension={ - type:[ri.WebGLSystem,ri.WebGPUSystem],name:"graphicsContext"} - ,Ll.defaultOptions={ - bezierSmoothness:.5} - ; - let Dl=Ll; - const Gl=1.1920929e-7; - function Bl(t,i,s,e,n,h,r,o,a,c){ - let l=(1-Math.min(.99,Math.max(0,c??Dl.defaultOptions.bezierSmoothness)))/1; - return l*=l,Ul(i,s,e,n,h,r,o,a,t,l),t} - function Ul(t,i,s,e,n,h,r,o,a,c){ - Fl(t,i,s,e,n,h,r,o,a,c,0),a.push(r,o)} - function Fl(t,i,s,e,n,h,r,o,a,c,l){ - if(l>8)return; - const u=(t+s)/2,d=(i+e)/2,f=(s+n)/2,p=(e+h)/2,w=(n+r)/2,g=(h+o)/2,m=(u+f)/2,v=(d+p)/2,_=(f+w)/2,M=(p+g)/2,b=(m+_)/2,y=(v+M)/2; - if(l>0){ - let l=r-t,u=o-i; - const d=Math.abs((s-r)*u-(e-o)*l),f=Math.abs((n-r)*u-(h-o)*l); - if(d>Gl&&f>Gl){ - if((d+f)*(d+f)<=c*(l*l+u*u))return void a.push(b,y)} - else if(d>Gl){ - if(d*d<=c*(l*l+u*u))return void a.push(b,y)} - else if(f>Gl){ - if(f*f<=c*(l*l+u*u))return void a.push(b,y)} - else if(l=b-(t+r)/2,u=y-(i+o)/2,l*l+u*u<=c)return void a.push(b,y)} - Fl(t,i,u,d,m,v,b,y,a,c,l+1),Fl(b,y,_,M,w,g,r,o,a,c,l+1)} - function $l(t,i,s,e,n,h,r,o){ - let a=(1-Math.min(.99,Math.max(0,o??Dl.defaultOptions.bezierSmoothness)))/1; - return a*=a,Hl(i,s,e,n,h,r,t,a),t} - function Hl(t,i,s,e,n,h,r,o){ - Wl(r,t,i,s,e,n,h,o,0),r.push(n,h)} - function Wl(t,i,s,e,n,h,r,o,a){ - if(a>8)return; - const c=(i+e)/2,l=(s+n)/2,u=(e+h)/2,d=(n+r)/2,f=(c+u)/2,p=(l+d)/2; - let w=h-i,g=r-s; - const m=Math.abs((e-h)*g-(n-r)*w); - if(m>1.1920929e-7){ - if(m*m<=o*(w*w+g*g))return void t.push(f,p)} - else if(w=f-(i+h)/2,g=p-(s+r)/2,w*w+g*g<=o)return void t.push(f,p); - Wl(t,i,s,c,l,f,p,o,a+1),Wl(t,f,p,u,d,h,r,o,a+1)} - function Vl(t,i,s,e,n,h,r,o){ - let a=Math.abs(n-h); - (!r&&n>h||r&&h>n)&&(a=2*Math.PI-a),o||(o=Math.max(6,Math.floor(6*Math.pow(e,1/3)*(a/Math.PI)))); - let c=a/(o=Math.max(o,3)),l=n; - c*=r?-1:1; - for(let u=0; - u<o+1; - u++){ - const n=i+Math.cos(l)*e,h=s+Math.sin(l)*e; - t.push(n,h),l+=c} - } - function jl(t,i,s,e,n,h){ - const r=t[t.length-2],o=t[t.length-1]-s,a=r-i,c=n-s,l=e-i,u=Math.abs(o*l-a*c); - if(u<1e-8||0===h)return void(t[t.length-2]===i&&t[t.length-1]===s||t.push(i,s)); - const d=o*o+a*a,f=c*c+l*l,p=o*c+a*l,w=h*Math.sqrt(d)/u,g=h*Math.sqrt(f)/u,m=w*p/d,v=g*p/f,_=w*l+g*a,M=w*c+g*o,b=a*(g+m),y=o*(g+m),E=l*(w+v),A=c*(w+v); - Vl(t,_+i,M+s,h,Math.atan2(y-M,b-_),Math.atan2(A-M,E-_),a*c>l*o)} - Qt(Bl,"buildAdaptiveBezier"),Qt(Ul,"begin$1"),Qt(Fl,"recursive$1"),Qt($l,"buildAdaptiveQuadratic"),Qt(Hl,"begin"),Qt(Wl,"recursive"),Qt(Vl,"buildArc"),Qt(jl,"buildArcTo"); - const Kl=2*Math.PI,zl={ - centerX:0,centerY:0,ang1:0,ang2:0} - ,Yl=Qt(({ - x:t,y:i} - ,s,e,n,h,r,o,a)=>{ - const c=n*(t*=s)-h*(i*=e),l=h*t+n*i; - return a.x=c+r,a.y=l+o,a} - ,"mapToEllipse"); - function ql(t,i){ - const s=-1.5707963267948966===i?-.551915024494:4/3*Math.tan(i/4),e=1.5707963267948966===i?.551915024494:s,n=Math.cos(t),h=Math.sin(t),r=Math.cos(t+i),o=Math.sin(t+i); - return[{ - x:n-h*e,y:h+n*e} - ,{ - x:r+o*e,y:o-r*e} - ,{ - x:r,y:o} - ]} - Qt(ql,"approxUnitArc"); - const Xl=Qt((t,i,s,e)=>{ - let n=t*s+i*e; - return n>1&&(n=1),n<-1&&(n=-1),(t*e-i*s<0?-1:1)*Math.acos(n)} - ,"vectorAngle"),Jl=Qt((t,i,s,e,n,h,r,o,a,c,l,u,d)=>{ - const f=Math.pow(n,2),p=Math.pow(h,2),w=Math.pow(l,2),g=Math.pow(u,2); - let m=f*p-f*g-p*w; - m<0&&(m=0),m/=f*g+p*w,m=Math.sqrt(m)*(r===o?-1:1); - const v=m*n/h*u,_=m*-h/n*l,M=c*v-a*_+(t+s)/2,b=a*v+c*_+(i+e)/2,y=(l-v)/n,E=(u-_)/h,A=(-l-v)/n,S=(-u-_)/h,T=Xl(1,0,y,E); - let C=Xl(y,E,A,S); - 0===o&&C>0&&(C-=Kl),1===o&&C<0&&(C+=Kl),d.centerX=M,d.centerY=b,d.ang1=T,d.ang2=C} - ,"getArcCenter"); - function Ql(t,i,s,e,n,h,r,o=0,a=0,c=0){ - if(0===h||0===r)return; - const l=Math.sin(o*Kl/360),u=Math.cos(o*Kl/360),d=u*(i-e)/2+l*(s-n)/2,f=-l*(i-e)/2+u*(s-n)/2; - if(0===d&&0===f)return; - h=Math.abs(h),r=Math.abs(r); - const p=Math.pow(d,2)/Math.pow(h,2)+Math.pow(f,2)/Math.pow(r,2); - p>1&&(h*=Math.sqrt(p),r*=Math.sqrt(p)),Jl(i,s,e,n,h,r,a,c,l,u,d,f,zl); - let{ - ang1:w,ang2:g} - =zl; - const{ - centerX:m,centerY:v} - =zl; - let _=Math.abs(g)/(Kl/4); - Math.abs(1-_)<1e-7&&(_=1); - const M=Math.max(Math.ceil(_),1); - g/=M; - let b=t[t.length-2],y=t[t.length-1]; - const E={ - x:0,y:0} - ; - for(let A=0; - A<M; - A++){ - const i=ql(w,g),{ - x:s,y:e} - =Yl(i[0],h,r,u,l,m,v,E),{ - x:n,y:o} - =Yl(i[1],h,r,u,l,m,v,E),{ - x:a,y:c} - =Yl(i[2],h,r,u,l,m,v,E); - Bl(t,b,y,s,e,n,o,a,c),b=a,y=c,w+=g} - } - function Zl(t,i,s){ - const e=Qt((t,i)=>{ - const s=i.x-t.x,e=i.y-t.y,n=Math.sqrt(s*s+e*e); - return{ - len:n,nx:s/n,ny:e/n} - } - ,"vecFrom"),n=Qt((i,s)=>{ - 0===i?t.moveTo(s.x,s.y):t.lineTo(s.x,s.y)} - ,"sharpCorner"); - let h=i[i.length-1]; - for(let r=0; - r<i.length; - r++){ - const o=i[r%i.length],a=o.radius??s; - if(a<=0){ - n(r,o),h=o; - continue} - const c=i[(r+1)%i.length],l=e(o,h),u=e(o,c); - if(l.len<1e-4||u.len<1e-4){ - n(r,o),h=o; - continue} - let d=Math.asin(l.nx*u.ny-l.ny*u.nx),f=1,p=!1; - l.nx*u.nx-l.ny*-u.ny<0?d<0?d=Math.PI+d:(d=Math.PI-d,f=-1,p=!0):d>0&&(f=-1,p=!0); - const w=d/2; - let g,m=Math.abs(Math.cos(w)*a/Math.sin(w)); - m>Math.min(l.len/2,u.len/2)?(m=Math.min(l.len/2,u.len/2),g=Math.abs(m*Math.sin(w)/Math.cos(w))):g=a; - const v=o.x+u.nx*m+-u.ny*g*f,_=o.y+u.ny*m+u.nx*g*f,M=Math.atan2(l.ny,l.nx)+Math.PI/2*f,b=Math.atan2(u.ny,u.nx)-Math.PI/2*f; - 0===r&&t.moveTo(v+Math.cos(M)*g,_+Math.sin(M)*g),t.arc(v,_,g,M,b,p),h=o} - } - function tu(t,i,s,e){ - const n=Qt((t,i)=>Math.sqrt((t.x-i.x)**2+(t.y-i.y)**2),"distance"),h=Qt((t,i,s)=>({ - x:t.x+(i.x-t.x)*s,y:t.y+(i.y-t.y)*s} - ),"pointLerp"),r=i.length; - for(let o=0; - o<r; - o++){ - const a=i[(o+1)%r],c=a.radius??s; - if(c<=0){ - 0===o?t.moveTo(a.x,a.y):t.lineTo(a.x,a.y); - continue} - const l=i[o],u=i[(o+2)%r],d=n(l,a); - let f; - f=d<1e-4?a:h(a,l,Math.min(d/2,c)/d); - const p=n(u,a); - let w; - w=p<1e-4?a:h(a,u,Math.min(p/2,c)/p),0===o?t.moveTo(f.x,f.y):t.lineTo(f.x,f.y),t.quadraticCurveTo(a.x,a.y,w.x,w.y,e)} - } - Qt(Ql,"buildArcToSvg"),Qt(Zl,"roundedShapeArc"),Qt(tu,"roundedShapeQuadraticCurve"); - const iu=new $i,su=class{ - constructor(t){ - this.shapePrimitives=[],this._currentPoly=null,this._bounds=new ps,this._graphicsPath2D=t,this.signed=t.checkForHoles} - moveTo(t,i){ - return this.startPoly(t,i),this} - lineTo(t,i){ - this._ensurePoly(); - const s=this._currentPoly.points,e=s[s.length-2],n=s[s.length-1]; - return e===t&&n===i||s.push(t,i),this} - arc(t,i,s,e,n,h){ - return this._ensurePoly(!1),Vl(this._currentPoly.points,t,i,s,e,n,h),this} - arcTo(t,i,s,e,n){ - return this._ensurePoly(),jl(this._currentPoly.points,t,i,s,e,n),this} - arcToSvg(t,i,s,e,n,h,r){ - return Ql(this._currentPoly.points,this._currentPoly.lastX,this._currentPoly.lastY,h,r,t,i,s,e,n),this} - bezierCurveTo(t,i,s,e,n,h,r){ - this._ensurePoly(); - const o=this._currentPoly; - return Bl(this._currentPoly.points,o.lastX,o.lastY,t,i,s,e,n,h,r),this} - quadraticCurveTo(t,i,s,e,n){ - this._ensurePoly(); - const h=this._currentPoly; - return $l(this._currentPoly.points,h.lastX,h.lastY,t,i,s,e,n),this} - closePath(){ - return this.endPoly(!0),this} - addPath(t,i){ - this.endPoly(),i&&!i.isIdentity()&&(t=t.clone(!0)).transform(i); - const s=this.shapePrimitives,e=s.length; - for(let n=0; - n<t.instructions.length; - n++){ - const i=t.instructions[n]; - this[i.action](...i.data)} - if(t.checkForHoles&&s.length-e>1){ - let t=null; - for(let i=e; - i<s.length; - i++){ - const e=s[i]; - if("polygon"===e.shape.type){ - const n=e.shape,h=null==t?void 0:t.shape; - h&&h.containsPolygon(n)?(t.holes||(t.holes=[]),t.holes.push(e),s.copyWithin(i,i+1),s.length--,i--):t=e} - } - } - return this} - finish(t=!1){ - this.endPoly(t)} - rect(t,i,s,e,n){ - return this.drawShape(new $i(t,i,s,e),n),this} - circle(t,i,s,e){ - return this.drawShape(new da(t,i,s),e),this} - poly(t,i,s){ - const e=new ma(t); - return e.closePath=i,this.drawShape(e,s),this} - regularPoly(t,i,s,e,n=0,h){ - e=Math.max(0|e,3); - const r=-1*Math.PI/2+n,o=2*Math.PI/e,a=[]; - for(let c=0; - c<e; - c++){ - const e=r-c*o; - a.push(t+s*Math.cos(e),i+s*Math.sin(e))} - return this.poly(a,!0,h),this} - roundPoly(t,i,s,e,n,h=0,r){ - if(e=Math.max(0|e,3),n<=0)return this.regularPoly(t,i,s,e,h); - const o=s*Math.sin(Math.PI/e)-.001; - n=Math.min(n,o); - const a=-1*Math.PI/2+h,c=2*Math.PI/e,l=(e-2)*Math.PI/e/2; - for(let u=0; - u<e; - u++){ - const e=u*c+a,h=t+s*Math.cos(e),o=i+s*Math.sin(e),d=e+Math.PI+l,f=e-Math.PI-l,p=h+n*Math.cos(d),w=o+n*Math.sin(d),g=h+n*Math.cos(f),m=o+n*Math.sin(f); - 0===u?this.moveTo(p,w):this.lineTo(p,w),this.quadraticCurveTo(h,o,g,m,r)} - return this.closePath()} - roundShape(t,i,s=!1,e){ - return t.length<3?this:(s?tu(this,t,i,e):Zl(this,t,i),this.closePath())} - filletRect(t,i,s,e,n){ - if(0===n)return this.rect(t,i,s,e); - const h=Math.min(s,e)/2,r=Math.min(h,Math.max(-h,n)),o=t+s,a=i+e,c=r<0?-r:0,l=Math.abs(r); - return this.moveTo(t,i+l).arcTo(t+c,i+c,t+l,i,l).lineTo(o-l,i).arcTo(o-c,i+c,o,i+l,l).lineTo(o,a-l).arcTo(o-c,a-c,t+s-l,a,l).lineTo(t+l,a).arcTo(t+c,a-c,t,a-l,l).closePath()} - chamferRect(t,i,s,e,n,h){ - if(n<=0)return this.rect(t,i,s,e); - const r=Math.min(n,Math.min(s,e)/2),o=t+s,a=i+e,c=[t+r,i,o-r,i,o,i+r,o,a-r,o-r,a,t+r,a,t,a-r,t,i+r]; - for(let l=c.length-1; - l>=2; - l-=2)c[l]===c[l-2]&&c[l-1]===c[l-3]&&c.splice(l-1,2); - return this.poly(c,!0,h)} - ellipse(t,i,s,e,n){ - return this.drawShape(new pa(t,i,s,e),n),this} - roundRect(t,i,s,e,n,h){ - return this.drawShape(new Ma(t,i,s,e,n),h),this} - drawShape(t,i){ - return this.endPoly(),this.shapePrimitives.push({ - shape:t,transform:i} - ),this} - startPoly(t,i){ - let s=this._currentPoly; - return s&&this.endPoly(),s=new ma,s.points.push(t,i),this._currentPoly=s,this} - endPoly(t=!1){ - const i=this._currentPoly; - return i&&i.points.length>2&&(i.closePath=t,this.shapePrimitives.push({ - shape:i} - )),this._currentPoly=null,this} - _ensurePoly(t=!0){ - if(!this._currentPoly&&(this._currentPoly=new ma,t)){ - const t=this.shapePrimitives[this.shapePrimitives.length-1]; - if(t){ - let i=t.shape.x,s=t.shape.y; - if(t.transform&&!t.transform.isIdentity()){ - const e=t.transform,n=i; - i=e.a*i+e.c*s+e.tx,s=e.b*n+e.d*s+e.ty} - this._currentPoly.points.push(i,s)} - else this._currentPoly.points.push(0,0)} - } - buildPath(){ - const t=this._graphicsPath2D; - this.shapePrimitives.length=0,this._currentPoly=null; - for(let i=0; - i<t.instructions.length; - i++){ - const s=t.instructions[i]; - this[s.action](...s.data)} - this.finish()} - get bounds(){ - const t=this._bounds; - t.clear(); - const i=this.shapePrimitives; - for(let s=0; - s<i.length; - s++){ - const e=i[s],n=e.shape.getBounds(iu); - e.transform?t.addRect(n,e.transform):t.addRect(n)} - return t} - } - ; - Qt(su,"ShapePath"); - let eu=su; - const nu=class t{ - constructor(t,i=!1){ - this.instructions=[],this.uid=Wi("graphicsPath"),this._dirty=!0,this.checkForHoles=i,"string"==typeof t?la(t,this):this.instructions=(null==t?void 0:t.slice())??[]} - get shapePath(){ - return this._shapePath||(this._shapePath=new eu(this)),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath} - addPath(t,i){ - return t=t.clone(),this.instructions.push({ - action:"addPath",data:[t,i]} - ),this._dirty=!0,this} - arc(...t){ - return this.instructions.push({ - action:"arc",data:t} - ),this._dirty=!0,this} - arcTo(...t){ - return this.instructions.push({ - action:"arcTo",data:t} - ),this._dirty=!0,this} - arcToSvg(...t){ - return this.instructions.push({ - action:"arcToSvg",data:t} - ),this._dirty=!0,this} - bezierCurveTo(...t){ - return this.instructions.push({ - action:"bezierCurveTo",data:t} - ),this._dirty=!0,this} - bezierCurveToShort(t,i,s,e,n){ - const h=this.instructions[this.instructions.length-1],r=this.getLastPoint(Ai.shared); - let o=0,a=0; - if(h&&"bezierCurveTo"===h.action){ - o=h.data[2],a=h.data[3]; - const t=r.x,i=r.y; - o=t+(t-o),a=i+(i-a)} - else o=r.x,a=r.y; - return this.instructions.push({ - action:"bezierCurveTo",data:[o,a,t,i,s,e,n]} - ),this._dirty=!0,this} - closePath(){ - return this.instructions.push({ - action:"closePath",data:[]} - ),this._dirty=!0,this} - ellipse(...t){ - return this.instructions.push({ - action:"ellipse",data:t} - ),this._dirty=!0,this} - lineTo(...t){ - return this.instructions.push({ - action:"lineTo",data:t} - ),this._dirty=!0,this} - moveTo(...t){ - return this.instructions.push({ - action:"moveTo",data:t} - ),this} - quadraticCurveTo(...t){ - return this.instructions.push({ - action:"quadraticCurveTo",data:t} - ),this._dirty=!0,this} - quadraticCurveToShort(t,i,s){ - const e=this.instructions[this.instructions.length-1],n=this.getLastPoint(Ai.shared); - let h=0,r=0; - if(e&&"quadraticCurveTo"===e.action){ - h=e.data[0],r=e.data[1]; - const t=n.x,i=n.y; - h=t+(t-h),r=i+(i-r)} - else h=n.x,r=n.y; - return this.instructions.push({ - action:"quadraticCurveTo",data:[h,r,t,i,s]} - ),this._dirty=!0,this} - rect(t,i,s,e,n){ - return this.instructions.push({ - action:"rect",data:[t,i,s,e,n]} - ),this._dirty=!0,this} - circle(t,i,s,e){ - return this.instructions.push({ - action:"circle",data:[t,i,s,e]} - ),this._dirty=!0,this} - roundRect(...t){ - return this.instructions.push({ - action:"roundRect",data:t} - ),this._dirty=!0,this} - poly(...t){ - return this.instructions.push({ - action:"poly",data:t} - ),this._dirty=!0,this} - regularPoly(...t){ - return this.instructions.push({ - action:"regularPoly",data:t} - ),this._dirty=!0,this} - roundPoly(...t){ - return this.instructions.push({ - action:"roundPoly",data:t} - ),this._dirty=!0,this} - roundShape(...t){ - return this.instructions.push({ - action:"roundShape",data:t} - ),this._dirty=!0,this} - filletRect(...t){ - return this.instructions.push({ - action:"filletRect",data:t} - ),this._dirty=!0,this} - chamferRect(...t){ - return this.instructions.push({ - action:"chamferRect",data:t} - ),this._dirty=!0,this} - star(t,i,s,e,n,h,r){ - n||(n=e/2); - const o=-1*Math.PI/2+h,a=2*s,c=2*Math.PI/a,l=[]; - for(let u=0; - u<a; - u++){ - const s=u%2?n:e,h=u*c+o; - l.push(t+s*Math.cos(h),i+s*Math.sin(h))} - return this.poly(l,!0,r),this} - clone(i=!1){ - const s=new t; - if(s.checkForHoles=this.checkForHoles,i)for(let t=0; - t<this.instructions.length; - t++){ - const i=this.instructions[t]; - s.instructions.push({ - action:i.action,data:i.data.slice()} - )} - else s.instructions=this.instructions.slice(); - return s} - clear(){ - return this.instructions.length=0,this._dirty=!0,this} - transform(t){ - if(t.isIdentity())return this; - const i=t.a,s=t.b,e=t.c,n=t.d,h=t.tx,r=t.ty; - let o=0,a=0,c=0,l=0,u=0,d=0,f=0,p=0; - for(let w=0; - w<this.instructions.length; - w++){ - const g=this.instructions[w],m=g.data; - switch(g.action){ - case"moveTo":case"lineTo":o=m[0],a=m[1],m[0]=i*o+e*a+h,m[1]=s*o+n*a+r; - break; - case"bezierCurveTo":c=m[0],l=m[1],u=m[2],d=m[3],o=m[4],a=m[5],m[0]=i*c+e*l+h,m[1]=s*c+n*l+r,m[2]=i*u+e*d+h,m[3]=s*u+n*d+r,m[4]=i*o+e*a+h,m[5]=s*o+n*a+r; - break; - case"quadraticCurveTo":c=m[0],l=m[1],o=m[2],a=m[3],m[0]=i*c+e*l+h,m[1]=s*c+n*l+r,m[2]=i*o+e*a+h,m[3]=s*o+n*a+r; - break; - case"arcToSvg":o=m[5],a=m[6],f=m[0],p=m[1],m[0]=i*f+e*p,m[1]=s*f+n*p,m[5]=i*o+e*a+h,m[6]=s*o+n*a+r; - break; - case"circle":m[4]=ru(m[3],t); - break; - case"rect":m[4]=ru(m[4],t); - break; - case"ellipse":m[8]=ru(m[8],t); - break; - case"roundRect":m[5]=ru(m[5],t); - break; - case"addPath":m[0].transform(t); - break; - case"poly":m[2]=ru(m[2],t); - break; - default:qs(g.action)} - } - return this._dirty=!0,this} - get bounds(){ - return this.shapePath.bounds} - getLastPoint(t){ - let i=this.instructions.length-1,s=this.instructions[i]; - if(!s)return t.x=0,t.y=0,t; - for(; - "closePath"===s.action; - ){ - if(i--,i<0)return t.x=0,t.y=0,t; - s=this.instructions[i]} - switch(s.action){ - case"moveTo":case"lineTo":t.x=s.data[0],t.y=s.data[1]; - break; - case"quadraticCurveTo":t.x=s.data[2],t.y=s.data[3]; - break; - case"bezierCurveTo":t.x=s.data[4],t.y=s.data[5]; - break; - case"arc":case"arcToSvg":t.x=s.data[5],t.y=s.data[6]; - break; - case"addPath":s.data[0].getLastPoint(t)} - return t} - } - ; - Qt(nu,"GraphicsPath"); - let hu=nu; - function ru(t,i){ - return t?t.prepend(i):i.clone()} - function ou(t,i,s){ - const e=t.getAttribute(i); - return e?Number(e):s} - function au(t,i){ - const s=t.querySelectorAll("defs"); - for(let e=0; - e<s.length; - e++){ - const t=s[e]; - for(let s=0; - s<t.children.length; - s++){ - const e=t.children[s]; - switch(e.nodeName.toLowerCase()){ - case"lineargradient":i.defs[e.id]=cu(e); - break; - case"radialgradient":i.defs[e.id]=lu()} - } - } - } - function cu(t){ - const i=ou(t,"x1",0),s=ou(t,"y1",0),e=ou(t,"x2",1),n=ou(t,"y2",0),h=t.getAttribute("gradientUnits")||"objectBoundingBox",r=new ml(i,s,e,n,"objectBoundingBox"===h?"local":"global"); - for(let o=0; - o<t.children.length; - o++){ - const i=t.children[o],s=ou(i,"offset",0),e=Ks.shared.setValue(i.getAttribute("stop-color")).toNumber(); - r.addColorStop(s,e)} - return r} - function lu(t){ - return qs(),new ml(0,0,1,0)} - function uu(t){ - const i=t.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i); - return i?i[1]:""} - Qt(ru,"adjustTransform"),Qt(ou,"parseSVGFloatAttribute"),Qt(au,"parseSVGDefinitions"),Qt(cu,"parseLinearGradient"),Qt(lu,"parseRadialGradient"),Qt(uu,"extractSvgUrlId"); - const du={ - fill:{ - type:"paint",default:0} - ,"fill-opacity":{ - type:"number",default:1} - ,stroke:{ - type:"paint",default:0} - ,"stroke-width":{ - type:"number",default:1} - ,"stroke-opacity":{ - type:"number",default:1} - ,"stroke-linecap":{ - type:"string",default:"butt"} - ,"stroke-linejoin":{ - type:"string",default:"miter"} - ,"stroke-miterlimit":{ - type:"number",default:10} - ,"stroke-dasharray":{ - type:"string",default:"none"} - ,"stroke-dashoffset":{ - type:"number",default:0} - ,opacity:{ - type:"number",default:1} - } - ; - function fu(t,i){ - const s=t.getAttribute("style"),e={ - } - ,n={ - } - ,h={ - strokeStyle:e,fillStyle:n,useFill:!1,useStroke:!1} - ; - for(const r in du){ - const s=t.getAttribute(r); - s&&pu(i,h,r,s.trim())} - if(s){ - const t=s.split("; - "); - for(let s=0; - s<t.length; - s++){ - const e=t[s].trim(),[n,r]=e.split(":"); - du[n]&&pu(i,h,n,r.trim())} - } - return{ - strokeStyle:h.useStroke?e:null,fillStyle:h.useFill?n:null,useFill:h.useFill,useStroke:h.useStroke} - } - function pu(t,i,s,e){ - switch(s){ - case"stroke":if("none"!==e){ - if(e.startsWith("url(")){ - const s=uu(e); - i.strokeStyle.fill=t.defs[s]} - else i.strokeStyle.color=Ks.shared.setValue(e).toNumber(); - i.useStroke=!0} - break; - case"stroke-width":i.strokeStyle.width=Number(e); - break; - case"fill":if("none"!==e){ - if(e.startsWith("url(")){ - const s=uu(e); - i.fillStyle.fill=t.defs[s]} - else i.fillStyle.color=Ks.shared.setValue(e).toNumber(); - i.useFill=!0} - break; - case"fill-opacity":i.fillStyle.alpha=Number(e); - break; - case"stroke-opacity":i.strokeStyle.alpha=Number(e); - break; - case"opacity":i.fillStyle.alpha=Number(e),i.strokeStyle.alpha=Number(e)} - } - function wu(t){ - if(t.length<=2)return!0; - const i=t.map(t=>t.area).sort((t,i)=>i-t),[s,e]=i,n=i[i.length-1]; - return!(s/e>3&&e/n<2)} - function gu(t){ - return t.split(/(?=[Mm])/).filter(t=>t.trim().length>0)} - function mu(t){ - const i=t.match(/[-+]?[0-9]*\.?[0-9]+/g); - if(!i||i.length<4)return 0; - const s=i.map(Number),e=[],n=[]; - for(let a=0; - a<s.length; - a+=2)a+1<s.length&&(e.push(s[a]),n.push(s[a+1])); - if(0===e.length||0===n.length)return 0; - const h=Math.min(...e),r=Math.max(...e),o=Math.min(...n); - return(r-h)*(Math.max(...n)-o)} - function vu(t,i){ - const s=new hu(t,!1); - for(const e of s.instructions)i.instructions.push(e)} - function _u(t,i){ - if("string"==typeof t){ - const i=document.createElement("div"); - i.innerHTML=t.trim(),t=i.querySelector("svg")} - const s={ - context:i,defs:{ - } - ,path:new hu} - ; - au(t,s); - const e=t.children,{ - fillStyle:n,strokeStyle:h} - =fu(t,s); - for(let r=0; - r<e.length; - r++){ - const t=e[r]; - "defs"!==t.nodeName.toLowerCase()&&Mu(t,s,n,h)} - return i} - function Mu(t,i,s,e){ - const n=t.children,{ - fillStyle:h,strokeStyle:r} - =fu(t,i); - h&&s?s={ - ...s,...h} - :h&&(s=h),r&&e?e={ - ...e,...r} - :r&&(e=r); - const o=!s&&!e; - let a,c,l,u,d,f,p,w,g,m,v,_,M,b,y,E,A; - switch(o&&(s={ - color:0} - ),t.nodeName.toLowerCase()){ - case"path":{ - b=t.getAttribute("d"); - const n=t.getAttribute("fill-rule"),h=gu(b),r="evenodd"===n,o=h.length>1; - if(r&&o){ - const t=h.map(t=>({ - path:t,area:mu(t)} - )); - if(t.sort((t,i)=>i.area-t.area),h.length>3||!wu(t))for(let n=0; - n<t.length; - n++){ - const h=t[n],r=0===n; - i.context.beginPath(); - const o=new hu(void 0,!0); - vu(h.path,o),i.context.path(o),r?(s&&i.context.fill(s),e&&i.context.stroke(e)):i.context.cut()} - else for(let n=0; - n<t.length; - n++){ - const h=t[n],r=n%2==1; - i.context.beginPath(); - const o=new hu(void 0,!0); - vu(h.path,o),i.context.path(o),r?i.context.cut():(s&&i.context.fill(s),e&&i.context.stroke(e))} - } - else y=new hu(b,!n||"evenodd"===n),i.context.path(y),s&&i.context.fill(s),e&&i.context.stroke(e); - break} - case"circle":p=ou(t,"cx",0),w=ou(t,"cy",0),g=ou(t,"r",0),i.context.ellipse(p,w,g,g),s&&i.context.fill(s),e&&i.context.stroke(e); - break; - case"rect":a=ou(t,"x",0),c=ou(t,"y",0),E=ou(t,"width",0),A=ou(t,"height",0),m=ou(t,"rx",0),v=ou(t,"ry",0),m||v?i.context.roundRect(a,c,E,A,m||v):i.context.rect(a,c,E,A),s&&i.context.fill(s),e&&i.context.stroke(e); - break; - case"ellipse":p=ou(t,"cx",0),w=ou(t,"cy",0),m=ou(t,"rx",0),v=ou(t,"ry",0),i.context.beginPath(),i.context.ellipse(p,w,m,v),s&&i.context.fill(s),e&&i.context.stroke(e); - break; - case"line":l=ou(t,"x1",0),u=ou(t,"y1",0),d=ou(t,"x2",0),f=ou(t,"y2",0),i.context.beginPath(),i.context.moveTo(l,u),i.context.lineTo(d,f),e&&i.context.stroke(e); - break; - case"polygon":M=t.getAttribute("points"),_=M.match(/-?\d+/g).map(t=>parseInt(t,10)),i.context.poly(_,!0),s&&i.context.fill(s),e&&i.context.stroke(e); - break; - case"polyline":M=t.getAttribute("points"),_=M.match(/-?\d+/g).map(t=>parseInt(t,10)),i.context.poly(_,!1),e&&i.context.stroke(e); - break; - case"g":case"svg":break; - default:qs(t.nodeName)} - o&&(s=null); - for(let S=0; - S<n.length; - S++)Mu(n[S],i,s,e)} - Qt(fu,"parseSVGStyle"),Qt(pu,"parseAttribute"),Qt(wu,"checkForNestedPattern"),Qt(gu,"extractSubpaths"),Qt(mu,"calculatePathArea"),Qt(vu,"appendSVGPath"),Qt(_u,"SVGParser"),Qt(Mu,"renderChildren"); - const bu={ - repeat:{ - addressModeU:"repeat",addressModeV:"repeat"} - ,"repeat-x":{ - addressModeU:"repeat",addressModeV:"clamp-to-edge"} - ,"repeat-y":{ - addressModeU:"clamp-to-edge",addressModeV:"repeat"} - ,"no-repeat":{ - addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"} - } - ,yu=class{ - constructor(t,i){ - this.uid=Wi("fillPattern"),this._tick=0,this.transform=new Ci,this.texture=t,this.transform.scale(1/t.frame.width,1/t.frame.height),i&&(t.source.style.addressModeU=bu[i].addressModeU,t.source.style.addressModeV=bu[i].addressModeV)} - setTransform(t){ - const i=this.texture; - this.transform.copyFrom(t),this.transform.invert(),this.transform.scale(1/i.frame.width,1/i.frame.height),this._tick++} - get texture(){ - return this._texture} - set texture(t){ - this._texture!==t&&(this._texture=t,this._tick++)} - get styleKey(){ - return`fill-pattern-${ - this.uid} - -${ - this._tick} - `} - destroy(){ - this.texture.destroy(!0),this.texture=null} - } - ; - Qt(yu,"FillPattern"); - let Eu=yu; - function Au(t){ - return Ks.isColorLike(t)} - function Su(t){ - return t instanceof Eu} - function Tu(t){ - return t instanceof ml} - function Cu(t){ - return t instanceof ls} - function Ou(t,i,s){ - const e=Ks.shared.setValue(i??0); - return t.color=e.toNumber(),t.alpha=1===e.alpha?s.alpha:e.alpha,t.texture=ls.WHITE,{ - ...s,...t} - } - function Iu(t,i,s){ - return t.texture=i,{ - ...s,...t} - } - function ku(t,i,s){ - return t.fill=i,t.color=16777215,t.texture=i.texture,t.matrix=i.transform,{ - ...s,...t} - } - function xu(t,i,s){ - return i.buildGradient(),t.fill=i,t.color=16777215,t.texture=i.texture,t.matrix=i.transform,t.textureSpace=i.textureSpace,{ - ...s,...t} - } - function Ru(t,i){ - const s={ - ...i,...t} - ,e=Ks.shared.setValue(s.color); - return s.alpha*=e.alpha,s.color=e.toNumber(),s} - function Pu(t,i){ - if(null==t)return null; - const s={ - } - ,e=t; - return Au(t)?Ou(s,t,i):Cu(t)?Iu(s,t,i):Su(t)?ku(s,t,i):Tu(t)?xu(s,t,i):e.fill&&Su(e.fill)?ku(e,e.fill,i):e.fill&&Tu(e.fill)?xu(e,e.fill,i):Ru(e,i)} - function Nu(t,i){ - const{ - width:s,alignment:e,miterLimit:n,cap:h,join:r,pixelLine:o,...a} - =i,c=Pu(t,a); - return c?{ - width:s,alignment:e,miterLimit:n,cap:h,join:r,pixelLine:o,...c} - :null} - function Lu(t,i){ - let s=1; - const e=t.shapePath.shapePrimitives; - for(let n=0; - n<e.length; - n++){ - const t=e[n].shape; - if("polygon"!==t.type)continue; - const h=t.points,r=h.length; - if(r<6)continue; - const o=t.closePath; - for(let e=0; - e<r; - e+=2){ - if(!o&&(0===e||e===r-2))continue; - const t=(e-2+r)%r,n=(e+2)%r,a=h[t],c=h[t+1],l=h[e],u=h[e+1],d=a-l,f=c-u,p=h[n]-l,w=h[n+1]-u,g=d*d+f*f,m=p*p+w*w; - if(g<1e-12||m<1e-12)continue; - let v=(d*p+f*w)/Math.sqrt(g*m); - v<-1?v=-1:v>1&&(v=1); - const _=Math.sqrt(.5*(1-v)); - if(_<1e-6)continue; - const M=Math.min(1/_,i); - M>s&&(s=M)} - } - return s} - Qt(Au,"isColorLike"),Qt(Su,"isFillPattern"),Qt(Tu,"isFillGradient"),Qt(Cu,"isTexture"),Qt(Ou,"handleColorLike"),Qt(Iu,"handleTexture"),Qt(ku,"handleFillPattern"),Qt(xu,"handleFillGradient"),Qt(Ru,"handleFillObject"),Qt(Pu,"toFillStyle"),Qt(Nu,"toStrokeStyle"),Qt(Lu,"getMaxMiterRatio"); - const Du=new Ai,Gu=new Ci,Bu=(y=class extends vi{ - constructor(){ - super(...arguments),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=Wi("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this.destroyed=!1,this._activePath=new hu,this._transform=new Ci,this._fillStyle={ - ...y.defaultFillStyle} - ,this._strokeStyle={ - ...y.defaultStrokeStyle} - ,this._stateStack=[],this._tick=0,this._bounds=new ps,this._boundsDirty=!0} - clone(){ - const t=new y; - return t.batchMode=this.batchMode,t.instructions=this.instructions.slice(),t._activePath=this._activePath.clone(),t._transform=this._transform.clone(),t._fillStyle={ - ...this._fillStyle} - ,t._strokeStyle={ - ...this._strokeStyle} - ,t._stateStack=this._stateStack.slice(),t._bounds=this._bounds.clone(),t._boundsDirty=!0,t} - get fillStyle(){ - return this._fillStyle} - set fillStyle(t){ - this._fillStyle=Pu(t,y.defaultFillStyle)} - get strokeStyle(){ - return this._strokeStyle} - set strokeStyle(t){ - this._strokeStyle=Nu(t,y.defaultStrokeStyle)} - setFillStyle(t){ - return this._fillStyle=Pu(t,y.defaultFillStyle),this} - setStrokeStyle(t){ - return this._strokeStyle=Pu(t,y.defaultStrokeStyle),this} - texture(t,i,s,e,n,h){ - return this.instructions.push({ - action:"texture",data:{ - image:t,dx:s||0,dy:e||0,dw:n||t.frame.width,dh:h||t.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:i||0===i?Ks.shared.setValue(i).toNumber():16777215} - } - ),this.onUpdate(),this} - beginPath(){ - return this._activePath=new hu,this} - fill(t,i){ - let s; - const e=this.instructions[this.instructions.length-1]; - return s=0===this._tick&&"stroke"===(null==e?void 0:e.action)?e.data.path:this._activePath.clone(),s?(null!=t&&(void 0!==i&&"number"==typeof t&&(Yi(ji,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ - color, alpha } - ) instead"),t={ - color:t,alpha:i} - ),this._fillStyle=Pu(t,y.defaultFillStyle)),this.instructions.push({ - action:"fill",data:{ - style:this.fillStyle,path:s} - } - ),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this} - _initNextPathLocation(){ - const{ - x:t,y:i} - =this._activePath.getLastPoint(Ai.shared); - this._activePath.clear(),this._activePath.moveTo(t,i)} - stroke(t){ - let i; - const s=this.instructions[this.instructions.length-1]; - return i=0===this._tick&&"fill"===(null==s?void 0:s.action)?s.data.path:this._activePath.clone(),i?(null!=t&&(this._strokeStyle=Nu(t,y.defaultStrokeStyle)),this.instructions.push({ - action:"stroke",data:{ - style:this.strokeStyle,path:i} - } - ),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this} - cut(){ - for(let t=0; - t<2; - t++){ - const i=this.instructions[this.instructions.length-1-t],s=this._activePath.clone(); - if(i&&("stroke"===i.action||"fill"===i.action)){ - if(!i.data.hole){ - i.data.hole=s; - break} - i.data.hole.addPath(s)} - } - return this._initNextPathLocation(),this} - arc(t,i,s,e,n,h){ - this._tick++; - const r=this._transform; - return this._activePath.arc(r.a*t+r.c*i+r.tx,r.b*t+r.d*i+r.ty,s,e,n,h),this} - arcTo(t,i,s,e,n){ - this._tick++; - const h=this._transform; - return this._activePath.arcTo(h.a*t+h.c*i+h.tx,h.b*t+h.d*i+h.ty,h.a*s+h.c*e+h.tx,h.b*s+h.d*e+h.ty,n),this} - arcToSvg(t,i,s,e,n,h,r){ - this._tick++; - const o=this._transform; - return this._activePath.arcToSvg(t,i,s,e,n,o.a*h+o.c*r+o.tx,o.b*h+o.d*r+o.ty),this} - bezierCurveTo(t,i,s,e,n,h,r){ - this._tick++; - const o=this._transform; - return this._activePath.bezierCurveTo(o.a*t+o.c*i+o.tx,o.b*t+o.d*i+o.ty,o.a*s+o.c*e+o.tx,o.b*s+o.d*e+o.ty,o.a*n+o.c*h+o.tx,o.b*n+o.d*h+o.ty,r),this} - closePath(){ - var t; - return this._tick++,null==(t=this._activePath)||t.closePath(),this} - ellipse(t,i,s,e){ - return this._tick++,this._activePath.ellipse(t,i,s,e,this._transform.clone()),this} - circle(t,i,s){ - return this._tick++,this._activePath.circle(t,i,s,this._transform.clone()),this} - path(t){ - return this._tick++,this._activePath.addPath(t,this._transform.clone()),this} - lineTo(t,i){ - this._tick++; - const s=this._transform; - return this._activePath.lineTo(s.a*t+s.c*i+s.tx,s.b*t+s.d*i+s.ty),this} - moveTo(t,i){ - this._tick++; - const s=this._transform,e=this._activePath.instructions,n=s.a*t+s.c*i+s.tx,h=s.b*t+s.d*i+s.ty; - return 1===e.length&&"moveTo"===e[0].action?(e[0].data[0]=n,e[0].data[1]=h,this):(this._activePath.moveTo(n,h),this)} - quadraticCurveTo(t,i,s,e,n){ - this._tick++; - const h=this._transform; - return this._activePath.quadraticCurveTo(h.a*t+h.c*i+h.tx,h.b*t+h.d*i+h.ty,h.a*s+h.c*e+h.tx,h.b*s+h.d*e+h.ty,n),this} - rect(t,i,s,e){ - return this._tick++,this._activePath.rect(t,i,s,e,this._transform.clone()),this} - roundRect(t,i,s,e,n){ - return this._tick++,this._activePath.roundRect(t,i,s,e,n,this._transform.clone()),this} - poly(t,i){ - return this._tick++,this._activePath.poly(t,i,this._transform.clone()),this} - regularPoly(t,i,s,e,n=0,h){ - return this._tick++,this._activePath.regularPoly(t,i,s,e,n,h),this} - roundPoly(t,i,s,e,n,h){ - return this._tick++,this._activePath.roundPoly(t,i,s,e,n,h),this} - roundShape(t,i,s,e){ - return this._tick++,this._activePath.roundShape(t,i,s,e),this} - filletRect(t,i,s,e,n){ - return this._tick++,this._activePath.filletRect(t,i,s,e,n),this} - chamferRect(t,i,s,e,n,h){ - return this._tick++,this._activePath.chamferRect(t,i,s,e,n,h),this} - star(t,i,s,e,n=0,h=0){ - return this._tick++,this._activePath.star(t,i,s,e,n,h,this._transform.clone()),this} - svg(t){ - return this._tick++,_u(t,this),this} - restore(){ - const t=this._stateStack.pop(); - return t&&(this._transform=t.transform,this._fillStyle=t.fillStyle,this._strokeStyle=t.strokeStyle),this} - save(){ - return this._stateStack.push({ - transform:this._transform.clone(),fillStyle:{ - ...this._fillStyle} - ,strokeStyle:{ - ...this._strokeStyle} - } - ),this} - getTransform(){ - return this._transform} - resetTransform(){ - return this._transform.identity(),this} - rotate(t){ - return this._transform.rotate(t),this} - scale(t,i=t){ - return this._transform.scale(t,i),this} - setTransform(t,i,s,e,n,h){ - return t instanceof Ci?(this._transform.set(t.a,t.b,t.c,t.d,t.tx,t.ty),this):(this._transform.set(t,i,s,e,n,h),this)} - transform(t,i,s,e,n,h){ - return t instanceof Ci?(this._transform.append(t),this):(Gu.set(t,i,s,e,n,h),this._transform.append(Gu),this)} - translate(t,i=t){ - return this._transform.translate(t,i),this} - clear(){ - return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this} - onUpdate(){ - this._boundsDirty=!0,this.dirty=!0,this.emit("update",this,16)} - get bounds(){ - if(!this._boundsDirty)return this._bounds; - this._boundsDirty=!1; - const t=this._bounds; - t.clear(); - for(let i=0; - i<this.instructions.length; - i++){ - const s=this.instructions[i],e=s.action; - if("fill"===e){ - const i=s.data; - t.addBounds(i.path.bounds)} - else if("texture"===e){ - const i=s.data; - t.addFrame(i.dx,i.dy,i.dx+i.dw,i.dy+i.dh,i.transform)} - if("stroke"===e){ - const i=s.data,e=i.style.alignment; - let n=i.style.width*(1-e); - "miter"===i.style.join&&(n*=Lu(i.path,i.style.miterLimit)); - const h=i.path.bounds; - t.addFrame(h.minX-n,h.minY-n,h.maxX+n,h.maxY+n)} - } - return t.isValid||t.set(0,0,0,0),t} - containsPoint(t){ - var i; - if(!this.bounds.containsPoint(t.x,t.y))return!1; - const s=this.instructions; - let e=!1; - for(let n=0; - n<s.length; - n++){ - const h=s[n],r=h.data,o=r.path; - if(!h.action||!o)continue; - const a=r.style,c=o.shapePath.shapePrimitives; - for(let s=0; - s<c.length; - s++){ - const n=c[s].shape; - if(!a||!n)continue; - const o=c[s].transform,l=o?o.applyInverse(t,Du):t; - if("fill"===h.action)e=n.contains(l.x,l.y); - else{ - const t=a; - e=n.strokeContains(l.x,l.y,t.width,t.alignment)} - const u=r.hole; - if(u){ - const t=null==(i=u.shapePath)?void 0:i.shapePrimitives; - if(t)for(let i=0; - i<t.length; - i++)t[i].shape.contains(l.x,l.y)&&(e=!1)} - if(e)return!0} - } - return e} - unload(){ - var t; - this.emit("unload",this); - for(const i in this._gpuData)null==(t=this._gpuData[i])||t.destroy(); - this._gpuData=Object.create(null)} - destroy(t=!1){ - if(!this.destroyed){ - if(this.destroyed=!0,this._stateStack.length=0,this._transform=null,this.unload(),this.emit("destroy",this),this.removeAllListeners(),"boolean"==typeof t?t:null==t?void 0:t.texture){ - const i="boolean"==typeof t?t:null==t?void 0:t.textureSource; - this._fillStyle.texture&&(this._fillStyle.fill&&"uid"in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(i)),this._strokeStyle.texture&&(this._strokeStyle.fill&&"uid"in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(i))} - this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null} - } - } - ,Qt(y,"_GraphicsContext"),y); - Bu.defaultFillStyle={ - color:16777215,alpha:1,texture:ls.WHITE,matrix:null,fill:null,textureSpace:"local"} - ,Bu.defaultStrokeStyle={ - width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:ls.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:!1} - ; - let Uu=Bu; - function Fu(t,i=1){ - var s; - const e=null==(s=Hn.RETINA_PREFIX)?void 0:s.exec(t); - return e?parseFloat(e[1]):i} - function $u(t,i,s){ - t.label=s,t._sourceOrigin=s; - const e=new ls({ - source:t,label:s} - ),n=Qt(()=>{ - delete i.promiseCache[s],Tn.has(s)&&Tn.remove(s)} - ,"unload"); - return e.source.once("destroy",()=>{ - i.promiseCache[s]&&(qs(),n())} - ),e.once("destroy",()=>{ - t.destroyed||(qs(),n())} - ),e} - Qt(Fu,"getResolutionOfUrl"),Qt($u,"createTexture"); - const Hu={ - extension:{ - type:ri.LoadParser,priority:xn.Low,name:"loadSVG"} - ,name:"loadSVG",id:"svg",config:{ - crossOrigin:"anonymous",parseAsGraphicsContext:!1} - ,test:t=>jo(t,"image/svg+xml")||Ko(t,".svg"),async load(t,i,s){ - var e; - return(null==(e=i.data)?void 0:e.parseAsGraphicsContext)??this.config.parseAsGraphicsContext?Vu(t):Wu(t,i,s,this.config.crossOrigin)} - ,unload(t){ - t.destroy(!0)} - } - ; - async function Wu(t,i,s,e){ - var n,h,r; - const o=await ln.get().fetch(t),a=ln.get().createImage(); - a.src=`data:image/svg+xml; - charset=utf-8,${ - encodeURIComponent(await o.text())} - `,a.crossOrigin=e,await a.decode(); - const c=(null==(n=i.data)?void 0:n.width)??a.width,l=(null==(h=i.data)?void 0:h.height)??a.height,u=(null==(r=i.data)?void 0:r.resolution)||Fu(t),d=Math.ceil(c*u),f=Math.ceil(l*u),p=ln.get().createCanvas(d,f),w=p.getContext("2d"); - w.imageSmoothingEnabled=!0,w.imageSmoothingQuality="high",w.drawImage(a,0,0,c*u,l*u); - const{ - parseAsGraphicsContext:g,...m} - =i.data??{ - } - ; - return $u(new pn({ - resource:p,alphaMode:"premultiply-alpha-on-upload",resolution:u,...m} - ),s,t)} - async function Vu(t){ - const i=await ln.get().fetch(t),s=await i.text(),e=new Uu; - return e.svg(s),e} - Qt(Wu,"loadAsTexture"),Qt(Vu,"loadAsGraphics"); - let ju=null,Ku=(Qt(E=class{ - constructor(){ - ju||(ju=URL.createObjectURL(new Blob(['(function () { - \n \'use strict\'; - \n\n const WHITE_PNG = "data:image/png; - base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII="; - \n async function checkImageBitmap() { - \n try { - \n if (typeof createImageBitmap !== "function") return false; - \n const response = await fetch(WHITE_PNG); - \n const imageBlob = await response.blob(); - \n const imageBitmap = await createImageBitmap(imageBlob); - \n return imageBitmap.width === 1 && imageBitmap.height === 1; - \n } - catch (_e) { - \n return false; - \n } - \n } - \n void checkImageBitmap().then((result) => { - \n self.postMessage(result); - \n } - ); - \n\n} - )(); - \n'],{ - type:"application/javascript"} - ))),this.worker=new Worker(ju)} - } - ,"WorkerInstance"),E); - Ku.revokeObjectURL=Qt(function(){ - ju&&(URL.revokeObjectURL(ju),ju=null)} - ,"revokeObjectURL"); - let zu=null,Yu=(Qt(A=class{ - constructor(){ - zu||(zu=URL.createObjectURL(new Blob(['(function () { - \n \'use strict\'; - \n\n async function loadImageBitmap(url, alphaMode) { - \n const response = await fetch(url); - \n if (!response.ok) { - \n throw new Error(`[WorkerManager.loadImageBitmap] Failed to fetch ${ - url} - : ${ - response.status} - ${ - response.statusText} - `); - \n } - \n const imageBlob = await response.blob(); - \n return alphaMode === "premultiplied-alpha" ? createImageBitmap(imageBlob, { - premultiplyAlpha: "none" } - ) : createImageBitmap(imageBlob); - \n } - \n self.onmessage = async (event) => { - \n try { - \n const imageBitmap = await loadImageBitmap(event.data.data[0], event.data.data[1]); - \n self.postMessage({ - \n data: imageBitmap,\n uuid: event.data.uuid,\n id: event.data.id\n } - , [imageBitmap]); - \n } - catch (e) { - \n self.postMessage({ - \n error: e,\n uuid: event.data.uuid,\n id: event.data.id\n } - ); - \n } - \n } - ; - \n\n} - )(); - \n'],{ - type:"application/javascript"} - ))),this.worker=new Worker(zu)} - } - ,"WorkerInstance"),A); - Yu.revokeObjectURL=Qt(function(){ - zu&&(URL.revokeObjectURL(zu),zu=null)} - ,"revokeObjectURL"); - let qu,Xu=0; - const Ju=class{ - constructor(){ - this._initialized=!1,this._createdWorkers=0,this._workerPool=[],this._queue=[],this._resolveHash={ - } - } - isImageBitmapSupported(){ - return void 0!==this._isImageBitmapSupported||(this._isImageBitmapSupported=new Promise(t=>{ - const{ - worker:i} - =new Ku; - i.addEventListener("message",s=>{ - i.terminate(),Ku.revokeObjectURL(),t(s.data)} - )} - )),this._isImageBitmapSupported} - loadImageBitmap(t,i){ - var s; - return this._run("loadImageBitmap",[t,null==(s=null==i?void 0:i.data)?void 0:s.alphaMode])} - async _initWorkers(){ - this._initialized||(this._initialized=!0)} - _getWorker(){ - void 0===qu&&(qu=navigator.hardwareConcurrency||4); - let t=this._workerPool.pop(); - return!t&&this._createdWorkers<qu&&(this._createdWorkers++,t=(new Yu).worker,t.addEventListener("message",t=>{ - this._complete(t.data),this._returnWorker(t.target),this._next()} - )),t} - _returnWorker(t){ - this._workerPool.push(t)} - _complete(t){ - this._resolveHash[t.uuid]&&(void 0!==t.error?this._resolveHash[t.uuid].reject(t.error):this._resolveHash[t.uuid].resolve(t.data),delete this._resolveHash[t.uuid])} - async _run(t,i){ - await this._initWorkers(); - const s=new Promise((s,e)=>{ - this._queue.push({ - id:t,arguments:i,resolve:s,reject:e} - )} - ); - return this._next(),s} - _next(){ - if(!this._queue.length)return; - const t=this._getWorker(); - if(!t)return; - const i=this._queue.pop(),s=i.id; - this._resolveHash[Xu]={ - resolve:i.resolve,reject:i.reject} - ,t.postMessage({ - data:i.arguments,uuid:Xu++,id:s} - )} - reset(){ - this._workerPool.forEach(t=>t.terminate()),this._workerPool.length=0,Object.values(this._resolveHash).forEach(({ - reject:t} - )=>{ - null==t||t(new Error("WorkerManager has been reset before completion"))} - ),this._resolveHash={ - } - ,this._queue.length=0,this._initialized=!1,this._createdWorkers=0} - } - ; - Qt(Ju,"WorkerManagerClass"); - const Qu=new Ju,Zu=[".jpeg",".jpg",".png",".webp",".avif"],td=["image/jpeg","image/png","image/webp","image/avif"]; - async function id(t,i){ - var s; - const e=await ln.get().fetch(t); - if(!e.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${ - t} - : ${ - e.status} - ${ - e.statusText} - `); - const n=await e.blob(); - return"premultiplied-alpha"===(null==(s=null==i?void 0:i.data)?void 0:s.alphaMode)?createImageBitmap(n,{ - premultiplyAlpha:"none"} - ):createImageBitmap(n)} - Qt(id,"loadImageBitmap"); - const sd={ - name:"loadTextures",id:"texture",extension:{ - type:ri.LoadParser,priority:xn.High,name:"loadTextures"} - ,config:{ - preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"} - ,test:t=>jo(t,td)||Ko(t,Zu),async load(t,i,s){ - var e; - let n=null; - return n=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap?this.config.preferWorkers&&await Qu.isImageBitmapSupported()?await Qu.loadImageBitmap(t,i):await id(t,i):await new Promise((i,s)=>{ - n=ln.get().createImage(),n.crossOrigin=this.config.crossOrigin,n.src=t,n.complete?i(n):(n.onload=()=>{ - i(n)} - ,n.onerror=s)} - ),$u(new pn({ - resource:n,alphaMode:"premultiply-alpha-on-upload",resolution:(null==(e=i.data)?void 0:e.resolution)||Fu(t),...i.data} - ),s,t)} - ,unload(t){ - t.destroy(!0)} - } - ,ed=[".mp4",".m4v",".webm",".ogg",".ogv",".h264",".avi",".mov"]; - let nd,hd; - function rd(t,i,s){ - void 0!==s||i.startsWith("data:")?!1!==s&&(t.crossOrigin="string"==typeof s?s:"anonymous"):t.crossOrigin=ad(i)} - function od(t){ - return new Promise((i,s)=>{ - function e(){ - h(),i()} - function n(t){ - h(),s(t)} - function h(){ - t.removeEventListener("canplaythrough",e),t.removeEventListener("error",n)} - t.addEventListener("canplaythrough",e),t.addEventListener("error",n),t.load(),Qt(e,"loaded"),Qt(n,"error"),Qt(h,"cleanup")} - )} - function ad(t,i=globalThis.location){ - if(t.startsWith("data:"))return""; - i||(i=globalThis.location); - const s=new URL(t,document.baseURI); - return s.hostname!==i.hostname||s.port!==i.port||s.protocol!==i.protocol?"anonymous":""} - function cd(){ - const t=[],i=[]; - for(const s of ed){ - const e=En.MIME_TYPES[s.substring(1)]||`video/${ - s.substring(1)} - `; - Bo(e)&&(t.push(s),i.includes(e)||i.push(e))} - return{ - validVideoExtensions:t,validVideoMime:i} - } - Qt(rd,"crossOrigin"),Qt(od,"preloadVideo"),Qt(ad,"determineCrossOrigin"),Qt(cd,"getBrowserSupportedVideoExtensions"); - const ld={ - name:"loadVideo",id:"video",extension:{ - type:ri.LoadParser,name:"loadVideo"} - ,test(t){ - if(!nd||!hd){ - const{ - validVideoExtensions:t,validVideoMime:i} - =cd(); - nd=t,hd=i} - const i=jo(t,hd),s=Ko(t,nd); - return i||s} - ,async load(t,i,s){ - var e,n; - const h={ - ...En.defaultOptions,resolution:(null==(e=i.data)?void 0:e.resolution)||Fu(t),alphaMode:(null==(n=i.data)?void 0:n.alphaMode)||await bn(),...i.data} - ,r=document.createElement("video"),o={ - preload:!1!==h.autoLoad?"auto":void 0,"webkit-playsinline":!1!==h.playsinline?"":void 0,playsinline:!1!==h.playsinline?"":void 0,muted:!0===h.muted?"":void 0,loop:!0===h.loop?"":void 0,autoplay:!1!==h.autoPlay?"":void 0} - ; - Object.keys(o).forEach(t=>{ - const i=o[t]; - void 0!==i&&r.setAttribute(t,i)} - ),!0===h.muted&&(r.muted=!0),rd(r,t,h.crossorigin); - const a=document.createElement("source"); - let c; - if(h.mime)c=h.mime; - else if(t.startsWith("data:"))c=t.slice(5,t.indexOf("; - ")); - else if(!t.startsWith("blob:")){ - const i=t.split("?")[0].slice(t.lastIndexOf(".")+1).toLowerCase(); - c=En.MIME_TYPES[i]||`video/${ - i} - `} - return a.src=t,c&&(a.type=c),new Promise((e,n)=>{ - async function o(){ - const n=new En({ - ...h,resource:r} - ); - l(),i.data.preload&&await od(r),e($u(n,s,t))} - function c(t){ - l(),n(t)} - function l(){ - r.removeEventListener("canplay",o),r.removeEventListener("error",c),a.removeEventListener("error",c)} - h.preload&&!h.autoPlay&&r.load(),r.addEventListener("canplay",o),r.addEventListener("error",c),a.addEventListener("error",c),r.appendChild(a),Qt(o,"onCanPlay"),Qt(c,"onError"),Qt(l,"cleanup")} - )} - ,unload(t){ - t.destroy(!0)} - } - ,ud={ - extension:{ - type:ri.ResolveParser,name:"resolveTexture"} - ,test:sd.test,parse:Qt(t=>{ - var i; - return{ - resolution:parseFloat((null==(i=Hn.RETINA_PREFIX.exec(t))?void 0:i[1])??"1"),format:t.split(".").pop(),src:t} - } - ,"parse")} - ,dd={ - extension:{ - type:ri.ResolveParser,priority:-2,name:"resolveJson"} - ,test:Qt(t=>Hn.RETINA_PREFIX.test(t)&&t.endsWith(".json"),"test"),parse:ud.parse} - ,fd=class{ - constructor(){ - this._detections=[],this._initialized=!1,this.resolver=new Hn,this.loader=new Vo,this.cache=Tn,this._backgroundLoader=new xo(this.loader),this._backgroundLoader.active=!0,this.reset()} - async init(t={ - } - ){ - var i,s; - if(this._initialized)return void qs(); - if(this._initialized=!0,t.defaultSearchParams&&this.resolver.setDefaultSearchParams(t.defaultSearchParams),t.basePath&&(this.resolver.basePath=t.basePath),t.bundleIdentifier&&this.resolver.setBundleIdentifier(t.bundleIdentifier),t.manifest){ - let i=t.manifest; - "string"==typeof i&&(i=await this.load(i)),this.resolver.addManifest(i)} - const e=(null==(i=t.texturePreference)?void 0:i.resolution)??1,n="number"==typeof e?[e]:e,h=await this._detectFormats({ - preferredFormats:null==(s=t.texturePreference)?void 0:s.format,skipDetections:t.skipDetections,detections:this._detections} - ); - this.resolver.prefer({ - params:{ - format:h,resolution:n} - } - ),t.preferences&&this.setPreferences(t.preferences),t.loadOptions&&(this.loader.loadOptions={ - ...this.loader.loadOptions,...t.loadOptions} - )} - add(t){ - this.resolver.add(t)} - async load(t,i){ - this._initialized||await this.init(); - const s=Fn(t),e=An(t).map(t=>{ - if("string"!=typeof t){ - const i=this.resolver.getAlias(t); - return i.some(t=>!this.resolver.hasKey(t))&&this.add(t),Array.isArray(i)?i[0]:i} - return this.resolver.hasKey(t)||this.add({ - alias:t,src:t} - ),t} - ),n=this.resolver.resolve(e),h=await this._mapLoadToResolve(n,i); - return s?h[e[0]]:h} - addBundle(t,i){ - this.resolver.addBundle(t,i)} - async loadBundle(t,i){ - this._initialized||await this.init(); - let s=!1; - "string"==typeof t&&(s=!0,t=[t]); - const e=this.resolver.resolveBundle(t),n={ - } - ,h=Object.keys(e); - let r=0; - const o=[],a=Qt(()=>{ - null==i||i(o.reduce((t,i)=>t+i,0)/r)} - ,"_onProgress"),c=h.map((t,i)=>{ - const s=e[t],h=Object.values(s),c=[...new Set(h.flat())].reduce((t,i)=>t+(i.progressSize||1),0); - return o.push(0),r+=c,this._mapLoadToResolve(s,t=>{ - o[i]=t*c,a()} - ).then(i=>{ - n[t]=i} - )} - ); - return await Promise.all(c),s?n[t[0]]:n} - async backgroundLoad(t){ - this._initialized||await this.init(),"string"==typeof t&&(t=[t]); - const i=this.resolver.resolve(t); - this._backgroundLoader.add(Object.values(i))} - async backgroundLoadBundle(t){ - this._initialized||await this.init(),"string"==typeof t&&(t=[t]); - const i=this.resolver.resolveBundle(t); - Object.values(i).forEach(t=>{ - this._backgroundLoader.add(Object.values(t))} - )} - reset(){ - this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1} - get(t){ - if("string"==typeof t)return Tn.get(t); - const i={ - } - ; - for(let s=0; - s<t.length; - s++)i[s]=Tn.get(t[s]); - return i} - async _mapLoadToResolve(t,i){ - const s=[...new Set(Object.values(t))]; - this._backgroundLoader.active=!1; - const e=await this.loader.load(s,i); - this._backgroundLoader.active=!0; - const n={ - } - ; - return s.forEach(t=>{ - const i=e[t.src],s=[t.src]; - t.alias&&s.push(...t.alias),s.forEach(t=>{ - n[t]=i} - ),Tn.set(s,i)} - ),n} - async unload(t){ - this._initialized||await this.init(); - const i=An(t).map(t=>"string"!=typeof t?t.src:t),s=this.resolver.resolve(i); - await this._unloadFromResolved(s)} - async unloadBundle(t){ - this._initialized||await this.init(),t=An(t); - const i=this.resolver.resolveBundle(t),s=Object.keys(i).map(t=>this._unloadFromResolved(i[t])); - await Promise.all(s)} - async _unloadFromResolved(t){ - const i=Object.values(t); - i.forEach(t=>{ - Tn.remove(t.src)} - ),await this.loader.unload(i)} - async _detectFormats(t){ - let i=[]; - t.preferredFormats&&(i=Array.isArray(t.preferredFormats)?t.preferredFormats:[t.preferredFormats]); - for(const s of t.detections)t.skipDetections||await s.test()?i=await s.add(i):t.skipDetections||(i=await s.remove(i)); - return i=i.filter((t,s)=>i.indexOf(t)===s),i} - get detections(){ - return this._detections} - setPreferences(t){ - this.loader.parsers.forEach(i=>{ - i.config&&Object.keys(i.config).filter(i=>i in t).forEach(s=>{ - i.config[s]=t[s]} - )} - )} - } - ; - Qt(fd,"AssetsClass"); - let pd=fd; - const wd=new pd; - ci.handleByList(ri.LoadParser,wd.loader.parsers).handleByList(ri.ResolveParser,wd.resolver.parsers).handleByList(ri.CacheParser,wd.cache.parsers).handleByList(ri.DetectionParser,wd.detections),ci.add(Ro,Do,No,Ho,Uo,Fo,$o,zo,Yo,sa,Hu,sd,ld,Io,Oo,ud,dd); - const gd={ - loader:ri.LoadParser,resolver:ri.ResolveParser,cache:ri.CacheParser,detection:ri.DetectionParser} - ; - ci.handle(ri.Asset,t=>{ - const i=t.ref; - Object.entries(gd).filter(([t])=>!!i[t]).forEach(([t,s])=>ci.add(Object.assign(i[t],{ - extension:i[t].extension??s} - )))} - ,t=>{ - const i=t.ref; - Object.keys(gd).filter(t=>!!i[t]).forEach(t=>ci.remove(i[t]))} - ); - const md=class extends ns{ - constructor(t){ - super({ - ...t,mipLevelCount:t.resource.length} - ),this.uploadMethodId="compressed"} - } - ; - Qt(md,"CompressedSource"); - let vd,_d,Md,bd=md; - function yd(){ - if(vd)return vd; - const t=ln.get().createCanvas(1,1).getContext("webgl"); - return t?(vd=[...t.getExtension("EXT_texture_compression_bptc")?["bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"]:[],...t.getExtension("WEBGL_compressed_texture_s3tc")?["bc1-rgba-unorm","bc2-rgba-unorm","bc3-rgba-unorm"]:[],...t.getExtension("WEBGL_compressed_texture_s3tc_srgb")?["bc1-rgba-unorm-srgb","bc2-rgba-unorm-srgb","bc3-rgba-unorm-srgb"]:[],...t.getExtension("EXT_texture_compression_rgtc")?["bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm"]:[],...t.getExtension("WEBGL_compressed_texture_etc")?["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","eac-r11unorm","eac-rg11unorm"]:[],...t.getExtension("WEBGL_compressed_texture_astc")?["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]:[]],vd):[]} - async function Ed(){ - if(_d)return _d; - const t=await ln.get().getNavigator().gpu.requestAdapter(); - return _d=[...t.features.has("texture-compression-bc")?["bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc2-rgba-unorm","bc2-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb","bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm","bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"]:[],...t.features.has("texture-compression-etc2")?["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm"]:[],...t.features.has("texture-compression-astc")?["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]:[]],_d} - async function Ad(){ - return void 0!==Md||(Md=await(async()=>{ - const t=await co(),i=ao(); - if(t&&i){ - const t=await Ed(),i=yd(); - return t.filter(t=>i.includes(t))} - return t?await Ed():i?yd():[]} - )()),Md} - Qt(yd,"getSupportedGlCompressedTextureFormats"),Qt(Ed,"getSupportedGPUCompressedTextureFormats"),Qt(Ad,"getSupportedCompressedTextureFormats"); - const Sd=["r8unorm","r8snorm","r8uint","r8sint","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32uint","r32sint","r32float","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb9e5ufloat","rgb10a2unorm","rg11b10ufloat","rg32uint","rg32sint","rg32float","rgba16uint","rgba16sint","rgba16float","rgba32uint","rgba32sint","rgba32float","stencil8","depth16unorm","depth24plus","depth24plus-stencil8","depth32float","depth32float-stencil8"]; - let Td; - async function Cd(){ - if(void 0!==Td)return Td; - const t=await Ad(); - return Td=[...Sd,...t],Td} - Qt(Cd,"getSupportedTextureFormats"); - let Od=null; - const Id=class{ - constructor(){ - Od||(Od=URL.createObjectURL(new Blob(['(function () { - \n \'use strict\'; - \n\n const converters = { - \n rgb8unorm: { - \n convertedFormat: "rgba8unorm",\n convertFunction: convertRGBtoRGBA\n } - ,\n "rgb8unorm-srgb": { - \n convertedFormat: "rgba8unorm-srgb",\n convertFunction: convertRGBtoRGBA\n } - \n } - ; - \n function convertFormatIfRequired(textureOptions) { - \n const format = textureOptions.format; - \n if (converters[format]) { - \n const convertFunction = converters[format].convertFunction; - \n const levelBuffers = textureOptions.resource; - \n for (let i = 0; - i < levelBuffers.length; - i++) { - \n levelBuffers[i] = convertFunction(levelBuffers[i]); - \n } - \n textureOptions.format = converters[format].convertedFormat; - \n } - \n } - \n function convertRGBtoRGBA(levelBuffer) { - \n const pixelCount = levelBuffer.byteLength / 3; - \n const levelBufferWithAlpha = new Uint32Array(pixelCount); - \n for (let i = 0; - i < pixelCount; - ++i) { - \n levelBufferWithAlpha[i] = levelBuffer[i * 3] + (levelBuffer[i * 3 + 1] << 8) + (levelBuffer[i * 3 + 2] << 16) + 4278190080; - \n } - \n return new Uint8Array(levelBufferWithAlpha.buffer); - \n } - \n\n function createLevelBuffersFromKTX(ktxTexture) { - \n const levelBuffers = []; - \n for (let i = 0; - i < ktxTexture.numLevels; - i++) { - \n const imageData = ktxTexture.getImageData(i, 0, 0); - \n const levelBuffer = new Uint8Array(imageData.byteLength); - \n levelBuffer.set(imageData); - \n levelBuffers.push(levelBuffer); - \n } - \n return levelBuffers; - \n } - \n\n const glFormatToGPUFormatMap = { - \n 6408: "rgba8unorm",\n 32856: "bgra8unorm",\n //\n 32857: "rgb10a2unorm",\n 33189: "depth16unorm",\n 33190: "depth24plus",\n 33321: "r8unorm",\n 33323: "rg8unorm",\n 33325: "r16float",\n 33326: "r32float",\n 33327: "rg16float",\n 33328: "rg32float",\n 33329: "r8sint",\n 33330: "r8uint",\n 33331: "r16sint",\n 33332: "r16uint",\n 33333: "r32sint",\n 33334: "r32uint",\n 33335: "rg8sint",\n 33336: "rg8uint",\n 33337: "rg16sint",\n 33338: "rg16uint",\n 33339: "rg32sint",\n 33340: "rg32uint",\n 33778: "bc2-rgba-unorm",\n 33779: "bc3-rgba-unorm",\n 34836: "rgba32float",\n 34842: "rgba16float",\n 35056: "depth24plus-stencil8",\n 35898: "rg11b10ufloat",\n 35901: "rgb9e5ufloat",\n 35907: "rgba8unorm-srgb",\n // bgra8unorm-srgb\n 36012: "depth32float",\n 36013: "depth32float-stencil8",\n 36168: "stencil8",\n 36208: "rgba32uint",\n 36214: "rgba16uint",\n 36220: "rgba8uint",\n 36226: "rgba32sint",\n 36232: "rgba16sint",\n 36238: "rgba8sint",\n 36492: "bc7-rgba-unorm",\n 36756: "r8snorm",\n 36757: "rg8snorm",\n 36759: "rgba8snorm",\n 37496: "etc2-rgba8unorm",\n 37808: "astc-4x4-unorm"\n } - ; - \n function glFormatToGPUFormat(glInternalFormat) { - \n const format = glFormatToGPUFormatMap[glInternalFormat]; - \n if (format) { - \n return format; - \n } - \n throw new Error(`Unsupported glInternalFormat: ${ - glInternalFormat} - `); - \n } - \n\n const vkFormatToGPUFormatMap = { - \n 23: "rgb8unorm",\n // VK_FORMAT_R8G8B8_UNORM\n 37: "rgba8unorm",\n // VK_FORMAT_R8G8B8A8_UNORM\n 43: "rgba8unorm-srgb"\n // VK_FORMAT_R8G8B8A8_SRGB\n // TODO add more!\n } - ; - \n function vkFormatToGPUFormat(vkFormat) { - \n const format = vkFormatToGPUFormatMap[vkFormat]; - \n if (format) { - \n return format; - \n } - \n throw new Error(`Unsupported VkFormat: ${ - vkFormat} - `); - \n } - \n\n function getTextureFormatFromKTXTexture(ktxTexture) { - \n if (ktxTexture.classId === 2) { - \n return vkFormatToGPUFormat(ktxTexture.vkFormat); - \n } - \n return glFormatToGPUFormat(ktxTexture.glInternalformat); - \n } - \n\n const gpuFormatToBasisTranscoderFormatMap = { - \n "bc3-rgba-unorm": "BC3_RGBA",\n "bc7-rgba-unorm": "BC7_M5_RGBA",\n "etc2-rgba8unorm": "ETC2_RGBA",\n "astc-4x4-unorm": "ASTC_4x4_RGBA",\n // Uncompressed\n rgba8unorm: "RGBA32",\n rg11b10ufloat: "R11F_G11F_B10F"\n } - ; - \n function gpuFormatToKTXBasisTranscoderFormat(transcoderFormat) { - \n const format = gpuFormatToBasisTranscoderFormatMap[transcoderFormat]; - \n if (format) { - \n return format; - \n } - \n throw new Error(`Unsupported transcoderFormat: ${ - transcoderFormat} - `); - \n } - \n\n const settings = { - \n jsUrl: "",\n wasmUrl: ""\n } - ; - \n let basisTranscoderFormat; - \n let basisTranscodedTextureFormat; - \n let ktxPromise; - \n async function getKTX() { - \n if (!ktxPromise) { - \n const absoluteJsUrl = new URL(settings.jsUrl, location.origin).href; - \n const absoluteWasmUrl = new URL(settings.wasmUrl, location.origin).href; - \n importScripts(absoluteJsUrl); - \n ktxPromise = new Promise((resolve) => { - \n LIBKTX({ - \n locateFile: (_file) => absoluteWasmUrl\n } - ).then((libktx) => { - \n resolve(libktx); - \n } - ); - \n } - ); - \n } - \n return ktxPromise; - \n } - \n async function fetchKTXTexture(url, ktx) { - \n const ktx2Response = await fetch(url); - \n if (ktx2Response.ok) { - \n const ktx2ArrayBuffer = await ktx2Response.arrayBuffer(); - \n return new ktx.ktxTexture(new Uint8Array(ktx2ArrayBuffer)); - \n } - \n throw new Error(`Failed to load KTX(2) texture: ${ - url} - `); - \n } - \n const preferredTranscodedFormat = [\n "bc7-rgba-unorm",\n "astc-4x4-unorm",\n "etc2-rgba8unorm",\n "bc3-rgba-unorm",\n "rgba8unorm"\n ]; - \n async function load(url) { - \n const ktx = await getKTX(); - \n const ktxTexture = await fetchKTXTexture(url, ktx); - \n let format; - \n if (ktxTexture.needsTranscoding) { - \n format = basisTranscodedTextureFormat; - \n const transcodeFormat = ktx.TranscodeTarget[basisTranscoderFormat]; - \n const result = ktxTexture.transcodeBasis(transcodeFormat, 0); - \n if (result !== ktx.ErrorCode.SUCCESS) { - \n throw new Error("Unable to transcode basis texture."); - \n } - \n } - else { - \n format = getTextureFormatFromKTXTexture(ktxTexture); - \n } - \n const levelBuffers = createLevelBuffersFromKTX(ktxTexture); - \n const textureOptions = { - \n width: ktxTexture.baseWidth,\n height: ktxTexture.baseHeight,\n format,\n mipLevelCount: ktxTexture.numLevels,\n resource: levelBuffers,\n alphaMode: "no-premultiply-alpha"\n } - ; - \n convertFormatIfRequired(textureOptions); - \n return textureOptions; - \n } - \n async function init(jsUrl, wasmUrl, supportedTextures) { - \n if (jsUrl) settings.jsUrl = jsUrl; - \n if (wasmUrl) settings.wasmUrl = wasmUrl; - \n basisTranscodedTextureFormat = preferredTranscodedFormat.filter((format) => supportedTextures.includes(format))[0]; - \n basisTranscoderFormat = gpuFormatToKTXBasisTranscoderFormat(basisTranscodedTextureFormat); - \n await getKTX(); - \n } - \n const messageHandlers = { - \n init: async (data) => { - \n const { - jsUrl, wasmUrl, supportedTextures } - = data; - \n await init(jsUrl, wasmUrl, supportedTextures); - \n } - ,\n load: async (data) => { - \n try { - \n const textureOptions = await load(data.url); - \n return { - \n type: "load",\n url: data.url,\n success: true,\n textureOptions,\n transferables: textureOptions.resource?.map((arr) => arr.buffer)\n } - ; - \n } - catch (e) { - \n throw e; - \n } - \n } - \n } - ; - \n self.onmessage = (async (messageEvent) => { - \n const message = messageEvent.data; - \n try { - \n const response = await messageHandlers[message.type]?.(message); - \n if (response) { - \n self.postMessage(response, response.transferables); - \n } - \n } - catch (err) { - \n self.postMessage({ - \n type: "error",\n err,\n url: message.url\n } - ); - \n } - \n } - ); - \n\n} - )(); - \n'],{ - type:"application/javascript"} - ))),this.worker=new Worker(Od)} - } - ; - Qt(Id,"WorkerInstance"); - let kd=Id; - kd.revokeObjectURL=Qt(function(){ - Od&&(URL.revokeObjectURL(Od),Od=null)} - ,"revokeObjectURL"); - const xd={ - jsUrl:"https://cdn.jsdelivr.net/npm/pixi.js/transcoders/ktx/libktx.js",wasmUrl:"https://cdn.jsdelivr.net/npm/pixi.js/transcoders/ktx/libktx.wasm"} - ; - let Rd; - const Pd={ - } - ,Nd={ - } - ; - function Ld(t){ - return Rd||(Rd=(new kd).worker,Rd.onmessage=t=>{ - const{ - err:i,success:s,url:e,textureOptions:n} - =t.data; - i?Nd[e](i):Pd[e](n)} - ,Rd.postMessage({ - type:"init",jsUrl:xd.jsUrl,wasmUrl:xd.wasmUrl,supportedTextures:t} - )),Rd} - function Dd(t,i){ - const s=Ld(i); - return new Promise((i,e)=>{ - Pd[t]=i,Nd[t]=e,s.postMessage({ - type:"load",url:t} - )} - )} - Qt(Ld,"getKTX2Worker"),Qt(Dd,"loadKTX2onWorker"); - const Gd={ - extension:{ - type:ri.LoadParser,priority:xn.High,name:"loadKTX2"} - ,name:"loadKTX2",id:"ktx2",test:t=>Ko(t,".ktx2"),async load(t,i,s){ - const e=await Cd(),n=await Dd(t,e); - return $u(new bd(n),s,t)} - ,async unload(t){ - Array.isArray(t)?t.forEach(t=>t.destroy(!0)):t.destroy(!0)} - } - ,Bd=["basis","bc7","bc6h","astc","etc2","bc5","bc4","bc3","bc2","bc1","eac"],Ud={ - extension:ri.ResolveParser,test:Qt(t=>Ko(t,[".ktx",".ktx2",".dds"]),"test"),parse:Qt(t=>{ - var i; - let s; - const e=t.split("."); - if(e.length>2){ - const t=e[e.length-2]; - Bd.includes(t)&&(s=t)} - else s=e[e.length-1]; - return{ - resolution:parseFloat((null==(i=Hn.RETINA_PREFIX.exec(t))?void 0:i[1])??"1"),format:s,src:t} - } - ,"parse")} - ; - let Fd; - const $d={ - extension:{ - type:ri.DetectionParser,priority:2} - ,test:Qt(async()=>!!(await co())||!!ao(),"test"),add:Qt(async t=>{ - const i=await Ad(); - return Fd=Hd(i),[...Fd,...t]} - ,"add"),remove:Qt(async t=>Fd?t.filter(t=>!(t in Fd)):t,"remove")} - ; - function Hd(t){ - const i=["basis"],s={ - } - ; - return t.forEach(t=>{ - const e=t.split("-")[0]; - e&&!s[e]&&(s[e]=!0,i.push(e))} - ),i.sort((t,i)=>{ - const s=Bd.indexOf(t),e=Bd.indexOf(i); - return-1===s?1:-1===e?-1:s-e} - ),i} - Qt(Hd,"extractExtensionsForCompressedTextureFormats"); - const Wd=class{ - constructor(t){ - this._attachedDomElements=[],this._renderer=t,this._renderer.runners.postrender.add(this),this._renderer.runners.init.add(this),this._domElement=document.createElement("div"),this._domElement.style.position="absolute",this._domElement.style.top="0",this._domElement.style.left="0",this._domElement.style.pointerEvents="none",this._domElement.style.zIndex="1000"} - init(){ - this._canvasObserver=new Jn({ - domElement:this._domElement,renderer:this._renderer} - )} - addRenderable(t,i){ - this._attachedDomElements.includes(t)||this._attachedDomElements.push(t)} - updateRenderable(t){ - } - validateRenderable(t){ - return!0} - postrender(){ - const t=this._attachedDomElements; - if(0!==t.length){ - this._canvasObserver.ensureAttached(); - for(let i=0; - i<t.length; - i++){ - const s=t[i],e=s.element; - if(!s.parent||s.globalDisplayStatus<7)null==e||e.remove(),t.splice(i,1),i--; - else{ - this._domElement.contains(e)||(e.style.position="absolute",e.style.pointerEvents="auto",this._domElement.appendChild(e)); - const t=s.worldTransform,i=s._anchor,n=s.width*i.x,h=s.height*i.y; - e.style.transformOrigin=`${ - n} - px ${ - h} - px`,e.style.transform=`matrix(${ - t.a} - , ${ - t.b} - , ${ - t.c} - , ${ - t.d} - , ${ - t.tx-n} - , ${ - t.ty-h} - )`,e.style.opacity=s.groupAlpha.toString()} - } - } - else this._domElement.remove()} - destroy(){ - var t; - this._renderer.runners.postrender.remove(this); - for(let i=0; - i<this._attachedDomElements.length; - i++)null==(t=this._attachedDomElements[i].element)||t.remove(); - this._attachedDomElements.length=0,this._domElement.remove(),this._canvasObserver.destroy(),this._renderer=null} - } - ; - Qt(Wd,"DOMPipe"); - let Vd=Wd; - Vd.extension={ - type:[ri.WebGLPipes,ri.WebGPUPipes,ri.CanvasPipes],name:"dom"} - ; - const jd=class{ - constructor(){ - this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0} - init(t){ - this.removeTickerListener(),this.events=t,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0} - get pauseUpdate(){ - return this._pauseUpdate} - set pauseUpdate(t){ - this._pauseUpdate=t} - addTickerListener(){ - !this._tickerAdded&&this.domElement&&(Mn.system.add(this._tickerUpdate,this,wn.INTERACTION),this._tickerAdded=!0)} - removeTickerListener(){ - this._tickerAdded&&(Mn.system.remove(this._tickerUpdate,this),this._tickerAdded=!1)} - pointerMoved(){ - this._didMove=!0} - _update(){ - if(!this.domElement||this._pauseUpdate)return; - if(this._didMove)return void(this._didMove=!1); - const t=this.events._rootPointerEvent; - this.events.supportsTouchEvents&&"touch"===t.pointerType||globalThis.document.dispatchEvent(this.events.supportsPointerEvents?new PointerEvent("pointermove",{ - clientX:t.clientX,clientY:t.clientY,pointerType:t.pointerType,pointerId:t.pointerId} - ):new MouseEvent("mousemove",{ - clientX:t.clientX,clientY:t.clientY} - ))} - _tickerUpdate(t){ - this._deltaTime+=t.deltaTime,this._deltaTime<this.interactionFrequency||(this._deltaTime=0,this._update())} - destroy(){ - this.removeTickerListener(),this.events=null,this.domElement=null,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0} - } - ; - Qt(jd,"EventsTickerClass"); - const Kd=new jd,zd=class extends Zn{ - constructor(){ - super(...arguments),this.client=new Ai,this.movement=new Ai,this.offset=new Ai,this.global=new Ai,this.screen=new Ai} - get clientX(){ - return this.client.x} - get clientY(){ - return this.client.y} - get x(){ - return this.clientX} - get y(){ - return this.clientY} - get movementX(){ - return this.movement.x} - get movementY(){ - return this.movement.y} - get offsetX(){ - return this.offset.x} - get offsetY(){ - return this.offset.y} - get globalX(){ - return this.global.x} - get globalY(){ - return this.global.y} - get screenX(){ - return this.screen.x} - get screenY(){ - return this.screen.y} - getLocalPosition(t,i,s){ - return t.worldTransform.applyInverse(s||this.global,i)} - getModifierState(t){ - return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)} - initMouseEvent(t,i,s,e,n,h,r,o,a,c,l,u,d,f,p){ - throw new Error("Method not implemented.")} - } - ; - Qt(zd,"FederatedMouseEvent"); - let Yd=zd; - const qd=class extends Yd{ - constructor(){ - super(...arguments),this.width=0,this.height=0,this.isPrimary=!1} - getCoalescedEvents(){ - return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]} - getPredictedEvents(){ - throw new Error("getPredictedEvents is not supported!")} - } - ; - Qt(qd,"FederatedPointerEvent"); - let Xd=qd; - const Jd=class extends Yd{ - constructor(){ - super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2} - } - ; - Qt(Jd,"FederatedWheelEvent"); - let Qd=Jd; - Qd.DOM_DELTA_PIXEL=0,Qd.DOM_DELTA_LINE=1,Qd.DOM_DELTA_PAGE=2; - const Zd=new Ai,tf=new Ai,sf=class{ - constructor(t){ - this.dispatch=new vi,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={ - trackingData:{ - } - } - ,this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=t,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={ - } - ,this.addEventMapping("pointerdown",this.mapPointerDown),this.addEventMapping("pointermove",this.mapPointerMove),this.addEventMapping("pointerout",this.mapPointerOut),this.addEventMapping("pointerleave",this.mapPointerOut),this.addEventMapping("pointerover",this.mapPointerOver),this.addEventMapping("pointerup",this.mapPointerUp),this.addEventMapping("pointerupoutside",this.mapPointerUpOutside),this.addEventMapping("wheel",this.mapWheel)} - addEventMapping(t,i){ - this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({ - fn:i,priority:0} - ),this.mappingTable[t].sort((t,i)=>t.priority-i.priority)} - dispatchEvent(t,i){ - t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,i),this.dispatch.emit(i||t.type,t)} - mapEvent(t){ - if(!this.rootTarget)return; - const i=this.mappingTable[t.type]; - if(i)for(let s=0,e=i.length; - s<e; - s++)i[s].fn(t); - else qs(t.type)} - hitTest(t,i){ - Kd.pauseUpdate=!0; - const s=this[this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive"](this.rootTarget,this.rootTarget.eventMode,Zd.set(t,i),this.hitTestFn,this.hitPruneFn); - return s&&s[0]} - propagate(t,i){ - if(!t.target)return; - const s=t.composedPath(); - t.eventPhase=t.CAPTURING_PHASE; - for(let e=0,n=s.length-1; - e<n; - e++)if(t.currentTarget=s[e],this.notifyTarget(t,i),t.propagationStopped||t.propagationImmediatelyStopped)return; - if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,i),!t.propagationStopped&&!t.propagationImmediatelyStopped){ - t.eventPhase=t.BUBBLING_PHASE; - for(let e=s.length-2; - e>=0; - e--)if(t.currentTarget=s[e],this.notifyTarget(t,i),t.propagationStopped||t.propagationImmediatelyStopped)return} - } - all(t,i,s=this._allInteractiveElements){ - if(0===s.length)return; - t.eventPhase=t.BUBBLING_PHASE; - const e=Array.isArray(i)?i:[i]; - for(let n=s.length-1; - n>=0; - n--)e.forEach(i=>{ - t.currentTarget=s[n],this.notifyTarget(t,i)} - )} - propagationPath(t){ - const i=[t]; - for(let s=0; - s<2048&&t!==this.rootTarget&&t.parent; - s++){ - if(!t.parent)throw new Error("Cannot find propagation path to disconnected target"); - i.push(t.parent),t=t.parent} - return i.reverse(),i} - hitTestMoveRecursive(t,i,s,e,n,h=!1){ - let r=!1; - if(this._interactivePrune(t))return null; - if("dynamic"!==t.eventMode&&"dynamic"!==i||(Kd.pauseUpdate=!1),t.interactiveChildren&&t.children){ - const o=t.children; - for(let a=o.length-1; - a>=0; - a--){ - const c=o[a],l=this.hitTestMoveRecursive(c,this._isInteractive(i)?i:c.eventMode,s,e,n,h||n(t,s)); - if(l){ - if(l.length>0&&!l[l.length-1].parent)continue; - const i=t.isInteractive(); - (l.length>0||i)&&(i&&this._allInteractiveElements.push(t),l.push(t)),0===this._hitElements.length&&(this._hitElements=l),r=!0} - } - } - const o=this._isInteractive(i),a=t.isInteractive(); - return a&&a&&this._allInteractiveElements.push(t),h||this._hitElements.length>0?null:r?this._hitElements:o&&!n(t,s)&&e(t,s)?a?[t]:[]:null} - hitTestRecursive(t,i,s,e,n){ - if(this._interactivePrune(t)||n(t,s))return null; - if("dynamic"!==t.eventMode&&"dynamic"!==i||(Kd.pauseUpdate=!1),t.interactiveChildren&&t.children){ - const h=t.children,r=s; - for(let s=h.length-1; - s>=0; - s--){ - const o=h[s],a=this.hitTestRecursive(o,this._isInteractive(i)?i:o.eventMode,r,e,n); - if(a){ - if(a.length>0&&!a[a.length-1].parent)continue; - const i=t.isInteractive(); - return(a.length>0||i)&&a.push(t),a} - } - } - const h=this._isInteractive(i),r=t.isInteractive(); - return h&&e(t,s)?r?[t]:[]:null} - _isInteractive(t){ - return"static"===t||"dynamic"===t} - _interactivePrune(t){ - return!(t&&t.visible&&t.renderable&&t.measurable)||"none"===t.eventMode||"passive"===t.eventMode&&!t.interactiveChildren} - hitPruneFn(t,i){ - if(t.hitArea&&(t.worldTransform.applyInverse(i,tf),!t.hitArea.contains(tf.x,tf.y)))return!0; - if(t.effects&&t.effects.length)for(let s=0; - s<t.effects.length; - s++){ - const e=t.effects[s]; - if(e.containsPoint&&!e.containsPoint(i,this.hitTestFn))return!0} - return!1} - hitTestFn(t,i){ - return!!t.hitArea||!!(null==t?void 0:t.containsPoint)&&(t.worldTransform.applyInverse(i,tf),t.containsPoint(tf))} - notifyTarget(t,i){ - var s,e; - if(!t.currentTarget.isInteractive())return; - i??(i=t.type); - const n=`on${ - i} - `; - null==(e=(s=t.currentTarget)[n])||e.call(s,t); - const h=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${ - i} - capture`:i; - this._notifyListeners(t,h),t.eventPhase===t.AT_TARGET&&this._notifyListeners(t,i)} - mapPointerDown(t){ - if(!(t instanceof Xd))return void qs(); - const i=this.createPointerEvent(t); - if(this.dispatchEvent(i,"pointerdown"),"touch"===i.pointerType)this.dispatchEvent(i,"touchstart"); - else if("mouse"===i.pointerType||"pen"===i.pointerType){ - const t=2===i.button; - this.dispatchEvent(i,t?"rightdown":"mousedown")} - this.trackingData(t.pointerId).pressTargetsByButton[t.button]=i.composedPath(),this.freeEvent(i)} - mapPointerMove(t){ - var i,s; - if(!(t instanceof Xd))return void qs(); - this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0; - const e=this.createPointerEvent(t); - this._isPointerMoveEvent=!1; - const n="mouse"===e.pointerType||"pen"===e.pointerType,h=this.trackingData(t.pointerId),r=this.findMountedTarget(h.overTargets); - if((null==(i=h.overTargets)?void 0:i.length)>0&&r!==e.target){ - const i="mousemove"===t.type?"mouseout":"pointerout",s=this.createPointerEvent(t,i,r); - if(this.dispatchEvent(s,"pointerout"),n&&this.dispatchEvent(s,"mouseout"),!e.composedPath().includes(r)){ - const i=this.createPointerEvent(t,"pointerleave",r); - for(i.eventPhase=i.AT_TARGET; - i.target&&!e.composedPath().includes(i.target); - )i.currentTarget=i.target,this.notifyTarget(i),n&&this.notifyTarget(i,"mouseleave"),i.target=i.target.parent; - this.freeEvent(i)} - this.freeEvent(s)} - if(r!==e.target){ - const i="mousemove"===t.type?"mouseover":"pointerover",s=this.clonePointerEvent(e,i); - this.dispatchEvent(s,"pointerover"),n&&this.dispatchEvent(s,"mouseover"); - let h=null==r?void 0:r.parent; - for(; - h&&h!==this.rootTarget.parent&&h!==e.target; - )h=h.parent; - if(!h||h===this.rootTarget.parent){ - const t=this.clonePointerEvent(e,"pointerenter"); - for(t.eventPhase=t.AT_TARGET; - t.target&&t.target!==r&&t.target!==this.rootTarget.parent; - )t.currentTarget=t.target,this.notifyTarget(t),n&&this.notifyTarget(t,"mouseenter"),t.target=t.target.parent; - this.freeEvent(t)} - this.freeEvent(s)} - const o=[],a=this.enableGlobalMoveEvents??!0; - this.moveOnAll?o.push("pointermove"):this.dispatchEvent(e,"pointermove"),a&&o.push("globalpointermove"),"touch"===e.pointerType&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(e,"touchmove"),a&&o.push("globaltouchmove")),n&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(e,"mousemove"),a&&o.push("globalmousemove"),this.cursor=null==(s=e.target)?void 0:s.cursor),o.length>0&&this.all(e,o),this._allInteractiveElements.length=0,this._hitElements.length=0,h.overTargets=e.composedPath(),this.freeEvent(e)} - mapPointerOver(t){ - var i; - if(!(t instanceof Xd))return void qs(); - const s=this.trackingData(t.pointerId),e=this.createPointerEvent(t),n="mouse"===e.pointerType||"pen"===e.pointerType; - this.dispatchEvent(e,"pointerover"),n&&this.dispatchEvent(e,"mouseover"),"mouse"===e.pointerType&&(this.cursor=null==(i=e.target)?void 0:i.cursor); - const h=this.clonePointerEvent(e,"pointerenter"); - for(h.eventPhase=h.AT_TARGET; - h.target&&h.target!==this.rootTarget.parent; - )h.currentTarget=h.target,this.notifyTarget(h),n&&this.notifyTarget(h,"mouseenter"),h.target=h.target.parent; - s.overTargets=e.composedPath(),this.freeEvent(e),this.freeEvent(h)} - mapPointerOut(t){ - if(!(t instanceof Xd))return void qs(); - const i=this.trackingData(t.pointerId); - if(i.overTargets){ - const s="mouse"===t.pointerType||"pen"===t.pointerType,e=this.findMountedTarget(i.overTargets),n=this.createPointerEvent(t,"pointerout",e); - this.dispatchEvent(n),s&&this.dispatchEvent(n,"mouseout"); - const h=this.createPointerEvent(t,"pointerleave",e); - for(h.eventPhase=h.AT_TARGET; - h.target&&h.target!==this.rootTarget.parent; - )h.currentTarget=h.target,this.notifyTarget(h),s&&this.notifyTarget(h,"mouseleave"),h.target=h.target.parent; - i.overTargets=null,this.freeEvent(n),this.freeEvent(h)} - this.cursor=null} - mapPointerUp(t){ - if(!(t instanceof Xd))return void qs(); - const i=performance.now(),s=this.createPointerEvent(t); - if(this.dispatchEvent(s,"pointerup"),"touch"===s.pointerType)this.dispatchEvent(s,"touchend"); - else if("mouse"===s.pointerType||"pen"===s.pointerType){ - const t=2===s.button; - this.dispatchEvent(s,t?"rightup":"mouseup")} - const e=this.trackingData(t.pointerId),n=this.findMountedTarget(e.pressTargetsByButton[t.button]); - let h=n; - if(n&&!s.composedPath().includes(n)){ - let i=n; - for(; - i&&!s.composedPath().includes(i); - ){ - if(s.currentTarget=i,this.notifyTarget(s,"pointerupoutside"),"touch"===s.pointerType)this.notifyTarget(s,"touchendoutside"); - else if("mouse"===s.pointerType||"pen"===s.pointerType){ - const t=2===s.button; - this.notifyTarget(s,t?"rightupoutside":"mouseupoutside")} - i=i.parent} - delete e.pressTargetsByButton[t.button],h=i} - if(h){ - const n=this.clonePointerEvent(s,"click"); - n.target=h,n.path=null,e.clicksByButton[t.button]||(e.clicksByButton[t.button]={ - clickCount:0,target:n.target,timeStamp:i} - ); - const r=e.clicksByButton[t.button]; - if(r.target===n.target&&i-r.timeStamp<200?++r.clickCount:r.clickCount=1,r.target=n.target,r.timeStamp=i,n.detail=r.clickCount,"mouse"===n.pointerType){ - const t=2===n.button; - this.dispatchEvent(n,t?"rightclick":"click")} - else"touch"===n.pointerType&&this.dispatchEvent(n,"tap"); - this.dispatchEvent(n,"pointertap"),this.freeEvent(n)} - this.freeEvent(s)} - mapPointerUpOutside(t){ - if(!(t instanceof Xd))return void qs(); - const i=this.trackingData(t.pointerId),s=this.findMountedTarget(i.pressTargetsByButton[t.button]),e=this.createPointerEvent(t); - if(s){ - let n=s; - for(; - n; - )e.currentTarget=n,this.notifyTarget(e,"pointerupoutside"),"touch"===e.pointerType?this.notifyTarget(e,"touchendoutside"):"mouse"!==e.pointerType&&"pen"!==e.pointerType||this.notifyTarget(e,2===e.button?"rightupoutside":"mouseupoutside"),n=n.parent; - delete i.pressTargetsByButton[t.button]} - this.freeEvent(e)} - mapWheel(t){ - if(!(t instanceof Qd))return void qs(); - const i=this.createWheelEvent(t); - this.dispatchEvent(i),this.freeEvent(i)} - findMountedTarget(t){ - if(!t)return null; - let i=t[0]; - for(let s=1; - s<t.length&&t[s].parent===i; - s++)i=t[s]; - return i} - createPointerEvent(t,i,s){ - const e=this.allocateEvent(Xd); - return this.copyPointerData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t,e.target=s??this.hitTest(e.global.x,e.global.y)??this._hitElements[0],"string"==typeof i&&(e.type=i),e} - createWheelEvent(t){ - const i=this.allocateEvent(Qd); - return this.copyWheelData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t,i.target=this.hitTest(i.global.x,i.global.y),i} - clonePointerEvent(t,i){ - const s=this.allocateEvent(Xd); - return s.nativeEvent=t.nativeEvent,s.originalEvent=t.originalEvent,this.copyPointerData(t,s),this.copyMouseData(t,s),this.copyData(t,s),s.target=t.target,s.path=t.composedPath().slice(),s.type=i??s.type,s} - copyWheelData(t,i){ - i.deltaMode=t.deltaMode,i.deltaX=t.deltaX,i.deltaY=t.deltaY,i.deltaZ=t.deltaZ} - copyPointerData(t,i){ - t instanceof Xd&&i instanceof Xd&&(i.pointerId=t.pointerId,i.width=t.width,i.height=t.height,i.isPrimary=t.isPrimary,i.pointerType=t.pointerType,i.pressure=t.pressure,i.tangentialPressure=t.tangentialPressure,i.tiltX=t.tiltX,i.tiltY=t.tiltY,i.twist=t.twist)} - copyMouseData(t,i){ - t instanceof Yd&&i instanceof Yd&&(i.altKey=t.altKey,i.button=t.button,i.buttons=t.buttons,i.client.copyFrom(t.client),i.ctrlKey=t.ctrlKey,i.metaKey=t.metaKey,i.movement.copyFrom(t.movement),i.screen.copyFrom(t.screen),i.shiftKey=t.shiftKey,i.global.copyFrom(t.global))} - copyData(t,i){ - i.isTrusted=t.isTrusted,i.srcElement=t.srcElement,i.timeStamp=performance.now(),i.type=t.type,i.detail=t.detail,i.view=t.view,i.which=t.which,i.layer.copyFrom(t.layer),i.page.copyFrom(t.page)} - trackingData(t){ - return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={ - pressTargetsByButton:{ - } - ,clicksByButton:{ - } - ,overTarget:null} - ),this.mappingState.trackingData[t]} - allocateEvent(t){ - this.eventPool.has(t)||this.eventPool.set(t,[]); - const i=this.eventPool.get(t).pop()||new t(this); - return i.eventPhase=i.NONE,i.currentTarget=null,i.defaultPrevented=!1,i.path=null,i.target=null,i} - freeEvent(t){ - if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!"); - const i=t.constructor; - this.eventPool.has(i)||this.eventPool.set(i,[]),this.eventPool.get(i).push(t)} - _notifyListeners(t,i){ - const s=t.currentTarget._events[i]; - if(s)if("fn"in s)s.once&&t.currentTarget.removeListener(i,s.fn,void 0,!0),s.fn.call(s.context,t); - else for(let e=0,n=s.length; - e<n&&!t.propagationImmediatelyStopped; - e++)s[e].once&&t.currentTarget.removeListener(i,s[e].fn,void 0,!0),s[e].fn.call(s[e].context,t)} - } - ; - Qt(sf,"EventBoundary"); - let ef=sf; - const nf={ - touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"} - ,hf=(Qt(S=class{ - constructor(t){ - this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=t,this.rootBoundary=new ef(null),Kd.init(this),this.autoPreventDefault=!0,this._eventsAdded=!1,this._rootPointerEvent=new Xd(null),this._rootWheelEvent=new Qd(null),this.cursorStyles={ - default:"inherit",pointer:"pointer"} - ,this.features=new Proxy({ - ...S.defaultEventFeatures} - ,{ - set:Qt((t,i,s)=>("globalMove"===i&&(this.rootBoundary.enableGlobalMoveEvents=s),t[i]=s,!0),"set")} - ),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerOverOut=this._onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)} - static get defaultEventMode(){ - return this._defaultEventMode} - init(t){ - const{ - canvas:i,resolution:s} - =this.renderer; - this.setTargetElement(i),this.resolution=s,S._defaultEventMode=t.eventMode??"passive",Object.assign(this.features,t.eventFeatures??{ - } - ),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove} - resolutionChange(t){ - this.resolution=t} - destroy(){ - Kd.destroy(),this.setTargetElement(null),this.renderer=null,this._currentCursor=null} - setCursor(t){ - t||(t="default"); - let i=!0; - if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(i=!1),this._currentCursor===t)return; - this._currentCursor=t; - const s=this.cursorStyles[t]; - if(s)switch(typeof s){ - case"string":i&&(this.domElement.style.cursor=s); - break; - case"function":s(t); - break; - case"object":i&&Object.assign(this.domElement.style,s)} - else i&&"string"==typeof t&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.domElement.style.cursor=t)} - get pointer(){ - return this._rootPointerEvent} - _onPointerDown(t){ - if(!this.features.click)return; - this.rootBoundary.rootTarget=this.renderer.lastObjectRendered; - const i=this._normalizeToPointerData(t); - this.autoPreventDefault&&i[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault(); - for(let s=0,e=i.length; - s<e; - s++){ - const t=i[s],e=this._bootstrapEvent(this._rootPointerEvent,t); - this.rootBoundary.mapEvent(e)} - this.setCursor(this.rootBoundary.cursor)} - _onPointerMove(t){ - if(!this.features.move)return; - this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,Kd.pointerMoved(); - const i=this._normalizeToPointerData(t); - for(let s=0,e=i.length; - s<e; - s++){ - const t=this._bootstrapEvent(this._rootPointerEvent,i[s]); - this.rootBoundary.mapEvent(t)} - this.setCursor(this.rootBoundary.cursor)} - _onPointerUp(t){ - if(!this.features.click)return; - this.rootBoundary.rootTarget=this.renderer.lastObjectRendered; - let i=t.target; - t.composedPath&&t.composedPath().length>0&&(i=t.composedPath()[0]); - const s=i!==this.domElement?"outside":"",e=this._normalizeToPointerData(t); - for(let n=0,h=e.length; - n<h; - n++){ - const t=this._bootstrapEvent(this._rootPointerEvent,e[n]); - t.type+=s,this.rootBoundary.mapEvent(t)} - this.setCursor(this.rootBoundary.cursor)} - _onPointerOverOut(t){ - if(!this.features.click)return; - this.rootBoundary.rootTarget=this.renderer.lastObjectRendered; - const i=this._normalizeToPointerData(t); - for(let s=0,e=i.length; - s<e; - s++){ - const t=this._bootstrapEvent(this._rootPointerEvent,i[s]); - this.rootBoundary.mapEvent(t)} - this.setCursor(this.rootBoundary.cursor)} - onWheel(t){ - if(!this.features.wheel)return; - const i=this.normalizeWheelEvent(t); - this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(i)} - setTargetElement(t){ - this._removeEvents(),this.domElement=t,Kd.domElement=t,this._addEvents()} - _addEvents(){ - if(this._eventsAdded||!this.domElement)return; - Kd.addTickerListener(); - const t=this.domElement.style; - t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this._onPointerMove,!0),this.domElement.addEventListener("pointerdown",this._onPointerDown,!0),this.domElement.addEventListener("pointerleave",this._onPointerOverOut,!0),this.domElement.addEventListener("pointerover",this._onPointerOverOut,!0),globalThis.addEventListener("pointerup",this._onPointerUp,!0)):(globalThis.document.addEventListener("mousemove",this._onPointerMove,!0),this.domElement.addEventListener("mousedown",this._onPointerDown,!0),this.domElement.addEventListener("mouseout",this._onPointerOverOut,!0),this.domElement.addEventListener("mouseover",this._onPointerOverOut,!0),globalThis.addEventListener("mouseup",this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this._onPointerDown,!0),this.domElement.addEventListener("touchend",this._onPointerUp,!0),this.domElement.addEventListener("touchmove",this._onPointerMove,!0))),this.domElement.addEventListener("wheel",this.onWheel,{ - passive:!0,capture:!0} - ),this._eventsAdded=!0} - _removeEvents(){ - if(!this._eventsAdded||!this.domElement)return; - Kd.removeTickerListener(); - const t=this.domElement.style; - t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction="")),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this._onPointerMove,!0),this.domElement.removeEventListener("pointerdown",this._onPointerDown,!0),this.domElement.removeEventListener("pointerleave",this._onPointerOverOut,!0),this.domElement.removeEventListener("pointerover",this._onPointerOverOut,!0),globalThis.removeEventListener("pointerup",this._onPointerUp,!0)):(globalThis.document.removeEventListener("mousemove",this._onPointerMove,!0),this.domElement.removeEventListener("mousedown",this._onPointerDown,!0),this.domElement.removeEventListener("mouseout",this._onPointerOverOut,!0),this.domElement.removeEventListener("mouseover",this._onPointerOverOut,!0),globalThis.removeEventListener("mouseup",this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this._onPointerDown,!0),this.domElement.removeEventListener("touchend",this._onPointerUp,!0),this.domElement.removeEventListener("touchmove",this._onPointerMove,!0))),this.domElement.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this._eventsAdded=!1} - mapPositionToPoint(t,i,s){ - const e=this.domElement.isConnected?this.domElement.getBoundingClientRect():{ - width:this.domElement.width,height:this.domElement.height,left:0,top:0} - ,n=1/this.resolution; - t.x=(i-e.left)*(this.domElement.width/e.width)*n,t.y=(s-e.top)*(this.domElement.height/e.height)*n} - _normalizeToPointerData(t){ - const i=[]; - if(this.supportsTouchEvents&&t instanceof TouchEvent)for(let s=0,e=t.changedTouches.length; - s<e; - s++){ - const e=t.changedTouches[s]; - void 0===e.button&&(e.button=0),void 0===e.buttons&&(e.buttons=1),void 0===e.isPrimary&&(e.isPrimary=1===t.touches.length&&"touchstart"===t.type),void 0===e.width&&(e.width=e.radiusX||1),void 0===e.height&&(e.height=e.radiusY||1),void 0===e.tiltX&&(e.tiltX=0),void 0===e.tiltY&&(e.tiltY=0),void 0===e.pointerType&&(e.pointerType="touch"),void 0===e.pointerId&&(e.pointerId=e.identifier||0),void 0===e.pressure&&(e.pressure=e.force||.5),void 0===e.twist&&(e.twist=0),void 0===e.tangentialPressure&&(e.tangentialPressure=0),void 0===e.layerX&&(e.layerX=e.offsetX=e.clientX),void 0===e.layerY&&(e.layerY=e.offsetY=e.clientY),e.isNormalized=!0,e.type=t.type,e.altKey??(e.altKey=t.altKey),e.ctrlKey??(e.ctrlKey=t.ctrlKey),e.metaKey??(e.metaKey=t.metaKey),e.shiftKey??(e.shiftKey=t.shiftKey),i.push(e)} - else if(!globalThis.MouseEvent||t instanceof MouseEvent&&!(this.supportsPointerEvents&&t instanceof globalThis.PointerEvent)){ - const s=t; - void 0===s.isPrimary&&(s.isPrimary=!0),void 0===s.width&&(s.width=1),void 0===s.height&&(s.height=1),void 0===s.tiltX&&(s.tiltX=0),void 0===s.tiltY&&(s.tiltY=0),void 0===s.pointerType&&(s.pointerType="mouse"),void 0===s.pointerId&&(s.pointerId=1),void 0===s.pressure&&(s.pressure=.5),void 0===s.twist&&(s.twist=0),void 0===s.tangentialPressure&&(s.tangentialPressure=0),s.isNormalized=!0,i.push(s)} - else i.push(t); - return i} - normalizeWheelEvent(t){ - const i=this._rootWheelEvent; - return this._transferMouseData(i,t),i.deltaX=t.deltaX,i.deltaY=t.deltaY,i.deltaZ=t.deltaZ,i.deltaMode=t.deltaMode,this.mapPositionToPoint(i.screen,t.clientX,t.clientY),i.global.copyFrom(i.screen),i.offset.copyFrom(i.screen),i.nativeEvent=t,i.type=t.type,i} - _bootstrapEvent(t,i){ - return t.originalEvent=null,t.nativeEvent=i,t.pointerId=i.pointerId,t.width=i.width,t.height=i.height,t.isPrimary=i.isPrimary,t.pointerType=i.pointerType,t.pressure=i.pressure,t.tangentialPressure=i.tangentialPressure,t.tiltX=i.tiltX,t.tiltY=i.tiltY,t.twist=i.twist,this._transferMouseData(t,i),this.mapPositionToPoint(t.screen,i.clientX,i.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.isTrusted=i.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=nf[t.type]||t.type),t} - _transferMouseData(t,i){ - t.isTrusted=i.isTrusted,t.srcElement=i.srcElement,t.timeStamp=performance.now(),t.type=i.type,t.altKey=i.altKey,t.button=i.button,t.buttons=i.buttons,t.client.x=i.clientX,t.client.y=i.clientY,t.ctrlKey=i.ctrlKey,t.metaKey=i.metaKey,t.movement.x=i.movementX,t.movement.y=i.movementY,t.page.x=i.pageX,t.page.y=i.pageY,t.relatedTarget=null,t.shiftKey=i.shiftKey} - } - ,"_EventSystem"),S); - hf.extension={ - name:"events",type:[ri.WebGLSystem,ri.CanvasSystem,ri.WebGPUSystem],priority:-1} - ,hf.defaultEventFeatures={ - move:!0,globalMove:!0,click:!0,wheel:!0} - ; - let rf=hf; - const of={ - onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){ - return"dynamic"===this.eventMode||"static"===this.eventMode} - ,set interactive(t){ - this.eventMode=t?"static":"passive"} - ,_internalEventMode:void 0,get eventMode(){ - return this._internalEventMode??rf.defaultEventMode} - ,set eventMode(t){ - this._internalEventMode=t} - ,isInteractive(){ - return"static"===this.eventMode||"dynamic"===this.eventMode} - ,interactiveChildren:!0,hitArea:null,addEventListener(t,i,s){ - const e="boolean"==typeof s&&s||"object"==typeof s&&s.capture,n="object"==typeof s?s.signal:void 0,h="object"==typeof s&&!0===s.once,r="function"==typeof i?void 0:i; - t=e?`${ - t} - capture`:t; - const o="function"==typeof i?i:i.handleEvent,a=this; - n&&n.addEventListener("abort",()=>{ - a.off(t,o,r)} - ),h?a.once(t,o,r):a.on(t,o,r)} - ,removeEventListener(t,i,s){ - const e="function"==typeof i?void 0:i; - t="boolean"==typeof s&&s||"object"==typeof s&&s.capture?`${ - t} - capture`:t,i="function"==typeof i?i:i.handleEvent,this.off(t,i,e)} - ,dispatchEvent(t){ - if(!(t instanceof Zn))throw new Error("Container cannot propagate events outside of the Federated Events API"); - return t.defaultPrevented=!1,t.path=null,t.target=this,t.manager.dispatchEvent(t),!t.defaultPrevented} - } - ; - var af="in vec2 aPosition; - \nout vec2 vTextureCoord; - \n\nuniform vec4 uInputSize; - \nuniform vec4 uOutputFrame; - \nuniform vec4 uOutputTexture; - \n\nvec4 filterVertexPosition( void )\n{ - \n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy; - \n \n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0; - \n position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z; - \n\n return vec4(position, 0.0, 1.0); - \n} - \n\nvec2 filterTextureCoord( void )\n{ - \n return aPosition * (uOutputFrame.zw * uInputSize.zw); - \n} - \n\nvoid main(void)\n{ - \n gl_Position = filterVertexPosition(); - \n vTextureCoord = filterTextureCoord(); - \n} - \n"; - const cf={ - 5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]} - ,lf=["in vec2 vBlurTexCoords[%size%]; - ","uniform sampler2D uTexture; - ","out vec4 finalColor; - ","void main(void)","{ - "," %blur%","} - "].join("\n"); - function uf(t){ - const i=cf[t],s=i.length; - let e=""; - for(let n=0; - n<t; - n++){ - const h=n<s?n:t-n-1; - e+=`${ - 0===n?"finalColor = ":" + "} - ${ - "texture(uTexture, vBlurTexCoords[%index%]) * %value%".replace("%index%",n.toString()).replace("%value%",i[h].toString())} - \n`} - return lf.replace("%blur%",`${ - e} - ; - `).replace("%size%",t.toString())} - function df(t,i){ - const s=Math.ceil(t/2); - let e,n="\n in vec2 aPosition; - \n\n uniform float uStrength; - \n\n out vec2 vBlurTexCoords[%size%]; - \n\n uniform vec4 uInputSize; - \n uniform vec4 uOutputFrame; - \n uniform vec4 uOutputTexture; - \n\n vec4 filterVertexPosition( void )\n{ - \n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy; - \n\n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0; - \n position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z; - \n\n return vec4(position, 0.0, 1.0); - \n} - \n\n vec2 filterTextureCoord( void )\n { - \n return aPosition * (uOutputFrame.zw * uInputSize.zw); - \n } - \n\n void main(void)\n { - \n gl_Position = filterVertexPosition(); - \n\n float pixelStrength = uInputSize.%dimension% * uStrength; - \n\n vec2 textureCoord = filterTextureCoord(); - \n %blur%\n } - ",h=""; - e=i?"vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * pixelStrength, 0.0); - ":"vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * pixelStrength); - "; - for(let r=0; - r<t; - r++){ - let t=e.replace("%index%",r.toString()); - t=t.replace("%sampleIndex%",r-(s-1)+".0"),h+=t,h+="\n"} - return n=n.replace("%blur%",h),n=n.replace("%size%",t.toString()),n=n.replace("%dimension%",i?"z":"w"),n} - function ff(t,i){ - const s=df(i,t),e=uf(i); - return Uh.from({ - vertex:s,fragment:e,name:`blur-${ - t?"horizontal":"vertical"} - -pass-filter`} - )} - Qt(uf,"generateBlurFragSource"),Qt(df,"generateBlurVertSource"),Qt(ff,"generateBlurGlProgram"); - var pf="\n\nstruct GlobalFilterUniforms { - \n uInputSize:vec4<f32>,\n uInputPixel:vec4<f32>,\n uInputClamp:vec4<f32>,\n uOutputFrame:vec4<f32>,\n uGlobalFrame:vec4<f32>,\n uOutputTexture:vec4<f32>,\n} - ; - \n\nstruct BlurUniforms { - \n uStrength:f32,\n} - ; - \n\n@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms; - \n@group(0) @binding(1) var uTexture: texture_2d<f32>; - \n@group(0) @binding(2) var uSampler : sampler; - \n\n@group(1) @binding(0) var<uniform> blurUniforms : BlurUniforms; - \n\n\nstruct VSOutput { - \n @builtin(position) position: vec4<f32>,\n %blur-struct%\n } - ; - \n\nfn filterVertexPosition(aPosition:vec2<f32>) -> vec4<f32>\n{ - \n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy; - \n\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0; - \n position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z; - \n\n return vec4(position, 0.0, 1.0); - \n} - \n\nfn filterTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{ - \n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw); - \n} - \n\nfn globalTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{ - \n return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw); - \n} - \n\nfn getSize() -> vec2<f32>\n{ - \n return gfu.uGlobalFrame.zw; - \n} - \n\n\n@vertex\nfn mainVertex(\n @location(0) aPosition : vec2<f32>,\n) -> VSOutput { - \n\n let filteredCord = filterTextureCoord(aPosition); - \n\n let pixelStrength = gfu.uInputSize.%dimension% * blurUniforms.uStrength; - \n\n return VSOutput(\n filterVertexPosition(aPosition),\n %blur-vertex-out%\n ); - \n} - \n\n@fragment\nfn mainFragment(\n @builtin(position) position: vec4<f32>,\n %blur-fragment-in%\n) -> @location(0) vec4<f32> { - \n\n var finalColor = vec4(0.0); - \n\n %blur-sampling%\n\n return finalColor; - \n} - \n"; - function wf(t,i){ - const s=cf[i],e=s.length,n=[],h=[],r=[]; - for(let u=0; - u<i; - u++){ - n[u]=`@location(${ - u} - ) offset${ - u} - : vec2<f32>,`,h[u]=t?`filteredCord + vec2(${ - u-e+1} - * pixelStrength, 0.0),`:`filteredCord + vec2(0.0, ${ - u-e+1} - * pixelStrength),`; - const o=s[u<e?u:i-u-1].toString(); - r[u]=`finalColor += textureSample(uTexture, uSampler, offset${ - u} - ) * ${ - o} - ; - `} - const o=n.join("\n"),a=h.join("\n"),c=r.join("\n"),l=pf.replace("%blur-struct%",o).replace("%blur-vertex-out%",a).replace("%blur-fragment-in%",o).replace("%blur-sampling%",c).replace("%dimension%",t?"z":"w"); - return tr.from({ - vertex:{ - source:l,entryPoint:"mainVertex"} - ,fragment:{ - source:l,entryPoint:"mainFragment"} - } - )} - Qt(wf,"generateBlurProgram"); - const gf=(Qt(T=class extends wr{ - constructor(t){ - super({ - glProgram:ff((t={ - ...T.defaultOptions,...t} - ).horizontal,t.kernelSize),gpuProgram:wf(t.horizontal,t.kernelSize),resources:{ - blurUniforms:{ - uStrength:{ - value:0,type:"f32"} - } - } - ,...t} - ),this.horizontal=t.horizontal,this.legacy=t.legacy??!1,this._quality=0,this.quality=t.quality,this.blur=t.strength,this._blurUniforms=this.resources.blurUniforms,this._uniforms=this._blurUniforms.uniforms} - apply(t,i,s,e){ - this.legacy?this._applyLegacy(t,i,s,e):this._applyOptimized(t,i,s,e)} - _applyLegacy(t,i,s,e){ - if(this._uniforms.uStrength=this.strength/this.passes,1===this.passes)t.applyFilter(this,i,s,e); - else{ - const n=Be.getSameSizeTexture(i); - let h=i,r=n; - this._state.blend=!1; - const o=t.renderer.type===ar.WEBGPU; - for(let i=0; - i<this.passes-1; - i++){ - t.applyFilter(this,h,r,0===i||o); - const s=r; - r=h,h=s} - this._state.blend=!0,t.applyFilter(this,h,s,e),Be.returnTexture(n)} - } - _applyOptimized(t,i,s,e){ - if(this._uniforms.uStrength=this._calculateInitialStrength(),1===this.passes)t.applyFilter(this,i,s,e); - else{ - const n=Be.getSameSizeTexture(i); - let h=i,r=n; - this._state.blend=!1; - const o=t.renderer,a=o.type===ar.WEBGPU,c=a?o.renderPipes.uniformBatch:null; - for(let i=0; - i<this.passes-1; - i++){ - c&&this.groups[1].setResource(c.getUboResource(this._blurUniforms),0),t.applyFilter(this,h,r,a); - const i=r; - r=h,h=i,this._uniforms.uStrength*=.5} - c&&this.groups[1].setResource(c.getUboResource(this._blurUniforms),0),this._state.blend=!0,t.applyFilter(this,h,s,e),Be.returnTexture(n)} - } - _calculateInitialStrength(){ - let t=1,i=.5; - for(let s=1; - s<this.passes; - s++)t+=i*i,i*=.5; - return this.strength/Math.sqrt(t)} - get blur(){ - return this.strength} - set blur(t){ - this.padding=1+2*Math.abs(t),this.strength=t} - get quality(){ - return this._quality} - set quality(t){ - this._quality=t,this.passes=t} - } - ,"_BlurFilterPass"),T); - gf.defaultOptions={ - strength:8,quality:4,kernelSize:5,legacy:!1} - ; - let mf=gf; - const vf=class extends wr{ - constructor(...t){ - let i=t[0]??{ - } - ; - "number"==typeof i&&(Yi(ji,"BlurFilter constructor params are now options object. See params: { - strength, quality, resolution, kernelSize } - "),i={ - strength:i} - ,void 0!==t[1]&&(i.quality=t[1]),void 0!==t[2]&&(i.resolution=t[2]||"inherit"),void 0!==t[3]&&(i.kernelSize=t[3])),i={ - ...mf.defaultOptions,...i} - ; - const{ - strength:s,strengthX:e,strengthY:n,quality:h,...r} - =i; - super({ - ...r,compatibleRenderers:ar.BOTH,resources:{ - } - } - ),this._repeatEdgePixels=!1,this.blurXFilter=new mf({ - horizontal:!0,...i} - ),this.blurYFilter=new mf({ - horizontal:!1,...i} - ),this.quality=h,this.strengthX=e??s,this.strengthY=n??s,this.repeatEdgePixels=!1} - apply(t,i,s,e){ - const n=Math.abs(this.blurXFilter.strength),h=Math.abs(this.blurYFilter.strength); - if(n&&h){ - const n=Be.getSameSizeTexture(i); - this.blurXFilter.blendMode="normal",this.blurXFilter.apply(t,i,n,!0),this.blurYFilter.blendMode=this.blendMode,this.blurYFilter.apply(t,n,s,e),Be.returnTexture(n)} - else h?(this.blurYFilter.blendMode=this.blendMode,this.blurYFilter.apply(t,i,s,e)):(this.blurXFilter.blendMode=this.blendMode,this.blurXFilter.apply(t,i,s,e))} - updatePadding(){ - this._repeatEdgePixels?this.padding=0:this.padding=2*Math.max(Math.abs(this.blurXFilter.blur),Math.abs(this.blurYFilter.blur))} - get strength(){ - if(this.strengthX!==this.strengthY)throw new Error("BlurFilter's strengthX and strengthY are different"); - return this.strengthX} - set strength(t){ - this.blurXFilter.blur=this.blurYFilter.blur=t,this.updatePadding()} - get quality(){ - return this.blurXFilter.quality} - set quality(t){ - this.blurXFilter.quality=this.blurYFilter.quality=t} - get strengthX(){ - return this.blurXFilter.blur} - set strengthX(t){ - this.blurXFilter.blur=t,this.updatePadding()} - get strengthY(){ - return this.blurYFilter.blur} - set strengthY(t){ - this.blurYFilter.blur=t,this.updatePadding()} - get blur(){ - return Yi("8.3.0","BlurFilter.blur is deprecated, please use BlurFilter.strength instead."),this.strength} - set blur(t){ - Yi("8.3.0","BlurFilter.blur is deprecated, please use BlurFilter.strength instead."),this.strength=t} - get blurX(){ - return Yi("8.3.0","BlurFilter.blurX is deprecated, please use BlurFilter.strengthX instead."),this.strengthX} - set blurX(t){ - Yi("8.3.0","BlurFilter.blurX is deprecated, please use BlurFilter.strengthX instead."),this.strengthX=t} - get blurY(){ - return Yi("8.3.0","BlurFilter.blurY is deprecated, please use BlurFilter.strengthY instead."),this.strengthY} - set blurY(t){ - Yi("8.3.0","BlurFilter.blurY is deprecated, please use BlurFilter.strengthY instead."),this.strengthY=t} - get repeatEdgePixels(){ - return this._repeatEdgePixels} - set repeatEdgePixels(t){ - this._repeatEdgePixels=t,this.updatePadding()} - } - ; - Qt(vf,"BlurFilter"); - let _f=vf; - _f.defaultOptions={ - strength:8,quality:4,kernelSize:5,legacy:!1} - ; - var Mf="\nin vec2 vTextureCoord; - \nin vec4 vColor; - \n\nout vec4 finalColor; - \n\nuniform float uColorMatrix[20]; - \nuniform float uAlpha; - \n\nuniform sampler2D uTexture; - \n\nfloat rand(vec2 co)\n{ - \n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); - \n} - \n\nvoid main()\n{ - \n vec4 color = texture(uTexture, vTextureCoord); - \n float randomValue = rand(gl_FragCoord.xy * 0.2); - \n float diff = (randomValue - 0.5) * 0.5; - \n\n if (uAlpha == 0.0) { - \n finalColor = color; - \n return; - \n } - \n\n if (color.a > 0.0) { - \n color.rgb /= color.a; - \n } - \n\n vec4 result; - \n\n result.r = (uColorMatrix[0] * color.r); - \n result.r += (uColorMatrix[1] * color.g); - \n result.r += (uColorMatrix[2] * color.b); - \n result.r += (uColorMatrix[3] * color.a); - \n result.r += uColorMatrix[4]; - \n\n result.g = (uColorMatrix[5] * color.r); - \n result.g += (uColorMatrix[6] * color.g); - \n result.g += (uColorMatrix[7] * color.b); - \n result.g += (uColorMatrix[8] * color.a); - \n result.g += uColorMatrix[9]; - \n\n result.b = (uColorMatrix[10] * color.r); - \n result.b += (uColorMatrix[11] * color.g); - \n result.b += (uColorMatrix[12] * color.b); - \n result.b += (uColorMatrix[13] * color.a); - \n result.b += uColorMatrix[14]; - \n\n result.a = (uColorMatrix[15] * color.r); - \n result.a += (uColorMatrix[16] * color.g); - \n result.a += (uColorMatrix[17] * color.b); - \n result.a += (uColorMatrix[18] * color.a); - \n result.a += uColorMatrix[19]; - \n\n vec3 rgb = mix(color.rgb, result.rgb, uAlpha); - \n\n // Premultiply alpha again.\n rgb *= result.a; - \n\n finalColor = vec4(rgb, result.a); - \n} - \n",bf="struct GlobalFilterUniforms { - \n uInputSize:vec4<f32>,\n uInputPixel:vec4<f32>,\n uInputClamp:vec4<f32>,\n uOutputFrame:vec4<f32>,\n uGlobalFrame:vec4<f32>,\n uOutputTexture:vec4<f32>,\n} - ; - \n\nstruct ColorMatrixUniforms { - \n uColorMatrix:array<vec4<f32>, 5>,\n uAlpha:f32,\n} - ; - \n\n\n@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms; - \n@group(0) @binding(1) var uTexture: texture_2d<f32>; - \n@group(0) @binding(2) var uSampler : sampler; - \n@group(1) @binding(0) var<uniform> colorMatrixUniforms : ColorMatrixUniforms; - \n\n\nstruct VSOutput { - \n @builtin(position) position: vec4<f32>,\n @location(0) uv : vec2<f32>,\n } - ; - \n \nfn filterVertexPosition(aPosition:vec2<f32>) -> vec4<f32>\n{ - \n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy; - \n\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0; - \n position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z; - \n\n return vec4(position, 0.0, 1.0); - \n} - \n\nfn filterTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{ - \n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw); - \n} - \n\n@vertex\nfn mainVertex(\n @location(0) aPosition : vec2<f32>, \n) -> VSOutput { - \n return VSOutput(\n filterVertexPosition(aPosition),\n filterTextureCoord(aPosition),\n ); - \n} - \n\n\n@fragment\nfn mainFragment(\n @location(0) uv: vec2<f32>,\n) -> @location(0) vec4<f32> { - \n\n\n var c = textureSample(uTexture, uSampler, uv); - \n \n if (colorMatrixUniforms.uAlpha == 0.0) { - \n return c; - \n } - \n\n \n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (c.a > 0.0) { - \n c.r /= c.a; - \n c.g /= c.a; - \n c.b /= c.a; - \n } - \n\n var cm = colorMatrixUniforms.uColorMatrix; - \n\n\n var result = vec4<f32>(0.); - \n\n result.r = (cm[0][0] * c.r); - \n result.r += (cm[0][1] * c.g); - \n result.r += (cm[0][2] * c.b); - \n result.r += (cm[0][3] * c.a); - \n result.r += cm[1][0]; - \n\n result.g = (cm[1][1] * c.r); - \n result.g += (cm[1][2] * c.g); - \n result.g += (cm[1][3] * c.b); - \n result.g += (cm[2][0] * c.a); - \n result.g += cm[2][1]; - \n\n result.b = (cm[2][2] * c.r); - \n result.b += (cm[2][3] * c.g); - \n result.b += (cm[3][0] * c.b); - \n result.b += (cm[3][1] * c.a); - \n result.b += cm[3][2]; - \n\n result.a = (cm[3][3] * c.r); - \n result.a += (cm[4][0] * c.g); - \n result.a += (cm[4][1] * c.b); - \n result.a += (cm[4][2] * c.a); - \n result.a += cm[4][3]; - \n\n var rgb = mix(c.rgb, result.rgb, colorMatrixUniforms.uAlpha); - \n\n rgb.r *= result.a; - \n rgb.g *= result.a; - \n rgb.b *= result.a; - \n\n return vec4(rgb, result.a); - \n} - "; - const yf=class extends wr{ - constructor(t={ - } - ){ - const i=new hr({ - uColorMatrix:{ - value:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],type:"f32",size:20} - ,uAlpha:{ - value:1,type:"f32"} - } - ); - super({ - ...t,gpuProgram:tr.from({ - vertex:{ - source:bf,entryPoint:"mainVertex"} - ,fragment:{ - source:bf,entryPoint:"mainFragment"} - } - ),glProgram:Uh.from({ - vertex:af,fragment:Mf,name:"color-matrix-filter"} - ),resources:{ - colorMatrixUniforms:i} - } - ),this.alpha=1} - _loadMatrix(t,i=!1){ - if(i){ - const i=[...t]; - this._multiply(i,this.matrix,t),this.resources.colorMatrixUniforms.uniforms.uColorMatrix=i} - else this.resources.colorMatrixUniforms.uniforms.uColorMatrix=t; - this.resources.colorMatrixUniforms.update()} - _multiply(t,i,s){ - return t[0]=i[0]*s[0]+i[1]*s[5]+i[2]*s[10]+i[3]*s[15],t[1]=i[0]*s[1]+i[1]*s[6]+i[2]*s[11]+i[3]*s[16],t[2]=i[0]*s[2]+i[1]*s[7]+i[2]*s[12]+i[3]*s[17],t[3]=i[0]*s[3]+i[1]*s[8]+i[2]*s[13]+i[3]*s[18],t[4]=i[0]*s[4]+i[1]*s[9]+i[2]*s[14]+i[3]*s[19]+i[4],t[5]=i[5]*s[0]+i[6]*s[5]+i[7]*s[10]+i[8]*s[15],t[6]=i[5]*s[1]+i[6]*s[6]+i[7]*s[11]+i[8]*s[16],t[7]=i[5]*s[2]+i[6]*s[7]+i[7]*s[12]+i[8]*s[17],t[8]=i[5]*s[3]+i[6]*s[8]+i[7]*s[13]+i[8]*s[18],t[9]=i[5]*s[4]+i[6]*s[9]+i[7]*s[14]+i[8]*s[19]+i[9],t[10]=i[10]*s[0]+i[11]*s[5]+i[12]*s[10]+i[13]*s[15],t[11]=i[10]*s[1]+i[11]*s[6]+i[12]*s[11]+i[13]*s[16],t[12]=i[10]*s[2]+i[11]*s[7]+i[12]*s[12]+i[13]*s[17],t[13]=i[10]*s[3]+i[11]*s[8]+i[12]*s[13]+i[13]*s[18],t[14]=i[10]*s[4]+i[11]*s[9]+i[12]*s[14]+i[13]*s[19]+i[14],t[15]=i[15]*s[0]+i[16]*s[5]+i[17]*s[10]+i[18]*s[15],t[16]=i[15]*s[1]+i[16]*s[6]+i[17]*s[11]+i[18]*s[16],t[17]=i[15]*s[2]+i[16]*s[7]+i[17]*s[12]+i[18]*s[17],t[18]=i[15]*s[3]+i[16]*s[8]+i[17]*s[13]+i[18]*s[18],t[19]=i[15]*s[4]+i[16]*s[9]+i[17]*s[14]+i[18]*s[19]+i[19],t} - brightness(t,i){ - const s=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0]; - this._loadMatrix(s,i)} - tint(t,i){ - const[s,e,n]=Ks.shared.setValue(t).toArray(),h=[s,0,0,0,0,0,e,0,0,0,0,0,n,0,0,0,0,0,1,0]; - this._loadMatrix(h,i)} - greyscale(t,i){ - const s=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0]; - this._loadMatrix(s,i)} - grayscale(t,i){ - this.greyscale(t,i)} - blackAndWhite(t){ - this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)} - hue(t,i){ - t=(t||0)/180*Math.PI; - const s=Math.cos(t),e=Math.sin(t),n=1/3,h=(0,Math.sqrt)(n),r=[s+(1-s)*n,n*(1-s)-h*e,n*(1-s)+h*e,0,0,n*(1-s)+h*e,s+n*(1-s),n*(1-s)-h*e,0,0,n*(1-s)-h*e,n*(1-s)+h*e,s+n*(1-s),0,0,0,0,0,1,0]; - this._loadMatrix(r,i)} - contrast(t,i){ - const s=(t||0)+1,e=-.5*(s-1),n=[s,0,0,0,e,0,s,0,0,e,0,0,s,0,e,0,0,0,1,0]; - this._loadMatrix(n,i)} - saturate(t=0,i){ - const s=2*t/3+1,e=-.5*(s-1),n=[s,e,e,0,0,e,s,e,0,0,e,e,s,0,0,0,0,0,1,0]; - this._loadMatrix(n,i)} - desaturate(){ - this.saturate(-1)} - negative(t){ - this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)} - sepia(t){ - this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)} - technicolor(t){ - this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,.046249425232852304,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-.2758903984886823,-.231103377548616,-.7501899197440212,1.847597816108189,0,.12137623870388682,0,0,0,1,0],t)} - polaroid(t){ - this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)} - toBGR(t){ - this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)} - kodachrome(t){ - this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,.24991995145868634,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,.09698983488904393,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,.13972481597886063,0,0,0,1,0],t)} - browni(t){ - this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,.1860075629647401,-.037703249837783157,.8609577587992641,.15059552388459913,0,-.14497417640467167,.24113635128153335,-.07441037908422492,.44972182064877153,0,-.029655197167024642,0,0,0,1,0],t)} - vintage(t){ - this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,.037848179746251466,.02578397704808868,.6441188644374771,.03259127616149294,0,.029265996770472907,.0466055556782719,-.0851232987247891,.5241648018700465,0,.020232119953863904,0,0,0,1,0],t)} - colorTone(t,i,s,e,n){ - t||(t=.2),i||(i=.15),s||(s=16770432),e||(e=3375104); - const h=Ks.shared,[r,o,a]=h.setValue(s).toArray(),[c,l,u]=h.setValue(e).toArray(),d=[.3,.59,.11,0,0,r,o,a,t,0,c,l,u,i,0,r-c,o-l,a-u,0,0]; - this._loadMatrix(d,n)} - night(t,i){ - t||(t=.1); - const s=[-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0]; - this._loadMatrix(s,i)} - predator(t,i){ - const s=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0]; - this._loadMatrix(s,i)} - lsd(t){ - this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)} - reset(){ - this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)} - get matrix(){ - return this.resources.colorMatrixUniforms.uniforms.uColorMatrix} - set matrix(t){ - this.resources.colorMatrixUniforms.uniforms.uColorMatrix=t} - get alpha(){ - return this.resources.colorMatrixUniforms.uniforms.uAlpha} - set alpha(t){ - this.resources.colorMatrixUniforms.uniforms.uAlpha=t} - } - ; - Qt(yf,"ColorMatrixFilter"); - let Ef=yf; - var Af="in vec2 vTextureCoord; - \nout vec4 finalColor; - \nuniform sampler2D uTexture; - \nvoid main() { - \n finalColor = texture(uTexture, vTextureCoord); - \n} - \n",Sf="struct GlobalFilterUniforms { - \n uInputSize: vec4<f32>,\n uInputPixel: vec4<f32>,\n uInputClamp: vec4<f32>,\n uOutputFrame: vec4<f32>,\n uGlobalFrame: vec4<f32>,\n uOutputTexture: vec4<f32>,\n} - ; - \n\n@group(0) @binding(0) var <uniform> gfu: GlobalFilterUniforms; - \n@group(0) @binding(1) var uTexture: texture_2d<f32>; - \n@group(0) @binding(2) var uSampler: sampler; - \n\nstruct VSOutput { - \n @builtin(position) position: vec4<f32>,\n @location(0) uv: vec2<f32>\n} - ; - \n\nfn filterVertexPosition(aPosition: vec2<f32>) -> vec4<f32>\n{ - \n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy; - \n\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0; - \n position.y = position.y * (2.0 * gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z; - \n\n return vec4(position, 0.0, 1.0); - \n} - \n\nfn filterTextureCoord(aPosition: vec2<f32>) -> vec2<f32>\n{ - \n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw); - \n} - \n\n@vertex\nfn mainVertex(\n @location(0) aPosition: vec2<f32>,\n) -> VSOutput { - \n return VSOutput(\n filterVertexPosition(aPosition),\n filterTextureCoord(aPosition)\n ); - \n} - \n\n@fragment\nfn mainFragment(\n @location(0) uv: vec2<f32>,\n) -> @location(0) vec4<f32> { - \n return textureSample(uTexture, uSampler, uv); - \n} - \n"; - const Tf=class extends wr{ - constructor(){ - super({ - gpuProgram:tr.from({ - vertex:{ - source:Sf,entryPoint:"mainVertex"} - ,fragment:{ - source:Sf,entryPoint:"mainFragment"} - ,name:"passthrough-filter"} - ),glProgram:Uh.from({ - vertex:af,fragment:Af,name:"passthrough-filter"} - )} - )} - } - ; - Qt(Tf,"PassthroughFilter"); - let Cf=Tf; - const Of=class{ - constructor(t){ - this._renderer=t} - push(t,i,s){ - this._renderer.renderPipes.batch.break(s),s.add({ - renderPipeId:"filter",canBundle:!1,action:"pushFilter",container:i,filterEffect:t} - )} - pop(t,i,s){ - this._renderer.renderPipes.batch.break(s),s.add({ - renderPipeId:"filter",action:"popFilter",canBundle:!1} - )} - execute(t){ - "pushFilter"===t.action?this._renderer.filter.push(t):"popFilter"===t.action&&this._renderer.filter.pop()} - destroy(){ - this._renderer=null} - } - ; - Qt(Of,"FilterPipe"); - let If=Of; - function kf(t,i,s,e,n,h,r,o){ - const a=r-s,c=o-e,l=n-s,u=h-e,d=t-s,f=i-e,p=a*a+c*c,w=a*l+c*u,g=a*d+c*f,m=l*l+u*u,v=l*d+u*f,_=1/(p*m-w*w),M=(m*g-w*v)*_,b=(p*v-w*g)*_; - return M>=0&&b>=0&&M+b<1} - If.extension={ - type:[ri.WebGLPipes,ri.WebGPUPipes,ri.CanvasPipes],name:"filter"} - ,Qt(kf,"pointInTriangle"); - const xf=new Ci; - function Rf(t,i){ - i.clear(); - const s=i.matrix; - for(let e=0; - e<t.length; - e++){ - const s=t[e]; - if(s.globalDisplayStatus<7)continue; - const n=s.renderGroup??s.parentRenderGroup; - (null==n?void 0:n.isCachedAsTexture)?i.matrix=xf.copyFrom(n.textureOffsetInverseTransform).append(s.worldTransform):(null==n?void 0:n._parentCacheAsTextureRenderGroup)?i.matrix=xf.copyFrom(n._parentCacheAsTextureRenderGroup.inverseWorldTransform).append(s.groupTransform):i.matrix=s.worldTransform,i.addBounds(s.bounds)} - return i.matrix=s,i} - Qt(Rf,"getGlobalRenderableBounds"); - const Pf=new Qa({ - attributes:{ - aPosition:{ - buffer:new Float32Array([0,0,1,0,1,1,0,1]),format:"float32x2",stride:8,offset:0} - } - ,indexBuffer:new Uint32Array([0,1,2,0,2,3])} - ),Nf=class{ - constructor(){ - this.skip=!1,this.inputTexture=null,this.backTexture=null,this.filters=null,this.bounds=new ps,this.container=null,this.blendRequired=!1,this.outputRenderSurface=null,this.globalFrame={ - x:0,y:0,width:0,height:0} - ,this.firstEnabledIndex=-1,this.lastEnabledIndex=-1} - } - ; - Qt(Nf,"FilterData"); - let Lf=Nf; - const Df=class{ - constructor(t){ - this._filterStackIndex=0,this._filterStack=[],this._filterGlobalUniforms=new hr({ - uInputSize:{ - value:new Float32Array(4),type:"vec4<f32>"} - ,uInputPixel:{ - value:new Float32Array(4),type:"vec4<f32>"} - ,uInputClamp:{ - value:new Float32Array(4),type:"vec4<f32>"} - ,uOutputFrame:{ - value:new Float32Array(4),type:"vec4<f32>"} - ,uGlobalFrame:{ - value:new Float32Array(4),type:"vec4<f32>"} - ,uOutputTexture:{ - value:new Float32Array(4),type:"vec4<f32>"} - } - ),this._globalFilterBindGroup=new or({ - } - ),this.renderer=t} - get activeBackTexture(){ - var t; - return null==(t=this._activeFilterData)?void 0:t.backTexture} - push(t){ - const i=this.renderer,s=t.filterEffect.filters,e=this._pushFilterData(); - e.skip=!1,e.filters=s,e.container=t.container,e.outputRenderSurface=i.renderTarget.renderSurface; - const n=i.renderTarget.renderTarget.colorTexture.source,h=n.resolution,r=n.antialias; - if(s.every(t=>!t.enabled))return void(e.skip=!0); - const o=e.bounds; - if(this._calculateFilterArea(t,o),this._calculateFilterBounds(e,i.renderTarget.rootViewPort,r,h,1),e.skip)return; - const a=this._getPreviousFilterData(),c=this._findFilterResolution(h); - let l=0,u=0; - a&&(l=a.bounds.minX,u=a.bounds.minY),this._calculateGlobalFrame(e,l,u,c,n.width,n.height),this._setupFilterTextures(e,o,i,a)} - generateFilteredTexture({ - texture:t,filters:i} - ){ - const s=this._pushFilterData(); - this._activeFilterData=s,s.skip=!1,s.filters=i; - const e=t.source,n=e.resolution,h=e.antialias; - if(i.every(t=>!t.enabled))return s.skip=!0,t; - const r=s.bounds; - if(r.addRect(t.frame),this._calculateFilterBounds(s,r.rectangle,h,n,0),s.skip)return t; - const o=n; - this._calculateGlobalFrame(s,0,0,o,e.width,e.height),s.outputRenderSurface=Be.getOptimalTexture(r.width,r.height,s.resolution,s.antialias),s.backTexture=ls.EMPTY,s.inputTexture=t,this.renderer.renderTarget.finishRenderPass(),this._applyFiltersToTexture(s,!0); - const a=s.outputRenderSurface; - return a.source.alphaMode="premultiplied-alpha",a} - pop(){ - const t=this.renderer,i=this._popFilterData(); - i.skip||(t.globalUniforms.pop(),t.renderTarget.finishRenderPass(),this._activeFilterData=i,this._applyFiltersToTexture(i,!1),i.blendRequired&&Be.returnTexture(i.backTexture),Be.returnTexture(i.inputTexture))} - getBackTexture(t,i,s){ - const e=t.colorTexture.source._resolution,n=Be.getOptimalTexture(i.width,i.height,e,!1); - let h=i.minX,r=i.minY; - s&&(h-=s.minX,r-=s.minY),h=Math.floor(h*e),r=Math.floor(r*e); - const o=Math.ceil(i.width*e),a=Math.ceil(i.height*e); - return this.renderer.renderTarget.copyToTexture(t,n,{ - x:h,y:r} - ,{ - width:o,height:a} - ,{ - x:0,y:0} - ),n} - applyFilter(t,i,s,e){ - const n=this.renderer,h=this._activeFilterData,r=h.outputRenderSurface===s,o=n.renderTarget.rootRenderTarget.colorTexture.source._resolution,a=this._findFilterResolution(o); - let c=0,l=0; - if(r){ - const t=this._findPreviousFilterOffset(); - c=t.x,l=t.y} - this._updateFilterUniforms(i,s,h,c,l,a,r,e); - const u=t.enabled?t:this._getPassthroughFilter(); - this._setupBindGroupsAndRender(u,i,n)} - calculateSpriteMatrix(t,i){ - const s=this._activeFilterData,e=t.set(s.inputTexture._source.width,0,0,s.inputTexture._source.height,s.bounds.minX,s.bounds.minY),n=i.worldTransform.copyTo(Ci.shared),h=i.renderGroup||i.parentRenderGroup; - return h&&h.cacheToLocalTransform&&n.prepend(h.cacheToLocalTransform),n.invert(),e.prepend(n),e.scale(1/i.texture.orig.width,1/i.texture.orig.height),e.translate(i.anchor.x,i.anchor.y),e} - destroy(){ - var t; - null==(t=this._passthroughFilter)||t.destroy(!0),this._passthroughFilter=null} - _getPassthroughFilter(){ - return this._passthroughFilter??(this._passthroughFilter=new Cf),this._passthroughFilter} - _setupBindGroupsAndRender(t,i,s){ - if(s.renderPipes.uniformBatch){ - const t=s.renderPipes.uniformBatch.getUboResource(this._filterGlobalUniforms); - this._globalFilterBindGroup.setResource(t,0)} - else this._globalFilterBindGroup.setResource(this._filterGlobalUniforms,0); - this._globalFilterBindGroup.setResource(i.source,1),this._globalFilterBindGroup.setResource(i.source.style,2),t.groups[0]=this._globalFilterBindGroup,s.encoder.draw({ - geometry:Pf,shader:t,state:t._state,topology:"triangle-list"} - ),s.type===ar.WEBGL&&s.renderTarget.finishRenderPass()} - _setupFilterTextures(t,i,s,e){ - if(t.backTexture=ls.EMPTY,t.inputTexture=Be.getOptimalTexture(i.width,i.height,t.resolution,t.antialias),t.blendRequired){ - s.renderTarget.finishRenderPass(); - const n=s.renderTarget.getRenderTarget(t.outputRenderSurface); - t.backTexture=this.getBackTexture(n,i,null==e?void 0:e.bounds)} - s.renderTarget.bind(t.inputTexture,!0),s.globalUniforms.push({ - offset:i} - )} - _calculateGlobalFrame(t,i,s,e,n,h){ - const r=t.globalFrame; - r.x=i*e,r.y=s*e,r.width=n*e,r.height=h*e} - _updateFilterUniforms(t,i,s,e,n,h,r,o){ - const a=this._filterGlobalUniforms.uniforms,c=a.uOutputFrame,l=a.uInputSize,u=a.uInputPixel,d=a.uInputClamp,f=a.uGlobalFrame,p=a.uOutputTexture; - r?(c[0]=s.bounds.minX-e,c[1]=s.bounds.minY-n):(c[0]=0,c[1]=0),c[2]=t.frame.width,c[3]=t.frame.height,l[0]=t.source.width,l[1]=t.source.height,l[2]=1/l[0],l[3]=1/l[1],u[0]=t.source.pixelWidth,u[1]=t.source.pixelHeight,u[2]=1/u[0],u[3]=1/u[1],d[0]=.5*u[2],d[1]=.5*u[3],d[2]=t.frame.width*l[2]-.5*u[2],d[3]=t.frame.height*l[3]-.5*u[3]; - const w=this.renderer.renderTarget.rootRenderTarget.colorTexture; - f[0]=e*h,f[1]=n*h,f[2]=w.source.width*h,f[3]=w.source.height*h,i instanceof ls&&(i.source.resource=null); - const g=this.renderer.renderTarget.getRenderTarget(i); - this.renderer.renderTarget.bind(i,!!o),i instanceof ls?(p[0]=i.frame.width,p[1]=i.frame.height):(p[0]=g.width,p[1]=g.height),p[2]=g.isRoot?-1:1,this._filterGlobalUniforms.update()} - _findFilterResolution(t){ - let i=this._filterStackIndex-1; - for(; - i>0&&this._filterStack[i].skip; - )--i; - return i>0&&this._filterStack[i].inputTexture?this._filterStack[i].inputTexture.source._resolution:t} - _findPreviousFilterOffset(){ - let t=0,i=0,s=this._filterStackIndex; - for(; - s>0; - ){ - s--; - const e=this._filterStack[s]; - if(!e.skip){ - t=e.bounds.minX,i=e.bounds.minY; - break} - } - return{ - x:t,y:i} - } - _calculateFilterArea(t,i){ - if(t.renderables?Rf(t.renderables,i):t.filterEffect.filterArea?(i.clear(),i.addRect(t.filterEffect.filterArea),i.applyMatrix(t.container.worldTransform)):t.container.getFastGlobalBounds(!0,i),t.container){ - const s=(t.container.renderGroup||t.container.parentRenderGroup).cacheToLocalTransform; - s&&i.applyMatrix(s)} - } - _applyFiltersToTexture(t,i){ - const s=t.inputTexture,e=t.bounds,n=t.filters,h=t.firstEnabledIndex,r=t.lastEnabledIndex; - if(this._globalFilterBindGroup.setResource(s.source.style,2),this._globalFilterBindGroup.setResource(t.backTexture.source,3),h===r)n[h].apply(this,s,t.outputRenderSurface,i); - else{ - let s=t.inputTexture; - const o=Be.getOptimalTexture(e.width,e.height,s.source._resolution,!1); - let a=o; - for(let t=h; - t<r; - t++){ - const i=n[t]; - if(!i.enabled)continue; - i.apply(this,s,a,!0); - const e=s; - s=a,a=e} - n[r].apply(this,s,t.outputRenderSurface,i),Be.returnTexture(o)} - } - _calculateFilterBounds(t,i,s,e,n){ - var h; - const r=this.renderer,o=t.bounds,a=t.filters; - let c=1/0,l=0,u=!0,d=!1,f=!1,p=!0,w=-1,g=-1; - for(let m=0; - m<a.length; - m++){ - const t=a[m]; - if(t.enabled){ - if(-1===w&&(w=m),g=m,c=Math.min(c,"inherit"===t.resolution?e:t.resolution),l+=t.padding,"off"===t.antialias?u=!1:"inherit"===t.antialias&&u&&(u=s),t.clipToViewport||(p=!1),!(t.compatibleRenderers&r.type)){ - f=!1; - break} - if(t.blendRequired&&!((null==(h=r.backBuffer)?void 0:h.useBackBuffer)??1)){ - qs(),f=!1; - break} - f=!0,d||(d=t.blendRequired)} - } - f?(p&&o.fitBounds(0,i.width/e,0,i.height/e),o.scale(c).ceil().scale(1/c).pad((0|l)*n),o.isPositive?(t.antialias=u,t.resolution=c,t.blendRequired=d,t.firstEnabledIndex=w,t.lastEnabledIndex=g):t.skip=!0):t.skip=!0} - _popFilterData(){ - return this._filterStackIndex--,this._filterStack[this._filterStackIndex]} - _getPreviousFilterData(){ - let t,i=this._filterStackIndex-1; - for(; - i>0&&(i--,t=this._filterStack[i],t.skip); - ); - return t} - _pushFilterData(){ - let t=this._filterStack[this._filterStackIndex]; - return t||(t=this._filterStack[this._filterStackIndex]=new Lf),this._filterStackIndex++,t} - } - ; - Qt(Df,"FilterSystem"); - let Gf=Df; - Gf.extension={ - type:[ri.WebGLSystem,ri.WebGPUSystem],name:"filter"} - ; - var Bf="in vec2 vMaskCoord; - \nin vec2 vTextureCoord; - \n\nuniform sampler2D uTexture; - \nuniform sampler2D uMaskTexture; - \n\nuniform float uAlpha; - \nuniform vec4 uMaskClamp; - \nuniform float uInverse; - \n\nout vec4 finalColor; - \n\nvoid main(void)\n{ - \n float clip = step(3.5,\n step(uMaskClamp.x, vMaskCoord.x) +\n step(uMaskClamp.y, vMaskCoord.y) +\n step(vMaskCoord.x, uMaskClamp.z) +\n step(vMaskCoord.y, uMaskClamp.w)); - \n\n // TODO look into why this is needed\n float npmAlpha = uAlpha; - \n vec4 original = texture(uTexture, vTextureCoord); - \n vec4 masky = texture(uMaskTexture, vMaskCoord); - \n float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a); - \n\n float a = alphaMul * masky.r * npmAlpha * clip; - \n\n if (uInverse == 1.0) { - \n a = 1.0 - a; - \n } - \n\n finalColor = original * a; - \n} - \n",Uf="in vec2 aPosition; - \n\nout vec2 vTextureCoord; - \nout vec2 vMaskCoord; - \n\n\nuniform vec4 uInputSize; - \nuniform vec4 uOutputFrame; - \nuniform vec4 uOutputTexture; - \nuniform mat3 uFilterMatrix; - \n\nvec4 filterVertexPosition( vec2 aPosition )\n{ - \n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy; - \n \n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0; - \n position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z; - \n\n return vec4(position, 0.0, 1.0); - \n} - \n\nvec2 filterTextureCoord( vec2 aPosition )\n{ - \n return aPosition * (uOutputFrame.zw * uInputSize.zw); - \n} - \n\nvec2 getFilterCoord( vec2 aPosition )\n{ - \n return ( uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy; - \n} - \n\nvoid main(void)\n{ - \n gl_Position = filterVertexPosition(aPosition); - \n vTextureCoord = filterTextureCoord(aPosition); - \n vMaskCoord = getFilterCoord(aPosition); - \n} - \n",Ff="struct GlobalFilterUniforms { - \n uInputSize:vec4<f32>,\n uInputPixel:vec4<f32>,\n uInputClamp:vec4<f32>,\n uOutputFrame:vec4<f32>,\n uGlobalFrame:vec4<f32>,\n uOutputTexture:vec4<f32>,\n} - ; - \n\nstruct MaskUniforms { - \n uFilterMatrix:mat3x3<f32>,\n uMaskClamp:vec4<f32>,\n uAlpha:f32,\n uInverse:f32,\n} - ; - \n\n@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms; - \n@group(0) @binding(1) var uTexture: texture_2d<f32>; - \n@group(0) @binding(2) var uSampler : sampler; - \n\n@group(1) @binding(0) var<uniform> filterUniforms : MaskUniforms; - \n@group(1) @binding(1) var uMaskTexture: texture_2d<f32>; - \n\nstruct VSOutput { - \n @builtin(position) position: vec4<f32>,\n @location(0) uv : vec2<f32>,\n @location(1) filterUv : vec2<f32>,\n} - ; - \n\nfn filterVertexPosition(aPosition:vec2<f32>) -> vec4<f32>\n{ - \n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy; - \n\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0; - \n position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z; - \n\n return vec4(position, 0.0, 1.0); - \n} - \n\nfn filterTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{ - \n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw); - \n} - \n\nfn globalTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{ - \n return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw); - \n} - \n\nfn getFilterCoord(aPosition:vec2<f32> ) -> vec2<f32>\n{ - \n return ( filterUniforms.uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy; - \n} - \n\nfn getSize() -> vec2<f32>\n{ - \n return gfu.uGlobalFrame.zw; - \n} - \n\n@vertex\nfn mainVertex(\n @location(0) aPosition : vec2<f32>,\n) -> VSOutput { - \n return VSOutput(\n filterVertexPosition(aPosition),\n filterTextureCoord(aPosition),\n getFilterCoord(aPosition)\n ); - \n} - \n\n@fragment\nfn mainFragment(\n @location(0) uv: vec2<f32>,\n @location(1) filterUv: vec2<f32>,\n @builtin(position) position: vec4<f32>\n) -> @location(0) vec4<f32> { - \n\n var maskClamp = filterUniforms.uMaskClamp; - \n var uAlpha = filterUniforms.uAlpha; - \n\n var clip = step(3.5,\n step(maskClamp.x, filterUv.x) +\n step(maskClamp.y, filterUv.y) +\n step(filterUv.x, maskClamp.z) +\n step(filterUv.y, maskClamp.w)); - \n\n var mask = textureSample(uMaskTexture, uSampler, filterUv); - \n var source = textureSample(uTexture, uSampler, uv); - \n var alphaMul = 1.0 - uAlpha * (1.0 - mask.a); - \n\n var a: f32 = alphaMul * mask.r * uAlpha * clip; - \n\n if (filterUniforms.uInverse == 1.0) { - \n a = 1.0 - a; - \n } - \n\n return source * a; - \n} - \n"; - const $f=class extends wr{ - constructor(t){ - const{ - sprite:i,...s} - =t,e=new cs(i.texture),n=new hr({ - uFilterMatrix:{ - value:new Ci,type:"mat3x3<f32>"} - ,uMaskClamp:{ - value:e.uClampFrame,type:"vec4<f32>"} - ,uAlpha:{ - value:1,type:"f32"} - ,uInverse:{ - value:t.inverse?1:0,type:"f32"} - } - ); - super({ - ...s,gpuProgram:tr.from({ - vertex:{ - source:Ff,entryPoint:"mainVertex"} - ,fragment:{ - source:Ff,entryPoint:"mainFragment"} - } - ),glProgram:Uh.from({ - vertex:Uf,fragment:Bf,name:"mask-filter"} - ),clipToViewport:!1,resources:{ - filterUniforms:n,uMaskTexture:i.texture.source} - } - ),this.sprite=i,this._textureMatrix=e} - set inverse(t){ - this.resources.filterUniforms.uniforms.uInverse=t?1:0} - get inverse(){ - return 1===this.resources.filterUniforms.uniforms.uInverse} - apply(t,i,s,e){ - this._textureMatrix.texture=this.sprite.texture,t.calculateSpriteMatrix(this.resources.filterUniforms.uniforms.uFilterMatrix,this.sprite).prepend(this._textureMatrix.mapCoord),this.resources.uMaskTexture=this.sprite.texture.source,t.applyFilter(this,i,s,e)} - } - ; - Qt($f,"MaskFilter"); - let Hf=$f; - const Wf=class{ - constructor(){ - this.isBatchable=!1} - reset(){ - this.isBatchable=!1,this.context=null,this.graphicsData&&(this.graphicsData.destroy(),this.graphicsData=null)} - destroy(){ - this.reset()} - } - ; - Qt(Wf,"CanvasGraphicsContext"); - let Vf=Wf; - const jf=class{ - constructor(){ - this.instructions=new Ne} - init(){ - this.instructions.reset()} - destroy(){ - this.instructions.destroy(),this.instructions=null} - } - ; - Qt(jf,"CanvasGraphicsContextRenderData"); - let Kf=jf; - const zf=(Qt(C=class{ - constructor(t){ - this._renderer=t,this._managedContexts=new Yc({ - renderer:t,type:"resource",name:"graphicsContext"} - )} - init(t){ - C.defaultOptions.bezierSmoothness=(null==t?void 0:t.bezierSmoothness)??C.defaultOptions.bezierSmoothness} - getContextRenderData(t){ - return this.getGpuContext(t).graphicsData||this._initContextRenderData(t)} - updateGpuContext(t){ - const i=t._gpuData,s=!!i[this._renderer.uid],e=i[this._renderer.uid]||this._initContext(t); - return!t.dirty&&s||(s&&e.reset(),e.isBatchable=!1,t.dirty=!1),e} - getGpuContext(t){ - return t._gpuData[this._renderer.uid]||this._initContext(t)} - _initContextRenderData(t){ - const i=new Kf; - return this.getGpuContext(t).graphicsData=i,i.init(),i} - _initContext(t){ - const i=new Vf; - return i.context=t,t._gpuData[this._renderer.uid]=i,this._managedContexts.add(t),i} - destroy(){ - this._managedContexts.destroy(),this._renderer=null} - } - ,"_CanvasGraphicsContextSystem"),C); - zf.extension={ - type:[ri.CanvasSystem],name:"graphicsContext"} - ,zf.defaultOptions={ - bezierSmoothness:.5} - ; - let Yf=zf; - const qf=class{ - constructor(t,i){ - this.state=fr.for2d(),this.renderer=t,this._adaptor=i,this.renderer.runners.contextChange.add(this),this._managedGraphics=new Yc({ - renderer:t,type:"renderable",priority:-1,name:"graphics"} - )} - contextChange(){ - this._adaptor.contextChange(this.renderer)} - validateRenderable(t){ - return!1} - addRenderable(t,i){ - this._managedGraphics.add(t),this.renderer.renderPipes.batch.break(i),i.add(t)} - updateRenderable(t){ - } - execute(t){ - t.isRenderable&&this._adaptor.execute(this,t)} - destroy(){ - this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null} - } - ; - Qt(qf,"CanvasGraphicsPipe"); - let Xf=qf; - function Jf(t,i,s){ - const e=(t>>24&255)/255; - i[s++]=(255&t)/255*e,i[s++]=(t>>8&255)/255*e,i[s++]=(t>>16&255)/255*e,i[s++]=e} - Xf.extension={ - type:[ri.CanvasPipes],name:"graphics"} - ,Qt(Jf,"color32BitToUniform"); - const Qf=class{ - constructor(){ - this.batches=[],this.batched=!1} - destroy(){ - this.batches.forEach(t=>{ - te.return(t)} - ),this.batches.length=0} - } - ; - Qt(Qf,"GraphicsGpuData"); - let Zf=Qf; - const tp=class{ - constructor(t,i){ - this.state=fr.for2d(),this.renderer=t,this._adaptor=i,this.renderer.runners.contextChange.add(this),this._managedGraphics=new Yc({ - renderer:t,type:"renderable",priority:-1,name:"graphics"} - )} - contextChange(){ - this._adaptor.contextChange(this.renderer)} - validateRenderable(t){ - const i=t.context,s=!!t._gpuData,e=this.renderer.graphicsContext.updateGpuContext(i); - return!(!e.isBatchable&&s===e.isBatchable)} - addRenderable(t,i){ - const s=this.renderer.graphicsContext.updateGpuContext(t.context); - t.didViewUpdate&&this._rebuild(t),s.isBatchable?this._addToBatcher(t,i):(this.renderer.renderPipes.batch.break(i),i.add(t))} - updateRenderable(t){ - const i=this._getGpuDataForRenderable(t).batches; - for(let s=0; - s<i.length; - s++){ - const t=i[s]; - t._batcher.updateElement(t)} - } - execute(t){ - if(!t.isRenderable)return; - const i=this.renderer,s=t.context; - if(!i.graphicsContext.getGpuContext(s).batches.length)return; - const e=s.customShader||this._adaptor.shader; - this.state.blendMode=t.groupBlendMode; - const n=e.resources.localUniforms.uniforms; - n.uTransformMatrix=t.groupTransform,n.uRound=i._roundPixels|t._roundPixels,Jf(t.groupColorAlpha,n.uColor,0),this._adaptor.execute(this,t)} - _rebuild(t){ - const i=this._getGpuDataForRenderable(t),s=this.renderer.graphicsContext.updateGpuContext(t.context); - i.destroy(),s.isBatchable&&this._updateBatchesForRenderable(t,i)} - _addToBatcher(t,i){ - const s=this.renderer.renderPipes.batch,e=this._getGpuDataForRenderable(t).batches; - for(let n=0; - n<e.length; - n++){ - const t=e[n]; - s.addToBatch(t,i)} - } - _getGpuDataForRenderable(t){ - return t._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(t)} - _initGpuDataForRenderable(t){ - const i=new Zf; - return t._gpuData[this.renderer.uid]=i,this._managedGraphics.add(t),i} - _updateBatchesForRenderable(t,i){ - const s=t.context,e=this.renderer.graphicsContext.getGpuContext(s),n=this.renderer._roundPixels|t._roundPixels; - i.batches=e.batches.map(i=>{ - const s=te.get(tl); - return i.copyTo(s),s.renderable=t,s.roundPixels=n,s} - )} - destroy(){ - this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null} - } - ; - Qt(tp,"GraphicsPipe"); - let ip=tp; - ip.extension={ - type:[ri.WebGLPipes,ri.WebGPUPipes],name:"graphics"} - ,ci.add(Xf),ci.add(ip),ci.add(Yf),ci.add(Dl); - const sp=class t extends Ye{ - constructor(t){ - t instanceof Uu&&(t={ - context:t} - ); - const{ - context:i,roundPixels:s,...e} - =t||{ - } - ; - super({ - label:"Graphics",...e} - ),this.renderPipeId="graphics",i?this.context=i:(this.context=this._ownedContext=new Uu,this.context.autoGarbageCollect=this.autoGarbageCollect),this.didViewUpdate=!0,this.allowChildren=!1,this.roundPixels=s??!1} - set context(t){ - t!==this._context&&(this._context&&(this._context.off("update",this.onViewUpdate,this),this._context.off("unload",this.unload,this)),this._context=t,this._context.on("update",this.onViewUpdate,this),this._context.on("unload",this.unload,this),this.onViewUpdate())} - get context(){ - return this._context} - get bounds(){ - return this._context.bounds} - updateBounds(){ - } - containsPoint(t){ - return this._context.containsPoint(t)} - destroy(t){ - this._ownedContext&&!t?this._ownedContext.destroy(t):!0!==t&&!0!==(null==t?void 0:t.context)||this._context.destroy(t),this._ownedContext=null,this._context=null,super.destroy(t)} - _onTouch(t){ - this._gcLastUsed=t,this._context._gcLastUsed=t} - _callContextMethod(t,i){ - return this.context[t](...i),this} - setFillStyle(...t){ - return this._callContextMethod("setFillStyle",t)} - setStrokeStyle(...t){ - return this._callContextMethod("setStrokeStyle",t)} - fill(...t){ - return this._callContextMethod("fill",t)} - stroke(...t){ - return this._callContextMethod("stroke",t)} - texture(...t){ - return this._callContextMethod("texture",t)} - beginPath(){ - return this._callContextMethod("beginPath",[])} - cut(){ - return this._callContextMethod("cut",[])} - arc(...t){ - return this._callContextMethod("arc",t)} - arcTo(...t){ - return this._callContextMethod("arcTo",t)} - arcToSvg(...t){ - return this._callContextMethod("arcToSvg",t)} - bezierCurveTo(...t){ - return this._callContextMethod("bezierCurveTo",t)} - closePath(){ - return this._callContextMethod("closePath",[])} - ellipse(...t){ - return this._callContextMethod("ellipse",t)} - circle(...t){ - return this._callContextMethod("circle",t)} - path(...t){ - return this._callContextMethod("path",t)} - lineTo(...t){ - return this._callContextMethod("lineTo",t)} - moveTo(...t){ - return this._callContextMethod("moveTo",t)} - quadraticCurveTo(...t){ - return this._callContextMethod("quadraticCurveTo",t)} - rect(...t){ - return this._callContextMethod("rect",t)} - roundRect(...t){ - return this._callContextMethod("roundRect",t)} - poly(...t){ - return this._callContextMethod("poly",t)} - regularPoly(...t){ - return this._callContextMethod("regularPoly",t)} - roundPoly(...t){ - return this._callContextMethod("roundPoly",t)} - roundShape(...t){ - return this._callContextMethod("roundShape",t)} - filletRect(...t){ - return this._callContextMethod("filletRect",t)} - chamferRect(...t){ - return this._callContextMethod("chamferRect",t)} - star(...t){ - return this._callContextMethod("star",t)} - svg(...t){ - return this._callContextMethod("svg",t)} - restore(...t){ - return this._callContextMethod("restore",t)} - save(){ - return this._callContextMethod("save",[])} - getTransform(){ - return this.context.getTransform()} - resetTransform(){ - return this._callContextMethod("resetTransform",[])} - rotateTransform(...t){ - return this._callContextMethod("rotate",t)} - scaleTransform(...t){ - return this._callContextMethod("scale",t)} - setTransform(...t){ - return this._callContextMethod("setTransform",t)} - transform(...t){ - return this._callContextMethod("transform",t)} - translateTransform(...t){ - return this._callContextMethod("translate",t)} - clear(){ - return this._callContextMethod("clear",[])} - get fillStyle(){ - return this._context.fillStyle} - set fillStyle(t){ - this._context.fillStyle=t} - get strokeStyle(){ - return this._context.strokeStyle} - set strokeStyle(t){ - this._context.strokeStyle=t} - clone(i=!1){ - return i?new t(this._context.clone()):(this._ownedContext=null,new t(this._context))} - lineStyle(t,i,s){ - Yi(ji,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style."); - const e={ - } - ; - return t&&(e.width=t),i&&(e.color=i),s&&(e.alpha=s),this.context.strokeStyle=e,this} - beginFill(t,i){ - Yi(ji,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."); - const s={ - } - ; - return void 0!==t&&(s.color=t),void 0!==i&&(s.alpha=i),this.context.fillStyle=s,this} - endFill(){ - Yi(ji,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill(); - const t=this.context.strokeStyle; - return t.width===Uu.defaultStrokeStyle.width&&t.color===Uu.defaultStrokeStyle.color&&t.alpha===Uu.defaultStrokeStyle.alpha||this.context.stroke(),this} - drawCircle(...t){ - return Yi(ji,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",t)} - drawEllipse(...t){ - return Yi(ji,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",t)} - drawPolygon(...t){ - return Yi(ji,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",t)} - drawRect(...t){ - return Yi(ji,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",t)} - drawRoundedRect(...t){ - return Yi(ji,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",t)} - drawStar(...t){ - return Yi(ji,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",t)} - } - ; - Qt(sp,"Graphics"); - let ep=sp; - const np=(Qt(O=class extends Qa{ - constructor(...t){ - let i=t[0]??{ - } - ; - i instanceof Float32Array&&(Yi(ji,"use new MeshGeometry({ - positions, uvs, indices } - ) instead"),i={ - positions:i,uvs:t[1],indices:t[2]} - ),i={ - ...O.defaultOptions,...i} - ; - const s=i.positions||new Float32Array([0,0,1,0,1,1,0,1]); - let e=i.uvs; - e||(e=i.positions?new Float32Array(s.length):new Float32Array([0,0,1,0,1,1,0,1])); - const n=i.indices||new Uint32Array([0,1,2,0,2,3]),h=i.shrinkBuffersToFit; - super({ - attributes:{ - aPosition:{ - buffer:new za({ - data:s,label:"attribute-mesh-positions",shrinkToFit:h,usage:Ka.VERTEX|Ka.COPY_DST} - ),format:"float32x2",stride:8,offset:0} - ,aUV:{ - buffer:new za({ - data:e,label:"attribute-mesh-uvs",shrinkToFit:h,usage:Ka.VERTEX|Ka.COPY_DST} - ),format:"float32x2",stride:8,offset:0} - } - ,indexBuffer:new za({ - data:n,label:"index-mesh-buffer",shrinkToFit:h,usage:Ka.INDEX|Ka.COPY_DST} - ),topology:i.topology} - ),this.batchMode="auto"} - get positions(){ - return this.attributes.aPosition.buffer.data} - set positions(t){ - this.attributes.aPosition.buffer.data=t} - get uvs(){ - return this.attributes.aUV.buffer.data} - set uvs(t){ - this.attributes.aUV.buffer.data=t} - get indices(){ - return this.indexBuffer.data} - set indices(t){ - this.indexBuffer.data=t} - } - ,"_MeshGeometry"),O); - np.defaultOptions={ - topology:"triangle-list",shrinkBuffersToFit:!1} - ; - let hp=np; - const rp=class{ - constructor(){ - this.batcherName="default",this.packAsQuad=!1,this.indexOffset=0,this.attributeOffset=0,this.roundPixels=0,this._batcher=null,this._batch=null,this._textureMatrixUpdateId=-1,this._uvUpdateId=-1} - get blendMode(){ - return this.renderable.groupBlendMode} - get topology(){ - return this._topology||this.geometry.topology} - set topology(t){ - this._topology=t} - reset(){ - this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.geometry=null,this._uvUpdateId=-1,this._textureMatrixUpdateId=-1} - setTexture(t){ - this.texture!==t&&(this.texture=t,this._textureMatrixUpdateId=-1)} - get uvs(){ - const t=this.geometry.getBuffer("aUV"),i=t.data; - let s=i; - const e=this.texture.textureMatrix; - return e.isSimple||(s=this._transformedUvs,this._textureMatrixUpdateId===e._updateID&&this._uvUpdateId===t._updateID||((!s||s.length<i.length)&&(s=this._transformedUvs=new Float32Array(i.length)),this._textureMatrixUpdateId=e._updateID,this._uvUpdateId=t._updateID,e.multiplyUvs(i,s))),s} - get positions(){ - return this.geometry.positions} - get indices(){ - return this.geometry.indices} - get color(){ - return this.renderable.groupColorAlpha} - get groupTransform(){ - return this.renderable.groupTransform} - get attributeSize(){ - return this.geometry.positions.length/2} - get indexSize(){ - return this.geometry.indices.length} - } - ; - Qt(rp,"BatchableMesh"); - let op=rp; - const ap=class{ - destroy(){ - } - } - ; - Qt(ap,"MeshGpuData"); - let cp=ap; - const lp=class{ - constructor(t,i){ - this.localUniforms=new hr({ - uTransformMatrix:{ - value:new Ci,type:"mat3x3<f32>"} - ,uColor:{ - value:new Float32Array([1,1,1,1]),type:"vec4<f32>"} - ,uRound:{ - value:0,type:"f32"} - } - ),this.localUniformsBindGroup=new or({ - 0:this.localUniforms} - ),this.renderer=t,this._adaptor=i,this._adaptor.init()} - validateRenderable(t){ - const i=this._getMeshData(t),s=i.batched,e=t.batched; - if(i.batched=e,s!==e)return!0; - if(e){ - const s=t._geometry; - if(s.indices.length!==i.indexSize||s.positions.length!==i.vertexSize)return i.indexSize=s.indices.length,i.vertexSize=s.positions.length,!0; - const e=this._getBatchableMesh(t); - return e.texture.uid!==t._texture.uid&&(e._textureMatrixUpdateId=-1),!e._batcher.checkAndUpdateTexture(e,t._texture)} - return!1} - addRenderable(t,i){ - var s,e; - const n=this.renderer.renderPipes.batch,h=this._getMeshData(t); - if(t.didViewUpdate&&(h.indexSize=null==(s=t._geometry.indices)?void 0:s.length,h.vertexSize=null==(e=t._geometry.positions)?void 0:e.length),h.batched){ - const s=this._getBatchableMesh(t); - s.setTexture(t._texture),s.geometry=t._geometry,n.addToBatch(s,i)} - else n.break(i),i.add(t)} - updateRenderable(t){ - if(t.batched){ - const i=this._getBatchableMesh(t); - i.setTexture(t._texture),i.geometry=t._geometry,i._batcher.updateElement(i)} - } - execute(t){ - if(!t.isRenderable)return; - t.state.blendMode=Ia(t.groupBlendMode,t.texture._source); - const i=this.localUniforms; - i.uniforms.uTransformMatrix=t.groupTransform,i.uniforms.uRound=this.renderer._roundPixels|t._roundPixels,i.update(),Jf(t.groupColorAlpha,i.uniforms.uColor,0),this._adaptor.execute(this,t)} - _getMeshData(t){ - var i,s; - return(i=t._gpuData)[s=this.renderer.uid]||(i[s]=new cp),t._gpuData[this.renderer.uid].meshData||this._initMeshData(t)} - _initMeshData(t){ - return t._gpuData[this.renderer.uid].meshData={ - batched:t.batched,indexSize:0,vertexSize:0} - ,t._gpuData[this.renderer.uid].meshData} - _getBatchableMesh(t){ - var i,s; - return(i=t._gpuData)[s=this.renderer.uid]||(i[s]=new cp),t._gpuData[this.renderer.uid].batchableMesh||this._initBatchableMesh(t)} - _initBatchableMesh(t){ - const i=new op; - return i.renderable=t,i.setTexture(t._texture),i.transform=t.groupTransform,i.roundPixels=this.renderer._roundPixels|t._roundPixels,t._gpuData[this.renderer.uid].batchableMesh=i,i} - destroy(){ - this.localUniforms=null,this.localUniformsBindGroup=null,this._adaptor.destroy(),this._adaptor=null,this.renderer=null} - } - ; - Qt(lp,"MeshPipe"); - let up=lp; - up.extension={ - type:[ri.WebGLPipes,ri.WebGPUPipes],name:"mesh"} - ,ci.add(up); - const dp=class extends Ye{ - constructor(...t){ - let i=t[0]; - i instanceof Qa&&(Yi(ji,"Mesh: use new Mesh({ - geometry, shader } - ) instead"),i={ - geometry:i,shader:t[1]} - ,t[3]&&(Yi(ji,"Mesh: drawMode argument has been removed, use geometry.topology instead"),i.geometry.topology=t[3])); - const{ - geometry:s,shader:e,texture:n,roundPixels:h,state:r,...o} - =i; - super({ - label:"Mesh",...o} - ),this.renderPipeId="mesh",this._shader=null,this.allowChildren=!1,this.shader=e??null,this.texture=n??(null==e?void 0:e.texture)??ls.WHITE,this.state=r??fr.for2d(),this._geometry=s,this._geometry.on("update",this.onViewUpdate,this),this.roundPixels=h??!1} - get material(){ - return Yi(ji,"mesh.material property has been removed, use mesh.shader instead"),this._shader} - set shader(t){ - this._shader!==t&&(this._shader=t,this.onViewUpdate())} - get shader(){ - return this._shader} - set geometry(t){ - var i; - this._geometry!==t&&(null==(i=this._geometry)||i.off("update",this.onViewUpdate,this),t.on("update",this.onViewUpdate,this),this._geometry=t,this.onViewUpdate())} - get geometry(){ - return this._geometry} - set texture(t){ - t||(t=ls.EMPTY); - const i=this._texture; - i!==t&&(i&&i.dynamic&&i.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this.shader&&(this.shader.texture=t),this._texture=t,this.onViewUpdate())} - get texture(){ - return this._texture} - get batched(){ - return!this._shader&&!(12&this.state.data)&&this._geometry instanceof hp&&("auto"===this._geometry.batchMode?this._geometry.positions.length/2<=100:"batch"===this._geometry.batchMode)} - get bounds(){ - return this._geometry.bounds} - updateBounds(){ - this._bounds=this._geometry.bounds} - containsPoint(t){ - const{ - x:i,y:s} - =t; - if(!this.bounds.containsPoint(i,s))return!1; - const e=this.geometry.getBuffer("aPosition").data,n="triangle-strip"===this.geometry.topology?3:1; - if(this.geometry.getIndex()){ - const t=this.geometry.getIndex().data,h=t.length; - for(let r=0; - r+2<h; - r+=n){ - const n=2*t[r],h=2*t[r+1],o=2*t[r+2]; - if(kf(i,s,e[n],e[n+1],e[h],e[h+1],e[o],e[o+1]))return!0} - } - else{ - const t=e.length/2; - for(let h=0; - h+2<t; - h+=n){ - const t=2*h,n=2*(h+1),r=2*(h+2); - if(kf(i,s,e[t],e[t+1],e[n],e[n+1],e[r],e[r+1]))return!0} - } - return!1} - destroy(t){ - var i; - if(super.destroy(t),"boolean"==typeof t?t:null==t?void 0:t.texture){ - const i="boolean"==typeof t?t:null==t?void 0:t.textureSource; - this._texture.destroy(i)} - null==(i=this._geometry)||i.off("update",this.onViewUpdate,this),this._texture=null,this._geometry=null,this._shader=null} - } - ; - Qt(dp,"Mesh"); - let fp=dp; - const pp=class t extends Xe{ - constructor(...t){ - let i=t[0]; - Array.isArray(t[0])&&(i={ - textures:t[0],autoUpdate:t[1]} - ); - const{ - animationSpeed:s=1,autoPlay:e=!1,autoUpdate:n=!0,loop:h=!0,onComplete:r=null,onFrameChange:o=null,onLoop:a=null,textures:c,updateAnchor:l=!1,...u} - =i,[d]=c; - super({ - ...u,texture:d instanceof ls?d:d.texture} - ),this._textures=null,this._durations=null,this._autoUpdate=n,this._isConnectedToTicker=!1,this.animationSpeed=s,this.loop=h,this.updateAnchor=l,this.onComplete=r,this.onFrameChange=o,this.onLoop=a,this._currentTime=0,this._playing=!1,this._previousFrame=null,this.textures=c,e&&this.play()} - stop(){ - this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(Mn.shared.remove(this.update,this),this._isConnectedToTicker=!1))} - play(){ - this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(Mn.shared.add(this.update,this,wn.HIGH),this._isConnectedToTicker=!0))} - gotoAndStop(t){ - this.stop(),this.currentFrame=t} - gotoAndPlay(t){ - this.currentFrame=t,this.play()} - update(t){ - if(!this._playing)return; - const i=t.deltaTime,s=this.animationSpeed*i,e=this.currentFrame; - if(null!==this._durations){ - let t=this._currentTime%1*this._durations[this.currentFrame]; - for(t+=s/60*1e3; - t<0; - )this._currentTime--,t+=this._durations[this.currentFrame]; - const e=Math.sign(this.animationSpeed*i); - for(this._currentTime=Math.floor(this._currentTime); - t>=this._durations[this.currentFrame]; - )t-=this._durations[this.currentFrame]*e,this._currentTime+=e; - this._currentTime+=t/this._durations[this.currentFrame]} - else this._currentTime+=s; - this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):e!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<e||this.animationSpeed<0&&this.currentFrame>e)&&this.onLoop(),this._updateTexture())} - _updateTexture(){ - const t=this.currentFrame; - this._previousFrame!==t&&(this._previousFrame=t,this.texture=this._textures[t],this.updateAnchor&&this.texture.defaultAnchor&&this.anchor.copyFrom(this.texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))} - destroy(t=!1){ - if("boolean"==typeof t?t:null==t?void 0:t.texture){ - const i="boolean"==typeof t?t:null==t?void 0:t.textureSource; - this._textures.forEach(t=>{ - this.texture!==t&&t.destroy(i)} - )} - this._textures=[],this._durations=null,this.stop(),super.destroy(t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null} - static fromFrames(i){ - const s=[]; - for(let t=0; - t<i.length; - ++t)s.push(ls.from(i[t])); - return new t(s)} - static fromImages(i){ - const s=[]; - for(let t=0; - t<i.length; - ++t)s.push(ls.from(i[t])); - return new t(s)} - get totalFrames(){ - return this._textures.length} - get textures(){ - return this._textures} - set textures(t){ - if(t[0]instanceof ls)this._textures=t,this._durations=null; - else{ - this._textures=[],this._durations=[]; - for(let i=0; - i<t.length; - i++)this._textures.push(t[i].texture),this._durations.push(t[i].time)} - this._previousFrame=null,this.gotoAndStop(0),this._updateTexture()} - get currentFrame(){ - let t=Math.floor(this._currentTime)%this._textures.length; - return t<0&&(t+=this._textures.length),t} - set currentFrame(t){ - if(t<0||t>this.totalFrames-1)throw new Error(`[AnimatedSprite]: Invalid frame index value ${ - t} - , expected to be between 0 and totalFrames ${ - this.totalFrames} - .`); - const i=this.currentFrame; - this._currentTime=t,i!==this.currentFrame&&this._updateTexture()} - get playing(){ - return this._playing} - get autoUpdate(){ - return this._autoUpdate} - set autoUpdate(t){ - t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(Mn.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(Mn.shared.add(this.update,this),this._isConnectedToTicker=!0))} - } - ; - Qt(pp,"AnimatedSprite"); - let wp=pp; - const gp=class{ - constructor({ - matrix:t,observer:i} - ={ - } - ){ - this.dirty=!0,this._matrix=t??new Ci,this.observer=i,this.position=new fi(this,0,0),this.scale=new fi(this,1,1),this.pivot=new fi(this,0,0),this.skew=new fi(this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1} - get matrix(){ - const t=this._matrix; - return this.dirty?(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this.dirty=!1,t):t} - _onUpdate(t){ - var i; - this.dirty=!0,t===this.skew&&this.updateSkew(),null==(i=this.observer)||i._onUpdate(this)} - updateSkew(){ - this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this.dirty=!0} - toString(){ - return`[pixi.js/math:Transform position=(${ - this.position.x} - , ${ - this.position.y} - ) rotation=${ - this.rotation} - scale=(${ - this.scale.x} - , ${ - this.scale.y} - ) skew=(${ - this.skew.x} - , ${ - this.skew.y} - ) ]`} - setFromMatrix(t){ - t.decompose(this),this.dirty=!0} - get rotation(){ - return this._rotation} - set rotation(t){ - this._rotation!==t&&(this._rotation=t,this._onUpdate(this.skew))} - } - ; - Qt(gp,"Transform"); - let mp,vp=gp; - function _p(t){ - const i=ln.get().createCanvas(6,1),s=i.getContext("2d"); - return s.fillStyle=t,s.fillRect(0,0,6,1),i} - function Mp(){ - if(void 0!==mp)return mp; - try{ - const t=_p("#ff00ff"),i=_p("#ffff00"),s=ln.get().createCanvas(6,1).getContext("2d"); - s.globalCompositeOperation="multiply",s.drawImage(t,0,0),s.drawImage(i,2,0); - const e=s.getImageData(2,0,1,1); - if(e){ - const t=e.data; - mp=255===t[0]&&0===t[1]&&0===t[2]} - else mp=!1} - catch(t){ - mp=!1} - return mp} - Qt(_p,"createColoredCanvas"),Qt(Mp,"canUseNewCanvasBlendModes"); - const bp={ - canvas:null,convertTintToImage:!1,cacheStepsPerColorChannel:8,canUseMultiply:Mp(),tintMethod:null,_canvasSourceCache:new WeakMap,_unpremultipliedCache:new WeakMap,getCanvasSource:Qt(t=>{ - const i=t.source,s=null==i?void 0:i.resource; - if(!s)return null; - const e="premultiplied-alpha"===i.alphaMode,n=i.resourceWidth??i.pixelWidth,h=i.resourceHeight??i.pixelHeight,r=n!==i.pixelWidth||h!==i.pixelHeight; - if(e){ - if((s instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&s instanceof OffscreenCanvas)&&!r)return s; - const t=bp._unpremultipliedCache.get(i); - if((null==t?void 0:t.resourceId)===i._resourceId)return t.canvas} - if(s instanceof Uint8Array||s instanceof Uint8ClampedArray||s instanceof Int8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Uint32Array||s instanceof Int32Array||s instanceof Float32Array||s instanceof ArrayBuffer){ - const t=bp._canvasSourceCache.get(i); - if((null==t?void 0:t.resourceId)===i._resourceId)return t.canvas; - const e=ln.get().createCanvas(i.pixelWidth,i.pixelHeight),n=e.getContext("2d"),h=n.createImageData(i.pixelWidth,i.pixelHeight),r=h.data,o=s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength); - if("bgra8unorm"===i.format)for(let i=0; - i<r.length&&i+3<o.length; - i+=4)r[i]=o[i+2],r[i+1]=o[i+1],r[i+2]=o[i],r[i+3]=o[i+3]; - else r.set(o.subarray(0,r.length)); - return n.putImageData(h,0,0),bp._canvasSourceCache.set(i,{ - canvas:e,resourceId:i._resourceId} - ),e} - if(e){ - const t=ln.get().createCanvas(i.pixelWidth,i.pixelHeight),e=t.getContext("2d",{ - willReadFrequently:!0} - ); - t.width=i.pixelWidth,t.height=i.pixelHeight,e.drawImage(s,0,0); - const n=e.getImageData(0,0,t.width,t.height),h=n.data; - for(let i=0; - i<h.length; - i+=4){ - const t=h[i+3]; - if(t>0){ - const s=255/t; - h[i]=Math.min(255,h[i]*s+.5),h[i+1]=Math.min(255,h[i+1]*s+.5),h[i+2]=Math.min(255,h[i+2]*s+.5)} - } - return e.putImageData(n,0,0),bp._unpremultipliedCache.set(i,{ - canvas:t,resourceId:i._resourceId} - ),t} - if(r){ - const t=bp._canvasSourceCache.get(i); - if((null==t?void 0:t.resourceId)===i._resourceId)return t.canvas; - const e=ln.get().createCanvas(i.pixelWidth,i.pixelHeight),n=e.getContext("2d"); - return e.width=i.pixelWidth,e.height=i.pixelHeight,n.drawImage(s,0,0),bp._canvasSourceCache.set(i,{ - canvas:e,resourceId:i._resourceId} - ),e} - return s} - ,"getCanvasSource"),getTintedCanvas:Qt((t,i)=>{ - const s=t.texture,e=Ks.shared.setValue(i).toHex(),n=s.tintCache||(s.tintCache={ - } - ),h=n[e],r=s.source._resourceId; - if((null==h?void 0:h.tintId)===r)return h; - const o=h&&"getContext"in h?h:ln.get().createCanvas(); - return bp.tintMethod(s,i,o),o.tintId=r,n[e]=o,n[e]} - ,"getTintedCanvas"),getTintedPattern:Qt((t,i)=>{ - const s=Ks.shared.setValue(i).toHex(),e=t.patternCache||(t.patternCache={ - } - ),n=t.source._resourceId; - let h=e[s]; - return(null==h?void 0:h.tintId)===n||(bp.canvas||(bp.canvas=ln.get().createCanvas()),bp.tintMethod(t,i,bp.canvas),h=bp.canvas.getContext("2d").createPattern(bp.canvas,"repeat"),h.tintId=n,e[s]=h),h} - ,"getTintedPattern"),applyPatternTransform:Qt((t,i,s=!0)=>{ - if(!i)return; - const e=t; - if(!e.setTransform)return; - const n=globalThis.DOMMatrix; - if(!n)return; - const h=new n([i.a,i.b,i.c,i.d,i.tx,i.ty]); - e.setTransform(s?h.inverse():h)} - ,"applyPatternTransform"),tintWithMultiply:Qt((t,i,s)=>{ - const e=s.getContext("2d"),n=t.frame.clone(),h=t.source._resolution??t.source.resolution??1,r=t.rotate; - n.x*=h,n.y*=h,n.width*=h,n.height*=h; - const o=Bi.isVertical(r),a=o?n.height:n.width,c=o?n.width:n.height; - s.width=Math.ceil(a),s.height=Math.ceil(c),e.save(),e.fillStyle=Ks.shared.setValue(i).toHex(),e.fillRect(0,0,a,c),e.globalCompositeOperation="multiply"; - const l=bp.getCanvasSource(t); - l?(r&&bp._applyInverseRotation(e,r,n.width,n.height),e.drawImage(l,n.x,n.y,n.width,n.height,0,0,n.width,n.height),e.globalCompositeOperation="destination-atop",e.drawImage(l,n.x,n.y,n.width,n.height,0,0,n.width,n.height),e.restore()):e.restore()} - ,"tintWithMultiply"),tintWithOverlay:Qt((t,i,s)=>{ - const e=s.getContext("2d"),n=t.frame.clone(),h=t.source._resolution??t.source.resolution??1,r=t.rotate; - n.x*=h,n.y*=h,n.width*=h,n.height*=h; - const o=Bi.isVertical(r),a=o?n.height:n.width,c=o?n.width:n.height; - s.width=Math.ceil(a),s.height=Math.ceil(c),e.save(),e.globalCompositeOperation="copy",e.fillStyle=Ks.shared.setValue(i).toHex(),e.fillRect(0,0,a,c),e.globalCompositeOperation="destination-atop"; - const l=bp.getCanvasSource(t); - l?(r&&bp._applyInverseRotation(e,r,n.width,n.height),e.drawImage(l,n.x,n.y,n.width,n.height,0,0,n.width,n.height),e.restore()):e.restore()} - ,"tintWithOverlay"),tintWithPerPixel:Qt((t,i,s)=>{ - const e=s.getContext("2d"),n=t.frame.clone(),h=t.source._resolution??t.source.resolution??1,r=t.rotate; - n.x*=h,n.y*=h,n.width*=h,n.height*=h; - const o=Bi.isVertical(r),a=o?n.height:n.width,c=o?n.width:n.height; - s.width=Math.ceil(a),s.height=Math.ceil(c),e.save(),e.globalCompositeOperation="copy"; - const l=bp.getCanvasSource(t); - if(!l)return void e.restore(); - r&&bp._applyInverseRotation(e,r,n.width,n.height),e.drawImage(l,n.x,n.y,n.width,n.height,0,0,n.width,n.height),e.restore(); - const u=i>>16&255,d=i>>8&255,f=255&i,p=e.getImageData(0,0,a,c),w=p.data; - for(let g=0; - g<w.length; - g+=4)w[g]=w[g]*u/255,w[g+1]=w[g+1]*d/255,w[g+2]=w[g+2]*f/255; - e.putImageData(p,0,0)} - ,"tintWithPerPixel"),_applyInverseRotation:Qt((t,i,s,e)=>{ - const n=Bi.inv(i),h=Bi.uX(n),r=Bi.uY(n),o=Bi.vX(n),a=Bi.vY(n),c=-Math.min(0,h*s,o*e,h*s+o*e),l=-Math.min(0,r*s,a*e,r*s+a*e); - t.transform(h,r,o,a,c,l)} - ,"_applyInverseRotation")} - ; - bp.tintMethod=bp.canUseMultiply?bp.tintWithMultiply:bp.tintWithPerPixel; - const yp=new Ci,Ep=new Ci,Ap=[new Ai,new Ai,new Ai,new Ai],Sp=class{ - constructor(t){ - this._renderer=t} - validateRenderable(t){ - return!1} - addRenderable(t,i){ - this._renderer.renderPipes.batch.break(i),i.add(t)} - updateRenderable(t){ - } - execute(t){ - var i,s; - const e=this._renderer,n=e.canvasContext,h=n.activeContext; - h.save(),n.setBlendMode(t.groupBlendMode); - const r=(null==(i=e.globalUniforms.globalUniformData)?void 0:i.worldColor)??4294967295,o=t.groupColorAlpha,a=(r>>>24&255)/255*((o>>>24&255)/255)*((null==(s=e.filter)?void 0:s.alphaMultiplier)??1); - if(a<=0)return void h.restore(); - h.globalAlpha=a; - const c=ye(_e(16777215&o,16777215&r)),l=t.texture,u=bp.getTintedPattern(l,c),d=t.width,f=t.height,p=t.groupTransform,w=l.source._resolution??l.source.resolution??1; - Ep.copyFrom(t._tileTransform.matrix),t.applyAnchorToTexture||Ep.translate(-t.anchor.x*d,-t.anchor.y*f),Ep.scale(1/w,1/w),yp.identity(),yp.prepend(Ep),yp.prepend(p); - const g=e._roundPixels|t._roundPixels; - n.setContextTransform(yp,1===g),h.fillStyle=u; - const m=t.anchor.x*-d,v=t.anchor.y*-f; - Ap[0].set(m,v),Ap[1].set(m+d,v),Ap[2].set(m+d,v+f),Ap[3].set(m,v+f); - for(let _=0; - _<4; - _++)Ep.applyInverse(Ap[_],Ap[_]); - h.beginPath(),h.moveTo(Ap[0].x,Ap[0].y); - for(let _=1; - _<4; - _++)h.lineTo(Ap[_].x,Ap[_].y); - h.closePath(),h.fill(),h.restore()} - destroy(){ - this._renderer=null} - } - ; - Qt(Sp,"CanvasTilingSpritePipe"); - let Tp=Sp; - Tp.extension={ - type:[ri.CanvasPipes],name:"tilingSprite"} - ; - const Cp={ - name:"local-uniform-bit",vertex:{ - header:"\n\n struct LocalUniforms { - \n uTransformMatrix:mat3x3<f32>,\n uColor:vec4<f32>,\n uRound:f32,\n } - \n\n @group(1) @binding(0) var<uniform> localUniforms : LocalUniforms; - \n ",main:"\n vColor *= localUniforms.uColor; - \n modelMatrix *= localUniforms.uTransformMatrix; - \n ",end:"\n if(localUniforms.uRound == 1)\n { - \n vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw); - \n } - \n "} - } - ,Op={ - ...Cp,vertex:{ - ...Cp.vertex,header:Cp.vertex.header.replace("group(1)","group(2)")} - } - ,Ip={ - name:"local-uniform-bit",vertex:{ - header:"\n\n uniform mat3 uTransformMatrix; - \n uniform vec4 uColor; - \n uniform float uRound; - \n ",main:"\n vColor *= uColor; - \n modelMatrix = uTransformMatrix; - \n ",end:"\n if(uRound == 1.)\n { - \n gl_Position.xy = roundPixels(gl_Position.xy, uResolution); - \n } - \n "} - } - ,kp={ - name:"tiling-bit",vertex:{ - header:"\n struct TilingUniforms { - \n uMapCoord:mat3x3<f32>,\n uClampFrame:vec4<f32>,\n uClampOffset:vec2<f32>,\n uTextureTransform:mat3x3<f32>,\n uSizeAnchor:vec4<f32>\n } - ; - \n\n @group(2) @binding(0) var<uniform> tilingUniforms: TilingUniforms; - \n @group(2) @binding(1) var uTexture: texture_2d<f32>; - \n @group(2) @binding(2) var uSampler: sampler; - \n ",main:"\n uv = (tilingUniforms.uTextureTransform * vec3(uv, 1.0)).xy; - \n\n position = (position - tilingUniforms.uSizeAnchor.zw) * tilingUniforms.uSizeAnchor.xy; - \n "} - ,fragment:{ - header:"\n struct TilingUniforms { - \n uMapCoord:mat3x3<f32>,\n uClampFrame:vec4<f32>,\n uClampOffset:vec2<f32>,\n uTextureTransform:mat3x3<f32>,\n uSizeAnchor:vec4<f32>\n } - ; - \n\n @group(2) @binding(0) var<uniform> tilingUniforms: TilingUniforms; - \n @group(2) @binding(1) var uTexture: texture_2d<f32>; - \n @group(2) @binding(2) var uSampler: sampler; - \n ",main:"\n\n var coord = vUV + ceil(tilingUniforms.uClampOffset - vUV); - \n coord = (tilingUniforms.uMapCoord * vec3(coord, 1.0)).xy; - \n var unclamped = coord; - \n coord = clamp(coord, tilingUniforms.uClampFrame.xy, tilingUniforms.uClampFrame.zw); - \n\n var bias = 0.; - \n\n if(unclamped.x == coord.x && unclamped.y == coord.y)\n { - \n bias = -32.; - \n } - \n\n outColor = textureSampleBias(uTexture, uSampler, coord, bias); - \n "} - } - ,xp={ - name:"tiling-bit",vertex:{ - header:"\n uniform mat3 uTextureTransform; - \n uniform vec4 uSizeAnchor; - \n\n ",main:"\n uv = (uTextureTransform * vec3(aUV, 1.0)).xy; - \n\n position = (position - uSizeAnchor.zw) * uSizeAnchor.xy; - \n "} - ,fragment:{ - header:"\n uniform sampler2D uTexture; - \n uniform mat3 uMapCoord; - \n uniform vec4 uClampFrame; - \n uniform vec2 uClampOffset; - \n ",main:"\n\n vec2 coord = vUV + ceil(uClampOffset - vUV); - \n coord = (uMapCoord * vec3(coord, 1.0)).xy; - \n vec2 unclamped = coord; - \n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw); - \n\n outColor = texture(uTexture, coord, unclamped == coord ? 0.0 : -32.0); - // lod-bias very negative to force lod 0\n\n "} - } - ; - let Rp,Pp; - const Np=class extends lr{ - constructor(){ - Rp??(Rp=Cc({ - name:"tiling-sprite-shader",bits:[Cp,kp,Bc]} - )),Pp??(Pp=Oc({ - name:"tiling-sprite-shader",bits:[Ip,xp,Uc]} - )); - const t=new hr({ - uMapCoord:{ - value:new Ci,type:"mat3x3<f32>"} - ,uClampFrame:{ - value:new Float32Array([0,0,1,1]),type:"vec4<f32>"} - ,uClampOffset:{ - value:new Float32Array([0,0]),type:"vec2<f32>"} - ,uTextureTransform:{ - value:new Ci,type:"mat3x3<f32>"} - ,uSizeAnchor:{ - value:new Float32Array([100,100,.5,.5]),type:"vec4<f32>"} - } - ); - super({ - glProgram:Pp,gpuProgram:Rp,resources:{ - localUniforms:new hr({ - uTransformMatrix:{ - value:new Ci,type:"mat3x3<f32>"} - ,uColor:{ - value:new Float32Array([1,1,1,1]),type:"vec4<f32>"} - ,uRound:{ - value:0,type:"f32"} - } - ),tilingUniforms:t,uTexture:ls.EMPTY.source,uSampler:ls.EMPTY.source.style} - } - )} - updateUniforms(t,i,s,e,n,h){ - const r=this.resources.tilingUniforms,o=h.width,a=h.height,c=h.textureMatrix,l=r.uniforms.uTextureTransform; - l.set(s.a*o/t,s.b*o/i,s.c*a/t,s.d*a/i,s.tx/t,s.ty/i),l.invert(),r.uniforms.uMapCoord=c.mapCoord,r.uniforms.uClampFrame=c.uClampFrame,r.uniforms.uClampOffset=c.uClampOffset,r.uniforms.uTextureTransform=l,r.uniforms.uSizeAnchor[0]=t,r.uniforms.uSizeAnchor[1]=i,r.uniforms.uSizeAnchor[2]=e,r.uniforms.uSizeAnchor[3]=n,h&&(this.resources.uTexture=h.source,this.resources.uSampler=h.source.style)} - } - ; - Qt(Np,"TilingSpriteShader"); - let Lp=Np; - const Dp=class extends hp{ - constructor(){ - super({ - positions:new Float32Array([0,0,1,0,1,1,0,1]),uvs:new Float32Array([0,0,1,0,1,1,0,1]),indices:new Uint32Array([0,1,2,0,2,3])} - )} - } - ; - Qt(Dp,"QuadGeometry"); - let Gp=Dp; - function Bp(t,i){ - const s=t.anchor.x,e=t.anchor.y; - i[0]=-s*t.width,i[1]=-e*t.height,i[2]=(1-s)*t.width,i[3]=-e*t.height,i[4]=(1-s)*t.width,i[5]=(1-e)*t.height,i[6]=-s*t.width,i[7]=(1-e)*t.height} - function Up(t,i,s,e){ - let n=0; - const h=t.length/i,r=e.a,o=e.b,a=e.c,c=e.d,l=e.tx,u=e.ty; - for(s*=i; - n<h; - ){ - const e=t[s],h=t[s+1]; - t[s]=r*e+a*h+l,t[s+1]=o*e+c*h+u,s+=i,n++} - } - function Fp(t,i){ - const s=t.texture,e=s.frame.width,n=s.frame.height; - let h=0,r=0; - t.applyAnchorToTexture&&(h=t.anchor.x,r=t.anchor.y),i[0]=i[6]=-h,i[2]=i[4]=1-h,i[1]=i[3]=-r,i[5]=i[7]=1-r; - const o=Ci.shared; - o.copyFrom(t._tileTransform.matrix),o.tx/=t.width,o.ty/=t.height,o.invert(),o.scale(t.width/e,t.height/n),Up(i,2,0,o)} - Qt(Bp,"setPositions"),Qt(Up,"applyMatrix"),Qt(Fp,"setUvs"); - const $p=new Gp,Hp=class{ - constructor(){ - this.canBatch=!0,this.geometry=new hp({ - indices:$p.indices.slice(),positions:$p.positions.slice(),uvs:$p.uvs.slice()} - )} - destroy(){ - var t; - this.geometry.destroy(),null==(t=this.shader)||t.destroy()} - } - ; - Qt(Hp,"TilingSpriteGpuData"); - let Wp=Hp; - const Vp=class{ - constructor(t){ - this._state=fr.default2d,this._renderer=t,this._managedTilingSprites=new Yc({ - renderer:t,type:"renderable",name:"tilingSprite"} - )} - validateRenderable(t){ - const i=this._getTilingSpriteData(t),s=i.canBatch; - this._updateCanBatch(t); - const e=i.canBatch; - if(e&&e===s){ - const{ - batchableMesh:s} - =i; - return!s._batcher.checkAndUpdateTexture(s,t.texture)} - return s!==e} - addRenderable(t,i){ - const s=this._renderer.renderPipes.batch; - this._updateCanBatch(t); - const e=this._getTilingSpriteData(t),{ - geometry:n,canBatch:h} - =e; - if(h){ - e.batchableMesh||(e.batchableMesh=new op); - const h=e.batchableMesh; - t.didViewUpdate&&(this._updateBatchableMesh(t),h.geometry=n,h.renderable=t,h.transform=t.groupTransform,h.setTexture(t._texture)),h.roundPixels=this._renderer._roundPixels|t._roundPixels,s.addToBatch(h,i)} - else s.break(i),e.shader||(e.shader=new Lp),this.updateRenderable(t),i.add(t)} - execute(t){ - const i=this._renderer,{ - shader:s} - =this._getTilingSpriteData(t); - s.groups[0]=i.globalUniforms.bindGroup; - const e=s.resources.localUniforms.uniforms; - e.uTransformMatrix=t.groupTransform,e.uRound=i._roundPixels|t._roundPixels,Jf(t.groupColorAlpha,e.uColor,0),this._state.blendMode=Ia(t.groupBlendMode,t.texture._source),i.encoder.draw({ - geometry:$p,shader:s,state:this._state} - )} - updateRenderable(t){ - const i=this._getTilingSpriteData(t),{ - canBatch:s} - =i; - if(s){ - const{ - batchableMesh:s} - =i; - t.didViewUpdate&&this._updateBatchableMesh(t),s._batcher.updateElement(s)} - else if(t.didViewUpdate){ - const{ - shader:s} - =i; - s.updateUniforms(t.width,t.height,t._tileTransform.matrix,t.anchor.x,t.anchor.y,t.texture)} - } - _getTilingSpriteData(t){ - return t._gpuData[this._renderer.uid]||this._initTilingSpriteData(t)} - _initTilingSpriteData(t){ - const i=new Wp; - return i.renderable=t,t._gpuData[this._renderer.uid]=i,this._managedTilingSprites.add(t),i} - _updateBatchableMesh(t){ - const i=this._getTilingSpriteData(t),{ - geometry:s} - =i,e=t.texture.source.style; - "repeat"!==e.addressMode&&(e.addressMode="repeat",e.update()),Fp(t,s.uvs),Bp(t,s.positions)} - destroy(){ - this._managedTilingSprites.destroy(),this._renderer=null} - _updateCanBatch(t){ - const i=this._getTilingSpriteData(t),s=t.texture; - let e=!0; - return this._renderer.type===ar.WEBGL&&(e=this._renderer.context.supports.nonPowOf2wrapping),i.canBatch=s.textureMatrix.isSimple&&(e||s.source.isPowerOfTwo),i.canBatch} - } - ; - Qt(Vp,"TilingSpritePipe"); - let jp=Vp; - jp.extension={ - type:[ri.WebGLPipes,ri.WebGPUPipes],name:"tilingSprite"} - ,ci.add(Tp),ci.add(jp); - const Kp=(Qt(I=class extends Ye{ - constructor(...t){ - let i=t[0]||{ - } - ; - i instanceof ls&&(i={ - texture:i} - ),t.length>1&&(Yi(ji,"use new TilingSprite({ - texture, width:100, height:100 } - ) instead"),i.width=t[1],i.height=t[2]),i={ - ...I.defaultOptions,...i} - ; - const{ - texture:s,anchor:e,tilePosition:n,tileScale:h,tileRotation:r,width:o,height:a,applyAnchorToTexture:c,roundPixels:l,...u} - =i??{ - } - ; - super({ - label:"TilingSprite",...u} - ),this.renderPipeId="tilingSprite",this.batched=!0,this.allowChildren=!1,this._anchor=new fi({ - _onUpdate:Qt(()=>{ - this.onViewUpdate()} - ,"_onUpdate")} - ),this.applyAnchorToTexture=c,this.texture=s,this._width=o??s.width,this._height=a??s.height,this._tileTransform=new vp({ - observer:{ - _onUpdate:Qt(()=>this.onViewUpdate(),"_onUpdate")} - } - ),e&&(this.anchor=e),this.tilePosition=n,this.tileScale=h,this.tileRotation=r,this.roundPixels=l??!1} - static from(t,i={ - } - ){ - return new I("string"==typeof t?{ - texture:Tn.get(t),...i} - :{ - texture:t,...i} - )} - get uvRespectAnchor(){ - return Yi(ji,"uvRespectAnchor is deprecated, please use applyAnchorToTexture instead"),this.applyAnchorToTexture} - set uvRespectAnchor(t){ - Yi(ji,"uvRespectAnchor is deprecated, please use applyAnchorToTexture instead"),this.applyAnchorToTexture=t} - get clampMargin(){ - return this._texture.textureMatrix.clampMargin} - set clampMargin(t){ - this._texture.textureMatrix.clampMargin=t} - get anchor(){ - return this._anchor} - set anchor(t){ - "number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)} - get tilePosition(){ - return this._tileTransform.position} - set tilePosition(t){ - this._tileTransform.position.copyFrom(t)} - get tileScale(){ - return this._tileTransform.scale} - set tileScale(t){ - "number"==typeof t?this._tileTransform.scale.set(t):this._tileTransform.scale.copyFrom(t)} - set tileRotation(t){ - this._tileTransform.rotation=t} - get tileRotation(){ - return this._tileTransform.rotation} - get tileTransform(){ - return this._tileTransform} - set texture(t){ - t||(t=ls.EMPTY); - const i=this._texture; - i!==t&&(i&&i.dynamic&&i.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,this.onViewUpdate())} - get texture(){ - return this._texture} - set width(t){ - this._width=t,this.onViewUpdate()} - get width(){ - return this._width} - set height(t){ - this._height=t,this.onViewUpdate()} - get height(){ - return this._height} - setSize(t,i){ - "object"==typeof t&&(i=t.height??t.width,t=t.width),this._width=t,this._height=i??t,this.onViewUpdate()} - getSize(t){ - return t||(t={ - } - ),t.width=this._width,t.height=this._height,t} - updateBounds(){ - const t=this._bounds,i=this._anchor,s=this._width,e=this._height; - t.minX=-i._x*s,t.maxX=t.minX+s,t.minY=-i._y*e,t.maxY=t.minY+e} - containsPoint(t){ - const i=this._width,s=this._height,e=-i*this._anchor._x; - let n=0; - return t.x>=e&&t.x<=e+i&&(n=-s*this._anchor._y,t.y>=n&&t.y<=n+s)} - destroy(t=!1){ - if(super.destroy(t),this._anchor=null,this._tileTransform=null,this._bounds=null,"boolean"==typeof t?t:null==t?void 0:t.texture){ - const i="boolean"==typeof t?t:null==t?void 0:t.textureSource; - this._texture.destroy(i)} - this._texture=null} - } - ,"_TilingSprite"),I); - Kp.defaultOptions={ - texture:ls.EMPTY,anchor:{ - x:0,y:0} - ,tilePosition:{ - x:0,y:0} - ,tileScale:{ - x:1,y:1} - ,tileRotation:0,applyAnchorToTexture:!1} - ; - let zp=Kp; - const Yp=class extends Ye{ - constructor(t,i){ - const{ - text:s,resolution:e,style:n,anchor:h,width:r,height:o,roundPixels:a,...c} - =t; - super({ - ...c} - ),this.batched=!0,this._resolution=null,this._autoResolution=!0,this._didTextUpdate=!0,this._styleClass=i,this.text=s??"",this.style=n,this.resolution=e??null,this.allowChildren=!1,this._anchor=new fi({ - _onUpdate:Qt(()=>{ - this.onViewUpdate()} - ,"_onUpdate")} - ),h&&(this.anchor=h),this.roundPixels=a??!1,void 0!==r&&(this.width=r),void 0!==o&&(this.height=o)} - get anchor(){ - return this._anchor} - set anchor(t){ - "number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)} - set text(t){ - t=t.toString(),this._text!==t&&(this._text=t,this.onViewUpdate())} - get text(){ - return this._text} - set resolution(t){ - this._autoResolution=null===t,this._resolution=t,this.onViewUpdate()} - get resolution(){ - return this._resolution} - get style(){ - return this._style} - set style(t){ - var i; - t||(t={ - } - ),null==(i=this._style)||i.off("update",this.onViewUpdate,this),t instanceof this._styleClass?this._style=t:this._style=new this._styleClass(t),this._style.on("update",this.onViewUpdate,this),this.onViewUpdate()} - get width(){ - return Math.abs(this.scale.x)*this.bounds.width} - set width(t){ - this._setWidth(t,this.bounds.width)} - get height(){ - return Math.abs(this.scale.y)*this.bounds.height} - set height(t){ - this._setHeight(t,this.bounds.height)} - getSize(t){ - return t||(t={ - } - ),t.width=Math.abs(this.scale.x)*this.bounds.width,t.height=Math.abs(this.scale.y)*this.bounds.height,t} - setSize(t,i){ - "object"==typeof t?(i=t.height??t.width,t=t.width):i??(i=t),void 0!==t&&this._setWidth(t,this.bounds.width),void 0!==i&&this._setHeight(i,this.bounds.height)} - containsPoint(t){ - const i=this.bounds.width,s=this.bounds.height,e=-i*this.anchor.x; - let n=0; - return t.x>=e&&t.x<=e+i&&(n=-s*this.anchor.y,t.y>=n&&t.y<=n+s)} - onViewUpdate(){ - this.didViewUpdate||(this._didTextUpdate=!0),super.onViewUpdate()} - destroy(t=!1){ - super.destroy(t),this.owner=null,this._bounds=null,this._anchor=null,("boolean"==typeof t?t:null==t?void 0:t.style)&&this._style.destroy(t),this._style=null,this._text=null} - get styleKey(){ - return`${ - this._text} - :${ - this._style.styleKey} - :${ - this._resolution} - `} - } - ; - Qt(Yp,"AbstractText"); - let qp=Yp; - function Xp(t,i){ - let s=t[0]??{ - } - ; - return("string"==typeof s||t[1])&&(Yi(ji,`use new ${ - i} - ({ - text: "hi!", style } - ) instead`),s={ - text:s,style:t[1]} - ),s} - Qt(Xp,"ensureTextOptions"); - const Jp=class{ - constructor(t){ - this._canvasPool=Object.create(null),this.canvasOptions=t||{ - } - ,this.enableFullScreen=!1} - _createCanvasAndContext(t,i){ - const s=ln.get().createCanvas(); - s.width=t,s.height=i; - const e=s.getContext("2d"); - return{ - canvas:s,context:e} - } - getOptimalCanvasAndContext(t,i,s=1){ - t=Math.ceil(t*s-1e-6),i=Math.ceil(i*s-1e-6); - const e=((t=Xi(t))<<17)+((i=Xi(i))<<1); - this._canvasPool[e]||(this._canvasPool[e]=[]); - let n=this._canvasPool[e].pop(); - return n||(n=this._createCanvasAndContext(t,i)),n} - returnCanvasAndContext(t){ - const i=t.canvas,{ - width:s,height:e} - =i,n=(s<<17)+(e<<1); - t.context.resetTransform(),t.context.clearRect(0,0,s,e),this._canvasPool[n].push(t)} - clear(){ - this._canvasPool={ - } - } - } - ; - Qt(Jp,"CanvasPoolClass"); - let Qp=Jp; - const Zp=new Qp; - Xs.register(Zp); - let tw=null,iw=null; - function sw(t,i){ - tw||(tw=ln.get().createCanvas(256,128),iw=tw.getContext("2d",{ - willReadFrequently:!0} - ),iw.globalCompositeOperation="copy",iw.globalAlpha=1),(tw.width<t||tw.height<i)&&(tw.width=Xi(t),tw.height=Xi(i))} - function ew(t,i,s){ - for(let e=0,n=4*s*i; - e<i; - ++e,n+=4)if(0!==t[n+3])return!1; - return!0} - function nw(t,i,s,e,n){ - const h=4*i; - for(let r=e,o=e*h+4*s; - r<=n; - ++r,o+=h)if(0!==t[o+3])return!1; - return!0} - function hw(...t){ - let i=t[0]; - i.canvas||(i={ - canvas:t[0],resolution:t[1]} - ); - const{ - canvas:s} - =i,e=Math.min(i.resolution??1,1),n=i.width??s.width,h=i.height??s.height; - let r=i.output; - if(sw(n,h),!iw)throw new TypeError("Failed to get canvas 2D context"); - iw.drawImage(s,0,0,n,h,0,0,n*e,h*e); - const o=iw.getImageData(0,0,n,h).data; - let a=0,c=0,l=n-1,u=h-1; - for(; - c<h&&ew(o,n,c); - )++c; - if(c===h)return $i.EMPTY; - for(; - ew(o,n,u); - )--u; - for(; - nw(o,n,a,c,u); - )++a; - for(; - nw(o,n,l,c,u); - )--l; - return++l,++u,iw.globalCompositeOperation="source-over",iw.strokeRect(a,c,l-a,u-c),iw.globalCompositeOperation="copy",r??(r=new $i),r.set(a/e,c/e,(l-a)/e,(u-c)/e),r} - Qt(sw,"ensureInternalCanvas"),Qt(ew,"checkRow"),Qt(nw,"checkColumn"),Qt(hw,"getCanvasBoundingBox"); - const rw=class{ - constructor(t=0,i=0,s=!1){ - this.first=null,this.items=Object.create(null),this.last=null,this.max=t,this.resetTtl=s,this.size=0,this.ttl=i} - clear(){ - return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this} - delete(t){ - if(this.has(t)){ - const i=this.items[t]; - delete this.items[t],this.size--,null!==i.prev&&(i.prev.next=i.next),null!==i.next&&(i.next.prev=i.prev),this.first===i&&(this.first=i.next),this.last===i&&(this.last=i.prev)} - return this} - entries(t=this.keys()){ - const i=new Array(t.length); - for(let s=0; - s<t.length; - s++){ - const e=t[s]; - i[s]=[e,this.get(e)]} - return i} - evict(t=!1){ - if(t||this.size>0){ - const t=this.first; - delete this.items[t.key],0===--this.size?(this.first=null,this.last=null):(this.first=t.next,this.first.prev=null)} - return this} - expiresAt(t){ - let i; - return this.has(t)&&(i=this.items[t].expiry),i} - get(t){ - const i=this.items[t]; - if(void 0!==i)return this.ttl>0&&i.expiry<=Date.now()?void this.delete(t):(this.moveToEnd(i),i.value)} - has(t){ - return t in this.items} - moveToEnd(t){ - this.last!==t&&(null!==t.prev&&(t.prev.next=t.next),null!==t.next&&(t.next.prev=t.prev),this.first===t&&(this.first=t.next),t.prev=this.last,t.next=null,null!==this.last&&(this.last.next=t),this.last=t,null===this.first&&(this.first=t))} - keys(){ - const t=new Array(this.size); - let i=this.first,s=0; - for(; - null!==i; - )t[s++]=i.key,i=i.next; - return t} - setWithEvicted(t,i,s=this.resetTtl){ - let e=null; - if(this.has(t))this.set(t,i,!0,s); - else{ - this.max>0&&this.size===this.max&&(e={ - ...this.first} - ,this.evict(!0)); - let s=this.items[t]={ - expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:i} - ; - 1===++this.size?this.first=s:this.last.next=s,this.last=s} - return e} - set(t,i,s=!1,e=this.resetTtl){ - let n=this.items[t]; - return s||void 0!==n?(n.value=i,!1===s&&e&&(n.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),this.moveToEnd(n)):(this.max>0&&this.size===this.max&&this.evict(!0),n=this.items[t]={ - expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:i} - ,1===++this.size?this.first=n:this.last.next=n,this.last=n),this} - values(t=this.keys()){ - const i=new Array(t.length); - for(let s=0; - s<t.length; - s++)i[s]=this.get(t[s]); - return i} - } - ; - Qt(rw,"LRU"); - let ow=rw; - function aw(t=1e3,i=0,s=!1){ - if(isNaN(t)||t<0)throw new TypeError("Invalid max value"); - if(isNaN(i)||i<0)throw new TypeError("Invalid ttl value"); - if("boolean"!=typeof s)throw new TypeError("Invalid resetTtl value"); - return new ow(t,i,s)} - function cw(t){ - return!!t.tagStyles&&Object.keys(t.tagStyles).length>0} - function lw(t){ - return t.includes("<")} - function uw(t,i){ - return t.clone().assign(i)} - function dw(t,i){ - const s=[],e=i.tagStyles; - if(!cw(i)||!lw(t))return s.push({ - text:t,style:i} - ),s; - const n=[i],h=[]; - let r="",o=0; - for(; - o<t.length; - ){ - const i=t[o]; - if("<"===i){ - const a=t.indexOf(">",o); - if(-1===a){ - r+=i,o++; - continue} - const c=t.slice(o+1,a); - if(c.startsWith("/")){ - const i=c.slice(1).trim(); - if(h.length>0&&h[h.length-1]===i){ - r.length>0&&(s.push({ - text:r,style:n[n.length-1]} - ),r=""),n.pop(),h.pop(),o=a+1; - continue} - r+=t.slice(o,a+1),o=a+1; - continue} - { - const i=c.trim(); - if(e[i]){ - r.length>0&&(s.push({ - text:r,style:n[n.length-1]} - ),r=""); - const t=uw(n[n.length-1],e[i]); - n.push(t),h.push(i),o=a+1; - continue} - r+=t.slice(o,a+1),o=a+1; - continue} - } - r+=i,o++} - return r.length>0&&s.push({ - text:r,style:n[n.length-1]} - ),s} - Qt(aw,"lru"),Qt(cw,"hasTagStyles"),Qt(lw,"hasTagMarkup"),Qt(uw,"createMergedStyle"),Qt(dw,"parseTaggedText"); - const fw=[10,13],pw=new Set(fw),ww=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288],gw=new Set(ww),mw=[9,32],vw=new Set(mw),_w=[45,8208,8211,8212,173],Mw=new Set(_w),bw=/(\r\n|\r|\n)/,yw=/(?:\r\n|\r|\n)/; - function Ew(t){ - return"string"==typeof t&&pw.has(t.charCodeAt(0))} - function Aw(t,i){ - return"string"==typeof t&&gw.has(t.charCodeAt(0))} - function Sw(t){ - return"string"==typeof t&&vw.has(t.charCodeAt(0))} - function Tw(t){ - return"string"==typeof t&&Mw.has(t.charCodeAt(0))} - function Cw(t){ - return"normal"===t||"pre-line"===t} - function Ow(t){ - return"normal"===t} - function Iw(t){ - if("string"!=typeof t)return""; - let i=t.length-1; - for(; - i>=0&&Aw(t[i]); - )i--; - return i<t.length-1?t.slice(0,i+1):t} - function kw(t){ - const i=[],s=[]; - if("string"!=typeof t)return i; - for(let e=0; - e<t.length; - e++){ - const n=t[e],h=t[e+1]; - Aw(n)||Ew(n)?(s.length>0&&(i.push(s.join("")),s.length=0),"\r"===n&&"\n"===h?(i.push("\r\n"),e++):i.push(n)):(s.push(n),Tw(n)&&h&&!Aw(h)&&!Ew(h)&&(i.push(s.join("")),s.length=0))} - return s.length>0&&i.push(s.join("")),i} - function xw(t,i,s,e){ - const n=s(t),h=[]; - for(let r=0; - r<n.length; - r++){ - let s=n[r],o=s,a=1; - for(; - n[r+a]; - ){ - const h=n[r+a]; - if(e(o,h,t,r,i))break; - s+=h,o=h,a++} - r+=a-1,h.push(s)} - return h} - Qt(Ew,"isNewline"),Qt(Aw,"isBreakingSpace"),Qt(Sw,"isCollapsibleSpace"),Qt(Tw,"isBreakAfterChar"),Qt(Cw,"collapseSpaces"),Qt(Ow,"collapseNewlines"),Qt(Iw,"trimRight"),Qt(kw,"tokenize"),Qt(xw,"getCharacterGroups"); - const Rw=/\r\n|\r|\n/g; - function Pw(t,i,s,e,n,h,r,o){ - var a,c; - const l=dw(t,i); - if(Ow(i.whiteSpace))for(let C=0; - C<l.length; - C++){ - const t=l[C]; - l[C]={ - text:t.text.replace(Rw," "),style:t.style} - } - const u=[]; - let d=[]; - for(const C of l){ - const t=C.text.split(bw); - for(let i=0; - i<t.length; - i++){ - const s=t[i]; - "\r\n"===s||"\r"===s||"\n"===s?(u.push(d),d=[]):s.length>0&&d.push({ - text:s,style:C.style} - )} - } - (d.length>0||0===u.length)&&u.push(d); - const f=s?Nw(u,i,e,n,r,o):u,p=[],w=[],g=[],m=[],v=[]; - let _=0; - const M=h(i._fontString); - 0===M.fontSize&&(M.fontSize=i.fontSize,M.ascent=i.fontSize); - let b="",y=!!i.dropShadow,E=(null==(a=i._stroke)?void 0:a.width)||0; - for(const C of f){ - let t=0,s=M.ascent,r=M.descent,o=""; - for(const i of C){ - const a=i.style._fontString,l=h(a); - a!==b&&(e.font=a,b=a),t+=n(i.text,i.style.letterSpacing,e),s=Math.max(s,l.ascent),r=Math.max(r,l.descent),o+=i.text; - const u=(null==(c=i.style._stroke)?void 0:c.width)||0; - u>E&&(E=u),!y&&i.style.dropShadow&&(y=!0)} - 0===C.length&&(s=M.ascent,r=M.descent),p.push(t),w.push(s),g.push(r),v.push(o); - const a=i.lineHeight||s+r; - m.push(a+i.leading),_=Math.max(_,t)} - const A=E,S=(s&&"left"!==i.align?Math.max(_,i.wordWrapWidth):_)+A+(i.dropShadow?i.dropShadow.distance:0); - let T=0; - for(let C=0; - C<m.length; - C++)T+=m[C]; - return T=Math.max(T,m[0]+A),{ - width:S,height:T+(i.dropShadow?i.dropShadow.distance:0),lines:v,lineWidths:p,lineHeight:(i.lineHeight||M.fontSize)+i.leading,maxLineWidth:_,fontProperties:M,runsByLine:f,lineAscents:w,lineDescents:g,lineHeights:m,hasDropShadow:y} - } - function Nw(t,i,s,e,n,h){ - var r; - const{ - letterSpacing:o,whiteSpace:a,wordWrapWidth:c,breakWords:l} - =i,u=Cw(a),d=c+o,f={ - } - ; - let p=""; - const w=Qt((t,i)=>{ - const n=`${ - t} - |${ - i.styleKey} - `; - let h=f[n]; - if(void 0===h){ - const r=i._fontString; - r!==p&&(s.font=r,p=r),h=e(t,i.letterSpacing,s)+i.letterSpacing,f[n]=h} - return h} - ,"measureTokenWidth"),g=[]; - for(const m of t){ - const t=Lw(m),i=g.length,s=Qt(i=>{ - let s=0,e=i; - do{ - const{ - token:i,style:n} - =t[e]; - s+=w(i,n),e++} - while(e<t.length&&t[e].continuesFromPrevious); - return s} - ,"getWordGroupWidth"),e=Qt(i=>{ - const s=[]; - let e=i; - do{ - s.push({ - token:t[e].token,style:t[e].style} - ),e++} - while(e<t.length&&t[e].continuesFromPrevious); - return s} - ,"getWordGroupTokens"); - let o=[],a=0,c=!u,f=null; - const p=Qt(()=>{ - f&&f.text.length>0&&o.push(f),f=null} - ,"flushBuildingRun"),v=Qt(()=>{ - if(p(),o.length>0){ - const t=o[o.length-1]; - t.text=Iw(t.text),0===t.text.length&&o.pop()} - g.push(o),o=[],a=0,c=!1} - ,"startNewLine"); - for(let m=0; - m<t.length; - m++){ - const{ - token:i,style:_,continuesFromPrevious:M} - =t[m],b=w(i,_); - if(u){ - const t=Aw(i),s=(null==f?void 0:f.text[f.text.length-1])??(null==(r=o[o.length-1])?void 0:r.text.slice(-1))??"",e=!!s&&Aw(s); - if(t&&e)continue} - const y=!M,E=y?s(m):b; - if(E>d&&y)if(a>0&&v(),l){ - const t=e(m); - for(let i=0; - i<t.length; - i++){ - const s=t[i].token,e=t[i].style,r=xw(s,l,h,n); - for(const t of r){ - const i=w(t,e); - i+a>d&&v(),f&&f.style===e?f.text+=t:(p(),f={ - text:t,style:e} - ),a+=i} - } - m+=t.length-1} - else{ - const t=e(m); - p(),g.push(t.map(t=>({ - text:t.token,style:t.style} - ))),c=!1,m+=t.length-1} - else if(E+a>d&&y){ - if(Aw(i)){ - c=!1; - continue} - v(),f={ - text:i,style:_} - ,a=b} - else if(M&&!l)f&&f.style===_?f.text+=i:(p(),f={ - text:i,style:_} - ),a+=b; - else{ - const t=Aw(i); - if(0===a&&t&&!c)continue; - f&&f.style===_?f.text+=i:(p(),f={ - text:i,style:_} - ),a+=b} - } - if(p(),o.length>0){ - const t=o[o.length-1]; - t.text=Iw(t.text),0===t.text.length&&o.pop()} - (o.length>0||g.length===i)&&g.push(o)} - return g} - function Lw(t){ - const i=[]; - let s=!1; - for(const e of t){ - const t=kw(e.text); - let n=!0; - for(const h of t){ - const t=Aw(h)||Ew(h),r=n&&s&&!t; - i.push({ - token:h,style:e.style,continuesFromPrevious:r} - ),s=!t,n=!1} - } - return i} - Qt(Pw,"measureTaggedText"),Qt(Nw,"wordWrapTaggedLines"),Qt(Lw,"tokenizeTaggedRuns"); - const Dw={ - willReadFrequently:!0} - ; - function Gw(t,i,s,e,n){ - let h=s[t]; - return"number"!=typeof h&&(h=n(t,i,e)+i,s[t]=h),h} - function Bw(t,i,s,e,n,h,r){ - const o=s.getContext("2d",Dw); - o.font=i._fontString; - let a=0,c=""; - const l=[],u=Object.create(null),{ - letterSpacing:d,whiteSpace:f} - =i,p=Cw(f),w=Ow(f); - let g=!p; - const m=i.wordWrapWidth+d,v=kw(t); - for(let M=0; - M<v.length; - M++){ - let t=v[M]; - if(Ew(t)){ - if(!w){ - l.push(Iw(c)),g=!p,c="",a=0; - continue} - t=" "} - if(p){ - const i=Aw(t),s=Aw(c[c.length-1]); - if(i&&s)continue} - const s=Gw(t,d,u,o,e); - if(s>m)if(""!==c&&(l.push(Iw(c)),c="",a=0),n(t,i.breakWords)){ - const s=xw(t,i.breakWords,r,h); - for(const t of s){ - const i=Gw(t,d,u,o,e); - i+a>m&&(l.push(Iw(c)),g=!1,c="",a=0),c+=t,a+=i} - } - else c.length>0&&(l.push(Iw(c)),c="",a=0),l.push(Iw(t)),g=!1,c="",a=0; - else s+a>m&&(g=!1,l.push(Iw(c)),c="",a=0),(c.length>0||!Aw(t)||g)&&(c+=t,a+=s)} - const _=Iw(c); - return _.length>0&&l.push(_),l.join("\n")} - Qt(Gw,"getFromCache"),Qt(Bw,"wordWrap"); - const Uw={ - willReadFrequently:!0} - ,Fw=(k=class{ - static get experimentalLetterSpacingSupported(){ - let t=k._experimentalLetterSpacingSupported; - if(void 0===t){ - const i=ln.get().getCanvasRenderingContext2D().prototype; - t=k._experimentalLetterSpacingSupported="letterSpacing"in i||"textLetterSpacing"in i} - return t} - constructor(t,i,s,e,n,h,r,o,a,c){ - this.text=t,this.style=i,this.width=s,this.height=e,this.lines=n,this.lineWidths=h,this.lineHeight=r,this.maxLineWidth=o,this.fontProperties=a,c&&(this.runsByLine=c.runsByLine,this.lineAscents=c.lineAscents,this.lineDescents=c.lineDescents,this.lineHeights=c.lineHeights,this.hasDropShadow=c.hasDropShadow)} - static measureText(t=" ",i,s=k._canvas,e=i.wordWrap){ - var n; - const h=`${ - t} - -${ - i.styleKey} - -wordWrap-${ - e} - `; - if(k._measurementCache.has(h))return k._measurementCache.get(h); - if(cw(i)&&lw(t)){ - const s=Pw(t,i,e,k._context,k._measureText,k.measureFont,k.canBreakChars,k.wordWrapSplit),n=new k(t,i,s.width,s.height,s.lines,s.lineWidths,s.lineHeight,s.maxLineWidth,s.fontProperties,{ - runsByLine:s.runsByLine,lineAscents:s.lineAscents,lineDescents:s.lineDescents,lineHeights:s.lineHeights,hasDropShadow:s.hasDropShadow} - ); - return k._measurementCache.set(h,n),n} - const r=i._fontString,o=k.measureFont(r); - 0===o.fontSize&&(o.fontSize=i.fontSize,o.ascent=i.fontSize,o.descent=0); - const a=k._context; - a.font=r; - const c=(e?k._wordWrap(t,i,s):t).split(yw),l=new Array(c.length); - let u=0; - for(let _=0; - _<c.length; - _++){ - const t=k._measureText(c[_],i.letterSpacing,a); - l[_]=t,u=Math.max(u,t)} - const d=(null==(n=i._stroke)?void 0:n.width)??0,f=i.lineHeight||o.fontSize,p=k._getAlignWidth(u,i,e),w=k._adjustWidthForStyle(p,i),g=Math.max(f,o.fontSize+d)+(c.length-1)*(f+i.leading),m=k._adjustHeightForStyle(g,i),v=new k(t,i,w,m,c,l,f+i.leading,u,o); - return k._measurementCache.set(h,v),v} - static _adjustWidthForStyle(t,i){ - var s; - let e=t+((null==(s=i._stroke)?void 0:s.width)||0); - return i.dropShadow&&(e+=i.dropShadow.distance),e} - static _adjustHeightForStyle(t,i){ - let s=t; - return i.dropShadow&&(s+=i.dropShadow.distance),s} - static _getAlignWidth(t,i,s){ - return s&&"left"!==i.align?Math.max(t,i.wordWrapWidth):t} - static _measureText(t,i,s){ - let e=!1; - k.experimentalLetterSpacingSupported&&(k.experimentalLetterSpacing?(s.letterSpacing=`${ - i} - px`,s.textLetterSpacing=`${ - i} - px`,e=!0):(s.letterSpacing="0px",s.textLetterSpacing="0px")); - const n=s.measureText(t); - let h=n.width; - const r=-(n.actualBoundingBoxLeft??0); - let o=(n.actualBoundingBoxRight??0)-r; - if(h>0)if(e)h-=i,o-=i; - else{ - const s=(k.graphemeSegmenter(t).length-1)*i; - h+=s,o+=s} - return Math.max(h,o)} - static _wordWrap(t,i,s=k._canvas){ - return Bw(t,i,s,k._measureText,k.canBreakWords,k.canBreakChars,k.wordWrapSplit)} - static isBreakingSpace(t,i){ - return Aw(t)} - static canBreakWords(t,i){ - return i} - static canBreakChars(t,i,s,e,n){ - return!0} - static wordWrapSplit(t){ - return k.graphemeSegmenter(t)} - static measureFont(t){ - if(k._fonts[t])return k._fonts[t]; - const i=k._context; - i.font=t; - const s=i.measureText(k.METRICS_STRING+k.BASELINE_SYMBOL),e=s.actualBoundingBoxAscent??0,n=s.actualBoundingBoxDescent??0,h={ - ascent:e,descent:n,fontSize:e+n} - ; - return k._fonts[t]=h,h} - static clearMetrics(t=""){ - t?delete k._fonts[t]:k._fonts={ - } - } - static get _canvas(){ - if(!k.__canvas){ - let i; - try{ - const t=new OffscreenCanvas(0,0),s=t.getContext("2d",Uw); - if(null==s?void 0:s.measureText)return k.__canvas=t,t; - i=ln.get().createCanvas()} - catch(t){ - i=ln.get().createCanvas()} - i.width=i.height=10,k.__canvas=i} - return k.__canvas} - static get _context(){ - return k.__context||(k.__context=k._canvas.getContext("2d",Uw)),k.__context} - } - ,Qt(k,"_CanvasTextMetrics"),k); - Fw.METRICS_STRING="|ÉqÅ",Fw.BASELINE_SYMBOL="M",Fw.BASELINE_MULTIPLIER=1.4,Fw.HEIGHT_MULTIPLIER=2,Fw.graphemeSegmenter=(()=>{ - if("function"==typeof(null==Intl?void 0:Intl.Segmenter)){ - const t=new Intl.Segmenter; - return i=>{ - const s=t.segment(i),e=[]; - let n=0; - for(const t of s)e[n++]=t.segment; - return e} - } - return t=>[...t]} - )(),Fw.experimentalLetterSpacing=!1,Fw._fonts={ - } - ,Fw._measurementCache=aw(1e3); - let $w=Fw; - const Hw=["serif","sans-serif","monospace","cursive","fantasy","system-ui"]; - function Ww(t){ - const i="number"==typeof t.fontSize?`${ - t.fontSize} - px`:t.fontSize; - let s=t.fontFamily; - Array.isArray(t.fontFamily)||(s=t.fontFamily.split(",")); - for(let e=s.length-1; - e>=0; - e--){ - let t=s[e].trim(); - /([\"\'])[^\'\"]+\1/.test(t)||Hw.includes(t)||(t=`"${ - t} - "`),s[e]=t} - return`${ - t.fontStyle} - ${ - t.fontVariant} - ${ - t.fontWeight} - ${ - i} - ${ - s.join(",")} - `} - Qt(Ww,"fontStringFromTextStyle"); - const Vw=1e5; - function jw(t,i,s,e=0,n=0,h=0){ - if(t.texture===ls.WHITE&&!t.fill)return Ks.shared.setValue(t.color).setAlpha(t.alpha??1).toHexa(); - if(!t.fill){ - const s=i.createPattern(t.texture.source.resource,"repeat"),e=t.matrix.copyTo(Ci.shared); - return e.scale(t.texture.source.pixelWidth,t.texture.source.pixelHeight),s.setTransform(e),s} - if(t.fill instanceof Eu){ - const s=t.fill,e=i.createPattern(s.texture.source.resource,"repeat"),n=s.transform.copyTo(Ci.shared); - return n.scale(s.texture.source.pixelWidth,s.texture.source.pixelHeight),e.setTransform(n),e} - if(t.fill instanceof ml){ - const r=t.fill,o="linear"===r.type,a="local"===r.textureSpace; - let c,l=1,u=1; - a&&s&&(l=s.width+e,u=s.height+e); - let d=!1; - if(o){ - const{ - start:t,end:s} - =r; - c=i.createLinearGradient(t.x*l+n,t.y*u+h,s.x*l+n,s.y*u+h),d=Math.abs(s.x-t.x)<Math.abs(.1*(s.y-t.y))} - else{ - const{ - center:t,innerRadius:s,outerCenter:e,outerRadius:o} - =r; - c=i.createRadialGradient(t.x*l+n,t.y*u+h,s*l,e.x*l+n,e.y*u+h,o*l)} - if(d&&a&&s){ - const t=s.lineHeight/u; - for(let i=0; - i<s.lines.length; - i++){ - const n=(i*s.lineHeight+e/2)/u; - r.colorStops.forEach(i=>{ - let s=n+i.offset*t; - s=Math.max(0,Math.min(1,s)),c.addColorStop(Math.floor(s*Vw)/Vw,Ks.shared.setValue(i.color).toHex())} - )} - } - else r.colorStops.forEach(t=>{ - c.addColorStop(t.offset,Ks.shared.setValue(t.color).toHex())} - ); - return c} - return qs(),"red"} - Qt(jw,"getCanvasFillStyle"); - const Kw=new $i; - function zw(t){ - let i=0; - for(let s=0; - s<t.length; - s++)32===t.charCodeAt(s)&&i++; - return i} - Qt(zw,"countSpaces"); - const Yw=class{ - getCanvasAndContext(t){ - const{ - text:i,style:s,resolution:e=1} - =t,n=s._getFinalPadding(),h=$w.measureText(i||" ",s),r=Math.ceil(Math.ceil(Math.max(1,h.width)+2*n)*e),o=Math.ceil(Math.ceil(Math.max(1,h.height)+2*n)*e),a=Zp.getOptimalCanvasAndContext(r,o); - return this._renderTextToCanvas(s,n,e,a,h),{ - canvasAndContext:a,frame:s.trim?hw({ - canvas:a.canvas,width:r,height:o,resolution:1,output:Kw} - ):Kw.set(0,0,r,o)} - } - returnCanvasAndContext(t){ - Zp.returnCanvasAndContext(t)} - _renderTextToCanvas(t,i,s,e,n){ - var h,r,o; - if(n.runsByLine&&n.runsByLine.length>0)return void this._renderTaggedTextToCanvas(n,t,i,s,e); - const{ - canvas:a,context:c} - =e,l=Ww(t),u=n.lines,d=n.lineHeight,f=n.lineWidths,p=n.maxLineWidth,w=n.fontProperties,g=a.height; - if(c.resetTransform(),c.scale(s,s),c.textBaseline=t.textBaseline,null==(h=t._stroke)?void 0:h.width){ - const i=t._stroke; - c.lineWidth=i.width,c.miterLimit=i.miterLimit,c.lineJoin=i.join,c.lineCap=i.cap} - let m,v; - c.font=l; - const _=t.dropShadow?2:1,M=t.wordWrap?t.wordWrapWidth:p,b=((null==(r=t._stroke)?void 0:r.width)??0)/2; - let y=(d-w.fontSize)/2; - d-w.fontSize<0&&(y=0); - for(let E=0; - E<_; - ++E){ - const h=t.dropShadow&&0===E,r=h?Math.ceil(Math.max(1,g)+2*i):0,a=r*s; - if(h)this._setupDropShadow(c,t,s,a); - else{ - const s=t._gradientBounds,e=t._gradientOffset; - if(s){ - const h={ - width:s.width,height:s.height,lineHeight:s.height,lines:n.lines} - ; - this._setFillAndStrokeStyles(c,t,h,i,b,(null==e?void 0:e.x)??0,(null==e?void 0:e.y)??0)} - else e?this._setFillAndStrokeStyles(c,t,n,i,b,e.x,e.y):this._setFillAndStrokeStyles(c,t,n,i,b); - c.shadowColor="rgba(0,0,0,0)"} - for(let s=0; - s<u.length; - s++){ - m=b,v=b+s*d+w.ascent+y,m+=this._getAlignmentOffset(f[s],M,t.align); - let n=0; - if("justify"===t.align&&t.wordWrap&&s<u.length-1){ - const t=zw(u[s]); - t>0&&(n=(M-f[s])/t)} - (null==(o=t._stroke)?void 0:o.width)&&this._drawLetterSpacing(u[s],t,e,m+i,v+i-r,!0,n),void 0!==t._fill&&this._drawLetterSpacing(u[s],t,e,m+i,v+i-r,!1,n)} - } - } - _renderTaggedTextToCanvas(t,i,s,e,n){ - var h,r,o; - const{ - canvas:a,context:c} - =n,{ - runsByLine:l,lineWidths:u,maxLineWidth:d,lineAscents:f,lineHeights:p,hasDropShadow:w} - =t,g=a.height; - c.resetTransform(),c.scale(e,e),c.textBaseline=i.textBaseline; - const m=w?2:1,v=i.wordWrap?i.wordWrapWidth:d; - let _=(null==(h=i._stroke)?void 0:h.width)??0; - for(const y of l)for(const t of y){ - const i=(null==(r=t.style._stroke)?void 0:r.width)??0; - i>_&&(_=i)} - const M=_/2,b=[]; - for(let y=0; - y<l.length; - y++){ - const t=l[y],i=[]; - for(const s of t){ - const t=Ww(s.style); - c.font=t,i.push({ - width:$w._measureText(s.text,s.style.letterSpacing,c),font:t} - )} - b.push(i)} - for(let y=0; - y<m; - ++y){ - const t=w&&0===y,h=t?Math.ceil(Math.max(1,g)+2*s):0,r=h*e; - t||(c.shadowColor="rgba(0,0,0,0)"); - let a=M; - for(let d=0; - d<l.length; - d++){ - const w=l[d],g=u[d],m=f[d],_=p[d],y=b[d]; - let E=M; - E+=this._getAlignmentOffset(g,v,i.align); - let A=0; - if("justify"===i.align&&i.wordWrap&&d<l.length-1){ - let t=0; - for(const i of w)t+=zw(i.text); - t>0&&(A=(v-g)/t)} - const S=a+m; - let T=E+s; - for(let i=0; - i<w.length; - i++){ - const l=w[i],{ - width:u,font:d} - =y[i]; - if(c.font=d,c.textBaseline=l.style.textBaseline,null==(o=l.style._stroke)?void 0:o.width){ - const i=l.style._stroke; - if(c.lineWidth=i.width,c.miterLimit=i.miterLimit,c.lineJoin=i.join,c.lineCap=i.cap,t){ - if(!l.style.dropShadow){ - T+=u+zw(l.text)*A; - continue} - this._setupDropShadow(c,l.style,e,r)} - else{ - const t=$w.measureFont(d),e=l.style.lineHeight||t.fontSize,n={ - width:u,height:e,lineHeight:e,lines:[l.text]} - ; - c.strokeStyle=jw(i,c,n,2*s,T-s,a)} - this._drawLetterSpacing(l.text,l.style,n,T,S+s-h,!0,A)} - T+=u+zw(l.text)*A} - T=E+s; - for(let i=0; - i<w.length; - i++){ - const o=w[i],{ - width:l,font:u} - =y[i]; - if(c.font=u,c.textBaseline=o.style.textBaseline,void 0!==o.style._fill){ - if(t){ - if(!o.style.dropShadow){ - T+=l+zw(o.text)*A; - continue} - this._setupDropShadow(c,o.style,e,r)} - else{ - const t=$w.measureFont(u),i=o.style.lineHeight||t.fontSize,e={ - width:l,height:i,lineHeight:i,lines:[o.text]} - ; - c.fillStyle=jw(o.style._fill,c,e,2*s,T-s,a)} - this._drawLetterSpacing(o.text,o.style,n,T,S+s-h,!1,A)} - T+=l+zw(o.text)*A} - a+=_} - } - } - _setFillAndStrokeStyles(t,i,s,e,n,h=0,r=0){ - var o; - if(t.fillStyle=i._fill?jw(i._fill,t,s,2*e,h,r):null,null==(o=i._stroke)?void 0:o.width){ - const o=n+2*e; - t.strokeStyle=jw(i._stroke,t,s,o,h,r)} - } - _setupDropShadow(t,i,s,e){ - t.fillStyle="black",t.strokeStyle="black"; - const n=i.dropShadow,h=n.color,r=n.alpha; - t.shadowColor=Ks.shared.setValue(h).setAlpha(r).toRgbaString(); - const o=n.blur*s,a=n.distance*s; - t.shadowBlur=o,t.shadowOffsetX=Math.cos(n.angle)*a,t.shadowOffsetY=Math.sin(n.angle)*a+e} - _getAlignmentOffset(t,i,s){ - return"right"===s?i-t:"center"===s?(i-t)/2:0} - _drawLetterSpacing(t,i,s,e,n,h=!1,r=0){ - const{ - context:o} - =s,a=i.letterSpacing; - let c=!1; - if($w.experimentalLetterSpacingSupported&&($w.experimentalLetterSpacing?(o.letterSpacing=`${ - a} - px`,o.textLetterSpacing=`${ - a} - px`,c=!0):(o.letterSpacing="0px",o.textLetterSpacing="0px")),(0===a||c)&&0===r)return void(h?o.strokeText(t,e,n):o.fillText(t,e,n)); - if(0!==r&&(0===a||c)){ - const i=t.split(" "); - let s=e; - const a=o.measureText(" ").width; - for(let t=0; - t<i.length; - t++)h?o.strokeText(i[t],s,n):o.fillText(i[t],s,n),s+=o.measureText(i[t]).width+a+r; - return} - let l=e; - const u=$w.graphemeSegmenter(t); - let d=o.measureText(t).width,f=0; - for(let p=0; - p<u.length; - ++p){ - const t=u[p]; - h?o.strokeText(t,l,n):o.fillText(t,l,n); - let i=""; - for(let s=p+1; - s<u.length; - ++s)i+=u[s]; - f=o.measureText(i).width,l+=d-f+a," "===t&&(l+=r),d=f} - } - } - ; - Qt(Yw,"CanvasTextGeneratorClass"); - const qw=new Yw,Xw=(Qt(x=class extends vi{ - constructor(t={ - } - ){ - super(),this.uid=Wi("textStyle"),this._tick=0,this._cachedFontString=null,Qw(t),t instanceof x&&(t=t._toObject()); - const i={ - ...x.defaultTextStyle,...t} - ; - for(const s in i)this[s]=i[s]; - this._tagStyles=t.tagStyles??void 0,this.update(),this._tick=0} - get align(){ - return this._align} - set align(t){ - this._align!==t&&(this._align=t,this.update())} - get breakWords(){ - return this._breakWords} - set breakWords(t){ - this._breakWords!==t&&(this._breakWords=t,this.update())} - get dropShadow(){ - return this._dropShadow} - set dropShadow(t){ - this._dropShadow!==t&&(this._dropShadow=null!==t&&"object"==typeof t?this._createProxy({ - ...x.defaultDropShadow,...t} - ):t?this._createProxy({ - ...x.defaultDropShadow} - ):null,this.update())} - get fontFamily(){ - return this._fontFamily} - set fontFamily(t){ - this._fontFamily!==t&&(this._fontFamily=t,this.update())} - get fontSize(){ - return this._fontSize} - set fontSize(t){ - this._fontSize!==t&&(this._fontSize="string"==typeof t?parseInt(t,10):t,this.update())} - get fontStyle(){ - return this._fontStyle} - set fontStyle(t){ - this._fontStyle!==t&&(this._fontStyle=t.toLowerCase(),this.update())} - get fontVariant(){ - return this._fontVariant} - set fontVariant(t){ - this._fontVariant!==t&&(this._fontVariant=t,this.update())} - get fontWeight(){ - return this._fontWeight} - set fontWeight(t){ - this._fontWeight!==t&&(this._fontWeight=t,this.update())} - get leading(){ - return this._leading} - set leading(t){ - this._leading!==t&&(this._leading=t,this.update())} - get letterSpacing(){ - return this._letterSpacing} - set letterSpacing(t){ - this._letterSpacing!==t&&(this._letterSpacing=t,this.update())} - get lineHeight(){ - return this._lineHeight} - set lineHeight(t){ - this._lineHeight!==t&&(this._lineHeight=t,this.update())} - get padding(){ - return this._padding} - set padding(t){ - this._padding!==t&&(this._padding=t,this.update())} - get filters(){ - return this._filters} - set filters(t){ - this._filters!==t&&(this._filters=Object.freeze(t),this.update())} - get trim(){ - return this._trim} - set trim(t){ - this._trim!==t&&(this._trim=t,this.update())} - get textBaseline(){ - return this._textBaseline} - set textBaseline(t){ - this._textBaseline!==t&&(this._textBaseline=t,this.update())} - get whiteSpace(){ - return this._whiteSpace} - set whiteSpace(t){ - this._whiteSpace!==t&&(this._whiteSpace=t,this.update())} - get wordWrap(){ - return this._wordWrap} - set wordWrap(t){ - this._wordWrap!==t&&(this._wordWrap=t,this.update())} - get wordWrapWidth(){ - return this._wordWrapWidth} - set wordWrapWidth(t){ - this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.update())} - get fill(){ - return this._originalFill} - set fill(t){ - t!==this._originalFill&&(this._originalFill=t,this._isFillStyle(t)&&(this._originalFill=this._createProxy({ - ...Uu.defaultFillStyle,...t} - ,()=>{ - this._fill=Pu({ - ...this._originalFill} - ,Uu.defaultFillStyle)} - )),this._fill=Pu(0===t?"black":t,Uu.defaultFillStyle),this.update())} - get stroke(){ - return this._originalStroke} - set stroke(t){ - t!==this._originalStroke&&(this._originalStroke=t,this._isFillStyle(t)&&(this._originalStroke=this._createProxy({ - ...Uu.defaultStrokeStyle,...t} - ,()=>{ - this._stroke=Nu({ - ...this._originalStroke} - ,Uu.defaultStrokeStyle)} - )),this._stroke=Nu(t,Uu.defaultStrokeStyle),this.update())} - get tagStyles(){ - return this._tagStyles} - set tagStyles(t){ - this._tagStyles!==t&&(this._tagStyles=t??void 0,this.update())} - update(){ - this._tick++,this._cachedFontString=null,this.emit("update",this)} - reset(){ - const t=x.defaultTextStyle; - for(const i in t)this[i]=t[i]} - assign(t){ - for(const i in t)this[i]=t[i]; - return this} - get styleKey(){ - return`${ - this.uid} - -${ - this._tick} - `} - get _fontString(){ - return null===this._cachedFontString&&(this._cachedFontString=Ww(this)),this._cachedFontString} - _toObject(){ - return{ - align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{ - ...this._dropShadow} - :null,fill:this._fill?{ - ...this._fill} - :void 0,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke?{ - ...this._stroke} - :void 0,textBaseline:this.textBaseline,trim:this.trim,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,filters:this._filters?[...this._filters]:void 0,tagStyles:this._tagStyles?{ - ...this._tagStyles} - :void 0} - } - clone(){ - return new x(this._toObject())} - _getFinalPadding(){ - let t=0; - if(this._filters)for(let i=0; - i<this._filters.length; - i++)t+=this._filters[i].padding; - return Math.max(this._padding,t)} - destroy(t=!1){ - var i,s,e,n; - if(this.removeAllListeners(),"boolean"==typeof t?t:null==t?void 0:t.texture){ - const h="boolean"==typeof t?t:null==t?void 0:t.textureSource; - (null==(i=this._fill)?void 0:i.texture)&&this._fill.texture.destroy(h),(null==(s=this._originalFill)?void 0:s.texture)&&this._originalFill.texture.destroy(h),(null==(e=this._stroke)?void 0:e.texture)&&this._stroke.texture.destroy(h),(null==(n=this._originalStroke)?void 0:n.texture)&&this._originalStroke.texture.destroy(h)} - this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null} - _createProxy(t,i){ - return new Proxy(t,{ - set:Qt((t,s,e)=>(t[s]===e||(t[s]=e,null==i||i(s,e),this.update()),!0),"set")} - )} - _isFillStyle(t){ - return null!==(t??null)&&!(Ks.isColorLike(t)||t instanceof ml||t instanceof Eu)} - } - ,"_TextStyle"),x); - Xw.defaultDropShadow={ - alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5} - ,Xw.defaultTextStyle={ - align:"left",breakWords:!1,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100} - ; - let Jw=Xw; - function Qw(t){ - const i=t; - if("boolean"==typeof i.dropShadow&&i.dropShadow){ - const s=Jw.defaultDropShadow; - t.dropShadow={ - alpha:i.dropShadowAlpha??s.alpha,angle:i.dropShadowAngle??s.angle,blur:i.dropShadowBlur??s.blur,color:i.dropShadowColor??s.color,distance:i.dropShadowDistance??s.distance} - } - if(void 0!==i.strokeThickness){ - Yi(ji,"strokeThickness is now a part of stroke"); - const s=i.stroke; - let e={ - } - ; - if(Ks.isColorLike(s))e.color=s; - else if(s instanceof ml||s instanceof Eu)e.fill=s; - else{ - if(!Object.hasOwnProperty.call(s,"color")&&!Object.hasOwnProperty.call(s,"fill"))throw new Error("Invalid stroke value."); - e=s} - t.stroke={ - ...e,width:i.strokeThickness} - } - if(Array.isArray(i.fillGradientStops)){ - if(Yi(ji,"gradient fill is now a fill pattern: `new FillGradient(...)`"),!Array.isArray(i.fill)||0===i.fill.length)throw new Error("Invalid fill value. Expected an array of colors for gradient fill."); - i.fill.length!==i.fillGradientStops.length&&qs(); - const s=new ml({ - start:{ - x:0,y:0} - ,end:{ - x:0,y:1} - ,textureSpace:"local"} - ),e=i.fillGradientStops.slice(),n=i.fill.map(t=>Ks.shared.setValue(t).toNumber()); - e.forEach((t,i)=>{ - s.addColorStop(t,n[i])} - ),t.fill={ - fill:s} - } - } - function Zw(t,i){ - const{ - texture:s,bounds:e} - =t,n=i._style._getFinalPadding(); - us(e,i._anchor,s); - const h=i._anchor._x*n*2,r=i._anchor._y*n*2; - e.minX-=n-h,e.minY-=n-r,e.maxX-=n-h,e.maxY-=n-r} - Qt(Qw,"convertV7Tov8Style"),Qt(Zw,"updateTextBounds"); - const tg=class{ - constructor(){ - this.batcherName="default",this.topology="triangle-list",this.attributeSize=4,this.indexSize=6,this.packAsQuad=!0,this.roundPixels=0,this._attributeStart=0,this._batcher=null,this._batch=null} - get blendMode(){ - return this.renderable.groupBlendMode} - get color(){ - return this.renderable.groupColorAlpha} - reset(){ - this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.bounds=null} - destroy(){ - this.reset()} - } - ; - Qt(tg,"BatchableSprite"); - let ig=tg; - const sg=class extends ig{ - } - ; - Qt(sg,"BatchableText"); - let eg=sg; - const ng=class{ - constructor(t){ - this._renderer=t,t.runners.resolutionChange.add(this),this._managedTexts=new Yc({ - renderer:t,type:"renderable",onUnload:this.onTextUnload.bind(this),name:"canvasText"} - )} - resolutionChange(){ - for(const t in this._managedTexts.items){ - const i=this._managedTexts.items[t]; - (null==i?void 0:i._autoResolution)&&i.onViewUpdate()} - } - validateRenderable(t){ - const i=this._getGpuText(t),s=t.styleKey; - return i.currentKey!==s||t._didTextUpdate} - addRenderable(t,i){ - const s=this._getGpuText(t); - if(t._didTextUpdate){ - const i=t._autoResolution?this._renderer.resolution:t.resolution; - s.currentKey===t.styleKey&&t._resolution===i||this._updateGpuText(t),t._didTextUpdate=!1,Zw(s,t)} - this._renderer.renderPipes.batch.addToBatch(s,i)} - updateRenderable(t){ - const i=this._getGpuText(t); - i._batcher.updateElement(i)} - _updateGpuText(t){ - const i=this._getGpuText(t); - i.texture&&this._renderer.canvasText.decreaseReferenceCount(i.currentKey),t._resolution=t._autoResolution?this._renderer.resolution:t.resolution,i.texture=this._renderer.canvasText.getManagedTexture(t),i.currentKey=t.styleKey} - _getGpuText(t){ - return t._gpuData[this._renderer.uid]||this.initGpuText(t)} - initGpuText(t){ - const i=new eg; - return i.currentKey="--",i.renderable=t,i.transform=t.groupTransform,i.bounds={ - minX:0,maxX:1,minY:0,maxY:0} - ,i.roundPixels=this._renderer._roundPixels|t._roundPixels,t._gpuData[this._renderer.uid]=i,this._managedTexts.add(t),i} - onTextUnload(t){ - const i=t._gpuData[this._renderer.uid]; - if(!i)return; - const{ - canvasText:s} - =this._renderer; - s.getReferenceCount(i.currentKey)>0?s.decreaseReferenceCount(i.currentKey):i.texture&&s.returnTexture(i.texture)} - destroy(){ - this._managedTexts.destroy(),this._renderer=null} - } - ; - Qt(ng,"CanvasTextPipe"); - let hg=ng; - hg.extension={ - type:[ri.WebGLPipes,ri.WebGPUPipes,ri.CanvasPipes],name:"text"} - ; - const rg=new ps; - function og(t,i,s,e,n=!1){ - const h=rg; - h.minX=0,h.minY=0,h.maxX=t.width/e|0,h.maxY=t.height/e|0; - const r=Be.getOptimalTexture(h.width,h.height,e,!1,n); - return r.source.uploadMethodId="image",r.source.resource=t,r.source.alphaMode="premultiply-alpha-on-upload",r.frame.width=i/e,r.frame.height=s/e,r.source.emit("update",r.source),r.updateUvs(),r} - Qt(og,"getPo2TextureFromSource"); - const ag=class{ - constructor(t,i){ - this._activeTextures={ - } - ,this._renderer=t,this._retainCanvasContext=i} - getTexture(t,i,s,e){ - "string"==typeof t&&(Yi("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),t={ - text:t,style:s,resolution:i} - ),t.style instanceof Jw||(t.style=new Jw(t.style)),t.textureStyle instanceof ss||(t.textureStyle=new ss(t.textureStyle)),"string"!=typeof t.text&&(t.text=t.text.toString()); - const{ - text:n,style:h,textureStyle:r,autoGenerateMipmaps:o} - =t,a=t.resolution??this._renderer.resolution,{ - frame:c,canvasAndContext:l} - =qw.getCanvasAndContext({ - text:n,style:h,resolution:a} - ),u=og(l.canvas,c.width,c.height,a,o); - if(r&&(u.source.style=r),h.trim&&(c.pad(h.padding),u.frame.copyFrom(c),u.frame.scale(1/a),u.updateUvs()),h.filters){ - const t=this._applyFilters(u,h.filters); - return this.returnTexture(u),qw.returnCanvasAndContext(l),t} - return this._renderer.texture.initSource(u._source),this._retainCanvasContext||qw.returnCanvasAndContext(l),u} - returnTexture(t){ - const i=t.source,s=i.resource; - if(this._retainCanvasContext&&(null==s?void 0:s.getContext)){ - const t=s.getContext("2d"); - t&&qw.returnCanvasAndContext({ - canvas:s,context:t} - )} - i.resource=null,i.uploadMethodId="unknown",i.alphaMode="no-premultiply-alpha",Be.returnTexture(t,!0)} - renderTextToCanvas(){ - Yi("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead")} - getManagedTexture(t){ - t._resolution=t._autoResolution?this._renderer.resolution:t.resolution; - const i=t.styleKey; - if(this._activeTextures[i])return this._increaseReferenceCount(i),this._activeTextures[i].texture; - const s=this.getTexture({ - text:t.text,style:t.style,resolution:t._resolution,textureStyle:t.textureStyle,autoGenerateMipmaps:t.autoGenerateMipmaps} - ); - return this._activeTextures[i]={ - texture:s,usageCount:1} - ,s} - decreaseReferenceCount(t){ - const i=this._activeTextures[t]; - i&&(i.usageCount--,0===i.usageCount&&(this.returnTexture(i.texture),this._activeTextures[t]=null))} - getReferenceCount(t){ - var i; - return(null==(i=this._activeTextures[t])?void 0:i.usageCount)??0} - _increaseReferenceCount(t){ - this._activeTextures[t].usageCount++} - _applyFilters(t,i){ - const s=this._renderer.renderTarget.renderTarget,e=this._renderer.filter.generateFilteredTexture({ - texture:t,filters:i} - ); - return this._renderer.renderTarget.bind(s,!1),e} - destroy(){ - this._renderer=null; - for(const t in this._activeTextures)this._activeTextures[t]&&this.returnTexture(this._activeTextures[t].texture); - this._activeTextures=null} - } - ; - Qt(ag,"AbstractTextSystem"); - let cg=ag; - const lg=class extends cg{ - constructor(t){ - super(t,!0)} - } - ; - Qt(lg,"CanvasRendererTextSystem"); - let ug=lg; - ug.extension={ - type:[ri.CanvasSystem],name:"canvasText"} - ; - const dg=class extends cg{ - constructor(t){ - super(t,!1)} - } - ; - Qt(dg,"CanvasTextSystem"); - let fg=dg; - fg.extension={ - type:[ri.WebGLSystem,ri.WebGPUSystem],name:"canvasText"} - ,ci.add(ug),ci.add(fg),ci.add(hg); - let pg=(Qt(R=class extends qp{ - constructor(...t){ - const i=Xp(t,"Text"); - super(i,Jw),this.renderPipeId="text",i.textureStyle&&(this.textureStyle=i.textureStyle instanceof ss?i.textureStyle:new ss(i.textureStyle)),this.autoGenerateMipmaps=i.autoGenerateMipmaps??ns.defaultOptions.autoGenerateMipmaps} - updateBounds(){ - const t=this._bounds,i=this._anchor; - let s=0,e=0; - if(this._style.trim){ - const{ - frame:t,canvasAndContext:i} - =qw.getCanvasAndContext({ - text:this.text,style:this._style,resolution:1} - ); - qw.returnCanvasAndContext(i),s=t.width,e=t.height} - else{ - const t=$w.measureText(this._text,this._style); - s=t.width,e=t.height} - t.minX=-i._x*s,t.maxX=t.minX+s,t.minY=-i._y*e,t.maxY=t.minY+e} - } - ,"Text"),R); - const wg=class extends vi{ - constructor(){ - super(...arguments),this.chars=Object.create(null),this.lineHeight=0,this.fontFamily="",this.fontMetrics={ - fontSize:0,ascent:0,descent:0} - ,this.baseLineOffset=0,this.distanceField={ - type:"none",range:0} - ,this.pages=[],this.applyFillAsTint=!0,this.baseMeasurementFontSize=100,this.baseRenderedFontSize=100} - get font(){ - return Yi(ji,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily} - get pageTextures(){ - return Yi(ji,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages} - get size(){ - return Yi(ji,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize} - get distanceFieldRange(){ - return Yi(ji,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range} - get distanceFieldType(){ - return Yi(ji,"BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),this.distanceField.type} - destroy(t=!1){ - var i; - this.emit("destroy",this),this.removeAllListeners(); - for(const s in this.chars)null==(i=this.chars[s].texture)||i.destroy(); - this.chars=null,t&&(this.pages.forEach(t=>t.texture.destroy(!0)),this.pages=null)} - } - ; - Qt(wg,"AbstractBitmapFont"); - let gg=wg; - const mg=(P=class extends gg{ - constructor(t){ - super(),this.resolution=1,this.pages=[],this._padding=0,this._measureCache=Object.create(null),this._currentChars=[],this._currentX=0,this._currentY=0,this._currentMaxCharHeight=0,this._currentPageIndex=-1,this._skipKerning=!1; - const i={ - ...P.defaultOptions,...t} - ; - this._textureSize=i.textureSize,this._mipmap=i.mipmap; - const s=i.style.clone(); - i.overrideFill&&(s._fill.color=16777215,s._fill.alpha=1,s._fill.texture=ls.WHITE,s._fill.fill=null),this.applyFillAsTint=i.overrideFill; - const e=s.fontSize; - s.fontSize=this.baseMeasurementFontSize; - const n=Ww(s); - i.overrideSize?(s._stroke&&(s._stroke.width*=this.baseRenderedFontSize/e),s.dropShadow&&(s.dropShadow.blur*=this.baseRenderedFontSize/e,s.dropShadow.distance*=this.baseRenderedFontSize/e)):s.fontSize=this.baseRenderedFontSize=e,this._style=s,this._skipKerning=i.skipKerning??!1,this.resolution=i.resolution??1,this._padding=i.padding??4,i.textureStyle&&(this._textureStyle=i.textureStyle instanceof ss?i.textureStyle:new ss(i.textureStyle)),this.fontMetrics=$w.measureFont(n),this.lineHeight=s.lineHeight||this.fontMetrics.fontSize||s.fontSize} - ensureCharacters(t){ - var i,s; - const e=$w.graphemeSegmenter(t).filter(t=>!this._currentChars.includes(t)).filter((t,i,s)=>s.indexOf(t)===i); - if(!e.length)return; - let n; - this._currentChars=[...this._currentChars,...e],n=-1===this._currentPageIndex?this._nextPage():this.pages[this._currentPageIndex]; - let{ - canvas:h,context:r} - =n.canvasAndContext,o=n.texture.source; - const a=this._style; - let c=this._currentX,l=this._currentY,u=this._currentMaxCharHeight; - const d=this.baseRenderedFontSize/this.baseMeasurementFontSize,f=((null==(i=a.dropShadow)?void 0:i.distance)??0)+((null==(s=a._stroke)?void 0:s.width)??0),p=this._padding+f; - let w=!1; - const g=h.width/this.resolution,m=h.height/this.resolution; - for(let v=0; - v<e.length; - v++){ - const t=e[v],i=$w.measureText(t,a,h,!1); - i.lineHeight=i.height; - const s=i.width*d,n=Math.ceil(("italic"===a.fontStyle?2:1)*s)+2*p,f=i.height*d+2*p; - if(w=!1,"\n"!==t&&"\r"!==t&&"\t"!==t&&" "!==t&&(w=!0,u=Math.ceil(Math.max(f,u))),c+n>g&&(l+=u,u=f,c=0,l+u>m)){ - o.update(); - const t=this._nextPage(); - h=t.canvasAndContext.canvas,r=t.canvasAndContext.context,o=t.texture.source,c=0,l=0,u=0} - const _=r.measureText(t).width/d; - if(this.chars[t]={ - id:t.codePointAt(0),xOffset:-p/d,yOffset:-p/d,xAdvance:_,kerning:{ - } - } - ,w){ - this._drawGlyph(r,i,c+p,l+p,d,a); - const s=o.width*d,e=o.height*d,h=new $i(c/s*o.width,l/e*o.height,n/s*o.width,f/e*o.height); - this.chars[t].texture=new ls({ - source:o,frame:h} - ),c+=Math.ceil(n)} - } - o.update(),this._currentX=c,this._currentY=l,this._currentMaxCharHeight=u,this._skipKerning||this._applyKerning(e,r,d)} - get pageTextures(){ - return Yi(ji,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages} - _applyKerning(t,i,s){ - const e=this._measureCache; - for(let n=0; - n<t.length; - n++){ - const h=t[n]; - for(let t=0; - t<this._currentChars.length; - t++){ - const n=this._currentChars[t]; - let r=e[h]; - r||(r=e[h]=i.measureText(h).width); - let o=e[n]; - o||(o=e[n]=i.measureText(n).width); - let a=i.measureText(h+n).width,c=a-(r+o); - c&&this.chars[h]&&(this.chars[h].kerning[n]=c/s),a=i.measureText(h+n).width,c=a-(r+o),c&&this.chars[n]&&(this.chars[n].kerning[h]=c/s)} - } - } - _nextPage(){ - this._currentPageIndex++; - const t=this.resolution,i=Zp.getOptimalCanvasAndContext(this._textureSize,this._textureSize,t); - this._setupContext(i.context,this._style,t); - const s=t*(this.baseRenderedFontSize/this.baseMeasurementFontSize),e=new ls({ - source:new pn({ - resource:i.canvas,resolution:s,alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:this._mipmap} - )} - ); - this._textureStyle&&(e.source.style=this._textureStyle); - const n={ - canvasAndContext:i,texture:e} - ; - return this.pages[this._currentPageIndex]=n,n} - _setupContext(t,i,s){ - i.fontSize=this.baseRenderedFontSize,t.scale(s,s),t.font=Ww(i),i.fontSize=this.baseMeasurementFontSize,t.textBaseline=i.textBaseline; - const e=i._stroke,n=(null==e?void 0:e.width)??0; - if(e&&(t.lineWidth=n,t.lineJoin=e.join,t.miterLimit=e.miterLimit,t.strokeStyle=jw(e,t)),i._fill&&(t.fillStyle=jw(i._fill,t)),i.dropShadow){ - const e=i.dropShadow,n=Ks.shared.setValue(e.color).toArray(),h=e.blur*s,r=e.distance*s; - t.shadowColor=`rgba(${ - 255*n[0]} - ,${ - 255*n[1]} - ,${ - 255*n[2]} - ,${ - e.alpha} - )`,t.shadowBlur=h,t.shadowOffsetX=Math.cos(e.angle)*r,t.shadowOffsetY=Math.sin(e.angle)*r} - else t.shadowColor="black",t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0} - _drawGlyph(t,i,s,e,n,h){ - const r=i.text,o=i.fontProperties,a=h._stroke,c=((null==a?void 0:a.width)??0)*n,l=s+c/2,u=e-c/2,d=o.descent*n,f=i.lineHeight*n; - let p=!1; - h.stroke&&c&&(p=!0,t.strokeText(r,l,u+f-d)); - const{ - shadowBlur:w,shadowOffsetX:g,shadowOffsetY:m} - =t; - h._fill&&(p&&(t.shadowBlur=0,t.shadowOffsetX=0,t.shadowOffsetY=0),t.fillText(r,l,u+f-d)),p&&(t.shadowBlur=w,t.shadowOffsetX=g,t.shadowOffsetY=m)} - destroy(){ - super.destroy(); - for(let t=0; - t<this.pages.length; - t++){ - const{ - canvasAndContext:i,texture:s} - =this.pages[t]; - Zp.returnCanvasAndContext(i),s.destroy(!0)} - this.pages=null} - } - ,Qt(P,"_DynamicBitmapFont"),P); - mg.defaultOptions={ - textureSize:512,style:new Jw,mipmap:!0} - ; - let vg=mg; - function _g(t,i,s,e){ - var n,h; - const r={ - width:0,height:0,offsetY:0,scale:i.fontSize/s.baseMeasurementFontSize,lines:[{ - width:0,charPositions:[],spaceWidth:0,spacesIndex:[],chars:[]} - ]} - ; - r.offsetY=s.baseLineOffset; - let o=r.lines[0],a=null,c=!0; - const l={ - width:0,start:0,index:0,positions:[],chars:[]} - ,u=s.baseMeasurementFontSize/i.fontSize,d=i.letterSpacing*u,f=i.wordWrapWidth*u,p=i.lineHeight?i.lineHeight*u:s.lineHeight,w=i.wordWrap&&i.breakWords,g=Cw(i.whiteSpace),m=Ow(i.whiteSpace); - if(g||m){ - const i=[]; - let s=g; - for(let e=0; - e<t.length; - e++){ - let n=t[e]; - if("\r"===n||"\n"===n){ - if(!m){ - g&&(s=!0),i.push(n); - continue} - "\r"===n&&"\n"===t[e+1]&&e++,n=" "} - if(Aw(n))if(g&&Sw(n)){ - if(s)continue; - s=!0,i.push(" ")} - else s=!1,i.push(n); - else s=!1,i.push(n)} - t=i} - const v=Qt(t=>{ - const i=o.width; - for(let s=0; - s<l.index; - s++){ - const e=t.positions[s]; - o.chars.push(t.chars[s]),o.charPositions.push(e+i)} - o.width+=t.width,(l.index>0||!g)&&(c=!1),l.width=0,l.index=0,l.chars.length=0} - ,"nextWord"),_=Qt(()=>{ - let t=o.chars.length-1; - if(e){ - let i=o.chars[t]; - for(; - Sw(i); - )o.width-=s.chars[i].xAdvance,o.spacesIndex.pop(),i=o.chars[--t]} - r.width=Math.max(r.width,o.width),o={ - width:0,charPositions:[],chars:[],spaceWidth:0,spacesIndex:[]} - ,c=!0,r.lines.push(o),r.height+=p} - ,"nextLine"),M=Qt(t=>t-d>f,"checkIsOverflow"); - for(let b=0; - b<t.length+1; - b++){ - let e; - const r=b===t.length; - r||(e=t[b]); - const u=s.chars[e]; - if(/(?:\s)/.test(e)||"\r"===e||"\n"===e||r){ - if(!c&&i.wordWrap&&M(o.width+l.width)?(_(),v(l),r||o.charPositions.push(0)):(l.start=o.width,v(l),r||o.charPositions.push(0)),"\r"===e||"\n"===e)_(); - else if(!r&&u){ - const t=u.xAdvance+((null==(n=u.kerning)?void 0:n[a])||0)+d; - o.width+=t,o.spaceWidth=t,o.spacesIndex.push(o.charPositions.length),o.chars.push(e)} - } - else if(u){ - const t=(null==(h=u.kerning)?void 0:h[a])||0,s=u.xAdvance+t+d; - w&&M(l.width+s)&&(c||_(),v(l),_()),l.positions[l.index++]=l.width+t,l.chars.push(e),l.width+=s,Tw(e)&&(!c&&i.wordWrap&&M(o.width+l.width)&&_(),v(l))} - a=e} - return _(),i.wordWrap&&"left"!==i.align&&(r.width=Math.max(r.width,f)),"center"===i.align?Mg(r):"right"===i.align?bg(r):"justify"===i.align&&yg(r),r} - function Mg(t){ - for(let i=0; - i<t.lines.length; - i++){ - const s=t.lines[i],e=t.width/2-s.width/2; - for(let t=0; - t<s.charPositions.length; - t++)s.charPositions[t]+=e} - } - function bg(t){ - for(let i=0; - i<t.lines.length; - i++){ - const s=t.lines[i],e=t.width-s.width; - for(let t=0; - t<s.charPositions.length; - t++)s.charPositions[t]+=e} - } - function yg(t){ - const i=t.width; - for(let s=0; - s<t.lines.length-2; - s++){ - const e=t.lines[s]; - let n=0,h=e.spacesIndex[n++],r=0; - const o=e.spacesIndex.length,a=(i-e.width)/o; - for(let t=0; - t<e.charPositions.length; - t++)t===h&&(h=e.spacesIndex[n++],r+=a),e.charPositions[t]+=r} - } - function Eg(t){ - if(""===t)return[]; - "string"==typeof t&&(t=[t]); - const i=[]; - for(let s=0,e=t.length; - s<e; - s++){ - const e=t[s]; - if(Array.isArray(e)){ - if(2!==e.length)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${ - e.length} - .`); - if(0===e[0].length||0===e[1].length)throw new Error("[BitmapFont]: Invalid character delimiter."); - const t=e[0].charCodeAt(0),s=e[1].charCodeAt(0); - if(s<t)throw new Error("[BitmapFont]: Invalid character range."); - for(let e=t,n=s; - e<=n; - e++)i.push(String.fromCharCode(e))} - else i.push(...Array.from(e))} - if(0===i.length)throw new Error("[BitmapFont]: Empty set when resolving characters."); - return i} - Qt(_g,"getBitmapTextLayout"),Qt(Mg,"alignCenter"),Qt(bg,"alignRight"),Qt(yg,"alignJustify"),Qt(Eg,"resolveCharacters"); - let Ag=0; - const Sg=class{ - constructor(){ - this.ALPHA=[["a","z"],["A","Z"]," "],this.NUMERIC=[["0","9"]],this.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],this.ASCII=[[" ","~"]],this.defaultOptions={ - chars:this.ALPHANUMERIC,resolution:1,padding:4,skipKerning:!1,textureStyle:null} - ,this.measureCache=aw(1e3)} - getFont(t,i){ - var s,e; - let n=`${ - i.fontFamily} - -bitmap`,h=!0; - if(Tn.has(n)){ - const i=Tn.get(n); - return null==(s=i.ensureCharacters)||s.call(i,t),i} - if(i._fill.fill&&!i._stroke?(n+=i._fill.fill.styleKey,h=!1):(i._stroke||i.dropShadow)&&(n=`${ - i.styleKey} - -bitmap`,h=!1),n+=`-${ - i.fontStyle} - `,n+=`-${ - i.fontVariant} - `,n+=`-${ - i.fontWeight} - `,!Tn.has(n)){ - const t=Object.create(i); - t._lineHeight=0; - const s=new vg({ - style:t,overrideFill:h,overrideSize:!0,...this.defaultOptions} - ); - Ag++,Ag>50&&qs(),s.once("destroy",()=>{ - Ag--,Tn.remove(n)} - ),Tn.set(n,s)} - const r=Tn.get(n); - return null==(e=r.ensureCharacters)||e.call(r,t),r} - getLayout(t,i,s=!0){ - const e=this.getFont(t,i),n=`${ - t} - -${ - i.styleKey} - -${ - s} - `; - if(this.measureCache.has(n))return this.measureCache.get(n); - const h=_g($w.graphemeSegmenter(t),i,e,s); - return this.measureCache.set(n,h),h} - measureText(t,i,s=!0){ - return this.getLayout(t,i,s)} - install(...t){ - var i,s,e,n; - let h=t[0]; - "string"==typeof h&&(h={ - name:h,style:t[1],chars:null==(i=t[2])?void 0:i.chars,resolution:null==(s=t[2])?void 0:s.resolution,padding:null==(e=t[2])?void 0:e.padding,skipKerning:null==(n=t[2])?void 0:n.skipKerning} - ,Yi(ji,"BitmapFontManager.install(name, style, options) is deprecated, use BitmapFontManager.install({ - name, style, ...options} - )")); - const r=null==h?void 0:h.name; - if(!r)throw new Error("[BitmapFontManager] Property `name` is required."); - h={ - ...this.defaultOptions,...h} - ; - const o=h.style,a=o instanceof Jw?o:new Jw(o),c=h.dynamicFill??this._canUseTintForStyle(a),l=new vg({ - style:a,overrideFill:c,skipKerning:h.skipKerning,padding:h.padding,resolution:h.resolution,overrideSize:!1,textureStyle:h.textureStyle} - ),u=Eg(h.chars); - return l.ensureCharacters(u.join("")),Tn.set(`${ - r} - -bitmap`,l),l.once("destroy",()=>Tn.remove(`${ - r} - -bitmap`)),l} - uninstall(t){ - const i=`${ - t} - -bitmap`,s=Tn.get(i); - s&&s.destroy()} - _canUseTintForStyle(t){ - return!(t._stroke||t.dropShadow&&0!==t.dropShadow.color||t._fill.fill||16777215!==t._fill.color)} - } - ; - Qt(Sg,"BitmapFontManagerClass"); - const Tg=new Sg; - function Cg(t){ - const i=t._stroke,s=t._fill,e=[`div { - ${ - [`color: ${ - Ks.shared.setValue(s.color).setAlpha(s.alpha??1).toHexa()} - `,`font-size: ${ - t.fontSize} - px`,`font-family: ${ - t.fontFamily} - `,`font-weight: ${ - t.fontWeight} - `,`font-style: ${ - t.fontStyle} - `,`font-variant: ${ - t.fontVariant} - `,`letter-spacing: ${ - t.letterSpacing} - px`,`text-align: ${ - t.align} - `,`padding: ${ - t.padding} - px`,`white-space: ${ - "pre"===t.whiteSpace&&t.wordWrap?"pre-wrap":t.whiteSpace} - `,...t.lineHeight?[`line-height: ${ - t.lineHeight} - px`]:[],...t.wordWrap?["word-break: "+(t.breakWords?"break-word":"normal"),`max-width: ${ - t.wordWrapWidth} - px`]:[],...i?[Ig(i)]:[],...t.dropShadow?[Og(t.dropShadow)]:[],...t.cssOverrides].join("; - ")} - } - `]; - return Rg(t.tagStyles,e),e.join(" ")} - function Og(t){ - const i={ - ...t} - ,s=Ks.shared.setValue(i.color).setAlpha(i.alpha??1).toHexa(),e=`${ - Math.round(Math.cos(i.angle)*i.distance)} - px ${ - Math.round(Math.sin(i.angle)*i.distance)} - px`; - return i.blur>0?`text-shadow: ${ - e} - ${ - i.blur} - px ${ - s} - `:`text-shadow: ${ - e} - ${ - s} - `} - function Ig(t){ - const i=Ks.shared.setValue(t.color).setAlpha(t.alpha??1).toHexa(); - return[`-webkit-text-stroke-width: ${ - t.width} - px`,`-webkit-text-stroke-color: ${ - i} - `,`text-stroke-width: ${ - t.width} - px`,`text-stroke-color: ${ - i} - `,"paint-order: stroke"].join("; - ")} - Qt(Cg,"textStyleToCSS"),Qt(Og,"dropShadowToCSS"),Qt(Ig,"strokeToCSS"); - const kg={ - fontSize:"font-size: { - { - VALUE} - } - px",fontFamily:"font-family: { - { - VALUE} - } - ",fontWeight:"font-weight: { - { - VALUE} - } - ",fontStyle:"font-style: { - { - VALUE} - } - ",fontVariant:"font-variant: { - { - VALUE} - } - ",letterSpacing:"letter-spacing: { - { - VALUE} - } - px",align:"text-align: { - { - VALUE} - } - ",padding:"padding: { - { - VALUE} - } - px",whiteSpace:"white-space: { - { - VALUE} - } - ",lineHeight:"line-height: { - { - VALUE} - } - px",wordWrapWidth:"max-width: { - { - VALUE} - } - px"} - ,xg={ - fill:Qt(t=>`color: ${ - Ks.shared.setValue(t).toHexa()} - `,"fill"),breakWords:Qt(t=>"word-break: "+(t?"break-all":"normal"),"breakWords"),stroke:Ig,dropShadow:Qt(t=>!0===t?Og(Jw.defaultDropShadow):t&&"object"==typeof t?Og({ - ...Jw.defaultDropShadow,...t} - ):"","dropShadow")} - ; - function Rg(t,i){ - for(const s in t){ - const e=t[s],n=[]; - for(const t in e)xg[t]?n.push(xg[t](e[t])):kg[t]&&n.push(kg[t].replace("{ - { - VALUE} - } - ",e[t])); - i.push(`${ - s} - { - ${ - n.join("; - ")} - } - `)} - } - Qt(Rg,"tagStyleToCSS"); - const Pg=class t extends Jw{ - constructor(t={ - } - ){ - super(t),this._cssOverrides=[],this.cssOverrides=t.cssOverrides??[],this.tagStyles=t.tagStyles??{ - } - } - get tagStyles(){ - return this._tagStyles} - set tagStyles(t){ - this._tagStyles!==t&&(this._tagStyles=t??{ - } - ,this.update())} - set cssOverrides(t){ - this._cssOverrides=t instanceof Array?t:[t],this.update()} - get cssOverrides(){ - return this._cssOverrides} - update(){ - this._cssStyle=null,super.update()} - clone(){ - return new t({ - align:this.align,breakWords:this.breakWords,dropShadow:this.dropShadow?{ - ...this.dropShadow} - :null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,cssOverrides:this.cssOverrides,tagStyles:{ - ...this.tagStyles} - } - )} - get cssStyle(){ - return this._cssStyle||(this._cssStyle=Cg(this)),this._cssStyle} - addOverride(...t){ - const i=t.filter(t=>!this.cssOverrides.includes(t)); - i.length>0&&(this.cssOverrides.push(...i),this.update())} - removeOverride(...t){ - const i=t.filter(t=>this.cssOverrides.includes(t)); - i.length>0&&(this.cssOverrides=this.cssOverrides.filter(t=>!i.includes(t)),this.update())} - set fill(t){ - "string"!=typeof t&&"number"!=typeof t&&qs(),super.fill=t} - set stroke(t){ - t&&"string"!=typeof t&&"number"!=typeof t&&qs(),super.stroke=t} - } - ; - Qt(Pg,"HTMLTextStyle"); - let Ng=Pg; - const Lg="http://www.w3.org/2000/svg",Dg="http://www.w3.org/1999/xhtml",Gg=class{ - constructor(){ - this.svgRoot=document.createElementNS(Lg,"svg"),this.foreignObject=document.createElementNS(Lg,"foreignObject"),this.domElement=document.createElementNS(Dg,"div"),this.styleElement=document.createElementNS(Dg,"style"); - const{ - foreignObject:t,svgRoot:i,styleElement:s,domElement:e} - =this; - t.setAttribute("width","10000"),t.setAttribute("height","10000"),t.style.overflow="hidden",i.appendChild(t),t.appendChild(s),t.appendChild(e),this.image=ln.get().createImage()} - destroy(){ - this.svgRoot.remove(),this.foreignObject.remove(),this.styleElement.remove(),this.domElement.remove(),this.image.src="",this.image.remove(),this.svgRoot=null,this.foreignObject=null,this.styleElement=null,this.domElement=null,this.image=null,this.canvasAndContext=null} - } - ; - Qt(Gg,"HTMLTextRenderData"); - let Bg,Ug=Gg; - function Fg(t,i,s,e){ - e||(e=Bg||(Bg=new Ug)); - const{ - domElement:n,styleElement:h,svgRoot:r} - =e; - n.innerHTML=`<style>${ - i.cssStyle} - ; - </style><div style='padding:0'>${ - t} - </div>`,n.setAttribute("style","transform-origin: top left; - display: inline-block"),s&&(h.textContent=s),document.body.appendChild(r); - let o=n.scrollWidth,a=n.scrollHeight; - if(r.remove(),i.dropShadow){ - const{ - distance:t,angle:s,blur:e} - =i.dropShadow; - o+=Math.abs(Math.round(Math.cos(s)*t))+e,a+=Math.abs(Math.round(Math.sin(s)*t))+e} - const c=2*i.padding; - return{ - width:o-c,height:a-c} - } - Qt(Fg,"measureHtmlText"); - const $g=class extends ig{ - constructor(){ - super(...arguments),this.generatingTexture=!1,this.currentKey="--"} - destroy(){ - this.texturePromise=null,this.generatingTexture=!1,this.currentKey="--",super.destroy()} - } - ; - Qt($g,"BatchableHTMLText"); - let Hg=$g; - const Wg=class{ - constructor(t){ - this._renderer=t,t.runners.resolutionChange.add(this),this._managedTexts=new Yc({ - renderer:t,type:"renderable",onUnload:this.onTextUnload.bind(this),name:"htmlText"} - )} - resolutionChange(){ - for(const t in this._managedTexts.items){ - const i=this._managedTexts.items[t]; - (null==i?void 0:i._autoResolution)&&i.onViewUpdate()} - } - validateRenderable(t){ - const i=this._getGpuText(t),s=t.styleKey; - return i.currentKey!==s} - addRenderable(t,i){ - const s=this._getGpuText(t); - if(t._didTextUpdate){ - const i=t._autoResolution?this._renderer.resolution:t.resolution; - s.currentKey===t.styleKey&&t.resolution===i||this._updateGpuText(t).catch(t=>{ - } - ),t._didTextUpdate=!1,Zw(s,t)} - this._renderer.renderPipes.batch.addToBatch(s,i)} - updateRenderable(t){ - const i=this._getGpuText(t); - i._batcher.updateElement(i)} - async _updateGpuText(t){ - t._didTextUpdate=!1; - const i=this._getGpuText(t); - if(i.generatingTexture)return; - const s=i.texturePromise; - i.texturePromise=null,i.generatingTexture=!0,t._resolution=t._autoResolution?this._renderer.resolution:t.resolution; - let e=this._renderer.htmlText.getTexturePromise(t); - s&&(e=e.finally(()=>{ - this._renderer.htmlText.decreaseReferenceCount(i.currentKey),this._renderer.htmlText.returnTexturePromise(s)} - )),i.texturePromise=e,i.currentKey=t.styleKey,i.texture=await e; - const n=t.renderGroup||t.parentRenderGroup; - n&&(n.structureDidChange=!0),i.generatingTexture=!1,Zw(i,t)} - _getGpuText(t){ - return t._gpuData[this._renderer.uid]||this.initGpuText(t)} - initGpuText(t){ - const i=new Hg; - return i.renderable=t,i.transform=t.groupTransform,i.texture=ls.EMPTY,i.bounds={ - minX:0,maxX:1,minY:0,maxY:0} - ,i.roundPixels=this._renderer._roundPixels|t._roundPixels,t._resolution=t._autoResolution?this._renderer.resolution:t.resolution,t._gpuData[this._renderer.uid]=i,this._managedTexts.add(t),i} - onTextUnload(t){ - const i=t._gpuData[this._renderer.uid]; - if(!i)return; - const{ - htmlText:s} - =this._renderer; - null===s.getReferenceCount(i.currentKey)?s.returnTexturePromise(i.texturePromise):s.decreaseReferenceCount(i.currentKey)} - destroy(){ - this._managedTexts.destroy(),this._renderer=null} - } - ; - Qt(Wg,"HTMLTextPipe"); - let Vg=Wg; - function jg(){ - const{ - userAgent:t} - =ln.get().getNavigator(); - return/^((?!chrome|android).)*safari/i.test(t)} - function Kg(t,i){ - const s=i.fontFamily,e=[],n={ - } - ,h=t.match(/font-family:([^; - "\s]+)/g); - function r(t){ - n[t]||(e.push(t),n[t]=!0)} - if(Qt(r,"addFontFamily"),Array.isArray(s))for(let o=0; - o<s.length; - o++)r(s[o]); - else r(s); - h&&h.forEach(t=>{ - r(t.split(":")[1].trim())} - ); - for(const o in i.tagStyles)r(i.tagStyles[o].fontFamily); - return e} - async function zg(t){ - const i=await ln.get().fetch(t),s=await i.blob(),e=new FileReader; - return await new Promise((t,i)=>{ - e.onloadend=()=>t(e.result),e.onerror=i,e.readAsDataURL(s)} - )} - async function Yg(t,i){ - const s=await zg(i); - return`@font-face { - \n font-family: "${ - t.fontFamily} - "; - \n font-weight: ${ - t.fontWeight} - ; - \n font-style: ${ - t.fontStyle} - ; - \n src: url('${ - s} - '); - \n } - `} - Vg.extension={ - type:[ri.WebGLPipes,ri.WebGPUPipes,ri.CanvasPipes],name:"htmlText"} - ,Qt(jg,"isSafari"),Qt(Kg,"extractFontFamilies"),Qt(zg,"loadFontAsBase64"),Qt(Yg,"loadFontCSS"); - const qg=new Map; - async function Xg(t){ - const i=t.filter(t=>Tn.has(`${ - t} - -and-url`)).map(t=>{ - if(!qg.has(t)){ - const{ - entries:i} - =Tn.get(`${ - t} - -and-url`),s=[]; - i.forEach(i=>{ - const e=i.url,n=i.faces.map(t=>({ - weight:t.weight,style:t.style} - )); - s.push(...n.map(i=>Yg({ - fontWeight:i.weight,fontStyle:i.style,fontFamily:t} - ,e)))} - ),qg.set(t,Promise.all(s).then(t=>t.join("\n")))} - return qg.get(t)} - ); - return(await Promise.all(i)).join("\n")} - function Jg(t,i,s,e,n){ - const{ - domElement:h,styleElement:r,svgRoot:o} - =n; - h.innerHTML=`<style>${ - i.cssStyle} - </style><div style='padding:0; - '>${ - t} - </div>`,h.setAttribute("style",`transform: scale(${ - s} - ); - transform-origin: top left; - display: inline-block`),r.textContent=e; - const{ - width:a,height:c} - =n.image; - return o.setAttribute("width",a.toString()),o.setAttribute("height",c.toString()),(new XMLSerializer).serializeToString(o)} - function Qg(t,i){ - const s=Zp.getOptimalCanvasAndContext(t.width,t.height,i),{ - context:e} - =s; - return e.clearRect(0,0,t.width,t.height),e.drawImage(t,0,0),s} - function Zg(t,i,s){ - return new Promise(async e=>{ - s&&await new Promise(t=>setTimeout(t,100)),t.onload=()=>{ - e()} - ,t.src=`data:image/svg+xml; - charset=utf8,${ - encodeURIComponent(i)} - `,t.crossOrigin="anonymous"} - )} - Qt(Xg,"getFontCss"),Qt(Jg,"getSVGUrl"),Qt(Qg,"getTemporaryCanvasFromImage"),Qt(Zg,"loadSVGImage"); - const tm=class{ - constructor(t){ - this._activeTextures={ - } - ,this._renderer=t,this._createCanvas=t.type===ar.WEBGPU} - getTexture(t){ - return this.getTexturePromise(t)} - getManagedTexture(t){ - const i=t.styleKey; - if(this._activeTextures[i])return this._increaseReferenceCount(i),this._activeTextures[i].promise; - const s=this._buildTexturePromise(t).then(t=>(this._activeTextures[i].texture=t,t)); - return this._activeTextures[i]={ - texture:null,promise:s,usageCount:1} - ,s} - getReferenceCount(t){ - var i; - return(null==(i=this._activeTextures[t])?void 0:i.usageCount)??null} - _increaseReferenceCount(t){ - this._activeTextures[t].usageCount++} - decreaseReferenceCount(t){ - const i=this._activeTextures[t]; - i&&(i.usageCount--,0===i.usageCount&&(i.texture?this._cleanUp(i.texture):i.promise.then(t=>{ - i.texture=t,this._cleanUp(i.texture)} - ).catch(()=>{ - qs()} - ),this._activeTextures[t]=null))} - getTexturePromise(t){ - return this._buildTexturePromise(t)} - async _buildTexturePromise(t){ - const{ - text:i,style:s,resolution:e,textureStyle:n,autoGenerateMipmaps:h} - =t,r=te.get(Ug),o=Kg(i,s),a=await Xg(o),c=Fg(i,s,a,r),l=Math.ceil(Math.ceil(Math.max(1,c.width)+2*s.padding)*e),u=Math.ceil(Math.ceil(Math.max(1,c.height)+2*s.padding)*e),d=r.image; - d.width=2+(0|l),d.height=2+(0|u); - const f=Jg(i,s,e,a,r); - await Zg(d,f,jg()&&o.length>0); - const p=d; - let w; - this._createCanvas&&(w=Qg(d,e)); - const g=og(w?w.canvas:p,d.width-2,d.height-2,e,h); - return n&&(g.source.style=n),this._createCanvas&&(this._renderer.texture.initSource(g.source),Zp.returnCanvasAndContext(w)),te.return(r),g} - returnTexturePromise(t){ - t.then(t=>{ - this._cleanUp(t)} - ).catch(()=>{ - qs()} - )} - _cleanUp(t){ - Be.returnTexture(t,!0),t.source.resource=null,t.source.uploadMethodId="unknown"} - destroy(){ - this._renderer=null; - for(const t in this._activeTextures)this._activeTextures[t]&&this.returnTexturePromise(this._activeTextures[t].promise); - this._activeTextures=null} - } - ; - Qt(tm,"HTMLTextSystem"); - let im=tm; - im.extension={ - type:[ri.WebGLSystem,ri.WebGPUSystem,ri.CanvasSystem],name:"htmlText"} - ,ci.add(im),ci.add(Vg); - const sm=class extends qp{ - constructor(...t){ - const i=Xp(t,"HtmlText"); - super(i,Ng),this.renderPipeId="htmlText",i.textureStyle&&(this.textureStyle=i.textureStyle instanceof ss?i.textureStyle:new ss(i.textureStyle)),this.autoGenerateMipmaps=i.autoGenerateMipmaps??ns.defaultOptions.autoGenerateMipmaps} - updateBounds(){ - const t=this._bounds,i=this._anchor,s=Fg(this.text,this._style),{ - width:e,height:n} - =s; - t.minX=-i._x*e,t.maxX=t.minX+e,t.minY=-i._y*n,t.maxY=t.minY+n} - get text(){ - return this._text} - set text(t){ - const i=this._sanitiseText(t.toString()); - super.text=i} - _sanitiseText(t){ - return this._removeInvalidHtmlTags(t.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/ - /gi,"  - "))} - _removeInvalidHtmlTags(t){ - return t.replace(/<[^>]*?(?=<|$)/g,"")} - } - ; - Qt(sm,"HTMLText"); - let em=sm; - const nm=(N=class{ - static _getPatternRepeat(t,i){ - const s=t&&"clamp-to-edge"!==t,e=i&&"clamp-to-edge"!==i; - return s&&e?"repeat":s?"repeat-x":e?"repeat-y":"no-repeat"} - start(t,i,s){ - } - execute(t,i){ - var s,e,n,h; - const r=i.elements; - if(!r||!r.length)return; - const o=t.renderer,a=o.canvasContext,c=a.activeContext; - for(let l=0; - l<r.length; - l++){ - const t=r[l]; - if(!t.packAsQuad)continue; - const u=t,d=u.texture,f=d?bp.getCanvasSource(d):null; - if(!f)continue; - const p=d.source.style,w=a.smoothProperty,g="nearest"!==p.scaleMode; - c[w]!==g&&(c[w]=g),a.setBlendMode(i.blendMode); - const m=(null==(s=o.globalUniforms.globalUniformData)?void 0:s.worldColor)??4294967295,v=u.color,_=(m>>>24&255)/255*((v>>>24&255)/255)*((null==(e=o.filter)?void 0:e.alphaMultiplier)??1); - if(_<=0)continue; - c.globalAlpha=_; - const M=ye(_e(16777215&v,16777215&m)),b=d.frame,y=p.addressModeU??p.addressMode,E=p.addressModeV??p.addressMode,A=N._getPatternRepeat(y,E),S=d.source._resolution??d.source.resolution??1,T=null==(h=null==(n=u.renderable)?void 0:n.renderGroup)?void 0:h.isCachedAsTexture,C=b.x*S,O=b.y*S,I=b.width*S,k=b.height*S,x=u.bounds,R=o.renderTarget.renderTarget.isRoot,P=x.minX,L=x.minY,D=x.maxX-x.minX,G=x.maxY-x.minY,B=d.rotate,U=d.uvs,F=Math.min(U.x0,U.x1,U.x2,U.x3,U.y0,U.y1,U.y2,U.y3),$=Math.max(U.x0,U.x1,U.x2,U.x3,U.y0,U.y1,U.y2,U.y3),H="no-repeat"!==A&&(F<0||$>1),W=B&&!(!H&&(16777215!==M||B)); - W?(N._tempPatternMatrix.copyFrom(u.transform),Bi.matrixAppendRotationInv(N._tempPatternMatrix,B,P,L,D,G),a.setContextTransform(N._tempPatternMatrix,1===u.roundPixels,void 0,T&&R)):a.setContextTransform(u.transform,1===u.roundPixels,void 0,T&&R); - const V=W?0:P,j=W?0:L,K=D,z=G; - if(H){ - let t=f; - const i=16777215!==M&&!B,s=b.width<=d.source.width&&b.height<=d.source.height; - i&&s&&(t=bp.getTintedCanvas({ - texture:d} - ,M)); - const e=c.createPattern(t,A); - if(!e)continue; - const n=K,h=z; - if(0===n||0===h)continue; - const r=1/n,o=1/h,a=(U.x1-U.x0)*r,l=(U.y1-U.y0)*r,u=(U.x3-U.x0)*o,p=(U.y3-U.y0)*o,w=U.x0-a*V-u*j,g=U.y0-l*V-p*j,m=d.source.pixelWidth,v=d.source.pixelHeight; - N._tempPatternMatrix.set(a*m,l*v,u*m,p*v,w*m,g*v),bp.applyPatternTransform(e,N._tempPatternMatrix),c.fillStyle=e,c.fillRect(V,j,K,z)} - else{ - const t=16777215!==M||B?bp.getTintedCanvas({ - texture:d} - ,M):f,i=t!==f; - c.drawImage(t,i?0:C,i?0:O,i?t.width:I,i?t.height:k,V,j,K,z)} - } - } - } - ,Qt(N,"_CanvasBatchAdaptor"),N); - nm._tempPatternMatrix=new Ci,nm.extension={ - type:[ri.CanvasPipesAdaptor],name:"batch"} - ; - let hm=nm; - const rm=class{ - constructor(){ - this._tempState=fr.for2d(),this._didUploadHash={ - } - } - init(t){ - t.renderer.runners.contextChange.add(this)} - contextChange(){ - this._didUploadHash={ - } - } - start(t,i,s){ - const e=t.renderer,n=this._didUploadHash[s.uid]; - e.shader.bind(s,n),n||(this._didUploadHash[s.uid]=!0),e.shader.updateUniformGroup(e.globalUniforms.uniformGroup),e.geometry.bind(i,s.glProgram)} - execute(t,i){ - const s=t.renderer; - this._tempState.blendMode=i.blendMode,s.state.set(this._tempState); - const e=i.textures.textures; - for(let n=0; - n<i.textures.count; - n++)s.texture.bind(e[n],n); - s.geometry.draw(i.topology,i.size,i.start)} - } - ; - Qt(rm,"GlBatchAdaptor"); - let om=rm; - om.extension={ - type:[ri.WebGLPipesAdaptor],name:"batch"} - ; - const am=fr.for2d(),cm=class{ - start(t,i,s){ - const e=t.renderer,n=e.encoder,h=s.gpuProgram; - this._shader=s,this._geometry=i,n.setGeometry(i,h),am.blendMode="normal",e.pipeline.getPipeline(i,h,am); - const r=e.globalUniforms.bindGroup; - n.resetBindGroup(1),n.setBindGroup(0,r,h)} - execute(t,i){ - const s=this._shader.gpuProgram,e=t.renderer,n=e.encoder; - if(!i.bindGroup){ - const t=i.textures; - i.bindGroup=ya(t.textures,t.count,e.limits.maxBatchableTextures)} - am.blendMode=i.blendMode; - const h=e.bindGroup.getBindGroup(i.bindGroup,s,1),r=e.pipeline.getPipeline(this._geometry,s,am,i.topology); - i.bindGroup._touch(e.gc.now,e.tick),n.setPipeline(r),n.renderPassEncoder.setBindGroup(1,h),n.renderPassEncoder.drawIndexed(i.size,1,i.start)} - } - ; - Qt(cm,"GpuBatchAdaptor"); - let lm=cm; - lm.extension={ - type:[ri.WebGPUPipesAdaptor],name:"batch"} - ; - const um=(Qt(L=class{ - constructor(t,i){ - var s,e; - this.state=fr.for2d(),this._batchersByInstructionSet=Object.create(null),this._activeBatches=Object.create(null),this.renderer=t,this._adaptor=i,null==(e=(s=this._adaptor).init)||e.call(s,this)} - static getBatcher(t){ - return new this._availableBatchers[t]} - buildStart(t){ - let i=this._batchersByInstructionSet[t.uid]; - i||(i=this._batchersByInstructionSet[t.uid]=Object.create(null),i.default||(i.default=new Kc({ - maxTextures:this.renderer.limits.maxBatchableTextures} - ))),this._activeBatches=i,this._activeBatch=this._activeBatches.default; - for(const s in this._activeBatches)this._activeBatches[s].begin()} - addToBatch(t,i){ - if(this._activeBatch.name!==t.batcherName){ - this._activeBatch.break(i); - let s=this._activeBatches[t.batcherName]; - s||(s=this._activeBatches[t.batcherName]=L.getBatcher(t.batcherName),s.begin()),this._activeBatch=s} - this._activeBatch.add(t)} - break(t){ - this._activeBatch.break(t)} - buildEnd(t){ - this._activeBatch.break(t); - const i=this._activeBatches; - for(const s in i){ - const t=i[s],e=t.geometry; - e.indexBuffer.setDataWithSize(t.indexBuffer,t.indexSize,!0),e.buffers[0].setDataWithSize(t.attributeBuffer.float32View,t.attributeSize,!1)} - } - upload(t){ - const i=this._batchersByInstructionSet[t.uid]; - for(const s in i){ - const t=i[s],e=t.geometry; - t.dirty&&(t.dirty=!1,e.buffers[0].update(4*t.attributeSize))} - } - execute(t){ - if("startBatch"===t.action){ - const i=t.batcher,s=i.geometry,e=i.shader; - this._adaptor.start(this,s,e)} - this._adaptor.execute(this,t)} - destroy(){ - this.state=null,this.renderer=null,this._adaptor=null; - for(const t in this._activeBatches)this._activeBatches[t].destroy(); - this._activeBatches=null} - } - ,"_BatcherPipe"),L); - um.extension={ - type:[ri.WebGLPipes,ri.WebGPUPipes,ri.CanvasPipes],name:"batch"} - ,um._availableBatchers=Object.create(null); - let dm=um; - ci.handleByMap(ri.Batcher,dm._availableBatchers),ci.add(Kc); - const fm={ - name:"texture-bit",vertex:{ - header:"\n\n struct TextureUniforms { - \n uTextureMatrix:mat3x3<f32>,\n } - \n\n @group(2) @binding(2) var<uniform> textureUniforms : TextureUniforms; - \n ",main:"\n uv = (textureUniforms.uTextureMatrix * vec3(uv, 1.0)).xy; - \n "} - ,fragment:{ - header:"\n @group(2) @binding(0) var uTexture: texture_2d<f32>; - \n @group(2) @binding(1) var uSampler: sampler; - \n\n\n ",main:"\n outColor = textureSample(uTexture, uSampler, vUV); - \n "} - } - ,pm={ - name:"texture-bit",vertex:{ - header:"\n uniform mat3 uTextureMatrix; - \n ",main:"\n uv = (uTextureMatrix * vec3(uv, 1.0)).xy; - \n "} - ,fragment:{ - header:"\n uniform sampler2D uTexture; - \n\n\n ",main:"\n outColor = texture(uTexture, vUV); - \n "} - } - ,wm=new ps,gm=class extends re{ - constructor(){ - super(),this.filters=[new Hf({ - sprite:new Xe(ls.EMPTY),inverse:!1,resolution:"inherit",antialias:"inherit"} - )]} - get sprite(){ - return this.filters[0].sprite} - set sprite(t){ - this.filters[0].sprite=t} - get inverse(){ - return this.filters[0].inverse} - set inverse(t){ - this.filters[0].inverse=t} - } - ; - Qt(gm,"AlphaMaskEffect"); - let mm=gm; - const vm=class{ - constructor(t){ - this._activeMaskStage=[],this._renderer=t} - push(t,i,s){ - const e=this._renderer; - if(e.renderPipes.batch.break(s),s.add({ - renderPipeId:"alphaMask",action:"pushMaskBegin",mask:t,inverse:i._maskOptions.inverse,canBundle:!1,maskedContainer:i} - ),t.inverse=i._maskOptions.inverse,t.renderMaskToTexture){ - const i=t.mask; - i.includeInBuild=!0,i.collectRenderables(s,e,null),i.includeInBuild=!1} - e.renderPipes.batch.break(s),s.add({ - renderPipeId:"alphaMask",action:"pushMaskEnd",mask:t,maskedContainer:i,inverse:i._maskOptions.inverse,canBundle:!1} - )} - pop(t,i,s){ - this._renderer.renderPipes.batch.break(s),s.add({ - renderPipeId:"alphaMask",action:"popMaskEnd",mask:t,inverse:i._maskOptions.inverse,canBundle:!1} - )} - execute(t){ - const i=this._renderer,s=t.mask.renderMaskToTexture; - if("pushMaskBegin"===t.action){ - const e=te.get(mm); - if(e.inverse=t.inverse,s){ - t.mask.mask.measurable=!0; - const s=ge(t.mask.mask,!0,wm); - t.mask.mask.measurable=!1,s.ceil(); - const n=i.renderTarget.renderTarget.colorTexture.source,h=Be.getOptimalTexture(s.width,s.height,n._resolution,n.antialias); - i.renderTarget.push(h,!0),i.globalUniforms.push({ - offset:s,worldColor:4294967295} - ); - const r=e.sprite; - r.texture=h,r.worldTransform.tx=s.minX,r.worldTransform.ty=s.minY,this._activeMaskStage.push({ - filterEffect:e,maskedContainer:t.maskedContainer,filterTexture:h} - )} - else e.sprite=t.mask.mask,this._activeMaskStage.push({ - filterEffect:e,maskedContainer:t.maskedContainer} - )} - else if("pushMaskEnd"===t.action){ - const t=this._activeMaskStage[this._activeMaskStage.length-1]; - s&&(i.type===ar.WEBGL&&i.renderTarget.finishRenderPass(),i.renderTarget.pop(),i.globalUniforms.pop()),i.filter.push({ - renderPipeId:"filter",action:"pushFilter",container:t.maskedContainer,filterEffect:t.filterEffect,canBundle:!1} - )} - else if("popMaskEnd"===t.action){ - i.filter.pop(); - const t=this._activeMaskStage.pop(); - s&&Be.returnTexture(t.filterTexture),te.return(t.filterEffect)} - } - destroy(){ - this._renderer=null,this._activeMaskStage=null} - } - ; - Qt(vm,"AlphaMaskPipe"); - let _m=vm; - _m.extension={ - type:[ri.WebGLPipes,ri.WebGPUPipes,ri.CanvasPipes],name:"alphaMask"} - ; - const Mm=class{ - constructor(t){ - this._colorStack=[],this._colorStackIndex=0,this._currentColor=0,this._renderer=t} - buildStart(){ - this._colorStack[0]=15,this._colorStackIndex=1,this._currentColor=15} - push(t,i,s){ - this._renderer.renderPipes.batch.break(s); - const e=this._colorStack; - e[this._colorStackIndex]=e[this._colorStackIndex-1]&t.mask; - const n=this._colorStack[this._colorStackIndex]; - n!==this._currentColor&&(this._currentColor=n,s.add({ - renderPipeId:"colorMask",colorMask:n,canBundle:!1} - )),this._colorStackIndex++} - pop(t,i,s){ - this._renderer.renderPipes.batch.break(s); - const e=this._colorStack; - this._colorStackIndex--; - const n=e[this._colorStackIndex-1]; - n!==this._currentColor&&(this._currentColor=n,s.add({ - renderPipeId:"colorMask",colorMask:n,canBundle:!1} - ))} - execute(t){ - } - destroy(){ - this._renderer=null,this._colorStack=null} - } - ; - Qt(Mm,"CanvasColorMaskPipe"); - let bm=Mm; - bm.extension={ - type:[ri.CanvasPipes],name:"colorMask"} - ; - const ym=class{ - constructor(t){ - this._colorStack=[],this._colorStackIndex=0,this._currentColor=0,this._renderer=t} - buildStart(){ - this._colorStack[0]=15,this._colorStackIndex=1,this._currentColor=15} - push(t,i,s){ - this._renderer.renderPipes.batch.break(s); - const e=this._colorStack; - e[this._colorStackIndex]=e[this._colorStackIndex-1]&t.mask; - const n=this._colorStack[this._colorStackIndex]; - n!==this._currentColor&&(this._currentColor=n,s.add({ - renderPipeId:"colorMask",colorMask:n,canBundle:!1} - )),this._colorStackIndex++} - pop(t,i,s){ - this._renderer.renderPipes.batch.break(s); - const e=this._colorStack; - this._colorStackIndex--; - const n=e[this._colorStackIndex-1]; - n!==this._currentColor&&(this._currentColor=n,s.add({ - renderPipeId:"colorMask",colorMask:n,canBundle:!1} - ))} - execute(t){ - this._renderer.colorMask.setMask(t.colorMask)} - destroy(){ - this._renderer=null,this._colorStack=null} - } - ; - Qt(ym,"ColorMaskPipe"); - let Em=ym; - function Am(t,i,s,e,n,h){ - h=Math.max(0,Math.min(h,Math.min(e,n)/2)),t.moveTo(i+h,s),t.lineTo(i+e-h,s),t.quadraticCurveTo(i+e,s,i+e,s+h),t.lineTo(i+e,s+n-h),t.quadraticCurveTo(i+e,s+n,i+e-h,s+n),t.lineTo(i+h,s+n),t.quadraticCurveTo(i,s+n,i,s+n-h),t.lineTo(i,s+h),t.quadraticCurveTo(i,s,i+h,s)} - function Sm(t,i){ - switch(i.type){ - case"rectangle":{ - const s=i; - t.rect(s.x,s.y,s.width,s.height); - break} - case"roundedRectangle":{ - const s=i; - Am(t,s.x,s.y,s.width,s.height,s.radius); - break} - case"circle":{ - const s=i; - t.moveTo(s.x+s.radius,s.y),t.arc(s.x,s.y,s.radius,0,2*Math.PI); - break} - case"ellipse":{ - const s=i; - t.ellipse?(t.moveTo(s.x+s.halfWidth,s.y),t.ellipse(s.x,s.y,s.halfWidth,s.halfHeight,0,0,2*Math.PI)):(t.save(),t.translate(s.x,s.y),t.scale(s.halfWidth,s.halfHeight),t.moveTo(1,0),t.arc(0,0,1,0,2*Math.PI),t.restore()); - break} - case"triangle":{ - const s=i; - t.moveTo(s.x,s.y),t.lineTo(s.x2,s.y2),t.lineTo(s.x3,s.y3),t.closePath(); - break} - default:{ - const s=i,e=s.points; - if(!(null==e?void 0:e.length))break; - t.moveTo(e[0],e[1]); - for(let i=2; - i<e.length; - i+=2)t.lineTo(e[i],e[i+1]); - s.closePath&&t.closePath(); - break} - } - } - function Tm(t,i){ - if(!(null==i?void 0:i.length))return!1; - for(let s=0; - s<i.length; - s++){ - const e=i[s]; - if(!(null==e?void 0:e.shape))continue; - const n=e.transform,h=n&&!n.isIdentity(); - h&&(t.save(),t.transform(n.a,n.b,n.c,n.d,n.tx,n.ty)),Sm(t,e.shape),h&&t.restore()} - return!0} - Em.extension={ - type:[ri.WebGLPipes,ri.WebGPUPipes],name:"colorMask"} - ,Qt(Am,"buildRoundedRectPath$1"),Qt(Sm,"buildShapePath$1"),Qt(Tm,"addHolePaths$1"); - const Cm=class{ - constructor(t){ - this._warnedMaskTypes=new Set,this._canvasMaskStack=[],this._renderer=t} - push(t,i,s){ - this._renderer.renderPipes.batch.break(s),s.add({ - renderPipeId:"stencilMask",action:"pushMaskBegin",mask:t,inverse:i._maskOptions.inverse,canBundle:!1} - )} - pop(t,i,s){ - this._renderer.renderPipes.batch.break(s),s.add({ - renderPipeId:"stencilMask",action:"popMaskEnd",mask:t,inverse:i._maskOptions.inverse,canBundle:!1} - )} - execute(t){ - var i,s,e; - if("pushMaskBegin"!==t.action&&"popMaskEnd"!==t.action)return; - const n=this._renderer,h=n.canvasContext,r=null==h?void 0:h.activeContext; - if(!r)return; - if("popMaskEnd"===t.action)return void(this._canvasMaskStack.pop()&&r.restore()); - t.inverse&&this._warnOnce("inverse","CanvasRenderer: inverse masks are not supported on Canvas2D; - ignoring inverse flag."); - const o=t.mask.mask; - if(!(o instanceof ep))return this._warnOnce("nonGraphics","CanvasRenderer: only Graphics masks are supported in Canvas2D; - skipping mask."),void this._canvasMaskStack.push(!1); - const a=o,c=null==(i=a.context)?void 0:i.instructions; - if(!(null==c?void 0:c.length))return void this._canvasMaskStack.push(!1); - r.save(),h.setContextTransform(a.groupTransform,1===(n._roundPixels|a._roundPixels)),r.beginPath(); - let l=!1,u=!1; - for(let d=0; - d<c.length; - d++){ - const t=c[d],i=t.action; - if("fill"!==i&&"stroke"!==i)continue; - const n=t.data,h=null==(s=null==n?void 0:n.path)?void 0:s.shapePath; - if(!(null==(e=null==h?void 0:h.shapePrimitives)?void 0:e.length))continue; - const o=h.shapePrimitives; - for(let s=0; - s<o.length; - s++){ - const t=o[s]; - if(!(null==t?void 0:t.shape))continue; - const i=t.transform,e=i&&!i.isIdentity(); - e&&(r.save(),r.transform(i.a,i.b,i.c,i.d,i.tx,i.ty)),Sm(r,t.shape),u=Tm(r,t.holes)||u,l=!0,e&&r.restore()} - } - if(!l)return r.restore(),void this._canvasMaskStack.push(!1); - u?r.clip("evenodd"):r.clip(),this._canvasMaskStack.push(!0)} - destroy(){ - this._renderer=null,this._warnedMaskTypes=null,this._canvasMaskStack=null} - _warnOnce(t,i){ - this._warnedMaskTypes.has(t)||(this._warnedMaskTypes.add(t),qs())} - } - ; - Qt(Cm,"CanvasStencilMaskPipe"); - let Om=Cm; - Om.extension={ - type:[ri.CanvasPipes],name:"stencilMask"} - ; - const Im=class{ - constructor(t){ - this._maskStackHash={ - } - ,this._maskHash=new WeakMap,this._renderer=t} - push(t,i,s){ - var e; - const n=t,h=this._renderer; - h.renderPipes.batch.break(s),h.renderPipes.blendMode.setBlendMode(n.mask,"none",s),s.add({ - renderPipeId:"stencilMask",action:"pushMaskBegin",mask:t,inverse:i._maskOptions.inverse,canBundle:!1} - ); - const r=n.mask; - r.includeInBuild=!0,this._maskHash.has(n)||this._maskHash.set(n,{ - instructionsStart:0,instructionsLength:0} - ); - const o=this._maskHash.get(n); - o.instructionsStart=s.instructionSize,r.collectRenderables(s,h,null),r.includeInBuild=!1,h.renderPipes.batch.break(s),s.add({ - renderPipeId:"stencilMask",action:"pushMaskEnd",mask:t,inverse:i._maskOptions.inverse,canBundle:!1} - ); - const a=s.instructionSize-o.instructionsStart-1; - o.instructionsLength=a; - const c=h.renderTarget.renderTarget.uid; - (e=this._maskStackHash)[c]??(e[c]=0)} - pop(t,i,s){ - const e=t,n=this._renderer; - n.renderPipes.batch.break(s),n.renderPipes.blendMode.setBlendMode(e.mask,"none",s),s.add({ - renderPipeId:"stencilMask",action:"popMaskBegin",inverse:i._maskOptions.inverse,canBundle:!1} - ); - const h=this._maskHash.get(t); - for(let r=0; - r<h.instructionsLength; - r++)s.instructions[s.instructionSize++]=s.instructions[h.instructionsStart++]; - s.add({ - renderPipeId:"stencilMask",action:"popMaskEnd",canBundle:!1} - )} - execute(t){ - var i; - const s=this._renderer,e=s,n=s.renderTarget.renderTarget.uid; - let h=(i=this._maskStackHash)[n]??(i[n]=0); - "pushMaskBegin"===t.action?(e.renderTarget.ensureDepthStencil(),e.stencil.setStencilMode(Oa.RENDERING_MASK_ADD,h),h++,e.colorMask.setMask(0)):"pushMaskEnd"===t.action?(t.inverse?e.stencil.setStencilMode(Oa.INVERSE_MASK_ACTIVE,h):e.stencil.setStencilMode(Oa.MASK_ACTIVE,h),e.colorMask.setMask(15)):"popMaskBegin"===t.action?(e.colorMask.setMask(0),0!==h?e.stencil.setStencilMode(Oa.RENDERING_MASK_REMOVE,h):(e.renderTarget.clear(null,to.STENCIL),e.stencil.setStencilMode(Oa.DISABLED,h)),h--):"popMaskEnd"===t.action&&(t.inverse?e.stencil.setStencilMode(Oa.INVERSE_MASK_ACTIVE,h):e.stencil.setStencilMode(Oa.MASK_ACTIVE,h),e.colorMask.setMask(15)),this._maskStackHash[n]=h} - destroy(){ - this._renderer=null,this._maskStackHash=null,this._maskHash=null} - } - ; - Qt(Im,"StencilMaskPipe"); - let km=Im; - km.extension={ - type:[ri.WebGLPipes,ri.WebGPUPipes],name:"stencilMask"} - ; - const xm="source-over"; - function Rm(){ - const t=Mp(),i=Object.create(null); - return i.inherit=xm,i.none=xm,i.normal="source-over",i.add="lighter",i.multiply=t?"multiply":xm,i.screen=t?"screen":xm,i.overlay=t?"overlay":xm,i.darken=t?"darken":xm,i.lighten=t?"lighten":xm,i["color-dodge"]=t?"color-dodge":xm,i["color-burn"]=t?"color-burn":xm,i["hard-light"]=t?"hard-light":xm,i["soft-light"]=t?"soft-light":xm,i.difference=t?"difference":xm,i.exclusion=t?"exclusion":xm,i.saturation=t?"saturation":xm,i.color=t?"color":xm,i.luminosity=t?"luminosity":xm,i["linear-burn"]=t?"color-burn":xm,i["linear-dodge"]=t?"color-dodge":xm,i["linear-light"]=t?"hard-light":xm,i["pin-light"]=t?"hard-light":xm,i["vivid-light"]=t?"hard-light":xm,i["hard-mix"]=xm,i.negation=t?"difference":xm,i["normal-npm"]=i.normal,i["add-npm"]=i.add,i["screen-npm"]=i.screen,i.erase="destination-out",i.subtract=xm,i.divide=xm,i.min=xm,i.max=xm,i} - Qt(Rm,"mapCanvasBlendModesToPixi"); - const Pm=new Ci,Nm=class{ - constructor(t){ - this.activeResolution=1,this.smoothProperty="imageSmoothingEnabled",this.blendModes=Rm(),this._activeBlendMode="normal",this._projTransform=null,this._outerBlend=!1,this._warnedBlendModes=new Set,this._renderer=t} - resolutionChange(t){ - this.activeResolution=t} - init(){ - const t=this._renderer.background.alpha<1; - if(this.rootContext=this._renderer.canvas.getContext("2d",{ - alpha:t} - ),this.activeContext=this.rootContext,this.activeResolution=this._renderer.resolution,!this.rootContext.imageSmoothingEnabled){ - const t=this.rootContext; - t.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":t.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":t.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":t.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")} - } - setContextTransform(t,i,s,e){ - var n; - const h=e?Ci.IDENTITY:(null==(n=this._renderer.globalUniforms.globalUniformData)?void 0:n.worldTransformMatrix)||Ci.IDENTITY; - let r=Pm; - r.copyFrom(h),r.append(t); - const o=this._projTransform,a=this.activeResolution; - if(s=s||a,o){ - const t=Ci.shared; - t.copyFrom(r),t.prepend(o),r=t} - i?this.activeContext.setTransform(r.a*s,r.b*s,r.c*s,r.d*s,r.tx*a|0,r.ty*a|0):this.activeContext.setTransform(r.a*s,r.b*s,r.c*s,r.d*s,r.tx*a,r.ty*a)} - clear(t,i){ - const s=this.activeContext,e=this._renderer; - if(s.clearRect(0,0,e.width,e.height),t){ - const n=Ks.shared.setValue(t); - s.globalAlpha=i??n.alpha,s.fillStyle=n.toHex(),s.fillRect(0,0,e.width,e.height),s.globalAlpha=1} - } - setBlendMode(t){ - if(this._activeBlendMode===t)return; - this._activeBlendMode=t,this._outerBlend=!1; - const i=this.blendModes[t]; - if(!i)return this._warnedBlendModes.has(t)||this._warnedBlendModes.add(t),void(this.activeContext.globalCompositeOperation="source-over"); - this.activeContext.globalCompositeOperation=i} - destroy(){ - this.rootContext=null,this.activeContext=null,this._warnedBlendModes.clear()} - } - ; - Qt(Nm,"CanvasContextSystem"); - let Lm=Nm; - Lm.extension={ - type:[ri.CanvasSystem],name:"canvasContext"} - ; - const Dm=class{ - constructor(){ - this.maxTextures=16,this.maxBatchableTextures=16,this.maxUniformBindings=0} - init(){ - } - } - ; - Qt(Dm,"CanvasLimitsSystem"); - let Gm=Dm; - Gm.extension={ - type:[ri.CanvasSystem],name:"limits"} - ; - const Bm=class{ - constructor(t){ - this._renderer=t} - updateRenderable(){ - } - destroyRenderable(){ - } - validateRenderable(){ - return!1} - addRenderable(t,i){ - this._renderer.renderPipes.batch.break(i),i.add(t)} - execute(t){ - t.isRenderable&&t.render(this._renderer)} - destroy(){ - this._renderer=null} - } - ; - Qt(Bm,"CustomRenderPipe"); - let Um=Bm; - function Fm(t,i){ - const s=t.instructionSet,e=s.instructions; - for(let n=0; - n<s.instructionSize; - n++){ - const t=e[n]; - i[t.renderPipeId].execute(t)} - } - Um.extension={ - type:[ri.WebGLPipes,ri.WebGPUPipes,ri.CanvasPipes],name:"customRender"} - ,Qt(Fm,"executeInstructions"); - const $m=class{ - constructor(t){ - this._renderer=t} - addRenderGroup(t,i){ - t.isCachedAsTexture?this._addRenderableCacheAsTexture(t,i):this._addRenderableDirect(t,i)} - execute(t){ - t.isRenderable&&(t.isCachedAsTexture?this._executeCacheAsTexture(t):this._executeDirect(t))} - destroy(){ - this._renderer=null} - _addRenderableDirect(t,i){ - this._renderer.renderPipes.batch.break(i),t._batchableRenderGroup&&(te.return(t._batchableRenderGroup),t._batchableRenderGroup=null),i.add(t)} - _addRenderableCacheAsTexture(t,i){ - const s=t._batchableRenderGroup??(t._batchableRenderGroup=te.get(ig)); - s.renderable=t.root,s.transform=t.root.relativeGroupTransform,s.texture=t.texture,s.bounds=t._textureBounds,i.add(t),this._renderer.renderPipes.blendMode.pushBlendMode(t,t.root.groupBlendMode,i),this._renderer.renderPipes.batch.addToBatch(s,i),this._renderer.renderPipes.blendMode.popBlendMode(i)} - _executeCacheAsTexture(t){ - if(t.textureNeedsUpdate){ - t.textureNeedsUpdate=!1; - const i=(new Ci).translate(-t._textureBounds.x,-t._textureBounds.y); - this._renderer.renderTarget.push(t.texture,!0,null,t.texture.frame),this._renderer.globalUniforms.push({ - worldTransformMatrix:i,worldColor:4294967295,offset:{ - x:0,y:0} - } - ),Fm(t,this._renderer.renderPipes),this._renderer.renderTarget.finishRenderPass(),this._renderer.renderTarget.pop(),this._renderer.globalUniforms.pop()} - t._batchableRenderGroup._batcher.updateElement(t._batchableRenderGroup),t._batchableRenderGroup._batcher.geometry.buffers[0].update()} - _executeDirect(t){ - this._renderer.globalUniforms.push({ - worldTransformMatrix:t.inverseParentTextureTransform,worldColor:t.worldColorAlpha} - ),Fm(t,this._renderer.renderPipes),this._renderer.globalUniforms.pop()} - } - ; - Qt($m,"RenderGroupPipe"); - let Hm=$m; - Hm.extension={ - type:[ri.WebGLPipes,ri.WebGPUPipes,ri.CanvasPipes],name:"renderGroup"} - ; - const Wm=new Ci,Vm=new Ci,jm=new Ci,Km=new Ci; - function zm(t,i,s){ - t.beginPath(); - for(let e=0; - e<s.length; - e+=3){ - const n=2*s[e],h=2*s[e+1],r=2*s[e+2]; - t.moveTo(i[n],i[n+1]),t.lineTo(i[h],i[h+1]),t.lineTo(i[r],i[r+1]),t.closePath()} - t.fill()} - function Ym(t){ - return`#${ - (16777215&t).toString(16).padStart(6,"0")} - `} - function qm(t,i,s,e,n,h){ - h=Math.max(0,Math.min(h,Math.min(e,n)/2)),t.moveTo(i+h,s),t.lineTo(i+e-h,s),t.quadraticCurveTo(i+e,s,i+e,s+h),t.lineTo(i+e,s+n-h),t.quadraticCurveTo(i+e,s+n,i+e-h,s+n),t.lineTo(i+h,s+n),t.quadraticCurveTo(i,s+n,i,s+n-h),t.lineTo(i,s+h),t.quadraticCurveTo(i,s,i+h,s)} - function Xm(t,i){ - switch(i.type){ - case"rectangle":{ - const s=i; - t.rect(s.x,s.y,s.width,s.height); - break} - case"roundedRectangle":{ - const s=i; - qm(t,s.x,s.y,s.width,s.height,s.radius); - break} - case"circle":{ - const s=i; - t.arc(s.x,s.y,s.radius,0,2*Math.PI); - break} - case"ellipse":{ - const s=i; - t.ellipse?t.ellipse(s.x,s.y,s.halfWidth,s.halfHeight,0,0,2*Math.PI):(t.save(),t.translate(s.x,s.y),t.scale(s.halfWidth,s.halfHeight),t.arc(0,0,1,0,2*Math.PI),t.restore()); - break} - case"triangle":{ - const s=i; - t.moveTo(s.x,s.y),t.lineTo(s.x2,s.y2),t.lineTo(s.x3,s.y3),t.closePath(); - break} - default:{ - const s=i,e=s.points; - if(!(null==e?void 0:e.length))break; - t.moveTo(e[0],e[1]); - for(let i=2; - i<e.length; - i+=2)t.lineTo(e[i],e[i+1]); - s.closePath&&t.closePath(); - break} - } - } - function Jm(t,i){ - if(!(null==i?void 0:i.length))return!1; - for(let s=0; - s<i.length; - s++){ - const e=i[s]; - if(!(null==e?void 0:e.shape))continue; - const n=e.transform,h=n&&!n.isIdentity(); - h&&(t.save(),t.transform(n.a,n.b,n.c,n.d,n.tx,n.ty)),Xm(t,e.shape),h&&t.restore()} - return!0} - function Qm(t,i,s,e){ - const n=t.fill; - if(n instanceof ml){ - n.buildGradient(); - const h=n.texture; - if(h){ - const r=bp.getTintedPattern(h,i),o=s?Km.copyFrom(s).scale(h.source.pixelWidth,h.source.pixelHeight):Km.copyFrom(n.transform); - return e&&!t.textureSpace&&o.append(e),bp.applyPatternTransform(r,o),r} - } - if(n instanceof Eu){ - const t=bp.getTintedPattern(n.texture,i); - return bp.applyPatternTransform(t,n.transform),t} - const h=t.texture; - if(h&&h!==ls.WHITE){ - if(!h.source.resource)return"#808080"; - const e=bp.getTintedPattern(h,i),n=s?Km.copyFrom(s).scale(h.source.pixelWidth,h.source.pixelHeight):t.matrix; - return bp.applyPatternTransform(e,n),e} - return Ym(i)} - Qt(zm,"fillTriangles"),Qt(Ym,"colorToHex"),Qt(qm,"buildRoundedRectPath"),Qt(Xm,"buildShapePath"),Qt(Jm,"addHolePaths"),Qt(Qm,"getCanvasStyle"); - const Zm=class{ - constructor(){ - this.shader=null} - contextChange(t){ - } - execute(t,i){ - var s,e,n,h,r,o,a; - const c=t.renderer,l=c.canvasContext,u=l.activeContext,d=i.groupTransform,f=(null==(s=c.globalUniforms.globalUniformData)?void 0:s.worldColor)??4294967295,p=i.groupColorAlpha,w=(f>>>24&255)/255*((p>>>24&255)/255)*((null==(e=c.filter)?void 0:e.alphaMultiplier)??1); - if(w<=0)return; - const g=ye(_e(16777215&p,16777215&f)),m=c._roundPixels|i._roundPixels; - u.save(),l.setContextTransform(d,1===m),l.setBlendMode(i.groupBlendMode); - const v=i.context.instructions; - for(let _=0; - _<v.length; - _++){ - const t=v[_]; - if("texture"===t.action){ - const i=t.data,s=i.image,e=s?bp.getCanvasSource(s):null; - if(!e)continue; - const n=i.alpha*w; - if(n<=0)continue; - const h=_e(i.style,g); - u.globalAlpha=n; - let r=e; - 16777215!==h&&(r=bp.getTintedCanvas({ - texture:s} - ,h)); - const o=s.frame,a=s.source._resolution??s.source.resolution??1; - let c=o.x*a,f=o.y*a; - const p=o.width*a,v=o.height*a; - r!==e&&(c=0,f=0); - const _=i.transform,M=_&&!_.isIdentity(),b=s.rotate; - M||b?(Wm.copyFrom(d),M&&Wm.append(_),b&&Bi.matrixAppendRotationInv(Wm,b,i.dx,i.dy,i.dw,i.dh),l.setContextTransform(Wm,1===m)):l.setContextTransform(d,1===m),u.drawImage(r,c,f,r===e?p:r.width,r===e?v:r.height,b?0:i.dx,b?0:i.dy,i.dw,i.dh),(M||b)&&l.setContextTransform(d,1===m); - continue} - const i=t.data,s=null==(n=null==i?void 0:i.path)?void 0:n.shapePath; - if(!(null==(h=null==s?void 0:s.shapePrimitives)?void 0:h.length))continue; - const e=i.style,c=_e(e.color,g),f=e.alpha*w; - if(f<=0)continue; - const p="stroke"===t.action; - if(u.globalAlpha=f,p){ - const t=e; - u.lineWidth=t.width,u.lineCap=t.cap,u.lineJoin=t.join,u.miterLimit=t.miterLimit} - const M=s.shapePrimitives; - !p&&(null==(a=null==(o=null==(r=i.hole)?void 0:r.shapePath)?void 0:o.shapePrimitives)?void 0:a.length)&&(M[M.length-1].holes=i.hole.shapePath.shapePrimitives); - for(let n=0; - n<M.length; - n++){ - const t=M[n]; - if(!(null==t?void 0:t.shape))continue; - const i=t.transform,s=i&&!i.isIdentity(),h=e.texture&&e.texture!==ls.WHITE,r="global"===e.textureSpace?i:null,o=Qm(e,c,h?El(Vm,e,t.shape,r):null,s?jm.copyFrom(d).append(i):d); - if(s&&(u.save(),u.transform(i.a,i.b,i.c,i.d,i.tx,i.ty)),p){ - const i=e; - if(.5===i.alignment||i.pixelLine)u.strokeStyle=o,u.beginPath(),Xm(u,t.shape),u.stroke(); - else{ - const s=[],e=[],n=[],h=Al[t.shape.type]; - (null==h?void 0:h.build(t.shape,s))?(al(s,i,0,t.shape.closePath??!0,e,n),u.fillStyle=o,zm(u,e,n)):(u.strokeStyle=o,u.beginPath(),Xm(u,t.shape),u.stroke())} - } - else u.fillStyle=o,u.beginPath(),Xm(u,t.shape),Jm(u,t.holes)?u.fill("evenodd"):u.fill(); - s&&u.restore()} - } - u.restore()} - destroy(){ - this.shader=null} - } - ; - Qt(Zm,"CanvasGraphicsAdaptor"); - let tv=Zm; - tv.extension={ - type:[ri.CanvasPipesAdaptor],name:"graphics"} - ; - const iv=class{ - constructor(t){ - this._renderer=t} - addRenderable(t,i){ - const s=this._getGpuSprite(t); - t.didViewUpdate&&this._updateBatchableSprite(t,s),this._renderer.renderPipes.batch.addToBatch(s,i)} - updateRenderable(t){ - const i=this._getGpuSprite(t); - t.didViewUpdate&&this._updateBatchableSprite(t,i),i._batcher.updateElement(i)} - validateRenderable(t){ - const i=this._getGpuSprite(t); - return!i._batcher.checkAndUpdateTexture(i,t._texture)} - _updateBatchableSprite(t,i){ - i.bounds=t.visualBounds,i.texture=t._texture} - _getGpuSprite(t){ - return t._gpuData[this._renderer.uid]||this._initGPUSprite(t)} - _initGPUSprite(t){ - const i=new ig; - return i.renderable=t,i.transform=t.groupTransform,i.texture=t._texture,i.bounds=t.visualBounds,i.roundPixels=this._renderer._roundPixels|t._roundPixels,t._gpuData[this._renderer.uid]=i,i} - destroy(){ - this._renderer=null} - } - ; - Qt(iv,"SpritePipe"); - let sv=iv; - sv.extension={ - type:[ri.WebGLPipes,ri.WebGPUPipes,ri.CanvasPipes],name:"sprite"} - ; - const ev={ - } - ; - ci.handle(ri.BlendMode,t=>{ - if(!t.name)throw new Error("BlendMode extension must have a name property"); - ev[t.name]=t.ref} - ,t=>{ - delete ev[t.name]} - ); - const nv=class{ - constructor(t){ - this._blendModeStack=[],this._isAdvanced=!1,this._filterHash=Object.create(null),this._renderer=t,this._renderer.runners.prerender.add(this)} - prerender(){ - this._activeBlendMode="normal",this._isAdvanced=!1} - pushBlendMode(t,i,s){ - this._blendModeStack.push(i),this.setBlendMode(t,i,s)} - popBlendMode(t){ - this._blendModeStack.pop(); - const i=this._blendModeStack[this._activeBlendMode.length-1]??"normal"; - this.setBlendMode(null,i,t)} - setBlendMode(t,i,s){ - var e; - const n=t instanceof Fe; - this._activeBlendMode!==i?(this._isAdvanced&&this._endAdvancedBlendMode(s),this._activeBlendMode=i,t&&(this._isAdvanced=!!ev[i],this._isAdvanced&&this._beginAdvancedBlendMode(t,s))):this._isAdvanced&&t&&!n&&(null==(e=this._renderableList)||e.push(t))} - _beginAdvancedBlendMode(t,i){ - this._renderer.renderPipes.batch.break(i); - const s=this._activeBlendMode; - if(!ev[s])return void qs(); - const e=this._ensureFilterEffect(s),n=t instanceof Fe,h={ - renderPipeId:"filter",action:"pushFilter",filterEffect:e,renderables:n?null:[t],container:n?t.root:null,canBundle:!1} - ; - this._renderableList=h.renderables,i.add(h)} - _ensureFilterEffect(t){ - let i=this._filterHash[t]; - return i||(i=this._filterHash[t]=new re,i.filters=[new ev[t]]),i} - _endAdvancedBlendMode(t){ - this._isAdvanced=!1,this._renderableList=null,this._renderer.renderPipes.batch.break(t),t.add({ - renderPipeId:"filter",action:"popFilter",canBundle:!1} - )} - buildStart(){ - this._isAdvanced=!1} - buildEnd(t){ - this._isAdvanced&&this._endAdvancedBlendMode(t)} - destroy(){ - this._renderer=null,this._renderableList=null; - for(const t in this._filterHash)this._filterHash[t].destroy(); - this._filterHash=null} - } - ; - Qt(nv,"BlendModePipe"); - let hv=nv; - function rv(t,i){ - i||(i=0); - for(let s=i; - s<t.length&&t[s]; - s++)t[s]=null} - hv.extension={ - type:[ri.WebGLPipes,ri.WebGPUPipes,ri.CanvasPipes],name:"blendMode"} - ,Qt(rv,"clearList"); - const ov=new Ke; - function av(t,i=!1){ - cv(t); - const s=t.childrenToUpdate,e=t.updateTick++; - for(const n in s){ - const i=Number(n),h=s[n],r=h.list,o=h.index; - for(let s=0; - s<o; - s++){ - const n=r[s]; - n.parentRenderGroup===t&&n.relativeRenderGroupDepth===i&&lv(n,e,0)} - rv(r,o),h.index=0} - if(i)for(let n=0; - n<t.renderGroupChildren.length; - n++)av(t.renderGroupChildren[n],i)} - function cv(t){ - const i=t.root; - let s; - if(t.renderGroupParent){ - const e=t.renderGroupParent; - t.worldTransform.appendFrom(i.relativeGroupTransform,e.worldTransform),t.worldColor=be(i.groupColor,e.worldColor),s=i.groupAlpha*e.worldAlpha} - else t.worldTransform.copyFrom(i.localTransform),t.worldColor=i.localColor,s=i.localAlpha; - s=s<0?0:s>1?1:s,t.worldAlpha=s,t.worldColorAlpha=t.worldColor+(255*s<<24)} - function lv(t,i,s){ - if(i===t.updateTick)return; - t.updateTick=i,t.didChange=!1; - const e=t.localTransform; - t.updateLocalTransform(); - const n=t.parent; - if(n&&!n.renderGroup?(s|=t._updateFlags,t.relativeGroupTransform.appendFrom(e,n.relativeGroupTransform),7&s&&uv(t,n,s)):(s=t._updateFlags,t.relativeGroupTransform.copyFrom(e),7&s&&uv(t,ov,s)),!t.renderGroup){ - const e=t.children,n=e.length; - for(let t=0; - t<n; - t++)lv(e[t],i,s); - const h=t.parentRenderGroup,r=t; - r.renderPipeId&&!h.structureDidChange&&h.updateRenderable(r)} - } - function uv(t,i,s){ - if(1&s){ - t.groupColor=be(t.localColor,i.groupColor); - let s=t.localAlpha*i.groupAlpha; - s=s<0?0:s>1?1:s,t.groupAlpha=s,t.groupColorAlpha=t.groupColor+(255*s<<24)} - 2&s&&(t.groupBlendMode="inherit"===t.localBlendMode?i.groupBlendMode:t.localBlendMode),4&s&&(t.globalDisplayStatus=t.localDisplayStatus&i.globalDisplayStatus),t._updateFlags=0} - function dv(t,i){ - const{ - list:s} - =t.childrenRenderablesToUpdate; - let e=!1; - for(let n=0; - n<t.childrenRenderablesToUpdate.index; - n++){ - const t=s[n]; - if(e=i[t.renderPipeId].validateRenderable(t),e)break} - return t.structureDidChange=e,e} - Qt(av,"updateRenderGroupTransforms"),Qt(cv,"updateRenderGroupTransform"),Qt(lv,"updateTransformAndChildren"),Qt(uv,"updateColorBlendVisibility"),Qt(dv,"validateRenderables"); - const fv=new Ci,pv=class{ - constructor(t){ - this._renderer=t} - render({ - container:t,transform:i} - ){ - const s=t.parent,e=t.renderGroup.renderGroupParent; - t.parent=null,t.renderGroup.renderGroupParent=null; - const n=this._renderer,h=fv; - i&&(h.copyFrom(t.renderGroup.localTransform),t.renderGroup.localTransform.copyFrom(i)); - const r=n.renderPipes; - this._updateCachedRenderGroups(t.renderGroup,null),this._updateRenderGroups(t.renderGroup),n.globalUniforms.start({ - worldTransformMatrix:i?t.renderGroup.localTransform:t.renderGroup.worldTransform,worldColor:t.renderGroup.worldColorAlpha} - ),Fm(t.renderGroup,r),r.uniformBatch&&r.uniformBatch.renderEnd(),i&&t.renderGroup.localTransform.copyFrom(h),t.parent=s,t.renderGroup.renderGroupParent=e} - destroy(){ - this._renderer=null} - _updateCachedRenderGroups(t,i){ - if(t._parentCacheAsTextureRenderGroup=i,t.isCachedAsTexture){ - if(!t.textureNeedsUpdate)return; - i=t} - for(let s=t.renderGroupChildren.length-1; - s>=0; - s--)this._updateCachedRenderGroups(t.renderGroupChildren[s],i); - if(t.invalidateMatrices(),t.isCachedAsTexture){ - if(t.textureNeedsUpdate){ - const i=t.root.getLocalBounds(),s=this._renderer,e=t.textureOptions.resolution||s.view.resolution,n=t.textureOptions.antialias??s.view.antialias,h=t.textureOptions.scaleMode??"linear",r=t.texture; - i.ceil(),t.texture&&Be.returnTexture(t.texture,!0); - const o=Be.getOptimalTexture(i.width,i.height,e,n); - o._source.style=new ss({ - scaleMode:h} - ),t.texture=o,t._textureBounds||(t._textureBounds=new ps),t._textureBounds.copyFrom(i),r!==t.texture&&t.renderGroupParent&&(t.renderGroupParent.structureDidChange=!0)} - } - else t.texture&&(Be.returnTexture(t.texture,!0),t.texture=null)} - _updateRenderGroups(t){ - const i=this._renderer,s=i.renderPipes; - if(t.runOnRender(i),t.instructionSet.renderPipes=s,t.structureDidChange?rv(t.childrenRenderablesToUpdate.list,0):dv(t,s),av(t),t.structureDidChange?(t.structureDidChange=!1,this._buildInstructions(t,i)):this._updateRenderables(t),t.childrenRenderablesToUpdate.index=0,i.renderPipes.batch.upload(t.instructionSet),!t.isCachedAsTexture||t.textureNeedsUpdate)for(let e=0; - e<t.renderGroupChildren.length; - e++)this._updateRenderGroups(t.renderGroupChildren[e])} - _updateRenderables(t){ - const{ - list:i,index:s} - =t.childrenRenderablesToUpdate; - for(let e=0; - e<s; - e++){ - const s=i[e]; - s.didViewUpdate&&t.updateRenderable(s)} - rv(i,s)} - _buildInstructions(t,i){ - const s=t.root,e=t.instructionSet; - e.reset(); - const n=i.renderPipes?i:i.batch.renderer,h=n.renderPipes; - h.batch.buildStart(e),h.blendMode.buildStart(),h.colorMask.buildStart(),s.sortableChildren&&s.sortChildren(),s.collectRenderablesWithEffects(e,n,null),h.batch.buildEnd(e),h.blendMode.buildEnd(e)} - } - ; - Qt(pv,"RenderGroupSystem"); - let wv=pv; - wv.extension={ - type:[ri.WebGLSystem,ri.WebGPUSystem,ri.CanvasSystem],name:"renderGroup"} - ; - const gv=(Qt(D=class{ - constructor(){ - this.clearBeforeRender=!0,this._backgroundColor=new Ks(0),this.color=this._backgroundColor,this.alpha=1} - init(t){ - t={ - ...D.defaultOptions,...t} - ,this.clearBeforeRender=t.clearBeforeRender,this.color=t.background||t.backgroundColor||this._backgroundColor,this.alpha=t.backgroundAlpha,this._backgroundColor.setAlpha(t.backgroundAlpha)} - get color(){ - return this._backgroundColor} - set color(t){ - Ks.shared.setValue(t).alpha<1&&1===this._backgroundColor.alpha&&qs(),this._backgroundColor.setValue(t)} - get alpha(){ - return this._backgroundColor.alpha} - set alpha(t){ - this._backgroundColor.setAlpha(t)} - get colorRgba(){ - return this._backgroundColor.toArray()} - destroy(){ - } - } - ,"_BackgroundSystem"),D); - gv.extension={ - type:[ri.WebGLSystem,ri.WebGPUSystem,ri.CanvasSystem],name:"background",priority:0} - ,gv.defaultOptions={ - backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0} - ; - let mv=gv; - const vv={ - png:"image/png",jpg:"image/jpeg",webp:"image/webp"} - ,_v=(Qt(G=class{ - constructor(t){ - this._renderer=t} - _normalizeOptions(t,i={ - } - ){ - return t instanceof Ke||t instanceof ls?{ - target:t,...i} - :{ - ...i,...t} - } - async image(t){ - const i=ln.get().createImage(); - return i.src=await this.base64(t),i} - async base64(t){ - t=this._normalizeOptions(t,G.defaultImageOptions); - const{ - format:i,quality:s} - =t,e=this.canvas(t); - if(void 0!==e.toBlob)return new Promise((t,n)=>{ - e.toBlob(i=>{ - if(!i)return void n(new Error("ICanvas.toBlob failed!")); - const s=new FileReader; - s.onload=()=>t(s.result),s.onerror=n,s.readAsDataURL(i)} - ,vv[i],s)} - ); - if(void 0!==e.toDataURL)return e.toDataURL(vv[i],s); - if(void 0!==e.convertToBlob){ - const t=await e.convertToBlob({ - type:vv[i],quality:s} - ); - return new Promise((i,s)=>{ - const e=new FileReader; - e.onload=()=>i(e.result),e.onerror=s,e.readAsDataURL(t)} - )} - throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")} - canvas(t){ - const i=(t=this._normalizeOptions(t)).target,s=this._renderer; - if(i instanceof ls)return s.texture.generateCanvas(i); - const e=s.textureGenerator.generateTexture(t),n=s.texture.generateCanvas(e); - return e.destroy(!0),n} - pixels(t){ - const i=(t=this._normalizeOptions(t)).target,s=this._renderer,e=i instanceof ls?i:s.textureGenerator.generateTexture(t),n=s.texture.getPixels(e); - return i instanceof Ke&&e.destroy(!0),n} - texture(t){ - return(t=this._normalizeOptions(t)).target instanceof ls?t.target:this._renderer.textureGenerator.generateTexture(t)} - download(t){ - t=this._normalizeOptions(t); - const i=this.canvas(t),s=document.createElement("a"); - s.download=t.filename??"image.png",s.href=i.toDataURL("image/png"),document.body.appendChild(s),s.click(),document.body.removeChild(s)} - log(t){ - const i=t.width??200; - t=this._normalizeOptions(t),["font-size: 1px; - ",`padding: ${ - i} - px 300px; - `,`background: url(${ - this.canvas(t).toDataURL()} - ) no-repeat; - `,"background-size: contain; - "].join(" ")} - destroy(){ - this._renderer=null} - } - ,"_ExtractSystem"),G); - _v.extension={ - type:[ri.WebGLSystem,ri.WebGPUSystem,ri.CanvasSystem],name:"extract"} - ,_v.defaultImageOptions={ - format:"png",quality:1} - ; - let Mv=_v; - const bv=class t extends ls{ - static create(i){ - const{ - dynamic:s,...e} - =i; - return new t({ - source:new ns(e),dynamic:s??!1} - )} - resize(t,i,s){ - return this.source.resize(t,i,s),this} - } - ; - Qt(bv,"RenderTexture"); - let yv=bv; - const Ev=new $i,Av=new ps,Sv=[0,0,0,0],Tv=class{ - constructor(t){ - this._renderer=t} - generateTexture(t){ - var i; - t instanceof Ke&&(t={ - target:t,frame:void 0,textureSourceOptions:{ - } - ,resolution:void 0} - ); - const s=t.resolution||this._renderer.resolution,e=t.antialias||this._renderer.view.antialias,n=t.target; - let h=t.clearColor; - h=h?Array.isArray(h)&&4===h.length?h:Ks.shared.setValue(h).toArray():Sv; - const r=(null==(i=t.frame)?void 0:i.copyTo(Ev))||Ae(n,Av).rectangle; - r.width=0|Math.max(r.width,1/s),r.height=0|Math.max(r.height,1/s); - const o=yv.create({ - ...t.textureSourceOptions,width:r.width,height:r.height,resolution:s,antialias:e} - ),a=Ci.shared.translate(-r.x,-r.y); - return this._renderer.render({ - container:n,transform:a,target:o,clearColor:h} - ),o.source.updateMipmaps(),o} - destroy(){ - this._renderer=null} - } - ; - Qt(Tv,"GenerateTextureSystem"); - let Cv=Tv; - function Ov(t){ - let i=!1; - for(const e in t)if(null==t[e]){ - i=!0; - break} - if(!i)return t; - const s=Object.create(null); - for(const e in t){ - const i=t[e]; - i&&(s[e]=i)} - return s} - function Iv(t){ - let i=0; - for(let s=0; - s<t.length; - s++)null==t[s]?i++:t[s-i]=t[s]; - return t.length-=i,t} - Cv.extension={ - type:[ri.WebGLSystem,ri.WebGPUSystem,ri.CanvasSystem],name:"textureGenerator"} - ,Qt(Ov,"cleanHash"),Qt(Iv,"cleanArray"); - const kv=(Qt(B=class{ - constructor(t){ - this._managedResources=[],this._managedResourceHashes=[],this._managedCollections=[],this._ready=!1,this._renderer=t} - init(t){ - t={ - ...B.defaultOptions,...t} - ,this.maxUnusedTime=t.gcMaxUnusedTime,this._frequency=t.gcFrequency,this.enabled=t.gcActive,this.now=performance.now()} - get enabled(){ - return!!this._handler} - set enabled(t){ - this.enabled!==t&&(t?(this._handler=this._renderer.scheduler.repeat(()=>{ - this._ready=!0} - ,this._frequency,!1),this._collectionsHandler=this._renderer.scheduler.repeat(()=>{ - for(const t of this._managedCollections){ - const{ - context:i,collection:s,type:e} - =t; - i[s]="hash"===e?Ov(i[s]):Iv(i[s])} - } - ,this._frequency)):(this._renderer.scheduler.cancel(this._handler),this._renderer.scheduler.cancel(this._collectionsHandler),this._handler=0,this._collectionsHandler=0))} - prerender({ - container:t} - ){ - this.now=performance.now(),t.renderGroup.gcTick=this._renderer.tick++,this._updateInstructionGCTick(t.renderGroup,t.renderGroup.gcTick)} - postrender(){ - this._ready&&this.enabled&&(this.run(),this._ready=!1)} - _updateInstructionGCTick(t,i){ - t.instructionSet.gcTick=i,t.gcTick=i; - for(const s of t.renderGroupChildren)this._updateInstructionGCTick(s,i)} - addCollection(t,i,s){ - this._managedCollections.push({ - context:t,collection:i,type:s} - )} - addResource(t,i){ - var s,e; - if(-1!==t._gcLastUsed)return t._gcLastUsed=this.now,void(null==(s=t._onTouch)||s.call(t,this.now)); - const n=this._managedResources.length; - t._gcData={ - index:n,type:i} - ,t._gcLastUsed=this.now,null==(e=t._onTouch)||e.call(t,this.now),t.once("unload",this.removeResource,this),this._managedResources.push(t)} - removeResource(t){ - const i=t._gcData; - if(!i)return; - const s=i.index,e=this._managedResources.length-1; - if(s!==e){ - const t=this._managedResources[e]; - this._managedResources[s]=t,t._gcData.index=s} - this._managedResources.length--,t._gcData=null,t._gcLastUsed=-1} - addResourceHash(t,i,s,e=0){ - this._managedResourceHashes.push({ - context:t,hash:i,type:s,priority:e} - ),this._managedResourceHashes.sort((t,i)=>t.priority-i.priority)} - run(){ - const t=performance.now(),i=this._managedResourceHashes; - for(const e of i)this.runOnHash(e,t); - let s=0; - for(let e=0; - e<this._managedResources.length; - e++){ - const i=this._managedResources[e]; - s=this.runOnResource(i,t,s)} - this._managedResources.length=s} - updateRenderableGCTick(t,i){ - var s,e; - const n=t.renderGroup??t.parentRenderGroup,h=(null==(s=null==n?void 0:n.instructionSet)?void 0:s.gcTick)??-1; - ((null==n?void 0:n.gcTick)??0)===h&&(t._gcLastUsed=i,null==(e=t._onTouch)||e.call(t,i))} - runOnResource(t,i,s){ - const e=t._gcData; - return"renderable"===e.type&&this.updateRenderableGCTick(t,i),i-t._gcLastUsed<this.maxUnusedTime||!t.autoGarbageCollect?(this._managedResources[s]=t,e.index=s,s++):(t.unload(),t._gcData=null,t._gcLastUsed=-1,t.off("unload",this.removeResource,this)),s} - _createHashClone(t,i){ - const s=Object.create(null); - for(const e in t){ - if(e===i)break; - null!==t[e]&&(s[e]=t[e])} - return s} - runOnHash(t,i){ - var s; - const{ - context:e,hash:n,type:h} - =t,r=e[n]; - let o=null,a=0; - for(const c in r){ - const t=r[c]; - if(null!==t)if(-1!==t._gcLastUsed)if("renderable"===h&&this.updateRenderableGCTick(t,i),i-t._gcLastUsed<this.maxUnusedTime||!t.autoGarbageCollect)o&&(o[c]=t); - else{ - if(o||(a+1!==1e4?(r[c]=null,a++):o=this._createHashClone(r,c)),"renderable"===h){ - const i=t,s=i.renderGroup??i.parentRenderGroup; - s&&(s.structureDidChange=!0)} - t.unload(),t._gcData=null,t._gcLastUsed=-1} - else t._gcLastUsed=i,null==(s=t._onTouch)||s.call(t,i),o&&(o[c]=t); - else a++,1e4!==a||o||(o=this._createHashClone(r,c))} - o&&(e[n]=o)} - destroy(){ - this.enabled=!1,this._managedResources.forEach(t=>{ - t.off("unload",this.removeResource,this)} - ),this._managedResources.length=0,this._managedResourceHashes.length=0,this._managedCollections.length=0,this._renderer=null} - } - ,"_GCSystem"),B); - kv.extension={ - type:[ri.WebGLSystem,ri.WebGPUSystem,ri.CanvasSystem],name:"gc",priority:0} - ,kv.defaultOptions={ - gcActive:!0,gcMaxUnusedTime:6e4,gcFrequency:3e4} - ; - let xv=kv; - const Rv=class{ - constructor(t){ - this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=t} - reset(){ - this._stackIndex=0; - for(let t=0; - t<this._activeUniforms.length; - t++)this._uniformsPool.push(this._activeUniforms[t]); - for(let t=0; - t<this._activeBindGroups.length; - t++)this._bindGroupPool.push(this._activeBindGroups[t]); - this._activeUniforms.length=0,this._activeBindGroups.length=0} - start(t){ - this.reset(),this.push(t)} - bind({ - size:t,projectionMatrix:i,worldTransformMatrix:s,worldColor:e,offset:n} - ){ - const h=this._renderer.renderTarget.renderTarget,r=this._stackIndex?this._globalUniformDataStack[this._stackIndex-1]:{ - worldTransformMatrix:new Ci,worldColor:4294967295,offset:new Ai} - ,o={ - projectionMatrix:i||this._renderer.renderTarget.projectionMatrix,resolution:t||h.size,worldTransformMatrix:s||r.worldTransformMatrix,worldColor:e||r.worldColor,offset:n||r.offset,bindGroup:null} - ,a=this._uniformsPool.pop()||this._createUniforms(); - this._activeUniforms.push(a); - const c=a.uniforms; - let l; - c.uProjectionMatrix=o.projectionMatrix,c.uResolution=o.resolution,c.uWorldTransformMatrix.copyFrom(o.worldTransformMatrix),c.uWorldTransformMatrix.tx-=o.offset.x,c.uWorldTransformMatrix.ty-=o.offset.y,Jf(o.worldColor,c.uWorldColorAlpha,0),a.update(),this._renderer.renderPipes.uniformBatch?l=this._renderer.renderPipes.uniformBatch.getUniformBindGroup(a,!1):(l=this._bindGroupPool.pop()||new or,this._activeBindGroups.push(l),l.setResource(a,0)),o.bindGroup=l,this._currentGlobalUniformData=o} - push(t){ - this.bind(t),this._globalUniformDataStack[this._stackIndex++]=this._currentGlobalUniformData} - pop(){ - this._currentGlobalUniformData=this._globalUniformDataStack[--this._stackIndex-1],this._renderer.type===ar.WEBGL&&this._currentGlobalUniformData.bindGroup.resources[0].update()} - get bindGroup(){ - return this._currentGlobalUniformData.bindGroup} - get globalUniformData(){ - return this._currentGlobalUniformData} - get uniformGroup(){ - return this._currentGlobalUniformData.bindGroup.resources[0]} - _createUniforms(){ - return new hr({ - uProjectionMatrix:{ - value:new Ci,type:"mat3x3<f32>"} - ,uWorldTransformMatrix:{ - value:new Ci,type:"mat3x3<f32>"} - ,uWorldColorAlpha:{ - value:new Float32Array(4),type:"vec4<f32>"} - ,uResolution:{ - value:[0,0],type:"vec2<f32>"} - } - ,{ - isStatic:!0} - )} - destroy(){ - this._renderer=null,this._globalUniformDataStack.length=0,this._uniformsPool.length=0,this._activeUniforms.length=0,this._bindGroupPool.length=0,this._activeBindGroups.length=0,this._currentGlobalUniformData=null} - } - ; - Qt(Rv,"GlobalUniformSystem"); - let Pv=Rv; - Pv.extension={ - type:[ri.WebGLSystem,ri.WebGPUSystem,ri.CanvasSystem],name:"globalUniforms"} - ; - let Nv=1; - const Lv=class{ - constructor(){ - this._tasks=[],this._offset=0} - init(){ - Mn.system.add(this._update,this)} - repeat(t,i,s=!0){ - const e=Nv++; - let n=0; - return s&&(this._offset+=1e3,n=this._offset),this._tasks.push({ - func:t,duration:i,start:performance.now(),offset:n,last:performance.now(),repeat:!0,id:e} - ),e} - cancel(t){ - for(let i=0; - i<this._tasks.length; - i++)if(this._tasks[i].id===t)return void this._tasks.splice(i,1)} - _update(){ - const t=performance.now(); - for(let i=0; - i<this._tasks.length; - i++){ - const s=this._tasks[i]; - if(t-s.offset-s.last>=s.duration){ - const i=t-s.start; - s.func(i),s.last=t} - } - } - destroy(){ - Mn.system.remove(this._update,this),this._tasks.length=0} - } - ; - Qt(Lv,"SchedulerSystem"); - let Dv=Lv; - Dv.extension={ - type:[ri.WebGLSystem,ri.WebGPUSystem,ri.CanvasSystem],name:"scheduler",priority:0} - ; - let Gv=!1; - function Bv(t){ - if(!Gv){ - if(ln.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){ - const i=[`%c %c %c %c %c PixiJS %c v${ - fo} - (${ - t} - ) http://www.pixijs.com/\n\n`,"background: #E72264; - padding:5px 0; - ","background: #6CA2EA; - padding:5px 0; - ","background: #B5D33D; - padding:5px 0; - ","background: #FED23F; - padding:5px 0; - ","color: #FFFFFF; - background: #E72264; - padding:5px 0; - ","color: #E72264; - background: #FFFFFF; - padding:5px 0; - "]; - globalThis.console.log(...i)} - else globalThis.console&&globalThis.console.log(`PixiJS ${ - fo} - - ${ - t} - - http://www.pixijs.com/`); - Gv=!0} - } - Qt(Bv,"sayHello"); - const Uv=class{ - constructor(t){ - this._renderer=t} - init(t){ - if(t.hello){ - let t=this._renderer.name; - this._renderer.type===ar.WEBGL&&(t+=` ${ - this._renderer.context.webGLVersion} - `),Bv(t)} - } - } - ; - Qt(Uv,"HelloSystem"); - let Fv=Uv; - Fv.extension={ - type:[ri.WebGLSystem,ri.WebGPUSystem,ri.CanvasSystem],name:"hello",priority:-2} - ,Fv.defaultOptions={ - hello:!1} - ; - const $v=(Qt(U=class{ - constructor(t){ - this._renderer=t} - init(t){ - t={ - ...U.defaultOptions,...t} - ,this.maxUnusedTime=t.renderableGCMaxUnusedTime} - get enabled(){ - return Yi("8.15.0","RenderableGCSystem.enabled is deprecated, please use the GCSystem.enabled instead."),this._renderer.gc.enabled} - set enabled(t){ - Yi("8.15.0","RenderableGCSystem.enabled is deprecated, please use the GCSystem.enabled instead."),this._renderer.gc.enabled=t} - addManagedHash(t,i){ - Yi("8.15.0","RenderableGCSystem.addManagedHash is deprecated, please use the GCSystem.addCollection instead."),this._renderer.gc.addCollection(t,i,"hash")} - addManagedArray(t,i){ - Yi("8.15.0","RenderableGCSystem.addManagedArray is deprecated, please use the GCSystem.addCollection instead."),this._renderer.gc.addCollection(t,i,"array")} - addRenderable(t){ - Yi("8.15.0","RenderableGCSystem.addRenderable is deprecated, please use the GCSystem instead."),this._renderer.gc.addResource(t,"renderable")} - run(){ - Yi("8.15.0","RenderableGCSystem.run is deprecated, please use the GCSystem instead."),this._renderer.gc.run()} - destroy(){ - this._renderer=null} - } - ,"_RenderableGCSystem"),U); - $v.extension={ - type:[ri.WebGLSystem,ri.WebGPUSystem,ri.CanvasSystem],name:"renderableGC",priority:0} - ,$v.defaultOptions={ - renderableGCActive:!0,renderableGCMaxUnusedTime:6e4,renderableGCFrequency:3e4} - ; - let Hv=$v; - const Wv=(Qt(F=class{ - get count(){ - return this._renderer.tick} - get checkCount(){ - return this._checkCount} - set checkCount(t){ - Yi("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead."),this._checkCount=t} - get maxIdle(){ - return this._renderer.gc.maxUnusedTime/1e3*60} - set maxIdle(t){ - Yi("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead."),this._renderer.gc.maxUnusedTime=t/60*1e3} - get checkCountMax(){ - return Math.floor(this._renderer.gc._frequency/1e3)} - set checkCountMax(t){ - Yi("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead.")} - get active(){ - return this._renderer.gc.enabled} - set active(t){ - Yi("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead."),this._renderer.gc.enabled=t} - constructor(t){ - this._renderer=t,this._checkCount=0} - init(t){ - t.textureGCActive!==F.defaultOptions.textureGCActive&&(this.active=t.textureGCActive),t.textureGCMaxIdle!==F.defaultOptions.textureGCMaxIdle&&(this.maxIdle=t.textureGCMaxIdle),t.textureGCCheckCountMax!==F.defaultOptions.textureGCCheckCountMax&&(this.checkCountMax=t.textureGCCheckCountMax)} - run(){ - Yi("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead."),this._renderer.gc.run()} - destroy(){ - this._renderer=null} - } - ,"_TextureGCSystem"),F); - Wv.extension={ - type:[ri.WebGLSystem,ri.WebGPUSystem],name:"textureGC"} - ,Wv.defaultOptions={ - textureGCActive:!0,textureGCAMaxIdle:null,textureGCMaxIdle:3600,textureGCCheckCountMax:600} - ; - let Vv=Wv; - const jv=(Qt($=class{ - constructor(t={ - } - ){ - if(this.uid=Wi("renderTarget"),this.colorTextures=[],this.dirtyId=0,this.isRoot=!1,this._size=new Float32Array(2),this._managedColorTextures=!1,t={ - ...$.defaultOptions,...t} - ,this.stencil=t.stencil,this.depth=t.depth,this.isRoot=t.isRoot,"number"==typeof t.colorTextures){ - this._managedColorTextures=!0; - for(let i=0; - i<t.colorTextures; - i++)this.colorTextures.push(new ns({ - width:t.width,height:t.height,resolution:t.resolution,antialias:t.antialias} - ))} - else{ - this.colorTextures=[...t.colorTextures.map(t=>t.source)]; - const i=this.colorTexture.source; - this.resize(i.width,i.height,i._resolution)} - this.colorTexture.source.on("resize",this.onSourceResize,this),(t.depthStencilTexture||this.stencil)&&(t.depthStencilTexture instanceof ls||t.depthStencilTexture instanceof ns?this.depthStencilTexture=t.depthStencilTexture.source:this.ensureDepthStencilTexture())} - get size(){ - const t=this._size; - return t[0]=this.pixelWidth,t[1]=this.pixelHeight,t} - get width(){ - return this.colorTexture.source.width} - get height(){ - return this.colorTexture.source.height} - get pixelWidth(){ - return this.colorTexture.source.pixelWidth} - get pixelHeight(){ - return this.colorTexture.source.pixelHeight} - get resolution(){ - return this.colorTexture.source._resolution} - get colorTexture(){ - return this.colorTextures[0]} - onSourceResize(t){ - this.resize(t.width,t.height,t._resolution,!0)} - ensureDepthStencilTexture(){ - this.depthStencilTexture||(this.depthStencilTexture=new ns({ - width:this.width,height:this.height,resolution:this.resolution,format:"depth24plus-stencil8",autoGenerateMipmaps:!1,antialias:!1,mipLevelCount:1} - ))} - resize(t,i,s=this.resolution,e=!1){ - this.dirtyId++,this.colorTextures.forEach((n,h)=>{ - e&&0===h||n.source.resize(t,i,s)} - ),this.depthStencilTexture&&this.depthStencilTexture.source.resize(t,i,s)} - destroy(){ - this.colorTexture.source.off("resize",this.onSourceResize,this),this._managedColorTextures&&this.colorTextures.forEach(t=>{ - t.destroy()} - ),this.depthStencilTexture&&(this.depthStencilTexture.destroy(),delete this.depthStencilTexture)} - } - ,"_RenderTarget"),$); - jv.defaultOptions={ - width:0,height:0,resolution:1,colorTextures:1,stencil:!1,depth:!1,antialias:!1,isRoot:!1} - ; - let Kv=jv; - const zv=new Map; - function Yv(t,i){ - if(!zv.has(t)){ - const s=new ls({ - source:new dn({ - resource:t,...i} - )} - ),e=Qt(()=>{ - zv.get(t)===s&&zv.delete(t)} - ,"onDestroy"); - s.once("destroy",e),s.source.once("destroy",e),zv.set(t,s)} - return zv.get(t)} - Xs.register(zv),Qt(Yv,"getCanvasTexture"); - const qv=(Qt(H=class{ - get autoDensity(){ - return this.texture.source.autoDensity} - set autoDensity(t){ - this.texture.source.autoDensity=t} - get resolution(){ - return this.texture.source._resolution} - set resolution(t){ - this.texture.source.resize(this.texture.source.width,this.texture.source.height,t)} - init(t){ - (t={ - ...H.defaultOptions,...t} - ).view&&(Yi(ji,"ViewSystem.view has been renamed to ViewSystem.canvas"),t.canvas=t.view),this.screen=new $i(0,0,t.width,t.height),this.canvas=t.canvas||ln.get().createCanvas(),this.antialias=!!t.antialias,this.texture=Yv(this.canvas,t),this.renderTarget=new Kv({ - colorTextures:[this.texture],depth:!!t.depth,isRoot:!0} - ),this.texture.source.transparent=t.backgroundAlpha<1,this.resolution=t.resolution} - resize(t,i,s){ - this.texture.source.resize(t,i,s),this.screen.width=this.texture.frame.width,this.screen.height=this.texture.frame.height} - destroy(t=!1){ - ("boolean"==typeof t?t:!!(null==t?void 0:t.removeView))&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.texture.destroy()} - } - ,"_ViewSystem"),H); - qv.extension={ - type:[ri.WebGLSystem,ri.WebGPUSystem,ri.CanvasSystem],name:"view",priority:0} - ,qv.defaultOptions={ - width:800,height:600,autoDensity:!1,antialias:!1} - ; - let Xv=qv; - const Jv=[mv,Pv,Fv,Xv,wv,xv,Vv,Cv,Mv,mo,Hv,Dv],Qv=[hv,dm,sv,Hm,_m,km,Em,Um]; - function Zv(t,i,s,e,n,h){ - const r=h?1:-1; - return t.identity(),t.a=1/e*2,t.d=r*(1/n*2),t.tx=-1-i*t.a,t.ty=-r-s*t.d,t} - function t_(t){ - const i=t.colorTexture.source.resource; - return globalThis.HTMLCanvasElement&&i instanceof HTMLCanvasElement&&document.body.contains(i)} - Qt(Zv,"calculateProjection"),Qt(t_,"isRenderingToScreen"); - const i_=class{ - constructor(t){ - this.rootViewPort=new $i,this.viewport=new $i,this.mipLevel=0,this.layer=0,this.onRenderTargetChange=new so("onRenderTargetChange"),this.projectionMatrix=new Ci,this.defaultClearColor=[0,0,0,0],this._renderSurfaceToRenderTargetHash=new Map,this._gpuRenderTargetHash=Object.create(null),this._renderTargetStack=[],this._renderer=t,t.gc.addCollection(this,"_gpuRenderTargetHash","hash")} - finishRenderPass(){ - this.adaptor.finishRenderPass(this.renderTarget)} - renderStart({ - target:t,clear:i,clearColor:s,frame:e,mipLevel:n,layer:h} - ){ - var r,o; - this._renderTargetStack.length=0,this.push(t,i,s,e,n??0,h??0),this.rootViewPort.copyFrom(this.viewport),this.rootRenderTarget=this.renderTarget,this.renderingToScreen=t_(this.rootRenderTarget),null==(o=(r=this.adaptor).prerender)||o.call(r,this.rootRenderTarget)} - postrender(){ - var t,i; - null==(i=(t=this.adaptor).postrender)||i.call(t,this.rootRenderTarget)} - bind(t,i=!0,s,e,n=0,h=0){ - const r=this.getRenderTarget(t),o=this.renderTarget!==r; - this.renderTarget=r,this.renderSurface=t; - const a=this.getGpuRenderTarget(r); - r.pixelWidth===a.width&&r.pixelHeight===a.height||(this.adaptor.resizeGpuRenderTarget(r),a.width=r.pixelWidth,a.height=r.pixelHeight); - const c=r.colorTexture,l=this.viewport,u=c.arrayLayerCount||1; - if((0|h)!==h&&(h|=0),h<0||h>=u)throw new Error(`[RenderTargetSystem] layer ${ - h} - is out of bounds (arrayLayerCount=${ - u} - ).`); - this.mipLevel=0|n,this.layer=0|h; - const d=Math.max(c.pixelWidth>>n,1),f=Math.max(c.pixelHeight>>n,1); - if(!e&&t instanceof ls&&(e=t.frame),e){ - const t=c._resolution,i=1<<Math.max(0|n,0),s=e.x*t+.5|0,h=e.y*t+.5|0,r=e.width*t+.5|0,o=e.height*t+.5|0; - let a=Math.floor(s/i),u=Math.floor(h/i),p=Math.ceil(r/i),w=Math.ceil(o/i); - a=Math.min(Math.max(a,0),d-1),u=Math.min(Math.max(u,0),f-1),p=Math.min(Math.max(p,1),d-a),w=Math.min(Math.max(w,1),f-u),l.x=a,l.y=u,l.width=p,l.height=w} - else l.x=0,l.y=0,l.width=d,l.height=f; - return Zv(this.projectionMatrix,0,0,l.width/c.resolution,l.height/c.resolution,!r.isRoot),this.adaptor.startRenderPass(r,i,s,l,n,h),o&&this.onRenderTargetChange.emit(r),r} - clear(t,i=to.ALL,s,e=this.mipLevel,n=this.layer){ - i&&(t&&(t=this.getRenderTarget(t)),this.adaptor.clear(t||this.renderTarget,i,s,this.viewport,e,n))} - contextChange(){ - this._gpuRenderTargetHash=Object.create(null)} - push(t,i=to.ALL,s,e,n=0,h=0){ - const r=this.bind(t,i,s,e,n,h); - return this._renderTargetStack.push({ - renderTarget:r,frame:e,mipLevel:n,layer:h} - ),r} - pop(){ - this._renderTargetStack.pop(); - const t=this._renderTargetStack[this._renderTargetStack.length-1]; - this.bind(t.renderTarget,!1,null,t.frame,t.mipLevel,t.layer)} - getRenderTarget(t){ - return t.isTexture&&(t=t.source),this._renderSurfaceToRenderTargetHash.get(t)??this._initRenderTarget(t)} - copyToTexture(t,i,s,e,n){ - s.x<0&&(e.width+=s.x,n.x-=s.x,s.x=0),s.y<0&&(e.height+=s.y,n.y-=s.y,s.y=0); - const{ - pixelWidth:h,pixelHeight:r} - =t; - return e.width=Math.min(e.width,h-s.x),e.height=Math.min(e.height,r-s.y),this.adaptor.copyToTexture(t,i,s,e,n)} - ensureDepthStencil(){ - this.renderTarget.stencil||(this.renderTarget.stencil=!0,this.adaptor.startRenderPass(this.renderTarget,!1,null,this.viewport,0,this.layer))} - destroy(){ - this._renderer=null,this._renderSurfaceToRenderTargetHash.forEach((t,i)=>{ - t!==i&&t.destroy()} - ),this._renderSurfaceToRenderTargetHash.clear(),this._gpuRenderTargetHash=Object.create(null)} - _initRenderTarget(t){ - let i=null; - return dn.test(t)&&(t=Yv(t).source),t instanceof Kv?i=t:t instanceof ns&&(i=new Kv({ - colorTextures:[t]} - ),t.source instanceof dn&&(i.isRoot=!0),t.once("destroy",()=>{ - i.destroy(),this._renderSurfaceToRenderTargetHash.delete(t); - const s=this._gpuRenderTargetHash[i.uid]; - s&&(this._gpuRenderTargetHash[i.uid]=null,this.adaptor.destroyGpuRenderTarget(s))} - )),this._renderSurfaceToRenderTargetHash.set(t,i),i} - getGpuRenderTarget(t){ - return this._gpuRenderTargetHash[t.uid]||(this._gpuRenderTargetHash[t.uid]=this.adaptor.initGpuRenderTarget(t))} - resetState(){ - this.renderTarget=null,this.renderSurface=null} - } - ; - Qt(i_,"RenderTargetSystem"); - let s_=i_; - const e_=class{ - init(t,i){ - this._renderer=t,this._renderTargetSystem=i} - initGpuRenderTarget(t){ - const i=t.colorTexture,{ - canvas:s,context:e} - =this._ensureCanvas(i); - return{ - canvas:s,context:e,width:s.width,height:s.height} - } - resizeGpuRenderTarget(t){ - const i=t.colorTexture,{ - canvas:s} - =this._ensureCanvas(i); - s.width=t.pixelWidth,s.height=t.pixelHeight} - startRenderPass(t,i,s,e){ - const n=this._renderTargetSystem.getGpuRenderTarget(t); - this._renderer.canvasContext.activeContext=n.context,this._renderer.canvasContext.activeResolution=t.resolution,i&&this.clear(t,i,s,e)} - clear(t,i,s,e){ - const n=this._renderTargetSystem.getGpuRenderTarget(t).context,h=e||{ - x:0,y:0,width:t.pixelWidth,height:t.pixelHeight} - ; - if(n.setTransform(1,0,0,1,0,0),n.clearRect(h.x,h.y,h.width,h.height),s){ - const t=Ks.shared.setValue(s); - t.alpha>0&&(n.globalAlpha=t.alpha,n.fillStyle=t.toHex(),n.fillRect(h.x,h.y,h.width,h.height),n.globalAlpha=1)} - } - finishRenderPass(){ - } - copyToTexture(t,i,s,e,n){ - const h=this._renderTargetSystem.getGpuRenderTarget(t).canvas,r=i.source,{ - context:o} - =this._ensureCanvas(r),a=(null==n?void 0:n.x)??0,c=(null==n?void 0:n.y)??0; - return o.drawImage(h,s.x,s.y,e.width,e.height,a,c,e.width,e.height),r.update(),i} - destroyGpuRenderTarget(t){ - } - _ensureCanvas(t){ - let i=t.resource; - i&&dn.test(i)||(i=ln.get().createCanvas(t.pixelWidth,t.pixelHeight),t.resource=i),i.width===t.pixelWidth&&i.height===t.pixelHeight||(i.width=t.pixelWidth,i.height=t.pixelHeight); - const s=i.getContext("2d"); - return{ - canvas:i,context:s} - } - } - ; - Qt(e_,"CanvasRenderTargetAdaptor"); - let n_=e_; - const h_=class extends s_{ - constructor(t){ - super(t),this.adaptor=new n_,this.adaptor.init(t,this)} - } - ; - Qt(h_,"CanvasRenderTargetSystem"); - let r_=h_; - r_.extension={ - type:[ri.CanvasSystem],name:"renderTarget"} - ; - const o_=class{ - constructor(t){ - } - init(){ - } - initSource(t){ - } - generateCanvas(t){ - const i=ln.get().createCanvas(),s=i.getContext("2d"),e=bp.getCanvasSource(t); - if(!e)return i; - const n=t.frame,h=t.source._resolution??t.source.resolution??1,r=n.x*h,o=n.y*h,a=n.width*h,c=n.height*h; - return i.width=Math.ceil(a),i.height=Math.ceil(c),s.drawImage(e,r,o,a,c,0,0,a,c),i} - getPixels(t){ - const i=this.generateCanvas(t); - return{ - pixels:i.getContext("2d",{ - willReadFrequently:!0} - ).getImageData(0,0,i.width,i.height).data,width:i.width,height:i.height} - } - destroy(){ - } - } - ; - Qt(o_,"CanvasTextureSystem"); - let a_=o_; - a_.extension={ - type:[ri.CanvasSystem],name:"texture"} - ; - const c_=[...Jv,Lm,Gm,a_,r_],l_=[hv,dm,sv,Hm,_m,Om,bm,Um],u_=[hm,tv],d_=[],f_=[],p_=[]; - ci.handleByNamedList(ri.CanvasSystem,d_),ci.handleByNamedList(ri.CanvasPipes,f_),ci.handleByNamedList(ri.CanvasPipesAdaptor,p_),ci.add(...c_,...l_,...u_); - const w_=class extends oo{ - constructor(){ - super({ - name:"canvas",type:ar.CANVAS,systems:d_,renderPipes:f_,renderPipeAdaptors:p_} - )} - } - ; - Qt(w_,"CanvasRenderer"); - let g_=w_; - const m_=Object.freeze(Object.defineProperty({ - __proto__:null,CanvasRenderer:g_} - ,Symbol.toStringTag,{ - value:"Module"} - )); - var v_=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(v_||{ - } - ); - const __=class{ - constructor(t,i){ - this._lastBindBaseLocation=-1,this._lastBindCallId=-1,this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.type=i} - destroy(){ - this.buffer=null,this.updateID=-1,this.byteLength=-1,this.type=-1,this._lastBindBaseLocation=-1,this._lastBindCallId=-1} - } - ; - Qt(__,"GlBuffer"); - let M_=__; - const b_=class{ - constructor(t){ - this._boundBufferBases=Object.create(null),this._minBaseLocation=0,this._nextBindBaseIndex=this._minBaseLocation,this._bindCallId=0,this._renderer=t,this._managedBuffers=new Yc({ - renderer:t,type:"resource",onUnload:this.onBufferUnload.bind(this),name:"glBuffer"} - )} - destroy(){ - this._managedBuffers.destroy(),this._renderer=null,this._gl=null,this._boundBufferBases={ - } - } - contextChange(){ - this._gl=this._renderer.gl,this.destroyAll(!0),this._maxBindings=this._renderer.limits.maxUniformBindings} - getGlBuffer(t){ - return t._gcLastUsed=this._renderer.gc.now,t._gpuData[this._renderer.uid]||this.createGLBuffer(t)} - bind(t){ - const{ - _gl:i} - =this,s=this.getGlBuffer(t); - i.bindBuffer(s.type,s.buffer)} - bindBufferBase(t,i){ - const{ - _gl:s} - =this; - this._boundBufferBases[i]!==t&&(this._boundBufferBases[i]=t,t._lastBindBaseLocation=i,s.bindBufferBase(s.UNIFORM_BUFFER,i,t.buffer))} - nextBindBase(t){ - this._bindCallId++,this._minBaseLocation=0,t&&(this._boundBufferBases[0]=null,this._minBaseLocation=1,this._nextBindBaseIndex<1&&(this._nextBindBaseIndex=1))} - freeLocationForBufferBase(t){ - let i=this.getLastBindBaseLocation(t); - if(i>=this._minBaseLocation)return t._lastBindCallId=this._bindCallId,i; - let s=0,e=this._nextBindBaseIndex; - for(; - s<2; - ){ - e>=this._maxBindings&&(e=this._minBaseLocation,s++); - const t=this._boundBufferBases[e]; - if(!t||t._lastBindCallId!==this._bindCallId)break; - e++} - return i=e,this._nextBindBaseIndex=e+1,s>=2?-1:(t._lastBindCallId=this._bindCallId,this._boundBufferBases[i]=null,i)} - getLastBindBaseLocation(t){ - const i=t._lastBindBaseLocation; - return this._boundBufferBases[i]===t?i:-1} - bindBufferRange(t,i,s,e){ - const{ - _gl:n} - =this; - s||(s=0),i||(i=0),this._boundBufferBases[i]=null,n.bindBufferRange(n.UNIFORM_BUFFER,i||0,t.buffer,256*s,e||256)} - updateBuffer(t){ - const{ - _gl:i} - =this,s=this.getGlBuffer(t); - if(t._updateID===s.updateID)return s; - s.updateID=t._updateID,i.bindBuffer(s.type,s.buffer); - const e=t.data,n=t.descriptor.usage&Ka.STATIC?i.STATIC_DRAW:i.DYNAMIC_DRAW; - return e?s.byteLength>=e.byteLength?i.bufferSubData(s.type,0,e,0,t._updateSize/e.BYTES_PER_ELEMENT):(s.byteLength=e.byteLength,i.bufferData(s.type,e,n)):(s.byteLength=t.descriptor.size,i.bufferData(s.type,s.byteLength,n)),s} - destroyAll(t=!1){ - this._managedBuffers.removeAll(t)} - onBufferUnload(t,i=!1){ - const s=t._gpuData[this._renderer.uid]; - s&&(i||this._gl.deleteBuffer(s.buffer))} - createGLBuffer(t){ - const{ - _gl:i} - =this; - let s=v_.ARRAY_BUFFER; - t.descriptor.usage&Ka.INDEX?s=v_.ELEMENT_ARRAY_BUFFER:t.descriptor.usage&Ka.UNIFORM&&(s=v_.UNIFORM_BUFFER); - const e=new M_(i.createBuffer(),s); - return t._gpuData[this._renderer.uid]=e,this._managedBuffers.add(t),e} - resetState(){ - this._boundBufferBases=Object.create(null)} - } - ; - Qt(b_,"GlBufferSystem"); - let y_=b_; - y_.extension={ - type:[ri.WebGLSystem],name:"buffer"} - ; - const E_=(Qt(W=class{ - constructor(t){ - this.supports={ - uint32Indices:!0,uniformBufferObject:!0,vertexArrayObject:!0,srgbTextures:!0,nonPowOf2wrapping:!0,msaa:!0,nonPowOf2mipmaps:!0} - ,this._renderer=t,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)} - get isLost(){ - return!this.gl||this.gl.isContextLost()} - contextChange(t){ - this.gl=t,this._renderer.gl=t} - init(t){ - t={ - ...W.defaultOptions,...t} - ; - let i=this.multiView=t.multiView; - if(t.context&&i&&(qs(),i=!1),this.canvas=i?ln.get().createCanvas(this._renderer.canvas.width,this._renderer.canvas.height):this._renderer.view.canvas,t.context)this.initFromContext(t.context); - else{ - const i=this._renderer.background.alpha<1,s=t.premultipliedAlpha??!0,e=t.antialias&&!this._renderer.backBuffer.useBackBuffer; - this.createContext(t.preferWebGLVersion,{ - alpha:i,premultipliedAlpha:s,antialias:e,stencil:!0,preserveDrawingBuffer:t.preserveDrawingBuffer,powerPreference:t.powerPreference??"default"} - )} - } - ensureCanvasSize(t){ - if(!this.multiView)return void(t!==this.canvas&&qs()); - const{ - canvas:i} - =this; - (i.width<t.width||i.height<t.height)&&(i.width=Math.max(t.width,t.width),i.height=Math.max(t.height,t.height))} - initFromContext(t){ - this.gl=t,this.webGLVersion=t instanceof ln.get().getWebGLRenderingContext()?1:2,this.getExtensions(),this.validateContext(t),this._renderer.runners.contextChange.emit(t); - const i=this._renderer.view.canvas; - i.addEventListener("webglcontextlost",this.handleContextLost,!1),i.addEventListener("webglcontextrestored",this.handleContextRestored,!1)} - createContext(t,i){ - let s; - const e=this.canvas; - if(2===t&&(s=e.getContext("webgl2",i)),!s&&(s=e.getContext("webgl",i),!s))throw new Error("This browser does not support WebGL. Try using the canvas renderer"); - this.gl=s,this.initFromContext(this.gl)} - getExtensions(){ - const{ - gl:t} - =this,i={ - anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc"),bptc:t.getExtension("EXT_texture_compression_bptc"),rgtc:t.getExtension("EXT_texture_compression_rgtc"),loseContext:t.getExtension("WEBGL_lose_context")} - ; - if(1===this.webGLVersion)this.extensions={ - ...i,drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear"),vertexAttribDivisorANGLE:t.getExtension("ANGLE_instanced_arrays"),srgb:t.getExtension("EXT_sRGB")} - ; - else{ - this.extensions={ - ...i,colorBufferFloat:t.getExtension("EXT_color_buffer_float")} - ; - const s=t.getExtension("WEBGL_provoking_vertex"); - s&&s.provokingVertexWEBGL(s.FIRST_VERTEX_CONVENTION_WEBGL)} - } - handleContextLost(t){ - t.preventDefault(),this._contextLossForced&&(this._contextLossForced=!1,setTimeout(()=>{ - var t; - this.gl.isContextLost()&&(null==(t=this.extensions.loseContext)||t.restoreContext())} - ,0))} - handleContextRestored(){ - this.getExtensions(),this._renderer.runners.contextChange.emit(this.gl)} - destroy(){ - var t; - const i=this._renderer.view.canvas; - this._renderer=null,i.removeEventListener("webglcontextlost",this.handleContextLost),i.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),null==(t=this.extensions.loseContext)||t.loseContext()} - forceContextLoss(){ - var t; - null==(t=this.extensions.loseContext)||t.loseContext(),this._contextLossForced=!0} - validateContext(t){ - const i=t.getContextAttributes(); - i&&!i.stencil&&qs(); - const s=this.supports,e=2===this.webGLVersion,n=this.extensions; - s.uint32Indices=e||!!n.uint32ElementIndex,s.uniformBufferObject=e,s.vertexArrayObject=e||!!n.vertexArrayObject,s.srgbTextures=e||!!n.srgb,s.nonPowOf2wrapping=e,s.nonPowOf2mipmaps=e,s.msaa=e,s.uint32Indices||qs()} - } - ,"_GlContextSystem"),W); - E_.extension={ - type:[ri.WebGLSystem],name:"context"} - ,E_.defaultOptions={ - context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2,multiView:!1} - ; - let A_=E_; - function S_(t,i){ - for(const s in t.attributes){ - const e=t.attributes[s],n=i[s]; - n?(e.format??(e.format=n.format),e.offset??(e.offset=n.offset),e.instance??(e.instance=n.instance)):qs()} - T_(t)} - function T_(t){ - const{ - buffers:i,attributes:s} - =t,e={ - } - ,n={ - } - ; - for(const h in i){ - const t=i[h]; - e[t.uid]=0,n[t.uid]=0} - for(const h in s){ - const t=s[h]; - e[t.buffer.uid]+=$h(t.format).stride} - for(const h in s){ - const t=s[h]; - t.stride??(t.stride=e[t.buffer.uid]),t.start??(t.start=n[t.buffer.uid]),n[t.buffer.uid]+=$h(t.format).stride} - } - Qt(S_,"ensureAttributes"),Qt(T_,"ensureStartAndStride"); - var C_=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(C_||{ - } - ),O_=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(O_||{ - } - ),I_=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(I_||{ - } - ); - const k_={ - uint8x2:I_.UNSIGNED_BYTE,uint8x4:I_.UNSIGNED_BYTE,sint8x2:I_.BYTE,sint8x4:I_.BYTE,unorm8x2:I_.UNSIGNED_BYTE,unorm8x4:I_.UNSIGNED_BYTE,snorm8x2:I_.BYTE,snorm8x4:I_.BYTE,uint16x2:I_.UNSIGNED_SHORT,uint16x4:I_.UNSIGNED_SHORT,sint16x2:I_.SHORT,sint16x4:I_.SHORT,unorm16x2:I_.UNSIGNED_SHORT,unorm16x4:I_.UNSIGNED_SHORT,snorm16x2:I_.SHORT,snorm16x4:I_.SHORT,float16x2:I_.HALF_FLOAT,float16x4:I_.HALF_FLOAT,float32:I_.FLOAT,float32x2:I_.FLOAT,float32x3:I_.FLOAT,float32x4:I_.FLOAT,uint32:I_.UNSIGNED_INT,uint32x2:I_.UNSIGNED_INT,uint32x3:I_.UNSIGNED_INT,uint32x4:I_.UNSIGNED_INT,sint32:I_.INT,sint32x2:I_.INT,sint32x3:I_.INT,sint32x4:I_.INT} - ; - function x_(t){ - return k_[t]??k_.float32} - Qt(x_,"getGlTypeFromFormat"); - const R_={ - "point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5} - ,P_=class{ - constructor(){ - this.vaoCache=Object.create(null)} - destroy(){ - this.vaoCache=Object.create(null)} - } - ; - Qt(P_,"GlGeometryGpuData"); - let N_=P_; - const L_=class{ - constructor(t){ - this._renderer=t,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this._managedGeometries=new Yc({ - renderer:t,type:"resource",onUnload:this.onGeometryUnload.bind(this),name:"glGeometry"} - )} - contextChange(){ - const t=this.gl=this._renderer.gl; - if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device"); - this.destroyAll(!0); - const i=this._renderer.context.extensions.vertexArrayObject; - i&&(t.createVertexArray=()=>i.createVertexArrayOES(),t.bindVertexArray=t=>i.bindVertexArrayOES(t),t.deleteVertexArray=t=>i.deleteVertexArrayOES(t)); - const s=this._renderer.context.extensions.vertexAttribDivisorANGLE; - s&&(t.drawArraysInstanced=(t,i,e,n)=>{ - s.drawArraysInstancedANGLE(t,i,e,n)} - ,t.drawElementsInstanced=(t,i,e,n,h)=>{ - s.drawElementsInstancedANGLE(t,i,e,n,h)} - ,t.vertexAttribDivisor=(t,i)=>s.vertexAttribDivisorANGLE(t,i)),this._activeGeometry=null,this._activeVao=null} - bind(t,i){ - const s=this.gl; - this._activeGeometry=t; - const e=this.getVao(t,i); - this._activeVao!==e&&(this._activeVao=e,s.bindVertexArray(e)),this.updateBuffers()} - resetState(){ - this.unbind()} - updateBuffers(){ - const t=this._activeGeometry,i=this._renderer.buffer; - for(let s=0; - s<t.buffers.length; - s++){ - const e=t.buffers[s]; - i.updateBuffer(e)} - t._gcLastUsed=this._renderer.gc.now} - checkCompatibility(t,i){ - const s=t.attributes,e=i._attributeData; - for(const n in e)if(!s[n])throw new Error(`shader and geometry incompatible, geometry missing the "${ - n} - " attribute`)} - getSignature(t,i){ - const s=t.attributes,e=i._attributeData,n=["g",t.uid]; - for(const h in s)e[h]&&n.push(h,e[h].location); - return n.join("-")} - getVao(t,i){ - var s; - return(null==(s=t._gpuData[this._renderer.uid])?void 0:s.vaoCache[i._key])||this.initGeometryVao(t,i)} - initGeometryVao(t,i,s=!0){ - const e=this._renderer.gl,n=this._renderer.buffer; - this._renderer.shader._getProgramData(i),this.checkCompatibility(t,i); - const h=this.getSignature(t,i); - let r=t._gpuData[this._renderer.uid]; - r||(r=new N_,t._gpuData[this._renderer.uid]=r,this._managedGeometries.add(t)); - const o=r.vaoCache; - let a=o[h]; - if(a)return o[i._key]=a,a; - S_(t,i._attributeData); - const c=t.buffers; - a=e.createVertexArray(),e.bindVertexArray(a); - for(let l=0; - l<c.length; - l++){ - const t=c[l]; - n.bind(t)} - return this.activateVao(t,i),o[i._key]=a,o[h]=a,e.bindVertexArray(null),a} - onGeometryUnload(t,i=!1){ - const s=t._gpuData[this._renderer.uid]; - if(!s)return; - const e=s.vaoCache; - if(!i)for(const n in e)this._activeVao!==e[n]&&this.resetState(),this.gl.deleteVertexArray(e[n])} - destroyAll(t=!1){ - this._managedGeometries.removeAll(t)} - activateVao(t,i){ - var s; - const e=this._renderer.gl,n=this._renderer.buffer,h=t.attributes; - t.indexBuffer&&n.bind(t.indexBuffer); - let r=null; - for(const o in h){ - const t=h[o],a=t.buffer,c=n.getGlBuffer(a),l=i._attributeData[o]; - if(l){ - r!==c&&(n.bind(a),r=c); - const i=l.location; - e.enableVertexAttribArray(i); - const h=$h(t.format),o=x_(t.format); - if("int"===(null==(s=l.format)?void 0:s.substring(1,4))?e.vertexAttribIPointer(i,h.size,o,t.stride,t.offset):e.vertexAttribPointer(i,h.size,o,h.normalised,t.stride,t.offset),t.instance){ - if(!this.hasInstance)throw new Error("geometry error, GPU Instancing is not supported on this device"); - { - const s=t.divisor??1; - e.vertexAttribDivisor(i,s)} - } - } - } - } - draw(t,i,s,e){ - const{ - gl:n} - =this._renderer,h=this._activeGeometry,r=R_[t||h.topology]; - if(e??(e=h.instanceCount),h.indexBuffer){ - const t=h.indexBuffer.data.BYTES_PER_ELEMENT,o=2===t?n.UNSIGNED_SHORT:n.UNSIGNED_INT; - 1!==e?n.drawElementsInstanced(r,i||h.indexBuffer.data.length,o,(s||0)*t,e):n.drawElements(r,i||h.indexBuffer.data.length,o,(s||0)*t)} - else 1!==e?n.drawArraysInstanced(r,s||0,i||h.getSize(),e):n.drawArrays(r,s||0,i||h.getSize()); - return this} - unbind(){ - this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null} - destroy(){ - this._managedGeometries.destroy(),this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null} - } - ; - Qt(L_,"GlGeometrySystem"); - let D_=L_; - D_.extension={ - type:[ri.WebGLSystem],name:"geometry"} - ; - const G_=new Qa({ - attributes:{ - aPosition:[-1,-1,3,-1,-1,3]} - } - ),B_=(Qt(V=class{ - constructor(t){ - this.useBackBuffer=!1,this._useBackBufferThisRender=!1,this._renderer=t} - init(t={ - } - ){ - const{ - useBackBuffer:i,antialias:s} - ={ - ...V.defaultOptions,...t} - ; - this.useBackBuffer=i,this._antialias=s,this._renderer.context.supports.msaa||(qs(),this._antialias=!1),this._state=fr.for2d(); - const e=new Uh({ - vertex:"\n attribute vec2 aPosition; - \n out vec2 vUv; - \n\n void main() { - \n gl_Position = vec4(aPosition, 0.0, 1.0); - \n\n vUv = (aPosition + 1.0) / 2.0; - \n\n // flip dem UVs\n vUv.y = 1.0 - vUv.y; - \n } - ",fragment:"\n in vec2 vUv; - \n out vec4 finalColor; - \n\n uniform sampler2D uTexture; - \n\n void main() { - \n finalColor = texture(uTexture, vUv); - \n } - ",name:"big-triangle"} - ); - this._bigTriangleShader=new lr({ - glProgram:e,resources:{ - uTexture:ls.WHITE.source} - } - )} - renderStart(t){ - const i=this._renderer.renderTarget.getRenderTarget(t.target); - if(this._useBackBufferThisRender=this.useBackBuffer&&!!i.isRoot,this._useBackBufferThisRender){ - const i=this._renderer.renderTarget.getRenderTarget(t.target); - this._targetTexture=i.colorTexture,t.target=this._getBackBufferTexture(i.colorTexture)} - } - renderEnd(){ - this._presentBackBuffer()} - _presentBackBuffer(){ - const t=this._renderer; - t.renderTarget.finishRenderPass(),this._useBackBufferThisRender&&(t.renderTarget.bind(this._targetTexture,!1),this._bigTriangleShader.resources.uTexture=this._backBufferTexture.source,t.encoder.draw({ - geometry:G_,shader:this._bigTriangleShader,state:this._state} - ))} - _getBackBufferTexture(t){ - return this._backBufferTexture=this._backBufferTexture||new ls({ - source:new ns({ - width:t.width,height:t.height,resolution:t._resolution,antialias:this._antialias} - )} - ),this._backBufferTexture.source.resize(t.width,t.height,t._resolution),this._backBufferTexture} - destroy(){ - this._backBufferTexture&&(this._backBufferTexture.destroy(),this._backBufferTexture=null)} - } - ,"_GlBackBufferSystem"),V); - B_.extension={ - type:[ri.WebGLSystem],name:"backBuffer",priority:1} - ,B_.defaultOptions={ - useBackBuffer:!1} - ; - let U_=B_; - const F_=class{ - constructor(t){ - this._colorMaskCache=15,this._renderer=t} - setMask(t){ - this._colorMaskCache!==t&&(this._colorMaskCache=t,this._renderer.gl.colorMask(!!(8&t),!!(4&t),!!(2&t),!!(1&t)))} - } - ; - Qt(F_,"GlColorMaskSystem"); - let $_=F_; - $_.extension={ - type:[ri.WebGLSystem],name:"colorMask"} - ; - const H_=class{ - constructor(t){ - this.commandFinished=Promise.resolve(),this._renderer=t} - setGeometry(t,i){ - this._renderer.geometry.bind(t,i.glProgram)} - finishRenderPass(){ - } - draw(t){ - const i=this._renderer,{ - geometry:s,shader:e,state:n,skipSync:h,topology:r,size:o,start:a,instanceCount:c} - =t; - i.shader.bind(e,h),i.geometry.bind(s,i.shader._activeProgram),n&&i.state.set(n),i.geometry.draw(r,o,a,c??s.instanceCount)} - destroy(){ - this._renderer=null} - } - ; - Qt(H_,"GlEncoderSystem"); - let W_=H_; - W_.extension={ - type:[ri.WebGLSystem],name:"encoder"} - ; - const V_=class{ - constructor(t){ - this._renderer=t} - contextChange(){ - const t=this._renderer.gl; - this.maxTextures=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),this.maxBatchableTextures=Ra(this.maxTextures,t); - const i=2===this._renderer.context.webGLVersion; - this.maxUniformBindings=i?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0} - destroy(){ - } - } - ; - Qt(V_,"GlLimitsSystem"); - let j_=V_; - j_.extension={ - type:[ri.WebGLSystem],name:"limits"} - ; - const K_=class{ - constructor(){ - this.width=-1,this.height=-1,this.msaa=!1,this._attachedMipLevel=0,this._attachedLayer=0,this.msaaRenderBuffer=[]} - } - ; - Qt(K_,"GlRenderTarget"); - let z_=K_; - const Y_=[]; - Y_[Oa.NONE]=void 0,Y_[Oa.DISABLED]={ - stencilWriteMask:0,stencilReadMask:0} - ,Y_[Oa.RENDERING_MASK_ADD]={ - stencilFront:{ - compare:"equal",passOp:"increment-clamp"} - ,stencilBack:{ - compare:"equal",passOp:"increment-clamp"} - } - ,Y_[Oa.RENDERING_MASK_REMOVE]={ - stencilFront:{ - compare:"equal",passOp:"decrement-clamp"} - ,stencilBack:{ - compare:"equal",passOp:"decrement-clamp"} - } - ,Y_[Oa.MASK_ACTIVE]={ - stencilWriteMask:0,stencilFront:{ - compare:"equal",passOp:"keep"} - ,stencilBack:{ - compare:"equal",passOp:"keep"} - } - ,Y_[Oa.INVERSE_MASK_ACTIVE]={ - stencilWriteMask:0,stencilFront:{ - compare:"not-equal",passOp:"keep"} - ,stencilBack:{ - compare:"not-equal",passOp:"keep"} - } - ; - const q_=class{ - constructor(t){ - this._stencilCache={ - enabled:!1,stencilReference:0,stencilMode:Oa.NONE} - ,this._renderTargetStencilState=Object.create(null),t.renderTarget.onRenderTargetChange.add(this)} - contextChange(t){ - this._gl=t,this._comparisonFuncMapping={ - always:t.ALWAYS,never:t.NEVER,equal:t.EQUAL,"not-equal":t.NOTEQUAL,less:t.LESS,"less-equal":t.LEQUAL,greater:t.GREATER,"greater-equal":t.GEQUAL} - ,this._stencilOpsMapping={ - keep:t.KEEP,zero:t.ZERO,replace:t.REPLACE,invert:t.INVERT,"increment-clamp":t.INCR,"decrement-clamp":t.DECR,"increment-wrap":t.INCR_WRAP,"decrement-wrap":t.DECR_WRAP} - ,this.resetState()} - onRenderTargetChange(t){ - if(this._activeRenderTarget===t)return; - this._activeRenderTarget=t; - let i=this._renderTargetStencilState[t.uid]; - i||(i=this._renderTargetStencilState[t.uid]={ - stencilMode:Oa.DISABLED,stencilReference:0} - ),this.setStencilMode(i.stencilMode,i.stencilReference)} - resetState(){ - this._stencilCache.enabled=!1,this._stencilCache.stencilMode=Oa.NONE,this._stencilCache.stencilReference=0} - setStencilMode(t,i){ - const s=this._renderTargetStencilState[this._activeRenderTarget.uid],e=this._gl,n=Y_[t],h=this._stencilCache; - s.stencilMode=t,s.stencilReference=i,t!==Oa.DISABLED?(this._stencilCache.enabled||(this._stencilCache.enabled=!0,e.enable(e.STENCIL_TEST)),t===h.stencilMode&&h.stencilReference===i||(h.stencilMode=t,h.stencilReference=i,e.stencilFunc(this._comparisonFuncMapping[n.stencilBack.compare],i,255),e.stencilOp(e.KEEP,e.KEEP,this._stencilOpsMapping[n.stencilBack.passOp]))):this._stencilCache.enabled&&(this._stencilCache.enabled=!1,e.disable(e.STENCIL_TEST))} - } - ; - Qt(q_,"GlStencilSystem"); - let X_=q_; - X_.extension={ - type:[ri.WebGLSystem],name:"stencil"} - ; - const J_=class{ - constructor(t){ - this._syncFunctionHash=Object.create(null),this._adaptor=t,this._systemCheck()} - _systemCheck(){ - if(!_r())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")} - ensureUniformGroup(t){ - const i=this.getUniformGroupData(t); - t.buffer||(t.buffer=new za({ - data:new Float32Array(i.layout.size/4),usage:Ka.UNIFORM|Ka.COPY_DST} - ))} - getUniformGroupData(t){ - return this._syncFunctionHash[t._signature]||this._initUniformGroup(t)} - _initUniformGroup(t){ - const i=t._signature; - let s=this._syncFunctionHash[i]; - if(!s){ - const e=Object.keys(t.uniformStructures).map(i=>t.uniformStructures[i]),n=this._adaptor.createUboElements(e),h=this._generateUboSync(n.uboElements); - s=this._syncFunctionHash[i]={ - layout:n,syncFunction:h} - } - return this._syncFunctionHash[i]} - _generateUboSync(t){ - return this._adaptor.generateUboSync(t)} - syncUniformGroup(t,i,s){ - const e=this.getUniformGroupData(t); - t.buffer||(t.buffer=new za({ - data:new Float32Array(e.layout.size/4),usage:Ka.UNIFORM|Ka.COPY_DST} - )); - let n=null; - return i||(i=t.buffer.data,n=t.buffer.dataInt32),s||(s=0),e.syncFunction(t.uniforms,i,n,s),!0} - updateUniformGroup(t){ - if(t.isStatic&&!t._dirtyId)return!1; - t._dirtyId=0; - const i=this.syncUniformGroup(t); - return t.buffer.update(),i} - destroy(){ - this._syncFunctionHash=null} - } - ; - Qt(J_,"UboSystem"); - let Q_=J_; - const Z_={ - f32:4,i32:4,"vec2<f32>":8,"vec3<f32>":12,"vec4<f32>":16,"vec2<i32>":8,"vec3<i32>":12,"vec4<i32>":16,"mat2x2<f32>":32,"mat3x3<f32>":48,"mat4x4<f32>":64} - ; - function tM(t){ - const i=t.map(t=>({ - data:t,offset:0,size:0} - )); - let s=0,e=0; - for(let n=0; - n<i.length; - n++){ - const t=i[n]; - if(s=Z_[t.data.type],!s)throw new Error(`Unknown type ${ - t.data.type} - `); - t.data.size>1&&(s=Math.max(s,16)*t.data.size); - const h=12===s?16:s; - t.size=s; - const r=e%16; - e+=r>0&&16-r<h?(16-r)%16:(s-r%s)%s,t.offset=e,e+=s} - return e=16*Math.ceil(e/16),{ - uboElements:i,size:e} - } - Qt(tM,"createUboElementsSTD40"); - const iM=[{ - type:"mat3x3<f32>",test:Qt(t=>void 0!==t.value.a,"test"),ubo:"\n var matrix = uv[name].toArray(true); - \n data[offset] = matrix[0]; - \n data[offset + 1] = matrix[1]; - \n data[offset + 2] = matrix[2]; - \n data[offset + 4] = matrix[3]; - \n data[offset + 5] = matrix[4]; - \n data[offset + 6] = matrix[5]; - \n data[offset + 8] = matrix[6]; - \n data[offset + 9] = matrix[7]; - \n data[offset + 10] = matrix[8]; - \n ",uniform:"\n gl.uniformMatrix3fv(ud[name].location, false, uv[name].toArray(true)); - \n "} - ,{ - type:"vec4<f32>",test:Qt(t=>"vec4<f32>"===t.type&&1===t.size&&void 0!==t.value.width,"test"),ubo:"\n v = uv[name]; - \n data[offset] = v.x; - \n data[offset + 1] = v.y; - \n data[offset + 2] = v.width; - \n data[offset + 3] = v.height; - \n ",uniform:"\n cv = ud[name].value; - \n v = uv[name]; - \n if (cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) { - \n cv[0] = v.x; - \n cv[1] = v.y; - \n cv[2] = v.width; - \n cv[3] = v.height; - \n gl.uniform4f(ud[name].location, v.x, v.y, v.width, v.height); - \n } - \n "} - ,{ - type:"vec2<f32>",test:Qt(t=>"vec2<f32>"===t.type&&1===t.size&&void 0!==t.value.x,"test"),ubo:"\n v = uv[name]; - \n data[offset] = v.x; - \n data[offset + 1] = v.y; - \n ",uniform:"\n cv = ud[name].value; - \n v = uv[name]; - \n if (cv[0] !== v.x || cv[1] !== v.y) { - \n cv[0] = v.x; - \n cv[1] = v.y; - \n gl.uniform2f(ud[name].location, v.x, v.y); - \n } - \n "} - ,{ - type:"vec4<f32>",test:Qt(t=>"vec4<f32>"===t.type&&1===t.size&&void 0!==t.value.red,"test"),ubo:"\n v = uv[name]; - \n data[offset] = v.red; - \n data[offset + 1] = v.green; - \n data[offset + 2] = v.blue; - \n data[offset + 3] = v.alpha; - \n ",uniform:"\n cv = ud[name].value; - \n v = uv[name]; - \n if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) { - \n cv[0] = v.red; - \n cv[1] = v.green; - \n cv[2] = v.blue; - \n cv[3] = v.alpha; - \n gl.uniform4f(ud[name].location, v.red, v.green, v.blue, v.alpha); - \n } - \n "} - ,{ - type:"vec3<f32>",test:Qt(t=>"vec3<f32>"===t.type&&1===t.size&&void 0!==t.value.red,"test"),ubo:"\n v = uv[name]; - \n data[offset] = v.red; - \n data[offset + 1] = v.green; - \n data[offset + 2] = v.blue; - \n ",uniform:"\n cv = ud[name].value; - \n v = uv[name]; - \n if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue) { - \n cv[0] = v.red; - \n cv[1] = v.green; - \n cv[2] = v.blue; - \n gl.uniform3f(ud[name].location, v.red, v.green, v.blue); - \n } - \n "} - ]; - function sM(t,i,s,e){ - const n=["\n var v = null; - \n var v2 = null; - \n var t = 0; - \n var index = 0; - \n var name = null; - \n var arrayOffset = null; - \n "]; - let h=0; - for(let o=0; - o<t.length; - o++){ - const r=t[o],a=r.data.name; - let c=!1,l=0; - for(let t=0; - t<iM.length; - t++)if(iM[t].test(r.data)){ - l=r.offset/4,n.push(`name = "${ - a} - "; - `,`offset += ${ - l-h} - ; - `,iM[t][i]||iM[t].ubo),c=!0; - break} - if(!c)if(r.data.size>1)l=r.offset/4,n.push(s(r,l-h)); - else{ - const t=e[r.data.type]; - l=r.offset/4,n.push(`\n v = uv.${ - a} - ; - \n offset += ${ - l-h} - ; - \n ${ - t} - ; - \n `)} - h=l} - const r=n.join("\n"); - return new Function("uv","data","dataInt32","offset",r)} - function eM(t,i){ - return`\n for (let i = 0; - i < ${ - t*i} - ; - i++) { - \n data[offset + (((i / ${ - t} - )|0) * 4) + (i % ${ - t} - )] = v[i]; - \n } - \n `} - Qt(sM,"createUboSyncFunction"),Qt(eM,"loopMatrix"); - const nM={ - f32:"\n data[offset] = v; - ",i32:"\n dataInt32[offset] = v; - ","vec2<f32>":"\n data[offset] = v[0]; - \n data[offset + 1] = v[1]; - ","vec3<f32>":"\n data[offset] = v[0]; - \n data[offset + 1] = v[1]; - \n data[offset + 2] = v[2]; - ","vec4<f32>":"\n data[offset] = v[0]; - \n data[offset + 1] = v[1]; - \n data[offset + 2] = v[2]; - \n data[offset + 3] = v[3]; - ","vec2<i32>":"\n dataInt32[offset] = v[0]; - \n dataInt32[offset + 1] = v[1]; - ","vec3<i32>":"\n dataInt32[offset] = v[0]; - \n dataInt32[offset + 1] = v[1]; - \n dataInt32[offset + 2] = v[2]; - ","vec4<i32>":"\n dataInt32[offset] = v[0]; - \n dataInt32[offset + 1] = v[1]; - \n dataInt32[offset + 2] = v[2]; - \n dataInt32[offset + 3] = v[3]; - ","mat2x2<f32>":"\n data[offset] = v[0]; - \n data[offset + 1] = v[1]; - \n data[offset + 4] = v[2]; - \n data[offset + 5] = v[3]; - ","mat3x3<f32>":"\n data[offset] = v[0]; - \n data[offset + 1] = v[1]; - \n data[offset + 2] = v[2]; - \n data[offset + 4] = v[3]; - \n data[offset + 5] = v[4]; - \n data[offset + 6] = v[5]; - \n data[offset + 8] = v[6]; - \n data[offset + 9] = v[7]; - \n data[offset + 10] = v[8]; - ","mat4x4<f32>":"\n for (let i = 0; - i < 16; - i++) { - \n data[offset + i] = v[i]; - \n } - ","mat3x2<f32>":eM(3,2),"mat4x2<f32>":eM(4,2),"mat2x3<f32>":eM(2,3),"mat4x3<f32>":eM(4,3),"mat2x4<f32>":eM(2,4),"mat3x4<f32>":eM(3,4)} - ,hM={ - ...nM,"mat2x2<f32>":"\n data[offset] = v[0]; - \n data[offset + 1] = v[1]; - \n data[offset + 2] = v[2]; - \n data[offset + 3] = v[3]; - \n "} - ; - function rM(t,i){ - const s=Math.max(Z_[t.data.type]/16,1),e=t.data.value.length/t.data.size,n=(4-e%4)%4,h=t.data.type.indexOf("i32")>=0?"dataInt32":"data"; - return`\n v = uv.${ - t.data.name} - ; - \n offset += ${ - i} - ; - \n\n arrayOffset = offset; - \n\n t = 0; - \n\n for(var i=0; - i < ${ - t.data.size*s} - ; - i++)\n { - \n for(var j = 0; - j < ${ - e} - ; - j++)\n { - \n ${ - h} - [arrayOffset++] = v[t++]; - \n } - \n ${ - 0!==n?`arrayOffset += ${ - n} - ; - `:""} - \n } - \n `} - function oM(t){ - return sM(t,"uboStd40",rM,nM)} - Qt(rM,"generateArraySyncSTD40"),Qt(oM,"createUboSyncFunctionSTD40"); - const aM=class extends Q_{ - constructor(){ - super({ - createUboElements:tM,generateUboSync:oM} - )} - } - ; - Qt(aM,"GlUboSystem"); - let cM=aM; - cM.extension={ - type:[ri.WebGLSystem],name:"ubo"} - ; - const lM=class{ - constructor(){ - this._clearColorCache=[0,0,0,0],this._viewPortCache=new $i} - init(t,i){ - this._renderer=t,this._renderTargetSystem=i,t.runners.contextChange.add(this)} - contextChange(){ - this._clearColorCache=[0,0,0,0],this._viewPortCache=new $i; - const t=this._renderer.gl; - this._drawBuffersCache=[]; - for(let i=1; - i<=16; - i++)this._drawBuffersCache[i]=Array.from({ - length:i} - ,(i,s)=>t.COLOR_ATTACHMENT0+s)} - copyToTexture(t,i,s,e,n){ - const h=this._renderTargetSystem,r=this._renderer,o=h.getGpuRenderTarget(t),a=r.gl; - return this.finishRenderPass(t),a.bindFramebuffer(a.FRAMEBUFFER,o.resolveTargetFramebuffer),r.texture.bind(i,0),a.copyTexSubImage2D(a.TEXTURE_2D,0,n.x,n.y,s.x,s.y,e.width,e.height),i} - startRenderPass(t,i=!0,s,e,n=0,h=0){ - const r=this._renderTargetSystem,o=t.colorTexture,a=r.getGpuRenderTarget(t); - if(0!==h&&this._renderer.context.webGLVersion<2)throw new Error("[RenderTargetSystem] Rendering to array layers requires WebGL2."); - if(n>0){ - if(a.msaa)throw new Error("[RenderTargetSystem] Rendering to mip levels is not supported with MSAA render targets."); - if(this._renderer.context.webGLVersion<2)throw new Error("[RenderTargetSystem] Rendering to mip levels requires WebGL2.")} - let c=e.y; - t.isRoot&&(c=o.pixelHeight-e.height-e.y),t.colorTextures.forEach(t=>{ - this._renderer.texture.unbind(t)} - ); - const l=this._renderer.gl; - l.bindFramebuffer(l.FRAMEBUFFER,a.framebuffer),t.isRoot||a._attachedMipLevel===n&&a._attachedLayer===h||(t.colorTextures.forEach((t,i)=>{ - const s=this._renderer.texture.getGlSource(t); - if(s.target===l.TEXTURE_2D){ - if(0!==h)throw new Error("[RenderTargetSystem] layer must be 0 when rendering to 2D textures in WebGL."); - l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0+i,l.TEXTURE_2D,s.texture,n)} - else if(s.target===l.TEXTURE_2D_ARRAY){ - if(this._renderer.context.webGLVersion<2)throw new Error("[RenderTargetSystem] Rendering to 2D array textures requires WebGL2."); - l.framebufferTextureLayer(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0+i,s.texture,n,h)} - else{ - if(s.target!==l.TEXTURE_CUBE_MAP)throw new Error("[RenderTargetSystem] Unsupported texture target for render-to-layer in WebGL."); - if(h<0||h>5)throw new Error("[RenderTargetSystem] Cube map layer must be between 0 and 5."); - l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0+i,l.TEXTURE_CUBE_MAP_POSITIVE_X+h,s.texture,n)} - } - ),a._attachedMipLevel=n,a._attachedLayer=h),t.colorTextures.length>1&&this._setDrawBuffers(t,l); - const u=this._viewPortCache; - u.x===e.x&&u.y===c&&u.width===e.width&&u.height===e.height||(u.x=e.x,u.y=c,u.width=e.width,u.height=e.height,l.viewport(e.x,c,e.width,e.height)),a.depthStencilRenderBuffer||!t.stencil&&!t.depth||this._initStencil(a),this.clear(t,i,s)} - finishRenderPass(t){ - const i=this._renderTargetSystem.getGpuRenderTarget(t); - if(!i.msaa)return; - const s=this._renderer.gl; - s.bindFramebuffer(s.FRAMEBUFFER,i.resolveTargetFramebuffer),s.bindFramebuffer(s.READ_FRAMEBUFFER,i.framebuffer),s.blitFramebuffer(0,0,i.width,i.height,0,0,i.width,i.height,s.COLOR_BUFFER_BIT,s.NEAREST),s.bindFramebuffer(s.FRAMEBUFFER,i.framebuffer)} - initGpuRenderTarget(t){ - const i=this._renderer.gl,s=new z_; - return s._attachedMipLevel=0,s._attachedLayer=0,t.colorTexture instanceof dn?(this._renderer.context.ensureCanvasSize(t.colorTexture.resource),s.framebuffer=null,s):(this._initColor(t,s),i.bindFramebuffer(i.FRAMEBUFFER,null),s)} - destroyGpuRenderTarget(t){ - const i=this._renderer.gl; - t.framebuffer&&(i.deleteFramebuffer(t.framebuffer),t.framebuffer=null),t.resolveTargetFramebuffer&&(i.deleteFramebuffer(t.resolveTargetFramebuffer),t.resolveTargetFramebuffer=null),t.depthStencilRenderBuffer&&(i.deleteRenderbuffer(t.depthStencilRenderBuffer),t.depthStencilRenderBuffer=null),t.msaaRenderBuffer.forEach(t=>{ - i.deleteRenderbuffer(t)} - ),t.msaaRenderBuffer=null} - clear(t,i,s,e,n=0,h=0){ - if(!i)return; - if(0!==h)throw new Error("[RenderTargetSystem] Clearing array layers is not supported in WebGL renderer."); - const r=this._renderTargetSystem; - "boolean"==typeof i&&(i=i?to.ALL:to.NONE); - const o=this._renderer.gl; - if(i&to.COLOR){ - s??(s=r.defaultClearColor); - const t=this._clearColorCache,i=s; - t[0]===i[0]&&t[1]===i[1]&&t[2]===i[2]&&t[3]===i[3]||(t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],o.clearColor(i[0],i[1],i[2],i[3]))} - o.clear(i)} - resizeGpuRenderTarget(t){ - if(t.isRoot)return; - const i=this._renderTargetSystem.getGpuRenderTarget(t); - this._resizeColor(t,i),(t.stencil||t.depth)&&this._resizeStencil(i)} - _initColor(t,i){ - const s=this._renderer,e=s.gl,n=e.createFramebuffer(); - if(i.resolveTargetFramebuffer=n,e.bindFramebuffer(e.FRAMEBUFFER,n),i.width=t.colorTexture.source.pixelWidth,i.height=t.colorTexture.source.pixelHeight,t.colorTextures.forEach((t,n)=>{ - const h=t.source; - h.antialias&&(s.context.supports.msaa?i.msaa=!0:qs()),s.texture.bindSource(h,0); - const r=s.texture.getGlSource(h),o=r.texture; - if(r.target===e.TEXTURE_2D)e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,e.TEXTURE_2D,o,0); - else if(r.target===e.TEXTURE_2D_ARRAY){ - if(s.context.webGLVersion<2)throw new Error("[RenderTargetSystem] TEXTURE_2D_ARRAY requires WebGL2."); - e.framebufferTextureLayer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,o,0,0)} - else{ - if(r.target!==e.TEXTURE_CUBE_MAP)throw new Error("[RenderTargetSystem] Unsupported texture target for framebuffer attachment."); - e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,e.TEXTURE_CUBE_MAP_POSITIVE_X,o,0)} - } - ),i.msaa){ - const s=e.createFramebuffer(); - i.framebuffer=s,e.bindFramebuffer(e.FRAMEBUFFER,s),t.colorTextures.forEach((t,s)=>{ - const n=e.createRenderbuffer(); - i.msaaRenderBuffer[s]=n} - )} - else i.framebuffer=n; - this._resizeColor(t,i)} - _resizeColor(t,i){ - const s=t.colorTexture.source; - if(i.width=s.pixelWidth,i.height=s.pixelHeight,i._attachedMipLevel=0,i._attachedLayer=0,t.colorTextures.forEach((t,i)=>{ - 0!==i&&t.source.resize(s.width,s.height,s._resolution)} - ),i.msaa){ - const s=this._renderer,e=s.gl,n=i.framebuffer; - e.bindFramebuffer(e.FRAMEBUFFER,n),t.colorTextures.forEach((t,n)=>{ - const h=t.source; - s.texture.bindSource(h,0); - const r=s.texture.getGlSource(h).internalFormat,o=i.msaaRenderBuffer[n]; - e.bindRenderbuffer(e.RENDERBUFFER,o),e.renderbufferStorageMultisample(e.RENDERBUFFER,4,r,h.pixelWidth,h.pixelHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,e.RENDERBUFFER,o)} - )} - } - _initStencil(t){ - if(null===t.framebuffer)return; - const i=this._renderer.gl,s=i.createRenderbuffer(); - t.depthStencilRenderBuffer=s,i.bindRenderbuffer(i.RENDERBUFFER,s),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,s),this._resizeStencil(t)} - _resizeStencil(t){ - const i=this._renderer.gl; - i.bindRenderbuffer(i.RENDERBUFFER,t.depthStencilRenderBuffer),t.msaa?i.renderbufferStorageMultisample(i.RENDERBUFFER,4,i.DEPTH24_STENCIL8,t.width,t.height):i.renderbufferStorage(i.RENDERBUFFER,2===this._renderer.context.webGLVersion?i.DEPTH24_STENCIL8:i.DEPTH_STENCIL,t.width,t.height)} - prerender(t){ - const i=t.colorTexture.resource; - this._renderer.context.multiView&&dn.test(i)&&this._renderer.context.ensureCanvasSize(i)} - postrender(t){ - if(this._renderer.context.multiView&&dn.test(t.colorTexture.resource)){ - const i=this._renderer.context.canvas,s=t.colorTexture; - s.context2D.drawImage(i,0,s.pixelHeight-i.height)} - } - _setDrawBuffers(t,i){ - const s=t.colorTextures.length,e=this._drawBuffersCache[s]; - if(1===this._renderer.context.webGLVersion){ - const t=this._renderer.context.extensions.drawBuffers; - t?t.drawBuffersWEBGL(e):qs()} - else i.drawBuffers(e)} - } - ; - Qt(lM,"GlRenderTargetAdaptor"); - let uM=lM; - const dM=class extends s_{ - constructor(t){ - super(t),this.adaptor=new uM,this.adaptor.init(t,this)} - } - ; - Qt(dM,"GlRenderTargetSystem"); - let fM=dM; - fM.extension={ - type:[ri.WebGLSystem],name:"renderTarget"} - ; - const pM=class extends vi{ - constructor({ - buffer:t,offset:i,size:s} - ){ - super(),this.uid=Wi("buffer"),this._resourceType="bufferResource",this._touched=0,this._resourceId=Wi("resource"),this._bufferResource=!0,this.destroyed=!1,this.buffer=t,this.offset=0|i,this.size=s,this.buffer.on("change",this.onBufferChange,this)} - onBufferChange(){ - this._resourceId=Wi("resource"),this.emit("change",this)} - destroy(t=!1){ - this.destroyed=!0,t&&this.buffer.destroy(),this.emit("change",this),this.buffer=null,this.removeAllListeners()} - } - ; - Qt(pM,"BufferResource"); - let wM=pM; - function gM(t,i){ - const s=[],e=["\n var g = s.groups; - \n var sS = r.shader; - \n var p = s.glProgram; - \n var ugS = r.uniformGroup; - \n var resources; - \n "]; - let n=!1,h=0; - const r=i._getProgramData(t.glProgram); - for(const a in t.groups){ - const o=t.groups[a]; - s.push(`\n resources = g[${ - a} - ].resources; - \n `); - for(const c in o.resources){ - const l=o.resources[c]; - if(l instanceof hr)if(l.ubo){ - const i=t._uniformBindMap[a][Number(c)]; - s.push(`\n sS.bindUniformBlock(\n resources[${ - c} - ],\n '${ - i} - ',\n ${ - t.glProgram._uniformBlockData[i].index} - \n ); - \n `)} - else s.push(`\n ugS.updateUniformGroup(resources[${ - c} - ], p, sD); - \n `); - else if(l instanceof wM){ - const i=t._uniformBindMap[a][Number(c)]; - s.push(`\n sS.bindUniformBlock(\n resources[${ - c} - ],\n '${ - i} - ',\n ${ - t.glProgram._uniformBlockData[i].index} - \n ); - \n `)} - else if(l instanceof ns){ - const o=t._uniformBindMap[a][c],l=r.uniformData[o]; - l&&(n||(n=!0,e.push("\n var tS = r.texture; - \n ")),i._gl.uniform1i(l.location,h),s.push(`\n tS.bind(resources[${ - c} - ], ${ - h} - ); - \n `),h++)} - } - } - const o=[...e,...s].join("\n"); - return new Function("r","s","sD",o)} - Qt(gM,"generateShaderSyncCode"); - const mM=class{ - constructor(t,i){ - this.program=t,this.uniformData=i,this.uniformGroups={ - } - ,this.uniformDirtyGroups={ - } - ,this.uniformBlockBindings={ - } - } - destroy(){ - this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBlockBindings=null,this.program=null} - } - ; - Qt(mM,"GlProgramData"); - let vM=mM; - function _M(t,i,s){ - const e=t.createShader(i); - return t.shaderSource(e,s),t.compileShader(e),e} - function MM(t){ - const i=new Array(t); - for(let s=0; - s<i.length; - s++)i[s]=!1; - return i} - function bM(t,i){ - switch(t){ - case"float":case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0; - case"vec2":return new Float32Array(2*i); - case"vec3":return new Float32Array(3*i); - case"vec4":return new Float32Array(4*i); - case"ivec2":return new Int32Array(2*i); - case"ivec3":return new Int32Array(3*i); - case"ivec4":return new Int32Array(4*i); - case"uvec2":return new Uint32Array(2*i); - case"uvec3":return new Uint32Array(3*i); - case"uvec4":return new Uint32Array(4*i); - case"bool":return!1; - case"bvec2":return MM(2*i); - case"bvec3":return MM(3*i); - case"bvec4":return MM(4*i); - case"mat2":return new Float32Array([1,0,0,1]); - case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]); - case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])} - return null} - Qt(_M,"compileShader"),Qt(MM,"booleanArray"),Qt(bM,"defaultValue"); - let yM=null; - const EM={ - FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"} - ,AM={ - float:"float32",vec2:"float32x2",vec3:"float32x3",vec4:"float32x4",int:"sint32",ivec2:"sint32x2",ivec3:"sint32x3",ivec4:"sint32x4",uint:"uint32",uvec2:"uint32x2",uvec3:"uint32x3",uvec4:"uint32x4",bool:"uint32",bvec2:"uint32x2",bvec3:"uint32x3",bvec4:"uint32x4"} - ; - function SM(t,i){ - if(!yM){ - const i=Object.keys(EM); - yM={ - } - ; - for(let s=0; - s<i.length; - ++s){ - const e=i[s]; - yM[t[e]]=EM[e]} - } - return yM[i]} - function TM(t,i){ - const s=SM(t,i); - return AM[s]||"float32"} - function CM(t,i,s=!1){ - const e={ - } - ,n=i.getProgramParameter(t,i.ACTIVE_ATTRIBUTES); - for(let r=0; - r<n; - r++){ - const s=i.getActiveAttrib(t,r); - if(s.name.startsWith("gl_"))continue; - const n=TM(i,s.type); - e[s.name]={ - location:0,format:n,stride:$h(n).stride,offset:0,instance:!1,start:0} - } - const h=Object.keys(e); - if(s){ - h.sort((t,i)=>t>i?1:-1); - for(let s=0; - s<h.length; - s++)e[h[s]].location=s,i.bindAttribLocation(t,s,h[s]); - i.linkProgram(t)} - else for(let r=0; - r<h.length; - r++)e[h[r]].location=i.getAttribLocation(t,h[r]); - return e} - function OM(t,i){ - if(!i.ACTIVE_UNIFORM_BLOCKS)return{ - } - ; - const s={ - } - ,e=i.getProgramParameter(t,i.ACTIVE_UNIFORM_BLOCKS); - for(let n=0; - n<e; - n++){ - const e=i.getActiveUniformBlockName(t,n),h=i.getUniformBlockIndex(t,e),r=i.getActiveUniformBlockParameter(t,n,i.UNIFORM_BLOCK_DATA_SIZE); - s[e]={ - name:e,index:h,size:r} - } - return s} - function IM(t,i){ - const s={ - } - ,e=i.getProgramParameter(t,i.ACTIVE_UNIFORMS); - for(let n=0; - n<e; - n++){ - const e=i.getActiveUniform(t,n),h=e.name.replace(/\[.*?\]$/,""),r=!!e.name.match(/\[.*?\]$/),o=SM(i,e.type); - s[h]={ - name:h,index:n,type:o,size:e.size,isArray:r,value:bM(o,e.size)} - } - return s} - function kM(t,i){ - const s=t.getShaderSource(i).split("\n").map((t,i)=>`${ - i} - : ${ - t} - `),e=t.getShaderInfoLog(i).split("\n"),n={ - } - ,h=e.map(t=>parseFloat(t.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(t=>!(!t||n[t]||(n[t]=!0,0))),r=[""]; - h.forEach(t=>{ - s[t-1]=`%c${ - s[t-1]} - %c`,r.push("background: #FF0000; - color:#FFFFFF; - font-size: 10px","font-size: 10px")} - ); - const o=s.join("\n"); - r[0]=o} - function xM(t,i,s,e){ - t.getProgramParameter(i,t.LINK_STATUS)||(t.getShaderParameter(s,t.COMPILE_STATUS)||kM(t,s),t.getShaderParameter(e,t.COMPILE_STATUS)||kM(t,e),t.getProgramInfoLog(i))} - function RM(t,i){ - const s=_M(t,t.VERTEX_SHADER,i.vertex),e=_M(t,t.FRAGMENT_SHADER,i.fragment),n=t.createProgram(); - t.attachShader(n,s),t.attachShader(n,e); - const h=i.transformFeedbackVaryings; - h&&("function"!=typeof t.transformFeedbackVaryings?qs():t.transformFeedbackVaryings(n,h.names,"separate"===h.bufferMode?t.SEPARATE_ATTRIBS:t.INTERLEAVED_ATTRIBS)),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS)||xM(t,n,s,e),i._attributeData=CM(n,t,!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(i.vertex)),i._uniformData=IM(n,t),i._uniformBlockData=OM(n,t),t.deleteShader(s),t.deleteShader(e); - const r={ - } - ; - for(const o in i._uniformData){ - const s=i._uniformData[o]; - r[o]={ - location:t.getUniformLocation(n,o),value:bM(s.type,s.size)} - } - return new vM(n,r)} - Qt(SM,"mapType"),Qt(TM,"mapGlToVertexFormat"),Qt(CM,"extractAttributesFromGlProgram"),Qt(OM,"getUboData"),Qt(IM,"getUniformData"),Qt(kM,"logPrettyShaderError"),Qt(xM,"logProgramError"),Qt(RM,"generateProgram"); - const PM={ - textureCount:0,blockIndex:0} - ,NM=class{ - constructor(t){ - this._activeProgram=null,this._programDataHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._renderer=t} - contextChange(t){ - this._gl=t,this._programDataHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._activeProgram=null} - bind(t,i){ - if(this._setProgram(t.glProgram),i)return; - PM.textureCount=0,PM.blockIndex=0; - let s=this._shaderSyncFunctions[t.glProgram._key]; - s||(s=this._shaderSyncFunctions[t.glProgram._key]=this._generateShaderSync(t,this)),this._renderer.buffer.nextBindBase(!!t.glProgram.transformFeedbackVaryings),s(this._renderer,t,PM)} - updateUniformGroup(t){ - this._renderer.uniformGroup.updateUniformGroup(t,this._activeProgram,PM)} - bindUniformBlock(t,i,s=0){ - const e=this._renderer.buffer,n=this._getProgramData(this._activeProgram),h=t._bufferResource; - h||this._renderer.ubo.updateUniformGroup(t); - const r=t.buffer,o=e.updateBuffer(r),a=e.freeLocationForBufferBase(o); - if(h){ - const{ - offset:i,size:s} - =t; - 0===i&&s===r.data.byteLength?e.bindBufferBase(o,a):e.bindBufferRange(o,a,i)} - else e.getLastBindBaseLocation(o)!==a&&e.bindBufferBase(o,a); - const c=this._activeProgram._uniformBlockData[i].index; - n.uniformBlockBindings[s]!==a&&(n.uniformBlockBindings[s]=a,this._renderer.gl.uniformBlockBinding(n.program,c,a))} - _setProgram(t){ - if(this._activeProgram===t)return; - this._activeProgram=t; - const i=this._getProgramData(t); - this._gl.useProgram(i.program)} - _getProgramData(t){ - return this._programDataHash[t._key]||this._createProgramData(t)} - _createProgramData(t){ - const i=t._key; - return this._programDataHash[i]=RM(this._gl,t),this._programDataHash[i]} - destroy(){ - for(const t of Object.keys(this._programDataHash))this._programDataHash[t].destroy(); - this._programDataHash=null,this._shaderSyncFunctions=null,this._activeProgram=null,this._renderer=null,this._gl=null} - _generateShaderSync(t,i){ - return gM(t,i)} - resetState(){ - this._activeProgram=null} - } - ; - Qt(NM,"GlShaderSystem"); - let LM=NM; - LM.extension={ - type:[ri.WebGLSystem],name:"shader"} - ; - const DM={ - f32:"if (cv !== v) { - \n cu.value = v; - \n gl.uniform1f(location, v); - \n } - ","vec2<f32>":"if (cv[0] !== v[0] || cv[1] !== v[1]) { - \n cv[0] = v[0]; - \n cv[1] = v[1]; - \n gl.uniform2f(location, v[0], v[1]); - \n } - ","vec3<f32>":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) { - \n cv[0] = v[0]; - \n cv[1] = v[1]; - \n cv[2] = v[2]; - \n gl.uniform3f(location, v[0], v[1], v[2]); - \n } - ","vec4<f32>":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) { - \n cv[0] = v[0]; - \n cv[1] = v[1]; - \n cv[2] = v[2]; - \n cv[3] = v[3]; - \n gl.uniform4f(location, v[0], v[1], v[2], v[3]); - \n } - ",i32:"if (cv !== v) { - \n cu.value = v; - \n gl.uniform1i(location, v); - \n } - ","vec2<i32>":"if (cv[0] !== v[0] || cv[1] !== v[1]) { - \n cv[0] = v[0]; - \n cv[1] = v[1]; - \n gl.uniform2i(location, v[0], v[1]); - \n } - ","vec3<i32>":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) { - \n cv[0] = v[0]; - \n cv[1] = v[1]; - \n cv[2] = v[2]; - \n gl.uniform3i(location, v[0], v[1], v[2]); - \n } - ","vec4<i32>":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) { - \n cv[0] = v[0]; - \n cv[1] = v[1]; - \n cv[2] = v[2]; - \n cv[3] = v[3]; - \n gl.uniform4i(location, v[0], v[1], v[2], v[3]); - \n } - ",u32:"if (cv !== v) { - \n cu.value = v; - \n gl.uniform1ui(location, v); - \n } - ","vec2<u32>":"if (cv[0] !== v[0] || cv[1] !== v[1]) { - \n cv[0] = v[0]; - \n cv[1] = v[1]; - \n gl.uniform2ui(location, v[0], v[1]); - \n } - ","vec3<u32>":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) { - \n cv[0] = v[0]; - \n cv[1] = v[1]; - \n cv[2] = v[2]; - \n gl.uniform3ui(location, v[0], v[1], v[2]); - \n } - ","vec4<u32>":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) { - \n cv[0] = v[0]; - \n cv[1] = v[1]; - \n cv[2] = v[2]; - \n cv[3] = v[3]; - \n gl.uniform4ui(location, v[0], v[1], v[2], v[3]); - \n } - ",bool:"if (cv !== v) { - \n cu.value = v; - \n gl.uniform1i(location, v); - \n } - ","vec2<bool>":"if (cv[0] !== v[0] || cv[1] !== v[1]) { - \n cv[0] = v[0]; - \n cv[1] = v[1]; - \n gl.uniform2i(location, v[0], v[1]); - \n } - ","vec3<bool>":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) { - \n cv[0] = v[0]; - \n cv[1] = v[1]; - \n cv[2] = v[2]; - \n gl.uniform3i(location, v[0], v[1], v[2]); - \n } - ","vec4<bool>":"if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) { - \n cv[0] = v[0]; - \n cv[1] = v[1]; - \n cv[2] = v[2]; - \n cv[3] = v[3]; - \n gl.uniform4i(location, v[0], v[1], v[2], v[3]); - \n } - ","mat2x2<f32>":"gl.uniformMatrix2fv(location, false, v); - ","mat3x3<f32>":"gl.uniformMatrix3fv(location, false, v); - ","mat4x4<f32>":"gl.uniformMatrix4fv(location, false, v); - "} - ,GM={ - f32:"gl.uniform1fv(location, v); - ","vec2<f32>":"gl.uniform2fv(location, v); - ","vec3<f32>":"gl.uniform3fv(location, v); - ","vec4<f32>":"gl.uniform4fv(location, v); - ","mat2x2<f32>":"gl.uniformMatrix2fv(location, false, v); - ","mat3x3<f32>":"gl.uniformMatrix3fv(location, false, v); - ","mat4x4<f32>":"gl.uniformMatrix4fv(location, false, v); - ",i32:"gl.uniform1iv(location, v); - ","vec2<i32>":"gl.uniform2iv(location, v); - ","vec3<i32>":"gl.uniform3iv(location, v); - ","vec4<i32>":"gl.uniform4iv(location, v); - ",u32:"gl.uniform1iv(location, v); - ","vec2<u32>":"gl.uniform2iv(location, v); - ","vec3<u32>":"gl.uniform3iv(location, v); - ","vec4<u32>":"gl.uniform4iv(location, v); - ",bool:"gl.uniform1iv(location, v); - ","vec2<bool>":"gl.uniform2iv(location, v); - ","vec3<bool>":"gl.uniform3iv(location, v); - ","vec4<bool>":"gl.uniform4iv(location, v); - "} - ; - function BM(t,i){ - const s=["\n var v = null; - \n var cv = null; - \n var cu = null; - \n var t = 0; - \n var gl = renderer.gl; - \n var name = null; - \n "]; - for(const e in t.uniforms){ - if(!i[e]){ - t.uniforms[e]instanceof hr?t.uniforms[e].ubo?s.push(`\n renderer.shader.bindUniformBlock(uv.${ - e} - , "${ - e} - "); - \n `):s.push(`\n renderer.shader.updateUniformGroup(uv.${ - e} - ); - \n `):t.uniforms[e]instanceof wM&&s.push(`\n renderer.shader.bindBufferResource(uv.${ - e} - , "${ - e} - "); - \n `); - continue} - const n=t.uniformStructures[e]; - let h=!1; - for(let t=0; - t<iM.length; - t++){ - const i=iM[t]; - if(n.type===i.type&&i.test(n)){ - s.push(`name = "${ - e} - "; - `,iM[t].uniform),h=!0; - break} - } - if(!h){ - const t=(1===n.size?DM:GM)[n.type].replace("location",`ud["${ - e} - "].location`); - s.push(`\n cu = ud["${ - e} - "]; - \n cv = cu.value; - \n v = uv["${ - e} - "]; - \n ${ - t} - ; - `)} - } - return new Function("ud","uv","renderer","syncData",s.join("\n"))} - Qt(BM,"generateUniformsSync"); - const UM=class{ - constructor(t){ - this._cache={ - } - ,this._uniformGroupSyncHash={ - } - ,this._renderer=t,this.gl=null,this._cache={ - } - } - contextChange(t){ - this.gl=t} - updateUniformGroup(t,i,s){ - const e=this._renderer.shader._getProgramData(i); - t.isStatic&&t._dirtyId===e.uniformDirtyGroups[t.uid]||(e.uniformDirtyGroups[t.uid]=t._dirtyId,this._getUniformSyncFunction(t,i)(e.uniformData,t.uniforms,this._renderer,s))} - _getUniformSyncFunction(t,i){ - var s; - return(null==(s=this._uniformGroupSyncHash[t._signature])?void 0:s[i._key])||this._createUniformSyncFunction(t,i)} - _createUniformSyncFunction(t,i){ - const s=this._uniformGroupSyncHash[t._signature]||(this._uniformGroupSyncHash[t._signature]={ - } - ),e=this._getSignature(t,i._uniformData,"u"); - return this._cache[e]||(this._cache[e]=this._generateUniformsSync(t,i._uniformData)),s[i._key]=this._cache[e],s[i._key]} - _generateUniformsSync(t,i){ - return BM(t,i)} - _getSignature(t,i,s){ - const e=t.uniforms,n=[`${ - s} - -`]; - for(const h in e)n.push(h),i[h]&&n.push(i[h].type); - return n.join("-")} - destroy(){ - this._renderer=null,this._cache=null} - } - ; - Qt(UM,"GlUniformGroupSystem"); - let FM=UM; - function $M(t){ - const i={ - } - ; - if(i.normal=[t.ONE,t.ONE_MINUS_SRC_ALPHA],i.add=[t.ONE,t.ONE],i.multiply=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],i.screen=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],i.none=[0,0],i["normal-npm"]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],i["add-npm"]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],i["screen-npm"]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],i.erase=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],t instanceof ln.get().getWebGLRenderingContext()){ - const s=t.getExtension("EXT_blend_minmax"); - s&&(i.min=[t.ONE,t.ONE,t.ONE,t.ONE,s.MIN_EXT,s.MIN_EXT],i.max=[t.ONE,t.ONE,t.ONE,t.ONE,s.MAX_EXT,s.MAX_EXT])} - else i.min=[t.ONE,t.ONE,t.ONE,t.ONE,t.MIN,t.MIN],i.max=[t.ONE,t.ONE,t.ONE,t.ONE,t.MAX,t.MAX]; - return i} - FM.extension={ - type:[ri.WebGLSystem],name:"uniformGroup"} - ,Qt($M,"mapWebGLBlendModesToPixi"); - const HM=(Qt(j=class{ - constructor(t){ - this._invertFrontFace=!1,this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=!1,this.map=[],this.map[0]=this.setBlend,this.map[1]=this.setOffset,this.map[2]=this.setCullFace,this.map[3]=this.setDepthTest,this.map[4]=this.setFrontFace,this.map[5]=this.setDepthMask,this.checks=[],this.defaultState=fr.for2d(),t.renderTarget.onRenderTargetChange.add(this)} - onRenderTargetChange(t){ - this._invertFrontFace=!t.isRoot,this._cullFace?this.setFrontFace(this._frontFace):this._frontFaceDirty=!0} - contextChange(t){ - this.gl=t,this.blendModesMap=$M(t),this.resetState()} - set(t){ - if(t||(t=this.defaultState),this.stateId!==t.data){ - let i=this.stateId^t.data,s=0; - for(; - i; - )1&i&&this.map[s].call(this,!!(t.data&1<<s)),i>>=1,s++; - this.stateId=t.data} - for(let i=0; - i<this.checks.length; - i++)this.checks[i](this,t)} - forceState(t){ - t||(t=this.defaultState); - for(let i=0; - i<this.map.length; - i++)this.map[i].call(this,!!(t.data&1<<i)); - for(let i=0; - i<this.checks.length; - i++)this.checks[i](this,t); - this.stateId=t.data} - setBlend(t){ - this._updateCheck(j._checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)} - setOffset(t){ - this._updateCheck(j._checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)} - setDepthTest(t){ - this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)} - setDepthMask(t){ - this.gl.depthMask(t)} - setCullFace(t){ - this._cullFace=t,this.gl[t?"enable":"disable"](this.gl.CULL_FACE),this._cullFace&&this._frontFaceDirty&&this.setFrontFace(this._frontFace)} - setFrontFace(t){ - this._frontFace=t,this._frontFaceDirty=!1; - const i=this._invertFrontFace?!t:t; - this._glFrontFace!==i&&(this._glFrontFace=i,this.gl.frontFace(this.gl[i?"CW":"CCW"]))} - setBlendMode(t){ - if(this.blendModesMap[t]||(t="normal"),t===this.blendMode)return; - this.blendMode=t; - const i=this.blendModesMap[t],s=this.gl; - 2===i.length?s.blendFunc(i[0],i[1]):s.blendFuncSeparate(i[0],i[1],i[2],i[3]),6===i.length?(this._blendEq=!0,s.blendEquationSeparate(i[4],i[5])):this._blendEq&&(this._blendEq=!1,s.blendEquationSeparate(s.FUNC_ADD,s.FUNC_ADD))} - setPolygonOffset(t,i){ - this.gl.polygonOffset(t,i)} - resetState(){ - this._glFrontFace=!1,this._frontFace=!1,this._cullFace=!1,this._frontFaceDirty=!1,this._invertFrontFace=!1,this.gl.frontFace(this.gl.CCW),this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode="",this.setBlendMode("normal")} - _updateCheck(t,i){ - const s=this.checks.indexOf(t); - i&&-1===s?this.checks.push(t):i||-1===s||this.checks.splice(s,1)} - static _checkBlendMode(t,i){ - t.setBlendMode(i.blendMode)} - static _checkPolygonOffset(t,i){ - t.setPolygonOffset(1,i.polygonOffset)} - destroy(){ - this.gl=null,this.checks.length=0} - } - ,"_GlStateSystem"),j); - HM.extension={ - type:[ri.WebGLSystem],name:"state"} - ; - let WM=HM; - const VM=class{ - constructor(t){ - this.target=O_.TEXTURE_2D,this._layerInitMask=0,this.texture=t,this.width=-1,this.height=-1,this.type=I_.UNSIGNED_BYTE,this.internalFormat=C_.RGBA,this.format=C_.RGBA,this.samplerType=0} - destroy(){ - } - } - ; - Qt(VM,"GlTexture"); - let jM=VM; - const KM={ - id:"buffer",upload(t,i,s,e,n,h=!1){ - const r=n||i.target; - h||i.width!==t.width||i.height!==t.height?s.texImage2D(r,0,i.internalFormat,t.width,t.height,0,i.format,i.type,t.resource):s.texSubImage2D(r,0,0,0,t.width,t.height,i.format,i.type,t.resource),i.width=t.width,i.height=t.height} - } - ,zM={ - "bc1-rgba-unorm":!0,"bc1-rgba-unorm-srgb":!0,"bc2-rgba-unorm":!0,"bc2-rgba-unorm-srgb":!0,"bc3-rgba-unorm":!0,"bc3-rgba-unorm-srgb":!0,"bc4-r-unorm":!0,"bc4-r-snorm":!0,"bc5-rg-unorm":!0,"bc5-rg-snorm":!0,"bc6h-rgb-ufloat":!0,"bc6h-rgb-float":!0,"bc7-rgba-unorm":!0,"bc7-rgba-unorm-srgb":!0,"etc2-rgb8unorm":!0,"etc2-rgb8unorm-srgb":!0,"etc2-rgb8a1unorm":!0,"etc2-rgb8a1unorm-srgb":!0,"etc2-rgba8unorm":!0,"etc2-rgba8unorm-srgb":!0,"eac-r11unorm":!0,"eac-r11snorm":!0,"eac-rg11unorm":!0,"eac-rg11snorm":!0,"astc-4x4-unorm":!0,"astc-4x4-unorm-srgb":!0,"astc-5x4-unorm":!0,"astc-5x4-unorm-srgb":!0,"astc-5x5-unorm":!0,"astc-5x5-unorm-srgb":!0,"astc-6x5-unorm":!0,"astc-6x5-unorm-srgb":!0,"astc-6x6-unorm":!0,"astc-6x6-unorm-srgb":!0,"astc-8x5-unorm":!0,"astc-8x5-unorm-srgb":!0,"astc-8x6-unorm":!0,"astc-8x6-unorm-srgb":!0,"astc-8x8-unorm":!0,"astc-8x8-unorm-srgb":!0,"astc-10x5-unorm":!0,"astc-10x5-unorm-srgb":!0,"astc-10x6-unorm":!0,"astc-10x6-unorm-srgb":!0,"astc-10x8-unorm":!0,"astc-10x8-unorm-srgb":!0,"astc-10x10-unorm":!0,"astc-10x10-unorm-srgb":!0,"astc-12x10-unorm":!0,"astc-12x10-unorm-srgb":!0,"astc-12x12-unorm":!0,"astc-12x12-unorm-srgb":!0} - ,YM={ - id:"compressed",upload(t,i,s,e,n,h){ - const r=n??i.target; - s.pixelStorei(s.UNPACK_ALIGNMENT,4); - let o=t.pixelWidth,a=t.pixelHeight; - const c=!!zM[t.format]; - for(let l=0; - l<t.resource.length; - l++){ - const e=t.resource[l]; - c?s.compressedTexImage2D(r,l,i.internalFormat,o,a,0,e):s.texImage2D(r,l,i.internalFormat,o,a,0,i.format,i.type,e),o=Math.max(o>>1,1),a=Math.max(a>>1,1)} - } - } - ,qM=["right","left","top","bottom","front","back"]; - function XM(t){ - return{ - id:"cube",upload(i,s,e,n){ - const h=i.faces; - for(let r=0; - r<qM.length; - r++){ - const i=h[qM[r]]; - (t[i.uploadMethodId]||t.image).upload(i,s,e,n,O_.TEXTURE_CUBE_MAP_POSITIVE_X+r,!(s._layerInitMask&1<<r)),s._layerInitMask|=1<<r} - s.width=i.pixelWidth,s.height=i.pixelHeight} - } - } - Qt(XM,"createGlUploadCubeTextureResource"); - const JM={ - id:"image",upload(t,i,s,e,n,h=!1){ - const r=n||i.target,o=t.pixelWidth,a=t.pixelHeight,c=t.resourceWidth,l=t.resourceHeight,u=2===e,d=h||i.width!==o||i.height!==a,f=c>=o&&l>=a; - (u?QM:ZM)(s,r,i,o,a,c,l,t.resource,d,f),i.width=o,i.height=a} - } - ; - function QM(t,i,s,e,n,h,r,o,a,c){ - if(!c)return a&&t.texImage2D(i,0,s.internalFormat,e,n,0,s.format,s.type,null),void t.texSubImage2D(i,0,0,0,h,r,s.format,s.type,o); - a?t.texImage2D(i,0,s.internalFormat,e,n,0,s.format,s.type,o):t.texSubImage2D(i,0,0,0,s.format,s.type,o)} - function ZM(t,i,s,e,n,h,r,o,a,c){ - if(!c)return a&&t.texImage2D(i,0,s.internalFormat,e,n,0,s.format,s.type,null),void t.texSubImage2D(i,0,0,0,s.format,s.type,o); - a?t.texImage2D(i,0,s.internalFormat,s.format,s.type,o):t.texSubImage2D(i,0,0,0,s.format,s.type,o)} - Qt(QM,"uploadImageWebGL2"),Qt(ZM,"uploadImageWebGL1"); - const tb=jg(),ib={ - id:"video",upload(t,i,s,e,n,h=tb){ - if(!t.isValid){ - const t=n??i.target; - return void s.texImage2D(t,0,i.internalFormat,1,1,0,i.format,i.type,null)} - JM.upload(t,i,s,e,n,h)} - } - ,sb={ - linear:9729,nearest:9728} - ,eb={ - linear:{ - linear:9987,nearest:9985} - ,nearest:{ - linear:9986,nearest:9984} - } - ,nb={ - "clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648} - ,hb={ - never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519} - ; - function rb(t,i,s,e,n,h,r,o){ - const a=h; - if(!o||"repeat"!==t.addressModeU||"repeat"!==t.addressModeV||"repeat"!==t.addressModeW){ - const s=nb[r?"clamp-to-edge":t.addressModeU],e=nb[r?"clamp-to-edge":t.addressModeV],h=nb[r?"clamp-to-edge":t.addressModeW]; - i[n](a,i.TEXTURE_WRAP_S,s),i[n](a,i.TEXTURE_WRAP_T,e),i.TEXTURE_WRAP_R&&i[n](a,i.TEXTURE_WRAP_R,h)} - if(o&&"linear"===t.magFilter||i[n](a,i.TEXTURE_MAG_FILTER,sb[t.magFilter]),s){ - if(!o||"linear"!==t.mipmapFilter){ - const s=eb[t.minFilter][t.mipmapFilter]; - i[n](a,i.TEXTURE_MIN_FILTER,s)} - } - else i[n](a,i.TEXTURE_MIN_FILTER,sb[t.minFilter]); - if(e&&t.maxAnisotropy>1){ - const s=Math.min(t.maxAnisotropy,i.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT)); - i[n](a,e.TEXTURE_MAX_ANISOTROPY_EXT,s)} - t.compare&&i[n](a,i.TEXTURE_COMPARE_FUNC,hb[t.compare])} - function ob(t){ - return{ - r8unorm:t.RED,r8snorm:t.RED,r8uint:t.RED,r8sint:t.RED,r16uint:t.RED,r16sint:t.RED,r16float:t.RED,rg8unorm:t.RG,rg8snorm:t.RG,rg8uint:t.RG,rg8sint:t.RG,r32uint:t.RED,r32sint:t.RED,r32float:t.RED,rg16uint:t.RG,rg16sint:t.RG,rg16float:t.RG,rgba8unorm:t.RGBA,"rgba8unorm-srgb":t.RGBA,rgba8snorm:t.RGBA,rgba8uint:t.RGBA,rgba8sint:t.RGBA,bgra8unorm:t.RGBA,"bgra8unorm-srgb":t.RGBA,rgb9e5ufloat:t.RGB,rgb10a2unorm:t.RGBA,rg11b10ufloat:t.RGB,rg32uint:t.RG,rg32sint:t.RG,rg32float:t.RG,rgba16uint:t.RGBA,rgba16sint:t.RGBA,rgba16float:t.RGBA,rgba32uint:t.RGBA,rgba32sint:t.RGBA,rgba32float:t.RGBA,stencil8:t.STENCIL_INDEX8,depth16unorm:t.DEPTH_COMPONENT,depth24plus:t.DEPTH_COMPONENT,"depth24plus-stencil8":t.DEPTH_STENCIL,depth32float:t.DEPTH_COMPONENT,"depth32float-stencil8":t.DEPTH_STENCIL} - } - function ab(t,i){ - let s={ - } - ,e=t.RGBA; - return t instanceof ln.get().getWebGLRenderingContext()?i.srgb&&(s={ - "rgba8unorm-srgb":i.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":i.srgb.SRGB8_ALPHA8_EXT} - ):(s={ - "rgba8unorm-srgb":t.SRGB8_ALPHA8,"bgra8unorm-srgb":t.SRGB8_ALPHA8} - ,e=t.RGBA8),{ - r8unorm:t.R8,r8snorm:t.R8_SNORM,r8uint:t.R8UI,r8sint:t.R8I,r16uint:t.R16UI,r16sint:t.R16I,r16float:t.R16F,rg8unorm:t.RG8,rg8snorm:t.RG8_SNORM,rg8uint:t.RG8UI,rg8sint:t.RG8I,r32uint:t.R32UI,r32sint:t.R32I,r32float:t.R32F,rg16uint:t.RG16UI,rg16sint:t.RG16I,rg16float:t.RG16F,rgba8unorm:t.RGBA,...s,rgba8snorm:t.RGBA8_SNORM,rgba8uint:t.RGBA8UI,rgba8sint:t.RGBA8I,bgra8unorm:e,rgb9e5ufloat:t.RGB9_E5,rgb10a2unorm:t.RGB10_A2,rg11b10ufloat:t.R11F_G11F_B10F,rg32uint:t.RG32UI,rg32sint:t.RG32I,rg32float:t.RG32F,rgba16uint:t.RGBA16UI,rgba16sint:t.RGBA16I,rgba16float:t.RGBA16F,rgba32uint:t.RGBA32UI,rgba32sint:t.RGBA32I,rgba32float:t.RGBA32F,stencil8:t.STENCIL_INDEX8,depth16unorm:t.DEPTH_COMPONENT16,depth24plus:t.DEPTH_COMPONENT24,"depth24plus-stencil8":t.DEPTH24_STENCIL8,depth32float:t.DEPTH_COMPONENT32F,"depth32float-stencil8":t.DEPTH32F_STENCIL8,...i.s3tc?{ - "bc1-rgba-unorm":i.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":i.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":i.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT} - :{ - } - ,...i.s3tc_sRGB?{ - "bc1-rgba-unorm-srgb":i.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":i.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":i.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT} - :{ - } - ,...i.rgtc?{ - "bc4-r-unorm":i.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":i.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":i.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":i.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT} - :{ - } - ,...i.bptc?{ - "bc6h-rgb-float":i.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":i.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":i.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":i.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT} - :{ - } - ,...i.etc?{ - "etc2-rgb8unorm":i.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":i.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":i.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":i.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":i.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":i.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":i.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":i.etc.COMPRESSED_SIGNED_RG11_EAC} - :{ - } - ,...i.astc?{ - "astc-4x4-unorm":i.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":i.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":i.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":i.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":i.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":i.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":i.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":i.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":i.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":i.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":i.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":i.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":i.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":i.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":i.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":i.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":i.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":i.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":i.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":i.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":i.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":i.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":i.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":i.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":i.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":i.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":i.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":i.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR} - :{ - } - } - } - function cb(t){ - return{ - r8unorm:t.UNSIGNED_BYTE,r8snorm:t.BYTE,r8uint:t.UNSIGNED_BYTE,r8sint:t.BYTE,r16uint:t.UNSIGNED_SHORT,r16sint:t.SHORT,r16float:t.HALF_FLOAT,rg8unorm:t.UNSIGNED_BYTE,rg8snorm:t.BYTE,rg8uint:t.UNSIGNED_BYTE,rg8sint:t.BYTE,r32uint:t.UNSIGNED_INT,r32sint:t.INT,r32float:t.FLOAT,rg16uint:t.UNSIGNED_SHORT,rg16sint:t.SHORT,rg16float:t.HALF_FLOAT,rgba8unorm:t.UNSIGNED_BYTE,"rgba8unorm-srgb":t.UNSIGNED_BYTE,rgba8snorm:t.BYTE,rgba8uint:t.UNSIGNED_BYTE,rgba8sint:t.BYTE,bgra8unorm:t.UNSIGNED_BYTE,"bgra8unorm-srgb":t.UNSIGNED_BYTE,rgb9e5ufloat:t.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:t.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:t.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:t.UNSIGNED_INT,rg32sint:t.INT,rg32float:t.FLOAT,rgba16uint:t.UNSIGNED_SHORT,rgba16sint:t.SHORT,rgba16float:t.HALF_FLOAT,rgba32uint:t.UNSIGNED_INT,rgba32sint:t.INT,rgba32float:t.FLOAT,stencil8:t.UNSIGNED_BYTE,depth16unorm:t.UNSIGNED_SHORT,depth24plus:t.UNSIGNED_INT,"depth24plus-stencil8":t.UNSIGNED_INT_24_8,depth32float:t.FLOAT,"depth32float-stencil8":t.FLOAT_32_UNSIGNED_INT_24_8_REV} - } - function lb(t){ - return{ - "2d":t.TEXTURE_2D,cube:t.TEXTURE_CUBE_MAP,"1d":null,"3d":(null==t?void 0:t.TEXTURE_3D)||null,"2d-array":(null==t?void 0:t.TEXTURE_2D_ARRAY)||null,"cube-array":(null==t?void 0:t.TEXTURE_CUBE_MAP_ARRAY)||null} - } - Qt(rb,"applyStyleParams"),Qt(ob,"mapFormatToGlFormat"),Qt(ab,"mapFormatToGlInternalFormat"),Qt(cb,"mapFormatToGlType"),Qt(lb,"mapViewDimensionToGlTarget"); - const ub=class{ - constructor(t){ - this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._premultiplyAlpha=!1,this._useSeparateSamplers=!1,this._renderer=t,this._managedTextures=new Yc({ - renderer:t,type:"resource",onUnload:this.onSourceUnload.bind(this),name:"glTexture"} - ); - const i={ - image:JM,buffer:KM,video:ib,compressed:YM} - ; - this._uploads={ - ...i,cube:XM(i)} - } - get managedTextures(){ - return Object.values(this._managedTextures.items)} - contextChange(t){ - this._gl=t,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=ab(t,this._renderer.context.extensions),this._mapFormatToType=cb(t),this._mapFormatToFormat=ob(t),this._mapViewDimensionToGlTarget=lb(t)),this._managedTextures.removeAll(!0),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null),this._premultiplyAlpha=!1; - for(let i=0; - i<16; - i++)this.bind(ls.EMPTY,i)} - initSource(t){ - this.bind(t)} - bind(t,i=0){ - const s=t.source; - t?(this.bindSource(s,i),this._useSeparateSamplers&&this._bindSampler(s.style,i)):(this.bindSource(null,i),this._useSeparateSamplers&&this._bindSampler(null,i))} - bindSource(t,i=0){ - const s=this._gl; - if(t._gcLastUsed=this._renderer.gc.now,this._boundTextures[i]!==t){ - this._boundTextures[i]=t,this._activateLocation(i),t||(t=ls.EMPTY.source); - const e=this.getGlSource(t); - s.bindTexture(e.target,e.texture)} - } - _bindSampler(t,i=0){ - const s=this._gl; - if(!t)return this._boundSamplers[i]=null,void s.bindSampler(i,null); - const e=this._getGlSampler(t); - this._boundSamplers[i]!==e&&(this._boundSamplers[i]=e,s.bindSampler(i,e))} - unbind(t){ - const i=t.source,s=this._boundTextures,e=this._gl; - for(let n=0; - n<s.length; - n++)if(s[n]===i){ - this._activateLocation(n); - const t=this.getGlSource(i); - e.bindTexture(t.target,null),s[n]=null} - } - _activateLocation(t){ - this._activeTextureLocation!==t&&(this._activeTextureLocation=t,this._gl.activeTexture(this._gl.TEXTURE0+t))} - _initSource(t){ - const i=this._gl,s=new jM(i.createTexture()); - if(s.type=this._mapFormatToType[t.format],s.internalFormat=this._mapFormatToInternalFormat[t.format],s.format=this._mapFormatToFormat[t.format],s.target=this._mapViewDimensionToGlTarget[t.viewDimension],null===s.target)throw new Error(`Unsupported view dimension: ${ - t.viewDimension} - with this webgl version: ${ - this._renderer.context.webGLVersion} - `); - if("cube"===t.uploadMethodId&&(s.target=i.TEXTURE_CUBE_MAP),t.autoGenerateMipmaps&&(this._renderer.context.supports.nonPowOf2mipmaps||t.isPowerOfTwo)){ - const i=Math.max(t.width,t.height); - t.mipLevelCount=Math.floor(Math.log2(i))+1} - return t._gpuData[this._renderer.uid]=s,this._managedTextures.add(t)&&(t.on("update",this.onSourceUpdate,this),t.on("resize",this.onSourceUpdate,this),t.on("styleChange",this.onStyleChange,this),t.on("updateMipmaps",this.onUpdateMipmaps,this)),this.onSourceUpdate(t),this.updateStyle(t,!1),s} - onStyleChange(t){ - this.updateStyle(t,!1)} - updateStyle(t,i){ - const s=this._gl,e=this.getGlSource(t); - s.bindTexture(e.target,e.texture),this._boundTextures[this._activeTextureLocation]=t,rb(t.style,s,t.mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",e.target,!this._renderer.context.supports.nonPowOf2wrapping&&!t.isPowerOfTwo,i)} - onSourceUnload(t,i=!1){ - const s=t._gpuData[this._renderer.uid]; - s&&(i||(this.unbind(t),this._gl.deleteTexture(s.texture)),t.off("update",this.onSourceUpdate,this),t.off("resize",this.onSourceUpdate,this),t.off("styleChange",this.onStyleChange,this),t.off("updateMipmaps",this.onUpdateMipmaps,this))} - onSourceUpdate(t){ - const i=this._gl,s=this.getGlSource(t); - i.bindTexture(s.target,s.texture),this._boundTextures[this._activeTextureLocation]=t; - const e="premultiply-alpha-on-upload"===t.alphaMode; - if(this._premultiplyAlpha!==e&&(this._premultiplyAlpha=e,i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e)),this._uploads[t.uploadMethodId])this._uploads[t.uploadMethodId].upload(t,s,i,this._renderer.context.webGLVersion); - else if(s.target===i.TEXTURE_2D)this._initEmptyTexture2D(s,t); - else if(s.target===i.TEXTURE_2D_ARRAY)this._initEmptyTexture2DArray(s,t); - else{ - if(s.target!==i.TEXTURE_CUBE_MAP)throw new Error("[GlTextureSystem] Unsupported texture target for empty allocation."); - this._initEmptyTextureCube(s,t)} - this._applyMipRange(s,t),t.autoGenerateMipmaps&&t.mipLevelCount>1&&this.onUpdateMipmaps(t,!1)} - onUpdateMipmaps(t,i=!0){ - i&&this.bindSource(t,0); - const s=this.getGlSource(t); - this._gl.generateMipmap(s.target)} - _initEmptyTexture2D(t,i){ - const s=this._gl; - s.texImage2D(s.TEXTURE_2D,0,t.internalFormat,i.pixelWidth,i.pixelHeight,0,t.format,t.type,null); - let e=Math.max(i.pixelWidth>>1,1),n=Math.max(i.pixelHeight>>1,1); - for(let h=1; - h<i.mipLevelCount; - h++)s.texImage2D(s.TEXTURE_2D,h,t.internalFormat,e,n,0,t.format,t.type,null),e=Math.max(e>>1,1),n=Math.max(n>>1,1)} - _initEmptyTexture2DArray(t,i){ - if(2!==this._renderer.context.webGLVersion)throw new Error("[GlTextureSystem] TEXTURE_2D_ARRAY requires WebGL2."); - const s=this._gl,e=Math.max(0|i.arrayLayerCount,1); - s.texImage3D(s.TEXTURE_2D_ARRAY,0,t.internalFormat,i.pixelWidth,i.pixelHeight,e,0,t.format,t.type,null); - let n=Math.max(i.pixelWidth>>1,1),h=Math.max(i.pixelHeight>>1,1); - for(let r=1; - r<i.mipLevelCount; - r++)s.texImage3D(s.TEXTURE_2D_ARRAY,r,t.internalFormat,n,h,e,0,t.format,t.type,null),n=Math.max(n>>1,1),h=Math.max(h>>1,1)} - _initEmptyTextureCube(t,i){ - const s=this._gl; - for(let h=0; - h<6; - h++)s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,t.internalFormat,i.pixelWidth,i.pixelHeight,0,t.format,t.type,null); - let e=Math.max(i.pixelWidth>>1,1),n=Math.max(i.pixelHeight>>1,1); - for(let h=1; - h<i.mipLevelCount; - h++){ - for(let i=0; - i<6; - i++)s.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+i,h,t.internalFormat,e,n,0,t.format,t.type,null); - e=Math.max(e>>1,1),n=Math.max(n>>1,1)} - } - _applyMipRange(t,i){ - if(2!==this._renderer.context.webGLVersion)return; - const s=this._gl,e=Math.max((0|i.mipLevelCount)-1,0); - s.texParameteri(t.target,s.TEXTURE_BASE_LEVEL,0),s.texParameteri(t.target,s.TEXTURE_MAX_LEVEL,e)} - _initSampler(t){ - const i=this._gl,s=this._gl.createSampler(); - return this._glSamplers[t._resourceId]=s,rb(t,i,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",s,!1,!0),this._glSamplers[t._resourceId]} - _getGlSampler(t){ - return this._glSamplers[t._resourceId]||this._initSampler(t)} - getGlSource(t){ - return t._gcLastUsed=this._renderer.gc.now,t._gpuData[this._renderer.uid]||this._initSource(t)} - generateCanvas(t){ - const{ - pixels:i,width:s,height:e} - =this.getPixels(t),n=ln.get().createCanvas(); - n.width=s,n.height=e; - const h=n.getContext("2d"); - if(h){ - const t=h.createImageData(s,e); - t.data.set(i),h.putImageData(t,0,0)} - return n} - getPixels(t){ - const i=t.source.resolution,s=t.frame,e=Math.max(Math.round(s.width*i),1),n=Math.max(Math.round(s.height*i),1),h=new Uint8Array(4*e*n),r=this._renderer,o=r.renderTarget.getRenderTarget(t),a=r.renderTarget.getGpuRenderTarget(o),c=r.gl; - return c.bindFramebuffer(c.FRAMEBUFFER,a.resolveTargetFramebuffer),c.readPixels(Math.round(s.x*i),Math.round(s.y*i),e,n,c.RGBA,c.UNSIGNED_BYTE,h),{ - pixels:new Uint8ClampedArray(h.buffer),width:e,height:n} - } - destroy(){ - this._managedTextures.destroy(),this._glSamplers=null,this._boundTextures=null,this._boundSamplers=null,this._mapFormatToInternalFormat=null,this._mapFormatToType=null,this._mapFormatToFormat=null,this._uploads=null,this._renderer=null} - resetState(){ - this._activeTextureLocation=-1,this._boundTextures.fill(ls.EMPTY.source),this._boundSamplers=Object.create(null); - const t=this._gl; - this._premultiplyAlpha=!1,t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._premultiplyAlpha)} - } - ; - Qt(ub,"GlTextureSystem"); - let db=ub; - db.extension={ - type:[ri.WebGLSystem],name:"texture"} - ; - const fb=class{ - contextChange(t){ - const i=new hr({ - uColor:{ - value:new Float32Array([1,1,1,1]),type:"vec4<f32>"} - ,uTransformMatrix:{ - value:new Ci,type:"mat3x3<f32>"} - ,uRound:{ - value:0,type:"f32"} - } - ),s=t.limits.maxBatchableTextures,e=Oc({ - name:"graphics",bits:[kc,Gc(s),Ip,Uc]} - ); - this.shader=new lr({ - glProgram:e,resources:{ - localUniforms:i,batchSamplers:$c(s)} - } - )} - execute(t,i){ - const s=i.context,e=s.customShader||this.shader,n=t.renderer,h=n.graphicsContext,{ - batcher:r,instructions:o} - =h.getContextRenderData(s); - e.groups[0]=n.globalUniforms.bindGroup,n.state.set(t.state),n.shader.bind(e),n.geometry.bind(r.geometry,e.glProgram); - const a=o.instructions; - for(let c=0; - c<o.instructionSize; - c++){ - const t=a[c]; - if(t.size){ - for(let i=0; - i<t.textures.count; - i++)n.texture.bind(t.textures.textures[i],i); - n.geometry.draw(t.topology,t.size,t.start)} - } - } - destroy(){ - this.shader.destroy(!0),this.shader=null} - } - ; - Qt(fb,"GlGraphicsAdaptor"); - let pb=fb; - pb.extension={ - type:[ri.WebGLPipesAdaptor],name:"graphics"} - ; - const wb=class{ - init(){ - const t=Oc({ - name:"mesh",bits:[Ip,pm,Uc]} - ); - this._shader=new lr({ - glProgram:t,resources:{ - uTexture:ls.EMPTY.source,textureUniforms:{ - uTextureMatrix:{ - type:"mat3x3<f32>",value:new Ci} - } - } - } - )} - execute(t,i){ - const s=t.renderer; - let e=i._shader; - if(e){ - if(!e.glProgram)return void qs(i.shader)} - else{ - e=this._shader; - const t=i.texture,s=t.source; - e.resources.uTexture=s,e.resources.uSampler=s.style,e.resources.textureUniforms.uniforms.uTextureMatrix=t.textureMatrix.mapCoord} - e.groups[100]=s.globalUniforms.bindGroup,e.groups[101]=t.localUniformsBindGroup,s.encoder.draw({ - geometry:i._geometry,shader:e,state:i.state} - )} - destroy(){ - this._shader.destroy(!0),this._shader=null} - } - ; - Qt(wb,"GlMeshAdaptor"); - let gb=wb; - gb.extension={ - type:[ri.WebGLPipesAdaptor],name:"mesh"} - ; - const mb=[...Jv,cM,U_,A_,j_,y_,db,fM,D_,FM,LM,W_,WM,X_,$_],vb=[...Qv],_b=[om,gb,pb],Mb=[],bb=[],yb=[]; - ci.handleByNamedList(ri.WebGLSystem,Mb),ci.handleByNamedList(ri.WebGLPipes,bb),ci.handleByNamedList(ri.WebGLPipesAdaptor,yb),ci.add(...mb,...vb,..._b); - const Eb=class extends oo{ - constructor(){ - super({ - name:"webgl",type:ar.WEBGL,systems:Mb,renderPipes:bb,renderPipeAdaptors:yb} - )} - } - ; - Qt(Eb,"WebGLRenderer"); - let Ab=Eb; - const Sb=Object.freeze(Object.defineProperty({ - __proto__:null,WebGLRenderer:Ab} - ,Symbol.toStringTag,{ - value:"Module"} - )),Tb=class{ - constructor(t){ - this._hash=Object.create(null),this._renderer=t} - contextChange(t){ - this._gpu=t} - getBindGroup(t,i,s){ - return t._updateKey(),this._hash[t._key]||this._createBindGroup(t,i,s)} - _createBindGroup(t,i,s){ - const e=this._gpu.device,n=i.layout[s],h=[],r=this._renderer; - for(const c in n){ - const i=t.resources[c]??t.resources[n[c]]; - let s; - if("uniformGroup"===i._resourceType){ - const t=i; - r.ubo.updateUniformGroup(t); - const e=t.buffer; - s={ - buffer:r.buffer.getGPUBuffer(e),offset:0,size:e.descriptor.size} - } - else if("buffer"===i._resourceType){ - const t=i; - s={ - buffer:r.buffer.getGPUBuffer(t),offset:0,size:t.descriptor.size} - } - else if("bufferResource"===i._resourceType){ - const t=i; - s={ - buffer:r.buffer.getGPUBuffer(t.buffer),offset:t.offset,size:t.size} - } - else if("textureSampler"===i._resourceType){ - const t=i; - s=r.texture.getGpuSampler(t)} - else if("textureSource"===i._resourceType){ - const t=i; - s=r.texture.getTextureView(t)} - h.push({ - binding:n[c],resource:s} - )} - const o=r.shader.getProgramData(i).bindGroups[s],a=e.createBindGroup({ - layout:o,entries:h} - ); - return this._hash[t._key]=a,a} - destroy(){ - this._hash=null,this._renderer=null} - } - ; - Qt(Tb,"BindGroupSystem"); - let Cb=Tb; - Cb.extension={ - type:[ri.WebGPUSystem],name:"bindGroup"} - ; - const Ob=class{ - constructor(t){ - this.gpuBuffer=t} - destroy(){ - this.gpuBuffer.destroy(),this.gpuBuffer=null} - } - ; - Qt(Ob,"GpuBufferData"); - let Ib=Ob; - const kb=class{ - constructor(t){ - this._renderer=t,this._managedBuffers=new Yc({ - renderer:t,type:"resource",onUnload:this.onBufferUnload.bind(this),name:"gpuBuffer"} - )} - contextChange(t){ - this._gpu=t} - getGPUBuffer(t){ - var i; - return t._gcLastUsed=this._renderer.gc.now,(null==(i=t._gpuData[this._renderer.uid])?void 0:i.gpuBuffer)||this.createGPUBuffer(t)} - updateBuffer(t){ - const i=this.getGPUBuffer(t),s=t.data; - return t._updateID&&s&&(t._updateID=0,this._gpu.device.queue.writeBuffer(i,0,s.buffer,0,(t._updateSize||s.byteLength)+3&-4)),i} - destroyAll(){ - this._managedBuffers.removeAll()} - onBufferUnload(t){ - t.off("update",this.updateBuffer,this),t.off("change",this.onBufferChange,this)} - createGPUBuffer(t){ - const i=this._gpu.device.createBuffer(t.descriptor); - return t._updateID=0,t._resourceId=Wi("resource"),t.data&&(Ta(t.data.buffer,i.getMappedRange(),t.data.byteOffset,t.data.byteLength),i.unmap()),t._gpuData[this._renderer.uid]=new Ib(i),this._managedBuffers.add(t)&&(t.on("update",this.updateBuffer,this),t.on("change",this.onBufferChange,this)),i} - onBufferChange(t){ - this._managedBuffers.remove(t),t._updateID=0,this.createGPUBuffer(t)} - destroy(){ - this._managedBuffers.destroy(),this._renderer=null,this._gpu=null} - } - ; - Qt(kb,"GpuBufferSystem"); - let xb=kb; - xb.extension={ - type:[ri.WebGPUSystem],name:"buffer"} - ; - const Rb=class{ - constructor({ - minUniformOffsetAlignment:t} - ){ - this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=t,this.data=new Float32Array(65535)} - clear(){ - this.byteIndex=0} - addEmptyGroup(t){ - if(t>this._minUniformOffsetAlignment/4)throw new Error("UniformBufferBatch: array is too large: "+4*t); - const i=this.byteIndex; - let s=i+4*t; - if(s=Math.ceil(s/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,s>4*this.data.length)throw new Error("UniformBufferBatch: ubo batch got too big"); - return this.byteIndex=s,i} - addGroup(t){ - const i=this.addEmptyGroup(t.length); - for(let s=0; - s<t.length; - s++)this.data[i/4+s]=t[s]; - return i} - destroy(){ - this.data=null} - } - ; - Qt(Rb,"UboBatch"); - let Pb=Rb; - const Nb=class{ - constructor(t){ - this._colorMaskCache=15,this._renderer=t} - setMask(t){ - this._colorMaskCache!==t&&(this._colorMaskCache=t,this._renderer.pipeline.setColorMask(t))} - destroy(){ - this._renderer=null,this._colorMaskCache=null} - } - ; - Qt(Nb,"GpuColorMaskSystem"); - let Lb=Nb; - Lb.extension={ - type:[ri.WebGPUSystem],name:"colorMask"} - ; - const Db=class{ - constructor(t){ - this._renderer=t} - async init(t){ - return this._initPromise||(this._initPromise=(t.gpu?Promise.resolve(t.gpu):this._createDeviceAndAdaptor(t)).then(t=>{ - this.gpu=t,this._renderer.runners.contextChange.emit(this.gpu)} - )),this._initPromise} - contextChange(t){ - this._renderer.gpu=t} - async _createDeviceAndAdaptor(t){ - const i=await ln.get().getNavigator().gpu.requestAdapter({ - powerPreference:t.powerPreference,forceFallbackAdapter:t.forceFallbackAdapter} - ),s=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(t=>i.features.has(t)),e=await i.requestDevice({ - requiredFeatures:s} - ); - return{ - adapter:i,device:e} - } - destroy(){ - this.gpu=null,this._renderer=null} - } - ; - Qt(Db,"GpuDeviceSystem"); - let Gb=Db; - Gb.extension={ - type:[ri.WebGPUSystem],name:"device"} - ,Gb.defaultOptions={ - powerPreference:void 0,forceFallbackAdapter:!1} - ; - const Bb=class{ - constructor(t){ - this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=t} - renderStart(){ - this.commandFinished=new Promise(t=>{ - this._resolveCommandFinished=t} - ),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()} - beginRenderPass(t){ - this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(t.descriptor)} - endRenderPass(){ - this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null} - setViewport(t){ - this.renderPassEncoder.setViewport(t.x,t.y,t.width,t.height,0,1)} - setPipelineFromGeometryProgramAndState(t,i,s,e){ - const n=this._renderer.pipeline.getPipeline(t,i,s,e); - this.setPipeline(n)} - setPipeline(t){ - this._boundPipeline!==t&&(this._boundPipeline=t,this.renderPassEncoder.setPipeline(t))} - _setVertexBuffer(t,i){ - this._boundVertexBuffer[t]!==i&&(this._boundVertexBuffer[t]=i,this.renderPassEncoder.setVertexBuffer(t,this._renderer.buffer.updateBuffer(i)))} - _setIndexBuffer(t){ - if(this._boundIndexBuffer===t)return; - this._boundIndexBuffer=t; - const i=2===t.data.BYTES_PER_ELEMENT?"uint16":"uint32"; - this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(t),i)} - resetBindGroup(t){ - this._boundBindGroup[t]=null} - setBindGroup(t,i,s){ - if(this._boundBindGroup[t]===i)return; - this._boundBindGroup[t]=i,i._touch(this._renderer.gc.now,this._renderer.tick); - const e=this._renderer.bindGroup.getBindGroup(i,s,t); - this.renderPassEncoder.setBindGroup(t,e)} - setGeometry(t,i){ - const s=this._renderer.pipeline.getBufferNamesToBind(t,i); - for(const e in s)this._setVertexBuffer(parseInt(e,10),t.attributes[s[e]].buffer); - t.indexBuffer&&this._setIndexBuffer(t.indexBuffer)} - _setShaderBindGroups(t,i){ - for(const s in t.groups){ - const e=t.groups[s]; - i||this._syncBindGroup(e),this.setBindGroup(s,e,t.gpuProgram)} - } - _syncBindGroup(t){ - for(const i in t.resources){ - const s=t.resources[i]; - s.isUniformGroup&&this._renderer.ubo.updateUniformGroup(s)} - } - draw(t){ - const{ - geometry:i,shader:s,state:e,topology:n,size:h,start:r,instanceCount:o,skipSync:a} - =t; - this.setPipelineFromGeometryProgramAndState(i,s.gpuProgram,e,n),this.setGeometry(i,s.gpuProgram),this._setShaderBindGroups(s,a),i.indexBuffer?this.renderPassEncoder.drawIndexed(h||i.indexBuffer.data.length,o??i.instanceCount,r||0):this.renderPassEncoder.draw(h||i.getSize(),o??i.instanceCount,r||0)} - finishRenderPass(){ - this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null)} - postrender(){ - this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null} - restoreRenderPass(){ - const t=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1],this._renderer.renderTarget.mipLevel,this._renderer.renderTarget.layer); - this.renderPassEncoder=this.commandEncoder.beginRenderPass(t); - const i=this._boundPipeline,s={ - ...this._boundVertexBuffer} - ,e=this._boundIndexBuffer,n={ - ...this._boundBindGroup} - ; - this._clearCache(); - const h=this._renderer.renderTarget.viewport; - this.renderPassEncoder.setViewport(h.x,h.y,h.width,h.height,0,1),this.setPipeline(i); - for(const r in s)this._setVertexBuffer(r,s[r]); - for(const r in n)this.setBindGroup(r,n[r],null); - this._setIndexBuffer(e)} - _clearCache(){ - for(let t=0; - t<16; - t++)this._boundBindGroup[t]=null,this._boundVertexBuffer[t]=null; - this._boundIndexBuffer=null,this._boundPipeline=null} - destroy(){ - this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null} - contextChange(t){ - this._gpu=t} - } - ; - Qt(Bb,"GpuEncoderSystem"); - let Ub=Bb; - Ub.extension={ - type:[ri.WebGPUSystem],name:"encoder",priority:1} - ; - const Fb=class{ - constructor(t){ - this._renderer=t} - contextChange(){ - this.maxTextures=this._renderer.device.gpu.device.limits.maxSampledTexturesPerShaderStage,this.maxBatchableTextures=this.maxTextures} - destroy(){ - } - } - ; - Qt(Fb,"GpuLimitsSystem"); - let $b=Fb; - $b.extension={ - type:[ri.WebGPUSystem],name:"limits"} - ; - const Hb=class{ - constructor(t){ - this._renderTargetStencilState=Object.create(null),this._renderer=t,t.renderTarget.onRenderTargetChange.add(this)} - onRenderTargetChange(t){ - let i=this._renderTargetStencilState[t.uid]; - i||(i=this._renderTargetStencilState[t.uid]={ - stencilMode:Oa.DISABLED,stencilReference:0} - ),this._activeRenderTarget=t,this.setStencilMode(i.stencilMode,i.stencilReference)} - setStencilMode(t,i){ - const s=this._renderTargetStencilState[this._activeRenderTarget.uid]; - s.stencilMode=t,s.stencilReference=i; - const e=this._renderer; - e.pipeline.setStencilMode(t),e.encoder.renderPassEncoder.setStencilReference(i)} - destroy(){ - this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null} - } - ; - Qt(Hb,"GpuStencilSystem"); - let Wb=Hb; - Wb.extension={ - type:[ri.WebGPUSystem],name:"stencil"} - ; - const Vb={ - i32:{ - align:4,size:4} - ,u32:{ - align:4,size:4} - ,f32:{ - align:4,size:4} - ,f16:{ - align:2,size:2} - ,"vec2<i32>":{ - align:8,size:8} - ,"vec2<u32>":{ - align:8,size:8} - ,"vec2<f32>":{ - align:8,size:8} - ,"vec2<f16>":{ - align:4,size:4} - ,"vec3<i32>":{ - align:16,size:12} - ,"vec3<u32>":{ - align:16,size:12} - ,"vec3<f32>":{ - align:16,size:12} - ,"vec3<f16>":{ - align:8,size:6} - ,"vec4<i32>":{ - align:16,size:16} - ,"vec4<u32>":{ - align:16,size:16} - ,"vec4<f32>":{ - align:16,size:16} - ,"vec4<f16>":{ - align:8,size:8} - ,"mat2x2<f32>":{ - align:8,size:16} - ,"mat2x2<f16>":{ - align:4,size:8} - ,"mat3x2<f32>":{ - align:8,size:24} - ,"mat3x2<f16>":{ - align:4,size:12} - ,"mat4x2<f32>":{ - align:8,size:32} - ,"mat4x2<f16>":{ - align:4,size:16} - ,"mat2x3<f32>":{ - align:16,size:32} - ,"mat2x3<f16>":{ - align:8,size:16} - ,"mat3x3<f32>":{ - align:16,size:48} - ,"mat3x3<f16>":{ - align:8,size:24} - ,"mat4x3<f32>":{ - align:16,size:64} - ,"mat4x3<f16>":{ - align:8,size:32} - ,"mat2x4<f32>":{ - align:16,size:32} - ,"mat2x4<f16>":{ - align:8,size:16} - ,"mat3x4<f32>":{ - align:16,size:48} - ,"mat3x4<f16>":{ - align:8,size:24} - ,"mat4x4<f32>":{ - align:16,size:64} - ,"mat4x4<f16>":{ - align:8,size:32} - } - ; - function jb(t){ - const i=t.map(t=>({ - data:t,offset:0,size:0} - )); - let s=0; - for(let e=0; - e<i.length; - e++){ - const t=i[e]; - let n=Vb[t.data.type].size; - const h=Vb[t.data.type].align; - if(!Vb[t.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${ - t.data.type} - `); - t.data.size>1&&(n=Math.max(n,h)*t.data.size),s=Math.ceil(s/h)*h,t.size=n,t.offset=s,s+=n} - return s=16*Math.ceil(s/16),{ - uboElements:i,size:s} - } - function Kb(t,i){ - const{ - size:s,align:e} - =Vb[t.data.type],n=(e-s)/4,h=t.data.type.indexOf("i32")>=0?"dataInt32":"data"; - return`\n v = uv.${ - t.data.name} - ; - \n ${ - 0!==i?`offset += ${ - i} - ; - `:""} - \n\n arrayOffset = offset; - \n\n t = 0; - \n\n for(var i=0; - i < ${ - t.data.size*(s/4)} - ; - i++)\n { - \n for(var j = 0; - j < ${ - s/4} - ; - j++)\n { - \n ${ - h} - [arrayOffset++] = v[t++]; - \n } - \n ${ - 0!==n?`arrayOffset += ${ - n} - ; - `:""} - \n } - \n `} - function zb(t){ - return sM(t,"uboWgsl",Kb,hM)} - Qt(jb,"createUboElementsWGSL"),Qt(Kb,"generateArraySyncWGSL"),Qt(zb,"createUboSyncFunctionWGSL"); - const Yb=class extends Q_{ - constructor(){ - super({ - createUboElements:jb,generateUboSync:zb} - )} - } - ; - Qt(Yb,"GpuUboSystem"); - let qb=Yb; - qb.extension={ - type:[ri.WebGPUSystem],name:"ubo"} - ; - const Xb=128,Jb=class{ - constructor(t){ - this._bindGroupHash=Object.create(null),this._buffers=[],this._bindGroups=[],this._bufferResources=[],this._renderer=t,this._batchBuffer=new Pb({ - minUniformOffsetAlignment:Xb} - ); - for(let i=0; - i<2; - i++){ - let t=Ka.UNIFORM|Ka.COPY_DST; - 0===i&&(t|=Ka.COPY_SRC),this._buffers.push(new za({ - data:this._batchBuffer.data,usage:t} - ))} - } - renderEnd(){ - this._uploadBindGroups(),this._resetBindGroups()} - _resetBindGroups(){ - this._bindGroupHash=Object.create(null),this._batchBuffer.clear()} - getUniformBindGroup(t,i){ - if(!i&&this._bindGroupHash[t.uid])return this._bindGroupHash[t.uid]; - this._renderer.ubo.ensureUniformGroup(t); - const s=t.buffer.data,e=this._batchBuffer.addEmptyGroup(s.length); - return this._renderer.ubo.syncUniformGroup(t,this._batchBuffer.data,e/4),this._bindGroupHash[t.uid]=this._getBindGroup(e/Xb),this._bindGroupHash[t.uid]} - getUboResource(t){ - this._renderer.ubo.updateUniformGroup(t); - const i=t.buffer.data,s=this._batchBuffer.addGroup(i); - return this._getBufferResource(s/Xb)} - getArrayBindGroup(t){ - const i=this._batchBuffer.addGroup(t); - return this._getBindGroup(i/Xb)} - getArrayBufferResource(t){ - const i=this._batchBuffer.addGroup(t)/Xb; - return this._getBufferResource(i)} - _getBufferResource(t){ - if(!this._bufferResources[t]){ - const i=this._buffers[t%2]; - this._bufferResources[t]=new wM({ - buffer:i,offset:256*(t/2|0),size:Xb} - )} - return this._bufferResources[t]} - _getBindGroup(t){ - if(!this._bindGroups[t]){ - const i=new or({ - 0:this._getBufferResource(t)} - ); - this._bindGroups[t]=i} - return this._bindGroups[t]} - _uploadBindGroups(){ - const t=this._renderer.buffer,i=this._buffers[0]; - i.update(this._batchBuffer.byteIndex),t.updateBuffer(i); - const s=this._renderer.gpu.device.createCommandEncoder(); - for(let e=1; - e<this._buffers.length; - e++){ - const n=this._buffers[e]; - s.copyBufferToBuffer(t.getGPUBuffer(i),Xb,t.getGPUBuffer(n),0,this._batchBuffer.byteIndex)} - this._renderer.gpu.device.queue.submit([s.finish()])} - destroy(){ - var t; - for(let i=0; - i<this._bindGroups.length; - i++)null==(t=this._bindGroups[i])||t.destroy(); - this._bindGroups=null,this._bindGroupHash=null; - for(let i=0; - i<this._buffers.length; - i++)this._buffers[i].destroy(); - this._buffers=null; - for(let i=0; - i<this._bufferResources.length; - i++)this._bufferResources[i].destroy(); - this._bufferResources=null,this._batchBuffer.destroy(),this._renderer=null} - } - ; - Qt(Jb,"GpuUniformBatchPipe"); - let Qb=Jb; - Qb.extension={ - type:[ri.WebGPUPipes],name:"uniformBatch"} - ; - const Zb={ - "point-list":0,"line-list":1,"line-strip":2,"triangle-list":3,"triangle-strip":4} - ; - function ty(t,i,s,e,n){ - return t<<24|i<<16|s<<10|e<<5|n} - function iy(t,i,s,e,n){ - return s<<8|t<<5|e<<3|n<<1|i} - Qt(ty,"getGraphicsStateKey"),Qt(iy,"getGlobalStateKey"); - const sy=class{ - constructor(t){ - this._moduleCache=Object.create(null),this._bufferLayoutsCache=Object.create(null),this._bindingNamesCache=Object.create(null),this._pipeCache=Object.create(null),this._pipeStateCaches=Object.create(null),this._colorMask=15,this._multisampleCount=1,this._colorTargetCount=1,this._renderer=t} - contextChange(t){ - this._gpu=t,this.setStencilMode(Oa.DISABLED),this._updatePipeHash()} - setMultisampleCount(t){ - this._multisampleCount!==t&&(this._multisampleCount=t,this._updatePipeHash())} - setRenderTarget(t){ - this._multisampleCount=t.msaaSamples,this._depthStencilAttachment=t.descriptor.depthStencilAttachment?1:0,this._colorTargetCount=t.colorTargetCount,this._updatePipeHash()} - setColorMask(t){ - this._colorMask!==t&&(this._colorMask=t,this._updatePipeHash())} - setStencilMode(t){ - this._stencilMode!==t&&(this._stencilMode=t,this._stencilState=Y_[t],this._updatePipeHash())} - setPipeline(t,i,s,e){ - const n=this.getPipeline(t,i,s); - e.setPipeline(n)} - getPipeline(t,i,s,e){ - t._layoutKey||(S_(t,i.attributeData),this._generateBufferKey(t)),e||(e=t.topology); - const n=ty(t._layoutKey,i._layoutKey,s.data,s._blendModeId,Zb[e]); - return this._pipeCache[n]||(this._pipeCache[n]=this._createPipeline(t,i,s,e)),this._pipeCache[n]} - _createPipeline(t,i,s,e){ - const n=this._gpu.device,h=this._createVertexBufferLayouts(t,i),r=this._renderer.state.getColorTargets(s,this._colorTargetCount),o=this._stencilMode===Oa.RENDERING_MASK_ADD?0:this._colorMask; - for(let l=0; - l<r.length; - l++)r[l].writeMask=o; - const a=this._renderer.shader.getProgramData(i).pipeline,c={ - vertex:{ - module:this._getModule(i.vertex.source),entryPoint:i.vertex.entryPoint,buffers:h} - ,fragment:{ - module:this._getModule(i.fragment.source),entryPoint:i.fragment.entryPoint,targets:r} - ,primitive:{ - topology:e,cullMode:s.cullMode} - ,layout:a,multisample:{ - count:this._multisampleCount} - ,label:"PIXI Pipeline"} - ; - return this._depthStencilAttachment&&(c.depthStencil={ - ...this._stencilState,format:"depth24plus-stencil8",depthWriteEnabled:s.depthTest,depthCompare:s.depthTest?"less":"always"} - ),n.createRenderPipeline(c)} - _getModule(t){ - return this._moduleCache[t]||this._createModule(t)} - _createModule(t){ - const i=this._gpu.device; - return this._moduleCache[t]=i.createShaderModule({ - code:t} - ),this._moduleCache[t]} - _generateBufferKey(t){ - const i=[]; - let s=0; - const e=Object.keys(t.attributes).sort(); - for(let h=0; - h<e.length; - h++){ - const n=t.attributes[e[h]]; - i[s++]=n.offset,i[s++]=n.format,i[s++]=n.stride,i[s++]=n.instance} - const n=i.join("|"); - return t._layoutKey=Ah(n,"geometry"),t._layoutKey} - _generateAttributeLocationsKey(t){ - const i=[]; - let s=0; - const e=Object.keys(t.attributeData).sort(); - for(let h=0; - h<e.length; - h++){ - const n=t.attributeData[e[h]]; - i[s++]=n.location} - const n=i.join("|"); - return t._attributeLocationsKey=Ah(n,"programAttributes"),t._attributeLocationsKey} - getBufferNamesToBind(t,i){ - const s=t._layoutKey<<16|i._attributeLocationsKey; - if(this._bindingNamesCache[s])return this._bindingNamesCache[s]; - const e=this._createVertexBufferLayouts(t,i),n=Object.create(null),h=i.attributeData; - for(let r=0; - r<e.length; - r++){ - const t=Object.values(e[r].attributes)[0].shaderLocation; - for(const i in h)if(h[i].location===t){ - n[r]=i; - break} - } - return this._bindingNamesCache[s]=n,n} - _createVertexBufferLayouts(t,i){ - i._attributeLocationsKey||this._generateAttributeLocationsKey(i); - const s=t._layoutKey<<16|i._attributeLocationsKey; - if(this._bufferLayoutsCache[s])return this._bufferLayoutsCache[s]; - const e=[]; - return t.buffers.forEach(s=>{ - const n={ - arrayStride:0,stepMode:"vertex",attributes:[]} - ,h=n.attributes; - for(const e in i.attributeData){ - const r=t.attributes[e]; - 1!==(r.divisor??1)&&qs(r.divisor),r.buffer===s&&(n.arrayStride=r.stride,n.stepMode=r.instance?"instance":"vertex",h.push({ - shaderLocation:i.attributeData[e].location,offset:r.offset,format:r.format} - ))} - h.length&&e.push(n)} - ),this._bufferLayoutsCache[s]=e,e} - _updatePipeHash(){ - const t=iy(this._stencilMode,this._multisampleCount,this._colorMask,this._depthStencilAttachment,this._colorTargetCount); - this._pipeStateCaches[t]||(this._pipeStateCaches[t]=Object.create(null)),this._pipeCache=this._pipeStateCaches[t]} - destroy(){ - this._renderer=null,this._bufferLayoutsCache=null} - } - ; - Qt(sy,"PipelineSystem"); - let ey=sy; - ey.extension={ - type:[ri.WebGPUSystem],name:"pipeline"} - ; - const ny=class{ - constructor(){ - this.contexts=[],this.msaaTextures=[],this.msaaSamples=1} - } - ; - Qt(ny,"GpuRenderTarget"); - let hy=ny; - const ry=class{ - init(t,i){ - this._renderer=t,this._renderTargetSystem=i} - copyToTexture(t,i,s,e,n){ - const h=this._renderer,r=this._getGpuColorTexture(t),o=h.texture.getGpuSource(i.source); - return h.encoder.commandEncoder.copyTextureToTexture({ - texture:r,origin:s} - ,{ - texture:o,origin:n} - ,e),i} - startRenderPass(t,i=!0,s,e,n=0,h=0){ - var r,o; - const a=this._renderTargetSystem.getGpuRenderTarget(t); - if(0!==h&&(null==(r=a.msaaTextures)?void 0:r.length))throw new Error("[RenderTargetSystem] Rendering to array layers is not supported with MSAA render targets."); - if(n>0&&(null==(o=a.msaaTextures)?void 0:o.length))throw new Error("[RenderTargetSystem] Rendering to mip levels is not supported with MSAA render targets."); - const c=this.getDescriptor(t,i,s,n,h); - a.descriptor=c,this._renderer.pipeline.setRenderTarget(a),this._renderer.encoder.beginRenderPass(a),this._renderer.encoder.setViewport(e)} - finishRenderPass(){ - this._renderer.encoder.endRenderPass()} - _getGpuColorTexture(t){ - const i=this._renderTargetSystem.getGpuRenderTarget(t); - return i.contexts[0]?i.contexts[0].getCurrentTexture():this._renderer.texture.getGpuSource(t.colorTextures[0].source)} - getDescriptor(t,i,s,e=0,n=0){ - "boolean"==typeof i&&(i=i?to.ALL:to.NONE); - const h=this._renderTargetSystem,r=h.getGpuRenderTarget(t),o=t.colorTextures.map((t,o)=>{ - const a=r.contexts[o]; - let c,l; - if(a){ - if(0!==n)throw new Error("[RenderTargetSystem] Rendering to array layers is not supported for canvas targets."); - c=a.getCurrentTexture().createView()} - else c=this._renderer.texture.getGpuSource(t).createView({ - dimension:"2d",baseMipLevel:e,mipLevelCount:1,baseArrayLayer:n,arrayLayerCount:1} - ); - r.msaaTextures[o]&&(l=c,c=this._renderer.texture.getTextureView(r.msaaTextures[o])); - const u=i&to.COLOR?"clear":"load"; - return s??(s=h.defaultClearColor),{ - view:c,resolveTarget:l,clearValue:s,storeOp:"store",loadOp:u} - } - ); - let a; - if(!t.stencil&&!t.depth||t.depthStencilTexture||(t.ensureDepthStencilTexture(),t.depthStencilTexture.source.sampleCount=r.msaa?4:1),t.depthStencilTexture){ - const s=i&to.STENCIL?"clear":"load",h=i&to.DEPTH?"clear":"load"; - a={ - view:this._renderer.texture.getGpuSource(t.depthStencilTexture.source).createView({ - dimension:"2d",baseMipLevel:e,mipLevelCount:1,baseArrayLayer:n,arrayLayerCount:1} - ),stencilStoreOp:"store",stencilLoadOp:s,depthClearValue:1,depthLoadOp:h,depthStoreOp:"store"} - } - return{ - colorAttachments:o,depthStencilAttachment:a} - } - clear(t,i=!0,s,e,n=0,h=0){ - if(!i)return; - const{ - gpu:r,encoder:o} - =this._renderer,a=r.device; - if(null===o.commandEncoder){ - const r=a.createCommandEncoder(),o=this.getDescriptor(t,i,s,n,h),c=r.beginRenderPass(o); - c.setViewport(e.x,e.y,e.width,e.height,0,1),c.end(); - const l=r.finish(); - a.queue.submit([l])} - else this.startRenderPass(t,i,s,e,n,h)} - initGpuRenderTarget(t){ - t.isRoot=!0; - const i=new hy; - return i.colorTargetCount=t.colorTextures.length,t.colorTextures.forEach((t,s)=>{ - if(t instanceof dn){ - const e=t.resource.getContext("webgpu"),n=t.transparent?"premultiplied":"opaque"; - try{ - e.configure({ - device:this._renderer.gpu.device,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,format:"bgra8unorm",alphaMode:n} - )} - catch(frt){ - } - i.contexts[s]=e} - if(i.msaa=t.source.antialias,t.source.antialias){ - const e=new ns({ - width:0,height:0,sampleCount:4,arrayLayerCount:t.source.arrayLayerCount} - ); - i.msaaTextures[s]=e} - } - ),i.msaa&&(i.msaaSamples=4,t.depthStencilTexture&&(t.depthStencilTexture.source.sampleCount=4)),i} - destroyGpuRenderTarget(t){ - t.contexts.forEach(t=>{ - t.unconfigure()} - ),t.msaaTextures.forEach(t=>{ - t.destroy()} - ),t.msaaTextures.length=0,t.contexts.length=0} - ensureDepthStencilTexture(t){ - const i=this._renderTargetSystem.getGpuRenderTarget(t); - t.depthStencilTexture&&i.msaa&&(t.depthStencilTexture.source.sampleCount=4)} - resizeGpuRenderTarget(t){ - const i=this._renderTargetSystem.getGpuRenderTarget(t); - i.width=t.width,i.height=t.height,i.msaa&&t.colorTextures.forEach((t,s)=>{ - const e=i.msaaTextures[s]; - null==e||e.resize(t.source.width,t.source.height,t.source._resolution)} - )} - } - ; - Qt(ry,"GpuRenderTargetAdaptor"); - let oy=ry; - const ay=class extends s_{ - constructor(t){ - super(t),this.adaptor=new oy,this.adaptor.init(t,this)} - } - ; - Qt(ay,"GpuRenderTargetSystem"); - let cy=ay; - cy.extension={ - type:[ri.WebGPUSystem],name:"renderTarget"} - ; - const ly=class{ - constructor(){ - this._gpuProgramData=Object.create(null)} - contextChange(t){ - this._gpu=t} - getProgramData(t){ - return this._gpuProgramData[t._layoutKey]||this._createGPUProgramData(t)} - _createGPUProgramData(t){ - const i=this._gpu.device,s=t.gpuLayout.map(t=>i.createBindGroupLayout({ - entries:t} - )),e={ - bindGroupLayouts:s} - ; - return this._gpuProgramData[t._layoutKey]={ - bindGroups:s,pipeline:i.createPipelineLayout(e)} - ,this._gpuProgramData[t._layoutKey]} - destroy(){ - this._gpu=null,this._gpuProgramData=null} - } - ; - Qt(ly,"GpuShaderSystem"); - let uy=ly; - uy.extension={ - type:[ri.WebGPUSystem],name:"shader"} - ; - const dy={ - normal:{ - alpha:{ - srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"} - ,color:{ - srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"} - } - ,add:{ - alpha:{ - srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"} - ,color:{ - srcFactor:"one",dstFactor:"one",operation:"add"} - } - ,multiply:{ - alpha:{ - srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"} - ,color:{ - srcFactor:"dst",dstFactor:"one-minus-src-alpha",operation:"add"} - } - ,screen:{ - alpha:{ - srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"} - ,color:{ - srcFactor:"one",dstFactor:"one-minus-src",operation:"add"} - } - ,overlay:{ - alpha:{ - srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"} - ,color:{ - srcFactor:"one",dstFactor:"one-minus-src",operation:"add"} - } - ,none:{ - alpha:{ - srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"} - ,color:{ - srcFactor:"zero",dstFactor:"zero",operation:"add"} - } - ,"normal-npm":{ - alpha:{ - srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"} - ,color:{ - srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"} - } - ,"add-npm":{ - alpha:{ - srcFactor:"one",dstFactor:"one",operation:"add"} - ,color:{ - srcFactor:"src-alpha",dstFactor:"one",operation:"add"} - } - ,"screen-npm":{ - alpha:{ - srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"} - ,color:{ - srcFactor:"src-alpha",dstFactor:"one-minus-src",operation:"add"} - } - ,erase:{ - alpha:{ - srcFactor:"zero",dstFactor:"one-minus-src-alpha",operation:"add"} - ,color:{ - srcFactor:"zero",dstFactor:"one-minus-src",operation:"add"} - } - ,min:{ - alpha:{ - srcFactor:"one",dstFactor:"one",operation:"min"} - ,color:{ - srcFactor:"one",dstFactor:"one",operation:"min"} - } - ,max:{ - alpha:{ - srcFactor:"one",dstFactor:"one",operation:"max"} - ,color:{ - srcFactor:"one",dstFactor:"one",operation:"max"} - } - } - ,fy=class{ - constructor(){ - this.defaultState=new fr,this.defaultState.blend=!0} - contextChange(t){ - this.gpu=t} - getColorTargets(t,i){ - const s=[],e={ - format:"bgra8unorm",writeMask:0,blend:dy[t.blendMode]||dy.normal} - ; - for(let n=0; - n<i; - n++)s[n]=e; - return s} - destroy(){ - this.gpu=null} - } - ; - Qt(fy,"GpuStateSystem"); - let py=fy; - py.extension={ - type:[ri.WebGPUSystem],name:"state"} - ; - const wy={ - type:"image",upload(t,i,s,e=0){ - const n=t.resource,h=(0|t.pixelWidth)*(0|t.pixelHeight),r=n.byteLength/h; - s.device.queue.writeTexture({ - texture:i,origin:{ - x:0,y:0,z:e} - } - ,n,{ - offset:0,rowsPerImage:t.pixelHeight,bytesPerRow:t.pixelWidth*r} - ,{ - width:t.pixelWidth,height:t.pixelHeight,depthOrArrayLayers:1} - )} - } - ,gy={ - "bc1-rgba-unorm":{ - blockBytes:8,blockWidth:4,blockHeight:4} - ,"bc2-rgba-unorm":{ - blockBytes:16,blockWidth:4,blockHeight:4} - ,"bc3-rgba-unorm":{ - blockBytes:16,blockWidth:4,blockHeight:4} - ,"bc7-rgba-unorm":{ - blockBytes:16,blockWidth:4,blockHeight:4} - ,"etc1-rgb-unorm":{ - blockBytes:8,blockWidth:4,blockHeight:4} - ,"etc2-rgba8unorm":{ - blockBytes:16,blockWidth:4,blockHeight:4} - ,"astc-4x4-unorm":{ - blockBytes:16,blockWidth:4,blockHeight:4} - } - ,my={ - blockBytes:4,blockWidth:1,blockHeight:1} - ,vy={ - type:"compressed",upload(t,i,s,e=0){ - let n=t.pixelWidth,h=t.pixelHeight; - const r=gy[t.format]||my; - for(let o=0; - o<t.resource.length; - o++){ - const a=t.resource[o],c=Math.ceil(n/r.blockWidth)*r.blockBytes; - s.device.queue.writeTexture({ - texture:i,mipLevel:o,origin:{ - x:0,y:0,z:e} - } - ,a,{ - offset:0,bytesPerRow:c} - ,{ - width:Math.ceil(n/r.blockWidth)*r.blockWidth,height:Math.ceil(h/r.blockHeight)*r.blockHeight,depthOrArrayLayers:1} - ),n=Math.max(n>>1,1),h=Math.max(h>>1,1)} - } - } - ,_y=["right","left","top","bottom","front","back"]; - function My(t){ - return{ - type:"cube",upload(i,s,e){ - const n=i.faces; - for(let h=0; - h<_y.length; - h++){ - const i=n[_y[h]]; - (t[i.uploadMethodId]||t.image).upload(i,s,e,h)} - } - } - } - Qt(My,"createGpuUploadCubeTextureResource"); - const by={ - type:"image",upload(t,i,s,e=0){ - const n=t.resource; - if(!n)return; - if(globalThis.HTMLImageElement&&n instanceof HTMLImageElement){ - const i=ln.get().createCanvas(n.width,n.height); - i.getContext("2d").drawImage(n,0,0,n.width,n.height),t.resource=i,qs()} - const h=Math.min(i.width,t.resourceWidth||t.pixelWidth),r=Math.min(i.height,t.resourceHeight||t.pixelHeight),o="premultiply-alpha-on-upload"===t.alphaMode; - s.device.queue.copyExternalImageToTexture({ - source:n} - ,{ - texture:i,origin:{ - x:0,y:0,z:e} - ,premultipliedAlpha:o} - ,{ - width:h,height:r} - )} - } - ,yy={ - type:"video",upload(t,i,s,e){ - by.upload(t,i,s,e)} - } - ,Ey=class{ - constructor(t){ - this.device=t,this.sampler=t.createSampler({ - minFilter:"linear"} - ),this.pipelines={ - } - } - _getMipmapPipeline(t){ - let i=this.pipelines[t]; - return i||(this.mipmapShaderModule||(this.mipmapShaderModule=this.device.createShaderModule({ - code:"\n var<private> pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(\n vec2<f32>(-1.0, -1.0), vec2<f32>(-1.0, 3.0), vec2<f32>(3.0, -1.0)); - \n\n struct VertexOutput { - \n @builtin(position) position : vec4<f32>,\n @location(0) texCoord : vec2<f32>,\n } - ; - \n\n @vertex\n fn vertexMain(@builtin(vertex_index) vertexIndex : u32) -> VertexOutput { - \n var output : VertexOutput; - \n output.texCoord = pos[vertexIndex] * vec2<f32>(0.5, -0.5) + vec2<f32>(0.5); - \n output.position = vec4<f32>(pos[vertexIndex], 0.0, 1.0); - \n return output; - \n } - \n\n @group(0) @binding(0) var imgSampler : sampler; - \n @group(0) @binding(1) var img : texture_2d<f32>; - \n\n @fragment\n fn fragmentMain(@location(0) texCoord : vec2<f32>) -> @location(0) vec4<f32> { - \n return textureSample(img, imgSampler, texCoord); - \n } - \n "} - )),i=this.device.createRenderPipeline({ - layout:"auto",vertex:{ - module:this.mipmapShaderModule,entryPoint:"vertexMain"} - ,fragment:{ - module:this.mipmapShaderModule,entryPoint:"fragmentMain",targets:[{ - format:t} - ]} - } - ),this.pipelines[t]=i),i} - generateMipmap(t){ - const i=this._getMipmapPipeline(t.format); - if("3d"===t.dimension||"1d"===t.dimension)throw new Error("Generating mipmaps for non-2d textures is currently unsupported!"); - let s=t; - const e=t.depthOrArrayLayers||1,n=t.usage&GPUTextureUsage.RENDER_ATTACHMENT; - if(!n){ - const i={ - size:{ - width:Math.ceil(t.width/2),height:Math.ceil(t.height/2),depthOrArrayLayers:e} - ,format:t.format,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT,mipLevelCount:t.mipLevelCount-1} - ; - s=this.device.createTexture(i)} - const h=this.device.createCommandEncoder({ - } - ),r=i.getBindGroupLayout(0); - for(let o=0; - o<e; - ++o){ - let e=t.createView({ - baseMipLevel:0,mipLevelCount:1,dimension:"2d",baseArrayLayer:o,arrayLayerCount:1} - ),a=n?1:0; - for(let n=1; - n<t.mipLevelCount; - ++n){ - const t=s.createView({ - baseMipLevel:a++,mipLevelCount:1,dimension:"2d",baseArrayLayer:o,arrayLayerCount:1} - ),n=h.beginRenderPass({ - colorAttachments:[{ - view:t,storeOp:"store",loadOp:"clear",clearValue:{ - r:0,g:0,b:0,a:0} - } - ]} - ),c=this.device.createBindGroup({ - layout:r,entries:[{ - binding:0,resource:this.sampler} - ,{ - binding:1,resource:e} - ]} - ); - n.setPipeline(i),n.setBindGroup(0,c),n.draw(3,1,0,0),n.end(),e=t} - } - if(!n){ - const i={ - width:Math.ceil(t.width/2),height:Math.ceil(t.height/2),depthOrArrayLayers:e} - ; - for(let e=1; - e<t.mipLevelCount; - ++e)h.copyTextureToTexture({ - texture:s,mipLevel:e-1} - ,{ - texture:t,mipLevel:e} - ,i),i.width=Math.ceil(i.width/2),i.height=Math.ceil(i.height/2)} - return this.device.queue.submit([h.finish()]),n||s.destroy(),t} - } - ; - Qt(Ey,"GpuMipmapGenerator"); - let Ay=Ey; - const Sy=class{ - constructor(t){ - this.textureView=null,this.gpuTexture=t} - destroy(){ - this.gpuTexture.destroy(),this.textureView=null,this.gpuTexture=null} - } - ; - Qt(Sy,"GPUTextureGpuData"); - let Ty=Sy; - const Cy=class{ - constructor(t){ - this._gpuSamplers=Object.create(null),this._bindGroupHash=Object.create(null),this._renderer=t,t.gc.addCollection(this,"_bindGroupHash","hash"),this._managedTextures=new Yc({ - renderer:t,type:"resource",onUnload:this.onSourceUnload.bind(this),name:"gpuTextureSource"} - ); - const i={ - image:by,buffer:wy,video:yy,compressed:vy} - ; - this._uploads={ - ...i,cube:My(i)} - } - get managedTextures(){ - return Object.values(this._managedTextures.items)} - contextChange(t){ - this._gpu=t} - initSource(t){ - var i; - return(null==(i=t._gpuData[this._renderer.uid])?void 0:i.gpuTexture)||this._initSource(t)} - _initSource(t){ - if(t.autoGenerateMipmaps){ - const i=Math.max(t.pixelWidth,t.pixelHeight); - t.mipLevelCount=Math.floor(Math.log2(i))+1} - let i=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST; - "compressed"!==t.uploadMethodId&&(i|=GPUTextureUsage.RENDER_ATTACHMENT,i|=GPUTextureUsage.COPY_SRC); - const s=gy[t.format]||{ - blockWidth:1,blockHeight:1} - ,e=Math.ceil(t.pixelWidth/s.blockWidth)*s.blockWidth,n=Math.ceil(t.pixelHeight/s.blockHeight)*s.blockHeight,h={ - label:t.label,size:{ - width:e,height:n,depthOrArrayLayers:t.arrayLayerCount} - ,format:t.format,sampleCount:t.sampleCount,mipLevelCount:t.mipLevelCount,dimension:t.dimension,usage:i} - ,r=this._gpu.device.createTexture(h); - return t._gpuData[this._renderer.uid]=new Ty(r),this._managedTextures.add(t)&&(t.on("update",this.onSourceUpdate,this),t.on("resize",this.onSourceResize,this),t.on("updateMipmaps",this.onUpdateMipmaps,this)),this.onSourceUpdate(t),r} - onSourceUpdate(t){ - const i=this.getGpuSource(t); - i&&(this._uploads[t.uploadMethodId]&&this._uploads[t.uploadMethodId].upload(t,i,this._gpu),t.autoGenerateMipmaps&&t.mipLevelCount>1&&this.onUpdateMipmaps(t))} - onUpdateMipmaps(t){ - this._mipmapGenerator||(this._mipmapGenerator=new Ay(this._gpu.device)); - const i=this.getGpuSource(t); - this._mipmapGenerator.generateMipmap(i)} - onSourceUnload(t){ - t.off("update",this.onSourceUpdate,this),t.off("resize",this.onSourceResize,this),t.off("updateMipmaps",this.onUpdateMipmaps,this)} - onSourceResize(t){ - t._gcLastUsed=this._renderer.gc.now; - const i=t._gpuData[this._renderer.uid],s=null==i?void 0:i.gpuTexture; - s?s.width===t.pixelWidth&&s.height===t.pixelHeight||(i.destroy(),this._bindGroupHash[t.uid]=null,t._gpuData[this._renderer.uid]=null,this.initSource(t)):this.initSource(t)} - _initSampler(t){ - return this._gpuSamplers[t._resourceId]=this._gpu.device.createSampler(t),this._gpuSamplers[t._resourceId]} - getGpuSampler(t){ - return this._gpuSamplers[t._resourceId]||this._initSampler(t)} - getGpuSource(t){ - var i; - return t._gcLastUsed=this._renderer.gc.now,(null==(i=t._gpuData[this._renderer.uid])?void 0:i.gpuTexture)||this.initSource(t)} - getTextureBindGroup(t){ - return this._bindGroupHash[t.uid]||this._createTextureBindGroup(t)} - _createTextureBindGroup(t){ - const i=t.source; - return this._bindGroupHash[t.uid]=new or({ - 0:i,1:i.style,2:new hr({ - uTextureMatrix:{ - type:"mat3x3<f32>",value:t.textureMatrix.mapCoord} - } - )} - ),this._bindGroupHash[t.uid]} - getTextureView(t){ - const i=t.source; - i._gcLastUsed=this._renderer.gc.now; - let s=i._gpuData[this._renderer.uid]; - return s||(this.initSource(i),s=i._gpuData[this._renderer.uid]),s.textureView||(s.textureView=s.gpuTexture.createView({ - dimension:i.viewDimension} - )),s.textureView} - generateCanvas(t){ - const i=this._renderer,s=i.gpu.device.createCommandEncoder(),e=ln.get().createCanvas(); - e.width=t.source.pixelWidth,e.height=t.source.pixelHeight; - const n=e.getContext("webgpu"); - return n.configure({ - device:i.gpu.device,usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC,format:ln.get().getNavigator().gpu.getPreferredCanvasFormat(),alphaMode:"premultiplied"} - ),s.copyTextureToTexture({ - texture:i.texture.getGpuSource(t.source),origin:{ - x:0,y:0} - } - ,{ - texture:n.getCurrentTexture()} - ,{ - width:e.width,height:e.height} - ),i.gpu.device.queue.submit([s.finish()]),e} - getPixels(t){ - const i=this.generateCanvas(t),s=Zp.getOptimalCanvasAndContext(i.width,i.height),e=s.context; - e.drawImage(i,0,0); - const{ - width:n,height:h} - =i,r=e.getImageData(0,0,n,h),o=new Uint8ClampedArray(r.data.buffer); - return Zp.returnCanvasAndContext(s),{ - pixels:o,width:n,height:h} - } - destroy(){ - this._managedTextures.destroy(); - for(const t of Object.keys(this._bindGroupHash)){ - const i=Number(t),s=this._bindGroupHash[i]; - null==s||s.destroy()} - this._renderer=null,this._gpu=null,this._mipmapGenerator=null,this._gpuSamplers=null,this._bindGroupHash=null} - } - ; - Qt(Cy,"GpuTextureSystem"); - let Oy=Cy; - Oy.extension={ - type:[ri.WebGPUSystem],name:"texture"} - ; - const Iy=class{ - constructor(){ - this._maxTextures=0} - contextChange(t){ - const i=new hr({ - uTransformMatrix:{ - value:new Ci,type:"mat3x3<f32>"} - ,uColor:{ - value:new Float32Array([1,1,1,1]),type:"vec4<f32>"} - ,uRound:{ - value:0,type:"f32"} - } - ); - this._maxTextures=t.limits.maxBatchableTextures; - const s=Cc({ - name:"graphics",bits:[Ic,Nc(this._maxTextures),Op,Bc]} - ); - this.shader=new lr({ - gpuProgram:s,resources:{ - localUniforms:i} - } - )} - execute(t,i){ - const s=i.context,e=s.customShader||this.shader,n=t.renderer,h=n.graphicsContext,{ - batcher:r,instructions:o} - =h.getContextRenderData(s),a=n.encoder; - a.setGeometry(r.geometry,e.gpuProgram); - const c=n.globalUniforms.bindGroup; - a.setBindGroup(0,c,e.gpuProgram); - const l=n.renderPipes.uniformBatch.getUniformBindGroup(e.resources.localUniforms,!0); - a.setBindGroup(2,l,e.gpuProgram); - const u=o.instructions; - let d=null; - for(let f=0; - f<o.instructionSize; - f++){ - const i=u[f]; - if(i.topology!==d&&(d=i.topology,a.setPipelineFromGeometryProgramAndState(r.geometry,e.gpuProgram,t.state,i.topology)),e.groups[1]=i.bindGroup,!i.gpuBindGroup){ - const t=i.textures; - i.bindGroup=ya(t.textures,t.count,this._maxTextures),i.gpuBindGroup=n.bindGroup.getBindGroup(i.bindGroup,e.gpuProgram,1)} - a.setBindGroup(1,i.bindGroup,e.gpuProgram),a.renderPassEncoder.drawIndexed(i.size,1,i.start)} - } - destroy(){ - this.shader.destroy(!0),this.shader=null} - } - ; - Qt(Iy,"GpuGraphicsAdaptor"); - let ky=Iy; - ky.extension={ - type:[ri.WebGPUPipesAdaptor],name:"graphics"} - ; - const xy=class{ - init(){ - const t=Cc({ - name:"mesh",bits:[Cp,fm,Bc]} - ); - this._shader=new lr({ - gpuProgram:t,resources:{ - uTexture:ls.EMPTY._source,uSampler:ls.EMPTY._source.style,textureUniforms:{ - uTextureMatrix:{ - type:"mat3x3<f32>",value:new Ci} - } - } - } - )} - execute(t,i){ - const s=t.renderer; - let e=i._shader; - if(e){ - if(!e.gpuProgram)return void qs(i.shader)} - else e=this._shader,e.groups[2]=s.texture.getTextureBindGroup(i.texture); - const n=e.gpuProgram; - if(n.autoAssignGlobalUniforms&&(e.groups[0]=s.globalUniforms.bindGroup),n.autoAssignLocalUniforms){ - const i=t.localUniforms; - e.groups[1]=s.renderPipes.uniformBatch.getUniformBindGroup(i,!0)} - s.encoder.draw({ - geometry:i._geometry,shader:e,state:i.state} - )} - destroy(){ - this._shader.destroy(!0),this._shader=null} - } - ; - Qt(xy,"GpuMeshAdapter"); - let Ry=xy; - Ry.extension={ - type:[ri.WebGPUPipesAdaptor],name:"mesh"} - ; - const Py=[...Jv,qb,Ub,Gb,$b,xb,Oy,cy,uy,py,ey,Lb,Wb,Cb],Ny=[...Qv,Qb],Ly=[lm,Ry,ky],Dy=[],Gy=[],By=[]; - ci.handleByNamedList(ri.WebGPUSystem,Dy),ci.handleByNamedList(ri.WebGPUPipes,Gy),ci.handleByNamedList(ri.WebGPUPipesAdaptor,By),ci.add(...Py,...Ny,...Ly); - const Uy=class extends oo{ - constructor(){ - super({ - name:"webgpu",type:ar.WEBGPU,systems:Dy,renderPipes:Gy,renderPipeAdaptors:By} - )} - } - ; - Qt(Uy,"WebGPURenderer"); - let Fy=Uy; - const $y=Object.freeze(Object.defineProperty({ - __proto__:null,WebGPURenderer:Fy} - ,Symbol.toStringTag,{ - value:"Module"} - )),Hy=(Qt(K=class extends hp{ - constructor(...t){ - super({ - } - ); - let i=t[0]??{ - } - ; - "number"==typeof i&&(Yi(ji,"PlaneGeometry constructor changed please use { - width, height, verticesX, verticesY } - instead"),i={ - width:i,height:t[1],verticesX:t[2],verticesY:t[3]} - ),this.build(i)} - build(t){ - t={ - ...K.defaultOptions,...t} - ,this.verticesX=this.verticesX??t.verticesX,this.verticesY=this.verticesY??t.verticesY,this.width=this.width??t.width,this.height=this.height??t.height; - const i=this.verticesX*this.verticesY,s=[],e=[],n=[],h=this.verticesX-1,r=this.verticesY-1,o=this.width/h,a=this.height/r; - for(let l=0; - l<i; - l++){ - const t=l%this.verticesX,i=l/this.verticesX|0; - s.push(t*o,i*a),e.push(t/h,i/r)} - const c=h*r; - for(let l=0; - l<c; - l++){ - const t=l%h,i=l/h|0,s=i*this.verticesX+t,e=i*this.verticesX+t+1,r=(i+1)*this.verticesX+t,o=(i+1)*this.verticesX+t+1; - n.push(s,e,r,e,o,r)} - this.buffers[0].data=new Float32Array(s),this.buffers[1].data=new Float32Array(e),this.indexBuffer.data=new Uint32Array(n),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()} - } - ,"_PlaneGeometry"),K); - Hy.defaultOptions={ - width:100,height:100,verticesX:10,verticesY:10} - ; - let Wy=Hy; - const Vy=class extends fp{ - constructor(t){ - const{ - texture:i,verticesX:s,verticesY:e,...n} - =t,h=new Wy(Qi({ - width:i.width,height:i.height,verticesX:s,verticesY:e} - )); - super(Qi({ - ...n,geometry:h,texture:i} - )),this.texture=i,this.autoResize=!0} - textureUpdated(){ - const t=this.geometry,{ - width:i,height:s} - =this.texture; - !this.autoResize||t.width===i&&t.height===s||(t.width=i,t.height=s,t.build({ - } - ))} - set texture(t){ - var i; - null==(i=this._texture)||i.off("update",this.textureUpdated,this),super.texture=t,t.on("update",this.textureUpdated,this),this.textureUpdated()} - get texture(){ - return this._texture} - destroy(t){ - this.texture.off("update",this.textureUpdated,this),super.destroy(t)} - } - ; - Qt(Vy,"MeshPlane"); - let jy=Vy; - const Ky=(Qt(z=class extends hp{ - constructor(t){ - const{ - width:i,points:s,textureScale:e} - ={ - ...z.defaultOptions,...t} - ; - super({ - positions:new Float32Array(4*s.length),uvs:new Float32Array(4*s.length),indices:new Uint32Array(6*(s.length-1))} - ),this.points=s,this._width=i,this.textureScale=e,this._build()} - get width(){ - return this._width} - _build(){ - const t=this.points; - if(!t)return; - const i=this.getBuffer("aPosition"),s=this.getBuffer("aUV"),e=this.getIndex(); - if(t.length<1)return; - i.data.length/4!==t.length&&(i.data=new Float32Array(4*t.length),s.data=new Float32Array(4*t.length),e.data=new Uint16Array(6*(t.length-1))); - const n=s.data,h=e.data; - n[0]=0,n[1]=0,n[2]=0,n[3]=1; - let r=0,o=t[0]; - const a=this._width*this.textureScale,c=t.length; - for(let u=0; - u<c; - u++){ - const i=4*u; - if(this.textureScale>0){ - const i=o.x-t[u].x,s=o.y-t[u].y,e=Math.sqrt(i*i+s*s); - o=t[u],r+=e/a} - else r=u/(c-1); - n[i]=r,n[i+1]=0,n[i+2]=r,n[i+3]=1} - let l=0; - for(let u=0; - u<c-1; - u++){ - const t=2*u; - h[l++]=t,h[l++]=t+1,h[l++]=t+2,h[l++]=t+2,h[l++]=t+1,h[l++]=t+3} - s.update(),e.update(),this.updateVertices()} - updateVertices(){ - const t=this.points; - if(t.length<1)return; - let i,s=t[0],e=0,n=0; - const h=this.buffers[0].data,r=t.length,o=this.textureScale>0?this.textureScale*this._width/2:this._width/2; - for(let a=0; - a<r; - a++){ - const r=t[a],c=4*a; - i=a<t.length-1?t[a+1]:r,n=-(i.x-s.x),e=i.y-s.y; - const l=Math.sqrt(e*e+n*n); - l<1e-6?(e=0,n=0):(e/=l,n/=l,e*=o,n*=o),h[c]=r.x+e,h[c+1]=r.y+n,h[c+2]=r.x-e,h[c+3]=r.y-n,s=r} - this.buffers[0].update()} - update(){ - this.textureScale>0?this._build():this.updateVertices()} - } - ,"_RopeGeometry"),z); - Ky.defaultOptions={ - width:200,points:[],textureScale:0} - ; - let zy=Ky; - const Yy=(Qt(Y=class extends fp{ - constructor(t){ - const{ - texture:i,points:s,textureScale:e,...n} - ={ - ...Y.defaultOptions,...t} - ,h=new zy(Qi({ - width:i.height,points:s,textureScale:e} - )); - e>0&&(i.source.style.addressMode="repeat"),super(Qi({ - ...n,texture:i,geometry:h} - )),this.autoUpdate=!0,this.onRender=this._render} - _render(){ - const t=this.geometry; - (this.autoUpdate||t._width!==this.texture.height)&&(t._width=this.texture.height,t.update())} - } - ,"_MeshRope"),Y); - Yy.defaultOptions={ - textureScale:0} - ; - let qy=Yy; - const Xy=class{ - constructor(t){ - this._renderer=t} - validateRenderable(t){ - return!1} - addRenderable(t,i){ - this._renderer.renderPipes.batch.break(i),i.add(t)} - updateRenderable(t){ - } - execute(t){ - var i,s; - const e=this._renderer,n=e.canvasContext,h=n.activeContext; - h.save(); - const r=t.groupTransform,o=e._roundPixels|t._roundPixels; - n.setContextTransform(r,1===o),n.setBlendMode(t.groupBlendMode); - const a=(null==(i=e.globalUniforms.globalUniformData)?void 0:i.worldColor)??4294967295,c=t.groupColorAlpha,l=(a>>>24&255)/255*((c>>>24&255)/255)*((null==(s=e.filter)?void 0:s.alphaMultiplier)??1); - if(l<=0)return void h.restore(); - h.globalAlpha=l; - const u=ye(_e(16777215&c,16777215&a)),d=t.texture,f=bp.getCanvasSource(d); - if(!f)return void h.restore(); - const p=n.smoothProperty,w="nearest"!==d.source.style.scaleMode; - h[p]!==w&&(h[p]=w); - const g=16777215!==u||0!==d.rotate,m=g?bp.getTintedCanvas({ - texture:d} - ,u):f,{ - leftWidth:v,topHeight:_,rightWidth:M,bottomHeight:b,width:y,height:E} - =t,A=v+M,S=_+b,T=Math.min(A>y?y/A:1,S>E?E/S:1,1),C=v*T,O=M*T,I=_*T,k=b*T,x=Math.max(0,y-C-O),R=Math.max(0,E-I-k),P=t.anchor,N=d.source._resolution??d.source.resolution??1; - let L=d.frame.x*N,D=d.frame.y*N; - const G=-P.x*y,B=-P.y*E,U=v*N,F=_*N,$=M*N,H=b*N; - let W=d.frame.width*N,V=d.frame.height*N; - g&&(L=0,D=0,W=m.width,V=m.height),h.drawImage(m,L,D,U,F,G,B,C,I),h.drawImage(m,L+U,D,W-U-$,F,G+C,B,x,I),h.drawImage(m,L+W-$,D,$,F,G+y-O,B,O,I),h.drawImage(m,L,D+F,U,V-F-H,G,B+I,C,R),h.drawImage(m,L+U,D+F,W-U-$,V-F-H,G+C,B+I,x,R),h.drawImage(m,L+W-$,D+F,$,V-F-H,G+y-O,B+I,O,R),h.drawImage(m,L,D+V-H,U,H,G,B+E-k,C,k),h.drawImage(m,L+U,D+V-H,W-U-$,H,G+C,B+E-k,x,k),h.drawImage(m,L+W-$,D+V-H,$,H,G+y-O,B+E-k,O,k),h.restore()} - destroy(){ - this._renderer=null} - } - ; - Qt(Xy,"CanvasNineSliceSpritePipe"); - let Jy=Xy; - Jy.extension={ - type:[ri.CanvasPipes],name:"nineSliceSprite"} - ; - const Qy=(Qt(q=class extends Wy{ - constructor(t={ - } - ){ - super({ - width:(t={ - ...q.defaultOptions,...t} - ).width,height:t.height,verticesX:4,verticesY:4} - ),this._trimX=0,this._trimY=0,this._trimWidth=t.originalWidth??q.defaultOptions.originalWidth,this._trimHeight=t.originalHeight??q.defaultOptions.originalHeight,this.update(t)} - update(t){ - var i,s,e,n,h,r; - this.width=t.width??this.width,this.height=t.height??this.height,this._originalWidth=t.originalWidth??this._originalWidth,this._originalHeight=t.originalHeight??this._originalHeight,this._leftWidth=t.leftWidth??this._leftWidth,this._rightWidth=t.rightWidth??this._rightWidth,this._topHeight=t.topHeight??this._topHeight,this._bottomHeight=t.bottomHeight??this._bottomHeight,this._anchorX=null==(i=t.anchor)?void 0:i.x,this._anchorY=null==(s=t.anchor)?void 0:s.y,void 0!==t.trim?(this._trimX=(null==(e=t.trim)?void 0:e.x)??0,this._trimY=(null==(n=t.trim)?void 0:n.y)??0,this._trimWidth=(null==(h=t.trim)?void 0:h.width)??this._originalWidth,this._trimHeight=(null==(r=t.trim)?void 0:r.height)??this._originalHeight):(this._trimWidth=this._originalWidth,this._trimHeight=this._originalHeight),this.updateUvs(),this.updatePositions()} - updatePositions(){ - const t=this.positions,{ - width:i,height:s,_leftWidth:e,_rightWidth:n,_topHeight:h,_bottomHeight:r,_anchorX:o,_anchorY:a} - =this,c=e+n,l=i>c?1:i/c,u=h+r,d=s>u?1:s/u,f=Math.min(l,d),p=o*i,w=a*s; - t[0]=t[8]=t[16]=t[24]=-p,t[2]=t[10]=t[18]=t[26]=e*f-p,t[4]=t[12]=t[20]=t[28]=i-n*f-p,t[6]=t[14]=t[22]=t[30]=i-p,t[1]=t[3]=t[5]=t[7]=-w,t[9]=t[11]=t[13]=t[15]=h*f-w,t[17]=t[19]=t[21]=t[23]=s-r*f-w,t[25]=t[27]=t[29]=t[31]=s-w,this.getBuffer("aPosition").update()} - updateUvs(){ - const t=this.uvs,i=this._originalWidth,s=this._originalHeight,e=this._trimX/i,n=this._trimY/s,h=(this._trimX+this._trimWidth)/i,r=(this._trimY+this._trimHeight)/s; - t[0]=t[8]=t[16]=t[24]=e,t[1]=t[3]=t[5]=t[7]=n,t[6]=t[14]=t[22]=t[30]=h,t[25]=t[27]=t[29]=t[31]=r; - const o=1/i,a=1/s; - t[2]=t[10]=t[18]=t[26]=e+o*this._leftWidth,t[9]=t[11]=t[13]=t[15]=n+a*this._topHeight,t[4]=t[12]=t[20]=t[28]=h-o*this._rightWidth,t[17]=t[19]=t[21]=t[23]=r-a*this._bottomHeight,this.getBuffer("aUV").update()} - } - ,"_NineSliceGeometry"),q); - Qy.defaultOptions={ - width:100,height:100,leftWidth:10,topHeight:10,rightWidth:10,bottomHeight:10,originalWidth:100,originalHeight:100} - ; - let Zy=Qy; - const tE=class extends op{ - constructor(){ - super(),this.geometry=new Zy} - destroy(){ - this.geometry.destroy()} - } - ; - Qt(tE,"NineSliceSpriteGpuData"); - let iE=tE; - const sE=class{ - constructor(t){ - this._renderer=t,this._managedSprites=new Yc({ - renderer:t,type:"renderable",name:"nineSliceSprite"} - )} - addRenderable(t,i){ - const s=this._getGpuSprite(t); - t.didViewUpdate&&this._updateBatchableSprite(t,s),this._renderer.renderPipes.batch.addToBatch(s,i)} - updateRenderable(t){ - const i=this._getGpuSprite(t); - t.didViewUpdate&&this._updateBatchableSprite(t,i),i._batcher.updateElement(i)} - validateRenderable(t){ - const i=this._getGpuSprite(t); - return!i._batcher.checkAndUpdateTexture(i,t._texture)} - _updateBatchableSprite(t,i){ - i.geometry.update(t),i.setTexture(t._texture)} - _getGpuSprite(t){ - return t._gpuData[this._renderer.uid]||this._initGPUSprite(t)} - _initGPUSprite(t){ - const i=t._gpuData[this._renderer.uid]=new iE,s=i; - return s.renderable=t,s.transform=t.groupTransform,s.texture=t._texture,s.roundPixels=this._renderer._roundPixels|t._roundPixels,this._managedSprites.add(t),t.didViewUpdate||this._updateBatchableSprite(t,s),i} - destroy(){ - this._managedSprites.destroy(),this._renderer=null} - } - ; - Qt(sE,"NineSliceSpritePipe"); - let eE=sE; - eE.extension={ - type:[ri.WebGLPipes,ri.WebGPUPipes],name:"nineSliceSprite"} - ,ci.add(Jy),ci.add(eE); - const nE=(Qt(X=class extends Ye{ - constructor(t){ - var i,s,e,n; - t instanceof ls&&(t={ - texture:t} - ); - const{ - width:h,height:r,anchor:o,leftWidth:a,rightWidth:c,topHeight:l,bottomHeight:u,texture:d,roundPixels:f,...p} - =t; - super({ - label:"NineSliceSprite",...p} - ),this.renderPipeId="nineSliceSprite",this.batched=!0,this._leftWidth=a??(null==(i=null==d?void 0:d.defaultBorders)?void 0:i.left)??Zy.defaultOptions.leftWidth,this._topHeight=l??(null==(s=null==d?void 0:d.defaultBorders)?void 0:s.top)??Zy.defaultOptions.topHeight,this._rightWidth=c??(null==(e=null==d?void 0:d.defaultBorders)?void 0:e.right)??Zy.defaultOptions.rightWidth,this._bottomHeight=u??(null==(n=null==d?void 0:d.defaultBorders)?void 0:n.bottom)??Zy.defaultOptions.bottomHeight,this._width=h??d.width??Zy.defaultOptions.width,this._height=r??d.height??Zy.defaultOptions.height,this.allowChildren=!1,this.texture=d??X.defaultOptions.texture,this.roundPixels=f??!1,this._anchor=new fi({ - _onUpdate:Qt(()=>{ - this.onViewUpdate()} - ,"_onUpdate")} - ),o?this.anchor=o:this.texture.defaultAnchor&&(this.anchor=this.texture.defaultAnchor)} - get anchor(){ - return this._anchor} - set anchor(t){ - "number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)} - get width(){ - return this._width} - set width(t){ - this._width=t,this.onViewUpdate()} - get height(){ - return this._height} - set height(t){ - this._height=t,this.onViewUpdate()} - setSize(t,i){ - "object"==typeof t&&(i=t.height??t.width,t=t.width),this._width=t,this._height=i??t,this.onViewUpdate()} - getSize(t){ - return t||(t={ - } - ),t.width=this._width,t.height=this._height,t} - get leftWidth(){ - return this._leftWidth} - set leftWidth(t){ - this._leftWidth=t,this.onViewUpdate()} - get topHeight(){ - return this._topHeight} - set topHeight(t){ - this._topHeight=t,this.onViewUpdate()} - get rightWidth(){ - return this._rightWidth} - set rightWidth(t){ - this._rightWidth=t,this.onViewUpdate()} - get bottomHeight(){ - return this._bottomHeight} - set bottomHeight(t){ - this._bottomHeight=t,this.onViewUpdate()} - get texture(){ - return this._texture} - set texture(t){ - t||(t=ls.EMPTY); - const i=this._texture; - i!==t&&(i&&i.dynamic&&i.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,this.onViewUpdate())} - get originalWidth(){ - return this._texture.width} - get originalHeight(){ - return this._texture.height} - get trim(){ - return this._texture.trim??null} - destroy(t){ - if(super.destroy(t),"boolean"==typeof t?t:null==t?void 0:t.texture){ - const i="boolean"==typeof t?t:null==t?void 0:t.textureSource; - this._texture.destroy(i)} - this._texture=null} - updateBounds(){ - const t=this._bounds,i=this._anchor,s=this._width,e=this._height; - t.minX=-i._x*s,t.maxX=t.minX+s,t.minY=-i._y*e,t.maxY=t.minY+e} - } - ,"_NineSliceSprite"),X); - nE.defaultOptions={ - texture:ls.EMPTY} - ; - let hE=nE; - const rE=class extends gg{ - constructor(t,i){ - super(); - const{ - textures:s,data:e} - =t; - Object.keys(e.pages).forEach(t=>{ - const i=e.pages[parseInt(t,10)],n=s[i.id]; - this.pages.push({ - texture:n} - )} - ),Object.keys(e.chars).forEach(t=>{ - const i=e.chars[t],{ - frame:n,source:h,rotate:r} - =s[i.page],o=Bi.transformRectCoords(i,n,r,new $i),a=new ls({ - frame:o,orig:new $i(0,0,i.width,i.height),source:h,rotate:r} - ); - this.chars[t]={ - id:t.codePointAt(0),xOffset:i.xOffset,yOffset:i.yOffset,xAdvance:i.xAdvance,kerning:i.kerning??{ - } - ,texture:a} - } - ),this.baseRenderedFontSize=e.fontSize,this.baseMeasurementFontSize=e.fontSize,this.fontMetrics={ - ascent:0,descent:0,fontSize:e.fontSize} - ,this.baseLineOffset=e.baseLineOffset,this.lineHeight=e.lineHeight,this.fontFamily=e.fontFamily,this.distanceField=e.distanceField??{ - type:"none",range:0} - ,this.url=i} - destroy(){ - super.destroy(); - for(let t=0; - t<this.pages.length; - t++){ - const{ - texture:i} - =this.pages[t]; - i.destroy(!0)} - this.pages=null} - static install(t){ - Tg.install(t)} - static uninstall(t){ - Tg.uninstall(t)} - } - ; - Qt(rE,"BitmapFont"); - let oE=rE; - const aE=Object.freeze(Object.defineProperty({ - __proto__:null,BitmapFont:oE} - ,Symbol.toStringTag,{ - value:"Module"} - )); - ci.add(li,ui); - const cE=Object.freeze(Object.defineProperty({ - __proto__:null,AbstractBitmapFont:gg,AbstractRenderer:oo,AbstractText:qp,AbstractTextSystem:cg,AccessibilitySystem:Mh,AlphaMask:en,AlphaMaskPipe:_m,AnimatedSprite:wp,Application:Eo,ApplicationInitHook:wo,Assets:wd,AssetsClass:pd,BLEND_TO_NPM:Ca,BREAKING_SPACES:ww,BREAKING_SPACES_SET:gw,BREAK_AFTER_CHARS:_w,BREAK_AFTER_CHARS_SET:Mw,BUFFER_TYPE:v_,BackgroundLoader:xo,BackgroundSystem:mv,Batch:Ba,BatchGeometry:sc,BatchTextureArray:Da,BatchableGraphics:tl,BatchableHTMLText:Hg,BatchableMesh:op,BatchableSprite:ig,BatchableText:eg,Batcher:ja,BatcherPipe:dm,BigPool:te,BindGroup:or,BindGroupSystem:Cb,BitmapFont:oE,BitmapFontManager:Tg,BlendModePipe:hv,BlurFilter:_f,BlurFilterPass:mf,Bounds:ps,BrowserAdapter:an,Buffer:za,BufferImageSource:rs,BufferResource:wM,BufferUsage:Ka,CLEAR:to,COLLAPSIBLE_SPACES:mw,COLLAPSIBLE_SPACES_SET:vw,Cache:Tn,CanvasBatchAdaptor:hm,CanvasColorMaskPipe:bm,CanvasContextSystem:Lm,CanvasGraphicsAdaptor:tv,CanvasGraphicsContextSystem:Yf,CanvasGraphicsPipe:Xf,CanvasLimitsSystem:Gm,CanvasNineSliceSpritePipe:Jy,CanvasObserver:Jn,CanvasPool:Zp,CanvasPoolClass:Qp,CanvasRenderTargetAdaptor:n_,CanvasRenderTargetSystem:r_,CanvasRenderer:g_,CanvasRendererTextSystem:ug,CanvasSource:dn,CanvasStencilMaskPipe:Om,CanvasTextGenerator:qw,CanvasTextMetrics:$w,CanvasTextPipe:hg,CanvasTextSystem:fg,CanvasTextureSystem:a_,CanvasTilingSpritePipe:Tp,Circle:da,Color:Ks,ColorMask:hn,ColorMaskPipe:Em,ColorMatrixFilter:Ef,CompressedSource:bd,Container:Ke,CustomRenderPipe:Um,DEG_TO_RAD:yi,DOMAdapter:ln,DOMPipe:Vd,DefaultBatcher:Kc,DefaultShader:Wc,DynamicBitmapFont:vg,Ellipse:pa,EventBoundary:ef,EventEmitter:vi,EventSystem:rf,EventsTicker:Kd,ExtensionType:ri,ExtractSystem:Mv,FederatedContainer:of,FederatedEvent:Zn,FederatedMouseEvent:Yd,FederatedPointerEvent:Xd,FederatedWheelEvent:Qd,FillGradient:ml,FillPattern:Eu,Filter:wr,FilterEffect:re,FilterPipe:If,FilterSystem:Gf,FontStylePromiseCache:qg,GAUSSIAN_VALUES:cf,GCManagedHash:Yc,GCSystem:xv,GL_FORMATS:C_,GL_TARGETS:O_,GL_TYPES:I_,GPUTextureGpuData:Ty,GenerateTextureSystem:Cv,Geometry:Qa,GlBackBufferSystem:U_,GlBatchAdaptor:om,GlBuffer:M_,GlBufferSystem:y_,GlColorMaskSystem:$_,GlContextSystem:A_,GlEncoderSystem:W_,GlGeometryGpuData:N_,GlGeometrySystem:D_,GlGraphicsAdaptor:pb,GlLimitsSystem:j_,GlMeshAdaptor:gb,GlProgram:Uh,GlProgramData:vM,GlRenderTarget:z_,GlRenderTargetAdaptor:uM,GlRenderTargetSystem:fM,GlShaderSystem:LM,GlStateSystem:WM,GlStencilSystem:X_,GlTexture:jM,GlTextureSystem:db,GlUboSystem:cM,GlUniformGroupSystem:FM,GlobalResourceRegistry:Xs,GlobalUniformSystem:Pv,GpuBatchAdaptor:lm,GpuBlendModesToPixi:dy,GpuBufferData:Ib,GpuBufferSystem:xb,GpuColorMaskSystem:Lb,GpuDeviceSystem:Gb,GpuEncoderSystem:Ub,GpuGraphicsAdaptor:ky,GpuGraphicsContext:Rl,GpuLimitsSystem:$b,GpuMeshAdapter:Ry,GpuMipmapGenerator:Ay,GpuProgram:tr,GpuRenderTarget:hy,GpuRenderTargetAdaptor:oy,GpuRenderTargetSystem:cy,GpuShaderSystem:uy,GpuStateSystem:py,GpuStencilModesToPixi:Y_,GpuStencilSystem:Wb,GpuTextureSystem:Oy,GpuUboSystem:qb,GpuUniformBatchPipe:Qb,Graphics:ep,GraphicsContext:Uu,GraphicsContextRenderData:Nl,GraphicsContextSystem:Dl,GraphicsGpuData:Zf,GraphicsPath:hu,GraphicsPipe:ip,HTMLText:em,HTMLTextPipe:Vg,HTMLTextRenderData:Ug,HTMLTextStyle:Ng,HTMLTextSystem:im,HelloSystem:Fv,ImageSource:pn,InstructionSet:Ne,Loader:Vo,LoaderParserPriority:xn,MaskEffectManager:ce,MaskEffectManagerClass:ae,MaskFilter:Hf,Matrix:Ci,Mesh:fp,MeshGeometry:hp,MeshGpuData:cp,MeshPipe:up,MeshPlane:jy,MeshRope:qy,NEWLINES:fw,NEWLINES_SET:pw,NEWLINE_MATCH_REGEX:yw,NEWLINE_SPLIT_REGEX:bw,NOOP:qi,NineSliceGeometry:Zy,NineSliceSprite:hE,NineSliceSpriteGpuData:iE,NineSliceSpritePipe:eE,ObservablePoint:fi,PI_2:Mi,PassthroughFilter:Cf,PipelineSystem:ey,PlaneGeometry:Wy,Point:Ai,Polygon:ma,Pool:Js,PoolGroupClass:Zs,QuadGeometry:Gp,RAD_TO_DEG:bi,Rectangle:$i,RenderGroup:Fe,RenderGroupPipe:Hm,RenderGroupSystem:wv,RenderTarget:Kv,RenderTargetSystem:s_,RenderTexture:yv,RenderableGCSystem:Hv,RendererInitHook:mo,RendererType:ar,ResizePlugin:_o,Resolver:Hn,RopeGeometry:zy,RoundedRectangle:Ma,STENCIL_MODES:Oa,SVGParser:_u,SchedulerSystem:Dv,Shader:lr,ShaderStage:Yh,ShapePath:eu,SharedRenderPipes:Qv,SharedSystems:Jv,Sprite:Xe,SpritePipe:sv,Spritesheet:Kn,State:fr,StencilMask:on,StencilMaskPipe:km,SystemRunner:so,Text:pg,TextStyle:Jw,Texture:ls,TextureGCSystem:Vv,TextureMatrix:cs,TexturePool:Be,TexturePoolClass:Ge,TextureSource:ns,TextureStyle:ss,Ticker:Mn,TickerListener:mn,TickerPlugin:bo,TilingSprite:zp,TilingSpriteGpuData:Wp,TilingSpritePipe:jp,TilingSpriteShader:Lp,Transform:vp,UNIFORM_TO_ARRAY_SETTERS:GM,UNIFORM_TO_SINGLE_SETTERS:DM,UNIFORM_TYPES_MAP:sr,UNIFORM_TYPES_VALUES:ir,UPDATE_BLEND:2,UPDATE_COLOR:1,UPDATE_PRIORITY:wn,UPDATE_VISIBLE:4,UboBatch:Pb,UboSystem:Q_,UniformGroup:hr,VERSION:fo,VideoSource:En,ViewContainer:Ye,ViewSystem:Xv,ViewableBuffer:Sa,WGSL_ALIGN_SIZE_DATA:Vb,WGSL_TO_STD40_SIZE:Z_,WebGLRenderer:Ab,WebGPURenderer:Fy,WorkerManager:Qu,accessibilityTarget:bh,addBits:ec,addMaskBounds:Qe,addMaskLocalBounds:Ze,addProgramDefines:Ih,appendSVGPath:vu,applyMatrix:Up,applyStyleParams:rb,assignWithIgnore:$e,autoDetectRenderer:uo,bgr2rgb:ye,bitmapFontCachePlugin:Oo,bitmapFontTextParser:Ao,bitmapFontXMLParser:So,bitmapFontXMLStringParser:To,blockDataMap:gy,blurTemplateWgsl:pf,boundsPool:fe,browserExt:li,buildAdaptiveBezier:Bl,buildAdaptiveQuadratic:$l,buildArc:Vl,buildArcTo:jl,buildArcToSvg:Ql,buildCircle:il,buildContextBatches:Cl,buildEllipse:sl,buildLine:al,buildPixelLine:cl,buildPolygon:dl,buildRectangle:fl,buildRoundedRectangle:el,buildSimpleUvs:Xc,buildTriangle:pl,buildUvs:qc,cacheAsTextureMixin:ie,cacheTextureArray:Ro,calculatePathArea:mu,calculateProjection:Zv,canUseNewCanvasBlendModes:Mp,canvasUtils:bp,checkChildrenDidChange:Te,checkDataUrl:jo,checkExtension:Ko,checkForNestedPattern:wu,checkMaxIfStatementsInShader:Ra,childrenHelperMixin:ee,cleanArray:Iv,cleanHash:Ov,clearList:rv,closePointEps:nl,collapseNewlines:Ow,collapseSpaces:Cw,collectRenderablesMixin:ne,color32BitToUniform:Jf,colorBit:Ic,colorBitGl:kc,colorMatrixFilterFrag:Mf,colorMatrixFilterWgsl:bf,compareModeToGlCompare:hb,compileHighShader:gc,compileHighShaderGl:mc,compileHighShaderGlProgram:Oc,compileHighShaderGpuProgram:Cc,compileHooks:hc,compileInputs:oc,compileOutputs:uc,compileShader:_M,convertToList:An,copySearchParams:Vn,createGlUploadCubeTextureResource:XM,createGpuUploadCubeTextureResource:My,createIdFromString:Ah,createStringVariations:Un,createTexture:$u,createUboElementsSTD40:tM,createUboElementsWGSL:jb,createUboSyncFunction:sM,createUboSyncFunctionSTD40:oM,createUboSyncFunctionWGSL:zb,crossOrigin:rd,cullingMixin:zs,curveEps:1e-4,defaultFilterVert:af,defaultValue:bM,definedProps:Qi,deprecation:Yi,detectAvif:No,detectCompressed:$d,detectDefaults:Do,detectMp4:Uo,detectOgv:Fo,detectVideoAlphaMode:bn,detectWebm:$o,detectWebp:Ho,determineCrossOrigin:ad,earcut:Zr,effectsMixin:le,ensureAttributes:S_,ensureIsBuffer:Ya,ensurePrecision:kh,ensureTextOptions:Xp,executeInstructions:Fm,extensions:ci,extractAttributesFromGlProgram:CM,extractAttributesFromGpuProgram:Kh,extractFontFamilies:Kg,extractStructAndGroups:zh,extractSubpaths:gu,extractSvgUrlId:uu,fastCopy:Ta,findMixin:ue,fontStringFromTextStyle:Ww,fragmentGPUTemplate:yc,fragmentGlTemplate:Ac,generateArraySyncSTD40:rM,generateArraySyncWGSL:Kb,generateBlurFragSource:uf,generateBlurGlProgram:ff,generateBlurProgram:wf,generateBlurVertSource:df,generateGpuLayoutGroups:qh,generateLayoutHash:Xh,generateProgram:RM,generateShaderSyncCode:gM,generateTextureBatchBit:Nc,generateTextureBatchBitGl:Gc,generateTextureMatrix:El,generateUniformsSync:BM,getAdjustedBlendModeBlend:Ia,getAttributeInfoFromFormat:$h,getBatchSamplersUniformGroup:$c,getBitmapTextLayout:_g,getCanvasBoundingBox:hw,getCanvasFillStyle:jw,getCanvasTexture:Yv,getCharacterGroups:xw,getDefaultUniformValue:er,getFastGlobalBoundsMixin:we,getFontCss:Xg,getFontFamilyName:Zo,getGeometryBounds:qa,getGlTypeFromFormat:x_,getGlobalBounds:ge,getGlobalMixin:Ee,getGlobalRenderableBounds:Rf,getLocalBounds:Ae,getMaxFragmentPrecision:Oh,getMaxMiterRatio:Lu,getMaxTexturesPerBatch:Na,getOrientationOfPoints:hl,getPo2TextureFromSource:og,getResolutionOfUrl:Fu,getSVGUrl:Jg,getSupportedCompressedTextureFormats:Ad,getSupportedGPUCompressedTextureFormats:Ed,getSupportedGlCompressedTextureFormats:yd,getSupportedTextureFormats:Cd,getTemporaryCanvasFromImage:Qg,getTestContext:Ch,getTextureBatchBindGroup:ya,getUboData:OM,getUniformData:IM,getUrlExtension:Wn,glUploadBufferImageResource:KM,glUploadCompressedTextureResource:YM,glUploadImageResource:JM,glUploadVideoResource:ib,globalUniformsBit:Sc,globalUniformsBitGl:Tc,gpuUploadBufferImageResource:wy,gpuUploadCompressedTextureResource:vy,gpuUploadImageResource:by,gpuUploadVideoResource:yy,groupD8:Bi,hasTagMarkup:lw,hasTagStyles:cw,injectBits:dc,insertVersion:xh,isBreakAfterChar:Tw,isBreakingSpace:Aw,isCollapsibleSpace:Sw,isMobile:vh,isNewline:Ew,isPow2:Ji,isRenderingToScreen:t_,isSafari:jg,isSingleItem:Fn,isWebGLSupported:ao,isWebGPUSupported:co,ktxTranscoderUrls:xd,loadBitmapFont:Io,loadEnvironmentExtensions:mr,loadFontAsBase64:zg,loadFontCSS:Yg,loadImageBitmap:id,loadJson:zo,loadKTX2:Gd,loadKTX2onWorker:Dd,loadSVGImage:Zg,loadSvg:Hu,loadTextures:sd,loadTxt:Yo,loadVideoTextures:ld,loadWebFont:sa,localUniformBit:Cp,localUniformBitGl:Ip,localUniformBitGroup2:Op,logProgramError:xM,mapCanvasBlendModesToPixi:Rm,mapFormatToGlFormat:ob,mapFormatToGlInternalFormat:ab,mapFormatToGlType:cb,mapGlToVertexFormat:TM,mapType:SM,mapViewDimensionToGlTarget:lb,mapWebGLBlendModesToPixi:$M,maskFrag:Bf,maskVert:Uf,maskWgsl:Ff,matrixPool:de,measureHtmlText:Fg,measureMixin:Oe,measureTaggedText:Pw,mipmapScaleModeToGlFilter:eb,multiplyColors:be,multiplyHexColors:_e,nextPow2:Xi,nonCompressedFormats:Sd,normalizeExtensionPriority:ai,onRenderMixin:Ie,parseSVGDefinitions:au,parseSVGFloatAttribute:ou,parseSVGPath:la,parseSVGStyle:fu,parseTaggedText:dw,passthroughFrag:Af,passthroughWgsl:Sf,path:Gn,pointInTriangle:kf,preloadVideo:od,removeItems:se,removeStructAndGroupDuplicates:Jh,resolveCharacters:Eg,resolveCompressedTextureUrl:Ud,resolveJsonUrl:dd,resolveTextureUrl:ud,resourceToTexture:In,roundPixelsBit:Bc,roundPixelsBitGl:Uc,roundedShapeArc:Zl,roundedShapeQuadraticCurve:tu,sayHello:Bv,scaleModeToGlFilter:sb,setPositions:Bp,setProgramName:Nh,setUvs:Fp,shapeBuilders:Al,sortMixin:ke,spritesheetAsset:qn,squaredDistanceToLineSegment:wa,stripVersion:Lh,styleAttributes:du,testImageFormat:Po,testVideoFormat:Bo,textStyleToCSS:Cg,textureBit:fm,textureBitGl:pm,textureFrom:kn,tilingBit:kp,tilingBitGl:xp,toFillStyle:Pu,toLocalGlobalMixin:Re,toStrokeStyle:Nu,tokenize:kw,tokenizeTaggedRuns:Lw,transformVertices:Jc,triangulateWithHoles:ll,trimRight:Iw,uboSyncFunctionsSTD40:nM,uboSyncFunctionsWGSL:hM,uid:Wi,uniformParsers:iM,unsafeEvalSupported:_r,updateQuadBounds:us,updateRenderGroupTransform:cv,updateRenderGroupTransforms:av,updateTextBounds:Zw,updateTransformAndChildren:lv,updateTransformBackwards:ve,v8_0_0:ji,v8_3_4:Ki,validFormats:Bd,validateRenderables:dv,vertexGPUTemplate:bc,vertexGlTemplate:Ec,warn:qs,webworkerExt:ui,wordWrap:Bw,wordWrapTaggedLines:Nw,wrapModeToGlAddress:nb} - ,Symbol.toStringTag,{ - value:"Module"} - )),lE=class t{
StringSet 1 hunks, 5671 statements
- if("undefined"!=typeof window&&window.PIXI){ - const t=window.require; - window.require=i=>t?t(i):i.startsWith("@pixi/")||i.startsWith("pixi.js")?window.PIXI:void 0} - const LY=class{ - constructor(){ - Zt(this,"entries",{ - } - ),Zt(this,"size",0)} - add(t){ - let i=this.entries[t]; - return this.entries[t]=!0,!i&&(this.size++,!0)} - addAll(t){ - let i=this.size; - for(var s=0,e=t.length; - s<e; - s++)this.add(t[s]); - return i!=this.size} - contains(t){ - return this.entries[t]} - clear(){ - this.entries={ - } - ,this.size=0} - } - ; - Qt(LY,"StringSet"); - let DY=LY; - const GY=class t{ - constructor(t=0,i=0,s=0,e=0){ - Zt(this,"r"),Zt(this,"g"),Zt(this,"b"),Zt(this,"a"),this.r=t,this.g=i,this.b=s,this.a=e} - set(t,i,s,e){ - return this.r=t,this.g=i,this.b=s,this.a=e,this.clamp()} - setFromColor(t){ - return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this} - setFromString(t){ - return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=8!=t.length?1:parseInt(t.substr(6,2),16)/255,this} - add(t,i,s,e){ - return this.r+=t,this.g+=i,this.b+=s,this.a+=e,this.clamp()} - clamp(){ - return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this} - static rgba8888ToColor(t,i){ - t.r=((4278190080&i)>>>24)/255,t.g=((16711680&i)>>>16)/255,t.b=((65280&i)>>>8)/255,t.a=(255&i)/255} - static rgb888ToColor(t,i){ - t.r=((16711680&i)>>>16)/255,t.g=((65280&i)>>>8)/255,t.b=(255&i)/255} - toRgb888(){ - const t=Qt(t=>("0"+(255*t).toString(16)).slice(-2),"hex"); - return Number("0x"+t(this.r)+t(this.g)+t(this.b))} - static fromString(i,s=new t){ - return s.setFromString(i)} - } - ; - Qt(GY,"Color"),Zt(GY,"WHITE",new GY(1,1,1,1)),Zt(GY,"RED",new GY(1,0,0,1)),Zt(GY,"GREEN",new GY(0,1,0,1)),Zt(GY,"BLUE",new GY(0,0,1,1)),Zt(GY,"MAGENTA",new GY(1,0,1,1)); - let BY=GY; - const UY=class t{ - static clamp(t,i,s){ - return t<i?i:t>s?s:t} - static cosDeg(i){ - return Math.cos(i*t.degRad)} - static sinDeg(i){ - return Math.sin(i*t.degRad)} - static atan2Deg(i,s){ - return Math.atan2(i,s)*t.degRad} - static signum(t){ - return t>0?1:t<0?-1:0} - static toInt(t){ - return t>0?Math.floor(t):Math.ceil(t)} - static cbrt(t){ - let i=Math.pow(Math.abs(t),1/3); - return t<0?-i:i} - static randomTriangular(i,s){ - return t.randomTriangularWith(i,s,.5*(i+s))} - static randomTriangularWith(t,i,s){ - let e=Math.random(),n=i-t; - return e<=(s-t)/n?t+Math.sqrt(e*n*(s-t)):i-Math.sqrt((1-e)*n*(i-s))} - static isPowerOfTwo(t){ - return t&&!(t&t-1)} - } - ; - Qt(UY,"MathUtils"),Zt(UY,"PI",3.1415927),Zt(UY,"PI2",2*UY.PI),Zt(UY,"invPI2",1/UY.PI2),Zt(UY,"radiansToDegrees",180/UY.PI),Zt(UY,"radDeg",UY.radiansToDegrees),Zt(UY,"degreesToRadians",UY.PI/180),Zt(UY,"degRad",UY.degreesToRadians); - let FY=UY; - const $Y=class t{ - static arrayCopy(t,i,s,e,n){ - for(let h=i,r=e; - h<i+n; - h++,r++)s[r]=t[h]} - static arrayFill(t,i,s,e){ - for(let n=i; - n<s; - n++)t[n]=e} - static setArraySize(t,i,s=0){ - let e=t.length; - if(e==i)return t; - if(t.length=i,e<i)for(let n=e; - n<i; - n++)t[n]=s; - return t} - static ensureArrayCapacity(i,s,e=0){ - return i.length>=s?i:t.setArraySize(i,s,e)} - static newArray(t,i){ - let s=new Array(t); - for(let e=0; - e<t; - e++)s[e]=i; - return s} - static newFloatArray(i){ - if(t.SUPPORTS_TYPED_ARRAYS)return new Float32Array(i); - { - let t=new Array(i); - for(let i=0; - i<t.length; - i++)t[i]=0; - return t} - } - static newShortArray(i){ - if(t.SUPPORTS_TYPED_ARRAYS)return new Int16Array(i); - { - let t=new Array(i); - for(let i=0; - i<t.length; - i++)t[i]=0; - return t} - } - static toFloatArray(i){ - return t.SUPPORTS_TYPED_ARRAYS?new Float32Array(i):i} - static toSinglePrecision(i){ - return t.SUPPORTS_TYPED_ARRAYS?Math.fround(i):i} - static webkit602BugfixHelper(t,i){ - } - static contains(t,i,s=!0){ - for(var e=0; - e<t.length; - e++)if(t[e]==i)return!0; - return!1} - static enumValue(t,i){ - return t[i[0].toUpperCase()+i.slice(1)]} - } - ; - Qt($Y,"Utils"),Zt($Y,"SUPPORTS_TYPED_ARRAYS","undefined"!=typeof Float32Array); - let HY=$Y; - const WY=class{ - constructor(t){ - Zt(this,"items",new Array),Zt(this,"instantiator"),this.instantiator=t} - obtain(){ - return this.items.length>0?this.items.pop():this.instantiator()} - free(t){ - t.reset&&t.reset(),this.items.push(t)} - freeAll(t){ - for(let i=0; - i<t.length; - i++)this.free(t[i])} - clear(){ - this.items.length=0} - } - ; - Qt(WY,"Pool"); - let VY=WY; - const jY=class{ - constructor(t=0,i=0){ - Zt(this,"x"),Zt(this,"y"),this.x=t,this.y=i} - set(t,i){ - return this.x=t,this.y=i,this} - length(){ - let t=this.x,i=this.y; - return Math.sqrt(t*t+i*i)} - normalize(){ - let t=this.length(); - return 0!=t&&(this.x/=t,this.y/=t),this} - } - ; - Qt(jY,"Vector2"); - let KY=jY; - const zY=class{ - constructor(t){ - if(Zt(this,"name"),!t)throw new Error("name cannot be null."); - this.name=t} - } - ; - Qt(zY,"Attachment"); - let YY=zY; - const qY=class t extends YY{ - constructor(i){ - super(i),Zt(this,"id",t.nextID++),Zt(this,"bones",null),Zt(this,"vertices",[]),Zt(this,"worldVerticesLength",0),Zt(this,"timelineAttachment",this)} - computeWorldVertices(t,i,s,e,n,h){ - s=n+(s>>1)*h; - let r=t.bone.skeleton,o=t.deform,a=this.vertices,c=this.bones; - if(!c){ - o.length>0&&(a=o); - let r=t.bone,c=r.worldX,l=r.worldY,u=r.a,d=r.b,f=r.c,p=r.d; - for(let t=i,o=n; - o<s; - t+=2,o+=h){ - let i=a[t],s=a[t+1]; - e[o]=i*u+s*d+c,e[o+1]=i*f+s*p+l} - return} - let l=0,u=0; - for(let f=0; - f<i; - f+=2){ - let t=c[l]; - l+=t+1,u+=t} - let d=r.bones; - if(0==o.length)for(let f=n,p=3*u; - f<s; - f+=h){ - let t=0,i=0,s=c[l++]; - for(s+=l; - l<s; - l++,p+=3){ - let s=d[c[l]],e=a[p],n=a[p+1],h=a[p+2]; - t+=(e*s.a+n*s.b+s.worldX)*h,i+=(e*s.c+n*s.d+s.worldY)*h} - e[f]=t,e[f+1]=i} - else{ - let t=o; - for(let i=n,r=3*u,o=u<<1; - i<s; - i+=h){ - let s=0,n=0,h=c[l++]; - for(h+=l; - l<h; - l++,r+=3,o+=2){ - let i=d[c[l]],e=a[r]+t[o],h=a[r+1]+t[o+1],u=a[r+2]; - s+=(e*i.a+h*i.b+i.worldX)*u,n+=(e*i.c+h*i.d+i.worldY)*u} - e[i]=s,e[i+1]=n} - } - } - copyTo(t){ - this.bones?(t.bones=new Array(this.bones.length),HY.arrayCopy(this.bones,0,t.bones,0,this.bones.length)):t.bones=null,this.vertices&&(t.vertices=HY.newFloatArray(this.vertices.length),HY.arrayCopy(this.vertices,0,t.vertices,0,this.vertices.length)),t.worldVerticesLength=this.worldVerticesLength,t.timelineAttachment=this.timelineAttachment} - } - ; - Qt(qY,"VertexAttachment"),Zt(qY,"nextID",0); - let XY=qY; - const JY=class t{ - constructor(i){ - Zt(this,"id",t.nextID()),Zt(this,"regions"),Zt(this,"start",0),Zt(this,"digits",0),Zt(this,"setupIndex",0),this.regions=new Array(i)} - copy(){ - let i=new t(this.regions.length); - return HY.arrayCopy(this.regions,0,i.regions,0,this.regions.length),i.start=this.start,i.digits=this.digits,i.setupIndex=this.setupIndex,i} - apply(t,i){ - let s=t.sequenceIndex; - -1==s&&(s=this.setupIndex),s>=this.regions.length&&(s=this.regions.length-1); - let e=this.regions[s]; - i.region!=e&&(i.region=e,i.updateRegion())} - getPath(t,i){ - let s=t,e=(this.start+i).toString(); - for(let n=this.digits-e.length; - n>0; - n--)s+="0"; - return s+=e,s} - static nextID(){ - return t._nextID++} - } - ; - Qt(JY,"Sequence"),Zt(JY,"_nextID",0); - let QY=JY; - var ZY,tq; - (tq=ZY||(ZY={ - } - ))[tq.hold=0]="hold",tq[tq.once=1]="once",tq[tq.loop=2]="loop",tq[tq.pingpong=3]="pingpong",tq[tq.onceReverse=4]="onceReverse",tq[tq.loopReverse=5]="loopReverse",tq[tq.pingpongReverse=6]="pingpongReverse"; - const iq=[ZY.hold,ZY.once,ZY.loop,ZY.pingpong,ZY.onceReverse,ZY.loopReverse,ZY.pingpongReverse],sq=class{ - constructor(t,i,s){ - if(Zt(this,"name"),Zt(this,"timelines",[]),Zt(this,"timelineIds",new DY),Zt(this,"duration"),!t)throw new Error("name cannot be null."); - this.name=t,this.setTimelines(i),this.duration=s} - setTimelines(t){ - if(!t)throw new Error("timelines cannot be null."); - this.timelines=t,this.timelineIds.clear(); - for(var i=0; - i<t.length; - i++)this.timelineIds.addAll(t[i].getPropertyIds())} - hasTimeline(t){ - for(let i=0; - i<t.length; - i++)if(this.timelineIds.contains(t[i]))return!0; - return!1} - apply(t,i,s,e,n,h,r,o){ - if(!t)throw new Error("skeleton cannot be null."); - e&&0!=this.duration&&(s%=this.duration,i>0&&(i%=this.duration)); - let a=this.timelines; - for(let c=0,l=a.length; - c<l; - c++)a[c].apply(t,i,s,n,h,r,o)} - } - ; - Qt(sq,"Animation"); - let eq=sq; - var nq,hq,rq,oq; - (hq=nq||(nq={ - } - ))[hq.setup=0]="setup",hq[hq.first=1]="first",hq[hq.replace=2]="replace",hq[hq.add=3]="add",(oq=rq||(rq={ - } - ))[oq.mixIn=0]="mixIn",oq[oq.mixOut=1]="mixOut"; - const aq={ - rotate:0,x:1,y:2,scaleX:3,scaleY:4,shearX:5,shearY:6,inherit:7,rgb:8,alpha:9,rgb2:10,attachment:11,deform:12,event:13,drawOrder:14,ikConstraint:15,transformConstraint:16,pathConstraintPosition:17,pathConstraintSpacing:18,pathConstraintMix:19,physicsConstraintInertia:20,physicsConstraintStrength:21,physicsConstraintDamping:22,physicsConstraintMass:23,physicsConstraintWind:24,physicsConstraintGravity:25,physicsConstraintMix:26,physicsConstraintReset:27,sequence:28} - ,cq=class{ - constructor(t,i){ - Zt(this,"propertyIds"),Zt(this,"frames"),this.propertyIds=i,this.frames=HY.newFloatArray(t*this.getFrameEntries())} - getPropertyIds(){ - return this.propertyIds} - getFrameEntries(){ - return 1} - getFrameCount(){ - return this.frames.length/this.getFrameEntries()} - getDuration(){ - return this.frames[this.frames.length-this.getFrameEntries()]} - static search1(t,i){ - let s=t.length; - for(let e=1; - e<s; - e++)if(t[e]>i)return e-1; - return s-1} - static search(t,i,s){ - let e=t.length; - for(let n=s; - n<e; - n+=s)if(t[n]>i)return n-s; - return e-s} - } - ; - Qt(cq,"Timeline"); - let lq=cq; - const uq=class extends lq{ - constructor(t,i,s){ - super(t,s),Zt(this,"curves"),this.curves=HY.newFloatArray(t+18*i),this.curves[t-1]=1} - setLinear(t){ - this.curves[t]=0} - setStepped(t){ - this.curves[t]=1} - shrink(t){ - let i=this.getFrameCount()+18*t; - if(this.curves.length>i){ - let t=HY.newFloatArray(i); - HY.arrayCopy(this.curves,0,t,0,i),this.curves=t} - } - setBezier(t,i,s,e,n,h,r,o,a,c,l){ - let u=this.curves,d=this.getFrameCount()+18*t; - 0==s&&(u[i]=2+d); - let f=.03*(e-2*h+o),p=.03*(n-2*r+a),w=.006*(3*(h-o)-e+c),g=.006*(3*(r-a)-n+l),m=2*f+w,v=2*p+g,_=.3*(h-e)+f+.16666667*w,M=.3*(r-n)+p+.16666667*g,b=e+_,y=n+M; - for(let E=d+18; - d<E; - d+=2)u[d]=b,u[d+1]=y,_+=m,M+=v,m+=w,v+=g,b+=_,y+=M} - getBezierValue(t,i,s,e){ - let n=this.curves; - if(n[e]>t){ - let h=this.frames[i],r=this.frames[i+s]; - return r+(t-h)/(n[e]-h)*(n[e+1]-r)} - let h=e+18; - for(e+=2; - e<h; - e+=2)if(n[e]>=t){ - let i=n[e-2],s=n[e-1]; - return s+(t-i)/(n[e]-i)*(n[e+1]-s)} - i+=this.getFrameEntries(); - let r=n[h-2],o=n[h-1]; - return o+(t-r)/(this.frames[i]-r)*(this.frames[i+s]-o)} - } - ; - Qt(uq,"CurveTimeline"); - let dq=uq; - const fq=class extends dq{ - constructor(t,i,s){ - super(t,i,[s])} - getFrameEntries(){ - return 2} - setFrame(t,i,s){ - t<<=1,this.frames[t]=i,this.frames[t+1]=s} - getCurveValue(t){ - let i=this.frames,s=i.length-2; - for(let n=2; - n<=s; - n+=2)if(i[n]>t){ - s=n-2; - break} - let e=this.curves[s>>1]; - switch(e){ - case 0:let e=i[s],n=i[s+1]; - return n+(t-e)/(i[s+2]-e)*(i[s+2+1]-n); - case 1:return i[s+1]} - return this.getBezierValue(t,s,1,e-2)} - getRelativeValue(t,i,s,e,n){ - if(t<this.frames[0]){ - switch(s){ - case nq.setup:return n; - case nq.first:return e+(n-e)*i} - return e} - let h=this.getCurveValue(t); - switch(s){ - case nq.setup:return n+h*i; - case nq.first:case nq.replace:h+=n-e} - return e+h*i} - getAbsoluteValue(t,i,s,e,n){ - if(t<this.frames[0]){ - switch(s){ - case nq.setup:return n; - case nq.first:return e+(n-e)*i} - return e} - let h=this.getCurveValue(t); - return s==nq.setup?n+(h-n)*i:e+(h-e)*i} - getAbsoluteValue2(t,i,s,e,n,h){ - if(t<this.frames[0]){ - switch(s){ - case nq.setup:return n; - case nq.first:return e+(n-e)*i} - return e} - return s==nq.setup?n+(h-n)*i:e+(h-e)*i} - getScaleValue(t,i,s,e,n,h){ - if(t<this.frames[0]){ - switch(s){ - case nq.setup:return h; - case nq.first:return n+(h-n)*i} - return n} - let r=this.getCurveValue(t)*h; - if(1==i)return s==nq.add?n+r-h:r; - if(e==rq.mixOut)switch(s){ - case nq.setup:return h+(Math.abs(r)*FY.signum(h)-h)*i; - case nq.first:case nq.replace:return n+(Math.abs(r)*FY.signum(n)-n)*i} - else{ - let t=0; - switch(s){ - case nq.setup:return t=Math.abs(h)*FY.signum(r),t+(r-t)*i; - case nq.first:case nq.replace:return t=Math.abs(n)*FY.signum(r),t+(r-t)*i} - } - return n+(r-h)*i} - } - ; - Qt(fq,"CurveTimeline1"); - let pq=fq; - const wq=class extends dq{ - constructor(t,i,s,e){ - super(t,i,[s,e])} - getFrameEntries(){ - return 3} - setFrame(t,i,s,e){ - t*=3,this.frames[t]=i,this.frames[t+1]=s,this.frames[t+2]=e} - } - ; - Qt(wq,"CurveTimeline2"); - let gq=wq; - const mq=class extends pq{ - constructor(t,i,s){ - super(t,i,aq.rotate+"|"+s),Zt(this,"boneIndex",0),this.boneIndex=s} - apply(t,i,s,e,n,h,r){ - let o=t.bones[this.boneIndex]; - o.active&&(o.rotation=this.getRelativeValue(s,n,h,o.rotation,o.data.rotation))} - } - ; - Qt(mq,"RotateTimeline"); - let vq=mq; - const _q=class extends gq{ - constructor(t,i,s){ - super(t,i,aq.x+"|"+s,aq.y+"|"+s),Zt(this,"boneIndex",0),this.boneIndex=s} - apply(t,i,s,e,n,h,r){ - let o=t.bones[this.boneIndex]; - if(!o.active)return; - let a=this.frames; - if(s<a[0]){ - switch(h){ - case nq.setup:return o.x=o.data.x,void(o.y=o.data.y); - case nq.first:o.x+=(o.data.x-o.x)*n,o.y+=(o.data.y-o.y)*n} - return} - let c=0,l=0,u=lq.search(a,s,3),d=this.curves[u/3]; - switch(d){ - case 0:let t=a[u]; - c=a[u+1],l=a[u+2]; - let i=(s-t)/(a[u+3]-t); - c+=(a[u+3+1]-c)*i,l+=(a[u+3+2]-l)*i; - break; - case 1:c=a[u+1],l=a[u+2]; - break; - default:c=this.getBezierValue(s,u,1,d-2),l=this.getBezierValue(s,u,2,d+18-2)} - switch(h){ - case nq.setup:o.x=o.data.x+c*n,o.y=o.data.y+l*n; - break; - case nq.first:case nq.replace:o.x+=(o.data.x+c-o.x)*n,o.y+=(o.data.y+l-o.y)*n; - break; - case nq.add:o.x+=c*n,o.y+=l*n} - } - } - ; - Qt(_q,"TranslateTimeline"); - let Mq=_q; - const bq=class extends pq{ - constructor(t,i,s){ - super(t,i,aq.x+"|"+s),Zt(this,"boneIndex",0),this.boneIndex=s} - apply(t,i,s,e,n,h,r){ - let o=t.bones[this.boneIndex]; - o.active&&(o.x=this.getRelativeValue(s,n,h,o.x,o.data.x))} - } - ; - Qt(bq,"TranslateXTimeline"); - let yq=bq; - const Eq=class extends pq{ - constructor(t,i,s){ - super(t,i,aq.y+"|"+s),Zt(this,"boneIndex",0),this.boneIndex=s} - apply(t,i,s,e,n,h,r){ - let o=t.bones[this.boneIndex]; - o.active&&(o.y=this.getRelativeValue(s,n,h,o.y,o.data.y))} - } - ; - Qt(Eq,"TranslateYTimeline"); - let Aq=Eq; - const Sq=class extends gq{ - constructor(t,i,s){ - super(t,i,aq.scaleX+"|"+s,aq.scaleY+"|"+s),Zt(this,"boneIndex",0),this.boneIndex=s} - apply(t,i,s,e,n,h,r){ - let o=t.bones[this.boneIndex]; - if(!o.active)return; - let a,c,l=this.frames; - if(s<l[0]){ - switch(h){ - case nq.setup:return o.scaleX=o.data.scaleX,void(o.scaleY=o.data.scaleY); - case nq.first:o.scaleX+=(o.data.scaleX-o.scaleX)*n,o.scaleY+=(o.data.scaleY-o.scaleY)*n} - return} - let u=lq.search(l,s,3),d=this.curves[u/3]; - switch(d){ - case 0:let t=l[u]; - a=l[u+1],c=l[u+2]; - let i=(s-t)/(l[u+3]-t); - a+=(l[u+3+1]-a)*i,c+=(l[u+3+2]-c)*i; - break; - case 1:a=l[u+1],c=l[u+2]; - break; - default:a=this.getBezierValue(s,u,1,d-2),c=this.getBezierValue(s,u,2,d+18-2)} - if(a*=o.data.scaleX,c*=o.data.scaleY,1==n)h==nq.add?(o.scaleX+=a-o.data.scaleX,o.scaleY+=c-o.data.scaleY):(o.scaleX=a,o.scaleY=c); - else{ - let t=0,i=0; - if(r==rq.mixOut)switch(h){ - case nq.setup:t=o.data.scaleX,i=o.data.scaleY,o.scaleX=t+(Math.abs(a)*FY.signum(t)-t)*n,o.scaleY=i+(Math.abs(c)*FY.signum(i)-i)*n; - break; - case nq.first:case nq.replace:t=o.scaleX,i=o.scaleY,o.scaleX=t+(Math.abs(a)*FY.signum(t)-t)*n,o.scaleY=i+(Math.abs(c)*FY.signum(i)-i)*n; - break; - case nq.add:o.scaleX+=(a-o.data.scaleX)*n,o.scaleY+=(c-o.data.scaleY)*n} - else switch(h){ - case nq.setup:t=Math.abs(o.data.scaleX)*FY.signum(a),i=Math.abs(o.data.scaleY)*FY.signum(c),o.scaleX=t+(a-t)*n,o.scaleY=i+(c-i)*n; - break; - case nq.first:case nq.replace:t=Math.abs(o.scaleX)*FY.signum(a),i=Math.abs(o.scaleY)*FY.signum(c),o.scaleX=t+(a-t)*n,o.scaleY=i+(c-i)*n; - break; - case nq.add:o.scaleX+=(a-o.data.scaleX)*n,o.scaleY+=(c-o.data.scaleY)*n} - } - } - } - ; - Qt(Sq,"ScaleTimeline"); - let Tq=Sq; - const Cq=class extends pq{ - constructor(t,i,s){ - super(t,i,aq.scaleX+"|"+s),Zt(this,"boneIndex",0),this.boneIndex=s} - apply(t,i,s,e,n,h,r){ - let o=t.bones[this.boneIndex]; - o.active&&(o.scaleX=this.getScaleValue(s,n,h,r,o.scaleX,o.data.scaleX))} - } - ; - Qt(Cq,"ScaleXTimeline"); - let Oq=Cq; - const Iq=class extends pq{ - constructor(t,i,s){ - super(t,i,aq.scaleY+"|"+s),Zt(this,"boneIndex",0),this.boneIndex=s} - apply(t,i,s,e,n,h,r){ - let o=t.bones[this.boneIndex]; - o.active&&(o.scaleY=this.getScaleValue(s,n,h,r,o.scaleY,o.data.scaleY))} - } - ; - Qt(Iq,"ScaleYTimeline"); - let kq=Iq; - const xq=class extends gq{ - constructor(t,i,s){ - super(t,i,aq.shearX+"|"+s,aq.shearY+"|"+s),Zt(this,"boneIndex",0),this.boneIndex=s} - apply(t,i,s,e,n,h,r){ - let o=t.bones[this.boneIndex]; - if(!o.active)return; - let a=this.frames; - if(s<a[0]){ - switch(h){ - case nq.setup:return o.shearX=o.data.shearX,void(o.shearY=o.data.shearY); - case nq.first:o.shearX+=(o.data.shearX-o.shearX)*n,o.shearY+=(o.data.shearY-o.shearY)*n} - return} - let c=0,l=0,u=lq.search(a,s,3),d=this.curves[u/3]; - switch(d){ - case 0:let t=a[u]; - c=a[u+1],l=a[u+2]; - let i=(s-t)/(a[u+3]-t); - c+=(a[u+3+1]-c)*i,l+=(a[u+3+2]-l)*i; - break; - case 1:c=a[u+1],l=a[u+2]; - break; - default:c=this.getBezierValue(s,u,1,d-2),l=this.getBezierValue(s,u,2,d+18-2)} - switch(h){ - case nq.setup:o.shearX=o.data.shearX+c*n,o.shearY=o.data.shearY+l*n; - break; - case nq.first:case nq.replace:o.shearX+=(o.data.shearX+c-o.shearX)*n,o.shearY+=(o.data.shearY+l-o.shearY)*n; - break; - case nq.add:o.shearX+=c*n,o.shearY+=l*n} - } - } - ; - Qt(xq,"ShearTimeline"); - let Rq=xq; - const Pq=class extends pq{ - constructor(t,i,s){ - super(t,i,aq.shearX+"|"+s),Zt(this,"boneIndex",0),this.boneIndex=s} - apply(t,i,s,e,n,h,r){ - let o=t.bones[this.boneIndex]; - o.active&&(o.shearX=this.getRelativeValue(s,n,h,o.shearX,o.data.shearX))} - } - ; - Qt(Pq,"ShearXTimeline"); - let Nq=Pq; - const Lq=class extends pq{ - constructor(t,i,s){ - super(t,i,aq.shearY+"|"+s),Zt(this,"boneIndex",0),this.boneIndex=s} - apply(t,i,s,e,n,h,r){ - let o=t.bones[this.boneIndex]; - o.active&&(o.shearY=this.getRelativeValue(s,n,h,o.shearY,o.data.shearY))} - } - ; - Qt(Lq,"ShearYTimeline"); - let Dq=Lq; - const Gq=class extends lq{ - constructor(t,i){ - super(t,[aq.inherit+"|"+i]),Zt(this,"boneIndex",0),this.boneIndex=i} - getFrameEntries(){ - return 2} - setFrame(t,i,s){ - t*=2,this.frames[t]=i,this.frames[t+1]=s} - apply(t,i,s,e,n,h,r){ - let o=t.bones[this.boneIndex]; - if(!o.active)return; - if(r==rq.mixOut)return void(h==nq.setup&&(o.inherit=o.data.inherit)); - let a=this.frames; - s<a[0]?h!=nq.setup&&h!=nq.first||(o.inherit=o.data.inherit):o.inherit=this.frames[lq.search(a,s,2)+1]} - } - ; - Qt(Gq,"InheritTimeline"); - let Bq=Gq; - const Uq=class extends dq{ - constructor(t,i,s){ - super(t,i,[aq.rgb+"|"+s,aq.alpha+"|"+s]),Zt(this,"slotIndex",0),this.slotIndex=s} - getFrameEntries(){ - return 5} - setFrame(t,i,s,e,n,h){ - t*=5,this.frames[t]=i,this.frames[t+1]=s,this.frames[t+2]=e,this.frames[t+3]=n,this.frames[t+4]=h} - apply(t,i,s,e,n,h,r){ - let o=t.slots[this.slotIndex]; - if(!o.bone.active)return; - let a=this.frames,c=o.color; - if(s<a[0]){ - let t=o.data.color; - switch(h){ - case nq.setup:return void c.setFromColor(t); - case nq.first:c.add((t.r-c.r)*n,(t.g-c.g)*n,(t.b-c.b)*n,(t.a-c.a)*n)} - return} - let l=0,u=0,d=0,f=0,p=lq.search(a,s,5),w=this.curves[p/5]; - switch(w){ - case 0:let t=a[p]; - l=a[p+1],u=a[p+2],d=a[p+3],f=a[p+4]; - let i=(s-t)/(a[p+5]-t); - l+=(a[p+5+1]-l)*i,u+=(a[p+5+2]-u)*i,d+=(a[p+5+3]-d)*i,f+=(a[p+5+4]-f)*i; - break; - case 1:l=a[p+1],u=a[p+2],d=a[p+3],f=a[p+4]; - break; - default:l=this.getBezierValue(s,p,1,w-2),u=this.getBezierValue(s,p,2,w+18-2),d=this.getBezierValue(s,p,3,w+36-2),f=this.getBezierValue(s,p,4,w+54-2)} - 1==n?c.set(l,u,d,f):(h==nq.setup&&c.setFromColor(o.data.color),c.add((l-c.r)*n,(u-c.g)*n,(d-c.b)*n,(f-c.a)*n))} - } - ; - Qt(Uq,"RGBATimeline"); - let Fq=Uq; - const $q=class extends dq{ - constructor(t,i,s){ - super(t,i,[aq.rgb+"|"+s]),Zt(this,"slotIndex",0),this.slotIndex=s} - getFrameEntries(){ - return 4} - setFrame(t,i,s,e,n){ - t<<=2,this.frames[t]=i,this.frames[t+1]=s,this.frames[t+2]=e,this.frames[t+3]=n} - apply(t,i,s,e,n,h,r){ - let o=t.slots[this.slotIndex]; - if(!o.bone.active)return; - let a=this.frames,c=o.color; - if(s<a[0]){ - let t=o.data.color; - switch(h){ - case nq.setup:return c.r=t.r,c.g=t.g,void(c.b=t.b); - case nq.first:c.r+=(t.r-c.r)*n,c.g+=(t.g-c.g)*n,c.b+=(t.b-c.b)*n} - return} - let l=0,u=0,d=0,f=lq.search(a,s,4),p=this.curves[f>>2]; - switch(p){ - case 0:let t=a[f]; - l=a[f+1],u=a[f+2],d=a[f+3]; - let i=(s-t)/(a[f+4]-t); - l+=(a[f+4+1]-l)*i,u+=(a[f+4+2]-u)*i,d+=(a[f+4+3]-d)*i; - break; - case 1:l=a[f+1],u=a[f+2],d=a[f+3]; - break; - default:l=this.getBezierValue(s,f,1,p-2),u=this.getBezierValue(s,f,2,p+18-2),d=this.getBezierValue(s,f,3,p+36-2)} - if(1==n)c.r=l,c.g=u,c.b=d; - else{ - if(h==nq.setup){ - let t=o.data.color; - c.r=t.r,c.g=t.g,c.b=t.b} - c.r+=(l-c.r)*n,c.g+=(u-c.g)*n,c.b+=(d-c.b)*n} - } - } - ; - Qt($q,"RGBTimeline"); - let Hq=$q; - const Wq=class extends pq{ - constructor(t,i,s){ - super(t,i,aq.alpha+"|"+s),Zt(this,"slotIndex",0),this.slotIndex=s} - apply(t,i,s,e,n,h,r){ - let o=t.slots[this.slotIndex]; - if(!o.bone.active)return; - let a=o.color; - if(s<this.frames[0]){ - let t=o.data.color; - switch(h){ - case nq.setup:return void(a.a=t.a); - case nq.first:a.a+=(t.a-a.a)*n} - return} - let c=this.getCurveValue(s); - 1==n?a.a=c:(h==nq.setup&&(a.a=o.data.color.a),a.a+=(c-a.a)*n)} - } - ; - Qt(Wq,"AlphaTimeline"); - let Vq=Wq; - const jq=class extends dq{ - constructor(t,i,s){ - super(t,i,[aq.rgb+"|"+s,aq.alpha+"|"+s,aq.rgb2+"|"+s]),Zt(this,"slotIndex",0),this.slotIndex=s} - getFrameEntries(){ - return 8} - setFrame(t,i,s,e,n,h,r,o,a){ - t<<=3,this.frames[t]=i,this.frames[t+1]=s,this.frames[t+2]=e,this.frames[t+3]=n,this.frames[t+4]=h,this.frames[t+5]=r,this.frames[t+6]=o,this.frames[t+7]=a} - apply(t,i,s,e,n,h,r){ - let o=t.slots[this.slotIndex]; - if(!o.bone.active)return; - let a=this.frames,c=o.color,l=o.darkColor; - if(s<a[0]){ - let t=o.data.color,i=o.data.darkColor; - switch(h){ - case nq.setup:return c.setFromColor(t),l.r=i.r,l.g=i.g,void(l.b=i.b); - case nq.first:c.add((t.r-c.r)*n,(t.g-c.g)*n,(t.b-c.b)*n,(t.a-c.a)*n),l.r+=(i.r-l.r)*n,l.g+=(i.g-l.g)*n,l.b+=(i.b-l.b)*n} - return} - let u=0,d=0,f=0,p=0,w=0,g=0,m=0,v=lq.search(a,s,8),_=this.curves[v>>3]; - switch(_){ - case 0:let t=a[v]; - u=a[v+1],d=a[v+2],f=a[v+3],p=a[v+4],w=a[v+5],g=a[v+6],m=a[v+7]; - let i=(s-t)/(a[v+8]-t); - u+=(a[v+8+1]-u)*i,d+=(a[v+8+2]-d)*i,f+=(a[v+8+3]-f)*i,p+=(a[v+8+4]-p)*i,w+=(a[v+8+5]-w)*i,g+=(a[v+8+6]-g)*i,m+=(a[v+8+7]-m)*i; - break; - case 1:u=a[v+1],d=a[v+2],f=a[v+3],p=a[v+4],w=a[v+5],g=a[v+6],m=a[v+7]; - break; - default:u=this.getBezierValue(s,v,1,_-2),d=this.getBezierValue(s,v,2,_+18-2),f=this.getBezierValue(s,v,3,_+36-2),p=this.getBezierValue(s,v,4,_+54-2),w=this.getBezierValue(s,v,5,_+72-2),g=this.getBezierValue(s,v,6,_+90-2),m=this.getBezierValue(s,v,7,_+108-2)} - if(1==n)c.set(u,d,f,p),l.r=w,l.g=g,l.b=m; - else{ - if(h==nq.setup){ - c.setFromColor(o.data.color); - let t=o.data.darkColor; - l.r=t.r,l.g=t.g,l.b=t.b} - c.add((u-c.r)*n,(d-c.g)*n,(f-c.b)*n,(p-c.a)*n),l.r+=(w-l.r)*n,l.g+=(g-l.g)*n,l.b+=(m-l.b)*n} - } - } - ; - Qt(jq,"RGBA2Timeline"); - let Kq=jq; - const zq=class extends dq{ - constructor(t,i,s){ - super(t,i,[aq.rgb+"|"+s,aq.rgb2+"|"+s]),Zt(this,"slotIndex",0),this.slotIndex=s} - getFrameEntries(){ - return 7} - setFrame(t,i,s,e,n,h,r,o){ - t*=7,this.frames[t]=i,this.frames[t+1]=s,this.frames[t+2]=e,this.frames[t+3]=n,this.frames[t+4]=h,this.frames[t+5]=r,this.frames[t+6]=o} - apply(t,i,s,e,n,h,r){ - let o=t.slots[this.slotIndex]; - if(!o.bone.active)return; - let a=this.frames,c=o.color,l=o.darkColor; - if(s<a[0]){ - let t=o.data.color,i=o.data.darkColor; - switch(h){ - case nq.setup:return c.r=t.r,c.g=t.g,c.b=t.b,l.r=i.r,l.g=i.g,void(l.b=i.b); - case nq.first:c.r+=(t.r-c.r)*n,c.g+=(t.g-c.g)*n,c.b+=(t.b-c.b)*n,l.r+=(i.r-l.r)*n,l.g+=(i.g-l.g)*n,l.b+=(i.b-l.b)*n} - return} - let u=0,d=0,f=0,p=0,w=0,g=0,m=lq.search(a,s,7),v=this.curves[m/7]; - switch(v){ - case 0:let t=a[m]; - u=a[m+1],d=a[m+2],f=a[m+3],p=a[m+4],w=a[m+5],g=a[m+6]; - let i=(s-t)/(a[m+7]-t); - u+=(a[m+7+1]-u)*i,d+=(a[m+7+2]-d)*i,f+=(a[m+7+3]-f)*i,p+=(a[m+7+4]-p)*i,w+=(a[m+7+5]-w)*i,g+=(a[m+7+6]-g)*i; - break; - case 1:u=a[m+1],d=a[m+2],f=a[m+3],p=a[m+4],w=a[m+5],g=a[m+6]; - break; - default:u=this.getBezierValue(s,m,1,v-2),d=this.getBezierValue(s,m,2,v+18-2),f=this.getBezierValue(s,m,3,v+36-2),p=this.getBezierValue(s,m,4,v+54-2),w=this.getBezierValue(s,m,5,v+72-2),g=this.getBezierValue(s,m,6,v+90-2)} - if(1==n)c.r=u,c.g=d,c.b=f,l.r=p,l.g=w,l.b=g; - else{ - if(h==nq.setup){ - let t=o.data.color,i=o.data.darkColor; - c.r=t.r,c.g=t.g,c.b=t.b,l.r=i.r,l.g=i.g,l.b=i.b} - c.r+=(u-c.r)*n,c.g+=(d-c.g)*n,c.b+=(f-c.b)*n,l.r+=(p-l.r)*n,l.g+=(w-l.g)*n,l.b+=(g-l.b)*n} - } - } - ; - Qt(zq,"RGB2Timeline"); - let Yq=zq; - const qq=class extends lq{ - constructor(t,i){ - super(t,[aq.attachment+"|"+i]),Zt(this,"slotIndex",0),Zt(this,"attachmentNames"),this.slotIndex=i,this.attachmentNames=new Array(t)} - getFrameCount(){ - return this.frames.length} - setFrame(t,i,s){ - this.frames[t]=i,this.attachmentNames[t]=s} - apply(t,i,s,e,n,h,r){ - let o=t.slots[this.slotIndex]; - o.bone.active&&(r!=rq.mixOut?s<this.frames[0]?h!=nq.setup&&h!=nq.first||this.setAttachment(t,o,o.data.attachmentName):this.setAttachment(t,o,this.attachmentNames[lq.search1(this.frames,s)]):h==nq.setup&&this.setAttachment(t,o,o.data.attachmentName))} - setAttachment(t,i,s){ - i.setAttachment(s?t.getAttachment(this.slotIndex,s):null)} - } - ; - Qt(qq,"AttachmentTimeline"); - let Xq=qq; - const Jq=class extends dq{ - constructor(t,i,s,e){ - super(t,i,[aq.deform+"|"+s+"|"+e.id]),Zt(this,"slotIndex",0),Zt(this,"attachment"),Zt(this,"vertices"),this.slotIndex=s,this.attachment=e,this.vertices=new Array(t)} - getFrameCount(){ - return this.frames.length} - setFrame(t,i,s){ - this.frames[t]=i,this.vertices[t]=s} - setBezier(t,i,s,e,n,h,r,o,a,c,l){ - let u=this.curves,d=this.getFrameCount()+18*t; - 0==s&&(u[i]=2+d); - let f=.03*(e-2*h+o),p=.03*a-.06*r,w=.006*(3*(h-o)-e+c),g=.018*(r-a+.33333333),m=2*f+w,v=2*p+g,_=.3*(h-e)+f+.16666667*w,M=.3*r+p+.16666667*g,b=e+_,y=M; - for(let E=d+18; - d<E; - d+=2)u[d]=b,u[d+1]=y,_+=m,M+=v,m+=w,v+=g,b+=_,y+=M} - getCurvePercent(t,i){ - let s=this.curves,e=s[i]; - switch(e){ - case 0:let s=this.frames[i]; - return(t-s)/(this.frames[i+this.getFrameEntries()]-s); - case 1:return 0} - if(e-=2,s[e]>t){ - let n=this.frames[i]; - return s[e+1]*(t-n)/(s[e]-n)} - let n=e+18; - for(e+=2; - e<n; - e+=2)if(s[e]>=t){ - let i=s[e-2],n=s[e-1]; - return n+(t-i)/(s[e]-i)*(s[e+1]-n)} - let h=s[n-2],r=s[n-1]; - return r+(1-r)*(t-h)/(this.frames[i+this.getFrameEntries()]-h)} - apply(t,i,s,e,n,h,r){ - let o=t.slots[this.slotIndex]; - if(!o.bone.active)return; - let a=o.getAttachment(); - if(!a)return; - if(!(a instanceof XY)||a.timelineAttachment!=this.attachment)return; - let c=o.deform; - 0==c.length&&(h=nq.setup); - let l=this.vertices,u=l[0].length,d=this.frames; - if(s<d[0]){ - switch(h){ - case nq.setup:return void(c.length=0); - case nq.first:if(1==n)return void(c.length=0); - c.length=u; - let t=a; - if(t.bones)for(n=1-n,f=0; - f<u; - f++)c[f]*=n; - else{ - let i=t.vertices; - for(var f=0; - f<u; - f++)c[f]+=(i[f]-c[f])*n} - } - return} - if(c.length=u,s>=d[d.length-1]){ - let t=l[d.length-1]; - if(1==n)if(h==nq.add){ - let i=a; - if(i.bones)for(let s=0; - s<u; - s++)c[s]+=t[s]; - else{ - let s=i.vertices; - for(let i=0; - i<u; - i++)c[i]+=t[i]-s[i]} - } - else HY.arrayCopy(t,0,c,0,u); - else switch(h){ - case nq.setup:{ - let i=a; - if(i.bones)for(let s=0; - s<u; - s++)c[s]=t[s]*n; - else{ - let s=i.vertices; - for(let i=0; - i<u; - i++){ - let e=s[i]; - c[i]=e+(t[i]-e)*n} - } - break} - case nq.first:case nq.replace:for(let s=0; - s<u; - s++)c[s]+=(t[s]-c[s])*n; - break; - case nq.add:let i=a; - if(i.bones)for(let s=0; - s<u; - s++)c[s]+=t[s]*n; - else{ - let s=i.vertices; - for(let i=0; - i<u; - i++)c[i]+=(t[i]-s[i])*n} - } - return} - let p=lq.search1(d,s),w=this.getCurvePercent(s,p),g=l[p],m=l[p+1]; - if(1==n)if(h==nq.add){ - let t=a; - if(t.bones)for(let i=0; - i<u; - i++){ - let t=g[i]; - c[i]+=t+(m[i]-t)*w} - else{ - let i=t.vertices; - for(let t=0; - t<u; - t++){ - let s=g[t]; - c[t]+=s+(m[t]-s)*w-i[t]} - } - } - else for(let v=0; - v<u; - v++){ - let t=g[v]; - c[v]=t+(m[v]-t)*w} - else switch(h){ - case nq.setup:{ - let t=a; - if(t.bones)for(let i=0; - i<u; - i++){ - let t=g[i]; - c[i]=(t+(m[i]-t)*w)*n} - else{ - let i=t.vertices; - for(let t=0; - t<u; - t++){ - let s=g[t],e=i[t]; - c[t]=e+(s+(m[t]-s)*w-e)*n} - } - break} - case nq.first:case nq.replace:for(let i=0; - i<u; - i++){ - let t=g[i]; - c[i]+=(t+(m[i]-t)*w-c[i])*n} - break; - case nq.add:let t=a; - if(t.bones)for(let i=0; - i<u; - i++){ - let t=g[i]; - c[i]+=(t+(m[i]-t)*w)*n} - else{ - let i=t.vertices; - for(let t=0; - t<u; - t++){ - let s=g[t]; - c[t]+=(s+(m[t]-s)*w-i[t])*n} - } - } - } - } - ; - Qt(Jq,"DeformTimeline"); - let Qq=Jq; - const Zq=class t extends lq{ - constructor(i){ - super(i,t.propertyIds),Zt(this,"events"),this.events=new Array(i)} - getFrameCount(){ - return this.frames.length} - setFrame(t,i){ - this.frames[t]=i.time,this.events[t]=i} - apply(t,i,s,e,n,h,r){ - if(!e)return; - let o=this.frames,a=this.frames.length; - if(i>s)this.apply(t,i,Number.MAX_VALUE,e,n,h,r),i=-1; - else if(i>=o[a-1])return; - if(s<o[0])return; - let c=0; - if(i<o[0])c=0; - else{ - c=lq.search1(o,i)+1; - let t=o[c]; - for(; - c>0&&o[c-1]==t; - )c--} - for(; - c<a&&s>=o[c]; - c++)e.push(this.events[c])} - } - ; - Qt(Zq,"EventTimeline"),Zt(Zq,"propertyIds",[""+aq.event]); - let tX=Zq; - const iX=class t extends lq{ - constructor(i){ - super(i,t.propertyIds),Zt(this,"drawOrders"),this.drawOrders=new Array(i)} - getFrameCount(){ - return this.frames.length} - setFrame(t,i,s){ - this.frames[t]=i,this.drawOrders[t]=s} - apply(t,i,s,e,n,h,r){ - if(r==rq.mixOut)return void(h==nq.setup&&HY.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length)); - if(s<this.frames[0])return void(h!=nq.setup&&h!=nq.first||HY.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length)); - let o=lq.search1(this.frames,s),a=this.drawOrders[o]; - if(a){ - let i=t.drawOrder,s=t.slots; - for(let t=0,e=a.length; - t<e; - t++)i[t]=s[a[t]]} - else HY.arrayCopy(t.slots,0,t.drawOrder,0,t.slots.length)} - } - ; - Qt(iX,"DrawOrderTimeline"),Zt(iX,"propertyIds",[""+aq.drawOrder]); - let sX=iX; - const eX=class extends dq{ - constructor(t,i,s){ - super(t,i,[aq.ikConstraint+"|"+s]),Zt(this,"constraintIndex",0),this.constraintIndex=s} - getFrameEntries(){ - return 6} - setFrame(t,i,s,e,n,h,r){ - t*=6,this.frames[t]=i,this.frames[t+1]=s,this.frames[t+2]=e,this.frames[t+3]=n,this.frames[t+4]=h?1:0,this.frames[t+5]=r?1:0} - apply(t,i,s,e,n,h,r){ - let o=t.ikConstraints[this.constraintIndex]; - if(!o.active)return; - let a=this.frames; - if(s<a[0]){ - switch(h){ - case nq.setup:return o.mix=o.data.mix,o.softness=o.data.softness,o.bendDirection=o.data.bendDirection,o.compress=o.data.compress,void(o.stretch=o.data.stretch); - case nq.first:o.mix+=(o.data.mix-o.mix)*n,o.softness+=(o.data.softness-o.softness)*n,o.bendDirection=o.data.bendDirection,o.compress=o.data.compress,o.stretch=o.data.stretch} - return} - let c=0,l=0,u=lq.search(a,s,6),d=this.curves[u/6]; - switch(d){ - case 0:let t=a[u]; - c=a[u+1],l=a[u+2]; - let i=(s-t)/(a[u+6]-t); - c+=(a[u+6+1]-c)*i,l+=(a[u+6+2]-l)*i; - break; - case 1:c=a[u+1],l=a[u+2]; - break; - default:c=this.getBezierValue(s,u,1,d-2),l=this.getBezierValue(s,u,2,d+18-2)} - h==nq.setup?(o.mix=o.data.mix+(c-o.data.mix)*n,o.softness=o.data.softness+(l-o.data.softness)*n,r==rq.mixOut?(o.bendDirection=o.data.bendDirection,o.compress=o.data.compress,o.stretch=o.data.stretch):(o.bendDirection=a[u+3],o.compress=0!=a[u+4],o.stretch=0!=a[u+5])):(o.mix+=(c-o.mix)*n,o.softness+=(l-o.softness)*n,r==rq.mixIn&&(o.bendDirection=a[u+3],o.compress=0!=a[u+4],o.stretch=0!=a[u+5]))} - } - ; - Qt(eX,"IkConstraintTimeline"); - let nX=eX; - const hX=class extends dq{ - constructor(t,i,s){ - super(t,i,[aq.transformConstraint+"|"+s]),Zt(this,"constraintIndex",0),this.constraintIndex=s} - getFrameEntries(){ - return 7} - setFrame(t,i,s,e,n,h,r,o){ - let a=this.frames; - a[t*=7]=i,a[t+1]=s,a[t+2]=e,a[t+3]=n,a[t+4]=h,a[t+5]=r,a[t+6]=o} - apply(t,i,s,e,n,h,r){ - let o=t.transformConstraints[this.constraintIndex]; - if(!o.active)return; - let a,c,l,u,d,f,p=this.frames; - if(s<p[0]){ - let t=o.data; - switch(h){ - case nq.setup:return o.mixRotate=t.mixRotate,o.mixX=t.mixX,o.mixY=t.mixY,o.mixScaleX=t.mixScaleX,o.mixScaleY=t.mixScaleY,void(o.mixShearY=t.mixShearY); - case nq.first:o.mixRotate+=(t.mixRotate-o.mixRotate)*n,o.mixX+=(t.mixX-o.mixX)*n,o.mixY+=(t.mixY-o.mixY)*n,o.mixScaleX+=(t.mixScaleX-o.mixScaleX)*n,o.mixScaleY+=(t.mixScaleY-o.mixScaleY)*n,o.mixShearY+=(t.mixShearY-o.mixShearY)*n} - return} - let w=lq.search(p,s,7),g=this.curves[w/7]; - switch(g){ - case 0:let t=p[w]; - a=p[w+1],c=p[w+2],l=p[w+3],u=p[w+4],d=p[w+5],f=p[w+6]; - let i=(s-t)/(p[w+7]-t); - a+=(p[w+7+1]-a)*i,c+=(p[w+7+2]-c)*i,l+=(p[w+7+3]-l)*i,u+=(p[w+7+4]-u)*i,d+=(p[w+7+5]-d)*i,f+=(p[w+7+6]-f)*i; - break; - case 1:a=p[w+1],c=p[w+2],l=p[w+3],u=p[w+4],d=p[w+5],f=p[w+6]; - break; - default:a=this.getBezierValue(s,w,1,g-2),c=this.getBezierValue(s,w,2,g+18-2),l=this.getBezierValue(s,w,3,g+36-2),u=this.getBezierValue(s,w,4,g+54-2),d=this.getBezierValue(s,w,5,g+72-2),f=this.getBezierValue(s,w,6,g+90-2)} - if(h==nq.setup){ - let t=o.data; - o.mixRotate=t.mixRotate+(a-t.mixRotate)*n,o.mixX=t.mixX+(c-t.mixX)*n,o.mixY=t.mixY+(l-t.mixY)*n,o.mixScaleX=t.mixScaleX+(u-t.mixScaleX)*n,o.mixScaleY=t.mixScaleY+(d-t.mixScaleY)*n,o.mixShearY=t.mixShearY+(f-t.mixShearY)*n} - else o.mixRotate+=(a-o.mixRotate)*n,o.mixX+=(c-o.mixX)*n,o.mixY+=(l-o.mixY)*n,o.mixScaleX+=(u-o.mixScaleX)*n,o.mixScaleY+=(d-o.mixScaleY)*n,o.mixShearY+=(f-o.mixShearY)*n} - } - ; - Qt(hX,"TransformConstraintTimeline"); - let rX=hX; - const oX=class extends pq{ - constructor(t,i,s){ - super(t,i,aq.pathConstraintPosition+"|"+s),Zt(this,"constraintIndex",0),this.constraintIndex=s} - apply(t,i,s,e,n,h,r){ - let o=t.pathConstraints[this.constraintIndex]; - o.active&&(o.position=this.getAbsoluteValue(s,n,h,o.position,o.data.position))} - } - ; - Qt(oX,"PathConstraintPositionTimeline"); - let aX=oX; - const cX=class extends pq{ - constructor(t,i,s){ - super(t,i,aq.pathConstraintSpacing+"|"+s),Zt(this,"constraintIndex",0),this.constraintIndex=s} - apply(t,i,s,e,n,h,r){ - let o=t.pathConstraints[this.constraintIndex]; - o.active&&(o.spacing=this.getAbsoluteValue(s,n,h,o.spacing,o.data.spacing))} - } - ; - Qt(cX,"PathConstraintSpacingTimeline"); - let lX=cX; - const uX=class extends dq{ - constructor(t,i,s){ - super(t,i,[aq.pathConstraintMix+"|"+s]),Zt(this,"constraintIndex",0),this.constraintIndex=s} - getFrameEntries(){ - return 4} - setFrame(t,i,s,e,n){ - let h=this.frames; - h[t<<=2]=i,h[t+1]=s,h[t+2]=e,h[t+3]=n} - apply(t,i,s,e,n,h,r){ - let o=t.pathConstraints[this.constraintIndex]; - if(!o.active)return; - let a,c,l,u=this.frames; - if(s<u[0]){ - switch(h){ - case nq.setup:return o.mixRotate=o.data.mixRotate,o.mixX=o.data.mixX,void(o.mixY=o.data.mixY); - case nq.first:o.mixRotate+=(o.data.mixRotate-o.mixRotate)*n,o.mixX+=(o.data.mixX-o.mixX)*n,o.mixY+=(o.data.mixY-o.mixY)*n} - return} - let d=lq.search(u,s,4),f=this.curves[d>>2]; - switch(f){ - case 0:let t=u[d]; - a=u[d+1],c=u[d+2],l=u[d+3]; - let i=(s-t)/(u[d+4]-t); - a+=(u[d+4+1]-a)*i,c+=(u[d+4+2]-c)*i,l+=(u[d+4+3]-l)*i; - break; - case 1:a=u[d+1],c=u[d+2],l=u[d+3]; - break; - default:a=this.getBezierValue(s,d,1,f-2),c=this.getBezierValue(s,d,2,f+18-2),l=this.getBezierValue(s,d,3,f+36-2)} - if(h==nq.setup){ - let t=o.data; - o.mixRotate=t.mixRotate+(a-t.mixRotate)*n,o.mixX=t.mixX+(c-t.mixX)*n,o.mixY=t.mixY+(l-t.mixY)*n} - else o.mixRotate+=(a-o.mixRotate)*n,o.mixX+=(c-o.mixX)*n,o.mixY+=(l-o.mixY)*n} - } - ; - Qt(uX,"PathConstraintMixTimeline"); - let dX=uX; - const fX=class extends pq{ - constructor(t,i,s,e){ - super(t,i,e+"|"+s),Zt(this,"constraintIndex",0),this.constraintIndex=s} - apply(t,i,s,e,n,h,r){ - let o; - if(-1==this.constraintIndex){ - const i=s>=this.frames[0]?this.getCurveValue(s):0; - for(const e of t.physicsConstraints)e.active&&this.global(e.data)&&this.set(e,this.getAbsoluteValue2(s,n,h,this.get(e),this.setup(e),i))} - else o=t.physicsConstraints[this.constraintIndex],o.active&&this.set(o,this.getAbsoluteValue(s,n,h,this.get(o),this.setup(o)))} - } - ; - Qt(fX,"PhysicsConstraintTimeline"); - let pX=fX; - const wX=class extends pX{ - constructor(t,i,s){ - super(t,i,s,aq.physicsConstraintInertia)} - setup(t){ - return t.data.inertia} - get(t){ - return t.inertia} - set(t,i){ - t.inertia=i} - global(t){ - return t.inertiaGlobal} - } - ; - Qt(wX,"PhysicsConstraintInertiaTimeline"); - let gX=wX; - const mX=class extends pX{ - constructor(t,i,s){ - super(t,i,s,aq.physicsConstraintStrength)} - setup(t){ - return t.data.strength} - get(t){ - return t.strength} - set(t,i){ - t.strength=i} - global(t){ - return t.strengthGlobal} - } - ; - Qt(mX,"PhysicsConstraintStrengthTimeline"); - let vX=mX; - const _X=class extends pX{ - constructor(t,i,s){ - super(t,i,s,aq.physicsConstraintDamping)} - setup(t){ - return t.data.damping} - get(t){ - return t.damping} - set(t,i){ - t.damping=i} - global(t){ - return t.dampingGlobal} - } - ; - Qt(_X,"PhysicsConstraintDampingTimeline"); - let MX=_X; - const bX=class extends pX{ - constructor(t,i,s){ - super(t,i,s,aq.physicsConstraintMass)} - setup(t){ - return 1/t.data.massInverse} - get(t){ - return 1/t.massInverse} - set(t,i){ - t.massInverse=1/i} - global(t){ - return t.massGlobal} - } - ; - Qt(bX,"PhysicsConstraintMassTimeline"); - let yX=bX; - const EX=class extends pX{ - constructor(t,i,s){ - super(t,i,s,aq.physicsConstraintWind)} - setup(t){ - return t.data.wind} - get(t){ - return t.wind} - set(t,i){ - t.wind=i} - global(t){ - return t.windGlobal} - } - ; - Qt(EX,"PhysicsConstraintWindTimeline"); - let AX=EX; - const SX=class extends pX{ - constructor(t,i,s){ - super(t,i,s,aq.physicsConstraintGravity)} - setup(t){ - return t.data.gravity} - get(t){ - return t.gravity} - set(t,i){ - t.gravity=i} - global(t){ - return t.gravityGlobal} - } - ; - Qt(SX,"PhysicsConstraintGravityTimeline"); - let TX=SX; - const CX=class extends pX{ - constructor(t,i,s){ - super(t,i,s,aq.physicsConstraintMix)} - setup(t){ - return t.data.mix} - get(t){ - return t.mix} - set(t,i){ - t.mix=i} - global(t){ - return t.mixGlobal} - } - ; - Qt(CX,"PhysicsConstraintMixTimeline"); - let OX=CX; - const IX=class t extends lq{ - constructor(i,s){ - super(i,t.propertyIds),Zt(this,"constraintIndex"),this.constraintIndex=s} - getFrameCount(){ - return this.frames.length} - setFrame(t,i){ - this.frames[t]=i} - apply(t,i,s,e,n,h,r){ - let o; - if(-1!=this.constraintIndex&&(o=t.physicsConstraints[this.constraintIndex],!o.active))return; - const a=this.frames; - if(i>s)this.apply(t,i,Number.MAX_VALUE,[],n,h,r),i=-1; - else if(i>=a[a.length-1])return; - if(!(s<a[0])&&(i<a[0]||s>=a[lq.search1(a,i)+1]))if(null!=o)o.reset(); - else for(const c of t.physicsConstraints)c.active&&c.reset()} - } - ; - Qt(IX,"PhysicsConstraintResetTimeline"),Zt(IX,"propertyIds",[aq.physicsConstraintReset.toString()]); - let kX=IX; - const xX=class t extends lq{ - constructor(t,i,s){ - super(t,[aq.sequence+"|"+i+"|"+s.sequence.id]),Zt(this,"slotIndex"),Zt(this,"attachment"),this.slotIndex=i,this.attachment=s} - getFrameEntries(){ - return t.ENTRIES} - getSlotIndex(){ - return this.slotIndex} - getAttachment(){ - return this.attachment} - setFrame(i,s,e,n,h){ - let r=this.frames; - r[i*=t.ENTRIES]=s,r[i+t.MODE]=e|n<<4,r[i+t.DELAY]=h} - apply(i,s,e,n,h,r,o){ - let a=i.slots[this.slotIndex]; - if(!a.bone.active)return; - let c=a.attachment,l=this.attachment; - if(!(c==l||c instanceof XY&&c.timelineAttachment==l))return; - if(o==rq.mixOut)return void(r==nq.setup&&(a.sequenceIndex=-1)); - let u=this.frames; - if(e<u[0])return void(r!=nq.setup&&r!=nq.first||(a.sequenceIndex=-1)); - let d=lq.search(u,e,t.ENTRIES),f=u[d],p=u[d+t.MODE],w=u[d+t.DELAY]; - if(!this.attachment.sequence)return; - let g=p>>4,m=this.attachment.sequence.regions.length,v=iq[15&p]; - if(v!=ZY.hold)switch(g+=(e-f)/w+1e-5|0,v){ - case ZY.once:g=Math.min(m-1,g); - break; - case ZY.loop:g%=m; - break; - case ZY.pingpong:{ - let t=(m<<1)-2; - g=0==t?0:g%t,g>=m&&(g=t-g); - break} - case ZY.onceReverse:g=Math.max(m-1-g,0); - break; - case ZY.loopReverse:g=m-1-g%m; - break; - case ZY.pingpongReverse:{ - let t=(m<<1)-2; - g=0==t?0:(g+m-1)%t,g>=m&&(g=t-g)} - } - a.sequenceIndex=g} - } - ; - Qt(xX,"SequenceTimeline"),Zt(xX,"ENTRIES",3),Zt(xX,"MODE",1),Zt(xX,"DELAY",2); - let RX=xX; - const PX=class t{ - constructor(t){ - Zt(this,"data"),Zt(this,"tracks",new Array),Zt(this,"timeScale",1),Zt(this,"unkeyedState",0),Zt(this,"events",new Array),Zt(this,"listeners",new Array),Zt(this,"queue",new BX(this)),Zt(this,"propertyIDs",new DY),Zt(this,"animationsChanged",!1),Zt(this,"trackEntryPool",new VY(()=>new DX)),this.data=t} - static emptyAnimation(){ - return t._emptyAnimation} - update(t){ - t*=this.timeScale; - let i=this.tracks; - for(let s=0,e=i.length; - s<e; - s++){ - let e=i[s]; - if(!e)continue; - e.animationLast=e.nextAnimationLast,e.trackLast=e.nextTrackLast; - let n=t*e.timeScale; - if(e.delay>0){ - if(e.delay-=n,e.delay>0)continue; - n=-e.delay,e.delay=0} - let h=e.next; - if(h){ - let i=e.trackLast-h.delay; - if(i>=0){ - for(h.delay=0,h.trackTime+=0==e.timeScale?0:(i/e.timeScale+t)*h.timeScale,e.trackTime+=n,this.setCurrent(s,h,!0); - h.mixingFrom; - )h.mixTime+=t,h=h.mixingFrom; - continue} - } - else if(e.trackLast>=e.trackEnd&&!e.mixingFrom){ - i[s]=null,this.queue.end(e),this.clearNext(e); - continue} - if(e.mixingFrom&&this.updateMixingFrom(e,t)){ - let t=e.mixingFrom; - for(e.mixingFrom=null,t&&(t.mixingTo=null); - t; - )this.queue.end(t),t=t.mixingFrom} - e.trackTime+=n} - this.queue.drain()} - updateMixingFrom(t,i){ - let s=t.mixingFrom; - if(!s)return!0; - let e=this.updateMixingFrom(s,i); - return s.animationLast=s.nextAnimationLast,s.trackLast=s.nextTrackLast,-1!=t.nextTrackLast&&t.mixTime>=t.mixDuration?(0!=s.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=s.mixingFrom,null!=s.mixingFrom&&(s.mixingFrom.mixingTo=t),t.interruptAlpha=s.interruptAlpha,this.queue.end(s)),e):(s.trackTime+=i*s.timeScale,t.mixTime+=i,!1)} - apply(t){ - if(!t)throw new Error("skeleton cannot be null."); - this.animationsChanged&&this._animationsChanged(); - let i=this.events,s=this.tracks,e=!1; - for(let u=0,d=s.length; - u<d; - u++){ - let h=s[u]; - if(!h||h.delay>0)continue; - e=!0; - let r=0==u?nq.first:h.mixBlend,o=h.alpha; - h.mixingFrom?o*=this.applyMixingFrom(h,t,r):h.trackTime>=h.trackEnd&&!h.next&&(o=0); - let a=o>=h.alphaAttachmentThreshold,c=h.animationLast,l=h.getAnimationTime(),d=l,f=i; - h.reverse&&(d=h.animation.duration-d,f=null); - let p=h.animation.timelines,w=p.length; - if(0==u&&1==o||r==nq.add){ - 0==u&&(a=!0); - for(let i=0; - i<w; - i++){ - var n=p[i]; - n instanceof Xq?this.applyAttachmentTimeline(n,t,d,r,a):n.apply(t,c,d,f,o,r,rq.mixIn)} - } - else{ - let i=h.timelineMode,s=h.shortestRotation,e=!s&&h.timelinesRotation.length!=w<<1; - e&&(h.timelinesRotation.length=w<<1); - for(let n=0; - n<w; - n++){ - let l=p[n],u=i[n]==$X?r:nq.setup; - !s&&l instanceof vq?this.applyRotateTimeline(l,t,d,o,u,h.timelinesRotation,n<<1,e):l instanceof Xq?this.applyAttachmentTimeline(l,t,d,r,a):l.apply(t,c,d,f,o,u,rq.mixIn)} - } - this.queueEvents(h,l),i.length=0,h.nextAnimationLast=l,h.nextTrackLast=h.trackTime} - for(var h=this.unkeyedState+KX,r=t.slots,o=0,a=t.slots.length; - o<a; - o++){ - var c=r[o]; - if(c.attachmentState==h){ - var l=c.data.attachmentName; - c.setAttachment(l?t.getAttachment(c.data.index,l):null)} - } - return this.unkeyedState+=2,this.queue.drain(),e} - applyMixingFrom(t,i,s){ - let e=t.mixingFrom; - e.mixingFrom&&this.applyMixingFrom(e,i,s); - let n=0; - 0==t.mixDuration?(n=1,s==nq.first&&(s=nq.setup)):(n=t.mixTime/t.mixDuration,n>1&&(n=1),s!=nq.first&&(s=e.mixBlend)); - let h=n<e.mixAttachmentThreshold,r=n<e.mixDrawOrderThreshold,o=e.animation.timelines,a=o.length,c=e.alpha*t.interruptAlpha,l=c*(1-n),u=e.animationLast,d=e.getAnimationTime(),f=d,p=null; - if(e.reverse?f=e.animation.duration-f:n<e.eventThreshold&&(p=this.events),s==nq.add)for(let w=0; - w<a; - w++)o[w].apply(i,u,f,p,l,s,rq.mixOut); - else{ - let t=e.timelineMode,n=e.timelineHoldMix,d=e.shortestRotation,w=!d&&e.timelinesRotation.length!=a<<1; - w&&(e.timelinesRotation.length=a<<1),e.totalAlpha=0; - for(let g=0; - g<a; - g++){ - let a,m=o[g],v=rq.mixOut,_=0; - switch(t[g]){ - case $X:if(!r&&m instanceof sX)continue; - a=s,_=l; - break; - case HX:a=nq.setup,_=l; - break; - case WX:a=s,_=c; - break; - case VX:a=nq.setup,_=c; - break; - default:a=nq.setup; - let t=n[g]; - _=c*Math.max(0,1-t.mixTime/t.mixDuration)} - e.totalAlpha+=_,!d&&m instanceof vq?this.applyRotateTimeline(m,i,f,_,a,e.timelinesRotation,g<<1,w):m instanceof Xq?this.applyAttachmentTimeline(m,i,f,a,h&&_>=e.alphaAttachmentThreshold):(r&&m instanceof sX&&a==nq.setup&&(v=rq.mixIn),m.apply(i,u,f,p,_,a,v))} - } - return t.mixDuration>0&&this.queueEvents(e,d),this.events.length=0,e.nextAnimationLast=d,e.nextTrackLast=e.trackTime,n} - applyAttachmentTimeline(t,i,s,e,n){ - var h=i.slots[t.slotIndex]; - h.bone.active&&(s<t.frames[0]?e!=nq.setup&&e!=nq.first||this.setAttachment(i,h,h.data.attachmentName,n):this.setAttachment(i,h,t.attachmentNames[lq.search1(t.frames,s)],n),h.attachmentState<=this.unkeyedState&&(h.attachmentState=this.unkeyedState+KX))} - setAttachment(t,i,s,e){ - i.setAttachment(s?t.getAttachment(i.data.index,s):null),e&&(i.attachmentState=this.unkeyedState+zX)} - applyRotateTimeline(t,i,s,e,n,h,r,o){ - if(o&&(h[r]=0),1==e)return void t.apply(i,0,s,null,1,n,rq.mixIn); - let a=i.bones[t.boneIndex]; - if(!a.active)return; - let c=0,l=0; - if(s<t.frames[0])switch(n){ - case nq.setup:a.rotation=a.data.rotation; - default:return; - case nq.first:c=a.rotation,l=a.data.rotation} - else c=n==nq.setup?a.data.rotation:a.rotation,l=a.data.rotation+t.getCurveValue(s); - let u=0,d=l-c; - if(d-=360*Math.ceil(d/360-.5),0==d)u=h[r]; - else{ - let t=0,i=0; - o?(t=0,i=d):(t=h[r],i=h[r+1]); - let s=t-t%360; - u=d+s; - let e=d>=0,n=t>=0; - Math.abs(i)<=90&&FY.signum(i)!=FY.signum(d)&&(Math.abs(t-s)>180?(u+=360*FY.signum(t),n=e):0!=s?u-=360*FY.signum(t):n=e),n!=e&&(u+=360*FY.signum(t)),h[r]=u} - h[r+1]=d,a.rotation=c+u*e} - queueEvents(t,i){ - let s=t.animationStart,e=t.animationEnd,n=e-s,h=t.trackLast%n,r=this.events,o=0,a=r.length; - for(; - o<a; - o++){ - let i=r[o]; - if(i.time<h)break; - i.time>e||this.queue.event(t,i)} - let c=!1; - if(t.loop)if(0==n)c=!0; - else{ - const i=Math.floor(t.trackTime/n); - c=i>0&&i>Math.floor(t.trackLast/n)} - else c=i>=e&&t.animationLast<e; - for(c&&this.queue.complete(t); - o<a; - o++){ - let i=r[o]; - i.time<s||this.queue.event(t,i)} - } - clearTracks(){ - let t=this.queue.drainDisabled; - this.queue.drainDisabled=!0; - for(let i=0,s=this.tracks.length; - i<s; - i++)this.clearTrack(i); - this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()} - clearTrack(t){ - if(t>=this.tracks.length)return; - let i=this.tracks[t]; - if(!i)return; - this.queue.end(i),this.clearNext(i); - let s=i; - for(; - ; - ){ - let t=s.mixingFrom; - if(!t)break; - this.queue.end(t),s.mixingFrom=null,s.mixingTo=null,s=t} - this.tracks[i.trackIndex]=null,this.queue.drain()} - setCurrent(t,i,s){ - let e=this.expandToIndex(t); - this.tracks[t]=i,i.previous=null,e&&(s&&this.queue.interrupt(e),i.mixingFrom=e,e.mixingTo=i,i.mixTime=0,e.mixingFrom&&e.mixDuration>0&&(i.interruptAlpha*=Math.min(1,e.mixTime/e.mixDuration)),e.timelinesRotation.length=0),this.queue.start(i)} - setAnimation(t,i,s=!1){ - let e=this.data.skeletonData.findAnimation(i); - if(!e)throw new Error("Animation not found: "+i); - return this.setAnimationWith(t,e,s)} - setAnimationWith(t,i,s=!1){ - if(!i)throw new Error("animation cannot be null."); - let e=!0,n=this.expandToIndex(t); - n&&(-1==n.nextTrackLast?(this.tracks[t]=n.mixingFrom,this.queue.interrupt(n),this.queue.end(n),this.clearNext(n),n=n.mixingFrom,e=!1):this.clearNext(n)); - let h=this.trackEntry(t,i,s,n); - return this.setCurrent(t,h,e),this.queue.drain(),h} - addAnimation(t,i,s=!1,e=0){ - let n=this.data.skeletonData.findAnimation(i); - if(!n)throw new Error("Animation not found: "+i); - return this.addAnimationWith(t,n,s,e)} - addAnimationWith(t,i,s=!1,e=0){ - if(!i)throw new Error("animation cannot be null."); - let n=this.expandToIndex(t); - if(n)for(; - n.next; - )n=n.next; - let h=this.trackEntry(t,i,s,n); - return n?(n.next=h,h.previous=n,e<=0&&(e=Math.max(e+n.getTrackComplete()-h.mixDuration,0))):(this.setCurrent(t,h,!0),this.queue.drain(),e<0&&(e=0)),h.delay=e,h} - setEmptyAnimation(i,s=0){ - let e=this.setAnimationWith(i,t.emptyAnimation(),!1); - return e.mixDuration=s,e.trackEnd=s,e} - addEmptyAnimation(i,s=0,e=0){ - let n=this.addAnimationWith(i,t.emptyAnimation(),!1,e); - return e<=0&&(n.delay=Math.max(n.delay+n.mixDuration-s,0)),n.mixDuration=s,n.trackEnd=s,n} - setEmptyAnimations(t=0){ - let i=this.queue.drainDisabled; - this.queue.drainDisabled=!0; - for(let s=0,e=this.tracks.length; - s<e; - s++){ - let i=this.tracks[s]; - i&&this.setEmptyAnimation(i.trackIndex,t)} - this.queue.drainDisabled=i,this.queue.drain()} - expandToIndex(t){ - return t<this.tracks.length?this.tracks[t]:(HY.ensureArrayCapacity(this.tracks,t+1,null),this.tracks.length=t+1,null)} - trackEntry(t,i,s,e){ - let n=this.trackEntryPool.obtain(); - return n.reset(),n.trackIndex=t,n.animation=i,n.loop=s,n.holdPrevious=!1,n.reverse=!1,n.shortestRotation=!1,n.eventThreshold=0,n.alphaAttachmentThreshold=0,n.mixAttachmentThreshold=0,n.mixDrawOrderThreshold=0,n.animationStart=0,n.animationEnd=i.duration,n.animationLast=-1,n.nextAnimationLast=-1,n.delay=0,n.trackTime=0,n.trackLast=-1,n.nextTrackLast=-1,n.trackEnd=Number.MAX_VALUE,n.timeScale=1,n.alpha=1,n.mixTime=0,n.mixDuration=e?this.data.getMix(e.animation,i):0,n.interruptAlpha=1,n.totalAlpha=0,n.mixBlend=nq.replace,n} - clearNext(t){ - let i=t.next; - for(; - i; - )this.queue.dispose(i),i=i.next; - t.next=null} - _animationsChanged(){ - this.animationsChanged=!1,this.propertyIDs.clear(); - let t=this.tracks; - for(let i=0,s=t.length; - i<s; - i++){ - let s=t[i]; - if(s){ - for(; - s.mixingFrom; - )s=s.mixingFrom; - do{ - s.mixingTo&&s.mixBlend==nq.add||this.computeHold(s),s=s.mixingTo} - while(s)} - } - } - computeHold(t){ - let i=t.mixingTo,s=t.animation.timelines,e=t.animation.timelines.length,n=t.timelineMode; - n.length=e; - let h=t.timelineHoldMix; - h.length=0; - let r=this.propertyIDs; - if(i&&i.holdPrevious)for(let o=0; - o<e; - o++)n[o]=r.addAll(s[o].getPropertyIds())?VX:WX; - else t:for(let o=0; - o<e; - o++){ - let e=s[o],a=e.getPropertyIds(); - if(r.addAll(a))if(!i||e instanceof Xq||e instanceof sX||e instanceof tX||!i.animation.hasTimeline(a))n[o]=HX; - else{ - for(let s=i.mixingTo; - s; - s=s.mixingTo)if(!s.animation.hasTimeline(a)){ - if(t.mixDuration>0){ - n[o]=jX,h[o]=s; - continue t} - break} - n[o]=VX} - else n[o]=$X} - } - getCurrent(t){ - return t>=this.tracks.length?null:this.tracks[t]} - addListener(t){ - if(!t)throw new Error("listener cannot be null."); - this.listeners.push(t)} - removeListener(t){ - let i=this.listeners.indexOf(t); - i>=0&&this.listeners.splice(i,1)} - clearListeners(){ - this.listeners.length=0} - clearListenerNotifications(){ - this.queue.clear()} - } - ; - Qt(PX,"AnimationState"),Zt(PX,"_emptyAnimation",new eq("<empty>",[],0)); - let NX=PX; - const LX=class{ - constructor(){ - Zt(this,"animation",null),Zt(this,"previous",null),Zt(this,"next",null),Zt(this,"mixingFrom",null),Zt(this,"mixingTo",null),Zt(this,"listener",null),Zt(this,"trackIndex",0),Zt(this,"loop",!1),Zt(this,"holdPrevious",!1),Zt(this,"reverse",!1),Zt(this,"shortestRotation",!1),Zt(this,"eventThreshold",0),Zt(this,"mixAttachmentThreshold",0),Zt(this,"alphaAttachmentThreshold",0),Zt(this,"mixDrawOrderThreshold",0),Zt(this,"animationStart",0),Zt(this,"animationEnd",0),Zt(this,"animationLast",0),Zt(this,"nextAnimationLast",0),Zt(this,"delay",0),Zt(this,"trackTime",0),Zt(this,"trackLast",0),Zt(this,"nextTrackLast",0),Zt(this,"trackEnd",0),Zt(this,"timeScale",0),Zt(this,"alpha",0),Zt(this,"mixTime",0),Zt(this,"_mixDuration",0),Zt(this,"interruptAlpha",0),Zt(this,"totalAlpha",0),Zt(this,"mixBlend",nq.replace),Zt(this,"timelineMode",new Array),Zt(this,"timelineHoldMix",new Array),Zt(this,"timelinesRotation",new Array)} - get mixDuration(){ - return this._mixDuration} - set mixDuration(t){ - this._mixDuration=t} - setMixDurationWithDelay(t,i){ - this._mixDuration=t,i<=0&&(i=null!=this.previous?Math.max(i+this.previous.getTrackComplete()-t,0):0),this.delay=i} - reset(){ - this.next=null,this.previous=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0} - getAnimationTime(){ - if(this.loop){ - let t=this.animationEnd-this.animationStart; - return 0==t?this.animationStart:this.trackTime%t+this.animationStart} - return Math.min(this.trackTime+this.animationStart,this.animationEnd)} - setAnimationLast(t){ - this.animationLast=t,this.nextAnimationLast=t} - isComplete(){ - return this.trackTime>=this.animationEnd-this.animationStart} - resetRotationDirections(){ - this.timelinesRotation.length=0} - getTrackComplete(){ - let t=this.animationEnd-this.animationStart; - if(0!=t){ - if(this.loop)return t*(1+(this.trackTime/t|0)); - if(this.trackTime<t)return t} - return this.trackTime} - wasApplied(){ - return-1!=this.nextTrackLast} - isNextReady(){ - return null!=this.next&&this.nextTrackLast-this.next.delay>=0} - } - ; - Qt(LX,"TrackEntry"); - let DX=LX; - const GX=class{ - constructor(t){ - Zt(this,"objects",[]),Zt(this,"drainDisabled",!1),Zt(this,"animState"),this.animState=t} - start(t){ - this.objects.push(UX.start),this.objects.push(t),this.animState.animationsChanged=!0} - interrupt(t){ - this.objects.push(UX.interrupt),this.objects.push(t)} - end(t){ - this.objects.push(UX.end),this.objects.push(t),this.animState.animationsChanged=!0} - dispose(t){ - this.objects.push(UX.dispose),this.objects.push(t)} - complete(t){ - this.objects.push(UX.complete),this.objects.push(t)} - event(t,i){ - this.objects.push(UX.event),this.objects.push(t),this.objects.push(i)} - drain(){ - if(this.drainDisabled)return; - this.drainDisabled=!0; - let t=this.objects,i=this.animState.listeners; - for(let s=0; - s<t.length; - s+=2){ - let e=t[s],n=t[s+1]; - switch(e){ - case UX.start:n.listener&&n.listener.start&&n.listener.start(n); - for(let t=0; - t<i.length; - t++){ - let s=i[t]; - s.start&&s.start(n)} - break; - case UX.interrupt:n.listener&&n.listener.interrupt&&n.listener.interrupt(n); - for(let t=0; - t<i.length; - t++){ - let s=i[t]; - s.interrupt&&s.interrupt(n)} - break; - case UX.end:n.listener&&n.listener.end&&n.listener.end(n); - for(let t=0; - t<i.length; - t++){ - let s=i[t]; - s.end&&s.end(n)} - case UX.dispose:n.listener&&n.listener.dispose&&n.listener.dispose(n); - for(let t=0; - t<i.length; - t++){ - let s=i[t]; - s.dispose&&s.dispose(n)} - this.animState.trackEntryPool.free(n); - break; - case UX.complete:n.listener&&n.listener.complete&&n.listener.complete(n); - for(let t=0; - t<i.length; - t++){ - let s=i[t]; - s.complete&&s.complete(n)} - break; - case UX.event:let e=t[2+s++]; - n.listener&&n.listener.event&&n.listener.event(n,e); - for(let t=0; - t<i.length; - t++){ - let s=i[t]; - s.event&&s.event(n,e)} - } - } - this.clear(),this.drainDisabled=!1} - clear(){ - this.objects.length=0} - } - ; - Qt(GX,"EventQueue"); - let BX=GX; - var UX,FX; - (FX=UX||(UX={ - } - ))[FX.start=0]="start",FX[FX.interrupt=1]="interrupt",FX[FX.end=2]="end",FX[FX.dispose=3]="dispose",FX[FX.complete=4]="complete",FX[FX.event=5]="event"; - const $X=0,HX=1,WX=2,VX=3,jX=4,KX=1,zX=2,YX=class{ - constructor(t){ - if(Zt(this,"skeletonData"),Zt(this,"animationToMixTime",{ - } - ),Zt(this,"defaultMix",0),!t)throw new Error("skeletonData cannot be null."); - this.skeletonData=t} - setMix(t,i,s){ - let e=this.skeletonData.findAnimation(t); - if(!e)throw new Error("Animation not found: "+t); - let n=this.skeletonData.findAnimation(i); - if(!n)throw new Error("Animation not found: "+i); - this.setMixWith(e,n,s)} - setMixWith(t,i,s){ - if(!t)throw new Error("from cannot be null."); - if(!i)throw new Error("to cannot be null."); - let e=t.name+"."+i.name; - this.animationToMixTime[e]=s} - getMix(t,i){ - let s=t.name+"."+i.name,e=this.animationToMixTime[s]; - return void 0===e?this.defaultMix:e} - } - ; - Qt(YX,"AnimationStateData"); - let qX=YX; - const XX=class t extends XY{ - constructor(t){ - super(t),Zt(this,"color",new BY(1,1,1,1))} - copy(){ - let i=new t(this.name); - return this.copyTo(i),i.color.setFromColor(this.color),i} - } - ; - Qt(XX,"BoundingBoxAttachment"); - let JX=XX; - const QX=class t extends XY{ - constructor(t){ - super(t),Zt(this,"endSlot",null),Zt(this,"color",new BY(.2275,.2275,.8078,1))} - copy(){ - let i=new t(this.name); - return this.copyTo(i),i.endSlot=this.endSlot,i.color.setFromColor(this.color),i} - } - ; - Qt(QX,"ClippingAttachment"); - let ZX=QX; - const tJ=class{ - constructor(t){ - Zt(this,"_image"),this._image=t} - getImage(){ - return this._image} - } - ; - Qt(tJ,"Texture"); - let iJ=tJ; - var sJ,eJ,nJ,hJ; - (eJ=sJ||(sJ={ - } - ))[eJ.Nearest=9728]="Nearest",eJ[eJ.Linear=9729]="Linear",eJ[eJ.MipMap=9987]="MipMap",eJ[eJ.MipMapNearestNearest=9984]="MipMapNearestNearest",eJ[eJ.MipMapLinearNearest=9985]="MipMapLinearNearest",eJ[eJ.MipMapNearestLinear=9986]="MipMapNearestLinear",eJ[eJ.MipMapLinearLinear=9987]="MipMapLinearLinear",(hJ=nJ||(nJ={ - } - ))[hJ.MirroredRepeat=33648]="MirroredRepeat",hJ[hJ.ClampToEdge=33071]="ClampToEdge",hJ[hJ.Repeat=10497]="Repeat"; - const rJ=class{ - constructor(){ - Zt(this,"texture"),Zt(this,"u",0),Zt(this,"v",0),Zt(this,"u2",0),Zt(this,"v2",0),Zt(this,"width",0),Zt(this,"height",0),Zt(this,"degrees",0),Zt(this,"offsetX",0),Zt(this,"offsetY",0),Zt(this,"originalWidth",0),Zt(this,"originalHeight",0)} - } - ; - Qt(rJ,"TextureRegion"); - let oJ=rJ; - const aJ=class{ - constructor(t){ - Zt(this,"pages",new Array),Zt(this,"regions",new Array); - let i=new uJ(t),s=new Array(4),e={ - size:t=>{ - t.width=parseInt(s[1]),t.height=parseInt(s[2])} - ,format:()=>{ - } - ,filter:t=>{ - t.minFilter=HY.enumValue(sJ,s[1]),t.magFilter=HY.enumValue(sJ,s[2])} - ,repeat:t=>{ - -1!=s[1].indexOf("x")&&(t.uWrap=nJ.Repeat),-1!=s[1].indexOf("y")&&(t.vWrap=nJ.Repeat)} - ,pma:t=>{ - t.pma="true"==s[1]} - } - ; - var n={ - xy:t=>{ - t.x=parseInt(s[1]),t.y=parseInt(s[2])} - ,size:t=>{ - t.width=parseInt(s[1]),t.height=parseInt(s[2])} - ,bounds:t=>{ - t.x=parseInt(s[1]),t.y=parseInt(s[2]),t.width=parseInt(s[3]),t.height=parseInt(s[4])} - ,offset:t=>{ - t.offsetX=parseInt(s[1]),t.offsetY=parseInt(s[2])} - ,orig:t=>{ - t.originalWidth=parseInt(s[1]),t.originalHeight=parseInt(s[2])} - ,offsets:t=>{ - t.offsetX=parseInt(s[1]),t.offsetY=parseInt(s[2]),t.originalWidth=parseInt(s[3]),t.originalHeight=parseInt(s[4])} - ,rotate:t=>{ - let i=s[1]; - "true"==i?t.degrees=90:"false"!=i&&(t.degrees=parseInt(i))} - ,index:t=>{ - t.index=parseInt(s[1])} - } - ; - let h=i.readLine(); - for(; - h&&0==h.trim().length; - )h=i.readLine(); - for(; - h&&0!=h.trim().length&&0!=i.readEntry(s,h); - )h=i.readLine(); - let r=null,o=null,a=null; - for(; - null!==h; - )if(0==h.trim().length)r=null,h=i.readLine(); - else if(r){ - let t=new wJ(r,h); - for(; - ; - ){ - let e=i.readEntry(s,h=i.readLine()); - if(0==e)break; - let r=n[s[0]]; - if(r)r(t); - else{ - o||(o=[]),a||(a=[]),o.push(s[0]); - let t=[]; - for(let i=0; - i<e; - i++)t.push(parseInt(s[i+1])); - a.push(t)} - } - 0==t.originalWidth&&0==t.originalHeight&&(t.originalWidth=t.width,t.originalHeight=t.height),o&&o.length>0&&a&&a.length>0&&(t.names=o,t.values=a,o=null,a=null),t.u=t.x/r.width,t.v=t.y/r.height,90==t.degrees?(t.u2=(t.x+t.height)/r.width,t.v2=(t.y+t.width)/r.height):(t.u2=(t.x+t.width)/r.width,t.v2=(t.y+t.height)/r.height),this.regions.push(t)} - else{ - for(r=new fJ(h.trim()); - 0!=i.readEntry(s,h=i.readLine()); - ){ - let t=e[s[0]]; - t&&t(r)} - this.pages.push(r)} - } - findRegion(t){ - for(let i=0; - i<this.regions.length; - i++)if(this.regions[i].name==t)return this.regions[i]; - return null} - setTextures(t,i=""){ - for(let s of this.pages)s.setTexture(t.get(i+s.name))} - dispose(){ - var t; - for(let i=0; - i<this.pages.length; - i++)null==(t=this.pages[i].texture)||t.dispose()} - } - ; - Qt(aJ,"TextureAtlas"); - let cJ=aJ; - const lJ=class{ - constructor(t){ - Zt(this,"lines"),Zt(this,"index",0),this.lines=t.split(/\r\n|\r|\n/)} - readLine(){ - return this.index>=this.lines.length?null:this.lines[this.index++]} - readEntry(t,i){ - if(!i)return 0; - if(0==(i=i.trim()).length)return 0; - let s=i.indexOf(":"); - if(-1==s)return 0; - t[0]=i.substr(0,s).trim(); - for(let e=1,n=s+1; - ; - e++){ - let s=i.indexOf(",",n); - if(-1==s)return t[e]=i.substr(n).trim(),e; - if(t[e]=i.substr(n,s-n).trim(),n=s+1,4==e)return 4} - } - } - ; - Qt(lJ,"TextureAtlasReader"); - let uJ=lJ; - const dJ=class{ - constructor(t){ - Zt(this,"name"),Zt(this,"minFilter",sJ.Nearest),Zt(this,"magFilter",sJ.Nearest),Zt(this,"uWrap",nJ.ClampToEdge),Zt(this,"vWrap",nJ.ClampToEdge),Zt(this,"texture",null),Zt(this,"width",0),Zt(this,"height",0),Zt(this,"pma",!1),Zt(this,"regions",new Array),this.name=t} - setTexture(t){ - this.texture=t,t.setFilters(this.minFilter,this.magFilter),t.setWraps(this.uWrap,this.vWrap); - for(let i of this.regions)i.texture=t} - } - ; - Qt(dJ,"TextureAtlasPage"); - let fJ=dJ; - const pJ=class extends oJ{ - constructor(t,i){ - super(),Zt(this,"page"),Zt(this,"name"),Zt(this,"x",0),Zt(this,"y",0),Zt(this,"offsetX",0),Zt(this,"offsetY",0),Zt(this,"originalWidth",0),Zt(this,"originalHeight",0),Zt(this,"index",0),Zt(this,"degrees",0),Zt(this,"names",null),Zt(this,"values",null),this.page=t,this.name=i,t.regions.push(this)} - } - ; - Qt(pJ,"TextureAtlasRegion"); - let wJ=pJ; - const gJ=class t extends XY{ - constructor(t,i){ - super(t),Zt(this,"region",null),Zt(this,"path"),Zt(this,"regionUVs",[]),Zt(this,"uvs",[]),Zt(this,"triangles",[]),Zt(this,"color",new BY(1,1,1,1)),Zt(this,"width",0),Zt(this,"height",0),Zt(this,"hullLength",0),Zt(this,"edges",[]),Zt(this,"parentMesh",null),Zt(this,"sequence",null),Zt(this,"tempColor",new BY(0,0,0,0)),this.path=i} - updateRegion(){ - if(!this.region)throw new Error("Region not set."); - let t=this.regionUVs; - this.uvs&&this.uvs.length==t.length||(this.uvs=HY.newFloatArray(t.length)); - let i=this.uvs,s=this.uvs.length,e=this.region.u,n=this.region.v,h=0,r=0; - if(this.region instanceof wJ){ - let o=this.region,a=o.page,c=a.width,l=a.height; - switch(o.degrees){ - case 90:e-=(o.originalHeight-o.offsetY-o.height)/c,n-=(o.originalWidth-o.offsetX-o.width)/l,h=o.originalHeight/c,r=o.originalWidth/l; - for(let o=0; - o<s; - o+=2)i[o]=e+t[o+1]*h,i[o+1]=n+(1-t[o])*r; - return; - case 180:e-=(o.originalWidth-o.offsetX-o.width)/c,n-=o.offsetY/l,h=o.originalWidth/c,r=o.originalHeight/l; - for(let o=0; - o<s; - o+=2)i[o]=e+(1-t[o])*h,i[o+1]=n+(1-t[o+1])*r; - return; - case 270:e-=o.offsetY/c,n-=o.offsetX/l,h=o.originalHeight/c,r=o.originalWidth/l; - for(let o=0; - o<s; - o+=2)i[o]=e+(1-t[o+1])*h,i[o+1]=n+t[o]*r; - return} - e-=o.offsetX/c,n-=(o.originalHeight-o.offsetY-o.height)/l,h=o.originalWidth/c,r=o.originalHeight/l} - else this.region?(h=this.region.u2-e,r=this.region.v2-n):(e=n=0,h=r=1); - for(let o=0; - o<s; - o+=2)i[o]=e+t[o]*h,i[o+1]=n+t[o+1]*r} - getParentMesh(){ - return this.parentMesh} - setParentMesh(t){ - this.parentMesh=t,t&&(this.bones=t.bones,this.vertices=t.vertices,this.worldVerticesLength=t.worldVerticesLength,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength,this.worldVerticesLength=t.worldVerticesLength)} - copy(){ - if(this.parentMesh)return this.newLinkedMesh(); - let i=new t(this.name,this.path); - return i.region=this.region,i.color.setFromColor(this.color),this.copyTo(i),i.regionUVs=new Array(this.regionUVs.length),HY.arrayCopy(this.regionUVs,0,i.regionUVs,0,this.regionUVs.length),i.uvs=this.uvs instanceof Float32Array?HY.newFloatArray(this.uvs.length):new Array(this.uvs.length),HY.arrayCopy(this.uvs,0,i.uvs,0,this.uvs.length),i.triangles=new Array(this.triangles.length),HY.arrayCopy(this.triangles,0,i.triangles,0,this.triangles.length),i.hullLength=this.hullLength,i.sequence=null!=this.sequence?this.sequence.copy():null,this.edges&&(i.edges=new Array(this.edges.length),HY.arrayCopy(this.edges,0,i.edges,0,this.edges.length)),i.width=this.width,i.height=this.height,i} - computeWorldVertices(t,i,s,e,n,h){ - null!=this.sequence&&this.sequence.apply(t,this),super.computeWorldVertices(t,i,s,e,n,h)} - newLinkedMesh(){ - let i=new t(this.name,this.path); - return i.region=this.region,i.color.setFromColor(this.color),i.timelineAttachment=this.timelineAttachment,i.setParentMesh(this.parentMesh?this.parentMesh:this),null!=i.region&&i.updateRegion(),i} - } - ; - Qt(gJ,"MeshAttachment"); - let mJ=gJ; - const vJ=class t extends XY{ - constructor(t){ - super(t),Zt(this,"lengths",[]),Zt(this,"closed",!1),Zt(this,"constantSpeed",!1),Zt(this,"color",new BY(1,1,1,1))} - copy(){ - let i=new t(this.name); - return this.copyTo(i),i.lengths=new Array(this.lengths.length),HY.arrayCopy(this.lengths,0,i.lengths,0,this.lengths.length),i.closed=closed,i.constantSpeed=this.constantSpeed,i.color.setFromColor(this.color),i} - } - ; - Qt(vJ,"PathAttachment"); - let _J=vJ; - const MJ=class t extends XY{ - constructor(t){ - super(t),Zt(this,"x",0),Zt(this,"y",0),Zt(this,"rotation",0),Zt(this,"color",new BY(.38,.94,0,1))} - computeWorldPosition(t,i){ - return i.x=this.x*t.a+this.y*t.b+t.worldX,i.y=this.x*t.c+this.y*t.d+t.worldY,i} - computeWorldRotation(t){ - const i=this.rotation*FY.degRad,s=Math.cos(i),e=Math.sin(i),n=s*t.a+e*t.b,h=s*t.c+e*t.d; - return FY.atan2Deg(h,n)} - copy(){ - let i=new t(this.name); - return i.x=this.x,i.y=this.y,i.rotation=this.rotation,i.color.setFromColor(this.color),i} - } - ; - Qt(MJ,"PointAttachment"); - let bJ=MJ; - const yJ=class t extends YY{ - constructor(t,i){ - super(t),Zt(this,"x",0),Zt(this,"y",0),Zt(this,"scaleX",1),Zt(this,"scaleY",1),Zt(this,"rotation",0),Zt(this,"width",0),Zt(this,"height",0),Zt(this,"color",new BY(1,1,1,1)),Zt(this,"path"),Zt(this,"region",null),Zt(this,"sequence",null),Zt(this,"offset",HY.newFloatArray(8)),Zt(this,"uvs",HY.newFloatArray(8)),Zt(this,"tempColor",new BY(1,1,1,1)),this.path=i} - updateRegion(){ - if(!this.region)throw new Error("Region not set."); - let t=this.region,i=this.uvs; - if(null==t)return i[0]=0,i[1]=0,i[2]=0,i[3]=1,i[4]=1,i[5]=1,i[6]=1,void(i[7]=0); - let s=this.width/this.region.originalWidth*this.scaleX,e=this.height/this.region.originalHeight*this.scaleY,n=-this.width/2*this.scaleX+this.region.offsetX*s,h=-this.height/2*this.scaleY+this.region.offsetY*e,r=n+this.region.width*s,o=h+this.region.height*e,a=this.rotation*FY.degRad,c=Math.cos(a),l=Math.sin(a),u=this.x,d=this.y,f=n*c+u,p=n*l,w=h*c+d,g=h*l,m=r*c+u,v=r*l,_=o*c+d,M=o*l,b=this.offset; - b[0]=f-g,b[1]=w+p,b[2]=f-M,b[3]=_+p,b[4]=m-M,b[5]=_+v,b[6]=m-g,b[7]=w+v,90==t.degrees?(i[0]=t.u2,i[1]=t.v2,i[2]=t.u,i[3]=t.v2,i[4]=t.u,i[5]=t.v,i[6]=t.u2,i[7]=t.v):(i[0]=t.u,i[1]=t.v2,i[2]=t.u,i[3]=t.v,i[4]=t.u2,i[5]=t.v,i[6]=t.u2,i[7]=t.v2)} - computeWorldVertices(t,i,s,e){ - null!=this.sequence&&this.sequence.apply(t,this); - let n=t.bone,h=this.offset,r=n.worldX,o=n.worldY,a=n.a,c=n.b,l=n.c,u=n.d,d=0,f=0; - d=h[0],f=h[1],i[s]=d*a+f*c+r,i[s+1]=d*l+f*u+o,s+=e,d=h[2],f=h[3],i[s]=d*a+f*c+r,i[s+1]=d*l+f*u+o,s+=e,d=h[4],f=h[5],i[s]=d*a+f*c+r,i[s+1]=d*l+f*u+o,s+=e,d=h[6],f=h[7],i[s]=d*a+f*c+r,i[s+1]=d*l+f*u+o} - copy(){ - let i=new t(this.name,this.path); - return i.region=this.region,i.x=this.x,i.y=this.y,i.scaleX=this.scaleX,i.scaleY=this.scaleY,i.rotation=this.rotation,i.width=this.width,i.height=this.height,HY.arrayCopy(this.uvs,0,i.uvs,0,8),HY.arrayCopy(this.offset,0,i.offset,0,8),i.color.setFromColor(this.color),i.sequence=null!=this.sequence?this.sequence.copy():null,i} - } - ; - Qt(yJ,"RegionAttachment"),Zt(yJ,"X1",0),Zt(yJ,"Y1",1),Zt(yJ,"C1R",2),Zt(yJ,"C1G",3),Zt(yJ,"C1B",4),Zt(yJ,"C1A",5),Zt(yJ,"U1",6),Zt(yJ,"V1",7),Zt(yJ,"X2",8),Zt(yJ,"Y2",9),Zt(yJ,"C2R",10),Zt(yJ,"C2G",11),Zt(yJ,"C2B",12),Zt(yJ,"C2A",13),Zt(yJ,"U2",14),Zt(yJ,"V2",15),Zt(yJ,"X3",16),Zt(yJ,"Y3",17),Zt(yJ,"C3R",18),Zt(yJ,"C3G",19),Zt(yJ,"C3B",20),Zt(yJ,"C3A",21),Zt(yJ,"U3",22),Zt(yJ,"V3",23),Zt(yJ,"X4",24),Zt(yJ,"Y4",25),Zt(yJ,"C4R",26),Zt(yJ,"C4G",27),Zt(yJ,"C4B",28),Zt(yJ,"C4A",29),Zt(yJ,"U4",30),Zt(yJ,"V4",31); - let EJ=yJ; - const AJ=class{ - constructor(t){ - Zt(this,"atlas"),this.atlas=t} - loadSequence(t,i,s){ - let e=s.regions; - for(let n=0,h=e.length; - n<h; - n++){ - let h=s.getPath(i,n),r=this.atlas.findRegion(h); - if(null==r)throw new Error("Region not found in atlas: "+h+" (sequence: "+t+")"); - e[n]=r} - } - newRegionAttachment(t,i,s,e){ - let n=new EJ(i,s); - if(null!=e)this.loadSequence(i,s,e); - else{ - let t=this.atlas.findRegion(s); - if(!t)throw new Error("Region not found in atlas: "+s+" (region attachment: "+i+")"); - n.region=t} - return n} - newMeshAttachment(t,i,s,e){ - let n=new mJ(i,s); - if(null!=e)this.loadSequence(i,s,e); - else{ - let t=this.atlas.findRegion(s); - if(!t)throw new Error("Region not found in atlas: "+s+" (mesh attachment: "+i+")"); - n.region=t} - return n} - newBoundingBoxAttachment(t,i){ - return new JX(i)} - newPathAttachment(t,i){ - return new _J(i)} - newPointAttachment(t,i){ - return new bJ(i)} - newClippingAttachment(t,i){ - return new ZX(i)} - } - ; - Qt(AJ,"AtlasAttachmentLoader"); - let SJ=AJ; - const TJ=class{ - constructor(t,i,s){ - if(Zt(this,"index",0),Zt(this,"name"),Zt(this,"parent",null),Zt(this,"length",0),Zt(this,"x",0),Zt(this,"y",0),Zt(this,"rotation",0),Zt(this,"scaleX",1),Zt(this,"scaleY",1),Zt(this,"shearX",0),Zt(this,"shearY",0),Zt(this,"inherit",OJ.Normal),Zt(this,"skinRequired",!1),Zt(this,"color",new BY),Zt(this,"icon"),Zt(this,"visible",!1),t<0)throw new Error("index must be >= 0."); - if(!i)throw new Error("name cannot be null."); - this.index=t,this.name=i,this.parent=s} - } - ; - Qt(TJ,"BoneData"); - let CJ=TJ; - var OJ,IJ; - (IJ=OJ||(OJ={ - } - ))[IJ.Normal=0]="Normal",IJ[IJ.OnlyTranslation=1]="OnlyTranslation",IJ[IJ.NoRotationOrReflection=2]="NoRotationOrReflection",IJ[IJ.NoScale=3]="NoScale",IJ[IJ.NoScaleOrReflection=4]="NoScaleOrReflection"; - const kJ=class{ - constructor(t,i,s){ - if(Zt(this,"data"),Zt(this,"skeleton"),Zt(this,"parent",null),Zt(this,"children",new Array),Zt(this,"x",0),Zt(this,"y",0),Zt(this,"rotation",0),Zt(this,"scaleX",0),Zt(this,"scaleY",0),Zt(this,"shearX",0),Zt(this,"shearY",0),Zt(this,"ax",0),Zt(this,"ay",0),Zt(this,"arotation",0),Zt(this,"ascaleX",0),Zt(this,"ascaleY",0),Zt(this,"ashearX",0),Zt(this,"ashearY",0),Zt(this,"a",0),Zt(this,"b",0),Zt(this,"c",0),Zt(this,"d",0),Zt(this,"worldY",0),Zt(this,"worldX",0),Zt(this,"inherit",OJ.Normal),Zt(this,"sorted",!1),Zt(this,"active",!1),!t)throw new Error("data cannot be null."); - if(!i)throw new Error("skeleton cannot be null."); - this.data=t,this.skeleton=i,this.parent=s,this.setToSetupPose()} - isActive(){ - return this.active} - update(t){ - this.updateWorldTransformWith(this.ax,this.ay,this.arotation,this.ascaleX,this.ascaleY,this.ashearX,this.ashearY)} - updateWorldTransform(){ - this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)} - updateWorldTransformWith(t,i,s,e,n,h,r){ - this.ax=t,this.ay=i,this.arotation=s,this.ascaleX=e,this.ascaleY=n,this.ashearX=h,this.ashearY=r; - let o=this.parent; - if(!o){ - let o=this.skeleton; - const a=o.scaleX,c=o.scaleY,l=(s+h)*FY.degRad,u=(s+90+r)*FY.degRad; - return this.a=Math.cos(l)*e*a,this.b=Math.cos(u)*n*a,this.c=Math.sin(l)*e*c,this.d=Math.sin(u)*n*c,this.worldX=t*a+o.x,void(this.worldY=i*c+o.y)} - let a=o.a,c=o.b,l=o.c,u=o.d; - switch(this.worldX=a*t+c*i+o.worldX,this.worldY=l*t+u*i+o.worldY,this.inherit){ - case OJ.Normal:{ - const t=(s+h)*FY.degRad,i=(s+90+r)*FY.degRad,o=Math.cos(t)*e,d=Math.cos(i)*n,f=Math.sin(t)*e,p=Math.sin(i)*n; - return this.a=a*o+c*f,this.b=a*d+c*p,this.c=l*o+u*f,void(this.d=l*d+u*p)} - case OJ.OnlyTranslation:{ - const t=(s+h)*FY.degRad,i=(s+90+r)*FY.degRad; - this.a=Math.cos(t)*e,this.b=Math.cos(i)*n,this.c=Math.sin(t)*e,this.d=Math.sin(i)*n; - break} - case OJ.NoRotationOrReflection:{ - let t=1/this.skeleton.scaleX,i=1/this.skeleton.scaleY; - a*=t,l*=i; - let o=a*a+l*l,d=0; - o>1e-4?(o=Math.abs(a*u*i-c*t*l)/o,c=l*o,u=a*o,d=Math.atan2(l,a)*FY.radDeg):(a=0,l=0,d=90-Math.atan2(u,c)*FY.radDeg); - const f=(s+h-d)*FY.degRad,p=(s+r-d+90)*FY.degRad,w=Math.cos(f)*e,g=Math.cos(p)*n,m=Math.sin(f)*e,v=Math.sin(p)*n; - this.a=a*w-c*m,this.b=a*g-c*v,this.c=l*w+u*m,this.d=l*g+u*v; - break} - case OJ.NoScale:case OJ.NoScaleOrReflection:{ - s*=FY.degRad; - const t=Math.cos(s),i=Math.sin(s); - let o=(a*t+c*i)/this.skeleton.scaleX,d=(l*t+u*i)/this.skeleton.scaleY,f=Math.sqrt(o*o+d*d); - f>1e-5&&(f=1/f),o*=f,d*=f,f=Math.sqrt(o*o+d*d),this.inherit==OJ.NoScale&&a*u-c*l<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(f=-f),s=Math.PI/2+Math.atan2(d,o); - const p=Math.cos(s)*f,w=Math.sin(s)*f; - h*=FY.degRad,r=(90+r)*FY.degRad; - const g=Math.cos(h)*e,m=Math.cos(r)*n,v=Math.sin(h)*e,_=Math.sin(r)*n; - this.a=o*g+p*v,this.b=o*m+p*_,this.c=d*g+w*v,this.d=d*m+w*_; - break} - } - this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY} - setToSetupPose(){ - let t=this.data; - this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY,this.inherit=t.inherit} - updateAppliedTransform(){ - let t=this.parent; - if(!t)return this.ax=this.worldX-this.skeleton.x,this.ay=this.worldY-this.skeleton.y,this.arotation=Math.atan2(this.c,this.a)*FY.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*FY.radDeg); - let i,s,e,n,h=t.a,r=t.b,o=t.c,a=t.d,c=1/(h*a-r*o),l=a*c,u=r*c,d=o*c,f=h*c,p=this.worldX-t.worldX,w=this.worldY-t.worldY; - if(this.ax=p*l-w*u,this.ay=w*f-p*d,this.inherit==OJ.OnlyTranslation)i=this.a,s=this.b,e=this.c,n=this.d; - else{ - switch(this.inherit){ - case OJ.NoRotationOrReflection:{ - let t=Math.abs(h*a-r*o)/(h*h+o*o); - r=-o*this.skeleton.scaleX*t/this.skeleton.scaleY,a=h*this.skeleton.scaleY*t/this.skeleton.scaleX,c=1/(h*a-r*o),l=a*c,u=r*c; - break} - case OJ.NoScale:case OJ.NoScaleOrReflection:let t=FY.cosDeg(this.rotation),i=FY.sinDeg(this.rotation); - h=(h*t+r*i)/this.skeleton.scaleX,o=(o*t+a*i)/this.skeleton.scaleY; - let s=Math.sqrt(h*h+o*o); - s>1e-5&&(s=1/s),h*=s,o*=s,s=Math.sqrt(h*h+o*o),this.inherit==OJ.NoScale&&c<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(s=-s); - let e=FY.PI/2+Math.atan2(o,h); - r=Math.cos(e)*s,a=Math.sin(e)*s,c=1/(h*a-r*o),l=a*c,u=r*c,d=o*c,f=h*c} - i=l*this.a-u*this.c,s=l*this.b-u*this.d,e=f*this.c-d*this.a,n=f*this.d-d*this.b} - if(this.ashearX=0,this.ascaleX=Math.sqrt(i*i+e*e),this.ascaleX>1e-4){ - let t=i*n-s*e; - this.ascaleY=t/this.ascaleX,this.ashearY=-Math.atan2(i*s+e*n,t)*FY.radDeg,this.arotation=Math.atan2(e,i)*FY.radDeg} - else this.ascaleX=0,this.ascaleY=Math.sqrt(s*s+n*n),this.ashearY=0,this.arotation=90-Math.atan2(n,s)*FY.radDeg} - getWorldRotationX(){ - return Math.atan2(this.c,this.a)*FY.radDeg} - getWorldRotationY(){ - return Math.atan2(this.d,this.b)*FY.radDeg} - getWorldScaleX(){ - return Math.sqrt(this.a*this.a+this.c*this.c)} - getWorldScaleY(){ - return Math.sqrt(this.b*this.b+this.d*this.d)} - worldToLocal(t){ - let i=1/(this.a*this.d-this.b*this.c),s=t.x-this.worldX,e=t.y-this.worldY; - return t.x=s*this.d*i-e*this.b*i,t.y=e*this.a*i-s*this.c*i,t} - localToWorld(t){ - let i=t.x,s=t.y; - return t.x=i*this.a+s*this.b+this.worldX,t.y=i*this.c+s*this.d+this.worldY,t} - worldToParent(t){ - if(null==t)throw new Error("world cannot be null."); - return null==this.parent?t:this.parent.worldToLocal(t)} - parentToWorld(t){ - if(null==t)throw new Error("world cannot be null."); - return null==this.parent?t:this.parent.localToWorld(t)} - worldToLocalRotation(t){ - let i=FY.sinDeg(t),s=FY.cosDeg(t); - return Math.atan2(this.a*i-this.c*s,this.d*s-this.b*i)*FY.radDeg+this.rotation-this.shearX} - localToWorldRotation(t){ - t-=this.rotation-this.shearX; - let i=FY.sinDeg(t),s=FY.cosDeg(t); - return Math.atan2(s*this.c+i*this.d,s*this.a+i*this.b)*FY.radDeg} - rotateWorld(t){ - t*=FY.degRad; - const i=Math.sin(t),s=Math.cos(t),e=this.a,n=this.b; - this.a=s*e-i*this.c,this.b=s*n-i*this.d,this.c=i*e+s*this.c,this.d=i*n+s*this.d} - } - ; - Qt(kJ,"Bone"); - let xJ=kJ; - const RJ=class{ - constructor(t,i,s){ - Zt(this,"name"),Zt(this,"order"),Zt(this,"skinRequired"),this.name=t,this.order=i,this.skinRequired=s} - } - ; - Qt(RJ,"ConstraintData"); - let PJ=RJ,NJ=(Qt(Z=class{ - constructor(t,i){ - if(Zt(this,"data"),Zt(this,"intValue",0),Zt(this,"floatValue",0),Zt(this,"stringValue",null),Zt(this,"time",0),Zt(this,"volume",0),Zt(this,"balance",0),!i)throw new Error("data cannot be null."); - this.time=t,this.data=i} - } - ,"Event"),Z); - const LJ=class{ - constructor(t){ - Zt(this,"name"),Zt(this,"intValue",0),Zt(this,"floatValue",0),Zt(this,"stringValue",null),Zt(this,"audioPath",null),Zt(this,"volume",0),Zt(this,"balance",0),this.name=t} - } - ; - Qt(LJ,"EventData"); - let DJ=LJ; - const GJ=class{ - constructor(t,i){ - if(Zt(this,"data"),Zt(this,"bones"),Zt(this,"target"),Zt(this,"bendDirection",0),Zt(this,"compress",!1),Zt(this,"stretch",!1),Zt(this,"mix",1),Zt(this,"softness",0),Zt(this,"active",!1),!t)throw new Error("data cannot be null."); - if(!i)throw new Error("skeleton cannot be null."); - this.data=t,this.bones=new Array; - for(let e=0; - e<t.bones.length; - e++){ - let s=i.findBone(t.bones[e].name); - if(!s)throw new Error(`Couldn't find bone ${ - t.bones[e].name} - `); - this.bones.push(s)} - let s=i.findBone(t.target.name); - if(!s)throw new Error(`Couldn't find bone ${ - t.target.name} - `); - this.target=s,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch} - isActive(){ - return this.active} - setToSetupPose(){ - const t=this.data; - this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch} - update(t){ - if(0==this.mix)return; - let i=this.target,s=this.bones; - switch(s.length){ - case 1:this.apply1(s[0],i.worldX,i.worldY,this.compress,this.stretch,this.data.uniform,this.mix); - break; - case 2:this.apply2(s[0],s[1],i.worldX,i.worldY,this.bendDirection,this.stretch,this.data.uniform,this.softness,this.mix)} - } - apply1(t,i,s,e,n,h,r){ - let o=t.parent; - if(!o)throw new Error("IK bone must have parent."); - let a=o.a,c=o.b,l=o.c,u=o.d,d=-t.ashearX-t.arotation,f=0,p=0; - switch(t.inherit){ - case OJ.OnlyTranslation:f=(i-t.worldX)*FY.signum(t.skeleton.scaleX),p=(s-t.worldY)*FY.signum(t.skeleton.scaleY); - break; - case OJ.NoRotationOrReflection:let e=Math.abs(a*u-c*l)/Math.max(1e-4,a*a+l*l),n=a/t.skeleton.scaleX,h=l/t.skeleton.scaleY; - c=-h*e*t.skeleton.scaleX,u=n*e*t.skeleton.scaleY,d+=Math.atan2(h,n)*FY.radDeg; - default:let r=i-o.worldX,w=s-o.worldY,g=a*u-c*l; - Math.abs(g)<=1e-4?(f=0,p=0):(f=(r*u-w*c)/g-t.ax,p=(w*a-r*l)/g-t.ay)} - d+=Math.atan2(p,f)*FY.radDeg,t.ascaleX<0&&(d+=180),d>180?d-=360:d<-180&&(d+=360); - let w=t.ascaleX,g=t.ascaleY; - if(e||n){ - switch(t.inherit){ - case OJ.NoScale:case OJ.NoScaleOrReflection:f=i-t.worldX,p=s-t.worldY} - const o=t.data.length*w; - if(o>1e-4){ - const t=f*f+p*p; - if(e&&t<o*o||n&&t>o*o){ - const i=(Math.sqrt(t)/o-1)*r+1; - w*=i,h&&(g*=i)} - } - } - t.updateWorldTransformWith(t.ax,t.ay,t.arotation+d*r,w,g,t.ashearX,t.ashearY)} - apply2(t,i,s,e,n,h,r,o,a){ - if(t.inherit!=OJ.Normal||i.inherit!=OJ.Normal)return; - let c=t.ax,l=t.ay,u=t.ascaleX,d=t.ascaleY,f=u,p=d,w=i.ascaleX,g=0,m=0,v=0; - u<0?(u=-u,g=180,v=-1):(g=0,v=1),d<0&&(d=-d,v=-v),w<0?(w=-w,m=180):m=0; - let _=i.ax,M=0,b=0,y=0,E=t.a,A=t.b,S=t.c,T=t.d,C=Math.abs(u-d)<=1e-4; - !C||h?(M=0,b=E*_+t.worldX,y=S*_+t.worldY):(M=i.ay,b=E*_+A*M+t.worldX,y=S*_+T*M+t.worldY); - let O=t.parent; - if(!O)throw new Error("IK parent must itself have a parent."); - E=O.a,A=O.b,S=O.c,T=O.d; - let I=E*T-A*S,k=b-O.worldX,x=y-O.worldY; - I=Math.abs(I)<=1e-4?0:1/I; - let R,P,N=(k*T-x*A)*I-c,L=(x*E-k*S)*I-l,D=Math.sqrt(N*N+L*L),G=i.data.length*w; - if(D<1e-4)return this.apply1(t,s,e,!1,h,!1,a),void i.updateWorldTransformWith(_,M,0,i.ascaleX,i.ascaleY,i.ashearX,i.ashearY); - k=s-O.worldX,x=e-O.worldY; - let B=(k*T-x*A)*I-c,U=(x*E-k*S)*I-l,F=B*B+U*U; - if(0!=o){ - o*=u*(w+1)*.5; - let t=Math.sqrt(F),i=t-D-G*u+o; - if(i>0){ - let s=Math.min(1,i/(2*o))-1; - s=(i-o*(1-s*s))/t,B-=s*B,U-=s*U,F=B*B+U*U} - } - t:if(C){ - G*=u; - let t=(F-D*D-G*G)/(2*D*G); - t<-1?(t=-1,P=Math.PI*n):t>1?(t=1,P=0,h&&(E=(Math.sqrt(F)/(D+G)-1)*a+1,f*=E,r&&(p*=E))):P=Math.acos(t)*n,E=D+G*t,A=G*Math.sin(P),R=Math.atan2(U*E-B*A,B*E+U*A)} - else{ - E=u*G,A=d*G; - let t=E*E,i=A*A,s=Math.atan2(U,B); - S=i*D*D+t*F-t*i; - let e=-2*i*D,h=i-t; - if(T=e*e-4*h*S,T>=0){ - let t=Math.sqrt(T); - e<0&&(t=-t),t=.5*-(e+t); - let i=t/h,r=S/t,o=Math.abs(i)<Math.abs(r)?i:r; - if(i=F-o*o,i>=0){ - x=Math.sqrt(i)*n,R=s-Math.atan2(x,o),P=Math.atan2(x/d,(o-D)/u); - break t} - } - let r=FY.PI,o=D-E,a=o*o,c=0,l=0,f=D+E,p=f*f,w=0; - S=-E*D/(t-i),S>=-1&&S<=1&&(S=Math.acos(S),k=E*Math.cos(S)+D,x=A*Math.sin(S),T=k*k+x*x,T<a&&(r=S,a=T,o=k,c=x),T>p&&(l=S,p=T,f=k,w=x)),F<=.5*(a+p)?(R=s-Math.atan2(c*n,o),P=r*n):(R=s-Math.atan2(w*n,f),P=l*n)} - let $=Math.atan2(M,_)*v,H=t.arotation; - R=(R-$)*FY.radDeg+g-H,R>180?R-=360:R<-180&&(R+=360),t.updateWorldTransformWith(c,l,H+R*a,f,p,0,0),H=i.arotation,P=((P+$)*FY.radDeg-i.ashearX)*v+m-H,P>180?P-=360:P<-180&&(P+=360),i.updateWorldTransformWith(_,M,H+P*a,i.ascaleX,i.ascaleY,i.ashearX,i.ashearY)} - } - ; - Qt(GJ,"IkConstraint"); - let BJ=GJ; - const UJ=class extends PJ{ - constructor(t){ - super(t,0,!1),Zt(this,"bones",new Array),Zt(this,"_target",null),Zt(this,"bendDirection",0),Zt(this,"compress",!1),Zt(this,"stretch",!1),Zt(this,"uniform",!1),Zt(this,"mix",0),Zt(this,"softness",0)} - set target(t){ - this._target=t} - get target(){ - if(this._target)return this._target; - throw new Error("BoneData not set.")} - } - ; - Qt(UJ,"IkConstraintData"); - let FJ=UJ; - const $J=class extends PJ{ - constructor(t){ - super(t,0,!1),Zt(this,"bones",new Array),Zt(this,"_target",null),Zt(this,"positionMode",WJ.Fixed),Zt(this,"spacingMode",jJ.Fixed),Zt(this,"rotateMode",zJ.Chain),Zt(this,"offsetRotation",0),Zt(this,"position",0),Zt(this,"spacing",0),Zt(this,"mixRotate",0),Zt(this,"mixX",0),Zt(this,"mixY",0)} - set target(t){ - this._target=t} - get target(){ - if(this._target)return this._target; - throw new Error("SlotData not set.")} - } - ; - Qt($J,"PathConstraintData"); - let HJ=$J; - var WJ,VJ,jJ,KJ,zJ,YJ; - (VJ=WJ||(WJ={ - } - ))[VJ.Fixed=0]="Fixed",VJ[VJ.Percent=1]="Percent",(KJ=jJ||(jJ={ - } - ))[KJ.Length=0]="Length",KJ[KJ.Fixed=1]="Fixed",KJ[KJ.Percent=2]="Percent",KJ[KJ.Proportional=3]="Proportional",(YJ=zJ||(zJ={ - } - ))[YJ.Tangent=0]="Tangent",YJ[YJ.Chain=1]="Chain",YJ[YJ.ChainScale=2]="ChainScale"; - const qJ=class t{ - constructor(t,i){ - if(Zt(this,"data"),Zt(this,"bones"),Zt(this,"target"),Zt(this,"position",0),Zt(this,"spacing",0),Zt(this,"mixRotate",0),Zt(this,"mixX",0),Zt(this,"mixY",0),Zt(this,"spaces",new Array),Zt(this,"positions",new Array),Zt(this,"world",new Array),Zt(this,"curves",new Array),Zt(this,"lengths",new Array),Zt(this,"segments",new Array),Zt(this,"active",!1),!t)throw new Error("data cannot be null."); - if(!i)throw new Error("skeleton cannot be null."); - this.data=t,this.bones=new Array; - for(let e=0,n=t.bones.length; - e<n; - e++){ - let s=i.findBone(t.bones[e].name); - if(!s)throw new Error(`Couldn't find bone ${ - t.bones[e].name} - .`); - this.bones.push(s)} - let s=i.findSlot(t.target.name); - if(!s)throw new Error(`Couldn't find target bone ${ - t.target.name} - `); - this.target=s,this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY} - isActive(){ - return this.active} - setToSetupPose(){ - const t=this.data; - this.position=t.position,this.spacing=t.spacing,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY} - update(i){ - let s=this.target.getAttachment(); - if(!(s instanceof _J))return; - let e=this.mixRotate,n=this.mixX,h=this.mixY; - if(0==e&&0==n&&0==h)return; - let r=this.data,o=r.rotateMode==zJ.Tangent,a=r.rotateMode==zJ.ChainScale,c=this.bones,l=c.length,u=o?l:l+1,d=HY.setArraySize(this.spaces,u),f=a?this.lengths=HY.setArraySize(this.lengths,l):[],p=this.spacing; - switch(r.spacingMode){ - case jJ.Percent:if(a)for(let t=0,e=u-1; - t<e; - t++){ - let i=c[t],s=i.data.length,e=s*i.a,n=s*i.c; - f[t]=Math.sqrt(e*e+n*n)} - HY.arrayFill(d,1,u,p); - break; - case jJ.Proportional:let i=0; - for(let e=0,n=u-1; - e<n; - ){ - let s=c[e],n=s.data.length; - if(n<t.epsilon)a&&(f[e]=0),d[++e]=p; - else{ - let t=n*s.a,h=n*s.c,r=Math.sqrt(t*t+h*h); - a&&(f[e]=r),d[++e]=r,i+=r} - } - if(i>0){ - i=u/i*p; - for(let t=1; - t<u; - t++)d[t]*=i} - break; - default:let s=r.spacingMode==jJ.Length; - for(let e=0,n=u-1; - e<n; - ){ - let i=c[e],n=i.data.length; - if(n<t.epsilon)a&&(f[e]=0),d[++e]=p; - else{ - let t=n*i.a,h=n*i.c,r=Math.sqrt(t*t+h*h); - a&&(f[e]=r),d[++e]=(s?n+p:p)*r/n} - } - } - let w=this.computeWorldPositions(s,u,o),g=w[0],m=w[1],v=r.offsetRotation,_=!1; - if(0==v)_=r.rotateMode==zJ.Chain; - else{ - _=!1; - let t=this.target.bone; - v*=t.a*t.d-t.b*t.c>0?FY.degRad:-.01745329277777778} - for(let t=0,M=3; - t<l; - t++,M+=3){ - let i=c[t]; - i.worldX+=(g-i.worldX)*n,i.worldY+=(m-i.worldY)*h; - let s=w[M],r=w[M+1],l=s-g,u=r-m; - if(a){ - let s=f[t]; - if(0!=s){ - let t=(Math.sqrt(l*l+u*u)/s-1)*e+1; - i.a*=t,i.c*=t} - } - if(g=s,m=r,e>0){ - let s=i.a,n=i.b,h=i.c,r=i.d,a=0,c=0,f=0; - if(a=o?w[M-1]:0==d[t+1]?w[M+2]:Math.atan2(u,l),a-=Math.atan2(h,s),_){ - c=Math.cos(a),f=Math.sin(a); - let t=i.data.length; - g+=(t*(c*s-f*h)-l)*e,m+=(t*(f*s+c*h)-u)*e} - else a+=v; - a>FY.PI?a-=FY.PI2:a<-3.1415927&&(a+=FY.PI2),a*=e,c=Math.cos(a),f=Math.sin(a),i.a=c*s-f*h,i.b=c*n-f*r,i.c=f*s+c*h,i.d=f*n+c*r} - i.updateAppliedTransform()} - } - computeWorldPositions(i,s,e){ - let n=this.target,h=this.position,r=this.spaces,o=HY.setArraySize(this.positions,3*s+2),a=this.world,c=i.closed,l=i.worldVerticesLength,u=l/6,d=t.NONE; - if(!i.constantSpeed){ - let f=i.lengths; - u-=c?1:2; - let p,w=f[u]; - switch(this.data.positionMode==WJ.Percent&&(h*=w),this.data.spacingMode){ - case jJ.Percent:p=w; - break; - case jJ.Proportional:p=w/s; - break; - default:p=1} - a=HY.setArraySize(this.world,8); - for(let g=0,m=0,v=0; - g<s; - g++,m+=3){ - let s=r[g]*p; - h+=s; - let _=h; - if(c)_%=w,_<0&&(_+=w),v=0; - else{ - if(_<0){ - d!=t.BEFORE&&(d=t.BEFORE,i.computeWorldVertices(n,2,4,a,0,2)),this.addBeforePosition(_,a,0,o,m); - continue} - if(_>w){ - d!=t.AFTER&&(d=t.AFTER,i.computeWorldVertices(n,l-6,4,a,0,2)),this.addAfterPosition(_-w,a,0,o,m); - continue} - } - for(; - ; - v++){ - let t=f[v]; - if(!(_>t)){ - if(0==v)_/=t; - else{ - let i=f[v-1]; - _=(_-i)/(t-i)} - break} - } - v!=d&&(d=v,c&&v==u?(i.computeWorldVertices(n,l-4,4,a,0,2),i.computeWorldVertices(n,0,4,a,4,2)):i.computeWorldVertices(n,6*v+2,8,a,0,2)),this.addCurvePosition(_,a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],o,m,e||g>0&&0==s)} - return o} - c?(l+=2,a=HY.setArraySize(this.world,l),i.computeWorldVertices(n,2,l-4,a,0,2),i.computeWorldVertices(n,0,2,a,l-4,2),a[l-2]=a[0],a[l-1]=a[1]):(u--,l-=4,a=HY.setArraySize(this.world,l),i.computeWorldVertices(n,2,l,a,0,2)); - let f,p=HY.setArraySize(this.curves,u),w=0,g=a[0],m=a[1],v=0,_=0,M=0,b=0,y=0,E=0,A=0,S=0,T=0,C=0,O=0,I=0,k=0,x=0; - for(let t=0,N=2; - t<u; - t++,N+=6)v=a[N],_=a[N+1],M=a[N+2],b=a[N+3],y=a[N+4],E=a[N+5],A=.1875*(g-2*v+M),S=.1875*(m-2*_+b),T=.09375*(3*(v-M)-g+y),C=.09375*(3*(_-b)-m+E),O=2*A+T,I=2*S+C,k=.75*(v-g)+A+.16666667*T,x=.75*(_-m)+S+.16666667*C,w+=Math.sqrt(k*k+x*x),k+=O,x+=I,O+=T,I+=C,w+=Math.sqrt(k*k+x*x),k+=O,x+=I,w+=Math.sqrt(k*k+x*x),k+=O+T,x+=I+C,w+=Math.sqrt(k*k+x*x),p[t]=w,g=y,m=E; - switch(this.data.positionMode==WJ.Percent&&(h*=w),this.data.spacingMode){ - case jJ.Percent:f=w; - break; - case jJ.Proportional:f=w/s; - break; - default:f=1} - let R=this.segments,P=0; - for(let t=0,N=0,L=0,D=0; - t<s; - t++,N+=3){ - let i=r[t]*f; - h+=i; - let s=h; - if(c)s%=w,s<0&&(s+=w),L=0; - else{ - if(s<0){ - this.addBeforePosition(s,a,0,o,N); - continue} - if(s>w){ - this.addAfterPosition(s-w,a,l-4,o,N); - continue} - } - for(; - ; - L++){ - let t=p[L]; - if(!(s>t)){ - if(0==L)s/=t; - else{ - let i=p[L-1]; - s=(s-i)/(t-i)} - break} - } - if(L!=d){ - d=L; - let t=6*L; - for(g=a[t],m=a[t+1],v=a[t+2],_=a[t+3],M=a[t+4],b=a[t+5],y=a[t+6],E=a[t+7],A=.03*(g-2*v+M),S=.03*(m-2*_+b),T=.006*(3*(v-M)-g+y),C=.006*(3*(_-b)-m+E),O=2*A+T,I=2*S+C,k=.3*(v-g)+A+.16666667*T,x=.3*(_-m)+S+.16666667*C,P=Math.sqrt(k*k+x*x),R[0]=P,t=1; - t<8; - t++)k+=O,x+=I,O+=T,I+=C,P+=Math.sqrt(k*k+x*x),R[t]=P; - k+=O,x+=I,P+=Math.sqrt(k*k+x*x),R[8]=P,k+=O+T,x+=I+C,P+=Math.sqrt(k*k+x*x),R[9]=P,D=0} - for(s*=P; - ; - D++){ - let t=R[D]; - if(!(s>t)){ - if(0==D)s/=t; - else{ - let i=R[D-1]; - s=D+(s-i)/(t-i)} - break} - } - this.addCurvePosition(.1*s,g,m,v,_,M,b,y,E,o,N,e||t>0&&0==i)} - return o} - addBeforePosition(t,i,s,e,n){ - let h=i[s],r=i[s+1],o=i[s+2]-h,a=i[s+3]-r,c=Math.atan2(a,o); - e[n]=h+t*Math.cos(c),e[n+1]=r+t*Math.sin(c),e[n+2]=c} - addAfterPosition(t,i,s,e,n){ - let h=i[s+2],r=i[s+3],o=h-i[s],a=r-i[s+1],c=Math.atan2(a,o); - e[n]=h+t*Math.cos(c),e[n+1]=r+t*Math.sin(c),e[n+2]=c} - addCurvePosition(t,i,s,e,n,h,r,o,a,c,l,u){ - if(0==t||isNaN(t))return c[l]=i,c[l+1]=s,void(c[l+2]=Math.atan2(n-s,e-i)); - let d=t*t,f=d*t,p=1-t,w=p*p,g=w*p,m=p*t,v=3*m,_=p*v,M=v*t,b=i*g+e*_+h*M+o*f,y=s*g+n*_+r*M+a*f; - c[l]=b,c[l+1]=y,u&&(c[l+2]=t<.001?Math.atan2(n-s,e-i):Math.atan2(y-(s*w+n*m*2+r*d),b-(i*w+e*m*2+h*d)))} - } - ; - Qt(qJ,"PathConstraint"),Zt(qJ,"NONE",-1),Zt(qJ,"BEFORE",-2),Zt(qJ,"AFTER",-3),Zt(qJ,"epsilon",1e-5); - let XJ=qJ; - const JJ=class{ - constructor(t,i){ - Zt(this,"data"),Zt(this,"_bone",null),Zt(this,"inertia",0),Zt(this,"strength",0),Zt(this,"damping",0),Zt(this,"massInverse",0),Zt(this,"wind",0),Zt(this,"gravity",0),Zt(this,"mix",0),Zt(this,"_reset",!0),Zt(this,"ux",0),Zt(this,"uy",0),Zt(this,"cx",0),Zt(this,"cy",0),Zt(this,"tx",0),Zt(this,"ty",0),Zt(this,"xOffset",0),Zt(this,"xVelocity",0),Zt(this,"yOffset",0),Zt(this,"yVelocity",0),Zt(this,"rotateOffset",0),Zt(this,"rotateVelocity",0),Zt(this,"scaleOffset",0),Zt(this,"scaleVelocity",0),Zt(this,"active",!1),Zt(this,"skeleton"),Zt(this,"remaining",0),Zt(this,"lastTime",0),this.data=t,this.skeleton=i,this.bone=i.bones[t.bone.index],this.inertia=t.inertia,this.strength=t.strength,this.damping=t.damping,this.massInverse=t.massInverse,this.wind=t.wind,this.gravity=t.gravity,this.mix=t.mix} - set bone(t){ - this._bone=t} - get bone(){ - if(this._bone)return this._bone; - throw new Error("Bone not set.")} - reset(){ - this.remaining=0,this.lastTime=this.skeleton.time,this._reset=!0,this.xOffset=0,this.xVelocity=0,this.yOffset=0,this.yVelocity=0,this.rotateOffset=0,this.rotateVelocity=0,this.scaleOffset=0,this.scaleVelocity=0} - setToSetupPose(){ - const t=this.data; - this.inertia=t.inertia,this.strength=t.strength,this.damping=t.damping,this.massInverse=t.massInverse,this.wind=t.wind,this.gravity=t.gravity,this.mix=t.mix} - isActive(){ - return this.active} - update(t){ - const i=this.mix; - if(0==i)return; - const s=this.data.x>0,e=this.data.y>0,n=this.data.rotate>0||this.data.shearX>0,h=this.data.scaleX>0,r=this.bone,o=r.data.length; - switch(t){ - case hQ.none:return; - case hQ.reset:this.reset(); - case hQ.update:const t=this.skeleton,a=Math.max(this.skeleton.time-this.lastTime,0); - this.remaining+=a,this.lastTime=t.time; - const c=r.worldX,l=r.worldY; - if(this._reset)this._reset=!1,this.ux=c,this.uy=l; - else{ - let u=this.remaining,d=this.inertia,f=this.data.step,p=this.skeleton.data.referenceScale,w=-1,g=this.data.limit*a,m=g*Math.abs(t.scaleY); - if(g*=Math.abs(t.scaleX),s||e){ - if(s){ - const t=(this.ux-c)*d; - this.xOffset+=t>g?g:t<-g?-g:t,this.ux=c} - if(e){ - const t=(this.uy-l)*d; - this.yOffset+=t>m?m:t<-m?-m:t,this.uy=l} - if(u>=f){ - w=Math.pow(this.damping,60*f); - const i=this.massInverse*f,n=this.strength,h=this.wind*p*t.scaleX,r=this.gravity*p*t.scaleY; - do{ - s&&(this.xVelocity+=(h-this.xOffset*n)*i,this.xOffset+=this.xVelocity*f,this.xVelocity*=w),e&&(this.yVelocity-=(r+this.yOffset*n)*i,this.yOffset+=this.yVelocity*f,this.yVelocity*=w),u-=f} - while(u>=f)} - s&&(r.worldX+=this.xOffset*i*this.data.x),e&&(r.worldY+=this.yOffset*i*this.data.y)} - if(n||h){ - let t=Math.atan2(r.c,r.a),s=0,e=0,a=0,c=this.cx-r.worldX,l=this.cy-r.worldY; - if(c>g?c=g:c<-g&&(c=-g),l>m?l=m:l<-m&&(l=-m),n){ - a=(this.data.rotate+this.data.shearX)*i; - let n=Math.atan2(l+this.ty,c+this.tx)-t-this.rotateOffset*a; - this.rotateOffset+=(n-Math.ceil(n*FY.invPI2-.5)*FY.PI2)*d,n=this.rotateOffset*a+t,s=Math.cos(n),e=Math.sin(n),h&&(n=o*r.getWorldScaleX(),n>0&&(this.scaleOffset+=(c*s+l*e)*d/n))} - else{ - s=Math.cos(t),e=Math.sin(t); - const i=o*r.getWorldScaleX(); - i>0&&(this.scaleOffset+=(c*s+l*e)*d/i)} - if(u=this.remaining,u>=f){ - -1==w&&(w=Math.pow(this.damping,60*f)); - const i=this.massInverse*f,r=this.strength,c=this.wind,l=nQ.yDown?-this.gravity:this.gravity,d=o/p; - for(; - ; - )if(u-=f,h&&(this.scaleVelocity+=(c*s-l*e-this.scaleOffset*r)*i,this.scaleOffset+=this.scaleVelocity*f,this.scaleVelocity*=w),n){ - if(this.rotateVelocity-=((c*e+l*s)*d+this.rotateOffset*r)*i,this.rotateOffset+=this.rotateVelocity*f,this.rotateVelocity*=w,u<f)break; - const n=this.rotateOffset*a+t; - s=Math.cos(n),e=Math.sin(n)} - else if(u<f)break} - } - this.remaining=u} - this.cx=r.worldX,this.cy=r.worldY; - break; - case hQ.pose:s&&(r.worldX+=this.xOffset*i*this.data.x),e&&(r.worldY+=this.yOffset*i*this.data.y)} - if(n){ - let t=this.rotateOffset*i,s=0,e=0,n=0; - if(this.data.shearX>0){ - let i=0; - this.data.rotate>0&&(i=t*this.data.rotate,s=Math.sin(i),e=Math.cos(i),n=r.b,r.b=e*n-s*r.d,r.d=s*n+e*r.d),i+=t*this.data.shearX,s=Math.sin(i),e=Math.cos(i),n=r.a,r.a=e*n-s*r.c,r.c=s*n+e*r.c} - else t*=this.data.rotate,s=Math.sin(t),e=Math.cos(t),n=r.a,r.a=e*n-s*r.c,r.c=s*n+e*r.c,n=r.b,r.b=e*n-s*r.d,r.d=s*n+e*r.d} - if(h){ - const t=1+this.scaleOffset*i*this.data.scaleX; - r.a*=t,r.c*=t} - t!=hQ.pose&&(this.tx=o*r.a,this.ty=o*r.c),r.updateAppliedTransform()} - translate(t,i){ - this.ux-=t,this.uy-=i,this.cx-=t,this.cy-=i} - rotate(t,i,s){ - const e=s*FY.degRad,n=Math.cos(e),h=Math.sin(e),r=this.cx-t,o=this.cy-i; - this.translate(r*n-o*h-r,r*h+o*n-o)} - } - ; - Qt(JJ,"PhysicsConstraint"); - let QJ=JJ; - const ZJ=class{ - constructor(t,i){ - if(Zt(this,"data"),Zt(this,"bone"),Zt(this,"color"),Zt(this,"darkColor",null),Zt(this,"attachment",null),Zt(this,"attachmentState",0),Zt(this,"sequenceIndex",-1),Zt(this,"deform",new Array),!t)throw new Error("data cannot be null."); - if(!i)throw new Error("bone cannot be null."); - this.data=t,this.bone=i,this.color=new BY,this.darkColor=t.darkColor?new BY:null,this.setToSetupPose()} - getSkeleton(){ - return this.bone.skeleton} - getAttachment(){ - return this.attachment} - setAttachment(t){ - this.attachment!=t&&(t instanceof XY&&this.attachment instanceof XY&&t.timelineAttachment==this.attachment.timelineAttachment||(this.deform.length=0),this.attachment=t,this.sequenceIndex=-1)} - setToSetupPose(){ - this.color.setFromColor(this.data.color),this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),this.data.attachmentName?(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName))):this.attachment=null} - } - ; - Qt(ZJ,"Slot"); - let tQ=ZJ; - const iQ=class{ - constructor(t,i){ - if(Zt(this,"data"),Zt(this,"bones"),Zt(this,"target"),Zt(this,"mixRotate",0),Zt(this,"mixX",0),Zt(this,"mixY",0),Zt(this,"mixScaleX",0),Zt(this,"mixScaleY",0),Zt(this,"mixShearY",0),Zt(this,"temp",new KY),Zt(this,"active",!1),!t)throw new Error("data cannot be null."); - if(!i)throw new Error("skeleton cannot be null."); - this.data=t,this.bones=new Array; - for(let e=0; - e<t.bones.length; - e++){ - let s=i.findBone(t.bones[e].name); - if(!s)throw new Error(`Couldn't find bone ${ - t.bones[e].name} - .`); - this.bones.push(s)} - let s=i.findBone(t.target.name); - if(!s)throw new Error(`Couldn't find target bone ${ - t.target.name} - .`); - this.target=s,this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY} - isActive(){ - return this.active} - setToSetupPose(){ - const t=this.data; - this.mixRotate=t.mixRotate,this.mixX=t.mixX,this.mixY=t.mixY,this.mixScaleX=t.mixScaleX,this.mixScaleY=t.mixScaleY,this.mixShearY=t.mixShearY} - update(t){ - 0==this.mixRotate&&0==this.mixX&&0==this.mixY&&0==this.mixScaleX&&0==this.mixScaleY&&0==this.mixShearY||(this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld())} - applyAbsoluteWorld(){ - let t=this.mixRotate,i=this.mixX,s=this.mixY,e=this.mixScaleX,n=this.mixScaleY,h=this.mixShearY,r=0!=i||0!=s,o=this.target,a=o.a,c=o.b,l=o.c,u=o.d,d=a*u-c*l>0?FY.degRad:-.01745329277777778,f=this.data.offsetRotation*d,p=this.data.offsetShearY*d,w=this.bones; - for(let g=0,m=w.length; - g<m; - g++){ - let d=w[g]; - if(0!=t){ - let i=d.a,s=d.b,e=d.c,n=d.d,h=Math.atan2(l,a)-Math.atan2(e,i)+f; - h>FY.PI?h-=FY.PI2:h<-3.1415927&&(h+=FY.PI2),h*=t; - let r=Math.cos(h),o=Math.sin(h); - d.a=r*i-o*e,d.b=r*s-o*n,d.c=o*i+r*e,d.d=o*s+r*n} - if(r){ - let t=this.temp; - o.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),d.worldX+=(t.x-d.worldX)*i,d.worldY+=(t.y-d.worldY)*s} - if(0!=e){ - let t=Math.sqrt(d.a*d.a+d.c*d.c); - 0!=t&&(t=(t+(Math.sqrt(a*a+l*l)-t+this.data.offsetScaleX)*e)/t),d.a*=t,d.c*=t} - if(0!=n){ - let t=Math.sqrt(d.b*d.b+d.d*d.d); - 0!=t&&(t=(t+(Math.sqrt(c*c+u*u)-t+this.data.offsetScaleY)*n)/t),d.b*=t,d.d*=t} - if(h>0){ - let t=d.b,i=d.d,s=Math.atan2(i,t),e=Math.atan2(u,c)-Math.atan2(l,a)-(s-Math.atan2(d.c,d.a)); - e>FY.PI?e-=FY.PI2:e<-3.1415927&&(e+=FY.PI2),e=s+(e+p)*h; - let n=Math.sqrt(t*t+i*i); - d.b=Math.cos(e)*n,d.d=Math.sin(e)*n} - d.updateAppliedTransform()} - } - applyRelativeWorld(){ - let t=this.mixRotate,i=this.mixX,s=this.mixY,e=this.mixScaleX,n=this.mixScaleY,h=this.mixShearY,r=0!=i||0!=s,o=this.target,a=o.a,c=o.b,l=o.c,u=o.d,d=a*u-c*l>0?FY.degRad:-.01745329277777778,f=this.data.offsetRotation*d,p=this.data.offsetShearY*d,w=this.bones; - for(let g=0,m=w.length; - g<m; - g++){ - let d=w[g]; - if(0!=t){ - let i=d.a,s=d.b,e=d.c,n=d.d,h=Math.atan2(l,a)+f; - h>FY.PI?h-=FY.PI2:h<-3.1415927&&(h+=FY.PI2),h*=t; - let r=Math.cos(h),o=Math.sin(h); - d.a=r*i-o*e,d.b=r*s-o*n,d.c=o*i+r*e,d.d=o*s+r*n} - if(r){ - let t=this.temp; - o.localToWorld(t.set(this.data.offsetX,this.data.offsetY)),d.worldX+=t.x*i,d.worldY+=t.y*s} - if(0!=e){ - let t=(Math.sqrt(a*a+l*l)-1+this.data.offsetScaleX)*e+1; - d.a*=t,d.c*=t} - if(0!=n){ - let t=(Math.sqrt(c*c+u*u)-1+this.data.offsetScaleY)*n+1; - d.b*=t,d.d*=t} - if(h>0){ - let t=Math.atan2(u,c)-Math.atan2(l,a); - t>FY.PI?t-=FY.PI2:t<-3.1415927&&(t+=FY.PI2); - let i=d.b,s=d.d; - t=Math.atan2(s,i)+(t-FY.PI/2+p)*h; - let e=Math.sqrt(i*i+s*s); - d.b=Math.cos(t)*e,d.d=Math.sin(t)*e} - d.updateAppliedTransform()} - } - applyAbsoluteLocal(){ - let t=this.mixRotate,i=this.mixX,s=this.mixY,e=this.mixScaleX,n=this.mixScaleY,h=this.mixShearY,r=this.target,o=this.bones; - for(let a=0,c=o.length; - a<c; - a++){ - let c=o[a],l=c.arotation; - 0!=t&&(l+=(r.arotation-l+this.data.offsetRotation)*t); - let u=c.ax,d=c.ay; - u+=(r.ax-u+this.data.offsetX)*i,d+=(r.ay-d+this.data.offsetY)*s; - let f=c.ascaleX,p=c.ascaleY; - 0!=e&&0!=f&&(f=(f+(r.ascaleX-f+this.data.offsetScaleX)*e)/f),0!=n&&0!=p&&(p=(p+(r.ascaleY-p+this.data.offsetScaleY)*n)/p); - let w=c.ashearY; - 0!=h&&(w+=(r.ashearY-w+this.data.offsetShearY)*h),c.updateWorldTransformWith(u,d,l,f,p,c.ashearX,w)} - } - applyRelativeLocal(){ - let t=this.mixRotate,i=this.mixX,s=this.mixY,e=this.mixScaleX,n=this.mixScaleY,h=this.mixShearY,r=this.target,o=this.bones; - for(let a=0,c=o.length; - a<c; - a++){ - let c=o[a],l=c.arotation+(r.arotation+this.data.offsetRotation)*t,u=c.ax+(r.ax+this.data.offsetX)*i,d=c.ay+(r.ay+this.data.offsetY)*s,f=c.ascaleX*((r.ascaleX-1+this.data.offsetScaleX)*e+1),p=c.ascaleY*((r.ascaleY-1+this.data.offsetScaleY)*n+1),w=c.ashearY+(r.ashearY+this.data.offsetShearY)*h; - c.updateWorldTransformWith(u,d,l,f,p,c.ashearX,w)} - } - } - ; - Qt(iQ,"TransformConstraint"); - let sQ=iQ; - const eQ=class t{ - constructor(t){ - if(Zt(this,"data"),Zt(this,"bones"),Zt(this,"slots"),Zt(this,"drawOrder"),Zt(this,"ikConstraints"),Zt(this,"transformConstraints"),Zt(this,"pathConstraints"),Zt(this,"physicsConstraints"),Zt(this,"_updateCache",new Array),Zt(this,"skin",null),Zt(this,"color"),Zt(this,"scaleX",1),Zt(this,"_scaleY",1),Zt(this,"x",0),Zt(this,"y",0),Zt(this,"time",0),!t)throw new Error("data cannot be null."); - this.data=t,this.bones=new Array; - for(let i=0; - i<t.bones.length; - i++){ - let s,e=t.bones[i]; - if(e.parent){ - let t=this.bones[e.parent.index]; - s=new xJ(e,this,t),t.children.push(s)} - else s=new xJ(e,this,null); - this.bones.push(s)} - this.slots=new Array,this.drawOrder=new Array; - for(let i=0; - i<t.slots.length; - i++){ - let s=t.slots[i],e=this.bones[s.boneData.index],n=new tQ(s,e); - this.slots.push(n),this.drawOrder.push(n)} - this.ikConstraints=new Array; - for(let i=0; - i<t.ikConstraints.length; - i++){ - let s=t.ikConstraints[i]; - this.ikConstraints.push(new BJ(s,this))} - this.transformConstraints=new Array; - for(let i=0; - i<t.transformConstraints.length; - i++){ - let s=t.transformConstraints[i]; - this.transformConstraints.push(new sQ(s,this))} - this.pathConstraints=new Array; - for(let i=0; - i<t.pathConstraints.length; - i++){ - let s=t.pathConstraints[i]; - this.pathConstraints.push(new XJ(s,this))} - this.physicsConstraints=new Array; - for(let i=0; - i<t.physicsConstraints.length; - i++){ - let s=t.physicsConstraints[i]; - this.physicsConstraints.push(new QJ(s,this))} - this.color=new BY(1,1,1,1),this.updateCache()} - get scaleY(){ - return t.yDown?-this._scaleY:this._scaleY} - set scaleY(t){ - this._scaleY=t} - updateCache(){ - this._updateCache.length=0; - let t=this.bones; - for(let l=0,u=t.length; - l<u; - l++){ - let i=t[l]; - i.sorted=i.data.skinRequired,i.active=!i.sorted} - if(this.skin){ - let t=this.skin.bones; - for(let i=0,s=this.skin.bones.length; - i<s; - i++){ - let s=this.bones[t[i].index]; - do{ - s.sorted=!1,s.active=!0,s=s.parent} - while(s)} - } - let i=this.ikConstraints,s=this.transformConstraints,e=this.pathConstraints,n=this.physicsConstraints,h=i.length,r=s.length,o=e.length,a=this.physicsConstraints.length,c=h+r+o+a; - t:for(let l=0; - l<c; - l++){ - for(let t=0; - t<h; - t++){ - let s=i[t]; - if(s.data.order==l){ - this.sortIkConstraint(s); - continue t} - } - for(let t=0; - t<r; - t++){ - let i=s[t]; - if(i.data.order==l){ - this.sortTransformConstraint(i); - continue t} - } - for(let t=0; - t<o; - t++){ - let i=e[t]; - if(i.data.order==l){ - this.sortPathConstraint(i); - continue t} - } - for(let t=0; - t<a; - t++){ - const i=n[t]; - if(i.data.order==l){ - this.sortPhysicsConstraint(i); - continue t} - } - } - for(let l=0,u=t.length; - l<u; - l++)this.sortBone(t[l])} - sortIkConstraint(t){ - if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&HY.contains(this.skin.constraints,t.data,!0)),!t.active)return; - let i=t.target; - this.sortBone(i); - let s=t.bones,e=s[0]; - if(this.sortBone(e),1==s.length)this._updateCache.push(t),this.sortReset(e.children); - else{ - let i=s[s.length-1]; - this.sortBone(i),this._updateCache.push(t),this.sortReset(e.children),i.sorted=!0} - } - sortPathConstraint(t){ - if(t.active=t.target.bone.isActive()&&(!t.data.skinRequired||this.skin&&HY.contains(this.skin.constraints,t.data,!0)),!t.active)return; - let i=t.target,s=i.data.index,e=i.bone; - this.skin&&this.sortPathConstraintAttachment(this.skin,s,e),this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,s,e); - for(let o=0,a=this.data.skins.length; - o<a; - o++)this.sortPathConstraintAttachment(this.data.skins[o],s,e); - let n=i.getAttachment(); - n instanceof _J&&this.sortPathConstraintAttachmentWith(n,e); - let h=t.bones,r=h.length; - for(let o=0; - o<r; - o++)this.sortBone(h[o]); - this._updateCache.push(t); - for(let o=0; - o<r; - o++)this.sortReset(h[o].children); - for(let o=0; - o<r; - o++)h[o].sorted=!0} - sortTransformConstraint(t){ - if(t.active=t.target.isActive()&&(!t.data.skinRequired||this.skin&&HY.contains(this.skin.constraints,t.data,!0)),!t.active)return; - this.sortBone(t.target); - let i=t.bones,s=i.length; - if(t.data.local)for(let e=0; - e<s; - e++){ - let t=i[e]; - this.sortBone(t.parent),this.sortBone(t)} - else for(let e=0; - e<s; - e++)this.sortBone(i[e]); - this._updateCache.push(t); - for(let e=0; - e<s; - e++)this.sortReset(i[e].children); - for(let e=0; - e<s; - e++)i[e].sorted=!0} - sortPathConstraintAttachment(t,i,s){ - let e=t.attachments[i]; - if(e)for(let n in e)this.sortPathConstraintAttachmentWith(e[n],s)} - sortPathConstraintAttachmentWith(t,i){ - if(!(t instanceof _J))return; - let s=t.bones; - if(s){ - let t=this.bones; - for(let i=0,e=s.length; - i<e; - ){ - let e=s[i++]; - for(e+=i; - i<e; - )this.sortBone(t[s[i++]])} - } - else this.sortBone(i)} - sortPhysicsConstraint(t){ - const i=t.bone; - t.active=i.active&&(!t.data.skinRequired||null!=this.skin&&HY.contains(this.skin.constraints,t.data,!0)),t.active&&(this.sortBone(i),this._updateCache.push(t),this.sortReset(i.children),i.sorted=!0)} - sortBone(t){ - if(!t)return; - if(t.sorted)return; - let i=t.parent; - i&&this.sortBone(i),t.sorted=!0,this._updateCache.push(t)} - sortReset(t){ - for(let i=0,s=t.length; - i<s; - i++){ - let s=t[i]; - s.active&&(s.sorted&&this.sortReset(s.children),s.sorted=!1)} - } - updateWorldTransform(t){ - if(null==t)throw new Error("physics is undefined"); - let i=this.bones; - for(let e=0,n=i.length; - e<n; - e++){ - let t=i[e]; - t.ax=t.x,t.ay=t.y,t.arotation=t.rotation,t.ascaleX=t.scaleX,t.ascaleY=t.scaleY,t.ashearX=t.shearX,t.ashearY=t.shearY} - let s=this._updateCache; - for(let e=0,n=s.length; - e<n; - e++)s[e].update(t)} - updateWorldTransformWith(t,i){ - if(!i)throw new Error("parent cannot be null."); - let s=this.bones; - for(let w=1,g=s.length; - w<g; - w++){ - let t=s[w]; - t.ax=t.x,t.ay=t.y,t.arotation=t.rotation,t.ascaleX=t.scaleX,t.ascaleY=t.scaleY,t.ashearX=t.shearX,t.ashearY=t.shearY} - let e=this.getRootBone(); - if(!e)throw new Error("Root bone must not be null."); - let n=i.a,h=i.b,r=i.c,o=i.d; - e.worldX=n*this.x+h*this.y+i.worldX,e.worldY=r*this.x+o*this.y+i.worldY; - const a=(e.rotation+e.shearX)*FY.degRad,c=(e.rotation+90+e.shearY)*FY.degRad,l=Math.cos(a)*e.scaleX,u=Math.cos(c)*e.scaleY,d=Math.sin(a)*e.scaleX,f=Math.sin(c)*e.scaleY; - e.a=(n*l+h*d)*this.scaleX,e.b=(n*u+h*f)*this.scaleX,e.c=(r*l+o*d)*this.scaleY,e.d=(r*u+o*f)*this.scaleY; - let p=this._updateCache; - for(let w=0,g=p.length; - w<g; - w++){ - let i=p[w]; - i!=e&&i.update(t)} - } - setToSetupPose(){ - this.setBonesToSetupPose(),this.setSlotsToSetupPose()} - setBonesToSetupPose(){ - for(const t of this.bones)t.setToSetupPose(); - for(const t of this.ikConstraints)t.setToSetupPose(); - for(const t of this.transformConstraints)t.setToSetupPose(); - for(const t of this.pathConstraints)t.setToSetupPose(); - for(const t of this.physicsConstraints)t.setToSetupPose()} - setSlotsToSetupPose(){ - let t=this.slots; - HY.arrayCopy(t,0,this.drawOrder,0,t.length); - for(let i=0,s=t.length; - i<s; - i++)t[i].setToSetupPose()} - getRootBone(){ - return 0==this.bones.length?null:this.bones[0]} - findBone(t){ - if(!t)throw new Error("boneName cannot be null."); - let i=this.bones; - for(let s=0,e=i.length; - s<e; - s++){ - let e=i[s]; - if(e.data.name==t)return e} - return null} - findSlot(t){ - if(!t)throw new Error("slotName cannot be null."); - let i=this.slots; - for(let s=0,e=i.length; - s<e; - s++){ - let e=i[s]; - if(e.data.name==t)return e} - return null} - setSkinByName(t){ - let i=this.data.findSkin(t); - if(!i)throw new Error("Skin not found: "+t); - this.setSkin(i)} - setSkin(t){ - if(t!=this.skin){ - if(t)if(this.skin)t.attachAll(this,this.skin); - else{ - let i=this.slots; - for(let s=0,e=i.length; - s<e; - s++){ - let e=i[s],n=e.data.attachmentName; - if(n){ - let i=t.getAttachment(s,n); - i&&e.setAttachment(i)} - } - } - this.skin=t,this.updateCache()} - } - getAttachmentByName(t,i){ - let s=this.data.findSlot(t); - if(!s)throw new Error(`Can't find slot with name ${ - t} - `); - return this.getAttachment(s.index,i)} - getAttachment(t,i){ - if(!i)throw new Error("attachmentName cannot be null."); - if(this.skin){ - let s=this.skin.getAttachment(t,i); - if(s)return s} - return this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,i):null} - setAttachment(t,i){ - if(!t)throw new Error("slotName cannot be null."); - let s=this.slots; - for(let e=0,n=s.length; - e<n; - e++){ - let n=s[e]; - if(n.data.name==t){ - let s=null; - if(i&&(s=this.getAttachment(e,i),!s))throw new Error("Attachment not found: "+i+", for slot: "+t); - return void n.setAttachment(s)} - } - throw new Error("Slot not found: "+t)} - findIkConstraint(t){ - if(!t)throw new Error("constraintName cannot be null."); - return this.ikConstraints.find(i=>i.data.name==t)??null} - findTransformConstraint(t){ - if(!t)throw new Error("constraintName cannot be null."); - return this.transformConstraints.find(i=>i.data.name==t)??null} - findPathConstraint(t){ - if(!t)throw new Error("constraintName cannot be null."); - return this.pathConstraints.find(i=>i.data.name==t)??null} - findPhysicsConstraint(t){ - if(null==t)throw new Error("constraintName cannot be null."); - return this.physicsConstraints.find(i=>i.data.name==t)??null} - getBoundsRect(t){ - let i=new KY,s=new KY; - return this.getBounds(i,s,void 0,t),{ - x:i.x,y:i.y,width:s.x,height:s.y} - } - getBounds(i,s,e=new Array(2),n=null){ - if(!i)throw new Error("offset cannot be null."); - if(!s)throw new Error("size cannot be null."); - let h=this.drawOrder,r=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY; - for(let l=0,u=h.length; - l<u; - l++){ - let i=h[l]; - if(!i.bone.active)continue; - let s=0,u=null,d=null,f=i.getAttachment(); - if(f instanceof EJ)s=8,u=HY.setArraySize(e,s,0),f.computeWorldVertices(i,u,0,2),d=t.quadTriangles; - else if(f instanceof mJ){ - let t=f; - s=t.worldVerticesLength,u=HY.setArraySize(e,s,0),t.computeWorldVertices(i,0,s,u,0,2),d=t.triangles} - else if(f instanceof ZX&&null!=n){ - n.clipStart(i,f); - continue} - if(u&&d){ - null!=n&&n.isClipping()&&(n.clipTriangles(u,d,d.length),u=n.clippedVertices,s=n.clippedVertices.length); - for(let t=0,i=u.length; - t<i; - t+=2){ - let i=u[t],s=u[t+1]; - r=Math.min(r,i),o=Math.min(o,s),a=Math.max(a,i),c=Math.max(c,s)} - } - null!=n&&n.clipEndWithSlot(i)} - null!=n&&n.clipEnd(),i.set(r,o),s.set(a-r,c-o)} - update(t){ - this.time+=t} - physicsTranslate(t,i){ - const s=this.physicsConstraints; - for(let e=0,n=s.length; - e<n; - e++)s[e].translate(t,i)} - physicsRotate(t,i,s){ - const e=this.physicsConstraints; - for(let n=0,h=e.length; - n<h; - n++)e[n].rotate(t,i,s)} - } - ; - Qt(eQ,"Skeleton"),Zt(eQ,"quadTriangles",[0,1,2,2,3,0]),Zt(eQ,"yDown",!1); - let nQ=eQ; - var hQ,rQ; - (rQ=hQ||(hQ={ - } - ))[rQ.none=0]="none",rQ[rQ.reset=1]="reset",rQ[rQ.update=2]="update",rQ[rQ.pose=3]="pose"; - const oQ=class extends PJ{ - constructor(t){ - super(t,0,!1),Zt(this,"_bone",null),Zt(this,"x",0),Zt(this,"y",0),Zt(this,"rotate",0),Zt(this,"scaleX",0),Zt(this,"shearX",0),Zt(this,"limit",0),Zt(this,"step",0),Zt(this,"inertia",0),Zt(this,"strength",0),Zt(this,"damping",0),Zt(this,"massInverse",0),Zt(this,"wind",0),Zt(this,"gravity",0),Zt(this,"mix",0),Zt(this,"inertiaGlobal",!1),Zt(this,"strengthGlobal",!1),Zt(this,"dampingGlobal",!1),Zt(this,"massGlobal",!1),Zt(this,"windGlobal",!1),Zt(this,"gravityGlobal",!1),Zt(this,"mixGlobal",!1)} - set bone(t){ - this._bone=t} - get bone(){ - if(this._bone)return this._bone; - throw new Error("BoneData not set.")} - } - ; - Qt(oQ,"PhysicsConstraintData"); - let aQ=oQ; - const cQ=class{ - constructor(){ - Zt(this,"name",null),Zt(this,"bones",new Array),Zt(this,"slots",new Array),Zt(this,"skins",new Array),Zt(this,"defaultSkin",null),Zt(this,"events",new Array),Zt(this,"animations",new Array),Zt(this,"ikConstraints",new Array),Zt(this,"transformConstraints",new Array),Zt(this,"pathConstraints",new Array),Zt(this,"physicsConstraints",new Array),Zt(this,"x",0),Zt(this,"y",0),Zt(this,"width",0),Zt(this,"height",0),Zt(this,"referenceScale",100),Zt(this,"version",null),Zt(this,"hash",null),Zt(this,"fps",0),Zt(this,"imagesPath",null),Zt(this,"audioPath",null)} - findBone(t){ - if(!t)throw new Error("boneName cannot be null."); - let i=this.bones; - for(let s=0,e=i.length; - s<e; - s++){ - let e=i[s]; - if(e.name==t)return e} - return null} - findSlot(t){ - if(!t)throw new Error("slotName cannot be null."); - let i=this.slots; - for(let s=0,e=i.length; - s<e; - s++){ - let e=i[s]; - if(e.name==t)return e} - return null} - findSkin(t){ - if(!t)throw new Error("skinName cannot be null."); - let i=this.skins; - for(let s=0,e=i.length; - s<e; - s++){ - let e=i[s]; - if(e.name==t)return e} - return null} - findEvent(t){ - if(!t)throw new Error("eventDataName cannot be null."); - let i=this.events; - for(let s=0,e=i.length; - s<e; - s++){ - let e=i[s]; - if(e.name==t)return e} - return null} - findAnimation(t){ - if(!t)throw new Error("animationName cannot be null."); - let i=this.animations; - for(let s=0,e=i.length; - s<e; - s++){ - let e=i[s]; - if(e.name==t)return e} - return null} - findIkConstraint(t){ - if(!t)throw new Error("constraintName cannot be null."); - const i=this.ikConstraints; - for(let s=0,e=i.length; - s<e; - s++){ - const e=i[s]; - if(e.name==t)return e} - return null} - findTransformConstraint(t){ - if(!t)throw new Error("constraintName cannot be null."); - const i=this.transformConstraints; - for(let s=0,e=i.length; - s<e; - s++){ - const e=i[s]; - if(e.name==t)return e} - return null} - findPathConstraint(t){ - if(!t)throw new Error("constraintName cannot be null."); - const i=this.pathConstraints; - for(let s=0,e=i.length; - s<e; - s++){ - const e=i[s]; - if(e.name==t)return e} - return null} - findPhysicsConstraint(t){ - if(!t)throw new Error("constraintName cannot be null."); - const i=this.physicsConstraints; - for(let s=0,e=i.length; - s<e; - s++){ - const e=i[s]; - if(e.name==t)return e} - return null} - } - ; - Qt(cQ,"SkeletonData"); - let lQ=cQ; - const uQ=class{ - constructor(t=0,i,s){ - Zt(this,"slotIndex"),Zt(this,"name"),Zt(this,"attachment"),this.slotIndex=t,this.name=i,this.attachment=s} - } - ; - Qt(uQ,"SkinEntry"); - let dQ=uQ; - const fQ=class{ - constructor(t){ - if(Zt(this,"name"),Zt(this,"attachments",new Array),Zt(this,"bones",Array()),Zt(this,"constraints",new Array),Zt(this,"color",new BY(.99607843,.61960787,.30980393,1)),!t)throw new Error("name cannot be null."); - this.name=t} - setAttachment(t,i,s){ - if(!s)throw new Error("attachment cannot be null."); - let e=this.attachments; - t>=e.length&&(e.length=t+1),e[t]||(e[t]={ - } - ),e[t][i]=s} - addSkin(t){ - for(let e=0; - e<t.bones.length; - e++){ - let i=t.bones[e],s=!1; - for(let t=0; - t<this.bones.length; - t++)if(this.bones[t]==i){ - s=!0; - break} - s||this.bones.push(i)} - for(let e=0; - e<t.constraints.length; - e++){ - let i=t.constraints[e],s=!1; - for(let t=0; - t<this.constraints.length; - t++)if(this.constraints[t]==i){ - s=!0; - break} - s||this.constraints.push(i)} - let i=t.getAttachments(); - for(let e=0; - e<i.length; - e++){ - var s=i[e]; - this.setAttachment(s.slotIndex,s.name,s.attachment)} - } - copySkin(t){ - for(let e=0; - e<t.bones.length; - e++){ - let i=t.bones[e],s=!1; - for(let t=0; - t<this.bones.length; - t++)if(this.bones[t]==i){ - s=!0; - break} - s||this.bones.push(i)} - for(let e=0; - e<t.constraints.length; - e++){ - let i=t.constraints[e],s=!1; - for(let t=0; - t<this.constraints.length; - t++)if(this.constraints[t]==i){ - s=!0; - break} - s||this.constraints.push(i)} - let i=t.getAttachments(); - for(let e=0; - e<i.length; - e++){ - var s=i[e]; - s.attachment&&(s.attachment instanceof mJ?(s.attachment=s.attachment.newLinkedMesh(),this.setAttachment(s.slotIndex,s.name,s.attachment)):(s.attachment=s.attachment.copy(),this.setAttachment(s.slotIndex,s.name,s.attachment)))} - } - getAttachment(t,i){ - let s=this.attachments[t]; - return s?s[i]:null} - removeAttachment(t,i){ - let s=this.attachments[t]; - s&&delete s[i]} - getAttachments(){ - let t=new Array; - for(var i=0; - i<this.attachments.length; - i++){ - let s=this.attachments[i]; - if(s)for(let e in s){ - let n=s[e]; - n&&t.push(new dQ(i,e,n))} - } - return t} - getAttachmentsForSlot(t,i){ - let s=this.attachments[t]; - if(s)for(let e in s){ - let n=s[e]; - n&&i.push(new dQ(t,e,n))} - } - clear(){ - this.attachments.length=0,this.bones.length=0,this.constraints.length=0} - attachAll(t,i){ - let s=0; - for(let e=0; - e<t.slots.length; - e++){ - let n=t.slots[e],h=n.getAttachment(); - if(h&&s<i.attachments.length){ - let t=i.attachments[s]; - for(let i in t)if(h==t[i]){ - let t=this.getAttachment(s,i); - t&&n.setAttachment(t); - break} - } - s++} - } - } - ; - Qt(fQ,"Skin"); - let pQ=fQ; - const wQ=class{ - constructor(t,i,s){ - if(Zt(this,"index",0),Zt(this,"name"),Zt(this,"boneData"),Zt(this,"color",new BY(1,1,1,1)),Zt(this,"darkColor",null),Zt(this,"attachmentName",null),Zt(this,"blendMode",mQ.Normal),Zt(this,"visible",!0),t<0)throw new Error("index must be >= 0."); - if(!i)throw new Error("name cannot be null."); - if(!s)throw new Error("boneData cannot be null."); - this.index=t,this.name=i,this.boneData=s} - } - ; - Qt(wQ,"SlotData"); - let gQ=wQ; - var mQ,vQ; - (vQ=mQ||(mQ={ - } - ))[vQ.Normal=0]="Normal",vQ[vQ.Additive=1]="Additive",vQ[vQ.Multiply=2]="Multiply",vQ[vQ.Screen=3]="Screen"; - const _Q=class extends PJ{ - constructor(t){ - super(t,0,!1),Zt(this,"bones",new Array),Zt(this,"_target",null),Zt(this,"mixRotate",0),Zt(this,"mixX",0),Zt(this,"mixY",0),Zt(this,"mixScaleX",0),Zt(this,"mixScaleY",0),Zt(this,"mixShearY",0),Zt(this,"offsetRotation",0),Zt(this,"offsetX",0),Zt(this,"offsetY",0),Zt(this,"offsetScaleX",0),Zt(this,"offsetScaleY",0),Zt(this,"offsetShearY",0),Zt(this,"relative",!1),Zt(this,"local",!1)} - set target(t){ - this._target=t} - get target(){ - if(this._target)return this._target; - throw new Error("BoneData not set.")} - } - ; - Qt(_Q,"TransformConstraintData"); - let MQ=_Q; - const bQ=class{ - constructor(t){ - Zt(this,"scale",1),Zt(this,"attachmentLoader"),Zt(this,"linkedMeshes",new Array),this.attachmentLoader=t} - readSkeletonData(t){ - let i=this.scale,s=new lQ; - s.name=""; - let e=new AQ(t),n=e.readInt32(),h=e.readInt32(); - s.hash=0==h&&0==n?null:h.toString(16)+n.toString(16),s.version=e.readString(),s.x=e.readFloat(),s.y=e.readFloat(),s.width=e.readFloat(),s.height=e.readFloat(),s.referenceScale=e.readFloat()*i; - let r=e.readBoolean(); - r&&(s.fps=e.readFloat(),s.imagesPath=e.readString(),s.audioPath=e.readString()); - let o=0; - o=e.readInt(!0); - for(let c=0; - c<o; - c++){ - let t=e.readString(); - if(!t)throw new Error("String in string table must not be null."); - e.strings.push(t)} - o=e.readInt(!0); - for(let c=0; - c<o; - c++){ - let t=e.readString(); - if(!t)throw new Error("Bone name must not be null."); - let n=0==c?null:s.bones[e.readInt(!0)],h=new CJ(c,t,n); - h.rotation=e.readFloat(),h.x=e.readFloat()*i,h.y=e.readFloat()*i,h.scaleX=e.readFloat(),h.scaleY=e.readFloat(),h.shearX=e.readFloat(),h.shearY=e.readFloat(),h.length=e.readFloat()*i,h.inherit=e.readByte(),h.skinRequired=e.readBoolean(),r&&(BY.rgba8888ToColor(h.color,e.readInt32()),h.icon=e.readString()??void 0,h.visible=e.readBoolean()),s.bones.push(h)} - o=e.readInt(!0); - for(let c=0; - c<o; - c++){ - let t=e.readString(); - if(!t)throw new Error("Slot name must not be null."); - let i=s.bones[e.readInt(!0)],n=new gQ(c,t,i); - BY.rgba8888ToColor(n.color,e.readInt32()); - let h=e.readInt32(); - -1!=h&&BY.rgb888ToColor(n.darkColor=new BY,h),n.attachmentName=e.readStringRef(),n.blendMode=e.readInt(!0),r&&(n.visible=e.readBoolean()),s.slots.push(n)} - o=e.readInt(!0); - for(let c,l=0; - l<o; - l++){ - let t=e.readString(); - if(!t)throw new Error("IK constraint data name must not be null."); - let n=new FJ(t); - n.order=e.readInt(!0),c=e.readInt(!0); - for(let i=0; - i<c; - i++)n.bones.push(s.bones[e.readInt(!0)]); - n.target=s.bones[e.readInt(!0)]; - let h=e.readByte(); - n.skinRequired=!!(1&h),n.bendDirection=2&h?1:-1,n.compress=!!(4&h),n.stretch=!!(8&h),n.uniform=!!(16&h),32&h&&(n.mix=64&h?e.readFloat():1),128&h&&(n.softness=e.readFloat()*i),s.ikConstraints.push(n)} - o=e.readInt(!0); - for(let c,l=0; - l<o; - l++){ - let t=e.readString(); - if(!t)throw new Error("Transform constraint data name must not be null."); - let n=new MQ(t); - n.order=e.readInt(!0),c=e.readInt(!0); - for(let i=0; - i<c; - i++)n.bones.push(s.bones[e.readInt(!0)]); - n.target=s.bones[e.readInt(!0)]; - let h=e.readByte(); - n.skinRequired=!!(1&h),n.local=!!(2&h),n.relative=!!(4&h),8&h&&(n.offsetRotation=e.readFloat()),16&h&&(n.offsetX=e.readFloat()*i),32&h&&(n.offsetY=e.readFloat()*i),64&h&&(n.offsetScaleX=e.readFloat()),128&h&&(n.offsetScaleY=e.readFloat()),h=e.readByte(),1&h&&(n.offsetShearY=e.readFloat()),2&h&&(n.mixRotate=e.readFloat()),4&h&&(n.mixX=e.readFloat()),8&h&&(n.mixY=e.readFloat()),16&h&&(n.mixScaleX=e.readFloat()),32&h&&(n.mixScaleY=e.readFloat()),64&h&&(n.mixShearY=e.readFloat()),s.transformConstraints.push(n)} - o=e.readInt(!0); - for(let c,l=0; - l<o; - l++){ - let t=e.readString(); - if(!t)throw new Error("Path constraint data name must not be null."); - let n=new HJ(t); - n.order=e.readInt(!0),n.skinRequired=e.readBoolean(),c=e.readInt(!0); - for(let i=0; - i<c; - i++)n.bones.push(s.bones[e.readInt(!0)]); - n.target=s.slots[e.readInt(!0)]; - const h=e.readByte(); - n.positionMode=1&h,n.spacingMode=h>>1&3,n.rotateMode=h>>3&3,128&h&&(n.offsetRotation=e.readFloat()),n.position=e.readFloat(),n.positionMode==WJ.Fixed&&(n.position*=i),n.spacing=e.readFloat(),n.spacingMode!=jJ.Length&&n.spacingMode!=jJ.Fixed||(n.spacing*=i),n.mixRotate=e.readFloat(),n.mixX=e.readFloat(),n.mixY=e.readFloat(),s.pathConstraints.push(n)} - o=e.readInt(!0); - for(let c=0; - c<o; - c++){ - const t=e.readString(); - if(!t)throw new Error("Physics constraint data name must not be null."); - const n=new aQ(t); - n.order=e.readInt(!0),n.bone=s.bones[e.readInt(!0)]; - let h=e.readByte(); - n.skinRequired=!!(1&h),2&h&&(n.x=e.readFloat()),4&h&&(n.y=e.readFloat()),8&h&&(n.rotate=e.readFloat()),16&h&&(n.scaleX=e.readFloat()),32&h&&(n.shearX=e.readFloat()),n.limit=(64&h?e.readFloat():5e3)*i,n.step=1/e.readUnsignedByte(),n.inertia=e.readFloat(),n.strength=e.readFloat(),n.damping=e.readFloat(),n.massInverse=128&h?e.readFloat():1,n.wind=e.readFloat(),n.gravity=e.readFloat(),h=e.readByte(),1&h&&(n.inertiaGlobal=!0),2&h&&(n.strengthGlobal=!0),4&h&&(n.dampingGlobal=!0),8&h&&(n.massGlobal=!0),16&h&&(n.windGlobal=!0),32&h&&(n.gravityGlobal=!0),64&h&&(n.mixGlobal=!0),n.mix=128&h?e.readFloat():1,s.physicsConstraints.push(n)} - let a=this.readSkin(e,s,!0,r); - a&&(s.defaultSkin=a,s.skins.push(a)); - { - let t=s.skins.length; - for(HY.setArraySize(s.skins,o=t+e.readInt(!0)); - t<o; - t++){ - let i=this.readSkin(e,s,!1,r); - if(!i)throw new Error("readSkin() should not have returned null."); - s.skins[t]=i} - } - o=this.linkedMeshes.length; - for(let c=0; - c<o; - c++){ - let t=this.linkedMeshes[c]; - const i=s.skins[t.skinIndex]; - if(!t.parent)throw new Error("Linked mesh parent must not be null"); - let e=i.getAttachment(t.slotIndex,t.parent); - if(!e)throw new Error(`Parent mesh not found: ${ - t.parent} - `); - t.mesh.timelineAttachment=t.inheritTimeline?e:t.mesh,t.mesh.setParentMesh(e),null!=t.mesh.region&&t.mesh.updateRegion()} - this.linkedMeshes.length=0,o=e.readInt(!0); - for(let c=0; - c<o; - c++){ - let t=e.readString(); - if(!t)throw new Error("Event data name must not be null"); - let i=new DJ(t); - i.intValue=e.readInt(!1),i.floatValue=e.readFloat(),i.stringValue=e.readString(),i.audioPath=e.readString(),i.audioPath&&(i.volume=e.readFloat(),i.balance=e.readFloat()),s.events.push(i)} - o=e.readInt(!0); - for(let c=0; - c<o; - c++){ - let t=e.readString(); - if(!t)throw new Error("Animatio name must not be null."); - s.animations.push(this.readAnimation(e,t,s))} - return s} - readSkin(t,i,s,e){ - let n=null,h=0; - if(s){ - if(h=t.readInt(!0),0==h)return null; - n=new pQ("default")} - else{ - let s=t.readString(); - if(!s)throw new Error("Skin name must not be null."); - n=new pQ(s),e&&BY.rgba8888ToColor(n.color,t.readInt32()),n.bones.length=t.readInt(!0); - for(let e=0,h=n.bones.length; - e<h; - e++)n.bones[e]=i.bones[t.readInt(!0)]; - for(let e=0,h=t.readInt(!0); - e<h; - e++)n.constraints.push(i.ikConstraints[t.readInt(!0)]); - for(let e=0,h=t.readInt(!0); - e<h; - e++)n.constraints.push(i.transformConstraints[t.readInt(!0)]); - for(let e=0,h=t.readInt(!0); - e<h; - e++)n.constraints.push(i.pathConstraints[t.readInt(!0)]); - for(let e=0,h=t.readInt(!0); - e<h; - e++)n.constraints.push(i.physicsConstraints[t.readInt(!0)]); - h=t.readInt(!0)} - for(let r=0; - r<h; - r++){ - let s=t.readInt(!0); - for(let h=0,r=t.readInt(!0); - h<r; - h++){ - let h=t.readStringRef(); - if(!h)throw new Error("Attachment name must not be null"); - let r=this.readAttachment(t,i,n,s,h,e); - r&&n.setAttachment(s,h,r)} - } - return n} - readAttachment(t,i,s,e,n,h){ - let r=this.scale,o=t.readByte(); - const a=8&o?t.readStringRef():n; - if(!a)throw new Error("Attachment name must not be null"); - switch(7&o){ - case OQ.Region:{ - let i=16&o?t.readStringRef():null; - const e=32&o?t.readInt32():4294967295,n=64&o?this.readSequence(t):null; - let h=128&o?t.readFloat():0,c=t.readFloat(),l=t.readFloat(),u=t.readFloat(),d=t.readFloat(),f=t.readFloat(),p=t.readFloat(); - i||(i=a); - let w=this.attachmentLoader.newRegionAttachment(s,a,i,n); - return w?(w.path=i,w.x=c*r,w.y=l*r,w.scaleX=u,w.scaleY=d,w.rotation=h,w.width=f*r,w.height=p*r,BY.rgba8888ToColor(w.color,e),w.sequence=n,null==n&&w.updateRegion(),w):null} - case OQ.BoundingBox:{ - let i=this.readVertices(t,!!(16&o)),e=h?t.readInt32():0,n=this.attachmentLoader.newBoundingBoxAttachment(s,a); - return n?(n.worldVerticesLength=i.length,n.vertices=i.vertices,n.bones=i.bones,h&&BY.rgba8888ToColor(n.color,e),n):null} - case OQ.Mesh:{ - let i=16&o?t.readStringRef():a; - const e=32&o?t.readInt32():4294967295,n=64&o?this.readSequence(t):null,c=t.readInt(!0),l=this.readVertices(t,!!(128&o)),u=this.readFloatArray(t,l.length,1),d=this.readShortArray(t,3*(l.length-c-2)); - let f=[],p=0,w=0; - h&&(f=this.readShortArray(t,t.readInt(!0)),p=t.readFloat(),w=t.readFloat()),i||(i=a); - let g=this.attachmentLoader.newMeshAttachment(s,a,i,n); - return g?(g.path=i,BY.rgba8888ToColor(g.color,e),g.bones=l.bones,g.vertices=l.vertices,g.worldVerticesLength=l.length,g.triangles=d,g.regionUVs=u,null==n&&g.updateRegion(),g.hullLength=c<<1,g.sequence=n,h&&(g.edges=f,g.width=p*r,g.height=w*r),g):null} - case OQ.LinkedMesh:{ - const i=16&o?t.readStringRef():a; - if(null==i)throw new Error("Path of linked mesh must not be null"); - const n=32&o?t.readInt32():4294967295,c=64&o?this.readSequence(t):null,l=!!(128&o),u=t.readInt(!0),d=t.readStringRef(); - let f=0,p=0; - h&&(f=t.readFloat(),p=t.readFloat()); - let w=this.attachmentLoader.newMeshAttachment(s,a,i,c); - return w?(w.path=i,BY.rgba8888ToColor(w.color,n),w.sequence=c,h&&(w.width=f*r,w.height=p*r),this.linkedMeshes.push(new SQ(w,u,e,d,l)),w):null} - case OQ.Path:{ - const i=!!(16&o),e=!!(32&o),n=this.readVertices(t,!!(64&o)),c=HY.newArray(n.length/6,0); - for(let s=0,h=c.length; - s<h; - s++)c[s]=t.readFloat()*r; - const l=h?t.readInt32():0,u=this.attachmentLoader.newPathAttachment(s,a); - return u?(u.closed=i,u.constantSpeed=e,u.worldVerticesLength=n.length,u.vertices=n.vertices,u.bones=n.bones,u.lengths=c,h&&BY.rgba8888ToColor(u.color,l),u):null} - case OQ.Point:{ - const i=t.readFloat(),e=t.readFloat(),n=t.readFloat(),o=h?t.readInt32():0,c=this.attachmentLoader.newPointAttachment(s,a); - return c?(c.x=e*r,c.y=n*r,c.rotation=i,h&&BY.rgba8888ToColor(c.color,o),c):null} - case OQ.Clipping:{ - const e=t.readInt(!0),n=this.readVertices(t,!!(16&o)); - let r=h?t.readInt32():0,c=this.attachmentLoader.newClippingAttachment(s,a); - return c?(c.endSlot=i.slots[e],c.worldVerticesLength=n.length,c.vertices=n.vertices,c.bones=n.bones,h&&BY.rgba8888ToColor(c.color,r),c):null} - } - return null} - readSequence(t){ - let i=new QY(t.readInt(!0)); - return i.start=t.readInt(!0),i.digits=t.readInt(!0),i.setupIndex=t.readInt(!0),i} - readVertices(t,i){ - const s=this.scale,e=t.readInt(!0),n=new CQ; - if(n.length=e<<1,!i)return n.vertices=this.readFloatArray(t,n.length,s),n; - let h=new Array,r=new Array; - for(let o=0; - o<e; - o++){ - let i=t.readInt(!0); - r.push(i); - for(let e=0; - e<i; - e++)r.push(t.readInt(!0)),h.push(t.readFloat()*s),h.push(t.readFloat()*s),h.push(t.readFloat())} - return n.vertices=HY.toFloatArray(h),n.bones=r,n} - readFloatArray(t,i,s){ - let e=new Array(i); - if(1==s)for(let n=0; - n<i; - n++)e[n]=t.readFloat(); - else for(let n=0; - n<i; - n++)e[n]=t.readFloat()*s; - return e} - readShortArray(t,i){ - let s=new Array(i); - for(let e=0; - e<i; - e++)s[e]=t.readInt(!0); - return s} - readAnimation(t,i,s){ - t.readInt(!0); - let e=new Array,n=this.scale; - for(let a=0,c=t.readInt(!0); - a<c; - a++){ - let i=t.readInt(!0); - for(let s=0,n=t.readInt(!0); - s<n; - s++){ - let s=t.readByte(),n=t.readInt(!0),h=n-1; - switch(s){ - case VQ:{ - let s=new Xq(n,i); - for(let i=0; - i<n; - i++)s.setFrame(i,t.readFloat(),t.readStringRef()); - e.push(s); - break} - case jQ:{ - let s=t.readInt(!0),r=new Fq(n,s,i),o=t.readFloat(),a=t.readUnsignedByte()/255,c=t.readUnsignedByte()/255,l=t.readUnsignedByte()/255,u=t.readUnsignedByte()/255; - for(let i=0,e=0; - r.setFrame(i,o,a,c,l,u),i!=h; - i++){ - let s=t.readFloat(),n=t.readUnsignedByte()/255,h=t.readUnsignedByte()/255,d=t.readUnsignedByte()/255,f=t.readUnsignedByte()/255; - switch(t.readByte()){ - case cZ:r.setStepped(i); - break; - case lZ:RQ(t,r,e++,i,0,o,s,a,n,1),RQ(t,r,e++,i,1,o,s,c,h,1),RQ(t,r,e++,i,2,o,s,l,d,1),RQ(t,r,e++,i,3,o,s,u,f,1)} - o=s,a=n,c=h,l=d,u=f} - e.push(r); - break} - case KQ:{ - let s=t.readInt(!0),r=new Hq(n,s,i),o=t.readFloat(),a=t.readUnsignedByte()/255,c=t.readUnsignedByte()/255,l=t.readUnsignedByte()/255; - for(let i=0,e=0; - r.setFrame(i,o,a,c,l),i!=h; - i++){ - let s=t.readFloat(),n=t.readUnsignedByte()/255,h=t.readUnsignedByte()/255,u=t.readUnsignedByte()/255; - switch(t.readByte()){ - case cZ:r.setStepped(i); - break; - case lZ:RQ(t,r,e++,i,0,o,s,a,n,1),RQ(t,r,e++,i,1,o,s,c,h,1),RQ(t,r,e++,i,2,o,s,l,u,1)} - o=s,a=n,c=h,l=u} - e.push(r); - break} - case zQ:{ - let s=t.readInt(!0),r=new Kq(n,s,i),o=t.readFloat(),a=t.readUnsignedByte()/255,c=t.readUnsignedByte()/255,l=t.readUnsignedByte()/255,u=t.readUnsignedByte()/255,d=t.readUnsignedByte()/255,f=t.readUnsignedByte()/255,p=t.readUnsignedByte()/255; - for(let i=0,e=0; - r.setFrame(i,o,a,c,l,u,d,f,p),i!=h; - i++){ - let s=t.readFloat(),n=t.readUnsignedByte()/255,h=t.readUnsignedByte()/255,w=t.readUnsignedByte()/255,g=t.readUnsignedByte()/255,m=t.readUnsignedByte()/255,v=t.readUnsignedByte()/255,_=t.readUnsignedByte()/255; - switch(t.readByte()){ - case cZ:r.setStepped(i); - break; - case lZ:RQ(t,r,e++,i,0,o,s,a,n,1),RQ(t,r,e++,i,1,o,s,c,h,1),RQ(t,r,e++,i,2,o,s,l,w,1),RQ(t,r,e++,i,3,o,s,u,g,1),RQ(t,r,e++,i,4,o,s,d,m,1),RQ(t,r,e++,i,5,o,s,f,v,1),RQ(t,r,e++,i,6,o,s,p,_,1)} - o=s,a=n,c=h,l=w,u=g,d=m,f=v,p=_} - e.push(r); - break} - case YQ:{ - let s=t.readInt(!0),r=new Yq(n,s,i),o=t.readFloat(),a=t.readUnsignedByte()/255,c=t.readUnsignedByte()/255,l=t.readUnsignedByte()/255,u=t.readUnsignedByte()/255,d=t.readUnsignedByte()/255,f=t.readUnsignedByte()/255; - for(let i=0,e=0; - r.setFrame(i,o,a,c,l,u,d,f),i!=h; - i++){ - let s=t.readFloat(),n=t.readUnsignedByte()/255,h=t.readUnsignedByte()/255,p=t.readUnsignedByte()/255,w=t.readUnsignedByte()/255,g=t.readUnsignedByte()/255,m=t.readUnsignedByte()/255; - switch(t.readByte()){ - case cZ:r.setStepped(i); - break; - case lZ:RQ(t,r,e++,i,0,o,s,a,n,1),RQ(t,r,e++,i,1,o,s,c,h,1),RQ(t,r,e++,i,2,o,s,l,p,1),RQ(t,r,e++,i,3,o,s,u,w,1),RQ(t,r,e++,i,4,o,s,d,g,1),RQ(t,r,e++,i,5,o,s,f,m,1)} - o=s,a=n,c=h,l=p,u=w,d=g,f=m} - e.push(r); - break} - case qQ:{ - let s=new Vq(n,t.readInt(!0),i),r=t.readFloat(),o=t.readUnsignedByte()/255; - for(let i=0,e=0; - s.setFrame(i,r,o),i!=h; - i++){ - let n=t.readFloat(),h=t.readUnsignedByte()/255; - switch(t.readByte()){ - case cZ:s.setStepped(i); - break; - case lZ:RQ(t,s,e++,i,0,r,n,o,h,1)} - r=n,o=h} - e.push(s)} - } - } - } - for(let a=0,c=t.readInt(!0); - a<c; - a++){ - let i=t.readInt(!0); - for(let s=0,h=t.readInt(!0); - s<h; - s++){ - let s=t.readByte(),h=t.readInt(!0); - if(s==WQ){ - let s=new Bq(h,i); - for(let i=0; - i<h; - i++)s.setFrame(i,t.readFloat(),t.readByte()); - e.push(s); - continue} - let r=t.readInt(!0); - switch(s){ - case PQ:e.push(kQ(t,new vq(h,r,i),1)); - break; - case NQ:e.push(xQ(t,new Mq(h,r,i),n)); - break; - case LQ:e.push(kQ(t,new yq(h,r,i),n)); - break; - case DQ:e.push(kQ(t,new Aq(h,r,i),n)); - break; - case GQ:e.push(xQ(t,new Tq(h,r,i),1)); - break; - case BQ:e.push(kQ(t,new Oq(h,r,i),1)); - break; - case UQ:e.push(kQ(t,new kq(h,r,i),1)); - break; - case FQ:e.push(xQ(t,new Rq(h,r,i),1)); - break; - case $Q:e.push(kQ(t,new Nq(h,r,i),1)); - break; - case HQ:e.push(kQ(t,new Dq(h,r,i),1))} - } - } - for(let a=0,c=t.readInt(!0); - a<c; - a++){ - let i=t.readInt(!0),s=t.readInt(!0),h=s-1,r=new nX(s,t.readInt(!0),i),o=t.readByte(),a=t.readFloat(),c=1&o?2&o?t.readFloat():1:0,l=4&o?t.readFloat()*n:0; - for(let e=0,u=0; - r.setFrame(e,a,c,l,8&o?1:-1,!!(16&o),!!(32&o)),e!=h; - e++){ - o=t.readByte(); - const i=t.readFloat(),s=1&o?2&o?t.readFloat():1:0,h=4&o?t.readFloat()*n:0; - 64&o?r.setStepped(e):128&o&&(RQ(t,r,u++,e,0,a,i,c,s,1),RQ(t,r,u++,e,1,a,i,l,h,n)),a=i,c=s,l=h} - e.push(r)} - for(let a=0,c=t.readInt(!0); - a<c; - a++){ - let i=t.readInt(!0),s=t.readInt(!0),n=s-1,h=new rX(s,t.readInt(!0),i),r=t.readFloat(),o=t.readFloat(),a=t.readFloat(),c=t.readFloat(),l=t.readFloat(),u=t.readFloat(),d=t.readFloat(); - for(let e=0,f=0; - h.setFrame(e,r,o,a,c,l,u,d),e!=n; - e++){ - let i=t.readFloat(),s=t.readFloat(),n=t.readFloat(),p=t.readFloat(),w=t.readFloat(),g=t.readFloat(),m=t.readFloat(); - switch(t.readByte()){ - case cZ:h.setStepped(e); - break; - case lZ:RQ(t,h,f++,e,0,r,i,o,s,1),RQ(t,h,f++,e,1,r,i,a,n,1),RQ(t,h,f++,e,2,r,i,c,p,1),RQ(t,h,f++,e,3,r,i,l,w,1),RQ(t,h,f++,e,4,r,i,u,g,1),RQ(t,h,f++,e,5,r,i,d,m,1)} - r=i,o=s,a=n,c=p,l=w,u=g,d=m} - e.push(h)} - for(let a=0,c=t.readInt(!0); - a<c; - a++){ - let i=t.readInt(!0),h=s.pathConstraints[i]; - for(let s=0,r=t.readInt(!0); - s<r; - s++){ - const s=t.readByte(),r=t.readInt(!0),o=t.readInt(!0); - switch(s){ - case QQ:e.push(kQ(t,new aX(r,o,i),h.positionMode==WJ.Fixed?n:1)); - break; - case ZQ:e.push(kQ(t,new lX(r,o,i),h.spacingMode==jJ.Length||h.spacingMode==jJ.Fixed?n:1)); - break; - case tZ:let s=new dX(r,o,i),a=t.readFloat(),c=t.readFloat(),l=t.readFloat(),u=t.readFloat(); - for(let i=0,e=0,n=s.getFrameCount()-1; - s.setFrame(i,a,c,l,u),i!=n; - i++){ - let n=t.readFloat(),h=t.readFloat(),r=t.readFloat(),o=t.readFloat(); - switch(t.readByte()){ - case cZ:s.setStepped(i); - break; - case lZ:RQ(t,s,e++,i,0,a,n,c,h,1),RQ(t,s,e++,i,1,a,n,l,r,1),RQ(t,s,e++,i,2,a,n,u,o,1)} - a=n,c=h,l=r,u=o} - e.push(s)} - } - } - for(let a=0,c=t.readInt(!0); - a<c; - a++){ - const i=t.readInt(!0)-1; - for(let s=0,n=t.readInt(!0); - s<n; - s++){ - const s=t.readByte(),n=t.readInt(!0); - if(s==aZ){ - const s=new kX(n,i); - for(let i=0; - i<n; - i++)s.setFrame(i,t.readFloat()); - e.push(s); - continue} - const h=t.readInt(!0); - switch(s){ - case iZ:e.push(kQ(t,new gX(n,h,i),1)); - break; - case sZ:e.push(kQ(t,new vX(n,h,i),1)); - break; - case eZ:e.push(kQ(t,new MX(n,h,i),1)); - break; - case nZ:e.push(kQ(t,new yX(n,h,i),1)); - break; - case hZ:e.push(kQ(t,new AX(n,h,i),1)); - break; - case rZ:e.push(kQ(t,new TX(n,h,i),1)); - break; - case oZ:e.push(kQ(t,new OX(n,h,i),1))} - } - } - for(let a=0,c=t.readInt(!0); - a<c; - a++){ - let i=s.skins[t.readInt(!0)]; - for(let s=0,h=t.readInt(!0); - s<h; - s++){ - let s=t.readInt(!0); - for(let h=0,r=t.readInt(!0); - h<r; - h++){ - let h=t.readStringRef(); - if(!h)throw new Error("attachmentName must not be null."); - let r=i.getAttachment(s,h),o=t.readByte(),a=t.readInt(!0),c=a-1; - switch(o){ - case XQ:{ - let i=r,h=i.bones,o=i.vertices,l=h?o.length/3*2:o.length,u=t.readInt(!0),d=new Qq(a,u,s,i),f=t.readFloat(); - for(let s=0,e=0; - ; - s++){ - let i,r=t.readInt(!0); - if(0==r)i=h?HY.newFloatArray(l):o; - else{ - i=HY.newFloatArray(l); - let s=t.readInt(!0); - if(r+=s,1==n)for(let e=s; - e<r; - e++)i[e]=t.readFloat(); - else for(let e=s; - e<r; - e++)i[e]=t.readFloat()*n; - if(!h)for(let t=0,e=i.length; - t<e; - t++)i[t]+=o[t]} - if(d.setFrame(s,f,i),s==c)break; - let a=t.readFloat(); - switch(t.readByte()){ - case cZ:d.setStepped(s); - break; - case lZ:RQ(t,d,e++,s,0,f,a,0,1,1)} - f=a} - e.push(d); - break} - case JQ:{ - let i=new RX(a,s,r); - for(let s=0; - s<a; - s++){ - let e=t.readFloat(),n=t.readInt32(); - i.setFrame(s,e,iq[15&n],n>>4,t.readFloat())} - e.push(i); - break} - } - } - } - } - let h=t.readInt(!0); - if(h>0){ - let i=new sX(h),n=s.slots.length; - for(let s=0; - s<h; - s++){ - let e=t.readFloat(),h=t.readInt(!0),r=HY.newArray(n,0); - for(let t=n-1; - t>=0; - t--)r[t]=-1; - let o=HY.newArray(n-h,0),a=0,c=0; - for(let i=0; - i<h; - i++){ - let i=t.readInt(!0); - for(; - a!=i; - )o[c++]=a++; - r[a+t.readInt(!0)]=a++} - for(; - a<n; - )o[c++]=a++; - for(let t=n-1; - t>=0; - t--)-1==r[t]&&(r[t]=o[--c]); - i.setFrame(s,e,r)} - e.push(i)} - let r=t.readInt(!0); - if(r>0){ - let i=new tX(r); - for(let e=0; - e<r; - e++){ - let n=t.readFloat(),h=s.events[t.readInt(!0)],r=new NJ(n,h); - r.intValue=t.readInt(!1),r.floatValue=t.readFloat(),r.stringValue=t.readString(),null==r.stringValue&&(r.stringValue=h.stringValue),r.data.audioPath&&(r.volume=t.readFloat(),r.balance=t.readFloat()),i.setFrame(e,r)} - e.push(i)} - let o=0; - for(let a=0,c=e.length; - a<c; - a++)o=Math.max(o,e[a].getDuration()); - return new eq(i,e,o)} - } - ; - Qt(bQ,"SkeletonBinary"); - let yQ=bQ; - const EQ=class{ - constructor(t,i=new Array,s=0,e=new DataView(t instanceof ArrayBuffer?t:t.buffer)){ - Zt(this,"strings"),Zt(this,"index"),Zt(this,"buffer"),this.strings=i,this.index=s,this.buffer=e} - readByte(){ - return this.buffer.getInt8(this.index++)} - readUnsignedByte(){ - return this.buffer.getUint8(this.index++)} - readShort(){ - let t=this.buffer.getInt16(this.index); - return this.index+=2,t} - readInt32(){ - let t=this.buffer.getInt32(this.index); - return this.index+=4,t} - readInt(t){ - let i=this.readByte(),s=127&i; - return 128&i&&(i=this.readByte(),s|=(127&i)<<7,128&i&&(i=this.readByte(),s|=(127&i)<<14,128&i&&(i=this.readByte(),s|=(127&i)<<21,128&i&&(i=this.readByte(),s|=(127&i)<<28)))),t?s:s>>>1^-(1&s)} - readStringRef(){ - let t=this.readInt(!0); - return 0==t?null:this.strings[t-1]} - readString(){ - let t=this.readInt(!0); - switch(t){ - case 0:return null; - case 1:return""} - t--; - let i=""; - for(let s=0; - s<t; - ){ - let t=this.readUnsignedByte(); - switch(t>>4){ - case 12:case 13:i+=String.fromCharCode((31&t)<<6|63&this.readByte()),s+=2; - break; - case 14:i+=String.fromCharCode((15&t)<<12|(63&this.readByte())<<6|63&this.readByte()),s+=3; - break; - default:i+=String.fromCharCode(t),s++} - } - return i} - readFloat(){ - let t=this.buffer.getFloat32(this.index); - return this.index+=4,t} - readBoolean(){ - return 0!=this.readByte()} - } - ; - Qt(EQ,"BinaryInput"); - let AQ=EQ,SQ=(Qt(tt=class{ - constructor(t,i,s,e,n){ - Zt(this,"parent"),Zt(this,"skinIndex"),Zt(this,"slotIndex"),Zt(this,"mesh"),Zt(this,"inheritTimeline"),this.mesh=t,this.skinIndex=i,this.slotIndex=s,this.parent=e,this.inheritTimeline=n} - } - ,"LinkedMesh"),tt); - const TQ=class{ - constructor(t=null,i=null,s=0){ - Zt(this,"bones"),Zt(this,"vertices"),Zt(this,"length"),this.bones=t,this.vertices=i,this.length=s} - } - ; - Qt(TQ,"Vertices"); - let CQ=TQ; - var OQ,IQ; - function kQ(t,i,s){ - let e=t.readFloat(),n=t.readFloat()*s; - for(let h=0,r=0,o=i.getFrameCount()-1; - i.setFrame(h,e,n),h!=o; - h++){ - let o=t.readFloat(),a=t.readFloat()*s; - switch(t.readByte()){ - case cZ:i.setStepped(h); - break; - case lZ:RQ(t,i,r++,h,0,e,o,n,a,s)} - e=o,n=a} - return i} - function xQ(t,i,s){ - let e=t.readFloat(),n=t.readFloat()*s,h=t.readFloat()*s; - for(let r=0,o=0,a=i.getFrameCount()-1; - i.setFrame(r,e,n,h),r!=a; - r++){ - let a=t.readFloat(),c=t.readFloat()*s,l=t.readFloat()*s; - switch(t.readByte()){ - case cZ:i.setStepped(r); - break; - case lZ:RQ(t,i,o++,r,0,e,a,n,c,s),RQ(t,i,o++,r,1,e,a,h,l,s)} - e=a,n=c,h=l} - return i} - function RQ(t,i,s,e,n,h,r,o,a,c){ - i.setBezier(s,e,n,h,o,t.readFloat(),t.readFloat()*c,t.readFloat(),t.readFloat()*c,r,a)} - (IQ=OQ||(OQ={ - } - ))[IQ.Region=0]="Region",IQ[IQ.BoundingBox=1]="BoundingBox",IQ[IQ.Mesh=2]="Mesh",IQ[IQ.LinkedMesh=3]="LinkedMesh",IQ[IQ.Path=4]="Path",IQ[IQ.Point=5]="Point",IQ[IQ.Clipping=6]="Clipping",Qt(kQ,"readTimeline1$1"),Qt(xQ,"readTimeline2$1"),Qt(RQ,"setBezier"); - const PQ=0,NQ=1,LQ=2,DQ=3,GQ=4,BQ=5,UQ=6,FQ=7,$Q=8,HQ=9,WQ=10,VQ=0,jQ=1,KQ=2,zQ=3,YQ=4,qQ=5,XQ=0,JQ=1,QQ=0,ZQ=1,tZ=2,iZ=0,sZ=1,eZ=2,nZ=4,hZ=5,rZ=6,oZ=7,aZ=8,cZ=1,lZ=2,uZ=class{ - constructor(){ - Zt(this,"minX",0),Zt(this,"minY",0),Zt(this,"maxX",0),Zt(this,"maxY",0),Zt(this,"boundingBoxes",new Array),Zt(this,"polygons",new Array),Zt(this,"polygonPool",new VY(()=>HY.newFloatArray(16)))} - update(t,i){ - if(!t)throw new Error("skeleton cannot be null."); - let s=this.boundingBoxes,e=this.polygons,n=this.polygonPool,h=t.slots,r=h.length; - s.length=0,n.freeAll(e),e.length=0; - for(let o=0; - o<r; - o++){ - let t=h[o]; - if(!t.bone.active)continue; - let i=t.getAttachment(); - if(i instanceof JX){ - let h=i; - s.push(h); - let r=n.obtain(); - r.length!=h.worldVerticesLength&&(r=HY.newFloatArray(h.worldVerticesLength)),e.push(r),h.computeWorldVertices(t,0,h.worldVerticesLength,r,0,2)} - } - i?this.aabbCompute():(this.minX=Number.POSITIVE_INFINITY,this.minY=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.maxY=Number.NEGATIVE_INFINITY)} - aabbCompute(){ - let t=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,e=Number.NEGATIVE_INFINITY,n=this.polygons; - for(let h=0,r=n.length; - h<r; - h++){ - let r=n[h],o=r; - for(let n=0,h=r.length; - n<h; - n+=2){ - let h=o[n],r=o[n+1]; - t=Math.min(t,h),i=Math.min(i,r),s=Math.max(s,h),e=Math.max(e,r)} - } - this.minX=t,this.minY=i,this.maxX=s,this.maxY=e} - aabbContainsPoint(t,i){ - return t>=this.minX&&t<=this.maxX&&i>=this.minY&&i<=this.maxY} - aabbIntersectsSegment(t,i,s,e){ - let n=this.minX,h=this.minY,r=this.maxX,o=this.maxY; - if(t<=n&&s<=n||i<=h&&e<=h||t>=r&&s>=r||i>=o&&e>=o)return!1; - let a=(e-i)/(s-t),c=a*(n-t)+i; - if(c>h&&c<o)return!0; - if(c=a*(r-t)+i,c>h&&c<o)return!0; - let l=(h-i)/a+t; - return l>n&&l<r||(l=(o-i)/a+t,l>n&&l<r)} - aabbIntersectsSkeleton(t){ - return this.minX<t.maxX&&this.maxX>t.minX&&this.minY<t.maxY&&this.maxY>t.minY} - containsPoint(t,i){ - let s=this.polygons; - for(let e=0,n=s.length; - e<n; - e++)if(this.containsPointPolygon(s[e],t,i))return this.boundingBoxes[e]; - return null} - containsPointPolygon(t,i,s){ - let e=t,n=t.length,h=n-2,r=!1; - for(let o=0; - o<n; - o+=2){ - let t=e[o+1],n=e[h+1]; - if(t<s&&n>=s||n<s&&t>=s){ - let a=e[o]; - a+(s-t)/(n-t)*(e[h]-a)<i&&(r=!r)} - h=o} - return r} - intersectsSegment(t,i,s,e){ - let n=this.polygons; - for(let h=0,r=n.length; - h<r; - h++)if(this.intersectsSegmentPolygon(n[h],t,i,s,e))return this.boundingBoxes[h]; - return null} - intersectsSegmentPolygon(t,i,s,e,n){ - let h=t,r=t.length,o=i-e,a=s-n,c=i*n-s*e,l=h[r-2],u=h[r-1]; - for(let d=0; - d<r; - d+=2){ - let t=h[d],r=h[d+1],f=l*r-u*t,p=l-t,w=u-r,g=o*w-a*p,m=(c*p-o*f)/g; - if((m>=l&&m<=t||m>=t&&m<=l)&&(m>=i&&m<=e||m>=e&&m<=i)){ - let t=(c*w-a*f)/g; - if((t>=u&&t<=r||t>=r&&t<=u)&&(t>=s&&t<=n||t>=n&&t<=s))return!0} - l=t,u=r} - return!1} - getPolygon(t){ - if(!t)throw new Error("boundingBox cannot be null."); - let i=this.boundingBoxes.indexOf(t); - return-1==i?null:this.polygons[i]} - getWidth(){ - return this.maxX-this.minX} - getHeight(){ - return this.maxY-this.minY} - } - ; - Qt(uZ,"SkeletonBounds"); - let dZ=uZ; - const fZ=class t{ - constructor(){ - Zt(this,"convexPolygons",new Array),Zt(this,"convexPolygonsIndices",new Array),Zt(this,"indicesArray",new Array),Zt(this,"isConcaveArray",new Array),Zt(this,"triangles",new Array),Zt(this,"polygonPool",new VY(()=>new Array)),Zt(this,"polygonIndicesPool",new VY(()=>new Array))} - triangulate(i){ - let s=i,e=i.length>>1,n=this.indicesArray; - n.length=0; - for(let t=0; - t<e; - t++)n[t]=t; - let h=this.isConcaveArray; - h.length=0; - for(let o=0,a=e; - o<a; - ++o)h[o]=t.isConcave(o,e,s,n); - let r=this.triangles; - for(r.length=0; - e>3; - ){ - let i=e-1,o=0,a=1; - for(; - ; - ){ - t:if(!h[o]){ - let r=n[i]<<1,c=n[o]<<1,l=n[a]<<1,u=s[r],d=s[r+1],f=s[c],p=s[c+1],w=s[l],g=s[l+1]; - for(let o=(a+1)%e; - o!=i; - o=(o+1)%e){ - if(!h[o])continue; - let i=n[o]<<1,e=s[i],r=s[i+1]; - if(t.positiveArea(w,g,u,d,e,r)&&t.positiveArea(u,d,f,p,e,r)&&t.positiveArea(f,p,w,g,e,r))break t} - break} - if(0==a){ - do{ - if(!h[o])break; - o--} - while(o>0); - break} - i=o,o=a,a=(a+1)%e} - r.push(n[(e+o-1)%e]),r.push(n[o]),r.push(n[(o+1)%e]),n.splice(o,1),h.splice(o,1),e--; - let c=(e+o-1)%e,l=o==e?0:o; - h[c]=t.isConcave(c,e,s,n),h[l]=t.isConcave(l,e,s,n)} - return 3==e&&(r.push(n[2]),r.push(n[0]),r.push(n[1])),r} - decompose(i,s){ - let e=i,n=this.convexPolygons; - this.polygonPool.freeAll(n),n.length=0; - let h=this.convexPolygonsIndices; - this.polygonIndicesPool.freeAll(h),h.length=0; - let r=this.polygonIndicesPool.obtain(); - r.length=0; - let o=this.polygonPool.obtain(); - o.length=0; - let a=-1,c=0; - for(let l=0,u=s.length; - l<u; - l+=3){ - let i=s[l]<<1,u=s[l+1]<<1,d=s[l+2]<<1,f=e[i],p=e[i+1],w=e[u],g=e[u+1],m=e[d],v=e[d+1],_=!1; - if(a==i){ - let i=o.length-4,s=t.winding(o[i],o[i+1],o[i+2],o[i+3],m,v),e=t.winding(m,v,o[0],o[1],o[2],o[3]); - s==c&&e==c&&(o.push(m),o.push(v),r.push(d),_=!0)} - _||(o.length>0?(n.push(o),h.push(r)):(this.polygonPool.free(o),this.polygonIndicesPool.free(r)),o=this.polygonPool.obtain(),o.length=0,o.push(f),o.push(p),o.push(w),o.push(g),o.push(m),o.push(v),r=this.polygonIndicesPool.obtain(),r.length=0,r.push(i),r.push(u),r.push(d),c=t.winding(f,p,w,g,m,v),a=i)} - o.length>0&&(n.push(o),h.push(r)); - for(let l=0,u=n.length; - l<u; - l++){ - if(r=h[l],0==r.length)continue; - let i=r[0],s=r[r.length-1]; - o=n[l]; - let e=o.length-4,a=o[e],c=o[e+1],d=o[e+2],f=o[e+3],p=o[0],w=o[1],g=o[2],m=o[3],v=t.winding(a,c,d,f,p,w); - for(let _=0; - _<u; - _++){ - if(_==l)continue; - let e=h[_]; - if(3!=e.length)continue; - let u=e[0],M=e[1],b=e[2],y=n[_],E=y[y.length-2],A=y[y.length-1]; - if(u!=i||M!=s)continue; - let S=t.winding(a,c,d,f,E,A),T=t.winding(E,A,p,w,g,m); - S==v&&T==v&&(y.length=0,e.length=0,o.push(E),o.push(A),r.push(b),a=d,c=f,d=E,f=A,_=0)} - } - for(let t=n.length-1; - t>=0; - t--)o=n[t],0==o.length&&(n.splice(t,1),this.polygonPool.free(o),r=h[t],h.splice(t,1),this.polygonIndicesPool.free(r)); - return n} - static isConcave(t,i,s,e){ - let n=e[(i+t-1)%i]<<1,h=e[t]<<1,r=e[(t+1)%i]<<1; - return!this.positiveArea(s[n],s[n+1],s[h],s[h+1],s[r],s[r+1])} - static positiveArea(t,i,s,e,n,h){ - return t*(h-e)+s*(i-h)+n*(e-i)>=0} - static winding(t,i,s,e,n,h){ - let r=s-t,o=e-i; - return n*o-h*r+r*i-t*o>=0?1:-1} - } - ; - Qt(fZ,"Triangulator"); - let pZ=fZ; - const wZ=class t{ - constructor(){ - Zt(this,"triangulator",new pZ),Zt(this,"clippingPolygon",new Array),Zt(this,"clipOutput",new Array),Zt(this,"clippedVertices",new Array),Zt(this,"clippedUVs",new Array),Zt(this,"clippedTriangles",new Array),Zt(this,"scratch",new Array),Zt(this,"clipAttachment",null),Zt(this,"clippingPolygons",null)} - clipStart(i,s){ - if(this.clipAttachment)return 0; - this.clipAttachment=s; - let e=s.worldVerticesLength,n=HY.setArraySize(this.clippingPolygon,e); - s.computeWorldVertices(i,0,e,n,0,2); - let h=this.clippingPolygon; - t.makeClockwise(h); - let r=this.clippingPolygons=this.triangulator.decompose(h,this.triangulator.triangulate(h)); - for(let o=0,a=r.length; - o<a; - o++){ - let i=r[o]; - t.makeClockwise(i),i.push(i[0]),i.push(i[1])} - return r.length} - clipEndWithSlot(t){ - this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()} - clipEnd(){ - this.clipAttachment&&(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)} - isClipping(){ - return null!=this.clipAttachment} - clipTriangles(t,i,s,e,n,h,r,o){ - let a,c,l,u,d,f; - "number"==typeof i?(a=s,c=e,l=n,u=h,d=r,f=o):(a=i,c=s,l=e,u=n,d=h,f=r),l&&u&&d&&"boolean"==typeof f?this.clipTrianglesRender(t,a,c,l,u,d,f):this.clipTrianglesNoRender(t,a,c)} - clipTrianglesNoRender(t,i,s){ - let e=this.clipOutput,n=this.clippedVertices,h=this.clippedTriangles,r=this.clippingPolygons,o=r.length,a=0; - n.length=0,h.length=0; - for(let c=0; - c<s; - c+=3){ - let s=i[c]<<1,l=t[s],u=t[s+1]; - s=i[c+1]<<1; - let d=t[s],f=t[s+1]; - s=i[c+2]<<1; - let p=t[s],w=t[s+1]; - for(let t=0; - t<o; - t++){ - let i=n.length; - if(!this.clip(l,u,d,f,p,w,r[t],e)){ - let t=HY.setArraySize(n,i+6); - t[i]=l,t[i+1]=u,t[i+2]=d,t[i+3]=f,t[i+4]=p,t[i+5]=w,i=h.length; - let s=HY.setArraySize(h,i+3); - s[i]=a,s[i+1]=a+1,s[i+2]=a+2,a+=3; - break} - { - let t=e.length; - if(0==t)continue; - let s=t>>1,r=this.clipOutput,o=HY.setArraySize(n,i+2*s); - for(let e=0; - e<t; - e+=2,i+=2){ - let t=r[e],s=r[e+1]; - o[i]=t,o[i+1]=s} - i=h.length; - let c=HY.setArraySize(h,i+3*(s-2)); - s--; - for(let e=1; - e<s; - e++,i+=3)c[i]=a,c[i+1]=a+e,c[i+2]=a+e+1; - a+=s+1} - } - } - } - clipTrianglesRender(t,i,s,e,n,h,r){ - let o=this.clipOutput,a=this.clippedVertices,c=this.clippedTriangles,l=this.clippingPolygons,u=l.length,d=r?12:8,f=0; - a.length=0,c.length=0; - for(let p=0; - p<s; - p+=3){ - let s=i[p]<<1,w=t[s],g=t[s+1],m=e[s],v=e[s+1]; - s=i[p+1]<<1; - let _=t[s],M=t[s+1],b=e[s],y=e[s+1]; - s=i[p+2]<<1; - let E=t[s],A=t[s+1],S=e[s],T=e[s+1]; - for(let t=0; - t<u; - t++){ - let i=a.length; - if(!this.clip(w,g,_,M,E,A,l[t],o)){ - let t=HY.setArraySize(a,i+3*d); - t[i]=w,t[i+1]=g,t[i+2]=n.r,t[i+3]=n.g,t[i+4]=n.b,t[i+5]=n.a,r?(t[i+6]=m,t[i+7]=v,t[i+8]=h.r,t[i+9]=h.g,t[i+10]=h.b,t[i+11]=h.a,t[i+12]=_,t[i+13]=M,t[i+14]=n.r,t[i+15]=n.g,t[i+16]=n.b,t[i+17]=n.a,t[i+18]=b,t[i+19]=y,t[i+20]=h.r,t[i+21]=h.g,t[i+22]=h.b,t[i+23]=h.a,t[i+24]=E,t[i+25]=A,t[i+26]=n.r,t[i+27]=n.g,t[i+28]=n.b,t[i+29]=n.a,t[i+30]=S,t[i+31]=T,t[i+32]=h.r,t[i+33]=h.g,t[i+34]=h.b,t[i+35]=h.a):(t[i+6]=m,t[i+7]=v,t[i+8]=_,t[i+9]=M,t[i+10]=n.r,t[i+11]=n.g,t[i+12]=n.b,t[i+13]=n.a,t[i+14]=b,t[i+15]=y,t[i+16]=E,t[i+17]=A,t[i+18]=n.r,t[i+19]=n.g,t[i+20]=n.b,t[i+21]=n.a,t[i+22]=S,t[i+23]=T),i=c.length; - let s=HY.setArraySize(c,i+3); - s[i]=f,s[i+1]=f+1,s[i+2]=f+2,f+=3; - break} - { - let t=o.length; - if(0==t)continue; - let s=M-A,e=E-_,l=w-E,u=A-g,p=1/(s*l+e*(g-A)),C=t>>1,O=this.clipOutput,I=HY.setArraySize(a,i+C*d); - for(let o=0; - o<t; - o+=2,i+=d){ - let t=O[o],a=O[o+1]; - I[i]=t,I[i+1]=a,I[i+2]=n.r,I[i+3]=n.g,I[i+4]=n.b,I[i+5]=n.a; - let c=t-E,d=a-A,f=(s*c+e*d)*p,w=(u*c+l*d)*p,g=1-f-w; - I[i+6]=m*f+b*w+S*g,I[i+7]=v*f+y*w+T*g,r&&(I[i+8]=h.r,I[i+9]=h.g,I[i+10]=h.b,I[i+11]=h.a)} - i=c.length; - let k=HY.setArraySize(c,i+3*(C-2)); - C--; - for(let n=1; - n<C; - n++,i+=3)k[i]=f,k[i+1]=f+n,k[i+2]=f+n+1; - f+=C+1} - } - } - } - clipTrianglesUnpacked(t,i,s,e){ - let n=this.clipOutput,h=this.clippedVertices,r=this.clippedUVs,o=this.clippedTriangles,a=this.clippingPolygons,c=a.length,l=0; - h.length=0,r.length=0,o.length=0; - for(let u=0; - u<s; - u+=3){ - let s=i[u]<<1,d=t[s],f=t[s+1],p=e[s],w=e[s+1]; - s=i[u+1]<<1; - let g=t[s],m=t[s+1],v=e[s],_=e[s+1]; - s=i[u+2]<<1; - let M=t[s],b=t[s+1],y=e[s],E=e[s+1]; - for(let t=0; - t<c; - t++){ - let i=h.length; - if(!this.clip(d,f,g,m,M,b,a[t],n)){ - let t=HY.setArraySize(h,i+6); - t[i]=d,t[i+1]=f,t[i+2]=g,t[i+3]=m,t[i+4]=M,t[i+5]=b; - let s=HY.setArraySize(r,i+6); - s[i]=p,s[i+1]=w,s[i+2]=v,s[i+3]=_,s[i+4]=y,s[i+5]=E,i=o.length; - let e=HY.setArraySize(o,i+3); - e[i]=l,e[i+1]=l+1,e[i+2]=l+2,l+=3; - break} - { - let t=n.length; - if(0==t)continue; - let s=m-b,e=M-g,a=d-M,c=b-f,u=1/(s*a+e*(f-b)),A=t>>1,S=this.clipOutput,T=HY.setArraySize(h,i+2*A),C=HY.setArraySize(r,i+2*A); - for(let n=0; - n<t; - n+=2,i+=2){ - let t=S[n],h=S[n+1]; - T[i]=t,T[i+1]=h; - let r=t-M,o=h-b,l=(s*r+e*o)*u,d=(c*r+a*o)*u,f=1-l-d; - C[i]=p*l+v*d+y*f,C[i+1]=w*l+_*d+E*f} - i=o.length; - let O=HY.setArraySize(o,i+3*(A-2)); - A--; - for(let n=1; - n<A; - n++,i+=3)O[i]=l,O[i+1]=l+n,O[i+2]=l+n+1; - l+=A+1} - } - } - } - clip(t,i,s,e,n,h,r,o){ - let a,c=o,l=!1; - r.length%4>=2?(a=o,o=this.scratch):a=this.scratch,a.length=0,a.push(t),a.push(i),a.push(s),a.push(e),a.push(n),a.push(h),a.push(t),a.push(i),o.length=0; - let u=r.length-4,d=r; - for(let f=0; - ; - f+=2){ - let t=d[f],i=d[f+1],s=t-d[f+2],e=i-d[f+3],n=o.length,h=a; - for(let c=0,u=a.length-2; - c<u; - ){ - let n=h[c],r=h[c+1]; - c+=2; - let a=h[c],u=h[c+1],d=e*(t-a)>s*(i-u),f=e*(t-n)-s*(i-r); - if(f>0){ - if(d){ - o.push(a),o.push(u); - continue} - let t=a-n,i=u-r,h=f/(t*e-i*s); - if(!(h>=0&&h<=1)){ - o.push(a),o.push(u); - continue} - o.push(n+t*h),o.push(r+i*h)} - else if(d){ - let t=a-n,i=u-r,h=f/(t*e-i*s); - if(!(h>=0&&h<=1)){ - o.push(a),o.push(u); - continue} - o.push(n+t*h),o.push(r+i*h),o.push(a),o.push(u)} - l=!0} - if(n==o.length)return c.length=0,!0; - if(o.push(o[0]),o.push(o[1]),f==u)break; - let r=o; - (o=a).length=0,a=r} - if(c!=o){ - c.length=0; - for(let t=0,i=o.length-2; - t<i; - t++)c[t]=o[t]} - else c.length=c.length-2; - return l} - static makeClockwise(t){ - let i=t,s=t.length,e=i[s-2]*i[1]-i[0]*i[s-1],n=0,h=0,r=0,o=0; - for(let a=0,c=s-3; - a<c; - a+=2)n=i[a],h=i[a+1],r=i[a+2],o=i[a+3],e+=n*o-r*h; - if(!(e<0))for(let a=0,c=s-2,l=s>>1; - a<l; - a+=2){ - let t=i[a],s=i[a+1],e=c-a; - i[a]=i[e],i[a+1]=i[e+1],i[e]=t,i[e+1]=s} - } - } - ; - Qt(wZ,"SkeletonClipping"); - let gZ=wZ; - const mZ=class{ - constructor(t){ - Zt(this,"attachmentLoader"),Zt(this,"scale",1),Zt(this,"linkedMeshes",new Array),this.attachmentLoader=t} - readSkeletonData(t){ - let i=this.scale,s=new lQ,e="string"==typeof t?JSON.parse(t):t,n=e.skeleton; - if(n&&(s.hash=n.hash,s.version=n.spine,s.x=n.x,s.y=n.y,s.width=n.width,s.height=n.height,s.referenceScale=AZ(n,"referenceScale",100)*i,s.fps=n.fps,s.imagesPath=n.images??null,s.audioPath=n.audio??null),e.bones)for(let h=0; - h<e.bones.length; - h++){ - let t=e.bones[h],n=null,r=AZ(t,"parent",null); - r&&(n=s.findBone(r)); - let o=new CJ(s.bones.length,t.name,n); - o.length=AZ(t,"length",0)*i,o.x=AZ(t,"x",0)*i,o.y=AZ(t,"y",0)*i,o.rotation=AZ(t,"rotation",0),o.scaleX=AZ(t,"scaleX",1),o.scaleY=AZ(t,"scaleY",1),o.shearX=AZ(t,"shearX",0),o.shearY=AZ(t,"shearY",0),o.inherit=HY.enumValue(OJ,AZ(t,"inherit","Normal")),o.skinRequired=AZ(t,"skin",!1); - let a=AZ(t,"color",null); - a&&o.color.setFromString(a),s.bones.push(o)} - if(e.slots)for(let h=0; - h<e.slots.length; - h++){ - let t=e.slots[h],i=t.name,n=s.findBone(t.bone); - if(!n)throw new Error(`Couldn't find bone ${ - t.bone} - for slot ${ - i} - `); - let r=new gQ(s.slots.length,i,n),o=AZ(t,"color",null); - o&&r.color.setFromString(o); - let a=AZ(t,"dark",null); - a&&(r.darkColor=BY.fromString(a)),r.attachmentName=AZ(t,"attachment",null),r.blendMode=HY.enumValue(mQ,AZ(t,"blend","normal")),r.visible=AZ(t,"visible",!0),s.slots.push(r)} - if(e.ik)for(let h=0; - h<e.ik.length; - h++){ - let t=e.ik[h],n=new FJ(t.name); - n.order=AZ(t,"order",0),n.skinRequired=AZ(t,"skin",!1); - for(let i=0; - i<t.bones.length; - i++){ - let e=s.findBone(t.bones[i]); - if(!e)throw new Error(`Couldn't find bone ${ - t.bones[i]} - for IK constraint ${ - t.name} - .`); - n.bones.push(e)} - let r=s.findBone(t.target); - if(!r)throw new Error(`Couldn't find target bone ${ - t.target} - for IK constraint ${ - t.name} - .`); - n.target=r,n.mix=AZ(t,"mix",1),n.softness=AZ(t,"softness",0)*i,n.bendDirection=AZ(t,"bendPositive",!0)?1:-1,n.compress=AZ(t,"compress",!1),n.stretch=AZ(t,"stretch",!1),n.uniform=AZ(t,"uniform",!1),s.ikConstraints.push(n)} - if(e.transform)for(let h=0; - h<e.transform.length; - h++){ - let t=e.transform[h],n=new MQ(t.name); - n.order=AZ(t,"order",0),n.skinRequired=AZ(t,"skin",!1); - for(let i=0; - i<t.bones.length; - i++){ - let e=t.bones[i],h=s.findBone(e); - if(!h)throw new Error(`Couldn't find bone ${ - e} - for transform constraint ${ - t.name} - .`); - n.bones.push(h)} - let r=t.target,o=s.findBone(r); - if(!o)throw new Error(`Couldn't find target bone ${ - r} - for transform constraint ${ - t.name} - .`); - n.target=o,n.local=AZ(t,"local",!1),n.relative=AZ(t,"relative",!1),n.offsetRotation=AZ(t,"rotation",0),n.offsetX=AZ(t,"x",0)*i,n.offsetY=AZ(t,"y",0)*i,n.offsetScaleX=AZ(t,"scaleX",0),n.offsetScaleY=AZ(t,"scaleY",0),n.offsetShearY=AZ(t,"shearY",0),n.mixRotate=AZ(t,"mixRotate",1),n.mixX=AZ(t,"mixX",1),n.mixY=AZ(t,"mixY",n.mixX),n.mixScaleX=AZ(t,"mixScaleX",1),n.mixScaleY=AZ(t,"mixScaleY",n.mixScaleX),n.mixShearY=AZ(t,"mixShearY",1),s.transformConstraints.push(n)} - if(e.path)for(let h=0; - h<e.path.length; - h++){ - let t=e.path[h],n=new HJ(t.name); - n.order=AZ(t,"order",0),n.skinRequired=AZ(t,"skin",!1); - for(let i=0; - i<t.bones.length; - i++){ - let e=t.bones[i],h=s.findBone(e); - if(!h)throw new Error(`Couldn't find bone ${ - e} - for path constraint ${ - t.name} - .`); - n.bones.push(h)} - let r=t.target,o=s.findSlot(r); - if(!o)throw new Error(`Couldn't find target slot ${ - r} - for path constraint ${ - t.name} - .`); - n.target=o,n.positionMode=HY.enumValue(WJ,AZ(t,"positionMode","Percent")),n.spacingMode=HY.enumValue(jJ,AZ(t,"spacingMode","Length")),n.rotateMode=HY.enumValue(zJ,AZ(t,"rotateMode","Tangent")),n.offsetRotation=AZ(t,"rotation",0),n.position=AZ(t,"position",0),n.positionMode==WJ.Fixed&&(n.position*=i),n.spacing=AZ(t,"spacing",0),n.spacingMode!=jJ.Length&&n.spacingMode!=jJ.Fixed||(n.spacing*=i),n.mixRotate=AZ(t,"mixRotate",1),n.mixX=AZ(t,"mixX",1),n.mixY=AZ(t,"mixY",n.mixX),s.pathConstraints.push(n)} - if(e.physics)for(let h=0; - h<e.physics.length; - h++){ - const t=e.physics[h],n=new aQ(t.name); - n.order=AZ(t,"order",0),n.skinRequired=AZ(t,"skin",!1); - const r=t.bone,o=s.findBone(r); - if(null==o)throw new Error("Physics bone not found: "+r); - n.bone=o,n.x=AZ(t,"x",0),n.y=AZ(t,"y",0),n.rotate=AZ(t,"rotate",0),n.scaleX=AZ(t,"scaleX",0),n.shearX=AZ(t,"shearX",0),n.limit=AZ(t,"limit",5e3)*i,n.step=1/AZ(t,"fps",60),n.inertia=AZ(t,"inertia",1),n.strength=AZ(t,"strength",100),n.damping=AZ(t,"damping",1),n.massInverse=1/AZ(t,"mass",1),n.wind=AZ(t,"wind",0),n.gravity=AZ(t,"gravity",0),n.mix=AZ(t,"mix",1),n.inertiaGlobal=AZ(t,"inertiaGlobal",!1),n.strengthGlobal=AZ(t,"strengthGlobal",!1),n.dampingGlobal=AZ(t,"dampingGlobal",!1),n.massGlobal=AZ(t,"massGlobal",!1),n.windGlobal=AZ(t,"windGlobal",!1),n.gravityGlobal=AZ(t,"gravityGlobal",!1),n.mixGlobal=AZ(t,"mixGlobal",!1),s.physicsConstraints.push(n)} - if(e.skins)for(let h=0; - h<e.skins.length; - h++){ - let t=e.skins[h],i=new pQ(t.name); - if(t.bones)for(let e=0; - e<t.bones.length; - e++){ - let n=t.bones[e],h=s.findBone(n); - if(!h)throw new Error(`Couldn't find bone ${ - n} - for skin ${ - t.name} - .`); - i.bones.push(h)} - if(t.ik)for(let e=0; - e<t.ik.length; - e++){ - let n=t.ik[e],h=s.findIkConstraint(n); - if(!h)throw new Error(`Couldn't find IK constraint ${ - n} - for skin ${ - t.name} - .`); - i.constraints.push(h)} - if(t.transform)for(let e=0; - e<t.transform.length; - e++){ - let n=t.transform[e],h=s.findTransformConstraint(n); - if(!h)throw new Error(`Couldn't find transform constraint ${ - n} - for skin ${ - t.name} - .`); - i.constraints.push(h)} - if(t.path)for(let e=0; - e<t.path.length; - e++){ - let n=t.path[e],h=s.findPathConstraint(n); - if(!h)throw new Error(`Couldn't find path constraint ${ - n} - for skin ${ - t.name} - .`); - i.constraints.push(h)} - if(t.physics)for(let e=0; - e<t.physics.length; - e++){ - let n=t.physics[e],h=s.findPhysicsConstraint(n); - if(!h)throw new Error(`Couldn't find physics constraint ${ - n} - for skin ${ - t.name} - .`); - i.constraints.push(h)} - for(let e in t.attachments){ - let n=s.findSlot(e); - if(!n)throw new Error(`Couldn't find slot ${ - e} - for skin ${ - t.name} - .`); - let h=t.attachments[e]; - for(let t in h){ - let e=this.readAttachment(h[t],i,n.index,t,s); - e&&i.setAttachment(n.index,t,e)} - } - s.skins.push(i),"default"==i.name&&(s.defaultSkin=i)} - for(let h=0,r=this.linkedMeshes.length; - h<r; - h++){ - let t=this.linkedMeshes[h],i=t.skin?s.findSkin(t.skin):s.defaultSkin; - if(!i)throw new Error(`Skin not found: ${ - t.skin} - `); - let e=i.getAttachment(t.slotIndex,t.parent); - if(!e)throw new Error(`Parent mesh not found: ${ - t.parent} - `); - t.mesh.timelineAttachment=t.inheritTimeline?e:t.mesh,t.mesh.setParentMesh(e),null!=t.mesh.region&&t.mesh.updateRegion()} - if(this.linkedMeshes.length=0,e.events)for(let h in e.events){ - let t=e.events[h],i=new DJ(h); - i.intValue=AZ(t,"int",0),i.floatValue=AZ(t,"float",0),i.stringValue=AZ(t,"string",""),i.audioPath=AZ(t,"audio",null),i.audioPath&&(i.volume=AZ(t,"volume",1),i.balance=AZ(t,"balance",0)),s.events.push(i)} - if(e.animations)for(let h in e.animations){ - let t=e.animations[h]; - this.readAnimation(t,h,s)} - return s} - readAttachment(t,i,s,e,n){ - let h=this.scale; - switch(e=AZ(t,"name",e),AZ(t,"type","region")){ - case"region":{ - let s=AZ(t,"path",e),n=this.readSequence(AZ(t,"sequence",null)),r=this.attachmentLoader.newRegionAttachment(i,e,s,n); - if(!r)return null; - r.path=s,r.x=AZ(t,"x",0)*h,r.y=AZ(t,"y",0)*h,r.scaleX=AZ(t,"scaleX",1),r.scaleY=AZ(t,"scaleY",1),r.rotation=AZ(t,"rotation",0),r.width=t.width*h,r.height=t.height*h,r.sequence=n; - let o=AZ(t,"color",null); - return o&&r.color.setFromString(o),null!=r.region&&r.updateRegion(),r} - case"boundingbox":{ - let s=this.attachmentLoader.newBoundingBoxAttachment(i,e); - if(!s)return null; - this.readVertices(t,s,t.vertexCount<<1); - let n=AZ(t,"color",null); - return n&&s.color.setFromString(n),s} - case"mesh":case"linkedmesh":{ - let n=AZ(t,"path",e),r=this.readSequence(AZ(t,"sequence",null)),o=this.attachmentLoader.newMeshAttachment(i,e,n,r); - if(!o)return null; - o.path=n; - let a=AZ(t,"color",null); - a&&o.color.setFromString(a),o.width=AZ(t,"width",0)*h,o.height=AZ(t,"height",0)*h,o.sequence=r; - let c=AZ(t,"parent",null); - if(c)return this.linkedMeshes.push(new MZ(o,AZ(t,"skin",null),s,c,AZ(t,"timelines",!0))),o; - let l=t.uvs; - return this.readVertices(t,o,l.length),o.triangles=t.triangles,o.regionUVs=l,null!=o.region&&o.updateRegion(),o.edges=AZ(t,"edges",null),o.hullLength=2*AZ(t,"hull",0),o} - case"path":{ - let s=this.attachmentLoader.newPathAttachment(i,e); - if(!s)return null; - s.closed=AZ(t,"closed",!1),s.constantSpeed=AZ(t,"constantSpeed",!0); - let n=t.vertexCount; - this.readVertices(t,s,n<<1); - let r=HY.newArray(n/3,0); - for(let i=0; - i<t.lengths.length; - i++)r[i]=t.lengths[i]*h; - s.lengths=r; - let o=AZ(t,"color",null); - return o&&s.color.setFromString(o),s} - case"point":{ - let s=this.attachmentLoader.newPointAttachment(i,e); - if(!s)return null; - s.x=AZ(t,"x",0)*h,s.y=AZ(t,"y",0)*h,s.rotation=AZ(t,"rotation",0); - let n=AZ(t,"color",null); - return n&&s.color.setFromString(n),s} - case"clipping":{ - let s=this.attachmentLoader.newClippingAttachment(i,e); - if(!s)return null; - let h=AZ(t,"end",null); - h&&(s.endSlot=n.findSlot(h)); - let r=t.vertexCount; - this.readVertices(t,s,r<<1); - let o=AZ(t,"color",null); - return o&&s.color.setFromString(o),s} - } - return null} - readSequence(t){ - if(null==t)return null; - let i=new QY(AZ(t,"count",0)); - return i.start=AZ(t,"start",1),i.digits=AZ(t,"digits",0),i.setupIndex=AZ(t,"setup",0),i} - readVertices(t,i,s){ - let e=this.scale; - i.worldVerticesLength=s; - let n=t.vertices; - if(s==n.length){ - let t=HY.toFloatArray(n); - if(1!=e)for(let i=0,s=n.length; - i<s; - i++)t[i]*=e; - return void(i.vertices=t)} - let h=new Array,r=new Array; - for(let o=0,a=n.length; - o<a; - ){ - let t=n[o++]; - r.push(t); - for(let i=o+4*t; - o<i; - o+=4)r.push(n[o]),h.push(n[o+1]*e),h.push(n[o+2]*e),h.push(n[o+3])} - i.bones=r,i.vertices=HY.toFloatArray(h)} - readAnimation(t,i,s){ - let e=this.scale,n=new Array; - if(t.slots)for(let r in t.slots){ - let i=t.slots[r],e=s.findSlot(r); - if(!e)throw new Error("Slot not found: "+r); - let h=e.index; - for(let t in i){ - let s=i[t]; - if(!s)continue; - let e=s.length; - if("attachment"==t){ - let t=new Xq(e,h); - for(let i=0; - i<e; - i++){ - let e=s[i]; - t.setFrame(i,AZ(e,"time",0),AZ(e,"name",null))} - n.push(t)} - else if("rgba"==t){ - let t=new Fq(e,e<<2,h),i=s[0],r=AZ(i,"time",0),o=BY.fromString(i.color); - for(let e=0,n=0; - ; - e++){ - t.setFrame(e,r,o.r,o.g,o.b,o.a); - let h=s[e+1]; - if(!h){ - t.shrink(n); - break} - let a=AZ(h,"time",0),c=BY.fromString(h.color),l=i.curve; - l&&(n=EZ(l,t,n,e,0,r,a,o.r,c.r,1),n=EZ(l,t,n,e,1,r,a,o.g,c.g,1),n=EZ(l,t,n,e,2,r,a,o.b,c.b,1),n=EZ(l,t,n,e,3,r,a,o.a,c.a,1)),r=a,o=c,i=h} - n.push(t)} - else if("rgb"==t){ - let t=new Hq(e,3*e,h),i=s[0],r=AZ(i,"time",0),o=BY.fromString(i.color); - for(let e=0,n=0; - ; - e++){ - t.setFrame(e,r,o.r,o.g,o.b); - let h=s[e+1]; - if(!h){ - t.shrink(n); - break} - let a=AZ(h,"time",0),c=BY.fromString(h.color),l=i.curve; - l&&(n=EZ(l,t,n,e,0,r,a,o.r,c.r,1),n=EZ(l,t,n,e,1,r,a,o.g,c.g,1),n=EZ(l,t,n,e,2,r,a,o.b,c.b,1)),r=a,o=c,i=h} - n.push(t)} - else if("alpha"==t)n.push(bZ(s,new Vq(e,e,h),0,1)); - else if("rgba2"==t){ - let t=new Kq(e,7*e,h),i=s[0],r=AZ(i,"time",0),o=BY.fromString(i.light),a=BY.fromString(i.dark); - for(let e=0,n=0; - ; - e++){ - t.setFrame(e,r,o.r,o.g,o.b,o.a,a.r,a.g,a.b); - let h=s[e+1]; - if(!h){ - t.shrink(n); - break} - let c=AZ(h,"time",0),l=BY.fromString(h.light),u=BY.fromString(h.dark),d=i.curve; - d&&(n=EZ(d,t,n,e,0,r,c,o.r,l.r,1),n=EZ(d,t,n,e,1,r,c,o.g,l.g,1),n=EZ(d,t,n,e,2,r,c,o.b,l.b,1),n=EZ(d,t,n,e,3,r,c,o.a,l.a,1),n=EZ(d,t,n,e,4,r,c,a.r,u.r,1),n=EZ(d,t,n,e,5,r,c,a.g,u.g,1),n=EZ(d,t,n,e,6,r,c,a.b,u.b,1)),r=c,o=l,a=u,i=h} - n.push(t)} - else if("rgb2"==t){ - let t=new Yq(e,6*e,h),i=s[0],r=AZ(i,"time",0),o=BY.fromString(i.light),a=BY.fromString(i.dark); - for(let e=0,n=0; - ; - e++){ - t.setFrame(e,r,o.r,o.g,o.b,a.r,a.g,a.b); - let h=s[e+1]; - if(!h){ - t.shrink(n); - break} - let c=AZ(h,"time",0),l=BY.fromString(h.light),u=BY.fromString(h.dark),d=i.curve; - d&&(n=EZ(d,t,n,e,0,r,c,o.r,l.r,1),n=EZ(d,t,n,e,1,r,c,o.g,l.g,1),n=EZ(d,t,n,e,2,r,c,o.b,l.b,1),n=EZ(d,t,n,e,3,r,c,a.r,u.r,1),n=EZ(d,t,n,e,4,r,c,a.g,u.g,1),n=EZ(d,t,n,e,5,r,c,a.b,u.b,1)),r=c,o=l,a=u,i=h} - n.push(t)} - } - } - if(t.bones)for(let r in t.bones){ - let i=t.bones[r],h=s.findBone(r); - if(!h)throw new Error("Bone not found: "+r); - let o=h.index; - for(let t in i){ - let s=i[t],r=s.length; - if(0!=r)if("rotate"===t)n.push(bZ(s,new vq(r,r,o),0,1)); - else if("translate"===t){ - let t=new Mq(r,r<<1,o); - n.push(yZ(s,t,"x","y",0,e))} - else if("translatex"===t){ - let t=new yq(r,r,o); - n.push(bZ(s,t,0,e))} - else if("translatey"===t){ - let t=new Aq(r,r,o); - n.push(bZ(s,t,0,e))} - else if("scale"===t){ - let t=new Tq(r,r<<1,o); - n.push(yZ(s,t,"x","y",1,1))} - else if("scalex"===t){ - let t=new Oq(r,r,o); - n.push(bZ(s,t,1,1))} - else if("scaley"===t){ - let t=new kq(r,r,o); - n.push(bZ(s,t,1,1))} - else if("shear"===t){ - let t=new Rq(r,r<<1,o); - n.push(yZ(s,t,"x","y",0,1))} - else if("shearx"===t){ - let t=new Nq(r,r,o); - n.push(bZ(s,t,0,1))} - else if("sheary"===t){ - let t=new Dq(r,r,o); - n.push(bZ(s,t,0,1))} - else if("inherit"===t){ - let t=new Bq(r,h.index); - for(let i=0; - i<s.length; - i++){ - let e=s[i]; - t.setFrame(i,AZ(e,"time",0),HY.enumValue(OJ,AZ(e,"inherit","Normal")))} - n.push(t)} - } - } - if(t.ik)for(let r in t.ik){ - let i=t.ik[r],h=i[0]; - if(!h)continue; - let o=s.findIkConstraint(r); - if(!o)throw new Error("IK Constraint not found: "+r); - let a=s.ikConstraints.indexOf(o),c=new nX(i.length,i.length<<1,a),l=AZ(h,"time",0),u=AZ(h,"mix",1),d=AZ(h,"softness",0)*e; - for(let t=0,s=0; - ; - t++){ - c.setFrame(t,l,u,d,AZ(h,"bendPositive",!0)?1:-1,AZ(h,"compress",!1),AZ(h,"stretch",!1)); - let n=i[t+1]; - if(!n){ - c.shrink(s); - break} - let r=AZ(n,"time",0),o=AZ(n,"mix",1),a=AZ(n,"softness",0)*e,f=h.curve; - f&&(s=EZ(f,c,s,t,0,l,r,u,o,1),s=EZ(f,c,s,t,1,l,r,d,a,e)),l=r,u=o,d=a,h=n} - n.push(c)} - if(t.transform)for(let r in t.transform){ - let i=t.transform[r],e=i[0]; - if(!e)continue; - let h=s.findTransformConstraint(r); - if(!h)throw new Error("Transform constraint not found: "+r); - let o=s.transformConstraints.indexOf(h),a=new rX(i.length,6*i.length,o),c=AZ(e,"time",0),l=AZ(e,"mixRotate",1),u=AZ(e,"mixX",1),d=AZ(e,"mixY",u),f=AZ(e,"mixScaleX",1),p=AZ(e,"mixScaleY",f),w=AZ(e,"mixShearY",1); - for(let t=0,s=0; - ; - t++){ - a.setFrame(t,c,l,u,d,f,p,w); - let n=i[t+1]; - if(!n){ - a.shrink(s); - break} - let h=AZ(n,"time",0),r=AZ(n,"mixRotate",1),o=AZ(n,"mixX",1),g=AZ(n,"mixY",o),m=AZ(n,"mixScaleX",1),v=AZ(n,"mixScaleY",m),_=AZ(n,"mixShearY",1),M=e.curve; - M&&(s=EZ(M,a,s,t,0,c,h,l,r,1),s=EZ(M,a,s,t,1,c,h,u,o,1),s=EZ(M,a,s,t,2,c,h,d,g,1),s=EZ(M,a,s,t,3,c,h,f,m,1),s=EZ(M,a,s,t,4,c,h,p,v,1),s=EZ(M,a,s,t,5,c,h,w,_,1)),c=h,l=r,u=o,d=g,f=m,p=v,f=m,e=n} - n.push(a)} - if(t.path)for(let r in t.path){ - let i=t.path[r],h=s.findPathConstraint(r); - if(!h)throw new Error("Path constraint not found: "+r); - let o=s.pathConstraints.indexOf(h); - for(let t in i){ - let s=i[t],r=s[0]; - if(!r)continue; - let a=s.length; - if("position"===t){ - let t=new aX(a,a,o); - n.push(bZ(s,t,0,h.positionMode==WJ.Fixed?e:1))} - else if("spacing"===t){ - let t=new lX(a,a,o); - n.push(bZ(s,t,0,h.spacingMode==jJ.Length||h.spacingMode==jJ.Fixed?e:1))} - else if("mix"===t){ - let t=new dX(a,3*a,o),i=AZ(r,"time",0),e=AZ(r,"mixRotate",1),h=AZ(r,"mixX",1),c=AZ(r,"mixY",h); - for(let n=0,o=0; - ; - n++){ - t.setFrame(n,i,e,h,c); - let a=s[n+1]; - if(!a){ - t.shrink(o); - break} - let l=AZ(a,"time",0),u=AZ(a,"mixRotate",1),d=AZ(a,"mixX",1),f=AZ(a,"mixY",d),p=r.curve; - p&&(o=EZ(p,t,o,n,0,i,l,e,u,1),o=EZ(p,t,o,n,1,i,l,h,d,1),o=EZ(p,t,o,n,2,i,l,c,f,1)),i=l,e=u,h=d,c=f,r=a} - n.push(t)} - } - } - if(t.physics)for(let r in t.physics){ - let i=t.physics[r],e=-1; - if(r.length>0){ - let t=s.findPhysicsConstraint(r); - if(!t)throw new Error("Physics constraint not found: "+r); - e=s.physicsConstraints.indexOf(t)} - for(let t in i){ - let s=i[t],h=s[0]; - if(!h)continue; - let r,o=s.length; - if("reset"==t){ - const t=new kX(o,e); - for(let i=0; - null!=h; - h=s[i+1],i++)t.setFrame(i,AZ(h,"time",0)); - n.push(t); - continue} - if("inertia"==t)r=new gX(o,o,e); - else if("strength"==t)r=new vX(o,o,e); - else if("damping"==t)r=new MX(o,o,e); - else if("mass"==t)r=new yX(o,o,e); - else if("wind"==t)r=new AX(o,o,e); - else if("gravity"==t)r=new TX(o,o,e); - else{ - if("mix"!=t)continue; - r=new OX(o,o,e)} - n.push(bZ(s,r,0,1))} - } - if(t.attachments)for(let r in t.attachments){ - let i=t.attachments[r],h=s.findSkin(r); - if(!h)throw new Error("Skin not found: "+r); - for(let t in i){ - let r=i[t],o=s.findSlot(t); - if(!o)throw new Error("Slot not found: "+t); - let a=o.index; - for(let t in r){ - let i=r[t],s=h.getAttachment(a,t); - for(let t in i){ - let h=i[t],r=h[0]; - if(r)if("deform"==t){ - let t=s.bones,i=s.vertices,o=t?i.length/3*2:i.length,c=new Qq(h.length,h.length,a,s),l=AZ(r,"time",0); - for(let s=0,n=0; - ; - s++){ - let a,u=AZ(r,"vertices",null); - if(u){ - a=HY.newFloatArray(o); - let s=AZ(r,"offset",0); - if(HY.arrayCopy(u,0,a,s,u.length),1!=e)for(let t=s,i=t+u.length; - t<i; - t++)a[t]*=e; - if(!t)for(let t=0; - t<o; - t++)a[t]+=i[t]} - else a=t?HY.newFloatArray(o):i; - c.setFrame(s,l,a); - let d=h[s+1]; - if(!d){ - c.shrink(n); - break} - let f=AZ(d,"time",0),p=r.curve; - p&&(n=EZ(p,c,n,s,0,l,f,0,1,1)),l=f,r=d} - n.push(c)} - else if("sequence"==t){ - let t=new RX(h.length,a,s),i=0; - for(let s=0; - s<h.length; - s++){ - let e=AZ(r,"delay",i),n=AZ(r,"time",0),o=ZY[AZ(r,"mode","hold")],a=AZ(r,"index",0); - t.setFrame(s,n,o,a,e),i=e,r=h[s+1]} - n.push(t)} - } - } - } - } - if(t.drawOrder){ - let i=new sX(t.drawOrder.length),e=s.slots.length,h=0; - for(let n=0; - n<t.drawOrder.length; - n++,h++){ - let r=t.drawOrder[n],o=null,a=AZ(r,"offsets",null); - if(a){ - o=HY.newArray(e,-1); - let t=HY.newArray(e-a.length,0),i=0,n=0; - for(let e=0; - e<a.length; - e++){ - let h=a[e],r=s.findSlot(h.slot); - if(!r)throw new Error("Slot not found: "+r); - let c=r.index; - for(; - i!=c; - )t[n++]=i++; - o[i+h.offset]=i++} - for(; - i<e; - )t[n++]=i++; - for(let s=e-1; - s>=0; - s--)-1==o[s]&&(o[s]=t[--n])} - i.setFrame(h,AZ(r,"time",0),o)} - n.push(i)} - if(t.events){ - let i=new tX(t.events.length),e=0; - for(let n=0; - n<t.events.length; - n++,e++){ - let h=t.events[n],r=s.findEvent(h.name); - if(!r)throw new Error("Event not found: "+h.name); - let o=new NJ(HY.toSinglePrecision(AZ(h,"time",0)),r); - o.intValue=AZ(h,"int",r.intValue),o.floatValue=AZ(h,"float",r.floatValue),o.stringValue=AZ(h,"string",r.stringValue),o.data.audioPath&&(o.volume=AZ(h,"volume",1),o.balance=AZ(h,"balance",0)),i.setFrame(e,o)} - n.push(i)} - let h=0; - for(let r=0,o=n.length; - r<o; - r++)h=Math.max(h,n[r].getDuration()); - s.animations.push(new eq(i,n,h))} - } - ; - Qt(mZ,"SkeletonJson"); - let vZ=mZ; - const _Z=class{ - constructor(t,i,s,e,n){ - Zt(this,"parent"),Zt(this,"skin"),Zt(this,"slotIndex"),Zt(this,"mesh"),Zt(this,"inheritTimeline"),this.mesh=t,this.skin=i,this.slotIndex=s,this.parent=e,this.inheritTimeline=n} - } - ; - Qt(_Z,"LinkedMesh"); - let MZ=_Z; - function bZ(t,i,s,e){ - let n=t[0],h=AZ(n,"time",0),r=AZ(n,"value",s)*e,o=0; - for(let a=0; - ; - a++){ - i.setFrame(a,h,r); - let c=t[a+1]; - if(!c)return i.shrink(o),i; - let l=AZ(c,"time",0),u=AZ(c,"value",s)*e; - n.curve&&(o=EZ(n.curve,i,o,a,0,h,l,r,u,e)),h=l,r=u,n=c} - } - function yZ(t,i,s,e,n,h){ - let r=t[0],o=AZ(r,"time",0),a=AZ(r,s,n)*h,c=AZ(r,e,n)*h,l=0; - for(let u=0; - ; - u++){ - i.setFrame(u,o,a,c); - let d=t[u+1]; - if(!d)return i.shrink(l),i; - let f=AZ(d,"time",0),p=AZ(d,s,n)*h,w=AZ(d,e,n)*h,g=r.curve; - g&&(l=EZ(g,i,l,u,0,o,f,a,p,h),l=EZ(g,i,l,u,1,o,f,c,w,h)),o=f,a=p,c=w,r=d} - } - function EZ(t,i,s,e,n,h,r,o,a,c){ - if("stepped"==t)return i.setStepped(e),s; - let l=n<<2,u=t[l],d=t[l+1]*c,f=t[l+2],p=t[l+3]*c; - return i.setBezier(s,e,n,h,o,u,d,f,p,r,a),s+1} - function AZ(t,i,s){ - return void 0!==t[i]?t[i]:s} - Qt(bZ,"readTimeline1"),Qt(yZ,"readTimeline2"),Qt(EZ,"readCurve"),Qt(AZ,"getValue"),void 0===Math.fround&&(Math.fround=function(t){ - return function(i){ - return t[0]=i,t[0]} - } - (new Float32Array(1))); - const SZ=class t extends iJ{ - constructor(t){ - super(t.resource),Zt(this,"texture"),this.texture=ls.from(t)} - static from(i){ - return t.textureMap.has(i)?t.textureMap.get(i):new t(i)} - setFilters(i,s){ - const e=this.texture.source.style; - e.minFilter=t.toPixiTextureFilter(i),e.magFilter=t.toPixiTextureFilter(s),this.texture.source.autoGenerateMipmaps=t.toPixiMipMap(i),this.texture.source.updateMipmaps()} - setWraps(i,s){ - const e=this.texture.source.style; - e.addressModeU=t.toPixiTextureWrap(i),e.addressModeV=t.toPixiTextureWrap(s)} - dispose(){ - this.texture.destroy()} - static toPixiMipMap(t){ - switch(t){ - case sJ.Nearest:case sJ.Linear:return!1; - case sJ.MipMapNearestLinear:case sJ.MipMapNearestNearest:case sJ.MipMapLinearLinear:case sJ.MipMapLinearNearest:return!0; - default:throw new Error(`Unknown texture filter: ${ - String(t)} - `)} - } - static toPixiTextureFilter(t){ - switch(t){ - case sJ.Nearest:case sJ.MipMapNearestLinear:case sJ.MipMapNearestNearest:return"nearest"; - case sJ.Linear:case sJ.MipMapLinearLinear:case sJ.MipMapLinearNearest:return"linear"; - default:throw new Error(`Unknown texture filter: ${ - String(t)} - `)} - } - static toPixiTextureWrap(t){ - switch(t){ - case nJ.ClampToEdge:return"clamp-to-edge"; - case nJ.MirroredRepeat:return"mirror-repeat"; - case nJ.Repeat:return"repeat"; - default:throw new Error(`Unknown texture wrap: ${ - String(t)} - `)} - } - static toPixiBlending(t){ - switch(t){ - case mQ.Normal:return"normal"; - case mQ.Additive:return"add"; - case mQ.Multiply:return"multiply"; - case mQ.Screen:return"screen"; - default:throw new Error(`Unknown blendMode: ${ - String(t)} - `)} - } - } - ; - Qt(SZ,"SpineTexture"),Zt(SZ,"textureMap",new Map); - let TZ=SZ; - const CZ="spineTextureAtlasLoader",OZ={ - extension:ri.Asset,resolver:{ - test:Qt(t=>Ko(t,".atlas"),"test"),parse:Qt(t=>{ - var i,s; - const e=t.split("."); - return{ - resolution:parseFloat((null==(s=null==(i=Hn.RETINA_PREFIX)?void 0:i.exec(t))?void 0:s[1])??"1"),format:e[e.length-2],src:t} - } - ,"parse")} - ,loader:{ - id:CZ,name:CZ,extension:{ - type:ri.LoadParser,priority:xn.Normal,name:CZ} - ,test:t=>Ko(t,".atlas"),async load(t){ - const i=await ln.get().fetch(t); - return await i.text()} - ,testParse(t,i){ - const s=Ko(i.src,".atlas"),e="string"==typeof t,n=i.parser===CZ||i.loadParser===CZ; - return Promise.resolve((s||n)&&e)} - ,unload(t){ - t.dispose()} - ,async parse(t,i,s){ - const e=i.data||{ - } - ; - let n=Gn.dirname(i.src); - n&&n.lastIndexOf("/")!==n.length-1&&(n+="/"); - const h=new cJ(t); - if(e.images instanceof ns||"string"==typeof e.images){ - const t=e.images; - e.images={ - } - ,e.images[h.pages[0].name]=t} - const r=[]; - for(const o of h.pages){ - const t=o.name,h=(null==e?void 0:e.images)?e.images[t]:void 0; - if(h instanceof ns)o.setTexture(TZ.from(h)); - else{ - const a=h??Gn.normalize([...n.split(Gn.sep),t].join(Gn.sep)),c={ - src:Vn(a,i.src),data:{ - ...e.imageMetadata,alphaMode:o.pma?"premultiplied-alpha":"premultiply-alpha-on-upload"} - } - ,l=s.load(c).then(t=>{ - o.setTexture(TZ.from(t.source))} - ); - r.push(l)} - } - return await Promise.all(r),h} - } - } - ; - ci.add(OZ); - const IZ="spineSkeletonLoader"; - function kZ(t){ - return Object.prototype.hasOwnProperty.call(t,"bones")} - function xZ(t){ - return t instanceof Uint8Array} - Qt(kZ,"isJson"),Qt(xZ,"isBuffer"); - const RZ={ - extension:ri.Asset,loader:{ - id:IZ,name:IZ,extension:{ - type:ri.LoadParser,priority:xn.Normal,name:IZ} - ,test:t=>Ko(t,".skel"),async load(t){ - const i=await ln.get().fetch(t); - return new Uint8Array(await i.arrayBuffer())} - ,testParse(t,i){ - const s=Ko(i.src,".json")&&kZ(t),e=Ko(i.src,".skel")&&xZ(t),n=i.parser===IZ||i.loadParser===IZ; - return Promise.resolve(s||e||n)} - } - } - ; - ci.add(RZ); - const PZ=new Float32Array(1),NZ=new Uint32Array(1),LZ=class extends Qa{ - constructor(){ - const t=new za({ - data:PZ,label:"attribute-batch-buffer",usage:Ka.VERTEX|Ka.COPY_DST,shrinkToFit:!1} - ); - super({ - attributes:{ - aPosition:{ - buffer:t,format:"float32x2",stride:28,offset:0} - ,aUV:{ - buffer:t,format:"float32x2",stride:28,offset:8} - ,aColor:{ - buffer:t,format:"unorm8x4",stride:28,offset:16} - ,aDarkColor:{ - buffer:t,format:"unorm8x4",stride:28,offset:20} - ,aTextureIdAndRound:{ - buffer:t,format:"uint16x2",stride:28,offset:24} - } - ,indexBuffer:new za({ - data:NZ,label:"index-batch-buffer",usage:Ka.INDEX|Ka.COPY_DST,shrinkToFit:!1} - )} - )} - } - ; - Qt(LZ,"DarkTintBatchGeometry"); - let DZ=LZ; - const GZ={ - name:"color-bit",vertex:{ - header:"\n @in aDarkColor: vec4<f32>; - \n @out vDarkColor: vec4<f32>; - \n ",main:"\n vDarkColor = aDarkColor; - \n "} - ,fragment:{ - header:"\n @in vDarkColor: vec4<f32>; - \n ",end:"\n\n let alpha = outColor.a * vColor.a; - \n let rgb = ((outColor.a - 1.0) * vDarkColor.a + 1.0 - outColor.rgb) * vDarkColor.rgb + outColor.rgb * vColor.rgb; - \n\n finalColor = vec4<f32>(rgb, alpha); - \n\n "} - } - ,BZ={ - name:"color-bit",vertex:{ - header:"\n in vec4 aDarkColor; - \n out vec4 vDarkColor; - \n ",main:"\n vDarkColor = aDarkColor; - \n "} - ,fragment:{ - header:"\n in vec4 vDarkColor; - \n ",end:"\n\n finalColor.a = outColor.a * vColor.a; - \n finalColor.rgb = ((outColor.a - 1.0) * vDarkColor.a + 1.0 - outColor.rgb) * vDarkColor.rgb + outColor.rgb * vColor.rgb; - \n "} - } - ,UZ=class extends lr{ - constructor(t){ - super({ - glProgram:Oc({ - name:"dark-tint-batch",bits:[kc,BZ,Gc(t),Uc]} - ),gpuProgram:Cc({ - name:"dark-tint-batch",bits:[Ic,GZ,Nc(t),Bc]} - ),resources:{ - batchSamplers:$c(t)} - } - )} - } - ; - Qt(UZ,"DarkTintShader"); - let FZ=UZ,$Z=null; - const HZ=class t extends ja{ - constructor(){ - super(...arguments),Zt(this,"geometry",new DZ),Zt(this,"shader",$Z||($Z=new FZ(this.maxTextures))),Zt(this,"name",t.extension.name),Zt(this,"vertexSize",7)} - packAttributes(t,i,s,e,n){ - const h=n<<16|65535&t.roundPixels,r=t.transform,o=r.a,a=r.b,c=r.c,l=r.d,u=r.tx,d=r.ty,{ - positions:f,uvs:p} - =t,w=t.color,g=(w>>24&255)/255,m=Ks.shared.setValue(t.darkColor).premultiply(g,!0).toPremultiplied(1,!1),v=t.attributeOffset,_=v+t.attributeSize; - for(let M=v; - M<_; - M++){ - const t=2*M,n=f[t],r=f[t+1]; - i[e++]=o*n+c*r+u,i[e++]=l*r+a*n+d,i[e++]=p[t],i[e++]=p[t+1],s[e++]=w,s[e++]=m,s[e++]=h} - } - packQuadAttributes(t,i,s,e,n){ - const h=t.texture,r=t.transform,o=r.a,a=r.b,c=r.c,l=r.d,u=r.tx,d=r.ty,f=t.bounds,p=f.maxX,w=f.minX,g=f.maxY,m=f.minY,v=h.uvs,_=t.color,M=t.darkColor,b=n<<16|65535&t.roundPixels; - i[e+0]=o*w+c*m+u,i[e+1]=l*m+a*w+d,i[e+2]=v.x0,i[e+3]=v.y0,s[e+4]=_,s[e+5]=M,s[e+6]=b,i[e+7]=o*p+c*m+u,i[e+8]=l*m+a*p+d,i[e+9]=v.x1,i[e+10]=v.y1,s[e+11]=_,s[e+12]=M,s[e+13]=b,i[e+14]=o*p+c*g+u,i[e+15]=l*g+a*p+d,i[e+16]=v.x2,i[e+17]=v.y2,s[e+18]=_,s[e+19]=M,s[e+20]=b,i[e+21]=o*w+c*g+u,i[e+22]=l*g+a*w+d,i[e+23]=v.x3,i[e+24]=v.y3,s[e+25]=_,s[e+26]=M,s[e+27]=b} - } - ; - Qt(HZ,"DarkTintBatcher"),Zt(HZ,"extension",{ - type:[ri.Batcher],name:"darkTint"} - ); - let WZ=HZ; - ci.add(WZ); - const VZ=HY.newFloatArray(8),jZ=class t{ - constructor(t){ - Zt(this,"ctx"),Zt(this,"triangleRendering",!1),Zt(this,"debugRendering",!1),Zt(this,"vertices",HY.newFloatArray(8192)),Zt(this,"tempColor",new BY),this.ctx=t} - draw(t){ - this.triangleRendering?this.drawTriangles(t):this.drawImages(t)} - drawImages(t){ - let i=this.ctx,s=this.tempColor,e=t.color,n=t.drawOrder; - this.debugRendering&&(i.strokeStyle="green"); - for(let h=0,r=n.length; - h<r; - h++){ - let t=n[h],r=t.bone; - if(!r.active)continue; - let o=t.getAttachment(); - if(!(o instanceof EJ))continue; - o.computeWorldVertices(t,VZ,0,2); - let a=o.region,c=a.texture.getImage(),l=t.color,u=o.color; - s.set(e.r*l.r*u.r,e.g*l.g*u.g,e.b*l.b*u.b,e.a*l.a*u.a),i.save(),i.transform(r.a,r.c,r.b,r.d,r.worldX,r.worldY),i.translate(o.offset[0],o.offset[1]),i.rotate(o.rotation*Math.PI/180); - let d=o.width/a.originalWidth; - i.scale(d*o.scaleX,d*o.scaleY); - let f=a.width,p=a.height; - if(i.translate(f/2,p/2),90==o.region.degrees){ - let t=f; - f=p,p=t,i.rotate(-Math.PI/2)} - i.scale(1,-1),i.translate(-f/2,-p/2),i.globalAlpha=s.a,i.drawImage(c,c.width*a.u,c.height*a.v,f,p,0,0,f,p),this.debugRendering&&i.strokeRect(0,0,f,p),i.restore()} - } - drawTriangles(i){ - let s=this.ctx,e=this.tempColor,n=i.color,h=i.drawOrder,r=null,o=this.vertices,a=null; - for(let l=0,u=h.length; - l<u; - l++){ - let i,u=h[l],d=u.getAttachment(); - if(d instanceof EJ){ - let s=d; - o=this.computeRegionVertices(u,s,!1),a=t.QUAD_TRIANGLES,i=s.region.texture.getImage()} - else{ - if(!(d instanceof mJ))continue; - { - let t=d; - o=this.computeMeshVertices(u,t,!1),a=t.triangles,i=t.region.texture.getImage()} - } - if(i){ - u.data.blendMode!=r&&(r=u.data.blendMode); - let t=u.color,h=d.color; - e.set(n.r*t.r*h.r,n.g*t.g*h.g,n.b*t.b*h.b,n.a*t.a*h.a),s.globalAlpha=e.a; - for(var c=0; - c<a.length; - c+=3){ - let t=8*a[c],e=8*a[c+1],n=8*a[c+2],h=o[t],r=o[t+1],l=o[t+6],u=o[t+7],d=o[e],f=o[e+1],p=o[e+6],w=o[e+7],g=o[n],m=o[n+1],v=o[n+6],_=o[n+7]; - this.drawTriangle(i,h,r,l,u,d,f,p,w,g,m,v,_),this.debugRendering&&(s.strokeStyle="green",s.beginPath(),s.moveTo(h,r),s.lineTo(d,f),s.lineTo(g,m),s.lineTo(h,r),s.stroke())} - } - } - this.ctx.globalAlpha=1} - drawTriangle(t,i,s,e,n,h,r,o,a,c,l,u,d){ - let f=this.ctx; - const p=t.width-1,w=t.height-1; - e*=p,n*=w,o*=p,a*=w,u*=p,d*=w,f.beginPath(),f.moveTo(i,s),f.lineTo(h,r),f.lineTo(c,l),f.closePath(); - let g=(o-=e)*(d-=n)-(u-=e)*(a-=n); - if(0==g)return; - g=1/g; - const m=(d*(h-=i)-a*(c-=i))*g,v=(d*(r-=s)-a*(l-=s))*g,_=(o*c-u*h)*g,M=(o*l-u*r)*g,b=i-m*e-_*n,y=s-v*e-M*n; - f.save(),f.transform(m,v,_,M,b,y),f.clip(),f.drawImage(t,0,0),f.restore()} - computeRegionVertices(i,s,e){ - let n=i.bone.skeleton.color,h=i.color,r=s.color,o=n.a*h.a*r.a,a=e?o:1,c=this.tempColor; - c.set(n.r*h.r*r.r*a,n.g*h.g*r.g*a,n.b*h.b*r.b*a,o),s.computeWorldVertices(i,this.vertices,0,t.VERTEX_SIZE); - let l=this.vertices,u=s.uvs; - return l[EJ.C1R]=c.r,l[EJ.C1G]=c.g,l[EJ.C1B]=c.b,l[EJ.C1A]=c.a,l[EJ.U1]=u[0],l[EJ.V1]=u[1],l[EJ.C2R]=c.r,l[EJ.C2G]=c.g,l[EJ.C2B]=c.b,l[EJ.C2A]=c.a,l[EJ.U2]=u[2],l[EJ.V2]=u[3],l[EJ.C3R]=c.r,l[EJ.C3G]=c.g,l[EJ.C3B]=c.b,l[EJ.C3A]=c.a,l[EJ.U3]=u[4],l[EJ.V3]=u[5],l[EJ.C4R]=c.r,l[EJ.C4G]=c.g,l[EJ.C4B]=c.b,l[EJ.C4A]=c.a,l[EJ.U4]=u[6],l[EJ.V4]=u[7],l} - computeMeshVertices(i,s,e){ - let n=i.bone.skeleton.color,h=i.color,r=s.color,o=n.a*h.a*r.a,a=e?o:1,c=this.tempColor; - c.set(n.r*h.r*r.r*a,n.g*h.g*r.g*a,n.b*h.b*r.b*a,o); - let l=s.worldVerticesLength/2,u=this.vertices; - u.length<s.worldVerticesLength&&(this.vertices=u=HY.newFloatArray(s.worldVerticesLength)),s.computeWorldVertices(i,0,s.worldVerticesLength,u,0,t.VERTEX_SIZE); - let d=s.uvs; - for(let t=0,f=0,p=2; - t<l; - t++)u[p++]=c.r,u[p++]=c.g,u[p++]=c.b,u[p++]=c.a,u[p++]=d[f++],u[p++]=d[f++],p+=2; - return u} - } - ; - Qt(jZ,"SkeletonRenderer"),Zt(jZ,"QUAD_TRIANGLES",[0,1,2,2,3,0]),Zt(jZ,"VERTEX_SIZE",8); - let KZ=jZ; - const zZ=class{ - constructor(){ - Zt(this,"indexOffset",0),Zt(this,"attributeOffset",0),Zt(this,"indexSize"),Zt(this,"attributeSize"),Zt(this,"batcherName","darkTint"),Zt(this,"topology","triangle-list"),Zt(this,"packAsQuad",!1),Zt(this,"renderable"),Zt(this,"positions"),Zt(this,"indices"),Zt(this,"uvs"),Zt(this,"roundPixels"),Zt(this,"data"),Zt(this,"blendMode"),Zt(this,"darkTint"),Zt(this,"texture"),Zt(this,"transform"),Zt(this,"_textureId"),Zt(this,"_attributeStart"),Zt(this,"_indexStart"),Zt(this,"_batcher"),Zt(this,"_batch")} - get color(){ - const t=this.data.color,i=this.renderable.groupColor,s=this.renderable.groupAlpha; - let e; - const n=t.a*s*255; - if(16777215!==i){ - const s=i>>16&255,h=i>>8&255,r=255&i,o=t.r*r,a=t.g*h; - e=n<<24|t.b*s<<16|a<<8|o} - else e=n<<24|255*t.b<<16|255*t.g<<8|255*t.r; - return e} - get darkColor(){ - const t=this.data.darkColor; - return 255*t.b<<16|255*t.g<<8|255*t.r} - get groupTransform(){ - return this.renderable.groupTransform} - setData(t,i,s,e){ - if(this.renderable=t,this.transform=t.groupTransform,this.data=i,i.clipped){ - const t=i.clippedData; - this.indexSize=t.indicesCount,this.attributeSize=t.vertexCount,this.positions=t.vertices,this.indices=t.indices,this.uvs=t.uvs} - else this.indexSize=i.indices.length,this.attributeSize=i.vertices.length/2,this.positions=i.vertices,this.indices=i.indices,this.uvs=i.uvs; - this.texture=i.texture,this.roundPixels=e,this.blendMode=s,this.batcherName=i.darkTint?"darkTint":"default"} - } - ; - Qt(zZ,"BatchableSpineSlot"); - let YZ=zZ; - const qZ={ - 0:"normal",1:"add",2:"multiply",3:"screen"} - ,XZ=class{ - constructor(t){ - Zt(this,"renderer"),Zt(this,"canvasSkeletonRenderer"),Zt(this,"gpuSpineData",{ - } - ),Zt(this,"_destroyRenderableBound",this.destroyRenderable.bind(this)),this.renderer=t} - validateRenderable(t){ - if(this.renderer.type===ar.CANVAS)return!0; - if(t._validateAndTransformAttachments(),t.spineAttachmentsDirty)return!0; - if(t.spineTexturesDirty){ - const i=t.skeleton.drawOrder,s=this.gpuSpineData[t.uid]; - for(let e=0,n=i.length; - e<n; - e++){ - const n=i[e],h=n.getAttachment(); - if(h instanceof EJ||h instanceof mJ){ - const i=t._getCachedData(n,h),e=s.slotBatches[i.id],r=i.texture; - if(r!==(null==e?void 0:e.texture)&&!(null==e?void 0:e._batcher.checkAndUpdateTexture(e,r)))return!0} - } - } - return!1} - execute(t){ - if(this.renderer.type===ar.CANVAS){ - const i=this.renderer,s=(t.groupColorAlpha>>>24&255)/255,e=i.canvasContext,n=e.activeContext; - n.save(),this.canvasSkeletonRenderer||(this.canvasSkeletonRenderer=new KZ(n),this.canvasSkeletonRenderer.triangleRendering=!0),e.setContextTransform(t.groupTransform,1===(i._roundPixels|t._roundPixels)); - const h=t.skeleton.color.a; - t.skeleton.color.a*=s,this.canvasSkeletonRenderer.draw(t.skeleton),t.skeleton.color.a=h,n.restore()} - } - addRenderable(t,i){ - var s,e; - if(this.renderer.type===ar.CANVAS)return this.renderer.renderPipes.batch.break(i),void i.add(t); - const n=this._getSpineData(t),h=this.renderer.renderPipes.batch,r=t.skeleton.drawOrder,o=this.renderer._roundPixels|t._roundPixels; - t._validateAndTransformAttachments(),t.spineAttachmentsDirty=!1,t.spineTexturesDirty=!1; - for(let a=0,c=r.length; - a<c; - a++){ - const c=r[a],l=c.getAttachment(),u=qZ[c.data.blendMode]; - let d=!1; - if(l instanceof EJ||l instanceof mJ){ - const r=t._getCachedData(c,l),a=(s=n.slotBatches)[e=r.id]||(s[e]=new YZ); - a.setData(t,r,u,o),d=r.skipRender,d||h.addToBatch(a,i)} - const f=t._slotsObject[c.data.name]; - if(f){ - const t=f.container; - d||(t.includeInBuild=!0,t.collectRenderables(i,this.renderer,null)),t.includeInBuild=!1} - } - } - updateRenderable(t){ - var i; - const s=this.gpuSpineData[t.uid]; - t._validateAndTransformAttachments(),t.spineAttachmentsDirty=!1,t.spineTexturesDirty=!1; - const e=t.skeleton.drawOrder; - for(let n=0,h=e.length; - n<h; - n++){ - const h=e[n],r=h.getAttachment(); - if(r instanceof EJ||r instanceof mJ){ - const e=t._getCachedData(h,r); - if(!e.skipRender){ - const t=s.slotBatches[e.id]; - null==(i=null==t?void 0:t._batcher)||i.updateElement(t)} - } - } - } - destroyRenderable(t){ - this.gpuSpineData[t.uid]=null,t.off("destroyed",this._destroyRenderableBound)} - destroy(){ - this.gpuSpineData=null,this.renderer=null,this.canvasSkeletonRenderer=null} - _getSpineData(t){ - return this.gpuSpineData[t.uid]||this._initMeshData(t)} - _initMeshData(t){ - return this.gpuSpineData[t.uid]={ - slotBatches:{ - } - } - ,t.on("destroyed",this._destroyRenderableBound),this.gpuSpineData[t.uid]} - } - ; - Qt(XZ,"SpinePipe"),Zt(XZ,"extension",{ - type:[ri.WebGLPipes,ri.WebGPUPipes,ri.CanvasPipes],name:"spine"} - ); - let JZ=XZ; - ci.add(JZ); - const QZ=new KY; - nQ.yDown=!0; - const ZZ=new gZ,t0=new VY(()=>new ep),i0=class t extends Ye{ - constructor(t){ - t instanceof lQ&&(t={ - skeletonData:t} - ),super({ - } - ),Zt(this,"batched",!0),Zt(this,"buildId",0),Zt(this,"renderPipeId","spine"),Zt(this,"_didSpineUpdate",!1),Zt(this,"beforeUpdateWorldTransforms",Qt(()=>{ - } - ,"beforeUpdateWorldTransforms")),Zt(this,"afterUpdateWorldTransforms",Qt(()=>{ - } - ,"afterUpdateWorldTransforms")),Zt(this,"skeleton"),Zt(this,"state"),Zt(this,"skeletonBounds"),Zt(this,"darkTint",!1),Zt(this,"_debug"),Zt(this,"_slotsObject",Object.create(null)),Zt(this,"clippingSlotToPixiMasks",Object.create(null)),Zt(this,"spineAttachmentsDirty",!0),Zt(this,"spineTexturesDirty",!0),Zt(this,"_lastAttachments",[]),Zt(this,"_stateChanged",!0),Zt(this,"attachmentCacheData",[]),Zt(this,"_autoUpdate",!1),Zt(this,"_ticker",Mn.shared),Zt(this,"_boundsProvider"),Zt(this,"hasNeverUpdated",!0),Zt(this,"currentClippingSlot"),this.allowChildren=!0; - const i=t instanceof lQ?t:t.skeletonData; - this.skeleton=new nQ(i),this.state=new NX(new qX(i)),(null==t?void 0:t.ticker)&&(this._ticker=t.ticker),this.autoUpdate=(null==t?void 0:t.autoUpdate)??!0,this.darkTint=void 0===(null==t?void 0:t.darkTint)?this.skeleton.slots.some(t=>!!t.data.darkColor):null==t?void 0:t.darkTint; - const s=this.skeleton.slots; - for(let e=0; - e<s.length; - e++)this.attachmentCacheData[e]=Object.create(null); - this._boundsProvider=t.boundsProvider} - getSlotFromRef(t){ - let i; - if(i="number"==typeof t?this.skeleton.slots[t]:"string"==typeof t?this.skeleton.findSlot(t):t,!i)throw new Error(`No slot found with the given slot reference: ${ - t} - `); - return i} - get debug(){ - return this._debug} - set debug(t){ - this._debug&&this._debug.unregisterSpine(this),t&&t.registerSpine(this),this._debug=t} - get autoUpdate(){ - return this._autoUpdate} - set autoUpdate(t){ - t&&!this._autoUpdate?this._ticker.add(this.internalUpdate,this):!t&&this._autoUpdate&&this._ticker.remove(this.internalUpdate,this),this._autoUpdate=t} - get ticker(){ - return this._ticker} - set ticker(t){ - t=t??Mn.shared,this._ticker!==t&&(this._autoUpdate&&(this._ticker.remove(this.internalUpdate,this),t.add(this.internalUpdate,this)),this._ticker=t)} - get boundsProvider(){ - return this._boundsProvider} - set boundsProvider(t){ - this._boundsProvider=t,t&&(this._boundsDirty=!1),this.updateBounds()} - update(t){ - this.internalUpdate(0,t)} - internalUpdate(t,i){ - this._updateAndApplyState(i??this._ticker.deltaMS/1e3)} - get bounds(){ - return this._boundsDirty&&this.updateBounds(),this._bounds} - setBonePosition(t,i){ - const s=t; - if("string"==typeof t&&(t=this.skeleton.findBone(t)),!t)throw Error(`Cant set bone position, bone ${ - String(s)} - not found`); - if(QZ.set(i.x,i.y),t.parent){ - const i=t.parent.worldToLocal(QZ); - t.x=i.x,t.y=-i.y} - else t.x=QZ.x,t.y=QZ.y} - getBonePosition(t,i){ - return"string"==typeof t&&(t=this.skeleton.findBone(t)),t?(i||(i={ - x:0,y:0} - ),i.x=t.worldX,i.y=t.worldY,i):i} - _updateAndApplyState(t){ - this.hasNeverUpdated=!1,this.state.update(t),this.skeleton.update(t); - const{ - skeleton:i} - =this; - this.state.apply(i),this.beforeUpdateWorldTransforms(this),i.updateWorldTransform(hQ.update),this.afterUpdateWorldTransforms(this),this.updateSlotObjects(),this._stateChanged=!0,this.onViewUpdate()} - _validateAndTransformAttachments(){ - this._stateChanged&&(this._stateChanged=!1,this.validateAttachments(),this.transformAttachments())} - validateAttachments(){ - const t=this.skeleton.drawOrder,i=this._lastAttachments; - let s=0,e=!1; - for(let n=0; - n<t.length; - n++){ - const h=t[n].getAttachment(); - h&&(h!==i[s]&&(e=!0,i[s]=h),s++)} - s!==i.length&&(e=!0,i.length=s),this.spineAttachmentsDirty||(this.spineAttachmentsDirty=e)} - updateAndSetPixiMask(t,i){ - var s,e; - const n=t.attachment; - if(n&&n instanceof ZX){ - const i=(s=this.clippingSlotToPixiMasks)[e=t.data.name]||(s[e]={ - slot:t,vertices:new Array} - ); - return i.maskComputed=!1,void(this.currentClippingSlot=i)} - let h=this.currentClippingSlot,r=this._slotsObject[t.data.name]; - if(h&&r){ - let t=h.mask; - if(t||(t=t0.obtain(),h.mask=t,this.addChild(t)),!h.maskComputed){ - let i=h.slot,s=i.attachment; - h.maskComputed=!0; - const e=s.worldVerticesLength,n=h.vertices; - s.computeWorldVertices(i,0,e,n,0,2),t.clear().poly(n).stroke({ - width:0} - ).fill({ - alpha:.25} - )} - r.container.mask=t} - else(null==r?void 0:r.container.mask)&&(r.container.mask=null); - if(h&&h.slot.attachment.endSlot==t.data&&(this.currentClippingSlot=void 0),i){ - for(const t in this.clippingSlotToPixiMasks){ - const i=this.clippingSlotToPixiMasks[t]; - i.slot.attachment instanceof ZX&&i.maskComputed||!i.mask||(this.removeChild(i.mask),t0.free(i.mask),i.mask=void 0)} - this.currentClippingSlot=void 0} - } - transformAttachments(){ - var t; - const i=this.skeleton.drawOrder; - for(let s=0; - s<i.length; - s++){ - const e=i[s]; - this.updateAndSetPixiMask(e,s===i.length-1); - const n=e.getAttachment(); - if(n)if(n instanceof mJ||n instanceof EJ){ - const i=this._getCachedData(e,n); - n instanceof EJ?n.computeWorldVertices(e,i.vertices,0,2):n.computeWorldVertices(e,0,n.worldVerticesLength,i.vertices,0,2),i.uvs.length<n.uvs.length&&(i.uvs=new Float32Array(n.uvs.length)),Ta(n.uvs.buffer,i.uvs.buffer); - const s=e.bone.skeleton.color,h=e.color,r=n.color,o=s.a*h.a*r.a; - if(i.color.set(s.r*h.r*r.r,s.g*h.g*r.g,s.b*h.b*r.b,o),0===this.alpha||0===o)i.skipRender||(this.spineAttachmentsDirty=!0),i.skipRender=!0; - else{ - i.skipRender&&(this.spineAttachmentsDirty=!0),i.skipRender=i.clipped=!1,e.darkColor&&i.darkColor.setFromColor(e.darkColor); - const s=(null==(t=n.region)?void 0:t.texture.texture)||ls.EMPTY; - i.texture!==s&&(i.texture=s,this.spineTexturesDirty=!0),ZZ.isClipping()&&this.updateClippingData(i)} - } - else if(n instanceof ZX){ - ZZ.clipStart(e,n); - continue} - ZZ.clipEndWithSlot(e)} - ZZ.clipEnd()} - updateClippingData(t){ - t.clipped=!0,ZZ.clipTrianglesUnpacked(t.vertices,t.indices,t.indices.length,t.uvs); - const{ - clippedVertices:i,clippedUVs:s,clippedTriangles:e} - =ZZ,n=i.length/2,h=e.length; - t.clippedData||(t.clippedData={ - vertices:new Float32Array(2*n),uvs:new Float32Array(2*n),vertexCount:n,indices:new Uint16Array(h),indicesCount:h} - ,this.spineAttachmentsDirty=!0); - const r=t.clippedData,o=r.vertexCount!==n||h!==r.indicesCount; - t.skipRender=0===n,o&&(this.spineAttachmentsDirty=!0,r.vertexCount<n&&(r.vertices=new Float32Array(2*n),r.uvs=new Float32Array(2*n)),r.indices.length<h&&(r.indices=new Uint16Array(h))); - const{ - vertices:a,uvs:c,indices:l} - =r; - for(let u=0; - u<n; - u++)a[2*u]=i[2*u],a[2*u+1]=i[2*u+1],c[2*u]=s[2*u],c[2*u+1]=s[2*u+1]; - r.vertexCount=n; - for(let u=0; - u<h; - u++)l[u]!==e[u]&&(this.spineAttachmentsDirty=!0,l[u]=e[u]); - r.indicesCount=h} - updateSlotObjects(){ - for(const t in this._slotsObject){ - const i=this._slotsObject[t]; - i&&this.updateSlotObject(i)} - } - updateSlotObject(t){ - const{ - slot:i,container:s} - =t,e=!t.followAttachmentTimeline||Boolean(i.attachment); - if(s.visible=this.skeleton.drawOrder.includes(i)&&e,s.visible){ - let t=i.bone; - const e=s.localTransform; - e.a=t.a,e.b=t.c,e.c=-t.b,e.d=-t.d,e.tx=t.worldX,e.ty=t.worldY,s.setFromMatrix(e),s.alpha=this.skeleton.color.a*i.color.a} - } - _getCachedData(t,i){ - return this.attachmentCacheData[t.data.index][i.name]||this.initCachedData(t,i)} - initCachedData(t,i){ - var s,e; - let n; - return i instanceof EJ?(n=new Float32Array(8),this.attachmentCacheData[t.data.index][i.name]={ - id:`${ - t.data.index} - -${ - i.name} - `,vertices:n,clipped:!1,indices:[0,1,2,0,2,3],uvs:new Float32Array(i.uvs.length),color:new BY(1,1,1,1),darkColor:new BY(0,0,0,0),darkTint:this.darkTint,skipRender:!1,texture:null==(s=i.region)?void 0:s.texture.texture} - ):(n=new Float32Array(i.worldVerticesLength),this.attachmentCacheData[t.data.index][i.name]={ - id:`${ - t.data.index} - -${ - i.name} - `,vertices:n,clipped:!1,indices:i.triangles,uvs:new Float32Array(i.uvs.length),color:new BY(1,1,1,1),darkColor:new BY(0,0,0,0),darkTint:this.darkTint,skipRender:!1,texture:null==(e=i.region)?void 0:e.texture.texture} - ),this.attachmentCacheData[t.data.index][i.name]} - onViewUpdate(){ - var t; - if(this._didViewChangeTick++,this._boundsProvider||(this._boundsDirty=!0),this.didViewUpdate)return; - this.didViewUpdate=!0; - const i=this.renderGroup||this.parentRenderGroup; - i&&i.onChildViewUpdate(this),null==(t=this.debug)||t.renderDebug(this)} - addSlotObject(t,i,s){ - var e; - t=this.getSlotFromRef(t); - for(const h in this._slotsObject)(null==(e=this._slotsObject[h])?void 0:e.container)===i&&this.removeSlotObject(this._slotsObject[h].slot); - this.removeSlotObject(t),i.includeInBuild=!1,this.addChild(i); - const n={ - container:i,slot:t,followAttachmentTimeline:(null==s?void 0:s.followAttachmentTimeline)||!1} - ; - this._slotsObject[t.data.name]=n,this.updateSlotObject(n)} - removeSlotObject(t){ - var i,s; - let e; - if(t instanceof Ke){ - for(const n in this._slotsObject)if((null==(i=this._slotsObject[n])?void 0:i.container)===t){ - this._slotsObject[n]=null,e=t; - break} - } - else{ - const i=this.getSlotFromRef(t); - e=null==(s=this._slotsObject[i.data.name])?void 0:s.container,this._slotsObject[i.data.name]=null} - e&&(this.removeChild(e),e.includeInBuild=!0)} - removeSlotObjects(){ - Object.entries(this._slotsObject).forEach(([t,i])=>{ - i&&i.container.removeFromParent(),delete this._slotsObject[t]} - )} - getSlotObject(t){ - var i; - return t=this.getSlotFromRef(t),null==(i=this._slotsObject[t.data.name])?void 0:i.container} - updateBounds(){ - this._boundsDirty=!1,this.skeletonBounds||(this.skeletonBounds=new dZ); - const t=this.skeletonBounds; - if(t.update(this.skeleton,!0),this._boundsProvider){ - const t=this._boundsProvider.calculateBounds(this),i=this._bounds; - i.clear(),i.x=t.x,i.y=t.y,i.width=t.width,i.height=t.height} - else if(t.minX===1/0){ - this.hasNeverUpdated&&(this._updateAndApplyState(0),this._boundsDirty=!1),this._validateAndTransformAttachments(); - const t=this.skeleton.drawOrder,i=this._bounds; - i.clear(); - for(let s=0; - s<t.length; - s++){ - const e=t[s],n=e.getAttachment(); - if(n&&(n instanceof EJ||n instanceof mJ)){ - const t=this._getCachedData(e,n); - i.addVertexData(t.vertices,0,t.vertices.length)} - } - } - else this._bounds.minX=t.minX,this._bounds.minY=t.minY,this._bounds.maxX=t.maxX,this._bounds.maxY=t.maxY} - addBounds(t){ - t.addBounds(this.bounds)} - destroy(t=!1){ - super.destroy(t),this._ticker.remove(this.internalUpdate,this),this._ticker=null,this.state.clearListeners(),this.debug=void 0,this.skeleton=null,this.state=null,this._slotsObject=null,this._lastAttachments.length=0,this.attachmentCacheData=null} - skeletonToPixiWorldCoordinates(t){ - this.worldTransform.apply(t,t)} - pixiWorldCoordinatesToSkeleton(t){ - this.worldTransform.applyInverse(t,t)} - pixiWorldCoordinatesToBone(t,i){ - this.pixiWorldCoordinatesToSkeleton(t),i.parent?i.parent.worldToLocal(t):i.worldToLocal(t)} - static from({ - skeleton:i,atlas:s,scale:e=1,darkTint:n,autoUpdate:h=!0,boundsProvider:r,ticker:o} - ){ - const a=`${ - i} - -${ - s} - -${ - e} - `; - if(Tn.has(a))return new t({ - skeletonData:Tn.get(a),darkTint:n,autoUpdate:h,boundsProvider:r,ticker:o} - ); - const c=wd.get(i),l=wd.get(s),u=new SJ(l),d=c instanceof Uint8Array?new yQ(u):new vZ(u); - d.scale=e; - const f=d.readSkeletonData(c); - return Tn.set(a,f),new t({ - skeletonData:f,darkTint:n,autoUpdate:h,boundsProvider:r,ticker:o} - )} - } - ; - Qt(i0,"Spine"); - let s0=i0;
FrameLoopManager 4 hunks, 3203 statements
- var t,i,s,e,n,h,r,o,a,c,l,u,d,f,p,w,g,m,v,_,M,b,y,E,A,S,T,C,O,I,k,x,R,P,N,L,D,G,B,U,F,$,H,W,V,j,K,z,Y,q,X,J,Q,Z,tt,it,st,et,nt,ht,rt,ot,at,ct,lt,ut,dt,ft,pt,wt,gt,mt,vt,_t,Mt,bt,yt,Et,At,St,Tt,Ct,Ot,It,kt,xt,Rt,Pt,Nt,Lt,Dt,Gt,Bt,Ut,Ft,$t,Ht,Wt,Vt,jt,Kt,zt,Yt,qt,Xt,Jt=Object.defineProperty,Qt=(t,i)=>Jt(t,"name",{ + const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./chunks/vendor-misc.js","./chunks/vendor-pixi.js","./chunks/vendor-firebase.js","./chunks/index.js","./chunks/vendor-gsap.js","./chunks/vendor-spine.js","./chunks/AttendanceAutoTrigger.js","./chunks/GuildWarBattlePopupV3.js","./chunks/GuildWarSeason3Board.js","./chunks/GuildWarBoard.js","./chunks/GuildWarBattleReadyPopup.js","./chunks/GuildBarrackRowItemRenderer.js","./chunks/GuildWarSquadsPopup.js","./chunks/GuildWarTierAssignPopup.js","./chunks/TossBridge.js","./chunks/CapacitorBridge.js","./chunks/PlayGamesManager.js","./chunks/AppSig.js","./chunks/SoulRestEndConfirmPopup.js","./chunks/AppsFlyerManager.js","./chunks/GameSpeedBuffPopup.js","./chunks/ShopProductResultPopup.js","./chunks/AnalyticsManager.js","./chunks/TransConfirmPopup.js","./chunks/PetCoupleTreasurePopup.js","./chunks/FavoritePetSelectPopup.js","./chunks/EventHubPopup.js","./chunks/AttendEventPopup.js","./chunks/WaveCallGuidePopup.js","./chunks/CardEventLobbyPopup.js","./chunks/MiniAscentAssets.js","./chunks/MiniAscentFlow.js","./chunks/miniAscentPveText.js","./chunks/ConquestPopup.js","./chunks/ArcheryGamePopup.js","./chunks/GuildRaidOpenSettingsPopup.js","./chunks/FriendPopup.js","./chunks/SoulRestSkipConfirmPopup.js","./chunks/ReviveTreasurePopup.js","./chunks/OfflineCountdown.js","./chunks/StoreReviewManager.js","./chunks/ProfileDecoPopup.js","./chunks/StampCalendarPopup.js","./chunks/StampDayCell.js","./chunks/CapacitorLoginPopup.js","./chunks/MobileBackButtonManager.js","./chunks/OfflinePopup.js","./chunks/LocalPushManager.js","./chunks/CapacitorLoginPopup2.js"])))=>i.map(i=>d[i]); + + var t,s,i,h=Object.defineProperty,e=(t,s)=>h(t,"name",{
- function ti(t,i){ - for(var s=0; - s<i.length; - s++){ - const e=i[s]; - if("string"!=typeof e&&!Array.isArray(e))for(const i in e)if("default"!==i&&!(i in t)){ - const s=Object.getOwnPropertyDescriptor(e,i); - s&&Object.defineProperty(t,i,s.get?s:{ - enumerable:!0,get:Qt(()=>e[i],"get")} - )} + import{ + _ as o,A as r,I as a,t as l,X as c,w as u,W as d,T as _,Z as f,v as p,P as M,J as g,y as E,$ as w,z as m,N as A,x as T,q as b,F as S,a0 as I,a1 as O,Y as v,a2 as C,M as R} + from"./chunks/vendor-pixi.js"; + import{ + j as y,m as N,q as k,t as G,O as L,T as D,r as P,C as x} + from"./chunks/vendor-misc.js"; + import{ + g as B} + from"./chunks/vendor-gsap.js"; + import{ + S as U} + from"./chunks/vendor-spine.js"; + import"./chunks/vendor-firebase.js"; + function H(t,s,i){ + return t&&t.wave&&void 0!==t.numRevive?t.numRevive!==s?"clearStale":"restoreLocal":i?"restoreServer":"none"} + function $(t){ + if(t)return{ + gameOver:!0,gameOverWave:t.wave,...void 0!==t.numRevive?{ + gameOverNumRevive:t.numRevive} + :{
- return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{ - value:"Module"} - ))} - Qt(ti,"_mergeNamespaces"),Qt(function(){ + } + } + e(function(){
- ,"polyfill")(); - const ii=Qt(function(t){ - return"/"+t} - ,"assetsURL"),si={ - } - ,ei=Qt(function(t,i,s){ - let e=Promise.resolve(); - if(i&&i.length>0){ - document.getElementsByTagName("link"); - const t=document.querySelector("meta[property=csp-nonce]"),s=(null==t?void 0:t.nonce)||(null==t?void 0:t.getAttribute("nonce")); - e=Promise.allSettled(i.map(t=>{ - if((t=ii(t))in si)return; - si[t]=!0; - const i=t.endsWith(".css"),e=i?'[rel="stylesheet"]':""; - if(document.querySelector(`link[href="${ - t} - "]${ - e} - `))return; - const n=document.createElement("link"); - return n.rel=i?"stylesheet":"modulepreload",i||(n.as="script"),n.crossOrigin="",n.href=t,s&&n.setAttribute("nonce",s),document.head.appendChild(n),i?new Promise((i,s)=>{ - n.addEventListener("load",i),n.addEventListener("error",()=>s(new Error(`Unable to preload CSS for ${ - t} - `)))} - ):void 0} - ))} - function n(t){ - const i=new Event("vite:preloadError",{ - cancelable:!0} - ); - if(i.payload=t,window.dispatchEvent(i),!i.defaultPrevented)throw t} - return Qt(n,"handlePreloadError"),e.then(i=>{ - for(const t of i||[])"rejected"===t.status&&n(t.reason); - return t().catch(n)} - )} - ,"preload"); - function ni(t,i,s){ - return t&&t.wave&&void 0!==t.numRevive?t.numRevive!==i?"clearStale":"restoreLocal":s?"restoreServer":"none"} - function hi(t){ - if(t)return{ - gameOver:!0,gameOverWave:t.wave,...void 0!==t.numRevive?{ - gameOverNumRevive:t.numRevive} - :{ - } - } - } - Qt(ni,"resolveBootGameOver"),Qt(hi,"gameOverInfoForServer"); - var ri=(t=>(t.Application="application",t.WebGLPipes="webgl-pipes",t.WebGLPipesAdaptor="webgl-pipes-adaptor",t.WebGLSystem="webgl-system",t.WebGPUPipes="webgpu-pipes",t.WebGPUPipesAdaptor="webgpu-pipes-adaptor",t.WebGPUSystem="webgpu-system",t.CanvasSystem="canvas-system",t.CanvasPipesAdaptor="canvas-pipes-adaptor",t.CanvasPipes="canvas-pipes",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t.MaskEffect="mask-effect",t.BlendMode="blend-mode",t.TextureSource="texture-source",t.Environment="environment",t.ShapeBuilder="shape-builder",t.Batcher="batcher",t))(ri||{ - } - ); - const oi=Qt(t=>{ - if("function"==typeof t||"object"==typeof t&&t.extension){ - if(!t.extension)throw new Error("Extension class must have an extension object"); - t={ - ..."object"!=typeof t.extension?{ - type:t.extension} - :t.extension,ref:t} - } - if("object"!=typeof t)throw new Error("Invalid extension type"); - return"string"==typeof(t={ - ...t} - ).type&&(t.type=[t.type]),t} - ,"normalizeExtension"),ai=Qt((t,i)=>oi(t).priority??i,"normalizeExtensionPriority"),ci={ - _addHandlers:{ - } - ,_removeHandlers:{ - } - ,_queue:{ - } - ,remove(...t){ - return t.map(oi).forEach(t=>{ - t.type.forEach(i=>{ - var s,e; - return null==(e=(s=this._removeHandlers)[i])?void 0:e.call(s,t)} - )} - ),this} - ,add(...t){ - return t.map(oi).forEach(t=>{ - t.type.forEach(i=>{ - var s,e; - const n=this._addHandlers,h=this._queue; - n[i]?null==(e=n[i])||e.call(n,t):(h[i]=h[i]||[],null==(s=h[i])||s.push(t))} - )} - ),this} - ,handle(t,i,s){ - var e; - const n=this._addHandlers,h=this._removeHandlers; - if(n[t]||h[t])throw new Error(`Extension type ${ - t} - already has a handler`); - n[t]=i,h[t]=s; - const r=this._queue; - return r[t]&&(null==(e=r[t])||e.forEach(t=>i(t)),delete r[t]),this} - ,handleByMap(t,i){ - return this.handle(t,t=>{ - t.name&&(i[t.name]=t.ref)} - ,t=>{ - t.name&&delete i[t.name]} - )} - ,handleByNamedList(t,i,s=-1){ - return this.handle(t,t=>{ - i.findIndex(i=>i.name===t.name)>=0||(i.push({ - name:t.name,value:t.ref} - ),i.sort((t,i)=>ai(i.value,s)-ai(t.value,s)))} - ,t=>{ - const s=i.findIndex(i=>i.name===t.name); - -1!==s&&i.splice(s,1)} - )} - ,handleByList(t,i,s=-1){ - return this.handle(t,t=>{ - i.includes(t.ref)||(i.push(t.ref),i.sort((t,i)=>ai(i,s)-ai(t,s)))} - ,t=>{ - const s=i.indexOf(t.ref); - -1!==s&&i.splice(s,1)} - )} - ,mixin(t,...i){ - for(const s of i)Object.defineProperties(t.prototype,Object.getOwnPropertyDescriptors(s))} - } - ,li={ - extension:{ - type:ri.Environment,name:"browser",priority:-1} - ,test:Qt(()=>!0,"test"),load:Qt(async()=>{ - await ei(()=>Promise.resolve().then(()=>Gpi),void 0)} - ,"load")} - ,ui={ - extension:{ - type:ri.Environment,name:"webworker",priority:0} - ,test:Qt(()=>"undefined"!=typeof self&&void 0!==self.WorkerGlobalScope,"test"),load:Qt(async()=>{ - await ei(()=>Promise.resolve().then(()=>Bpi),void 0)} - ,"load")} - ,di=class t{ - constructor(t,i,s){ - this._x=i||0,this._y=s||0,this._observer=t} - clone(i){ - return new t(i??this._observer,this._x,this._y)} - set(t=0,i=t){ - return this._x===t&&this._y===i||(this._x=t,this._y=i,this._observer._onUpdate(this)),this} - copyFrom(t){ - return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),this} - copyTo(t){ - return t.set(this._x,this._y),t} - equals(t){ - return t.x===this._x&&t.y===this._y} - toString(){ - return`[pixi.js/math:ObservablePoint x=${ - this._x} - y=${ - this._y} - scope=${ - this._observer} - ]`} - get x(){ - return this._x} - set x(t){ - this._x!==t&&(this._x=t,this._observer._onUpdate(this))} - get y(){ - return this._y} - set y(t){ - this._y!==t&&(this._y=t,this._observer._onUpdate(this))} - } - ; - Qt(di,"ObservablePoint"); - let fi=di; - var pi="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{ - } - ; - function wi(t){ - return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t} - function gi(t){ - if(t.__esModule)return t; - var i=t.default; - if("function"==typeof i){ - var s=Qt(function t(){ - return this instanceof t?Reflect.construct(i,arguments,this.constructor):i.apply(this,arguments)} - ,"a"); - s.prototype=i.prototype} - else s={ - } - ; - return Object.defineProperty(s,"__esModule",{ - value:!0} - ),Object.keys(t).forEach(function(i){ - var e=Object.getOwnPropertyDescriptor(t,i); - Object.defineProperty(s,i,e.get?e:{ - enumerable:!0,get:Qt(function(){ - return t[i]} - ,"get")} - )} - ),s} - Qt(wi,"getDefaultExportFromCjs"),Qt(gi,"getAugmentedNamespace$1"); - var mi={ - exports:{ - } - } - ; - !function(t){ - var i=Object.prototype.hasOwnProperty,s="~"; - function e(){ - } - function n(t,i,s){ - this.fn=t,this.context=i,this.once=s||!1} - function h(t,i,e,h,r){ - if("function"!=typeof e)throw new TypeError("The listener must be a function"); - var o=new n(e,h||t,r),a=s?s+i:i; - return t._events[a]?t._events[a].fn?t._events[a]=[t._events[a],o]:t._events[a].push(o):(t._events[a]=o,t._eventsCount++),t} - function r(t,i){ - 0===--t._eventsCount?t._events=new e:delete t._events[i]} - function o(){ - this._events=new e,this._eventsCount=0} - Qt(e,"Events"),Object.create&&(e.prototype=Object.create(null),(new e).__proto__||(s=!1)),Qt(n,"EE"),Qt(h,"addListener"),Qt(r,"clearEvent"),Qt(o,"EventEmitter"),o.prototype.eventNames=Qt(function(){ - var t,e,n=[]; - if(0===this._eventsCount)return n; - for(e in t=this._events)i.call(t,e)&&n.push(s?e.slice(1):e); - return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n} - ,"eventNames"),o.prototype.listeners=Qt(function(t){ - var i=s?s+t:t,e=this._events[i]; - if(!e)return[]; - if(e.fn)return[e.fn]; - for(var n=0,h=e.length,r=new Array(h); - n<h; - n++)r[n]=e[n].fn; - return r} - ,"listeners"),o.prototype.listenerCount=Qt(function(t){ - var i=s?s+t:t,e=this._events[i]; - return e?e.fn?1:e.length:0} - ,"listenerCount"),o.prototype.emit=Qt(function(t,i,e,n,h,r){ - var o=s?s+t:t; - if(!this._events[o])return!1; - var a,c,l=this._events[o],u=arguments.length; - if(l.fn){ - switch(l.once&&this.removeListener(t,l.fn,void 0,!0),u){ - case 1:return l.fn.call(l.context),!0; - case 2:return l.fn.call(l.context,i),!0; - case 3:return l.fn.call(l.context,i,e),!0; - case 4:return l.fn.call(l.context,i,e,n),!0; - case 5:return l.fn.call(l.context,i,e,n,h),!0; - case 6:return l.fn.call(l.context,i,e,n,h,r),!0} - for(c=1,a=new Array(u-1); - c<u; - c++)a[c-1]=arguments[c]; - l.fn.apply(l.context,a)} - else{ - var d,f=l.length; - for(c=0; - c<f; - c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),u){ - case 1:l[c].fn.call(l[c].context); - break; - case 2:l[c].fn.call(l[c].context,i); - break; - case 3:l[c].fn.call(l[c].context,i,e); - break; - case 4:l[c].fn.call(l[c].context,i,e,n); - break; - default:if(!a)for(d=1,a=new Array(u-1); - d<u; - d++)a[d-1]=arguments[d]; - l[c].fn.apply(l[c].context,a)} - } - return!0} - ,"emit"),o.prototype.on=Qt(function(t,i,s){ - return h(this,t,i,s,!1)} - ,"on"),o.prototype.once=Qt(function(t,i,s){ - return h(this,t,i,s,!0)} - ,"once"),o.prototype.removeListener=Qt(function(t,i,e,n){ - var h=s?s+t:t; - if(!this._events[h])return this; - if(!i)return r(this,h),this; - var o=this._events[h]; - if(o.fn)o.fn!==i||n&&!o.once||e&&o.context!==e||r(this,h); - else{ - for(var a=0,c=[],l=o.length; - a<l; - a++)(o[a].fn!==i||n&&!o[a].once||e&&o[a].context!==e)&&c.push(o[a]); - c.length?this._events[h]=1===c.length?c[0]:c:r(this,h)} - return this} - ,"removeListener"),o.prototype.removeAllListeners=Qt(function(t){ - var i; - return t?(i=s?s+t:t,this._events[i]&&r(this,i)):(this._events=new e,this._eventsCount=0),this} - ,"removeAllListeners"),o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=s,o.EventEmitter=o,t.exports=o} - (mi); - const vi=wi(mi.exports),_i=Object.freeze(Object.defineProperty({ - __proto__:null,EventEmitter:vi,default:vi} - ,Symbol.toStringTag,{ - value:"Module"} - )),Mi=2*Math.PI,bi=180/Math.PI,yi=Math.PI/180,Ei=class t{ - constructor(t=0,i=0){ - this.x=0,this.y=0,this.x=t,this.y=i} - clone(){ - return new t(this.x,this.y)} - copyFrom(t){ - return this.set(t.x,t.y),this} - copyTo(t){ - return t.set(this.x,this.y),t} - equals(t){ - return t.x===this.x&&t.y===this.y} - set(t=0,i=t){ - return this.x=t,this.y=i,this} - toString(){ - return`[pixi.js/math:Point x=${ - this.x} - y=${ - this.y} - ]`} - static get shared(){ - return Si.x=0,Si.y=0,Si} - } - ; - Qt(Ei,"Point"); - let Ai=Ei; - const Si=new Ai,Ti=class t{ - constructor(t=1,i=0,s=0,e=1,n=0,h=0){ - this.array=null,this.a=t,this.b=i,this.c=s,this.d=e,this.tx=n,this.ty=h} - fromArray(t){ - this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]} - set(t,i,s,e,n,h){ - return this.a=t,this.b=i,this.c=s,this.d=e,this.tx=n,this.ty=h,this} - toArray(t,i){ - this.array||(this.array=new Float32Array(9)); - const s=i||this.array; - return t?(s[0]=this.a,s[1]=this.b,s[2]=0,s[3]=this.c,s[4]=this.d,s[5]=0,s[6]=this.tx,s[7]=this.ty,s[8]=1):(s[0]=this.a,s[1]=this.c,s[2]=this.tx,s[3]=this.b,s[4]=this.d,s[5]=this.ty,s[6]=0,s[7]=0,s[8]=1),s} - apply(t,i){ - i=i||new Ai; - const s=t.x,e=t.y; - return i.x=this.a*s+this.c*e+this.tx,i.y=this.b*s+this.d*e+this.ty,i} - applyInverse(t,i){ - i=i||new Ai; - const s=this.a,e=this.b,n=this.c,h=this.d,r=this.tx,o=this.ty,a=1/(s*h+n*-e),c=t.x,l=t.y; - return i.x=h*a*c+-n*a*l+(o*n-r*h)*a,i.y=s*a*l+-e*a*c+(-o*s+r*e)*a,i} - translate(t,i){ - return this.tx+=t,this.ty+=i,this} - scale(t,i){ - return this.a*=t,this.d*=i,this.c*=t,this.b*=i,this.tx*=t,this.ty*=i,this} - rotate(t){ - const i=Math.cos(t),s=Math.sin(t),e=this.a,n=this.c,h=this.tx; - return this.a=e*i-this.b*s,this.b=e*s+this.b*i,this.c=n*i-this.d*s,this.d=n*s+this.d*i,this.tx=h*i-this.ty*s,this.ty=h*s+this.ty*i,this} - append(t){ - const i=this.a,s=this.b,e=this.c,n=this.d; - return this.a=t.a*i+t.b*e,this.b=t.a*s+t.b*n,this.c=t.c*i+t.d*e,this.d=t.c*s+t.d*n,this.tx=t.tx*i+t.ty*e+this.tx,this.ty=t.tx*s+t.ty*n+this.ty,this} - appendFrom(t,i){ - const s=t.a,e=t.b,n=t.c,h=t.d,r=t.tx,o=t.ty,a=i.a,c=i.b,l=i.c,u=i.d; - return this.a=s*a+e*l,this.b=s*c+e*u,this.c=n*a+h*l,this.d=n*c+h*u,this.tx=r*a+o*l+i.tx,this.ty=r*c+o*u+i.ty,this} - setTransform(t,i,s,e,n,h,r,o,a){ - return this.a=Math.cos(r+a)*n,this.b=Math.sin(r+a)*n,this.c=-Math.sin(r-o)*h,this.d=Math.cos(r-o)*h,this.tx=t-(s*this.a+e*this.c),this.ty=i-(s*this.b+e*this.d),this} - prepend(t){ - const i=this.tx; - if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){ - const i=this.a,s=this.c; - this.a=i*t.a+this.b*t.c,this.b=i*t.b+this.b*t.d,this.c=s*t.a+this.d*t.c,this.d=s*t.b+this.d*t.d} - return this.tx=i*t.a+this.ty*t.c+t.tx,this.ty=i*t.b+this.ty*t.d+t.ty,this} - decompose(t){ - const i=this.a,s=this.b,e=this.c,n=this.d,h=t.pivot,r=-Math.atan2(-e,n),o=Math.atan2(s,i),a=Math.abs(r+o); - return a<1e-5||Math.abs(Mi-a)<1e-5?(t.rotation=o,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=r,t.skew.y=o),t.scale.x=Math.sqrt(i*i+s*s),t.scale.y=Math.sqrt(e*e+n*n),t.position.x=this.tx+(h.x*i+h.y*e),t.position.y=this.ty+(h.x*s+h.y*n),t} - invert(){ - const t=this.a,i=this.b,s=this.c,e=this.d,n=this.tx,h=t*e-i*s; - return this.a=e/h,this.b=-i/h,this.c=-s/h,this.d=t/h,this.tx=(s*this.ty-e*n)/h,this.ty=-(t*this.ty-i*n)/h,this} - isIdentity(){ - return 1===this.a&&0===this.b&&0===this.c&&1===this.d&&0===this.tx&&0===this.ty} - identity(){ - return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this} - clone(){ - const i=new t; - return i.a=this.a,i.b=this.b,i.c=this.c,i.d=this.d,i.tx=this.tx,i.ty=this.ty,i} - copyTo(t){ - return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t} - copyFrom(t){ - return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this} - equals(t){ - return t.a===this.a&&t.b===this.b&&t.c===this.c&&t.d===this.d&&t.tx===this.tx&&t.ty===this.ty} - toString(){ - return`[pixi.js:Matrix a=${ - this.a} - b=${ - this.b} - c=${ - this.c} - d=${ - this.d} - tx=${ - this.tx} - ty=${ - this.ty} - ]`} - static get IDENTITY(){ - return Ii.identity()} - static get shared(){ - return Oi.identity()} - } - ; - Qt(Ti,"Matrix"); - let Ci=Ti; - const Oi=new Ci,Ii=new Ci,ki=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],xi=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Ri=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Pi=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Ni=[],Li=[],Di=Math.sign; - function Gi(){ - for(let t=0; - t<16; - t++){ - const i=[]; - Ni.push(i); - for(let s=0; - s<16; - s++){ - const e=Di(ki[t]*ki[s]+Ri[t]*xi[s]),n=Di(xi[t]*ki[s]+Pi[t]*xi[s]),h=Di(ki[t]*Ri[s]+Ri[t]*Pi[s]),r=Di(xi[t]*Ri[s]+Pi[t]*Pi[s]); - for(let t=0; - t<16; - t++)if(ki[t]===e&&xi[t]===n&&Ri[t]===h&&Pi[t]===r){ - i.push(t); - break} - } - } - for(let t=0; - t<16; - t++){ - const i=new Ci; - i.set(ki[t],xi[t],Ri[t],Pi[t],0,0),Li.push(i)} - } - Qt(Gi,"init$1"),Gi(); - const Bi={ - E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:Qt(t=>ki[t],"uX"),uY:Qt(t=>xi[t],"uY"),vX:Qt(t=>Ri[t],"vX"),vY:Qt(t=>Pi[t],"vY"),inv:Qt(t=>8&t?15&t:7&-t,"inv"),add:Qt((t,i)=>Ni[t][i],"add"),sub:Qt((t,i)=>Ni[t][Bi.inv(i)],"sub"),rotate180:Qt(t=>4^t,"rotate180"),isVertical:Qt(t=>2==(3&t),"isVertical"),byDirection:Qt((t,i)=>2*Math.abs(t)<=Math.abs(i)?i>=0?Bi.S:Bi.N:2*Math.abs(i)<=Math.abs(t)?t>0?Bi.E:Bi.W:i>0?t>0?Bi.SE:Bi.SW:t>0?Bi.NE:Bi.NW,"byDirection"),matrixAppendRotationInv:Qt((t,i,s=0,e=0,n=0,h=0)=>{ - const r=Li[Bi.inv(i)],o=r.a,a=r.b,c=r.c,l=r.d,u=s-Math.min(0,o*n,c*h,o*n+c*h),d=e-Math.min(0,a*n,l*h,a*n+l*h),f=t.a,p=t.b,w=t.c,g=t.d; - t.a=o*f+a*w,t.b=o*p+a*g,t.c=c*f+l*w,t.d=c*p+l*g,t.tx=u*f+d*w+t.tx,t.ty=u*p+d*g+t.ty} - ,"matrixAppendRotationInv"),transformRectCoords:Qt((t,i,s,e)=>{ - const{ - x:n,y:h,width:r,height:o} - =t,{ - x:a,y:c,width:l,height:u} - =i; - return s===Bi.E?(e.set(n+a,h+c,r,o),e):s===Bi.S?e.set(l-h-o+a,n+c,o,r):s===Bi.W?e.set(l-n-r+a,u-h-o+c,r,o):s===Bi.N?e.set(h+a,u-n-r+c,o,r):e.set(n+a,h+c,r,o)} - ,"transformRectCoords")} - ,Ui=[new Ai,new Ai,new Ai,new Ai],Fi=class t{ - constructor(t=0,i=0,s=0,e=0){ - this.type="rectangle",this.x=Number(t),this.y=Number(i),this.width=Number(s),this.height=Number(e)} - get left(){ - return this.x} - get right(){ - return this.x+this.width} - get top(){ - return this.y} - get bottom(){ - return this.y+this.height} - isEmpty(){ - return this.left===this.right||this.top===this.bottom} - static get EMPTY(){ - return new t(0,0,0,0)} - clone(){ - return new t(this.x,this.y,this.width,this.height)} - copyFromBounds(t){ - return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this} - copyFrom(t){ - return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this} - copyTo(t){ - return t.copyFrom(this),t} - contains(t,i){ - return!(this.width<=0||this.height<=0)&&t>=this.x&&t<this.x+this.width&&i>=this.y&&i<this.y+this.height} - strokeContains(t,i,s,e=.5){ - const{ - width:n,height:h} - =this; - if(n<=0||h<=0)return!1; - const r=this.x,o=this.y,a=s*(1-e),c=s-a; - return t>=r-a&&t<=r+n+a&&i>=o-a&&i<=o+h+a&&!(t>r+c&&t<r+n-c&&i>o+c&&i<o+h-c)} - intersects(t,i){ - if(!i){ - const i=this.x<t.x?t.x:this.x; - if((this.right>t.right?t.right:this.right)<=i)return!1; - const s=this.y<t.y?t.y:this.y; - return(this.bottom>t.bottom?t.bottom:this.bottom)>s} - const s=this.left,e=this.right,n=this.top,h=this.bottom; - if(e<=s||h<=n)return!1; - const r=Ui[0].set(t.left,t.top),o=Ui[1].set(t.left,t.bottom),a=Ui[2].set(t.right,t.top),c=Ui[3].set(t.right,t.bottom); - if(a.x<=r.x||o.y<=r.y)return!1; - const l=Math.sign(i.a*i.d-i.b*i.c); - if(0===l)return!1; - if(i.apply(r,r),i.apply(o,o),i.apply(a,a),i.apply(c,c),Math.max(r.x,o.x,a.x,c.x)<=s||Math.min(r.x,o.x,a.x,c.x)>=e||Math.max(r.y,o.y,a.y,c.y)<=n||Math.min(r.y,o.y,a.y,c.y)>=h)return!1; - const u=l*(o.y-r.y),d=l*(r.x-o.x),f=u*s+d*n,p=u*e+d*n,w=u*s+d*h,g=u*e+d*h; - if(Math.max(f,p,w,g)<=u*r.x+d*r.y||Math.min(f,p,w,g)>=u*c.x+d*c.y)return!1; - const m=l*(r.y-a.y),v=l*(a.x-r.x),_=m*s+v*n,M=m*e+v*n,b=m*s+v*h,y=m*e+v*h; - return!(Math.max(_,M,b,y)<=m*r.x+v*r.y||Math.min(_,M,b,y)>=m*c.x+v*c.y)} - pad(t=0,i=t){ - return this.x-=t,this.y-=i,this.width+=2*t,this.height+=2*i,this} - fit(t){ - const i=Math.max(this.x,t.x),s=Math.min(this.x+this.width,t.x+t.width),e=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height); - return this.x=i,this.width=Math.max(s-i,0),this.y=e,this.height=Math.max(n-e,0),this} - ceil(t=1,i=.001){ - const s=Math.ceil((this.x+this.width-i)*t)/t,e=Math.ceil((this.y+this.height-i)*t)/t; - return this.x=Math.floor((this.x+i)*t)/t,this.y=Math.floor((this.y+i)*t)/t,this.width=s-this.x,this.height=e-this.y,this} - scale(t,i=t){ - return this.x*=t,this.y*=i,this.width*=t,this.height*=i,this} - enlarge(t){ - const i=Math.min(this.x,t.x),s=Math.max(this.x+this.width,t.x+t.width),e=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height); - return this.x=i,this.width=s-i,this.y=e,this.height=n-e,this} - getBounds(i){ - return i||(i=new t),i.copyFrom(this),i} - containsRect(t){ - if(this.width<=0||this.height<=0)return!1; - const i=t.x,s=t.y,e=t.x+t.width,n=t.y+t.height; - return i>=this.x&&i<this.x+this.width&&s>=this.y&&s<this.y+this.height&&e>=this.x&&e<this.x+this.width&&n>=this.y&&n<this.y+this.height} - set(t,i,s,e){ - return this.x=t,this.y=i,this.width=s,this.height=e,this} - toString(){ - return`[pixi.js/math:Rectangle x=${ - this.x} - y=${ - this.y} - width=${ - this.width} - height=${ - this.height} - ]`} - } - ; - Qt(Fi,"Rectangle"); - let $i=Fi; - const Hi={ - default:-1} - ; - function Wi(t="default"){ - return void 0===Hi[t]&&(Hi[t]=-1),++Hi[t]} - Qt(Wi,"uid$1"); - const Vi=new Set,ji="8.0.0",Ki="8.3.4",zi={ - quiet:!1,noColor:!1} - ,Yi=Qt((t,i,s=3)=>{ - if(zi.quiet||Vi.has(i))return; - let e=(new Error).stack; - "function"==typeof console.groupCollapsed&&zi.noColor,void 0===e||(e=e.split("\n").splice(s).join("\n")),Vi.add(i)} - ,"deprecation"); - Object.defineProperties(Yi,{ - quiet:{ - get:Qt(()=>zi.quiet,"get"),set:Qt(t=>{ - zi.quiet=t} - ,"set"),enumerable:!0,configurable:!1} - ,noColor:{ - get:Qt(()=>zi.noColor,"get"),set:Qt(t=>{ - zi.noColor=t} - ,"set"),enumerable:!0,configurable:!1} - } - ); - const qi=Qt(()=>{ - } - ,"NOOP"); - function Xi(t){ - return t+=0===t?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)} - function Ji(t){ - return!(t&t-1||!t)} - function Qi(t){ - const i={ - } - ; - for(const s in t)void 0!==t[s]&&(i[s]=t[s]); - return i} - Qt(Xi,"nextPow2"),Qt(Ji,"isPow2"),Qt(Qi,"definedProps"); - const Zi=Object.create(null); - function ts(t){ - const i=Zi[t]; - return void 0===i&&(Zi[t]=Wi("resource")),i} - Qt(ts,"createResourceIdFromString"); - const is=(Qt(t=class extends vi{ - constructor(i={ - } - ){ - super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,i={ - ...t.defaultOptions,...i} - ,this.addressMode=i.addressMode,this.addressModeU=i.addressModeU??this.addressModeU,this.addressModeV=i.addressModeV??this.addressModeV,this.addressModeW=i.addressModeW??this.addressModeW,this.scaleMode=i.scaleMode,this.magFilter=i.magFilter??this.magFilter,this.minFilter=i.minFilter??this.minFilter,this.mipmapFilter=i.mipmapFilter??this.mipmapFilter,this.lodMinClamp=i.lodMinClamp,this.lodMaxClamp=i.lodMaxClamp,this.compare=i.compare,this.maxAnisotropy=i.maxAnisotropy??1} - set addressMode(t){ - this.addressModeU=t,this.addressModeV=t,this.addressModeW=t} - get addressMode(){ - return this.addressModeU} - set wrapMode(t){ - Yi(ji,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=t} - get wrapMode(){ - return this.addressMode} - set scaleMode(t){ - this.magFilter=t,this.minFilter=t,this.mipmapFilter=t} - get scaleMode(){ - return this.magFilter} - set maxAnisotropy(t){ - this._maxAnisotropy=Math.min(t,16),this._maxAnisotropy>1&&(this.scaleMode="linear")} - get maxAnisotropy(){ - return this._maxAnisotropy} - get _resourceId(){ - return this._sharedResourceId||this._generateResourceId()} - update(){ - this._sharedResourceId=null,this.emit("change",this)} - _generateResourceId(){ - const t=`${ - this.addressModeU} - -${ - this.addressModeV} - -${ - this.addressModeW} - -${ - this.magFilter} - -${ - this.minFilter} - -${ - this.mipmapFilter} - -${ - this.lodMinClamp} - -${ - this.lodMaxClamp} - -${ - this.compare} - -${ - this._maxAnisotropy} - `; - return this._sharedResourceId=ts(t),this._resourceId} - destroy(){ - this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()} - } - ,"_TextureStyle"),t); - is.defaultOptions={ - addressMode:"clamp-to-edge",scaleMode:"linear"} - ; - let ss=is; - const es=(Qt(i=class extends vi{ - constructor(t={ - } - ){ - super(),this.options=t,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=Wi("textureSource"),this._resourceType="textureSource",this._resourceId=Wi("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.viewDimension="2d",this.arrayLayerCount=1,this.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,t={ - ...i.defaultOptions,...t} - ,this.label=t.label??"",this.resource=t.resource,this.autoGarbageCollect=t.autoGarbageCollect,this._resolution=t.resolution,t.width?this.pixelWidth=t.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,t.height?this.pixelHeight=t.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=t.format,this.dimension=t.dimensions,this.viewDimension=t.viewDimension??t.dimensions,this.arrayLayerCount=t.arrayLayerCount,this.mipLevelCount=t.mipLevelCount,this.autoGenerateMipmaps=t.autoGenerateMipmaps,this.sampleCount=t.sampleCount,this.antialias=t.antialias,this.alphaMode=t.alphaMode,this.style=new ss(Qi(t)),this.destroyed=!1,this._refreshPOT()} - get source(){ - return this} - get style(){ - return this._style} - set style(t){ - var i,s; - this.style!==t&&(null==(i=this._style)||i.off("change",this._onStyleChange,this),this._style=t,null==(s=this._style)||s.on("change",this._onStyleChange,this),this._onStyleChange())} - set maxAnisotropy(t){ - this._style.maxAnisotropy=t} - get maxAnisotropy(){ - return this._style.maxAnisotropy} - get addressMode(){ - return this._style.addressMode} - set addressMode(t){ - this._style.addressMode=t} - get repeatMode(){ - return this._style.addressMode} - set repeatMode(t){ - this._style.addressMode=t} - get magFilter(){ - return this._style.magFilter} - set magFilter(t){ - this._style.magFilter=t} - get minFilter(){ - return this._style.minFilter} - set minFilter(t){ - this._style.minFilter=t} - get mipmapFilter(){ - return this._style.mipmapFilter} - set mipmapFilter(t){ - this._style.mipmapFilter=t} - get lodMinClamp(){ - return this._style.lodMinClamp} - set lodMinClamp(t){ - this._style.lodMinClamp=t} - get lodMaxClamp(){ - return this._style.lodMaxClamp} - set lodMaxClamp(t){ - this._style.lodMaxClamp=t} - _onStyleChange(){ - this.emit("styleChange",this)} - update(){ - if(this.resource){ - const t=this._resolution; - if(this.resize(this.resourceWidth/t,this.resourceHeight/t))return} - this.emit("update",this)} - destroy(){ - this.destroyed=!0,this.unload(),this.emit("destroy",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()} - unload(){ - var t,i; - this._resourceId=Wi("resource"),this.emit("change",this),this.emit("unload",this); - for(const s in this._gpuData)null==(i=null==(t=this._gpuData[s])?void 0:t.destroy)||i.call(t); - this._gpuData=Object.create(null)} - get resourceWidth(){ - const{ - resource:t} - =this; - return t.naturalWidth||t.videoWidth||t.displayWidth||t.width} - get resourceHeight(){ - const{ - resource:t} - =this; - return t.naturalHeight||t.videoHeight||t.displayHeight||t.height} - get resolution(){ - return this._resolution} - set resolution(t){ - this._resolution!==t&&(this._resolution=t,this.width=this.pixelWidth/t,this.height=this.pixelHeight/t)} - resize(t,i,s){ - s||(s=this._resolution),t||(t=this.width),i||(i=this.height); - const e=Math.round(t*s),n=Math.round(i*s); - return this.width=e/s,this.height=n/s,this._resolution=s,(this.pixelWidth!==e||this.pixelHeight!==n)&&(this._refreshPOT(),this.pixelWidth=e,this.pixelHeight=n,this.emit("resize",this),this._resourceId=Wi("resource"),this.emit("change",this),!0)} - updateMipmaps(){ - this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)} - set wrapMode(t){ - this._style.wrapMode=t} - get wrapMode(){ - return this._style.wrapMode} - set scaleMode(t){ - this._style.scaleMode=t} - get scaleMode(){ - return this._style.scaleMode} - _refreshPOT(){ - this.isPowerOfTwo=Ji(this.pixelWidth)&&Ji(this.pixelHeight)} - static test(t){ - throw new Error("Unimplemented")} - } - ,"_TextureSource"),i); - es.defaultOptions={ - resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",viewDimension:"2d",arrayLayerCount:1,mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1} - ; - let ns=es; - const hs=class extends ns{ - constructor(t){ - const i=t.resource||new Float32Array(t.width*t.height*4); - let s=t.format; - s||(s=i instanceof Float32Array?"rgba32float":i instanceof Int32Array||i instanceof Uint32Array?"rgba32uint":i instanceof Int16Array||i instanceof Uint16Array?"rgba16uint":(Int8Array,"bgra8unorm")),super({ - ...t,resource:i,format:s} - ),this.uploadMethodId="buffer"} - static test(t){ - return t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array} - } - ; - Qt(hs,"BufferImageSource"); - let rs=hs; - rs.extension=ri.TextureSource; - const os=new Ci,as=class{ - constructor(t,i){ - this.mapCoord=new Ci,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===i?t.width<10?0:.5:i,this.isSimple=!1,this.texture=t} - get texture(){ - return this._texture} - set texture(t){ - var i; - this.texture!==t&&(null==(i=this._texture)||i.removeListener("update",this.update,this),this._texture=t,this._texture.addListener("update",this.update,this),this.update())} - multiplyUvs(t,i){ - void 0===i&&(i=t); - const s=this.mapCoord; - for(let e=0; - e<t.length; - e+=2){ - const n=t[e],h=t[e+1]; - i[e]=n*s.a+h*s.c+s.tx,i[e+1]=n*s.b+h*s.d+s.ty} - return i} - update(){ - const t=this._texture; - this._updateID++; - const i=t.uvs; - this.mapCoord.set(i.x1-i.x0,i.y1-i.y0,i.x3-i.x0,i.y3-i.y0,i.x0,i.y0); - const s=t.orig,e=t.trim; - e&&(os.set(s.width/e.width,0,0,s.height/e.height,-e.x/e.width,-e.y/e.height),this.mapCoord.append(os)); - const n=t.source,h=this.uClampFrame,r=this.clampMargin/n._resolution,o=this.clampOffset/n._resolution; - return h[0]=(t.frame.x+r+o)/n.width,h[1]=(t.frame.y+r+o)/n.height,h[2]=(t.frame.x+t.frame.width-r+o)/n.width,h[3]=(t.frame.y+t.frame.height-r+o)/n.height,this.uClampOffset[0]=this.clampOffset/n.pixelWidth,this.uClampOffset[1]=this.clampOffset/n.pixelHeight,this.isSimple=t.frame.width===n.width&&t.frame.height===n.height&&0===t.rotate,!0} - } - ; - Qt(as,"TextureMatrix"); - let cs=as,ls=(Qt(s=class extends vi{ - constructor({ - source:t,label:i,frame:s,orig:e,trim:n,defaultAnchor:h,defaultBorders:r,rotate:o,dynamic:a} - ={ - } - ){ - if(super(),this.uid=Wi("texture"),this.uvs={ - x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0} - ,this.frame=new $i,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=i,this.source=(null==t?void 0:t.source)??new ns,this.noFrame=!s,s)this.frame.copyFrom(s); - else{ - const{ - width:t,height:i} - =this._source; - this.frame.width=t,this.frame.height=i} - this.orig=e||this.frame,this.trim=n,this.rotate=o??0,this.defaultAnchor=h,this.defaultBorders=r,this.destroyed=!1,this.dynamic=a||!1,this.updateUvs()} - set source(t){ - this._source&&this._source.off("resize",this.update,this),this._source=t,t.on("resize",this.update,this),this.emit("update",this)} - get source(){ - return this._source} - get textureMatrix(){ - return this._textureMatrix||(this._textureMatrix=new cs(this)),this._textureMatrix} - get width(){ - return this.orig.width} - get height(){ - return this.orig.height} - updateUvs(){ - const{ - uvs:t,frame:i} - =this,{ - width:s,height:e} - =this._source,n=i.x/s,h=i.y/e,r=i.width/s,o=i.height/e; - let a=this.rotate; - if(a){ - const i=r/2,s=o/2,e=n+i,c=h+s; - a=Bi.add(a,Bi.NW),t.x0=e+i*Bi.uX(a),t.y0=c+s*Bi.uY(a),a=Bi.add(a,2),t.x1=e+i*Bi.uX(a),t.y1=c+s*Bi.uY(a),a=Bi.add(a,2),t.x2=e+i*Bi.uX(a),t.y2=c+s*Bi.uY(a),a=Bi.add(a,2),t.x3=e+i*Bi.uX(a),t.y3=c+s*Bi.uY(a)} - else t.x0=n,t.y0=h,t.x1=n+r,t.y1=h,t.x2=n+r,t.y2=h+o,t.x3=n,t.y3=h+o} - destroy(t=!1){ - this._source&&(this._source.off("resize",this.update,this),t&&(this._source.destroy(),this._source=null)),this._textureMatrix=null,this.destroyed=!0,this.emit("destroy",this),this.removeAllListeners()} - update(){ - this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this)} - get baseTexture(){ - return Yi(ji,"Texture.baseTexture is now Texture.source"),this._source} - } - ,"Texture"),s); - function us(t,i,s){ - const{ - width:e,height:n} - =s.orig,h=s.trim; - if(h){ - const s=h.width,r=h.height; - t.minX=h.x-i._x*e,t.maxX=t.minX+s,t.minY=h.y-i._y*n,t.maxY=t.minY+r} - else t.minX=-i._x*e,t.maxX=t.minX+e,t.minY=-i._y*n,t.maxY=t.minY+n} - ls.EMPTY=new ls({ - label:"EMPTY",source:new ns({ - label:"EMPTY"} - )} - ),ls.EMPTY.destroy=qi,ls.WHITE=new ls({ - source:new rs({ - resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"} - ),label:"WHITE"} - ),ls.WHITE.destroy=qi,Qt(us,"updateQuadBounds"); - const ds=new Ci,fs=class t{ - constructor(t=1/0,i=1/0,s=-1/0,e=-1/0){ - this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=ds,this.minX=t,this.minY=i,this.maxX=s,this.maxY=e} - isEmpty(){ - return this.minX>this.maxX||this.minY>this.maxY} - get rectangle(){ - this._rectangle||(this._rectangle=new $i); - const t=this._rectangle; - return this.minX>this.maxX||this.minY>this.maxY?(t.x=0,t.y=0,t.width=0,t.height=0):t.copyFromBounds(this),t} - clear(){ - return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=ds,this} - set(t,i,s,e){ - this.minX=t,this.minY=i,this.maxX=s,this.maxY=e} - addFrame(t,i,s,e,n){ - n||(n=this.matrix); - const h=n.a,r=n.b,o=n.c,a=n.d,c=n.tx,l=n.ty; - let u=this.minX,d=this.minY,f=this.maxX,p=this.maxY,w=h*t+o*i+c,g=r*t+a*i+l; - w<u&&(u=w),g<d&&(d=g),w>f&&(f=w),g>p&&(p=g),w=h*s+o*i+c,g=r*s+a*i+l,w<u&&(u=w),g<d&&(d=g),w>f&&(f=w),g>p&&(p=g),w=h*t+o*e+c,g=r*t+a*e+l,w<u&&(u=w),g<d&&(d=g),w>f&&(f=w),g>p&&(p=g),w=h*s+o*e+c,g=r*s+a*e+l,w<u&&(u=w),g<d&&(d=g),w>f&&(f=w),g>p&&(p=g),this.minX=u,this.minY=d,this.maxX=f,this.maxY=p} - addRect(t,i){ - this.addFrame(t.x,t.y,t.x+t.width,t.y+t.height,i)} - addBounds(t,i){ - this.addFrame(t.minX,t.minY,t.maxX,t.maxY,i)} - addBoundsMask(t){ - this.minX=this.minX>t.minX?this.minX:t.minX,this.minY=this.minY>t.minY?this.minY:t.minY,this.maxX=this.maxX<t.maxX?this.maxX:t.maxX,this.maxY=this.maxY<t.maxY?this.maxY:t.maxY} - applyMatrix(t){ - const i=this.minX,s=this.minY,e=this.maxX,n=this.maxY,{ - a:h,b:r,c:o,d:a,tx:c,ty:l} - =t; - let u=h*i+o*s+c,d=r*i+a*s+l; - this.minX=u,this.minY=d,this.maxX=u,this.maxY=d,u=h*e+o*s+c,d=r*e+a*s+l,this.minX=u<this.minX?u:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=u>this.maxX?u:this.maxX,this.maxY=d>this.maxY?d:this.maxY,u=h*i+o*n+c,d=r*i+a*n+l,this.minX=u<this.minX?u:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=u>this.maxX?u:this.maxX,this.maxY=d>this.maxY?d:this.maxY,u=h*e+o*n+c,d=r*e+a*n+l,this.minX=u<this.minX?u:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=u>this.maxX?u:this.maxX,this.maxY=d>this.maxY?d:this.maxY} - fit(t){ - return this.minX<t.left&&(this.minX=t.left),this.maxX>t.right&&(this.maxX=t.right),this.minY<t.top&&(this.minY=t.top),this.maxY>t.bottom&&(this.maxY=t.bottom),this} - fitBounds(t,i,s,e){ - return this.minX<t&&(this.minX=t),this.maxX>i&&(this.maxX=i),this.minY<s&&(this.minY=s),this.maxY>e&&(this.maxY=e),this} - pad(t,i=t){ - return this.minX-=t,this.maxX+=t,this.minY-=i,this.maxY+=i,this} - ceil(){ - return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this} - clone(){ - return new t(this.minX,this.minY,this.maxX,this.maxY)} - scale(t,i=t){ - return this.minX*=t,this.minY*=i,this.maxX*=t,this.maxY*=i,this} - get x(){ - return this.minX} - set x(t){ - const i=this.maxX-this.minX; - this.minX=t,this.maxX=t+i} - get y(){ - return this.minY} - set y(t){ - const i=this.maxY-this.minY; - this.minY=t,this.maxY=t+i} - get width(){ - return this.maxX-this.minX} - set width(t){ - this.maxX=this.minX+t} - get height(){ - return this.maxY-this.minY} - set height(t){ - this.maxY=this.minY+t} - get left(){ - return this.minX} - get right(){ - return this.maxX} - get top(){ - return this.minY} - get bottom(){ - return this.maxY} - get isPositive(){ - return this.maxX-this.minX>0&&this.maxY-this.minY>0} - get isValid(){ - return this.minX+this.minY!==1/0} - addVertexData(t,i,s,e){ - let n=this.minX,h=this.minY,r=this.maxX,o=this.maxY; - e||(e=this.matrix); - const a=e.a,c=e.b,l=e.c,u=e.d,d=e.tx,f=e.ty; - for(let p=i; - p<s; - p+=2){ - const i=t[p],s=t[p+1],e=a*i+l*s+d,w=c*i+u*s+f; - n=e<n?e:n,h=w<h?w:h,r=e>r?e:r,o=w>o?w:o} - this.minX=n,this.minY=h,this.maxX=r,this.maxY=o} - containsPoint(t,i){ - return this.minX<=t&&this.minY<=i&&this.maxX>=t&&this.maxY>=i} - toString(){ - return`[pixi.js:Bounds minX=${ - this.minX} - minY=${ - this.minY} - maxX=${ - this.maxX} - maxY=${ - this.maxY} - width=${ - this.width} - height=${ - this.height} - ]`} - copyFrom(t){ - return this.minX=t.minX,this.minY=t.minY,this.maxX=t.maxX,this.maxY=t.maxY,this} - } - ; - Qt(fs,"Bounds"); - let ps=fs; - var ws={ - grad:.9,turn:360,rad:360/(2*Math.PI)} - ,gs=Qt(function(t){ - return"string"==typeof t?t.length>0:"number"==typeof t} - ,"t$2"),ms=Qt(function(t,i,s){ - return void 0===i&&(i=0),void 0===s&&(s=Math.pow(10,i)),Math.round(s*t)/s+0} - ,"n$1"),vs=Qt(function(t,i,s){ - return void 0===i&&(i=0),void 0===s&&(s=1),t>s?s:t>i?t:i} - ,"e$2"),_s=Qt(function(t){ - return(t=isFinite(t)?t%360:0)>0?t:t+360} - ,"u$2"),Ms=Qt(function(t){ - return{ - r:vs(t.r,0,255),g:vs(t.g,0,255),b:vs(t.b,0,255),a:vs(t.a)} - } - ,"a$1"),bs=Qt(function(t){ - return{ - r:ms(t.r),g:ms(t.g),b:ms(t.b),a:ms(t.a,3)} - } - ,"o$1"),ys=/^#([0-9a-f]{ - 3,8} - )$/i,Es=Qt(function(t){ - var i=t.toString(16); - return i.length<2?"0"+i:i} - ,"s$1"),As=Qt(function(t){ - var i=t.r,s=t.g,e=t.b,n=t.a,h=Math.max(i,s,e),r=h-Math.min(i,s,e),o=r?h===i?(s-e)/r:h===s?2+(e-i)/r:4+(i-s)/r:0; - return{ - h:60*(o<0?o+6:o),s:h?r/h*100:0,v:h/255*100,a:n} - } - ,"h$2"),Ss=Qt(function(t){ - var i=t.h,s=t.s,e=t.v,n=t.a; - i=i/360*6,s/=100,e/=100; - var h=Math.floor(i),r=e*(1-s),o=e*(1-(i-h)*s),a=e*(1-(1-i+h)*s),c=h%6; - return{ - r:255*[e,o,r,r,a,e][c],g:255*[a,e,e,o,r,r][c],b:255*[r,r,a,e,e,o][c],a:n} - } - ,"b$1"),Ts=Qt(function(t){ - return{ - h:_s(t.h),s:vs(t.s,0,100),l:vs(t.l,0,100),a:vs(t.a)} - } - ,"g$1"),Cs=Qt(function(t){ - return{ - h:ms(t.h),s:ms(t.s),l:ms(t.l),a:ms(t.a,3)} - } - ,"d$1"),Os=Qt(function(t){ - return Ss((s=(i=t).s,{ - h:i.h,s:(s*=((e=i.l)<50?e:100-e)/100)>0?2*s/(e+s)*100:0,v:e+s,a:i.a} - )); - var i,s,e} - ,"f$1"),Is=Qt(function(t){ - return{ - h:(i=As(t)).h,s:(n=(200-(s=i.s))*(e=i.v)/100)>0&&n<200?s*e/100/(n<=100?n:200-n)*100:0,l:n/2,a:i.a} - ; - var i,s,e,n} - ,"c$2"),ks=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,xs=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Rs=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ps=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ns={ - string:[[function(t){ - var i=ys.exec(t); - return i?(t=i[1]).length<=4?{ - r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:4===t.length?ms(parseInt(t[3]+t[3],16)/255,2):1} - :6===t.length||8===t.length?{ - r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:8===t.length?ms(parseInt(t.substr(6,2),16)/255,2):1} - :null:null} - ,"hex"],[function(t){ - var i=Rs.exec(t)||Ps.exec(t); - return i?i[2]!==i[4]||i[4]!==i[6]?null:Ms({ - r:Number(i[1])/(i[2]?100/255:1),g:Number(i[3])/(i[4]?100/255:1),b:Number(i[5])/(i[6]?100/255:1),a:void 0===i[7]?1:Number(i[7])/(i[8]?100:1)} - ):null} - ,"rgb"],[function(t){ - var i=ks.exec(t)||xs.exec(t); - if(!i)return null; - var s,e,n=Ts({ - h:(s=i[1],e=i[2],void 0===e&&(e="deg"),Number(s)*(ws[e]||1)),s:Number(i[3]),l:Number(i[4]),a:void 0===i[5]?1:Number(i[5])/(i[6]?100:1)} - ); - return Os(n)} - ,"hsl"]],object:[[function(t){ - var i=t.r,s=t.g,e=t.b,n=t.a,h=void 0===n?1:n; - return gs(i)&&gs(s)&&gs(e)?Ms({ - r:Number(i),g:Number(s),b:Number(e),a:Number(h)} - ):null} - ,"rgb"],[function(t){ - var i=t.h,s=t.s,e=t.l,n=t.a,h=void 0===n?1:n; - if(!gs(i)||!gs(s)||!gs(e))return null; - var r=Ts({ - h:Number(i),s:Number(s),l:Number(e),a:Number(h)} - ); - return Os(r)} - ,"hsl"],[function(t){ - var i=t.h,s=t.s,e=t.v,n=t.a,h=void 0===n?1:n; - if(!gs(i)||!gs(s)||!gs(e))return null; - var r,o=(r={ - h:Number(i),s:Number(s),v:Number(e),a:Number(h)} - ,{ - h:_s(r.h),s:vs(r.s,0,100),v:vs(r.v,0,100),a:vs(r.a)} - ); - return Ss(o)} - ,"hsv"]]} - ,Ls=Qt(function(t,i){ - for(var s=0; - s<i.length; - s++){ - var e=i[s][0](t); - if(e)return[e,i[s][1]]} - return[null,void 0]} - ,"N$1"),Ds=Qt(function(t){ - return"string"==typeof t?Ls(t.trim(),Ns.string):"object"==typeof t&&null!==t?Ls(t,Ns.object):[null,void 0]} - ,"x$1"),Gs=Qt(function(t,i){ - var s=Is(t); - return{ - h:s.h,s:vs(s.s+100*i,0,100),l:s.l,a:s.a} - } - ,"M$1"),Bs=Qt(function(t){ - return(299*t.r+587*t.g+114*t.b)/1e3/255} - ,"H$1"),Us=Qt(function(t,i){ - var s=Is(t); - return{ - h:s.h,s:s.s,l:vs(s.l+100*i,0,100),a:s.a} - } - ,"$$1"),Fs=function(){ - function t(t){ - this.parsed=Ds(t)[0],this.rgba=this.parsed||{ - r:0,g:0,b:0,a:1} - } - return Qt(t,"r"),t.prototype.isValid=function(){ - return null!==this.parsed} - ,t.prototype.brightness=function(){ - return ms(Bs(this.rgba),2)} - ,t.prototype.isDark=function(){ - return Bs(this.rgba)<.5} - ,t.prototype.isLight=function(){ - return Bs(this.rgba)>=.5} - ,t.prototype.toHex=function(){ - return i=(t=bs(this.rgba)).r,s=t.g,e=t.b,h=(n=t.a)<1?Es(ms(255*n)):"","#"+Es(i)+Es(s)+Es(e)+h; - var t,i,s,e,n,h} - ,t.prototype.toRgb=function(){ - return bs(this.rgba)} - ,t.prototype.toRgbString=function(){ - return i=(t=bs(this.rgba)).r,s=t.g,e=t.b,(n=t.a)<1?"rgba("+i+", "+s+", "+e+", "+n+")":"rgb("+i+", "+s+", "+e+")"; - var t,i,s,e,n} - ,t.prototype.toHsl=function(){ - return Cs(Is(this.rgba))} - ,t.prototype.toHslString=function(){ - return i=(t=Cs(Is(this.rgba))).h,s=t.s,e=t.l,(n=t.a)<1?"hsla("+i+", "+s+"%, "+e+"%, "+n+")":"hsl("+i+", "+s+"%, "+e+"%)"; - var t,i,s,e,n} - ,t.prototype.toHsv=function(){ - return t=As(this.rgba),{ - h:ms(t.h),s:ms(t.s),v:ms(t.v),a:ms(t.a,3)} - ; - var t} - ,t.prototype.invert=function(){ - return $s({ - r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a} - ); - var t} - ,t.prototype.saturate=function(t){ - return void 0===t&&(t=.1),$s(Gs(this.rgba,t))} - ,t.prototype.desaturate=function(t){ - return void 0===t&&(t=.1),$s(Gs(this.rgba,-t))} - ,t.prototype.grayscale=function(){ - return $s(Gs(this.rgba,-1))} - ,t.prototype.lighten=function(t){ - return void 0===t&&(t=.1),$s(Us(this.rgba,t))} - ,t.prototype.darken=function(t){ - return void 0===t&&(t=.1),$s(Us(this.rgba,-t))} - ,t.prototype.rotate=function(t){ - return void 0===t&&(t=15),this.hue(this.hue()+t)} - ,t.prototype.alpha=function(t){ - return"number"==typeof t?$s({ - r:(i=this.rgba).r,g:i.g,b:i.b,a:t} - ):ms(this.rgba.a,3); - var i} - ,t.prototype.hue=function(t){ - var i=Is(this.rgba); - return"number"==typeof t?$s({ - h:t,s:i.s,l:i.l,a:i.a} - ):ms(i.h)} - ,t.prototype.isEqual=function(t){ - return this.toHex()===$s(t).toHex()} - ,t} - (),$s=Qt(function(t){ - return t instanceof Fs?t:new Fs(t)} - ,"w$1"),Hs=[],Ws=Qt(function(t){ - t.forEach(function(t){ - Hs.indexOf(t)<0&&(t(Fs,Ns),Hs.push(t))} - )} - ,"k$1"); - function Vs(t,i){ - var s={ - white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"} - ,e={ - } - ; - for(var n in s)e[s[n]]=n; - var h={ - } - ; - t.prototype.toName=function(i){ - if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent"; - var n,r,o=e[this.toHex()]; - if(o)return o; - if(null==i?void 0:i.closest){ - var a=this.toRgb(),c=1/0,l="black"; - if(!h.length)for(var u in s)h[u]=new t(s[u]).toRgb(); - for(var d in s){ - var f=(n=a,r=h[d],Math.pow(n.r-r.r,2)+Math.pow(n.g-r.g,2)+Math.pow(n.b-r.b,2)); - f<c&&(c=f,l=d)} - return l} - } - ,i.string.push([function(i){ - var e=i.toLowerCase(),n="transparent"===e?"#0000":s[e]; - return n?new t(n).toRgb():null} - ,"name"])} - Qt(Vs,"namesPlugin"),Ws([Vs]); - const js=(Qt(e=class{ - constructor(t=16777215){ - this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t} - get red(){ - return this._components[0]} - get green(){ - return this._components[1]} - get blue(){ - return this._components[2]} - get alpha(){ - return this._components[3]} - setValue(t){ - return this.value=t,this} - set value(t){ - if(t instanceof e)this._value=this._cloneSource(t._value),this._int=t._int,this._components.set(t._components); - else{ - if(null===t)throw new Error("Cannot set Color#value to null"); - null!==this._value&&this._isSourceEqual(this._value,t)||(this._value=this._cloneSource(t),this._normalize(this._value))} - } - get value(){ - return this._value} - _cloneSource(t){ - return"string"==typeof t||"number"==typeof t||t instanceof Number||null===t?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):"object"==typeof t&&null!==t?{ - ...t} - :t} - _isSourceEqual(t,i){ - const s=typeof t; - if(s!==typeof i)return!1; - if("number"===s||"string"===s||t instanceof Number)return t===i; - if(Array.isArray(t)&&Array.isArray(i)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(i))return t.length===i.length&&t.every((t,s)=>t===i[s]); - if(null!==t&&null!==i){ - const s=Object.keys(t),e=Object.keys(i); - return s.length===e.length&&s.every(s=>t[s]===i[s])} - return t===i} - toRgba(){ - const[t,i,s,e]=this._components; - return{ - r:t,g:i,b:s,a:e} - } - toRgb(){ - const[t,i,s]=this._components; - return{ - r:t,g:i,b:s} - } - toRgbaString(){ - const[t,i,s]=this.toUint8RgbArray(); - return`rgba(${ - t} - ,${ - i} - ,${ - s} - ,${ - this.alpha} - )`} - toUint8RgbArray(t){ - const[i,s,e]=this._components; - return this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb),t[0]=Math.round(255*i),t[1]=Math.round(255*s),t[2]=Math.round(255*e),t} - toArray(t){ - this._arrayRgba||(this._arrayRgba=[]),t||(t=this._arrayRgba); - const[i,s,e,n]=this._components; - return t[0]=i,t[1]=s,t[2]=e,t[3]=n,t} - toRgbArray(t){ - this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb); - const[i,s,e]=this._components; - return t[0]=i,t[1]=s,t[2]=e,t} - toNumber(){ - return this._int} - toBgrNumber(){ - const[t,i,s]=this.toUint8RgbArray(); - return(s<<16)+(i<<8)+t} - toLittleEndianNumber(){ - const t=this._int; - return(t>>16)+(65280&t)+((255&t)<<16)} - multiply(t){ - const[i,s,n,h]=e._temp.setValue(t)._components; - return this._components[0]*=i,this._components[1]*=s,this._components[2]*=n,this._components[3]*=h,this._refreshInt(),this._value=null,this} - premultiply(t,i=!0){ - return i&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this._refreshInt(),this._value=null,this} - toPremultiplied(t,i=!0){ - if(1===t)return(255<<24)+this._int; - if(0===t)return i?0:this._int; - let s=this._int>>16&255,e=this._int>>8&255,n=255&this._int; - return i&&(s=s*t+.5|0,e=e*t+.5|0,n=n*t+.5|0),(255*t<<24)+(s<<16)+(e<<8)+n} - toHex(){ - const t=this._int.toString(16); - return`#${ - "000000".substring(0,6-t.length)+t} - `} - toHexa(){ - const t=Math.round(255*this._components[3]).toString(16); - return this.toHex()+"00".substring(0,2-t.length)+t} - setAlpha(t){ - return this._components[3]=this._clamp(t),this._value=null,this} - _normalize(t){ - let i,s,n,h; - if(("number"==typeof t||t instanceof Number)&&t>=0&&t<=16777215)i=(t>>16&255)/255,s=(t>>8&255)/255,n=(255&t)/255,h=1; - else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[i,s,n,h=1]=t; - else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[i,s,n,h=255]=t,i/=255,s/=255,n/=255,h/=255; - else if("string"==typeof t||"object"==typeof t){ - if("string"==typeof t){ - const i=e.HEX_PATTERN.exec(t); - i&&(t=`#${ - i[2]} - `)} - const r=$s(t); - r.isValid()&&(({ - r:i,g:s,b:n,a:h} - =r.rgba),i/=255,s/=255,n/=255)} - if(void 0===i)throw new Error(`Unable to convert color ${ - t} - `); - this._components[0]=i,this._components[1]=s,this._components[2]=n,this._components[3]=h,this._refreshInt()} - _refreshInt(){ - this._clamp(this._components); - const[t,i,s]=this._components; - this._int=(255*t<<16)+(255*i<<8)+(255*s|0)} - _clamp(t,i=0,s=1){ - return"number"==typeof t?Math.min(Math.max(t,i),s):(t.forEach((e,n)=>{ - t[n]=Math.min(Math.max(e,i),s)} - ),t)} - static isColorLike(t){ - return"number"==typeof t||"string"==typeof t||t instanceof Number||t instanceof e||Array.isArray(t)||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||void 0!==t.r&&void 0!==t.g&&void 0!==t.b||void 0!==t.r&&void 0!==t.g&&void 0!==t.b&&void 0!==t.a||void 0!==t.h&&void 0!==t.s&&void 0!==t.l||void 0!==t.h&&void 0!==t.s&&void 0!==t.l&&void 0!==t.a||void 0!==t.h&&void 0!==t.s&&void 0!==t.v||void 0!==t.h&&void 0!==t.s&&void 0!==t.v&&void 0!==t.a} - } - ,"_Color"),e); - js.shared=new js,js._temp=new js,js.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{ - 3} - ){ - 1,2} - ([a-f0-9]{ - 2} - )?)$/i; - let Ks=js; - const zs={ - cullArea:null,cullable:!1,cullableChildren:!0} - ; - let Ys=0; - function qs(...t){ - 500!==Ys&&Ys++} - Qt(qs,"warn"); - const Xs={ - _registeredResources:new Set,register(t){ - this._registeredResources.add(t)} - ,unregister(t){ - this._registeredResources.delete(t)} - ,release(){ - this._registeredResources.forEach(t=>t.clear())} - ,get registeredCount(){ - return this._registeredResources.size} - ,isRegistered(t){ - return this._registeredResources.has(t)} - ,reset(){ - this._registeredResources.clear()} - } - ; - let Js=(Qt(n=class{ - constructor(t,i){ - this._pool=[],this._count=0,this._index=0,this._classType=t,i&&this.prepopulate(i)} - prepopulate(t){ - for(let i=0; - i<t; - i++)this._pool[this._index++]=new this._classType; - this._count+=t} - get(t){ - var i; - let s; - return this._index>0?s=this._pool[--this._index]:(s=new this._classType,this._count++),null==(i=s.init)||i.call(s,t),s} - return(t){ - var i; - null==(i=t.reset)||i.call(t),this._pool[this._index++]=t} - get totalSize(){ - return this._count} - get totalFree(){ - return this._index} - get totalUsed(){ - return this._count-this._index} - clear(){ - if(this._pool.length>0&&this._pool[0].destroy)for(let t=0; - t<this._index; - t++)this._pool[t].destroy(); - this._pool.length=0,this._count=0,this._index=0} - } - ,"Pool"),n); - const Qs=class{ - constructor(){ - this._poolsByClass=new Map} - prepopulate(t,i){ - this.getPool(t).prepopulate(i)} - get(t,i){ - return this.getPool(t).get(i)} - return(t){ - this.getPool(t.constructor).return(t)} - getPool(t){ - return this._poolsByClass.has(t)||this._poolsByClass.set(t,new Js(t)),this._poolsByClass.get(t)} - stats(){ - const t={ - } - ; - return this._poolsByClass.forEach(i=>{ - const s=t[i._classType.name]?i._classType.name+i._classType.ID:i._classType.name; - t[s]={ - free:i.totalFree,used:i.totalUsed,size:i.totalSize} - } - ),t} - clear(){ - this._poolsByClass.forEach(t=>t.clear()),this._poolsByClass.clear()} - } - ; - Qt(Qs,"PoolGroupClass"); - let Zs=Qs; - const te=new Zs; - Xs.register(te); - const ie={ - get isCachedAsTexture(){ - var t; - return!!(null==(t=this.renderGroup)?void 0:t.isCachedAsTexture)} - ,cacheAsTexture(t){ - "boolean"==typeof t&&!1===t?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(!0===t?{ - } - :t))} - ,updateCacheTexture(){ - var t; - null==(t=this.renderGroup)||t.updateCacheTexture()} - ,get cacheAsBitmap(){ - return this.isCachedAsTexture} - ,set cacheAsBitmap(t){ - Yi("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(t)} - } - ; - function se(t,i,s){ - const e=t.length; - let n; - if(i>=e||0===s)return; - const h=e-(s=i+s>e?e-i:s); - for(n=i; - n<h; - ++n)t[n]=t[n+s]; - t.length=h} - Qt(se,"removeItems"); - const ee={ - allowChildren:!0,removeChildren(t=0,i){ - var s; - const e=i??this.children.length,n=e-t,h=[]; - if(n>0&&n<=e){ - for(let s=e-1; - s>=t; - s--){ - const t=this.children[s]; - t&&(h.push(t),t.parent=null)} - se(this.children,t,e); - const i=this.renderGroup||this.parentRenderGroup; - i&&i.removeChildren(h); - for(let t=0; - t<h.length; - ++t){ - const i=h[t]; - null==(s=i.parentRenderLayer)||s.detach(i),this.emit("childRemoved",i,this,t),h[t].emit("removed",this)} - return h.length>0&&this._didViewChangeTick++,h} - if(0===n&&0===this.children.length)return h; - throw new RangeError("removeChildren: numeric values are outside the acceptable range.")} - ,removeChildAt(t){ - const i=this.getChildAt(t); - return this.removeChild(i)} - ,getChildAt(t){ - if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${ - t} - ) does not exist.`); - return this.children[t]} - ,setChildIndex(t,i){ - if(i<0||i>=this.children.length)throw new Error(`The index ${ - i} - supplied is out of bounds ${ - this.children.length} - `); - this.getChildIndex(t),this.addChildAt(t,i)} - ,getChildIndex(t){ - const i=this.children.indexOf(t); - if(-1===i)throw new Error("The supplied Container must be a child of the caller"); - return i} - ,addChildAt(t,i){ - this.allowChildren||Yi(ji,"addChildAt: Only Containers will be allowed to add children in v8.0.0"); - const{ - children:s} - =this; - if(i<0||i>s.length)throw new Error(`${ - t} - addChildAt: The index ${ - i} - supplied is out of bounds ${ - s.length} - `); - const e=t.parent===this; - if(t.parent){ - const s=t.parent.children.indexOf(t); - if(e){ - if(s===i)return t; - t.parent.children.splice(s,1)} - else t.removeFromParent()} - i===s.length?s.push(t):s.splice(i,0,t),t.parent=this,t.didChange=!0,t._updateFlags=15; - const n=this.renderGroup||this.parentRenderGroup; - return n&&n.addChild(t),this.sortableChildren&&(this.sortDirty=!0),e||(this.emit("childAdded",t,this,i),t.emit("added",this)),t} - ,swapChildren(t,i){ - if(t===i)return; - const s=this.getChildIndex(t),e=this.getChildIndex(i); - this.children[s]=i,this.children[e]=t; - const n=this.renderGroup||this.parentRenderGroup; - n&&(n.structureDidChange=!0),this._didContainerChangeTick++} - ,removeFromParent(){ - var t; - null==(t=this.parent)||t.removeChild(this)} - ,reparentChild(...t){ - return 1===t.length?this.reparentChildAt(t[0],this.children.length):(t.forEach(t=>this.reparentChildAt(t,this.children.length)),t[0])} - ,reparentChildAt(t,i){ - if(t.parent===this)return this.setChildIndex(t,i),t; - const s=t.worldTransform.clone(); - t.removeFromParent(),this.addChildAt(t,i); - const e=this.worldTransform.clone(); - return e.invert(),s.prepend(e),t.setFromMatrix(s),t} - ,replaceChild(t,i){ - t.updateLocalTransform(),this.addChildAt(i,this.getChildIndex(t)),i.setFromMatrix(t.localTransform),i.updateLocalTransform(),this.removeChild(t)} - } - ,ne={ - collectRenderables(t,i,s){ - this.parentRenderLayer&&this.parentRenderLayer!==s||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(t,i,s):this.renderGroup?i.renderPipes.renderGroup.addRenderGroup(this.renderGroup,t):this.collectRenderablesWithEffects(t,i,s))} - ,collectRenderablesSimple(t,i,s){ - const e=this.children,n=e.length; - for(let h=0; - h<n; - h++)e[h].collectRenderables(t,i,s)} - ,collectRenderablesWithEffects(t,i,s){ - const{ - renderPipes:e} - =i; - for(let n=0; - n<this.effects.length; - n++){ - const i=this.effects[n]; - e[i.pipe].push(i,this,t)} - this.collectRenderablesSimple(t,i,s); - for(let n=this.effects.length-1; - n>=0; - n--){ - const i=this.effects[n]; - e[i.pipe].pop(i,this,t)} - } - } - ,he=class{ - constructor(){ - this.pipe="filter",this.priority=1} - destroy(){ - for(let t=0; - t<this.filters.length; - t++)this.filters[t].destroy(); - this.filters=null,this.filterArea=null} - } - ; - Qt(he,"FilterEffect"); - let re=he; - const oe=class{ - constructor(){ - this._effectClasses=[],this._tests=[],this._initialized=!1} - init(){ - this._initialized||(this._initialized=!0,this._effectClasses.forEach(t=>{ - this.add({ - test:t.test,maskClass:t} - )} - ))} - add(t){ - this._tests.push(t)} - getMaskEffect(t){ - this._initialized||this.init(); - for(let i=0; - i<this._tests.length; - i++){ - const s=this._tests[i]; - if(s.test(t))return te.get(s.maskClass,t)} - return t} - returnMaskEffect(t){ - te.return(t)} - } - ; - Qt(oe,"MaskEffectManagerClass"); - let ae=oe; - const ce=new ae; - ci.handleByList(ri.MaskEffect,ce._effectClasses); - const le={ - _maskEffect:null,_maskOptions:{ - inverse:!1} - ,_filterEffect:null,effects:[],_markStructureAsChanged(){ - const t=this.renderGroup||this.parentRenderGroup; - t&&(t.structureDidChange=!0)} - ,addEffect(t){ - -1===this.effects.indexOf(t)&&(this.effects.push(t),this.effects.sort((t,i)=>t.priority-i.priority),this._markStructureAsChanged(),this._updateIsSimple())} - ,removeEffect(t){ - const i=this.effects.indexOf(t); - -1!==i&&(this.effects.splice(i,1),this._markStructureAsChanged(),this._updateIsSimple())} - ,set mask(t){ - const i=this._maskEffect; - (null==i?void 0:i.mask)!==t&&(i&&(this.removeEffect(i),ce.returnMaskEffect(i),this._maskEffect=null),null!=t&&(this._maskEffect=ce.getMaskEffect(t),this.addEffect(this._maskEffect)))} - ,get mask(){ - var t; - return null==(t=this._maskEffect)?void 0:t.mask} - ,setMask(t){ - this._maskOptions={ - ...this._maskOptions,...t} - ,t.mask&&(this.mask=t.mask),this._markStructureAsChanged()} - ,set filters(t){ - var i; - !Array.isArray(t)&&t&&(t=[t]); - const s=this._filterEffect||(this._filterEffect=new re),e=(null==t?void 0:t.length)>0,n=e!==(null==(i=s.filters)?void 0:i.length)>0; - t=Array.isArray(t)?t.slice(0):t,s.filters=Object.freeze(t),n&&(e?this.addEffect(s):(this.removeEffect(s),s.filters=t??null))} - ,get filters(){ - var t; - return null==(t=this._filterEffect)?void 0:t.filters} - ,set filterArea(t){ - this._filterEffect||(this._filterEffect=new re),this._filterEffect.filterArea=t} - ,get filterArea(){ - var t; - return null==(t=this._filterEffect)?void 0:t.filterArea} - } - ,ue={ - label:null,get name(){ - return Yi(ji,"Container.name property has been removed, use Container.label instead"),this.label} - ,set name(t){ - Yi(ji,"Container.name property has been removed, use Container.label instead"),this.label=t} - ,getChildByName(t,i=!1){ - return this.getChildByLabel(t,i)} - ,getChildByLabel(t,i=!1){ - const s=this.children; - for(let e=0; - e<s.length; - e++){ - const i=s[e]; - if(i.label===t||t instanceof RegExp&&t.test(i.label))return i} - if(i)for(let e=0; - e<s.length; - e++){ - const i=s[e].getChildByLabel(t,!0); - if(i)return i} - return null} - ,getChildrenByLabel(t,i=!1,s=[]){ - const e=this.children; - for(let n=0; - n<e.length; - n++){ - const i=e[n]; - (i.label===t||t instanceof RegExp&&t.test(i.label))&&s.push(i)} - if(i)for(let n=0; - n<e.length; - n++)e[n].getChildrenByLabel(t,!0,s); - return s} - } - ,de=te.getPool(Ci),fe=te.getPool(ps),pe=new Ci,we={ - getFastGlobalBounds(t,i){ - i||(i=new ps),i.clear(),this._getGlobalBoundsRecursive(!!t,i,this.parentRenderLayer),i.isValid||i.set(0,0,0,0); - const s=this.renderGroup||this.parentRenderGroup; - return i.applyMatrix(s.worldTransform),i} - ,_getGlobalBoundsRecursive(t,i,s){ - let e=i; - if(t&&this.parentRenderLayer&&this.parentRenderLayer!==s)return; - if(7!==this.localDisplayStatus||!this.measurable)return; - const n=!!this.effects.length; - if((this.renderGroup||n)&&(e=fe.get().clear()),this.boundsArea)i.addRect(this.boundsArea,this.worldTransform); - else{ - if(this.renderPipeId){ - const t=this.bounds; - e.addFrame(t.minX,t.minY,t.maxX,t.maxY,this.groupTransform)} - const i=this.children; - for(let n=0; - n<i.length; - n++)i[n]._getGlobalBoundsRecursive(t,e,s)} - if(n){ - let t=!1; - const s=this.renderGroup||this.parentRenderGroup; - for(let i=0; - i<this.effects.length; - i++)this.effects[i].addBounds&&(t||(t=!0,e.applyMatrix(s.worldTransform)),this.effects[i].addBounds(e,!0)); - t&&e.applyMatrix(s.worldTransform.copyTo(pe).invert()),i.addBounds(e),fe.return(e)} - else this.renderGroup&&(i.addBounds(e,this.relativeGroupTransform),fe.return(e))} - } - ; - function ge(t,i,s){ - let e,n; - return s.clear(),t.parent?i?e=t.parent.worldTransform:(n=de.get().identity(),e=ve(t,n)):e=Ci.IDENTITY,me(t,s,e,i),n&&de.return(n),s.isValid||s.set(0,0,0,0),s} - function me(t,i,s,e){ - var n,h; - if(!t.visible||!t.measurable)return; - let r; - e?r=t.worldTransform:(t.updateLocalTransform(),r=de.get(),r.appendFrom(t.localTransform,s)); - const o=i,a=!!t.effects.length; - if(a&&(i=fe.get().clear()),t.boundsArea)i.addRect(t.boundsArea,r); - else{ - const s=t.bounds; - s&&!s.isEmpty()&&(i.matrix=r,i.addBounds(s)); - for(let n=0; - n<t.children.length; - n++)me(t.children[n],i,r,e)} - if(a){ - for(let s=0; - s<t.effects.length; - s++)null==(h=(n=t.effects[s]).addBounds)||h.call(n,i); - o.addBounds(i,Ci.IDENTITY),fe.return(i)} - e||de.return(r)} - function ve(t,i){ - const s=t.parent; - return s&&(ve(s,i),s.updateLocalTransform(),i.append(s.localTransform)),i} - function _e(t,i){ - return 16777215!==t&&i?16777215!==i&&t?((t>>16&255)*(i>>16&255)/255<<16)+((t>>8&255)*(i>>8&255)/255<<8)+((255&t)*(255&i)/255|0):t:i} - Qt(ge,"getGlobalBounds"),Qt(me,"_getGlobalBounds"),Qt(ve,"updateTransformBackwards"),Qt(_e,"multiplyHexColors"); - const Me=16777215; - function be(t,i){ - return t===Me?i:i===Me?t:_e(t,i)} - function ye(t){ - return((255&t)<<16)+(65280&t)+(t>>16&255)} - Qt(be,"multiplyColors"),Qt(ye,"bgr2rgb"); - const Ee={ - getGlobalAlpha(t){ - if(t)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha; - let i=this.alpha,s=this.parent; - for(; - s; - )i*=s.alpha,s=s.parent; - return i} - ,getGlobalTransform(t=new Ci,i){ - if(i)return t.copyFrom(this.worldTransform); - this.updateLocalTransform(); - const s=ve(this,de.get().identity()); - return t.appendFrom(this.localTransform,s),de.return(s),t} - ,getGlobalTint(t){ - if(t)return this.renderGroup?ye(this.renderGroup.worldColor):this.parentRenderGroup?ye(be(this.localColor,this.parentRenderGroup.worldColor)):this.tint; - let i=this.localColor,s=this.parent; - for(; - s; - )i=be(i,s.localColor),s=s.parent; - return ye(i)} - } - ; - function Ae(t,i,s){ - return i.clear(),s||(s=Ci.IDENTITY),Se(t,i,s,t,!0),i.isValid||i.set(0,0,0,0),i} - function Se(t,i,s,e,n){ - var h,r; - let o; - if(n)o=de.get(),o=s.copyTo(o); - else{ - if(!t.visible||!t.measurable)return; - t.updateLocalTransform(); - const i=t.localTransform; - o=de.get(),o.appendFrom(i,s)} - const a=i,c=!!t.effects.length; - if(c&&(i=fe.get().clear()),t.boundsArea)i.addRect(t.boundsArea,o); - else{ - t.renderPipeId&&(i.matrix=o,i.addBounds(t.bounds)); - const s=t.children; - for(let t=0; - t<s.length; - t++)Se(s[t],i,o,e,!1)} - if(c){ - for(let s=0; - s<t.effects.length; - s++)null==(r=(h=t.effects[s]).addLocalBounds)||r.call(h,i,e); - a.addBounds(i,Ci.IDENTITY),fe.return(i)} - de.return(o)} - function Te(t,i){ - const s=t.children; - for(let e=0; - e<s.length; - e++){ - const t=s[e],n=t.uid,h=(65535&t._didViewChangeTick)<<16|65535&t._didContainerChangeTick,r=i.index; - i.data[r]===n&&i.data[r+1]===h||(i.data[i.index]=n,i.data[i.index+1]=h,i.didChange=!0),i.index=r+2,t.children.length&&Te(t,i)} - return i.didChange} - Qt(Ae,"getLocalBounds"),Qt(Se,"_getLocalBounds"),Qt(Te,"checkChildrenDidChange"); - const Ce=new Ci,Oe={ - _localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(t,i){ - const s=Math.sign(this.scale.x)||1; - this.scale.x=0!==i?t/i*s:s} - ,_setHeight(t,i){ - const s=Math.sign(this.scale.y)||1; - this.scale.y=0!==i?t/i*s:s} - ,getLocalBounds(){ - this._localBoundsCacheData||(this._localBoundsCacheData={ - data:[],index:1,didChange:!1,localBounds:new ps} - ); - const t=this._localBoundsCacheData; - return t.index=1,t.didChange=!1,t.data[0]!==this._didViewChangeTick&&(t.didChange=!0,t.data[0]=this._didViewChangeTick),Te(this,t),t.didChange&&Ae(this,t.localBounds,Ce),t.localBounds} - ,getBounds(t,i){ - return ge(this,t,i||new ps)} - } - ,Ie={ - _onRender:null,set onRender(t){ - const i=this.renderGroup||this.parentRenderGroup; - if(!t)return this._onRender&&(null==i||i.removeOnRender(this)),void(this._onRender=null); - this._onRender||null==i||i.addOnRender(this),this._onRender=t} - ,get onRender(){ - return this._onRender} - } - ,ke={ - _zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){ - return this._zIndex} - ,set zIndex(t){ - this._zIndex!==t&&(this._zIndex=t,this.depthOfChildModified())} - ,depthOfChildModified(){ - this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0)} - ,sortChildren(){ - this.sortDirty&&(this.sortDirty=!1,this.children.sort(xe))} - } - ; - function xe(t,i){ - return t._zIndex-i._zIndex} - Qt(xe,"sortChildren"); - const Re={ - getGlobalPosition(t=new Ai,i=!1){ - return this.parent?this.parent.toGlobal(this._position,t,i):(t.x=this._position.x,t.y=this._position.y),t} - ,toGlobal(t,i,s=!1){ - const e=this.getGlobalTransform(de.get(),s); - return i=e.apply(t,i),de.return(e),i} - ,toLocal(t,i,s,e){ - i&&(t=i.toGlobal(t,s,e)); - const n=this.getGlobalTransform(de.get(),e); - return s=n.applyInverse(t,s),de.return(n),s} - } - ,Pe=class{ - constructor(){ - this.uid=Wi("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0} - reset(){ - this.instructionSize=0} - destroy(){ - this.instructions.length=0,this.renderables.length=0,this.renderPipes=null,this.gcTick=0} - add(t){ - this.instructions[this.instructionSize++]=t} - log(){ - this.instructions.length=this.instructionSize} - } - ; - Qt(Pe,"InstructionSet"); - let Ne=Pe,Le=0; - const De=class{ - constructor(t){ - this._poolKeyHash=Object.create(null),this._texturePool={ - } - ,this.textureOptions=t||{ - } - ,this.enableFullScreen=!1,this.textureStyle=new ss(this.textureOptions)} - createTexture(t,i,s,e){ - const n=new ns({ - ...this.textureOptions,width:t,height:i,resolution:1,antialias:s,autoGarbageCollect:!1,autoGenerateMipmaps:e} - ); - return new ls({ - source:n,label:"texturePool_"+Le++} - )} - getOptimalTexture(t,i,s=1,e,n=!1){ - let h=Math.ceil(t*s-1e-6),r=Math.ceil(i*s-1e-6); - h=Xi(h),r=Xi(r); - const o=(h<<17)+(r<<2)+((n?1:0)<<1)+(e?1:0); - this._texturePool[o]||(this._texturePool[o]=[]); - let a=this._texturePool[o].pop(); - return a||(a=this.createTexture(h,r,e,n)),a.source._resolution=s,a.source.width=h/s,a.source.height=r/s,a.source.pixelWidth=h,a.source.pixelHeight=r,a.frame.x=0,a.frame.y=0,a.frame.width=t,a.frame.height=i,a.updateUvs(),this._poolKeyHash[a.uid]=o,a} - getSameSizeTexture(t,i=!1){ - const s=t.source; - return this.getOptimalTexture(t.width,t.height,s._resolution,i)} - returnTexture(t,i=!1){ - const s=this._poolKeyHash[t.uid]; - i&&(t.source.style=this.textureStyle),this._texturePool[s].push(t)} - clear(t){ - if(t=!1!==t)for(const i in this._texturePool){ - const t=this._texturePool[i]; - if(t)for(let i=0; - i<t.length; - i++)t[i].destroy(!0)} - this._texturePool={ - } - } - } - ; - Qt(De,"TexturePoolClass"); - let Ge=De; - const Be=new Ge; - Xs.register(Be); - const Ue=class{ - constructor(){ - this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new Ci,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.gcTick=0,this.childrenRenderablesToUpdate={ - list:[],index:0} - ,this.structureDidChange=!0,this.instructionSet=new Ne,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7} - init(t){ - this.root=t,t._onRender&&this.addOnRender(t),t.didChange=!0; - const i=t.children; - for(let s=0; - s<i.length; - s++){ - const t=i[s]; - t._updateFlags=15,this.addChild(t)} - } - enableCacheAsTexture(t={ - } - ){ - this.textureOptions=t,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0} - disableCacheAsTexture(){ - this.isCachedAsTexture=!1,this.texture&&(Be.returnTexture(this.texture,!0),this.texture=null)} - updateCacheTexture(){ - this.textureNeedsUpdate=!0; - const t=this._parentCacheAsTextureRenderGroup; - t&&!t.textureNeedsUpdate&&t.updateCacheTexture()} - reset(){ - this.renderGroupChildren.length=0; - for(const t in this.childrenToUpdate){ - const i=this.childrenToUpdate[t]; - i.list.fill(null),i.index=0} - this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=!0,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture()} - get localTransform(){ - return this.root.localTransform} - addRenderGroupChild(t){ - t.renderGroupParent&&t.renderGroupParent._removeRenderGroupChild(t),t.renderGroupParent=this,this.renderGroupChildren.push(t)} - _removeRenderGroupChild(t){ - const i=this.renderGroupChildren.indexOf(t); - i>-1&&this.renderGroupChildren.splice(i,1),t.renderGroupParent=null} - addChild(t){ - if(this.structureDidChange=!0,t.parentRenderGroup=this,t.updateTick=-1,t.parent===this.root?t.relativeRenderGroupDepth=1:t.relativeRenderGroupDepth=t.parent.relativeRenderGroupDepth+1,t.didChange=!0,this.onChildUpdate(t),t.renderGroup)return void this.addRenderGroupChild(t.renderGroup); - t._onRender&&this.addOnRender(t); - const i=t.children; - for(let s=0; - s<i.length; - s++)this.addChild(i[s])} - removeChild(t){ - if(this.structureDidChange=!0,t._onRender&&(t.renderGroup||this.removeOnRender(t)),t.parentRenderGroup=null,t.renderGroup)return void this._removeRenderGroupChild(t.renderGroup); - const i=t.children; - for(let s=0; - s<i.length; - s++)this.removeChild(i[s])} - removeChildren(t){ - for(let i=0; - i<t.length; - i++)this.removeChild(t[i])} - onChildUpdate(t){ - let i=this.childrenToUpdate[t.relativeRenderGroupDepth]; - i||(i=this.childrenToUpdate[t.relativeRenderGroupDepth]={ - index:0,list:[]} - ),i.list[i.index++]=t} - updateRenderable(t){ - t.globalDisplayStatus<7||(this.instructionSet.renderPipes[t.renderPipeId].updateRenderable(t),t.didViewUpdate=!1)} - onChildViewUpdate(t){ - this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=t} - get isRenderable(){ - return 7===this.root.localDisplayStatus&&this.worldAlpha>0} - addOnRender(t){ - this._onRenderContainers.push(t)} - removeOnRender(t){ - this._onRenderContainers.splice(this._onRenderContainers.indexOf(t),1)} - runOnRender(t){ - for(let i=0; - i<this._onRenderContainers.length; - i++)this._onRenderContainers[i]._onRender(t)} - destroy(){ - this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null} - getChildren(t=[]){ - const i=this.root.children; - for(let s=0; - s<i.length; - s++)this._getChildren(i[s],t); - return t} - _getChildren(t,i=[]){ - if(i.push(t),t.renderGroup)return i; - const s=t.children; - for(let e=0; - e<s.length; - e++)this._getChildren(s[e],i); - return i} - invalidateMatrices(){ - this._matrixDirty=7} - get inverseWorldTransform(){ - return 1&this._matrixDirty?(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new Ci),this._inverseWorldTransform.copyFrom(this.worldTransform).invert()):this._inverseWorldTransform} - get textureOffsetInverseTransform(){ - return 2&this._matrixDirty?(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new Ci),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y)):this._textureOffsetInverseTransform} - get inverseParentTextureTransform(){ - if(!(4&this._matrixDirty))return this._inverseParentTextureTransform; - this._matrixDirty&=-5; - const t=this._parentCacheAsTextureRenderGroup; - return t?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new Ci),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(t.inverseWorldTransform).translate(-t._textureBounds.x,-t._textureBounds.y)):this.worldTransform} - get cacheToLocalTransform(){ - return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null} - } - ; - Qt(Ue,"RenderGroup"); - let Fe=Ue; - function $e(t,i,s={ - } - ){ - for(const e in i)s[e]||void 0===i[e]||(t[e]=i[e])} - Qt($e,"assignWithIgnore"); - const He=new fi(null),We=new fi(null),Ve=new fi(null,1,1),je=new fi(null); - let Ke=(h=class extends vi{ - constructor(t={ - } - ){ - var i,s; - super(),this.uid=Wi("renderable"),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=!1,this.didViewUpdate=!1,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=!0,this.measurable=!0,this.isSimple=!0,this.parentRenderLayer=null,this.updateTick=-1,this.localTransform=new Ci,this.relativeGroupTransform=new Ci,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new fi(this,0,0),this._scale=Ve,this._pivot=We,this._origin=je,this._skew=He,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=16777215,this.localAlpha=1,this.groupAlpha=1,this.groupColor=16777215,this.groupColorAlpha=4294967295,this.localBlendMode="inherit",this.groupBlendMode="normal",this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],$e(this,t,{ - children:!0,parent:!0,effects:!0} - ),null==(i=t.children)||i.forEach(t=>this.addChild(t)),null==(s=t.parent)||s.addChild(this)} - static mixin(t){ - Yi("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),ci.mixin(h,t)} - set _didChangeId(t){ - this._didViewChangeTick=t>>12&4095,this._didContainerChangeTick=4095&t} - get _didChangeId(){ - return 4095&this._didContainerChangeTick|(4095&this._didViewChangeTick)<<12} - addChild(...t){ - if(this.allowChildren||Yi(ji,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){ - for(let i=0; - i<t.length; - i++)this.addChild(t[i]); - return t[0]} - const i=t[0],s=this.renderGroup||this.parentRenderGroup; - return i.parent===this?(this.children.splice(this.children.indexOf(i),1),this.children.push(i),s&&(s.structureDidChange=!0),i):(i.parent&&i.parent.removeChild(i),this.children.push(i),this.sortableChildren&&(this.sortDirty=!0),i.parent=this,i.didChange=!0,i._updateFlags=15,s&&s.addChild(i),this.emit("childAdded",i,this,this.children.length-1),i.emit("added",this),this._didViewChangeTick++,0!==i._zIndex&&i.depthOfChildModified(),i)} - removeChild(...t){ - if(t.length>1){ - for(let i=0; - i<t.length; - i++)this.removeChild(t[i]); - return t[0]} - const i=t[0],s=this.children.indexOf(i); - return s>-1&&(this._didViewChangeTick++,this.children.splice(s,1),this.renderGroup?this.renderGroup.removeChild(i):this.parentRenderGroup&&this.parentRenderGroup.removeChild(i),i.parentRenderLayer&&i.parentRenderLayer.detach(i),i.parent=null,this.emit("childRemoved",i,this,s),i.emit("removed",this)),i} - _onUpdate(t){ - t&&t===this._skew&&this._updateSkew(),this._didContainerChangeTick++,this.didChange||(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))} - set isRenderGroup(t){ - !!this.renderGroup!==t&&(t?this.enableRenderGroup():this.disableRenderGroup())} - get isRenderGroup(){ - return!!this.renderGroup} - enableRenderGroup(){ - if(this.renderGroup)return; - const t=this.parentRenderGroup; - null==t||t.removeChild(this),this.renderGroup=te.get(Fe,this),this.groupTransform=Ci.IDENTITY,null==t||t.addChild(this),this._updateIsSimple()} - disableRenderGroup(){ - if(!this.renderGroup)return; - const t=this.parentRenderGroup; - null==t||t.removeChild(this),te.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,null==t||t.addChild(this),this._updateIsSimple()} - _updateIsSimple(){ - this.isSimple=!this.renderGroup&&0===this.effects.length} - get worldTransform(){ - return this._worldTransform||(this._worldTransform=new Ci),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform} - get x(){ - return this._position.x} - set x(t){ - this._position.x=t} - get y(){ - return this._position.y} - set y(t){ - this._position.y=t} - get position(){ - return this._position} - set position(t){ - this._position.copyFrom(t)} - get rotation(){ - return this._rotation} - set rotation(t){ - this._rotation!==t&&(this._rotation=t,this._onUpdate(this._skew))} - get angle(){ - return this.rotation*bi} - set angle(t){ - this.rotation=t*yi} - get pivot(){ - return this._pivot===We&&(this._pivot=new fi(this,0,0)),this._pivot} - set pivot(t){ - this._pivot===We&&(this._pivot=new fi(this,0,0),this._origin!==je&&qs()),"number"==typeof t?this._pivot.set(t):this._pivot.copyFrom(t)} - get skew(){ - return this._skew===He&&(this._skew=new fi(this,0,0)),this._skew} - set skew(t){ - this._skew===He&&(this._skew=new fi(this,0,0)),this._skew.copyFrom(t)} - get scale(){ - return this._scale===Ve&&(this._scale=new fi(this,1,1)),this._scale} - set scale(t){ - this._scale===Ve&&(this._scale=new fi(this,0,0)),"string"==typeof t&&(t=parseFloat(t)),"number"==typeof t?this._scale.set(t):this._scale.copyFrom(t)} - get origin(){ - return this._origin===je&&(this._origin=new fi(this,0,0)),this._origin} - set origin(t){ - this._origin===je&&(this._origin=new fi(this,0,0),this._pivot!==We&&qs()),"number"==typeof t?this._origin.set(t):this._origin.copyFrom(t)} - get width(){ - return Math.abs(this.scale.x*this.getLocalBounds().width)} - set width(t){ - const i=this.getLocalBounds().width; - this._setWidth(t,i)} - get height(){ - return Math.abs(this.scale.y*this.getLocalBounds().height)} - set height(t){ - const i=this.getLocalBounds().height; - this._setHeight(t,i)} - getSize(t){ - t||(t={ - } - ); - const i=this.getLocalBounds(); - return t.width=Math.abs(this.scale.x*i.width),t.height=Math.abs(this.scale.y*i.height),t} - setSize(t,i){ - const s=this.getLocalBounds(); - "object"==typeof t?(i=t.height??t.width,t=t.width):i??(i=t),void 0!==t&&this._setWidth(t,s.width),void 0!==i&&this._setHeight(i,s.height)} - _updateSkew(){ - const t=this._rotation,i=this._skew; - this._cx=Math.cos(t+i._y),this._sx=Math.sin(t+i._y),this._cy=-Math.sin(t-i._x),this._sy=Math.cos(t-i._x)} - updateTransform(t){ - return this.position.set("number"==typeof t.x?t.x:this.position.x,"number"==typeof t.y?t.y:this.position.y),this.scale.set("number"==typeof t.scaleX?t.scaleX||1:this.scale.x,"number"==typeof t.scaleY?t.scaleY||1:this.scale.y),this.rotation="number"==typeof t.rotation?t.rotation:this.rotation,this.skew.set("number"==typeof t.skewX?t.skewX:this.skew.x,"number"==typeof t.skewY?t.skewY:this.skew.y),this.pivot.set("number"==typeof t.pivotX?t.pivotX:this.pivot.x,"number"==typeof t.pivotY?t.pivotY:this.pivot.y),this.origin.set("number"==typeof t.originX?t.originX:this.origin.x,"number"==typeof t.originY?t.originY:this.origin.y),this} - setFromMatrix(t){ - t.decompose(this)} - updateLocalTransform(){ - const t=this._didContainerChangeTick; - if(this._didLocalTransformChangeId===t)return; - this._didLocalTransformChangeId=t; - const i=this.localTransform,s=this._scale,e=this._pivot,n=this._origin,h=this._position,r=s._x,o=s._y,a=e._x,c=e._y,l=-n._x,u=-n._y; - i.a=this._cx*r,i.b=this._sx*r,i.c=this._cy*o,i.d=this._sy*o,i.tx=h._x-(a*i.a+c*i.c)+(l*i.a+u*i.c)-l,i.ty=h._y-(a*i.b+c*i.d)+(l*i.b+u*i.d)-u} - set alpha(t){ - t!==this.localAlpha&&(this.localAlpha=t,this._updateFlags|=1,this._onUpdate())} - get alpha(){ - return this.localAlpha} - set tint(t){ - const i=Ks.shared.setValue(t??16777215).toBgrNumber(); - i!==this.localColor&&(this.localColor=i,this._updateFlags|=1,this._onUpdate())} - get tint(){ - return ye(this.localColor)} - set blendMode(t){ - this.localBlendMode!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=2,this.localBlendMode=t,this._onUpdate())} - get blendMode(){ - return this.localBlendMode} - get visible(){ - return!!(2&this.localDisplayStatus)} - set visible(t){ - const i=t?2:0; - (2&this.localDisplayStatus)!==i&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=4,this.localDisplayStatus^=2,this._onUpdate(),this.emit("visibleChanged",t))} - get culled(){ - return!(4&this.localDisplayStatus)} - set culled(t){ - const i=t?0:4; - (4&this.localDisplayStatus)!==i&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=4,this.localDisplayStatus^=4,this._onUpdate())} - get renderable(){ - return!!(1&this.localDisplayStatus)} - set renderable(t){ - const i=t?1:0; - (1&this.localDisplayStatus)!==i&&(this._updateFlags|=4,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())} - get isRenderable(){ - return 7===this.localDisplayStatus&&this.groupAlpha>0} - destroy(t=!1){ - var i; - if(this.destroyed)return; - let s; - if(this.destroyed=!0,this.children.length&&(s=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),("boolean"==typeof t?t:null==t?void 0:t.children)&&s)for(let e=0; - e<s.length; - ++e)s[e].destroy(t); - null==(i=this.renderGroup)||i.destroy(),this.renderGroup=null} - } - ,Qt(h,"Container"),h); - ci.mixin(Ke,ee,we,Re,Ie,Oe,le,ue,ke,zs,ie,Ee,ne); - const ze=class extends Ke{ - constructor(t){ - super(t),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this._bounds=new ps(0,1,0,0),this._boundsDirty=!0,this.autoGarbageCollect=t.autoGarbageCollect??!0} - get bounds(){ - return this._boundsDirty?(this.updateBounds(),this._boundsDirty=!1,this._bounds):this._bounds} - get roundPixels(){ - return!!this._roundPixels} - set roundPixels(t){ - this._roundPixels=t?1:0} - containsPoint(t){ - const i=this.bounds,{ - x:s,y:e} - =t; - return s>=i.minX&&s<=i.maxX&&e>=i.minY&&e<=i.maxY} - onViewUpdate(){ - if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return; - this.didViewUpdate=!0; - const t=this.renderGroup||this.parentRenderGroup; - t&&t.onChildViewUpdate(this)} - unload(){ - var t; - this.emit("unload",this); - for(const i in this._gpuData)null==(t=this._gpuData[i])||t.destroy(); - this._gpuData=Object.create(null),this.onViewUpdate()} - destroy(t){ - this.unload(),super.destroy(t),this._bounds=null} - collectRenderablesSimple(t,i,s){ - const{ - renderPipes:e} - =i; - e.blendMode.pushBlendMode(this,this.groupBlendMode,t); - const n=e[this.renderPipeId]; - (null==n?void 0:n.addRenderable)&&n.addRenderable(this,t),this.didViewUpdate=!1; - const h=this.children,r=h.length; - for(let o=0; - o<r; - o++)h[o].collectRenderables(t,i,s); - e.blendMode.popBlendMode(t)} - } - ; - Qt(ze,"ViewContainer"); - let Ye=ze; - const qe=class t extends Ye{ - constructor(t=ls.EMPTY){ - t instanceof ls&&(t={ - texture:t} - ); - const{ - texture:i=ls.EMPTY,anchor:s,roundPixels:e,width:n,height:h,...r} - =t; - super({ - label:"Sprite",...r} - ),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={ - minX:0,maxX:1,minY:0,maxY:0} - ,this._anchor=new fi({ - _onUpdate:Qt(()=>{ - this.onViewUpdate()} - ,"_onUpdate")} - ),s?this.anchor=s:i.defaultAnchor&&(this.anchor=i.defaultAnchor),this.texture=i,this.allowChildren=!1,this.roundPixels=e??!1,void 0!==n&&(this.width=n),void 0!==h&&(this.height=h)} - static from(i,s=!1){ - return new t(i instanceof ls?i:ls.from(i,s))} - set texture(t){ - t||(t=ls.EMPTY); - const i=this._texture; - i!==t&&(i&&i.dynamic&&i.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())} - get texture(){ - return this._texture} - get visualBounds(){ - return us(this._visualBounds,this._anchor,this._texture),this._visualBounds} - get sourceBounds(){ - return Yi("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds} - updateBounds(){ - const t=this._anchor,i=this._texture,s=this._bounds,{ - width:e,height:n} - =i.orig; - s.minX=-t._x*e,s.maxX=s.minX+e,s.minY=-t._y*n,s.maxY=s.minY+n} - destroy(t=!1){ - if(super.destroy(t),"boolean"==typeof t?t:null==t?void 0:t.texture){ - const i="boolean"==typeof t?t:null==t?void 0:t.textureSource; - this._texture.destroy(i)} - this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null} - get anchor(){ - return this._anchor} - set anchor(t){ - "number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)} - get width(){ - return Math.abs(this.scale.x)*this._texture.orig.width} - set width(t){ - this._setWidth(t,this._texture.orig.width),this._width=t} - get height(){ - return Math.abs(this.scale.y)*this._texture.orig.height} - set height(t){ - this._setHeight(t,this._texture.orig.height),this._height=t} - getSize(t){ - return t||(t={ - } - ),t.width=Math.abs(this.scale.x)*this._texture.orig.width,t.height=Math.abs(this.scale.y)*this._texture.orig.height,t} - setSize(t,i){ - "object"==typeof t?(i=t.height??t.width,t=t.width):i??(i=t),void 0!==t&&this._setWidth(t,this._texture.orig.width),void 0!==i&&this._setHeight(i,this._texture.orig.height)} - } - ; - Qt(qe,"Sprite"); - let Xe=qe; - const Je=new ps; - function Qe(t,i,s){ - const e=Je; - t.measurable=!0,ge(t,s,e),i.addBoundsMask(e),t.measurable=!1} - function Ze(t,i,s){ - const e=fe.get(); - t.measurable=!0; - const n=de.get().identity(); - Ae(t,e,tn(t,s,n)),t.measurable=!1,i.addBoundsMask(e),de.return(n),fe.return(e)} - function tn(t,i,s){ - return t?(t!==i&&(tn(t.parent,i,s),t.updateLocalTransform(),s.append(t.localTransform)),s):(qs(),s)} - Qt(Qe,"addMaskBounds"),Qt(Ze,"addMaskLocalBounds"),Qt(tn,"getMatrixRelativeToParent"); - const sn=class{ - constructor(t){ - this.priority=0,this.inverse=!1,this.pipe="alphaMask",(null==t?void 0:t.mask)&&this.init(t.mask)} - init(t){ - this.mask=t,this.renderMaskToTexture=!(t instanceof Xe),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1} - reset(){ - null!==this.mask&&(this.mask.measurable=!0,this.mask=null)} - addBounds(t,i){ - this.inverse||Qe(this.mask,t,i)} - addLocalBounds(t,i){ - Ze(this.mask,t,i)} - containsPoint(t,i){ - return i(this.mask,t)} - destroy(){ - this.reset()} - static test(t){ - return t instanceof Xe} - } - ; - Qt(sn,"AlphaMask"); - let en=sn; - en.extension=ri.MaskEffect; - const nn=class{ - constructor(t){ - this.priority=0,this.pipe="colorMask",(null==t?void 0:t.mask)&&this.init(t.mask)} - init(t){ - this.mask=t} - destroy(){ - } - static test(t){ - return"number"==typeof t} - } - ; - Qt(nn,"ColorMask"); - let hn=nn; - hn.extension=ri.MaskEffect; - const rn=class{ - constructor(t){ - this.priority=0,this.pipe="stencilMask",(null==t?void 0:t.mask)&&this.init(t.mask)} - init(t){ - this.mask=t,this.mask.includeInBuild=!1,this.mask.measurable=!1} - reset(){ - null!==this.mask&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)} - addBounds(t,i){ - Qe(this.mask,t,i)} - addLocalBounds(t,i){ - Ze(this.mask,t,i)} - containsPoint(t,i){ - return i(this.mask,t)} - destroy(){ - this.reset()} - static test(t){ - return t instanceof Ke} - } - ; - Qt(rn,"StencilMask"); - let on=rn; - on.extension=ri.MaskEffect; - const an={ - createCanvas:Qt((t,i)=>{ - const s=document.createElement("canvas"); - return s.width=t,s.height=i,s} - ,"createCanvas"),createImage:Qt(()=>new Image,"createImage"),getCanvasRenderingContext2D:Qt(()=>CanvasRenderingContext2D,"getCanvasRenderingContext2D"),getWebGLRenderingContext:Qt(()=>WebGLRenderingContext,"getWebGLRenderingContext"),getNavigator:Qt(()=>navigator,"getNavigator"),getBaseUrl:Qt(()=>document.baseURI??window.location.href,"getBaseUrl"),getFontFaceSet:Qt(()=>document.fonts,"getFontFaceSet"),fetch:Qt((t,i)=>fetch(t,i),"fetch"),parseXML:Qt(t=>(new DOMParser).parseFromString(t,"text/xml"),"parseXML")} - ; - let cn=an; - const ln={ - get:()=>cn,set(t){ - cn=t} - } - ,un=class extends ns{ - constructor(t){ - t.resource||(t.resource=ln.get().createCanvas()),t.width||(t.width=t.resource.width,t.autoDensity||(t.width/=t.resolution)),t.height||(t.height=t.resource.height,t.autoDensity||(t.height/=t.resolution)),super(t),this.uploadMethodId="image",this.autoDensity=t.autoDensity,this.resizeCanvas(),this.transparent=!!t.transparent} - resizeCanvas(){ - this.autoDensity&&"style"in this.resource&&(this.resource.style.width=`${ - this.width} - px`,this.resource.style.height=`${ - this.height} - px`),this.resource.width===this.pixelWidth&&this.resource.height===this.pixelHeight||(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)} - resize(t=this.width,i=this.height,s=this._resolution){ - const e=super.resize(t,i,s); - return e&&this.resizeCanvas(),e} - static test(t){ - return globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&t instanceof OffscreenCanvas} - get context2D(){ - return this._context2D||(this._context2D=this.resource.getContext("2d"))} - } - ; - Qt(un,"CanvasSource"); - let dn=un; - dn.extension=ri.TextureSource; - const fn=class extends ns{ - constructor(t){ - super(t),this.uploadMethodId="image",this.autoGarbageCollect=!0} - static test(t){ - return globalThis.HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||globalThis.VideoFrame&&t instanceof VideoFrame} - } - ; - Qt(fn,"ImageSource"); - let pn=fn; - pn.extension=ri.TextureSource; - var wn=(t=>(t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY",t))(wn||{ - } - ); - const gn=class{ - constructor(t,i=null,s=0,e=!1){ - this.next=null,this.previous=null,this._destroyed=!1,this._fn=t,this._context=i,this.priority=s,this._once=e} - match(t,i=null){ - return this._fn===t&&this._context===i} - emit(t){ - this._fn&&(this._context?this._fn.call(this._context,t):this._fn(t)); - const i=this.next; - return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),i} - connect(t){ - this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this} - destroy(t=!1){ - this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous); - const i=this.next; - return this.next=t?null:i,this.previous=null,i} - } - ; - Qt(gn,"TickerListener"); - let mn=gn; - const vn=(Qt(r=class{ - constructor(){ - this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new mn(null,null,1/0),this.deltaMS=1/r.targetFPMS,this.elapsedMS=1/r.targetFPMS,this._tick=t=>{ - this._requestId=null,this.started&&(this.update(t),this.started&&null===this._requestId&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))} - } - _requestIfNeeded(){ - null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))} - _cancelIfNeeded(){ - null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)} - _startIfPossible(){ - this.started?this._requestIfNeeded():this.autoStart&&this.start()} - add(t,i,s=wn.NORMAL){ - return this._addListener(new mn(t,i,s))} - addOnce(t,i,s=wn.NORMAL){ - return this._addListener(new mn(t,i,s,!0))} - _addListener(t){ - let i=this._head.next,s=this._head; - if(i){ - for(; - i; - ){ - if(t.priority>i.priority){ - t.connect(s); - break} - s=i,i=i.next} - t.previous||t.connect(s)} - else t.connect(s); - return this._startIfPossible(),this} - remove(t,i){ - let s=this._head.next; - for(; - s; - )s=s.match(t,i)?s.destroy():s.next; - return this._head.next||this._cancelIfNeeded(),this} - get count(){ - if(!this._head)return 0; - let t=0,i=this._head; - for(; - i=i.next; - )t++; - return t} - start(){ - this.started||(this.started=!0,this._requestIfNeeded())} - stop(){ - this.started&&(this.started=!1,this._cancelIfNeeded())} - destroy(){ - if(!this._protected){ - this.stop(); - let t=this._head.next; - for(; - t; - )t=t.destroy(!0); - this._head.destroy(),this._head=null} - } - update(t=performance.now()){ - let i; - if(t>this.lastTime){ - if(i=this.elapsedMS=t-this.lastTime,i>this._maxElapsedMS&&(i=this._maxElapsedMS),i*=this.speed,this._minElapsedMS){ - const i=t-this._lastFrame|0; - if(i<this._minElapsedMS)return; - this._lastFrame=t-i%this._minElapsedMS} - this.deltaMS=i,this.deltaTime=this.deltaMS*r.targetFPMS; - const s=this._head; - let e=s.next; - for(; - e; - )e=e.emit(this); - s.next||this._cancelIfNeeded()} - else this.deltaTime=this.deltaMS=this.elapsedMS=0; - this.lastTime=t} - get FPS(){ - return 1e3/this.elapsedMS} - get minFPS(){ - return 1e3/this._maxElapsedMS} - set minFPS(t){ - const i=Math.min(Math.max(0,t)/1e3,r.targetFPMS); - this._maxElapsedMS=1/i,this._minElapsedMS&&t>this.maxFPS&&(this.maxFPS=t)} - get maxFPS(){ - return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0} - set maxFPS(t){ - 0===t?this._minElapsedMS=0:(t<this.minFPS&&(this.minFPS=t),this._minElapsedMS=1/(t/1e3))} - static get shared(){ - if(!r._shared){ - const t=r._shared=new r; - t.autoStart=!0,t._protected=!0} - return r._shared} - static get system(){ - if(!r._system){ - const t=r._system=new r; - t.autoStart=!0,t._protected=!0} - return r._system} - } - ,"_Ticker"),r); - vn.targetFPMS=.06; - let _n,Mn=vn; - async function bn(){ - return _n??(_n=(async()=>{ - var t; - const i=ln.get().createCanvas(1,1).getContext("webgl"); - if(!i)return"premultiply-alpha-on-upload"; - const s=await new Promise(t=>{ - const i=document.createElement("video"); - i.onloadeddata=()=>t(i),i.onerror=()=>t(null),i.autoplay=!1,i.crossOrigin="anonymous",i.preload="auto",i.src="data:video/webm; - base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",i.load()} - ); - if(!s)return"premultiply-alpha-on-upload"; - const e=i.createTexture(); - i.bindTexture(i.TEXTURE_2D,e); - const n=i.createFramebuffer(); - i.bindFramebuffer(i.FRAMEBUFFER,n),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,e,0),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.NONE),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,s); - const h=new Uint8Array(4); - return i.readPixels(0,0,1,1,i.RGBA,i.UNSIGNED_BYTE,h),i.deleteFramebuffer(n),i.deleteTexture(e),null==(t=i.getExtension("WEBGL_lose_context"))||t.loseContext(),h[0]<=h[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"} - )()),_n} - Qt(bn,"detectVideoAlphaMode"); - const yn=(Qt(o=class extends ns{ - constructor(t){ - super(t),this.isReady=!1,this.uploadMethodId="video",t={ - ...o.defaultOptions,...t} - ,this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=!1!==t.autoPlay,this.alphaMode=t.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),!1!==t.autoLoad&&this.load()} - updateFrame(){ - if(!this.destroyed){ - if(this._updateFPS){ - const t=Mn.shared.elapsedMS*this.resource.playbackRate; - this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)} - (!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()} - } - _videoFrameRequestCallback(){ - this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)} - get isValid(){ - return!!this.resource.videoWidth&&!!this.resource.videoHeight} - async load(){ - if(this._load)return this._load; - const t=this.resource,i=this.options; - return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(i.preload||t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlayThrough),t.addEventListener("error",this._onError,!0)),this.alphaMode=await bn(),this._load=new Promise((s,e)=>{ - this.isValid?s(this):(this._resolve=s,this._reject=e,void 0!==i.preloadTimeoutMs&&(this._preloadTimeout=setTimeout(()=>{ - this._onError(new ErrorEvent(`Preload exceeded timeout of ${ - i.preloadTimeoutMs} - ms`))} - )),t.load())} - ),this._load} - _onError(t){ - this.resource.removeEventListener("error",this._onError,!0),this.emit("error",t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)} - _isSourcePlaying(){ - const t=this.resource; - return!t.paused&&!t.ended} - _isSourceReady(){ - return this.resource.readyState>2} - _onPlayStart(){ - this.isValid||this._mediaReady(),this._configureAutoUpdate()} - _onPlayStop(){ - this._configureAutoUpdate()} - _onSeeked(){ - this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)} - _onCanPlay(){ - this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady()} - _onCanPlayThrough(){ - this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady()} - _mediaReady(){ - const t=this.resource; - this.isValid&&(this.isReady=!0,this.resize(t.videoWidth,t.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()} - destroy(){ - this._configureAutoUpdate(); - const t=this.resource; - t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlayThrough),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.destroy()} - get autoUpdate(){ - return this._autoUpdate} - set autoUpdate(t){ - t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())} - get updateFPS(){ - return this._updateFPS} - set updateFPS(t){ - t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())} - _configureAutoUpdate(){ - this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(Mn.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),null===this._videoFrameRequestCallbackHandle&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(null!==this._videoFrameRequestCallbackHandle&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(Mn.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(null!==this._videoFrameRequestCallbackHandle&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Mn.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))} - static test(t){ - return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement} - } - ,"_VideoSource"),o); - yn.extension=ri.TextureSource,yn.defaultOptions={ - ...ns.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1} - ,yn.MIME_TYPES={ - ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"} - ; - let En=yn; - const An=Qt((t,i,s=!1)=>(Array.isArray(t)||(t=[t]),i?t.map(t=>"string"==typeof t||s?i(t):t):t),"convertToList"),Sn=class{ - constructor(){ - this._parsers=[],this._cache=new Map,this._cacheMap=new Map} - reset(){ - this._cacheMap.clear(),this._cache.clear()} - has(t){ - return this._cache.has(t)} - get(t){ - const i=this._cache.get(t); - return i||qs(),i} - set(t,i){ - const s=An(t); - let e; - for(let o=0; - o<this.parsers.length; - o++){ - const t=this.parsers[o]; - if(t.test(i)){ - e=t.getCacheableAssets(s,i); - break} - } - const n=new Map(Object.entries(e||{ - } - )); - e||s.forEach(t=>{ - n.set(t,i)} - ); - const h=[...n.keys()],r={ - cacheKeys:h,keys:s} - ; - s.forEach(t=>{ - this._cacheMap.set(t,r)} - ),h.forEach(t=>{ - const s=e?e[t]:i; - this._cache.has(t)&&this._cache.get(t)!==s&&qs(),this._cache.set(t,n.get(t))} - )} - remove(t){ - if(!this._cacheMap.has(t))return void qs(); - const i=this._cacheMap.get(t); - i.cacheKeys.forEach(t=>{ - this._cache.delete(t)} - ),i.keys.forEach(t=>{ - this._cacheMap.delete(t)} - )} - get parsers(){ - return this._parsers} - } - ; - Qt(Sn,"CacheClass"); - const Tn=new Sn,Cn=[]; - function On(t={ - } - ){ - const i=t&&t.resource,s=i?t.resource:t,e=i?t:{ - resource:t} - ; - for(let n=0; - n<Cn.length; - n++){ - const t=Cn[n]; - if(t.test(s))return new t(e)} - throw new Error(`Could not find a source type for resource: ${ - e.resource} - `)} - function In(t={ - } - ,i=!1){ - const s=t&&t.resource,e=s?t.resource:t,n=s?t:{ - resource:t} - ; - if(!i&&Tn.has(e))return Tn.get(e); - const h=new ls({ - source:On(n)} - ); - return h.on("destroy",()=>{ - Tn.has(e)&&Tn.remove(e)} - ),i||Tn.set(e,h),h} - function kn(t,i=!1){ - return"string"==typeof t?Tn.get(t):t instanceof ns?new ls({ - source:t} - ):In(t,i)} - ci.handleByList(ri.TextureSource,Cn),Qt(On,"textureSourceFrom"),Qt(In,"resourceToTexture"),Qt(kn,"textureFrom"),ls.from=kn,ns.from=On,ci.add(en,hn,on,En,pn,dn,rs); - var xn=(t=>(t[t.Low=0]="Low",t[t.Normal=1]="Normal",t[t.High=2]="High",t))(xn||{ - } - ); - function Rn(t){ - if("string"!=typeof t)throw new TypeError(`Path must be a string. Received ${ - JSON.stringify(t)} - `)} - function Pn(t){ - return t.split("?")[0].split("#")[0]} - function Nn(t){ - return t.replace(/[.*+?^${ - } - ()|[\]\\]/g,"\\$&")} - function Ln(t,i,s){ - return t.replace(new RegExp(Nn(i),"g"),s)} - function Dn(t,i){ - let s="",e=0,n=-1,h=0,r=-1; - for(let o=0; - o<=t.length; - ++o){ - if(o<t.length)r=t.charCodeAt(o); - else{ - if(47===r)break; - r=47} - if(47===r){ - if(n===o-1||1===h); - else if(n!==o-1&&2===h){ - if(s.length<2||2!==e||46!==s.charCodeAt(s.length-1)||46!==s.charCodeAt(s.length-2))if(s.length>2){ - const t=s.lastIndexOf("/"); - if(t!==s.length-1){ - -1===t?(s="",e=0):(s=s.slice(0,t),e=s.length-1-s.lastIndexOf("/")),n=o,h=0; - continue} - } - else if(2===s.length||1===s.length){ - s="",e=0,n=o,h=0; - continue} - } - else s.length>0?s+=`/${ - t.slice(n+1,o)} - `:s=t.slice(n+1,o),e=o-n-1; - n=o,h=0} - else 46===r&&-1!==h?++h:h=-1} - return s} - Qt(Rn,"assertPath"),Qt(Pn,"removeUrlParams"),Qt(Nn,"escapeRegExp"),Qt(Ln,"replaceAll"),Qt(Dn,"normalizeStringPosix"); - const Gn={ - toPosix:t=>Ln(t,"\\","/"),isUrl(t){ - return/^https?:/.test(this.toPosix(t))} - ,isDataUrl:t=>/^data:([a-z]+\/[a-z0-9-+.]+(; - [a-z0-9-.!#$%*+.{ - } - |~`]+=[a-z0-9-.!#$%*+.{ - } - ()_|~`]+)*)?(; - base64)?,([a-z0-9!$&',()*+; - =\-._~:@\/?%\s<>]*?)$/i.test(t),isBlobUrl:t=>t.startsWith("blob:"),hasProtocol(t){ - return/^[^/:]+:/.test(this.toPosix(t))} - ,getProtocol(t){ - Rn(t),t=this.toPosix(t); - const i=/^file:\/\/\//.exec(t); - if(i)return i[0]; - const s=/^[^/:]+:\/{ - 0,2} - /.exec(t); - return s?s[0]:""} - ,toAbsolute(t,i,s){ - if(Rn(t),this.isDataUrl(t)||this.isBlobUrl(t))return t; - const e=Pn(this.toPosix(i??ln.get().getBaseUrl())),n=Pn(this.toPosix(s??this.rootname(e))); - return(t=this.toPosix(t)).startsWith("/")?Gn.join(n,t.slice(1)):this.isAbsolute(t)?t:this.join(e,t)} - ,normalize(t){ - if(Rn(t),0===t.length)return"."; - if(this.isDataUrl(t)||this.isBlobUrl(t))return t; - let i=""; - const s=(t=this.toPosix(t)).startsWith("/"); - this.hasProtocol(t)&&(i=this.rootname(t),t=t.slice(i.length)); - const e=t.endsWith("/"); - return(t=Dn(t)).length>0&&e&&(t+="/"),s?`/${ - t} - `:i+t} - ,isAbsolute(t){ - return Rn(t),t=this.toPosix(t),!!this.hasProtocol(t)||t.startsWith("/")} - ,join(...t){ - if(0===t.length)return"."; - let i; - for(let s=0; - s<t.length; - ++s){ - const e=t[s]; - if(Rn(e),e.length>0)if(void 0===i)i=e; - else{ - const n=t[s-1]??""; - this.joinExtensions.includes(this.extname(n).toLowerCase())?i+=`/../${ - e} - `:i+=`/${ - e} - `} - } - return void 0===i?".":this.normalize(i)} - ,dirname(t){ - if(Rn(t),0===t.length)return"."; - let i=(t=this.toPosix(t)).charCodeAt(0); - const s=47===i; - let e=-1,n=!0; - const h=this.getProtocol(t),r=t; - for(let o=(t=t.slice(h.length)).length-1; - o>=1; - --o)if(i=t.charCodeAt(o),47===i){ - if(!n){ - e=o; - break} - } - else n=!1; - return-1===e?s?"/":this.isUrl(r)?h+t:h:s&&1===e?"//":h+t.slice(0,e)} - ,rootname(t){ - Rn(t); - let i=""; - if(i=(t=this.toPosix(t)).startsWith("/")?"/":this.getProtocol(t),this.isUrl(t)){ - const s=t.indexOf("/",i.length); - i=-1!==s?t.slice(0,s):t,i.endsWith("/")||(i+="/")} - return i} - ,basename(t,i){ - Rn(t),i&&Rn(i),t=Pn(this.toPosix(t)); - let s,e=0,n=-1,h=!0; - if(void 0!==i&&i.length>0&&i.length<=t.length){ - if(i.length===t.length&&i===t)return""; - let r=i.length-1,o=-1; - for(s=t.length-1; - s>=0; - --s){ - const a=t.charCodeAt(s); - if(47===a){ - if(!h){ - e=s+1; - break} - } - else-1===o&&(h=!1,o=s+1),r>=0&&(a===i.charCodeAt(r)?-1===--r&&(n=s):(r=-1,n=o))} - return e===n?n=o:-1===n&&(n=t.length),t.slice(e,n)} - for(s=t.length-1; - s>=0; - --s)if(47===t.charCodeAt(s)){ - if(!h){ - e=s+1; - break} - } - else-1===n&&(h=!1,n=s+1); - return-1===n?"":t.slice(e,n)} - ,extname(t){ - Rn(t); - let i=-1,s=0,e=-1,n=!0,h=0; - for(let r=(t=Pn(this.toPosix(t))).length-1; - r>=0; - --r){ - const o=t.charCodeAt(r); - if(47!==o)-1===e&&(n=!1,e=r+1),46===o?-1===i?i=r:1!==h&&(h=1):-1!==i&&(h=-1); - else if(!n){ - s=r+1; - break} - } - return-1===i||-1===e||0===h||1===h&&i===e-1&&i===s+1?"":t.slice(i,e)} - ,parse(t){ - Rn(t); - const i={ - root:"",dir:"",base:"",ext:"",name:""} - ; - if(0===t.length)return i; - let s=(t=Pn(this.toPosix(t))).charCodeAt(0); - const e=this.isAbsolute(t); - let n; - i.root=this.rootname(t),n=e||this.hasProtocol(t)?1:0; - let h=-1,r=0,o=-1,a=!0,c=t.length-1,l=0; - for(; - c>=n; - --c)if(s=t.charCodeAt(c),47!==s)-1===o&&(a=!1,o=c+1),46===s?-1===h?h=c:1!==l&&(l=1):-1!==h&&(l=-1); - else if(!a){ - r=c+1; - break} - return-1===h||-1===o||0===l||1===l&&h===o-1&&h===r+1?-1!==o&&(i.base=i.name=0===r&&e?t.slice(1,o):t.slice(r,o)):(0===r&&e?(i.name=t.slice(1,h),i.base=t.slice(1,o)):(i.name=t.slice(r,h),i.base=t.slice(r,o)),i.ext=t.slice(h,o)),i.dir=this.dirname(t),i} - ,sep:"/",delimiter:":",joinExtensions:[".html"]} - ; - function Bn(t,i,s,e,n){ - const h=i[s]; - for(let r=0; - r<h.length; - r++){ - const o=h[r]; - s<i.length-1?Bn(t.replace(e[s],o),i,s+1,e,n):n.push(t.replace(e[s],o))} - } - function Un(t){ - const i=t.match(/\{ - (.*?)\} - /g),s=[]; - if(i){ - const e=[]; - i.forEach(t=>{ - const i=t.substring(1,t.length-1).split(","); - e.push(i)} - ),Bn(t,e,0,i,s)} - else s.push(t); - return s} - Qt(Bn,"processX"),Qt(Un,"createStringVariations"); - const Fn=Qt(t=>!Array.isArray(t),"isSingleItem"),$n=class{ - constructor(){ - this._defaultBundleIdentifierOptions={ - connector:"-",createBundleAssetId:Qt((t,i)=>`${ - t} - ${ - this._bundleIdConnector} - ${ - i} - `,"createBundleAssetId"),extractAssetIdFromBundle:Qt((t,i)=>i.replace(`${ - t} - ${ - this._bundleIdConnector} - `,""),"extractAssetIdFromBundle")} - ,this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={ - } - ,this._preferredOrder=[],this._parsers=[],this._resolverHash={ - } - ,this._bundles={ - } - } - setBundleIdentifier(t){ - if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,"bar"!==this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar")))throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")} - prefer(...t){ - t.forEach(t=>{ - this._preferredOrder.push(t),t.priority||(t.priority=Object.keys(t.params))} - ),this._resolverHash={ - } - } - set basePath(t){ - this._basePath=t} - get basePath(){ - return this._basePath} - set rootPath(t){ - this._rootPath=t} - get rootPath(){ - return this._rootPath} - get parsers(){ - return this._parsers} - reset(){ - this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={ - } - ,this._preferredOrder=[],this._resolverHash={ - } - ,this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={ - } - ,this._defaultSearchParams=null} - setDefaultSearchParams(t){ - if("string"==typeof t)this._defaultSearchParams=t; - else{ - const i=t; - this._defaultSearchParams=Object.keys(i).map(t=>`${ - encodeURIComponent(t)} - =${ - encodeURIComponent(i[t])} - `).join("&")} - } - getAlias(t){ - const{ - alias:i,src:s} - =t; - return An(i||s,t=>"string"==typeof t?t:Array.isArray(t)?t.map(t=>(null==t?void 0:t.src)??t):(null==t?void 0:t.src)?t.src:t,!0)} - removeAlias(t,i){ - this._assetMap[t]&&(i&&i!==this._resolverHash[t]||(delete this._resolverHash[t],delete this._assetMap[t]))} - addManifest(t){ - this._manifest&&qs(),this._manifest=t,t.bundles.forEach(t=>{ - this.addBundle(t.name,t.assets)} - )} - addBundle(t,i){ - const s=[]; - let e=i; - Array.isArray(i)||(e=Object.entries(i).map(([t,i])=>"string"==typeof i||Array.isArray(i)?{ - alias:t,src:i} - :{ - alias:t,...i} - )),e.forEach(i=>{ - const e=i.src,n=i.alias; - let h; - if("string"==typeof n){ - const i=this._createBundleAssetId(t,n); - s.push(i),h=[n,i]} - else{ - const i=n.map(i=>this._createBundleAssetId(t,i)); - s.push(...i),h=[...n,...i]} - this.add({ - ...i,alias:h,src:e} - )} - ),this._bundles[t]=s} - add(t){ - const i=[]; - let s; - Array.isArray(t)?i.push(...t):i.push(t),s=Qt(t=>{ - this.hasKey(t)&&qs()} - ,"keyCheck"),An(i).forEach(t=>{ - const{ - src:i} - =t; - let{ - data:e,format:n,loadParser:h,parser:r} - =t; - const o=An(i).map(t=>"string"==typeof t?Un(t):Array.isArray(t)?t:[t]),a=this.getAlias(t); - Array.isArray(a)?a.forEach(s):s(a); - const c=[],l=Qt(t=>{ - const i=this._parsers.find(i=>i.test(t)); - return{ - src:t,...null==i?void 0:i.parse(t)} - } - ,"parseUrl"); - o.forEach(i=>{ - i.forEach(i=>{ - let s={ - } - ; - if("object"!=typeof i?s=l(i):(e=i.data??e,n=i.format??n,(i.loadParser||i.parser)&&(h=i.loadParser??h,r=i.parser??r),s={ - ...l(i.src),...i} - ),!a)throw new Error(`[Resolver] alias is undefined for this asset: ${ - s.src} - `); - s=this._buildResolvedAsset(s,{ - aliases:a,data:e,format:n,loadParser:h,parser:r,progressSize:t.progressSize} - ),c.push(s)} - )} - ),a.forEach(t=>{ - this._assetMap[t]=c} - )} - )} - resolveBundle(t){ - const i=Fn(t); - t=An(t); - const s={ - } - ; - return t.forEach(t=>{ - const i=this._bundles[t]; - if(i){ - const e=this.resolve(i),n={ - } - ; - for(const i in e){ - const s=e[i]; - n[this._extractAssetIdFromBundle(t,i)]=s} - s[t]=n} - } - ),i?s[t[0]]:s} - resolveUrl(t){ - const i=this.resolve(t); - if("string"!=typeof t){ - const t={ - } - ; - for(const s in i)t[s]=i[s].src; - return t} - return i.src} - resolve(t){ - const i=Fn(t); - t=An(t); - const s={ - } - ; - return t.forEach(t=>{ - if(!this._resolverHash[t])if(this._assetMap[t]){ - let i=this._assetMap[t]; - const s=this._getPreferredOrder(i); - null==s||s.priority.forEach(t=>{ - s.params[t].forEach(s=>{ - const e=i.filter(i=>!!i[t]&&i[t]===s); - e.length&&(i=e)} - )} - ),this._resolverHash[t]=i[0]} - else this._resolverHash[t]=this._buildResolvedAsset({ - alias:[t],src:t} - ,{ - } - ); - s[t]=this._resolverHash[t]} - ),i?s[t[0]]:s} - hasKey(t){ - return!!this._assetMap[t]} - hasBundle(t){ - return!!this._bundles[t]} - _getPreferredOrder(t){ - for(let i=0; - i<t.length; - i++){ - const s=t[i],e=this._preferredOrder.find(t=>t.params.format.includes(s.format)); - if(e)return e} - return this._preferredOrder[0]} - _appendDefaultSearchParams(t){ - return this._defaultSearchParams?`${ - t} - ${ - /\?/.test(t)?"&":"?"} - ${ - this._defaultSearchParams} - `:t} - _buildResolvedAsset(t,i){ - const{ - aliases:s,data:e,loadParser:n,parser:h,format:r,progressSize:o} - =i; - return(this._basePath||this._rootPath)&&(t.src=Gn.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=s??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={ - ...e||{ - } - ,...t.data} - ,t.loadParser=n??t.loadParser,t.parser=h??t.parser,t.format=r??t.format??Wn(t.src),void 0!==o&&(t.progressSize=o),t} - } - ; - Qt($n,"Resolver"); - let Hn=$n; - function Wn(t){ - return t.split(".").pop().split("?").shift().split("#").shift()} - Hn.RETINA_PREFIX=/@([0-9\.]+)x/,Qt(Wn,"getUrlExtension"); - const Vn=Qt((t,i)=>{ - const s=i.split("?")[1]; - return s&&(t+=`?${ - s} - `),t} - ,"copySearchParams"),jn=(Qt(a=class{ - constructor(t,i){ - this.linkedSheets=[]; - let s=t; - (null==t?void 0:t.source)instanceof ns&&(s={ - texture:t,data:i} - ); - const{ - texture:e,data:n,cachePrefix:h=""} - =s; - this.cachePrefix=h,this._texture=e instanceof ls?e:null,this.textureSource=e.source,this.textures={ - } - ,this.animations={ - } - ,this.data=n; - const r=parseFloat(n.meta.scale); - r?(this.resolution=r,e.source.resolution=this.resolution):this.resolution=e.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null} - parse(){ - return new Promise(t=>{ - this._callback=t,this._batchIndex=0,this._frameKeys.length<=a.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()} - )} - parseSync(){ - return this._processFrames(0,!0),this._processAnimations(),this.textures} - _processFrames(t,i=!1){ - let s=t; - const e=i?1/0:a.BATCH_SIZE; - for(; - s-t<e&&s<this._frameKeys.length; - ){ - const t=this._frameKeys[s],i=this._frames[t],e=i.frame; - if(e){ - let s=null,n=null; - const h=!1!==i.trimmed&&i.sourceSize?i.sourceSize:i.frame,r=new $i(0,0,Math.floor(h.w)/this.resolution,Math.floor(h.h)/this.resolution); - s=i.rotated?new $i(Math.floor(e.x)/this.resolution,Math.floor(e.y)/this.resolution,Math.floor(e.h)/this.resolution,Math.floor(e.w)/this.resolution):new $i(Math.floor(e.x)/this.resolution,Math.floor(e.y)/this.resolution,Math.floor(e.w)/this.resolution,Math.floor(e.h)/this.resolution),!1!==i.trimmed&&i.spriteSourceSize&&(n=new $i(Math.floor(i.spriteSourceSize.x)/this.resolution,Math.floor(i.spriteSourceSize.y)/this.resolution,Math.floor(e.w)/this.resolution,Math.floor(e.h)/this.resolution)),this.textures[t]=new ls({ - source:this.textureSource,frame:s,orig:r,trim:n,rotate:i.rotated?2:0,defaultAnchor:i.anchor,defaultBorders:i.borders,label:t.toString()} - )} - s++} - } - _processAnimations(){ - const t=this.data.animations||{ - } - ; - for(const i in t){ - this.animations[i]=[]; - for(let s=0; - s<t[i].length; - s++){ - const e=t[i][s]; - this.animations[i].push(this.textures[e])} - } - } - _parseComplete(){ - const t=this._callback; - this._callback=null,this._batchIndex=0,t.call(this,this.textures)} - _nextBatch(){ - this._processFrames(this._batchIndex*a.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{ - this._batchIndex*a.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())} - ,0)} - destroy(t=!1){ - var i; - for(const s in this.textures)this.textures[s].destroy(); - this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&(null==(i=this._texture)||i.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]} - } - ,"_Spritesheet"),a); - jn.BATCH_SIZE=1e3; - let Kn=jn; - const zn=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"]; - function Yn(t,i,s){ - const e={ - } - ; - if(t.forEach(t=>{ - e[t]=i} - ),Object.keys(i.textures).forEach(t=>{ - e[`${ - i.cachePrefix} - ${ - t} - `]=i.textures[t]} - ),!s){ - const s=Gn.dirname(t[0]); - i.linkedSheets.forEach((t,n)=>{ - const h=Yn([`${ - s} - /${ - i.data.meta.related_multi_packs[n]} - `],t,!0); - Object.assign(e,h)} - )} - return e} - Qt(Yn,"getCacheableAssets"); - const qn={ - extension:ri.Asset,cache:{ - test:Qt(t=>t instanceof Kn,"test"),getCacheableAssets:Qt((t,i)=>Yn(t,i,!1),"getCacheableAssets")} - ,resolver:{ - extension:{ - type:ri.ResolveParser,name:"resolveSpritesheet"} - ,test:Qt(t=>{ - const i=t.split("?")[0].split("."),s=i.pop(),e=i.pop(); - return"json"===s&&zn.includes(e)} - ,"test"),parse:Qt(t=>{ - var i; - const s=t.split("."); - return{ - resolution:parseFloat((null==(i=Hn.RETINA_PREFIX.exec(t))?void 0:i[1])??"1"),format:s[s.length-2],src:t} - } - ,"parse")} - ,loader:{ - name:"spritesheetLoader",id:"spritesheet",extension:{ - type:ri.LoadParser,priority:xn.Normal,name:"spritesheetLoader"} - ,testParse:async(t,i)=>".json"===Gn.extname(i.src).toLowerCase()&&!!t.frames,async parse(t,i,s){ - var e,n; - const{ - texture:h,imageFilename:r,textureOptions:o,cachePrefix:a} - =(null==i?void 0:i.data)??{ - } - ; - let c,l=Gn.dirname(i.src); - if(l&&l.lastIndexOf("/")!==l.length-1&&(l+="/"),h instanceof ls)c=h; - else{ - const e=Vn(l+(r??t.meta.image),i.src); - c=(await s.load([{ - src:e,data:o} - ]))[e]} - const u=new Kn({ - texture:c.source,data:t,cachePrefix:a} - ); - await u.parse(); - const d=null==(e=null==t?void 0:t.meta)?void 0:e.related_multi_packs; - if(Array.isArray(d)){ - const t=[]; - for(const h of d){ - if("string"!=typeof h)continue; - let e=l+h; - (null==(n=i.data)?void 0:n.ignoreMultiPack)||(e=Vn(e,i.src),t.push(s.load({ - src:e,data:{ - textureOptions:o,ignoreMultiPack:!0} - } - )))} - const e=await Promise.all(t); - u.linkedSheets=e,e.forEach(t=>{ - t.linkedSheets=[u].concat(u.linkedSheets.filter(i=>i!==t))} - )} - return u} - ,async unload(t,i,s){ - await s.unload(t.textureSource._sourceOrigin),t.destroy(!1)} - } - } - ; - ci.add(qn); - const Xn=class{ - constructor(t){ - this._lastTransform="",this._observer=null,this._tickerAttached=!1,this.updateTranslation=()=>{ - if(!this._canvas)return; - const t=this._canvas.getBoundingClientRect(),i=this._canvas.width,s=this._canvas.height,e=t.width/i*this._renderer.resolution,n=t.height/s*this._renderer.resolution,h=`translate(${ - t.left} - px, ${ - t.top} - px) scale(${ - e} - , ${ - n} - )`; - h!==this._lastTransform&&(this._domElement.style.transform=h,this._lastTransform=h)} - ,this._domElement=t.domElement,this._renderer=t.renderer,globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas||(this._canvas=this._renderer.canvas,this._attachObserver())} - get canvas(){ - return this._canvas} - ensureAttached(){ - !this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation())} - _attachObserver(){ - "ResizeObserver"in globalThis?(this._observer&&(this._observer.disconnect(),this._observer=null),this._observer=new ResizeObserver(t=>{ - for(const i of t){ - if(i.target!==this._canvas)continue; - const t=this.canvas.width,s=this.canvas.height,e=i.contentRect.width/t*this._renderer.resolution,n=i.contentRect.height/s*this._renderer.resolution; - (this._lastScaleX!==e||this._lastScaleY!==n)&&(this.updateTranslation(),this._lastScaleX=e,this._lastScaleY=n)} - } - ),this._observer.observe(this._canvas)):this._tickerAttached||Mn.shared.add(this.updateTranslation,this,wn.HIGH)} - destroy(){ - this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&Mn.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=!1,this._lastTransform="",this._lastScaleX=null,this._lastScaleY=null} - } - ; - Qt(Xn,"CanvasObserver"); - let Jn=Xn; + ,"polyfill")(),e(H,"resolveBootGameOver"),e($,"gameOverInfoForServer");
LocalDataManager 7 hunks, 2837 statements
- function gE(t){ - throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')} - Qt(gE,"commonjsRequire$1"); - var mE={ - exports:{ - } - } - ; - const vE=gi(Object.freeze(Object.defineProperty({ - __proto__:null,default:{ - } - } - ,Symbol.toStringTag,{ - value:"Module"} - ))); - var _E; - function ME(){ - return _E||(_E=1,mE.exports=(t=t||function(t){ - var i; - if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),"undefined"!=typeof self&&self.crypto&&(i=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(i=globalThis.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==pi&&pi.crypto&&(i=pi.crypto),!i)try{ - i=vE} - catch(p){ - } - var s=Qt(function(){ - if(i){ - if("function"==typeof i.getRandomValues)try{ - return i.getRandomValues(new Uint32Array(1))[0]} - catch(p){ - } - if("function"==typeof i.randomBytes)try{ - return i.randomBytes(4).readInt32LE()} - catch(p){ - } - } - throw new Error("Native crypto module could not be used to get secure random number.")} - ,"cryptoSecureRandomInt"),e=Object.create||function(){ - function t(){ - } - return Qt(t,"F"),function(i){ - var s; - return t.prototype=i,s=new t,t.prototype=null,s} - } - (),n={ - } - ,h=n.lib={ - } - ,r=h.Base=function(){ - return{ - extend:Qt(function(t){ - var i=e(this); - return t&&i.mixIn(t),i.hasOwnProperty("init")&&this.init!==i.init||(i.init=function(){ - i.$super.init.apply(this,arguments)} - ),i.init.prototype=i,i.$super=this,i} - ,"extend"),create:Qt(function(){ - var t=this.extend(); - return t.init.apply(t,arguments),t} - ,"create"),init:Qt(function(){ - } - ,"init"),mixIn:Qt(function(t){ - for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]); - t.hasOwnProperty("toString")&&(this.toString=t.toString)} - ,"mixIn"),clone:Qt(function(){ - return this.init.prototype.extend(this)} - ,"clone")} - } - (),o=h.WordArray=r.extend({ - init:Qt(function(t,i){ - t=this.words=t||[],this.sigBytes=null!=i?i:4*t.length} - ,"init"),toString:Qt(function(t){ - return(t||c).stringify(this)} - ,"toString"),concat:Qt(function(t){ - var i=this.words,s=t.words,e=this.sigBytes,n=t.sigBytes; - if(this.clamp(),e%4)for(var h=0; - h<n; - h++){ - var r=s[h>>>2]>>>24-h%4*8&255; - i[e+h>>>2]|=r<<24-(e+h)%4*8} - else for(var o=0; - o<n; - o+=4)i[e+o>>>2]=s[o>>>2]; - return this.sigBytes+=n,this} - ,"concat"),clamp:Qt(function(){ - var i=this.words,s=this.sigBytes; - i[s>>>2]&=4294967295<<32-s%4*8,i.length=t.ceil(s/4)} - ,"clamp"),clone:Qt(function(){ - var t=r.clone.call(this); - return t.words=this.words.slice(0),t} - ,"clone"),random:Qt(function(t){ - for(var i=[],e=0; - e<t; - e+=4)i.push(s()); - return new o.init(i,t)} - ,"random")} - ),a=n.enc={ - } - ,c=a.Hex={ - stringify:Qt(function(t){ - for(var i=t.words,s=t.sigBytes,e=[],n=0; - n<s; - n++){ - var h=i[n>>>2]>>>24-n%4*8&255; - e.push((h>>>4).toString(16)),e.push((15&h).toString(16))} - return e.join("")} - ,"stringify"),parse:Qt(function(t){ - for(var i=t.length,s=[],e=0; - e<i; - e+=2)s[e>>>3]|=parseInt(t.substr(e,2),16)<<24-e%8*4; - return new o.init(s,i/2)} - ,"parse")} - ,l=a.Latin1={ - stringify:Qt(function(t){ - for(var i=t.words,s=t.sigBytes,e=[],n=0; - n<s; - n++){ - var h=i[n>>>2]>>>24-n%4*8&255; - e.push(String.fromCharCode(h))} - return e.join("")} - ,"stringify"),parse:Qt(function(t){ - for(var i=t.length,s=[],e=0; - e<i; - e++)s[e>>>2]|=(255&t.charCodeAt(e))<<24-e%4*8; - return new o.init(s,i)} - ,"parse")} - ,u=a.Utf8={ - stringify:Qt(function(t){ - try{ - return decodeURIComponent(escape(l.stringify(t)))} - catch(frt){ - throw new Error("Malformed UTF-8 data")} - } - ,"stringify"),parse:Qt(function(t){ - return l.parse(unescape(encodeURIComponent(t)))} - ,"parse")} - ,d=h.BufferedBlockAlgorithm=r.extend({ - reset:Qt(function(){ - this._data=new o.init,this._nDataBytes=0} - ,"reset"),_append:Qt(function(t){ - "string"==typeof t&&(t=u.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes} - ,"_append"),_process:Qt(function(i){ - var s,e=this._data,n=e.words,h=e.sigBytes,r=this.blockSize,a=h/(4*r),c=(a=i?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*r,l=t.min(4*c,h); - if(c){ - for(var u=0; - u<c; - u+=r)this._doProcessBlock(n,u); - s=n.splice(0,c),e.sigBytes-=l} - return new o.init(s,l)} - ,"_process"),clone:Qt(function(){ - var t=r.clone.call(this); - return t._data=this._data.clone(),t} - ,"clone"),_minBufferSize:0} - ); - h.Hasher=d.extend({ - cfg:r.extend(),init:Qt(function(t){ - this.cfg=this.cfg.extend(t),this.reset()} - ,"init"),reset:Qt(function(){ - d.reset.call(this),this._doReset()} - ,"reset"),update:Qt(function(t){ - return this._append(t),this._process(),this} - ,"update"),finalize:Qt(function(t){ - return t&&this._append(t),this._doFinalize()} - ,"finalize"),blockSize:16,_createHelper:Qt(function(t){ - return function(i,s){ - return new t.init(s).finalize(i)} - } - ,"_createHelper"),_createHmacHelper:Qt(function(t){ - return function(i,s){ - return new f.HMAC.init(t,s).finalize(i)} - } - ,"_createHmacHelper")} - ); - var f=n.algo={ - } - ; - return n} - (Math),t)),mE.exports; - var t} - Qt(ME,"requireCore"); - var bE,yE={ - exports:{ - } - } - ; - function EE(){ - return bE?yE.exports:(bE=1,yE.exports=(i=(t=h=ME()).lib,s=i.Base,e=i.WordArray,(n=t.x64={ - } - ).Word=s.extend({ - init:Qt(function(t,i){ - this.high=t,this.low=i} - ,"init")} - ),n.WordArray=s.extend({ - init:Qt(function(t,i){ - t=this.words=t||[],this.sigBytes=null!=i?i:8*t.length} - ,"init"),toX32:Qt(function(){ - for(var t=this.words,i=t.length,s=[],n=0; - n<i; - n++){ - var h=t[n]; - s.push(h.high),s.push(h.low)} - return e.create(s,this.sigBytes)} - ,"toX32"),clone:Qt(function(){ - for(var t=s.clone.call(this),i=t.words=this.words.slice(0),e=i.length,n=0; - n<e; - n++)i[n]=i[n].clone(); - return t} - ,"clone")} - ),h)); - var t,i,s,e,n,h} - Qt(EE,"requireX64Core"); - var AE,SE={ - exports:{ - } - } - ; - function TE(){ - return AE||(AE=1,SE.exports=(t=ME(),function(){ - if("function"==typeof ArrayBuffer){ - var i=t.lib.WordArray,s=i.init,e=i.init=function(t){ - if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),(t instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),t instanceof Uint8Array){ - for(var i=t.byteLength,e=[],n=0; - n<i; - n++)e[n>>>2]|=t[n]<<24-n%4*8; - s.call(this,e,i)} - else s.apply(this,arguments)} - ; - e.prototype=i} - } - (),t.lib.WordArray)),SE.exports; - var t} - Qt(TE,"requireLibTypedarrays"); - var CE,OE={ - exports:{ - } - } - ; - function IE(){ - return CE?OE.exports:(CE=1,OE.exports=(t=ME(),function(){ - var i=t,s=i.lib.WordArray,e=i.enc; - function n(t){ - return t<<8&4278255360|t>>>8&16711935} - e.Utf16=e.Utf16BE={ - stringify:Qt(function(t){ - for(var i=t.words,s=t.sigBytes,e=[],n=0; - n<s; - n+=2){ - var h=i[n>>>2]>>>16-n%4*8&65535; - e.push(String.fromCharCode(h))} - return e.join("")} - ,"stringify"),parse:Qt(function(t){ - for(var i=t.length,e=[],n=0; - n<i; - n++)e[n>>>1]|=t.charCodeAt(n)<<16-n%2*16; - return s.create(e,2*i)} - ,"parse")} - ,e.Utf16LE={ - stringify:Qt(function(t){ - for(var i=t.words,s=t.sigBytes,e=[],h=0; - h<s; - h+=2){ - var r=n(i[h>>>2]>>>16-h%4*8&65535); - e.push(String.fromCharCode(r))} - return e.join("")} - ,"stringify"),parse:Qt(function(t){ - for(var i=t.length,e=[],h=0; - h<i; - h++)e[h>>>1]|=n(t.charCodeAt(h)<<16-h%2*16); - return s.create(e,2*i)} - ,"parse")} - ,Qt(n,"swapEndian")} - (),t.enc.Utf16)); - var t} - Qt(IE,"requireEncUtf16"); - var kE,xE={ - exports:{ - } - } - ; - function RE(){ - return kE?xE.exports:(kE=1,xE.exports=(t=ME(),function(){ - var i=t,s=i.lib.WordArray; - function e(t,i,e){ - for(var n=[],h=0,r=0; - r<i; - r++)if(r%4){ - var o=e[t.charCodeAt(r-1)]<<r%4*2|e[t.charCodeAt(r)]>>>6-r%4*2; - n[h>>>2]|=o<<24-h%4*8,h++} - return s.create(n,h)} - i.enc.Base64={ - stringify:Qt(function(t){ - var i=t.words,s=t.sigBytes,e=this._map; - t.clamp(); - for(var n=[],h=0; - h<s; - h+=3)for(var r=(i[h>>>2]>>>24-h%4*8&255)<<16|(i[h+1>>>2]>>>24-(h+1)%4*8&255)<<8|i[h+2>>>2]>>>24-(h+2)%4*8&255,o=0; - o<4&&h+.75*o<s; - o++)n.push(e.charAt(r>>>6*(3-o)&63)); - var a=e.charAt(64); - if(a)for(; - n.length%4; - )n.push(a); - return n.join("")} - ,"stringify"),parse:Qt(function(t){ - var i=t.length,s=this._map,n=this._reverseMap; - if(!n){ - n=this._reverseMap=[]; - for(var h=0; - h<s.length; - h++)n[s.charCodeAt(h)]=h} - var r=s.charAt(64); - if(r){ - var o=t.indexOf(r); - -1!==o&&(i=o)} - return e(t,i,n)} - ,"parse"),_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="} - ,Qt(e,"parseLoop")} - (),t.enc.Base64)); - var t} - Qt(RE,"requireEncBase64"); - var PE,NE={ - exports:{ - } - } - ; - function LE(){ - return PE?NE.exports:(PE=1,NE.exports=(t=ME(),function(){ - var i=t,s=i.lib.WordArray; - function e(t,i,e){ - for(var n=[],h=0,r=0; - r<i; - r++)if(r%4){ - var o=e[t.charCodeAt(r-1)]<<r%4*2|e[t.charCodeAt(r)]>>>6-r%4*2; - n[h>>>2]|=o<<24-h%4*8,h++} - return s.create(n,h)} - i.enc.Base64url={ - stringify:Qt(function(t,i){ - void 0===i&&(i=!0); - var s=t.words,e=t.sigBytes,n=i?this._safe_map:this._map; - t.clamp(); - for(var h=[],r=0; - r<e; - r+=3)for(var o=(s[r>>>2]>>>24-r%4*8&255)<<16|(s[r+1>>>2]>>>24-(r+1)%4*8&255)<<8|s[r+2>>>2]>>>24-(r+2)%4*8&255,a=0; - a<4&&r+.75*a<e; - a++)h.push(n.charAt(o>>>6*(3-a)&63)); - var c=n.charAt(64); - if(c)for(; - h.length%4; - )h.push(c); - return h.join("")} - ,"stringify"),parse:Qt(function(t,i){ - void 0===i&&(i=!0); - var s=t.length,n=i?this._safe_map:this._map,h=this._reverseMap; - if(!h){ - h=this._reverseMap=[]; - for(var r=0; - r<n.length; - r++)h[n.charCodeAt(r)]=r} - var o=n.charAt(64); - if(o){ - var a=t.indexOf(o); - -1!==a&&(s=a)} - return e(t,s,h)} - ,"parse"),_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"} - ,Qt(e,"parseLoop")} - (),t.enc.Base64url)); - var t} - Qt(LE,"requireEncBase64url"); - var DE,GE={ - exports:{ - } - } - ; - function BE(){ - return DE?GE.exports:(DE=1,GE.exports=(t=ME(),function(i){ - var s=t,e=s.lib,n=e.WordArray,h=e.Hasher,r=s.algo,o=[]; - !function(){ - for(var t=0; - t<64; - t++)o[t]=4294967296*i.abs(i.sin(t+1))|0} - (); - var a=r.MD5=h.extend({ - _doReset:Qt(function(){ - this._hash=new n.init([1732584193,4023233417,2562383102,271733878])} - ,"_doReset"),_doProcessBlock:Qt(function(t,i){ - for(var s=0; - s<16; - s++){ - var e=i+s,n=t[e]; - t[e]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)} - var h=this._hash.words,r=t[i+0],a=t[i+1],f=t[i+2],p=t[i+3],w=t[i+4],g=t[i+5],m=t[i+6],v=t[i+7],_=t[i+8],M=t[i+9],b=t[i+10],y=t[i+11],E=t[i+12],A=t[i+13],S=t[i+14],T=t[i+15],C=h[0],O=h[1],I=h[2],k=h[3]; - C=c(C,O,I,k,r,7,o[0]),k=c(k,C,O,I,a,12,o[1]),I=c(I,k,C,O,f,17,o[2]),O=c(O,I,k,C,p,22,o[3]),C=c(C,O,I,k,w,7,o[4]),k=c(k,C,O,I,g,12,o[5]),I=c(I,k,C,O,m,17,o[6]),O=c(O,I,k,C,v,22,o[7]),C=c(C,O,I,k,_,7,o[8]),k=c(k,C,O,I,M,12,o[9]),I=c(I,k,C,O,b,17,o[10]),O=c(O,I,k,C,y,22,o[11]),C=c(C,O,I,k,E,7,o[12]),k=c(k,C,O,I,A,12,o[13]),I=c(I,k,C,O,S,17,o[14]),C=l(C,O=c(O,I,k,C,T,22,o[15]),I,k,a,5,o[16]),k=l(k,C,O,I,m,9,o[17]),I=l(I,k,C,O,y,14,o[18]),O=l(O,I,k,C,r,20,o[19]),C=l(C,O,I,k,g,5,o[20]),k=l(k,C,O,I,b,9,o[21]),I=l(I,k,C,O,T,14,o[22]),O=l(O,I,k,C,w,20,o[23]),C=l(C,O,I,k,M,5,o[24]),k=l(k,C,O,I,S,9,o[25]),I=l(I,k,C,O,p,14,o[26]),O=l(O,I,k,C,_,20,o[27]),C=l(C,O,I,k,A,5,o[28]),k=l(k,C,O,I,f,9,o[29]),I=l(I,k,C,O,v,14,o[30]),C=u(C,O=l(O,I,k,C,E,20,o[31]),I,k,g,4,o[32]),k=u(k,C,O,I,_,11,o[33]),I=u(I,k,C,O,y,16,o[34]),O=u(O,I,k,C,S,23,o[35]),C=u(C,O,I,k,a,4,o[36]),k=u(k,C,O,I,w,11,o[37]),I=u(I,k,C,O,v,16,o[38]),O=u(O,I,k,C,b,23,o[39]),C=u(C,O,I,k,A,4,o[40]),k=u(k,C,O,I,r,11,o[41]),I=u(I,k,C,O,p,16,o[42]),O=u(O,I,k,C,m,23,o[43]),C=u(C,O,I,k,M,4,o[44]),k=u(k,C,O,I,E,11,o[45]),I=u(I,k,C,O,T,16,o[46]),C=d(C,O=u(O,I,k,C,f,23,o[47]),I,k,r,6,o[48]),k=d(k,C,O,I,v,10,o[49]),I=d(I,k,C,O,S,15,o[50]),O=d(O,I,k,C,g,21,o[51]),C=d(C,O,I,k,E,6,o[52]),k=d(k,C,O,I,p,10,o[53]),I=d(I,k,C,O,b,15,o[54]),O=d(O,I,k,C,a,21,o[55]),C=d(C,O,I,k,_,6,o[56]),k=d(k,C,O,I,T,10,o[57]),I=d(I,k,C,O,m,15,o[58]),O=d(O,I,k,C,A,21,o[59]),C=d(C,O,I,k,w,6,o[60]),k=d(k,C,O,I,y,10,o[61]),I=d(I,k,C,O,f,15,o[62]),O=d(O,I,k,C,M,21,o[63]),h[0]=h[0]+C|0,h[1]=h[1]+O|0,h[2]=h[2]+I|0,h[3]=h[3]+k|0} - ,"_doProcessBlock"),_doFinalize:Qt(function(){ - var t=this._data,s=t.words,e=8*this._nDataBytes,n=8*t.sigBytes; - s[n>>>5]|=128<<24-n%32; - var h=i.floor(e/4294967296),r=e; - s[15+(n+64>>>9<<4)]=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),s[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(s.length+1),this._process(); - for(var o=this._hash,a=o.words,c=0; - c<4; - c++){ - var l=a[c]; - a[c]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)} - return o} - ,"_doFinalize"),clone:Qt(function(){ - var t=h.clone.call(this); - return t._hash=this._hash.clone(),t} - ,"clone")} - ); - function c(t,i,s,e,n,h,r){ - var o=t+(i&s|~i&e)+n+r; - return(o<<h|o>>>32-h)+i} - function l(t,i,s,e,n,h,r){ - var o=t+(i&e|s&~e)+n+r; - return(o<<h|o>>>32-h)+i} - function u(t,i,s,e,n,h,r){ - var o=t+(i^s^e)+n+r; - return(o<<h|o>>>32-h)+i} - function d(t,i,s,e,n,h,r){ - var o=t+(s^(i|~e))+n+r; - return(o<<h|o>>>32-h)+i} - Qt(c,"FF"),Qt(l,"GG"),Qt(u,"HH"),Qt(d,"II"),s.MD5=h._createHelper(a),s.HmacMD5=h._createHmacHelper(a)} - (Math),t.MD5)); - var t} - Qt(BE,"requireMd5"); - var UE,FE={ - exports:{ - } - } - ; - function $E(){ - return UE?FE.exports:(UE=1,FE.exports=(i=(t=o=ME()).lib,s=i.WordArray,e=i.Hasher,n=t.algo,h=[],r=n.SHA1=e.extend({ - _doReset:Qt(function(){ - this._hash=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])} - ,"_doReset"),_doProcessBlock:Qt(function(t,i){ - for(var s=this._hash.words,e=s[0],n=s[1],r=s[2],o=s[3],a=s[4],c=0; - c<80; - c++){ - if(c<16)h[c]=0|t[i+c]; - else{ - var l=h[c-3]^h[c-8]^h[c-14]^h[c-16]; - h[c]=l<<1|l>>>31} - var u=(e<<5|e>>>27)+a+h[c]; - u+=c<20?1518500249+(n&r|~n&o):c<40?1859775393+(n^r^o):c<60?(n&r|n&o|r&o)-1894007588:(n^r^o)-899497514,a=o,o=r,r=n<<30|n>>>2,n=e,e=u} - s[0]=s[0]+e|0,s[1]=s[1]+n|0,s[2]=s[2]+r|0,s[3]=s[3]+o|0,s[4]=s[4]+a|0} - ,"_doProcessBlock"),_doFinalize:Qt(function(){ - var t=this._data,i=t.words,s=8*this._nDataBytes,e=8*t.sigBytes; - return i[e>>>5]|=128<<24-e%32,i[14+(e+64>>>9<<4)]=Math.floor(s/4294967296),i[15+(e+64>>>9<<4)]=s,t.sigBytes=4*i.length,this._process(),this._hash} - ,"_doFinalize"),clone:Qt(function(){ - var t=e.clone.call(this); - return t._hash=this._hash.clone(),t} - ,"clone")} - ),t.SHA1=e._createHelper(r),t.HmacSHA1=e._createHmacHelper(r),o.SHA1)); - var t,i,s,e,n,h,r,o} - Qt($E,"requireSha1"); - var HE,WE={ - exports:{ - } - } - ; - function VE(){ - return HE?WE.exports:(HE=1,WE.exports=(t=ME(),function(i){ - var s=t,e=s.lib,n=e.WordArray,h=e.Hasher,r=s.algo,o=[],a=[]; - !function(){ - function t(t){ - for(var s=i.sqrt(t),e=2; - e<=s; - e++)if(!(t%e))return!1; - return!0} - function s(t){ - return 4294967296*(t-(0|t))|0} - Qt(t,"isPrime"),Qt(s,"getFractionalBits"); - for(var e=2,n=0; - n<64; - )t(e)&&(n<8&&(o[n]=s(i.pow(e,.5))),a[n]=s(i.pow(e,1/3)),n++),e++} - (); - var c=[],l=r.SHA256=h.extend({ - _doReset:Qt(function(){ - this._hash=new n.init(o.slice(0))} - ,"_doReset"),_doProcessBlock:Qt(function(t,i){ - for(var s=this._hash.words,e=s[0],n=s[1],h=s[2],r=s[3],o=s[4],l=s[5],u=s[6],d=s[7],f=0; - f<64; - f++){ - if(f<16)c[f]=0|t[i+f]; - else{ - var p=c[f-15],w=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=c[f-2],m=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10; - c[f]=w+c[f-7]+m+c[f-16]} - var v=e&n^e&h^n&h,_=(e<<30|e>>>2)^(e<<19|e>>>13)^(e<<10|e>>>22),M=d+((o<<26|o>>>6)^(o<<21|o>>>11)^(o<<7|o>>>25))+(o&l^~o&u)+a[f]+c[f]; - d=u,u=l,l=o,o=r+M|0,r=h,h=n,n=e,e=M+(_+v)|0} - s[0]=s[0]+e|0,s[1]=s[1]+n|0,s[2]=s[2]+h|0,s[3]=s[3]+r|0,s[4]=s[4]+o|0,s[5]=s[5]+l|0,s[6]=s[6]+u|0,s[7]=s[7]+d|0} - ,"_doProcessBlock"),_doFinalize:Qt(function(){ - var t=this._data,s=t.words,e=8*this._nDataBytes,n=8*t.sigBytes; - return s[n>>>5]|=128<<24-n%32,s[14+(n+64>>>9<<4)]=i.floor(e/4294967296),s[15+(n+64>>>9<<4)]=e,t.sigBytes=4*s.length,this._process(),this._hash} - ,"_doFinalize"),clone:Qt(function(){ - var t=h.clone.call(this); - return t._hash=this._hash.clone(),t} - ,"clone")} - ); - s.SHA256=h._createHelper(l),s.HmacSHA256=h._createHmacHelper(l)} - (Math),t.SHA256)); - var t} - Qt(VE,"requireSha256"); - var jE,KE={ - exports:{ - } - } - ; - function zE(){ - return jE?KE.exports:(jE=1,KE.exports=(h=ME(),VE(),i=(t=h).lib.WordArray,s=t.algo,e=s.SHA256,n=s.SHA224=e.extend({ - _doReset:Qt(function(){ - this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])} - ,"_doReset"),_doFinalize:Qt(function(){ - var t=e._doFinalize.call(this); - return t.sigBytes-=4,t} - ,"_doFinalize")} - ),t.SHA224=e._createHelper(n),t.HmacSHA224=e._createHmacHelper(n),h.SHA224)); - var t,i,s,e,n,h} - Qt(zE,"requireSha224"); - var YE,qE={ - exports:{ - } - } - ; - function XE(){ - return YE||(YE=1,qE.exports=(t=ME(),EE(),function(){ - var i=t,s=i.lib.Hasher,e=i.x64,n=e.Word,h=e.WordArray,r=i.algo; - function o(){ - return n.create.apply(n,arguments)} - Qt(o,"X64Word_create"); - var a=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],c=[]; - !function(){ - for(var t=0; - t<80; - t++)c[t]=o()} - (); - var l=r.SHA512=s.extend({ - _doReset:Qt(function(){ - this._hash=new h.init([new n.init(1779033703,4089235720),new n.init(3144134277,2227873595),new n.init(1013904242,4271175723),new n.init(2773480762,1595750129),new n.init(1359893119,2917565137),new n.init(2600822924,725511199),new n.init(528734635,4215389547),new n.init(1541459225,327033209)])} - ,"_doReset"),_doProcessBlock:Qt(function(t,i){ - for(var s=this._hash.words,e=s[0],n=s[1],h=s[2],r=s[3],o=s[4],l=s[5],u=s[6],d=s[7],f=e.high,p=e.low,w=n.high,g=n.low,m=h.high,v=h.low,_=r.high,M=r.low,b=o.high,y=o.low,E=l.high,A=l.low,S=u.high,T=u.low,C=d.high,O=d.low,I=f,k=p,x=w,R=g,P=m,N=v,L=_,D=M,G=b,B=y,U=E,F=A,$=S,H=T,W=C,V=O,j=0; - j<80; - j++){ - var K,z,Y=c[j]; - if(j<16)z=Y.high=0|t[i+2*j],K=Y.low=0|t[i+2*j+1]; - else{ - var q=c[j-15],X=q.high,J=q.low,Q=(X>>>1|J<<31)^(X>>>8|J<<24)^X>>>7,Z=(J>>>1|X<<31)^(J>>>8|X<<24)^(J>>>7|X<<25),tt=c[j-2],it=tt.high,st=tt.low,et=(it>>>19|st<<13)^(it<<3|st>>>29)^it>>>6,nt=(st>>>19|it<<13)^(st<<3|it>>>29)^(st>>>6|it<<26),ht=c[j-7],rt=ht.high,ot=ht.low,at=c[j-16],ct=at.high,lt=at.low; - z=(z=(z=Q+rt+((K=Z+ot)>>>0<Z>>>0?1:0))+et+((K+=nt)>>>0<nt>>>0?1:0))+ct+((K+=lt)>>>0<lt>>>0?1:0),Y.high=z,Y.low=K} - var ut,dt=G&U^~G&$,ft=B&F^~B&H,pt=I&x^I&P^x&P,wt=k&R^k&N^R&N,gt=(I>>>28|k<<4)^(I<<30|k>>>2)^(I<<25|k>>>7),mt=(k>>>28|I<<4)^(k<<30|I>>>2)^(k<<25|I>>>7),vt=(G>>>14|B<<18)^(G>>>18|B<<14)^(G<<23|B>>>9),_t=(B>>>14|G<<18)^(B>>>18|G<<14)^(B<<23|G>>>9),Mt=a[j],bt=Mt.high,yt=Mt.low,Et=W+vt+((ut=V+_t)>>>0<V>>>0?1:0),At=mt+wt; - W=$,V=H,$=U,H=F,U=G,F=B,G=L+(Et=(Et=(Et=Et+dt+((ut+=ft)>>>0<ft>>>0?1:0))+bt+((ut+=yt)>>>0<yt>>>0?1:0))+z+((ut+=K)>>>0<K>>>0?1:0))+((B=D+ut|0)>>>0<D>>>0?1:0)|0,L=P,D=N,P=x,N=R,x=I,R=k,I=Et+(gt+pt+(At>>>0<mt>>>0?1:0))+((k=ut+At|0)>>>0<ut>>>0?1:0)|0} - p=e.low=p+k,e.high=f+I+(p>>>0<k>>>0?1:0),g=n.low=g+R,n.high=w+x+(g>>>0<R>>>0?1:0),v=h.low=v+N,h.high=m+P+(v>>>0<N>>>0?1:0),M=r.low=M+D,r.high=_+L+(M>>>0<D>>>0?1:0),y=o.low=y+B,o.high=b+G+(y>>>0<B>>>0?1:0),A=l.low=A+F,l.high=E+U+(A>>>0<F>>>0?1:0),T=u.low=T+H,u.high=S+$+(T>>>0<H>>>0?1:0),O=d.low=O+V,d.high=C+W+(O>>>0<V>>>0?1:0)} - ,"_doProcessBlock"),_doFinalize:Qt(function(){ - var t=this._data,i=t.words,s=8*this._nDataBytes,e=8*t.sigBytes; - return i[e>>>5]|=128<<24-e%32,i[30+(e+128>>>10<<5)]=Math.floor(s/4294967296),i[31+(e+128>>>10<<5)]=s,t.sigBytes=4*i.length,this._process(),this._hash.toX32()} - ,"_doFinalize"),clone:Qt(function(){ - var t=s.clone.call(this); - return t._hash=this._hash.clone(),t} - ,"clone"),blockSize:32} - ); - i.SHA512=s._createHelper(l),i.HmacSHA512=s._createHmacHelper(l)} - (),t.SHA512)),qE.exports; - var t} - Qt(XE,"requireSha512"); - var JE,QE={ - exports:{ - } - } - ; - function ZE(){ - return JE?QE.exports:(JE=1,QE.exports=(o=ME(),EE(),XE(),i=(t=o).x64,s=i.Word,e=i.WordArray,n=t.algo,h=n.SHA512,r=n.SHA384=h.extend({ - _doReset:Qt(function(){ - this._hash=new e.init([new s.init(3418070365,3238371032),new s.init(1654270250,914150663),new s.init(2438529370,812702999),new s.init(355462360,4144912697),new s.init(1731405415,4290775857),new s.init(2394180231,1750603025),new s.init(3675008525,1694076839),new s.init(1203062813,3204075428)])} - ,"_doReset"),_doFinalize:Qt(function(){ - var t=h._doFinalize.call(this); - return t.sigBytes-=16,t} - ,"_doFinalize")} - ),t.SHA384=h._createHelper(r),t.HmacSHA384=h._createHmacHelper(r),o.SHA384)); - var t,i,s,e,n,h,r,o} - Qt(ZE,"requireSha384"); - var tA,iA={ - exports:{ - } - } - ; - function sA(){ - return tA?iA.exports:(tA=1,iA.exports=(t=ME(),EE(),function(i){ - var s=t,e=s.lib,n=e.WordArray,h=e.Hasher,r=s.x64.Word,o=s.algo,a=[],c=[],l=[]; - !function(){ - for(var t=1,i=0,s=0; - s<24; - s++){ - a[t+5*i]=(s+1)*(s+2)/2%64; - var e=(2*t+3*i)%5; - t=i%5,i=e} - for(t=0; - t<5; - t++)for(i=0; - i<5; - i++)c[t+5*i]=i+(2*t+3*i)%5*5; - for(var n=1,h=0; - h<24; - h++){ - for(var o=0,u=0,d=0; - d<7; - d++){ - if(1&n){ - var f=(1<<d)-1; - f<32?u^=1<<f:o^=1<<f-32} - 128&n?n=n<<1^113:n<<=1} - l[h]=r.create(o,u)} - } - (); - var u=[]; - !function(){ - for(var t=0; - t<25; - t++)u[t]=r.create()} - (); - var d=o.SHA3=h.extend({ - cfg:h.cfg.extend({ - outputLength:512} - ),_doReset:Qt(function(){ - for(var t=this._state=[],i=0; - i<25; - i++)t[i]=new r.init; - this.blockSize=(1600-2*this.cfg.outputLength)/32} - ,"_doReset"),_doProcessBlock:Qt(function(t,i){ - for(var s=this._state,e=this.blockSize/2,n=0; - n<e; - n++){ - var h=t[i+2*n],r=t[i+2*n+1]; - h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),r=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),(O=s[n]).high^=r,O.low^=h} - for(var o=0; - o<24; - o++){ - for(var d=0; - d<5; - d++){ - for(var f=0,p=0,w=0; - w<5; - w++)f^=(O=s[d+5*w]).high,p^=O.low; - var g=u[d]; - g.high=f,g.low=p} - for(d=0; - d<5; - d++){ - var m=u[(d+4)%5],v=u[(d+1)%5],_=v.high,M=v.low; - for(f=m.high^(_<<1|M>>>31),p=m.low^(M<<1|_>>>31),w=0; - w<5; - w++)(O=s[d+5*w]).high^=f,O.low^=p} - for(var b=1; - b<25; - b++){ - var y=(O=s[b]).high,E=O.low,A=a[b]; - A<32?(f=y<<A|E>>>32-A,p=E<<A|y>>>32-A):(f=E<<A-32|y>>>64-A,p=y<<A-32|E>>>64-A); - var S=u[c[b]]; - S.high=f,S.low=p} - var T=u[0],C=s[0]; - for(T.high=C.high,T.low=C.low,d=0; - d<5; - d++)for(w=0; - w<5; - w++){ - var O=s[b=d+5*w],I=u[b],k=u[(d+1)%5+5*w],x=u[(d+2)%5+5*w]; - O.high=I.high^~k.high&x.high,O.low=I.low^~k.low&x.low} - O=s[0]; - var R=l[o]; - O.high^=R.high,O.low^=R.low} - } - ,"_doProcessBlock"),_doFinalize:Qt(function(){ - var t=this._data,s=t.words; - this._nDataBytes; - var e=8*t.sigBytes,h=32*this.blockSize; - s[e>>>5]|=1<<24-e%32,s[(i.ceil((e+1)/h)*h>>>5)-1]|=128,t.sigBytes=4*s.length,this._process(); - for(var r=this._state,o=this.cfg.outputLength/8,a=o/8,c=[],l=0; - l<a; - l++){ - var u=r[l],d=u.high,f=u.low; - d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),c.push(f),c.push(d)} - return new n.init(c,o)} - ,"_doFinalize"),clone:Qt(function(){ - for(var t=h.clone.call(this),i=t._state=this._state.slice(0),s=0; - s<25; - s++)i[s]=i[s].clone(); - return t} - ,"clone")} - ); - s.SHA3=h._createHelper(d),s.HmacSHA3=h._createHmacHelper(d)} - (Math),t.SHA3)); - var t} - Qt(sA,"requireSha3"); - var eA,nA={ - exports:{ - } - } - ; - function hA(){ - return eA?nA.exports:(eA=1,nA.exports=(t=ME(),function(){ - var i=t,s=i.lib,e=s.WordArray,n=s.Hasher,h=i.algo,r=e.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),o=e.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),a=e.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),c=e.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),l=e.create([0,1518500249,1859775393,2400959708,2840853838]),u=e.create([1352829926,1548603684,1836072691,2053994217,0]),d=h.RIPEMD160=n.extend({ - _doReset:Qt(function(){ - this._hash=e.create([1732584193,4023233417,2562383102,271733878,3285377520])} - ,"_doReset"),_doProcessBlock:Qt(function(t,i){ - for(var s=0; - s<16; - s++){ - var e=i+s,n=t[e]; - t[e]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)} - var h,d,_,M,b,y,E,A,S,T,C,O=this._hash.words,I=l.words,k=u.words,x=r.words,R=o.words,P=a.words,N=c.words; - for(y=h=O[0],E=d=O[1],A=_=O[2],S=M=O[3],T=b=O[4],s=0; - s<80; - s+=1)C=h+t[i+x[s]]|0,C+=s<16?f(d,_,M)+I[0]:s<32?p(d,_,M)+I[1]:s<48?w(d,_,M)+I[2]:s<64?g(d,_,M)+I[3]:m(d,_,M)+I[4],C=(C=v(C|=0,P[s]))+b|0,h=b,b=M,M=v(_,10),_=d,d=C,C=y+t[i+R[s]]|0,C+=s<16?m(E,A,S)+k[0]:s<32?g(E,A,S)+k[1]:s<48?w(E,A,S)+k[2]:s<64?p(E,A,S)+k[3]:f(E,A,S)+k[4],C=(C=v(C|=0,N[s]))+T|0,y=T,T=S,S=v(A,10),A=E,E=C; - C=O[1]+_+S|0,O[1]=O[2]+M+T|0,O[2]=O[3]+b+y|0,O[3]=O[4]+h+E|0,O[4]=O[0]+d+A|0,O[0]=C} - ,"_doProcessBlock"),_doFinalize:Qt(function(){ - var t=this._data,i=t.words,s=8*this._nDataBytes,e=8*t.sigBytes; - i[e>>>5]|=128<<24-e%32,i[14+(e+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(i.length+1),this._process(); - for(var n=this._hash,h=n.words,r=0; - r<5; - r++){ - var o=h[r]; - h[r]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)} - return n} - ,"_doFinalize"),clone:Qt(function(){ - var t=n.clone.call(this); - return t._hash=this._hash.clone(),t} - ,"clone")} - ); - function f(t,i,s){ - return t^i^s} - function p(t,i,s){ - return t&i|~t&s} - function w(t,i,s){ - return(t|~i)^s} - function g(t,i,s){ - return t&s|i&~s} - function m(t,i,s){ - return t^(i|~s)} - function v(t,i){ - return t<<i|t>>>32-i} - Qt(f,"f1"),Qt(p,"f2"),Qt(w,"f3"),Qt(g,"f4"),Qt(m,"f5"),Qt(v,"rotl"),i.RIPEMD160=n._createHelper(d),i.HmacRIPEMD160=n._createHmacHelper(d)} - (),t.RIPEMD160)); - var t} - Qt(hA,"requireRipemd160"); - var rA,oA={ - exports:{ - } - } - ; - function aA(){ - return rA?oA.exports:(rA=1,oA.exports=(i=(t=ME()).lib.Base,s=t.enc.Utf8,void(t.algo.HMAC=i.extend({ - init:Qt(function(t,i){ - t=this._hasher=new t.init,"string"==typeof i&&(i=s.parse(i)); - var e=t.blockSize,n=4*e; - i.sigBytes>n&&(i=t.finalize(i)),i.clamp(); - for(var h=this._oKey=i.clone(),r=this._iKey=i.clone(),o=h.words,a=r.words,c=0; - c<e; - c++)o[c]^=1549556828,a[c]^=909522486; - h.sigBytes=r.sigBytes=n,this.reset()} - ,"init"),reset:Qt(function(){ - var t=this._hasher; - t.reset(),t.update(this._iKey)} - ,"reset"),update:Qt(function(t){ - return this._hasher.update(t),this} - ,"update"),finalize:Qt(function(t){ - var i=this._hasher,s=i.finalize(t); - return i.reset(),i.finalize(this._oKey.clone().concat(s))} - ,"finalize")} - )))); - var t,i,s} - Qt(aA,"requireHmac"); - var cA,lA={ - exports:{ - } - } - ; - function uA(){ - return cA?lA.exports:(cA=1,lA.exports=(a=ME(),VE(),aA(),s=(i=(t=a).lib).Base,e=i.WordArray,h=(n=t.algo).SHA256,r=n.HMAC,o=n.PBKDF2=s.extend({ - cfg:s.extend({ - keySize:4,hasher:h,iterations:25e4} - ),init:Qt(function(t){ - this.cfg=this.cfg.extend(t)} - ,"init"),compute:Qt(function(t,i){ - for(var s=this.cfg,n=r.create(s.hasher,t),h=e.create(),o=e.create([1]),a=h.words,c=o.words,l=s.keySize,u=s.iterations; - a.length<l; - ){ - var d=n.update(i).finalize(o); - n.reset(); - for(var f=d.words,p=f.length,w=d,g=1; - g<u; - g++){ - w=n.finalize(w),n.reset(); - for(var m=w.words,v=0; - v<p; - v++)f[v]^=m[v]} - h.concat(d),c[0]++} - return h.sigBytes=4*l,h} - ,"compute")} - ),t.PBKDF2=function(t,i,s){ - return o.create(s).compute(t,i)} - ,a.PBKDF2)); - var t,i,s,e,n,h,r,o,a} - Qt(uA,"requirePbkdf2"); - var dA,fA={ - exports:{ - } - } - ; - function pA(){ - return dA?fA.exports:(dA=1,fA.exports=(o=ME(),$E(),aA(),s=(i=(t=o).lib).Base,e=i.WordArray,h=(n=t.algo).MD5,r=n.EvpKDF=s.extend({ - cfg:s.extend({ - keySize:4,hasher:h,iterations:1} - ),init:Qt(function(t){ - this.cfg=this.cfg.extend(t)} - ,"init"),compute:Qt(function(t,i){ - for(var s,n=this.cfg,h=n.hasher.create(),r=e.create(),o=r.words,a=n.keySize,c=n.iterations; - o.length<a; - ){ - s&&h.update(s),s=h.update(t).finalize(i),h.reset(); - for(var l=1; - l<c; - l++)s=h.finalize(s),h.reset(); - r.concat(s)} - return r.sigBytes=4*a,r} - ,"compute")} - ),t.EvpKDF=function(t,i,s){ - return r.create(s).compute(t,i)} - ,o.EvpKDF)); - var t,i,s,e,n,h,r,o} - Qt(pA,"requireEvpkdf"); - var wA,gA={ - exports:{ - } - } - ; - function mA(){ - return wA?gA.exports:(wA=1,gA.exports=(t=ME(),pA(),void(t.lib.Cipher||function(){ - var i=t,s=i.lib,e=s.Base,n=s.WordArray,h=s.BufferedBlockAlgorithm,r=i.enc; - r.Utf8; - var o=r.Base64,a=i.algo.EvpKDF,c=s.Cipher=h.extend({ - cfg:e.extend(),createEncryptor:Qt(function(t,i){ - return this.create(this._ENC_XFORM_MODE,t,i)} - ,"createEncryptor"),createDecryptor:Qt(function(t,i){ - return this.create(this._DEC_XFORM_MODE,t,i)} - ,"createDecryptor"),init:Qt(function(t,i,s){ - this.cfg=this.cfg.extend(s),this._xformMode=t,this._key=i,this.reset()} - ,"init"),reset:Qt(function(){ - h.reset.call(this),this._doReset()} - ,"reset"),process:Qt(function(t){ - return this._append(t),this._process()} - ,"process"),finalize:Qt(function(t){ - return t&&this._append(t),this._doFinalize()} - ,"finalize"),keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){ - function t(t){ - return"string"==typeof t?v:g} - return Qt(t,"selectCipherStrategy"),function(i){ - return{ - encrypt:Qt(function(s,e,n){ - return t(e).encrypt(i,s,e,n)} - ,"encrypt"),decrypt:Qt(function(s,e,n){ - return t(e).decrypt(i,s,e,n)} - ,"decrypt")} - } - } - ()} - ); - s.StreamCipher=c.extend({ - _doFinalize:Qt(function(){ - return this._process(!0)} - ,"_doFinalize"),blockSize:1} - ); - var l=i.mode={ - } - ,u=s.BlockCipherMode=e.extend({ - createEncryptor:Qt(function(t,i){ - return this.Encryptor.create(t,i)} - ,"createEncryptor"),createDecryptor:Qt(function(t,i){ - return this.Decryptor.create(t,i)} - ,"createDecryptor"),init:Qt(function(t,i){ - this._cipher=t,this._iv=i} - ,"init")} - ),d=l.CBC=function(){ - var t=u.extend(); - function i(t,i,s){ - var e,n=this._iv; - n?(e=n,this._iv=void 0):e=this._prevBlock; - for(var h=0; - h<s; - h++)t[i+h]^=e[h]} - return t.Encryptor=t.extend({ - processBlock:Qt(function(t,s){ - var e=this._cipher,n=e.blockSize; - i.call(this,t,s,n),e.encryptBlock(t,s),this._prevBlock=t.slice(s,s+n)} - ,"processBlock")} - ),t.Decryptor=t.extend({ - processBlock:Qt(function(t,s){ - var e=this._cipher,n=e.blockSize,h=t.slice(s,s+n); - e.decryptBlock(t,s),i.call(this,t,s,n),this._prevBlock=h} - ,"processBlock")} - ),Qt(i,"xorBlock"),t} - (),f=(i.pad={ - } - ).Pkcs7={ - pad:Qt(function(t,i){ - for(var s=4*i,e=s-t.sigBytes%s,h=e<<24|e<<16|e<<8|e,r=[],o=0; - o<e; - o+=4)r.push(h); - var a=n.create(r,e); - t.concat(a)} - ,"pad"),unpad:Qt(function(t){ - var i=255&t.words[t.sigBytes-1>>>2]; - t.sigBytes-=i} - ,"unpad")} - ; - s.BlockCipher=c.extend({ - cfg:c.cfg.extend({ - mode:d,padding:f} - ),reset:Qt(function(){ - var t; - c.reset.call(this); - var i=this.cfg,s=i.iv,e=i.mode; - this._xformMode==this._ENC_XFORM_MODE?t=e.createEncryptor:(t=e.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,s&&s.words):(this._mode=t.call(e,this,s&&s.words),this._mode.__creator=t)} - ,"reset"),_doProcessBlock:Qt(function(t,i){ - this._mode.processBlock(t,i)} - ,"_doProcessBlock"),_doFinalize:Qt(function(){ - var t,i=this.cfg.padding; - return this._xformMode==this._ENC_XFORM_MODE?(i.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),i.unpad(t)),t} - ,"_doFinalize"),blockSize:4} - ); - var p=s.CipherParams=e.extend({ - init:Qt(function(t){ - this.mixIn(t)} - ,"init"),toString:Qt(function(t){ - return(t||this.formatter).stringify(this)} - ,"toString")} - ),w=(i.format={ - } - ).OpenSSL={ - stringify:Qt(function(t){ - var i=t.ciphertext,s=t.salt; - return(s?n.create([1398893684,1701076831]).concat(s).concat(i):i).toString(o)} - ,"stringify"),parse:Qt(function(t){ - var i,s=o.parse(t),e=s.words; - return 1398893684==e[0]&&1701076831==e[1]&&(i=n.create(e.slice(2,4)),e.splice(0,4),s.sigBytes-=16),p.create({ - ciphertext:s,salt:i} - )} - ,"parse")} - ,g=s.SerializableCipher=e.extend({ - cfg:e.extend({ - format:w} - ),encrypt:Qt(function(t,i,s,e){ - e=this.cfg.extend(e); - var n=t.createEncryptor(s,e),h=n.finalize(i),r=n.cfg; - return p.create({ - ciphertext:h,key:s,iv:r.iv,algorithm:t,mode:r.mode,padding:r.padding,blockSize:t.blockSize,formatter:e.format} - )} - ,"encrypt"),decrypt:Qt(function(t,i,s,e){ - return e=this.cfg.extend(e),i=this._parse(i,e.format),t.createDecryptor(s,e).finalize(i.ciphertext)} - ,"decrypt"),_parse:Qt(function(t,i){ - return"string"==typeof t?i.parse(t,this):t} - ,"_parse")} - ),m=(i.kdf={ - } - ).OpenSSL={ - execute:Qt(function(t,i,s,e,h){ - if(e||(e=n.random(8)),h)r=a.create({ - keySize:i+s,hasher:h} - ).compute(t,e); - else var r=a.create({ - keySize:i+s} - ).compute(t,e); - var o=n.create(r.words.slice(i),4*s); - return r.sigBytes=4*i,p.create({ - key:r,iv:o,salt:e} - )} - ,"execute")} - ,v=s.PasswordBasedCipher=g.extend({ - cfg:g.cfg.extend({ - kdf:m} - ),encrypt:Qt(function(t,i,s,e){ - var n=(e=this.cfg.extend(e)).kdf.execute(s,t.keySize,t.ivSize,e.salt,e.hasher); - e.iv=n.iv; - var h=g.encrypt.call(this,t,i,n.key,e); - return h.mixIn(n),h} - ,"encrypt"),decrypt:Qt(function(t,i,s,e){ - e=this.cfg.extend(e),i=this._parse(i,e.format); - var n=e.kdf.execute(s,t.keySize,t.ivSize,i.salt,e.hasher); - return e.iv=n.iv,g.decrypt.call(this,t,i,n.key,e)} - ,"decrypt")} - )} - ()))); - var t} - Qt(mA,"requireCipherCore"); - var vA,_A={ - exports:{ - } - } - ; - function MA(){ - return vA?_A.exports:(vA=1,_A.exports=(t=ME(),mA(),t.mode.CFB=function(){ - var i=t.lib.BlockCipherMode.extend(); - function s(t,i,s,e){ - var n,h=this._iv; - h?(n=h.slice(0),this._iv=void 0):n=this._prevBlock,e.encryptBlock(n,0); - for(var r=0; - r<s; - r++)t[i+r]^=n[r]} - return i.Encryptor=i.extend({ - processBlock:Qt(function(t,i){ - var e=this._cipher,n=e.blockSize; - s.call(this,t,i,n,e),this._prevBlock=t.slice(i,i+n)} - ,"processBlock")} - ),i.Decryptor=i.extend({ - processBlock:Qt(function(t,i){ - var e=this._cipher,n=e.blockSize,h=t.slice(i,i+n); - s.call(this,t,i,n,e),this._prevBlock=h} - ,"processBlock")} - ),Qt(s,"generateKeystreamAndEncrypt"),i} - (),t.mode.CFB)); - var t} - Qt(MA,"requireModeCfb"); - var bA,yA={ - exports:{ - } - } - ; - function EA(){ - return bA?yA.exports:(bA=1,yA.exports=(s=ME(),mA(),s.mode.CTR=(i=(t=s.lib.BlockCipherMode.extend()).Encryptor=t.extend({ - processBlock:Qt(function(t,i){ - var s=this._cipher,e=s.blockSize,n=this._iv,h=this._counter; - n&&(h=this._counter=n.slice(0),this._iv=void 0); - var r=h.slice(0); - s.encryptBlock(r,0),h[e-1]=h[e-1]+1|0; - for(var o=0; - o<e; - o++)t[i+o]^=r[o]} - ,"processBlock")} - ),t.Decryptor=i,t),s.mode.CTR)); - var t,i,s} - Qt(EA,"requireModeCtr"); - var AA,SA={ - exports:{ - } - } - ; - function TA(){ - return AA?SA.exports:(AA=1,SA.exports=(t=ME(),mA(),t.mode.CTRGladman=function(){ - var i=t.lib.BlockCipherMode.extend(); - function s(t){ - if(255&~(t>>24))t+=1<<24; - else{ - var i=t>>16&255,s=t>>8&255,e=255&t; - 255===i?(i=0,255===s?(s=0,255===e?e=0:++e):++s):++i,t=0,t+=i<<16,t+=s<<8,t+=e} - return t} - function e(t){ - return 0===(t[0]=s(t[0]))&&(t[1]=s(t[1])),t} - Qt(s,"incWord"),Qt(e,"incCounter"); - var n=i.Encryptor=i.extend({ - processBlock:Qt(function(t,i){ - var s=this._cipher,n=s.blockSize,h=this._iv,r=this._counter; - h&&(r=this._counter=h.slice(0),this._iv=void 0),e(r); - var o=r.slice(0); - s.encryptBlock(o,0); - for(var a=0; - a<n; - a++)t[i+a]^=o[a]} - ,"processBlock")} - ); - return i.Decryptor=n,i} - (),t.mode.CTRGladman)); - var t} - Qt(TA,"requireModeCtrGladman"); - var CA,OA={ - exports:{ - } - } - ; - function IA(){ - return CA?OA.exports:(CA=1,OA.exports=(s=ME(),mA(),s.mode.OFB=(i=(t=s.lib.BlockCipherMode.extend()).Encryptor=t.extend({ - processBlock:Qt(function(t,i){ - var s=this._cipher,e=s.blockSize,n=this._iv,h=this._keystream; - n&&(h=this._keystream=n.slice(0),this._iv=void 0),s.encryptBlock(h,0); - for(var r=0; - r<e; - r++)t[i+r]^=h[r]} - ,"processBlock")} - ),t.Decryptor=i,t),s.mode.OFB)); - var t,i,s} - Qt(IA,"requireModeOfb"); - var kA,xA={ - exports:{ - } - } - ; - function RA(){ - return kA?xA.exports:(kA=1,xA.exports=(i=ME(),mA(),i.mode.ECB=((t=i.lib.BlockCipherMode.extend()).Encryptor=t.extend({ - processBlock:Qt(function(t,i){ - this._cipher.encryptBlock(t,i)} - ,"processBlock")} - ),t.Decryptor=t.extend({ - processBlock:Qt(function(t,i){ - this._cipher.decryptBlock(t,i)} - ,"processBlock")} - ),t),i.mode.ECB)); - var t,i} - Qt(RA,"requireModeEcb"); - var PA,NA={ - exports:{ - } - } - ; - function LA(){ - return PA?NA.exports:(PA=1,NA.exports=(t=ME(),mA(),t.pad.AnsiX923={ - pad:Qt(function(t,i){ - var s=t.sigBytes,e=4*i,n=e-s%e,h=s+n-1; - t.clamp(),t.words[h>>>2]|=n<<24-h%4*8,t.sigBytes+=n} - ,"pad"),unpad:Qt(function(t){ - var i=255&t.words[t.sigBytes-1>>>2]; - t.sigBytes-=i} - ,"unpad")} - ,t.pad.Ansix923)); - var t} - Qt(LA,"requirePadAnsix923"); - var DA,GA={ - exports:{ - } - } - ; - function BA(){ - return DA?GA.exports:(DA=1,GA.exports=(t=ME(),mA(),t.pad.Iso10126={ - pad:Qt(function(i,s){ - var e=4*s,n=e-i.sigBytes%e; - i.concat(t.lib.WordArray.random(n-1)).concat(t.lib.WordArray.create([n<<24],1))} - ,"pad"),unpad:Qt(function(t){ - var i=255&t.words[t.sigBytes-1>>>2]; - t.sigBytes-=i} - ,"unpad")} - ,t.pad.Iso10126)); - var t} - Qt(BA,"requirePadIso10126"); - var UA,FA={ - exports:{ - } - } - ; - function $A(){ - return UA?FA.exports:(UA=1,FA.exports=(t=ME(),mA(),t.pad.Iso97971={ - pad:Qt(function(i,s){ - i.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(i,s)} - ,"pad"),unpad:Qt(function(i){ - t.pad.ZeroPadding.unpad(i),i.sigBytes--} - ,"unpad")} - ,t.pad.Iso97971)); - var t} - Qt($A,"requirePadIso97971"); - var HA,WA={ - exports:{ - } - } - ; - function VA(){ - return HA?WA.exports:(HA=1,WA.exports=(t=ME(),mA(),t.pad.ZeroPadding={ - pad:Qt(function(t,i){ - var s=4*i; - t.clamp(),t.sigBytes+=s-(t.sigBytes%s||s)} - ,"pad"),unpad:Qt(function(t){ - var i=t.words,s=t.sigBytes-1; - for(s=t.sigBytes-1; - s>=0; - s--)if(i[s>>>2]>>>24-s%4*8&255){ - t.sigBytes=s+1; - break} - } - ,"unpad")} - ,t.pad.ZeroPadding)); - var t} - Qt(VA,"requirePadZeropadding"); - var jA,KA={ - exports:{ - } - } - ; - function zA(){ - return jA?KA.exports:(jA=1,KA.exports=(t=ME(),mA(),t.pad.NoPadding={ - pad:Qt(function(){ - } - ,"pad"),unpad:Qt(function(){ - } - ,"unpad")} - ,t.pad.NoPadding)); - var t} - Qt(zA,"requirePadNopadding"); - var YA,qA={ - exports:{ - } - } - ; - function XA(){ - return YA?qA.exports:(YA=1,qA.exports=(e=ME(),mA(),i=(t=e).lib.CipherParams,s=t.enc.Hex,t.format.Hex={ - stringify:Qt(function(t){ - return t.ciphertext.toString(s)} - ,"stringify"),parse:Qt(function(t){ - var e=s.parse(t); - return i.create({ - ciphertext:e} - )} - ,"parse")} - ,e.format.Hex)); - var t,i,s,e} - Qt(XA,"requireFormatHex"); - var JA,QA={ - exports:{ - } - } - ; - function ZA(){ - return JA?QA.exports:(JA=1,QA.exports=(t=ME(),RE(),BE(),pA(),mA(),function(){ - var i=t,s=i.lib.BlockCipher,e=i.algo,n=[],h=[],r=[],o=[],a=[],c=[],l=[],u=[],d=[],f=[]; - !function(){ - for(var t=[],i=0; - i<256; - i++)t[i]=i<128?i<<1:i<<1^283; - var s=0,e=0; - for(i=0; - i<256; - i++){ - var p=e^e<<1^e<<2^e<<3^e<<4; - p=p>>>8^255&p^99,n[s]=p,h[p]=s; - var w=t[s],g=t[w],m=t[g],v=257*t[p]^16843008*p; - r[s]=v<<24|v>>>8,o[s]=v<<16|v>>>16,a[s]=v<<8|v>>>24,c[s]=v,v=16843009*m^65537*g^257*w^16843008*s,l[p]=v<<24|v>>>8,u[p]=v<<16|v>>>16,d[p]=v<<8|v>>>24,f[p]=v,s?(s=w^t[t[t[m^w]]],e^=t[t[e]]):s=e=1} - } - (); - var p=[0,1,2,4,8,16,32,64,128,27,54],w=e.AES=s.extend({ - _doReset:Qt(function(){ - if(!this._nRounds||this._keyPriorReset!==this._key){ - for(var t=this._keyPriorReset=this._key,i=t.words,s=t.sigBytes/4,e=4*((this._nRounds=s+6)+1),h=this._keySchedule=[],r=0; - r<e; - r++)r<s?h[r]=i[r]:(c=h[r-1],r%s?s>6&&r%s==4&&(c=n[c>>>24]<<24|n[c>>>16&255]<<16|n[c>>>8&255]<<8|n[255&c]):(c=n[(c=c<<8|c>>>24)>>>24]<<24|n[c>>>16&255]<<16|n[c>>>8&255]<<8|n[255&c],c^=p[r/s|0]<<24),h[r]=h[r-s]^c); - for(var o=this._invKeySchedule=[],a=0; - a<e; - a++){ - if(r=e-a,a%4)var c=h[r]; - else c=h[r-4]; - o[a]=a<4||r<=4?c:l[n[c>>>24]]^u[n[c>>>16&255]]^d[n[c>>>8&255]]^f[n[255&c]]} - } - } - ,"_doReset"),encryptBlock:Qt(function(t,i){ - this._doCryptBlock(t,i,this._keySchedule,r,o,a,c,n)} - ,"encryptBlock"),decryptBlock:Qt(function(t,i){ - var s=t[i+1]; - t[i+1]=t[i+3],t[i+3]=s,this._doCryptBlock(t,i,this._invKeySchedule,l,u,d,f,h),s=t[i+1],t[i+1]=t[i+3],t[i+3]=s} - ,"decryptBlock"),_doCryptBlock:Qt(function(t,i,s,e,n,h,r,o){ - for(var a=this._nRounds,c=t[i]^s[0],l=t[i+1]^s[1],u=t[i+2]^s[2],d=t[i+3]^s[3],f=4,p=1; - p<a; - p++){ - var w=e[c>>>24]^n[l>>>16&255]^h[u>>>8&255]^r[255&d]^s[f++],g=e[l>>>24]^n[u>>>16&255]^h[d>>>8&255]^r[255&c]^s[f++],m=e[u>>>24]^n[d>>>16&255]^h[c>>>8&255]^r[255&l]^s[f++],v=e[d>>>24]^n[c>>>16&255]^h[l>>>8&255]^r[255&u]^s[f++]; - c=w,l=g,u=m,d=v} - w=(o[c>>>24]<<24|o[l>>>16&255]<<16|o[u>>>8&255]<<8|o[255&d])^s[f++],g=(o[l>>>24]<<24|o[u>>>16&255]<<16|o[d>>>8&255]<<8|o[255&c])^s[f++],m=(o[u>>>24]<<24|o[d>>>16&255]<<16|o[c>>>8&255]<<8|o[255&l])^s[f++],v=(o[d>>>24]<<24|o[c>>>16&255]<<16|o[l>>>8&255]<<8|o[255&u])^s[f++],t[i]=w,t[i+1]=g,t[i+2]=m,t[i+3]=v} - ,"_doCryptBlock"),keySize:8} - ); - i.AES=s._createHelper(w)} - (),t.AES)); - var t} - Qt(ZA,"requireAes"); - var tS,iS={ - exports:{ - } - } - ; - function sS(){ - return tS?iS.exports:(tS=1,iS.exports=(t=ME(),RE(),BE(),pA(),mA(),function(){ - var i=t,s=i.lib,e=s.WordArray,n=s.BlockCipher,h=i.algo,r=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],o=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],a=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{ - 0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378} - ,{ - 0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672} - ,{ - 0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792} - ,{ - 0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464} - ,{ - 0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040} - ,{ - 0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656} - ,{ - 0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577} - ,{ - 0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848} - ],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],u=h.DES=n.extend({ - _doReset:Qt(function(){ - for(var t=this._key.words,i=[],s=0; - s<56; - s++){ - var e=r[s]-1; - i[s]=t[e>>>5]>>>31-e%32&1} - for(var n=this._subKeys=[],h=0; - h<16; - h++){ - var c=n[h]=[],l=a[h]; - for(s=0; - s<24; - s++)c[s/6|0]|=i[(o[s]-1+l)%28]<<31-s%6,c[4+(s/6|0)]|=i[28+(o[s+24]-1+l)%28]<<31-s%6; - for(c[0]=c[0]<<1|c[0]>>>31,s=1; - s<7; - s++)c[s]=c[s]>>>4*(s-1)+3; - c[7]=c[7]<<5|c[7]>>>27} - var u=this._invSubKeys=[]; - for(s=0; - s<16; - s++)u[s]=n[15-s]} - ,"_doReset"),encryptBlock:Qt(function(t,i){ - this._doCryptBlock(t,i,this._subKeys)} - ,"encryptBlock"),decryptBlock:Qt(function(t,i){ - this._doCryptBlock(t,i,this._invSubKeys)} - ,"decryptBlock"),_doCryptBlock:Qt(function(t,i,s){ - this._lBlock=t[i],this._rBlock=t[i+1],d.call(this,4,252645135),d.call(this,16,65535),f.call(this,2,858993459),f.call(this,8,16711935),d.call(this,1,1431655765); - for(var e=0; - e<16; - e++){ - for(var n=s[e],h=this._lBlock,r=this._rBlock,o=0,a=0; - a<8; - a++)o|=c[a][((r^n[a])&l[a])>>>0]; - this._lBlock=r,this._rBlock=h^o} - var u=this._lBlock; - this._lBlock=this._rBlock,this._rBlock=u,d.call(this,1,1431655765),f.call(this,8,16711935),f.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),t[i]=this._lBlock,t[i+1]=this._rBlock} - ,"_doCryptBlock"),keySize:2,ivSize:2,blockSize:2} - ); - function d(t,i){ - var s=(this._lBlock>>>t^this._rBlock)&i; - this._rBlock^=s,this._lBlock^=s<<t} - function f(t,i){ - var s=(this._rBlock>>>t^this._lBlock)&i; - this._lBlock^=s,this._rBlock^=s<<t} - Qt(d,"exchangeLR"),Qt(f,"exchangeRL"),i.DES=n._createHelper(u); - var p=h.TripleDES=n.extend({ - _doReset:Qt(function(){ - var t=this._key.words; - if(2!==t.length&&4!==t.length&&t.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192."); - var i=t.slice(0,2),s=t.length<4?t.slice(0,2):t.slice(2,4),n=t.length<6?t.slice(0,2):t.slice(4,6); - this._des1=u.createEncryptor(e.create(i)),this._des2=u.createEncryptor(e.create(s)),this._des3=u.createEncryptor(e.create(n))} - ,"_doReset"),encryptBlock:Qt(function(t,i){ - this._des1.encryptBlock(t,i),this._des2.decryptBlock(t,i),this._des3.encryptBlock(t,i)} - ,"encryptBlock"),decryptBlock:Qt(function(t,i){ - this._des3.decryptBlock(t,i),this._des2.encryptBlock(t,i),this._des1.decryptBlock(t,i)} - ,"decryptBlock"),keySize:6,ivSize:2,blockSize:2} - ); - i.TripleDES=n._createHelper(p)} - (),t.TripleDES)); - var t} - Qt(sS,"requireTripledes"); - var eS,nS={ - exports:{ - } - } - ; - function hS(){ - return eS?nS.exports:(eS=1,nS.exports=(t=ME(),RE(),BE(),pA(),mA(),function(){ - var i=t,s=i.lib.StreamCipher,e=i.algo,n=e.RC4=s.extend({ - _doReset:Qt(function(){ - for(var t=this._key,i=t.words,s=t.sigBytes,e=this._S=[],n=0; - n<256; - n++)e[n]=n; - n=0; - for(var h=0; - n<256; - n++){ - var r=n%s,o=i[r>>>2]>>>24-r%4*8&255; - h=(h+e[n]+o)%256; - var a=e[n]; - e[n]=e[h],e[h]=a} - this._i=this._j=0} - ,"_doReset"),_doProcessBlock:Qt(function(t,i){ - t[i]^=h.call(this)} - ,"_doProcessBlock"),keySize:8,ivSize:0} - ); - function h(){ - for(var t=this._S,i=this._i,s=this._j,e=0,n=0; - n<4; - n++){ - s=(s+t[i=(i+1)%256])%256; - var h=t[i]; - t[i]=t[s],t[s]=h,e|=t[(t[i]+t[s])%256]<<24-8*n} - return this._i=i,this._j=s,e} - Qt(h,"generateKeystreamWord"),i.RC4=s._createHelper(n); - var r=e.RC4Drop=n.extend({ - cfg:n.cfg.extend({ - drop:192} - ),_doReset:Qt(function(){ - n._doReset.call(this); - for(var t=this.cfg.drop; - t>0; - t--)h.call(this)} - ,"_doReset")} - ); - i.RC4Drop=s._createHelper(r)} - (),t.RC4)); - var t} - Qt(hS,"requireRc4"); - var rS,oS={ - exports:{ - } - } - ; - function aS(){ - return rS?oS.exports:(rS=1,oS.exports=(t=ME(),RE(),BE(),pA(),mA(),function(){ - var i=t,s=i.lib.StreamCipher,e=i.algo,n=[],h=[],r=[],o=e.Rabbit=s.extend({ - _doReset:Qt(function(){ - for(var t=this._key.words,i=this.cfg.iv,s=0; - s<4; - s++)t[s]=16711935&(t[s]<<8|t[s]>>>24)|4278255360&(t[s]<<24|t[s]>>>8); - var e=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],n=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]]; - for(this._b=0,s=0; - s<4; - s++)a.call(this); - for(s=0; - s<8; - s++)n[s]^=e[s+4&7]; - if(i){ - var h=i.words,r=h[0],o=h[1],c=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),l=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=c>>>16|4294901760&l,d=l<<16|65535&c; - for(n[0]^=c,n[1]^=u,n[2]^=l,n[3]^=d,n[4]^=c,n[5]^=u,n[6]^=l,n[7]^=d,s=0; - s<4; - s++)a.call(this)} - } - ,"_doReset"),_doProcessBlock:Qt(function(t,i){ - var s=this._X; - a.call(this),n[0]=s[0]^s[5]>>>16^s[3]<<16,n[1]=s[2]^s[7]>>>16^s[5]<<16,n[2]=s[4]^s[1]>>>16^s[7]<<16,n[3]=s[6]^s[3]>>>16^s[1]<<16; - for(var e=0; - e<4; - e++)n[e]=16711935&(n[e]<<8|n[e]>>>24)|4278255360&(n[e]<<24|n[e]>>>8),t[i+e]^=n[e]} - ,"_doProcessBlock"),blockSize:4,ivSize:2} - ); - function a(){ - for(var t=this._X,i=this._C,s=0; - s<8; - s++)h[s]=i[s]; - for(i[0]=i[0]+1295307597+this._b|0,i[1]=i[1]+3545052371+(i[0]>>>0<h[0]>>>0?1:0)|0,i[2]=i[2]+886263092+(i[1]>>>0<h[1]>>>0?1:0)|0,i[3]=i[3]+1295307597+(i[2]>>>0<h[2]>>>0?1:0)|0,i[4]=i[4]+3545052371+(i[3]>>>0<h[3]>>>0?1:0)|0,i[5]=i[5]+886263092+(i[4]>>>0<h[4]>>>0?1:0)|0,i[6]=i[6]+1295307597+(i[5]>>>0<h[5]>>>0?1:0)|0,i[7]=i[7]+3545052371+(i[6]>>>0<h[6]>>>0?1:0)|0,this._b=i[7]>>>0<h[7]>>>0?1:0,s=0; - s<8; - s++){ - var e=t[s]+i[s],n=65535&e,o=e>>>16,a=((n*n>>>17)+n*o>>>15)+o*o,c=((4294901760&e)*e|0)+((65535&e)*e|0); - r[s]=a^c} - t[0]=r[0]+(r[7]<<16|r[7]>>>16)+(r[6]<<16|r[6]>>>16)|0,t[1]=r[1]+(r[0]<<8|r[0]>>>24)+r[7]|0,t[2]=r[2]+(r[1]<<16|r[1]>>>16)+(r[0]<<16|r[0]>>>16)|0,t[3]=r[3]+(r[2]<<8|r[2]>>>24)+r[1]|0,t[4]=r[4]+(r[3]<<16|r[3]>>>16)+(r[2]<<16|r[2]>>>16)|0,t[5]=r[5]+(r[4]<<8|r[4]>>>24)+r[3]|0,t[6]=r[6]+(r[5]<<16|r[5]>>>16)+(r[4]<<16|r[4]>>>16)|0,t[7]=r[7]+(r[6]<<8|r[6]>>>24)+r[5]|0} - Qt(a,"nextState"),i.Rabbit=s._createHelper(o)} - (),t.Rabbit)); - var t} - Qt(aS,"requireRabbit"); - var cS,lS={ - exports:{ - } - } - ; - function uS(){ - return cS?lS.exports:(cS=1,lS.exports=(t=ME(),RE(),BE(),pA(),mA(),function(){ - var i=t,s=i.lib.StreamCipher,e=i.algo,n=[],h=[],r=[],o=e.RabbitLegacy=s.extend({ - _doReset:Qt(function(){ - var t=this._key.words,i=this.cfg.iv,s=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],e=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]]; - this._b=0; - for(var n=0; - n<4; - n++)a.call(this); - for(n=0; - n<8; - n++)e[n]^=s[n+4&7]; - if(i){ - var h=i.words,r=h[0],o=h[1],c=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),l=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),u=c>>>16|4294901760&l,d=l<<16|65535&c; - for(e[0]^=c,e[1]^=u,e[2]^=l,e[3]^=d,e[4]^=c,e[5]^=u,e[6]^=l,e[7]^=d,n=0; - n<4; - n++)a.call(this)} - } - ,"_doReset"),_doProcessBlock:Qt(function(t,i){ - var s=this._X; - a.call(this),n[0]=s[0]^s[5]>>>16^s[3]<<16,n[1]=s[2]^s[7]>>>16^s[5]<<16,n[2]=s[4]^s[1]>>>16^s[7]<<16,n[3]=s[6]^s[3]>>>16^s[1]<<16; - for(var e=0; - e<4; - e++)n[e]=16711935&(n[e]<<8|n[e]>>>24)|4278255360&(n[e]<<24|n[e]>>>8),t[i+e]^=n[e]} - ,"_doProcessBlock"),blockSize:4,ivSize:2} - ); - function a(){ - for(var t=this._X,i=this._C,s=0; - s<8; - s++)h[s]=i[s]; - for(i[0]=i[0]+1295307597+this._b|0,i[1]=i[1]+3545052371+(i[0]>>>0<h[0]>>>0?1:0)|0,i[2]=i[2]+886263092+(i[1]>>>0<h[1]>>>0?1:0)|0,i[3]=i[3]+1295307597+(i[2]>>>0<h[2]>>>0?1:0)|0,i[4]=i[4]+3545052371+(i[3]>>>0<h[3]>>>0?1:0)|0,i[5]=i[5]+886263092+(i[4]>>>0<h[4]>>>0?1:0)|0,i[6]=i[6]+1295307597+(i[5]>>>0<h[5]>>>0?1:0)|0,i[7]=i[7]+3545052371+(i[6]>>>0<h[6]>>>0?1:0)|0,this._b=i[7]>>>0<h[7]>>>0?1:0,s=0; - s<8; - s++){ - var e=t[s]+i[s],n=65535&e,o=e>>>16,a=((n*n>>>17)+n*o>>>15)+o*o,c=((4294901760&e)*e|0)+((65535&e)*e|0); - r[s]=a^c} - t[0]=r[0]+(r[7]<<16|r[7]>>>16)+(r[6]<<16|r[6]>>>16)|0,t[1]=r[1]+(r[0]<<8|r[0]>>>24)+r[7]|0,t[2]=r[2]+(r[1]<<16|r[1]>>>16)+(r[0]<<16|r[0]>>>16)|0,t[3]=r[3]+(r[2]<<8|r[2]>>>24)+r[1]|0,t[4]=r[4]+(r[3]<<16|r[3]>>>16)+(r[2]<<16|r[2]>>>16)|0,t[5]=r[5]+(r[4]<<8|r[4]>>>24)+r[3]|0,t[6]=r[6]+(r[5]<<16|r[5]>>>16)+(r[4]<<16|r[4]>>>16)|0,t[7]=r[7]+(r[6]<<8|r[6]>>>24)+r[5]|0} - Qt(a,"nextState"),i.RabbitLegacy=s._createHelper(o)} - (),t.RabbitLegacy)); - var t} - Qt(uS,"requireRabbitLegacy"); - var dS,fS,pS={ - exports:{ - } - } - ; - function wS(){ - return dS?pS.exports:(dS=1,pS.exports=(t=ME(),RE(),BE(),pA(),mA(),function(){ - var i=t,s=i.lib.BlockCipher,e=i.algo; - const n=16,h=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],r=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]]; - var o={ - pbox:[],sbox:[]} - ; - function a(t,i){ - let s=i>>24&255,e=i>>16&255,n=i>>8&255,h=255&i,r=t.sbox[0][s]+t.sbox[1][e]; - return r^=t.sbox[2][n],r+=t.sbox[3][h],r} - function c(t,i,s){ - let e,h=i,r=s; - for(let o=0; - o<n; - ++o)h^=t.pbox[o],r=a(t,h)^r,e=h,h=r,r=e; - return e=h,h=r,r=e,r^=t.pbox[16],h^=t.pbox[17],{ - left:h,right:r} - } - function l(t,i,s){ - let e,n=i,h=s; - for(let r=17; - r>1; - --r)n^=t.pbox[r],h=a(t,n)^h,e=n,n=h,h=e; - return e=n,n=h,h=e,h^=t.pbox[1],n^=t.pbox[0],{ - left:n,right:h} - } - function u(t,i,s){ - for(let h=0; - h<4; - h++){ - t.sbox[h]=[]; - for(let i=0; - i<256; - i++)t.sbox[h][i]=r[h][i]} - let e=0; - for(let r=0; - r<18; - r++)t.pbox[r]=h[r]^i[e],e++,e>=s&&(e=0); - let n=0,o=0,a=0; - for(let h=0; - h<18; - h+=2)a=c(t,n,o),n=a.left,o=a.right,t.pbox[h]=n,t.pbox[h+1]=o; - for(let h=0; - h<4; - h++)for(let i=0; - i<256; - i+=2)a=c(t,n,o),n=a.left,o=a.right,t.sbox[h][i]=n,t.sbox[h][i+1]=o; - return!0} - Qt(a,"F"),Qt(c,"BlowFish_Encrypt"),Qt(l,"BlowFish_Decrypt"),Qt(u,"BlowFishInit"); - var d=e.Blowfish=s.extend({ - _doReset:Qt(function(){ - if(this._keyPriorReset!==this._key){ - var t=this._keyPriorReset=this._key,i=t.words,s=t.sigBytes/4; - u(o,i,s)} - } - ,"_doReset"),encryptBlock:Qt(function(t,i){ - var s=c(o,t[i],t[i+1]); - t[i]=s.left,t[i+1]=s.right} - ,"encryptBlock"),decryptBlock:Qt(function(t,i){ - var s=l(o,t[i],t[i+1]); - t[i]=s.left,t[i+1]=s.right} - ,"decryptBlock"),blockSize:2,keySize:4,ivSize:2} - ); - i.Blowfish=s._createHelper(d)} - (),t.Blowfish)); - var t} - Qt(wS,"requireBlowfish"); - var gS={ - exports:{ - } - } - .exports=(fS=ME(),EE(),TE(),IE(),RE(),LE(),BE(),$E(),VE(),zE(),XE(),ZE(),sA(),hA(),aA(),uA(),pA(),mA(),MA(),EA(),TA(),IA(),RA(),LA(),BA(),$A(),VA(),zA(),XA(),ZA(),sS(),hS(),aS(),uS(),wS(),fS); - const mS=wi(gS); - var vS={ - exports:{ - } - } - ; - vS.exports=Qt(function t(i,s,e){ - function n(r,o){ - if(!s[r]){ - if(!i[r]){ - if(!o&&gE)return gE(r); - if(h)return h(r,!0); - var a=new Error("Cannot find module '"+r+"'"); - throw a.code="MODULE_NOT_FOUND",a} - var c=s[r]={ - exports:{ - } - } - ; - i[r][0].call(c.exports,function(t){ - return n(i[r][1][t]||t)} - ,c,c.exports,t,i,s,e)} - return s[r].exports} - Qt(n,"s"); - for(var h=gE,r=0; - r<e.length; - r++)n(e[r]); - return n} - ,"e")({ - 1:[function(t,i,s){ - (function(t){ - var s,e,n=t.MutationObserver||t.WebKitMutationObserver; - if(n){ - var h=0,r=new n(l),o=t.document.createTextNode(""); - r.observe(o,{ - characterData:!0} - ),s=Qt(function(){ - o.data=h=++h%2} - ,"scheduleDrain")} - else if(t.setImmediate||void 0===t.MessageChannel)s="document"in t&&"onreadystatechange"in t.document.createElement("script")?Qt(function(){ - var i=t.document.createElement("script"); - i.onreadystatechange=function(){ - l(),i.onreadystatechange=null,i.parentNode.removeChild(i),i=null} - ,t.document.documentElement.appendChild(i)} - ,"scheduleDrain"):Qt(function(){ - setTimeout(l,0)} - ,"scheduleDrain"); - else{ - var a=new t.MessageChannel; - a.port1.onmessage=l,s=Qt(function(){ - a.port2.postMessage(0)} - ,"scheduleDrain")} - var c=[]; - function l(){ - var t,i; - e=!0; - for(var s=c.length; - s; - ){ - for(i=c,c=[],t=-1; - ++t<s; - )i[t](); - s=c.length} - e=!1} - function u(t){ - 1!==c.push(t)||e||s()} - Qt(l,"nextTick"),i.exports=u,Qt(u,"immediate")} - ).call(this,void 0!==pi?pi:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{ - } - )} - ,{ - } - ],2:[function(t,i,s){ - var e=t(1); - function n(){ - } - Qt(n,"INTERNAL"); - var h={ - } - ,r=["REJECTED"],o=["FULFILLED"],a=["PENDING"]; - function c(t){ - if("function"!=typeof t)throw new TypeError("resolver must be a function"); - this.state=a,this.queue=[],this.outcome=void 0,t!==n&&f(this,t)} - function l(t,i,s){ - this.promise=t,"function"==typeof i&&(this.onFulfilled=i,this.callFulfilled=this.otherCallFulfilled),"function"==typeof s&&(this.onRejected=s,this.callRejected=this.otherCallRejected)} - function u(t,i,s){ - e(function(){ - var e; - try{ - e=i(s)} - catch(frt){ - return h.reject(t,frt)} - e===t?h.reject(t,new TypeError("Cannot resolve promise with itself")):h.resolve(t,e)} - )} - function d(t){ - var i=t&&t.then; - if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof i)return Qt(function(){ - i.apply(t,arguments)} - ,"appyThen")} - function f(t,i){ - var s=!1; - function e(i){ - s||(s=!0,h.reject(t,i))} - function n(i){ - s||(s=!0,h.resolve(t,i))} - function r(){ - i(n,e)} - Qt(e,"onError"),Qt(n,"onSuccess"),Qt(r,"tryToUnwrap"); - var o=p(r); - "error"===o.status&&e(o.value)} - function p(t,i){ - var s={ - } - ; - try{ - s.value=t(i),s.status="success"} - catch(frt){ - s.status="error",s.value=frt} - return s} - function w(t){ - return t instanceof this?t:h.resolve(new this(n),t)} - function g(t){ - var i=new this(n); - return h.reject(i,t)} - function m(t){ - var i=this; - if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array")); - var s=t.length,e=!1; - if(!s)return this.resolve([]); - for(var r=new Array(s),o=0,a=-1,c=new this(n); - ++a<s; - )l(t[a],a); - return c; - function l(t,n){ - function a(t){ - r[n]=t,++o!==s||e||(e=!0,h.resolve(c,r))} - i.resolve(t).then(a,function(t){ - e||(e=!0,h.reject(c,t))} - ),Qt(a,"resolveFromAll")} - } - function v(t){ - var i=this; - if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array")); - var s=t.length,e=!1; - if(!s)return this.resolve([]); - for(var r=-1,o=new this(n); - ++r<s; - )a(t[r]); - return o; - function a(t){ - i.resolve(t).then(function(t){ - e||(e=!0,h.resolve(o,t))} - ,function(t){ - e||(e=!0,h.reject(o,t))} - )} - } - i.exports=c,Qt(c,"Promise"),c.prototype.catch=function(t){ - return this.then(null,t)} - ,c.prototype.then=function(t,i){ - if("function"!=typeof t&&this.state===o||"function"!=typeof i&&this.state===r)return this; - var s=new this.constructor(n); - return this.state!==a?u(s,this.state===o?t:i,this.outcome):this.queue.push(new l(s,t,i)),s} - ,Qt(l,"QueueItem"),l.prototype.callFulfilled=function(t){ - h.resolve(this.promise,t)} - ,l.prototype.otherCallFulfilled=function(t){ - u(this.promise,this.onFulfilled,t)} - ,l.prototype.callRejected=function(t){ - h.reject(this.promise,t)} - ,l.prototype.otherCallRejected=function(t){ - u(this.promise,this.onRejected,t)} - ,Qt(u,"unwrap"),h.resolve=function(t,i){ - var s=p(d,i); - if("error"===s.status)return h.reject(t,s.value); - var e=s.value; - if(e)f(t,e); - else{ - t.state=o,t.outcome=i; - for(var n=-1,r=t.queue.length; - ++n<r; - )t.queue[n].callFulfilled(i)} - return t} - ,h.reject=function(t,i){ - t.state=r,t.outcome=i; - for(var s=-1,e=t.queue.length; - ++s<e; - )t.queue[s].callRejected(i); - return t} - ,Qt(d,"getThen"),Qt(f,"safelyResolveThenable"),Qt(p,"tryCatch"),c.resolve=w,Qt(w,"resolve"),c.reject=g,Qt(g,"reject"),c.all=m,Qt(m,"all"),c.race=v,Qt(v,"race")} - ,{ - 1:1} - ],3:[function(t,i,s){ - (function(i){ - "function"!=typeof i.Promise&&(i.Promise=t(2))} - ).call(this,void 0!==pi?pi:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{ - } - )} - ,{ - 2:2} - ],4:[function(t,i,s){ - var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){ - return typeof t} - :function(t){ - return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t} - ; - function n(t,i){ - if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")} - function h(){ - try{ - if("undefined"!=typeof indexedDB)return indexedDB; - if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB; - if("undefined"!=typeof mozIndexedDB)return mozIndexedDB; - if("undefined"!=typeof OIndexedDB)return OIndexedDB; - if("undefined"!=typeof msIndexedDB)return msIndexedDB} - catch(frt){ - return} - } - Qt(n,"_classCallCheck"),Qt(h,"getIDB"); - var r=h(); - function o(){ - try{ - if(!r||!r.open)return!1; - var t="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),i="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code"); - return(!t||i)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange} - catch(frt){ - return!1} - } - function a(t,i){ - t=t||[],i=i||{ - } - ; - try{ - return new Blob(t,i)} - catch(frt){ - if("TypeError"!==frt.name)throw frt; - for(var s=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),e=0; - e<t.length; - e+=1)s.append(t[e]); - return s.getBlob(i.type)} - } - Qt(o,"isIndexedDBValid"),Qt(a,"createBlob"),"undefined"==typeof Promise&&t(3); - var c=Promise; - function l(t,i){ - i&&t.then(function(t){ - i(null,t)} - ,function(t){ - i(t)} - )} - function u(t,i,s){ - "function"==typeof i&&t.then(i),"function"==typeof s&&t.catch(s)} - function d(t){ - return"string"!=typeof t&&(t=String(t)),t} - function f(){ - if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]} - Qt(l,"executeCallback"),Qt(u,"executeTwoCallbacks"),Qt(d,"normalizeKey"),Qt(f,"getCallback"); - var p="local-forage-detect-blob-support",w=void 0,g={ - } - ,m=Object.prototype.toString,v="readonly",_="readwrite"; - function M(t){ - for(var i=t.length,s=new ArrayBuffer(i),e=new Uint8Array(s),n=0; - n<i; - n++)e[n]=t.charCodeAt(n); - return s} - function b(t){ - return new c(function(i){ - var s=t.transaction(p,_),e=a([""]); - s.objectStore(p).put(e,"key"),s.onabort=function(t){ - t.preventDefault(),t.stopPropagation(),i(!1)} - ,s.oncomplete=function(){ - var t=navigator.userAgent.match(/Chrome\/(\d+)/),s=navigator.userAgent.match(/Edge\//); - i(s||!t||parseInt(t[1],10)>=43)} - } - ).catch(function(){ - return!1} - )} - function y(t){ - return"boolean"==typeof w?c.resolve(w):b(t).then(function(t){ - return w=t} - )} - function E(t){ - var i=g[t.name],s={ - } - ; - s.promise=new c(function(t,i){ - s.resolve=t,s.reject=i} - ),i.deferredOperations.push(s),i.dbReady?i.dbReady=i.dbReady.then(function(){ - return s.promise} - ):i.dbReady=s.promise} - function A(t){ - var i=g[t.name].deferredOperations.pop(); - if(i)return i.resolve(),i.promise} - function S(t,i){ - var s=g[t.name].deferredOperations.pop(); - if(s)return s.reject(i),s.promise} - function T(t,i){ - return new c(function(s,e){ - if(g[t.name]=g[t.name]||{ - forages:[],db:null,dbReady:null,deferredOperations:[]} - ,t.db){ - if(!i)return s(t.db); - E(t),t.db.close()} - var n=[t.name]; - i&&n.push(t.version); - var h=r.open.apply(r,n); - i&&(h.onupgradeneeded=function(i){ - var s=h.result; - try{ - s.createObjectStore(t.storeName),i.oldVersion<=1&&s.createObjectStore(p)} - catch(e){ - if("ConstraintError"!==e.name)throw e} - } - ),h.onerror=function(t){ - t.preventDefault(),e(h.error)} - ,h.onsuccess=function(){ - var i=h.result; - i.onversionchange=function(t){ - t.target.close()} - ,s(i),A(t)} - } - )} - function C(t){ - return T(t,!1)} - function O(t){ - return T(t,!0)} - function I(t,i){ - if(!t.db)return!0; - var s=!t.db.objectStoreNames.contains(t.storeName),e=t.version<t.db.version,n=t.version>t.db.version; - if(e&&(t.version,t.version=t.db.version),n||s){ - if(s){ - var h=t.db.version+1; - h>t.version&&(t.version=h)} - return!0} - return!1} - function k(t){ - return new c(function(i,s){ - var e=new FileReader; - e.onerror=s,e.onloadend=function(s){ - var e=btoa(s.target.result||""); - i({ - __local_forage_encoded_blob:!0,data:e,type:t.type} - )} - ,e.readAsBinaryString(t)} - )} - function x(t){ - return a([M(atob(t.data))],{ - type:t.type} - )} - function R(t){ - return t&&t.__local_forage_encoded_blob} - function P(t){ - var i=this,s=i._initReady().then(function(){ - var t=g[i._dbInfo.name]; - if(t&&t.dbReady)return t.dbReady} - ); - return u(s,t,t),s} - function N(t){ - E(t); - for(var i=g[t.name],s=i.forages,e=0; - e<s.length; - e++){ - var n=s[e]; - n._dbInfo.db&&(n._dbInfo.db.close(),n._dbInfo.db=null)} - return t.db=null,C(t).then(function(i){ - return t.db=i,I(t)?O(t):i} - ).then(function(e){ - t.db=i.db=e; - for(var n=0; - n<s.length; - n++)s[n]._dbInfo.db=e} - ).catch(function(i){ - throw S(t,i),i} - )} - function L(t,i,s,e){ - void 0===e&&(e=1); - try{ - var n=t.db.transaction(t.storeName,i); - s(null,n)} - catch(h){ - if(e>0&&(!t.db||"InvalidStateError"===h.name||"NotFoundError"===h.name))return c.resolve().then(function(){ - if(!t.db||"NotFoundError"===h.name&&!t.db.objectStoreNames.contains(t.storeName)&&t.version<=t.db.version)return t.db&&(t.version=t.db.version+1),O(t)} - ).then(function(){ - return N(t).then(function(){ - L(t,i,s,e-1)} - )} - ).catch(s); - s(h)} - } - function D(){ - return{ - forages:[],db:null,dbReady:null,deferredOperations:[]} - } - function G(t){ - var i=this,s={ - db:null} - ; - if(t)for(var e in t)s[e]=t[e]; - var n=g[s.name]; - n||(n={ - forages:[],db:null,dbReady:null,deferredOperations:[]} - ,g[s.name]=n),n.forages.push(i),i._initReady||(i._initReady=i.ready,i.ready=P); - var h=[]; - function r(){ - return c.resolve()} - Qt(r,"ignoreErrors"); - for(var o=0; - o<n.forages.length; - o++){ - var a=n.forages[o]; - a!==i&&h.push(a._initReady().catch(r))} - var l=n.forages.slice(0); - return c.all(h).then(function(){ - return s.db=n.db,C(s)} - ).then(function(t){ - return s.db=t,I(s,i._defaultConfig.version)?O(s):t} - ).then(function(t){ - s.db=n.db=t,i._dbInfo=s; - for(var e=0; - e<l.length; - e++){ - var h=l[e]; - h!==i&&(h._dbInfo.db=s.db,h._dbInfo.version=s.version)} - } - )} - function B(t,i){ - var s=this; - t=d(t); - var e=new c(function(i,e){ - s.ready().then(function(){ - L(s._dbInfo,v,function(n,h){ - if(n)return e(n); - try{ - var r=h.objectStore(s._dbInfo.storeName).get(t); - r.onsuccess=function(){ - var t=r.result; - void 0===t&&(t=null),R(t)&&(t=x(t)),i(t)} - ,r.onerror=function(){ - e(r.error)} - } - catch(frt){ - e(frt)} - } - )} - ).catch(e)} - ); - return l(e,i),e} - function U(t,i){ - var s=this,e=new c(function(i,e){ - s.ready().then(function(){ - L(s._dbInfo,v,function(n,h){ - if(n)return e(n); - try{ - var r=h.objectStore(s._dbInfo.storeName).openCursor(),o=1; - r.onsuccess=function(){ - var s=r.result; - if(s){ - var e=s.value; - R(e)&&(e=x(e)); - var n=t(e,s.key,o++); - void 0!==n?i(n):s.continue()} - else i()} - ,r.onerror=function(){ - e(r.error)} - } - catch(frt){ - e(frt)} - } - )} - ).catch(e)} - ); - return l(e,i),e} - function F(t,i,s){ - var e=this; - t=d(t); - var n=new c(function(s,n){ - var h; - e.ready().then(function(){ - return h=e._dbInfo,"[object Blob]"===m.call(i)?y(h.db).then(function(t){ - return t?i:k(i)} - ):i} - ).then(function(i){ - L(e._dbInfo,_,function(h,r){ - if(h)return n(h); - try{ - var o=r.objectStore(e._dbInfo.storeName); - null===i&&(i=void 0); - var a=o.put(i,t); - r.oncomplete=function(){ - void 0===i&&(i=null),s(i)} - ,r.onabort=r.onerror=function(){ - var t=a.error?a.error:a.transaction.error; - n(t)} - } - catch(frt){ - n(frt)} - } - )} - ).catch(n)} - ); - return l(n,s),n} - function $(t,i){ - var s=this; - t=d(t); - var e=new c(function(i,e){ - s.ready().then(function(){ - L(s._dbInfo,_,function(n,h){ - if(n)return e(n); - try{ - var r=h.objectStore(s._dbInfo.storeName).delete(t); - h.oncomplete=function(){ - i()} - ,h.onerror=function(){ - e(r.error)} - ,h.onabort=function(){ - var t=r.error?r.error:r.transaction.error; - e(t)} - } - catch(frt){ - e(frt)} - } - )} - ).catch(e)} - ); - return l(e,i),e} - function H(t){ - var i=this,s=new c(function(t,s){ - i.ready().then(function(){ - L(i._dbInfo,_,function(e,n){ - if(e)return s(e); - try{ - var h=n.objectStore(i._dbInfo.storeName).clear(); - n.oncomplete=function(){ - t()} - ,n.onabort=n.onerror=function(){ - var t=h.error?h.error:h.transaction.error; - s(t)} - } - catch(frt){ - s(frt)} - } - )} - ).catch(s)} - ); - return l(s,t),s} - function W(t){ - var i=this,s=new c(function(t,s){ - i.ready().then(function(){ - L(i._dbInfo,v,function(e,n){ - if(e)return s(e); - try{ - var h=n.objectStore(i._dbInfo.storeName).count(); - h.onsuccess=function(){ - t(h.result)} - ,h.onerror=function(){ - s(h.error)} - } - catch(frt){ - s(frt)} - } - )} - ).catch(s)} - ); - return l(s,t),s} - function V(t,i){ - var s=this,e=new c(function(i,e){ - t<0?i(null):s.ready().then(function(){ - L(s._dbInfo,v,function(n,h){ - if(n)return e(n); - try{ - var r=h.objectStore(s._dbInfo.storeName),o=!1,a=r.openKeyCursor(); - a.onsuccess=function(){ - var s=a.result; - s?0===t||o?i(s.key):(o=!0,s.advance(t)):i(null)} - ,a.onerror=function(){ - e(a.error)} - } - catch(frt){ - e(frt)} - } - )} - ).catch(e)} - ); - return l(e,i),e} - function j(t){ - var i=this,s=new c(function(t,s){ - i.ready().then(function(){ - L(i._dbInfo,v,function(e,n){ - if(e)return s(e); - try{ - var h=n.objectStore(i._dbInfo.storeName).openKeyCursor(),r=[]; - h.onsuccess=function(){ - var i=h.result; - i?(r.push(i.key),i.continue()):t(r)} - ,h.onerror=function(){ - s(h.error)} - } - catch(frt){ - s(frt)} - } - )} - ).catch(s)} - ); - return l(s,t),s} - function K(t,i){ - i=f.apply(this,arguments); - var s=this.config(); - (t="function"!=typeof t&&t||{ - } - ).name||(t.name=t.name||s.name,t.storeName=t.storeName||s.storeName); - var e; - if(t.name){ - var n=t.name===s.name&&this._dbInfo.db?c.resolve(this._dbInfo.db):C(t).then(function(i){ - var s=g[t.name],e=s.forages; - s.db=i; - for(var n=0; - n<e.length; - n++)e[n]._dbInfo.db=i; - return i} - ); - e=t.storeName?n.then(function(i){ - if(i.objectStoreNames.contains(t.storeName)){ - var s=i.version+1; - E(t); - var e=g[t.name],n=e.forages; - i.close(); - for(var h=0; - h<n.length; - h++){ - var o=n[h]; - o._dbInfo.db=null,o._dbInfo.version=s} - return new c(function(i,e){ - var n=r.open(t.name,s); - n.onerror=function(t){ - n.result.close(),e(t)} - ,n.onupgradeneeded=function(){ - n.result.deleteObjectStore(t.storeName)} - ,n.onsuccess=function(){ - var t=n.result; - t.close(),i(t)} - } - ).then(function(t){ - e.db=t; - for(var i=0; - i<n.length; - i++){ - var s=n[i]; - s._dbInfo.db=t,A(s._dbInfo)} - } - ).catch(function(i){ - throw(S(t,i)||c.resolve()).catch(function(){ - } - ),i} - )} - } - ):n.then(function(i){ - E(t); - var s=g[t.name],e=s.forages; - i.close(); - for(var n=0; - n<e.length; - n++)e[n]._dbInfo.db=null; - return new c(function(i,s){ - var e=r.deleteDatabase(t.name); - e.onerror=function(){ - var t=e.result; - t&&t.close(),s(e.error)} - ,e.onblocked=function(){ - } - ,e.onsuccess=function(){ - var t=e.result; - t&&t.close(),i(t)} - } - ).then(function(t){ - s.db=t; - for(var i=0; - i<e.length; - i++)A(e[i]._dbInfo)} - ).catch(function(i){ - throw(S(t,i)||c.resolve()).catch(function(){ - } - ),i} - )} - )} - else e=c.reject("Invalid arguments"); - return l(e,i),e} - Qt(M,"_binStringToArrayBuffer"),Qt(b,"_checkBlobSupportWithoutCaching"),Qt(y,"_checkBlobSupport"),Qt(E,"_deferReadiness"),Qt(A,"_advanceReadiness"),Qt(S,"_rejectReadiness"),Qt(T,"_getConnection"),Qt(C,"_getOriginalConnection"),Qt(O,"_getUpgradedConnection"),Qt(I,"_isUpgradeNeeded"),Qt(k,"_encodeBlob"),Qt(x,"_decodeBlob"),Qt(R,"_isEncodedBlob"),Qt(P,"_fullyReady"),Qt(N,"_tryReconnect"),Qt(L,"createTransaction"),Qt(D,"createDbContext"),Qt(G,"_initStorage"),Qt(B,"getItem"),Qt(U,"iterate"),Qt(F,"setItem"),Qt($,"removeItem"),Qt(H,"clear"),Qt(W,"length"),Qt(V,"key"),Qt(j,"keys"),Qt(K,"dropInstance"); - var z={ - _driver:"asyncStorage",_initStorage:G,_support:o(),iterate:U,getItem:B,setItem:F,removeItem:$,clear:H,length:W,key:V,keys:j,dropInstance:K} - ; - function Y(){ - return"function"==typeof openDatabase} - Qt(Y,"isWebSQLValid"); - var q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",X=/^~~local_forage_type~([^~]+)~/,J="__lfsc__:",Q="arbf",Z="blob",tt="si08",it="ui08",st="uic8",et="si16",nt="si32",ht="ur16",rt="ui32",ot="fl32",at="fl64",ct=Object.prototype.toString; - function lt(t){ - var i,s,e,n,h,r=.75*t.length,o=t.length,a=0; - "="===t[t.length-1]&&(r--,"="===t[t.length-2]&&r--); - var c=new ArrayBuffer(r),l=new Uint8Array(c); - for(i=0; - i<o; - i+=4)s=q.indexOf(t[i]),e=q.indexOf(t[i+1]),n=q.indexOf(t[i+2]),h=q.indexOf(t[i+3]),l[a++]=s<<2|e>>4,l[a++]=(15&e)<<4|n>>2,l[a++]=(3&n)<<6|63&h; - return c} - function ut(t){ - var i,s=new Uint8Array(t),e=""; - for(i=0; - i<s.length; - i+=3)e+=q[s[i]>>2],e+=q[(3&s[i])<<4|s[i+1]>>4],e+=q[(15&s[i+1])<<2|s[i+2]>>6],e+=q[63&s[i+2]]; - return s.length%3==2?e=e.substring(0,e.length-1)+"=":s.length%3==1&&(e=e.substring(0,e.length-2)+"=="),e} - function dt(t,i){ - var s=""; - if(t&&(s=ct.call(t)),t&&("[object ArrayBuffer]"===s||t.buffer&&"[object ArrayBuffer]"===ct.call(t.buffer))){ - var e,n=J; - t instanceof ArrayBuffer?(e=t,n+=Q):(e=t.buffer,"[object Int8Array]"===s?n+=tt:"[object Uint8Array]"===s?n+=it:"[object Uint8ClampedArray]"===s?n+=st:"[object Int16Array]"===s?n+=et:"[object Uint16Array]"===s?n+=ht:"[object Int32Array]"===s?n+=nt:"[object Uint32Array]"===s?n+=rt:"[object Float32Array]"===s?n+=ot:"[object Float64Array]"===s?n+=at:i(new Error("Failed to get type for BinaryArray"))),i(n+ut(e))} - else if("[object Blob]"===s){ - var h=new FileReader; - h.onload=function(){ - var s="~~local_forage_type~"+t.type+"~"+ut(this.result); - i(J+Z+s)} - ,h.readAsArrayBuffer(t)} - else try{ - i(JSON.stringify(t))} - catch(frt){ - i(null,frt)} - } - function ft(t){ - if(t.substring(0,9)!==J)return JSON.parse(t); - var i,s=t.substring(13),e=t.substring(9,13); - if(e===Z&&X.test(s)){ - var n=s.match(X); - i=n[1],s=s.substring(n[0].length)} - var h=lt(s); - switch(e){ - case Q:return h; - case Z:return a([h],{ - type:i} - ); - case tt:return new Int8Array(h); - case it:return new Uint8Array(h); - case st:return new Uint8ClampedArray(h); - case et:return new Int16Array(h); - case ht:return new Uint16Array(h); - case nt:return new Int32Array(h); - case rt:return new Uint32Array(h); - case ot:return new Float32Array(h); - case at:return new Float64Array(h); - default:throw new Error("Unkown type: "+e)} - } - Qt(lt,"stringToBuffer"),Qt(ut,"bufferToString"),Qt(dt,"serialize"),Qt(ft,"deserialize"); - var pt={ - serialize:dt,deserialize:ft,stringToBuffer:lt,bufferToString:ut} - ; - function wt(t,i,s,e){ - t.executeSql("CREATE TABLE IF NOT EXISTS "+i.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],s,e)} - function gt(t){ - var i=this,s={ - db:null} - ; - if(t)for(var e in t)s[e]="string"!=typeof t[e]?t[e].toString():t[e]; - var n=new c(function(t,e){ - try{ - s.db=openDatabase(s.name,String(s.version),s.description,s.size)} - catch(frt){ - return e(frt)} - s.db.transaction(function(n){ - wt(n,s,function(){ - i._dbInfo=s,t()} - ,function(t,i){ - e(i)} - )} - ,e)} - ); - return s.serializer=pt,n} - function mt(t,i,s,e,n,h){ - t.executeSql(s,e,n,function(t,r){ - r.code===r.SYNTAX_ERR?t.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[i.storeName],function(t,o){ - o.rows.length?h(t,r):wt(t,i,function(){ - t.executeSql(s,e,n,h)} - ,h)} - ,h):h(t,r)} - ,h)} - function vt(t,i){ - var s=this; - t=d(t); - var e=new c(function(i,e){ - s.ready().then(function(){ - var n=s._dbInfo; - n.db.transaction(function(s){ - mt(s,n,"SELECT * FROM "+n.storeName+" WHERE key = ? LIMIT 1",[t],function(t,s){ - var e=s.rows.length?s.rows.item(0).value:null; - e&&(e=n.serializer.deserialize(e)),i(e)} - ,function(t,i){ - e(i)} - )} - )} - ).catch(e)} - ); - return l(e,i),e} - function _t(t,i){ - var s=this,e=new c(function(i,e){ - s.ready().then(function(){ - var n=s._dbInfo; - n.db.transaction(function(s){ - mt(s,n,"SELECT * FROM "+n.storeName,[],function(s,e){ - for(var h=e.rows,r=h.length,o=0; - o<r; - o++){ - var a=h.item(o),c=a.value; - if(c&&(c=n.serializer.deserialize(c)),void 0!==(c=t(c,a.key,o+1)))return void i(c)} - i()} - ,function(t,i){ - e(i)} - )} - )} - ).catch(e)} - ); - return l(e,i),e} - function Mt(t,i,s,e){ - var n=this; - t=d(t); - var h=new c(function(h,r){ - n.ready().then(function(){ - void 0===i&&(i=null); - var o=i,a=n._dbInfo; - a.serializer.serialize(i,function(i,c){ - c?r(c):a.db.transaction(function(s){ - mt(s,a,"INSERT OR REPLACE INTO "+a.storeName+" (key, value) VALUES (?, ?)",[t,i],function(){ - h(o)} - ,function(t,i){ - r(i)} - )} - ,function(i){ - if(i.code===i.QUOTA_ERR){ - if(e>0)return void h(Mt.apply(n,[t,o,s,e-1])); - r(i)} - } - )} - )} - ).catch(r)} - ); - return l(h,s),h} - function bt(t,i,s){ - return Mt.apply(this,[t,i,s,1])} - function yt(t,i){ - var s=this; - t=d(t); - var e=new c(function(i,e){ - s.ready().then(function(){ - var n=s._dbInfo; - n.db.transaction(function(s){ - mt(s,n,"DELETE FROM "+n.storeName+" WHERE key = ?",[t],function(){ - i()} - ,function(t,i){ - e(i)} - )} - )} - ).catch(e)} - ); - return l(e,i),e} - function Et(t){ - var i=this,s=new c(function(t,s){ - i.ready().then(function(){ - var e=i._dbInfo; - e.db.transaction(function(i){ - mt(i,e,"DELETE FROM "+e.storeName,[],function(){ - t()} - ,function(t,i){ - s(i)} - )} - )} - ).catch(s)} - ); - return l(s,t),s} - function At(t){ - var i=this,s=new c(function(t,s){ - i.ready().then(function(){ - var e=i._dbInfo; - e.db.transaction(function(i){ - mt(i,e,"SELECT COUNT(key) as c FROM "+e.storeName,[],function(i,s){ - var e=s.rows.item(0).c; - t(e)} - ,function(t,i){ - s(i)} - )} - )} - ).catch(s)} - ); - return l(s,t),s} - function St(t,i){ - var s=this,e=new c(function(i,e){ - s.ready().then(function(){ - var n=s._dbInfo; - n.db.transaction(function(s){ - mt(s,n,"SELECT key FROM "+n.storeName+" WHERE id = ? LIMIT 1",[t+1],function(t,s){ - var e=s.rows.length?s.rows.item(0).key:null; - i(e)} - ,function(t,i){ - e(i)} - )} - )} - ).catch(e)} - ); - return l(e,i),e} - function Tt(t){ - var i=this,s=new c(function(t,s){ - i.ready().then(function(){ - var e=i._dbInfo; - e.db.transaction(function(i){ - mt(i,e,"SELECT key FROM "+e.storeName,[],function(i,s){ - for(var e=[],n=0; - n<s.rows.length; - n++)e.push(s.rows.item(n).key); - t(e)} - ,function(t,i){ - s(i)} - )} - )} - ).catch(s)} - ); - return l(s,t),s} - function Ct(t){ - return new c(function(i,s){ - t.transaction(function(e){ - e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(s,e){ - for(var n=[],h=0; - h<e.rows.length; - h++)n.push(e.rows.item(h).name); - i({ - db:t,storeNames:n} - )} - ,function(t,i){ - s(i)} - )} - ,function(t){ - s(t)} - )} - )} - function Ot(t,i){ - i=f.apply(this,arguments); - var s=this.config(); - (t="function"!=typeof t&&t||{ - } - ).name||(t.name=t.name||s.name,t.storeName=t.storeName||s.storeName); - var e,n=this; - return l(e=t.name?new c(function(i){ - var e; - e=t.name===s.name?n._dbInfo.db:openDatabase(t.name,"","",0),t.storeName?i({ - db:e,storeNames:[t.storeName]} - ):i(Ct(e))} - ).then(function(t){ - return new c(function(i,s){ - t.db.transaction(function(e){ - function n(t){ - return new c(function(i,s){ - e.executeSql("DROP TABLE IF EXISTS "+t,[],function(){ - i()} - ,function(t,i){ - s(i)} - )} - )} - Qt(n,"dropTable"); - for(var h=[],r=0,o=t.storeNames.length; - r<o; - r++)h.push(n(t.storeNames[r])); - c.all(h).then(function(){ - i()} - ).catch(function(t){ - s(t)} - )} - ,function(t){ - s(t)} - )} - )} - ):c.reject("Invalid arguments"),i),e} - Qt(wt,"createDbTable"),Qt(gt,"_initStorage$1"),Qt(mt,"tryExecuteSql"),Qt(vt,"getItem$1"),Qt(_t,"iterate$1"),Qt(Mt,"_setItem"),Qt(bt,"setItem$1"),Qt(yt,"removeItem$1"),Qt(Et,"clear$1"),Qt(At,"length$1"),Qt(St,"key$1"),Qt(Tt,"keys$1"),Qt(Ct,"getAllStoreNames"),Qt(Ot,"dropInstance$1"); - var It={ - _driver:"webSQLStorage",_initStorage:gt,_support:Y(),iterate:_t,getItem:vt,setItem:bt,removeItem:yt,clear:Et,length:At,key:St,keys:Tt,dropInstance:Ot} - ; - function kt(){ - try{ - return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem} - catch(frt){ - return!1} - } - function xt(t,i){ - var s=t.name+"/"; - return t.storeName!==i.storeName&&(s+=t.storeName+"/"),s} - function Rt(){ - var t="_localforage_support_test"; - try{ - return localStorage.setItem(t,!0),localStorage.removeItem(t),!1} - catch(frt){ - return!0} - } - function Pt(){ - return!Rt()||localStorage.length>0} - function Nt(t){ - var i={ - } - ; - if(t)for(var s in t)i[s]=t[s]; - return i.keyPrefix=xt(t,this._defaultConfig),Pt()?(this._dbInfo=i,i.serializer=pt,c.resolve()):c.reject()} - function Lt(t){ - var i=this,s=i.ready().then(function(){ - for(var t=i._dbInfo.keyPrefix,s=localStorage.length-1; - s>=0; - s--){ - var e=localStorage.key(s); - 0===e.indexOf(t)&&localStorage.removeItem(e)} - } - ); - return l(s,t),s} - function Dt(t,i){ - var s=this; - t=d(t); - var e=s.ready().then(function(){ - var i=s._dbInfo,e=localStorage.getItem(i.keyPrefix+t); - return e&&(e=i.serializer.deserialize(e)),e} - ); - return l(e,i),e} - function Gt(t,i){ - var s=this,e=s.ready().then(function(){ - for(var i=s._dbInfo,e=i.keyPrefix,n=e.length,h=localStorage.length,r=1,o=0; - o<h; - o++){ - var a=localStorage.key(o); - if(0===a.indexOf(e)){ - var c=localStorage.getItem(a); - if(c&&(c=i.serializer.deserialize(c)),void 0!==(c=t(c,a.substring(n),r++)))return c} - } - } - ); - return l(e,i),e} - function Bt(t,i){ - var s=this,e=s.ready().then(function(){ - var i,e=s._dbInfo; - try{ - i=localStorage.key(t)} - catch(n){ - i=null} - return i&&(i=i.substring(e.keyPrefix.length)),i} - ); - return l(e,i),e} - function Ut(t){ - var i=this,s=i.ready().then(function(){ - for(var t=i._dbInfo,s=localStorage.length,e=[],n=0; - n<s; - n++){ - var h=localStorage.key(n); - 0===h.indexOf(t.keyPrefix)&&e.push(h.substring(t.keyPrefix.length))} - return e} - ); - return l(s,t),s} - function Ft(t){ - var i=this.keys().then(function(t){ - return t.length} - ); - return l(i,t),i} - function $t(t,i){ - var s=this; - t=d(t); - var e=s.ready().then(function(){ - var i=s._dbInfo; - localStorage.removeItem(i.keyPrefix+t)} - ); - return l(e,i),e} - function Ht(t,i,s){ - var e=this; - t=d(t); - var n=e.ready().then(function(){ - void 0===i&&(i=null); - var s=i; - return new c(function(n,h){ - var r=e._dbInfo; - r.serializer.serialize(i,function(i,e){ - if(e)h(e); - else try{ - localStorage.setItem(r.keyPrefix+t,i),n(s)} - catch(frt){ - "QuotaExceededError"!==frt.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==frt.name||h(frt),h(frt)} - } - )} - )} - ); - return l(n,s),n} - function Wt(t,i){ - if(i=f.apply(this,arguments),!(t="function"!=typeof t&&t||{ - } - ).name){ - var s=this.config(); - t.name=t.name||s.name,t.storeName=t.storeName||s.storeName} - var e,n=this; - return l(e=t.name?new c(function(i){ - t.storeName?i(xt(t,n._defaultConfig)):i(t.name+"/")} - ).then(function(t){ - for(var i=localStorage.length-1; - i>=0; - i--){ - var s=localStorage.key(i); - 0===s.indexOf(t)&&localStorage.removeItem(s)} - } - ):c.reject("Invalid arguments"),i),e} - Qt(kt,"isLocalStorageValid"),Qt(xt,"_getKeyPrefix"),Qt(Rt,"checkIfLocalStorageThrows"),Qt(Pt,"_isLocalStorageUsable"),Qt(Nt,"_initStorage$2"),Qt(Lt,"clear$2"),Qt(Dt,"getItem$2"),Qt(Gt,"iterate$2"),Qt(Bt,"key$2"),Qt(Ut,"keys$2"),Qt(Ft,"length$2"),Qt($t,"removeItem$2"),Qt(Ht,"setItem$2"),Qt(Wt,"dropInstance$2"); - var Vt={ - _driver:"localStorageWrapper",_initStorage:Nt,_support:kt(),iterate:Gt,getItem:Dt,setItem:Ht,removeItem:$t,clear:Lt,length:Ft,key:Bt,keys:Ut,dropInstance:Wt} - ,jt=Qt(function(t,i){ - return t===i||"number"==typeof t&&"number"==typeof i&&isNaN(t)&&isNaN(i)} - ,"sameValue"),Kt=Qt(function(t,i){ - for(var s=t.length,e=0; - e<s; - ){ - if(jt(t[e],i))return!0; - e++} - return!1} - ,"includes"),zt=Array.isArray||function(t){ - return"[object Array]"===Object.prototype.toString.call(t)} - ,Yt={ - } - ,qt={ - } - ,Xt={ - INDEXEDDB:z,WEBSQL:It,LOCALSTORAGE:Vt} - ,Jt=[Xt.INDEXEDDB._driver,Xt.WEBSQL._driver,Xt.LOCALSTORAGE._driver],Zt=["dropInstance"],ti=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Zt),ii={ - description:"",driver:Jt.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1} - ; - function si(t,i){ - t[i]=function(){ - var s=arguments; - return t.ready().then(function(){ - return t[i].apply(t,s)} - )} - } - function ei(){ - for(var t=1; - t<arguments.length; - t++){ - var i=arguments[t]; - if(i)for(var s in i)i.hasOwnProperty(s)&&(zt(i[s])?arguments[0][s]=i[s].slice():arguments[0][s]=i[s])} - return arguments[0]} - Qt(si,"callWhenReady"),Qt(ei,"extend"); - var ni=function(){ - function t(i){ - for(var s in n(this,t),Xt)if(Xt.hasOwnProperty(s)){ - var e=Xt[s],h=e._driver; - this[s]=h,Yt[h]||this.defineDriver(e)} - this._defaultConfig=ei({ - } - ,ii),this._config=ei({ - } - ,this._defaultConfig,i),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){ - } - )} - return Qt(t,"LocalForage"),t.prototype.config=Qt(function(t){ - if("object"===(void 0===t?"undefined":e(t))){ - if(this._ready)return new Error("Can't call config() after localforage has been used."); - for(var i in t){ - if("storeName"===i&&(t[i]=t[i].replace(/\W/g,"_")),"version"===i&&"number"!=typeof t[i])return new Error("Database version must be a number."); - this._config[i]=t[i]} - return!("driver"in t)||!t.driver||this.setDriver(this._config.driver)} - return"string"==typeof t?this._config[t]:this._config} - ,"config"),t.prototype.defineDriver=Qt(function(t,i,s){ - var e=new c(function(i,s){ - try{ - var e=t._driver,n=new Error("Custom driver not compliant; - see https://mozilla.github.io/localForage/#definedriver"); - if(!t._driver)return void s(n); - for(var h=ti.concat("_initStorage"),r=0,o=h.length; - r<o; - r++){ - var a=h[r]; - if((!Kt(Zt,a)||t[a])&&"function"!=typeof t[a])return void s(n)} - var u=Qt(function(){ - for(var i=Qt(function(t){ - return function(){ - var i=new Error("Method "+t+" is not implemented by the current driver"),s=c.reject(i); - return l(s,arguments[arguments.length-1]),s} - } - ,"methodNotImplementedFactory"),s=0,e=Zt.length; - s<e; - s++){ - var n=Zt[s]; - t[n]||(t[n]=i(n))} - } - ,"configureMissingMethods"); - u(); - var d=Qt(function(s){ - Yt[e],Yt[e]=t,qt[e]=s,i()} - ,"setDriverSupport"); - "_support"in t?t._support&&"function"==typeof t._support?t._support().then(d,s):d(!!t._support):d(!0)} - catch(frt){ - s(frt)} - } - ); - return u(e,i,s),e} - ,"defineDriver"),t.prototype.driver=Qt(function(){ - return this._driver||null} - ,"driver"),t.prototype.getDriver=Qt(function(t,i,s){ - var e=Yt[t]?c.resolve(Yt[t]):c.reject(new Error("Driver not found.")); - return u(e,i,s),e} - ,"getDriver"),t.prototype.getSerializer=Qt(function(t){ - var i=c.resolve(pt); - return u(i,t),i} - ,"getSerializer"),t.prototype.ready=Qt(function(t){ - var i=this,s=i._driverSet.then(function(){ - return null===i._ready&&(i._ready=i._initDriver()),i._ready} - ); - return u(s,t,t),s} - ,"ready"),t.prototype.setDriver=Qt(function(t,i,s){ - var e=this; - zt(t)||(t=[t]); - var n=this._getSupportedDrivers(t); - function h(){ - e._config.driver=e.driver()} - function r(t){ - return e._extend(t),h(),e._ready=e._initStorage(e._config),e._ready} - function o(t){ - return function(){ - var i=0; - function s(){ - for(; - i<t.length; - ){ - var n=t[i]; - return i++,e._dbInfo=null,e._ready=null,e.getDriver(n).then(r).catch(s)} - h(); - var o=new Error("No available storage method found."); - return e._driverSet=c.reject(o),e._driverSet} - return Qt(s,"driverPromiseLoop"),s()} - } - Qt(h,"setDriverToConfig"),Qt(r,"extendSelfWithDriver"),Qt(o,"initDriver"); - var a=null!==this._driverSet?this._driverSet.catch(function(){ - return c.resolve()} - ):c.resolve(); - return this._driverSet=a.then(function(){ - var t=n[0]; - return e._dbInfo=null,e._ready=null,e.getDriver(t).then(function(t){ - e._driver=t._driver,h(),e._wrapLibraryMethodsWithReady(),e._initDriver=o(n)} - )} - ).catch(function(){ - h(); - var t=new Error("No available storage method found."); - return e._driverSet=c.reject(t),e._driverSet} - ),u(this._driverSet,i,s),this._driverSet} - ,"setDriver"),t.prototype.supports=Qt(function(t){ - return!!qt[t]} - ,"supports"),t.prototype._extend=Qt(function(t){ - ei(this,t)} - ,"_extend"),t.prototype._getSupportedDrivers=Qt(function(t){ - for(var i=[],s=0,e=t.length; - s<e; - s++){ - var n=t[s]; - this.supports(n)&&i.push(n)} - return i} - ,"_getSupportedDrivers"),t.prototype._wrapLibraryMethodsWithReady=Qt(function(){ - for(var t=0,i=ti.length; - t<i; - t++)si(this,ti[t])} - ,"_wrapLibraryMethodsWithReady"),t.prototype.createInstance=Qt(function(i){ - return new t(i)} - ,"createInstance"),t} - (),hi=new ni; - i.exports=hi} - ,{ - 3:3} - ]} - ,{ - } - ,[4])(4); - var _S=vS.exports; - const MS=wi(_S),bS=class t{ + const X=class t{
- =await Promise.resolve().then(()=>Fpi); + =await import("./chunks/vendor-misc.js").then(t=>t.v);
- ,void 0); + ,__vite__mapDeps([0,1,2]),import.meta.url);
- =await Promise.resolve().then(()=>Fpi); + =await import("./chunks/vendor-misc.js").then(t=>t.v);
- ,void 0); + ,__vite__mapDeps([0,1,2]),import.meta.url);
+ static async getHeroAutoEnabled(){ + const t=this.getKey("hAuto"); + return await this.getData(t)} + static async setHeroAutoEnabled(t){ + const s=this.getKey("hAuto"); + await this.saveData(s,t)}
- Qt(bS,"LocalDataManager"),Zt(bS,"encryptionKey",null),Zt(bS,"BASE_KEY","EF2_DEFAULT_KEY_2025"),Zt(bS,"CREDS_LF_KEY",bS.getKey("aC")),Zt(bS,"CREDS_LS_KEY","EF2_ACB"),Zt(bS,"CREDS_NATIVE_KEY","ef2_account_creds"),Zt(bS,"KEY_GAME_OVER",bS.getKey("gO")),Zt(bS,"KEY_RALLY_POINTS",bS.getKey("rP")),Zt(bS,"KEY_DIALOGUE_COUNT",bS.getKey("dC")),Zt(bS,"KEY_MINI_ASCENT_PENDING",bS.getKey("mPvePending")),Zt(bS,"KEY_MINI_ASCENT_FORMATION",bS.getKey("mPveFormation")),Zt(bS,"KEY_AUTO_POWER_SAVE",bS.getKey("aPS")),Zt(bS,"BASE","EF2_STORAGE_"),Zt(bS,"SALT","e1z7sf2h"),Zt(bS,"KEYS",{ + e(X,"LocalDataManager"),n(X,"encryptionKey",null),n(X,"BASE_KEY","EF2_DEFAULT_KEY_2025"),n(X,"CREDS_LF_KEY",X.getKey("aC")),n(X,"CREDS_LS_KEY","EF2_ACB"),n(X,"CREDS_NATIVE_KEY","ef2_account_creds"),n(X,"KEY_GAME_OVER",X.getKey("gO")),n(X,"KEY_RALLY_POINTS",X.getKey("rP")),n(X,"KEY_DIALOGUE_COUNT",X.getKey("dC")),n(X,"KEY_MINI_ASCENT_PENDING",X.getKey("mPvePending")),n(X,"KEY_MINI_ASCENT_FORMATION",X.getKey("mPveFormation")),n(X,"KEY_AUTO_POWER_SAVE",X.getKey("aPS")),n(X,"KEY_AUTO_REBIRTH",X.getKey("aRb")),n(X,"BASE","EF2_STORAGE_"),n(X,"SALT","e1z7sf2h"),n(X,"KEYS",{
Animation 1 hunks, 1714 statements
- function KS(t){ - if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - return t} - function zS(t,i){ - t.prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i} - Qt(KS,"_assertThisInitialized"),Qt(zS,"_inheritsLoose"); - var YS,qS,XS,JS,QS,ZS,tT,iT,sT,eT,nT,hT,rT,oT,aT,cT,lT,uT,dT,fT,pT,wT,gT,mT,vT,_T,MT,bT,yT,ET,AT,ST,TT={ - autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{ - lineHeight:""} - } - ,CT={ - duration:.5,overwrite:!1,delay:0} - ,OT=1e8,IT=1e-8,kT=2*Math.PI,xT=kT/4,RT=0,PT=Math.sqrt,NT=Math.cos,LT=Math.sin,DT=Qt(function(t){ - return"string"==typeof t} - ,"_isString"),GT=Qt(function(t){ - return"function"==typeof t} - ,"_isFunction"),BT=Qt(function(t){ - return"number"==typeof t} - ,"_isNumber"),UT=Qt(function(t){ - return void 0===t} - ,"_isUndefined"),FT=Qt(function(t){ - return"object"==typeof t} - ,"_isObject"),$T=Qt(function(t){ - return!1!==t} - ,"_isNotFalse"),HT=Qt(function(){ - return"undefined"!=typeof window} - ,"_windowExists"),WT=Qt(function(t){ - return GT(t)||DT(t)} - ,"_isFuncOrString"),VT="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){ - } - ,jT=Array.isArray,KT=/random\([^)]+\)/g,zT=/,\s*/g,YT=/(?:-?\.?\d|\.)+/gi,qT=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,XT=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,JT=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,QT=/[+-]=-?[.\d]+/,ZT=/[^,'"\[\]\s]+/gi,tC=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,iC={ - } - ,sC={ - } - ,eC=Qt(function(t){ - return(sC=NC(t,iC))&&QI} - ,"_install"),nC=Qt(function(t,i){ - } - ,"_missingPlugin"),hC=Qt(function(t,i){ - return!i&&void 0} - ,"_warn"),rC=Qt(function(t,i){ - return t&&(iC[t]=i)&&sC&&(sC[t]=i)||iC} - ,"_addGlobal"),oC=Qt(function(){ - return 0} - ,"_emptyFunc"),aC={ - suppressEvents:!0,isStart:!0,kill:!1} - ,cC={ - suppressEvents:!0,kill:!1} - ,lC={ - suppressEvents:!0} - ,uC={ - } - ,dC=[],fC={ - } - ,pC={ - } - ,wC={ - } - ,gC=30,mC=[],vC="",_C=Qt(function(t){ - var i,s,e=t[0]; - if(FT(e)||GT(e)||(t=[t]),!(i=(e._gsap||{ - } - ).harness)){ - for(s=mC.length; - s--&&!mC[s].targetTest(e); - ); - i=mC[s]} - for(s=t.length; - s--; - )t[s]&&(t[s]._gsap||(t[s]._gsap=new aI(t[s],i)))||t.splice(s,1); - return t} - ,"_harness"),MC=Qt(function(t){ - return t._gsap||_C(mO(t))[0]._gsap} - ,"_getCache"),bC=Qt(function(t,i,s){ - return(s=t[i])&>(s)?t[i]():UT(s)&&t.getAttribute&&t.getAttribute(i)||s} - ,"_getProperty"),yC=Qt(function(t,i){ - return(t=t.split(",")).forEach(i)||t} - ,"_forEachName"),EC=Qt(function(t){ - return Math.round(1e5*t)/1e5||0} - ,"_round"),AC=Qt(function(t){ - return Math.round(1e7*t)/1e7||0} - ,"_roundPrecise"),SC=Qt(function(t,i){ - var s=i.charAt(0),e=parseFloat(i.substr(2)); - return t=parseFloat(t),"+"===s?t+e:"-"===s?t-e:"*"===s?t*e:t/e} - ,"_parseRelative"),TC=Qt(function(t,i){ - for(var s=i.length,e=0; - t.indexOf(i[e])<0&&++e<s; - ); - return e<s} - ,"_arrayContainsAny"),CC=Qt(function(){ - var t,i,s=dC.length,e=dC.slice(0); - for(fC={ - } - ,dC.length=0,t=0; - t<s; - t++)(i=e[t])&&i._lazy&&(i.render(i._lazy[0],i._lazy[1],!0)._lazy=0)} - ,"_lazyRender"),OC=Qt(function(t){ - return!!(t._initted||t._startAt||t.add)} - ,"_isRevertWorthy"),IC=Qt(function(t,i,s,e){ - dC.length&&!qS&&CC(),t.render(i,s,!!(qS&&i<0&&OC(t))),dC.length&&!qS&&CC()} - ,"_lazySafeRender"),kC=Qt(function(t){ - var i=parseFloat(t); - return(i||0===i)&&(t+"").match(ZT).length<2?i:DT(t)?t.trim():t} - ,"_numericIfPossible"),xC=Qt(function(t){ - return t} - ,"_passThrough"),RC=Qt(function(t,i){ - for(var s in i)s in t||(t[s]=i[s]); - return t} - ,"_setDefaults"),PC=Qt(function(t){ - return function(i,s){ - for(var e in s)e in i||"duration"===e&&t||"ease"===e||(i[e]=s[e])} - } - ,"_setKeyframeDefaults"),NC=Qt(function(t,i){ - for(var s in i)t[s]=i[s]; - return t} - ,"_merge"),LC=Qt(function t(i,s){ - for(var e in s)"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&(i[e]=FT(s[e])?t(i[e]||(i[e]={ - } - ),s[e]):s[e]); - return i} - ,"_mergeDeep"),DC=Qt(function(t,i){ - var s,e={ - } - ; - for(s in t)s in i||(e[s]=t[s]); - return e} - ,"_copyExcluding"),GC=Qt(function(t){ - var i=t.parent||JS,s=t.keyframes?PC(jT(t.keyframes)):RC; - if($T(t.inherit))for(; - i; - )s(t,i.vars.defaults),i=i.parent||i._dp; - return t} - ,"_inheritDefaults"),BC=Qt(function(t,i){ - for(var s=t.length,e=s===i.length; - e&&s--&&t[s]===i[s]; - ); - return s<0} - ,"_arraysMatch"),UC=Qt(function(t,i,s,e,n){ - var h,r=t[e]; - if(n)for(h=i[n]; - r&&r[n]>h; - )r=r._prev; - return r?(i._next=r._next,r._next=i):(i._next=t[s],t[s]=i),i._next?i._next._prev=i:t[e]=i,i._prev=r,i.parent=i._dp=t,i} - ,"_addLinkedListItem"),FC=Qt(function(t,i,s,e){ - void 0===s&&(s="_first"),void 0===e&&(e="_last"); - var n=i._prev,h=i._next; - n?n._next=h:t[s]===i&&(t[s]=h),h?h._prev=n:t[e]===i&&(t[e]=n),i._next=i._prev=i.parent=null} - ,"_removeLinkedListItem"),$C=Qt(function(t,i){ - t.parent&&(!i||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0} - ,"_removeFromParent"),HC=Qt(function(t,i){ - if(t&&(!i||i._end>t._dur||i._start<0))for(var s=t; - s; - )s._dirty=1,s=s.parent; - return t} - ,"_uncache"),WC=Qt(function(t){ - for(var i=t.parent; - i&&i.parent; - )i._dirty=1,i.totalDuration(),i=i.parent; - return t} - ,"_recacheAncestors"),VC=Qt(function(t,i,s,e){ - return t._startAt&&(qS?t._startAt.revert(cC):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(i,!0,e))} - ,"_rewindStartAt"),jC=Qt(function t(i){ - return!i||i._ts&&t(i.parent)} - ,"_hasNoPausedAncestors"),KC=Qt(function(t){ - return t._repeat?zC(t._tTime,t=t.duration()+t._rDelay)*t:0} - ,"_elapsedCycleDuration"),zC=Qt(function(t,i){ - var s=Math.floor(t=AC(t/i)); - return t&&s===t?s-1:s} - ,"_animationCycle"),YC=Qt(function(t,i){ - return(t-i._start)*i._ts+(i._ts>=0?0:i._dirty?i.totalDuration():i._tDur)} - ,"_parentToChildTotalTime"),qC=Qt(function(t){ - return t._end=AC(t._start+(t._tDur/Math.abs(t._ts||t._rts||IT)||0))} - ,"_setEnd"),XC=Qt(function(t,i){ - var s=t._dp; - return s&&s.smoothChildTiming&&t._ts&&(t._start=AC(s._time-(t._ts>0?i/t._ts:((t._dirty?t.totalDuration():t._tDur)-i)/-t._ts)),qC(t),s._dirty||HC(s,t)),t} - ,"_alignPlayhead"),JC=Qt(function(t,i){ - var s; - if((i._time||!i._dur&&i._initted||i._start<t._time&&(i._dur||!i.add))&&(s=YC(t.rawTime(),i),(!i._dur||uO(0,i.totalDuration(),s)-i._tTime>IT)&&i.render(s,!0)),HC(t,i)._dp&&t._initted&&t._time>=t._dur&&t._ts){ - if(t._dur<t.duration())for(s=t; - s._dp; - )s.rawTime()>=0&&s.totalTime(s._tTime),s=s._dp; - t._zTime=-1e-8} - } - ,"_postAddChecks"),QC=Qt(function(t,i,s,e){ - return i.parent&&$C(i),i._start=AC((BT(s)?s:s||t!==JS?aO(t,s,i):t._time)+i._delay),i._end=AC(i._start+(i.totalDuration()/Math.abs(i.timeScale())||0)),UC(t,i,"_first","_last",t._sort?"_start":0),sO(i)||(t._recent=i),e||JC(t,i),t._ts<0&&XC(t,t._tTime),t} - ,"_addToTimeline"),ZC=Qt(function(t,i){ - return(iC.ScrollTrigger||nC("scrollTrigger",i))&&iC.ScrollTrigger.create(i,t)} - ,"_scrollTrigger"),tO=Qt(function(t,i,s,e,n){ - return mI(t,i,n),t._initted?!s&&t._pt&&!qS&&(t._dur&&!1!==t.vars.lazy||!t._dur&&t.vars.lazy)&&sT!==zO.frame?(dC.push(t),t._lazy=[n,e],1):void 0:1} - ,"_attemptInitTween"),iO=Qt(function t(i){ - var s=i.parent; - return s&&s._ts&&s._initted&&!s._lock&&(s.rawTime()<0||t(s))} - ,"_parentPlayheadIsBeforeStart"),sO=Qt(function(t){ - var i=t.data; - return"isFromStart"===i||"isStart"===i} - ,"_isFromOrFromStart"),eO=Qt(function(t,i,s,e){ - var n,h,r,o=t.ratio,a=i<0||!i&&(!t._start&&iO(t)&&(t._initted||!sO(t))||(t._ts<0||t._dp._ts<0)&&!sO(t))?0:1,c=t._rDelay,l=0; - if(c&&t._repeat&&(l=uO(0,t._tDur,i),h=zC(l,c),t._yoyo&&1&h&&(a=1-a),h!==zC(t._tTime,c)&&(o=1-a,t.vars.repeatRefresh&&t._initted&&t.invalidate())),a!==o||qS||e||t._zTime===IT||!i&&t._zTime){ - if(!t._initted&&tO(t,i,e,s,l))return; - for(r=t._zTime,t._zTime=i||(s?IT:0),s||(s=i&&!r),t.ratio=a,t._from&&(a=1-a),t._time=0,t._tTime=l,n=t._pt; - n; - )n.r(a,n.d),n=n._next; - i<0&&VC(t,i,s,!0),t._onUpdate&&!s&&NO(t,"onUpdate"),l&&t._repeat&&!s&&t.parent&&NO(t,"onRepeat"),(i>=t._tDur||i<0)&&t.ratio===a&&(a&&$C(t,1),s||qS||(NO(t,a?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))} - else t._zTime||(t._zTime=i)} - ,"_renderZeroDurationTween"),nO=Qt(function(t,i,s){ - var e; - if(s>i)for(e=t._first; - e&&e._start<=s; - ){ - if("isPause"===e.data&&e._start>i)return e; - e=e._next} - else for(e=t._last; - e&&e._start>=s; - ){ - if("isPause"===e.data&&e._start<i)return e; - e=e._prev} - } - ,"_findNextPauseTween"),hO=Qt(function(t,i,s,e){ - var n=t._repeat,h=AC(i)||0,r=t._tTime/t._tDur; - return r&&!e&&(t._time*=h/t._dur),t._dur=h,t._tDur=n?n<0?1e10:AC(h*(n+1)+t._rDelay*n):h,r>0&&!e&&XC(t,t._tTime=t._tDur*r),t.parent&&qC(t),s||HC(t.parent,t),t} - ,"_setDuration"),rO=Qt(function(t){ - return t instanceof lI?HC(t):hO(t,t._dur)} - ,"_onUpdateTotalDuration"),oO={ - _start:0,endTime:oC,totalDuration:oC} - ,aO=Qt(function t(i,s,e){ - var n,h,r,o=i.labels,a=i._recent||oO,c=i.duration()>=OT?a.endTime(!1):i._dur; - return DT(s)&&(isNaN(s)||s in o)?(h=s.charAt(0),r="%"===s.substr(-1),n=s.indexOf("="),"<"===h||">"===h?(n>=0&&(s=s.replace(/=/,"")),("<"===h?a._start:a.endTime(a._repeat>=0))+(parseFloat(s.substr(1))||0)*(r?(n<0?a:e).totalDuration()/100:1)):n<0?(s in o||(o[s]=c),o[s]):(h=parseFloat(s.charAt(n-1)+s.substr(n+1)),r&&e&&(h=h/100*(jT(e)?e[0]:e).totalDuration()),n>1?t(i,s.substr(0,n-1),e)+h:c+h)):null==s?c:+s} - ,"_parsePosition"),cO=Qt(function(t,i,s){ - var e,n,h=BT(i[1]),r=(h?2:1)+(t<2?0:1),o=i[r]; - if(h&&(o.duration=i[1]),o.parent=s,t){ - for(e=o,n=s; - n&&!("immediateRender"in e); - )e=n.vars.defaults||{ - } - ,n=$T(n.vars.inherit)&&n.parent; - o.immediateRender=$T(e.immediateRender),t<2?o.runBackwards=1:o.startAt=i[r-1]} - return new AI(i[0],o,i[r+1])} - ,"_createTweenType"),lO=Qt(function(t,i){ - return t||0===t?i(t):i} - ,"_conditionalReturn"),uO=Qt(function(t,i,s){ - return s<t?t:s>i?i:s} - ,"_clamp"),dO=Qt(function(t,i){ - return DT(t)&&(i=tC.exec(t))?i[1]:""} - ,"getUnit"),fO=Qt(function(t,i,s){ - return lO(s,function(s){ - return uO(t,i,s)} - )} - ,"clamp"),pO=[].slice,wO=Qt(function(t,i){ - return t&&FT(t)&&"length"in t&&(!i&&!t.length||t.length-1 in t&&FT(t[0]))&&!t.nodeType&&t!==QS} - ,"_isArrayLike"),gO=Qt(function(t,i,s){ - return void 0===s&&(s=[]),t.forEach(function(t){ - var e; - return DT(t)&&!i||wO(t,1)?(e=s).push.apply(e,mO(t)):s.push(t)} - )||s} - ,"_flatten"),mO=Qt(function(t,i,s){ - return XS&&!i&&XS.selector?XS.selector(t):!DT(t)||s||!ZS&&YO()?jT(t)?gO(t,s):wO(t)?pO.call(t,0):t?[t]:[]:pO.call((i||tT).querySelectorAll(t),0)} - ,"toArray"),vO=Qt(function(t){ - return t=mO(t)[0]||hC("Invalid scope")||{ - } - ,function(i){ - var s=t.current||t.nativeElement||t; - return mO(i,s.querySelectorAll?s:s===t?hC("Invalid scope")||tT.createElement("div"):t)} - } - ,"selector"),_O=Qt(function(t){ - return t.sort(function(){ - return.5-Math.random()} - )} - ,"shuffle"),MO=Qt(function(t){ - if(GT(t))return t; - var i=FT(t)?t:{ - each:t} - ,s=eI(i.ease),e=i.from||0,n=parseFloat(i.base)||0,h={ - } - ,r=e>0&&e<1,o=isNaN(e)||r,a=i.axis,c=e,l=e; - return DT(e)?c=l={ - center:.5,edges:.5,end:1} - [e]||0:!r&&o&&(c=e[0],l=e[1]),function(t,r,u){ - var d,f,p,w,g,m,v,_,M,b=(u||i).length,y=h[b]; - if(!y){ - if(!(M="auto"===i.grid?0:(i.grid||[1,OT])[1])){ - for(v=-1e8; - v<(v=u[M++].getBoundingClientRect().left)&&M<b; - ); - M<b&&M--} - for(y=h[b]=[],d=o?Math.min(M,b)*c-.5:e%M,f=M===OT?0:o?b*l/M-.5:e/M|0,v=0,_=OT,m=0; - m<b; - m++)p=m%M-d,w=f-(m/M|0),y[m]=g=a?Math.abs("y"===a?w:p):PT(p*p+w*w),g>v&&(v=g),g<_&&(_=g); - "random"===e&&_O(y),y.max=v-_,y.min=_,y.v=b=(parseFloat(i.amount)||parseFloat(i.each)*(M>b?b-1:a?"y"===a?b/M:M:Math.max(M,b/M))||0)*("edges"===e?-1:1),y.b=b<0?n-b:n,y.u=dO(i.amount||i.each)||0,s=s&&b<0?iI(s):s} - return b=(y[t]-y.min)/y.max||0,AC(y.b+(s?s(b):b)*y.v)+y.u} - } - ,"distribute"),bO=Qt(function(t){ - var i=Math.pow(10,((t+"").split(".")[1]||"").length); - return function(s){ - var e=AC(Math.round(parseFloat(s)/t)*t*i); - return(e-e%1)/i+(BT(s)?0:dO(s))} - } - ,"_roundModifier"),yO=Qt(function(t,i){ - var s,e,n=jT(t); - return!n&&FT(t)&&(s=n=t.radius||OT,t.values?(t=mO(t.values),(e=!BT(t[0]))&&(s*=s)):t=bO(t.increment)),lO(i,n?GT(t)?function(i){ - return e=t(i),Math.abs(e-i)<=s?e:i} - :function(i){ - for(var n,h,r=parseFloat(e?i.x:i),o=parseFloat(e?i.y:0),a=OT,c=0,l=t.length; - l--; - )(n=e?(n=t[l].x-r)*n+(h=t[l].y-o)*h:Math.abs(t[l]-r))<a&&(a=n,c=l); - return c=!s||a<=s?t[c]:i,e||c===i||BT(i)?c:c+dO(i)} - :bO(t))} - ,"snap"),EO=Qt(function(t,i,s,e){ - return lO(jT(t)?!i:!0===s?!!(s=0):!e,function(){ - return jT(t)?t[~~(Math.random()*t.length)]:(s=s||1e-5)&&(e=s<1?Math.pow(10,(s+"").length-2):1)&&Math.floor(Math.round((t-s/2+Math.random()*(i-t+.99*s))/s)*s*e)/e} - )} - ,"random"),AO=Qt(function(){ - for(var t=arguments.length,i=new Array(t),s=0; - s<t; - s++)i[s]=arguments[s]; - return function(t){ - return i.reduce(function(t,i){ - return i(t)} - ,t)} - } - ,"pipe"),SO=Qt(function(t,i){ - return function(s){ - return t(parseFloat(s))+(i||dO(s))} - } - ,"unitize"),TO=Qt(function(t,i,s){ - return xO(t,i,0,1,s)} - ,"normalize"),CO=Qt(function(t,i,s){ - return lO(s,function(s){ - return t[~~i(s)]} - )} - ,"_wrapArray"),OO=Qt(function t(i,s,e){ - var n=s-i; - return jT(i)?CO(i,t(0,i.length),s):lO(e,function(t){ - return(n+(t-i)%n)%n+i} - )} - ,"wrap"),IO=Qt(function t(i,s,e){ - var n=s-i,h=2*n; - return jT(i)?CO(i,t(0,i.length-1),s):lO(e,function(t){ - return i+((t=(h+(t-i)%h)%h||0)>n?h-t:t)} - )} - ,"wrapYoyo"),kO=Qt(function(t){ - return t.replace(KT,function(t){ - var i=t.indexOf("[")+1,s=t.substring(i||7,i?t.indexOf("]"):t.length-1).split(zT); - return EO(i?s:+s[0],i?0:+s[1],+s[2]||1e-5)} - )} - ,"_replaceRandom"),xO=Qt(function(t,i,s,e,n){ - var h=i-t,r=e-s; - return lO(n,function(i){ - return s+((i-t)/h*r||0)} - )} - ,"mapRange"),RO=Qt(function t(i,s,e,n){ - var h=isNaN(i+s)?0:function(t){ - return(1-t)*i+t*s} - ; - if(!h){ - var r,o,a,c,l,u=DT(i),d={ - } - ; - if(!0===e&&(n=1)&&(e=null),u)i={ - p:i} - ,s={ - p:s} - ; - else if(jT(i)&&!jT(s)){ - for(a=[],c=i.length,l=c-2,o=1; - o<c; - o++)a.push(t(i[o-1],i[o])); - c--,h=Qt(function(t){ - t*=c; - var i=Math.min(l,~~t); - return a[i](t-i)} - ,"func"),e=s} - else n||(i=NC(jT(i)?[]:{ - } - ,i)); - if(!a){ - for(r in s)pI.call(d,i,r,"get",s[r]); - h=Qt(function(t){ - return PI(t,d)||(u?i.p:i)} - ,"func")} - } - return lO(e,h)} - ,"interpolate"),PO=Qt(function(t,i,s){ - var e,n,h,r=t.labels,o=OT; - for(e in r)(n=r[e]-i)<0==!!s&&n&&o>(n=Math.abs(n))&&(h=e,o=n); - return h} - ,"_getLabelInDirection"),NO=Qt(function(t,i,s){ - var e,n,h,r=t.vars,o=r[i],a=XS,c=t._ctx; - if(o)return e=r[i+"Params"],n=r.callbackScope||t,s&&dC.length&&CC(),c&&(XS=c),h=e?o.apply(n,e):o.call(n),XS=a,h} - ,"_callback"),LO=Qt(function(t){ - return $C(t),t.scrollTrigger&&t.scrollTrigger.kill(!!qS),t.progress()<1&&NO(t,"onInterrupt"),t} - ,"_interrupt"),DO=[],GO=Qt(function(t){ - if(t)if(t=!t.name&&t.default||t,HT()||t.headless){ - var i=t.name,s=GT(t),e=i&&!s&&t.init?function(){ - this._props=[]} - :t,n={ - init:oC,render:PI,add:pI,kill:LI,modifier:NI,rawVars:0} - ,h={ - targetTest:0,get:0,getSetter:II,aliases:{ - } - ,register:0} - ; - if(YO(),t!==e){ - if(pC[i])return; - RC(e,RC(DC(t,n),h)),NC(e.prototype,NC(n,DC(t,h))),pC[e.prop=i]=e,t.targetTest&&(mC.push(e),uC[i]=1),i=("css"===i?"CSS":i.charAt(0).toUpperCase()+i.substr(1))+"Plugin"} - rC(i,e),t.register&&t.register(QI,e,BI)} - else DO.push(t)} - ,"_createPlugin"),BO=255,UO={ - aqua:[0,BO,BO],lime:[0,BO,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,BO],navy:[0,0,128],white:[BO,BO,BO],olive:[128,128,0],yellow:[BO,BO,0],orange:[BO,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[BO,0,0],pink:[BO,192,203],cyan:[0,BO,BO],transparent:[BO,BO,BO,0]} - ,FO=Qt(function(t,i,s){ - return(6*(t+=t<0?1:t>1?-1:0)<1?i+(s-i)*t*6:t<.5?s:3*t<2?i+(s-i)*(2/3-t)*6:i)*BO+.5|0} - ,"_hue"),$O=Qt(function(t,i,s){ - var e,n,h,r,o,a,c,l,u,d,f=t?BT(t)?[t>>16,t>>8&BO,t&BO]:0:UO.black; - if(!f){ - if(","===t.substr(-1)&&(t=t.substr(0,t.length-1)),UO[t])f=UO[t]; - else if("#"===t.charAt(0)){ - if(t.length<6&&(e=t.charAt(1),n=t.charAt(2),h=t.charAt(3),t="#"+e+e+n+n+h+h+(5===t.length?t.charAt(4)+t.charAt(4):"")),9===t.length)return[(f=parseInt(t.substr(1,6),16))>>16,f>>8&BO,f&BO,parseInt(t.substr(7),16)/255]; - f=[(t=parseInt(t.substr(1),16))>>16,t>>8&BO,t&BO]} - else if("hsl"===t.substr(0,3))if(f=d=t.match(YT),i){ - if(~t.indexOf("="))return f=t.match(qT),s&&f.length<4&&(f[3]=1),f} - else r=+f[0]%360/360,o=+f[1]/100,e=2*(a=+f[2]/100)-(n=a<=.5?a*(o+1):a+o-a*o),f.length>3&&(f[3]*=1),f[0]=FO(r+1/3,e,n),f[1]=FO(r,e,n),f[2]=FO(r-1/3,e,n); - else f=t.match(YT)||UO.transparent; - f=f.map(Number)} - return i&&!d&&(e=f[0]/BO,n=f[1]/BO,h=f[2]/BO,a=((c=Math.max(e,n,h))+(l=Math.min(e,n,h)))/2,c===l?r=o=0:(u=c-l,o=a>.5?u/(2-c-l):u/(c+l),r=c===e?(n-h)/u+(n<h?6:0):c===n?(h-e)/u+2:(e-n)/u+4,r*=60),f[0]=~~(r+.5),f[1]=~~(100*o+.5),f[2]=~~(100*a+.5)),s&&f.length<4&&(f[3]=1),f} - ,"splitColor"),HO=Qt(function(t){ - var i=[],s=[],e=-1; - return t.split(VO).forEach(function(t){ - var n=t.match(XT)||[]; - i.push.apply(i,n),s.push(e+=n.length+1)} - ),i.c=s,i} - ,"_colorOrderData"),WO=Qt(function(t,i,s){ - var e,n,h,r,o="",a=(t+o).match(VO),c=i?"hsla(":"rgba(",l=0; - if(!a)return t; - if(a=a.map(function(t){ - return(t=$O(t,i,1))&&c+(i?t[0]+","+t[1]+"%,"+t[2]+"%,"+t[3]:t.join(","))+")"} - ),s&&(h=HO(t),(e=s.c).join(o)!==h.c.join(o)))for(r=(n=t.replace(VO,"1").split(XT)).length-1; - l<r; - l++)o+=n[l]+(~e.indexOf(l)?a.shift()||c+"0,0,0,0)":(h.length?h:a.length?a:s).shift()); - if(!n)for(r=(n=t.split(VO)).length-1; - l<r; - l++)o+=n[l]+a[l]; - return o+n[r]} - ,"_formatColors"),VO=function(){ - var t,i="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{ - 3,4} - ){ - 1,2} - \\b"; - for(t in UO)i+="|"+t+"\\b"; - return new RegExp(i+")","gi")} - (),jO=/hsl[a]?\(/,KO=Qt(function(t){ - var i,s=t.join(" "); - if(VO.lastIndex=0,VO.test(s))return i=jO.test(s),t[1]=WO(t[1],i),t[0]=WO(t[0],i,HO(t[1])),!0} - ,"_colorStringFilter"),zO=(uT=Date.now,dT=500,fT=33,pT=uT(),wT=pT,mT=gT=1e3/240,vT=[],_T=Qt(function t(i){ - var s,e,n,h,r=uT()-wT,o=!0===i; - if((r>dT||r<0)&&(pT+=r-fT),((s=(n=(wT+=r)-pT)-mT)>0||o)&&(h=++aT.frame,cT=n-1e3*aT.time,aT.time=n/=1e3,mT+=s+(s>=gT?4:gT-s),e=1),o||(hT=rT(t)),e)for(lT=0; - lT<vT.length; - lT++)vT[lT](n,cT,h,i)} - ,"_tick"),aT={ - time:0,frame:0,tick:Qt(function(){ - _T(!0)} - ,"tick"),deltaRatio:Qt(function(t){ - return cT/(1e3/(t||60))} - ,"deltaRatio"),wake:Qt(function(){ - iT&&(!ZS&&HT()&&(QS=ZS=window,tT=QS.document||{ - } - ,iC.gsap=QI,(QS.gsapVersions||(QS.gsapVersions=[])).push(QI.version),eC(sC||QS.GreenSockGlobals||!QS.gsap&&QS||{ - } - ),DO.forEach(GO)),oT="undefined"!=typeof requestAnimationFrame&&requestAnimationFrame,hT&&aT.sleep(),rT=oT||function(t){ - return setTimeout(t,mT-1e3*aT.time+1|0)} - ,nT=1,_T(2))} - ,"wake"),sleep:Qt(function(){ - (oT?cancelAnimationFrame:clearTimeout)(hT),nT=0,rT=oC} - ,"sleep"),lagSmoothing:Qt(function(t,i){ - dT=t||1/0,fT=Math.min(i||33,dT)} - ,"lagSmoothing"),fps:Qt(function(t){ - gT=1e3/(t||240),mT=1e3*aT.time+gT} - ,"fps"),add:Qt(function(t,i,s){ - var e=i?function(i,s,n,h){ - t(i,s,n,h),aT.remove(e)} - :t; - return aT.remove(t),vT[s?"unshift":"push"](e),YO(),e} - ,"add"),remove:Qt(function(t,i){ - ~(i=vT.indexOf(t))&&vT.splice(i,1)&&lT>=i&&lT--} - ,"remove"),_listeners:vT} - ),YO=Qt(function(){ - return!nT&&zO.wake()} - ,"_wake"),qO={ - } - ,XO=/^[\d.\-M][\d.\-,\s]/,JO=/["']/g,QO=Qt(function(t){ - for(var i,s,e,n={ - } - ,h=t.substr(1,t.length-3).split(":"),r=h[0],o=1,a=h.length; - o<a; - o++)s=h[o],i=o!==a-1?s.lastIndexOf(","):s.length,e=s.substr(0,i),n[r]=isNaN(e)?e.replace(JO,"").trim():+e,r=s.substr(i+1).trim(); - return n} - ,"_parseObjectInString"),ZO=Qt(function(t){ - var i=t.indexOf("(")+1,s=t.indexOf(")"),e=t.indexOf("(",i); - return t.substring(i,~e&&e<s?t.indexOf(")",s+1):s)} - ,"_valueInParentheses"),tI=Qt(function(t){ - var i=(t+"").split("("),s=qO[i[0]]; - return s&&i.length>1&&s.config?s.config.apply(null,~t.indexOf("{ - ")?[QO(i[1])]:ZO(t).split(",").map(kC)):qO._CE&&XO.test(t)?qO._CE("",t):s} - ,"_configEaseFromString"),iI=Qt(function(t){ - return function(i){ - return 1-t(1-i)} - } - ,"_invertEase"),sI=Qt(function t(i,s){ - for(var e,n=i._first; - n; - )n instanceof lI?t(n,s):!n.vars.yoyoEase||n._yoyo&&n._repeat||n._yoyo===s||(n.timeline?t(n.timeline,s):(e=n._ease,n._ease=n._yEase,n._yEase=e,n._yoyo=s)),n=n._next} - ,"_propagateYoyoEase"),eI=Qt(function(t,i){ - return t&&(GT(t)?t:qO[t]||tI(t))||i} - ,"_parseEase"),nI=Qt(function(t,i,s,e){ - void 0===s&&(s=Qt(function(t){ - return 1-i(1-t)} - ,"easeOut")),void 0===e&&(e=Qt(function(t){ - return t<.5?i(2*t)/2:1-i(2*(1-t))/2} - ,"easeInOut")); - var n,h={ - easeIn:i,easeOut:s,easeInOut:e} - ; - return yC(t,function(t){ - for(var i in qO[t]=iC[t]=h,qO[n=t.toLowerCase()]=s,h)qO[n+("easeIn"===i?".in":"easeOut"===i?".out":".inOut")]=qO[t+"."+i]=h[i]} - ),h} - ,"_insertEase"),hI=Qt(function(t){ - return function(i){ - return i<.5?(1-t(1-2*i))/2:.5+t(2*(i-.5))/2} - } - ,"_easeInOutFromOut"),rI=Qt(function t(i,s,e){ - var n=s>=1?s:1,h=(e||(i?.3:.45))/(s<1?s:1),r=h/kT*(Math.asin(1/n)||0),o=Qt(function(t){ - return 1===t?1:n*Math.pow(2,-10*t)*LT((t-r)*h)+1} - ,"easeOut"),a="out"===i?o:"in"===i?function(t){ - return 1-o(1-t)} - :hI(o); - return h=kT/h,a.config=function(s,e){ - return t(i,s,e)} - ,a} - ,"_configElastic"),oI=Qt(function t(i,s){ - void 0===s&&(s=1.70158); - var e=Qt(function(t){ - return t?--t*t*((s+1)*t+s)+1:0} - ,"easeOut"),n="out"===i?e:"in"===i?function(t){ - return 1-e(1-t)} - :hI(e); - return n.config=function(s){ - return t(i,s)} - ,n} - ,"_configBack"); - yC("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,i){ - var s=i<5?i+1:i; - nI(t+",Power"+(s-1),i?function(t){ - return Math.pow(t,s)} - :function(t){ - return t} - ,function(t){ - return 1-Math.pow(1-t,s)} - ,function(t){ - return t<.5?Math.pow(2*t,s)/2:1-Math.pow(2*(1-t),s)/2} - )} - ),qO.Linear.easeNone=qO.none=qO.Linear.easeIn,nI("Elastic",rI("in"),rI("out"),rI()),MT=7.5625,ET=2*(yT=1/(bT=2.75)),AT=2.5*yT,nI("Bounce",function(t){ - return 1-ST(1-t)} - ,ST=Qt(function(t){ - return t<yT?MT*t*t:t<ET?MT*Math.pow(t-1.5/bT,2)+.75:t<AT?MT*(t-=2.25/bT)*t+.9375:MT*Math.pow(t-2.625/bT,2)+.984375} - ,"easeOut")),nI("Expo",function(t){ - return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)} - ),nI("Circ",function(t){ - return-(PT(1-t*t)-1)} - ),nI("Sine",function(t){ - return 1===t?1:1-NT(t*xT)} - ),nI("Back",oI("in"),oI("out"),oI()),qO.SteppedEase=qO.steps=iC.SteppedEase={ - config:Qt(function(t,i){ - void 0===t&&(t=1); - var s=1/t,e=t+(i?0:1),n=i?1:0; - return function(t){ - return((e*uO(0,.99999999,t)|0)+n)*s} - } - ,"config")} - ,CT.ease=qO["quad.out"],yC("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){ - return vC+=t+","+t+"Params,"} - ); - var aI=Qt(function(t,i){ - this.id=RT++,t._gsap=this,this.target=t,this.harness=i,this.get=i?i.get:bC,this.set=i?i.getSetter:II} - ,"GSCache"),cI=function(){ - function t(t){ - this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,hO(this,+t.duration,1,1),this.data=t.data,XS&&(this._ctx=XS,XS.data.push(this)),nT||zO.wake()} - Qt(t,"Animation"); - var i=t.prototype; - return i.delay=Qt(function(t){ - return t||0===t?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay),this._delay=t,this):this._delay} - ,"delay"),i.duration=Qt(function(t){ - return arguments.length?this.totalDuration(this._repeat>0?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur} - ,"duration"),i.totalDuration=Qt(function(t){ - return arguments.length?(this._dirty=0,hO(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur} - ,"totalDuration"),i.totalTime=Qt(function(t,i){ - if(YO(),!arguments.length)return this._tTime; - var s=this._dp; - if(s&&s.smoothChildTiming&&this._ts){ - for(XC(this,t),!s._dp||s.parent||JC(s,this); - s&&s.parent; - )s.parent._time!==s._start+(s._ts>=0?s._tTime/s._ts:(s.totalDuration()-s._tTime)/-s._ts)&&s.totalTime(s._tTime,!0),s=s.parent; - !this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&t<this._tDur||this._ts<0&&t>0||!this._tDur&&!t)&&QC(this._dp,this,this._start-this._delay)} - return(this._tTime!==t||!this._dur&&!i||this._initted&&Math.abs(this._zTime)===IT||!this._initted&&this._dur&&t||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),IC(this,t,i)),this} - ,"totalTime"),i.time=Qt(function(t,i){ - return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+KC(this))%(this._dur+this._rDelay)||(t?this._dur:0),i):this._time} - ,"time"),i.totalProgress=Qt(function(t,i){ - return arguments.length?this.totalTime(this.totalDuration()*t,i):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0} - ,"totalProgress"),i.progress=Qt(function(t,i){ - return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?t:1-t)+KC(this),i):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0} - ,"progress"),i.iteration=Qt(function(t,i){ - var s=this.duration()+this._rDelay; - return arguments.length?this.totalTime(this._time+(t-1)*s,i):this._repeat?zC(this._tTime,s)+1:1} - ,"iteration"),i.timeScale=Qt(function(t,i){ - if(!arguments.length)return-1e-8===this._rts?0:this._rts; - if(this._rts===t)return this; - var s=this.parent&&this._ts?YC(this.parent._time,this):this._tTime; - return this._rts=+t||0,this._ts=this._ps||-1e-8===t?0:this._rts,this.totalTime(uO(-Math.abs(this._delay),this.totalDuration(),s),!1!==i),qC(this),WC(this)} - ,"timeScale"),i.paused=Qt(function(t){ - return arguments.length?(this._ps!==t&&(this._ps=t,t?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(YO(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&Math.abs(this._zTime)!==IT&&(this._tTime-=IT)))),this):this._ps} - ,"paused"),i.startTime=Qt(function(t){ - if(arguments.length){ - this._start=AC(t); - var i=this.parent||this._dp; - return i&&(i._sort||!this.parent)&&QC(i,this,this._start-this._delay),this} - return this._start} - ,"startTime"),i.endTime=Qt(function(t){ - return this._start+($T(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)} - ,"endTime"),i.rawTime=Qt(function(t){ - var i=this.parent||this._dp; - return i?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?YC(i.rawTime(t),this):this._tTime:this._tTime} - ,"rawTime"),i.revert=Qt(function(t){ - void 0===t&&(t=lC); - var i=qS; - return qS=t,OC(this)&&(this.timeline&&this.timeline.revert(t),this.totalTime(-.01,t.suppressEvents)),"nested"!==this.data&&!1!==t.kill&&this.kill(),qS=i,this} - ,"revert"),i.globalTime=Qt(function(t){ - for(var i=this,s=arguments.length?t:i.rawTime(); - i; - )s=i._start+s/(Math.abs(i._ts)||1),i=i._dp; - return!this.parent&&this._sat?this._sat.globalTime(t):s} - ,"globalTime"),i.repeat=Qt(function(t){ - return arguments.length?(this._repeat=t===1/0?-2:t,rO(this)):-2===this._repeat?1/0:this._repeat} - ,"repeat"),i.repeatDelay=Qt(function(t){ - if(arguments.length){ - var i=this._time; - return this._rDelay=t,rO(this),i?this.time(i):this} - return this._rDelay} - ,"repeatDelay"),i.yoyo=Qt(function(t){ - return arguments.length?(this._yoyo=t,this):this._yoyo} - ,"yoyo"),i.seek=Qt(function(t,i){ - return this.totalTime(aO(this,t),$T(i))} - ,"seek"),i.restart=Qt(function(t,i){ - return this.play().totalTime(t?-this._delay:0,$T(i)),this._dur||(this._zTime=-1e-8),this} - ,"restart"),i.play=Qt(function(t,i){ - return null!=t&&this.seek(t,i),this.reversed(!1).paused(!1)} - ,"play"),i.reverse=Qt(function(t,i){ - return null!=t&&this.seek(t||this.totalDuration(),i),this.reversed(!0).paused(!1)} - ,"reverse"),i.pause=Qt(function(t,i){ - return null!=t&&this.seek(t,i),this.paused(!0)} - ,"pause"),i.resume=Qt(function(){ - return this.paused(!1)} - ,"resume"),i.reversed=Qt(function(t){ - return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-1e-8:0)),this):this._rts<0} - ,"reversed"),i.invalidate=Qt(function(){ - return this._initted=this._act=0,this._zTime=-1e-8,this} - ,"invalidate"),i.isActive=Qt(function(){ - var t,i=this.parent||this._dp,s=this._start; - return!(i&&!(this._ts&&this._initted&&i.isActive()&&(t=i.rawTime(!0))>=s&&t<this.endTime(!0)-IT))} - ,"isActive"),i.eventCallback=Qt(function(t,i,s){ - var e=this.vars; - return arguments.length>1?(i?(e[t]=i,s&&(e[t+"Params"]=s),"onUpdate"===t&&(this._onUpdate=i)):delete e[t],this):e[t]} - ,"eventCallback"),i.then=Qt(function(t){ - var i=this,s=i._prom; - return new Promise(function(e){ - var n=GT(t)?t:xC,h=Qt(function(){ - var t=i.then; - i.then=null,s&&s(),GT(n)&&(n=n(i))&&(n.then||n===i)&&(i.then=t),e(n),i.then=t} - ,"_resolve"); - i._initted&&1===i.totalProgress()&&i._ts>=0||!i._tTime&&i._ts<0?h():i._prom=h} - )} - ,"then"),i.kill=Qt(function(){ - LO(this)} - ,"kill"),t} - (); - RC(cI.prototype,{ - _time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-1e-8,_prom:0,_ps:!1,_rts:1} - ); - var lI=function(t){ - function i(i,s){ - var e; - return void 0===i&&(i={ - } - ),(e=t.call(this,i)||this).labels={ - } - ,e.smoothChildTiming=!!i.smoothChildTiming,e.autoRemoveChildren=!!i.autoRemoveChildren,e._sort=$T(i.sortChildren),JS&&QC(i.parent||JS,KS(e),s),i.reversed&&e.reverse(),i.paused&&e.paused(!0),i.scrollTrigger&&ZC(KS(e),i.scrollTrigger),e} - zS(i,t),Qt(i,"Timeline"); - var s=i.prototype; - return s.to=Qt(function(t,i,s){ - return cO(0,arguments,this),this} - ,"to"),s.from=Qt(function(t,i,s){ - return cO(1,arguments,this),this} - ,"from"),s.fromTo=Qt(function(t,i,s,e){ - return cO(2,arguments,this),this} - ,"fromTo"),s.set=Qt(function(t,i,s){ - return i.duration=0,i.parent=this,GC(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new AI(t,i,aO(this,s),1),this} - ,"set"),s.call=Qt(function(t,i,s){ - return QC(this,AI.delayedCall(0,t,i),s)} - ,"call"),s.staggerTo=Qt(function(t,i,s,e,n,h,r){ - return s.duration=i,s.stagger=s.stagger||e,s.onComplete=h,s.onCompleteParams=r,s.parent=this,new AI(t,s,aO(this,n)),this} - ,"staggerTo"),s.staggerFrom=Qt(function(t,i,s,e,n,h,r){ - return s.runBackwards=1,GC(s).immediateRender=$T(s.immediateRender),this.staggerTo(t,i,s,e,n,h,r)} - ,"staggerFrom"),s.staggerFromTo=Qt(function(t,i,s,e,n,h,r,o){ - return e.startAt=s,GC(e).immediateRender=$T(e.immediateRender),this.staggerTo(t,i,e,n,h,r,o)} - ,"staggerFromTo"),s.render=Qt(function(t,i,s){ - var e,n,h,r,o,a,c,l,u,d,f,p,w=this._time,g=this._dirty?this.totalDuration():this._tDur,m=this._dur,v=t<=0?0:AC(t),_=this._zTime<0!=t<0&&(this._initted||!m); - if(this!==JS&&v>g&&t>=0&&(v=g),v!==this._tTime||s||_){ - if(w!==this._time&&m&&(v+=this._time-w,t+=this._time-w),e=v,u=this._start,a=!(l=this._ts),_&&(m||(w=this._zTime),(t||!i)&&(this._zTime=t)),this._repeat){ - if(f=this._yoyo,o=m+this._rDelay,this._repeat<-1&&t<0)return this.totalTime(100*o+t,i,s); - if(e=AC(v%o),v===g?(r=this._repeat,e=m):((r=~~(d=AC(v/o)))&&r===d&&(e=m,r--),e>m&&(e=m)),d=zC(this._tTime,o),!w&&this._tTime&&d!==r&&this._tTime-d*o-this._dur<=0&&(d=r),f&&1&r&&(e=m-e,p=1),r!==d&&!this._lock){ - var M=f&&1&d,b=M===(f&&1&r); - if(r<d&&(M=!M),w=M?0:v%m?m:v,this._lock=1,this.render(w||(p?0:AC(r*o)),i,!m)._lock=0,this._tTime=v,!i&&this.parent&&NO(this,"onRepeat"),this.vars.repeatRefresh&&!p&&(this.invalidate()._lock=1,d=r),w&&w!==this._time||a!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this; - if(m=this._dur,g=this._tDur,b&&(this._lock=2,w=M?m:-1e-4,this.render(w,!0),this.vars.repeatRefresh&&!p&&this.invalidate()),this._lock=0,!this._ts&&!a)return this; - sI(this,p)} - } - if(this._hasPause&&!this._forcing&&this._lock<2&&(c=nO(this,AC(w),AC(e)))&&(v-=e-(e=c._start)),this._tTime=v,this._time=e,this._act=!l,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=t,w=0),!w&&v&&m&&!i&&!d&&(NO(this,"onStart"),this._tTime!==v))return this; - if(e>=w&&t>=0)for(n=this._first; - n; - ){ - if(h=n._next,(n._act||e>=n._start)&&n._ts&&c!==n){ - if(n.parent!==this)return this.render(t,i,s); - if(n.render(n._ts>0?(e-n._start)*n._ts:(n._dirty?n.totalDuration():n._tDur)+(e-n._start)*n._ts,i,s),e!==this._time||!this._ts&&!a){ - c=0,h&&(v+=this._zTime=-1e-8); - break} - } - n=h} - else{ - n=this._last; - for(var y=t<0?t:e; - n; - ){ - if(h=n._prev,(n._act||y<=n._end)&&n._ts&&c!==n){ - if(n.parent!==this)return this.render(t,i,s); - if(n.render(n._ts>0?(y-n._start)*n._ts:(n._dirty?n.totalDuration():n._tDur)+(y-n._start)*n._ts,i,s||qS&&OC(n)),e!==this._time||!this._ts&&!a){ - c=0,h&&(v+=this._zTime=y?-1e-8:IT); - break} - } - n=h} - } - if(c&&!i&&(this.pause(),c.render(e>=w?0:-1e-8)._zTime=e>=w?1:-1,this._ts))return this._start=u,qC(this),this.render(t,i,s); - this._onUpdate&&!i&&NO(this,"onUpdate",!0),(v===g&&this._tTime>=this.totalDuration()||!v&&w)&&(u!==this._start&&Math.abs(l)===Math.abs(this._ts)||this._lock||((t||!m)&&(v===g&&this._ts>0||!v&&this._ts<0)&&$C(this,1),i||t<0&&!w||!v&&!w&&g||(NO(this,v===g&&t>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(v<g&&this.timeScale()>0)&&this._prom())))} - return this} - ,"render"),s.add=Qt(function(t,i){ - var s=this; - if(BT(i)||(i=aO(this,i,t)),!(t instanceof cI)){ - if(jT(t))return t.forEach(function(t){ - return s.add(t,i)} - ),this; - if(DT(t))return this.addLabel(t,i); - if(!GT(t))return this; - t=AI.delayedCall(0,t)} - return this!==t?QC(this,t,i):this} - ,"add"),s.getChildren=Qt(function(t,i,s,e){ - void 0===t&&(t=!0),void 0===i&&(i=!0),void 0===s&&(s=!0),void 0===e&&(e=-1e8); - for(var n=[],h=this._first; - h; - )h._start>=e&&(h instanceof AI?i&&n.push(h):(s&&n.push(h),t&&n.push.apply(n,h.getChildren(!0,i,s)))),h=h._next; - return n} - ,"getChildren"),s.getById=Qt(function(t){ - for(var i=this.getChildren(1,1,1),s=i.length; - s--; - )if(i[s].vars.id===t)return i[s]} - ,"getById"),s.remove=Qt(function(t){ - return DT(t)?this.removeLabel(t):GT(t)?this.killTweensOf(t):(t.parent===this&&FC(this,t),t===this._recent&&(this._recent=this._last),HC(this))} - ,"remove"),s.totalTime=Qt(function(i,s){ - return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=AC(zO.time-(this._ts>0?i/this._ts:(this.totalDuration()-i)/-this._ts))),t.prototype.totalTime.call(this,i,s),this._forcing=0,this):this._tTime} - ,"totalTime"),s.addLabel=Qt(function(t,i){ - return this.labels[t]=aO(this,i),this} - ,"addLabel"),s.removeLabel=Qt(function(t){ - return delete this.labels[t],this} - ,"removeLabel"),s.addPause=Qt(function(t,i,s){ - var e=AI.delayedCall(0,i||oC,s); - return e.data="isPause",this._hasPause=1,QC(this,e,aO(this,t))} - ,"addPause"),s.removePause=Qt(function(t){ - var i=this._first; - for(t=aO(this,t); - i; - )i._start===t&&"isPause"===i.data&&$C(i),i=i._next} - ,"removePause"),s.killTweensOf=Qt(function(t,i,s){ - for(var e=this.getTweensOf(t,s),n=e.length; - n--; - )uI!==e[n]&&e[n].kill(t,i); - return this} - ,"killTweensOf"),s.getTweensOf=Qt(function(t,i){ - for(var s,e=[],n=mO(t),h=this._first,r=BT(i); - h; - )h instanceof AI?TC(h._targets,n)&&(r?(!uI||h._initted&&h._ts)&&h.globalTime(0)<=i&&h.globalTime(h.totalDuration())>i:!i||h.isActive())&&e.push(h):(s=h.getTweensOf(n,i)).length&&e.push.apply(e,s),h=h._next; - return e} - ,"getTweensOf"),s.tweenTo=Qt(function(t,i){ - i=i||{ - } - ; - var s,e=this,n=aO(e,t),h=i,r=h.startAt,o=h.onStart,a=h.onStartParams,c=h.immediateRender,l=AI.to(e,RC({ - ease:i.ease||"none",lazy:!1,immediateRender:!1,time:n,overwrite:"auto",duration:i.duration||Math.abs((n-(r&&"time"in r?r.time:e._time))/e.timeScale())||IT,onStart:Qt(function(){ - if(e.pause(),!s){ - var t=i.duration||Math.abs((n-(r&&"time"in r?r.time:e._time))/e.timeScale()); - l._dur!==t&&hO(l,t,0,1).render(l._time,!0,!0),s=1} - o&&o.apply(l,a||[])} - ,"onStart")} - ,i)); - return c?l.render(0):l} - ,"tweenTo"),s.tweenFromTo=Qt(function(t,i,s){ - return this.tweenTo(i,RC({ - startAt:{ - time:aO(this,t)} - } - ,s))} - ,"tweenFromTo"),s.recent=Qt(function(){ - return this._recent} - ,"recent"),s.nextLabel=Qt(function(t){ - return void 0===t&&(t=this._time),PO(this,aO(this,t))} - ,"nextLabel"),s.previousLabel=Qt(function(t){ - return void 0===t&&(t=this._time),PO(this,aO(this,t),1)} - ,"previousLabel"),s.currentLabel=Qt(function(t){ - return arguments.length?this.seek(t,!0):this.previousLabel(this._time+IT)} - ,"currentLabel"),s.shiftChildren=Qt(function(t,i,s){ - void 0===s&&(s=0); - var e,n=this._first,h=this.labels; - for(t=AC(t); - n; - )n._start>=s&&(n._start+=t,n._end+=t),n=n._next; - if(i)for(e in h)h[e]>=s&&(h[e]+=t); - return HC(this)} - ,"shiftChildren"),s.invalidate=Qt(function(i){ - var s=this._first; - for(this._lock=0; - s; - )s.invalidate(i),s=s._next; - return t.prototype.invalidate.call(this,i)} - ,"invalidate"),s.clear=Qt(function(t){ - void 0===t&&(t=!0); - for(var i,s=this._first; - s; - )i=s._next,this.remove(s),s=i; - return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={ - } - ),HC(this)} - ,"clear"),s.totalDuration=Qt(function(t){ - var i,s,e,n=0,h=this,r=h._last,o=OT; - if(arguments.length)return h.timeScale((h._repeat<0?h.duration():h.totalDuration())/(h.reversed()?-t:t)); - if(h._dirty){ - for(e=h.parent; - r; - )i=r._prev,r._dirty&&r.totalDuration(),(s=r._start)>o&&h._sort&&r._ts&&!h._lock?(h._lock=1,QC(h,r,s-r._delay,1)._lock=0):o=s,s<0&&r._ts&&(n-=s,(!e&&!h._dp||e&&e.smoothChildTiming)&&(h._start+=AC(s/h._ts),h._time-=s,h._tTime-=s),h.shiftChildren(-s,!1,-1/0),o=0),r._end>n&&r._ts&&(n=r._end),r=i; - hO(h,h===JS&&h._time>n?h._time:n,1,1),h._dirty=0} - return h._tDur} - ,"totalDuration"),i.updateRoot=Qt(function(t){ - if(JS._ts&&(IC(JS,YC(t,JS)),sT=zO.frame),zO.frame>=gC){ - gC+=TT.autoSleep||120; - var i=JS._first; - if((!i||!i._ts)&&TT.autoSleep&&zO._listeners.length<2){ - for(; - i&&!i._ts; - )i=i._next; - i||zO.sleep()} - } - } - ,"updateRoot"),i} - (cI); - RC(lI.prototype,{ - _lock:0,_hasPause:0,_forcing:0} - ); - var uI,dI,fI=Qt(function(t,i,s,e,n,h,r){ - var o,a,c,l,u,d,f,p,w=new BI(this._pt,t,i,0,1,RI,null,n),g=0,m=0; - for(w.b=s,w.e=e,s+="",(f=~(e+="").indexOf("random("))&&(e=kO(e)),h&&(h(p=[s,e],t,i),s=p[0],e=p[1]),a=s.match(JT)||[]; - o=JT.exec(e); - )l=o[0],u=e.substring(g,o.index),c?c=(c+1)%5:"rgba("===u.substr(-5)&&(c=1),l!==a[m++]&&(d=parseFloat(a[m-1])||0,w._pt={ - _next:w._pt,p:u||1===m?u:",",s:d,c:"="===l.charAt(1)?SC(d,l)-d:parseFloat(l)-d,m:c&&c<4?Math.round:0} - ,g=JT.lastIndex); - return w.c=g<e.length?e.substring(g,e.length):"",w.fp=r,(QT.test(e)||f)&&(w.e=0),this._pt=w,w} - ,"_addComplexStringPropTween"),pI=Qt(function(t,i,s,e,n,h,r,o,a,c){ - GT(e)&&(e=e(n||0,t,h)); - var l,u=t[i],d="get"!==s?s:GT(u)?a?t[i.indexOf("set")||!GT(t["get"+i.substr(3)])?i:"get"+i.substr(3)](a):t[i]():u,f=GT(u)?a?CI:TI:SI; - if(DT(e)&&(~e.indexOf("random(")&&(e=kO(e)),"="===e.charAt(1)&&((l=SC(d,e)+(dO(d)||0))||0===l)&&(e=l)),!c||d!==e||dI)return isNaN(d*e)||""===e?(!u&&!(i in t)&&nC(i,e),fI.call(this,t,i,d,e,f,o||TT.stringFilter,a)):(l=new BI(this._pt,t,i,+d||0,e-(d||0),"boolean"==typeof u?xI:kI,0,f),a&&(l.fp=a),r&&l.modifier(r,this,t),this._pt=l)} - ,"_addPropTween"),wI=Qt(function(t,i,s,e,n){ - if(GT(t)&&(t=bI(t,n,i,s,e)),!FT(t)||t.style&&t.nodeType||jT(t)||VT(t))return DT(t)?bI(t,n,i,s,e):t; - var h,r={ - } - ; - for(h in t)r[h]=bI(t[h],n,i,s,e); - return r} - ,"_processVars"),gI=Qt(function(t,i,s,e,n,h){ - var r,o,a,c; - if(pC[t]&&!1!==(r=new pC[t]).init(n,r.rawVars?i[t]:wI(i[t],e,n,h,s),s,e,h)&&(s._pt=o=new BI(s._pt,n,t,0,1,r.render,r,0,r.priority),s!==eT))for(a=s._ptLookup[s._targets.indexOf(n)],c=r._props.length; - c--; - )a[r._props[c]]=o; - return r} - ,"_checkPlugin"),mI=Qt(function t(i,s,e){ - var n,h,r,o,a,c,l,u,d,f,p,w,g,m=i.vars,v=m.ease,_=m.startAt,M=m.immediateRender,b=m.lazy,y=m.onUpdate,E=m.runBackwards,A=m.yoyoEase,S=m.keyframes,T=m.autoRevert,C=i._dur,O=i._startAt,I=i._targets,k=i.parent,x=k&&"nested"===k.data?k.vars.targets:I,R="auto"===i._overwrite&&!YS,P=i.timeline; - if(P&&(!S||!v)&&(v="none"),i._ease=eI(v,CT.ease),i._yEase=A?iI(eI(!0===A?v:A,CT.ease)):0,A&&i._yoyo&&!i._repeat&&(A=i._yEase,i._yEase=i._ease,i._ease=A),i._from=!P&&!!m.runBackwards,!P||S&&!m.stagger){ - if(w=(u=I[0]?MC(I[0]).harness:0)&&m[u.prop],n=DC(m,uC),O&&(O._zTime<0&&O.progress(1),s<0&&E&&M&&!T?O.render(-1,!0):O.revert(E&&C?cC:aC),O._lazy=0),_){ - if($C(i._startAt=AI.set(I,RC({ - data:"isStart",overwrite:!1,parent:k,immediateRender:!0,lazy:!O&&$T(b),startAt:null,delay:0,onUpdate:y&&function(){ - return NO(i,"onUpdate")} - ,stagger:0} - ,_))),i._startAt._dp=0,i._startAt._sat=i,s<0&&(qS||!M&&!T)&&i._startAt.revert(cC),M&&C&&s<=0&&e<=0)return void(s&&(i._zTime=s))} - else if(E&&C&&!O)if(s&&(M=!1),r=RC({ - overwrite:!1,data:"isFromStart",lazy:M&&!O&&$T(b),immediateRender:M,stagger:0,parent:k} - ,n),w&&(r[u.prop]=w),$C(i._startAt=AI.set(I,r)),i._startAt._dp=0,i._startAt._sat=i,s<0&&(qS?i._startAt.revert(cC):i._startAt.render(-1,!0)),i._zTime=s,M){ - if(!s)return} - else t(i._startAt,IT,IT); - for(i._pt=i._ptCache=0,b=C&&$T(b)||b&&!C,h=0; - h<I.length; - h++){ - if(l=(a=I[h])._gsap||_C(I)[h]._gsap,i._ptLookup[h]=f={ - } - ,fC[l.id]&&dC.length&&CC(),p=x===I?h:x.indexOf(a),u&&!1!==(d=new u).init(a,w||n,i,p,x)&&(i._pt=o=new BI(i._pt,a,d.name,0,1,d.render,d,0,d.priority),d._props.forEach(function(t){ - f[t]=o} - ),d.priority&&(c=1)),!u||w)for(r in n)pC[r]&&(d=gI(r,n,i,p,a,x))?d.priority&&(c=1):f[r]=o=pI.call(i,a,r,"get",n[r],p,x,0,m.stringFilter); - i._op&&i._op[h]&&i.kill(a,i._op[h]),R&&i._pt&&(uI=i,JS.killTweensOf(a,f,i.globalTime(s)),g=!i.parent,uI=0),i._pt&&b&&(fC[l.id]=1)} - c&&GI(i),i._onInit&&i._onInit(i)} - i._onUpdate=y,i._initted=(!i._op||i._pt)&&!g,S&&s<=0&&P.render(OT,!0,!0)} - ,"_initTween"),vI=Qt(function(t,i,s,e,n,h,r,o){ - var a,c,l,u,d=(t._pt&&t._ptCache||(t._ptCache={ - } - ))[i]; - if(!d)for(d=t._ptCache[i]=[],l=t._ptLookup,u=t._targets.length; - u--; - ){ - if((a=l[u][i])&&a.d&&a.d._pt)for(a=a.d._pt; - a&&a.p!==i&&a.fp!==i; - )a=a._next; - if(!a)return dI=1,t.vars[i]="+=0",mI(t,r),dI=0,o?hC(i+" not eligible for reset"):1; - d.push(a)} - for(u=d.length; - u--; - )(a=(c=d[u])._pt||c).s=!e&&0!==e||n?a.s+(e||0)+h*a.c:e,a.c=s-a.s,c.e&&(c.e=EC(s)+dO(c.e)),c.b&&(c.b=a.s+dO(c.b))} - ,"_updatePropTweens"),_I=Qt(function(t,i){ - var s,e,n,h,r=t[0]?MC(t[0]).harness:0,o=r&&r.aliases; - if(!o)return i; - for(e in s=NC({ - } - ,i),o)if(e in s)for(n=(h=o[e].split(",")).length; - n--; - )s[h[n]]=s[e]; - return s} - ,"_addAliasesToVars"),MI=Qt(function(t,i,s,e){ - var n,h,r=i.ease||e||"power1.inOut"; - if(jT(i))h=s[t]||(s[t]=[]),i.forEach(function(t,s){ - return h.push({ - t:s/(i.length-1)*100,v:t,e:r} - )} - ); - else for(n in i)h=s[n]||(s[n]=[]),"ease"===n||h.push({ - t:parseFloat(t),v:i[n],e:r} - )} - ,"_parseKeyframe"),bI=Qt(function(t,i,s,e,n){ - return GT(t)?t.call(i,s,e,n):DT(t)&&~t.indexOf("random(")?kO(t):t} - ,"_parseFuncOrString"),yI=vC+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",EI={ - } - ; - yC(yI+",id,stagger,delay,duration,paused,scrollTrigger",function(t){ - return EI[t]=1} - ); - var AI=function(t){ - function i(i,s,e,n){ - var h; - "number"==typeof s&&(e.duration=s,s=e,e=null); - var r,o,a,c,l,u,d,f,p=(h=t.call(this,n?s:GC(s))||this).vars,w=p.duration,g=p.delay,m=p.immediateRender,v=p.stagger,_=p.overwrite,M=p.keyframes,b=p.defaults,y=p.scrollTrigger,E=p.yoyoEase,A=s.parent||JS,S=(jT(i)||VT(i)?BT(i[0]):"length"in s)?[i]:mO(i); - if(h._targets=S.length?_C(S):hC("GSAP target "+i+" not found. https://gsap.com",!TT.nullTargetWarn)||[],h._ptLookup=[],h._overwrite=_,M||v||WT(w)||WT(g)){ - if(s=h.vars,(r=h.timeline=new lI({ - data:"nested",defaults:b||{ - } - ,targets:A&&"nested"===A.data?A.vars.targets:S} - )).kill(),r.parent=r._dp=KS(h),r._start=0,v||WT(w)||WT(g)){ - if(c=S.length,d=v&&MO(v),FT(v))for(l in v)~yI.indexOf(l)&&(f||(f={ - } - ),f[l]=v[l]); - for(o=0; - o<c; - o++)(a=DC(s,EI)).stagger=0,E&&(a.yoyoEase=E),f&&NC(a,f),u=S[o],a.duration=+bI(w,KS(h),o,u,S),a.delay=(+bI(g,KS(h),o,u,S)||0)-h._delay,!v&&1===c&&a.delay&&(h._delay=g=a.delay,h._start+=g,a.delay=0),r.to(u,a,d?d(o,u,S):0),r._ease=qO.none; - r.duration()?w=g=0:h.timeline=0} - else if(M){ - GC(RC(r.vars.defaults,{ - ease:"none"} - )),r._ease=eI(M.ease||s.ease||"none"); - var T,C,O,I=0; - if(jT(M))M.forEach(function(t){ - return r.to(S,t,">")} - ),r.duration(); - else{ - for(l in a={ - } - ,M)"ease"===l||"easeEach"===l||MI(l,M[l],a,M.easeEach); - for(l in a)for(T=a[l].sort(function(t,i){ - return t.t-i.t} - ),I=0,o=0; - o<T.length; - o++)(O={ - ease:(C=T[o]).e,duration:(C.t-(o?T[o-1].t:0))/100*w} - )[l]=C.v,r.to(S,O,I),I+=O.duration; - r.duration()<w&&r.to({ - } - ,{ - duration:w-r.duration()} - )} - } - w||h.duration(w=r.duration())} - else h.timeline=0; - return!0!==_||YS||(uI=KS(h),JS.killTweensOf(S),uI=0),QC(A,KS(h),e),s.reversed&&h.reverse(),s.paused&&h.paused(!0),(m||!w&&!M&&h._start===AC(A._time)&&$T(m)&&jC(KS(h))&&"nested"!==A.data)&&(h._tTime=-1e-8,h.render(Math.max(0,-g)||0)),y&&ZC(KS(h),y),h} - zS(i,t),Qt(i,"Tween"); - var s=i.prototype; - return s.render=Qt(function(t,i,s){ - var e,n,h,r,o,a,c,l,u,d=this._time,f=this._tDur,p=this._dur,w=t<0,g=t>f-IT&&!w?f:t<IT?0:t; - if(p){ - if(g!==this._tTime||!t||s||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==w||this._lazy){ - if(e=g,l=this.timeline,this._repeat){ - if(r=p+this._rDelay,this._repeat<-1&&w)return this.totalTime(100*r+t,i,s); - if(e=AC(g%r),g===f?(h=this._repeat,e=p):(h=~~(o=AC(g/r)))&&h===o?(e=p,h--):e>p&&(e=p),(a=this._yoyo&&1&h)&&(u=this._yEase,e=p-e),o=zC(this._tTime,r),e===d&&!s&&this._initted&&h===o)return this._tTime=g,this; - h!==o&&(l&&this._yEase&&sI(l,a),this.vars.repeatRefresh&&!a&&!this._lock&&e!==r&&this._initted&&(this._lock=s=1,this.render(AC(r*h),!0).invalidate()._lock=0))} - if(!this._initted){ - if(tO(this,w?t:e,s,i,g))return this._tTime=0,this; - if(!(d===this._time||s&&this.vars.repeatRefresh&&h!==o))return this; - if(p!==this._dur)return this.render(t,i,s)} - if(this._tTime=g,this._time=e,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=c=(u||this._ease)(e/p),this._from&&(this.ratio=c=1-c),!d&&g&&!i&&!o&&(NO(this,"onStart"),this._tTime!==g))return this; - for(n=this._pt; - n; - )n.r(c,n.d),n=n._next; - l&&l.render(t<0?t:l._dur*l._ease(e/this._dur),i,s)||this._startAt&&(this._zTime=t),this._onUpdate&&!i&&(w&&VC(this,t,i,s),NO(this,"onUpdate")),this._repeat&&h!==o&&this.vars.onRepeat&&!i&&this.parent&&NO(this,"onRepeat"),g!==this._tDur&&g||this._tTime!==g||(w&&!this._onUpdate&&VC(this,t,!0,!0),(t||!p)&&(g===this._tDur&&this._ts>0||!g&&this._ts<0)&&$C(this,1),i||w&&!d||!(g||d||a)||(NO(this,g===f?"onComplete":"onReverseComplete",!0),this._prom&&!(g<f&&this.timeScale()>0)&&this._prom()))} - } - else eO(this,t,i,s); - return this} - ,"render"),s.targets=Qt(function(){ - return this._targets} - ,"targets"),s.invalidate=Qt(function(i){ - return(!i||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(i),t.prototype.invalidate.call(this,i)} - ,"invalidate"),s.resetTo=Qt(function(t,i,s,e,n){ - nT||zO.wake(),this._ts||this.play(); - var h,r=Math.min(this._dur,(this._dp._time-this._start)*this._ts); - return this._initted||mI(this,r),h=this._ease(r/this._dur),vI(this,t,i,s,e,h,r,n)?this.resetTo(t,i,s,e,1):(XC(this,0),this.parent||UC(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))} - ,"resetTo"),s.kill=Qt(function(t,i){ - if(void 0===i&&(i="all"),!(t||i&&"all"!==i))return this._lazy=this._pt=0,this.parent?LO(this):this.scrollTrigger&&this.scrollTrigger.kill(!!qS),this; - if(this.timeline){ - var s=this.timeline.totalDuration(); - return this.timeline.killTweensOf(t,i,uI&&!0!==uI.vars.overwrite)._first||LO(this),this.parent&&s!==this.timeline.totalDuration()&&hO(this,this._dur*this.timeline._tDur/s,0,1),this} - var e,n,h,r,o,a,c,l=this._targets,u=t?mO(t):l,d=this._ptLookup,f=this._pt; - if((!i||"all"===i)&&BC(l,u))return"all"===i&&(this._pt=0),LO(this); - for(e=this._op=this._op||[],"all"!==i&&(DT(i)&&(o={ - } - ,yC(i,function(t){ - return o[t]=1} - ),i=o),i=_I(l,i)),c=l.length; - c--; - )if(~u.indexOf(l[c]))for(o in n=d[c],"all"===i?(e[c]=i,r=n,h={ - } - ):(h=e[c]=e[c]||{ - } - ,r=i),r)(a=n&&n[o])&&("kill"in a.d&&!0!==a.d.kill(o)||FC(this,a,"_pt"),delete n[o]),"all"!==h&&(h[o]=1); - return this._initted&&!this._pt&&f&&LO(this),this} - ,"kill"),i.to=Qt(function(t,s){ - return new i(t,s,arguments[2])} - ,"to"),i.from=Qt(function(t,i){ - return cO(1,arguments)} - ,"from"),i.delayedCall=Qt(function(t,s,e,n){ - return new i(s,0,{ - immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:s,onReverseComplete:s,onCompleteParams:e,onReverseCompleteParams:e,callbackScope:n} - )} - ,"delayedCall"),i.fromTo=Qt(function(t,i,s){ - return cO(2,arguments)} - ,"fromTo"),i.set=Qt(function(t,s){ - return s.duration=0,s.repeatDelay||(s.repeat=0),new i(t,s)} - ,"set"),i.killTweensOf=Qt(function(t,i,s){ - return JS.killTweensOf(t,i,s)} - ,"killTweensOf"),i} - (cI); - RC(AI.prototype,{ - _targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0} - ),yC("staggerTo,staggerFrom,staggerFromTo",function(t){ - AI[t]=function(){ - var i=new lI,s=pO.call(arguments,0); - return s.splice("staggerFromTo"===t?5:4,0,0),i[t].apply(i,s)} - } - ); - var SI=Qt(function(t,i,s){ - return t[i]=s} - ,"_setterPlain"),TI=Qt(function(t,i,s){ - return t[i](s)} - ,"_setterFunc"),CI=Qt(function(t,i,s,e){ - return t[i](e.fp,s)} - ,"_setterFuncWithParam"),OI=Qt(function(t,i,s){ - return t.setAttribute(i,s)} - ,"_setterAttribute"),II=Qt(function(t,i){ - return GT(t[i])?TI:UT(t[i])&&t.setAttribute?OI:SI} - ,"_getSetter"),kI=Qt(function(t,i){ - return i.set(i.t,i.p,Math.round(1e6*(i.s+i.c*t))/1e6,i)} - ,"_renderPlain"),xI=Qt(function(t,i){ - return i.set(i.t,i.p,!!(i.s+i.c*t),i)} - ,"_renderBoolean"),RI=Qt(function(t,i){ - var s=i._pt,e=""; - if(!t&&i.b)e=i.b; - else if(1===t&&i.e)e=i.e; - else{ - for(; - s; - )e=s.p+(s.m?s.m(s.s+s.c*t):Math.round(1e4*(s.s+s.c*t))/1e4)+e,s=s._next; - e+=i.c} - i.set(i.t,i.p,e,i)} - ,"_renderComplexString"),PI=Qt(function(t,i){ - for(var s=i._pt; - s; - )s.r(t,s.d),s=s._next} - ,"_renderPropTweens"),NI=Qt(function(t,i,s,e){ - for(var n,h=this._pt; - h; - )n=h._next,h.p===e&&h.modifier(t,i,s),h=n} - ,"_addPluginModifier"),LI=Qt(function(t){ - for(var i,s,e=this._pt; - e; - )s=e._next,e.p===t&&!e.op||e.op===t?FC(this,e,"_pt"):e.dep||(i=1),e=s; - return!i} - ,"_killPropTweensOf"),DI=Qt(function(t,i,s,e){ - e.mSet(t,i,e.m.call(e.tween,s,e.mt),e)} - ,"_setterWithModifier"),GI=Qt(function(t){ - for(var i,s,e,n,h=t._pt; - h; - ){ - for(i=h._next,s=e; - s&&s.pr>h.pr; - )s=s._next; - (h._prev=s?s._prev:n)?h._prev._next=h:e=h,(h._next=s)?s._prev=h:n=h,h=i} - t._pt=e} - ,"_sortPropTweensByPriority"),BI=function(){ - function t(t,i,s,e,n,h,r,o,a){ - this.t=i,this.s=e,this.c=n,this.p=s,this.r=h||kI,this.d=r||this,this.set=o||SI,this.pr=a||0,this._next=t,t&&(t._prev=this)} - return Qt(t,"PropTween"),t.prototype.modifier=Qt(function(t,i,s){ - this.mSet=this.mSet||this.set,this.set=DI,this.m=t,this.mt=s,this.tween=i} - ,"modifier"),t} - (); - yC(vC+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(t){ - return uC[t]=1} - ),iC.TweenMax=iC.TweenLite=AI,iC.TimelineLite=iC.TimelineMax=lI,JS=new lI({ - sortChildren:!1,defaults:CT,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0} - ),TT.stringFilter=KO; - var UI=[],FI={ - } - ,$I=[],HI=0,WI=0,VI=Qt(function(t){ - return(FI[t]||$I).map(function(t){ - return t()} - )} - ,"_dispatch"),jI=Qt(function(){ - var t=Date.now(),i=[]; - t-HI>2&&(VI("matchMediaInit"),UI.forEach(function(t){ - var s,e,n,h,r=t.queries,o=t.conditions; - for(e in r)(s=QS.matchMedia(r[e]).matches)&&(n=1),s!==o[e]&&(o[e]=s,h=1); - h&&(t.revert(),n&&i.push(t))} - ),VI("matchMediaRevert"),i.forEach(function(t){ - return t.onMatch(t,function(i){ - return t.add(null,i)} - )} - ),HI=t,VI("matchMedia"))} - ,"_onMediaChange"),KI=function(){ - function t(t,i){ - this.selector=i&&vO(i),this.data=[],this._r=[],this.isReverted=!1,this.id=WI++,t&&this.add(t)} - Qt(t,"Context"); - var i=t.prototype; - return i.add=Qt(function(t,i,s){ - GT(t)&&(s=i,i=t,t=GT); - var e=this,n=Qt(function(){ - var t,n=XS,h=e.selector; - return n&&n!==e&&n.data.push(e),s&&(e.selector=vO(s)),XS=e,t=i.apply(e,arguments),GT(t)&&e._r.push(t),XS=n,e.selector=h,e.isReverted=!1,t} - ,"f"); - return e.last=n,t===GT?n(e,function(t){ - return e.add(null,t)} - ):t?e[t]=n:n} - ,"add"),i.ignore=Qt(function(t){ - var i=XS; - XS=null,t(this),XS=i} - ,"ignore"),i.getTweens=Qt(function(){ - var i=[]; - return this.data.forEach(function(s){ - return s instanceof t?i.push.apply(i,s.getTweens()):s instanceof AI&&!(s.parent&&"nested"===s.parent.data)&&i.push(s)} - ),i} - ,"getTweens"),i.clear=Qt(function(){ - this._r.length=this.data.length=0} - ,"clear"),i.kill=Qt(function(t,i){ - var s=this; - if(t?function(){ - for(var i,e=s.getTweens(),n=s.data.length; - n--; - )"isFlip"===(i=s.data[n]).data&&(i.revert(),i.getChildren(!0,!0,!1).forEach(function(t){ - return e.splice(e.indexOf(t),1)} - )); - for(e.map(function(t){ - return{ - g:t._dur||t._delay||t._sat&&!t._sat.vars.immediateRender?t.globalTime(0):-1/0,t} - } - ).sort(function(t,i){ - return i.g-t.g||-1/0} - ).forEach(function(i){ - return i.t.revert(t)} - ),n=s.data.length; - n--; - )(i=s.data[n])instanceof lI?"nested"!==i.data&&(i.scrollTrigger&&i.scrollTrigger.revert(),i.kill()):!(i instanceof AI)&&i.revert&&i.revert(t); - s._r.forEach(function(i){ - return i(t,s)} - ),s.isReverted=!0} - ():this.data.forEach(function(t){ - return t.kill&&t.kill()} - ),this.clear(),i)for(var e=UI.length; - e--; - )UI[e].id===this.id&&UI.splice(e,1)} - ,"kill"),i.revert=Qt(function(t){ - this.kill(t||{ - } - )} - ,"revert"),t} - (),zI=function(){ - function t(t){ - this.contexts=[],this.scope=t,XS&&XS.data.push(this)} - Qt(t,"MatchMedia"); - var i=t.prototype; - return i.add=Qt(function(t,i,s){ - FT(t)||(t={ - matches:t} - ); - var e,n,h,r=new KI(0,s||this.scope),o=r.conditions={ - } - ; - for(n in XS&&!r.selector&&(r.selector=XS.selector),this.contexts.push(r),i=r.add("onMatch",i),r.queries=t,t)"all"===n?h=1:(e=QS.matchMedia(t[n]))&&(UI.indexOf(r)<0&&UI.push(r),(o[n]=e.matches)&&(h=1),e.addListener?e.addListener(jI):e.addEventListener("change",jI)); - return h&&i(r,function(t){ - return r.add(null,t)} - ),this} - ,"add"),i.revert=Qt(function(t){ - this.kill(t||{ - } - )} - ,"revert"),i.kill=Qt(function(t){ - this.contexts.forEach(function(i){ - return i.kill(t,!0)} - )} - ,"kill"),t} - (),YI={ - registerPlugin:Qt(function(){ - for(var t=arguments.length,i=new Array(t),s=0; - s<t; - s++)i[s]=arguments[s]; - i.forEach(function(t){ - return GO(t)} - )} - ,"registerPlugin"),timeline:Qt(function(t){ - return new lI(t)} - ,"timeline"),getTweensOf:Qt(function(t,i){ - return JS.getTweensOf(t,i)} - ,"getTweensOf"),getProperty:Qt(function(t,i,s,e){ - DT(t)&&(t=mO(t)[0]); - var n=MC(t||{ - } - ).get,h=s?xC:kC; - return"native"===s&&(s=""),t?i?h((pC[i]&&pC[i].get||n)(t,i,s,e)):function(i,s,e){ - return h((pC[i]&&pC[i].get||n)(t,i,s,e))} - :t} - ,"getProperty"),quickSetter:Qt(function(t,i,s){ - if((t=mO(t)).length>1){ - var e=t.map(function(t){ - return QI.quickSetter(t,i,s)} - ),n=e.length; - return function(t){ - for(var i=n; - i--; - )e[i](t)} - } - t=t[0]||{ - } - ; - var h=pC[i],r=MC(t),o=r.harness&&(r.harness.aliases||{ - } - )[i]||i,a=h?function(i){ - var e=new h; - eT._pt=0,e.init(t,s?i+s:i,eT,0,[t]),e.render(1,e),eT._pt&&PI(1,eT)} - :r.set(t,o); - return h?a:function(i){ - return a(t,o,s?i+s:i,r,1)} - } - ,"quickSetter"),quickTo:Qt(function(t,i,s){ - var e,n=QI.to(t,RC(((e={ - } - )[i]="+=0.1",e.paused=!0,e.stagger=0,e),s||{ - } - )),h=Qt(function(t,s,e){ - return n.resetTo(i,t,s,e)} - ,"func"); - return h.tween=n,h} - ,"quickTo"),isTweening:Qt(function(t){ - return JS.getTweensOf(t,!0).length>0} - ,"isTweening"),defaults:Qt(function(t){ - return t&&t.ease&&(t.ease=eI(t.ease,CT.ease)),LC(CT,t||{ - } - )} - ,"defaults"),config:Qt(function(t){ - return LC(TT,t||{ - } - )} - ,"config"),registerEffect:Qt(function(t){ - var i=t.name,s=t.effect,e=t.plugins,n=t.defaults,h=t.extendTimeline; - (e||"").split(",").forEach(function(t){ - return t&&!pC[t]&&!iC[t]&&hC(i+" effect requires "+t+" plugin.")} - ),wC[i]=function(t,i,e){ - return s(mO(t),RC(i||{ - } - ,n),e)} - ,h&&(lI.prototype[i]=function(t,s,e){ - return this.add(wC[i](t,FT(s)?s:(e=s)&&{ - } - ,this),e)} - )} - ,"registerEffect"),registerEase:Qt(function(t,i){ - qO[t]=eI(i)} - ,"registerEase"),parseEase:Qt(function(t,i){ - return arguments.length?eI(t,i):qO} - ,"parseEase"),getById:Qt(function(t){ - return JS.getById(t)} - ,"getById"),exportRoot:Qt(function(t,i){ - void 0===t&&(t={ - } - ); - var s,e,n=new lI(t); - for(n.smoothChildTiming=$T(t.smoothChildTiming),JS.remove(n),n._dp=0,n._time=n._tTime=JS._time,s=JS._first; - s; - )e=s._next,!i&&!s._dur&&s instanceof AI&&s.vars.onComplete===s._targets[0]||QC(n,s,s._start-s._delay),s=e; - return QC(JS,n,0),n} - ,"exportRoot"),context:Qt(function(t,i){ - return t?new KI(t,i):XS} - ,"context"),matchMedia:Qt(function(t){ - return new zI(t)} - ,"matchMedia"),matchMediaRefresh:Qt(function(){ - return UI.forEach(function(t){ - var i,s,e=t.conditions; - for(s in e)e[s]&&(e[s]=!1,i=1); - i&&t.revert()} - )||jI()} - ,"matchMediaRefresh"),addEventListener:Qt(function(t,i){ - var s=FI[t]||(FI[t]=[]); - ~s.indexOf(i)||s.push(i)} - ,"addEventListener"),removeEventListener:Qt(function(t,i){ - var s=FI[t],e=s&&s.indexOf(i); - e>=0&&s.splice(e,1)} - ,"removeEventListener"),utils:{ - wrap:OO,wrapYoyo:IO,distribute:MO,random:EO,snap:yO,normalize:TO,getUnit:dO,clamp:fO,splitColor:$O,toArray:mO,selector:vO,mapRange:xO,pipe:AO,unitize:SO,interpolate:RO,shuffle:_O} - ,install:eC,effects:wC,ticker:zO,updateRoot:lI.updateRoot,plugins:pC,globalTimeline:JS,core:{ - PropTween:BI,globals:rC,Tween:AI,Timeline:lI,Animation:cI,getCache:MC,_removeLinkedListItem:FC,reverting:Qt(function(){ - return qS} - ,"reverting"),context:Qt(function(t){ - return t&&XS&&(XS.data.push(t),t._ctx=XS),XS} - ,"context"),suppressOverwrites:Qt(function(t){ - return YS=t} - ,"suppressOverwrites")} - } - ; - yC("to,from,fromTo,delayedCall,set,killTweensOf",function(t){ - return YI[t]=AI[t]} - ),zO.add(lI.updateRoot),eT=YI.to({ - } - ,{ - duration:0} - ); - var qI=Qt(function(t,i){ - for(var s=t._pt; - s&&s.p!==i&&s.op!==i&&s.fp!==i; - )s=s._next; - return s} - ,"_getPluginPropTween"),XI=Qt(function(t,i){ - var s,e,n,h=t._targets; - for(s in i)for(e=h.length; - e--; - )(n=t._ptLookup[e][s])&&(n=n.d)&&(n._pt&&(n=qI(n,s)),n&&n.modifier&&n.modifier(i[s],t,h[e],s))} - ,"_addModifiers"),JI=Qt(function(t,i){ - return{ - name:t,headless:1,rawVars:1,init:Qt(function(t,s,e){ - e._onInit=function(t){ - var e,n; - if(DT(s)&&(e={ - } - ,yC(s,function(t){ - return e[t]=1} - ),s=e),i){ - for(n in e={ - } - ,s)e[n]=i(s[n]); - s=e} - XI(t,s)} - } - ,"init")} - } - ,"_buildModifierPlugin"),QI=YI.registerPlugin({ - name:"attr",init:Qt(function(t,i,s,e,n){ - var h,r,o; - for(h in this.tween=s,i)o=t.getAttribute(h)||"",(r=this.add(t,"setAttribute",(o||0)+"",i[h],e,n,0,0,h)).op=h,r.b=o,this._props.push(h)} - ,"init"),render:Qt(function(t,i){ - for(var s=i._pt; - s; - )qS?s.set(s.t,s.p,s.b,s):s.r(t,s.d),s=s._next} - ,"render")} - ,{ - name:"endArray",headless:1,init:Qt(function(t,i){ - for(var s=i.length; - s--; - )this.add(t,s,t[s]||0,i[s],0,0,0,0,0,1)} - ,"init")} - ,JI("roundProps",bO),JI("modifiers"),JI("snap",yO))||YI; - AI.version=lI.version=QI.version="3.14.2",iT=1,HT()&&YO(),qO.Power0,qO.Power1,qO.Power2,qO.Power3,qO.Power4,qO.Linear,qO.Quad,qO.Cubic,qO.Quart,qO.Quint,qO.Strong,qO.Elastic,qO.Back,qO.SteppedEase,qO.Bounce,qO.Sine,qO.Expo,qO.Circ; - var ZI,tk,ik,sk,ek,nk,hk,rk,ok=Qt(function(){ - return"undefined"!=typeof window} - ,"_windowExists"),ak={ - } - ,ck=180/Math.PI,lk=Math.PI/180,uk=Math.atan2,dk=/([A-Z])/g,fk=/(left|right|width|margin|padding|x)/i,pk=/[\s,\(]\S/,wk={ - autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"} - ,gk=Qt(function(t,i){ - return i.set(i.t,i.p,Math.round(1e4*(i.s+i.c*t))/1e4+i.u,i)} - ,"_renderCSSProp"),mk=Qt(function(t,i){ - return i.set(i.t,i.p,1===t?i.e:Math.round(1e4*(i.s+i.c*t))/1e4+i.u,i)} - ,"_renderPropWithEnd"),vk=Qt(function(t,i){ - return i.set(i.t,i.p,t?Math.round(1e4*(i.s+i.c*t))/1e4+i.u:i.b,i)} - ,"_renderCSSPropWithBeginning"),_k=Qt(function(t,i){ - return i.set(i.t,i.p,1===t?i.e:t?Math.round(1e4*(i.s+i.c*t))/1e4+i.u:i.b,i)} - ,"_renderCSSPropWithBeginningAndEnd"),Mk=Qt(function(t,i){ - var s=i.s+i.c*t; - i.set(i.t,i.p,~~(s+(s<0?-.5:.5))+i.u,i)} - ,"_renderRoundedCSSProp"),bk=Qt(function(t,i){ - return i.set(i.t,i.p,t?i.e:i.b,i)} - ,"_renderNonTweeningValue"),yk=Qt(function(t,i){ - return i.set(i.t,i.p,1!==t?i.b:i.e,i)} - ,"_renderNonTweeningValueOnlyAtEnd"),Ek=Qt(function(t,i,s){ - return t.style[i]=s} - ,"_setterCSSStyle"),Ak=Qt(function(t,i,s){ - return t.style.setProperty(i,s)} - ,"_setterCSSProp"),Sk=Qt(function(t,i,s){ - return t._gsap[i]=s} - ,"_setterTransform"),Tk=Qt(function(t,i,s){ - return t._gsap.scaleX=t._gsap.scaleY=s} - ,"_setterScale"),Ck=Qt(function(t,i,s,e,n){ - var h=t._gsap; - h.scaleX=h.scaleY=s,h.renderTransform(n,h)} - ,"_setterScaleWithRender"),Ok=Qt(function(t,i,s,e,n){ - var h=t._gsap; - h[i]=s,h.renderTransform(n,h)} - ,"_setterTransformWithRender"),Ik="transform",kk=Ik+"Origin",xk=Qt(function t(i,s){ - var e=this,n=this.target,h=n.style,r=n._gsap; - if(i in ak&&h){ - if(this.tfm=this.tfm||{ - } - ,"transform"===i)return wk.transform.split(",").forEach(function(i){ - return t.call(e,i,s)} - ); - if(~(i=wk[i]||i).indexOf(",")?i.split(",").forEach(function(t){ - return e.tfm[t]=qk(n,t)} - ):this.tfm[i]=r.x?r[i]:qk(n,i),i===kk&&(this.tfm.zOrigin=r.zOrigin),this.props.indexOf(Ik)>=0)return; - r.svg&&(this.svgo=n.getAttribute("data-svg-origin"),this.props.push(kk,s,"")),i=Ik} - (h||s)&&this.props.push(i,s,h[i])} - ,"_saveStyle"),Rk=Qt(function(t){ - t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))} - ,"_removeIndependentTransforms"),Pk=Qt(function(){ - var t,i,s=this.props,e=this.target,n=e.style,h=e._gsap; - for(t=0; - t<s.length; - t+=3)s[t+1]?2===s[t+1]?e[s[t]](s[t+2]):e[s[t]]=s[t+2]:s[t+2]?n[s[t]]=s[t+2]:n.removeProperty("--"===s[t].substr(0,2)?s[t]:s[t].replace(dk,"-$1").toLowerCase()); - if(this.tfm){ - for(i in this.tfm)h[i]=this.tfm[i]; - h.svg&&(h.renderTransform(),e.setAttribute("data-svg-origin",this.svgo||"")),(t=hk())&&t.isStart||n[Ik]||(Rk(n),h.zOrigin&&n[kk]&&(n[kk]+=" "+h.zOrigin+"px",h.zOrigin=0,h.renderTransform()),h.uncache=1)} - } - ,"_revertStyle"),Nk=Qt(function(t,i){ - var s={ - target:t,props:[],revert:Pk,save:xk} - ; - return t._gsap||QI.core.getCache(t),i&&t.style&&t.nodeType&&i.split(",").forEach(function(t){ - return s.save(t)} - ),s} - ,"_getStyleSaver"),Lk=Qt(function(t,i){ - var s=tk.createElementNS?tk.createElementNS((i||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):tk.createElement(t); - return s&&s.style?s:tk.createElement(t)} - ,"_createElement"),Dk=Qt(function t(i,s,e){ - var n=getComputedStyle(i); - return n[s]||n.getPropertyValue(s.replace(dk,"-$1").toLowerCase())||n.getPropertyValue(s)||!e&&t(i,Bk(s)||s,1)||""} - ,"_getComputedProperty"),Gk="O,Moz,ms,Ms,Webkit".split(","),Bk=Qt(function(t,i,s){ - var e=(i||ek).style,n=5; - if(t in e&&!s)return t; - for(t=t.charAt(0).toUpperCase()+t.substr(1); - n--&&!(Gk[n]+t in e); - ); - return n<0?null:(3===n?"ms":n>=0?Gk[n]:"")+t} - ,"_checkPropPrefix"),Uk=Qt(function(){ - ok()&&window.document&&(ZI=window,tk=ZI.document,ik=tk.documentElement,ek=Lk("div")||{ - style:{ - } - } - ,Lk("div"),Ik=Bk(Ik),kk=Ik+"Origin",ek.style.cssText="border-width:0; - line-height:0; - position:absolute; - padding:0",rk=!!Bk("perspective"),hk=QI.core.reverting,sk=1)} - ,"_initCore"),Fk=Qt(function(t){ - var i,s=t.ownerSVGElement,e=Lk("svg",s&&s.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=t.cloneNode(!0); - n.style.display="block",e.appendChild(n),ik.appendChild(e); - try{ - i=n.getBBox()} - catch(frt){ - } - return e.removeChild(n),ik.removeChild(e),i} - ,"_getReparentedCloneBBox"),$k=Qt(function(t,i){ - for(var s=i.length; - s--; - )if(t.hasAttribute(i[s]))return t.getAttribute(i[s])} - ,"_getAttributeFallbacks"),Hk=Qt(function(t){ - var i,s; - try{ - i=t.getBBox()} - catch(e){ - i=Fk(t),s=1} - return i&&(i.width||i.height)||s||(i=Fk(t)),!i||i.width||i.x||i.y?i:{ - x:+$k(t,["x","cx","x1"])||0,y:+$k(t,["y","cy","y1"])||0,width:0,height:0} - } - ,"_getBBox"),Wk=Qt(function(t){ - return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!Hk(t))} - ,"_isSVG"),Vk=Qt(function(t,i){ - if(i){ - var s,e=t.style; - i in ak&&i!==kk&&(i=Ik),e.removeProperty?("ms"!==(s=i.substr(0,2))&&"webkit"!==i.substr(0,6)||(i="-"+i),e.removeProperty("--"===s?i:i.replace(dk,"-$1").toLowerCase())):e.removeAttribute(i)} - } - ,"_removeProperty"),jk=Qt(function(t,i,s,e,n,h){ - var r=new BI(t._pt,i,s,0,1,h?yk:bk); - return t._pt=r,r.b=e,r.e=n,t._props.push(s),r} - ,"_addNonTweeningPT"),Kk={ - deg:1,rad:1,turn:1} - ,zk={ - grid:1,flex:1} - ,Yk=Qt(function t(i,s,e,n){ - var h,r,o,a,c=parseFloat(e)||0,l=(e+"").trim().substr((c+"").length)||"px",u=ek.style,d=fk.test(s),f="svg"===i.tagName.toLowerCase(),p=(f?"client":"offset")+(d?"Width":"Height"),w=100,g="px"===n,m="%"===n; - if(n===l||!c||Kk[n]||Kk[l])return c; - if("px"!==l&&!g&&(c=t(i,s,e,"px")),a=i.getCTM&&Wk(i),(m||"%"===l)&&(ak[s]||~s.indexOf("adius")))return h=a?i.getBBox()[d?"width":"height"]:i[p],EC(m?c/h*w:c/100*h); - if(u[d?"width":"height"]=w+(g?l:n),r="rem"!==n&&~s.indexOf("adius")||"em"===n&&i.appendChild&&!f?i:i.parentNode,a&&(r=(i.ownerSVGElement||{ - } - ).parentNode),r&&r!==tk&&r.appendChild||(r=tk.body),(o=r._gsap)&&m&&o.width&&d&&o.time===zO.time&&!o.uncache)return EC(c/o.width*w); - if(!m||"height"!==s&&"width"!==s)(m||"%"===l)&&!zk[Dk(r,"display")]&&(u.position=Dk(i,"position")),r===i&&(u.position="static"),r.appendChild(ek),h=ek[p],r.removeChild(ek),u.position="absolute"; - else{ - var v=i.style[s]; - i.style[s]=w+n,h=i[p],v?i.style[s]=v:Vk(i,s)} - return d&&m&&((o=MC(r)).time=zO.time,o.width=r[p]),EC(g?h*c/w:h&&c?w/h*c:0)} - ,"_convertToUnit"),qk=Qt(function(t,i,s,e){ - var n; - return sk||Uk(),i in wk&&"transform"!==i&&~(i=wk[i]).indexOf(",")&&(i=i.split(",")[0]),ak[i]&&"transform"!==i?(n=ox(t,e),n="transformOrigin"!==i?n[i]:n.svg?n.origin:ax(Dk(t,kk))+" "+n.zOrigin+"px"):(!(n=t.style[i])||"auto"===n||e||~(n+"").indexOf("calc("))&&(n=tx[i]&&tx[i](t,i,s)||Dk(t,i)||bC(t,i)||("opacity"===i?1:0)),s&&!~(n+"").trim().indexOf(" ")?Yk(t,i,n,s)+s:n} - ,"_get"),Xk=Qt(function(t,i,s,e){ - if(!s||"none"===s){ - var n=Bk(i,t,1),h=n&&Dk(t,n,1); - h&&h!==s?(i=n,s=h):"borderColor"===i&&(s=Dk(t,"borderTopColor"))} - var r,o,a,c,l,u,d,f,p,w,g,m=new BI(this._pt,t.style,i,0,1,RI),v=0,_=0; - if(m.b=s,m.e=e,s+="","var(--"===(e+="").substring(0,6)&&(e=Dk(t,e.substring(4,e.indexOf(")")))),"auto"===e&&(u=t.style[i],t.style[i]=e,e=Dk(t,i)||e,u?t.style[i]=u:Vk(t,i)),KO(r=[s,e]),e=r[1],a=(s=r[0]).match(XT)||[],(e.match(XT)||[]).length){ - for(; - o=XT.exec(e); - )d=o[0],p=e.substring(v,o.index),l?l=(l+1)%5:"rgba("!==p.substr(-5)&&"hsla("!==p.substr(-5)||(l=1),d!==(u=a[_++]||"")&&(c=parseFloat(u)||0,g=u.substr((c+"").length),"="===d.charAt(1)&&(d=SC(c,d)+g),f=parseFloat(d),w=d.substr((f+"").length),v=XT.lastIndex-w.length,w||(w=w||TT.units[i]||g,v===e.length&&(e+=w,m.e+=w)),g!==w&&(c=Yk(t,i,u,w)||0),m._pt={ - _next:m._pt,p:p||1===_?p:",",s:c,c:f-c,m:l&&l<4||"zIndex"===i?Math.round:0} - ); - m.c=v<e.length?e.substring(v,e.length):""} - else m.r="display"===i&&"none"===e?yk:bk; - return QT.test(e)&&(m.e=0),this._pt=m,m} - ,"_tweenComplexCSSString"),Jk={ - top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"} - ,Qk=Qt(function(t){ - var i=t.split(" "),s=i[0],e=i[1]||"50%"; - return"top"!==s&&"bottom"!==s&&"left"!==e&&"right"!==e||(t=s,s=e,e=t),i[0]=Jk[s]||s,i[1]=Jk[e]||e,i.join(" ")} - ,"_convertKeywordsToPercentages"),Zk=Qt(function(t,i){ - if(i.tween&&i.tween._time===i.tween._dur){ - var s,e,n,h=i.t,r=h.style,o=i.u,a=h._gsap; - if("all"===o||!0===o)r.cssText="",e=1; - else for(n=(o=o.split(",")).length; - --n>-1; - )s=o[n],ak[s]&&(e=1,s="transformOrigin"===s?kk:Ik),Vk(h,s); - e&&(Vk(h,Ik),a&&(a.svg&&h.removeAttribute("transform"),r.scale=r.rotate=r.translate="none",ox(h,1),a.uncache=1,Rk(r)))} - } - ,"_renderClearProps"),tx={ - clearProps:Qt(function(t,i,s,e,n){ - if("isFromStart"!==n.data){ - var h=t._pt=new BI(t._pt,i,s,0,0,Zk); - return h.u=e,h.pr=-10,h.tween=n,t._props.push(s),1} - } - ,"clearProps")} - ,ix=[1,0,0,1,0,0],sx={ - } - ,ex=Qt(function(t){ - return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t} - ,"_isNullTransform"),nx=Qt(function(t){ - var i=Dk(t,Ik); - return ex(i)?ix:i.substr(7).match(qT).map(EC)} - ,"_getComputedTransformMatrixAsArray"),hx=Qt(function(t,i){ - var s,e,n,h,r=t._gsap||MC(t),o=t.style,a=nx(t); - return r.svg&&t.getAttribute("transform")?"1,0,0,1,0,0"===(a=[(n=t.transform.baseVal.consolidate().matrix).a,n.b,n.c,n.d,n.e,n.f]).join(",")?ix:a:(a!==ix||t.offsetParent||t===ik||r.svg||(n=o.display,o.display="block",(s=t.parentNode)&&(t.offsetParent||t.getBoundingClientRect().width)||(h=1,e=t.nextElementSibling,ik.appendChild(t)),a=nx(t),n?o.display=n:Vk(t,"display"),h&&(e?s.insertBefore(t,e):s?s.appendChild(t):ik.removeChild(t))),i&&a.length>6?[a[0],a[1],a[4],a[5],a[12],a[13]]:a)} - ,"_getMatrix"),rx=Qt(function(t,i,s,e,n,h){ - var r,o,a,c=t._gsap,l=n||hx(t,!0),u=c.xOrigin||0,d=c.yOrigin||0,f=c.xOffset||0,p=c.yOffset||0,w=l[0],g=l[1],m=l[2],v=l[3],_=l[4],M=l[5],b=i.split(" "),y=parseFloat(b[0])||0,E=parseFloat(b[1])||0; - s?l!==ix&&(o=w*v-g*m)&&(a=y*(-g/o)+E*(w/o)-(w*M-g*_)/o,y=y*(v/o)+E*(-m/o)+(m*M-v*_)/o,E=a):(y=(r=Hk(t)).x+(~b[0].indexOf("%")?y/100*r.width:y),E=r.y+(~(b[1]||b[0]).indexOf("%")?E/100*r.height:E)),e||!1!==e&&c.smooth?(_=y-u,M=E-d,c.xOffset=f+(_*w+M*m)-_,c.yOffset=p+(_*g+M*v)-M):c.xOffset=c.yOffset=0,c.xOrigin=y,c.yOrigin=E,c.smooth=!!e,c.origin=i,c.originIsAbsolute=!!s,t.style[kk]="0px 0px",h&&(jk(h,c,"xOrigin",u,y),jk(h,c,"yOrigin",d,E),jk(h,c,"xOffset",f,c.xOffset),jk(h,c,"yOffset",p,c.yOffset)),t.setAttribute("data-svg-origin",y+" "+E)} - ,"_applySVGOrigin"),ox=Qt(function(t,i){ - var s=t._gsap||new aI(t); - if("x"in s&&!i&&!s.uncache)return s; - var e,n,h,r,o,a,c,l,u,d,f,p,w,g,m,v,_,M,b,y,E,A,S,T,C,O,I,k,x,R,P,N,L=t.style,D=s.scaleX<0,G="px",B="deg",U=getComputedStyle(t),F=Dk(t,kk)||"0"; - return e=n=h=a=c=l=u=d=f=0,r=o=1,s.svg=!(!t.getCTM||!Wk(t)),U.translate&&("none"===U.translate&&"none"===U.scale&&"none"===U.rotate||(L[Ik]=("none"!==U.translate?"translate3d("+(U.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==U.rotate?"rotate("+U.rotate+") ":"")+("none"!==U.scale?"scale("+U.scale.split(" ").join(",")+") ":"")+("none"!==U[Ik]?U[Ik]:"")),L.scale=L.rotate=L.translate="none"),g=hx(t,s.svg),s.svg&&(s.uncache?(C=t.getBBox(),F=s.xOrigin-C.x+"px "+(s.yOrigin-C.y)+"px",T=""):T=!i&&t.getAttribute("data-svg-origin"),rx(t,T||F,!!T||s.originIsAbsolute,!1!==s.smooth,g)),p=s.xOrigin||0,w=s.yOrigin||0,g!==ix&&(M=g[0],b=g[1],y=g[2],E=g[3],e=A=g[4],n=S=g[5],6===g.length?(r=Math.sqrt(M*M+b*b),o=Math.sqrt(E*E+y*y),a=M||b?uk(b,M)*ck:0,(u=y||E?uk(y,E)*ck+a:0)&&(o*=Math.abs(Math.cos(u*lk))),s.svg&&(e-=p-(p*M+w*y),n-=w-(p*b+w*E))):(N=g[6],R=g[7],I=g[8],k=g[9],x=g[10],P=g[11],e=g[12],n=g[13],h=g[14],c=(m=uk(N,x))*ck,m&&(T=A*(v=Math.cos(-m))+I*(_=Math.sin(-m)),C=S*v+k*_,O=N*v+x*_,I=A*-_+I*v,k=S*-_+k*v,x=N*-_+x*v,P=R*-_+P*v,A=T,S=C,N=O),l=(m=uk(-y,x))*ck,m&&(v=Math.cos(-m),P=E*(_=Math.sin(-m))+P*v,M=T=M*v-I*_,b=C=b*v-k*_,y=O=y*v-x*_),a=(m=uk(b,M))*ck,m&&(T=M*(v=Math.cos(m))+b*(_=Math.sin(m)),C=A*v+S*_,b=b*v-M*_,S=S*v-A*_,M=T,A=C),c&&Math.abs(c)+Math.abs(a)>359.9&&(c=a=0,l=180-l),r=EC(Math.sqrt(M*M+b*b+y*y)),o=EC(Math.sqrt(S*S+N*N)),m=uk(A,S),u=Math.abs(m)>2e-4?m*ck:0,f=P?1/(P<0?-P:P):0),s.svg&&(T=t.getAttribute("transform"),s.forceCSS=t.setAttribute("transform","")||!ex(Dk(t,Ik)),T&&t.setAttribute("transform",T))),Math.abs(u)>90&&Math.abs(u)<270&&(D?(r*=-1,u+=a<=0?180:-180,a+=a<=0?180:-180):(o*=-1,u+=u<=0?180:-180)),i=i||s.uncache,s.x=e-((s.xPercent=e&&(!i&&s.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-e)?-50:0)))?t.offsetWidth*s.xPercent/100:0)+G,s.y=n-((s.yPercent=n&&(!i&&s.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-n)?-50:0)))?t.offsetHeight*s.yPercent/100:0)+G,s.z=h+G,s.scaleX=EC(r),s.scaleY=EC(o),s.rotation=EC(a)+B,s.rotationX=EC(c)+B,s.rotationY=EC(l)+B,s.skewX=u+B,s.skewY=d+B,s.transformPerspective=f+G,(s.zOrigin=parseFloat(F.split(" ")[2])||!i&&s.zOrigin||0)&&(L[kk]=ax(F)),s.xOffset=s.yOffset=0,s.force3D=TT.force3D,s.renderTransform=s.svg?wx:rk?px:lx,s.uncache=0,s} - ,"_parseTransform"),ax=Qt(function(t){ - return(t=t.split(" "))[0]+" "+t[1]} - ,"_firstTwoOnly"),cx=Qt(function(t,i,s){ - var e=dO(i); - return EC(parseFloat(i)+parseFloat(Yk(t,"x",s+"px",e)))+e} - ,"_addPxTranslate"),lx=Qt(function(t,i){ - i.z="0px",i.rotationY=i.rotationX="0deg",i.force3D=0,px(t,i)} - ,"_renderNon3DTransforms"),ux="0deg",dx="0px",fx=") ",px=Qt(function(t,i){ - var s=i||this,e=s.xPercent,n=s.yPercent,h=s.x,r=s.y,o=s.z,a=s.rotation,c=s.rotationY,l=s.rotationX,u=s.skewX,d=s.skewY,f=s.scaleX,p=s.scaleY,w=s.transformPerspective,g=s.force3D,m=s.target,v=s.zOrigin,_="",M="auto"===g&&t&&1!==t||!0===g; - if(v&&(l!==ux||c!==ux)){ - var b,y=parseFloat(c)*lk,E=Math.sin(y),A=Math.cos(y); - y=parseFloat(l)*lk,b=Math.cos(y),h=cx(m,h,E*b*-v),r=cx(m,r,-Math.sin(y)*-v),o=cx(m,o,A*b*-v+v)} - w!==dx&&(_+="perspective("+w+fx),(e||n)&&(_+="translate("+e+"%, "+n+"%) "),(M||h!==dx||r!==dx||o!==dx)&&(_+=o!==dx||M?"translate3d("+h+", "+r+", "+o+") ":"translate("+h+", "+r+fx),a!==ux&&(_+="rotate("+a+fx),c!==ux&&(_+="rotateY("+c+fx),l!==ux&&(_+="rotateX("+l+fx),u===ux&&d===ux||(_+="skew("+u+", "+d+fx),1===f&&1===p||(_+="scale("+f+", "+p+fx),m.style[Ik]=_||"translate(0, 0)"} - ,"_renderCSSTransforms"),wx=Qt(function(t,i){ - var s,e,n,h,r,o=i||this,a=o.xPercent,c=o.yPercent,l=o.x,u=o.y,d=o.rotation,f=o.skewX,p=o.skewY,w=o.scaleX,g=o.scaleY,m=o.target,v=o.xOrigin,_=o.yOrigin,M=o.xOffset,b=o.yOffset,y=o.forceCSS,E=parseFloat(l),A=parseFloat(u); - d=parseFloat(d),f=parseFloat(f),(p=parseFloat(p))&&(f+=p=parseFloat(p),d+=p),d||f?(d*=lk,f*=lk,s=Math.cos(d)*w,e=Math.sin(d)*w,n=Math.sin(d-f)*-g,h=Math.cos(d-f)*g,f&&(p*=lk,r=Math.tan(f-p),n*=r=Math.sqrt(1+r*r),h*=r,p&&(r=Math.tan(p),s*=r=Math.sqrt(1+r*r),e*=r)),s=EC(s),e=EC(e),n=EC(n),h=EC(h)):(s=w,h=g,e=n=0),(E&&!~(l+"").indexOf("px")||A&&!~(u+"").indexOf("px"))&&(E=Yk(m,"x",l,"px"),A=Yk(m,"y",u,"px")),(v||_||M||b)&&(E=EC(E+v-(v*s+_*n)+M),A=EC(A+_-(v*e+_*h)+b)),(a||c)&&(r=m.getBBox(),E=EC(E+a/100*r.width),A=EC(A+c/100*r.height)),r="matrix("+s+","+e+","+n+","+h+","+E+","+A+")",m.setAttribute("transform",r),y&&(m.style[Ik]=r)} - ,"_renderSVGTransforms"),gx=Qt(function(t,i,s,e,n){ - var h,r,o=360,a=DT(n),c=parseFloat(n)*(a&&~n.indexOf("rad")?ck:1)-e,l=e+c+"deg"; - return a&&("short"===(h=n.split("_")[1])&&(c%=o)!==c%180&&(c+=c<0?o:-360),"cw"===h&&c<0?c=(c+36e9)%o-~~(c/o)*o:"ccw"===h&&c>0&&(c=(c-36e9)%o-~~(c/o)*o)),t._pt=r=new BI(t._pt,i,s,e,c,mk),r.e=l,r.u="deg",t._props.push(s),r} - ,"_addRotationalPropTween"),mx=Qt(function(t,i){ - for(var s in i)t[s]=i[s]; - return t} - ,"_assign"),vx=Qt(function(t,i,s){ - var e,n,h,r,o,a,c,l=mx({ - } - ,s._gsap),u=s.style; - for(n in l.svg?(h=s.getAttribute("transform"),s.setAttribute("transform",""),u[Ik]=i,e=ox(s,1),Vk(s,Ik),s.setAttribute("transform",h)):(h=getComputedStyle(s)[Ik],u[Ik]=i,e=ox(s,1),u[Ik]=h),ak)(h=l[n])!==(r=e[n])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(n)<0&&(o=dO(h)!==(c=dO(r))?Yk(s,n,h,c):parseFloat(h),a=parseFloat(r),t._pt=new BI(t._pt,e,n,o,a-o,gk),t._pt.u=c||0,t._props.push(n)); - mx(e,l)} - ,"_addRawTransformPTs"); - yC("padding,margin,Width,Radius",function(t,i){ - var s="Top",e="Right",n="Bottom",h="Left",r=(i<3?[s,e,n,h]:[s+h,s+e,n+e,n+h]).map(function(s){ - return i<2?t+s:"border"+s+t} - ); - tx[i>1?"border"+t:t]=function(t,i,s,e,n){ - var h,o; - if(arguments.length<4)return h=r.map(function(i){ - return qk(t,i,s)} - ),5===(o=h.join(" ")).split(h[0]).length?h[0]:o; - h=(e+"").split(" "),o={ - } - ,r.forEach(function(t,i){ - return o[t]=h[i]=h[i]||h[(i-1)/2|0]} - ),t.init(i,o,n)} - } - ); - var _x,Mx,bx={ - name:"css",register:Uk,targetTest:Qt(function(t){ - return t.style&&t.nodeType} - ,"targetTest"),init:Qt(function(t,i,s,e,n){ - var h,r,o,a,c,l,u,d,f,p,w,g,m,v,_,M,b,y=this._props,E=t.style,A=s.vars.startAt; - for(u in sk||Uk(),this.styles=this.styles||Nk(t),M=this.styles.props,this.tween=s,i)if("autoRound"!==u&&(r=i[u],!pC[u]||!gI(u,i,s,e,t,n)))if(c=typeof r,l=tx[u],"function"===c&&(c=typeof(r=r.call(s,e,t,n))),"string"===c&&~r.indexOf("random(")&&(r=kO(r)),l)l(this,t,u,r,s)&&(_=1); - else if("--"===u.substr(0,2))h=(getComputedStyle(t).getPropertyValue(u)+"").trim(),r+="",VO.lastIndex=0,VO.test(h)||(d=dO(h),(f=dO(r))?d!==f&&(h=Yk(t,u,h,f)+f):d&&(r+=d)),this.add(E,"setProperty",h,r,e,n,0,0,u),y.push(u),M.push(u,0,E[u]); - else if("undefined"!==c){ - if(A&&u in A?(h="function"==typeof A[u]?A[u].call(s,e,t,n):A[u],DT(h)&&~h.indexOf("random(")&&(h=kO(h)),dO(h+"")||"auto"===h||(h+=TT.units[u]||dO(qk(t,u))||""),"="===(h+"").charAt(1)&&(h=qk(t,u))):h=qk(t,u),a=parseFloat(h),(p="string"===c&&"="===r.charAt(1)&&r.substr(0,2))&&(r=r.substr(2)),o=parseFloat(r),u in wk&&("autoAlpha"===u&&(1===a&&"hidden"===qk(t,"visibility")&&o&&(a=0),M.push("visibility",0,E.visibility),jk(this,E,"visibility",a?"inherit":"hidden",o?"inherit":"hidden",!o)),"scale"!==u&&"transform"!==u&&~(u=wk[u]).indexOf(",")&&(u=u.split(",")[0])),w=u in ak){ - if(this.styles.save(u),b=r,"string"===c&&"var(--"===r.substring(0,6)){ - if("calc("===(r=Dk(t,r.substring(4,r.indexOf(")")))).substring(0,5)){ - var S=t.style.perspective; - t.style.perspective=r,r=Dk(t,"perspective"),S?t.style.perspective=S:Vk(t,"perspective")} - o=parseFloat(r)} - if(g||((m=t._gsap).renderTransform&&!i.parseTransform||ox(t,i.parseTransform),v=!1!==i.smoothOrigin&&m.smooth,(g=this._pt=new BI(this._pt,E,Ik,0,1,m.renderTransform,m,0,-1)).dep=1),"scale"===u)this._pt=new BI(this._pt,m,"scaleY",m.scaleY,(p?SC(m.scaleY,p+o):o)-m.scaleY||0,gk),this._pt.u=0,y.push("scaleY",u),u+="X"; - else{ - if("transformOrigin"===u){ - M.push(kk,0,E[kk]),r=Qk(r),m.svg?rx(t,r,0,v,0,this):((f=parseFloat(r.split(" ")[2])||0)!==m.zOrigin&&jk(this,m,"zOrigin",m.zOrigin,f),jk(this,E,u,ax(h),ax(r))); - continue} - if("svgOrigin"===u){ - rx(t,r,1,v,0,this); - continue} - if(u in sx){ - gx(this,m,u,a,p?SC(a,p+r):r); - continue} - if("smoothOrigin"===u){ - jk(this,m,"smooth",m.smooth,r); - continue} - if("force3D"===u){ - m[u]=r; - continue} - if("transform"===u){ - vx(this,r,t); - continue} - } - } - else u in E||(u=Bk(u)||u); - if(w||(o||0===o)&&(a||0===a)&&!pk.test(r)&&u in E)o||(o=0),(d=(h+"").substr((a+"").length))!==(f=dO(r)||(u in TT.units?TT.units[u]:d))&&(a=Yk(t,u,h,f)),this._pt=new BI(this._pt,w?m:E,u,a,(p?SC(a,p+o):o)-a,w||"px"!==f&&"zIndex"!==u||!1===i.autoRound?gk:Mk),this._pt.u=f||0,w&&b!==r?(this._pt.b=h,this._pt.e=b,this._pt.r=_k):d!==f&&"%"!==f&&(this._pt.b=h,this._pt.r=vk); - else if(u in E)Xk.call(this,t,u,h,p?p+r:r); - else if(u in t)this.add(t,u,h||t[u],p?p+r:r,e,n); - else if("parseTransform"!==u){ - nC(u,r); - continue} - w||(u in E?M.push(u,0,E[u]):"function"==typeof t[u]?M.push(u,2,t[u]()):M.push(u,1,h||t[u])),y.push(u)} - _&&GI(this)} - ,"init"),render:Qt(function(t,i){ - if(i.tween._time||!hk())for(var s=i._pt; - s; - )s.r(t,s.d),s=s._next; - else i.styles.revert()} - ,"render"),get:qk,aliases:wk,getSetter:Qt(function(t,i,s){ - var e=wk[i]; - return e&&e.indexOf(",")<0&&(i=e),i in ak&&i!==kk&&(t._gsap.x||qk(t,"x"))?s&&nk===s?"scale"===i?Tk:Sk:(nk=s||{ - } - )&&("scale"===i?Ck:Ok):t.style&&!UT(t.style[i])?Ek:~i.indexOf("-")?Ak:II(t,i)} - ,"getSetter"),core:{ - _removeProperty:Vk,_getMatrix:hx} - } - ; - QI.utils.checkPrefix=Bk,QI.core.getStyleSaver=Nk,Mx=yC("x,y,z,scale,scaleX,scaleY,xPercent,yPercent"+","+(_x="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",function(t){ - ak[t]=1} - ),yC(_x,function(t){ - TT.units[t]="deg",sx[t]=1} - ),wk[Mx[13]]="x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+_x,yC("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",function(t){ - var i=t.split(":"); - wk[i[1]]=Mx[i[0]]} - ),yC("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){ - TT.units[t]="px"} - ),QI.registerPlugin(bx); - var yx=QI.registerPlugin(bx)||QI; - yx.core.Tween;
SoundManager 9 hunks, 794 statements
- var GG,BG={ - } - ; - GG=BG,function(){ - var t=Qt(function(){ - this.init()} - ,"HowlerGlobal"); - t.prototype={ - init:Qt(function(){ - var t=this||i; - return t._counter=1e3,t._html5AudioPool=[],t.html5PoolSize=10,t._codecs={ - } - ,t._howls=[],t._muted=!1,t._volume=1,t._canPlayEvent="canplaythrough",t._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,t.masterGain=null,t.noAudio=!1,t.usingWebAudio=!0,t.autoSuspend=!0,t.ctx=null,t.autoUnlock=!0,t._setup(),t} - ,"init"),volume:Qt(function(t){ - var s=this||i; - if(t=parseFloat(t),s.ctx||c(),void 0!==t&&t>=0&&t<=1){ - if(s._volume=t,s._muted)return s; - s.usingWebAudio&&s.masterGain.gain.setValueAtTime(t,i.ctx.currentTime); - for(var e=0; - e<s._howls.length; - e++)if(!s._howls[e]._webAudio)for(var n=s._howls[e]._getSoundIds(),h=0; - h<n.length; - h++){ - var r=s._howls[e]._soundById(n[h]); - r&&r._node&&(r._node.volume=r._volume*t)} - return s} - return s._volume} - ,"volume"),mute:Qt(function(t){ - var s=this||i; - s.ctx||c(),s._muted=t,s.usingWebAudio&&s.masterGain.gain.setValueAtTime(t?0:s._volume,i.ctx.currentTime); - for(var e=0; - e<s._howls.length; - e++)if(!s._howls[e]._webAudio)for(var n=s._howls[e]._getSoundIds(),h=0; - h<n.length; - h++){ - var r=s._howls[e]._soundById(n[h]); - r&&r._node&&(r._node.muted=!!t||r._muted)} - return s} - ,"mute"),stop:Qt(function(){ - for(var t=this||i,s=0; - s<t._howls.length; - s++)t._howls[s].stop(); - return t} - ,"stop"),unload:Qt(function(){ - for(var t=this||i,s=t._howls.length-1; - s>=0; - s--)t._howls[s].unload(); - return t.usingWebAudio&&t.ctx&&void 0!==t.ctx.close&&(t.ctx.close(),t.ctx=null,c()),t} - ,"unload"),codecs:Qt(function(t){ - return(this||i)._codecs[t.replace(/^x-/,"")]} - ,"codecs"),_setup:Qt(function(){ - var t=this||i; - if(t.state=t.ctx&&t.ctx.state||"suspended",t._autoSuspend(),!t.usingWebAudio)if("undefined"!=typeof Audio)try{ - void 0===(new Audio).oncanplaythrough&&(t._canPlayEvent="canplay")} - catch(frt){ - t.noAudio=!0} - else t.noAudio=!0; - try{ - (new Audio).muted&&(t.noAudio=!0)} - catch(frt){ - } - return t.noAudio||t._setupCodecs(),t} - ,"_setup"),_setupCodecs:Qt(function(){ - var t=this||i,s=null; - try{ - s="undefined"!=typeof Audio?new Audio:null} - catch(l){ - return t} - if(!s||"function"!=typeof s.canPlayType)return t; - var e=s.canPlayType("audio/mpeg; - ").replace(/^no$/,""),n=t._navigator?t._navigator.userAgent:"",h=n.match(/OPR\/(\d+)/g),r=h&&parseInt(h[0].split("/")[1],10)<33,o=-1!==n.indexOf("Safari")&&-1===n.indexOf("Chrome"),a=n.match(/Version\/(.*?) /),c=o&&a&&parseInt(a[1],10)<15; - return t._codecs={ - mp3:!(r||!e&&!s.canPlayType("audio/mp3; - ").replace(/^no$/,"")),mpeg:!!e,opus:!!s.canPlayType('audio/ogg; - codecs="opus"').replace(/^no$/,""),ogg:!!s.canPlayType('audio/ogg; - codecs="vorbis"').replace(/^no$/,""),oga:!!s.canPlayType('audio/ogg; - codecs="vorbis"').replace(/^no$/,""),wav:!!(s.canPlayType('audio/wav; - codecs="1"')||s.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!s.canPlayType("audio/aac; - ").replace(/^no$/,""),caf:!!s.canPlayType("audio/x-caf; - ").replace(/^no$/,""),m4a:!!(s.canPlayType("audio/x-m4a; - ")||s.canPlayType("audio/m4a; - ")||s.canPlayType("audio/aac; - ")).replace(/^no$/,""),m4b:!!(s.canPlayType("audio/x-m4b; - ")||s.canPlayType("audio/m4b; - ")||s.canPlayType("audio/aac; - ")).replace(/^no$/,""),mp4:!!(s.canPlayType("audio/x-mp4; - ")||s.canPlayType("audio/mp4; - ")||s.canPlayType("audio/aac; - ")).replace(/^no$/,""),weba:!(c||!s.canPlayType('audio/webm; - codecs="vorbis"').replace(/^no$/,"")),webm:!(c||!s.canPlayType('audio/webm; - codecs="vorbis"').replace(/^no$/,"")),dolby:!!s.canPlayType('audio/mp4; - codecs="ec-3"').replace(/^no$/,""),flac:!!(s.canPlayType("audio/x-flac; - ")||s.canPlayType("audio/flac; - ")).replace(/^no$/,"")} - ,t} - ,"_setupCodecs"),_unlockAudio:Qt(function(){ - var t=this||i; - if(!t._audioUnlocked&&t.ctx){ - t._audioUnlocked=!1,t.autoUnlock=!1,t._mobileUnloaded||44100===t.ctx.sampleRate||(t._mobileUnloaded=!0,t.unload()),t._scratchBuffer=t.ctx.createBuffer(1,1,22050); - var s=Qt(function(i){ - for(; - t._html5AudioPool.length<t.html5PoolSize; - )try{ - var e=new Audio; - e._unlocked=!0,t._releaseHtml5Audio(e)} - catch(c){ - t.noAudio=!0; - break} - for(var n=0; - n<t._howls.length; - n++)if(!t._howls[n]._webAudio)for(var h=t._howls[n]._getSoundIds(),r=0; - r<h.length; - r++){ - var o=t._howls[n]._soundById(h[r]); - o&&o._node&&!o._node._unlocked&&(o._node._unlocked=!0,o._node.load())} - t._autoResume(); - var a=t.ctx.createBufferSource(); - a.buffer=t._scratchBuffer,a.connect(t.ctx.destination),void 0===a.start?a.noteOn(0):a.start(0),"function"==typeof t.ctx.resume&&t.ctx.resume(),a.onended=function(){ - a.disconnect(0),t._audioUnlocked=!0,document.removeEventListener("touchstart",s,!0),document.removeEventListener("touchend",s,!0),document.removeEventListener("click",s,!0),document.removeEventListener("keydown",s,!0); - for(var i=0; - i<t._howls.length; - i++)t._howls[i]._emit("unlock")} - } - ,"unlock"); - return document.addEventListener("touchstart",s,!0),document.addEventListener("touchend",s,!0),document.addEventListener("click",s,!0),document.addEventListener("keydown",s,!0),t} - } - ,"_unlockAudio"),_obtainHtml5Audio:Qt(function(){ - var t=this||i; - if(t._html5AudioPool.length)return t._html5AudioPool.pop(); - var s=(new Audio).play(); - return s&&"undefined"!=typeof Promise&&(s instanceof Promise||"function"==typeof s.then)&&s.catch(function(){ - } - ),new Audio} - ,"_obtainHtml5Audio"),_releaseHtml5Audio:Qt(function(t){ - var s=this||i; - return t._unlocked&&s._html5AudioPool.push(t),s} - ,"_releaseHtml5Audio"),_autoSuspend:Qt(function(){ - var t=this; - if(t.autoSuspend&&t.ctx&&void 0!==t.ctx.suspend&&i.usingWebAudio){ - for(var s=0; - s<t._howls.length; - s++)if(t._howls[s]._webAudio)for(var e=0; - e<t._howls[s]._sounds.length; - e++)if(!t._howls[s]._sounds[e]._paused)return t; - return t._suspendTimer&&clearTimeout(t._suspendTimer),t._suspendTimer=setTimeout(function(){ - if(t.autoSuspend){ - t._suspendTimer=null,t.state="suspending"; - var i=Qt(function(){ - t.state="suspended",t._resumeAfterSuspend&&(delete t._resumeAfterSuspend,t._autoResume())} - ,"handleSuspension"); - t.ctx.suspend().then(i,i)} - } - ,3e4),t} - } - ,"_autoSuspend"),_autoResume:Qt(function(){ - var t=this; - if(t.ctx&&void 0!==t.ctx.resume&&i.usingWebAudio)return"running"===t.state&&"interrupted"!==t.ctx.state&&t._suspendTimer?(clearTimeout(t._suspendTimer),t._suspendTimer=null):"suspended"===t.state||"running"===t.state&&"interrupted"===t.ctx.state?(t.ctx.resume().then(function(){ - t.state="running"; - for(var i=0; - i<t._howls.length; - i++)t._howls[i]._emit("resume")} - ),t._suspendTimer&&(clearTimeout(t._suspendTimer),t._suspendTimer=null)):"suspending"===t.state&&(t._resumeAfterSuspend=!0),t} - ,"_autoResume")} - ; - var i=new t,s=Qt(function(t){ - t.src&&0!==t.src.length&&this.init(t)} - ,"Howl"); - s.prototype={ - init:Qt(function(t){ - var s=this; - return i.ctx||c(),s._autoplay=t.autoplay||!1,s._format="string"!=typeof t.format?t.format:[t.format],s._html5=t.html5||!1,s._muted=t.mute||!1,s._loop=t.loop||!1,s._pool=t.pool||5,s._preload="boolean"!=typeof t.preload&&"metadata"!==t.preload||t.preload,s._rate=t.rate||1,s._sprite=t.sprite||{ - } - ,s._src="string"!=typeof t.src?t.src:[t.src],s._volume=void 0!==t.volume?t.volume:1,s._xhr={ - method:t.xhr&&t.xhr.method?t.xhr.method:"GET",headers:t.xhr&&t.xhr.headers?t.xhr.headers:null,withCredentials:!(!t.xhr||!t.xhr.withCredentials)&&t.xhr.withCredentials} - ,s._duration=0,s._state="unloaded",s._sounds=[],s._endTimers={ - } - ,s._queue=[],s._playLock=!1,s._onend=t.onend?[{ - fn:t.onend} - ]:[],s._onfade=t.onfade?[{ - fn:t.onfade} - ]:[],s._onload=t.onload?[{ - fn:t.onload} - ]:[],s._onloaderror=t.onloaderror?[{ - fn:t.onloaderror} - ]:[],s._onplayerror=t.onplayerror?[{ - fn:t.onplayerror} - ]:[],s._onpause=t.onpause?[{ - fn:t.onpause} - ]:[],s._onplay=t.onplay?[{ - fn:t.onplay} - ]:[],s._onstop=t.onstop?[{ - fn:t.onstop} - ]:[],s._onmute=t.onmute?[{ - fn:t.onmute} - ]:[],s._onvolume=t.onvolume?[{ - fn:t.onvolume} - ]:[],s._onrate=t.onrate?[{ - fn:t.onrate} - ]:[],s._onseek=t.onseek?[{ - fn:t.onseek} - ]:[],s._onunlock=t.onunlock?[{ - fn:t.onunlock} - ]:[],s._onresume=[],s._webAudio=i.usingWebAudio&&!s._html5,void 0!==i.ctx&&i.ctx&&i.autoUnlock&&i._unlockAudio(),i._howls.push(s),s._autoplay&&s._queue.push({ - event:"play",action:Qt(function(){ - s.play()} - ,"action")} - ),s._preload&&"none"!==s._preload&&s.load(),s} - ,"init"),load:Qt(function(){ - var t=this,s=null; - if(i.noAudio)t._emit("loaderror",null,"No audio support."); - else{ - "string"==typeof t._src&&(t._src=[t._src]); - for(var n=0; - n<t._src.length; - n++){ - var r,o; - if(t._format&&t._format[n])r=t._format[n]; - else{ - if("string"!=typeof(o=t._src[n])){ - t._emit("loaderror",null,"Non-string found in selected audio sources - ignoring."); - continue} - (r=/^data:audio\/([^; - ,]+); - /i.exec(o))||(r=/\.([^.]+)$/.exec(o.split("?",1)[0])),r&&(r=r[1].toLowerCase())} - if(r&&i.codecs(r)){ - s=t._src[n]; - break} - } - if(s)return t._src=s,t._state="loading","https:"===window.location.protocol&&"http:"===s.slice(0,5)&&(t._html5=!0,t._webAudio=!1),new e(t),t._webAudio&&h(t),t; - t._emit("loaderror",null,"No codec support for selected audio sources.")} - } - ,"load"),play:Qt(function(t,s){ - var e=this,n=null; - if("number"==typeof t)n=t,t=null; - else{ - if("string"==typeof t&&"loaded"===e._state&&!e._sprite[t])return null; - if(void 0===t&&(t="__default",!e._playLock)){ - for(var h=0,r=0; - r<e._sounds.length; - r++)e._sounds[r]._paused&&!e._sounds[r]._ended&&(h++,n=e._sounds[r]._id); - 1===h?t=null:n=null} - } - var o=n?e._soundById(n):e._inactiveSound(); - if(!o)return null; - if(n&&!t&&(t=o._sprite||"__default"),"loaded"!==e._state){ - o._sprite=t,o._ended=!1; - var a=o._id; - return e._queue.push({ - event:"play",action:Qt(function(){ - e.play(a)} - ,"action")} - ),a} - if(n&&!o._paused)return s||e._loadQueue("play"),o._id; - e._webAudio&&i._autoResume(); - var c=Math.max(0,o._seek>0?o._seek:e._sprite[t][0]/1e3),l=Math.max(0,(e._sprite[t][0]+e._sprite[t][1])/1e3-c),u=1e3*l/Math.abs(o._rate),d=e._sprite[t][0]/1e3,f=(e._sprite[t][0]+e._sprite[t][1])/1e3; - o._sprite=t,o._ended=!1; - var p=Qt(function(){ - o._paused=!1,o._seek=c,o._start=d,o._stop=f,o._loop=!(!o._loop&&!e._sprite[t][2])} - ,"setParams"); - if(!(c>=f)){ - var w=o._node; - if(e._webAudio){ - var g=Qt(function(){ - e._playLock=!1,p(),e._refreshBuffer(o); - var t=o._muted||e._muted?0:o._volume; - w.gain.setValueAtTime(t,i.ctx.currentTime),o._playStart=i.ctx.currentTime,void 0===w.bufferSource.start?o._loop?w.bufferSource.noteGrainOn(0,c,86400):w.bufferSource.noteGrainOn(0,c,l):o._loop?w.bufferSource.start(0,c,86400):w.bufferSource.start(0,c,l),u!==1/0&&(e._endTimers[o._id]=setTimeout(e._ended.bind(e,o),u)),s||setTimeout(function(){ - e._emit("play",o._id),e._loadQueue()} - ,0)} - ,"playWebAudio"); - "running"===i.state&&"interrupted"!==i.ctx.state?g():(e._playLock=!0,e.once("resume",g),e._clearTimer(o._id))} - else{ - var m=Qt(function(){ - w.currentTime=c,w.muted=o._muted||e._muted||i._muted||w.muted,w.volume=o._volume*i.volume(),w.playbackRate=o._rate; - try{ - var n=w.play(); - if(n&&"undefined"!=typeof Promise&&(n instanceof Promise||"function"==typeof n.then)?(e._playLock=!0,p(),n.then(function(){ - e._playLock=!1,w._unlocked=!0,s?e._loadQueue():e._emit("play",o._id)} - ).catch(function(){ - e._playLock=!1,e._emit("playerror",o._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),o._ended=!0,o._paused=!0} - )):s||(e._playLock=!1,p(),e._emit("play",o._id)),w.playbackRate=o._rate,w.paused)return void e._emit("playerror",o._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."); - "__default"!==t||o._loop?e._endTimers[o._id]=setTimeout(e._ended.bind(e,o),u):(e._endTimers[o._id]=function(){ - e._ended(o),w.removeEventListener("ended",e._endTimers[o._id],!1)} - ,w.addEventListener("ended",e._endTimers[o._id],!1))} - catch(h){ - e._emit("playerror",o._id,h)} - } - ,"playHtml5"); - "data:audio/wav; - base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===w.src&&(w.src=e._src,w.load()); - var v=window&&window.ejecta||!w.readyState&&i._navigator.isCocoonJS; - if(w.readyState>=3||v)m(); - else{ - e._playLock=!0,e._state="loading"; - var _=Qt(function(){ - e._state="loaded",m(),w.removeEventListener(i._canPlayEvent,_,!1)} - ,"listener"); - w.addEventListener(i._canPlayEvent,_,!1),e._clearTimer(o._id)} - } - return o._id} - e._ended(o)} - ,"play"),pause:Qt(function(t){ - var i=this; - if("loaded"!==i._state||i._playLock)return i._queue.push({ - event:"pause",action:Qt(function(){ - i.pause(t)} - ,"action")} - ),i; - for(var s=i._getSoundIds(t),e=0; - e<s.length; - e++){ - i._clearTimer(s[e]); - var n=i._soundById(s[e]); - if(n&&!n._paused&&(n._seek=i.seek(s[e]),n._rateSeek=0,n._paused=!0,i._stopFade(s[e]),n._node))if(i._webAudio){ - if(!n._node.bufferSource)continue; - void 0===n._node.bufferSource.stop?n._node.bufferSource.noteOff(0):n._node.bufferSource.stop(0),i._cleanBuffer(n._node)} - else isNaN(n._node.duration)&&n._node.duration!==1/0||n._node.pause(); - arguments[1]||i._emit("pause",n?n._id:null)} - return i} - ,"pause"),stop:Qt(function(t,i){ - var s=this; - if("loaded"!==s._state||s._playLock)return s._queue.push({ - event:"stop",action:Qt(function(){ - s.stop(t)} - ,"action")} - ),s; - for(var e=s._getSoundIds(t),n=0; - n<e.length; - n++){ - s._clearTimer(e[n]); - var h=s._soundById(e[n]); - h&&(h._seek=h._start||0,h._rateSeek=0,h._paused=!0,h._ended=!0,s._stopFade(e[n]),h._node&&(s._webAudio?h._node.bufferSource&&(void 0===h._node.bufferSource.stop?h._node.bufferSource.noteOff(0):h._node.bufferSource.stop(0),s._cleanBuffer(h._node)):isNaN(h._node.duration)&&h._node.duration!==1/0||(h._node.currentTime=h._start||0,h._node.pause(),h._node.duration===1/0&&s._clearSound(h._node))),i||s._emit("stop",h._id))} - return s} - ,"stop"),mute:Qt(function(t,s){ - var e=this; - if("loaded"!==e._state||e._playLock)return e._queue.push({ - event:"mute",action:Qt(function(){ - e.mute(t,s)} - ,"action")} - ),e; - if(void 0===s){ - if("boolean"!=typeof t)return e._muted; - e._muted=t} - for(var n=e._getSoundIds(s),h=0; - h<n.length; - h++){ - var r=e._soundById(n[h]); - r&&(r._muted=t,r._interval&&e._stopFade(r._id),e._webAudio&&r._node?r._node.gain.setValueAtTime(t?0:r._volume,i.ctx.currentTime):r._node&&(r._node.muted=!!i._muted||t),e._emit("mute",r._id))} - return e} - ,"mute"),volume:Qt(function(){ - var t,s,e,n=this,h=arguments; - if(0===h.length)return n._volume; - if(1===h.length||2===h.length&&void 0===h[1]?n._getSoundIds().indexOf(h[0])>=0?s=parseInt(h[0],10):t=parseFloat(h[0]):h.length>=2&&(t=parseFloat(h[0]),s=parseInt(h[1],10)),!(void 0!==t&&t>=0&&t<=1))return(e=s?n._soundById(s):n._sounds[0])?e._volume:0; - if("loaded"!==n._state||n._playLock)return n._queue.push({ - event:"volume",action:Qt(function(){ - n.volume.apply(n,h)} - ,"action")} - ),n; - void 0===s&&(n._volume=t),s=n._getSoundIds(s); - for(var r=0; - r<s.length; - r++)(e=n._soundById(s[r]))&&(e._volume=t,h[2]||n._stopFade(s[r]),n._webAudio&&e._node&&!e._muted?e._node.gain.setValueAtTime(t,i.ctx.currentTime):e._node&&!e._muted&&(e._node.volume=t*i.volume()),n._emit("volume",e._id)); - return n} - ,"volume"),fade:Qt(function(t,s,e,n){ - var h=this; - if("loaded"!==h._state||h._playLock)return h._queue.push({ - event:"fade",action:Qt(function(){ - h.fade(t,s,e,n)} - ,"action")} - ),h; - t=Math.min(Math.max(0,parseFloat(t)),1),s=Math.min(Math.max(0,parseFloat(s)),1),e=parseFloat(e),h.volume(t,n); - for(var r=h._getSoundIds(n),o=0; - o<r.length; - o++){ - var a=h._soundById(r[o]); - if(a){ - if(n||h._stopFade(r[o]),h._webAudio&&!a._muted){ - var c=i.ctx.currentTime,l=c+e/1e3; - a._volume=t,a._node.gain.setValueAtTime(t,c),a._node.gain.linearRampToValueAtTime(s,l)} - h._startFadeInterval(a,t,s,e,r[o],void 0===n)} - } - return h} - ,"fade"),_startFadeInterval:Qt(function(t,i,s,e,n,h){ - var r=this,o=i,a=s-i,c=Math.abs(a/.01),l=Math.max(4,c>0?e/c:e),u=Date.now(); - t._fadeTo=s,t._interval=setInterval(function(){ - var n=(Date.now()-u)/e; - u=Date.now(),o+=a*n,o=Math.round(100*o)/100,o=a<0?Math.max(s,o):Math.min(s,o),r._webAudio?t._volume=o:r.volume(o,t._id,!0),h&&(r._volume=o),(s<i&&o<=s||s>i&&o>=s)&&(clearInterval(t._interval),t._interval=null,t._fadeTo=null,r.volume(s,t._id),r._emit("fade",t._id))} - ,l)} - ,"_startFadeInterval"),_stopFade:Qt(function(t){ - var s=this,e=s._soundById(t); - return e&&e._interval&&(s._webAudio&&e._node.gain.cancelScheduledValues(i.ctx.currentTime),clearInterval(e._interval),e._interval=null,s.volume(e._fadeTo,t),e._fadeTo=null,s._emit("fade",t)),s} - ,"_stopFade"),loop:Qt(function(){ - var t,i,s,e=this,n=arguments; - if(0===n.length)return e._loop; - if(1===n.length){ - if("boolean"!=typeof n[0])return!!(s=e._soundById(parseInt(n[0],10)))&&s._loop; - t=n[0],e._loop=t} - else 2===n.length&&(t=n[0],i=parseInt(n[1],10)); - for(var h=e._getSoundIds(i),r=0; - r<h.length; - r++)(s=e._soundById(h[r]))&&(s._loop=t,e._webAudio&&s._node&&s._node.bufferSource&&(s._node.bufferSource.loop=t,t&&(s._node.bufferSource.loopStart=s._start||0,s._node.bufferSource.loopEnd=s._stop,e.playing(h[r])&&(e.pause(h[r],!0),e.play(h[r],!0))))); - return e} - ,"loop"),rate:Qt(function(){ - var t,s,e,n=this,h=arguments; - if(0===h.length?s=n._sounds[0]._id:1===h.length?n._getSoundIds().indexOf(h[0])>=0?s=parseInt(h[0],10):t=parseFloat(h[0]):2===h.length&&(t=parseFloat(h[0]),s=parseInt(h[1],10)),"number"!=typeof t)return(e=n._soundById(s))?e._rate:n._rate; - if("loaded"!==n._state||n._playLock)return n._queue.push({ - event:"rate",action:Qt(function(){ - n.rate.apply(n,h)} - ,"action")} - ),n; - void 0===s&&(n._rate=t),s=n._getSoundIds(s); - for(var r=0; - r<s.length; - r++)if(e=n._soundById(s[r])){ - n.playing(s[r])&&(e._rateSeek=n.seek(s[r]),e._playStart=n._webAudio?i.ctx.currentTime:e._playStart),e._rate=t,n._webAudio&&e._node&&e._node.bufferSource?e._node.bufferSource.playbackRate.setValueAtTime(t,i.ctx.currentTime):e._node&&(e._node.playbackRate=t); - var o=n.seek(s[r]),a=1e3*((n._sprite[e._sprite][0]+n._sprite[e._sprite][1])/1e3-o)/Math.abs(e._rate); - !n._endTimers[s[r]]&&e._paused||(n._clearTimer(s[r]),n._endTimers[s[r]]=setTimeout(n._ended.bind(n,e),a)),n._emit("rate",e._id)} - return n} - ,"rate"),seek:Qt(function(){ - var t,s,e=this,n=arguments; - if(0===n.length?e._sounds.length&&(s=e._sounds[0]._id):1===n.length?e._getSoundIds().indexOf(n[0])>=0?s=parseInt(n[0],10):e._sounds.length&&(s=e._sounds[0]._id,t=parseFloat(n[0])):2===n.length&&(t=parseFloat(n[0]),s=parseInt(n[1],10)),void 0===s)return 0; - if("number"==typeof t&&("loaded"!==e._state||e._playLock))return e._queue.push({ - event:"seek",action:Qt(function(){ - e.seek.apply(e,n)} - ,"action")} - ),e; - var h=e._soundById(s); - if(h){ - if(!("number"==typeof t&&t>=0)){ - if(e._webAudio){ - var r=e.playing(s)?i.ctx.currentTime-h._playStart:0,o=h._rateSeek?h._rateSeek-h._seek:0; - return h._seek+(o+r*Math.abs(h._rate))} - return h._node.currentTime} - var a=e.playing(s); - a&&e.pause(s,!0),h._seek=t,h._ended=!1,e._clearTimer(s),e._webAudio||!h._node||isNaN(h._node.duration)||(h._node.currentTime=t); - var c=Qt(function(){ - a&&e.play(s,!0),e._emit("seek",s)} - ,"seekAndEmit"); - if(a&&!e._webAudio){ - var l=Qt(function(){ - e._playLock?setTimeout(l,0):c()} - ,"emitSeek"); - setTimeout(l,0)} - else c()} - return e} - ,"seek"),playing:Qt(function(t){ - var i=this; - if("number"==typeof t){ - var s=i._soundById(t); - return!!s&&!s._paused} - for(var e=0; - e<i._sounds.length; - e++)if(!i._sounds[e]._paused)return!0; - return!1} - ,"playing"),duration:Qt(function(t){ - var i=this,s=i._duration,e=i._soundById(t); - return e&&(s=i._sprite[e._sprite][1]/1e3),s} - ,"duration"),state:Qt(function(){ - return this._state} - ,"state"),unload:Qt(function(){ - for(var t=this,s=t._sounds,e=0; - e<s.length; - e++)s[e]._paused||t.stop(s[e]._id),t._webAudio||(t._clearSound(s[e]._node),s[e]._node.removeEventListener("error",s[e]._errorFn,!1),s[e]._node.removeEventListener(i._canPlayEvent,s[e]._loadFn,!1),s[e]._node.removeEventListener("ended",s[e]._endFn,!1),i._releaseHtml5Audio(s[e]._node)),delete s[e]._node,t._clearTimer(s[e]._id); - var h=i._howls.indexOf(t); - h>=0&&i._howls.splice(h,1); - var r=!0; - for(e=0; - e<i._howls.length; - e++)if(i._howls[e]._src===t._src||t._src.indexOf(i._howls[e]._src)>=0){ - r=!1; - break} - return n&&r&&delete n[t._src],i.noAudio=!1,t._state="unloaded",t._sounds=[],t=null,null} - ,"unload"),on:Qt(function(t,i,s,e){ - var n=this["_on"+t]; - return"function"==typeof i&&n.push(e?{ - id:s,fn:i,once:e} - :{ - id:s,fn:i} - ),this} - ,"on"),off:Qt(function(t,i,s){ - var e=this,n=e["_on"+t],h=0; - if("number"==typeof i&&(s=i,i=null),i||s)for(h=0; - h<n.length; - h++){ - var r=s===n[h].id; - if(i===n[h].fn&&r||!i&&r){ - n.splice(h,1); - break} - } - else if(t)e["_on"+t]=[]; - else{ - var o=Object.keys(e); - for(h=0; - h<o.length; - h++)0===o[h].indexOf("_on")&&Array.isArray(e[o[h]])&&(e[o[h]]=[])} - return e} - ,"off"),once:Qt(function(t,i,s){ - return this.on(t,i,s,1),this} - ,"once"),_emit:Qt(function(t,i,s){ - for(var e=this,n=e["_on"+t],h=n.length-1; - h>=0; - h--)n[h].id&&n[h].id!==i&&"load"!==t||(setTimeout(function(t){ - t.call(this,i,s)} - .bind(e,n[h].fn),0),n[h].once&&e.off(t,n[h].fn,n[h].id)); - return e._loadQueue(t),e} - ,"_emit"),_loadQueue:Qt(function(t){ - var i=this; - if(i._queue.length>0){ - var s=i._queue[0]; - s.event===t&&(i._queue.shift(),i._loadQueue()),t||s.action()} - return i} - ,"_loadQueue"),_ended:Qt(function(t){ - var s=this,e=t._sprite; - if(!s._webAudio&&t._node&&!t._node.paused&&!t._node.ended&&t._node.currentTime<t._stop)return setTimeout(s._ended.bind(s,t),100),s; - var n=!(!t._loop&&!s._sprite[e][2]); - if(s._emit("end",t._id),!s._webAudio&&n&&s.stop(t._id,!0).play(t._id),s._webAudio&&n){ - s._emit("play",t._id),t._seek=t._start||0,t._rateSeek=0,t._playStart=i.ctx.currentTime; - var h=1e3*(t._stop-t._start)/Math.abs(t._rate); - s._endTimers[t._id]=setTimeout(s._ended.bind(s,t),h)} - return s._webAudio&&!n&&(t._paused=!0,t._ended=!0,t._seek=t._start||0,t._rateSeek=0,s._clearTimer(t._id),s._cleanBuffer(t._node),i._autoSuspend()),s._webAudio||n||s.stop(t._id,!0),s} - ,"_ended"),_clearTimer:Qt(function(t){ - var i=this; - if(i._endTimers[t]){ - if("function"!=typeof i._endTimers[t])clearTimeout(i._endTimers[t]); - else{ - var s=i._soundById(t); - s&&s._node&&s._node.removeEventListener("ended",i._endTimers[t],!1)} - delete i._endTimers[t]} - return i} - ,"_clearTimer"),_soundById:Qt(function(t){ - for(var i=this,s=0; - s<i._sounds.length; - s++)if(t===i._sounds[s]._id)return i._sounds[s]; - return null} - ,"_soundById"),_inactiveSound:Qt(function(){ - var t=this; - t._drain(); - for(var i=0; - i<t._sounds.length; - i++)if(t._sounds[i]._ended)return t._sounds[i].reset(); - return new e(t)} - ,"_inactiveSound"),_drain:Qt(function(){ - var t=this,i=t._pool,s=0,e=0; - if(!(t._sounds.length<i)){ - for(e=0; - e<t._sounds.length; - e++)t._sounds[e]._ended&&s++; - for(e=t._sounds.length-1; - e>=0; - e--){ - if(s<=i)return; - t._sounds[e]._ended&&(t._webAudio&&t._sounds[e]._node&&t._sounds[e]._node.disconnect(0),t._sounds.splice(e,1),s--)} - } - } - ,"_drain"),_getSoundIds:Qt(function(t){ - if(void 0===t){ - for(var i=[],s=0; - s<this._sounds.length; - s++)i.push(this._sounds[s]._id); - return i} - return[t]} - ,"_getSoundIds"),_refreshBuffer:Qt(function(t){ - return t._node.bufferSource=i.ctx.createBufferSource(),t._node.bufferSource.buffer=n[this._src],t._panner?t._node.bufferSource.connect(t._panner):t._node.bufferSource.connect(t._node),t._node.bufferSource.loop=t._loop,t._loop&&(t._node.bufferSource.loopStart=t._start||0,t._node.bufferSource.loopEnd=t._stop||0),t._node.bufferSource.playbackRate.setValueAtTime(t._rate,i.ctx.currentTime),this} - ,"_refreshBuffer"),_cleanBuffer:Qt(function(t){ - var s=i._navigator&&i._navigator.vendor.indexOf("Apple")>=0; - if(!t.bufferSource)return this; - if(i._scratchBuffer&&t.bufferSource&&(t.bufferSource.onended=null,t.bufferSource.disconnect(0),s))try{ - t.bufferSource.buffer=i._scratchBuffer} - catch(frt){ - } - return t.bufferSource=null,this} - ,"_cleanBuffer"),_clearSound:Qt(function(t){ - /MSIE |Trident\//.test(i._navigator&&i._navigator.userAgent)||(t.src="data:audio/wav; - base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")} - ,"_clearSound")} - ; - var e=Qt(function(t){ - this._parent=t,this.init()} - ,"Sound"); - e.prototype={ - init:Qt(function(){ - var t=this,s=t._parent; - return t._muted=s._muted,t._loop=s._loop,t._volume=s._volume,t._rate=s._rate,t._seek=0,t._paused=!0,t._ended=!0,t._sprite="__default",t._id=++i._counter,s._sounds.push(t),t.create(),t} - ,"init"),create:Qt(function(){ - var t=this,s=t._parent,e=i._muted||t._muted||t._parent._muted?0:t._volume; - return s._webAudio?(t._node=void 0===i.ctx.createGain?i.ctx.createGainNode():i.ctx.createGain(),t._node.gain.setValueAtTime(e,i.ctx.currentTime),t._node.paused=!0,t._node.connect(i.masterGain)):i.noAudio||(t._node=i._obtainHtml5Audio(),t._errorFn=t._errorListener.bind(t),t._node.addEventListener("error",t._errorFn,!1),t._loadFn=t._loadListener.bind(t),t._node.addEventListener(i._canPlayEvent,t._loadFn,!1),t._endFn=t._endListener.bind(t),t._node.addEventListener("ended",t._endFn,!1),t._node.src=s._src,t._node.preload=!0===s._preload?"auto":s._preload,t._node.volume=e*i.volume(),t._node.load()),t} - ,"create"),reset:Qt(function(){ - var t=this,s=t._parent; - return t._muted=s._muted,t._loop=s._loop,t._volume=s._volume,t._rate=s._rate,t._seek=0,t._rateSeek=0,t._paused=!0,t._ended=!0,t._sprite="__default",t._id=++i._counter,t} - ,"reset"),_errorListener:Qt(function(){ - var t=this; - t._parent._emit("loaderror",t._id,t._node.error?t._node.error.code:0),t._node.removeEventListener("error",t._errorFn,!1)} - ,"_errorListener"),_loadListener:Qt(function(){ - var t=this,s=t._parent; - s._duration=Math.ceil(10*t._node.duration)/10,0===Object.keys(s._sprite).length&&(s._sprite={ - __default:[0,1e3*s._duration]} - ),"loaded"!==s._state&&(s._state="loaded",s._emit("load"),s._loadQueue()),t._node.removeEventListener(i._canPlayEvent,t._loadFn,!1)} - ,"_loadListener"),_endListener:Qt(function(){ - var t=this,i=t._parent; - i._duration===1/0&&(i._duration=Math.ceil(10*t._node.duration)/10,i._sprite.__default[1]===1/0&&(i._sprite.__default[1]=1e3*i._duration),i._ended(t)),t._node.removeEventListener("ended",t._endFn,!1)} - ,"_endListener")} - ; - var n={ - } - ,h=Qt(function(t){ - var i=t._src; - if(n[i])return t._duration=n[i].duration,void a(t); - if(/^data:[^; - ]+; - base64,/.test(i)){ - for(var s=atob(i.split(",")[1]),e=new Uint8Array(s.length),h=0; - h<s.length; - ++h)e[h]=s.charCodeAt(h); - o(e.buffer,t)} - else{ - var c=new XMLHttpRequest; - c.open(t._xhr.method,i,!0),c.withCredentials=t._xhr.withCredentials,c.responseType="arraybuffer",t._xhr.headers&&Object.keys(t._xhr.headers).forEach(function(i){ - c.setRequestHeader(i,t._xhr.headers[i])} - ),c.onload=function(){ - var i=(c.status+"")[0]; - "0"===i||"2"===i||"3"===i?o(c.response,t):t._emit("loaderror",null,"Failed loading audio file with status: "+c.status+".")} - ,c.onerror=function(){ - t._webAudio&&(t._html5=!0,t._webAudio=!1,t._sounds=[],delete n[i],t.load())} - ,r(c)} - } - ,"loadBuffer"),r=Qt(function(t){ - try{ - t.send()} - catch(frt){ - t.onerror()} - } - ,"safeXhrSend"),o=Qt(function(t,s){ - var e=Qt(function(){ - s._emit("loaderror",null,"Decoding audio data failed.")} - ,"error"),h=Qt(function(t){ - t&&s._sounds.length>0?(n[s._src]=t,a(s,t)):e()} - ,"success"); - "undefined"!=typeof Promise&&1===i.ctx.decodeAudioData.length?i.ctx.decodeAudioData(t).then(h).catch(e):i.ctx.decodeAudioData(t,h,e)} - ,"decodeAudioData"),a=Qt(function(t,i){ - i&&!t._duration&&(t._duration=i.duration),0===Object.keys(t._sprite).length&&(t._sprite={ - __default:[0,1e3*t._duration]} - ),"loaded"!==t._state&&(t._state="loaded",t._emit("load"),t._loadQueue())} - ,"loadSound"),c=Qt(function(){ - if(i.usingWebAudio){ - try{ - "undefined"!=typeof AudioContext?i.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?i.ctx=new webkitAudioContext:i.usingWebAudio=!1} - catch(frt){ - i.usingWebAudio=!1} - i.ctx||(i.usingWebAudio=!1); - var t=/iP(hone|od|ad)/.test(i._navigator&&i._navigator.platform),s=i._navigator&&i._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),e=s?parseInt(s[1],10):null; - if(t&&e&&e<9){ - var n=/safari/.test(i._navigator&&i._navigator.userAgent.toLowerCase()); - i._navigator&&!n&&(i.usingWebAudio=!1)} - i.usingWebAudio&&(i.masterGain=void 0===i.ctx.createGain?i.ctx.createGainNode():i.ctx.createGain(),i.masterGain.gain.setValueAtTime(i._muted?0:i._volume,i.ctx.currentTime),i.masterGain.connect(i.ctx.destination)),i._setup()} - } - ,"setupAudioContext"); - GG.Howler=i,GG.Howl=s,void 0!==pi?(pi.HowlerGlobal=t,pi.Howler=i,pi.Howl=s,pi.Sound=e):"undefined"!=typeof window&&(window.HowlerGlobal=t,window.Howler=i,window.Howl=s,window.Sound=e)} - (),function(){ - HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(t){ - var i=this; - if(!i.ctx||!i.ctx.listener)return i; - for(var s=i._howls.length-1; - s>=0; - s--)i._howls[s].stereo(t); - return i} - ,HowlerGlobal.prototype.pos=function(t,i,s){ - var e=this; - return e.ctx&&e.ctx.listener?(i="number"!=typeof i?e._pos[1]:i,s="number"!=typeof s?e._pos[2]:s,"number"!=typeof t?e._pos:(e._pos=[t,i,s],void 0!==e.ctx.listener.positionX?(e.ctx.listener.positionX.setTargetAtTime(e._pos[0],Howler.ctx.currentTime,.1),e.ctx.listener.positionY.setTargetAtTime(e._pos[1],Howler.ctx.currentTime,.1),e.ctx.listener.positionZ.setTargetAtTime(e._pos[2],Howler.ctx.currentTime,.1)):e.ctx.listener.setPosition(e._pos[0],e._pos[1],e._pos[2]),e)):e} - ,HowlerGlobal.prototype.orientation=function(t,i,s,e,n,h){ - var r=this; - if(!r.ctx||!r.ctx.listener)return r; - var o=r._orientation; - return i="number"!=typeof i?o[1]:i,s="number"!=typeof s?o[2]:s,e="number"!=typeof e?o[3]:e,n="number"!=typeof n?o[4]:n,h="number"!=typeof h?o[5]:h,"number"!=typeof t?o:(r._orientation=[t,i,s,e,n,h],void 0!==r.ctx.listener.forwardX?(r.ctx.listener.forwardX.setTargetAtTime(t,Howler.ctx.currentTime,.1),r.ctx.listener.forwardY.setTargetAtTime(i,Howler.ctx.currentTime,.1),r.ctx.listener.forwardZ.setTargetAtTime(s,Howler.ctx.currentTime,.1),r.ctx.listener.upX.setTargetAtTime(e,Howler.ctx.currentTime,.1),r.ctx.listener.upY.setTargetAtTime(n,Howler.ctx.currentTime,.1),r.ctx.listener.upZ.setTargetAtTime(h,Howler.ctx.currentTime,.1)):r.ctx.listener.setOrientation(t,i,s,e,n,h),r)} - ,Howl.prototype.init=function(t){ - return function(i){ - var s=this; - return s._orientation=i.orientation||[1,0,0],s._stereo=i.stereo||null,s._pos=i.pos||null,s._pannerAttr={ - coneInnerAngle:void 0!==i.coneInnerAngle?i.coneInnerAngle:360,coneOuterAngle:void 0!==i.coneOuterAngle?i.coneOuterAngle:360,coneOuterGain:void 0!==i.coneOuterGain?i.coneOuterGain:0,distanceModel:void 0!==i.distanceModel?i.distanceModel:"inverse",maxDistance:void 0!==i.maxDistance?i.maxDistance:1e4,panningModel:void 0!==i.panningModel?i.panningModel:"HRTF",refDistance:void 0!==i.refDistance?i.refDistance:1,rolloffFactor:void 0!==i.rolloffFactor?i.rolloffFactor:1} - ,s._onstereo=i.onstereo?[{ - fn:i.onstereo} - ]:[],s._onpos=i.onpos?[{ - fn:i.onpos} - ]:[],s._onorientation=i.onorientation?[{ - fn:i.onorientation} - ]:[],t.call(this,i)} - } - (Howl.prototype.init),Howl.prototype.stereo=function(i,s){ - var e=this; - if(!e._webAudio)return e; - if("loaded"!==e._state)return e._queue.push({ - event:"stereo",action:Qt(function(){ - e.stereo(i,s)} - ,"action")} - ),e; - var n=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo"; - if(void 0===s){ - if("number"!=typeof i)return e._stereo; - e._stereo=i,e._pos=[i,0,0]} - for(var h=e._getSoundIds(s),r=0; - r<h.length; - r++){ - var o=e._soundById(h[r]); - if(o){ - if("number"!=typeof i)return o._stereo; - o._stereo=i,o._pos=[i,0,0],o._node&&(o._pannerAttr.panningModel="equalpower",o._panner&&o._panner.pan||t(o,n),"spatial"===n?void 0!==o._panner.positionX?(o._panner.positionX.setValueAtTime(i,Howler.ctx.currentTime),o._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),o._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):o._panner.setPosition(i,0,0):o._panner.pan.setValueAtTime(i,Howler.ctx.currentTime)),e._emit("stereo",o._id)} - } - return e} - ,Howl.prototype.pos=function(i,s,e,n){ - var h=this; - if(!h._webAudio)return h; - if("loaded"!==h._state)return h._queue.push({ - event:"pos",action:Qt(function(){ - h.pos(i,s,e,n)} - ,"action")} - ),h; - if(s="number"!=typeof s?0:s,e="number"!=typeof e?-.5:e,void 0===n){ - if("number"!=typeof i)return h._pos; - h._pos=[i,s,e]} - for(var r=h._getSoundIds(n),o=0; - o<r.length; - o++){ - var a=h._soundById(r[o]); - if(a){ - if("number"!=typeof i)return a._pos; - a._pos=[i,s,e],a._node&&(a._panner&&!a._panner.pan||t(a,"spatial"),void 0!==a._panner.positionX?(a._panner.positionX.setValueAtTime(i,Howler.ctx.currentTime),a._panner.positionY.setValueAtTime(s,Howler.ctx.currentTime),a._panner.positionZ.setValueAtTime(e,Howler.ctx.currentTime)):a._panner.setPosition(i,s,e)),h._emit("pos",a._id)} - } - return h} - ,Howl.prototype.orientation=function(i,s,e,n){ - var h=this; - if(!h._webAudio)return h; - if("loaded"!==h._state)return h._queue.push({ - event:"orientation",action:Qt(function(){ - h.orientation(i,s,e,n)} - ,"action")} - ),h; - if(s="number"!=typeof s?h._orientation[1]:s,e="number"!=typeof e?h._orientation[2]:e,void 0===n){ - if("number"!=typeof i)return h._orientation; - h._orientation=[i,s,e]} - for(var r=h._getSoundIds(n),o=0; - o<r.length; - o++){ - var a=h._soundById(r[o]); - if(a){ - if("number"!=typeof i)return a._orientation; - a._orientation=[i,s,e],a._node&&(a._panner||(a._pos||(a._pos=h._pos||[0,0,-.5]),t(a,"spatial")),void 0!==a._panner.orientationX?(a._panner.orientationX.setValueAtTime(i,Howler.ctx.currentTime),a._panner.orientationY.setValueAtTime(s,Howler.ctx.currentTime),a._panner.orientationZ.setValueAtTime(e,Howler.ctx.currentTime)):a._panner.setOrientation(i,s,e)),h._emit("orientation",a._id)} - } - return h} - ,Howl.prototype.pannerAttr=function(){ - var i,s,e,n=this,h=arguments; - if(!n._webAudio)return n; - if(0===h.length)return n._pannerAttr; - if(1===h.length){ - if("object"!=typeof h[0])return(e=n._soundById(parseInt(h[0],10)))?e._pannerAttr:n._pannerAttr; - i=h[0],void 0===s&&(i.pannerAttr||(i.pannerAttr={ - coneInnerAngle:i.coneInnerAngle,coneOuterAngle:i.coneOuterAngle,coneOuterGain:i.coneOuterGain,distanceModel:i.distanceModel,maxDistance:i.maxDistance,refDistance:i.refDistance,rolloffFactor:i.rolloffFactor,panningModel:i.panningModel} - ),n._pannerAttr={ - coneInnerAngle:void 0!==i.pannerAttr.coneInnerAngle?i.pannerAttr.coneInnerAngle:n._coneInnerAngle,coneOuterAngle:void 0!==i.pannerAttr.coneOuterAngle?i.pannerAttr.coneOuterAngle:n._coneOuterAngle,coneOuterGain:void 0!==i.pannerAttr.coneOuterGain?i.pannerAttr.coneOuterGain:n._coneOuterGain,distanceModel:void 0!==i.pannerAttr.distanceModel?i.pannerAttr.distanceModel:n._distanceModel,maxDistance:void 0!==i.pannerAttr.maxDistance?i.pannerAttr.maxDistance:n._maxDistance,refDistance:void 0!==i.pannerAttr.refDistance?i.pannerAttr.refDistance:n._refDistance,rolloffFactor:void 0!==i.pannerAttr.rolloffFactor?i.pannerAttr.rolloffFactor:n._rolloffFactor,panningModel:void 0!==i.pannerAttr.panningModel?i.pannerAttr.panningModel:n._panningModel} - )} - else 2===h.length&&(i=h[0],s=parseInt(h[1],10)); - for(var r=n._getSoundIds(s),o=0; - o<r.length; - o++)if(e=n._soundById(r[o])){ - var a=e._pannerAttr; - a={ - coneInnerAngle:void 0!==i.coneInnerAngle?i.coneInnerAngle:a.coneInnerAngle,coneOuterAngle:void 0!==i.coneOuterAngle?i.coneOuterAngle:a.coneOuterAngle,coneOuterGain:void 0!==i.coneOuterGain?i.coneOuterGain:a.coneOuterGain,distanceModel:void 0!==i.distanceModel?i.distanceModel:a.distanceModel,maxDistance:void 0!==i.maxDistance?i.maxDistance:a.maxDistance,refDistance:void 0!==i.refDistance?i.refDistance:a.refDistance,rolloffFactor:void 0!==i.rolloffFactor?i.rolloffFactor:a.rolloffFactor,panningModel:void 0!==i.panningModel?i.panningModel:a.panningModel} - ; - var c=e._panner; - c||(e._pos||(e._pos=n._pos||[0,0,-.5]),t(e,"spatial"),c=e._panner),c.coneInnerAngle=a.coneInnerAngle,c.coneOuterAngle=a.coneOuterAngle,c.coneOuterGain=a.coneOuterGain,c.distanceModel=a.distanceModel,c.maxDistance=a.maxDistance,c.refDistance=a.refDistance,c.rolloffFactor=a.rolloffFactor,c.panningModel=a.panningModel} - return n} - ,Sound.prototype.init=function(t){ - return function(){ - var i=this,s=i._parent; - i._orientation=s._orientation,i._stereo=s._stereo,i._pos=s._pos,i._pannerAttr=s._pannerAttr,t.call(this),i._stereo?s.stereo(i._stereo):i._pos&&s.pos(i._pos[0],i._pos[1],i._pos[2],i._id)} - } - (Sound.prototype.init),Sound.prototype.reset=function(t){ - return function(){ - var i=this,s=i._parent; - return i._orientation=s._orientation,i._stereo=s._stereo,i._pos=s._pos,i._pannerAttr=s._pannerAttr,i._stereo?s.stereo(i._stereo):i._pos?s.pos(i._pos[0],i._pos[1],i._pos[2],i._id):i._panner&&(i._panner.disconnect(0),i._panner=void 0,s._refreshBuffer(i)),t.call(this)} - } - (Sound.prototype.reset); - var t=Qt(function(t,i){ - "spatial"===(i=i||"spatial")?(t._panner=Howler.ctx.createPanner(),t._panner.coneInnerAngle=t._pannerAttr.coneInnerAngle,t._panner.coneOuterAngle=t._pannerAttr.coneOuterAngle,t._panner.coneOuterGain=t._pannerAttr.coneOuterGain,t._panner.distanceModel=t._pannerAttr.distanceModel,t._panner.maxDistance=t._pannerAttr.maxDistance,t._panner.refDistance=t._pannerAttr.refDistance,t._panner.rolloffFactor=t._pannerAttr.rolloffFactor,t._panner.panningModel=t._pannerAttr.panningModel,void 0!==t._panner.positionX?(t._panner.positionX.setValueAtTime(t._pos[0],Howler.ctx.currentTime),t._panner.positionY.setValueAtTime(t._pos[1],Howler.ctx.currentTime),t._panner.positionZ.setValueAtTime(t._pos[2],Howler.ctx.currentTime)):t._panner.setPosition(t._pos[0],t._pos[1],t._pos[2]),void 0!==t._panner.orientationX?(t._panner.orientationX.setValueAtTime(t._orientation[0],Howler.ctx.currentTime),t._panner.orientationY.setValueAtTime(t._orientation[1],Howler.ctx.currentTime),t._panner.orientationZ.setValueAtTime(t._orientation[2],Howler.ctx.currentTime)):t._panner.setOrientation(t._orientation[0],t._orientation[1],t._orientation[2])):(t._panner=Howler.ctx.createStereoPanner(),t._panner.pan.setValueAtTime(t._stereo,Howler.ctx.currentTime)),t._panner.connect(t._node),t._paused||t._parent.pause(t._id,!0).play(t._id,!0)} - ,"setupPanner")} - (); - const UG=ti({ - __proto__:null} - ,[BG]);
- =await Promise.resolve().then(()=>_vi); + =await import("./chunks/TossBridge.js");
- ,void 0); + ,__vite__mapDeps([14,1,0,2]),import.meta.url);
- =await Promise.resolve().then(()=>yvi); + =await import("./chunks/TelegramBridge.js");
- ,void 0); + ,[],import.meta.url);
- =await Promise.resolve().then(()=>Jvi); + =await import("./chunks/CapacitorBridge.js");
- ,void 0); + ,__vite__mapDeps([15,1,0,2,16,4,5]),import.meta.url);
- =await Promise.resolve().then(()=>t_i); + =await import("./chunks/WebBridge.js");
- ,void 0); + ,[],import.meta.url);
AgeRangeObjectAOS 2 hunks, 393 statements
- var DKt,GKt,BKt=(t=>(t.EMPTY="",t.UNKNOWN="UNKNOWN",t.VERIFIED="VERIFIED",t.SUPERVISED="SUPERVISED",t.SUPERVISED_APPROVAL_PENDING="SUPERVISED_APPROVAL_PENDING",t.SUPERVISED_APPROVAL_DENIED="SUPERVISED_APPROVAL_DENIED",t.SHARED="SHARED",t.DECLINED="DECLINED",t.UNSUPPORTED="UNSUPPORTED",t))(BKt||{ + var qI=(t=>(t.EMPTY="",t.UNKNOWN="UNKNOWN",t.VERIFIED="VERIFIED",t.SUPERVISED="SUPERVISED",t.SUPERVISED_APPROVAL_PENDING="SUPERVISED_APPROVAL_PENDING",t.SUPERVISED_APPROVAL_DENIED="SUPERVISED_APPROVAL_DENIED",t.SHARED="SHARED",t.DECLINED="DECLINED",t.UNSUPPORTED="UNSUPPORTED",t))(qI||{
- (GKt=DKt||(DKt={ - } - )).Unimplemented="UNIMPLEMENTED",GKt.Unavailable="UNAVAILABLE"; - const UKt=class extends Error{ - constructor(t,i,s){ - super(t),this.message=t,this.code=i,this.data=s} - } - ; - Qt(UKt,"CapacitorException"); - let FKt=UKt; - const $Kt=Qt(t=>{ - var i,s; - return(null==t?void 0:t.androidBridge)?"android":(null===(s=null===(i=null==t?void 0:t.webkit)||void 0===i?void 0:i.messageHandlers)||void 0===s?void 0:s.bridge)?"ios":"web"} - ,"getPlatformId"),HKt=Qt(t=>{ - const i=t.CapacitorCustomPlatform||null,s=t.Capacitor||{ - } - ,e=s.Plugins=s.Plugins||{ - } - ,n=Qt(()=>null!==i?i.name:$Kt(t),"getPlatform"),h=Qt(()=>"web"!==n(),"isNativePlatform"),r=Qt(t=>{ - const i=c.get(t); - return!!(null==i?void 0:i.platforms.has(n()))||!!o(t)} - ,"isPluginAvailable"),o=Qt(t=>{ - var i; - return null===(i=s.PluginHeaders)||void 0===i?void 0:i.find(i=>i.name===t)} - ,"getPluginHeader"),a=Qt(i=>t.console.error(i),"handleError"),c=new Map,l=Qt((t,h={ - } - )=>{ - const r=c.get(t); - if(r)return r.proxy; - const a=n(),l=o(t); - let u; - const d=Qt(async()=>(!u&&a in h?u=u="function"==typeof h[a]?await h[a]():h[a]:null!==i&&!u&&"web"in h&&(u=u="function"==typeof h.web?await h.web():h.web),u),"loadPluginImplementation"),f=Qt((i,e)=>{ - var n,h; - if(!l){ - if(i)return null===(h=i[e])||void 0===h?void 0:h.bind(i); - throw new FKt(`"${ - t} - " plugin is not implemented on ${ - a} - `,DKt.Unimplemented)} - { - const h=null==l?void 0:l.methods.find(t=>e===t.name); - if(h)return"promise"===h.rtype?i=>s.nativePromise(t,e.toString(),i):(i,n)=>s.nativeCallback(t,e.toString(),i,n); - if(i)return null===(n=i[e])||void 0===n?void 0:n.bind(i)} - } - ,"createPluginMethod"),p=Qt(i=>{ - let s; - const e=Qt((...e)=>{ - const n=d().then(n=>{ - const h=f(n,i); - if(h){ - const t=h(...e); - return s=null==t?void 0:t.remove,t} - throw new FKt(`"${ - t} - .${ - i} - ()" is not implemented on ${ - a} - `,DKt.Unimplemented)} - ); - return"addListener"===i&&(n.remove=async()=>s()),n} - ,"wrapper"); - return e.toString=()=>`${ - i.toString()} - () { - [capacitor code] } - `,Object.defineProperty(e,"name",{ - value:i,writable:!1,configurable:!1} - ),e} - ,"createPluginMethodWrapper"),w=p("addListener"),g=p("removeListener"),m=Qt((t,i)=>{ - const s=w({ - eventName:t} - ,i),e=Qt(async()=>{ - const e=await s; - g({ - eventName:t,callbackId:e} - ,i)} - ,"remove"),n=new Promise(t=>s.then(()=>t({ - remove:e} - ))); - return n.remove=async()=>{ - await e()} - ,n} - ,"addListenerNative"),v=new Proxy({ - } - ,{ - get(t,i){ - switch(i){ - case"$$typeof":return; - case"toJSON":return()=>({ - } - ); - case"addListener":return l?m:w; - case"removeListener":return g; - default:return p(i)} - } - } - ); - return e[t]=v,c.set(t,{ - name:t,proxy:v,platforms:new Set([...Object.keys(h),...l?[a]:[]])} - ),v} - ,"registerPlugin"); - return s.convertFileSrc||(s.convertFileSrc=t=>t),s.getPlatform=n,s.handleError=a,s.isNativePlatform=h,s.isPluginAvailable=r,s.registerPlugin=l,s.Exception=FKt,s.DEBUG=!!s.DEBUG,s.isLoggingEnabled=!!s.isLoggingEnabled,s} - ,"createCapacitor"),WKt=Qt(t=>t.Capacitor=HKt(t),"initCapacitorGlobal")("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{ - } - ),VKt=WKt.registerPlugin,jKt=class{ - constructor(){ - this.listeners={ - } - ,this.retainedEventArguments={ - } - ,this.windowListeners={ - } - } - addListener(t,i){ - let s=!1; - this.listeners[t]||(this.listeners[t]=[],s=!0),this.listeners[t].push(i); - const e=this.windowListeners[t]; - e&&!e.registered&&this.addWindowListener(e),s&&this.sendRetainedArgumentsForEvent(t); - const n=Qt(async()=>this.removeListener(t,i),"remove"); - return Promise.resolve({ - remove:n} - )} - async removeAllListeners(){ - this.listeners={ - } - ; - for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]); - this.windowListeners={ - } - } - notifyListeners(t,i,s){ - const e=this.listeners[t]; - if(e)e.forEach(t=>t(i)); - else if(s){ - let s=this.retainedEventArguments[t]; - s||(s=[]),s.push(i),this.retainedEventArguments[t]=s} - } - hasListeners(t){ - var i; - return!!(null===(i=this.listeners[t])||void 0===i?void 0:i.length)} - registerWindowListener(t,i){ - this.windowListeners[i]={ - registered:!1,windowEventName:t,pluginEventName:i,handler:Qt(t=>{ - this.notifyListeners(i,t)} - ,"handler")} - } - unimplemented(t="not implemented"){ - return new WKt.Exception(t,DKt.Unimplemented)} - unavailable(t="not available"){ - return new WKt.Exception(t,DKt.Unavailable)} - async removeListener(t,i){ - const s=this.listeners[t]; - if(!s)return; - const e=s.indexOf(i); - this.listeners[t].splice(e,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])} - addWindowListener(t){ - window.addEventListener(t.windowEventName,t.handler),t.registered=!0} - removeWindowListener(t){ - t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)} - sendRetainedArgumentsForEvent(t){ - const i=this.retainedEventArguments[t]; - i&&(delete this.retainedEventArguments[t],i.forEach(i=>{ - this.notifyListeners(t,i)} - ))} - } - ; - Qt(jKt,"WebPlugin"); - let KKt=jKt; - const zKt=Qt(t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),"encode$1"),YKt=Qt(t=>t.replace(/(%[\dA-F]{ - 2} - )+/gi,decodeURIComponent),"decode"),qKt=class extends KKt{ - async getCookies(){ - const t=document.cookie,i={ - } - ; - return t.split("; - ").forEach(t=>{ - if(t.length<=0)return; - let[s,e]=t.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE"); - s=YKt(s).trim(),e=YKt(e).trim(),i[s]=e} - ),i} - async setCookie(t){ - try{ - const i=zKt(t.key),s=zKt(t.value),e=t.expires?`; - expires=${ - t.expires.replace("expires=","")} - `:"",n=(t.path||"/").replace("path=",""),h=null!=t.url&&t.url.length>0?`domain=${ - t.url} - `:""; - document.cookie=`${ - i} - =${ - s||""} - ${ - e} - ; - path=${ - n} - ; - ${ - h} - ; - `} - catch(i){ - return Promise.reject(i)} - } - async deleteCookie(t){ - try{ - document.cookie=`${ - t.key} - =; - Max-Age=0`} - catch(i){ - return Promise.reject(i)} - } - async clearCookies(){ - try{ - const t=document.cookie.split("; - ")||[]; - for(const i of t)document.cookie=i.replace(/^ +/,"").replace(/=.*/,`=; - expires=${ - (new Date).toUTCString()} - ; - path=/`)} - catch(t){ - return Promise.reject(t)} - } - async clearAllCookies(){ - try{ - await this.clearCookies()} - catch(t){ - return Promise.reject(t)} - } - } - ; - Qt(qKt,"CapacitorCookiesPluginWeb"); - let XKt=qKt; - VKt("CapacitorCookies",{ - web:Qt(()=>new XKt,"web")} - ); - const JKt=Qt(async t=>new Promise((i,s)=>{ - const e=new FileReader; - e.onload=()=>{ - const t=e.result; - i(t.indexOf(",")>=0?t.split(",")[1]:t)} - ,e.onerror=t=>s(t),e.readAsDataURL(t)} - ),"readBlobAsBase64"),QKt=Qt((t={ - } - )=>{ - const i=Object.keys(t); - return Object.keys(t).map(t=>t.toLocaleLowerCase()).reduce((s,e,n)=>(s[e]=t[i[n]],s),{ - } - )} - ,"normalizeHttpHeaders"),ZKt=Qt((t,i=!0)=>t?Object.entries(t).reduce((t,s)=>{ - const[e,n]=s; - let h,r; - return Array.isArray(n)?(r="",n.forEach(t=>{ - h=i?encodeURIComponent(t):t,r+=`${ - e} - =${ - h} - &`} - ),r.slice(0,-1)):(h=i?encodeURIComponent(n):n,r=`${ - e} - =${ - h} - `),`${ - t} - &${ - r} - `} - ,"").substr(1):null,"buildUrlParams"),tzt=Qt((t,i={ - } - )=>{ - const s=Object.assign({ - method:t.method||"GET",headers:t.headers} - ,i),e=QKt(t.headers)["content-type"]||""; - if("string"==typeof t.data)s.body=t.data; - else if(e.includes("application/x-www-form-urlencoded")){ - const i=new URLSearchParams; - for(const[s,e]of Object.entries(t.data||{ - } - ))i.set(s,e); - s.body=i.toString()} - else if(e.includes("multipart/form-data")||t.data instanceof FormData){ - const i=new FormData; - if(t.data instanceof FormData)t.data.forEach((t,s)=>{ - i.append(s,t)} - ); - else for(const s of Object.keys(t.data))i.append(s,t.data[s]); - s.body=i; - const e=new Headers(s.headers); - e.delete("content-type"),s.headers=e} - else(e.includes("application/json")||"object"==typeof t.data)&&(s.body=JSON.stringify(t.data)); - return s} - ,"buildRequestInit"),izt=class extends KKt{ - async request(t){ - const i=tzt(t,t.webFetchExtra),s=ZKt(t.params,t.shouldEncodeUrlParams),e=s?`${ - t.url} - ?${ - s} - `:t.url,n=await fetch(e,i),h=n.headers.get("content-type")||""; - let r,o,{ - responseType:a="text"} - =n.ok?t:{ - } - ; - switch(h.includes("application/json")&&(a="json"),a){ - case"arraybuffer":case"blob":o=await n.blob(),r=await JKt(o); - break; - case"json":r=await n.json(); - break; - default:r=await n.text()} - const c={ - } - ; - return n.headers.forEach((t,i)=>{ - c[i]=t} - ),{ - data:r,headers:c,status:n.status,url:n.url} - } - async get(t){ - return this.request(Object.assign(Object.assign({ - } - ,t),{ - method:"GET"} - ))} - async post(t){ - return this.request(Object.assign(Object.assign({ - } - ,t),{ - method:"POST"} - ))} - async put(t){ - return this.request(Object.assign(Object.assign({ - } - ,t),{ - method:"PUT"} - ))} - async patch(t){ - return this.request(Object.assign(Object.assign({ - } - ,t),{ - method:"PATCH"} - ))} - async delete(t){ - return this.request(Object.assign(Object.assign({ - } - ,t),{ - method:"DELETE"} - ))} - } - ; - Qt(izt,"CapacitorHttpPluginWeb"); - let szt=izt; - var ezt,nzt,hzt,rzt; - VKt("CapacitorHttp",{ - web:Qt(()=>new szt,"web")} - ),(nzt=ezt||(ezt={ - } - )).Dark="DARK",nzt.Light="LIGHT",nzt.Default="DEFAULT",(rzt=hzt||(hzt={ - } - )).StatusBar="StatusBar",rzt.NavigationBar="NavigationBar"; - const ozt=class extends KKt{ - async setStyle(){ - this.unavailable("not available for web")} - async setAnimation(){ - this.unavailable("not available for web")} - async show(){ - this.unavailable("not available for web")} - async hide(){ - this.unavailable("not available for web")} - } - ; - Qt(ozt,"SystemBarsPluginWeb"); - let azt=ozt; - VKt("SystemBars",{ - web:Qt(()=>new azt,"web")} - ); - const czt=Object.freeze(Object.defineProperty({ - __proto__:null,Capacitor:WKt,CapacitorException:FKt,get ExceptionCode(){ - return DKt} - ,get SystemBarType(){ - return hzt} - ,get SystemBarsStyle(){ - return ezt} - ,WebPlugin:KKt,buildRequestInit:tzt,registerPlugin:VKt} - ,Symbol.toStringTag,{ - value:"Module"} - )),lzt=VKt("PlayAgeSignals"),uzt=class t{ + const QI=P("PlayAgeSignals"),JI=class t{
GuildRaidBookVO 1 hunks, 378 statements
- var X0t="in vec2 aPosition; - \nout vec2 vTextureCoord; - \n\nuniform vec4 uInputSize; - \nuniform vec4 uOutputFrame; - \nuniform vec4 uOutputTexture; - \n\nvec4 filterVertexPosition( void )\n{ - \n vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy; - \n \n position.x = position.x * (2.0 / uOutputTexture.x) - 1.0; - \n position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z; - \n\n return vec4(position, 0.0, 1.0); - \n} - \n\nvec2 filterTextureCoord( void )\n{ - \n return aPosition * (uOutputFrame.zw * uInputSize.zw); - \n} - \n\nvoid main(void)\n{ - \n gl_Position = filterVertexPosition(); - \n vTextureCoord = filterTextureCoord(); - \n} - \n",J0t="struct GlobalFilterUniforms { - \n uInputSize:vec4<f32>,\n uInputPixel:vec4<f32>,\n uInputClamp:vec4<f32>,\n uOutputFrame:vec4<f32>,\n uGlobalFrame:vec4<f32>,\n uOutputTexture:vec4<f32>,\n} - ; - \n\n@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms; - \n\nstruct VSOutput { - \n @builtin(position) position: vec4<f32>,\n @location(0) uv : vec2<f32>\n } - ; - \n\nfn filterVertexPosition(aPosition:vec2<f32>) -> vec4<f32>\n{ - \n var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy; - \n\n position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0; - \n position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z; - \n\n return vec4(position, 0.0, 1.0); - \n} - \n\nfn filterTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{ - \n return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw); - \n} - \n\nfn globalTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{ - \n return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw); - \n} - \n\nfn getSize() -> vec2<f32>\n{ - \n return gfu.uGlobalFrame.zw; - \n} - \n \n@vertex\nfn mainVertex(\n @location(0) aPosition : vec2<f32>, \n) -> VSOutput { - \n return VSOutput(\n filterVertexPosition(aPosition),\n filterTextureCoord(aPosition)\n ); - \n} - ",Q0t=Object.defineProperty,Z0t=Qt((t,i,s)=>i in t?Q0t(t,i,{ - enumerable:!0,configurable:!0,writable:!0,value:s} - ):t[i]=s,"__defNormalProp$1"),t1t=Qt((t,i,s)=>(Z0t(t,"symbol"!=typeof i?i+"":i,s),s),"__publicField$1"); - const i1t=(Qt(Bt=class extends wr{ - constructor(t){ - const i=(t={ - ...Bt.DEFAULT_OPTIONS,...t} - ).distance??10,s=t.quality??.1; - super({ - gpuProgram:tr.from({ - vertex:{ - source:J0t,entryPoint:"mainVertex"} - ,fragment:{ - source:"struct GlowUniforms { - \n uDistance: f32,\n uStrength: vec2<f32>,\n uColor: vec3<f32>,\n uAlpha: f32,\n uQuality: f32,\n uKnockout: f32,\n} - ; - \n\nstruct GlobalFilterUniforms { - \n uInputSize:vec4<f32>,\n uInputPixel:vec4<f32>,\n uInputClamp:vec4<f32>,\n uOutputFrame:vec4<f32>,\n uGlobalFrame:vec4<f32>,\n uOutputTexture:vec4<f32>,\n} - ; - \n\n@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms; - \n\n@group(0) @binding(1) var uTexture: texture_2d<f32>; - \n@group(0) @binding(2) var uSampler: sampler; - \n@group(1) @binding(0) var<uniform> glowUniforms : GlowUniforms; - \n\n@fragment\nfn mainFragment(\n @builtin(position) position: vec4<f32>,\n @location(0) uv : vec2<f32>\n) -> @location(0) vec4<f32> { - \n let quality = glowUniforms.uQuality; - \n let distance = glowUniforms.uDistance; - \n\n let dist: f32 = glowUniforms.uDistance; - \n let angleStepSize: f32 = min(1. / quality / distance, PI * 2.0); - \n let angleStepNum: f32 = ceil(PI * 2.0 / angleStepSize); - \n\n let px: vec2<f32> = vec2<f32>(1.0 / gfu.uInputSize.xy); - \n\n var totalAlpha: f32 = 0.0; - \n\n var direction: vec2<f32>; - \n var displaced: vec2<f32>; - \n var curColor: vec4<f32>; - \n\n for (var angle = 0.0; - angle < PI * 2.0; - angle += angleStepSize) { - \n direction = vec2<f32>(cos(angle), sin(angle)) * px; - \n for (var curDistance = 0.0; - curDistance < dist; - curDistance+=1) { - \n displaced = vec2<f32>(clamp(uv + direction * (curDistance + 1.0), gfu.uInputClamp.xy, gfu.uInputClamp.zw)); - \n curColor = textureSample(uTexture, uSampler, displaced); - \n totalAlpha += (dist - curDistance) * curColor.a; - \n } - \n } - \n \n curColor = textureSample(uTexture, uSampler, uv); - \n\n let glowColorRGB = glowUniforms.uColor; - \n let glowAlpha = glowUniforms.uAlpha; - \n let glowColor = vec4<f32>(glowColorRGB, glowAlpha); - \n let knockout: bool = glowUniforms.uKnockout > 0.5; - \n let innerStrength = glowUniforms.uStrength[0]; - \n let outerStrength = glowUniforms.uStrength[1]; - \n\n let alphaRatio: f32 = (totalAlpha / (angleStepNum * dist * (dist + 1.0) / 2.0)); - \n let innerGlowAlpha: f32 = (1.0 - alphaRatio) * innerStrength * curColor.a * glowAlpha; - \n let innerGlowStrength: f32 = min(1.0, innerGlowAlpha); - \n \n let innerColor: vec4<f32> = mix(curColor, glowColor, innerGlowStrength); - \n let outerGlowAlpha: f32 = alphaRatio * outerStrength * (1. - curColor.a) * glowAlpha; - \n let outerGlowStrength: f32 = min(1.0 - innerColor.a, outerGlowAlpha); - \n let outerGlowColor: vec4<f32> = outerGlowStrength * glowColor.rgba; - \n \n if (knockout) { - \n let resultAlpha: f32 = outerGlowAlpha + innerGlowAlpha; - \n return vec4<f32>(glowColor.rgb * resultAlpha, resultAlpha); - \n } - \n else { - \n return innerColor + outerGlowColor; - \n } - \n} - \n\nconst PI: f32 = 3.14159265358979323846264; - ",entryPoint:"mainFragment"} - } - ),glProgram:Uh.from({ - vertex:X0t,fragment:"precision highp float; - \nin vec2 vTextureCoord; - \nout vec4 finalColor; - \n\nuniform sampler2D uTexture; - \nuniform vec2 uStrength; - \nuniform vec3 uColor; - \nuniform float uKnockout; - \nuniform float uAlpha; - \n\nuniform vec4 uInputSize; - \nuniform vec4 uInputClamp; - \n\nconst float PI = 3.14159265358979323846264; - \n\n// Hard-assignment of DIST and ANGLE_STEP_SIZE instead of using uDistance and uQuality to allow them to be use on GLSL loop conditions\nconst float DIST = __DIST__; - \nconst float ANGLE_STEP_SIZE = min(__ANGLE_STEP_SIZE__, PI * 2.); - \nconst float ANGLE_STEP_NUM = ceil(PI * 2. / ANGLE_STEP_SIZE); - \nconst float MAX_TOTAL_ALPHA = ANGLE_STEP_NUM * DIST * (DIST + 1.) / 2.; - \n\nvoid main(void) { - \n vec2 px = vec2(1.) / uInputSize.xy; - \n\n float totalAlpha = 0.; - \n\n vec2 direction; - \n vec2 displaced; - \n vec4 curColor; - \n\n for (float angle = 0.; - angle < PI * 2.; - angle += ANGLE_STEP_SIZE) { - \n direction = vec2(cos(angle), sin(angle)) * px; - \n\n for (float curDistance = 0.; - curDistance < DIST; - curDistance++) { - \n displaced = clamp(vTextureCoord + direction * (curDistance + 1.), uInputClamp.xy, uInputClamp.zw); - \n curColor = texture(uTexture, displaced); - \n totalAlpha += (DIST - curDistance) * curColor.a; - \n } - \n } - \n \n curColor = texture(uTexture, vTextureCoord); - \n\n vec4 glowColor = vec4(uColor, uAlpha); - \n bool knockout = uKnockout > .5; - \n float innerStrength = uStrength[0]; - \n float outerStrength = uStrength[1]; - \n\n float alphaRatio = totalAlpha / MAX_TOTAL_ALPHA; - \n float innerGlowAlpha = (1. - alphaRatio) * innerStrength * curColor.a * uAlpha; - \n float innerGlowStrength = min(1., innerGlowAlpha); - \n \n vec4 innerColor = mix(curColor, glowColor, innerGlowStrength); - \n float outerGlowAlpha = alphaRatio * outerStrength * (1. - curColor.a) * uAlpha; - \n float outerGlowStrength = min(1. - innerColor.a, outerGlowAlpha); - \n vec4 outerGlowColor = outerGlowStrength * glowColor.rgba; - \n\n if (knockout) { - \n float resultAlpha = outerGlowAlpha + innerGlowAlpha; - \n finalColor = vec4(glowColor.rgb * resultAlpha, resultAlpha); - \n } - \n else { - \n finalColor = innerColor + outerGlowColor; - \n } - \n} - \n".replace(/__ANGLE_STEP_SIZE__/gi,`${ - (1/s/i).toFixed(7)} - `).replace(/__DIST__/gi,`${ - i.toFixed(0)} - .0`),name:"glow-filter"} - ),resources:{ - glowUniforms:{ - uDistance:{ - value:i,type:"f32"} - ,uStrength:{ - value:[t.innerStrength,t.outerStrength],type:"vec2<f32>"} - ,uColor:{ - value:new Float32Array(3),type:"vec3<f32>"} - ,uAlpha:{ - value:t.alpha,type:"f32"} - ,uQuality:{ - value:s,type:"f32"} - ,uKnockout:{ - value:(null==t?void 0:t.knockout)?1:0,type:"f32"} - } - } - ,padding:i} - ),t1t(this,"uniforms"),t1t(this,"_color"),this.uniforms=this.resources.glowUniforms.uniforms,this._color=new Ks,this.color=t.color??16777215} - get distance(){ - return this.uniforms.uDistance} - set distance(t){ - this.uniforms.uDistance=this.padding=t} - get innerStrength(){ - return this.uniforms.uStrength[0]} - set innerStrength(t){ - this.uniforms.uStrength[0]=t} - get outerStrength(){ - return this.uniforms.uStrength[1]} - set outerStrength(t){ - this.uniforms.uStrength[1]=t} - get color(){ - return this._color.value} - set color(t){ - this._color.setValue(t); - const[i,s,e]=this._color.toArray(); - this.uniforms.uColor[0]=i,this.uniforms.uColor[1]=s,this.uniforms.uColor[2]=e} - get alpha(){ - return this.uniforms.uAlpha} - set alpha(t){ - this.uniforms.uAlpha=t} - get quality(){ - return this.uniforms.uQuality} - set quality(t){ - this.uniforms.uQuality=t} - get knockout(){ - return 1===this.uniforms.uKnockout} - set knockout(t){ - this.uniforms.uKnockout=t?1:0} - } - ,"_GlowFilter"),Bt); - t1t(i1t,"DEFAULT_OPTIONS",{ - distance:10,outerStrength:4,innerStrength:0,color:16777215,alpha:1,quality:.1,knockout:!1} - ); - let s1t=i1t; - var e1t=Object.defineProperty,n1t=Qt((t,i,s)=>i in t?e1t(t,i,{ - enumerable:!0,configurable:!0,writable:!0,value:s} - ):t[i]=s,"__defNormalProp"),h1t=Qt((t,i,s)=>(n1t(t,"symbol"!=typeof i?i+"":i,s),s),"__publicField"); - const r1t=(Qt(Ut=class extends wr{ - constructor(...t){ - let i=t[0]??{ - } - ; - "number"==typeof i&&(Yi("6.0.0","OutlineFilter constructor params are now options object. See params: { - thickness, color, quality, alpha, knockout } - "),i={ - thickness:i} - ,void 0!==t[1]&&(i.color=t[1]),void 0!==t[2]&&(i.quality=t[2]),void 0!==t[3]&&(i.alpha=t[3]),void 0!==t[4]&&(i.knockout=t[4])),i={ - ...Ut.DEFAULT_OPTIONS,...i} - ; - const s=i.quality??.1; - super({ - gpuProgram:tr.from({ - vertex:{ - source:J0t,entryPoint:"mainVertex"} - ,fragment:{ - source:"struct OutlineUniforms { - \n uThickness:vec2<f32>,\n uColor:vec3<f32>,\n uAlpha:f32,\n uAngleStep:f32,\n uKnockout:f32,\n} - ; - \n\nstruct GlobalFilterUniforms { - \n uInputSize:vec4<f32>,\n uInputPixel:vec4<f32>,\n uInputClamp:vec4<f32>,\n uOutputFrame:vec4<f32>,\n uGlobalFrame:vec4<f32>,\n uOutputTexture:vec4<f32>,\n} - ; - \n\n@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms; - \n\n@group(0) @binding(1) var uTexture: texture_2d<f32>; - \n@group(0) @binding(2) var uSampler: sampler; - \n@group(1) @binding(0) var<uniform> outlineUniforms : OutlineUniforms; - \n\n@fragment\nfn mainFragment(\n @builtin(position) position: vec4<f32>,\n @location(0) uv : vec2<f32>\n) -> @location(0) vec4<f32> { - \n let sourceColor: vec4<f32> = textureSample(uTexture, uSampler, uv); - \n let contentColor: vec4<f32> = sourceColor * (1. - outlineUniforms.uKnockout); - \n \n let outlineAlpha: f32 = outlineUniforms.uAlpha * outlineMaxAlphaAtPos(uv) * (1. - sourceColor.a); - \n let outlineColor: vec4<f32> = vec4<f32>(vec3<f32>(outlineUniforms.uColor) * outlineAlpha, outlineAlpha); - \n \n return contentColor + outlineColor; - \n} - \n\nfn outlineMaxAlphaAtPos(uv: vec2<f32>) -> f32 { - \n let thickness = outlineUniforms.uThickness; - \n\n if (thickness.x == 0. || thickness.y == 0.) { - \n return 0.; - \n } - \n \n let angleStep = outlineUniforms.uAngleStep; - \n\n var displacedColor: vec4<f32>; - \n var displacedPos: vec2<f32>; - \n\n var maxAlpha: f32 = 0.; - \n var displaced: vec2<f32>; - \n var curColor: vec4<f32>; - \n\n for (var angle = 0.; - angle <= DOUBLE_PI; - angle += angleStep)\n { - \n displaced.x = uv.x + thickness.x * cos(angle); - \n displaced.y = uv.y + thickness.y * sin(angle); - \n curColor = textureSample(uTexture, uSampler, clamp(displaced, gfu.uInputClamp.xy, gfu.uInputClamp.zw)); - \n maxAlpha = max(maxAlpha, curColor.a); - \n } - \n\n return maxAlpha; - \n} - \n\nconst DOUBLE_PI: f32 = 3.14159265358979323846264 * 2.; - ",entryPoint:"mainFragment"} - } - ),glProgram:Uh.from({ - vertex:X0t,fragment:"precision highp float; - \nin vec2 vTextureCoord; - \nout vec4 finalColor; - \n\nuniform sampler2D uTexture; - \nuniform vec2 uThickness; - \nuniform vec3 uColor; - \nuniform float uAlpha; - \nuniform float uKnockout; - \n\nuniform vec4 uInputClamp; - \n\nconst float DOUBLE_PI = 2. * 3.14159265358979323846264; - \nconst float ANGLE_STEP = ${ - ANGLE_STEP} - ; - \n\nfloat outlineMaxAlphaAtPos(vec2 pos) { - \n if (uThickness.x == 0. || uThickness.y == 0.) { - \n return 0.; - \n } - \n\n vec4 displacedColor; - \n vec2 displacedPos; - \n float maxAlpha = 0.; - \n\n for (float angle = 0.; - angle <= DOUBLE_PI; - angle += ANGLE_STEP) { - \n displacedPos.x = vTextureCoord.x + uThickness.x * cos(angle); - \n displacedPos.y = vTextureCoord.y + uThickness.y * sin(angle); - \n displacedColor = texture(uTexture, clamp(displacedPos, uInputClamp.xy, uInputClamp.zw)); - \n maxAlpha = max(maxAlpha, displacedColor.a); - \n } - \n\n return maxAlpha; - \n} - \n\nvoid main(void) { - \n vec4 sourceColor = texture(uTexture, vTextureCoord); - \n vec4 contentColor = sourceColor * float(uKnockout < 0.5); - \n float outlineAlpha = uAlpha * outlineMaxAlphaAtPos(vTextureCoord.xy) * (1.-sourceColor.a); - \n vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha); - \n finalColor = contentColor + outlineColor; - \n} - \n".replace(/\$\{ - ANGLE_STEP\} - /,Ut.getAngleStep(s).toFixed(7)),name:"outline-filter"} - ),resources:{ - outlineUniforms:{ - uThickness:{ - value:new Float32Array(2),type:"vec2<f32>"} - ,uColor:{ - value:new Float32Array(3),type:"vec3<f32>"} - ,uAlpha:{ - value:i.alpha,type:"f32"} - ,uAngleStep:{ - value:0,type:"f32"} - ,uKnockout:{ - value:i.knockout?1:0,type:"f32"} - } - } - } - ),h1t(this,"uniforms"),h1t(this,"_thickness"),h1t(this,"_quality"),h1t(this,"_color"),this.uniforms=this.resources.outlineUniforms.uniforms,this.uniforms.uAngleStep=Ut.getAngleStep(s),this._color=new Ks,this.color=i.color??0,Object.assign(this,i)} - apply(t,i,s,e){ - this.uniforms.uThickness[0]=this.thickness/i.source.width,this.uniforms.uThickness[1]=this.thickness/i.source.height,t.applyFilter(this,i,s,e)} - static getAngleStep(t){ - return parseFloat((2*Math.PI/Math.max(t*Ut.MAX_SAMPLES,Ut.MIN_SAMPLES)).toFixed(7))} - get thickness(){ - return this._thickness} - set thickness(t){ - this._thickness=this.padding=t} - get color(){ - return this._color.value} - set color(t){ - this._color.setValue(t); - const[i,s,e]=this._color.toArray(); - this.uniforms.uColor[0]=i,this.uniforms.uColor[1]=s,this.uniforms.uColor[2]=e} - get alpha(){ - return this.uniforms.uAlpha} - set alpha(t){ - this.uniforms.uAlpha=t} - get quality(){ - return this._quality} - set quality(t){ - this._quality=t,this.uniforms.uAngleStep=Ut.getAngleStep(t)} - get knockout(){ - return 1===this.uniforms.uKnockout} - set knockout(t){ - this.uniforms.uKnockout=t?1:0} - } - ,"_OutlineFilter"),Ut); - h1t(r1t,"DEFAULT_OPTIONS",{ - thickness:1,color:0,alpha:1,quality:.1,knockout:!1} - ),h1t(r1t,"MIN_SAMPLES",1),h1t(r1t,"MAX_SAMPLES",100); - let o1t=r1t;
ProfileDecoManager 1 hunks, 272 statements
+ const cc=[11,12,13,14,15,16],uc=11,dc={ + 1:13,2:14,3:16,4:15} + ,_c=[{ + id:101,floor:1e3} + ,{ + id:102,floor:2e3} + ,{ + id:103,floor:5e3} + ,{ + id:104,floor:7e3} + ,{ + id:105,floor:1e4} + ,{ + id:106,floor:2e4} + ,{ + id:107,floor:3e4} + ,{ + id:108,floor:5e4} + ,{ + id:109,floor:7e4} + ],fc=[{ + id:201,kind:"season",place:1} + ,{ + id:202,kind:"season",place:2} + ,{ + id:203,kind:"season",place:3} + ,{ + id:204,kind:"season",place:45} + ,{ + id:205,kind:"season",place:68} + ,{ + id:211,kind:"tour",place:1} + ,{ + id:212,kind:"tour",place:2} + ,{ + id:213,kind:"tour",place:3} + ,{ + id:214,kind:"tour",place:4} + ,{ + id:215,kind:"tour",place:8} + ,{ + id:216,kind:"tour",place:16} + ],pc=e(t=>t>=1&&t<=4?t:1,"clampTribe"),Mc=class t{ + static onChange(s){ + t.listeners.push(s)} + static emit(){ + for(const i of t.listeners)try{ + i()} + catch(s){ + } + } + static ensure(){ + t.state||t.loading||t.load(!1)} + static async load(s=!1,i=!1){ + return t.loading&&!i||(t.loading=(async()=>{ + var h,e; + try{ + const n=await tn.getInstance().profileDeco.getState(s,i),r=(null==n?void 0:n.success)?null==(h=n.body)?void 0:h.state:void 0; + if(r){ + Array.isArray(r.faces)||(r.faces=(null==(e=t.state)?void 0:e.faces)??[]); + const s=t.state; + t.state=r,t.emit(),s&&r.frames.some(t=>cc.includes(t.id)&&!s.frames.some(s=>s.id===t.id))&&Promise.all([o(()=>Promise.resolve().then(()=>Yu),void 0,import.meta.url),o(()=>Promise.resolve().then(()=>PW),void 0,import.meta.url)]).then(([{ + CommonToast:t} + ,{ + DecoText:s} + ])=>t.getInstance().showMessage(s.frameMailNew()))} + return t.state} + catch(n){ + return t.state} + finally{ + t.loading=null} + } + )()),t.loading} + static checkFloors(s){ + if(!t.state||t.loading)return; + const i=dc[Oo.tribe]; + (t.floorFrames.some(i=>s>=i.floor&&!t.ownsFrame(i.id))||void 0!==i&&!t.ownsFrame(i))&&t.load(!1)} + static async save(s){ + var i,h; + const e=await tn.getInstance().profileDeco.save(s.faces,s.frames,s.rep); + if(!(null==e?void 0:e.success))return null; + const n=null==(i=e.body)?void 0:i.state; + return n&&(t.state=n,t.emit()),(null==(h=e.body)?void 0:h.result)??null} + static get deco(){ + var s; + return(null==(s=t.state)?void 0:s.deco)??{ + faces:[0,0,0,0],frames:[0,0,0,0],rep:0} + } + static get floorFrames(){ + var s; + return(null==(s=t.state)?void 0:s.floorFrames)??_c} + static get nowTribe(){ + return pc(Oo.tribe)} + static repTribe(s=t.deco){ + return s.rep>=1&&s.rep<=4?s.rep:t.nowTribe} + static slot(s,i=t.deco){ + const h=pc(s); + return{ + tribe:h,face:i.faces[h-1]??0,frame:i.frames[h-1]??0} + } + static get nowLook(){ + return t.slot(t.nowTribe)} + static ownsFace(s){ + var i; + return 0===s||!!(null==(i=t.state)?void 0:i.faces.includes(s))} + static ownsFrame(s){ + var i; + return 0===s||!!(null==(i=t.state)?void 0:i.frames.some(t=>t.id===s))} + } + ; + e(Mc,"ProfileDecoManager"),n(Mc,"state",null),n(Mc,"loading",null),n(Mc,"listeners",[]); + let gc=Mc; + const Ec={ + 11:{ + group:"gift",own:1,equip:1} + ,12:{ + group:"gift",own:1,equip:1} + ,13:{ + group:"gift",own:1,equip:1} + ,14:{ + group:"gift",own:1,equip:1} + ,15:{ + group:"gift",own:1,equip:1} + ,16:{ + group:"gift",own:1,equip:1} + ,101:{ + group:"floor",own:1,equip:1} + ,102:{ + group:"floor",own:1,equip:1} + ,103:{ + group:"floor",own:1,equip:1} + ,104:{ + group:"floor",own:1,equip:1} + ,105:{ + group:"floor",own:1,equip:2} + ,106:{ + group:"floor",own:1,equip:2} + ,107:{ + group:"floor",own:1,equip:2} + ,108:{ + group:"floor",own:1,equip:3} + ,109:{ + group:"floor",own:1,equip:3} + ,201:{ + group:"season",own:5,equip:7} + ,202:{ + group:"season",own:4,equip:6} + ,203:{ + group:"season",own:3,equip:5} + ,204:{ + group:"season",own:2,equip:4} + ,205:{ + group:"season",own:1,equip:3} + ,211:{ + group:"tour",own:6,equip:8} + ,212:{ + group:"tour",own:5,equip:7} + ,213:{ + group:"tour",own:4,equip:6} + ,214:{ + group:"tour",own:3,equip:5} + ,215:{ + group:"tour",own:2,equip:4} + ,216:{ + group:"tour",own:1,equip:3} + } + ; + function wc(t,s){ + var i; + const h=new Set(t); + let e=0,n=0,o=0; + const r={ + } + ; + for(const c of t){ + if(r[c])continue; + r[c]=!0; + const t=Ec[c]; + t&&("floor"===t.group||"gift"===t.group?e+=t.own:"season"===t.group?n=Math.max(n,t.own):o=Math.max(o,t.own))} + const a=h.has(s)?(null==(i=Ec[s])?void 0:i.equip)??0:0,l=e+n+o; + return{ + own:l,equip:a,total:l+a} + } + e(wc,"framePlusLv"); + const mc=class t{ + constructor(){ + n(this,"sourceId","profileFrame"),n(this,"value",0),gc.onChange(()=>this.refresh())} + static getInstance(){ + return null==this._instance&&(this._instance=new t),this._instance} + get effect(){ + const t=gc.state; + return t?wc(t.frames.map(t=>t.id),gc.nowLook.frame):{ + own:0,equip:0,total:0} + } + refresh(){ + const t=this.effect.total; + t!==this.value&&(this.value=t,Ii.getInstance().recalculate(),Promise.all([o(()=>Promise.resolve().then(()=>fN),void 0,import.meta.url),o(()=>Promise.resolve().then(()=>M0),void 0,import.meta.url)]).then(([{ + HeroSubView:t} + ,{ + CastleSubView:s} + ])=>{ + var i; + t.getInstance().refreshLevels(); + const h=s.getInstance(); + (null==(i=h.parent)?void 0:i.parent)&&h.setData()} + ))} + getBuffList(){ + return[]} + getGameplayBuffs(){ + return this.value=this.effect.total,this.value>0?[{ + code:ci.PlusLv,value:this.value} + ]:[]} + } + ; + e(mc,"ProfileFrameBuffSource"),n(mc,"_instance"); + let Ac=mc; + const Tc="ProfileDeco",bc=["Human","Human","Elf","Undead","Orc"]; + function Sc(t){ + if(nt.hasSheet(Tc))return nt.getTexture(Tc,t)??void 0} + e(Sc,"deco"); + const Ic=class extends l{ + constructor(t=124){ + super(),n(this,"faceSp",new u),n(this,"emptySp",new p),n(this,"frameSp",new u),n(this,"_size"),n(this,"look",{ + tribe:1,face:0,frame:0} + ),this._size=t,this.faceSp.eventMode="none",this.emptySp.eventMode="none",this.frameSp.eventMode="none",this.addChild(this.faceSp,this.emptySp,this.frameSp)} + get size(){ + return this._size} + setSize(t){ + this._size=t,this.draw()} + setLook(t,s,i){ + this.look={ + tribe:t>=1&&t<=4?t:1,face:s,frame:i} + ,this.draw()} + setDim(t,s=!1){ + const i=t?s?10395294:8421504:16777215; + this.faceSp.tint=i,this.frameSp.tint=s?16777215:i} + draw(){ + const t=this._size,s=t/124,{ + tribe:i,face:h,frame:e} + =this.look; + if(this.faceSp.visible=h>=0,this.emptySp.visible=h<0,this.emptySp.clear(),h<0){ + const t=62*s; + this.emptySp.circle(t,t,35*s).fill(2760985),this.emptySp.circle(t,t,35*s*.62).fill({ + color:3812898,alpha:.6} + )} + const n=(h>0?Sc(`face_${ + h} + `):void 0)??Sc(`tribe_${ + i} + `); + if(n)this.faceSp.texture=n,this.faceSp.scale.set(70*s/n.width),this.faceSp.position.set(27*s,27*s); + else{ + const t=nt.getTexture("UI_Ekkorr",`Profile_${ + bc[i]} + `); + this.faceSp.texture=t; + const h=70*s/74; + this.faceSp.scale.set(h),this.faceSp.position.set(62*s-51*h,62*s-46*h)} + const o=e>0?Sc(`frame_${ + e} + `):void 0; + if(o)this.frameSp.texture=o,this.frameSp.scale.set(t/o.width),this.frameSp.position.set(0,0); + else{ + const s=nt.getTexture("UI_Ekkorr","ProfileFrame_01"); + this.frameSp.texture=s,this.frameSp.scale.set(t/124),this.frameSp.position.set(0,5)} + } + setEventMode(t){ + this.faceSp.eventMode=t,this.frameSp.eventMode=t} + } + ; + e(Ic,"ProfileBadge"); + let Oc=Ic;
GuildWarGuidePopup 2 hunks, 185 statements
+ super(),n(this,"pageNav"),n(this,"medalBuffList",null),this.outSideClickHide=!0,this.width=t.POPUP_WIDTH,this.pageNav=new Ka(t.POPUP_WIDTH-40,16,en.DEFAULT_COLOR,6),this.pageNav.setBgVisible(!1),this.pageNav.x=20,this.pageNav.y=t.NAV_TOP_Y,this.contentContainer.addChild(this.pageNav),this.buildPages()} + static getInstance(){ + return this._instance||(this._instance=new t),this._instance} + buildPages(){ + const s=e((t,s)=>Nr.getText(t,s),"t"); + this.medalBuffList||(this.medalBuffList=this.createMedalBuffList()); + const i=this.medalBuffList,h=t.season3,n=e((t,i,...h)=>h.reduce((t,s,i)=>t.split(`{ + ${ + i} + } + `).join(String(s)),s(t,i)),"fill"),o=[{ + title:s("GAME_1020","개요"),content:[...h?["# "+s("GAME_1989","시즌 3부터 종족 영역 · 피로 · 축복 카드 규칙이 더해집니다.")]:[],"# "+s("GAME_988","길드전은 12시간마다 자동으로 매칭되며, 23시간동안 진행됩니다. ( 1시간은 보상/정산 및 다음 길드전 준비시간 )"),"# "+s("GAME_989","길드원이 17명 이상인 길드만 길드전에 참여할 수 있습니다."),"# "+s("GAME_990","ELO 점수를 기반으로 비슷한 실력의 길드와 매칭됩니다."),"# "+s("GAME_991","자신의 성을 수비하면서, 상대 성을 함락시키는 방식으로 진행되면, 더 많은 점수를 얻은 길드가 승리합니다."),"# "+s("GAME_992","모든 보상은 우편으로 지급됩니다."),"# "+s("GAME_993","길드전을 30회 이상 진행한 이후, 길드랭킹에 따라 길드원들은 추가 환생 버프를 받습니다.")].join("\n")} + ,{ + title:s("GAME_994","방어팀/성 구조"),content:["# "+s("GAME_995","길드전 - 방어팀 메뉴에서 본인의 방어팀을 편성할 수 있습니다."),"# "+s("GAME_996","길드장/부길드장은 각 길드원이 방어할 성의 등급(S/A/B/C)을 미리 지정할 수 있으며, 지정되지 않은 길드원은 자동으로 배치됩니다."),"# "+s("GAME_997","한번 설정한 방어팀은 다음 길드전에도 계속 유지됩니다."),"# "+s("GAME_998","성은 총 17개로 구성됩니다.")+"\n - "+s("GAME_999","정 중앙 : S 등급 성 1개")+"\n - "+s("GAME_1000","내부 : A 등급 성 4개")+"\n - "+s("GAME_1001","중간 : B 등급 성 4개")+"\n - "+s("GAME_1002","외곽 : C 등급 성 8개")].join("\n")} + ,{ + title:s("GAME_1003","전투"),content:["# "+s("GAME_1004","각 길드원은 한 길드전 당 2개의 공격권을 가집니다."),"# "+s("GAME_1005","누적 점수에 따라, 공격가능한 성이 단계별로 해금됩니다.")+"\n ( "+s("GAME_1006","C → B → A → S 순서로 더 높은 누적 점수가 필요")+" )","# "+s("GAME_1007","상대를 공격하여, 승리하면 +3점을 획득하고, 패배하더라도 +1점을 받습니다. ( 전투 단계가 높아질수록 승리 점수가 증가합니다. )"),"# "+s("GAME_1008","등급이 높은 성일수록 수비군이 강화되고, 함락시 더 많은 점수를 얻습니다."),"# "+s("GAME_1009","성에 배치된 모든 수비대를 격파하면, 그 성을 함락시킬 수 있습니다."),"# "+(h?n("GAME_1990","수비에 성공한 수비자는 { + 0} + 분 동안 보호 상태가 됩니다.",t.protectMin):s("GAME_1010","수비에 성공한 슬롯은 일정 시간동안 보호 상태가 됩니다.")),"# "+s("GAME_1011","S 등급 성을 함락하면, 다음 단계로 진입하며, 단계가 올라갈수록 수비군이 강해지고, 함락 점수도 증가합니다."),"# "+s("GAME_1012","길드전은 최대 3 단계까지 올라갈 수 있습니다."),...h?["# "+s("GAME_1991","레벨 보정은 공격을 시작하는 순간 상태로 정해지고, 전투 중에는 바뀌지 않습니다.")]:[]].join("\n")} + ,...(null==h?void 0:h.regionStep)?[{ + title:s("GAME_1992","종족 영역"),content:["# "+s("GAME_1993","본성(S)을 뺀 16개 성은 네 구역으로 나뉩니다. 단계마다 구역마다 종족(인간·엘프·언데드·오크)이 하나씩 정해지며, 양쪽 길드가 같습니다."),"# "+n("GAME_1994","한 구역의 성을 하나 함락할 때마다, 상대 길드의 모든 성에서 그 구역 종족의 군단(영웅·병사) 레벨이 { + 0} + 씩 내려갑니다. 한 구역을 모두 함락하면 −{ + 1} + 입니다.",h.regionStep,4*h.regionStep),"# "+s("GAME_1995","비어 있어서 자동으로 함락된 성도 함락으로 칩니다."),"# "+s("GAME_1996","단계가 바뀌면 종족 배정이 새로 정해지고, 지도도 바뀝니다."),"# "+s("GAME_2102","보드 가장자리 배지는 그 구역 종족 · 함락한 성 수 · 지금 레벨 보정이에요. 누르면 자세히 볼 수 있어요.")].join("\n")} + ]:[],...(null==h?void 0:h.fatigueStep)?[{ + title:s("GAME_1997","피로"),content:["# "+n("GAME_1998","수비에 성공할 때마다 그 수비자의 군단(영웅·병사) 레벨이 { + 0} + 씩 내려갑니다.",h.fatigueStep),"# "+s("GAME_1999","피로는 단계마다 새로 시작합니다."),"# "+s("GAME_2000","여러 번 막아 낸 수비자일수록 약해지므로, 강한 수비자도 계속 공격하면 뚫을 수 있습니다.")].join("\n")} + ]:[],...(null==h?void 0:h.blessLevel)?[{ + title:s("GAME_2001","축복 카드"),content:["# "+s("GAME_2002","단계마다 종족 하나가 축복을 받습니다. 양쪽 길드가 같습니다."),"# "+n("GAME_2003","축복받은 종족 군단은 공격할 때도, 수비할 때도 군단(영웅·병사) 레벨이 { + 0} + 올라갑니다.",h.blessLevel),"# "+s("GAME_2004","단계마다 축복 종족에 맞춰 공격 군단과 수비 군단을 바꿔 두면 더 유리합니다."),"# "+s("GAME_2103","보드 오른쪽 위 축복 칩을 누르면 이번 단계 축복을 볼 수 있어요.")].join("\n")} + ]:[],{ + title:s("GAME_1013","보상/길드전 변동"),content:["# "+s("GAME_1014","공격 보상은 즉시 지급되며, 수비/전쟁 결과 보상은 길드전 종료 후 우편으로 전송됩니다."),"# "+s("GAME_1015","상대를 공격하여 승리하면, 보석 100개, 명예코인 40개를 받고, 패배해도 보석 50개, 명예코인 20개를 받습니다."),"# "+s("GAME_1016","수비를 성공하면, 보석 20개, 명예코인 10개를 받습니다. ( 한 길드전 당 최대 10번 )"),"# "+s("GAME_1017","길드가 승리하면, 모든 길드원은 길드코인 200개, 길드전 펫조각을 2개 받고, 패배하면, 길드코인 100개, 길드전 펫조각을 1개 받습니다. ( 점수가 같으면 양쪽 모두 패배 처리됩니다. )"),"# "+s("GAME_1018","길드전 진행중 탈퇴한 길드원은 방어 슬롯이 그대로 유지되며, 종료후 보상도 정상 지급됩니다."),"# "+s("GAME_1019","길드에 새로 가입한 유저의 경우, 진행중인 길드전에는 참여할 수 없으며, 길드 가입 이후에 시작한 길드전에 참여할 수 있습니다.")].join("\n")} + ,{ + title:s("GAME_1202","길드 랭킹 보상( 훈장버프 )"),customContainer:i} + ]; + this.pageNav.setPages(o)} + createMedalBuffList(){ + const t=new St(Cj,480,430,3); + return t.dataProvider=[{ + rank:Nr.getText("COMMON_373","순위"),buff:Nr.getText("CASTLE_SPECIAL_NAME_6","훈장버프"),isHeader:!0} + ,{ + rank:"1",buff:"+300%"} + ,{ + rank:"2",buff:"+280%"} + ,{ + rank:"3",buff:"+260%"} + ,{ + rank:"4 - 5",buff:"+240%"} + ,{ + rank:"6 - 7",buff:"+220%"} + ,{ + rank:"8 - 10",buff:"+200%"} + ,{ + rank:"11 - 12",buff:"+180%"} + ,{ + rank:"13 - 15",buff:"+160%"} + ,{ + rank:"16 - 20",buff:"+150%"} + ,{ + rank:"21 - 25",buff:"+140%"} + ,{ + rank:"26 - 30",buff:"+130%"} + ,{ + rank:"31 - 40",buff:"+120%"} + ,{ + rank:"41 - 50",buff:"+110%"} + ,{ + rank:"51 - 60",buff:"+100%"} + ,{ + rank:"61 - 70",buff:"+90%"} + ,{ + rank:"71 - 100",buff:"+80%"} + ,{ + rank:"101 이하",buff:"+70%"} + ],t} + async showGuide(){ + this.title=Nr.getText("GAME_1021","길드전 안내"),this.buildPages(),this.height=this.pageNav.y+this.pageNav.height+t.NAV_BOTTOM_PAD,await this.loadImage(),super.show()} + getDefaultPositionY(){ + return.47*J.stageHeight} + onBackButton(){ + return this.hide(),!0} + } + ; + e(Ij,"GuildWarGuidePopup"),n(Ij,"_instance"),n(Ij,"POPUP_WIDTH",620),n(Ij,"NAV_TOP_Y",80),n(Ij,"NAV_BOTTOM_PAD",30),n(Ij,"season3",null),n(Ij,"protectMin",20); + let Oj=Ij; + const vj=class t extends Ot{ + constructor(){ + super(),n(this,"bg"),n(this,"lblRank"),n(this,"lblBuff"),this.bg=new A({ + texture:nt.getTexture("UI_Ekkorr","Popup_List_00"),leftWidth:6,topHeight:6,rightWidth:6,bottomHeight:6} + ),this.bg.width=t.ROW_W,this.bg.height=t.ROW_H,this.addChild(this.bg),this.lblRank=new to("",en.DEFAULT_COLOR,en.DEFAULT_OUTLINE_FONT_OPTION_16),this.lblRank.align="center",this.addChild(this.lblRank),this.lblBuff=new to("",16763904,en.DEFAULT_OUTLINE_FONT_OPTION_17),this.addChild(this.lblBuff)} + setData(s){ + this.data=s; + const i=s.isHeader?16763904:en.DEFAULT_COLOR,h=s.isHeader?16763904:6737151; + this.lblRank.text=s.rank,this.lblRank.textColor=i,this.lblRank.x=t.RANK_COL_CENTER+t.RANK_X_OFFSET-.5*this.lblRank.width,this.lblRank.y=.5*(t.ROW_H-this.lblRank.height)-1,this.lblBuff.text=s.buff,this.lblBuff.textColor=h,this.lblBuff.x=t.ROW_W-this.lblBuff.width-62,this.lblBuff.y=.5*(t.ROW_H-this.lblBuff.height)-1} + get height(){ + return t.ROW_H} + } + ; + e(vj,"GuildWarMedalBuffItemRenderer"),n(vj,"ROW_W",480),n(vj,"ROW_H",34),n(vj,"RANK_COL_CENTER",70),n(vj,"RANK_X_OFFSET",-15); + let Cj=vj; + const Rj=class t extends SC{ + constructor(){
- super(),Zt(this,"pageNav"),this.outSideClickHide=!0,this.width=t.POPUP_WIDTH,this.pageNav=new YU(t.POPUP_WIDTH-40,16,hD.DEFAULT_COLOR,6),this.pageNav.setBgVisible(!1),this.pageNav.x=20,this.pageNav.y=t.NAV_TOP_Y,this.contentContainer.addChild(this.pageNav); - const i=Qt((t,i)=>NB.getText(t,i),"t"),s=this.createMedalBuffList(); - this.pageNav.setPages([{ - title:i("GAME_1020","개요"),content:["# "+i("GAME_988","길드전은 12시간마다 자동으로 매칭되며, 23시간동안 진행됩니다. ( 1시간은 보상/정산 및 다음 길드전 준비시간 )"),"# "+i("GAME_989","길드원이 17명 이상인 길드만 길드전에 참여할 수 있습니다."),"# "+i("GAME_990","ELO 점수를 기반으로 비슷한 실력의 길드와 매칭됩니다."),"# "+i("GAME_991","자신의 성을 수비하면서, 상대 성을 함락시키는 방식으로 진행되면, 더 많은 점수를 얻은 길드가 승리합니다."),"# "+i("GAME_992","모든 보상은 우편으로 지급됩니다."),"# "+i("GAME_993","길드전을 30회 이상 진행한 이후, 길드랭킹에 따라 길드원들은 추가 환생 버프를 받습니다.")].join("\n")} - ,{ - title:i("GAME_994","방어팀/성 구조"),content:["# "+i("GAME_995","길드전 - 방어팀 메뉴에서 본인의 방어팀을 편성할 수 있습니다."),"# "+i("GAME_996","길드장/부길드장은 각 길드원이 방어할 성의 등급(S/A/B/C)을 미리 지정할 수 있으며, 지정되지 않은 길드원은 자동으로 배치됩니다."),"# "+i("GAME_997","한번 설정한 방어팀은 다음 길드전에도 계속 유지됩니다."),"# "+i("GAME_998","성은 총 17개로 구성됩니다.")+"\n - "+i("GAME_999","정 중앙 : S 등급 성 1개")+"\n - "+i("GAME_1000","내부 : A 등급 성 4개")+"\n - "+i("GAME_1001","중간 : B 등급 성 4개")+"\n - "+i("GAME_1002","외곽 : C 등급 성 8개")].join("\n")} - ,{ - title:i("GAME_1003","전투"),content:["# "+i("GAME_1004","각 길드원은 한 길드전 당 2개의 공격권을 가집니다."),"# "+i("GAME_1005","누적 점수에 따라, 공격가능한 성이 단계별로 해금됩니다.")+"\n ( "+i("GAME_1006","C → B → A → S 순서로 더 높은 누적 점수가 필요")+" )","# "+i("GAME_1007","상대를 공격하여, 승리하면 +3점을 획득하고, 패배하더라도 +1점을 받습니다. ( 전투 단계가 높아질수록 승리 점수가 증가합니다. )"),"# "+i("GAME_1008","등급이 높은 성일수록 수비군이 강화되고, 함락시 더 많은 점수를 얻습니다."),"# "+i("GAME_1009","성에 배치된 모든 수비대를 격파하면, 그 성을 함락시킬 수 있습니다."),"# "+i("GAME_1010","수비에 성공한 슬롯은 일정 시간동안 보호 상태가 됩니다."),"# "+i("GAME_1011","S 등급 성을 함락하면, 다음 단계로 진입하며, 단계가 올라갈수록 수비군이 강해지고, 함락 점수도 증가합니다."),"# "+i("GAME_1012","길드전은 최대 3 단계까지 올라갈 수 있습니다.")].join("\n")} - ,{ - title:i("GAME_1013","보상/길드전 변동"),content:["# "+i("GAME_1014","공격 보상은 즉시 지급되며, 수비/전쟁 결과 보상은 길드전 종료 후 우편으로 전송됩니다."),"# "+i("GAME_1015","상대를 공격하여 승리하면, 보석 100개, 명예코인 40개를 받고, 패배해도 보석 50개, 명예코인 20개를 받습니다."),"# "+i("GAME_1016","수비를 성공하면, 보석 20개, 명예코인 10개를 받습니다. ( 한 길드전 당 최대 10번 )"),"# "+i("GAME_1017","길드가 승리하면, 모든 길드원은 길드코인 200개, 길드전 펫조각을 2개 받고, 패배하면, 길드코인 100개, 길드전 펫조각을 1개 받습니다. ( 점수가 같으면 양쪽 모두 패배 처리됩니다. )"),"# "+i("GAME_1018","길드전 진행중 탈퇴한 길드원은 방어 슬롯이 그대로 유지되며, 종료후 보상도 정상 지급됩니다."),"# "+i("GAME_1019","길드에 새로 가입한 유저의 경우, 진행중인 길드전에는 참여할 수 없으며, 길드 가입 이후에 시작한 길드전에 참여할 수 있습니다.")].join("\n")} - ,{ - title:i("GAME_1202","길드 랭킹 보상( 훈장버프 )"),customContainer:s} - ])} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - createMedalBuffList(){ - const t=new Ox(kri,480,430,3); - return t.dataProvider=[{ - rank:NB.getText("COMMON_373","순위"),buff:NB.getText("CASTLE_SPECIAL_NAME_6","훈장버프"),isHeader:!0} - ,{ - rank:"1",buff:"+300%"} - ,{ - rank:"2",buff:"+280%"} - ,{ - rank:"3",buff:"+260%"} - ,{ - rank:"4 - 5",buff:"+240%"} - ,{ - rank:"6 - 7",buff:"+220%"} - ,{ - rank:"8 - 10",buff:"+200%"} - ,{ - rank:"11 - 12",buff:"+180%"} - ,{ - rank:"13 - 15",buff:"+160%"} - ,{ - rank:"16 - 20",buff:"+150%"} - ,{ - rank:"21 - 25",buff:"+140%"} - ,{ - rank:"26 - 30",buff:"+130%"} - ,{ - rank:"31 - 40",buff:"+120%"} - ,{ - rank:"41 - 50",buff:"+110%"} - ,{ - rank:"51 - 60",buff:"+100%"} - ,{ - rank:"61 - 70",buff:"+90%"} - ,{ - rank:"71 - 100",buff:"+80%"} - ,{ - rank:"101 이하",buff:"+70%"} - ],t} - async showGuide(){ - this.title=NB.getText("GAME_1021","길드전 안내"),this.height=this.pageNav.y+this.pageNav.height+t.NAV_BOTTOM_PAD,await this.loadImage(),super.show()} - getDefaultPositionY(){ - return.47*SS.stageHeight} - onBackButton(){ - return this.hide(),!0} - } - ; - Qt(Cri,"GuildWarGuidePopup"),Zt(Cri,"_instance"),Zt(Cri,"POPUP_WIDTH",620),Zt(Cri,"NAV_TOP_Y",80),Zt(Cri,"NAV_BOTTOM_PAD",30); - let Ori=Cri; - const Iri=class t extends kx{ - constructor(){ - super(),Zt(this,"bg"),Zt(this,"lblRank"),Zt(this,"lblBuff"),this.bg=new hE({ - texture:RS.getTexture("UI_Ekkorr","Popup_List_00"),leftWidth:6,topHeight:6,rightWidth:6,bottomHeight:6} - ),this.bg.width=t.ROW_W,this.bg.height=t.ROW_H,this.addChild(this.bg),this.lblRank=new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_OUTLINE_FONT_OPTION_16),this.lblRank.align="center",this.addChild(this.lblRank),this.lblBuff=new iG("",16763904,hD.DEFAULT_OUTLINE_FONT_OPTION_17),this.addChild(this.lblBuff)} - setData(i){ - this.data=i; - const s=i.isHeader?16763904:hD.DEFAULT_COLOR,e=i.isHeader?16763904:6737151; - this.lblRank.text=i.rank,this.lblRank.textColor=s,this.lblRank.x=t.RANK_COL_CENTER+t.RANK_X_OFFSET-.5*this.lblRank.width,this.lblRank.y=.5*(t.ROW_H-this.lblRank.height)-1,this.lblBuff.text=i.buff,this.lblBuff.textColor=e,this.lblBuff.x=t.ROW_W-this.lblBuff.width-62,this.lblBuff.y=.5*(t.ROW_H-this.lblBuff.height)-1} - get height(){ - return t.ROW_H} - } - ; - Qt(Iri,"GuildWarMedalBuffItemRenderer"),Zt(Iri,"ROW_W",480),Zt(Iri,"ROW_H",34),Zt(Iri,"RANK_COL_CENTER",70),Zt(Iri,"RANK_X_OFFSET",-15); - let kri=Iri; - const xri=class t extends XU{ - constructor(){
FireOrb1 11 hunks, 114 statements
+ const dE={ + texW:93,texH:33,headX:93*.774194,anchorY:.545455,headBack:16} + ,_E=18; + function fE(t,s,i,h){ + const e=Math.min(s,39); + return t.copyWithin(2,0,2*e),t[0]=i,t[1]=h,e+1} + function pE(t,s,i,h,e){ + let n=0; + for(let d=0; + d<s-1; + d++){ + const s=t[2*d],h=t[2*d+1],o=t[2*d+2],r=t[2*d+3],a=Math.hypot(o-s,r-h); + if(a>0&&n+a>=i){ + const t=(i-n)/a; + return e.x=s+(o-s)*t,void(e.y=h+(r-h)*t)} + n+=a} + const o=Math.max(0,s-1),r=t[2*o],a=t[2*o+1]; + let l=-Math.cos(h),c=-Math.sin(h); + if(s>=2){ + const s=t[2*o-2],i=t[2*o-1],h=Math.hypot(r-s,a-i); + h>.01&&(l=(r-s)/h,c=(a-i)/h)} + const u=i-n; + e.x=r+l*u,e.y=a+c*u} + function ME(t,s){ + if(s<2)return 1; + const i=Math.hypot(t[0]-t[2],t[1]-t[3]); + return Math.max(.65,Math.min(1,i/11))} + function gE(t){ + const s=t/_E; + return s>=.34?1:.3+s/.34*.7} + function EE(t=dE){ + const s=new Float32Array(84),i=t.headX-t.headBack; + for(let h=0; + h<21; + h++){ + let e; + e=h<=_E?i*h/_E:19===h?t.headX:t.texW,s[4*h]=e/t.texW,s[4*h+1]=0,s[4*h+2]=e/t.texW,s[4*h+3]=1} + return s} + function wE(){ + const t=new Uint32Array(120); + for(let s=0; + s<20; + s++){ + const i=2*s; + t.set([i,i+1,i+2,i+1,i+3,i+2],6*s)} + return t} + e(fE,"pushTrail"),e(pE,"trailPointAt"),e(ME,"trailSpeedK"),e(gE,"taperAt"),e(EE,"cometUvs"),e(wE,"cometIndices"); + const mE={ + x:0,y:0} + ,AE=new Float32Array(21),TE=new Float32Array(21); + function bE(t,s,i,h,e,n,o,r=dE){ + const a=t[0],l=t[1],c=r.headX-r.headBack,u=ME(t,s); + for(let M=0; + M<=_E; + M++){ + const n=c*M/_E; + pE(t,s,(r.headBack+(c-n)*e*u)*h,i,mE),AE[M]=mE.x,TE[M]=mE.y} + let d=a-AE[18],_=l-TE[18]; + const f=Math.hypot(d,_); + f>.01?(d/=f,_/=f):(d=Math.cos(i),_=Math.sin(i)),AE[19]=a,TE[19]=l,AE[20]=a+d*(r.texW-r.headX)*h,TE[20]=l+_*(r.texW-r.headX)*h; + const p=r.texH*h*n; + for(let M=0; + M<21; + M++){ + let t,s; + if(M>_E)t=d,s=_; + else{ + const i=Math.max(0,M-1),h=Math.min(_E,M+1); + t=AE[h]-AE[i],s=TE[h]-TE[i]; + const e=Math.hypot(t,s); + e>1e-4?(t/=e,s/=e):(t=d,s=_)} + const i=M<=_E?gE(M):1,h=-s,e=t,n=r.anchorY*p*i,c=(1-r.anchorY)*p*i,u=AE[M]-a,f=TE[M]-l; + o[4*M]=u-h*n,o[4*M+1]=f-e*n,o[4*M+2]=u+h*c,o[4*M+3]=f+e*c} + } + e(bE,"buildComet"); + const SE=e(t=>t<0?0:t>1?1:t,"clamp01"); + function IE(t,s){ + return 3+(s-3)*SE(t/100)} + function OE(t){ + return.3*t} + function vE(t){ + return SE((t-6)/34)} + function CE(t){ + return.45+.55*SE(t/50)} + e(IE,"dockSpeed"),e(OE,"dockTurn"),e(vE,"dockAlpha"),e(CE,"dockScale");
- super(...arguments),Zt(this,"mode",0),Zt(this,"orbTarget",null),Zt(this,"orbSpeed",8),Zt(this,"orbDamage",1),Zt(this,"canSplit",!1),Zt(this,"heading",0),Zt(this,"arcSign",1),Zt(this,"arcT",0),Zt(this,"arcAmount",t.ARC),Zt(this,"isChild",!1),Zt(this,"homeDist",t.CATCH_DIST),Zt(this,"spreadT",0),Zt(this,"spreadAngle",0),Zt(this,"fuse",0),Zt(this,"blastRadius",0),Zt(this,"blastDamage",0),Zt(this,"burnTick",0),Zt(this,"burnDur",0),Zt(this,"burnInterval",0),Zt(this,"burnId",0),Zt(this,"burnPoint",new Ai(0,0)),Zt(this,"pathDamage",0),Zt(this,"scArm",0),Zt(this,"turnRadius",t.R_TURN_PARENT),Zt(this,"hitDist",t.HIT_DIST),Zt(this,"prevDist",1/0),Zt(this,"noHitT",0),Zt(this,"wanderT",0),Zt(this,"wanderSign",1),Zt(this,"pathHitSet",new Set)} + super(...arguments),n(this,"mode",0),n(this,"orbTarget",null),n(this,"orbSpeed",8),n(this,"orbDamage",1),n(this,"canSplit",!1),n(this,"heading",0),n(this,"arcSign",1),n(this,"arcT",0),n(this,"arcAmount",t.ARC),n(this,"isChild",!1),n(this,"homeDist",t.CATCH_DIST),n(this,"spreadT",0),n(this,"spreadAngle",0),n(this,"fuse",0),n(this,"blastRadius",0),n(this,"blastDamage",0),n(this,"burnTick",0),n(this,"burnDur",0),n(this,"burnInterval",0),n(this,"burnId",0),n(this,"burnPoint",new M(0,0)),n(this,"pathDamage",0),n(this,"scArm",0),n(this,"turnRadius",t.R_TURN_PARENT),n(this,"hitDist",t.HIT_DIST),n(this,"prevDist",1/0),n(this,"noHitT",0),n(this,"wanderT",0),n(this,"wanderSign",1),n(this,"pathHitSet",new Set),n(this,"comet",null),n(this,"trail",new Float32Array(80)),n(this,"trailCount",0),n(this,"cometScale",.62),n(this,"cometAge",0),n(this,"cometPhase",0),n(this,"cometLive",!1),n(this,"lookAlpha",1),n(this,"lookScale",1)}
- this.heading=a?l:Math.atan2(g-s,w-i),this.sp&&(this.sp.visible=!0,this.sp.alpha=1),this.faceHeading()} + this.heading=a?c:Math.atan2(M-i,p-s),this.startComet(),this.faceHeading()}
- this.setArea(0,t.LIFE),this.x=i,this.y=s,this.mode=2,this.pathDamage=0,this.pathHitSet.clear(),this.orbTarget=null,this.orbSpeed=n,this.orbDamage=r,this.canSplit=!1,this.isChild=!1,this.spreadT=0,this.arcT=t.ARC_FADE,this.heading=e,this.fuse=h,this.scArm=f,this.blastRadius=o,this.blastDamage=r,this.burnTick=a,this.burnDur=c,this.burnInterval=l,this.burnId=u,this.applyScale(d),this.sp&&(this.sp.visible=!0,this.sp.alpha=1),this.faceHeading()} + this.setArea(0,t.LIFE),this.x=s,this.y=i,this.mode=2,this.pathDamage=0,this.pathHitSet.clear(),this.orbTarget=null,this.orbSpeed=e,this.orbDamage=o,this.canSplit=!1,this.isChild=!1,this.spreadT=0,this.arcT=t.ARC_FADE,this.heading=h,this.fuse=n,this.scArm=_,this.blastRadius=r,this.blastDamage=o,this.burnTick=a,this.burnDur=l,this.burnInterval=c,this.burnId=u,this.applyScale(d),this.startComet(),this.faceHeading()}
- this.sp&&this.sp.scale.set(t)} + this.cometScale=t,this.sp&&this.sp.scale.set(t)} + startComet(){ + if(this.sp&&(this.sp.visible=t.classicLook,this.sp.alpha=1),!this.comet){ + const t=nt.getTextures("Game2","FireBall")[4]; + this.comet=new I({ + texture:t,vertices:new Float32Array(84),uvs:EE(),indices:wE()} + ),this.addChild(this.comet)} + this.comet.visible=!0,this.comet.alpha=1,this.lookAlpha=1,this.lookScale=1,this.trailCount=0,this.cometAge=0,this.cometPhase=(.13*this.x+.07*this.y)%6.283,this.cometLive||(this.cometLive=!0,t.activeComets++)} + remove(){ + this.cometLive&&(this.cometLive=!1,t.activeComets=Math.max(0,t.activeComets-1)),super.remove()}
- Math.cos(this.heading)<0?(this.rotation=this.heading+Math.PI,this.scale.x=-Math.abs(this.scale.x)):(this.rotation=this.heading,this.scale.x=Math.abs(this.scale.x))} + if(this.rotation=0,this.scale.x=Math.abs(this.scale.x),this.trailCount=fE(this.trail,this.trailCount,this.x,this.y),!this.comet)return; + this.cometAge++; + const s=t.activeComets>t.CROWD_LIMIT?1:t.TAIL_MUL,i=1+.04*Math.sin(.9*this.cometAge+this.cometPhase); + bE(this.trail,this.trailCount,this.heading,this.cometScale*this.lookScale,s,i,this.comet.vertices),this.comet.alpha=this.lookAlpha}
- r=this.owner.x,o=this.owner.y} + o=this.owner.x+this.owner.firePoint.x*this.owner.direction,r=this.owner.y+this.owner.firePoint.y}
+ if(1===this.mode&&c<=100)return void this.dockStep(o,r);
+ dockStep(s,i){ + var h,e; + const n=Math.atan2(i-this.y,s-this.x); + this.heading+=OE(Math.atan2(Math.sin(n-this.heading),Math.cos(n-this.heading))); + const o=IE(Math.hypot(s-this.x,i-this.y),this.orbSpeed*t.BACK_SPEED_MULT); + this.x+=Math.cos(this.heading)*o,this.y+=Math.sin(this.heading)*o; + const r=Math.hypot(s-this.x,i-this.y); + this.lookAlpha=vE(r),this.lookScale=CE(r),this.faceHeading(),r>6||(null==(e=null==(h=this.owner)?void 0:h.onOrbReturned)||e.call(h,this.x,this.y),this.remove())}
- e.x=this.x,e.y=this.y,AU.getInstance().addChild(e),e.start(30),e.scale.set(e.orgScale*(this.isChild?.3:.42)),this.canSplit&&(null==(i=null==(t=this.owner)?void 0:t.spawnOrbSplit)?void 0:i.call(t,this.x,this.y,s,this.heading))?this.remove():this.toBack()} + h.x=this.x,h.y=this.y,Aa.getInstance().addChild(h),h.start(30),h.scale.set(h.orgScale*(this.isChild?.21:.3)),this.canSplit&&(null==(s=null==(t=this.owner)?void 0:t.spawnOrbSplit)?void 0:s.call(t,this.x,this.y,i,this.heading))?this.remove():this.toBack()}
- Qt(o0,"FireOrb1"),Zt(o0,"HIT_DIST",22),Zt(o0,"CATCH_DIST",26),Zt(o0,"R_TURN_PARENT",73),Zt(o0,"R_TURN_CHILD",37),Zt(o0,"HIT_DIST_CHILD",40),Zt(o0,"CHILD_ARM",5),Zt(o0,"R_BACK_FAR",95),Zt(o0,"R_BACK_NEAR",26),Zt(o0,"R_BACK_RATIO",.55),Zt(o0,"BACK_SPEED_MULT",.72),Zt(o0,"WANDER_AFTER_HIT",16),Zt(o0,"WANDER_NO_TARGET",30),Zt(o0,"WANDER_CURL",.042),Zt(o0,"HIT_PASS_RATIO",2.2),Zt(o0,"ARC",.17),Zt(o0,"ARC_WIDE",.65),Zt(o0,"ARC_FADE",11),Zt(o0,"LIFE",300),Zt(o0,"PATH_R_MAIN",26),Zt(o0,"PATH_R_CHILD",20),Zt(o0,"PATH_MAX",4),Zt(o0,"PATH_STEP_RATIO",.6),Zt(o0,"PATH_TICK_MAX",10),Zt(o0,"SC_HIT_R",30),Zt(o0,"BLAST_MAX_TARGETS",3),Zt(o0,"BLAST_FX_SCALE",.62),Zt(o0,"SPREAD_FRAMES",7),Zt(o0,"SPREAD_SPEED",19),Zt(o0,"SPREAD_DIST_RATIO",.4),Zt(o0,"SPREAD_MIN",2),Zt(o0,"ACCEL_FRAMES",8); + e(RE,"FireOrb1"),n(RE,"HIT_DIST",22),n(RE,"CATCH_DIST",26),n(RE,"R_TURN_PARENT",73),n(RE,"R_TURN_CHILD",37),n(RE,"HIT_DIST_CHILD",40),n(RE,"CHILD_ARM",5),n(RE,"R_BACK_FAR",95),n(RE,"R_BACK_NEAR",26),n(RE,"R_BACK_RATIO",.55),n(RE,"BACK_SPEED_MULT",.72),n(RE,"WANDER_AFTER_HIT",16),n(RE,"WANDER_NO_TARGET",30),n(RE,"WANDER_CURL",.042),n(RE,"HIT_PASS_RATIO",2.2),n(RE,"ARC",.17),n(RE,"ARC_WIDE",.65),n(RE,"ARC_FADE",11),n(RE,"LIFE",300),n(RE,"PATH_R_MAIN",26),n(RE,"PATH_R_CHILD",20),n(RE,"PATH_MAX",4),n(RE,"PATH_STEP_RATIO",.6),n(RE,"PATH_TICK_MAX",10),n(RE,"SC_HIT_R",30),n(RE,"BLAST_MAX_TARGETS",3),n(RE,"BLAST_FX_SCALE",.4),n(RE,"SPREAD_FRAMES",7),n(RE,"SPREAD_SPEED",19),n(RE,"SPREAD_DIST_RATIO",.4),n(RE,"SPREAD_MIN",2),n(RE,"ACCEL_FRAMES",8),n(RE,"TAIL_MUL",2),n(RE,"CROWD_LIMIT",60),n(RE,"activeComets",0),n(RE,"classicLook",!1),n(RE,"classicReturn",!1);
TribeBanner 4 hunks, 105 statements
- super(),Zt(this,"lblMessage"),Zt(this,"btnMessageGuide"),Zt(this,"lblTribeBuff"),Zt(this,"topContainer"),Zt(this,"decorationTop"),Zt(this,"decorationBottom"),Zt(this,"decorationLine"),Zt(this,"rows",[]),Zt(this,"helpBg"),Zt(this,"lblHelp"),Zt(this,"image"),this.title=NB.getText("GAME_258","프로필"),this.width=580,this.outSideClickHide=!0,this.decorationTop=new Xe(RS.getTexture("UI_Ekkorr","Shadow_Upward")),this.decorationTop.alpha=.7,this.contentContainer.addChild(this.decorationTop),this.decorationBottom=new Xe(RS.getTexture("UI_Ekkorr","Shadow_Upward")),this.decorationBottom.alpha=.7,this.decorationBottom.scale.y=-1,this.contentContainer.addChild(this.decorationBottom),this.decorationLine=new Xe(RS.getTexture("UI_Ekkorr","Patter_Diamond_01")),this.contentContainer.addChild(this.decorationLine),this.topContainer=new Ke,this.contentContainer.addChild(this.topContainer),this.lblMessage=new iG("",16763904,hD.DEFAULT_FONT_OPTION_18),this.topContainer.addChild(this.lblMessage),this.btnMessageGuide=new HU("UI_Ekkorr","UI_Alarm"),this.topContainer.addChild(this.btnMessageGuide),this.btnMessageGuide.onClick=()=>{ - this.showHelp("raceChange")} - ,this.lblTribeBuff=new iG("",16763904,hD.DEFAULT_FONT_OPTION_17),this.lblTribeBuff.align="center",hD.setLabelWrapWidth(this.lblTribeBuff,520),this.topContainer.addChild(this.lblTribeBuff),this.helpBg=new hE({ - texture:RS.getTexture("UI_Ekkorr","Popup_Bg_05"),leftWidth:12,topHeight:12,rightWidth:12,bottomHeight:12} - ),this.helpBg.width=525,this.helpBg.visible=!1,this.contentContainer.addChild(this.helpBg),this.lblHelp=new iG("",8978312,hD.DEFAULT_FONT_OPTION_17),hD.setLabelWrapWidth(this.lblHelp,this.helpBg.width-80),this.lblHelp.visible=!1,this.contentContainer.addChild(this.lblHelp)} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - async showProfile(){ - if(this.title=NB.getText("GAME_258","프로필"),this.clearRows(),this.buildRows(),this.updateLayout(),!this.image){ - this.image=new Xe,this.image.eventMode="none",this.addChildAt(this.image,0); - const{ - AssetPathManager:t} - =await ei(async()=>{ - const{ - AssetPathManager:t} - =await Promise.resolve().then(()=>kS); - return{ - AssetPathManager:t} + super(),n(this,"bg",new p),n(this,"icon",new u),n(this,"line1",new l),n(this,"pre",new to("",16763904,en.DEFAULT_OUTLINE_FONT_OPTION_20)),n(this,"tribeLbl",new to("",16777215,en.DEFAULT_OUTLINE_FONT_OPTION_20)),n(this,"post",new to("",16763904,en.DEFAULT_OUTLINE_FONT_OPTION_20)),n(this,"line2",new to("",16763904,en.DEFAULT_FONT_OPTION_17)),n(this,"caret",N1()),n(this,"desc",new D1(501)),n(this,"tribe",1),this.pre.textColor=this.post.textColor=this.line2.textColor=16763904,this.bg.eventMode=this.icon.eventMode=this.line1.eventMode=this.line2.eventMode="none",this.icon.anchor.set(.5),this.line1.addChild(this.pre,this.tribeLbl,this.post),this.desc.visible=!1,this.addChild(this.bg,this.icon,this.line1,this.line2,this.caret,this.desc),this.eventMode="static",this.cursor="pointer"} + static loadHiRes(){ + return t.hiResLoading||(t.hiResLoading=(async()=>{ + try{ + const s=await r.load(it.getAssetPath("TribeIcon2x.webp")),i=t.HI; + t.hiRes=[0,1,2,3].map(t=>new _({ + source:s.source,frame:new T(t*i,0,i,i)} + ))} + catch(s){
- ,void 0),s=t.getAssetPath("CharProfile.png"),e=await i.load(s); - this.image.texture=e,this.image.x=20,this.image.y=5-this.image.height} - super.show()} - clearRows(){ - for(const t of this.rows)t.bg.removeFromParent(),t.label.removeFromParent(),t.value.removeFromParent(),t.helpBtn&&t.helpBtn.removeFromParent(),t.rowHit&&t.rowHit.removeFromParent(); - this.rows=[],this.lblHelp.visible=!1,this.helpBg.visible=!1} - buildRows(){ - const i=NB.getText(`TRIBE_${ - TG.tribe} - `,t.TRIBE_NAMES[TG.tribe]); - this.lblMessage.text=NB.getValueReplace("GAME_259","##",i,`${ - i} - 종족으로 환생했습니다.`); - const s=TG.getKnightLevel(TG.tribe); - this.lblTribeBuff.text=NB.getValueReplaceMulti("GAME_344",["##","@@"],[i,s],`모든 ${ + )()),t.hiResLoading} + setData(s,i,h){ + var e; + this.tribe=s; + const n=null==(e=t.hiRes)?void 0:e[s-1]; + this.icon.texture=n??nt.getTexture("UI_Ekkorr",`TRIBE_${ + s-1} + _Icon`),this.icon.scale.set(n?t.ICON/t.HI:1); + const o=Nr.getText("GAME_259","## 종족으로 환생했습니다."),r=o.indexOf("##"); + this.pre.text=r<0?o:o.slice(0,r),this.tribeLbl.text=r<0?"":i,this.post.text=r<0?"":o.slice(r+2),this.tribeLbl.textColor=I1[s][1],this.line2.text=Nr.getValueReplaceMulti("GAME_344",["##","@@"],[i,h],`모든 ${
- )만큼 증가합니다.`); - const e=Math.floor(TG.maxWave/100); - this.addRow(NB.getText("GAME_260","기사단 레벨"),`${ - e} - `,"knightLevel"),this.addRow(NB.getText("GAME_261","최대 웨이브"),`${ - TG.maxWave} - `),this.addRow(NB.getText("GAME_262","환생수"),`${ - TG.numRevive30} - `,"revive"),this.addRow(NB.getText("GAME_263","누적훈장수"),`${ - qD.displayLargeNumberAsAlphabet(TG.accuMedal)} - `); - const n=3*e; - this.addRow(NB.getText("GAME_264","기사단 훈장 버프"),`${ - n} - %`,"medalBuff"); - const h=Math.min(250,50*TG.numRevive30); - this.addRow(NB.getText("GAME_265","퀘스트 골드 버프"),`${ - h} - %`,"questGold"); - const r=Math.min(100,20*TG.numRevive30); - this.addRow(NB.getText("GAME_266","퀘스트 시간 단축"),`${ - r} - %`,"questTime"); - const o=Math.min(100,20*TG.numRevive30); - this.addRow(NB.getText("GAME_267","퀘스트 오픈 비용 감소"),`${ - o} - %`,"questCost")} - addRow(t,i,s){ - const e=new iG(`${ - t} - :`,hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_17),n=new iG(` ${ - i} - `,16777215,hD.DEFAULT_FONT_OPTION_17),h=new hE({ - texture:RS.getTexture("UI_Ekkorr","Popup_Bg_04"),leftWidth:12,topHeight:12,rightWidth:12,bottomHeight:12} - ); - let r,o; - h.width=525,h.height=40,this.contentContainer.addChild(h),s&&(r=new Ke,r.eventMode="static",r.cursor="pointer",r.on("pointertap",()=>this.showHelp(s)),this.contentContainer.addChild(r)),s&&(e.eventMode="none",n.eventMode="none"),this.contentContainer.addChild(e),this.contentContainer.addChild(n),s&&(o=this.createHelpButton(s),this.contentContainer.addChild(o)),this.rows.push({ - bg:h,label:e,value:n,helpKey:s,helpBtn:o,rowHit:r} - )} - createHelpButton(t){ - const i=new Ke; - i.eventMode="none"; - const s=new Xe(RS.getTexture("UI_Ekkorr","UI_Alarm")); - return s.anchor.set(.5),s.scale.set(.8),i.addChild(s),i} - showHelp(t){ - let i=""; - switch(t){ - case"knightLevel":i=NB.getText("GAME_268",gdi[t]); - break; - case"revive":i=NB.getText("GAME_269",gdi[t]); - break; - case"medalBuff":i=NB.getText("GAME_270",gdi[t]); - break; - case"questGold":i=NB.getText("GAME_271",gdi[t]); - break; - case"questTime":i=NB.getText("GAME_272",gdi[t]); - break; - case"questCost":i=NB.getText("GAME_273",gdi[t]); - break; - case"raceChange":i=NB.getText("GAME_1259",gdi[t])} - this.lblHelp.text=i,this.lblHelp.visible=!0,this.lblHelp.y,this.helpBg.height=this.lblHelp.height+40,this.helpBg.visible=!0} - updateLayout(){ - this.lblMessage.x=.5*(this.topContainer.width-this.lblMessage.width),this.btnMessageGuide.x=this.lblMessage.x+this.lblMessage.width+3,this.lblTribeBuff.x=.5*(this.topContainer.width-this.lblTribeBuff.width),this.lblTribeBuff.y=this.lblMessage.y+this.lblMessage.height+3,this.topContainer.x=.5*(this.width-this.topContainer.width),this.topContainer.y=110-.5*this.topContainer.height; - let t=this.topContainer.y+this.topContainer.height+20; - this.decorationTop.x=.5*(this.width-this.decorationTop.width),this.decorationTop.y=t-this.decorationTop.height-2; - for(const s of this.rows)s.rowHit&&(s.rowHit.x=18,s.rowHit.y=t-3,s.rowHit.hitArea=new $i(0,0,this.width-56+20,45)),s.bg.x=28,s.bg.y=t,s.label.x=43,s.label.y=t+.5*(s.bg.height-s.label.height),s.value.x=s.label.x+s.label.width+4,s.value.y=s.label.y,s.helpBtn&&(s.helpBtn.x=s.value.x+s.value.width+16,s.helpBtn.y=s.value.y+s.value.height/2+2),t+=45; - this.decorationBottom.x=this.decorationTop.x,this.decorationBottom.y=t-3+this.decorationBottom.height,this.decorationLine.x=.5*(this.width-this.decorationLine.width),this.decorationLine.y=t+25; - const i=this.decorationLine.y+this.decorationLine.height+25; - this.helpBg.x=28,this.helpBg.y=i,this.lblHelp.x=this.helpBg.x+20,this.lblHelp.y=this.helpBg.y+20,this.helpBg.height=this.lblHelp.height+40,this.height=this.helpBg.y+this.helpBg.height+60} + )만큼 증가합니다.`)} + gradient(){ + let s=t.gradients.get(this.tribe); + return s||(s=new R({ + type:"linear",start:{ + x:0,y:0} + ,end:{ + x:1,y:0} + ,textureSpace:"local",colorStops:[{ + offset:0,color:y1(C1,I1[this.tribe][0],.42)} + ,{ + offset:.72,color:C1} + ,{ + offset:1,color:C1} + ]} + ),t.gradients.set(this.tribe,s)),s} + layout(t){ + this.tribeLbl.x=this.pre.text?this.pre.width-4:0,this.post.x=this.tribeLbl.x+(this.tribeLbl.text?this.tribeLbl.width-4:0); + const s=this.post.x+this.post.width; + this.line1.scale.set(s>403?Math.max(.6,403/s):1),k1(this.line2,403,25); + const i=this.line1.height,h=i+6+this.line2.height,e=Math.max(108,Math.ceil(h)+28); + this.line1.position.set(86,(e-h)/2),this.line2.position.set(86,this.line1.y+i+6),this.icon.position.set(43,Math.round(e/2)),this.caret.position.set(504,e/2),this.caret.scale.y=t?-1:1; + let n=e; + return this.desc.visible=t,t&&(this.desc.position.set(12,e-6),n=this.desc.y+this.desc.draw(S1("raceChange"))+12),this.bg.clear().roundRect(0,0,v1,n,14).fill(y1(C1,I1[this.tribe][0],.6)).roundRect(2,2,521,n-4,12).fill(this.gradient()),this.hitArea=new T(0,0,v1,n),n}
- Qt(mdi,"ProfilePopup"),Zt(mdi,"_instance"),Zt(mdi,"TRIBE_NAMES",{ - 1:"인간",2:"엘프",3:"언데드",4:"오크"} - ); + e(B1,"TribeBanner"),n(B1,"gradients",new Map),n(B1,"hiRes",null),n(B1,"hiResLoading",null),n(B1,"HI",132),n(B1,"ICON",72);
ProfilePopup 2 hunks, 105 statements
- ,void 0),{ - Assets:i} - =await ei(async()=>{ - const{ - Assets:t} - =await Promise.resolve().then(()=>cE); - return{ - Assets:t}
+ const H1=class t extends ur{ + constructor(){ + super(),n(this,"meRow",new l),n(this,"meBg",new p),n(this,"meBadge",new Oc(66)),n(this,"lblMeName",new to("",16777215,en.DEFAULT_OUTLINE_FONT_OPTION_20)),n(this,"lblMeSub",new to("",16763904,en.DEFAULT_FONT_OPTION_17)),n(this,"btnDeco",new AI("",130,24)),n(this,"banner",new U1),n(this,"rowKnight"),n(this,"rowWave"),n(this,"rowRevive"),n(this,"rowMedal"),n(this,"rowMedalBuff"),n(this,"rowQuestGold"),n(this,"rowQuestTime"),n(this,"rowQuestCost"),n(this,"lblEffect",new to("",11113847,en.DEFAULT_FONT_OPTION_15)),n(this,"openKey",null),n(this,"image"),this.title=Nr.getText("GAME_258","프로필"),this.width=580,this.outSideClickHide=!0,this.meBg.eventMode="none",this.meBadge.position.set(6,3),this.lblMeName.position.set(84,12),this.lblMeSub.position.set(85,42),this.lblMeName.eventMode=this.lblMeSub.eventMode="none",this.meRow.addChild(this.meBg,this.meBadge,this.lblMeName,this.lblMeSub,this.btnDeco),this.btnDeco.onClick=()=>{ + this.openDeco()} + ,this.contentContainer.addChild(this.meRow),gc.onChange(()=>{ + this.parent&&this.refreshMe()} + ); + const t=new l; + t.eventMode="none"; + const s=new m({ + text:"Lv",style:{ + fontFamily:"Arial",fontSize:10,fontWeight:"bold",fill:16763904,stroke:{ + color:1182726,width:3} + } + } + ); + s.anchor.set(.5),t.addChild(G1("Icon_RankBadge_11",34,34),s); + const i=16777215,h=16763904; + this.rowKnight=new x1(t,"knightLevel",i),this.rowWave=new x1(G1("Icon_Startwave_02",30,30),null,i),this.rowRevive=new x1(G1("UI_REVIVE_ICON",30,32),"revive",i),this.rowMedal=new x1(G1("Icon_medal_1st",24,31),null,i),this.rowMedalBuff=new x1(G1("Icon_Medalbuff_02",30,30),"medalBuff",h),this.rowQuestGold=new x1(G1("Icon_Skill_QGGU",46,24,"UI_Ekkorr2"),"questGold",h),this.rowQuestTime=new x1(G1("Icon_Skill_QCTD",46,24,"UI_Ekkorr2"),"questTime",h),this.rowQuestCost=new x1(G1("Icon_Skill_QUCD",46,24,"UI_Ekkorr2"),"questCost",h),this.lblEffect.eventMode="none",this.banner.on("pointertap",()=>this.toggle("raceChange")); + for(const e of this.allRows()){ + const t=e.helpKey; + t&&e.on("pointertap",()=>this.toggle(t))} + this.contentContainer.addChild(this.banner,...this.allRows(),this.lblEffect)} + static getInstance(){ + return this._instance||(this._instance=new t),this._instance} + allRows(){ + return[this.rowKnight,this.rowWave,this.rowRevive,this.rowMedal,this.rowMedalBuff,this.rowQuestGold,this.rowQuestTime,this.rowQuestCost]} + async showProfile(){ + if(this.title=Nr.getText("GAME_258","프로필"),this.openKey=null,await U1.loadHiRes(),this.refreshData(),this.refreshMe(),this.updateLayout(),!this.image){ + this.image=new u,this.image.eventMode="none",this.addChildAt(this.image,0); + const t=it.getAssetPath("CharProfile.png"),s=await r.load(t); + this.image.texture=s,this.image.x=20,this.image.y=5-this.image.height} + super.show()} + refreshMe(){ + const t=gc.nowLook; + this.meBadge.setLook(t.tribe,t.face,t.frame),this.lblMeName.text=Oo.name,this.lblMeSub.text=DW.meSub(DW.tribe(t.tribe),DW.tribe(gc.repTribe())),this.btnDeco.text=DW.open(),this.meBg.clear().roundRect(0,0,v1,72,12).fill(C1),this.btnDeco.position.set(v1-this.btnDeco.width-10,(72-this.btnDeco.height)/2); + const s=this.btnDeco.x-84-8; + for(const i of[this.lblMeName,this.lblMeSub])i.scale.set(1),i.width>s&&i.scale.set(Math.max(.6,s/i.width))} + async openDeco(){ + const{ + ProfileDecoPopup:t} + =await o(async()=>{ + const{ + ProfileDecoPopup:t} + =await import("./chunks/ProfileDecoPopup.js"); + return{ + ProfileDecoPopup:t} + } + ,__vite__mapDeps([41,1,0,2,4,5]),import.meta.url); + this.hide(),await t.getInstance().open(!0)} + refreshData(){ + const t=Oo.tribe; + if(this.banner.visible=t>=1&&t<=4,this.banner.visible){ + const s=Nr.getText(`TRIBE_${ + t} + `,O1[t]); + this.banner.setData(t,s,Oo.getKnightLevel(t))} + const s=Math.floor(Oo.maxWave/100),i=Oo.numRevive30,h=Math.min(250,50*i),e=Math.min(100,20*i),n=Math.min(100,20*i); + this.rowKnight.setData(Nr.getText("GAME_260","기사단 레벨"),`${ + s} + `),this.rowWave.setData(Nr.getText("GAME_261","최대 웨이브"),`${ + Oo.maxWave} + `),this.rowRevive.setData(Nr.getText("GAME_262","환생수"),`${ + i} + `),this.rowMedal.setData(Nr.getText("GAME_263","누적훈장수"),Xn.displayLargeNumberAsAlphabet(Oo.accuMedal)),this.rowMedalBuff.setData(Nr.getText("GAME_264","기사단 훈장 버프"),3*s+"%"),this.rowQuestGold.setData(Nr.getText("GAME_265","퀘스트 골드 버프"),`${ + h} + %`,h>=250),this.rowQuestTime.setData(Nr.getText("GAME_266","퀘스트 시간 단축"),`${ + e} + %`,e>=100),this.rowQuestCost.setData(Nr.getText("GAME_267","퀘스트 오픈 비용 감소"),`${ + n} + %`,n>=100),this.lblEffect.text=Nr.getText("GAME_1461","효과")} + toggle(t){ + this.openKey=this.openKey===t?null:t,queueMicrotask(()=>{ + if(!this.parent)return; + const t=this.height; + this.updateLayout(),this.y+=Math.round((this.height-t)/2*this.scale.y),this.keepOnScreen()} + )} + keepOnScreen(){ + const t=this.y-this.pivot.y*this.scale.y,s=t+this.height*this.scale.y,i=J.safeHeight-8; + s>i&&(this.y-=Math.min(s-i,Math.max(0,t-8)))} + updateLayout(){ + this.meRow.position.set(28,72); + let t=this.meRow.y+72+12; + this.banner.visible&&(this.banner.position.set(28,t),t+=this.banner.layout("raceChange"===this.openKey)+10); + const s=e(s=>{ + s.position.set(28,t),t+=s.layout(null!==s.helpKey&&s.helpKey===this.openKey)+6} + ,"place"); + [this.rowKnight,this.rowWave,this.rowRevive,this.rowMedal].forEach(s),t+=6,this.lblEffect.position.set(32,t),t+=Math.ceil(this.lblEffect.height)+2,[this.rowMedalBuff,this.rowQuestGold,this.rowQuestTime,this.rowQuestCost].forEach(s),this.height=2*Math.ceil((t-6+30)/2)} + } + ; + e(H1,"ProfilePopup"),n(H1,"_instance"); + let $1=H1; + const F1=Object.freeze(Object.defineProperty({ + __proto__:null,ProfilePopup:$1} + ,Symbol.toStringTag,{ + value:"Module"} + ));
(module) 56 hunks, 104 statements
- =await Promise.resolve().then(()=>TVi); + =await import("./chunks/CapacitorLoginPopup.js");
- ,void 0),e=await Promise.race([s.getInstance().waitForChoice(),new Promise(t=>setTimeout(()=>t("guest"),6e4))]); + ,__vite__mapDeps([44,1,0,2,4,5]),import.meta.url),h=await Promise.race([i.getInstance().waitForChoice(),new Promise(t=>setTimeout(()=>t("guest"),6e4))]);
- =await Promise.resolve().then(()=>Jvi); + =await import("./chunks/CapacitorBridge.js");
- ,void 0); + ,__vite__mapDeps([15,1,0,2,16,4,5]),import.meta.url);
- width:n,...h?{ + width:e,...n?{
- await RS.generateTexture("UI",r,!1),await RS.generateTexture("Effect",r,!1),await RS.generateTexture("Loading",r,!1),await RS.generateTexture("BG",r,!1),await RS.generateTexture("GW_BG2",r,!1),await RS.generateTexture("BgRaid2",r,!1),await RS.generateTexture("bg/bg2",r,!1),await RS.generateTexture("Game",r,!1),await RS.generateTexture("Game1",r,!1),await RS.generateTexture("LevelUp",r,!1),await RS.generateTexture("HeroSkillEffect",r,!1),await RS.generateTexture("ClickHand",r,!1),await RS.generateTexture("UI_PET",r,!1),await RS.generateTexture("UI_HELP",r,!1),await RS.generateTexture("UI_HELP2",r,!1),await RS.generateTexture("UI_GuildWar",r,!1); + await nt.generateTexture("UI",r,!1),await nt.generateTexture("ProfileDeco","ktx2",!1),await nt.generateTexture("Effect",r,!1),await nt.generateTexture("Loading",r,!1),await nt.generateTexture("BG",r,!1),await nt.generateTexture("GW_BG2",r,!1),await nt.generateTexture("BgRaid2",r,!1),await nt.generateTexture("bg/bg2",r,!1),await nt.generateTexture("Game",r,!1),await nt.generateTexture("Game1",r,!1),await nt.generateTexture("LevelUp",r,!1),await nt.generateTexture("HeroSkillEffect",r,!1),await nt.generateTexture("ClickHand",r,!1),await nt.generateTexture("UI_PET",r,!1),await nt.generateTexture("UI_HELP",r,!1),await nt.generateTexture("UI_HELP2",r,!1);
- =await Promise.resolve().then(()=>PVi); + =await import("./chunks/MobileBackButtonManager.js");
- ,void 0); + ,__vite__mapDeps([45,0,1,2,4,5]),import.meta.url);
- =await Promise.resolve().then(()=>__i); + =await import("./chunks/AppsFlyerManager.js");
- ,void 0),e=OG.getInstance().getTimeoutMilliSeconds(); + ,__vite__mapDeps([19,1,0,2,4,5]),import.meta.url),h=Co.getInstance().getTimeoutMilliSeconds();
- =await Promise.resolve().then(()=>__i); + =await import("./chunks/AppsFlyerManager.js");
- ,void 0); + ,__vite__mapDeps([19,1,0,2,4,5]),import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
- =await Promise.resolve().then(()=>__i); + =await import("./chunks/AppsFlyerManager.js");
- ,void 0); + ,__vite__mapDeps([19,1,0,2,4,5]),import.meta.url);
- zx.getInstance().setBookData(v),zx.getInstance().setSkillBookData(_),Ipi(7.12),RP.getInstance().registerSource(tP.getInstance()),RP.getInstance().registerSource(jR.getInstance()),RP.getInstance().registerSource(pR.getInstance()),RP.getInstance().registerSource(oP.getInstance()),RP.getInstance().registerSource(_fi.getInstance()),RP.getInstance().registerSource($N.getInstance()),RP.getInstance().registerSource(fP.getInstance()),fP.getInstance().syncIsolatedCodesToBuffManager(),Ipi(7.13),lpi()} + Ht.getInstance().setBookData(E),Ht.getInstance().setSkillBookData(w),Z5(7.12),Ii.getInstance().registerSource(zs.getInstance()),Ii.getInstance().registerSource(Bs.getInstance()),Ii.getInstance().registerSource(rs.getInstance()),Ii.getInstance().registerSource(ti.getInstance()),Ii.getInstance().registerSource(W2.getInstance()),Ii.getInstance().registerSource(Bh.getInstance()),Ii.getInstance().registerSource(oi.getInstance()),Ii.getInstance().registerSource(Ac.getInstance()),oi.getInstance().syncIsolatedCodesToBuffManager(),Z5(7.13),L5()}
- =await Promise.resolve().then(()=>__i); + =await import("./chunks/AppsFlyerManager.js");
- ,void 0),s=OG.getInstance().getTimeoutMilliSeconds(); + ,__vite__mapDeps([19,1,0,2,4,5]),import.meta.url),i=Co.getInstance().getTimeoutMilliSeconds();
- ),$li.getInstance().loadSetting(),SH.getInstance().init(),Ipi(9.9),xpi(),Ipi(10),PYt.getMailList(),Ipi(10.1),EYt.getInstance().getStatus().then(()=>{ + ),YZ.getInstance().loadSetting(),Uy.getInstance().loadSetting(),qu.getInstance().init(),Z5(9.9),s3(),Z5(10),Tv.getMailList(),Z5(10.1),cv.getInstance().getStatus().then(()=>{
- ,void 0); + ,void 0,import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
- =await Promise.resolve().then(()=>pAi); + =await import("./chunks/StampCalendarPopup.js");
- ,void 0); + ,__vite__mapDeps([42,1,0,2,43,4,5]),import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
- =await Promise.resolve().then(()=>BVi); + =await import("./chunks/OfflinePopup.js");
- ,void 0),e=s.getInstance(); + ,__vite__mapDeps([46,1,0,2,4,5]),import.meta.url),h=i.getInstance();
- ,void 0); + ,void 0,import.meta.url);
- =await Promise.resolve().then(()=>sAi); + =await import("./chunks/OfflineCountdown.js");
- ,void 0),{ + ,__vite__mapDeps([39,1,0,2,4,5]),import.meta.url),{
- ,void 0),s=t.getInstance(); + ,void 0,import.meta.url),i=t.getInstance();
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
- =await Promise.resolve().then(()=>$Vi); + =await import("./chunks/KeepScreenAwake.js");
- ,void 0).then(({ + ,[],import.meta.url).then(({
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
- =await Promise.resolve().then(()=>zVi); + =await import("./chunks/LocalPushManager.js");
- ,void 0).then(({ + ,__vite__mapDeps([47,1,0,2,4,5]),import.meta.url).then(({
- ,void 0),s=i.getInstance(); + ,void 0,import.meta.url),i=t.getInstance();
- =await Promise.resolve().then(()=>zVi); + =await import("./chunks/LocalPushManager.js");
- ,void 0).then(({ + ,__vite__mapDeps([47,1,0,2,4,5]),import.meta.url).then(({
- =await Promise.resolve().then(()=>__i); + =await import("./chunks/AppsFlyerManager.js");
- ,void 0); + ,__vite__mapDeps([19,1,0,2,4,5]),import.meta.url);
- =await Promise.resolve().then(()=>zVi); + =await import("./chunks/LocalPushManager.js");
- ,void 0).then(({ + ,__vite__mapDeps([47,1,0,2,4,5]),import.meta.url).then(({
- =await Promise.resolve().then(()=>__i); + =await import("./chunks/AppsFlyerManager.js");
- ,void 0); + ,__vite__mapDeps([19,1,0,2,4,5]),import.meta.url);
- =await Promise.resolve().then(()=>XVi); + =await import("./chunks/CapacitorLoginPopup2.js");
- ,void 0),i=await t.getInstance().waitForChoice(); + ,__vite__mapDeps([48,1,0,2,4,5]),import.meta.url),s=await t.getInstance().waitForChoice();
+ e(h3,"onPlatformIdTransferredError"),e(e3,"loadLangPack"),e(n3,"onLangPackLoad"); + let o3=!1;
- Qt(Ppi,"onPlatformIdTransferredError"),Qt(Npi,"loadLangPack"),Qt(Lpi,"onLangPackLoad"),window.startElfDefenderGame=async()=>{ + window.addEventListener("vite:preloadError",t=>{ + o3||(o3=!0,gr.getInstance().showDelay("NEW_BUILD"))} + ),window.startElfDefenderGame=async()=>{
- ,Qt(Dpi,"init"),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Dpi):Dpi(),ci.add(Mh),ci.mixin(Ke,bh),ci.add(Vd),ci.add(rf),ci.mixin(Ke,of),ci.add(Gf),ci.add(If); - const Gpi=Object.freeze(Object.defineProperty({ - __proto__:null} - ,Symbol.toStringTag,{ - value:"Module"} - )),Bpi=Object.freeze(Object.defineProperty({ - __proto__:null} - ,Symbol.toStringTag,{ - value:"Module"} - )),Upi=VKt("Preferences",{ - web:Qt(()=>ei(()=>Promise.resolve().then(()=>ZVi),void 0).then(t=>new t.PreferencesWeb),"web")} - ),Fpi=Object.freeze(Object.defineProperty({ - __proto__:null,Preferences:Upi} - ,Symbol.toStringTag,{ - value:"Module"} - )),$pi=class t{ - constructor(){ - Zt(this,"timerId",0)} - static getInstance(){ - return this._instance||(this._instance=new t),this._instance} - requestShow(){ - this.schedule(0)} - cancel(){ - this.timerId&&(clearTimeout(this.timerId),this.timerId=0)} - schedule(t){ - this.cancel(),this.timerId=window.setTimeout(()=>{ - this.timerId=0,this.tryShow()} - ,t)} - isBlockedByContext(){ - return!zui.getInstance().isIdleBattleActive()||!!LG.getInstance().hasPopup||A$.getInstance().children.length>0} - async tryShow(){ - if(TG.numRevive30<t.UNLOCK_REVIVE30)return; - if(!ZP.getInstance().hasReward())return; - if(this.isBlockedByContext())return void this.schedule(t.RETRY_BLOCKED_MS); - const{ - AttendancePopup:i} - =await ei(async()=>{ - const{ - AttendancePopup:t} - =await Promise.resolve().then(()=>vai); - return{ - AttendancePopup:t} - } - ,void 0); - LG.getInstance().hasPopup?this.schedule(t.RETRY_BLOCKED_MS):(i.getInstance().setData(),i.getInstance().show(),i.getInstance().placeVertically(350))} - } + ,e(r3,"init"),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",r3):r3(); + export{ + _a as $,Yi as A,ur as B,to as C,tn as D,sQ as E,_y as F,Dr as G,gy as H,Nv as I,Rt as J,XI as K,Nr as L,qt as M,pR as N,VC as O,Do as P,xr as Q,qi as R,No as S,w5 as T,Oo as U,tt as V,Br as W,Ii as X,ci as Y,rs as Z,ns as _,en as a,z as a$,kO as a0,Nt as a1,Yn as a2,FH as a3,za as a4,Wu as a5,_P as a6,Xu as a7,gP as a8,Pc as a9,aL as aA,cy as aB,vn as aC,Uz as aD,qu as aE,GS as aF,Ht as aG,wo as aH,VB as aI,St as aJ,Bz as aK,xz as aL,JJ as aM,aP as aN,hI as aO,$o as aP,cQ as aQ,IJ as aR,Ko as aS,rL as aT,jo as aU,jU as aV,Jn as aW,EO as aX,AO as aY,sc as aZ,YS as a_,cC as aa,Oc as ab,Tc as ac,gc as ad,cc as ae,fc as af,DW as ag,wc as ah,Ec as ai,Il as aj,Xn as ak,nr as al,eO as am,lk as an,Ak as ao,ws as ap,Cs as aq,uV as ar,AI as as,lo as at,RV as au,it as av,oy as aw,Ot as ax,uy as ay,Ua as az,DI as b,gv as b0,JU as b1,_t as b2,Qv as b3,Yv as b4,uc as b5,In as b6,bn as b7,$a as b8,Oj as b9,kc as bA,Yo as bB,Zi as bC,yi as bD,rt as bE,K as bF,mt as bG,Tt as bH,ht as bI,ft as bJ,sn as bK,Ro as bL,Go as bM,il as bN,xS as bO,zS as bP,lO as bQ,uv as bR,bv as bS,bH as bT,Mj as bU,Nj as bV,iq as bW,dq as bX,bQ as bY,F1 as bZ,U2 as b_,Xi as ba,Lc as bb,QG as bc,tL as bd,oi as be,ud as bf,fG as bg,Le as bh,j as bi,M$ as bj,Dt as bk,ui as bl,sa as bm,hP as bn,tP as bo,$D as bp,QD as bq,YD as br,ZD as bs,sP as bt,XD as bu,eP as bv,oP as bw,JD as bx,bl as by,nd as bz,Co as c,Et as d,nt as e,OC as f,J as g,lc as h,Ku as i,Ar as j,rd as k,Lv as l,GV as m,vv as n,FS as o,Mt as p,J0 as q,Kc as r,HS as s,BR as t,NS as u,jS as v,py as w,sr as x,Xt as y,ai as z}
HeroAutoController 1 hunks, 99 statements
+ function Dy(t,s,i,h){ + if(t>=s||!(i>0))return t; + if(h(t,t+1)>i)return t; + let e=t+1,n=s; + for(; + e<n; + ){ + const s=e+Math.ceil((n-e)/2); + h(t,s)<=i?e=s:n=s-1} + return e} + function Py(t,s,i){ + const h=t.map(t=>t.level),n=t.filter(t=>t.level<t.maxLevel); + if(0===n.length||!(s>0))return h; + const o=e(s=>{ + let h=0; + for(const e of t){ + const t=Math.min(s,e.maxLevel); + t>e.level&&(h+=i(e.level,t))} + return h} + ,"costTo"); + let r=Math.min(...n.map(t=>t.level)),a=Math.max(...n.map(t=>t.maxLevel)); + for(; + r<a; + ){ + const t=r+Math.ceil((a-r)/2); + o(t)<=s?r=t:a=t-1} + let l=s-o(r); + t.forEach((t,s)=>{ + h[s]=Math.max(t.level,Math.min(r,t.maxLevel))} + ); + for(let e=0; + e<t.length; + e++){ + const s=h[e]; + if(s!==r||s>=t[e].maxLevel)continue; + const n=i(s,s+1); + if(n>l)break; + h[e]=s+1,l-=n} + return h} + function xy(t,s,i){ + const h=t.map(t=>t.level); + let e=s; + for(let n=0; + n<t.length; + n++){ + const s=t[n],o=Dy(s.level,s.maxLevel,e,i[n]); + o>s.level&&(e-=i[n](s.level,o),h[n]=o)} + return h} + e(Dy,"maxAffordableLevel"),e(Py,"planEvenLevels"),e(xy,"planInOrder"); + const By=class t{ + constructor(){ + n(this,"frameCount",0),n(this,"frameRegistered",!1),n(this,"_enabled",!1),n(this,"lastFlushAt",0),n(this,"loadPromise",null),n(this,"touched",!1)} + static getInstance(){ + return this.instance||(this.instance=new t),this.instance} + static get isUnlocked(){ + return Oo.maxWave>=t.UNLOCK_WAVE} + get enabled(){ + return this._enabled} + loadSetting(){ + return this.loadPromise||(this.loadPromise=j.getHeroAutoEnabled().then(s=>{ + this.touched||(t.isUnlocked?(this._enabled=!0===s,this._enabled&&this.startTimer()):this._enabled=!1)} + )),this.loadPromise} + setEnabled(t){ + this.touched=!0,this._enabled!==t&&(this._enabled=t,j.setHeroAutoEnabled(t),t?(this.startTimer(),this.tick()):this.stopTimer())} + startTimer(){ + this.frameRegistered||(this.frameRegistered=!0,this.frameCount=0,sa.getInstance().add(this.onFrame,this))} + stopTimer(){ + this.frameRegistered&&(this.frameRegistered=!1,sa.getInstance().remove(this.onFrame,this))} + onFrame(){ + ++this.frameCount<t.TICK_FRAMES||(this.frameCount=0,this.tick())} + teamHeroes(){ + return Xt.getInstance().list.filter(t=>t&&t.id>0&&t.kindNum>0&&t.level>0&&t.getBookVo())} + tick(){ + if(!this._enabled)return; + if(!t.isUnlocked)return; + if(!lo.isIdleBattle)return; + if(lo.pausedAt>0)return; + if(!B2.getInstance().getPlayer())return; + const s=this.teamHeroes(); + if(0===s.length)return; + const i=CS.getInstance(),h=Ii.getInstance().getGameplayMultiplier(ci.UnitUpgradeGold),n=e((t,s)=>Math.floor(i.getTotalGold(t,s)/h),"cost"),o=s.map(t=>({ + level:t.level,maxLevel:i.getMaxLevel(t.grade,t.trans)} + )); + if(o.every(t=>t.level>=t.maxLevel))return; + const r=Py(o,.5*Oo.gold,n); + let a=0,l=!1; + for(let t=0; + t<s.length; + t++){ + const i=s[t],h=i.level,e=r[t]; + e<=h||(a+=n(h,e),i.level=e,yy.registerTargetLevel(i.id,e),B2.getInstance().udpateHero(i),l||(l=Vs.some(t=>h<t&&e>=t)))} + if(a<=0)return; + Oo.gold-=a,rd.getInstance().updateGold(),l&&Ii.getInstance().recalculate(),yy.markDirtyAndSchedule(); + const c=Date.now(); + 0===this.lastFlushAt&&(this.lastFlushAt=c),c-this.lastFlushAt>=t.FLUSH_MS&&(this.lastFlushAt=c,yy.cleanup()),_N.getInstance().refreshLevels(),pR.getInstance().onConditionChanged()} + } + ; + e(By,"HeroAutoController"),n(By,"instance"),n(By,"TICK_FRAMES",180),n(By,"FLUSH_MS",15e3),n(By,"UNLOCK_WAVE",1e3); + let Uy=By;
PodiumColumn 3 hunks, 95 statements
- const yoi=class extends RJt{ - constructor(t){ - super(t),Zt(this,"_enabled",!0),this.outlineText=!0} - get enabled(){ - return this._enabled} - set enabled(t){ - t!=this._enabled&&(this._enabled=t,this._enabled?(this.text="ON",this.color=RJt.COLOR_SAND_BROWN):(this.text="OFF",this.color=RJt.COLOR_GRAY))} + const Rq=class t extends l{ + constructor(s,i,h,e,o,r){ + super(),n(this,"badge"),n(this,"face"),n(this,"shield"),n(this,"lblName"),n(this,"lblLv"),n(this,"pedestal",new p),n(this,"pedIcon"),n(this,"pedValue"),n(this,"userName",""),this.place=s,this.badgeSize=i,this.pedH=h,this.pedColor=e,this.panelH=o,this.faceLook=r,this.badge=new u(nt.getTexture("UI_Ekkorr",`Icon_RankBadge_0${ + s} + `)),this.badge.width=i,this.badge.height=i,this.addChild(this.badge),this.face=new Oc(r.face),this.shield=new fG(r.shield),this.shield.setRank(s),this.addChild(this.face,this.shield),this.lblName=new to("",16777215,en.DEFAULT_OUTLINE_FONT_OPTION_17),this.addChild(this.lblName),this.lblLv=new to("",13216120),this.lblLv.textSize=13,this.addChild(this.lblLv),this.addChild(this.pedestal),this.pedIcon=new u(nt.getTexture("UI_Ekkorr",Iq[0])),this.addChild(this.pedIcon),this.pedValue=new to("",16777215,en.DEFAULT_OUTLINE_FONT_OPTION_20),this.addChild(this.pedValue); + for(const t of[this.badge,this.face,this.lblName,this.lblLv,this.pedestal,this.pedIcon,this.pedValue])t.eventMode="none"; + this.hitArea=new T(0,0,t.W,o),this.eventMode="static",this.cursor="pointer",this.on("pointertap",()=>{ + this.userName&&Sq.getInstance().open(this.userName)} + )} + setData(s){ + if(this.visible=void 0!==s,!s)return; + const i=t.W; + this.userName=String(s.name??""); + const h=""!==this.userName&&this.userName===Oo.name,e=h?MG.myDeco()??cG(s.deco):cG(s.deco),n=e?this.faceLook.pedH:this.pedH,o=this.panelH-n; + this.pedestal.clear().roundRect(.5*(i-156),o,156,n+14,12).fill(this.pedColor); + const r=fq.getInstance().selectedIndex; + this.pedIcon.texture=nt.getTexture("UI_Ekkorr",Iq[r]??Iq[0]),this.pedIcon.scale.set(22/this.pedIcon.texture.height),this.pedValue.text=Oq(s); + const a=this.pedIcon.width+6+this.pedValue.width; + this.pedIcon.x=.5*(i-a),this.pedIcon.y=o+.5*(n-this.pedIcon.height),this.pedValue.x=this.pedIcon.x+this.pedIcon.width+6,this.pedValue.y=o+.5*(n-this.pedValue.height),this.lblLv.text=`Lv.${ + Math.floor(Number(s.maxWave??0)/100)} + `,this.lblLv.x=.5*(i-this.lblLv.width),this.lblLv.y=o-8-this.lblLv.height,this.lblName.text=this.userName,this.lblName.textColor=h?16767370:16777215,this.lblName.scale.set(1); + const l=i-8; + if(this.lblName.width>l&&this.lblName.scale.set(l/this.lblName.width),this.lblName.x=.5*(i-this.lblName.width),this.lblName.y=this.lblLv.y-2-this.lblName.height,this.badge.visible=!e,this.face.visible=!!e,this.shield.visible=!!e,!e)return this.badge.x=.5*(i-this.badgeSize),void(this.badge.y=this.lblName.y-2-this.badgeSize); + const{ + face:c,shield:u} + =this.faceLook; + this.shield.x=.5*(i-u),this.shield.y=this.lblName.y-2-u,this.face.setLook(e.tribe,e.face,e.frame),this.face.x=.5*(i-c),this.face.y=this.shield.y+.25*u-.8*c}
- Qt(yoi,"SoundOptionButton"); + e(Rq,"PodiumColumn"),n(Rq,"W",176); + let yq=Rq; + const Nq=class t extends l{ + constructor(s=570){ + super(),n(this,"columns"); + const i=t.H,h=(new p).roundRect(0,0,s,i,18).fill(2300949); + h.eventMode="none",this.addChild(h); + const e=new l,o=(new p).roundRect(0,0,s,i,18).fill(16777215); + o.eventMode="none",this.addChild(o),e.mask=o,this.addChild(e),this.columns=[new yq(2,100,52,8093060,i,{ + face:116,shield:42,pedH:46} + ),new yq(1,124,64,11106869,i,{ + face:138,shield:48,pedH:56} + ),new yq(3,100,42,9132599,i,{ + face:116,shield:42,pedH:36} + )]; + const r=3*yq.W+20; + this.columns.forEach((t,i)=>{ + t.x=.5*(s-r)+i*(yq.W+10),e.addChild(t)} + )} + setData(t){ + this.columns[0].setData(t[1]),this.columns[1].setData(t[0]),this.columns[2].setData(t[2])} + } + ; + e(Nq,"RankingPodium"),n(Nq,"H",250);
- const Toi=class t extends Ke{ - constructor(i,s,e,n,h){ - super(),Zt(this,"badge"),Zt(this,"lblName"),Zt(this,"lblLv"),Zt(this,"pedestal",new ep),Zt(this,"pedIcon"),Zt(this,"pedValue"),Zt(this,"userName",""),this.place=i,this.badgeSize=s,this.pedH=e,this.pedColor=n,this.panelH=h,this.badge=new Xe(RS.getTexture("UI_Ekkorr",`Icon_RankBadge_0${ - i} - `)),this.badge.width=s,this.badge.height=s,this.addChild(this.badge),this.lblName=new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_17),this.addChild(this.lblName),this.lblLv=new iG("",13216120),this.lblLv.textSize=13,this.addChild(this.lblLv),this.addChild(this.pedestal),this.pedIcon=new Xe(RS.getTexture("UI_Ekkorr",voi[0])),this.addChild(this.pedIcon),this.pedValue=new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_20),this.addChild(this.pedValue); - for(const t of[this.badge,this.lblName,this.lblLv,this.pedestal,this.pedIcon,this.pedValue])t.eventMode="none"; - this.hitArea=new $i(0,0,t.W,h),this.eventMode="static",this.cursor="pointer",this.on("pointertap",()=>{ - this.userName&&moi.getInstance().open(this.userName)} - )} - setData(i){ - if(this.visible=void 0!==i,!i)return; - const s=t.W; - this.userName=String(i.name??""); - const e=this.panelH-this.pedH; - this.pedestal.clear().roundRect(.5*(s-156),e,156,this.pedH+14,12).fill(this.pedColor); - const n=coi.getInstance().selectedIndex; - this.pedIcon.texture=RS.getTexture("UI_Ekkorr",voi[n]??voi[0]),this.pedIcon.scale.set(22/this.pedIcon.texture.height),this.pedValue.text=_oi(i); - const h=this.pedIcon.width+6+this.pedValue.width; - this.pedIcon.x=.5*(s-h),this.pedIcon.y=e+.5*(this.pedH-this.pedIcon.height),this.pedValue.x=this.pedIcon.x+this.pedIcon.width+6,this.pedValue.y=e+.5*(this.pedH-this.pedValue.height),this.lblLv.text=`Lv.${ - Math.floor(Number(i.maxWave??0)/100)} - `,this.lblLv.x=.5*(s-this.lblLv.width),this.lblLv.y=e-8-this.lblLv.height,this.lblName.text=this.userName,this.lblName.textColor=this.userName===TG.name?16767370:16777215,this.lblName.scale.set(1); - const r=s-8; - this.lblName.width>r&&this.lblName.scale.set(r/this.lblName.width),this.lblName.x=.5*(s-this.lblName.width),this.lblName.y=this.lblLv.y-2-this.lblName.height,this.badge.x=.5*(s-this.badgeSize),this.badge.y=this.lblName.y-2-this.badgeSize} - } - ; - Qt(Toi,"PodiumColumn"),Zt(Toi,"W",176); - let Coi=Toi; - const Ooi=class t extends Ke{ - constructor(i=570){ - super(),Zt(this,"columns"); - const s=t.H,e=(new ep).roundRect(0,0,i,s,18).fill(2300949); - e.eventMode="none",this.addChild(e); - const n=new Ke,h=(new ep).roundRect(0,0,i,s,18).fill(16777215); - h.eventMode="none",this.addChild(h),n.mask=h,this.addChild(n),this.columns=[new Coi(2,100,52,8093060,s),new Coi(1,124,64,11106869,s),new Coi(3,100,42,9132599,s)]; - const r=3*Coi.W+20; - this.columns.forEach((t,s)=>{ - t.x=.5*(i-r)+s*(Coi.W+10),n.addChild(t)} - )} - setData(t){ - this.columns[0].setData(t[1]),this.columns[1].setData(t[0]),this.columns[2].setData(t[2])} - } - ; - Qt(Ooi,"RankingPodium"),Zt(Ooi,"H",250); - let Ioi=Ooi;
GameOverPopup 21 hunks, 91 statements
- super(),Zt(this,"lblMessage1",new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_18)),Zt(this,"lblMessage2",new iG("",hD.COLOR_GRAY,hD.DEFAULT_FONT_OPTION_16)),Zt(this,"lblMedalReward",new OF("UI_STAR_ICON","0",16750848,hD.DEFAULT_OUTLINE_FONT_OPTION_18)),Zt(this,"lblEventBonus",new iG("",4500223,hD.DEFAULT_OUTLINE_FONT_OPTION_18)),Zt(this,"rewardCardBg"),Zt(this,"lblTabCurrentArrow"),Zt(this,"lblTabCurrent",new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_17)),Zt(this,"lblTabCenter",new iG("",8947848,hD.DEFAULT_OUTLINE_FONT_OPTION_16)),Zt(this,"lblTabReviveArrow"),Zt(this,"lblTabRevive",new iG("",8947848,hD.DEFAULT_OUTLINE_FONT_OPTION_17)),Zt(this,"lblStartWave",new iG("",13421772,hD.DEFAULT_FONT_OPTION_16)),Zt(this,"lblLastRevive",new iG("",10066329,hD.DEFAULT_FONT_OPTION_16)),Zt(this,"btnMedalBuffGuide",new HU("UI_Ekkorr","UI_Alarm",.85)),Zt(this,"btnRebirth",new M$("","","환생",.8,135,70)),Zt(this,"btnRebirthBonus",new M$("UI_GEM","500","환생 (훈장 x 2)",.8,240,70)),Zt(this,"btnContinue",new M$("Icon_Heart2","1","이어하기",.8,140,70)),Zt(this,"reviveTeamBanner"),Zt(this,"reviveTreasureBanner"),Zt(this,"revivePetBanner"),Zt(this,"bannerSeparator"),Zt(this,"useReviveTeam",!1),Zt(this,"hasReviveTeam",!1),Zt(this,"reviveTeamKindNums",[]),Zt(this,"reviveTeamTrans",[]),Zt(this,"currentWave",1),Zt(this,"baseMedalCache",0),Zt(this,"normalMedalCache",0),Zt(this,"reviveTeamMedalCache",0),Zt(this,"eventMultiCache",1),Zt(this,"currentBuffMultiplier",1),Zt(this,"reviveBuffMultiplier",1),Zt(this,"onContinue",null),Zt(this,"onRebirth",null),Zt(this,"onRebirthBonus",null),Zt(this,"requestPending",!1),Zt(this,"continueResumeSeq",0),Zt(this,"isGameOverMode",!1),Zt(this,"pendingGameOver",null),Zt(this,"gameOverWave",0),Zt(this,"gameOverShownAt",0),jS.getInstance().addEventListener("BattleSwitch",this.onBattleSwitchEvent.bind(this)),this.title=NB.getText("GAME_6","환생하기"),this.lblMessage1.y=85,this.lblMessage2.align="center",this.btnRebirth.showIconLabel=!1,this.btnRebirth.showTextLabel=!0,this.btnRebirth.text=NB.getText("GAME_5","환생"),this.btnRebirth.color=M$.GREEN,this.btnRebirthBonus.showIconLabel=!0,this.btnRebirthBonus.showTextLabel=!0,this.btnRebirthBonus.iconText="500",this.btnRebirthBonus.text=`${ + super(),n(this,"lblMessage1",new to("",en.DEFAULT_COLOR,en.DEFAULT_FONT_OPTION_18)),n(this,"lblMessage2",new to("",en.COLOR_GRAY,en.DEFAULT_FONT_OPTION_16)),n(this,"lblMedalReward",new Il("UI_STAR_ICON","0",16750848,en.DEFAULT_OUTLINE_FONT_OPTION_18)),n(this,"lblEventBonus",new to("",4500223,en.DEFAULT_OUTLINE_FONT_OPTION_18)),n(this,"rewardCardBg"),n(this,"lblTabCurrentArrow"),n(this,"lblTabCurrent",new to("",16777215,en.DEFAULT_OUTLINE_FONT_OPTION_17)),n(this,"lblTabCenter",new to("",8947848,en.DEFAULT_OUTLINE_FONT_OPTION_16)),n(this,"lblTabReviveArrow"),n(this,"lblTabRevive",new to("",8947848,en.DEFAULT_OUTLINE_FONT_OPTION_17)),n(this,"lblStartWave",new to("",13421772,en.DEFAULT_FONT_OPTION_16)),n(this,"lblLastRevive",new to("",10066329,en.DEFAULT_FONT_OPTION_16)),n(this,"btnMedalBuffGuide",new Ua("UI_Ekkorr","UI_Alarm",.85)),n(this,"btnRebirth",new Pc("","","환생",.8,135,70)),n(this,"btnRebirthBonus",new Pc("UI_GEM","500","환생 (훈장 x 2)",.8,240,70)),n(this,"btnContinue",new Pc("Icon_Heart2","1","이어하기",.8,140,70)),n(this,"cbAutoRebirth",new Lc),n(this,"lblAutoRebirth",new to("",en.COLOR_WHITE,en.DEFAULT_FONT_OPTION_16)),n(this,"cbAutoGem",new Lc),n(this,"lblAutoGem",new Il("UI_GEM","",en.COLOR_WHITE,en.DEFAULT_FONT_OPTION_16)),n(this,"btnAutoGuide",new Ua("UI_Ekkorr","UI_Alarm",.85)),n(this,"lblAutoCountdown",new to("",16752688,en.DEFAULT_OUTLINE_FONT_OPTION_17)),n(this,"lblAutoGemShort",new to("",en.COLOR_RED_GEM,en.DEFAULT_FONT_OPTION_15)),n(this,"autoSetting",{ + on:!1,gem:!1} + ),n(this,"autoSettingLoad",null),n(this,"autoGemShortRebirth",!1),n(this,"autoDeadline",0),n(this,"autoLastTickAt",0),n(this,"autoShownSec",-1),n(this,"reviveTeamBanner"),n(this,"reviveTreasureBanner"),n(this,"revivePetBanner"),n(this,"bannerSeparator"),n(this,"useReviveTeam",!1),n(this,"hasReviveTeam",!1),n(this,"reviveTeamKindNums",[]),n(this,"reviveTeamTrans",[]),n(this,"currentWave",1),n(this,"baseMedalCache",0),n(this,"normalMedalCache",0),n(this,"reviveTeamMedalCache",0),n(this,"eventMultiCache",1),n(this,"currentBuffMultiplier",1),n(this,"reviveBuffMultiplier",1),n(this,"onContinue",null),n(this,"onRebirth",null),n(this,"onRebirthBonus",null),n(this,"requestPending",!1),n(this,"continueResumeSeq",0),n(this,"isGameOverMode",!1),n(this,"pendingGameOver",null),n(this,"gameOverWave",0),n(this,"gameOverShownAt",0),Et.getInstance().addEventListener("BattleSwitch",this.onBattleSwitchEvent.bind(this)),this.title=Nr.getText("GAME_6","환생하기"),this.lblMessage1.y=85,this.lblMessage2.align="center",this.btnRebirth.showIconLabel=!1,this.btnRebirth.showTextLabel=!0,this.btnRebirth.text=Nr.getText("GAME_5","환생"),this.btnRebirth.color=Pc.GREEN,this.btnRebirthBonus.showIconLabel=!0,this.btnRebirthBonus.showTextLabel=!0,this.btnRebirthBonus.iconText="500",this.btnRebirthBonus.text=`${
- x 2)`,this.btnRebirthBonus.color=M$.RED,this.btnContinue.iconScale=.6,this.btnContinue.showIconLabel=!0,this.btnContinue.showTextLabel=!0,this.btnContinue.text=NB.getText("GAME_240","이어하기"),this.btnContinue.color=M$.GREEN,this.btnContinue.onClick=this.onContinueClick.bind(this),this.btnRebirth.onClick=this.onRebirthClick.bind(this),this.btnRebirthBonus.onClick=this.onRebirthBonusClick.bind(this),this.rewardCardBg=new KU,this.rewardCardBg.setIndex(2),this.rewardCardBg.width=this.width-80,this.lblMedalReward.iconScale=.8,this.lblEventBonus.textColor=6737151,this.lblTabCurrentArrow=new Xui("left",.6),this.lblTabCurrentArrow.onClick=this.onSelectCurrentTeam.bind(this),this.lblTabCurrent.eventMode="static",this.lblTabCurrent.cursor="pointer",this.lblTabCurrent.on("pointertap",this.onSelectCurrentTeam,this),this.lblTabCurrent.lineHeight=14,this.lblTabCurrent.align="right",hD.setLabelWrapWidth(this.lblTabCurrent,130),this.lblTabReviveArrow=new Xui("right",.6),this.lblTabReviveArrow.onClick=this.onSelectReviveTeam.bind(this),this.lblTabRevive.eventMode="static",this.lblTabRevive.cursor="pointer",this.lblTabRevive.on("pointertap",this.onSelectReviveTeam,this),this.lblTabRevive.lineHeight=14,this.lblTabCurrent.align="left",hD.setLabelWrapWidth(this.lblTabRevive,130),this.lblTabCenter.text=NB.getText("GAME_611","환생 보상"),this.btnMedalBuffGuide.onClick=this.onMedalBuffGuideClick.bind(this),this.reviveTeamBanner=new sdi(this.width-40),this.reviveTeamBanner.onChanged=()=>{ + x 2)`,this.btnRebirthBonus.color=Pc.RED,this.btnContinue.iconScale=.6,this.btnContinue.showIconLabel=!0,this.btnContinue.showTextLabel=!0,this.btnContinue.text=Nr.getText("GAME_240","이어하기"),this.btnContinue.color=Pc.GREEN,this.btnContinue.onClick=this.onContinueClick.bind(this),this.btnRebirth.onClick=this.onRebirthClick.bind(this),this.btnRebirthBonus.onClick=this.onRebirthBonusClick.bind(this),this.rewardCardBg=new Wa,this.rewardCardBg.setIndex(2),this.rewardCardBg.width=this.width-80,this.lblMedalReward.iconScale=.8,this.lblEventBonus.textColor=6737151,this.lblTabCurrentArrow=new s1("left",.6),this.lblTabCurrentArrow.onClick=this.onSelectCurrentTeam.bind(this),this.lblTabCurrent.eventMode="static",this.lblTabCurrent.cursor="pointer",this.lblTabCurrent.on("pointertap",this.onSelectCurrentTeam,this),this.lblTabCurrent.lineHeight=14,this.lblTabCurrent.align="right",en.setLabelWrapWidth(this.lblTabCurrent,130),this.lblTabReviveArrow=new s1("right",.6),this.lblTabReviveArrow.onClick=this.onSelectReviveTeam.bind(this),this.lblTabRevive.eventMode="static",this.lblTabRevive.cursor="pointer",this.lblTabRevive.on("pointertap",this.onSelectReviveTeam,this),this.lblTabRevive.lineHeight=14,this.lblTabCurrent.align="left",en.setLabelWrapWidth(this.lblTabRevive,130),this.lblTabCenter.text=Nr.getText("GAME_611","환생 보상"),this.btnMedalBuffGuide.onClick=this.onMedalBuffGuideClick.bind(this),this.lblAutoRebirth.eventMode="none",this.lblAutoGem.eventMode="none",this.lblAutoCountdown.eventMode="none",this.lblAutoGemShort.eventMode="none",this.lblAutoGem.iconScale=.6,this.cbAutoRebirth.onClick=this.onAutoRebirthToggle.bind(this),this.cbAutoGem.onClick=this.onAutoGemToggle.bind(this),this.btnAutoGuide.onClick=()=>{ + h1.getInstance().showGuide()} + ,b.shared.add(this.onAutoTick,this),this.reviveTeamBanner=new l1(this.width-40),this.reviveTeamBanner.onChanged=()=>{
- ),this.bannerSeparator.visible=!1,this.contentContainer.addChild(this.lblMessage1,this.lblMessage2,this.lblTabCurrentArrow,this.lblTabCurrent,this.lblTabCenter,this.lblTabReviveArrow,this.lblTabRevive,this.btnMedalBuffGuide,this.rewardCardBg,this.lblMedalReward,this.lblEventBonus,this.lblStartWave,this.lblLastRevive,this.btnRebirth,this.btnRebirthBonus,this.btnContinue,this.bannerSeparator,this.reviveTeamBanner,this.reviveTreasureBanner,this.revivePetBanner),hD.setLabelWrapWidth(this.lblMessage1,this.width-60),hD.setLabelWrapWidth(this.lblMessage2,this.width-60)} + ),this.bannerSeparator.visible=!1,this.contentContainer.addChild(this.lblMessage1,this.lblMessage2,this.lblTabCurrentArrow,this.lblTabCurrent,this.lblTabCenter,this.lblTabReviveArrow,this.lblTabRevive,this.btnMedalBuffGuide,this.rewardCardBg,this.lblMedalReward,this.lblEventBonus,this.lblStartWave,this.lblLastRevive,this.btnRebirth,this.btnRebirthBonus,this.btnContinue,this.cbAutoRebirth,this.lblAutoRebirth,this.cbAutoGem,this.lblAutoGem,this.lblAutoGemShort,this.lblAutoCountdown,this.btnAutoGuide,this.bannerSeparator,this.reviveTeamBanner,this.reviveTreasureBanner,this.revivePetBanner),en.setLabelWrapWidth(this.lblMessage1,this.width-60),en.setLabelWrapWidth(this.lblMessage2,this.width-60)}
- x 2)`,this.setRewardView(),{ + x 2)`,this.updateAutoRebirthRow(),this.setRewardView(),{
- ),this.hideImmediately(),nU.getInstance().start(),lG.getInstance().startUpdate())} + ),this.stopAutoRebirth(),this.hideImmediately(),sa.getInstance().start(),lo.getInstance().startUpdate())}
- `,this.btnContinue.activated=TG.heart>0,this.btnContinue.text=NB.getText("GAME_240","이어하기")):this.btnContinue.visible=!1,this.isGameOverMode=!0,this.title=NB.getText("GAME_310","성 함락"),await this.syncGuildWarMedalBuff(); + `,this.btnContinue.activated=Oo.heart>0,this.btnContinue.text=Nr.getText("GAME_240","이어하기")):this.btnContinue.visible=!1,this.isGameOverMode=!0,this.title=Nr.getText("GAME_310","성 함락"),await this.loadAutoSetting(),await this.syncGuildWarMedalBuff();
- return this.updateLayout(),nU.getInstance().stop(),lG.getInstance().stopUpdate(),this.btnClose.visible=!1,this.outSideClickHide=!1,this.gameOverShownAt=performance.now(),super.show(),await this.loadAndUpdateReviveTeam(h,r),!0} + return this.updateLayout(),sa.getInstance().stop(),lo.getInstance().stopUpdate(),this.btnClose.visible=!1,this.outSideClickHide=!1,this.gameOverShownAt=performance.now(),super.show(),await this.loadAndUpdateReviveTeam(n,o),this.parent&&this.isGameOverMode&&this.startAutoRebirth(),!0}
- this.onRebirth=i,this.onRebirthBonus=s,this.onContinue=null,this.btnContinue.visible=!1,this.isGameOverMode=!1,this.continueResumeSeq++,this.title=NB.getText("GAME_6","환생하기"),await this.syncGuildWarMedalBuff(); + this.onRebirth=s,this.onRebirthBonus=i,this.onContinue=null,this.btnContinue.visible=!1,this.isGameOverMode=!1,this.continueResumeSeq++,this.stopAutoRebirth(),this.title=Nr.getText("GAME_6","환생하기"),await this.loadAutoSetting(),await this.syncGuildWarMedalBuff();
- nU.getInstance().start(),lG.getInstance().startUpdate(),super.hide()} + this.stopAutoRebirth(),sa.getInstance().start(),lo.getInstance().startUpdate(),super.hide()}
- i+=this.btnRebirth.height+18,this.reviveTeamBanner.canShow()?(this.bannerSeparator.visible=!0,this.bannerSeparator.x=20,this.bannerSeparator.y=i,i+=this.bannerSeparator.height+17,this.reviveTeamBanner.setData(),this.reviveTeamBanner.visible=!0,this.reviveTeamBanner.x=20,this.reviveTeamBanner.y=i,i+=85,this.reviveTreasureBanner.setData(),this.reviveTreasureBanner.canShow()?(this.reviveTreasureBanner.visible=!0,this.reviveTreasureBanner.x=20,this.reviveTreasureBanner.y=i,i+=this.reviveTreasureBanner.height+5):this.reviveTreasureBanner.visible=!1,this.revivePetBanner.canShow()?(this.revivePetBanner.setData(),this.revivePetBanner.visible=!0,this.revivePetBanner.x=20,this.revivePetBanner.y=i,i+=this.revivePetBanner.height+5):this.revivePetBanner.visible=!1):(this.bannerSeparator.visible=!1,this.reviveTeamBanner.visible=!1,this.reviveTreasureBanner.visible=!1,this.revivePetBanner.visible=!1),this.height=i+20} + if(s+=this.btnRebirth.height+18,this.cbAutoRebirth.visible){ + const i=this.cbAutoRebirth.height,h=6,e=28,n=i+h+this.lblAutoRebirth.width,o=i+h+this.lblAutoGem.width,r=n+e+o; + this.btnAutoGuide.x=this.width-this.btnAutoGuide.width-45,this.btnAutoGuide.y=s+.5*(i-this.btnAutoGuide.height); + const a=64; + let l=Math.min(t-.5*r,this.btnAutoGuide.x-8-a-r); + l=Math.max(30,l),this.cbAutoRebirth.x=l,this.cbAutoRebirth.y=s,this.lblAutoRebirth.x=l+i+h,this.lblAutoRebirth.y=s+.5*(i-this.lblAutoRebirth.height),this.cbAutoRebirth.setCustomHitAreaSize(n,i),l+=n+e,this.cbAutoGem.x=l,this.cbAutoGem.y=s,this.lblAutoGem.x=l+i+h,this.lblAutoGem.y=s+.5*(i-this.lblAutoGem.height),this.cbAutoGem.setCustomHitAreaSize(o,i),this.lblAutoGemShort.x=Math.max(30,Math.min(this.lblAutoGem.x+.5*(this.lblAutoGem.width-this.lblAutoGemShort.width),this.width-30-this.lblAutoGemShort.width)),this.lblAutoGemShort.y=s+i,l+=o,this.lblAutoCountdown.x=l+14,this.lblAutoCountdown.y=s+.5*(i-this.lblAutoCountdown.height)-4,s+=i+20} + this.reviveTeamBanner.canShow()?(this.bannerSeparator.visible=!0,this.bannerSeparator.x=20,this.bannerSeparator.y=s,s+=this.bannerSeparator.height+17,this.reviveTeamBanner.setData(),this.reviveTeamBanner.visible=!0,this.reviveTeamBanner.x=20,this.reviveTeamBanner.y=s,s+=85,this.reviveTreasureBanner.setData(),this.reviveTreasureBanner.canShow()?(this.reviveTreasureBanner.visible=!0,this.reviveTreasureBanner.x=20,this.reviveTreasureBanner.y=s,s+=this.reviveTreasureBanner.height+5):this.reviveTreasureBanner.visible=!1,this.revivePetBanner.canShow()?(this.revivePetBanner.setData(),this.revivePetBanner.visible=!0,this.revivePetBanner.x=20,this.revivePetBanner.y=s,s+=this.revivePetBanner.height+5):this.revivePetBanner.visible=!1):(this.bannerSeparator.visible=!1,this.reviveTeamBanner.visible=!1,this.reviveTreasureBanner.visible=!1,this.revivePetBanner.visible=!1),this.height=s+20}
- this.requestPending=!0; + this.stopAutoRebirth(),this.requestPending=!0;
- =await Promise.resolve().then(()=>sAi); + =await import("./chunks/OfflineCountdown.js");
- ,void 0),{ + ,__vite__mapDeps([39,1,0,2,4,5]),import.meta.url),{
- ,void 0),n=s.getInstance(); + ,void 0,import.meta.url),e=i.getInstance();
- this.requestPending=!0; + this.stopAutoRebirth(),this.requestPending=!0;
- if(TG.gem<500)return void AB.getInstance().show(NB.getText("COMMON_352","보석이 부족합니다.")); + if(this.stopAutoRebirth(),Oo.gem<500)return void Ar.getInstance().show(Nr.getText("COMMON_352","보석이 부족합니다."));
- this.requestPending=!1,this.hideImmediately(); - const l=1===h?this.onRebirth:this.onRebirthBonus; + this.requestPending=!1,this.stopAutoRebirth(),this.hideImmediately(),o(async()=>{ + const{ + PowerSaveManager:t} + =await Promise.resolve().then(()=>lP); + return{ + PowerSaveManager:t} + } + ,void 0,import.meta.url).then(({ + PowerSaveManager:t} + )=>t.getInstance().onCastleRestored()).catch(()=>{ + } + ); + const u=1===n?this.onRebirth:this.onRebirthBonus,d={ + multiplier:n,gemShort:1===n&&this.autoGemShortRebirth} + ;
- :null),l&&l(),1===h?this.onRebirth=null:this.onRebirthBonus=null,EYt.getInstance().getStatus(),this.notifyResearchLabIfNeeded(e),dXt.getInstance().checkEnable(),TXt.getInstance().onConditionChanged()} + :null,d),u&&u(),1===n?this.onRebirth=null:this.onRebirthBonus=null,cv.getInstance().getStatus(),this.notifyResearchLabIfNeeded(h),sR.getInstance().checkEnable(),pR.getInstance().onConditionChanged()}
+ loadAutoSetting(){ + return this.autoSettingLoad||(this.autoSettingLoad=j.getData(j.KEY_AUTO_REBIRTH).then(t=>{ + this.autoSetting=xc(t)} + )),this.autoSettingLoad} + saveAutoSetting(){ + j.saveData(j.KEY_AUTO_REBIRTH,{ + ...this.autoSetting} + )} + updateAutoRebirthRow(){ + const t=Bc(Oo.maxWave,Oo.numRevive); + this.cbAutoRebirth.visible=t,this.btnAutoGuide.visible=t,this.lblAutoRebirth.visible=t,this.cbAutoGem.visible=t,this.lblAutoGem.visible=t,this.lblAutoGemShort.visible=t&&Oo.gem<500,this.lblAutoCountdown.visible=t&&this.autoDeadline>0,this.lblAutoRebirth.text=Nr.getText("GAME_1934","자동 환생"),this.lblAutoGem.text=`500 (${ + Nr.getText("GAME_7","훈장")} + x 2)`,this.lblAutoGemShort.text=Nr.getText("COMMON_352","보석이 부족합니다."),this.cbAutoRebirth.selected=this.autoSetting.on,this.cbAutoGem.selected=this.autoSetting.gem; + const s=this.autoSetting.on?1:.5; + this.cbAutoGem.alpha=s,this.lblAutoGem.alpha=s,this.lblAutoGemShort.alpha=s} + onAutoRebirthToggle(t){ + this.autoSetting.on=t,this.saveAutoSetting(),t?this.startAutoRebirth():this.stopAutoRebirth(),this.updateAutoRebirthRow(),t&&h1.getInstance().showGuide()} + onAutoGemToggle(t){ + this.autoSetting.gem=t,this.saveAutoSetting(),this.updateAutoRebirthRow()} + startAutoRebirth(){ + if(!Uc({ + setting:this.autoSetting,gameOverMode:this.isGameOverMode,maxWave:Oo.maxWave,numRevive:Oo.numRevive,coachActive:ZC.active} + )||this.requestPending)return; + const t=performance.now(); + this.autoDeadline=t+15e3,this.autoLastTickAt=t,this.autoShownSec=-1,this.onAutoTick()} + stopAutoRebirth(){ + 0!==this.autoDeadline&&(this.autoDeadline=0,this.autoShownSec=-1,this.lblAutoCountdown.visible=!1)} + onAutoTick(){ + if(0===this.autoDeadline)return; + if(!this.parent||!this.isGameOverMode)return void this.stopAutoRebirth(); + const t=performance.now(),s=this.parent.children; + if(s[s.length-1]!==this)return this.autoDeadline+=t-this.autoLastTickAt,void(this.autoLastTickAt=t); + this.autoLastTickAt=t; + const i=$c(this.autoDeadline,t); + i!==this.autoShownSec&&(this.autoShownSec=i,this.lblAutoCountdown.text=Nr.getValueReplace("COMMON_550","##",i,`${ + i} + 초`),this.lblAutoCountdown.visible=!0),i>0||(this.stopAutoRebirth(),this.runAutoRebirth())} + async runAutoRebirth(){ + if(this.parent&&this.isGameOverMode&&!this.requestPending)if("bonus"===Hc(this.autoSetting,Oo.gem))await this.onRebirthBonusClick(); + else{ + this.autoGemShortRebirth=this.autoSetting.gem; + try{ + await this.onRebirthClick()} + finally{ + this.autoGemShortRebirth=!1} + } + }
- =await Promise.resolve().then(()=>hAi); + =await import("./chunks/StoreReviewManager.js");
- ,void 0); + ,__vite__mapDeps([40,1,0,2,4,5]),import.meta.url);
MailLoading 1 hunks, 78 statements
+ const yW=e((t,s)=>Nr.getText(t,s),"t"),NW=e((t,...s)=>s.reduce((t,s,i)=>t.split(`{ + ${ + i} + } + `).join(String(s)),t),"fill"),kW=e(t=>t.toLocaleString("en-US"),"n"),GW=["","인간","엘프","언데드","오크"],LW={ + 13:1,14:2,16:3,15:4} + ,DW={ + tribe:e(t=>yW(`TRIBE_${ + t} + `,GW[t]??""),"tribe"),title:e(()=>yW("GAME_2029","프로필 꾸미기"),"title"),open:e(()=>yW("GAME_2030","꾸미기"),"open"),meSub:e((t,s)=>NW(yW("GAME_2031","{ + 0} + 종족 · 대표: { + 1} + "),t,s),"meSub"),tagNow:e(()=>yW("GAME_2032","지금"),"tagNow"),tagRep:e(()=>yW("GAME_2033","대표"),"tagRep"),hintNow:e(()=>yW("GAME_2034","지금 환생 종족 — 상단에 보여요"),"hintNow"),hintOther:e(t=>NW(yW("GAME_2035","{ + 0} + 종족으로 환생하면 상단에 보여요"),t),"hintOther"),setRep:e(()=>yW("GAME_2036","대표로 설정"),"setRep"),isRep:e(()=>yW("PROFILE_DECO_REP","대표 프로필"),"isRep"),repToast:e(t=>NW(yW("GAME_2038","{ + 0} + 얼굴을 대표로 — 저장하면 다른 사람에게 보여요"),t),"repToast"),modeFace:e(()=>yW("GAME_2039","얼굴"),"modeFace"),modeFrame:e(()=>yW("GAME_2040","테두리"),"modeFrame"),baseFace:e(t=>NW(yW("GAME_2041","기본 { + 0} + 얼굴"),t),"baseFace"),baseFaceSub:e(()=>yW("GAME_2042","고르지 않으면 이 얼굴 (지금과 같음)"),"baseFaceSub"),faceLocked:e(()=>yW("GAME_2043","영웅을 얻으면 쓸 수 있어요"),"faceLocked"),frameDefault:e(()=>yW("GAME_2078","기본"),"frameDefault"),frameFloor:e(t=>kW(t),"frameFloor"),frameLocked:e(t=>NW(yW("GAME_2045","웨이브 { + 0} + 달성 시 획득"),kW(t)),"frameLocked"),frameHead:e(()=>yW("GAME_2046","층수 기념"),"frameHead"),headGift:e(()=>yW("GAME_2089","선물 테두리"),"headGift"),giftName:e(t=>[yW("GAME_2083","은빛"),yW("GAME_2084","구릿빛"),yW("GAME_2085","빨강"),yW("GAME_2086","초록"),yW("GAME_2087","파랑"),yW("GAME_2088","보라")][t-11]??"","giftName"),giftLocked:e(t=>11===t?yW("GAME_2090","친구를 처음 맺으면 받아요"):12===t?yW("GAME_2091","프로필 꾸미기를 처음 열면 받아요"):NW(yW("GAME_2092","{ + 0} + 종족으로 처음 환생하면 받아요"),yW(`TRIBE_${ + LW[t]} + `,GW[LW[t]]??"")),"giftLocked"),frameTabFloor:e(()=>"WAVE","frameTabFloor"),frameTabGuild:e(()=>yW("GAME_502","길드전"),"frameTabGuild"),headSeason:e(()=>yW("GAME_502","길드전"),"headSeason"),headTour:e(()=>yW("GWT_1","서버 대항전"),"headTour"),seasonPlace:e(t=>45===t?yW("GAME_2053","4·5위"):68===t?yW("GAME_2061","6~8위"):NW(yW("GAME_2054","{ + 0} + 위"),t),"seasonPlace"),tourPlace:e(t=>1===t?yW("GAME_2055","우승"):2===t?yW("GAME_2056","준우승"):NW(t>=4?yW("GAME_2062","{ + 0} + 강"):yW("GAME_2054","{ + 0} + 위"),t),"tourPlace"),seasonLocked:e(t=>NW(yW("GAME_2057","길드전 시즌 서버 { + 0} + 길드원이 받아요"),t),"seasonLocked"),tourLocked:e(t=>NW(yW("GAME_2058","서버 대항전 { + 0} + 길드원이 받아요"),t),"tourLocked"),frameMailNew:e(()=>yW("GAME_2059","새 프로필 테두리를 받았어요 — 프로필 › 꾸미기에서 써 보세요"),"frameMailNew"),frameMailDup:e(()=>yW("GAME_2060","이미 가진 테두리예요"),"frameMailDup"),cellEffect:e((t,s)=>NW(yW("GAME_2063","보유 +{ + 0} + · 장착 +{ + 1} + "),t,s),"cellEffect"),effectNow:e((t,s,i)=>NW(yW("GAME_2064","테두리 효과 성 · 영웅 레벨 +{ + 0} + (보유 +{ + 1} + · 장착 +{ + 2} + )"),t,s,i),"effectNow"),guideTitle:e(()=>yW("GAME_2065","프로필 테두리"),"guideTitle"),guideIntro:e(()=>yW("GAME_2066","테두리는 가지고만 있어도(보유), 프로필에 끼워 두면(장착) 성과 모든 영웅의 레벨이 올라갑니다. 일반 전투에만 적용됩니다."),"guideIntro"),guideRankHead:e(()=>yW("GAME_2067","서버 대항전 · 길드전 시즌 테두리"),"guideRankHead"),guideRankLines:e(()=>[yW("GAME_2068","순위마다 한 번만 받습니다. 같은 순위의 테두리는 다시 받을 수 없습니다."),yW("GAME_2069","보유 효과는 가장 높은 순위의 테두리 하나만 적용됩니다. 1위와 2위 테두리를 모두 가지고 있어도 1위 효과만 받습니다."),yW("GAME_2070","서버 대항전과 길드전 시즌은 따로 적용됩니다. 둘 다 가지고 있으면 두 효과를 모두 받습니다."),yW("GAME_2071","테두리는 우편으로 도착합니다. 받은 뒤 꾸미기에서 끼울 수 있습니다.")],"guideRankLines"),guideFloorHead:e(()=>yW("GAME_2072","웨이브 테두리"),"guideFloorHead"),guideFloorLines:e(()=>[yW("GAME_2073","최고 웨이브가 목표에 도달하면 받습니다."),yW("GAME_2074","가진 웨이브 테두리의 보유 효과는 모두 더해집니다.")],"guideFloorLines"),guideGiftHead:e(()=>yW("GAME_2089","선물 테두리"),"guideGiftHead"),guideGiftLines:e(()=>[yW("GAME_2093","첫 친구 · 꾸미기 처음 열기 · 종족마다 첫 환생으로 받습니다."),yW("GAME_2094","가진 선물 테두리의 보유 효과는 모두 더해집니다.")],"guideGiftLines"),guideEquipHead:e(()=>yW("GAME_2075","장착 효과"),"guideEquipHead"),guideEquipLines:e(()=>[yW("GAME_2076","지금 환생한 종족 칸에 끼운 테두리 하나의 장착 효과만 적용됩니다."),yW("GAME_2077","환생해서 종족이 바뀌면, 바뀐 종족 칸의 테두리로 장착 효과가 바뀝니다.")],"guideEquipLines"),save:e(()=>yW("GAME_527","저장"),"save"),saved:e(()=>yW("GAME_2047","저장했어요"),"saved"),saveFail:e(()=>yW("GAME_2048","저장하지 못했어요. 잠시 뒤 다시 해 주세요"),"saveFail"),leave:e(()=>yW("GAME_2049","저장하지 않고 닫을까요?"),"leave"),repNote:e(()=>yW("GAME_2050","대표 = 친구 목록 등 다른 사람에게 보이는 얼굴"),"repNote"),preview:e(()=>yW("PROFILE_DECO_PREVIEW","미리보기"),"preview"),ownedCount:e((t,s)=>`${ + t} + / ${ + s} + ${ + yW("COMMON_11","보유")} + `,"ownedCount"),ownedEffect:e(()=>yW("PROFILE_DECO_OWN_EFFECT","보유효과"),"ownedEffect"),equipEffect:e(()=>yW("GAME_2075","장착효과"),"equipEffect"),activeEffect:e(()=>yW("PROFILE_DECO_ACTIVE_EFFECT","현재 전투 효과"),"activeEffect"),totalEffect:e(t=>`${ + yW("GAME_2","성")} + · ${ + yW("GAME_3","영웅")} + Lv +${ + t} + `,"totalEffect"),acquireToEquip:e(()=>yW("PROFILE_DECO_ACQUIRE","획득 후 장착 가능"),"acquireToEquip"),faceHint:e(()=>yW("PROFILE_DECO_FACE_HINT","보유한 영웅의 얼굴을 사용할 수 있어요"),"faceHint"),equip:e(()=>yW("GAME_149","장착"),"equip"),equipped:e(()=>yW("GAME_1296","장착 중"),"equipped"),owned:e(()=>yW("COMMON_11","보유"),"owned"),notOwned:e(()=>yW("GAME_1774","미보유"),"notOwned"),effActive:e(()=>yW("GAME_2095","적용 중"),"effActive"),effIfOwned:e(()=>yW("GAME_2096","얻으면 적용"),"effIfOwned"),effIfEquipped:e(()=>yW("GAME_2097","장착하면 적용"),"effIfEquipped"),effBest:e(t=>NW(yW("GAME_2098","{ + 0} + 효과가 적용 중"),t),"effBest"),effIfRebirth:e(t=>NW(yW("GAME_2099","{ + 0} + 종족으로 환생하면 적용"),t),"effIfRebirth"),faceNote:e(()=>yW("GAME_2100","얼굴은 모양만 바뀌어요 · 효과 없음"),"faceNote"),equipBeforeRep:e(()=>`${ + yW("GAME_149","장착")} + → ${ + yW("GAME_2036","대표로 설정")} + `,"equipBeforeRep")} + ,PW=Object.freeze(Object.defineProperty({ + __proto__:null,DecoText:DW} + ,Symbol.toStringTag,{ + value:"Module"} + )); + function xW(t){ + const s=Array.isArray(null==t?void 0:t.profileFrames)?t.profileFrames:[]; + if(!s.length)return; + gc.load(!1); + const i=s.filter(t=>t.isNew).length; + Ku.getInstance().showMessage(i>0?DW.frameMailNew():DW.frameMailDup())} + e(xW,"afterMailFrames");
DescBox 1 hunks, 64 statements
- revive:"30 웨이브 이상에서 환생한 횟수입니다.",knightLevel:"최대 웨이브 100당 레벨이 1씩 올라갑니다. 최대 웨이브가 100이면 1레벨, 200이면 2레벨이 됩니다.",medalBuff:"기사단 레벨 1당 훈장버프가 3%씩 증가합니다.",questGold:"30 웨이브 이상에서 환생할때마다, 퀘스트 골드 획득이 50%씩 증가합니다. ( 최대 250% )",questTime:"30 웨이브 이상에서 환생할때마다, 퀘스트 시간이 20%씩 단축됩니다. ( 최대 100% )",questCost:"30 웨이브 이상에서 환생할때마다, 퀘스트 오픈비용이 20%씩 감소합니다. ( 최대 100% )",raceChange:"30 웨이브 이상에서 환생할 경우, 종족이 무작위로 변경됩니다."} - ,mdi=class t extends pB{ + raceChange:["GAME_1259","30 웨이브 이상에서 환생할 경우, 종족이 무작위로 변경됩니다."],knightLevel:["GAME_268","최대 웨이브 100당 레벨이 1씩 올라갑니다. 최대 웨이브가 100이면 1레벨, 200이면 2레벨이 됩니다."],revive:["GAME_269","30 웨이브 이상에서 환생한 횟수입니다."],medalBuff:["GAME_270","기사단 레벨 1당 훈장버프가 3%씩 증가합니다."],questGold:["GAME_271","30 웨이브 이상에서 환생할때마다, 퀘스트 골드 획득이 50%씩 증가합니다. ( 최대 250% )"],questTime:["GAME_272","30 웨이브 이상에서 환생할때마다, 퀘스트 시간이 20%씩 단축됩니다. ( 최대 100% )"],questCost:["GAME_273","30 웨이브 이상에서 환생할때마다, 퀘스트 오픈비용이 20%씩 감소합니다. ( 최대 100% )"]} + ,S1=e(t=>Nr.getText(b1[t][0],b1[t][1]),"helpText"),I1={ + 1:[14832942,16751210],2:[5224506,10940538],3:[5073112,11123967],4:[3975360,8840434]} + ,O1={ + 1:"인간",2:"엘프",3:"언데드",4:"오크"} + ,v1=525,C1=2827034,R1=8978312; + function y1(t,s,i){ + const h=e(h=>Math.round((t>>h&255)*(1-i)+(s>>h&255)*i)<<h,"ch"); + return h(16)|h(8)|h(0)} + function N1(){ + const t=(new p).poly([0,0,18,0,9,12]).fill(12819042); + return t.pivot.set(9,6),t.eventMode="none",t} + function k1(t,s,i){ + const h=e(()=>Math.round(t.height/i),"lines"); + en.setLabelWrapWidth(t,s); + const n=h(); + if(n<=1)return; + let o=.5*s,r=s; + for(; + r-o>6; + ){ + const s=(o+r)/2; + en.setLabelWrapWidth(t,s),h()<=n?r=s:o=s} + en.setLabelWrapWidth(t,r)} + function G1(t,s,i,h="UI_Ekkorr"){ + const e=new u(nt.getTexture(h,t)); + return e.anchor.set(.5),e.scale.set(Math.min(s/e.texture.width,i/e.texture.height)),e.eventMode="none",e} + e(y1,"mix"),e(N1,"makeCaret"),e(k1,"balanceWrap"),e(G1,"makeIcon"); + const L1=class extends l{ + constructor(t){ + super(),n(this,"bg",new p),n(this,"lbl",new to("",R1,en.DEFAULT_FONT_OPTION_17)),this.boxW=t,this.eventMode="none",this.lbl.textColor=R1,en.setLabelWrapWidth(this.lbl,t-24),this.lbl.position.set(12,7),this.addChild(this.bg,this.lbl)} + draw(t){ + this.lbl.text=t; + const s=Math.ceil(this.lbl.height)+14; + return this.bg.clear().roundRect(0,0,this.boxW,s,9).fill(1709070),s} + } + ; + e(L1,"DescBox"); + let D1=L1; + const P1=class extends l{ + constructor(t,s,i){ + super(),n(this,"bg"),n(this,"lbl",new to("",en.DEFAULT_COLOR,en.DEFAULT_FONT_OPTION_17)),n(this,"val"),n(this,"max",new l),n(this,"caret",null),n(this,"desc",null),this.icon=t,this.helpKey=s,this.bg=new A({ + texture:nt.getTexture("UI_Ekkorr","Popup_Bg_04"),leftWidth:12,topHeight:12,rightWidth:12,bottomHeight:12} + ),this.bg.width=v1,this.bg.eventMode="none",this.lbl.eventMode="none",this.val=new to("",i,en.DEFAULT_OUTLINE_FONT_OPTION_18),this.val.textColor=i,this.val.eventMode="none"; + const h=(new p).roundRect(0,0,38,17,8.5).fill(15774778),e=new m({ + text:"MAX",style:{ + fontFamily:"Arial",fontSize:11,fontWeight:"bold",fill:3809285} + } + ); + e.anchor.set(.5),e.position.set(19,9),this.max.addChild(h,e),this.max.eventMode="none",this.max.visible=!1,this.addChild(this.bg,this.icon,this.lbl,this.val,this.max),s?(this.caret=N1(),this.desc=new D1(505),this.desc.visible=!1,this.addChild(this.caret,this.desc),this.eventMode="static",this.cursor="pointer"):this.eventMode="none"} + setData(t,s,i=!1){ + this.lbl.text=t,this.val.text=s,this.max.visible=i} + layout(t){ + let s=483; + this.max.visible&&(this.max.x=445,s=this.max.x-6),this.val.x=s-this.val.width,en.setLabelWrapWidth(this.lbl,Math.max(80,this.val.x-8-64)); + const i=Math.max(46,Math.ceil(this.lbl.height)+16); + this.lbl.position.set(64,(i-this.lbl.height)/2),this.val.y=(i-this.val.height)/2,this.max.y=(i-17)/2,this.icon.position.set(35,i/2); + let h=i; + return this.caret&&this.desc&&(this.caret.position.set(500,i/2),this.caret.scale.y=t?-1:1,this.desc.visible=t,t&&this.helpKey&&(this.desc.position.set(10,i-4),h=this.desc.y+this.desc.draw(S1(this.helpKey))+10)),this.bg.height=h,this.hitArea=new T(0,0,v1,h),h} + } + ; + e(P1,"StatRow"); + let x1=P1; + const B1=class t extends l{
GuildShopItemRenderer 7 hunks, 63 statements
- super(),Zt(this,"bg"),Zt(this,"lblName",new iG("늑대전사 ",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_18)),Zt(this,"lblHp",new OF("UI_HEART","100",16711680,hD.DEFAULT_OUTLINE_FONT_OPTION_18)),Zt(this,"lblAtk",new OF("UI_MAGIC_WAND","20",39423,hD.DEFAULT_OUTLINE_FONT_OPTION_18)),Zt(this,"lblDef",new OF("UI_PHY_DEFENSE","20",16776960,hD.DEFAULT_OUTLINE_FONT_OPTION_18)),Zt(this,"lblBlock",new OF("ICON_UNIT","0",hD.DEFAULT_COLOR,hD.DEFAULT_OUTLINE_FONT_OPTION_18)),Zt(this,"btnHire",new kF("UI_GEM","고용")),Zt(this,"icon",new c4),Zt(this,"mainContainer",new Ke),Zt(this,"requestPending",!1),this.bg=new hE({ + super(),n(this,"bg"),n(this,"lblName",new to("늑대전사 ",16777215,en.DEFAULT_OUTLINE_FONT_OPTION_18)),n(this,"lblHp",new Il("UI_HEART","100",16711680,en.DEFAULT_OUTLINE_FONT_OPTION_18)),n(this,"lblAtk",new Il("UI_MAGIC_WAND","20",39423,en.DEFAULT_OUTLINE_FONT_OPTION_18)),n(this,"lblDef",new Il("UI_PHY_DEFENSE","20",16776960,en.DEFAULT_OUTLINE_FONT_OPTION_18)),n(this,"lblBlock",new Il("ICON_UNIT","0",en.DEFAULT_COLOR,en.DEFAULT_OUTLINE_FONT_OPTION_18)),n(this,"btnHire",new vl("UI_GEM","고용")),n(this,"icon",new NS),n(this,"petIcon",new GS),n(this,"lblPetInfo",new to("",en.DEFAULT_COLOR,en.DEFAULT_OUTLINE_FONT_OPTION_18)),n(this,"lblRemain",new to("",en.DEFAULT_COLOR,en.DEFAULT_OUTLINE_FONT_OPTION_16)),n(this,"mainContainer",new l),n(this,"requestPending",!1),this.bg=new A({
- ),this.bg.width=630,this.bg.height=80,this.mainContainer.addChild(this.bg),this.icon.hideBackground(),this.icon.x=-1,this.icon.y=.5*(this.bg.height-this.icon.height),this.mainContainer.addChild(this.icon),this.lblName.x=135,this.lblName.y=13,this.mainContainer.addChild(this.lblName),this.lblHp.x=this.lblName.x,this.lblHp.y=this.lblName.y+this.lblName.height+8,this.mainContainer.addChild(this.lblHp),this.lblAtk.x=this.lblHp.x+100,this.lblAtk.y=this.lblHp.y,this.mainContainer.addChild(this.lblAtk),this.lblDef.x=this.lblAtk.x+100,this.lblDef.y=this.lblHp.y,this.mainContainer.addChild(this.lblDef),this.lblBlock.iconScale=1.05,this.lblBlock.x=this.lblDef.x+95,this.lblBlock.y=this.lblHp.y,this.mainContainer.addChild(this.lblBlock),this.btnHire.lbl.iconScale=.8,this.btnHire.color=kF.BROWN,this.btnHire.height=58,this.btnHire.width=120,this.btnHire.x=this.bg.width-this.btnHire.width-10,this.btnHire.y=.5*(this.bg.height-this.btnHire.height),this.mainContainer.addChild(this.btnHire),this.btnHire.on("pointertap",this.onHire,this),this.addChild(this.mainContainer)} + ),this.bg.width=630,this.bg.height=80,this.mainContainer.addChild(this.bg),this.icon.hideBackground(),this.icon.x=-1,this.icon.y=.5*(this.bg.height-this.icon.height),this.mainContainer.addChild(this.icon),this.lblName.x=135,this.lblName.y=13,this.mainContainer.addChild(this.lblName),this.lblHp.x=this.lblName.x,this.lblHp.y=this.lblName.y+this.lblName.height+8,this.mainContainer.addChild(this.lblHp),this.lblAtk.x=this.lblHp.x+100,this.lblAtk.y=this.lblHp.y,this.mainContainer.addChild(this.lblAtk),this.lblDef.x=this.lblAtk.x+100,this.lblDef.y=this.lblHp.y,this.mainContainer.addChild(this.lblDef),this.lblBlock.iconScale=1.05,this.lblBlock.x=this.lblDef.x+95,this.lblBlock.y=this.lblHp.y,this.mainContainer.addChild(this.lblBlock),this.btnHire.lbl.iconScale=.8,this.btnHire.color=vl.BROWN,this.btnHire.height=58,this.btnHire.width=120,this.btnHire.x=this.bg.width-this.btnHire.width-10,this.btnHire.y=.5*(this.bg.height-this.btnHire.height),this.mainContainer.addChild(this.btnHire),this.btnHire.on("pointertap",this.onHire,this),this.petIcon.scale=(this.bg.height-8)/this.petIcon.frameHeight,this.petIcon.x=this.icon.x+.5*(this.icon.width-15-this.petIcon.frameWidth*this.petIcon.scale.x),this.petIcon.y=.5*(this.bg.height-this.petIcon.frameHeight*this.petIcon.scale.y),this.petIcon.visible=!1,this.mainContainer.addChild(this.petIcon),this.lblPetInfo.x=this.lblHp.x,this.lblPetInfo.y=this.lblHp.y,this.lblPetInfo.visible=!1,this.mainContainer.addChild(this.lblPetInfo),this.lblRemain.visible=!1,this.lblRemain.eventMode="none",this.mainContainer.addChild(this.lblRemain),this.addChild(this.mainContainer)} + get item(){ + return this.data} + get remainCount(){ + const t=this.item; + return t.dailyLimit<=0?1/0:Math.max(0,t.dailyLimit-t.purchaseCount)}
- if("guildCoin"===this.data.payType){ - if(OD.myCoins<this.data.medal)return void bH.getInstance().showMessage(NB.getText("GAME_520","길드코인이 부족합니다."))} - else if(TG.gem<this.data.gem)return void bH.getInstance().showMessage(NB.getText("COMMON_352","보석이 부족합니다.")); + var s; + const i=this.item; + if(!i)return; + if(this.remainCount<=0)return void Ku.getInstance().showMessage(Nr.getText("COMMON_342","오늘 더 이상 구매할 수 없습니다.")); + if("guildCoin"===i.costType){ + if(vn.myCoins<i.cost)return void Ku.getInstance().showMessage(Nr.getText("GAME_520","길드코인이 부족합니다."))} + else if("raidCoin"===i.costType&&vn.myRaidCoins<i.cost)return void Ku.getInstance().showMessage(Nr.getText("GAME_1347","레이드 코인이 부족합니다"));
- let i=await sD.getInstance().guild.hireUnit(this.data.kindNum); - if(!i.success||0==i.success)return this.setRequestPending(!1),"NOT_IN_GUILD"===i.error?(AB.getInstance().show(NB.getText("GAME_478","길드원 정보가 변경되었습니다.")+"\n"+NB.getText("COMMON_280","새로고침합니다.")),void roi.getInstance().goMainSubView()):void AB.getInstance().showError(i); - TG.setUserInfo(i.body),OD.myMembershipVO.coin=OD.myCoins=i.body.coin,OD.myMembershipVO.raidCoin=OD.myRaidCoins=i.body.raidCoin,wsi.getInstance().setData(),LH.getInstance().updateGuildCoin(); + let h=await tn.getInstance().guild.hireUnit(i.kindNum,i.type); + if(!h.success||0==h.success)return this.setRequestPending(!1),"NOT_IN_GUILD"===h.error?(Ar.getInstance().show(Nr.getText("GAME_478","길드원 정보가 변경되었습니다.")+"\n"+Nr.getText("COMMON_280","새로고침합니다.")),void uq.getInstance().goMainSubView()):"ALREADY_BOUGHT_TODAY"===h.error?(i.purchaseCount=i.dailyLimit,this.setData(i),void Ku.getInstance().showMessage(Nr.getText("COMMON_342","오늘 더 이상 구매할 수 없습니다."))):void Ar.getInstance().showError(h); + if(Oo.setUserInfo(h.body),vn.myMembershipVO.coin=vn.myCoins=h.body.coin,vn.myMembershipVO.raidCoin=vn.myRaidCoins=h.body.raidCoin,rd.getInstance().updateGuildCoin(),"pet"===i.type){ + void 0!==h.body.purchaseCount&&(i.purchaseCount=Number(h.body.purchaseCount)||0),void 0!==h.body.dailyLimit&&(i.dailyLimit=Number(h.body.dailyLimit)||0),this.setData(i); + const t=(null==(s=h.body.rewardPetInfo)?void 0:s.pieces)??i.amount; + return Ku.getInstance().showMessage(Nr.getValueReplace("GAME_1189","##",t,`펫 조각 ${ + t} + 개를 획득했습니다.`)),void this.setRequestPending(!1)} + wK.getInstance().setData();
- let i=t; + const s=t,i="pet"===s.type; + this.icon.visible=!i,this.lblHp.visible=this.lblAtk.visible=this.lblDef.visible=this.lblBlock.visible=!i,this.petIcon.visible=this.lblPetInfo.visible=i,i?this.setPetData(s):this.setUnitData(s.unit),this.setPriceButton(s),this.updateCache()} + setPetData(t){ + const s=Ht.getInstance(),i=s.getBookVO(t.kindNum),h=s.getPetVO(t.kindNum); + this.petIcon.setPet(t.kindNum,1),this.petIcon.hideStar(),this.lblName.text=Nr.getText(`PET_NAME_${ + t.kindNum} + `,(null==i?void 0:i.name)??""); + const e=Math.max(0,Math.min(5,Number((null==h?void 0:h.grade)??0))); + this.lblPetInfo.text=`${ + Nr.getText("GAME_736","조각")} + x${ + t.amount} + ( ${ + Nr.getText("GAME_850","등급")} + : ${ + e} + , ${ + Nr.getText("GAME_711","펫조각")} + : ${ + (null==h?void 0:h.piece)??0} + )`,this.lblPetInfo.scale.set(1); + const n=this.btnHire.x-10-this.lblPetInfo.x,o=Math.min(1,n/this.lblPetInfo.width); + this.lblPetInfo.scale.set(o),this.lblPetInfo.y=this.lblHp.y+.5*(this.lblPetInfo.height/o-this.lblPetInfo.height)} + setPriceButton(t){ + "raidCoin"===t.costType?this.btnHire.lbl.texture=nt.getTexture("UI_Ekkorr","RaidCoin_on"):this.btnHire.lbl.texture=nt.getTexture("UI_Ekkorr","GUILD_COIN"),this.btnHire.text=`${ + t.cost} + `; + const s=this.remainCount; + this.btnHire.activated=s>0,this.lblRemain.visible=t.dailyLimit>0,this.lblRemain.visible&&(this.btnHire.textOffsetY=-9,this.lblRemain.text=`${ + s} + /${ + t.dailyLimit} + `,this.lblRemain.textColor=s>0?en.DEFAULT_COLOR:16737894,this.lblRemain.x=this.btnHire.x+.5*(this.btnHire.width-this.lblRemain.width),this.lblRemain.y=this.btnHire.y+.5*this.btnHire.height+3)} + setUnitData(t){
- `,i.dmgType==$x.MAGICAL?this.lblAtk.texture=RS.getTexture("UI_Ekkorr","ICON_ATTACK2"):this.lblAtk.texture=RS.getTexture("UI_Ekkorr","UI_SWORD"),"guildCoin"===i.payType?(this.btnHire.lbl.texture=RS.getTexture("UI_Ekkorr","GUILD_COIN"),this.btnHire.text=`${ - i.medal} - `):(this.btnHire.lbl.texture=RS.getTexture("UI_Ekkorr","UI_GEM"),this.btnHire.text=`${ - i.gem} - `),this.updateCache()} + `,t.dmgType==Lt.MAGICAL?this.lblAtk.texture=nt.getTexture("UI_Ekkorr","ICON_ATTACK2"):this.lblAtk.texture=nt.getTexture("UI_Ekkorr","UI_SWORD")}
- t>=this.btnHire.x-10||this.data&&GQt.getInstance().showInBook(this.data.kindNum,BQt.guild)} + t>=this.btnHire.x-10||this.data&&"pet"!==this.item.type&&kN.getInstance().showInBook(this.data.kindNum,GN.guild)}
FriendService 1 hunks, 58 statements
+ const kh=class extends Zi{ + async getInfo(t=!1){ + return this.post(yi.FRIEND.GET_INFO,{ + } + ,t)} + async getPending(){ + return this.post(yi.FRIEND.GET_PENDING,{ + } + ,!1)} + async request(t){ + return this.post(yi.FRIEND.REQUEST,{ + code:t} + ,!0)} + async accept(t){ + return this.post(yi.FRIEND.ACCEPT,{ + uid:t} + ,!0)} + async reject(t){ + return this.post(yi.FRIEND.REJECT,{ + uid:t} + ,!0)} + async remove(t){ + return this.post(yi.FRIEND.REMOVE,{ + uid:t} + ,!0)} + async block(t){ + return this.post(yi.FRIEND.BLOCK,{ + uid:t} + ,!0)} + async unblock(t){ + return this.post(yi.FRIEND.UNBLOCK,{ + uid:t} + ,!0)} + async resetCode(){ + return this.post(yi.FRIEND.RESET_CODE,{ + } + ,!0)} + async getRecent(){ + return this.post(yi.FRIEND.GET_RECENT,{ + } + ,!1)} + } + ; + e(kh,"FriendService"); + let Gh=kh; + const Lh=class extends Zi{ + async getState(t=!1,s=!1){ + return this.post(yi.PROFILE_DECO.GET_STATE,{ + full:s} + ,t)} + async save(t,s,i){ + return this.post(yi.PROFILE_DECO.SAVE,{ + faces:t,frames:s,rep:i} + ,!0)} + } + ; + e(Lh,"ProfileDecoService"); + let Dh=Lh;
GuildWarBattleController 8 hunks, 53 statements
+ const YG="GW_BG2",zG=["GW_BG_Human","GW_BG_Elf","GW_BG_Undead","GW_BG_Orc"]; + function XG(t){ + if(t>=5&&t<=12){ + const s=(t-5)%2==1,i=s?"v":"h"; + return{ + sheet:zG[Math.floor((t-5)/2)],bg:`bg_${ + i} + `,mask:`mask_${ + i} + `,vertical:s} + } + const s=t>=1&&t<=4?t:1; + return{ + sheet:YG,bg:`gwbg${ + s} + `,mask:`mask${ + s} + `,vertical:2===s||3===s} + } + function jG(t,s){ + return t>=1&&t<=4?2*t+(s?4:3):0} + e(XG,"battleMapDef"),e(jG,"tribeMapIndex"); + const qG={ + a1:3,a2:4,a3:1,a4:2,b1:1,b2:2,b3:3,b4:4,c1:2,c2:3,c3:1,c4:4,c5:2,c6:3,c7:1,c8:4} + ; + function QG(t,s,i,h){ + const e=Math.min(Math.max(h,0),.999999); + if("s"===t)return i?5+Math.floor(8*e):1+Math.floor(4*e); + const n=qG[t]??1; + return i&&jG(s,2===n||3===n)||n} + e(QG,"pickBattleMapIndex");
- super(),Zt(this,"battleType",b$.GUILD_WAR),Zt(this,"currentAllyOffsets",[]),Zt(this,"currentEnemyOffsets",[]),Zt(this,"battleMode",1),Zt(this,"mapIndex",1),Zt(this,"zoomLevel",.7),Zt(this,"prevGameScale",1),Zt(this,"prevGameX",0),Zt(this,"prevGameY",0),Zt(this,"prevBackgroundVisible",!0),Zt(this,"prevZoomEnabled",!0),Zt(this,"hasViewStateBackup",!1),Zt(this,"heroKindNums",[60,58,78,54,56]),Zt(this,"soldierKindNums",[1,4,7,20,13]),Zt(this,"enemyHeroKindNums",[78,78,78,78,78]),Zt(this,"enemySoldierKindNums",[20,9,14,8,21]),Zt(this,"allyCorpSoldierTiers",[null,null,null,null,null]),Zt(this,"enemyCorpSoldierTiers",[null,null,null,null,null]),Zt(this,"allyTacticBonuses",null),Zt(this,"allyHeroLevels",null),Zt(this,"allySoldierLevels",null),Zt(this,"enemyHeroLevels",null),Zt(this,"enemySoldierLevels",null),Zt(this,"allyKnightLevel",1),Zt(this,"enemyKnightLevel",1),Zt(this,"allyHeroTrans",null),Zt(this,"enemyHeroTrans",null),Zt(this,"allyTransPoints",null),Zt(this,"enemyTransPoints",null),Zt(this,"allyPetBuffs",null),Zt(this,"enemyPetBuffs",null),Zt(this,"enemyHeroLevelBonus",0),Zt(this,"allyHeroLevelBonus",0),Zt(this,"onComplete",null),Zt(this,"onAfterReturnToIdle",null),Zt(this,"lastReward",{ + super(),n(this,"battleType",Fc.GUILD_WAR),n(this,"currentAllyOffsets",[]),n(this,"currentEnemyOffsets",[]),n(this,"battleMode",1),n(this,"mapIndex",1),n(this,"mapDef",XG(1)),n(this,"zoomLevel",.7),n(this,"prevGameScale",1),n(this,"prevGameX",0),n(this,"prevGameY",0),n(this,"prevBackgroundVisible",!0),n(this,"prevZoomEnabled",!0),n(this,"hasViewStateBackup",!1),n(this,"heroKindNums",[60,58,78,54,56]),n(this,"soldierKindNums",[1,4,7,20,13]),n(this,"enemyHeroKindNums",[78,78,78,78,78]),n(this,"enemySoldierKindNums",[20,9,14,8,21]),n(this,"allyCorpSoldierTiers",[null,null,null,null,null]),n(this,"enemyCorpSoldierTiers",[null,null,null,null,null]),n(this,"allyTacticBonuses",null),n(this,"allyHeroLevels",null),n(this,"allySoldierLevels",null),n(this,"enemyHeroLevels",null),n(this,"enemySoldierLevels",null),n(this,"allyKnightLevel",1),n(this,"enemyKnightLevel",1),n(this,"allyHeroTrans",null),n(this,"enemyHeroTrans",null),n(this,"allyTransPoints",null),n(this,"enemyTransPoints",null),n(this,"allyPetBuffs",null),n(this,"enemyPetBuffs",null),n(this,"enemyHeroLevelBonus",0),n(this,"allyHeroLevelBonus",0),n(this,"onComplete",null),n(this,"onAfterReturnToIdle",null),n(this,"lastReward",{
- this.mapIndex=t,this.battleMode=2===t||3===t?2:1} + this.mapIndex=t,this.battleMode=XG(t).vertical?2:1} + async prepareMap(){ + const t=XG(this.mapIndex); + return t.sheet===YG||nt.hasSheet(t.sheet)||await nt.generateTexture(t.sheet,"ktx2",!1).catch(()=>null)?t:XG(t.vertical?2:1)} + preloadMap(t){ + const s=XG(t); + s.sheet===YG||nt.hasSheet(s.sheet)||nt.generateTexture(s.sheet,"ktx2",!1).catch(()=>null)} + setTerrainOverlayVisible(t){ + this.terrainOverlay&&(this.terrainOverlay.visible=t)}
- const i=t.FIELD_WIDTH,s=t.FIELD_HEIGHT,e=2===this.battleMode,n=1/B1.CELL_SIZE,h=`mask${ - this.mapIndex} - `,r=RS.getTexture("GW_BG2",h); + const s=t.FIELD_WIDTH,i=t.FIELD_HEIGHT,h=2===this.battleMode,e=1/om.CELL_SIZE,n=this.mapDef.mask,o=nt.getTexture(this.mapDef.sheet,n);
- this.cleanup(),this.lastReward={ + const i=await this.prepareMap(); + this.cleanup(),this.mapDef=i,this.lastReward={
- this.currentAllyOffsets=[...s],this.currentEnemyOffsets=[...s],this.battleEnded=!1,this.battleResult=null,this.battleTime=0,this.killCount=0,this.captureViewState(); - const e=2===this.battleMode,n=`gwbg${ - this.mapIndex} - `; - MU.getInstance().setMapBackground("GW_BG2",n),MU.getInstance().visible=!0,pfi.zoomEnabled=!1,await this.setupTestTerrain(); + this.currentAllyOffsets=[...h],this.currentEnemyOffsets=[...h],this.battleEnded=!1,this.battleResult=null,this.battleTime=0,this.killCount=0,this.captureViewState(); + const e=2===this.battleMode,n=this.mapDef.sheet,o=this.mapDef.bg; + ga.getInstance().setMapBackground(n,o),ga.getInstance().visible=!0,B2.zoomEnabled=!1,await this.setupTestTerrain();
- this.setupEnemyLists(),this.snapUnitsToTerrain(),this.initialAllyCount=this.friendList.length,this.initialEnemyCount=this.enemyList.length,zui.getInstance().switchToBattle(this),MU.getInstance().setMapBackground("GW_BG2",n),MU.getInstance().visible=!0,pfi.zoomEnabled=!1,this.applyZoom(),this.updateZIndexSorting(),this.enterGuildWarSpeed(),this.setupDamageMeter(),this.setupAliveCounter(),nU.getInstance().remove(this.execute,this),await this.playStartCountdown(),nU.getInstance().add(this.execute,this),nU.getInstance().add(this.clampHeroPosition,this)} + this.setupEnemyLists(),this.snapUnitsToTerrain(),this.initialAllyCount=this.friendList.length,this.initialEnemyCount=this.enemyList.length,J0.getInstance().switchToBattle(this),ga.getInstance().setMapBackground(n,o),ga.getInstance().visible=!0,B2.zoomEnabled=!1,this.applyZoom(),this.updateZIndexSorting(),this.enterGuildWarSpeed(),this.setupDamageMeter(),this.setupAliveCounter(),sa.getInstance().remove(this.execute,this),await this.playStartCountdown(),sa.getInstance().add(this.execute,this),sa.getInstance().add(this.clampHeroPosition,this)}
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
CastleAutoController 8 hunks, 48 statements
- Zt(this,"frameCount",0),Zt(this,"frameRegistered",!1),Zt(this,"_enabled",!1)} + n(this,"frameCount",0),n(this,"frameRegistered",!1),n(this,"_enabled",!1),n(this,"loadPromise",null),n(this,"touched",!1),n(this,"lastFlushAt",0)}
- async loadSetting(){ - const i=await yS.getCastleAutoEnabled(); - TG.maxWave<t.UNLOCK_WAVE?this._enabled=!1:(this._enabled=!0===i,this._enabled&&this.startTimer())} + loadSetting(){ + return this.loadPromise||(this.loadPromise=j.getCastleAutoEnabled().then(s=>{ + this.touched||(Oo.maxWave<t.UNLOCK_WAVE?this._enabled=!1:(this._enabled=!0===s,this._enabled&&this.startTimer()))} + )),this.loadPromise}
- this._enabled!==t&&(this._enabled=t,yS.setCastleAutoEnabled(t),t?(this.startTimer(),this.tick()):this.stopTimer())} + this.touched=!0,this._enabled!==t&&(this._enabled=t,j.setCastleAutoEnabled(t),t?(this.startTimer(),this.tick()):this.stopTimer())}
- return sP.getInstance().bookList.filter(t=>1==t.type)} + return js.getInstance().bookList.filter(t=>1==t.type).sort((t,s)=>Number(1===s.kindNum)-Number(1===t.kindNum))}
- const s=TG.gold*(1-t.SPEND_RATIO_PER_TICK); - let e=!1; + const i=CS.getInstance(),h=js.getInstance().castleVO,e=s.map(t=>1===t.kindNum?{ + level:h.level,maxLevel:i.getMaxLevel(5)} + :{ + level:t.level,maxLevel:t.maxLv} + ),n=s.map(t=>1===t.kindNum?(t,s)=>i.getTotalGold(t,s):(s,i)=>t.getTotalCost(s,i)),o=xy(e,.5*Oo.gold,n); + let r=0;
- t<20&&this.buyNext(i,s); - t++)e=!0; - e&&(LH.getInstance().updateGold(),lui.getInstance().setData(),Uli.markDirtyAndSchedule())} - buyNext(t,i){ - const s=TG.gold-i; - if(s<=0)return!1; - for(const e of t)if(1===e.kindNum){ - if(this.buyCastle(e,s))return!0} - else if(this.buyUpgrade(e,s))return!0; - return!1} - buyCastle(t,i){ - const s=r4.getInstance(),e=sP.getInstance().castleVO,n=s.getMaxLevel(5); - if(e.level>=n)return!1; - if(i<s.getTotalGold(e.level,e.level+1))return!1; - let h=e.level+1,r=n; - for(; - h<r; - ){ - const t=h+Math.ceil((r-h)/2); - s.getTotalGold(e.level,t)<=i?h=t:r=t-1} - const o=s.getTotalGold(e.level,h); - return TG.gold-=o,t.level=h,e.level=h,pfi.getInstance().udpateHero(e),!0} - buyUpgrade(t,i){ - if(t.level>=t.maxLv)return!1; - if(i<t.getTotalCost(t.level,t.level+1))return!1; - let s=t.level+1,e=t.maxLv; - for(; - s<e; - ){ - const n=s+Math.ceil((e-s)/2); - t.getTotalCost(t.level,n)<=i?s=n:e=n-1} - const n=t.getTotalCost(t.level,s); - TG.gold-=n,t.level=s; + t<s.length; + t++){ + const i=e[t].level,h=o[t]; + h<=i||(r+=n[t](i,h),1===s[t].kindNum?this.applyCastleLevel(s[t],h):this.applyUpgrade(s[t],h))} + if(r>0){ + Oo.gold-=r,rd.getInstance().updateGold(),p0.getInstance().setData(),VZ.markDirtyAndSchedule(); + const s=Date.now(); + 0===this.lastFlushAt&&(this.lastFlushAt=s),s-this.lastFlushAt>=t.FLUSH_MS&&(this.lastFlushAt=s,VZ.cleanup())} + } + applyCastleLevel(t,s){ + const i=js.getInstance().castleVO; + t.level=s,i.level=s,B2.getInstance().udpateHero(i)} + applyUpgrade(t,s){ + t.level=s;
- return h&&(2==t.kindNum?(h.setPlayerAtkRange(t.value),FF.getInstance().setRange()):3==t.kindNum?h.setPlayerAtkDuration(t.value):4==t.kindNum?h.setPlayerNumShot(t.value):5==t.kindNum&&h.setPlayerNumBounce(t.value)),!0} + i&&(2==t.kindNum?(i.setPlayerAtkRange(t.value),xl.getInstance().setRange()):3==t.kindNum?i.setPlayerAtkDuration(t.value):4==t.kindNum?i.setPlayerNumShot(t.value):5==t.kindNum&&i.setPlayerNumBounce(t.value))}
- Qt(Fli,"CastleAutoController"),Zt(Fli,"instance"),Zt(Fli,"TICK_FRAMES",180),Zt(Fli,"SPEND_RATIO_PER_TICK",.5),Zt(Fli,"UNLOCK_WAVE",100); + e(KZ,"CastleAutoController"),n(KZ,"instance"),n(KZ,"TICK_FRAMES",180),n(KZ,"UNLOCK_WAVE",100),n(KZ,"FLUSH_MS",15e3);
CheckBox 2 hunks, 47 statements
- const v$=m$.getInstance(),_$=class t extends Ke{ + const kc=Nc.getInstance(),Gc=class extends l{ + constructor(){ + super(),n(this,"bg"),n(this,"check"),n(this,"customHitArea"),n(this,"customHitAreaOffset",15),n(this,"colorMatrix"),n(this,"onClick"),n(this,"_selected",!0),this.bg=new A({ + texture:nt.getTexture("UI_Ekkorr","Base_Tooltip"),leftWidth:6,topHeight:6,rightWidth:6,bottomHeight:6} + ),this.bg.width=this.bg.height=24,this.bg.eventMode="none",this.addChild(this.bg),this.check=new u(nt.getTexture("UI_Ekkorr","Icon_Check_Green")),this.check.scale=.85,this.check.eventMode="none",this.check.x=.5*(this.bg.width-this.check.width)+2,this.check.y=this.bg.height-this.check.height-4,this.addChild(this.check),this.customHitArea=new u(nt.getTexture("UI_Ekkorr","Base_Tooltip")),this.customHitArea.tint=1708562,this.customHitArea.alpha=.1,this.customHitArea.x=-this.customHitAreaOffset,this.customHitArea.y=-this.customHitAreaOffset,this.customHitArea.width=this.bg.width+2*this.customHitAreaOffset,this.customHitArea.height=this.bg.height+2*this.customHitAreaOffset,this.addChildAt(this.customHitArea,0),this.customHitArea.eventMode="dynamic",this.customHitArea.on("pointertap",this.onTap,this),this.selected=!1,this.colorMatrix=new S,this.colorMatrix.blackAndWhite(!0)} + onTap(t){ + this.selected=!this._selected,jo.getInstance().playSFX(jo.SFX_NORMAL_CLICK),null!=this.onClick&&this.onClick(this._selected)} + get selected(){ + return this._selected} + set selected(t){ + t!=this._selected&&(this._selected=t,this.check.visible=this._selected)} + get width(){ + return this.bg.width} + get height(){ + return this.bg.height} + setCustomHitAreaSize(t,s){ + this.customHitArea.width=t+2*this.customHitAreaOffset,this.customHitArea.height=s+2*this.customHitAreaOffset} + setGrayScale(t){ + this.bg.filters=t?[this.colorMatrix]:[]} + } + ; + e(Gc,"CheckBox"); + let Lc=Gc; + const Dc=class t extends l{
- constructor(){ - super(),Zt(this,"bg"),Zt(this,"check"),Zt(this,"customHitArea"),Zt(this,"customHitAreaOffset",15),Zt(this,"colorMatrix"),Zt(this,"onClick"),Zt(this,"_selected",!0),this.bg=new hE({ - texture:RS.getTexture("UI_Ekkorr","Base_Tooltip"),leftWidth:6,topHeight:6,rightWidth:6,bottomHeight:6} - ),this.bg.width=this.bg.height=24,this.bg.eventMode="none",this.addChild(this.bg),this.check=new Xe(RS.getTexture("UI_Ekkorr","Icon_Check_Green")),this.check.scale=.85,this.check.eventMode="none",this.check.x=.5*(this.bg.width-this.check.width)+2,this.check.y=this.bg.height-this.check.height-4,this.addChild(this.check),this.customHitArea=new Xe(RS.getTexture("UI_Ekkorr","Base_Tooltip")),this.customHitArea.tint=1708562,this.customHitArea.alpha=.1,this.customHitArea.x=-this.customHitAreaOffset,this.customHitArea.y=-this.customHitAreaOffset,this.customHitArea.width=this.bg.width+2*this.customHitAreaOffset,this.customHitArea.height=this.bg.height+2*this.customHitAreaOffset,this.addChildAt(this.customHitArea,0),this.customHitArea.eventMode="dynamic",this.customHitArea.on("pointertap",this.onTap,this),this.selected=!1,this.colorMatrix=new Ef,this.colorMatrix.blackAndWhite(!0)} - onTap(t){ - this.selected=!this._selected,QG.getInstance().playSFX(QG.SFX_NORMAL_CLICK),null!=this.onClick&&this.onClick(this._selected)} - get selected(){ - return this._selected} - set selected(t){ - t!=this._selected&&(this._selected=t,this.check.visible=this._selected)} - get width(){ - return this.bg.width} - get height(){ - return this.bg.height} - setCustomHitAreaSize(t,i){ - this.customHitArea.width=t+2*this.customHitAreaOffset,this.customHitArea.height=i+2*this.customHitAreaOffset} - setGrayScale(t){ - this.bg.filters=t?[this.colorMatrix]:[]} - } - ; - Qt(qjt,"CheckBox"); - let Xjt=qjt; - const Jjt=class extends Ke{
Timer 1 hunks, 33 statements
- const xx=class extends EventTarget{ - constructor(t,i=-1){ - super(),Zt(this,"_currentCount",0),Zt(this,"timerEvent"),Zt(this,"_running",!1),Zt(this,"_prevTime",0),Zt(this,"delay"),Zt(this,"repeatCount"),Zt(this,"data"),this.delay=t,this.repeatCount=i,this.timerEvent=new Event("timer")} - start(){ - this._running||(this._currentCount=0,this._prevTime=performance.now(),this._running=!0,wE.getInstance().add(this.update,this))} - update(){ - if(!this._running)return; - const t=performance.now(); - if(t-this._prevTime>=this.delay){ - if(this._currentCount++,this.dispatchEvent(this.timerEvent),this.repeatCount>0&&this._currentCount>=this.repeatCount)return void this.stop(); - this._prevTime=t} - } - stop(){ - this._running&&(this._running=!1,wE.getInstance().remove(this.update,this))} - reset(){ - this.stop(),this.start()} - get currentCount(){ - return this._currentCount} - get running(){ - return this._running} - addEventListener(t,i,s){ - super.addEventListener(t,i,s)} - removeEventListener(t,i,s){ - super.removeEventListener(t,i,s)} - } - ; - Qt(xx,"Timer"); - let Rx=xx; - const Px=Object.freeze(Object.defineProperty({ - __proto__:null,BackgroundStage:NS,BaseFrameController:fE,BaseLayer:WS,BaseListItem:kx,BaseShape:Ax,Box:Tx,EkkorrGame:FS,EventDispatcher:jS,List:Ox,StageManager:SS,Timer:Rx,UIFrameController:wE} - ,Symbol.toStringTag,{ - value:"Module"} - ));
URLManager 1 hunks, 32 statements
+ static get FRIEND(){ + return{ + GET_INFO:`${ + t.baseURL} + /friend/getInfo`,GET_PENDING:`${ + t.baseURL} + /friend/getPending`,REQUEST:`${ + t.baseURL} + /friend/request`,ACCEPT:`${ + t.baseURL} + /friend/accept`,REJECT:`${ + t.baseURL} + /friend/reject`,REMOVE:`${ + t.baseURL} + /friend/remove`,BLOCK:`${ + t.baseURL} + /friend/block`,UNBLOCK:`${ + t.baseURL} + /friend/unblock`,RESET_CODE:`${ + t.baseURL} + /friend/resetCode`,GET_RECENT:`${ + t.baseURL} + /friend/getRecent`} + } + static get PROFILE_DECO(){ + return{ + GET_STATE:`${ + t.baseURL} + /profileDeco/getState`,SAVE:`${ + t.baseURL} + /profileDeco/save`} + }
FriendManager 1 hunks, 25 statements
- )); + )),Mv=class t{ + static get unlocked(){ + return Oo.maxWave>=t.UNLOCK_WAVE} + static get hasRedDot(){ + return t.unlocked&&t.pending>0} + static pollPending(s=!1){ + if(!t.unlocked||t.polling)return; + const i=Date.now(); + !s&&i-t.lastPollAt<t.POLL_MS||(t.lastPollAt=i,t.polling=!0,tn.getInstance().friend.getPending().then(s=>{ + var i; + (null==s?void 0:s.success)&&"number"==typeof(null==(i=s.body)?void 0:i.requests)&&(t.pending=s.body.requests)} + ).catch(()=>{ + } + ).finally(()=>t.polling=!1))} + static async load(s=!1){ + const i=await tn.getInstance().friend.getInfo(s); + return t.apply(i)} + static apply(s){ + var i; + const h=(null==s?void 0:s.success)?null==(i=s.body)?void 0:i.info:void 0; + return h?(t.info=h,t.pending=h.requests.length,t.lastPollAt=Date.now(),h):null} + } + ; + e(Mv,"FriendManager"),n(Mv,"UNLOCK_WAVE",50),n(Mv,"POLL_MS",3e5),n(Mv,"info",null),n(Mv,"pending",0),n(Mv,"lastPollAt",0),n(Mv,"polling",!1); + let gv=Mv;
LanguageManager 5 hunks, 23 statements
- if(this.debug("LanguageManager, load()"),this.debug(" -> 1) lang : "+t),this.loadCallback=i,0==this.isLanguageCodeEnum(t)&&(t="en"),this.debug(" -> 2) lang : "+t),this.debug(" -> this._language : "+this._language),t!=this._language){ + var i; + if(this.debug("LanguageManager, load()"),this.debug(" -> 1) lang : "+t),this.loadCallback=s,0==this.isLanguageCodeEnum(t)&&(t="en"),this.debug(" -> 2) lang : "+t),this.debug(" -> this._language : "+this._language),t==this._language)return void this.onLoadCallback(!0);
+ const h=window.gameLocaleInfo,e=null==(i=null==h?void 0:h.files)?void 0:i[t]; + if(null==e?void 0:e.fileName)try{ + const s=`${ + h.baseUrl} + /${ + e.fileName} + `; + this.debug(" -> cdnUrl : "+s); + const i=await fetch(s); + if(i.ok){ + const s=await i.json(); + return void(await this.applyLanguagePack(t,s))} + this.debug(" -> CDN locale 응답 오류, 로컬 fallback : "+i.status)} + catch(n){ + }
- const e=await s.json(); - this.objLangJson=e,this.objLangJson._version_=CS.appVersion,this.objLangJson._language_=t,this._language=t,await yS.saveLocalLanguage(t),await yS.saveLanguagePack(this.objLangJson),this.onLoadCallback(!0)} + const h=await i.json(),n=!e; + await this.applyLanguagePack(t,h,n)}
- else this.onLoadCallback(!0)} + static async applyLanguagePack(t,s,i=!0){ + this.objLangJson=s,this.objLangJson._version_=tt.appVersion,this.objLangJson._language_=t,this._language=t,await j.saveLocalLanguage(t),i&&await j.saveLanguagePack(this.objLangJson),this.onLoadCallback(!0)}
- case"INSUFFICIENT_HONOR_COIN":case"LACK_OF_HONOR_COIN":s=t.getText("GAME_194","명예코인이 부족합니다."); - break;
ShortcutManager 21 hunks, 21 statements
- ,void 0),{ + ,void 0,import.meta.url),{
- ,void 0); + ,void 0,import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
- ,void 0),{ + ,void 0,import.meta.url),{
- ,void 0); + ,void 0,import.meta.url);
- ,void 0),{ + ,void 0,import.meta.url),{
- ,void 0); + ,void 0,import.meta.url);
- ,void 0),{ + ,void 0,import.meta.url),{
- ,void 0); + ,void 0,import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
- ,void 0),{ + ,void 0,import.meta.url),{
- ,void 0); + ,void 0,import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
- =await Promise.resolve().then(()=>Y_i); + =await import("./chunks/EventHubPopup.js");
- ,void 0); + ,__vite__mapDeps([26,1,0,2,4,5]),import.meta.url);
- =await Promise.resolve().then(()=>hMi); + =await import("./chunks/AttendEventPopup.js");
- ,void 0); + ,__vite__mapDeps([27,1,0,2,4,5]),import.meta.url);
RightMenu 9 hunks, 21 statements
- super(),Zt(this,"btnSetting"),Zt(this,"btnMail"),Zt(this,"btnEventSchedule"),Zt(this,"indicator"),Zt(this,"indicatorArea"),Zt(this,"bg"),Zt(this,"container"),Zt(this,"btnRanking"),Zt(this,"btnAchieve"),Zt(this,"btnPass"),Zt(this,"btnGuild"),Zt(this,"btnPet"),Zt(this,"btnInventory"),Zt(this,"btnDaily"),Zt(this,"btnMine"),Zt(this,"btnTournament"),Zt(this,"menuXoffset",2),Zt(this,"_opened",!1),Zt(this,"count",0),Zt(this,"onPetDataChangeBind"),Zt(this,"countUtc0",0),Zt(this,"onReviveBind"),Zt(this,"onMailChangeBind"),Zt(this,"onPaymentSuccessBind"),Zt(this,"onAchieveStatusBind"),Zt(this,"onPassStatusBind"),Zt(this,"onGuildInfoUpdateBind"),Zt(this,"petPoint",new Ai),Zt(this,"petPointInitialized",!1),Zt(this,"guildPoint",new Ai),Zt(this,"guildPointInitialized",!1),Zt(this,"indicatorRedDot"),this.btnSetting=new HU("UI_Ekkorr","Btn_Setting"),this.btnSetting.x=-this.btnSetting.width-10+this.menuXoffset,this.btnSetting.y=-13,this.addChild(this.btnSetting),this.btnMail=new HU("UI_Ekkorr","Btn_Mailbox"),this.btnMail.x=this.btnSetting.x-this.btnMail.width+this.menuXoffset,this.btnMail.y=-13,this.addChild(this.btnMail),this.btnEventSchedule=new HU("UI_Ekkorr","Btn_EventSchedule"),this.btnEventSchedule.x=this.btnMail.x-this.btnEventSchedule.width+this.menuXoffset,this.btnEventSchedule.y=-13,this.addChild(this.btnEventSchedule),this.btnSetting.onClick=this.onSettingBtnClick.bind(this),this.btnMail.onClick=this.onMailBtnClick.bind(this),this.btnEventSchedule.onClick=this.onEventScheduleBtnClick.bind(this),this.container=new Ke,this.container.x=-40,this.container.y=this.btnSetting.y+this.btnSetting.height-5,this.addChild(this.container),this.bg=new hE({ + super(),n(this,"btnSetting"),n(this,"btnMail"),n(this,"btnEventSchedule"),n(this,"indicator"),n(this,"indicatorArea"),n(this,"bg"),n(this,"container"),n(this,"btnRanking"),n(this,"btnAchieve"),n(this,"btnPass"),n(this,"btnGuild"),n(this,"btnPet"),n(this,"btnInventory"),n(this,"btnDaily"),n(this,"btnMine"),n(this,"btnTournament"),n(this,"btnFriend"),n(this,"menuXoffset",2),n(this,"_opened",!1),n(this,"count",0),n(this,"onPetDataChangeBind"),n(this,"countUtc0",0),n(this,"onReviveBind"),n(this,"onMailChangeBind"),n(this,"onPaymentSuccessBind"),n(this,"onAchieveStatusBind"),n(this,"onPassStatusBind"),n(this,"onGuildInfoUpdateBind"),n(this,"petPoint",new M),n(this,"petPointInitialized",!1),n(this,"guildPoint",new M),n(this,"guildPointInitialized",!1),n(this,"indicatorRedDot"),this.btnSetting=new Ua("UI_Ekkorr","Btn_Setting"),this.btnSetting.x=-this.btnSetting.width-10+this.menuXoffset,this.btnSetting.y=-13,this.addChild(this.btnSetting),this.btnMail=new Ua("UI_Ekkorr","Btn_Mailbox"),this.btnMail.x=this.btnSetting.x-this.btnMail.width+this.menuXoffset,this.btnMail.y=-13,this.addChild(this.btnMail),this.btnEventSchedule=new Ua("UI_Ekkorr","Btn_EventSchedule"),this.btnEventSchedule.x=this.btnMail.x-this.btnEventSchedule.width+this.menuXoffset,this.btnEventSchedule.y=-13,this.addChild(this.btnEventSchedule),this.btnSetting.onClick=this.onSettingBtnClick.bind(this),this.btnMail.onClick=this.onMailBtnClick.bind(this),this.btnEventSchedule.onClick=this.onEventScheduleBtnClick.bind(this),this.container=new l,this.container.x=-40,this.container.y=this.btnSetting.y+this.btnSetting.height-5,this.addChild(this.container),this.bg=new A({
- ),this.container.addChild(this.bg),this.indicator=new Xe(RS.getTexture("UI_Ekkorr","UI_Menu_Open")),this.indicator.x=this.bg.x+15,this.indicator.y=this.bg.y+21,this.container.addChild(this.indicator),this.indicatorArea=new Xe(RS.getTexture("UI_Ekkorr","whiteRect")),this.indicatorArea.alpha=.01,this.indicatorArea.width=this.indicator.width+30,this.indicatorArea.height=this.indicator.height+20,this.indicatorArea.x=this.indicator.x-15,this.indicatorArea.y=this.indicator.y-10,this.container.addChild(this.indicatorArea),this.indicatorArea.eventMode="dynamic",this.indicatorArea.on("pointertap",this.onIndicatorTap,this),this.btnRanking=new HU("UI_Ekkorr","Icon_Ranking"),this.btnAchieve=new HU("UI_Ekkorr","Btn_Achieve"),this.btnPass=new HU("UI_Ekkorr","Btn_Pass"),this.btnGuild=new HU("UI_Ekkorr","Btn_Guild"),this.btnPet=new HU("UI_Ekkorr","Icon_Pet"),this.btnInventory=new HU("UI_Ekkorr","Icon_Inventory"),this.btnDaily=new HU("UI_Ekkorr","Icon_Daily"),this.btnMine=new HU("UI_Ekkorr","Btn_Event"),this.btnTournament=new HU("UI_Ekkorr","Icon_Tournament"),this.btnRanking.onClick=this.onRankingBtnClick.bind(this),this.btnAchieve.onClick=this.onAchieveBtnClick.bind(this),this.btnPass.onClick=this.onPassBtnClick.bind(this),this.btnGuild.onClick=this.onGuildBtnClick.bind(this),this.btnPet.onClick=this.onPetBtnClick.bind(this),this.btnInventory.onClick=this.onInventoryBtnClick.bind(this),this.btnDaily.onClick=this.onDailyBtnClick.bind(this),this.btnMine.onClick=this.onMineBtnClick.bind(this),this.btnTournament.onClick=this.onTournamentBtnClick.bind(this),this.update(),this.on("added",this.onAdded,this),this.on("removed",this.onRemoved,this),TXt.getInstance().registerRightMenuIndicatorButtonGetter(t=>"indicatorArea"===t&&this.indicatorArea.visible?{ + ),this.container.addChild(this.bg),this.indicator=new u(nt.getTexture("UI_Ekkorr","UI_Menu_Open")),this.indicator.x=this.bg.x+15,this.indicator.y=this.bg.y+21,this.container.addChild(this.indicator),this.indicatorArea=new u(nt.getTexture("UI_Ekkorr","whiteRect")),this.indicatorArea.alpha=.01,this.indicatorArea.width=this.indicator.width+30,this.indicatorArea.height=this.indicator.height+20,this.indicatorArea.x=this.indicator.x-15,this.indicatorArea.y=this.indicator.y-10,this.container.addChild(this.indicatorArea),this.indicatorArea.eventMode="dynamic",this.indicatorArea.on("pointertap",this.onIndicatorTap,this),this.btnRanking=new Ua("UI_Ekkorr","Icon_Ranking"),this.btnAchieve=new Ua("UI_Ekkorr","Btn_Achieve"),this.btnPass=new Ua("UI_Ekkorr","Btn_Pass"),this.btnGuild=new Ua("UI_Ekkorr","Btn_Guild"),this.btnPet=new Ua("UI_Ekkorr","Icon_Pet"),this.btnInventory=new Ua("UI_Ekkorr","Icon_Inventory"),this.btnDaily=new Ua("UI_Ekkorr","Icon_Daily"),this.btnMine=new Ua("UI_Ekkorr","Btn_Event"),this.btnTournament=new Ua("UI_Ekkorr","Icon_Tournament"),this.btnFriend=new Ua("UI_Ekkorr","Btn_Friend"),this.btnRanking.onClick=this.onRankingBtnClick.bind(this),this.btnAchieve.onClick=this.onAchieveBtnClick.bind(this),this.btnPass.onClick=this.onPassBtnClick.bind(this),this.btnGuild.onClick=this.onGuildBtnClick.bind(this),this.btnPet.onClick=this.onPetBtnClick.bind(this),this.btnInventory.onClick=this.onInventoryBtnClick.bind(this),this.btnDaily.onClick=this.onDailyBtnClick.bind(this),this.btnMine.onClick=this.onMineBtnClick.bind(this),this.btnTournament.onClick=this.onTournamentBtnClick.bind(this),this.btnFriend.onClick=this.onFriendBtnClick.bind(this),this.update(),this.on("added",this.onAdded,this),this.on("removed",this.onRemoved,this),pR.getInstance().registerRightMenuIndicatorButtonGetter(t=>"indicatorArea"===t&&this.indicatorArea.visible?{
- e.push(this.btnInventory),null!=OD.getTournamentSchedule()&&e.push(this.btnTournament),this.container.removeChildren(),this.container.addChild(this.bg),this.container.addChild(this.indicator),this.container.addChild(this.indicatorArea); + h.push(this.btnInventory),gv.unlocked&&(h.push(this.btnFriend),this.updateRedDotForFriend()),null!=vn.getTournamentSchedule()&&h.push(this.btnTournament),this.container.removeChildren(),this.container.addChild(this.bg),this.container.addChild(this.indicator),this.container.addChild(this.indicatorArea);
- =await Promise.resolve().then(()=>Y_i); + =await import("./chunks/EventHubPopup.js");
- ,void 0); + ,__vite__mapDeps([26,1,0,2,4,5]),import.meta.url);
+ async onFriendBtnClick(){ + const{ + FriendPopup:t} + =await o(async()=>{ + const{ + FriendPopup:t} + =await import("./chunks/FriendPopup.js"); + return{ + FriendPopup:t} + } + ,__vite__mapDeps([36,1,0,2,4,5]),import.meta.url); + t.getInstance().show(),await t.getInstance().setData()}
+ updateRedDotForFriend(){ + gv.pollPending(),gv.hasRedDot?this.btnFriend.showRedDot():this.btnFriend.hideRedDot()}
- this._opened?TG.numRevive>=1&&this.updateRedDotForDaily():this.checkIndicatorRedDot(); + this._opened?(Oo.numRevive>=1&&this.updateRedDotForDaily(),gv.unlocked&&this.updateRedDotForFriend()):this.checkIndicatorRedDot();
- TG.maxWave>=zx.getInstance().unlockWave&&(t=zx.getInstance().hasAnyEvolvable(),t)||OD.opened&&OD.unlocked&&(t=await OD.checkRedDot(),t)?this.showIndicatorRedDot():this.hideIndicatorRedDot()} + Oo.maxWave>=Ht.getInstance().unlockWave&&(t=Ht.getInstance().hasAnyEvolvable(),t)||gv.unlocked&&(gv.pollPending(),gv.hasRedDot)||vn.opened&&vn.unlocked&&(t=await vn.checkRedDot(),t)?this.showIndicatorRedDot():this.hideIndicatorRedDot()}
RankProfile 1 hunks, 18 statements
+ constructor(t,s){ + super(),n(this,"face"),n(this,"small"),n(this,"big"),this.eventMode="none",this.face=new Oc(t); + const i=uG(t); + this.small=new fG(i.size),this.small.position.set(i.x,i.y),this.big=new fG(s.size),this.big.position.set(s.x,s.y),this.addChild(this.face,this.small,this.big)} + setData(t,s){ + this.show(t,cG(s))} + setMine(s,i){ + this.show(s,t.myDeco()??cG(i))} + static myDeco(){ + return gc.state?gc.slot(gc.repTribe()):null} + show(t,s){ + const i=null!==s; + this.face.visible=i,this.small.visible=i,this.big.visible=!i,s?(this.face.setLook(s.tribe,s.face,s.frame),this.small.setRank(t)):this.big.setRank(t)} + } + ; + e(pG,"RankProfile"); + let MG=pG; + const gG=class t extends Ot{
DetailPopupLayer 1 hunks, 16 statements
+ function xc(t){ + const s=t&&"object"==typeof t?t:{ + } + ; + return{ + on:!0===s.on,gem:!0===s.gem} + } + function Bc(t,s){ + return t>=1e3&&s>=1} + function Uc(t){ + return t.setting.on&&t.gameOverMode&&Bc(t.maxWave,t.numRevive)&&!t.coachActive} + function Hc(t,s){ + return t.gem&&s>=500?"bonus":"normal"} + function $c(t,s){ + return Math.max(0,Math.ceil((t-s)/1e3))} + e(xc,"parseAutoRebirthSetting"),e(Bc,"isAutoRebirthUnlocked"),e(Uc,"canAutoRebirth"),e(Hc,"autoRebirthChoice"),e($c,"autoRebirthRemainSec");
RankBadge 3 hunks, 16 statements
- const s=t.length<=2?.3:3===t.length?.26:.2; + const i=t.length<=2?.4:3===t.length?.31:.24;
+ const lG=e(t=>"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null,"int"); + function cG(t){ + if(!t||"object"!=typeof t)return null; + const s=t,i=lG(s.tribe),h=lG(s.face),e=lG(s.frame); + return null===i||null===h||null===e||i<1||i>4?null:{ + tribe:i,face:h,frame:e} + } + function uG(t){ + return{ + size:Math.round(.42*t),x:Math.round(.07*t),y:Math.round(.45*t)} + } + function dG(t){ + return Math.min(4,Math.max(2,Math.round(t/12*2)/2))} + e(cG,"parseRepDeco"),e(uG,"rankProfileBadge"),e(dG,"rankLabelStroke");
- color:1971212,width:4,join:"round"} + color:1971212,width:dG(t),join:"round"}
AutoRebirthGuidePopup 1 hunks, 16 statements
- super(),Zt(this,"btnConfirm",new M$("","","확인",.8,180,60)),Zt(this,"lblMedalTitle",new iG("",hD.DEFAULT_COLOR,hD.DEFAULT_FONT_OPTION_18)),Zt(this,"lblMedalAmount",new OF("UI_STAR_ICON","0",16766720,hD.DEFAULT_OUTLINE_FONT_OPTION_20)),Zt(this,"lblMedalGuide",new iG("",hD.COLOR_GRAY,hD.DEFAULT_FONT_OPTION_16)),Zt(this,"lblHeroMessage",new iG("",52326,hD.DEFAULT_FONT_OPTION_16)),Zt(this,"heroIcon",new c4),Zt(this,"onConfirm",null),this.heroIcon.setMode(o4.HERO_LIST),this.lblMedalTitle.align="center",this.lblMedalGuide.align="center",this.lblHeroMessage.align="center",this.contentContainer.addChild(this.lblMedalTitle,this.lblMedalAmount,this.lblMedalGuide,this.lblHeroMessage,this.heroIcon,this.btnConfirm),this.btnConfirm.showIconLabel=!1,this.btnConfirm.showTextLabel=!0,this.btnConfirm.text=NB.getText("COMMON_1","확인"),this.btnConfirm.color=M$.GREEN,this.btnConfirm.onClick=this.onConfirmClick.bind(this); + super(),n(this,"lblIntro"),n(this,"lblGuideTitle"),n(this,"lblGuide"),this.lblIntro=new to("",16777215,en.DEFAULT_FONT_OPTION_18),en.setLabelWrapWidth(this.lblIntro,this.width-60),this.lblGuideTitle=new to("",16767354,en.DEFAULT_FONT_OPTION_16),this.lblGuide=new to("",en.DEFAULT_COLOR,en.DEFAULT_FONT_OPTION_16),en.setLabelWrapWidth(this.lblGuide,this.width-60),this.lblGuide.lineHeight=26,this.contentContainer.addChild(this.lblIntro,this.lblGuideTitle,this.lblGuide),this.outSideClickHide=!0} + static getInstance(){ + return this._instance||(this._instance=new t),this._instance} + async showGuide(){ + this.title=Nr.getText("GAME_1934","자동 환생"),this.lblIntro.text=Nr.getValueReplace("GAME_1935","##",15,"자동 환생을 켜 두면, 성이 파괴되었을 때 15초 후에 자동으로 환생합니다."),this.lblIntro.x=30,this.lblIntro.y=84,this.lblGuideTitle.text=Nr.getSquareBracketStr(Nr.getText("GAME_1554","상세 설명")),this.lblGuideTitle.x=30,this.lblGuideTitle.y=this.lblIntro.y+this.lblIntro.height+22,this.lblGuide.text=[Nr.getText("GAME_1936","1. 성이 파괴되면 환생 창에 남은 시간이 표시됩니다."),Nr.getText("GAME_1937","2. 그 사이에 버튼을 직접 누르면 누른 대로 진행되고, 자동 환생을 끄면 멈춥니다."),Nr.getText("GAME_1938","3. 보석 500 (훈장 x 2)을 함께 켜면 보석 500개를 써서 훈장을 2배로 받습니다. 보석이 부족하면 일반 환생을 합니다."),Nr.getText("GAME_1939","4. 환생 보상에서 선택한 팀(현재 팀 / 환생전용팀)으로 환생합니다."),Nr.getText("GAME_1940","5. 다른 창이 열려 있는 동안에는 남은 시간이 멈춥니다.")].join("\n"),this.lblGuide.x=30,this.lblGuide.y=this.lblGuideTitle.y+this.lblGuideTitle.height+8,this.height=this.lblGuide.y+this.lblGuide.height+40,await this.loadImage(),super.show()} + getDefaultPositionY(){ + return.45*J.stageHeight} + onBackButton(){ + return this.hide(),!0} + } + ; + e(i1,"AutoRebirthGuidePopup"),n(i1,"_instance"); + let h1=i1; + const e1=class t extends ur{ + constructor(){ + super(),n(this,"btnConfirm",new Pc("","","확인",.8,180,60)),n(this,"lblMedalTitle",new to("",en.DEFAULT_COLOR,en.DEFAULT_FONT_OPTION_18)),n(this,"lblMedalAmount",new Il("UI_STAR_ICON","0",16766720,en.DEFAULT_OUTLINE_FONT_OPTION_20)),n(this,"lblMedalGuide",new to("",en.COLOR_GRAY,en.DEFAULT_FONT_OPTION_16)),n(this,"lblGemShort",new to("",en.COLOR_RED_GEM,en.DEFAULT_FONT_OPTION_16)),n(this,"lblHeroMessage",new to("",52326,en.DEFAULT_FONT_OPTION_16)),n(this,"heroIcon",new NS),n(this,"onConfirm",null),this.heroIcon.setMode(RS.HERO_LIST),this.lblMedalTitle.align="center",this.lblMedalGuide.align="center",this.lblGemShort.align="center",this.lblHeroMessage.align="center",this.contentContainer.addChild(this.lblMedalTitle,this.lblMedalAmount,this.lblGemShort,this.lblMedalGuide,this.lblHeroMessage,this.heroIcon,this.btnConfirm),this.btnConfirm.showIconLabel=!1,this.btnConfirm.showTextLabel=!0,this.btnConfirm.text=Nr.getText("COMMON_1","확인"),this.btnConfirm.color=Pc.GREEN,this.btnConfirm.onClick=this.onConfirmClick.bind(this);
RebirthResultPopup 4 hunks, 14 statements
- hD.setLabelWrapWidth(this.lblMedalTitle,t),hD.setLabelWrapWidth(this.lblMedalGuide,t),hD.setLabelWrapWidth(this.lblHeroMessage,t)} + en.setLabelWrapWidth(this.lblMedalTitle,t),en.setLabelWrapWidth(this.lblMedalGuide,t),en.setLabelWrapWidth(this.lblGemShort,t),en.setLabelWrapWidth(this.lblHeroMessage,t)}
- showResult(t,i=null,s=null){ - this.onConfirm=s,this.title=NB.getText("GAME_320","환생결과"),this.lblMedalTitle.text=NB.getText("GAME_321","환생을 통해 훈장을 획득했습니다."),this.lblMedalAmount.text=`${ - NB.getText("GAME_7","훈장")} + showResult(t,s=null,i=null,h={ + multiplier:1,gemShort:!1} + ){ + this.onConfirm=i,this.title=Nr.getText("GAME_320","환생결과"),this.lblMedalTitle.text=Nr.getText("GAME_321","환생을 통해 훈장을 획득했습니다."); + const e=Nr.getText("GAME_7","훈장"),n=h.multiplier>1?` (x${ + h.multiplier} + )`:""; + this.lblMedalAmount.text=`${ + e} + ${ + n}
- `,this.lblMedalGuide.text=NB.getText("GAME_322","훈장으로 영웅을 더 강화시켜, 더 높은 웨이브로 도전해보세요!"),i?(this.heroIcon.setData(i),this.heroIcon.visible=!0,this.lblHeroMessage.text=NB.getText("GAME_323","아군의 전력에 도움이 될만한 영웅이 합류했습니다!"),this.lblHeroMessage.visible=!0):(this.heroIcon.visible=!1,this.lblHeroMessage.visible=!1),this.btnConfirm.text=NB.getText("COMMON_1","확인"),this.updateLayout(),this.btnClose.visible=!1,this.outSideClickHide=!0,super.show()} + `,this.lblGemShort.visible=h.gemShort,this.lblGemShort.text=Nr.getText("GAME_2101","보석이 부족해 일반 환생(훈장 x 1)으로 진행했어요."),this.lblMedalGuide.text=Nr.getText("GAME_322","훈장으로 영웅을 더 강화시켜, 더 높은 웨이브로 도전해보세요!"),s?(this.heroIcon.setData(s),this.heroIcon.visible=!0,this.lblHeroMessage.text=Nr.getText("GAME_323","아군의 전력에 도움이 될만한 영웅이 합류했습니다!"),this.lblHeroMessage.visible=!0):(this.heroIcon.visible=!1,this.lblHeroMessage.visible=!1),this.btnConfirm.text=Nr.getText("COMMON_1","확인"),this.updateLayout(),this.btnClose.visible=!1,this.outSideClickHide=!0,super.show()}
- this.lblMedalTitle.x=.5*(this.width-this.lblMedalTitle.width),this.lblMedalTitle.y=t,t+=this.lblMedalTitle.height+25,this.lblMedalAmount.x=.5*(this.width-this.lblMedalAmount.width),this.lblMedalAmount.y=t,t+=this.lblMedalAmount.height+25,this.lblMedalGuide.x=.5*(this.width-this.lblMedalGuide.width),this.lblMedalGuide.y=t,t+=this.lblMedalGuide.height+30,this.heroIcon.visible&&(this.lblHeroMessage.x=.5*(this.width-this.lblHeroMessage.width),this.lblHeroMessage.y=t,t+=this.lblHeroMessage.height+15,this.heroIcon.x=.5*(this.width-this.heroIcon.width),this.heroIcon.y=t,t+=this.heroIcon.height+30),this.btnConfirm.x=.5*(this.width-this.btnConfirm.width),this.btnConfirm.y=t,this.height=this.btnConfirm.y+this.btnConfirm.height+50} + this.lblMedalTitle.x=.5*(this.width-this.lblMedalTitle.width),this.lblMedalTitle.y=t,t+=this.lblMedalTitle.height+25,this.lblMedalAmount.x=.5*(this.width-this.lblMedalAmount.width),this.lblMedalAmount.y=t,t+=this.lblMedalAmount.height,this.lblGemShort.visible&&(t+=8,this.lblGemShort.x=.5*(this.width-this.lblGemShort.width),this.lblGemShort.y=t,t+=this.lblGemShort.height),t+=25,this.lblMedalGuide.x=.5*(this.width-this.lblMedalGuide.width),this.lblMedalGuide.y=t,t+=this.lblMedalGuide.height+30,this.heroIcon.visible&&(this.lblHeroMessage.x=.5*(this.width-this.lblHeroMessage.width),this.lblHeroMessage.y=t,t+=this.lblHeroMessage.height+15,this.heroIcon.x=.5*(this.width-this.heroIcon.width),this.heroIcon.y=t,t+=this.heroIcon.height+30),this.btnConfirm.x=.5*(this.width-this.btnConfirm.width),this.btnConfirm.y=t,this.height=this.btnConfirm.y+this.btnConfirm.height+50}
GuildManager 13 hunks, 13 statements
- ,void 0); + ,void 0,import.meta.url);
- =await Promise.resolve().then(()=>Ewi); + =await import("./chunks/GuildWarBattlePopupV3.js");
- ,void 0); + ,__vite__mapDeps([7,1,0,2,4,8,9,5]),import.meta.url);
- =await Promise.resolve().then(()=>xwi); + =await import("./chunks/GuildWarBattleReadyPopup.js");
- ,void 0); + ,__vite__mapDeps([10,1,0,2,11,8,9,4,5]),import.meta.url);
- =await Promise.resolve().then(()=>Dwi); + =await import("./chunks/GuildWarSquadsPopup.js");
- ,void 0); + ,__vite__mapDeps([12,1,0,2,11,4,5]),import.meta.url);
- =await Promise.resolve().then(()=>Hwi); + =await import("./chunks/GuildWarTierAssignPopup.js");
- ,void 0); + ,__vite__mapDeps([13,9,1,0,2,4,5]),import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
- ...i} + ...s}
- ...i} + ...s}
ActiveSkillDamageHelper 2 hunks, 13 statements
- const gH=class t{ - static getSkillRatio(t,i){ - const s=i-t; + function xu(t){
+ function Bu(t,s){ + return Math.max(0,Math.min(s,12e3)-t)+3*Math.max(0,s-Math.max(t,12e3))} + function Uu(t,s){ + return xu(Bu(t,s))} + e(xu,"skillRatioByDistance"),e(Bu,"overRecordDistance"),e(Uu,"overRecordSkillRatio"); + const Hu=class t{ + static getOverRecordRatio(t,s){ + return Uu(t,s)} + static getSkillRatio(t,s){ + return xu(s-t)}
RightBottomMenus 13 hunks, 13 statements
- =await Promise.resolve().then(()=>dMi); + =await import("./chunks/WaveCallGuidePopup.js");
- ,void 0).then(({ + ,__vite__mapDeps([28,1,0,2,4,5]),import.meta.url).then(({
- YG(),TG.isSoulResting?bH.getInstance().showMessage(NB.getText("GAME_866","영혼의 휴식중에는 사용할 수 없습니다.")):this.waveCallInfo.callWave()} + Ko(),Oo.isSoulResting?Ku.getInstance().showMessage(Nr.getText("GAME_866","영혼의 휴식중에는 사용할 수 없습니다.")):this.waveCallInfo.M()}
- =await Promise.resolve().then(()=>ubi); + =await import("./chunks/CardEventLobbyPopup.js");
- ,void 0); + ,__vite__mapDeps([29,1,0,2,4,5]),import.meta.url);
- =await Promise.resolve().then(()=>Obi); + =await import("./chunks/MiniAscentAssets.js").then(t=>t.e);
- ,void 0); + ,__vite__mapDeps([30,1,0,2]),import.meta.url);
- =await Promise.resolve().then(()=>Tyi); + =await import("./chunks/MiniAscentFlow.js").then(t=>t.q);
- ,void 0); + ,__vite__mapDeps([31,1,0,2,32,4,5,30,3]),import.meta.url);
- =await Promise.resolve().then(()=>$bi); + =await import("./chunks/miniAscentPveText.js");
- ,void 0); + ,__vite__mapDeps([32,1,0,2,4,5]),import.meta.url);
- =await Promise.resolve().then(()=>rEi); + =await import("./chunks/ConquestPopup.js");
- ,void 0); + ,__vite__mapDeps([33,1,0,2,4,5]),import.meta.url);
HeroHireSubMenu 4 hunks, 12 statements
- oQt.getInstance().showPopup()} + if(0==this.btnMassiveBuy.activated)return; + const t=Oo.massiveRequiredMedal; + Oo.medal<t?Ku.getInstance().showMessage(`${ + Nr.getText("GAME_48","훈장이 부족합니다.")} + (${ + Nr.getText("COMMON_14","필요개수")} + : ${ + sc.setComma(t)} + )`):iN.getInstance().showPopup()}
- const t=this.lblTime.x-(this.btnResetEvent.visible?20:0)-18,i=t-(this.lblTitle.x+this.lblTitle.width+10),s=Math.max(70,Math.min(110,i)),e=s-20; + const t=this.lblTime.x-(this.btnResetEvent.visible?20:15)-18,s=t-(this.lblTitle.x+this.lblTitle.width+10),i=Math.max(70,Math.min(110,s)),h=i-20;
- ...h,fontSize:n} + ...n,fontSize:e}
- this.btnMassiveBuy.width===s&&this.btnMassiveBuy.lbl.getWrapWidth()===e&&this.btnMassiveBuy.text===this.massiveBuyLabel&&this.btnMassiveBuy.lbl.textSize===n||(this.btnMassiveBuy.lbl.textSize=n,this.btnMassiveBuy.lbl.align="center",this.btnMassiveBuy.lbl.setWrapWidth(e),this.btnMassiveBuy.text=this.massiveBuyLabel,this.btnMassiveBuy.width=s),this.btnMassiveBuy.x=t-s} + this.btnMassiveBuy.width===i&&this.btnMassiveBuy.lbl.getWrapWidth()===h&&this.btnMassiveBuy.text===this.massiveBuyLabel&&this.btnMassiveBuy.lbl.textSize===e||(this.btnMassiveBuy.lbl.textSize=e,this.btnMassiveBuy.lbl.align="center",this.btnMassiveBuy.lbl.setWrapWidth(h),this.btnMassiveBuy.text=this.massiveBuyLabel,this.btnMassiveBuy.width=i),this.btnMassiveBuy.x=t-i,this.btnMassiveBuy.activated=Oo.massiveRequiredMedal>0}
BasePopup 6 hunks, 11 statements
- const fB=class extends Ke{ + const cr=class t extends l{
- )),Zt(this,"hideHandler",null),Zt(this,"_positionY",-1),Zt(this,"outSideClickHide",!1),Zt(this,"onPointerDownHandler"),this.addChild(this.bg),this.addChild(this.contentContainer),this.addChild(this.txtTitle),this.addChild(this.btnClose),this.btnClose.y=9,this.btnClose.onClick=this.onCloseBtnClick.bind(this),this.width=580,this.height=300,this.onPointerDownHandler=this.onPointerDown.bind(this)} + )),n(this,"hideHandler",null),n(this,"_positionY",-1),n(this,"outSideClickHide",!1),n(this,"onPointerDownHandler"),n(this,"shownTime",0),this.addChild(this.bg),this.addChild(this.contentContainer),this.addChild(this.txtTitle),this.addChild(this.btnClose),this.btnClose.y=9,this.btnClose.onClick=this.onCloseBtnClick.bind(this),this.width=580,this.height=300,this.onPointerDownHandler=this.onPointerDown.bind(this)}
- this.eventMode="auto",this.interactiveChildren=!0,this.pivot.set(this.width/2,this.height/2),this.position.set(320,this.getPositionY()),this.scale.set(.1),yx.to(this.scale,{ + this.eventMode="auto",this.interactiveChildren=!0,t.watchPointerDowns(),this.shownTime=performance.now(),this.pivot.set(this.width/2,this.height/2),this.position.set(320,this.getPositionY()),this.scale.set(.1),B.to(this.scale,{
+ static watchPointerDowns(){ + !t.watchingPointerDowns&&J.stage&&(t.watchingPointerDowns=!0,J.stage.on("pointerdown",s=>{ + var i; + const h=null==(i=s.nativeEvent)?void 0:i.timeStamp; + t.lastPointerDownTime="number"==typeof h&&h>0?h:performance.now()} + ))}
- 0!=this.outSideClickHide&&(this.getPopupBounds().containsPoint(t.global.x,t.global.y)||this.hide())} + 0!=this.outSideClickHide&&(t.lastPointerDownTime<this.shownTime||this.getPopupBounds().containsPoint(s.global.x,s.global.y)||this.hide())}
- Qt(fB,"BasePopup"); + e(cr,"BasePopup"),n(cr,"lastPointerDownTime",0),n(cr,"watchingPointerDowns",!1);
InAppPurchaseManager 11 hunks, 11 statements
- =await Promise.resolve().then(()=>czt); + =await import("./chunks/vendor-misc.js").then(t=>t.u);
- ,void 0); + ,__vite__mapDeps([0,1,2]),import.meta.url);
- =await Promise.resolve().then(()=>C_i); + =await import("./chunks/ShopProductResultPopup.js");
- ,void 0); + ,__vite__mapDeps([21,1,0,2,4,5]),import.meta.url);
- =await Promise.resolve().then(()=>__i); + =await import("./chunks/AppsFlyerManager.js");
- ,void 0),o=e.getTimeoutMilliSeconds(); + ,__vite__mapDeps([19,1,0,2,4,5]),import.meta.url),a=h.getTimeoutMilliSeconds();
- =await Promise.resolve().then(()=>k_i); + =await import("./chunks/AnalyticsManager.js");
- ,void 0); + ,__vite__mapDeps([22,1,0,2,4,5]),import.meta.url);
- =await Promise.resolve().then(()=>C_i); + =await import("./chunks/ShopProductResultPopup.js");
- ,void 0); + ,__vite__mapDeps([21,1,0,2,4,5]),import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
SoundOptionButton 1 hunks, 11 statements
+ const Aq=class extends Ty{ + constructor(t){ + super(t),n(this,"_enabled",!0),this.outlineText=!0} + get enabled(){ + return this._enabled} + set enabled(t){ + t!=this._enabled&&(this._enabled=t,this._enabled?(this.text="ON",this.color=Ty.COLOR_SAND_BROWN):(this.text="OFF",this.color=Ty.COLOR_GRAY))} + } + ; + e(Aq,"SoundOptionButton"); + let Tq=Aq;
PVPRankItemRenderer 4 hunks, 10 statements
- super(),Zt(this,"bg"),Zt(this,"rankBadge",new w0t(46)),Zt(this,"lblName",new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_16)),Zt(this,"lblRecord",new iG("",11184810,hD.DEFAULT_OUTLINE_FONT_OPTION_16)),Zt(this,"lblPoint",new iG("",hD.COLOR_BRIGHT_ORANGE,hD.DEFAULT_OUTLINE_FONT_OPTION_16)),this.bg=new hE({ + super(),n(this,"bg"),n(this,"profile",new MG(64,{ + size:46,x:8,y:9} + )),n(this,"lblName",new to("",16777215,en.DEFAULT_OUTLINE_FONT_OPTION_16)),n(this,"lblRecord",new to("",11184810,en.DEFAULT_OUTLINE_FONT_OPTION_16)),n(this,"lblPoint",new to("",en.COLOR_BRIGHT_ORANGE,en.DEFAULT_OUTLINE_FONT_OPTION_16)),this.bg=new A({
- ),this.bg.width=610,this.bg.height=50,this.bg.x=5,this.addChild(this.bg),this.rankBadge.x=30,this.rankBadge.y=.5*(this.bg.height-46),this.addChild(this.rankBadge),this.lblName.x=112,this.lblName.y=.5*(this.bg.height-this.lblName.height),this.addChild(this.lblName),this.lblRecord.x=400,this.lblRecord.y=.5*(this.bg.height-this.lblRecord.height),this.addChild(this.lblRecord),this.lblPoint.x=this.bg.width-80,this.lblPoint.y=.5*(this.bg.height-this.lblPoint.height),this.addChild(this.lblPoint)} + ),this.bg.width=610,this.bg.height=50,this.bg.x=5,this.addChild(this.bg),this.profile.position.set(22,.5*(this.bg.height-64)),this.addChild(this.profile),this.lblName.x=112,this.lblName.y=.5*(this.bg.height-this.lblName.height),this.addChild(this.lblName),this.lblRecord.x=400,this.lblRecord.y=.5*(this.bg.height-this.lblRecord.height),this.addChild(this.lblRecord),this.lblPoint.x=this.bg.width-80,this.lblPoint.y=.5*(this.bg.height-this.lblPoint.height),this.addChild(this.lblPoint)}
- this.data=t,this.rankBadge.setRank(Number(t.rank)||0),this.lblName.text=t.name,this.lblRecord.text=`${ + this.data=t; + const s=t.name===Oo.name; + s?this.profile.setMine(Number(t.rank)||0,t.deco):this.profile.setData(Number(t.rank)||0,t.deco),this.lblName.text=t.name,this.lblRecord.text=`${
- `,this.lblRecord.x=427.5-.5*this.lblRecord.width,this.lblPoint.x=this.bg.width-47.5-.5*this.lblPoint.width; - const i=t.name===TG.name; - this.lblName.textColor=i?hD.COLOR_YELLOW:16777215} + `,this.lblRecord.x=427.5-.5*this.lblRecord.width,this.lblPoint.x=this.bg.width-47.5-.5*this.lblPoint.width,this.lblName.textColor=s?en.COLOR_YELLOW:16777215}
GuildShopSubView 1 hunks, 10 statements
- let t=this.shopInfo[s],e=eR.getVO(); - e.kindNum=t.kindNum,e.payType=t.costType,e.medal=t.cost,e.level=1,i.push(e)} + let t=this.shopInfo[i]; + const h="pet"===t.type?"pet":"unit",e={ + type:h,kindNum:t.kindNum,costType:t.costType,cost:t.cost,amount:Number(t.amount)>0?Number(t.amount):10,dailyLimit:Number(t.dailyLimit)||0,purchaseCount:Number(t.purchaseCount)||0} + ; + if("pet"===h){ + if(!Ht.getInstance().getBookVO(t.kindNum))continue} + else{ + let s=qt.getVO(); + s.kindNum=t.kindNum,s.payType=t.costType,s.medal=t.cost,s.level=1,e.unit=s} + s.push(e)}
HeroSubMenu 3 hunks, 9 statements
- super(),Zt(this,"lblMaxCapacity",new OF("menu_icon_03_on","0/10",16711680,hD.DEFAULT_OUTLINE_FONT_OPTION_18)),Zt(this,"btnHire",new aKt("고용",110)),Zt(this,"btnRoaster",new aKt("내영웅",110)),Zt(this,"btnMultiLevel",new Gqt("+",40)),Zt(this,"btnPreset",new aKt("프리셋",90)),Zt(this,"btnGuide"),Zt(this,"btnSlotAdd"),Zt(this,"cnt",0),Zt(this,"requestPending",!1),Zt(this,"btnRosterPoint",new Ai),Zt(this,"btnRosterlPointInitialized",!1),this.lblTitle.y=2,this.lblMaxCapacity.iconScale=.5,this.lblMaxCapacity.x=this.lblTitle.x,this.lblMaxCapacity.y=this.lblTitle.y+this.lblTitle.height+1,this.addChild(this.lblMaxCapacity),this.btnHire.width=110,this.btnHire.height=45,this.btnHire.y=.5*(this.bg.height-this.btnHire.height),this.addChild(this.btnHire),this.btnRoaster.width=110,this.btnRoaster.height=45,this.btnRoaster.y=.5*(this.bg.height-this.btnRoaster.height),this.addChild(this.btnRoaster),this.btnMultiLevel.height=42,this.btnMultiLevel.width=50,this.btnMultiLevel.y=.5*(this.bg.height-this.btnMultiLevel.height),this.addChild(this.btnMultiLevel),this.btnPreset.width=90,this.btnPreset.height=45,this.btnPreset.y=.5*(this.bg.height-this.btnPreset.height),this.addChild(this.btnPreset),this.btnHire.on("pointertap",this.onHire,this),this.btnRoaster.on("pointertap",this.onRoaster,this),this.btnMultiLevel.on("pointertap",this.onMultiLevelPopup,this),this.btnPreset.on("pointertap",this.onPresetToggle,this),this.btnSlotAdd=new HU("UI_Ekkorr","Btn_Plus"),this.btnSlotAdd.y=this.lblMaxCapacity.y+.5*(this.lblMaxCapacity.height-this.btnSlotAdd.height),this.addChild(this.btnSlotAdd),this.btnSlotAdd.onClick=this.onSlotAddBtnClick.bind(this),this.btnGuide=new HU("UI_Ekkorr","UI_Alarm"),this.btnGuide.y=this.lblTitle.y+.5*(this.lblTitle.height-this.btnGuide.height)+2,this.addChild(this.btnGuide),this.btnGuide.on("pointertap",()=>{ + super(),n(this,"lblMaxCapacity",new Il("menu_icon_03_on","0/10",16711680,en.DEFAULT_OUTLINE_FONT_OPTION_18)),n(this,"btnHire",new AI("고용",110)),n(this,"btnRoaster",new AI("내영웅",110)),n(this,"btnMultiLevel",new OC("+",40)),n(this,"btnPreset",new AI("프리셋",90)),n(this,"btnGuide"),n(this,"btnSlotAdd"),n(this,"autoToggle",new Wu),n(this,"cnt",0),n(this,"requestPending",!1),n(this,"btnRosterPoint",new M),n(this,"btnRosterlPointInitialized",!1),this.lblTitle.y=2,this.lblMaxCapacity.iconScale=.5,this.lblMaxCapacity.x=this.lblTitle.x,this.lblMaxCapacity.y=this.lblTitle.y+this.lblTitle.height+1,this.addChild(this.lblMaxCapacity),this.btnHire.width=110,this.btnHire.height=45,this.btnHire.y=.5*(this.bg.height-this.btnHire.height),this.addChild(this.btnHire),this.btnRoaster.width=110,this.btnRoaster.height=45,this.btnRoaster.y=.5*(this.bg.height-this.btnRoaster.height),this.addChild(this.btnRoaster),this.btnMultiLevel.height=42,this.btnMultiLevel.width=50,this.btnMultiLevel.y=.5*(this.bg.height-this.btnMultiLevel.height),this.addChild(this.btnMultiLevel),this.btnPreset.width=90,this.btnPreset.height=45,this.btnPreset.y=.5*(this.bg.height-this.btnPreset.height),this.addChild(this.btnPreset),this.btnHire.on("pointertap",this.onHire,this),this.btnRoaster.on("pointertap",this.onRoaster,this),this.btnMultiLevel.on("pointertap",this.onMultiLevelPopup,this),this.btnPreset.on("pointertap",this.onPresetToggle,this),this.btnSlotAdd=new Ua("UI_Ekkorr","Btn_Plus"),this.btnSlotAdd.y=this.lblMaxCapacity.y+.5*(this.lblMaxCapacity.height-this.btnSlotAdd.height),this.addChild(this.btnSlotAdd),this.btnSlotAdd.onClick=this.onSlotAddBtnClick.bind(this),this.btnGuide=new Ua("UI_Ekkorr","UI_Alarm"),this.btnGuide.y=this.lblTitle.y+.5*(this.lblTitle.height-this.btnGuide.height)+2,this.addChild(this.btnGuide),this.btnGuide.on("pointertap",()=>{
- :null),this.updateLanguage(),this.on("added",this.onAdded,this),this.on("removed",this.onRemoved,this)} + :null),this.autoToggle.onTap=this.onToggleAuto.bind(this),this.addChild(this.autoToggle),this.updateLanguage(),Uy.getInstance().loadSetting().then(()=>this.refreshAutoToggle()),this.on("added",this.onAdded,this),this.on("removed",this.onRemoved,this)}
- this.btnPreset.visible=TG.maxWave>=300,this.btnHire.x=640-this.btnHire.width-6,this.btnRoaster.x=this.btnHire.x-this.btnRoaster.width-2,this.btnPreset.visible?(this.btnPreset.x=this.btnRoaster.x-this.btnPreset.width-2,this.btnMultiLevel.x=this.btnPreset.x-this.btnMultiLevel.width-4):this.btnMultiLevel.x=this.btnRoaster.x-this.btnMultiLevel.width-4,TG.maxWave<50?this.btnMultiLevel.visible=!1:this.btnMultiLevel.visible=!0,this.btnSlotAdd.x=this.lblMaxCapacity.x+this.lblMaxCapacity.width+5,this.btnGuide.x=this.lblTitle.x+this.lblTitle.width+3} + this.btnPreset.visible=Oo.maxWave>=300,this.btnHire.x=640-this.btnHire.width-6,this.btnRoaster.x=this.btnHire.x-this.btnRoaster.width-2,this.btnPreset.visible?(this.btnPreset.x=this.btnRoaster.x-this.btnPreset.width-2,this.btnMultiLevel.x=this.btnPreset.x-this.btnMultiLevel.width-4):this.btnMultiLevel.x=this.btnRoaster.x-this.btnMultiLevel.width-4,Oo.maxWave<50?this.btnMultiLevel.visible=!1:this.btnMultiLevel.visible=!0,this.btnSlotAdd.x=this.lblMaxCapacity.x+this.lblMaxCapacity.width+5,this.btnGuide.x=this.lblTitle.x+this.lblTitle.width+3,this.autoToggle.x=this.btnGuide.x+this.btnGuide.width+6,this.autoToggle.y=this.lblTitle.y+.5*(this.lblTitle.height-this.autoToggle.height)+2} + onToggleAuto(){ + if(!Uy.isUnlocked)return void Ku.getInstance().showMessage(Nr.getValueReplace("GAME_633","##",Uy.UNLOCK_WAVE,"최고 WAVE 1000 이상에서 환생 후 이용가능합니다.")); + const t=Uy.getInstance(); + t.setEnabled(!t.enabled),this.refreshAutoToggle()} + refreshAutoToggle(){ + this.autoToggle.setOn(Uy.getInstance().enabled)}
PowerSaveManager 1 hunks, 9 statements
+ onCastleRestored(){ + if(!this._active||!this._castleDestroyed)return; + this._castleDestroyed=!1; + const t=J.stageHeight||1400; + this.bg.clear(),this.bg.rect(0,-100,640,t+200),this.bg.fill({ + color:658970} + ),this.setNormalMode(),_t.app.ticker.maxFPS=2,setTimeout(()=>{ + this._active&&(_t.app.ticker.maxFPS=1)} + ,1e3)}
ActiveSkillMain 8 hunks, 8 statements
- this.onSkill(t.id)} + this._(t.id)}
- onSkill(t){ + _(t){
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
- await RS.generateTexture("Lightening","ktx2",!1),this.count=0,this.darkLightningCount=t,this.thunderStormIter=0,this.thunderStormHitCount=0,this.lightningHitTargets.clear(),this.thunderStormRatio=mH.getSkillRatio(TG.maxWave,TG.wave),nU.getInstance().add(this.onDarkLightningEnter,this),QG.getInstance().playSFX(QG.SFX_BABEL_TOWER)} + await nt.generateTexture("Lightening","ktx2",!1),this.count=0,this.darkLightningCount=t,this.thunderStormIter=0,this.thunderStormHitCount=0,this.lightningHitTargets.clear(),this.thunderStormRatio=$u.getOverRecordRatio(Oo.maxWave,Oo.wave),sa.getInstance().add(this.onDarkLightningEnter,this),jo.getInstance().playSFX(jo.SFX_BABEL_TOWER)}
- const i=mH.getSkillRatio(TG.maxWave,TG.wave); + const s=$u.getOverRecordRatio(Oo.maxWave,Oo.wave);
- const i=mH.getSkillRatio(TG.maxWave,TG.wave); + const s=$u.getOverRecordRatio(Oo.maxWave,Oo.wave);
- const i=mH.getSkillRatio(TG.maxWave,TG.wave); + const s=$u.getOverRecordRatio(Oo.maxWave,Oo.wave);
SpiritLandDataManager 6 hunks, 7 statements
- get:()=>e?h()?Number(t^s):(jP.I(VP.G_SENTINEL),n):0,set:t=>!(!isFinite(t)||t<0||(e&&!h()?(jP.I(VP.G_SENTINEL),1):(r(t),0))),setTrusted(t){ + get:()=>h?o()?Number(t^i):(Bi.i(xi.G_SENTINEL),n):0,set:t=>!(!isFinite(t)||t<0||(h&&!o()?(Bi.i(xi.G_SENTINEL),1):(r(t),0))),setTrusted(t){
- if(!r())return jP.I(VP.W_SENTINEL),n; + if(!r())return Bi.i(xi.W_SENTINEL),n;
- return!isFinite(i)||i<1?(jP.I(VP.W_DECODE),n):i} + return!isFinite(s)||s<1?(Bi.i(xi.W_DECODE),n):s}
- if(i>h)return jP.I(VP.W_CEILING),!1; - if(e&&!r())return jP.I(VP.W_SENTINEL),!1; + if(s>o)return Bi.i(xi.W_CEILING),!1; + if(h&&!r())return Bi.i(xi.W_SENTINEL),!1;
- if(Math.abs(i-e)>50)return jP.I(VP.W_DELTA),!1} + if(Math.abs(s-h)>50)return Bi.i(xi.W_DELTA),!1}
- ),this.stageList.length=0,this.stageList.push(...n),this.stageMap.clear(); + ),this.stageList.length=0,this.stageList.push(...e),this.stageMap.clear();
HeroMassiveBuyPopup 4 hunks, 7 statements
- ...hD.DEFAULT_FONT_OPTION_17} + ...en.DEFAULT_FONT_OPTION_17}
- this.massiveBuySize=isNaN(s)?this.massiveBuySize:s} + this.massiveBuySize=isNaN(i)?this.massiveBuySize:i,this.massiveBuyCost=Oo.massiveGemCost>0?Oo.massiveGemCost:this.massiveBuyCost}
- const e=FB.isValidEvent($B.HERO_RESET_EVENT)?Number(null==(t=FB.currentHeroResetEvent)?void 0:t.divide):1,n=(Number.isFinite(e)&&e>0?e:1)*Math.floor(this.massiveBuyCost/this.refreshCost),h=5*n,r=NB.getValueReplaceMulti("GAME_1889",["##","@@"],[n,h],`영웅 목록을 ${ + const h=xr.isValidEvent(Br.HERO_RESET_EVENT)?Number(null==(t=xr.currentHeroResetEvent)?void 0:t.divide):1; + let e=(Number.isFinite(h)&&h>0?h:1)*Math.floor(this.massiveBuyCost/this.refreshCost),n=5*e; + n=Oo.massiveSize,e=Math.floor(Oo.massiveSize/5); + const o=Nr.getValueReplaceMulti("GAME_1889",["##","@@"],[e,n],`영웅 목록을 ${
- h.setData(e,[],n,n),h.show()} + n.setData(h,[],e,e,i.spentMedal),n.show()}
CardEventDataManager 6 hunks, 7 statements
+ HAND_SIZE:8,MAX_SUBMIT_CARDS:5,CONQUEST_CHAPTER:8,SHOP_CARD_SLOTS:2,PACK_CHOICES:3,REROLL_BASE_COST:5,PRICE_PACK:4,ENHANCE_POWER_ADD:30,ENHANCE_BUFF_ADD:4,GLASS_BUFF_MULT:2,SEAL_HUMAN_GOLD:2,FREE_ENTRIES_PER_DAY:3,AD_ENTRIES_PER_DAY:2} + ,zD={
- handSize:8,submits:e.submits,discards:e.discards,petSlots:e.petSlots,consumableSlots:e.consumableSlots,interestCap:e.interestCap,shopCardSlots:2,packPrice:4,rerollBaseCost:5} + handSize:YD.HAND_SIZE,submits:h.submits,discards:h.discards,petSlots:h.petSlots,consumableSlots:h.consumableSlots,interestCap:h.interestCap,shopCardSlots:YD.SHOP_CARD_SLOTS,packPrice:YD.PRICE_PACK,rerollBaseCost:YD.REROLL_BASE_COST}
- const s=[...i.values()].sort((t,i)=>i-t); + const i=[...s.values()].sort((t,s)=>s-t);
- const t=[...i.keys()].sort((t,i)=>t-i); + const t=[...s.keys()].sort((t,s)=>t-s);
- i++)r+=Q2t(p.rank),"power"===p.enhance&&(r+=30),"buff"===p.enhance&&(o+=4),"glass"===p.enhance&&(a*=2),"human"===p.seal&&(l+=2); + s++)r+=XD(e.rank),"power"===e.enhance&&(r+=YD.ENHANCE_POWER_ADD),"buff"===e.enhance&&(a+=YD.ENHANCE_BUFF_ADD),"glass"===e.enhance&&(l*=YD.GLASS_BUFF_MULT),"human"===e.seal&&(u+=YD.SEAL_HUMAN_GOLD);
- if(!i||t.length<1||t.length>5)return null; + if(!s||t.length<1||t.length>YD.MAX_SUBMIT_CARDS)return null;
PetDetailPopup 7 hunks, 7 statements
- `,t.isFavoritePet(this.currentKindNum)?this.iconFavorite.activated=!0:this.iconFavorite.activated=!1; + `,i?(t.isFavoritePet(this.currentKindNum)?this.iconFavorite.activated=!0:this.iconFavorite.activated=!1,this.iconFavorite.visible=!0):this.iconFavorite.visible=!1;
- ,void 0),e=s.getInstance().getBookDataByKindNum(t),n=s.getInstance().isEquipedOrOwned(t); + ,void 0,import.meta.url),h=i.getInstance().getBookDataByKindNum(t),e=i.getInstance().isEquipedOrOwned(t);
- =await Promise.resolve().then(()=>B_i); + =await import("./chunks/PetCoupleTreasurePopup.js");
- ,void 0); + ,__vite__mapDeps([24,1,0,2,4,5]),import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
RankingItemRenderer 3 hunks, 7 statements
- super(),Zt(this,"bg",new ep),Zt(this,"badge",new w0t(56)),Zt(this,"lblName"),Zt(this,"lblLv"),Zt(this,"valueIcon"),Zt(this,"lblValue"),Zt(this,"chevron",new ep),Zt(this,"userName",""); + super(),n(this,"bg",new p),n(this,"profile",new MG(84,{ + size:56,x:12,y:14} + )),n(this,"lblName"),n(this,"lblLv"),n(this,"valueIcon"),n(this,"lblValue"),n(this,"chevron",new p),n(this,"userName","");
- this.drawBg(t.BG),this.addChild(this.bg),this.badge.x=6,this.badge.y=.5*(s-56),this.addChild(this.badge),this.lblName=new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_20),this.lblName.x=76,this.lblName.y=8,this.addChild(this.lblName),this.lblLv=new iG("",13216120),this.lblLv.textSize=14,this.lblLv.x=77,this.lblLv.y=36,this.addChild(this.lblLv),this.valueIcon=new Xe(RS.getTexture("UI_Ekkorr",voi[0])),this.addChild(this.valueIcon),this.lblValue=new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_20),this.lblValue.textSize=22,this.addChild(this.lblValue),this.chevron.poly([0,0,3,0,9,8,3,16,0,16,6,8]).fill(9074528),this.chevron.x=i-22,this.chevron.y=.5*(s-16),this.addChild(this.chevron); + this.drawBg(t.BG),this.addChild(this.bg),this.profile.position.set(-6,.5*(i-84)),this.addChild(this.profile),this.lblName=new to("",16777215,en.DEFAULT_OUTLINE_FONT_OPTION_20),this.lblName.x=76,this.lblName.y=8,this.addChild(this.lblName),this.lblLv=new to("",13216120),this.lblLv.textSize=14,this.lblLv.x=77,this.lblLv.y=36,this.addChild(this.lblLv),this.valueIcon=new u(nt.getTexture("UI_Ekkorr",Iq[0])),this.addChild(this.valueIcon),this.lblValue=new to("",16777215,en.DEFAULT_OUTLINE_FONT_OPTION_20),this.lblValue.textSize=22,this.addChild(this.lblValue),this.chevron.poly([0,0,3,0,9,8,3,16,0,16,6,8]).fill(9074528),this.chevron.x=s-22,this.chevron.y=.5*(i-16),this.addChild(this.chevron);
- this.userName=String((null==i?void 0:i.name)??""),this.badge.setRank(Number((null==i?void 0:i.rank)??0)),this.drawBg(""!==this.userName&&this.userName===TG.name?t.BG_ME:t.BG),this.lblName.text=this.userName,this.lblLv.text=`Lv.${ + this.userName=String((null==s?void 0:s.name)??""); + const i=""!==this.userName&&this.userName===Oo.name,h=Number((null==s?void 0:s.rank)??0); + i?this.profile.setMine(h,null==s?void 0:s.deco):this.profile.setData(h,null==s?void 0:s.deco),this.drawBg(i?t.BG_ME:t.BG),this.lblName.text=this.userName,this.lblLv.text=`Lv.${
ConfigManager 5 hunks, 6 statements
- if(t.user&&this.setUser(t.user,i),t.quest&&lG.getInstance().setData(t.quest),t.hero&&iR.getInstance().setData(t.hero),t.castle&&(sP.getInstance().setData(t.castle),RP.getInstance().recalculate()),t.treasure||t.dungeon){ + if(t.user&&this.setUser(t.user,s),t.quest&&lo.getInstance().setData(t.quest),t.hero&&Xt.getInstance().setData(t.hero),t.massive&&this.setMassiveBuy(t.massive),t.hero&&t.hero.massive&&this.setMassiveBuy(t.hero.massive),t.castle&&(js.getInstance().setData(t.castle),Ii.getInstance().recalculate()),t.treasure||t.dungeon){
+ static setMassiveBuy(t){ + this.massiveGemCost=t.gemCost,this.massiveSize=t.size,this.massiveRequiredMedal=t.requiredMedal}
- Zt(SG,"accountId",""),Zt(SG,"currentServer",0),Zt(SG,"platform",""),Zt(SG,"platformId",""),Zt(SG,"regTime",""),Zt(SG,"agreeTime",""),Zt(SG,"optOut",!1),Zt(SG,"withdrawYn",""),Zt(SG,"withdrawTime",""),Zt(SG,"email",""),Zt(SG,"userId",""),Zt(SG,"name",""),Zt(SG,"uid",""),Zt(SG,"userType",0),Zt(SG,"hideRankingTeam",!1),Zt(SG,"language","en"),Zt(SG,"timezone",0),Zt(SG,"lastLoginTime",""),Zt(SG,"lastGoldUpdateTime",""),Zt(SG,"goldPerSec",100),Zt(SG,"walletType",""),Zt(SG,"walletAddress",""),Zt(SG,"createdJustNow",!1),Zt(SG,"tribe",0),Zt(SG,"reviveQuestGoldBuff",0),Zt(SG,"reviveQuestDurationBuff",0),Zt(SG,"reviveQuestOpenCostBuff",0),Zt(SG,"maxWave",1),Zt(SG,"gem",0),Zt(SG,"redGem",0),Zt(SG,"accuMedal",0),Zt(SG,"accuWave",0),Zt(SG,"medalBuyCount",0),Zt(SG,"needRevive",!1),Zt(SG,"medal",0),Zt(SG,"honorCoin",0),Zt(SG,"_speed15",jD(VP.SP15_SENTINEL)),Zt(SG,"_speed20",jD(VP.SP20_SENTINEL)),Zt(SG,"medalBuffLevel",0),Zt(SG,"goldBuffLevel",0),Zt(SG,"daySkipLevel",0),Zt(SG,"lastReviveTime",0),Zt(SG,"numRevive",0),Zt(SG,"numRevive30",0),Zt(SG,"numReviveHoldActive",!1),Zt(SG,"pendingNumRevive",-1),Zt(SG,"numReviveHoldTimer",null),Zt(SG,"heart",0),Zt(SG,"adsEndTime",0),Zt(SG,"assistantEndTime",0),Zt(SG,"assistantPassEndTime",0),Zt(SG,"soulRestStartAt",0),Zt(SG,"soulRestEndAt",0),Zt(SG,"bestMedalPerMin",0),Zt(SG,"bestMedalPerMinAt",0),Zt(SG,"soulRestNextStartAt",0),Zt(SG,"soulRestSkipCount",0),Zt(SG,"castleKindNum",10001),Zt(SG,"castleLevel",0),Zt(SG,"castleEnhance",0),Zt(SG,"castleGoldLevels",[0,0,0,0,0,0,0,0,0,0]),Zt(SG,"castleMedalLevels",[0,0,0,0,0,0,0,0,0,0]),Zt(SG,"questsLevels",[0,0,0,0,0,0,0,0,0,0]),Zt(SG,"maxTeamSlots",5),Zt(SG,"unitsSlotIds",[]),Zt(SG,"unitsSlotKindNums",[]),Zt(SG,"unitsSlotLevels",[]),Zt(SG,"unitsSlotEnhances",[]),Zt(SG,"ownedUnitKindNums",[]),Zt(SG,"ownedUnitCounts",[]),Zt(SG,"treasuresMaxSlots",5),Zt(SG,"treasuresKindNums",[]),Zt(SG,"treasuresLevels",[]),Zt(SG,"treasuresOwned",[]),Zt(SG,"skillsKindNums",[]),Zt(SG,"activeSkills",[1,-1,-1]),Zt(SG,"_godBless",jD(VP.GODBLESS_SENTINEL)),Zt(SG,"_skillSpeed",jD(VP.SKILLSPEED_SENTINEL)); + n(Io,"accountId",""),n(Io,"currentServer",0),n(Io,"platform",""),n(Io,"platformId",""),n(Io,"regTime",""),n(Io,"agreeTime",""),n(Io,"optOut",!1),n(Io,"withdrawYn",""),n(Io,"withdrawTime",""),n(Io,"email",""),n(Io,"userId",""),n(Io,"name",""),n(Io,"uid",""),n(Io,"userType",0),n(Io,"hideRankingTeam",!1),n(Io,"language","en"),n(Io,"timezone",0),n(Io,"lastLoginTime",""),n(Io,"lastGoldUpdateTime",""),n(Io,"goldPerSec",100),n(Io,"walletType",""),n(Io,"walletAddress",""),n(Io,"createdJustNow",!1),n(Io,"tribe",0),n(Io,"reviveQuestGoldBuff",0),n(Io,"reviveQuestDurationBuff",0),n(Io,"reviveQuestOpenCostBuff",0),n(Io,"maxWave",1),n(Io,"gem",0),n(Io,"redGem",0),n(Io,"accuMedal",0),n(Io,"accuWave",0),n(Io,"medalBuyCount",0),n(Io,"needRevive",!1),n(Io,"medal",0),n(Io,"honorCoin",0),n(Io,"_speed15",Vn(xi.SP15_SENTINEL)),n(Io,"_speed20",Vn(xi.SP20_SENTINEL)),n(Io,"medalBuffLevel",0),n(Io,"goldBuffLevel",0),n(Io,"daySkipLevel",0),n(Io,"lastReviveTime",0),n(Io,"numRevive",0),n(Io,"numRevive30",0),n(Io,"massiveGemCost",0),n(Io,"massiveSize",0),n(Io,"massiveRequiredMedal",0),n(Io,"numReviveHoldActive",!1),n(Io,"pendingNumRevive",-1),n(Io,"numReviveHoldTimer",null),n(Io,"heart",0),n(Io,"adsEndTime",0),n(Io,"assistantEndTime",0),n(Io,"assistantPassEndTime",0),n(Io,"soulRestStartAt",0),n(Io,"soulRestEndAt",0),n(Io,"bestMedalPerMin",0),n(Io,"bestMedalPerMinAt",0),n(Io,"soulRestNextStartAt",0),n(Io,"soulRestSkipCount",0),n(Io,"castleKindNum",10001),n(Io,"castleLevel",0),n(Io,"castleEnhance",0),n(Io,"castleGoldLevels",[0,0,0,0,0,0,0,0,0,0]),n(Io,"castleMedalLevels",[0,0,0,0,0,0,0,0,0,0]),n(Io,"questsLevels",[0,0,0,0,0,0,0,0,0,0]),n(Io,"maxTeamSlots",5),n(Io,"unitsSlotIds",[]),n(Io,"unitsSlotKindNums",[]),n(Io,"unitsSlotLevels",[]),n(Io,"unitsSlotEnhances",[]),n(Io,"ownedUnitKindNums",[]),n(Io,"ownedUnitCounts",[]),n(Io,"treasuresMaxSlots",5),n(Io,"treasuresKindNums",[]),n(Io,"treasuresLevels",[]),n(Io,"treasuresOwned",[]),n(Io,"skillsKindNums",[]),n(Io,"activeSkills",[1,-1,-1]),n(Io,"_godBless",Vn(xi.GODBLESS_SENTINEL)),n(Io,"_skillSpeed",Vn(xi.SKILLSPEED_SENTINEL));
- =await Promise.resolve().then(()=>Vwi); + =await import("./chunks/vendor-misc.js").then(t=>t.x);
- ,void 0),s=await i.getInfo(); + ,__vite__mapDeps([0,1,2]),import.meta.url),i=await s.getInfo();
AttestManager 6 hunks, 6 statements
- =await Promise.resolve().then(()=>czt); + =await import("./chunks/vendor-misc.js").then(t=>t.u);
- ,void 0); + ,__vite__mapDeps([0,1,2]),import.meta.url);
- =await Promise.resolve().then(()=>s_i); + =await import("./chunks/vendor-misc.js").then(t=>t.z);
- ,void 0),h=await s.requestIntegrityToken({ + ,__vite__mapDeps([0,1,2]),import.meta.url),n=await i.requestIntegrityToken({
- =await Promise.resolve().then(()=>n_i); + =await import("./chunks/AppSig.js");
- ,void 0),i=await t.getSig(); + ,__vite__mapDeps([17,0,1,2]),import.meta.url),s=await t.getSig();
Profile 4 hunks, 6 statements
- super(),Zt(this,"frame",new Xe(RS.getTexture("UI_Ekkorr","ProfileFrame_01"))),Zt(this,"icon",new Xe(RS.getTexture("UI_Ekkorr","Profile_Human"))),Zt(this,"lblLevel",new iG("Lv.1",hD.COLOR_ORANGE,hD.DEFAULT_OUTLINE_FONT_OPTION_20)),Zt(this,"arrTribe",["Human","Human","Elf","Undead","Orc"]),this.eventMode="static",this.cursor="pointer",this.addChild(this.icon),this.frame.x=-15,this.frame.y=-8,this.icon.x=-3,this.icon.y=4,this.scale=.85,this.lblLevel.x=10,this.lblLevel.y=10,this.addChild(this.frame),this.setLevel(1),this.addChild(this.lblLevel)} + super(),n(this,"badge",new Oc(124)),n(this,"lblLevel",new to("Lv.1",en.COLOR_ORANGE,en.DEFAULT_OUTLINE_FONT_OPTION_20)),this.eventMode="static",this.cursor="pointer",this.badge.setEventMode("dynamic"),this.badge.x=-15,this.badge.y=-8,this.addChild(this.badge),this.scale=.85,this.lblLevel.x=10,this.lblLevel.y=10,this.setLevel(1),this.addChild(this.lblLevel),gc.onChange(()=>this.setTribe(Oo.tribe))}
- this.icon.texture=RS.getTexture("UI_Ekkorr",`Profile_${ - this.arrTribe[t]} - `)} + const s=gc.slot(t); + this.badge.setLook(s.tribe,s.face,s.frame)}
- `,this.lblLevel.x=this.icon.x+.5*(this.icon.width-this.lblLevel.width),this.lblLevel.y=this.icon.y+this.icon.height-25} + `,this.lblLevel.x=this.badge.x+.5*(this.badge.size-this.lblLevel.width),this.lblLevel.y=79}
- this.setTribe(TG.tribe),this.setLevel(Math.floor(TG.maxWave/100))} + gc.ensure(),gc.checkFloors(Oo.maxWave),this.setTribe(Oo.tribe),Ac.getInstance().refresh(),this.setLevel(Math.floor(Oo.maxWave/100))}
GoogleAuthManager 3 hunks, 6 statements
- const fKt="google-login-success",pKt="google-login-failed"; - let wKt=(Lt=class{ + const OI="google-login-success",vI="google-login-failed",CI=class t{
- theme:"outline",size:"medium",text:"signin_with",shape:"rectangular",...i} + theme:"outline",size:"medium",text:"signin_with",shape:"rectangular",...s}
- ,Qt(Lt,"GoogleAuthManager"),Zt(Lt,"_instance"),Lt); + ; + e(CI,"GoogleAuthManager"),n(CI,"_instance"); + let RI=CI;
ChatOverlay 6 hunks, 6 statements
- Zt(this,"root"),Zt(this,"card"),Zt(this,"listEl"),Zt(this,"statusEl"),Zt(this,"titleEl"),Zt(this,"actionSheetEl"),Zt(this,"actionSheetBackdrop"),Zt(this,"actionSheetContent"),Zt(this,"tabBarEl"),Zt(this,"tabSystemBtn"),Zt(this,"tabGlobalBtn"),Zt(this,"tabGuildBtn"),Zt(this,"tabDMBtn"),Zt(this,"tabDMUnreadBadge"),Zt(this,"tabGuildRedDot"),Zt(this,"tabSystemRedDot"),Zt(this,"tabWhisperRedDot"),Zt(this,"listWrap"),Zt(this,"dmListWrap"),Zt(this,"dmListEl"),Zt(this,"newMsgBadgeEl"),Zt(this,"newMsgBadgeCount",0),Zt(this,"hideTransitionTimer",null),Zt(this,"inputBar"),Zt(this,"emojiPicker"),Zt(this,"textareaEl"),Zt(this,"sendBtnEl"),Zt(this,"emojiBtnEl"),Zt(this,"emojiGridEl"),Zt(this,"emojiCategoryBtns",[]),Zt(this,"emojiPickerOpen",!1),Zt(this,"sending",!1),Zt(this,"roomUnsubs",[]),Zt(this,"globalUnsubs",[]),Zt(this,"rows",new Map),Zt(this,"orderedIds",[]),Zt(this,"viewMode","guild"),Zt(this,"globalCooldownEnd",0),Zt(this,"globalCooldownTimer",null),Zt(this,"activeRoom",ED.getInstance().getGuildRoom()),Zt(this,"activeDMPeer",null),Zt(this,"channelSwitchBtn"),Zt(this,"channelSwitching",!1),Zt(this,"totalUnread",0),Zt(this,"loadingOlder",!1),Zt(this,"exhaustedOlder",!1),Zt(this,"pendingTranslations",new Set),Zt(this,"translationCache",new Map),Zt(this,"timeTickerId",null),Zt(this,"handleNew",Qt(t=>{ + n(this,"root"),n(this,"card"),n(this,"listEl"),n(this,"statusEl"),n(this,"titleEl"),n(this,"actionSheetEl"),n(this,"actionSheetBackdrop"),n(this,"actionSheetContent"),n(this,"tabBarEl"),n(this,"tabSystemBtn"),n(this,"tabGlobalBtn"),n(this,"tabGuildBtn"),n(this,"tabDMBtn"),n(this,"tabDMUnreadBadge"),n(this,"tabGuildRedDot"),n(this,"tabSystemRedDot"),n(this,"tabWhisperRedDot"),n(this,"listWrap"),n(this,"dmListWrap"),n(this,"dmListEl"),n(this,"newMsgBadgeEl"),n(this,"newMsgBadgeCount",0),n(this,"hideTransitionTimer",null),n(this,"inputBar"),n(this,"emojiPicker"),n(this,"textareaEl"),n(this,"sendBtnEl"),n(this,"emojiBtnEl"),n(this,"emojiGridEl"),n(this,"emojiCategoryBtns",[]),n(this,"emojiPickerOpen",!1),n(this,"sending",!1),n(this,"roomUnsubs",[]),n(this,"globalUnsubs",[]),n(this,"rows",new Map),n(this,"orderedIds",[]),n(this,"viewMode","guild"),n(this,"dmBackCloses",!1),n(this,"globalCooldownEnd",0),n(this,"globalCooldownTimer",null),n(this,"activeRoom",Tn.getInstance().getGuildRoom()),n(this,"activeDMPeer",null),n(this,"channelSwitchBtn"),n(this,"channelSwitching",!1),n(this,"totalUnread",0),n(this,"loadingOlder",!1),n(this,"exhaustedOlder",!1),n(this,"pendingTranslations",new Set),n(this,"translationCache",new Map),n(this,"timeTickerId",null),n(this,"handleNew",e(t=>{
- this.listEl.insertBefore(n,this.listEl.firstChild),this.orderedIds=[...e.map(t=>t.id),...this.orderedIds]; + this.listEl.insertBefore(e,this.listEl.firstChild),this.orderedIds=[...h.map(t=>t.id),...this.orderedIds];
- "dm"===this.viewMode?this.setViewMode("dmList"):this.hide()} + "dm"!==this.viewMode||this.dmBackCloses?this.hide():this.setViewMode("dmList")}
- openDMWith(t,i){ + openDMWith(t,s,i){
- ))} + ),this.dmBackCloses=!!(null==i?void 0:i.backCloses))}
- this.viewMode=t; + this.viewMode=t,this.dmBackCloses=!1;
HeroMassiveBuyResultPopup 5 hunks, 6 statements
- super(),Zt(this,"slotMsg"),Zt(this,"slotMsgBg"),Zt(this,"slotContainer"),Zt(this,"slotHeroIcons"),Zt(this,"slotHeroContainer"),Zt(this,"barrackMsg"),Zt(this,"barrackMsgBg"),Zt(this,"barrackContainer"),Zt(this,"barrackHeroIcons"),Zt(this,"barrackHeroContainer"),Zt(this,"btnHistory"),Zt(this,"btnConfirm"),Zt(this,"historyDescription",""),Zt(this,"slotKindnums",[]),Zt(this,"barrackKindnums",[]),this.btnClose.removeFromParent(),this.slotContainer=new Ke,this.addChild(this.slotContainer),this.slotMsgBg=new KU,this.slotMsgBg.setIndex(2),this.slotMsgBg.width=this.width-60,this.slotContainer.addChild(this.slotMsgBg); + super(),n(this,"slotMsg"),n(this,"slotMsgBg"),n(this,"slotContainer"),n(this,"slotHeroIcons"),n(this,"slotHeroContainer"),n(this,"barrackMsg"),n(this,"barrackMsgBg"),n(this,"barrackContainer"),n(this,"barrackHeroIcons"),n(this,"barrackHeroContainer"),n(this,"lblMedal"),n(this,"iconMedal",new Il("UI_STAR_ICON","0",en.COLOR_WHITE,en.DEFAULT_FONT_OPTION_18)),n(this,"btnHistory"),n(this,"btnConfirm"),n(this,"historyDescription",""),n(this,"slotKindnums",[]),n(this,"barrackKindnums",[]),this.btnClose.removeFromParent(),this.slotContainer=new l,this.addChild(this.slotContainer),this.slotMsgBg=new Wa,this.slotMsgBg.setIndex(2),this.slotMsgBg.width=this.width-60,this.slotContainer.addChild(this.slotMsgBg);
- t.fill=hD.DEFAULT_COLOR,this.slotMsg=new iG("",t.fill,t),this.slotMsg.y=15,this.slotContainer.addChild(this.slotMsg),hD.setLabelWrapWidth(this.slotMsg,this.slotMsgBg.width-40),this.slotHeroIcons=[],this.slotHeroContainer=new Ke,this.slotContainer.addChild(this.slotHeroContainer),this.barrackContainer=new Ke,this.addChild(this.barrackContainer),this.barrackMsgBg=new KU,this.barrackMsgBg.setIndex(2),this.barrackMsgBg.width=this.width-60,this.barrackContainer.addChild(this.barrackMsgBg),this.barrackMsg=new iG("",t.fill,t),this.barrackMsg.y=this.slotMsg.y,this.barrackContainer.addChild(this.barrackMsg),hD.setLabelWrapWidth(this.barrackMsg,this.barrackMsgBg.width-40),this.barrackHeroIcons=[],this.barrackHeroContainer=new Ke,this.barrackContainer.addChild(this.barrackHeroContainer),this.btnHistory=new aKt(""),this.addChild(this.btnHistory),this.btnHistory.onClick=this.onHistoryBtnClick.bind(this),this.btnConfirm=new aB(""),this.addChild(this.btnConfirm),this.btnConfirm.onClick=this.onConfirmBtnClick.bind(this),this.updateLanguage()} + t.fill=en.DEFAULT_COLOR,this.slotMsg=new to("",t.fill,t),this.slotMsg.y=15,this.slotContainer.addChild(this.slotMsg),en.setLabelWrapWidth(this.slotMsg,this.slotMsgBg.width-40),this.slotHeroIcons=[],this.slotHeroContainer=new l,this.slotContainer.addChild(this.slotHeroContainer),this.barrackContainer=new l,this.addChild(this.barrackContainer),this.barrackMsgBg=new Wa,this.barrackMsgBg.setIndex(2),this.barrackMsgBg.width=this.width-60,this.barrackContainer.addChild(this.barrackMsgBg),this.barrackMsg=new to("",t.fill,t),this.barrackMsg.y=this.slotMsg.y,this.barrackContainer.addChild(this.barrackMsg),en.setLabelWrapWidth(this.barrackMsg,this.barrackMsgBg.width-40),this.lblMedal=new to("",t.fill,t),this.addChild(this.lblMedal),en.setLabelWrapWidth(this.lblMedal,this.width-40),this.addChild(this.iconMedal),this.barrackHeroIcons=[],this.barrackHeroContainer=new l,this.barrackContainer.addChild(this.barrackHeroContainer),this.btnHistory=new AI(""),this.addChild(this.btnHistory),this.btnHistory.onClick=this.onHistoryBtnClick.bind(this),this.btnConfirm=new nr(""),this.addChild(this.btnConfirm),this.btnConfirm.onClick=this.onConfirmBtnClick.bind(this),this.updateLanguage()}
- this.slotContainer.visible&&(this.slotContainer.x=.5*(this.width-this.slotMsgBg.width),this.slotContainer.y=t,t+=this.slotContainer.height+50,this.slotMsg.x=.5*(this.slotMsgBg.width-this.slotMsg.width),this.slotHeroContainer.x=this.slotMsgBg.x+.5*(this.slotMsgBg.width-this.slotHeroContainer.width)),this.barrackContainer.visible&&(this.barrackContainer.x=.5*(this.width-this.barrackMsgBg.width),this.barrackContainer.y=t,t+=this.barrackContainer.height+50,this.barrackMsg.x=.5*(this.barrackMsgBg.width-this.barrackMsg.width),this.barrackHeroContainer.x=this.barrackMsgBg.x+.5*(this.barrackMsgBg.width-this.barrackHeroContainer.width)),this.btnHistory.x=.5*(this.width-this.btnHistory.width-this.btnConfirm.width-20),this.btnConfirm.x=this.btnHistory.x+this.btnHistory.width+20,this.btnHistory.y=t,this.btnConfirm.y=this.btnHistory.y,this.height=this.btnConfirm.y+this.btnConfirm.height+50} - setData(t,i,s,e){ + this.slotContainer.visible&&(this.slotContainer.x=.5*(this.width-this.slotMsgBg.width),this.slotContainer.y=t,t+=this.slotContainer.height+50,this.slotMsg.x=.5*(this.slotMsgBg.width-this.slotMsg.width),this.slotHeroContainer.x=this.slotMsgBg.x+.5*(this.slotMsgBg.width-this.slotHeroContainer.width)),this.barrackContainer.visible&&(this.barrackContainer.x=.5*(this.width-this.barrackMsgBg.width),this.barrackContainer.y=t,t+=this.barrackContainer.height+50,this.barrackMsg.x=.5*(this.barrackMsgBg.width-this.barrackMsg.width),this.barrackHeroContainer.x=this.barrackMsgBg.x+.5*(this.barrackMsgBg.width-this.barrackHeroContainer.width)),this.lblMedal.x=.5*(this.width-this.lblMedal.width),this.lblMedal.y=t,t+=this.lblMedal.height+5,this.iconMedal.x=.5*(this.width-this.iconMedal.width),this.iconMedal.y=t,t+=this.iconMedal.height+20,this.btnHistory.x=.5*(this.width-this.btnHistory.width-this.btnConfirm.width-20),this.btnConfirm.x=this.btnHistory.x+this.btnHistory.width+20,this.btnHistory.y=t,this.btnConfirm.y=this.btnHistory.y,this.height=this.btnConfirm.y+this.btnConfirm.height+50} + setData(t,s,i,h,n){
- this.updateLayout(),this.btnHistory.activated=!1,this.btnConfirm.activated=!1,setTimeout(()=>{ + this.lblMedal.text=Nr.getText("GAME_1933","사용한 훈장"),this.iconMedal.text=sc.setComma(n),this.updateLayout(),this.btnHistory.activated=!1,this.btnConfirm.activated=!1,setTimeout(()=>{
- 1==t?(i=[63,65,57,63,63],s=[],e=[6789,6790,6791,6792],n=[6789,6790,6791,6792,6793,6794]):2==t?(i=[63,65,57,63,63],s=[],e=[6789,6790,6791,6792],n=[6789,6790,6791,6792]):3==t&&(i=[53,51,68,51,57,64,61,67,25,59,61,79,79,51,79,59,55,65,68,64,25,53,62,59,66,57,55,69,66,64],s=[],e=[6804,6807,7032],n=[6804,6807,7032,7033,7034,7035]),this.setData(i,s,e,n),this.show()} + 1==t?(s=[63,65,57,63,63],i=[],h=[6789,6790,6791,6792],e=[6789,6790,6791,6792,6793,6794]):2==t?(s=[63,65,57,63,63],i=[],h=[6789,6790,6791,6792],e=[6789,6790,6791,6792]):3==t&&(s=[53,51,68,51,57,64,61,67,25,59,61,79,79,51,79,59,55,65,68,64,25,53,62,59,66,57,55,69,66,64],i=[],h=[6804,6807,7032],e=[6804,6807,7032,7033,7034,7035]),this.setData(s,i,h,e,1e6),this.show()}
HeroSubView 1 hunks, 6 statements
+ refreshLevels(){ + var t; + if(null!=(null==(t=this.parent)?void 0:t.parent)){ + for(const t of this.getListItems())t.data&&t.setData(t.data); + this.lastGold=-1} + }
HeroDetailPopup 6 hunks, 6 statements
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
- =await Promise.resolve().then(()=>L_i); + =await import("./chunks/TransConfirmPopup.js");
- ,void 0); + ,__vite__mapDeps([23,1,0,2,4,5]),import.meta.url);
- =await Promise.resolve().then(()=>L_i); + =await import("./chunks/TransConfirmPopup.js");
- ,void 0); + ,__vite__mapDeps([23,1,0,2,4,5]),import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
PVPBattleSubView 2 hunks, 6 statements
- super(),Zt(this,"dashboard",new ep),Zt(this,"rankBadge",new w0t(70)),Zt(this,"lblPointTitle",a0t(13,r0t)),Zt(this,"lblPoint",a0t(32,o0t)),Zt(this,"lblRank",a0t(14,h0t)),Zt(this,"lblTicketTitle",a0t(13,r0t)),Zt(this,"lblTicket",new OF("PVP_TICKET_ON","",h0t,hD.DEFAULT_FONT_OPTION_16)),Zt(this,"lblTimer",new OF("Icon_Time02","",r0t,{ - ...hD.DEFAULT_FONT_OPTION_16,fontSize:14} - )),Zt(this,"lblOpponents",a0t(18)),Zt(this,"lblSettlement",new iG("",16755370,hD.DEFAULT_OUTLINE_FONT_OPTION_18)),Zt(this,"opponentList"),Zt(this,"btnBuyTicket",new M$("UI_GEM","","티켓구매",.8,140,60)),Zt(this,"btnRefreshOppo",new M$("UI_GEM","","새로고침",.8,140,60)),Zt(this,"pvpInfo",null),Zt(this,"userPvp",null),Zt(this,"battleId",0),Zt(this,"lastLoadTime",0),Zt(this,"requestPending",!1),Zt(this,"requestPending2",!1),Zt(this,"timerRunning",!1),Zt(this,"timerUpdateCount",0),Zt(this,"rechargeTime",0),Zt(this,"myHeroKindNums",[]),Zt(this,"myHeroTrans",[]),this.dashboard.roundRect(5,0,298,92,13).fill(n0t).roundRect(313,0,302,92,13).fill(n0t),this.dashboard.eventMode="none",this.rankBadge.position.set(18,11),this.lblPointTitle.position.set(104,10),this.lblPoint.position.set(102,27),this.lblRank.position.set(104,66),this.lblTicketTitle.position.set(331,10),this.lblTicket.iconScale=.9,this.lblTicket.textSize=24,this.lblTicket.position.set(330,30),this.lblTimer.iconScale=.5,this.lblTimer.position.set(331,66),this.addChild(this.dashboard,this.rankBadge,this.lblPointTitle,this.lblPoint,this.lblRank,this.lblTicketTitle,this.lblTicket,this.lblTimer); + super(),n(this,"dashboard",new p),n(this,"rankBadge",new MG(96,{ + size:70,x:12,y:13} + )),n(this,"lblPointTitle",hG(13,sG)),n(this,"lblPoint",hG(32,iG)),n(this,"lblRank",hG(14,tG)),n(this,"lblTicketTitle",hG(13,sG)),n(this,"lblTicket",new Il("PVP_TICKET_ON","",tG,en.DEFAULT_FONT_OPTION_16)),n(this,"lblTimer",new Il("Icon_Time02","",sG,{ + ...en.DEFAULT_FONT_OPTION_16,fontSize:14} + )),n(this,"lblOpponents",hG(18)),n(this,"lblSettlement",new to("",16755370,en.DEFAULT_OUTLINE_FONT_OPTION_18)),n(this,"opponentList"),n(this,"btnBuyTicket",new Pc("UI_GEM","","티켓구매",.8,140,60)),n(this,"btnRefreshOppo",new Pc("UI_GEM","","새로고침",.8,140,60)),n(this,"pvpInfo",null),n(this,"userPvp",null),n(this,"battleId",0),n(this,"lastLoadTime",0),n(this,"requestPending",!1),n(this,"requestPending2",!1),n(this,"timerRunning",!1),n(this,"timerUpdateCount",0),n(this,"rechargeTime",0),n(this,"myHeroKindNums",[]),n(this,"myHeroTrans",[]),this.dashboard.roundRect(5,0,298,92,13).fill(Zk).roundRect(313,0,302,92,13).fill(Zk),this.dashboard.eventMode="none",this.rankBadge.position.set(6,-2),this.lblPointTitle.position.set(104,10),this.lblPoint.position.set(102,27),this.lblRank.position.set(104,66),this.lblTicketTitle.position.set(331,10),this.lblTicket.iconScale=.9,this.lblTicket.textSize=24,this.lblTicket.position.set(330,30),this.lblTimer.iconScale=.5,this.lblTimer.position.set(331,66),this.addChild(this.dashboard,this.rankBadge,this.lblPointTitle,this.lblPoint,this.lblRank,this.lblTicketTitle,this.lblTicket,this.lblTimer);
- this.rankBadge.setRank(t),this.lblPoint.text=Number(this.userPvp.point).toLocaleString(),c0t(this.lblPoint,184),this.lblRank.text=`${ + this.rankBadge.setMine(t),this.lblPoint.text=Number(this.userPvp.point).toLocaleString(),eG(this.lblPoint,184),this.lblRank.text=`${
GuildWarMainView 6 hunks, 6 statements
- this.applyGuildCard(i); + this.applyGuildCard(s),s&&"season3Rules"in s&&(Oj.season3=s.season3Rules??null);
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
- =await Promise.resolve().then(()=>Ewi); + =await import("./chunks/GuildWarBattlePopupV3.js");
- ,void 0).then(({ + ,__vite__mapDeps([7,1,0,2,4,8,9,5]),import.meta.url).then(({
- =await Promise.resolve().then(()=>Ewi); + =await import("./chunks/GuildWarBattlePopupV3.js");
- ,void 0).then(({ + ,__vite__mapDeps([7,1,0,2,4,8,9,5]),import.meta.url).then(({
RankingPopup 4 hunks, 6 statements
- super(),Zt(this,"tabs",new Soi(t.W,58)),Zt(this,"podium",new Ioi(t.W)),Zt(this,"list"),Zt(this,"lblMyTitle",new iG("",13216120)),Zt(this,"myCard",new Ke),Zt(this,"myBadge",new w0t(66)),Zt(this,"myName"),Zt(this,"myLv",new iG("",16769704)),Zt(this,"myValueIcon"),Zt(this,"myValue"),Zt(this,"myGap",new iG("",16767370)),Zt(this,"lblHideTeam",new iG("",12298639)),Zt(this,"hideTeamButton",new Eoi("ON")),Zt(this,"savingPrivacy",!1),this.myName=new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_20),this.myValueIcon=new Xe(RS.getTexture("UI_Ekkorr",voi[0])),this.myValue=new iG("",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_20),this.initialize()} + super(),n(this,"tabs",new Lq(t.W,58)),n(this,"podium",new kq(t.W)),n(this,"list"),n(this,"lblMyTitle",new to("",13216120)),n(this,"myCard",new l),n(this,"myProfile",new MG(96,{ + size:66,x:12,y:15} + )),n(this,"myName"),n(this,"myLv",new to("",16769704)),n(this,"myValueIcon"),n(this,"myValue"),n(this,"myGap",new to("",16767370)),n(this,"lblHideTeam",new to("",12298639)),n(this,"hideTeamButton",new Tq("ON")),n(this,"savingPrivacy",!1),this.myName=new to("",16777215,en.DEFAULT_OUTLINE_FONT_OPTION_20),this.myValueIcon=new u(nt.getTexture("UI_Ekkorr",Iq[0])),this.myValue=new to("",16777215,en.DEFAULT_OUTLINE_FONT_OPTION_20),this.initialize()}
- this.myCard.addChild(i),this.myBadge.x=8,this.myBadge.y=.5*(t.CARD_H-66),this.myCard.addChild(this.myBadge),this.myName.x=86,this.myName.y=14,this.myCard.addChild(this.myName),this.myLv.textSize=14,this.myLv.x=87,this.myLv.y=46,this.myCard.addChild(this.myLv),this.myCard.addChild(this.myValueIcon),this.myValue.textSize=22,this.myCard.addChild(this.myValue),this.myGap.textSize=15,this.myCard.addChild(this.myGap),this.addChild(this.myCard),i.eventMode="static",i.cursor="pointer",i.on("pointertap",()=>{ + this.myCard.addChild(s),this.myProfile.position.set(-4,.5*(t.CARD_H-96)),this.myCard.addChild(this.myProfile),this.myName.x=86,this.myName.y=14,this.myCard.addChild(this.myName),this.myLv.textSize=14,this.myLv.x=87,this.myLv.y=46,this.myCard.addChild(this.myLv),this.myCard.addChild(this.myValueIcon),this.myValue.textSize=22,this.myCard.addChild(this.myValue),this.myGap.textSize=15,this.myCard.addChild(this.myGap),this.addChild(this.myCard),s.eventMode="static",s.cursor="pointer",s.on("pointertap",()=>{
- this.tabs.setLabels(woi().map(t=>t.label)),this.tabs.setSelected(t.selectedIndex),this.lblMyTitle.text=NB.getText("COMMON_374","내 순위"),this.lblHideTeam.text=NB.getText("RANKING_HIDE_TEAM","내 팀 편성 숨기기"),this.hideTeamButton.enabled=TG.hideRankingTeam,this.updateLayout(),await t.loadRanking(); + this.tabs.setLabels(mq().map(t=>t.label)),this.tabs.setSelected(t.selectedIndex),this.lblMyTitle.text=Nr.getText("COMMON_374","내 순위"),this.lblHideTeam.text=Nr.getText("GAME_2079","내 팀 편성 숨기기"),this.hideTeamButton.enabled=Oo.hideRankingTeam,this.updateLayout(),await t.loadRanking();
- this.myBadge.setRank(Number((null==s?void 0:s.rank)??0)),this.myName.text=String((null==s?void 0:s.name)||TG.name||""),this.myLv.text=`Lv.${ + this.myProfile.setMine(Number((null==i?void 0:i.rank)??0),null==i?void 0:i.deco),this.myName.text=String((null==i?void 0:i.name)||Oo.name||""),this.myLv.text=`Lv.${
TutorialController 6 hunks, 6 statements
- ,void 0),e=s.getInstance().getItemRenderers(),n=null==(t=e[0])?void 0:t.tutorialTargets,h=null==(i=e[1])?void 0:i.tutorialTargets; + ,void 0,import.meta.url),h=i.getInstance().getItemRenderers(),e=null==(t=h[0])?void 0:t.tutorialTargets,n=null==(s=h[1])?void 0:s.tutorialTargets;
- ,void 0),{ + ,void 0,import.meta.url),{
- ]=await Promise.all([ei(()=>Promise.resolve().then(()=>uui),void 0),ei(()=>Promise.resolve().then(()=>Eli),void 0),ei(()=>Promise.resolve().then(()=>hP),void 0),ei(()=>Promise.resolve().then(()=>hJt),void 0)]),n=s.getInstance().castleVO,h=e.getInstance().getCost(n.enhance+1); + ]=await Promise.all([o(()=>Promise.resolve().then(()=>M0),void 0,import.meta.url),o(()=>Promise.resolve().then(()=>CZ),void 0,import.meta.url),o(()=>Promise.resolve().then(()=>Js),void 0,import.meta.url),o(()=>Promise.resolve().then(()=>jR),void 0,import.meta.url)]),n=i.getInstance().castleVO,r=h.getInstance().getCost(n.enhance+1);
- await hli.run([...r?[]:[{ + await cZ.run([...a?[]:[{
- ,void 0); + ,void 0,import.meta.url);
- ,void 0),s=i.getInstance().reviveButton; + ,void 0,import.meta.url),i=s.getInstance().reviveButton;
CastleUpgradeItemRenderer 6 hunks, 6 statements
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
- =await Promise.resolve().then(()=>WEi); + =await import("./chunks/SoulRestSkipConfirmPopup.js");
- ,void 0); + ,__vite__mapDeps([37,1,0,2,4,5]),import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
BattleController 5 hunks, 6 statements
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
- return this.spawnSchedule.splice(0,this.spawnScheduleIndex),this.spawnScheduleIndex=0,this.spawnSchedule.push(...o),this.spawnSchedule.sort((t,i)=>t.spawnTime-i.spawnTime),this.activeWaveNumbers.push(s),this.waveSpawnStatus.set(s,!1),this.totalEnemiesInWave+=r,this.allEnemiesSpawned=!1,Sdi.getInstance().updateWaves(this.activeWaveNumbers),!0} + return this.spawnSchedule.splice(0,this.spawnScheduleIndex),this.spawnScheduleIndex=0,this.spawnSchedule.push(...r),this.spawnSchedule.sort((t,s)=>t.spawnTime-s.spawnTime),this.activeWaveNumbers.push(i),this.waveSpawnStatus.set(i,!1),this.totalEnemiesInWave+=o,this.allEnemiesSpawned=!1,j1.getInstance().updateWaves(this.activeWaveNumbers),!0}
- ...s} + ...i}
- for(const i of this.skippedWaves)this.shownDialogueWaves.has(i)||(t.push(...rYt.getInstance().getByWave(i)),this.shownDialogueWaves.add(i)); - this.shownDialogueWaves.has(TG.wave)||(t.push(...rYt.getInstance().getByWave(TG.wave)),this.shownDialogueWaves.add(TG.wave)),t.length>0&&Wci.getInstance().showDialogues(t)} + for(const s of this.skippedWaves)this.shownDialogueWaves.has(s)||(t.push(...zO.getInstance().getByWave(s)),this.shownDialogueWaves.add(s)); + this.shownDialogueWaves.has(Oo.wave)||(t.push(...zO.getInstance().getByWave(Oo.wave)),this.shownDialogueWaves.add(Oo.wave)),t.length>0&&XJ.getInstance().showDialogues(t)}
PetDataManager 5 hunks, 5 statements
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
- =await Promise.resolve().then(()=>Px); + =await import("./chunks/index.js");
- ,void 0).then(({ + ,__vite__mapDeps([3,1,0,2,4,5]),import.meta.url).then(({
- ),this.list.length=0,this.list.push(...e),this.objList.clear(); + ),this.list.length=0,this.list.push(...h),this.objList.clear();
ActiveSkillButton 5 hunks, 5 statements
- ,"onClick")),Zt(this,"durationFrames",1350),Zt(this,"remainingFrames",0),Zt(this,"displayCount",0),Zt(this,"id",0),Zt(this,"canUse",!1),Zt(this,"_enabled",!0),Zt(this,"_started",!1),this.container.scale.set(.8),this.container.addChild(this.icon),this.icon.x=.5*-this.icon.width,this.icon.y=.5*-this.icon.height,this.container.addChild(this.iconOff),this.iconOff.x=.5*-this.iconOff.width,this.iconOff.y=.5*-this.iconOff.height,this.iconOff.visible=!1,this.container.x=.5*this.container.width,this.container.y=.5*this.container.height,this.addChild(this.container),this.lblTime.text="30",this.addChild(this.lblTime),this.w=this.container.width,this.lblTime.x=(this.w-this.lblTime.width)/2,this.lblTime.y=(this.container.height-this.lblTime.height)/2,this.lblTime.eventMode="none",this.icon.eventMode="static",this.icon.on("pointerdown",this.onDown,this),this.icon.on("pointerup",this.onUp,this),this.icon.on("pointerupoutside",this.onUp,this),this.alpha=.9} + ,"onClick")),n(this,"durationFrames",1350),n(this,"displayCount",0),n(this,"id",0),n(this,"canUse",!1),n(this,"_enabled",!0),n(this,"_started",!1),this.l=0,this.container.scale.set(.8),this.container.addChild(this.icon),this.icon.x=.5*-this.icon.width,this.icon.y=.5*-this.icon.height,this.container.addChild(this.iconOff),this.iconOff.x=.5*-this.iconOff.width,this.iconOff.y=.5*-this.iconOff.height,this.iconOff.visible=!1,this.container.x=.5*this.container.width,this.container.y=.5*this.container.height,this.addChild(this.container),this.lblTime.text="30",this.addChild(this.lblTime),this.w=this.container.width,this.lblTime.x=(this.w-this.lblTime.width)/2,this.lblTime.y=(this.container.height-this.lblTime.height)/2,this.lblTime.eventMode="none",this.icon.eventMode="static",this.icon.on("pointerdown",this.onDown,this),this.icon.on("pointerup",this.onUp,this),this.icon.on("pointerupoutside",this.onUp,this),this.alpha=.9}
- 0!=this.enabled&&(this.remainingFrames=this.durationFrames,this.displayCount=0,this.canUse=!1,this.iconOff.visible=!0,this.icon.visible=!1,this.lblTime.visible=!0,this.updateLabel(),nU.getInstance().add(this.onEnter,this))} + 0!=this.enabled&&(this.l=this.durationFrames,this.displayCount=0,this.canUse=!1,this.iconOff.visible=!0,this.icon.visible=!1,this.lblTime.visible=!0,this.updateLabel(),sa.getInstance().add(this.onEnter,this))}
- if(this.remainingFrames--,this.remainingFrames<=0)return nU.getInstance().remove(this.onEnter,this),this.iconOff.visible=!1,this.icon.visible=!0,this.lblTime.visible=!1,void(this.canUse=!0); + if(this.l--,this.l<=0)return sa.getInstance().remove(this.onEnter,this),this.iconOff.visible=!1,this.icon.visible=!0,this.lblTime.visible=!1,void(this.canUse=!0);
- const t=Math.ceil(this.remainingFrames/60); + const t=Math.ceil(this.l/60);
- 0!=this._enabled&&(nU.getInstance().remove(this.onEnter,this),this.remainingFrames=0,this.displayCount=0,this.canUse=!0,this.iconOff.visible=!1,this.icon.visible=!0,this.lblTime.visible=!1,this._started=!0)} + 0!=this._enabled&&(sa.getInstance().remove(this.onEnter,this),this.l=0,this.displayCount=0,this.canUse=!0,this.iconOff.visible=!1,this.icon.visible=!0,this.lblTime.visible=!1,this._started=!0)}
BattleAutoController 1 hunks, 5 statements
- const yH=class t{ + const Yu=Object.freeze(Object.defineProperty({ + __proto__:null,CommonToast:Ku} + ,Symbol.toStringTag,{ + value:"Module"} + )),zu=class t{
RunInfoPopup 2 hunks, 5 statements
- let IH=OH,kH=(Qt(Q=class extends pB{ + let td=Zu; + const sd=class t extends ur{
- ,"RunInfoPopup"),Zt(Q,"_instance"),Zt(Q,"REFRESH_FRAMES",30),Q); + ; + e(sd,"RunInfoPopup"),n(sd,"_instance"),n(sd,"REFRESH_FRAMES",30); + let id=sd;
ShopView 2 hunks, 5 statements
- let HXt=$Xt,WXt=(Qt(Gt=class extends Lqt{ + let NR=yR; + const kR=class t extends SC{
- ,"ShopView"),Zt(Gt,"instance"),Gt); + ; + e(kR,"ShopView"),n(kR,"instance"); + let GR=kR;
GuildBuildingItemRenderer 5 hunks, 5 statements
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
- =await Promise.resolve().then(()=>PEi); + =await import("./chunks/ArcheryGamePopup.js");
- ,void 0).then(({ + ,__vite__mapDeps([34,1,0,2,4,5]),import.meta.url).then(({
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
GuildRaidBattleReadyPopup 5 hunks, 5 statements
- ...hD.DEFAULT_OUTLINE_FONT_OPTION_16,fontSize:13} + ...en.DEFAULT_OUTLINE_FONT_OPTION_16,fontSize:13}
- =await Promise.resolve().then(()=>Dwi); + =await import("./chunks/GuildWarSquadsPopup.js");
- ,void 0).then(({ + ,__vite__mapDeps([12,1,0,2,11,4,5]),import.meta.url).then(({
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
GuildRaidPopup 5 hunks, 5 statements
- ...i,initialSquads:t.loadLastSquads(s.main,s.sub),onSquadsChange:Qt(i=>t.saveLastSquads(s.main,s.sub,i),"onSquadsChange"),onBattleStart:Qt((t,i)=>this.startRaidBattle(t,i),"onBattleStart"),onPracticeStart:Qt((t,i,s,e)=>this.startPracticeBattle(t,i,s,e),"onPracticeStart")} + ...s,initialSquads:t.loadLastSquads(i.main,i.sub),onSquadsChange:e(s=>t.saveLastSquads(i.main,i.sub,s),"onSquadsChange"),onBattleStart:e((t,s)=>this.startRaidBattle(t,s),"onBattleStart"),onPracticeStart:e((t,s,i,h)=>this.startPracticeBattle(t,s,i,h),"onPracticeStart")}
- ,void 0); + ,void 0,import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
- ...i,curHp:n,userTicket:this.userTicket,currentBattleUser:""} + ...s,curHp:e,userTicket:this.userTicket,currentBattleUser:""}
- ,void 0); + ,void 0,import.meta.url);
TopMenu 5 hunks, 5 statements
- YG(),vdi.getInstance().showProfile()} + Ko(),$1.getInstance().setPositonRatioY(.5),$1.getInstance().showProfile()}
- =await Promise.resolve().then(()=>pAi); + =await import("./chunks/StampCalendarPopup.js");
- ,void 0); + ,__vite__mapDeps([42,1,0,2,43,4,5]),import.meta.url);
- =await Promise.resolve().then(()=>hMi); + =await import("./chunks/AttendEventPopup.js");
- ,void 0); + ,__vite__mapDeps([27,1,0,2,4,5]),import.meta.url);
PetAwakeningEffects 4 hunks, 4 statements
- kindNum:n.kindNum,grade:h.grade,count:n.count,trans:[...n.trans],contrib:c} + kindNum:e.kindNum,grade:n.grade,count:e.count,trans:[...e.trans],contrib:l}
- kindNum:n.kindNum,grade:h.grade,count:n.count,trans:[...n.trans],contrib:c} + kindNum:e.kindNum,grade:n.grade,count:e.count,trans:[...e.trans],contrib:l}
- kindNum:n.kindNum,grade:h.grade,count:n.count,trans:[...n.trans],contrib:c} + kindNum:e.kindNum,grade:n.grade,count:e.count,trans:[...e.trans],contrib:l}
- kindNum:n.kindNum,grade:h.grade,count:n.count,trans:[...n.trans],contrib:c} + kindNum:e.kindNum,grade:n.grade,count:e.count,trans:[...e.trans],contrib:l}
MiniAscentService 4 hunks, 4 statements
- seasonId:t,chapter:i,floor:s,...e?{ + seasonId:t,chapter:s,floor:i,...h?{
- chapter:t,...i?{ + chapter:t,...s?{
- ,...i?{ + ,...s?{
- chapter:i,...s?{ + chapter:s,...i?{
EventDataManager 1 hunks, 4 statements
- if("TOWER"===t.type&&t.action)try{ - 62===JSON.parse(t.action).seasonNumber&&(t.startTime="2026-10-10T00:00:00.000Z",t.endTime="2026-10-12T23:59:59.000Z")} - catch(i){ - }
AppsFlyerBridge 4 hunks, 4 statements
- =await Promise.resolve().then(()=>__i); + =await import("./chunks/AppsFlyerManager.js");
- ,void 0),r=e.getTimeoutMilliSeconds(); + ,__vite__mapDeps([19,1,0,2,4,5]),import.meta.url),r=h.getTimeoutMilliSeconds();
- =await Promise.resolve().then(()=>__i); + =await import("./chunks/AppsFlyerManager.js");
- ,void 0),h=s.getTimeoutMilliSeconds(); + ,__vite__mapDeps([19,1,0,2,4,5]),import.meta.url),n=i.getTimeoutMilliSeconds();
RewardItem 4 hunks, 4 statements
- var v4=(t=>(t.gem="gem",t.redGem="redGem",t.gold="gold",t.medal="medal",t.honorCoin="honorCoin",t.guildPoint="guildPoint",t.guildCoin="guildCoin",t.raidCoin="raidCoin",t.runeTicket="runeTicket",t.hammer="hammer",t.hero="hero",t.trans="trans",t.massive="massive",t.pet="pet",t.petTicket="petTicket",t.petSelect="petSelect",t.heroGacha="heroGacha",t.heroSelect="heroSelect",t.heroTrans="heroTrans",t.treasure="treasure",t.treasureGacha="treasureGacha",t.treasureTrans="treasureTrans",t.buff="buff",t.instant="instant",t.ticket="ticket",t.pass="pass",t.ads="ads",t.speed="speed",t.assistant="assistant",t.dungeonTicket="dungeonTicket",t.miniAscentEnergy="miniAscentEnergy",t.bless="bless",t))(v4||{ + var HS=(t=>(t.gem="gem",t.redGem="redGem",t.gold="gold",t.medal="medal",t.honorCoin="honorCoin",t.guildPoint="guildPoint",t.guildCoin="guildCoin",t.raidCoin="raidCoin",t.runeTicket="runeTicket",t.hammer="hammer",t.hero="hero",t.trans="trans",t.massive="massive",t.pet="pet",t.petTicket="petTicket",t.petSelect="petSelect",t.heroGacha="heroGacha",t.heroSelect="heroSelect",t.heroTrans="heroTrans",t.treasure="treasure",t.treasureGacha="treasureGacha",t.treasureTrans="treasureTrans",t.buff="buff",t.instant="instant",t.ticket="ticket",t.pass="pass",t.ads="ads",t.speed="speed",t.assistant="assistant",t.dungeonTicket="dungeonTicket",t.miniAscentEnergy="miniAscentEnergy",t.bless="bless",t.profileFrame="profileFrame",t))(HS||{
- super(),Zt(this,"bg"),Zt(this,"img"),Zt(this,"heroIcon"),Zt(this,"petIcon"),Zt(this,"lblNum"),Zt(this,"_type",""),Zt(this,"_amount",0),Zt(this,"_grade",-1),Zt(this,"_kindNum",-1),Zt(this,"_subType",""),this.bg=new Xe(RS.getTexture("UI_Ekkorr","Frame_Reward_01")),this.addChild(this.bg),this.img=new Xe(RS.getTexture("UI_Ekkorr","UI_SHOP_GEM")),this.addChild(this.img),this.heroIcon=new c4,this.heroIcon.visible=!1,this.heroIcon.height=this.bg.height,this.heroIcon.scale.x=this.heroIcon.scale.y,this.addChild(this.heroIcon),this.petIcon=new u4,this.petIcon.visible=!1,this.petIcon.scale=.9,this.addChild(this.petIcon); + super(),n(this,"bg"),n(this,"img"),n(this,"heroIcon"),n(this,"petIcon"),n(this,"frameBadge",new Oc(62)),n(this,"lblNum"),n(this,"_type",""),n(this,"_amount",0),n(this,"_grade",-1),n(this,"_kindNum",-1),n(this,"_subType",""),this.bg=new u(nt.getTexture("UI_Ekkorr","Frame_Reward_01")),this.addChild(this.bg),this.img=new u(nt.getTexture("UI_Ekkorr","UI_SHOP_GEM")),this.addChild(this.img),this.heroIcon=new NS,this.heroIcon.visible=!1,this.heroIcon.height=this.bg.height,this.heroIcon.scale.x=this.heroIcon.scale.y,this.addChild(this.heroIcon),this.petIcon=new GS,this.petIcon.visible=!1,this.petIcon.scale=.9,this.addChild(this.petIcon),this.frameBadge.visible=!1,this.frameBadge.eventMode="none",this.addChild(this.frameBadge);
- this._type=t,this._amount=i,this._grade=s,this._kindNum=e,this._subType=n,this.img.visible=!1,this.bg.visible=!1,this.heroIcon.visible=!1,this.petIcon.visible=!1; + if(this._type=t,this._amount=s,this._grade=i,this._kindNum=h,this._subType=e,this.img.visible=!1,this.bg.visible=!1,this.heroIcon.visible=!1,this.petIcon.visible=!1,this.frameBadge.visible=!1,t==HS.profileFrame)return this.frameBadge.setLook(1,-1,h),this.frameBadge.position.set(.5*(this.bg.width-this.frameBadge.size),.5*(this.bg.height-this.frameBadge.size)-2),this.frameBadge.visible=!0,this.bg.visible=!0,this.lblNum.text="",void this.updateLayout();
- t==v4.gem?(r="UI_SHOP_GEM",h=.85):t==v4.redGem?(r="UI_SHOP_RED_GEM",h=.83):t==v4.gold?(r="m_gold",h=.7):t==v4.honorCoin?(r="UI_COIN_Big",h=.8):t==v4.hammer?(r="Icon_Hammer",h=1.5):t==v4.dungeonTicket||n==v4.dungeonTicket?(r="DungeonTick",h=.8):t==v4.miniAscentEnergy||n==v4.miniAscentEnergy?(r="ui_energy",h=56/30):t==v4.hero?(this.heroIcon.setDataWithKindNum(e),this.heroIcon.visible=!0):t==v4.ticket&&n==v4.heroGacha?r="Ticket_HeroGacha":t==v4.ticket&&n==v4.heroSelect?(r="Ticket_HeroSelect",h=.85):t==v4.trans&&n==v4.hero?r=9==this._grade?"Ticket_HeroTrans2":"Ticket_HeroTrans":t==v4.trans&&n==v4.massive?r="Ticket_UnitBuy":t==v4.pet?(this.petIcon.setPet(e,1),this.petIcon.visible=!0):t==v4.petTicket||n==v4.petTicket||t==v4.ticket&&n==v4.pet?(r="PetTick",h=.9):t==v4.petSelect||n==v4.petSelect||t==v4.ticket&&n==v4.petSelect?(r="Ticket_PetSelect",h=.9):t==v4.ticket&&n==v4.treasureGacha?(r="Ticket_TreasureGacha",h=.95):t==v4.trans&&n==v4.treasure?r=7===this._grade?"Ticket_TreasureTrans7":"Ticket_TreasureTrans6":t==v4.ads||n==v4.ads?(r="AdsRemove",h=.7):t==v4.speed||n==v4.speed?(r="UI_SHOP_SPEED2",h=.8):t==v4.assistant||n==v4.assistant?(r="Package_Secretary",h=.7):t==v4.guildCoin||t==v4.guildPoint?(r="GUILD_COIN",h=1.6):t==v4.raidCoin?(r="RaidCoin_on",h=1.5):t==v4.runeTicket&&(r="RuneTicket",h=1.2),r&&(this.img.scale=h,this.img.texture=RS.getTexture("UI_Ekkorr",r),this.img.visible=!0,this.bg.visible=!0),t==v4.ads||t==v4.speed||t==v4.assistant?this.lblNum.text=`${ + t==HS.gem?(o="UI_SHOP_GEM",n=.85):t==HS.redGem?(o="UI_SHOP_RED_GEM",n=.83):t==HS.gold?o="m_gold":t==HS.honorCoin?(o="UI_COIN_Big",n=.8):t==HS.hammer?(o="Icon_Hammer",n=1.5):t==HS.dungeonTicket||e==HS.dungeonTicket?(o="DungeonTick",n=.8):t==HS.miniAscentEnergy||e==HS.miniAscentEnergy?(o="ui_energy",n=56/30):t==HS.hero?(this.heroIcon.setDataWithKindNum(h),this.heroIcon.visible=!0):t==HS.ticket&&e==HS.heroGacha?o="Ticket_HeroGacha":t==HS.ticket&&e==HS.heroSelect?(o="Ticket_HeroSelect",n=.85):t==HS.trans&&e==HS.hero?o=9==this._grade?"Ticket_HeroTrans2":"Ticket_HeroTrans":t==HS.trans&&e==HS.massive?o="Ticket_UnitBuy":t==HS.pet?(this.petIcon.setPet(h,1),this.petIcon.visible=!0):t==HS.petTicket||e==HS.petTicket||t==HS.ticket&&e==HS.pet?(o="PetTick",n=.9):t==HS.petSelect||e==HS.petSelect||t==HS.ticket&&e==HS.petSelect?(o="Ticket_PetSelect",n=.9):t==HS.ticket&&e==HS.treasureGacha?(o="Ticket_TreasureGacha",n=.95):t==HS.trans&&e==HS.treasure?o=7===this._grade?"Ticket_TreasureTrans7":"Ticket_TreasureTrans6":t==HS.ads||e==HS.ads?(o="AdsRemove",n=.7):t==HS.speed||e==HS.speed?(o="UI_SHOP_SPEED2",n=.8):t==HS.assistant||e==HS.assistant?(o="Package_Secretary",n=.7):t==HS.guildCoin||t==HS.guildPoint?(o="GUILD_COIN",n=1.6):t==HS.raidCoin?(o="RaidCoin_on",n=1.5):t==HS.runeTicket&&(o="RuneTicket",n=1.2),o&&(this.img.scale=n,this.img.texture=nt.getTexture("UI_Ekkorr",o),this.img.visible=!0,this.bg.visible=!0),t==HS.ads||t==HS.speed||t==HS.assistant?this.lblNum.text=`${
ShopPaySubView 4 hunks, 4 statements
- =await Promise.resolve().then(()=>__i); + =await import("./chunks/AppsFlyerManager.js");
- ,void 0); + ,__vite__mapDeps([19,1,0,2,4,5]),import.meta.url);
- =await Promise.resolve().then(()=>R_i); + =await import("./chunks/vendor-misc.js").then(t=>t.B);
- ,void 0); + ,__vite__mapDeps([0,1,2]),import.meta.url);
PVPOpponentItemRenderer 2 hunks, 4 statements
- super(),Zt(this,"bg",new ep),Zt(this,"levelChip",(new ep).roundRect(108,21,64,26,8).fill(4930347)),Zt(this,"rankBadge",new w0t(66)),Zt(this,"lblNameInfo",a0t(20)),Zt(this,"lblLevel",a0t(16,h0t)),Zt(this,"lblPoint",a0t(21,o0t)),Zt(this,"lblPointCaption",a0t(13,r0t)),Zt(this,"lblWin",a0t(14,9754784)),Zt(this,"lblLose",a0t(14,15574163)),Zt(this,"btnFight",new nB("")),Zt(this,"onFight"),this.bg.roundRect(5,0,610,100,13).fill(n0t).roundRect(14,10,78,80,10).fill(2695449),this.bg.eventMode=this.levelChip.eventMode="none",this.rankBadge.position.set(20,17),this.lblNameInfo.x=182,this.lblPointCaption.x=109,this.lblWin.x=286,this.lblLose.x=389,this.addChild(this.bg,this.rankBadge,this.levelChip,this.lblLevel,this.lblNameInfo,this.lblPointCaption,this.lblPoint,this.lblWin,this.lblLose),this.btnFight.color=nB.RED; + super(),n(this,"bg",new p),n(this,"inset",(new p).roundRect(14,10,78,80,10).fill(2695449)),n(this,"levelChip",(new p).roundRect(108,21,64,26,8).fill(4930347)),n(this,"profile",new MG(108,{ + size:66,x:20,y:21} + )),n(this,"lblNameInfo",hG(20)),n(this,"lblLevel",hG(16,tG)),n(this,"lblPoint",hG(21,iG)),n(this,"lblPointCaption",hG(13,sG)),n(this,"lblWin",hG(14,9754784)),n(this,"lblLose",hG(14,15574163)),n(this,"btnFight",new sr("")),n(this,"onFight"),this.bg.roundRect(5,0,610,100,13).fill(Zk),this.bg.eventMode=this.inset.eventMode=this.levelChip.eventMode="none",this.profile.position.set(0,-4),this.lblNameInfo.x=182,this.lblPointCaption.x=109,this.lblWin.x=286,this.lblLose.x=389,this.addChild(this.bg,this.inset,this.profile,this.levelChip,this.lblLevel,this.lblNameInfo,this.lblPointCaption,this.lblPoint,this.lblWin,this.lblLose),this.btnFight.color=sr.RED;
- this.data=t,this.rankBadge.setRank(Number(t.rank)||0),this.lblLevel.text=`Lv.${ + this.data=t,this.profile.setData(Number(t.rank)||0,t.deco),this.inset.visible=null===cG(t.deco),this.lblLevel.text=`Lv.${
MineMain 1 hunks, 4 statements
- if(e){ - const t=[...this.revealedChests.values()].filter(t=>t.isExcavated).length; - t>=e.chestCount&&(this.gameEnded=!0,null==(i=this.onAllChestsExcavated)||i.call(this),null==(s=this.onComplete)||s.call(this))} - } + h&&[...this.revealedChests.values()].filter(t=>t.isExcavated).length>=h.chestCount&&(this.gameEnded=!0,null==(s=this.onAllChestsExcavated)||s.call(this),null==(i=this.onComplete)||i.call(this))}
AchievementPopup 4 hunks, 4 statements
- =await Promise.resolve().then(()=>lEi); + =await import("./chunks/PlayGamesAchievementMap.js");
- ,void 0),{ + ,[],import.meta.url),{
- =await Promise.resolve().then(()=>Gvi); + =await import("./chunks/PlayGamesManager.js");
- ,void 0),n=s(t,i); + ,__vite__mapDeps([16,0,1,2]),import.meta.url),e=i(t,s);
GuildWarPopup 4 hunks, 4 statements
- =await Promise.resolve().then(()=>Dwi); + =await import("./chunks/GuildWarSquadsPopup.js");
- ,void 0); + ,__vite__mapDeps([12,1,0,2,11,4,5]),import.meta.url);
- =await Promise.resolve().then(()=>Hwi); + =await import("./chunks/GuildWarTierAssignPopup.js");
- ,void 0).then(({ + ,__vite__mapDeps([13,9,1,0,2,4,5]),import.meta.url).then(({
AttendanceDataManager 3 hunks, 3 statements
- ,void 0),i=await t.getAuthToken()||void 0; + ,void 0,import.meta.url),s=await t.getAuthToken()||void 0;
- =await Promise.resolve().then(()=>Wpi); + =await import("./chunks/AttendanceAutoTrigger.js");
- ,void 0); + ,__vite__mapDeps([6,1,0,2,4,5]),import.meta.url);
MiniGameService 1 hunks, 3 statements
- const GL=class extends rN{ + const Le={ + ARCHERY:1,ROULETTE:2} + ,De=class extends Zi{
SystemErrorPopup 3 hunks, 3 statements
- ,void 0); + ,void 0,import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
- "CLIENT_NOT_ATTESTED"==t?i=NB.getText("COMMON_562","이 앱의 안전성을 확인할 수 없습니다.")+"\n"+NB.getText("COMMON_561","Google Play에서 정식 버전을 설치해 주세요.")+" (E1)":"LT_ERROR"==t?(i=NB.getText("COMMON_268","게임 데이터가 업데이트 되었습니다."),i+=" (LE)"):"DUPLICATE_LOGIN"==t||"DUPLICATE_SESSION"==t?(i=NB.getText("COMMON_75","다른 기기에서 접속하였습니다."),i+=" (DL)"):"INVALID_USER_TYPE"==t?i=xB.getInstance().getInvalidUserTypeMessage("(IUT-SEP)"):(i=NB.getText("COMMON_74","서버와의 접속이 끊어졌습니다."),i+=" ("+t.toUpperCase().substring(0,3)+")"),this.lblMessage.text=i,this.btnConfirm.text=NB.getText("COMMON_1","확인"),this.updateLayout()} + "CLIENT_NOT_ATTESTED"==t?s=Nr.getText("COMMON_562","이 앱의 안전성을 확인할 수 없습니다.")+"\n"+Nr.getText("COMMON_561","Google Play에서 정식 버전을 설치해 주세요.")+" (E1)":"LT_ERROR"==t?(s=Nr.getText("COMMON_268","게임 데이터가 업데이트 되었습니다."),s+=" (LE)"):"NEW_BUILD"==t?(s=Nr.getText("COMMON_268","게임 데이터가 업데이트 되었습니다."),s+=" (NB)"):"DUPLICATE_LOGIN"==t||"DUPLICATE_SESSION"==t?(s=Nr.getText("COMMON_75","다른 기기에서 접속하였습니다."),s+=" (DL)"):"INVALID_USER_TYPE"==t?s=Cr.getInstance().getInvalidUserTypeMessage("(IUT-SEP)"):(s=Nr.getText("COMMON_74","서버와의 접속이 끊어졌습니다."),s+=" ("+t.toUpperCase().substring(0,3)+")"),this.lblMessage.text=s,this.btnConfirm.text=Nr.getText("COMMON_1","확인"),this.updateLayout()}
BaseGuidePopup 3 hunks, 3 statements
- ,void 0),{ + ,void 0,import.meta.url),{
- =await Promise.resolve().then(()=>cE); + =await import("./chunks/vendor-pixi.js").then(t=>t.a3);
- ,void 0),s=t.getAssetPath("CharGuide.png"),e=await i.load(s); + ,__vite__mapDeps([1,0,2]),import.meta.url),i=t.getAssetPath("CharGuide.png"),h=await s.load(i);
SoulRestActivePopup 3 hunks, 3 statements
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
- =await Promise.resolve().then(()=>o_i); + =await import("./chunks/SoulRestEndConfirmPopup.js");
- ,void 0); + ,__vite__mapDeps([18,1,0,2,4,5]),import.meta.url);
BomberBigBombExplode1 2 hunks, 3 statements
- const PV=class extends HH{ + const of=class extends fd{
- Qt(PV,"BomberBigBombExplode1"); - let NV=PV; + e(of,"BomberBigBombExplode1"); + let rf=of;
WalletPopup 3 hunks, 3 statements
- ...hD.ERROR_POPUP_LABEL_OPTION,fontSize:24,fontWeight:"bold"} + ...en.ERROR_POPUP_LABEL_OPTION,fontSize:24,fontWeight:"bold"}
- ...hD.ERROR_POPUP_LABEL_OPTION,fontSize:16} + ...en.ERROR_POPUP_LABEL_OPTION,fontSize:16}
- ...hD.ERROR_POPUP_LABEL_OPTION,fontSize:16} + ...en.ERROR_POPUP_LABEL_OPTION,fontSize:16}
ShopProductPopupWithTimer 3 hunks, 3 statements
- ,void 0),{ + ,void 0,import.meta.url),{
- =await Promise.resolve().then(()=>cE); + =await import("./chunks/vendor-pixi.js").then(t=>t.a3);
- ,void 0),s=t.getAssetPath("CharShopProduct.png"),e=await i.load(s); + ,__vite__mapDeps([1,0,2]),import.meta.url),i=t.getAssetPath("CharShopProduct.png"),h=await s.load(i);
FavoritePetSubMenu 3 hunks, 3 statements
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
- =await Promise.resolve().then(()=>j_i); + =await import("./chunks/FavoritePetSelectPopup.js");
- ,void 0).then(({ + ,__vite__mapDeps([25,1,0,2,4,5]),import.meta.url).then(({
MailDetailPopup 2 hunks, 3 statements
- 0!=(await sD.getInstance().mail.receive(this.currentMail.id,this.currentMail.mailType)).success?(this.currentMail.mailType===IYt.PAYMENT?jti.getInstance().updatePaymentMailList():jti.getInstance().updateGameMailList(),jS.getInstance().dispatchCustomEvent("MailUpdate")):jS.getInstance().dispatchCustomEvent("MailUpdate")} + const t=await tn.getInstance().mail.receive(this.currentMail.id,this.currentMail.mailType); + 0!=t.success?(xW(t.body),this.currentMail.mailType===Ev.PAYMENT?jW.getInstance().updatePaymentMailList():jW.getInstance().updateGameMailList(),Et.getInstance().dispatchCustomEvent("MailUpdate")):Et.getInstance().dispatchCustomEvent("MailUpdate")}
- if(this.currentMail.receivedAt=new Date,TG.setUserInfo(s.body),HYt.getInstance().setData(s.body),ZB.getInstance().setStatusData(null==(t=s.body)?void 0:t.mineStatus),jYt.getInstance().setData(null==(i=s.body)?void 0:i.transTicket),jS.getInstance().dispatchCustomEvent("MailUpdate"),"inventory"in s.body){ + if(this.currentMail.receivedAt=new Date,Oo.setUserInfo(i.body),Nv.getInstance().setData(i.body),qr.getInstance().setStatusData(null==(t=i.body)?void 0:t.mineStatus),Lv.getInstance().setData(null==(s=i.body)?void 0:s.transTicket),xW(i.body),Et.getInstance().dispatchCustomEvent("MailUpdate"),"inventory"in i.body){
DailyQuestPopup 3 hunks, 3 statements
- ,void 0),{ + ,void 0,import.meta.url),{
- =await Promise.resolve().then(()=>cE); + =await import("./chunks/vendor-pixi.js").then(t=>t.a3);
- ,void 0),s=t.getAssetPath("CharDailyQuest.png"),e=await i.load(s); + ,__vite__mapDeps([1,0,2]),import.meta.url),i=t.getAssetPath("CharDailyQuest.png"),h=await s.load(i);
GuildMainSubView 3 hunks, 3 statements
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
- const i=[...OD.guildList].sort((t,i)=>{ + const s=[...vn.guildList].sort((t,s)=>{
AttendancePopup 3 hunks, 3 statements
- ,void 0),{ + ,void 0,import.meta.url),{
- =await Promise.resolve().then(()=>cE); + =await import("./chunks/vendor-pixi.js").then(t=>t.a3);
- ,void 0),s=t.getAssetPath("CharAttendance.png"),e=await i.load(s); + ,__vite__mapDeps([1,0,2]),import.meta.url),i=t.getAssetPath("CharAttendance.png"),h=await s.load(i);
SettingEtcInfo 3 hunks, 3 statements
- ,void 0),s=i(),e=await s.login(t); + ,void 0,import.meta.url),i=s(),h=await i.login(t);
- =await Promise.resolve().then(()=>Gvi); + =await import("./chunks/PlayGamesManager.js");
- ,void 0),s=await t.isPlayGamesPC(),e=OG.getInstance().getWebClientId(); + ,__vite__mapDeps([16,0,1,2]),import.meta.url),i=await t.isPlayGamesPC(),h=Co.getInstance().getWebClientId();
VersionManager 2 hunks, 2 statements
- ci.add(Gd),ci.add(Ud),ci.add($d);
- Qt(TS,"VersionManager"),Zt(TS,"gameId","ef2"),Zt(TS,"appVersion","1.15.40"); + e(Z,"VersionManager"),n(Z,"gameId","ef2"),n(Z,"appVersion","1.15.80");
UnitDataManager 2 hunks, 2 statements
- n.length,e.length,this.list.length=0,this.list.push(...n),this.objList.clear(); + e.length,h.length,this.list.length=0,this.list.push(...e),this.objList.clear();
- n.length,e.length,this.ownedUnitList.length=0,this.ownedUnitList.push(...n),this.objOwnedUnitList.clear(); + e.length,h.length,this.ownedUnitList.length=0,this.ownedUnitList.push(...e),this.objOwnedUnitList.clear();
HeroUniqueSkillDataManager 2 hunks, 2 statements
- const r=new Map,o=[...h,...n(s)]; + const a=new Map,l=[...r,...n(i)];
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
BaseService 2 hunks, 2 statements
- ,...r?{ + ,...o?{
- ...s,signal:t} + ...i,signal:t}
AccountService 2 hunks, 2 statements
- ...o,...a} + ...r,...a}
- ...r,...o} + ...o,...r}
GuildService 2 hunks, 2 statements
- async hireUnit(t,i=!1){ + async hireUnit(t,s="unit",i=!1){
- kindNum:t} + kindNum:t,type:s}
GuildWarBuffSource 2 hunks, 2 statements
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
GameSpeedMode 1 hunks, 2 statements
- get:()=>h?o()?Number(s^n):(jP.I(t),r):r,set(i){ - isFinite(i)&&(h&&!o()&&jP.I(t),a(i))} + get:()=>o?a()?Number(i^n):(Bi.i(t),r):r,set(s){ + isFinite(s)&&(o&&!a()&&Bi.i(t),l(s))}
GuildBarracksDataManager 1 hunks, 2 statements
- const r=this.computeSoldiers(t,i,s,n,h),o=this.computeSoldierProgress(t,i,s,e,n,h).map(t=>Math.floor(Math.max(0,t))); - return o.some((t,i)=>t!==(r[i]??0))} + const o=this.computeSoldiers(t,s,i,e,n); + return this.computeSoldierProgress(t,s,i,h,e,n).map(t=>Math.floor(Math.max(0,t))).some((t,s)=>t!==(o[s]??0))}
IconOnlyButton 1 hunks, 2 statements
+ setIconTexture(t){ + this.bg.texture=t}
ResourceInfo 2 hunks, 2 statements
- =await Promise.resolve().then(()=>y_i); + =await import("./chunks/GameSpeedBuffPopup.js");
- ,void 0).then(({ + ,__vite__mapDeps([20,1,0,2,4,5]),import.meta.url).then(({
SubscriptionPurchaseManager 2 hunks, 2 statements
- ,void 0); + ,void 0,import.meta.url);
- ,void 0); + ,void 0,import.meta.url);
ShopPayItemRenderer 2 hunks, 2 statements
- =await Promise.resolve().then(()=>czt); + =await import("./chunks/vendor-misc.js").then(t=>t.u);
- ,void 0),l=Dzt.getInstance(); + ,__vite__mapDeps([0,1,2]),import.meta.url),d=bO.getInstance();
GuideBubble 2 hunks, 2 statements
- function Kzt(t,...i){ + function GO(t,...s){
- ...hD.DEFAULT_FONT_OPTION_18,fontSize:15,lineHeight:20} + ...en.DEFAULT_FONT_OPTION_18,fontSize:15,lineHeight:20}
HelpDetailPopup 2 hunks, 2 statements
- ...hD.DEFAULT_FONT_OPTION_18,fontSize:32,lineHeight:40} + ...en.DEFAULT_FONT_OPTION_18,fontSize:32,lineHeight:40}
- ...hD.DEFAULT_FONT_OPTION_18,fontSize:24,lineHeight:34} + ...en.DEFAULT_FONT_OPTION_18,fontSize:24,lineHeight:34}
ShopPayItemRendererStage 2 hunks, 2 statements
- =await Promise.resolve().then(()=>czt); + =await import("./chunks/vendor-misc.js").then(t=>t.u);
- ,void 0),r=Dzt.getInstance(); + ,__vite__mapDeps([0,1,2]),import.meta.url),a=bO.getInstance();
WaveCallInfo 2 hunks, 2 statements
- const t=this.callWave(); + const t=this.M();
- callWave(){ + M(){
SpriteLandSubMenu 2 hunks, 2 statements
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
TowerSimulationPopup 2 hunks, 2 statements
- i&&i.kindNums&&12===i.kindNums.length?(this.teamKindNums=[...i.kindNums],this.teamTrans=[...i.trans]):this.initEmptyTeam(); + s&&s.kindNums&&12===s.kindNums.length?(this.teamKindNums=[...s.kindNums],this.teamTrans=[...s.trans]):this.initEmptyTeam();
- s&&Array.isArray(s.kindNums)&&20===s.kindNums.length?(this.enemyKindNums=[...s.kindNums],this.enemyTrans=[...s.trans],this.enemyLevels=s.levels?[...s.levels]:new Array(20).fill(1),this.enemyShields=s.shields?[...s.shields]:new Array(20).fill(0),this.enemyCustomTrans=s.customTrans?[...s.customTrans]:new Array(20).fill(0)):this.initEmptyEnemies(),this.selectedSlot=-1,this.updateAllyButtons(),this.updateEnemyButtons(),this.updateHeroList()} + i&&Array.isArray(i.kindNums)&&20===i.kindNums.length?(this.enemyKindNums=[...i.kindNums],this.enemyTrans=[...i.trans],this.enemyLevels=i.levels?[...i.levels]:new Array(20).fill(1),this.enemyShields=i.shields?[...i.shields]:new Array(20).fill(0),this.enemyCustomTrans=i.customTrans?[...i.customTrans]:new Array(20).fill(0)):this.initEmptyEnemies(),this.selectedSlot=-1,this.updateAllyButtons(),this.updateEnemyButtons(),this.updateHeroList()}
MineRewardInfoPopup 2 hunks, 2 statements
- ...r} + ...o}
- ...r} + ...o}
TreasureTransSubView 2 hunks, 2 statements
- return[...e.equipedList,...e.ownedList].some(e=>e&&e.grade===t&&(e.trans||0)===s-1&&e.kindNum!==i)} + return[...h.equipedList,...h.ownedList].some(h=>h&&h.grade===t&&(h.trans||0)===i-1&&h.kindNum!==s)}
- ,void 0); + ,void 0,import.meta.url);
EmblemBadge 2 hunks, 2 statements
- ,Pni=12564136; + ,xz=14,Bz=12564136;
- Qt(Nni,"fillTagChips"),Qt(Lni,"fillSkillPrefixChips"),Qt(Dni,"mixColor$1"),Qt(Gni,"runeTypeColor"); + e(Uz,"fillTagChips"),e(Hz,"fillSkillPrefixChips"),e($z,"mixColor"),e(Fz,"runeTypeColor");
GuildRaidSubMenu 2 hunks, 2 statements
- =await Promise.resolve().then(()=>FEi); + =await import("./chunks/GuildRaidOpenSettingsPopup.js");
- ,void 0).then(({ + ,__vite__mapDeps([35,1,0,2,4,5]),import.meta.url).then(({
GuildWarTournament2Popup 2 hunks, 2 statements
- =await Promise.resolve().then(()=>Ewi); + =await import("./chunks/GuildWarBattlePopupV3.js");
- ,void 0).then(({ + ,__vite__mapDeps([7,1,0,2,4,8,9,5]),import.meta.url).then(({
SettingContent 2 hunks, 2 statements
- =await Promise.resolve().then(()=>Vwi); + =await import("./chunks/vendor-misc.js").then(t=>t.x);
- ,void 0),s=await t.getInfo(); + ,__vite__mapDeps([0,1,2]),import.meta.url),i=await t.getInfo();
NpcDialogueToast 2 hunks, 2 statements
- ...hD.DEFAULT_FONT_OPTION_18,fontSize:14,lineHeight:18} + ...en.DEFAULT_FONT_OPTION_18,fontSize:14,lineHeight:18}
- this.queue.push(...i),this.timeCount<=0&&this.playNext()} + this.queue.push(...s),this.timeCount<=0&&this.playNext()}
SecretaryPopup 2 hunks, 2 statements
- for(const h of[...i.children])i.removeChild(h),null==(t=h.destroy)||t.call(h,{ + for(const n of[...s.children])s.removeChild(n),null==(t=n.destroy)||t.call(n,{
- ].filter(t=>t.icon.visible),n=Qt(t=>t.icon.width+s+t.label.width,"groupW"),h=e.reduce((t,i)=>t+n(i),0)+Math.max(0,e.length-1)*t,r=i,o=Math.max(28,...e.map(t=>t.icon.height)); + ].filter(t=>t.icon.visible),n=e(t=>t.icon.width+i+t.label.width,"groupW"),o=h.reduce((t,s)=>t+n(s),0)+Math.max(0,h.length-1)*t,r=s,a=Math.max(28,...h.map(t=>t.icon.height));
CitadelBuildingDetailPopup 2 hunks, 2 statements
- const c=[...s.eligibleKindNums??[]].sort((t,i)=>i-t); + const l=[...i.eligibleKindNums??[]].sort((t,s)=>s-t);
- const w=(null==(e=r.previewKindNum)?void 0:e.call(r))??((null==(n=r.eligibleKindNums)?void 0:n.length)?Math.max(...r.eligibleKindNums):0); + const p=(null==(h=o.previewKindNum)?void 0:h.call(o))??((null==(e=o.eligibleKindNums)?void 0:e.length)?Math.max(...o.eligibleKindNums):0);
BattleManager 2 hunks, 2 statements
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
ReviveTreasureBanner 2 hunks, 2 statements
- =await Promise.resolve().then(()=>ZEi); + =await import("./chunks/ReviveTreasurePopup.js");
- ,void 0).then(({ + ,__vite__mapDeps([38,1,0,2,4,5]),import.meta.url).then(({
AssetPathManager 1 hunks, 1 statements
- return this.toAbsolute("/")} + return this.toAbsolute("./")}
TreasureDataManager 1 hunks, 1 statements
- s.label=i.label||"",s.kindNums=Array.isArray(i.kindNums)?[...i.kindNums]:[],s.enhances=Array.isArray(i.enhances)?[...i.enhances]:[]} + i.label=s.label||"",i.kindNums=Array.isArray(s.kindNums)?[...s.kindNums]:[],i.enhances=Array.isArray(s.enhances)?[...s.enhances]:[]}
TreasureSetDataManager 1 hunks, 1 statements
- for(const h of[...i.equipedList,...i.ownedList])h&&s.set(h.kindNum,h.trans||0); + for(const n of[...s.equipedList,...s.ownedList])n&&i.set(n.kindNum,n.trans||0);
Base64Util 1 hunks, 1 statements
- e+=32768)s+=String.fromCharCode(...i.subarray(e,e+32768)); + h+=32768)i+=String.fromCharCode(...s.subarray(h,h+32768));
RequestManager 1 hunks, 1 statements
- const s=jP.U(); + const i=Bi.o();
ShopService 1 hunks, 1 statements
- productId:t,transactionId:i,receiptData:s,storeProductId:e,n} + productId:t,transactionId:s,receiptData:i,storeProductId:h,n:e}
UserService 1 hunks, 1 statements
- ,void 0),s=await i.getInstance().getConversionData(); + ,void 0,import.meta.url),i=await s.getInstance().getConversionData();
DataManager 1 hunks, 1 statements
- Zt(this,"system"),Zt(this,"account"),Zt(this,"user"),Zt(this,"mail"),Zt(this,"book"),Zt(this,"castle"),Zt(this,"hero"),Zt(this,"quest"),Zt(this,"waveCall"),Zt(this,"timeShift"),Zt(this,"referral"),Zt(this,"dailyRanking"),Zt(this,"payback"),Zt(this,"pvp"),Zt(this,"dungeon"),Zt(this,"treasure"),Zt(this,"achievement"),Zt(this,"shop"),Zt(this,"ads"),Zt(this,"notice"),Zt(this,"notice2"),Zt(this,"attendance"),Zt(this,"stampCalendar"),Zt(this,"pass"),Zt(this,"tower"),Zt(this,"missionGuide"),Zt(this,"promotion"),Zt(this,"guild"),Zt(this,"guildWar"),Zt(this,"guildRaid"),Zt(this,"rune"),Zt(this,"guildDefense"),Zt(this,"guildBarracks"),Zt(this,"battle"),Zt(this,"pet"),Zt(this,"petShop"),Zt(this,"spirit"),Zt(this,"heroPresent"),Zt(this,"vip"),Zt(this,"miniGame"),Zt(this,"assistant"),Zt(this,"subscription"),Zt(this,"soulRest"),Zt(this,"translate"),Zt(this,"dailyQuest"),Zt(this,"lineNext"),Zt(this,"mine"),Zt(this,"cardEvent"),Zt(this,"miniAscent"),this.system=new AL,this.account=new aN,this.user=new kL,this.mail=new sL,this.book=new kN,this.castle=new RN,this.hero=new tL,this.quest=new vL,this.waveCall=new VL,this.timeShift=new KL,this.dailyRanking=new NN,this.referral=new ML,this.payback=new dL,this.pvp=new gL,this.dungeon=new DN,this.treasure=new OL,this.achievement=new lN,this.shop=new yL,this.ads=new dN,this.notice=new rL,this.notice2=new aL,this.attendance=new AN,this.stampCalendar=new TN,this.pass=new lL,this.tower=new TL,this.missionGuide=new nL,this.promotion=new pL,this.guild=new BN,this.guildWar=new VN,this.guildRaid=new KN,this.rune=new YN,this.guildDefense=new XN,this.guildBarracks=new QN,this.battle=new ON,this.pet=new NL,this.petShop=new DL,this.spirit=new FL,this.heroPresent=new RL,this.vip=new HL,this.miniGame=new BL,this.assistant=new pN,this.subscription=new yN,this.soulRest=new gN,this.translate=new vN,this.dailyQuest=new MN,this.lineNext=new YL,this.mine=new XL,this.cardEvent=new QL,this.miniAscent=new tD} + n(this,"system"),n(this,"account"),n(this,"user"),n(this,"mail"),n(this,"book"),n(this,"castle"),n(this,"hero"),n(this,"quest"),n(this,"waveCall"),n(this,"timeShift"),n(this,"referral"),n(this,"dailyRanking"),n(this,"payback"),n(this,"pvp"),n(this,"dungeon"),n(this,"treasure"),n(this,"achievement"),n(this,"shop"),n(this,"ads"),n(this,"notice"),n(this,"notice2"),n(this,"attendance"),n(this,"stampCalendar"),n(this,"pass"),n(this,"tower"),n(this,"missionGuide"),n(this,"promotion"),n(this,"guild"),n(this,"friend"),n(this,"profileDeco"),n(this,"guildWar"),n(this,"guildRaid"),n(this,"rune"),n(this,"guildDefense"),n(this,"guildBarracks"),n(this,"battle"),n(this,"pet"),n(this,"petShop"),n(this,"spirit"),n(this,"heroPresent"),n(this,"vip"),n(this,"miniGame"),n(this,"assistant"),n(this,"subscription"),n(this,"soulRest"),n(this,"translate"),n(this,"dailyQuest"),n(this,"lineNext"),n(this,"mine"),n(this,"cardEvent"),n(this,"miniAscent"),this.system=new Ae,this.account=new sh,this.user=new ve,this.mail=new Zh,this.book=new bh,this.castle=new Ih,this.hero=new Qh,this.quest=new pe,this.waveCall=new Fe,this.timeShift=new Ve,this.dailyRanking=new vh,this.referral=new ge,this.payback=new le,this.pvp=new _e,this.dungeon=new Rh,this.treasure=new Ie,this.achievement=new hh,this.shop=new we,this.ads=new nh,this.notice=new he,this.notice2=new ne,this.attendance=new gh,this.stampCalendar=new wh,this.pass=new re,this.tower=new be,this.missionGuide=new se,this.promotion=new ue,this.guild=new Nh,this.friend=new Gh,this.profileDeco=new Dh,this.guildWar=new $h,this.guildRaid=new Wh,this.rune=new Kh,this.guildDefense=new zh,this.guildBarracks=new jh,this.battle=new Ah,this.pet=new Ne,this.petShop=new Ge,this.spirit=new Be,this.heroPresent=new Re,this.vip=new He,this.miniGame=new Pe,this.assistant=new rh,this.subscription=new ph,this.soulRest=new lh,this.translate=new uh,this.dailyQuest=new _h,this.lineNext=new Ye,this.mine=new Xe,this.cardEvent=new qe,this.miniAscent=new Je}
EventBus 1 hunks, 1 statements
- const e=[...s]; + const h=[...i];
CommonLabel 1 hunks, 1 statements
- ...s} + ...i}
GameUpdatePopup 1 hunks, 1 statements
- ,void 0); + ,void 0,import.meta.url);
FireStormFx 1 hunks, 1 statements
- ),Mn.shared.remove(A),Mn.shared.remove(O),s.position.set(y.x,y.y),yx.killTweensOf([S,E,...M]),o.destroy({ + ),b.shared.remove(R),b.shared.remove(G),i.position.set(v.x,v.y),B.killTweensOf([y,C,...I]),a.destroy({
CommonIconLabel 1 hunks, 1 statements
- ...n} + ...e}
AutoTogglePill 1 hunks, 1 statements
- ...hD.DEFAULT_FONT_OPTION_15,fontSize:t.FONT_SIZE,lineHeight:t.PILL_H} + ...en.DEFAULT_FONT_OPTION_15,fontSize:t.FONT_SIZE,lineHeight:t.PILL_H}
FireBird1 1 hunks, 1 statements
- Qt(a2,"FireBird1"),Zt(a2,"SWOOP_POSES",[[23,0,0],[27,-7.8,-8.2],[31,-11,-11.7],[35,5.2,11.2],[39,3.9,4.6],[43,1.6,1.8]]),Zt(a2,"SWOOP_HOLD",4),Zt(a2,"SWOOP_KEYS",[...a2.SWOOP_POSES.map(([t,i,s])=>[t+(a2.SWOOP_HOLD-1)/2,i,s]),[a2.SWOOP_POSES[a2.SWOOP_POSES.length-1][0]+a2.SWOOP_HOLD,0,0]]); + e(ym,"FireBird1"),n(ym,"SWOOP_POSES",[[23,0,0],[27,-7.8,-8.2],[31,-11,-11.7],[35,5.2,11.2],[39,3.9,4.6],[43,1.6,1.8]]),n(ym,"SWOOP_HOLD",4),n(ym,"SWOOP_KEYS",[...ym.SWOOP_POSES.map(([t,s,i])=>[t+(ym.SWOOP_HOLD-1)/2,s,i]),[ym.SWOOP_POSES[ym.SWOOP_POSES.length-1][0]+ym.SWOOP_HOLD,0,0]]);
FireSpirit1 1 hunks, 1 statements
- Qt(l2,"FireSpirit1"),Zt(l2,"SKILL_MODE",6),Zt(l2,"BASIC_MODE",4),Zt(l2,"BASIC_SHOTS",3),Zt(l2,"BASIC_SHOT_DELAY",3),Zt(l2,"WHIRL_COUNT",3),Zt(l2,"WHIRL_COUNT_E",4),Zt(l2,"WHIRL_SPREAD",.34),Zt(l2,"WHIRL_SPEED",3.4),Zt(l2,"WHIRL_RANGE",210),Zt(l2,"WHIRL_DPS",.5),Zt(l2,"WHIRL_SCALE",.45),Zt(l2,"WHIRL_HIT_R",26),Zt(l2,"WHIRL_STAGGER_BACK",16),Zt(l2,"WHIRL_JITTER",.05),Zt(l2,"STORM_COUNT",10),Zt(l2,"STORM_COUNT_E",12),Zt(l2,"STORM_SPEED",3),Zt(l2,"STORM_RANGE",330),Zt(l2,"STORM_SCALE",.85),Zt(l2,"STORM_SCALE_Y",1.45),Zt(l2,"STORM_HIT_R",42),Zt(l2,"STORM_DPS",.7),Zt(l2,"STORM_JITTER",.1),Zt(l2,"STORM_TRAIL_STEP",62),Zt(l2,"TRAIL_LIFE",150),Zt(l2,"TRAIL_RADIUS",34),Zt(l2,"TRAIL_TICK",30),Zt(l2,"TRAIL_DMG",.12),Zt(l2,"TRAIL_MAX",60),Zt(l2,"TRAIL_SCALE",.75),Zt(l2,"RUSH_MORPH_FRAMES",12),Zt(l2,"RUSH_SPEED",5.2),Zt(l2,"RUSH_MAX_FRAMES",70),Zt(l2,"RUSH_STAY_FRAMES",40),Zt(l2,"RUSH_BACK_SPEED",6.5),Zt(l2,"RUSH_BACK_MAX",70),Zt(l2,"RUSH_RANGE",300),Zt(l2,"RUSH_ARRIVE_DIST",14),Zt(l2,"RUSH_HIT_RADIUS",52),Zt(l2,"RUSH_TICK",12),Zt(l2,"RUSH_TICK_DMG",.45),Zt(l2,"RUSH_PILLAR_SCALE",1),Zt(l2,"RUSH_BURN_TICK",.1),Zt(l2,"RUSH_BURN_DURATION",180),Zt(l2,"RUSH_BURN_INTERVAL",30),Zt(l2,"RUSH_BURN_DOT_ID",72),Zt(l2,"SUPER_COUNT",5),Zt(l2,"SUPER_COUNT_E",7),Zt(l2,"SUPER_OUTER_R",150),Zt(l2,"SUPER_INNER_R",20),Zt(l2,"SUPER_SPIN",.075),Zt(l2,"SUPER_LIFE",180),Zt(l2,"SUPER_ARRIVE",.9),Zt(l2,"SUPER_DPS",1.4),Zt(l2,"SUPER_RANGE",260),Zt(l2,"TORNADO_COUNT",3),Zt(l2,"TORNADO_COUNT_E",4),Zt(l2,"SPREAD_RADIUS",140),Zt(l2,"GATHER_START_RADIUS",120),Zt(l2,"INNER_RADIUS",12),Zt(l2,"GATHER_END_RADIUS",60),Zt(l2,"SCATTER_SPIN",.07),Zt(l2,"GATHER_SPIN",.08),Zt(l2,"SCATTER_FRAMES",190),Zt(l2,"GAP_FRAMES",90),Zt(l2,"GATHER_FRAMES",180),Zt(l2,"GATHER_DIST",260),Zt(l2,"MIN_GATHER_DIST",120),Zt(l2,"TORNADO_DPS",1),Zt(l2,"ORBIT_COUNT",3),Zt(l2,"ORBIT_COUNT_E",4),Zt(l2,"ORBIT_RX",42),Zt(l2,"ORBIT_RY",14),Zt(l2,"ORBIT_H",-26),Zt(l2,"ORBIT_SPIN",.032),Zt(l2,"ORBIT_BOB",5),Zt(l2,"ORBIT_BOB_SPEED",.07),Zt(l2,"ORBIT_RAD_MIN",.72),Zt(l2,"ORBIT_RAD_MAX",1.32),Zt(l2,"ORBIT_SPIN_MIN",.82),Zt(l2,"ORBIT_SPIN_MAX",1.22),Zt(l2,"ORBIT_H_VAR",13),Zt(l2,"ORBIT_RUSH_SPIN",.9),Zt(l2,"ORBIT_RUSH_TIGHT",.2),Zt(l2,"JOIN_BLEND",20),Zt(l2,"CATCH_SETTLE",.3),Zt(l2,"CATCH_SETTLE_EASE",.94),Zt(l2,"CATCH_SPARK_SCALE",.3),Zt(l2,"CATCH_SPARK_LIFE",30),Zt(l2,"ORBIT_LAG",.14),Zt(l2,"ORBIT_LAG_MAX",130),Zt(l2,"DEATH_SCATTER_SPD",3.4),Zt(l2,"DEATH_SCATTER_LIFE",26),Zt(l2,"ORBIT_SCALE",.42),Zt(l2,"ORBIT_DEPTH",.04),Zt(l2,"BOOM_SPEED",5.6),Zt(l2,"BOOM_CURVE",.6),Zt(l2,"BOOM_OVERSHOOT",80),Zt(l2,"BOOM_MIN_TRAVEL",300),Zt(l2,"BOOM_SCALE",.44),Zt(l2,"BOOM_SCALE_Y",1.2),Zt(l2,"BOOM_GROW",9),Zt(l2,"BOOM_HIT_R",34),Zt(l2,"BOOM_DPS",.75),Zt(l2,"BOOM_MAX_TARGETS",6),Zt(l2,"SKILL_MAX_TARGETS",8),Zt(l2,"BOOM_TIMEOUT",1320),Zt(l2,"EMPTY_RETRY",8),Zt(l2,"JUGGLE_MAX",5),Zt(l2,"JUGGLE_PER",.15),Zt(l2,"OVERHEAT_HOLD",180),Zt(l2,"JUGGLE_BUFF_DUR",3600),Zt(l2,"JUGGLE_FREEZE",90),Zt(l2,"SKILL_BOOM_SPEED",4.8),Zt(l2,"SKILL_BOOM_CURVE",.7),Zt(l2,"SKILL_BOOM_SCALE",.54),Zt(l2,"SKILL_BOOM_SCALE_Y",1.4),Zt(l2,"SKILL_BOOM_HIT_R",48),Zt(l2,"SKILL_BOOM_DPS",.8),Zt(l2,"SKILL_BOOM_HOPS",3),Zt(l2,"SKILL_EXP_DMG",1),Zt(l2,"SKILL_EXP_RADIUS",92),Zt(l2,"SKILL_EXP_BURN",.15),Zt(l2,"SKILL_EXP_SCALE",1.1),Zt(l2,"SKILL_ARM_FRAMES",22),Zt(l2,"SKILL_MAX_TRAVEL",330),Zt(l2,"RELIGHT_DELAY",34),Zt(l2,"BLOOM_FRAMES",24),Zt(l2,"BLOOM_STAGGER",8),Zt(l2,"BLOOM_SPIN",2.4),Zt(l2,"BLOOM_START_RAD",.12),Zt(l2,"BLOOM_START_SCL",.2),Zt(l2,"SKILL_OVERSHOOT",70),Zt(l2,"SKILL_MIN_TRAVEL",120),Zt(l2,"SKILL_BOOM_GROW",12),Zt(l2,"SKILL_HOP_RANGE",180),Zt(l2,"SKILL_SECTOR_PAD",1.25),Zt(l2,"ORB_SPEED",15.5),Zt(l2,"ORB_SHOTS",2),Zt(l2,"ORB_DMG",.45),Zt(l2,"ORB_CHILD_DMG",.35),Zt(l2,"ORB_CHILD_REPEAT",.22),Zt(l2,"ORB_PATH_RATIO",.5),Zt(l2,"ORB_SPLIT",4),Zt(l2,"ORB_SPLIT_E",5),Zt(l2,"ORB_CHILD_RANGE",380),Zt(l2,"ORB_SCALE_MAIN",.78),Zt(l2,"ORB_SCALE_CHILD",.46),Zt(l2,"ORB_SPREAD_ARC",1.5),Zt(l2,"ORB_SPREAD_KICK",.3),Zt(l2,"ORB_H",-26),Zt(l2,"ORB_HOME_DIST",54),Zt(l2,"ORB_SCATTER",8),Zt(l2,"ORB_SCATTER_E",11),Zt(l2,"ORB_FUSE",30),Zt(l2,"ORB_SC_ARM",8),Zt(l2,"ORB_SC_SPD_MIN",5),Zt(l2,"ORB_SC_SPD_MAX",15),Zt(l2,"ORB_SC_JITTER",.16),Zt(l2,"ORB_SC_AIM_R",450),Zt(l2,"ORB_SC_AIM_JIT",.25),Zt(l2,"ORB_SC_SCALE",.7),Zt(l2,"ORB_BLAST_R",78),Zt(l2,"ORB_BLAST_DMG",1.15),Zt(l2,"ORB_BLAST_BURN",.12),Zt(l2,"ORB_BURN_DUR",180),Zt(l2,"ORB_BURN_INT",30),Zt(l2,"ORB_BURN_ID",74); + e(km,"FireSpirit1"),n(km,"SKILL_MODE",6),n(km,"BASIC_MODE",4),n(km,"BASIC_SHOTS",3),n(km,"BASIC_SHOT_DELAY",3),n(km,"WHIRL_COUNT",3),n(km,"WHIRL_COUNT_E",4),n(km,"WHIRL_SPREAD",.34),n(km,"WHIRL_SPEED",3.4),n(km,"WHIRL_RANGE",210),n(km,"WHIRL_DPS",.5),n(km,"WHIRL_SCALE",.45),n(km,"WHIRL_HIT_R",26),n(km,"WHIRL_STAGGER_BACK",16),n(km,"WHIRL_JITTER",.05),n(km,"STORM_COUNT",10),n(km,"STORM_COUNT_E",12),n(km,"STORM_SPEED",3),n(km,"STORM_RANGE",330),n(km,"STORM_SCALE",.85),n(km,"STORM_SCALE_Y",1.45),n(km,"STORM_HIT_R",42),n(km,"STORM_DPS",.7),n(km,"STORM_JITTER",.1),n(km,"STORM_TRAIL_STEP",62),n(km,"TRAIL_LIFE",150),n(km,"TRAIL_RADIUS",34),n(km,"TRAIL_TICK",30),n(km,"TRAIL_DMG",.12),n(km,"TRAIL_MAX",60),n(km,"TRAIL_SCALE",.75),n(km,"RUSH_MORPH_FRAMES",12),n(km,"RUSH_SPEED",5.2),n(km,"RUSH_MAX_FRAMES",70),n(km,"RUSH_STAY_FRAMES",40),n(km,"RUSH_BACK_SPEED",6.5),n(km,"RUSH_BACK_MAX",70),n(km,"RUSH_RANGE",300),n(km,"RUSH_ARRIVE_DIST",14),n(km,"RUSH_HIT_RADIUS",52),n(km,"RUSH_TICK",12),n(km,"RUSH_TICK_DMG",.45),n(km,"RUSH_PILLAR_SCALE",1),n(km,"RUSH_BURN_TICK",.1),n(km,"RUSH_BURN_DURATION",180),n(km,"RUSH_BURN_INTERVAL",30),n(km,"RUSH_BURN_DOT_ID",72),n(km,"SUPER_COUNT",5),n(km,"SUPER_COUNT_E",7),n(km,"SUPER_OUTER_R",150),n(km,"SUPER_INNER_R",20),n(km,"SUPER_SPIN",.075),n(km,"SUPER_LIFE",180),n(km,"SUPER_ARRIVE",.9),n(km,"SUPER_DPS",1.4),n(km,"SUPER_RANGE",260),n(km,"TORNADO_COUNT",3),n(km,"TORNADO_COUNT_E",4),n(km,"SPREAD_RADIUS",140),n(km,"GATHER_START_RADIUS",120),n(km,"INNER_RADIUS",12),n(km,"GATHER_END_RADIUS",60),n(km,"SCATTER_SPIN",.07),n(km,"GATHER_SPIN",.08),n(km,"SCATTER_FRAMES",190),n(km,"GAP_FRAMES",90),n(km,"GATHER_FRAMES",180),n(km,"GATHER_DIST",260),n(km,"MIN_GATHER_DIST",120),n(km,"TORNADO_DPS",1),n(km,"ORBIT_COUNT",3),n(km,"ORBIT_COUNT_E",4),n(km,"ORBIT_RX",42),n(km,"ORBIT_RY",14),n(km,"ORBIT_H",-26),n(km,"ORBIT_SPIN",.032),n(km,"ORBIT_BOB",5),n(km,"ORBIT_BOB_SPEED",.07),n(km,"ORBIT_RAD_MIN",.72),n(km,"ORBIT_RAD_MAX",1.32),n(km,"ORBIT_SPIN_MIN",.82),n(km,"ORBIT_SPIN_MAX",1.22),n(km,"ORBIT_H_VAR",13),n(km,"ORBIT_RUSH_SPIN",.9),n(km,"ORBIT_RUSH_TIGHT",.2),n(km,"JOIN_BLEND",20),n(km,"CATCH_SETTLE",.3),n(km,"CATCH_SETTLE_EASE",.94),n(km,"CATCH_SPARK_SCALE",.3),n(km,"CATCH_SPARK_LIFE",30),n(km,"ORBIT_LAG",.14),n(km,"ORBIT_LAG_MAX",130),n(km,"DEATH_SCATTER_SPD",3.4),n(km,"DEATH_SCATTER_LIFE",26),n(km,"ORBIT_SCALE",.42),n(km,"ORBIT_DEPTH",.04),n(km,"BOOM_SPEED",5.6),n(km,"BOOM_CURVE",.6),n(km,"BOOM_OVERSHOOT",80),n(km,"BOOM_MIN_TRAVEL",300),n(km,"BOOM_SCALE",.44),n(km,"BOOM_SCALE_Y",1.2),n(km,"BOOM_GROW",9),n(km,"BOOM_HIT_R",34),n(km,"BOOM_DPS",.75),n(km,"BOOM_MAX_TARGETS",6),n(km,"SKILL_MAX_TARGETS",8),n(km,"BOOM_TIMEOUT",1320),n(km,"EMPTY_RETRY",8),n(km,"JUGGLE_MAX",5),n(km,"JUGGLE_PER",.15),n(km,"OVERHEAT_HOLD",180),n(km,"JUGGLE_BUFF_DUR",3600),n(km,"JUGGLE_FREEZE",90),n(km,"SKILL_BOOM_SPEED",4.8),n(km,"SKILL_BOOM_CURVE",.7),n(km,"SKILL_BOOM_SCALE",.54),n(km,"SKILL_BOOM_SCALE_Y",1.4),n(km,"SKILL_BOOM_HIT_R",48),n(km,"SKILL_BOOM_DPS",.8),n(km,"SKILL_BOOM_HOPS",3),n(km,"SKILL_EXP_DMG",1),n(km,"SKILL_EXP_RADIUS",92),n(km,"SKILL_EXP_BURN",.15),n(km,"SKILL_EXP_SCALE",1.1),n(km,"SKILL_ARM_FRAMES",22),n(km,"SKILL_MAX_TRAVEL",330),n(km,"RELIGHT_DELAY",34),n(km,"BLOOM_FRAMES",24),n(km,"BLOOM_STAGGER",8),n(km,"BLOOM_SPIN",2.4),n(km,"BLOOM_START_RAD",.12),n(km,"BLOOM_START_SCL",.2),n(km,"SKILL_OVERSHOOT",70),n(km,"SKILL_MIN_TRAVEL",120),n(km,"SKILL_BOOM_GROW",12),n(km,"SKILL_HOP_RANGE",180),n(km,"SKILL_SECTOR_PAD",1.25),n(km,"ORB_SPEED",15.5),n(km,"ORB_SHOTS",2),n(km,"ORB_DMG",.45),n(km,"ORB_CHILD_DMG",.35),n(km,"ORB_CHILD_REPEAT",.22),n(km,"ORB_PATH_RATIO",.5),n(km,"ORB_SPLIT",4),n(km,"ORB_SPLIT_E",5),n(km,"ORB_CHILD_RANGE",380),n(km,"ORB_SCALE_MAIN",.55),n(km,"ORB_SCALE_CHILD",.32),n(km,"ORB_SPREAD_ARC",1.5),n(km,"ORB_SPREAD_KICK",.3),n(km,"ORB_H",-26),n(km,"ORB_HOME_DIST",54),n(km,"ORB_SCATTER",8),n(km,"ORB_SCATTER_E",11),n(km,"ORB_FUSE",30),n(km,"ORB_SC_ARM",8),n(km,"ORB_SC_SPD_MIN",5),n(km,"ORB_SC_SPD_MAX",15),n(km,"ORB_SC_JITTER",.16),n(km,"ORB_SC_AIM_R",450),n(km,"ORB_SC_AIM_JIT",.25),n(km,"ORB_SC_SCALE",.45),n(km,"ORB_BLAST_R",78),n(km,"ORB_BLAST_DMG",1.15),n(km,"ORB_BLAST_BURN",.12),n(km,"ORB_BURN_DUR",180),n(km,"ORB_BURN_INT",30),n(km,"ORB_BURN_ID",74);
HeroUpgradeManager 1 hunks, 1 statements
- i.length>0&&0===i[i.length-1]&&i.pop(),this.acc=[0,...i]} + s.length>0&&0===s[s.length-1]&&s.pop(),this.acc=[0,...s]}
WalletSelectPopup 1 hunks, 1 statements
- ...hD.ERROR_POPUP_LABEL_OPTION,fontSize:18} + ...en.ERROR_POPUP_LABEL_OPTION,fontSize:18}
PetSelectGuidePopup 1 hunks, 1 statements
- const s=[...i.targetKindNums],e=[...i.targetAmounts]; + const i=[...s.targetKindNums],h=[...s.targetAmounts];
BaseShopProductPopup 1 hunks, 1 statements
- ,void 0); + ,void 0,import.meta.url);
ShopItemRenderer 1 hunks, 1 statements
- super(),Zt(this,"bg"),Zt(this,"lblName",new iG("2배속 ",16777215,hD.DEFAULT_OUTLINE_FONT_OPTION_18)),Zt(this,"icon",new Xe(RS.getTexture("UI_Ekkorr","Shop_Icon_07"))),Zt(this,"btnBuy",new kF("UI_GEM","100")),Zt(this,"btnAd",new kF("UI_MOVIE_SMALL",NB.getText("GAME_236","광고"))),Zt(this,"lblRemaining",new iG("",11184810,hD.DEFAULT_FONT_OPTION_16)),Zt(this,"lblCooldown",new iG("",16737894,hD.DEFAULT_FONT_OPTION_16)),Zt(this,"requesting",!1),this.bg=new hE({ + super(),n(this,"bg"),n(this,"lblName",new to("2배속 ",16777215,en.DEFAULT_OUTLINE_FONT_OPTION_18)),n(this,"icon",new u(nt.getTexture("UI_Ekkorr","Package_2"))),n(this,"btnBuy",new vl("UI_GEM","100")),n(this,"btnAd",new vl("UI_MOVIE_SMALL",Nr.getText("GAME_236","광고"))),n(this,"lblRemaining",new to("",11184810,en.DEFAULT_FONT_OPTION_16)),n(this,"lblCooldown",new to("",16737894,en.DEFAULT_FONT_OPTION_16)),n(this,"requesting",!1),this.bg=new A({
MissionGuide 1 hunks, 1 statements
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
ShopGemSubView 1 hunks, 1 statements
- return t.targetNum<=1?i(Math.max(0,...s.map(e)),t.condValue):i(s.filter(i=>e(i)>=t.condValue).length,t.targetNum)} + return t.targetNum<=1?s(Math.max(0,...i.map(h)),t.condValue):s(i.filter(s=>h(s)>=t.condValue).length,t.targetNum)}
HeroMultiLevelPopup 1 hunks, 1 statements
- const s=Math.min(...i.map(t=>t.level)),e=r4.getInstance().getMaxLevel(); + const i=Math.min(...s.map(t=>t.level)),h=CS.getInstance().getMaxLevel();
TreasureTransItemRenderer 1 hunks, 1 statements
- return[...i.equipedList,...i.ownedList].some(i=>i&&i.grade===t&&0===(i.trans||0))} + return[...s.equipedList,...s.ownedList].some(s=>s&&s.grade===t&&0===(s.trans||0))}
TreasureTransResultPopup 1 hunks, 1 statements
- const e=s[0],n=TR.getInstance(),h=new Set([...n.equipedKindNums,...n.ownedList.map(t=>t.kindNum)]),r=Math.min(e.itemList.length,this.setIcons.length); + const h=i[0],e=ws.getInstance(),n=new Set([...e.equipedKindNums,...e.ownedList.map(t=>t.kindNum)]),o=Math.min(h.itemList.length,this.setIcons.length);
AttackEffectManager 1 hunks, 1 statements
- const y0t=Qt(t=>Math.max(1,Math.round(60*t)),"frames$1"); + const bG=e(t=>Math.max(1,Math.round(60*t)),"frames");
BattleSpeedHelper 1 hunks, 1 statements
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
RaidResultPopup 1 hunks, 1 statements
- const _=Math.max(1,...s.map(t=>t.dmg)); + const b=Math.max(1,...i.map(t=>t.dmg));
RaidHud 1 hunks, 1 statements
- ),this.bossName.anchor.set(0,1),this.bossName.position.set(T,O-4),this.root.addChild(this.bossName),this.corpHeroKindNums=[...e]; + ),this.bossName.anchor.set(0,1),this.bossName.position.set(L,P-4),this.root.addChild(this.bossName),this.corpHeroKindNums=[...h];
BuffStatusPopup 1 hunks, 1 statements
- if(n)if(t=[...pR.getInstance().getContributors(o)],o===dR.GodBless){ + if(e)if(t=[...rs.getInstance().getContributors(r)],r===ns.GodBless){
TowerReadyPopup 1 hunks, 1 statements
- !r&&t.isCleared&&(r=await yS.getTowerTeam(-1,t.floor)),r&&r.kindNums&&12===r.kindNums.length?(this.teamKindNums=[...r.kindNums],this.teamTrans=[...r.trans],this.pruneInvalidTeamEntries(),this.clampTeamToMax()):this.initTeam(),this.selectedSlot=-1,this.updateAllyButtons(),this.updateEnemyButtons(),this.updateHeroList(),this.btnStart.text=NB.getText("COMMON_378","도전")} + !o&&t.isCleared&&(o=await j.getTowerTeam(-1,t.floor)),o&&o.kindNums&&12===o.kindNums.length?(this.teamKindNums=[...o.kindNums],this.teamTrans=[...o.trans],this.pruneInvalidTeamEntries(),this.clampTeamToMax()):this.initTeam(),this.selectedSlot=-1,this.updateAllyButtons(),this.updateEnemyButtons(),this.updateHeroList(),this.btnStart.text=Nr.getText("COMMON_378","도전")}
DungeonCoreBuffPopup 1 hunks, 1 statements
- const t=iR.getInstance(),i=[...r].sort((t,i)=>{ + const t=Xt.getInstance(),s=[...o].sort((t,s)=>{
DungeonReadyPopup 1 hunks, 1 statements
- s&&s.kindNums&&s.kindNums.length===t.MAX_ALLIES?(this.teamKindNums=[...s.kindNums],this.teamTrans=[...s.trans],this.pruneInvalidTeamEntries()):this.initTeam(),SJt.showAttackType=!0,this.selectedSlot=-1,this.updateAllyButtons(),this.updateHeroList(),this.btnStart.text=NB.getText("COMMON_378","도전")} + i&&i.kindNums&&i.kindNums.length===t.MAX_ALLIES?(this.teamKindNums=[...i.kindNums],this.teamTrans=[...i.trans],this.pruneInvalidTeamEntries()):this.initTeam(),py.showAttackType=!0,this.selectedSlot=-1,this.updateAllyButtons(),this.updateHeroList(),this.btnStart.text=Nr.getText("COMMON_378","도전")}
DungeonBattleController 1 hunks, 1 statements
- this.presetTeamKindNums=[...t],this.presetTeamTrans=[...i]} + this.presetTeamKindNums=[...t],this.presetTeamTrans=[...s]}
FavoritePetSubView 1 hunks, 1 statements
- const t=[..._G.getInstance().favoritePets].sort((t,i)=>{ + const t=[...wo.getInstance().favoritePets].sort((t,s)=>{
PetSecretShopSubMenu 1 hunks, 1 statements
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
PetShopSubMenu 1 hunks, 1 statements
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
TreasureChest 1 hunks, 1 statements
- w:n,h} + w:e,h:n}
MineRewardPopup 1 hunks, 1 statements
- const i=c.reduce((t,i)=>t+i.width,0)+Math.max(0,c.length-1)*t.REWARD_GAP_X,s=Math.max(24,...c.map(t=>t.height)); + const s=l.reduce((t,s)=>t+s.width,0)+Math.max(0,l.length-1)*t.REWARD_GAP_X,i=Math.max(24,...l.map(t=>t.height));
HeroPresetPart 1 hunks, 1 statements
- const i=iR.getInstance(),s=[...i.heroPresets[t].team]; + const s=Xt.getInstance(),i=[...s.heroPresets[t].team];
TreasureShopItemRenderer 1 hunks, 1 statements
- ,void 0); + ,void 0,import.meta.url);
TreasureSubView 1 hunks, 1 statements
- const t=[...TR.getInstance().equipedList]; + const t=[...ws.getInstance().equipedList];
TreasureTransDetailView 1 hunks, 1 statements
- const s=TR.getInstance(),e=[...s.equipedList,...s.ownedList].filter(i=>i&&i.grade===t); + const i=ws.getInstance(),h=[...i.equipedList,...i.ownedList].filter(s=>s&&s.grade===t);
HeroSelectGuidePopup 1 hunks, 1 statements
- const s=[...i.targetKindNums],e=iR.getInstance(); + const i=[...s.targetKindNums],h=Xt.getInstance();
MailItemRenderer 1 hunks, 1 statements
- t!=this._width&&(this._width=t,this.bg.width=this._width,this.updateLayout(),hD.setLabelWrapWidth(this.lblTitle,this.lblDate.x-85-20))} + t!=this._width&&(this._width=t,this.bg.width=this._width,this.updateLayout(),en.setLabelWrapWidth(this.lblTitle,this.lblDate.x-this.lblTitle.x-5))}
MailPopup 1 hunks, 1 statements
- TG.setUserInfo(s.body),HYt.getInstance().setData(s.body),ZB.getInstance().setStatusData(null==(t=s.body)?void 0:t.mineStatus),jYt.getInstance().setData(null==(i=s.body)?void 0:i.transTicket),this.setRequestPending3(!1); + Oo.setUserInfo(i.body),Nv.getInstance().setData(i.body),qr.getInstance().setStatusData(null==(t=i.body)?void 0:t.mineStatus),xW(i.body),Lv.getInstance().setData(null==(s=i.body)?void 0:s.transTicket),this.setRequestPending3(!1);
EventScheduleDetailPopup 1 hunks, 1 statements
- ,void 0); + ,void 0,import.meta.url);
EventSchedulePopup 1 hunks, 1 statements
- this.title=NB.getText("GAME_1887","이벤트 일정"),this.header.setData(),this.list.dataProvider=[...FB.eventScheduled],t&&this.list.scrollTo(0)} + this.title=Nr.getText("GAME_1887","이벤트 일정"),this.header.setData(),this.list.dataProvider=[...xr.eventScheduled],t&&this.list.scrollTo(0)}
GuildBarracksRaceView 1 hunks, 1 statements
- ...hD.DEFAULT_OUTLINE_FONT_OPTION_16,fontSize:i} + ...en.DEFAULT_OUTLINE_FONT_OPTION_16,fontSize:s}
GuildBarracksTribeItemRenderer 1 hunks, 1 statements
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
GuildGiftSubView 1 hunks, 1 statements
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
GuildRaidSubView 1 hunks, 1 statements
- const n=(null==(t=e.body)?void 0:t.mainList)??[],h=s.hasBook()?s.getMains():n.map(t=>t.main),r=h.map(t=>{ + const n=(null==(t=h.body)?void 0:t.mainList)??[],o=(i.hasBook()?i.getMains():n.map(t=>t.main)).map(t=>{
GuildWarHistoryItemRenderer 1 hunks, 1 statements
- ...hD.DEFAULT_OUTLINE_FONT_OPTION_16,fontSize:i} + ...en.DEFAULT_OUTLINE_FONT_OPTION_16,fontSize:s}
GuildWarTournamentRewardGuidePopup 1 hunks, 1 statements
- let e=[...OD.rewardBattleList.sort((t,i)=>i.kindNum-t.kindNum)].concat([...OD.rewardBattleLostList.sort((t,i)=>i.kindNum-t.kindNum)]); + let h=[...vn.rewardBattleList.sort((t,s)=>s.kindNum-t.kindNum)].concat([...vn.rewardBattleLostList.sort((t,s)=>s.kindNum-t.kindNum)]);
RankingDataManager 1 hunks, 1 statements
- e.name=i.name,e.maxWave=i.maxWave,e.accuWave=i.accuWave,e.accuMedal=i.accuMedal,e.rank=i.rank,this.list[this.selectedIndex].push(e)} + h.name=s.name,h.maxWave=s.maxWave,h.accuWave=s.accuWave,h.accuMedal=s.accuMedal,h.rank=s.rank,h.deco=s.deco??null,this.list[this.selectedIndex].push(h)}
RankingVO 1 hunks, 1 statements
- Zt(this,"name",""),Zt(this,"maxWave",0),Zt(this,"accuWave",0),Zt(this,"accuMedal",0),Zt(this,"rank",0)} + n(this,"name",""),n(this,"maxWave",0),n(this,"accuWave",0),n(this,"accuMedal",0),n(this,"rank",0),n(this,"deco",null)}
UserRankVO 1 hunks, 1 statements
- Zt(this,"userId",""),Zt(this,"name",""),Zt(this,"maxWave",0),Zt(this,"accuWave",0),Zt(this,"accuMedal",0),Zt(this,"rank",0)} + n(this,"userId",""),n(this,"name",""),n(this,"maxWave",0),n(this,"accuWave",0),n(this,"accuMedal",0),n(this,"rank",0),n(this,"deco",null)}
RankingUserTeamPopup 1 hunks, 1 statements
- this.teamContainer.visible=!n,this.lblHidden.visible=n,this.lblHidden.text=NB.getText("RANKING_TEAM_HIDDEN","팀 편성을 비공개로 설정한 유저입니다."),this.lblHidden.x=.5*(this.width-this.lblHidden.width),this.lblHidden.y=this.teamContainer.y+.5*(130-this.lblHidden.height); + this.teamContainer.visible=!e,this.lblHidden.visible=e,this.lblHidden.text=Nr.getText("GAME_2080","팀 편성을 비공개로 설정한 유저입니다."),this.lblHidden.x=.5*(this.width-this.lblHidden.width),this.lblHidden.y=this.teamContainer.y+.5*(130-this.lblHidden.height);
LanguageChangePopup 1 hunks, 1 statements
- ,void 0); + ,void 0,import.meta.url);
QuizRouletteManager 1 hunks, 1 statements
- const s=await sD.getInstance().miniGame.getInfo(2); + const i=await tn.getInstance().miniGame.getInfo(Le.ROULETTE);
RouletteSubView 1 hunks, 1 statements
- const t=await sD.getInstance().miniGame.rollRoulette(2); + const t=await tn.getInstance().miniGame.rollRoulette(Le.ROULETTE);
ReviveTeamBanner 1 hunks, 1 statements
- ,void 0).then(({ + ,void 0,import.meta.url).then(({
AdsRewardPopup 1 hunks, 1 statements
- ,void 0),i=t(); + ,void 0,import.meta.url),s=t();
ElfSecretSkillToast 1 hunks, 1 statements
- this.showIconMessage([s,...e].join("\n"),this.iconName,this.sheetName,180),this.y=580-this.height} + this.showIconMessage([i,...h].join("\n"),this.iconName,this.sheetName,180),this.y=580-this.height}
IntroOverlay 1 hunks, 1 statements
- ...hD.DEFAULT_FONT_OPTION_18,fontSize:14,lineHeight:18} + ...en.DEFAULT_FONT_OPTION_18,fontSize:14,lineHeight:18}
IntroView 1 hunks, 1 statements
- this.footerShade.clear().rect(0,n,i,s-n).fill(this.footerGradient)} + this.footerShade.clear().rect(0,e,s,i-e+J.SAFE_AREA_TOP).fill(this.footerGradient)}




