@rpg-engine/long-bow 0.5.21 → 0.5.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.
@@ -1,4 +1,4 @@
1
- import React, { Component, useState, useEffect, useRef, useMemo, Fragment } from 'react';
1
+ import React, { Component, useState, useEffect, useRef, useContext, createContext, useMemo, Fragment } from 'react';
2
2
  import styled from 'styled-components';
3
3
  import { GRID_WIDTH, GRID_HEIGHT, ShortcutType, getItemTextureKeyPath, ItemContainerType, ItemType, DepotSocketEvents, ItemSocketEvents, ItemSocketEventsDisplayLabels, ActionsForInventory, ActionsForEquipmentSet, ActionsForLoot, ActionsForMapContainer, ItemRarities, ItemSubType, ItemSlotType, isMobileOrTablet, CharacterClass, getSPForLevel, getXPForLevel, PeriodOfDay, UserAccountTypes } from '@rpg-engine/shared';
4
4
  import dayjs from 'dayjs';
@@ -13386,6 +13386,101 @@ var Container$7 = /*#__PURE__*/styled.div.withConfig({
13386
13386
  componentId: "sc-dgmp04-0"
13387
13387
  })(["position:static !important;"]);
13388
13388
 
13389
+ var onRenderStackInfo = function onRenderStackInfo(itemId, stackQty) {
13390
+ var isFractionalStackQty = stackQty % 1 !== 0;
13391
+ var isLargerThan999 = stackQty > 999;
13392
+ var qtyClassName = 'regular';
13393
+ if (isLargerThan999) qtyClassName = 'small';
13394
+ if (isFractionalStackQty) qtyClassName = 'xsmall';
13395
+ if (stackQty > 1) {
13396
+ return React.createElement(ItemSlotQty, {
13397
+ itemId: itemId,
13398
+ stackQty: stackQty,
13399
+ qtyClassName: qtyClassName
13400
+ });
13401
+ }
13402
+ return undefined;
13403
+ };
13404
+ var ItemSlotQty = function ItemSlotQty(_ref) {
13405
+ var itemId = _ref.itemId,
13406
+ stackQty = _ref.stackQty,
13407
+ qtyClassName = _ref.qtyClassName;
13408
+ return React.createElement(ItemQtyContainer, {
13409
+ key: "qty-" + itemId,
13410
+ className: "item-slot-qty"
13411
+ }, React.createElement(Ellipsis, {
13412
+ maxLines: 1,
13413
+ maxWidth: "48px"
13414
+ }, React.createElement(ItemQty, {
13415
+ className: qtyClassName
13416
+ }, Math.round(stackQty * 100) / 100, ' ')));
13417
+ };
13418
+ var ItemQtyContainer = /*#__PURE__*/styled.div.withConfig({
13419
+ displayName: "ItemSlotQty__ItemQtyContainer",
13420
+ componentId: "sc-keb1s5-0"
13421
+ })(["position:relative;width:85%;height:16px;top:25px;left:2px;pointer-events:none;display:flex;justify-content:flex-end;"]);
13422
+ var ItemQty = /*#__PURE__*/styled.span.withConfig({
13423
+ displayName: "ItemSlotQty__ItemQty",
13424
+ componentId: "sc-keb1s5-1"
13425
+ })(["&.regular{font-size:", ";}&.small{font-size:", ";}&.xsmall{font-size:", ";}"], uiFonts.size.small, uiFonts.size.xsmall, uiFonts.size.xxsmall);
13426
+
13427
+ var ItemSlotRenderer = function ItemSlotRenderer(_ref) {
13428
+ var containerType = _ref.containerType,
13429
+ atlasJSON = _ref.atlasJSON,
13430
+ atlasIMG = _ref.atlasIMG,
13431
+ slotSpriteMask = _ref.slotSpriteMask,
13432
+ item = _ref.item;
13433
+ var renderItem = function renderItem(itemToRender) {
13434
+ var _itemToRender$stackQt;
13435
+ if (!(itemToRender != null && itemToRender.texturePath)) {
13436
+ return null;
13437
+ }
13438
+ return React.createElement(ErrorBoundary, {
13439
+ key: itemToRender._id
13440
+ }, React.createElement(SpriteFromAtlas, {
13441
+ atlasIMG: atlasIMG,
13442
+ atlasJSON: atlasJSON,
13443
+ spriteKey: getItemTextureKeyPath({
13444
+ key: itemToRender.texturePath,
13445
+ texturePath: itemToRender.texturePath,
13446
+ stackQty: itemToRender.stackQty || 1,
13447
+ isStackable: itemToRender.isStackable
13448
+ }, atlasJSON),
13449
+ imgScale: 3,
13450
+ imgClassname: "sprite-from-atlas-img--item"
13451
+ }), onRenderStackInfo(itemToRender._id, (_itemToRender$stackQt = itemToRender.stackQty) != null ? _itemToRender$stackQt : 0));
13452
+ };
13453
+ var renderEquipment = function renderEquipment(itemToRender) {
13454
+ var _itemToRender$allowed;
13455
+ if (!(itemToRender != null && itemToRender.texturePath) || !((_itemToRender$allowed = itemToRender.allowedEquipSlotType) != null && _itemToRender$allowed.includes(slotSpriteMask))) {
13456
+ return React.createElement(ErrorBoundary, {
13457
+ key: v4()
13458
+ }, React.createElement(SpriteFromAtlas, {
13459
+ key: v4(),
13460
+ atlasIMG: atlasIMG,
13461
+ atlasJSON: atlasJSON,
13462
+ spriteKey: EquipmentSlotSpriteByType[slotSpriteMask],
13463
+ imgScale: 3,
13464
+ grayScale: true,
13465
+ opacity: 0.4,
13466
+ imgClassname: "sprite-from-atlas-img--item"
13467
+ }));
13468
+ }
13469
+ return renderItem(itemToRender);
13470
+ };
13471
+ var onRenderSlot = function onRenderSlot(itemToRender) {
13472
+ switch (containerType) {
13473
+ case ItemContainerType.Equipment:
13474
+ return renderEquipment(itemToRender);
13475
+ case ItemContainerType.Inventory:
13476
+ return renderItem(itemToRender);
13477
+ default:
13478
+ return null;
13479
+ }
13480
+ };
13481
+ return React.createElement(React.Fragment, null, onRenderSlot(item));
13482
+ };
13483
+
13389
13484
  var RelativeListMenu = function RelativeListMenu(_ref) {
13390
13485
  var options = _ref.options,
13391
13486
  onSelected = _ref.onSelected,
@@ -13496,6 +13591,78 @@ var Option = /*#__PURE__*/styled.button.withConfig({
13496
13591
  componentId: "sc-ku4p1j-2"
13497
13592
  })(["padding:1rem;background-color:#333;color:white;border:none;border-radius:3px;width:8rem;transition:background-color 0.1s;&:hover{background-color:#555;}@media (max-width:640px){padding:1rem 0.5rem;}"]);
13498
13593
 
13594
+ var ItemSlotToolTips = function ItemSlotToolTips(_ref) {
13595
+ var isTooltipVisible = _ref.isTooltipVisible,
13596
+ isFocused = _ref.isFocused,
13597
+ isContextMenuVisible = _ref.isContextMenuVisible,
13598
+ isContextMenuDisabled = _ref.isContextMenuDisabled,
13599
+ item = _ref.item,
13600
+ contextActions = _ref.contextActions,
13601
+ contextMenuPosition = _ref.contextMenuPosition,
13602
+ dragScale = _ref.dragScale,
13603
+ setIsContextMenuVisible = _ref.setIsContextMenuVisible,
13604
+ setIsTooltipMobileVisible = _ref.setIsTooltipMobileVisible,
13605
+ isTooltipMobileVisible = _ref.isTooltipMobileVisible,
13606
+ _onSelected = _ref.onSelected,
13607
+ atlasIMG = _ref.atlasIMG,
13608
+ atlasJSON = _ref.atlasJSON,
13609
+ equipmentSet = _ref.equipmentSet;
13610
+ return React.createElement(React.Fragment, null, isTooltipVisible && item && !isFocused && React.createElement(ItemTooltip, {
13611
+ item: item,
13612
+ atlasIMG: atlasIMG,
13613
+ atlasJSON: atlasJSON,
13614
+ equipmentSet: equipmentSet
13615
+ }), isTooltipMobileVisible && item && React.createElement(MobileItemTooltip, {
13616
+ item: item,
13617
+ atlasIMG: atlasIMG,
13618
+ atlasJSON: atlasJSON,
13619
+ equipmentSet: equipmentSet,
13620
+ closeTooltip: function closeTooltip() {
13621
+ setIsTooltipMobileVisible(false);
13622
+ },
13623
+ scale: dragScale,
13624
+ options: contextActions,
13625
+ onSelected: function onSelected(optionId) {
13626
+ setIsContextMenuVisible(false);
13627
+ if (item) {
13628
+ _onSelected == null ? void 0 : _onSelected(optionId, item);
13629
+ }
13630
+ }
13631
+ }), !isContextMenuDisabled && isContextMenuVisible && contextActions && React.createElement(RelativeListMenu, {
13632
+ options: contextActions,
13633
+ onSelected: function onSelected(optionId) {
13634
+ setIsContextMenuVisible(false);
13635
+ if (item) {
13636
+ _onSelected == null ? void 0 : _onSelected(optionId, item);
13637
+ }
13638
+ },
13639
+ onOutsideClick: function onOutsideClick() {
13640
+ setIsContextMenuVisible(false);
13641
+ },
13642
+ pos: contextMenuPosition
13643
+ }));
13644
+ };
13645
+
13646
+ var DraggingContext = /*#__PURE__*/createContext({
13647
+ item: null,
13648
+ setDraggingItem: function setDraggingItem() {}
13649
+ });
13650
+ var useDragging = function useDragging() {
13651
+ return useContext(DraggingContext);
13652
+ };
13653
+ var DraggingProvider = function DraggingProvider(_ref) {
13654
+ var children = _ref.children;
13655
+ var _useState = useState(null),
13656
+ item = _useState[0],
13657
+ setDraggingItem = _useState[1];
13658
+ return React.createElement(DraggingContext.Provider, {
13659
+ value: {
13660
+ item: item,
13661
+ setDraggingItem: setDraggingItem
13662
+ }
13663
+ }, children);
13664
+ };
13665
+
13499
13666
  var generateContextMenuListOptions = function generateContextMenuListOptions(actionsByTypeList) {
13500
13667
  var contextMenu = actionsByTypeList.map(function (action) {
13501
13668
  return {
@@ -13680,6 +13847,8 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
13680
13847
  dropPosition = _useState8[0],
13681
13848
  setDropPosition = _useState8[1];
13682
13849
  var dragContainer = useRef(null);
13850
+ var _useDragging = useDragging(),
13851
+ setDraggingItem = _useDragging.setDraggingItem;
13683
13852
  var _useState9 = useState([]),
13684
13853
  contextActions = _useState9[0],
13685
13854
  setContextActions = _useState9[1];
@@ -13698,105 +13867,11 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
13698
13867
  onDrop(item, dropPosition);
13699
13868
  }
13700
13869
  }, [dropPosition]);
13701
- var getStackInfo = function getStackInfo(itemId, stackQty) {
13702
- var isFractionalStackQty = stackQty % 1 !== 0;
13703
- var isLargerThan999 = stackQty > 999;
13704
- var qtyClassName = 'regular';
13705
- if (isLargerThan999) qtyClassName = 'small';
13706
- if (isFractionalStackQty) qtyClassName = 'xsmall';
13707
- if (stackQty > 1) {
13708
- return React.createElement(ItemQtyContainer, {
13709
- key: "qty-" + itemId
13710
- }, React.createElement(Ellipsis, {
13711
- maxLines: 1,
13712
- maxWidth: "48px"
13713
- }, React.createElement(ItemQty, {
13714
- className: qtyClassName
13715
- }, Math.round(stackQty * 100) / 100, ' ')));
13716
- }
13717
- return undefined;
13718
- };
13719
- var renderItem = function renderItem(itemToRender) {
13720
- var _itemToRender$_id, _itemToRender$stackQt;
13721
- var element = [];
13722
- if (itemToRender != null && itemToRender.texturePath) {
13723
- element.push(React.createElement(ErrorBoundary, {
13724
- key: itemToRender._id
13725
- }, React.createElement(SpriteFromAtlas, {
13726
- key: itemToRender._id,
13727
- atlasIMG: atlasIMG,
13728
- atlasJSON: atlasJSON,
13729
- spriteKey: getItemTextureKeyPath({
13730
- key: itemToRender.texturePath,
13731
- texturePath: itemToRender.texturePath,
13732
- stackQty: itemToRender.stackQty || 1,
13733
- isStackable: itemToRender.isStackable
13734
- }, atlasJSON),
13735
- imgScale: 3,
13736
- imgClassname: "sprite-from-atlas-img--item"
13737
- })));
13738
- }
13739
- var stackInfo = getStackInfo((_itemToRender$_id = itemToRender == null ? void 0 : itemToRender._id) != null ? _itemToRender$_id : '', (_itemToRender$stackQt = itemToRender == null ? void 0 : itemToRender.stackQty) != null ? _itemToRender$stackQt : 0);
13740
- if (stackInfo) {
13741
- element.push(stackInfo);
13742
- }
13743
- return element;
13744
- };
13745
- var renderEquipment = function renderEquipment(itemToRender) {
13746
- var _itemToRender$allowed;
13747
- if (itemToRender != null && itemToRender.texturePath && (_itemToRender$allowed = itemToRender.allowedEquipSlotType) != null && _itemToRender$allowed.includes(slotSpriteMask)) {
13748
- var _itemToRender$_id2, _itemToRender$stackQt2;
13749
- var element = [];
13750
- element.push(React.createElement(ErrorBoundary, {
13751
- key: itemToRender._id
13752
- }, React.createElement(SpriteFromAtlas, {
13753
- key: itemToRender._id,
13754
- atlasIMG: atlasIMG,
13755
- atlasJSON: atlasJSON,
13756
- spriteKey: getItemTextureKeyPath({
13757
- key: itemToRender.texturePath,
13758
- texturePath: itemToRender.texturePath,
13759
- stackQty: itemToRender.stackQty || 1,
13760
- isStackable: itemToRender.isStackable
13761
- }, atlasJSON),
13762
- imgScale: 3,
13763
- imgClassname: "sprite-from-atlas-img--item"
13764
- })));
13765
- var stackInfo = getStackInfo((_itemToRender$_id2 = itemToRender == null ? void 0 : itemToRender._id) != null ? _itemToRender$_id2 : '', (_itemToRender$stackQt2 = itemToRender == null ? void 0 : itemToRender.stackQty) != null ? _itemToRender$stackQt2 : 0);
13766
- if (stackInfo) {
13767
- element.push(stackInfo);
13768
- }
13769
- return element;
13770
- } else {
13771
- return React.createElement(ErrorBoundary, {
13772
- key: v4()
13773
- }, React.createElement(SpriteFromAtlas, {
13774
- key: v4(),
13775
- atlasIMG: atlasIMG,
13776
- atlasJSON: atlasJSON,
13777
- spriteKey: EquipmentSlotSpriteByType[slotSpriteMask],
13778
- imgScale: 3,
13779
- grayScale: true,
13780
- opacity: 0.4,
13781
- imgClassname: "sprite-from-atlas-img--item"
13782
- }));
13783
- }
13784
- };
13785
- var onRenderSlot = function onRenderSlot(itemToRender) {
13786
- switch (containerType) {
13787
- case ItemContainerType.Equipment:
13788
- return renderEquipment(itemToRender);
13789
- case ItemContainerType.Inventory:
13790
- return renderItem(itemToRender);
13791
- default:
13792
- return renderItem(itemToRender);
13793
- }
13794
- };
13795
13870
  var resetItem = function resetItem() {
13796
13871
  setTooltipVisible(false);
13797
13872
  setWasDragged(false);
13798
13873
  };
13799
- var onSuccesfulDrag = function onSuccesfulDrag(quantity) {
13874
+ var onSuccessfulDrag = function onSuccessfulDrag(quantity) {
13800
13875
  resetItem();
13801
13876
  if (quantity === -1) {
13802
13877
  setDragPosition({
@@ -13837,6 +13912,7 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
13837
13912
  scale: dragScale,
13838
13913
  disabled: onDragStart === undefined || onDragEnd === undefined,
13839
13914
  onStop: function onStop(e, data) {
13915
+ setDraggingItem(null);
13840
13916
  var target = e.target;
13841
13917
  if (target != null && target.id.includes('shortcutSetter') && setItemShortcut && item) {
13842
13918
  var index = parseInt(target.id.split('_')[1]);
@@ -13871,7 +13947,7 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
13871
13947
  setTimeout(function () {
13872
13948
  if (checkIfItemCanBeMoved != null && checkIfItemCanBeMoved()) {
13873
13949
  if (checkIfItemShouldDragEnd && !checkIfItemShouldDragEnd()) return;
13874
- if (item.stackQty && item.stackQty !== 1 && openQuantitySelector) openQuantitySelector(item.stackQty, onSuccesfulDrag);else onSuccesfulDrag(item.stackQty);
13950
+ if (item.stackQty && item.stackQty !== 1 && openQuantitySelector) openQuantitySelector(item.stackQty, onSuccessfulDrag);else onSuccessfulDrag(item.stackQty);
13875
13951
  } else {
13876
13952
  resetItem();
13877
13953
  setIsFocused(false);
@@ -13880,7 +13956,7 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
13880
13956
  y: 0
13881
13957
  });
13882
13958
  }
13883
- }, 100);
13959
+ }, 50);
13884
13960
  } else if (item) {
13885
13961
  var isTouch = false;
13886
13962
  if (!isContextMenuDisabled && e.type === 'touchend' && !isSelectingShortcut) {
@@ -13904,6 +13980,7 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
13904
13980
  if (!item || isSelectingShortcut) {
13905
13981
  return;
13906
13982
  }
13983
+ setDraggingItem(item);
13907
13984
  if (onDragStart && containerType) {
13908
13985
  onDragStart(item, slotIndex, containerType);
13909
13986
  }
@@ -13931,39 +14008,32 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
13931
14008
  onMouseLeave: function onMouseLeave() {
13932
14009
  setTooltipVisible(false);
13933
14010
  }
13934
- }, onRenderSlot(item))), isTooltipVisible && item && !isFocused && React.createElement(ItemTooltip, {
14011
+ }, React.createElement(ItemSlotRenderer, {
13935
14012
  item: item,
14013
+ slotSpriteMask: slotSpriteMask,
13936
14014
  atlasIMG: atlasIMG,
13937
14015
  atlasJSON: atlasJSON,
13938
- equipmentSet: equipmentSet
13939
- }), isTooltipMobileVisible && item && React.createElement(MobileItemTooltip, {
14016
+ containerType: containerType
14017
+ }))), React.createElement(ItemSlotToolTips, {
14018
+ isTooltipVisible: isTooltipVisible,
14019
+ isTooltipMobileVisible: isTooltipMobileVisible,
14020
+ setIsTooltipMobileVisible: setIsTooltipMobileVisible,
14021
+ isFocused: isFocused,
14022
+ isContextMenuVisible: isContextMenuVisible,
14023
+ isContextMenuDisabled: isContextMenuDisabled,
13940
14024
  item: item,
14025
+ contextActions: contextActions,
14026
+ contextMenuPosition: contextMenuPosition,
14027
+ dragScale: dragScale,
14028
+ setIsContextMenuVisible: setIsContextMenuVisible,
14029
+ onSelected: function onSelected(optionId, item) {
14030
+ setIsContextMenuVisible(false);
14031
+ if (_onSelected) _onSelected(optionId, item);
14032
+ },
13941
14033
  atlasIMG: atlasIMG,
13942
14034
  atlasJSON: atlasJSON,
13943
14035
  equipmentSet: equipmentSet,
13944
- closeTooltip: function closeTooltip() {
13945
- setIsTooltipMobileVisible(false);
13946
- },
13947
- scale: dragScale,
13948
- options: contextActions,
13949
- onSelected: function onSelected(optionId) {
13950
- setIsContextMenuVisible(false);
13951
- if (item) {
13952
- _onSelected == null ? void 0 : _onSelected(optionId, item);
13953
- }
13954
- }
13955
- }), !isContextMenuDisabled && isContextMenuVisible && contextActions && React.createElement(RelativeListMenu, {
13956
- options: contextActions,
13957
- onSelected: function onSelected(optionId) {
13958
- setIsContextMenuVisible(false);
13959
- if (item) {
13960
- _onSelected == null ? void 0 : _onSelected(optionId, item);
13961
- }
13962
- },
13963
- onOutsideClick: function onOutsideClick() {
13964
- setIsContextMenuVisible(false);
13965
- },
13966
- pos: contextMenuPosition
14036
+ setIsTooltipVisible: setTooltipVisible
13967
14037
  }));
13968
14038
  });
13969
14039
  var rarityColor = function rarityColor(item) {
@@ -13983,7 +14053,7 @@ var rarityColor = function rarityColor(item) {
13983
14053
  var Container$a = /*#__PURE__*/styled.div.withConfig({
13984
14054
  displayName: "ItemSlot__Container",
13985
14055
  componentId: "sc-l2j5ef-0"
13986
- })(["margin:0.1rem;.react-draggable-dragging{opacity:0.5;}.sprite-from-atlas-img--item{position:relative;top:1.5rem;left:1.5rem;border-color:", ";box-shadow:", " inset,", ";}position:relative;&::before{content:'';position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;border-radius:12px;pointer-events:none;animation:", ";@keyframes bg-color-change{0%{background-color:rgba(255 255 255 / 0.5);}50%{background-color:transparent;}100%{background-color:rgba(255 255 255 / 0.5);}}}"], function (_ref2) {
14056
+ })(["margin:0.1rem;.react-draggable-dragging{display:none;}.sprite-from-atlas-img--item{position:relative;top:1.5rem;left:1.5rem;border-color:", ";box-shadow:", " inset,", ";}position:relative;&::before{content:'';position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;border-radius:12px;pointer-events:none;animation:", ";@keyframes bg-color-change{0%{background-color:rgba(255 255 255 / 0.5);}50%{background-color:transparent;}100%{background-color:rgba(255 255 255 / 0.5);}}}"], function (_ref2) {
13987
14057
  var item = _ref2.item;
13988
14058
  return rarityColor(item);
13989
14059
  }, function (_ref3) {
@@ -13999,17 +14069,9 @@ var Container$a = /*#__PURE__*/styled.div.withConfig({
13999
14069
  var ItemContainer = /*#__PURE__*/styled.div.withConfig({
14000
14070
  displayName: "ItemSlot__ItemContainer",
14001
14071
  componentId: "sc-l2j5ef-1"
14002
- })(["width:100%;height:100%;position:relative;", ""], function (props) {
14072
+ })(["width:64px;height:64px;position:relative;", ";"], function (props) {
14003
14073
  return props.isFocused && 'z-index: 100; pointer-events: none;';
14004
14074
  });
14005
- var ItemQtyContainer = /*#__PURE__*/styled.div.withConfig({
14006
- displayName: "ItemSlot__ItemQtyContainer",
14007
- componentId: "sc-l2j5ef-2"
14008
- })(["position:relative;width:85%;height:16px;top:25px;left:2px;pointer-events:none;display:flex;justify-content:flex-end;"]);
14009
- var ItemQty = /*#__PURE__*/styled.span.withConfig({
14010
- displayName: "ItemSlot__ItemQty",
14011
- componentId: "sc-l2j5ef-3"
14012
- })(["&.regular{font-size:", ";}&.small{font-size:", ";}&.xsmall{font-size:", ";}"], uiFonts.size.small, uiFonts.size.xsmall, uiFonts.size.xxsmall);
14013
14075
 
14014
14076
  var statisticsToDisplay = [{
14015
14077
  key: 'attack'
@@ -14688,6 +14750,102 @@ var Details = /*#__PURE__*/styled.p.withConfig({
14688
14750
  componentId: "sc-kaa0h9-0"
14689
14751
  })(["font-size:", " !important;"], uiFonts.size.xsmall);
14690
14752
 
14753
+ var useCursorPosition = function useCursorPosition() {
14754
+ var _useState = useState({
14755
+ x: 0,
14756
+ y: 0
14757
+ }),
14758
+ cursorPosition = _useState[0],
14759
+ setCursorPosition = _useState[1];
14760
+ useEffect(function () {
14761
+ var animationFrameId;
14762
+ var updateCursorPosition = function updateCursorPosition(x, y) {
14763
+ // Cancel the previous frame request
14764
+ cancelAnimationFrame(animationFrameId);
14765
+ // Request a new frame
14766
+ animationFrameId = requestAnimationFrame(function () {
14767
+ setCursorPosition({
14768
+ x: x,
14769
+ y: y
14770
+ });
14771
+ });
14772
+ };
14773
+ var handleMouseMove = function handleMouseMove(event) {
14774
+ updateCursorPosition(event.clientX, event.clientY);
14775
+ };
14776
+ var handleTouchMove = function handleTouchMove(event) {
14777
+ // Prevent default touch behavior (like scrolling)
14778
+ event.preventDefault();
14779
+ if (event.touches.length > 0) {
14780
+ var touch = event.touches[0];
14781
+ updateCursorPosition(touch.clientX, touch.clientY);
14782
+ }
14783
+ };
14784
+ window.addEventListener('mousemove', handleMouseMove);
14785
+ window.addEventListener('touchmove', handleTouchMove, {
14786
+ passive: false
14787
+ });
14788
+ // Cleanup function
14789
+ return function () {
14790
+ window.removeEventListener('mousemove', handleMouseMove);
14791
+ window.removeEventListener('touchmove', handleTouchMove);
14792
+ cancelAnimationFrame(animationFrameId);
14793
+ };
14794
+ }, []);
14795
+ return cursorPosition;
14796
+ };
14797
+
14798
+ var CONTAINER_SIZE = 32;
14799
+ var OFFSET = CONTAINER_SIZE / 2;
14800
+ var DraggedItem = function DraggedItem(_ref) {
14801
+ var _item$_id, _item$stackQty;
14802
+ var atlasJSON = _ref.atlasJSON,
14803
+ atlasIMG = _ref.atlasIMG;
14804
+ var _useDragging = useDragging(),
14805
+ item = _useDragging.item;
14806
+ var _useCursorPosition = useCursorPosition(),
14807
+ x = _useCursorPosition.x,
14808
+ y = _useCursorPosition.y;
14809
+ if (!item) {
14810
+ return null;
14811
+ }
14812
+ var centeredX = x - OFFSET;
14813
+ var centeredY = y - OFFSET;
14814
+ var stackInfo = onRenderStackInfo((_item$_id = item == null ? void 0 : item._id) != null ? _item$_id : '', (_item$stackQty = item == null ? void 0 : item.stackQty) != null ? _item$stackQty : 0);
14815
+ return React.createElement(Container$e, null, React.createElement(SpriteContainer, {
14816
+ x: centeredX,
14817
+ y: centeredY
14818
+ }, React.createElement(SpriteFromAtlas, {
14819
+ key: item._id,
14820
+ atlasIMG: atlasIMG,
14821
+ atlasJSON: atlasJSON,
14822
+ spriteKey: getItemTextureKeyPath({
14823
+ key: item.texturePath,
14824
+ texturePath: item.texturePath,
14825
+ stackQty: item.stackQty || 1,
14826
+ isStackable: item.isStackable
14827
+ }, atlasJSON),
14828
+ imgScale: 3,
14829
+ imgClassname: "sprite-from-atlas-img--item"
14830
+ }), stackInfo));
14831
+ };
14832
+ var pulse = "\n @keyframes pulse {\n 0%, 100% {\n transform: scale(1) rotate(-3deg);\n }\n 50% {\n transform: scale(0.95) rotate(-3deg);\n }\n }\n";
14833
+ var Container$e = /*#__PURE__*/styled.div.withConfig({
14834
+ displayName: "DraggedItem__Container",
14835
+ componentId: "sc-mlzzcp-0"
14836
+ })(["position:relative;"]);
14837
+ var SpriteContainer = /*#__PURE__*/styled.div.attrs(function (props) {
14838
+ return {
14839
+ style: {
14840
+ left: props.x + "px",
14841
+ top: props.y + "px"
14842
+ }
14843
+ };
14844
+ }).withConfig({
14845
+ displayName: "DraggedItem__SpriteContainer",
14846
+ componentId: "sc-mlzzcp-1"
14847
+ })(["", " position:absolute;z-index:100;pointer-events:none;width:", "px;height:", "px;transform:rotate(-3deg);filter:grayscale(100%);opacity:0.35;animation:pulse 2s infinite;.item-slot-qty{position:absolute;bottom:0;margin-left:0.8rem;}"], pulse, CONTAINER_SIZE, CONTAINER_SIZE);
14848
+
14691
14849
  var EquipmentSet = function EquipmentSet(_ref) {
14692
14850
  var equipmentSet = _ref.equipmentSet,
14693
14851
  onClose = _ref.onClose,
@@ -14764,7 +14922,10 @@ var EquipmentSet = function EquipmentSet(_ref) {
14764
14922
  });
14765
14923
  });
14766
14924
  };
14767
- return React.createElement(DraggableContainer, {
14925
+ return React.createElement(DraggingProvider, null, React.createElement(DraggedItem, {
14926
+ atlasIMG: atlasIMG,
14927
+ atlasJSON: atlasJSON
14928
+ }), React.createElement(DraggableContainer, {
14768
14929
  title: 'Equipments',
14769
14930
  type: RPGUIContainerTypes.Framed,
14770
14931
  onCloseButton: function onCloseButton() {
@@ -14778,7 +14939,7 @@ var EquipmentSet = function EquipmentSet(_ref) {
14778
14939
  onPositionChangeStart: onPositionChangeStart
14779
14940
  }, React.createElement(EquipmentSetContainer, {
14780
14941
  className: "equipment-container-body"
14781
- }, React.createElement(EquipmentColumn, null, onRenderEquipmentSlotRange(0, 3)), React.createElement(EquipmentColumn, null, onRenderEquipmentSlotRange(3, 7)), React.createElement(EquipmentColumn, null, onRenderEquipmentSlotRange(7, 10))));
14942
+ }, React.createElement(EquipmentColumn, null, onRenderEquipmentSlotRange(0, 3)), React.createElement(EquipmentColumn, null, onRenderEquipmentSlotRange(3, 7)), React.createElement(EquipmentColumn, null, onRenderEquipmentSlotRange(7, 10)))));
14782
14943
  };
14783
14944
  var EquipmentSetContainer = /*#__PURE__*/styled.div.withConfig({
14784
14945
  displayName: "EquipmentSet__EquipmentSetContainer",
@@ -14884,7 +15045,7 @@ var NPCDialogText = function NPCDialogText(_ref) {
14884
15045
  var _useState2 = useState(false),
14885
15046
  showGoNextIndicator = _useState2[0],
14886
15047
  setShowGoNextIndicator = _useState2[1];
14887
- return React.createElement(Container$e, null, React.createElement(DynamicText, {
15048
+ return React.createElement(Container$f, null, React.createElement(DynamicText, {
14888
15049
  text: (textChunks == null ? void 0 : textChunks[chunkIndex]) || '',
14889
15050
  onFinish: function onFinish() {
14890
15051
  setShowGoNextIndicator(true);
@@ -14902,7 +15063,7 @@ var NPCDialogText = function NPCDialogText(_ref) {
14902
15063
  }
14903
15064
  }));
14904
15065
  };
14905
- var Container$e = /*#__PURE__*/styled.div.withConfig({
15066
+ var Container$f = /*#__PURE__*/styled.div.withConfig({
14906
15067
  displayName: "NPCDialogText__Container",
14907
15068
  componentId: "sc-1cxkdh9-0"
14908
15069
  })([""]);
@@ -15054,7 +15215,7 @@ var QuestionDialog = function QuestionDialog(_ref) {
15054
15215
  return null;
15055
15216
  });
15056
15217
  };
15057
- return React.createElement(Container$f, null, React.createElement(QuestionContainer, null, React.createElement(DynamicText, {
15218
+ return React.createElement(Container$g, null, React.createElement(QuestionContainer, null, React.createElement(DynamicText, {
15058
15219
  text: currentQuestion.text,
15059
15220
  onStart: function onStart() {
15060
15221
  return setCanShowAnswers(false);
@@ -15064,7 +15225,7 @@ var QuestionDialog = function QuestionDialog(_ref) {
15064
15225
  }
15065
15226
  })), canShowAnswers && React.createElement(AnswersContainer, null, onRenderCurrentAnswers()));
15066
15227
  };
15067
- var Container$f = /*#__PURE__*/styled.div.withConfig({
15228
+ var Container$g = /*#__PURE__*/styled.div.withConfig({
15068
15229
  displayName: "QuestionDialog__Container",
15069
15230
  componentId: "sc-bxc5u0-0"
15070
15231
  })(["display:flex;word-break:break-all;box-sizing:border-box;justify-content:flex-start;align-items:flex-start;flex-wrap:wrap;"]);
@@ -15125,7 +15286,7 @@ var NPCDialog = function NPCDialog(_ref) {
15125
15286
  }
15126
15287
  })), type === NPCDialogType.TextAndThumbnail && React.createElement(ThumbnailContainer, null, React.createElement(NPCThumbnail, {
15127
15288
  src: imagePath || img$7
15128
- }))) : React.createElement(React.Fragment, null, React.createElement(Container$g, null, React.createElement(TextContainer$1, {
15289
+ }))) : React.createElement(React.Fragment, null, React.createElement(Container$h, null, React.createElement(TextContainer$1, {
15129
15290
  flex: type === NPCDialogType.TextAndThumbnail ? '70%' : '100%'
15130
15291
  }, React.createElement(NPCDialogText, {
15131
15292
  type: type,
@@ -15139,7 +15300,7 @@ var NPCDialog = function NPCDialog(_ref) {
15139
15300
  src: imagePath || img$7
15140
15301
  })))));
15141
15302
  };
15142
- var Container$g = /*#__PURE__*/styled.div.withConfig({
15303
+ var Container$h = /*#__PURE__*/styled.div.withConfig({
15143
15304
  displayName: "NPCDialog__Container",
15144
15305
  componentId: "sc-1b4aw74-0"
15145
15306
  })(["display:flex;width:100%;height:100%;box-sizing:border-box;justify-content:center;align-items:flex-start;position:relative;"]);
@@ -15196,7 +15357,7 @@ var NPCMultiDialog = function NPCMultiDialog(_ref) {
15196
15357
  type: RPGUIContainerTypes.FramedGold,
15197
15358
  width: '50%',
15198
15359
  height: '180px'
15199
- }, React.createElement(React.Fragment, null, React.createElement(Container$h, null, ((_textAndTypeArray$sli = textAndTypeArray[slide]) == null ? void 0 : _textAndTypeArray$sli.imageSide) === 'right' && React.createElement(React.Fragment, null, React.createElement(TextContainer$2, {
15360
+ }, React.createElement(React.Fragment, null, React.createElement(Container$i, null, ((_textAndTypeArray$sli = textAndTypeArray[slide]) == null ? void 0 : _textAndTypeArray$sli.imageSide) === 'right' && React.createElement(React.Fragment, null, React.createElement(TextContainer$2, {
15200
15361
  flex: '70%'
15201
15362
  }, React.createElement(NPCDialogText, {
15202
15363
  onStartStep: function onStartStep() {
@@ -15238,7 +15399,7 @@ var NPCMultiDialog = function NPCMultiDialog(_ref) {
15238
15399
  src: img$6
15239
15400
  }))), ")"));
15240
15401
  };
15241
- var Container$h = /*#__PURE__*/styled.div.withConfig({
15402
+ var Container$i = /*#__PURE__*/styled.div.withConfig({
15242
15403
  displayName: "NPCMultiDialog__Container",
15243
15404
  componentId: "sc-rvu5wg-0"
15244
15405
  })(["display:flex;width:100%;height:100%;box-sizing:border-box;justify-content:center;align-items:flex-start;position:relative;"]);
@@ -15432,7 +15593,8 @@ var SlotsContainer = function SlotsContainer(_ref) {
15432
15593
  _onPositionChangeStart = _ref.onPositionChangeStart,
15433
15594
  onOutsideClick = _ref.onOutsideClick,
15434
15595
  initialPosition = _ref.initialPosition,
15435
- scale = _ref.scale;
15596
+ scale = _ref.scale,
15597
+ width = _ref.width;
15436
15598
  return React.createElement(DraggableContainer, {
15437
15599
  title: title,
15438
15600
  type: RPGUIContainerTypes.Framed,
@@ -15441,7 +15603,7 @@ var SlotsContainer = function SlotsContainer(_ref) {
15441
15603
  onClose();
15442
15604
  }
15443
15605
  },
15444
- width: "450px",
15606
+ width: width != null ? width : '415px',
15445
15607
  cancelDrag: ".item-container-body, #shortcuts_list",
15446
15608
  onPositionChange: function onPositionChange(_ref2) {
15447
15609
  var x = _ref2.x,
@@ -15683,7 +15845,7 @@ var ShortcutsSetter = function ShortcutsSetter(_ref) {
15683
15845
  }
15684
15846
  return null;
15685
15847
  };
15686
- return React.createElement(Container$i, null, React.createElement("p", null, "Shortcuts:"), React.createElement(List, {
15848
+ return React.createElement(Container$j, null, React.createElement("p", null, "Shortcuts:"), React.createElement(List, {
15687
15849
  id: "shortcuts_list"
15688
15850
  }, Array.from({
15689
15851
  length: 12
@@ -15701,7 +15863,7 @@ var ShortcutsSetter = function ShortcutsSetter(_ref) {
15701
15863
  }, getContent(i));
15702
15864
  })));
15703
15865
  };
15704
- var Container$i = /*#__PURE__*/styled.div.withConfig({
15866
+ var Container$j = /*#__PURE__*/styled.div.withConfig({
15705
15867
  displayName: "ShortcutsSetter__Container",
15706
15868
  componentId: "sc-xuouuf-0"
15707
15869
  })(["p{margin:0;margin-left:0.5rem;font-size:10px;}width:100%;"]);
@@ -15812,7 +15974,10 @@ var ItemContainer$1 = function ItemContainer(_ref) {
15812
15974
  }
15813
15975
  return slots;
15814
15976
  };
15815
- return React.createElement(React.Fragment, null, React.createElement(SlotsContainer, {
15977
+ return React.createElement(DraggingProvider, null, React.createElement(DraggedItem, {
15978
+ atlasIMG: atlasIMG,
15979
+ atlasJSON: atlasJSON
15980
+ }), React.createElement(SlotsContainer, {
15816
15981
  title: itemContainer.name || 'Container',
15817
15982
  onClose: onClose,
15818
15983
  initialPosition: initialPosition,
@@ -15851,7 +16016,7 @@ var ItemContainer$1 = function ItemContainer(_ref) {
15851
16016
  var ItemsContainer = /*#__PURE__*/styled.div.withConfig({
15852
16017
  displayName: "ItemContainer__ItemsContainer",
15853
16018
  componentId: "sc-15y5p9l-0"
15854
- })(["display:flex;justify-content:center;flex-wrap:wrap;max-height:270px;overflow-y:auto;overflow-x:hidden;width:450px;"]);
16019
+ })(["display:flex;justify-content:center;flex-wrap:wrap;max-height:270px;overflow-y:auto;overflow-x:hidden;width:415px;"]);
15855
16020
  var QuantitySelectorContainer = /*#__PURE__*/styled.div.withConfig({
15856
16021
  displayName: "ItemContainer__QuantitySelectorContainer",
15857
16022
  componentId: "sc-15y5p9l-1"
@@ -15980,7 +16145,7 @@ var ListMenu = function ListMenu(_ref) {
15980
16145
  onSelected = _ref.onSelected,
15981
16146
  x = _ref.x,
15982
16147
  y = _ref.y;
15983
- return React.createElement(Container$j, {
16148
+ return React.createElement(Container$k, {
15984
16149
  x: x,
15985
16150
  y: y
15986
16151
  }, React.createElement("ul", {
@@ -15997,7 +16162,7 @@ var ListMenu = function ListMenu(_ref) {
15997
16162
  }, (params == null ? void 0 : params.text) || 'No text');
15998
16163
  })));
15999
16164
  };
16000
- var Container$j = /*#__PURE__*/styled.div.withConfig({
16165
+ var Container$k = /*#__PURE__*/styled.div.withConfig({
16001
16166
  displayName: "ListMenu__Container",
16002
16167
  componentId: "sc-i9097t-0"
16003
16168
  })(["display:flex;flex-direction:column;width:100%;justify-content:start;align-items:flex-start;position:absolute;top:", "px;left:", "px;li{font-size:", ";}"], function (props) {
@@ -16016,7 +16181,7 @@ var Pager = function Pager(_ref) {
16016
16181
  itemsPerPage = _ref.itemsPerPage,
16017
16182
  onPageChange = _ref.onPageChange;
16018
16183
  var totalPages = Math.ceil(totalItems / itemsPerPage);
16019
- return React.createElement(Container$k, null, React.createElement("p", null, "Total items: ", totalItems), React.createElement(PagerContainer, null, React.createElement("button", {
16184
+ return React.createElement(Container$l, null, React.createElement("p", null, "Total items: ", totalItems), React.createElement(PagerContainer, null, React.createElement("button", {
16020
16185
  disabled: currentPage === 1,
16021
16186
  onPointerDown: function onPointerDown() {
16022
16187
  return onPageChange(Math.max(currentPage - 1, 1));
@@ -16030,7 +16195,7 @@ var Pager = function Pager(_ref) {
16030
16195
  }
16031
16196
  }, '>')));
16032
16197
  };
16033
- var Container$k = /*#__PURE__*/styled.div.withConfig({
16198
+ var Container$l = /*#__PURE__*/styled.div.withConfig({
16034
16199
  displayName: "Pager__Container",
16035
16200
  componentId: "sc-1ekmf50-0"
16036
16201
  })(["display:flex;flex-direction:column;align-items:center;p{margin:0;font-size:", ";}"], uiFonts.size.xsmall);
@@ -16043,7 +16208,7 @@ var ConfirmModal = function ConfirmModal(_ref) {
16043
16208
  var onConfirm = _ref.onConfirm,
16044
16209
  onClose = _ref.onClose,
16045
16210
  message = _ref.message;
16046
- return React.createElement(ModalPortal, null, React.createElement(Background, null), React.createElement(Container$l, {
16211
+ return React.createElement(ModalPortal, null, React.createElement(Background, null), React.createElement(Container$m, {
16047
16212
  onPointerDown: onClose
16048
16213
  }, React.createElement(DraggableContainer, {
16049
16214
  width: "auto",
@@ -16066,7 +16231,7 @@ var Background = /*#__PURE__*/styled.div.withConfig({
16066
16231
  displayName: "ConfirmModal__Background",
16067
16232
  componentId: "sc-11qkyu1-0"
16068
16233
  })(["position:absolute;width:100%;height:100%;background-color:#000000;opacity:0.5;left:0;top:0;z-index:1000;"]);
16069
- var Container$l = /*#__PURE__*/styled.div.withConfig({
16234
+ var Container$m = /*#__PURE__*/styled.div.withConfig({
16070
16235
  displayName: "ConfirmModal__Container",
16071
16236
  componentId: "sc-11qkyu1-1"
16072
16237
  })(["position:absolute;width:100%;height:100%;left:0;top:0;display:flex;justify-content:center;align-items:center;z-index:1001;"]);
@@ -16089,7 +16254,7 @@ var MarketplaceRows = function MarketplaceRows(_ref) {
16089
16254
  onMarketPlaceItemBuy = _ref.onMarketPlaceItemBuy,
16090
16255
  onMarketPlaceItemRemove = _ref.onMarketPlaceItemRemove,
16091
16256
  disabled = _ref.disabled;
16092
- return React.createElement(MarketplaceWrapper, null, React.createElement(ItemIconContainer, null, React.createElement(SpriteContainer, null, React.createElement(ItemInfoWrapper, {
16257
+ return React.createElement(MarketplaceWrapper, null, React.createElement(ItemIconContainer, null, React.createElement(SpriteContainer$1, null, React.createElement(ItemInfoWrapper, {
16093
16258
  item: item,
16094
16259
  atlasIMG: atlasIMG,
16095
16260
  atlasJSON: atlasJSON,
@@ -16150,7 +16315,7 @@ var GoldContainer = /*#__PURE__*/styled.div.withConfig({
16150
16315
  displayName: "MarketplaceRows__GoldContainer",
16151
16316
  componentId: "sc-wmpr1o-4"
16152
16317
  })(["position:relative;top:-0.5rem;left:0.5rem;"]);
16153
- var SpriteContainer = /*#__PURE__*/styled.div.withConfig({
16318
+ var SpriteContainer$1 = /*#__PURE__*/styled.div.withConfig({
16154
16319
  displayName: "MarketplaceRows__SpriteContainer",
16155
16320
  componentId: "sc-wmpr1o-5"
16156
16321
  })(["position:relative;left:0.5rem;"]);
@@ -17031,7 +17196,7 @@ var ProgressBar = function ProgressBar(_ref) {
17031
17196
  }
17032
17197
  return value * 100 / max;
17033
17198
  };
17034
- return React.createElement(Container$m, {
17199
+ return React.createElement(Container$n, {
17035
17200
  className: "rpgui-progress",
17036
17201
  "data-value": calculatePercentageValue(max, value) / 100,
17037
17202
  "data-rpguitype": "progress",
@@ -17061,7 +17226,7 @@ var TextOverlay$1 = /*#__PURE__*/styled.div.withConfig({
17061
17226
  displayName: "ProgressBar__TextOverlay",
17062
17227
  componentId: "sc-qa6fzh-1"
17063
17228
  })(["width:100%;position:relative;"]);
17064
- var Container$m = /*#__PURE__*/styled.div.withConfig({
17229
+ var Container$n = /*#__PURE__*/styled.div.withConfig({
17065
17230
  displayName: "ProgressBar__Container",
17066
17231
  componentId: "sc-qa6fzh-2"
17067
17232
  })(["display:flex;flex-direction:column;min-width:", "px;width:", "%;justify-content:start;align-items:flex-start;", " @media (max-width:950px){transform:scale(", ");}"], function (props) {
@@ -17409,7 +17574,7 @@ var SimpleProgressBar = function SimpleProgressBar(_ref) {
17409
17574
  bgColor = _ref$bgColor === void 0 ? 'red' : _ref$bgColor,
17410
17575
  _ref$margin = _ref.margin,
17411
17576
  margin = _ref$margin === void 0 ? 20 : _ref$margin;
17412
- return React.createElement(Container$n, {
17577
+ return React.createElement(Container$o, {
17413
17578
  className: "simple-progress-bar"
17414
17579
  }, React.createElement(ProgressBarContainer, {
17415
17580
  margin: margin
@@ -17418,7 +17583,7 @@ var SimpleProgressBar = function SimpleProgressBar(_ref) {
17418
17583
  bgColor: bgColor
17419
17584
  }))));
17420
17585
  };
17421
- var Container$n = /*#__PURE__*/styled.div.withConfig({
17586
+ var Container$o = /*#__PURE__*/styled.div.withConfig({
17422
17587
  displayName: "SimpleProgressBar__Container",
17423
17588
  componentId: "sc-mbeil3-0"
17424
17589
  })(["display:flex;justify-content:center;align-items:center;width:100%;"]);
@@ -17465,7 +17630,7 @@ var SkillProgressBar = function SkillProgressBar(_ref) {
17465
17630
  return "" + result.toFixed(2);
17466
17631
  }
17467
17632
  };
17468
- return React.createElement(React.Fragment, null, React.createElement(ProgressTitle, null, buffAndDebuff !== undefined && React.createElement(React.Fragment, null, buffAndDebuff > 0 ? React.createElement(BuffAndDebuffContainer, null, React.createElement(TitleNameContainer, null, React.createElement(TitleNameBuff, null, skillName), React.createElement(TitleNameBuff, null, "lv ", level, " (", skillsBuffsCalc(level, buffAndDebuff), ")")), React.createElement(TitleNameBuffContainer, null, React.createElement(TitleNameBuff, null, "(+", buffAndDebuff, "%)"))) : buffAndDebuff < 0 ? React.createElement(React.Fragment, null, React.createElement(TitleNameContainer, null, React.createElement(TitleNameDebuff, null, skillName), React.createElement(TitleNameDebuff, null, "lv ", level, " (", skillsBuffsCalc(level, buffAndDebuff), ")")), React.createElement("div", null, React.createElement(TitleNameDebuff, null, "(", buffAndDebuff, "%)"))) : React.createElement(TitleName, null, skillName)), !buffAndDebuff && React.createElement(TitleNameContainer, null, React.createElement(TitleName, null, skillName), React.createElement(ValueDisplay, null, "lv ", level))), React.createElement(ProgressBody, null, React.createElement(ProgressIconContainer, null, atlasIMG && atlasJSON ? React.createElement(SpriteContainer$1, null, React.createElement(ErrorBoundary, null, React.createElement(SpriteFromAtlas, {
17633
+ return React.createElement(React.Fragment, null, React.createElement(ProgressTitle, null, buffAndDebuff !== undefined && React.createElement(React.Fragment, null, buffAndDebuff > 0 ? React.createElement(BuffAndDebuffContainer, null, React.createElement(TitleNameContainer, null, React.createElement(TitleNameBuff, null, skillName), React.createElement(TitleNameBuff, null, "lv ", level, " (", skillsBuffsCalc(level, buffAndDebuff), ")")), React.createElement(TitleNameBuffContainer, null, React.createElement(TitleNameBuff, null, "(+", buffAndDebuff, "%)"))) : buffAndDebuff < 0 ? React.createElement(React.Fragment, null, React.createElement(TitleNameContainer, null, React.createElement(TitleNameDebuff, null, skillName), React.createElement(TitleNameDebuff, null, "lv ", level, " (", skillsBuffsCalc(level, buffAndDebuff), ")")), React.createElement("div", null, React.createElement(TitleNameDebuff, null, "(", buffAndDebuff, "%)"))) : React.createElement(TitleName, null, skillName)), !buffAndDebuff && React.createElement(TitleNameContainer, null, React.createElement(TitleName, null, skillName), React.createElement(ValueDisplay, null, "lv ", level))), React.createElement(ProgressBody, null, React.createElement(ProgressIconContainer, null, atlasIMG && atlasJSON ? React.createElement(SpriteContainer$2, null, React.createElement(ErrorBoundary, null, React.createElement(SpriteFromAtlas, {
17469
17634
  atlasIMG: atlasIMG,
17470
17635
  atlasJSON: atlasJSON,
17471
17636
  spriteKey: texturePath,
@@ -17481,7 +17646,7 @@ var ProgressBarContainer$1 = /*#__PURE__*/styled.div.withConfig({
17481
17646
  displayName: "SkillProgressBar__ProgressBarContainer",
17482
17647
  componentId: "sc-5vuroc-0"
17483
17648
  })(["position:relative;top:8px;width:100%;height:auto;"]);
17484
- var SpriteContainer$1 = /*#__PURE__*/styled.div.withConfig({
17649
+ var SpriteContainer$2 = /*#__PURE__*/styled.div.withConfig({
17485
17650
  displayName: "SkillProgressBar__SpriteContainer",
17486
17651
  componentId: "sc-5vuroc-1"
17487
17652
  })(["position:relative;top:-3px;left:0;"]);
@@ -17707,7 +17872,7 @@ var SpellInfo = function SpellInfo(_ref) {
17707
17872
  castingType = spell.castingType,
17708
17873
  cooldown = spell.cooldown,
17709
17874
  maxDistanceGrid = spell.maxDistanceGrid;
17710
- return React.createElement(Container$o, null, React.createElement(Header$1, null, React.createElement("div", null, React.createElement(Title$9, null, name), React.createElement(Type$1, null, magicWords))), React.createElement(Statistic$1, null, React.createElement("div", {
17875
+ return React.createElement(Container$p, null, React.createElement(Header$1, null, React.createElement("div", null, React.createElement(Title$9, null, name), React.createElement(Type$1, null, magicWords))), React.createElement(Statistic$1, null, React.createElement("div", {
17711
17876
  className: "label"
17712
17877
  }, "Casting Type:"), React.createElement("div", {
17713
17878
  className: "value"
@@ -17733,7 +17898,7 @@ var SpellInfo = function SpellInfo(_ref) {
17733
17898
  className: "value"
17734
17899
  }, requiredItem))), React.createElement(Description$2, null, description));
17735
17900
  };
17736
- var Container$o = /*#__PURE__*/styled.div.withConfig({
17901
+ var Container$p = /*#__PURE__*/styled.div.withConfig({
17737
17902
  displayName: "SpellInfo__Container",
17738
17903
  componentId: "sc-4hbw3q-0"
17739
17904
  })(["color:white;background-color:#222;border-radius:5px;padding:0.5rem;font-size:", ";border:3px solid ", ";height:max-content;width:30rem;@media (max-width:580px){width:80vw;}"], uiFonts.size.small, uiColors.lightGray);
@@ -17787,7 +17952,7 @@ var MobileSpellTooltip = function MobileSpellTooltip(_ref) {
17787
17952
  var _ref$current;
17788
17953
  (_ref$current = ref.current) == null ? void 0 : _ref$current.classList.add('fadeOut');
17789
17954
  };
17790
- return React.createElement(ModalPortal, null, React.createElement(Container$p, {
17955
+ return React.createElement(ModalPortal, null, React.createElement(Container$q, {
17791
17956
  ref: ref,
17792
17957
  onTouchEnd: function onTouchEnd() {
17793
17958
  handleFadeOut();
@@ -17812,7 +17977,7 @@ var MobileSpellTooltip = function MobileSpellTooltip(_ref) {
17812
17977
  }, option.text);
17813
17978
  }))));
17814
17979
  };
17815
- var Container$p = /*#__PURE__*/styled.div.withConfig({
17980
+ var Container$q = /*#__PURE__*/styled.div.withConfig({
17816
17981
  displayName: "MobileSpellTooltip__Container",
17817
17982
  componentId: "sc-6p7uvr-0"
17818
17983
  })(["position:absolute;z-index:100;left:0;top:0;width:100vw;height:100vh;background-color:rgba(0 0 0 / 0.5);display:flex;justify-content:center;align-items:center;gap:0.5rem;transition:opacity 0.08s;animation:fadeIn 0.1s forwards;@keyframes fadeIn{0%{opacity:0;}100%{opacity:0.92;}}@keyframes fadeOut{0%{opacity:0.92;}100%{opacity:0;}}&.fadeOut{animation:fadeOut 0.1s forwards;}@media (max-width:580px){flex-direction:column;}"]);
@@ -17853,13 +18018,13 @@ var MagicTooltip = function MagicTooltip(_ref) {
17853
18018
  }
17854
18019
  return;
17855
18020
  }, []);
17856
- return React.createElement(ModalPortal, null, React.createElement(Container$q, {
18021
+ return React.createElement(ModalPortal, null, React.createElement(Container$r, {
17857
18022
  ref: ref
17858
18023
  }, React.createElement(SpellInfoDisplay, {
17859
18024
  spell: spell
17860
18025
  })));
17861
18026
  };
17862
- var Container$q = /*#__PURE__*/styled.div.withConfig({
18027
+ var Container$r = /*#__PURE__*/styled.div.withConfig({
17863
18028
  displayName: "SpellTooltip__Container",
17864
18029
  componentId: "sc-1go0gwg-0"
17865
18030
  })(["position:absolute;z-index:100;pointer-events:none;left:0;top:0;opacity:0;transition:opacity 0.08s;"]);
@@ -17919,7 +18084,7 @@ var Spell = function Spell(_ref) {
17919
18084
  var IMAGE_SCALE = 2;
17920
18085
  return React.createElement(SpellInfoWrapper, {
17921
18086
  spell: spell
17922
- }, React.createElement(Container$r, {
18087
+ }, React.createElement(Container$s, {
17923
18088
  onPointerUp: onPointerUp == null ? void 0 : onPointerUp.bind(null, spellKey),
17924
18089
  isSettingShortcut: isSettingShortcut && !disabled,
17925
18090
  className: "spell"
@@ -17938,7 +18103,7 @@ var Spell = function Spell(_ref) {
17938
18103
  className: "mana"
17939
18104
  }, manaCost))));
17940
18105
  };
17941
- var Container$r = /*#__PURE__*/styled.button.withConfig({
18106
+ var Container$s = /*#__PURE__*/styled.button.withConfig({
17942
18107
  displayName: "Spell__Container",
17943
18108
  componentId: "sc-j96fa2-0"
17944
18109
  })(["display:block;background:none;border:2px solid transparent;border-radius:1rem;width:100%;display:flex;gap:1rem;align-items:center;padding:0 1rem;text-align:left;position:relative;animation:", ";@keyframes border-color-change{0%{border-color:", ";}50%{border-color:transparent;}100%{border-color:", ";}}&:hover,&:focus{background-color:", ";}&:active{background:none;}"], function (_ref2) {
@@ -18017,7 +18182,7 @@ var Spellbook = function Spellbook(_ref) {
18017
18182
  height: "inherit",
18018
18183
  cancelDrag: "#spellbook-search, #shortcuts_list, .spell",
18019
18184
  scale: scale
18020
- }, React.createElement(Container$s, null, React.createElement(Title$b, null, "Learned Spells"), React.createElement(ShortcutsSetter, {
18185
+ }, React.createElement(Container$t, null, React.createElement(Title$b, null, "Learned Spells"), React.createElement(ShortcutsSetter, {
18021
18186
  setSettingShortcutIndex: setSettingShortcutIndex,
18022
18187
  settingShortcutIndex: settingShortcutIndex,
18023
18188
  shortcuts: shortcuts,
@@ -18053,7 +18218,7 @@ var Title$b = /*#__PURE__*/styled.h1.withConfig({
18053
18218
  displayName: "Spellbook__Title",
18054
18219
  componentId: "sc-r02nfq-0"
18055
18220
  })(["font-size:", " !important;margin-bottom:0 !important;"], uiFonts.size.large);
18056
- var Container$s = /*#__PURE__*/styled.div.withConfig({
18221
+ var Container$t = /*#__PURE__*/styled.div.withConfig({
18057
18222
  displayName: "Spellbook__Container",
18058
18223
  componentId: "sc-r02nfq-1"
18059
18224
  })(["width:100%;height:100%;color:white;display:flex;flex-direction:column;"]);
@@ -18174,7 +18339,7 @@ var TradingItemRow = function TradingItemRow(_ref) {
18174
18339
  }
18175
18340
  return null;
18176
18341
  };
18177
- return React.createElement(ItemWrapper, null, React.createElement(ItemIconContainer$1, null, React.createElement(SpriteContainer$2, null, React.createElement(ItemInfoWrapper, {
18342
+ return React.createElement(ItemWrapper, null, React.createElement(ItemIconContainer$1, null, React.createElement(SpriteContainer$3, null, React.createElement(ItemInfoWrapper, {
18178
18343
  atlasIMG: atlasIMG,
18179
18344
  atlasJSON: atlasJSON,
18180
18345
  equipmentSet: equipmentSet,
@@ -18241,7 +18406,7 @@ var ItemIconContainer$1 = /*#__PURE__*/styled.div.withConfig({
18241
18406
  displayName: "TradingItemRow__ItemIconContainer",
18242
18407
  componentId: "sc-mja0b5-4"
18243
18408
  })(["display:flex;justify-content:flex-start;align-items:center;flex:0 0 58px;"]);
18244
- var SpriteContainer$2 = /*#__PURE__*/styled.div.withConfig({
18409
+ var SpriteContainer$3 = /*#__PURE__*/styled.div.withConfig({
18245
18410
  displayName: "TradingItemRow__SpriteContainer",
18246
18411
  componentId: "sc-mja0b5-5"
18247
18412
  })(["position:relative;top:-0.5rem;left:0.5rem;"]);
@@ -18399,11 +18564,11 @@ var Truncate = function Truncate(_ref) {
18399
18564
  var _ref$maxLines = _ref.maxLines,
18400
18565
  maxLines = _ref$maxLines === void 0 ? 1 : _ref$maxLines,
18401
18566
  children = _ref.children;
18402
- return React.createElement(Container$t, {
18567
+ return React.createElement(Container$u, {
18403
18568
  maxLines: maxLines
18404
18569
  }, children);
18405
18570
  };
18406
- var Container$t = /*#__PURE__*/styled.div.withConfig({
18571
+ var Container$u = /*#__PURE__*/styled.div.withConfig({
18407
18572
  displayName: "Truncate__Container",
18408
18573
  componentId: "sc-6x00qb-0"
18409
18574
  })(["display:-webkit-box;max-width:100%;max-height:100%;-webkit-line-clamp:", ";-webkit-box-orient:vertical;overflow:hidden;"], function (props) {