From 1550b0cd9bb2d2c3453884ab7e4dbf5b1d1af60f Mon Sep 17 00:00:00 2001 From: autosubmit Date: Fri, 17 May 2024 20:54:14 +0800 Subject: [PATCH] Auto Submit --- p__Paperlibrary__See__index.chunk.css | 2 +- p__Problems__OjForm__NewEdit__index.async.js | 2 +- p__Problemset__NewItem__index.async.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/p__Paperlibrary__See__index.chunk.css b/p__Paperlibrary__See__index.chunk.css index 0fbfd58711..f6b43af80e 100644 --- a/p__Paperlibrary__See__index.chunk.css +++ b/p__Paperlibrary__See__index.chunk.css @@ -1 +1 @@ -.wrp___dq7YK{align-items:center;display:flex;height:100%;justify-content:center;left:0;position:fixed;top:0;width:100%;z-index:108}.wrp___dq7YK.bgBlack___ARIUV{background:rgba(0,0,0,.5)}.wrp___dq7YK img,.wrp___dq7YK video{max-height:80%;max-width:100%;text-align:center}.wrp___dq7YK iframe{background:#fff;border:none;left:0;top:0}.monaco___VnZC3,.wrp___dq7YK iframe{height:100%;position:absolute;width:100%}.darkBlue___UprA9 *{font-size:14px}.darkBlue___UprA9 [class~=margin],.darkBlue___UprA9 [class~=monaco-editor-background]{background:#0a0e2d!important}.darkBlue___UprA9 [class~=line-numbers]{color:#fff!important}.close___LKoWu{display:flex;position:absolute;right:40px;top:40px;z-index:10}.close___LKoWu>span{align-items:center;background:#4a4a4a;border-radius:4px;color:#fff;cursor:pointer;display:flex;height:40px;justify-content:center;margin-left:10px;width:40px}.embed___hvpEJ{height:100%;left:0;position:absolute;top:0;width:100%}.my-diff-editor div,.my-monaco-editor div{font-size:inherit}.my-error-line-wrp{background:rgba(245,0,0,.2)!important;color:#f50000;height:auto!important;width:calc(100% - 20px)!important}.noCopyPaste .quick-input-widget{display:none!important}.breakpoints-select{background:red}.breakpoints-fake,.breakpoints-select{border-radius:4px;height:8px!important;left:7px!important;pointer-events:none;top:7px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:8px!important}.breakpoints-fake{background:rgba(255,0,0,.5)}.highlighted-line{background:#4b4b18}.flexRow____Sm4b{display:flex;flex-direction:row}.flexColumn___mQNZs{display:flex;flex-direction:column}.action___QUVEn{display:flex;flex-direction:row;justify-content:flex-end;margin-right:2px;margin-top:25px}.setScore___yZ0Yb{background:#33bd8c;margin-right:27px}.delete___e4taL,.setScore___yZ0Yb{border-radius:4px 4px 0 0;color:#fff;cursor:pointer;font-size:12px;height:40px;line-height:40px;text-align:center;width:100px}.delete___e4taL{background:#0152d9}.content___jR4Y6{background:#fff;margin-bottom:20px;min-height:114px;padding:20px 20px 0}.titleWrap___zsXYY{align-items:center;display:flex;flex-direction:row}.titleNumber___p60vi{color:#333;margin:0}.score___DbCHw,.titleNumber___p60vi{font-size:14px;font-weight:700;line-height:28px}.score___DbCHw{color:#888;flex-shrink:0;margin-right:5px;min-width:auto;word-break:break-word}.titleHtml___FALbj{color:#333;line-height:28px}.answerWrap___uPjYq{color:#333;display:flex;flex-direction:column;font-size:14px;line-height:19px}.answer___pfiPk{word-break:break-word}.answerText___K3TNr{font-size:14px!important;font-weight:600}.lists___xhHyq{padding-bottom:10px}.lists___xhHyq code{background:none!important}.lists___xhHyq>div>div:first-child{align-items:center;background:#f6f6f6;cursor:pointer;display:flex;flex-direction:column;font-size:12px;justify-content:center;padding:10px 0}.lists___xhHyq>div>div:first-child [class^=katex]{font-size:22px}.item___pWJAA{position:relative}.item___pWJAA:nth-last-child(-n+3) .children___sDG61{left:auto;right:5px}.item___pWJAA:hover{z-index:2147483648}.item___pWJAA:hover .children___sDG61{display:block}.children___sDG61{background:#fff;border:1px solid #ccc;border-radius:4px;box-shadow:0 0 6px #ccc;display:none;left:6px;max-height:400px;overflow:auto;padding:15px;position:absolute;top:70px;width:440px}.children___sDG61 h1{font-size:14px;padding-top:6px}.children___sDG61 .diamond___FwgzD>div{align-items:center;background:#f6f6f6;cursor:pointer;display:flex;flex-direction:column;font-size:12px;height:50px;justify-content:center;min-width:80px;padding:0 10px}.children___sDG61 .diamond___FwgzD>div [class^=katex]{font-size:14px}.button___WPN6r{bottom:20px;position:absolute;right:20px}.mathWrap___FmnMJ{height:550px;width:800px}.mathFillWrap___PmY3H{cursor:pointer}.mathFillWrap___PmY3H ::part(menu-toggle){color:blue;display:none;opacity:1}.mathFillWrap___PmY3H math-field{background:none}.mathFillWrap___PmY3H *{pointer-events:none}.bg___vBzoO{margin:0 auto;padding-bottom:140px;width:1200px}.bg___vBzoO div[class~=ant-breadcrumb]{font-size:14px}.wrap___rrSkg{background:#fff;border-radius:2px;box-shadow:0 6px 8px 0 rgba(0,0,0,.03);margin-top:20px;padding:0 20px;position:relative}.btnWrapper___F_tyj{align-items:center;color:#333;display:flex;flex-direction:row;font-size:19px;height:27px;justify-content:center;line-height:27px;margin-top:16px;position:relative}.btnWrapper___F_tyj .btn___ToWSe{background:rgba(248,249,252,.5);border:1px solid rgba(195,207,224,.5);color:#464f66;margin-right:20px}.titleForExport___lhBnq{color:#333;font-size:22px;font-weight:700;margin-bottom:8px;text-align:center}.flexRow___cvXQo{display:flex;flex-direction:row}.flexColumn___cTDFf{display:flex;flex-direction:column}.flexJustifyBetween___vy_7r{justify-content:space-between}.relative____B_F8{position:relative}.questionNumber___V4g28{color:#888;font-size:14px;line-height:34px}.score___dNKpj{color:#333;font-size:14px;line-height:34px;margin-left:60px}.selectTopicButton___NO9DO{background:#33bd8c;border-radius:4px;color:#fff;cursor:pointer;height:34px;line-height:34px;text-align:center;width:106px}.line___j553x{background:#eee;height:1px;margin:20px 0}.dragTip___AaESI{color:#888;font-size:12px}.typeActive___dLHVW{align-items:center;display:flex;flex-direction:row;margin-top:10px}.mouseTypeActive___N_Yv8{background:#f9f9f9;border:1px solid #ddd;margin-top:50px;min-height:42px;width:1020px}.typeName___bdcw3{color:#333;font-size:14px}.typeNumber___B6Fic{color:#888;font-size:14px;margin-left:15px}.typeAction___O3dpz{position:absolute;right:2px;top:-39px}.setScore___GA5cK{background:#33bd8c;margin-right:27px}.delete___O2OvN,.setScore___GA5cK{border-radius:4px 4px 0 0;color:#fff;cursor:pointer;font-size:12px;height:40px;line-height:40px;text-align:center;width:100px}.delete___O2OvN{background:#0152d9}.modal___0ENtb{align-items:center;display:flex;flex-direction:row;font-size:14px;justify-content:center}.table___ZRr4b a{color:rgba(0,0,0,.85)}.glassSeal___C7Vpa{border-bottom:2px dashed #fb3226;font-size:16px;left:-470px;position:absolute;top:520px;transform:rotate(-90deg);width:1000px}.glassSeal___C7Vpa>span{padding-left:10px;padding-right:50px}.glassSeal___C7Vpa>span:first-child{margin-left:100px}.export_type_modal___ldAtg{display:flex;flex-wrap:wrap;justify-content:right;margin-top:10px}.export_type_modal___ldAtg .export_type_modal_con___Y9iST{display:flex;justify-content:center;width:100%}.export_type_modal___ldAtg .export_type_modal_con___Y9iST .type_item___cWirW{align-items:center;display:flex;flex-wrap:wrap;height:120px;justify-content:center;margin:0 20px;width:120px}.export_type_modal___ldAtg .export_type_modal_con___Y9iST .img_warp___G7xtB{border:1px solid #d9d9d9;border-radius:8px;box-shadow:0 2px 0 rgba(0,0,0,.02);cursor:pointer;margin-bottom:3px;padding:15px}.export_type_modal___ldAtg .export_type_modal_con___Y9iST .img_warp___G7xtB:hover{background-color:#fafafa}.export_type_modal___ldAtg .export_type_modal_con___Y9iST .img_warp_active___rw33a{background-color:#fafafa;border-color:#5784de}.flex_box_center___LsrKL{box-align:center;align-items:center;justify-content:center;-webkit-justify-content:center}.flex_space_between___sZBht{-webkit-box-pack:justify;justify-content:space-between}.flex_box_vertical_center___QNt7D{box-align:center;align-items:center}.flex_box_center_end___S9zs3{-webkit-box-align:center;-webkit-box-pack:end;box-align:center;box-pack:end;align-items:center;-webkit-align-items:center;justify-content:flex-end;-webkit-justify-content:flex-end}.flex_box_column___Y5tcm{box-orient:block-axis;flex-direction:column}.title___t4qlt{align-items:center;color:#333;display:flex;font-size:14px;text-align:left}.title___t4qlt img{height:14px;margin-right:5px;position:relative;width:14px}.tip___MtKbx{color:#6bb3dc;display:flex;font-size:14px;margin-bottom:15px;margin-left:20px;text-align:left}.radioWrap___fp3kY{cursor:default;margin-bottom:20px}.radioWrap___fp3kY .row___IoDN5 td{border-bottom:0}.radioWrap___fp3kY .row___IoDN5.row___IoDN5:nth-child(odd){background-color:#f5f5f5}.radioWrap___fp3kY .row___IoDN5.row___IoDN5:nth-child(2n){background-color:#fff}.radio___vuEDI{display:block;height:30px;line-height:30px}.radio___vuEDI span{font-size:14px}.colorFF0000____5DYm{color:red}.pagination___bvqCI{margin:10px auto 0}.modalColumn___szBPb{font-size:14px}.modalColumn___szBPb .modalRow___mtd9M{align-items:center;display:flex;flex-direction:row;font-size:14px;margin-top:12px}.modalColumn___szBPb .modalRow___mtd9M .sup___JDuYL{color:#fb3226;font-size:16px;margin-right:2px;margin-top:21px}.search___wNY_F{height:46px}.search___wNY_F span[class~=ant-input-wrapper] input{height:46px!important}.search___wNY_F span[class~=ant-input-group-addon] button{height:46px!important}.bottom___HvFhF .yes___xmznh{background:#3061d0;border-radius:2px;box-shadow:0 2px 4px 0 #e0dfe1,inset 0 1px 3px 0 hsla(0,0%,100%,.5);color:#fff;font-weight:400;height:32px;width:60px}.bottom___HvFhF .yes___xmznh:hover{background:#3061d0;border-radius:2px;box-shadow:0 2px 4px 0 #e0dfe1,inset 0 1px 3px 0 hsla(0,0%,100%,.5);color:#fff;font-weight:400;height:32px;width:60px}.bottom___HvFhF .no___vEJlu{background:#f8f9fc;border:1px solid #c3cfe0;border-radius:2px;color:#464f66;font-weight:400;height:32px;line-height:14px;margin-right:20px;opacity:.5;width:60px}.bottom___HvFhF .no___vEJlu:hover{background:#f8f9fc;border:1px solid #c3cfe0;border-radius:2px;color:#464f66;font-weight:400;height:32px;line-height:14px;margin-right:20px;opacity:.5;width:60px}.sendToClass___le_BX{align-items:center;display:flex;flex-direction:column}.sendToClass___le_BX img{margin-top:24px}.sendToClass___le_BX div{color:#999;margin-bottom:20px;margin-top:-32px}.sendToClass___le_BX button{border-radius:4px;font-size:14px;height:32px;margin-bottom:10px;width:100px}.brief___LOzpE{font-size:14px;font-weight:400;margin-bottom:30px}.contentTitle___xkdcN{align-items:center;color:#000;display:flex}.contentTitle___xkdcN,.content___Vtri0{font-size:14px;font-weight:400}.tips___tuAtH{color:#6b758b;font-size:12px;font-weight:400;padding-left:14px}.antdTable___s8T2N{margin-bottom:20px;margin-top:10px}.antdTable___s8T2N thead[class~=ant-table-thead]>tr>th{background:#f2f2f2;color:#5f6367}.antdTable___s8T2N .tableCell___kN9Fw{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.antdModal___WVBk3 div[class~=ant-modal-header]{padding-left:40px;padding-top:30px}.antdModal___WVBk3 button[class~=ant-modal-close]{right:10px;top:18px}.antdModal___WVBk3 button[class~=ant-modal-close] span[class~=ant-modal-close-x]{font-size:18px}.antdModal___WVBk3 div[class~=ant-modal-body]{max-height:620px;overflow:auto;padding-left:40px;padding-right:40px}.antdModal___WVBk3 div[class~=ant-modal-footer]{border-top:none;padding-bottom:30px;padding-right:40px}.orangeColor___ryB2u{color:#fe6300} \ No newline at end of file +.wrp___dq7YK{align-items:center;display:flex;height:100%;justify-content:center;left:0;position:fixed;top:0;width:100%;z-index:108}.wrp___dq7YK.bgBlack___ARIUV{background:rgba(0,0,0,.5)}.wrp___dq7YK img,.wrp___dq7YK video{max-height:80%;max-width:100%;text-align:center}.wrp___dq7YK iframe{background:#fff;border:none;left:0;top:0}.monaco___VnZC3,.wrp___dq7YK iframe{height:100%;position:absolute;width:100%}.darkBlue___UprA9 *{font-size:14px}.darkBlue___UprA9 [class~=margin],.darkBlue___UprA9 [class~=monaco-editor-background]{background:#0a0e2d!important}.darkBlue___UprA9 [class~=line-numbers]{color:#fff!important}.close___LKoWu{display:flex;position:absolute;right:40px;top:40px;z-index:10}.close___LKoWu>span{align-items:center;background:#4a4a4a;border-radius:4px;color:#fff;cursor:pointer;display:flex;height:40px;justify-content:center;margin-left:10px;width:40px}.embed___hvpEJ{height:100%;left:0;position:absolute;top:0;width:100%}.my-diff-editor div,.my-monaco-editor div{font-size:inherit}.my-error-line-wrp{background:rgba(245,0,0,.2)!important;color:#f50000;height:auto!important;width:calc(100% - 20px)!important}.noCopyPaste .quick-input-widget{display:none!important}.breakpoints-select{background:red}.breakpoints-fake,.breakpoints-select{border-radius:4px;height:8px!important;left:7px!important;pointer-events:none;top:7px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:8px!important}.breakpoints-fake{background:rgba(255,0,0,.5)}.highlighted-line{background:#4b4b18}.flexRow____Sm4b{display:flex;flex-direction:row}.flexColumn___mQNZs{display:flex;flex-direction:column}.action___QUVEn{display:flex;flex-direction:row;justify-content:flex-end;margin-right:2px;margin-top:25px}.setScore___yZ0Yb{background:#33bd8c;margin-right:27px}.delete___e4taL,.setScore___yZ0Yb{border-radius:4px 4px 0 0;color:#fff;cursor:pointer;font-size:12px;height:40px;line-height:40px;text-align:center;width:100px}.delete___e4taL{background:#0152d9}.content___jR4Y6{background:#fff;margin-bottom:20px;min-height:114px;padding:20px 20px 0}.titleWrap___zsXYY{align-items:center;display:flex;flex-direction:row}.titleNumber___p60vi{color:#333;margin:0}.score___DbCHw,.titleNumber___p60vi{font-size:14px;font-weight:700;line-height:28px}.score___DbCHw{color:#888;flex-shrink:0;margin-right:5px;min-width:auto;word-break:break-word}.titleHtml___FALbj{color:#333;line-height:28px}.answerWrap___uPjYq{color:#333;display:flex;flex-direction:column;font-size:14px;line-height:19px}.answer___pfiPk{word-break:break-word}.answerText___K3TNr{font-size:14px!important;font-weight:600}.lists___xhHyq{padding-bottom:10px}.lists___xhHyq code{background:none!important}.lists___xhHyq>div>div:first-child{align-items:center;background:#f6f6f6;cursor:pointer;display:flex;flex-direction:column;font-size:12px;justify-content:center;padding:10px 0}.lists___xhHyq>div>div:first-child [class^=katex]{font-size:22px}.item___pWJAA{position:relative}.item___pWJAA:nth-last-child(-n+3) .children___sDG61{left:auto;right:5px}.item___pWJAA:hover{z-index:2147483648}.item___pWJAA:hover .children___sDG61{display:block}.children___sDG61{background:#fff;border:1px solid #ccc;border-radius:4px;box-shadow:0 0 6px #ccc;display:none;left:6px;max-height:400px;overflow:auto;padding:15px;position:absolute;top:70px;width:440px}.children___sDG61 h1{font-size:14px;padding-top:6px}.children___sDG61 .diamond___FwgzD>div{align-items:center;background:#f6f6f6;cursor:pointer;display:flex;flex-direction:column;font-size:12px;height:50px;justify-content:center;min-width:80px;padding:0 10px}.children___sDG61 .diamond___FwgzD>div [class^=katex]{font-size:14px}.button___WPN6r{bottom:20px;position:absolute;right:20px}.mathWrap___FmnMJ{height:550px;width:800px}.mathFillWrap___PmY3H{cursor:pointer}.mathFillWrap___PmY3H ::part(menu-toggle){color:blue;display:none;opacity:1}.mathFillWrap___PmY3H math-field{background:none}.mathFillWrap___PmY3H *{pointer-events:none}.bg___vBzoO{margin:0 auto;padding-bottom:140px;width:1200px}.bg___vBzoO div[class~=ant-breadcrumb]{font-size:14px}.wrap___rrSkg{background:#fff;border-radius:2px;box-shadow:0 6px 8px 0 rgba(0,0,0,.03);margin-top:20px;padding:0 20px;position:relative}.btnWrapper___F_tyj{align-items:center;color:#333;display:flex;flex-direction:row;font-size:19px;height:27px;justify-content:center;line-height:27px;position:relative}.btnWrapper___F_tyj .btn___ToWSe{background:rgba(248,249,252,.5);border:1px solid rgba(195,207,224,.5);color:#464f66;margin-right:20px}.titleForExport___lhBnq{color:#333;font-size:22px;font-weight:700;margin-bottom:8px;text-align:center}.flexRow___cvXQo{display:flex;flex-direction:row}.flexColumn___cTDFf{display:flex;flex-direction:column}.flexJustifyBetween___vy_7r{justify-content:space-between}.relative____B_F8{position:relative}.questionNumber___V4g28{color:#888;font-size:14px;line-height:34px}.score___dNKpj{color:#333;font-size:14px;line-height:34px;margin-left:60px}.selectTopicButton___NO9DO{background:#33bd8c;border-radius:4px;color:#fff;cursor:pointer;height:34px;line-height:34px;text-align:center;width:106px}.line___j553x{background:#eee;height:1px;margin:20px 0}.dragTip___AaESI{color:#888;font-size:12px}.typeActive___dLHVW{align-items:center;display:flex;flex-direction:row;margin-top:10px}.mouseTypeActive___N_Yv8{background:#f9f9f9;border:1px solid #ddd;margin-top:50px;min-height:42px;width:1020px}.typeName___bdcw3{color:#333;font-size:14px}.typeNumber___B6Fic{color:#888;font-size:14px;margin-left:15px}.typeAction___O3dpz{position:absolute;right:2px;top:-39px}.setScore___GA5cK{background:#33bd8c;margin-right:27px}.delete___O2OvN,.setScore___GA5cK{border-radius:4px 4px 0 0;color:#fff;cursor:pointer;font-size:12px;height:40px;line-height:40px;text-align:center;width:100px}.delete___O2OvN{background:#0152d9}.modal___0ENtb{align-items:center;display:flex;flex-direction:row;font-size:14px;justify-content:center}.table___ZRr4b a{color:rgba(0,0,0,.85)}.glassSeal___C7Vpa{border-bottom:2px dashed #fb3226;font-size:16px;left:-470px;position:absolute;top:520px;transform:rotate(-90deg);width:1000px}.glassSeal___C7Vpa>span{padding-left:10px;padding-right:50px}.glassSeal___C7Vpa>span:first-child{margin-left:100px}.export_type_modal___ldAtg{display:flex;flex-wrap:wrap;justify-content:right;margin-top:10px}.export_type_modal___ldAtg .export_type_modal_con___Y9iST{display:flex;justify-content:center;width:100%}.export_type_modal___ldAtg .export_type_modal_con___Y9iST .type_item___cWirW{align-items:center;display:flex;flex-wrap:wrap;height:120px;justify-content:center;margin:0 20px;width:120px}.export_type_modal___ldAtg .export_type_modal_con___Y9iST .img_warp___G7xtB{border:1px solid #d9d9d9;border-radius:8px;box-shadow:0 2px 0 rgba(0,0,0,.02);cursor:pointer;margin-bottom:3px;padding:15px}.export_type_modal___ldAtg .export_type_modal_con___Y9iST .img_warp___G7xtB:hover{background-color:#fafafa}.export_type_modal___ldAtg .export_type_modal_con___Y9iST .img_warp_active___rw33a{background-color:#fafafa;border-color:#5784de}.flex_box_center___LsrKL{box-align:center;align-items:center;justify-content:center;-webkit-justify-content:center}.flex_space_between___sZBht{-webkit-box-pack:justify;justify-content:space-between}.flex_box_vertical_center___QNt7D{box-align:center;align-items:center}.flex_box_center_end___S9zs3{-webkit-box-align:center;-webkit-box-pack:end;box-align:center;box-pack:end;align-items:center;-webkit-align-items:center;justify-content:flex-end;-webkit-justify-content:flex-end}.flex_box_column___Y5tcm{box-orient:block-axis;flex-direction:column}.title___t4qlt{align-items:center;color:#333;display:flex;font-size:14px;text-align:left}.title___t4qlt img{height:14px;margin-right:5px;position:relative;width:14px}.tip___MtKbx{color:#6bb3dc;display:flex;font-size:14px;margin-bottom:15px;margin-left:20px;text-align:left}.radioWrap___fp3kY{cursor:default;margin-bottom:20px}.radioWrap___fp3kY .row___IoDN5 td{border-bottom:0}.radioWrap___fp3kY .row___IoDN5.row___IoDN5:nth-child(odd){background-color:#f5f5f5}.radioWrap___fp3kY .row___IoDN5.row___IoDN5:nth-child(2n){background-color:#fff}.radio___vuEDI{display:block;height:30px;line-height:30px}.radio___vuEDI span{font-size:14px}.colorFF0000____5DYm{color:red}.pagination___bvqCI{margin:10px auto 0}.modalColumn___szBPb{font-size:14px}.modalColumn___szBPb .modalRow___mtd9M{align-items:center;display:flex;flex-direction:row;font-size:14px;margin-top:12px}.modalColumn___szBPb .modalRow___mtd9M .sup___JDuYL{color:#fb3226;font-size:16px;margin-right:2px;margin-top:21px}.search___wNY_F{height:46px}.search___wNY_F span[class~=ant-input-wrapper] input{height:46px!important}.search___wNY_F span[class~=ant-input-group-addon] button{height:46px!important}.bottom___HvFhF .yes___xmznh{background:#3061d0;border-radius:2px;box-shadow:0 2px 4px 0 #e0dfe1,inset 0 1px 3px 0 hsla(0,0%,100%,.5);color:#fff;font-weight:400;height:32px;width:60px}.bottom___HvFhF .yes___xmznh:hover{background:#3061d0;border-radius:2px;box-shadow:0 2px 4px 0 #e0dfe1,inset 0 1px 3px 0 hsla(0,0%,100%,.5);color:#fff;font-weight:400;height:32px;width:60px}.bottom___HvFhF .no___vEJlu{background:#f8f9fc;border:1px solid #c3cfe0;border-radius:2px;color:#464f66;font-weight:400;height:32px;line-height:14px;margin-right:20px;opacity:.5;width:60px}.bottom___HvFhF .no___vEJlu:hover{background:#f8f9fc;border:1px solid #c3cfe0;border-radius:2px;color:#464f66;font-weight:400;height:32px;line-height:14px;margin-right:20px;opacity:.5;width:60px}.sendToClass___le_BX{align-items:center;display:flex;flex-direction:column}.sendToClass___le_BX img{margin-top:24px}.sendToClass___le_BX div{color:#999;margin-bottom:20px;margin-top:-32px}.sendToClass___le_BX button{border-radius:4px;font-size:14px;height:32px;margin-bottom:10px;width:100px}.brief___LOzpE{font-size:14px;font-weight:400;margin-bottom:30px}.contentTitle___xkdcN{align-items:center;color:#000;display:flex}.contentTitle___xkdcN,.content___Vtri0{font-size:14px;font-weight:400}.tips___tuAtH{color:#6b758b;font-size:12px;font-weight:400;padding-left:14px}.antdTable___s8T2N{margin-bottom:20px;margin-top:10px}.antdTable___s8T2N thead[class~=ant-table-thead]>tr>th{background:#f2f2f2;color:#5f6367}.antdTable___s8T2N .tableCell___kN9Fw{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.antdModal___WVBk3 div[class~=ant-modal-header]{padding-left:40px;padding-top:30px}.antdModal___WVBk3 button[class~=ant-modal-close]{right:10px;top:18px}.antdModal___WVBk3 button[class~=ant-modal-close] span[class~=ant-modal-close-x]{font-size:18px}.antdModal___WVBk3 div[class~=ant-modal-body]{max-height:620px;overflow:auto;padding-left:40px;padding-right:40px}.antdModal___WVBk3 div[class~=ant-modal-footer]{border-top:none;padding-bottom:30px;padding-right:40px}.orangeColor___ryB2u{color:#fe6300} \ No newline at end of file diff --git a/p__Problems__OjForm__NewEdit__index.async.js b/p__Problems__OjForm__NewEdit__index.async.js index f86e4c1b20..e612fee875 100644 --- a/p__Problems__OjForm__NewEdit__index.async.js +++ b/p__Problems__OjForm__NewEdit__index.async.js @@ -1 +1 @@ -(self.webpackChunk=self.webpackChunk||[]).push([[34741,4977,4633],{78091:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var i=n(1565),a=n(59301),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"minus-circle",theme:"outlined"},r=n(68475),s=function(e,t){return a.createElement(r.Z,(0,i.Z)({},e,{ref:t,icon:o}))};var l=a.forwardRef(s)},57703:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var i=n(1565),a=n(59301),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"plus-circle",theme:"outlined"},r=n(68475),s=function(e,t){return a.createElement(r.Z,(0,i.Z)({},e,{ref:t,icon:o}))};var l=a.forwardRef(s)},35575:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,_typeof=__webpack_require__(31468).default;(function(){if("function"!=typeof window.GGBApplet){var isRenderGGBElementEnabled=!1,scriptLoadStarted=!1,html5AppletsToProcess=null,ggbHTML5LoadedCodebaseIsWebSimple=!1,ggbHTML5LoadedCodebaseVersion=null,ggbHTML5LoadedScript=null,GGBApplet=function(){"use strict";for(var e={},t="5.0",n={},i=null,a=!1,o=!1,r=null,s=!1,l=null,c=null,d=0;d4?parseFloat(e):5};function _(){try{return window.self!==window.top}catch(e){return!0}}function k(){return(!n.hasOwnProperty("screenshotGenerator")||!n.screenshotGenerator)&&Math.max(screen.width,screen.height)<800}e.setHTML5Codebase=function(e,t){c=e,G(e,t)},e.setJavaCodebase=e.setJavaCodebaseVersion=e.isCompiledInstalled=e.setPreCompiledScriptPath=e.setPreCompiledResourcePath=function(){},e.setHTML5CodebaseVersion=function(e,t){var n=parseFloat(e);NaN!==n&&n<5?console.log("The GeoGebra HTML5 codebase version "+n+" is deprecated. Using version latest instead."):(l=e,Z(e,t))},e.getHTML5CodebaseVersion=function(){return m},e.getParameters=function(){return n},e.setFontsCSSURL=function(e){y=e},e.setGiacJSURL=function(e){},e.setJNLPFile=function(e){e},e.setJNLPBaseDir=function(e){},e.inject=function(){function t(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var i,a="auto",o=n.id,r=!1,l=0;l=5)return!0;var t=e.getAppletObject();return!(!t||"function"!=typeof t.recalculateEnvironments)&&(t.recalculateEnvironments(),!0)},e.startAnimation=function(){var t=e.getAppletObject();return!(!t||"function"!=typeof t.startAnimation)&&(t.startAnimation(),!0)},e.stopAnimation=function(){var t=e.getAppletObject();return!(!t||"function"!=typeof t.stopAnimation)&&(t.stopAnimation(),!0)},e.getAppletObject=function(){var e=void 0!==n.id?n.id:"ggbApplet";return window[e]},e.resize=function(){};var A=function(e){return e&&"false"!==e},T=function(t,n,i){x(m)<=4.2&&(i=!0);var a=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==m||ggbHTML5LoadedCodebaseIsWebSimple&&!v)&&(a=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var o=document.createElement("div");o.classList.add("appletParameters","notranslate");var r=n.width,s=n.height;if(n.disableAutoScale=void 0===n.disableAutoScale?GGBAppletUtils.isFlexibleWorksheetEditor():n.disableAutoScale,void 0!==n.width)if(x(m)<=4.4)A(n.showToolBar)&&(n.height-=7),A(n.showAlgebraInput)&&(n.height-=37),n.width<605&&A(n.showToolBar)&&(n.width=605,r=605);else{var d=100;(A(n.showToolBar)||A(n.showMenuBar))&&(n.hasOwnProperty("customToolBar")&&(n.customToolbar=n.customToolBar),d=A(n.showMenuBar)?245:155),r=5?(n.appletOnLoad=function(e){var n=t.querySelector(".ggb_preview");n&&n.parentNode.removeChild(n),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(w),window.GGBT_wsf_view&&$(window).trigger("resize"),h(e)},b||w.appendChild(_)):o.appendChild(_),w.appendChild(o),b||t.appendChild(w),setTimeout((function(){e.resize()}),1)}function k(e,t){t&&"function"==typeof t.appletOnLoad&&"function"==typeof renderGGBElement?renderGGBElement(e,t.appletOnLoad):renderGGBElement(e),D("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",t)}function C(e,t){"undefined"==typeof renderGGBElement?(null===html5AppletsToProcess&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:e,params:t}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,null!==html5AppletsToProcess&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach((function(e){k(e.article,e.params)})),html5AppletsToProcess=null)},x(m)<5&&(e.className+=" geogebraweb")):k(e,t)}if(a){scriptLoadStarted=!0;for(var j=0;j0?(a.remove(),s.attr("id","fullscreencontent").show(),jQuery(o).append(s),window.dispatchEvent(new Event("resize"))):T(a,t,!1),window.GGBT_wsf_view.launchFullScreen(o)}else f=i,T(e,t,!1);if(!window.GGBT_wsf_view)for(r=0;re/4*3&&(s=e/4*3),l=s/5.8,r.setAttribute("src",b),r.setAttribute("width",s),r.setAttribute("height",l);var d=(e-s)/2,u=(t-l)/2;r.style.left=d+"px",r.style.top=u+"px",a.appendChild(r)}return a.appendChild(c),a},L=function(e){return"html5"===(e=e.toLowerCase())||"screenshot"===e?e:"html5"},M=["web","webSimple","web3d","tablet","tablet3d","phone"],Z=function(e,t){if(m=e,t)G(m,!0);else{var o,r,s=!a;if(s){var l=x(m);!isNaN(l)&&l<4.4&&(s=!1)}o="http"===window.location.protocol.substr(0,4)?window.location.protocol:"http:";var c=m.indexOf("//");for(var d in r=c>0?m:0===c?o+m:"https://www.geogebra.org/apps/5.2.814.0/",M)if(m.slice(-1*M[d].length)===M[d]||m.slice(-1*(M[d].length+1))===M[d]+"/")return void G(r,!1);GGBAppletUtils.isFlexibleWorksheetEditor()||!s||i.is3D||i.AV||i.SV||i.CV||i.EV2||i.CP||i.PC||i.DA||i.FI||i.PV||A(n.showToolBar)||A(n.showMenuBar)||A(n.showAlgebraInput)||A(n.enableRightClick)||n.appName&&"classic"!=n.appName?r+="web3d/":r+="webSimple/",G(r,!1)}},G=function(e,t){if(e.requirejs)p=e;else{"/"!==e.slice(-1)&&(e+="/"),p=e,null===t&&(t=-1===e.indexOf("http")),h=t,g="web.nocache.js",v=!1;var n=p.split("/");n.length>1&&(t||"webSimple"!==n[n.length-2]?M.indexOf(n[n.length-2])>=0&&(g=n[n.length-2]+".nocache.js"):(g="webSimple.nocache.js",v=!0)),n=e.split("/"),"test"===(m=n[n.length-3]).substr(0,4)?m=m.substr(4,1)+"."+m.substr(5,1):"war"!==m.substr(0,3)&&"beta"!==m.substr(0,4)||(m="5.0");var i=parseFloat(m);NaN!==i&&i<5&&e.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+i+" is deprecated. Using version latest instead."),Z("5.0",t))}},D=function(e,t){window.console&&window.console.log&&(!t||void 0===t.showLogging||t.showLogging&&"false"!==t.showLogging)&&console.log(e)};function F(){var e=t;null!==l?e=l:parseFloat(e)<5&&(e="5.0"),Z(e,!1),null!==c&&G(c,h),s=!0}return void 0!==n.material_id?C(F):F(),e},GGBAppletUtils=function(){"use strict";function e(){return void 0!==window.GGBT_wsf_edit}function t(e,t){1!=t?(e.style.transformOrigin="0% 0% 0px",e.style.webkitTransformOrigin="0% 0% 0px",e.style.transform="scale("+t+","+t+")",e.style.webkitTransform="scale("+t+","+t+")",e.style.maxWidth="initial",null!==e.querySelector(".ggb_preview")&&(e.querySelector(".ggb_preview").style.maxWidth="initial"),void 0!==e.querySelectorAll(".ggb_preview img")[0]&&(e.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),void 0!==e.querySelectorAll(".ggb_preview img")[1]&&(e.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(e.style.transform="none",e.style.webkitTransform="none")}function n(e,t,n,i,a){if(e.isScreenshoGenerator)return 1;var o,r=void 0!==i&&i,s=null!=e.noScaleMargin&&e.noScaleMargin,l=(o=e.autoHeight)&&"false"!==o,c=function(e,t,n,i,a,o){var r=null;if(null!=o&&""!=o)for(var s=e.parentNode;null!=s;){if((" "+s.className+" ").indexOf(" "+o+" ")>-1){r=s;break}s=s.parentNode}var l=0,c=0,d=0,u=0,p=0,h=0,f=0;if(r)l=r.offsetWidth,c=Math.max(i?r.offsetWidth:0,r.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(l=Math.min(window.innerWidth,document.documentElement.clientWidth),c=Math.min(window.innerHeight,document.documentElement.clientHeight),d=l):(l=window.innerWidth,c=window.innerHeight,d=window.innerWidth),e){var m=e.getBoundingClientRect();m.left>0&&m.left<=l&&(void 0===a||!a)&&("rtl"===document.dir?(p=l-m.width-m.left,h=d<=480?10:30):(h=m.left,p=d<=480?10:30),u=h+p)}e&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(e.getBoundingClientRect(),"closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(u=40,f=0):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(u=0,f=40))}return e&&((void 0===n||!n)&&t>0&&t+u1&&(r=!0)),t&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(r=!0),e.hasOwnProperty("disableAutoScale")&&e.disableAutoScale?o:(a=n(e,t,r,i,e.scaleContainerClass),!r||e.hasOwnProperty("scale")&&1!==o?Math.min(o,a):a)}function a(e){var t=Math.min(window.innerWidth,document.documentElement.clientWidth),n=Math.min(window.innerHeight,document.documentElement.clientHeight),i=e.getBoundingClientRect(),a=(t-i.width)/2,o=(n-i.height)/2;o<0&&(o=0),e.style.position="relative","closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(e.style.left=a<40?"40px":a+"px",e.style.top=o+"px"):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(e.style.top=o<40?"40px":o+"px",e.style.left=a+"px")}return{responsiveResize:function(n,o){var r=n.querySelector(".appletParameters");if(r){if("object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()){if(o.id!==r.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(n)}if(r.parentElement&&/fullscreen/.test(r.parentElement.className))return;var s=i(o,n);e()&&r.setAttribute("data-param-scale",s);for(var l=null,c=0;c=O)continue;if(j==jb){if(k=i.getAttribute(kb),k){var l,m=k.indexOf(lb);m>=O?(j=k.substring(O,m),l=k.substring(m+P)):(j=k,l=W),c[j]=l}}else if(j==mb){if(k=i.getAttribute(kb),k)try{d=eval(k)}catch(e){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(e){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(e){var t=c[e];return null==t?null:t},r=d,webModule.__errFn=e}function B(){function e(e){var t=e.lastIndexOf(rb);-1==t&&(t=e.length);var n=e.indexOf(sb);-1==n&&(n=e.length);var i=e.lastIndexOf(tb,Math.min(n,t));return i>=O?e.substring(O,i+P):W}var t,n=null!=(t=__gwt_getMetaProperty(wb))?t:W;return n==W&&(n=function(){for(var t=o.getElementsByTagName(_),n=O;nO?e[e.length-P].href:W}()),n==W&&function(){var e=o.location;return e.href==e.protocol+zb+e.host+e.pathname+e.search+e.hash}()&&(n=e(o.location.href)),n=function(t){if(t.match(/^\w+:\/\//));else{var n=o.createElement(ub);n.src=t+vb,t=e(n.src)}return t}(n),n}function C(e){return e.match(/^\//)||e.match(/^[a-zA-Z]+:\/\//)?e:webModule.__moduleBase+e}function D(){var e,t=O,i=[],a=[];function o(e){var t=a[e](),n=i[e];if(t in n)return t;var o=[];for(var s in n)o[n[s]]=s;throw r&&r(e,o,t),null}if(__gwt_isKnownPropertyValue=function(e,t){return t in i[e]},webModule.__getPropMap=function(){var e={};for(var t in i)i.hasOwnProperty(t)&&(e[t]=o(t));return e},webModule.__computePropValue=o,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);try{var s=(e=Cb).indexOf(Db);-1!=s&&(t=parseInt(e.substring(s+P),$),e=e.substring(O,s))}catch(e){}return webModule.__softPermutationId=t,C(e+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}s[L]={moduleName:L},webModule.__moduleStartupDone=function(e){var t=s[L].bindings;s[L].bindings=function(){for(var n=t?t():{},i=e[webModule.__softPermutationId],a=O;a0){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"",n=[],i=0;i0&&(0,w.jsx)("div",{id:i||"",children:(0,w.jsx)(p.Z,a()({showLine:{showLeafIcon:!1},showIcon:!0,treeData:c,className:h,onSelect:n,onExpand:function(e,t){b((function(e){return _(e,t.node.key,t.expanded)}))}},k))})}},87359:function(e,t,n){"use strict";n.d(t,{Z:function(){return y}});var i=n(7557),a=n.n(i),o=n(41498),r=n.n(o),s=n(79800),l=n.n(s),c=n(59301),d="imageDimensions___a7crR",u="img___Kroat",p="fullWidth___c492T",h=n(92310),f=n.n(h),m=n(71418),g=n(2859),v=n(90694),w=n(41282),b=n(37712),y=function(e){var t=e.data,n=e.className,i=e.fullWidth,o=e.style,s=void 0===o?{}:o,h=e.onClose,y=e.onOk,x=e.showFullTools,_=e.noAssociationId,k=(0,c.useRef)(null),C=(0,c.useRef)(null),j=(0,c.useState)(!1),S=l()(j,2),A=S[0],T=S[1],B=(0,c.useState)("正在加载中"),N=l()(B,2),P=N[0],E=N[1];(0,c.useEffect)((function(){null!=t&&t.visible?document.body.setAttribute("data-custom","y-hidden"):document.body.removeAttribute("data-custom"),null!=t&&t.src&&I()}),[null==t?void 0:t.visible]);var I=function(){var e=r()(a()().mark((function e(){var n;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T(!0),E("正在加载中"),e.next=4,(0,w.ZJ)(null==t?void 0:t.src);case 4:n=e.sent,k.current.src="",k.current.src=n,k.current.onload=function(){M()},T(!1),E("");case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),L=function(){var e=r()(a()().mark((function e(n){var i;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T(!0),E("正在保存中"),e.next=4,(0,v.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:t.title,file:n.dataUrl}});case 4:if(null==(i=e.sent)||!i.id||_){e.next=12;break}return e.next=8,(0,v.ZP)("/api/attachments/".concat(t.id,"/add_subitem.json"),{method:"post",body:{subitem_id:null==i?void 0:i.id,settings:JSON.stringify(n.state)}});case 8:0===e.sent.status&&y(),e.next=13;break;case 12:null!=i&&i.id&&y(i);case 13:T(!1),E("");case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),M=function(){C.current=new g.hP(k.current),C.current.addEventListener("render",L),C.current.addEventListener("beforeclose",h),x&&(C.current.availableMarkerTypes=C.current.ALL_MARKER_TYPES,C.current.uiStyleSettings.redoButtonVisible=!0,C.current.uiStyleSettings.notesButtonVisible=!0,C.current.uiStyleSettings.zoomButtonVisible=!0,C.current.uiStyleSettings.zoomOutButtonVisible=!0,C.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=C.current.uiStyleSettings,C.current.show(),null!=t&&t.snapshotData&&C.current.restoreState(t.snapshotData),setTimeout((function(){var e;(e=document.querySelector('a[href="https://markerjs.com/"]'))&&e.parentNode&&(e.parentNode.style.display="none"),[{name:'[data-action="select"]',title:"选择"},{name:'[data-action="delete"]',title:"删除元素"},{name:'[data-action="undo"]',title:"撤销"},{name:'[data-type-name="FrameMarker"]',title:"矩形"},{name:'[data-type-name="FreehandMarker"]',title:"画线"},{name:'[data-type-name="ArrowMarker"]',title:"箭头"},{name:'[data-type-name="TextMarker"]',title:"文本"},{name:'[data-type-name="EllipseMarker"]',title:"椭圆"},{name:'[data-type-name="HighlightMarker"]',title:"方块"},{name:'[data-type-name="CalloutMarker"]',title:"注释"},{name:'[data-action="render"]',title:"保存"},{name:'[data-action="close"]',title:"退出"}].forEach((function(e){var t=document.querySelector(e.name);t&&t.setAttribute("title",e.title)}))}),300)};return(0,b.jsx)(c.Fragment,{children:(null==t?void 0:t.visible)&&(0,b.jsxs)("div",{className:f()(d,n,i?p:""),style:s,children:[(0,b.jsx)(m.Z,{spinning:A,tip:P,style:{position:"absolute"}}),(0,b.jsx)("img",{className:u,ref:k})]})})}},43941:function(e,t,n){"use strict";n.d(t,{N:function(){return B}});var i=n(7557),a=n.n(i),o=n(41498),r=n.n(o),s=n(37205),l=n.n(s),c=n(79800),d=n.n(c),u=n(59301),p=n(57809),h=n(43418),f=n(98135),m=n(8591),g=n(95237),v=n(43604),w=n(90694),b="wrap___F7E3F",y="selectWrapper____kESB",x="tips___aHjQY",_="linkBtn___uggVr",k="public_tips___sZVWd",C="inputCss___t66EO",j="bt___lXptu",S=n(88289),A=n(37712),T=p.default.Option,B=function(e){var t=e.subId,n=e.value,i=e.selectvalues,o=e.disabled,s=e.knowledgeOptions,c=void 0===s?[]:s,B=e.onChange,N=void 0===B?function(){}:B,P=e.onAddKnowledgeFinish,E=void 0===P?function(){}:P,I=(0,u.useRef)(),L=(0,u.useState)([]),M=d()(L,2),Z=M[0],G=M[1];n=n||[];(0,u.useEffect)((function(){(null==i?void 0:i.length)>0?(G(l()(i)),N(l()(i))):(G([]),N([]))}),[c]),(0,u.useEffect)((function(){var e;(null===(e=n)||void 0===e?void 0:e.length)>0&&N(l()(n))}),[c]);return(0,A.jsxs)(g.Z,{wrap:!1,align:"middle",className:b,children:[(0,A.jsx)(v.Z,{children:(0,A.jsx)(p.default,{mode:"multiple",disabled:!t||o,className:y,placeholder:"请选择知识点,支持选择多个",onChange:function(e,t){e?(G(l()(t)),N(l()(t))):(G([]),N([]))},style:{width:490},showSearch:!0,allowClear:!0,value:Z,filterOption:function(e,t){return t.label.indexOf(e.toLowerCase())>=0},children:null==c?void 0:c.map((function(e){return(0,A.jsx)(T,{value:e.id,label:e.name,children:(0,A.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,A.jsx)("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:e.name}),"personal"===(null==e?void 0:e.type)&&(0,A.jsx)("div",{style:{marginLeft:"5px",border:"1px solid #24C074",color:"#24C074",padding:"0 4px",borderRadius:"2px",fontSize:"12px",height:"20px",lineHeight:"20px"},children:"自用"})]})},e.id)}))})}),t&&(0,A.jsxs)(v.Z,{className:"ml20",children:[(0,A.jsx)("span",{className:x,children:"没有合适的知识点?"}),(0,A.jsx)("span",{className:_,onClick:function(e){e.preventDefault(),I.current="",h.Z.confirm({centered:!0,width:585,okText:"确定",cancelText:"取消",icon:null,title:"新建知识点",className:"custom-modal-divider",content:(0,A.jsxs)("div",{className:"font14",children:[(0,A.jsxs)("div",{className:k,children:[(0,A.jsx)(S.Z,{style:{color:"#FF8C29",marginRight:10,paddingTop:5}}),"新建的知识点仅本人可见,平台审核列入公开知识点后,对所有用户可见。 平台有权删除不合适的知识点,请认真填写知识点名称。"]}),(0,A.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,A.jsxs)("div",{style:{width:"95px"},children:[(0,A.jsx)("span",{className:j,children:"*"}),"知识点名称"]}),(0,A.jsx)(f.Z,{className:C,style:{width:"calc(100% - 95px)"},maxLength:20,size:"middle",showCount:!0,placeholder:"请输入知识点名称",defaultValue:I.current,onChange:function(e){I.current=e.target.value}})]})]}),onOk:function(){return new Promise(function(){var e=r()(a()().mark((function e(n,o){var r,s;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(I.current){e.next=3;break}return m.ZP.warning("请输入知识点名称"),e.abrupt("return",o());case 3:if(!(I.current.length>20)){e.next=6;break}return m.ZP.warning("请输入不超过20字的知识点名称"),e.abrupt("return",o());case 6:return e.next=8,(0,w.ZP)("/api/tag_disciplines.json",{method:"post",body:{name:I.current,sub_discipline_id:t}});case 8:return 0===(null==(r=e.sent)?void 0:r.status)&&(E({id:r.tag_discipline_id,name:I.current,type:"personal"}),(s=i||[]).push(r.tag_discipline_id),N(l()(s)),G(l()(s)),N(l()(s))),e.abrupt("return",n());case 11:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}())}})},children:"新建知识点"})]})]})}},78716:function(e,t,n){"use strict";n.d(t,{h:function(){return p},x:function(){return h}});var i=n(82242),a=n.n(i),o=n(39647),r=n.n(o),s=n(77162),l=n(26194),c=n(36653),d=n(37712),u=["value","onChange","scrollId"],p=function(e){var t=e.value,n=e.onChange,i=e.scrollId,o=r()(e,u);return(0,d.jsx)("div",{id:i||"",children:(0,d.jsx)(s.Z,a()(a()({},o),{},{defaultValue:t,onChange:function(e,t){console.log("a:",e,t),null!=t&&t.length?n(e,t):n(e)}}))})},h=function(e){var t=e.value,n=e.onChange,i=e.placeholder,a=e.height,o=void 0===a?140:a;return e.isEdit?(0,d.jsx)(s.Z,{watch:!0,isFocus:!0,height:o,placeholder:i,defaultValue:t,onChange:n}):(0,d.jsx)("div",{style:{cursor:"pointer"},children:t?(0,d.jsx)(c.Z,{className:l.Z.inputBorder,value:t}):(0,d.jsx)("div",{className:"".concat(l.Z.inputBorder," ").concat(l.Z.placeholder," inputBorderError"),children:i})})}},71550:function(e,t,n){"use strict";n.d(t,{h:function(){return v}});var i=n(82242),a=n.n(i),o=n(79800),r=n.n(o),s=n(59301),l=n(57809),c=n(78241),d=n(3113),u=n(89780),p=n.n(u),h=(n(49324),n(20615),n(37712)),f=l.default.Option,m={labelCol:{span:4},wrapperCol:{span:20}},g={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};function v(e){var t=e.value,n=e.onChange,i=e.mode,o=e.options,l=void 0===o?{}:o,c=(0,s.useRef)(),d=(0,s.useState)(),u=r()(d,2),f=u[0],m=u[1];return(0,s.useEffect)((function(){if(f){var e=function(e){var t=e.getValue();n&&n(t)};return f.on("change",e),function(){f.off("change",e)}}}),[f,n]),(0,s.useEffect)((function(){f&&f.setOption("mode",i)}),[f,i]),(0,s.useEffect)((function(){f&&(t===f.getValue()&&""!==t||setTimeout((function(){f.setValue(t||"")}),300))}),[f,t]),(0,s.useEffect)((function(){if(c.current&&!f){var e=p().fromTextArea(c.current,a()({mode:i,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},l));m(e)}}),[c.current,f]),(0,h.jsx)("div",{className:"my-codemirror-container",children:(0,h.jsx)("textarea",{ref:c})})}t.Z=function(e){var t=e.callback,n=e.onCancel,i=(0,s.useState)("python"),o=r()(i,2),u=o[0],p=o[1];return(0,h.jsxs)(c.Z,a()(a()({},m),{},{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){t(e)},style:{width:500},children:[(0,h.jsx)(c.Z.Item,{label:"代码语言",name:"language",children:(0,h.jsx)(l.default,{getPopupContainer:function(e){return e.parentNode},onChange:function(e){p(g[e][1])},children:Object.keys(g).map((function(e){return(0,h.jsx)(f,{value:e,children:g[e][0]},e)}))})}),(0,h.jsx)(c.Z.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}],children:(0,h.jsx)(v,{mode:u})}),(0,h.jsxs)("div",{className:"flex-container flex-end",children:[(0,h.jsx)(d.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,h.jsx)(d.ZP,{type:"ghost",onClick:n,children:"取消"})]})]}))}},77162:function(e,t,n){"use strict";n.d(t,{Z:function(){return Ae}});var i=n(91232),a=n.n(i),o=n(79800),r=n.n(o),s=n(85573),l=n.n(s),c=n(59301),d=n(89780),u=n.n(d),p=n(76374),h=(n(49324),n(6313),n(25717),n(99498),n(25419),n(67549),n(36653)),f=n(37712),m=function(e){var t=e.value,n=void 0===t?"":t,i=(e.className,e.showTextOnly,e.showLines,e.style,(0,c.useMemo)((function(){return""}),[n]));return(0,f.jsx)(f.Fragment,{children:(0,f.jsx)("div",{dangerouslySetInnerHTML:{__html:i}})})},g=n(82242),v=n.n(g),w=[{title:"粗体",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"斜体",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"无序列表",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"有序列表",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"行内代码",icon:"md-iconfont icon-code",actionName:"code"},{title:"代码块(多语言风格)",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"链接",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"行内公式",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"数学图像",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"多行公式",icon:"iconfont icon-jisuan1",actionName:"latex"},"|",{title:"添加图片",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"插入画图",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"插入流程图",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"表格",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"换行",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"清空",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function b(e){var t=e.onActionCallback,n=e.title,i=e.icon,a=e.actionName,o=e.className,r=void 0===o?"":o,s=e.children;return(0,f.jsxs)("a",{title:n,className:r,onClick:function(){t(a)},children:[(0,f.jsx)("i",{className:"".concat(i)}),s]})}var y=function(e){var t=e.watch,n=e.showNullButton,i=e.showNullProgramButton,a=e.onActionCallback,o=e.fullScreen,r=e.insertTemp,s=e.hidetoolBar,l=e.extraUse,c=[].concat(w,[{title:"".concat(t?"关闭实时预览":"开启实时预览"),icon:"".concat(t?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"),actionName:"trigger-watch"}]);return(0,f.jsxs)("ul",{className:"markdown-toolbar-container",children:[!s&&c.map((function(e,t){return(0,f.jsx)("li",{children:e.actionName?(0,f.jsx)(b,v()(v()({},e),{},{onActionCallback:a})):(0,f.jsx)("span",{className:"v-line"})},t)})),n?(0,f.jsx)("li",{children:(0,f.jsx)(b,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-null-ch",onActionCallback:a,children:(0,f.jsx)("span",{className:"fill-tip",children:"点击插入\b填空项"})})}):null,i?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("li",{children:(0,f.jsx)(b,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-signal",onActionCallback:a,children:(0,f.jsx)("span",{className:"fill-tip",children:"+单行填空项"})})}),(0,f.jsx)("li",{children:(0,f.jsx)(b,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"增加填空",actionName:"add-multiple",onActionCallback:a,children:(0,f.jsx)("span",{className:"fill-tip",children:"+多行填空项"})})})]}):null,r&&(0,f.jsx)("li",{children:(0,f.jsx)(b,{icon:"md-iconfont icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(r),onActionCallback:a,children:(0,f.jsx)("span",{className:"fill-tip",children:"插入模板"})})}),l&&(0,f.jsx)("li",{children:l}),(0,f.jsx)("li",{className:"btn-full-screen",children:(0,f.jsx)(b,{icon:"".concat(o?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"),title:o?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:a})})]})},x=n(30043),_=n(78241),k=n(98135),C=n(3113),j={labelCol:{span:4},wrapperCol:{span:20}},S=function(e){var t=e.callback,n=e.onCancel;return(0,f.jsxs)(_.Z,v()(v()({},j),{},{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(e){t(e)},style:{width:500},children:[(0,f.jsx)(_.Z.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}],children:(0,f.jsx)(k.Z,{})}),(0,f.jsx)(_.Z.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}],children:(0,f.jsx)(k.Z,{})}),(0,f.jsxs)("div",{className:"flex-container flex-end",children:[(0,f.jsx)(C.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,f.jsx)(C.ZP,{type:"ghost",onClick:n,children:"取消"})]})]}))},A=n(71550),T=n(8591),B=n(53842),N=_.Z.useForm,P={width:280,marginRight:10},E={labelCol:{span:5},wrapperCol:{span:19}},I=function(e){var t=e.callback,n=e.onCancel,i=N(),a=r()(i,1)[0],o=(0,c.useRef)();function s(e,t){-1!==e.status?a.setFieldsValue({src:"/api/attachments/".concat(e.id),type:t.type}):T.ZP.error(e.message)}return(0,f.jsxs)(_.Z,v()(v()({form:a},E),{},{className:"upload-image-panel",onFinish:function(e){t(e,o.current)},style:{width:470,overflow:"hidden"},children:[(0,f.jsx)(_.Z.Item,{label:"图片地址",required:!0,children:(0,f.jsxs)("div",{className:"flex-container",children:[(0,f.jsx)(_.Z.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入图片地址"}],children:(0,f.jsx)(k.Z,{style:P})}),(0,f.jsx)(L,{onFileChange:function(e){var t=e.target.files[0];o.current=t,M(t,s)}})]})}),(0,f.jsx)(_.Z.Item,{label:"图片描述",name:"alt",children:(0,f.jsx)(k.Z,{style:{width:264}})}),(0,f.jsxs)(_.Z.Item,{style:{textAlign:"right"},children:[(0,f.jsx)(C.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,f.jsx)(C.ZP,{type:"default",onClick:n,children:"取消"})]})]}))};function L(e){var t=e.onFileChange;return(0,f.jsxs)("label",{className:"upload-button",style:{cursor:"pointer"},children:["本地上传",(0,f.jsx)("input",{type:"file",onChange:t})]})}function M(e,t){if(!e)throw new String("没有文件");var n=new FormData;n.append("editormd-image-file",e),n.append("file_param_name","editormd-image-file"),n.append("byxhr","true");var i=new window.XMLHttpRequest;i.withCredentials=!0,i.addEventListener("load",(function(n){t(JSON.parse(n.target.responseText),e)}),!1),i.addEventListener("error",(function(e){console.error(e)}),!1),i.open("POST","".concat(B.KI,"/api/attachments.json")),i.send(n)}var Z=n(95237),G=n(87359),D=function(e){var t=e.callback,n=e.onCancel,i=document.createElement("canvas"),a=i.getContext("2d");i.width=1e3,i.height=800,a.fillStyle="#ffffff",a.fillRect(0,0,i.width,i.height);var o=i.toDataURL("image/png");return(0,f.jsx)(Z.Z,{style:{height:"100vh"},children:(0,f.jsx)(G.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:o,visible:!0,title:String(Date.now())},onOk:function(e){t({src:e.url})},onClose:n})})},F=n(7557),R=n.n(F),O=n(41498),z=n.n(O),H=n(37205),W=n.n(H),V=n(12378);function U(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(U,go.CommandHandler),U.prototype.canAlignSelection=function(){var e=this.diagram;return null!==e&&!e.isReadOnly&&!e.isModelReadOnly&&!(e.selection.count<2)},U.prototype.alignLeft=function(){var e=this.diagram;e.startTransaction("aligning left");var t=1/0;e.selection.each((function(e){e instanceof go.Link||(t=Math.min(e.position.x,t))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(t,e.position.y))})),e.commitTransaction("aligning left")},U.prototype.alignRight=function(){var e=this.diagram;e.startTransaction("aligning right");var t=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var n=e.actualBounds.x+e.actualBounds.width;t=Math.max(n,t)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(t-e.actualBounds.width,e.position.y))})),e.commitTransaction("aligning right")},U.prototype.alignTop=function(){var e=this.diagram;e.startTransaction("alignTop");var t=1/0;e.selection.each((function(e){e instanceof go.Link||(t=Math.min(e.position.y,t))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.position.x,t))})),e.commitTransaction("alignTop")},U.prototype.alignBottom=function(){var e=this.diagram;e.startTransaction("aligning bottom");var t=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var n=e.actualBounds.y+e.actualBounds.height;t=Math.max(n,t)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,t-e.actualBounds.height))})),e.commitTransaction("aligning bottom")},U.prototype.alignCenterX=function(){var e=this.diagram,t=e.selection.first();if(t){e.startTransaction("aligning Center X");var n=t.actualBounds.x+t.actualBounds.width/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(n-e.actualBounds.width/2,e.actualBounds.y))})),e.commitTransaction("aligning Center X")}},U.prototype.alignCenterY=function(){var e=this.diagram,t=e.selection.first();if(t){e.startTransaction("aligning Center Y");var n=t.actualBounds.y+t.actualBounds.height/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,n-e.actualBounds.height/2))})),e.commitTransaction("aligning Center Y")}},U.prototype.alignColumn=function(e){var t=this.diagram;t.startTransaction("align Column"),void 0===e&&(e=0),e=parseFloat(e);var n=new Array;t.selection.each((function(e){e instanceof go.Link||n.push(e)}));for(var i=0;i0){for(var i=r.elt(s-1);null!==i&&i.isTreeExpanded&&!i.isTreeLeaf;){i=this._sortTreeChildrenByY(i).last()}null!==i&&e.select(i)}else e.select(o)}else if("Down"===n.key){var a;if(t.isTreeExpanded&&!t.isTreeLeaf)null!==(a=this._sortTreeChildrenByY(t).first())&&e.select(a);else for(;null!==t;){var o,r,s;if(null===(o=t.findTreeParentNode()))break;if((s=(r=this._sortTreeChildrenByY(o)).indexOf(t))i.y?1:n.xi.x?1:0})),t},U.prototype.copyToClipboard=function(e){go.CommandHandler.prototype.copyToClipboard.call(this,e),this._lastPasteOffset.set(this.pasteOffset)},U.prototype.pasteFromClipboard=function(){var e=go.CommandHandler.prototype.pasteFromClipboard.call(this);return this.diagram.moveParts(e,this._lastPasteOffset),this._lastPasteOffset.add(this.pasteOffset),e},Object.defineProperty(U.prototype,"arrowKeyBehavior",{get:function(){return this._arrowKeyBehavior},set:function(e){if("move"!==e&&"select"!==e&&"scroll"!==e&&"tree"!==e&&"none"!==e)throw new Error('DrawCommandHandler.arrowKeyBehavior must be either "move", "select", "scroll", "tree", or "none", not: '+e);this._arrowKeyBehavior=e}}),Object.defineProperty(U.prototype,"pasteOffset",{get:function(){return this._pasteOffset},set:function(e){if(!(e instanceof go.Point))throw new Error("DrawCommandHandler.pasteOffset must be a Point, not: "+e);this._pasteOffset.set(e)}});var K=U,q=(n(79286),n(85160)),Y=n(43418),J=n(43604),Q=n(90694),X="myPaletteDiv___Xjz2I",$="maxH60___Pd4Re";window.go=V;var ee=function(e){var t=e.onCancel,n=e.callback,i=(0,c.useRef)(),a=(0,c.useRef)(),o=(0,c.useRef)(),s=(0,c.useRef)(!1),l=(0,c.useRef)(!1),d=(0,c.useState)(0),u=r()(d,2),p=u[0],h=u[1],m=function(){var e=z()(R()().mark((function e(){var t,a;return R()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.current.makeImage(),e.next=3,(0,Q.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:t.src}});case 3:a=e.sent,n({src:a.url});case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,c.useEffect)((function(){h(p+1)}),[]),(0,f.jsx)("div",{ref:l,className:s.current?"".concat($," body-overflow-initial"):"body-overflow-initial",children:(0,f.jsx)(Y.Z,{width:1200,icon:null,footer:null,closable:!0,visible:!!p,destroyOnClose:!0,maskClosable:!1,getContainer:l.current,rootClassName:"zIndex-9999",title:(0,f.jsxs)(Z.Z,{children:[(0,f.jsx)(J.Z,{flex:1,children:"插入流程图"}),(0,f.jsx)(J.Z,{onClick:function(){s.current=!s.current,h(p+1)},children:(0,f.jsx)("span",{className:"current c-blue mr30",style:{fontWeight:400},children:"展开/收起"})})]}),onCancel:t,children:(0,f.jsxs)("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative"},children:[(0,f.jsxs)("div",{style:{display:"flex",height:"100%"},children:[(0,f.jsxs)("div",{style:{width:"300px",height:"100%"},children:[(0,f.jsx)("div",{style:{background:"#fff",position:"relative",zIndex:12,fontSize:16,color:"#3061d0"},children:"图形库"}),(0,f.jsx)("div",{style:{height:"calc(100% - 50px)"},className:X,ref:o})]}),(0,f.jsxs)("div",{style:{flex:1,position:"relative"},children:[(0,f.jsx)(q.FI,{initDiagram:function(){var e=V.GraphObject.make,t="#ff3333",n="#3358ff",r="#25ad23",s="#d533ff",l="#7d33ff",c="#ff6233",d="#ffffff",u="#000000",p="#fffcd5",h="#d5ebff",f="#f2dfe0",m="#a5d2fa",g="#cccccc",v="#b3e6b3",w="#fcbbbd";function b(t,n){var i=function(e,n){e.handled=!0,e.diagram.model.commit((function(i){var a=n.part.adornedPart,o=(new V.Point).setRectSpot(a.actualBounds,t);o.subtract(a.location),o.scale(2,2),o.x+=130*Math.sign(o.x),o.y+=130*Math.sign(o.y),o.add(a.location),o.snapToGridPoint(e.diagram.grid.gridOrigin,e.diagram.grid.gridCellSize);var r=i.copyNodeData(a.data);i.setGroupKeyForNodeData(r,i.getGroupKeyForNodeData(a.data)),i.addNodeData(r);var s={from:a.key,to:i.getKeyForNodeData(r)};i.addLinkData(s);var l=e.diagram.findNodeForData(r);l.location=o,e.diagram.select(l),setTimeout((function(){e.diagram.commandHandler.editTextBlock()}),20)}))};return e(V.Shape,{figure:n,alignment:t,alignmentFocus:t.opposite(),width:t.equals(V.Spot.Top)||t.equals(V.Spot.Bottom)?25:18,height:t.equals(V.Spot.Top)||t.equals(V.Spot.Bottom)?18:25,fill:"orange",stroke:d,strokeWidth:4,mouseEnter:function(e,t){return t.fill="dodgerblue"},mouseLeave:function(e,t){return t.fill="orange"},isActionable:!0,click:i,contextClick:i})}function y(t){return e(V.Shape,{fill:"orange",stroke:"rgba(0, 0, 0, 0)",strokeWidth:15,background:"transparent",geometryString:"F1 M0 0 b 0 360 -4 0 4 z M10 0 b 0 360 -4 0 4 z M20 0 b 0 360 -4 0 4",isActionable:!0,cursor:"context-menu",mouseEnter:function(e,t){return t.fill="dodgerblue"},mouseLeave:function(e,t){return t.fill="orange"},click:function(e,t){e.diagram.commandHandler.showContextMenu(t.part.adornedPart)}},t||{})}function x(e,t){return function(n,i){n.handled=!0,n.diagram.model.commit((function(n){n.set(i.part.adornedPart.data,e,t)}))}}function _(t,n){return n||(n="color"),e(V.Shape,{width:16,height:16,stroke:"lightgray",fill:t,margin:1,background:"transparent",mouseEnter:function(e,t){return t.stroke="dodgerblue"},mouseLeave:function(e,t){return t.stroke="lightgray"},click:x(n,t),contextClick:x(n,t)})}function k(){return[e("ContextMenuButton",e(V.Panel,"Horizontal",_(d,"fill"),_(p,"fill"),_(h,"fill"),_(f,"fill"))),e("ContextMenuButton",e(V.Panel,"Horizontal",_(g,"fill"),_(v,"fill"),_(m,"fill"),_(w,"fill")))]}function C(){return[e("ContextMenuButton",e(V.Panel,"Horizontal",_(u),_(r),_(n),_(t))),e("ContextMenuButton",e(V.Panel,"Horizontal",_(d),_(s),_(l),_(c)))]}function j(t,n){return n||(n="thickness"),e(V.Shape,"LineH",{width:16,height:16,strokeWidth:t,margin:1,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:x(n,t),contextClick:x(n,t)})}function S(t,n){return n||(n="dash"),e(V.Shape,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:t,margin:1,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:x(n,t),contextClick:x(n,t)})}function A(){return[e("ContextMenuButton",e(V.Panel,"Horizontal",j(1),j(2),j(3),j(4))),e("ContextMenuButton",e(V.Panel,"Horizontal",S(null),S([2,4]),S([4,4])))]}function T(t,n){return n||(n="figure"),e(V.Shape,{width:32,height:32,scale:.5,fill:"lightgray",figure:t,margin:1,background:"transparent",mouseEnter:function(e,t){return t.fill="dodgerblue"},mouseLeave:function(e,t){return t.fill="lightgray"},click:x(n,t),contextClick:x(n,t)})}function B(t){return e(V.Shape,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(t+4).toString()+" H3"})}function N(t){var n="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return 0===t?n="M0 0 M16 16 M0 8 L16 8":2===t&&(n="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),e(V.Shape,{geometryString:n,margin:2,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:x("dir",t),contextClick:x("dir",t)})}function P(t){var n=function(e,n){e.handled=!0,e.diagram.model.commit((function(e){var i=n.part.adornedPart;e.set(i.data,t?"toSpot":"fromSpot",V.Spot.stringify(V.Spot.AllSides)),(t?i.toNode:i.fromNode).invalidateConnectedLinks()}))};return e(V.Shape,{width:12,height:12,fill:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:n,contextClick:n})}function E(t,n){var i=0,a=V.Spot.RightSide;t.equals(V.Spot.Top)?(i=270,a=V.Spot.TopSide):t.equals(V.Spot.Left)?(i=180,a=V.Spot.LeftSide):t.equals(V.Spot.Bottom)&&(i=90,a=V.Spot.BottomSide),n||(i-=180);var o=function(e,t){e.handled=!0,e.diagram.model.commit((function(e){var i=t.part.adornedPart;e.set(i.data,n?"toSpot":"fromSpot",V.Spot.stringify(a)),(n?i.toNode:i.fromNode).invalidateConnectedLinks()}))};return e(V.Shape,{alignment:t,alignmentFocus:t.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:i,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:o,contextClick:o})}return i.current=new V.Diagram(a.current,{padding:20,grid:e(V.Panel,"Grid",e(V.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(V.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),"draggingTool.isGridSnapEnabled":!0,handlesDragDropForTopLevelParts:!0,mouseDrop:function(e){e.diagram.commandHandler.addTopLevelParts(e.diagram.selection,!0)||e.diagram.currentTool.doCancel()},commandHandler:e(K),"clickCreatingTool.archetypeNodeData":{text:"未命名",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:function(e){var t=e.subject;t.location=t.location.copy().snapToGridPoint(e.diagram.grid.gridOrigin,e.diagram.grid.gridCellSize),setTimeout((function(){e.diagram.commandHandler.editTextBlock()}),20)},"commandHandler.archetypeGroupData":{isGroup:!0,text:"NEW GROUP"},SelectionGrouped:function(e){e.subject;setTimeout((function(){e.diagram.commandHandler.editTextBlock()}))},LinkRelinked:function(e){e.parameter.part.invalidateConnectedLinks();var t=e.subject;e.diagram.toolManager.linkingTool.isForwards?t.toNode.invalidateConnectedLinks():t.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),i.current.nodeTemplate=e(V.Node,"Auto",{locationSpot:V.Spot.Center,locationObjectName:"SHAPE",desiredSize:new V.Size(120,60),minSize:new V.Size(40,40),resizable:!0,resizeCellSize:new V.Size(10,10),rotatable:!0},new V.Binding("location","loc",V.Point.parse).makeTwoWay(V.Point.stringify),new V.Binding("desiredSize","size",V.Size.parse).makeTwoWay(V.Size.stringify),e(V.Shape,{name:"SHAPE",fill:d,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:V.Spot.AllSides,toSpot:V.Spot.AllSides},new V.Binding("figure"),new V.Binding("fill"),new V.Binding("stroke","borderColor"),new V.Binding("strokeWidth","thickness"),new V.Binding("strokeDashArray","dash")),e(V.Shape,{width:100,height:20,strokeWidth:0,fill:"transparent"}),e(V.TextBlock,{margin:1,textAlign:"center",overflow:V.TextBlock.OverflowEllipsis,editable:!0},new V.Binding("text").makeTwoWay(),new V.Binding("stroke","color"))),i.current.nodeTemplate.toolTip=e("ToolTip",e(V.Panel,"Vertical",{maxSize:new V.Size(200,NaN)},e(V.TextBlock,{font:"bold 10pt sans-serif",textAlign:"center"},new V.Binding("text")),e(V.TextBlock,{font:"10pt sans-serif",textAlign:"center"},new V.Binding("text","details")))),i.current.nodeTemplate.selectionAdornmentTemplate=e(V.Adornment,"Spot",e(V.Placeholder,{padding:10}),b(V.Spot.Top,"TriangleUp"),b(V.Spot.Left,"TriangleLeft"),b(V.Spot.Right,"TriangleRight"),b(V.Spot.Bottom,"TriangleDown"),y({alignment:new V.Spot(.75,0)})),i.current.nodeTemplate.contextMenu=e("ContextMenu",e("ContextMenuButton",e(V.Panel,"Horizontal",T("Rectangle"),T("RoundedRectangle"),T("Ellipse"),T("Diamond"))),e("ContextMenuButton",e(V.Panel,"Horizontal",T("Parallelogram2"),T("ManualOperation"),T("Procedure"),T("Cylinder1"))),e("ContextMenuButton",e(V.Panel,"Horizontal",T("Terminator"),T("CreateRequest"),T("Document"),T("TriangleDown"))),k(),C(),A()),i.current.groupTemplate=e(V.Group,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:V.Spot.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:function(e,t){t.addMembers(t.diagram.selection,!0)||t.diagram.currentTool.doCancel()},avoidable:!1},new V.Binding("location","loc",V.Point.parse).makeTwoWay(V.Point.stringify),e(V.Panel,"Auto",{name:"BODY"},e(V.Shape,{parameter1:10,fill:d,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:V.Spot.AllSides,toSpot:V.Spot.AllSides},new V.Binding("fill"),new V.Binding("stroke","color"),new V.Binding("strokeWidth","thickness"),new V.Binding("strokeDashArray","dash")),e(V.Placeholder,{background:"transparent",margin:20})),e(V.TextBlock,{alignment:V.Spot.Top,alignmentFocus:V.Spot.Bottom,font:"bold 12pt sans-serif",editable:!0},new V.Binding("text"),new V.Binding("stroke","color"))),i.current.groupTemplate.selectionAdornmentTemplate=e(V.Adornment,"Spot",e(V.Panel,"Auto",e(V.Shape,{fill:null,stroke:"dodgerblue",strokeWidth:3}),e(V.Placeholder,{margin:1.5})),y({alignment:V.Spot.TopRight,alignmentFocus:V.Spot.BottomRight})),i.current.groupTemplate.contextMenu=e("ContextMenu",k(),C(),A()),i.current.linkTemplate=e(V.Link,{layerName:"Foreground",routing:V.Link.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new V.Binding("fromSpot","fromSpot",V.Spot.parse),new V.Binding("toSpot","toSpot",V.Spot.parse),new V.Binding("fromShortLength","dir",(function(e){return e>=1?10:0})),new V.Binding("toShortLength","dir",(function(e){return e>=1?10:0})),new V.Binding("points").makeTwoWay(),e(V.Shape,{strokeWidth:2},new V.Binding("stroke","color"),new V.Binding("strokeWidth","thickness"),new V.Binding("strokeDashArray","dash")),e(V.Shape,{segmentIndex:0,segmentOffset:new V.Point(15,0),segmentOrientation:V.Link.OrientAlong,alignmentFocus:V.Spot.Right,figure:"circle",width:10,strokeWidth:0},new V.Binding("fill","color"),new V.Binding("visible","dir",(function(e){return 1===e}))),e(V.Shape,{segmentIndex:-1,segmentOffset:new V.Point(-10,6),segmentOrientation:V.Link.OrientPlus90,alignmentFocus:V.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new V.Binding("fill","color"),new V.Binding("visible","dir",(function(e){return e>=1})),new V.Binding("width","thickness",(function(e){return 7+3*e})),new V.Binding("height","thickness",(function(e){return 7+3*e})),new V.Binding("segmentOffset","thickness",(function(e){return new V.Point(-15,4+1.5*e)}))),e(V.Shape,{segmentIndex:0,segmentOffset:new V.Point(15,-6),segmentOrientation:V.Link.OrientMinus90,alignmentFocus:V.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new V.Binding("fill","color"),new V.Binding("visible","dir",(function(e){return 2===e})),new V.Binding("width","thickness",(function(e){return 7+3*e})),new V.Binding("height","thickness",(function(e){return 7+3*e})),new V.Binding("segmentOffset","thickness",(function(e){return new V.Point(-15,4+1.5*e)}))),e(V.TextBlock,{alignmentFocus:new V.Spot(0,1,-4,0),editable:!0},new V.Binding("text").makeTwoWay(),new V.Binding("stroke","color"))),i.current.linkTemplate.selectionAdornmentTemplate=e(V.Adornment,e(V.Shape,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:B(2)},new V.Binding("pathPattern","thickness",B)),y({alignmentFocus:new V.Spot(0,0,-6,-4)})),i.current.linkTemplate.contextMenu=e("ContextMenu",C(),A(),e("ContextMenuButton",e(V.Panel,"Horizontal",N(0),N(1),N(2))),e("ContextMenuButton",e(V.Panel,"Horizontal",e(V.Panel,"Spot",P(!1),E(V.Spot.Top,!1),E(V.Spot.Left,!1),E(V.Spot.Right,!1),E(V.Spot.Bottom,!1)),e(V.Panel,"Spot",{margin:new V.Margin(0,0,0,2)},P(!0),E(V.Spot.Top,!0),E(V.Spot.Left,!0),E(V.Spot.Right,!0),E(V.Spot.Bottom,!0))))),new V.Palette(o.current,{maxSelectionCount:1,linkTemplate:e(V.Link,{locationSpot:V.Spot.Center,selectionAdornmentTemplate:e(V.Adornment,"Link",{locationSpot:V.Spot.Center},e(V.Shape,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),e(V.Shape,{toArrow:"Standard",stroke:null}))},{routing:V.Link.AvoidsNodes,curve:V.Link.JumpOver,corner:5,toShortLength:4},new V.Binding("points"),e(V.Shape,{isPanelMain:!0,strokeWidth:2}),e(V.Shape,{toArrow:"Standard",stroke:null})),model:new V.GraphLinksModel([{text:"未命名",size:"100 100",fill:null,stroke:"#000"}].concat(W()(V.Shape.getFigureGenerators().toArray().map((function(e){return{text:"未命名",size:"100 100",figure:e.key,fill:"white",stroke:"#666",borderColor:"#000"}})))))}).nodeTemplate=e(V.Node,"Auto",{locationSpot:V.Spot.Center},new V.Binding("location","location",V.Point.parse).makeTwoWay(V.Point.stringify),e(V.Shape,"Circle",{fill:"white",stroke:"gray",strokeWidth:2,width:20,height:20,portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromLinkableSelfNode:!0,toLinkableSelfNode:!0},new V.Binding("stroke").makeTwoWay(),new V.Binding("fill").makeTwoWay(),new V.Binding("figure")),e(V.TextBlock,{margin:new V.Margin(5,5,3,5),font:"10pt sans-serif",minSize:new V.Size(16,16),maxSize:new V.Size(10,NaN),textAlign:"center",editable:!0},new V.Binding("key").makeTwoWay())),setTimeout((function(){i.current.grid=e(V.Panel,"Grid",e(V.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(V.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),i.current.grid.visible=!0,i.current.grid.gridCellStroke="darkgray",i.current.grid.gridCellStrokeWidth=1}),300),window.myDiagrams=i.current,i.current},divClassName:"diagram-component",style:{height:"80vh"}}),(0,f.jsx)("div",{ref:a})]})]}),(0,f.jsx)("div",{className:"tr",children:(0,f.jsx)(C.ZP,{size:"large",onClick:m,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary",children:"保存到编辑器"})})]})})})},te=n(5112),ne=n(54449),ie=te.ZP.Group,ae={margin:"0 8px"},oe=function(e){var t=e.callback,n=e.onCancel;return(0,f.jsxs)(_.Z,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(e){t(e)},children:[(0,f.jsxs)("div",{className:"flex-container",style:{alignItems:"baseline"},children:[(0,f.jsx)("span",{style:ae,children:"单元格数:"}),(0,f.jsx)("span",{style:ae,children:"行数"}),(0,f.jsx)(_.Z.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}],children:(0,f.jsx)(ne.Z,{})}),(0,f.jsx)("span",{style:ae,children:"列数"}),(0,f.jsx)(_.Z.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}],children:(0,f.jsx)(ne.Z,{})})]}),(0,f.jsxs)("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"},children:[(0,f.jsx)("span",{style:ae,children:"对齐方式:"}),(0,f.jsx)(_.Z.Item,{name:"align",children:(0,f.jsxs)(ie,{children:[(0,f.jsx)(te.ZP,{value:"default",children:(0,f.jsx)("i",{className:"fa fa-align-justify"})}),(0,f.jsx)(te.ZP,{value:"left",children:(0,f.jsx)("i",{className:"fa fa-align-left"})}),(0,f.jsx)(te.ZP,{value:"center",children:(0,f.jsx)("i",{className:"fa fa-align-center"})}),(0,f.jsx)(te.ZP,{value:"right",children:(0,f.jsx)("i",{className:"fa fa-align-right"})})]})})]}),(0,f.jsxs)("div",{className:"flex-container flex-end",children:[(0,f.jsx)(C.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,f.jsx)(C.ZP,{type:"ghost",onClick:n,children:"取消"})]})]})},re=n(78673),se=n(35575),le=n.n(se),ce=(0,c.forwardRef)((function(e,t){var n=e.use3d,i=e.width,a=e.height,o=e.callback,s=(e.showSaveButton,(0,c.useRef)()),l=(0,c.useRef)(),d=(0,c.useState)(!1),u=r()(d,2),p=u[0],h=u[1],m=(0,c.useRef)({id:s,appName:"graphing",width:i||1e3,height:a||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,c.useEffect)((function(){l.current=new(le())(m.current,!0),window.onload=function(){l.current.inject("applet_container")}}),[]);var g=function(){var e=window.ggbApplet.getPNGBase64(1,!0,72);return o&&o(e),e};return(0,c.useEffect)((function(){m.current.appName=p?"3D":"graphing",l.current.inject("applet_container")}),[p]),(0,c.useEffect)((function(){h(n)}),[n]),(0,c.useImperativeHandle)(t,(function(){return{getImgData:g}})),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:s}),(0,f.jsxs)(Z.Z,{align:"middle",children:[(0,f.jsx)(J.Z,{flex:1,children:(0,f.jsx)(re.Z,{size:"default",checkedChildren:"关闭3D图像",unCheckedChildren:"开启3D图像",checked:p,onChange:function(e){return h(e)}})}),(0,f.jsx)(J.Z,{children:(0,f.jsx)(C.ZP,{size:"large",onClick:g,style:{zIndex:8,marginTop:10},type:"primary",children:"保存到编辑器"})})]})]})})),de=n(42594),ue=n(57357),pe="link",he="upload-image",fe="add-flowchart",me="draw-image",ge="code-block",ve="add-table",we="------------",be={default:we,left:":".concat(we),center:":".concat(we,":"),right:"".concat(we,":")},ye=n(40238);var xe="@▁▁@",_e=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"];function ke(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var Ce=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",je=l()(l()({},Ce+"-B","bold"),Ce+"-I","italic"),Se=l()(l()(l()(l()(l()(l()(l()(l()({},pe,"添加链接"),ge,"添加代码块"),he,"添加图片"),me,"添加画图"),fe,"插入流程图"),ve,"添加表格"),"maths-latex","数学图像"),"inline-latex","LATEX公式"),Ae=function(e){var t=e.defaultValue,n=void 0===t?"":t,i=e.onChange,o=e.width,s=void 0===o?"100%":o,d=e.height,g=void 0===d?400:d,v=e.miniToolbar,w=void 0!==v&&v,b=e.isFocus,_=void 0!==b&&b,k=e.watch,C=e.insertTemp,j=e.mode,B=void 0===j?"markdown":j,N=e.id,P=void 0===N?"markdown-editor-id":N,E=e.showResizeBar,L=void 0!==E&&E,Z=e.noStorage,G=void 0!==Z&&Z,F=e.showNullButton,R=void 0!==F&&F,O=e.showNullProgramButton,z=void 0!==O&&O,H=e.hidetoolBar,W=void 0!==H&&H,V=e.fullScreen,U=void 0!==V&&V,K=e.onBlur,q=e.onCMBeforeChange,J=e.onFullScreen,Q=e.className,X=void 0===Q?"":Q,$=e.disablePaste,te=void 0!==$&&$,ne=e.disabled,ie=void 0!==ne&&ne,ae=e.disabledFill,re=void 0!==ae&&ae,se=e.placeholder,le=void 0===se?"":se,we=e.values,Ce=void 0===we?"":we,Ae=e.extraUse,Te=(0,c.useState)(null),Be=r()(Te,2),Ne=Be[0],Pe=Be[1],Ee=(0,c.useState)(n),Ie=r()(Ee,2),Le=Ie[0],Me=Ie[1],Ze=(0,c.useState)(k),Ge=r()(Ze,2),De=Ge[0],Fe=Ge[1],Re=(0,c.useState)(U),Oe=r()(Re,2),ze=Oe[0],He=Oe[1],We=(0,c.useState)(""),Ve=r()(We,2),Ue=Ve[0],Ke=Ve[1],qe=(0,c.useState)(0),Ye=r()(qe,2),Je=Ye[0],Qe=Ye[1],Xe=(0,c.useState)(g),$e=r()(Xe,2),et=$e[0],tt=$e[1],nt=(0,c.useState)(!1),it=r()(nt,2),at=(it[0],it[1]),ot=(0,c.useState)(0),rt=r()(ot,2),st=rt[0],lt=rt[1],ct=(0,c.useState)(0),dt=r()(ct,2),ut=dt[0],pt=dt[1],ht=(0,c.useRef)(),ft=(0,c.useRef)(),mt=(0,c.useRef)(),gt=(0,c.useRef)();(0,c.useEffect)((function(){var e=window.scrollY||window.pageYOffset;Me(Ce),null==Ne||Ne.setValue(Ce),window.scrollTo(0,e)}),[Ce]),(0,c.useEffect)((function(){null==J||J(ze)}),[ze]),(0,c.useEffect)((function(){if(ht.current){var e=function(e,n){if(!te){var i=n.clipboardData;if(i){var a=i.types.toString(),o=i.items;if("Files"===a||i.types.indexOf("Files")>-1){if(n.preventDefault(),"stex"==B)return;try{var r,s=o[1];"file"===(null===(r=o[0])||void 0===r?void 0:r.kind)&&(s=o[0]);var l=s.getAsFile(),c=l.name.split(".").pop();M(l,(function(e){var n,i,a;e.id?(null==l||null===(n=l.type)||void 0===n?void 0:n.indexOf("image"))>-1?t.replaceSelection("![,](/api/attachments/".concat(e.id,"?type=").concat(e.content_type,")")):(null==l||null===(i=l.type)||void 0===i?void 0:i.indexOf("video"))>-1?t.replaceSelection('')):(null==l||null===(a=l.type)||void 0===a?void 0:a.indexOf("pdf"))>-1?t.replaceSelection('').concat(l.name,"")):_e.includes(c)?t.replaceSelection('').concat(l.name,"")):t.replaceSelection("[".concat(l.name,"](").concat(ue.Z.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}))}catch(n){T.ZP.warning("请使用chrome浏览器粘贴")}return!0}return!0}return!0}n.preventDefault()},t=u().fromTextArea(ht.current,{mode:B,lineNumbers:!w,lineWrapping:!0,value:n,autoCloseTags:!0,autoCloseBrackets:!0});return t.on("keyup",(function(e,n){8===n.keyCode&&(""==e.getValue()?t.setOption("placeholder",le):t.setOption("placeholder",null))})),t.on("keydown",(function(e,t){if(8===t.keyCode){var n=function(e,t){var n=e.getDoc(),i=n.getCursor(),a=n.getLine(i.line),o=a.charAt(i.ch-1),r=a.lastIndexOf("@▁@",i.ch),s=a.lastIndexOf("@▁▁@",i.ch),l=r>s?r:s,c=r>s?3:4;if(-1===xe.indexOf(o))return null;if(console.log("change1:",t,e,a,i,l,r,s,o),l>=0&&i.ch-l<5){var d=l+c;return n.replaceRange("",{line:i.line,ch:l},{line:i.line,ch:d}),{line:i.line,ch:d}}return null}(e);n&&t.preventDefault()}})),_&&t.focus(),t.on("paste",e),ie&&t.on("beforeChange",(function(e,t){"paste"!==t.origin&&"+input"!==t.origin||t.cancel()})),Pe(t),function(){t.off("paste",e)}}}),[]);var vt=(0,c.useCallback)((function(){ft.current}),[et,ft,ze]);(0,c.useEffect)((function(){if(Ne){var e=function(){var e=new p.Z((function(e){var t,n=a()(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&(vt(),Ne.setSize("100%","100%"),Ne.refresh())}}catch(e){n.e(e)}finally{n.f()}}));return e.observe(ht.current.parentElement),e}();return function(){var t,n;null!==(t=ht.current)&&void 0!==t&&t.parentElement&&e.unobserve(null===(n=ht.current)||void 0===n?void 0:n.parentElement)}}}),[Ne,vt]),(0,c.useEffect)((function(){if(Ne){for(var e=[],t=function(){var t=r()(i[n],2),a=t[0],o=t[1],s=l()({},a,(function(){wt(o)}));e.push(s),Ne.addKeyMap(s)},n=0,i=Object.entries(je);n0){var e=(new Date).getTime(),t=window.sessionStorage.getItem(P);e>=Je+1e4&&(!t||t!==Le)&&(window.sessionStorage.setItem(P,Le),at(!0))}}),1e4),(0,c.useEffect)((function(){Fe(k)}),[Ne,k]),(0,c.useEffect)((function(){Ne&&_&&Ne.focus()}),[Ne,_]),(0,c.useEffect)((function(){if(De&&Ne){var e=function(e){var t=e.target;if(gt.current){var n=t.scrollTop/t.scrollHeight;gt.current.scrollTop=gt.current.scrollHeight*n}},t=Ne.getScrollerElement();return t.addEventListener("scroll",e),function(){t.removeEventListener("scroll",e)}}}),[Ne,De]),(0,c.useEffect)((function(){if(Ne&&q){var e=function(e,t){q(e,t)};return Ne.on("beforeChange",e),function(){Ne.off("beforeChange",e)}}}),[Ne,q]),(0,c.useEffect)((function(){if(Ne&&K){var e=function(){K(Ne.getValue())};return Ne.on("blur",e),function(){Ne.off("blur",e)}}}),[Ne,K]),(0,c.useEffect)((function(){if(Ne){var e=function(e,t){var n=e.getValue();Me(n),Qe((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),i&&(z?i(n,kt(n)):i(n))};return Ne.on("change",e),function(){Ne.off("change",e)}}}),[Ne,i]),(0,c.useEffect)((function(){if(Ne)if(null==n)Ne.setValue(""),Me("");else{var e=window.scrollY||window.pageYOffset;n!==Ne.getValue()&&(Ne.setValue(n),Me(n),Ne.setCursor(ie?1:Ne.lineCount(),0),window.scrollTo(0,e))}}),[Ne,n]);var wt=(0,c.useCallback)((function(e){var t=Ne.getCursor(),n=Ne.getSelection(),i=n.split("\n");switch(e){case"bold":return Ne.replaceSelection("**"+n+"**"),""===n&&Ne.setCursor(t.line,t.ch+2),Ne.focus();case"italic":return Ne.replaceSelection("*"+n+"*"),""===n&&Ne.setCursor(t.line,t.ch+1),Ne.focus();case"code":return Ne.replaceSelection("`"+n+"`"),""===n&&Ne.setCursor(t.line,t.ch+1),Ne.focus();case"inline-latex":return Ke("inline-latex"),Ne.focus();case"latex":return Ne.replaceSelection("```latex\n"+n+"\n```"),Ne.setCursor(t.line+1,n.length+1),Ne.focus();case"line-break":return Ne.replaceSelection("
\n"),Ne.focus();case"list-ul":return""===n?Ne.replaceSelection("- "+n):Ne.replaceSelection(i.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),Ne.focus();case"list-ol":return""===n?Ne.replaceSelection("1. "+n):Ne.replaceSelection(i.map((function(e,t){return""===e?"":"".concat(t+1,". ").concat(e)})).join("\n")),Ne.focus();case"add-null-ch":return""===n&&Ne.setCursor(t.line,t.ch),Ne.replaceSelection("▁"),Ne.focus();case"add-signal":return""===n&&Ne.setCursor(t.line,t.ch),Ne.replaceSelection("@▁@"),Ne.focus();case"add-multiple":return""===n&&Ne.setCursor(t.line,t.ch),Ne.replaceSelection(xe),Ne.focus();case"inster-template-1":return""===n&&Ne.setCursor(t.line,t.ch),Ne.replaceSelection("\n**模板标题**\n模板正文内容,可输入文本内容和粘贴图片等操作"),Ne.focus();case"eraser":return Ne.setValue(""),Ne.focus();case"trigger-watch":return Fe(!De),Ne.focus();case"trigger-full-screen":return He(!ze),Ne.focus();case pe:return void Ke(pe);case ge:return void Ke(ge);case he:return void Ke(he);case me:return void Ke(me);case"maths-latex":return void Ke("maths-latex");case fe:return void Ke(fe);case ve:return void Ke(ve);default:throw new Error}}),[Ne,De,ze]),bt=(0,c.useCallback)((function(e,t){var n,i,a,o,r;switch(Ke(""),Ue){case pe:var s=e.title,l=e.link;return Ne.replaceSelection("[".concat(s,"](").concat(l,")")),Ne.focus();case ge:var c=e.language,d=e.content;return Ne.replaceSelection(["```"+c,d,"```"].join("\n")),Ne.focus();case"maths-latex":for(var u=atob(e),p=new Uint8Array(u.length),h=0;h-1||null==g||!g.type?m?Ne.replaceSelection("![ ".concat(m," ]( ").concat(f,' "').concat(m,'" )')):Ne.replaceSelection("![,](".concat(f,")")):(null==g||null===(o=g.type)||void 0===o?void 0:o.indexOf("video"))>-1?Ne.replaceSelection('')):(null==g||null===(r=g.type)||void 0===r?void 0:r.indexOf("pdf"))>-1?Ne.replaceSelection('').concat(g.name,"")):_e.includes(v)?Ne.replaceSelection('').concat(g.name,"")):Ne.replaceSelection("[".concat(g.name,"](").concat(ue.Z.API_SERVER).concat(f,")")),Ne.focus();case ve:for(var w=e.row,b=e.col,y=e.align,x="\n",_=0;_300&&(t=300),tt(g+t+"px")}},i=mt.current,a=!1,o=0;return i.addEventListener("mousedown",e),document.addEventListener("mousemove",n),document.addEventListener("mouseup",t),function(){i.removeEventListener("mousedown",e),document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",t)}}}),[Ne,mt]),(0,c.useEffect)((function(){tt(g)}),[g]);var _t={width:ke(s),height:ke(et)},kt=((0,c.useMemo)((function(){if(Je){var e=new Date(Je),t=e.getHours(),n=e.getMinutes(),i=e.getSeconds();return n=n<10?"0"+n:n,i=i<10?"0"+i:i,"".concat(t=t<10?"0"+t:t,":").concat(n,":").concat(i)}return 0}),[Je]),function(e){var t=[];if(z){e=e.replace(/(@▁▁@|@▁@)/g,(function(e,n,i){t.push({multiLine:!("@▁@"===e)})}))}return t});(0,c.useEffect)((function(){if(Se[Ue]&&Ue!==me&&Ue!==fe){var e=document.getElementsByClassName("ant-modal")[0],t=window.innerWidth/2-e.offsetWidth/2,n=window.innerHeight/2-e.offsetHeight/2;lt(t),pt(n)}}),[Ue]);var Ct=function(e,t,n,i){var a=document.body.clientHeight,o=document.body.clientWidth;return!(e<20&&n>e||e>o-20&&nt||t>a-20&&i0&&(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)(K.Z,{className:g.add,onClick:function(e){ye(e),x()}}),(0,ee.jsx)(U.Z,{okText:"确定",cancelText:"取消",title:"确定删除测试集"+(t+1),onCancel:ye,onConfirm:function(e){ye(e),C(t)},children:(0,ee.jsx)(q.Z,{className:"".concat(g.remove," ml20"),onClick:ye})})]})})]})})]}),children:[(0,ee.jsx)(v.Z.Item,{label:"输入",labelCol:{span:24},name:[e.name,"input"],children:(0,ee.jsx)(te,{rows:4})}),(0,ee.jsx)(v.Z.Item,{label:"输出",labelCol:{span:24},name:[e.name,"output"],rules:[{required:!0,message:"请输入输出内容"}],children:(0,ee.jsx)(te,{rows:4})})]},e.key)}))})}}),(0,ee.jsx)("div",{style:{display:me?"block":"none"}}),(0,ee.jsx)(X.ZP,{rootIdentifier:null,visible:we,onClose:function(){return be(!1)},onOK:function(e){if(null!=e&&e.length){if(null!=e&&e[0].is_file){E(e,!0)();var t=A.concat(e);d.test_set_average?B(t):T(t)}null!=e&&e[0].is_file||E(e)}},multiple:!0,defaultMultipleValue:null==d?void 0:d.is_file})]})},ae=n(89392),oe=n(88289);function re(){return(new Date).getTime()}var se={loading:!0,user:null,disciplines:[],dicts:null,status:0,data:void 0,lastedUpdateTime:0},le=function(e){return e[e.SET_INITAL_DATA=0]="SET_INITAL_DATA",e[e.SET_LOADING=1]="SET_LOADING",e[e.SET_STATUS=2]="SET_STATUS",e}({});function ce(e,t){switch(t.type){case le.SET_INITAL_DATA:return f()(f()({},e),t.payload);case le.SET_LOADING:return f()(f()({},e),{},{loading:t.payload});case le.SET_STATUS:return f()(f()({},e),{},{status:t.payload});default:throw new Error}}var de=function(){var e,t,n=(0,C.useSearchParams)(),i=p()(n,1)[0],o=(0,C.useParams)().id,s=v.Z.useForm(),c=p()(s,1)[0],u=(0,m.useState)(),h=p()(u,2),M=h[0],Z=h[1],G=(0,m.useState)([]),D=p()(G,2),F=D[0],R=D[1],O=(0,m.useState)([]),z=p()(O,2),H=z[0],W=z[1],V=(0,m.useReducer)(ce,se),U=p()(V,2),K=U[0],q=U[1],Y=K.loading,J=K.data,Q=K.user,X=K.disciplines,$=K.dicts,te=K.status,ne=null==J?void 0:J.hack_sets,de=null==J||null===(e=J.hack)||void 0===e?void 0:e.test_set_average,ue=(0,P.oP)(),pe=ue.callback_url,he=ue.express_id,fe=ue.score,me=ue.question_id,ge=ue.type,ve=(0,m.useState)([]),we=p()(ve,2),be=we[0],ye=we[1],xe=(0,m.useState)(!1),_e=p()(xe,2),ke=_e[0],Ce=_e[1],je=(0,m.useState)(!1),Se=p()(je,2),Ae=Se[0],Te=Se[1],Be=(0,m.useState)(),Ne=p()(Be,2),Pe=Ne[0],Ee=Ne[1],Ie="1"===ge,Le=(0,m.useMemo)((function(){var e=[];return X&&(0,k.D0)(X,e),e}),[X]),Me=(0,m.useCallback)(d()(l()().mark((function e(){var t,n,i,a,r,s,d,u,h,m,g,v,w,b,y,x,_,C,A,T,B,N,E,I,L,M,G,D,F,R,O,z,H,V,U,K,Y,J,Q,$,ee,te,ne,ie,ae,oe,re,se,ce,de,ue,pe,he,me,ge,ve,we,be,ye,xe,_e,ke=arguments;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=ke.length>0&&void 0!==ke[0]?ke[0]:0,0!==(n=X).length){e.next=7;break}return e.next=5,(0,S.d1)("new_question");case 5:i=e.sent,n=i.disciplines;case 7:if(!o){e.next=15;break}return a={disciplines:n},e.next=11,(0,S.fu)(o);case 11:(r=e.sent).message?"401"===r.status&&(document.location.href="/user/login"):(u=r.category,h=r.user,m=r.code,g=r.language,v=r.hack_sets,w=r.description,b=r.difficult,y=r.name,x=r.open_or_not,_=r.discipline_id,C=r.sub_discipline_id,r.tag_discipline_id,A=r.analysis,T=r.time_limit,B=r.test_set_average,N=r.test_set_score,E=r.status,I=r.tag_discipline_ids,L=r.item_banks_group_id,M=r.is_file,G=void 0!==M&&M,D=r.hide_actual_output,F=r.code_compile_score,R=r.languages,O=r.is_my,z=r.codes,H=r.answer_text,V=r.submit_rule,U=r.show_case,K=(0,k.y3)(n,C),Y=p()(K,2),J=Y[0],Q=Y[1],J=[_,C],$=G?[{input:"",output:"",score:100,position:1}]:v,G?(W(v),c.setFieldsValue({hack_sets:$})):W([]),ee=(0,P.oP)(),te=ee.lastedUpdateTime,ne=null==z?void 0:z.map((function(e){return f()(f()({},e),{},{code:j.Base64.decode(null==e?void 0:e.code)})})),a=f()(f()({},a),{},{loading:!1,user:h,dicts:Q,status:E,lastedUpdateTime:t||(te||0),data:{hack_codes:{language:g,code:j.Base64.decode(m)},hack:{category:u,difficult:b,name:y,description:w,open_or_not:x,time_limit:T,test_set_average:B,test_set_score:N,sub_discipline_id:J,tag_discipline_ids:I,languages:R,score:fe||1,item_banks_group_ids:L,is_file:G,is_my:O,code_compile_score:F,hide_actual_output:D,show_case:U,analysis:A,answer_text:H,submit_rule:V},hack_sets:$,tags:I,codes:ne}}),parseInt(F)>0&&Ce(!0),q({type:le.SET_INITAL_DATA,payload:a}),Z({hack:{category:u,difficult:b,name:y,description:w,open_or_not:x,time_limit:T,test_set_average:B,test_set_score:N,sub_discipline_id:J,tag_discipline_ids:I,score:fe||1,item_banks_group_ids:L,is_file:G,analysis:A,answer_text:H},codes:ne}),Ze(null===(s=J)||void 0===s?void 0:s[0],null===(d=J)||void 0===d?void 0:d[1],n)),e.next=27;break;case 15:return e.next=17,(0,S.PR)();case 17:se=e.sent,ce=se.user,de=(0,P.oP)(),ue=de.discipline_id,pe=de.sub_discipline_id,he=de.tag_discipline_id,me=de.tagIds,ge=de.banksIds,ve=2,we=(0,k.y3)(n,parseInt(pe,10)),be=p()(we,2),ye=be[0],xe=be[1],ye=[ue,pe],_e=[Number(ge||0)],q({type:le.SET_INITAL_DATA,payload:{loading:!1,user:ce,disciplines:n,status:0,dicts:xe,data:{hack_codes:{language:"C",code:""},hack:{category:null,difficult:ve,time_limit:3,description:"",test_set_score:!0,test_set_average:!0,open_or_not:!0,sub_discipline_id:[],tag_discipline_id:me&&(null==me||null===(ie=me.split(","))||void 0===ie?void 0:ie.map((function(e){return Number(e)}))),name:"",item_banks_group_ids:_e,is_file:!1,answer_text:"",submit_rule:1},tags:he?null==he?void 0:he.split(",").map((function(e){return parseInt(e,10)})):[],hack_sets:[{input:"",output:"",score:100,position:1}]}}}),Z({hack:{category:null,difficult:ve,time_limit:3,description:"",test_set_average:!0,open_or_not:!0,sub_discipline_id:[],tag_discipline_id:me&&(null==me||null===(ae=me.split(","))||void 0===ae?void 0:ae.map((function(e){return Number(e)}))),name:"",item_banks_group_id:_e,is_file:!1,answer_text:""}}),Ze(null===(oe=ye)||void 0===oe?void 0:oe[0],null===(re=ye)||void 0===re?void 0:re[1],n);case 27:case"end":return e.stop()}}),e)}))),[o,X]);(0,m.useEffect)((function(){try{Me()}catch(e){console.log(e,"----")}}),[]),(0,m.useEffect)((function(){function e(){return e=d()(l()().mark((function e(){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,N.U2)("item_banks_groups/mine.json");case 2:t=e.sent,ye(t);case 4:case"end":return e.stop()}}),e)}))),e.apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[]);var Ze=function(e,t,n){var i;null==n||null===(i=n.find((function(t){return t.id===e})))||void 0===i||null===(i=i.sub_disciplines)||void 0===i||null===(i=i.find((function(e){return e.id===t})))||void 0===i||i.tag_disciplines};function Ge(e,t,n){return De.apply(this,arguments)}function De(){return De=d()(l()().mark((function e(t,n,r){var s,c,u,p,h,m,g,v,y,x,_,k,A,T,B,N,P,E,M,Z,G,D,F,R;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:u=f()({},t),p=u.hack_sets,h=u.hack_codes,m=u.hack,g=u.tags,v=u.codes,y=[],(null==m||null===(s=m.tag_discipline_ids)||void 0===s?void 0:s.length)>0&&(null!=m&&null!==(x=m.tag_discipline_ids)&&void 0!==x&&null!==(x=x[0])&&void 0!==x&&x.value?null==m||null===(_=m.tag_discipline_ids)||void 0===_||_.map((function(e){y.push(null==e?void 0:e.value)})):y=null==m?void 0:m.tag_discipline_ids),m.tag_discipline_ids=y,k=[],A=[],T=0,B=null!=m&&m.is_file?H.map((function(e,t){return f()(f()({},e),{},{position:t+1})})):p.map((function(e){return f()(f()({},e),{},{is_file:!1})})),N=a()(B);try{for(N.s();!(P=N.n()).done;)E=P.value,T+=E.score,E.id&&E.id>=0?k.push(E):A.push(E)}catch(e){N.e(e)}finally{N.f()}if(null!=B&&B.length){e.next=13;break}return w.ZP.error("测试集不能为空"),e.abrupt("return");case 13:if(100===(T+=parseInt(m.code_compile_score||0))||m.test_set_score){e.next=17;break}return w.ZP.error("测试集的评分占比之和必须等于100"),e.abrupt("return");case 17:if(null==B||!B.some((function(e){return!e.output}))){e.next=22;break}return Ye(null==B?void 0:B.map((function(e){return(null==e?void 0:e.position)-1}))),$e(!0),w.ZP.error("测试集输出不能为空"),e.abrupt("return");case 22:if(M={},Ie?null==v||v.forEach((function(e){M[e.language]=null!=e&&e.code?j.Base64.encode(null==e?void 0:e.code):""})):h.code=j.Base64.encode(null==h?void 0:h.code),m.sub_discipline_id=null===(c=m.sub_discipline_id)||void 0===c?void 0:c[1],q({type:le.SET_LOADING,payload:!0}),pe||(m.score=100*m.difficult),!o){e.next=60;break}return e.next=30,(0,S.l_)(o,{hack:m,hack_codes:h,hack_sets:A,update_hack_sets:k,tags:g,is_cover:r,languages:m.languages,codes:M});case 30:if(0===e.sent.status){e.next=34;break}return q({type:le.SET_LOADING,payload:!1}),e.abrupt("return");case 34:if(!pe){e.next=54;break}return e.next=38,(0,S.j2)(o);case 38:if(!pe.includes("paperlibrary")){e.next=44;break}return e.next=41,(0,I.oF)({id:he,question_id:me,item_type:L.c.Program,name:m.name,question_score:m.score,difficulty:m.difficult,sub_discipline_id:m.sub_discipline_id,tag_discipline_ids:m.tag_discipline_ids,item_banks_group_ids:m.item_banks_group_ids,analysis:m.analysis});case 41:return 0===e.sent.status&&("course"==i.get("pageType")?"course"==i.get("updateType")?C.history.replace(i.get("callback_url")+"&defaultActiveKey=0&pageType=course&updateType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):C.history.replace(i.get("callback_url")+"&pageType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):C.history.replace(i.get("callback_url"))),e.abrupt("return");case 44:return e.next=46,(0,S.GM)(me,{question_type:6,question_score:m.score,question_title:m.name,description:m.description,sub_discipline_id:m.sub_discipline_id,tag_discipline_ids:m.tag_discipline_ids,item_banks_group_ids:m.item_banks_group_ids,identifier:o,analysis:m.analysis});case 46:if(Z=e.sent,0!==Z.status){e.next=52;break}if("start"!==n){e.next=51;break}return e.abrupt("return");case 51:"course"==i.get("pageType")?"course"==i.get("updateType")?C.history.replace(i.get("callback_url")+"&defaultActiveKey=0&pageType=course&updateType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):C.history.replace(i.get("callback_url")+"&pageType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):C.history.replace(i.get("callback_url"));case 52:e.next=57;break;case 54:w.ZP.success("保存成功"),Me(re()),"start"!==n&&0===te&&b.Z.confirm({icon:null,title:"提示",width:452,centered:!0,content:(0,ee.jsx)("div",{children:"编程题已保存!目前外于未发布状态,发布后即可应用到自己管理的课堂,是否立即发布?"}),cancelText:"稍后再说",okText:"立即发布",onCancel:function(){C.history.replace("/problemset")},onOk:function(){var e=d()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Fe(o);case 2:C.history.replace("/problemset");case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()});case 57:q({type:le.SET_LOADING,payload:!1}),e.next=91;break;case 60:return e.next=62,(0,S.zQ)({hack:m,hack_codes:h,hack_sets:B,tags:g,examination_bank_id:he||null});case 62:if(G=e.sent,D=G.identifier,F=G.exam_identifier,q({type:le.SET_LOADING,payload:!1}),"start"!==n){e.next=68;break}return e.abrupt("return");case 68:if(!D){e.next=91;break}if(pe){e.next=74;break}Ee(D),Te(!0),e.next=91;break;case 74:return e.next=76,(0,S.j2)(D);case 76:if(o){e.next=90;break}if(!pe.includes("paperlibrary")){e.next=83;break}return e.next=80,(0,I.oF)({id:he,item_type:L.c.Program,name:m.name,question_score:m.score,difficulty:m.difficult,sub_discipline_id:m.sub_discipline_id,tag_discipline_ids:m.tag_discipline_ids,identifier:F,analysis:m.analysis});case 80:return 0===e.sent.status&&("course"==i.get("pageType")?"course"==i.get("updateType")?C.history.replace(i.get("callback_url")+"&defaultActiveKey=0&pageType=course&updateType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):C.history.replace(i.get("callback_url")+"&pageType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):C.history.replace(i.get("callback_url"))),e.abrupt("return");case 83:return e.next=85,(0,S.MK)(parseInt(he,10),{question_type:6,question_score:m.score,question_title:m.name,identifier:D,tag_discipline_ids:m.tag_discipline_ids,analysis:m.analysis});case 85:R=e.sent,0===R.status&&("course"==i.get("pageType")?"course"==i.get("updateType")?C.history.replace(i.get("callback_url")+"&defaultActiveKey=0&pageType=course&updateType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):C.history.replace(i.get("callback_url")+"&pageType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):C.history.replace(i.get("callback_url"))),e.next=91;break;case 90:"course"==i.get("pageType")?"course"==i.get("updateType")?C.history.replace(i.get("callback_url")+"&defaultActiveKey=0&pageType=course&updateType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):C.history.replace(i.get("callback_url")+"&pageType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):C.history.replace(i.get("callback_url"));case 91:case"end":return e.stop()}}),e)}))),De.apply(this,arguments)}function Fe(e){return Re.apply(this,arguments)}function Re(){return(Re=d()(l()().mark((function e(t){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.j2)(t);case 2:0===(n=e.sent).status?(w.ZP.success("发布成功"),q({type:le.SET_STATUS,payload:1})):w.ZP.info(n.message);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Oe(){return(Oe=d()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Ge(c.getFieldsValue(),"start"),setTimeout(d()(l()().mark((function e(){var t,n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.uE)(o);case 2:t=e.sent,n=t.identifier,window.location.href=Ie?"/myproblems/".concat(n,"?type=1"):"/myproblems/".concat(n);case 5:case"end":return e.stop()}}),e)}))),400);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ze(){if("course"==i.get("pageType"))"course"==i.get("updateType")?C.history.replace(i.get("callback_url")+"&defaultActiveKey=0&pageType=course&updateType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):C.history.replace(i.get("callback_url")+"&pageType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId")));else if(pe)C.history.replace(i.get("callback_url"));else if(Ie){var e,t=null===(e=localStorage.getItem("program_homework"))||void 0===e?void 0:e.split(",");C.history.push("/classrooms/".concat(null==t?void 0:t[0],"/program_homework/").concat(null==t?void 0:t[1],"/detail"))}else C.history.replace("/problemset")}var He=function(e){var t=parseInt(c.getFieldValue("hack").code_compile_score)||0,n=Math.floor((100-t)/e.length),i=n+(100-t)%e.length,a=e.map((function(t,a){return a===e.length-1?f()(f()({},t),{},{score:i}):f()(f()({},t),{},{score:n})}));W(a)};(0,m.useEffect)((function(){if(de){var e=parseInt(c.getFieldValue("hack").code_compile_score)||0,t=null==ne?void 0:ne.length,n=Math.floor((100-e)/t),i=(100-e)%t;null==ne||ne.map((function(e,a){return e.score=n,e.position=a+1,a===t-1&&(e.score=n+i),e})),q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack_sets:ne})}}),c.setFieldsValue({hack_sets:ne})}}),[de]);(0,m.useEffect)((function(){var e,t;null!=J&&null!==(e=J.hack)&&void 0!==e&&null!==(e=e.sub_discipline_id)&&void 0!==e&&e[1]&&We(null==J||null===(t=J.hack)||void 0===t||null===(t=t.sub_discipline_id)||void 0===t?void 0:t[1])}),[null==J||null===(t=J.hack)||void 0===t?void 0:t.sub_discipline_id]);var We=function(){var e=d()(l()().mark((function e(t){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,A.YY)({sub_discipline_id:t});case 2:n=e.sent,R(n.tag_disciplines);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();var Ve=function(){var e=d()(l()().mark((function e(){var t,n,a,o,r,s;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,c.validateFields();case 3:if(t=c.getFieldsValue(),!i.get("exercise")||pe.includes("paperlibrary")){e.next=7;break}return b.Z.confirm({title:"保存提示",content:"此题目已存在试题库中,是否将修改后的试题覆盖试题库的原题?",okText:"覆盖原题",cancelText:"不覆盖",onOk:function(){return Ge(t,"",1)},onCancel:function(){return Ge(t,"",0)}}),e.abrupt("return");case 7:Ge(t,"",1),e.next=17;break;case 10:e.prev=10,e.t0=e.catch(0),(r=null===e.t0||void 0===e.t0||null===(n=e.t0.errorFields)||void 0===n||null===(n=n.filter((function(e){var t;return"hack_sets"==(null==e||null===(t=e.name)||void 0===t?void 0:t[0])})))||void 0===n?void 0:n.map((function(e){var t;return null==e||null===(t=e.name)||void 0===t?void 0:t[1]}))).length>0&&Ye(r),c.scrollToField(null===e.t0||void 0===e.t0||null===(a=e.t0.errorFields)||void 0===a||null===(a=a[0])||void 0===a?void 0:a.name,{behavior:"smooth",block:"start"}),s=null===e.t0||void 0===e.t0||null===(o=e.t0.errorFields)||void 0===o||null===(o=o[0])||void 0===o||null===(o=o.errors)||void 0===o?void 0:o[0],w.ZP.error(s);case 17:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),Ue=(0,m.useState)(0),Ke=p()(Ue,2),qe=Ke[0],Ye=Ke[1],Je=(0,m.useState)(!1),Qe=p()(Je,2),Xe=Qe[0],$e=Qe[1];return(0,m.useEffect)((function(){if(Xe){var e=document.getElementById("scroll-key-".concat(qe));null==e||e.scrollIntoView({behavior:"smooth"}),$e(!1)}}),[qe,Xe]),(0,ee.jsxs)(y.Z,{spinning:Y,delay:500,children:[J?(0,ee.jsxs)("div",{className:g.bg,children:[(0,ee.jsxs)("header",{className:g.header,children:[(0,ee.jsxs)("div",{className:g.avatar,children:[(0,ee.jsx)("img",{src:"".concat(E.Z.IMG_SERVER,"/images/").concat(null==Q?void 0:Q.image_url),alt:"user"}),(0,ee.jsx)("span",{children:null==Q?void 0:Q.name})]}),(0,ee.jsxs)("div",{className:g.title,children:[" ",(null==J?void 0:J.hack.name)||"编程题"," "]}),(0,ee.jsxs)("div",{className:g.exitBtn,onClick:ze,children:[(0,ee.jsx)("i",{className:"icon iconfont icon-tuichu1"}),(0,ee.jsx)("span",{children:"退出"})]})]}),(0,ee.jsx)(v.Z,{colon:!1,form:c,initialValues:J,scrollToFirstError:!0,onValuesChange:function(e){var t;if(null!=e&&null!==(t=e.hack)&&void 0!==t&&t.sub_discipline_id){var n,i,a,o=null==e||null===(n=e.hack)||void 0===n?void 0:n.sub_discipline_id,r=p()(o,2),s=r[0],l=r[1],d=(null==X||null===(i=X.find((function(e){return e.id===s})))||void 0===i||null===(i=i.sub_disciplines)||void 0===i||null===(i=i.find((function(e){return e.id===l})))||void 0===i||i.tag_disciplines,f()(f()({},c.getFieldsValue()),{},{hack:f()(f()({},null===(a=c.getFieldsValue())||void 0===a?void 0:a.hack),{},{tag_discipline_ids:[]})}));c.setFieldsValue(d),Z(d)}else Z(f()({},c.getFieldsValue()))},labelCol:{flex:"200px"},children:(0,ee.jsx)("div",{className:g.contentWrapper,children:(0,ee.jsx)(x.Z,{defaultActiveKey:"2"==i.get("tabKey")?"2":"1",className:g.tabWrapper,tabBarGutter:180,centered:!0,items:[{label:"基础信息",key:"1",forceRender:!0,children:(0,ee.jsx)(ie,{onAddTestCases:function(){var e=c.getFieldValue("hack_sets"),t=parseInt(c.getFieldValue("hack").code_compile_score)||0,n=e.length,i=Math.floor((100-t)/n),a=(100-t)%n;e.map((function(t,n){return de&&(t.score=i,n===e.length-1&&(t.score=i+a)),t.position=n+1,t})),c.setFieldsValue({hack_sets:e}),q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack_sets:e})}})},form:c,handleAddKnowledgeFinish:function(e){R([].concat(r()(F),[f()({},e)]))},MyGroup:be,formValue:M,knowledgeOptions:F,onChangeLanguage:function(e){q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack_codes:f()(f()({},J.hack_codes),{},{language:e})})}})},onChangeSubDiscipline:function(e){var t,n;R([]);var i=e?e[1]:null,a=(0,k.y3)(X,i),o=p()(a,2)[1];c.setFieldsValue({tags:[]}),q({type:le.SET_INITAL_DATA,payload:{dicts:o,data:f()(f()({},J),{},{hack:f()(f()({},J.hack),{},{sub_discipline_id:e,tag_discipline_ids:e&&e[1]==(null==J||null===(t=J.hack)||void 0===t?void 0:t.sub_discipline_id)?null==J||null===(n=J.hack)||void 0===n?void 0:n.tag_discipline_ids:[]}),tags:[]})}})},onRemoveTestCase:function(e){var t=c.getFieldValue("hack_sets"),n=parseInt(c.getFieldValue("hack").code_compile_score)||0,i=(null==t?void 0:t.length)-1,a=Math.floor((100-n)/i),o=(100-n)%i;t.splice(e,1),null==t||t.map((function(e,t){return de&&(e.score=a,t===i-1&&(e.score=a+o)),e.position=t+1,e})),q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack_sets:t})}}),c.setFieldsValue({hack_sets:t})},onAddTestCase:function(){var e=c.getFieldValue("hack_sets"),t=parseInt(c.getFieldValue("hack").code_compile_score)||0,n=e.length+1,i=Math.floor((100-t)/n),a=(100-t)%n;e.map((function(e,t){return de&&(e.score=i),e.position=t+1,e})),e.push({input:"",output:"",position:n,score:de?i+a:0}),c.setFieldsValue({hack_sets:e}),q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack_sets:e})}}),Ye(e.length-1),$e(!0)},dicts:$,categorys:Le,callback_url:pe,hack:J.hack,onChangeScore:function(e){e.target.value||He(H),q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack:f()(f()({},J.hack),{},{test_set_score:e.target.value})})}})},onChangeAverage:function(e){var t=e.target.value;t&&He(H);var n=c.getFieldValue("hack_sets");q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack_sets:n,hack:f()(f()({},J.hack),{},{test_set_average:t})})}})},onChangeFile:function(e){q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack:f()(f()({},J.hack),{},{is_file:e.target.value})})}})},uploadData:H,setUploadData:W,handleUploadRatio:He,isshows:ke,isProgram:Ie,addUploadFnc:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(n)return function(){q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack:f()(f()({},J.hack),{},{is_file:!0})})}}),c.setFieldsValue({hack:{is_file:!0}})};var i=null==e?void 0:e.map((function(e){return{input:e.input,output:e.output,score:0,position:1}})),a=null===(t=c.getFieldValue("hack_sets"))||void 0===t||null===(t=t.filter((function(e){return e.input||e.output})))||void 0===t?void 0:t.concat(i),o=parseInt(c.getFieldValue("hack").code_compile_score)||0,r=null==a?void 0:a.length,s=Math.floor((100-o)/r),l=(100-o)%r;null==a||a.map((function(e,t){return de&&(e.score=s,t===r-1&&(e.score=s+l)),e.position=t+1,e})),q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack_sets:a,hack:f()(f()({},J.hack),{},{is_file:!1})})}}),c.setFieldsValue({hack_sets:a,hack:{is_file:!1}})},activeKey:qe,setActiveKey:Ye})},{label:"学员初始代码",key:"2",forceRender:!0,children:(0,ee.jsx)("div",{className:g.codePanelWrapper,children:Ie?(0,ee.jsx)(v.Z.Item,{name:"codes",noStyle:!0,children:(0,ee.jsx)(B.Z,{})}):(0,ee.jsx)(v.Z.Item,{name:["hack_codes","code"],noStyle:!0,children:(0,ee.jsx)(T.Z,{language:J.hack_codes.language,onUpdateCode:function(){}})})})}]})})}),(0,ee.jsx)("div",{className:g.buttonFixed,children:o?(0,ee.jsxs)(m.Fragment,{children:[(0,ee.jsx)("div",{className:g.cancelBtn,onClick:ze,children:"取消"}),(0,ee.jsx)(_.ZP,{className:"".concat(g.saveBtn," ml20"),loading:Y,type:"primary",onClick:(0,ae.throttle)(Ve,1e3),children:"保存"}),(0,ee.jsx)(_.ZP,{type:"primary",className:"".concat(g.challengeBtn," ml20"),onClick:(0,ae.throttle)((function(){return Oe.apply(this,arguments)}),1e3),icon:(0,ee.jsx)("i",{className:"icon iconfont icon-kaishitiaozhan1 mr5 font14"}),children:te?"开始挑战":"模拟挑战"})]}):(0,ee.jsxs)(m.Fragment,{children:[(0,ee.jsx)("div",{className:g.cancelBtn,onClick:ze,children:"取消"}),(0,ee.jsx)(_.ZP,{className:"".concat(g.saveBtn," ml20"),loading:Y,type:"primary",onClick:(0,ae.throttle)(Ve,1e3),children:"保存"})]})})]}):(0,ee.jsx)("div",{className:"vh100"}),(0,ee.jsxs)(b.Z,{centered:!0,maskClosable:!1,open:Ae,title:"提示",width:"484px",onCancel:function(){C.history.push("/problems/newedit/".concat(Pe)),Te(!1)},footer:null,children:[(0,ee.jsxs)("div",{children:[(0,ee.jsx)("div",{style:{lineHeight:"26px"},children:"本次试题内容修改已保存成功,可点击“退出”返回到试题库页面,点击“模拟实战”进行代码调试"}),(0,ee.jsxs)("div",{style:{color:"#E99237",fontSize:12,marginTop:12},children:[(0,ee.jsx)(oe.Z,{style:{marginRight:10}}),"如本试题学生进入需要展示初始代码,请点击",(0,ee.jsx)("span",{style:{color:"#165DFF",cursor:"pointer",textDecoration:"underline"},onClick:function(){C.history.push("/problems/newedit/".concat(Pe,"?tabKey=2"))},children:"设置初始代码"}),"进行设置"]})]}),(0,ee.jsxs)("div",{className:"mt30 mb20",style:{display:"flex",justifyContent:"flex-end"},children:[(0,ee.jsx)(_.ZP,{className:"mr20",onClick:function(){C.history.replace("/problemset")},children:"退出"}),(0,ee.jsx)(_.ZP,{type:"primary",onClick:d()(l()().mark((function e(){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.uE)(Pe);case 2:t=e.sent,window.location.href=Ie?"/myproblems/".concat(null==t?void 0:t.identifier,"?type=1"):"/myproblems/".concat(null==t?void 0:t.identifier);case 4:case"end":return e.stop()}}),e)}))),children:"模拟实战"})]})]})]})}},6427:function(e,t,n){"use strict";n.d(t,{GM:function(){return d},MK:function(){return c},PR:function(){return a},ZS:function(){return p},d1:function(){return o},fu:function(){return r},j2:function(){return u},l_:function(){return s},uE:function(){return h},zQ:function(){return l}});var i=n(90694);function a(){return(0,i.U2)("problems/new.json")}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"question";return(0,i.U2)("disciplines.json",{source:e})}function r(e){return(0,i.U2)("problems/".concat(e,"/edit.json"))}function s(e,t){return(0,i.gz)("problems/".concat(e,".json"),t)}function l(e){return(0,i.v_)("problems.json",e)}function c(e,t){return(0,i.v_)("exercises/".concat(e,"/exercise_questions.json"),t)}function d(e,t){return(0,i.gz)("exercise_questions/".concat(e,".json"),t)}function u(e){return(0,i.v_)("problems/".concat(e,"/publish.json"))}function p(e){return(0,i.v_)("problems/".concat(e,"/cancel_publish.json"))}function h(e){return(0,i.U2)("problems/".concat(e,"/start.json"))}},74527:function(e,t,n){"use strict";n.d(t,{D0:function(){return u},R8:function(){return l},jw:function(){return d},y3:function(){return p}});var i=n(85573),a=n.n(i),o=n(57809),r=(n(59301),n(37712)),s=o.default.Option,l=function(e){return e[e.language=0]="language",e[e.difficult=1]="difficult",e[e.category=2]="category",e[e.openOrNot=3]="openOrNot",e}({}),c=a()(a()(a()(a()({},l.language,[{title:"C",key:"C"},{title:"C++",key:"C++"},{title:"Python",key:"Python"},{title:"Java",key:"Java"},{title:"JavaScript",key:"JavaScript"},{title:"Ruby",key:"Ruby"}]),l.difficult,[{title:"简单",key:1},{title:"中等",key:2},{title:"困难",key:3}]),l.category,[{title:"程序设计",key:1},{title:"算法",key:2}]),l.openOrNot,[{title:"公开",key:1},{title:"私有",key:0}]);function d(e){return c[e].map((function(e){return(0,r.jsxs)(s,{value:e.key,children:[" ",e.title," "]},e.title)}))}function u(e,t){e.map((function(e){var n=e.id,i=e.name,a=e.sub_disciplines,o={value:n,label:i};t.push(o),a&&a.length>0&&(o.children=[],u(a,o.children))}))}function p(e,t){for(var n=[],i=0;i0){n[0]=o.id;for(var r=0;r4?parseFloat(e):5};function _(){try{return window.self!==window.top}catch(e){return!0}}function k(){return(!n.hasOwnProperty("screenshotGenerator")||!n.screenshotGenerator)&&Math.max(screen.width,screen.height)<800}e.setHTML5Codebase=function(e,t){c=e,G(e,t)},e.setJavaCodebase=e.setJavaCodebaseVersion=e.isCompiledInstalled=e.setPreCompiledScriptPath=e.setPreCompiledResourcePath=function(){},e.setHTML5CodebaseVersion=function(e,t){var n=parseFloat(e);NaN!==n&&n<5?console.log("The GeoGebra HTML5 codebase version "+n+" is deprecated. Using version latest instead."):(l=e,Z(e,t))},e.getHTML5CodebaseVersion=function(){return m},e.getParameters=function(){return n},e.setFontsCSSURL=function(e){y=e},e.setGiacJSURL=function(e){},e.setJNLPFile=function(e){e},e.setJNLPBaseDir=function(e){},e.inject=function(){function t(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var i,a="auto",o=n.id,r=!1,l=0;l=5)return!0;var t=e.getAppletObject();return!(!t||"function"!=typeof t.recalculateEnvironments)&&(t.recalculateEnvironments(),!0)},e.startAnimation=function(){var t=e.getAppletObject();return!(!t||"function"!=typeof t.startAnimation)&&(t.startAnimation(),!0)},e.stopAnimation=function(){var t=e.getAppletObject();return!(!t||"function"!=typeof t.stopAnimation)&&(t.stopAnimation(),!0)},e.getAppletObject=function(){var e=void 0!==n.id?n.id:"ggbApplet";return window[e]},e.resize=function(){};var A=function(e){return e&&"false"!==e},T=function(t,n,i){x(m)<=4.2&&(i=!0);var a=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==m||ggbHTML5LoadedCodebaseIsWebSimple&&!v)&&(a=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var o=document.createElement("div");o.classList.add("appletParameters","notranslate");var r=n.width,s=n.height;if(n.disableAutoScale=void 0===n.disableAutoScale?GGBAppletUtils.isFlexibleWorksheetEditor():n.disableAutoScale,void 0!==n.width)if(x(m)<=4.4)A(n.showToolBar)&&(n.height-=7),A(n.showAlgebraInput)&&(n.height-=37),n.width<605&&A(n.showToolBar)&&(n.width=605,r=605);else{var d=100;(A(n.showToolBar)||A(n.showMenuBar))&&(n.hasOwnProperty("customToolBar")&&(n.customToolbar=n.customToolBar),d=A(n.showMenuBar)?245:155),r=5?(n.appletOnLoad=function(e){var n=t.querySelector(".ggb_preview");n&&n.parentNode.removeChild(n),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(w),window.GGBT_wsf_view&&$(window).trigger("resize"),h(e)},b||w.appendChild(_)):o.appendChild(_),w.appendChild(o),b||t.appendChild(w),setTimeout((function(){e.resize()}),1)}function k(e,t){t&&"function"==typeof t.appletOnLoad&&"function"==typeof renderGGBElement?renderGGBElement(e,t.appletOnLoad):renderGGBElement(e),D("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",t)}function C(e,t){"undefined"==typeof renderGGBElement?(null===html5AppletsToProcess&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:e,params:t}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,null!==html5AppletsToProcess&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach((function(e){k(e.article,e.params)})),html5AppletsToProcess=null)},x(m)<5&&(e.className+=" geogebraweb")):k(e,t)}if(a){scriptLoadStarted=!0;for(var j=0;j0?(a.remove(),s.attr("id","fullscreencontent").show(),jQuery(o).append(s),window.dispatchEvent(new Event("resize"))):T(a,t,!1),window.GGBT_wsf_view.launchFullScreen(o)}else f=i,T(e,t,!1);if(!window.GGBT_wsf_view)for(r=0;re/4*3&&(s=e/4*3),l=s/5.8,r.setAttribute("src",b),r.setAttribute("width",s),r.setAttribute("height",l);var d=(e-s)/2,u=(t-l)/2;r.style.left=d+"px",r.style.top=u+"px",a.appendChild(r)}return a.appendChild(c),a},L=function(e){return"html5"===(e=e.toLowerCase())||"screenshot"===e?e:"html5"},M=["web","webSimple","web3d","tablet","tablet3d","phone"],Z=function(e,t){if(m=e,t)G(m,!0);else{var o,r,s=!a;if(s){var l=x(m);!isNaN(l)&&l<4.4&&(s=!1)}o="http"===window.location.protocol.substr(0,4)?window.location.protocol:"http:";var c=m.indexOf("//");for(var d in r=c>0?m:0===c?o+m:"https://www.geogebra.org/apps/5.2.814.0/",M)if(m.slice(-1*M[d].length)===M[d]||m.slice(-1*(M[d].length+1))===M[d]+"/")return void G(r,!1);GGBAppletUtils.isFlexibleWorksheetEditor()||!s||i.is3D||i.AV||i.SV||i.CV||i.EV2||i.CP||i.PC||i.DA||i.FI||i.PV||A(n.showToolBar)||A(n.showMenuBar)||A(n.showAlgebraInput)||A(n.enableRightClick)||n.appName&&"classic"!=n.appName?r+="web3d/":r+="webSimple/",G(r,!1)}},G=function(e,t){if(e.requirejs)p=e;else{"/"!==e.slice(-1)&&(e+="/"),p=e,null===t&&(t=-1===e.indexOf("http")),h=t,g="web.nocache.js",v=!1;var n=p.split("/");n.length>1&&(t||"webSimple"!==n[n.length-2]?M.indexOf(n[n.length-2])>=0&&(g=n[n.length-2]+".nocache.js"):(g="webSimple.nocache.js",v=!0)),n=e.split("/"),"test"===(m=n[n.length-3]).substr(0,4)?m=m.substr(4,1)+"."+m.substr(5,1):"war"!==m.substr(0,3)&&"beta"!==m.substr(0,4)||(m="5.0");var i=parseFloat(m);NaN!==i&&i<5&&e.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+i+" is deprecated. Using version latest instead."),Z("5.0",t))}},D=function(e,t){window.console&&window.console.log&&(!t||void 0===t.showLogging||t.showLogging&&"false"!==t.showLogging)&&console.log(e)};function F(){var e=t;null!==l?e=l:parseFloat(e)<5&&(e="5.0"),Z(e,!1),null!==c&&G(c,h),s=!0}return void 0!==n.material_id?C(F):F(),e},GGBAppletUtils=function(){"use strict";function e(){return void 0!==window.GGBT_wsf_edit}function t(e,t){1!=t?(e.style.transformOrigin="0% 0% 0px",e.style.webkitTransformOrigin="0% 0% 0px",e.style.transform="scale("+t+","+t+")",e.style.webkitTransform="scale("+t+","+t+")",e.style.maxWidth="initial",null!==e.querySelector(".ggb_preview")&&(e.querySelector(".ggb_preview").style.maxWidth="initial"),void 0!==e.querySelectorAll(".ggb_preview img")[0]&&(e.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),void 0!==e.querySelectorAll(".ggb_preview img")[1]&&(e.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(e.style.transform="none",e.style.webkitTransform="none")}function n(e,t,n,i,a){if(e.isScreenshoGenerator)return 1;var o,r=void 0!==i&&i,s=null!=e.noScaleMargin&&e.noScaleMargin,l=(o=e.autoHeight)&&"false"!==o,c=function(e,t,n,i,a,o){var r=null;if(null!=o&&""!=o)for(var s=e.parentNode;null!=s;){if((" "+s.className+" ").indexOf(" "+o+" ")>-1){r=s;break}s=s.parentNode}var l=0,c=0,d=0,u=0,p=0,h=0,f=0;if(r)l=r.offsetWidth,c=Math.max(i?r.offsetWidth:0,r.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(l=Math.min(window.innerWidth,document.documentElement.clientWidth),c=Math.min(window.innerHeight,document.documentElement.clientHeight),d=l):(l=window.innerWidth,c=window.innerHeight,d=window.innerWidth),e){var m=e.getBoundingClientRect();m.left>0&&m.left<=l&&(void 0===a||!a)&&("rtl"===document.dir?(p=l-m.width-m.left,h=d<=480?10:30):(h=m.left,p=d<=480?10:30),u=h+p)}e&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(e.getBoundingClientRect(),"closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(u=40,f=0):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(u=0,f=40))}return e&&((void 0===n||!n)&&t>0&&t+u1&&(r=!0)),t&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(r=!0),e.hasOwnProperty("disableAutoScale")&&e.disableAutoScale?o:(a=n(e,t,r,i,e.scaleContainerClass),!r||e.hasOwnProperty("scale")&&1!==o?Math.min(o,a):a)}function a(e){var t=Math.min(window.innerWidth,document.documentElement.clientWidth),n=Math.min(window.innerHeight,document.documentElement.clientHeight),i=e.getBoundingClientRect(),a=(t-i.width)/2,o=(n-i.height)/2;o<0&&(o=0),e.style.position="relative","closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(e.style.left=a<40?"40px":a+"px",e.style.top=o+"px"):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(e.style.top=o<40?"40px":o+"px",e.style.left=a+"px")}return{responsiveResize:function(n,o){var r=n.querySelector(".appletParameters");if(r){if("object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()){if(o.id!==r.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(n)}if(r.parentElement&&/fullscreen/.test(r.parentElement.className))return;var s=i(o,n);e()&&r.setAttribute("data-param-scale",s);for(var l=null,c=0;c=O)continue;if(j==jb){if(k=i.getAttribute(kb),k){var l,m=k.indexOf(lb);m>=O?(j=k.substring(O,m),l=k.substring(m+P)):(j=k,l=W),c[j]=l}}else if(j==mb){if(k=i.getAttribute(kb),k)try{d=eval(k)}catch(e){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(e){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(e){var t=c[e];return null==t?null:t},r=d,webModule.__errFn=e}function B(){function e(e){var t=e.lastIndexOf(rb);-1==t&&(t=e.length);var n=e.indexOf(sb);-1==n&&(n=e.length);var i=e.lastIndexOf(tb,Math.min(n,t));return i>=O?e.substring(O,i+P):W}var t,n=null!=(t=__gwt_getMetaProperty(wb))?t:W;return n==W&&(n=function(){for(var t=o.getElementsByTagName(_),n=O;nO?e[e.length-P].href:W}()),n==W&&function(){var e=o.location;return e.href==e.protocol+zb+e.host+e.pathname+e.search+e.hash}()&&(n=e(o.location.href)),n=function(t){if(t.match(/^\w+:\/\//));else{var n=o.createElement(ub);n.src=t+vb,t=e(n.src)}return t}(n),n}function C(e){return e.match(/^\//)||e.match(/^[a-zA-Z]+:\/\//)?e:webModule.__moduleBase+e}function D(){var e,t=O,i=[],a=[];function o(e){var t=a[e](),n=i[e];if(t in n)return t;var o=[];for(var s in n)o[n[s]]=s;throw r&&r(e,o,t),null}if(__gwt_isKnownPropertyValue=function(e,t){return t in i[e]},webModule.__getPropMap=function(){var e={};for(var t in i)i.hasOwnProperty(t)&&(e[t]=o(t));return e},webModule.__computePropValue=o,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);try{var s=(e=Cb).indexOf(Db);-1!=s&&(t=parseInt(e.substring(s+P),$),e=e.substring(O,s))}catch(e){}return webModule.__softPermutationId=t,C(e+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}s[L]={moduleName:L},webModule.__moduleStartupDone=function(e){var t=s[L].bindings;s[L].bindings=function(){for(var n=t?t():{},i=e[webModule.__softPermutationId],a=O;a0){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"",n=[],i=0;i0&&(0,w.jsx)("div",{id:i||"",children:(0,w.jsx)(p.Z,a()({showLine:{showLeafIcon:!1},showIcon:!0,treeData:c,className:h,onSelect:n,onExpand:function(e,t){b((function(e){return _(e,t.node.key,t.expanded)}))}},k))})}},87359:function(e,t,n){"use strict";n.d(t,{Z:function(){return y}});var i=n(7557),a=n.n(i),o=n(41498),r=n.n(o),s=n(79800),l=n.n(s),c=n(59301),d="imageDimensions___a7crR",u="img___Kroat",p="fullWidth___c492T",h=n(92310),f=n.n(h),m=n(71418),g=n(2859),v=n(90694),w=n(41282),b=n(37712),y=function(e){var t=e.data,n=e.className,i=e.fullWidth,o=e.style,s=void 0===o?{}:o,h=e.onClose,y=e.onOk,x=e.showFullTools,_=e.noAssociationId,k=(0,c.useRef)(null),C=(0,c.useRef)(null),j=(0,c.useState)(!1),S=l()(j,2),A=S[0],T=S[1],B=(0,c.useState)("正在加载中"),N=l()(B,2),P=N[0],E=N[1];(0,c.useEffect)((function(){null!=t&&t.visible?document.body.setAttribute("data-custom","y-hidden"):document.body.removeAttribute("data-custom"),null!=t&&t.src&&I()}),[null==t?void 0:t.visible]);var I=function(){var e=r()(a()().mark((function e(){var n;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T(!0),E("正在加载中"),e.next=4,(0,w.ZJ)(null==t?void 0:t.src);case 4:n=e.sent,k.current.src="",k.current.src=n,k.current.onload=function(){M()},T(!1),E("");case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),L=function(){var e=r()(a()().mark((function e(n){var i;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T(!0),E("正在保存中"),e.next=4,(0,v.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:t.title,file:n.dataUrl}});case 4:if(null==(i=e.sent)||!i.id||_){e.next=12;break}return e.next=8,(0,v.ZP)("/api/attachments/".concat(t.id,"/add_subitem.json"),{method:"post",body:{subitem_id:null==i?void 0:i.id,settings:JSON.stringify(n.state)}});case 8:0===e.sent.status&&y(),e.next=13;break;case 12:null!=i&&i.id&&y(i);case 13:T(!1),E("");case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),M=function(){C.current=new g.hP(k.current),C.current.addEventListener("render",L),C.current.addEventListener("beforeclose",h),x&&(C.current.availableMarkerTypes=C.current.ALL_MARKER_TYPES,C.current.uiStyleSettings.redoButtonVisible=!0,C.current.uiStyleSettings.notesButtonVisible=!0,C.current.uiStyleSettings.zoomButtonVisible=!0,C.current.uiStyleSettings.zoomOutButtonVisible=!0,C.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=C.current.uiStyleSettings,C.current.show(),null!=t&&t.snapshotData&&C.current.restoreState(t.snapshotData),setTimeout((function(){var e;(e=document.querySelector('a[href="https://markerjs.com/"]'))&&e.parentNode&&(e.parentNode.style.display="none"),[{name:'[data-action="select"]',title:"选择"},{name:'[data-action="delete"]',title:"删除元素"},{name:'[data-action="undo"]',title:"撤销"},{name:'[data-type-name="FrameMarker"]',title:"矩形"},{name:'[data-type-name="FreehandMarker"]',title:"画线"},{name:'[data-type-name="ArrowMarker"]',title:"箭头"},{name:'[data-type-name="TextMarker"]',title:"文本"},{name:'[data-type-name="EllipseMarker"]',title:"椭圆"},{name:'[data-type-name="HighlightMarker"]',title:"方块"},{name:'[data-type-name="CalloutMarker"]',title:"注释"},{name:'[data-action="render"]',title:"保存"},{name:'[data-action="close"]',title:"退出"}].forEach((function(e){var t=document.querySelector(e.name);t&&t.setAttribute("title",e.title)}))}),300)};return(0,b.jsx)(c.Fragment,{children:(null==t?void 0:t.visible)&&(0,b.jsxs)("div",{className:f()(d,n,i?p:""),style:s,children:[(0,b.jsx)(m.Z,{spinning:A,tip:P,style:{position:"absolute"}}),(0,b.jsx)("img",{className:u,ref:k})]})})}},43941:function(e,t,n){"use strict";n.d(t,{N:function(){return B}});var i=n(7557),a=n.n(i),o=n(41498),r=n.n(o),s=n(37205),l=n.n(s),c=n(79800),d=n.n(c),u=n(59301),p=n(57809),h=n(43418),f=n(98135),m=n(8591),g=n(95237),v=n(43604),w=n(90694),b="wrap___F7E3F",y="selectWrapper____kESB",x="tips___aHjQY",_="linkBtn___uggVr",k="public_tips___sZVWd",C="inputCss___t66EO",j="bt___lXptu",S=n(88289),A=n(37712),T=p.default.Option,B=function(e){var t=e.subId,n=e.value,i=e.selectvalues,o=e.disabled,s=e.knowledgeOptions,c=void 0===s?[]:s,B=e.onChange,N=void 0===B?function(){}:B,P=e.onAddKnowledgeFinish,E=void 0===P?function(){}:P,I=(0,u.useRef)(),L=(0,u.useState)([]),M=d()(L,2),Z=M[0],G=M[1];n=n||[];(0,u.useEffect)((function(){(null==i?void 0:i.length)>0?(G(l()(i)),N(l()(i))):(G([]),N([]))}),[c]),(0,u.useEffect)((function(){var e;(null===(e=n)||void 0===e?void 0:e.length)>0&&N(l()(n))}),[c]);return(0,A.jsxs)(g.Z,{wrap:!1,align:"middle",className:b,children:[(0,A.jsx)(v.Z,{children:(0,A.jsx)(p.default,{mode:"multiple",disabled:!t||o,className:y,placeholder:"请选择知识点,支持选择多个",onChange:function(e,t){e?(G(l()(t)),N(l()(t))):(G([]),N([]))},style:{width:490},showSearch:!0,allowClear:!0,value:Z,filterOption:function(e,t){return t.label.indexOf(e.toLowerCase())>=0},children:null==c?void 0:c.map((function(e){return(0,A.jsx)(T,{value:e.id,label:e.name,children:(0,A.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,A.jsx)("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:e.name}),"personal"===(null==e?void 0:e.type)&&(0,A.jsx)("div",{style:{marginLeft:"5px",border:"1px solid #24C074",color:"#24C074",padding:"0 4px",borderRadius:"2px",fontSize:"12px",height:"20px",lineHeight:"20px"},children:"自用"})]})},e.id)}))})}),t&&(0,A.jsxs)(v.Z,{className:"ml20",children:[(0,A.jsx)("span",{className:x,children:"没有合适的知识点?"}),(0,A.jsx)("span",{className:_,onClick:function(e){e.preventDefault(),I.current="",h.Z.confirm({centered:!0,width:585,okText:"确定",cancelText:"取消",icon:null,title:"新建知识点",className:"custom-modal-divider",content:(0,A.jsxs)("div",{className:"font14",children:[(0,A.jsxs)("div",{className:k,children:[(0,A.jsx)(S.Z,{style:{color:"#FF8C29",marginRight:10,paddingTop:5}}),"新建的知识点仅本人可见,平台审核列入公开知识点后,对所有用户可见。 平台有权删除不合适的知识点,请认真填写知识点名称。"]}),(0,A.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,A.jsxs)("div",{style:{width:"95px"},children:[(0,A.jsx)("span",{className:j,children:"*"}),"知识点名称"]}),(0,A.jsx)(f.Z,{className:C,style:{width:"calc(100% - 95px)"},maxLength:20,size:"middle",showCount:!0,placeholder:"请输入知识点名称",defaultValue:I.current,onChange:function(e){I.current=e.target.value}})]})]}),onOk:function(){return new Promise(function(){var e=r()(a()().mark((function e(n,o){var r,s;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(I.current){e.next=3;break}return m.ZP.warning("请输入知识点名称"),e.abrupt("return",o());case 3:if(!(I.current.length>20)){e.next=6;break}return m.ZP.warning("请输入不超过20字的知识点名称"),e.abrupt("return",o());case 6:return e.next=8,(0,w.ZP)("/api/tag_disciplines.json",{method:"post",body:{name:I.current,sub_discipline_id:t}});case 8:return 0===(null==(r=e.sent)?void 0:r.status)&&(E({id:r.tag_discipline_id,name:I.current,type:"personal"}),(s=i||[]).push(r.tag_discipline_id),N(l()(s)),G(l()(s)),N(l()(s))),e.abrupt("return",n());case 11:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}())}})},children:"新建知识点"})]})]})}},78716:function(e,t,n){"use strict";n.d(t,{h:function(){return p},x:function(){return h}});var i=n(82242),a=n.n(i),o=n(39647),r=n.n(o),s=n(77162),l=n(26194),c=n(36653),d=n(37712),u=["value","onChange","scrollId"],p=function(e){var t=e.value,n=e.onChange,i=e.scrollId,o=r()(e,u);return(0,d.jsx)("div",{id:i||"",children:(0,d.jsx)(s.Z,a()(a()({},o),{},{defaultValue:t,onChange:function(e,t){console.log("a:",e,t),null!=t&&t.length?n(e,t):n(e)}}))})},h=function(e){var t=e.value,n=e.onChange,i=e.placeholder,a=e.height,o=void 0===a?140:a;return e.isEdit?(0,d.jsx)(s.Z,{watch:!0,isFocus:!0,height:o,placeholder:i,defaultValue:t,onChange:n}):(0,d.jsx)("div",{style:{cursor:"pointer"},children:t?(0,d.jsx)(c.Z,{className:l.Z.inputBorder,value:t}):(0,d.jsx)("div",{className:"".concat(l.Z.inputBorder," ").concat(l.Z.placeholder," inputBorderError"),children:i})})}},71550:function(e,t,n){"use strict";n.d(t,{h:function(){return v}});var i=n(82242),a=n.n(i),o=n(79800),r=n.n(o),s=n(59301),l=n(57809),c=n(78241),d=n(3113),u=n(89780),p=n.n(u),h=(n(49324),n(20615),n(37712)),f=l.default.Option,m={labelCol:{span:4},wrapperCol:{span:20}},g={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};function v(e){var t=e.value,n=e.onChange,i=e.mode,o=e.options,l=void 0===o?{}:o,c=(0,s.useRef)(),d=(0,s.useState)(),u=r()(d,2),f=u[0],m=u[1];return(0,s.useEffect)((function(){if(f){var e=function(e){var t=e.getValue();n&&n(t)};return f.on("change",e),function(){f.off("change",e)}}}),[f,n]),(0,s.useEffect)((function(){f&&f.setOption("mode",i)}),[f,i]),(0,s.useEffect)((function(){f&&(t===f.getValue()&&""!==t||setTimeout((function(){f.setValue(t||"")}),300))}),[f,t]),(0,s.useEffect)((function(){if(c.current&&!f){var e=p().fromTextArea(c.current,a()({mode:i,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},l));m(e)}}),[c.current,f]),(0,h.jsx)("div",{className:"my-codemirror-container",children:(0,h.jsx)("textarea",{ref:c})})}t.Z=function(e){var t=e.callback,n=e.onCancel,i=(0,s.useState)("python"),o=r()(i,2),u=o[0],p=o[1];return(0,h.jsxs)(c.Z,a()(a()({},m),{},{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){t(e)},style:{width:500},children:[(0,h.jsx)(c.Z.Item,{label:"代码语言",name:"language",children:(0,h.jsx)(l.default,{getPopupContainer:function(e){return e.parentNode},onChange:function(e){p(g[e][1])},children:Object.keys(g).map((function(e){return(0,h.jsx)(f,{value:e,children:g[e][0]},e)}))})}),(0,h.jsx)(c.Z.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}],children:(0,h.jsx)(v,{mode:u})}),(0,h.jsxs)("div",{className:"flex-container flex-end",children:[(0,h.jsx)(d.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,h.jsx)(d.ZP,{type:"ghost",onClick:n,children:"取消"})]})]}))}},77162:function(e,t,n){"use strict";n.d(t,{Z:function(){return Ae}});var i=n(91232),a=n.n(i),o=n(79800),r=n.n(o),s=n(85573),l=n.n(s),c=n(59301),d=n(89780),u=n.n(d),p=n(76374),h=(n(49324),n(6313),n(25717),n(99498),n(25419),n(67549),n(36653)),f=n(37712),m=function(e){var t=e.value,n=void 0===t?"":t,i=(e.className,e.showTextOnly,e.showLines,e.style,(0,c.useMemo)((function(){return""}),[n]));return(0,f.jsx)(f.Fragment,{children:(0,f.jsx)("div",{dangerouslySetInnerHTML:{__html:i}})})},g=n(82242),v=n.n(g),w=[{title:"粗体",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"斜体",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"无序列表",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"有序列表",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"行内代码",icon:"md-iconfont icon-code",actionName:"code"},{title:"代码块(多语言风格)",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"链接",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"行内公式",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"数学图像",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"多行公式",icon:"iconfont icon-jisuan1",actionName:"latex"},"|",{title:"添加图片",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"插入画图",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"插入流程图",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"表格",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"换行",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"清空",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function b(e){var t=e.onActionCallback,n=e.title,i=e.icon,a=e.actionName,o=e.className,r=void 0===o?"":o,s=e.children;return(0,f.jsxs)("a",{title:n,className:r,onClick:function(){t(a)},children:[(0,f.jsx)("i",{className:"".concat(i)}),s]})}var y=function(e){var t=e.watch,n=e.showNullButton,i=e.showNullProgramButton,a=e.onActionCallback,o=e.fullScreen,r=e.insertTemp,s=e.hidetoolBar,l=e.extraUse,c=[].concat(w,[{title:"".concat(t?"关闭实时预览":"开启实时预览"),icon:"".concat(t?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"),actionName:"trigger-watch"}]);return(0,f.jsxs)("ul",{className:"markdown-toolbar-container",children:[!s&&c.map((function(e,t){return(0,f.jsx)("li",{children:e.actionName?(0,f.jsx)(b,v()(v()({},e),{},{onActionCallback:a})):(0,f.jsx)("span",{className:"v-line"})},t)})),n?(0,f.jsx)("li",{children:(0,f.jsx)(b,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-null-ch",onActionCallback:a,children:(0,f.jsx)("span",{className:"fill-tip",children:"点击插入\b填空项"})})}):null,i?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("li",{children:(0,f.jsx)(b,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-signal",onActionCallback:a,children:(0,f.jsx)("span",{className:"fill-tip",children:"+单行填空项"})})}),(0,f.jsx)("li",{children:(0,f.jsx)(b,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"增加填空",actionName:"add-multiple",onActionCallback:a,children:(0,f.jsx)("span",{className:"fill-tip",children:"+多行填空项"})})})]}):null,r&&(0,f.jsx)("li",{children:(0,f.jsx)(b,{icon:"md-iconfont icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(r),onActionCallback:a,children:(0,f.jsx)("span",{className:"fill-tip",children:"插入模板"})})}),l&&(0,f.jsx)("li",{children:l}),(0,f.jsx)("li",{className:"btn-full-screen",children:(0,f.jsx)(b,{icon:"".concat(o?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"),title:o?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:a})})]})},x=n(30043),_=n(78241),k=n(98135),C=n(3113),j={labelCol:{span:4},wrapperCol:{span:20}},S=function(e){var t=e.callback,n=e.onCancel;return(0,f.jsxs)(_.Z,v()(v()({},j),{},{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(e){t(e)},style:{width:500},children:[(0,f.jsx)(_.Z.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}],children:(0,f.jsx)(k.Z,{})}),(0,f.jsx)(_.Z.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}],children:(0,f.jsx)(k.Z,{})}),(0,f.jsxs)("div",{className:"flex-container flex-end",children:[(0,f.jsx)(C.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,f.jsx)(C.ZP,{type:"ghost",onClick:n,children:"取消"})]})]}))},A=n(71550),T=n(8591),B=n(53842),N=_.Z.useForm,P={width:280,marginRight:10},E={labelCol:{span:5},wrapperCol:{span:19}},I=function(e){var t=e.callback,n=e.onCancel,i=N(),a=r()(i,1)[0],o=(0,c.useRef)();function s(e,t){-1!==e.status?a.setFieldsValue({src:"/api/attachments/".concat(e.id),type:t.type}):T.ZP.error(e.message)}return(0,f.jsxs)(_.Z,v()(v()({form:a},E),{},{className:"upload-image-panel",onFinish:function(e){t(e,o.current)},style:{width:470,overflow:"hidden"},children:[(0,f.jsx)(_.Z.Item,{label:"图片地址",required:!0,children:(0,f.jsxs)("div",{className:"flex-container",children:[(0,f.jsx)(_.Z.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入图片地址"}],children:(0,f.jsx)(k.Z,{style:P})}),(0,f.jsx)(L,{onFileChange:function(e){var t=e.target.files[0];o.current=t,M(t,s)}})]})}),(0,f.jsx)(_.Z.Item,{label:"图片描述",name:"alt",children:(0,f.jsx)(k.Z,{style:{width:264}})}),(0,f.jsxs)(_.Z.Item,{style:{textAlign:"right"},children:[(0,f.jsx)(C.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,f.jsx)(C.ZP,{type:"default",onClick:n,children:"取消"})]})]}))};function L(e){var t=e.onFileChange;return(0,f.jsxs)("label",{className:"upload-button",style:{cursor:"pointer"},children:["本地上传",(0,f.jsx)("input",{type:"file",onChange:t})]})}function M(e,t){if(!e)throw new String("没有文件");var n=new FormData;n.append("editormd-image-file",e),n.append("file_param_name","editormd-image-file"),n.append("byxhr","true");var i=new window.XMLHttpRequest;i.withCredentials=!0,i.addEventListener("load",(function(n){t(JSON.parse(n.target.responseText),e)}),!1),i.addEventListener("error",(function(e){console.error(e)}),!1),i.open("POST","".concat(B.KI,"/api/attachments.json")),i.send(n)}var Z=n(95237),G=n(87359),D=function(e){var t=e.callback,n=e.onCancel,i=document.createElement("canvas"),a=i.getContext("2d");i.width=1e3,i.height=800,a.fillStyle="#ffffff",a.fillRect(0,0,i.width,i.height);var o=i.toDataURL("image/png");return(0,f.jsx)(Z.Z,{style:{height:"100vh"},children:(0,f.jsx)(G.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:o,visible:!0,title:String(Date.now())},onOk:function(e){t({src:e.url})},onClose:n})})},F=n(7557),R=n.n(F),O=n(41498),z=n.n(O),H=n(37205),W=n.n(H),V=n(12378);function U(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(U,go.CommandHandler),U.prototype.canAlignSelection=function(){var e=this.diagram;return null!==e&&!e.isReadOnly&&!e.isModelReadOnly&&!(e.selection.count<2)},U.prototype.alignLeft=function(){var e=this.diagram;e.startTransaction("aligning left");var t=1/0;e.selection.each((function(e){e instanceof go.Link||(t=Math.min(e.position.x,t))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(t,e.position.y))})),e.commitTransaction("aligning left")},U.prototype.alignRight=function(){var e=this.diagram;e.startTransaction("aligning right");var t=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var n=e.actualBounds.x+e.actualBounds.width;t=Math.max(n,t)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(t-e.actualBounds.width,e.position.y))})),e.commitTransaction("aligning right")},U.prototype.alignTop=function(){var e=this.diagram;e.startTransaction("alignTop");var t=1/0;e.selection.each((function(e){e instanceof go.Link||(t=Math.min(e.position.y,t))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.position.x,t))})),e.commitTransaction("alignTop")},U.prototype.alignBottom=function(){var e=this.diagram;e.startTransaction("aligning bottom");var t=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var n=e.actualBounds.y+e.actualBounds.height;t=Math.max(n,t)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,t-e.actualBounds.height))})),e.commitTransaction("aligning bottom")},U.prototype.alignCenterX=function(){var e=this.diagram,t=e.selection.first();if(t){e.startTransaction("aligning Center X");var n=t.actualBounds.x+t.actualBounds.width/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(n-e.actualBounds.width/2,e.actualBounds.y))})),e.commitTransaction("aligning Center X")}},U.prototype.alignCenterY=function(){var e=this.diagram,t=e.selection.first();if(t){e.startTransaction("aligning Center Y");var n=t.actualBounds.y+t.actualBounds.height/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,n-e.actualBounds.height/2))})),e.commitTransaction("aligning Center Y")}},U.prototype.alignColumn=function(e){var t=this.diagram;t.startTransaction("align Column"),void 0===e&&(e=0),e=parseFloat(e);var n=new Array;t.selection.each((function(e){e instanceof go.Link||n.push(e)}));for(var i=0;i0){for(var i=r.elt(s-1);null!==i&&i.isTreeExpanded&&!i.isTreeLeaf;){i=this._sortTreeChildrenByY(i).last()}null!==i&&e.select(i)}else e.select(o)}else if("Down"===n.key){var a;if(t.isTreeExpanded&&!t.isTreeLeaf)null!==(a=this._sortTreeChildrenByY(t).first())&&e.select(a);else for(;null!==t;){var o,r,s;if(null===(o=t.findTreeParentNode()))break;if((s=(r=this._sortTreeChildrenByY(o)).indexOf(t))i.y?1:n.xi.x?1:0})),t},U.prototype.copyToClipboard=function(e){go.CommandHandler.prototype.copyToClipboard.call(this,e),this._lastPasteOffset.set(this.pasteOffset)},U.prototype.pasteFromClipboard=function(){var e=go.CommandHandler.prototype.pasteFromClipboard.call(this);return this.diagram.moveParts(e,this._lastPasteOffset),this._lastPasteOffset.add(this.pasteOffset),e},Object.defineProperty(U.prototype,"arrowKeyBehavior",{get:function(){return this._arrowKeyBehavior},set:function(e){if("move"!==e&&"select"!==e&&"scroll"!==e&&"tree"!==e&&"none"!==e)throw new Error('DrawCommandHandler.arrowKeyBehavior must be either "move", "select", "scroll", "tree", or "none", not: '+e);this._arrowKeyBehavior=e}}),Object.defineProperty(U.prototype,"pasteOffset",{get:function(){return this._pasteOffset},set:function(e){if(!(e instanceof go.Point))throw new Error("DrawCommandHandler.pasteOffset must be a Point, not: "+e);this._pasteOffset.set(e)}});var K=U,q=(n(79286),n(85160)),Y=n(43418),J=n(43604),Q=n(90694),X="myPaletteDiv___Xjz2I",$="maxH60___Pd4Re";window.go=V;var ee=function(e){var t=e.onCancel,n=e.callback,i=(0,c.useRef)(),a=(0,c.useRef)(),o=(0,c.useRef)(),s=(0,c.useRef)(!1),l=(0,c.useRef)(!1),d=(0,c.useState)(0),u=r()(d,2),p=u[0],h=u[1],m=function(){var e=z()(R()().mark((function e(){var t,a;return R()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.current.makeImage(),e.next=3,(0,Q.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:t.src}});case 3:a=e.sent,n({src:a.url});case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,c.useEffect)((function(){h(p+1)}),[]),(0,f.jsx)("div",{ref:l,className:s.current?"".concat($," body-overflow-initial"):"body-overflow-initial",children:(0,f.jsx)(Y.Z,{width:1200,icon:null,footer:null,closable:!0,visible:!!p,destroyOnClose:!0,maskClosable:!1,getContainer:l.current,rootClassName:"zIndex-9999",title:(0,f.jsxs)(Z.Z,{children:[(0,f.jsx)(J.Z,{flex:1,children:"插入流程图"}),(0,f.jsx)(J.Z,{onClick:function(){s.current=!s.current,h(p+1)},children:(0,f.jsx)("span",{className:"current c-blue mr30",style:{fontWeight:400},children:"展开/收起"})})]}),onCancel:t,children:(0,f.jsxs)("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative"},children:[(0,f.jsxs)("div",{style:{display:"flex",height:"100%"},children:[(0,f.jsxs)("div",{style:{width:"300px",height:"100%"},children:[(0,f.jsx)("div",{style:{background:"#fff",position:"relative",zIndex:12,fontSize:16,color:"#3061d0"},children:"图形库"}),(0,f.jsx)("div",{style:{height:"calc(100% - 50px)"},className:X,ref:o})]}),(0,f.jsxs)("div",{style:{flex:1,position:"relative"},children:[(0,f.jsx)(q.FI,{initDiagram:function(){var e=V.GraphObject.make,t="#ff3333",n="#3358ff",r="#25ad23",s="#d533ff",l="#7d33ff",c="#ff6233",d="#ffffff",u="#000000",p="#fffcd5",h="#d5ebff",f="#f2dfe0",m="#a5d2fa",g="#cccccc",v="#b3e6b3",w="#fcbbbd";function b(t,n){var i=function(e,n){e.handled=!0,e.diagram.model.commit((function(i){var a=n.part.adornedPart,o=(new V.Point).setRectSpot(a.actualBounds,t);o.subtract(a.location),o.scale(2,2),o.x+=130*Math.sign(o.x),o.y+=130*Math.sign(o.y),o.add(a.location),o.snapToGridPoint(e.diagram.grid.gridOrigin,e.diagram.grid.gridCellSize);var r=i.copyNodeData(a.data);i.setGroupKeyForNodeData(r,i.getGroupKeyForNodeData(a.data)),i.addNodeData(r);var s={from:a.key,to:i.getKeyForNodeData(r)};i.addLinkData(s);var l=e.diagram.findNodeForData(r);l.location=o,e.diagram.select(l),setTimeout((function(){e.diagram.commandHandler.editTextBlock()}),20)}))};return e(V.Shape,{figure:n,alignment:t,alignmentFocus:t.opposite(),width:t.equals(V.Spot.Top)||t.equals(V.Spot.Bottom)?25:18,height:t.equals(V.Spot.Top)||t.equals(V.Spot.Bottom)?18:25,fill:"orange",stroke:d,strokeWidth:4,mouseEnter:function(e,t){return t.fill="dodgerblue"},mouseLeave:function(e,t){return t.fill="orange"},isActionable:!0,click:i,contextClick:i})}function y(t){return e(V.Shape,{fill:"orange",stroke:"rgba(0, 0, 0, 0)",strokeWidth:15,background:"transparent",geometryString:"F1 M0 0 b 0 360 -4 0 4 z M10 0 b 0 360 -4 0 4 z M20 0 b 0 360 -4 0 4",isActionable:!0,cursor:"context-menu",mouseEnter:function(e,t){return t.fill="dodgerblue"},mouseLeave:function(e,t){return t.fill="orange"},click:function(e,t){e.diagram.commandHandler.showContextMenu(t.part.adornedPart)}},t||{})}function x(e,t){return function(n,i){n.handled=!0,n.diagram.model.commit((function(n){n.set(i.part.adornedPart.data,e,t)}))}}function _(t,n){return n||(n="color"),e(V.Shape,{width:16,height:16,stroke:"lightgray",fill:t,margin:1,background:"transparent",mouseEnter:function(e,t){return t.stroke="dodgerblue"},mouseLeave:function(e,t){return t.stroke="lightgray"},click:x(n,t),contextClick:x(n,t)})}function k(){return[e("ContextMenuButton",e(V.Panel,"Horizontal",_(d,"fill"),_(p,"fill"),_(h,"fill"),_(f,"fill"))),e("ContextMenuButton",e(V.Panel,"Horizontal",_(g,"fill"),_(v,"fill"),_(m,"fill"),_(w,"fill")))]}function C(){return[e("ContextMenuButton",e(V.Panel,"Horizontal",_(u),_(r),_(n),_(t))),e("ContextMenuButton",e(V.Panel,"Horizontal",_(d),_(s),_(l),_(c)))]}function j(t,n){return n||(n="thickness"),e(V.Shape,"LineH",{width:16,height:16,strokeWidth:t,margin:1,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:x(n,t),contextClick:x(n,t)})}function S(t,n){return n||(n="dash"),e(V.Shape,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:t,margin:1,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:x(n,t),contextClick:x(n,t)})}function A(){return[e("ContextMenuButton",e(V.Panel,"Horizontal",j(1),j(2),j(3),j(4))),e("ContextMenuButton",e(V.Panel,"Horizontal",S(null),S([2,4]),S([4,4])))]}function T(t,n){return n||(n="figure"),e(V.Shape,{width:32,height:32,scale:.5,fill:"lightgray",figure:t,margin:1,background:"transparent",mouseEnter:function(e,t){return t.fill="dodgerblue"},mouseLeave:function(e,t){return t.fill="lightgray"},click:x(n,t),contextClick:x(n,t)})}function B(t){return e(V.Shape,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(t+4).toString()+" H3"})}function N(t){var n="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return 0===t?n="M0 0 M16 16 M0 8 L16 8":2===t&&(n="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),e(V.Shape,{geometryString:n,margin:2,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:x("dir",t),contextClick:x("dir",t)})}function P(t){var n=function(e,n){e.handled=!0,e.diagram.model.commit((function(e){var i=n.part.adornedPart;e.set(i.data,t?"toSpot":"fromSpot",V.Spot.stringify(V.Spot.AllSides)),(t?i.toNode:i.fromNode).invalidateConnectedLinks()}))};return e(V.Shape,{width:12,height:12,fill:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:n,contextClick:n})}function E(t,n){var i=0,a=V.Spot.RightSide;t.equals(V.Spot.Top)?(i=270,a=V.Spot.TopSide):t.equals(V.Spot.Left)?(i=180,a=V.Spot.LeftSide):t.equals(V.Spot.Bottom)&&(i=90,a=V.Spot.BottomSide),n||(i-=180);var o=function(e,t){e.handled=!0,e.diagram.model.commit((function(e){var i=t.part.adornedPart;e.set(i.data,n?"toSpot":"fromSpot",V.Spot.stringify(a)),(n?i.toNode:i.fromNode).invalidateConnectedLinks()}))};return e(V.Shape,{alignment:t,alignmentFocus:t.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:i,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:o,contextClick:o})}return i.current=new V.Diagram(a.current,{padding:20,grid:e(V.Panel,"Grid",e(V.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(V.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),"draggingTool.isGridSnapEnabled":!0,handlesDragDropForTopLevelParts:!0,mouseDrop:function(e){e.diagram.commandHandler.addTopLevelParts(e.diagram.selection,!0)||e.diagram.currentTool.doCancel()},commandHandler:e(K),"clickCreatingTool.archetypeNodeData":{text:"未命名",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:function(e){var t=e.subject;t.location=t.location.copy().snapToGridPoint(e.diagram.grid.gridOrigin,e.diagram.grid.gridCellSize),setTimeout((function(){e.diagram.commandHandler.editTextBlock()}),20)},"commandHandler.archetypeGroupData":{isGroup:!0,text:"NEW GROUP"},SelectionGrouped:function(e){e.subject;setTimeout((function(){e.diagram.commandHandler.editTextBlock()}))},LinkRelinked:function(e){e.parameter.part.invalidateConnectedLinks();var t=e.subject;e.diagram.toolManager.linkingTool.isForwards?t.toNode.invalidateConnectedLinks():t.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),i.current.nodeTemplate=e(V.Node,"Auto",{locationSpot:V.Spot.Center,locationObjectName:"SHAPE",desiredSize:new V.Size(120,60),minSize:new V.Size(40,40),resizable:!0,resizeCellSize:new V.Size(10,10),rotatable:!0},new V.Binding("location","loc",V.Point.parse).makeTwoWay(V.Point.stringify),new V.Binding("desiredSize","size",V.Size.parse).makeTwoWay(V.Size.stringify),e(V.Shape,{name:"SHAPE",fill:d,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:V.Spot.AllSides,toSpot:V.Spot.AllSides},new V.Binding("figure"),new V.Binding("fill"),new V.Binding("stroke","borderColor"),new V.Binding("strokeWidth","thickness"),new V.Binding("strokeDashArray","dash")),e(V.Shape,{width:100,height:20,strokeWidth:0,fill:"transparent"}),e(V.TextBlock,{margin:1,textAlign:"center",overflow:V.TextBlock.OverflowEllipsis,editable:!0},new V.Binding("text").makeTwoWay(),new V.Binding("stroke","color"))),i.current.nodeTemplate.toolTip=e("ToolTip",e(V.Panel,"Vertical",{maxSize:new V.Size(200,NaN)},e(V.TextBlock,{font:"bold 10pt sans-serif",textAlign:"center"},new V.Binding("text")),e(V.TextBlock,{font:"10pt sans-serif",textAlign:"center"},new V.Binding("text","details")))),i.current.nodeTemplate.selectionAdornmentTemplate=e(V.Adornment,"Spot",e(V.Placeholder,{padding:10}),b(V.Spot.Top,"TriangleUp"),b(V.Spot.Left,"TriangleLeft"),b(V.Spot.Right,"TriangleRight"),b(V.Spot.Bottom,"TriangleDown"),y({alignment:new V.Spot(.75,0)})),i.current.nodeTemplate.contextMenu=e("ContextMenu",e("ContextMenuButton",e(V.Panel,"Horizontal",T("Rectangle"),T("RoundedRectangle"),T("Ellipse"),T("Diamond"))),e("ContextMenuButton",e(V.Panel,"Horizontal",T("Parallelogram2"),T("ManualOperation"),T("Procedure"),T("Cylinder1"))),e("ContextMenuButton",e(V.Panel,"Horizontal",T("Terminator"),T("CreateRequest"),T("Document"),T("TriangleDown"))),k(),C(),A()),i.current.groupTemplate=e(V.Group,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:V.Spot.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:function(e,t){t.addMembers(t.diagram.selection,!0)||t.diagram.currentTool.doCancel()},avoidable:!1},new V.Binding("location","loc",V.Point.parse).makeTwoWay(V.Point.stringify),e(V.Panel,"Auto",{name:"BODY"},e(V.Shape,{parameter1:10,fill:d,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:V.Spot.AllSides,toSpot:V.Spot.AllSides},new V.Binding("fill"),new V.Binding("stroke","color"),new V.Binding("strokeWidth","thickness"),new V.Binding("strokeDashArray","dash")),e(V.Placeholder,{background:"transparent",margin:20})),e(V.TextBlock,{alignment:V.Spot.Top,alignmentFocus:V.Spot.Bottom,font:"bold 12pt sans-serif",editable:!0},new V.Binding("text"),new V.Binding("stroke","color"))),i.current.groupTemplate.selectionAdornmentTemplate=e(V.Adornment,"Spot",e(V.Panel,"Auto",e(V.Shape,{fill:null,stroke:"dodgerblue",strokeWidth:3}),e(V.Placeholder,{margin:1.5})),y({alignment:V.Spot.TopRight,alignmentFocus:V.Spot.BottomRight})),i.current.groupTemplate.contextMenu=e("ContextMenu",k(),C(),A()),i.current.linkTemplate=e(V.Link,{layerName:"Foreground",routing:V.Link.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new V.Binding("fromSpot","fromSpot",V.Spot.parse),new V.Binding("toSpot","toSpot",V.Spot.parse),new V.Binding("fromShortLength","dir",(function(e){return e>=1?10:0})),new V.Binding("toShortLength","dir",(function(e){return e>=1?10:0})),new V.Binding("points").makeTwoWay(),e(V.Shape,{strokeWidth:2},new V.Binding("stroke","color"),new V.Binding("strokeWidth","thickness"),new V.Binding("strokeDashArray","dash")),e(V.Shape,{segmentIndex:0,segmentOffset:new V.Point(15,0),segmentOrientation:V.Link.OrientAlong,alignmentFocus:V.Spot.Right,figure:"circle",width:10,strokeWidth:0},new V.Binding("fill","color"),new V.Binding("visible","dir",(function(e){return 1===e}))),e(V.Shape,{segmentIndex:-1,segmentOffset:new V.Point(-10,6),segmentOrientation:V.Link.OrientPlus90,alignmentFocus:V.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new V.Binding("fill","color"),new V.Binding("visible","dir",(function(e){return e>=1})),new V.Binding("width","thickness",(function(e){return 7+3*e})),new V.Binding("height","thickness",(function(e){return 7+3*e})),new V.Binding("segmentOffset","thickness",(function(e){return new V.Point(-15,4+1.5*e)}))),e(V.Shape,{segmentIndex:0,segmentOffset:new V.Point(15,-6),segmentOrientation:V.Link.OrientMinus90,alignmentFocus:V.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new V.Binding("fill","color"),new V.Binding("visible","dir",(function(e){return 2===e})),new V.Binding("width","thickness",(function(e){return 7+3*e})),new V.Binding("height","thickness",(function(e){return 7+3*e})),new V.Binding("segmentOffset","thickness",(function(e){return new V.Point(-15,4+1.5*e)}))),e(V.TextBlock,{alignmentFocus:new V.Spot(0,1,-4,0),editable:!0},new V.Binding("text").makeTwoWay(),new V.Binding("stroke","color"))),i.current.linkTemplate.selectionAdornmentTemplate=e(V.Adornment,e(V.Shape,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:B(2)},new V.Binding("pathPattern","thickness",B)),y({alignmentFocus:new V.Spot(0,0,-6,-4)})),i.current.linkTemplate.contextMenu=e("ContextMenu",C(),A(),e("ContextMenuButton",e(V.Panel,"Horizontal",N(0),N(1),N(2))),e("ContextMenuButton",e(V.Panel,"Horizontal",e(V.Panel,"Spot",P(!1),E(V.Spot.Top,!1),E(V.Spot.Left,!1),E(V.Spot.Right,!1),E(V.Spot.Bottom,!1)),e(V.Panel,"Spot",{margin:new V.Margin(0,0,0,2)},P(!0),E(V.Spot.Top,!0),E(V.Spot.Left,!0),E(V.Spot.Right,!0),E(V.Spot.Bottom,!0))))),new V.Palette(o.current,{maxSelectionCount:1,linkTemplate:e(V.Link,{locationSpot:V.Spot.Center,selectionAdornmentTemplate:e(V.Adornment,"Link",{locationSpot:V.Spot.Center},e(V.Shape,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),e(V.Shape,{toArrow:"Standard",stroke:null}))},{routing:V.Link.AvoidsNodes,curve:V.Link.JumpOver,corner:5,toShortLength:4},new V.Binding("points"),e(V.Shape,{isPanelMain:!0,strokeWidth:2}),e(V.Shape,{toArrow:"Standard",stroke:null})),model:new V.GraphLinksModel([{text:"未命名",size:"100 100",fill:null,stroke:"#000"}].concat(W()(V.Shape.getFigureGenerators().toArray().map((function(e){return{text:"未命名",size:"100 100",figure:e.key,fill:"white",stroke:"#666",borderColor:"#000"}})))))}).nodeTemplate=e(V.Node,"Auto",{locationSpot:V.Spot.Center},new V.Binding("location","location",V.Point.parse).makeTwoWay(V.Point.stringify),e(V.Shape,"Circle",{fill:"white",stroke:"gray",strokeWidth:2,width:20,height:20,portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromLinkableSelfNode:!0,toLinkableSelfNode:!0},new V.Binding("stroke").makeTwoWay(),new V.Binding("fill").makeTwoWay(),new V.Binding("figure")),e(V.TextBlock,{margin:new V.Margin(5,5,3,5),font:"10pt sans-serif",minSize:new V.Size(16,16),maxSize:new V.Size(10,NaN),textAlign:"center",editable:!0},new V.Binding("key").makeTwoWay())),setTimeout((function(){i.current.grid=e(V.Panel,"Grid",e(V.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(V.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),i.current.grid.visible=!0,i.current.grid.gridCellStroke="darkgray",i.current.grid.gridCellStrokeWidth=1}),300),window.myDiagrams=i.current,i.current},divClassName:"diagram-component",style:{height:"80vh"}}),(0,f.jsx)("div",{ref:a})]})]}),(0,f.jsx)("div",{className:"tr",children:(0,f.jsx)(C.ZP,{size:"large",onClick:m,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary",children:"保存到编辑器"})})]})})})},te=n(5112),ne=n(54449),ie=te.ZP.Group,ae={margin:"0 8px"},oe=function(e){var t=e.callback,n=e.onCancel;return(0,f.jsxs)(_.Z,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(e){t(e)},children:[(0,f.jsxs)("div",{className:"flex-container",style:{alignItems:"baseline"},children:[(0,f.jsx)("span",{style:ae,children:"单元格数:"}),(0,f.jsx)("span",{style:ae,children:"行数"}),(0,f.jsx)(_.Z.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}],children:(0,f.jsx)(ne.Z,{})}),(0,f.jsx)("span",{style:ae,children:"列数"}),(0,f.jsx)(_.Z.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}],children:(0,f.jsx)(ne.Z,{})})]}),(0,f.jsxs)("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"},children:[(0,f.jsx)("span",{style:ae,children:"对齐方式:"}),(0,f.jsx)(_.Z.Item,{name:"align",children:(0,f.jsxs)(ie,{children:[(0,f.jsx)(te.ZP,{value:"default",children:(0,f.jsx)("i",{className:"fa fa-align-justify"})}),(0,f.jsx)(te.ZP,{value:"left",children:(0,f.jsx)("i",{className:"fa fa-align-left"})}),(0,f.jsx)(te.ZP,{value:"center",children:(0,f.jsx)("i",{className:"fa fa-align-center"})}),(0,f.jsx)(te.ZP,{value:"right",children:(0,f.jsx)("i",{className:"fa fa-align-right"})})]})})]}),(0,f.jsxs)("div",{className:"flex-container flex-end",children:[(0,f.jsx)(C.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,f.jsx)(C.ZP,{type:"ghost",onClick:n,children:"取消"})]})]})},re=n(78673),se=n(35575),le=n.n(se),ce=(0,c.forwardRef)((function(e,t){var n=e.use3d,i=e.width,a=e.height,o=e.callback,s=(e.showSaveButton,(0,c.useRef)()),l=(0,c.useRef)(),d=(0,c.useState)(!1),u=r()(d,2),p=u[0],h=u[1],m=(0,c.useRef)({id:s,appName:"graphing",width:i||1e3,height:a||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,c.useEffect)((function(){l.current=new(le())(m.current,!0),window.onload=function(){l.current.inject("applet_container")}}),[]);var g=function(){var e=window.ggbApplet.getPNGBase64(1,!0,72);return o&&o(e),e};return(0,c.useEffect)((function(){m.current.appName=p?"3D":"graphing",l.current.inject("applet_container")}),[p]),(0,c.useEffect)((function(){h(n)}),[n]),(0,c.useImperativeHandle)(t,(function(){return{getImgData:g}})),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:s}),(0,f.jsxs)(Z.Z,{align:"middle",children:[(0,f.jsx)(J.Z,{flex:1,children:(0,f.jsx)(re.Z,{size:"default",checkedChildren:"关闭3D图像",unCheckedChildren:"开启3D图像",checked:p,onChange:function(e){return h(e)}})}),(0,f.jsx)(J.Z,{children:(0,f.jsx)(C.ZP,{size:"large",onClick:g,style:{zIndex:8,marginTop:10},type:"primary",children:"保存到编辑器"})})]})]})})),de=n(42594),ue=n(57357),pe="link",he="upload-image",fe="add-flowchart",me="draw-image",ge="code-block",ve="add-table",we="------------",be={default:we,left:":".concat(we),center:":".concat(we,":"),right:"".concat(we,":")},ye=n(40238);var xe="@▁▁@",_e=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"];function ke(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var Ce=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",je=l()(l()({},Ce+"-B","bold"),Ce+"-I","italic"),Se=l()(l()(l()(l()(l()(l()(l()(l()({},pe,"添加链接"),ge,"添加代码块"),he,"添加图片"),me,"添加画图"),fe,"插入流程图"),ve,"添加表格"),"maths-latex","数学图像"),"inline-latex","LATEX公式"),Ae=function(e){var t=e.defaultValue,n=void 0===t?"":t,i=e.onChange,o=e.width,s=void 0===o?"100%":o,d=e.height,g=void 0===d?400:d,v=e.miniToolbar,w=void 0!==v&&v,b=e.isFocus,_=void 0!==b&&b,k=e.watch,C=e.insertTemp,j=e.mode,B=void 0===j?"markdown":j,N=e.id,P=void 0===N?"markdown-editor-id":N,E=e.showResizeBar,L=void 0!==E&&E,Z=e.noStorage,G=void 0!==Z&&Z,F=e.showNullButton,R=void 0!==F&&F,O=e.showNullProgramButton,z=void 0!==O&&O,H=e.hidetoolBar,W=void 0!==H&&H,V=e.fullScreen,U=void 0!==V&&V,K=e.onBlur,q=e.onCMBeforeChange,J=e.onFullScreen,Q=e.className,X=void 0===Q?"":Q,$=e.disablePaste,te=void 0!==$&&$,ne=e.disabled,ie=void 0!==ne&&ne,ae=e.disabledFill,re=void 0!==ae&&ae,se=e.placeholder,le=void 0===se?"":se,we=e.values,Ce=void 0===we?"":we,Ae=e.extraUse,Te=(0,c.useState)(null),Be=r()(Te,2),Ne=Be[0],Pe=Be[1],Ee=(0,c.useState)(n),Ie=r()(Ee,2),Le=Ie[0],Me=Ie[1],Ze=(0,c.useState)(k),Ge=r()(Ze,2),De=Ge[0],Fe=Ge[1],Re=(0,c.useState)(U),Oe=r()(Re,2),ze=Oe[0],He=Oe[1],We=(0,c.useState)(""),Ve=r()(We,2),Ue=Ve[0],Ke=Ve[1],qe=(0,c.useState)(0),Ye=r()(qe,2),Je=Ye[0],Qe=Ye[1],Xe=(0,c.useState)(g),$e=r()(Xe,2),et=$e[0],tt=$e[1],nt=(0,c.useState)(!1),it=r()(nt,2),at=(it[0],it[1]),ot=(0,c.useState)(0),rt=r()(ot,2),st=rt[0],lt=rt[1],ct=(0,c.useState)(0),dt=r()(ct,2),ut=dt[0],pt=dt[1],ht=(0,c.useRef)(),ft=(0,c.useRef)(),mt=(0,c.useRef)(),gt=(0,c.useRef)();(0,c.useEffect)((function(){var e=window.scrollY||window.pageYOffset;Me(Ce),null==Ne||Ne.setValue(Ce),window.scrollTo(0,e)}),[Ce]),(0,c.useEffect)((function(){null==J||J(ze)}),[ze]),(0,c.useEffect)((function(){if(ht.current){var e=function(e,n){if(!te){var i=n.clipboardData;if(i){var a=i.types.toString(),o=i.items;if("Files"===a||i.types.indexOf("Files")>-1){if(n.preventDefault(),"stex"==B)return;try{var r,s=o[1];"file"===(null===(r=o[0])||void 0===r?void 0:r.kind)&&(s=o[0]);var l=s.getAsFile(),c=l.name.split(".").pop();M(l,(function(e){var n,i,a;e.id?(null==l||null===(n=l.type)||void 0===n?void 0:n.indexOf("image"))>-1?t.replaceSelection("![,](/api/attachments/".concat(e.id,"?type=").concat(e.content_type,")")):(null==l||null===(i=l.type)||void 0===i?void 0:i.indexOf("video"))>-1?t.replaceSelection('')):(null==l||null===(a=l.type)||void 0===a?void 0:a.indexOf("pdf"))>-1?t.replaceSelection('').concat(l.name,"")):_e.includes(c)?t.replaceSelection('').concat(l.name,"")):t.replaceSelection("[".concat(l.name,"](").concat(ue.Z.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}))}catch(n){T.ZP.warning("请使用chrome浏览器粘贴")}return!0}return!0}return!0}n.preventDefault()},t=u().fromTextArea(ht.current,{mode:B,lineNumbers:!w,lineWrapping:!0,value:n,autoCloseTags:!0,autoCloseBrackets:!0});return t.on("keyup",(function(e,n){8===n.keyCode&&(""==e.getValue()?t.setOption("placeholder",le):t.setOption("placeholder",null))})),t.on("keydown",(function(e,t){if(8===t.keyCode){var n=function(e,t){var n=e.getDoc(),i=n.getCursor(),a=n.getLine(i.line),o=a.charAt(i.ch-1),r=a.lastIndexOf("@▁@",i.ch),s=a.lastIndexOf("@▁▁@",i.ch),l=r>s?r:s,c=r>s?3:4;if(-1===xe.indexOf(o))return null;if(console.log("change1:",t,e,a,i,l,r,s,o),l>=0&&i.ch-l<5){var d=l+c;return n.replaceRange("",{line:i.line,ch:l},{line:i.line,ch:d}),{line:i.line,ch:d}}return null}(e);n&&t.preventDefault()}})),_&&t.focus(),t.on("paste",e),ie&&t.on("beforeChange",(function(e,t){"paste"!==t.origin&&"+input"!==t.origin||t.cancel()})),Pe(t),function(){t.off("paste",e)}}}),[]);var vt=(0,c.useCallback)((function(){ft.current}),[et,ft,ze]);(0,c.useEffect)((function(){if(Ne){var e=function(){var e=new p.Z((function(e){var t,n=a()(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&(vt(),Ne.setSize("100%","100%"),Ne.refresh())}}catch(e){n.e(e)}finally{n.f()}}));return e.observe(ht.current.parentElement),e}();return function(){var t,n;null!==(t=ht.current)&&void 0!==t&&t.parentElement&&e.unobserve(null===(n=ht.current)||void 0===n?void 0:n.parentElement)}}}),[Ne,vt]),(0,c.useEffect)((function(){if(Ne){for(var e=[],t=function(){var t=r()(i[n],2),a=t[0],o=t[1],s=l()({},a,(function(){wt(o)}));e.push(s),Ne.addKeyMap(s)},n=0,i=Object.entries(je);n0){var e=(new Date).getTime(),t=window.sessionStorage.getItem(P);e>=Je+1e4&&(!t||t!==Le)&&(window.sessionStorage.setItem(P,Le),at(!0))}}),1e4),(0,c.useEffect)((function(){Fe(k)}),[Ne,k]),(0,c.useEffect)((function(){Ne&&_&&Ne.focus()}),[Ne,_]),(0,c.useEffect)((function(){if(De&&Ne){var e=function(e){var t=e.target;if(gt.current){var n=t.scrollTop/t.scrollHeight;gt.current.scrollTop=gt.current.scrollHeight*n}},t=Ne.getScrollerElement();return t.addEventListener("scroll",e),function(){t.removeEventListener("scroll",e)}}}),[Ne,De]),(0,c.useEffect)((function(){if(Ne&&q){var e=function(e,t){q(e,t)};return Ne.on("beforeChange",e),function(){Ne.off("beforeChange",e)}}}),[Ne,q]),(0,c.useEffect)((function(){if(Ne&&K){var e=function(){K(Ne.getValue())};return Ne.on("blur",e),function(){Ne.off("blur",e)}}}),[Ne,K]),(0,c.useEffect)((function(){if(Ne){var e=function(e,t){var n=e.getValue();Me(n),Qe((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),i&&(z?i(n,kt(n)):i(n))};return Ne.on("change",e),function(){Ne.off("change",e)}}}),[Ne,i]),(0,c.useEffect)((function(){if(Ne)if(null==n)Ne.setValue(""),Me("");else{var e=window.scrollY||window.pageYOffset;n!==Ne.getValue()&&(Ne.setValue(n),Me(n),Ne.setCursor(ie?1:Ne.lineCount(),0),window.scrollTo(0,e))}}),[Ne,n]);var wt=(0,c.useCallback)((function(e){var t=Ne.getCursor(),n=Ne.getSelection(),i=n.split("\n");switch(e){case"bold":return Ne.replaceSelection("**"+n+"**"),""===n&&Ne.setCursor(t.line,t.ch+2),Ne.focus();case"italic":return Ne.replaceSelection("*"+n+"*"),""===n&&Ne.setCursor(t.line,t.ch+1),Ne.focus();case"code":return Ne.replaceSelection("`"+n+"`"),""===n&&Ne.setCursor(t.line,t.ch+1),Ne.focus();case"inline-latex":return Ke("inline-latex"),Ne.focus();case"latex":return Ne.replaceSelection("```latex\n"+n+"\n```"),Ne.setCursor(t.line+1,n.length+1),Ne.focus();case"line-break":return Ne.replaceSelection("
\n"),Ne.focus();case"list-ul":return""===n?Ne.replaceSelection("- "+n):Ne.replaceSelection(i.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),Ne.focus();case"list-ol":return""===n?Ne.replaceSelection("1. "+n):Ne.replaceSelection(i.map((function(e,t){return""===e?"":"".concat(t+1,". ").concat(e)})).join("\n")),Ne.focus();case"add-null-ch":return""===n&&Ne.setCursor(t.line,t.ch),Ne.replaceSelection("▁"),Ne.focus();case"add-signal":return""===n&&Ne.setCursor(t.line,t.ch),Ne.replaceSelection("@▁@"),Ne.focus();case"add-multiple":return""===n&&Ne.setCursor(t.line,t.ch),Ne.replaceSelection(xe),Ne.focus();case"inster-template-1":return""===n&&Ne.setCursor(t.line,t.ch),Ne.replaceSelection("\n**模板标题**\n模板正文内容,可输入文本内容和粘贴图片等操作"),Ne.focus();case"eraser":return Ne.setValue(""),Ne.focus();case"trigger-watch":return Fe(!De),Ne.focus();case"trigger-full-screen":return He(!ze),Ne.focus();case pe:return void Ke(pe);case ge:return void Ke(ge);case he:return void Ke(he);case me:return void Ke(me);case"maths-latex":return void Ke("maths-latex");case fe:return void Ke(fe);case ve:return void Ke(ve);default:throw new Error}}),[Ne,De,ze]),bt=(0,c.useCallback)((function(e,t){var n,i,a,o,r;switch(Ke(""),Ue){case pe:var s=e.title,l=e.link;return Ne.replaceSelection("[".concat(s,"](").concat(l,")")),Ne.focus();case ge:var c=e.language,d=e.content;return Ne.replaceSelection(["```"+c,d,"```"].join("\n")),Ne.focus();case"maths-latex":for(var u=atob(e),p=new Uint8Array(u.length),h=0;h-1||null==g||!g.type?m?Ne.replaceSelection("![ ".concat(m," ]( ").concat(f,' "').concat(m,'" )')):Ne.replaceSelection("![,](".concat(f,")")):(null==g||null===(o=g.type)||void 0===o?void 0:o.indexOf("video"))>-1?Ne.replaceSelection('')):(null==g||null===(r=g.type)||void 0===r?void 0:r.indexOf("pdf"))>-1?Ne.replaceSelection('').concat(g.name,"")):_e.includes(v)?Ne.replaceSelection('').concat(g.name,"")):Ne.replaceSelection("[".concat(g.name,"](").concat(ue.Z.API_SERVER).concat(f,")")),Ne.focus();case ve:for(var w=e.row,b=e.col,y=e.align,x="\n",_=0;_300&&(t=300),tt(g+t+"px")}},i=mt.current,a=!1,o=0;return i.addEventListener("mousedown",e),document.addEventListener("mousemove",n),document.addEventListener("mouseup",t),function(){i.removeEventListener("mousedown",e),document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",t)}}}),[Ne,mt]),(0,c.useEffect)((function(){tt(g)}),[g]);var _t={width:ke(s),height:ke(et)},kt=((0,c.useMemo)((function(){if(Je){var e=new Date(Je),t=e.getHours(),n=e.getMinutes(),i=e.getSeconds();return n=n<10?"0"+n:n,i=i<10?"0"+i:i,"".concat(t=t<10?"0"+t:t,":").concat(n,":").concat(i)}return 0}),[Je]),function(e){var t=[];if(z){e=e.replace(/(@▁▁@|@▁@)/g,(function(e,n,i){t.push({multiLine:!("@▁@"===e)})}))}return t});(0,c.useEffect)((function(){if(Se[Ue]&&Ue!==me&&Ue!==fe){var e=document.getElementsByClassName("ant-modal")[0],t=window.innerWidth/2-e.offsetWidth/2,n=window.innerHeight/2-e.offsetHeight/2;lt(t),pt(n)}}),[Ue]);var Ct=function(e,t,n,i){var a=document.body.clientHeight,o=document.body.clientWidth;return!(e<20&&n>e||e>o-20&&nt||t>a-20&&i0&&(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)(K.Z,{className:g.add,onClick:function(e){ye(e),x()}}),(0,ee.jsx)(U.Z,{okText:"确定",cancelText:"取消",title:"确定删除测试集"+(t+1),onCancel:ye,onConfirm:function(e){ye(e),C(t)},children:(0,ee.jsx)(q.Z,{className:"".concat(g.remove," ml20"),onClick:ye})})]})})]})})]}),children:[(0,ee.jsx)(v.Z.Item,{label:"输入",labelCol:{span:24},name:[e.name,"input"],children:(0,ee.jsx)(te,{rows:4})}),(0,ee.jsx)(v.Z.Item,{label:"输出",labelCol:{span:24},name:[e.name,"output"],rules:[{required:!0,message:"请输入输出内容"}],children:(0,ee.jsx)(te,{rows:4})})]},e.key)}))})}}),(0,ee.jsx)("div",{style:{display:me?"block":"none"}}),(0,ee.jsx)(X.ZP,{rootIdentifier:null,visible:we,onClose:function(){return be(!1)},onOK:function(e){if(null!=e&&e.length){if(null!=e&&e[0].is_file){E(e,!0)();var t=A.concat(e);d.test_set_average?B(t):T(t)}null!=e&&e[0].is_file||E(e)}},multiple:!0,defaultMultipleValue:null==d?void 0:d.is_file})]})},ae=n(89392),oe=n(88289);function re(){return(new Date).getTime()}var se={loading:!0,user:null,disciplines:[],dicts:null,status:0,data:void 0,lastedUpdateTime:0},le=function(e){return e[e.SET_INITAL_DATA=0]="SET_INITAL_DATA",e[e.SET_LOADING=1]="SET_LOADING",e[e.SET_STATUS=2]="SET_STATUS",e}({});function ce(e,t){switch(t.type){case le.SET_INITAL_DATA:return f()(f()({},e),t.payload);case le.SET_LOADING:return f()(f()({},e),{},{loading:t.payload});case le.SET_STATUS:return f()(f()({},e),{},{status:t.payload});default:throw new Error}}var de=function(){var e,t,n=(0,C.useSearchParams)(),i=p()(n,1)[0],o=(0,C.useParams)().id,s=v.Z.useForm(),c=p()(s,1)[0],u=(0,m.useState)(),h=p()(u,2),M=h[0],Z=h[1],G=(0,m.useState)([]),D=p()(G,2),F=D[0],R=D[1],O=(0,m.useState)([]),z=p()(O,2),H=z[0],W=z[1],V=(0,m.useReducer)(ce,se),U=p()(V,2),K=U[0],q=U[1],Y=K.loading,J=K.data,Q=K.user,X=K.disciplines,$=K.dicts,te=K.status,ne=null==J?void 0:J.hack_sets,de=null==J||null===(e=J.hack)||void 0===e?void 0:e.test_set_average,ue=(0,P.oP)(),pe=ue.callback_url,he=ue.express_id,fe=ue.score,me=ue.question_id,ge=ue.type,ve=(0,m.useState)([]),we=p()(ve,2),be=we[0],ye=we[1],xe=(0,m.useState)(!1),_e=p()(xe,2),ke=_e[0],Ce=_e[1],je=(0,m.useState)(!1),Se=p()(je,2),Ae=Se[0],Te=Se[1],Be=(0,m.useState)(),Ne=p()(Be,2),Pe=Ne[0],Ee=Ne[1],Ie=(0,m.useState)(!1),Le=p()(Ie,2),Me=Le[0],Ze=Le[1],Ge="1"===ge,De=(0,m.useMemo)((function(){var e=[];return X&&(0,k.D0)(X,e),e}),[X]),Fe=(0,m.useCallback)(d()(l()().mark((function e(){var t,n,i,a,r,s,d,u,h,m,g,v,w,b,y,x,_,C,A,T,B,N,E,I,L,M,G,D,F,R,O,z,H,V,U,K,Y,J,Q,$,ee,te,ne,ie,ae,oe,re,se,ce,de,ue,pe,he,me,ge,ve,we,be,ye,xe,_e,ke=arguments;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=ke.length>0&&void 0!==ke[0]?ke[0]:0,0!==(n=X).length){e.next=7;break}return e.next=5,(0,S.d1)("new_question");case 5:i=e.sent,n=i.disciplines;case 7:if(!o){e.next=15;break}return a={disciplines:n},e.next=11,(0,S.fu)(o);case 11:(r=e.sent).message?"401"===r.status&&(document.location.href="/user/login"):(u=r.category,h=r.user,m=r.code,g=r.language,v=r.hack_sets,w=r.description,b=r.difficult,y=r.name,x=r.open_or_not,_=r.discipline_id,C=r.sub_discipline_id,r.tag_discipline_id,A=r.analysis,T=r.time_limit,B=r.test_set_average,N=r.test_set_score,E=r.status,I=r.tag_discipline_ids,L=r.item_banks_group_id,M=r.is_file,G=void 0!==M&&M,D=r.hide_actual_output,F=r.code_compile_score,R=r.languages,O=r.is_my,z=r.codes,H=r.answer_text,V=r.submit_rule,U=r.show_case,K=(0,k.y3)(n,C),Y=p()(K,2),J=Y[0],Q=Y[1],J=[_,C],$=G?[{input:"",output:"",score:100,position:1}]:v,G?(W(v),c.setFieldsValue({hack_sets:$})):W([]),ee=(0,P.oP)(),te=ee.lastedUpdateTime,ne=null==z?void 0:z.map((function(e){return f()(f()({},e),{},{code:j.Base64.decode(null==e?void 0:e.code)})})),a=f()(f()({},a),{},{loading:!1,user:h,dicts:Q,status:E,lastedUpdateTime:t||(te||0),data:{hack_codes:{language:g,code:j.Base64.decode(m)},hack:{category:u,difficult:b,name:y,description:w,open_or_not:x,time_limit:T,test_set_average:B,test_set_score:N,sub_discipline_id:J,tag_discipline_ids:I,languages:R,score:fe||1,item_banks_group_ids:L,is_file:G,is_my:O,code_compile_score:F,hide_actual_output:D,show_case:U,analysis:A,answer_text:H,submit_rule:V},hack_sets:$,tags:I,codes:ne}}),parseInt(F)>0&&Ce(!0),q({type:le.SET_INITAL_DATA,payload:a}),Z({hack:{category:u,difficult:b,name:y,description:w,open_or_not:x,time_limit:T,test_set_average:B,test_set_score:N,sub_discipline_id:J,tag_discipline_ids:I,score:fe||1,item_banks_group_ids:L,is_file:G,analysis:A,answer_text:H},codes:ne}),Re(null===(s=J)||void 0===s?void 0:s[0],null===(d=J)||void 0===d?void 0:d[1],n)),e.next=27;break;case 15:return e.next=17,(0,S.PR)();case 17:se=e.sent,ce=se.user,de=(0,P.oP)(),ue=de.discipline_id,pe=de.sub_discipline_id,he=de.tag_discipline_id,me=de.tagIds,ge=de.banksIds,ve=2,we=(0,k.y3)(n,parseInt(pe,10)),be=p()(we,2),ye=be[0],xe=be[1],ye=[ue,pe],_e=[Number(ge||0)],q({type:le.SET_INITAL_DATA,payload:{loading:!1,user:ce,disciplines:n,status:0,dicts:xe,data:{hack_codes:{language:"C",code:""},hack:{category:null,difficult:ve,time_limit:3,description:"",test_set_score:!0,test_set_average:!0,open_or_not:!0,sub_discipline_id:[],tag_discipline_id:me&&(null==me||null===(ie=me.split(","))||void 0===ie?void 0:ie.map((function(e){return Number(e)}))),name:"",item_banks_group_ids:_e,is_file:!1,answer_text:"",submit_rule:1},tags:he?null==he?void 0:he.split(",").map((function(e){return parseInt(e,10)})):[],hack_sets:[{input:"",output:"",score:100,position:1}]}}}),Z({hack:{category:null,difficult:ve,time_limit:3,description:"",test_set_average:!0,open_or_not:!0,sub_discipline_id:[],tag_discipline_id:me&&(null==me||null===(ae=me.split(","))||void 0===ae?void 0:ae.map((function(e){return Number(e)}))),name:"",item_banks_group_id:_e,is_file:!1,answer_text:""}}),Re(null===(oe=ye)||void 0===oe?void 0:oe[0],null===(re=ye)||void 0===re?void 0:re[1],n);case 27:case"end":return e.stop()}}),e)}))),[o,X]);(0,m.useEffect)((function(){try{Fe()}catch(e){console.log(e,"----")}}),[]),(0,m.useEffect)((function(){function e(){return e=d()(l()().mark((function e(){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,N.U2)("item_banks_groups/mine.json");case 2:t=e.sent,ye(t);case 4:case"end":return e.stop()}}),e)}))),e.apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[]);var Re=function(e,t,n){var i;null==n||null===(i=n.find((function(t){return t.id===e})))||void 0===i||null===(i=i.sub_disciplines)||void 0===i||null===(i=i.find((function(e){return e.id===t})))||void 0===i||i.tag_disciplines};function Oe(e,t,n){return ze.apply(this,arguments)}function ze(){return ze=d()(l()().mark((function e(t,n,r){var s,c,u,p,h,m,g,v,y,x,_,k,A,T,B,N,P,E,M,Z,G,D,F,R;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:u=f()({},t),p=u.hack_sets,h=u.hack_codes,m=u.hack,g=u.tags,v=u.codes,y=[],(null==m||null===(s=m.tag_discipline_ids)||void 0===s?void 0:s.length)>0&&(null!=m&&null!==(x=m.tag_discipline_ids)&&void 0!==x&&null!==(x=x[0])&&void 0!==x&&x.value?null==m||null===(_=m.tag_discipline_ids)||void 0===_||_.map((function(e){y.push(null==e?void 0:e.value)})):y=null==m?void 0:m.tag_discipline_ids),m.tag_discipline_ids=y,k=[],A=[],T=0,B=null!=m&&m.is_file?H.map((function(e,t){return f()(f()({},e),{},{position:t+1})})):p.map((function(e){return f()(f()({},e),{},{is_file:!1})})),N=a()(B);try{for(N.s();!(P=N.n()).done;)E=P.value,T+=E.score,E.id&&E.id>=0?k.push(E):A.push(E)}catch(e){N.e(e)}finally{N.f()}if(null!=B&&B.length){e.next=13;break}return w.ZP.error("测试集不能为空"),e.abrupt("return");case 13:if(100===(T+=parseInt(m.code_compile_score||0))||m.test_set_score){e.next=17;break}return w.ZP.error("测试集的评分占比之和必须等于100"),e.abrupt("return");case 17:if(null==B||!B.some((function(e){return!e.output}))){e.next=22;break}return $e(null==B?void 0:B.map((function(e){return(null==e?void 0:e.position)-1}))),it(!0),w.ZP.error("测试集输出不能为空"),e.abrupt("return");case 22:if(M={},Ge?null==v||v.forEach((function(e){M[e.language]=null!=e&&e.code?j.Base64.encode(null==e?void 0:e.code):""})):h.code=j.Base64.encode(null==h?void 0:h.code),m.sub_discipline_id=null===(c=m.sub_discipline_id)||void 0===c?void 0:c[1],Me&&(m.tag_discipline_ids=[]),q({type:le.SET_LOADING,payload:!0}),pe||(m.score=100*m.difficult),!o){e.next=61;break}return e.next=31,(0,S.l_)(o,{hack:m,hack_codes:h,hack_sets:A,update_hack_sets:k,tags:g,is_cover:r,languages:m.languages,codes:M});case 31:if(0===e.sent.status){e.next=35;break}return q({type:le.SET_LOADING,payload:!1}),e.abrupt("return");case 35:if(!pe){e.next=55;break}return e.next=39,(0,S.j2)(o);case 39:if(!pe.includes("paperlibrary")){e.next=45;break}return e.next=42,(0,I.oF)({id:he,question_id:me,item_type:L.c.Program,name:m.name,question_score:m.score,difficulty:m.difficult,sub_discipline_id:m.sub_discipline_id,tag_discipline_ids:m.tag_discipline_ids,item_banks_group_ids:m.item_banks_group_ids,analysis:m.analysis});case 42:return 0===e.sent.status&&("course"==i.get("pageType")?"course"==i.get("updateType")?C.history.replace(i.get("callback_url")+"&defaultActiveKey=0&pageType=course&updateType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):C.history.replace(i.get("callback_url")+"&pageType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):C.history.replace(i.get("callback_url"))),e.abrupt("return");case 45:return e.next=47,(0,S.GM)(me,{question_type:6,question_score:m.score,question_title:m.name,description:m.description,sub_discipline_id:m.sub_discipline_id,tag_discipline_ids:m.tag_discipline_ids,item_banks_group_ids:m.item_banks_group_ids,identifier:o,analysis:m.analysis});case 47:if(Z=e.sent,0!==Z.status){e.next=53;break}if("start"!==n){e.next=52;break}return e.abrupt("return");case 52:"course"==i.get("pageType")?"course"==i.get("updateType")?C.history.replace(i.get("callback_url")+"&defaultActiveKey=0&pageType=course&updateType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):C.history.replace(i.get("callback_url")+"&pageType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):C.history.replace(i.get("callback_url"));case 53:e.next=58;break;case 55:w.ZP.success("保存成功"),Fe(re()),"start"!==n&&0===te&&b.Z.confirm({icon:null,title:"提示",width:452,centered:!0,content:(0,ee.jsx)("div",{children:"编程题已保存!目前外于未发布状态,发布后即可应用到自己管理的课堂,是否立即发布?"}),cancelText:"稍后再说",okText:"立即发布",onCancel:function(){C.history.replace("/problemset")},onOk:function(){var e=d()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,He(o);case 2:C.history.replace("/problemset");case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()});case 58:q({type:le.SET_LOADING,payload:!1}),e.next=92;break;case 61:return e.next=63,(0,S.zQ)({hack:m,hack_codes:h,hack_sets:B,tags:g,examination_bank_id:he||null});case 63:if(G=e.sent,D=G.identifier,F=G.exam_identifier,q({type:le.SET_LOADING,payload:!1}),"start"!==n){e.next=69;break}return e.abrupt("return");case 69:if(!D){e.next=92;break}if(pe){e.next=75;break}Ee(D),Te(!0),e.next=92;break;case 75:return e.next=77,(0,S.j2)(D);case 77:if(o){e.next=91;break}if(!pe.includes("paperlibrary")){e.next=84;break}return e.next=81,(0,I.oF)({id:he,item_type:L.c.Program,name:m.name,question_score:m.score,difficulty:m.difficult,sub_discipline_id:m.sub_discipline_id,tag_discipline_ids:m.tag_discipline_ids,identifier:F,analysis:m.analysis});case 81:return 0===e.sent.status&&("course"==i.get("pageType")?"course"==i.get("updateType")?C.history.replace(i.get("callback_url")+"&defaultActiveKey=0&pageType=course&updateType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):C.history.replace(i.get("callback_url")+"&pageType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):C.history.replace(i.get("callback_url"))),e.abrupt("return");case 84:return e.next=86,(0,S.MK)(parseInt(he,10),{question_type:6,question_score:m.score,question_title:m.name,identifier:D,tag_discipline_ids:m.tag_discipline_ids,analysis:m.analysis});case 86:R=e.sent,0===R.status&&("course"==i.get("pageType")?"course"==i.get("updateType")?C.history.replace(i.get("callback_url")+"&defaultActiveKey=0&pageType=course&updateType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):C.history.replace(i.get("callback_url")+"&pageType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):C.history.replace(i.get("callback_url"))),e.next=92;break;case 91:"course"==i.get("pageType")?"course"==i.get("updateType")?C.history.replace(i.get("callback_url")+"&defaultActiveKey=0&pageType=course&updateType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):C.history.replace(i.get("callback_url")+"&pageType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):C.history.replace(i.get("callback_url"));case 92:case"end":return e.stop()}}),e)}))),ze.apply(this,arguments)}function He(e){return We.apply(this,arguments)}function We(){return(We=d()(l()().mark((function e(t){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.j2)(t);case 2:0===(n=e.sent).status?(w.ZP.success("发布成功"),q({type:le.SET_STATUS,payload:1})):w.ZP.info(n.message);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ve(){return(Ve=d()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Oe(c.getFieldsValue(),"start"),setTimeout(d()(l()().mark((function e(){var t,n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.uE)(o);case 2:t=e.sent,n=t.identifier,window.location.href=Ge?"/myproblems/".concat(n,"?type=1"):"/myproblems/".concat(n);case 5:case"end":return e.stop()}}),e)}))),400);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ue(){if("course"==i.get("pageType"))"course"==i.get("updateType")?C.history.replace(i.get("callback_url")+"&defaultActiveKey=0&pageType=course&updateType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):C.history.replace(i.get("callback_url")+"&pageType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId")));else if(pe)C.history.replace(i.get("callback_url"));else if(Ge){var e,t=null===(e=localStorage.getItem("program_homework"))||void 0===e?void 0:e.split(",");C.history.push("/classrooms/".concat(null==t?void 0:t[0],"/program_homework/").concat(null==t?void 0:t[1],"/detail"))}else C.history.replace("/problemset")}var Ke=function(e){var t=parseInt(c.getFieldValue("hack").code_compile_score)||0,n=Math.floor((100-t)/e.length),i=n+(100-t)%e.length,a=e.map((function(t,a){return a===e.length-1?f()(f()({},t),{},{score:i}):f()(f()({},t),{},{score:n})}));W(a)};(0,m.useEffect)((function(){if(de){var e=parseInt(c.getFieldValue("hack").code_compile_score)||0,t=null==ne?void 0:ne.length,n=Math.floor((100-e)/t),i=(100-e)%t;null==ne||ne.map((function(e,a){return e.score=n,e.position=a+1,a===t-1&&(e.score=n+i),e})),q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack_sets:ne})}}),c.setFieldsValue({hack_sets:ne})}}),[de]);(0,m.useEffect)((function(){var e,t;null!=J&&null!==(e=J.hack)&&void 0!==e&&null!==(e=e.sub_discipline_id)&&void 0!==e&&e[1]&&qe(null==J||null===(t=J.hack)||void 0===t||null===(t=t.sub_discipline_id)||void 0===t?void 0:t[1])}),[null==J||null===(t=J.hack)||void 0===t?void 0:t.sub_discipline_id]);var qe=function(){var e=d()(l()().mark((function e(t){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,A.YY)({sub_discipline_id:t});case 2:n=e.sent,R(n.tag_disciplines);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();var Ye=function(){var e=d()(l()().mark((function e(){var t,n,a,o,r,s;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,c.validateFields();case 3:if(t=c.getFieldsValue(),!i.get("exercise")||pe.includes("paperlibrary")){e.next=7;break}return b.Z.confirm({title:"保存提示",content:"此题目已存在试题库中,是否将修改后的试题覆盖试题库的原题?",okText:"覆盖原题",cancelText:"不覆盖",onOk:function(){return Oe(t,"",1)},onCancel:function(){return Oe(t,"",0)}}),e.abrupt("return");case 7:Oe(t,"",1),e.next=17;break;case 10:e.prev=10,e.t0=e.catch(0),(r=null===e.t0||void 0===e.t0||null===(n=e.t0.errorFields)||void 0===n||null===(n=n.filter((function(e){var t;return"hack_sets"==(null==e||null===(t=e.name)||void 0===t?void 0:t[0])})))||void 0===n?void 0:n.map((function(e){var t;return null==e||null===(t=e.name)||void 0===t?void 0:t[1]}))).length>0&&$e(r),c.scrollToField(null===e.t0||void 0===e.t0||null===(a=e.t0.errorFields)||void 0===a||null===(a=a[0])||void 0===a?void 0:a.name,{behavior:"smooth",block:"start"}),s=null===e.t0||void 0===e.t0||null===(o=e.t0.errorFields)||void 0===o||null===(o=o[0])||void 0===o||null===(o=o.errors)||void 0===o?void 0:o[0],w.ZP.error(s);case 17:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),Je=(0,m.useState)(0),Qe=p()(Je,2),Xe=Qe[0],$e=Qe[1],et=(0,m.useState)(!1),tt=p()(et,2),nt=tt[0],it=tt[1];return(0,m.useEffect)((function(){if(nt){var e=document.getElementById("scroll-key-".concat(Xe));null==e||e.scrollIntoView({behavior:"smooth"}),it(!1)}}),[Xe,nt]),(0,ee.jsxs)(y.Z,{spinning:Y,delay:500,children:[J?(0,ee.jsxs)("div",{className:g.bg,children:[(0,ee.jsxs)("header",{className:g.header,children:[(0,ee.jsxs)("div",{className:g.avatar,children:[(0,ee.jsx)("img",{src:"".concat(E.Z.IMG_SERVER,"/images/").concat(null==Q?void 0:Q.image_url),alt:"user"}),(0,ee.jsx)("span",{children:null==Q?void 0:Q.name})]}),(0,ee.jsxs)("div",{className:g.title,children:[" ",(null==J?void 0:J.hack.name)||"编程题"," "]}),(0,ee.jsxs)("div",{className:g.exitBtn,onClick:Ue,children:[(0,ee.jsx)("i",{className:"icon iconfont icon-tuichu1"}),(0,ee.jsx)("span",{children:"退出"})]})]}),(0,ee.jsx)(v.Z,{colon:!1,form:c,initialValues:J,scrollToFirstError:!0,onValuesChange:function(e){var t;if(null!=e&&null!==(t=e.hack)&&void 0!==t&&t.sub_discipline_id){var n,i,a,o=null==e||null===(n=e.hack)||void 0===n?void 0:n.sub_discipline_id,r=p()(o,2),s=r[0],l=r[1],d=(null==X||null===(i=X.find((function(e){return e.id===s})))||void 0===i||null===(i=i.sub_disciplines)||void 0===i||null===(i=i.find((function(e){return e.id===l})))||void 0===i||i.tag_disciplines,f()(f()({},c.getFieldsValue()),{},{hack:f()(f()({},null===(a=c.getFieldsValue())||void 0===a?void 0:a.hack),{},{tag_discipline_ids:[]})}));c.setFieldsValue(d),Z(d)}else Z(f()({},c.getFieldsValue()))},labelCol:{flex:"200px"},children:(0,ee.jsx)("div",{className:g.contentWrapper,children:(0,ee.jsx)(x.Z,{defaultActiveKey:"2"==i.get("tabKey")?"2":"1",className:g.tabWrapper,tabBarGutter:180,centered:!0,items:[{label:"基础信息",key:"1",forceRender:!0,children:(0,ee.jsx)(ie,{onAddTestCases:function(){var e=c.getFieldValue("hack_sets"),t=parseInt(c.getFieldValue("hack").code_compile_score)||0,n=e.length,i=Math.floor((100-t)/n),a=(100-t)%n;e.map((function(t,n){return de&&(t.score=i,n===e.length-1&&(t.score=i+a)),t.position=n+1,t})),c.setFieldsValue({hack_sets:e}),q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack_sets:e})}})},form:c,handleAddKnowledgeFinish:function(e){R([].concat(r()(F),[f()({},e)]))},MyGroup:be,formValue:M,knowledgeOptions:F,onChangeLanguage:function(e){q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack_codes:f()(f()({},J.hack_codes),{},{language:e})})}})},onChangeSubDiscipline:function(e){var t,n;Ze(!e),R([]);var i=e?e[1]:null,a=(0,k.y3)(X,i),o=p()(a,2)[1];c.setFieldsValue({tags:[]}),q({type:le.SET_INITAL_DATA,payload:{dicts:o,data:f()(f()({},J),{},{hack:f()(f()({},J.hack),{},{sub_discipline_id:e,tag_discipline_ids:e&&e[1]==(null==J||null===(t=J.hack)||void 0===t?void 0:t.sub_discipline_id)?null==J||null===(n=J.hack)||void 0===n?void 0:n.tag_discipline_ids:[]}),tags:[]})}})},onRemoveTestCase:function(e){var t=c.getFieldValue("hack_sets"),n=parseInt(c.getFieldValue("hack").code_compile_score)||0,i=(null==t?void 0:t.length)-1,a=Math.floor((100-n)/i),o=(100-n)%i;t.splice(e,1),null==t||t.map((function(e,t){return de&&(e.score=a,t===i-1&&(e.score=a+o)),e.position=t+1,e})),q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack_sets:t})}}),c.setFieldsValue({hack_sets:t})},onAddTestCase:function(){var e=c.getFieldValue("hack_sets"),t=parseInt(c.getFieldValue("hack").code_compile_score)||0,n=e.length+1,i=Math.floor((100-t)/n),a=(100-t)%n;e.map((function(e,t){return de&&(e.score=i),e.position=t+1,e})),e.push({input:"",output:"",position:n,score:de?i+a:0}),c.setFieldsValue({hack_sets:e}),q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack_sets:e})}}),$e(e.length-1),it(!0)},dicts:$,categorys:De,callback_url:pe,hack:J.hack,onChangeScore:function(e){e.target.value||Ke(H),q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack:f()(f()({},J.hack),{},{test_set_score:e.target.value})})}})},onChangeAverage:function(e){var t=e.target.value;t&&Ke(H);var n=c.getFieldValue("hack_sets");q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack_sets:n,hack:f()(f()({},J.hack),{},{test_set_average:t})})}})},onChangeFile:function(e){q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack:f()(f()({},J.hack),{},{is_file:e.target.value})})}})},uploadData:H,setUploadData:W,handleUploadRatio:Ke,isshows:ke,isProgram:Ge,addUploadFnc:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(n)return function(){q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack:f()(f()({},J.hack),{},{is_file:!0})})}}),c.setFieldsValue({hack:{is_file:!0}})};var i=null==e?void 0:e.map((function(e){return{input:e.input,output:e.output,score:0,position:1}})),a=null===(t=c.getFieldValue("hack_sets"))||void 0===t||null===(t=t.filter((function(e){return e.input||e.output})))||void 0===t?void 0:t.concat(i),o=parseInt(c.getFieldValue("hack").code_compile_score)||0,r=null==a?void 0:a.length,s=Math.floor((100-o)/r),l=(100-o)%r;null==a||a.map((function(e,t){return de&&(e.score=s,t===r-1&&(e.score=s+l)),e.position=t+1,e})),q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack_sets:a,hack:f()(f()({},J.hack),{},{is_file:!1})})}}),c.setFieldsValue({hack_sets:a,hack:{is_file:!1}})},activeKey:Xe,setActiveKey:$e})},{label:"学员初始代码",key:"2",forceRender:!0,children:(0,ee.jsx)("div",{className:g.codePanelWrapper,children:Ge?(0,ee.jsx)(v.Z.Item,{name:"codes",noStyle:!0,children:(0,ee.jsx)(B.Z,{})}):(0,ee.jsx)(v.Z.Item,{name:["hack_codes","code"],noStyle:!0,children:(0,ee.jsx)(T.Z,{language:J.hack_codes.language,onUpdateCode:function(){}})})})}]})})}),(0,ee.jsx)("div",{className:g.buttonFixed,children:o?(0,ee.jsxs)(m.Fragment,{children:[(0,ee.jsx)("div",{className:g.cancelBtn,onClick:Ue,children:"取消"}),(0,ee.jsx)(_.ZP,{className:"".concat(g.saveBtn," ml20"),loading:Y,type:"primary",onClick:(0,ae.throttle)(Ye,1e3),children:"保存"}),(0,ee.jsx)(_.ZP,{type:"primary",className:"".concat(g.challengeBtn," ml20"),onClick:(0,ae.throttle)((function(){return Ve.apply(this,arguments)}),1e3),icon:(0,ee.jsx)("i",{className:"icon iconfont icon-kaishitiaozhan1 mr5 font14"}),children:te?"开始挑战":"模拟挑战"})]}):(0,ee.jsxs)(m.Fragment,{children:[(0,ee.jsx)("div",{className:g.cancelBtn,onClick:Ue,children:"取消"}),(0,ee.jsx)(_.ZP,{className:"".concat(g.saveBtn," ml20"),loading:Y,type:"primary",onClick:(0,ae.throttle)(Ye,1e3),children:"保存"})]})})]}):(0,ee.jsx)("div",{className:"vh100"}),(0,ee.jsxs)(b.Z,{centered:!0,maskClosable:!1,open:Ae,title:"提示",width:"484px",onCancel:function(){C.history.push("/problems/newedit/".concat(Pe)),Te(!1)},footer:null,children:[(0,ee.jsxs)("div",{children:[(0,ee.jsx)("div",{style:{lineHeight:"26px"},children:"本次试题内容修改已保存成功,可点击“退出”返回到试题库页面,点击“模拟实战”进行代码调试"}),(0,ee.jsxs)("div",{style:{color:"#E99237",fontSize:12,marginTop:12},children:[(0,ee.jsx)(oe.Z,{style:{marginRight:10}}),"如本试题学生进入需要展示初始代码,请点击",(0,ee.jsx)("span",{style:{color:"#165DFF",cursor:"pointer",textDecoration:"underline"},onClick:function(){C.history.push("/problems/newedit/".concat(Pe,"?tabKey=2"))},children:"设置初始代码"}),"进行设置"]})]}),(0,ee.jsxs)("div",{className:"mt30 mb20",style:{display:"flex",justifyContent:"flex-end"},children:[(0,ee.jsx)(_.ZP,{className:"mr20",onClick:function(){C.history.replace("/problemset")},children:"退出"}),(0,ee.jsx)(_.ZP,{type:"primary",onClick:d()(l()().mark((function e(){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.uE)(Pe);case 2:t=e.sent,window.location.href=Ge?"/myproblems/".concat(null==t?void 0:t.identifier,"?type=1"):"/myproblems/".concat(null==t?void 0:t.identifier);case 4:case"end":return e.stop()}}),e)}))),children:"模拟实战"})]})]})]})}},6427:function(e,t,n){"use strict";n.d(t,{GM:function(){return d},MK:function(){return c},PR:function(){return a},ZS:function(){return p},d1:function(){return o},fu:function(){return r},j2:function(){return u},l_:function(){return s},uE:function(){return h},zQ:function(){return l}});var i=n(90694);function a(){return(0,i.U2)("problems/new.json")}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"question";return(0,i.U2)("disciplines.json",{source:e})}function r(e){return(0,i.U2)("problems/".concat(e,"/edit.json"))}function s(e,t){return(0,i.gz)("problems/".concat(e,".json"),t)}function l(e){return(0,i.v_)("problems.json",e)}function c(e,t){return(0,i.v_)("exercises/".concat(e,"/exercise_questions.json"),t)}function d(e,t){return(0,i.gz)("exercise_questions/".concat(e,".json"),t)}function u(e){return(0,i.v_)("problems/".concat(e,"/publish.json"))}function p(e){return(0,i.v_)("problems/".concat(e,"/cancel_publish.json"))}function h(e){return(0,i.U2)("problems/".concat(e,"/start.json"))}},74527:function(e,t,n){"use strict";n.d(t,{D0:function(){return u},R8:function(){return l},jw:function(){return d},y3:function(){return p}});var i=n(85573),a=n.n(i),o=n(57809),r=(n(59301),n(37712)),s=o.default.Option,l=function(e){return e[e.language=0]="language",e[e.difficult=1]="difficult",e[e.category=2]="category",e[e.openOrNot=3]="openOrNot",e}({}),c=a()(a()(a()(a()({},l.language,[{title:"C",key:"C"},{title:"C++",key:"C++"},{title:"Python",key:"Python"},{title:"Java",key:"Java"},{title:"JavaScript",key:"JavaScript"},{title:"Ruby",key:"Ruby"}]),l.difficult,[{title:"简单",key:1},{title:"中等",key:2},{title:"困难",key:3}]),l.category,[{title:"程序设计",key:1},{title:"算法",key:2}]),l.openOrNot,[{title:"公开",key:1},{title:"私有",key:0}]);function d(e){return c[e].map((function(e){return(0,r.jsxs)(s,{value:e.key,children:[" ",e.title," "]},e.title)}))}function u(e,t){e.map((function(e){var n=e.id,i=e.name,a=e.sub_disciplines,o={value:n,label:i};t.push(o),a&&a.length>0&&(o.children=[],u(a,o.children))}))}function p(e,t){for(var n=[],i=0;i0){n[0]=o.id;for(var r=0;r4?parseFloat(e):5};function j(){try{return window.self!==window.top}catch(e){return!0}}function k(){return(!t.hasOwnProperty("screenshotGenerator")||!t.screenshotGenerator)&&Math.max(screen.width,screen.height)<800}e.setHTML5Codebase=function(e,n){c=e,M(e,n)},e.setJavaCodebase=e.setJavaCodebaseVersion=e.isCompiledInstalled=e.setPreCompiledScriptPath=e.setPreCompiledResourcePath=function(){},e.setHTML5CodebaseVersion=function(e,n){var t=parseFloat(e);NaN!==t&&t<5?console.log("The GeoGebra HTML5 codebase version "+t+" is deprecated. Using version latest instead."):(s=e,L(e,n))},e.getHTML5CodebaseVersion=function(){return f},e.getParameters=function(){return t},e.setFontsCSSURL=function(e){b=e},e.setGiacJSURL=function(e){},e.setJNLPFile=function(e){e},e.setJNLPBaseDir=function(e){},e.inject=function(){function n(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var i,r="auto",o=t.id,a=!1,s=0;s=5)return!0;var n=e.getAppletObject();return!(!n||"function"!=typeof n.recalculateEnvironments)&&(n.recalculateEnvironments(),!0)},e.startAnimation=function(){var n=e.getAppletObject();return!(!n||"function"!=typeof n.startAnimation)&&(n.startAnimation(),!0)},e.stopAnimation=function(){var n=e.getAppletObject();return!(!n||"function"!=typeof n.stopAnimation)&&(n.stopAnimation(),!0)},e.getAppletObject=function(){var e=void 0!==t.id?t.id:"ggbApplet";return window[e]},e.resize=function(){};var Z=function(e){return e&&"false"!==e},A=function(n,t,i){y(f)<=4.2&&(i=!0);var r=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==f||ggbHTML5LoadedCodebaseIsWebSimple&&!v)&&(r=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var o=document.createElement("div");o.classList.add("appletParameters","notranslate");var a=t.width,l=t.height;if(t.disableAutoScale=void 0===t.disableAutoScale?GGBAppletUtils.isFlexibleWorksheetEditor():t.disableAutoScale,void 0!==t.width)if(y(f)<=4.4)Z(t.showToolBar)&&(t.height-=7),Z(t.showAlgebraInput)&&(t.height-=37),t.width<605&&Z(t.showToolBar)&&(t.width=605,a=605);else{var u=100;(Z(t.showToolBar)||Z(t.showMenuBar))&&(t.hasOwnProperty("customToolBar")&&(t.customToolbar=t.customToolBar),u=Z(t.showMenuBar)?245:155),a=5?(t.appletOnLoad=function(e){var t=n.querySelector(".ggb_preview");t&&t.parentNode.removeChild(t),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(w),window.GGBT_wsf_view&&$(window).trigger("resize"),h(e)},x||w.appendChild(j)):o.appendChild(j),w.appendChild(o),x||n.appendChild(w),setTimeout((function(){e.resize()}),1)}function k(e,n){n&&"function"==typeof n.appletOnLoad&&"function"==typeof renderGGBElement?renderGGBElement(e,n.appletOnLoad):renderGGBElement(e),R("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",n)}function C(e,n){"undefined"==typeof renderGGBElement?(null===html5AppletsToProcess&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:e,params:n}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,null!==html5AppletsToProcess&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach((function(e){k(e.article,e.params)})),html5AppletsToProcess=null)},y(f)<5&&(e.className+=" geogebraweb")):k(e,n)}if(r){scriptLoadStarted=!0;for(var _=0;_0?(r.remove(),l.attr("id","fullscreencontent").show(),jQuery(o).append(l),window.dispatchEvent(new Event("resize"))):A(r,n,!1),window.GGBT_wsf_view.launchFullScreen(o)}else m=i,A(e,n,!1);if(!window.GGBT_wsf_view)for(a=0;ae/4*3&&(l=e/4*3),s=l/5.8,a.setAttribute("src",x),a.setAttribute("width",l),a.setAttribute("height",s);var u=(e-l)/2,d=(n-s)/2;a.style.left=u+"px",a.style.top=d+"px",r.appendChild(a)}return r.appendChild(c),r},I=function(e){return"html5"===(e=e.toLowerCase())||"screenshot"===e?e:"html5"},O=["web","webSimple","web3d","tablet","tablet3d","phone"],L=function(e,n){if(f=e,n)M(f,!0);else{var o,a,l=!r;if(l){var s=y(f);!isNaN(s)&&s<4.4&&(l=!1)}o="http"===window.location.protocol.substr(0,4)?window.location.protocol:"http:";var c=f.indexOf("//");for(var u in a=c>0?f:0===c?o+f:"https://www.geogebra.org/apps/5.2.814.0/",O)if(f.slice(-1*O[u].length)===O[u]||f.slice(-1*(O[u].length+1))===O[u]+"/")return void M(a,!1);GGBAppletUtils.isFlexibleWorksheetEditor()||!l||i.is3D||i.AV||i.SV||i.CV||i.EV2||i.CP||i.PC||i.DA||i.FI||i.PV||Z(t.showToolBar)||Z(t.showMenuBar)||Z(t.showAlgebraInput)||Z(t.enableRightClick)||t.appName&&"classic"!=t.appName?a+="web3d/":a+="webSimple/",M(a,!1)}},M=function(e,n){if(e.requirejs)p=e;else{"/"!==e.slice(-1)&&(e+="/"),p=e,null===n&&(n=-1===e.indexOf("http")),h=n,g="web.nocache.js",v=!1;var t=p.split("/");t.length>1&&(n||"webSimple"!==t[t.length-2]?O.indexOf(t[t.length-2])>=0&&(g=t[t.length-2]+".nocache.js"):(g="webSimple.nocache.js",v=!0)),t=e.split("/"),"test"===(f=t[t.length-3]).substr(0,4)?f=f.substr(4,1)+"."+f.substr(5,1):"war"!==f.substr(0,3)&&"beta"!==f.substr(0,4)||(f="5.0");var i=parseFloat(f);NaN!==i&&i<5&&e.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+i+" is deprecated. Using version latest instead."),L("5.0",n))}},R=function(e,n){window.console&&window.console.log&&(!n||void 0===n.showLogging||n.showLogging&&"false"!==n.showLogging)&&console.log(e)};function D(){var e=n;null!==s?e=s:parseFloat(e)<5&&(e="5.0"),L(e,!1),null!==c&&M(c,h),l=!0}return void 0!==t.material_id?C(D):D(),e},GGBAppletUtils=function(){"use strict";function e(){return void 0!==window.GGBT_wsf_edit}function n(e,n){1!=n?(e.style.transformOrigin="0% 0% 0px",e.style.webkitTransformOrigin="0% 0% 0px",e.style.transform="scale("+n+","+n+")",e.style.webkitTransform="scale("+n+","+n+")",e.style.maxWidth="initial",null!==e.querySelector(".ggb_preview")&&(e.querySelector(".ggb_preview").style.maxWidth="initial"),void 0!==e.querySelectorAll(".ggb_preview img")[0]&&(e.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),void 0!==e.querySelectorAll(".ggb_preview img")[1]&&(e.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(e.style.transform="none",e.style.webkitTransform="none")}function t(e,n,t,i,r){if(e.isScreenshoGenerator)return 1;var o,a=void 0!==i&&i,l=null!=e.noScaleMargin&&e.noScaleMargin,s=(o=e.autoHeight)&&"false"!==o,c=function(e,n,t,i,r,o){var a=null;if(null!=o&&""!=o)for(var l=e.parentNode;null!=l;){if((" "+l.className+" ").indexOf(" "+o+" ")>-1){a=l;break}l=l.parentNode}var s=0,c=0,u=0,d=0,p=0,h=0,m=0;if(a)s=a.offsetWidth,c=Math.max(i?a.offsetWidth:0,a.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(s=Math.min(window.innerWidth,document.documentElement.clientWidth),c=Math.min(window.innerHeight,document.documentElement.clientHeight),u=s):(s=window.innerWidth,c=window.innerHeight,u=window.innerWidth),e){var f=e.getBoundingClientRect();f.left>0&&f.left<=s&&(void 0===r||!r)&&("rtl"===document.dir?(p=s-f.width-f.left,h=u<=480?10:30):(h=f.left,p=u<=480?10:30),d=h+p)}e&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(e.getBoundingClientRect(),"closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(d=40,m=0):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(d=0,m=40))}return e&&((void 0===t||!t)&&n>0&&n+d1&&(a=!0)),n&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(a=!0),e.hasOwnProperty("disableAutoScale")&&e.disableAutoScale?o:(r=t(e,n,a,i,e.scaleContainerClass),!a||e.hasOwnProperty("scale")&&1!==o?Math.min(o,r):r)}function r(e){var n=Math.min(window.innerWidth,document.documentElement.clientWidth),t=Math.min(window.innerHeight,document.documentElement.clientHeight),i=e.getBoundingClientRect(),r=(n-i.width)/2,o=(t-i.height)/2;o<0&&(o=0),e.style.position="relative","closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(e.style.left=r<40?"40px":r+"px",e.style.top=o+"px"):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(e.style.top=o<40?"40px":o+"px",e.style.left=r+"px")}return{responsiveResize:function(t,o){var a=t.querySelector(".appletParameters");if(a){if("object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()){if(o.id!==a.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(t)}if(a.parentElement&&/fullscreen/.test(a.parentElement.className))return;var l=i(o,t);e()&&a.setAttribute("data-param-scale",l);for(var s=null,c=0;c=O)continue;if(j==jb){if(k=i.getAttribute(kb),k){var l,m=k.indexOf(lb);m>=O?(j=k.substring(O,m),l=k.substring(m+P)):(j=k,l=W),c[j]=l}}else if(j==mb){if(k=i.getAttribute(kb),k)try{d=eval(k)}catch(e){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(e){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(e){var n=c[e];return null==n?null:n},r=d,webModule.__errFn=e}function B(){function e(e){var n=e.lastIndexOf(rb);-1==n&&(n=e.length);var t=e.indexOf(sb);-1==t&&(t=e.length);var i=e.lastIndexOf(tb,Math.min(t,n));return i>=O?e.substring(O,i+P):W}var n,t=null!=(n=__gwt_getMetaProperty(wb))?n:W;return t==W&&(t=function(){for(var n=o.getElementsByTagName(_),t=O;tO?e[e.length-P].href:W}()),t==W&&function(){var e=o.location;return e.href==e.protocol+zb+e.host+e.pathname+e.search+e.hash}()&&(t=e(o.location.href)),t=function(n){if(n.match(/^\w+:\/\//));else{var t=o.createElement(ub);t.src=n+vb,n=e(t.src)}return n}(t),t}function C(e){return e.match(/^\//)||e.match(/^[a-zA-Z]+:\/\//)?e:webModule.__moduleBase+e}function D(){var e,t=O,i=[],o=[];function a(e){var n=o[e](),t=i[e];if(n in t)return n;var a=[];for(var l in t)a[t[l]]=l;throw r&&r(e,a,n),null}if(__gwt_isKnownPropertyValue=function(e,n){return n in i[e]},webModule.__getPropMap=function(){var e={};for(var n in i)i.hasOwnProperty(n)&&(e[n]=a(n));return e},webModule.__computePropValue=a,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);try{var l=(e=Cb).indexOf(Db);-1!=l&&(t=parseInt(e.substring(l+P),$),e=e.substring(O,l))}catch(e){}return webModule.__softPermutationId=t,C(e+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}s[L]={moduleName:L},webModule.__moduleStartupDone=function(e){var n=s[L].bindings;s[L].bindings=function(){for(var t=n?n():{},i=e[webModule.__softPermutationId],r=O;r0){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:"",t=[],i=0;i0&&(0,w.jsx)("div",{id:i||"",children:(0,w.jsx)(p.Z,r()({showLine:{showLeafIcon:!1},showIcon:!0,treeData:c,className:h,onSelect:t,onExpand:function(e,n){x((function(e){return j(e,n.node.key,n.expanded)}))}},k))})}},87359:function(e,n,t){"use strict";t.d(n,{Z:function(){return b}});var i=t(7557),r=t.n(i),o=t(41498),a=t.n(o),l=t(79800),s=t.n(l),c=t(59301),u="imageDimensions___a7crR",d="img___Kroat",p="fullWidth___c492T",h=t(92310),m=t.n(h),f=t(71418),g=t(2859),v=t(90694),w=t(41282),x=t(37712),b=function(e){var n=e.data,t=e.className,i=e.fullWidth,o=e.style,l=void 0===o?{}:o,h=e.onClose,b=e.onOk,y=e.showFullTools,j=e.noAssociationId,k=(0,c.useRef)(null),C=(0,c.useRef)(null),_=(0,c.useState)(!1),S=s()(_,2),Z=S[0],A=S[1],P=(0,c.useState)("正在加载中"),N=s()(P,2),E=N[0],B=N[1];(0,c.useEffect)((function(){null!=n&&n.visible?document.body.setAttribute("data-custom","y-hidden"):document.body.removeAttribute("data-custom"),null!=n&&n.src&&T()}),[null==n?void 0:n.visible]);var T=function(){var e=a()(r()().mark((function e(){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A(!0),B("正在加载中"),e.next=4,(0,w.ZJ)(null==n?void 0:n.src);case 4:t=e.sent,k.current.src="",k.current.src=t,k.current.onload=function(){O()},A(!1),B("");case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),I=function(){var e=a()(r()().mark((function e(t){var i;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A(!0),B("正在保存中"),e.next=4,(0,v.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:n.title,file:t.dataUrl}});case 4:if(null==(i=e.sent)||!i.id||j){e.next=12;break}return e.next=8,(0,v.ZP)("/api/attachments/".concat(n.id,"/add_subitem.json"),{method:"post",body:{subitem_id:null==i?void 0:i.id,settings:JSON.stringify(t.state)}});case 8:0===e.sent.status&&b(),e.next=13;break;case 12:null!=i&&i.id&&b(i);case 13:A(!1),B("");case 15:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),O=function(){C.current=new g.hP(k.current),C.current.addEventListener("render",I),C.current.addEventListener("beforeclose",h),y&&(C.current.availableMarkerTypes=C.current.ALL_MARKER_TYPES,C.current.uiStyleSettings.redoButtonVisible=!0,C.current.uiStyleSettings.notesButtonVisible=!0,C.current.uiStyleSettings.zoomButtonVisible=!0,C.current.uiStyleSettings.zoomOutButtonVisible=!0,C.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=C.current.uiStyleSettings,C.current.show(),null!=n&&n.snapshotData&&C.current.restoreState(n.snapshotData),setTimeout((function(){var e;(e=document.querySelector('a[href="https://markerjs.com/"]'))&&e.parentNode&&(e.parentNode.style.display="none"),[{name:'[data-action="select"]',title:"选择"},{name:'[data-action="delete"]',title:"删除元素"},{name:'[data-action="undo"]',title:"撤销"},{name:'[data-type-name="FrameMarker"]',title:"矩形"},{name:'[data-type-name="FreehandMarker"]',title:"画线"},{name:'[data-type-name="ArrowMarker"]',title:"箭头"},{name:'[data-type-name="TextMarker"]',title:"文本"},{name:'[data-type-name="EllipseMarker"]',title:"椭圆"},{name:'[data-type-name="HighlightMarker"]',title:"方块"},{name:'[data-type-name="CalloutMarker"]',title:"注释"},{name:'[data-action="render"]',title:"保存"},{name:'[data-action="close"]',title:"退出"}].forEach((function(e){var n=document.querySelector(e.name);n&&n.setAttribute("title",e.title)}))}),300)};return(0,x.jsx)(c.Fragment,{children:(null==n?void 0:n.visible)&&(0,x.jsxs)("div",{className:m()(u,t,i?p:""),style:l,children:[(0,x.jsx)(f.Z,{spinning:Z,tip:E,style:{position:"absolute"}}),(0,x.jsx)("img",{className:d,ref:k})]})})}},43941:function(e,n,t){"use strict";t.d(n,{N:function(){return P}});var i=t(7557),r=t.n(i),o=t(41498),a=t.n(o),l=t(37205),s=t.n(l),c=t(79800),u=t.n(c),d=t(59301),p=t(57809),h=t(43418),m=t(98135),f=t(8591),g=t(95237),v=t(43604),w=t(90694),x="wrap___F7E3F",b="selectWrapper____kESB",y="tips___aHjQY",j="linkBtn___uggVr",k="public_tips___sZVWd",C="inputCss___t66EO",_="bt___lXptu",S=t(88289),Z=t(37712),A=p.default.Option,P=function(e){var n=e.subId,t=e.value,i=e.selectvalues,o=e.disabled,l=e.knowledgeOptions,c=void 0===l?[]:l,P=e.onChange,N=void 0===P?function(){}:P,E=e.onAddKnowledgeFinish,B=void 0===E?function(){}:E,T=(0,d.useRef)(),I=(0,d.useState)([]),O=u()(I,2),L=O[0],M=O[1];t=t||[];(0,d.useEffect)((function(){(null==i?void 0:i.length)>0?(M(s()(i)),N(s()(i))):(M([]),N([]))}),[c]),(0,d.useEffect)((function(){var e;(null===(e=t)||void 0===e?void 0:e.length)>0&&N(s()(t))}),[c]);return(0,Z.jsxs)(g.Z,{wrap:!1,align:"middle",className:x,children:[(0,Z.jsx)(v.Z,{children:(0,Z.jsx)(p.default,{mode:"multiple",disabled:!n||o,className:b,placeholder:"请选择知识点,支持选择多个",onChange:function(e,n){e?(M(s()(n)),N(s()(n))):(M([]),N([]))},style:{width:490},showSearch:!0,allowClear:!0,value:L,filterOption:function(e,n){return n.label.indexOf(e.toLowerCase())>=0},children:null==c?void 0:c.map((function(e){return(0,Z.jsx)(A,{value:e.id,label:e.name,children:(0,Z.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,Z.jsx)("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:e.name}),"personal"===(null==e?void 0:e.type)&&(0,Z.jsx)("div",{style:{marginLeft:"5px",border:"1px solid #24C074",color:"#24C074",padding:"0 4px",borderRadius:"2px",fontSize:"12px",height:"20px",lineHeight:"20px"},children:"自用"})]})},e.id)}))})}),n&&(0,Z.jsxs)(v.Z,{className:"ml20",children:[(0,Z.jsx)("span",{className:y,children:"没有合适的知识点?"}),(0,Z.jsx)("span",{className:j,onClick:function(e){e.preventDefault(),T.current="",h.Z.confirm({centered:!0,width:585,okText:"确定",cancelText:"取消",icon:null,title:"新建知识点",className:"custom-modal-divider",content:(0,Z.jsxs)("div",{className:"font14",children:[(0,Z.jsxs)("div",{className:k,children:[(0,Z.jsx)(S.Z,{style:{color:"#FF8C29",marginRight:10,paddingTop:5}}),"新建的知识点仅本人可见,平台审核列入公开知识点后,对所有用户可见。 平台有权删除不合适的知识点,请认真填写知识点名称。"]}),(0,Z.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,Z.jsxs)("div",{style:{width:"95px"},children:[(0,Z.jsx)("span",{className:_,children:"*"}),"知识点名称"]}),(0,Z.jsx)(m.Z,{className:C,style:{width:"calc(100% - 95px)"},maxLength:20,size:"middle",showCount:!0,placeholder:"请输入知识点名称",defaultValue:T.current,onChange:function(e){T.current=e.target.value}})]})]}),onOk:function(){return new Promise(function(){var e=a()(r()().mark((function e(t,o){var a,l;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(T.current){e.next=3;break}return f.ZP.warning("请输入知识点名称"),e.abrupt("return",o());case 3:if(!(T.current.length>20)){e.next=6;break}return f.ZP.warning("请输入不超过20字的知识点名称"),e.abrupt("return",o());case 6:return e.next=8,(0,w.ZP)("/api/tag_disciplines.json",{method:"post",body:{name:T.current,sub_discipline_id:n}});case 8:return 0===(null==(a=e.sent)?void 0:a.status)&&(B({id:a.tag_discipline_id,name:T.current,type:"personal"}),(l=i||[]).push(a.tag_discipline_id),N(s()(l)),M(s()(l)),N(s()(l))),e.abrupt("return",t());case 11:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}())}})},children:"新建知识点"})]})]})}},64565:function(e,n,t){"use strict";var i=t(79800),r=t.n(i),o=t(59301),a=t(50630),l=(t(48136),t(42594)),s=t(43418),c=t(37712),u=(0,o.forwardRef)((function(e,n){var t=e.callback,i=e.width,u=e.onChange,d=e.disabled,p=e.readOnly,h=e.type,m=void 0===h?"":h,f=e.value,g=void 0===f?"":f,v=e.style,w=void 0===v?{}:v,x=(0,o.useRef)(),b=(0,o.useRef)(),y=(0,o.useState)(0),j=r()(y,2),k=j[0],C=j[1],_=(0,o.useState)(0),S=r()(_,2),Z=S[0],A=S[1],P=(0,o.useState)(!1),N=r()(P,2),E=N[0],B=N[1],T=function(){var e=document.createElement("div");e.innerHTML=x.current.getValue();var n=e.innerText;return t&&t(n),n};(0,o.useImperativeHandle)(n,(function(){return{getData:T}}));var I=function(e,n,t,i){var r=document.body.clientHeight,o=document.body.clientWidth;return!(e<20&&t>e||e>o-20&&tn||n>r-20&&i1e3*(a+3)*s,te.current){e.next=9;break}return e.abrupt("return");case 9:if(!l){e.next=13;break}return P.ZP.error("调试代码超时"),f(!1),e.abrupt("return");case 13:if(0!==t){e.next=17;break}return f(!1),V(u()(u()({},i),{},{showText:!0})),e.abrupt("return");case 17:setTimeout(c,1e3);case 18:case"end":return e.stop()}}),e)}))),d.apply(this,arguments)},c=function(){return d.apply(this,arguments)},o=ie(),a=re?null==l?void 0:l.time_limit:null===(n=i.getFieldsValue())||void 0===n?void 0:n.hack.time_limit,s=re?null==l||null===(t=l.answer_content)||void 0===t?void 0:t.length:null===(r=i.getFieldsValue())||void 0===r||null===(r=r.standard_answers)||void 0===r?void 0:r.length,f(!0),e.next=8,(0,D.bM)(ne.current,{test_hack_code:q,test_input:X});case 8:c();case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),le=function(){var e=A()(S()().mark((function e(){var n,t,r,o,a,s,c,d;return S()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l){e.next=25;break}return e.prev=1,e.next=4,i.validateFields();case 4:e.next=11;break;case 6:return e.prev=6,e.t0=e.catch(1),null!==e.t0&&void 0!==e.t0&&null!==(n=e.t0.errorFields)&&void 0!==n&&null!==(n=n[0])&&void 0!==n&&null!==(n=n.name)&&void 0!==n&&n.includes("standard_answers")?P.ZP.error("填空项答案不能为空"):P.ZP.error(e.t0.errorFields[0].errors[0]),i.scrollToField(e.t0.errorFields[0].name,{behavior:"smooth",block:"center"}),e.abrupt("return");case 11:if(b(!0),t="",r=i.getFieldsValue(),ee.current){e.next=22;break}return e.next=17,(0,R.ZP)("/api/problems.json",{method:"post",body:u()(u()({},r),{},{hack:u()(u()({},null==r?void 0:r.hack),{},{sub_discipline_id:null==r||null===(o=r.hack)||void 0===o||null===(o=o.sub_discipline_id)||void 0===o?void 0:o[1],difficult:r.difficulty,item_banks_group_id:r.item_banks_group_id}),hack_codes:u()(u()({},r.hack_codes),{},{code:B.Base64.encode(r.hack_codes.code)}),hack_sets:[u()({},r.hack_sets)],is_blank:!0})});case 17:t=e.sent,ee.current=null===(a=t)||void 0===a?void 0:a.identifier,sessionStorage.projectFill=null===(s=t)||void 0===s?void 0:s.identifier,e.next=25;break;case 22:return e.next=24,(0,R.ZP)("/api/problems/".concat(ee.current,".json"),{method:"put",body:u()(u()({},r),{},{hack:u()(u()({},null==r?void 0:r.hack),{},{sub_discipline_id:null==r||null===(c=r.hack)||void 0===c||null===(c=c.sub_discipline_id)||void 0===c?void 0:c[1],difficult:r.difficulty,item_banks_group_id:r.item_banks_group_id}),hack_codes:u()(u()({},r.hack_codes),{},{code:B.Base64.encode(r.hack_codes.code)}),update_hack_sets:[u()({},r.hack_sets)],is_blank:!0})});case 24:t=e.sent;case 25:return e.next=27,(0,R.ZP)("/api/problems/".concat(ee.current,"/start.json"),{method:"get"});case 27:if(0!==(null==(d=e.sent)?void 0:d.status)){e.next=34;break}return ne.current=null==d?void 0:d.identifier,te.current=!0,b(!1),oe(),e.abrupt("return");case 34:b(!1);case 35:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(){return e.apply(this,arguments)}}();return(0,W.jsxs)("div",{children:[(0,W.jsx)(N.ZP,u()(u()({loading:x},n),{},{onClick:le,children:t})),(0,W.jsx)(g.Z,{open:k,title:"调试代码",destroyOnClose:!0,width:1200,okText:"运行测试",confirmLoading:d,cancelButtonProps:{style:{display:"none"}},onOk:function(){return ae()},onCancel:function(){te.current=!1,C(!1)},children:(0,W.jsxs)("div",{className:T,children:[(0,W.jsxs)("div",{className:I,children:[(0,W.jsxs)("div",{className:"mb20",children:[(0,W.jsx)("span",{className:"c-black",children:"执行代码"}),!l&&(0,W.jsx)(F.CopyToClipboard,{text:q,onCopy:function(){return P.ZP.success("复制成功")},children:(0,W.jsxs)("span",{style:{float:"right"},className:"current c-light-primary",children:[(0,W.jsx)("i",{className:"iconfont icon-fuzhi8 mr5"}),"复制"]})})]}),(0,W.jsx)(G.Z,{height:510,className:"mb0",hidetoolBar:!0,defaultValue:q,onChange:function(e){return Y(e)}})]}),(0,W.jsxs)("div",{className:O,children:[(0,W.jsx)("div",{className:"c-black mb20",children:"自定义测试用例"}),(0,W.jsx)("div",{className:L,children:(0,W.jsx)("div",{className:M,children:(0,W.jsx)(m.Z.TextArea,{placeholder:"请输入",value:X,onChange:function(e){return $(e.target.value)},bordered:!1,style:{height:180}})})}),(0,W.jsx)("div",{className:"c-black mb20 mt30",children:"代码执行结果"}),(0,W.jsx)("div",{className:L,children:(0,W.jsx)(E.Z,{spinning:d,tip:"代码执行中",children:(0,W.jsx)("div",{className:M,style:{height:196,overflow:"auto",padding:10},children:function(e){var n=e.status,t=e.error_msg,i=e.execute_time,r=e.output,o=e.input,a=e.expected_output,l=null;switch(n){case z.h.OK:l=(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)("p",{children:["执行用时:",i/1e3,"秒"]}),(0,W.jsx)("p",{children:"执行结果:调试通过"})]});break;case z.h.NOMATCH:l=(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)("div",{children:"输入:"}),(0,W.jsx)("pre",{style:{fontFamily:"initial"},children:o}),(0,W.jsx)("div",{children:"输出:"}),(0,W.jsx)("pre",{style:{fontFamily:"initial"},children:r&&B.Base64.decode(r)}),(0,W.jsx)("div",{children:"预期输出:"}),(0,W.jsx)("pre",{style:{fontFamily:"initial"},children:a&&B.Base64.decode(a)})]});break;case z.h.EXECUTEFAILURE:case z.h.COMPILEFAILURE:l=(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)("p",{children:["最后执行的输入:",(0,W.jsx)("pre",{children:o})]}),(0,W.jsx)("p",{children:"执行出错信息:"}),(0,W.jsx)("pre",{className:"error",children:B.Base64.decode(t)})]});break;case z.h.PODFAILURE:l=(0,W.jsx)("p",{children:"创建pod失败,请稍后重试"});break;case z.h.TIMEOUT:l=(0,W.jsx)("p",{children:"评测超时,请稍后重试"})}return(0,W.jsxs)(W.Fragment,{children:[" ",l," "]})}(H)})})})]})]})})]})},V=t(88289),K=["key","name"],U=m.Z.TextArea,q=[{title:"C",key:"C"},{title:"C++",key:"C++"},{title:"Python",key:"Python"},{title:"Java",key:"Java"},{title:"JavaScript",key:"JavaScript"},{title:"Ruby",key:"Ruby"}],Y="@▁@",J="@▁▁@",Q=function(e){var n=e.questionTitlePlaceholder,t=e.form,i=e.scoreByBlank,o=void 0!==i&&i,l=e.hackidentifier,c=e.answerKey,d=(0,h.useState)(!1),_=p()(d,2),S=_[0],Z=_[1],A=(0,h.useState)(!1),P=p()(A,2),N=(P[0],P[1],(0,k.useParams)().type,function(e,n){for(var t=n.line,i=0,r=0;r0){var a=N(e,n.from);console.log("新增".concat(o,"个,之前有").concat(a,"个")),t(o,a)}}else{var l=r.split(Y).length-1+r.split(J).length-1,s=N(e,n.from);console.log("删除".concat(l,"个, 前面有").concat(s,"个,新增").concat(o,"个")),i(l>1?Array.from({length:l},(function(e,n){return s+n})):s)}}(e,n,T,O)}})})}),(0,W.jsx)(f.Z.List,{name:c,rules:[{validator:function(e,n){if(null==n||!n.length)return Promise.reject(new Error("答案不能为空"));var t,i=a()(n);try{for(i.s();!(t=i.n()).done;){var r=(t.value||{}).answer_text;if(0===(null==r?void 0:r.length))return Promise.reject(new Error("填空项答案不能为空"))}}catch(e){i.e(e)}finally{i.f()}return Promise.resolve()}}],children:function(e,n,t){var i=n.add,a=n.remove;t.errors;return B.current=i,I.current=a,(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,W.jsx)(f.Z.Item,{label:"填空项答案",required:!0,labelCol:{span:24}}),(0,W.jsxs)("div",{onClick:function(){g.Z.warning({title:"给分说明",icon:null,width:700,centered:!0,content:(0,W.jsxs)("div",{children:[(0,W.jsxs)("div",{children:["1.学生填写答案之后,必须提交代码",(0,W.jsx)("span",{style:{color:"#e30000"},children:"进行评测"}),"才能得分。"]}),(0,W.jsx)("div",{style:{marginTop:10},children:"2.试题算分时,系统会将程序里面的所有空替换成学生的答案进行评测。输出的结果与测试集比对,完全正确则得满分;若不完全正确,则依次将每个空换成学生提交的答案,同时将其他空替换成标准答案,运行程序。如果这个空的学生答案与标准答案结合能得到正确输出,则这个空得到该空的满分,否则该空得0分。"})]})})},style:{minHeight:32,color:"#3061D0",cursor:"pointer"},children:[(0,W.jsx)(V.Z,{style:{marginRight:3,color:"#3061D0"}}),(0,W.jsx)("span",{children:" 给分说明"})]})]}),e.map((function(e,n){var t,i,a=e.key,l=e.name,s=r()(e,K);return(0,W.jsxs)(v.Z,{className:"mb20",align:"middle",wrap:!1,children:[(0,W.jsxs)(w.Z,{flex:"0 0 auto",className:"".concat(C.Z.blankIndex),children:["填空项",n+1]}),(0,W.jsx)(w.Z,{flex:1,children:(0,W.jsxs)(v.Z,{align:"top",justify:"space-between",wrap:!1,children:[(0,W.jsx)(w.Z,{children:(0,W.jsx)(f.Z.Item,u()(u()({},s),{},{name:[l,"answer_text"],noStyle:!0,children:null!=L&&null!==(t=L[l])&&void 0!==t&&t.multi_line||null!=L&&null!==(i=L[l])&&void 0!==i&&i.multiLine?(0,W.jsx)(U,{spellCheck:!1,style:{marginLeft:10,width:550}}):(0,W.jsx)(m.Z,{style:{marginLeft:10,width:550},className:C.Z.blankInput,size:"large",maxLength:1e3,onBlur:function(e){}})}))}),o&&(0,W.jsx)(w.Z,{flex:"224px",children:(0,W.jsx)(f.Z.Item,u()(u()({},s),{},{name:[l,"score"],label:"分值",rules:[{required:!0}],children:(0,W.jsx)(x.Z,{size:"large",className:C.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"请输入分值"})}))})]})})]},a)}))]})}}),(0,W.jsx)("div",{onClick:function(){return Z(!0)},children:(0,W.jsx)(f.Z.Item,{name:["hack","analysis"],label:"题目解析",labelCol:{span:24},children:(0,W.jsx)(j.x,{placeholder:"请编辑题目解析(非必填)",isEdit:S})})}),(0,W.jsx)(f.Z.Item,{label:"编程语言",style:{marginTop:30},name:["hack_codes","language"],labelCol:{span:24},rules:[{required:!0,message:"请选择编程语言"}],children:(0,W.jsx)(b.default,{size:"large",children:q.map((function(e){return(0,W.jsxs)(b.default.Option,{value:e.key,children:[" ",e.title]},e.title)}))})}),(0,W.jsxs)(f.Z.Item,{label:"最大评测时长(秒)",style:{marginTop:30},labelCol:{span:24},required:!0,children:[(0,W.jsx)(f.Z.Item,{name:["hack","time_limit"],rules:[{required:!0,message:"请输入单个测试集评测时长限制"},{type:"number",min:3,message:"最小限制时间是3秒"}],noStyle:!0,children:(0,W.jsx)(x.Z,{precision:0,max:10,min:3,size:"large",style:{width:"97%"}})}),(0,W.jsx)("span",{className:"ml10 font14",children:"秒"})]}),(0,W.jsx)(f.Z.Item,{label:"学生答案的空格处理方式",style:{marginTop:30},name:["hack","submit_rule"],labelCol:{span:24},rules:[{required:!0,message:"请选择学生答案的空格处理方式"}],children:(0,W.jsxs)(y.ZP.Group,{style:{marginTop:-10},children:[(0,W.jsx)(y.ZP,{value:0,children:"不忽略空格"}),(0,W.jsx)(y.ZP,{value:1,children:"忽略首尾空格"}),(0,W.jsx)(y.ZP,{value:2,children:"忽略所有空格"})]})}),(0,W.jsx)(f.Z.Item,{label:"测试用例",required:!0,style:{marginTop:30}}),(0,W.jsxs)("div",{style:{background:"#F6F7F9",padding:15},children:[(0,W.jsx)(f.Z.Item,{label:"输入",labelCol:{span:24},name:["hack_sets","input"],children:(0,W.jsx)(U,{rows:4})}),(0,W.jsx)(f.Z.Item,{label:"输出",labelCol:{span:24},name:["hack_sets","output"],rules:[{required:!0,message:"请输入输出内容"}],children:(0,W.jsx)(U,{rows:4})})]}),(0,W.jsx)(H,{form:t,answerKey:c,hackIdentifier:l,buttonText:"运行调试",buttonProps:{ghost:!0,icon:(0,W.jsx)("i",{className:"iconfont icon-ceshi"}),style:{background:"rgba(55,173,131,0.05)",borderRadius:19,border:"1px solid #37AD83",width:116,height:38,display:"inline-flex",fontSize:14,alignItems:"center",justifyContent:"center",marginTop:20,cursor:"pointer",color:"#37AD83"}}})]})}},10877:function(e,n,t){"use strict";t.d(n,{u:function(){return C}});var i=t(39647),r=t.n(i),o=t(79800),a=t.n(o),l=t(85573),s=t.n(l),c=t(82242),u=t.n(c),d=t(59301),p=t(95237),h=t(43604),m=t(6848),f=t(78241),g=t(26194),v=t(57703),w=t(78091),x=t(78716),b=t(37712),y=["key","name"],j=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],k=function(e){var n=e.value,t=e.onChange,i=e.choiceTextKey,r=e.answerKey,o=e.index,a=e.isEdit,l=e.setInputActive,c=e.form,d=e.choiceOptionsPath,f=e.allowChangeMode,y=e.showAddIcon,k=e.addItem,C=e.deleteItem;console.log(n,"value");var _=1===(null==n?void 0:n[r]),S=function(){var e;_?t(u()(u()({},n),{},s()({},r,0))):(f||(e=c.getFieldValue(d),c.setFieldValue(d,e.map((function(e){return u()(u()({},e),{},s()({},r,0))})))),t(u()(u()({},n),{},s()({},r,1))))};return(0,b.jsxs)(p.Z,{className:g.Z.choiceWrap,align:"middle",wrap:!1,children:[(0,b.jsx)(h.Z,{onClick:S,className:"".concat(g.Z.choiceIndex," ").concat(_?g.Z.activeAnswer:""),children:j[o]}),(0,b.jsx)(h.Z,{flex:1,className:"".concat(g.Z.editorWrap," ml15"),onClick:l,children:(0,b.jsx)(x.x,{height:155,placeholder:"请您输入选项",isEdit:a,value:null==n?void 0:n[i],onChange:function(e){t(u()(u()({},n),{},s()({},i,e)))}})}),(0,b.jsx)(h.Z,{flex:"0 0 auto",className:"ml15",children:(0,b.jsx)("div",{onClick:S,className:"".concat(g.Z.setAnswerBtn," ").concat(_?g.Z.activeAnswer:""),children:_?"正确答案":"设为答案"})}),(0,b.jsxs)(h.Z,{className:g.Z.actionWrapper,children:[(0,b.jsx)(m.Z,{title:"新增参考答案",children:(0,b.jsx)(v.Z,{className:g.Z.addIcon,onClick:k,style:{visibility:y?"visible":"hidden"}})}),(0,b.jsx)(m.Z,{title:"删除",children:(0,b.jsx)(w.Z,{className:g.Z.deleteIcon,onClick:C,style:{visibility:o>1?"visible":"hidden"}})})]})]})},C=function(e){var n=e.questionTitlePlaceholder,t=e.titleKey,i=e.choiceKey,o=e.analysisKey,l=e.choiceTextKey,c=e.answerKey,p=e.choiceOptionsPath,h=e.allowChangeMode,m=void 0===h||h,v=e.form,w=e.showAnalysis,C=void 0===w||w,_=(0,d.useState)(),S=a()(_,2),Z=S[0],A=S[1],P=(0,d.useState)(!1),N=a()(P,2),E=N[0],B=N[1];return(0,b.jsxs)("div",{className:g.Z.wrap,children:[(0,b.jsx)("div",{className:g.Z.questionTitleEditorWrap,children:(0,b.jsx)(f.Z.Item,{label:"题干",name:t,labelCol:{span:24},rules:[{required:!0}],children:(0,b.jsx)(x.h,{scrollId:Array.isArray(t)?t.join("_"):"".concat(t),watch:!0,height:140,placeholder:n})})}),(0,b.jsx)(f.Z.Item,{label:"答案选项",required:!0,labelCol:{span:24}}),(0,b.jsx)(f.Z.List,{name:i,rules:[{validator:function(e,n){var t=n.some((function(e){return 1===e[c]})),i=n.findIndex((function(e){var n;return(null===(n=e[l])||void 0===n?void 0:n.length)<=0}));return-1!==i?Promise.reject(new Error("请先输入".concat(j[i],"选项的内容"))):t?Promise.resolve():Promise.reject(new Error("请设置正确答案"))}}],children:function(e,n){var t=n.add,i=n.remove;return(0,b.jsxs)("div",{id:Array.isArray(p)?p.join("_"):"".concat(p),children:[e.map((function(n,o){var a=n.key,h=n.name,w=r()(n,y),x=Z===a,C=o<7&&o===e.length-1;return(0,d.createElement)(f.Z.Item,u()(u()({},w),{},{key:a,name:h,className:g.Z.choiceListWrap,rules:[{validator:function(e,n){return null!=n&&n.choice_text?Promise.resolve():Promise.reject(new Error("请先输入".concat(j[o],"选项的内容")))}}]}),(0,b.jsx)(k,{choiceTextKey:l,answerKey:c,index:o,isEdit:x,setInputActive:function(){A(a)},form:v,choiceOptionsPath:p,allowChangeMode:m,showAddIcon:C,addItem:function(){return t(s()(s()({},l,""),c,0))},deleteItem:function(){return i(h)}}))})),e.length<8&&(0,b.jsx)("div",{className:"".concat(g.Z.addBtn," mb30"),onClick:function(){return t(s()(s()({},l,""),c,0))},children:"添加选项"})]})}}),C&&(0,b.jsx)("div",{onClick:function(){return B(!0)},children:(0,b.jsx)(f.Z.Item,{name:o,label:"题目解析",labelCol:{span:24},children:(0,b.jsx)(x.x,{placeholder:"请编辑题目解析(非必填)",isEdit:E})})})]})}},56689:function(e,n,t){"use strict";t.d(n,{u:function(){return L}});var i=t(39647),r=t.n(i),o=t(91232),a=t.n(o),l=t(85573),s=t.n(l),c=t(82242),u=t.n(c),d=t(79800),p=t.n(d),h=t(37205),m=t.n(h),f=t(59301),g=t(43418),v=t(95237),w=t(43604),x=t(98135),b=t(6848),y=t(78673),j=t(78241),k=t(5112),C=t(54449),_=t(78716),S=t(78091),Z=t(85699),A=t(26194),P=t(64565),N=t(37712),E=["key","name"],B=function(e){var n=e.value,t=e.onChange;return(0,N.jsxs)(v.Z,{className:"ml20",children:[(0,N.jsx)(w.Z,{flex:1,children:null==n?void 0:n.map((function(e,i){return(0,N.jsxs)(v.Z,{className:"mb20",children:[(0,N.jsx)(x.Z.TextArea,{style:{flex:1,minHeight:44},defaultValue:e,autoSize:{maxRows:3},maxLength:1e3,onBlur:function(e){var r=m()(n),o=e.target.value.trim();r[i]=o,t(r)}}),(0,N.jsx)(b.Z,{title:"删除",children:(0,N.jsx)(S.Z,{className:A.Z.deleteIcon,style:{marginLeft:15,visibility:i>0?"visible":"hidden"},onClick:function(){return function(e){g.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:A.Z.modal,onOk:function(){var i=m()(n);i.splice(e,1),t(i)}})}(i)}})})]},"".concat(e,"_").concat(i))}))}),(0,N.jsx)(w.Z,{children:(0,N.jsx)("div",{className:"".concat(A.Z.addBtn),onClick:function(){var e;(e=m()(n)).push(""),t(e)},children:"新增答案"})})]})},T=function(e){var n=e.value,t=e.onChange;return(0,N.jsxs)(v.Z,{className:"ml20",children:[(0,N.jsx)(w.Z,{flex:1,children:null==n?void 0:n.map((function(e,i){return(0,N.jsxs)(v.Z,{align:"middle",className:"mb20",children:[(0,N.jsx)(P.Z,{value:e,style:{flex:1},onChange:function(e){var r=m()(n);r[i]=e,t(r)}}),(0,N.jsx)(b.Z,{title:"删除",children:(0,N.jsx)(S.Z,{className:A.Z.deleteIcon,style:{marginLeft:15,visibility:i>0?"visible":"hidden"},onClick:function(){return function(e){g.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:A.Z.modal,onOk:function(){var i=m()(n);i.splice(e,1),t(i)}})}(i)}})})]},"".concat(e,"_").concat(i))}))}),(0,N.jsx)(w.Z,{children:(0,N.jsx)("div",{className:"".concat(A.Z.addBtn),onClick:function(){var e;(e=m()(n)).push(""),t(e)},children:"新增答案"})})]})},I=function(e){var n=e.value,t=void 0===n||n,i=e.onChange;return(0,N.jsx)(y.Z,{checked:!t,onChange:function(e){i(!e)}})},O="▁",L=function(e){var n=e.questionTitlePlaceholder,t=e.form,i=e.scoreByBlank,o=void 0!==i&&i,l=e.answerKey,c=(0,f.useState)(!1),d=p()(c,2),h=d[0],m=d[1],g=function(e,n){for(var t=n.line,i=0,r=0;r1?Array.from({length:a},(function(e,n){return l+n})):l)}else if(o>0){var s=g(e,n.from);console.log("新增".concat(o,"个,之前有").concat(s,"个")),t(o,s)}}(e,n,L,R)}})})}),(0,N.jsx)(j.Z.List,{name:l,rules:[{validator:function(e,n){if(null==n||!n.length)return Promise.reject(new Error("请先在题干中插入填空项"));var t,i=a()(n);try{for(i.s();!(t=i.n()).done;){var r=(t.value||{}).answer_text;if(null!=r&&r.some((function(e){return 0===(null==e?void 0:e.length)})))return Promise.reject(new Error("填空项答案不能为空"))}}catch(e){i.e(e)}finally{i.f()}return Promise.resolve()}}],children:function(e,n,i){var a=n.add,c=n.remove;i.errors;return P.current=a,M.current=c,(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(j.Z.Item,{label:(0,N.jsxs)("span",{children:["填空项答案",!(null!=e&&e.length)&&(0,N.jsx)("span",{style:{color:"#E99237"},children:"(请先在题干中插入填空项)"})]}),required:!0,labelCol:{span:24}}),e.map((function(e,n){var i,a=e.key,c=e.name,d=r()(e,E);return(0,N.jsxs)("div",{style:{marginBottom:10},children:[(0,N.jsxs)(v.Z,{className:"mb20",align:"middle",wrap:!1,children:[(0,N.jsxs)(w.Z,{style:{marginRight:10},flex:"0 0 auto",className:"".concat(A.Z.blankIndex),children:["填空项",n+1]}),(0,N.jsx)(j.Z.Item,u()(u()({},d),{},{name:[c,"model"],noStyle:!0,children:(0,N.jsxs)(k.ZP.Group,{onChange:function(){var e=t.getFieldValue(l);t.setFieldsValue(s()({},l,e.map((function(e,n){return u()(u()({},e),{},{answer_text:c===n?[""]:e.answer_text})}))))},children:[(0,N.jsxs)(k.ZP,{value:1,children:["文本模式 ",(0,N.jsx)(b.Z,{title:"学生答题时,需要在文本框中填写文本答案",children:(0,N.jsx)(Z.Z,{})})]}),(0,N.jsxs)(k.ZP,{value:2,children:["数学公式模式 ",(0,N.jsx)(b.Z,{title:"学生答题时,需要编写数学公式作为答案",children:(0,N.jsx)(Z.Z,{})})]})]})}))]}),(0,N.jsx)(v.Z,{style:{marginLeft:20},align:"middle",wrap:!1,children:(0,N.jsxs)(w.Z,{flex:1,children:[(0,N.jsxs)(v.Z,{align:"top",justify:"space-between",wrap:!1,children:[(0,N.jsx)(w.Z,{flex:1,children:(0,N.jsx)(j.Z.Item,u()(u()({},d),{},{name:[c,"answer_text"],noStyle:!0,children:1===(null===(i=t.getFieldValue(l))||void 0===i||null===(i=i[c])||void 0===i?void 0:i.model)?(0,N.jsx)(B,{}):(0,N.jsx)(T,{})}))}),o&&(0,N.jsx)(w.Z,{flex:"224px",style:{margin:"-7px 0 0 20px"},children:(0,N.jsx)(j.Z.Item,u()(u()({},d),{},{name:[c,"score"],label:"分值",rules:[{required:!0}],className:A.Z.blankInputNumberWrapper,children:(0,N.jsx)(C.Z,{min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"请输入分值"})}))})]}),(0,N.jsx)(j.Z.Item,u()(u()({},d),{},{name:[c,"position"],noStyle:!0,children:(0,N.jsx)(x.Z,{type:"hidden"})}))]})})]},a)}))]})}}),(0,N.jsxs)(v.Z,{align:"middle",children:[(0,N.jsx)(j.Z.Item,{name:"downcase",valuePropName:"checked",children:(0,N.jsx)(y.Z,{})}),(0,N.jsx)(w.Z,{className:"ml10",children:"判分时忽略答案中的字母大小写"})]}),(0,N.jsxs)(v.Z,{align:"middle",children:[(0,N.jsx)(j.Z.Item,{name:"no_space",valuePropName:"checked",children:(0,N.jsx)(y.Z,{})}),(0,N.jsx)(w.Z,{className:"ml10",children:"判分时忽略答案中的空格"})]}),(null==D?void 0:D.length)>1&&(0,N.jsxs)(v.Z,{align:"middle",className:(null==D?void 0:D.length)>1?"mb30":"".concat(A.Z.hide),children:[(0,N.jsx)(j.Z.Item,{name:"is_ordered",children:(0,N.jsx)(I,{})}),(0,N.jsx)(w.Z,{className:"ml10",children:"允许学生每个填空的答案与标准答案的顺序不一致"})]}),(0,N.jsx)("div",{onClick:function(){return m(!0)},children:(0,N.jsx)(j.Z.Item,{name:"analysis",label:"题目解析",labelCol:{span:24},children:(0,N.jsx)(_.x,{placeholder:"请编辑题目解析(非必填)",isEdit:h})})})]})}},72173:function(e,n,t){"use strict";t.d(n,{Z:function(){return y}});var i=t(39647),r=t.n(i),o=t(79800),a=t.n(o),l=t(82242),s=t.n(l),c=t(85573),u=t.n(c),d=t(59301),p=t(95237),h=t(43604),m=t(78241),f=t(26194),g=t(78716),v=t(37712),w=["key","name"],x=u()(u()({},"正确","T"),"错误","F"),b=function(e){var n=e.value,t=e.onChange,i=e.form,r=1===(null==n?void 0:n.is_answer),o=null==n?void 0:n.choice_text,a=function(){var e=i.getFieldsValue().choices.map((function(e){return{choice_text:e.choice_text,is_answer:0}}));i.setFieldsValue({choices:e}),t(s()(s()({},n),{},{is_answer:1}))};return(0,v.jsxs)(p.Z,{className:f.Z.choiceWrap,align:"middle",wrap:!1,style:{marginBottom:"20px"},children:[(0,v.jsx)(h.Z,{onClick:a,className:"".concat(f.Z.choiceIndex," ").concat(f.Z.judgementIndex," ").concat(r?f.Z.activeAnswer:""),children:x[o]}),(0,v.jsx)(h.Z,{flex:1,className:"".concat(f.Z.editorWrap," ml15"),children:(0,v.jsx)("div",{className:"".concat(f.Z.inputBorder," ").concat(f.Z.placeholder," ").concat(r?f.Z.activeJudgementAnswer:""),children:o})}),(0,v.jsx)(h.Z,{flex:"0 0 auto",className:"ml15",children:(0,v.jsx)("div",{onClick:a,className:"".concat(f.Z.setAnswerBtn," ").concat(r?f.Z.activeAnswer:""),children:r?"正确答案":"设为答案"})})]})},y=function(e){var n=e.questionTitlePlaceholder,t=(e.choiceKey,e.form),i=(0,d.useState)(!1),o=a()(i,2),l=o[0],c=o[1];return(0,v.jsxs)("div",{className:f.Z.wrap,children:[(0,v.jsx)("div",{className:f.Z.questionTitleEditorWrap,children:(0,v.jsx)(m.Z.Item,{label:"题干",name:"name",labelCol:{span:24},rules:[{required:!0}],children:(0,v.jsx)(g.h,{scrollId:"name",watch:!0,height:140,placeholder:n})})}),(0,v.jsx)(m.Z.Item,{label:"答案选项",required:!0,labelCol:{span:24},children:(0,v.jsx)(m.Z.List,{name:"choices",rules:[{validator:function(e,n){return n.some((function(e){return 1===(null==e?void 0:e.is_answer)}))?Promise.resolve():Promise.reject(new Error("请设置正确答案"))}}],children:function(e){return(0,v.jsx)("div",{id:"choices",children:e.map((function(e){var n=e.key,i=e.name,o=r()(e,w);return(0,d.createElement)(m.Z.Item,s()(s()({},o),{},{key:n,name:i,noStyle:!0}),(0,v.jsx)(b,{form:t}))}))})}})}),(0,v.jsx)("div",{onClick:function(){return c(!0)},children:(0,v.jsx)(m.Z.Item,{name:"analysis",label:"题目解析",labelCol:{span:24},children:(0,v.jsx)(g.x,{placeholder:"请编辑题目解析(非必填)",isEdit:l})})})]})}},78716:function(e,n,t){"use strict";t.d(n,{h:function(){return p},x:function(){return h}});var i=t(82242),r=t.n(i),o=t(39647),a=t.n(o),l=t(77162),s=t(26194),c=t(36653),u=t(37712),d=["value","onChange","scrollId"],p=function(e){var n=e.value,t=e.onChange,i=e.scrollId,o=a()(e,d);return(0,u.jsx)("div",{id:i||"",children:(0,u.jsx)(l.Z,r()(r()({},o),{},{defaultValue:n,onChange:function(e,n){console.log("a:",e,n),null!=n&&n.length?t(e,n):t(e)}}))})},h=function(e){var n=e.value,t=e.onChange,i=e.placeholder,r=e.height,o=void 0===r?140:r;return e.isEdit?(0,u.jsx)(l.Z,{watch:!0,isFocus:!0,height:o,placeholder:i,defaultValue:n,onChange:t}):(0,u.jsx)("div",{style:{cursor:"pointer"},children:n?(0,u.jsx)(c.Z,{className:s.Z.inputBorder,value:n}):(0,u.jsx)("div",{className:"".concat(s.Z.inputBorder," ").concat(s.Z.placeholder," inputBorderError"),children:i})})}},42655:function(e,n,t){"use strict";t.d(n,{W:function(){return N}});var i=t(91232),r=t.n(i),o=t(79800),a=t.n(o),l=t(82242),s=t.n(l),c=t(39647),u=t.n(c),d=t(59301),p=t(8591),h=t(12563),m=t(78241),f=t(78673),g=t(95237),v=t(43604),w=t(6848),x=t(98135),b=t(54449),y=t(26194),j=t(78716),k=t(77162),C=t(85699),_=t(37712),S=["value","onChange"],Z=["key","name"],A=function(e){var n=e.value,t=e.onChange,i=u()(e,S);return(0,_.jsx)(k.Z,s()(s()({},i),{},{defaultValue:null==n?void 0:n[0],onChange:function(e){t([e])}}))},P=function(e){var n=e.value,t=void 0===n?[]:n,i=e.onClose;return(0,_.jsx)(h.Z,{closable:!0,onClose:i,className:y.Z.keywordTag,children:(0,_.jsx)("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"},children:t.join(" 或 ")})})},N=function(e){var n=e.questionTitlePlaceholder,t=e.form,i=e.showKeywords,o=e.isMustKeyWords,l=void 0===o?i:o,c=(0,d.useState)(!1),h=a()(c,2),k=h[0],S=h[1],N=(0,d.useState)(""),E=a()(N,2),B=E[0],T=E[1],I=m.Z.useWatch("use_keywords",t),O=m.Z.useWatch("question_score",t);return(0,_.jsxs)("div",{className:y.Z.wrap,children:[(0,_.jsx)("div",{className:y.Z.questionTitleEditorWrap,children:(0,_.jsx)(m.Z.Item,{label:"题干",name:"name",labelCol:{span:24},rules:[{required:!0}],children:(0,_.jsx)(j.h,{scrollId:"name",watch:!0,height:140,placeholder:n})})}),(0,_.jsx)(m.Z.Item,{label:"参考答案",name:"answer_texts",labelCol:{span:24},children:(0,_.jsx)(A,{watch:!0,height:140,placeholder:"请编辑参考答案(非必填)"})}),i&&!l&&(0,_.jsx)(m.Z.Item,{hidden:!0,name:"use_keywords",valuePropName:"checked",children:(0,_.jsx)(f.Z,{defaultChecked:!0})}),i&&l&&(0,_.jsxs)(g.Z,{align:"middle",className:"mb30",children:[(0,_.jsx)(m.Z.Item,{name:"use_keywords",valuePropName:"checked",children:(0,_.jsx)(f.Z,{})}),(0,_.jsx)(v.Z,{className:"ml10",children:"开启关键词自动判分"}),(0,_.jsx)(v.Z,{children:(0,_.jsx)(w.Z,{placement:"right",title:"选中后,需要设置每个关键词的分值,系统会根据设置的关键词进行自动判分; 所有关键词分值之和必须小于等于小题分值。",children:(0,_.jsx)(C.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})})})]}),(I||!l)&&(0,_.jsx)(m.Z.List,{name:"keywords",rules:[{validator:function(e,n){return l?null!=n&&n.length?(null==n?void 0:n.reduce((function(e,n){return e+n.score}),0))>parseFloat(O)?Promise.reject(new Error("所有关键词的分值之和必须小于等于该小题的分值")):Promise.resolve():Promise.reject(new Error("请设置判分关键词")):Promise.resolve()}}],children:function(e,n){var i=n.add,o=n.remove;return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"".concat(y.Z.title," mb10"),children:l?"关键词":(0,_.jsx)("span",{style:{color:"#9096A3"},children:"判分关键词"})}),(0,_.jsxs)(g.Z,{align:"middle",className:"font14 mb30",children:[(0,_.jsx)(v.Z,{flex:1,children:(0,_.jsx)(x.Z,{value:B,onChange:function(e){T(e.target.value)},maxLength:50,allowClear:!0,onPressEnter:function(e){var n,o,a,l,s="".concat(null===(n=e.target)||void 0===n?void 0:n.value),c=null==s||null===(o=s.split("|"))||void 0===o||null===(o=o.filter((function(e){return!!e})))||void 0===o?void 0:o.map((function(e){return null==e?void 0:e.trim()})),u=t.getFieldValue("keywords"),d=(null==u||null===(a=u.map((function(e){return null==e?void 0:e.keyword})))||void 0===a?void 0:a.flat())||[],h=r()(c);try{for(h.s();!(l=h.n()).done;){var m=l.value;if(d.includes(m))return void p.ZP.error("为避免判分错误,请勿设置相同的关键词")}}catch(e){h.e(e)}finally{h.f()}(function(e){if(!e)return!1;if(!/^s*$/.test(e)&&""!==e.trim())return new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~!@#¥……&*()—【】‘;:”“。,、?「」『』_\\+\\-·%《》]|[\\\\/]"),"|"!==e||(p.ZP.warning("关键词不能只输入一个“|”字符!"),!1);p.ZP.warning("关键词不能全为空格")})(s)&&(i({keyword:c,score:1}),T(""))},className:y.Z.inputBorder,placeholder:"支持设置多个关键词;并列关键词(或的关系)请用“|”分隔开"})}),(0,_.jsx)(v.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"},children:"“回车键”保存关键词"})]}),e.map((function(e){var n=e.key,t=e.name,i=u()(e,Z);return(0,_.jsx)(g.Z,{className:"mb20",style:{marginRight:148},children:(0,_.jsx)(v.Z,{flex:1,children:(0,_.jsxs)(g.Z,{align:"middle",justify:"space-between",children:[(0,_.jsx)(m.Z.Item,s()(s()({},i),{},{name:[t,"keyword"],children:(0,_.jsx)(P,{onClose:function(){return o(t)}})})),l&&(0,_.jsx)(m.Z.Item,s()(s()({},i),{},{name:[t,"score"],label:"分值",rules:[{required:!0}],className:y.Z.blankInputNumberWrapper,children:(0,_.jsx)(b.Z,{className:y.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"请输入关键词分数"})}))]})})},n)}))]})}}),(0,_.jsx)("div",{onClick:function(){return S(!0)},children:(0,_.jsx)(m.Z.Item,{name:"analysis",label:"题目解析",labelCol:{span:24},children:(0,_.jsx)(j.x,{placeholder:"请编辑题目解析(非必填)",isEdit:k})})})]})}},66815:function(e,n,t){"use strict";t.d(n,{tc:function(){return ne.t},uh:function(){return i.u},rL:function(){return ee},u8:function(){return o.u},ZZ:function(){return r.Z},Wk:function(){return a.W}});var i=t(10877),r=t(72173),o=t(56689),a=t(42655),l=t(37205),s=t.n(l),c=t(82242),u=t.n(c),d=t(39647),p=t.n(d),h=t(79800),m=t.n(h),f=t(59301),g=t(36381),v=t(78241),w=t(95237),x=t(54449),b=t(6848),y=t(38854),j=t(26194),k=t(78091),C=t(78716),_=t(91232),S=t.n(_),Z=t(43418),A=t(43604),P=t(98135),N=t(78673),E=t(37712),B=["key","name"],T=function(e){var n=e.value,t=e.onChange;return(0,E.jsxs)(w.Z,{className:"ml20",children:[(0,E.jsx)(A.Z,{flex:1,children:null==n?void 0:n.map((function(e,i){return(0,E.jsxs)(w.Z,{align:"middle",className:"mb20",children:[(0,E.jsx)(P.Z.TextArea,{style:{flex:1,minHeight:44},defaultValue:e,autoSize:{maxRows:3},maxLength:1e3,onBlur:function(e){var r=s()(n),o=e.target.value.trim();r[i]=o,t(r)}}),(0,E.jsx)(b.Z,{title:"删除",children:(0,E.jsx)(k.Z,{className:j.Z.deleteIcon,style:{marginLeft:15,visibility:i>0?"visible":"hidden"},onClick:function(){return function(e){Z.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:j.Z.modal,onOk:function(){var i=s()(n);i.splice(e,1),t(i)}})}(i)}})})]},"".concat(e,"_").concat(i))}))}),(0,E.jsx)(A.Z,{children:(0,E.jsx)("div",{className:"".concat(j.Z.addBtn),onClick:function(){var e;(e=s()(n)).push(""),t(e)},children:"新增答案"})})]})},I=function(e){var n=e.value,t=void 0===n||n,i=e.onChange;return(0,E.jsx)(N.Z,{checked:!t,onChange:function(e){i(!e)}})},O="▁",L=function(e){var n,t=e.questionTitlePlaceholder,i=e.form,r=e.name,o=e.scoreByBlank,a=void 0!==o&&o,l=e.answerKey,c=e.titleKey,d=void 0===c?"name":c,h=e.analysisKey,g=void 0===h?"analysis":h,b=e.isOrdered,y=void 0===b?"is_ordered":b,k=(0,f.useState)(!1),_=m()(k,2),Z=_[0],L=_[1],M=function(e,n){for(var t=n.line,i=0,r=0;r1?Array.from({length:a},(function(e,n){return l+n})):l)}else if(o>0){var s=M(e,n.from);console.log("新增".concat(o,"个,之前有").concat(s,"个")),t(o,s)}}(e,n,G,z)}})})}),(0,E.jsx)(v.Z.List,{name:l,rules:[{validator:function(e,n){if(0===(null==n?void 0:n.length))return Promise.reject(new Error("请先在题干中插入填空项"));var t,i=S()(n);try{for(i.s();!(t=i.n()).done;){var r=(t.value||{}).answer_text;if(null!=r&&r.some((function(e){return 0===(null==e?void 0:e.length)})))return Promise.reject(new Error("填空项答案不能为空"))}}catch(e){i.e(e)}finally{i.f()}return Promise.resolve()}}],children:function(e,n,t){var i=n.add,r=n.remove;t.errors;return D.current=i,F.current=r,(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(v.Z.Item,{label:(0,E.jsxs)("span",{children:["填空项答案",!(null!=e&&e.length)&&(0,E.jsx)("span",{style:{color:"#E99237"},children:"(请先在题干中插入填空项)"})]}),required:!0,labelCol:{span:24}}),e.map((function(e,n){var t=e.key,i=e.name,r=p()(e,B);return(0,E.jsxs)(w.Z,{align:"top",children:[(0,E.jsxs)(A.Z,{className:"".concat(j.Z.blankIndex," pt5"),children:["填空项",n+1]}),(0,E.jsxs)(A.Z,{flex:1,children:[(0,E.jsxs)(w.Z,{align:"top",justify:"space-between",children:[(0,E.jsx)(A.Z,{flex:1,children:(0,E.jsx)(v.Z.Item,u()(u()({},r),{},{name:[i,"answer_text"],noStyle:!0,children:(0,E.jsx)(T,{})}))}),a&&(0,E.jsx)(A.Z,{flex:"224px",children:(0,E.jsx)(v.Z.Item,u()(u()({},r),{},{name:[i,"score"],label:"分值",rules:[{required:!0}],className:j.Z.blankInputNumberWrapper,children:(0,E.jsx)(x.Z,{className:j.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"按空给分请输入分值"})}))})]}),(0,E.jsx)(v.Z.Item,u()(u()({},r),{},{name:[i,"position"],noStyle:!0,children:(0,E.jsx)(P.Z,{type:"hidden"})}))]})]},t)}))]})}}),(0,E.jsxs)(w.Z,{align:"middle",children:[(0,E.jsx)(v.Z.Item,{name:[r,"downcase"],valuePropName:"checked",children:(0,E.jsx)(N.Z,{})}),(0,E.jsx)(A.Z,{className:"ml10",children:"判分时忽略答案中的字母大小写"})]}),(0,E.jsxs)(w.Z,{align:"middle",children:[(0,E.jsx)(v.Z.Item,{name:[r,"no_space"],valuePropName:"checked",children:(0,E.jsx)(N.Z,{})}),(0,E.jsx)(A.Z,{className:"ml10",children:"判分时忽略答案中的空格"})]}),(null==W?void 0:W.length)>1&&(0,E.jsxs)(w.Z,{align:"middle",className:(null==W?void 0:W.length)>1?"mb30":"".concat(j.Z.hide),children:[(0,E.jsx)(v.Z.Item,{name:y,children:(0,E.jsx)(I,{})}),(0,E.jsx)(A.Z,{className:"ml10",children:"允许学生每个填空的答案与标准答案的顺序不一致"})]}),(0,E.jsx)("div",{onClick:function(){return L(!0)},children:(0,E.jsx)(v.Z.Item,{name:g,label:"题目解析",labelCol:{span:24},children:(0,E.jsx)(C.x,{placeholder:"请编辑题目解析(非必填)",isEdit:Z})})})]})},M=t(85573),R=t.n(M),D=["key","name"],G=R()(R()({},"正确","T"),"错误","F"),F=function(e){var n=e.value,t=e.onChange,i=e.form,r=e.choiceKey,o=1===(null==n?void 0:n.is_answer),a=null==n?void 0:n.choice_text,l=function(){var e,o=null==i||null===(e=i.getFieldValue(["sub_item_banks"].concat(s()(r))))||void 0===e?void 0:e.map((function(e){return{choice_text:e.choice_text,is_answer:0}}));null==i||i.setFieldValue(["sub_item_banks"].concat(s()(r)),o),t(u()(u()({},n),{},{is_answer:1}))};return(0,E.jsxs)(w.Z,{className:j.Z.choiceWrap,align:"middle",wrap:!1,children:[(0,E.jsx)(A.Z,{onClick:l,className:"".concat(j.Z.choiceIndex," ").concat(j.Z.judgementIndex," ").concat(o?j.Z.activeAnswer:""),children:G[a]}),(0,E.jsx)(A.Z,{flex:1,className:"".concat(j.Z.editorWrap," ml15"),children:(0,E.jsx)("div",{className:"".concat(j.Z.inputBorder," ").concat(j.Z.placeholder," ").concat(o?j.Z.activeJudgementAnswer:""),children:a})}),(0,E.jsx)(A.Z,{flex:"0 0 auto",className:"ml15",children:(0,E.jsx)("div",{onClick:l,className:"".concat(j.Z.setAnswerBtn," ").concat(o?j.Z.activeAnswer:""),children:o?"正确答案":"设为答案"})})]})},z=function(e){var n=e.questionTitlePlaceholder,t=e.choiceKey,i=void 0===t?"choices":t,r=e.form,o=e.titleKey,a=void 0===o?"name":o,l=e.analysisKey,s=void 0===l?"analysis":l,c=(0,f.useState)(!1),d=m()(c,2),h=d[0],g=d[1];return(0,E.jsxs)("div",{className:j.Z.wrap,children:[(0,E.jsx)("div",{className:j.Z.questionTitleEditorWrap,children:(0,E.jsx)(v.Z.Item,{label:"题干",name:a,labelCol:{span:24},rules:[{required:!0}],children:(0,E.jsx)(C.h,{scrollId:"name",watch:!0,height:140,placeholder:n})})}),(0,E.jsx)(v.Z.Item,{label:"答案选项",required:!0,labelCol:{span:24},children:(0,E.jsx)(v.Z.List,{name:i,rules:[{validator:function(e,n){return n.some((function(e){return 1===(null==e?void 0:e.is_answer)}))?Promise.resolve():Promise.reject(new Error("请设置正确答案"))}}],children:function(e){return(0,E.jsx)("div",{id:"choices",children:e.map((function(e){var n=e.key,t=e.name,o=p()(e,D);return(0,f.createElement)(v.Z.Item,u()(u()({},o),{},{key:n,name:t,noStyle:!0}),(0,E.jsx)(F,{form:r,choiceKey:i}))}))})}})}),(0,E.jsx)("div",{onClick:function(){return g(!0)},children:(0,E.jsx)(v.Z.Item,{name:s,label:"题目解析",labelCol:{span:24},children:(0,E.jsx)(C.x,{placeholder:"请编辑题目解析(非必填)",isEdit:h})})})]})},W=t(8591),H=t(12563),V=t(77162),K=t(85699),U=["value","onChange"],q=["key","name"],Y=function(e){var n=e.value,t=e.onChange,i=p()(e,U);return(0,E.jsx)(V.Z,u()(u()({},i),{},{defaultValue:null==n?void 0:n[0],onChange:function(e){t([e])}}))},J=function(e){var n=e.value,t=void 0===n?[]:n,i=e.onClose;return(0,E.jsx)(H.Z,{closable:!0,onClose:i,className:j.Z.keywordTag,children:(0,E.jsx)("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"},children:t.join(" 或 ")})})},Q=function(e){var n=e.questionTitlePlaceholder,t=e.form,i=e.showKeywords,r=e.isMustKeyWords,o=void 0===r?i:r,a=e.titleKey,l=void 0===a?"name":a,c=e.analysisKey,d=void 0===c?"analysis":c,h=e.answerTexts,g=void 0===h?"answer_texts":h,y=e.keywords,k=void 0===y?"keywords":y,_=e.useKeywords,Z=void 0===_?"use_keywords":_,B=e.indexs,T=(0,f.useState)(!1),I=m()(T,2),O=I[0],L=I[1],M=(0,f.useState)(""),R=m()(M,2),D=R[0],G=R[1],F=(0,f.useState)(!1),z=m()(F,2),H=z[0],V=z[1],U=v.Z.useWatch("question_score",t);return(0,E.jsxs)("div",{className:j.Z.wrap,children:[(0,E.jsx)("div",{className:j.Z.questionTitleEditorWrap,children:(0,E.jsx)(v.Z.Item,{label:"题干",name:l,labelCol:{span:24},rules:[{required:!0}],children:(0,E.jsx)(C.h,{scrollId:"name",watch:!0,height:140,placeholder:n})})}),(0,E.jsx)(v.Z.Item,{label:"参考答案",name:g,labelCol:{span:24},children:(0,E.jsx)(Y,{watch:!0,height:140,placeholder:"请编辑参考答案(非必填)"})}),i&&!o&&(0,E.jsx)(v.Z.Item,{hidden:!0,name:Z,valuePropName:"checked",children:(0,E.jsx)(N.Z,{defaultChecked:!0})}),i&&o&&(0,E.jsxs)(w.Z,{align:"middle",className:"mb30",children:[(0,E.jsx)(v.Z.Item,{name:Z,valuePropName:"checked",children:(0,E.jsx)(N.Z,{onChange:function(){var e,n;console.log(t.getFieldsValue()),V(null===(e=t.getFieldsValue())||void 0===e||null===(e=e.sub_item_banks)||void 0===e||null===(e=e[B])||void 0===e?void 0:e.use_keywords),console.log(null===(n=t.getFieldsValue())||void 0===n||null===(n=n.sub_item_banks)||void 0===n||null===(n=n[B])||void 0===n?void 0:n.use_keywords),console.log(H)}})}),(0,E.jsx)(A.Z,{className:"ml10",children:"开启关键词自动判分"}),(0,E.jsx)(A.Z,{children:(0,E.jsx)(b.Z,{placement:"right",title:"选中后,需要设置每个关键词的分值,系统会根据设置的关键词进行自动判分; 所有关键词分值之和必须小于等于小题分值。",children:(0,E.jsx)(K.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})})})]}),(H||!o)&&(0,E.jsx)(v.Z.List,{name:k,rules:[{validator:function(e,n){return o?null!=n&&n.length?(null==n?void 0:n.reduce((function(e,n){return e+n.score}),0))>parseFloat(U)?Promise.reject(new Error("所有关键词的分值之和必须小于等于该小题的分值")):Promise.resolve():Promise.reject(new Error("请设置判分关键词")):Promise.resolve()}}],children:function(e,n){var i=n.add,r=n.remove;return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("div",{className:"".concat(j.Z.title," mb10"),children:o?"关键词":(0,E.jsx)("span",{style:{color:"#9096A3"},children:"判分关键词"})}),(0,E.jsxs)(w.Z,{align:"middle",className:"font14 mb30",children:[(0,E.jsx)(A.Z,{flex:1,children:(0,E.jsx)(P.Z,{value:D,onChange:function(e){G(e.target.value)},maxLength:50,allowClear:!0,onPressEnter:function(e){var n,r,o,a,l,c="".concat(null===(n=e.target)||void 0===n?void 0:n.value),u=null==c||null===(r=c.split("|"))||void 0===r||null===(r=r.filter((function(e){return!!e})))||void 0===r?void 0:r.map((function(e){return null==e?void 0:e.trim()})),d=t.getFieldValue(["sub_item_banks"].concat(s()(k))),p=(null==d||null===(o=d.map((function(e){return null==e?void 0:e.keyword})))||void 0===o?void 0:o.flat())||[],h=S()(u);try{for(h.s();!(a=h.n()).done;){var m=a.value;if(p.includes(m))return void W.ZP.error("为避免判分错误,请勿设置相同的关键词")}}catch(e){h.e(e)}finally{h.f()}(l=c)&&(new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~!@#¥……&*()—【】‘;:”“。,、?「」『』_\\+\\-·%《》]|[\\\\/]"),"|"!==l||(W.ZP.warning("关键词不能只输入一个“|”字符!"),0))&&(i({keyword:u,score:1}),G(""))},className:j.Z.inputBorder,placeholder:"支持设置多个关键词;并列关键词(或的关系)请用“|”分隔开"})}),(0,E.jsx)(A.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"},children:"“回车键”保存关键词"})]}),e.map((function(e){var n=e.key,t=e.name,i=p()(e,q);return(0,E.jsx)(w.Z,{className:"mb20",style:{marginRight:148},children:(0,E.jsx)(A.Z,{flex:1,children:(0,E.jsxs)(w.Z,{align:"middle",justify:"space-between",children:[(0,E.jsx)(v.Z.Item,u()(u()({},i),{},{name:[t,"keyword"],children:(0,E.jsx)(J,{onClose:function(){return r(t)}})})),o&&(0,E.jsx)(v.Z.Item,u()(u()({},i),{},{name:[t,"score"],label:"分值",rules:[{required:!0}],className:j.Z.blankInputNumberWrapper,children:(0,E.jsx)(x.Z,{className:j.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"请输入关键词分数"})}))]})})},n)}))]})}}),(0,E.jsx)("div",{onClick:function(){return L(!0)},children:(0,E.jsx)(v.Z.Item,{name:d,label:"题目解析",labelCol:{span:24},children:(0,E.jsx)(C.x,{placeholder:"请编辑题目解析(非必填)",isEdit:O})})})]})},X=["key","name"],$=g.Z.Panel,ee=function(e){var n=e.questionTitlePlaceholder,t=(e.choiceKey,e.form),r=e.withScore,o=(0,f.useState)([]),a=m()(o,2),l=a[0],c=a[1],d=function(e){c(e)};return(0,E.jsxs)("div",{className:j.Z.wrap,children:[(0,E.jsx)("div",{className:j.Z.questionTitleEditorWrap,children:(0,E.jsx)(v.Z.Item,{label:"题干",name:"name",labelCol:{span:24},rules:[{required:!0}],children:(0,E.jsx)(C.h,{scrollId:"name",watch:!0,height:140,placeholder:n})})}),(0,E.jsx)(v.Z.Item,{label:"小题",required:!0,labelCol:{span:24}}),(0,E.jsx)(v.Z.List,{name:"sub_item_banks",rules:[{validator:function(e,n){return n?Promise.resolve():Promise.reject(new Error("请添加小题"))}}],children:function(e,n){var o=n.add,a=n.remove,h=t.getFieldValue("sub_item_banks");return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(g.Z,{className:e.length>0?j.Z.collapseWrapper:"",bordered:!1,activeKey:l,onChange:d,expandIcon:function(e){var n=e.isActive;return(0,E.jsx)("i",{className:"iconfont icon-weizhankai ".concat(n?j.Z.open:j.Z.close),style:{fontSize:14,transition:"all .2s"}})},children:e.map((function(e,n){e.key;var o,l,s,c,d,m,f,g,y,C,_=e.name,S=p()(e,X);return(0,E.jsx)($,{className:j.Z.panel,forceRender:!0,header:(0,E.jsxs)("div",{className:j.Z.panelHeader,children:["第",n+1,"小题",(0,E.jsxs)("span",{children:["(","SINGLE"==(null==h||null===(o=h[_])||void 0===o?void 0:o.item_type)?"单选题":"MULTIPLE"==(null==h||null===(l=h[_])||void 0===l?void 0:l.item_type)?"多选题":"COMPLETION"==(null==h||null===(s=h[_])||void 0===s?void 0:s.item_type)?"填空题":"JUDGMENT"==(null==h||null===(c=h[_])||void 0===c?void 0:c.item_type)?"判断题":"简答题",")"]})]}),extra:(0,E.jsxs)(w.Z,{align:"middle",onClick:function(e){return e.stopPropagation()},children:[r&&(0,E.jsx)(v.Z.Item,u()(u()({},S),{},{rules:[{required:!0,message:"请输入小题分值"}],label:"分值",name:[_,"question_score"],className:j.Z.blankInputNumberWrapper,children:(0,E.jsx)(x.Z,{className:j.Z.blankInput,placeholder:"请输入当前小题分数",min:.1,precision:1,max:100,style:{width:150}})})),(0,E.jsx)(b.Z,{title:"删除",children:(0,E.jsx)(k.Z,{className:"".concat(j.Z.deleteIcon," ml40"),onClick:function(){return a(_)}})})]}),children:(0,E.jsxs)(v.Z.Item,u()(u()({},S),{},{name:_,children:[("SINGLE"==(null==h||null===(d=h[_])||void 0===d?void 0:d.item_type)||"MULTIPLE"==(null==h||null===(m=h[_])||void 0===m?void 0:m.item_type))&&(0,E.jsx)(i.u,{questionTitlePlaceholder:"请编辑选择题题干内容",allowChangeMode:"MULTIPLE"==(null==h||null===(f=h[_])||void 0===f?void 0:f.item_type),form:t,choiceKey:[_,"choices"],titleKey:[_,"name"],analysisKey:[_,"analysis"],choiceOptionsPath:["sub_item_banks",_,"choices"],choiceTextKey:"choice_text",answerKey:"is_answer"}),"COMPLETION"==(null==h||null===(g=h[_])||void 0===g?void 0:g.item_type)&&(0,E.jsx)(L,{form:t,questionTitlePlaceholder:"请编辑题干并设置填空项",scoreByBlank:!1,name:_,titleKey:[_,"name"],analysisKey:[_,"analysis"],isOrdered:[_,"is_ordered"],answerKey:[_,"standard_answers"]}),"JUDGMENT"==(null==h||null===(y=h[_])||void 0===y?void 0:y.item_type)&&(0,E.jsx)(z,{form:t,questionTitlePlaceholder:"请编辑判断题题干内容",titleKey:[_,"name"],analysisKey:[_,"analysis"],choiceKey:[_,"choices"]}),"SUBJECTIVE"==(null==h||null===(C=h[_])||void 0===C?void 0:C.item_type)&&(0,E.jsx)(Q,{showKeywords:!0,isMustKeyWords:!1,form:t,titleKey:[_,"name"],analysisKey:[_,"analysis"],answerTexts:[_,"answer_texts"],useKeywords:[_,"use_keywords"],keywords:[_,"keywords"],indexs:_,questionTitlePlaceholder:"请编辑简答题题干内容"})]}))},_)}))}),e.length<20&&(0,E.jsx)(y.Z,{menu:{items:[{label:(0,E.jsx)("div",{onClick:function(){o({name:"",choices:Array.from({length:4},(function(){return{choice_text:"",is_answer:0}})),analysis:"",item_type:"SINGLE"}),c([null==e?void 0:e.length].concat(s()(l)))},children:"单选题"}),key:"1",show:!0},{label:(0,E.jsx)("div",{onClick:function(){o({name:"",choices:Array.from({length:4},(function(){return{choice_text:"",is_answer:0}})),analysis:"",item_type:"MULTIPLE"}),c([null==e?void 0:e.length].concat(s()(l)))},children:"多选题"}),key:"2",show:!0},{label:(0,E.jsx)("div",{onClick:function(){o({name:"",choices:[{choice_text:"正确",is_answer:0},{choice_text:"错误",is_answer:0}],analysis:"",item_type:"JUDGMENT"}),c([null==e?void 0:e.length].concat(s()(l)))},children:"判断题"}),key:"3",show:!0},{label:(0,E.jsx)("div",{onClick:function(){o({name:"",analysis:"",is_ordered:!0,standard_answers:[],item_type:"COMPLETION",downcase:!0,no_space:!0}),c([null==e?void 0:e.length].concat(s()(l)))},children:"填空题"}),key:"4",show:!0},{label:(0,E.jsx)("div",{onClick:function(){o({name:"",answer_texts:[],keywords:[],use_keywords:!0,analysis:"",item_type:"SUBJECTIVE"}),c([null==e?void 0:e.length].concat(s()(l)))},children:"简答题"}),key:"5",show:!0}].filter((function(e){return e.show})).map((function(e){return{label:e.label,key:e.key}}))},children:(0,E.jsx)("div",{className:"".concat(j.Z.addBtn),children:"添加小题"})})]})}})]})},ne=t(75150)},71550:function(e,n,t){"use strict";t.d(n,{h:function(){return v}});var i=t(82242),r=t.n(i),o=t(79800),a=t.n(o),l=t(59301),s=t(57809),c=t(78241),u=t(3113),d=t(89780),p=t.n(d),h=(t(49324),t(20615),t(37712)),m=s.default.Option,f={labelCol:{span:4},wrapperCol:{span:20}},g={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};function v(e){var n=e.value,t=e.onChange,i=e.mode,o=e.options,s=void 0===o?{}:o,c=(0,l.useRef)(),u=(0,l.useState)(),d=a()(u,2),m=d[0],f=d[1];return(0,l.useEffect)((function(){if(m){var e=function(e){var n=e.getValue();t&&t(n)};return m.on("change",e),function(){m.off("change",e)}}}),[m,t]),(0,l.useEffect)((function(){m&&m.setOption("mode",i)}),[m,i]),(0,l.useEffect)((function(){m&&(n===m.getValue()&&""!==n||setTimeout((function(){m.setValue(n||"")}),300))}),[m,n]),(0,l.useEffect)((function(){if(c.current&&!m){var e=p().fromTextArea(c.current,r()({mode:i,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},s));f(e)}}),[c.current,m]),(0,h.jsx)("div",{className:"my-codemirror-container",children:(0,h.jsx)("textarea",{ref:c})})}n.Z=function(e){var n=e.callback,t=e.onCancel,i=(0,l.useState)("python"),o=a()(i,2),d=o[0],p=o[1];return(0,h.jsxs)(c.Z,r()(r()({},f),{},{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){n(e)},style:{width:500},children:[(0,h.jsx)(c.Z.Item,{label:"代码语言",name:"language",children:(0,h.jsx)(s.default,{getPopupContainer:function(e){return e.parentNode},onChange:function(e){p(g[e][1])},children:Object.keys(g).map((function(e){return(0,h.jsx)(m,{value:e,children:g[e][0]},e)}))})}),(0,h.jsx)(c.Z.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}],children:(0,h.jsx)(v,{mode:d})}),(0,h.jsxs)("div",{className:"flex-container flex-end",children:[(0,h.jsx)(u.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,h.jsx)(u.ZP,{type:"ghost",onClick:t,children:"取消"})]})]}))}},77162:function(e,n,t){"use strict";t.d(n,{Z:function(){return Ze}});var i=t(91232),r=t.n(i),o=t(79800),a=t.n(o),l=t(85573),s=t.n(l),c=t(59301),u=t(89780),d=t.n(u),p=t(76374),h=(t(49324),t(6313),t(25717),t(99498),t(25419),t(67549),t(36653)),m=t(37712),f=function(e){var n=e.value,t=void 0===n?"":n,i=(e.className,e.showTextOnly,e.showLines,e.style,(0,c.useMemo)((function(){return""}),[t]));return(0,m.jsx)(m.Fragment,{children:(0,m.jsx)("div",{dangerouslySetInnerHTML:{__html:i}})})},g=t(82242),v=t.n(g),w=[{title:"粗体",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"斜体",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"无序列表",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"有序列表",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"行内代码",icon:"md-iconfont icon-code",actionName:"code"},{title:"代码块(多语言风格)",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"链接",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"行内公式",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"数学图像",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"多行公式",icon:"iconfont icon-jisuan1",actionName:"latex"},"|",{title:"添加图片",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"插入画图",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"插入流程图",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"表格",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"换行",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"清空",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function x(e){var n=e.onActionCallback,t=e.title,i=e.icon,r=e.actionName,o=e.className,a=void 0===o?"":o,l=e.children;return(0,m.jsxs)("a",{title:t,className:a,onClick:function(){n(r)},children:[(0,m.jsx)("i",{className:"".concat(i)}),l]})}var b=function(e){var n=e.watch,t=e.showNullButton,i=e.showNullProgramButton,r=e.onActionCallback,o=e.fullScreen,a=e.insertTemp,l=e.hidetoolBar,s=e.extraUse,c=[].concat(w,[{title:"".concat(n?"关闭实时预览":"开启实时预览"),icon:"".concat(n?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"),actionName:"trigger-watch"}]);return(0,m.jsxs)("ul",{className:"markdown-toolbar-container",children:[!l&&c.map((function(e,n){return(0,m.jsx)("li",{children:e.actionName?(0,m.jsx)(x,v()(v()({},e),{},{onActionCallback:r})):(0,m.jsx)("span",{className:"v-line"})},n)})),t?(0,m.jsx)("li",{children:(0,m.jsx)(x,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-null-ch",onActionCallback:r,children:(0,m.jsx)("span",{className:"fill-tip",children:"点击插入\b填空项"})})}):null,i?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("li",{children:(0,m.jsx)(x,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-signal",onActionCallback:r,children:(0,m.jsx)("span",{className:"fill-tip",children:"+单行填空项"})})}),(0,m.jsx)("li",{children:(0,m.jsx)(x,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"增加填空",actionName:"add-multiple",onActionCallback:r,children:(0,m.jsx)("span",{className:"fill-tip",children:"+多行填空项"})})})]}):null,a&&(0,m.jsx)("li",{children:(0,m.jsx)(x,{icon:"md-iconfont icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(a),onActionCallback:r,children:(0,m.jsx)("span",{className:"fill-tip",children:"插入模板"})})}),s&&(0,m.jsx)("li",{children:s}),(0,m.jsx)("li",{className:"btn-full-screen",children:(0,m.jsx)(x,{icon:"".concat(o?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"),title:o?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:r})})]})},y=t(30043),j=t(78241),k=t(98135),C=t(3113),_={labelCol:{span:4},wrapperCol:{span:20}},S=function(e){var n=e.callback,t=e.onCancel;return(0,m.jsxs)(j.Z,v()(v()({},_),{},{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(e){n(e)},style:{width:500},children:[(0,m.jsx)(j.Z.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}],children:(0,m.jsx)(k.Z,{})}),(0,m.jsx)(j.Z.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}],children:(0,m.jsx)(k.Z,{})}),(0,m.jsxs)("div",{className:"flex-container flex-end",children:[(0,m.jsx)(C.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,m.jsx)(C.ZP,{type:"ghost",onClick:t,children:"取消"})]})]}))},Z=t(71550),A=t(8591),P=t(53842),N=j.Z.useForm,E={width:280,marginRight:10},B={labelCol:{span:5},wrapperCol:{span:19}},T=function(e){var n=e.callback,t=e.onCancel,i=N(),r=a()(i,1)[0],o=(0,c.useRef)();function l(e,n){-1!==e.status?r.setFieldsValue({src:"/api/attachments/".concat(e.id),type:n.type}):A.ZP.error(e.message)}return(0,m.jsxs)(j.Z,v()(v()({form:r},B),{},{className:"upload-image-panel",onFinish:function(e){n(e,o.current)},style:{width:470,overflow:"hidden"},children:[(0,m.jsx)(j.Z.Item,{label:"图片地址",required:!0,children:(0,m.jsxs)("div",{className:"flex-container",children:[(0,m.jsx)(j.Z.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入图片地址"}],children:(0,m.jsx)(k.Z,{style:E})}),(0,m.jsx)(I,{onFileChange:function(e){var n=e.target.files[0];o.current=n,O(n,l)}})]})}),(0,m.jsx)(j.Z.Item,{label:"图片描述",name:"alt",children:(0,m.jsx)(k.Z,{style:{width:264}})}),(0,m.jsxs)(j.Z.Item,{style:{textAlign:"right"},children:[(0,m.jsx)(C.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,m.jsx)(C.ZP,{type:"default",onClick:t,children:"取消"})]})]}))};function I(e){var n=e.onFileChange;return(0,m.jsxs)("label",{className:"upload-button",style:{cursor:"pointer"},children:["本地上传",(0,m.jsx)("input",{type:"file",onChange:n})]})}function O(e,n){if(!e)throw new String("没有文件");var t=new FormData;t.append("editormd-image-file",e),t.append("file_param_name","editormd-image-file"),t.append("byxhr","true");var i=new window.XMLHttpRequest;i.withCredentials=!0,i.addEventListener("load",(function(t){n(JSON.parse(t.target.responseText),e)}),!1),i.addEventListener("error",(function(e){console.error(e)}),!1),i.open("POST","".concat(P.KI,"/api/attachments.json")),i.send(t)}var L=t(95237),M=t(87359),R=function(e){var n=e.callback,t=e.onCancel,i=document.createElement("canvas"),r=i.getContext("2d");i.width=1e3,i.height=800,r.fillStyle="#ffffff",r.fillRect(0,0,i.width,i.height);var o=i.toDataURL("image/png");return(0,m.jsx)(L.Z,{style:{height:"100vh"},children:(0,m.jsx)(M.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:o,visible:!0,title:String(Date.now())},onOk:function(e){n({src:e.url})},onClose:t})})},D=t(7557),G=t.n(D),F=t(41498),z=t.n(F),W=t(37205),H=t.n(W),V=t(12378);function K(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(K,go.CommandHandler),K.prototype.canAlignSelection=function(){var e=this.diagram;return null!==e&&!e.isReadOnly&&!e.isModelReadOnly&&!(e.selection.count<2)},K.prototype.alignLeft=function(){var e=this.diagram;e.startTransaction("aligning left");var n=1/0;e.selection.each((function(e){e instanceof go.Link||(n=Math.min(e.position.x,n))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(n,e.position.y))})),e.commitTransaction("aligning left")},K.prototype.alignRight=function(){var e=this.diagram;e.startTransaction("aligning right");var n=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var t=e.actualBounds.x+e.actualBounds.width;n=Math.max(t,n)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(n-e.actualBounds.width,e.position.y))})),e.commitTransaction("aligning right")},K.prototype.alignTop=function(){var e=this.diagram;e.startTransaction("alignTop");var n=1/0;e.selection.each((function(e){e instanceof go.Link||(n=Math.min(e.position.y,n))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.position.x,n))})),e.commitTransaction("alignTop")},K.prototype.alignBottom=function(){var e=this.diagram;e.startTransaction("aligning bottom");var n=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var t=e.actualBounds.y+e.actualBounds.height;n=Math.max(t,n)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,n-e.actualBounds.height))})),e.commitTransaction("aligning bottom")},K.prototype.alignCenterX=function(){var e=this.diagram,n=e.selection.first();if(n){e.startTransaction("aligning Center X");var t=n.actualBounds.x+n.actualBounds.width/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(t-e.actualBounds.width/2,e.actualBounds.y))})),e.commitTransaction("aligning Center X")}},K.prototype.alignCenterY=function(){var e=this.diagram,n=e.selection.first();if(n){e.startTransaction("aligning Center Y");var t=n.actualBounds.y+n.actualBounds.height/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,t-e.actualBounds.height/2))})),e.commitTransaction("aligning Center Y")}},K.prototype.alignColumn=function(e){var n=this.diagram;n.startTransaction("align Column"),void 0===e&&(e=0),e=parseFloat(e);var t=new Array;n.selection.each((function(e){e instanceof go.Link||t.push(e)}));for(var i=0;i0){for(var i=a.elt(l-1);null!==i&&i.isTreeExpanded&&!i.isTreeLeaf;){i=this._sortTreeChildrenByY(i).last()}null!==i&&e.select(i)}else e.select(o)}else if("Down"===t.key){var r;if(n.isTreeExpanded&&!n.isTreeLeaf)null!==(r=this._sortTreeChildrenByY(n).first())&&e.select(r);else for(;null!==n;){var o,a,l;if(null===(o=n.findTreeParentNode()))break;if((l=(a=this._sortTreeChildrenByY(o)).indexOf(n))i.y?1:t.xi.x?1:0})),n},K.prototype.copyToClipboard=function(e){go.CommandHandler.prototype.copyToClipboard.call(this,e),this._lastPasteOffset.set(this.pasteOffset)},K.prototype.pasteFromClipboard=function(){var e=go.CommandHandler.prototype.pasteFromClipboard.call(this);return this.diagram.moveParts(e,this._lastPasteOffset),this._lastPasteOffset.add(this.pasteOffset),e},Object.defineProperty(K.prototype,"arrowKeyBehavior",{get:function(){return this._arrowKeyBehavior},set:function(e){if("move"!==e&&"select"!==e&&"scroll"!==e&&"tree"!==e&&"none"!==e)throw new Error('DrawCommandHandler.arrowKeyBehavior must be either "move", "select", "scroll", "tree", or "none", not: '+e);this._arrowKeyBehavior=e}}),Object.defineProperty(K.prototype,"pasteOffset",{get:function(){return this._pasteOffset},set:function(e){if(!(e instanceof go.Point))throw new Error("DrawCommandHandler.pasteOffset must be a Point, not: "+e);this._pasteOffset.set(e)}});var U=K,q=(t(79286),t(85160)),Y=t(43418),J=t(43604),Q=t(90694),X="myPaletteDiv___Xjz2I",$="maxH60___Pd4Re";window.go=V;var ee=function(e){var n=e.onCancel,t=e.callback,i=(0,c.useRef)(),r=(0,c.useRef)(),o=(0,c.useRef)(),l=(0,c.useRef)(!1),s=(0,c.useRef)(!1),u=(0,c.useState)(0),d=a()(u,2),p=d[0],h=d[1],f=function(){var e=z()(G()().mark((function e(){var n,r;return G()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.current.makeImage(),e.next=3,(0,Q.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:n.src}});case 3:r=e.sent,t({src:r.url});case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,c.useEffect)((function(){h(p+1)}),[]),(0,m.jsx)("div",{ref:s,className:l.current?"".concat($," body-overflow-initial"):"body-overflow-initial",children:(0,m.jsx)(Y.Z,{width:1200,icon:null,footer:null,closable:!0,visible:!!p,destroyOnClose:!0,maskClosable:!1,getContainer:s.current,rootClassName:"zIndex-9999",title:(0,m.jsxs)(L.Z,{children:[(0,m.jsx)(J.Z,{flex:1,children:"插入流程图"}),(0,m.jsx)(J.Z,{onClick:function(){l.current=!l.current,h(p+1)},children:(0,m.jsx)("span",{className:"current c-blue mr30",style:{fontWeight:400},children:"展开/收起"})})]}),onCancel:n,children:(0,m.jsxs)("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative"},children:[(0,m.jsxs)("div",{style:{display:"flex",height:"100%"},children:[(0,m.jsxs)("div",{style:{width:"300px",height:"100%"},children:[(0,m.jsx)("div",{style:{background:"#fff",position:"relative",zIndex:12,fontSize:16,color:"#3061d0"},children:"图形库"}),(0,m.jsx)("div",{style:{height:"calc(100% - 50px)"},className:X,ref:o})]}),(0,m.jsxs)("div",{style:{flex:1,position:"relative"},children:[(0,m.jsx)(q.FI,{initDiagram:function(){var e=V.GraphObject.make,n="#ff3333",t="#3358ff",a="#25ad23",l="#d533ff",s="#7d33ff",c="#ff6233",u="#ffffff",d="#000000",p="#fffcd5",h="#d5ebff",m="#f2dfe0",f="#a5d2fa",g="#cccccc",v="#b3e6b3",w="#fcbbbd";function x(n,t){var i=function(e,t){e.handled=!0,e.diagram.model.commit((function(i){var r=t.part.adornedPart,o=(new V.Point).setRectSpot(r.actualBounds,n);o.subtract(r.location),o.scale(2,2),o.x+=130*Math.sign(o.x),o.y+=130*Math.sign(o.y),o.add(r.location),o.snapToGridPoint(e.diagram.grid.gridOrigin,e.diagram.grid.gridCellSize);var a=i.copyNodeData(r.data);i.setGroupKeyForNodeData(a,i.getGroupKeyForNodeData(r.data)),i.addNodeData(a);var l={from:r.key,to:i.getKeyForNodeData(a)};i.addLinkData(l);var s=e.diagram.findNodeForData(a);s.location=o,e.diagram.select(s),setTimeout((function(){e.diagram.commandHandler.editTextBlock()}),20)}))};return e(V.Shape,{figure:t,alignment:n,alignmentFocus:n.opposite(),width:n.equals(V.Spot.Top)||n.equals(V.Spot.Bottom)?25:18,height:n.equals(V.Spot.Top)||n.equals(V.Spot.Bottom)?18:25,fill:"orange",stroke:u,strokeWidth:4,mouseEnter:function(e,n){return n.fill="dodgerblue"},mouseLeave:function(e,n){return n.fill="orange"},isActionable:!0,click:i,contextClick:i})}function b(n){return e(V.Shape,{fill:"orange",stroke:"rgba(0, 0, 0, 0)",strokeWidth:15,background:"transparent",geometryString:"F1 M0 0 b 0 360 -4 0 4 z M10 0 b 0 360 -4 0 4 z M20 0 b 0 360 -4 0 4",isActionable:!0,cursor:"context-menu",mouseEnter:function(e,n){return n.fill="dodgerblue"},mouseLeave:function(e,n){return n.fill="orange"},click:function(e,n){e.diagram.commandHandler.showContextMenu(n.part.adornedPart)}},n||{})}function y(e,n){return function(t,i){t.handled=!0,t.diagram.model.commit((function(t){t.set(i.part.adornedPart.data,e,n)}))}}function j(n,t){return t||(t="color"),e(V.Shape,{width:16,height:16,stroke:"lightgray",fill:n,margin:1,background:"transparent",mouseEnter:function(e,n){return n.stroke="dodgerblue"},mouseLeave:function(e,n){return n.stroke="lightgray"},click:y(t,n),contextClick:y(t,n)})}function k(){return[e("ContextMenuButton",e(V.Panel,"Horizontal",j(u,"fill"),j(p,"fill"),j(h,"fill"),j(m,"fill"))),e("ContextMenuButton",e(V.Panel,"Horizontal",j(g,"fill"),j(v,"fill"),j(f,"fill"),j(w,"fill")))]}function C(){return[e("ContextMenuButton",e(V.Panel,"Horizontal",j(d),j(a),j(t),j(n))),e("ContextMenuButton",e(V.Panel,"Horizontal",j(u),j(l),j(s),j(c)))]}function _(n,t){return t||(t="thickness"),e(V.Shape,"LineH",{width:16,height:16,strokeWidth:n,margin:1,background:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:y(t,n),contextClick:y(t,n)})}function S(n,t){return t||(t="dash"),e(V.Shape,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:n,margin:1,background:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:y(t,n),contextClick:y(t,n)})}function Z(){return[e("ContextMenuButton",e(V.Panel,"Horizontal",_(1),_(2),_(3),_(4))),e("ContextMenuButton",e(V.Panel,"Horizontal",S(null),S([2,4]),S([4,4])))]}function A(n,t){return t||(t="figure"),e(V.Shape,{width:32,height:32,scale:.5,fill:"lightgray",figure:n,margin:1,background:"transparent",mouseEnter:function(e,n){return n.fill="dodgerblue"},mouseLeave:function(e,n){return n.fill="lightgray"},click:y(t,n),contextClick:y(t,n)})}function P(n){return e(V.Shape,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(n+4).toString()+" H3"})}function N(n){var t="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return 0===n?t="M0 0 M16 16 M0 8 L16 8":2===n&&(t="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),e(V.Shape,{geometryString:t,margin:2,background:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:y("dir",n),contextClick:y("dir",n)})}function E(n){var t=function(e,t){e.handled=!0,e.diagram.model.commit((function(e){var i=t.part.adornedPart;e.set(i.data,n?"toSpot":"fromSpot",V.Spot.stringify(V.Spot.AllSides)),(n?i.toNode:i.fromNode).invalidateConnectedLinks()}))};return e(V.Shape,{width:12,height:12,fill:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:t,contextClick:t})}function B(n,t){var i=0,r=V.Spot.RightSide;n.equals(V.Spot.Top)?(i=270,r=V.Spot.TopSide):n.equals(V.Spot.Left)?(i=180,r=V.Spot.LeftSide):n.equals(V.Spot.Bottom)&&(i=90,r=V.Spot.BottomSide),t||(i-=180);var o=function(e,n){e.handled=!0,e.diagram.model.commit((function(e){var i=n.part.adornedPart;e.set(i.data,t?"toSpot":"fromSpot",V.Spot.stringify(r)),(t?i.toNode:i.fromNode).invalidateConnectedLinks()}))};return e(V.Shape,{alignment:n,alignmentFocus:n.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:i,background:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:o,contextClick:o})}return i.current=new V.Diagram(r.current,{padding:20,grid:e(V.Panel,"Grid",e(V.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(V.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),"draggingTool.isGridSnapEnabled":!0,handlesDragDropForTopLevelParts:!0,mouseDrop:function(e){e.diagram.commandHandler.addTopLevelParts(e.diagram.selection,!0)||e.diagram.currentTool.doCancel()},commandHandler:e(U),"clickCreatingTool.archetypeNodeData":{text:"未命名",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:function(e){var n=e.subject;n.location=n.location.copy().snapToGridPoint(e.diagram.grid.gridOrigin,e.diagram.grid.gridCellSize),setTimeout((function(){e.diagram.commandHandler.editTextBlock()}),20)},"commandHandler.archetypeGroupData":{isGroup:!0,text:"NEW GROUP"},SelectionGrouped:function(e){e.subject;setTimeout((function(){e.diagram.commandHandler.editTextBlock()}))},LinkRelinked:function(e){e.parameter.part.invalidateConnectedLinks();var n=e.subject;e.diagram.toolManager.linkingTool.isForwards?n.toNode.invalidateConnectedLinks():n.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),i.current.nodeTemplate=e(V.Node,"Auto",{locationSpot:V.Spot.Center,locationObjectName:"SHAPE",desiredSize:new V.Size(120,60),minSize:new V.Size(40,40),resizable:!0,resizeCellSize:new V.Size(10,10),rotatable:!0},new V.Binding("location","loc",V.Point.parse).makeTwoWay(V.Point.stringify),new V.Binding("desiredSize","size",V.Size.parse).makeTwoWay(V.Size.stringify),e(V.Shape,{name:"SHAPE",fill:u,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:V.Spot.AllSides,toSpot:V.Spot.AllSides},new V.Binding("figure"),new V.Binding("fill"),new V.Binding("stroke","borderColor"),new V.Binding("strokeWidth","thickness"),new V.Binding("strokeDashArray","dash")),e(V.Shape,{width:100,height:20,strokeWidth:0,fill:"transparent"}),e(V.TextBlock,{margin:1,textAlign:"center",overflow:V.TextBlock.OverflowEllipsis,editable:!0},new V.Binding("text").makeTwoWay(),new V.Binding("stroke","color"))),i.current.nodeTemplate.toolTip=e("ToolTip",e(V.Panel,"Vertical",{maxSize:new V.Size(200,NaN)},e(V.TextBlock,{font:"bold 10pt sans-serif",textAlign:"center"},new V.Binding("text")),e(V.TextBlock,{font:"10pt sans-serif",textAlign:"center"},new V.Binding("text","details")))),i.current.nodeTemplate.selectionAdornmentTemplate=e(V.Adornment,"Spot",e(V.Placeholder,{padding:10}),x(V.Spot.Top,"TriangleUp"),x(V.Spot.Left,"TriangleLeft"),x(V.Spot.Right,"TriangleRight"),x(V.Spot.Bottom,"TriangleDown"),b({alignment:new V.Spot(.75,0)})),i.current.nodeTemplate.contextMenu=e("ContextMenu",e("ContextMenuButton",e(V.Panel,"Horizontal",A("Rectangle"),A("RoundedRectangle"),A("Ellipse"),A("Diamond"))),e("ContextMenuButton",e(V.Panel,"Horizontal",A("Parallelogram2"),A("ManualOperation"),A("Procedure"),A("Cylinder1"))),e("ContextMenuButton",e(V.Panel,"Horizontal",A("Terminator"),A("CreateRequest"),A("Document"),A("TriangleDown"))),k(),C(),Z()),i.current.groupTemplate=e(V.Group,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:V.Spot.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:function(e,n){n.addMembers(n.diagram.selection,!0)||n.diagram.currentTool.doCancel()},avoidable:!1},new V.Binding("location","loc",V.Point.parse).makeTwoWay(V.Point.stringify),e(V.Panel,"Auto",{name:"BODY"},e(V.Shape,{parameter1:10,fill:u,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:V.Spot.AllSides,toSpot:V.Spot.AllSides},new V.Binding("fill"),new V.Binding("stroke","color"),new V.Binding("strokeWidth","thickness"),new V.Binding("strokeDashArray","dash")),e(V.Placeholder,{background:"transparent",margin:20})),e(V.TextBlock,{alignment:V.Spot.Top,alignmentFocus:V.Spot.Bottom,font:"bold 12pt sans-serif",editable:!0},new V.Binding("text"),new V.Binding("stroke","color"))),i.current.groupTemplate.selectionAdornmentTemplate=e(V.Adornment,"Spot",e(V.Panel,"Auto",e(V.Shape,{fill:null,stroke:"dodgerblue",strokeWidth:3}),e(V.Placeholder,{margin:1.5})),b({alignment:V.Spot.TopRight,alignmentFocus:V.Spot.BottomRight})),i.current.groupTemplate.contextMenu=e("ContextMenu",k(),C(),Z()),i.current.linkTemplate=e(V.Link,{layerName:"Foreground",routing:V.Link.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new V.Binding("fromSpot","fromSpot",V.Spot.parse),new V.Binding("toSpot","toSpot",V.Spot.parse),new V.Binding("fromShortLength","dir",(function(e){return e>=1?10:0})),new V.Binding("toShortLength","dir",(function(e){return e>=1?10:0})),new V.Binding("points").makeTwoWay(),e(V.Shape,{strokeWidth:2},new V.Binding("stroke","color"),new V.Binding("strokeWidth","thickness"),new V.Binding("strokeDashArray","dash")),e(V.Shape,{segmentIndex:0,segmentOffset:new V.Point(15,0),segmentOrientation:V.Link.OrientAlong,alignmentFocus:V.Spot.Right,figure:"circle",width:10,strokeWidth:0},new V.Binding("fill","color"),new V.Binding("visible","dir",(function(e){return 1===e}))),e(V.Shape,{segmentIndex:-1,segmentOffset:new V.Point(-10,6),segmentOrientation:V.Link.OrientPlus90,alignmentFocus:V.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new V.Binding("fill","color"),new V.Binding("visible","dir",(function(e){return e>=1})),new V.Binding("width","thickness",(function(e){return 7+3*e})),new V.Binding("height","thickness",(function(e){return 7+3*e})),new V.Binding("segmentOffset","thickness",(function(e){return new V.Point(-15,4+1.5*e)}))),e(V.Shape,{segmentIndex:0,segmentOffset:new V.Point(15,-6),segmentOrientation:V.Link.OrientMinus90,alignmentFocus:V.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new V.Binding("fill","color"),new V.Binding("visible","dir",(function(e){return 2===e})),new V.Binding("width","thickness",(function(e){return 7+3*e})),new V.Binding("height","thickness",(function(e){return 7+3*e})),new V.Binding("segmentOffset","thickness",(function(e){return new V.Point(-15,4+1.5*e)}))),e(V.TextBlock,{alignmentFocus:new V.Spot(0,1,-4,0),editable:!0},new V.Binding("text").makeTwoWay(),new V.Binding("stroke","color"))),i.current.linkTemplate.selectionAdornmentTemplate=e(V.Adornment,e(V.Shape,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:P(2)},new V.Binding("pathPattern","thickness",P)),b({alignmentFocus:new V.Spot(0,0,-6,-4)})),i.current.linkTemplate.contextMenu=e("ContextMenu",C(),Z(),e("ContextMenuButton",e(V.Panel,"Horizontal",N(0),N(1),N(2))),e("ContextMenuButton",e(V.Panel,"Horizontal",e(V.Panel,"Spot",E(!1),B(V.Spot.Top,!1),B(V.Spot.Left,!1),B(V.Spot.Right,!1),B(V.Spot.Bottom,!1)),e(V.Panel,"Spot",{margin:new V.Margin(0,0,0,2)},E(!0),B(V.Spot.Top,!0),B(V.Spot.Left,!0),B(V.Spot.Right,!0),B(V.Spot.Bottom,!0))))),new V.Palette(o.current,{maxSelectionCount:1,linkTemplate:e(V.Link,{locationSpot:V.Spot.Center,selectionAdornmentTemplate:e(V.Adornment,"Link",{locationSpot:V.Spot.Center},e(V.Shape,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),e(V.Shape,{toArrow:"Standard",stroke:null}))},{routing:V.Link.AvoidsNodes,curve:V.Link.JumpOver,corner:5,toShortLength:4},new V.Binding("points"),e(V.Shape,{isPanelMain:!0,strokeWidth:2}),e(V.Shape,{toArrow:"Standard",stroke:null})),model:new V.GraphLinksModel([{text:"未命名",size:"100 100",fill:null,stroke:"#000"}].concat(H()(V.Shape.getFigureGenerators().toArray().map((function(e){return{text:"未命名",size:"100 100",figure:e.key,fill:"white",stroke:"#666",borderColor:"#000"}})))))}).nodeTemplate=e(V.Node,"Auto",{locationSpot:V.Spot.Center},new V.Binding("location","location",V.Point.parse).makeTwoWay(V.Point.stringify),e(V.Shape,"Circle",{fill:"white",stroke:"gray",strokeWidth:2,width:20,height:20,portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromLinkableSelfNode:!0,toLinkableSelfNode:!0},new V.Binding("stroke").makeTwoWay(),new V.Binding("fill").makeTwoWay(),new V.Binding("figure")),e(V.TextBlock,{margin:new V.Margin(5,5,3,5),font:"10pt sans-serif",minSize:new V.Size(16,16),maxSize:new V.Size(10,NaN),textAlign:"center",editable:!0},new V.Binding("key").makeTwoWay())),setTimeout((function(){i.current.grid=e(V.Panel,"Grid",e(V.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(V.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),i.current.grid.visible=!0,i.current.grid.gridCellStroke="darkgray",i.current.grid.gridCellStrokeWidth=1}),300),window.myDiagrams=i.current,i.current},divClassName:"diagram-component",style:{height:"80vh"}}),(0,m.jsx)("div",{ref:r})]})]}),(0,m.jsx)("div",{className:"tr",children:(0,m.jsx)(C.ZP,{size:"large",onClick:f,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary",children:"保存到编辑器"})})]})})})},ne=t(5112),te=t(54449),ie=ne.ZP.Group,re={margin:"0 8px"},oe=function(e){var n=e.callback,t=e.onCancel;return(0,m.jsxs)(j.Z,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(e){n(e)},children:[(0,m.jsxs)("div",{className:"flex-container",style:{alignItems:"baseline"},children:[(0,m.jsx)("span",{style:re,children:"单元格数:"}),(0,m.jsx)("span",{style:re,children:"行数"}),(0,m.jsx)(j.Z.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}],children:(0,m.jsx)(te.Z,{})}),(0,m.jsx)("span",{style:re,children:"列数"}),(0,m.jsx)(j.Z.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}],children:(0,m.jsx)(te.Z,{})})]}),(0,m.jsxs)("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"},children:[(0,m.jsx)("span",{style:re,children:"对齐方式:"}),(0,m.jsx)(j.Z.Item,{name:"align",children:(0,m.jsxs)(ie,{children:[(0,m.jsx)(ne.ZP,{value:"default",children:(0,m.jsx)("i",{className:"fa fa-align-justify"})}),(0,m.jsx)(ne.ZP,{value:"left",children:(0,m.jsx)("i",{className:"fa fa-align-left"})}),(0,m.jsx)(ne.ZP,{value:"center",children:(0,m.jsx)("i",{className:"fa fa-align-center"})}),(0,m.jsx)(ne.ZP,{value:"right",children:(0,m.jsx)("i",{className:"fa fa-align-right"})})]})})]}),(0,m.jsxs)("div",{className:"flex-container flex-end",children:[(0,m.jsx)(C.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,m.jsx)(C.ZP,{type:"ghost",onClick:t,children:"取消"})]})]})},ae=t(78673),le=t(35575),se=t.n(le),ce=(0,c.forwardRef)((function(e,n){var t=e.use3d,i=e.width,r=e.height,o=e.callback,l=(e.showSaveButton,(0,c.useRef)()),s=(0,c.useRef)(),u=(0,c.useState)(!1),d=a()(u,2),p=d[0],h=d[1],f=(0,c.useRef)({id:l,appName:"graphing",width:i||1e3,height:r||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,c.useEffect)((function(){s.current=new(se())(f.current,!0),window.onload=function(){s.current.inject("applet_container")}}),[]);var g=function(){var e=window.ggbApplet.getPNGBase64(1,!0,72);return o&&o(e),e};return(0,c.useEffect)((function(){f.current.appName=p?"3D":"graphing",s.current.inject("applet_container")}),[p]),(0,c.useEffect)((function(){h(t)}),[t]),(0,c.useImperativeHandle)(n,(function(){return{getImgData:g}})),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:l}),(0,m.jsxs)(L.Z,{align:"middle",children:[(0,m.jsx)(J.Z,{flex:1,children:(0,m.jsx)(ae.Z,{size:"default",checkedChildren:"关闭3D图像",unCheckedChildren:"开启3D图像",checked:p,onChange:function(e){return h(e)}})}),(0,m.jsx)(J.Z,{children:(0,m.jsx)(C.ZP,{size:"large",onClick:g,style:{zIndex:8,marginTop:10},type:"primary",children:"保存到编辑器"})})]})]})})),ue=t(42594),de=t(57357),pe="link",he="upload-image",me="add-flowchart",fe="draw-image",ge="code-block",ve="add-table",we="------------",xe={default:we,left:":".concat(we),center:":".concat(we,":"),right:"".concat(we,":")},be=t(40238);var ye="@▁▁@",je=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"];function ke(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var Ce=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",_e=s()(s()({},Ce+"-B","bold"),Ce+"-I","italic"),Se=s()(s()(s()(s()(s()(s()(s()(s()({},pe,"添加链接"),ge,"添加代码块"),he,"添加图片"),fe,"添加画图"),me,"插入流程图"),ve,"添加表格"),"maths-latex","数学图像"),"inline-latex","LATEX公式"),Ze=function(e){var n=e.defaultValue,t=void 0===n?"":n,i=e.onChange,o=e.width,l=void 0===o?"100%":o,u=e.height,g=void 0===u?400:u,v=e.miniToolbar,w=void 0!==v&&v,x=e.isFocus,j=void 0!==x&&x,k=e.watch,C=e.insertTemp,_=e.mode,P=void 0===_?"markdown":_,N=e.id,E=void 0===N?"markdown-editor-id":N,B=e.showResizeBar,I=void 0!==B&&B,L=e.noStorage,M=void 0!==L&&L,D=e.showNullButton,G=void 0!==D&&D,F=e.showNullProgramButton,z=void 0!==F&&F,W=e.hidetoolBar,H=void 0!==W&&W,V=e.fullScreen,K=void 0!==V&&V,U=e.onBlur,q=e.onCMBeforeChange,J=e.onFullScreen,Q=e.className,X=void 0===Q?"":Q,$=e.disablePaste,ne=void 0!==$&&$,te=e.disabled,ie=void 0!==te&&te,re=e.disabledFill,ae=void 0!==re&&re,le=e.placeholder,se=void 0===le?"":le,we=e.values,Ce=void 0===we?"":we,Ze=e.extraUse,Ae=(0,c.useState)(null),Pe=a()(Ae,2),Ne=Pe[0],Ee=Pe[1],Be=(0,c.useState)(t),Te=a()(Be,2),Ie=Te[0],Oe=Te[1],Le=(0,c.useState)(k),Me=a()(Le,2),Re=Me[0],De=Me[1],Ge=(0,c.useState)(K),Fe=a()(Ge,2),ze=Fe[0],We=Fe[1],He=(0,c.useState)(""),Ve=a()(He,2),Ke=Ve[0],Ue=Ve[1],qe=(0,c.useState)(0),Ye=a()(qe,2),Je=Ye[0],Qe=Ye[1],Xe=(0,c.useState)(g),$e=a()(Xe,2),en=$e[0],nn=$e[1],tn=(0,c.useState)(!1),rn=a()(tn,2),on=(rn[0],rn[1]),an=(0,c.useState)(0),ln=a()(an,2),sn=ln[0],cn=ln[1],un=(0,c.useState)(0),dn=a()(un,2),pn=dn[0],hn=dn[1],mn=(0,c.useRef)(),fn=(0,c.useRef)(),gn=(0,c.useRef)(),vn=(0,c.useRef)();(0,c.useEffect)((function(){var e=window.scrollY||window.pageYOffset;Oe(Ce),null==Ne||Ne.setValue(Ce),window.scrollTo(0,e)}),[Ce]),(0,c.useEffect)((function(){null==J||J(ze)}),[ze]),(0,c.useEffect)((function(){if(mn.current){var e=function(e,t){if(!ne){var i=t.clipboardData;if(i){var r=i.types.toString(),o=i.items;if("Files"===r||i.types.indexOf("Files")>-1){if(t.preventDefault(),"stex"==P)return;try{var a,l=o[1];"file"===(null===(a=o[0])||void 0===a?void 0:a.kind)&&(l=o[0]);var s=l.getAsFile(),c=s.name.split(".").pop();O(s,(function(e){var t,i,r;e.id?(null==s||null===(t=s.type)||void 0===t?void 0:t.indexOf("image"))>-1?n.replaceSelection("![,](/api/attachments/".concat(e.id,"?type=").concat(e.content_type,")")):(null==s||null===(i=s.type)||void 0===i?void 0:i.indexOf("video"))>-1?n.replaceSelection('')):(null==s||null===(r=s.type)||void 0===r?void 0:r.indexOf("pdf"))>-1?n.replaceSelection('').concat(s.name,"")):je.includes(c)?n.replaceSelection('').concat(s.name,"")):n.replaceSelection("[".concat(s.name,"](").concat(de.Z.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}))}catch(t){A.ZP.warning("请使用chrome浏览器粘贴")}return!0}return!0}return!0}t.preventDefault()},n=d().fromTextArea(mn.current,{mode:P,lineNumbers:!w,lineWrapping:!0,value:t,autoCloseTags:!0,autoCloseBrackets:!0});return n.on("keyup",(function(e,t){8===t.keyCode&&(""==e.getValue()?n.setOption("placeholder",se):n.setOption("placeholder",null))})),n.on("keydown",(function(e,n){if(8===n.keyCode){var t=function(e,n){var t=e.getDoc(),i=t.getCursor(),r=t.getLine(i.line),o=r.charAt(i.ch-1),a=r.lastIndexOf("@▁@",i.ch),l=r.lastIndexOf("@▁▁@",i.ch),s=a>l?a:l,c=a>l?3:4;if(-1===ye.indexOf(o))return null;if(console.log("change1:",n,e,r,i,s,a,l,o),s>=0&&i.ch-s<5){var u=s+c;return t.replaceRange("",{line:i.line,ch:s},{line:i.line,ch:u}),{line:i.line,ch:u}}return null}(e);t&&n.preventDefault()}})),j&&n.focus(),n.on("paste",e),ie&&n.on("beforeChange",(function(e,n){"paste"!==n.origin&&"+input"!==n.origin||n.cancel()})),Ee(n),function(){n.off("paste",e)}}}),[]);var wn=(0,c.useCallback)((function(){fn.current}),[en,fn,ze]);(0,c.useEffect)((function(){if(Ne){var e=function(){var e=new p.Z((function(e){var n,t=r()(e);try{for(t.s();!(n=t.n()).done;){var i=n.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&(wn(),Ne.setSize("100%","100%"),Ne.refresh())}}catch(e){t.e(e)}finally{t.f()}}));return e.observe(mn.current.parentElement),e}();return function(){var n,t;null!==(n=mn.current)&&void 0!==n&&n.parentElement&&e.unobserve(null===(t=mn.current)||void 0===t?void 0:t.parentElement)}}}),[Ne,wn]),(0,c.useEffect)((function(){if(Ne){for(var e=[],n=function(){var n=a()(i[t],2),r=n[0],o=n[1],l=s()({},r,(function(){xn(o)}));e.push(l),Ne.addKeyMap(l)},t=0,i=Object.entries(_e);t0){var e=(new Date).getTime(),n=window.sessionStorage.getItem(E);e>=Je+1e4&&(!n||n!==Ie)&&(window.sessionStorage.setItem(E,Ie),on(!0))}}),1e4),(0,c.useEffect)((function(){De(k)}),[Ne,k]),(0,c.useEffect)((function(){Ne&&j&&Ne.focus()}),[Ne,j]),(0,c.useEffect)((function(){if(Re&&Ne){var e=function(e){var n=e.target;if(vn.current){var t=n.scrollTop/n.scrollHeight;vn.current.scrollTop=vn.current.scrollHeight*t}},n=Ne.getScrollerElement();return n.addEventListener("scroll",e),function(){n.removeEventListener("scroll",e)}}}),[Ne,Re]),(0,c.useEffect)((function(){if(Ne&&q){var e=function(e,n){q(e,n)};return Ne.on("beforeChange",e),function(){Ne.off("beforeChange",e)}}}),[Ne,q]),(0,c.useEffect)((function(){if(Ne&&U){var e=function(){U(Ne.getValue())};return Ne.on("blur",e),function(){Ne.off("blur",e)}}}),[Ne,U]),(0,c.useEffect)((function(){if(Ne){var e=function(e,n){var t=e.getValue();Oe(t),Qe((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),i&&(z?i(t,Cn(t)):i(t))};return Ne.on("change",e),function(){Ne.off("change",e)}}}),[Ne,i]),(0,c.useEffect)((function(){if(Ne)if(null==t)Ne.setValue(""),Oe("");else{var e=window.scrollY||window.pageYOffset;t!==Ne.getValue()&&(Ne.setValue(t),Oe(t),Ne.setCursor(ie?1:Ne.lineCount(),0),window.scrollTo(0,e))}}),[Ne,t]);var xn=(0,c.useCallback)((function(e){var n=Ne.getCursor(),t=Ne.getSelection(),i=t.split("\n");switch(e){case"bold":return Ne.replaceSelection("**"+t+"**"),""===t&&Ne.setCursor(n.line,n.ch+2),Ne.focus();case"italic":return Ne.replaceSelection("*"+t+"*"),""===t&&Ne.setCursor(n.line,n.ch+1),Ne.focus();case"code":return Ne.replaceSelection("`"+t+"`"),""===t&&Ne.setCursor(n.line,n.ch+1),Ne.focus();case"inline-latex":return Ue("inline-latex"),Ne.focus();case"latex":return Ne.replaceSelection("```latex\n"+t+"\n```"),Ne.setCursor(n.line+1,t.length+1),Ne.focus();case"line-break":return Ne.replaceSelection("
\n"),Ne.focus();case"list-ul":return""===t?Ne.replaceSelection("- "+t):Ne.replaceSelection(i.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),Ne.focus();case"list-ol":return""===t?Ne.replaceSelection("1. "+t):Ne.replaceSelection(i.map((function(e,n){return""===e?"":"".concat(n+1,". ").concat(e)})).join("\n")),Ne.focus();case"add-null-ch":return""===t&&Ne.setCursor(n.line,n.ch),Ne.replaceSelection("▁"),Ne.focus();case"add-signal":return""===t&&Ne.setCursor(n.line,n.ch),Ne.replaceSelection("@▁@"),Ne.focus();case"add-multiple":return""===t&&Ne.setCursor(n.line,n.ch),Ne.replaceSelection(ye),Ne.focus();case"inster-template-1":return""===t&&Ne.setCursor(n.line,n.ch),Ne.replaceSelection("\n**模板标题**\n模板正文内容,可输入文本内容和粘贴图片等操作"),Ne.focus();case"eraser":return Ne.setValue(""),Ne.focus();case"trigger-watch":return De(!Re),Ne.focus();case"trigger-full-screen":return We(!ze),Ne.focus();case pe:return void Ue(pe);case ge:return void Ue(ge);case he:return void Ue(he);case fe:return void Ue(fe);case"maths-latex":return void Ue("maths-latex");case me:return void Ue(me);case ve:return void Ue(ve);default:throw new Error}}),[Ne,Re,ze]),bn=(0,c.useCallback)((function(e,n){var t,i,r,o,a;switch(Ue(""),Ke){case pe:var l=e.title,s=e.link;return Ne.replaceSelection("[".concat(l,"](").concat(s,")")),Ne.focus();case ge:var c=e.language,u=e.content;return Ne.replaceSelection(["```"+c,u,"```"].join("\n")),Ne.focus();case"maths-latex":for(var d=atob(e),p=new Uint8Array(d.length),h=0;h-1||null==g||!g.type?f?Ne.replaceSelection("![ ".concat(f," ]( ").concat(m,' "').concat(f,'" )')):Ne.replaceSelection("![,](".concat(m,")")):(null==g||null===(o=g.type)||void 0===o?void 0:o.indexOf("video"))>-1?Ne.replaceSelection('')):(null==g||null===(a=g.type)||void 0===a?void 0:a.indexOf("pdf"))>-1?Ne.replaceSelection('').concat(g.name,"")):je.includes(v)?Ne.replaceSelection('').concat(g.name,"")):Ne.replaceSelection("[".concat(g.name,"](").concat(de.Z.API_SERVER).concat(m,")")),Ne.focus();case ve:for(var w=e.row,x=e.col,b=e.align,y="\n",j=0;j300&&(n=300),nn(g+n+"px")}},i=gn.current,r=!1,o=0;return i.addEventListener("mousedown",e),document.addEventListener("mousemove",t),document.addEventListener("mouseup",n),function(){i.removeEventListener("mousedown",e),document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",n)}}}),[Ne,gn]),(0,c.useEffect)((function(){nn(g)}),[g]);var kn={width:ke(l),height:ke(en)},Cn=((0,c.useMemo)((function(){if(Je){var e=new Date(Je),n=e.getHours(),t=e.getMinutes(),i=e.getSeconds();return t=t<10?"0"+t:t,i=i<10?"0"+i:i,"".concat(n=n<10?"0"+n:n,":").concat(t,":").concat(i)}return 0}),[Je]),function(e){var n=[];if(z){e=e.replace(/(@▁▁@|@▁@)/g,(function(e,t,i){n.push({multiLine:!("@▁@"===e)})}))}return n});(0,c.useEffect)((function(){if(Se[Ke]&&Ke!==fe&&Ke!==me){var e=document.getElementsByClassName("ant-modal")[0],n=window.innerWidth/2-e.offsetWidth/2,t=window.innerHeight/2-e.offsetHeight/2;cn(n),hn(t)}}),[Ke]);var _n=function(e,n,t,i){var r=document.body.clientHeight,o=document.body.clientWidth;return!(e<20&&t>e||e>o-20&&tn||n>r-20&&i0&&(o.children=[],d(r,o.children))}))}function p(e,n){for(var t=[],i=0;i0){t[0]=o.id;for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:null;switch(ce.resetFields(),ce.setFieldsValue({item_type:e,item_banks_group_id:n}),He(e),e){case"SELECT":ce.setFieldsValue({choices:Array.from({length:4},(function(){return{choice_text:"",is_answer:0}}))});break;case"JUDGMENT":ce.setFieldsValue({choices:[{choice_text:"正确",is_answer:0},{choice_text:"错误",is_answer:0}]});break;case"COMPLETION":ce.setFieldsValue({standard_answers:[],downcase:!0,no_space:!0});break;case"SUBJECTIVE":ce.setFieldsValue({answer_texts:[],use_keywords:!0});break;case"COMBINATION":case"PROGRAM":break;case"BPROGRAM":ce.setFieldsValue({hack:{time_limit:3,allow_student_debug:!1,submit_rule:1}})}},Ye=function(e,n){var t;if(null!=e&&e.item_type&&("PROGRAM"===(null==e?void 0:e.item_type)&&(0,J.xg)("/problems/newcreate"),qe(null==e?void 0:e.item_type,null==n?void 0:n.item_banks_group_id)),null!=e&&e.course){var i=u()(e.course,2),r=(i[0],i[1]);tn(r),ce.setFieldsValue({knowledge:[]})}if(null!=e&&null!==(t=e.hack)&&void 0!==t&&t.sub_discipline_id){var o=u()(e.hack.sub_discipline_id,2),a=(o[0],o[1]);tn(a),ce.setFieldsValue({hack:{tag_discipline_ids:[]}})}},Je=(0,h.useState)(""),Qe=u()(Je,2),Xe=Qe[0],$e=Qe[1];(0,h.useEffect)((function(){$e(new Date)}),[ce.getFieldValue("course")]);var en=function(){var e=a()(r()().mark((function e(){var n,t,i,o,a,l,s,d,h,f,w,x,b,y,j,k,C,_,S,Z,A,P,N,E,B,T;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("COMPLETION"==(null==(n=ce.getFieldsValue())?void 0:n.item_type)&&null==n.is_ordered&&(n.is_ordered=!0),i=(t=n||{}).course,o=void 0===i?[]:i,a=t.item_type,l=t.item_banks_group_id,s=t.knowledge,d=void 0===s?[]:s,h=t.choices,f=u()(o,2),w=f[0],x=f[1],1!==be){e.next=41;break}if("PROGRAM"!==a){e.next=8;break}return(0,J.xg)("/problems/newcreate"),e.abrupt("return");case 8:if("BPROGRAM"!==a){e.next=24;break}if(j=[],(null==n||null===(b=n.hack)||void 0===b||null===(b=b.tag_discipline_ids)||void 0===b?void 0:b.length)>0?null==n||null===(k=n.hack)||void 0===k||null===(k=k.tag_discipline_ids)||void 0===k||k.map((function(e){null!=e&&e.value?j.push(null==e?void 0:e.value):j.push(e)})):j=[],C=p()(p()({},n),{},{hack:p()(p()({},null==n?void 0:n.hack),{},{sub_discipline_id:null==n||null===(y=n.hack)||void 0===y||null===(y=y.sub_discipline_id)||void 0===y?void 0:y[1],difficult:n.difficulty,item_banks_group_ids:n.item_banks_group_id,tag_discipline_ids:j}),hack_codes:p()(p()({},n.hack_codes),{},{code:te.Base64.encode(n.hack_codes.code)}),hack_sets:[p()({},n.hack_sets)],update_hack_sets:[p()({},n.hack_sets)],is_blank:!0}),!Ke&&!sessionStorage.projectFill){e.next=19;break}return e.next=15,(0,$.ZP)("/api/problems/".concat(ve.current||sessionStorage.projectFill,".json"),{method:"put",body:p()({},C)});case 15:0===e.sent.status&&m.history.replace("/problemset?group_id=".concat(n.hack.item_banks_group_id)),e.next=23;break;case 19:return e.next=21,(0,$.ZP)("/api/problems.json",{method:"post",body:p()({},C)});case 21:0===e.sent.status&&g.Z.confirm({title:"提示",centered:!0,icon:null,content:"试题新增成功",okText:"继续新增",cancelText:"返回列表",onOk:function(){qe(We,l)},onCancel:function(){m.history.replace("/problemset?group_id=".concat(l))}});case 23:return e.abrupt("return");case 24:if("SELECT"===a&&(a=h.filter((function(e){return 1===e.is_answer})).length>1?"MULTIPLE":"SINGLE"),"COMBINATION"===a&&(_=(n||{}).sub_item_banks,n.sub_item_banks=null==_?void 0:_.map((function(e){return p()({},e)}))),S=[],(null==d?void 0:d.length)>0&&(null!=d&&null!==(Z=d[0])&&void 0!==Z&&Z.value?null==d||d.map((function(e){S.push(null==e?void 0:e.value)})):S=d),A=p()(p()({},n),{},{discipline_id:w,sub_discipline_id:x,item_banks_group_ids:l,tag_discipline_ids:S,knowledge:S,item_type:a}),!Ke){e.next=35;break}return e.next=32,c({type:"problemset/editProblemset",payload:p()(p()({},A),{},{id:ve.current})});case 32:P=e.sent,e.next=38;break;case 35:return e.next=37,c({type:"problemset/addProblemset",payload:A});case 37:P=e.sent;case 38:0===P.status&&(Ke?m.history.replace("/problemset?group_id=".concat(l)):g.Z.confirm({title:"提示",centered:!0,icon:null,content:"试题新增成功",okText:"继续新增",cancelText:"返回列表",onOk:function(){qe(We,l)},onCancel:function(){m.history.replace("/problemset?group_id=".concat(l))}})),e.next=61;break;case 41:if(!((null==Ce?void 0:Ce.length)<=0)){e.next=44;break}return v.ZP.info("请上传试题文件"),e.abrupt("return");case 44:return Te(!0),(N=new FormData).append("file",Ce[0]),N.append("sub_discipline_id",x),e.next=50,(0,$.ZP)("/api/item_banks/file_import.json",{method:"post",body:N},!0);case 50:if(E=e.sent,Te(!1),0!==(null==E?void 0:E.status)){e.next=61;break}if(!((null==E||null===(B=E.fail)||void 0===B?void 0:B.length)>0)){e.next=57;break}return Pe(null==E?void 0:E.fail),v.ZP.error("上传失败题数为"+(null==E||null===(T=E.fail)||void 0===T?void 0:T.length)+",可在底部试题列表查看错误原因。"),e.abrupt("return");case 57:ce.setFieldsValue({course:[]}),_e([]),Pe([]),v.ZP.info("上传成功");case 61:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),nn=function(){var e=a()(r()().mark((function e(n){var t,i;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.errorFields[0].name.includes("standard_answers")?"请先在题干中插入填空项"===(null==n||null===(i=n.errorFields)||void 0===i||null===(i=i[0])||void 0===i||null===(i=i.errors)||void 0===i?void 0:i[0])?((0,J.pE)(),v.ZP.error("请先在题干中插入填空项")):v.ZP.error("填空项答案不能为空"):v.ZP.error(n.errorFields[0].errors[0]),ce.scrollToField(null==n||null===(t=n.errorFields)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.name,{behavior:"smooth",block:"center"});case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),tn=function(){var e=a()(r()().mark((function e(n){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c({type:"exercise/getTagDiscipline",payload:{sub_discipline_id:n}});case 2:return t=e.sent,ge(t.tag_disciplines),e.abrupt("return",null==t?void 0:t.tag_disciplines);case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,ie.jsx)("div",{className:S,children:(0,ie.jsxs)("section",{className:Z,children:[(0,ie.jsxs)(w.Z,{className:"mb20",separator:">",children:[(0,ie.jsx)(w.Z.Item,{href:"/problemset",children:"试题库"}),(0,ie.jsxs)(w.Z.Item,{children:[Ke?"编辑":"新增","试题"]})]}),(0,ie.jsxs)("div",{className:A,children:[!Ke&&(0,ie.jsx)(x.ZP.Group,{className:P,optionType:"button",options:[{label:"单个添加",value:1},{label:"批量导入",value:2}],onChange:function(e){ye(e.target.value),ce.setFieldsValue({course:[]}),_e([]),Pe([])},value:be}),1===be&&De&&(0,ie.jsxs)(f.Z,{form:ce,className:N,layout:"horizontal",colon:!1,onValuesChange:Ye,onFinish:en,onFinishFailed:nn,initialValues:De,children:[(0,ie.jsx)(f.Z.Item,{label:"试题类型",name:"item_type",rules:[{required:!0,message:"请选择题型"}],children:(0,ie.jsx)(x.ZP.Group,{disabled:Ke,optionType:"button",className:E,options:[{label:"选择题",value:"SELECT"},{label:"判断题",value:"JUDGMENT"},{label:"填空题",value:"COMPLETION"},{label:"简答题",value:"SUBJECTIVE"},{label:"编程题",value:"PROGRAM"},{label:"组合题",value:"COMBINATION"},{label:"程序填空题",value:"BPROGRAM"}]})}),(0,ie.jsx)("div",{className:U,children:(0,ie.jsx)(ae,{editId:ve.current,currentItemType:We,form:ce})}),"PROGRAM"!==We&&(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(f.Z.Item,{label:"知识点",labelCol:{flex:"62px"},className:"".concat(M," mb30"),style:{marginTop:"PROGRAM"===We?0:30},name:"BPROGRAM"===We?["hack","sub_discipline_id"]:"course",children:(0,ie.jsx)(b.Z,{className:R,popupClassName:q,dropdownMenuColumnStyle:{padding:"8px 12px",fontSize:14},showArrow:!0,placeholder:"请选择方向&课程",allowClear:!0,options:o.courseOptions,style:{width:490}})}),(0,ie.jsxs)("div",{style:{display:Le?"block":"none"},children:[(0,ie.jsx)(f.Z.Item,{style:{paddingLeft:62},label:"",name:"BPROGRAM"===We?["hack","tag_discipline_ids"]:"knowledge",labelCol:{flex:"62px"},labelAlign:"left",className:"".concat(D," mb30"),children:(0,ie.jsx)(Q.N,{selectvalues:Ve,subId:(null===(t=ce.getFieldsValue().course)||void 0===t?void 0:t[1])||(null===(i=ce.getFieldsValue())||void 0===i||null===(i=i.hack)||void 0===i||null===(i=i.sub_discipline_id)||void 0===i?void 0:i[1]),knowledgeOptions:fe,onAddKnowledgeFinish:function(e){ge([].concat(s()(fe),[p()({},e)]))}},Xe)}),(0,ie.jsx)(f.Z.Item,{labelCol:{flex:"62px"},labelAlign:"left",name:"difficulty",label:"难度",className:"".concat(B," mb30"),rules:[{required:!0,message:"请选择难度"}],children:(0,ie.jsxs)(x.ZP.Group,{optionType:"button",className:T,children:[(0,ie.jsx)(x.ZP.Button,{value:1,className:I,children:"简单"}),(0,ie.jsx)(x.ZP.Button,{value:2,className:O,children:"适中"}),(0,ie.jsx)(x.ZP.Button,{value:3,className:L,children:"困难"})]})}),(0,ie.jsx)(f.Z.Item,{label:"放入文件夹目录",rules:[{required:!0,message:"请选择文件夹"}],name:"item_banks_group_id",labelCol:{span:24},wrapperCol:{span:24},children:(0,ie.jsx)(ee.Z,{scrollId:"item_banks_group_id"})})]})]})]}),2===be&&(0,ie.jsxs)("div",{children:[(0,ie.jsxs)(f.Z,{form:ce,className:N,layout:"vertical",onValuesChange:Ye,onFinish:en,children:[(0,ie.jsx)(f.Z.Item,{className:M,label:"方向&课程:",name:"course",rules:[{required:!0,message:"请选择方向&课程"}],children:(0,ie.jsx)(b.Z,{className:R,popupClassName:q,dropdownMenuColumnStyle:{padding:"8px 12px",fontSize:14},placeholder:"请选择方向&课程",showArrow:!0,allowClear:!1,options:o.courseOptions,style:{width:490}})}),(0,ie.jsxs)("div",{className:"mb30",children:[(0,ie.jsxs)("span",{className:G,children:["根据模板要求编辑需要上传的试题",(0,ie.jsx)(y.Z,{title:(0,ie.jsxs)("div",{children:[(0,ie.jsx)("div",{children:"提示:"}),(0,ie.jsx)("div",{children:"1、目前仅支持Excel格式模板;"}),(0,ie.jsx)("div",{children:"2、不支持组合题和实训题导入;"}),(0,ie.jsx)("div",{children:"3、每次最多导入300题;"}),(0,ie.jsx)("div",{children:"4、填空题导入最多支持8个填空项。"})]}),children:(0,ie.jsx)(X.Z,{className:F})})]}),(0,ie.jsxs)("a",{className:"".concat(z," ml30"),href:_.Z.API_SERVER+"/api/item_banks/down_template",download:!0,children:["下载试题模版",(0,ie.jsx)("i",{className:"iconfont icon-xiazai4 ml10",style:{fontSize:14}})]})]}),(0,ie.jsx)(j.Z,{onRemove:function(){_e([])},beforeUpload:function(e){if(console.log(e),(null==e?void 0:e.size)>52428800)return v.ZP.info("文件超过50M,不符合上传要求"),!1;var n=[];return n.push(e),_e([].concat(n)),!1},fileList:Ce,accept:".xls,.xlsx",showUploadList:{removeIcon:(0,ie.jsx)("i",{className:"iconfont icon-shanchu12",style:{color:"#F65160"}})},children:(0,ie.jsxs)("div",{className:W,children:[(0,ie.jsx)("i",{className:"iconfont icon-shangchuan3",style:{fontSize:14}}),"点击上传"]})})]}),(0,ie.jsx)("br",{}),(null==Ae?void 0:Ae.length)>0&&(0,ie.jsx)("span",{style:{fontSize:"18px",display:"flex",width:"100%",justifyContent:"center"},children:"错误列表"}),(null==Ae?void 0:Ae.length)>0&&(0,ie.jsx)(k.Z,{style:{marginTop:"10px"},dataSource:Ae,columns:[{title:"题目名称",dataIndex:"name",key:"name"},{title:"错误原因",dataIndex:"message",key:"message"}]})]})]}),(0,ie.jsx)("div",{className:H,children:(0,ie.jsxs)("div",{className:V,children:[(0,ie.jsx)(C.ZP,{size:"middle",className:"".concat(K," mr20"),onClick:function(){return m.history.push("/problemset")},children:"取消"}),(0,ie.jsx)(C.ZP,{size:"middle",type:"primary",className:"".concat(K," mr20"),onClick:function(){return ce.submit()},loading:l["problemset/editProblemset"]||l["problemset/addProblemset"]||Be,children:"PROGRAM"===We&&1===be?"立即创建":"保存题目"})]})})]})})}))},26194:function(e,n){"use strict";n.Z={wrap:"wrap___ilWvf",deleteIcon:"deleteIcon___JBDG8",keywordTag:"keywordTag___iieCb",questionTitleEditorWrap:"questionTitleEditorWrap___MHB5s",choiceListWrap:"choiceListWrap___jB8b1",choiceWrap:"choiceWrap___QFkTc",choiceIndex:"choiceIndex___Mr2YO",judgementIndex:"judgementIndex___fUVWK",setAnswerBtn:"setAnswerBtn___Whox5",activeAnswer:"activeAnswer___fGU6Y",activeJudgementAnswer:"activeJudgementAnswer___wJv8P",actionWrapper:"actionWrapper___ERQ7k",addIcon:"addIcon___L9TE0",inputBorder:"inputBorder___Q5tRE",placeholder:"placeholder___p9sFY",blankInputNumberWrapper:"blankInputNumberWrapper___uEHb0",addBtn:"addBtn___WR5ZI",blankIndex:"blankIndex___x9Pny",baseInputWrapper:"baseInputWrapper___eVsG7",collapseWrapper:"collapseWrapper___ZTysU",panelHeader:"panelHeader___QSN9g",open:"open___B6FU9",close:"close___QX19r",hide:"hide___mn25n"}},66104:function(e,n,t){"use strict";t.d(n,{Z:function(){return N}});var i=t(92310),r=t.n(i),o=t(55401),a=t(87147),l=t(59301),s=t(92343),c=t(36355),u=t(43501),d=t(91857);const p=e=>{let{children:n}=e;const{getPrefixCls:t}=l.useContext(c.E_),i=t("breadcrumb");return l.createElement("li",{className:`${i}-separator`,"aria-hidden":"true"},""===n?n:n||"/")};p.__ANT_BREADCRUMB_SEPARATOR=!0;var h=p,m=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r{if(n)return n(t,i,r,o);const l=function(e,n){if(void 0===e.title||null===e.title)return null;const t=Object.keys(n).join("|");return"object"==typeof e.title?e.title:String(e.title).replace(new RegExp(`:(${t})`,"g"),((e,t)=>n[t]||e))}(t,i);return f(e,t,l,a)}}var v=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r{const{prefixCls:n,separator:t="/",children:i,menu:r,overlay:o,dropdownProps:a,href:s}=e;const c=(e=>{if(r||o){const t=Object.assign({},a);if(r){const e=r||{},{items:n}=e,i=v(e,["items"]);t.menu=Object.assign(Object.assign({},i),{items:null==n?void 0:n.map(((e,n)=>{var{key:t,title:i,label:r,path:o}=e,a=v(e,["key","title","label","path"]);let c=null!=r?r:i;return o&&(c=l.createElement("a",{href:`${s}${o}`},c)),Object.assign(Object.assign({},a),{key:null!=t?t:n,label:c})}))})}else o&&(t.overlay=o);return l.createElement(d.Z,Object.assign({placement:"bottom"},t),l.createElement("span",{className:`${n}-overlay-link`},e,l.createElement(u.Z,null)))}return e})(i);return null!=c?l.createElement(l.Fragment,null,l.createElement("li",null,c),t&&l.createElement(h,null,t)):null},x=e=>{const{prefixCls:n,children:t,href:i}=e,r=v(e,["prefixCls","children","href"]),{getPrefixCls:o}=l.useContext(c.E_),a=o("breadcrumb",n);return l.createElement(w,Object.assign({},r,{prefixCls:a}),f(a,r,t,i))};x.__ANT_BREADCRUMB_ITEM=!0;var b=x,y=t(17313),j=t(83116),k=t(37613);const C=e=>{const{componentCls:n,iconCls:t}=e;return{[n]:Object.assign(Object.assign({},(0,y.Wf)(e)),{color:e.itemColor,fontSize:e.fontSize,[t]:{fontSize:e.iconFontSize},ol:{display:"flex",flexWrap:"wrap",margin:0,padding:0,listStyle:"none"},a:Object.assign({color:e.linkColor,transition:`color ${e.motionDurationMid}`,padding:`0 ${e.paddingXXS}px`,borderRadius:e.borderRadiusSM,height:e.lineHeight*e.fontSize,display:"inline-block",marginInline:-e.marginXXS,"&:hover":{color:e.linkHoverColor,backgroundColor:e.colorBgTextHover}},(0,y.Qy)(e)),"li:last-child":{color:e.lastItemColor},[`${n}-separator`]:{marginInline:e.separatorMargin,color:e.separatorColor},[`${n}-link`]:{[`\n > ${t} + span,\n > ${t} + a\n `]:{marginInlineStart:e.marginXXS}},[`${n}-overlay-link`]:{borderRadius:e.borderRadiusSM,height:e.lineHeight*e.fontSize,display:"inline-block",padding:`0 ${e.paddingXXS}px`,marginInline:-e.marginXXS,[`> ${t}`]:{marginInlineStart:e.marginXXS,fontSize:e.fontSizeIcon},"&:hover":{color:e.linkHoverColor,backgroundColor:e.colorBgTextHover,a:{color:e.linkHoverColor}},a:{"&:hover":{backgroundColor:"transparent"}}},[`&${e.componentCls}-rtl`]:{direction:"rtl"}})}};var _=(0,j.Z)("Breadcrumb",(e=>{const n=(0,k.TS)(e,{});return[C(n)]}),(e=>({itemColor:e.colorTextDescription,lastItemColor:e.colorText,iconFontSize:e.fontSize,linkColor:e.colorTextDescription,linkHoverColor:e.colorText,separatorColor:e.colorTextDescription,separatorMargin:e.marginXS}))),S=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r{var{breadcrumbName:n}=e,t=S(e,["breadcrumbName"]);return Object.assign(Object.assign({},t),{title:n})}))}),r}var A=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r{const{prefixCls:n,separator:t="/",style:i,className:u,rootClassName:d,routes:p,items:m,children:f,itemRender:v,params:x={}}=e,b=A(e,["prefixCls","separator","style","className","rootClassName","routes","items","children","itemRender","params"]),{getPrefixCls:y,direction:j,breadcrumb:k}=l.useContext(c.E_);let C;const S=y("breadcrumb",n),[P,N]=_(S),E=function(e,n){return(0,l.useMemo)((()=>e||(n?n.map(Z):null)),[e,n])}(m,p);const B=g(S,v);if(E&&E.length>0){const e=[],n=m||p;C=E.map(((i,r)=>{const{path:o,key:s,type:c,menu:u,overlay:d,onClick:p,className:m,separator:f,dropdownProps:g}=i,v=((e,n)=>{if(void 0===n)return n;let t=(n||"").replace(/^\//,"");return Object.keys(e).forEach((n=>{t=t.replace(`:${n}`,e[n])})),t})(x,o);void 0!==v&&e.push(v);const b=null!=s?s:r;if("separator"===c)return l.createElement(h,{key:b},f);const y={},j=r===E.length-1;u?y.menu=u:d&&(y.overlay=d);let{href:k}=i;return e.length&&void 0!==v&&(k=`#/${e.join("/")}`),l.createElement(w,Object.assign({key:b},y,(0,a.Z)(i,{data:!0,aria:!0}),{className:m,dropdownProps:g,href:k,separator:j?"":t,onClick:p,prefixCls:S}),B(i,x,n,e,k))}))}else if(f){const e=(0,o.Z)(f).length;C=(0,o.Z)(f).map(((n,i)=>{if(!n)return n;const r=i===e-1;return(0,s.Tm)(n,{separator:r?"":t,key:i})}))}const T=r()(S,null==k?void 0:k.className,{[`${S}-rtl`]:"rtl"===j},u,d,N),I=Object.assign(Object.assign({},null==k?void 0:k.style),i);return P(l.createElement("nav",Object.assign({className:T,style:I},b),l.createElement("ol",null,C)))};P.Item=b,P.Separator=h;var N=P},25769:function(e,n,t){"use strict";var i=t(98040),r={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,n){var t,o,a,l,s,c,u=!1;n||(n={}),t=n.debug||!1;try{if(a=i(),l=document.createRange(),s=document.getSelection(),(c=document.createElement("span")).textContent=e,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",(function(i){if(i.stopPropagation(),n.format)if(i.preventDefault(),void 0===i.clipboardData){t&&console.warn("unable to use e.clipboardData"),t&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=r[n.format]||r.default;window.clipboardData.setData(o,e)}else i.clipboardData.clearData(),i.clipboardData.setData(n.format,e);n.onCopy&&(i.preventDefault(),n.onCopy(i.clipboardData))})),document.body.appendChild(c),l.selectNodeContents(c),s.addRange(l),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");u=!0}catch(i){t&&console.error("unable to copy using execCommand: ",i),t&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(n.format||"text",e),n.onCopy&&n.onCopy(window.clipboardData),u=!0}catch(i){t&&console.error("unable to copy using clipboardData: ",i),t&&console.error("falling back to prompt"),o=function(e){var n=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,n)}("message"in n?n.message:"Copy to clipboard: #{key}, Enter"),window.prompt(o,e)}}finally{s&&("function"==typeof s.removeRange?s.removeRange(l):s.removeAllRanges()),c&&document.body.removeChild(c),a()}return u}},83145:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.CopyToClipboard=void 0;var i=o(t(59301)),r=o(t(25769));function o(e){return e&&e.__esModule?e:{default:e}}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function l(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function s(e,n){if(null==e)return{};var t,i,r=function(e,n){if(null==e)return{};var t,i,r={},o=Object.keys(e);for(i=0;i=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}function c(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function u(e,n){for(var t=0;t4?parseFloat(e):5};function j(){try{return window.self!==window.top}catch(e){return!0}}function k(){return(!t.hasOwnProperty("screenshotGenerator")||!t.screenshotGenerator)&&Math.max(screen.width,screen.height)<800}e.setHTML5Codebase=function(e,n){c=e,M(e,n)},e.setJavaCodebase=e.setJavaCodebaseVersion=e.isCompiledInstalled=e.setPreCompiledScriptPath=e.setPreCompiledResourcePath=function(){},e.setHTML5CodebaseVersion=function(e,n){var t=parseFloat(e);NaN!==t&&t<5?console.log("The GeoGebra HTML5 codebase version "+t+" is deprecated. Using version latest instead."):(s=e,L(e,n))},e.getHTML5CodebaseVersion=function(){return f},e.getParameters=function(){return t},e.setFontsCSSURL=function(e){b=e},e.setGiacJSURL=function(e){},e.setJNLPFile=function(e){e},e.setJNLPBaseDir=function(e){},e.inject=function(){function n(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var i,r="auto",o=t.id,a=!1,s=0;s=5)return!0;var n=e.getAppletObject();return!(!n||"function"!=typeof n.recalculateEnvironments)&&(n.recalculateEnvironments(),!0)},e.startAnimation=function(){var n=e.getAppletObject();return!(!n||"function"!=typeof n.startAnimation)&&(n.startAnimation(),!0)},e.stopAnimation=function(){var n=e.getAppletObject();return!(!n||"function"!=typeof n.stopAnimation)&&(n.stopAnimation(),!0)},e.getAppletObject=function(){var e=void 0!==t.id?t.id:"ggbApplet";return window[e]},e.resize=function(){};var Z=function(e){return e&&"false"!==e},A=function(n,t,i){y(f)<=4.2&&(i=!0);var r=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==f||ggbHTML5LoadedCodebaseIsWebSimple&&!v)&&(r=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var o=document.createElement("div");o.classList.add("appletParameters","notranslate");var a=t.width,l=t.height;if(t.disableAutoScale=void 0===t.disableAutoScale?GGBAppletUtils.isFlexibleWorksheetEditor():t.disableAutoScale,void 0!==t.width)if(y(f)<=4.4)Z(t.showToolBar)&&(t.height-=7),Z(t.showAlgebraInput)&&(t.height-=37),t.width<605&&Z(t.showToolBar)&&(t.width=605,a=605);else{var u=100;(Z(t.showToolBar)||Z(t.showMenuBar))&&(t.hasOwnProperty("customToolBar")&&(t.customToolbar=t.customToolBar),u=Z(t.showMenuBar)?245:155),a=5?(t.appletOnLoad=function(e){var t=n.querySelector(".ggb_preview");t&&t.parentNode.removeChild(t),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(w),window.GGBT_wsf_view&&$(window).trigger("resize"),h(e)},x||w.appendChild(j)):o.appendChild(j),w.appendChild(o),x||n.appendChild(w),setTimeout((function(){e.resize()}),1)}function k(e,n){n&&"function"==typeof n.appletOnLoad&&"function"==typeof renderGGBElement?renderGGBElement(e,n.appletOnLoad):renderGGBElement(e),R("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",n)}function C(e,n){"undefined"==typeof renderGGBElement?(null===html5AppletsToProcess&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:e,params:n}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,null!==html5AppletsToProcess&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach((function(e){k(e.article,e.params)})),html5AppletsToProcess=null)},y(f)<5&&(e.className+=" geogebraweb")):k(e,n)}if(r){scriptLoadStarted=!0;for(var _=0;_0?(r.remove(),l.attr("id","fullscreencontent").show(),jQuery(o).append(l),window.dispatchEvent(new Event("resize"))):A(r,n,!1),window.GGBT_wsf_view.launchFullScreen(o)}else m=i,A(e,n,!1);if(!window.GGBT_wsf_view)for(a=0;ae/4*3&&(l=e/4*3),s=l/5.8,a.setAttribute("src",x),a.setAttribute("width",l),a.setAttribute("height",s);var u=(e-l)/2,d=(n-s)/2;a.style.left=u+"px",a.style.top=d+"px",r.appendChild(a)}return r.appendChild(c),r},I=function(e){return"html5"===(e=e.toLowerCase())||"screenshot"===e?e:"html5"},O=["web","webSimple","web3d","tablet","tablet3d","phone"],L=function(e,n){if(f=e,n)M(f,!0);else{var o,a,l=!r;if(l){var s=y(f);!isNaN(s)&&s<4.4&&(l=!1)}o="http"===window.location.protocol.substr(0,4)?window.location.protocol:"http:";var c=f.indexOf("//");for(var u in a=c>0?f:0===c?o+f:"https://www.geogebra.org/apps/5.2.814.0/",O)if(f.slice(-1*O[u].length)===O[u]||f.slice(-1*(O[u].length+1))===O[u]+"/")return void M(a,!1);GGBAppletUtils.isFlexibleWorksheetEditor()||!l||i.is3D||i.AV||i.SV||i.CV||i.EV2||i.CP||i.PC||i.DA||i.FI||i.PV||Z(t.showToolBar)||Z(t.showMenuBar)||Z(t.showAlgebraInput)||Z(t.enableRightClick)||t.appName&&"classic"!=t.appName?a+="web3d/":a+="webSimple/",M(a,!1)}},M=function(e,n){if(e.requirejs)p=e;else{"/"!==e.slice(-1)&&(e+="/"),p=e,null===n&&(n=-1===e.indexOf("http")),h=n,g="web.nocache.js",v=!1;var t=p.split("/");t.length>1&&(n||"webSimple"!==t[t.length-2]?O.indexOf(t[t.length-2])>=0&&(g=t[t.length-2]+".nocache.js"):(g="webSimple.nocache.js",v=!0)),t=e.split("/"),"test"===(f=t[t.length-3]).substr(0,4)?f=f.substr(4,1)+"."+f.substr(5,1):"war"!==f.substr(0,3)&&"beta"!==f.substr(0,4)||(f="5.0");var i=parseFloat(f);NaN!==i&&i<5&&e.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+i+" is deprecated. Using version latest instead."),L("5.0",n))}},R=function(e,n){window.console&&window.console.log&&(!n||void 0===n.showLogging||n.showLogging&&"false"!==n.showLogging)&&console.log(e)};function D(){var e=n;null!==s?e=s:parseFloat(e)<5&&(e="5.0"),L(e,!1),null!==c&&M(c,h),l=!0}return void 0!==t.material_id?C(D):D(),e},GGBAppletUtils=function(){"use strict";function e(){return void 0!==window.GGBT_wsf_edit}function n(e,n){1!=n?(e.style.transformOrigin="0% 0% 0px",e.style.webkitTransformOrigin="0% 0% 0px",e.style.transform="scale("+n+","+n+")",e.style.webkitTransform="scale("+n+","+n+")",e.style.maxWidth="initial",null!==e.querySelector(".ggb_preview")&&(e.querySelector(".ggb_preview").style.maxWidth="initial"),void 0!==e.querySelectorAll(".ggb_preview img")[0]&&(e.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),void 0!==e.querySelectorAll(".ggb_preview img")[1]&&(e.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(e.style.transform="none",e.style.webkitTransform="none")}function t(e,n,t,i,r){if(e.isScreenshoGenerator)return 1;var o,a=void 0!==i&&i,l=null!=e.noScaleMargin&&e.noScaleMargin,s=(o=e.autoHeight)&&"false"!==o,c=function(e,n,t,i,r,o){var a=null;if(null!=o&&""!=o)for(var l=e.parentNode;null!=l;){if((" "+l.className+" ").indexOf(" "+o+" ")>-1){a=l;break}l=l.parentNode}var s=0,c=0,u=0,d=0,p=0,h=0,m=0;if(a)s=a.offsetWidth,c=Math.max(i?a.offsetWidth:0,a.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(s=Math.min(window.innerWidth,document.documentElement.clientWidth),c=Math.min(window.innerHeight,document.documentElement.clientHeight),u=s):(s=window.innerWidth,c=window.innerHeight,u=window.innerWidth),e){var f=e.getBoundingClientRect();f.left>0&&f.left<=s&&(void 0===r||!r)&&("rtl"===document.dir?(p=s-f.width-f.left,h=u<=480?10:30):(h=f.left,p=u<=480?10:30),d=h+p)}e&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(e.getBoundingClientRect(),"closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(d=40,m=0):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(d=0,m=40))}return e&&((void 0===t||!t)&&n>0&&n+d1&&(a=!0)),n&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(a=!0),e.hasOwnProperty("disableAutoScale")&&e.disableAutoScale?o:(r=t(e,n,a,i,e.scaleContainerClass),!a||e.hasOwnProperty("scale")&&1!==o?Math.min(o,r):r)}function r(e){var n=Math.min(window.innerWidth,document.documentElement.clientWidth),t=Math.min(window.innerHeight,document.documentElement.clientHeight),i=e.getBoundingClientRect(),r=(n-i.width)/2,o=(t-i.height)/2;o<0&&(o=0),e.style.position="relative","closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(e.style.left=r<40?"40px":r+"px",e.style.top=o+"px"):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(e.style.top=o<40?"40px":o+"px",e.style.left=r+"px")}return{responsiveResize:function(t,o){var a=t.querySelector(".appletParameters");if(a){if("object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()){if(o.id!==a.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(t)}if(a.parentElement&&/fullscreen/.test(a.parentElement.className))return;var l=i(o,t);e()&&a.setAttribute("data-param-scale",l);for(var s=null,c=0;c=O)continue;if(j==jb){if(k=i.getAttribute(kb),k){var l,m=k.indexOf(lb);m>=O?(j=k.substring(O,m),l=k.substring(m+P)):(j=k,l=W),c[j]=l}}else if(j==mb){if(k=i.getAttribute(kb),k)try{d=eval(k)}catch(e){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(e){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(e){var n=c[e];return null==n?null:n},r=d,webModule.__errFn=e}function B(){function e(e){var n=e.lastIndexOf(rb);-1==n&&(n=e.length);var t=e.indexOf(sb);-1==t&&(t=e.length);var i=e.lastIndexOf(tb,Math.min(t,n));return i>=O?e.substring(O,i+P):W}var n,t=null!=(n=__gwt_getMetaProperty(wb))?n:W;return t==W&&(t=function(){for(var n=o.getElementsByTagName(_),t=O;tO?e[e.length-P].href:W}()),t==W&&function(){var e=o.location;return e.href==e.protocol+zb+e.host+e.pathname+e.search+e.hash}()&&(t=e(o.location.href)),t=function(n){if(n.match(/^\w+:\/\//));else{var t=o.createElement(ub);t.src=n+vb,n=e(t.src)}return n}(t),t}function C(e){return e.match(/^\//)||e.match(/^[a-zA-Z]+:\/\//)?e:webModule.__moduleBase+e}function D(){var e,t=O,i=[],o=[];function a(e){var n=o[e](),t=i[e];if(n in t)return n;var a=[];for(var l in t)a[t[l]]=l;throw r&&r(e,a,n),null}if(__gwt_isKnownPropertyValue=function(e,n){return n in i[e]},webModule.__getPropMap=function(){var e={};for(var n in i)i.hasOwnProperty(n)&&(e[n]=a(n));return e},webModule.__computePropValue=a,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);try{var l=(e=Cb).indexOf(Db);-1!=l&&(t=parseInt(e.substring(l+P),$),e=e.substring(O,l))}catch(e){}return webModule.__softPermutationId=t,C(e+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}s[L]={moduleName:L},webModule.__moduleStartupDone=function(e){var n=s[L].bindings;s[L].bindings=function(){for(var t=n?n():{},i=e[webModule.__softPermutationId],r=O;r0){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:"",t=[],i=0;i0&&(0,w.jsx)("div",{id:i||"",children:(0,w.jsx)(p.Z,r()({showLine:{showLeafIcon:!1},showIcon:!0,treeData:c,className:h,onSelect:t,onExpand:function(e,n){x((function(e){return j(e,n.node.key,n.expanded)}))}},k))})}},87359:function(e,n,t){"use strict";t.d(n,{Z:function(){return b}});var i=t(7557),r=t.n(i),o=t(41498),a=t.n(o),l=t(79800),s=t.n(l),c=t(59301),u="imageDimensions___a7crR",d="img___Kroat",p="fullWidth___c492T",h=t(92310),m=t.n(h),f=t(71418),g=t(2859),v=t(90694),w=t(41282),x=t(37712),b=function(e){var n=e.data,t=e.className,i=e.fullWidth,o=e.style,l=void 0===o?{}:o,h=e.onClose,b=e.onOk,y=e.showFullTools,j=e.noAssociationId,k=(0,c.useRef)(null),C=(0,c.useRef)(null),_=(0,c.useState)(!1),S=s()(_,2),Z=S[0],A=S[1],P=(0,c.useState)("正在加载中"),N=s()(P,2),E=N[0],B=N[1];(0,c.useEffect)((function(){null!=n&&n.visible?document.body.setAttribute("data-custom","y-hidden"):document.body.removeAttribute("data-custom"),null!=n&&n.src&&T()}),[null==n?void 0:n.visible]);var T=function(){var e=a()(r()().mark((function e(){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A(!0),B("正在加载中"),e.next=4,(0,w.ZJ)(null==n?void 0:n.src);case 4:t=e.sent,k.current.src="",k.current.src=t,k.current.onload=function(){O()},A(!1),B("");case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),I=function(){var e=a()(r()().mark((function e(t){var i;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A(!0),B("正在保存中"),e.next=4,(0,v.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:n.title,file:t.dataUrl}});case 4:if(null==(i=e.sent)||!i.id||j){e.next=12;break}return e.next=8,(0,v.ZP)("/api/attachments/".concat(n.id,"/add_subitem.json"),{method:"post",body:{subitem_id:null==i?void 0:i.id,settings:JSON.stringify(t.state)}});case 8:0===e.sent.status&&b(),e.next=13;break;case 12:null!=i&&i.id&&b(i);case 13:A(!1),B("");case 15:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),O=function(){C.current=new g.hP(k.current),C.current.addEventListener("render",I),C.current.addEventListener("beforeclose",h),y&&(C.current.availableMarkerTypes=C.current.ALL_MARKER_TYPES,C.current.uiStyleSettings.redoButtonVisible=!0,C.current.uiStyleSettings.notesButtonVisible=!0,C.current.uiStyleSettings.zoomButtonVisible=!0,C.current.uiStyleSettings.zoomOutButtonVisible=!0,C.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=C.current.uiStyleSettings,C.current.show(),null!=n&&n.snapshotData&&C.current.restoreState(n.snapshotData),setTimeout((function(){var e;(e=document.querySelector('a[href="https://markerjs.com/"]'))&&e.parentNode&&(e.parentNode.style.display="none"),[{name:'[data-action="select"]',title:"选择"},{name:'[data-action="delete"]',title:"删除元素"},{name:'[data-action="undo"]',title:"撤销"},{name:'[data-type-name="FrameMarker"]',title:"矩形"},{name:'[data-type-name="FreehandMarker"]',title:"画线"},{name:'[data-type-name="ArrowMarker"]',title:"箭头"},{name:'[data-type-name="TextMarker"]',title:"文本"},{name:'[data-type-name="EllipseMarker"]',title:"椭圆"},{name:'[data-type-name="HighlightMarker"]',title:"方块"},{name:'[data-type-name="CalloutMarker"]',title:"注释"},{name:'[data-action="render"]',title:"保存"},{name:'[data-action="close"]',title:"退出"}].forEach((function(e){var n=document.querySelector(e.name);n&&n.setAttribute("title",e.title)}))}),300)};return(0,x.jsx)(c.Fragment,{children:(null==n?void 0:n.visible)&&(0,x.jsxs)("div",{className:m()(u,t,i?p:""),style:l,children:[(0,x.jsx)(f.Z,{spinning:Z,tip:E,style:{position:"absolute"}}),(0,x.jsx)("img",{className:d,ref:k})]})})}},43941:function(e,n,t){"use strict";t.d(n,{N:function(){return P}});var i=t(7557),r=t.n(i),o=t(41498),a=t.n(o),l=t(37205),s=t.n(l),c=t(79800),u=t.n(c),d=t(59301),p=t(57809),h=t(43418),m=t(98135),f=t(8591),g=t(95237),v=t(43604),w=t(90694),x="wrap___F7E3F",b="selectWrapper____kESB",y="tips___aHjQY",j="linkBtn___uggVr",k="public_tips___sZVWd",C="inputCss___t66EO",_="bt___lXptu",S=t(88289),Z=t(37712),A=p.default.Option,P=function(e){var n=e.subId,t=e.value,i=e.selectvalues,o=e.disabled,l=e.knowledgeOptions,c=void 0===l?[]:l,P=e.onChange,N=void 0===P?function(){}:P,E=e.onAddKnowledgeFinish,B=void 0===E?function(){}:E,T=(0,d.useRef)(),I=(0,d.useState)([]),O=u()(I,2),L=O[0],M=O[1];t=t||[];(0,d.useEffect)((function(){(null==i?void 0:i.length)>0?(M(s()(i)),N(s()(i))):(M([]),N([]))}),[c]),(0,d.useEffect)((function(){var e;(null===(e=t)||void 0===e?void 0:e.length)>0&&N(s()(t))}),[c]);return(0,Z.jsxs)(g.Z,{wrap:!1,align:"middle",className:x,children:[(0,Z.jsx)(v.Z,{children:(0,Z.jsx)(p.default,{mode:"multiple",disabled:!n||o,className:b,placeholder:"请选择知识点,支持选择多个",onChange:function(e,n){e?(M(s()(n)),N(s()(n))):(M([]),N([]))},style:{width:490},showSearch:!0,allowClear:!0,value:L,filterOption:function(e,n){return n.label.indexOf(e.toLowerCase())>=0},children:null==c?void 0:c.map((function(e){return(0,Z.jsx)(A,{value:e.id,label:e.name,children:(0,Z.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,Z.jsx)("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:e.name}),"personal"===(null==e?void 0:e.type)&&(0,Z.jsx)("div",{style:{marginLeft:"5px",border:"1px solid #24C074",color:"#24C074",padding:"0 4px",borderRadius:"2px",fontSize:"12px",height:"20px",lineHeight:"20px"},children:"自用"})]})},e.id)}))})}),n&&(0,Z.jsxs)(v.Z,{className:"ml20",children:[(0,Z.jsx)("span",{className:y,children:"没有合适的知识点?"}),(0,Z.jsx)("span",{className:j,onClick:function(e){e.preventDefault(),T.current="",h.Z.confirm({centered:!0,width:585,okText:"确定",cancelText:"取消",icon:null,title:"新建知识点",className:"custom-modal-divider",content:(0,Z.jsxs)("div",{className:"font14",children:[(0,Z.jsxs)("div",{className:k,children:[(0,Z.jsx)(S.Z,{style:{color:"#FF8C29",marginRight:10,paddingTop:5}}),"新建的知识点仅本人可见,平台审核列入公开知识点后,对所有用户可见。 平台有权删除不合适的知识点,请认真填写知识点名称。"]}),(0,Z.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,Z.jsxs)("div",{style:{width:"95px"},children:[(0,Z.jsx)("span",{className:_,children:"*"}),"知识点名称"]}),(0,Z.jsx)(m.Z,{className:C,style:{width:"calc(100% - 95px)"},maxLength:20,size:"middle",showCount:!0,placeholder:"请输入知识点名称",defaultValue:T.current,onChange:function(e){T.current=e.target.value}})]})]}),onOk:function(){return new Promise(function(){var e=a()(r()().mark((function e(t,o){var a,l;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(T.current){e.next=3;break}return f.ZP.warning("请输入知识点名称"),e.abrupt("return",o());case 3:if(!(T.current.length>20)){e.next=6;break}return f.ZP.warning("请输入不超过20字的知识点名称"),e.abrupt("return",o());case 6:return e.next=8,(0,w.ZP)("/api/tag_disciplines.json",{method:"post",body:{name:T.current,sub_discipline_id:n}});case 8:return 0===(null==(a=e.sent)?void 0:a.status)&&(B({id:a.tag_discipline_id,name:T.current,type:"personal"}),(l=i||[]).push(a.tag_discipline_id),N(s()(l)),M(s()(l)),N(s()(l))),e.abrupt("return",t());case 11:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}())}})},children:"新建知识点"})]})]})}},64565:function(e,n,t){"use strict";var i=t(79800),r=t.n(i),o=t(59301),a=t(50630),l=(t(48136),t(42594)),s=t(43418),c=t(37712),u=(0,o.forwardRef)((function(e,n){var t=e.callback,i=e.width,u=e.onChange,d=e.disabled,p=e.readOnly,h=e.type,m=void 0===h?"":h,f=e.value,g=void 0===f?"":f,v=e.style,w=void 0===v?{}:v,x=(0,o.useRef)(),b=(0,o.useRef)(),y=(0,o.useState)(0),j=r()(y,2),k=j[0],C=j[1],_=(0,o.useState)(0),S=r()(_,2),Z=S[0],A=S[1],P=(0,o.useState)(!1),N=r()(P,2),E=N[0],B=N[1],T=function(){var e=document.createElement("div");e.innerHTML=x.current.getValue();var n=e.innerText;return t&&t(n),n};(0,o.useImperativeHandle)(n,(function(){return{getData:T}}));var I=function(e,n,t,i){var r=document.body.clientHeight,o=document.body.clientWidth;return!(e<20&&t>e||e>o-20&&tn||n>r-20&&i1e3*(a+3)*s,te.current){e.next=9;break}return e.abrupt("return");case 9:if(!l){e.next=13;break}return P.ZP.error("调试代码超时"),f(!1),e.abrupt("return");case 13:if(0!==t){e.next=17;break}return f(!1),V(u()(u()({},i),{},{showText:!0})),e.abrupt("return");case 17:setTimeout(c,1e3);case 18:case"end":return e.stop()}}),e)}))),d.apply(this,arguments)},c=function(){return d.apply(this,arguments)},o=ie(),a=re?null==l?void 0:l.time_limit:null===(n=i.getFieldsValue())||void 0===n?void 0:n.hack.time_limit,s=re?null==l||null===(t=l.answer_content)||void 0===t?void 0:t.length:null===(r=i.getFieldsValue())||void 0===r||null===(r=r.standard_answers)||void 0===r?void 0:r.length,f(!0),e.next=8,(0,D.bM)(ne.current,{test_hack_code:q,test_input:X});case 8:c();case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),le=function(){var e=A()(S()().mark((function e(){var n,t,r,o,a,s,c,d;return S()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l){e.next=25;break}return e.prev=1,e.next=4,i.validateFields();case 4:e.next=11;break;case 6:return e.prev=6,e.t0=e.catch(1),null!==e.t0&&void 0!==e.t0&&null!==(n=e.t0.errorFields)&&void 0!==n&&null!==(n=n[0])&&void 0!==n&&null!==(n=n.name)&&void 0!==n&&n.includes("standard_answers")?P.ZP.error("填空项答案不能为空"):P.ZP.error(e.t0.errorFields[0].errors[0]),i.scrollToField(e.t0.errorFields[0].name,{behavior:"smooth",block:"center"}),e.abrupt("return");case 11:if(b(!0),t="",r=i.getFieldsValue(),ee.current){e.next=22;break}return e.next=17,(0,R.ZP)("/api/problems.json",{method:"post",body:u()(u()({},r),{},{hack:u()(u()({},null==r?void 0:r.hack),{},{sub_discipline_id:null==r||null===(o=r.hack)||void 0===o||null===(o=o.sub_discipline_id)||void 0===o?void 0:o[1],difficult:r.difficulty,item_banks_group_id:r.item_banks_group_id}),hack_codes:u()(u()({},r.hack_codes),{},{code:B.Base64.encode(r.hack_codes.code)}),hack_sets:[u()({},r.hack_sets)],is_blank:!0})});case 17:t=e.sent,ee.current=null===(a=t)||void 0===a?void 0:a.identifier,sessionStorage.projectFill=null===(s=t)||void 0===s?void 0:s.identifier,e.next=25;break;case 22:return e.next=24,(0,R.ZP)("/api/problems/".concat(ee.current,".json"),{method:"put",body:u()(u()({},r),{},{hack:u()(u()({},null==r?void 0:r.hack),{},{sub_discipline_id:null==r||null===(c=r.hack)||void 0===c||null===(c=c.sub_discipline_id)||void 0===c?void 0:c[1],difficult:r.difficulty,item_banks_group_id:r.item_banks_group_id}),hack_codes:u()(u()({},r.hack_codes),{},{code:B.Base64.encode(r.hack_codes.code)}),update_hack_sets:[u()({},r.hack_sets)],is_blank:!0})});case 24:t=e.sent;case 25:return e.next=27,(0,R.ZP)("/api/problems/".concat(ee.current,"/start.json"),{method:"get"});case 27:if(0!==(null==(d=e.sent)?void 0:d.status)){e.next=34;break}return ne.current=null==d?void 0:d.identifier,te.current=!0,b(!1),oe(),e.abrupt("return");case 34:b(!1);case 35:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(){return e.apply(this,arguments)}}();return(0,W.jsxs)("div",{children:[(0,W.jsx)(N.ZP,u()(u()({loading:x},n),{},{onClick:le,children:t})),(0,W.jsx)(g.Z,{open:k,title:"调试代码",destroyOnClose:!0,width:1200,okText:"运行测试",confirmLoading:d,cancelButtonProps:{style:{display:"none"}},onOk:function(){return ae()},onCancel:function(){te.current=!1,C(!1)},children:(0,W.jsxs)("div",{className:T,children:[(0,W.jsxs)("div",{className:I,children:[(0,W.jsxs)("div",{className:"mb20",children:[(0,W.jsx)("span",{className:"c-black",children:"执行代码"}),!l&&(0,W.jsx)(F.CopyToClipboard,{text:q,onCopy:function(){return P.ZP.success("复制成功")},children:(0,W.jsxs)("span",{style:{float:"right"},className:"current c-light-primary",children:[(0,W.jsx)("i",{className:"iconfont icon-fuzhi8 mr5"}),"复制"]})})]}),(0,W.jsx)(G.Z,{height:510,className:"mb0",hidetoolBar:!0,defaultValue:q,onChange:function(e){return Y(e)}})]}),(0,W.jsxs)("div",{className:O,children:[(0,W.jsx)("div",{className:"c-black mb20",children:"自定义测试用例"}),(0,W.jsx)("div",{className:L,children:(0,W.jsx)("div",{className:M,children:(0,W.jsx)(m.Z.TextArea,{placeholder:"请输入",value:X,onChange:function(e){return $(e.target.value)},bordered:!1,style:{height:180}})})}),(0,W.jsx)("div",{className:"c-black mb20 mt30",children:"代码执行结果"}),(0,W.jsx)("div",{className:L,children:(0,W.jsx)(E.Z,{spinning:d,tip:"代码执行中",children:(0,W.jsx)("div",{className:M,style:{height:196,overflow:"auto",padding:10},children:function(e){var n=e.status,t=e.error_msg,i=e.execute_time,r=e.output,o=e.input,a=e.expected_output,l=null;switch(n){case z.h.OK:l=(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)("p",{children:["执行用时:",i/1e3,"秒"]}),(0,W.jsx)("p",{children:"执行结果:调试通过"})]});break;case z.h.NOMATCH:l=(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)("div",{children:"输入:"}),(0,W.jsx)("pre",{style:{fontFamily:"initial"},children:o}),(0,W.jsx)("div",{children:"输出:"}),(0,W.jsx)("pre",{style:{fontFamily:"initial"},children:r&&B.Base64.decode(r)}),(0,W.jsx)("div",{children:"预期输出:"}),(0,W.jsx)("pre",{style:{fontFamily:"initial"},children:a&&B.Base64.decode(a)})]});break;case z.h.EXECUTEFAILURE:case z.h.COMPILEFAILURE:l=(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)("p",{children:["最后执行的输入:",(0,W.jsx)("pre",{children:o})]}),(0,W.jsx)("p",{children:"执行出错信息:"}),(0,W.jsx)("pre",{className:"error",children:B.Base64.decode(t)})]});break;case z.h.PODFAILURE:l=(0,W.jsx)("p",{children:"创建pod失败,请稍后重试"});break;case z.h.TIMEOUT:l=(0,W.jsx)("p",{children:"评测超时,请稍后重试"})}return(0,W.jsxs)(W.Fragment,{children:[" ",l," "]})}(H)})})})]})]})})]})},V=t(88289),K=["key","name"],U=m.Z.TextArea,q=[{title:"C",key:"C"},{title:"C++",key:"C++"},{title:"Python",key:"Python"},{title:"Java",key:"Java"},{title:"JavaScript",key:"JavaScript"},{title:"Ruby",key:"Ruby"}],Y="@▁@",J="@▁▁@",Q=function(e){var n=e.questionTitlePlaceholder,t=e.form,i=e.scoreByBlank,o=void 0!==i&&i,l=e.hackidentifier,c=e.answerKey,d=(0,h.useState)(!1),_=p()(d,2),S=_[0],Z=_[1],A=(0,h.useState)(!1),P=p()(A,2),N=(P[0],P[1],(0,k.useParams)().type,function(e,n){for(var t=n.line,i=0,r=0;r0){var a=N(e,n.from);console.log("新增".concat(o,"个,之前有").concat(a,"个")),t(o,a)}}else{var l=r.split(Y).length-1+r.split(J).length-1,s=N(e,n.from);console.log("删除".concat(l,"个, 前面有").concat(s,"个,新增").concat(o,"个")),i(l>1?Array.from({length:l},(function(e,n){return s+n})):s)}}(e,n,T,O)}})})}),(0,W.jsx)(f.Z.List,{name:c,rules:[{validator:function(e,n){if(null==n||!n.length)return Promise.reject(new Error("答案不能为空"));var t,i=a()(n);try{for(i.s();!(t=i.n()).done;){var r=(t.value||{}).answer_text;if(0===(null==r?void 0:r.length))return Promise.reject(new Error("填空项答案不能为空"))}}catch(e){i.e(e)}finally{i.f()}return Promise.resolve()}}],children:function(e,n,t){var i=n.add,a=n.remove;t.errors;return B.current=i,I.current=a,(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,W.jsx)(f.Z.Item,{label:"填空项答案",required:!0,labelCol:{span:24}}),(0,W.jsxs)("div",{onClick:function(){g.Z.warning({title:"给分说明",icon:null,width:700,centered:!0,content:(0,W.jsxs)("div",{children:[(0,W.jsxs)("div",{children:["1.学生填写答案之后,必须提交代码",(0,W.jsx)("span",{style:{color:"#e30000"},children:"进行评测"}),"才能得分。"]}),(0,W.jsx)("div",{style:{marginTop:10},children:"2.试题算分时,系统会将程序里面的所有空替换成学生的答案进行评测。输出的结果与测试集比对,完全正确则得满分;若不完全正确,则依次将每个空换成学生提交的答案,同时将其他空替换成标准答案,运行程序。如果这个空的学生答案与标准答案结合能得到正确输出,则这个空得到该空的满分,否则该空得0分。"})]})})},style:{minHeight:32,color:"#3061D0",cursor:"pointer"},children:[(0,W.jsx)(V.Z,{style:{marginRight:3,color:"#3061D0"}}),(0,W.jsx)("span",{children:" 给分说明"})]})]}),e.map((function(e,n){var t,i,a=e.key,l=e.name,s=r()(e,K);return(0,W.jsxs)(v.Z,{className:"mb20",align:"middle",wrap:!1,children:[(0,W.jsxs)(w.Z,{flex:"0 0 auto",className:"".concat(C.Z.blankIndex),children:["填空项",n+1]}),(0,W.jsx)(w.Z,{flex:1,children:(0,W.jsxs)(v.Z,{align:"top",justify:"space-between",wrap:!1,children:[(0,W.jsx)(w.Z,{children:(0,W.jsx)(f.Z.Item,u()(u()({},s),{},{name:[l,"answer_text"],noStyle:!0,children:null!=L&&null!==(t=L[l])&&void 0!==t&&t.multi_line||null!=L&&null!==(i=L[l])&&void 0!==i&&i.multiLine?(0,W.jsx)(U,{spellCheck:!1,style:{marginLeft:10,width:550}}):(0,W.jsx)(m.Z,{style:{marginLeft:10,width:550},className:C.Z.blankInput,size:"large",maxLength:1e3,onBlur:function(e){}})}))}),o&&(0,W.jsx)(w.Z,{flex:"224px",children:(0,W.jsx)(f.Z.Item,u()(u()({},s),{},{name:[l,"score"],label:"分值",rules:[{required:!0}],children:(0,W.jsx)(x.Z,{size:"large",className:C.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"请输入分值"})}))})]})})]},a)}))]})}}),(0,W.jsx)("div",{onClick:function(){return Z(!0)},children:(0,W.jsx)(f.Z.Item,{name:["hack","analysis"],label:"题目解析",labelCol:{span:24},children:(0,W.jsx)(j.x,{placeholder:"请编辑题目解析(非必填)",isEdit:S})})}),(0,W.jsx)(f.Z.Item,{label:"编程语言",style:{marginTop:30},name:["hack_codes","language"],labelCol:{span:24},rules:[{required:!0,message:"请选择编程语言"}],children:(0,W.jsx)(b.default,{size:"large",children:q.map((function(e){return(0,W.jsxs)(b.default.Option,{value:e.key,children:[" ",e.title]},e.title)}))})}),(0,W.jsxs)(f.Z.Item,{label:"最大评测时长(秒)",style:{marginTop:30},labelCol:{span:24},required:!0,children:[(0,W.jsx)(f.Z.Item,{name:["hack","time_limit"],rules:[{required:!0,message:"请输入单个测试集评测时长限制"},{type:"number",min:3,message:"最小限制时间是3秒"}],noStyle:!0,children:(0,W.jsx)(x.Z,{precision:0,max:10,min:3,size:"large",style:{width:"97%"}})}),(0,W.jsx)("span",{className:"ml10 font14",children:"秒"})]}),(0,W.jsx)(f.Z.Item,{label:"学生答案的空格处理方式",style:{marginTop:30},name:["hack","submit_rule"],labelCol:{span:24},rules:[{required:!0,message:"请选择学生答案的空格处理方式"}],children:(0,W.jsxs)(y.ZP.Group,{style:{marginTop:-10},children:[(0,W.jsx)(y.ZP,{value:0,children:"不忽略空格"}),(0,W.jsx)(y.ZP,{value:1,children:"忽略首尾空格"}),(0,W.jsx)(y.ZP,{value:2,children:"忽略所有空格"})]})}),(0,W.jsx)(f.Z.Item,{label:"测试用例",required:!0,style:{marginTop:30}}),(0,W.jsxs)("div",{style:{background:"#F6F7F9",padding:15},children:[(0,W.jsx)(f.Z.Item,{label:"输入",labelCol:{span:24},name:["hack_sets","input"],children:(0,W.jsx)(U,{rows:4})}),(0,W.jsx)(f.Z.Item,{label:"输出",labelCol:{span:24},name:["hack_sets","output"],rules:[{required:!0,message:"请输入输出内容"}],children:(0,W.jsx)(U,{rows:4})})]}),(0,W.jsx)(H,{form:t,answerKey:c,hackIdentifier:l,buttonText:"运行调试",buttonProps:{ghost:!0,icon:(0,W.jsx)("i",{className:"iconfont icon-ceshi"}),style:{background:"rgba(55,173,131,0.05)",borderRadius:19,border:"1px solid #37AD83",width:116,height:38,display:"inline-flex",fontSize:14,alignItems:"center",justifyContent:"center",marginTop:20,cursor:"pointer",color:"#37AD83"}}})]})}},10877:function(e,n,t){"use strict";t.d(n,{u:function(){return C}});var i=t(39647),r=t.n(i),o=t(79800),a=t.n(o),l=t(85573),s=t.n(l),c=t(82242),u=t.n(c),d=t(59301),p=t(95237),h=t(43604),m=t(6848),f=t(78241),g=t(26194),v=t(57703),w=t(78091),x=t(78716),b=t(37712),y=["key","name"],j=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],k=function(e){var n=e.value,t=e.onChange,i=e.choiceTextKey,r=e.answerKey,o=e.index,a=e.isEdit,l=e.setInputActive,c=e.form,d=e.choiceOptionsPath,f=e.allowChangeMode,y=e.showAddIcon,k=e.addItem,C=e.deleteItem;console.log(n,"value");var _=1===(null==n?void 0:n[r]),S=function(){var e;_?t(u()(u()({},n),{},s()({},r,0))):(f||(e=c.getFieldValue(d),c.setFieldValue(d,e.map((function(e){return u()(u()({},e),{},s()({},r,0))})))),t(u()(u()({},n),{},s()({},r,1))))};return(0,b.jsxs)(p.Z,{className:g.Z.choiceWrap,align:"middle",wrap:!1,children:[(0,b.jsx)(h.Z,{onClick:S,className:"".concat(g.Z.choiceIndex," ").concat(_?g.Z.activeAnswer:""),children:j[o]}),(0,b.jsx)(h.Z,{flex:1,className:"".concat(g.Z.editorWrap," ml15"),onClick:l,children:(0,b.jsx)(x.x,{height:155,placeholder:"请您输入选项",isEdit:a,value:null==n?void 0:n[i],onChange:function(e){t(u()(u()({},n),{},s()({},i,e)))}})}),(0,b.jsx)(h.Z,{flex:"0 0 auto",className:"ml15",children:(0,b.jsx)("div",{onClick:S,className:"".concat(g.Z.setAnswerBtn," ").concat(_?g.Z.activeAnswer:""),children:_?"正确答案":"设为答案"})}),(0,b.jsxs)(h.Z,{className:g.Z.actionWrapper,children:[(0,b.jsx)(m.Z,{title:"新增参考答案",children:(0,b.jsx)(v.Z,{className:g.Z.addIcon,onClick:k,style:{visibility:y?"visible":"hidden"}})}),(0,b.jsx)(m.Z,{title:"删除",children:(0,b.jsx)(w.Z,{className:g.Z.deleteIcon,onClick:C,style:{visibility:o>1?"visible":"hidden"}})})]})]})},C=function(e){var n=e.questionTitlePlaceholder,t=e.titleKey,i=e.choiceKey,o=e.analysisKey,l=e.choiceTextKey,c=e.answerKey,p=e.choiceOptionsPath,h=e.allowChangeMode,m=void 0===h||h,v=e.form,w=e.showAnalysis,C=void 0===w||w,_=(0,d.useState)(),S=a()(_,2),Z=S[0],A=S[1],P=(0,d.useState)(!1),N=a()(P,2),E=N[0],B=N[1];return(0,b.jsxs)("div",{className:g.Z.wrap,children:[(0,b.jsx)("div",{className:g.Z.questionTitleEditorWrap,children:(0,b.jsx)(f.Z.Item,{label:"题干",name:t,labelCol:{span:24},rules:[{required:!0}],children:(0,b.jsx)(x.h,{scrollId:Array.isArray(t)?t.join("_"):"".concat(t),watch:!0,height:140,placeholder:n})})}),(0,b.jsx)(f.Z.Item,{label:"答案选项",required:!0,labelCol:{span:24}}),(0,b.jsx)(f.Z.List,{name:i,rules:[{validator:function(e,n){var t=n.some((function(e){return 1===e[c]})),i=n.findIndex((function(e){var n;return(null===(n=e[l])||void 0===n?void 0:n.length)<=0}));return-1!==i?Promise.reject(new Error("请先输入".concat(j[i],"选项的内容"))):t?Promise.resolve():Promise.reject(new Error("请设置正确答案"))}}],children:function(e,n){var t=n.add,i=n.remove;return(0,b.jsxs)("div",{id:Array.isArray(p)?p.join("_"):"".concat(p),children:[e.map((function(n,o){var a=n.key,h=n.name,w=r()(n,y),x=Z===a,C=o<7&&o===e.length-1;return(0,d.createElement)(f.Z.Item,u()(u()({},w),{},{key:a,name:h,className:g.Z.choiceListWrap,rules:[{validator:function(e,n){return null!=n&&n.choice_text?Promise.resolve():Promise.reject(new Error("请先输入".concat(j[o],"选项的内容")))}}]}),(0,b.jsx)(k,{choiceTextKey:l,answerKey:c,index:o,isEdit:x,setInputActive:function(){A(a)},form:v,choiceOptionsPath:p,allowChangeMode:m,showAddIcon:C,addItem:function(){return t(s()(s()({},l,""),c,0))},deleteItem:function(){return i(h)}}))})),e.length<8&&(0,b.jsx)("div",{className:"".concat(g.Z.addBtn," mb30"),onClick:function(){return t(s()(s()({},l,""),c,0))},children:"添加选项"})]})}}),C&&(0,b.jsx)("div",{onClick:function(){return B(!0)},children:(0,b.jsx)(f.Z.Item,{name:o,label:"题目解析",labelCol:{span:24},children:(0,b.jsx)(x.x,{placeholder:"请编辑题目解析(非必填)",isEdit:E})})})]})}},56689:function(e,n,t){"use strict";t.d(n,{u:function(){return L}});var i=t(39647),r=t.n(i),o=t(91232),a=t.n(o),l=t(85573),s=t.n(l),c=t(82242),u=t.n(c),d=t(79800),p=t.n(d),h=t(37205),m=t.n(h),f=t(59301),g=t(43418),v=t(95237),w=t(43604),x=t(98135),b=t(6848),y=t(78673),j=t(78241),k=t(5112),C=t(54449),_=t(78716),S=t(78091),Z=t(85699),A=t(26194),P=t(64565),N=t(37712),E=["key","name"],B=function(e){var n=e.value,t=e.onChange;return(0,N.jsxs)(v.Z,{className:"ml20",children:[(0,N.jsx)(w.Z,{flex:1,children:null==n?void 0:n.map((function(e,i){return(0,N.jsxs)(v.Z,{className:"mb20",children:[(0,N.jsx)(x.Z.TextArea,{style:{flex:1,minHeight:44},defaultValue:e,autoSize:{maxRows:3},maxLength:1e3,onBlur:function(e){var r=m()(n),o=e.target.value.trim();r[i]=o,t(r)}}),(0,N.jsx)(b.Z,{title:"删除",children:(0,N.jsx)(S.Z,{className:A.Z.deleteIcon,style:{marginLeft:15,visibility:i>0?"visible":"hidden"},onClick:function(){return function(e){g.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:A.Z.modal,onOk:function(){var i=m()(n);i.splice(e,1),t(i)}})}(i)}})})]},"".concat(e,"_").concat(i))}))}),(0,N.jsx)(w.Z,{children:(0,N.jsx)("div",{className:"".concat(A.Z.addBtn),onClick:function(){var e;(e=m()(n)).push(""),t(e)},children:"新增答案"})})]})},T=function(e){var n=e.value,t=e.onChange;return(0,N.jsxs)(v.Z,{className:"ml20",children:[(0,N.jsx)(w.Z,{flex:1,children:null==n?void 0:n.map((function(e,i){return(0,N.jsxs)(v.Z,{align:"middle",className:"mb20",children:[(0,N.jsx)(P.Z,{value:e,style:{flex:1},onChange:function(e){var r=m()(n);r[i]=e,t(r)}}),(0,N.jsx)(b.Z,{title:"删除",children:(0,N.jsx)(S.Z,{className:A.Z.deleteIcon,style:{marginLeft:15,visibility:i>0?"visible":"hidden"},onClick:function(){return function(e){g.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:A.Z.modal,onOk:function(){var i=m()(n);i.splice(e,1),t(i)}})}(i)}})})]},"".concat(e,"_").concat(i))}))}),(0,N.jsx)(w.Z,{children:(0,N.jsx)("div",{className:"".concat(A.Z.addBtn),onClick:function(){var e;(e=m()(n)).push(""),t(e)},children:"新增答案"})})]})},I=function(e){var n=e.value,t=void 0===n||n,i=e.onChange;return(0,N.jsx)(y.Z,{checked:!t,onChange:function(e){i(!e)}})},O="▁",L=function(e){var n=e.questionTitlePlaceholder,t=e.form,i=e.scoreByBlank,o=void 0!==i&&i,l=e.answerKey,c=(0,f.useState)(!1),d=p()(c,2),h=d[0],m=d[1],g=function(e,n){for(var t=n.line,i=0,r=0;r1?Array.from({length:a},(function(e,n){return l+n})):l)}else if(o>0){var s=g(e,n.from);console.log("新增".concat(o,"个,之前有").concat(s,"个")),t(o,s)}}(e,n,L,R)}})})}),(0,N.jsx)(j.Z.List,{name:l,rules:[{validator:function(e,n){if(null==n||!n.length)return Promise.reject(new Error("请先在题干中插入填空项"));var t,i=a()(n);try{for(i.s();!(t=i.n()).done;){var r=(t.value||{}).answer_text;if(null!=r&&r.some((function(e){return 0===(null==e?void 0:e.length)})))return Promise.reject(new Error("填空项答案不能为空"))}}catch(e){i.e(e)}finally{i.f()}return Promise.resolve()}}],children:function(e,n,i){var a=n.add,c=n.remove;i.errors;return P.current=a,M.current=c,(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(j.Z.Item,{label:(0,N.jsxs)("span",{children:["填空项答案",!(null!=e&&e.length)&&(0,N.jsx)("span",{style:{color:"#E99237"},children:"(请先在题干中插入填空项)"})]}),required:!0,labelCol:{span:24}}),e.map((function(e,n){var i,a=e.key,c=e.name,d=r()(e,E);return(0,N.jsxs)("div",{style:{marginBottom:10},children:[(0,N.jsxs)(v.Z,{className:"mb20",align:"middle",wrap:!1,children:[(0,N.jsxs)(w.Z,{style:{marginRight:10},flex:"0 0 auto",className:"".concat(A.Z.blankIndex),children:["填空项",n+1]}),(0,N.jsx)(j.Z.Item,u()(u()({},d),{},{name:[c,"model"],noStyle:!0,children:(0,N.jsxs)(k.ZP.Group,{onChange:function(){var e=t.getFieldValue(l);t.setFieldsValue(s()({},l,e.map((function(e,n){return u()(u()({},e),{},{answer_text:c===n?[""]:e.answer_text})}))))},children:[(0,N.jsxs)(k.ZP,{value:1,children:["文本模式 ",(0,N.jsx)(b.Z,{title:"学生答题时,需要在文本框中填写文本答案",children:(0,N.jsx)(Z.Z,{})})]}),(0,N.jsxs)(k.ZP,{value:2,children:["数学公式模式 ",(0,N.jsx)(b.Z,{title:"学生答题时,需要编写数学公式作为答案",children:(0,N.jsx)(Z.Z,{})})]})]})}))]}),(0,N.jsx)(v.Z,{style:{marginLeft:20},align:"middle",wrap:!1,children:(0,N.jsxs)(w.Z,{flex:1,children:[(0,N.jsxs)(v.Z,{align:"top",justify:"space-between",wrap:!1,children:[(0,N.jsx)(w.Z,{flex:1,children:(0,N.jsx)(j.Z.Item,u()(u()({},d),{},{name:[c,"answer_text"],noStyle:!0,children:1===(null===(i=t.getFieldValue(l))||void 0===i||null===(i=i[c])||void 0===i?void 0:i.model)?(0,N.jsx)(B,{}):(0,N.jsx)(T,{})}))}),o&&(0,N.jsx)(w.Z,{flex:"224px",style:{margin:"-7px 0 0 20px"},children:(0,N.jsx)(j.Z.Item,u()(u()({},d),{},{name:[c,"score"],label:"分值",rules:[{required:!0}],className:A.Z.blankInputNumberWrapper,children:(0,N.jsx)(C.Z,{min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"请输入分值"})}))})]}),(0,N.jsx)(j.Z.Item,u()(u()({},d),{},{name:[c,"position"],noStyle:!0,children:(0,N.jsx)(x.Z,{type:"hidden"})}))]})})]},a)}))]})}}),(0,N.jsxs)(v.Z,{align:"middle",children:[(0,N.jsx)(j.Z.Item,{name:"downcase",valuePropName:"checked",children:(0,N.jsx)(y.Z,{})}),(0,N.jsx)(w.Z,{className:"ml10",children:"判分时忽略答案中的字母大小写"})]}),(0,N.jsxs)(v.Z,{align:"middle",children:[(0,N.jsx)(j.Z.Item,{name:"no_space",valuePropName:"checked",children:(0,N.jsx)(y.Z,{})}),(0,N.jsx)(w.Z,{className:"ml10",children:"判分时忽略答案中的空格"})]}),(null==D?void 0:D.length)>1&&(0,N.jsxs)(v.Z,{align:"middle",className:(null==D?void 0:D.length)>1?"mb30":"".concat(A.Z.hide),children:[(0,N.jsx)(j.Z.Item,{name:"is_ordered",children:(0,N.jsx)(I,{})}),(0,N.jsx)(w.Z,{className:"ml10",children:"允许学生每个填空的答案与标准答案的顺序不一致"})]}),(0,N.jsx)("div",{onClick:function(){return m(!0)},children:(0,N.jsx)(j.Z.Item,{name:"analysis",label:"题目解析",labelCol:{span:24},children:(0,N.jsx)(_.x,{placeholder:"请编辑题目解析(非必填)",isEdit:h})})})]})}},72173:function(e,n,t){"use strict";t.d(n,{Z:function(){return y}});var i=t(39647),r=t.n(i),o=t(79800),a=t.n(o),l=t(82242),s=t.n(l),c=t(85573),u=t.n(c),d=t(59301),p=t(95237),h=t(43604),m=t(78241),f=t(26194),g=t(78716),v=t(37712),w=["key","name"],x=u()(u()({},"正确","T"),"错误","F"),b=function(e){var n=e.value,t=e.onChange,i=e.form,r=1===(null==n?void 0:n.is_answer),o=null==n?void 0:n.choice_text,a=function(){var e=i.getFieldsValue().choices.map((function(e){return{choice_text:e.choice_text,is_answer:0}}));i.setFieldsValue({choices:e}),t(s()(s()({},n),{},{is_answer:1}))};return(0,v.jsxs)(p.Z,{className:f.Z.choiceWrap,align:"middle",wrap:!1,style:{marginBottom:"20px"},children:[(0,v.jsx)(h.Z,{onClick:a,className:"".concat(f.Z.choiceIndex," ").concat(f.Z.judgementIndex," ").concat(r?f.Z.activeAnswer:""),children:x[o]}),(0,v.jsx)(h.Z,{flex:1,className:"".concat(f.Z.editorWrap," ml15"),children:(0,v.jsx)("div",{className:"".concat(f.Z.inputBorder," ").concat(f.Z.placeholder," ").concat(r?f.Z.activeJudgementAnswer:""),children:o})}),(0,v.jsx)(h.Z,{flex:"0 0 auto",className:"ml15",children:(0,v.jsx)("div",{onClick:a,className:"".concat(f.Z.setAnswerBtn," ").concat(r?f.Z.activeAnswer:""),children:r?"正确答案":"设为答案"})})]})},y=function(e){var n=e.questionTitlePlaceholder,t=(e.choiceKey,e.form),i=(0,d.useState)(!1),o=a()(i,2),l=o[0],c=o[1];return(0,v.jsxs)("div",{className:f.Z.wrap,children:[(0,v.jsx)("div",{className:f.Z.questionTitleEditorWrap,children:(0,v.jsx)(m.Z.Item,{label:"题干",name:"name",labelCol:{span:24},rules:[{required:!0}],children:(0,v.jsx)(g.h,{scrollId:"name",watch:!0,height:140,placeholder:n})})}),(0,v.jsx)(m.Z.Item,{label:"答案选项",required:!0,labelCol:{span:24},children:(0,v.jsx)(m.Z.List,{name:"choices",rules:[{validator:function(e,n){return n.some((function(e){return 1===(null==e?void 0:e.is_answer)}))?Promise.resolve():Promise.reject(new Error("请设置正确答案"))}}],children:function(e){return(0,v.jsx)("div",{id:"choices",children:e.map((function(e){var n=e.key,i=e.name,o=r()(e,w);return(0,d.createElement)(m.Z.Item,s()(s()({},o),{},{key:n,name:i,noStyle:!0}),(0,v.jsx)(b,{form:t}))}))})}})}),(0,v.jsx)("div",{onClick:function(){return c(!0)},children:(0,v.jsx)(m.Z.Item,{name:"analysis",label:"题目解析",labelCol:{span:24},children:(0,v.jsx)(g.x,{placeholder:"请编辑题目解析(非必填)",isEdit:l})})})]})}},78716:function(e,n,t){"use strict";t.d(n,{h:function(){return p},x:function(){return h}});var i=t(82242),r=t.n(i),o=t(39647),a=t.n(o),l=t(77162),s=t(26194),c=t(36653),u=t(37712),d=["value","onChange","scrollId"],p=function(e){var n=e.value,t=e.onChange,i=e.scrollId,o=a()(e,d);return(0,u.jsx)("div",{id:i||"",children:(0,u.jsx)(l.Z,r()(r()({},o),{},{defaultValue:n,onChange:function(e,n){console.log("a:",e,n),null!=n&&n.length?t(e,n):t(e)}}))})},h=function(e){var n=e.value,t=e.onChange,i=e.placeholder,r=e.height,o=void 0===r?140:r;return e.isEdit?(0,u.jsx)(l.Z,{watch:!0,isFocus:!0,height:o,placeholder:i,defaultValue:n,onChange:t}):(0,u.jsx)("div",{style:{cursor:"pointer"},children:n?(0,u.jsx)(c.Z,{className:s.Z.inputBorder,value:n}):(0,u.jsx)("div",{className:"".concat(s.Z.inputBorder," ").concat(s.Z.placeholder," inputBorderError"),children:i})})}},42655:function(e,n,t){"use strict";t.d(n,{W:function(){return N}});var i=t(91232),r=t.n(i),o=t(79800),a=t.n(o),l=t(82242),s=t.n(l),c=t(39647),u=t.n(c),d=t(59301),p=t(8591),h=t(12563),m=t(78241),f=t(78673),g=t(95237),v=t(43604),w=t(6848),x=t(98135),b=t(54449),y=t(26194),j=t(78716),k=t(77162),C=t(85699),_=t(37712),S=["value","onChange"],Z=["key","name"],A=function(e){var n=e.value,t=e.onChange,i=u()(e,S);return(0,_.jsx)(k.Z,s()(s()({},i),{},{defaultValue:null==n?void 0:n[0],onChange:function(e){t([e])}}))},P=function(e){var n=e.value,t=void 0===n?[]:n,i=e.onClose;return(0,_.jsx)(h.Z,{closable:!0,onClose:i,className:y.Z.keywordTag,children:(0,_.jsx)("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"},children:t.join(" 或 ")})})},N=function(e){var n=e.questionTitlePlaceholder,t=e.form,i=e.showKeywords,o=e.isMustKeyWords,l=void 0===o?i:o,c=(0,d.useState)(!1),h=a()(c,2),k=h[0],S=h[1],N=(0,d.useState)(""),E=a()(N,2),B=E[0],T=E[1],I=m.Z.useWatch("use_keywords",t),O=m.Z.useWatch("question_score",t);return(0,_.jsxs)("div",{className:y.Z.wrap,children:[(0,_.jsx)("div",{className:y.Z.questionTitleEditorWrap,children:(0,_.jsx)(m.Z.Item,{label:"题干",name:"name",labelCol:{span:24},rules:[{required:!0}],children:(0,_.jsx)(j.h,{scrollId:"name",watch:!0,height:140,placeholder:n})})}),(0,_.jsx)(m.Z.Item,{label:"参考答案",name:"answer_texts",labelCol:{span:24},children:(0,_.jsx)(A,{watch:!0,height:140,placeholder:"请编辑参考答案(非必填)"})}),i&&!l&&(0,_.jsx)(m.Z.Item,{hidden:!0,name:"use_keywords",valuePropName:"checked",children:(0,_.jsx)(f.Z,{defaultChecked:!0})}),i&&l&&(0,_.jsxs)(g.Z,{align:"middle",className:"mb30",children:[(0,_.jsx)(m.Z.Item,{name:"use_keywords",valuePropName:"checked",children:(0,_.jsx)(f.Z,{})}),(0,_.jsx)(v.Z,{className:"ml10",children:"开启关键词自动判分"}),(0,_.jsx)(v.Z,{children:(0,_.jsx)(w.Z,{placement:"right",title:"选中后,需要设置每个关键词的分值,系统会根据设置的关键词进行自动判分; 所有关键词分值之和必须小于等于小题分值。",children:(0,_.jsx)(C.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})})})]}),(I||!l)&&(0,_.jsx)(m.Z.List,{name:"keywords",rules:[{validator:function(e,n){return l?null!=n&&n.length?(null==n?void 0:n.reduce((function(e,n){return e+n.score}),0))>parseFloat(O)?Promise.reject(new Error("所有关键词的分值之和必须小于等于该小题的分值")):Promise.resolve():Promise.reject(new Error("请设置判分关键词")):Promise.resolve()}}],children:function(e,n){var i=n.add,o=n.remove;return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"".concat(y.Z.title," mb10"),children:l?"关键词":(0,_.jsx)("span",{style:{color:"#9096A3"},children:"判分关键词"})}),(0,_.jsxs)(g.Z,{align:"middle",className:"font14 mb30",children:[(0,_.jsx)(v.Z,{flex:1,children:(0,_.jsx)(x.Z,{value:B,onChange:function(e){T(e.target.value)},maxLength:50,allowClear:!0,onPressEnter:function(e){var n,o,a,l,s="".concat(null===(n=e.target)||void 0===n?void 0:n.value),c=null==s||null===(o=s.split("|"))||void 0===o||null===(o=o.filter((function(e){return!!e})))||void 0===o?void 0:o.map((function(e){return null==e?void 0:e.trim()})),u=t.getFieldValue("keywords"),d=(null==u||null===(a=u.map((function(e){return null==e?void 0:e.keyword})))||void 0===a?void 0:a.flat())||[],h=r()(c);try{for(h.s();!(l=h.n()).done;){var m=l.value;if(d.includes(m))return void p.ZP.error("为避免判分错误,请勿设置相同的关键词")}}catch(e){h.e(e)}finally{h.f()}(function(e){if(!e)return!1;if(!/^s*$/.test(e)&&""!==e.trim())return new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~!@#¥……&*()—【】‘;:”“。,、?「」『』_\\+\\-·%《》]|[\\\\/]"),"|"!==e||(p.ZP.warning("关键词不能只输入一个“|”字符!"),!1);p.ZP.warning("关键词不能全为空格")})(s)&&(i({keyword:c,score:1}),T(""))},className:y.Z.inputBorder,placeholder:"支持设置多个关键词;并列关键词(或的关系)请用“|”分隔开"})}),(0,_.jsx)(v.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"},children:"“回车键”保存关键词"})]}),e.map((function(e){var n=e.key,t=e.name,i=u()(e,Z);return(0,_.jsx)(g.Z,{className:"mb20",style:{marginRight:148},children:(0,_.jsx)(v.Z,{flex:1,children:(0,_.jsxs)(g.Z,{align:"middle",justify:"space-between",children:[(0,_.jsx)(m.Z.Item,s()(s()({},i),{},{name:[t,"keyword"],children:(0,_.jsx)(P,{onClose:function(){return o(t)}})})),l&&(0,_.jsx)(m.Z.Item,s()(s()({},i),{},{name:[t,"score"],label:"分值",rules:[{required:!0}],className:y.Z.blankInputNumberWrapper,children:(0,_.jsx)(b.Z,{className:y.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"请输入关键词分数"})}))]})})},n)}))]})}}),(0,_.jsx)("div",{onClick:function(){return S(!0)},children:(0,_.jsx)(m.Z.Item,{name:"analysis",label:"题目解析",labelCol:{span:24},children:(0,_.jsx)(j.x,{placeholder:"请编辑题目解析(非必填)",isEdit:k})})})]})}},66815:function(e,n,t){"use strict";t.d(n,{tc:function(){return ne.t},uh:function(){return i.u},rL:function(){return ee},u8:function(){return o.u},ZZ:function(){return r.Z},Wk:function(){return a.W}});var i=t(10877),r=t(72173),o=t(56689),a=t(42655),l=t(37205),s=t.n(l),c=t(82242),u=t.n(c),d=t(39647),p=t.n(d),h=t(79800),m=t.n(h),f=t(59301),g=t(36381),v=t(78241),w=t(95237),x=t(54449),b=t(6848),y=t(38854),j=t(26194),k=t(78091),C=t(78716),_=t(91232),S=t.n(_),Z=t(43418),A=t(43604),P=t(98135),N=t(78673),E=t(37712),B=["key","name"],T=function(e){var n=e.value,t=e.onChange;return(0,E.jsxs)(w.Z,{className:"ml20",children:[(0,E.jsx)(A.Z,{flex:1,children:null==n?void 0:n.map((function(e,i){return(0,E.jsxs)(w.Z,{align:"middle",className:"mb20",children:[(0,E.jsx)(P.Z.TextArea,{style:{flex:1,minHeight:44},defaultValue:e,autoSize:{maxRows:3},maxLength:1e3,onBlur:function(e){var r=s()(n),o=e.target.value.trim();r[i]=o,t(r)}}),(0,E.jsx)(b.Z,{title:"删除",children:(0,E.jsx)(k.Z,{className:j.Z.deleteIcon,style:{marginLeft:15,visibility:i>0?"visible":"hidden"},onClick:function(){return function(e){Z.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:j.Z.modal,onOk:function(){var i=s()(n);i.splice(e,1),t(i)}})}(i)}})})]},"".concat(e,"_").concat(i))}))}),(0,E.jsx)(A.Z,{children:(0,E.jsx)("div",{className:"".concat(j.Z.addBtn),onClick:function(){var e;(e=s()(n)).push(""),t(e)},children:"新增答案"})})]})},I=function(e){var n=e.value,t=void 0===n||n,i=e.onChange;return(0,E.jsx)(N.Z,{checked:!t,onChange:function(e){i(!e)}})},O="▁",L=function(e){var n,t=e.questionTitlePlaceholder,i=e.form,r=e.name,o=e.scoreByBlank,a=void 0!==o&&o,l=e.answerKey,c=e.titleKey,d=void 0===c?"name":c,h=e.analysisKey,g=void 0===h?"analysis":h,b=e.isOrdered,y=void 0===b?"is_ordered":b,k=(0,f.useState)(!1),_=m()(k,2),Z=_[0],L=_[1],M=function(e,n){for(var t=n.line,i=0,r=0;r1?Array.from({length:a},(function(e,n){return l+n})):l)}else if(o>0){var s=M(e,n.from);console.log("新增".concat(o,"个,之前有").concat(s,"个")),t(o,s)}}(e,n,G,z)}})})}),(0,E.jsx)(v.Z.List,{name:l,rules:[{validator:function(e,n){if(0===(null==n?void 0:n.length))return Promise.reject(new Error("请先在题干中插入填空项"));var t,i=S()(n);try{for(i.s();!(t=i.n()).done;){var r=(t.value||{}).answer_text;if(null!=r&&r.some((function(e){return 0===(null==e?void 0:e.length)})))return Promise.reject(new Error("填空项答案不能为空"))}}catch(e){i.e(e)}finally{i.f()}return Promise.resolve()}}],children:function(e,n,t){var i=n.add,r=n.remove;t.errors;return D.current=i,F.current=r,(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(v.Z.Item,{label:(0,E.jsxs)("span",{children:["填空项答案",!(null!=e&&e.length)&&(0,E.jsx)("span",{style:{color:"#E99237"},children:"(请先在题干中插入填空项)"})]}),required:!0,labelCol:{span:24}}),e.map((function(e,n){var t=e.key,i=e.name,r=p()(e,B);return(0,E.jsxs)(w.Z,{align:"top",children:[(0,E.jsxs)(A.Z,{className:"".concat(j.Z.blankIndex," pt5"),children:["填空项",n+1]}),(0,E.jsxs)(A.Z,{flex:1,children:[(0,E.jsxs)(w.Z,{align:"top",justify:"space-between",children:[(0,E.jsx)(A.Z,{flex:1,children:(0,E.jsx)(v.Z.Item,u()(u()({},r),{},{name:[i,"answer_text"],noStyle:!0,children:(0,E.jsx)(T,{})}))}),a&&(0,E.jsx)(A.Z,{flex:"224px",children:(0,E.jsx)(v.Z.Item,u()(u()({},r),{},{name:[i,"score"],label:"分值",rules:[{required:!0}],className:j.Z.blankInputNumberWrapper,children:(0,E.jsx)(x.Z,{className:j.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"按空给分请输入分值"})}))})]}),(0,E.jsx)(v.Z.Item,u()(u()({},r),{},{name:[i,"position"],noStyle:!0,children:(0,E.jsx)(P.Z,{type:"hidden"})}))]})]},t)}))]})}}),(0,E.jsxs)(w.Z,{align:"middle",children:[(0,E.jsx)(v.Z.Item,{name:[r,"downcase"],valuePropName:"checked",children:(0,E.jsx)(N.Z,{})}),(0,E.jsx)(A.Z,{className:"ml10",children:"判分时忽略答案中的字母大小写"})]}),(0,E.jsxs)(w.Z,{align:"middle",children:[(0,E.jsx)(v.Z.Item,{name:[r,"no_space"],valuePropName:"checked",children:(0,E.jsx)(N.Z,{})}),(0,E.jsx)(A.Z,{className:"ml10",children:"判分时忽略答案中的空格"})]}),(null==W?void 0:W.length)>1&&(0,E.jsxs)(w.Z,{align:"middle",className:(null==W?void 0:W.length)>1?"mb30":"".concat(j.Z.hide),children:[(0,E.jsx)(v.Z.Item,{name:y,children:(0,E.jsx)(I,{})}),(0,E.jsx)(A.Z,{className:"ml10",children:"允许学生每个填空的答案与标准答案的顺序不一致"})]}),(0,E.jsx)("div",{onClick:function(){return L(!0)},children:(0,E.jsx)(v.Z.Item,{name:g,label:"题目解析",labelCol:{span:24},children:(0,E.jsx)(C.x,{placeholder:"请编辑题目解析(非必填)",isEdit:Z})})})]})},M=t(85573),R=t.n(M),D=["key","name"],G=R()(R()({},"正确","T"),"错误","F"),F=function(e){var n=e.value,t=e.onChange,i=e.form,r=e.choiceKey,o=1===(null==n?void 0:n.is_answer),a=null==n?void 0:n.choice_text,l=function(){var e,o=null==i||null===(e=i.getFieldValue(["sub_item_banks"].concat(s()(r))))||void 0===e?void 0:e.map((function(e){return{choice_text:e.choice_text,is_answer:0}}));null==i||i.setFieldValue(["sub_item_banks"].concat(s()(r)),o),t(u()(u()({},n),{},{is_answer:1}))};return(0,E.jsxs)(w.Z,{className:j.Z.choiceWrap,align:"middle",wrap:!1,children:[(0,E.jsx)(A.Z,{onClick:l,className:"".concat(j.Z.choiceIndex," ").concat(j.Z.judgementIndex," ").concat(o?j.Z.activeAnswer:""),children:G[a]}),(0,E.jsx)(A.Z,{flex:1,className:"".concat(j.Z.editorWrap," ml15"),children:(0,E.jsx)("div",{className:"".concat(j.Z.inputBorder," ").concat(j.Z.placeholder," ").concat(o?j.Z.activeJudgementAnswer:""),children:a})}),(0,E.jsx)(A.Z,{flex:"0 0 auto",className:"ml15",children:(0,E.jsx)("div",{onClick:l,className:"".concat(j.Z.setAnswerBtn," ").concat(o?j.Z.activeAnswer:""),children:o?"正确答案":"设为答案"})})]})},z=function(e){var n=e.questionTitlePlaceholder,t=e.choiceKey,i=void 0===t?"choices":t,r=e.form,o=e.titleKey,a=void 0===o?"name":o,l=e.analysisKey,s=void 0===l?"analysis":l,c=(0,f.useState)(!1),d=m()(c,2),h=d[0],g=d[1];return(0,E.jsxs)("div",{className:j.Z.wrap,children:[(0,E.jsx)("div",{className:j.Z.questionTitleEditorWrap,children:(0,E.jsx)(v.Z.Item,{label:"题干",name:a,labelCol:{span:24},rules:[{required:!0}],children:(0,E.jsx)(C.h,{scrollId:"name",watch:!0,height:140,placeholder:n})})}),(0,E.jsx)(v.Z.Item,{label:"答案选项",required:!0,labelCol:{span:24},children:(0,E.jsx)(v.Z.List,{name:i,rules:[{validator:function(e,n){return n.some((function(e){return 1===(null==e?void 0:e.is_answer)}))?Promise.resolve():Promise.reject(new Error("请设置正确答案"))}}],children:function(e){return(0,E.jsx)("div",{id:"choices",children:e.map((function(e){var n=e.key,t=e.name,o=p()(e,D);return(0,f.createElement)(v.Z.Item,u()(u()({},o),{},{key:n,name:t,noStyle:!0}),(0,E.jsx)(F,{form:r,choiceKey:i}))}))})}})}),(0,E.jsx)("div",{onClick:function(){return g(!0)},children:(0,E.jsx)(v.Z.Item,{name:s,label:"题目解析",labelCol:{span:24},children:(0,E.jsx)(C.x,{placeholder:"请编辑题目解析(非必填)",isEdit:h})})})]})},W=t(8591),H=t(12563),V=t(77162),K=t(85699),U=["value","onChange"],q=["key","name"],Y=function(e){var n=e.value,t=e.onChange,i=p()(e,U);return(0,E.jsx)(V.Z,u()(u()({},i),{},{defaultValue:null==n?void 0:n[0],onChange:function(e){t([e])}}))},J=function(e){var n=e.value,t=void 0===n?[]:n,i=e.onClose;return(0,E.jsx)(H.Z,{closable:!0,onClose:i,className:j.Z.keywordTag,children:(0,E.jsx)("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"},children:t.join(" 或 ")})})},Q=function(e){var n=e.questionTitlePlaceholder,t=e.form,i=e.showKeywords,r=e.isMustKeyWords,o=void 0===r?i:r,a=e.titleKey,l=void 0===a?"name":a,c=e.analysisKey,d=void 0===c?"analysis":c,h=e.answerTexts,g=void 0===h?"answer_texts":h,y=e.keywords,k=void 0===y?"keywords":y,_=e.useKeywords,Z=void 0===_?"use_keywords":_,B=e.indexs,T=(0,f.useState)(!1),I=m()(T,2),O=I[0],L=I[1],M=(0,f.useState)(""),R=m()(M,2),D=R[0],G=R[1],F=(0,f.useState)(!1),z=m()(F,2),H=z[0],V=z[1],U=v.Z.useWatch("question_score",t);return(0,E.jsxs)("div",{className:j.Z.wrap,children:[(0,E.jsx)("div",{className:j.Z.questionTitleEditorWrap,children:(0,E.jsx)(v.Z.Item,{label:"题干",name:l,labelCol:{span:24},rules:[{required:!0}],children:(0,E.jsx)(C.h,{scrollId:"name",watch:!0,height:140,placeholder:n})})}),(0,E.jsx)(v.Z.Item,{label:"参考答案",name:g,labelCol:{span:24},children:(0,E.jsx)(Y,{watch:!0,height:140,placeholder:"请编辑参考答案(非必填)"})}),i&&!o&&(0,E.jsx)(v.Z.Item,{hidden:!0,name:Z,valuePropName:"checked",children:(0,E.jsx)(N.Z,{defaultChecked:!0})}),i&&o&&(0,E.jsxs)(w.Z,{align:"middle",className:"mb30",children:[(0,E.jsx)(v.Z.Item,{name:Z,valuePropName:"checked",children:(0,E.jsx)(N.Z,{onChange:function(){var e,n;console.log(t.getFieldsValue()),V(null===(e=t.getFieldsValue())||void 0===e||null===(e=e.sub_item_banks)||void 0===e||null===(e=e[B])||void 0===e?void 0:e.use_keywords),console.log(null===(n=t.getFieldsValue())||void 0===n||null===(n=n.sub_item_banks)||void 0===n||null===(n=n[B])||void 0===n?void 0:n.use_keywords),console.log(H)}})}),(0,E.jsx)(A.Z,{className:"ml10",children:"开启关键词自动判分"}),(0,E.jsx)(A.Z,{children:(0,E.jsx)(b.Z,{placement:"right",title:"选中后,需要设置每个关键词的分值,系统会根据设置的关键词进行自动判分; 所有关键词分值之和必须小于等于小题分值。",children:(0,E.jsx)(K.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})})})]}),(H||!o)&&(0,E.jsx)(v.Z.List,{name:k,rules:[{validator:function(e,n){return o?null!=n&&n.length?(null==n?void 0:n.reduce((function(e,n){return e+n.score}),0))>parseFloat(U)?Promise.reject(new Error("所有关键词的分值之和必须小于等于该小题的分值")):Promise.resolve():Promise.reject(new Error("请设置判分关键词")):Promise.resolve()}}],children:function(e,n){var i=n.add,r=n.remove;return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("div",{className:"".concat(j.Z.title," mb10"),children:o?"关键词":(0,E.jsx)("span",{style:{color:"#9096A3"},children:"判分关键词"})}),(0,E.jsxs)(w.Z,{align:"middle",className:"font14 mb30",children:[(0,E.jsx)(A.Z,{flex:1,children:(0,E.jsx)(P.Z,{value:D,onChange:function(e){G(e.target.value)},maxLength:50,allowClear:!0,onPressEnter:function(e){var n,r,o,a,l,c="".concat(null===(n=e.target)||void 0===n?void 0:n.value),u=null==c||null===(r=c.split("|"))||void 0===r||null===(r=r.filter((function(e){return!!e})))||void 0===r?void 0:r.map((function(e){return null==e?void 0:e.trim()})),d=t.getFieldValue(["sub_item_banks"].concat(s()(k))),p=(null==d||null===(o=d.map((function(e){return null==e?void 0:e.keyword})))||void 0===o?void 0:o.flat())||[],h=S()(u);try{for(h.s();!(a=h.n()).done;){var m=a.value;if(p.includes(m))return void W.ZP.error("为避免判分错误,请勿设置相同的关键词")}}catch(e){h.e(e)}finally{h.f()}(l=c)&&(new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~!@#¥……&*()—【】‘;:”“。,、?「」『』_\\+\\-·%《》]|[\\\\/]"),"|"!==l||(W.ZP.warning("关键词不能只输入一个“|”字符!"),0))&&(i({keyword:u,score:1}),G(""))},className:j.Z.inputBorder,placeholder:"支持设置多个关键词;并列关键词(或的关系)请用“|”分隔开"})}),(0,E.jsx)(A.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"},children:"“回车键”保存关键词"})]}),e.map((function(e){var n=e.key,t=e.name,i=p()(e,q);return(0,E.jsx)(w.Z,{className:"mb20",style:{marginRight:148},children:(0,E.jsx)(A.Z,{flex:1,children:(0,E.jsxs)(w.Z,{align:"middle",justify:"space-between",children:[(0,E.jsx)(v.Z.Item,u()(u()({},i),{},{name:[t,"keyword"],children:(0,E.jsx)(J,{onClose:function(){return r(t)}})})),o&&(0,E.jsx)(v.Z.Item,u()(u()({},i),{},{name:[t,"score"],label:"分值",rules:[{required:!0}],className:j.Z.blankInputNumberWrapper,children:(0,E.jsx)(x.Z,{className:j.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"请输入关键词分数"})}))]})})},n)}))]})}}),(0,E.jsx)("div",{onClick:function(){return L(!0)},children:(0,E.jsx)(v.Z.Item,{name:d,label:"题目解析",labelCol:{span:24},children:(0,E.jsx)(C.x,{placeholder:"请编辑题目解析(非必填)",isEdit:O})})})]})},X=["key","name"],$=g.Z.Panel,ee=function(e){var n=e.questionTitlePlaceholder,t=(e.choiceKey,e.form),r=e.withScore,o=(0,f.useState)([]),a=m()(o,2),l=a[0],c=a[1],d=function(e){c(e)};return(0,E.jsxs)("div",{className:j.Z.wrap,children:[(0,E.jsx)("div",{className:j.Z.questionTitleEditorWrap,children:(0,E.jsx)(v.Z.Item,{label:"题干",name:"name",labelCol:{span:24},rules:[{required:!0}],children:(0,E.jsx)(C.h,{scrollId:"name",watch:!0,height:140,placeholder:n})})}),(0,E.jsx)(v.Z.Item,{label:"小题",required:!0,labelCol:{span:24}}),(0,E.jsx)(v.Z.List,{name:"sub_item_banks",rules:[{validator:function(e,n){return n?Promise.resolve():Promise.reject(new Error("请添加小题"))}}],children:function(e,n){var o=n.add,a=n.remove,h=t.getFieldValue("sub_item_banks");return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(g.Z,{className:e.length>0?j.Z.collapseWrapper:"",bordered:!1,activeKey:l,onChange:d,expandIcon:function(e){var n=e.isActive;return(0,E.jsx)("i",{className:"iconfont icon-weizhankai ".concat(n?j.Z.open:j.Z.close),style:{fontSize:14,transition:"all .2s"}})},children:e.map((function(e,n){e.key;var o,l,s,c,d,m,f,g,y,C,_=e.name,S=p()(e,X);return(0,E.jsx)($,{className:j.Z.panel,forceRender:!0,header:(0,E.jsxs)("div",{className:j.Z.panelHeader,children:["第",n+1,"小题",(0,E.jsxs)("span",{children:["(","SINGLE"==(null==h||null===(o=h[_])||void 0===o?void 0:o.item_type)?"单选题":"MULTIPLE"==(null==h||null===(l=h[_])||void 0===l?void 0:l.item_type)?"多选题":"COMPLETION"==(null==h||null===(s=h[_])||void 0===s?void 0:s.item_type)?"填空题":"JUDGMENT"==(null==h||null===(c=h[_])||void 0===c?void 0:c.item_type)?"判断题":"简答题",")"]})]}),extra:(0,E.jsxs)(w.Z,{align:"middle",onClick:function(e){return e.stopPropagation()},children:[r&&(0,E.jsx)(v.Z.Item,u()(u()({},S),{},{rules:[{required:!0,message:"请输入小题分值"}],label:"分值",name:[_,"question_score"],className:j.Z.blankInputNumberWrapper,children:(0,E.jsx)(x.Z,{className:j.Z.blankInput,placeholder:"请输入当前小题分数",min:.1,precision:1,max:100,style:{width:150}})})),(0,E.jsx)(b.Z,{title:"删除",children:(0,E.jsx)(k.Z,{className:"".concat(j.Z.deleteIcon," ml40"),onClick:function(){return a(_)}})})]}),children:(0,E.jsxs)(v.Z.Item,u()(u()({},S),{},{name:_,children:[("SINGLE"==(null==h||null===(d=h[_])||void 0===d?void 0:d.item_type)||"MULTIPLE"==(null==h||null===(m=h[_])||void 0===m?void 0:m.item_type))&&(0,E.jsx)(i.u,{questionTitlePlaceholder:"请编辑选择题题干内容",allowChangeMode:"MULTIPLE"==(null==h||null===(f=h[_])||void 0===f?void 0:f.item_type),form:t,choiceKey:[_,"choices"],titleKey:[_,"name"],analysisKey:[_,"analysis"],choiceOptionsPath:["sub_item_banks",_,"choices"],choiceTextKey:"choice_text",answerKey:"is_answer"}),"COMPLETION"==(null==h||null===(g=h[_])||void 0===g?void 0:g.item_type)&&(0,E.jsx)(L,{form:t,questionTitlePlaceholder:"请编辑题干并设置填空项",scoreByBlank:!1,name:_,titleKey:[_,"name"],analysisKey:[_,"analysis"],isOrdered:[_,"is_ordered"],answerKey:[_,"standard_answers"]}),"JUDGMENT"==(null==h||null===(y=h[_])||void 0===y?void 0:y.item_type)&&(0,E.jsx)(z,{form:t,questionTitlePlaceholder:"请编辑判断题题干内容",titleKey:[_,"name"],analysisKey:[_,"analysis"],choiceKey:[_,"choices"]}),"SUBJECTIVE"==(null==h||null===(C=h[_])||void 0===C?void 0:C.item_type)&&(0,E.jsx)(Q,{showKeywords:!0,isMustKeyWords:!1,form:t,titleKey:[_,"name"],analysisKey:[_,"analysis"],answerTexts:[_,"answer_texts"],useKeywords:[_,"use_keywords"],keywords:[_,"keywords"],indexs:_,questionTitlePlaceholder:"请编辑简答题题干内容"})]}))},_)}))}),e.length<20&&(0,E.jsx)(y.Z,{menu:{items:[{label:(0,E.jsx)("div",{onClick:function(){o({name:"",choices:Array.from({length:4},(function(){return{choice_text:"",is_answer:0}})),analysis:"",item_type:"SINGLE"}),c([null==e?void 0:e.length].concat(s()(l)))},children:"单选题"}),key:"1",show:!0},{label:(0,E.jsx)("div",{onClick:function(){o({name:"",choices:Array.from({length:4},(function(){return{choice_text:"",is_answer:0}})),analysis:"",item_type:"MULTIPLE"}),c([null==e?void 0:e.length].concat(s()(l)))},children:"多选题"}),key:"2",show:!0},{label:(0,E.jsx)("div",{onClick:function(){o({name:"",choices:[{choice_text:"正确",is_answer:0},{choice_text:"错误",is_answer:0}],analysis:"",item_type:"JUDGMENT"}),c([null==e?void 0:e.length].concat(s()(l)))},children:"判断题"}),key:"3",show:!0},{label:(0,E.jsx)("div",{onClick:function(){o({name:"",analysis:"",is_ordered:!0,standard_answers:[],item_type:"COMPLETION",downcase:!0,no_space:!0}),c([null==e?void 0:e.length].concat(s()(l)))},children:"填空题"}),key:"4",show:!0},{label:(0,E.jsx)("div",{onClick:function(){o({name:"",answer_texts:[],keywords:[],use_keywords:!0,analysis:"",item_type:"SUBJECTIVE"}),c([null==e?void 0:e.length].concat(s()(l)))},children:"简答题"}),key:"5",show:!0}].filter((function(e){return e.show})).map((function(e){return{label:e.label,key:e.key}}))},children:(0,E.jsx)("div",{className:"".concat(j.Z.addBtn),children:"添加小题"})})]})}})]})},ne=t(75150)},71550:function(e,n,t){"use strict";t.d(n,{h:function(){return v}});var i=t(82242),r=t.n(i),o=t(79800),a=t.n(o),l=t(59301),s=t(57809),c=t(78241),u=t(3113),d=t(89780),p=t.n(d),h=(t(49324),t(20615),t(37712)),m=s.default.Option,f={labelCol:{span:4},wrapperCol:{span:20}},g={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};function v(e){var n=e.value,t=e.onChange,i=e.mode,o=e.options,s=void 0===o?{}:o,c=(0,l.useRef)(),u=(0,l.useState)(),d=a()(u,2),m=d[0],f=d[1];return(0,l.useEffect)((function(){if(m){var e=function(e){var n=e.getValue();t&&t(n)};return m.on("change",e),function(){m.off("change",e)}}}),[m,t]),(0,l.useEffect)((function(){m&&m.setOption("mode",i)}),[m,i]),(0,l.useEffect)((function(){m&&(n===m.getValue()&&""!==n||setTimeout((function(){m.setValue(n||"")}),300))}),[m,n]),(0,l.useEffect)((function(){if(c.current&&!m){var e=p().fromTextArea(c.current,r()({mode:i,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},s));f(e)}}),[c.current,m]),(0,h.jsx)("div",{className:"my-codemirror-container",children:(0,h.jsx)("textarea",{ref:c})})}n.Z=function(e){var n=e.callback,t=e.onCancel,i=(0,l.useState)("python"),o=a()(i,2),d=o[0],p=o[1];return(0,h.jsxs)(c.Z,r()(r()({},f),{},{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){n(e)},style:{width:500},children:[(0,h.jsx)(c.Z.Item,{label:"代码语言",name:"language",children:(0,h.jsx)(s.default,{getPopupContainer:function(e){return e.parentNode},onChange:function(e){p(g[e][1])},children:Object.keys(g).map((function(e){return(0,h.jsx)(m,{value:e,children:g[e][0]},e)}))})}),(0,h.jsx)(c.Z.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}],children:(0,h.jsx)(v,{mode:d})}),(0,h.jsxs)("div",{className:"flex-container flex-end",children:[(0,h.jsx)(u.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,h.jsx)(u.ZP,{type:"ghost",onClick:t,children:"取消"})]})]}))}},77162:function(e,n,t){"use strict";t.d(n,{Z:function(){return Ze}});var i=t(91232),r=t.n(i),o=t(79800),a=t.n(o),l=t(85573),s=t.n(l),c=t(59301),u=t(89780),d=t.n(u),p=t(76374),h=(t(49324),t(6313),t(25717),t(99498),t(25419),t(67549),t(36653)),m=t(37712),f=function(e){var n=e.value,t=void 0===n?"":n,i=(e.className,e.showTextOnly,e.showLines,e.style,(0,c.useMemo)((function(){return""}),[t]));return(0,m.jsx)(m.Fragment,{children:(0,m.jsx)("div",{dangerouslySetInnerHTML:{__html:i}})})},g=t(82242),v=t.n(g),w=[{title:"粗体",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"斜体",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"无序列表",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"有序列表",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"行内代码",icon:"md-iconfont icon-code",actionName:"code"},{title:"代码块(多语言风格)",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"链接",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"行内公式",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"数学图像",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"多行公式",icon:"iconfont icon-jisuan1",actionName:"latex"},"|",{title:"添加图片",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"插入画图",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"插入流程图",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"表格",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"换行",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"清空",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function x(e){var n=e.onActionCallback,t=e.title,i=e.icon,r=e.actionName,o=e.className,a=void 0===o?"":o,l=e.children;return(0,m.jsxs)("a",{title:t,className:a,onClick:function(){n(r)},children:[(0,m.jsx)("i",{className:"".concat(i)}),l]})}var b=function(e){var n=e.watch,t=e.showNullButton,i=e.showNullProgramButton,r=e.onActionCallback,o=e.fullScreen,a=e.insertTemp,l=e.hidetoolBar,s=e.extraUse,c=[].concat(w,[{title:"".concat(n?"关闭实时预览":"开启实时预览"),icon:"".concat(n?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"),actionName:"trigger-watch"}]);return(0,m.jsxs)("ul",{className:"markdown-toolbar-container",children:[!l&&c.map((function(e,n){return(0,m.jsx)("li",{children:e.actionName?(0,m.jsx)(x,v()(v()({},e),{},{onActionCallback:r})):(0,m.jsx)("span",{className:"v-line"})},n)})),t?(0,m.jsx)("li",{children:(0,m.jsx)(x,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-null-ch",onActionCallback:r,children:(0,m.jsx)("span",{className:"fill-tip",children:"点击插入\b填空项"})})}):null,i?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("li",{children:(0,m.jsx)(x,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-signal",onActionCallback:r,children:(0,m.jsx)("span",{className:"fill-tip",children:"+单行填空项"})})}),(0,m.jsx)("li",{children:(0,m.jsx)(x,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"增加填空",actionName:"add-multiple",onActionCallback:r,children:(0,m.jsx)("span",{className:"fill-tip",children:"+多行填空项"})})})]}):null,a&&(0,m.jsx)("li",{children:(0,m.jsx)(x,{icon:"md-iconfont icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(a),onActionCallback:r,children:(0,m.jsx)("span",{className:"fill-tip",children:"插入模板"})})}),s&&(0,m.jsx)("li",{children:s}),(0,m.jsx)("li",{className:"btn-full-screen",children:(0,m.jsx)(x,{icon:"".concat(o?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"),title:o?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:r})})]})},y=t(30043),j=t(78241),k=t(98135),C=t(3113),_={labelCol:{span:4},wrapperCol:{span:20}},S=function(e){var n=e.callback,t=e.onCancel;return(0,m.jsxs)(j.Z,v()(v()({},_),{},{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(e){n(e)},style:{width:500},children:[(0,m.jsx)(j.Z.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}],children:(0,m.jsx)(k.Z,{})}),(0,m.jsx)(j.Z.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}],children:(0,m.jsx)(k.Z,{})}),(0,m.jsxs)("div",{className:"flex-container flex-end",children:[(0,m.jsx)(C.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,m.jsx)(C.ZP,{type:"ghost",onClick:t,children:"取消"})]})]}))},Z=t(71550),A=t(8591),P=t(53842),N=j.Z.useForm,E={width:280,marginRight:10},B={labelCol:{span:5},wrapperCol:{span:19}},T=function(e){var n=e.callback,t=e.onCancel,i=N(),r=a()(i,1)[0],o=(0,c.useRef)();function l(e,n){-1!==e.status?r.setFieldsValue({src:"/api/attachments/".concat(e.id),type:n.type}):A.ZP.error(e.message)}return(0,m.jsxs)(j.Z,v()(v()({form:r},B),{},{className:"upload-image-panel",onFinish:function(e){n(e,o.current)},style:{width:470,overflow:"hidden"},children:[(0,m.jsx)(j.Z.Item,{label:"图片地址",required:!0,children:(0,m.jsxs)("div",{className:"flex-container",children:[(0,m.jsx)(j.Z.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入图片地址"}],children:(0,m.jsx)(k.Z,{style:E})}),(0,m.jsx)(I,{onFileChange:function(e){var n=e.target.files[0];o.current=n,O(n,l)}})]})}),(0,m.jsx)(j.Z.Item,{label:"图片描述",name:"alt",children:(0,m.jsx)(k.Z,{style:{width:264}})}),(0,m.jsxs)(j.Z.Item,{style:{textAlign:"right"},children:[(0,m.jsx)(C.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,m.jsx)(C.ZP,{type:"default",onClick:t,children:"取消"})]})]}))};function I(e){var n=e.onFileChange;return(0,m.jsxs)("label",{className:"upload-button",style:{cursor:"pointer"},children:["本地上传",(0,m.jsx)("input",{type:"file",onChange:n})]})}function O(e,n){if(!e)throw new String("没有文件");var t=new FormData;t.append("editormd-image-file",e),t.append("file_param_name","editormd-image-file"),t.append("byxhr","true");var i=new window.XMLHttpRequest;i.withCredentials=!0,i.addEventListener("load",(function(t){n(JSON.parse(t.target.responseText),e)}),!1),i.addEventListener("error",(function(e){console.error(e)}),!1),i.open("POST","".concat(P.KI,"/api/attachments.json")),i.send(t)}var L=t(95237),M=t(87359),R=function(e){var n=e.callback,t=e.onCancel,i=document.createElement("canvas"),r=i.getContext("2d");i.width=1e3,i.height=800,r.fillStyle="#ffffff",r.fillRect(0,0,i.width,i.height);var o=i.toDataURL("image/png");return(0,m.jsx)(L.Z,{style:{height:"100vh"},children:(0,m.jsx)(M.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:o,visible:!0,title:String(Date.now())},onOk:function(e){n({src:e.url})},onClose:t})})},D=t(7557),G=t.n(D),F=t(41498),z=t.n(F),W=t(37205),H=t.n(W),V=t(12378);function K(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(K,go.CommandHandler),K.prototype.canAlignSelection=function(){var e=this.diagram;return null!==e&&!e.isReadOnly&&!e.isModelReadOnly&&!(e.selection.count<2)},K.prototype.alignLeft=function(){var e=this.diagram;e.startTransaction("aligning left");var n=1/0;e.selection.each((function(e){e instanceof go.Link||(n=Math.min(e.position.x,n))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(n,e.position.y))})),e.commitTransaction("aligning left")},K.prototype.alignRight=function(){var e=this.diagram;e.startTransaction("aligning right");var n=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var t=e.actualBounds.x+e.actualBounds.width;n=Math.max(t,n)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(n-e.actualBounds.width,e.position.y))})),e.commitTransaction("aligning right")},K.prototype.alignTop=function(){var e=this.diagram;e.startTransaction("alignTop");var n=1/0;e.selection.each((function(e){e instanceof go.Link||(n=Math.min(e.position.y,n))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.position.x,n))})),e.commitTransaction("alignTop")},K.prototype.alignBottom=function(){var e=this.diagram;e.startTransaction("aligning bottom");var n=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var t=e.actualBounds.y+e.actualBounds.height;n=Math.max(t,n)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,n-e.actualBounds.height))})),e.commitTransaction("aligning bottom")},K.prototype.alignCenterX=function(){var e=this.diagram,n=e.selection.first();if(n){e.startTransaction("aligning Center X");var t=n.actualBounds.x+n.actualBounds.width/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(t-e.actualBounds.width/2,e.actualBounds.y))})),e.commitTransaction("aligning Center X")}},K.prototype.alignCenterY=function(){var e=this.diagram,n=e.selection.first();if(n){e.startTransaction("aligning Center Y");var t=n.actualBounds.y+n.actualBounds.height/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,t-e.actualBounds.height/2))})),e.commitTransaction("aligning Center Y")}},K.prototype.alignColumn=function(e){var n=this.diagram;n.startTransaction("align Column"),void 0===e&&(e=0),e=parseFloat(e);var t=new Array;n.selection.each((function(e){e instanceof go.Link||t.push(e)}));for(var i=0;i0){for(var i=a.elt(l-1);null!==i&&i.isTreeExpanded&&!i.isTreeLeaf;){i=this._sortTreeChildrenByY(i).last()}null!==i&&e.select(i)}else e.select(o)}else if("Down"===t.key){var r;if(n.isTreeExpanded&&!n.isTreeLeaf)null!==(r=this._sortTreeChildrenByY(n).first())&&e.select(r);else for(;null!==n;){var o,a,l;if(null===(o=n.findTreeParentNode()))break;if((l=(a=this._sortTreeChildrenByY(o)).indexOf(n))i.y?1:t.xi.x?1:0})),n},K.prototype.copyToClipboard=function(e){go.CommandHandler.prototype.copyToClipboard.call(this,e),this._lastPasteOffset.set(this.pasteOffset)},K.prototype.pasteFromClipboard=function(){var e=go.CommandHandler.prototype.pasteFromClipboard.call(this);return this.diagram.moveParts(e,this._lastPasteOffset),this._lastPasteOffset.add(this.pasteOffset),e},Object.defineProperty(K.prototype,"arrowKeyBehavior",{get:function(){return this._arrowKeyBehavior},set:function(e){if("move"!==e&&"select"!==e&&"scroll"!==e&&"tree"!==e&&"none"!==e)throw new Error('DrawCommandHandler.arrowKeyBehavior must be either "move", "select", "scroll", "tree", or "none", not: '+e);this._arrowKeyBehavior=e}}),Object.defineProperty(K.prototype,"pasteOffset",{get:function(){return this._pasteOffset},set:function(e){if(!(e instanceof go.Point))throw new Error("DrawCommandHandler.pasteOffset must be a Point, not: "+e);this._pasteOffset.set(e)}});var U=K,q=(t(79286),t(85160)),Y=t(43418),J=t(43604),Q=t(90694),X="myPaletteDiv___Xjz2I",$="maxH60___Pd4Re";window.go=V;var ee=function(e){var n=e.onCancel,t=e.callback,i=(0,c.useRef)(),r=(0,c.useRef)(),o=(0,c.useRef)(),l=(0,c.useRef)(!1),s=(0,c.useRef)(!1),u=(0,c.useState)(0),d=a()(u,2),p=d[0],h=d[1],f=function(){var e=z()(G()().mark((function e(){var n,r;return G()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.current.makeImage(),e.next=3,(0,Q.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:n.src}});case 3:r=e.sent,t({src:r.url});case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,c.useEffect)((function(){h(p+1)}),[]),(0,m.jsx)("div",{ref:s,className:l.current?"".concat($," body-overflow-initial"):"body-overflow-initial",children:(0,m.jsx)(Y.Z,{width:1200,icon:null,footer:null,closable:!0,visible:!!p,destroyOnClose:!0,maskClosable:!1,getContainer:s.current,rootClassName:"zIndex-9999",title:(0,m.jsxs)(L.Z,{children:[(0,m.jsx)(J.Z,{flex:1,children:"插入流程图"}),(0,m.jsx)(J.Z,{onClick:function(){l.current=!l.current,h(p+1)},children:(0,m.jsx)("span",{className:"current c-blue mr30",style:{fontWeight:400},children:"展开/收起"})})]}),onCancel:n,children:(0,m.jsxs)("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative"},children:[(0,m.jsxs)("div",{style:{display:"flex",height:"100%"},children:[(0,m.jsxs)("div",{style:{width:"300px",height:"100%"},children:[(0,m.jsx)("div",{style:{background:"#fff",position:"relative",zIndex:12,fontSize:16,color:"#3061d0"},children:"图形库"}),(0,m.jsx)("div",{style:{height:"calc(100% - 50px)"},className:X,ref:o})]}),(0,m.jsxs)("div",{style:{flex:1,position:"relative"},children:[(0,m.jsx)(q.FI,{initDiagram:function(){var e=V.GraphObject.make,n="#ff3333",t="#3358ff",a="#25ad23",l="#d533ff",s="#7d33ff",c="#ff6233",u="#ffffff",d="#000000",p="#fffcd5",h="#d5ebff",m="#f2dfe0",f="#a5d2fa",g="#cccccc",v="#b3e6b3",w="#fcbbbd";function x(n,t){var i=function(e,t){e.handled=!0,e.diagram.model.commit((function(i){var r=t.part.adornedPart,o=(new V.Point).setRectSpot(r.actualBounds,n);o.subtract(r.location),o.scale(2,2),o.x+=130*Math.sign(o.x),o.y+=130*Math.sign(o.y),o.add(r.location),o.snapToGridPoint(e.diagram.grid.gridOrigin,e.diagram.grid.gridCellSize);var a=i.copyNodeData(r.data);i.setGroupKeyForNodeData(a,i.getGroupKeyForNodeData(r.data)),i.addNodeData(a);var l={from:r.key,to:i.getKeyForNodeData(a)};i.addLinkData(l);var s=e.diagram.findNodeForData(a);s.location=o,e.diagram.select(s),setTimeout((function(){e.diagram.commandHandler.editTextBlock()}),20)}))};return e(V.Shape,{figure:t,alignment:n,alignmentFocus:n.opposite(),width:n.equals(V.Spot.Top)||n.equals(V.Spot.Bottom)?25:18,height:n.equals(V.Spot.Top)||n.equals(V.Spot.Bottom)?18:25,fill:"orange",stroke:u,strokeWidth:4,mouseEnter:function(e,n){return n.fill="dodgerblue"},mouseLeave:function(e,n){return n.fill="orange"},isActionable:!0,click:i,contextClick:i})}function b(n){return e(V.Shape,{fill:"orange",stroke:"rgba(0, 0, 0, 0)",strokeWidth:15,background:"transparent",geometryString:"F1 M0 0 b 0 360 -4 0 4 z M10 0 b 0 360 -4 0 4 z M20 0 b 0 360 -4 0 4",isActionable:!0,cursor:"context-menu",mouseEnter:function(e,n){return n.fill="dodgerblue"},mouseLeave:function(e,n){return n.fill="orange"},click:function(e,n){e.diagram.commandHandler.showContextMenu(n.part.adornedPart)}},n||{})}function y(e,n){return function(t,i){t.handled=!0,t.diagram.model.commit((function(t){t.set(i.part.adornedPart.data,e,n)}))}}function j(n,t){return t||(t="color"),e(V.Shape,{width:16,height:16,stroke:"lightgray",fill:n,margin:1,background:"transparent",mouseEnter:function(e,n){return n.stroke="dodgerblue"},mouseLeave:function(e,n){return n.stroke="lightgray"},click:y(t,n),contextClick:y(t,n)})}function k(){return[e("ContextMenuButton",e(V.Panel,"Horizontal",j(u,"fill"),j(p,"fill"),j(h,"fill"),j(m,"fill"))),e("ContextMenuButton",e(V.Panel,"Horizontal",j(g,"fill"),j(v,"fill"),j(f,"fill"),j(w,"fill")))]}function C(){return[e("ContextMenuButton",e(V.Panel,"Horizontal",j(d),j(a),j(t),j(n))),e("ContextMenuButton",e(V.Panel,"Horizontal",j(u),j(l),j(s),j(c)))]}function _(n,t){return t||(t="thickness"),e(V.Shape,"LineH",{width:16,height:16,strokeWidth:n,margin:1,background:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:y(t,n),contextClick:y(t,n)})}function S(n,t){return t||(t="dash"),e(V.Shape,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:n,margin:1,background:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:y(t,n),contextClick:y(t,n)})}function Z(){return[e("ContextMenuButton",e(V.Panel,"Horizontal",_(1),_(2),_(3),_(4))),e("ContextMenuButton",e(V.Panel,"Horizontal",S(null),S([2,4]),S([4,4])))]}function A(n,t){return t||(t="figure"),e(V.Shape,{width:32,height:32,scale:.5,fill:"lightgray",figure:n,margin:1,background:"transparent",mouseEnter:function(e,n){return n.fill="dodgerblue"},mouseLeave:function(e,n){return n.fill="lightgray"},click:y(t,n),contextClick:y(t,n)})}function P(n){return e(V.Shape,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(n+4).toString()+" H3"})}function N(n){var t="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return 0===n?t="M0 0 M16 16 M0 8 L16 8":2===n&&(t="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),e(V.Shape,{geometryString:t,margin:2,background:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:y("dir",n),contextClick:y("dir",n)})}function E(n){var t=function(e,t){e.handled=!0,e.diagram.model.commit((function(e){var i=t.part.adornedPart;e.set(i.data,n?"toSpot":"fromSpot",V.Spot.stringify(V.Spot.AllSides)),(n?i.toNode:i.fromNode).invalidateConnectedLinks()}))};return e(V.Shape,{width:12,height:12,fill:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:t,contextClick:t})}function B(n,t){var i=0,r=V.Spot.RightSide;n.equals(V.Spot.Top)?(i=270,r=V.Spot.TopSide):n.equals(V.Spot.Left)?(i=180,r=V.Spot.LeftSide):n.equals(V.Spot.Bottom)&&(i=90,r=V.Spot.BottomSide),t||(i-=180);var o=function(e,n){e.handled=!0,e.diagram.model.commit((function(e){var i=n.part.adornedPart;e.set(i.data,t?"toSpot":"fromSpot",V.Spot.stringify(r)),(t?i.toNode:i.fromNode).invalidateConnectedLinks()}))};return e(V.Shape,{alignment:n,alignmentFocus:n.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:i,background:"transparent",mouseEnter:function(e,n){return n.background="dodgerblue"},mouseLeave:function(e,n){return n.background="transparent"},click:o,contextClick:o})}return i.current=new V.Diagram(r.current,{padding:20,grid:e(V.Panel,"Grid",e(V.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(V.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),"draggingTool.isGridSnapEnabled":!0,handlesDragDropForTopLevelParts:!0,mouseDrop:function(e){e.diagram.commandHandler.addTopLevelParts(e.diagram.selection,!0)||e.diagram.currentTool.doCancel()},commandHandler:e(U),"clickCreatingTool.archetypeNodeData":{text:"未命名",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:function(e){var n=e.subject;n.location=n.location.copy().snapToGridPoint(e.diagram.grid.gridOrigin,e.diagram.grid.gridCellSize),setTimeout((function(){e.diagram.commandHandler.editTextBlock()}),20)},"commandHandler.archetypeGroupData":{isGroup:!0,text:"NEW GROUP"},SelectionGrouped:function(e){e.subject;setTimeout((function(){e.diagram.commandHandler.editTextBlock()}))},LinkRelinked:function(e){e.parameter.part.invalidateConnectedLinks();var n=e.subject;e.diagram.toolManager.linkingTool.isForwards?n.toNode.invalidateConnectedLinks():n.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),i.current.nodeTemplate=e(V.Node,"Auto",{locationSpot:V.Spot.Center,locationObjectName:"SHAPE",desiredSize:new V.Size(120,60),minSize:new V.Size(40,40),resizable:!0,resizeCellSize:new V.Size(10,10),rotatable:!0},new V.Binding("location","loc",V.Point.parse).makeTwoWay(V.Point.stringify),new V.Binding("desiredSize","size",V.Size.parse).makeTwoWay(V.Size.stringify),e(V.Shape,{name:"SHAPE",fill:u,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:V.Spot.AllSides,toSpot:V.Spot.AllSides},new V.Binding("figure"),new V.Binding("fill"),new V.Binding("stroke","borderColor"),new V.Binding("strokeWidth","thickness"),new V.Binding("strokeDashArray","dash")),e(V.Shape,{width:100,height:20,strokeWidth:0,fill:"transparent"}),e(V.TextBlock,{margin:1,textAlign:"center",overflow:V.TextBlock.OverflowEllipsis,editable:!0},new V.Binding("text").makeTwoWay(),new V.Binding("stroke","color"))),i.current.nodeTemplate.toolTip=e("ToolTip",e(V.Panel,"Vertical",{maxSize:new V.Size(200,NaN)},e(V.TextBlock,{font:"bold 10pt sans-serif",textAlign:"center"},new V.Binding("text")),e(V.TextBlock,{font:"10pt sans-serif",textAlign:"center"},new V.Binding("text","details")))),i.current.nodeTemplate.selectionAdornmentTemplate=e(V.Adornment,"Spot",e(V.Placeholder,{padding:10}),x(V.Spot.Top,"TriangleUp"),x(V.Spot.Left,"TriangleLeft"),x(V.Spot.Right,"TriangleRight"),x(V.Spot.Bottom,"TriangleDown"),b({alignment:new V.Spot(.75,0)})),i.current.nodeTemplate.contextMenu=e("ContextMenu",e("ContextMenuButton",e(V.Panel,"Horizontal",A("Rectangle"),A("RoundedRectangle"),A("Ellipse"),A("Diamond"))),e("ContextMenuButton",e(V.Panel,"Horizontal",A("Parallelogram2"),A("ManualOperation"),A("Procedure"),A("Cylinder1"))),e("ContextMenuButton",e(V.Panel,"Horizontal",A("Terminator"),A("CreateRequest"),A("Document"),A("TriangleDown"))),k(),C(),Z()),i.current.groupTemplate=e(V.Group,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:V.Spot.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:function(e,n){n.addMembers(n.diagram.selection,!0)||n.diagram.currentTool.doCancel()},avoidable:!1},new V.Binding("location","loc",V.Point.parse).makeTwoWay(V.Point.stringify),e(V.Panel,"Auto",{name:"BODY"},e(V.Shape,{parameter1:10,fill:u,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:V.Spot.AllSides,toSpot:V.Spot.AllSides},new V.Binding("fill"),new V.Binding("stroke","color"),new V.Binding("strokeWidth","thickness"),new V.Binding("strokeDashArray","dash")),e(V.Placeholder,{background:"transparent",margin:20})),e(V.TextBlock,{alignment:V.Spot.Top,alignmentFocus:V.Spot.Bottom,font:"bold 12pt sans-serif",editable:!0},new V.Binding("text"),new V.Binding("stroke","color"))),i.current.groupTemplate.selectionAdornmentTemplate=e(V.Adornment,"Spot",e(V.Panel,"Auto",e(V.Shape,{fill:null,stroke:"dodgerblue",strokeWidth:3}),e(V.Placeholder,{margin:1.5})),b({alignment:V.Spot.TopRight,alignmentFocus:V.Spot.BottomRight})),i.current.groupTemplate.contextMenu=e("ContextMenu",k(),C(),Z()),i.current.linkTemplate=e(V.Link,{layerName:"Foreground",routing:V.Link.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new V.Binding("fromSpot","fromSpot",V.Spot.parse),new V.Binding("toSpot","toSpot",V.Spot.parse),new V.Binding("fromShortLength","dir",(function(e){return e>=1?10:0})),new V.Binding("toShortLength","dir",(function(e){return e>=1?10:0})),new V.Binding("points").makeTwoWay(),e(V.Shape,{strokeWidth:2},new V.Binding("stroke","color"),new V.Binding("strokeWidth","thickness"),new V.Binding("strokeDashArray","dash")),e(V.Shape,{segmentIndex:0,segmentOffset:new V.Point(15,0),segmentOrientation:V.Link.OrientAlong,alignmentFocus:V.Spot.Right,figure:"circle",width:10,strokeWidth:0},new V.Binding("fill","color"),new V.Binding("visible","dir",(function(e){return 1===e}))),e(V.Shape,{segmentIndex:-1,segmentOffset:new V.Point(-10,6),segmentOrientation:V.Link.OrientPlus90,alignmentFocus:V.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new V.Binding("fill","color"),new V.Binding("visible","dir",(function(e){return e>=1})),new V.Binding("width","thickness",(function(e){return 7+3*e})),new V.Binding("height","thickness",(function(e){return 7+3*e})),new V.Binding("segmentOffset","thickness",(function(e){return new V.Point(-15,4+1.5*e)}))),e(V.Shape,{segmentIndex:0,segmentOffset:new V.Point(15,-6),segmentOrientation:V.Link.OrientMinus90,alignmentFocus:V.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new V.Binding("fill","color"),new V.Binding("visible","dir",(function(e){return 2===e})),new V.Binding("width","thickness",(function(e){return 7+3*e})),new V.Binding("height","thickness",(function(e){return 7+3*e})),new V.Binding("segmentOffset","thickness",(function(e){return new V.Point(-15,4+1.5*e)}))),e(V.TextBlock,{alignmentFocus:new V.Spot(0,1,-4,0),editable:!0},new V.Binding("text").makeTwoWay(),new V.Binding("stroke","color"))),i.current.linkTemplate.selectionAdornmentTemplate=e(V.Adornment,e(V.Shape,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:P(2)},new V.Binding("pathPattern","thickness",P)),b({alignmentFocus:new V.Spot(0,0,-6,-4)})),i.current.linkTemplate.contextMenu=e("ContextMenu",C(),Z(),e("ContextMenuButton",e(V.Panel,"Horizontal",N(0),N(1),N(2))),e("ContextMenuButton",e(V.Panel,"Horizontal",e(V.Panel,"Spot",E(!1),B(V.Spot.Top,!1),B(V.Spot.Left,!1),B(V.Spot.Right,!1),B(V.Spot.Bottom,!1)),e(V.Panel,"Spot",{margin:new V.Margin(0,0,0,2)},E(!0),B(V.Spot.Top,!0),B(V.Spot.Left,!0),B(V.Spot.Right,!0),B(V.Spot.Bottom,!0))))),new V.Palette(o.current,{maxSelectionCount:1,linkTemplate:e(V.Link,{locationSpot:V.Spot.Center,selectionAdornmentTemplate:e(V.Adornment,"Link",{locationSpot:V.Spot.Center},e(V.Shape,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),e(V.Shape,{toArrow:"Standard",stroke:null}))},{routing:V.Link.AvoidsNodes,curve:V.Link.JumpOver,corner:5,toShortLength:4},new V.Binding("points"),e(V.Shape,{isPanelMain:!0,strokeWidth:2}),e(V.Shape,{toArrow:"Standard",stroke:null})),model:new V.GraphLinksModel([{text:"未命名",size:"100 100",fill:null,stroke:"#000"}].concat(H()(V.Shape.getFigureGenerators().toArray().map((function(e){return{text:"未命名",size:"100 100",figure:e.key,fill:"white",stroke:"#666",borderColor:"#000"}})))))}).nodeTemplate=e(V.Node,"Auto",{locationSpot:V.Spot.Center},new V.Binding("location","location",V.Point.parse).makeTwoWay(V.Point.stringify),e(V.Shape,"Circle",{fill:"white",stroke:"gray",strokeWidth:2,width:20,height:20,portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromLinkableSelfNode:!0,toLinkableSelfNode:!0},new V.Binding("stroke").makeTwoWay(),new V.Binding("fill").makeTwoWay(),new V.Binding("figure")),e(V.TextBlock,{margin:new V.Margin(5,5,3,5),font:"10pt sans-serif",minSize:new V.Size(16,16),maxSize:new V.Size(10,NaN),textAlign:"center",editable:!0},new V.Binding("key").makeTwoWay())),setTimeout((function(){i.current.grid=e(V.Panel,"Grid",e(V.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(V.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),i.current.grid.visible=!0,i.current.grid.gridCellStroke="darkgray",i.current.grid.gridCellStrokeWidth=1}),300),window.myDiagrams=i.current,i.current},divClassName:"diagram-component",style:{height:"80vh"}}),(0,m.jsx)("div",{ref:r})]})]}),(0,m.jsx)("div",{className:"tr",children:(0,m.jsx)(C.ZP,{size:"large",onClick:f,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary",children:"保存到编辑器"})})]})})})},ne=t(5112),te=t(54449),ie=ne.ZP.Group,re={margin:"0 8px"},oe=function(e){var n=e.callback,t=e.onCancel;return(0,m.jsxs)(j.Z,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(e){n(e)},children:[(0,m.jsxs)("div",{className:"flex-container",style:{alignItems:"baseline"},children:[(0,m.jsx)("span",{style:re,children:"单元格数:"}),(0,m.jsx)("span",{style:re,children:"行数"}),(0,m.jsx)(j.Z.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}],children:(0,m.jsx)(te.Z,{})}),(0,m.jsx)("span",{style:re,children:"列数"}),(0,m.jsx)(j.Z.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}],children:(0,m.jsx)(te.Z,{})})]}),(0,m.jsxs)("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"},children:[(0,m.jsx)("span",{style:re,children:"对齐方式:"}),(0,m.jsx)(j.Z.Item,{name:"align",children:(0,m.jsxs)(ie,{children:[(0,m.jsx)(ne.ZP,{value:"default",children:(0,m.jsx)("i",{className:"fa fa-align-justify"})}),(0,m.jsx)(ne.ZP,{value:"left",children:(0,m.jsx)("i",{className:"fa fa-align-left"})}),(0,m.jsx)(ne.ZP,{value:"center",children:(0,m.jsx)("i",{className:"fa fa-align-center"})}),(0,m.jsx)(ne.ZP,{value:"right",children:(0,m.jsx)("i",{className:"fa fa-align-right"})})]})})]}),(0,m.jsxs)("div",{className:"flex-container flex-end",children:[(0,m.jsx)(C.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,m.jsx)(C.ZP,{type:"ghost",onClick:t,children:"取消"})]})]})},ae=t(78673),le=t(35575),se=t.n(le),ce=(0,c.forwardRef)((function(e,n){var t=e.use3d,i=e.width,r=e.height,o=e.callback,l=(e.showSaveButton,(0,c.useRef)()),s=(0,c.useRef)(),u=(0,c.useState)(!1),d=a()(u,2),p=d[0],h=d[1],f=(0,c.useRef)({id:l,appName:"graphing",width:i||1e3,height:r||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,c.useEffect)((function(){s.current=new(se())(f.current,!0),window.onload=function(){s.current.inject("applet_container")}}),[]);var g=function(){var e=window.ggbApplet.getPNGBase64(1,!0,72);return o&&o(e),e};return(0,c.useEffect)((function(){f.current.appName=p?"3D":"graphing",s.current.inject("applet_container")}),[p]),(0,c.useEffect)((function(){h(t)}),[t]),(0,c.useImperativeHandle)(n,(function(){return{getImgData:g}})),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:l}),(0,m.jsxs)(L.Z,{align:"middle",children:[(0,m.jsx)(J.Z,{flex:1,children:(0,m.jsx)(ae.Z,{size:"default",checkedChildren:"关闭3D图像",unCheckedChildren:"开启3D图像",checked:p,onChange:function(e){return h(e)}})}),(0,m.jsx)(J.Z,{children:(0,m.jsx)(C.ZP,{size:"large",onClick:g,style:{zIndex:8,marginTop:10},type:"primary",children:"保存到编辑器"})})]})]})})),ue=t(42594),de=t(57357),pe="link",he="upload-image",me="add-flowchart",fe="draw-image",ge="code-block",ve="add-table",we="------------",xe={default:we,left:":".concat(we),center:":".concat(we,":"),right:"".concat(we,":")},be=t(40238);var ye="@▁▁@",je=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"];function ke(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var Ce=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",_e=s()(s()({},Ce+"-B","bold"),Ce+"-I","italic"),Se=s()(s()(s()(s()(s()(s()(s()(s()({},pe,"添加链接"),ge,"添加代码块"),he,"添加图片"),fe,"添加画图"),me,"插入流程图"),ve,"添加表格"),"maths-latex","数学图像"),"inline-latex","LATEX公式"),Ze=function(e){var n=e.defaultValue,t=void 0===n?"":n,i=e.onChange,o=e.width,l=void 0===o?"100%":o,u=e.height,g=void 0===u?400:u,v=e.miniToolbar,w=void 0!==v&&v,x=e.isFocus,j=void 0!==x&&x,k=e.watch,C=e.insertTemp,_=e.mode,P=void 0===_?"markdown":_,N=e.id,E=void 0===N?"markdown-editor-id":N,B=e.showResizeBar,I=void 0!==B&&B,L=e.noStorage,M=void 0!==L&&L,D=e.showNullButton,G=void 0!==D&&D,F=e.showNullProgramButton,z=void 0!==F&&F,W=e.hidetoolBar,H=void 0!==W&&W,V=e.fullScreen,K=void 0!==V&&V,U=e.onBlur,q=e.onCMBeforeChange,J=e.onFullScreen,Q=e.className,X=void 0===Q?"":Q,$=e.disablePaste,ne=void 0!==$&&$,te=e.disabled,ie=void 0!==te&&te,re=e.disabledFill,ae=void 0!==re&&re,le=e.placeholder,se=void 0===le?"":le,we=e.values,Ce=void 0===we?"":we,Ze=e.extraUse,Ae=(0,c.useState)(null),Pe=a()(Ae,2),Ne=Pe[0],Ee=Pe[1],Be=(0,c.useState)(t),Te=a()(Be,2),Ie=Te[0],Oe=Te[1],Le=(0,c.useState)(k),Me=a()(Le,2),Re=Me[0],De=Me[1],Ge=(0,c.useState)(K),Fe=a()(Ge,2),ze=Fe[0],We=Fe[1],He=(0,c.useState)(""),Ve=a()(He,2),Ke=Ve[0],Ue=Ve[1],qe=(0,c.useState)(0),Ye=a()(qe,2),Je=Ye[0],Qe=Ye[1],Xe=(0,c.useState)(g),$e=a()(Xe,2),en=$e[0],nn=$e[1],tn=(0,c.useState)(!1),rn=a()(tn,2),on=(rn[0],rn[1]),an=(0,c.useState)(0),ln=a()(an,2),sn=ln[0],cn=ln[1],un=(0,c.useState)(0),dn=a()(un,2),pn=dn[0],hn=dn[1],mn=(0,c.useRef)(),fn=(0,c.useRef)(),gn=(0,c.useRef)(),vn=(0,c.useRef)();(0,c.useEffect)((function(){var e=window.scrollY||window.pageYOffset;Oe(Ce),null==Ne||Ne.setValue(Ce),window.scrollTo(0,e)}),[Ce]),(0,c.useEffect)((function(){null==J||J(ze)}),[ze]),(0,c.useEffect)((function(){if(mn.current){var e=function(e,t){if(!ne){var i=t.clipboardData;if(i){var r=i.types.toString(),o=i.items;if("Files"===r||i.types.indexOf("Files")>-1){if(t.preventDefault(),"stex"==P)return;try{var a,l=o[1];"file"===(null===(a=o[0])||void 0===a?void 0:a.kind)&&(l=o[0]);var s=l.getAsFile(),c=s.name.split(".").pop();O(s,(function(e){var t,i,r;e.id?(null==s||null===(t=s.type)||void 0===t?void 0:t.indexOf("image"))>-1?n.replaceSelection("![,](/api/attachments/".concat(e.id,"?type=").concat(e.content_type,")")):(null==s||null===(i=s.type)||void 0===i?void 0:i.indexOf("video"))>-1?n.replaceSelection('')):(null==s||null===(r=s.type)||void 0===r?void 0:r.indexOf("pdf"))>-1?n.replaceSelection('').concat(s.name,"")):je.includes(c)?n.replaceSelection('').concat(s.name,"")):n.replaceSelection("[".concat(s.name,"](").concat(de.Z.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}))}catch(t){A.ZP.warning("请使用chrome浏览器粘贴")}return!0}return!0}return!0}t.preventDefault()},n=d().fromTextArea(mn.current,{mode:P,lineNumbers:!w,lineWrapping:!0,value:t,autoCloseTags:!0,autoCloseBrackets:!0});return n.on("keyup",(function(e,t){8===t.keyCode&&(""==e.getValue()?n.setOption("placeholder",se):n.setOption("placeholder",null))})),n.on("keydown",(function(e,n){if(8===n.keyCode){var t=function(e,n){var t=e.getDoc(),i=t.getCursor(),r=t.getLine(i.line),o=r.charAt(i.ch-1),a=r.lastIndexOf("@▁@",i.ch),l=r.lastIndexOf("@▁▁@",i.ch),s=a>l?a:l,c=a>l?3:4;if(-1===ye.indexOf(o))return null;if(console.log("change1:",n,e,r,i,s,a,l,o),s>=0&&i.ch-s<5){var u=s+c;return t.replaceRange("",{line:i.line,ch:s},{line:i.line,ch:u}),{line:i.line,ch:u}}return null}(e);t&&n.preventDefault()}})),j&&n.focus(),n.on("paste",e),ie&&n.on("beforeChange",(function(e,n){"paste"!==n.origin&&"+input"!==n.origin||n.cancel()})),Ee(n),function(){n.off("paste",e)}}}),[]);var wn=(0,c.useCallback)((function(){fn.current}),[en,fn,ze]);(0,c.useEffect)((function(){if(Ne){var e=function(){var e=new p.Z((function(e){var n,t=r()(e);try{for(t.s();!(n=t.n()).done;){var i=n.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&(wn(),Ne.setSize("100%","100%"),Ne.refresh())}}catch(e){t.e(e)}finally{t.f()}}));return e.observe(mn.current.parentElement),e}();return function(){var n,t;null!==(n=mn.current)&&void 0!==n&&n.parentElement&&e.unobserve(null===(t=mn.current)||void 0===t?void 0:t.parentElement)}}}),[Ne,wn]),(0,c.useEffect)((function(){if(Ne){for(var e=[],n=function(){var n=a()(i[t],2),r=n[0],o=n[1],l=s()({},r,(function(){xn(o)}));e.push(l),Ne.addKeyMap(l)},t=0,i=Object.entries(_e);t0){var e=(new Date).getTime(),n=window.sessionStorage.getItem(E);e>=Je+1e4&&(!n||n!==Ie)&&(window.sessionStorage.setItem(E,Ie),on(!0))}}),1e4),(0,c.useEffect)((function(){De(k)}),[Ne,k]),(0,c.useEffect)((function(){Ne&&j&&Ne.focus()}),[Ne,j]),(0,c.useEffect)((function(){if(Re&&Ne){var e=function(e){var n=e.target;if(vn.current){var t=n.scrollTop/n.scrollHeight;vn.current.scrollTop=vn.current.scrollHeight*t}},n=Ne.getScrollerElement();return n.addEventListener("scroll",e),function(){n.removeEventListener("scroll",e)}}}),[Ne,Re]),(0,c.useEffect)((function(){if(Ne&&q){var e=function(e,n){q(e,n)};return Ne.on("beforeChange",e),function(){Ne.off("beforeChange",e)}}}),[Ne,q]),(0,c.useEffect)((function(){if(Ne&&U){var e=function(){U(Ne.getValue())};return Ne.on("blur",e),function(){Ne.off("blur",e)}}}),[Ne,U]),(0,c.useEffect)((function(){if(Ne){var e=function(e,n){var t=e.getValue();Oe(t),Qe((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),i&&(z?i(t,Cn(t)):i(t))};return Ne.on("change",e),function(){Ne.off("change",e)}}}),[Ne,i]),(0,c.useEffect)((function(){if(Ne)if(null==t)Ne.setValue(""),Oe("");else{var e=window.scrollY||window.pageYOffset;t!==Ne.getValue()&&(Ne.setValue(t),Oe(t),Ne.setCursor(ie?1:Ne.lineCount(),0),window.scrollTo(0,e))}}),[Ne,t]);var xn=(0,c.useCallback)((function(e){var n=Ne.getCursor(),t=Ne.getSelection(),i=t.split("\n");switch(e){case"bold":return Ne.replaceSelection("**"+t+"**"),""===t&&Ne.setCursor(n.line,n.ch+2),Ne.focus();case"italic":return Ne.replaceSelection("*"+t+"*"),""===t&&Ne.setCursor(n.line,n.ch+1),Ne.focus();case"code":return Ne.replaceSelection("`"+t+"`"),""===t&&Ne.setCursor(n.line,n.ch+1),Ne.focus();case"inline-latex":return Ue("inline-latex"),Ne.focus();case"latex":return Ne.replaceSelection("```latex\n"+t+"\n```"),Ne.setCursor(n.line+1,t.length+1),Ne.focus();case"line-break":return Ne.replaceSelection("
\n"),Ne.focus();case"list-ul":return""===t?Ne.replaceSelection("- "+t):Ne.replaceSelection(i.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),Ne.focus();case"list-ol":return""===t?Ne.replaceSelection("1. "+t):Ne.replaceSelection(i.map((function(e,n){return""===e?"":"".concat(n+1,". ").concat(e)})).join("\n")),Ne.focus();case"add-null-ch":return""===t&&Ne.setCursor(n.line,n.ch),Ne.replaceSelection("▁"),Ne.focus();case"add-signal":return""===t&&Ne.setCursor(n.line,n.ch),Ne.replaceSelection("@▁@"),Ne.focus();case"add-multiple":return""===t&&Ne.setCursor(n.line,n.ch),Ne.replaceSelection(ye),Ne.focus();case"inster-template-1":return""===t&&Ne.setCursor(n.line,n.ch),Ne.replaceSelection("\n**模板标题**\n模板正文内容,可输入文本内容和粘贴图片等操作"),Ne.focus();case"eraser":return Ne.setValue(""),Ne.focus();case"trigger-watch":return De(!Re),Ne.focus();case"trigger-full-screen":return We(!ze),Ne.focus();case pe:return void Ue(pe);case ge:return void Ue(ge);case he:return void Ue(he);case fe:return void Ue(fe);case"maths-latex":return void Ue("maths-latex");case me:return void Ue(me);case ve:return void Ue(ve);default:throw new Error}}),[Ne,Re,ze]),bn=(0,c.useCallback)((function(e,n){var t,i,r,o,a;switch(Ue(""),Ke){case pe:var l=e.title,s=e.link;return Ne.replaceSelection("[".concat(l,"](").concat(s,")")),Ne.focus();case ge:var c=e.language,u=e.content;return Ne.replaceSelection(["```"+c,u,"```"].join("\n")),Ne.focus();case"maths-latex":for(var d=atob(e),p=new Uint8Array(d.length),h=0;h-1||null==g||!g.type?f?Ne.replaceSelection("![ ".concat(f," ]( ").concat(m,' "').concat(f,'" )')):Ne.replaceSelection("![,](".concat(m,")")):(null==g||null===(o=g.type)||void 0===o?void 0:o.indexOf("video"))>-1?Ne.replaceSelection('')):(null==g||null===(a=g.type)||void 0===a?void 0:a.indexOf("pdf"))>-1?Ne.replaceSelection('').concat(g.name,"")):je.includes(v)?Ne.replaceSelection('').concat(g.name,"")):Ne.replaceSelection("[".concat(g.name,"](").concat(de.Z.API_SERVER).concat(m,")")),Ne.focus();case ve:for(var w=e.row,x=e.col,b=e.align,y="\n",j=0;j300&&(n=300),nn(g+n+"px")}},i=gn.current,r=!1,o=0;return i.addEventListener("mousedown",e),document.addEventListener("mousemove",t),document.addEventListener("mouseup",n),function(){i.removeEventListener("mousedown",e),document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",n)}}}),[Ne,gn]),(0,c.useEffect)((function(){nn(g)}),[g]);var kn={width:ke(l),height:ke(en)},Cn=((0,c.useMemo)((function(){if(Je){var e=new Date(Je),n=e.getHours(),t=e.getMinutes(),i=e.getSeconds();return t=t<10?"0"+t:t,i=i<10?"0"+i:i,"".concat(n=n<10?"0"+n:n,":").concat(t,":").concat(i)}return 0}),[Je]),function(e){var n=[];if(z){e=e.replace(/(@▁▁@|@▁@)/g,(function(e,t,i){n.push({multiLine:!("@▁@"===e)})}))}return n});(0,c.useEffect)((function(){if(Se[Ke]&&Ke!==fe&&Ke!==me){var e=document.getElementsByClassName("ant-modal")[0],n=window.innerWidth/2-e.offsetWidth/2,t=window.innerHeight/2-e.offsetHeight/2;cn(n),hn(t)}}),[Ke]);var _n=function(e,n,t,i){var r=document.body.clientHeight,o=document.body.clientWidth;return!(e<20&&t>e||e>o-20&&tn||n>r-20&&i0&&(o.children=[],d(r,o.children))}))}function p(e,n){for(var t=[],i=0;i0){t[0]=o.id;for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:null;switch(ce.resetFields(),ce.setFieldsValue({item_type:e,item_banks_group_id:n}),He(e),e){case"SELECT":ce.setFieldsValue({choices:Array.from({length:4},(function(){return{choice_text:"",is_answer:0}}))});break;case"JUDGMENT":ce.setFieldsValue({choices:[{choice_text:"正确",is_answer:0},{choice_text:"错误",is_answer:0}]});break;case"COMPLETION":ce.setFieldsValue({standard_answers:[],downcase:!0,no_space:!0});break;case"SUBJECTIVE":ce.setFieldsValue({answer_texts:[],use_keywords:!0});break;case"COMBINATION":case"PROGRAM":break;case"BPROGRAM":ce.setFieldsValue({hack:{time_limit:3,allow_student_debug:!1,submit_rule:1}})}},Ye=function(e,n){var t;if(null!=e&&e.item_type&&("PROGRAM"===(null==e?void 0:e.item_type)&&(0,J.xg)("/problems/newcreate"),qe(null==e?void 0:e.item_type,null==n?void 0:n.item_banks_group_id)),null!=e&&e.course){var i=u()(e.course,2),r=(i[0],i[1]);tn(r),ce.setFieldsValue({knowledge:[]})}if(null!=e&&null!==(t=e.hack)&&void 0!==t&&t.sub_discipline_id){var o=u()(e.hack.sub_discipline_id,2),a=(o[0],o[1]);tn(a),ce.setFieldsValue({hack:{tag_discipline_ids:[]}})}},Je=(0,h.useState)(""),Qe=u()(Je,2),Xe=Qe[0],$e=Qe[1];(0,h.useEffect)((function(){$e(new Date)}),[ce.getFieldValue("course")]);var en=function(){var e=a()(r()().mark((function e(){var n,t,i,o,a,l,s,d,h,f,w,x,b,y,j,k,C,_,S,Z,A,P,N,E,B,T;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("COMPLETION"==(null==(n=ce.getFieldsValue())?void 0:n.item_type)&&null==n.is_ordered&&(n.is_ordered=!0),i=(t=n||{}).course,o=void 0===i?[]:i,a=t.item_type,l=t.item_banks_group_id,s=t.knowledge,d=void 0===s?[]:s,h=t.choices,f=u()(o,2),w=f[0],x=f[1],1!==be){e.next=41;break}if("PROGRAM"!==a){e.next=8;break}return(0,J.xg)("/problems/newcreate"),e.abrupt("return");case 8:if("BPROGRAM"!==a){e.next=24;break}if(j=[],(null==n||null===(b=n.hack)||void 0===b||null===(b=b.tag_discipline_ids)||void 0===b?void 0:b.length)>0?null==n||null===(k=n.hack)||void 0===k||null===(k=k.tag_discipline_ids)||void 0===k||k.map((function(e){null!=e&&e.value?j.push(null==e?void 0:e.value):j.push(e)})):j=[],C=p()(p()({},n),{},{hack:p()(p()({},null==n?void 0:n.hack),{},{sub_discipline_id:null==n||null===(y=n.hack)||void 0===y||null===(y=y.sub_discipline_id)||void 0===y?void 0:y[1],difficult:n.difficulty,item_banks_group_ids:n.item_banks_group_id,tag_discipline_ids:j}),hack_codes:p()(p()({},n.hack_codes),{},{code:te.Base64.encode(n.hack_codes.code)}),hack_sets:[p()({},n.hack_sets)],update_hack_sets:[p()({},n.hack_sets)],is_blank:!0}),!Ke&&!sessionStorage.projectFill){e.next=19;break}return e.next=15,(0,$.ZP)("/api/problems/".concat(ve.current||sessionStorage.projectFill,".json"),{method:"put",body:p()({},C)});case 15:0===e.sent.status&&m.history.replace("/problemset?group_id=".concat(n.hack.item_banks_group_id)),e.next=23;break;case 19:return e.next=21,(0,$.ZP)("/api/problems.json",{method:"post",body:p()({},C)});case 21:0===e.sent.status&&g.Z.confirm({title:"提示",centered:!0,icon:null,content:"试题新增成功",okText:"继续新增",cancelText:"返回列表",onOk:function(){qe(We,l)},onCancel:function(){m.history.replace("/problemset?group_id=".concat(l))}});case 23:return e.abrupt("return");case 24:if("SELECT"===a&&(a=h.filter((function(e){return 1===e.is_answer})).length>1?"MULTIPLE":"SINGLE"),"COMBINATION"===a&&(_=(n||{}).sub_item_banks,n.sub_item_banks=null==_?void 0:_.map((function(e){return p()({},e)}))),S=[],(null==d?void 0:d.length)>0&&(null!=d&&null!==(Z=d[0])&&void 0!==Z&&Z.value?null==d||d.map((function(e){S.push(null==e?void 0:e.value)})):S=d),A=p()(p()({},n),{},{discipline_id:w,sub_discipline_id:x,item_banks_group_ids:l,tag_discipline_ids:S,knowledge:S,item_type:a}),!Ke){e.next=35;break}return e.next=32,c({type:"problemset/editProblemset",payload:p()(p()({},A),{},{id:ve.current})});case 32:P=e.sent,e.next=38;break;case 35:return e.next=37,c({type:"problemset/addProblemset",payload:A});case 37:P=e.sent;case 38:0===P.status&&(Ke?m.history.replace("/problemset?group_id=".concat(l)):g.Z.confirm({title:"提示",centered:!0,icon:null,content:"试题新增成功",okText:"继续新增",cancelText:"返回列表",onOk:function(){qe(We,l)},onCancel:function(){m.history.replace("/problemset?group_id=".concat(l))}})),e.next=61;break;case 41:if(!((null==Ce?void 0:Ce.length)<=0)){e.next=44;break}return v.ZP.info("请上传试题文件"),e.abrupt("return");case 44:return Te(!0),(N=new FormData).append("file",Ce[0]),N.append("sub_discipline_id",x),e.next=50,(0,$.ZP)("/api/item_banks/file_import.json",{method:"post",body:N},!0);case 50:if(E=e.sent,Te(!1),0!==(null==E?void 0:E.status)){e.next=61;break}if(!((null==E||null===(B=E.fail)||void 0===B?void 0:B.length)>0)){e.next=57;break}return Pe(null==E?void 0:E.fail),v.ZP.error("上传失败题数为"+(null==E||null===(T=E.fail)||void 0===T?void 0:T.length)+",可在底部试题列表查看错误原因。"),e.abrupt("return");case 57:ce.setFieldsValue({course:[]}),_e([]),Pe([]),v.ZP.info("上传成功");case 61:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),nn=function(){var e=a()(r()().mark((function e(n){var t,i;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.errorFields[0].name.includes("standard_answers")?"请先在题干中插入填空项"===(null==n||null===(i=n.errorFields)||void 0===i||null===(i=i[0])||void 0===i||null===(i=i.errors)||void 0===i?void 0:i[0])?((0,J.pE)(),v.ZP.error("请先在题干中插入填空项")):v.ZP.error("填空项答案不能为空"):v.ZP.error(n.errorFields[0].errors[0]),ce.scrollToField(null==n||null===(t=n.errorFields)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.name,{behavior:"smooth",block:"center"});case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),tn=function(){var e=a()(r()().mark((function e(n){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c({type:"exercise/getTagDiscipline",payload:{sub_discipline_id:n}});case 2:return t=e.sent,ge(t.tag_disciplines),e.abrupt("return",null==t?void 0:t.tag_disciplines);case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,ie.jsx)("div",{className:S,children:(0,ie.jsxs)("section",{className:Z,children:[(0,ie.jsxs)(w.Z,{className:"mb20",separator:">",children:[(0,ie.jsx)(w.Z.Item,{href:"/problemset",children:"试题库"}),(0,ie.jsxs)(w.Z.Item,{children:[Ke?"编辑":"新增","试题"]})]}),(0,ie.jsxs)("div",{className:A,children:[!Ke&&(0,ie.jsx)(x.ZP.Group,{className:P,optionType:"button",options:[{label:"单个添加",value:1},{label:"批量导入",value:2}],onChange:function(e){ye(e.target.value),ce.setFieldsValue({course:[]}),_e([]),Pe([])},value:be}),1===be&&De&&(0,ie.jsxs)(f.Z,{form:ce,className:N,layout:"horizontal",colon:!1,onValuesChange:Ye,onFinish:en,onFinishFailed:nn,initialValues:De,children:[(0,ie.jsx)(f.Z.Item,{label:"试题类型",name:"item_type",rules:[{required:!0,message:"请选择题型"}],children:(0,ie.jsx)(x.ZP.Group,{disabled:Ke,optionType:"button",className:E,options:[{label:"选择题",value:"SELECT"},{label:"判断题",value:"JUDGMENT"},{label:"填空题",value:"COMPLETION"},{label:"简答题",value:"SUBJECTIVE"},{label:"编程题",value:"PROGRAM"},{label:"组合题",value:"COMBINATION"},{label:"程序填空题",value:"BPROGRAM"}]})}),(0,ie.jsx)("div",{className:U,children:(0,ie.jsx)(ae,{editId:ve.current,currentItemType:We,form:ce})}),"PROGRAM"!==We&&(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(f.Z.Item,{label:"知识点",labelCol:{flex:"62px"},className:"".concat(M," mb30"),style:{marginTop:"PROGRAM"===We?0:30},name:"BPROGRAM"===We?["hack","sub_discipline_id"]:"course",children:(0,ie.jsx)(b.Z,{className:R,popupClassName:q,dropdownMenuColumnStyle:{padding:"8px 12px",fontSize:14},showArrow:!0,placeholder:"请选择方向&课程",allowClear:!0,options:o.courseOptions,style:{width:490},onChange:function(e){e||ce.setFieldsValue({knowledge:[]})}})}),(0,ie.jsxs)("div",{style:{display:Le?"block":"none"},children:[(0,ie.jsx)(f.Z.Item,{style:{paddingLeft:62},label:"",name:"BPROGRAM"===We?["hack","tag_discipline_ids"]:"knowledge",labelCol:{flex:"62px"},labelAlign:"left",className:"".concat(D," mb30"),children:(0,ie.jsx)(Q.N,{selectvalues:Ve,subId:(null===(t=ce.getFieldsValue().course)||void 0===t?void 0:t[1])||(null===(i=ce.getFieldsValue())||void 0===i||null===(i=i.hack)||void 0===i||null===(i=i.sub_discipline_id)||void 0===i?void 0:i[1]),knowledgeOptions:fe,onAddKnowledgeFinish:function(e){ge([].concat(s()(fe),[p()({},e)]))}},Xe)}),(0,ie.jsx)(f.Z.Item,{labelCol:{flex:"62px"},labelAlign:"left",name:"difficulty",label:"难度",className:"".concat(B," mb30"),rules:[{required:!0,message:"请选择难度"}],children:(0,ie.jsxs)(x.ZP.Group,{optionType:"button",className:T,children:[(0,ie.jsx)(x.ZP.Button,{value:1,className:I,children:"简单"}),(0,ie.jsx)(x.ZP.Button,{value:2,className:O,children:"适中"}),(0,ie.jsx)(x.ZP.Button,{value:3,className:L,children:"困难"})]})}),(0,ie.jsx)(f.Z.Item,{label:"放入文件夹目录",rules:[{required:!0,message:"请选择文件夹"}],name:"item_banks_group_id",labelCol:{span:24},wrapperCol:{span:24},children:(0,ie.jsx)(ee.Z,{scrollId:"item_banks_group_id"})})]})]})]}),2===be&&(0,ie.jsxs)("div",{children:[(0,ie.jsxs)(f.Z,{form:ce,className:N,layout:"vertical",onValuesChange:Ye,onFinish:en,children:[(0,ie.jsx)(f.Z.Item,{className:M,label:"方向&课程:",name:"course",rules:[{required:!0,message:"请选择方向&课程"}],children:(0,ie.jsx)(b.Z,{className:R,popupClassName:q,dropdownMenuColumnStyle:{padding:"8px 12px",fontSize:14},placeholder:"请选择方向&课程",showArrow:!0,allowClear:!1,options:o.courseOptions,style:{width:490}})}),(0,ie.jsxs)("div",{className:"mb30",children:[(0,ie.jsxs)("span",{className:G,children:["根据模板要求编辑需要上传的试题",(0,ie.jsx)(y.Z,{title:(0,ie.jsxs)("div",{children:[(0,ie.jsx)("div",{children:"提示:"}),(0,ie.jsx)("div",{children:"1、目前仅支持Excel格式模板;"}),(0,ie.jsx)("div",{children:"2、不支持组合题和实训题导入;"}),(0,ie.jsx)("div",{children:"3、每次最多导入300题;"}),(0,ie.jsx)("div",{children:"4、填空题导入最多支持8个填空项。"})]}),children:(0,ie.jsx)(X.Z,{className:F})})]}),(0,ie.jsxs)("a",{className:"".concat(z," ml30"),href:_.Z.API_SERVER+"/api/item_banks/down_template",download:!0,children:["下载试题模版",(0,ie.jsx)("i",{className:"iconfont icon-xiazai4 ml10",style:{fontSize:14}})]})]}),(0,ie.jsx)(j.Z,{onRemove:function(){_e([])},beforeUpload:function(e){if(console.log(e),(null==e?void 0:e.size)>52428800)return v.ZP.info("文件超过50M,不符合上传要求"),!1;var n=[];return n.push(e),_e([].concat(n)),!1},fileList:Ce,accept:".xls,.xlsx",showUploadList:{removeIcon:(0,ie.jsx)("i",{className:"iconfont icon-shanchu12",style:{color:"#F65160"}})},children:(0,ie.jsxs)("div",{className:W,children:[(0,ie.jsx)("i",{className:"iconfont icon-shangchuan3",style:{fontSize:14}}),"点击上传"]})})]}),(0,ie.jsx)("br",{}),(null==Ae?void 0:Ae.length)>0&&(0,ie.jsx)("span",{style:{fontSize:"18px",display:"flex",width:"100%",justifyContent:"center"},children:"错误列表"}),(null==Ae?void 0:Ae.length)>0&&(0,ie.jsx)(k.Z,{style:{marginTop:"10px"},dataSource:Ae,columns:[{title:"题目名称",dataIndex:"name",key:"name"},{title:"错误原因",dataIndex:"message",key:"message"}]})]})]}),(0,ie.jsx)("div",{className:H,children:(0,ie.jsxs)("div",{className:V,children:[(0,ie.jsx)(C.ZP,{size:"middle",className:"".concat(K," mr20"),onClick:function(){return m.history.push("/problemset")},children:"取消"}),(0,ie.jsx)(C.ZP,{size:"middle",type:"primary",className:"".concat(K," mr20"),onClick:function(){return ce.submit()},loading:l["problemset/editProblemset"]||l["problemset/addProblemset"]||Be,children:"PROGRAM"===We&&1===be?"立即创建":"保存题目"})]})})]})})}))},26194:function(e,n){"use strict";n.Z={wrap:"wrap___ilWvf",deleteIcon:"deleteIcon___JBDG8",keywordTag:"keywordTag___iieCb",questionTitleEditorWrap:"questionTitleEditorWrap___MHB5s",choiceListWrap:"choiceListWrap___jB8b1",choiceWrap:"choiceWrap___QFkTc",choiceIndex:"choiceIndex___Mr2YO",judgementIndex:"judgementIndex___fUVWK",setAnswerBtn:"setAnswerBtn___Whox5",activeAnswer:"activeAnswer___fGU6Y",activeJudgementAnswer:"activeJudgementAnswer___wJv8P",actionWrapper:"actionWrapper___ERQ7k",addIcon:"addIcon___L9TE0",inputBorder:"inputBorder___Q5tRE",placeholder:"placeholder___p9sFY",blankInputNumberWrapper:"blankInputNumberWrapper___uEHb0",addBtn:"addBtn___WR5ZI",blankIndex:"blankIndex___x9Pny",baseInputWrapper:"baseInputWrapper___eVsG7",collapseWrapper:"collapseWrapper___ZTysU",panelHeader:"panelHeader___QSN9g",open:"open___B6FU9",close:"close___QX19r",hide:"hide___mn25n"}},66104:function(e,n,t){"use strict";t.d(n,{Z:function(){return N}});var i=t(92310),r=t.n(i),o=t(55401),a=t(87147),l=t(59301),s=t(92343),c=t(36355),u=t(43501),d=t(91857);const p=e=>{let{children:n}=e;const{getPrefixCls:t}=l.useContext(c.E_),i=t("breadcrumb");return l.createElement("li",{className:`${i}-separator`,"aria-hidden":"true"},""===n?n:n||"/")};p.__ANT_BREADCRUMB_SEPARATOR=!0;var h=p,m=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r{if(n)return n(t,i,r,o);const l=function(e,n){if(void 0===e.title||null===e.title)return null;const t=Object.keys(n).join("|");return"object"==typeof e.title?e.title:String(e.title).replace(new RegExp(`:(${t})`,"g"),((e,t)=>n[t]||e))}(t,i);return f(e,t,l,a)}}var v=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r{const{prefixCls:n,separator:t="/",children:i,menu:r,overlay:o,dropdownProps:a,href:s}=e;const c=(e=>{if(r||o){const t=Object.assign({},a);if(r){const e=r||{},{items:n}=e,i=v(e,["items"]);t.menu=Object.assign(Object.assign({},i),{items:null==n?void 0:n.map(((e,n)=>{var{key:t,title:i,label:r,path:o}=e,a=v(e,["key","title","label","path"]);let c=null!=r?r:i;return o&&(c=l.createElement("a",{href:`${s}${o}`},c)),Object.assign(Object.assign({},a),{key:null!=t?t:n,label:c})}))})}else o&&(t.overlay=o);return l.createElement(d.Z,Object.assign({placement:"bottom"},t),l.createElement("span",{className:`${n}-overlay-link`},e,l.createElement(u.Z,null)))}return e})(i);return null!=c?l.createElement(l.Fragment,null,l.createElement("li",null,c),t&&l.createElement(h,null,t)):null},x=e=>{const{prefixCls:n,children:t,href:i}=e,r=v(e,["prefixCls","children","href"]),{getPrefixCls:o}=l.useContext(c.E_),a=o("breadcrumb",n);return l.createElement(w,Object.assign({},r,{prefixCls:a}),f(a,r,t,i))};x.__ANT_BREADCRUMB_ITEM=!0;var b=x,y=t(17313),j=t(83116),k=t(37613);const C=e=>{const{componentCls:n,iconCls:t}=e;return{[n]:Object.assign(Object.assign({},(0,y.Wf)(e)),{color:e.itemColor,fontSize:e.fontSize,[t]:{fontSize:e.iconFontSize},ol:{display:"flex",flexWrap:"wrap",margin:0,padding:0,listStyle:"none"},a:Object.assign({color:e.linkColor,transition:`color ${e.motionDurationMid}`,padding:`0 ${e.paddingXXS}px`,borderRadius:e.borderRadiusSM,height:e.lineHeight*e.fontSize,display:"inline-block",marginInline:-e.marginXXS,"&:hover":{color:e.linkHoverColor,backgroundColor:e.colorBgTextHover}},(0,y.Qy)(e)),"li:last-child":{color:e.lastItemColor},[`${n}-separator`]:{marginInline:e.separatorMargin,color:e.separatorColor},[`${n}-link`]:{[`\n > ${t} + span,\n > ${t} + a\n `]:{marginInlineStart:e.marginXXS}},[`${n}-overlay-link`]:{borderRadius:e.borderRadiusSM,height:e.lineHeight*e.fontSize,display:"inline-block",padding:`0 ${e.paddingXXS}px`,marginInline:-e.marginXXS,[`> ${t}`]:{marginInlineStart:e.marginXXS,fontSize:e.fontSizeIcon},"&:hover":{color:e.linkHoverColor,backgroundColor:e.colorBgTextHover,a:{color:e.linkHoverColor}},a:{"&:hover":{backgroundColor:"transparent"}}},[`&${e.componentCls}-rtl`]:{direction:"rtl"}})}};var _=(0,j.Z)("Breadcrumb",(e=>{const n=(0,k.TS)(e,{});return[C(n)]}),(e=>({itemColor:e.colorTextDescription,lastItemColor:e.colorText,iconFontSize:e.fontSize,linkColor:e.colorTextDescription,linkHoverColor:e.colorText,separatorColor:e.colorTextDescription,separatorMargin:e.marginXS}))),S=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r{var{breadcrumbName:n}=e,t=S(e,["breadcrumbName"]);return Object.assign(Object.assign({},t),{title:n})}))}),r}var A=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r{const{prefixCls:n,separator:t="/",style:i,className:u,rootClassName:d,routes:p,items:m,children:f,itemRender:v,params:x={}}=e,b=A(e,["prefixCls","separator","style","className","rootClassName","routes","items","children","itemRender","params"]),{getPrefixCls:y,direction:j,breadcrumb:k}=l.useContext(c.E_);let C;const S=y("breadcrumb",n),[P,N]=_(S),E=function(e,n){return(0,l.useMemo)((()=>e||(n?n.map(Z):null)),[e,n])}(m,p);const B=g(S,v);if(E&&E.length>0){const e=[],n=m||p;C=E.map(((i,r)=>{const{path:o,key:s,type:c,menu:u,overlay:d,onClick:p,className:m,separator:f,dropdownProps:g}=i,v=((e,n)=>{if(void 0===n)return n;let t=(n||"").replace(/^\//,"");return Object.keys(e).forEach((n=>{t=t.replace(`:${n}`,e[n])})),t})(x,o);void 0!==v&&e.push(v);const b=null!=s?s:r;if("separator"===c)return l.createElement(h,{key:b},f);const y={},j=r===E.length-1;u?y.menu=u:d&&(y.overlay=d);let{href:k}=i;return e.length&&void 0!==v&&(k=`#/${e.join("/")}`),l.createElement(w,Object.assign({key:b},y,(0,a.Z)(i,{data:!0,aria:!0}),{className:m,dropdownProps:g,href:k,separator:j?"":t,onClick:p,prefixCls:S}),B(i,x,n,e,k))}))}else if(f){const e=(0,o.Z)(f).length;C=(0,o.Z)(f).map(((n,i)=>{if(!n)return n;const r=i===e-1;return(0,s.Tm)(n,{separator:r?"":t,key:i})}))}const T=r()(S,null==k?void 0:k.className,{[`${S}-rtl`]:"rtl"===j},u,d,N),I=Object.assign(Object.assign({},null==k?void 0:k.style),i);return P(l.createElement("nav",Object.assign({className:T,style:I},b),l.createElement("ol",null,C)))};P.Item=b,P.Separator=h;var N=P},25769:function(e,n,t){"use strict";var i=t(98040),r={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,n){var t,o,a,l,s,c,u=!1;n||(n={}),t=n.debug||!1;try{if(a=i(),l=document.createRange(),s=document.getSelection(),(c=document.createElement("span")).textContent=e,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",(function(i){if(i.stopPropagation(),n.format)if(i.preventDefault(),void 0===i.clipboardData){t&&console.warn("unable to use e.clipboardData"),t&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=r[n.format]||r.default;window.clipboardData.setData(o,e)}else i.clipboardData.clearData(),i.clipboardData.setData(n.format,e);n.onCopy&&(i.preventDefault(),n.onCopy(i.clipboardData))})),document.body.appendChild(c),l.selectNodeContents(c),s.addRange(l),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");u=!0}catch(i){t&&console.error("unable to copy using execCommand: ",i),t&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(n.format||"text",e),n.onCopy&&n.onCopy(window.clipboardData),u=!0}catch(i){t&&console.error("unable to copy using clipboardData: ",i),t&&console.error("falling back to prompt"),o=function(e){var n=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,n)}("message"in n?n.message:"Copy to clipboard: #{key}, Enter"),window.prompt(o,e)}}finally{s&&("function"==typeof s.removeRange?s.removeRange(l):s.removeAllRanges()),c&&document.body.removeChild(c),a()}return u}},83145:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.CopyToClipboard=void 0;var i=o(t(59301)),r=o(t(25769));function o(e){return e&&e.__esModule?e:{default:e}}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function l(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function s(e,n){if(null==e)return{};var t,i,r=function(e,n){if(null==e)return{};var t,i,r={},o=Object.keys(e);for(i=0;i=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}function c(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function u(e,n){for(var t=0;t