@kolserdav/swiper 1.0.4 → 1.0.9
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.
- package/README.md +11 -8
- package/dist/index.d.ts +5 -13
- package/dist/index.js +34 -16
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +34 -17
- package/dist/index.modern.js.map +1 -1
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ npm install --save @kolserdav/swiper
|
|
|
14
14
|
|
|
15
15
|
```tsx
|
|
16
16
|
import React from 'react';
|
|
17
|
-
import Swiper,
|
|
17
|
+
import { Swiper, GetSwipeHandler } from 'swiper';
|
|
18
18
|
import 'swiper/dist/index.css';
|
|
19
19
|
|
|
20
20
|
const getNext: GetSwipeHandler = (old) => {
|
|
@@ -33,16 +33,19 @@ const getPrevious: GetSwipeHandler = (old) => {
|
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* Typescript syntetic method
|
|
38
|
+
* */
|
|
39
|
+
const _getNext = (id: number): Swipe => {
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
|
+
const res: any = getNext(id);
|
|
42
|
+
return res;
|
|
43
|
+
};
|
|
44
|
+
|
|
36
45
|
const App = (): React.ReactElement => {
|
|
37
46
|
return (
|
|
38
47
|
<div>
|
|
39
|
-
<Swiper
|
|
40
|
-
defaultCurrent={getNext(0)}
|
|
41
|
-
defaultPrev={getPrevious(1)}
|
|
42
|
-
defaultNext={getNext(1)}
|
|
43
|
-
getNext={getNext}
|
|
44
|
-
getPrev={getPrevious}
|
|
45
|
-
/>
|
|
48
|
+
<Swiper defaultCurrent={_getNext(0)} getNext={getNext} getPrev={getPrevious} />
|
|
46
49
|
</div>
|
|
47
50
|
);
|
|
48
51
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -16,13 +16,13 @@ export declare const SWIPE_TRANSITION_TIMEOUT = 400;
|
|
|
16
16
|
* One of swipe card
|
|
17
17
|
*/
|
|
18
18
|
export interface Swipe {
|
|
19
|
-
id: number;
|
|
20
|
-
children: React.ReactElement | React.ReactElement[]
|
|
19
|
+
id: number | null;
|
|
20
|
+
children: React.ReactElement | React.ReactElement[];
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Callback for get next or previous card content
|
|
24
24
|
*/
|
|
25
|
-
export declare type GetSwipeHandler = (oldId: number) => Swipe |
|
|
25
|
+
export declare type GetSwipeHandler = (oldId: number) => Swipe | Promise<Swipe>;
|
|
26
26
|
/**
|
|
27
27
|
* Props of Swiper component
|
|
28
28
|
*/
|
|
@@ -31,14 +31,6 @@ interface SwiperProps {
|
|
|
31
31
|
* Current card content
|
|
32
32
|
*/
|
|
33
33
|
defaultCurrent: Swipe;
|
|
34
|
-
/**
|
|
35
|
-
* Next card content
|
|
36
|
-
*/
|
|
37
|
-
defaultNext: Swipe;
|
|
38
|
-
/**
|
|
39
|
-
* Previous card content
|
|
40
|
-
*/
|
|
41
|
-
defaultPrev: Swipe;
|
|
42
34
|
/**
|
|
43
35
|
* Get next card handler
|
|
44
36
|
*/
|
|
@@ -67,10 +59,10 @@ interface SwiperProps {
|
|
|
67
59
|
/**
|
|
68
60
|
* Swiper component
|
|
69
61
|
*/
|
|
70
|
-
declare const Swiper: {
|
|
62
|
+
export declare const Swiper: {
|
|
71
63
|
(props: SwiperProps): React.ReactElement;
|
|
72
64
|
defaultProps: {
|
|
73
65
|
className: string;
|
|
74
66
|
};
|
|
75
67
|
};
|
|
76
|
-
export
|
|
68
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -277,15 +277,19 @@ var getSwipes = function getSwipes(__prev, __current, __next) {
|
|
|
277
277
|
return result;
|
|
278
278
|
};
|
|
279
279
|
|
|
280
|
+
var getDefaultSwipe = function getDefaultSwipe() {
|
|
281
|
+
return {
|
|
282
|
+
id: Math.ceil(Math.random() * 1000),
|
|
283
|
+
children: React__default.createElement("div", null)
|
|
284
|
+
};
|
|
285
|
+
};
|
|
286
|
+
|
|
280
287
|
var refs = {};
|
|
281
288
|
var startClientX;
|
|
282
289
|
var lastLeft;
|
|
283
290
|
var animated = false;
|
|
284
|
-
|
|
285
291
|
var Swiper = function Swiper(props) {
|
|
286
292
|
var defaultCurrent = props.defaultCurrent,
|
|
287
|
-
defaultNext = props.defaultNext,
|
|
288
|
-
defaultPrev = props.defaultPrev,
|
|
289
293
|
getNext = props.getNext,
|
|
290
294
|
getPrev = props.getPrev,
|
|
291
295
|
className = props.className,
|
|
@@ -336,7 +340,7 @@ var Swiper = function Swiper(props) {
|
|
|
336
340
|
var _buttonNextRef = React.useRef(null);
|
|
337
341
|
|
|
338
342
|
var swipes = React.useMemo(function () {
|
|
339
|
-
return getSwipes(prev ||
|
|
343
|
+
return getSwipes(prev || getDefaultSwipe(), current || defaultCurrent, next || getDefaultSwipe());
|
|
340
344
|
}, [next]);
|
|
341
345
|
|
|
342
346
|
var getRef = function getRef(id) {
|
|
@@ -390,7 +394,7 @@ var Swiper = function Swiper(props) {
|
|
|
390
394
|
|
|
391
395
|
var _temp6 = function () {
|
|
392
396
|
if (_lastLeft < 0) {
|
|
393
|
-
if ((next
|
|
397
|
+
if (!(next !== null && next !== void 0 && next.id)) {
|
|
394
398
|
setBackClass();
|
|
395
399
|
_exit2 = true;
|
|
396
400
|
return 1;
|
|
@@ -402,7 +406,7 @@ var Swiper = function Swiper(props) {
|
|
|
402
406
|
setNext(_getNext);
|
|
403
407
|
});
|
|
404
408
|
} else {
|
|
405
|
-
if ((prev
|
|
409
|
+
if (!(prev !== null && prev !== void 0 && prev.id)) {
|
|
406
410
|
setBackClass();
|
|
407
411
|
_exit2 = true;
|
|
408
412
|
return 1;
|
|
@@ -561,8 +565,17 @@ var Swiper = function Swiper(props) {
|
|
|
561
565
|
|
|
562
566
|
if (!current || !prev || !next) {
|
|
563
567
|
setCurrent(defaultCurrent);
|
|
564
|
-
|
|
565
|
-
|
|
568
|
+
|
|
569
|
+
try {
|
|
570
|
+
return Promise.resolve(getNext(defaultCurrent.id || 0)).then(function (_getNext2) {
|
|
571
|
+
setNext(_getNext2);
|
|
572
|
+
return Promise.resolve(getPrev(defaultCurrent.id || 0)).then(function (_getPrev2) {
|
|
573
|
+
setPrev(_getPrev2);
|
|
574
|
+
});
|
|
575
|
+
});
|
|
576
|
+
} catch (e) {
|
|
577
|
+
Promise.reject(e);
|
|
578
|
+
}
|
|
566
579
|
}
|
|
567
580
|
|
|
568
581
|
if (invitationAnimation && width && !animated) {
|
|
@@ -593,17 +606,23 @@ var Swiper = function Swiper(props) {
|
|
|
593
606
|
window.removeEventListener('resize', resizeHandler);
|
|
594
607
|
};
|
|
595
608
|
}, [next]);
|
|
609
|
+
console.log(swipes);
|
|
596
610
|
return React__default.createElement("div", {
|
|
597
611
|
className: styles.container,
|
|
598
612
|
ref: containerRef
|
|
599
613
|
}, swipes.map(function (item) {
|
|
614
|
+
var _item$id;
|
|
615
|
+
|
|
600
616
|
return React__default.createElement("div", {
|
|
601
|
-
key: item.id
|
|
602
|
-
|
|
617
|
+
key: item.id,
|
|
618
|
+
style: !(item !== null && item !== void 0 && item.id) ? {
|
|
619
|
+
display: 'none'
|
|
620
|
+
} : {}
|
|
621
|
+
}, item.id && width && React__default.createElement("div", {
|
|
603
622
|
onTouchMove: onTouchWrapper('onTouchMove'),
|
|
604
623
|
onTouchStart: onTouchWrapper('onTouchStart'),
|
|
605
624
|
onTouchEnd: onTouchWrapper('onTouchEnd'),
|
|
606
|
-
id: item.id.toString(),
|
|
625
|
+
id: (_item$id = item.id) === null || _item$id === void 0 ? void 0 : _item$id.toString(),
|
|
607
626
|
style: item.type === 'current' ? {
|
|
608
627
|
width: width,
|
|
609
628
|
height: height,
|
|
@@ -621,20 +640,19 @@ var Swiper = function Swiper(props) {
|
|
|
621
640
|
ref: getRef(item.id)
|
|
622
641
|
}, React__default.createElement("div", {
|
|
623
642
|
className: clsx(styles.content, className)
|
|
624
|
-
}, item.children))
|
|
625
|
-
}), typeof isMobile !== 'undefined' && !isMobile && !prevButtonRef && (prev === null || prev === void 0 ? void 0 : prev.
|
|
643
|
+
}, item.children)));
|
|
644
|
+
}), typeof isMobile !== 'undefined' && !isMobile && !prevButtonRef && (prev === null || prev === void 0 ? void 0 : prev.id) && React__default.createElement("div", {
|
|
626
645
|
className: clsx(styles.button, styles.button_prev),
|
|
627
646
|
ref: _buttonPrevRef
|
|
628
|
-
}, windowWidth < 3000 ? React__default.createElement(SvgNavigateNextBlack24Dp, null) : React__default.createElement(SvgNavigateNextBlack48Dp, null)), typeof isMobile !== 'undefined' && !isMobile && !nextButtonRef && (next === null || next === void 0 ? void 0 : next.
|
|
647
|
+
}, windowWidth < 3000 ? React__default.createElement(SvgNavigateNextBlack24Dp, null) : React__default.createElement(SvgNavigateNextBlack48Dp, null)), typeof isMobile !== 'undefined' && !isMobile && !nextButtonRef && (next === null || next === void 0 ? void 0 : next.id) && React__default.createElement("div", {
|
|
629
648
|
className: clsx(styles.button, styles.button_next),
|
|
630
649
|
ref: _buttonNextRef
|
|
631
650
|
}, windowWidth < 3000 ? React__default.createElement(SvgNavigateNextBlack24Dp, null) : React__default.createElement(SvgNavigateNextBlack48Dp, null)));
|
|
632
651
|
};
|
|
633
|
-
|
|
634
652
|
Swiper.defaultProps = {
|
|
635
653
|
className: ''
|
|
636
654
|
};
|
|
637
655
|
|
|
638
656
|
exports.SWIPE_TRANSITION_TIMEOUT = SWIPE_TRANSITION_TIMEOUT;
|
|
639
|
-
exports.
|
|
657
|
+
exports.Swiper = Swiper;
|
|
640
658
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../node_modules/babel-plugin-transform-async-to-promises/helpers.js","../src/index.tsx"],"sourcesContent":["// A type of promise-like that resolves synchronously and supports only one observer\nexport const _Pact = /*#__PURE__*/(function() {\n\tfunction _Pact() {}\n\t_Pact.prototype.then = function(onFulfilled, onRejected) {\n\t\tconst result = new _Pact();\n\t\tconst state = this.s;\n\t\tif (state) {\n\t\t\tconst callback = state & 1 ? onFulfilled : onRejected;\n\t\t\tif (callback) {\n\t\t\t\ttry {\n\t\t\t\t\t_settle(result, 1, callback(this.v));\n\t\t\t\t} catch (e) {\n\t\t\t\t\t_settle(result, 2, e);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\t\tthis.o = function(_this) {\n\t\t\ttry {\n\t\t\t\tconst value = _this.v;\n\t\t\t\tif (_this.s & 1) {\n\t\t\t\t\t_settle(result, 1, onFulfilled ? onFulfilled(value) : value);\n\t\t\t\t} else if (onRejected) {\n\t\t\t\t\t_settle(result, 1, onRejected(value));\n\t\t\t\t} else {\n\t\t\t\t\t_settle(result, 2, value);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(result, 2, e);\n\t\t\t}\n\t\t};\n\t\treturn result;\n\t}\n\treturn _Pact;\n})();\n\n// Settles a pact synchronously\nexport function _settle(pact, state, value) {\n\tif (!pact.s) {\n\t\tif (value instanceof _Pact) {\n\t\t\tif (value.s) {\n\t\t\t\tif (state & 1) {\n\t\t\t\t\tstate = value.s;\n\t\t\t\t}\n\t\t\t\tvalue = value.v;\n\t\t\t} else {\n\t\t\t\tvalue.o = _settle.bind(null, pact, state);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (value && value.then) {\n\t\t\tvalue.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));\n\t\t\treturn;\n\t\t}\n\t\tpact.s = state;\n\t\tpact.v = value;\n\t\tconst observer = pact.o;\n\t\tif (observer) {\n\t\t\tobserver(pact);\n\t\t}\n\t}\n}\n\nexport function _isSettledPact(thenable) {\n\treturn thenable instanceof _Pact && thenable.s & 1;\n}\n\n// Converts argument to a function that always returns a Promise\nexport function _async(f) {\n\treturn function() {\n\t\tfor (var args = [], i = 0; i < arguments.length; i++) {\n\t\t\targs[i] = arguments[i];\n\t\t}\n\t\ttry {\n\t\t\treturn Promise.resolve(f.apply(this, args));\n\t\t} catch(e) {\n\t\t\treturn Promise.reject(e);\n\t\t}\n\t}\n}\n\n// Awaits on a value that may or may not be a Promise (equivalent to the await keyword in ES2015, with continuations passed explicitly)\nexport function _await(value, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(value) : value;\n\t}\n\tif (!value || !value.then) {\n\t\tvalue = Promise.resolve(value);\n\t}\n\treturn then ? value.then(then) : value;\n}\n\n// Awaits on a value that may or may not be a Promise, then ignores it\nexport function _awaitIgnored(value, direct) {\n\tif (!direct) {\n\t\treturn value && value.then ? value.then(_empty) : Promise.resolve();\n\t}\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continue(value, then) {\n\treturn value && value.then ? value.then(then) : then(value);\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continueIgnored(value) {\n\tif (value && value.then) {\n\t\treturn value.then(_empty);\n\t}\n}\n\n// Asynchronously iterate through an object that has a length property, passing the index as the first argument to the callback (even as the length property changes)\nexport function _forTo(array, body, check) {\n\tvar i = -1, pact, reject;\n\tfunction _cycle(result) {\n\t\ttry {\n\t\t\twhile (++i < array.length && (!check || !check())) {\n\t\t\t\tresult = body(i);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pact) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t} else {\n\t\t\t\tpact = result;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t_settle(pact || (pact = new _Pact()), 2, e);\n\t\t}\n\t}\n\t_cycle();\n\treturn pact;\n}\n\n// Asynchronously iterate through an object's properties (including properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forIn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tkeys.push(key);\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\n// Asynchronously iterate through an object's own properties (excluding properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forOwn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tif (Object.prototype.hasOwnProperty.call(target, key)) {\n\t\t\tkeys.push(key);\n\t\t}\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\nexport const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== \"undefined\" ? (Symbol.iterator || (Symbol.iterator = Symbol(\"Symbol.iterator\"))) : \"@@iterator\";\n\n// Asynchronously iterate through an object's values\n// Uses for...of if the runtime supports it, otherwise iterates until length on a copy\nexport function _forOf(target, body, check) {\n\tif (typeof target[_iteratorSymbol] === \"function\") {\n\t\tvar iterator = target[_iteratorSymbol](), step, pact, reject;\n\t\tfunction _cycle(result) {\n\t\t\ttry {\n\t\t\t\twhile (!(step = iterator.next()).done && (!check || !check())) {\n\t\t\t\t\tresult = body(step.value);\n\t\t\t\t\tif (result && result.then) {\n\t\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (pact) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t} else {\n\t\t\t\t\tpact = result;\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(pact || (pact = new _Pact()), 2, e);\n\t\t\t}\n\t\t}\n\t\t_cycle();\n\t\tif (iterator.return) {\n\t\t\tvar _fixup = function(value) {\n\t\t\t\ttry {\n\t\t\t\t\tif (!step.done) {\n\t\t\t\t\t\titerator.return();\n\t\t\t\t\t}\n\t\t\t\t} catch(e) {\n\t\t\t\t}\n\t\t\t\treturn value;\n\t\t\t}\n\t\t\tif (pact && pact.then) {\n\t\t\t\treturn pact.then(_fixup, function(e) {\n\t\t\t\t\tthrow _fixup(e);\n\t\t\t\t});\n\t\t\t}\n\t\t\t_fixup();\n\t\t}\n\t\treturn pact;\n\t}\n\t// No support for Symbol.iterator\n\tif (!(\"length\" in target)) {\n\t\tthrow new TypeError(\"Object is not iterable\");\n\t}\n\t// Handle live collections properly\n\tvar values = [];\n\tfor (var i = 0; i < target.length; i++) {\n\t\tvalues.push(target[i]);\n\t}\n\treturn _forTo(values, function(i) { return body(values[i]); }, check);\n}\n\nexport const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== \"undefined\" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol(\"Symbol.asyncIterator\"))) : \"@@asyncIterator\";\n\n// Asynchronously iterate on a value using it's async iterator if present, or its synchronous iterator if missing\nexport function _forAwaitOf(target, body, check) {\n\tif (typeof target[_asyncIteratorSymbol] === \"function\") {\n\t\tvar pact = new _Pact();\n\t\tvar iterator = target[_asyncIteratorSymbol]();\n\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\treturn pact;\n\t\tfunction _resumeAfterBody(result) {\n\t\t\tif (check && check()) {\n\t\t\t\treturn _settle(pact, 1, iterator.return ? iterator.return().then(function() { return result; }) : result);\n\t\t\t}\n\t\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\t}\n\t\tfunction _resumeAfterNext(step) {\n\t\t\tif (step.done) {\n\t\t\t\t_settle(pact, 1);\n\t\t\t} else {\n\t\t\t\tPromise.resolve(body(step.value)).then(_resumeAfterBody).then(void 0, _reject);\n\t\t\t}\n\t\t}\n\t\tfunction _reject(error) {\n\t\t\t_settle(pact, 2, iterator.return ? iterator.return().then(function() { return error; }) : error);\n\t\t}\n\t}\n\treturn Promise.resolve(_forOf(target, function(value) { return Promise.resolve(value).then(body); }, check));\n}\n\n// Asynchronously implement a generic for loop\nexport function _for(test, update, body) {\n\tvar stage;\n\tfor (;;) {\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t\tif (shouldContinue.then) {\n\t\t\tstage = 0;\n\t\t\tbreak;\n\t\t}\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.s;\n\t\t\t} else {\n\t\t\t\tstage = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (update) {\n\t\t\tvar updateValue = update();\n\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\tstage = 2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tvar pact = new _Pact();\n\tvar reject = _settle.bind(null, pact, 2);\n\t(stage === 0 ? shouldContinue.then(_resumeAfterTest) : stage === 1 ? result.then(_resumeAfterBody) : updateValue.then(_resumeAfterUpdate)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tdo {\n\t\t\tif (update) {\n\t\t\t\tupdateValue = update();\n\t\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\t\tupdateValue.then(_resumeAfterUpdate).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tshouldContinue = test();\n\t\t\tif (!shouldContinue || (_isSettledPact(shouldContinue) && !shouldContinue.v)) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t}\n\t\t} while (!result || !result.then);\n\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterBody(result);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n\tfunction _resumeAfterUpdate() {\n\t\tif (shouldContinue = test()) {\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterTest(shouldContinue);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a do ... while loop\nexport function _do(body, test) {\n\tvar awaitBody;\n\tdo {\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t} else {\n\t\t\t\tawaitBody = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t} while (!shouldContinue.then);\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : shouldContinue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tfor (;;) {\n\t\t\tshouldContinue = test();\n\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t}\n\t\t\tif (!shouldContinue) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\tresult = result.v;\n\t\t\t\t} else {\n\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tdo {\n\t\t\t\tresult = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tshouldContinue = test();\n\t\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t\t}\n\t\t\t\tif (!shouldContinue) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} while (!shouldContinue.then);\n\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a switch statement\nexport function _switch(discriminant, cases) {\n\tvar dispatchIndex = -1;\n\tvar awaitBody;\n\touter: {\n\t\tfor (var i = 0; i < cases.length; i++) {\n\t\t\tvar test = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvar testValue = test();\n\t\t\t\tif (testValue && testValue.then) {\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tif (testValue === discriminant) {\n\t\t\t\t\tdispatchIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Found the default case, set it as the pending dispatch case\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tif (dispatchIndex !== -1) {\n\t\t\tdo {\n\t\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\t\twhile (!body) {\n\t\t\t\t\tdispatchIndex++;\n\t\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t\t}\n\t\t\t\tvar result = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tawaitBody = true;\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\t\tdispatchIndex++;\n\t\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t\treturn result;\n\t\t}\n\t}\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : testValue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterTest(value) {\n\t\tfor (;;) {\n\t\t\tif (value === discriminant) {\n\t\t\t\tdispatchIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (++i === cases.length) {\n\t\t\t\tif (dispatchIndex !== -1) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttest = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvalue = test();\n\t\t\t\tif (value && value.then) {\n\t\t\t\t\tvalue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tdo {\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tvar result = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tdispatchIndex++;\n\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterBody(result) {\n\t\tfor (;;) {\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tif (!fallthroughCheck || fallthroughCheck()) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdispatchIndex++;\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _call(body, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(body()) : body();\n\t}\n\ttry {\n\t\tvar result = Promise.resolve(body());\n\t\treturn then ? result.then(then) : result;\n\t} catch (e) {\n\t\treturn Promise.reject(e);\n\t}\n}\n\n// Asynchronously call a function and swallow the result\nexport function _callIgnored(body, direct) {\n\treturn _call(body, _empty, direct);\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _invoke(body, then) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(then);\n\t}\n\treturn then(result);\n}\n\n// Asynchronously call a function and swallow the result\nexport function _invokeIgnored(body) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(_empty);\n\t}\n}\n\n// Asynchronously call a function and send errors to recovery continuation\nexport function _catch(body, recover) {\n\ttry {\n\t\tvar result = body();\n\t} catch(e) {\n\t\treturn recover(e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(void 0, recover);\n\t}\n\treturn result;\n}\n\n// Asynchronously await a promise and pass the result to a finally continuation\nexport function _finallyRethrows(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer(true, e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer.bind(null, false), finalizer.bind(null, true));\n\t}\n\treturn finalizer(false, result);\n}\n\n// Asynchronously await a promise and invoke a finally continuation that always overrides the result\nexport function _finally(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer();\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer, finalizer);\n\t}\n\treturn finalizer();\n}\n\n// Rethrow or return a value from a finally continuation\nexport function _rethrow(thrown, value) {\n\tif (thrown)\n\t\tthrow value;\n\treturn value;\n}\n\n// Empty function to implement break and other control flow that ignores asynchronous results\nexport function _empty() {\n}\n\n// Sentinel value for early returns in generators \nexport const _earlyReturn = /*#__PURE__*/ {};\n\n// Asynchronously call a function and send errors to recovery continuation, skipping early returns\nexport function _catchInGenerator(body, recover) {\n\treturn _catch(body, function(e) {\n\t\tif (e === _earlyReturn) {\n\t\t\tthrow e;\n\t\t}\n\t\treturn recover(e);\n\t});\n}\n\n// Asynchronous generator class; accepts the entrypoint of the generator, to which it passes itself when the generator should start\nexport const _AsyncGenerator = /*#__PURE__*/(function() {\n\tfunction _AsyncGenerator(entry) {\n\t\tthis._entry = entry;\n\t\tthis._pact = null;\n\t\tthis._resolve = null;\n\t\tthis._return = null;\n\t\tthis._promise = null;\n\t}\n\n\tfunction _wrapReturnedValue(value) {\n\t\treturn { value: value, done: true };\n\t}\n\tfunction _wrapYieldedValue(value) {\n\t\treturn { value: value, done: false };\n\t}\n\n\t_AsyncGenerator.prototype._yield = function(value) {\n\t\t// Yield the value to the pending next call\n\t\tthis._resolve(value && value.then ? value.then(_wrapYieldedValue) : _wrapYieldedValue(value));\n\t\t// Return a pact for an upcoming next/return/throw call\n\t\treturn this._pact = new _Pact();\n\t};\n\t_AsyncGenerator.prototype.next = function(value) {\n\t\t// Advance the generator, starting it if it has yet to be started\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tconst _entry = _this._entry;\n\t\t\t\tif (_entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the next call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Start the generator\n\t\t\t\t_this._entry = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\tfunction returnValue(value) {\n\t\t\t\t\t_this._resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t_this._resolve = null;\n\t\t\t\t}\n\t\t\t\tvar result = _entry(_this);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tresult.then(returnValue, function(error) {\n\t\t\t\t\t\tif (error === _earlyReturn) {\n\t\t\t\t\t\t\treturnValue(_this._return);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst pact = new _Pact();\n\t\t\t\t\t\t\t_this._resolve(pact);\n\t\t\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t\t\t_this._resolve = null;\n\t\t\t\t\t\t\t_resolve(pact, 2, error);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\treturnValue(result);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Generator is started and a yield expression is pending, settle it\n\t\t\t\t_this._pact = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\t_settle(_pact, 1, value);\n\t\t\t}\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.return = function(value) {\n\t\t// Early return from the generator if started, otherwise abandons the generator\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the return call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return the specified value\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t}\n\t\t\t// Settle the yield expression with a rejected \"early return\" value\n\t\t\t_this._return = value;\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, _earlyReturn);\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.throw = function(error) {\n\t\t// Inject an exception into the pending yield expression\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve, reject) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the throw call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return a rejected Promise containing the error\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn reject(error);\n\t\t\t}\n\t\t\t// Settle the yield expression with the value as a rejection\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, error);\n\t\t});\n\t};\n\n\t_AsyncGenerator.prototype[_asyncIteratorSymbol] = function() {\n\t\treturn this;\n\t};\n\t\n\treturn _AsyncGenerator;\n})();\n","/******************************************************************************************\n * Repository: https://github.com/kolserdav/swiper.git\n * Author: Sergey Kolmiller\n * Email: <serega12101983@gmail.com>\n * License: MIT\n * License Text: The code is distributed as is. There are no guarantees regarding the functionality of the code or parts of it.\n * Copyright: kolserdav, All rights reserved (c)\n * Create date: Mon Nov 29 2021 16:18:08 GMT+0700 (Krasnoyarsk Standard Time)\n ******************************************************************************************/\nimport React, {\n useMemo,\n useState,\n useRef,\n createRef,\n RefObject,\n useEffect,\n TouchEvent,\n} from 'react';\nimport clsx from 'clsx';\nimport styles from './index.module.css';\nimport { ReactComponent as NextIcon } from './icons/navigate_next_black_24dp.svg';\nimport { ReactComponent as NextBigIcon } from './icons/navigate_next_black_48dp.svg';\n\n/**\n * Time to miliseconds of change animation by card left value\n */\nexport const SWIPE_TRANSITION_TIMEOUT = 400;\n\n/**\n * One of swipe card\n */\nexport interface Swipe {\n id: number;\n children: React.ReactElement | React.ReactElement[] | null;\n}\n\n/**\n * Callback for get next or previous card content\n */\nexport type GetSwipeHandler = (oldId: number) => Swipe | null | Promise<Swipe | null>;\n\n/**\n * One of swipe card internal\n */\ninterface SwipeFull extends Swipe {\n type: 'next' | 'current' | 'prev';\n}\n\n/**\n * Event touch name\n */\ntype TouchName = 'onTouchMove' | 'onTouchStart' | 'onTouchEnd';\n\n/**\n * Props of Swiper component\n */\ninterface SwiperProps {\n /**\n * Current card content\n */\n defaultCurrent: Swipe;\n\n /**\n * Next card content\n */\n defaultNext: Swipe;\n\n /**\n * Previous card content\n */\n defaultPrev: Swipe;\n\n /**\n * Get next card handler\n */\n getNext: GetSwipeHandler;\n\n /**\n * Get previous card handler\n */\n getPrev: GetSwipeHandler;\n\n /**\n * Class name for content block\n */\n className?: string;\n\n /**\n * Button for swipe to next\n */\n nextButtonRef?: RefObject<HTMLButtonElement | HTMLDivElement | undefined>;\n\n /**\n * Button for swipe to previous\n */\n prevButtonRef?: RefObject<HTMLButtonElement | HTMLDivElement | undefined>;\n\n /**\n * invitation animation\n */\n invitationAnimation?: boolean;\n}\n\n/**\n * Create swipe list from values\n */\nconst getSwipes = (__prev: Swipe, __current: Swipe, __next: Swipe): SwipeFull[] => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result: any[] = [1, 2, 3].map((id) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const item: any = id === 1 ? { ...__prev } : id === 2 ? { ...__current } : { ...__next };\n item.type = id === 1 ? 'prev' : id === 2 ? 'current' : 'next';\n return item;\n });\n return result;\n};\n\nconst refs: {\n [key: number]: RefObject<HTMLDivElement>;\n} = {};\n\nlet startClientX: number;\nlet lastLeft: number;\nlet animated = false;\n\n/**\n * Swiper component\n */\nconst Swiper = (props: SwiperProps): React.ReactElement => {\n const {\n defaultCurrent,\n defaultNext,\n defaultPrev,\n getNext,\n getPrev,\n className,\n prevButtonRef,\n nextButtonRef,\n invitationAnimation,\n } = props;\n\n const [current, setCurrent] = useState<Swipe | null>();\n const [prev, setPrev] = useState<Swipe | null>();\n const [next, setNext] = useState<Swipe | null>();\n const [windowWidth, setWindowWidth] = useState<number>(0);\n const [height, setHeight] = useState<number>(0);\n const [width, setWidth] = useState<number>(0);\n const [_left, _setLeft] = useState<number>(0);\n const [left, setLeft] = useState<number>(0);\n const [isMobile, setIsMobile] = useState<boolean>();\n\n const containerRef = useRef<HTMLDivElement>(null);\n const _buttonPrevRef = useRef<HTMLDivElement>(null);\n const _buttonNextRef = useRef<HTMLDivElement>(null);\n\n /**\n * Create memoized swipes\n */\n const swipes = useMemo(\n () => getSwipes(prev || defaultPrev, current || defaultCurrent, next || defaultNext),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [next]\n );\n\n /**\n * Get new or exists ref by id\n */\n const getRef = (id: number): typeof refs[0] => {\n refs[id] = refs[id] ? refs[id] : createRef<HTMLDivElement>();\n return refs[id];\n };\n\n /**\n * Set to cards classes for in animation\n */\n const setGoClass = (): void => {\n getRef(next?.id || 0).current?.classList.add(styles.go);\n getRef(prev?.id || 0).current?.classList.add(styles.go);\n getRef(current?.id || 0).current?.classList.add(styles.go);\n setTimeout(() => {\n getRef(next?.id || 0).current?.classList.remove(styles.go);\n getRef(prev?.id || 0).current?.classList.remove(styles.go);\n getRef(current?.id || 0).current?.classList.remove(styles.go);\n }, SWIPE_TRANSITION_TIMEOUT);\n };\n\n /**\n * Set to cards classes for out animation\n */\n const setBackClass = (): void => {\n getRef(next?.id || 0).current?.classList.add(styles.back);\n getRef(prev?.id || 0).current?.classList.add(styles.back);\n getRef(current?.id || 0).current?.classList.add(styles.back);\n setLeft(0);\n setTimeout(() => {\n getRef(next?.id || 0).current?.classList.remove(styles.back);\n getRef(prev?.id || 0).current?.classList.remove(styles.back);\n getRef(current?.id || 0).current?.classList.remove(styles.back);\n }, SWIPE_TRANSITION_TIMEOUT);\n };\n\n /**\n * Run swipe animation\n */\n const swipe = async (_lastLeft: number): Promise<1 | 0> => {\n if (Math.abs(_lastLeft) > width / 3) {\n setLeft(0);\n if (_lastLeft < 0) {\n if (next?.children === null) {\n setBackClass();\n return 1;\n }\n setPrev(current);\n setCurrent(next);\n setNext(await getNext(next?.id || 0));\n } else {\n if (prev?.children === null) {\n setBackClass();\n return 1;\n }\n setPrev(await getPrev(prev?.id || 0));\n setCurrent(prev);\n setNext(current);\n }\n setGoClass();\n } else {\n setBackClass();\n }\n return 0;\n };\n\n /**\n * Touch event handler\n */\n const onTouchHandler = async (name: TouchName, e: TouchEvent): Promise<void> => {\n const { touches } = e;\n const clientX = touches[0]?.clientX;\n startClientX = startClientX || 0;\n switch (name) {\n case 'onTouchStart':\n startClientX = clientX;\n break;\n case 'onTouchMove':\n lastLeft = _left - (startClientX - clientX);\n setLeft(lastLeft);\n break;\n case 'onTouchEnd':\n await swipe(lastLeft);\n break;\n default:\n }\n };\n\n /**\n * Wait helper\n */\n const wait = async (miliseconds: number): Promise<void> => {\n await new Promise((resolve) => {\n setTimeout(() => {\n resolve(0);\n }, miliseconds);\n });\n };\n\n /**\n * Touch event wrapper\n */\n const onTouchWrapper =\n (name: TouchName): ((event: TouchEvent<HTMLDivElement>) => void) =>\n (e): void => {\n onTouchHandler(name, e);\n };\n\n /**\n * On next or previous button click handler\n */\n const clickHandler = (origin: 'next' | 'prev'): (() => Promise<void>) => {\n const isNext = origin === 'next';\n return async (): Promise<void> => {\n const coeff = isNext ? -1 : 1;\n const leftVal = width * coeff;\n if (isNext) {\n setGoClass();\n } else {\n setBackClass();\n }\n setLeft(leftVal);\n await wait(SWIPE_TRANSITION_TIMEOUT / 2);\n await swipe(leftVal);\n };\n };\n\n /**\n * Wrapper for next button click handler\n */\n const clickNextHandler = clickHandler('next');\n\n /**\n * Wrapper for previous button click handler\n */\n const clickPrevHandler = clickHandler('prev');\n\n const resizeHandler = (): void => {\n const _width = containerRef?.current?.parentElement?.getBoundingClientRect()?.width;\n const _height = containerRef?.current?.parentElement?.getBoundingClientRect()?.height;\n const __left = containerRef?.current?.parentElement?.getBoundingClientRect()?.left;\n const _windowWidth = document.body.clientWidth;\n if (_width && _height) {\n setWidth(_width);\n setHeight(_height);\n }\n if (__left) {\n setLeft(__left);\n }\n if (_windowWidth) {\n setWindowWidth(_windowWidth);\n }\n };\n\n useEffect(() => {\n const _width = containerRef?.current?.parentElement?.getBoundingClientRect()?.width;\n const _height = containerRef?.current?.parentElement?.getBoundingClientRect()?.height;\n const __left = containerRef?.current?.parentElement?.getBoundingClientRect()?.left;\n const prevButton = prevButtonRef ? prevButtonRef?.current : _buttonPrevRef.current;\n const nextButton = nextButtonRef ? nextButtonRef?.current : _buttonNextRef.current;\n const _windowWidth = document.body.clientWidth;\n if (_width && !width && _height && !height) {\n setWidth(_width);\n setHeight(_height);\n }\n // save container left\n if (__left && !left) {\n _setLeft(__left);\n }\n // save window width\n if (!windowWidth && _windowWidth) {\n setWindowWidth(_windowWidth);\n }\n // set start cards\n if (!current || !prev || !next) {\n setCurrent(defaultCurrent);\n setNext(defaultNext);\n setPrev(defaultPrev);\n }\n // run invitation animation\n if (invitationAnimation && width && !animated) {\n animated = true;\n (async (): Promise<void> => {\n setGoClass();\n setLeft(-200);\n await wait(SWIPE_TRANSITION_TIMEOUT);\n setBackClass();\n setLeft(_left);\n })();\n }\n // set is mobile\n if (typeof isMobile === 'undefined') {\n setIsMobile('ontouchstart' in window || typeof navigator.msMaxTouchPoints !== 'undefined');\n }\n prevButton?.addEventListener('click', clickPrevHandler);\n nextButton?.addEventListener('click', clickNextHandler);\n window.addEventListener('resize', resizeHandler);\n return (): void => {\n prevButton?.removeEventListener('click', clickPrevHandler);\n nextButton?.removeEventListener('click', clickNextHandler);\n window.removeEventListener('resize', resizeHandler);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [next]);\n\n return (\n <div className={styles.container} ref={containerRef}>\n {/** absolute position cards */}\n {swipes.map((item) => (\n <div key={item.id}>\n {item.children && width ? (\n <div\n onTouchMove={onTouchWrapper('onTouchMove')}\n onTouchStart={onTouchWrapper('onTouchStart')}\n onTouchEnd={onTouchWrapper('onTouchEnd')}\n id={item.id.toString()}\n style={\n item.type === 'current'\n ? { width, height, left }\n : item.type === 'prev'\n ? { width, height, left: left - windowWidth }\n : { width, height, left: left + windowWidth }\n }\n className={clsx(\n styles.card,\n item.type === 'prev' ? styles.prev : item.type === 'next' ? styles.next : ''\n )}\n ref={getRef(item.id)}\n >\n {/** Block of content */}\n <div className={clsx(styles.content, className)}>{item.children}</div>\n </div>\n ) : (\n ''\n )}\n </div>\n ))}\n {typeof isMobile !== 'undefined' && !isMobile && !prevButtonRef && prev?.children !== null && (\n <div className={clsx(styles.button, styles.button_prev)} ref={_buttonPrevRef}>\n {windowWidth < 3000 ? <NextIcon /> : <NextBigIcon />}\n </div>\n )}\n {typeof isMobile !== 'undefined' && !isMobile && !nextButtonRef && next?.children !== null && (\n <div className={clsx(styles.button, styles.button_next)} ref={_buttonNextRef}>\n {windowWidth < 3000 ? <NextIcon /> : <NextBigIcon />}\n </div>\n )}\n </div>\n );\n};\n\nSwiper.defaultProps = {\n className: '',\n};\n\nexport default Swiper;\n"],"names":["SWIPE_TRANSITION_TIMEOUT","getSwipes","__prev","__current","__next","result","map","id","item","type","refs","startClientX","lastLeft","animated","Swiper","props","defaultCurrent","defaultNext","defaultPrev","getNext","getPrev","className","prevButtonRef","nextButtonRef","invitationAnimation","useState","current","setCurrent","prev","setPrev","next","setNext","windowWidth","setWindowWidth","height","setHeight","width","setWidth","_left","_setLeft","left","setLeft","isMobile","setIsMobile","containerRef","useRef","_buttonPrevRef","_buttonNextRef","swipes","useMemo","getRef","createRef","setGoClass","classList","add","styles","go","setTimeout","remove","setBackClass","back","swipe","_lastLeft","Math","abs","children","onTouchHandler","name","e","touches","clientX","wait","miliseconds","Promise","resolve","onTouchWrapper","clickHandler","origin","isNext","coeff","leftVal","clickNextHandler","clickPrevHandler","resizeHandler","_width","parentElement","getBoundingClientRect","_height","__left","_windowWidth","document","body","clientWidth","useEffect","prevButton","nextButton","window","navigator","msMaxTouchPoints","addEventListener","removeEventListener","React","container","ref","key","onTouchMove","onTouchStart","onTouchEnd","toString","style","clsx","card","content","button","button_prev","NextIcon","NextBigIcon","button_next","defaultProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACO,MAAM,KAAK,gBAAgB,CAAC,WAAW;AAC9C,CAAC,SAAS,KAAK,GAAG,EAAE;AACpB,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG,SAAS,WAAW,EAAE,UAAU,EAAE;AAC1D,EAAE,MAAM,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;AAC7B,EAAE,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC;AACvB,EAAE,IAAI,KAAK,EAAE;AACb,GAAG,MAAM,QAAQ,GAAG,KAAK,GAAG,CAAC,GAAG,WAAW,GAAG,UAAU,CAAC;AACzD,GAAG,IAAI,QAAQ,EAAE;AACjB,IAAI,IAAI;AACR,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1C,KAAK,CAAC,OAAO,CAAC,EAAE;AAChB,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3B,KAAK;AACL,IAAI,OAAO,MAAM,CAAC;AAClB,IAAI,M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CAACA,QAApC,IAAgD,CAACpB,aAAjD,IAAkE,CAAAM,IAAI,SAAJ,IAAAA,IAAI,WAAJ,YAAAA,IAAI,CAAEqC,QAAN,MAAmB,IAArF,IACCoC,4BAAA,MAAA;AAAKhF,IAAAA,SAAS,EAAEyF,IAAI,CAACvD,MAAM,CAAC0D,MAAR,EAAgB1D,MAAM,CAAC2D,WAAvB;AAAqCX,IAAAA,GAAG,EAAEzD;GAA9D,EACGd,WAAW,GAAG,IAAd,GAAqBqE,4BAAA,CAACc,wBAAD,MAAA,CAArB,GAAoCd,4BAAA,CAACe,wBAAD,MAAA,CADvC,CAhCJ,EAoCG,OAAO1E,QAAP,KAAoB,WAApB,IAAmC,CAACA,QAApC,IAAgD,CAACnB,aAAjD,IAAkE,CAAAO,IAAI,SAAJ,IAAAA,IAAI,WAAJ,YAAAA,IAAI,CAAEmC,QAAN,MAAmB,IAArF,IACCoC,4BAAA,MAAA;AAAKhF,IAAAA,SAAS,EAAEyF,IAAI,CAACvD,MAAM,CAAC0D,MAAR,EAAgB1D,MAAM,CAAC8D,WAAvB;AAAqCd,IAAAA,GAAG,EAAExD;GAA9D,EACGf,WAAW,GAAG,IAAd,GAAqBqE,4BAAA,CAACc,wBAAD,MAAA,CAArB,GAAoCd,4BAAA,CAACe,wBAAD,MAAA,CADvC,CArCJ,CADF;AA4CD,CA9RD;;AAgSAtG,MAAM,CAACwG,YAAP,GAAsB;AACpBjG,EAAAA,SAAS,EAAE;AADS,CAAtB;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../node_modules/babel-plugin-transform-async-to-promises/helpers.js","../src/index.tsx"],"sourcesContent":["// A type of promise-like that resolves synchronously and supports only one observer\nexport const _Pact = /*#__PURE__*/(function() {\n\tfunction _Pact() {}\n\t_Pact.prototype.then = function(onFulfilled, onRejected) {\n\t\tconst result = new _Pact();\n\t\tconst state = this.s;\n\t\tif (state) {\n\t\t\tconst callback = state & 1 ? onFulfilled : onRejected;\n\t\t\tif (callback) {\n\t\t\t\ttry {\n\t\t\t\t\t_settle(result, 1, callback(this.v));\n\t\t\t\t} catch (e) {\n\t\t\t\t\t_settle(result, 2, e);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\t\tthis.o = function(_this) {\n\t\t\ttry {\n\t\t\t\tconst value = _this.v;\n\t\t\t\tif (_this.s & 1) {\n\t\t\t\t\t_settle(result, 1, onFulfilled ? onFulfilled(value) : value);\n\t\t\t\t} else if (onRejected) {\n\t\t\t\t\t_settle(result, 1, onRejected(value));\n\t\t\t\t} else {\n\t\t\t\t\t_settle(result, 2, value);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(result, 2, e);\n\t\t\t}\n\t\t};\n\t\treturn result;\n\t}\n\treturn _Pact;\n})();\n\n// Settles a pact synchronously\nexport function _settle(pact, state, value) {\n\tif (!pact.s) {\n\t\tif (value instanceof _Pact) {\n\t\t\tif (value.s) {\n\t\t\t\tif (state & 1) {\n\t\t\t\t\tstate = value.s;\n\t\t\t\t}\n\t\t\t\tvalue = value.v;\n\t\t\t} else {\n\t\t\t\tvalue.o = _settle.bind(null, pact, state);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (value && value.then) {\n\t\t\tvalue.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));\n\t\t\treturn;\n\t\t}\n\t\tpact.s = state;\n\t\tpact.v = value;\n\t\tconst observer = pact.o;\n\t\tif (observer) {\n\t\t\tobserver(pact);\n\t\t}\n\t}\n}\n\nexport function _isSettledPact(thenable) {\n\treturn thenable instanceof _Pact && thenable.s & 1;\n}\n\n// Converts argument to a function that always returns a Promise\nexport function _async(f) {\n\treturn function() {\n\t\tfor (var args = [], i = 0; i < arguments.length; i++) {\n\t\t\targs[i] = arguments[i];\n\t\t}\n\t\ttry {\n\t\t\treturn Promise.resolve(f.apply(this, args));\n\t\t} catch(e) {\n\t\t\treturn Promise.reject(e);\n\t\t}\n\t}\n}\n\n// Awaits on a value that may or may not be a Promise (equivalent to the await keyword in ES2015, with continuations passed explicitly)\nexport function _await(value, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(value) : value;\n\t}\n\tif (!value || !value.then) {\n\t\tvalue = Promise.resolve(value);\n\t}\n\treturn then ? value.then(then) : value;\n}\n\n// Awaits on a value that may or may not be a Promise, then ignores it\nexport function _awaitIgnored(value, direct) {\n\tif (!direct) {\n\t\treturn value && value.then ? value.then(_empty) : Promise.resolve();\n\t}\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continue(value, then) {\n\treturn value && value.then ? value.then(then) : then(value);\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continueIgnored(value) {\n\tif (value && value.then) {\n\t\treturn value.then(_empty);\n\t}\n}\n\n// Asynchronously iterate through an object that has a length property, passing the index as the first argument to the callback (even as the length property changes)\nexport function _forTo(array, body, check) {\n\tvar i = -1, pact, reject;\n\tfunction _cycle(result) {\n\t\ttry {\n\t\t\twhile (++i < array.length && (!check || !check())) {\n\t\t\t\tresult = body(i);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pact) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t} else {\n\t\t\t\tpact = result;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t_settle(pact || (pact = new _Pact()), 2, e);\n\t\t}\n\t}\n\t_cycle();\n\treturn pact;\n}\n\n// Asynchronously iterate through an object's properties (including properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forIn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tkeys.push(key);\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\n// Asynchronously iterate through an object's own properties (excluding properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forOwn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tif (Object.prototype.hasOwnProperty.call(target, key)) {\n\t\t\tkeys.push(key);\n\t\t}\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\nexport const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== \"undefined\" ? (Symbol.iterator || (Symbol.iterator = Symbol(\"Symbol.iterator\"))) : \"@@iterator\";\n\n// Asynchronously iterate through an object's values\n// Uses for...of if the runtime supports it, otherwise iterates until length on a copy\nexport function _forOf(target, body, check) {\n\tif (typeof target[_iteratorSymbol] === \"function\") {\n\t\tvar iterator = target[_iteratorSymbol](), step, pact, reject;\n\t\tfunction _cycle(result) {\n\t\t\ttry {\n\t\t\t\twhile (!(step = iterator.next()).done && (!check || !check())) {\n\t\t\t\t\tresult = body(step.value);\n\t\t\t\t\tif (result && result.then) {\n\t\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (pact) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t} else {\n\t\t\t\t\tpact = result;\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(pact || (pact = new _Pact()), 2, e);\n\t\t\t}\n\t\t}\n\t\t_cycle();\n\t\tif (iterator.return) {\n\t\t\tvar _fixup = function(value) {\n\t\t\t\ttry {\n\t\t\t\t\tif (!step.done) {\n\t\t\t\t\t\titerator.return();\n\t\t\t\t\t}\n\t\t\t\t} catch(e) {\n\t\t\t\t}\n\t\t\t\treturn value;\n\t\t\t}\n\t\t\tif (pact && pact.then) {\n\t\t\t\treturn pact.then(_fixup, function(e) {\n\t\t\t\t\tthrow _fixup(e);\n\t\t\t\t});\n\t\t\t}\n\t\t\t_fixup();\n\t\t}\n\t\treturn pact;\n\t}\n\t// No support for Symbol.iterator\n\tif (!(\"length\" in target)) {\n\t\tthrow new TypeError(\"Object is not iterable\");\n\t}\n\t// Handle live collections properly\n\tvar values = [];\n\tfor (var i = 0; i < target.length; i++) {\n\t\tvalues.push(target[i]);\n\t}\n\treturn _forTo(values, function(i) { return body(values[i]); }, check);\n}\n\nexport const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== \"undefined\" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol(\"Symbol.asyncIterator\"))) : \"@@asyncIterator\";\n\n// Asynchronously iterate on a value using it's async iterator if present, or its synchronous iterator if missing\nexport function _forAwaitOf(target, body, check) {\n\tif (typeof target[_asyncIteratorSymbol] === \"function\") {\n\t\tvar pact = new _Pact();\n\t\tvar iterator = target[_asyncIteratorSymbol]();\n\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\treturn pact;\n\t\tfunction _resumeAfterBody(result) {\n\t\t\tif (check && check()) {\n\t\t\t\treturn _settle(pact, 1, iterator.return ? iterator.return().then(function() { return result; }) : result);\n\t\t\t}\n\t\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\t}\n\t\tfunction _resumeAfterNext(step) {\n\t\t\tif (step.done) {\n\t\t\t\t_settle(pact, 1);\n\t\t\t} else {\n\t\t\t\tPromise.resolve(body(step.value)).then(_resumeAfterBody).then(void 0, _reject);\n\t\t\t}\n\t\t}\n\t\tfunction _reject(error) {\n\t\t\t_settle(pact, 2, iterator.return ? iterator.return().then(function() { return error; }) : error);\n\t\t}\n\t}\n\treturn Promise.resolve(_forOf(target, function(value) { return Promise.resolve(value).then(body); }, check));\n}\n\n// Asynchronously implement a generic for loop\nexport function _for(test, update, body) {\n\tvar stage;\n\tfor (;;) {\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t\tif (shouldContinue.then) {\n\t\t\tstage = 0;\n\t\t\tbreak;\n\t\t}\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.s;\n\t\t\t} else {\n\t\t\t\tstage = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (update) {\n\t\t\tvar updateValue = update();\n\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\tstage = 2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tvar pact = new _Pact();\n\tvar reject = _settle.bind(null, pact, 2);\n\t(stage === 0 ? shouldContinue.then(_resumeAfterTest) : stage === 1 ? result.then(_resumeAfterBody) : updateValue.then(_resumeAfterUpdate)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tdo {\n\t\t\tif (update) {\n\t\t\t\tupdateValue = update();\n\t\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\t\tupdateValue.then(_resumeAfterUpdate).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tshouldContinue = test();\n\t\t\tif (!shouldContinue || (_isSettledPact(shouldContinue) && !shouldContinue.v)) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t}\n\t\t} while (!result || !result.then);\n\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterBody(result);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n\tfunction _resumeAfterUpdate() {\n\t\tif (shouldContinue = test()) {\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterTest(shouldContinue);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a do ... while loop\nexport function _do(body, test) {\n\tvar awaitBody;\n\tdo {\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t} else {\n\t\t\t\tawaitBody = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t} while (!shouldContinue.then);\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : shouldContinue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tfor (;;) {\n\t\t\tshouldContinue = test();\n\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t}\n\t\t\tif (!shouldContinue) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\tresult = result.v;\n\t\t\t\t} else {\n\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tdo {\n\t\t\t\tresult = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tshouldContinue = test();\n\t\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t\t}\n\t\t\t\tif (!shouldContinue) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} while (!shouldContinue.then);\n\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a switch statement\nexport function _switch(discriminant, cases) {\n\tvar dispatchIndex = -1;\n\tvar awaitBody;\n\touter: {\n\t\tfor (var i = 0; i < cases.length; i++) {\n\t\t\tvar test = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvar testValue = test();\n\t\t\t\tif (testValue && testValue.then) {\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tif (testValue === discriminant) {\n\t\t\t\t\tdispatchIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Found the default case, set it as the pending dispatch case\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tif (dispatchIndex !== -1) {\n\t\t\tdo {\n\t\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\t\twhile (!body) {\n\t\t\t\t\tdispatchIndex++;\n\t\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t\t}\n\t\t\t\tvar result = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tawaitBody = true;\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\t\tdispatchIndex++;\n\t\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t\treturn result;\n\t\t}\n\t}\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : testValue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterTest(value) {\n\t\tfor (;;) {\n\t\t\tif (value === discriminant) {\n\t\t\t\tdispatchIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (++i === cases.length) {\n\t\t\t\tif (dispatchIndex !== -1) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttest = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvalue = test();\n\t\t\t\tif (value && value.then) {\n\t\t\t\t\tvalue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tdo {\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tvar result = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tdispatchIndex++;\n\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterBody(result) {\n\t\tfor (;;) {\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tif (!fallthroughCheck || fallthroughCheck()) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdispatchIndex++;\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _call(body, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(body()) : body();\n\t}\n\ttry {\n\t\tvar result = Promise.resolve(body());\n\t\treturn then ? result.then(then) : result;\n\t} catch (e) {\n\t\treturn Promise.reject(e);\n\t}\n}\n\n// Asynchronously call a function and swallow the result\nexport function _callIgnored(body, direct) {\n\treturn _call(body, _empty, direct);\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _invoke(body, then) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(then);\n\t}\n\treturn then(result);\n}\n\n// Asynchronously call a function and swallow the result\nexport function _invokeIgnored(body) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(_empty);\n\t}\n}\n\n// Asynchronously call a function and send errors to recovery continuation\nexport function _catch(body, recover) {\n\ttry {\n\t\tvar result = body();\n\t} catch(e) {\n\t\treturn recover(e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(void 0, recover);\n\t}\n\treturn result;\n}\n\n// Asynchronously await a promise and pass the result to a finally continuation\nexport function _finallyRethrows(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer(true, e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer.bind(null, false), finalizer.bind(null, true));\n\t}\n\treturn finalizer(false, result);\n}\n\n// Asynchronously await a promise and invoke a finally continuation that always overrides the result\nexport function _finally(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer();\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer, finalizer);\n\t}\n\treturn finalizer();\n}\n\n// Rethrow or return a value from a finally continuation\nexport function _rethrow(thrown, value) {\n\tif (thrown)\n\t\tthrow value;\n\treturn value;\n}\n\n// Empty function to implement break and other control flow that ignores asynchronous results\nexport function _empty() {\n}\n\n// Sentinel value for early returns in generators \nexport const _earlyReturn = /*#__PURE__*/ {};\n\n// Asynchronously call a function and send errors to recovery continuation, skipping early returns\nexport function _catchInGenerator(body, recover) {\n\treturn _catch(body, function(e) {\n\t\tif (e === _earlyReturn) {\n\t\t\tthrow e;\n\t\t}\n\t\treturn recover(e);\n\t});\n}\n\n// Asynchronous generator class; accepts the entrypoint of the generator, to which it passes itself when the generator should start\nexport const _AsyncGenerator = /*#__PURE__*/(function() {\n\tfunction _AsyncGenerator(entry) {\n\t\tthis._entry = entry;\n\t\tthis._pact = null;\n\t\tthis._resolve = null;\n\t\tthis._return = null;\n\t\tthis._promise = null;\n\t}\n\n\tfunction _wrapReturnedValue(value) {\n\t\treturn { value: value, done: true };\n\t}\n\tfunction _wrapYieldedValue(value) {\n\t\treturn { value: value, done: false };\n\t}\n\n\t_AsyncGenerator.prototype._yield = function(value) {\n\t\t// Yield the value to the pending next call\n\t\tthis._resolve(value && value.then ? value.then(_wrapYieldedValue) : _wrapYieldedValue(value));\n\t\t// Return a pact for an upcoming next/return/throw call\n\t\treturn this._pact = new _Pact();\n\t};\n\t_AsyncGenerator.prototype.next = function(value) {\n\t\t// Advance the generator, starting it if it has yet to be started\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tconst _entry = _this._entry;\n\t\t\t\tif (_entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the next call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Start the generator\n\t\t\t\t_this._entry = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\tfunction returnValue(value) {\n\t\t\t\t\t_this._resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t_this._resolve = null;\n\t\t\t\t}\n\t\t\t\tvar result = _entry(_this);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tresult.then(returnValue, function(error) {\n\t\t\t\t\t\tif (error === _earlyReturn) {\n\t\t\t\t\t\t\treturnValue(_this._return);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst pact = new _Pact();\n\t\t\t\t\t\t\t_this._resolve(pact);\n\t\t\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t\t\t_this._resolve = null;\n\t\t\t\t\t\t\t_resolve(pact, 2, error);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\treturnValue(result);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Generator is started and a yield expression is pending, settle it\n\t\t\t\t_this._pact = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\t_settle(_pact, 1, value);\n\t\t\t}\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.return = function(value) {\n\t\t// Early return from the generator if started, otherwise abandons the generator\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the return call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return the specified value\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t}\n\t\t\t// Settle the yield expression with a rejected \"early return\" value\n\t\t\t_this._return = value;\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, _earlyReturn);\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.throw = function(error) {\n\t\t// Inject an exception into the pending yield expression\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve, reject) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the throw call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return a rejected Promise containing the error\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn reject(error);\n\t\t\t}\n\t\t\t// Settle the yield expression with the value as a rejection\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, error);\n\t\t});\n\t};\n\n\t_AsyncGenerator.prototype[_asyncIteratorSymbol] = function() {\n\t\treturn this;\n\t};\n\t\n\treturn _AsyncGenerator;\n})();\n","/******************************************************************************************\n * Repository: https://github.com/kolserdav/swiper.git\n * Author: Sergey Kolmiller\n * Email: <serega12101983@gmail.com>\n * License: MIT\n * License Text: The code is distributed as is. There are no guarantees regarding the functionality of the code or parts of it.\n * Copyright: kolserdav, All rights reserved (c)\n * Create date: Mon Nov 29 2021 16:18:08 GMT+0700 (Krasnoyarsk Standard Time)\n ******************************************************************************************/\nimport React, {\n useMemo,\n useState,\n useRef,\n createRef,\n RefObject,\n useEffect,\n TouchEvent,\n} from 'react';\nimport clsx from 'clsx';\nimport styles from './index.module.css';\nimport { ReactComponent as NextIcon } from './icons/navigate_next_black_24dp.svg';\nimport { ReactComponent as NextBigIcon } from './icons/navigate_next_black_48dp.svg';\n\n/**\n * Time to miliseconds of change animation by card left value\n */\nexport const SWIPE_TRANSITION_TIMEOUT = 400;\n\n/**\n * One of swipe card\n */\nexport interface Swipe {\n id: number | null;\n children: React.ReactElement | React.ReactElement[];\n}\n\n/**\n * Callback for get next or previous card content\n */\nexport type GetSwipeHandler = (oldId: number) => Swipe | Promise<Swipe>;\n\n/**\n * One of swipe card internal\n */\ninterface SwipeFull extends Swipe {\n type: 'next' | 'current' | 'prev';\n}\n\n/**\n * Event touch name\n */\ntype TouchName = 'onTouchMove' | 'onTouchStart' | 'onTouchEnd';\n\n/**\n * Props of Swiper component\n */\ninterface SwiperProps {\n /**\n * Current card content\n */\n defaultCurrent: Swipe;\n\n /**\n * Get next card handler\n */\n getNext: GetSwipeHandler;\n\n /**\n * Get previous card handler\n */\n getPrev: GetSwipeHandler;\n\n /**\n * Class name for content block\n */\n className?: string;\n\n /**\n * Button for swipe to next\n */\n nextButtonRef?: RefObject<HTMLButtonElement | HTMLDivElement | undefined>;\n\n /**\n * Button for swipe to previous\n */\n prevButtonRef?: RefObject<HTMLButtonElement | HTMLDivElement | undefined>;\n\n /**\n * invitation animation\n */\n invitationAnimation?: boolean;\n}\n\n/**\n * Create swipe list from values\n */\nconst getSwipes = (__prev: Swipe, __current: Swipe, __next: Swipe): SwipeFull[] => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result: any[] = [1, 2, 3].map((id) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const item: any = id === 1 ? { ...__prev } : id === 2 ? { ...__current } : { ...__next };\n item.type = id === 1 ? 'prev' : id === 2 ? 'current' : 'next';\n return item;\n });\n return result;\n};\n\n/**\n * Get default swipe with random id\n */\nconst getDefaultSwipe = (): Swipe => ({\n id: Math.ceil(Math.random() * 1000),\n children: <div></div>,\n});\n\nconst refs: {\n [key: number]: RefObject<HTMLDivElement>;\n} = {};\n\nlet startClientX: number;\nlet lastLeft: number;\nlet animated = false;\n\n/**\n * Swiper component\n */\nexport const Swiper = (props: SwiperProps): React.ReactElement => {\n const {\n defaultCurrent,\n getNext,\n getPrev,\n className,\n prevButtonRef,\n nextButtonRef,\n invitationAnimation,\n } = props;\n\n const [current, setCurrent] = useState<Swipe | null>();\n const [prev, setPrev] = useState<Swipe | null>();\n const [next, setNext] = useState<Swipe | null>();\n const [windowWidth, setWindowWidth] = useState<number>(0);\n const [height, setHeight] = useState<number>(0);\n const [width, setWidth] = useState<number>(0);\n const [_left, _setLeft] = useState<number>(0);\n const [left, setLeft] = useState<number>(0);\n const [isMobile, setIsMobile] = useState<boolean>();\n\n const containerRef = useRef<HTMLDivElement>(null);\n const _buttonPrevRef = useRef<HTMLDivElement>(null);\n const _buttonNextRef = useRef<HTMLDivElement>(null);\n\n /**\n * Create memoized swipes\n */\n const swipes = useMemo(\n () =>\n getSwipes(prev || getDefaultSwipe(), current || defaultCurrent, next || getDefaultSwipe()),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [next]\n );\n\n /**\n * Get new or exists ref by id\n */\n const getRef = (id: number): typeof refs[0] => {\n refs[id] = refs[id] ? refs[id] : createRef<HTMLDivElement>();\n return refs[id];\n };\n\n /**\n * Set to cards classes for in animation\n */\n const setGoClass = (): void => {\n getRef(next?.id || 0).current?.classList.add(styles.go);\n getRef(prev?.id || 0).current?.classList.add(styles.go);\n getRef(current?.id || 0).current?.classList.add(styles.go);\n setTimeout(() => {\n getRef(next?.id || 0).current?.classList.remove(styles.go);\n getRef(prev?.id || 0).current?.classList.remove(styles.go);\n getRef(current?.id || 0).current?.classList.remove(styles.go);\n }, SWIPE_TRANSITION_TIMEOUT);\n };\n\n /**\n * Set to cards classes for out animation\n */\n const setBackClass = (): void => {\n getRef(next?.id || 0).current?.classList.add(styles.back);\n getRef(prev?.id || 0).current?.classList.add(styles.back);\n getRef(current?.id || 0).current?.classList.add(styles.back);\n setLeft(0);\n setTimeout(() => {\n getRef(next?.id || 0).current?.classList.remove(styles.back);\n getRef(prev?.id || 0).current?.classList.remove(styles.back);\n getRef(current?.id || 0).current?.classList.remove(styles.back);\n }, SWIPE_TRANSITION_TIMEOUT);\n };\n\n /**\n * Run swipe animation\n */\n const swipe = async (_lastLeft: number): Promise<1 | 0> => {\n if (Math.abs(_lastLeft) > width / 3) {\n setLeft(0);\n if (_lastLeft < 0) {\n if (!next?.id) {\n setBackClass();\n return 1;\n }\n setPrev(current);\n setCurrent(next);\n setNext(await getNext(next?.id || 0));\n } else {\n if (!prev?.id) {\n setBackClass();\n return 1;\n }\n setPrev(await getPrev(prev?.id || 0));\n setCurrent(prev);\n setNext(current);\n }\n setGoClass();\n } else {\n setBackClass();\n }\n return 0;\n };\n\n /**\n * Touch event handler\n */\n const onTouchHandler = async (name: TouchName, e: TouchEvent): Promise<void> => {\n const { touches } = e;\n const clientX = touches[0]?.clientX;\n startClientX = startClientX || 0;\n switch (name) {\n case 'onTouchStart':\n startClientX = clientX;\n break;\n case 'onTouchMove':\n lastLeft = _left - (startClientX - clientX);\n setLeft(lastLeft);\n break;\n case 'onTouchEnd':\n await swipe(lastLeft);\n break;\n default:\n }\n };\n\n /**\n * Wait helper\n */\n const wait = async (miliseconds: number): Promise<void> => {\n await new Promise((resolve) => {\n setTimeout(() => {\n resolve(0);\n }, miliseconds);\n });\n };\n\n /**\n * Touch event wrapper\n */\n const onTouchWrapper =\n (name: TouchName): ((event: TouchEvent<HTMLDivElement>) => void) =>\n (e): void => {\n onTouchHandler(name, e);\n };\n\n /**\n * On next or previous button click handler\n */\n const clickHandler = (origin: 'next' | 'prev'): (() => Promise<void>) => {\n const isNext = origin === 'next';\n return async (): Promise<void> => {\n const coeff = isNext ? -1 : 1;\n const leftVal = width * coeff;\n if (isNext) {\n setGoClass();\n } else {\n setBackClass();\n }\n setLeft(leftVal);\n await wait(SWIPE_TRANSITION_TIMEOUT / 2);\n await swipe(leftVal);\n };\n };\n\n /**\n * Wrapper for next button click handler\n */\n const clickNextHandler = clickHandler('next');\n\n /**\n * Wrapper for previous button click handler\n */\n const clickPrevHandler = clickHandler('prev');\n\n const resizeHandler = (): void => {\n const _width = containerRef?.current?.parentElement?.getBoundingClientRect()?.width;\n const _height = containerRef?.current?.parentElement?.getBoundingClientRect()?.height;\n const __left = containerRef?.current?.parentElement?.getBoundingClientRect()?.left;\n const _windowWidth = document.body.clientWidth;\n if (_width && _height) {\n setWidth(_width);\n setHeight(_height);\n }\n if (__left) {\n setLeft(__left);\n }\n if (_windowWidth) {\n setWindowWidth(_windowWidth);\n }\n };\n\n useEffect(() => {\n const _width = containerRef?.current?.parentElement?.getBoundingClientRect()?.width;\n const _height = containerRef?.current?.parentElement?.getBoundingClientRect()?.height;\n const __left = containerRef?.current?.parentElement?.getBoundingClientRect()?.left;\n const prevButton = prevButtonRef ? prevButtonRef?.current : _buttonPrevRef.current;\n const nextButton = nextButtonRef ? nextButtonRef?.current : _buttonNextRef.current;\n const _windowWidth = document.body.clientWidth;\n if (_width && !width && _height && !height) {\n setWidth(_width);\n setHeight(_height);\n }\n // save container left\n if (__left && !left) {\n _setLeft(__left);\n }\n // save window width\n if (!windowWidth && _windowWidth) {\n setWindowWidth(_windowWidth);\n }\n // set start cards\n if (!current || !prev || !next) {\n setCurrent(defaultCurrent);\n (async (): Promise<void> => {\n setNext(await getNext(defaultCurrent.id || 0));\n setPrev(await getPrev(defaultCurrent.id || 0));\n })();\n }\n // run invitation animation\n if (invitationAnimation && width && !animated) {\n animated = true;\n (async (): Promise<void> => {\n setGoClass();\n setLeft(-200);\n await wait(SWIPE_TRANSITION_TIMEOUT);\n setBackClass();\n setLeft(_left);\n })();\n }\n // set is mobile\n if (typeof isMobile === 'undefined') {\n setIsMobile('ontouchstart' in window || typeof navigator.msMaxTouchPoints !== 'undefined');\n }\n prevButton?.addEventListener('click', clickPrevHandler);\n nextButton?.addEventListener('click', clickNextHandler);\n window.addEventListener('resize', resizeHandler);\n return (): void => {\n prevButton?.removeEventListener('click', clickPrevHandler);\n nextButton?.removeEventListener('click', clickNextHandler);\n window.removeEventListener('resize', resizeHandler);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [next]);\n\n console.log(swipes);\n\n return (\n <div className={styles.container} ref={containerRef}>\n {/** absolute position cards */}\n {swipes.map((item) => (\n <div key={item.id} style={!item?.id ? { display: 'none' } : {}}>\n {item.id && width && (\n <div\n onTouchMove={onTouchWrapper('onTouchMove')}\n onTouchStart={onTouchWrapper('onTouchStart')}\n onTouchEnd={onTouchWrapper('onTouchEnd')}\n id={item.id?.toString()}\n style={\n item.type === 'current'\n ? { width, height, left }\n : item.type === 'prev'\n ? { width, height, left: left - windowWidth }\n : { width, height, left: left + windowWidth }\n }\n className={clsx(\n styles.card,\n item.type === 'prev' ? styles.prev : item.type === 'next' ? styles.next : ''\n )}\n ref={getRef(item.id)}\n >\n {/** Block of content */}\n <div className={clsx(styles.content, className)}>{item.children}</div>\n </div>\n )}\n </div>\n ))}\n {typeof isMobile !== 'undefined' && !isMobile && !prevButtonRef && prev?.id && (\n <div className={clsx(styles.button, styles.button_prev)} ref={_buttonPrevRef}>\n {windowWidth < 3000 ? <NextIcon /> : <NextBigIcon />}\n </div>\n )}\n {typeof isMobile !== 'undefined' && !isMobile && !nextButtonRef && next?.id && (\n <div className={clsx(styles.button, styles.button_next)} ref={_buttonNextRef}>\n {windowWidth < 3000 ? <NextIcon /> : <NextBigIcon />}\n </div>\n )}\n </div>\n );\n};\n\nSwiper.defaultProps = {\n className: '',\n};\n"],"names":["SWIPE_TRANSITION_TIMEOUT","getSwipes","__prev","__current","__next","result","map","id","item","type","getDefaultSwipe","Math","ceil","random","children","React","refs","startClientX","lastLeft","animated","Swiper","props","defaultCurrent","getNext","getPrev","className","prevButtonRef","nextButtonRef","invitationAnimation","useState","current","setCurrent","prev","setPrev","next","setNext","windowWidth","setWindowWidth","height","setHeight","width","setWidth","_left","_setLeft","left","setLeft","isMobile","setIsMobile","containerRef","useRef","_buttonPrevRef","_buttonNextRef","swipes","useMemo","getRef","createRef","setGoClass","classList","add","styles","go","setTimeout","remove","setBackClass","back","swipe","_lastLeft","abs","onTouchHandler","name","e","touches","clientX","wait","miliseconds","Promise","resolve","onTouchWrapper","clickHandler","origin","isNext","coeff","leftVal","clickNextHandler","clickPrevHandler","resizeHandler","_width","parentElement","getBoundingClientRect","_height","__left","_windowWidth","document","body","clientWidth","useEffect","prevButton","nextButton","window","navigator","msMaxTouchPoints","addEventListener","removeEventListener","console","log","container","ref","key","style","display","onTouchMove","onTouchStart","onTouchEnd","toString","clsx","card","content","button","button_prev","NextIcon","NextBigIcon","button_next","defaultProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACO,MAAM,KAAK,gBAAgB,CAAC,WAAW;AAC9C,CAAC,SAAS,KAAK,GAAG,EAAE;AACpB,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG,SAAS,WAAW,EAAE,UAAU,EAAE;AAC1D,EAAE,MAAM,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;AAC7B,EAAE,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC;AACvB,EAAE,IAAI,KAAK,EAAE;AACb,GAAG,MAAM,QAAQ,GAAG,KAAK,GAAG,CAAC,GAAG,WAAW,GAAG,UAAU,CAAC;AACzD,GAAG,IAAI,QAAQ,EAAE;AACjB,IAAI,IAAI;AACR,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1C,KAAK,CAAC,OAAO,CAAC,EAAE;AAChB,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3B,KAAK;AACL,IAAI,OAAO,MAAM,CAAC;AAClB,IAAI,MAAM;AACV,IAAI,OAAO,IAAI,CAAC;AAChB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index.modern.js
CHANGED
|
@@ -274,15 +274,19 @@ var getSwipes = function getSwipes(__prev, __current, __next) {
|
|
|
274
274
|
return result;
|
|
275
275
|
};
|
|
276
276
|
|
|
277
|
+
var getDefaultSwipe = function getDefaultSwipe() {
|
|
278
|
+
return {
|
|
279
|
+
id: Math.ceil(Math.random() * 1000),
|
|
280
|
+
children: React__default.createElement("div", null)
|
|
281
|
+
};
|
|
282
|
+
};
|
|
283
|
+
|
|
277
284
|
var refs = {};
|
|
278
285
|
var startClientX;
|
|
279
286
|
var lastLeft;
|
|
280
287
|
var animated = false;
|
|
281
|
-
|
|
282
288
|
var Swiper = function Swiper(props) {
|
|
283
289
|
var defaultCurrent = props.defaultCurrent,
|
|
284
|
-
defaultNext = props.defaultNext,
|
|
285
|
-
defaultPrev = props.defaultPrev,
|
|
286
290
|
getNext = props.getNext,
|
|
287
291
|
getPrev = props.getPrev,
|
|
288
292
|
className = props.className,
|
|
@@ -333,7 +337,7 @@ var Swiper = function Swiper(props) {
|
|
|
333
337
|
var _buttonNextRef = useRef(null);
|
|
334
338
|
|
|
335
339
|
var swipes = useMemo(function () {
|
|
336
|
-
return getSwipes(prev ||
|
|
340
|
+
return getSwipes(prev || getDefaultSwipe(), current || defaultCurrent, next || getDefaultSwipe());
|
|
337
341
|
}, [next]);
|
|
338
342
|
|
|
339
343
|
var getRef = function getRef(id) {
|
|
@@ -387,7 +391,7 @@ var Swiper = function Swiper(props) {
|
|
|
387
391
|
|
|
388
392
|
var _temp6 = function () {
|
|
389
393
|
if (_lastLeft < 0) {
|
|
390
|
-
if ((next
|
|
394
|
+
if (!(next !== null && next !== void 0 && next.id)) {
|
|
391
395
|
setBackClass();
|
|
392
396
|
_exit2 = true;
|
|
393
397
|
return 1;
|
|
@@ -399,7 +403,7 @@ var Swiper = function Swiper(props) {
|
|
|
399
403
|
setNext(_getNext);
|
|
400
404
|
});
|
|
401
405
|
} else {
|
|
402
|
-
if ((prev
|
|
406
|
+
if (!(prev !== null && prev !== void 0 && prev.id)) {
|
|
403
407
|
setBackClass();
|
|
404
408
|
_exit2 = true;
|
|
405
409
|
return 1;
|
|
@@ -558,8 +562,17 @@ var Swiper = function Swiper(props) {
|
|
|
558
562
|
|
|
559
563
|
if (!current || !prev || !next) {
|
|
560
564
|
setCurrent(defaultCurrent);
|
|
561
|
-
|
|
562
|
-
|
|
565
|
+
|
|
566
|
+
try {
|
|
567
|
+
return Promise.resolve(getNext(defaultCurrent.id || 0)).then(function (_getNext2) {
|
|
568
|
+
setNext(_getNext2);
|
|
569
|
+
return Promise.resolve(getPrev(defaultCurrent.id || 0)).then(function (_getPrev2) {
|
|
570
|
+
setPrev(_getPrev2);
|
|
571
|
+
});
|
|
572
|
+
});
|
|
573
|
+
} catch (e) {
|
|
574
|
+
Promise.reject(e);
|
|
575
|
+
}
|
|
563
576
|
}
|
|
564
577
|
|
|
565
578
|
if (invitationAnimation && width && !animated) {
|
|
@@ -590,17 +603,23 @@ var Swiper = function Swiper(props) {
|
|
|
590
603
|
window.removeEventListener('resize', resizeHandler);
|
|
591
604
|
};
|
|
592
605
|
}, [next]);
|
|
606
|
+
console.log(swipes);
|
|
593
607
|
return React__default.createElement("div", {
|
|
594
608
|
className: styles.container,
|
|
595
609
|
ref: containerRef
|
|
596
610
|
}, swipes.map(function (item) {
|
|
611
|
+
var _item$id;
|
|
612
|
+
|
|
597
613
|
return React__default.createElement("div", {
|
|
598
|
-
key: item.id
|
|
599
|
-
|
|
614
|
+
key: item.id,
|
|
615
|
+
style: !(item !== null && item !== void 0 && item.id) ? {
|
|
616
|
+
display: 'none'
|
|
617
|
+
} : {}
|
|
618
|
+
}, item.id && width && React__default.createElement("div", {
|
|
600
619
|
onTouchMove: onTouchWrapper('onTouchMove'),
|
|
601
620
|
onTouchStart: onTouchWrapper('onTouchStart'),
|
|
602
621
|
onTouchEnd: onTouchWrapper('onTouchEnd'),
|
|
603
|
-
id: item.id.toString(),
|
|
622
|
+
id: (_item$id = item.id) === null || _item$id === void 0 ? void 0 : _item$id.toString(),
|
|
604
623
|
style: item.type === 'current' ? {
|
|
605
624
|
width: width,
|
|
606
625
|
height: height,
|
|
@@ -618,20 +637,18 @@ var Swiper = function Swiper(props) {
|
|
|
618
637
|
ref: getRef(item.id)
|
|
619
638
|
}, React__default.createElement("div", {
|
|
620
639
|
className: clsx(styles.content, className)
|
|
621
|
-
}, item.children))
|
|
622
|
-
}), typeof isMobile !== 'undefined' && !isMobile && !prevButtonRef && (prev === null || prev === void 0 ? void 0 : prev.
|
|
640
|
+
}, item.children)));
|
|
641
|
+
}), typeof isMobile !== 'undefined' && !isMobile && !prevButtonRef && (prev === null || prev === void 0 ? void 0 : prev.id) && React__default.createElement("div", {
|
|
623
642
|
className: clsx(styles.button, styles.button_prev),
|
|
624
643
|
ref: _buttonPrevRef
|
|
625
|
-
}, windowWidth < 3000 ? React__default.createElement(SvgNavigateNextBlack24Dp, null) : React__default.createElement(SvgNavigateNextBlack48Dp, null)), typeof isMobile !== 'undefined' && !isMobile && !nextButtonRef && (next === null || next === void 0 ? void 0 : next.
|
|
644
|
+
}, windowWidth < 3000 ? React__default.createElement(SvgNavigateNextBlack24Dp, null) : React__default.createElement(SvgNavigateNextBlack48Dp, null)), typeof isMobile !== 'undefined' && !isMobile && !nextButtonRef && (next === null || next === void 0 ? void 0 : next.id) && React__default.createElement("div", {
|
|
626
645
|
className: clsx(styles.button, styles.button_next),
|
|
627
646
|
ref: _buttonNextRef
|
|
628
647
|
}, windowWidth < 3000 ? React__default.createElement(SvgNavigateNextBlack24Dp, null) : React__default.createElement(SvgNavigateNextBlack48Dp, null)));
|
|
629
648
|
};
|
|
630
|
-
|
|
631
649
|
Swiper.defaultProps = {
|
|
632
650
|
className: ''
|
|
633
651
|
};
|
|
634
652
|
|
|
635
|
-
export
|
|
636
|
-
export { SWIPE_TRANSITION_TIMEOUT };
|
|
653
|
+
export { SWIPE_TRANSITION_TIMEOUT, Swiper };
|
|
637
654
|
//# sourceMappingURL=index.modern.js.map
|
package/dist/index.modern.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.modern.js","sources":["../node_modules/babel-plugin-transform-async-to-promises/helpers.js","../src/index.tsx"],"sourcesContent":["// A type of promise-like that resolves synchronously and supports only one observer\nexport const _Pact = /*#__PURE__*/(function() {\n\tfunction _Pact() {}\n\t_Pact.prototype.then = function(onFulfilled, onRejected) {\n\t\tconst result = new _Pact();\n\t\tconst state = this.s;\n\t\tif (state) {\n\t\t\tconst callback = state & 1 ? onFulfilled : onRejected;\n\t\t\tif (callback) {\n\t\t\t\ttry {\n\t\t\t\t\t_settle(result, 1, callback(this.v));\n\t\t\t\t} catch (e) {\n\t\t\t\t\t_settle(result, 2, e);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\t\tthis.o = function(_this) {\n\t\t\ttry {\n\t\t\t\tconst value = _this.v;\n\t\t\t\tif (_this.s & 1) {\n\t\t\t\t\t_settle(result, 1, onFulfilled ? onFulfilled(value) : value);\n\t\t\t\t} else if (onRejected) {\n\t\t\t\t\t_settle(result, 1, onRejected(value));\n\t\t\t\t} else {\n\t\t\t\t\t_settle(result, 2, value);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(result, 2, e);\n\t\t\t}\n\t\t};\n\t\treturn result;\n\t}\n\treturn _Pact;\n})();\n\n// Settles a pact synchronously\nexport function _settle(pact, state, value) {\n\tif (!pact.s) {\n\t\tif (value instanceof _Pact) {\n\t\t\tif (value.s) {\n\t\t\t\tif (state & 1) {\n\t\t\t\t\tstate = value.s;\n\t\t\t\t}\n\t\t\t\tvalue = value.v;\n\t\t\t} else {\n\t\t\t\tvalue.o = _settle.bind(null, pact, state);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (value && value.then) {\n\t\t\tvalue.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));\n\t\t\treturn;\n\t\t}\n\t\tpact.s = state;\n\t\tpact.v = value;\n\t\tconst observer = pact.o;\n\t\tif (observer) {\n\t\t\tobserver(pact);\n\t\t}\n\t}\n}\n\nexport function _isSettledPact(thenable) {\n\treturn thenable instanceof _Pact && thenable.s & 1;\n}\n\n// Converts argument to a function that always returns a Promise\nexport function _async(f) {\n\treturn function() {\n\t\tfor (var args = [], i = 0; i < arguments.length; i++) {\n\t\t\targs[i] = arguments[i];\n\t\t}\n\t\ttry {\n\t\t\treturn Promise.resolve(f.apply(this, args));\n\t\t} catch(e) {\n\t\t\treturn Promise.reject(e);\n\t\t}\n\t}\n}\n\n// Awaits on a value that may or may not be a Promise (equivalent to the await keyword in ES2015, with continuations passed explicitly)\nexport function _await(value, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(value) : value;\n\t}\n\tif (!value || !value.then) {\n\t\tvalue = Promise.resolve(value);\n\t}\n\treturn then ? value.then(then) : value;\n}\n\n// Awaits on a value that may or may not be a Promise, then ignores it\nexport function _awaitIgnored(value, direct) {\n\tif (!direct) {\n\t\treturn value && value.then ? value.then(_empty) : Promise.resolve();\n\t}\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continue(value, then) {\n\treturn value && value.then ? value.then(then) : then(value);\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continueIgnored(value) {\n\tif (value && value.then) {\n\t\treturn value.then(_empty);\n\t}\n}\n\n// Asynchronously iterate through an object that has a length property, passing the index as the first argument to the callback (even as the length property changes)\nexport function _forTo(array, body, check) {\n\tvar i = -1, pact, reject;\n\tfunction _cycle(result) {\n\t\ttry {\n\t\t\twhile (++i < array.length && (!check || !check())) {\n\t\t\t\tresult = body(i);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pact) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t} else {\n\t\t\t\tpact = result;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t_settle(pact || (pact = new _Pact()), 2, e);\n\t\t}\n\t}\n\t_cycle();\n\treturn pact;\n}\n\n// Asynchronously iterate through an object's properties (including properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forIn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tkeys.push(key);\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\n// Asynchronously iterate through an object's own properties (excluding properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forOwn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tif (Object.prototype.hasOwnProperty.call(target, key)) {\n\t\t\tkeys.push(key);\n\t\t}\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\nexport const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== \"undefined\" ? (Symbol.iterator || (Symbol.iterator = Symbol(\"Symbol.iterator\"))) : \"@@iterator\";\n\n// Asynchronously iterate through an object's values\n// Uses for...of if the runtime supports it, otherwise iterates until length on a copy\nexport function _forOf(target, body, check) {\n\tif (typeof target[_iteratorSymbol] === \"function\") {\n\t\tvar iterator = target[_iteratorSymbol](), step, pact, reject;\n\t\tfunction _cycle(result) {\n\t\t\ttry {\n\t\t\t\twhile (!(step = iterator.next()).done && (!check || !check())) {\n\t\t\t\t\tresult = body(step.value);\n\t\t\t\t\tif (result && result.then) {\n\t\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (pact) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t} else {\n\t\t\t\t\tpact = result;\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(pact || (pact = new _Pact()), 2, e);\n\t\t\t}\n\t\t}\n\t\t_cycle();\n\t\tif (iterator.return) {\n\t\t\tvar _fixup = function(value) {\n\t\t\t\ttry {\n\t\t\t\t\tif (!step.done) {\n\t\t\t\t\t\titerator.return();\n\t\t\t\t\t}\n\t\t\t\t} catch(e) {\n\t\t\t\t}\n\t\t\t\treturn value;\n\t\t\t}\n\t\t\tif (pact && pact.then) {\n\t\t\t\treturn pact.then(_fixup, function(e) {\n\t\t\t\t\tthrow _fixup(e);\n\t\t\t\t});\n\t\t\t}\n\t\t\t_fixup();\n\t\t}\n\t\treturn pact;\n\t}\n\t// No support for Symbol.iterator\n\tif (!(\"length\" in target)) {\n\t\tthrow new TypeError(\"Object is not iterable\");\n\t}\n\t// Handle live collections properly\n\tvar values = [];\n\tfor (var i = 0; i < target.length; i++) {\n\t\tvalues.push(target[i]);\n\t}\n\treturn _forTo(values, function(i) { return body(values[i]); }, check);\n}\n\nexport const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== \"undefined\" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol(\"Symbol.asyncIterator\"))) : \"@@asyncIterator\";\n\n// Asynchronously iterate on a value using it's async iterator if present, or its synchronous iterator if missing\nexport function _forAwaitOf(target, body, check) {\n\tif (typeof target[_asyncIteratorSymbol] === \"function\") {\n\t\tvar pact = new _Pact();\n\t\tvar iterator = target[_asyncIteratorSymbol]();\n\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\treturn pact;\n\t\tfunction _resumeAfterBody(result) {\n\t\t\tif (check && check()) {\n\t\t\t\treturn _settle(pact, 1, iterator.return ? iterator.return().then(function() { return result; }) : result);\n\t\t\t}\n\t\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\t}\n\t\tfunction _resumeAfterNext(step) {\n\t\t\tif (step.done) {\n\t\t\t\t_settle(pact, 1);\n\t\t\t} else {\n\t\t\t\tPromise.resolve(body(step.value)).then(_resumeAfterBody).then(void 0, _reject);\n\t\t\t}\n\t\t}\n\t\tfunction _reject(error) {\n\t\t\t_settle(pact, 2, iterator.return ? iterator.return().then(function() { return error; }) : error);\n\t\t}\n\t}\n\treturn Promise.resolve(_forOf(target, function(value) { return Promise.resolve(value).then(body); }, check));\n}\n\n// Asynchronously implement a generic for loop\nexport function _for(test, update, body) {\n\tvar stage;\n\tfor (;;) {\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t\tif (shouldContinue.then) {\n\t\t\tstage = 0;\n\t\t\tbreak;\n\t\t}\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.s;\n\t\t\t} else {\n\t\t\t\tstage = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (update) {\n\t\t\tvar updateValue = update();\n\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\tstage = 2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tvar pact = new _Pact();\n\tvar reject = _settle.bind(null, pact, 2);\n\t(stage === 0 ? shouldContinue.then(_resumeAfterTest) : stage === 1 ? result.then(_resumeAfterBody) : updateValue.then(_resumeAfterUpdate)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tdo {\n\t\t\tif (update) {\n\t\t\t\tupdateValue = update();\n\t\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\t\tupdateValue.then(_resumeAfterUpdate).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tshouldContinue = test();\n\t\t\tif (!shouldContinue || (_isSettledPact(shouldContinue) && !shouldContinue.v)) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t}\n\t\t} while (!result || !result.then);\n\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterBody(result);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n\tfunction _resumeAfterUpdate() {\n\t\tif (shouldContinue = test()) {\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterTest(shouldContinue);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a do ... while loop\nexport function _do(body, test) {\n\tvar awaitBody;\n\tdo {\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t} else {\n\t\t\t\tawaitBody = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t} while (!shouldContinue.then);\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : shouldContinue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tfor (;;) {\n\t\t\tshouldContinue = test();\n\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t}\n\t\t\tif (!shouldContinue) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\tresult = result.v;\n\t\t\t\t} else {\n\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tdo {\n\t\t\t\tresult = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tshouldContinue = test();\n\t\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t\t}\n\t\t\t\tif (!shouldContinue) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} while (!shouldContinue.then);\n\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a switch statement\nexport function _switch(discriminant, cases) {\n\tvar dispatchIndex = -1;\n\tvar awaitBody;\n\touter: {\n\t\tfor (var i = 0; i < cases.length; i++) {\n\t\t\tvar test = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvar testValue = test();\n\t\t\t\tif (testValue && testValue.then) {\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tif (testValue === discriminant) {\n\t\t\t\t\tdispatchIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Found the default case, set it as the pending dispatch case\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tif (dispatchIndex !== -1) {\n\t\t\tdo {\n\t\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\t\twhile (!body) {\n\t\t\t\t\tdispatchIndex++;\n\t\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t\t}\n\t\t\t\tvar result = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tawaitBody = true;\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\t\tdispatchIndex++;\n\t\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t\treturn result;\n\t\t}\n\t}\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : testValue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterTest(value) {\n\t\tfor (;;) {\n\t\t\tif (value === discriminant) {\n\t\t\t\tdispatchIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (++i === cases.length) {\n\t\t\t\tif (dispatchIndex !== -1) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttest = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvalue = test();\n\t\t\t\tif (value && value.then) {\n\t\t\t\t\tvalue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tdo {\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tvar result = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tdispatchIndex++;\n\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterBody(result) {\n\t\tfor (;;) {\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tif (!fallthroughCheck || fallthroughCheck()) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdispatchIndex++;\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _call(body, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(body()) : body();\n\t}\n\ttry {\n\t\tvar result = Promise.resolve(body());\n\t\treturn then ? result.then(then) : result;\n\t} catch (e) {\n\t\treturn Promise.reject(e);\n\t}\n}\n\n// Asynchronously call a function and swallow the result\nexport function _callIgnored(body, direct) {\n\treturn _call(body, _empty, direct);\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _invoke(body, then) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(then);\n\t}\n\treturn then(result);\n}\n\n// Asynchronously call a function and swallow the result\nexport function _invokeIgnored(body) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(_empty);\n\t}\n}\n\n// Asynchronously call a function and send errors to recovery continuation\nexport function _catch(body, recover) {\n\ttry {\n\t\tvar result = body();\n\t} catch(e) {\n\t\treturn recover(e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(void 0, recover);\n\t}\n\treturn result;\n}\n\n// Asynchronously await a promise and pass the result to a finally continuation\nexport function _finallyRethrows(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer(true, e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer.bind(null, false), finalizer.bind(null, true));\n\t}\n\treturn finalizer(false, result);\n}\n\n// Asynchronously await a promise and invoke a finally continuation that always overrides the result\nexport function _finally(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer();\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer, finalizer);\n\t}\n\treturn finalizer();\n}\n\n// Rethrow or return a value from a finally continuation\nexport function _rethrow(thrown, value) {\n\tif (thrown)\n\t\tthrow value;\n\treturn value;\n}\n\n// Empty function to implement break and other control flow that ignores asynchronous results\nexport function _empty() {\n}\n\n// Sentinel value for early returns in generators \nexport const _earlyReturn = /*#__PURE__*/ {};\n\n// Asynchronously call a function and send errors to recovery continuation, skipping early returns\nexport function _catchInGenerator(body, recover) {\n\treturn _catch(body, function(e) {\n\t\tif (e === _earlyReturn) {\n\t\t\tthrow e;\n\t\t}\n\t\treturn recover(e);\n\t});\n}\n\n// Asynchronous generator class; accepts the entrypoint of the generator, to which it passes itself when the generator should start\nexport const _AsyncGenerator = /*#__PURE__*/(function() {\n\tfunction _AsyncGenerator(entry) {\n\t\tthis._entry = entry;\n\t\tthis._pact = null;\n\t\tthis._resolve = null;\n\t\tthis._return = null;\n\t\tthis._promise = null;\n\t}\n\n\tfunction _wrapReturnedValue(value) {\n\t\treturn { value: value, done: true };\n\t}\n\tfunction _wrapYieldedValue(value) {\n\t\treturn { value: value, done: false };\n\t}\n\n\t_AsyncGenerator.prototype._yield = function(value) {\n\t\t// Yield the value to the pending next call\n\t\tthis._resolve(value && value.then ? value.then(_wrapYieldedValue) : _wrapYieldedValue(value));\n\t\t// Return a pact for an upcoming next/return/throw call\n\t\treturn this._pact = new _Pact();\n\t};\n\t_AsyncGenerator.prototype.next = function(value) {\n\t\t// Advance the generator, starting it if it has yet to be started\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tconst _entry = _this._entry;\n\t\t\t\tif (_entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the next call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Start the generator\n\t\t\t\t_this._entry = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\tfunction returnValue(value) {\n\t\t\t\t\t_this._resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t_this._resolve = null;\n\t\t\t\t}\n\t\t\t\tvar result = _entry(_this);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tresult.then(returnValue, function(error) {\n\t\t\t\t\t\tif (error === _earlyReturn) {\n\t\t\t\t\t\t\treturnValue(_this._return);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst pact = new _Pact();\n\t\t\t\t\t\t\t_this._resolve(pact);\n\t\t\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t\t\t_this._resolve = null;\n\t\t\t\t\t\t\t_resolve(pact, 2, error);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\treturnValue(result);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Generator is started and a yield expression is pending, settle it\n\t\t\t\t_this._pact = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\t_settle(_pact, 1, value);\n\t\t\t}\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.return = function(value) {\n\t\t// Early return from the generator if started, otherwise abandons the generator\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the return call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return the specified value\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t}\n\t\t\t// Settle the yield expression with a rejected \"early return\" value\n\t\t\t_this._return = value;\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, _earlyReturn);\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.throw = function(error) {\n\t\t// Inject an exception into the pending yield expression\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve, reject) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the throw call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return a rejected Promise containing the error\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn reject(error);\n\t\t\t}\n\t\t\t// Settle the yield expression with the value as a rejection\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, error);\n\t\t});\n\t};\n\n\t_AsyncGenerator.prototype[_asyncIteratorSymbol] = function() {\n\t\treturn this;\n\t};\n\t\n\treturn _AsyncGenerator;\n})();\n","/******************************************************************************************\n * Repository: https://github.com/kolserdav/swiper.git\n * Author: Sergey Kolmiller\n * Email: <serega12101983@gmail.com>\n * License: MIT\n * License Text: The code is distributed as is. There are no guarantees regarding the functionality of the code or parts of it.\n * Copyright: kolserdav, All rights reserved (c)\n * Create date: Mon Nov 29 2021 16:18:08 GMT+0700 (Krasnoyarsk Standard Time)\n ******************************************************************************************/\nimport React, {\n useMemo,\n useState,\n useRef,\n createRef,\n RefObject,\n useEffect,\n TouchEvent,\n} from 'react';\nimport clsx from 'clsx';\nimport styles from './index.module.css';\nimport { ReactComponent as NextIcon } from './icons/navigate_next_black_24dp.svg';\nimport { ReactComponent as NextBigIcon } from './icons/navigate_next_black_48dp.svg';\n\n/**\n * Time to miliseconds of change animation by card left value\n */\nexport const SWIPE_TRANSITION_TIMEOUT = 400;\n\n/**\n * One of swipe card\n */\nexport interface Swipe {\n id: number;\n children: React.ReactElement | React.ReactElement[] | null;\n}\n\n/**\n * Callback for get next or previous card content\n */\nexport type GetSwipeHandler = (oldId: number) => Swipe | null | Promise<Swipe | null>;\n\n/**\n * One of swipe card internal\n */\ninterface SwipeFull extends Swipe {\n type: 'next' | 'current' | 'prev';\n}\n\n/**\n * Event touch name\n */\ntype TouchName = 'onTouchMove' | 'onTouchStart' | 'onTouchEnd';\n\n/**\n * Props of Swiper component\n */\ninterface SwiperProps {\n /**\n * Current card content\n */\n defaultCurrent: Swipe;\n\n /**\n * Next card content\n */\n defaultNext: Swipe;\n\n /**\n * Previous card content\n */\n defaultPrev: Swipe;\n\n /**\n * Get next card handler\n */\n getNext: GetSwipeHandler;\n\n /**\n * Get previous card handler\n */\n getPrev: GetSwipeHandler;\n\n /**\n * Class name for content block\n */\n className?: string;\n\n /**\n * Button for swipe to next\n */\n nextButtonRef?: RefObject<HTMLButtonElement | HTMLDivElement | undefined>;\n\n /**\n * Button for swipe to previous\n */\n prevButtonRef?: RefObject<HTMLButtonElement | HTMLDivElement | undefined>;\n\n /**\n * invitation animation\n */\n invitationAnimation?: boolean;\n}\n\n/**\n * Create swipe list from values\n */\nconst getSwipes = (__prev: Swipe, __current: Swipe, __next: Swipe): SwipeFull[] => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result: any[] = [1, 2, 3].map((id) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const item: any = id === 1 ? { ...__prev } : id === 2 ? { ...__current } : { ...__next };\n item.type = id === 1 ? 'prev' : id === 2 ? 'current' : 'next';\n return item;\n });\n return result;\n};\n\nconst refs: {\n [key: number]: RefObject<HTMLDivElement>;\n} = {};\n\nlet startClientX: number;\nlet lastLeft: number;\nlet animated = false;\n\n/**\n * Swiper component\n */\nconst Swiper = (props: SwiperProps): React.ReactElement => {\n const {\n defaultCurrent,\n defaultNext,\n defaultPrev,\n getNext,\n getPrev,\n className,\n prevButtonRef,\n nextButtonRef,\n invitationAnimation,\n } = props;\n\n const [current, setCurrent] = useState<Swipe | null>();\n const [prev, setPrev] = useState<Swipe | null>();\n const [next, setNext] = useState<Swipe | null>();\n const [windowWidth, setWindowWidth] = useState<number>(0);\n const [height, setHeight] = useState<number>(0);\n const [width, setWidth] = useState<number>(0);\n const [_left, _setLeft] = useState<number>(0);\n const [left, setLeft] = useState<number>(0);\n const [isMobile, setIsMobile] = useState<boolean>();\n\n const containerRef = useRef<HTMLDivElement>(null);\n const _buttonPrevRef = useRef<HTMLDivElement>(null);\n const _buttonNextRef = useRef<HTMLDivElement>(null);\n\n /**\n * Create memoized swipes\n */\n const swipes = useMemo(\n () => getSwipes(prev || defaultPrev, current || defaultCurrent, next || defaultNext),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [next]\n );\n\n /**\n * Get new or exists ref by id\n */\n const getRef = (id: number): typeof refs[0] => {\n refs[id] = refs[id] ? refs[id] : createRef<HTMLDivElement>();\n return refs[id];\n };\n\n /**\n * Set to cards classes for in animation\n */\n const setGoClass = (): void => {\n getRef(next?.id || 0).current?.classList.add(styles.go);\n getRef(prev?.id || 0).current?.classList.add(styles.go);\n getRef(current?.id || 0).current?.classList.add(styles.go);\n setTimeout(() => {\n getRef(next?.id || 0).current?.classList.remove(styles.go);\n getRef(prev?.id || 0).current?.classList.remove(styles.go);\n getRef(current?.id || 0).current?.classList.remove(styles.go);\n }, SWIPE_TRANSITION_TIMEOUT);\n };\n\n /**\n * Set to cards classes for out animation\n */\n const setBackClass = (): void => {\n getRef(next?.id || 0).current?.classList.add(styles.back);\n getRef(prev?.id || 0).current?.classList.add(styles.back);\n getRef(current?.id || 0).current?.classList.add(styles.back);\n setLeft(0);\n setTimeout(() => {\n getRef(next?.id || 0).current?.classList.remove(styles.back);\n getRef(prev?.id || 0).current?.classList.remove(styles.back);\n getRef(current?.id || 0).current?.classList.remove(styles.back);\n }, SWIPE_TRANSITION_TIMEOUT);\n };\n\n /**\n * Run swipe animation\n */\n const swipe = async (_lastLeft: number): Promise<1 | 0> => {\n if (Math.abs(_lastLeft) > width / 3) {\n setLeft(0);\n if (_lastLeft < 0) {\n if (next?.children === null) {\n setBackClass();\n return 1;\n }\n setPrev(current);\n setCurrent(next);\n setNext(await getNext(next?.id || 0));\n } else {\n if (prev?.children === null) {\n setBackClass();\n return 1;\n }\n setPrev(await getPrev(prev?.id || 0));\n setCurrent(prev);\n setNext(current);\n }\n setGoClass();\n } else {\n setBackClass();\n }\n return 0;\n };\n\n /**\n * Touch event handler\n */\n const onTouchHandler = async (name: TouchName, e: TouchEvent): Promise<void> => {\n const { touches } = e;\n const clientX = touches[0]?.clientX;\n startClientX = startClientX || 0;\n switch (name) {\n case 'onTouchStart':\n startClientX = clientX;\n break;\n case 'onTouchMove':\n lastLeft = _left - (startClientX - clientX);\n setLeft(lastLeft);\n break;\n case 'onTouchEnd':\n await swipe(lastLeft);\n break;\n default:\n }\n };\n\n /**\n * Wait helper\n */\n const wait = async (miliseconds: number): Promise<void> => {\n await new Promise((resolve) => {\n setTimeout(() => {\n resolve(0);\n }, miliseconds);\n });\n };\n\n /**\n * Touch event wrapper\n */\n const onTouchWrapper =\n (name: TouchName): ((event: TouchEvent<HTMLDivElement>) => void) =>\n (e): void => {\n onTouchHandler(name, e);\n };\n\n /**\n * On next or previous button click handler\n */\n const clickHandler = (origin: 'next' | 'prev'): (() => Promise<void>) => {\n const isNext = origin === 'next';\n return async (): Promise<void> => {\n const coeff = isNext ? -1 : 1;\n const leftVal = width * coeff;\n if (isNext) {\n setGoClass();\n } else {\n setBackClass();\n }\n setLeft(leftVal);\n await wait(SWIPE_TRANSITION_TIMEOUT / 2);\n await swipe(leftVal);\n };\n };\n\n /**\n * Wrapper for next button click handler\n */\n const clickNextHandler = clickHandler('next');\n\n /**\n * Wrapper for previous button click handler\n */\n const clickPrevHandler = clickHandler('prev');\n\n const resizeHandler = (): void => {\n const _width = containerRef?.current?.parentElement?.getBoundingClientRect()?.width;\n const _height = containerRef?.current?.parentElement?.getBoundingClientRect()?.height;\n const __left = containerRef?.current?.parentElement?.getBoundingClientRect()?.left;\n const _windowWidth = document.body.clientWidth;\n if (_width && _height) {\n setWidth(_width);\n setHeight(_height);\n }\n if (__left) {\n setLeft(__left);\n }\n if (_windowWidth) {\n setWindowWidth(_windowWidth);\n }\n };\n\n useEffect(() => {\n const _width = containerRef?.current?.parentElement?.getBoundingClientRect()?.width;\n const _height = containerRef?.current?.parentElement?.getBoundingClientRect()?.height;\n const __left = containerRef?.current?.parentElement?.getBoundingClientRect()?.left;\n const prevButton = prevButtonRef ? prevButtonRef?.current : _buttonPrevRef.current;\n const nextButton = nextButtonRef ? nextButtonRef?.current : _buttonNextRef.current;\n const _windowWidth = document.body.clientWidth;\n if (_width && !width && _height && !height) {\n setWidth(_width);\n setHeight(_height);\n }\n // save container left\n if (__left && !left) {\n _setLeft(__left);\n }\n // save window width\n if (!windowWidth && _windowWidth) {\n setWindowWidth(_windowWidth);\n }\n // set start cards\n if (!current || !prev || !next) {\n setCurrent(defaultCurrent);\n setNext(defaultNext);\n setPrev(defaultPrev);\n }\n // run invitation animation\n if (invitationAnimation && width && !animated) {\n animated = true;\n (async (): Promise<void> => {\n setGoClass();\n setLeft(-200);\n await wait(SWIPE_TRANSITION_TIMEOUT);\n setBackClass();\n setLeft(_left);\n })();\n }\n // set is mobile\n if (typeof isMobile === 'undefined') {\n setIsMobile('ontouchstart' in window || typeof navigator.msMaxTouchPoints !== 'undefined');\n }\n prevButton?.addEventListener('click', clickPrevHandler);\n nextButton?.addEventListener('click', clickNextHandler);\n window.addEventListener('resize', resizeHandler);\n return (): void => {\n prevButton?.removeEventListener('click', clickPrevHandler);\n nextButton?.removeEventListener('click', clickNextHandler);\n window.removeEventListener('resize', resizeHandler);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [next]);\n\n return (\n <div className={styles.container} ref={containerRef}>\n {/** absolute position cards */}\n {swipes.map((item) => (\n <div key={item.id}>\n {item.children && width ? (\n <div\n onTouchMove={onTouchWrapper('onTouchMove')}\n onTouchStart={onTouchWrapper('onTouchStart')}\n onTouchEnd={onTouchWrapper('onTouchEnd')}\n id={item.id.toString()}\n style={\n item.type === 'current'\n ? { width, height, left }\n : item.type === 'prev'\n ? { width, height, left: left - windowWidth }\n : { width, height, left: left + windowWidth }\n }\n className={clsx(\n styles.card,\n item.type === 'prev' ? styles.prev : item.type === 'next' ? styles.next : ''\n )}\n ref={getRef(item.id)}\n >\n {/** Block of content */}\n <div className={clsx(styles.content, className)}>{item.children}</div>\n </div>\n ) : (\n ''\n )}\n </div>\n ))}\n {typeof isMobile !== 'undefined' && !isMobile && !prevButtonRef && prev?.children !== null && (\n <div className={clsx(styles.button, styles.button_prev)} ref={_buttonPrevRef}>\n {windowWidth < 3000 ? <NextIcon /> : <NextBigIcon />}\n </div>\n )}\n {typeof isMobile !== 'undefined' && !isMobile && !nextButtonRef && next?.children !== null && (\n <div className={clsx(styles.button, styles.button_next)} ref={_buttonNextRef}>\n {windowWidth < 3000 ? <NextIcon /> : <NextBigIcon />}\n </div>\n )}\n </div>\n );\n};\n\nSwiper.defaultProps = {\n className: '',\n};\n\nexport default Swiper;\n"],"names":["SWIPE_TRANSITION_TIMEOUT","getSwipes","__prev","__current","__next","result","map","id","item","type","refs","startClientX","lastLeft","animated","Swiper","props","defaultCurrent","defaultNext","defaultPrev","getNext","getPrev","className","prevButtonRef","nextButtonRef","invitationAnimation","useState","current","setCurrent","prev","setPrev","next","setNext","windowWidth","setWindowWidth","height","setHeight","width","setWidth","_left","_setLeft","left","setLeft","isMobile","setIsMobile","containerRef","useRef","_buttonPrevRef","_buttonNextRef","swipes","useMemo","getRef","createRef","setGoClass","classList","add","styles","go","setTimeout","remove","setBackClass","back","swipe","_lastLeft","Math","abs","children","onTouchHandler","name","e","touches","clientX","wait","miliseconds","Promise","resolve","onTouchWrapper","clickHandler","origin","isNext","coeff","leftVal","clickNextHandler","clickPrevHandler","resizeHandler","_width","parentElement","getBoundingClientRect","_height","__left","_windowWidth","document","body","clientWidth","useEffect","prevButton","nextButton","window","navigator","msMaxTouchPoints","addEventListener","removeEventListener","React","container","ref","key","onTouchMove","onTouchStart","onTouchEnd","toString","style","clsx","card","content","button","button_prev","NextIcon","NextBigIcon","button_next","defaultProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AACO,MAAM,KAAK,gBAAgB,CAAC,WAAW;AAC9C,CAAC,SAAS,KAAK,GAAG,EAAE;AACpB,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG,SAAS,WAAW,EAAE,UAAU,EAAE;AAC1D,EAAE,MAAM,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;AAC7B,EAAE,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC;AACvB,EAAE,IAAI,KAAK,EAAE;AACb,GAAG,MAAM,QAAQ,GAAG,KAAK,GAAG,CAAC,GAAG,WAAW,GAAG,UAAU,CAAC;AACzD,GAAG,IAAI,QAAQ,EAAE;AACjB,IAAI,IAAI;AACR,KAAK,OAAO,CAAC,M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,EAmBE8F,4BAAA,MAAA;AAAKhF,MAAAA,SAAS,EAAEyF,IAAI,CAACvD,MAAM,CAACyD,OAAR,EAAiB3F,SAAjB;KAApB,EAAkDb,IAAI,CAACyD,QAAvD,CAnBF,CADD,GAuBC,EAxBJ,CADU;AAAA,GAAX,CAFH,EA+BG,OAAOvB,QAAP,KAAoB,WAApB,IAAmC,CAACA,QAApC,IAAgD,CAACpB,aAAjD,IAAkE,CAAAM,IAAI,SAAJ,IAAAA,IAAI,WAAJ,YAAAA,IAAI,CAAEqC,QAAN,MAAmB,IAArF,IACCoC,4BAAA,MAAA;AAAKhF,IAAAA,SAAS,EAAEyF,IAAI,CAACvD,MAAM,CAAC0D,MAAR,EAAgB1D,MAAM,CAAC2D,WAAvB;AAAqCX,IAAAA,GAAG,EAAEzD;GAA9D,EACGd,WAAW,GAAG,IAAd,GAAqBqE,4BAAA,CAACc,wBAAD,MAAA,CAArB,GAAoCd,4BAAA,CAACe,wBAAD,MAAA,CADvC,CAhCJ,EAoCG,OAAO1E,QAAP,KAAoB,WAApB,IAAmC,CAACA,QAApC,IAAgD,CAACnB,aAAjD,IAAkE,CAAAO,IAAI,SAAJ,IAAAA,IAAI,WAAJ,YAAAA,IAAI,CAAEmC,QAAN,MAAmB,IAArF,IACCoC,4BAAA,MAAA;AAAKhF,IAAAA,SAAS,EAAEyF,IAAI,CAACvD,MAAM,CAAC0D,MAAR,EAAgB1D,MAAM,CAAC8D,WAAvB;AAAqCd,IAAAA,GAAG,EAAExD;GAA9D,EACGf,WAAW,GAAG,IAAd,GAAqBqE,4BAAA,CAACc,wBAAD,MAAA,CAArB,GAAoCd,4BAAA,CAACe,wBAAD,MAAA,CADvC,CArCJ,CADF;AA4CD,CA9RD;;AAgSAtG,MAAM,CAACwG,YAAP,GAAsB;AACpBjG,EAAAA,SAAS,EAAE;AADS,CAAtB;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.modern.js","sources":["../node_modules/babel-plugin-transform-async-to-promises/helpers.js","../src/index.tsx"],"sourcesContent":["// A type of promise-like that resolves synchronously and supports only one observer\nexport const _Pact = /*#__PURE__*/(function() {\n\tfunction _Pact() {}\n\t_Pact.prototype.then = function(onFulfilled, onRejected) {\n\t\tconst result = new _Pact();\n\t\tconst state = this.s;\n\t\tif (state) {\n\t\t\tconst callback = state & 1 ? onFulfilled : onRejected;\n\t\t\tif (callback) {\n\t\t\t\ttry {\n\t\t\t\t\t_settle(result, 1, callback(this.v));\n\t\t\t\t} catch (e) {\n\t\t\t\t\t_settle(result, 2, e);\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\t\tthis.o = function(_this) {\n\t\t\ttry {\n\t\t\t\tconst value = _this.v;\n\t\t\t\tif (_this.s & 1) {\n\t\t\t\t\t_settle(result, 1, onFulfilled ? onFulfilled(value) : value);\n\t\t\t\t} else if (onRejected) {\n\t\t\t\t\t_settle(result, 1, onRejected(value));\n\t\t\t\t} else {\n\t\t\t\t\t_settle(result, 2, value);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(result, 2, e);\n\t\t\t}\n\t\t};\n\t\treturn result;\n\t}\n\treturn _Pact;\n})();\n\n// Settles a pact synchronously\nexport function _settle(pact, state, value) {\n\tif (!pact.s) {\n\t\tif (value instanceof _Pact) {\n\t\t\tif (value.s) {\n\t\t\t\tif (state & 1) {\n\t\t\t\t\tstate = value.s;\n\t\t\t\t}\n\t\t\t\tvalue = value.v;\n\t\t\t} else {\n\t\t\t\tvalue.o = _settle.bind(null, pact, state);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (value && value.then) {\n\t\t\tvalue.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));\n\t\t\treturn;\n\t\t}\n\t\tpact.s = state;\n\t\tpact.v = value;\n\t\tconst observer = pact.o;\n\t\tif (observer) {\n\t\t\tobserver(pact);\n\t\t}\n\t}\n}\n\nexport function _isSettledPact(thenable) {\n\treturn thenable instanceof _Pact && thenable.s & 1;\n}\n\n// Converts argument to a function that always returns a Promise\nexport function _async(f) {\n\treturn function() {\n\t\tfor (var args = [], i = 0; i < arguments.length; i++) {\n\t\t\targs[i] = arguments[i];\n\t\t}\n\t\ttry {\n\t\t\treturn Promise.resolve(f.apply(this, args));\n\t\t} catch(e) {\n\t\t\treturn Promise.reject(e);\n\t\t}\n\t}\n}\n\n// Awaits on a value that may or may not be a Promise (equivalent to the await keyword in ES2015, with continuations passed explicitly)\nexport function _await(value, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(value) : value;\n\t}\n\tif (!value || !value.then) {\n\t\tvalue = Promise.resolve(value);\n\t}\n\treturn then ? value.then(then) : value;\n}\n\n// Awaits on a value that may or may not be a Promise, then ignores it\nexport function _awaitIgnored(value, direct) {\n\tif (!direct) {\n\t\treturn value && value.then ? value.then(_empty) : Promise.resolve();\n\t}\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continue(value, then) {\n\treturn value && value.then ? value.then(then) : then(value);\n}\n\n// Proceeds after a value has resolved, or proceeds immediately if the value is not thenable\nexport function _continueIgnored(value) {\n\tif (value && value.then) {\n\t\treturn value.then(_empty);\n\t}\n}\n\n// Asynchronously iterate through an object that has a length property, passing the index as the first argument to the callback (even as the length property changes)\nexport function _forTo(array, body, check) {\n\tvar i = -1, pact, reject;\n\tfunction _cycle(result) {\n\t\ttry {\n\t\t\twhile (++i < array.length && (!check || !check())) {\n\t\t\t\tresult = body(i);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pact) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t} else {\n\t\t\t\tpact = result;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t_settle(pact || (pact = new _Pact()), 2, e);\n\t\t}\n\t}\n\t_cycle();\n\treturn pact;\n}\n\n// Asynchronously iterate through an object's properties (including properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forIn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tkeys.push(key);\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\n// Asynchronously iterate through an object's own properties (excluding properties inherited from the prototype)\n// Uses a snapshot of the object's properties\nexport function _forOwn(target, body, check) {\n\tvar keys = [];\n\tfor (var key in target) {\n\t\tif (Object.prototype.hasOwnProperty.call(target, key)) {\n\t\t\tkeys.push(key);\n\t\t}\n\t}\n\treturn _forTo(keys, function(i) { return body(keys[i]); }, check);\n}\n\nexport const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== \"undefined\" ? (Symbol.iterator || (Symbol.iterator = Symbol(\"Symbol.iterator\"))) : \"@@iterator\";\n\n// Asynchronously iterate through an object's values\n// Uses for...of if the runtime supports it, otherwise iterates until length on a copy\nexport function _forOf(target, body, check) {\n\tif (typeof target[_iteratorSymbol] === \"function\") {\n\t\tvar iterator = target[_iteratorSymbol](), step, pact, reject;\n\t\tfunction _cycle(result) {\n\t\t\ttry {\n\t\t\t\twhile (!(step = iterator.next()).done && (!check || !check())) {\n\t\t\t\t\tresult = body(step.value);\n\t\t\t\t\tif (result && result.then) {\n\t\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (pact) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t} else {\n\t\t\t\t\tpact = result;\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t_settle(pact || (pact = new _Pact()), 2, e);\n\t\t\t}\n\t\t}\n\t\t_cycle();\n\t\tif (iterator.return) {\n\t\t\tvar _fixup = function(value) {\n\t\t\t\ttry {\n\t\t\t\t\tif (!step.done) {\n\t\t\t\t\t\titerator.return();\n\t\t\t\t\t}\n\t\t\t\t} catch(e) {\n\t\t\t\t}\n\t\t\t\treturn value;\n\t\t\t}\n\t\t\tif (pact && pact.then) {\n\t\t\t\treturn pact.then(_fixup, function(e) {\n\t\t\t\t\tthrow _fixup(e);\n\t\t\t\t});\n\t\t\t}\n\t\t\t_fixup();\n\t\t}\n\t\treturn pact;\n\t}\n\t// No support for Symbol.iterator\n\tif (!(\"length\" in target)) {\n\t\tthrow new TypeError(\"Object is not iterable\");\n\t}\n\t// Handle live collections properly\n\tvar values = [];\n\tfor (var i = 0; i < target.length; i++) {\n\t\tvalues.push(target[i]);\n\t}\n\treturn _forTo(values, function(i) { return body(values[i]); }, check);\n}\n\nexport const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== \"undefined\" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol(\"Symbol.asyncIterator\"))) : \"@@asyncIterator\";\n\n// Asynchronously iterate on a value using it's async iterator if present, or its synchronous iterator if missing\nexport function _forAwaitOf(target, body, check) {\n\tif (typeof target[_asyncIteratorSymbol] === \"function\") {\n\t\tvar pact = new _Pact();\n\t\tvar iterator = target[_asyncIteratorSymbol]();\n\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\treturn pact;\n\t\tfunction _resumeAfterBody(result) {\n\t\t\tif (check && check()) {\n\t\t\t\treturn _settle(pact, 1, iterator.return ? iterator.return().then(function() { return result; }) : result);\n\t\t\t}\n\t\t\titerator.next().then(_resumeAfterNext).then(void 0, _reject);\n\t\t}\n\t\tfunction _resumeAfterNext(step) {\n\t\t\tif (step.done) {\n\t\t\t\t_settle(pact, 1);\n\t\t\t} else {\n\t\t\t\tPromise.resolve(body(step.value)).then(_resumeAfterBody).then(void 0, _reject);\n\t\t\t}\n\t\t}\n\t\tfunction _reject(error) {\n\t\t\t_settle(pact, 2, iterator.return ? iterator.return().then(function() { return error; }) : error);\n\t\t}\n\t}\n\treturn Promise.resolve(_forOf(target, function(value) { return Promise.resolve(value).then(body); }, check));\n}\n\n// Asynchronously implement a generic for loop\nexport function _for(test, update, body) {\n\tvar stage;\n\tfor (;;) {\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t\tif (shouldContinue.then) {\n\t\t\tstage = 0;\n\t\t\tbreak;\n\t\t}\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.s;\n\t\t\t} else {\n\t\t\t\tstage = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (update) {\n\t\t\tvar updateValue = update();\n\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\tstage = 2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tvar pact = new _Pact();\n\tvar reject = _settle.bind(null, pact, 2);\n\t(stage === 0 ? shouldContinue.then(_resumeAfterTest) : stage === 1 ? result.then(_resumeAfterBody) : updateValue.then(_resumeAfterUpdate)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tdo {\n\t\t\tif (update) {\n\t\t\t\tupdateValue = update();\n\t\t\t\tif (updateValue && updateValue.then && !_isSettledPact(updateValue)) {\n\t\t\t\t\tupdateValue.then(_resumeAfterUpdate).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tshouldContinue = test();\n\t\t\tif (!shouldContinue || (_isSettledPact(shouldContinue) && !shouldContinue.v)) {\n\t\t\t\t_settle(pact, 1, result);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t}\n\t\t} while (!result || !result.then);\n\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterBody(result);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n\tfunction _resumeAfterUpdate() {\n\t\tif (shouldContinue = test()) {\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t} else {\n\t\t\t\t_resumeAfterTest(shouldContinue);\n\t\t\t}\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a do ... while loop\nexport function _do(body, test) {\n\tvar awaitBody;\n\tdo {\n\t\tvar result = body();\n\t\tif (result && result.then) {\n\t\t\tif (_isSettledPact(result)) {\n\t\t\t\tresult = result.v;\n\t\t\t} else {\n\t\t\t\tawaitBody = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tvar shouldContinue = test();\n\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\tshouldContinue = shouldContinue.v;\n\t\t}\n\t\tif (!shouldContinue) {\n\t\t\treturn result;\n\t\t}\n\t} while (!shouldContinue.then);\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : shouldContinue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterBody(value) {\n\t\tresult = value;\n\t\tfor (;;) {\n\t\t\tshouldContinue = test();\n\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t}\n\t\t\tif (!shouldContinue) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (shouldContinue.then) {\n\t\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\tresult = result.v;\n\t\t\t\t} else {\n\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterTest(shouldContinue) {\n\t\tif (shouldContinue) {\n\t\t\tdo {\n\t\t\t\tresult = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tif (_isSettledPact(result)) {\n\t\t\t\t\t\tresult = result.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tshouldContinue = test();\n\t\t\t\tif (_isSettledPact(shouldContinue)) {\n\t\t\t\t\tshouldContinue = shouldContinue.v;\n\t\t\t\t}\n\t\t\t\tif (!shouldContinue) {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} while (!shouldContinue.then);\n\t\t\tshouldContinue.then(_resumeAfterTest).then(void 0, reject);\n\t\t} else {\n\t\t\t_settle(pact, 1, result);\n\t\t}\n\t}\n}\n\n// Asynchronously implement a switch statement\nexport function _switch(discriminant, cases) {\n\tvar dispatchIndex = -1;\n\tvar awaitBody;\n\touter: {\n\t\tfor (var i = 0; i < cases.length; i++) {\n\t\t\tvar test = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvar testValue = test();\n\t\t\t\tif (testValue && testValue.then) {\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tif (testValue === discriminant) {\n\t\t\t\t\tdispatchIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Found the default case, set it as the pending dispatch case\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tif (dispatchIndex !== -1) {\n\t\t\tdo {\n\t\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\t\twhile (!body) {\n\t\t\t\t\tdispatchIndex++;\n\t\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t\t}\n\t\t\t\tvar result = body();\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tawaitBody = true;\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\t\tdispatchIndex++;\n\t\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t\treturn result;\n\t\t}\n\t}\n\tconst pact = new _Pact();\n\tconst reject = _settle.bind(null, pact, 2);\n\t(awaitBody ? result.then(_resumeAfterBody) : testValue.then(_resumeAfterTest)).then(void 0, reject);\n\treturn pact;\n\tfunction _resumeAfterTest(value) {\n\t\tfor (;;) {\n\t\t\tif (value === discriminant) {\n\t\t\t\tdispatchIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (++i === cases.length) {\n\t\t\t\tif (dispatchIndex !== -1) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t_settle(pact, 1, result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttest = cases[i][0];\n\t\t\tif (test) {\n\t\t\t\tvalue = test();\n\t\t\t\tif (value && value.then) {\n\t\t\t\t\tvalue.then(_resumeAfterTest).then(void 0, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdispatchIndex = i;\n\t\t\t}\n\t\t}\n\t\tdo {\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tvar result = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tdispatchIndex++;\n\t\t} while (fallthroughCheck && !fallthroughCheck());\n\t\t_settle(pact, 1, result);\n\t}\n\tfunction _resumeAfterBody(result) {\n\t\tfor (;;) {\n\t\t\tvar fallthroughCheck = cases[dispatchIndex][2];\n\t\t\tif (!fallthroughCheck || fallthroughCheck()) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdispatchIndex++;\n\t\t\tvar body = cases[dispatchIndex][1];\n\t\t\twhile (!body) {\n\t\t\t\tdispatchIndex++;\n\t\t\t\tbody = cases[dispatchIndex][1];\n\t\t\t}\n\t\t\tresult = body();\n\t\t\tif (result && result.then) {\n\t\t\t\tresult.then(_resumeAfterBody).then(void 0, reject);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t_settle(pact, 1, result);\n\t}\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _call(body, then, direct) {\n\tif (direct) {\n\t\treturn then ? then(body()) : body();\n\t}\n\ttry {\n\t\tvar result = Promise.resolve(body());\n\t\treturn then ? result.then(then) : result;\n\t} catch (e) {\n\t\treturn Promise.reject(e);\n\t}\n}\n\n// Asynchronously call a function and swallow the result\nexport function _callIgnored(body, direct) {\n\treturn _call(body, _empty, direct);\n}\n\n// Asynchronously call a function and pass the result to explicitly passed continuations\nexport function _invoke(body, then) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(then);\n\t}\n\treturn then(result);\n}\n\n// Asynchronously call a function and swallow the result\nexport function _invokeIgnored(body) {\n\tvar result = body();\n\tif (result && result.then) {\n\t\treturn result.then(_empty);\n\t}\n}\n\n// Asynchronously call a function and send errors to recovery continuation\nexport function _catch(body, recover) {\n\ttry {\n\t\tvar result = body();\n\t} catch(e) {\n\t\treturn recover(e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(void 0, recover);\n\t}\n\treturn result;\n}\n\n// Asynchronously await a promise and pass the result to a finally continuation\nexport function _finallyRethrows(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer(true, e);\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer.bind(null, false), finalizer.bind(null, true));\n\t}\n\treturn finalizer(false, result);\n}\n\n// Asynchronously await a promise and invoke a finally continuation that always overrides the result\nexport function _finally(body, finalizer) {\n\ttry {\n\t\tvar result = body();\n\t} catch (e) {\n\t\treturn finalizer();\n\t}\n\tif (result && result.then) {\n\t\treturn result.then(finalizer, finalizer);\n\t}\n\treturn finalizer();\n}\n\n// Rethrow or return a value from a finally continuation\nexport function _rethrow(thrown, value) {\n\tif (thrown)\n\t\tthrow value;\n\treturn value;\n}\n\n// Empty function to implement break and other control flow that ignores asynchronous results\nexport function _empty() {\n}\n\n// Sentinel value for early returns in generators \nexport const _earlyReturn = /*#__PURE__*/ {};\n\n// Asynchronously call a function and send errors to recovery continuation, skipping early returns\nexport function _catchInGenerator(body, recover) {\n\treturn _catch(body, function(e) {\n\t\tif (e === _earlyReturn) {\n\t\t\tthrow e;\n\t\t}\n\t\treturn recover(e);\n\t});\n}\n\n// Asynchronous generator class; accepts the entrypoint of the generator, to which it passes itself when the generator should start\nexport const _AsyncGenerator = /*#__PURE__*/(function() {\n\tfunction _AsyncGenerator(entry) {\n\t\tthis._entry = entry;\n\t\tthis._pact = null;\n\t\tthis._resolve = null;\n\t\tthis._return = null;\n\t\tthis._promise = null;\n\t}\n\n\tfunction _wrapReturnedValue(value) {\n\t\treturn { value: value, done: true };\n\t}\n\tfunction _wrapYieldedValue(value) {\n\t\treturn { value: value, done: false };\n\t}\n\n\t_AsyncGenerator.prototype._yield = function(value) {\n\t\t// Yield the value to the pending next call\n\t\tthis._resolve(value && value.then ? value.then(_wrapYieldedValue) : _wrapYieldedValue(value));\n\t\t// Return a pact for an upcoming next/return/throw call\n\t\treturn this._pact = new _Pact();\n\t};\n\t_AsyncGenerator.prototype.next = function(value) {\n\t\t// Advance the generator, starting it if it has yet to be started\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tconst _entry = _this._entry;\n\t\t\t\tif (_entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the next call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Start the generator\n\t\t\t\t_this._entry = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\tfunction returnValue(value) {\n\t\t\t\t\t_this._resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t_this._resolve = null;\n\t\t\t\t}\n\t\t\t\tvar result = _entry(_this);\n\t\t\t\tif (result && result.then) {\n\t\t\t\t\tresult.then(returnValue, function(error) {\n\t\t\t\t\t\tif (error === _earlyReturn) {\n\t\t\t\t\t\t\treturnValue(_this._return);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst pact = new _Pact();\n\t\t\t\t\t\t\t_this._resolve(pact);\n\t\t\t\t\t\t\t_this._pact = null;\n\t\t\t\t\t\t\t_this._resolve = null;\n\t\t\t\t\t\t\t_resolve(pact, 2, error);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\treturnValue(result);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Generator is started and a yield expression is pending, settle it\n\t\t\t\t_this._pact = null;\n\t\t\t\t_this._resolve = resolve;\n\t\t\t\t_settle(_pact, 1, value);\n\t\t\t}\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.return = function(value) {\n\t\t// Early return from the generator if started, otherwise abandons the generator\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the return call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return the specified value\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn resolve(value && value.then ? value.then(_wrapReturnedValue) : _wrapReturnedValue(value));\n\t\t\t}\n\t\t\t// Settle the yield expression with a rejected \"early return\" value\n\t\t\t_this._return = value;\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, _earlyReturn);\n\t\t});\n\t};\n\t_AsyncGenerator.prototype.throw = function(error) {\n\t\t// Inject an exception into the pending yield expression\n\t\tconst _this = this;\n\t\treturn _this._promise = new Promise(function (resolve, reject) {\n\t\t\tconst _pact = _this._pact;\n\t\t\tif (_pact === null) {\n\t\t\t\tif (_this._entry === null) {\n\t\t\t\t\t// Generator is started, but not awaiting a yield expression\n\t\t\t\t\t// Abandon the throw call!\n\t\t\t\t\treturn resolve(_this._promise);\n\t\t\t\t}\n\t\t\t\t// Generator is not started, abandon it and return a rejected Promise containing the error\n\t\t\t\t_this._entry = null;\n\t\t\t\treturn reject(error);\n\t\t\t}\n\t\t\t// Settle the yield expression with the value as a rejection\n\t\t\t_this._resolve = resolve;\n\t\t\t_this._pact = null;\n\t\t\t_settle(_pact, 2, error);\n\t\t});\n\t};\n\n\t_AsyncGenerator.prototype[_asyncIteratorSymbol] = function() {\n\t\treturn this;\n\t};\n\t\n\treturn _AsyncGenerator;\n})();\n","/******************************************************************************************\n * Repository: https://github.com/kolserdav/swiper.git\n * Author: Sergey Kolmiller\n * Email: <serega12101983@gmail.com>\n * License: MIT\n * License Text: The code is distributed as is. There are no guarantees regarding the functionality of the code or parts of it.\n * Copyright: kolserdav, All rights reserved (c)\n * Create date: Mon Nov 29 2021 16:18:08 GMT+0700 (Krasnoyarsk Standard Time)\n ******************************************************************************************/\nimport React, {\n useMemo,\n useState,\n useRef,\n createRef,\n RefObject,\n useEffect,\n TouchEvent,\n} from 'react';\nimport clsx from 'clsx';\nimport styles from './index.module.css';\nimport { ReactComponent as NextIcon } from './icons/navigate_next_black_24dp.svg';\nimport { ReactComponent as NextBigIcon } from './icons/navigate_next_black_48dp.svg';\n\n/**\n * Time to miliseconds of change animation by card left value\n */\nexport const SWIPE_TRANSITION_TIMEOUT = 400;\n\n/**\n * One of swipe card\n */\nexport interface Swipe {\n id: number | null;\n children: React.ReactElement | React.ReactElement[];\n}\n\n/**\n * Callback for get next or previous card content\n */\nexport type GetSwipeHandler = (oldId: number) => Swipe | Promise<Swipe>;\n\n/**\n * One of swipe card internal\n */\ninterface SwipeFull extends Swipe {\n type: 'next' | 'current' | 'prev';\n}\n\n/**\n * Event touch name\n */\ntype TouchName = 'onTouchMove' | 'onTouchStart' | 'onTouchEnd';\n\n/**\n * Props of Swiper component\n */\ninterface SwiperProps {\n /**\n * Current card content\n */\n defaultCurrent: Swipe;\n\n /**\n * Get next card handler\n */\n getNext: GetSwipeHandler;\n\n /**\n * Get previous card handler\n */\n getPrev: GetSwipeHandler;\n\n /**\n * Class name for content block\n */\n className?: string;\n\n /**\n * Button for swipe to next\n */\n nextButtonRef?: RefObject<HTMLButtonElement | HTMLDivElement | undefined>;\n\n /**\n * Button for swipe to previous\n */\n prevButtonRef?: RefObject<HTMLButtonElement | HTMLDivElement | undefined>;\n\n /**\n * invitation animation\n */\n invitationAnimation?: boolean;\n}\n\n/**\n * Create swipe list from values\n */\nconst getSwipes = (__prev: Swipe, __current: Swipe, __next: Swipe): SwipeFull[] => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result: any[] = [1, 2, 3].map((id) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const item: any = id === 1 ? { ...__prev } : id === 2 ? { ...__current } : { ...__next };\n item.type = id === 1 ? 'prev' : id === 2 ? 'current' : 'next';\n return item;\n });\n return result;\n};\n\n/**\n * Get default swipe with random id\n */\nconst getDefaultSwipe = (): Swipe => ({\n id: Math.ceil(Math.random() * 1000),\n children: <div></div>,\n});\n\nconst refs: {\n [key: number]: RefObject<HTMLDivElement>;\n} = {};\n\nlet startClientX: number;\nlet lastLeft: number;\nlet animated = false;\n\n/**\n * Swiper component\n */\nexport const Swiper = (props: SwiperProps): React.ReactElement => {\n const {\n defaultCurrent,\n getNext,\n getPrev,\n className,\n prevButtonRef,\n nextButtonRef,\n invitationAnimation,\n } = props;\n\n const [current, setCurrent] = useState<Swipe | null>();\n const [prev, setPrev] = useState<Swipe | null>();\n const [next, setNext] = useState<Swipe | null>();\n const [windowWidth, setWindowWidth] = useState<number>(0);\n const [height, setHeight] = useState<number>(0);\n const [width, setWidth] = useState<number>(0);\n const [_left, _setLeft] = useState<number>(0);\n const [left, setLeft] = useState<number>(0);\n const [isMobile, setIsMobile] = useState<boolean>();\n\n const containerRef = useRef<HTMLDivElement>(null);\n const _buttonPrevRef = useRef<HTMLDivElement>(null);\n const _buttonNextRef = useRef<HTMLDivElement>(null);\n\n /**\n * Create memoized swipes\n */\n const swipes = useMemo(\n () =>\n getSwipes(prev || getDefaultSwipe(), current || defaultCurrent, next || getDefaultSwipe()),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [next]\n );\n\n /**\n * Get new or exists ref by id\n */\n const getRef = (id: number): typeof refs[0] => {\n refs[id] = refs[id] ? refs[id] : createRef<HTMLDivElement>();\n return refs[id];\n };\n\n /**\n * Set to cards classes for in animation\n */\n const setGoClass = (): void => {\n getRef(next?.id || 0).current?.classList.add(styles.go);\n getRef(prev?.id || 0).current?.classList.add(styles.go);\n getRef(current?.id || 0).current?.classList.add(styles.go);\n setTimeout(() => {\n getRef(next?.id || 0).current?.classList.remove(styles.go);\n getRef(prev?.id || 0).current?.classList.remove(styles.go);\n getRef(current?.id || 0).current?.classList.remove(styles.go);\n }, SWIPE_TRANSITION_TIMEOUT);\n };\n\n /**\n * Set to cards classes for out animation\n */\n const setBackClass = (): void => {\n getRef(next?.id || 0).current?.classList.add(styles.back);\n getRef(prev?.id || 0).current?.classList.add(styles.back);\n getRef(current?.id || 0).current?.classList.add(styles.back);\n setLeft(0);\n setTimeout(() => {\n getRef(next?.id || 0).current?.classList.remove(styles.back);\n getRef(prev?.id || 0).current?.classList.remove(styles.back);\n getRef(current?.id || 0).current?.classList.remove(styles.back);\n }, SWIPE_TRANSITION_TIMEOUT);\n };\n\n /**\n * Run swipe animation\n */\n const swipe = async (_lastLeft: number): Promise<1 | 0> => {\n if (Math.abs(_lastLeft) > width / 3) {\n setLeft(0);\n if (_lastLeft < 0) {\n if (!next?.id) {\n setBackClass();\n return 1;\n }\n setPrev(current);\n setCurrent(next);\n setNext(await getNext(next?.id || 0));\n } else {\n if (!prev?.id) {\n setBackClass();\n return 1;\n }\n setPrev(await getPrev(prev?.id || 0));\n setCurrent(prev);\n setNext(current);\n }\n setGoClass();\n } else {\n setBackClass();\n }\n return 0;\n };\n\n /**\n * Touch event handler\n */\n const onTouchHandler = async (name: TouchName, e: TouchEvent): Promise<void> => {\n const { touches } = e;\n const clientX = touches[0]?.clientX;\n startClientX = startClientX || 0;\n switch (name) {\n case 'onTouchStart':\n startClientX = clientX;\n break;\n case 'onTouchMove':\n lastLeft = _left - (startClientX - clientX);\n setLeft(lastLeft);\n break;\n case 'onTouchEnd':\n await swipe(lastLeft);\n break;\n default:\n }\n };\n\n /**\n * Wait helper\n */\n const wait = async (miliseconds: number): Promise<void> => {\n await new Promise((resolve) => {\n setTimeout(() => {\n resolve(0);\n }, miliseconds);\n });\n };\n\n /**\n * Touch event wrapper\n */\n const onTouchWrapper =\n (name: TouchName): ((event: TouchEvent<HTMLDivElement>) => void) =>\n (e): void => {\n onTouchHandler(name, e);\n };\n\n /**\n * On next or previous button click handler\n */\n const clickHandler = (origin: 'next' | 'prev'): (() => Promise<void>) => {\n const isNext = origin === 'next';\n return async (): Promise<void> => {\n const coeff = isNext ? -1 : 1;\n const leftVal = width * coeff;\n if (isNext) {\n setGoClass();\n } else {\n setBackClass();\n }\n setLeft(leftVal);\n await wait(SWIPE_TRANSITION_TIMEOUT / 2);\n await swipe(leftVal);\n };\n };\n\n /**\n * Wrapper for next button click handler\n */\n const clickNextHandler = clickHandler('next');\n\n /**\n * Wrapper for previous button click handler\n */\n const clickPrevHandler = clickHandler('prev');\n\n const resizeHandler = (): void => {\n const _width = containerRef?.current?.parentElement?.getBoundingClientRect()?.width;\n const _height = containerRef?.current?.parentElement?.getBoundingClientRect()?.height;\n const __left = containerRef?.current?.parentElement?.getBoundingClientRect()?.left;\n const _windowWidth = document.body.clientWidth;\n if (_width && _height) {\n setWidth(_width);\n setHeight(_height);\n }\n if (__left) {\n setLeft(__left);\n }\n if (_windowWidth) {\n setWindowWidth(_windowWidth);\n }\n };\n\n useEffect(() => {\n const _width = containerRef?.current?.parentElement?.getBoundingClientRect()?.width;\n const _height = containerRef?.current?.parentElement?.getBoundingClientRect()?.height;\n const __left = containerRef?.current?.parentElement?.getBoundingClientRect()?.left;\n const prevButton = prevButtonRef ? prevButtonRef?.current : _buttonPrevRef.current;\n const nextButton = nextButtonRef ? nextButtonRef?.current : _buttonNextRef.current;\n const _windowWidth = document.body.clientWidth;\n if (_width && !width && _height && !height) {\n setWidth(_width);\n setHeight(_height);\n }\n // save container left\n if (__left && !left) {\n _setLeft(__left);\n }\n // save window width\n if (!windowWidth && _windowWidth) {\n setWindowWidth(_windowWidth);\n }\n // set start cards\n if (!current || !prev || !next) {\n setCurrent(defaultCurrent);\n (async (): Promise<void> => {\n setNext(await getNext(defaultCurrent.id || 0));\n setPrev(await getPrev(defaultCurrent.id || 0));\n })();\n }\n // run invitation animation\n if (invitationAnimation && width && !animated) {\n animated = true;\n (async (): Promise<void> => {\n setGoClass();\n setLeft(-200);\n await wait(SWIPE_TRANSITION_TIMEOUT);\n setBackClass();\n setLeft(_left);\n })();\n }\n // set is mobile\n if (typeof isMobile === 'undefined') {\n setIsMobile('ontouchstart' in window || typeof navigator.msMaxTouchPoints !== 'undefined');\n }\n prevButton?.addEventListener('click', clickPrevHandler);\n nextButton?.addEventListener('click', clickNextHandler);\n window.addEventListener('resize', resizeHandler);\n return (): void => {\n prevButton?.removeEventListener('click', clickPrevHandler);\n nextButton?.removeEventListener('click', clickNextHandler);\n window.removeEventListener('resize', resizeHandler);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [next]);\n\n console.log(swipes);\n\n return (\n <div className={styles.container} ref={containerRef}>\n {/** absolute position cards */}\n {swipes.map((item) => (\n <div key={item.id} style={!item?.id ? { display: 'none' } : {}}>\n {item.id && width && (\n <div\n onTouchMove={onTouchWrapper('onTouchMove')}\n onTouchStart={onTouchWrapper('onTouchStart')}\n onTouchEnd={onTouchWrapper('onTouchEnd')}\n id={item.id?.toString()}\n style={\n item.type === 'current'\n ? { width, height, left }\n : item.type === 'prev'\n ? { width, height, left: left - windowWidth }\n : { width, height, left: left + windowWidth }\n }\n className={clsx(\n styles.card,\n item.type === 'prev' ? styles.prev : item.type === 'next' ? styles.next : ''\n )}\n ref={getRef(item.id)}\n >\n {/** Block of content */}\n <div className={clsx(styles.content, className)}>{item.children}</div>\n </div>\n )}\n </div>\n ))}\n {typeof isMobile !== 'undefined' && !isMobile && !prevButtonRef && prev?.id && (\n <div className={clsx(styles.button, styles.button_prev)} ref={_buttonPrevRef}>\n {windowWidth < 3000 ? <NextIcon /> : <NextBigIcon />}\n </div>\n )}\n {typeof isMobile !== 'undefined' && !isMobile && !nextButtonRef && next?.id && (\n <div className={clsx(styles.button, styles.button_next)} ref={_buttonNextRef}>\n {windowWidth < 3000 ? <NextIcon /> : <NextBigIcon />}\n </div>\n )}\n </div>\n );\n};\n\nSwiper.defaultProps = {\n className: '',\n};\n"],"names":["SWIPE_TRANSITION_TIMEOUT","getSwipes","__prev","__current","__next","result","map","id","item","type","getDefaultSwipe","Math","ceil","random","children","React","refs","startClientX","lastLeft","animated","Swiper","props","defaultCurrent","getNext","getPrev","className","prevButtonRef","nextButtonRef","invitationAnimation","useState","current","setCurrent","prev","setPrev","next","setNext","windowWidth","setWindowWidth","height","setHeight","width","setWidth","_left","_setLeft","left","setLeft","isMobile","setIsMobile","containerRef","useRef","_buttonPrevRef","_buttonNextRef","swipes","useMemo","getRef","createRef","setGoClass","classList","add","styles","go","setTimeout","remove","setBackClass","back","swipe","_lastLeft","abs","onTouchHandler","name","e","touches","clientX","wait","miliseconds","Promise","resolve","onTouchWrapper","clickHandler","origin","isNext","coeff","leftVal","clickNextHandler","clickPrevHandler","resizeHandler","_width","parentElement","getBoundingClientRect","_height","__left","_windowWidth","document","body","clientWidth","useEffect","prevButton","nextButton","window","navigator","msMaxTouchPoints","addEventListener","removeEventListener","console","log","container","ref","key","style","display","onTouchMove","onTouchStart","onTouchEnd","toString","clsx","card","content","button","button_prev","NextIcon","NextBigIcon","button_next","defaultProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AACO,MAAM,KAAK,gBAAgB,CAAC,WAAW;AAC9C,CAAC,SAAS,KAAK,GAAG,EAAE;AACpB,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG,SAAS,WAAW,EAAE,UAAU,EAAE;AAC1D,EAAE,MAAM,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;AAC7B,EAAE,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC;AACvB,EAAE,IAAI,KAAK,EAAE;AACb,GAAG,MAAM,QAAQ,GAAG,KAAK,GAAG,CAAC,GAAG,WAAW,GAAG,UAAU,CAAC;AACzD,GAAG,IAAI,QAAQ,EAAE;AACjB,IAAI,IAAI;AACR,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,QAAQ,CAAC,IA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EACGf,WAAW,GAAG,IAAd,GAAqBrB,4BAAA,CAACwG,wBAAD,MAAA,CAArB,GAAoCxG,4BAAA,CAACyG,wBAAD,MAAA,CADvC,CAnCJ,CADF;AA0CD,CA/RM;AAiSPpG,MAAM,CAACsG,YAAP,GAAsB;AACpBjG,EAAAA,SAAS,EAAE;AADS,CAAtB;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolserdav/swiper",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "Simple and powerfull react swiper component",
|
|
5
5
|
"author": "kolserdav",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"@types/node": "^12.12.38",
|
|
42
42
|
"@types/react": "^16.9.27",
|
|
43
43
|
"@types/react-dom": "^16.9.7",
|
|
44
|
+
"@types/uuid": "^8.3.3",
|
|
44
45
|
"@typescript-eslint/eslint-plugin": "^2.26.0",
|
|
45
46
|
"@typescript-eslint/parser": "^2.26.0",
|
|
46
47
|
"babel-eslint": "^10.0.3",
|
|
@@ -72,7 +73,8 @@
|
|
|
72
73
|
"dist"
|
|
73
74
|
],
|
|
74
75
|
"dependencies": {
|
|
75
|
-
"clsx": "^1.1.1"
|
|
76
|
+
"clsx": "^1.1.1",
|
|
77
|
+
"uuid": "^8.3.2"
|
|
76
78
|
},
|
|
77
79
|
"fhead": {
|
|
78
80
|
"root": ".",
|