@eventlook/sdk 1.4.49 → 1.4.50

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 (84) hide show
  1. package/dist/cjs/form/PaymentOverviewBox.js +0 -6
  2. package/dist/cjs/form/PaymentOverviewBox.js.map +1 -1
  3. package/dist/cjs/form/ReleaseWithMerchandise.js +48 -57
  4. package/dist/cjs/form/ReleaseWithMerchandise.js.map +1 -1
  5. package/dist/cjs/form/TicketSelection.js +6 -5
  6. package/dist/cjs/form/TicketSelection.js.map +1 -1
  7. package/dist/cjs/form/TicketWithMerchandiseSelection.js +5 -3
  8. package/dist/cjs/form/TicketWithMerchandiseSelection.js.map +1 -1
  9. package/dist/cjs/form/services/index.js +1 -18
  10. package/dist/cjs/form/services/index.js.map +1 -1
  11. package/dist/cjs/hooks/useFirstRender.js +14 -0
  12. package/dist/cjs/hooks/useFirstRender.js.map +1 -0
  13. package/dist/esm/form/PaymentOverviewBox.js +0 -6
  14. package/dist/esm/form/PaymentOverviewBox.js.map +1 -1
  15. package/dist/esm/form/ReleaseWithMerchandise.js +49 -58
  16. package/dist/esm/form/ReleaseWithMerchandise.js.map +1 -1
  17. package/dist/esm/form/TicketSelection.js +6 -5
  18. package/dist/esm/form/TicketSelection.js.map +1 -1
  19. package/dist/esm/form/TicketWithMerchandiseSelection.js +6 -4
  20. package/dist/esm/form/TicketWithMerchandiseSelection.js.map +1 -1
  21. package/dist/esm/form/services/index.js +2 -19
  22. package/dist/esm/form/services/index.js.map +1 -1
  23. package/dist/esm/hooks/useFirstRender.js +12 -0
  24. package/dist/esm/hooks/useFirstRender.js.map +1 -0
  25. package/dist/types/locales/cs.d.ts +5 -1
  26. package/package.json +1 -1
  27. package/src/form/PaymentOverviewBox.tsx +11 -11
  28. package/src/form/services/index.tsx +36 -36
  29. package/dist/cjs/_virtual/_commonjsHelpers.js +0 -8
  30. package/dist/cjs/_virtual/_commonjsHelpers.js.map +0 -1
  31. package/dist/cjs/_virtual/index.js +0 -6
  32. package/dist/cjs/_virtual/index.js.map +0 -1
  33. package/dist/cjs/_virtual/index2.js +0 -6
  34. package/dist/cjs/_virtual/index2.js.map +0 -1
  35. package/dist/cjs/_virtual/index3.js +0 -6
  36. package/dist/cjs/_virtual/index3.js.map +0 -1
  37. package/dist/cjs/_virtual/react-is.development.js +0 -6
  38. package/dist/cjs/_virtual/react-is.development.js.map +0 -1
  39. package/dist/cjs/_virtual/react-is.development2.js +0 -6
  40. package/dist/cjs/_virtual/react-is.development2.js.map +0 -1
  41. package/dist/cjs/_virtual/react-is.production.js +0 -6
  42. package/dist/cjs/_virtual/react-is.production.js.map +0 -1
  43. package/dist/cjs/_virtual/react-is.production.min.js +0 -6
  44. package/dist/cjs/_virtual/react-is.production.min.js.map +0 -1
  45. package/dist/cjs/form/TicketQuantityControl.js +0 -51
  46. package/dist/cjs/form/TicketQuantityControl.js.map +0 -1
  47. package/dist/cjs/form/TicketSelectionMobile.js +0 -98
  48. package/dist/cjs/form/TicketSelectionMobile.js.map +0 -1
  49. package/dist/cjs/form/merchendise/MerchandiseSelection.js +0 -19
  50. package/dist/cjs/form/merchendise/MerchandiseSelection.js.map +0 -1
  51. package/dist/cjs/form/merchendise/MerchandiseSlider.js +0 -75
  52. package/dist/cjs/form/merchendise/MerchandiseSlider.js.map +0 -1
  53. package/dist/cjs/hooks/useConsentScrollOnDrawerOpen.js +0 -59
  54. package/dist/cjs/hooks/useConsentScrollOnDrawerOpen.js.map +0 -1
  55. package/dist/esm/_virtual/_commonjsHelpers.js +0 -6
  56. package/dist/esm/_virtual/_commonjsHelpers.js.map +0 -1
  57. package/dist/esm/_virtual/index.js +0 -4
  58. package/dist/esm/_virtual/index.js.map +0 -1
  59. package/dist/esm/_virtual/index2.js +0 -4
  60. package/dist/esm/_virtual/index2.js.map +0 -1
  61. package/dist/esm/_virtual/index3.js +0 -4
  62. package/dist/esm/_virtual/index3.js.map +0 -1
  63. package/dist/esm/_virtual/react-is.development.js +0 -4
  64. package/dist/esm/_virtual/react-is.development.js.map +0 -1
  65. package/dist/esm/_virtual/react-is.development2.js +0 -4
  66. package/dist/esm/_virtual/react-is.development2.js.map +0 -1
  67. package/dist/esm/_virtual/react-is.production.js +0 -4
  68. package/dist/esm/_virtual/react-is.production.js.map +0 -1
  69. package/dist/esm/_virtual/react-is.production.min.js +0 -4
  70. package/dist/esm/_virtual/react-is.production.min.js.map +0 -1
  71. package/dist/esm/form/TicketQuantityControl.js +0 -47
  72. package/dist/esm/form/TicketQuantityControl.js.map +0 -1
  73. package/dist/esm/form/TicketSelectionMobile.js +0 -94
  74. package/dist/esm/form/TicketSelectionMobile.js.map +0 -1
  75. package/dist/esm/form/merchendise/MerchandiseSelection.js +0 -15
  76. package/dist/esm/form/merchendise/MerchandiseSelection.js.map +0 -1
  77. package/dist/esm/form/merchendise/MerchandiseSlider.js +0 -71
  78. package/dist/esm/form/merchendise/MerchandiseSlider.js.map +0 -1
  79. package/dist/esm/hooks/useConsentScrollOnDrawerOpen.js +0 -55
  80. package/dist/esm/hooks/useConsentScrollOnDrawerOpen.js.map +0 -1
  81. package/dist/types/form/PaymentOverviewDrawer.d.ts +0 -8
  82. package/dist/types/form/merchendise/MerchandiseSelection.d.ts +0 -9
  83. package/dist/types/form/merchendise/MerchandiseSlider.d.ts +0 -10
  84. package/dist/types/form/merchendise/MerchendiseSlider.d.ts +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"MerchandiseSlider.js","sources":["../../../../src/form/merchendise/MerchandiseSlider.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport useEmblaCarousel from 'embla-carousel-react';\nimport { Box, SxProps } from '@mui/material';\nimport { useTheme } from '@mui/material/styles';\nimport { IEventProduct } from '@utils/types/event-product.type';\nimport ProductCard from '@form/product/ProductCard';\n\ninterface Props {\n // title: string;\n // icon: string;\n sx?: SxProps;\n eventProducts: IEventProduct[];\n eventId: number;\n}\n\nconst MerchandiseSlider: React.FC<Props> = ({ eventProducts, eventId, sx }) => {\n const [emblaRef, emblaApi] = useEmblaCarousel();\n const theme = useTheme();\n\n const [totalSlides, setTotalSlides] = useState<number>(0);\n const [activeSlide, setActiveSlide] = useState<number>(0);\n const [activeSlides, setActiveSlides] = useState<number>(0);\n\n const calculateTotal = useCallback(() => {\n if (!emblaApi) return;\n const slides = emblaApi.slideNodes().length || 0;\n const slidesInView = emblaApi.slidesInView();\n setActiveSlides(slidesInView.length);\n setTotalSlides(slides);\n const activeSlide = slidesInView[0];\n setActiveSlide(slidesInView.length > 4 ? slidesInView[1] : activeSlide || 0);\n }, [emblaApi]);\n\n const onNext = useCallback(() => {\n if (emblaApi) emblaApi.scrollNext();\n }, [emblaApi]);\n\n const onPrev = useCallback(() => {\n if (emblaApi) emblaApi.scrollPrev();\n }, [emblaApi]);\n\n useEffect(() => {\n if (!emblaApi) return;\n\n calculateTotal();\n\n emblaApi.on('reInit', calculateTotal);\n emblaApi.on('slidesChanged', calculateTotal);\n emblaApi.on('slidesInView', calculateTotal);\n\n return () => {\n emblaApi.off('reInit', calculateTotal);\n emblaApi.off('slidesChanged', calculateTotal);\n emblaApi.off('slidesInView', calculateTotal);\n };\n }, [emblaApi, calculateTotal]);\n\n const isActive = (index: number) => index >= activeSlide && index <= activeSlide + 2;\n\n return (\n <Box sx={sx}>\n {/* <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" mb={2}>\n <EventTitle title={title} icon={icon} />\n {events.length > 1 && (\n <EventSliderArrows\n active={activeSlide + 1}\n total={totalSlides}\n onNext={onNext}\n onPrev={onPrev}\n />\n )}\n </Stack> */}\n <Box\n sx={{\n overflow: 'hidden',\n padding: theme.spacing(8, 3),\n margin: theme.spacing(-8, -3),\n }}\n >\n <Box ref={emblaRef} className=\"embla\" sx={{ overflow: 'visible' }}>\n <Box\n className=\"embla__container\"\n sx={{\n display: 'flex',\n // marginLeft: theme.spacing(-2),\n // marginRight: theme.spacing(-2),\n }}\n >\n {eventProducts.map((eventProduct, index) => (\n <Box\n key={`event-slide-${index}`}\n className=\"embla__slide\"\n sx={{\n flex: `0 0 ${eventProducts.length > 1 ? '78%' : '100%'}`,\n minWidth: 0,\n margin: `0 ${theme.spacing(1)}`,\n transition: 'opacity 0.2s ease',\n [theme.breakpoints.up('sm')]: {\n flex: '0 0 43%',\n },\n [theme.breakpoints.up('md')]: {\n flex: '0 0 33.3333%',\n },\n }}\n >\n {/* <EventItem\n {...event}\n sx={{\n boxShadow: isActive(index) ? theme.customShadows.z8 : 'none',\n '&:hover': {\n boxShadow: theme.customShadows.z12,\n },\n }}\n /> */}\n\n <ProductCard eventProduct={eventProduct} eventId={eventId} isOnlyMerchandise />\n </Box>\n ))}\n </Box>\n </Box>\n </Box>\n </Box>\n );\n};\n\nexport default MerchandiseSlider;\n"],"names":["useTheme","useState","useCallback","useEffect","Box","ProductCard"],"mappings":";;;;;;;;;;AAeA,MAAM,iBAAiB,GAAoB,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,EAAE,EAAE,KAAI;IAC5E,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,gBAAgB,EAAE;AAC/C,IAAA,MAAM,KAAK,GAAGA,eAAQ,EAAE;IAExB,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAGC,cAAQ,CAAS,CAAC,CAAC;IACzD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAGA,cAAQ,CAAS,CAAC,CAAC;IACzD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAGA,cAAQ,CAAS,CAAC,CAAC;AAE3D,IAAA,MAAM,cAAc,GAAGC,iBAAW,CAAC,MAAK;AACtC,QAAA,IAAI,CAAC,QAAQ;YAAE;QACf,MAAM,MAAM,GAAG,QAAQ,CAAC,UAAU,EAAE,CAAC,MAAM,IAAI,CAAC;AAChD,QAAA,MAAM,YAAY,GAAG,QAAQ,CAAC,YAAY,EAAE;AAC5C,QAAA,eAAe,CAAC,YAAY,CAAC,MAAM,CAA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AA,EAAA,CAAG,CAC3E,CACP,CAAC,CACE,CACF,CACF,CACF;AAEV;;;;"}
@@ -1,59 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var React = require('react');
6
-
7
- function useConsentScrollOnDrawerOpen({ isDrawerOpen, consentRef, }) {
8
- const [isNearConsentSection, setIsNearConsentSection] = React.useState(false);
9
- React.useEffect(() => {
10
- const consentElement = consentRef.current;
11
- if (!consentElement) {
12
- return;
13
- }
14
- if (!('IntersectionObserver' in window)) {
15
- setIsNearConsentSection(true);
16
- return;
17
- }
18
- const observer = new IntersectionObserver((entries) => {
19
- const entry = entries[0];
20
- setIsNearConsentSection(entry.isIntersecting);
21
- }, {
22
- root: null,
23
- threshold: 0,
24
- rootMargin: '0px 0px 140px 0px',
25
- });
26
- observer.observe(consentElement);
27
- return () => {
28
- observer.disconnect();
29
- };
30
- }, [consentRef]);
31
- React.useEffect(() => {
32
- if (!isDrawerOpen) {
33
- return;
34
- }
35
- if (window.matchMedia('(min-width:900px)').matches) {
36
- return;
37
- }
38
- if (!isNearConsentSection) {
39
- return;
40
- }
41
- let frameId = 0;
42
- let frameId2 = 0;
43
- frameId = window.requestAnimationFrame(() => {
44
- frameId2 = window.requestAnimationFrame(() => {
45
- consentRef.current?.scrollIntoView({
46
- behavior: 'smooth',
47
- block: 'center',
48
- });
49
- });
50
- });
51
- return () => {
52
- window.cancelAnimationFrame(frameId);
53
- window.cancelAnimationFrame(frameId2);
54
- };
55
- }, [consentRef, isDrawerOpen, isNearConsentSection]);
56
- }
57
-
58
- exports.default = useConsentScrollOnDrawerOpen;
59
- //# sourceMappingURL=useConsentScrollOnDrawerOpen.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useConsentScrollOnDrawerOpen.js","sources":["../../../src/hooks/useConsentScrollOnDrawerOpen.ts"],"sourcesContent":["import { RefObject, useEffect, useState } from 'react';\n\ninterface UseConsentScrollOnDrawerOpenProps {\n isDrawerOpen: boolean;\n consentRef: RefObject<HTMLElement | null>;\n}\n\nexport default function useConsentScrollOnDrawerOpen({\n isDrawerOpen,\n consentRef,\n}: UseConsentScrollOnDrawerOpenProps) {\n const [isNearConsentSection, setIsNearConsentSection] = useState(false);\n\n useEffect(() => {\n const consentElement = consentRef.current;\n if (!consentElement) {\n return;\n }\n\n if (!('IntersectionObserver' in window)) {\n setIsNearConsentSection(true);\n return;\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n const entry = entries[0];\n setIsNearConsentSection(entry.isIntersecting);\n },\n {\n root: null,\n threshold: 0,\n rootMargin: '0px 0px 140px 0px',\n }\n );\n\n observer.observe(consentElement);\n\n return () => {\n observer.disconnect();\n };\n }, [consentRef]);\n\n useEffect(() => {\n if (!isDrawerOpen) {\n return;\n }\n\n if (window.matchMedia('(min-width:900px)').matches) {\n return;\n }\n\n if (!isNearConsentSection) {\n return;\n }\n\n let frameId = 0;\n let frameId2 = 0;\n frameId = window.requestAnimationFrame(() => {\n frameId2 = window.requestAnimationFrame(() => {\n consentRef.current?.scrollIntoView({\n behavior: 'smooth',\n block: 'center',\n });\n });\n });\n\n return () => {\n window.cancelAnimationFrame(frameId);\n window.cancelAnimationFrame(frameId2);\n };\n }, [consentRef, isDrawerOpen, isNearConsentSection]);\n}\n"],"names":["useState","useEffect"],"mappings":";;;;;;AAOc,SAAU,4BAA4B,CAAC,EACnD,YAAY,EACZ,UAAU,GACwB,EAAA;IAClC,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GAAGA,cAAQ,CAAC,KAAK,CAAC;IAEvEC,eAAS,CAAC,MAAK;AACb,QAAA,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO;QACzC,IAAI,CAAC,cAAc,EAAE;YACnB;;AAGF,QAAA,IAAI,EAAE,sBAAsB,IAAI,MAAM,CAAC,EAAE;YACvC,uBAAuB,CAAC,IAAI,CAAC;YAC7B;;QAGF,MAAM,QAAQ,GAAG,IAAI,oBAAoB,CACvC,CAAC,OAA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
3
- }
4
-
5
- export { getDefaultExportFromCjs };
6
- //# sourceMappingURL=_commonjsHelpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_commonjsHelpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1,4 +0,0 @@
1
- var propTypes = {exports: {}};
2
-
3
- export { propTypes as __module };
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,4 +0,0 @@
1
- var reactIs = {exports: {}};
2
-
3
- export { reactIs as __module };
4
- //# sourceMappingURL=index2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,4 +0,0 @@
1
- var reactIs = {exports: {}};
2
-
3
- export { reactIs as __module };
4
- //# sourceMappingURL=index3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,4 +0,0 @@
1
- var reactIs_development = {};
2
-
3
- export { reactIs_development as __exports };
4
- //# sourceMappingURL=react-is.development.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-is.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,4 +0,0 @@
1
- var reactIs_development = {};
2
-
3
- export { reactIs_development as __exports };
4
- //# sourceMappingURL=react-is.development2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-is.development2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,4 +0,0 @@
1
- var reactIs_production = {};
2
-
3
- export { reactIs_production as __exports };
4
- //# sourceMappingURL=react-is.production.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-is.production.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,4 +0,0 @@
1
- var reactIs_production_min = {};
2
-
3
- export { reactIs_production_min as __exports };
4
- //# sourceMappingURL=react-is.production.min.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-is.production.min.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,47 +0,0 @@
1
- import React from 'react';
2
- import { Stack, IconButton, Box, Button } from '@mui/material';
3
- import Iconify from '../components/iconify/Iconify.js';
4
-
5
- const TicketQuantityControl = ({ quantity, isDisabled, canAddFirst, canAddMore, addLabel, onDecrement, onIncrement, onAddFirst, }) => {
6
- if (quantity > 0) {
7
- return (React.createElement(Stack, { direction: "row", spacing: 0.5, alignItems: "center" },
8
- React.createElement(IconButton, { onClick: onDecrement, disabled: isDisabled || quantity <= 0, sx: {
9
- width: 32,
10
- height: 32,
11
- borderRadius: 1,
12
- border: '1px solid',
13
- borderColor: 'grey.300',
14
- } },
15
- React.createElement(Iconify, { icon: "eva:minus-fill" })),
16
- React.createElement(Box, { sx: {
17
- width: 32,
18
- height: 32,
19
- borderRadius: 1,
20
- border: '1px solid',
21
- borderColor: 'grey.300',
22
- display: 'flex',
23
- alignItems: 'center',
24
- justifyContent: 'center',
25
- fontWeight: 600,
26
- } }, quantity),
27
- React.createElement(IconButton, { onClick: onIncrement, disabled: isDisabled || !canAddMore, sx: {
28
- width: 32,
29
- height: 32,
30
- borderRadius: 1,
31
- bgcolor: 'primary.main',
32
- color: 'primary.contrastText',
33
- '&:hover': { bgcolor: 'primary.dark' },
34
- } },
35
- React.createElement(Iconify, { icon: "eva:plus-fill" }))));
36
- }
37
- return (React.createElement(Button, { variant: "contained", onClick: onAddFirst, disabled: isDisabled || !canAddFirst, sx: {
38
- height: 32,
39
- borderRadius: 1,
40
- px: 3,
41
- textTransform: 'none',
42
- fontWeight: 600,
43
- } }, addLabel));
44
- };
45
-
46
- export { TicketQuantityControl as default };
47
- //# sourceMappingURL=TicketQuantityControl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TicketQuantityControl.js","sources":["../../../src/form/TicketQuantityControl.tsx"],"sourcesContent":["import React from 'react';\nimport { Box, Button, IconButton, Stack } from '@mui/material';\nimport { Iconify } from '@components/iconify';\n\ninterface TicketQuantityControlProps {\n quantity: number;\n isDisabled: boolean;\n canAddFirst: boolean;\n canAddMore: boolean;\n addLabel: string;\n onDecrement: () => void;\n onIncrement: () => void;\n onAddFirst: () => void;\n}\n\nconst TicketQuantityControl: React.FC<TicketQuantityControlProps> = ({\n quantity,\n isDisabled,\n canAddFirst,\n canAddMore,\n addLabel,\n onDecrement,\n onIncrement,\n onAddFirst,\n}) => {\n if (quantity > 0) {\n return (\n <Stack direction=\"row\" spacing={0.5} alignItems=\"center\">\n <IconButton\n onClick={onDecrement}\n disabled={isDisabled || quantity <= 0}\n sx={{\n width: 32,\n height: 32,\n borderRadius: 1,\n border: '1px solid',\n borderColor: 'grey.300',\n }}\n >\n <Iconify icon=\"eva:minus-fill\" />\n </IconButton>\n <Box\n sx={{\n width: 32,\n height: 32,\n borderRadius: 1,\n border: '1px solid',\n borderColor: 'grey.300',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n fontWeight: 600,\n }}\n >\n {quantity}\n </Box>\n <IconButton\n onClick={onIncrement}\n disabled={isDisabled || !canAddMore}\n sx={{\n width: 32,\n height: 32,\n borderRadius: 1,\n bgcolor: 'primary.main',\n color: 'primary.contrastText',\n '&:hover': { bgcolor: 'primary.dark' },\n }}\n >\n <Iconify icon=\"eva:plus-fill\" />\n </IconButton>\n </Stack>\n );\n }\n\n return (\n <Button\n variant=\"contained\"\n onClick={onAddFirst}\n disabled={isDisabled || !canAddFirst}\n sx={{\n height: 32,\n borderRadius: 1,\n px: 3,\n textTransform: 'none',\n fontWeight: 600,\n }}\n >\n {addLabel}\n </Button>\n );\n};\n\nexport default TicketQuantityControl;\n"],"names":[],"mappings":";;;;AAeA,MAAM,qBAAqB,GAAyC,CAAC,EACnE,QAAQ,EACR,UAAU,EACV,WAAW,EACX,UAAU,EACV,QAAQ,EACR,WAAW,EACX,WAAW,EACX,UAAU,GACX,KAAI;AAC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B,oBAAA,SAAS,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;AACvC,iBAAA,EAAA;gBAED,KAAA,CAAA,aAAA,CAAC,OAAO,IAAC,IAAI,EAAC,eAAe,EAAA,CAAG,CACrB,CACP;;IAIZ,QACE,oBAAC,MAAM,EAAA,EACL,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,UAAU,IAAI,CAAC,WAAW,EACpC,EAAE,EAAE;AACF,YAAA,MAAM,EAAE,EAAE;AACV,YAAA,YAAY,EAAE,CAAC;AACf,YAAA,EAAE,EAAE,CAAC;AACL,YAAA,aAAa,EAAE,MAAM;AACrB,YAAA,UAAU,EAAE,GAAG;SAChB,EAAA,EAEA,QAAQ,CACF;AAEb;;;;"}
@@ -1,94 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { Stack, Skeleton, Box, Typography, Button, Collapse } from '@mui/material';
3
- import Iconify from '../components/iconify/Iconify.js';
4
- import { fCurrency } from '../utils/formatNumber.js';
5
- import useGlobal from '../hooks/useGlobal.js';
6
- import TicketQuantityControl from './tickets/TicketQuantityControl.js';
7
-
8
- const TicketSelectionMobile = ({ event, activeReleases, showLoading, soldOutReleaseCategoryNames, tickets, isQuantityDisabled, setValue, removeTicket, getExtraFields, }) => {
9
- const { t, lang } = useGlobal();
10
- const [expandedReleaseIds, setExpandedReleaseIds] = useState({});
11
- const getReleaseTitle = (release) => release.releaseCategoryName || release.name || '';
12
- const getTicketIndexByRelease = (releaseId) => tickets.findIndex((ticket) => ticket.releaseId === releaseId);
13
- const getReleaseQuantity = (releaseId) => {
14
- const ticket = tickets.find((t) => t.releaseId === releaseId);
15
- return Number(ticket?.quantity || 0);
16
- };
17
- const updateReleaseQuantity = (release, nextQuantity) => {
18
- const maxAvailable = Math.min(release.availableTickets || 0, 10);
19
- const clampedQuantity = Math.max(0, Math.min(nextQuantity, maxAvailable));
20
- const ticketIndex = getTicketIndexByRelease(release.id);
21
- if (clampedQuantity <= 0) {
22
- if (ticketIndex >= 0)
23
- removeTicket(ticketIndex);
24
- return;
25
- }
26
- if (ticketIndex >= 0) {
27
- setValue(`tickets.${event.id}.${ticketIndex}.quantity`, clampedQuantity);
28
- return;
29
- }
30
- setValue(`tickets.${event.id}`, [
31
- ...tickets,
32
- {
33
- releaseId: release.id,
34
- quantity: clampedQuantity,
35
- itemName: getReleaseTitle(release),
36
- price: release.price || 0,
37
- products: [],
38
- extraFields: [],
39
- },
40
- ]);
41
- };
42
- const toggleReleaseDescription = (releaseId) => setExpandedReleaseIds((prev) => ({
43
- ...prev,
44
- [releaseId]: !prev[releaseId],
45
- }));
46
- if (showLoading) {
47
- return (React.createElement(Stack, { spacing: 2 }, [...Array(2)].map((_, index) => (React.createElement(Skeleton, { key: index, variant: "rounded", sx: {
48
- width: '100%',
49
- height: (theme) => theme.spacing(12),
50
- } })))));
51
- }
52
- return (React.createElement(Stack, { spacing: 2 }, activeReleases?.map((release) => {
53
- const quantity = getReleaseQuantity(release.id);
54
- const ticketIndex = getTicketIndexByRelease(release.id);
55
- const maxAvailable = Math.min(release.availableTickets || 0, 10);
56
- const isLocked = release.locked && !soldOutReleaseCategoryNames.includes(release.releaseCategoryName);
57
- const isDisabled = isLocked && quantity === 0;
58
- const canAddFirst = maxAvailable > 0 && !isQuantityDisabled(1, release.id);
59
- const canAddMore = quantity < maxAvailable && !isQuantityDisabled(quantity + 1, release.id);
60
- const hasDescription = Boolean(release.description);
61
- return (React.createElement(Box, { key: release.id, sx: {
62
- p: 1,
63
- pb: 0,
64
- borderRadius: 1,
65
- bgcolor: 'grey.100',
66
- } },
67
- React.createElement(Stack, { spacing: 0 },
68
- React.createElement(Box, null,
69
- React.createElement(Typography, { variant: "subtitle1", fontWeight: 600 }, getReleaseTitle(release))),
70
- React.createElement(Stack, { direction: "row", alignItems: "center", justifyContent: "space-between" },
71
- React.createElement(Stack, null,
72
- React.createElement(Typography, { variant: "body2" }, release.price === 0
73
- ? t('free')
74
- : fCurrency(release.price, lang, event.currency)),
75
- hasDescription && (React.createElement(Button, { size: "small", onClick: () => toggleReleaseDescription(release.id), endIcon: React.createElement(Iconify, { icon: expandedReleaseIds[release.id]
76
- ? 'eva:chevron-up-fill'
77
- : 'eva:chevron-down-fill' }), sx: {
78
- px: 0,
79
- minWidth: 'auto',
80
- textTransform: 'none',
81
- color: 'text.primary',
82
- textDecoration: 'underline',
83
- fontWeight: 400,
84
- '& .MuiButton-endIcon': { ml: 0.3 },
85
- } }, t('more_info')))),
86
- React.createElement(TicketQuantityControl, { quantity: quantity, isDisabled: isDisabled, canAddFirst: canAddFirst, canAddMore: canAddMore, addLabel: t('add'), onDecrement: () => updateReleaseQuantity(release, quantity - 1), onIncrement: () => updateReleaseQuantity(release, quantity + 1), onAddFirst: () => updateReleaseQuantity(release, 1) })),
87
- hasDescription && (React.createElement(Collapse, { in: Boolean(expandedReleaseIds[release.id]) },
88
- React.createElement(Typography, { variant: "body2", color: "text.secondary" }, release.description))),
89
- ticketIndex >= 0 && getExtraFields(release.id, ticketIndex))));
90
- })));
91
- };
92
-
93
- export { TicketSelectionMobile as default };
94
- //# sourceMappingURL=TicketSelectionMobile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TicketSelectionMobile.js","sources":["../../../src/form/TicketSelectionMobile.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Box, Button, Collapse, Skeleton, Stack, Typography } from '@mui/material';\nimport { Iconify } from '@components/iconify';\nimport { fCurrency } from '@utils/formatNumber';\nimport { IEvent } from '@utils/types/event.type';\nimport { IReleaseShort } from '@utils/types/release.type';\nimport { ITicketFormTicket } from '@utils/types/ticket.type';\nimport useGlobal from '@hooks/useGlobal';\nimport TicketQuantityControl from './tickets/TicketQuantityControl';\n\ninterface Props {\n event: IEvent;\n activeReleases?: IReleaseShort[];\n showLoading: boolean;\n soldOutReleaseCategoryNames: string[];\n tickets: ITicketFormTicket[];\n isQuantityDisabled: (value: number, releaseId: number | '') => boolean;\n setValue: (name: string, value: any) => void;\n removeTicket: (indexToRemove: number) => void;\n getExtraFields: (releaseId: number | '', index: number) => React.ReactNode;\n}\n\nconst TicketSelectionMobile: React.FC<Props> = ({\n event,\n activeReleases,\n showLoading,\n soldOutReleaseCategoryNames,\n tickets,\n isQuantityDisabled,\n setValue,\n removeTicket,\n getExtraFields,\n}) => {\n const { t, lang } = useGlobal();\n const [expandedReleaseIds, setExpandedReleaseIds] = useState<Record<number, boolean>>({});\n\n const getReleaseTitle = (release: IReleaseShort) =>\n release.releaseCategoryName || release.name || '';\n\n const getTicketIndexByRelease = (releaseId: number) =>\n tickets.findIndex((ticket) => ticket.releaseId === releaseId);\n\n const getReleaseQuantity = (releaseId: number) => {\n const ticket = tickets.find((t) => t.releaseId === releaseId);\n return Number(ticket?.quantity || 0);\n };\n\n const updateReleaseQuantity = (release: IReleaseShort, nextQuantity: number) => {\n const maxAvailable = Math.min(release.availableTickets || 0, 10);\n const clampedQuantity = Math.max(0, Math.min(nextQuantity, maxAvailable));\n const ticketIndex = getTicketIndexByRelease(release.id);\n\n if (clampedQuantity <= 0) {\n if (ticketIndex >= 0) removeTicket(ticketIndex);\n return;\n }\n\n if (ticketIndex >= 0) {\n setValue(`tickets.${event.id}.${ticketIndex}.quantity`, clampedQuantity);\n return;\n }\n\n setValue(`tickets.${event.id}`, [\n ...tickets,\n {\n releaseId: release.id,\n quantity: clampedQuantity,\n itemName: getReleaseTitle(release),\n price: release.price || 0,\n products: [],\n extraFields: [],\n },\n ]);\n };\n\n const toggleReleaseDescription = (releaseId: number) =>\n setExpandedReleaseIds((prev) => ({\n ...prev,\n [releaseId]: !prev[releaseId],\n }));\n\n if (showLoading) {\n return (\n <Stack spacing={2}>\n {[...Array(2)].map((_, index) => (\n <Skeleton\n key={index}\n variant=\"rounded\"\n sx={{\n width: '100%',\n height: (theme) => theme.spacing(12),\n }}\n />\n ))}\n </Stack>\n );\n }\n\n return (\n <Stack spacing={2}>\n {activeReleases?.map((release) => {\n const quantity = getReleaseQuantity(release.id);\n const ticketIndex = getTicketIndexByRelease(release.id);\n const maxAvailable = Math.min(release.availableTickets || 0, 10);\n const isLocked =\n release.locked && !soldOutReleaseCategoryNames.includes(release.releaseCategoryName);\n const isDisabled = isLocked && quantity === 0;\n const canAddFirst = maxAvailable > 0 && !isQuantityDisabled(1, release.id);\n const canAddMore = quantity < maxAvailable && !isQuantityDisabled(quantity + 1, release.id);\n const hasDescription = Boolean(release.description);\n\n return (\n <Box\n key={release.id}\n sx={{\n p: 1,\n pb: 0,\n borderRadius: 1,\n bgcolor: 'grey.100',\n }}\n >\n <Stack spacing={0}>\n <Box>\n <Typography variant=\"subtitle1\" fontWeight={600}>\n {getReleaseTitle(release)}\n </Typography>\n </Box>\n\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"space-between\">\n <Stack>\n <Typography variant=\"body2\">\n {release.price === 0\n ? t('free')\n : fCurrency(release.price, lang, event.currency)}\n </Typography>\n\n {hasDescription && (\n <Button\n size=\"small\"\n onClick={() => toggleReleaseDescription(release.id)}\n endIcon={\n <Iconify\n icon={\n expandedReleaseIds[release.id]\n ? 'eva:chevron-up-fill'\n : 'eva:chevron-down-fill'\n }\n />\n }\n sx={{\n px: 0,\n minWidth: 'auto',\n textTransform: 'none',\n color: 'text.primary',\n textDecoration: 'underline',\n fontWeight: 400,\n '& .MuiButton-endIcon': { ml: 0.3 },\n }}\n >\n {t('more_info')}\n </Button>\n )}\n </Stack>\n\n <TicketQuantityControl\n quantity={quantity}\n isDisabled={isDisabled}\n canAddFirst={canAddFirst}\n canAddMore={canAddMore}\n addLabel={t('add')}\n onDecrement={() => updateReleaseQuantity(release, quantity - 1)}\n onIncrement={() => updateReleaseQuantity(release, quantity + 1)}\n onAddFirst={() => updateReleaseQuantity(release, 1)}\n />\n </Stack>\n\n {hasDescription && (\n <Collapse in={Boolean(expandedReleaseIds[release.id])}>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {release.description}\n </Typography>\n </Collapse>\n )}\n\n {ticketIndex >= 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BAAqB,EAAA,EACpB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,EAClB,WAAW,EAAE,MAAM,qBAAqB,CAAC,OAAO,EAAE,QAAQ,GAAG,CAAC,CAAC,EAC/D,WAAW,EAAE,MAAM,qBAAqB,CAAC,OAAO,EAAE,QAAQ,GAAG,CAAC,CAAC,EAC/D,UAAU,EAAE,MAAM,qBAAqB,CAAC,OAAO,EAAE,CAAC,CAAC,GACnD,CACI;AAEP,gBAAA,cAAc,KACb,KAAA,CAAA,aAAA,CAAC,QAAQ,IAAC,EAAE,EAAE,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAA;AACnD,oBAAA,KAAA,CAAA,aAAA,CAAC,UAAU,EAAA,EAAC,OAAO,EAAC,OAAO,EAAC,KAAK,EAAC,gBAAgB,IAC/C,OAAO,CAAC,WAAW,CACT,CACJ,CACZ;AAEA,gBAAA,WAAW,IAAI,CAAC,IAAI,cAAc,CAAC,OAAO,CAAC,EAAE,EAAE,WAAW,CAAC,CACtD,CACJ;KAET,CAAC,CACI;AAEZ;;;;"}
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { Grid } from '@mui/material';
3
- import CustomSkeleton from '../../components/CustomSkeleton.js';
4
- import MerchandiseSlider from './MerchandiseSlider.js';
5
-
6
- const MerchandiseSelection = ({ eventProducts, eventId, isLoading }) =>
7
- // <Grid container spacing={3}>
8
- // {
9
- // }
10
- // </Grid>
11
- isLoading ? ([...Array(3)].map((item) => (React.createElement(Grid, { key: item, item: true, xs: 12, md: 4 },
12
- React.createElement(CustomSkeleton, { height: 334 }))))) : (React.createElement(MerchandiseSlider, { eventProducts: eventProducts, eventId: eventId }));
13
-
14
- export { MerchandiseSelection as default };
15
- //# sourceMappingURL=MerchandiseSelection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MerchandiseSelection.js","sources":["../../../../src/form/merchendise/MerchandiseSelection.tsx"],"sourcesContent":["import React from 'react';\nimport { Grid } from '@mui/material';\nimport { IEventProduct } from '@utils/types/event-product.type';\nimport CustomSkeleton from '@components/CustomSkeleton';\nimport MerchandiseSlider from './MerchandiseSlider';\n\ninterface Props {\n eventProducts: IEventProduct[];\n eventId: number;\n isLoading?: boolean;\n}\n\nconst MerchandiseSelection: React.FC<Props> = ({ eventProducts, eventId, isLoading }) =>\n // <Grid container spacing={3}>\n // {\n\n // }\n // </Grid>\n isLoading ? (\n [...Array(3)].map((item) => (\n <Grid key={item} item xs={12} md={4}>\n <CustomSkeleton height={334} />\n </Grid>\n ))\n ) : (\n <MerchandiseSlider eventProducts={eventProducts} eventId={eventId} />\n );\n\nexport default MerchandiseSelection;\n"],"names":[],"mappings":";;;;;AAYA,MAAM,oBAAoB,GAAoB,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE;AAClF;AACA;AAEA;AACA;AACA,SAAS,IACP,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,MACrB,KAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAA,IAAA,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAA;IACjC,KAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAC,MAAM,EAAE,GAAG,EAAA,CAAI,CAC1B,CACR,CAAC,KAEF,KAAA,CAAA,aAAA,CAAC,iBAAiB,EAAA,EAAC,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAA,CAAI;;;;"}
@@ -1,71 +0,0 @@
1
- import React, { useState, useCallback, useEffect } from 'react';
2
- import useEmblaCarousel from 'embla-carousel-react';
3
- import { Box } from '@mui/material';
4
- import { useTheme } from '@mui/material/styles';
5
- import ProductCard from '../product/ProductCard.js';
6
-
7
- const MerchandiseSlider = ({ eventProducts, eventId, sx }) => {
8
- const [emblaRef, emblaApi] = useEmblaCarousel();
9
- const theme = useTheme();
10
- const [totalSlides, setTotalSlides] = useState(0);
11
- const [activeSlide, setActiveSlide] = useState(0);
12
- const [activeSlides, setActiveSlides] = useState(0);
13
- const calculateTotal = useCallback(() => {
14
- if (!emblaApi)
15
- return;
16
- const slides = emblaApi.slideNodes().length || 0;
17
- const slidesInView = emblaApi.slidesInView();
18
- setActiveSlides(slidesInView.length);
19
- setTotalSlides(slides);
20
- const activeSlide = slidesInView[0];
21
- setActiveSlide(slidesInView.length > 4 ? slidesInView[1] : activeSlide || 0);
22
- }, [emblaApi]);
23
- useCallback(() => {
24
- if (emblaApi)
25
- emblaApi.scrollNext();
26
- }, [emblaApi]);
27
- useCallback(() => {
28
- if (emblaApi)
29
- emblaApi.scrollPrev();
30
- }, [emblaApi]);
31
- useEffect(() => {
32
- if (!emblaApi)
33
- return;
34
- calculateTotal();
35
- emblaApi.on('reInit', calculateTotal);
36
- emblaApi.on('slidesChanged', calculateTotal);
37
- emblaApi.on('slidesInView', calculateTotal);
38
- return () => {
39
- emblaApi.off('reInit', calculateTotal);
40
- emblaApi.off('slidesChanged', calculateTotal);
41
- emblaApi.off('slidesInView', calculateTotal);
42
- };
43
- }, [emblaApi, calculateTotal]);
44
- return (React.createElement(Box, { sx: sx },
45
- React.createElement(Box, { sx: {
46
- overflow: 'hidden',
47
- padding: theme.spacing(8, 3),
48
- margin: theme.spacing(-8, -3),
49
- } },
50
- React.createElement(Box, { ref: emblaRef, className: "embla", sx: { overflow: 'visible' } },
51
- React.createElement(Box, { className: "embla__container", sx: {
52
- display: 'flex',
53
- // marginLeft: theme.spacing(-2),
54
- // marginRight: theme.spacing(-2),
55
- } }, eventProducts.map((eventProduct, index) => (React.createElement(Box, { key: `event-slide-${index}`, className: "embla__slide", sx: {
56
- flex: `0 0 ${eventProducts.length > 1 ? '78%' : '100%'}`,
57
- minWidth: 0,
58
- margin: `0 ${theme.spacing(1)}`,
59
- transition: 'opacity 0.2s ease',
60
- [theme.breakpoints.up('sm')]: {
61
- flex: '0 0 43%',
62
- },
63
- [theme.breakpoints.up('md')]: {
64
- flex: '0 0 33.3333%',
65
- },
66
- } },
67
- React.createElement(ProductCard, { eventProduct: eventProduct, eventId: eventId, isOnlyMerchandise: true })))))))));
68
- };
69
-
70
- export { MerchandiseSlider as default };
71
- //# sourceMappingURL=MerchandiseSlider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MerchandiseSlider.js","sources":["../../../../src/form/merchendise/MerchandiseSlider.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport useEmblaCarousel from 'embla-carousel-react';\nimport { Box, SxProps } from '@mui/material';\nimport { useTheme } from '@mui/material/styles';\nimport { IEventProduct } from '@utils/types/event-product.type';\nimport ProductCard from '@form/product/ProductCard';\n\ninterface Props {\n // title: string;\n // icon: string;\n sx?: SxProps;\n eventProducts: IEventProduct[];\n eventId: number;\n}\n\nconst MerchandiseSlider: React.FC<Props> = ({ eventProducts, eventId, sx }) => {\n const [emblaRef, emblaApi] = useEmblaCarousel();\n const theme = useTheme();\n\n const [totalSlides, setTotalSlides] = useState<number>(0);\n const [activeSlide, setActiveSlide] = useState<number>(0);\n const [activeSlides, setActiveSlides] = useState<number>(0);\n\n const calculateTotal = useCallback(() => {\n if (!emblaApi) return;\n const slides = emblaApi.slideNodes().length || 0;\n const slidesInView = emblaApi.slidesInView();\n setActiveSlides(slidesInView.length);\n setTotalSlides(slides);\n const activeSlide = slidesInView[0];\n setActiveSlide(slidesInView.length > 4 ? slidesInView[1] : activeSlide || 0);\n }, [emblaApi]);\n\n const onNext = useCallback(() => {\n if (emblaApi) emblaApi.scrollNext();\n }, [emblaApi]);\n\n const onPrev = useCallback(() => {\n if (emblaApi) emblaApi.scrollPrev();\n }, [emblaApi]);\n\n useEffect(() => {\n if (!emblaApi) return;\n\n calculateTotal();\n\n emblaApi.on('reInit', calculateTotal);\n emblaApi.on('slidesChanged', calculateTotal);\n emblaApi.on('slidesInView', calculateTotal);\n\n return () => {\n emblaApi.off('reInit', calculateTotal);\n emblaApi.off('slidesChanged', calculateTotal);\n emblaApi.off('slidesInView', calculateTotal);\n };\n }, [emblaApi, calculateTotal]);\n\n const isActive = (index: number) => index >= activeSlide && index <= activeSlide + 2;\n\n return (\n <Box sx={sx}>\n {/* <Stack direction=\"row\" justifyContent=\"space-between\" alignItems=\"center\" mb={2}>\n <EventTitle title={title} icon={icon} />\n {events.length > 1 && (\n <EventSliderArrows\n active={activeSlide + 1}\n total={totalSlides}\n onNext={onNext}\n onPrev={onPrev}\n />\n )}\n </Stack> */}\n <Box\n sx={{\n overflow: 'hidden',\n padding: theme.spacing(8, 3),\n margin: theme.spacing(-8, -3),\n }}\n >\n <Box ref={emblaRef} className=\"embla\" sx={{ overflow: 'visible' }}>\n <Box\n className=\"embla__container\"\n sx={{\n display: 'flex',\n // marginLeft: theme.spacing(-2),\n // marginRight: theme.spacing(-2),\n }}\n >\n {eventProducts.map((eventProduct, index) => (\n <Box\n key={`event-slide-${index}`}\n className=\"embla__slide\"\n sx={{\n flex: `0 0 ${eventProducts.length > 1 ? '78%' : '100%'}`,\n minWidth: 0,\n margin: `0 ${theme.spacing(1)}`,\n transition: 'opacity 0.2s ease',\n [theme.breakpoints.up('sm')]: {\n flex: '0 0 43%',\n },\n [theme.breakpoints.up('md')]: {\n flex: '0 0 33.3333%',\n },\n }}\n >\n {/* <EventItem\n {...event}\n sx={{\n boxShadow: isActive(index) ? theme.customShadows.z8 : 'none',\n '&:hover': {\n boxShadow: theme.customShadows.z12,\n },\n }}\n /> */}\n\n <ProductCard eventProduct={eventProduct} eventId={eventId} isOnlyMerchandise />\n </Box>\n ))}\n </Box>\n </Box>\n </Box>\n </Box>\n );\n};\n\nexport default MerchandiseSlider;\n"],"names":[],"mappings":";;;;;;AAeA,MAAM,iBAAiB,GAAoB,CAAC,EAAE,aAAa,EAAE,OAAO,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E,EAAE;AACF,wBAAA,IAAI,EAAE,CAAA,IAAA,EAAO,aAAa,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,GAAG,MAAM,CAAA,CAAE;AACxD,wBAAA,QAAQ,EAAE,CAAC;wBACX,MAAM,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA,CAAE;AAC/B,wBAAA,UAAU,EAAE,mBAAmB;wBAC/B,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;AAC5B,4BAAA,IAAI,EAAE,SAAS;AAChB,yBAAA;wBACD,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;AAC5B,4BAAA,IAAI,EAAE,cAAc;AACrB,yBAAA;AACF,qBAAA,EAAA;oBAYD,KAAA,CAAA,aAAA,CAAC,WAAW,IAAC,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAA,IAAA,EAAA,CAAG,CAC3E,CACP,CAAC,CACE,CACF,CACF,CACF;AAEV;;;;"}
@@ -1,55 +0,0 @@
1
- import { useState, useEffect } from 'react';
2
-
3
- function useConsentScrollOnDrawerOpen({ isDrawerOpen, consentRef, }) {
4
- const [isNearConsentSection, setIsNearConsentSection] = useState(false);
5
- useEffect(() => {
6
- const consentElement = consentRef.current;
7
- if (!consentElement) {
8
- return;
9
- }
10
- if (!('IntersectionObserver' in window)) {
11
- setIsNearConsentSection(true);
12
- return;
13
- }
14
- const observer = new IntersectionObserver((entries) => {
15
- const entry = entries[0];
16
- setIsNearConsentSection(entry.isIntersecting);
17
- }, {
18
- root: null,
19
- threshold: 0,
20
- rootMargin: '0px 0px 140px 0px',
21
- });
22
- observer.observe(consentElement);
23
- return () => {
24
- observer.disconnect();
25
- };
26
- }, [consentRef]);
27
- useEffect(() => {
28
- if (!isDrawerOpen) {
29
- return;
30
- }
31
- if (window.matchMedia('(min-width:900px)').matches) {
32
- return;
33
- }
34
- if (!isNearConsentSection) {
35
- return;
36
- }
37
- let frameId = 0;
38
- let frameId2 = 0;
39
- frameId = window.requestAnimationFrame(() => {
40
- frameId2 = window.requestAnimationFrame(() => {
41
- consentRef.current?.scrollIntoView({
42
- behavior: 'smooth',
43
- block: 'center',
44
- });
45
- });
46
- });
47
- return () => {
48
- window.cancelAnimationFrame(frameId);
49
- window.cancelAnimationFrame(frameId2);
50
- };
51
- }, [consentRef, isDrawerOpen, isNearConsentSection]);
52
- }
53
-
54
- export { useConsentScrollOnDrawerOpen as default };
55
- //# sourceMappingURL=useConsentScrollOnDrawerOpen.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useConsentScrollOnDrawerOpen.js","sources":["../../../src/hooks/useConsentScrollOnDrawerOpen.ts"],"sourcesContent":["import { RefObject, useEffect, useState } from 'react';\n\ninterface UseConsentScrollOnDrawerOpenProps {\n isDrawerOpen: boolean;\n consentRef: RefObject<HTMLElement | null>;\n}\n\nexport default function useConsentScrollOnDrawerOpen({\n isDrawerOpen,\n consentRef,\n}: UseConsentScrollOnDrawerOpenProps) {\n const [isNearConsentSection, setIsNearConsentSection] = useState(false);\n\n useEffect(() => {\n const consentElement = consentRef.current;\n if (!consentElement) {\n return;\n }\n\n if (!('IntersectionObserver' in window)) {\n setIsNearConsentSection(true);\n return;\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n const entry = entries[0];\n setIsNearConsentSection(entry.isIntersecting);\n },\n {\n root: null,\n threshold: 0,\n rootMargin: '0px 0px 140px 0px',\n }\n );\n\n observer.observe(consentElement);\n\n return () => {\n observer.disconnect();\n };\n }, [consentRef]);\n\n useEffect(() => {\n if (!isDrawerOpen) {\n return;\n }\n\n if (window.matchMedia('(min-width:900px)').matches) {\n return;\n }\n\n if (!isNearConsentSection) {\n return;\n }\n\n let frameId = 0;\n let frameId2 = 0;\n frameId = window.requestAnimationFrame(() => {\n frameId2 = window.requestAnimationFrame(() => {\n consentRef.current?.scrollIntoView({\n behavior: 'smooth',\n block: 'center',\n });\n });\n });\n\n return () => {\n window.cancelAnimationFrame(frameId);\n window.cancelAnimationFrame(frameId2);\n };\n }, [consentRef, isDrawerOpen, isNearConsentSection]);\n}\n"],"names":[],"mappings":";;AAOc,SAAU,4BAA4B,CAAC,EACnD,YAAY,EACZ,UAAU,GACwB,EAAA;IAClC,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;IAEvE,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO;QACzC,IAAI,CAAC,cAAc,EAAE;YACnB;;AAGF,QAAA,IAAI,EAAE,sBAAsB,IAAI,MAAM,CAAC,EAAE;YACvC,uBAAuB,CAAC,IAAI,CAAC;YAC7B;;QAGF,MAAM,QAAQ,GAAG,IAAI,oBAAoB,CACvC,CAAC,OAAO,KAAI;AACV,YAAA,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC;AACxB,YAAA,uBAAuB,CAAC,KAAK,CAAC,cAAc,CAAC;AAC/C,SAAC,EACD;AACE,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,SAAS,EAAE,CAAC;AACZ,YAAA,UAAU,EAAE,mBAAmB;AAChC,SAAA,CACF;AAED,QAAA,QAAQ,CAAC,OAAO,CAAC,cAAc,CAAC;AAEhC,QAAA,OAAO,MAAK;YACV,QAAQ,CAAC,UAAU,EAAE;AACvB,SAAC;AACH,KAAC,EAAE,CAAC,UAAU,CAAC,CAAC;IAEhB,SAAS,CAAC,MAAK;QACb,IAAI,CAAC,YAAY,EAAE;YACjB;;QAGF,IAAI,MAAM,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,OAAO,EAAE;YAClD;;QAGF,IAAI,CAAC,oBAAoB,EAAE;YACzB;;QAGF,IAAI,OAAO,GAAG,CAAC;QACf,IAAI,QAAQ,GAAG,CAAC;AAChB,QAAA,OAAO,GAAG,MAAM,CAAC,qBAAqB,CAAC,MAAK;AAC1C,YAAA,QAAQ,GAAG,MAAM,CAAC,qBAAqB,CAAC,MAAK;AAC3C,gBAAA,UAAU,CAAC,OAAO,EAAE,cAAc,CAAC;AACjC,oBAAA,QAAQ,EAAE,QAAQ;AAClB,oBAAA,KAAK,EAAE,QAAQ;AAChB,iBAAA,CAAC;AACJ,aAAC,CAAC;AACJ,SAAC,CAAC;AAEF,QAAA,OAAO,MAAK;AACV,YAAA,MAAM,CAAC,oBAAoB,CAAC,OAAO,CAAC;AACpC,YAAA,MAAM,CAAC,oBAAoB,CAAC,QAAQ,CAAC;AACvC,SAAC;KACF,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC;AACtD;;;;"}
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import { IEvent } from '@utils/types/event.type';
3
- interface Props {
4
- event: IEvent;
5
- totalPrice: number;
6
- }
7
- declare const PaymentOverviewDrawer: React.FC<Props>;
8
- export default PaymentOverviewDrawer;
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { IEventProduct } from '@utils/types/event-product.type';
3
- interface Props {
4
- eventProducts: IEventProduct[];
5
- eventId: number;
6
- isLoading?: boolean;
7
- }
8
- declare const MerchandiseSelection: React.FC<Props>;
9
- export default MerchandiseSelection;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { SxProps } from '@mui/material';
3
- import { IEventProduct } from '@utils/types/event-product.type';
4
- interface Props {
5
- sx?: SxProps;
6
- eventProducts: IEventProduct[];
7
- eventId: number;
8
- }
9
- declare const MerchandiseSlider: React.FC<Props>;
10
- export default MerchandiseSlider;