1 line
14 KiB
JSON
1 line
14 KiB
JSON
{"ast":null,"code":"\"use client\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport React, { useContext } from 'react';\nimport { QRCodeCanvas, QRCodeSVG } from '@rc-component/qrcode';\nimport classNames from 'classnames';\nimport { devUseWarning } from '../_util/warning';\nimport { ConfigContext } from '../config-provider';\nimport { useLocale } from '../locale';\nimport { useToken } from '../theme/internal';\nimport useStyle from './style/index';\nimport QRcodeStatus from './QrcodeStatus';\nconst QRCode = props => {\n var _a, _b, _c, _d;\n const [, token] = useToken();\n const {\n value,\n type = 'canvas',\n icon = '',\n size = 160,\n iconSize,\n color = token.colorText,\n errorLevel = 'M',\n status = 'active',\n bordered = true,\n onRefresh,\n style,\n className,\n rootClassName,\n prefixCls: customizePrefixCls,\n bgColor = 'transparent',\n statusRender\n } = props,\n rest = __rest(props, [\"value\", \"type\", \"icon\", \"size\", \"iconSize\", \"color\", \"errorLevel\", \"status\", \"bordered\", \"onRefresh\", \"style\", \"className\", \"rootClassName\", \"prefixCls\", \"bgColor\", \"statusRender\"]);\n const {\n getPrefixCls\n } = useContext(ConfigContext);\n const prefixCls = getPrefixCls('qrcode', customizePrefixCls);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n const imageSettings = {\n src: icon,\n x: undefined,\n y: undefined,\n height: typeof iconSize === 'number' ? iconSize : (_a = iconSize === null || iconSize === void 0 ? void 0 : iconSize.height) !== null && _a !== void 0 ? _a : 40,\n width: typeof iconSize === 'number' ? iconSize : (_b = iconSize === null || iconSize === void 0 ? void 0 : iconSize.width) !== null && _b !== void 0 ? _b : 40,\n excavate: true,\n crossOrigin: 'anonymous'\n };\n const qrCodeProps = {\n value,\n size,\n level: errorLevel,\n bgColor,\n fgColor: color,\n style: {\n width: style === null || style === void 0 ? void 0 : style.width,\n height: style === null || style === void 0 ? void 0 : style.height\n },\n imageSettings: icon ? imageSettings : undefined\n };\n const [locale] = useLocale('QRCode');\n if (process.env.NODE_ENV !== 'production') {\n const warning = devUseWarning('QRCode');\n process.env.NODE_ENV !== \"production\" ? warning(!!value, 'usage', 'need to receive `value` props') : void 0;\n process.env.NODE_ENV !== \"production\" ? warning(!(icon && errorLevel === 'L'), 'usage', 'ErrorLevel `L` is not recommended to be used with `icon`, for scanning result would be affected by low level.') : void 0;\n }\n if (!value) {\n return null;\n }\n const mergedCls = classNames(prefixCls, className, rootClassName, hashId, cssVarCls, {\n [`${prefixCls}-borderless`]: !bordered\n });\n const mergedStyle = Object.assign(Object.assign({\n backgroundColor: bgColor\n }, style), {\n width: (_c = style === null || style === void 0 ? void 0 : style.width) !== null && _c !== void 0 ? _c : size,\n height: (_d = style === null || style === void 0 ? void 0 : style.height) !== null && _d !== void 0 ? _d : size\n });\n return wrapCSSVar( /*#__PURE__*/React.createElement(\"div\", Object.assign({}, rest, {\n className: mergedCls,\n style: mergedStyle\n }), status !== 'active' && ( /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-mask`\n }, /*#__PURE__*/React.createElement(QRcodeStatus, {\n prefixCls: prefixCls,\n locale: locale,\n status: status,\n onRefresh: onRefresh,\n statusRender: statusRender\n }))), type === 'canvas' ? /*#__PURE__*/React.createElement(QRCodeCanvas, Object.assign({}, qrCodeProps)) : /*#__PURE__*/React.createElement(QRCodeSVG, Object.assign({}, qrCodeProps))));\n};\nif (process.env.NODE_ENV !== 'production') {\n QRCode.displayName = 'QRCode';\n}\nexport default QRCode;","map":{"version":3,"names":["__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","React","useContext","QRCodeCanvas","QRCodeSVG","classNames","devUseWarning","ConfigContext","useLocale","useToken","useStyle","QRcodeStatus","QRCode","props","_a","_b","_c","_d","token","value","type","icon","size","iconSize","color","colorText","errorLevel","status","bordered","onRefresh","style","className","rootClassName","prefixCls","customizePrefixCls","bgColor","statusRender","rest","getPrefixCls","wrapCSSVar","hashId","cssVarCls","imageSettings","src","x","undefined","y","height","width","excavate","crossOrigin","qrCodeProps","level","fgColor","locale","process","env","NODE_ENV","warning","mergedCls","mergedStyle","assign","backgroundColor","createElement","displayName"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/antd/es/qr-code/index.js"],"sourcesContent":["\"use client\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport React, { useContext } from 'react';\nimport { QRCodeCanvas, QRCodeSVG } from '@rc-component/qrcode';\nimport classNames from 'classnames';\nimport { devUseWarning } from '../_util/warning';\nimport { ConfigContext } from '../config-provider';\nimport { useLocale } from '../locale';\nimport { useToken } from '../theme/internal';\nimport useStyle from './style/index';\nimport QRcodeStatus from './QrcodeStatus';\nconst QRCode = props => {\n var _a, _b, _c, _d;\n const [, token] = useToken();\n const {\n value,\n type = 'canvas',\n icon = '',\n size = 160,\n iconSize,\n color = token.colorText,\n errorLevel = 'M',\n status = 'active',\n bordered = true,\n onRefresh,\n style,\n className,\n rootClassName,\n prefixCls: customizePrefixCls,\n bgColor = 'transparent',\n statusRender\n } = props,\n rest = __rest(props, [\"value\", \"type\", \"icon\", \"size\", \"iconSize\", \"color\", \"errorLevel\", \"status\", \"bordered\", \"onRefresh\", \"style\", \"className\", \"rootClassName\", \"prefixCls\", \"bgColor\", \"statusRender\"]);\n const {\n getPrefixCls\n } = useContext(ConfigContext);\n const prefixCls = getPrefixCls('qrcode', customizePrefixCls);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n const imageSettings = {\n src: icon,\n x: undefined,\n y: undefined,\n height: typeof iconSize === 'number' ? iconSize : (_a = iconSize === null || iconSize === void 0 ? void 0 : iconSize.height) !== null && _a !== void 0 ? _a : 40,\n width: typeof iconSize === 'number' ? iconSize : (_b = iconSize === null || iconSize === void 0 ? void 0 : iconSize.width) !== null && _b !== void 0 ? _b : 40,\n excavate: true,\n crossOrigin: 'anonymous'\n };\n const qrCodeProps = {\n value,\n size,\n level: errorLevel,\n bgColor,\n fgColor: color,\n style: {\n width: style === null || style === void 0 ? void 0 : style.width,\n height: style === null || style === void 0 ? void 0 : style.height\n },\n imageSettings: icon ? imageSettings : undefined\n };\n const [locale] = useLocale('QRCode');\n if (process.env.NODE_ENV !== 'production') {\n const warning = devUseWarning('QRCode');\n process.env.NODE_ENV !== \"production\" ? warning(!!value, 'usage', 'need to receive `value` props') : void 0;\n process.env.NODE_ENV !== \"production\" ? warning(!(icon && errorLevel === 'L'), 'usage', 'ErrorLevel `L` is not recommended to be used with `icon`, for scanning result would be affected by low level.') : void 0;\n }\n if (!value) {\n return null;\n }\n const mergedCls = classNames(prefixCls, className, rootClassName, hashId, cssVarCls, {\n [`${prefixCls}-borderless`]: !bordered\n });\n const mergedStyle = Object.assign(Object.assign({\n backgroundColor: bgColor\n }, style), {\n width: (_c = style === null || style === void 0 ? void 0 : style.width) !== null && _c !== void 0 ? _c : size,\n height: (_d = style === null || style === void 0 ? void 0 : style.height) !== null && _d !== void 0 ? _d : size\n });\n return wrapCSSVar( /*#__PURE__*/React.createElement(\"div\", Object.assign({}, rest, {\n className: mergedCls,\n style: mergedStyle\n }), status !== 'active' && ( /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-mask`\n }, /*#__PURE__*/React.createElement(QRcodeStatus, {\n prefixCls: prefixCls,\n locale: locale,\n status: status,\n onRefresh: onRefresh,\n statusRender: statusRender\n }))), type === 'canvas' ? /*#__PURE__*/React.createElement(QRCodeCanvas, Object.assign({}, qrCodeProps)) : /*#__PURE__*/React.createElement(QRCodeSVG, Object.assign({}, qrCodeProps))));\n};\nif (process.env.NODE_ENV !== 'production') {\n QRCode.displayName = 'QRCode';\n}\nexport default QRCode;"],"mappings":"AAAA,YAAY;;AAEZ,IAAIA,MAAM,GAAG,IAAI,IAAI,IAAI,CAACA,MAAM,IAAI,UAAUC,CAAC,EAAEC,CAAC,EAAE;EAClD,IAAIC,CAAC,GAAG,CAAC,CAAC;EACV,KAAK,IAAIC,CAAC,IAAIH,CAAC,EAAE,IAAII,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACP,CAAC,EAAEG,CAAC,CAAC,IAAIF,CAAC,CAACO,OAAO,CAACL,CAAC,CAAC,GAAG,CAAC,EAAED,CAAC,CAACC,CAAC,CAAC,GAAGH,CAAC,CAACG,CAAC,CAAC;EAChG,IAAIH,CAAC,IAAI,IAAI,IAAI,OAAOI,MAAM,CAACK,qBAAqB,KAAK,UAAU,EAAE,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEP,CAAC,GAAGC,MAAM,CAACK,qBAAqB,CAACT,CAAC,CAAC,EAAEU,CAAC,GAAGP,CAAC,CAACQ,MAAM,EAAED,CAAC,EAAE,EAAE;IAC3I,IAAIT,CAAC,CAACO,OAAO,CAACL,CAAC,CAACO,CAAC,CAAC,CAAC,GAAG,CAAC,IAAIN,MAAM,CAACC,SAAS,CAACO,oBAAoB,CAACL,IAAI,CAACP,CAAC,EAAEG,CAAC,CAACO,CAAC,CAAC,CAAC,EAAER,CAAC,CAACC,CAAC,CAACO,CAAC,CAAC,CAAC,GAAGV,CAAC,CAACG,CAAC,CAACO,CAAC,CAAC,CAAC;EACnG;EACA,OAAOR,CAAC;AACV,CAAC;AACD,OAAOW,K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