@rpg-engine/long-bow 0.8.20 → 0.8.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/components/InformationCenter/InformationCenter.d.ts +5 -15
  2. package/dist/components/InformationCenter/sections/bestiary/InformationCenterBestiarySection.d.ts +3 -1
  3. package/dist/components/InformationCenter/sections/bestiary/InformationCenterNPCDetails.d.ts +4 -1
  4. package/dist/components/InformationCenter/sections/bestiary/InformationCenterNPCTooltip.d.ts +1 -1
  5. package/dist/components/InformationCenter/sections/faq/InformationCenterFaqSection.d.ts +1 -1
  6. package/dist/components/InformationCenter/sections/items/InformationCenterItemDetails.d.ts +1 -1
  7. package/dist/components/InformationCenter/sections/items/InformationCenterItemTooltip.d.ts +1 -1
  8. package/dist/components/InformationCenter/sections/items/InformationCenterItemsSection.d.ts +2 -1
  9. package/dist/components/InformationCenter/sections/tutorials/InformationCenterTutorialsSection.d.ts +1 -1
  10. package/dist/long-bow.cjs.development.js +793 -660
  11. package/dist/long-bow.cjs.development.js.map +1 -1
  12. package/dist/long-bow.cjs.production.min.js +1 -1
  13. package/dist/long-bow.cjs.production.min.js.map +1 -1
  14. package/dist/long-bow.esm.js +794 -661
  15. package/dist/long-bow.esm.js.map +1 -1
  16. package/dist/mocks/informationCenter.mocks.d.ts +1 -2
  17. package/package.json +2 -2
  18. package/src/components/CraftBook/CraftBook.tsx +1 -1
  19. package/src/components/Dropdown.tsx +25 -3
  20. package/src/components/InformationCenter/InformationCenter.tsx +11 -18
  21. package/src/components/InformationCenter/sections/bestiary/InformationCenterBestiarySection.tsx +58 -7
  22. package/src/components/InformationCenter/sections/bestiary/InformationCenterNPCDetails.tsx +63 -15
  23. package/src/components/InformationCenter/sections/bestiary/InformationCenterNPCTooltip.tsx +7 -6
  24. package/src/components/InformationCenter/sections/faq/InformationCenterFaqSection.tsx +1 -1
  25. package/src/components/InformationCenter/sections/items/InformationCenterItemDetails.tsx +8 -6
  26. package/src/components/InformationCenter/sections/items/InformationCenterItemTooltip.tsx +1 -1
  27. package/src/components/InformationCenter/sections/items/InformationCenterItemsSection.tsx +36 -10
  28. package/src/components/InformationCenter/sections/tutorials/InformationCenterTutorialsSection.tsx +133 -34
  29. package/src/components/shared/PaginatedContent/PaginatedContent.tsx +1 -1
  30. package/src/mocks/informationCenter.mocks.ts +175 -55
  31. package/src/stories/UI/info/InformationCenter.stories.tsx +6 -1
  32. package/dist/components/InformationCenter/InformationCenterTypes.d.ts +0 -79
  33. package/src/components/InformationCenter/InformationCenterTypes.ts +0 -87
@@ -2,7 +2,7 @@ import React, { useState, useEffect, Component, useRef, useCallback, useContext,
2
2
  import styled, { css, keyframes } from 'styled-components';
3
3
  import { BeatLoader } from 'react-spinners';
4
4
  import { v4 } from 'uuid';
5
- import { GRID_WIDTH, GRID_HEIGHT, ShortcutType, getItemTextureKeyPath, ItemRarities, ItemContainerType, ItemType, DepotSocketEvents, ItemSocketEvents, ItemSocketEventsDisplayLabels, ActionsForInventory, ActionsForEquipmentSet, ActionsForLoot, ActionsForMapContainer, ItemSubType, isMobile, ItemSlotType, isMobileOrTablet, CharacterClass, QuestStatus, getSPForLevel, getXPForLevel, PeriodOfDay, UserAccountTypes } from '@rpg-engine/shared';
5
+ import { GRID_WIDTH, GRID_HEIGHT, ShortcutType, getItemTextureKeyPath, ItemRarities, ItemContainerType, ItemType, DepotSocketEvents, ItemSocketEvents, ItemSocketEventsDisplayLabels, ActionsForInventory, ActionsForEquipmentSet, ActionsForLoot, ActionsForMapContainer, ItemSubType, isMobile, ItemSlotType, isMobileOrTablet, NPCAlignment, VideoGuideCategory, VideoGuideLanguage, CharacterClass, QuestStatus, getSPForLevel, getXPForLevel, PeriodOfDay, UserAccountTypes } from '@rpg-engine/shared';
6
6
  import dayjs from 'dayjs';
7
7
  import { ErrorBoundary as ErrorBoundary$1 } from 'react-error-boundary';
8
8
  import { FaTimes, FaDiscord, FaWhatsapp, FaSearch, FaThumbtack, FaBoxOpen, FaChevronLeft, FaChevronRight, FaChevronUp, FaChevronDown, FaReddit } from 'react-icons/fa';
@@ -27398,6 +27398,9 @@ var Icon = /*#__PURE__*/styled.img.withConfig({
27398
27398
  return width;
27399
27399
  });
27400
27400
 
27401
+ var ITEM_HEIGHT = 35;
27402
+ var MAX_ITEMS_VISIBLE = 10;
27403
+ var MAX_HEIGHT = MAX_ITEMS_VISIBLE * ITEM_HEIGHT;
27401
27404
  var Dropdown = function Dropdown(_ref) {
27402
27405
  var options = _ref.options,
27403
27406
  width = _ref.width,
@@ -27450,7 +27453,8 @@ var Dropdown = function Dropdown(_ref) {
27450
27453
  }, React.createElement("label", null, "\u25BC"), " ", selectedOption), React.createElement(DropdownOptions$1, {
27451
27454
  className: "rpgui-dropdown-imp",
27452
27455
  opened: opened,
27453
- opensUp: opensUp
27456
+ opensUp: opensUp,
27457
+ optionsCount: options.length
27454
27458
  }, options.map(function (option) {
27455
27459
  return React.createElement("li", {
27456
27460
  key: option.id,
@@ -27465,23 +27469,25 @@ var Dropdown = function Dropdown(_ref) {
27465
27469
  var Container$8 = /*#__PURE__*/styled.div.withConfig({
27466
27470
  displayName: "Dropdown__Container",
27467
27471
  componentId: "sc-8arn65-0"
27468
- })(["position:relative;width:", ";"], function (props) {
27472
+ })(["position:relative;width:", ";max-height:", "px;"], function (props) {
27469
27473
  return props.width || '100%';
27470
- });
27474
+ }, MAX_HEIGHT);
27471
27475
  var DropdownSelect$1 = /*#__PURE__*/styled.p.withConfig({
27472
27476
  displayName: "Dropdown__DropdownSelect",
27473
27477
  componentId: "sc-8arn65-1"
27474
- })(["width:100%;box-sizing:border-box;label{display:inline-block;transform:translateY(-2px);}"]);
27478
+ })(["width:100%;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-height:", "px;label{display:inline-block;transform:translateY(-2px);}"], ITEM_HEIGHT);
27475
27479
  var DropdownOptions$1 = /*#__PURE__*/styled.ul.withConfig({
27476
27480
  displayName: "Dropdown__DropdownOptions",
27477
27481
  componentId: "sc-8arn65-2"
27478
- })(["position:absolute;width:100%;max-height:300px;overflow-y:auto;display:", ";box-sizing:border-box;bottom:", ";top:", ";margin:0;padding:0;@media (max-width:768px){padding:8px 0;}"], function (props) {
27482
+ })(["position:absolute;width:100%;max-height:", ";overflow-y:auto;display:", ";box-sizing:border-box;bottom:", ";top:", ";margin:0;padding:0;li{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:8px 12px;min-height:", "px;max-height:", "px;box-sizing:border-box;line-height:1.2;}"], function (props) {
27483
+ return props.opened ? Math.min(props.optionsCount * ITEM_HEIGHT, MAX_HEIGHT) + "px" : '0';
27484
+ }, function (props) {
27479
27485
  return props.opened ? 'block' : 'none';
27480
27486
  }, function (props) {
27481
27487
  return props.opensUp ? '100%' : 'auto';
27482
27488
  }, function (props) {
27483
27489
  return props.opensUp ? 'auto' : '100%';
27484
- });
27490
+ }, ITEM_HEIGHT, ITEM_HEIGHT);
27485
27491
 
27486
27492
  var modalRoot = /*#__PURE__*/document.getElementById('modal-root');
27487
27493
  var ModalPortal = function ModalPortal(_ref) {
@@ -29131,7 +29137,7 @@ var SearchContainer$1 = /*#__PURE__*/styled.div.withConfig({
29131
29137
  var ContentContainer = /*#__PURE__*/styled.div.withConfig({
29132
29138
  displayName: "CraftBook__ContentContainer",
29133
29139
  componentId: "sc-19q95ue-7"
29134
- })(["flex:1;display:flex;flex-direction:column;padding:16px;padding-right:0;padding-bottom:0;width:100%;position:relative;min-height:250px;overflow:hidden;"]);
29140
+ })(["flex:1;display:flex;flex-direction:column;padding:16px;padding-right:0;padding-bottom:0;width:100%;position:relative;min-height:300px;overflow:hidden;"]);
29135
29141
  var RadioInputScroller = /*#__PURE__*/styled.div.withConfig({
29136
29142
  displayName: "CraftBook__RadioInputScroller",
29137
29143
  componentId: "sc-19q95ue-8"
@@ -30963,7 +30969,7 @@ var StyledDropdown = /*#__PURE__*/styled(Dropdown).withConfig({
30963
30969
  var PaginatedContent = function PaginatedContent(_ref) {
30964
30970
  var items = _ref.items,
30965
30971
  _ref$itemsPerPage = _ref.itemsPerPage,
30966
- itemsPerPage = _ref$itemsPerPage === void 0 ? 5 : _ref$itemsPerPage,
30972
+ itemsPerPage = _ref$itemsPerPage === void 0 ? 8 : _ref$itemsPerPage,
30967
30973
  renderItem = _ref.renderItem,
30968
30974
  _ref$emptyMessage = _ref.emptyMessage,
30969
30975
  emptyMessage = _ref$emptyMessage === void 0 ? 'No items found' : _ref$emptyMessage,
@@ -31180,202 +31186,157 @@ var SpriteContainer$2 = /*#__PURE__*/styled.div.withConfig({
31180
31186
  componentId: "sc-1vguuz8-7"
31181
31187
  })(["width:64px;height:64px;background:rgba(0,0,0,0.3);border-radius:4px;display:flex;justify-content:center;align-items:center;position:relative;.sprite-from-atlas-img{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) scale(2);transform-origin:center;}"]);
31182
31188
 
31183
- var ITEMS_PER_PAGE$1 = 5;
31184
- var InformationCenterNPCDetails = function InformationCenterNPCDetails(_ref) {
31185
- var _npc$loots, _npc$skills$strength, _npc$skills$dexterity, _npc$skills$resistanc;
31186
- var npc = _ref.npc,
31189
+ var InformationCenterItemDetails = function InformationCenterItemDetails(_ref) {
31190
+ var item = _ref.item,
31187
31191
  itemsAtlasJSON = _ref.itemsAtlasJSON,
31188
31192
  itemsAtlasIMG = _ref.itemsAtlasIMG,
31189
- entitiesAtlasJSON = _ref.entitiesAtlasJSON,
31190
- entitiesAtlasIMG = _ref.entitiesAtlasIMG,
31193
+ droppedBy = _ref.droppedBy,
31191
31194
  onBack = _ref.onBack;
31192
31195
  var isMobile = isMobileOrTablet();
31193
- var _useState = useState(''),
31194
- lootSearchQuery = _useState[0],
31195
- setLootSearchQuery = _useState[1];
31196
- var _useState2 = useState(1),
31197
- currentLootPage = _useState2[0],
31198
- setCurrentLootPage = _useState2[1];
31199
- var formatText = function formatText(text) {
31200
- if (typeof text === 'number') {
31201
- return text.toString();
31202
- }
31203
- return text.toString().replace(/([A-Z])/g, ' $1').trim().replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2').replace(/\s+/g, ' ');
31196
+ var renderAllowedSlots = function renderAllowedSlots() {
31197
+ var _item$allowedEquipSlo;
31198
+ if (!((_item$allowedEquipSlo = item.allowedEquipSlotType) != null && _item$allowedEquipSlo.length)) return null;
31199
+ return React.createElement(InfoItem, null, React.createElement(Label, null, "Equip Slots:"), React.createElement(Value, null, item.allowedEquipSlotType.join(', ')));
31204
31200
  };
31205
- var formatRarity = function formatRarity(rarity) {
31206
- switch (rarity) {
31207
- case 0.5:
31208
- return 'Very Rare';
31209
- case 1:
31210
- return 'Rare';
31211
- case 10:
31212
- return 'Uncommon';
31213
- case 15:
31214
- return 'Semi Common';
31215
- case 20:
31216
- return 'Common';
31217
- case 35:
31218
- return 'Very Common';
31219
- default:
31220
- return 'Unknown';
31221
- }
31201
+ var renderRequirements = function renderRequirements() {
31202
+ if (!item.minRequirements) return null;
31203
+ return React.createElement(StyledCollapsible, {
31204
+ title: "Requirements",
31205
+ defaultOpen: !isMobile
31206
+ }, React.createElement(RequirementsGrid, null, item.minRequirements.level && React.createElement(RequirementItem, null, React.createElement(Label, null, "Level:"), React.createElement(Value, null, item.minRequirements.level)), item.minRequirements.skill && React.createElement(RequirementItem, null, React.createElement(Label, null, item.minRequirements.skill.name, ":"), React.createElement(Value, null, item.minRequirements.skill.level))));
31222
31207
  };
31223
- var filteredLoots = ((_npc$loots = npc.loots) == null ? void 0 : _npc$loots.filter(function (loot) {
31224
- return formatText(loot.itemBlueprintKey).toLowerCase().includes(lootSearchQuery.toLowerCase());
31225
- })) || [];
31226
- var totalLootPages = Math.ceil(filteredLoots.length / ITEMS_PER_PAGE$1);
31227
- var paginatedLoots = filteredLoots.slice((currentLootPage - 1) * ITEMS_PER_PAGE$1, currentLootPage * ITEMS_PER_PAGE$1);
31228
31208
  return React.createElement(BaseInformationDetails, {
31229
- name: npc.name,
31230
- spriteKey: npc.key,
31231
- atlasJSON: entitiesAtlasJSON,
31232
- atlasIMG: entitiesAtlasIMG,
31209
+ name: item.name,
31210
+ spriteKey: item.texturePath,
31211
+ atlasJSON: itemsAtlasJSON,
31212
+ atlasIMG: itemsAtlasIMG,
31233
31213
  onBack: onBack
31234
- }, React.createElement(InfoSection, null, React.createElement(InfoItem, null, React.createElement(Label, null, "Type:"), React.createElement(Value, null, formatText(npc.subType))), React.createElement(InfoItem, null, React.createElement(Label, null, "Alignment:"), React.createElement(Value, null, formatText(npc.alignment))), React.createElement(InfoItem, null, React.createElement(Label, null, "Attack Type:"), React.createElement(Value, null, formatText(npc.attackType))), React.createElement(InfoItem, null, React.createElement(Label, null, "Range:"), React.createElement(Value, null, formatText(npc.maxRangeAttack))), React.createElement(InfoItem, null, React.createElement(Label, null, "Speed:"), React.createElement(Value, null, formatText(npc.speed)))), React.createElement(StyledCollapsible, {
31235
- title: "Stats",
31214
+ }, React.createElement(InfoSection, null, React.createElement(InfoItem, null, React.createElement(Label, null, "Type:"), React.createElement(Value, null, item.type)), React.createElement(InfoItem, null, React.createElement(Label, null, "Subtype:"), React.createElement(Value, null, item.subType)), React.createElement(InfoItem, null, React.createElement(Label, null, "Tier:"), React.createElement(Value, null, item.tier)), React.createElement(InfoItem, null, React.createElement(Label, null, "Rarity:"), React.createElement(Value, null, item.rarity)), renderAllowedSlots()), React.createElement(StyledCollapsible, {
31215
+ title: "Description",
31236
31216
  defaultOpen: !isMobile
31237
- }, React.createElement(StatGrid, null, React.createElement(StatItem, null, "HP: ", npc.baseHealth), React.createElement(StatItem, null, "Level: ", npc.skills.level), ((_npc$skills$strength = npc.skills.strength) == null ? void 0 : _npc$skills$strength.level) && React.createElement(StatItem, null, "Strength: ", npc.skills.strength.level), ((_npc$skills$dexterity = npc.skills.dexterity) == null ? void 0 : _npc$skills$dexterity.level) && React.createElement(StatItem, null, "Dexterity: ", npc.skills.dexterity.level), ((_npc$skills$resistanc = npc.skills.resistance) == null ? void 0 : _npc$skills$resistanc.level) && React.createElement(StatItem, null, "Resistance: ", npc.skills.resistance.level))), npc.loots && npc.loots.length > 0 && React.createElement(StyledCollapsible, {
31238
- title: "Loot",
31217
+ }, React.createElement(Description$2, null, item.description || 'No description available.')), React.createElement(StyledCollapsible, {
31218
+ title: "Stats",
31239
31219
  defaultOpen: !isMobile
31240
- }, React.createElement(LootSearchContainer, null, React.createElement(StyledSearchBar$1, {
31241
- value: lootSearchQuery,
31242
- onChange: setLootSearchQuery,
31243
- placeholder: "Search loot..."
31244
- })), React.createElement(LootGrid, null, paginatedLoots.map(function (loot, index) {
31245
- return React.createElement(LootItem, {
31246
- key: index
31247
- }, React.createElement(SpriteFromAtlas, {
31248
- atlasJSON: itemsAtlasJSON,
31249
- atlasIMG: itemsAtlasIMG,
31250
- spriteKey: loot.itemBlueprintKey,
31251
- width: 24,
31252
- height: 24,
31253
- imgScale: 1
31254
- }), React.createElement(LootDetails, null, React.createElement(LootName, null, formatText(loot.itemBlueprintKey)), React.createElement(LootInfo, null, React.createElement(LootChance, null, formatRarity(loot.chance)), loot.quantityRange && React.createElement(LootQuantity, null, "x", loot.quantityRange[0], "-", loot.quantityRange[1]))));
31255
- })), filteredLoots.length > ITEMS_PER_PAGE$1 && React.createElement(PaginationContainer$2, null, React.createElement(StyledPagination, {
31256
- currentPage: currentLootPage,
31257
- totalPages: totalLootPages,
31258
- onPageChange: setCurrentLootPage
31259
- }))), npc.entityEffects && npc.entityEffects.length > 0 && React.createElement(StyledCollapsible, {
31220
+ }, React.createElement(StatGrid, null, React.createElement(StatItem, null, "Weight: ", item.weight), React.createElement(StatItem, null, "Stack Size: ", item.maxStackSize), item.rangeType && React.createElement(StatItem, null, "Range Type: ", item.rangeType), item.basePrice > 0 && React.createElement(StatItem, null, "Base Price: ", item.basePrice))), renderRequirements(), item.entityEffects && item.entityEffects.length > 0 && React.createElement(StyledCollapsible, {
31260
31221
  title: "Effects",
31261
31222
  defaultOpen: !isMobile
31262
- }, React.createElement(EffectsList, null, npc.entityEffects.map(function (effect, index) {
31223
+ }, React.createElement(EffectsList, null, item.entityEffects.map(function (effect, index) {
31263
31224
  return React.createElement(EffectItem, {
31264
31225
  key: index
31265
- }, formatText(effect));
31266
- }))), npc.areaSpells && npc.areaSpells.length > 0 && React.createElement(StyledCollapsible, {
31267
- title: "Spells",
31226
+ }, effect, item.entityEffectChance && React.createElement(EffectChance, null, "(", item.entityEffectChance, "%)"));
31227
+ })), item.usableEffectDescription && React.createElement(EffectDescription, null, item.usableEffectDescription)), item.equippedBuff && item.equippedBuff.length > 0 && React.createElement(StyledCollapsible, {
31228
+ title: "Equipped Buffs",
31268
31229
  defaultOpen: !isMobile
31269
- }, React.createElement(SpellsList, null, npc.areaSpells.map(function (spell, index) {
31270
- return React.createElement(SpellItem, {
31230
+ }, React.createElement(BuffsList, null, item.equippedBuff.map(function (buff, index) {
31231
+ return React.createElement(BuffItem, {
31271
31232
  key: index
31272
- }, React.createElement(SpellName, null, formatText(spell.spellKey)), React.createElement(SpellDetails, null, "Power: ", React.createElement(SpellValue, null, formatText(spell.power)), React.createElement(Separator, null, "\u2022"), "Chance: ", React.createElement(SpellValue, null, spell.probability, "%")));
31233
+ }, React.createElement(BuffName, null, buff.trait.replace(/^\w/, function (c) {
31234
+ return c.toUpperCase();
31235
+ })), React.createElement(BuffValue, null, "+", buff.buffPercentage, "%"));
31236
+ })), item.equippedBuffDescription && React.createElement(BuffDescription, null, item.equippedBuffDescription)), droppedBy.length > 0 && React.createElement(StyledCollapsible, {
31237
+ title: "Dropped By",
31238
+ defaultOpen: !isMobile
31239
+ }, React.createElement(DropList, null, droppedBy.map(function (npc) {
31240
+ var loot = npc.loots.find(function (l) {
31241
+ return l.itemBlueprintKey === item.key;
31242
+ });
31243
+ return React.createElement(DropItem, {
31244
+ key: npc.id
31245
+ }, React.createElement(NPCName, null, npc.name), React.createElement(DropRate, null, loot == null ? void 0 : loot.chance, "%"));
31273
31246
  }))));
31274
31247
  };
31275
31248
  var InfoSection = /*#__PURE__*/styled.div.withConfig({
31276
- displayName: "InformationCenterNPCDetails__InfoSection",
31277
- componentId: "sc-fdu3xl-0"
31249
+ displayName: "InformationCenterItemDetails__InfoSection",
31250
+ componentId: "sc-zwf6pb-0"
31278
31251
  })(["display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:8px;background:rgba(255,255,255,0.05);padding:12px;border-radius:4px;"]);
31279
31252
  var InfoItem = /*#__PURE__*/styled.div.withConfig({
31280
- displayName: "InformationCenterNPCDetails__InfoItem",
31281
- componentId: "sc-fdu3xl-1"
31253
+ displayName: "InformationCenterItemDetails__InfoItem",
31254
+ componentId: "sc-zwf6pb-1"
31282
31255
  })(["display:flex;align-items:center;gap:8px;"]);
31283
31256
  var Label = /*#__PURE__*/styled.span.withConfig({
31284
- displayName: "InformationCenterNPCDetails__Label",
31285
- componentId: "sc-fdu3xl-2"
31257
+ displayName: "InformationCenterItemDetails__Label",
31258
+ componentId: "sc-zwf6pb-2"
31286
31259
  })(["color:", ";font-size:0.5rem;opacity:0.8;"], uiColors.yellow);
31287
31260
  var Value = /*#__PURE__*/styled.span.withConfig({
31288
- displayName: "InformationCenterNPCDetails__Value",
31289
- componentId: "sc-fdu3xl-3"
31261
+ displayName: "InformationCenterItemDetails__Value",
31262
+ componentId: "sc-zwf6pb-3"
31290
31263
  })(["color:", ";font-size:0.5rem;"], uiColors.white);
31291
31264
  var StyledCollapsible = /*#__PURE__*/styled(Collapsible).withConfig({
31292
- displayName: "InformationCenterNPCDetails__StyledCollapsible",
31293
- componentId: "sc-fdu3xl-4"
31265
+ displayName: "InformationCenterItemDetails__StyledCollapsible",
31266
+ componentId: "sc-zwf6pb-4"
31294
31267
  })(["background:rgba(255,255,255,0.05);border-radius:4px;overflow:hidden;"]);
31268
+ var Description$2 = /*#__PURE__*/styled.p.withConfig({
31269
+ displayName: "InformationCenterItemDetails__Description",
31270
+ componentId: "sc-zwf6pb-5"
31271
+ })(["color:", ";font-size:0.5rem;margin:0;padding:12px;line-height:1.5;"], uiColors.white);
31295
31272
  var StatGrid = /*#__PURE__*/styled.div.withConfig({
31296
- displayName: "InformationCenterNPCDetails__StatGrid",
31297
- componentId: "sc-fdu3xl-5"
31273
+ displayName: "InformationCenterItemDetails__StatGrid",
31274
+ componentId: "sc-zwf6pb-6"
31298
31275
  })(["display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px;padding:12px;"]);
31299
31276
  var StatItem = /*#__PURE__*/styled.div.withConfig({
31300
- displayName: "InformationCenterNPCDetails__StatItem",
31301
- componentId: "sc-fdu3xl-6"
31277
+ displayName: "InformationCenterItemDetails__StatItem",
31278
+ componentId: "sc-zwf6pb-7"
31302
31279
  })(["color:", ";font-size:0.5rem;background:rgba(255,255,255,0.05);padding:8px;border-radius:4px;"], uiColors.white);
31303
31280
  var EffectsList = /*#__PURE__*/styled.div.withConfig({
31304
- displayName: "InformationCenterNPCDetails__EffectsList",
31305
- componentId: "sc-fdu3xl-7"
31281
+ displayName: "InformationCenterItemDetails__EffectsList",
31282
+ componentId: "sc-zwf6pb-8"
31306
31283
  })(["display:flex;flex-wrap:wrap;gap:8px;padding:12px;"]);
31307
31284
  var EffectItem = /*#__PURE__*/styled.div.withConfig({
31308
- displayName: "InformationCenterNPCDetails__EffectItem",
31309
- componentId: "sc-fdu3xl-8"
31310
- })(["color:", ";font-size:0.5rem;background:rgba(255,255,255,0.1);padding:4px 8px;border-radius:4px;"], uiColors.white);
31311
- var SpellsList = /*#__PURE__*/styled.div.withConfig({
31312
- displayName: "InformationCenterNPCDetails__SpellsList",
31313
- componentId: "sc-fdu3xl-9"
31285
+ displayName: "InformationCenterItemDetails__EffectItem",
31286
+ componentId: "sc-zwf6pb-9"
31287
+ })(["display:flex;align-items:center;gap:4px;color:", ";font-size:0.5rem;background:rgba(255,255,255,0.1);padding:4px 8px;border-radius:4px;"], uiColors.white);
31288
+ var EffectChance = /*#__PURE__*/styled.span.withConfig({
31289
+ displayName: "InformationCenterItemDetails__EffectChance",
31290
+ componentId: "sc-zwf6pb-10"
31291
+ })(["color:", ";opacity:0.8;"], uiColors.yellow);
31292
+ var BuffsList = /*#__PURE__*/styled.div.withConfig({
31293
+ displayName: "InformationCenterItemDetails__BuffsList",
31294
+ componentId: "sc-zwf6pb-11"
31314
31295
  })(["display:flex;flex-direction:column;gap:8px;padding:12px;"]);
31315
- var SpellItem = /*#__PURE__*/styled.div.withConfig({
31316
- displayName: "InformationCenterNPCDetails__SpellItem",
31317
- componentId: "sc-fdu3xl-10"
31318
- })(["display:flex;flex-direction:column;gap:4px;background:rgba(255,255,255,0.05);padding:8px;border-radius:4px;"]);
31319
- var SpellName = /*#__PURE__*/styled.div.withConfig({
31320
- displayName: "InformationCenterNPCDetails__SpellName",
31321
- componentId: "sc-fdu3xl-11"
31296
+ var BuffItem = /*#__PURE__*/styled.div.withConfig({
31297
+ displayName: "InformationCenterItemDetails__BuffItem",
31298
+ componentId: "sc-zwf6pb-12"
31299
+ })(["display:flex;justify-content:space-between;align-items:center;background:rgba(255,255,255,0.05);padding:8px;border-radius:4px;"]);
31300
+ var BuffName = /*#__PURE__*/styled.span.withConfig({
31301
+ displayName: "InformationCenterItemDetails__BuffName",
31302
+ componentId: "sc-zwf6pb-13"
31303
+ })(["color:", ";font-size:0.5rem;"], uiColors.white);
31304
+ var BuffValue = /*#__PURE__*/styled.span.withConfig({
31305
+ displayName: "InformationCenterItemDetails__BuffValue",
31306
+ componentId: "sc-zwf6pb-14"
31322
31307
  })(["color:", ";font-size:0.5rem;"], uiColors.yellow);
31323
- var SpellDetails = /*#__PURE__*/styled.div.withConfig({
31324
- displayName: "InformationCenterNPCDetails__SpellDetails",
31325
- componentId: "sc-fdu3xl-12"
31326
- })(["display:flex;align-items:center;gap:8px;color:", ";font-size:0.45rem;opacity:0.8;"], uiColors.white);
31327
- var SpellValue = /*#__PURE__*/styled.span.withConfig({
31328
- displayName: "InformationCenterNPCDetails__SpellValue",
31329
- componentId: "sc-fdu3xl-13"
31330
- })(["color:", ";"], uiColors.yellow);
31331
- var Separator = /*#__PURE__*/styled.span.withConfig({
31332
- displayName: "InformationCenterNPCDetails__Separator",
31333
- componentId: "sc-fdu3xl-14"
31334
- })(["color:", ";opacity:0.5;"], uiColors.yellow);
31335
- var LootSearchContainer = /*#__PURE__*/styled.div.withConfig({
31336
- displayName: "InformationCenterNPCDetails__LootSearchContainer",
31337
- componentId: "sc-fdu3xl-15"
31338
- })(["padding:12px 12px 0;"]);
31339
- var StyledSearchBar$1 = /*#__PURE__*/styled(SearchBar).withConfig({
31340
- displayName: "InformationCenterNPCDetails__StyledSearchBar",
31341
- componentId: "sc-fdu3xl-16"
31342
- })(["width:100%;"]);
31343
- var LootGrid = /*#__PURE__*/styled.div.withConfig({
31344
- displayName: "InformationCenterNPCDetails__LootGrid",
31345
- componentId: "sc-fdu3xl-17"
31346
- })(["display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:8px;padding:12px;"]);
31347
- var LootItem = /*#__PURE__*/styled.div.withConfig({
31348
- displayName: "InformationCenterNPCDetails__LootItem",
31349
- componentId: "sc-fdu3xl-18"
31350
- })(["display:flex;align-items:center;gap:8px;background:rgba(255,255,255,0.05);padding:8px;border-radius:4px;"]);
31351
- var LootDetails = /*#__PURE__*/styled.div.withConfig({
31352
- displayName: "InformationCenterNPCDetails__LootDetails",
31353
- componentId: "sc-fdu3xl-19"
31354
- })(["flex:1;display:flex;flex-direction:column;gap:4px;"]);
31355
- var LootName = /*#__PURE__*/styled.div.withConfig({
31356
- displayName: "InformationCenterNPCDetails__LootName",
31357
- componentId: "sc-fdu3xl-20"
31308
+ var BuffDescription = /*#__PURE__*/styled.p.withConfig({
31309
+ displayName: "InformationCenterItemDetails__BuffDescription",
31310
+ componentId: "sc-zwf6pb-15"
31311
+ })(["color:", ";font-size:0.45rem;margin:0;padding:0 12px 12px;font-style:italic;"], uiColors.lightGray);
31312
+ var DropList = /*#__PURE__*/styled.div.withConfig({
31313
+ displayName: "InformationCenterItemDetails__DropList",
31314
+ componentId: "sc-zwf6pb-16"
31315
+ })(["display:flex;flex-direction:column;gap:0.5rem;padding:12px;"]);
31316
+ var DropItem = /*#__PURE__*/styled.div.withConfig({
31317
+ displayName: "InformationCenterItemDetails__DropItem",
31318
+ componentId: "sc-zwf6pb-17"
31319
+ })(["display:flex;justify-content:space-between;align-items:center;padding:0.5rem;background:rgba(255,255,255,0.05);border-radius:4px;"]);
31320
+ var NPCName = /*#__PURE__*/styled.span.withConfig({
31321
+ displayName: "InformationCenterItemDetails__NPCName",
31322
+ componentId: "sc-zwf6pb-18"
31358
31323
  })(["color:", ";font-size:0.5rem;"], uiColors.white);
31359
- var LootInfo = /*#__PURE__*/styled.div.withConfig({
31360
- displayName: "InformationCenterNPCDetails__LootInfo",
31361
- componentId: "sc-fdu3xl-21"
31362
- })(["display:flex;align-items:center;gap:8px;"]);
31363
- var LootChance = /*#__PURE__*/styled.span.withConfig({
31364
- displayName: "InformationCenterNPCDetails__LootChance",
31365
- componentId: "sc-fdu3xl-22"
31366
- })(["color:", ";font-size:0.45rem;"], uiColors.yellow);
31367
- var LootQuantity = /*#__PURE__*/styled.span.withConfig({
31368
- displayName: "InformationCenterNPCDetails__LootQuantity",
31369
- componentId: "sc-fdu3xl-23"
31370
- })(["color:", ";font-size:0.45rem;"], uiColors.lightGray);
31371
- var PaginationContainer$2 = /*#__PURE__*/styled.div.withConfig({
31372
- displayName: "InformationCenterNPCDetails__PaginationContainer",
31373
- componentId: "sc-fdu3xl-24"
31374
- })(["display:flex;justify-content:center;padding:12px;"]);
31375
- var StyledPagination = /*#__PURE__*/styled(Pagination).withConfig({
31376
- displayName: "InformationCenterNPCDetails__StyledPagination",
31377
- componentId: "sc-fdu3xl-25"
31378
- })(["font-size:0.6rem;"]);
31324
+ var DropRate = /*#__PURE__*/styled.span.withConfig({
31325
+ displayName: "InformationCenterItemDetails__DropRate",
31326
+ componentId: "sc-zwf6pb-19"
31327
+ })(["color:", ";font-size:0.5rem;"], uiColors.yellow);
31328
+ var RequirementsGrid = /*#__PURE__*/styled.div.withConfig({
31329
+ displayName: "InformationCenterItemDetails__RequirementsGrid",
31330
+ componentId: "sc-zwf6pb-20"
31331
+ })(["display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px;padding:12px;"]);
31332
+ var RequirementItem = /*#__PURE__*/styled.div.withConfig({
31333
+ displayName: "InformationCenterItemDetails__RequirementItem",
31334
+ componentId: "sc-zwf6pb-21"
31335
+ })(["display:flex;align-items:center;gap:8px;background:rgba(255,255,255,0.05);padding:8px;border-radius:4px;"]);
31336
+ var EffectDescription = /*#__PURE__*/styled.p.withConfig({
31337
+ displayName: "InformationCenterItemDetails__EffectDescription",
31338
+ componentId: "sc-zwf6pb-22"
31339
+ })(["color:", ";font-size:0.45rem;margin:8px 0 0;padding:0 12px;font-style:italic;"], uiColors.lightGray);
31379
31340
 
31380
31341
  var TooltipContainer$1 = /*#__PURE__*/styled.div.withConfig({
31381
31342
  displayName: "BaseTooltip__TooltipContainer",
@@ -31411,595 +31372,728 @@ var BaseTooltip = function BaseTooltip(_ref) {
31411
31372
  }, children);
31412
31373
  };
31413
31374
 
31414
- var EffectsList$1 = /*#__PURE__*/styled.div.withConfig({
31415
- displayName: "InformationCenterNPCTooltip__EffectsList",
31416
- componentId: "sc-j2o39s-0"
31417
- })(["display:flex;gap:8px;flex-wrap:wrap;"]);
31418
- var EffectItem$1 = /*#__PURE__*/styled.span.withConfig({
31419
- displayName: "InformationCenterNPCTooltip__EffectItem",
31420
- componentId: "sc-j2o39s-1"
31421
- })(["font-size:0.5rem;color:", ";background:rgba(255,255,255,0.1);padding:2px 6px;border-radius:4px;"], uiColors.white);
31422
- var SpellList = /*#__PURE__*/styled.div.withConfig({
31423
- displayName: "InformationCenterNPCTooltip__SpellList",
31424
- componentId: "sc-j2o39s-2"
31425
- })(["display:flex;flex-direction:column;gap:2px;"]);
31426
- var SpellItem$1 = /*#__PURE__*/styled.div.withConfig({
31427
- displayName: "InformationCenterNPCTooltip__SpellItem",
31428
- componentId: "sc-j2o39s-3"
31429
- })(["display:flex;align-items:center;justify-content:space-between;font-size:0.5rem;color:", ";background:rgba(255,255,255,0.05);padding:2px 6px;border-radius:4px;"], uiColors.white);
31430
- var SpellInfo = /*#__PURE__*/styled.span.withConfig({
31431
- displayName: "InformationCenterNPCTooltip__SpellInfo",
31432
- componentId: "sc-j2o39s-4"
31433
- })(["color:", ";margin-left:8px;opacity:0.8;"], uiColors.yellow);
31434
- var LootList = /*#__PURE__*/styled.div.withConfig({
31435
- displayName: "InformationCenterNPCTooltip__LootList",
31436
- componentId: "sc-j2o39s-5"
31437
- })(["display:flex;flex-direction:column;gap:2px;"]);
31438
- var LootItem$1 = /*#__PURE__*/styled.div.withConfig({
31439
- displayName: "InformationCenterNPCTooltip__LootItem",
31440
- componentId: "sc-j2o39s-6"
31441
- })(["display:flex;align-items:center;gap:4px;font-size:0.5rem;background:rgba(255,255,255,0.05);padding:4px 6px;border-radius:4px;.sprite-from-atlas-img{top:0px;left:0px;}"]);
31442
- var LootName$1 = /*#__PURE__*/styled.span.withConfig({
31443
- displayName: "InformationCenterNPCTooltip__LootName",
31444
- componentId: "sc-j2o39s-7"
31445
- })(["color:", ";flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-left:4px;"], uiColors.white);
31446
- var LootChance$1 = /*#__PURE__*/styled.span.withConfig({
31447
- displayName: "InformationCenterNPCTooltip__LootChance",
31448
- componentId: "sc-j2o39s-8"
31449
- })(["color:", ";font-size:0.45rem;text-transform:lowercase;opacity:0.8;"], uiColors.yellow);
31450
- var MoreIndicator = /*#__PURE__*/styled.div.withConfig({
31451
- displayName: "InformationCenterNPCTooltip__MoreIndicator",
31452
- componentId: "sc-j2o39s-9"
31453
- })(["color:", ";font-size:0.45rem;text-align:center;margin-top:2px;opacity:0.7;"], uiColors.yellow);
31454
- var formatText = function formatText(text) {
31455
- if (typeof text === 'number') {
31456
- return text.toString();
31457
- }
31458
- return text.toString().replace(/([A-Z])/g, ' $1').trim().replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2').replace(/\s+/g, ' ');
31459
- };
31460
- var formatRarity = function formatRarity(rarity) {
31461
- switch (rarity) {
31462
- case 0.5:
31463
- return 'Very Rare';
31464
- case 1:
31465
- return 'Rare';
31466
- case 10:
31467
- return 'Uncommon';
31468
- case 15:
31469
- return 'Semi Common';
31470
- case 20:
31471
- return 'Common';
31472
- case 35:
31473
- return 'Very Common';
31375
+ var ItemHeader$1 = /*#__PURE__*/styled.div.withConfig({
31376
+ displayName: "InformationCenterItemTooltip__ItemHeader",
31377
+ componentId: "sc-1ecf9mj-0"
31378
+ })(["display:flex;align-items:center;gap:8px;"]);
31379
+ var Description$3 = /*#__PURE__*/styled.div.withConfig({
31380
+ displayName: "InformationCenterItemTooltip__Description",
31381
+ componentId: "sc-1ecf9mj-1"
31382
+ })(["color:", ";font-size:0.5rem;line-height:1.4;margin-top:8px;opacity:0.8;"], uiColors.white);
31383
+ var RarityText = /*#__PURE__*/styled.span.withConfig({
31384
+ displayName: "InformationCenterItemTooltip__RarityText",
31385
+ componentId: "sc-1ecf9mj-2"
31386
+ })(["color:", ";font-size:0.5rem;"], function (props) {
31387
+ switch (props.rarity.toLowerCase()) {
31388
+ case 'legendary':
31389
+ return '#ff8c00';
31390
+ case 'rare':
31391
+ return '#0070dd';
31392
+ case 'uncommon':
31393
+ return '#1eff00';
31474
31394
  default:
31475
- return 'Unknown';
31395
+ return '#ffffff';
31476
31396
  }
31477
- };
31478
- var InformationCenterNPCTooltip = function InformationCenterNPCTooltip(_ref) {
31479
- var _npc$skills$strength, _npc$skills$dexterity, _npc$skills$resistanc;
31480
- var npc = _ref.npc,
31481
- itemsAtlasJSON = _ref.itemsAtlasJSON,
31482
- itemsAtlasIMG = _ref.itemsAtlasIMG;
31483
- return React.createElement(BaseTooltip, null, React.createElement(TooltipTitle$1, null, npc.name), React.createElement(StatsContainer, null, React.createElement(StatItem$1, null, "HP: ", npc.baseHealth), React.createElement(StatItem$1, null, "LVL: ", npc.skills.level), React.createElement(StatItem$1, null, "STR: ", ((_npc$skills$strength = npc.skills.strength) == null ? void 0 : _npc$skills$strength.level) || '-'), React.createElement(StatItem$1, null, "DEX: ", ((_npc$skills$dexterity = npc.skills.dexterity) == null ? void 0 : _npc$skills$dexterity.level) || '-'), React.createElement(StatItem$1, null, "RES: ", ((_npc$skills$resistanc = npc.skills.resistance) == null ? void 0 : _npc$skills$resistanc.level) || '-'), React.createElement(StatItem$1, null, "SPD: ", formatText(npc.speed))), npc.entityEffects && npc.entityEffects.length > 0 && React.createElement(Section, null, React.createElement(SectionTitle, null, "Effects"), React.createElement(EffectsList$1, null, npc.entityEffects.map(function (effect) {
31484
- return React.createElement(EffectItem$1, {
31485
- key: effect
31486
- }, formatText(effect));
31487
- }))), npc.areaSpells && npc.areaSpells.length > 0 && React.createElement(Section, null, React.createElement(SectionTitle, null, "Spells"), React.createElement(SpellList, null, npc.areaSpells.map(function (spell) {
31488
- return React.createElement(SpellItem$1, {
31489
- key: spell.spellKey
31490
- }, formatText(spell.spellKey), React.createElement(SpellInfo, null, formatText(spell.power), ", ", spell.probability, "%"));
31491
- }))), npc.loots && npc.loots.length > 0 && React.createElement(Section, null, React.createElement(SectionTitle, null, "Possible Loot"), React.createElement(LootList, null, npc.loots.slice(0, 4).map(function (loot) {
31492
- return React.createElement(LootItem$1, {
31493
- key: loot.itemBlueprintKey
31494
- }, React.createElement(SpriteFromAtlas, {
31495
- atlasIMG: itemsAtlasIMG,
31496
- atlasJSON: itemsAtlasJSON,
31497
- spriteKey: loot.itemBlueprintKey,
31498
- imgScale: 1
31499
- }), React.createElement(LootName$1, null, formatText(loot.itemBlueprintKey)), React.createElement(LootChance$1, null, formatRarity(loot.chance)));
31500
- }), npc.loots.length > 4 && React.createElement(MoreIndicator, null, "..."))));
31397
+ });
31398
+ var InformationCenterItemTooltip = function InformationCenterItemTooltip(_ref) {
31399
+ var item = _ref.item;
31400
+ return React.createElement(BaseTooltip, null, React.createElement(ItemHeader$1, null, React.createElement(TooltipTitle$1, null, item.name)), React.createElement(Description$3, null, item.description), React.createElement(Section, null, React.createElement(SectionTitle, null, "Details"), React.createElement(StatsContainer, null, React.createElement(StatItem$1, null, "Type: ", item.type), React.createElement(StatItem$1, null, "Weight: ", item.weight), item.attack !== undefined && React.createElement(StatItem$1, null, "Attack: ", item.attack), item.defense !== undefined && React.createElement(StatItem$1, null, "Defense: ", item.defense), item.tier !== undefined && React.createElement(StatItem$1, null, "Tier: ", item.tier), item.rangeType && React.createElement(StatItem$1, null, "Range: ", item.rangeType))), React.createElement(Section, null, React.createElement(SectionTitle, null, "Market"), React.createElement(StatsContainer, null, React.createElement(StatItem$1, null, "Price: ", item.basePrice), item.rarity && React.createElement(StatItem$1, null, "Rarity:", ' ', React.createElement(RarityText, {
31401
+ rarity: item.rarity
31402
+ }, item.rarity)))));
31501
31403
  };
31502
31404
 
31503
- var InformationCenterBestiarySection = function InformationCenterBestiarySection(_ref) {
31504
- var bestiaryItems = _ref.bestiaryItems,
31405
+ var TOOLTIP_OFFSET = 200;
31406
+ var formatItemType = function formatItemType(type) {
31407
+ var words = type.split(/(?=[A-Z])/);
31408
+ if (words.length === 1) {
31409
+ return words[0];
31410
+ }
31411
+ return words.map(function (word, index) {
31412
+ if (index === 0) {
31413
+ return word.charAt(0) + '.';
31414
+ }
31415
+ return word;
31416
+ }).join(' ');
31417
+ };
31418
+ var InformationCenterItemsSection = function InformationCenterItemsSection(_ref) {
31419
+ var items = _ref.items,
31420
+ bestiaryItems = _ref.bestiaryItems,
31505
31421
  itemsAtlasJSON = _ref.itemsAtlasJSON,
31506
31422
  itemsAtlasIMG = _ref.itemsAtlasIMG,
31507
- entitiesAtlasJSON = _ref.entitiesAtlasJSON,
31508
- entitiesAtlasIMG = _ref.entitiesAtlasIMG,
31509
31423
  initialSearchQuery = _ref.initialSearchQuery,
31510
31424
  tabId = _ref.tabId;
31511
31425
  var _useState = useState(initialSearchQuery),
31512
31426
  searchQuery = _useState[0],
31513
31427
  setSearchQuery = _useState[1];
31514
- var _useState2 = useState(null),
31515
- tooltipData = _useState2[0],
31516
- setTooltipData = _useState2[1];
31428
+ var _useState2 = useState('all'),
31429
+ selectedItemCategory = _useState2[0],
31430
+ setSelectedItemCategory = _useState2[1];
31517
31431
  var _useState3 = useState(null),
31518
- selectedMonster = _useState3[0],
31519
- setSelectedMonster = _useState3[1];
31520
- var _useState4 = useState('ontouchstart' in window),
31521
- isTouchDevice = _useState4[0];
31522
- var handleMouseEnter = function handleMouseEnter(monster, event) {
31523
- if (!isTouchDevice && !selectedMonster) {
31524
- setTooltipData({
31525
- npc: monster,
31526
- position: {
31527
- x: event.clientX,
31528
- y: event.clientY
31529
- }
31432
+ hoveredItem = _useState3[0],
31433
+ setHoveredItem = _useState3[1];
31434
+ var _useState4 = useState({
31435
+ x: 0,
31436
+ y: 0
31437
+ }),
31438
+ tooltipPosition = _useState4[0],
31439
+ setTooltipPosition = _useState4[1];
31440
+ var _useState5 = useState(null),
31441
+ selectedItem = _useState5[0],
31442
+ setSelectedItem = _useState5[1];
31443
+ var itemCategoryOptions = [{
31444
+ id: 0,
31445
+ value: 'all',
31446
+ option: 'All Items'
31447
+ }].concat(Object.values(ItemType).map(function (type, index) {
31448
+ return {
31449
+ id: index + 1,
31450
+ value: type,
31451
+ option: formatItemType(type)
31452
+ };
31453
+ }));
31454
+ var filteredItems = items.filter(function (item) {
31455
+ return (selectedItemCategory === 'all' || item.type === selectedItemCategory) && item.name.toLowerCase().includes(searchQuery.toLowerCase());
31456
+ });
31457
+ var getDroppedByNPCs = function getDroppedByNPCs(itemId, npcs) {
31458
+ return npcs.filter(function (npc) {
31459
+ var _npc$loots;
31460
+ return (_npc$loots = npc.loots) == null ? void 0 : _npc$loots.some(function (loot) {
31461
+ return loot.itemBlueprintKey === itemId;
31462
+ });
31463
+ }) || [];
31464
+ };
31465
+ var handleMouseEnter = function handleMouseEnter(e, item) {
31466
+ setTooltipPosition({
31467
+ x: e.clientX + TOOLTIP_OFFSET,
31468
+ y: e.clientY
31469
+ });
31470
+ setHoveredItem(item);
31471
+ };
31472
+ var handleMouseMove = function handleMouseMove(e) {
31473
+ if (hoveredItem) {
31474
+ setTooltipPosition({
31475
+ x: e.clientX + TOOLTIP_OFFSET,
31476
+ y: e.clientY
31530
31477
  });
31531
31478
  }
31532
31479
  };
31533
31480
  var handleMouseLeave = function handleMouseLeave() {
31534
- if (!isTouchDevice) {
31535
- setTooltipData(null);
31536
- }
31481
+ setHoveredItem(null);
31537
31482
  };
31538
- var handleMouseMove = function handleMouseMove(event) {
31539
- if (!isTouchDevice && tooltipData) {
31540
- setTooltipData(_extends({}, tooltipData, {
31541
- position: {
31542
- x: event.clientX,
31543
- y: event.clientY
31544
- }
31545
- }));
31546
- }
31483
+ var handleTouchStart = function handleTouchStart(e, item) {
31484
+ var touch = e.touches[0];
31485
+ setTooltipPosition({
31486
+ x: touch.clientX + TOOLTIP_OFFSET,
31487
+ y: touch.clientY
31488
+ });
31489
+ setHoveredItem(item);
31547
31490
  };
31548
- var handleTouchStart = function handleTouchStart(monster, event) {
31549
- if (isTouchDevice) {
31550
- event.preventDefault();
31551
- var touch = event.touches[0];
31552
- if ((tooltipData == null ? void 0 : tooltipData.npc.id) === monster.id) {
31553
- setTooltipData(null);
31554
- } else {
31555
- setTooltipData({
31556
- npc: monster,
31557
- position: {
31558
- x: touch.clientX,
31559
- y: touch.clientY
31560
- }
31561
- });
31562
- }
31563
- }
31491
+ var handleItemClick = function handleItemClick(item) {
31492
+ setSelectedItem(item);
31493
+ setHoveredItem(null);
31564
31494
  };
31565
- var handleMonsterClick = function handleMonsterClick(monster) {
31566
- setSelectedMonster(monster);
31567
- setTooltipData(null);
31495
+ var handleSearchChange = function handleSearchChange(newQuery) {
31496
+ setSearchQuery(newQuery);
31497
+ if (newQuery && selectedItemCategory !== 'all') {
31498
+ setSelectedItemCategory('all');
31499
+ }
31568
31500
  };
31569
31501
  var renderItem = function renderItem(item) {
31570
31502
  return React.createElement(InformationCenterCell, {
31571
- key: item.id,
31503
+ key: item.key,
31572
31504
  name: item.name,
31573
- spriteKey: item.key,
31574
- atlasJSON: entitiesAtlasJSON,
31575
- atlasIMG: entitiesAtlasIMG,
31576
- onClick: function onClick() {
31577
- return handleMonsterClick(item);
31578
- },
31505
+ spriteKey: item.texturePath,
31506
+ atlasJSON: itemsAtlasJSON,
31507
+ atlasIMG: itemsAtlasIMG,
31579
31508
  onMouseEnter: function onMouseEnter(e) {
31580
- return handleMouseEnter(item, e);
31509
+ return handleMouseEnter(e, item);
31581
31510
  },
31582
- onMouseLeave: handleMouseLeave,
31583
31511
  onMouseMove: handleMouseMove,
31512
+ onMouseLeave: handleMouseLeave,
31584
31513
  onTouchStart: function onTouchStart(e) {
31585
- return handleTouchStart(item, e);
31514
+ return handleTouchStart(e, item);
31515
+ },
31516
+ onClick: function onClick() {
31517
+ return handleItemClick(item);
31586
31518
  }
31587
31519
  });
31588
31520
  };
31589
- var filteredItems = bestiaryItems.filter(function (item) {
31590
- return item.name.toLowerCase().includes(searchQuery.toLowerCase());
31591
- });
31592
31521
  return React.createElement(React.Fragment, null, React.createElement(PaginatedContent, {
31593
31522
  items: filteredItems,
31594
31523
  renderItem: renderItem,
31595
- emptyMessage: "No monsters found",
31596
- tabId: tabId,
31597
- layout: "grid",
31524
+ emptyMessage: "No items found",
31525
+ filterOptions: {
31526
+ options: itemCategoryOptions,
31527
+ selectedOption: selectedItemCategory,
31528
+ onOptionChange: setSelectedItemCategory
31529
+ },
31598
31530
  searchOptions: {
31599
31531
  value: searchQuery,
31600
- onChange: setSearchQuery,
31601
- placeholder: 'Search monsters...'
31532
+ onChange: handleSearchChange,
31533
+ placeholder: 'Search items...'
31602
31534
  },
31535
+ dependencies: [selectedItemCategory],
31536
+ tabId: tabId,
31537
+ layout: "grid",
31603
31538
  itemHeight: "180px"
31604
- }), tooltipData && React.createElement(Portal, null, React.createElement(TooltipWrapper, {
31539
+ }), hoveredItem && React.createElement(TooltipWrapper, {
31605
31540
  style: {
31606
- position: 'fixed',
31607
- left: tooltipData.position.x + 10,
31608
- top: tooltipData.position.y + 10
31541
+ top: tooltipPosition.y,
31542
+ left: tooltipPosition.x
31609
31543
  }
31610
- }, React.createElement(InformationCenterNPCTooltip, {
31611
- npc: tooltipData.npc,
31612
- itemsAtlasJSON: itemsAtlasJSON,
31613
- itemsAtlasIMG: itemsAtlasIMG
31614
- }))), selectedMonster && React.createElement(InformationCenterNPCDetails, {
31615
- npc: selectedMonster,
31544
+ }, React.createElement(InformationCenterItemTooltip, {
31545
+ item: hoveredItem
31546
+ })), selectedItem && React.createElement(InformationCenterItemDetails, {
31547
+ item: selectedItem,
31616
31548
  itemsAtlasJSON: itemsAtlasJSON,
31617
31549
  itemsAtlasIMG: itemsAtlasIMG,
31618
- entitiesAtlasJSON: entitiesAtlasJSON,
31619
- entitiesAtlasIMG: entitiesAtlasIMG,
31550
+ droppedBy: getDroppedByNPCs(selectedItem.key, bestiaryItems),
31620
31551
  onBack: function onBack() {
31621
- return setSelectedMonster(null);
31552
+ return setSelectedItem(null);
31622
31553
  }
31623
31554
  }));
31624
31555
  };
31625
31556
  var TooltipWrapper = /*#__PURE__*/styled.div.withConfig({
31626
- displayName: "InformationCenterBestiarySection__TooltipWrapper",
31627
- componentId: "sc-e3h0p2-0"
31628
- })(["position:fixed;z-index:1000;pointer-events:none;width:300px;"]);
31557
+ displayName: "InformationCenterItemsSection__TooltipWrapper",
31558
+ componentId: "sc-1wmpapt-0"
31559
+ })(["position:fixed;z-index:1000;pointer-events:none;transition:transform 0.1s ease;"]);
31629
31560
 
31630
- var InformationCenterFAQSection = function InformationCenterFAQSection(_ref) {
31631
- var faqItems = _ref.faqItems,
31632
- initialSearchQuery = _ref.initialSearchQuery,
31633
- tabId = _ref.tabId;
31634
- var _useState = useState(initialSearchQuery),
31635
- searchQuery = _useState[0],
31636
- setSearchQuery = _useState[1];
31637
- useEffect(function () {
31638
- setSearchQuery(initialSearchQuery);
31639
- }, [initialSearchQuery]);
31640
- var filteredFaqs = useMemo(function () {
31641
- if (!searchQuery) return faqItems;
31642
- return faqItems.filter(function (faq) {
31643
- return faq.question.toLowerCase().includes(searchQuery.toLowerCase()) || faq.answer.toLowerCase().includes(searchQuery.toLowerCase());
31644
- });
31645
- }, [searchQuery, faqItems]);
31646
- var renderItem = function renderItem(item) {
31647
- return React.createElement(StyledCollapsible$1, {
31648
- title: item.question
31649
- }, React.createElement(Answer$1, null, item.answer));
31650
- };
31651
- return React.createElement(Container$q, null, React.createElement(SearchHeader, {
31652
- searchOptions: {
31653
- value: searchQuery,
31654
- onChange: setSearchQuery,
31655
- placeholder: 'Search FAQs...'
31656
- }
31657
- }), React.createElement(PaginatedContent, {
31658
- items: filteredFaqs,
31659
- renderItem: renderItem,
31660
- emptyMessage: "No FAQ items found",
31661
- tabId: tabId,
31662
- layout: "list",
31663
- itemsPerPage: 10
31664
- }));
31561
+ var ITEMS_PER_PAGE$1 = 5;
31562
+ var formatItemName = function formatItemName(itemPath) {
31563
+ var _itemPath$split$pop;
31564
+ var cleanText = ((_itemPath$split$pop = itemPath.split('/').pop()) == null ? void 0 : _itemPath$split$pop.split('.').shift()) || '';
31565
+ return cleanText.split('-').map(function (word) {
31566
+ return word.charAt(0).toUpperCase() + word.slice(1);
31567
+ }).join(' ');
31665
31568
  };
31666
- var Container$q = /*#__PURE__*/styled.div.withConfig({
31667
- displayName: "InformationCenterFaqSection__Container",
31668
- componentId: "sc-ofmaa9-0"
31669
- })(["display:flex;flex-direction:column;gap:1rem;width:100%;"]);
31670
- var StyledCollapsible$1 = /*#__PURE__*/styled(Collapsible).withConfig({
31671
- displayName: "InformationCenterFaqSection__StyledCollapsible",
31672
- componentId: "sc-ofmaa9-1"
31673
- })(["margin-bottom:0.5rem;&:last-child{margin-bottom:0;}"]);
31674
- var Answer$1 = /*#__PURE__*/styled.p.withConfig({
31675
- displayName: "InformationCenterFaqSection__Answer",
31676
- componentId: "sc-ofmaa9-2"
31677
- })(["font-size:0.9rem;color:#ffffff;margin:0;line-height:1.5;"]);
31678
-
31679
- var InformationCenterItemDetails = function InformationCenterItemDetails(_ref) {
31680
- var item = _ref.item,
31569
+ var InformationCenterNPCDetails = function InformationCenterNPCDetails(_ref) {
31570
+ var _npc$loots, _npc$skills$strength, _npc$skills$dexterity, _npc$skills$resistanc;
31571
+ var npc = _ref.npc,
31681
31572
  itemsAtlasJSON = _ref.itemsAtlasJSON,
31682
31573
  itemsAtlasIMG = _ref.itemsAtlasIMG,
31683
- droppedBy = _ref.droppedBy,
31574
+ entitiesAtlasJSON = _ref.entitiesAtlasJSON,
31575
+ entitiesAtlasIMG = _ref.entitiesAtlasIMG,
31576
+ iconAtlasIMG = _ref.iconAtlasIMG,
31577
+ iconAtlasJSON = _ref.iconAtlasJSON,
31684
31578
  onBack = _ref.onBack;
31685
31579
  var isMobile = isMobileOrTablet();
31686
- var renderAllowedSlots = function renderAllowedSlots() {
31687
- var _item$allowedEquipSlo;
31688
- if (!((_item$allowedEquipSlo = item.allowedEquipSlotType) != null && _item$allowedEquipSlo.length)) return null;
31689
- return React.createElement(InfoItem$1, null, React.createElement(Label$1, null, "Equip Slots:"), React.createElement(Value$1, null, item.allowedEquipSlotType.join(', ')));
31580
+ var _useState = useState(''),
31581
+ lootSearchQuery = _useState[0],
31582
+ setLootSearchQuery = _useState[1];
31583
+ var _useState2 = useState(1),
31584
+ currentLootPage = _useState2[0],
31585
+ setCurrentLootPage = _useState2[1];
31586
+ var formatText = function formatText(text) {
31587
+ if (typeof text === 'number') {
31588
+ return text.toString();
31589
+ }
31590
+ return text.toString().replace(/([A-Z])/g, ' $1').trim().replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2').replace(/\s+/g, ' ').replace(/^\w/, function (c) {
31591
+ return c.toUpperCase();
31592
+ });
31690
31593
  };
31691
- var renderRequirements = function renderRequirements() {
31692
- if (!item.minRequirements) return null;
31693
- return React.createElement(StyledCollapsible$2, {
31694
- title: "Requirements",
31695
- defaultOpen: !isMobile
31696
- }, React.createElement(RequirementsGrid, null, item.minRequirements.level && React.createElement(RequirementItem, null, React.createElement(Label$1, null, "Level:"), React.createElement(Value$1, null, item.minRequirements.level)), item.minRequirements.skill && React.createElement(RequirementItem, null, React.createElement(Label$1, null, item.minRequirements.skill.name, ":"), React.createElement(Value$1, null, item.minRequirements.skill.level))));
31594
+ var formatRarity = function formatRarity(rarity) {
31595
+ switch (rarity) {
31596
+ case 0.5:
31597
+ return 'Very Rare';
31598
+ case 1:
31599
+ return 'Rare';
31600
+ case 10:
31601
+ return 'Uncommon';
31602
+ case 15:
31603
+ return 'Semi Common';
31604
+ case 20:
31605
+ return 'Common';
31606
+ case 35:
31607
+ return 'Very Common';
31608
+ default:
31609
+ return 'Unknown';
31610
+ }
31697
31611
  };
31612
+ var filteredLoots = ((_npc$loots = npc.loots) == null ? void 0 : _npc$loots.filter(function (loot) {
31613
+ return formatItemName(loot.itemBlueprintKey).toLowerCase().includes(lootSearchQuery.toLowerCase());
31614
+ })) || [];
31615
+ var totalLootPages = Math.ceil(filteredLoots.length / ITEMS_PER_PAGE$1);
31616
+ var paginatedLoots = filteredLoots.slice((currentLootPage - 1) * ITEMS_PER_PAGE$1, currentLootPage * ITEMS_PER_PAGE$1);
31698
31617
  return React.createElement(BaseInformationDetails, {
31699
- name: item.name,
31700
- spriteKey: item.texturePath,
31701
- atlasJSON: itemsAtlasJSON,
31702
- atlasIMG: itemsAtlasIMG,
31618
+ name: npc.name,
31619
+ spriteKey: npc.key,
31620
+ atlasJSON: entitiesAtlasJSON,
31621
+ atlasIMG: entitiesAtlasIMG,
31703
31622
  onBack: onBack
31704
- }, React.createElement(InfoSection$1, null, React.createElement(InfoItem$1, null, React.createElement(Label$1, null, "Type:"), React.createElement(Value$1, null, item.type)), React.createElement(InfoItem$1, null, React.createElement(Label$1, null, "Subtype:"), React.createElement(Value$1, null, item.subType)), React.createElement(InfoItem$1, null, React.createElement(Label$1, null, "Tier:"), React.createElement(Value$1, null, item.tier)), React.createElement(InfoItem$1, null, React.createElement(Label$1, null, "Rarity:"), React.createElement(Value$1, null, item.rarity)), renderAllowedSlots()), React.createElement(StyledCollapsible$2, {
31705
- title: "Description",
31706
- defaultOpen: !isMobile
31707
- }, React.createElement(Description$2, null, item.description || 'No description available.')), React.createElement(StyledCollapsible$2, {
31623
+ }, React.createElement(InfoSection$1, null, React.createElement(InfoItem$1, null, React.createElement(Label$1, null, "Type:"), React.createElement(Value$1, null, formatText(npc.subType))), React.createElement(InfoItem$1, null, React.createElement(Label$1, null, "Alignment:"), React.createElement(Value$1, null, formatText(npc.alignment))), React.createElement(InfoItem$1, null, React.createElement(Label$1, null, "Attack Type:"), React.createElement(Value$1, null, formatText(npc.attackType))), React.createElement(InfoItem$1, null, React.createElement(Label$1, null, "Range:"), React.createElement(Value$1, null, formatText(npc.maxRangeAttack))), React.createElement(InfoItem$1, null, React.createElement(Label$1, null, "Speed:"), React.createElement(Value$1, null, formatText(npc.speed)))), React.createElement(StyledCollapsible$1, {
31708
31624
  title: "Stats",
31709
31625
  defaultOpen: !isMobile
31710
- }, React.createElement(StatGrid$1, null, React.createElement(StatItem$2, null, "Weight: ", item.weight), React.createElement(StatItem$2, null, "Stack Size: ", item.maxStackSize), item.rangeType && React.createElement(StatItem$2, null, "Range Type: ", item.rangeType), item.basePrice > 0 && React.createElement(StatItem$2, null, "Base Price: ", item.basePrice))), renderRequirements(), item.entityEffects && item.entityEffects.length > 0 && React.createElement(StyledCollapsible$2, {
31711
- title: "Effects",
31626
+ }, React.createElement(StatGrid$1, null, React.createElement(StatItem$2, null, "HP: ", npc.baseHealth), React.createElement(StatItem$2, null, "Level: ", npc.skills.level), ((_npc$skills$strength = npc.skills.strength) == null ? void 0 : _npc$skills$strength.level) && React.createElement(StatItem$2, null, "Strength: ", npc.skills.strength.level), ((_npc$skills$dexterity = npc.skills.dexterity) == null ? void 0 : _npc$skills$dexterity.level) && React.createElement(StatItem$2, null, "Dexterity: ", npc.skills.dexterity.level), ((_npc$skills$resistanc = npc.skills.resistance) == null ? void 0 : _npc$skills$resistanc.level) && React.createElement(StatItem$2, null, "Resistance: ", npc.skills.resistance.level))), npc.loots && npc.loots.length > 0 && React.createElement(StyledCollapsible$1, {
31627
+ title: "Loot",
31712
31628
  defaultOpen: !isMobile
31713
- }, React.createElement(EffectsList$2, null, item.entityEffects.map(function (effect, index) {
31714
- return React.createElement(EffectItem$2, {
31629
+ }, React.createElement(LootSearchContainer, null, React.createElement(StyledSearchBar$1, {
31630
+ value: lootSearchQuery,
31631
+ onChange: setLootSearchQuery,
31632
+ placeholder: "Search loot..."
31633
+ })), React.createElement(LootGrid, null, paginatedLoots.map(function (loot, index) {
31634
+ return React.createElement(LootItem, {
31715
31635
  key: index
31716
- }, effect, item.entityEffectChance && React.createElement(EffectChance, null, "(", item.entityEffectChance, "%)"));
31717
- })), item.usableEffectDescription && React.createElement(EffectDescription, null, item.usableEffectDescription)), item.equippedBuff && item.equippedBuff.length > 0 && React.createElement(StyledCollapsible$2, {
31718
- title: "Equipped Buffs",
31636
+ }, React.createElement(SpriteFromAtlas, {
31637
+ atlasJSON: itemsAtlasJSON,
31638
+ atlasIMG: itemsAtlasIMG,
31639
+ spriteKey: loot.itemBlueprintKey,
31640
+ width: 24,
31641
+ height: 24,
31642
+ imgScale: 1
31643
+ }), React.createElement(LootDetails, null, React.createElement(LootName, null, formatItemName(loot.itemBlueprintKey)), React.createElement(LootInfo, null, React.createElement(LootChance, null, formatRarity(loot.chance)), loot.quantityRange && React.createElement(LootQuantity, null, "x", loot.quantityRange[0], "-", loot.quantityRange[1]))));
31644
+ })), filteredLoots.length > ITEMS_PER_PAGE$1 && React.createElement(PaginationContainer$2, null, React.createElement(StyledPagination, {
31645
+ currentPage: currentLootPage,
31646
+ totalPages: totalLootPages,
31647
+ onPageChange: setCurrentLootPage
31648
+ }))), npc.entityEffects && npc.entityEffects.length > 0 && React.createElement(StyledCollapsible$1, {
31649
+ title: "Effects",
31719
31650
  defaultOpen: !isMobile
31720
- }, React.createElement(BuffsList, null, item.equippedBuff.map(function (buff, index) {
31721
- return React.createElement(BuffItem, {
31651
+ }, React.createElement(EffectsList$1, null, npc.entityEffects.map(function (effect, index) {
31652
+ return React.createElement(EffectItem$1, {
31722
31653
  key: index
31723
- }, React.createElement(BuffName, null, buff.trait), React.createElement(BuffValue, null, "+", buff.buffPercentage, "%"));
31724
- })), item.equippedBuffDescription && React.createElement(BuffDescription, null, item.equippedBuffDescription)), droppedBy.length > 0 && React.createElement(StyledCollapsible$2, {
31725
- title: "Dropped By",
31654
+ }, formatText(effect));
31655
+ }))), npc.areaSpells && npc.areaSpells.length > 0 && React.createElement(StyledCollapsible$1, {
31656
+ title: "Spells",
31726
31657
  defaultOpen: !isMobile
31727
- }, React.createElement(DropList, null, droppedBy.map(function (npc) {
31728
- var loot = npc.loots.find(function (l) {
31729
- return l.itemBlueprintKey === item.key;
31730
- });
31731
- return React.createElement(DropItem, {
31732
- key: npc.id
31733
- }, React.createElement(NPCName, null, npc.name), React.createElement(DropRate, null, loot == null ? void 0 : loot.chance, "%"));
31658
+ }, React.createElement(SpellsList, null, npc.areaSpells.map(function (spell, index) {
31659
+ return React.createElement(SpellItem, {
31660
+ key: index
31661
+ }, React.createElement(SpellIconContainer, null, React.createElement(SpriteFromAtlas, {
31662
+ atlasJSON: iconAtlasJSON,
31663
+ atlasIMG: iconAtlasIMG,
31664
+ spriteKey: spell.texturePath || spell.spellKey,
31665
+ width: 24,
31666
+ height: 24,
31667
+ imgScale: 1
31668
+ })), React.createElement(SpellContent, null, React.createElement(SpellName, null, formatText(spell.spellKey)), React.createElement(SpellDetails, null, "Power: ", React.createElement(SpellValue, null, formatText(spell.power)), React.createElement(Separator, null, "\u2022"), "Chance: ", React.createElement(SpellValue, null, spell.probability, "%"))));
31734
31669
  }))));
31735
31670
  };
31736
31671
  var InfoSection$1 = /*#__PURE__*/styled.div.withConfig({
31737
- displayName: "InformationCenterItemDetails__InfoSection",
31738
- componentId: "sc-zwf6pb-0"
31672
+ displayName: "InformationCenterNPCDetails__InfoSection",
31673
+ componentId: "sc-fdu3xl-0"
31739
31674
  })(["display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:8px;background:rgba(255,255,255,0.05);padding:12px;border-radius:4px;"]);
31740
31675
  var InfoItem$1 = /*#__PURE__*/styled.div.withConfig({
31741
- displayName: "InformationCenterItemDetails__InfoItem",
31742
- componentId: "sc-zwf6pb-1"
31676
+ displayName: "InformationCenterNPCDetails__InfoItem",
31677
+ componentId: "sc-fdu3xl-1"
31743
31678
  })(["display:flex;align-items:center;gap:8px;"]);
31744
31679
  var Label$1 = /*#__PURE__*/styled.span.withConfig({
31745
- displayName: "InformationCenterItemDetails__Label",
31746
- componentId: "sc-zwf6pb-2"
31680
+ displayName: "InformationCenterNPCDetails__Label",
31681
+ componentId: "sc-fdu3xl-2"
31747
31682
  })(["color:", ";font-size:0.5rem;opacity:0.8;"], uiColors.yellow);
31748
31683
  var Value$1 = /*#__PURE__*/styled.span.withConfig({
31749
- displayName: "InformationCenterItemDetails__Value",
31750
- componentId: "sc-zwf6pb-3"
31684
+ displayName: "InformationCenterNPCDetails__Value",
31685
+ componentId: "sc-fdu3xl-3"
31751
31686
  })(["color:", ";font-size:0.5rem;"], uiColors.white);
31752
- var StyledCollapsible$2 = /*#__PURE__*/styled(Collapsible).withConfig({
31753
- displayName: "InformationCenterItemDetails__StyledCollapsible",
31754
- componentId: "sc-zwf6pb-4"
31687
+ var StyledCollapsible$1 = /*#__PURE__*/styled(Collapsible).withConfig({
31688
+ displayName: "InformationCenterNPCDetails__StyledCollapsible",
31689
+ componentId: "sc-fdu3xl-4"
31755
31690
  })(["background:rgba(255,255,255,0.05);border-radius:4px;overflow:hidden;"]);
31756
- var Description$2 = /*#__PURE__*/styled.p.withConfig({
31757
- displayName: "InformationCenterItemDetails__Description",
31758
- componentId: "sc-zwf6pb-5"
31759
- })(["color:", ";font-size:0.5rem;margin:0;padding:12px;line-height:1.5;"], uiColors.white);
31760
31691
  var StatGrid$1 = /*#__PURE__*/styled.div.withConfig({
31761
- displayName: "InformationCenterItemDetails__StatGrid",
31762
- componentId: "sc-zwf6pb-6"
31692
+ displayName: "InformationCenterNPCDetails__StatGrid",
31693
+ componentId: "sc-fdu3xl-5"
31763
31694
  })(["display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px;padding:12px;"]);
31764
31695
  var StatItem$2 = /*#__PURE__*/styled.div.withConfig({
31765
- displayName: "InformationCenterItemDetails__StatItem",
31766
- componentId: "sc-zwf6pb-7"
31696
+ displayName: "InformationCenterNPCDetails__StatItem",
31697
+ componentId: "sc-fdu3xl-6"
31767
31698
  })(["color:", ";font-size:0.5rem;background:rgba(255,255,255,0.05);padding:8px;border-radius:4px;"], uiColors.white);
31768
- var EffectsList$2 = /*#__PURE__*/styled.div.withConfig({
31769
- displayName: "InformationCenterItemDetails__EffectsList",
31770
- componentId: "sc-zwf6pb-8"
31699
+ var EffectsList$1 = /*#__PURE__*/styled.div.withConfig({
31700
+ displayName: "InformationCenterNPCDetails__EffectsList",
31701
+ componentId: "sc-fdu3xl-7"
31771
31702
  })(["display:flex;flex-wrap:wrap;gap:8px;padding:12px;"]);
31772
- var EffectItem$2 = /*#__PURE__*/styled.div.withConfig({
31773
- displayName: "InformationCenterItemDetails__EffectItem",
31774
- componentId: "sc-zwf6pb-9"
31775
- })(["display:flex;align-items:center;gap:4px;color:", ";font-size:0.5rem;background:rgba(255,255,255,0.1);padding:4px 8px;border-radius:4px;"], uiColors.white);
31776
- var EffectChance = /*#__PURE__*/styled.span.withConfig({
31777
- displayName: "InformationCenterItemDetails__EffectChance",
31778
- componentId: "sc-zwf6pb-10"
31779
- })(["color:", ";opacity:0.8;"], uiColors.yellow);
31780
- var BuffsList = /*#__PURE__*/styled.div.withConfig({
31781
- displayName: "InformationCenterItemDetails__BuffsList",
31782
- componentId: "sc-zwf6pb-11"
31703
+ var EffectItem$1 = /*#__PURE__*/styled.div.withConfig({
31704
+ displayName: "InformationCenterNPCDetails__EffectItem",
31705
+ componentId: "sc-fdu3xl-8"
31706
+ })(["color:", ";font-size:0.5rem;background:rgba(255,255,255,0.1);padding:4px 8px;border-radius:4px;"], uiColors.white);
31707
+ var SpellsList = /*#__PURE__*/styled.div.withConfig({
31708
+ displayName: "InformationCenterNPCDetails__SpellsList",
31709
+ componentId: "sc-fdu3xl-9"
31783
31710
  })(["display:flex;flex-direction:column;gap:8px;padding:12px;"]);
31784
- var BuffItem = /*#__PURE__*/styled.div.withConfig({
31785
- displayName: "InformationCenterItemDetails__BuffItem",
31786
- componentId: "sc-zwf6pb-12"
31787
- })(["display:flex;justify-content:space-between;align-items:center;background:rgba(255,255,255,0.05);padding:8px;border-radius:4px;"]);
31788
- var BuffName = /*#__PURE__*/styled.span.withConfig({
31789
- displayName: "InformationCenterItemDetails__BuffName",
31790
- componentId: "sc-zwf6pb-13"
31791
- })(["color:", ";font-size:0.5rem;"], uiColors.white);
31792
- var BuffValue = /*#__PURE__*/styled.span.withConfig({
31793
- displayName: "InformationCenterItemDetails__BuffValue",
31794
- componentId: "sc-zwf6pb-14"
31795
- })(["color:", ";font-size:0.5rem;"], uiColors.yellow);
31796
- var BuffDescription = /*#__PURE__*/styled.p.withConfig({
31797
- displayName: "InformationCenterItemDetails__BuffDescription",
31798
- componentId: "sc-zwf6pb-15"
31799
- })(["color:", ";font-size:0.45rem;margin:0;padding:0 12px 12px;font-style:italic;"], uiColors.lightGray);
31800
- var DropList = /*#__PURE__*/styled.div.withConfig({
31801
- displayName: "InformationCenterItemDetails__DropList",
31802
- componentId: "sc-zwf6pb-16"
31803
- })(["display:flex;flex-direction:column;gap:0.5rem;padding:12px;"]);
31804
- var DropItem = /*#__PURE__*/styled.div.withConfig({
31805
- displayName: "InformationCenterItemDetails__DropItem",
31806
- componentId: "sc-zwf6pb-17"
31807
- })(["display:flex;justify-content:space-between;align-items:center;padding:0.5rem;background:rgba(255,255,255,0.05);border-radius:4px;"]);
31808
- var NPCName = /*#__PURE__*/styled.span.withConfig({
31809
- displayName: "InformationCenterItemDetails__NPCName",
31810
- componentId: "sc-zwf6pb-18"
31811
- })(["color:", ";font-size:0.5rem;"], uiColors.white);
31812
- var DropRate = /*#__PURE__*/styled.span.withConfig({
31813
- displayName: "InformationCenterItemDetails__DropRate",
31814
- componentId: "sc-zwf6pb-19"
31711
+ var SpellIconContainer = /*#__PURE__*/styled.div.withConfig({
31712
+ displayName: "InformationCenterNPCDetails__SpellIconContainer",
31713
+ componentId: "sc-fdu3xl-10"
31714
+ })(["display:flex;padding-right:30px;padding-bottom:30px;"]);
31715
+ var SpellContent = /*#__PURE__*/styled.div.withConfig({
31716
+ displayName: "InformationCenterNPCDetails__SpellContent",
31717
+ componentId: "sc-fdu3xl-11"
31718
+ })(["display:flex;flex-direction:column;gap:4px;flex:1;"]);
31719
+ var SpellItem = /*#__PURE__*/styled.div.withConfig({
31720
+ displayName: "InformationCenterNPCDetails__SpellItem",
31721
+ componentId: "sc-fdu3xl-12"
31722
+ })(["display:flex;gap:8px;background:rgba(255,255,255,0.05);padding:8px;padding-left:10px;border-radius:4px;align-items:center;"]);
31723
+ var SpellName = /*#__PURE__*/styled.div.withConfig({
31724
+ displayName: "InformationCenterNPCDetails__SpellName",
31725
+ componentId: "sc-fdu3xl-13"
31815
31726
  })(["color:", ";font-size:0.5rem;"], uiColors.yellow);
31816
- var RequirementsGrid = /*#__PURE__*/styled.div.withConfig({
31817
- displayName: "InformationCenterItemDetails__RequirementsGrid",
31818
- componentId: "sc-zwf6pb-20"
31819
- })(["display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px;padding:12px;"]);
31820
- var RequirementItem = /*#__PURE__*/styled.div.withConfig({
31821
- displayName: "InformationCenterItemDetails__RequirementItem",
31822
- componentId: "sc-zwf6pb-21"
31727
+ var SpellDetails = /*#__PURE__*/styled.div.withConfig({
31728
+ displayName: "InformationCenterNPCDetails__SpellDetails",
31729
+ componentId: "sc-fdu3xl-14"
31730
+ })(["display:flex;align-items:center;gap:8px;color:", ";font-size:0.45rem;opacity:0.8;"], uiColors.white);
31731
+ var SpellValue = /*#__PURE__*/styled.span.withConfig({
31732
+ displayName: "InformationCenterNPCDetails__SpellValue",
31733
+ componentId: "sc-fdu3xl-15"
31734
+ })(["color:", ";"], uiColors.yellow);
31735
+ var Separator = /*#__PURE__*/styled.span.withConfig({
31736
+ displayName: "InformationCenterNPCDetails__Separator",
31737
+ componentId: "sc-fdu3xl-16"
31738
+ })(["color:", ";opacity:0.5;"], uiColors.yellow);
31739
+ var LootSearchContainer = /*#__PURE__*/styled.div.withConfig({
31740
+ displayName: "InformationCenterNPCDetails__LootSearchContainer",
31741
+ componentId: "sc-fdu3xl-17"
31742
+ })(["padding:12px 12px 0;"]);
31743
+ var StyledSearchBar$1 = /*#__PURE__*/styled(SearchBar).withConfig({
31744
+ displayName: "InformationCenterNPCDetails__StyledSearchBar",
31745
+ componentId: "sc-fdu3xl-18"
31746
+ })(["width:100%;"]);
31747
+ var LootGrid = /*#__PURE__*/styled.div.withConfig({
31748
+ displayName: "InformationCenterNPCDetails__LootGrid",
31749
+ componentId: "sc-fdu3xl-19"
31750
+ })(["display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:8px;padding:12px;"]);
31751
+ var LootItem = /*#__PURE__*/styled.div.withConfig({
31752
+ displayName: "InformationCenterNPCDetails__LootItem",
31753
+ componentId: "sc-fdu3xl-20"
31823
31754
  })(["display:flex;align-items:center;gap:8px;background:rgba(255,255,255,0.05);padding:8px;border-radius:4px;"]);
31824
- var EffectDescription = /*#__PURE__*/styled.p.withConfig({
31825
- displayName: "InformationCenterItemDetails__EffectDescription",
31826
- componentId: "sc-zwf6pb-22"
31827
- })(["color:", ";font-size:0.45rem;margin:8px 0 0;padding:0 12px;font-style:italic;"], uiColors.lightGray);
31828
-
31829
- var ItemHeader$1 = /*#__PURE__*/styled.div.withConfig({
31830
- displayName: "InformationCenterItemTooltip__ItemHeader",
31831
- componentId: "sc-1ecf9mj-0"
31755
+ var LootDetails = /*#__PURE__*/styled.div.withConfig({
31756
+ displayName: "InformationCenterNPCDetails__LootDetails",
31757
+ componentId: "sc-fdu3xl-21"
31758
+ })(["flex:1;display:flex;flex-direction:column;gap:4px;"]);
31759
+ var LootName = /*#__PURE__*/styled.div.withConfig({
31760
+ displayName: "InformationCenterNPCDetails__LootName",
31761
+ componentId: "sc-fdu3xl-22"
31762
+ })(["color:", ";font-size:0.5rem;"], uiColors.white);
31763
+ var LootInfo = /*#__PURE__*/styled.div.withConfig({
31764
+ displayName: "InformationCenterNPCDetails__LootInfo",
31765
+ componentId: "sc-fdu3xl-23"
31832
31766
  })(["display:flex;align-items:center;gap:8px;"]);
31833
- var Description$3 = /*#__PURE__*/styled.div.withConfig({
31834
- displayName: "InformationCenterItemTooltip__Description",
31835
- componentId: "sc-1ecf9mj-1"
31836
- })(["color:", ";font-size:0.5rem;line-height:1.4;margin-top:8px;opacity:0.8;"], uiColors.white);
31837
- var RarityText = /*#__PURE__*/styled.span.withConfig({
31838
- displayName: "InformationCenterItemTooltip__RarityText",
31839
- componentId: "sc-1ecf9mj-2"
31840
- })(["color:", ";font-size:0.5rem;"], function (props) {
31841
- switch (props.rarity.toLowerCase()) {
31842
- case 'legendary':
31843
- return '#ff8c00';
31844
- case 'rare':
31845
- return '#0070dd';
31846
- case 'uncommon':
31847
- return '#1eff00';
31767
+ var LootChance = /*#__PURE__*/styled.span.withConfig({
31768
+ displayName: "InformationCenterNPCDetails__LootChance",
31769
+ componentId: "sc-fdu3xl-24"
31770
+ })(["color:", ";font-size:0.45rem;"], uiColors.yellow);
31771
+ var LootQuantity = /*#__PURE__*/styled.span.withConfig({
31772
+ displayName: "InformationCenterNPCDetails__LootQuantity",
31773
+ componentId: "sc-fdu3xl-25"
31774
+ })(["color:", ";font-size:0.45rem;"], uiColors.lightGray);
31775
+ var PaginationContainer$2 = /*#__PURE__*/styled.div.withConfig({
31776
+ displayName: "InformationCenterNPCDetails__PaginationContainer",
31777
+ componentId: "sc-fdu3xl-26"
31778
+ })(["display:flex;justify-content:center;padding:12px;"]);
31779
+ var StyledPagination = /*#__PURE__*/styled(Pagination).withConfig({
31780
+ displayName: "InformationCenterNPCDetails__StyledPagination",
31781
+ componentId: "sc-fdu3xl-27"
31782
+ })(["font-size:0.6rem;"]);
31783
+
31784
+ var EffectsList$2 = /*#__PURE__*/styled.div.withConfig({
31785
+ displayName: "InformationCenterNPCTooltip__EffectsList",
31786
+ componentId: "sc-j2o39s-0"
31787
+ })(["display:flex;gap:8px;flex-wrap:wrap;"]);
31788
+ var EffectItem$2 = /*#__PURE__*/styled.span.withConfig({
31789
+ displayName: "InformationCenterNPCTooltip__EffectItem",
31790
+ componentId: "sc-j2o39s-1"
31791
+ })(["font-size:0.5rem;color:", ";background:rgba(255,255,255,0.1);padding:2px 6px;border-radius:4px;"], uiColors.white);
31792
+ var SpellList = /*#__PURE__*/styled.div.withConfig({
31793
+ displayName: "InformationCenterNPCTooltip__SpellList",
31794
+ componentId: "sc-j2o39s-2"
31795
+ })(["display:flex;flex-direction:column;gap:2px;"]);
31796
+ var SpellItem$1 = /*#__PURE__*/styled.div.withConfig({
31797
+ displayName: "InformationCenterNPCTooltip__SpellItem",
31798
+ componentId: "sc-j2o39s-3"
31799
+ })(["display:flex;align-items:center;justify-content:space-between;font-size:0.5rem;color:", ";background:rgba(255,255,255,0.05);padding:2px 6px;border-radius:4px;"], uiColors.white);
31800
+ var SpellInfo = /*#__PURE__*/styled.span.withConfig({
31801
+ displayName: "InformationCenterNPCTooltip__SpellInfo",
31802
+ componentId: "sc-j2o39s-4"
31803
+ })(["color:", ";margin-left:8px;opacity:0.8;"], uiColors.yellow);
31804
+ var LootList = /*#__PURE__*/styled.div.withConfig({
31805
+ displayName: "InformationCenterNPCTooltip__LootList",
31806
+ componentId: "sc-j2o39s-5"
31807
+ })(["display:flex;flex-direction:column;gap:2px;"]);
31808
+ var LootItem$1 = /*#__PURE__*/styled.div.withConfig({
31809
+ displayName: "InformationCenterNPCTooltip__LootItem",
31810
+ componentId: "sc-j2o39s-6"
31811
+ })(["display:flex;align-items:center;gap:4px;font-size:0.5rem;background:rgba(255,255,255,0.05);padding:4px 6px;border-radius:4px;.sprite-from-atlas-img{top:0px;left:0px;}"]);
31812
+ var LootName$1 = /*#__PURE__*/styled.span.withConfig({
31813
+ displayName: "InformationCenterNPCTooltip__LootName",
31814
+ componentId: "sc-j2o39s-7"
31815
+ })(["color:", ";flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-left:4px;"], uiColors.white);
31816
+ var LootChance$1 = /*#__PURE__*/styled.span.withConfig({
31817
+ displayName: "InformationCenterNPCTooltip__LootChance",
31818
+ componentId: "sc-j2o39s-8"
31819
+ })(["color:", ";font-size:0.45rem;text-transform:lowercase;opacity:0.8;"], uiColors.yellow);
31820
+ var MoreIndicator = /*#__PURE__*/styled.div.withConfig({
31821
+ displayName: "InformationCenterNPCTooltip__MoreIndicator",
31822
+ componentId: "sc-j2o39s-9"
31823
+ })(["color:", ";font-size:0.45rem;text-align:center;margin-top:2px;opacity:0.7;"], uiColors.yellow);
31824
+ var formatText = function formatText(text) {
31825
+ if (typeof text === 'number') {
31826
+ return text.toString();
31827
+ }
31828
+ return text.toString().replace(/([A-Z])/g, ' $1').trim().replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2').replace(/\s+/g, ' ');
31829
+ };
31830
+ var formatRarity = function formatRarity(rarity) {
31831
+ switch (rarity) {
31832
+ case 0.5:
31833
+ return 'Very Rare';
31834
+ case 1:
31835
+ return 'Rare';
31836
+ case 10:
31837
+ return 'Uncommon';
31838
+ case 15:
31839
+ return 'Semi Common';
31840
+ case 20:
31841
+ return 'Common';
31842
+ case 35:
31843
+ return 'Very Common';
31848
31844
  default:
31849
- return '#ffffff';
31845
+ return 'Unknown';
31850
31846
  }
31851
- });
31852
- var InformationCenterItemTooltip = function InformationCenterItemTooltip(_ref) {
31853
- var item = _ref.item;
31854
- return React.createElement(BaseTooltip, null, React.createElement(ItemHeader$1, null, React.createElement(TooltipTitle$1, null, item.name)), React.createElement(Description$3, null, item.description), React.createElement(Section, null, React.createElement(SectionTitle, null, "Details"), React.createElement(StatsContainer, null, React.createElement(StatItem$1, null, "Type: ", item.type), React.createElement(StatItem$1, null, "Weight: ", item.weight), item.attack !== undefined && React.createElement(StatItem$1, null, "Attack: ", item.attack), item.defense !== undefined && React.createElement(StatItem$1, null, "Defense: ", item.defense), item.tier !== undefined && React.createElement(StatItem$1, null, "Tier: ", item.tier), item.rangeType && React.createElement(StatItem$1, null, "Range: ", item.rangeType))), React.createElement(Section, null, React.createElement(SectionTitle, null, "Market"), React.createElement(StatsContainer, null, React.createElement(StatItem$1, null, "Price: ", item.basePrice), item.rarity && React.createElement(StatItem$1, null, "Rarity:", ' ', React.createElement(RarityText, {
31855
- rarity: item.rarity
31856
- }, item.rarity)))));
31847
+ };
31848
+ var InformationCenterNPCTooltip = function InformationCenterNPCTooltip(_ref) {
31849
+ var _npc$skills$strength, _npc$skills$dexterity, _npc$skills$resistanc;
31850
+ var npc = _ref.npc,
31851
+ itemsAtlasJSON = _ref.itemsAtlasJSON,
31852
+ itemsAtlasIMG = _ref.itemsAtlasIMG;
31853
+ return React.createElement(BaseTooltip, null, React.createElement(TooltipTitle$1, null, npc.name), React.createElement(StatsContainer, null, React.createElement(StatItem$1, null, "HP: ", npc.baseHealth), React.createElement(StatItem$1, null, "LVL: ", npc.skills.level), React.createElement(StatItem$1, null, "STR: ", ((_npc$skills$strength = npc.skills.strength) == null ? void 0 : _npc$skills$strength.level) || '-'), React.createElement(StatItem$1, null, "DEX: ", ((_npc$skills$dexterity = npc.skills.dexterity) == null ? void 0 : _npc$skills$dexterity.level) || '-'), React.createElement(StatItem$1, null, "RES: ", ((_npc$skills$resistanc = npc.skills.resistance) == null ? void 0 : _npc$skills$resistanc.level) || '-'), React.createElement(StatItem$1, null, "SPD: ", formatText(npc.speed))), npc.entityEffects && npc.entityEffects.length > 0 && React.createElement(Section, null, React.createElement(SectionTitle, null, "Effects"), React.createElement(EffectsList$2, null, npc.entityEffects.map(function (effect) {
31854
+ return React.createElement(EffectItem$2, {
31855
+ key: effect
31856
+ }, formatText(effect));
31857
+ }))), npc.areaSpells && npc.areaSpells.length > 0 && React.createElement(Section, null, React.createElement(SectionTitle, null, "Spells"), React.createElement(SpellList, null, npc.areaSpells.map(function (spell) {
31858
+ return React.createElement(SpellItem$1, {
31859
+ key: spell.spellKey
31860
+ }, formatText(spell.spellKey), React.createElement(SpellInfo, null, formatText(spell.power), ", ", spell.probability, "%"));
31861
+ }))), npc.loots && npc.loots.length > 0 && React.createElement(Section, null, React.createElement(SectionTitle, null, "Possible Loot"), React.createElement(LootList, null, npc.loots.slice(0, 4).map(function (loot) {
31862
+ return React.createElement(LootItem$1, {
31863
+ key: loot.itemBlueprintKey
31864
+ }, React.createElement(SpriteFromAtlas, {
31865
+ atlasIMG: itemsAtlasIMG,
31866
+ atlasJSON: itemsAtlasJSON,
31867
+ spriteKey: loot.itemBlueprintKey,
31868
+ imgScale: 1
31869
+ }), React.createElement(LootName$1, null, formatItemName(loot.itemBlueprintKey)), React.createElement(LootChance$1, null, formatRarity(loot.chance)));
31870
+ }), npc.loots.length > 4 && React.createElement(MoreIndicator, null, "..."))));
31857
31871
  };
31858
31872
 
31859
- var TOOLTIP_OFFSET = 20;
31860
- var InformationCenterItemsSection = function InformationCenterItemsSection(_ref) {
31861
- var items = _ref.items,
31862
- bestiaryItems = _ref.bestiaryItems,
31873
+ var InformationCenterBestiarySection = function InformationCenterBestiarySection(_ref) {
31874
+ var bestiaryItems = _ref.bestiaryItems,
31863
31875
  itemsAtlasJSON = _ref.itemsAtlasJSON,
31864
31876
  itemsAtlasIMG = _ref.itemsAtlasIMG,
31877
+ iconsAtlasIMG = _ref.iconsAtlasIMG,
31878
+ iconsAtlasJSON = _ref.iconsAtlasJSON,
31879
+ entitiesAtlasJSON = _ref.entitiesAtlasJSON,
31880
+ entitiesAtlasIMG = _ref.entitiesAtlasIMG,
31865
31881
  initialSearchQuery = _ref.initialSearchQuery,
31866
31882
  tabId = _ref.tabId;
31867
31883
  var _useState = useState(initialSearchQuery),
31868
31884
  searchQuery = _useState[0],
31869
31885
  setSearchQuery = _useState[1];
31870
- var _useState2 = useState('all'),
31871
- selectedItemCategory = _useState2[0],
31872
- setSelectedItemCategory = _useState2[1];
31886
+ var _useState2 = useState(null),
31887
+ tooltipData = _useState2[0],
31888
+ setTooltipData = _useState2[1];
31873
31889
  var _useState3 = useState(null),
31874
- hoveredItem = _useState3[0],
31875
- setHoveredItem = _useState3[1];
31876
- var _useState4 = useState({
31877
- x: 0,
31878
- y: 0
31879
- }),
31880
- tooltipPosition = _useState4[0],
31881
- setTooltipPosition = _useState4[1];
31882
- var _useState5 = useState(null),
31883
- selectedItem = _useState5[0],
31884
- setSelectedItem = _useState5[1];
31885
- var itemCategoryOptions = [{
31886
- id: 0,
31887
- value: 'all',
31888
- option: 'All Items'
31889
- }, {
31890
- id: 1,
31891
- value: ItemType.Consumable,
31892
- option: 'Consumables'
31893
- }, {
31894
- id: 2,
31895
- value: ItemType.Weapon,
31896
- option: 'Weapons'
31897
- }, {
31898
- id: 3,
31899
- value: ItemType.Armor,
31900
- option: 'Armor'
31901
- }];
31902
- var filteredItems = items.filter(function (item) {
31903
- return (selectedItemCategory === 'all' || item.type === selectedItemCategory) && item.name.toLowerCase().includes(searchQuery.toLowerCase());
31904
- });
31905
- var getDroppedByNPCs = function getDroppedByNPCs(itemId, npcs) {
31906
- return npcs.filter(function (npc) {
31907
- var _npc$loots;
31908
- return (_npc$loots = npc.loots) == null ? void 0 : _npc$loots.some(function (loot) {
31909
- return loot.itemBlueprintKey === itemId;
31910
- });
31911
- }) || [];
31912
- };
31913
- var handleMouseEnter = function handleMouseEnter(e, item) {
31914
- setTooltipPosition({
31915
- x: e.clientX + TOOLTIP_OFFSET,
31916
- y: e.clientY
31917
- });
31918
- setHoveredItem(item);
31919
- };
31920
- var handleMouseMove = function handleMouseMove(e) {
31921
- if (hoveredItem) {
31922
- setTooltipPosition({
31923
- x: e.clientX + TOOLTIP_OFFSET,
31924
- y: e.clientY
31890
+ selectedMonster = _useState3[0],
31891
+ setSelectedMonster = _useState3[1];
31892
+ var _useState4 = useState('ontouchstart' in window),
31893
+ isTouchDevice = _useState4[0];
31894
+ var handleMouseEnter = function handleMouseEnter(monster, event) {
31895
+ if (!isTouchDevice && !selectedMonster) {
31896
+ setTooltipData({
31897
+ npc: monster,
31898
+ position: {
31899
+ x: event.clientX,
31900
+ y: event.clientY
31901
+ }
31925
31902
  });
31926
31903
  }
31927
31904
  };
31928
31905
  var handleMouseLeave = function handleMouseLeave() {
31929
- setHoveredItem(null);
31906
+ if (!isTouchDevice) {
31907
+ setTooltipData(null);
31908
+ }
31930
31909
  };
31931
- var handleTouchStart = function handleTouchStart(e, item) {
31932
- var touch = e.touches[0];
31933
- setTooltipPosition({
31934
- x: touch.clientX + TOOLTIP_OFFSET,
31935
- y: touch.clientY
31936
- });
31937
- setHoveredItem(item);
31910
+ var handleMouseMove = function handleMouseMove(event) {
31911
+ if (!isTouchDevice && tooltipData) {
31912
+ setTooltipData(_extends({}, tooltipData, {
31913
+ position: {
31914
+ x: event.clientX,
31915
+ y: event.clientY
31916
+ }
31917
+ }));
31918
+ }
31938
31919
  };
31939
- var handleItemClick = function handleItemClick(item) {
31940
- setSelectedItem(item);
31941
- setHoveredItem(null);
31920
+ var handleTouchStart = function handleTouchStart(monster, event) {
31921
+ if (isTouchDevice) {
31922
+ event.preventDefault();
31923
+ var touch = event.touches[0];
31924
+ if ((tooltipData == null ? void 0 : tooltipData.npc.id) === monster.id) {
31925
+ setTooltipData(null);
31926
+ } else {
31927
+ setTooltipData({
31928
+ npc: monster,
31929
+ position: {
31930
+ x: touch.clientX,
31931
+ y: touch.clientY
31932
+ }
31933
+ });
31934
+ }
31935
+ }
31936
+ };
31937
+ var handleMonsterClick = function handleMonsterClick(monster) {
31938
+ setSelectedMonster(monster);
31939
+ setTooltipData(null);
31942
31940
  };
31941
+ var _useState5 = useState('all'),
31942
+ selectedBestiaryCategory = _useState5[0],
31943
+ setSelectedBestiaryCategory = _useState5[1];
31944
+ var bestiaryCategoryOptions = [{
31945
+ id: 0,
31946
+ value: 'all',
31947
+ option: 'All Monsters'
31948
+ }, {
31949
+ id: 1,
31950
+ value: 'bosses',
31951
+ option: 'Bosses'
31952
+ }].concat(Object.entries(NPCAlignment).map(function (_ref2, index) {
31953
+ var value = _ref2[1];
31954
+ return {
31955
+ id: index + 1,
31956
+ value: value,
31957
+ option: formatItemType(value)
31958
+ };
31959
+ }));
31943
31960
  var renderItem = function renderItem(item) {
31944
31961
  return React.createElement(InformationCenterCell, {
31945
- key: item.key,
31962
+ key: item.id,
31946
31963
  name: item.name,
31947
- spriteKey: item.texturePath,
31948
- atlasJSON: itemsAtlasJSON,
31949
- atlasIMG: itemsAtlasIMG,
31964
+ spriteKey: item.key,
31965
+ atlasJSON: entitiesAtlasJSON,
31966
+ atlasIMG: entitiesAtlasIMG,
31967
+ onClick: function onClick() {
31968
+ return handleMonsterClick(item);
31969
+ },
31950
31970
  onMouseEnter: function onMouseEnter(e) {
31951
- return handleMouseEnter(e, item);
31971
+ return handleMouseEnter(item, e);
31952
31972
  },
31953
- onMouseMove: handleMouseMove,
31954
31973
  onMouseLeave: handleMouseLeave,
31974
+ onMouseMove: handleMouseMove,
31955
31975
  onTouchStart: function onTouchStart(e) {
31956
- return handleTouchStart(e, item);
31957
- },
31958
- onClick: function onClick() {
31959
- return handleItemClick(item);
31976
+ return handleTouchStart(item, e);
31960
31977
  }
31961
31978
  });
31962
31979
  };
31980
+ var filteredItems = useMemo(function () {
31981
+ return bestiaryItems.filter(function (item) {
31982
+ var matchesSearch = item.name.toLowerCase().includes(searchQuery.toLowerCase());
31983
+ var matchesCategory = true;
31984
+ if (selectedBestiaryCategory === 'bosses') {
31985
+ matchesCategory = item.isBoss === true;
31986
+ } else if (selectedBestiaryCategory === NPCAlignment.Hostile) {
31987
+ matchesCategory = item.alignment === NPCAlignment.Hostile && !item.isBoss;
31988
+ } else if (selectedBestiaryCategory !== 'all') {
31989
+ matchesCategory = item.alignment === selectedBestiaryCategory;
31990
+ }
31991
+ return matchesSearch && matchesCategory;
31992
+ });
31993
+ }, [bestiaryItems, searchQuery, selectedBestiaryCategory]);
31994
+ var handleSearchChange = function handleSearchChange(newQuery) {
31995
+ setSearchQuery(newQuery);
31996
+ if (newQuery && selectedBestiaryCategory !== 'all') {
31997
+ setSelectedBestiaryCategory('all');
31998
+ }
31999
+ };
31963
32000
  return React.createElement(React.Fragment, null, React.createElement(PaginatedContent, {
31964
32001
  items: filteredItems,
31965
32002
  renderItem: renderItem,
31966
- emptyMessage: "No items found",
32003
+ emptyMessage: "No monsters found",
32004
+ tabId: tabId,
32005
+ layout: "grid",
31967
32006
  filterOptions: {
31968
- options: itemCategoryOptions,
31969
- selectedOption: selectedItemCategory,
31970
- onOptionChange: setSelectedItemCategory
32007
+ options: bestiaryCategoryOptions,
32008
+ selectedOption: selectedBestiaryCategory,
32009
+ onOptionChange: setSelectedBestiaryCategory
31971
32010
  },
31972
32011
  searchOptions: {
31973
32012
  value: searchQuery,
31974
- onChange: setSearchQuery,
31975
- placeholder: 'Search items...'
32013
+ onChange: handleSearchChange,
32014
+ placeholder: 'Search monsters...'
31976
32015
  },
31977
- dependencies: [selectedItemCategory],
31978
- tabId: tabId,
31979
- layout: "grid",
32016
+ dependencies: [selectedBestiaryCategory],
31980
32017
  itemHeight: "180px"
31981
- }), hoveredItem && React.createElement(TooltipWrapper$1, {
32018
+ }), tooltipData && React.createElement(Portal, null, React.createElement(TooltipWrapper$1, {
31982
32019
  style: {
31983
- top: tooltipPosition.y,
31984
- left: tooltipPosition.x
32020
+ position: 'fixed',
32021
+ left: tooltipData.position.x + 10,
32022
+ top: tooltipData.position.y + 10
31985
32023
  }
31986
- }, React.createElement(InformationCenterItemTooltip, {
31987
- item: hoveredItem
31988
- })), selectedItem && React.createElement(InformationCenterItemDetails, {
31989
- item: selectedItem,
32024
+ }, React.createElement(InformationCenterNPCTooltip, {
32025
+ npc: tooltipData.npc,
32026
+ itemsAtlasJSON: itemsAtlasJSON,
32027
+ itemsAtlasIMG: itemsAtlasIMG
32028
+ }))), selectedMonster && React.createElement(InformationCenterNPCDetails, {
32029
+ npc: selectedMonster,
31990
32030
  itemsAtlasJSON: itemsAtlasJSON,
31991
32031
  itemsAtlasIMG: itemsAtlasIMG,
31992
- droppedBy: getDroppedByNPCs(selectedItem.key, bestiaryItems),
32032
+ iconAtlasIMG: iconsAtlasIMG,
32033
+ iconAtlasJSON: iconsAtlasJSON,
32034
+ entitiesAtlasJSON: entitiesAtlasJSON,
32035
+ entitiesAtlasIMG: entitiesAtlasIMG,
31993
32036
  onBack: function onBack() {
31994
- return setSelectedItem(null);
32037
+ return setSelectedMonster(null);
31995
32038
  }
31996
32039
  }));
31997
32040
  };
31998
32041
  var TooltipWrapper$1 = /*#__PURE__*/styled.div.withConfig({
31999
- displayName: "InformationCenterItemsSection__TooltipWrapper",
32000
- componentId: "sc-1wmpapt-0"
32001
- })(["position:fixed;z-index:1000;pointer-events:none;transition:transform 0.1s ease;"]);
32042
+ displayName: "InformationCenterBestiarySection__TooltipWrapper",
32043
+ componentId: "sc-e3h0p2-0"
32044
+ })(["position:fixed;z-index:1000;pointer-events:none;width:300px;"]);
32045
+
32046
+ var InformationCenterFAQSection = function InformationCenterFAQSection(_ref) {
32047
+ var faqItems = _ref.faqItems,
32048
+ initialSearchQuery = _ref.initialSearchQuery,
32049
+ tabId = _ref.tabId;
32050
+ var _useState = useState(initialSearchQuery),
32051
+ searchQuery = _useState[0],
32052
+ setSearchQuery = _useState[1];
32053
+ useEffect(function () {
32054
+ setSearchQuery(initialSearchQuery);
32055
+ }, [initialSearchQuery]);
32056
+ var filteredFaqs = useMemo(function () {
32057
+ if (!searchQuery) return faqItems;
32058
+ return faqItems.filter(function (faq) {
32059
+ return faq.question.toLowerCase().includes(searchQuery.toLowerCase()) || faq.answer.toLowerCase().includes(searchQuery.toLowerCase());
32060
+ });
32061
+ }, [searchQuery, faqItems]);
32062
+ var renderItem = function renderItem(item) {
32063
+ return React.createElement(StyledCollapsible$2, {
32064
+ title: item.question
32065
+ }, React.createElement(Answer$1, null, item.answer));
32066
+ };
32067
+ return React.createElement(Container$q, null, React.createElement(SearchHeader, {
32068
+ searchOptions: {
32069
+ value: searchQuery,
32070
+ onChange: setSearchQuery,
32071
+ placeholder: 'Search FAQs...'
32072
+ }
32073
+ }), React.createElement(PaginatedContent, {
32074
+ items: filteredFaqs,
32075
+ renderItem: renderItem,
32076
+ emptyMessage: "No FAQ items found",
32077
+ tabId: tabId,
32078
+ layout: "list",
32079
+ itemsPerPage: 10
32080
+ }));
32081
+ };
32082
+ var Container$q = /*#__PURE__*/styled.div.withConfig({
32083
+ displayName: "InformationCenterFaqSection__Container",
32084
+ componentId: "sc-ofmaa9-0"
32085
+ })(["display:flex;flex-direction:column;gap:1rem;width:100%;"]);
32086
+ var StyledCollapsible$2 = /*#__PURE__*/styled(Collapsible).withConfig({
32087
+ displayName: "InformationCenterFaqSection__StyledCollapsible",
32088
+ componentId: "sc-ofmaa9-1"
32089
+ })(["margin-bottom:0.5rem;&:last-child{margin-bottom:0;}"]);
32090
+ var Answer$1 = /*#__PURE__*/styled.p.withConfig({
32091
+ displayName: "InformationCenterFaqSection__Answer",
32092
+ componentId: "sc-ofmaa9-2"
32093
+ })(["font-size:0.9rem;color:#ffffff;margin:0;line-height:1.5;"]);
32002
32094
 
32095
+ var ITEMS_PER_PAGE$2 = 3;
32096
+ var GRID_COLUMNS = 3;
32003
32097
  var InformationCenterTutorialsSection = function InformationCenterTutorialsSection(_ref) {
32004
32098
  var videoGuides = _ref.videoGuides,
32005
32099
  initialSearchQuery = _ref.initialSearchQuery,
@@ -32010,90 +32104,127 @@ var InformationCenterTutorialsSection = function InformationCenterTutorialsSecti
32010
32104
  var _useState2 = useState('all'),
32011
32105
  selectedCategory = _useState2[0],
32012
32106
  setSelectedCategory = _useState2[1];
32107
+ var _useState3 = useState(1),
32108
+ setCurrentPage = _useState3[1];
32109
+ var getYouTubeThumbnail = function getYouTubeThumbnail(videoUrl) {
32110
+ var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/;
32111
+ var match = videoUrl.match(regExp);
32112
+ var videoId = match && match[2].length === 11 ? match[2] : null;
32113
+ return videoId ? "https://img.youtube.com/vi/" + videoId + "/hqdefault.jpg" : '/placeholder-thumbnail.png';
32114
+ };
32013
32115
  var categoryOptions = [{
32014
32116
  id: 0,
32015
32117
  value: 'all',
32016
- option: 'All'
32017
- }, {
32018
- id: 1,
32019
- value: 'Combat',
32020
- option: 'Combat'
32021
- }, {
32022
- id: 2,
32023
- value: 'Crafting',
32024
- option: 'Crafting'
32025
- }, {
32026
- id: 3,
32027
- value: 'Exploration',
32028
- option: 'Exploration'
32029
- }, {
32030
- id: 4,
32031
- value: 'General',
32032
- option: 'General'
32033
- }];
32118
+ option: 'All Categories'
32119
+ }].concat(VideoGuideCategory ? Object.entries(VideoGuideCategory).map(function (_ref2, index) {
32120
+ var value = _ref2[1];
32121
+ return {
32122
+ id: index + 1,
32123
+ value: value,
32124
+ option: formatItemType(value)
32125
+ };
32126
+ }) : [], VideoGuideLanguage ? Object.entries(VideoGuideLanguage).map(function (_ref3, index) {
32127
+ var value = _ref3[1];
32128
+ return {
32129
+ id: index + (VideoGuideCategory ? Object.entries(VideoGuideCategory).length : 0) + 1,
32130
+ value: value,
32131
+ option: formatItemType(value)
32132
+ };
32133
+ }) : []);
32134
+ var handleVideoClick = function handleVideoClick(videoUrl) {
32135
+ window.open(videoUrl, '_blank', 'noopener,noreferrer');
32136
+ };
32034
32137
  var renderItem = function renderItem(guide) {
32035
32138
  return React.createElement(GuideItem, {
32036
- key: guide.id
32139
+ key: guide.id,
32140
+ onClick: function onClick() {
32141
+ return handleVideoClick(guide.videoUrl);
32142
+ }
32037
32143
  }, React.createElement(GuideThumbnail, null, React.createElement("img", {
32038
- src: guide.thumbnailUrl || '/placeholder-thumbnail.png',
32144
+ src: guide.localImage || getYouTubeThumbnail(guide.videoUrl),
32039
32145
  alt: guide.title
32040
- })), React.createElement(GuideContent, null, React.createElement(GuideTitle, null, guide.title), React.createElement(GuideDescription, null, guide.description), React.createElement(GuideCategory, null, guide.category)));
32146
+ })), React.createElement(GuideContent, null, React.createElement(GuideTitle, null, guide.title), React.createElement(GuideDescription, null, guide.description), React.createElement(GuideLabelsContainer, null, React.createElement(GuideCategory, null, guide.category), React.createElement(GuideLanguage, null, guide.language))));
32147
+ };
32148
+ var filteredGuides = useMemo(function () {
32149
+ return videoGuides.filter(function (guide) {
32150
+ var matchesSearch = guide.title.toLowerCase().includes(searchQuery.toLowerCase()) || guide.description.toLowerCase().includes(searchQuery.toLowerCase());
32151
+ var matchesCategory = selectedCategory === 'all' || Object.values(VideoGuideCategory).includes(selectedCategory) && guide.category === selectedCategory || Object.values(VideoGuideLanguage).includes(selectedCategory) && guide.language === selectedCategory;
32152
+ return matchesSearch && matchesCategory;
32153
+ });
32154
+ }, [videoGuides, searchQuery, selectedCategory]);
32155
+ var handleSearchChange = function handleSearchChange(newQuery) {
32156
+ setSearchQuery(newQuery);
32157
+ setCurrentPage(1);
32158
+ if (newQuery && selectedCategory !== 'all') {
32159
+ setSelectedCategory('all');
32160
+ }
32161
+ };
32162
+ var handleCategoryChange = function handleCategoryChange(category) {
32163
+ setSelectedCategory(category);
32164
+ setCurrentPage(1);
32041
32165
  };
32042
- var filteredGuides = videoGuides.filter(function (guide) {
32043
- return (selectedCategory === 'all' || guide.category === selectedCategory) && (guide.title.toLowerCase().includes(searchQuery.toLowerCase()) || guide.description.toLowerCase().includes(searchQuery.toLowerCase()));
32044
- });
32045
32166
  return React.createElement(PaginatedContent, {
32046
32167
  items: filteredGuides,
32047
32168
  renderItem: renderItem,
32048
32169
  emptyMessage: "No guides found",
32049
32170
  searchOptions: {
32050
32171
  value: searchQuery,
32051
- onChange: setSearchQuery,
32172
+ onChange: handleSearchChange,
32052
32173
  placeholder: 'Search guides...'
32053
32174
  },
32054
32175
  filterOptions: {
32055
32176
  options: categoryOptions,
32056
32177
  selectedOption: selectedCategory,
32057
- onOptionChange: setSelectedCategory
32178
+ onOptionChange: handleCategoryChange
32058
32179
  },
32059
32180
  dependencies: [selectedCategory],
32060
32181
  tabId: tabId,
32061
32182
  layout: "grid",
32062
- gridColumns: 3,
32063
- itemsPerPage: 3,
32064
- itemHeight: "400px"
32183
+ gridColumns: GRID_COLUMNS,
32184
+ itemsPerPage: ITEMS_PER_PAGE$2,
32185
+ itemHeight: "320px"
32065
32186
  });
32066
32187
  };
32067
32188
  var GuideItem = /*#__PURE__*/styled.div.withConfig({
32068
32189
  displayName: "InformationCenterTutorialsSection__GuideItem",
32069
32190
  componentId: "sc-1gk05vk-0"
32070
- })(["background:rgba(0,0,0,0.3);border-radius:4px;overflow:hidden;border:1px solid ", ";cursor:pointer;transition:transform 0.2s ease;height:100%;&:hover{transform:translateY(-2px);}"], uiColors.darkGray);
32191
+ })(["background:rgba(0,0,0,0.3);border-radius:4px;overflow:hidden;border:1px solid ", ";cursor:pointer;transition:transform 0.2s ease;display:flex;flex-direction:column;height:100%;padding:0;&:hover{transform:translateY(-2px);}"], uiColors.darkGray);
32071
32192
  var GuideThumbnail = /*#__PURE__*/styled.div.withConfig({
32072
32193
  displayName: "InformationCenterTutorialsSection__GuideThumbnail",
32073
32194
  componentId: "sc-1gk05vk-1"
32074
- })(["width:100%;height:168px;background:rgba(0,0,0,0.2);overflow:hidden;img{width:100%;height:100%;object-fit:cover;}font-size:0.8rem;line-height:1.8;"]);
32195
+ })(["width:100%;height:168px;background:rgba(0,0,0,0.2);overflow:hidden;img{width:100%;height:100%;object-fit:cover;}"]);
32075
32196
  var GuideContent = /*#__PURE__*/styled.div.withConfig({
32076
32197
  displayName: "InformationCenterTutorialsSection__GuideContent",
32077
32198
  componentId: "sc-1gk05vk-2"
32078
- })(["padding:12px;"]);
32199
+ })(["padding:0 12px 12px;flex:1;display:flex;flex-direction:column;"]);
32079
32200
  var GuideTitle = /*#__PURE__*/styled.h3.withConfig({
32080
32201
  displayName: "InformationCenterTutorialsSection__GuideTitle",
32081
32202
  componentId: "sc-1gk05vk-3"
32082
- })(["margin:0;font-size:0.6rem;color:", ";font-family:'Press Start 2P',cursive;margin-bottom:8px;"], uiColors.yellow);
32203
+ })(["margin:0;font-size:0.6rem !important;color:", ";font-family:'Press Start 2P',cursive;margin-bottom:5px;"], uiColors.yellow);
32083
32204
  var GuideDescription = /*#__PURE__*/styled.p.withConfig({
32084
32205
  displayName: "InformationCenterTutorialsSection__GuideDescription",
32085
32206
  componentId: "sc-1gk05vk-4"
32086
- })(["margin:0;font-size:0.55rem;color:", ";font-family:'Press Start 2P',cursive;margin-bottom:8px;line-height:1.4;"], uiColors.lightGray);
32087
- var GuideCategory = /*#__PURE__*/styled.span.withConfig({
32207
+ })(["margin:0;font-size:0.5rem !important;color:", ";text-align:center;font-family:'Press Start 2P',cursive;margin-bottom:8px;line-height:1.4;"], uiColors.lightGray);
32208
+ var GuideCategory = /*#__PURE__*/styled.label.withConfig({
32088
32209
  displayName: "InformationCenterTutorialsSection__GuideCategory",
32089
32210
  componentId: "sc-1gk05vk-5"
32090
- })(["font-size:0.5rem;color:", ";font-family:'Press Start 2P',cursive;background:rgba(255,255,255,0.1);padding:4px 8px;border-radius:4px;"], uiColors.yellow);
32211
+ })(["font-size:0.5rem !important;font-family:'Press Start 2P',cursive;color:", " !important;line-height:1.4;&::before{content:'\uD83C\uDFF7\uFE0F';padding-right:6px;font-size:0.7rem;transform:translateY(-2px);display:inline-block;}"], uiColors.yellow);
32212
+ var GuideLanguage = /*#__PURE__*/styled.label.withConfig({
32213
+ displayName: "InformationCenterTutorialsSection__GuideLanguage",
32214
+ componentId: "sc-1gk05vk-6"
32215
+ })(["font-size:0.5rem !important;font-family:'Press Start 2P',cursive;color:", " !important;line-height:1.4;&::before{content:'\uD83C\uDF10';padding-right:6px;font-size:0.6rem;transform:translateY(-2px);display:inline-block;}"], uiColors.blue);
32216
+ var GuideLabelsContainer = /*#__PURE__*/styled.div.withConfig({
32217
+ displayName: "InformationCenterTutorialsSection__GuideLabelsContainer",
32218
+ componentId: "sc-1gk05vk-7"
32219
+ })(["display:flex;justify-content:space-between;padding:0 6px 6px;"]);
32091
32220
 
32092
32221
  var InformationCenter = function InformationCenter(_ref) {
32093
32222
  var itemsAtlasJSON = _ref.itemsAtlasJSON,
32094
32223
  itemsAtlasIMG = _ref.itemsAtlasIMG,
32095
32224
  entitiesAtlasJSON = _ref.entitiesAtlasJSON,
32096
32225
  entitiesAtlasIMG = _ref.entitiesAtlasIMG,
32226
+ iconsAtlasIMG = _ref.iconsAtlasIMG,
32227
+ iconsAtlasJSON = _ref.iconsAtlasJSON,
32097
32228
  _ref$faqItems = _ref.faqItems,
32098
32229
  faqItems = _ref$faqItems === void 0 ? [] : _ref$faqItems,
32099
32230
  _ref$bestiaryItems = _ref.bestiaryItems,
@@ -32126,6 +32257,8 @@ var InformationCenter = function InformationCenter(_ref) {
32126
32257
  bestiaryItems: bestiaryItems,
32127
32258
  itemsAtlasJSON: itemsAtlasJSON,
32128
32259
  itemsAtlasIMG: itemsAtlasIMG,
32260
+ iconsAtlasIMG: iconsAtlasIMG,
32261
+ iconsAtlasJSON: iconsAtlasJSON,
32129
32262
  entitiesAtlasJSON: entitiesAtlasJSON,
32130
32263
  entitiesAtlasIMG: entitiesAtlasIMG,
32131
32264
  initialSearchQuery: initialSearchQuery,