PromoCursed/node_modules/.cache/babel-loader/ee3a2f41e9ea8709b72638341d18ba04c314d350e16d570f055f07f4f612ce06.json
2024-08-20 23:25:37 +04:00

1 line
8.0 KiB
JSON

{"ast":null,"code":"var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport * as React from 'react';\nimport copy from 'copy-to-clipboard';\nimport { useEvent } from 'rc-util';\nconst useCopyClick = _ref => {\n let {\n copyConfig,\n children\n } = _ref;\n const [copied, setCopied] = React.useState(false);\n const [copyLoading, setCopyLoading] = React.useState(false);\n const copyIdRef = React.useRef(null);\n const cleanCopyId = () => {\n if (copyIdRef.current) {\n clearTimeout(copyIdRef.current);\n }\n };\n const copyOptions = {};\n if (copyConfig.format) {\n copyOptions.format = copyConfig.format;\n }\n React.useEffect(() => cleanCopyId, []);\n // Keep copy action up to date\n const onClick = useEvent(e => __awaiter(void 0, void 0, void 0, function* () {\n var _a;\n e === null || e === void 0 ? void 0 : e.preventDefault();\n e === null || e === void 0 ? void 0 : e.stopPropagation();\n setCopyLoading(true);\n try {\n const text = typeof copyConfig.text === 'function' ? yield copyConfig.text() : copyConfig.text;\n copy(text || String(children) || '', copyOptions);\n setCopyLoading(false);\n setCopied(true);\n // Trigger tips update\n cleanCopyId();\n copyIdRef.current = setTimeout(() => {\n setCopied(false);\n }, 3000);\n (_a = copyConfig.onCopy) === null || _a === void 0 ? void 0 : _a.call(copyConfig, e);\n } catch (error) {\n setCopyLoading(false);\n throw error;\n }\n }));\n return {\n copied,\n copyLoading,\n onClick\n };\n};\nexport default useCopyClick;","map":{"version":3,"names":["__awaiter","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","React","copy","useEvent","useCopyClick","_ref","copyConfig","children","copied","setCopied","useState","copyLoading","setCopyLoading","copyIdRef","useRef","cleanCopyId","current","clearTimeout","copyOptions","format","useEffect","onClick","_a","preventDefault","stopPropagation","text","String","setTimeout","onCopy","call","error"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/antd/es/typography/hooks/useCopyClick.js"],"sourcesContent":["var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport * as React from 'react';\nimport copy from 'copy-to-clipboard';\nimport { useEvent } from 'rc-util';\nconst useCopyClick = _ref => {\n let {\n copyConfig,\n children\n } = _ref;\n const [copied, setCopied] = React.useState(false);\n const [copyLoading, setCopyLoading] = React.useState(false);\n const copyIdRef = React.useRef(null);\n const cleanCopyId = () => {\n if (copyIdRef.current) {\n clearTimeout(copyIdRef.current);\n }\n };\n const copyOptions = {};\n if (copyConfig.format) {\n copyOptions.format = copyConfig.format;\n }\n React.useEffect(() => cleanCopyId, []);\n // Keep copy action up to date\n const onClick = useEvent(e => __awaiter(void 0, void 0, void 0, function* () {\n var _a;\n e === null || e === void 0 ? void 0 : e.preventDefault();\n e === null || e === void 0 ? void 0 : e.stopPropagation();\n setCopyLoading(true);\n try {\n const text = typeof copyConfig.text === 'function' ? yield copyConfig.text() : copyConfig.text;\n copy(text || String(children) || '', copyOptions);\n setCopyLoading(false);\n setCopied(true);\n // Trigger tips update\n cleanCopyId();\n copyIdRef.current = setTimeout(() => {\n setCopied(false);\n }, 3000);\n (_a = copyConfig.onCopy) === null || _a === void 0 ? void 0 : _a.call(copyConfig, e);\n } catch (error) {\n setCopyLoading(false);\n throw error;\n }\n }));\n return {\n copied,\n copyLoading,\n onClick\n };\n};\nexport default useCopyClick;"],"mappings":"AAAA,IAAIA,SAAS,GAAG,IAAI,IAAI,IAAI,CAACA,SAAS,IAAI,UAAUC,OAAO,EAAEC,UAAU,EAAEC,CAAC,EAAEC,SAAS,EAAE;EACrF,SAASC,KAAKA,CAACC,KAAK,EAAE;IACpB,OAAOA,KAAK,YAAYH,CAAC,GAAGG,KAAK,GAAG,IAAIH,CAAC,CAAC,UAAUI,OAAO,EAAE;MAC3DA,OAAO,CAACD,KAAK,CAAC;IAChB,CAAC,CAAC;EACJ;EACA,OAAO,KAAKH,CAAC,KAAKA,CAAC,GAAGK,OAAO,CAAC,EAAE,UAAUD,OAAO,EAAEE,MAAM,EAAE;IACzD,SAASC,SAASA,CAACJ,KAAK,EAAE;MACxB,IAAI;QACFK,IAAI,CAACP,SAAS,CAACQ,IAAI,CAACN,KAAK,CAAC,CAAC;MAC7B,CAAC,CAAC,OAAOO,CAAC,EAAE;QACVJ,MAAM,CAACI,CAAC,CAAC;MACX;IACF;IACA,SAASC,QAAQA,CAACR,KAAK,EAAE;MACvB,IAAI;QACFK,IAAI,CAACP,SAAS,CAAC,OAAO,CAAC,CAACE,KAAK,CAAC,CAAC;MACjC,CAAC,CAAC,OAAOO,CAAC,EAAE;QACVJ,MAAM,CAACI,CAAC,CAAC;MACX;IACF;IACA,SAASF,IAAIA,CAACI,MAAM,EAAE;MACpBA,MAAM,CAACC,IAAI,GAAGT,OAAO,CAACQ,MAAM,CAACT,KAAK,CAAC,GAAGD,KAAK,CAACU,MAAM,CAACT,KAAK,CAAC,CAACW,IAAI,CAACP,SAAS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