PromoCursed/node_modules/.cache/babel-loader/7699705b537b4e402070db00f2bdc8dbe9422d42d340c524b5ac73b01ff825f9.json

1 line
27 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"ast":null,"code":"import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"prefixCls\", \"steps\", \"defaultCurrent\", \"current\", \"onChange\", \"onClose\", \"onFinish\", \"open\", \"mask\", \"arrow\", \"rootClassName\", \"placement\", \"renderPanel\", \"gap\", \"animated\", \"scrollIntoViewOptions\", \"zIndex\", \"closeIcon\", \"closable\", \"builtinPlacements\", \"disabledInteraction\"];\nimport * as React from 'react';\nimport Portal from '@rc-component/portal';\nimport Trigger from '@rc-component/trigger';\nimport classNames from 'classnames';\nimport useLayoutEffect from \"rc-util/es/hooks/useLayoutEffect\";\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport { useMemo } from 'react';\nimport { useClosable } from \"./hooks/useClosable\";\nimport useTarget from \"./hooks/useTarget\";\nimport Mask from \"./Mask\";\nimport { getPlacements } from \"./placements\";\nimport TourStep from \"./TourStep\";\nimport { getPlacement } from \"./util\";\nvar CENTER_PLACEHOLDER = {\n left: '50%',\n top: '50%',\n width: 1,\n height: 1\n};\nvar defaultScrollIntoViewOptions = {\n block: 'center',\n inline: 'center'\n};\nvar Tour = function Tour(props) {\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-tour' : _props$prefixCls,\n _props$steps = props.steps,\n steps = _props$steps === void 0 ? [] : _props$steps,\n defaultCurrent = props.defaultCurrent,\n current = props.current,\n onChange = props.onChange,\n onClose = props.onClose,\n _onFinish = props.onFinish,\n open = props.open,\n _props$mask = props.mask,\n mask = _props$mask === void 0 ? true : _props$mask,\n _props$arrow = props.arrow,\n arrow = _props$arrow === void 0 ? true : _props$arrow,\n rootClassName = props.rootClassName,\n placement = props.placement,\n renderPanel = props.renderPanel,\n gap = props.gap,\n animated = props.animated,\n _props$scrollIntoView = props.scrollIntoViewOptions,\n scrollIntoViewOptions = _props$scrollIntoView === void 0 ? defaultScrollIntoViewOptions : _props$scrollIntoView,\n _props$zIndex = props.zIndex,\n zIndex = _props$zIndex === void 0 ? 1001 : _props$zIndex,\n closeIcon = props.closeIcon,\n closable = props.closable,\n builtinPlacements = props.builtinPlacements,\n disabledInteraction = props.disabledInteraction,\n restProps = _objectWithoutProperties(props, _excluded);\n var triggerRef = React.useRef();\n var _useMergedState = useMergedState(0, {\n value: current,\n defaultValue: defaultCurrent\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n mergedCurrent = _useMergedState2[0],\n setMergedCurrent = _useMergedState2[1];\n var _useMergedState3 = useMergedState(undefined, {\n value: open,\n postState: function postState(origin) {\n return mergedCurrent < 0 || mergedCurrent >= steps.length ? false : origin !== null && origin !== void 0 ? origin : true;\n }\n }),\n _useMergedState4 = _slicedToArray(_useMergedState3, 2),\n mergedOpen = _useMergedState4[0],\n setMergedOpen = _useMergedState4[1];\n\n // Record if already rended in the DOM to avoid `findDOMNode` issue\n var _React$useState = React.useState(mergedOpen),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n hasOpened = _React$useState2[0],\n setHasOpened = _React$useState2[1];\n var openRef = React.useRef(mergedOpen);\n useLayoutEffect(function () {\n if (mergedOpen) {\n if (!openRef.current) {\n setMergedCurrent(0);\n }\n setHasOpened(true);\n }\n openRef.current = mergedOpen;\n }, [mergedOpen]);\n var _ref = steps[mergedCurrent] || {},\n target = _ref.target,\n stepPlacement = _