cloudlab-ui 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { b as e, A as i, C as t, a as n, M as a, R as u, B as Q, Q as p, z as l, x as r, y as m, w as C, v as c, s as d, p as f, i as w, q as A, k as M, n as R, h as J, j as y, r as k, l as B, o as x, u as T, c as b, g, f as h, d as j, e as q } from "./index-D_ea62nT.js";
1
+ import { b as e, A as i, C as t, a as n, M as a, R as u, B as Q, Q as p, z as l, x as r, y as m, w as C, v as c, s as d, p as f, i as w, q as A, k as M, n as R, h as J, j as y, r as k, l as B, o as x, u as T, c as b, g, f as h, d as j, e as q } from "./index-BJnwspyu.js";
2
2
  export {
3
3
  e as CodeBlock,
4
4
  i as QuestionAnswer,
@@ -272,7 +272,7 @@ html body {
272
272
  `));let l="";o&&(l+=o),a&&(l+=a);const c=l.trim()?l:"";return`\`\`\`question ${r}
273
273
  ${c}
274
274
  \`\`\``},xoe=i=>{const e=(i.option||[]).map(t=>({title:String(t.value??""),value:String(t.key??"")}));return{type:"radio",text:String(i.topic??""),options:e,answer:typeof i.answer=="string"?i.answer:String(i.answer??""),score:typeof i.score=="number"?i.score:void 0,analysis:i.description?String(i.description):void 0,validated:i.validated,validateMessage:i.message?String(i.message):void 0}},koe=i=>{const e=(i.option||[]).map(n=>({title:String(n.value??""),value:String(n.key??"")}));let t=[];if(Array.isArray(i.answer))t=i.answer.map(n=>String(n));else if(typeof i.answer=="string"){const n=i.answer.trim();if(n.startsWith("["))try{const s=JSON.parse(n);Array.isArray(s)&&(t=s.map(r=>String(r)))}catch{t=n.split(",").map(s=>s.trim()).filter(Boolean)}else t=n.split(",").map(s=>s.trim()).filter(Boolean)}return{type:"checkbox",text:String(i.topic??""),options:e,answer:t,score:typeof i.score=="number"?i.score:void 0,analysis:i.description?String(i.description):void 0,validated:i.validated,validateMessage:i.message?String(i.message):void 0}},Eoe=i=>{const e=String(i.topic??""),t=i.answer.map((n,s)=>({id:`blank_${s+1}`,answer:n.answer}));return{type:"completion",text:e,inputList:t,answerList:t.map(n=>n.answer),score:typeof i.score=="number"?i.score:void 0,validated:i.validated,validateMessage:i.message?String(i.message):void 0}},Loe=i=>({type:"answer",text:String(i.topic??""),answer:typeof i.answer=="string"?i.answer:String(i.answer??""),score:typeof i.score=="number"?i.score:void 0,analysis:i.description?String(i.description):void 0,validated:i.validated,validateMessage:i.message?String(i.message):void 0}),Ioe=i=>{const e=i.language?String(i.language):"",t=i.initCode?String(i.initCode):"";let n=[];i.exampleList&&Array.isArray(i.exampleList)&&(n=i.exampleList.map(r=>{if(r&&typeof r=="object"){const o=r.input,a=String(r.output??"");let l=[];if(typeof o=="string")try{const c=JSON.parse(o);l=Array.isArray(c)?c.map(String):[String(c)]}catch{l=[o]}else Array.isArray(o)?l=o.map(String):l=[String(o??"")];return{input:l,output:a}}return{input:[],output:""}}).filter(r=>r.input.length>0||r.output));let s=[];return i.testCaseList&&Array.isArray(i.testCaseList)&&(s=i.testCaseList.map(r=>{if(r&&typeof r=="object"){const o=r.input,a=String(r.output??"");let l=[];if(typeof o=="string")try{const c=JSON.parse(o);l=Array.isArray(c)?c.map(String):[String(c)]}catch{l=[o]}else Array.isArray(o)?l=o.map(String):l=[String(o??"")];return{input:l,output:a}}return{input:[],output:""}}).filter(r=>r.input.length>0||r.output)),{type:"ccm",form:"",topic:String(i.topic??""),text:String(i.content??""),answer:typeof i.answer=="string"?i.answer:String(i.answer??""),codeText:{lang:e,value:t},example:n,test:s,score:typeof i.score=="number"?i.score:void 0,validated:i.validated,validateMessage:i.message?String(i.message):void 0}},Toe=(i,e,t)=>{const[n,s]=M.useState(),[r,o]=M.useState(""),[a,l]=M.useState(!1),[c,d]=M.useState(!1),[u,h]=M.useState(""),[f,g]=M.useState(""),[p,m]=M.useState(!1),b=M.useCallback(k=>{if(k==null){s(void 0);return}try{const E=k;if(E.type!=="answer"){console.warn("useAnswerQuestion: unexpected type",E.type),s(void 0);return}s(Loe(E))}catch(E){console.warn("useAnswerQuestion: invalid question json",E),s(void 0)}},[]),v=()=>n?Soe(n):"",w=()=>{},C=M.useCallback(k=>{s(E=>E&&{...E,score:k===""?0:k})},[]),y=M.useCallback(k=>{h(""),o(k)},[]),S=M.useCallback(async()=>{var k;if(!r||!n){h("warning");return}d(!0);try{const E={id:e||"1938931024515944448",type:"qa",title:n.text||"",content:n.text||"",score:n.score||10,require:"",answer:n.answer||"",commit:r};console.log("params",E);const I=await q6(E);let T="",N="";((k=I==null?void 0:I.reasons)==null?void 0:k.length)>0&&(I==null||I.reasons.forEach(O=>{N+=`${O.reason}`}),T=`${I.answer} ${I.comment} ${N}`),g(T),(I==null?void 0:I.userScore)>0?h("correct"):h(i==="response"?"incorrect":"reanswerIncorrect"),t&&t((I==null?void 0:I.userScore)||0),l(!0)}catch(E){console.error("自动判分失败:",E),s_.error("自动判分失败,请稍后重试")}finally{d(!1)}},[r,n,e,t,i]);return{data:n,parse:b,toString:v,ask:w,updateScore:C,userAnswer:r,updateUserAnswer:y,submitted:a,analysisSentence:f,tipType:u,isSubmitting:c,submitForAutoScore:S,isExpanded:p,setIsExpanded:m,onChangeSubmit:()=>{l(!1),m(!1),h(""),o("")}}};function nr(i){const{type:e="type",children:t}=i;return ee.jsx("div",{className:"ques-tag ques-center","data-type":e,children:t})}function Doe(i,e,t,n,s){const r=e===void 0?void 0:e.key;return{sel:i,data:e,children:t,text:n,elm:s,key:r}}const F$e=Array.isArray;function Noe(i){return typeof i=="string"||typeof i=="number"||i instanceof String||i instanceof Number}function Aoe(i,e,t){if(i.ns="http://www.w3.org/2000/svg",t!=="foreignObject"&&e!==void 0)for(let n=0;n<e.length;++n){const s=e[n];if(typeof s=="string")continue;const r=s.data;r!==void 0&&Aoe(r,s.children,s.sel)}}function B$e(i,e,t){let n={},s,r,o;if(e!=null&&(F$e(e)?s=e:Noe(e)?r=e.toString():e&&e.sel?s=[e]:n=e),s!==void 0)for(o=0;o<s.length;++o)Noe(s[o])&&(s[o]=Doe(void 0,void 0,void 0,s[o],void 0));return i.startsWith("svg")&&(i.length===3||i[3]==="."||i[3]==="#")&&Aoe(n,s,i),Doe(i,n,s,r,void 0)}const yo=[];for(let i=0;i<256;++i)yo.push((i+256).toString(16).slice(1));function $$e(i,e=0){return(yo[i[e+0]]+yo[i[e+1]]+yo[i[e+2]]+yo[i[e+3]]+"-"+yo[i[e+4]]+yo[i[e+5]]+"-"+yo[i[e+6]]+yo[i[e+7]]+"-"+yo[i[e+8]]+yo[i[e+9]]+"-"+yo[i[e+10]]+yo[i[e+11]]+yo[i[e+12]]+yo[i[e+13]]+yo[i[e+14]]+yo[i[e+15]]).toLowerCase()}let L8;const W$e=new Uint8Array(16);function H$e(){if(!L8){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");L8=crypto.getRandomValues.bind(crypto)}return L8(W$e)}const Roe={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Ooe(i,e,t){var s;if(Roe.randomUUID&&!i)return Roe.randomUUID();i=i||{};const n=i.random??((s=i.rng)==null?void 0:s.call(i))??H$e();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,$$e(n)}function V$e(i){const{isInline:e,isVoid:t}=i,n=i;return n.isInline=s=>sD.DomEditor.getNodeType(s)==="fill-blank"?!0:e(s),n.isVoid=s=>sD.DomEditor.getNodeType(s)==="fill-blank"?!0:t(s),n}class z$e{constructor(){us(this,"title","插入填空项");us(this,"tag","button")}getValue(){return""}isActive(){return!1}isDisabled(e){var t;return e.selection==null||((t=e.getElemsByType("fill-blank"))==null?void 0:t.length)>=20}exec(e){if(this.isDisabled(e))return;const t=[{text:" "},{type:"fill-blank",key:Ooe(),children:[{text:""}]},{text:" "}];sD.SlateTransforms.insertNodes(e,t)}}let I8=[];const U$e={editorPlugin:V$e,renderElems:[{type:"fill-blank",renderElem:(i,e,t)=>{const n=t==null?void 0:t.getElemsByType("fill-blank"),s=(n==null?void 0:n.findIndex(r=>r.key===i.key&&!I8.includes(r.id||"")))||0;return s===n.length-1?I8=[]:I8.push(n[s].id),B$e("input",{attrs:{class:"w-e-fill-blank","data-w-e-type":"fill-blank","data-w-e-is-void":"true","data-w-e-is-inline":"true",readonly:!0,placeholder:s+1}})}}],elemsToHtml:[{type:"fill-blank",elemToHtml:()=>'<input class="w-e-fill-blank" data-w-e-type="fill-blank" data-w-e-is-void="true" data-w-e-is-inline="true" readonly="true">'}],parseElemsHtml:[{selector:"input[data-w-e-type='fill-blank']",parseElemHtml:()=>({type:"fill-blank",key:Ooe(),children:[{text:""}]})},{selector:"pre:not([data-w-e-type])>code",parseElemHtml:(i,e)=>{let t=(i==null?void 0:i.innerHTML)||"";const n='<input class="w-e-fill-blank" data-w-e-type="fill-blank" data-w-e-is-void="true" data-w-e-is-inline="true" readonly="true">',s=(e==null?void 0:e.filter(o=>(o==null?void 0:o.type)==="fill-blank"))||[],r=[];return s!=null&&s.length&&(e==null||e.forEach((o,a)=>{var l;if(r.push(o),(o==null?void 0:o.type)==="fill-blank")if(((l=e[a+1])==null?void 0:l.type)==="fill-blank"){const c=t==null?void 0:t.indexOf(n,1);let d=t==null?void 0:t.slice(0,c);t=t==null?void 0:t.replace(d,""),d=d.replace(n,""),r.push({text:d})}else t=t==null?void 0:t.replace(n,"");else t=t==null?void 0:t.replace((o==null?void 0:o.text)||"","")})),{type:"code",language:"",children:s!=null&&s.length?r:[{text:(i==null?void 0:i.textContent)||""}]}}}],menus:[{key:"fill-blank",factory(){return new z$e}}]};class j$e extends M.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}render(){return this.state.hasError?this.props.fallback||ee.jsx("h3",{children:"组件渲染错误"}):this.props.children}}/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:Poe,setPrototypeOf:Moe,isFrozen:q$e,getPrototypeOf:K$e,getOwnPropertyDescriptor:G$e}=Object;let{freeze:va,seal:Ac,create:Foe}=Object,{apply:T8,construct:D8}=typeof Reflect<"u"&&Reflect;va||(va=function(e){return e}),Ac||(Ac=function(e){return e}),T8||(T8=function(e,t,n){return e.apply(t,n)}),D8||(D8=function(e,t){return new e(...t)});const zN=Ca(Array.prototype.forEach),X$e=Ca(Array.prototype.lastIndexOf),Boe=Ca(Array.prototype.pop),Cx=Ca(Array.prototype.push),Z$e=Ca(Array.prototype.splice),UN=Ca(String.prototype.toLowerCase),N8=Ca(String.prototype.toString),$oe=Ca(String.prototype.match),yx=Ca(String.prototype.replace),Y$e=Ca(String.prototype.indexOf),Q$e=Ca(String.prototype.trim),xd=Ca(Object.prototype.hasOwnProperty),wa=Ca(RegExp.prototype.test),Sx=J$e(TypeError);function Ca(i){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];return T8(i,e,n)}}function J$e(i){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return D8(i,t)}}function Zn(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:UN;Moe&&Moe(i,null);let n=e.length;for(;n--;){let s=e[n];if(typeof s=="string"){const r=t(s);r!==s&&(q$e(e)||(e[n]=r),s=r)}i[s]=!0}return i}function e9e(i){for(let e=0;e<i.length;e++)xd(i,e)||(i[e]=null);return i}function af(i){const e=Foe(null);for(const[t,n]of Poe(i))xd(i,t)&&(Array.isArray(n)?e[t]=e9e(n):n&&typeof n=="object"&&n.constructor===Object?e[t]=af(n):e[t]=n);return e}function xx(i,e){for(;i!==null;){const n=G$e(i,e);if(n){if(n.get)return Ca(n.get);if(typeof n.value=="function")return Ca(n.value)}i=K$e(i)}function t(){return null}return t}const Woe=va(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),A8=va(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),R8=va(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),t9e=va(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),O8=va(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),n9e=va(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Hoe=va(["#text"]),Voe=va(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),P8=va(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),zoe=va(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),jN=va(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),i9e=Ac(/\{\{[\w\W]*|[\w\W]*\}\}/gm),s9e=Ac(/<%[\w\W]*|[\w\W]*%>/gm),r9e=Ac(/\$\{[\w\W]*/gm),o9e=Ac(/^data-[\-\w.\u00B7-\uFFFF]+$/),a9e=Ac(/^aria-[\-\w]+$/),Uoe=Ac(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),l9e=Ac(/^(?:\w+script|data):/i),c9e=Ac(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),joe=Ac(/^html$/i),d9e=Ac(/^[a-z][.\w]*(-[.\w]+)+$/i);var qoe=Object.freeze({__proto__:null,ARIA_ATTR:a9e,ATTR_WHITESPACE:c9e,CUSTOM_ELEMENT:d9e,DATA_ATTR:o9e,DOCTYPE_NAME:joe,ERB_EXPR:s9e,IS_ALLOWED_URI:Uoe,IS_SCRIPT_OR_DATA:l9e,MUSTACHE_EXPR:i9e,TMPLIT_EXPR:r9e});const kx={element:1,text:3,progressingInstruction:7,comment:8,document:9},u9e=function(){return typeof window>"u"?null:window},h9e=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(n=t.getAttribute(s));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},Koe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Goe(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:u9e();const e=Oe=>Goe(Oe);if(e.version="3.2.6",e.removed=[],!i||!i.document||i.document.nodeType!==kx.document||!i.Element)return e.isSupported=!1,e;let{document:t}=i;const n=t,s=n.currentScript,{DocumentFragment:r,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:c,NamedNodeMap:d=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:u,DOMParser:h,trustedTypes:f}=i,g=l.prototype,p=xx(g,"cloneNode"),m=xx(g,"remove"),b=xx(g,"nextSibling"),v=xx(g,"childNodes"),w=xx(g,"parentNode");if(typeof o=="function"){const Oe=t.createElement("template");Oe.content&&Oe.content.ownerDocument&&(t=Oe.content.ownerDocument)}let C,y="";const{implementation:S,createNodeIterator:x,createDocumentFragment:k,getElementsByTagName:E}=t,{importNode:I}=n;let T=Koe();e.isSupported=typeof Poe=="function"&&typeof w=="function"&&S&&S.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:N,ERB_EXPR:O,TMPLIT_EXPR:R,DATA_ATTR:P,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:q,ATTR_WHITESPACE:K,CUSTOM_ELEMENT:X}=qoe;let{IS_ALLOWED_URI:W}=qoe,ne=null;const le=Zn({},[...Woe,...A8,...R8,...O8,...Hoe]);let F=null;const ie=Zn({},[...Voe,...P8,...zoe,...jN]);let J=Object.seal(Foe(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),pe=null,ze=null,Le=!0,We=!0,je=!1,Ct=!0,Je=!1,wt=!0,Re=!1,Et=!1,rt=!1,lt=!1,ht=!1,ut=!1,Jt=!0,Xt=!1;const pn="user-content-";let At=!0,Ke=!1,mt={},ge=null;const Be=Zn({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ct=null;const pt=Zn({},["audio","video","img","source","image","track"]);let Rt=null;const Lt=Zn({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),$t="http://www.w3.org/1998/Math/MathML",xt="http://www.w3.org/2000/svg",et="http://www.w3.org/1999/xhtml";let Vt=et,vt=!1,zt=null;const Pt=Zn({},[$t,xt,et],N8);let Ws=Zn({},["mi","mo","mn","ms","mtext"]),Hr=Zn({},["annotation-xml"]);const Vr=Zn({},["title","style","font","a","script"]);let si=null;const Ts=["application/xhtml+xml","text/html"],Ds="text/html";let yn=null,Vn=null;const qe=t.createElement("form"),z=function(H){return H instanceof RegExp||H instanceof Function},j=function(){let H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Vn&&Vn===H)){if((!H||typeof H!="object")&&(H={}),H=af(H),si=Ts.indexOf(H.PARSER_MEDIA_TYPE)===-1?Ds:H.PARSER_MEDIA_TYPE,yn=si==="application/xhtml+xml"?N8:UN,ne=xd(H,"ALLOWED_TAGS")?Zn({},H.ALLOWED_TAGS,yn):le,F=xd(H,"ALLOWED_ATTR")?Zn({},H.ALLOWED_ATTR,yn):ie,zt=xd(H,"ALLOWED_NAMESPACES")?Zn({},H.ALLOWED_NAMESPACES,N8):Pt,Rt=xd(H,"ADD_URI_SAFE_ATTR")?Zn(af(Lt),H.ADD_URI_SAFE_ATTR,yn):Lt,ct=xd(H,"ADD_DATA_URI_TAGS")?Zn(af(pt),H.ADD_DATA_URI_TAGS,yn):pt,ge=xd(H,"FORBID_CONTENTS")?Zn({},H.FORBID_CONTENTS,yn):Be,pe=xd(H,"FORBID_TAGS")?Zn({},H.FORBID_TAGS,yn):af({}),ze=xd(H,"FORBID_ATTR")?Zn({},H.FORBID_ATTR,yn):af({}),mt=xd(H,"USE_PROFILES")?H.USE_PROFILES:!1,Le=H.ALLOW_ARIA_ATTR!==!1,We=H.ALLOW_DATA_ATTR!==!1,je=H.ALLOW_UNKNOWN_PROTOCOLS||!1,Ct=H.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Je=H.SAFE_FOR_TEMPLATES||!1,wt=H.SAFE_FOR_XML!==!1,Re=H.WHOLE_DOCUMENT||!1,lt=H.RETURN_DOM||!1,ht=H.RETURN_DOM_FRAGMENT||!1,ut=H.RETURN_TRUSTED_TYPE||!1,rt=H.FORCE_BODY||!1,Jt=H.SANITIZE_DOM!==!1,Xt=H.SANITIZE_NAMED_PROPS||!1,At=H.KEEP_CONTENT!==!1,Ke=H.IN_PLACE||!1,W=H.ALLOWED_URI_REGEXP||Uoe,Vt=H.NAMESPACE||et,Ws=H.MATHML_TEXT_INTEGRATION_POINTS||Ws,Hr=H.HTML_INTEGRATION_POINTS||Hr,J=H.CUSTOM_ELEMENT_HANDLING||{},H.CUSTOM_ELEMENT_HANDLING&&z(H.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(J.tagNameCheck=H.CUSTOM_ELEMENT_HANDLING.tagNameCheck),H.CUSTOM_ELEMENT_HANDLING&&z(H.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(J.attributeNameCheck=H.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),H.CUSTOM_ELEMENT_HANDLING&&typeof H.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(J.allowCustomizedBuiltInElements=H.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Je&&(We=!1),ht&&(lt=!0),mt&&(ne=Zn({},Hoe),F=[],mt.html===!0&&(Zn(ne,Woe),Zn(F,Voe)),mt.svg===!0&&(Zn(ne,A8),Zn(F,P8),Zn(F,jN)),mt.svgFilters===!0&&(Zn(ne,R8),Zn(F,P8),Zn(F,jN)),mt.mathMl===!0&&(Zn(ne,O8),Zn(F,zoe),Zn(F,jN))),H.ADD_TAGS&&(ne===le&&(ne=af(ne)),Zn(ne,H.ADD_TAGS,yn)),H.ADD_ATTR&&(F===ie&&(F=af(F)),Zn(F,H.ADD_ATTR,yn)),H.ADD_URI_SAFE_ATTR&&Zn(Rt,H.ADD_URI_SAFE_ATTR,yn),H.FORBID_CONTENTS&&(ge===Be&&(ge=af(ge)),Zn(ge,H.FORBID_CONTENTS,yn)),At&&(ne["#text"]=!0),Re&&Zn(ne,["html","head","body"]),ne.table&&(Zn(ne,["tbody"]),delete pe.tbody),H.TRUSTED_TYPES_POLICY){if(typeof H.TRUSTED_TYPES_POLICY.createHTML!="function")throw Sx('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof H.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Sx('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=H.TRUSTED_TYPES_POLICY,y=C.createHTML("")}else C===void 0&&(C=h9e(f,s)),C!==null&&typeof y=="string"&&(y=C.createHTML(""));va&&va(H),Vn=H}},G=Zn({},[...A8,...R8,...t9e]),te=Zn({},[...O8,...n9e]),re=function(H){let de=w(H);(!de||!de.tagName)&&(de={namespaceURI:Vt,tagName:"template"});const Ie=UN(H.tagName),Zt=UN(de.tagName);return zt[H.namespaceURI]?H.namespaceURI===xt?de.namespaceURI===et?Ie==="svg":de.namespaceURI===$t?Ie==="svg"&&(Zt==="annotation-xml"||Ws[Zt]):!!G[Ie]:H.namespaceURI===$t?de.namespaceURI===et?Ie==="math":de.namespaceURI===xt?Ie==="math"&&Hr[Zt]:!!te[Ie]:H.namespaceURI===et?de.namespaceURI===xt&&!Hr[Zt]||de.namespaceURI===$t&&!Ws[Zt]?!1:!te[Ie]&&(Vr[Ie]||!G[Ie]):!!(si==="application/xhtml+xml"&&zt[H.namespaceURI]):!1},ae=function(H){Cx(e.removed,{element:H});try{w(H).removeChild(H)}catch{m(H)}},Se=function(H,de){try{Cx(e.removed,{attribute:de.getAttributeNode(H),from:de})}catch{Cx(e.removed,{attribute:null,from:de})}if(de.removeAttribute(H),H==="is")if(lt||ht)try{ae(de)}catch{}else try{de.setAttribute(H,"")}catch{}},Ge=function(H){let de=null,Ie=null;if(rt)H="<remove></remove>"+H;else{const Pn=$oe(H,/^[\r\n\t ]+/);Ie=Pn&&Pn[0]}si==="application/xhtml+xml"&&Vt===et&&(H='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+H+"</body></html>");const Zt=C?C.createHTML(H):H;if(Vt===et)try{de=new h().parseFromString(Zt,si)}catch{}if(!de||!de.documentElement){de=S.createDocument(Vt,"template",null);try{de.documentElement.innerHTML=vt?y:Zt}catch{}}const zn=de.body||de.documentElement;return H&&Ie&&zn.insertBefore(t.createTextNode(Ie),zn.childNodes[0]||null),Vt===et?E.call(de,Re?"html":"body")[0]:Re?de.documentElement:zn},Ve=function(H){return x.call(H.ownerDocument||H,H,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ft=function(H){return H instanceof u&&(typeof H.nodeName!="string"||typeof H.textContent!="string"||typeof H.removeChild!="function"||!(H.attributes instanceof d)||typeof H.removeAttribute!="function"||typeof H.setAttribute!="function"||typeof H.namespaceURI!="string"||typeof H.insertBefore!="function"||typeof H.hasChildNodes!="function")},en=function(H){return typeof a=="function"&&H instanceof a};function Mt(Oe,H,de){zN(Oe,Ie=>{Ie.call(e,H,de,Vn)})}const Dn=function(H){let de=null;if(Mt(T.beforeSanitizeElements,H,null),ft(H))return ae(H),!0;const Ie=yn(H.nodeName);if(Mt(T.uponSanitizeElement,H,{tagName:Ie,allowedTags:ne}),wt&&H.hasChildNodes()&&!en(H.firstElementChild)&&wa(/<[/\w!]/g,H.innerHTML)&&wa(/<[/\w!]/g,H.textContent)||H.nodeType===kx.progressingInstruction||wt&&H.nodeType===kx.comment&&wa(/<[/\w]/g,H.data))return ae(H),!0;if(!ne[Ie]||pe[Ie]){if(!pe[Ie]&&wi(Ie)&&(J.tagNameCheck instanceof RegExp&&wa(J.tagNameCheck,Ie)||J.tagNameCheck instanceof Function&&J.tagNameCheck(Ie)))return!1;if(At&&!ge[Ie]){const Zt=w(H)||H.parentNode,zn=v(H)||H.childNodes;if(zn&&Zt){const Pn=zn.length;for(let jn=Pn-1;jn>=0;--jn){const ls=p(zn[jn],!0);ls.__removalCount=(H.__removalCount||0)+1,Zt.insertBefore(ls,b(H))}}}return ae(H),!0}return H instanceof l&&!re(H)||(Ie==="noscript"||Ie==="noembed"||Ie==="noframes")&&wa(/<\/no(script|embed|frames)/i,H.innerHTML)?(ae(H),!0):(Je&&H.nodeType===kx.text&&(de=H.textContent,zN([N,O,R],Zt=>{de=yx(de,Zt," ")}),H.textContent!==de&&(Cx(e.removed,{element:H.cloneNode()}),H.textContent=de)),Mt(T.afterSanitizeElements,H,null),!1)},On=function(H,de,Ie){if(Jt&&(de==="id"||de==="name")&&(Ie in t||Ie in qe))return!1;if(!(We&&!ze[de]&&wa(P,de))){if(!(Le&&wa($,de))){if(!F[de]||ze[de]){if(!(wi(H)&&(J.tagNameCheck instanceof RegExp&&wa(J.tagNameCheck,H)||J.tagNameCheck instanceof Function&&J.tagNameCheck(H))&&(J.attributeNameCheck instanceof RegExp&&wa(J.attributeNameCheck,de)||J.attributeNameCheck instanceof Function&&J.attributeNameCheck(de))||de==="is"&&J.allowCustomizedBuiltInElements&&(J.tagNameCheck instanceof RegExp&&wa(J.tagNameCheck,Ie)||J.tagNameCheck instanceof Function&&J.tagNameCheck(Ie))))return!1}else if(!Rt[de]){if(!wa(W,yx(Ie,K,""))){if(!((de==="src"||de==="xlink:href"||de==="href")&&H!=="script"&&Y$e(Ie,"data:")===0&&ct[H])){if(!(je&&!wa(q,yx(Ie,K,"")))){if(Ie)return!1}}}}}}return!0},wi=function(H){return H!=="annotation-xml"&&$oe(H,X)},Mi=function(H){Mt(T.beforeSanitizeAttributes,H,null);const{attributes:de}=H;if(!de||ft(H))return;const Ie={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:F,forceKeepAttr:void 0};let Zt=de.length;for(;Zt--;){const zn=de[Zt],{name:Pn,namespaceURI:jn,value:ls}=zn,pr=yn(Pn),cs=ls;let ys=Pn==="value"?cs:Q$e(cs);if(Ie.attrName=pr,Ie.attrValue=ys,Ie.keepAttr=!0,Ie.forceKeepAttr=void 0,Mt(T.uponSanitizeAttribute,H,Ie),ys=Ie.attrValue,Xt&&(pr==="id"||pr==="name")&&(Se(Pn,H),ys=pn+ys),wt&&wa(/((--!?|])>)|<\/(style|title)/i,ys)){Se(Pn,H);continue}if(Ie.forceKeepAttr)continue;if(!Ie.keepAttr){Se(Pn,H);continue}if(!Ct&&wa(/\/>/i,ys)){Se(Pn,H);continue}Je&&zN([N,O,R],hd=>{ys=yx(ys,hd," ")});const Qa=yn(H.nodeName);if(!On(Qa,pr,ys)){Se(Pn,H);continue}if(C&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!jn)switch(f.getAttributeType(Qa,pr)){case"TrustedHTML":{ys=C.createHTML(ys);break}case"TrustedScriptURL":{ys=C.createScriptURL(ys);break}}if(ys!==cs)try{jn?H.setAttributeNS(jn,Pn,ys):H.setAttribute(Pn,ys),ft(H)?ae(H):Boe(e.removed)}catch{Se(Pn,H)}}Mt(T.afterSanitizeAttributes,H,null)},Ys=function Oe(H){let de=null;const Ie=Ve(H);for(Mt(T.beforeSanitizeShadowDOM,H,null);de=Ie.nextNode();)Mt(T.uponSanitizeShadowNode,de,null),Dn(de),Mi(de),de.content instanceof r&&Oe(de.content);Mt(T.afterSanitizeShadowDOM,H,null)};return e.sanitize=function(Oe){let H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},de=null,Ie=null,Zt=null,zn=null;if(vt=!Oe,vt&&(Oe="<!-->"),typeof Oe!="string"&&!en(Oe))if(typeof Oe.toString=="function"){if(Oe=Oe.toString(),typeof Oe!="string")throw Sx("dirty is not a string, aborting")}else throw Sx("toString is not a function");if(!e.isSupported)return Oe;if(Et||j(H),e.removed=[],typeof Oe=="string"&&(Ke=!1),Ke){if(Oe.nodeName){const ls=yn(Oe.nodeName);if(!ne[ls]||pe[ls])throw Sx("root node is forbidden and cannot be sanitized in-place")}}else if(Oe instanceof a)de=Ge("<!---->"),Ie=de.ownerDocument.importNode(Oe,!0),Ie.nodeType===kx.element&&Ie.nodeName==="BODY"||Ie.nodeName==="HTML"?de=Ie:de.appendChild(Ie);else{if(!lt&&!Je&&!Re&&Oe.indexOf("<")===-1)return C&&ut?C.createHTML(Oe):Oe;if(de=Ge(Oe),!de)return lt?null:ut?y:""}de&&rt&&ae(de.firstChild);const Pn=Ve(Ke?Oe:de);for(;Zt=Pn.nextNode();)Dn(Zt),Mi(Zt),Zt.content instanceof r&&Ys(Zt.content);if(Ke)return Oe;if(lt){if(ht)for(zn=k.call(de.ownerDocument);de.firstChild;)zn.appendChild(de.firstChild);else zn=de;return(F.shadowroot||F.shadowrootmode)&&(zn=I.call(n,zn,!0)),zn}let jn=Re?de.outerHTML:de.innerHTML;return Re&&ne["!doctype"]&&de.ownerDocument&&de.ownerDocument.doctype&&de.ownerDocument.doctype.name&&wa(joe,de.ownerDocument.doctype.name)&&(jn="<!DOCTYPE "+de.ownerDocument.doctype.name+`>
275
- `+jn),Je&&zN([N,O,R],ls=>{jn=yx(jn,ls," ")}),C&&ut?C.createHTML(jn):jn},e.setConfig=function(){let Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};j(Oe),Et=!0},e.clearConfig=function(){Vn=null,Et=!1},e.isValidAttribute=function(Oe,H,de){Vn||j({});const Ie=yn(Oe),Zt=yn(H);return On(Ie,Zt,de)},e.addHook=function(Oe,H){typeof H=="function"&&Cx(T[Oe],H)},e.removeHook=function(Oe,H){if(H!==void 0){const de=X$e(T[Oe],H);return de===-1?void 0:Z$e(T[Oe],de,1)[0]}return Boe(T[Oe])},e.removeHooks=function(Oe){T[Oe]=[]},e.removeAllHooks=function(){T=Koe()},e}var f9e=Goe();sD.Boot.registerModule(U$e);const Nu=M.forwardRef(i=>{const{value:e,readOnly:t=!0,onChange:n,placeholder:s="",ifShowToolbar:r=!1,editorHeight:o,customToolbarKeys:a=[]}=i,[l,c]=M.useState(null),[d,u]=M.useState(()=>typeof e!="string"?(console.warn("RichEditor: value prop must be a string"),""):e||""),h={toolbarKeys:a??["undo","redo","fullScreen","|","headerSelect","bold","underline","italic","color","bgColor","|","bulletedList","numberedList",{key:"group-justify",title:"对齐",iconSvg:'<svg viewBox="0 0 1024 1024"><path d="M204.8 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z"></path><path d="M505.6 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z"></path><path d="M806.4 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z"></path></svg>',menuKeys:["justifyLeft","justifyRight","justifyCenter","justifyJustify"]},{key:"group-indent",title:"缩进",iconSvg:'<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m0-128V320l256 192z"></path></svg>',menuKeys:["indent","delIndent"]},"insertLink",{key:"group-image",title:"图片",iconSvg:'<svg viewBox="0 0 1024 1024"><path d="M959.877 128l0.123 0.123v767.775l-0.123 0.122H64.102l-0.122-0.122V128.123l0.122-0.123h895.775zM960 64H64C28.795 64 0 92.795 0 128v768c0 35.205 28.795 64 64 64h896c35.205 0 64-28.795 64-64V128c0-35.205-28.795-64-64-64zM832 288.01c0 53.023-42.988 96.01-96.01 96.01s-96.01-42.987-96.01-96.01S682.967 192 735.99 192 832 234.988 832 288.01zM896 832H128V704l224.01-384 256 320h64l224.01-192z"></path></svg>',menuKeys:["insertImage","uploadImage"]},"insertTable","codeBlock","divider","|"]},f={placeholder:s,autoFocus:!1,readOnly:t};M.useEffect(()=>()=>{if(l!=null){try{l==null||l.destroy()}catch(p){console.warn("Error destroying editor:",p)}c(null)}},[l]),M.useEffect(()=>{try{if(typeof e!="string"){console.warn("RichEditor: value prop must be a string");return}const p=e||"";u(p),l&&typeof l.setHtml=="function"&&l.setHtml(p)}catch(p){console.warn("Error setting editor content:",p)}},[e,l]);const g=p=>{if(!t)try{const m=p.getHtml();u(m),n&&!t&&n(m)}catch(m){console.warn("Error handling editor change:",m)}};return typeof e!="string"?ee.jsx("div",{children:"Invalid content type"}):ee.jsx(ee.Fragment,{children:ee.jsx(j$e,{fallback:ee.jsx("div",{dangerouslySetInnerHTML:{__html:Xoe(d)}}),children:ee.jsxs("div",{style:{border:a.length===0?"none":"1px solid #E5E5E5",zIndex:99,borderRadius:"10px"},className:"ques-richeditor",children:[a.length>0&&ee.jsx(ZQ.Toolbar,{editor:l,defaultConfig:h,mode:"default",style:{borderBottom:"1px solid #E5E5E5"}}),M.version&&ee.jsx(ZQ.Editor,{defaultConfig:f,value:d,onCreated:p=>{try{c(p)}catch(m){console.warn("Error creating editor:",m)}},onChange:g,mode:"default",style:{height:o?`${o}px`:"auto",padding:"10px"}}),!M.version&&ee.jsx("div",{dangerouslySetInnerHTML:{__html:Xoe(d)}})]})})})});function Xoe(i){try{return f9e.sanitize(i,{FORBID_TAGS:["style"]})}catch{return i}}function Ex(i){const{score:e,className:t,style:n,disabled:s=!0,max:r=100,id:o,name:a}=i,[l,c]=M.useState(e),d=u=>{var f,g;const h=u.target.value;if(h===""){c(Number(h)),(f=i.onChange)==null||f.call(i,h);return}/^\d*$/.test(h)&&Number(h)>=0&&Number(h)<=r&&(c(Number(h)),(g=i.onChange)==null||g.call(i,Number(h)))};return ee.jsxs("div",{className:Ne(["ques-scoreinput ques-center",t]),style:n,children:[ee.jsxs("span",{children:["分数",ee.jsx("span",{className:"ques-scoreinput-red",children:"*"})]}),ee.jsx(n_,{disabled:s,value:l,style:{width:60},onChange:d,id:o,name:a})]})}const g9e=()=>ee.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[ee.jsx("circle",{cx:"6",cy:"6",r:"6",fill:"#52C41A"}),ee.jsx("path",{d:"M4.5 6L5.5 7L8.5 4",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]}),Zoe=()=>ee.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[ee.jsx("circle",{cx:"6",cy:"6",r:"6",fill:"#FF4D4F"}),ee.jsx("path",{d:"M4 4L8 8M8 4L4 8",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]}),p9e=()=>ee.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[ee.jsx("circle",{cx:"6",cy:"6",r:"6",fill:"#FA8C16"}),ee.jsx("path",{d:"M6 3.5V7M6 8.5H6.01",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]});function qN(i){const{tipType:e}=i,t={correct:"回答正确!",incorrect:"回答错误!",warning:"请完成作答!",reanswerIncorrect:"回答错误,请重新作答!","":""},n={correct:ee.jsx(g9e,{}),incorrect:ee.jsx(Zoe,{}),warning:ee.jsx(p9e,{}),reanswerIncorrect:ee.jsx(Zoe,{}),"":""};return ee.jsx("div",{className:Ne("answer-tip",`answer-tip-${e}`),children:ee.jsxs("div",{className:"answer-tip-content",children:[ee.jsx("span",{className:"answer-tip-icon",children:n[e]}),ee.jsx("span",{className:"answer-tip-text",children:t[e]})]})})}const M8=({content:i,title:e="答案解析",collapsible:t=!1,defaultExpanded:n=!0,className:s})=>{const[r,o]=M.useState(n),a=()=>{t&&o(!r)};return ee.jsxs("div",{className:Ne("analysis-container",s,{"analysis-collapsible":t,"analysis-expanded":r,"analysis-collapsed":t&&!r}),children:[ee.jsx("div",{className:"analysis-header",onClick:a,style:{cursor:t?"pointer":"default"},children:ee.jsx("span",{className:"analysis-title",children:e})}),ee.jsx("div",{className:"analysis-content",children:i})]})},F8="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAA7NJREFUWEftls1vG1UUxc99M56ZFAlciaQsqDCwQ6BM2rJPWAV1YZvwVSSoK7FASKjpli7qIvYJ/QNqZ4EqlTZO/4JkTxuPu0EgJCcrJEco3lPPoXc+YidxPE6DVAl15NEbz/i9+3v3nnM9gud8yHOOjxcAY2VgssHKTlnqJy2Xv8rLuSdo/fqpBOla4wGscdfOwf/romw/K8SFBpdILAKg9PDBw09kQ9fKBMjfpe+4aPYcVP7+UFaeBeDCKosh0BBCNKL0MDc2wORdVsTFbbhY6czLleMC+HdYsBysAygkc+uPFvrrZGZg6h4byKFEF+2deXnruADn77MGoEIBBdjuCeaCsmyN1MDULU7Twyw8+OKhBBd5eKA4eBBOYIOnEDzpodWdke4ooPcbvBoSS0hST+LK5sJ+Me/LwKs/clEc3JAJvAIXIh5AF0A8UjwI4u+EXjuod94eXhZNvXGxKcTpCJL46dHHoiLcdxwqwWtLLIQ2fHExG3qY1lEBosAuAk5gAy5a/wAb3Zl+Kg8ufH6VbQEKZCT1rZ5gJigfzli2Bn5hHQ4ua/DOvMyMo4FzDd4QogoNDiAECs2F4RbOBJi8x6uSwzJcrHXmpZwFkKi+HYmOEBpUN8ty86h5mQBpH6CDyk5GH/BrzFsvowlBQXcvguDhR6Ozlgmg5FMPuEsbczsX+y102I7O3eeSIOp2Wvdu6MJvZnTPcQGqnaJUR6Xfv8OKWKiJiXauCThkuWHzxwLIrHuNBXpYNwYFBYBBfXOg242a/58ATP/M2lOrVXTnYrDFEHPBpaMtOgh0YoD3aizBQkOsOPVioRx8JmtZWTvUivNV5l9yUDQCEQPqCBu09JdW9NFmLmKjazlo/vZ17Ot3a5wVg3Vo7S0sP/5Cro0bPNZqcpz9ge2ntYtqKBYoGkxHA0Qwel+v4xoHv3/Tt9c7NVZsC/nHX8nycYLvA3j9JndhkI8AkkDpdTomEAq39ce3x/9nHOmCs1WWYFCMcp1YSXerp9bWJPf1OUOs/Pld/EZz0uPEIvz/AOQXmfdOoRQp34ZEpdBqGMAyYOSERIxQl4TR+0D8My2VA4QCOqlbcqDep0HXIlpH9YW9Epz5nm1j8EYiOHVA7AaVQOrxAYeoJlQbSJyyJ97YxntOimANWsHnw/+U+gDXuStIXJDYMBJgeqYBDzpkEO6Ag/ZcY7DduiRvjnTBmessCqBO6CvfjqdoBrRjDLpCcx/1BAXQMX0+4CJdy1YoYiX4crhrXrjgX4yiGjBINFE/AAAAAElFTkSuQmCC",m9e=i=>{const[e,t]=M.useState(0),n=()=>{t(T=>T+1)},{scenario:s="response",requestId:r,content:o,index:a,elements:l,elementCheckbox:c,elementLabel:d,scoreDisabled:u=!0,returnContent:h,onScore:f}=i,{data:g,parse:p,updateScore:m,userAnswer:b,updateUserAnswer:v,submitted:w,tipType:C,isSubmitting:y,analysisSentence:S,submitForAutoScore:x,isExpanded:k,setIsExpanded:E,onChangeSubmit:I}=Toe(s,r,f);return M.useEffect(()=>{p(o)},[o,p]),M.useEffect(()=>{n()},[w]),M.useEffect(()=>{h&&g&&h(g)},[g,h]),ee.jsx("div",{className:Ne(["ques-radio ques-com"]),children:ee.jsxs("div",{className:"ques-center ques-com-container",children:[ee.jsx("div",{className:"ques-center ques-com-checkbox",children:c}),a!=null&&ee.jsxs("div",{className:"ques-com-index",children:[a,"、"]}),ee.jsxs("div",{className:"ques-com-content",children:[ee.jsxs("div",{className:"ques-com-content-header ques-center",children:[ee.jsx(nr,{type:"type",children:"问答"}),ee.jsx(nr,{type:"auto",children:"自动判分"}),(g==null?void 0:g.validated)===!1&&ee.jsx(nr,{type:"verifyError",children:"AI验证未通过,建议人工调整"}),(g==null?void 0:g.validated)===!0&&ee.jsx(nr,{type:"verifySuccess",children:"AI已验证"})]}),ee.jsx("div",{className:"ques-com-content-title",children:(g==null?void 0:g.text)&&ee.jsx(Nu,{value:g.text})}),ee.jsx("div",{className:"ques-answer-input",children:s!="write"&&(w?ee.jsx(Nu,{value:b,onChange:v,placeholder:"请输入您的答案...",editorHeight:200,readOnly:!0,customToolbarKeys:["undo","redo","fullScreen","|","headerSelect"]},e):ee.jsx(Nu,{value:b,onChange:v,placeholder:"请输入您的答案...",editorHeight:200,readOnly:!1,customToolbarKeys:["undo","redo","fullScreen","|","headerSelect","bold"]},e))}),(g==null?void 0:g.answer)&&s==="write"&&ee.jsx("div",{className:"ques-answer-content",children:ee.jsx(zB,{defaultActiveKey:s==="write"?["1"]:[],ghost:!0,expandIcon:({isActive:T})=>ee.jsx(vN,{rotate:T?90:0}),items:[{key:"1",label:ee.jsxs(ee.Fragment,{children:[ee.jsx("span",{style:{fontWeight:"bold"},children:"参考答案"}),ee.jsx("span",{style:{fontSize:"12px",color:"#999999"},children:"(学生不可见)"})]}),children:ee.jsx(Nu,{value:g.answer})}]})}),C&&ee.jsx(qN,{tipType:C}),s!="write"&&s!=="exam"&&ee.jsx(ee.Fragment,{children:ee.jsxs("div",{className:"ques-answer-actions",children:[ee.jsx("div",{className:Ne(["ques-answer-actions-submit",{"ques-answer-actions-submit-disabled":y}]),onClick:!w&&!y?x:I,style:{cursor:y?"not-allowed":"pointer"},children:y?"判分中...":w?"重新作答":"提交"}),s==="response"&&w&&!y&&ee.jsxs("div",{onClick:()=>E(!k),className:"ques-answer-actions-analysis",children:[ee.jsx("img",{src:F8,alt:"答案解析图标"}),ee.jsx("span",{children:"答案解析"})]})]})}),k&&S&&ee.jsx(M8,{content:S}),d&&ee.jsx("div",{children:d})]}),ee.jsxs("div",{className:"ques-com-control ques-center",children:[(g==null?void 0:g.score)!==void 0&&ee.jsx(Ex,{disabled:u,score:g==null?void 0:g.score,onChange:m}),ee.jsx("div",{className:"ques-com-elements",children:l==null?void 0:l.map((T,N)=>ee.jsx("div",{className:"ques-com-element",children:T},N))})]})]})})},_9e=i=>{const t=lC().use(uC).use(_C).use(pC).parse(i);let n="",s="",r="",o="",a="",l="",c,d=[],u=[];function h(p){if(p.type==="code"){const m=p;if(m.lang==="question"){const b=m.meta||"",v=b.split(/\s+/);n=v[0]||"",s=v[1]||"";const w=b.match(/score=(\d+)/);w&&(c=parseInt(w[1],10));const C=m.value||"",y=C.match(/^#\s*(.+)$/m);y&&(r=y[1].trim());const S=C.match(/^#\s*.+$/m),x=S?S[0]:"",k=x?C.indexOf(x)+x.length:0,E=C.indexOf("<code lang",k),I=C.indexOf("'```",k),T=C.indexOf("```",k);let N=-1;if(E!==-1?N=E:I!==-1?N=I:T!==-1&&(N=T),k>0&&N>k&&(o=C.substring(k,N).trim(),o)){if(console.log(o),o.includes("<pre>"))o=b9e(o);else{const K=o.split(`
275
+ `+jn),Je&&zN([N,O,R],ls=>{jn=yx(jn,ls," ")}),C&&ut?C.createHTML(jn):jn},e.setConfig=function(){let Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};j(Oe),Et=!0},e.clearConfig=function(){Vn=null,Et=!1},e.isValidAttribute=function(Oe,H,de){Vn||j({});const Ie=yn(Oe),Zt=yn(H);return On(Ie,Zt,de)},e.addHook=function(Oe,H){typeof H=="function"&&Cx(T[Oe],H)},e.removeHook=function(Oe,H){if(H!==void 0){const de=X$e(T[Oe],H);return de===-1?void 0:Z$e(T[Oe],de,1)[0]}return Boe(T[Oe])},e.removeHooks=function(Oe){T[Oe]=[]},e.removeAllHooks=function(){T=Koe()},e}var f9e=Goe();sD.Boot.registerModule(U$e);const Nu=M.forwardRef(i=>{const{value:e,readOnly:t=!0,onChange:n,placeholder:s="",ifShowToolbar:r=!1,editorHeight:o,customToolbarKeys:a=[]}=i,[l,c]=M.useState(null),[d,u]=M.useState(()=>typeof e!="string"?(console.warn("RichEditor: value prop must be a string"),""):e||""),h={toolbarKeys:a??["undo","redo","fullScreen","|","headerSelect","bold","underline","italic","color","bgColor","|","bulletedList","numberedList",{key:"group-justify",title:"对齐",iconSvg:'<svg viewBox="0 0 1024 1024"><path d="M204.8 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z"></path><path d="M505.6 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z"></path><path d="M806.4 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z"></path></svg>',menuKeys:["justifyLeft","justifyRight","justifyCenter","justifyJustify"]},{key:"group-indent",title:"缩进",iconSvg:'<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m0-128V320l256 192z"></path></svg>',menuKeys:["indent","delIndent"]},"insertLink",{key:"group-image",title:"图片",iconSvg:'<svg viewBox="0 0 1024 1024"><path d="M959.877 128l0.123 0.123v767.775l-0.123 0.122H64.102l-0.122-0.122V128.123l0.122-0.123h895.775zM960 64H64C28.795 64 0 92.795 0 128v768c0 35.205 28.795 64 64 64h896c35.205 0 64-28.795 64-64V128c0-35.205-28.795-64-64-64zM832 288.01c0 53.023-42.988 96.01-96.01 96.01s-96.01-42.987-96.01-96.01S682.967 192 735.99 192 832 234.988 832 288.01zM896 832H128V704l224.01-384 256 320h64l224.01-192z"></path></svg>',menuKeys:["insertImage","uploadImage"]},"insertTable","codeBlock","divider","|"]},f={placeholder:s,autoFocus:!1,readOnly:t};M.useEffect(()=>()=>{if(l!=null){try{l==null||l.destroy()}catch(p){console.warn("Error destroying editor:",p)}c(null)}},[l]),M.useEffect(()=>{try{if(typeof e!="string"){console.warn("RichEditor: value prop must be a string");return}const p=e||"";u(p),l&&typeof l.setHtml=="function"&&l.setHtml(p)}catch(p){console.warn("Error setting editor content:",p)}},[e,l]);const g=p=>{if(!t)try{const m=p.getHtml();u(m),n&&!t&&n(m)}catch(m){console.warn("Error handling editor change:",m)}};return typeof e!="string"?ee.jsx("div",{children:"Invalid content type"}):ee.jsx(ee.Fragment,{children:ee.jsx(j$e,{fallback:ee.jsx("div",{dangerouslySetInnerHTML:{__html:Xoe(d)}}),children:ee.jsxs("div",{style:{border:a.length===0?"none":"1px solid #E5E5E5",zIndex:99,borderRadius:"10px"},className:"ques-richeditor",children:[a.length>0&&ee.jsx(ZQ.Toolbar,{editor:l,defaultConfig:h,mode:"default",style:{borderBottom:"1px solid #E5E5E5"}}),M.version&&ee.jsx(ZQ.Editor,{defaultConfig:f,value:d,onCreated:p=>{try{c(p)}catch(m){console.warn("Error creating editor:",m)}},onChange:g,mode:"default",style:{height:o?`${o}px`:"auto",padding:"10px"}}),!M.version&&ee.jsx("div",{dangerouslySetInnerHTML:{__html:Xoe(d)}})]})})})});function Xoe(i){try{return f9e.sanitize(i,{FORBID_TAGS:["style"]})}catch{return i}}function Ex(i){const{score:e,className:t,style:n,disabled:s=!0,max:r=100,id:o,name:a}=i,[l,c]=M.useState(e);M.useEffect(()=>{c(e)},[e]);const d=u=>{var f,g;const h=u.target.value;if(h===""){c(Number(h)),(f=i.onChange)==null||f.call(i,h);return}/^\d*$/.test(h)&&Number(h)>=0&&Number(h)<=r&&(c(Number(h)),(g=i.onChange)==null||g.call(i,Number(h)))};return ee.jsxs("div",{className:Ne(["ques-scoreinput ques-center",t]),style:n,children:[ee.jsxs("span",{children:["分数",ee.jsx("span",{className:"ques-scoreinput-red",children:"*"})]}),ee.jsx(n_,{disabled:s,value:l,style:{width:60},onChange:d,id:o,name:a})]})}const g9e=()=>ee.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[ee.jsx("circle",{cx:"6",cy:"6",r:"6",fill:"#52C41A"}),ee.jsx("path",{d:"M4.5 6L5.5 7L8.5 4",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]}),Zoe=()=>ee.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[ee.jsx("circle",{cx:"6",cy:"6",r:"6",fill:"#FF4D4F"}),ee.jsx("path",{d:"M4 4L8 8M8 4L4 8",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]}),p9e=()=>ee.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[ee.jsx("circle",{cx:"6",cy:"6",r:"6",fill:"#FA8C16"}),ee.jsx("path",{d:"M6 3.5V7M6 8.5H6.01",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]});function qN(i){const{tipType:e}=i,t={correct:"回答正确!",incorrect:"回答错误!",warning:"请完成作答!",reanswerIncorrect:"回答错误,请重新作答!","":""},n={correct:ee.jsx(g9e,{}),incorrect:ee.jsx(Zoe,{}),warning:ee.jsx(p9e,{}),reanswerIncorrect:ee.jsx(Zoe,{}),"":""};return ee.jsx("div",{className:Ne("answer-tip",`answer-tip-${e}`),children:ee.jsxs("div",{className:"answer-tip-content",children:[ee.jsx("span",{className:"answer-tip-icon",children:n[e]}),ee.jsx("span",{className:"answer-tip-text",children:t[e]})]})})}const M8=({content:i,title:e="答案解析",collapsible:t=!1,defaultExpanded:n=!0,className:s})=>{const[r,o]=M.useState(n),a=()=>{t&&o(!r)};return ee.jsxs("div",{className:Ne("analysis-container",s,{"analysis-collapsible":t,"analysis-expanded":r,"analysis-collapsed":t&&!r}),children:[ee.jsx("div",{className:"analysis-header",onClick:a,style:{cursor:t?"pointer":"default"},children:ee.jsx("span",{className:"analysis-title",children:e})}),ee.jsx("div",{className:"analysis-content",children:i})]})},F8="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAA7NJREFUWEftls1vG1UUxc99M56ZFAlciaQsqDCwQ6BM2rJPWAV1YZvwVSSoK7FASKjpli7qIvYJ/QNqZ4EqlTZO/4JkTxuPu0EgJCcrJEco3lPPoXc+YidxPE6DVAl15NEbz/i9+3v3nnM9gud8yHOOjxcAY2VgssHKTlnqJy2Xv8rLuSdo/fqpBOla4wGscdfOwf/romw/K8SFBpdILAKg9PDBw09kQ9fKBMjfpe+4aPYcVP7+UFaeBeDCKosh0BBCNKL0MDc2wORdVsTFbbhY6czLleMC+HdYsBysAygkc+uPFvrrZGZg6h4byKFEF+2deXnruADn77MGoEIBBdjuCeaCsmyN1MDULU7Twyw8+OKhBBd5eKA4eBBOYIOnEDzpodWdke4ooPcbvBoSS0hST+LK5sJ+Me/LwKs/clEc3JAJvAIXIh5AF0A8UjwI4u+EXjuod94eXhZNvXGxKcTpCJL46dHHoiLcdxwqwWtLLIQ2fHExG3qY1lEBosAuAk5gAy5a/wAb3Zl+Kg8ufH6VbQEKZCT1rZ5gJigfzli2Bn5hHQ4ua/DOvMyMo4FzDd4QogoNDiAECs2F4RbOBJi8x6uSwzJcrHXmpZwFkKi+HYmOEBpUN8ty86h5mQBpH6CDyk5GH/BrzFsvowlBQXcvguDhR6Ozlgmg5FMPuEsbczsX+y102I7O3eeSIOp2Wvdu6MJvZnTPcQGqnaJUR6Xfv8OKWKiJiXauCThkuWHzxwLIrHuNBXpYNwYFBYBBfXOg242a/58ATP/M2lOrVXTnYrDFEHPBpaMtOgh0YoD3aizBQkOsOPVioRx8JmtZWTvUivNV5l9yUDQCEQPqCBu09JdW9NFmLmKjazlo/vZ17Ot3a5wVg3Vo7S0sP/5Cro0bPNZqcpz9ge2ntYtqKBYoGkxHA0Qwel+v4xoHv3/Tt9c7NVZsC/nHX8nycYLvA3j9JndhkI8AkkDpdTomEAq39ce3x/9nHOmCs1WWYFCMcp1YSXerp9bWJPf1OUOs/Pld/EZz0uPEIvz/AOQXmfdOoRQp34ZEpdBqGMAyYOSERIxQl4TR+0D8My2VA4QCOqlbcqDep0HXIlpH9YW9Epz5nm1j8EYiOHVA7AaVQOrxAYeoJlQbSJyyJ97YxntOimANWsHnw/+U+gDXuStIXJDYMBJgeqYBDzpkEO6Ag/ZcY7DduiRvjnTBmessCqBO6CvfjqdoBrRjDLpCcx/1BAXQMX0+4CJdy1YoYiX4crhrXrjgX4yiGjBINFE/AAAAAElFTkSuQmCC",m9e=i=>{const[e,t]=M.useState(0),n=()=>{t(T=>T+1)},{scenario:s="response",requestId:r,content:o,index:a,elements:l,elementCheckbox:c,elementLabel:d,scoreDisabled:u=!0,returnContent:h,onScore:f}=i,{data:g,parse:p,updateScore:m,userAnswer:b,updateUserAnswer:v,submitted:w,tipType:C,isSubmitting:y,analysisSentence:S,submitForAutoScore:x,isExpanded:k,setIsExpanded:E,onChangeSubmit:I}=Toe(s,r,f);return M.useEffect(()=>{p(o)},[o,p]),M.useEffect(()=>{n()},[w]),M.useEffect(()=>{h&&g&&h(g)},[g,h]),ee.jsx("div",{className:Ne(["ques-radio ques-com"]),children:ee.jsxs("div",{className:"ques-center ques-com-container",children:[ee.jsx("div",{className:"ques-center ques-com-checkbox",children:c}),a!=null&&ee.jsxs("div",{className:"ques-com-index",children:[a,"、"]}),ee.jsxs("div",{className:"ques-com-content",children:[ee.jsxs("div",{className:"ques-com-content-header ques-center",children:[ee.jsx(nr,{type:"type",children:"问答"}),ee.jsx(nr,{type:"auto",children:"自动判分"}),(g==null?void 0:g.validated)===!1&&ee.jsx(nr,{type:"verifyError",children:"AI验证未通过,建议人工调整"}),(g==null?void 0:g.validated)===!0&&ee.jsx(nr,{type:"verifySuccess",children:"AI已验证"})]}),ee.jsx("div",{className:"ques-com-content-title",children:(g==null?void 0:g.text)&&ee.jsx(Nu,{value:g.text})}),ee.jsx("div",{className:"ques-answer-input",children:s!="write"&&(w?ee.jsx(Nu,{value:b,onChange:v,placeholder:"请输入您的答案...",editorHeight:200,readOnly:!0,customToolbarKeys:["undo","redo","fullScreen","|","headerSelect"]},e):ee.jsx(Nu,{value:b,onChange:v,placeholder:"请输入您的答案...",editorHeight:200,readOnly:!1,customToolbarKeys:["undo","redo","fullScreen","|","headerSelect","bold"]},e))}),(g==null?void 0:g.answer)&&s==="write"&&ee.jsx("div",{className:"ques-answer-content",children:ee.jsx(zB,{defaultActiveKey:s==="write"?["1"]:[],ghost:!0,expandIcon:({isActive:T})=>ee.jsx(vN,{rotate:T?90:0}),items:[{key:"1",label:ee.jsxs(ee.Fragment,{children:[ee.jsx("span",{style:{fontWeight:"bold"},children:"参考答案"}),ee.jsx("span",{style:{fontSize:"12px",color:"#999999"},children:"(学生不可见)"})]}),children:ee.jsx(Nu,{value:g.answer})}]})}),C&&ee.jsx(qN,{tipType:C}),s!="write"&&s!=="exam"&&ee.jsx(ee.Fragment,{children:ee.jsxs("div",{className:"ques-answer-actions",children:[ee.jsx("div",{className:Ne(["ques-answer-actions-submit",{"ques-answer-actions-submit-disabled":y}]),onClick:!w&&!y?x:I,style:{cursor:y?"not-allowed":"pointer"},children:y?"判分中...":w?"重新作答":"提交"}),s==="response"&&w&&!y&&ee.jsxs("div",{onClick:()=>E(!k),className:"ques-answer-actions-analysis",children:[ee.jsx("img",{src:F8,alt:"答案解析图标"}),ee.jsx("span",{children:"答案解析"})]})]})}),k&&S&&ee.jsx(M8,{content:S}),d&&ee.jsx("div",{children:d})]}),ee.jsxs("div",{className:"ques-com-control ques-center",children:[(g==null?void 0:g.score)!==void 0&&ee.jsx(Ex,{disabled:u,score:g==null?void 0:g.score,onChange:m}),ee.jsx("div",{className:"ques-com-elements",children:l==null?void 0:l.map((T,N)=>ee.jsx("div",{className:"ques-com-element",children:T},N))})]})]})})},_9e=i=>{const t=lC().use(uC).use(_C).use(pC).parse(i);let n="",s="",r="",o="",a="",l="",c,d=[],u=[];function h(p){if(p.type==="code"){const m=p;if(m.lang==="question"){const b=m.meta||"",v=b.split(/\s+/);n=v[0]||"",s=v[1]||"";const w=b.match(/score=(\d+)/);w&&(c=parseInt(w[1],10));const C=m.value||"",y=C.match(/^#\s*(.+)$/m);y&&(r=y[1].trim());const S=C.match(/^#\s*.+$/m),x=S?S[0]:"",k=x?C.indexOf(x)+x.length:0,E=C.indexOf("<code lang",k),I=C.indexOf("'```",k),T=C.indexOf("```",k);let N=-1;if(E!==-1?N=E:I!==-1?N=I:T!==-1&&(N=T),k>0&&N>k&&(o=C.substring(k,N).trim(),o)){if(console.log(o),o.includes("<pre>"))o=b9e(o);else{const K=o.split(`
276
276
  `);console.log(K),K.length===1?o=`<p>${K[0]}</p>`:K.length>1&&(o=K.map(X=>X.trim()===""?"":`<p>${X}</p>`).join(`
277
277
  `))}console.log(o)}const O=C.match(/<code\s+lang=["'](\w+)["']>\s*([\s\S]*?)\s*<\/code>/),R=C.match(/'```(\w+)\s*\n([\s\S]*?)\n```'/),P=C.match(/```(\w+)\s*\n([\s\S]*?)\n```/);O?(l=O[1],a=O[2].trim()):R?(l=R[1],a=R[2]):P&&(l=P[1],a=P[2]);const $=C.match(/<example>\s*([\s\S]*?)\s*<\/example>/);if($){const K=$[1].trim();try{const X=K.replace(/\[(.*?)\]/g,(W,ne)=>`[${ne.replace(/'/g,'"')}]`);d=JSON.parse(X)}catch(X){console.error("Failed to parse example:",X),console.error("Original content:",K),d=[]}}const q=C.match(/<test>\s*([\s\S]*?)\s*<\/test>/);if(q){const K=q[1].trim();try{const X=K.replace(/\[(.*?)\]/g,(W,ne)=>`[${ne.replace(/'/g,'"')}]`);u=JSON.parse(X)}catch(X){console.error("Failed to parse test:",X),console.error("Test content:",K),u=[]}}}else m.lang&&(l=m.lang,a=m.value||"")}if("children"in p&&Array.isArray(p.children))for(const m of p.children)h(m)}h(t);const g={type:n||"",form:s||"",topic:r||"",text:o,codeText:{lang:l||"",value:a||""},example:d,test:u};return c!==void 0&&(g.score=c),g};function b9e(i){return i.split(/(<pre[\s\S]*?<\/pre>)/).map(t=>t.includes("<pre>")?t:t.trim()?t.split(`
278
278
  `).map(n=>n.trim()?`<p>${n}</p>`:"").join(`
@@ -1,4 +1,4 @@
1
- import { m as et } from "./index-D_ea62nT.js";
1
+ import { m as et } from "./index-BJnwspyu.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
@@ -1,4 +1,4 @@
1
- import { m as f } from "./index-D_ea62nT.js";
1
+ import { m as f } from "./index-BJnwspyu.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
@@ -1,4 +1,4 @@
1
- import { m as l } from "./index-D_ea62nT.js";
1
+ import { m as l } from "./index-BJnwspyu.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
@@ -1,4 +1,4 @@
1
- import { m as s } from "./index-D_ea62nT.js";
1
+ import { m as s } from "./index-BJnwspyu.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
@@ -1,4 +1,4 @@
1
- import { m as lt } from "./index-D_ea62nT.js";
1
+ import { m as lt } from "./index-BJnwspyu.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)