import _defineProperty from '@babel/runtime/helpers/defineProperty';
import { s as styleInject, u as useViewHandler, G as GenericToolTip } from './index-bbdfb97a.js';
import { observer } from 'mobx-react-lite';
import 'react';
import { useHover, useLayer } from 'react-laag';
import classnames from 'classnames';
import { useDivaCore } from '@crystaldesign/diva-core';
import { jsxs, jsx } from 'react/jsx-runtime';

var posnrWrapper = "posnr-wrapper-Y5KDP";
var swiperWrapper = "swiper-wrapper-nEwC5";
var swiperSlide = "swiper-slide-43Id0";
var posnr = "posnr-zpYVY";
var mobile = "mobile-0MfYt";
var isActive = "isActive-mWaAC";
var allIsActive = "allIsActive-iSz9H";
var isSelectable = "isSelectable-FBPGm";
var small = "small-xZ6Og";
var css_248z = ".posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 {\n  font-family: var(--diva-typography-font-family);\n  font-weight: 100;\n  flex-wrap: wrap;\n  align-items: center;\n  font-size: 16px;\n  line-height: 18px;\n  color: var(--secondaryColor);\n  height: 100%;\n  position: relative;\n  max-width: 120px;\n}\n\n.swiper-slide-43Id0 {\n  outline: none;\n}\n\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper {\n  width: 100%;\n  height: 100%;\n}\n\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .posnr-zpYVY {\n  border-radius: var(--articlePosNrRadius);\n  font-size: 16px;\n  line-height: var(--articlePosNrSize);\n  min-width: var(--articlePosNrSize);\n  width: 25px;\n  text-align: center;\n  display: inline-block;\n  margin: 0 1px;\n  transition:\n    box-shadow 0.2s ease,\n    background-color 1s ease,\n    color 1s ease;\n}\n.mobile-0MfYt.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .posnr-zpYVY,\n.mobile-0MfYt.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .posnr-zpYVY.isActive-mWaAC {\n  font-size: 14px;\n  width: 20px;\n}\n\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .posnr-zpYVY:hover {\n  box-shadow: 0 -5px 16px rgba(0, 0, 0, 0.1);\n\n  cursor: pointer;\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .posnr-zpYVY.isActive-mWaAC {\n  color: white;\n  background-color: var(--primaryColor);\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .posnr-zpYVY.allIsActive-iSz9H {\n  color: white;\n  background: var(--primaryColor);\n}\n\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .posnr-zpYVY.isSelectable-FBPGm {\n  color: var(--secondaryColor);\n  background: #eaeaea;\n}\n\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .posnr-zpYVY.small-xZ6Og,\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .posnr-zpYVY.small-xZ6Og.isActive-mWaAC {\n  font-size: 12px;\n}\n\n/**\n * Swiper 11.1.12\n * Most modern mobile touch slider and framework with hardware accelerated transitions\n * https://swiperjs.com\n *\n * Copyright 2014-2024 Vladimir Kharlampidi\n *\n * Released under the MIT License\n *\n * Released on: September 1, 2024\n */\n\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper {\n  margin-left: auto;\n  margin-right: auto;\n  position: relative;\n  overflow: hidden;\n  list-style: none;\n  padding: 0;\n  /* Fix of Webkit flickering */\n  z-index: 1;\n  display: block;\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-vertical > .swiper-wrapper {\n  flex-direction: column;\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-wrapper {\n  position: relative;\n  width: 100%;\n  height: 100%;\n  z-index: 1;\n  display: flex;\n  transition-property: transform;\n  transition-timing-function: initial;\n  transition-timing-function: var(--swiper-wrapper-transition-timing-function, initial);\n  box-sizing: content-box;\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-android .swiper-slide,\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-ios .swiper-slide,\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-wrapper {\n  transform: translate3d(0px, 0, 0);\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-horizontal {\n  touch-action: pan-y;\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-vertical {\n  touch-action: pan-x;\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-slide {\n  flex-shrink: 0;\n  width: -moz-fit-content;\n  width: fit-content;\n  height: 100%;\n  position: relative;\n  transition-property: transform;\n  display: block;\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-slide-invisible-blank {\n  visibility: hidden;\n}\n/* Auto Height */\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-autoheight,\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-autoheight .swiper-slide {\n  height: auto;\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-autoheight .swiper-wrapper {\n  align-items: flex-start;\n  transition-property: transform, height;\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-backface-hidden .swiper-slide {\n  transform: translateZ(0);\n  backface-visibility: hidden;\n}\n/* 3D Effects */\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-3d.swiper-css-mode .swiper-wrapper {\n  perspective: 1200px;\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-3d .swiper-wrapper {\n  transform-style: preserve-3d;\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-3d {\n  perspective: 1200px;\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-3d .swiper-slide,\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-3d .swiper-cube-shadow {\n  transform-style: preserve-3d;\n}\n/* CSS Mode */\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-css-mode > .swiper-wrapper {\n  overflow: auto;\n  scrollbar-width: none;\n  /* For Firefox */\n  -ms-overflow-style: none;\n  /* For Internet Explorer and Edge */\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-css-mode > .swiper-wrapper::-webkit-scrollbar {\n  display: none;\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-css-mode > .swiper-wrapper > .swiper-slide {\n  scroll-snap-align: start start;\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-css-mode.swiper-horizontal > .swiper-wrapper {\n  scroll-snap-type: x mandatory;\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-css-mode.swiper-vertical > .swiper-wrapper {\n  scroll-snap-type: y mandatory;\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-css-mode.swiper-free-mode > .swiper-wrapper {\n  scroll-snap-type: none;\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-css-mode.swiper-free-mode > .swiper-wrapper > .swiper-slide {\n  scroll-snap-align: none;\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-css-mode.swiper-centered > .swiper-wrapper::before {\n  content: '';\n  flex-shrink: 0;\n  order: 9999;\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-css-mode.swiper-centered > .swiper-wrapper > .swiper-slide {\n  scroll-snap-align: center center;\n  scroll-snap-stop: always;\n}\n[dir=\"ltr\"] .posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-css-mode.swiper-centered.swiper-horizontal > .swiper-wrapper > .swiper-slide:first-child {\n  margin-left: var(--swiper-centered-offset-before);\n}\n[dir=\"rtl\"] .posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-css-mode.swiper-centered.swiper-horizontal > .swiper-wrapper > .swiper-slide:first-child {\n  margin-right: var(--swiper-centered-offset-before);\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-css-mode.swiper-centered.swiper-horizontal > .swiper-wrapper::before {\n  height: 100%;\n  min-height: 1px;\n  width: var(--swiper-centered-offset-after);\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-css-mode.swiper-centered.swiper-vertical > .swiper-wrapper > .swiper-slide:first-child {\n  margin-top: var(--swiper-centered-offset-before);\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-css-mode.swiper-centered.swiper-vertical > .swiper-wrapper::before {\n  width: 100%;\n  min-width: 1px;\n  height: var(--swiper-centered-offset-after);\n}\n/* Slide styles start */\n/* 3D Shadows */\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-3d .swiper-slide-shadow,\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-3d .swiper-slide-shadow-left,\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-3d .swiper-slide-shadow-right,\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-3d .swiper-slide-shadow-top,\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-3d .swiper-slide-shadow-bottom,\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-3d .swiper-slide-shadow,\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-3d .swiper-slide-shadow-left,\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-3d .swiper-slide-shadow-right,\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-3d .swiper-slide-shadow-top,\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-3d .swiper-slide-shadow-bottom {\n  position: absolute;\n  left: 0;\n  top: 0;\n  width: 100%;\n  height: 100%;\n  pointer-events: none;\n  z-index: 10;\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-3d .swiper-slide-shadow {\n  background: rgba(0, 0, 0, 0.15);\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-3d .swiper-slide-shadow-left {\n  background-image: linear-gradient(to left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-3d .swiper-slide-shadow-right {\n  background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-3d .swiper-slide-shadow-top {\n  background-image: linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-3d .swiper-slide-shadow-bottom {\n  background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-lazy-preloader {\n  width: 42px;\n  height: 42px;\n  position: absolute;\n  left: 50%;\n  top: 50%;\n  margin-left: -21px;\n  margin-top: -21px;\n  z-index: 10;\n  transform-origin: 50%;\n  box-sizing: border-box;\n  border: 4px solid var(--swiper-theme-color);\n  border: 4px solid var(--swiper-preloader-color, var(--swiper-theme-color));\n  border-radius: 50%;\n  border-top-color: transparent;\n}\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper:not(.swiper-watch-progress) .swiper-lazy-preloader,\n.posnr-wrapper-Y5KDP.swiper-wrapper-nEwC5 .swiper-watch-progress .swiper-slide-visible .swiper-lazy-preloader {\n  animation: swiper-preloader-spin 1s infinite linear;\n}\n";
styleInject(css_248z);

function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var SettingsPosNr = function SettingsPosNr(_ref) {
  var _renderLayer;
  var id = _ref.id;
  var viewHandler = useViewHandler();
  var article = viewHandler.settingsState.articleInfos[id];
  var _useDivaCore = useDivaCore(),
    _useDivaCore$state$di = _useDivaCore.state.dimensions,
    isMobile = _useDivaCore$state$di.isMobile,
    isTablet = _useDivaCore$state$di.isTablet;
  /* tool tip stuff*/
  var triggerProps = {};
  var layerProps = {};
  var renderLayer = undefined;
  var isOver = false;
  var hoverProps = {};
  var hover = useHover({
    delayEnter: 1500,
    hideOnScroll: true
  });
  var tooltip = useLayer({
    isOpen: hover[0],
    auto: true,
    placement: viewHandler.getViewConfig().tooltipPosition || 'left-center'
  });
  if (!isMobile && !isTablet && !viewHandler.getViewConfig().hideTooltip) {
    isOver = hover[0];
    hoverProps = hover[1];
    triggerProps = tooltip.triggerProps;
    layerProps = tooltip.layerProps;
    renderLayer = tooltip.renderLayer;
  }
  return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread(_objectSpread({
    onClick: function onClick() {
      return viewHandler.paletteViewHandler.articleInfoSelected(Number(id));
    },
    id: "ArticleInfo",
    className: classnames(posnr, viewHandler.settingsState.allArticlesAreActive ? allIsActive : article.isActive ? isActive : isSelectable, article.posNr.toString().length > 2 ? small : undefined)
  }, triggerProps), hoverProps), {}, {
    children: [article.posNr, isOver && ((_renderLayer = renderLayer) === null || _renderLayer === void 0 ? void 0 : _renderLayer(/*#__PURE__*/jsx(GenericToolTip, {
      text: article.name,
      price: article.singlePrice,
      codex: article.codex,
      image: article.image,
      layerProps: layerProps
    }, article.codex)))]
  }), id);
};
var SettingsPosNr$1 = observer(SettingsPosNr);

var index = /*#__PURE__*/Object.freeze({
  __proto__: null,
  'default': SettingsPosNr$1
});

export { SettingsPosNr$1 as S, swiperSlide as a, index as i, mobile as m, posnrWrapper as p, swiperWrapper as s };
