";else{r+=">";let s=!1;for(let o=0;o"}}}else{const t=e.nodeValue.trim();t&&(r+=t)}};const o=(new DOMParser).parseFromString(t,"text/xml");if(o.getElementsByTagName("parsererror").length>0)return void window.showToast(e.xmlErrorMsg||e.xmlFormatError,2500);new XMLSerializer;let r="";n(o.documentElement,0),r=r.trim(),m.dispatch({changes:{from:0,to:m.state.doc.length,insert:r}}),window.showToast(e.xmlValidMsg||e.xmlFormatCorrect,2500)}catch(t){console.error("格式化XML失败:",t),window.showToast(e.xmlErrorMsg||e.xmlFormatError,2500)}}function S(){const t=u.state.doc.toString();t.trim()&&navigator.clipboard.writeText(t).then((()=>{window.showToast(e.copySuccess||e.copySuccess,2500)})).catch((t=>{console.error(e.copyFailure,t)}))}function x(){m.dispatch({changes:{from:0,to:m.state.doc.length,insert:""}}),u.dispatch({changes:{from:0,to:u.state.doc.length,insert:""}})}!function(){try{p(),function(){let e,t;const n=document.querySelector(".bl");r.addEventListener("mousedown",(function(o){h=!0,e=o.clientY,t=parseInt(getComputedStyle(n).height,10),document.body.style.cursor="ns-resize",o.preventDefault()})),document.addEventListener("mousemove",(function(o){if(!h)return;const r=t+(o.clientY-e);r>=150&&r<=800&&(n.style.height=r+"px")})),document.addEventListener("mouseup",(function(e){h&&(h=!1,document.body.style.cursor="",m&&m.requestMeasure(),u&&u.requestMeasure())}))}(),s&&s.addEventListener("click",y),i&&i.addEventListener("click",S),c&&c.addEventListener("click",x),document.querySelectorAll(".bq").forEach((e=>{const t=e.querySelector(".bs");let n;e.addEventListener("mouseenter",(function(){t&&(clearTimeout(n),t.classList.add("show"),n=setTimeout((()=>{t.classList.remove("show")}),1e3))}))}))}catch(t){console.error(e.initFailure,t)}}()}))