You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Messages__Private__index...

1792 lines
82 KiB

"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([[52829],{
/***/ 56971:
/*!*****************************************!*\
!*** ./src/components/NoData/index.tsx ***!
\*****************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js */ 82242);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/assets/images/icons/nodata.png */ 93314);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ 3113);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
var noData = function noData(_ref) {
var img = _ref.img,
_ref$buttonProps = _ref.buttonProps,
buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
_ref$styles = _ref.styles,
styles = _ref$styles === void 0 ? {} : _ref$styles,
customText = _ref.customText,
ButtonText = _ref.ButtonText,
ButtonClick = _ref.ButtonClick,
Buttonclass = _ref.Buttonclass,
ButtonTwo = _ref.ButtonTwo,
imgStyles = _ref.imgStyles,
_ref$loading = _ref.loading,
loading = _ref$loading === void 0 ? false : _ref$loading;
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("section", {
className: "tc animated fadeIn",
style: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, {
color: '#999',
margin: '100px auto',
visibility: loading ? 'hidden' : 'visible'
}), styles),
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("img", {
src: img || _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_2__,
style: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, imgStyles), {}, {
pointerEvents: "none",
userSelect: "none"
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p", {
className: "mt20 font14",
children: customText || '暂时还没有相关数据哦!'
}), ButtonText && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({
className: Buttonclass,
onClick: ButtonClick
}, buttonProps), {}, {
children: ButtonText
})), ButtonTwo && ButtonTwo]
});
};
/* harmony default export */ __webpack_exports__.Z = (noData);
/***/ }),
/***/ 32272:
/*!*********************************************************!*\
!*** ./src/components/PreviewAll/index.tsx + 1 modules ***!
\*********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ PreviewAll; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(82242);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(7557);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(41498);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(79800);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
;// CONCATENATED MODULE: ./src/components/PreviewAll/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var PreviewAllmodules = ({"wrp":"wrp___dq7YK","bgBlack":"bgBlack___ARIUV","monaco":"monaco___VnZC3","darkBlue":"darkBlue___UprA9","close":"close___LKoWu","embed":"embed___hvpEJ"});
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es_button = __webpack_require__(3113);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.5@@ant-design/icons/es/icons/ArrowDownOutlined.js + 1 modules
var ArrowDownOutlined = __webpack_require__(52702);
// EXTERNAL MODULE: ./src/components/monaco-editor/index.jsx + 4 modules
var monaco_editor = __webpack_require__(34776);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
var tooltip = __webpack_require__(6848);
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(73400);
// EXTERNAL MODULE: ./src/service/exercise.ts
var exercise = __webpack_require__(86886);
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
var NoData = __webpack_require__(56971);
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(2367);
// EXTERNAL MODULE: ./src/service/attachment.ts
var attachment = __webpack_require__(84710);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/components/PreviewAll/index.tsx
/* harmony default export */ var PreviewAll = (function (_ref) {
var _data, _data2, _data3, _data4, _data5, _data6;
var _ref$editOffice = _ref.editOffice,
editOffice = _ref$editOffice === void 0 ? 'view' : _ref$editOffice,
data = _ref.data,
theme = _ref.theme,
type = _ref.type,
filename = _ref.filename,
monacoEditor = _ref.monacoEditor,
className = _ref.className,
style = _ref.style,
close = _ref.close,
onClose = _ref.onClose,
hasMask = _ref.hasMask,
disabledDownload = _ref.disabledDownload,
onImgDimensions = _ref.onImgDimensions,
showNodata = _ref.showNodata,
recordInfo = _ref.recordInfo;
var _useState = (0,_react_17_0_2_react.useState)('https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt'),
_useState2 = slicedToArray_default()(_useState, 2),
src = _useState2[0],
setSrc = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(""),
_useState4 = slicedToArray_default()(_useState3, 2),
token = _useState4[0],
setToken = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(),
_useState6 = slicedToArray_default()(_useState5, 2),
officeData = _useState6[0],
setOfficeData = _useState6[1];
var officePath = window.ENV === "build" ? "/react/build" : "";
var apiServer = location.host.startsWith("localhost") ? env/* default */.Z.PROXY_SERVER : env/* default */.Z.API_SERVER;
// let size;
var unit = 1024 * 1024;
var maxSize = 10 * unit;
var closeRef = (0,_react_17_0_2_react.useRef)();
if ((_data = data) !== null && _data !== void 0 && _data.startsWith("/api") && type !== "txt") {
data = env/* default */.Z.API_SERVER + data;
}
var getFileExtension = function getFileExtension(url) {
var filename = url.substring(url.lastIndexOf('/') + 1);
var extension = filename.split('.').pop();
return extension;
};
if (filename) monacoEditor.filename = filename;
(0,_react_17_0_2_react.useEffect)(function () {
var _document$cookie;
var cookies = (_document$cookie = document.cookie) === null || _document$cookie === void 0 || (_document$cookie = _document$cookie.replace(/\s/g, "")) === null || _document$cookie === void 0 ? void 0 : _document$cookie.split(";");
cookies === null || cookies === void 0 || cookies.map(function (item) {
var i = item.split("=");
if (i[0] === '_educoder_session') {
setToken(i[1]);
}
});
}, []);
(0,_react_17_0_2_react.useEffect)(function () {
if (type === "office") {
if (data.indexOf("bigfilescdn.") > -1 || data.indexOf("bigfiles1") > -1) {
setOfficeData({
url: data,
fileType: getFileExtension(data),
model: data.indexOf("model=edit") ? "edit" : "view"
});
} else {
getData();
}
}
}, [type, data]);
var getData = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var _url, _id, res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
console.log("data:", data);
_url = data;
if (!data.startsWith("http")) {
_url = location.origin + _url;
}
_id = new URL(_url).pathname.split("/").pop();
_context.next = 6;
return (0,exercise/* setEcsAttachment */.gJ)({
attachment_id: _id
});
case 6:
res = _context.sent;
res.url = apiServer + res.url;
setOfficeData(res);
case 9:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getData() {
return _ref2.apply(this, arguments);
};
}();
var handleClick = function handleClick() {
if (data.startsWith("http") || data.startsWith('blob:')) {
handleDown();
return;
}
(0,util/* downloadFile */.Sv)(filename || 'educoder', data, filename);
};
var handleDown = function handleDown() {
if (recordInfo) {
// 教学资料--点击下载资料时记录下载信息
(0,attachment/* add_file_quantity */.fc)({
id: recordInfo === null || recordInfo === void 0 ? void 0 : recordInfo.id,
watch_type: 1,
course_id: recordInfo === null || recordInfo === void 0 ? void 0 : recordInfo.course_id
});
}
(0,util/* downLoadLink */.Nd)(filename || 'educoder', decodeURIComponent(data));
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: objectSpread2_default()({}, style || {}),
className: "".concat(hasMask && PreviewAllmodules.bgBlack, " ").concat(!!type ? PreviewAllmodules.wrp : "hide"),
children: [close && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: PreviewAllmodules.close,
ref: closeRef,
children: [!!onImgDimensions && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",
getPopupContainer: function getPopupContainer() {
return closeRef.current;
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
onClick: function onClick() {
onClose();
onImgDimensions();
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "icon-yulanpizhu"
})
})
}), !disabledDownload && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",
getPopupContainer: function getPopupContainer() {
return closeRef.current;
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
onClick: handleDown,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "icon-quxiaozhiding"
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u5173\u95ED",
getPopupContainer: function getPopupContainer() {
return closeRef.current;
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "",
onClick: onClose,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "icon-guanbi1"
})
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "".concat(PreviewAllmodules[className], " ").concat(className, " ").concat(PreviewAllmodules.monaco, " ").concat(type === "txt" ? "show" : "hide"),
children: type === "txt" && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(monaco_editor/* default */.ZP, objectSpread2_default()({}, monacoEditor))
})
}), type === "audio" && /*#__PURE__*/(0,jsx_runtime.jsx)("audio", {
src: "".concat(((_data2 = data) === null || _data2 === void 0 ? void 0 : _data2.indexOf("http://")) > -1 || ((_data3 = data) === null || _data3 === void 0 ? void 0 : _data3.indexOf("https://")) > -1 ? "" : "data:audio/mp3;base64,").concat(data),
autoPlay: true
}), type === "video" && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
children: ((_data4 = data) === null || _data4 === void 0 ? void 0 : _data4.indexOf("http")) > -1 ? /*#__PURE__*/(0,jsx_runtime.jsx)("video", {
controls: true,
src: "".concat(data),
autoPlay: true
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("video", {
controls: true,
src: "data:video/mp4;base64,".concat(data),
autoPlay: true
})
}), type === 'office' && officeData && /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
src: "".concat(officePath, "/office.html?key=").concat(officeData.key, "&url=").concat(btoa(officeData.url), "&callbackUrl=").concat(apiServer + officeData.callbackUrl, "&fileType=").concat(officeData.fileType, "&title=").concat(officeData.title, "&model=").concat(editOffice, "&officeServer=").concat(env/* default */.Z.ONLYOFFICE, "&disabledDownload=").concat(!!disabledDownload)
}), type === 'html' && /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
src: data + '&disposition=inline'
}), type === 'pdf' && /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
src: "".concat(officePath, "/js/pdfview/index.html?url=").concat(data, "&disabledDownload=").concat(!!disabledDownload)
}) //<embed className={styles.embed + "#toolbar=0"} src={data} />
, type === "image" && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: "".concat(((_data5 = data) === null || _data5 === void 0 ? void 0 : _data5.indexOf("http://")) > -1 || ((_data6 = data) === null || _data6 === void 0 ? void 0 : _data6.indexOf("https://")) > -1 ? "" : "data:image/png;base64,").concat(data)
}), (type === "other" || type === "download") && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
children: showNodata ? /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {
customText: "\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",
ButtonTwo: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-xiazai4 font14"
}),
type: "primary",
size: 'middle',
onClick: handleClick,
children: "\u4E0B\u8F7D"
})
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
type: "primary",
size: 'middle',
onClick: handleClick,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ArrowDownOutlined/* default */.Z, {}), "\u70B9\u51FB\u4E0B\u8F7D"]
})
})]
});
});
/***/ }),
/***/ 78653:
/*!*********************************************!*\
!*** ./src/components/RenderHtml/index.tsx ***!
\*********************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js */ 82242);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js */ 37205);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/createForOfIteratorHelper.js */ 91232);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js */ 79800);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var katex_dist_katex_min_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! katex/dist/katex.min.css */ 53664);
/* harmony import */ var _utils_marked__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/utils/marked */ 89206);
/* harmony import */ var code_prettify__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! code-prettify */ 64018);
/* harmony import */ var code_prettify__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(code_prettify__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var hls_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! hls.js */ 70169);
/* harmony import */ var _utils_env__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/utils/env */ 2367);
/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! katex */ 15342);
/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(katex__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! uuid */ 1012);
/* harmony import */ var _components_PreviewAll__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/components/PreviewAll */ 32272);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
var ADD_MULTI = '@▁▁@';
var ADD_SINGLE = '@▁@';
var preRegex = /<pre[^>]*>/g;
function _unescape(str) {
var div = document.createElement('div');
div.innerHTML = str;
return div.childNodes.length === 0 ? '' : div.childNodes[0].nodeValue;
}
/* harmony default export */ __webpack_exports__.Z = (function (_ref) {
var _ref$value = _ref.value,
value = _ref$value === void 0 ? '' : _ref$value,
className = _ref.className,
showTextOnly = _ref.showTextOnly,
showLines = _ref.showLines,
_ref$style = _ref.style,
style = _ref$style === void 0 ? {} : _ref$style,
_ref$stylesPrev = _ref.stylesPrev,
stylesPrev = _ref$stylesPrev === void 0 ? {} : _ref$stylesPrev,
highlightKeywords = _ref.highlightKeywords,
showProgramFill = _ref.showProgramFill,
isProgramFill = _ref.isProgramFill,
_ref$disabledFill = _ref.disabledFill,
disabledFill = _ref$disabledFill === void 0 ? false : _ref$disabledFill,
programFillValue = _ref.programFillValue,
_ref$onFillChange = _ref.onFillChange,
onFillChange = _ref$onFillChange === void 0 ? function (value) {} : _ref$onFillChange,
_ref$onFillBlur = _ref.onFillBlur,
onFillBlur = _ref$onFillBlur === void 0 ? function () {} : _ref$onFillBlur;
var str = String(value);
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(""),
_useState2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState, 2),
data = _useState2[0],
setData = _useState2[1];
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)("office"),
_useState4 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState3, 2),
type = _useState4[0],
setType = _useState4[1];
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)([]),
_useState6 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState5, 2),
projectValue = _useState6[0],
setProjectValue = _useState6[1];
var classNamesRef = (0,react__WEBPACK_IMPORTED_MODULE_4__.useRef)("a" + (0,uuid__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z)());
var formObj = {};
var createInput = function createInput(a, num) {
// const wrap = document.createElement("span")
// wrap.className =
var input = document.createElement(a === ADD_SINGLE ? "input" : "textarea");
input.style.width = "100%";
input.style.height = a === ADD_SINGLE ? "40px" : "151px";
input.rows = 5;
input.spellcheck = false;
input.name = "edu-program-fill";
input.placeholder = "请输入";
input.dataset.id = num;
var key = Object.keys(formObj).length;
formObj[key] = input;
return "<span class=\"edu-program-fill-wrap ".concat(a === ADD_SINGLE ? "" : "show", "\" style=\"width:").concat(a === ADD_SINGLE ? "200px" : "100%", "\"><span>").concat(input.outerHTML, "<span class=\"edu-program-fill-score\"></span></span></span>");
};
var formatMD = function formatMD(rs) {
return rs.replace(/<style.*?>([\s\S]+?)<\/style>/gim, function (_, css) {
var _css = css.replace(/(\n|\r)/g, "").split("}");
var arr = [];
_css.map(function (item) {
if (item != '') {
arr.push(".".concat(classNamesRef.current, " ").concat(item));
}
});
return "<style>".concat(arr.join("}"), "</style>");
});
};
var html = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {
try {
var reg = /\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g;
var reg2 = /\"\/api\/attachments\/|\"\/attachments\/download\//g;
var reg3 = /\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;
str = str.replace(reg, "(" + _utils_env__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z.API_SERVER + "/api/attachments/").replace(reg2, '"' + _utils_env__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z.API_SERVER + "/api/attachments/").replace(reg3, '"' + _utils_env__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z.API_SERVER + "/files/uploads/").replaceAll("http://video.educoder", "https://video.educoder").replaceAll("http://www.educoder.net/api", "https://data.educoder.net/api").replaceAll("https://www.educoder.net/api", "https://data.educoder.net/api").replace(/\r\n/g, "\n");
// str = str.replace(new RegExp("(?<!\\n)\\n(?!\\n)", "g"), " \n")
} catch (e) {}
;
if (showProgramFill) {
var num = -1;
str = str.replaceAll("<", "&lt;").replaceAll(">", "&gt;").replace(/(@▁▁@|@▁@)/g, function (a, b, c) {
++num;
return createInput(a, num);
});
return "<pre style=\"background:#fff;padding:4px\">".concat(formatMD(str || ""), "</pre>");
}
var rs = formatMD(str);
rs = (0,_utils_marked__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .ZP)(rs);
var math_expressions = (0,_utils_marked__WEBPACK_IMPORTED_MODULE_6__/* .getMathExpressions */ .ez)();
if (str.match(/\[TOC\]/)) {
rs = rs.replace('<p>[TOC]</p>', (0,_utils_marked__WEBPACK_IMPORTED_MODULE_6__/* .getTocContent */ .Qv)());
(0,_utils_marked__WEBPACK_IMPORTED_MODULE_6__/* .cleanToc */ .Iy)();
}
rs = rs.replace(/(__special_katext_id_\d+__)/g, function (_match, capture) {
var _math_expressions$cap = math_expressions[capture],
type = _math_expressions$cap.type,
expression = _math_expressions$cap.expression;
return (0,katex__WEBPACK_IMPORTED_MODULE_10__.renderToString)(_unescape(expression) || '', {
displayMode: type === 'block',
throwOnError: false,
output: 'html'
});
});
rs = rs.replace(/▁/g, '▁▁▁');
(0,_utils_marked__WEBPACK_IMPORTED_MODULE_6__/* .resetMathExpressions */ .AL)();
// return dompurify.sanitize(rs)
var dom = document.createElement('div');
dom.innerHTML = rs;
if (highlightKeywords) {
var escapedKeywords = highlightKeywords.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
findKeyword(dom, escapedKeywords);
return dom.innerHTML;
}
if (showTextOnly) {
return dom.innerText;
}
setTimeout(function () {
return onLoad();
}, 500);
return dom.innerHTML;
}, [str, highlightKeywords]);
(0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {
if (el.current) {
var inputs = el.current.querySelectorAll(["input", "textarea"]);
inputs.forEach(function (input) {
input.oninput = onInput;
input.onblur = onBlur;
});
}
}, [projectValue]);
(0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {
if (!!(programFillValue !== null && programFillValue !== void 0 && programFillValue.length)) {
try {
var scoreDom = el.current.querySelectorAll(".edu-program-fill-score");
var dom = el.current.querySelectorAll('[name="edu-program-fill"]');
var _iterator = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_2___default()(dom.entries()),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var _programFillValue$k;
var _step$value = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_step.value, 2),
k = _step$value[0],
i = _step$value[1];
i.value = (_programFillValue$k = programFillValue[k]) === null || _programFillValue$k === void 0 ? void 0 : _programFillValue$k.value;
if (programFillValue[k].type === "warning") {
i.className = "program-fill-warning";
} else if (programFillValue[k].type === "success") {
i.className = "program-fill-success";
} else {
i.className = "";
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
var _iterator2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_2___default()(scoreDom.entries()),
_step2;
try {
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
var _programFillValue$_k, _programFillValue$_k2;
var _step2$value = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_step2.value, 2),
_k = _step2$value[0],
_i = _step2$value[1];
_i.innerHTML = (_programFillValue$_k = programFillValue[_k]) !== null && _programFillValue$_k !== void 0 && _programFillValue$_k.score ? "".concat((_programFillValue$_k2 = programFillValue[_k]) === null || _programFillValue$_k2 === void 0 ? void 0 : _programFillValue$_k2.score, "\u5206") : "";
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}
setProjectValue(programFillValue);
} catch (error) {}
}
}, [programFillValue]);
var onInput = function onInput(e) {
projectValue[e.target.dataset.id] = projectValue[e.target.dataset.id] || {};
projectValue[e.target.dataset.id]["value"] = e.target.value;
setProjectValue(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1___default()(projectValue));
onFillChange(projectValue, e.target.dataset.id);
};
var onBlur = function onBlur(e) {
projectValue[e.target.dataset.id] = projectValue[e.target.dataset.id] || {};
projectValue[e.target.dataset.id]["value"] = e.target.value;
setProjectValue(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1___default()(projectValue));
onFillBlur(projectValue, e.target.dataset.id);
};
function findKeyword(node, keyword) {
return node.childNodes.forEach(function (childNode) {
if (childNode.childNodes.length > 0) {
findKeyword(childNode, keyword);
} else if (childNode.nodeName !== "IMG") {
if (childNode.innerHTML) {
var _childNode$innerHTML;
childNode.innerHTML = (_childNode$innerHTML = childNode.innerHTML) === null || _childNode$innerHTML === void 0 ? void 0 : _childNode$innerHTML.replace(new RegExp(keyword, "gi"), '<span style="color:#0152d9;background-color:#1890ff33">$&</span>');
} else {
var dom = document.createElement("span");
dom.innerHTML = childNode.textContent.replace(new RegExp(keyword, "gi"), '<span style="color:#0152d9;background-color:#1890ff33">$&</span>');
childNode.replaceWith(dom);
}
}
});
// return dom.childNodes.forEach((node:any) => {
// console.log("nodeLen:",node.childNodes.length)
// if(node.childNodes.length > 0){
// debugger
// // findKeyword(dom.childNodes,keyword)
// }else{
// if(node.nodeName !== "#text"){
// node.innerHTML = node.innerHTML.replaceAll(keyword,`<span class="c-blue">${keyword}</span>`)
// console.log("node:",node,dom,node.nodeName,node.innerHTML,node.childNodes.length)
// debugger
// }
// }
// return node
// });
}
var el = (0,react__WEBPACK_IMPORTED_MODULE_4__.useRef)();
_utils_marked__WEBPACK_IMPORTED_MODULE_6__/* .lines */ .jb['WebkitLineClamp'] = showLines;
if (showLines) {
style = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, style), _utils_marked__WEBPACK_IMPORTED_MODULE_6__/* .lines */ .jb);
}
function onAncherHandler(e) {
var target = e.target;
if (target.tagName.toUpperCase() === 'A') {
var ancher = target.getAttribute('href');
if (ancher.indexOf("office") > -1) {
e.preventDefault();
setData(ancher);
setType("office");
} else if (ancher.indexOf("application/pdf") > -1) {
e.preventDefault();
setData(ancher);
setType("pdf");
} else if (ancher.indexOf("text/html") > -1) {
e.preventDefault();
setData(ancher);
setType("html");
} else if (ancher.startsWith('#')) {
e.preventDefault();
var viewEl = document.getElementById(ancher.replace('#', ''));
if (viewEl) {
viewEl.scrollIntoView(true);
}
}
}
}
var onLoad = function onLoad() {
var _el$current;
var videoElement = (_el$current = el.current) === null || _el$current === void 0 ? void 0 : _el$current.querySelectorAll('video');
videoElement === null || videoElement === void 0 || videoElement.forEach(function (item) {
item.oncontextmenu = function () {
return false;
};
if (item.src.indexOf('.m3u8') > -1) {
if (item.canPlayType('application/vnd.apple.mpegurl')) {} else if (hls_js__WEBPACK_IMPORTED_MODULE_8__/* ["default"].isSupported */ .ZP.isSupported()) {
var hls = new hls_js__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .ZP();
hls.loadSource(item.src);
hls.attachMedia(item);
}
}
});
};
(0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {
if (el.current && html) {
if (html.match(preRegex)) {
window.PR.prettyPrint();
}
}
if (el.current) {
el.current.addEventListener('click', onAncherHandler);
return function () {
var _el$current2;
(_el$current2 = el.current) === null || _el$current2 === void 0 || _el$current2.removeEventListener('click', onAncherHandler);
(0,_utils_marked__WEBPACK_IMPORTED_MODULE_6__/* .resetMathExpressions */ .AL)();
(0,_utils_marked__WEBPACK_IMPORTED_MODULE_6__/* .cleanToc */ .Iy)();
};
}
}, [html, el.current, onAncherHandler]);
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.Fragment, {
children: [showTextOnly && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div", {
ref: el,
children: html
}), !showTextOnly && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div", {
ref: el,
style: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, style),
className: "".concat(className ? className : '', " ").concat(disabledFill ? "disabled-fill" : "", " markdown-body ").concat(classNamesRef.current),
dangerouslySetInnerHTML: {
__html: html
}
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_components_PreviewAll__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z, {
close: true,
data: data,
type: !!(data !== null && data !== void 0 && data.length) ? type : "",
style: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, stylesPrev),
onClose: function onClose() {
return setData("");
}
})]
});
});
/***/ }),
/***/ 1703:
/*!**********************************************************!*\
!*** ./src/pages/Messages/Private/index.tsx + 2 modules ***!
\**********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"default": function() { return /* binding */ Private; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(82242);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(79800);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectWithoutProperties.js
var objectWithoutProperties = __webpack_require__(39647);
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 15 modules
var _umi_production_exports = __webpack_require__(58011);
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.10@dayjs/dayjs.min.js
var dayjs_min = __webpack_require__(9498);
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/menu/index.js + 11 modules
var menu = __webpack_require__(20834);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/layout/index.js
var layout = __webpack_require__(44000);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
var row = __webpack_require__(95237);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
var col = __webpack_require__(43604);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/divider/index.js + 1 modules
var divider = __webpack_require__(28103);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/skeleton/index.js + 12 modules
var skeleton = __webpack_require__(84578);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
var pagination = __webpack_require__(66786);
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(2367);
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
var NoData = __webpack_require__(56971);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/defineProperty.js
var defineProperty = __webpack_require__(85573);
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(7557);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(41498);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
var es_form = __webpack_require__(78241);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
var modal = __webpack_require__(43418);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
var message = __webpack_require__(8591);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
var input = __webpack_require__(62680);
// EXTERNAL MODULE: ./src/service/messages.ts
var service_messages = __webpack_require__(4825);
;// CONCATENATED MODULE: ./src/pages/Messages/Private/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var Privatemodules = ({"flex_box_center":"flex_box_center___N_gPw","flex_space_between":"flex_space_between___f_LaO","flex_box_vertical_center":"flex_box_vertical_center___silBX","flex_box_center_end":"flex_box_center_end___Nt5TD","flex_box_column":"flex_box_column___xc67X","tabs":"tabs___JYWDM","active":"active___siUX9","list":"list___IZLen","tags":"tags___V_Bdb","searchWrp":"searchWrp___MhTxO","newlight":"newlight___pybQh"});
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/Messages/Private/components/WriteMessage.tsx
var PublishShixun = function PublishShixun(_ref) {
var _data$users;
var messages = _ref.messages,
loading = _ref.loading,
user = _ref.user,
dispatch = _ref.dispatch;
var params = (0,_umi_production_exports.useParams)();
var location = (0,_umi_production_exports.useLocation)();
var actionTabs = messages.actionTabs;
var _Form$useForm = es_form/* default */.Z.useForm(),
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
form = _Form$useForm2[0];
var recentContacts = messages.recentContacts;
var _useState = (0,_react_17_0_2_react.useState)(''),
_useState2 = slicedToArray_default()(_useState, 2),
keyword = _useState2[0],
setKeyword = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)([]),
_useState4 = slicedToArray_default()(_useState3, 2),
data = _useState4[0],
setData = _useState4[1];
var _useState5 = (0,_react_17_0_2_react.useState)(false),
_useState6 = slicedToArray_default()(_useState5, 2),
showSearch = _useState6[0],
setShowSearch = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)(),
_useState8 = slicedToArray_default()(_useState7, 2),
selectUser = _useState8[0],
setSelectUser = _useState8[1];
(0,_react_17_0_2_react.useEffect)(function () {
if (messages.actionTabs.key === '写私信') getData();
}, [messages.actionTabs.key]);
var getData = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var _user$userInfo;
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return dispatch({
type: 'messages/getRecentContacts',
payload: {
id: user === null || user === void 0 || (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.user_id,
keyword: keyword
}
});
case 2:
res = _context.sent;
setData(objectSpread2_default()({}, res));
case 4:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getData() {
return _ref2.apply(this, arguments);
};
}();
var getData2 = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
var res;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
if (!(keyword !== '')) {
_context2.next = 5;
break;
}
_context2.next = 3;
return dispatch({
type: 'messages/getUsersForPrivateMessages',
payload: {
keyword: keyword
}
});
case 3:
res = _context2.sent;
setData(objectSpread2_default()({}, res));
case 5:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function getData2() {
return _ref3.apply(this, arguments);
};
}();
(0,_react_17_0_2_react.useEffect)(function () {
getData2();
}, [keyword]);
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
centered: true,
title: "\u5199\u79C1\u4FE1",
open: messages.actionTabs.key === '写私信' ? true : false,
okText: "\u786E\u5B9A",
cancelText: "\u53D6\u6D88",
bodyStyle: {
height: 320
},
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
var _user$userInfo2;
var formValue, fetchUrl, res, _user$userInfo3, _res$private_message;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
_context3.next = 2;
return form.validateFields();
case 2:
formValue = form.getFieldValue();
fetchUrl = "/api/course_modules/".concat(params.categoryId, "/add_second_category.json");
_context3.next = 6;
return (0,service_messages/* postPrivateMessages */.w0)({
content: formValue.content,
target_id: selectUser,
userId: user === null || user === void 0 || (_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.user_id
});
case 6:
res = _context3.sent;
if (res.status === 0) {
message/* default */.ZP.success('添加成功');
dispatch({
type: 'messages/setActionTabs',
payload: {}
});
_umi_production_exports.history.push("/messages/".concat(user === null || user === void 0 || (_user$userInfo3 = user.userInfo) === null || _user$userInfo3 === void 0 ? void 0 : _user$userInfo3.login, "/message_detail?target_ids=").concat(res === null || res === void 0 || (_res$private_message = res.private_message) === null || _res$private_message === void 0 ? void 0 : _res$private_message.receiver_id));
}
case 8:
case "end":
return _context3.stop();
}
}, _callee3);
})),
onCancel: function onCancel() {
dispatch({
type: 'messages/setActionTabs',
payload: {}
});
},
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
form: form,
initialValues: defineProperty_default()({}, 'name', ""),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
name: "users",
rules: [{
required: true,
message: "请选择发送对象"
}],
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Search, {
onFocus: function onFocus() {
return setShowSearch(true);
},
onSearch: function onSearch(value) {
setKeyword(value);
},
placeholder: "\u53D1\u9001\u7ED9..."
})
}), showSearch && /*#__PURE__*/(0,jsx_runtime.jsx)(skeleton/* default */.Z, {
loading: loading['messages/getUsersForPrivateMessages'],
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: Privatemodules.searchWrp,
style: {
maxHeight: 260,
overflow: "auto"
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: "c-light-black mt10",
children: keyword === '' ? '最近联系人' : "搜索结果"
}), data === null || data === void 0 || (_data$users = data.users) === null || _data$users === void 0 ? void 0 : _data$users.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
className: "mt15 current",
onClick: function onClick() {
setSelectUser(item.id);
form.setFieldsValue({
users: item.name
});
setShowSearch(false);
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "58px",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
style: {
width: 48,
borderRadius: 48
},
src: env/* default */.Z.IMG_SERVER + '/images/' + (item === null || item === void 0 ? void 0 : item.image_url),
alt: ""
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: item.name
})]
}, index);
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
rules: [{
required: true,
message: "请输入发送内容"
}],
className: showSearch && 'hide',
name: "content",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.TextArea, {
rows: 10,
maxLength: 200
})
})]
})
});
};
/* harmony default export */ var WriteMessage = ((0,_umi_production_exports.connect)(function (_ref6) {
var messages = _ref6.messages,
loading = _ref6.loading,
user = _ref6.user;
return {
messages: messages,
user: user,
loading: loading.effects
};
})(PublishShixun));
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx
var RenderHtml = __webpack_require__(78653);
// EXTERNAL MODULE: ./src/pages/Messages/component/LeftNav.tsx + 1 modules
var LeftNav = __webpack_require__(91757);
;// CONCATENATED MODULE: ./src/pages/Messages/Private/index.tsx
var _excluded = ["messages", "globalSetting", "loading", "user", "dispatch"];
var SubMenu = menu/* default */.Z.SubMenu;
var Sider = layout/* default */.Z.Sider,
Content = layout/* default */.Z.Content;
var ShixunsListPage = function ShixunsListPage(_ref) {
var _privateMessage$priva, _privateMessage$priva2;
var messages = _ref.messages,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
user = _ref.user,
dispatch = _ref.dispatch,
props = objectWithoutProperties_default()(_ref, _excluded);
var params = (0,_umi_production_exports.useParams)();
var userInfo = user.userInfo;
var tidingsList = messages.tidingsList,
privateMessage = messages.privateMessage;
var _useState = (0,_react_17_0_2_react.useState)({
per_page: 10,
page: 1
}),
_useState2 = slicedToArray_default()(_useState, 2),
bodyParams = _useState2[0],
setBodyParams = _useState2[1];
(0,_react_17_0_2_react.useEffect)(function () {
bodyParams.page = 1;
getData();
}, [params.userId]);
var getData = function getData() {
dispatch({
type: 'messages/getPrivateMessages',
payload: objectSpread2_default()(objectSpread2_default()({}, bodyParams), params)
});
};
var toDetail = function toDetail(item) {
var _user$userInfo, _item$target;
props.history.push("/messages/".concat(user === null || user === void 0 || (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.login, "/message_detail?target_ids=").concat(item === null || item === void 0 || (_item$target = item.target) === null || _item$target === void 0 ? void 0 : _item$target.id));
};
var toUser = function toUser(item) {
var _item$target2;
props.history.push("/users/".concat(item === null || item === void 0 || (_item$target2 = item.target) === null || _item$target2 === void 0 ? void 0 : _item$target2.login));
};
var privateMessageAuth = (0,_react_17_0_2_react.useMemo)(function () {
return (userInfo === null || userInfo === void 0 ? void 0 : userInfo.is_teacher) && (userInfo === null || userInfo === void 0 ? void 0 : userInfo.professional_certification);
}, [userInfo]);
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: Privatemodules.bg,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("section", {
className: "edu-container mt20",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
gutter: [20, 20],
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(LeftNav/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: "1",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: "bg-white",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
className: "pt30 pl30 pr30 font16",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "1",
children: "\u5168\u90E8\u79C1\u4FE1"
}), privateMessageAuth && /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-blue current",
onClick: function onClick() {
var _user$userInfo2;
dispatch({
type: 'messages/setActionTabs',
payload: {
key: '写私信',
bodyParams: objectSpread2_default()(objectSpread2_default()({}, bodyParams), {}, {
user_id: user === null || user === void 0 || (_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.user_id
})
}
});
},
children: "\u5199\u79C1\u4FE1"
})
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
className: Privatemodules.list,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(skeleton/* default */.Z, {
active: true,
avatar: {
size: 40
},
paragraph: {
rows: 5
},
loading: loading['messages/getPrivateMessages'],
children: [!(privateMessage !== null && privateMessage !== void 0 && (_privateMessage$priva = privateMessage.private_messages) !== null && _privateMessage$priva !== void 0 && _privateMessage$priva.length) && /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {}), privateMessage === null || privateMessage === void 0 || (_privateMessage$priva2 = privateMessage.private_messages) === null || _privateMessage$priva2 === void 0 ? void 0 : _privateMessage$priva2.map(function (item, index) {
var _item$target3, _item$target4;
return /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "58px",
onClick: function onClick() {
return toUser(item);
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: env/* default */.Z.IMG_SERVER + '/images/' + (item === null || item === void 0 || (_item$target3 = item.target) === null || _item$target3 === void 0 ? void 0 : _item$target3.image_url),
alt: ""
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: 1,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 24,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: "1",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
onClick: function onClick() {
return toUser(item);
},
children: item === null || item === void 0 || (_item$target4 = item.target) === null || _item$target4 === void 0 ? void 0 : _item$target4.name
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml15",
children: "\u4E0E\u4F60\u7684\u79C1\u4FE1"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "c-light-black mr15",
children: ["[", item === null || item === void 0 ? void 0 : item.message_count, "\u6761]"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml15 c-light-black",
children: dayjs_min_default()(item.send_time).fromNow()
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: (item === null || item === void 0 ? void 0 : item.unread) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Privatemodules.newlight
})
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 24,
onClick: function onClick() {
return toDetail(item);
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "mt15",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: item.content || ''
})
})
})]
})
})]
})
});
})]
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
className: "tc mt20",
children: !loading['messages/getTidings'] && /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
hideOnSinglePage: true,
showSizeChanger: false,
onChange: function onChange(page) {
bodyParams.page = page;
setBodyParams(objectSpread2_default()({}, bodyParams));
getData();
},
current: bodyParams.page || 1,
total: privateMessage === null || privateMessage === void 0 ? void 0 : privateMessage.count
})
})]
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(WriteMessage, {})]
});
};
/* harmony default export */ var Private = ((0,_umi_production_exports.connect)(function (_ref2) {
var messages = _ref2.messages,
loading = _ref2.loading,
user = _ref2.user,
globalSetting = _ref2.globalSetting;
return {
messages: messages,
globalSetting: globalSetting,
user: user,
loading: loading.effects
};
})(ShixunsListPage));
/***/ }),
/***/ 91757:
/*!**************************************************************!*\
!*** ./src/pages/Messages/component/LeftNav.tsx + 1 modules ***!
\**************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ LeftNav; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(82242);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(79800);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectWithoutProperties.js
var objectWithoutProperties = __webpack_require__(39647);
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 15 modules
var _umi_production_exports = __webpack_require__(58011);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/menu/index.js + 11 modules
var menu = __webpack_require__(20834);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/layout/index.js
var layout = __webpack_require__(44000);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
var col = __webpack_require__(43604);
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(2367);
;// CONCATENATED MODULE: ./src/pages/Messages/component/LeftNav.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var LeftNavmodules = ({"flex_box_center":"flex_box_center___cQVhO","flex_space_between":"flex_space_between___L36a6","flex_box_vertical_center":"flex_box_vertical_center___sIHwG","flex_box_center_end":"flex_box_center_end___OqNyE","flex_box_column":"flex_box_column___Ct7XG","userInfo":"userInfo____uyMZ","navInfo":"navInfo___acXs6","actived":"actived___WhZza","newTip":"newTip___Jdd6B"});
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/Messages/component/LeftNav.tsx
var _excluded = ["messages", "globalSetting", "loading", "user", "dispatch"];
var SubMenu = menu/* default */.Z.SubMenu;
var Sider = layout/* default */.Z.Sider,
Content = layout/* default */.Z.Content;
var ShixunsListPage = function ShixunsListPage(_ref) {
var messages = _ref.messages,
globalSetting = _ref.globalSetting,
loading = _ref.loading,
user = _ref.user,
dispatch = _ref.dispatch,
props = objectWithoutProperties_default()(_ref, _excluded);
var params = (0,_umi_production_exports.useParams)();
var userInfo = user.userInfo;
var location = (0,_umi_production_exports.useLocation)();
var tidingsList = messages.tidingsList,
privateMessage = messages.privateMessage,
unreadInfo = messages.unreadInfo;
var _useState = (0,_react_17_0_2_react.useState)({
per_page: 10,
page: 1
}),
_useState2 = slicedToArray_default()(_useState, 2),
bodyParams = _useState2[0],
setBodyParams = _useState2[1];
(0,_react_17_0_2_react.useEffect)(function () {
getData();
}, [params.userId]);
var getData = function getData() {
dispatch({
type: 'messages/unreadMessageInfo',
payload: objectSpread2_default()(objectSpread2_default()({}, bodyParams), params)
});
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: "264px",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: LeftNavmodules.userInfo,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
className: "mt40",
src: env/* default */.Z.IMG_SERVER + '/images/' + (userInfo === null || userInfo === void 0 ? void 0 : userInfo.image_url)
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: "font24 mt10",
children: userInfo === null || userInfo === void 0 ? void 0 : userInfo.username
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: "mt20",
children: userInfo === null || userInfo === void 0 ? void 0 : userInfo.user_identity
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", {
className: LeftNavmodules.navInfo,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
to: "/messages/".concat(userInfo === null || userInfo === void 0 ? void 0 : userInfo.login, "/user_tidings"),
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
className: location.pathname.indexOf("user_tidings") > -1 && LeftNavmodules.actived,
children: ["\u6D88\u606F", !!(unreadInfo !== null && unreadInfo !== void 0 && unreadInfo.unread_tiding_count) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: LeftNavmodules.newTip,
children: unreadInfo === null || unreadInfo === void 0 ? void 0 : unreadInfo.unread_tiding_count
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
to: "/messages/".concat(userInfo === null || userInfo === void 0 ? void 0 : userInfo.login, "/private_messages"),
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
className: (location.pathname.indexOf("private_messages") > -1 || location.pathname.indexOf("message_detail") > -1) && LeftNavmodules.actived,
children: ["\u79C1\u4FE1", !!(unreadInfo !== null && unreadInfo !== void 0 && unreadInfo.unread_message_count) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: LeftNavmodules.newTip,
children: unreadInfo === null || unreadInfo === void 0 ? void 0 : unreadInfo.unread_message_count
})]
})
})]
})]
});
};
/* harmony default export */ var LeftNav = ((0,_umi_production_exports.connect)(function (_ref2) {
var messages = _ref2.messages,
loading = _ref2.loading,
user = _ref2.user,
globalSetting = _ref2.globalSetting;
return {
messages: messages,
globalSetting: globalSetting,
user: user,
loading: loading.effects
};
})(ShixunsListPage));
/***/ }),
/***/ 89206:
/*!*****************************!*\
!*** ./src/utils/marked.ts ***!
\*****************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ AL: function() { return /* binding */ resetMathExpressions; },
/* harmony export */ Iy: function() { return /* binding */ cleanToc; },
/* harmony export */ Qv: function() { return /* binding */ getTocContent; },
/* harmony export */ ez: function() { return /* binding */ getMathExpressions; },
/* harmony export */ jb: function() { return /* binding */ lines; }
/* harmony export */ });
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js */ 79800);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var marked__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! marked */ 32834);
/* harmony import */ var marked__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(marked__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var marked_src_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! marked/src/helpers */ 11690);
/* harmony import */ var marked_src_helpers__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(marked_src_helpers__WEBPACK_IMPORTED_MODULE_2__);
function indentCodeCompensation(raw, text) {
var matchIndentToCode = raw.match(/^(\s+)(?:```)/);
if (matchIndentToCode === null) {
return text;
}
var indentToCode = matchIndentToCode[1];
return text.split('\n').map(function (node) {
var matchIndentInNode = node.match(/^\s+/);
if (matchIndentInNode === null) {
return node;
}
var _matchIndentInNode = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0___default()(matchIndentInNode, 1),
indentInNode = _matchIndentInNode[0];
if (indentInNode.length >= indentToCode.length) {
return node.slice(indentToCode.length);
}
return node;
}).join('\n');
}
//兼容之前的 ##标题式写法
var toc = [];
var ctx = ["<ul>"];
var renderer = new (marked__WEBPACK_IMPORTED_MODULE_1___default().Renderer)();
var headingRegex = /^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;
function cleanToc() {
toc.length = 0;
ctx = ["<ul>"];
}
var lines = {
overflow: "hidden",
WebkitBoxOrient: "vertical",
display: "-webkit-box",
WebkitLineClamp: 2
};
function buildToc(coll, k, level, ctx) {
if (k >= coll.length || coll[k].level <= level) {
return k;
}
var node = coll[k];
ctx.push("<li><a href='#" + node.anchor + "'>" + node.text + "</a>");
k++;
var childCtx = [];
k = buildToc(coll, k, node.level, childCtx);
if (childCtx.length > 0) {
ctx.push("<ul>");
childCtx.forEach(function (idm) {
ctx.push(idm);
});
ctx.push("</ul>");
}
ctx.push("</li>");
k = buildToc(coll, k, level, ctx);
return k;
}
function getTocContent() {
buildToc(toc, 0, 0, ctx);
ctx.push("</ul>");
return ctx.join("");
}
var tokenizer = {
heading: function heading(src) {
var cap = headingRegex.exec(src);
if (cap) {
return {
type: 'heading',
raw: cap[0],
depth: cap[1].length,
text: cap[2]
};
}
},
fences: function fences(src) {
var cap = this.rules.block.fences.exec(src);
if (cap) {
var raw = cap[0];
var text = indentCodeCompensation(raw, cap[3] || '');
var lang = cap[2] ? cap[2].trim() : cap[2];
if (['latex', 'katex', 'math'].indexOf(lang) >= 0) {
var id = next_id();
var expression = text;
text = id;
math_expressions[id] = {
type: 'block',
expression: expression
};
}
return {
type: 'code',
raw: raw,
lang: lang,
text: text
};
}
}
};
var latexRegex = /(?:\${2})([^\n`]+?)(?:\${2})/gi;
var katex_count = 0;
var next_id = function next_id() {
return "__special_katext_id_".concat(katex_count++, "__");
};
var math_expressions = {};
function getMathExpressions() {
return math_expressions;
}
function resetMathExpressions() {
katex_count = 0;
math_expressions = {};
}
function replace_math_with_ids(text) {
text = text.replace(latexRegex, function (_match, expression) {
var id = next_id();
math_expressions[id] = {
type: 'inline',
expression: expression
};
return id;
});
return text;
}
var original_listitem = renderer.listitem;
renderer.listitem = function (text) {
return original_listitem(replace_math_with_ids(text));
};
var original_paragraph = renderer.paragraph;
renderer.paragraph = function (text) {
return original_paragraph(replace_math_with_ids(text));
};
var original_tablecell = renderer.tablecell;
renderer.tablecell = function (content, flags) {
return original_tablecell(replace_math_with_ids(content), flags);
};
renderer.code = function (code, infostring, escaped) {
var lang = (infostring || '').match(/\S*/)[0];
if (!lang) {
return '<pre class="prettyprint linenums"><code>' + (escaped ? code : (0,marked_src_helpers__WEBPACK_IMPORTED_MODULE_2__.escape)(code, true)) + '</code></pre>';
}
if (['latex', 'katex', 'math'].indexOf(lang) >= 0) {
return "<p class='editormd-tex'>".concat(code, "</p>");
} else {
return "<pre class=\"prettyprint linenums\"><code class=\"language-".concat(infostring, "\">").concat(escaped ? code : (0,marked_src_helpers__WEBPACK_IMPORTED_MODULE_2__.escape)(code, true), "</code></pre>\n");
}
};
renderer.heading = function (text, level, raw) {
var anchor = this.options.headerPrefix + raw.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g, '-');
toc.push({
anchor: anchor,
level: level,
text: text
});
return '<h' + level + ' id="' + anchor + '">' + text + '</h' + level + '>';
};
marked__WEBPACK_IMPORTED_MODULE_1___default().setOptions({
silent: true,
gfm: true,
pedantic: false
});
marked__WEBPACK_IMPORTED_MODULE_1___default().use({
tokenizer: tokenizer,
renderer: renderer
});
/* harmony default export */ __webpack_exports__.ZP = ((marked__WEBPACK_IMPORTED_MODULE_1___default()));
/***/ }),
/***/ 28103:
/*!***********************************************************************!*\
!*** ./node_modules/_antd@5.9.0@antd/es/divider/index.js + 1 modules ***!
\***********************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ divider; }
});
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
var _classnames_2_5_1_classnames = __webpack_require__(92310);
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
var context = __webpack_require__(36355);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/style/index.js
var style = __webpack_require__(87832);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/genComponentStyleHook.js
var genComponentStyleHook = __webpack_require__(83116);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/statistic.js
var statistic = __webpack_require__(37613);
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/divider/style/index.js
// ============================== Shared ==============================
const genSharedDividerStyle = token => {
const {
componentCls,
sizePaddingEdgeHorizontal,
colorSplit,
lineWidth,
textPaddingInline,
orientationMargin,
verticalMarginInline
} = token;
return {
[componentCls]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
borderBlockStart: `${lineWidth}px solid ${colorSplit}`,
// vertical
'&-vertical': {
position: 'relative',
top: '-0.06em',
display: 'inline-block',
height: '0.9em',
marginInline: verticalMarginInline,
marginBlock: 0,
verticalAlign: 'middle',
borderTop: 0,
borderInlineStart: `${lineWidth}px solid ${colorSplit}`
},
'&-horizontal': {
display: 'flex',
clear: 'both',
width: '100%',
minWidth: '100%',
margin: `${token.dividerHorizontalGutterMargin}px 0`
},
[`&-horizontal${componentCls}-with-text`]: {
display: 'flex',
alignItems: 'center',
margin: `${token.dividerHorizontalWithTextGutterMargin}px 0`,
color: token.colorTextHeading,
fontWeight: 500,
fontSize: token.fontSizeLG,
whiteSpace: 'nowrap',
textAlign: 'center',
borderBlockStart: `0 ${colorSplit}`,
'&::before, &::after': {
position: 'relative',
width: '50%',
borderBlockStart: `${lineWidth}px solid transparent`,
// Chrome not accept `inherit` in `border-top`
borderBlockStartColor: 'inherit',
borderBlockEnd: 0,
transform: 'translateY(50%)',
content: "''"
}
},
[`&-horizontal${componentCls}-with-text-left`]: {
'&::before': {
width: `${orientationMargin * 100}%`
},
'&::after': {
width: `${100 - orientationMargin * 100}%`
}
},
[`&-horizontal${componentCls}-with-text-right`]: {
'&::before': {
width: `${100 - orientationMargin * 100}%`
},
'&::after': {
width: `${orientationMargin * 100}%`
}
},
[`${componentCls}-inner-text`]: {
display: 'inline-block',
paddingBlock: 0,
paddingInline: textPaddingInline
},
'&-dashed': {
background: 'none',
borderColor: colorSplit,
borderStyle: 'dashed',
borderWidth: `${lineWidth}px 0 0`
},
[`&-horizontal${componentCls}-with-text${componentCls}-dashed`]: {
'&::before, &::after': {
borderStyle: 'dashed none none'
}
},
[`&-vertical${componentCls}-dashed`]: {
borderInlineStartWidth: lineWidth,
borderInlineEnd: 0,
borderBlockStart: 0,
borderBlockEnd: 0
},
[`&-plain${componentCls}-with-text`]: {
color: token.colorText,
fontWeight: 'normal',
fontSize: token.fontSize
},
[`&-horizontal${componentCls}-with-text-left${componentCls}-no-default-orientation-margin-left`]: {
'&::before': {
width: 0
},
'&::after': {
width: '100%'
},
[`${componentCls}-inner-text`]: {
paddingInlineStart: sizePaddingEdgeHorizontal
}
},
[`&-horizontal${componentCls}-with-text-right${componentCls}-no-default-orientation-margin-right`]: {
'&::before': {
width: '100%'
},
'&::after': {
width: 0
},
[`${componentCls}-inner-text`]: {
paddingInlineEnd: sizePaddingEdgeHorizontal
}
}
})
};
};
// ============================== Export ==============================
/* harmony default export */ var divider_style = ((0,genComponentStyleHook/* default */.Z)('Divider', token => {
const dividerToken = (0,statistic/* merge */.TS)(token, {
dividerHorizontalWithTextGutterMargin: token.margin,
dividerHorizontalGutterMargin: token.marginLG,
sizePaddingEdgeHorizontal: 0
});
return [genSharedDividerStyle(dividerToken)];
}, token => ({
textPaddingInline: '1em',
orientationMargin: 0.05,
verticalMarginInline: token.marginXS
})));
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/divider/index.js
"use client";
var __rest = undefined && undefined.__rest || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
const Divider = props => {
const {
getPrefixCls,
direction,
divider
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
const {
prefixCls: customizePrefixCls,
type = 'horizontal',
orientation = 'center',
orientationMargin,
className,
rootClassName,
children,
dashed,
plain,
style
} = props,
restProps = __rest(props, ["prefixCls", "type", "orientation", "orientationMargin", "className", "rootClassName", "children", "dashed", "plain", "style"]);
const prefixCls = getPrefixCls('divider', customizePrefixCls);
const [wrapSSR, hashId] = divider_style(prefixCls);
const orientationPrefix = orientation.length > 0 ? `-${orientation}` : orientation;
const hasChildren = !!children;
const hasCustomMarginLeft = orientation === 'left' && orientationMargin != null;
const hasCustomMarginRight = orientation === 'right' && orientationMargin != null;
const classString = _classnames_2_5_1_classnames_default()(prefixCls, divider === null || divider === void 0 ? void 0 : divider.className, hashId, `${prefixCls}-${type}`, {
[`${prefixCls}-with-text`]: hasChildren,
[`${prefixCls}-with-text${orientationPrefix}`]: hasChildren,
[`${prefixCls}-dashed`]: !!dashed,
[`${prefixCls}-plain`]: !!plain,
[`${prefixCls}-rtl`]: direction === 'rtl',
[`${prefixCls}-no-default-orientation-margin-left`]: hasCustomMarginLeft,
[`${prefixCls}-no-default-orientation-margin-right`]: hasCustomMarginRight
}, className, rootClassName);
const memoizedOrientationMargin = _react_17_0_2_react.useMemo(() => {
if (typeof orientationMargin === 'number') {
return orientationMargin;
}
if (/^\d+$/.test(orientationMargin)) {
return Number(orientationMargin);
}
return orientationMargin;
}, [orientationMargin]);
const innerStyle = Object.assign(Object.assign({}, hasCustomMarginLeft && {
marginLeft: memoizedOrientationMargin
}), hasCustomMarginRight && {
marginRight: memoizedOrientationMargin
});
// Warning children not work in vertical mode
if (false) {}
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("div", Object.assign({
className: classString,
style: Object.assign(Object.assign({}, divider === null || divider === void 0 ? void 0 : divider.style), style)
}, restProps, {
role: "separator"
}), children && type !== 'vertical' && /*#__PURE__*/_react_17_0_2_react.createElement("span", {
className: `${prefixCls}-inner-text`,
style: innerStyle
}, children)));
};
if (false) {}
/* harmony default export */ var divider = (Divider);
/***/ }),
/***/ 44000:
/*!**********************************************************!*\
!*** ./node_modules/_antd@5.9.0@antd/es/layout/index.js ***!
\**********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./layout */ 84966);
/* harmony import */ var _Sider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Sider */ 44678);
"use client";
const Layout = _layout__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP;
Layout.Header = _layout__WEBPACK_IMPORTED_MODULE_0__/* .Header */ .h4;
Layout.Footer = _layout__WEBPACK_IMPORTED_MODULE_0__/* .Footer */ .$_;
Layout.Content = _layout__WEBPACK_IMPORTED_MODULE_0__/* .Content */ .VY;
Layout.Sider = _Sider__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z;
/* harmony default export */ __webpack_exports__.Z = (Layout);
/***/ })
}]);