function getREQS(){var t=location.search;if(-1!=t.indexOf("?")){var e=t.substr(1);REQS=e.split("&")}}function _gSet(t,e){Object.defineProperty(window,t,{value:e,writable:!1,enumerable:!0,configurable:!1})}function _hSet(t,e){Object.defineProperty(HTMLElement.prototype,t,{value:e,writable:!1,enumerable:!0,configurable:!1})}window._VIXJSVER=5,window.REQS=[],getREQS();for(var i=3;i<9;i++)_gSet("_C"+i,String.fromCharCode(i));_gSet("_RSOB",new ResizeObserver((t=>{for(let e of t){const{width:t,height:n}=e.contentRect;e.target._resizeFun&&e.target._resizeFun(t,n)}})));var vixConst={playIcon:`url(data:image/svg+xml,${encodeURIComponent('')})`,svgTxt:`url(data:image/svg+xml,${encodeURIComponent('')})`,headHelper:`url(data:image/svg+xml,${encodeURIComponent('')})`};window.vixBus={map:{},on(t,e){(this.map[t]=this.map[t]||[]).push(e)},send(t,e){(this.map[t]||[]).forEach((t=>t(e)))}},Array.prototype.shuffle=function(){for(var t,e,n=this,i=n.length;i;)e=Math.floor(Math.random()*i--),t=n[i],n[i]=n[e],n[e]=t;return n},$conLog=function(t,e){var n=document.body.son("div",{position:"absolute",width:"100%",height:"100%",textAlign:"center",backgroundColor:"rgba(0,0,0,0.5)",zIndex:3e6,display:"flex",alignItems:"center",justifyContent:"center",textAlign:"justify",left:0,top:0,opacity:0,transition:"opacity 0.7s ease"});n.tab=n.son("table",{width:"300px",margin:"auto",maxHeight:"800px",borderRadius:"5px 5px 5px 5px",backgroundColor:"rgba(255,255,255,1)"}),n.tab.insertRow(-1).insertCell().css({textAlign:"center",minHeight:"62px",height:"62px",borderBottom:"1px solid #f1f1f1"},{innerHTML:t,colSpan:2});var i=n.tab.insertRow(-1),o=i.insertCell(),s=i.insertCell();o.css({textAlign:"center",height:"42px",borderRight:"1px solid #f1f1f1"},{innerHTML:"取消",onclick:function(){_backRun()}}),s.css({textAlign:"center",height:"42px",color:"#1989fa"},{innerHTML:"确认",onclick:function(){e&&e(),_backRun()}}),n.close=function(){document.body.removeChild(n)},n.tab.onclick=function(){event.stopPropagation()},n.tab.Fly({SS:0}),n.tab.Fly({SS:1,d:800}),setTimeout((function(){n.style.opacity=1}),5),_backKey((function(){n.close()}))};class MOM{constructor(t,e={},n){this.targets=new Set,this.observer=new MutationObserver(n);this.config={attributes:!0,childList:!0,subtree:!1,attributeOldValue:!0,...e};const i=Array.isArray(t)?t:[t];this.add(...i)}add(...t){t.forEach((t=>{this.targets.has(t)||(this.targets.add(t),this.observer.observe(t,this.config))}))}removeTarget(t){this.targets.has(t)&&(this.targets.delete(t),this.observer.unobserve(t))}disconnect(){this.observer.disconnect(),this.targets.clear()}}window.thattsvg=svgToDataUri(''),window.thatfsvg=svgToDataUri('');class PeriodicRequester{constructor(t,e,n,i){this.url=t,this.interval=e,this.action=n,this.ection=i,this.currentController=null,this.timer=null}start(){if(null!==this.timer)return;const t=()=>{this.currentController&&this.currentController.abort(),this.currentController=new AbortController;const t=this.currentController.signal;fetch(this.url,{signal:t}).then((t=>{if(!t.ok)throw new Error("Network response was not ok");return t.json()})).then((t=>{this.action(t)})).catch((t=>{"AbortError"===t.name?console.log("Request was aborted"):this.ection(t)}))};t(),this.timer=setInterval(t,this.interval)}stop(){null!==this.timer&&(clearInterval(this.timer),this.timer=null),this.currentController&&this.currentController.abort()}}class touchPad{constructor(t,e,n=100){this.element=t,this.startX=0,this.startY=0,this.accumulatedDx=0,this.accumulatedDy=0,this.isDragging=!1,this.externalMoveBy=e,this.element.addEventListener("touchstart",this.onTouchStart.bind(this)),this.element.addEventListener("touchmove",this.onTouchMove.bind(this)),this.element.addEventListener("touchend",this.onTouchEnd.bind(this)),this.element.addEventListener("mousedown",this.onMouseDown.bind(this)),document.addEventListener("mousemove",this.onMouseMove.bind(this)),document.addEventListener("mouseup",this.onMouseUp.bind(this)),this.element.addEventListener("wheel",this.onWheel.bind(this)),this.throttledMoveBy=this.throttle(this._moveBy.bind(this),n)}onTouchStart(t){const e=t.touches[0];this.startX=e.clientX,this.startY=e.clientY}onTouchMove(t){t.preventDefault();const e=t.touches[0],n=e.clientX-this.startX,i=4*(e.clientY-this.startY);this.startX=e.clientX,this.startY=e.clientY,this.accumulatedDx+=n,this.accumulatedDy+=i,this.throttledMoveBy()}onTouchEnd(t){this.accumulatedDx=0,this.accumulatedDy=0,console.log("Touch ended, reset accumulated dx/dy")}onMouseDown(t){this.startX=t.clientX,this.startY=t.clientY,this.isDragging=!0}onMouseMove(t){if(!this.isDragging)return;const e=t.clientX-this.startX,n=t.clientY-this.startY;this.startX=t.clientX,this.startY=t.clientY,this.accumulatedDx+=e,this.accumulatedDy+=n,this.throttledMoveBy()}onMouseUp(t){this.isDragging&&(this.accumulatedDx=0,this.accumulatedDy=0,this.isDragging=!1,console.log("Mouse drag ended, reset accumulated dx/dy"))}onWheel(t){const e=t.deltaX,n=.25*t.deltaY;this.accumulatedDx+=e,this.accumulatedDy+=n,this.throttledMoveBy()}_moveBy(){this.externalMoveBy(this.accumulatedDx,this.accumulatedDy),this.accumulatedDx=0,this.accumulatedDy=0}throttle(t,e){let n=0;return function(...i){const o=Date.now();o-n>=e&&(t(...i),n=o)}}}class SplitterPane{constructor(t,e){this.container=t,this.layout=e,this.splitter=t.son("div",{left:t.offsetWidth/2-10,top:t.offsetHeight/2-10,width:20,height:20,position:"absolute",backgroundColor:"rgba(20, 20, 20, 0.3)",borderRadius:"20px",cursor:"move",zIndex:10}),this.panes=[],this.isDragging=!1,this.startX=0,this.startY=0,this.resizex=null,this.initialize(),t.addEventListener("click",(e=>{if(e.ctrlKey){const n=t.getBoundingClientRect();this.splitter.css({left:e.clientX-n.left-10,top:e.clientY-n.top-10}),this.updatePanes()}}))}initialize(){let t=0;switch(this.layout){case"S4P":t=4;break;case"S3T":case"S3U":case"S81":case"S18":t=3;break;default:return void console.error("Unknown layout type")}for(let e=0;e{t.preventDefault(),this.isDragging=!0,this.splitter.style.cursor="move",this.startX=t.clientX,this.startY=t.clientY})),document.addEventListener("mousemove",(t=>{if(!this.isDragging)return;t.preventDefault();const e=this.container.getBoundingClientRect();let n=this.splitter.offsetLeft+t.clientX-this.startX,i=this.splitter.offsetTop+t.clientY-this.startY;n=Math.max(0,Math.min(n,e.width-this.splitter.offsetWidth)),i=Math.max(0,Math.min(i,e.height-this.splitter.offsetHeight)),this.splitter.style.left=`${n}px`,this.splitter.style.top=`${i}px`,this.updatePanes(),this.startX=t.clientX,this.startY=t.clientY})),document.addEventListener("mouseup",(()=>{this.isDragging&&(this.isDragging=!1,this.splitter.style.cursor="move")}))}initSplitterPosition(){this.updatePanes()}updatePanes(){const t=this.container.getBoundingClientRect(),e=this.splitter.getBoundingClientRect();switch(this.layout){case"S4P":this.updatePanesS4P(t,e);break;case"S3T":this.updatePanesS3T(t,e);break;case"S3U":this.updatePanesS3U(t,e);break;case"S81":this.updatePanesS81(t,e);break;case"S18":this.updatePanesS18(t,e);break;default:console.error("Unknown layout type")}this.resizex&&this.resizex()}updatePanesS4P(t,e){this.panes[0].css({top:0,left:0,width:e.left-t.left+10,height:e.top-t.top+10}),this.panes[1].css({top:0,left:e.right-t.left-10,width:t.right-e.right+10,height:e.top-t.top+10}),this.panes[2].css({top:e.bottom-t.top-10,left:e.right-t.left-10,width:t.right-e.right+10,height:t.bottom-e.bottom+10}),this.panes[3].css({top:e.bottom-t.top-10,left:0,width:e.left-t.left+10,height:t.bottom-e.bottom+10})}updatePanesS3T(t,e){this.panes[0].css({top:0,left:0,width:t.width,height:e.top-t.top+10}),this.panes[1].css({top:e.top-t.top+10,left:0,width:e.left-t.left+10,height:t.bottom-e.top-10}),this.panes[2].css({top:e.top-t.top+10,left:e.right-t.left-10,width:t.right-e.right+10,height:t.bottom-e.top-10})}updatePanesS3U(t,e){this.panes[0].css({top:0,left:0,width:e.left-t.left+10,height:e.top-t.top+10}),this.panes[1].css({top:0,left:e.right-t.left-10,width:t.right-e.right+10,height:e.top-t.top+10}),this.panes[2].css({top:e.top-t.top+10,left:0,width:t.width,height:t.bottom-e.top-10})}updatePanesS81(t,e){this.panes[0].css({top:0,left:0,width:e.left-t.left+10,height:e.top-t.top+10}),this.panes[1].css({top:e.top-t.top+10,left:0,width:e.left-t.left+10,height:t.bottom-e.top-10}),this.panes[2].css({top:0,left:e.right-t.left-10,width:t.right-e.right+10,height:t.bottom-t.top})}updatePanesS18(t,e){this.panes[0].css({top:0,left:0,width:e.left-t.left+10,height:t.bottom-t.top}),this.panes[1].css({top:0,left:e.right-t.left-10,width:t.right-e.right+10,height:e.top-t.top+10}),this.panes[2].css({top:e.bottom-t.top-10,left:e.right-t.left-10,width:t.right-e.right+10,height:t.bottom-e.bottom+10})}}var w20796_success=!1;function $ilog(t,e=3e3){w20796_success||(w20796_success=document.body.son("table",{position:"fixed",maxWidth:"60%",top:"10px",right:"10%",fontSize:"16px",zIndex:3e4,borderSpacing:"10px"})),w20796_success.show();const n=w20796_success.insertRow(-1),i=n.insertCell();i.css({border:"2px solid #a0d911",backgroundColor:"#f6ffed",borderRadius:"10px",color:"#389e0d",fontWeight:"bold",padding:"12px 16px",boxShadow:"0 4px 20px rgba(0,200,0,0.3)",transition:"all .25s ease",transform:"scale(1)",opacity:.98,cursor:"pointer",display:"flex",alignItems:"center",gap:"8px"});const o=document.createElement("span");o.textContent="✅",o.style.fontSize="18px",i.prepend(o),i.innerText+=" "+t,i.animate([{transform:"scale(1)",offset:0},{transform:"scale(1.05)",offset:.2},{transform:"scale(0.98)",offset:.4},{transform:"scale(1.02)",offset:.6},{transform:"scale(1)",offset:1}],{duration:400,easing:"ease-out"}),i.onclick=()=>{i.style.transform="translateY(-10px)",i.style.opacity=0,setTimeout((()=>{$cle(i.parentElement),0===w20796_success.rows.length&&w20796_success.hide()}),300)},e>0&&setTimeout((()=>{i.style.transform="translateY(-10px)",i.style.opacity=0,setTimeout((()=>{$cle(n),0===w20796_success.rows.length&&w20796_success.hide()}),300)}),e)}$clog=$ilog;var w20797=!1;function $elog(t,e=3e3){w20797||(w20797=document.body.son("table",{position:"fixed",maxWidth:"60%",top:"10px",right:"10%",fontSize:"16px",zIndex:3e4,borderSpacing:"10px"})),w20797.show();const n=w20797.insertRow(-1),i=n.insertCell();i.css({border:"2px solid #ff4d4f",backgroundColor:"#ffeded",borderRadius:"10px",color:"#b00000",fontWeight:"bold",padding:"12px 16px",boxShadow:"0 4px 20px rgba(255,0,0,0.4)",transition:"all .25s ease",transform:"scale(1)",opacity:.98,cursor:"pointer",display:"flex",alignItems:"center",gap:"8px"});const o=document.createElement("span");o.textContent="⚠️",o.style.fontSize="18px",i.prepend(o),i.innerText+=" "+t,i.animate([{transform:"scale(1)",offset:0},{transform:"scale(1.05)",offset:.2},{transform:"scale(0.98)",offset:.4},{transform:"scale(1.02)",offset:.6},{transform:"scale(1)",offset:1}],{duration:400,easing:"ease-out"}),i.onclick=()=>{i.style.transform="translateY(-10px)",i.style.opacity=0,setTimeout((()=>{$cle(i.parentElement),0===w20797.rows.length&&w20797.hide()}),300)},e>0&&setTimeout((()=>{i.style.transform="translateY(-10px)",i.style.opacity=0,setTimeout((()=>{$cle(n),0===w20797.rows.length&&w20797.hide()}),300)}),e)}function videoCanvasPan(t,e,n={}){n=OPlus({autoplay:!1,loop:!1,controls:!1,muted:!0,poster:"",buttonOpacity:.5},n),t.clc();let i=t.son("div",{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:"none"}).son("div",{background:"#fff",border:"0px solid #000",boxSizing:"border-box"});const o=t.son("video",{position:"absolute",left:0,top:0,width:10,height:10,opacity:.01,pointerEvents:"none"});o.src=e,o.setAttribute("playsinline","playsinline"),o.setAttribute("webkit-playsinline","webkit-playsinline"),o.setAttribute("muted","muted"),o.muted=!0,n.autoplay&&o.setAttribute("autoplay","autoplay"),n.loop&&o.setAttribute("loop","loop"),n.poster&&(o.poster=n.poster);const s=t.son("canvas",{position:"absolute",left:0,top:0,zIndex:10});let r={scale:1,offsetX:0,offsetY:0,dragging:!1,lastX:0,lastY:0,boxW:0,boxH:0,rotate:!1,scale0:1};function l(t,e){return t>=e?"x":"y"}function a(){const e=t.clientWidth,n=t.clientHeight,a=o.videoWidth,d=o.videoHeight;if(!a||!d)return;const c=l(e,n)!==l(a,d);let h=c?d:a,u=c?a:d,p=Math.min(e/h,n/u),f=h*p,g=u*p;i.css({width:f+"px",height:g+"px"});let m=i.getBoundingClientRect(),b=t.getBoundingClientRect(),v=m.left-b.left,L=m.top-b.top;s.width=i.offsetWidth,s.height=i.offsetHeight,s.style.left=v+"px",s.style.top=L+"px",r.boxW=h,r.boxH=u,r.rotate=c,r.scale0=p,r.scale=1,r.offsetX=0,r.offsetY=0}function d(){r.scale=1,r.offsetX=0,r.offsetY=0}function c(t,e){if(!r.rotate)return{x:t,y:e};let n=s.width/2,i=s.height/2;return{x:n-(e-i),y:i+(t-n)}}s.onwheel=t=>{t.preventDefault();let e=s.getBoundingClientRect(),n=t.clientX-e.left,i=t.clientY-e.top,{x:o,y:l}=c(n,i),a=r.scale,d=t.deltaY<0?1.1:.9,h=Math.max(.1,Math.min(10,a*d));console.log("[zoom]",{px:n,py:i,mx:o,my:l,before:{scale:a,offsetX:r.offsetX,offsetY:r.offsetY}}),r.offsetX=o-(o-r.offsetX)*(a/h),r.offsetY=l-(l-r.offsetY)*(a/h),r.scale=h,console.log("[zoom result]",{after:{scale:h,offsetX:r.offsetX,offsetY:r.offsetY}})};s.onmousedown=t=>{let e=s.getBoundingClientRect(),n=t.clientX-e.left,i=t.clientY-e.top,{x:o,y:l}=c(n,i);r.dragging=!0,r.lastX=o,r.lastY=l,console.log("[mousedown]",{px:n,py:i,x:o,y:l,offsetX:r.offsetX,offsetY:r.offsetY})},window.addEventListener("mousemove",(t=>{if(r.dragging){let e=s.getBoundingClientRect(),n=t.clientX-e.left,i=t.clientY-e.top,{x:o,y:l}=c(n,i);r.offsetX+=o-r.lastX,r.offsetY+=l-r.lastY,r.lastX=o,r.lastY=l,console.log("[drag]",{px:n,py:i,x:o,y:l,offsetX:r.offsetX,offsetY:r.offsetY})}})),window.addEventListener("mouseup",(t=>{r.dragging=!1}));let h=0,u=1,p={x:0,y:0},f={x:0,y:0};s.ontouchstart=function(t){if(1===t.touches.length){let e=t.touches[0],n=s.getBoundingClientRect(),i=e.clientX-n.left,o=e.clientY-n.top,{x:l,y:a}=c(i,o);r.dragging=!0,r.lastX=l,r.lastY=a,console.log("[touchstart]",{tx:i,ty:o,x:l,y:a,offsetX:r.offsetX,offsetY:r.offsetY})}else if(2===t.touches.length){r.dragging=!1;const e=t.touches[0],n=t.touches[1];let i=s.getBoundingClientRect(),o=e.clientX-i.left,l=e.clientY-i.top,a=n.clientX-i.left,d=n.clientY-i.top,g=c(o,l),m=c(a,d);h=Math.hypot(m.x-g.x,m.y-g.y),u=r.scale,p={x:(g.x+m.x)/2,y:(g.y+m.y)/2},f={x:r.offsetX,y:r.offsetY},console.log("[pinchstart]",{x1:o,y1:l,x2:a,y2:d,p1:g,p2:m,pinchStartMid:p,pinchStartScale:u,pinchStartOffset:f})}},s.ontouchmove=function(t){if(1===t.touches.length&&r.dragging){let e=t.touches[0],n=s.getBoundingClientRect(),i=e.clientX-n.left,o=e.clientY-n.top,{x:l,y:a}=c(i,o);r.offsetX+=l-r.lastX,r.offsetY+=a-r.lastY,r.lastX=l,r.lastY=a,console.log("[touchdrag]",{tx:i,ty:o,x:l,y:a,offsetX:r.offsetX,offsetY:r.offsetY})}else if(2===t.touches.length){const e=t.touches[0],n=t.touches[1];let i=s.getBoundingClientRect(),o=e.clientX-i.left,l=e.clientY-i.top,a=n.clientX-i.left,d=n.clientY-i.top,g=c(o,l),m=c(a,d);const b=Math.hypot(m.x-g.x,m.y-g.y);let v=u,L=Math.max(.1,Math.min(10,v*(b/h))),y=p,x={x:(g.x+m.x)/2,y:(g.y+m.y)/2},w=f;r.scale=L,r.offsetX=x.x-(y.x-w.x)*(v/L),r.offsetY=x.y-(y.y-w.y)*(v/L),console.log("[pinchmove]",{x1:o,y1:l,x2:a,y2:d,p1:g,p2:m,mid:x,mid0:y,offset0:w,S0:v,S1:L,offsetX:r.offsetX,offsetY:r.offsetY}),t.preventDefault()}},s.ontouchend=function(t){r.dragging=!1},s.ontouchcancel=function(t){r.dragging=!1},s.ondblclick=function(t){d()};let g=t.son("div",{position:"absolute",right:"24px",bottom:"24px",width:"54px",height:"54px",borderRadius:"50%",background:"#1ec01e",opacity:n.buttonOpacity,cursor:"pointer",zIndex:30,userSelect:"none",boxShadow:"0 2px 8px rgba(0,0,0,0.2)",transition:"background 0.2s, opacity 0.2s"});function m(){g.style.background=o.paused?"#1ec01e":"#e52b24",g.title=o.paused?"播放":"暂停"}if(o.addEventListener("play",m),o.addEventListener("pause",m),g.onclick=function(t){t.stopPropagation(),o.paused?(o.muted=!1,o.removeAttribute("muted"),o.volume=1,o.currentTime+=.01,o.play().catch((()=>{}))):o.pause()},m(),o.addEventListener("loadedmetadata",a),o.addEventListener("loadeddata",a),window.addEventListener("resize",a),window.ResizeObserver){new ResizeObserver(a).observe(t)}return setTimeout(a,80),requestAnimationFrame((function t(){const e=s.getContext("2d");if(e.clearRect(0,0,s.width,s.height),!o.videoWidth||!o.videoHeight)return requestAnimationFrame(t);let n=r.boxW/r.scale,i=r.boxH/r.scale,l=-r.offsetX/r.scale,a=-r.offsetY/r.scale;e.save(),r.rotate?(e.translate(s.width/2,s.height/2),e.rotate(Math.PI/2),e.translate(-s.height/2,-s.width/2),e.drawImage(o,l,a,i,n,0,0,s.height,s.width)):e.drawImage(o,l,a,n,i,0,0,s.width,s.height),e.restore(),requestAnimationFrame(t)})),{video:o,canvas:s,fitbox:i,state:r,unmute:function(){o.muted=!1,o.removeAttribute("muted"),o.volume=1,o.currentTime+=.01,o.play().catch((()=>{}))},fitOrg:d}}function videoPan(t,e,n={}){n=Object.assign({autoplay:!1,loop:!1,controls:!0,muted:!1,poster:""},n),t.clc();let i=t.son("div",{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:"none"}).son("div",{background:"#fff",border:"4px solid #000",boxSizing:"border-box"});const o=t.son("video",{position:"absolute",left:0,top:0,background:"none"});o.src=e,o.setAttribute("playsinline","playsinline");for(let t in n)n[t]?o.setAttribute(t,n[t]):o.removeAttribute(t);function s(t,e){return t>=e?"x":"y"}function r(){const e=t.clientWidth,n=t.clientHeight,r=o.videoWidth,l=o.videoHeight;if(!r||!l)return;const a=s(e,n)!==s(r,l);let d=a?l:r,c=a?r:l,h=Math.min(e/d,n/c),u=d*h,p=c*h;i.css({width:u+"px",height:p+"px"});let f=i.getBoundingClientRect(),g=t.getBoundingClientRect(),m=f.left-g.left+i.offsetWidth/2,b=f.top-g.top+i.offsetHeight/2,v=a?i.offsetHeight:i.offsetWidth,L=a?i.offsetWidth:i.offsetHeight;o.style.width=v+"px",o.style.height=L+"px",o.style.left=m+"px",o.style.top=b+"px",o.style.transformOrigin="center center",o.style.transform=a?"translate(-50%,-50%) rotate(90deg)":"translate(-50%,-50%)"}return n.poster&&(o.poster=n.poster),o.addEventListener("loadedmetadata",r),o.addEventListener("loadeddata",r),window.addEventListener("resize",r),setTimeout(r,50),o}function DateDiff(t,e){var n,i,o;return n=t.split("-"),i=new Date(n[1]+"-"+n[2]+"-"+n[0]),n=e.split("-"),o=new Date(n[1]+"-"+n[2]+"-"+n[0]),parseInt(Math.abs(i-o)/1e3/60/60/24)}function GetDateDiff(t,e){var n=new Date(Date.parse(t.replace(/-/g,"/"))).getTime(),i=new Date(Date.parse(e.replace(/-/g,"/"))).getTime();return Math.abs(n-i)/864e5}function getNowFormatDate(){var t=new Date,e=t.getMonth()+1,n=t.getDate();return e>=1&&e<=9&&(e="0"+e),n>=0&&n<=9&&(n="0"+n),t.getFullYear()+"-"+e+"-"+n+" "+t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()}function calculateTimeDifference(t){const e=new Date(t),n=new Date-e;let i=Math.floor(n/864e5);const o=Math.floor(n%864e5/36e5),s=Math.floor(n%36e5/6e4),r=Math.floor(n%6e4/1e3);i=i||"";return`${i} ${o.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`}function formatNumber(t,e,n){var i;return!isNaN(parseFloat(t))&&isFinite(t)?(t=Number(t),(i=(t=(void 0!==e?t.toFixed(e):t).toString()).split("."))[0]=i[0].toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+(n||",")),i.join(".")):NaN}function checkItems(t,e){var n=t.split(","),i=[];return n.forEach((function(t){i.push({type:"checkbox",name:t,label:t}),t==e&&i.push({type:"newcolumn"})})),i}function getLenPx(t,e){return t.replace(/[^\x00-\xff]/gi,"aa").length*e/2}function myStrParse(t){const e=t.match(/([^{()\[\]]*)(\(([^()]+)\))?(\{([^{}]+)\})?(\[([^\[\]]+)\])?/);let[n,i,o,s,r,l,a,d]=e;i=i.trim();let c=!1;return"^"===i.charAt(0)&&(c=!0,i=i.substring(1)),{str:i.trim(),c:s?s.trim():null,vs:l?l.trim():null,v:d?d.trim():null,d:c}}function generateUniqueString(){let t=Date.now().toString(36),e=Math.random().toString(36).substring(2,8);return t.slice(-4)+e.slice(0,4)}Date.prototype.fmt=function(t){null!=t&&""!=t||(t="y-m-d");var e=this.getFullYear(),n=this.getMonth()+1,i=this.getDate(),o=t.replace(/y+/gi,e);return o=(o=o.replace(/m+/gi,(n<10?"0":"")+n)).replace(/d+/gi,(i<10?"0":"")+i)},Date.prototype.Format=function(t){var e={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var n in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),e)new RegExp("("+n+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[n]:("00"+e[n]).substr((""+e[n]).length)));return t},String.prototype.right=function(t){var e=this.length-t;return e<0&&(e=0),this.substring(this.length-t,this.length)},_C4=String.fromCharCode(4),_C3=String.fromCharCode(3),_C5=String.fromCharCode(5),_a_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",String.prototype.xor=function(t){for(var e="",n=0;n127||94==this.charCodeAt(e)?t+=2:t++;return t},String.prototype.format=function(){var t=arguments;return this.replace(/\{(\d+)\}/g,(function(e,n){return t[n]}))},String.prototype.$=function(){var t=this.replaceAll(_C3,"\r");return t=this.replaceAll(_C4,"\n"),unescape(t)},String.prototype._=function(){var t=this.replaceAll("\n","");return t=(t=(t=(t=t.replaceAll(":",":")).replaceAll("\r","")).replaceAll(",",",")).replaceAll(" ","")},ustring=function(t){var e=String.fromCharCode(4);r=t[0];for(var n=1;n{"function"!=typeof this[t]&&(s[t]=this[t])}));const r={};i.forEach((n=>{if("function"==typeof this[n]){const i=Object.getOwnPropertyNames(HTMLElement.prototype).includes(n);!t&&(e.has(n)||i||n.startsWith("on"))||(r[n]=this[n])}}));return{tag:`${this.tagName.toLowerCase()}${this.id?`#${this.id}`:""}${this.className?`.${this.className.trim().split(/\s+/).join(".")}`:""}`,props:s,methods:r}},HTMLElement.prototype.$css=function(t,e){var n,i;for(n in t)t.hasOwnProperty(n)&&null!==(i=pfx(n))&&(this.style[i]=t[n]);if(e)for(var o in e)o.startsWith("___")?this.setAttribute(o.substring(3),e[o]):this[o]=e[o];return this.init&&this.init(),this.iPos&&this.Fly(this.iPos),this},HTMLElement.prototype.css=function(t,e){var n,i;for(n in t)t.hasOwnProperty(n)&&null!==(i=pfx(n))&&(this.style[i]=t[n]);if(e)for(var o in e)o.startsWith("___")?this.setAttribute(o.substring(3),e[o]):this[o]=e[o];return this.iPos&&this.Fly(this.iPos),this},HTMLElement.prototype.addBackImg=function(t,e,n,i){var o=this;let s=t+", "+getComputedStyle(o).backgroundImage,r=e+", "+getComputedStyle(o).backgroundPosition,l=n+", "+getComputedStyle(o).backgroundSize;return o.style.backgroundImage=s,o.style.backgroundPosition=r,o.style.backgroundSize=l,o},HTMLElement.prototype.removeBackImg=function(t){var e=this;let n=getComputedStyle(e).backgroundImage.split(", "),i=getComputedStyle(e).backgroundPosition.split(", "),o=getComputedStyle(e).backgroundSize.split(", "),s=n.findIndex((e=>e.includes(t)));return-1!==s&&(n.splice(s,1),i.splice(s,1),o.splice(s,1)),e.style.backgroundImage=n.join(", "),e.style.backgroundPosition=i.join(", "),e.style.backgroundSize=o.join(", "),e},HTMLElement.prototype.scrollbarWidth=function(){return this.offsetWidth-this.clientWidth},HTMLElement.prototype.rED=function(t,e,n,i=!1){function o(){event.stopPropagation()}this.oncontextmenu=function(){return!1},this.onmousedown=function(){2==event.button&&(this._bgc=this.style.backgroundColor,this._c=this.style.color,this._btxt=this.innerText,this.innerText==this.ph&&(this.innerText=""),this.contentEditable=!0,this.style.backgroundColor="#FFA",this.style.color="#000",this.addEventListener("mouseup",o,!1),this.addEventListener("mousedown",o,!1),this.addEventListener("click",o,!1),i||this.addEventListener("keydown",(function(t){"Enter"===t.key&&(t.preventDefault(),this.blur())}),!1),t&&t(this),this.onblur=function(){this.contentEditable=!1,this.style.backgroundColor=this._bgc,this.style.color=this._c,e&&e(this),this.removeEventListener("mouseup",o),this.removeEventListener("mousedown",o),this.removeEventListener("click",o),i||this.removeEventListener("keydown",o)})},this.addEventListener("paste",(function(t){n?n(event):function(t){var e=t||window.event;e.preventDefault();var n=(e.originalEvent||e).clipboardData.getData("text/plain")||prompt("在这里输入文本");document.execCommand("insertText",!1,n)}(t)}))},_hSet("DF",(function(t){var e=this;function n(n){var i=n.name.split(".").pop().toLowerCase(),o=new FileReader;switch(i){case"svg":case"txt":case"js":case"json":case"cfg":case"py":case"html":case"c":case"md":case"css":o.readAsText(n);break;case"png":case"mp3":case"jpg":case"mp4":case"gif":case"pdf":case"wav":case"docx":case"xlsx":case"webp":o.readAsDataURL(n)}o.onload=function(){t.call(e,this.result,i,"f",n)}}document.body.ondragover=function(t){t.preventDefault()},document.body.ondrop=function(t){t.preventDefault()},e.ondragover=function(t){t.preventDefault()},e.ondrop=function(i){i.preventDefault();var o=i.dataTransfer.files;if(o.length>0)for(var s=0;st.preventDefault(),document.body.ondrop=t=>t.preventDefault(),t.ondragenter=function(e){e.preventDefault(),t.css({outline:"2px dashed #3af",backgroundColor:"rgba(0,150,255,0.05)"})},t.ondragleave=function(e){e.preventDefault(),t.css({outline:"",backgroundColor:""})},t.ondragover=function(t){t.preventDefault()},t.ondrop=function(n){n.preventDefault(),t.css({outline:"",backgroundColor:""});const i=n.dataTransfer,o=i.files;if(o&&o.length>0)for(let t=0;t=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)},HTMLElement.prototype.LRSwipe=function(t,e,n){var i,o,s=e||100;this.__gesture=!1;var r=this;this.onmousedown=function(t){r.__gesture=!0,i=t.clientX,o=t.clientY},this.onmouseup=function(e){r.__gesture=!1,i=e.clientX-i,o=e.clientY-o,t&&Math.abs(i)>=s?t.call(r,i):Math.abs(o)>=s&&n&&n.call(r,o)},this.ontouchstart=function(t){r.__gesture=!0,i=t.touches[0].clientX,o=t.touches[0].clientY},this.ontouchend=function(e){r.__gesture=!1,i=e.changedTouches[0].clientX-i,o=e.changedTouches[0].clientY-o,t&&Math.abs(i)>=s?t.call(r,i):Math.abs(o)>=s&&n&&n.call(r,o)}},HTMLElement.prototype.toJpg=function(t,e){const n=this,i=document.createElement("canvas"),o=i.getContext("2d");i.width=n.offsetWidth,i.height=n.offsetHeight,o.fillStyle="white",o.fillRect(0,0,i.width,i.height);const s=n.cloneNode(!0).outerHTML,r=`\n \n \n ${s}\n \n `,l=new Image;l.onload=()=>{o.drawImage(l,0,0,i.width,i.height);const n=i.toDataURL("image/jpeg",t);e&&e(n)},l.onerror=()=>{console.error("Failed to load image")},l.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(r)},HTMLElement.prototype.p2j=function(t,e){const n=Object.getOwnPropertyNames(this),i={};for(const t of n)i[t]=this[t];return i},HTMLElement.prototype.hasPointerEventsNone=function(){for(var t=this;t&&t!==document;){if("none"===window.getComputedStyle(t).pointerEvents)return!0;t=t.parentNode}return!1},HTMLElement.prototype._ltrb=function(){const t=this,e=t.offsetParent;if(!e)return null;const n=e.offsetWidth,i=e.offsetHeight,o=t.offsetLeft,s=t.offsetTop,r=n-o-t.offsetWidth,l=i-s-t.offsetHeight,a=t.offsetHeight,d=t.offsetWidth;return this.LTRB={w:d,h:a,l:o,t:s,r:r,b:l},{w:d,h:a,l:o,t:s,r:r,b:l}};var index20635=2021;function T(){return(new Date).getTime()}function _TT(){return parseInt(T()/6e4-23869797)}function $floor(t){return Math.floor(Math.random()*t)}function isEmptyObj(t){return 0===Object.keys(t).length&&t.constructor===Object}function Oplus(...t){const e={};for(const n of t)n&&"object"==typeof n&&Object.assign(e,n);return e}function getVs(keys){const keyArr=keys.split(",");for(let i=0;i{var i=document.createElement("script");i.type="module",i.src=t,i.onload=e,i.onerror=n,document.head.appendChild(i)}))}function loadjsmod(t,e,n){var i=document.createElement("script");i.type="module",i.src=t,i.onload=function(){"function"==typeof e&&e()},i.onerror=function(t){"function"==typeof n&&n(t)},document.head.appendChild(i)}function loadLink(t){const e=document.createElement("link");e.rel="manifest",e.href=t,document.head.appendChild(e)}function loadJLink(t){const e=new Blob([t],{type:"application/json"}),n=URL.createObjectURL(e),i=document.createElement("link");i.rel="manifest",i.href=n,document.head.appendChild(i)}function ex_0(t){if(t.startsWith("(")&&t.endsWith(")")){let e=0,n=!0;for(let i=1;i{if("object"==typeof n&&null!==n){if(e.has(n))return;e.add(n)}return n instanceof HTMLElement?void 0:n}));return JSON.parse(n)}function _TTS(t,e=0,n="zh-CN"){function i(){var i=window.speechSynthesis.getVoices(),o=new SpeechSynthesisUtterance(t);i.length>0&&e>=0&&e{i(),window.speechSynthesis.onvoiceschanged=null}:i()}function mySVGTXT(t,e=20,n="#a00",i="transparent",o=.7){const s=((t,e,n,i)=>{let o=0,s=0;for(const e of t)e.match(/[\u4e00-\u9fa5]/)?s++:o++;return{width:o*e*n+s*e*i,height:e}})(t,e,.6,1);return`\n \n ${t}\n \n `}function extractMethods(t){const e={};for(const n in t)if("function"==typeof t[n]){const i=t[n].toString().match(/\(([^)]*)\)/),o=i?i[1].split(",").map((t=>t.trim())):[];e[n]=o}return e}function calcAge(t){const e=new Date,n=new Date(t);let i=e.getFullYear()-n.getFullYear();const o=e.getMonth()-n.getMonth(),s=e.getDate()-n.getDate();return(o<0||0===o&&s<0)&&i--,i}function setVerticalRange(t){const e=t.parentElement,n=e.clientWidth,i=e.clientHeight;t.style.width=`${i}px`,t.style.height=`${n}px`,t.style.transform="rotate(-90deg)",t.style.transformOrigin="center center",t.style.display="block",t.style.margin="0 auto"}function generateRoomNo(){return`${Date.now().toString(36).substring(6)}${Math.random().toString(36).substr(2,6)+"_"+wx.user.id}`}function filePost(t,e,n,i,o){const s=new XMLHttpRequest;s.open("POST",e+encodeURI(t.name),!0),s.upload.onprogress=function(t){if(t.lengthComputable){const e=t.loaded/t.total*100;n(e)}},s.onload=function(){200===this.status?i():o(this.statusText)},s.onerror=function(){$clog("XHR错误:",s.statusText),o(s.statusText)};const r=new FileReader;r.readAsArrayBuffer(t),r.onload=()=>{s.send(r.result)},r.onerror=t=>{$clog("文件读错误:",t),o(t)}}function throttle(t,e){let n;return function(){const i=arguments,o=this;n||(t.apply(o,i),n=!0,setTimeout((()=>n=!1),e))}}function debounce0(t,e){let n;return function(){const i=this,o=arguments;clearTimeout(n),n=setTimeout((()=>{t.apply(i,o)}),e)}}function isInViewport(t,e){var n=t.offsetTop-e.offsetTop,i=n-e.scrollTop,o=e.scrollTop+e.clientHeight-4-n;return i<0?1:o<0?-1:0}function image2array(t,e,n){return new Promise(((i,o)=>{const s=new Image;s.crossOrigin="Anonymous",s.src=t,s.onload=()=>{const t=document.createElement("canvas"),o=t.getContext("2d"),r=s.width,l=s.height,a=r/n,d=l/e;t.width=a,t.height=d;const c=[];for(let i=0;i{o(t)}}))}async function camList(){try{return(await navigator.mediaDevices.enumerateDevices()).filter((t=>"videoinput"===t.kind))}catch(t){return console.error("枚举摄像头时发生错误:",t),[]}}function Monaco(t,e){return new Promise(((n,i)=>{const o=Object.assign({},{containerId:"",value:'// Some initial code\nconsole.log("Hello, world!")',language:"javascript",theme:"vs-dark",lineNumbersMinChars:4,lineDecorationsWidth:0},e);if(null===document.getElementById("monaco-loader-script")){var s=document.createElement("script");s.id="monaco-loader-script",s.src="/monaco-editor/vs/loader.js",s.onload=function(){window.require.config({paths:{vs:"/monaco-editor/vs"}}),window.require(["vs/editor/editor.main"],(function(){const e=monaco.editor.create(t,{value:o.value,language:o.language,theme:o.theme,lineNumbersMinChars:o.lineNumbersMinChars});n(e)}))},s.onerror=i,document.head.appendChild(s)}else window.require(["vs/editor/editor.main"],(function(){const e=monaco.editor.create(t,{value:o.value,language:o.language,theme:o.theme,lineNumbersMinChars:o.lineNumbersMinChars});n(e)}))}))}function uploadFile(t,e,n,i,o){const s=new XMLHttpRequest;s.open("POST",e,!0),s.upload.onprogress=function(t){if(t.lengthComputable){const e=t.loaded/t.total*100;o&&o(e)}},s.onload=function(){200===s.status?n&&n(s.responseText):i&&i(s.status,s.statusText)},s.onerror=function(){i&&i(s.status,s.statusText)};const r=new FileReader;r.readAsArrayBuffer(t),r.onload=()=>{s.send(r.result)},r.onerror=function(t){i&&i(0,t.toString())}}function scaleSvg(t,e){const n=t.width.baseVal.value/e,i=t.height.baseVal.value/e;t.setAttribute("viewBox",`0 0 ${n} ${i}`)}function pieIt(t,e="#F00",n){t.css({},{}),t.myHTML(' '.replace("#F00",e));var i=t.children[0];if(i.setAttribute("preserveAspectRatio","none"),i.setAttribute("width",t.offsetWidth),i.setAttribute("height",t.offsetHeight),t.___v=0,n){var o=n/100*502.4;t._ev.pie.setAttribute("stroke-dasharray",`${o}, 502.4`),t.___v=n}Object.defineProperty(t,"v",{get:function(){return this.___v},set:function(e){this.___v=e;var n=2*Math.PI*65,i=n*(e/100);t._ev.pie.setAttribute("stroke-dasharray",`${i}, ${n}`)}})}function fixSvgViewBox(t){let e=t.match(/width=["'](\d+)(px)?["']/),n=t.match(/height=["'](\d+)(px)?["']/),i=t.includes("viewBox=");if(e&&n&&!i){const i=e[1],o=n[1];t=t.replace(/]*?)>/,``)}return t}function bImg(t){const e=t.replace(/\n|\r|\s/g,"");return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function svgURL(t){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}function svgToDataUri(t){return`url('data:image/svg+xml;utf8,${encodeURIComponent(t)}')`}function svgData(t){return`data:image/svg+xml,${encodeURIComponent(t)}`}function getFileExt(t){const e=t.lastIndexOf(".");return-1===e||0===e||t.includes(",")?"":t.slice(e+1)}function OPEval(t,e){for(let n in t)t.hasOwnProperty(n)&&e(n,t[n])}function gColor(t,e){return`hsl(${137.508*t%360}, ${80+t%2*10}%, ${40+t%2*20}%,${e||1})`}function hslT1oRgb(t,e,n){const i=e*Math.min(n,1-n),o=(e,o=(e+t/30)%12)=>n-i*Math.max(Math.min(o-3,9-o,1),-1);return[255*o(0),255*o(8),255*o(4)]}function rgbT1oHex(t,e,n){return"#"+[t,e,n].map((t=>{const e=Math.round(t).toString(16);return 1===e.length?"0"+e:e})).join("")}function getDistinct_Color(t){const e=43*t%360,n=.8+t%2*.1,i=.4+t%2*.2,[o,s,r]=hslT1oRgb(e,n,i);return rgbT1oHex(o,s,r)}function deepRemove(t){if(t){var e=t.cloneNode(!1);t.parentNode.replaceChild(e,t);for(var n=e.firstChild;n;)deepRemove(n),n=n.nextSibling;e.parentNode.removeChild(e)}}function deepClear(t){if(t)for(var e=t.firstChild;e;){var n=e.nextSibling;deepRemove(e),e=n}}function etb(t,e={},n,i,o){return t.son("table",Oplus({width:"100%",height:"100%",borderCollapse:"collapse",tableLayout:"fixed",borderSpacing:0,cellPadding:0,cellSpacing:0},e),{cellPadding:0,cellSpacing:0,ccss:o||{padding:5},init:function(){for(var t=0;t');return e=e.replace(/\[mpf(\d+)\]/g," ")}function xClick(t,e,n,i){let o=null,s=null,r=null;let l=0,a=0;function d(e){e.preventDefault(),r=Date.now(),a=0,s=setTimeout((()=>{s=null,i(t)}),500)}function c(){clearTimeout(s),clearTimeout(o),a=0}t.addEventListener("mousedown",d),t.addEventListener("mouseup",(function(i){clearTimeout(s),o?(clearTimeout(o),n(t)):o=setTimeout((()=>{e(t),o=null}),300)})),t.addEventListener("mouseleave",c),t.addEventListener("touchstart",d),t.addEventListener("touchend",(function(i){clearTimeout(s);const d=Date.now();a++,1===a?o=setTimeout((()=>{1===a&&d-r<500&&e(t),o=null,a=0}),300):2===a&&(clearTimeout(o),d-l<=300&&n(t),a=0),l=d})),t.addEventListener("touchcancel",c)}if(HTMLElement.prototype.mPop=function(t,e,n){index20635+=5;var i=this.son("div",{zIndex:index20635,display:"none",position:"fixed",overflowY:"auto",maxHeight:"100%",backgroundColor:"#fff"},{openFun:function(){},closeFun:function(){}}),o={b:{css:{left:0,bottom:0,width:"100%",height:"30%"},openP:{y:0},closeP:{y:"100%"}},l:{css:{left:0,top:0,width:"30%",height:"100%"},openP:{x:0},closeP:{x:"-100%"}},r:{css:{right:0,top:0,width:"30%",height:"100%"},openP:{x:0},closeP:{x:"100%"}},t:{css:{left:0,top:0,width:"100%",height:"30%"},openP:{y:0},closeP:{y:"-100%"}}};if(o[t]){var s=o[t];i.css(OPlus(s.css,e),{_openP:s.openP,_closeP:s.closeP}),i.Fly(s.closeP)}var r=this.son("div",{width:"100%",height:"100%",position:"fixed",top:0,left:0,zIndex:index20635-3,display:"none",opacity:0,transition:"opacity 0.6s ease",backgroundColor:"rgba(0, 0, 0, 0.5)"},{onclick:function(){_backRun()}});return i.open=function(){r.css({display:""}),r.onclick=function(){_backRun()},this.css({display:""}),this.openFun(),setTimeout((()=>{r.style.opacity=1,this.Fly(this._openP,600)}),5);try{_backKey((()=>{this.myclose()}))}catch(t){}},i.myclose=function(){this.Fly(this._closeP,600),r.css({opacity:0}),r.onclick=null,this.closeFun(),setTimeout((()=>{this.style.display="none",r.style.display="none"}),800)},i.close=function(){_backRun()},i},HTMLElement.prototype.IMGLabel=function(t,e,n,i,o){return this.son("div",OPlus({width:"100%",position:"relative"},n),{init:function(){this.son("img:pp",OPlus({position:"absolute"},i),{po:this,src:e,onload:function(){this.po.style.height=this.po.offsetWidth*this.naturalHeight/this.naturalWidth}}),this.son("div",Oplus({padding:"2px 6px 2px 6px",backgroundColor:"rgb(00,00,00,0.5)",position:"absolute",bottom:2,right:2,borderRadius:"3px",color:"#ccC",fontSize:12,textShadow:"1px 1px 3px #000,-1px -1px 3px #fff"},o),{innerText:t})}})},HTMLElement.prototype.doClick=function(){var t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});this.dispatchEvent(t)},HTMLElement.prototype.tStyle=function(){return window.getComputedStyle(this)},HTMLElement.prototype.addListener=function(t,e){return this.addEventListener(t,e),this},HTMLElement.prototype.addEvent=function(t,e){return this.addEventListener(t,e),this},HTMLElement.prototype.typeWriter=function(t,e,n){let i=0;const o=()=>{i{o.innerText=s,--s<0&&(clearInterval(r),"function"==typeof i?i(o):o.style.backgroundColor="#A00")}),e)},HTMLElement.prototype.setLonPre=function(t=800){var e,n=!1;this.preventClick20798=!1;var i=()=>{n=!1,this.preventClick20798=!1,e=setTimeout((()=>{n=!0,this.preventClick20798=!0;try{this.onLonPre()}catch(t){}}),t)},o=t=>{clearTimeout(e),n&&t.preventDefault()},s=()=>{clearTimeout(e)};this.addEventListener("mousedown",i),this.addEventListener("mouseup",o),this.addEventListener("mouseleave",s),this.addEventListener("touchstart",i),this.addEventListener("touchend",o),this.addEventListener("touchleave",s);var r=this.onclick;this.onclick=t=>{this.preventClick20798?(t.preventDefault(),this.preventClick20798=!1):r&&r.call(this,t)}},HTMLElement.prototype.LRFontSize=function(){let t=0,e=parseFloat(window.getComputedStyle(this).fontSize)||16,n=!1;this.addEventListener("touchstart",(e=>{t=e.touches[0].clientX})),this.addEventListener("touchmove",(n=>{let i=n.touches[0].clientX,o=i-t;Math.abs(o)>30&&(o>0?e+=2:e=Math.max(6,e-2),this.style.fontSize=`${e}px`,t=i)})),this.addEventListener("wheel",(t=>{t.altKey&&(t.preventDefault(),t.deltaY<0?e+=2:e=Math.max(6,e-2),this.style.fontSize=`${e}px`)})),this.addEventListener("mousedown",(e=>{e.altKey&&(n=!0,t=e.clientX)})),document.addEventListener("mousemove",(i=>{if(!n||!i.altKey)return;let o=i.clientX,s=o-t;Math.abs(s)>30&&(s>0?e+=2:e=Math.max(6,e-2),this.style.fontSize=`${e}px`,t=o)})),document.addEventListener("mouseup",(()=>{n=!1}))},HTMLElement.prototype.setTip=function(t,e={}){this.title&&(this.title=""),this._tipBox||(this._tipBox=document.body.son("div:vix-tip-box",Oplus({position:"absolute",display:"none",whiteSpace:"nowrap",padding:"4px 8px",fontSize:"12px",background:"#333",opacity:.7,color:"#fff",borderRadius:"4px",zIndex:9999,pointerEvents:"none"},e.style),{_owner:this}));const n=this._tipBox,i=e.position||"top",o=()=>{const e=this.getBoundingClientRect(),o=window.scrollX||document.documentElement.scrollLeft,s=window.scrollY||document.documentElement.scrollTop;let r=e.left+o,l=e.top+s;switch(i){case"top":l-=30,r+=e.width/2-30;break;case"bottom":l+=e.height+5,r+=e.width/2-30;break;case"left":r-=80,l+=e.height/2-10;break;case"right":r+=e.width+10,l+=e.height/2-10}n.innerText=t,Object.assign(n.style,{left:r+"px",top:l+"px",display:"block"})},s=()=>{n.style.opacity=0,setTimeout((()=>{n.style.display="none"}),200)};return this._tipBound||(this._tipBound=!0,this.addEventListener("mouseenter",o),this.addEventListener("mouseleave",s)),this},HTMLElement.prototype.myFlay=function(t,e={},n={},i=16){function o(t){let[e,n,i,o]=t.split(":");return n=n||1,i=void 0!==i&&""!==i?i:1,o=void 0!==o&&""!==o?o:"0%",{name:e,grow:n,shrink:i,basis:o}}function s(t){if(!(t=t.replace(/[\s\r\n]+/g,"")))return[];const e=[],n=[];let i=0;for(;it.includes("*")?t.split("*").filter((t=>t)).map((t=>o(t))):t&&o(t)))}function r(t,e,o={}){return t.forEach((t=>{if(Array.isArray(t)){const n=document.createElement("div");n.classList.add("flexCont","flexRow"),n.style.gap=i+"px",e.appendChild(n),r(t,n,o)}else if(t){const i=document.createElement("div");i.classList.add("flexItem"),i.setAttribute("data-name",t.name),i.style.flex=`${t.grow} ${t.shrink} ${t.basis}`,n&&"object"==typeof n&&Object.assign(i.style,n),e.appendChild(i),o[t.name]=i}})),o}this.innerHTML="",this.classList.add("flexCont","flexCol"),this.style.gap=i+"px",e&&"object"==typeof e&&Object.assign(this.style,e),this.$={};const l=s(t);return Object.assign(this.$,r(l,this,this.$)),this.myFlayAdd=function(t){const e=s(t),n=document.createDocumentFragment();return Object.assign(this.$,r(e,n,this.$)),this.appendChild(n),this},this},HTMLElement.prototype.shadow=function(t="",e="",n){this.shadowRoot=this.shadowRoot||this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`${t}`;const i={},o={};return this.shadowRoot.querySelectorAll("[id]").forEach((t=>{const e=t.id;i[e]=t,Object.defineProperty(o,e,{get:()=>t.value??t.innerText??"",set(e){"value"in t?t.value=e:t.innerText=e}})})),this._=i,this.$=o,"function"==typeof n&&n.call(this,this.shadowRoot),this},HTMLTableElement.prototype.addRow=function(t,e,n){var i=this.insertRow(t||-1);return i.$css(e,n),i},HTMLTableRowElement.prototype.addCell=function(t,e,n){var i=this.insertCell(t);return i.$css(e,n),i},HTMLTableElement.prototype.addArr=function(t,e,n,i){var o=this.insertRow(e||-1);return t.forEach((function(t){o.addCell(-1,{},{innerHTML:t})})),o},HTMLTableElement.prototype.addRowByStr=function(t,e,n){var i="string"==typeof t?t.split(","):t,o=this.addRow(-1,{},{ppt:n}),s={};return i.forEach((function(t){var i=t.split("^");if(i.length>2){var r=i[2].substring(0,1);r="-"==r?"0":"+"==r?"100%":"center",s={backgroundImage:`url(/svcn/${Math.abs(i[2])})`,backgroundSize:"18px auto",backgroundPosition:`${r} center`}}else s={};o.addCell(-1,Oplus({padding:3,border:"1px solid #eee",width:i[1]||null},s,e),{ppt:n,innerText:i[0]})})),o},HTMLTableElement.prototype.rEval=function(t){Array.from(this.rows).forEach((function(e,n){t(e,n)}))},HTMLTableElement.prototype.cEval=function(t,e){var n=this.querySelectorAll(`tr td:nth-child(${t+1})`);Array.from(n).forEach((function(t,n){e(t,n)}))},HTMLTableRowElement.prototype.addText=function(t,e){let n=this;return t.forEach((function(t,i){n.addCell(-1,Oplus({border:"1px solid #ddd",padding:5},e&&e[i]),{innerText:t})})),n},HTMLTableElement.prototype.addJsonArray=function(t,e,n){if(!Array.isArray(t)||0===t.length)return this;const i=Object.keys(t[0]),o=Oplus({background:"#EEE",border:"1px solid #aaa",padding:5,wordBreak:"break-all"},e||{}),s=Oplus({border:"1px solid #aaa",padding:5,wordBreak:"break-all"},n||{}),r=this.addRow(-1,{},{});return i.forEach((t=>{r.addCell(-1,o,{innerText:t})})),t.forEach((t=>{const e=this.addRow(-1,{},{});i.forEach((n=>{e.addCell(-1,s,{innerText:void 0!==t[n]?t[n]:""})}))})),this},HTMLSelectElement.prototype.opts=function(t,e){var n=this,i=e||",";t.split(i).forEach((function(t){var e=t.split(":");1==e.length&&(e[1]=e[0]),n.add(new Option(e[1],e[0]))}))},HTMLSelectElement.prototype.optArr=function(t,e){var n=this;t.forEach((function(t){n.add(new Option(t,t))}))},HTMLSelectElement.prototype.opto=function(t){var e=this;t.forEach((function(t){e.add(new Option(t.name,t.id))}))},HTMLSelectElement.prototype.setOpt=function(t,e){let n;this.options.length;for(var i=this;i.options.length>0;)i.options.remove(0);if("string"==typeof t)n=t.split(e||",");else{if(!Array.isArray(t))return;n=t}for(var o=0;o0&&"\n"!==i[e-1];)e--;for(;nt.text())).then((t=>{const e=t.split(/\r?\n/),n=[];let o=[];for(const t of e)if(""===t.trim()){if(o.length>=3){const t=o[1],[e,i]=t.split("--\x3e").map((t=>r(t.trim()))),s=o.slice(2).join("\n");n.push({start:e,end:i,text:s})}o=[]}else o.push(t);i.ontimeupdate=()=>{const t=i.currentTime,e=n.find((e=>t>=e.start&&t<=e.end));s.innerText=e?e.text:""}})),i},C4=String.fromCharCode(4),OPlus=Oplus,window.loadJS=function(t){return new Promise(((e,n)=>{loadjs(t,(()=>e()))}))},function(){var t=new Set;window.loadjs=function(e,n){var i=e.split(";").map((t=>t.trim())).filter((t=>t)),o=0;!function e(){o>=i.length?n&&n():function(e,n){if(t.has(e))return console.log("Script already loaded:",e),void(n&&n());var i=document.createElement("script");i.type="text/javascript",i.charset="UTF-8",i.src=e,i.onload=function(){t.add(e),console.log("Script loaded:",e),n&&n()},i.onerror=function(){console.error("Failed to load script:",e),n&&n()},document.head.appendChild(i)}(i[o],(function(){o++,e()}))}()}}(),function(){var t=new Set;window.loadcss=function(e,n){var i=e.split(";").map((t=>t.trim())).filter((t=>t)),o=0;!function e(){o>=i.length?n&&n():function(e,n){if(t.has(e))return console.log("CSS already loaded:",e),void(n&&n());var i=document.createElement("link");i.rel="stylesheet",i.type="text/css",i.href=e,i.onload=function(){t.add(e),console.log("CSS loaded:",e),n&&n()},i.onerror=function(){console.error("Failed to load CSS:",e),n&&n()},document.head.appendChild(i)}(i[o],(function(){o++,e()}))}()}}(),$dlog=function(t){console.log("-----------"+t);for(var e=1;e-1&&i.splice(o,1),i.unshift(e),i.length>n&&(i=i.slice(0,n)),localStorage.setItem(t,JSON.stringify(i)),console.log(JSON.stringify(i))}},window.myLS=window.myLocalStorage,myWin=function(t,e){window.sonWin=window.open("javascript:;",t),window.sonWin.C4||window.open(e,t)},window._ppOn=function(t=""){let e=document.getElementById("_pp_loading");if(e){const n=document.getElementById("_pp_loading_btn");n&&(n.style.display="none");const i=document.getElementById("_pp_loading_text");i&&(i.innerText=t),e.style.display="flex"}else{e=document.createElement("div"),e.id="_pp_loading",e.style.cssText="\n position: fixed;\n top: 0; left: 0;\n width: 100%; height: 100%;\n background: rgba(0,0,0,0.3);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 9999;\n backdrop-filter: blur(2px);\n flex-direction: column;\n ";const n=document.createElement("div");n.id="_pp_loading_box",n.style.cssText='\n padding: 20px 30px;\n background: rgba(255,255,255,0.95);\n border-radius: 12px;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 15px;\n box-shadow: 0 4px 15px rgba(0,0,0,0.2);\n font-family: "Segoe UI", "Helvetica Neue", sans-serif;\n color: #333;\n min-width: 120px;\n ';const i=document.createElement("div");i.style.cssText="\n width: 40px; height: 40px;\n border: 4px solid #ccc;\n border-top-color: #409eff;\n border-radius: 50%;\n animation: _pp_spin 1s linear infinite;\n ",n.appendChild(i);const o=document.createElement("div");o.id="_pp_loading_text",o.innerText=t,o.style.cssText="font-size: 14px;",n.appendChild(o);const s=document.createElement("button");s.id="_pp_loading_btn",s.innerText="关闭",s.style.cssText="\n margin-top: 10px;\n padding: 6px 14px;\n border: none;\n border-radius: 6px;\n background: #f56c6c;\n color: #fff;\n cursor: pointer;\n font-size: 13px;\n display: none;\n ",s.onclick=window._ppOff,n.appendChild(s),e.appendChild(n),document.body.appendChild(e);const r=document.createElement("style");r.id="_pp_loading_style",r.innerHTML="\n @keyframes _pp_spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n ",document.head.appendChild(r)}clearTimeout(window._pp_loading_timeout),window._pp_loading_timeout=setTimeout((()=>{const t=document.getElementById("_pp_loading_btn");t&&(t.style.display="block")}),15e3)},window._ppOff=function(){const t=document.getElementById("_pp_loading");t&&(t.style.display="none"),clearTimeout(window._pp_loading_timeout)},function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).filesize=e()}(this,(function(){"use strict";var t=/^(b|B)$/,e={iec:{bits:["bit","Kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["bit","Kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},n={iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]},i={floor:Math.floor,ceil:Math.ceil};function o(o){var s,r,l,a,d,c,h,u,p,f,g,m,b,v,L,y,x,w,_,k,D,E=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},C=[],S=0;if(isNaN(o))throw new TypeError("Invalid number");if(l=!0===E.bits,L=!0===E.unix,m=!0===E.pad,r=E.base||10,b=void 0!==E.round?E.round:L?1:2,h=void 0!==E.locale?E.locale:"",u=E.localeOptions||{},y=void 0!==E.separator?E.separator:"",x=void 0!==E.spacer?E.spacer:L?"":" ",_=E.symbols||{},w=2===r?E.standard||"iec":"jedec",g=E.output||"string",d=!0===E.fullform,c=E.fullforms instanceof Array?E.fullforms:[],s=void 0!==E.exponent?E.exponent:-1,k=i[E.roundingMethod]||Math.round,p=(f=Number(o))<0,a=r>2?1e3:1024,D=!1===isNaN(E.precision)?parseInt(E.precision,10):0,p&&(f=-f),(-1===s||isNaN(s))&&(s=Math.floor(Math.log(f)/Math.log(a)))<0&&(s=0),s>8&&(D>0&&(D+=8-s),s=8),"exponent"===g)return s;if(0===f)C[0]=0,v=C[1]=L?"":e[w][l?"bits":"bytes"][s];else{S=f/(2===r?Math.pow(2,10*s):Math.pow(1e3,s)),l&&(S*=8)>=a&&s<8&&(S/=a,s++);var T=Math.pow(10,s>0?b:0);C[0]=k(S*T)/T,C[0]===a&&s<8&&void 0===E.exponent&&(C[0]=1,s++),v=C[1]=10===r&&1===s?l?"kbit":"kB":e[w][l?"bits":"bytes"][s],L&&(C[1]=C[1].charAt(0),t.test(C[1])&&(C[0]=Math.floor(C[0]),C[1]=""))}if(p&&(C[0]=-C[0]),D>0&&(C[0]=C[0].toPrecision(D)),C[1]=_[C[1]]||C[1],!0===h?C[0]=C[0].toLocaleString():h.length>0?C[0]=C[0].toLocaleString(h,u):y.length>0&&(C[0]=C[0].toString().replace(".",y)),m&&!1===Number.isInteger(C[0])&&b>0){var M=y||".",R=C[0].toString().split(M),F=R[1]||"",I=F.length,z=b-I;C[0]="".concat(R[0]).concat(M).concat(F.padEnd(I+z,"0"))}return d&&(C[1]=c[s]?c[s]:n[w][s]+(l?"bit":"byte")+(1===C[0]?"":"s")),"array"===g?C:"object"===g?{value:C[0],symbol:C[1],exponent:s,unit:v}:C.join(x)}return o.partial=function(t){return function(e){return o(e,t)}},o})),window.$cle=deepRemove,window.$clc=deepClear,!self.mv7112){var s=hget("/svcn/nptcss",[]);loadStyle(s),s=hget("/svcn/nptjs"),loadScript(s),self.mv7112=!0}var w20598=!1,pMp4=function(t){var e=getAbsoluteUrl(t);w20598?w20598.style.display="":((w20598=document.body.son("div",{width:"100%",height:"100%",backgroundColor:"#F00",position:"absolute",left:0,top:0,zIndex:15e3})).innerHTML=' ',w20598.vp=videojs("v20598",{})),w20598.vp.src({type:"video/mp4",src:e}),w20598.close=function(){w20598.vp.pause(),w20598.style.display="none"},_backKey((function(){w20598.close()}))};function v_cmp4(t){event.stopPropagation(),event.preventDefault(),pMp4("/svcn/gzh_cmp4i?"+t.getAttribute("ssrc"))}var w20600=!1,showImg=function(t,e){var n=getAbsoluteUrl(t);try{wx.previewImage({current:n,urls:[n]})}catch(r){try{WeixinJSBridge.invoke("imagePreview",{current:n,urls:[n]})}catch(n){var i=e||{maxWidth:"100%",margin:"auto"};if(o)o.style.display="flex";else var o=document.body.son("div",{width:"100%",height:"100%",left:0,top:0,overflow:"hidden",position:"absolute",zIndex:99999,display:"flex",alignItems:"center",backgroundColor:"#000"}),s=o.son("img",i,{onload:function(){_pOff()}});s.src=t,o.onclick=function(){_backFun.pop()()},o.close=function(){o.style.display="none"},_backKey((function(){o.close()}))}}},a20600=!1,tm20729;function getAbsoluteUrl(t){return a20600||(a20600=document.createElement("A")),a20600.href=t,t=a20600.href}function v_cimg(t){event.stopPropagation(),event.preventDefault(),showImg("/svcn/v_cimg?"+t.getAttribute("ssrc"))}function copyTextToClipboard(t){const e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select();try{document.execCommand("copy"),console.log("Text successfully copied to clipboard")}catch(t){console.error("Failed to copy text: ",t)}document.body.removeChild(e)}function strKV(t,e){for(var n=t.split(","),i=e.split(","),o={},s=0;s{let o=new Image;o.crossOrigin="Anonymous",o.onload=()=>{const t=o.width,i=o.height,s=document.createElement("canvas"),r=s.getContext("2d"),l=(t,e,n,i)=>(s.width=n,s.height=i,r.clearRect(0,0,n,i),r.drawImage(o,t,e,n,i,0,0,n,i),s.toDataURL());n({tl:l(0,0,e,e),tr:l(t-e,0,e,e),bl:l(0,i-e,e,e),br:l(t-e,i-e,e,e),t:l(e,0,8,e),b:l(e,i-e,8,e),l:l(0,e,e,8),r:l(t-e,e,e,8),c:l(e,e,8,8)})},o.onerror=i,o.src=t}))}function clipBackground(t,e){var n="url(_l) left / 40px calc(100% - 80px) no-repeat,\nurl(_r) right center / 40px calc(100% - 80px) no-repeat,\nurl(_tl) left top / 40px 41px no-repeat,\nurl(_tr) right top / 40px 41px no-repeat,\nurl(_bl) left bottom / 40px 40px no-repeat,\nurl(_br) right bottom / 40px 40px no-repeat,\nurl(_c) center / calc(100% - 80px) calc(100% - 80px) no-repeat,\nurl(_b) center bottom / calc(100% - 80px) 40px no-repeat,\nurl(_t) 40px 0 / calc( 100% - 80px ) 41px no-repeat";if(e){var i=e,o=e+1,s=2*e;n.replace(/40px/g,i+"px").replace(/41px/g,o+"px").replace(/80px/g,s+"px")}return OPEval(t,(function(t,e){n=n.replace("_"+t,e)})),n}function jsonA2table(t,e){var n=e;n.clc();var i=n.son("table",{borderCollapse:"collapse",fontSize:14}),o=n.htr=i.addRow(-1,{backgroundColor:"#DDD"});OPEval(t[0],(function(t,e){o.addCell(-1,{minWidth:40,border:"1px solid #888",textAlign:"center",padding:3},{className:".pvgridtd",fdname:t,al:"c",contentEditable:!0,innerText:t,onclick:function(){if(!event.ctrlKey)return;switch(this.style.textAlign){case"center":this.style.textAlign="left",this.al="l";break;case"left":this.style.textAlign="right",this.al="r";break;default:this.style.textAlign="center",this.al="c"}}})})),t.forEach((function(t){var e=i.addRow(-1,{});OPEval(t,(function(t,n){e.addCell(-1,{minWidth:40,border:"1px solid #888",padding:5},{innerText:n||"",className:".pvgridtd"})}))}))}function json2table(t,e){e.clc();var n=e.son("table",{borderCollapse:"collapse",fontSize:14});OPEval(t,(function(t,e){var i=n.addRow();i.addCell(-1,{padding:5,backgroundColor:"#EEE",border:"1px solid #ddd"},{innerText:t}),i.addCell(-1,{padding:5,border:"1px solid #ddd"},{innerText:e})}))}function pasteIt(t,e,n,i){let o=null;function s(t,e,n,i){const o=new Image;o.onload=function(){const t=document.createElement("canvas"),s=t.getContext("2d");if(t.width=o.width,t.height=o.height,s.drawImage(o,0,0),n){const t=s.getImageData(0,0,o.width,o.height),e=t.data,n=e[0],i=e[1],r=e[2];for(let t=0;t 智创辰禾 智创辰禾 ',_pSVG=i.firstElementChild}return window.w20028_svg.style.display="block",t?(_pSVG.r("10").textContent=t,_pSVG.r("11").textContent=t):(_pSVG.r("10").textContent="智创辰禾",_pSVG.r("11").textContent="智创辰禾"),[_pSVG.r("10"),_pSVG.r("11")]}function _pOff(){window.w20028_svg&&(window.w20028_svg.style.display="none"),window.w308&&(window.w308.style.display="none")}function changeFavicon(t){var e=document.querySelector("link[rel~='icon']");e||((e=document.createElement("link")).rel="icon",document.getElementsByTagName("head")[0].appendChild(e)),e.href=t}function regTest(t,e){return"string"==typeof t&&(t=new RegExp(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"))),t.test(e)}function iconimg(t,e){t.$css({paddingLeft:18,width:t.offsetWidth+8}),t.addBackImg(`url(/svcn/${e})`,"2px center","20px 20px")}function fairyOn(){return"undefined"==typeof _fairy_&&(_fairy_=document.body.son("div",{left:0,bottom:"20%",height:80,width:80,backgroundColor:"rgb(00,200,0,0.1)",position:"absolute",borderRadius:"80px",zIndex:4e4},{onclick:function(){document.elementsFromPoint(this.offsetLeft,this.offsetTop).forEach((function(t){t.getAttribute("_vixid")&&$clog(t.getAttribute("_vixid"))}))},ontouchstart:function(){drag=!0;var t=event.touches[0];_x=this.offsetLeft-t.clientX,_y=this.offsetTop-t.clientY;try{clearTimeout(tm20729)}catch(t){}tm20729=setTimeout((function(){$clog("asd")}),2e3)},ontouchmove:function(){if(event.preventDefault(),drag){try{clearTimeout(tm20729)}catch(t){}var t=event.touches[0],e=_y+t.clientY;e>0&&e0&&n{n&&n(i)},i.onmessage=t=>{try{e(t.data)}catch(t){console.warn("[mySSE] 处理数据出错",t)}},i.onerror=t=>{console.warn("⚠️ [mySSE] 连接异常,浏览器将尝试重连")},i}function appTitle(t,e,n,i,o){_backFun.length>6&&$clog("太深了,注意回退,不要兜圈!");var s,r=t;r.css(i||{},{innerHTML:"
",onclick:function(){if(event.ctrlKey){if(window==top)return void window.opener.focus();top.tabbar&&top.tabbar.newSDKTab(e.fip)}else event.altKey||(event.shiftKey?alert(_backFun.length):e.titleClick&&e.titleClick())}}),e.setTitle=function(t){r.r("0001").innerHTML=t},e.setTitle(n),e.ttr=r.r("000"),e.help,e.vedios&&e.vedios.forEach((function(t){var n=e.ttr.insertCell(-1);n.style.width=36,n.innerHTML=''})),e.chat&&(e.chat=e.ttr.addCell(-1,{width:e.ttr.offsetHeight,textAlign:"center"},{innerText:"?",onclick:function(){$clog("asdasd")}})),e.lPanel=function(t,e,n){var i=n?n<0?_H_+n:n:0,o=this.cont.son("div",{position:"absolute",backgroundColor:"#FFF",width:_W_-(t||100),height:"100%",borderRight:"2px solid #EEE",bottom:i,zIndex:100,opacity:.95});return o.fly({x:-o.offsetWidth}),o.bt=o.son("div",{position:"absolute",width:45,height:39,boxShadow:"1px 0px 3px #000",lineHeight:"40px",textAlign:"center",right:-45,bottom:0,borderRadius:"0px 5px 5px 0px",userSelect:"none",backgroundColor:"#ddd"}),o.bt.innerText=e||"?",o.bt.onclick=function(){o.fly({x:0==o.pos.x?-o.offsetWidth:0},"200ms")},o.close=function(){o.fly({x:-o.offsetWidth},"200ms")},o},e.popFun=function(t,n,i,o,r,l){return s&&(s.clc(),s.o=null,s=null),s=popPan(e.cont,{boxSizing:"border-box",backgroundColor:"#FFF",opacity:.4},{SS:0,x:window.innerWidth},{x:-window.innerWidth}),setTimeout((function(){s.o=getFun(t)(s,n,i,o,r,l),s.open()}),99),s},e.lPan=function(t){return this.cont.son("div:pp",{backgroundColor:"rgb(80,80,180,0.2)",width:"100vw",position:"absolute",left:"-100vw",top:0,zIndex:500,overflow:"visible"},{stat:!1,open:function(){this.Fly({x:"100vw",d:500}),this.stat=!0},close:function(){this.stat=!1,this.Fly({x:0,d:500})},toggle:function(){this.stat?this.close():this.open()},init:function(){this.Fly({x:0});this.bt=this.son("div",{left:0,top:0,zIndex:9,width:"calc(100vw + 32px )",height:32,backgroundColor:"rgb(255,255,255,0.01)",position:"absolute",borderRadius:"5px",backgroundImage:svgURL(''),backgroundPosition:"right",backgroundSize:"auto 100%"},{onclick:function(){event.stopPropagation(),this.p.toggle()},p:this})}})},e.rPan=function(t,e){return this.cont.son("div",{backgroundColor:"rgb(80,80,180,0.2)",width:t||"100vw",position:"absolute",left:"100vw",top:0,zIndex:500,overflow:"visible",height:"100vh"},{stat:!1,open:function(){this.Fly({x:-this.offsetWidth,d:500}),this.stat=!0},close:function(){this.stat=!1,this.Fly({x:0,d:500})},toggle:function(){this.stat?this.close():this.open()},init:function(){this.Fly({x:0});this.bt=this.son("div",{left:-32,top:0,zIndex:9,width:"calc(100vw + 32px )",height:32,backgroundColor:"rgb(255,255,255,0.01)",position:"absolute",borderRadius:"5px",backgroundImage:svgURL(''),backgroundPosition:"left",backgroundSize:"auto 100%"},{onclick:function(){event.stopPropagation(),this.p.toggle()},p:this})}})}}function myNCol(t,e,n,i,o){var s=n||"transparent",r=i||0,l={};if(!t)t=document.body;var a=t;l.b=a;e=e||6;l.n=e,l.baseSize=function(){l._w=parseInt(1*a.offsetWidth),l._h=parseInt(1*a.offsetHeight),l._z=l._w/2/Math.tan(Math.PI/e),l.p0=a.p0=o||{SS:1,z:-l._z,rX:0,rY:-90}},l.baseSize(),a.css({webkitPerspective:1e3,transformStyle:"preserve-3d",perspectiveOrigin:"50% 50%",backfaceVisibility:"hidden",boxSizing:"border-box"});var d=["#f88","#8f8","#88f","#ff8","#a44","#4a4","#44a","#aa4","#a44","#a4a","#0000ff","#ffff00","#ff0000","#00ff00","#0000ff","#ffff00","#880000","#008800","#000088"],c=a.son("div",{position:"absolute",width:0,height:0,transformStyle:"preserve-3d",left:l._w/2,top:l._h/2,boxSizing:"border-box"});l.p0=c.p0=o||{SS:1,z:-l._z,rX:0,rY:-90},c.fly(c.p0);function h(){var t=parseInt((l.stage.pos.rY+90)%360/l.scale);t<0&&(t+=l.n),l.ai=t}l.stage=c,c.u=l,l.scale=360/e,l.ai=0,l.stage.turn=function(t){l.stage.Fly({rY:l.stage.pos.rY+360/e,d:t||500})},l.turn1=function(t,n){l.stage.fly({rY:l.stage.pos.rY+t*(360/e),d:n||500}),h()},l.turn3=function(t,e){var n=(t-l.ai)%l.n;n+=n<0?l.n:0;var i=(l.ai-t)%l.n,o=n<(i+=i<0?l.n:0)?n:-i;console.log([n,i,o]),l.stage.turn(o),l.ai>-1&&(l.face[l.ai].style.zIndex=0),l.face[t].style.zIndex=1,h()},l.turn2=function(t,n){console.log("---"+l.ai),h(),l.stage.fly({rY:360/e*t-90},n||"500ms"),l.ai>-1&&(l.face[l.ai].style.zIndex=0),l.face[t].style.zIndex=1,h(),console.log("==="+l.ai)},l.face=[],l.cssi=function(t){return{width:l._w,height:l._h,position:"absolute",left:-l._w/2,top:-l._h/2,zIndex:-1,boxSizing:"border-box",backgroundColor:d[t]}},l.posi=function(t){return{SS:1,y:0,x:Math.cos(360/l.n*t*Math.PI/180)*l._z,z:Math.sin(360/l.n*t*Math.PI/180)*l._z,rY:90-360/l.n*t}};var u="
".replace("_bc_",s);u=u.replace("_bw_",r),c.faceOne=function(t){var e=c.son("div",l.cssi(t),{innerHTML:u});return e.d=e.r("00000"),e.ps0=l.posi(t),e.fly(e.ps0),e.d};for(var p=0;p1?(l=etb(e),void a.forEach((function(e){t(l.addRow(-1).addCell(-1,r,{_ex_:0}),e,++o)}))):(a=ex_n(i,1)).length>1?(l=etb(e).addRow(-1),void a.forEach((function(e){t(l.addCell(-1,r,{_ex_:1}),e,++o)}))):(a=ex_n(i,2)).length>1?(""!=a[1]&&(e._ex_?e.style.width=a[1]:e.style.height=a[1]),void t(e,a[0],++o)):(s[a[0]]={c:e,ex:e._ex_,lv:o,mask:e.son("div",{position:"absolute",width:"100%",height:"100%",left:0,top:0,border:"1px solid #000",zIndex:2,boxSizing:"border-box",overflow:"hidden"},{e:this})},void(n&&e.css({backgroundColor:gColor(cs20670++,.6),backgroundRepeat:"no-repeat",backgroundSize:"100% 155",backgroundImage:`url(/svcn/svg_text?${a[0]})`})))}(t,e),o&&t.children[0].css(o),t.$=s,t}function J2T(cont,json,kc,kv,edit,onInput,onBlur){var nn=[];function arrValue(t,e){var n=t.son("table:eetb",{fontSize:12}),i=n.addRow(-1,{backgroundColor:"#DDD"});OPEval(e[0],(function(t,e){i.addCell(-1,OPlus({border:"1px solid #aaa",padding:5},kc,{textAlign:"center"}),{innerText:t})})),e.forEach((function(t,e){i=n.addRow(-1,{}),nn.push(e),OPEval(t,(function(t,e){var n=i.addCell(-1,{});nn.push(t),cellVal(n,e,t),nn.pop()})),nn.pop()}))}function exp(){for(var t="json",e=[].concat(nn);e.length>0;){var n=e.shift();isNaN(n)?t+="."+n:t+="["+n+"]"}return t}function cellVal(c,v,k){if(Array.isArray(v))arrValue(c,v);else if("object"==typeof v&&null!==v)jsonTable(c,v);else{c.exp=exp(),c.title=c.exp;let oldValue=v;c.css(OPlus({border:"1px solid #aaa",padding:5},kv),{innerText:v,contentEditable:edit?"true":"false"}),edit&&(c.oninput=function(){let t=this.innerText.trim();"function"==typeof onInput&&onInput(k,t,oldValue,this)},c.onkeydown=function(t){"Enter"===t.key&&(t.preventDefault(),this.blur())},c.onblur=function(){let newValue=this.innerText.trim();if("function"==typeof onBlur){const shouldUpdate=onBlur(k,newValue,oldValue,this);shouldUpdate?(eval(this.exp+"=`"+newValue+"`"),oldValue=newValue):this.innerText=oldValue}})}}function jsonTable(t,e){const n=t.son("table:eetb",{border:"0px solid #eee",fontSize:12,cellPadding:0,cellSpacing:0},{cellPadding:0,cellSpacing:0});for(const t in e)if(e.hasOwnProperty(t)){nn.push(t);const i=n.addRow(-1,{});i.addCell(-1,OPlus({backgroundColor:"#DDD",padding:5,border:"1px solid #aaa",width:50},kc),{innerText:t});cellVal(i.addCell(-1,{}),e[t],t),nn.pop()}}jsonTable(cont,json)}function jsonEd(container,jsonData,keyConfig,valueConfig,editable){function JsonEditor(){this.container=container,this.data=jsonData,this.keyConfig=Oplus({border:"1px solid #aaa",padding:5,minWidth:40,backgroundColor:"#EEE"},keyConfig),this.valueConfig=Oplus({border:"1px solid #aaa",padding:5},valueConfig),this.editable=editable,this.init()}return JsonEditor.prototype.init=function(){this.renderJsonTable(this.container,this.data)},JsonEditor.prototype.renderJsonTable=function(t,e){const n=t.son("table:eetb",{border:"0px solid #eee",fontSize:12,cellPadding:0,cellSpacing:0},{cellPadding:0,cellSpacing:0});for(const t in e){const i=n.addRow(-1),o=(i.addCell(-1,this.keyConfig,{innerText:t}),i.addCell(-1,this.valueCell));this.renderCellValue(o,e[t],t)}},JsonEditor.prototype.renderCellValue=function(cell,value,key){Array.isArray(value)||"object"==typeof value&&null!==value?this.renderJsonTable(cell,value):(cell.innerText=value,this.editable&&(cell.contentEditable="true",cell.oninput=e=>{eval(`this.data['${key}'] = '${e.target.innerText}'`),this.onInput(`['${key}']`,e.target.innerText)},cell.onpaste=t=>{t.preventDefault();const e=t.clipboardData.getData("text/plain");document.execCommand("insertText",!1,e)},cell.onkeydown=t=>{"Enter"===t.key&&(t.shiftKey?(document.execCommand("insertHTML",!1,"

"),t.preventDefault()):t.preventDefault())}),Object.assign(cell.style,this.valueConfig,{border:"1px solid #aaa",padding:"5px"}))},JsonEditor.prototype.onInput=function(t,e){},new JsonEditor}function myList0(t){function e(t){var e="";return t.split("\n").forEach((function(t){e+="

"+t+"

"})),e}return t.son("div:ydiv",{fontSize:16,border:"1px solid #FFF"},{}).son("table:eetb",{tableLayout:"fixed"},{addText(t,n,i){return this.addRow().addCell(-1,OPlus({padding:10,textIndent:"1cm",textAlign:"justify"},n),{innerHTML:i?e(t):t})},addHTML:function(t,e){return this.addRow().addCell(-1,OPlus({padding:10},e),{innerHTML:t})},addImg:function(t,e){return this.addRow().addCell(-1).son("img",OPlus({width:"100%"},e),{src:t})},addCode:function(t){return this.addRow().addCell(-1,{padding:10}).son("div",{width:"100%",overflowX:"scroll"}).son("pre",{width:"auto",whiteSpace:"pre"},{innerText:t})},addTitle:function(t,e){return this.addRow().addCell(-1,OPlus({backgroundColor:"#EEE",fongSize:20,padding:8},e),{innerText:t})},addVideo:function(t,e,n,i){var o=this.addRow().addCell().son("video",OPlus({width:"100%",height:"auto"},i),{src:t,controls:!0,onloadedmetadata:function(){this.currentTime=e||0,o.style.height+=50},onclick:function(){this.play()},poter:n||!1});return o.addEventListener("play",(function(){aVideo&&aVideo!==this&&aVideo.pause(),aVideo=this})),o},addRNote:function(t,e){return this.addRow().addCell(-1,OPlus({fontSize:12,fontStyle:"italic",textAlign:"right",padding:4,backgroundColor:"#eee",borderBottom:"1px solid #aaa",color:"#008"},e),{innerText:t})},"add赞助商":function(t,e){var n=this.addRow().addCell();return n.myFrm("logo:120*info"),n.$.logo.son("img",{width:"100%",height:"auto"},{src:t}),n.$.info.css({fontSize:18,padding:8},{innerText:e}),n},addUsermVideo(t,e){var n=this.addRow().addCell().son("div",{position:"relative"});n.son("img",{width:"100%",height:"auto"},{src:e||`/svcn/gzh_cimgTi?${t}&jtxh`,ssrc:isNaN(t)?t:`/svcn/gzh_cmp4i?${t}&jtxh`,onclick:function(){pMp4(this.ssrc)}}),n.son("div",{width:60,height:60,right:10,bottom:10,position:"absolute",backgroundImage:"url(/svcn/20753)",backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundSize:"100% 100%",pointerEvents:"none"})},addIMGLabel(t,e){return this.addRow().addCell().IMGLabel(t,e)},addBiliButton(t,e){var n=this.offsetWidth-60;return this.addRow().addCell(-1,{textAlign:"left"},{innerHTML:"".replace("__BVID__",t).replace("__CAP__",e).replace("__WIDTH__",n)})},addApps:function(t,e){var n=t;Array.isArray(t)&&(n=t.join(","));var i=this.addRow().addCell(-1,{border:"1px solid #AA0",padding:10});myGetS(20756,[n],(function(t){t.forEach((function(t){i.son("div",{width:60,height:80,float:"left",boxShadow:"0px 0px 4px #F00",backgroundImage:`url(/svcn/${t.icon})`,backgroundRepeat:"no-repeat",backgroundPosition:"center 5px",backgroundSize:"60% auto",margin:10,borderRadius:"8px",position:"relative"},{_id:t.id,onclick:function(){_r.popFun(this._id)},init:function(){this.lb=this.son("span",{position:"absolute",bottom:2,padding:2,width:"100%",textAlign:"center",fontSize:12},{innerText:t.cmdname})}})}))}),!0)},load:function(t){id}})}HTMLElement.prototype.myLout=function(t,e,n,i){return myLayout(this,t,e,n,i)},HTMLElement.prototype.svgForm=function(t){var e=this;e.clc(),e.$={},e._={};var n=this.css({border:"1px solid #F00",display:"flex",justifyContent:"center"}).son("div",{flexShrink:0,position:"relative"},{innerHTML:t,init:function(){e.pan=this,$clog(this.offsetLeft)}}).children[0];console.log(e.pan),console.log(n);var i=!1,o=!1;console.log(n);var s={_:{},__:{}};function r(t,n,i){var o=n.split(":"),s=o[0],r=t.getBBox();switch(o[1]){case"text":case"password":case"number":case"date":case"time":case"email":case"search":case"color":console.log(i.pan),i._[s]=i.pan.son("input",{position:"absolute",left:r.x+2,top:r.y+1,width:r.width,height:r.height,backgroundColor:"#FFF",border:"1px solid #888",opacity:"path"==t.previousElementSibling.tagName?0:1},{type:o[1]}),Object.defineProperty(i.$,s,{configurable:!0,get:()=>e._[s].value,set(t){i._[s].value=t}}),o[2]&&(i._[s].placeholder=o[2]);break;case"select":i._[s]=i.pan.son("select",{position:"absolute",left:r.x+2,top:r.y+1,width:r.width,height:r.height,backgroundColor:"#FFF",border:"1px solid #888",opacity:"path"==t.previousElementSibling.tagName?0:.9},{}),Object.defineProperty(i.$,s,{configurable:!0,get:()=>i._[s].value,set(t){i._[s].value=t}}),o[2]&&i._[s].opts(o[2]);break;case"button":i._[s]=i.pan.son("button",{position:"absolute",left:r.x+2,top:r.y+1,width:r.width,height:r.height},{innerText:o[2]||o[0],onclick:function(){i["_"+s]&&i["_"+s](this)}});break;case"check":i._[s]=i.pan.son("div",{position:"absolute",left:r.x+2,top:r.y+1,width:r.width,height:r.height,backgroundColor:"#Fff",border:"1px solid rgb(0,0,0,0.1)",borderRadius:"4px",opacity:"path"==t.previousElementSibling.tagName?0:.9},{}).son("input",{position:"absolute",left:5,top:5,width:20,height:20},{type:"checkbox"}),Object.defineProperty(i.$,s,{configurable:!0,get:()=>i._[s].checked,set(t){i._[s].checked=t}});break;case"range":i._[s]=i.pan.son("div",{position:"absolute",left:r.x+2,top:r.y+1,width:r.width,padding:3,height:r.height,backgroundColor:"#FFF",border:"1px solid rgb(0,0,0,0.1)",borderRadius:"4px",opacity:"path"==t.previousElementSibling.tagName?0:.9},{}).son("input:pp",{},{type:"range"}),Object.defineProperty(i.$,s,{configurable:!0,get:()=>i._[s].checked,set(t){i._[s].checked=t}});break;case"textarea":i._[s]=i.pan.son("textarea",{position:"absolute",left:r.x+2,top:r.y+1,width:r.width,height:r.height,backgroundColor:"#FFF",border:"1px solid #888",opacity:"path"==t.previousElementSibling.tagName?0:1,padding:10},{}),Object.defineProperty(i.$,s,{configurable:!0,get:()=>i._[s].value,set(t){i._[s].value=t}}),o[2]&&(i._[s].placeholder=o[2]);break;case"rg":var l=i.pan.son("div:ediv",{position:"absolute",left:r.x+2,top:r.y+1,width:r.width,height:r.height,backgroundColor:"#FFF",border:"1px solid rgb(0,0,0,0.1)",borderRadius:"4px",opacity:"path"==t.previousElementSibling.tagName?0:1},{});i._[s]=new myRGroup(l,o[2]),Object.defineProperty(i.$,s,{configurable:!0,get:()=>i._[s].value,set(t){i._[s].value=t}});break;case"cg":l=i.pan.son("div:ediv",{position:"absolute",left:r.x+2,top:r.y+1,width:r.width,height:r.height,backgroundColor:"#FFF",border:"1px solid rgb(0,0,0,0.1)",borderRadius:"4px",opacity:"path"==t.previousElementSibling.tagName?0:1},{});i._[s]=new myCGroup(l,o[2]),Object.defineProperty(i.$,s,{configurable:!0,get:()=>i._[s].value,set(t){i._[s].value=t}})}t.textContent=""}!function t(l){!function(t,s,l){switch(t.tagName){case"text":i&&(o+=t.textContent,t.style.visibility="hidden");break;case"rect":i&&(console.log(o),r(i,o,e)),i=!1,"#654321"==t.getAttribute("fill")?(s.背板=t,s.背板.setAttribute("fill-opacity",0),cc=s.背板.getAttribute("width"),n.setAttribute("width",cc),s.z=t.getBBox()):"#123456"==t.getAttribute("fill")&&(i=t,t.style.visibility="hidden",o="")}}(l,s);for(var a=0;a{o.drawImage(r,0,0,i.width,i.height);const n=i.toDataURL("image/jpeg",t);e&&e(n)},r.onerror=()=>{console.error("Failed to load image")},r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(''+s+"")};class myFileInput{constructor(t,e="上传文件",n={},i="*/*"){this.container=t,this.cap=e,this.acceptedTypes=i,this.createFileInput(),this.createCustomButton()}createFileInput(){this.fileInput=document.createElement("input"),this.fileInput.type="file",this.fileInput.style.display="none",this.fileInput.accept=this.acceptedTypes,this.container.appendChild(this.fileInput),this.fileInput.addEventListener("change",(t=>{this.onFiles(t.target.files)}))}setAcceptedTypes(t){this.fileInput.accept=t}createCustomButton(){this.button=this.son("button",{},{innerText:cap,onclick:function(){this.fileInput.click()}})}onFiles(t){console.log(t)}}function popPan(t,e,n,i,o){var s=o||"500ms",r=document.body.son("div",{position:"absolute",left:0,top:0,width:"100%",height:"100%"},{owner:t,ipos:i||{x:Math.max(_r.cont.offsetWidth,_r.cont.offsetHeight)},opos:n||{SS:.7},open:function(t,e,n){var i=t;e&&(this.owner=e),n&&(this.ipos=n,this.fly(n));var o=this;this.owner.style.zIndex=0;try{this.owner.fly(this.opos,s)}catch(t){console.log("----")}_backKey((function(){r.close()})),setTimeout((function(){o.fly({o:1,x:0,y:0,z:0,SS:1,rX:0,rY:0,rZ:0},s),o.first(),r.style.zIndex=20,i&&i(r),r.openFun(r)}),100)},close:function(){var t=this;try{this.closeFun.forEach((function(e){e(t)}))}catch(t){}this.fly(this.ipos,s),this.style.zIndex=0,this.owner.fly({SS:1,x:0,y:0,z:0,rX:0,rY:0,rZ:0,o:1},s),this.owner.style.zIndex=20},ini:[],closeFun:[],first:function(){for(;this.ini.length>0;)this.ini.pop()()},setOwner:function(t){this.owner=t}});return r._3D(),t.o=r,e&&r.css(e),r.fly(i||{x:-_WH_,y:0}),r.openFun=function(){},r}function VIXTree1(t,e,n,i,o,s){var r={};if(r._p=t,t._o=r,s){new ResizeObserver((e=>{s.style.paddingRight=t.scrollbarWidth()})).observe(t)}var l=r;r.c0=OPlus({backgroundColor:"transparent",border:"0px solid #ddd",userSelect:"none"},e),r.ca=OPlus({backgroundColor:"rgb(230,130,80,0.4)",border:"0px solid #d00",userSelect:"text"},n),r.aRow=!1,r.loadco=i;var a=r.b=baseTable(t);r.nodes={},r.rootct=0,r.aNode=0,r._aid=!1,r.ct=1,r.addNode=function(t,n){var i=this.nodes[t.pid];i?(i._cs=i._cs+1||1,t._lv=i._lv+1,t.p=i.o):(t._lv=0,this.rootct++);var o=i?i.o.rt:a;if(!n)n=function(e,n,i){e.innerText=t.id+":"+t.name};var s={};t._cs=0;return s.cont=o.addRow(-1,{},{}).addCell(-1,e,{innerHTML:"
"}),s.cont.addEventListener("dblclick",(e=>{e.stopPropagation(),r._aRec=this._dt,r.onDBClick(t.id,t)})),s.mt=s.cont.r("0000"),s.mt._dt=t,s.mt.ds=t,s.mt._id=t.id,s.lt=s.cont.r("0010"),s.lt._id=t.id,s.lt.css({backgroundColor:"#F0FAFF"}),s.lt.onclick=function(){r.closeNode(this._id)},s.rt=s.cont.r("00110"),n(s.mt,s.lt,s.rt,this),s.mt.onclick=function(){r.aNode=this._id,r.aRow=this,r._aId=this._id,r._aRec=this._dt;var t="";try{t=event.srcElement.getAttribute("_cind")}catch(t){}r.__selectRow(this._id,this,event.srcElement,t)},t.o=s,s.x=t,this.nodes[t.id]=t,s},r.clearAll=function(e){$delE(r.b),r.ct=1,r.nodes={},r.aNode=0,r._aId=!1,r.activeRow=!1,a=r.b=baseTable(t),e&&e()};var d=r;return o?(r.oo="url(/svcn/"+o[0]+")",r.cc="url(/svcn/"+o[1]+")",r.dd="url(/svcn/"+o[2]+")"):(d.cc=svgURL(' '),d.dd=svgURL(' \x3c!-- Created with SVG-edit - https://github.com/SVG-Edit/svgedit--\x3e Layer 1 '),d.oo=svgURL(' ')),r.onDBClick=function(t,e){},r.deleteNode=function(t){},r.descendantsEval=function(t,e){const n=this.nodes[t];if(!n||!n.o||!n.o.rt)return;const i=n.o.rt.rows;for(const t of i){const n=t.cells[0].r("0000"),i=n?n._id:null;if(i){const t=this.nodes[i];t&&(e(t),this.descendantsEval(i,e))}}},r.desEval=r.descendantsEval,r.closeNode=function(t){this.nodes[t].o.lt.r("p").style.display="none",this.nodes[t].o.mt.r("0000").style.backgroundImage=this.cc},r.openNode=function(t){this.nodes[t].o.lt.r("p").style.display="",this.nodes[t].o.mt.r("0000").style.backgroundImage=this.oo},r.ocNode=function(t){var e=this.nodes[t].o.lt.r("p").style.display;return this.nodes[t].o.lt.r("p").style.display=""==e?"none":"",this.nodes[t].o.lt.r("p").style.display},r.setTNode=function(t,e,n,i){var o=this;t.css({backgroundImage:o.dd,backgroundRepeat:"no-repeat",backgroundSize:"20px 20px",backgroundPosition:"2px 5px"}),e.p&&(e.p.mt.r("0000").style.backgroundImage=n?o.oo:o.cc,e.p.mt.r("0000").__id=e.p.x.id,e.p.mt.r("0000").onclick=function(){var t=i.ocNode(this.__id);this.style.backgroundImage=""==t?o.oo:o.cc})},l.gridIni=function(t){var e="",n="",i={};return t.split(";").forEach((function(t,o){var s=t.split(",");s.length<4||(e+="__"+s[1]+"__",n+=''+s[0]+"",i[s[1]]={id:o+1,name:s[1],label:s[0]})})),e+="",n+="",this.cols=i,this.hTem=" "+n+"
",this.rTem=" "+e+"
",[e,n,i]},r.onNodeClick=function(t,e,n){},r.__selectRow=function(t,e,n,i){if(!e)try{n=(e=l.nodes[t].o.mt).r("0001")}catch(t){console.log("12751:__selectRow:"+t.toString())}if(r._aId=t,r._aRec=e._dt,l.cols&&l.cols[i]&&"function"==typeof l.cols[i].onclick0)try{l.cols[i].onclick0(t,e,n,i)}catch(t){$clog("__SELECTTREE:Error occurred while calling onclick0:")}if(r.activeRow){r.nodes[r.activeRow].o.mt.css(l.c0);try{r.nodes[r.activeRow].o.mt.r("000")}catch(t){}}r.activeRow=t,r.nodes[t].o.mt.css(l.ca);try{l.onNodeClick(t,e._dt,n,i)}catch(t){}},l.onRowSelect=function(t,e,n,i,o){},l.selectRow=function(t){for(var e=r.nodes[t].pid;r.nodes[e];)r.openNode(e),e=r.nodes[e].pid;r.__selectRow(t)},l.cellx=function(t,e){return this.nodes[t].o.mt.r("000"+this.cols[e].id)},r.loadSVC=function(t,e,n,i){this.clearAll();var o=this;i&&loadStyle(i),myGetS(t,e,(function(t){t.forEach((function(t){o.addNode(t,(function(e,i,s,r){e.innerHTML=d2f(t,n),e.css(o.c0),e.r("0000").style.backgroundImage="url(/svcn/10558)",i.r("p").style.display=o.loadco?"":"none",t.p&&(t.p.mt.r("0000").style.backgroundImage=o.loadoc?"url(/svcn/2549)":"url(/svcn/2548)",t.p.mt.r("0000").__id=t.p.x.id,t.p.mt.r("0000").onclick=function(){var t=r.ocNode(this.__id);this.style.backgroundImage=""==t?"URL(/svcn/2549)":"url(/svcn/2548)"})}))}))}),!0)},r}function hslToRgb(t,e,n){const i=e*Math.min(n,1-n),o=(e,o=(e+t/30)%12)=>n-i*Math.max(Math.min(o-3,9-o,1),-1);return[255*o(0),255*o(8),255*o(4)]}function rgbToHex(t,e,n){return"#"+[t,e,n].map((t=>{const e=Math.round(t).toString(16);return 1===e.length?"0"+e:e})).join("")}function getDistinctColor(t){const e=43*t%360,n=.8+t%2*.1,i=.4+t%2*.2,[o,s,r]=hslToRgb(e,n,i);return rgbToHex(o,s,r)}HTMLElement.prototype.myFBar=function(t,e){let n={};n.s=function(t,e,n){var o=s._cont.son("select",Oplus(i,{backgroundColor:"#FFE",paddingLeft:e[2]?"18px":"0px",paddingRight:"8px"},n),{});s._ev[e[0]]={o:o,_id:e[0],$:s._ev,get v(){return this.o.value},set v(t){this.o.value=t},dis:function(){this.o.disabled=!0},ena:function(){this.o.disabled=!1},setOpt:function(t){o.setOpt(t)}},t.vs&&o.setOpt(t.vs,"|"),t.v&&(o.value=t.v),o.disabled=t.d},n.i=function(t,e,n){var o=s._cont.son("input",Oplus(i,{backgroundColor:"#FFE",paddingLeft:e[2]?"18px":"2px",paddingRight:"2px"},n),{type:"text",disabled:t.d});s._ev[e[0]]={o:o,_id:e[0],$:s._ev,get v(){return this.o.value},set v(t){this.o.value=t},dis:function(){this.o.disabled=!0},ena:function(){this.o.disabled=!1}},o.$=s._ev,t.vs&&(o.placeholder=t.vs),t.v&&(o.value=t.v)},n.f=function(t,e,n){var o=s._cont.son("input",Oplus(i,{padding:2,paddingRight:"2px"},n),{type:"file",disabled:t.d});s._ev[e[0]]={o:o,_id:e[0],$:s._ev,get v(){return this.o.value},set v(t){this.o.value=t},dis:function(){this.o.disabled=!0},ena:function(){this.o.disabled=!1}},o.$=s._ev,t.vs&&(o.accept=t.vs),t.v&&(o.value=t.v)},n.n=function(t,e,n){var o=s._cont.son("input",Oplus(i,{backgroundColor:"#FFE",paddingLeft:e[2]?"18px":"0px",paddingRight:"8px",textAlign:"right"},n),{type:"number",step:.01,disabled:t.d});s._ev[e[0]]={o:o,_id:e[0],$:s._ev,get v(){return this.o.value},set v(t){this.o.value=t},dis:function(){this.o.disabled=!0},ena:function(){this.o.disabled=!1}},t.vs&&(o.placeholder=t.vs),t.v&&(o.value=t.v)},n._=function(t,e,n){var o=s._cont.son("div",Oplus(i,n,{backgroundColor:"transparent",borderWidth:0}),{});s._ev[e[0]]=o,o.$=s._ev[e[0]]},n.r=function(t,e,n){var o=s._cont.son("form",Oplus(i,{backgroundColor:"#ffe",paddingLeft:e[2]?"18px":"0px",paddingRight:"2px"},n),{items:{},disabled:!1,disable:function(t){OPEval(this.items,(function(e,n){n.disabled=t})),this.disabled=t}}),r=s._ev[e[0]]={o:o,_id:e[0],$:s._ev,get v(){return o.value},set v(t){o.items[t].checked=!0,o.value=t,this.onchange(t)},dis:function(){this.o.disable(!0)},ena:function(){this.o.disable(!1)},onchange:function(t){$clog(t)}};t.vs?(t.vs.split("|").forEach((function(n){let i=o.son("input",{},{type:"radio",value:n,checked:n==t.v,name:e[0],_g:o,onclick:function(){this._g.value=this.value,r.onchange(this.value)}});i._();o.son("label",{},{innerText:n,for:i,_cx:i,_g:o,onclick:function(){this._g.disabled||(this._cx.checked=!0,this._g.value=this._cx.value,r.onchange(this._g.value))}});o.items[n]=i})),t.v&&(o.value=t.v),o.disable(t.d)):$clog("radio缺少选项!")},n.d=function(t,e,n){var o=s._cont.son("input",Oplus(i,{backgroundColor:"#FFE",paddingLeft:e[2]?"18px":"2px",paddingRight:"2px"},n),{type:"date",disabled:t.d});s._ev[e[0]]={o:o,_id:e[0],$:s._ev,get v(){return this.o.value},set v(t){this.o.value=t},dis:function(){this.o.disabled=!0},ena:function(){this.o.disabled=!1}},t.v&&(o.value=t.v)},n.t=function(t,e,n){var o=s._cont.son("input",Oplus(i,{backgroundColor:"#FFE",paddingLeft:e[2]?"18px":"2px",paddingRight:"2px"},n),{type:"time",disabled:t.d});s._ev[e[0]]={o:o,_id:e[0],$:s._ev,get v(){return this.o.value},set v(t){this.o.value=t},dis:function(){this.o.disabled=!0},ena:function(){this.o.disabled=!1}},t.v&&(o.value=t.v.replace(/\^/g,":"))},n.dt=function(t,e,n){var o=s._cont.son("input",Oplus(i,{backgroundColor:"#FFE",paddingLeft:e[2]?"18px":"2px",paddingRight:"2px"},n),{type:"datetime-local",disabled:t.d});s._ev[e[0]]={o:o,_id:e[0],$:s._ev,get v(){return this.o.value},set v(t){this.o.value=t},dis:function(){this.o.disabled=!0},ena:function(){this.o.disabled=!1}},t.v&&(o.value=t.v.replace(/^/g,":"))},n.R=function(t,e,n){var o=s._cont.son("input",Oplus(i,{backgroundColor:"#FFE",paddingLeft:e[2]?"18px":"2px",paddingRight:"2px",height:"30%",borderWidth:0,backgroundColor:"linear-gradient(to right, #ccc 0, #ccc calc(100%/10), #fff calc(100%/10), #fff)",height:"4px",borderRadius:" 2px"},n),{type:"range",disabled:t.d,oninput:function(){$clog(this.value)}});if(s._ev[e[0]]={o:o,_id:e[0],$:s._ev,get v(){return this.o.value},set v(t){this.o.value=t},dis:function(){this.o.disabled=!0},ena:function(){this.o.disabled=!1}},t.vs){let e=t.vs.split("|");e[0]&&(o.min=e[0]),e[1]&&(o.max=e[1]),e[2]&&(o.step=e[2])}t.v&&(o.value=t.v)},n.l=function(t,e,n){var o=s._cont.son("div",Oplus(i,{backgroundColor:"transparent",paddingLeft:e[2]?"18px":"2px",paddingRight:"2px",borderWidth:0},n),{});t.v?(o.innerText=t.v,s._ev[t.v]=o):s._ev[e[0]]=o},n.c=function(t,e,n){var o=s._cont.son("div",Oplus(i,{backgroundColor:"transparent",paddingLeft:e[2]?"18px":"0px",paddingRight:"4px",opacity:1},n),{});let r=o.son("input",{},{type:"checkbox",disabled:t.d}),l=o.son("label",{},{innerText:e[0],for:r});r._lb=l,o._chx=r,r._000_(),s._ev[e[0]]={o:r,d:o,_id:e[0],$:s._ev,get v(){return this.o.checked},set v(t){var e;this.o.checked="string"==typeof(e=t)?"0"!==e&&""!==e&&"false"!==e:"number"==typeof e?0!==e:Boolean(e),this.onchange()},dis:function(){this.o.disabled=!0,this.d.css({opacity:.5})},ena:function(){this.o.disabled=!1,this.d.css({opacity:1})},onchange:function(){$clog("change")}},r.onchange=function(){s._ev[e[0]].onchange()},o.onclick=function(){this.style.opacity<1||(this._chx.checked=!this._chx.checked,s._ev[e[0]].onchange())},t.v&&(r.checked=t.v)},n.L=function(t,e,n){var o=s._cont.son("div",Oplus(i,{backgroundColor:"rgb(255,255,255,0.2",paddingLeft:e[2]?"18px":"2px",paddingRight:"2px",borderWidth:0,borderRadius:"2px",textShadow:"0px 0px 3px #fff"},n),{disabled:t.d});s._ev[e[0]]={vl:t.v||"",o:o,_id:e[0],$:s._ev,get v(){return this.vl},set v(t){this.vl=t,this.o.innerText=t}},t.v&&(s._ev[e[0]].v=t.v)},n.cl=function(t,e,n){var o=s._cont.son("input",Oplus(i,{backgroundColor:"#FFE",paddingLeft:e[2]?"18px":"2px",paddingRight:"2px"},n),{type:"color",disabled:t.d});s._ev[e[0]]={o:o,_id:e[0],$:s._ev,get v(){return this.o.value},set v(t){this.o.value=t},dis:function(){this.o.disabled=!0},ena:function(){this.o.disabled=!1}},t.v&&(o.value=t.v.replace(/\^/g,":"))};var i={display:"flex",alignItems:"center",border:"1px solid #888",borderRadius:"5px",minWidth:16,fontSize:11,flexGrow:0,width:"auto",userSelect:"none",justifyContent:"center",height:"100%",float:"left",boxSizing:"border-box",padding:5,margin:"0px 2px 0px 2px"};let o=[{backgroundPosition:"center center"},{backgroundPosition:"50% 2px",paddingTop:18},{backgroundPosition:"right 1px center",paddingRight:20},{backgroundPosition:"center bottom 1px",paddingBottom:16},{backgroundPosition:"left 2px center",paddingLeft:20}];this.clc(),s=this;var s=this;return this._ev=this._ev||{},this._cont=this.son("div",Oplus({width:"100%",height:"100%",backgroundColor:"#DDD",boxSizing:"border-box",padding:2,position:"relative",left:0,top:0,display:"flex",alignItems:"center",justifyContent:"center"},e||{})),t.split(",").forEach((function(t,e){""!=t&&("_"==t&&(t="d"+e+"(_):z"),function(t,e){var i=t.split(":"),r=myStrParse(i[0]);i[0]=r.str,""==i[0]&&(i[0]="d"+e,r.c="l");var l=i[2]?Oplus(o[i[2]],{backgroundImage:"url(/svcn/"+(i[3]||18889)+")",backgroundRepeat:"no-repeat",backgroundSize:"16px 16px"}):{};0==i[2]&&(l=Oplus(l,{fontSize:1,color:"transparent"})),l=Oplus(l,{flexGrow:"z"==i[1]?999:0,width:i[1]?"z"==i[1]?"auto":i[1]:"auto"});let a=Oplus({display:"flex",alignItems:"center",border:"1px solid #888",borderRadius:"5px",minWidth:16,fontSize:11,userSelect:"none",justifyContent:"center",height:"100%",boxSizing:"border-box"},l);r.c in n?n[r.c](r,i,l):s._ev[i[0]]=s._cont.son("button",a,{innerText:i[0],disabled:r.d,_id:i[0],$:s._ev,dis:function(){this.disabled=!0},ena:function(){this.disabled=!1},Dis:function(){return this.disabled}})}(t,e))})),this.$=this._ev,this},HTMLElement.prototype.Fly=function(t,e){let n=this;n.pos0||(n.pos0={x:0,y:0,z:0,rX:0,rY:0,rZ:0,sX:1,sY:1,sZ:1,org:"50% 50%",o:1,d:"0"}),n.pos||(n.pos={x:0,y:0,z:0,rX:0,rY:0,rZ:0,sX:1,sY:1,sZ:1,org:"50% 50%"});var i=Oplus(n.pos,t,e?{d:e}:{});isNaN(i.x)||(i.x=i.x+"px"),isNaN(i.y)||(i.y=i.y+"px"),isNaN(i.z)||(i.z=i.z+"px");try{"SS"in t&&(i.sX=i.sY=i.sZ=t.SS)}catch(n){}var o=`translate3d(${i.x}, ${i.y}, ${i.z}) \n rotateX(${i.rX}deg) rotateY(${i.rY}deg) rotateZ(${i.rZ}deg) \n scale3d(${i.sX}, ${i.sY}, ${i.sZ})`;window.requestAnimationFrame((()=>{n.pos=i,t&&"org"in t&&(n.style.transformOrigin=t.org),i.d&&(n.style.transitionDuration=isNaN(i.d)?i.d:i.d+"ms"),n.style.transform=o,t&&"o"in t&&(n.style.opacity=t.o)}))},HTMLElement.prototype.Fly1=function(t,e){let n=this;n.pos0||(n.pos0={x:0,y:0,z:0,rX:0,rY:0,rZ:0,sX:1,sY:1,sZ:1,org:"50% 50%",o:1,d:"0"}),n.pos||(n.pos={x:0,y:0,z:0,rX:0,rY:0,rZ:0,sX:1,sY:1,sZ:1,org:"50% 50%"});var i=Oplus(n.pos,t,e?{d:e}:{});isNaN(i.x)||(i.x=i.x+"px"),isNaN(i.y)||(i.y=i.y+"px"),isNaN(i.z)||(i.z=i.z+"px");try{"SS"in t&&(i.sX=i.sY=i.sZ=t.SS)}catch(n){}var o=`translate3d(${i.x},${i.y},${i.z}) \n rotateX(${i.rX}deg) rotateY(${i.rY}deg) rotateZ(${i.rZ}deg) \n scale3d(${i.sX},${i.sY},${i.sZ})`;n.pos=i,t&&"org"in t&&(n.style.webkitTransformOrigin=n.style.mozTransformOrigin=n.style.msTransformOrigin=t.org),i.d&&(n.style.webkitTransitionDuration=n.style.mozTransitionDuration=n.style.msTransitionDuration=isNaN(i.d)?i.d:i.d+"ms"),n.style.webkitTransform=n.style.mozTransform=n.style.msTransform=o,t&&"o"in t&&(n.style.opacity=t.o)},HTMLElement.prototype.fly=HTMLElement.prototype.Fly,HTMLElement.prototype.nFly=function(t){var e=this;this.ontransitionend=function(){var t=e.posArray.shift();t&&e.Fly(t)},this.posArray=t,this.ontransitionend()},HTMLElement.prototype.FlyP=function(t={}){const e=this,{x:n=0,y:i=0,z:o=0,rx:s=0,ry:r=0,rz:l=0,sx:a=1,sy:d=1,sz:c=1,opa:h=1,dur:u=.6,ease:p="ease",delay:f=0}=t;return e.style.transition=`transform ${u}s ${p} ${f}s,opacity ${u}s ${p} ${f}s`,e.style.transform=`translate3d(${n}px,${i}px,${o}px) rotateX(${s}deg) rotateY(${r}deg) rotateZ(${l}deg) scale3d(${a},${d},${c})`,e.style.opacity=h,new Promise((t=>{if(0===u+f)return void requestAnimationFrame((()=>t(e)));const n=i=>{i.target!==e||"transform"!==i.propertyName&&"opacity"!==i.propertyName||(e.removeEventListener("transitionend",n),t(e))};e.addEventListener("transitionend",n)}))},HTMLElement.prototype.mySPan=function(t){var e=Oplus({bw:"66px 30px 60px 30px",cap:"标签",start:32,lWidth:40,lHeight:32,mColor:"rgb(255,0,0,0.21)",btcss:{}},t);this.lps||(this.lps=[]);var n=this.son("div:pan",{zIndex:100},{stat:0,init:function(){const t=this;this.bt=this.son("div",Oplus({position:"absolute",right:-e.lWidth,top:e.start,userSelect:"none",textAlign:"center",clipPath:e.clipPath,fontSize:12,width:e.lWidth,height:e.lHeight,boxSizing:"border-box"},e.btcss),{innerText:e.cap,init:function(){this._000_()},onclick:function(){t.stat?t.close():t.open()}}),this.m=this.son("div:panN",{borderWidth:e.bw,borderStyle:"solid",borderColor:e.mColor},{onclick:function(){try{_backRun()}catch(t){}}}),this.c=this.m.son("div:pp",{boxShadow:"0px 0px 8px #000",backgroundColor:"#FFF"},{init:function(){this._000_()}}),this.Fly({x:"-100%"})},onclick:function(){this.myclose()},open:function(t){if(!this.stat){var e=this;this.stat=1,this.style.zIndex=101,this.Fly({x:0},500),this.openFun();try{t||_backKey((function(){e.myclose()}))}catch(t){}}},myclose:function(){this.stat=0,this.style.zIndex=100,this.closeFun(),this.fly({x:"-100%",org:"0 0"},500)},close:function(){try{_backRun()}catch(t){}},openFun:function(){},closeFun:function(){}});return this.lps.push(n),n};var cs19140=0,bw19140=6;function convertToCalc(t){if(t.includes(".")){const[e,n]=t.split(".");return`calc(100vw * ${n} / ${e})`}return t}function mFR19140INI(){window.myFrm19140=document.body.son("div",{position:"absolute",zIndex:400,width:"auto",fontSize:12,left:0,top:0,padding:3,visibility:"hidden",backgroundColor:"#F00",border:"1px solid #000",borderRadius:"4px",boxSizing:"border-box"})}function _w_19140(t,e){return window.myFrm19140||mFR19140INI(),myFrm19140.innerText=t,myFrm19140.offsetWidth+24+(e||0)+"px"}function myDoc(t,e){var n=t.son("div:ediv",e||{backgroundColor:"#FFF"});return n.标题=function(t,e,n){return this.son(`H${e||3}`,{padding:5,margin:"0px",backgroundColor:"#ddd"},{innerHTML:t,ch:n})},n.add=function(t,e){return this.son("div",e||{display:"inblock"},{innerHTML:t})},n.pv0=function(t,e){var n=this.son("div",e||{display:"inblock"},{});t.split("---").forEach((function(t){n.son("p:pv0",{},{innerHTML:t})}))},n.html=function(t,e){this.son("pre",e||{display:"inblock"},{innerText:t})},n.code=function(t,e){this.son("div",{overflow:"scroll"}).son("pre",{width:"auto",whiteSpace:"nowrap"},{innerHTML:t})},n.url=function(t,e,n){return this.son("a",{},{innerText:t,href:e})},n}function CMEditor(t,e,n){var i={};i.rid=e||19404,i.fdn=n||"text";var o=(t||document.body).son("div:eediv",{position:"relative",left:0,top:0});i.fip=19404,i.title="CMEditor",i.cont=o;var s=(h=o).son("div",{position:"absolute",top:60,left:2,width:24,height:24,backgroundColor:"rgb(255,200,0,1)",borderRadius:"12px",zIndex:1120,display:"none"},{ena:function(){this.style.display=""},dis:function(){this.style.display="none"},title:"sa2ve "+i.rid+":"+i.fdn,onclick:function(){myPostS(19450,[i.fdn,i.rid],encodeURI(c.getValue()),(function(t){c.okx()}))}}),r=h.son("div",{position:"absolute",bottom:40,left:2,width:24,height:24,backgroundColor:"rgb(100,255,100,1)",borderRadius:"12px",zIndex:120,display:"none"},{ena:function(){this.style.display=""},dis:function(){this.style.display="none"},title:"load "+i.rid+":"+i.fdn,onclick:function(){myGetS(19451,[i.fdn,i.rid],(function(t){c.setValue(t[0][i.fdn]),c.okx()}),!0)}}),l=(s=h.son("div",{position:"absolute",top:60,left:2,width:24,height:24,backgroundColor:"rgb(255,200,0,1)",borderRadius:"12px",zIndex:1120,display:"none"},{ena:function(){this.style.display=""},dis:function(){this.style.display="none"},title:"sa2ve "+i.rid+":"+i.fdn,onclick:function(){myPostS(19450,[i.fdn,i.rid],encodeURI(c.getValue()),(function(t){c.okx()}))}}),r=h.son("div",{position:"absolute",bottom:40,left:2,width:24,height:24,backgroundColor:"rgb(100,255,100,1)",borderRadius:"12px",zIndex:120,display:"none"},{ena:function(){this.style.display=""},dis:function(){this.style.display="none"},title:"load "+i.rid+":"+i.fdn,onclick:function(){myGetS(19451,[i.fdn,i.rid],(function(t){c.setValue(t[0][i.fdn]),c.okx()}),!0)}}),(d=o.son("div:eediv",{position:"absolute",left:0,top:0})).son("textArea:pp"));(c=i.editor=CodeMirror.fromTextArea(l,{lineNumbers:!0,mode:"javascript"}))._c_ont=d,c.resize=function(){this.setSize(this._c_ont.offsetWidth,this._c_ont.offsetHeight)},c.resize(),c.on("change",(function(){d.r("15").css({backgroundColor:"#f88"}),s.ena(),r.ena()}));var a=d.r("1").css({backgroundColor:"#FFE",position:"relative"});c.okx=function(){d.r("15").css({backgroundColor:"#fff"}),s.dis(),r.dis()},d.r("1520").css({backgroundColor:"#EEE",color:"#FF0"}),d.r("1520").onclick=function(){c.resize()};a.son("div",{position:"absolute",top:0,left:0,width:"auto",height:"auto",padding:"2 0 2 0",color:"#22c",zIndex:10,display:"",textShadow:"1px 1px 1px #aaa",writingMode:"vertical-rl"},{innerText:i.fdn,title:"resize",onclick:function(){c.resize()}}),a.son("div",{position:"absolute",top:0,left:0,width:"auto",height:"auto",padding:"2 0 2 0",color:"#22c",zIndex:10,display:"",textShadow:"1px 1px 1px #aaa",writingMode:"vertical-rl"},{innerText:i.fdn,title:"resize",onclick:function(){c.resize()}});var d,c,h=o;l=(d=o.son("div:eediv",{position:"absolute",left:0,top:0})).son("textArea:pp");(c=i.editor=CodeMirror.fromTextArea(l,{lineNumbers:!0,mode:"javascript"}))._c_ont=d,c.resize=function(){this.setSize(this._c_ont.offsetWidth,this._c_ont.offsetHeight)},c.resize(),c.on("change",(function(){d.r("15").css({backgroundColor:"#f88"}),s.ena(),r.ena()}));a=d.r("1").css({backgroundColor:"#FFE",position:"relative"});return c.okx=function(){d.r("15").css({backgroundColor:"#fff"}),s.dis(),r.dis()},d.r("1520").css({backgroundColor:"#EEE",color:"#FF0"}),d.r("1520").onclick=function(){c.resize()},r.onclick(),i}function myTabBar(t,e,n,i,o){var s=new Object;return s.a4=n||"#aaa",s.a8=i||"#ccc",s.ae=o||"#eee",s.rp=t||document.body,s.tabs={},s.a=!1,s.rp.innerHTML="
",s.rt=s.rp.r("0"),s.hr=s.rp.r("0000000"),s.bd=s.rp.r("00100"),s.a=!1,s.bd.parentElement.style.borderTopColor=s.ae,s.tabClick=function(t,e,n){},s.hidePage=function(t,e){var n=this.tabs[t];n?(n.b.style.display=e?"none":"",n.style.display=e?"none":""):console.log("notab:"+t)},s.onchange=function(t,e){},s.addCell=function(t,e,n,i,o){if(this.tabs[t])return this.selectTab(t),this.tabs[t];var r=s.hr.insertCell(s.hr.cells.length-1);r.innerText=e,r._id=t,r.css({backgroundColor:s.a8,width:n||"auto",minWidth:35,textAlign:"center",padding:"3px 8px 3px 8px",userSelect:"none",borderRadius:"6px 6px 0px 0px",boxShadow:"0px 0px 3px #337"}),s.a&&s.a.fly({x:1e3,SS:0});var l=s.bd.son("div",{width:"100%",height:"100%",overflow:"auto",position:"absolute",display:"block",backgroundColor:"#FFF"});return l.b=r,r.c=l,l._id=t,r.onclick=function(){let t=!1;s.a&&(t=s.a,s.a.fly({x:1e3,SS:0}),s.a.b.css({backgroundColor:s.a8})),this.c.fly({x:0,SS:1}),this.css({backgroundColor:s.ae}),s.a=this.c,this.c.onSelect&&this.c.onSelect(this.c);var e=this;s.tabClick(e._id,e,e.c),s.onchange(this.c)},i?(s.a&&s.a.b.css({backgroundColor:s.a8}),r.css({backgroundColor:s.ae}),s.a=l):(l.fly({x:1e3,SS:0}),s.a&&s.a.fly({x:0,SS:1})),s.tabs[t]=l,l},s.addTab=s.addCell,s.selectTab=function(t,e){var n=this.tabs[t],i=!1;this.a&&(i=this.a,this.a.fly({x:1e3,SS:0},"0s"),this.a.b.css({backgroundColor:this.a8})),n.fly({x:0,SS:1},"0s"),n.b.css({backgroundColor:s.ae}),s.a=n,s.onchange(this.a,i),e&&e(n,i)},s.delCell=function(t){var e=this.tabs[t];e?($cle(e.b),$cle(e),delete this.tabs[t]):console.log("notab:"+t)},s.hideHeader=function(){this.rt.r("00").style.height=0,this.rt.r("000").style.display="none"},s.showHeader=function(){this.rt.r("00").style.height=32,this.rt.r("000").style.display=""},s}function codeEditor(t,e){var n={};n.rid=e||19537;var i=(t||document.body).son("div:eediv",{});if(n.fip=19416,n.title="codeEditor",n.cont=i,i.myFrm("t:32+body",!0),console.log(typeof window.CodeMirror),!window.CodeMirror){var o=myGetSA(19431,[]);$clog("codemirror.css:"+o.length),loadStyle(o);o=myGetSA(19435,[]);$clog("codemirror.js:"+o.length),loadScript(o)}var s=n.topBar=i._fv.t.son("div:pp",{overflowX:"scroll"}).myFBar("[id],id(L):50,[cmdname],cmdname(i):120,[cmdtype],cmdtype(s){|mdjas|djs|msqlcmd|treeHtml|text|js|djs|djar|sqlcmd|dbpost|mypost|fun},[caption],caption(i):80,[connid],connid(i):80,load");s._ev.id.o.css({color:"#F00"},{innerText:n.rid}),s._ev.load.onclick=function(){},s.load=function(){myGetS(19456,[n.rid],(function(t){var e=t[0];for(var n in e)try{s._ev[n].v=e[n]}catch(t){console.log("==============="+t)}}),!0)},s.load();var r=n.body=i._fv.body.son("div:eediv",{border:"0px solid #DEF",boxSizing:"border-box",position:"relative",backgroundColor:"#DEF"},{init:function(){this.myHTML("
"),this.resizeA=[]},setSize:function(t){var e=t.offsetLeft+5,n=t.offsetTop+8;this._ev.t.style.height=n,this._ev.tl.style.width=e,this._ev.bl.style.width=e,this.resizeA.forEach((function(t){t()}))}}),l=r.son("div",{position:"absolute",left:"calc(50% - 10px)",top:"calc(50% - 10px)",width:20,height:20,borderRadius:"20px",backgroundColor:"RGB(255,0,0,0.3)",boxShadow:"0px 0px 3px #000",zIndex:200});r.onclick=function(){if(event.ctrlKey){var t=r.getBoundingClientRect();l.style.left=event.clientX-t.x-10,l.style.top=event.clientY-t.y-10,r.setSize(l)}},l.draggable=!0,l.ondragstart=function(t){this._x=event.offsetX,this._y=event.offsetY,this._X=this.offsetLeft,this._Y=this.offsetTop},l.ondragend=function(t){this.style.left=event.offsetX+this._X-12,this.style.top=event.offsetY+this._Y-12;r.setSize(l)};let a="tl,tr,bl,br".split(","),d="remark,text,sql,fmt".split(",");return r.editors={},d.forEach((function(t,e){var i=r._ev[a[e]].son("div:pp",{backgroundColor:"#FFF"});r.editors[t]=function(t,e,n){var i={};i.rid=e||19404,i.fdn=n||"text";var o=(t||document.body).son("div:eediv",{position:"relative",left:0,top:0});return i.fip=19404,i.title="CMEditor",i.cont=o,loadLed.onclick(),i}(i,n.rid,t),r.resizeA.push((function(){r.editors[t].editor.resize()}))})),n}function myAcc(t,e){var n=new Object;return n.o={},n.bClick={},n.rp=t||document.body,n.a=!1,n.hdcss=OPlus({borderTop:"1px solid #ccc",borderBottom:"1px solid #444",verticalAlign:"middle",backgroundColor:"#468",color:"#ff0",paddingLeft:10,display:"block",userSelect:"none",lineHeight:"30px"},e),n.p=n.rp.son("Table",{width:"100%",overflow:"hidden",height:"100%",borderCollapse:"collapse",border:"0px solid #000"}),n.p.cellPadding=0,n.p.cellSpacing=0,n.Ccells={},n.cells={},n.aCell=!1,n.openItem=function(t){this.cells[t].click()},n.addCell=function(t,e,i,o,s,r){var l=this.p.addRow(-1).addCell(-1,{position:"relative",color:"#A03",textShadow:"\n -1px -1px 1px #ddd,\n 1px 1px 2px #666",padding:4,backgroundColor:"#ccc",borderBottom:"1px solid #888",fontWeight:"bold",cursor:"default",userSelect:"none"},{__id:t,__capt:e}),a={width:"100%",height:"100%",overflow:"hidden",position:"relative"};if(o)for(var d in o)a[d]=o[d];l.innerText=e,l.css(this.hdcss),l.parentElement.css({height:30});var c=this.p.insertRow(-1).addCell(-1,{},{__id:t,__capt:e});c.css({overflow:"hidden"});var h=c.son("div:pp",{overflowY:"auto"}).son("div:ediv",{overflow:"visible"},{__id:t,__capt:e});return l.rc=c,l.dx=h,this.cells[t]=l,this.Ccells[e]=l,h.cCell=l,l.onclick=function(){n.a&&(n.a.rc.parentElement.style.display="none",n.a.dx.onclose&&n.a.dx.onclose(n.a,this)),this.rc.parentElement.style.display="table-row",this.dx.onopen&&this.dx.onopen(this.dx),n.a=this},h.onopen=s||!1,h.onclose=r||!1,i?(n.a&&(n.a.rc.parentElement.style.display="none"),n.a=l,c.parentElement.css({display:"table-row"}),h.ofun&&h.ofun()):c.parentElement.css({display:"none"}),h},n}function myDoc(t,e){var n=t.son("div",Oplus({position:"relative",overflow:"scroll",width:"100%",height:"100%"},e));return n._3D(),loadStyle(".mydocA{ color:#00a; cursor:pointer; //background-color:#ccc; padding:3px 6px 3px 6px; border-radius:4px;}.mydocA:hover{background-color:rgb(180,180,180,0.3)}.mydocC{color:#a00;background-color:rgb(255,255,180,0.3)}.mydoci{height:24;vertical-align: middle}"),n.okExp=[{e:RegExp(/\[B(.*?)\]/,"ig"),f:function(t){var e=t.substring(2,t.length-1).split(":");return 1==e.length&&(e[1]=e[0]),""}},{e:RegExp(/\[A(.*?)\]/,"ig"),f:function(t){var e=t.substring(2,t.length-1).split(":");return 1==e.length&&(e[1]=e[0]),""+e[1]+""}},{e:RegExp(/\[C(.*?)\]/,"ig"),f:function(t){var e=t.substring(2,t.length-1).split(":");return 1==e.length&&(e[1]=e[0]),""+e[1]+""}},{e:RegExp(/\[i(.*?)\]/,"ig"),f:function(t){var e=t.substring(2,t.length-1).split(":");return 1==e.length&&(e[1]=e[0]),""}}],n.ok=function(t){var e=t;return n.okExp.forEach((function(t){var n=t.e,i=t.f;e=e.replace(n,i)})),e},n.H=function(t,e){return n.son("h"+e||3,{padding:5,marginBlock:"0px",display:"block"},{innerText:t})},n.p0=function(t,e){var n=this.son("div",e||{});return t.split(">>>").forEach((function(t){n.son("p:pv0",{},{innerHTML:t})})),n},n.t=function(t,e){var i=this.son("div:pv0",e||{});return i.myHTML(n.ok(t)),i},n.code=function(t,e){return this.son("pre",OPlus({whiteSpace:"pre"},e),{innerText:t})},n.$=n._ev,n}function myGrid(t,e,n){if(!n)n={};var i={hr:Oplus({height:24},n.hr),hc:Oplus({height:24,fontSize:12},n.hc),gc:Oplus({fontSize:12},n.gc),gr:Oplus({height:30},n.gr)},o=t.son("table:etb",{tableLayout:"fixed"},{cellPadding:0});t._o=o,o._p=t,o.ds={},o.stru=[],o.rs={},o.HTD=o.addRow(-1,{}).addCell(-1,Oplus({backgroundColor:"rgb(220,220,220,0.5)",position:"relative"},i.hr),{init:function(){o.hdcell=this,o.hh=this.son("div:pp",{position:"absolute",backgroundColor:"rgb(80,80,80,0.1)"})}}).son("table:etb",{tableLayout:"fixed"},{cellPadding:0,init:function(){o.HTB=this}}).addRow(-1,{},{}),o.GTD=o.addRow().addCell(-1,{border:"0px solid #f00"},{}).son("div:ydiv",{overflowY:"scroll"},{init:function(){o.TBC=this}}).son("table:eetb",{},{init:function(){o.GTB=this}}),e.split(";").forEach((function(t){var e=t.split(",");if(!(e.length<4)){var n={id:e[0],lable:e[1],w:e[2],a:e[3],t:e[4]||"t",e:e[5]||"0"};n._v=-1==n.w?"none":"",o.stru.push(n),o.HTD.addCell(-1,Oplus({width:"_"==e[2]?null:e[2],textAlign:"center",display:n._v,border:"1px solid #aaa",borderWidth:"0px 1px 0px 1px"},i.hc),{className:"pvgridtd",innerText:e[1]})}}));return new ResizeObserver((t=>{o.hdcell.style.paddingRight=o.TBC.scrollbarWidth()})).observe(o.TBC),o.setData=function(t,e){this.ds=t;const n={l:"left",c:"center",r:"right"};t.forEach((function(t){var s=o.GTD.addRow(-1,Oplus({},i.gr),{});o.rs[t.id]=s,s.ds=s._dt=t,t.o=s,o.stru.forEach((function(e){var r=s.addCell(-1,Oplus({width:e.w,textAlign:n[e.a],border:"1px solid #ddd",display:e._v},i.gc),{className:"pvgridtd",innerText:t[e.id],fdName:e.id,rId:t.id});"E"==e.t&&r.rED(o.edB,o.edA,o.edP),"C"==e.t&&(r.innerText="",r.css({backgroundIamge:1==t[e.id]?thattsvg:thatfsvg}))})),e&&e(s,t)}))},o.clear=function(){o.GTD.clc(),o.ds={}},o.aRow=!1,o.GTD.onclick=function(){var t=event.srcElement;t.parentElement;if("TD"==t.tagName)if(t._fdClick)t._fdClick(t,r.parentElement);else{var e=o.aRow;o.aRow&&(o.aRow.style.backgroundColor=o.aRowBackcolor),o.aRow=t.parentElement,o.aRowBackcolor=o.aRow.style.backgroundColor,o.aRow.style.backgroundColor="rgb(255,255,30,0.6)",o.trClick&&o.trClick(o.aRow,t,e,o.stru[t.cellIndex])}},o.GTD.addEventListener("dblclick",(function(){var t=event.srcElement;t.parentElement;o.trDBClick&&o.trDBClick(o.aRow,t,o.stru[t.cellIndex])})),o.selectRow=function(t){this.rs[t]?(this.rs[t].cells[0].click(),this.rs[t].inView()||this.rs[t].scrollIntoView()):$clog("no---")},o.setTdClick=function(t,e){console.log(this.stru)},o.edB=function(){},o.edA=function(){},o.edP=function(){},o.colVisible=function(t,e){o.cEval(t,(function(t){t.style.display=e?"":"none"}))},o.cellx=function(t,e){return this.rs[t].cells[this.stru.findIndex((t=>t.id===e))]},o}function myContextMenu(t,e,n){var i=document.body.son("div",Oplus({position:"absolute",zIndex:3e3,boxShadow:"0px 0px 4px #000",padding:5,visibility:"hidden",borderRadius:"5px",minWidth:10,minHeight:10,color:"#FFa",fontSize:12,backgroundColor:"rgb(255,250,250,0.8)",textAlign:"left",opacity:.8,boxSizing:"border-box",cursor:"pointer"},t),{init:function(){let t=this;function e(e){t.contains(e.target)||t.hide()}function n(e){"Escape"===e.key&&t.hide()}this._registerAutoClose=()=>{document.addEventListener("mousedown",e),document.addEventListener("keydown",n)},this._unregisterAutoClose=()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",n)},this._registerAutoClose()},hide:function(){this.style.visibility="hidden"},applyTo:function(t,e){t.addEventListener(e||"contextmenu",(function(t){t.preventDefault(),t.stopPropagation(),i.offsetWidth+t.clientX>window.innerWidth?i.style.left=(t.clientX-i.offsetWidth+3>0?t.clientX-i.offsetWidth+8:8)+"px":i.style.left=t.clientX-8+"px",i.offsetHeight+t.clientY>window.innerHeight?i.style.top=(t.clientY-i.offsetHeight+3>0?t.clientY-i.offsetHeight+8:8)+"px":i.style.top=t.clientY-8+"px";var e=i.beforPop(i);i.event=t,i.o=this,e&&(i.style.visibility="visible")}))},show:function(t){$clog("----------------------sss")},beforPop:n||function(){return $clog("请定义beforePop"),!0},onclick:function(){event.stopPropagation()}});return e&&i.applyTo(e),i}function myButtonPop(t,e,n,i,o){t.$css({position:"relative",overflow:"visible",backgroundImage:svgURL(''),backgroundPosition:"right top",backgroundSize:"8px 8px"},{onmouseenter:function(){o||this.click()}});var s=t.pop=t.son("div",Oplus({position:"absolute",width:e,height:n,zIndex:200,boxSizing:"border-box",borderRadius:"4px",boxShadow:"0px 0px 5px #000",bottom:t.offsetHeight,left:0,backgroundColor:"rgb(200,255,255,0.6)",border:"0px solid #F00"},i),{stat:0,ow:t,owbg:t.style.backgroundColor,init:function(){var e=this;this._000_();var n=this.getBoundingClientRect();t.getBoundingClientRect();this.popx=0,this.popy=0,n.right>window.innerWidth&&(this.popx=-(n.right-window.innerWidth+10)),n.left<0&&(this.popx=10-n.left),n.top<100&&(this.style.bottom=null,this.style.top=t.offsetHeight-5,this.popy=0),this.Fly({SS:0,x:0,y:0,o:"0",org:"0% 50%"}),document.addEventListener("click",(function(n){t.disabled||(n.srcElement==e.ow?e.revert():1==e.stat&&e.close())}))},onclose:!1,onopen:!1,open:function(t){this.stat=1,this.ow.css({color:"#FF8",backgroundColor:"#488"}),this.Fly({SS:1,o:1,x:this.popx,y:this.popy,d:200,org:"0 100%"}),this.onopen&&this.onopen()},close:function(){this.stat=0,this.ow.css({color:"#000",backgroundColor:this.owbg}),this.Fly({SS:0,o:0,x:0,y:0,d:200,org:"0 100%"}),this.onclose&&this.onclose()},revert:function(){0==this.stat?this.open():this.close()}});return o||s.addEventListener("mouseleave",(function(){this.close()})),s}function myChechGroup(t,e,n,i){t.svg=i||'\n---\n',t.svg=t.svg.split("---"),t.svg[0]='url("data:image/svg+xml,'+encodeURIComponent(t.svg[0])+'")',t.svg[1]='url("data:image/svg+xml,'+encodeURIComponent(t.svg[1])+'")',t.fColor=["#888","#000"],t.css({display:"flex",flexWrap:"wrap",alignContent:"flex-start",fontSize:12,padding:5},{});var o={};return t.ini=function(e){this.clc(),o={},"",e.split(",").forEach((function(e){o[e]=t.son("div",{backgroundPosition:"5 center",fontSize:12,backgroundSize:"auto 60%",userSelect:"none",backgroundImage:t.svg[0],color:t.fColor[0],display:"flex",padding:"5 5 5 24",width:"auto",borderRadius:"5px",border:"0px solid rgb(0,0,0,0.05)"},{checked:0,innerText:e,onclick:function(){this.checked=this.checked?0:1,this.style.backgroundImage=t.svg[this.checked],this.style.color=t.fColor[this.checked],t.onchange(t.getVal())},setv:function(e){this.checked=e,this.style.backgroundImage=t.svg[this.checked],this.style.color=t.fColor[this.checked]}})}))},e&&t.ini(e),t.setVal=function(t){OPEval(o,(function(t,e){o[t].setv(0)})),t&&t.split(",").forEach((function(t){o[t].setv(1)}))},n&&t.setVal(n),t.getVal=function(){var t=[];return OPEval(o,(function(e,n){n.checked&&t.push(e)})),t.join(",")},t.onchange=function(t){},t}function myRadioGroup(t,e,n,i){t.svg=i||'\n---\n',t.svg=t.svg.split("---"),t.svg[0]='url("data:image/svg+xml,'+encodeURIComponent(t.svg[0])+'")',t.svg[1]='url("data:image/svg+xml,'+encodeURIComponent(t.svg[1])+'")',t.fColor=["#888","#000"],t.css({display:"flex",flexWrap:"wrap",alignContent:"flex-start",fontSize:12,padding:5},{});var o={},s="";return t.ini=function(e){this.clc(),o={},s="",e.split(",").forEach((function(e){o[e]=t.son("div",{backgroundPosition:"5 center",fontSize:12,backgroundSize:"auto 60%",userSelect:"none",backgroundImage:t.svg[0],color:t.fColor[0],display:"flex",padding:"5 5 5 24",width:"auto",borderRadius:"5px",border:"0px solid rgb(0,0,0,0.05)"},{checked:0,innerText:e,onclick:function(){if(""!=s&&s!=this.innerText)try{o[s].setv(0)}catch(t){}this.checked=this.checked?0:1,this.style.backgroundImage=t.svg[this.checked],this.style.color=t.fColor[this.checked],s=this.checked?this.innerText:"",t.onchange(t.getVal())},setv:function(e){this.checked=e,s=1==e?this.inerText:"",this.style.backgroundImage=t.svg[this.checked],this.style.color=t.fColor[this.checked]}})}))},e&&t.ini(e),t.setVal=function(t){""!=s&&o[s].setv(0),""!=t&&o[t].setv(1)},n&&t.setVal(n),t.getVal=function(){return s},t.onchange=function(t){$clog(t)},t}function popCMenu(t,e){var n=e||window.event;t.offsetWidth+n.clientX>window.innerWidth?t.style.left=(n.clientX-t.offsetWidth+5>0?n.clientX-t.offsetWidth+5:5)+"px":t.style.left=n.clientX-5+"px",t.offsetHeight+n.clientY>window.innerHeight?t.style.top=(n.clientY-t.offsetHeight+5>0?n.clientY-t.offsetHeight+5:5)+"px":t.style.top=n.clientY-5+"px",t.style.visibility="visible"}window.myFrm19140=!1,window.addEventListener("load",(function(){mFR19140INI()})),window.captionLen=_w_19140,HTMLElement.prototype.myFrm=function(t,e,n,i,o){let s=this,r=n||this,l=e||0;var a=!1;function d(t){if(t.startsWith("(")&&t.endsWith(")")){let e=0,n=!0;for(let i=1;i-1&&0===o?(n.push(i.trim()),i=""):i+=t;return i&&n.push(i.trim()),n}r._fv||(r._fv={},r.__={},r.$={},r.aOb=function(t,e){"function"==typeof e&&(r.$[t]||(r.$[t]=[]),r.$[t].push(e))},r.rOb=function(t,e){const n=r.$[t];if(n){const t=n.indexOf(e);t>-1&&n.splice(t,1)}}),r==this&&(r.$=r._fv,r.vixEs=s._fv);var h,u=c(t,0);if(u.length>1)return h=etb(s),u.forEach((function(t){h.addRow(-1).addCell(-1).myFrm(t,0,r,i)})),s;if((u=c(t,1)).length>1)return h=etb(s).addRow(-1),void u.forEach((function(t){h.addCell(-1,{boxSizing:"border-box"}).myFrm(t,1,r,i)}));var p,f;if((u=c(t,2)).length>1){if(""!=u[1]&&(s._size=!0,0==l?s.style.height=convertToCalc(u[1]):1==l?s.style.width=u[1]:console.log("不知道会不会出现")),u[2]){if("F"==u[2]&&s.css({backgroundColor:"#CCC",borderBottom:"1px solid #aaa"}),"g"==u[2]&&s.css({backgroundColor:"#FAFAFA"}),"f"==u[2]&&s.css({backgroundColor:"rgb(222,222,222,0.4)"}),("t"==u[2]||"b"==u[2])&&0==l){s.parentElement.parentElement.parentElement.addRow(s.parentElement.rowIndex+("b"==u[2]?1:0),{height:bw19140,backgroundColor:"#aaa",cursor:"row-resize"}).addCell(-1,{boxSizing:"border-box"},{ondragstart:function(){a=this.rObj.children[0].style.display,this.rObj.children[0]&&(this.rObj.children[0].style.display="none")},ondragend:function(){this.rObj.style.height=this.rObj.offsetHeight+event.offsetY*this._rr,this.rObj.children[0]&&(this.rObj.children[0].style.display=a),r.afterResize&&r.afterResize()},draggable:!0,rObj:s,_rr:"t"==u[2]?-1:1})}if(("l"==u[2]||"r"==u[2])&&1==l)s.parentElement.addCell(s.cellIndex+("r"==u[2]?1:0),{width:bw19140,backgroundColor:"#aaa",cursor:"col-resize",boxSizing:"border-box"},{draggable:!0,ondragstart:function(){a=this.rObj.children[0].style.display,this.rObj.children[0]&&(this.rObj.children[0].style.display="none")},ondragend:function(){this.rObj.style.width=this.rObj.offsetWidth+event.offsetX*this._rr,this.rObj.children[0]&&(this.rObj.children[0].style.display=a),r.afterResize&&r.afterResize()},rObj:s,_rr:"l"==u[2]?-1:1})}s.myFrm(u[0],0,r,i)}else{s.css(i?{backgroundColor:gColor(cs19140++,.6),backgroundRepeat:"no-repeat",backgroundSize:"100% 155",backgroundImage:`url(/svcn/svg_text?${t})`}:{},{});var g=t,m=s;if("_"==t[0])g=t.substring(1),s._size||(s.style.width=_w_19140(g,-10)),m=s.$css({boxSizing:"border-box",padding:3,borderColor:"transparent",cursor:"pointer",textAlign:"center",verticalAlign:"center",fontSize:12},{innerText:g,_id:g});else if("="==t[0])g=t.substring(1),s._size||(s.style.width=_w_19140(g-14)),s.css({boxSizing:"border-box"}),m=s.son("div:btdiv",{minHeight:26},{innerText:""}),Object.defineProperty(r._fv,g,{configurable:!0,get:()=>m.innerText,set(t){m.innerText=t}}),r._fv["___"+g]=m,r.__[g]=m,g=!1;else if("@"==t[0])g=t.substring(1),s.css({boxSizing:"border-box",fontSize:12}),m=s,Object.defineProperty(r._fv,g,{configurable:!0,get:()=>m.innerText,set(t){m.innerText;m.innerText=t}}),r._fv["___"+g]=m,g=!1;else if("^"==t[0]){s.css({boxSizing:"border-box",minHeight:28,padding:3});var b=(g=t.substring(1)).split("_");g=b[0];var v=b[0];if(!s._size)if(1==b.length){s.style.width=_w_19140(g);var L={}}else if(2==b.length){s.style.width=_w_19140(g,12);L={paddingLeft:20,backgroundImage:`url(/svcn/${b[1]})`,backgroundSize:"20px 20px",backgroundPosition:"5px center",border:"1px solid #AAA",borderRadius:"3px"}}else{L={paddingLeft:20,backgroundImage:`url(/svcn/${b[1]})`,backgroundSize:"16px 16px",backgroundPosition:"center",border:"1px solid #AAA",borderRadius:"3px"};v="",s.title=b[0],s.style.width=b[2]||40}m=s.son("button:pp",Oplus({width:"100%",textAlign:"center",fontSize:12},L),{innerText:v,title:g,onclick:function(){r._fv["_"+g]&&r._fv["_"+g](this)}})}else if("?"==t[0]){s.css({boxSizing:"border-box",padding:3});var y=(g=t.substring(1)).split("_"),x="text";g=y[0],2==y.length&&(x=y[1],g=y[0]),m=s.son("input:pp",{border:"1px solid rgb(0,0,0,0.4)",borderRadius:"4px",padding:5,fontSize:12},{type:x,placeholder:g,__idO:g,onchange:function(){r._fv["_"+this.__idO]&&r._fv["_"+this.__idO](this.value)}}),Object.defineProperty(r._fv,g,{configurable:!0,get:()=>m.value,set(t){var e=m.value;m.value=t,m&&m.onchange&&e!=t&&(m.onchange&&m.onchange(),r._fv["_"+this.__idO]&&r._fv["_"+this.__idO](t))}}),r._fv["___"+g]=m,r.__[g]=m,m._id=g,m._frm=r,g=!1}else if("F"==t[0]||"<"==t[0])g=t.substring(1),s._size||(s.style.width=_w_19140(g,-10)),(m=s.son("input:pp",{padding:5,display:"none"},{type:"file",_id:g,onchange:function(){r._fv["_"+this._id]&&r._fv["_"+this._id](event.target.files)}})).bt=s.son("button:pp",{fontSize:12,textAlign:"center"},{innerText:g,_id:g,onclick:function(){r._fv["_b"+this._id]&&r._fv["_b"+this._id](this)}}),s.css({boxSizing:"border-box",padding:3,color:"#00a",fontSize:12,textAlign:"center"},{onclick:function(){m.click()}}),r._fv["___"+g]=m,r._fv[g]=s,r.__[g]=m,g=!1;else if("%"==t[0])s.css({boxSizing:"border-box",padding:3,position:"relative"}),g=t.substring(1),(m=s.son("input:pp",{position:"absolute",top:0,left:0},{_id:g,type:"range",oninput:function(){r._fv[this._id]=this.value}})).vl=s.son("div",{position:"absolute",width:"100%",height:"100%",opacity:.8,left:0,bottom:0,textShadow:"\n -1px -1px 0 #000,\n 1px -1px 0 #000,\n -1px 1px 0 #000,\n 1px 1px 0 #000\n ",color:"#FAA",textAlign:"left",zIndex:2,pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"monospace",userSelect:"none",fontSize:16},{}),p=0,f=g,Object.defineProperty(r._fv,g,{configurable:!0,get:()=>p,set(t){p=t,m.value=t,m.vl.innerText=t,r._fv["_"+f]&&r._fv["_"+f](t)}}),r._fv[g]=m.value,r._fv["___"+g]=m,r.__[g]=m,m._id=g,m._frm=r,g=!1;else if("#"==t[0])s.css({boxSizing:"border-box",padding:3,border:"0px solid rgb(0,0,0,0.4)",borderRadius:"4px"}),g=t.substring(1),m=s.son("textarea:pp",{padding:5,overflow:"auto",fontSize:12},{placeholder:g}),Object.defineProperty(r._fv,g,{configurable:!0,get:()=>m.value,set(t){m.value=t}}),r._fv["___"+g]=m,r.__[g]=m,g=!1;else if("!"==t[0]||"["==t[0])s.css({boxSizing:"border-box",padding:3}),g=t.substring(1),m=myChechGroup(s.son("div:pp",{backgroundColor:"#FFF",border:"1px solid #eee"})),Object.defineProperty(r._fv,g,{configurable:!0,get:()=>m.getVal(),set(t){m.setVal(t)}}),r._fv["___"+g]=m,r.__[g]=m,m._id=g,m._frm=r,g=!1;else if("。"==t[0]||"]"==t[0])s.css({boxSizing:"border-box",padding:3}),g=t.substring(1),m=myRadioGroup(s.son("div:pp",{backgroundColor:"#FFF",border:"1px solid #eee"})),Object.defineProperty(r._fv,g,{configurable:!0,get:()=>m.getVal(),set(t){m.setVal(t)}}),r._fv["___"+g]=m,r.__[g]=m,m._id=g,m._frm=r,g=!1;else if(t[0]==String.fromCharCode(36))s.css({boxSizing:"border-box",padding:3}),g=t.substring(1),m=s.son("select:pp",{padding:3,borderRadius:"4px",border:"1px solid rgb(0,0,0,0.4)"},{_oon:g,onchange:function(){var t="_"+this._oon,e=this.value,n=this.options[this.selectedIndex].text;r._fv[t]&&r._fv[t](e,n)}}),Object.defineProperty(r._fv,g,{configurable:!0,get:()=>m.value,set(t){m.value=t}}),r._fv["___"+g]=m,r.__[g]=m,m._id=g,m._frm=r,g=!1;else if("!"==t[0]){var w=(g=t.substring(1)).split("_");g=w[0];var _=w.length>1?w[1]:g;i="";s._size||(s.style.width=_w_19140(_,12));let e=s.son("div",{boxSizing:"border-box",padding:3,display:"flex",alignItems:"center",justifyContent:"start"});if(m=e.son("input",{fontSize:12},{type:"checkbox"}),w.length<2)e.son("label",{userSelect:"none",fontSize:12,verticalAlign:"middle"},{textContent:_,for:m,onclick:function(){m.click()}});Object.defineProperty(r._fv,g,{configurable:!0,get:()=>m.checked,set(t){m.checked=t}}),r._fv["___"+g]=m,r.__[g]=m,m._id=g,m._frm=r,g=!1}else if("&"==t[0]){w=(g=t.substring(1)).split("_");g=w[0];_=w.length>1?w[1]:g,i="";let e=s.son("div",{boxSizing:"border-box",padding:3,display:"flex",alignItems:"center",justifyContent:"start"});m=e.son("input",{fontSize:12},{type:"checkbox"}),Object.defineProperty(r._fv,g,{configurable:!0,get:()=>m.checked,set(t){m.checked=t}}),r._fv["___"+g]=m,r.__[g]=m,m._id=g,m._frm=r,g=!1}else if("."==t[0])g=t.substring(1),m=s.son("div:ydiv",{},{}),r._fv[g]=m,g=!1;else if(">"==t[0]){w=(g=t.substring(1)).split("_");g=w[0];_=w.length>1?w[1]:g,i="";s._size||(s.style.width=_w_19140(_,12)),m=s.son("div"+i,{textAlign:"left",paddingLeft:28,backgroundImage:thatfsvg,backgroundRepeat:"no-repeat",backgroundPosition:"4px center",backgroundSize:"24px 24px",fontSize:12},{_id:g,innerText:_,onclick:function(){r._fv[this._id]=!r._fv[this._id]}}),function(){var t=!1,e=g;Object.defineProperty(r._fv,g,{configurable:!0,get:()=>t,set(n){t=n,m.style.backgroundImage=n?thattsvg:thatfsvg,r._fv["_"+e]&&r._fv["_"+e](n)}})}(),r._fv[g]=!1,g=!1}else"~"==t[0]?(g=t.substring(1),s.css({boxSizing:"border-box",padding:3}),s._size||(s.style.width=_w_19140(g)),m=s.son("div:pp",{border:"1px inset #888",backgroundColor:"#eee",color:"#000",boxSizing:"border-box",fontSize:12,cursor:"pointer",borderRadius:"2px",display:"inline-flex",textAlign:"center",alignItems:"center",justifyContent:"center",cursor:"pointer",userSelect:"none"},{_dis:!1,innerText:g}),Object.defineProperty(m,"disabled",{get:function(){return this._dis},set:function(t){this._dis=t,this._dis?(this.$css({color:"#AAA",border:"1px solid #AAA"}),this.clickH=this.onclick,this.onclick=function(){event.stopPropagation(),event.preventDefault()}):(this.$css({color:"#000",border:"1px solid #000"}),this.onclick=function(){})}})):(g=t,s.$css({fontSize:12},{}));g&&(r._fv[g]=m)}return s},HTMLElement.prototype.vixFrame=HTMLElement.prototype.myFrm,vixTabPage=myTabBar,myStage=function(t,e){var n=t.son("div:pp",Oplus({position:"relative",overflow:"hidden"},e));return n._3D(),n.walls={},n.oneWall=function(t,e,n){return this.walls[t]=this.son("div:pp",Oplus({backgroundColor:"#f00",position:"absolute",top:0,left:0,zIndex:10,overflow:"hidden"},n),{posOrg:e,init:function(){this.Fly(e)},open:function(t){this.Fly({x:0,y:0,x:0,rX:0,rY:0,rZ:0,sX:1,sY:1,sZ:1},T||500)},close:function(t){this.Fly(this.posOrg,t||500)}})},n},HTMLElement.prototype.myDoc=function(t){return myDoc(this,t)},HTMLElement.prototype.myKV=function(t,e,n,i,o){var s=t.split(",");this.style.verticalAlign="top";var r=this._tb=this.son("table:eetb"),l=this;function a(t){32==t.keyCode&&t.preventDefault()}return l._kv=l.$={},s.forEach((function(t){var e=t.split(":");1==e.length&&(e[1]=t);var s=r.addRow(-1,o||{});l.$[e[1]]=s.addCell(-1,Oplus({backgroundColor:"#ddd",padding:8,width:"30%",textAlign:"right",border:"1px solid #aaa"},n),{innerText:e[0]}),l.$[e[1]].o=s.addCell(-1,Oplus({backgroundColor:"#FFE",padding:8,textAlign:"left",border:"1px solid #aaa"},i),{contentEditable:!0,onkeypress:a})})),Object.defineProperty(l,"$",{set:t=>{for(var e in t)this._kv[e].o.innerText=t[e]},get:()=>{var t={};for(var e in this._kv)t[e]=this._kv[e].o.innerText;return t}}),e&&(l.$=e),l},HTMLElement.prototype.myHTML=function(t){this.innerHTML=t,this._ev={};var e=this;return this.chsEval((function(t){if(t.id)if("_"==t.id.substr(0,1)&&0==t.children.length){switch(t.tagName+(t.type||"")){case"TD":case"SPAN":e._ev[t.id]={vl:t.innerText,o:t,get v(){return this.vl},set v(t){this.vl=t,this.o.innerText=t}};break;case"INPUTcheckbox":case"INPUTradio":e._ev[t.id]={vl:t.value,o:t,get v(){return this.o.checked},set v(t){this.vl=t,this.o.checked=t}};break;case"INPUTtext":case"INPUTradio":case"INPUTrange":case"INPUTradio":case"TEXTAREAtextarea":e._ev[t.id]={vl:t.value,o:t,get v(){return this.o.value},set v(t){this.vl=t,this.o.value=t}}}}else e._ev[t.id]=t})),this.$=this._ev,this},HTMLElement.prototype.$HTML=function(t){this.innerHTML=t,this._ev={},this._eo={},this._em={},this._ch={},this._deb=800;var e,n=this;return this.chsEval=function(t){this.querySelectorAll("*").forEach(t)},this.chsEval((function(t){if(t.id)if(t._id=t.id,t.id.startsWith("_")){let e=(t.tagName+(t.type||"")).toLowerCase();switch(e){case"td":case"span":Object.defineProperty(n._ev,t.id,{get:function(){return t.innerText},set:function(e){t.innerText=e},enumerable:!0}),n._eo[t.id]=t;break;case"inputcheckbox":case"inputradio":Object.defineProperty(n._ev,t.id,{get:function(){return t.checked},set:function(e){t.checked=e},enumerable:!0}),n._eo[t.id]=t;break;case"inputtext":case"inputnumber":case"inputdate":case"inputsearch":case"inputurl":case"input":case"inputrange":case"textareatextarea":case"selectselect-one":Object.defineProperty(n._ev,t.id,{get:function(){return t.value},set:function(e){t.value=e},enumerable:!0}),n._eo[t.id]=t;break;default:console.log("未处理类型:"+e),$clog("$HTML:"+e)}t.removeAttribute("id")}else t.id.startsWith("-")?(n._em[t.id.substring(1)]=t,t.removeAttribute("id")):n._em[t.id]=t})),this.$=this._ev,Object.defineProperty(this,"jv",{get:function(){let t={};return Object.keys(this._ev).forEach((e=>{let n=Object.getOwnPropertyDescriptor(this._ev,e);n&&n.get&&(t[e]=n.get.call(this._ev))})),t},set:function(t){Object.keys(t).forEach((e=>{let n=Object.getOwnPropertyDescriptor(this._ev,e);n&&n.set?n.set.call(this._ev,t[e]):this._ev[e]=t[e]}))}}),this.addEventListener("input",(function(t){clearTimeout(e),e=setTimeout((function(){const e=t.target;if(e._id&&n._ch[e._id]){let t=Object.getOwnPropertyDescriptor(n._ev,e._id);if(t&&t.get){let i=t.get.call(n._ev);n._ch[e._id](i,e)}}}),n._deb)})),this.addEventListener("click",(function(t){const e=t.target;e._id&&n._ch[e._id+"_click"]&&n._ch[e._id+"_click"](e)})),this};class SVGMover{constructor(t,e="red",n=0,i=1e3,o=0){this.parent=t,this.color=e,this.dir=n,this.duration=i,this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svg.style.width="100%",this.svg.style.height="100%",this.parent.appendChild(this.svg),this._setupTemplateCircle(),o>0&&setInterval((()=>{this.flow()}),o)}_setupTemplateCircle(){const t=(Math.min(this.parent.clientWidth,this.parent.clientHeight)-4)/2;switch(this.templateCircle=document.createElementNS("http://www.w3.org/2000/svg","circle"),this.templateCircle.setAttribute("r",t),this.templateCircle.setAttribute("fill",this.color),this.templateAnimate=document.createElementNS("http://www.w3.org/2000/svg","animate"),this.templateAnimate.setAttribute("attributeName","cy"),this.templateAnimate.setAttribute("dur",`${this.duration}ms`),this.templateAnimate.setAttribute("fill","freeze"),this.dir){case 0:this.templateCircle.setAttribute("cx","50%"),this.templateCircle.setAttribute("cy",`-${t}`),this.templateAnimate.setAttribute("from",`-${t}`),this.templateAnimate.setAttribute("to",`${this.parent.clientHeight+t}`);break;case 1:this.templateCircle.setAttribute("cx","50%"),this.templateCircle.setAttribute("cy",`${this.parent.clientHeight+t}`),this.templateAnimate.setAttribute("from",`${this.parent.clientHeight+t}`),this.templateAnimate.setAttribute("to",`-${t}`);break;case 2:this.templateCircle.setAttribute("cy","50%"),this.templateCircle.setAttribute("cx",`-${t}`),this.templateAnimate.setAttribute("attributeName","cx"),this.templateAnimate.setAttribute("from",`-${t}`),this.templateAnimate.setAttribute("to",`${this.parent.clientWidth+t}`);break;case 3:this.templateCircle.setAttribute("cy","50%"),this.templateCircle.setAttribute("cx",`${this.parent.clientWidth+t}`),this.templateAnimate.setAttribute("attributeName","cx"),this.templateAnimate.setAttribute("from",`${this.parent.clientWidth+t}`),this.templateAnimate.setAttribute("to",`-${t}`)}}flow(){const t=this.templateCircle.cloneNode(!0),e=this.templateAnimate.cloneNode(!0);e.addEventListener("endEvent",(()=>{t.remove()})),t.appendChild(e),this.svg.appendChild(t),e.beginElement()}}function debounce(t,e,n){let i;return function(...o){const s=this;"function"==typeof e&&e.apply(s,o);clearTimeout(i),i=setTimeout((()=>{clearTimeout(i),"function"==typeof n&&n.apply(s,o)}),t)}}function popBox(t,e,n,i){return document.body.son("div",{position:"absolute",visibility:"hidden",zIndex:n||3e3,backgroundColor:"rgb(200,200,200,0)",boxSizing:"border-box"},{pini:i,popup:function(t,e,n){this.e=t;var i=t.getBoundingClientRect();this.style.visibility="visible",this.style.width=i.width+20,this.style.height=i.height+20,this.css({left:i.x-10,top:i.y-10,visibility:"visible",width:i.width+20,height:i.height+20}),this._ev.m.css({width:i.width,height:i.height}),document.body.offsetWidth-i.right>this.b.offsetWidth?(this.b.style.right=null,this.b.style.left=i.width-10,this._ev.l.style.width=20,this._ev.r.style.width=1):(this.b.style.left=null,this.b.style.right=i.width-10,this._ev.l.style.width=1,this._ev.r.style.width=20),i.y
"),this.c=this._ev.c,this.b=this._ev.bb,this.b.css({width:t||320,height:e||240})}})}function VIXList1(t,n,i,o){var s,r={};s=t||document.body,r.p=s,s.css({overflow:"auto",padding:0}),r.l=s.son("div",{width:"100%",overflow:"auto",height:"100%",border:"0px solid #cde",boxSizing:"border-box",margin:0}),o&&r.l.css(o),r.cols={},r.fid=10918;var l=baseTable(r.l);return r.div=l,r.data=[],l.data={},r.rData=l.data,l.activeRow=!1,r._aId=l.activeRow,r.rows={},r.css0=n||{borderLeft:"1px solid #eee",borderTop:"1px solid #eee",borderRight:"1px solid #eee",userSelect:"none",boxSizing:"border-box",borderBottom:"1px solid #eee"},r.cssa=i||{borderLeft:"1px solid #eee",borderTop:"1px solid #eee",borderRight:"1px solid #eee",userSelect:"text",borderBottom:"1px solid #F00"},r.loadData=function(t,e,n,i){r._aId=!1,myGetS(t,e||[],(function(t){r.data=t,t.forEach((function(t){l.addOne(t,n)})),i&&i(r.data)}),!0)},r.addOne=l.addOne=function(t,e,n){var i={};return(i=l.data[t.id]?this.rows[t.id]:l.addRow(n||-1,{},{_id:t.id,_data:t,onclick:function(){var t="";try{t=event.srcElement.getAttribute("_cind")}catch(t){}r._aId=this._id,r._aData=this._data,r._aCell=this,l.__selectRow(this._id,this,event.srcElement,t,this._data)}}).addCell(-1,r.css0,{_vixType:"LIST1TD"}))||console.log("id不唯一引起10919"),i._list=r,t.c=i,r.rows[t.id]=i,t._e=i,e?e(t,i):i.innerText=t.id,l.data[t.id]={d:t,o:i},i},r.clearAll=function(){l.clc(),l.activeRow=!1,r._aId=!1,l.data={},r.rows={},r.data=[]},r.__selectRow=l.__selectRow=function(t,n,i,o){if(!n)i=(n=l.data[t].o).r("0000");if(r.cols[o]&&r.cols[o].onclick0&&r.cols[o].onclick0(t,n,i,o),l.activeRow==t)try{r.onRowSelect(t,n,i,o)}catch(t){}else{if(l.activeRow){l.data[l.activeRow].o.css(r.css0);try{for(var s=l.data[l.activeRow].o.r("000"),a=0;a__"+s[1]+"__",n+=''+s[0]+"",i[s[1]]={id:o,name:s[1],label:s[0]})})),e+="",n+="",this.cols=i,this.hTem=" "+n+"
",this.rTem=" "+e+"
",[e,n,i]},r.cellx=function(t,e){return r.rows[t].r("000"+r.cols[e].id)},r.rEval=function(t){for(var e in r.rows)t(e,r.rows[e],r.rows[e].parentElement._data)},r}class myCGroup{constructor(t,e="AAA|0,BBB|b,CCC,DDD|d",n={}){this.container=t,this.itemDelimiter=n.itemDelimiter||",",this.valueDelimiter=n.valueDelimiter||"|",this.items={},this.itemFloat=n.float||"left",this.readonly=n.readonly||!1,this.selectedItems=new Set,this.options=n,this.fsvg=svgURL(''),this.tsvg=svgURL(''),this.parseItems(e),this.renderItems()}parseItems(t){this.items={},t.split(this.itemDelimiter).forEach((t=>{const[e,n=e]=t.split(this.valueDelimiter).map((t=>t.trim()));this.items[n]={label:e,value:n}}))}renderItems(){this.container.innerHTML="",Object.values(this.items).forEach((t=>{const e=this.selectedItems.has(t.value);this.container.son("div",{cursor:"pointer",padding:"5px 5px 5px 25px",margin:"5px",borderRadius:"5px",float:this.itemFloat,border:"1px solid #DDD",backgroundImage:e?this.tsvg:this.fsvg,backgroundRepeat:"no-repeat",backgroundPosition:"left center",backgroundSize:"20px 20px",backgroundColor:e?"rgb(0, 255, 0, 0.2)":""},{innerText:t.label,onclick:()=>this.toggleItem(t.value)})}))}toggleItem(t){this.readonly||(this.selectedItems.has(t)?this.selectedItems.delete(t):this.selectedItems.add(t),this.renderItems(),this.onInput(),this.onItemInput(t,this.selectedItems.has(t)))}onInput(){console.log("Selected items:",this.value)}onItemInput(t,e){console.log("Item selected:",t+":"+e)}get value(){return Array.from(this.selectedItems).join(this.itemDelimiter)}set value(t){const e=t.split(this.itemDelimiter).filter((t=>void 0!==this.items[t]));this.selectedItems=new Set(e),this.renderItems()}setItems(t){this.parseItems(t),this.selectedItems.clear(),this.renderItems()}}class myRGroup{constructor(t,e="AAA|0,BBB|1,CCC|2",n={}){this.container=t,this.itemDelimiter=n.itemDelimiter||",",this.valueDelimiter=n.valueDelimiter||"|",this.items={},this.itemFloat=n.float||"left",this.readonly=n.readonly||!1,this.selectedItem=null,this.options=n,this.fsvg=svgURL(''),this.tsvg=svgURL(''),this.parseItems(e),this.renderItems()}parseItems(t){(Array.isArray(t)?t:t.split(this.itemDelimiter)).forEach((t=>{const[e,n=e]=t.split(this.valueDelimiter).map((t=>t.trim()));this.items[n]={label:e,value:n}}))}renderItems(){this.container.innerHTML="",Object.values(this.items).forEach((t=>{const e=this.selectedItem===t.value;this.container.son("div",{cursor:"pointer",padding:"5px 5px 5px 25px",float:this.itemFloat,margin:"5px",borderRadius:"5px",backgroundImage:this.fsvg,backgroundRepeat:"no-repeat",backgroundPosition:"left center",backgroundSize:"20px 20px",backgroundImage:e?this.tsvg:this.fsvg},{innerText:t.label,onclick:()=>{this.selectItem(t.value)}})}))}selectItem(t){this.readonly||(this.selectedItem=t,this.updateItems(),this.onItemInput(t,this.selectedItem===t),this.onInput())}updateItems(){Array.from(this.container.children).forEach((t=>{let e=null;for(let n in this.items)if(this.items[n].label===t.innerText){e=this.items[n].value;break}t.style.backgroundImage=this.selectedItem===e?this.tsvg:this.fsvg}))}onInput(){console.log("Selected item:",this.value)}onItemInput(t,e){console.log("Item selected:",t+":"+e)}get value(){return this.selectedItem}set value(t){if(!Object.keys(this.items).includes(t))throw new Error(`myRGroup--\x3eValue "${t}" is not a valid item.`);this.selectedItem=t,this.updateItems(),this.onInput()}updateItemsInput(t){this.parseItems(t),this.renderItems()}}class vColorPicker{constructor(t,e,n={v:!1}){this.container=t,this.colors=e.split(","),this.canvas=document.createElement("canvas"),this.orientation=n.v,this.canvas.width=this.container.clientWidth,this.canvas.height=this.container.clientHeight,this.container.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d"),this.drawGradient(),this.setupEvents(),this.isTracking=!1}drawGradient(){let t;t=this.orientation?this.ctx.createLinearGradient(0,0,0,this.canvas.height):this.ctx.createLinearGradient(0,0,this.canvas.width,0),this.colors.forEach(((e,n)=>{t.addColorStop(n/(this.colors.length-1),e)})),this.ctx.fillStyle=t,this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height)}setupEvents(){this.canvas.addEventListener("mousedown",this.startTracking.bind(this)),this.canvas.addEventListener("mousemove",this.trackColor.bind(this)),this.canvas.addEventListener("mouseup",this.stopTracking.bind(this)),this.canvas.addEventListener("mouseleave",this.stopTracking.bind(this)),this.canvas.addEventListener("touchstart",this.startTracking.bind(this)),this.canvas.addEventListener("touchmove",this.trackColor.bind(this)),this.canvas.addEventListener("touchend",this.stopTracking.bind(this)),this.canvas.addEventListener("touchcancel",this.stopTracking.bind(this))}startTracking(t){this.isTracking=!0,this.trackColor(t)}stopTracking(t){this.isTracking=!1}rgbToHex(t,e,n){return"#"+[t,e,n].map((t=>{const e=t.toString(16);return 1===e.length?"0"+e:e})).join("")}trackColor(t){if(!this.isTracking)return;let e,n;if(t.preventDefault(),t.type.startsWith("touch")){if(0===t.touches.length)return void(this.isInsideCanvas=!1);e=t.touches[0].clientX,n=t.touches[0].clientY}else e=t.clientX,n=t.clientY;let i=this.canvas.getBoundingClientRect(),o=e-i.left,s=n-i.top;if(this.isInsideCanvas=o>=0&&s>=0&&o<=i.width&&s<=i.height,this.isInsideCanvas){let t=this.ctx.getImageData(o,s,1,1).data,e=`rgb(${t[0]}, ${t[1]}, ${t[2]})`,n=this.rgbToHex(t[0],t[1],t[2]);this.onColor&&this.onColor(e,n)}}onColor(t){console.log("Selected Color:",t)}}const TREE_FIELD_ALIASES={long:"long",text:"long",multiline:"long",json:"json",int:"int",integer:"int",float:"float",number:"float",double:"float",bool:"bool",boolean:"bool"};loadStyle('.dsl-tree-host { font-family: Arial, sans-serif; font-size: 12px; width:100%;height:100%; box-sizing: border-box;}.dsl-tree { width: 100%; display: flex; flex-direction: column; border: 1px solid #ddd; border-radius: 6px; background: #fff; overflow: hidden; font-size: 12px;}.dsl-tree-body { max-height: 420px; overflow: auto;}.dsl-tree-head { border-bottom: 1px solid #ddd; background: #f6f8fa;}.dsl-tree-head-row { display: flex;}.dsl-tree-list { list-style: none; margin: 0; padding: 0;}.dsl-tree-row { display: flex; align-items: stretch; cursor: default; user-select: none; font-size: 12px;}.dsl-tree-cell { border-right: 1px solid #ddd; border-bottom: 1px solid #ddd; box-sizing: border-box; display: flex; align-items: center; min-height: 30px; background-color: #fff; font-size: 12px; padding: 6px; white-space: pre-wrap; word-break: break-word;}.dsl-tree-cell.is-editing { padding: 0; align-items: stretch;}.dsl-tree-cell-editor { width: 100%; min-height: 34px; height: 100%; border: none; outline: none; resize: none; font: inherit; padding: 4px 6px; box-sizing: border-box;}.dsl-tree-cell-editor.is-multiline { min-height: 120px; height: auto;}.dsl-tree-head .dsl-tree-cell { font-weight: 600; color: #24292f; background: #f6f8fa; border-bottom: 1px solid #ddd; position: relative; padding: 6px;}.dsl-tree-head-label { padding: 0;}.dsl-tree-row:hover .dsl-tree-cell { background: #eaeaef;}.dsl-tree-row.is-selected .dsl-tree-cell { background: #d0ebff;}.dsl-tree-row.is-dragging .dsl-tree-cell { opacity: 0.6;}.dsl-tree-row.is-drop-target .dsl-tree-cell { box-shadow: inset 0 0 0 1px rgba(13, 110, 253, 0.8);}.dsl-tree-row.is-hidden-drag { display: none;}.tree-treecell { position: relative;}.tree-treecell::before { content: ""; width: var(--dsl-tree-indent, 0); flex: 0 0 var(--dsl-tree-indent, 0); display: block;}.tree-label { flex: 1; color: #303133;}.dsl-tree-row.is-collapsed .tree-label { opacity: 0.85;}.tree-toggle { width: 20px; height: 20px; font-size: 18px; border: none; background: transparent; cursor: pointer; color: #606266; padding: 0;}.tree-toggle.is-leaf-toggle { visibility: hidden;}.dsl-tree-row .dsl-tree-cell:last-child,.dsl-tree-head .dsl-tree-cell:last-child { border-right: none;}.dsl-tree-resize-handle { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; user-select: none;}body.dsl-tree-resizing { cursor: col-resize;}body.dsl-tree-resizing * { cursor: col-resize !important;}.dsl-tree-menu { position: fixed; min-width: 100px; background: #fff; border: 1px solid #ddd; border-radius: 6px; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.24); z-index: 3000; padding: 4px 0;}.dsl-tree-menu-list { list-style: none; margin: 0; padding: 0;}.dsl-tree-menu-list li { border-bottom: 1px solid #f2f2f2;}.dsl-tree-menu-list li:last-child { border-bottom: none;}.dsl-tree-menu li.has-sub { position: relative;}.dsl-tree-menu-sub { position: absolute; top: 0; left: 100%; margin-left: -1px; min-width: 100px; background: #fff; border: 1px solid #ddd; border-radius: 6px; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.24); list-style: none; padding: 0; z-index: 1; display: none;}.dsl-tree-menu li.has-sub:hover > .dsl-tree-menu-sub { display: block;}.dsl-tree-menu .submenu-arrow { margin-left: auto; opacity: 0.6;}.dsl-tree-menu-list button { width: 100%; background: transparent; border: none; text-align: left; padding: 8px 14px; font: inherit; cursor: pointer;}.dsl-tree-menu-list button:hover { background: #eaeaef;}.dsl-tree-menu-check { display: flex; align-items: center; gap: 6px;}.dsl-tree-menu-check input[type="checkbox"] { margin: 0;}.dsl-tree-menu-check-label { flex: 1;}.dsl-tree-menu-input { display: flex; align-items: center; gap: 8px;}.dsl-tree-menu-input-label { flex: 1; font-size: 12px; color: #475467;}.dsl-tree-menu-input-field { box-sizing: border-box; padding: 4px 6px; border: 1px solid #d0d5dd; border-radius: 4px; font: inherit;}.dsl-tree-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4); display: flex; align-items: center; justify-content: center; z-index: 2000;}.dsl-tree-modal { width: min(520px, 90vw); max-height: 80vh; background: #fff; border-radius: 8px; box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2); display: flex; flex-direction: column; overflow: hidden;}.dsl-tree-modal-header { padding: 14px 18px; border-bottom: 1px solid #e5e7eb; font-weight: 600;}.dsl-tree-modal-body { padding: 12px; overflow-y: auto; display: flex; flex-direction: column;}.dsl-tree-kv-row { display: flex; gap: 0; align-items: stretch;}.dsl-tree-kv-row label { font-size: 12px; background-color: #f0f0f0; color: #333; flex: 0 0 64px; padding: 4px; border: 1px solid #ddd; border-right: none; border-radius: 4px 0 0 4px; display: flex; align-items: center; justify-content: left;}.dsl-tree-kv-row input,.dsl-tree-kv-row select,.dsl-tree-kv-row textarea { flex: 1 1 auto; min-width: 0; padding: 4px; border: 1px solid #ddd; border-radius: 0 4px 4px 0; font-family: inherit; font-size: 12px; box-sizing: border-box;}.dsl-tree-kv-row textarea { min-height: 60px; resize: vertical;}.dsl-tree-modal-footer { padding: 12px 18px; border-top: 1px solid #e5e7eb; display: flex; justify-content: flex-end;}.dsl-tree-modal-footer button { appearance: none; border: 1px solid #0d6efd; background: #0d6efd; color: #fff; padding: 6px 12px; border-radius: 4px; font-size: 12px; cursor: pointer;}.dsl-tree-modal-footer button.secondary { background: #fff; color: #0d6efd;}.dsl-tree-kv-row.is-vertical-layout { flex-direction: column; align-items: stretch;}.dsl-tree-kv-row.is-vertical-layout label { flex: none; border-right: 1px solid #ddd; border-bottom: none; border-radius: 4px 4px 0 0; justify-content: flex-start;}.dsl-tree-kv-row.is-vertical-layout input,.dsl-tree-kv-row.is-vertical-layout textarea,.dsl-tree-kv-row.is-vertical-layout select { border-radius: 0 0 4px 4px;}');const ROOT_PID_VALUE=0;function normalizePidKey(t){return null==t||""===t||"0"===t||0===t?null:String(t)}function getRecordPidValue(t){return null==t?ROOT_PID_VALUE:t}function parseTreeFieldDefinitions(t){const e=[],n=new Map,i=[],o=[];return(Array.isArray(t)?t:[]).forEach((t=>{if("string"!=typeof t)return;const[s,r]=t.split(":"),l=(s||"").trim();if(!l)return;e.push(l);const a=TREE_FIELD_ALIASES[(r||"").trim().toLowerCase()];a&&(n.set(l,a),"long"===a&&i.push(l),"json"===a&&o.push(l))})),{names:e,hints:n,longFields:i,jsonFields:o}}class TreeNode{constructor(t){this.id=t.id,this.record=t,this.parentId=normalizePidKey(t.pid),this.parent=null,this.children=[],this.expanded=!0,this.depth=0,this.dom=null}}const TREE_DEFAULTS={indent:20,data:[],fields:[],columns:[],dragable:!1,icons:{open:"▾",closed:"▸",leaf:"•"},renderLabel:t=>t.name??String(t.id),onNodeClick:()=>{},onRowClick:null,onToggle:()=>{},onRowContextMenu:null,onNodeDblClick:null,rmenu:[],onMenuSelect:null};class DSLTree{constructor(t,e={}){if(!t)throw new Error("DSLTree requires a container element.");this.container=t,this.options={...TREE_DEFAULTS,...e};const{names:n,hints:i,longFields:o,jsonFields:s}=parseTreeFieldDefinitions(this.options.fields);this.fieldHints=i,this.longTextFields=new Set(o),this.jsonFields=new Set(s),this.staticFields=n,this.columns=this._normalizeColumns(this.options.columns),this.nodeMap=new Map,this.roots=[],this.flatList=[],this.selectedId=null,this.acriveRow=null,this.knownFields=[],this.dragState=null,this.columnResizeState=null,this.cellEditState=null,this.menuItems=this._normalizeMenuItems(this.options.rmenu),this.contextMenuEl=null,this.menuHandlers=new Map,this._onMenuOutsideClick=this._onMenuOutsideClick.bind(this),this._onMenuKey=this._onMenuKey.bind(this),this._onColumnResize=this._onColumnResize.bind(this),this._stopColumnResize=this._stopColumnResize.bind(this),this._build(),this.setData(this.options.data)}_normalizeColumns(t){const e=Array.isArray(t)&&t.length?t.slice():[{field:"name",head:"名称",tree:!0,flex:1}];return e.some((t=>t&&t.tree))||(e[0]={...e[0]||{},tree:!0}),e.map(((t,e)=>{const n={...t||{}};return n.field=n.field||(n.tree?"name":`col${e}`),n.head=n.head??n.field??"",n.tree=Boolean(n.tree),n.align=n.align||"left",n.render="function"==typeof n.render?n.render:null,n.width=Number.isFinite(n.width)?Number(n.width):null,n.minWidth=Number.isFinite(n.minWidth)?Number(n.minWidth):null,n.flex=Number.isFinite(n.flex)?Number(n.flex):n.width?0:n.tree?1:0,n.editable="boolean"==typeof n.editable?n.editable:Boolean(n.edatable),n}))}setDragable(t){const e=Boolean(t);this.options.dragable!==e&&(this.options.dragable=e,e?this._bindDragEvents():this._unbindDragEvents(),this._applyDragableStateToRows(e))}_applyDragableStateToRows(t){this.listEl&&this.listEl.querySelectorAll(".dsl-tree-row").forEach((e=>{e.draggable=t}))}_normalizeMenuItems(t){return Array.isArray(t)?t.map((t=>{if(Array.isArray(t)){const[e,n]=t;return e?{id:String(e),name:n??String(e)}:null}if(t&&"object"==typeof t){if(!t.id)return null;const e={id:String(t.id),name:t.name??String(t.id)};if("check"===t.type&&(e.type="check"),"boolean"==typeof t.checked&&(e.checked=Boolean(t.checked)),"input"===t.type){e.type="input";const n=Number(t.inputWidth??t.width);Number.isFinite(n)&&n>0&&(e.inputWidth=n),null!=t.value&&(e.value=String(t.value)),null!=t.placeholder&&(e.placeholder=String(t.placeholder))}return Array.isArray(t.children)&&t.children.length&&(e.children=this._normalizeMenuItems(t.children)),e}return"string"==typeof t?{id:t,name:t}:null})).filter(Boolean):[]}_build(){this.container.classList.add("dsl-tree-host"),this.root=document.createElement("div"),this.root.className="dsl-tree",this.headEl=document.createElement("div"),this.headEl.className="dsl-tree-head",this.body=document.createElement("div"),this.body.className="dsl-tree-body",this.listEl=document.createElement("ul"),this.listEl.className="dsl-tree-list",this.root.appendChild(this.headEl),this.body.appendChild(this.listEl),this.root.appendChild(this.body),this.container.innerHTML="",this.container.appendChild(this.root),this._bindEvents(),this.options.dragable&&this._bindDragEvents(),this.body.addEventListener("scroll",(()=>this._closeContextMenu())),this._renderHeader()}_renderHeader(){if(!this.headEl)return;this.headEl.innerHTML="";const t=document.createElement("div");t.className="dsl-tree-head-row",this.columns.forEach(((e,n)=>{const i=document.createElement("div");i.className="dsl-tree-cell dsl-tree-head-cell",e.tree&&i.classList.add("tree-cell"),i.dataset.colIndex=String(n),this._applyColumnSize(i,e);const o=document.createElement("span");o.className="dsl-tree-head-label",o.textContent=e.head||e.field||"",i.appendChild(o),this._attachColumnResizeHandle(i,e,n),t.appendChild(i)})),this.headEl.appendChild(t)}_attachColumnResizeHandle(t,e,n){const i=document.createElement("span");i.className="dsl-tree-resize-handle",i.dataset.index=String(n),i.addEventListener("mousedown",(t=>{this._startColumnResize(t,n)})),t.appendChild(i)}_startColumnResize(t,e){const n=this.columns[e];if(!n)return;t.preventDefault(),t.stopPropagation();const i=n.width&&Number.isFinite(n.width)?Number(n.width):this._measureColumnWidth(e),o=Number.isFinite(n.minWidth)?n.minWidth:60;this.columnResizeState={index:e,column:n,startX:t.clientX,startWidth:i,minWidth:o},document.addEventListener("mousemove",this._onColumnResize),document.addEventListener("mouseup",this._stopColumnResize),document.body.classList.add("dsl-tree-resizing")}_measureColumnWidth(t){const e=this.headEl?.querySelectorAll(".dsl-tree-head-cell");if(e&&e[t])return e[t].getBoundingClientRect().width;const n=this.listEl?.querySelector(".dsl-tree-row");return n&&n.children[t]?n.children[t].getBoundingClientRect().width:120}_applyColumnWidthToDOM(t,e){const n=`${e}px`,i=t=>{t&&(t.style.width=n,t.style.flex=`0 0 ${n}`)},o=this.headEl?.querySelectorAll(".dsl-tree-head-cell");o&&o[t]&&i(o[t]),this.listEl?.querySelectorAll(".dsl-tree-row").forEach((e=>{const n=e.children[t];n&&i(n)}))}_onColumnResize(t){if(!this.columnResizeState)return;const{startX:e,startWidth:n,minWidth:i,column:o,index:s}=this.columnResizeState,r=t.clientX-e,l=Math.max(i,n+r);o.width=l,o.flex=0,this._applyColumnWidthToDOM(s,l)}_stopColumnResize(){this.columnResizeState&&(document.removeEventListener("mousemove",this._onColumnResize),document.removeEventListener("mouseup",this._stopColumnResize),document.body.classList.remove("dsl-tree-resizing"),this.columnResizeState=null,this._renderHeader(),this._render())}_openContextMenu(t,e,n,i){if(!this.menuItems.length)return!1;this._closeContextMenu();const o=document.createElement("div");o.className="dsl-tree-menu";const s=this._buildMenuList(this.menuItems,e,n,i,0);o.appendChild(s),document.body.appendChild(o);const r=o.getBoundingClientRect(),l=document.documentElement.clientWidth,a=document.documentElement.clientHeight;let d=t.clientX,c=t.clientY;return d+r.width>l-4&&(d=l-r.width-4),c+r.height>a-4&&(c=a-r.height-4),o.style.left=`${Math.max(4,d)}px`,o.style.top=`${Math.max(4,c)}px`,this.contextMenuEl=o,this.contextMenuData={node:e,row:n,column:i},document.addEventListener("mousedown",this._onMenuOutsideClick,!0),document.addEventListener("contextmenu",this._onMenuOutsideClick,!0),document.addEventListener("keydown",this._onMenuKey,!0),!0}_buildMenuList(t,e,n,i,o=0){const s=document.createElement("ul");return s.className=0===o?"dsl-tree-menu-list":"dsl-tree-menu-sub",t.forEach(((t,r)=>{const l=document.createElement("li"),a=Array.isArray(t.children)&&t.children.length>0,d=this._createMenuButton(t,e,n,i,a);if(l.appendChild(d),a){l.classList.add("has-sub");const s=this._buildMenuList(t.children,e,n,i,o+1);let r;l.appendChild(s);const a=()=>{const t=l.parentElement;Array.from(t.children).forEach((t=>{if(t!==l){const e=t.querySelector(".dsl-tree-menu-sub");e&&(e.style.display="none",e.style.maxHeight="",e.style.overflowY="")}})),s.style.display="block",s.style.left="",s.style.top="",s.style.bottom="",s.style.maxHeight="",s.style.overflowY="";const e=l.getBoundingClientRect(),n=s.getBoundingClientRect(),i=document.documentElement.clientWidth,o=document.documentElement.clientHeight,r=i-e.right,a=e.left;r>=n.width?s.style.left="100%":a>=n.width?s.style.left="-100%":s.style.left=r>a?"100%":"-100%";const d=o-e.top,c=e.bottom;d>=n.height?s.style.top="0":c>=n.height?(s.style.top="auto",s.style.bottom="0"):d>=c?(s.style.top="0",s.style.maxHeight=d-4+"px",s.style.overflowY="auto"):(s.style.top="auto",s.style.bottom="0",s.style.maxHeight=c-4+"px",s.style.overflowY="auto")},d=()=>{s.style.display="none"};l.addEventListener("mouseenter",(()=>{clearTimeout(r),a()})),l.addEventListener("mouseleave",(()=>{r=setTimeout(d,200)})),s.addEventListener("mouseenter",(()=>{clearTimeout(r)})),s.addEventListener("mouseleave",(()=>{r=setTimeout(d,200)}))}s.appendChild(l),0===r&&0===o&&d.focus()})),s}_createMenuButton(t,e,n,i,o){const s=document.createElement("button");s.type="button";const r=t.name??t.id;if("check"===t.type){s.className="dsl-tree-menu-button dsl-tree-menu-check";const e=document.createElement("input");e.type="checkbox",e.checked=Boolean(t.checked),e.addEventListener("click",(t=>{t.stopPropagation()})),e.addEventListener("change",(()=>{t.checked=e.checked}));const n=document.createElement("span");n.className="dsl-tree-menu-check-label",n.textContent=r,s.append(e,n)}else if("input"===t.type){s.className="dsl-tree-menu-button dsl-tree-menu-input";const e=document.createElement("input");e.type="text",e.className="dsl-tree-menu-input-field",e.value=t.value??"",Number.isFinite(t.inputWidth)&&t.inputWidth>0&&(e.style.width=`${t.inputWidth}px`),t.placeholder&&(e.placeholder=t.placeholder);const n=t=>t.stopPropagation();["mousedown","mouseup","click","dblclick"].forEach((t=>{e.addEventListener(t,n)})),e.addEventListener("input",(()=>{t.value=e.value}));const i=document.createElement("span");i.className="dsl-tree-menu-input-label",i.textContent=r,s.append(i,e)}else s.className="dsl-tree-menu-button",s.textContent=r;if(s.dataset.id=t.id,o){const t=document.createElement("span");t.className="submenu-arrow",t.textContent="▶",s.appendChild(t),s.addEventListener("click",(t=>{t.stopPropagation()}))}else s.addEventListener("click",(()=>{this._handleMenuSelection(t,e,n,i)}));return s}_handleMenuSelection(t,e,n,i){this._closeContextMenu();const o="check"===t.type,s="input"===t.type,r=this.menuHandlers.get(t.id);"function"!=typeof r?"function"==typeof this.options.onMenuSelect&&(o?this.options.onMenuSelect(t.id,e.record,n,i,Boolean(t.checked)):s?this.options.onMenuSelect(t.id,e.record,n,i,t.value??""):this.options.onMenuSelect(t.id,e.record,n,i)):o?r(Boolean(t.checked),e.record,n,i):s?r(t.value??"",e.record,n,i):r(e.record,n,i)}_closeContextMenu(){this.contextMenuEl&&(this.contextMenuEl.remove(),this.contextMenuEl=null,this.contextMenuData=null,document.removeEventListener("mousedown",this._onMenuOutsideClick,!0),document.removeEventListener("contextmenu",this._onMenuOutsideClick,!0),document.removeEventListener("keydown",this._onMenuKey,!0))}_onMenuOutsideClick(t){this.contextMenuEl&&(this.contextMenuEl.contains(t.target)||this._closeContextMenu())}_onMenuKey(t){"Escape"===t.key&&this._closeContextMenu()}_maybeOpenContextMenu(t,e,n,i){return!!this.menuItems.length&&((!this.cellEditState||this.cellEditState.node!==e)&&(t.preventDefault(),this._openContextMenu(t,e,n,i)))}_startCellEdit(t,e,n){if(!e.field)return;if(this.cellEditState){const t=this.cellEditState.cell===n;if(this._finalizeCellEdit(!0),t)return}this._closeContextMenu();const i=t.record[e.field],o=this._resolveFieldHint(e.field,i);n.classList.add("is-editing"),n.innerHTML="";const s=document.createElement("textarea");s.className="dsl-tree-cell-editor",s.value=this._stringifyValue(i),"json"!==o&&"long"!==o||s.classList.add("is-multiline"),n.appendChild(s),s.focus();const r=t=>{this.cellEditState&&this.cellEditState.textarea===s&&this._finalizeCellEdit(t)};s.addEventListener("keydown",(t=>{"Enter"!==t.key||t.shiftKey?"Escape"===t.key&&(t.preventDefault(),r(!1)):(t.preventDefault(),r(!0))})),s.addEventListener("blur",(()=>r(!0))),this.cellEditState={node:t,column:e,cell:n,textarea:s,hint:o}}_finalizeCellEdit(t){if(!this.cellEditState)return;const{node:e,column:n,textarea:i,hint:o}=this.cellEditState;if(t){const t=o||this._resolveFieldHint(n.field,e.record[n.field]),s=this._convertValueType(e.record[n.field],i.value,t);e.record[n.field]=s;const r=this.data.findIndex((t=>t&&String(t.id)===e.id));-1!==r&&(this.data[r][n.field]=s),this._refreshKnownFields(e.record)}this.cellEditState=null,this._updateRow(e)}_resolveFieldHint(t,e){const n=this.fieldHints.get(t);return n||(this.jsonFields.has(t)||"object"==typeof e?"json":"boolean"==typeof e?"bool":"number"==typeof e?Number.isInteger(e)?"int":"float":this.longTextFields.has(t)||this._isLongText(e)?"long":null)}_bindEvents(){this.listEl.addEventListener("click",(t=>{const e=t.target.closest("[data-toggle]");if(e){const t=e.closest("li");return void(t&&this.toggleNode(t.dataset.id))}const n=t.target.closest("li.dsl-tree-row");if(!n)return;const i=this.nodeMap.get(n.dataset.id);if(!i)return;if(t.ctrlKey)return t.preventDefault(),void this.openNodeEditor(n.dataset.id);this.selectNode(n.dataset.id);const o=t.target.closest(".dsl-tree-cell");"function"==typeof this.options.onRowClick&&this.options.onRowClick(n,i.record,o),this.options.onNodeClick(i.record,n,t)})),this.listEl.addEventListener("dblclick",(t=>{const e=t.target.closest("li.dsl-tree-row");if(!e)return;const n=this.nodeMap.get(e.dataset.id);n&&("function"==typeof this.options.onNodeDblClick?this.options.onNodeDblClick(n.record,e):n.children.length&&this.toggleNode(n.id))})),this.listEl.addEventListener("contextmenu",(t=>{const e=t.target.closest(".dsl-tree-cell"),n=e?.closest("li.dsl-tree-row");if(!n)return;const i=this.nodeMap.get(n.dataset.id);if(!i)return;const o=e?.dataset.colIndex?Number(e.dataset.colIndex):-1,s=Number.isFinite(o)?this.columns[o]:null;t.preventDefault(),this.selectRow(i.id,!0),this._maybeOpenContextMenu(t,i,n,s)||"function"==typeof this.options.onRowContextMenu&&this.options.onRowContextMenu(i.record,n,t,s)}))}_bindDragEvents(){if(!this.options.dragable)return;if(this._dragListenersBound)return;const t=t=>{const e=t.target.closest("li.dsl-tree-row");if(!e)return;const n=this.nodeMap.get(e.dataset.id);n&&this._handleDragStart(n,e,t)},e=t=>{const e=t.target.closest("li.dsl-tree-row");this._handleDragOver(e,t)},n=t=>{const e=t.target.closest("li.dsl-tree-row");this._handleDrop(e,t)},i=()=>{this._handleDragEnd()};this.listEl.addEventListener("dragstart",t),this.listEl.addEventListener("dragover",e),this.listEl.addEventListener("drop",n),this.listEl.addEventListener("dragend",i),this._dragListenersBound={onDragStart:t,onDragOver:e,onDrop:n,onDragEnd:i}}_unbindDragEvents(){if(!this._dragListenersBound||!this.listEl)return;const{onDragStart:t,onDragOver:e,onDrop:n,onDragEnd:i}=this._dragListenersBound;this.listEl.removeEventListener("dragstart",t),this.listEl.removeEventListener("dragover",e),this.listEl.removeEventListener("drop",n),this.listEl.removeEventListener("dragend",i),this._dragListenersBound=null}setData(t=[]){this._closeContextMenu(),this.data=this._normalizeData(t),this._refreshKnownFields(),this._buildForest(),this._render()}addNode(t){this._closeContextMenu();const e=this._normalizeRecord(t,this.data.length);this.data.push(e),this._refreshKnownFields(e);const n=new TreeNode(e);this.nodeMap.set(n.id,n);const i=normalizePidKey(e.pid);if(i){const t=this.nodeMap.get(i);t?(n.parent=t,n.parentId=t.id,n.depth=t.depth+1,n.record.pid=t.id,t.children.push(n)):(n.parent=null,n.parentId=null,n.record.pid=ROOT_PID_VALUE,this.roots.push(n))}else n.parent=null,n.parentId=null,n.record.pid=ROOT_PID_VALUE,this.roots.push(n);return this._sortRecursive(this.roots),this._assignDepthAndPath(this.roots),this._rebuildFlatList(),this._render(),n.record}addRow(t={}){this._closeContextMenu();const e=t&&"object"==typeof t?t.data&&"object"==typeof t.data?{...t.data}:{...t}:{},n=this.data.reduce(((t,e)=>{const n=Number(e?.id);return Number.isFinite(n)&&n>t?n:t}),0),i=Number(e.id);e.id=null==e.id||!Number.isFinite(i)||i<0?n+1:i,e.name||(e.name=`节点${e.id}`);const o=normalizePidKey(e.pid),s=o?this.nodeMap.get(o):null;e.pid=s?s.id:ROOT_PID_VALUE;const r=Number(e.sort),l=this._normalizeRecord(e,this.data.length),a=new TreeNode(l);let d;this.data.push(l),this.nodeMap.set(a.id,a),s?(a.parent=s,a.parentId=s.id,a.depth=s.depth+1,a.record.pid=s.id,d=s.children):(a.parent=null,a.parentId=null,a.depth=0,a.record.pid=0,d=this.roots);let c=d.length;return Number.isFinite(r)&&r>0&&(c=Math.min(r-1,d.length)),d.splice(c,0,a),this._resequenceSort(d),this._refreshKnownFields(a.record),this._assignDepthAndPath(this.roots),this._rebuildFlatList(),this._render(),this.selectNode(a.id),a.record}updateNode(t,e={}){this._closeContextMenu();const n=this.nodeMap.get(String(t));if(!n)return null;const i={...e};delete i.id;let o=!1;if(Object.prototype.hasOwnProperty.call(i,"pid")){let t=normalizePidKey(i.pid);if(t){const e=this.nodeMap.get(t);e&&e!==n&&!this._isDescendantNode(e,n)||(t=null)}t===normalizePidKey(n.record.pid)?delete i.pid:(o=!0,i.pid=null==t?ROOT_PID_VALUE:t)}let s=!1;if(Object.prototype.hasOwnProperty.call(i,"sort")){const t=Number(n.record.sort)||0,e=Number(i.sort);Number.isFinite(e)?e===t?delete i.sort:(s=!0,i.sort=e):delete i.sort}return Object.keys(i).length?(Object.assign(n.record,i),o||s?(this._buildForest(),this._render()):this._updateRow(n),this._refreshKnownFields(n.record),n.record):n.record}removeNode(t,{cascade:e=!0}={}){this._closeContextMenu();const n=this.nodeMap.get(String(t));return!!n&&(!e&&n.children.length&&n.children.forEach((t=>{t.parent=n.parent||null,t.parentId=t.parent?t.parent.id:null,t.parent?t.parent.children.push(t):this.roots.push(t)})),n.parent?n.parent.children=n.parent.children.filter((t=>t!==n)):this.roots=this.roots.filter((t=>t!==n)),this.nodeMap.delete(n.id),this.data=this.data.filter((t=>String(t.id)!==n.id)),this._refreshKnownFields(),this._assignDepthAndPath(this.roots),this._rebuildFlatList(),this._render(),!0)}toggleNode(t,e){this._closeContextMenu();const n=this.nodeMap.get(String(t));n&&n.children.length&&(n.expanded="boolean"==typeof e?e:!n.expanded,this.options.onToggle(n.record,n.expanded),this._rebuildFlatList(),this._render())}selectNode(t){const e=this.nodeMap.get(String(t));e?(this.selectedId=e.id,this.acriveRow=e.record,this.listEl.querySelectorAll(".dsl-tree-row.is-selected").forEach((t=>t.classList.remove("is-selected"))),e.dom&&(e.dom.classList.add("is-selected"),e.dom.scrollIntoView({block:"nearest"}))):this.acriveRow=null}selectRow(t,e=!0){const n=this.nodeMap.get(String(t));if(n&&(this.selectNode(n.id),e&&"function"==typeof this.options.onRowClick)){const t=n.dom||this.listEl.querySelector(`li.dsl-tree-row[data-id="${n.id}"]`),e=t?t.querySelector(".dsl-tree-cell"):null;this.options.onRowClick(t,n.record,e)}}walk(t){const e=n=>{n.forEach((n=>{t(n.record,n),n.children.length&&e(n.children)}))};e(this.roots)}dispose(){this._closeContextMenu(),this.container.innerHTML="",this.nodeMap.clear(),this.roots=[],this.flatList=[],this.knownFields=[]}_createMenuId(){return`menu_${Date.now()}_${Math.random().toString(16).slice(2)}`}_findMenuItemById(t,e=this.menuItems){for(const n of e)if(n){if(n.id===t)return n;if(n.children&&n.children.length){const e=this._findMenuItemById(t,n.children);if(e)return e}}return null}_appendMenuItem(t,e){if(e){const n=this._findMenuItemById(String(e));if(n)return n.children=n.children||[],void n.children.push(t)}this.menuItems.push(t)}addMenu(t,e,n){if(!t)return null;const i=this._createMenuId();return this._appendMenuItem({id:i,name:t},n),"function"==typeof e&&this.menuHandlers.set(i,e),i}addCheckMenu(t,e,n=!1,i){if(!t)return null;const o=this._createMenuId();return this._appendMenuItem({id:o,name:t,type:"check",checked:Boolean(n)},i),"function"==typeof e&&this.menuHandlers.set(o,e),o}addInputMenu(t,e,n={},i){if(!t)return null;let o=60,s="",r="";"number"==typeof n?o=Number.isFinite(n)&&n>0?n:o:n&&"object"==typeof n&&(Number.isFinite(n.width)&&n.width>0&&(o=n.width),null!=n.value&&(s=String(n.value)),null!=n.placeholder&&(r=String(n.placeholder)));const l=this._createMenuId();return this._appendMenuItem({id:l,name:t,type:"input",inputWidth:o,value:s,placeholder:r},i),"function"==typeof e&&this.menuHandlers.set(l,e),l}_normalizeData(t){return t.map(((t,e)=>this._normalizeRecord(t,e)))}_normalizeRecord(t,e){if(!t||"object"!=typeof t)throw new Error(`Invalid record at index ${e}`);const n=t.id??null;if(null==n)throw new Error(`Record at index ${e} is missing "id".`);if(null==t.name)throw new Error(`Record ${n} is missing "name".`);const i={...t};i.id=String(n);const o=normalizePidKey(i.pid);return i.pid=null==o?ROOT_PID_VALUE:o,i.sort=Number.isFinite(Number(i.sort))?Number(i.sort):0,i}_buildForest(){this.nodeMap.clear(),this.roots=[];this.data.map((t=>{const e=new TreeNode(t);return this.nodeMap.set(e.id,e),normalizePidKey(t.pid)||this.roots.push(e),e})).forEach((t=>{if(null==t.parentId)return;const e=this.nodeMap.get(t.parentId);e?(t.parent=e,t.depth=e.depth+1,e.children.push(t)):(t.parent=null,t.parentId=null,t.record.pid=ROOT_PID_VALUE,this.roots.push(t))})),this._sortRecursive(this.roots),this._assignDepthAndPath(this.roots),this._rebuildFlatList()}_sortRecursive(t){t.sort(((t,e)=>t.record.sort!==e.record.sort?t.record.sort-e.record.sort:t.id.localeCompare(e.id))),t.forEach((t=>{t.children.length&&this._sortRecursive(t.children)}))}_rebuildFlatList(){const t=[],e=n=>{n.forEach((n=>{t.push(n),n.expanded&&n.children.length&&e(n.children)}))};e(this.roots),this.flatList=t}_assignDepthAndPath(t,e=0,n=""){t.forEach((t=>{t.depth=e,t.path=n?`${n}/${t.id}`:String(t.id),t.children.length&&this._assignDepthAndPath(t.children,e+1,t.path)}))}_render(){if(!this.listEl)return;const t=document.createDocumentFragment();this.flatList.forEach((e=>{t.appendChild(this._createRow(e))})),this.listEl.innerHTML="",this.listEl.appendChild(t)}_createRow(t){const e=t.dom||document.createElement("li");return e.className="dsl-tree-row",e.dataset.id=t.id,e.dataset.path=t.path||String(t.id),e.dataset.parentId=t.parent?t.parent.id:"",e.draggable=Boolean(this.options.dragable),e.innerHTML="",this.columns.forEach(((n,i)=>{const o=document.createElement("div");if(o.className="dsl-tree-cell",o.dataset.colIndex=String(i),o.dataset.field=n.field||"",n.tree&&o.classList.add("tree-cell"),this._applyColumnSize(o,n),n.tree){o.classList.add("tree-treecell"),o.style.setProperty("--dsl-tree-indent",t.depth*this.options.indent+"px");const e=document.createElement("button");e.type="button",e.className="tree-toggle",e.dataset.toggle="true",e.textContent=this._toggleIcon(t),t.children.length||(e.disabled=!0,e.classList.add("is-leaf-toggle"));const n=document.createElement("span");n.className="tree-label";const i=[];null!=t.record.id&&i.push(`id:${t.record.id}`),null!=t.record.sort&&i.push(`sort:${t.record.sort}`),i.length&&(n.title=i.join(", "));const s=this._getTreeLabel(t);s instanceof Node?n.appendChild(s):n.textContent=s,(n.textContent.includes("id=")||n.textContent.includes("sort="))&&(n.textContent=n.textContent.replace(/\s*(?id=.*?)?/g,"").replace(/\(sort=.*?\)/g,"").trim()),o.append(e,n)}else{const e=t.record[n.field],i=n.render?n.render(e,t.record,t):this._formatCellValue(e);i instanceof Node?o.appendChild(i):o.textContent=i}e.appendChild(o)})),e.classList.toggle("is-leaf",0===t.children.length),e.classList.toggle("is-collapsed",!t.expanded&&t.children.length>0),e.classList.toggle("is-selected",this.selectedId===t.id),t.dom=e,e}_handleDragStart(t,e,n){n.dataTransfer.effectAllowed="move",n.dataTransfer.setData("application/x-dsltree-node",t.id),e.classList.add("is-dragging"),this.dragState={sourceId:t.id,sourcePath:t.path,hiddenRows:[]},this._hideDescendantsForDrag(t.path)}_handleDragOver(t,e){if(!this.dragState)return;if(!t)return;const n=t.dataset.id;if(!n||n===this.dragState.sourceId)return;const i=t.dataset.path||n;this._isDescendantPath(i,this.dragState.sourcePath)||(e.preventDefault(),this.dragState.dropRow&&this.dragState.dropRow!==t&&this.dragState.dropRow.classList.remove("is-drop-target"),t.classList.add("is-drop-target"),this.dragState.dropRow=t)}_handleDrop(t,e){if(!this.dragState)return;e.preventDefault();const n=t||this.dragState.dropRow;if(!n)return void this._handleDragEnd();const i=n.dataset.id,o=this.dragState.sourceId;if(!i||!o||i===o)return void this._handleDragEnd();const s=n.dataset.path||i;if(this._isDescendantPath(s,this.dragState.sourcePath))return void this._handleDragEnd();const r=e&&e.shiftKey;this._moveNodeAfter(o,i,{asChild:r}),this._handleDragEnd()}_handleDragEnd(){this.dragState&&(this._clearDragVisuals(),this.dragState=null)}_hideDescendantsForDrag(t){if(!t)return;const e=`${t}/`,n=[];this.listEl.querySelectorAll("li.dsl-tree-row").forEach((t=>{(t.dataset.path||"").startsWith(e)&&(t.classList.add("is-hidden-drag"),n.push(t))})),this.dragState&&(this.dragState.hiddenRows=n)}_clearDragVisuals(){this.listEl.querySelectorAll(".is-dragging").forEach((t=>t.classList.remove("is-dragging"))),this.listEl.querySelectorAll(".is-drop-target").forEach((t=>t.classList.remove("is-drop-target"))),this.listEl.querySelectorAll(".is-hidden-drag").forEach((t=>t.classList.remove("is-hidden-drag")))}_isDescendantPath(t,e){return!(!t||!e)&&t.startsWith(`${e}/`)}_isDescendantNode(t,e){if(!t||!e)return!1;let n=t;for(;n;){if(n===e)return!0;n=n.parent}return!1}_moveNodeAfter(t,e,{asChild:n=!1}={}){const i=this.nodeMap.get(String(t)),o=this.nodeMap.get(String(e));if(!i||!o||i===o)return;const s=i.path;if(this._isDescendantPath(o.path,s))return;const r=i.parent?i.parent.children:this.roots,l=r.indexOf(i);let a,d;if(l>-1&&r.splice(l,1),n)a=o,d=o.children,o.expanded=!0,d.push(i);else{a=o.parent||null,d=a?a.children:this.roots;const t=d.indexOf(o);d.splice(t+1,0,i)}i.parent=a,i.parentId=a?a.id:null,i.record.pid=i.parentId??ROOT_PID_VALUE,this._resequenceSort(d),r!==d&&this._resequenceSort(r),this._assignDepthAndPath(this.roots),this._rebuildFlatList(),this._render()}_resequenceSort(t){t.forEach(((t,e)=>{t.record.sort=e+1,t.children.length&&this._resequenceSort(t.children)}))}_getTreeLabel(t){const e=this.options.renderLabel(t.record,t);return e instanceof Node?e:null!=e?String(e):t.record.name??t.id}_applyColumnSize(t,e){if(Number.isFinite(e.minWidth)&&(t.style.minWidth=`${e.minWidth}px`),Number.isFinite(e.width)){const n=`${e.width}px`;t.style.width=n,t.style.flex=`0 0 ${n}`}else Number.isFinite(e.flex)&&e.flex>0?t.style.flex=`${e.flex} 1 0`:t.style.flex="0 1 auto";e.align&&(t.style.textAlign=e.align)}_formatCellValue(t){return this._stringifyValue(t)}_toggleIcon(t){return t.children.length?t.expanded?this.options.icons.open:this.options.icons.closed:this.options.icons.leaf}_updateRow(t){t.dom&&this._createRow(t)}openNodeEditor(t){const e=this.nodeMap.get(String(t));if(!e)return;const n=e.record;this._refreshKnownFields(n),this.selectNode(e.id);const i=document.createElement("div");i.className="dsl-tree-overlay";const o=document.createElement("div");o.className="dsl-tree-modal";const s=document.createElement("div");s.className="dsl-tree-modal-header",s.textContent=`编辑节点 #${n.id}`;const r=document.createElement("div");r.className="dsl-tree-modal-body",r.style.gap="4px";const l=document.createElement("div");l.className="dsl-tree-modal-footer";const a=["id","name","pid","sort"],d=[...a.filter((t=>this.knownFields.includes(t))),...this.knownFields.filter((t=>!a.includes(t)))],c=Math.min(.6*window.innerHeight,500);d.forEach((t=>{const e=document.createElement("div");e.className="dsl-tree-kv-row";const i=document.createElement("label");i.textContent=t,e.appendChild(i);const o=this.fieldHints.get(t),s=n[t],l=this.jsonFields.has(t)||"json"===o||"object"==typeof s,a=this.longTextFields.has(t)||"long"===o||this._isLongText(s);let d;if("bool"===o||"boolean"==typeof s)d=document.createElement("select"),["true","false"].forEach((t=>{const e=document.createElement("option");e.value=t,e.textContent=t,String(s)===t&&(e.selected=!0),d.appendChild(e)}));else if("int"===o||"float"===o)d=document.createElement("input"),d.type="number",d.value=Number.isFinite(s)?String(s):"","int"===o&&(d.step="1");else if(l||a){if(d=document.createElement("textarea"),l)try{d.value=JSON.stringify(s,null,2)}catch(t){d.value=this._stringifyValue(s)}else d.value=this._stringifyValue(s);a&&!l?this._setupTextareaAutosize(d,120,c):this._setupTextareaAutosize(d,void 0,c)}else d=document.createElement("input"),d.type="text",d.value=null==s?"":String(s);(l||a)&&e.classList.add("is-vertical-layout"),d.dataset.field=t,"id"===t&&(d.readOnly=!0,d.classList.add("is-readonly")),e.appendChild(d),r.appendChild(e)}));const h=document.createElement("button");h.className="secondary",h.textContent="取消",h.addEventListener("click",p);const u=document.createElement("button");function p(){i.remove()}u.textContent="保存",u.addEventListener("click",(()=>{const t=r.querySelectorAll("input, textarea, select"),i={};t.forEach((t=>{const e=t.dataset.field;if("id"===e)return;const o=this.fieldHints.get(e);let s;if("TEXTAREA"===t.tagName){const n=t.value.trim();if(this.jsonFields.has(e)||"json"===o||this._looksLikeJSON(n))try{s=n?JSON.parse(n):{}}catch(t){s=n}else s=n}else if("SELECT"===t.tagName)s="true"===t.value;else if("number"===t.type||"int"===o||"float"===o){const i="int"===o?parseInt(t.value,10):parseFloat(t.value);s=Number.isNaN(i)?n[e]??0:i}else s=this._convertValueType(n[e],t.value,o);this._valuesEqual(n[e],s)||(i[e]=s)})),Object.keys(i).length?this.updateNode(e.id,i):this._updateRow(e),p()})),l.append(h,u),o.append(s,r,l),i.appendChild(o),document.body.appendChild(i)}_refreshKnownFields(t){const e=new Set(this.staticFields);this.columns.forEach((t=>{t.field&&e.add(String(t.field))})),this.data.forEach((t=>{Object.keys(t||{}).forEach((t=>e.add(String(t))))})),t&&Object.keys(t).forEach((t=>e.add(String(t)))),this.knownFields=Array.from(e)}_setupTextareaAutosize(t,e,n){const i=Number.isFinite(e)?e:(()=>{const e=window.getComputedStyle(t).minHeight,n=Number.parseFloat(e);return Number.isFinite(n)&&n>0?n:60})();Number.isFinite(e)&&(t.style.minHeight=`${i}px`),Number.isFinite(n)&&(t.style.maxHeight=`${n}px`,t.style.overflowY="auto");const o=()=>{t.style.height=`${i}px`;const e=t.scrollHeight;e>i+1&&(t.style.height=`${e}px`)};t.addEventListener("input",o),t.style.height=`${i}px`,requestAnimationFrame(o)}_stringifyValue(t){if(null==t)return"";if("object"==typeof t)try{return JSON.stringify(t,null,2)}catch(e){return String(t)}return String(t)}_convertValueType(t,e,n){if(!n)return e;if("int"===n){const n=parseInt(e,10);return Number.isNaN(n)?Number.isFinite(t)?t:0:n}if("float"===n){const n=parseFloat(e);return Number.isNaN(n)?Number.isFinite(t)?t:0:n}if("bool"===n){const n=String(e).trim().toLowerCase();return!!["true","1","yes"].includes(n)||!["false","0","no"].includes(n)&&Boolean(t)}if("json"===n)try{return e?JSON.parse(e):{}}catch(t){return e}return e}_valuesEqual(t,e){if(t===e)return!0;if("number"==typeof t&&"number"==typeof e&&Number.isNaN(t)&&Number.isNaN(e))return!0;if("object"==typeof t&&"object"==typeof e)try{return JSON.stringify(t)===JSON.stringify(e)}catch(t){return!1}return!1}_looksLikeJSON(t){if(null==t)return!1;if("object"==typeof t)return!0;if("string"!=typeof t)return!1;const e=t.trim();return e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]")}_isLongText(t){return null!=t&&("string"==typeof t&&t.length>120)}getNodeById(t){return this.nodeMap.get(String(t))||null}getRecordById(t){const e=this.getNodeById(t);return e?e.record:null}}window.DSLTree=DSLTree,window.parseTreeFieldDefinitions=parseTreeFieldDefinitions;const FIELD_TYPE_ALIASES={long:"long",text:"long",multiline:"long",json:"json",int:"int",integer:"int",float:"float",number:"float",double:"float",bool:"bool",boolean:"bool"};function parseFieldDefinitions(t){const e=[],n=new Map,i=[],o=[];return(Array.isArray(t)?t:[]).forEach((t=>{if("string"!=typeof t)return;const s=t.trim();if(!s)return;const[r,l]=s.split(":"),a=(r||"").trim();if(!a)return;e.push(a);const d=(l||"").trim().toLowerCase(),c=FIELD_TYPE_ALIASES[d];c&&(n.set(a,c),"long"===c?i.push(a):"json"===c&&o.push(a))})),{names:e,hints:n,longNames:i,jsonNames:o}}loadStyle('.dsl-grid-container { min-height: 100%; padding: 20px; box-sizing: border-box; } .dsl-grid { width: 100%; display: flex; flex-direction: column; border: 1px solid #ddd; border-radius: 6px; background: #fff; overflow: hidden; font-size:12px; } .dsl-grid table { border-collapse: collapse; width: 100%; } .dsl-grid thead th { background: #f6f8fa; color: #24292f; text-align: left; padding: 6px 6px; border-bottom: 1px solid #ddd; border-right: 1px solid #ddd; user-select: none; font-size:12px; } .dsl-grid thead th:last-child { border-right: none; } .dsl-grid tbody td { padding: 6px 6px; border-bottom: 1px solid #ddd; border-right: 1px solid #ddd; cursor: default; vertical-align: middle; white-space: pre-wrap; word-break: break-word; font-size:12px; } .dsl-grid tbody tr td:last-child { border-right: none; } .dsl-grid tbody tr:hover { background: #eaeaef; } .dsl-grid tbody tr.selected { background: #d0ebff; } .dsl-grid tbody td.cell-editor { padding: 0; } .dsl-grid textarea { width: 100%; border: none; padding: 6px 6px; resize: none; font-family: inherit; font-size: inherit; box-sizing: border-box; overflow: hidden; font-size:12px; } .dsl-grid-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4); display: flex; align-items: center; justify-content: center; z-index: 2000; } .dsl-grid-modal { width: min(520px, 90vw); max-height: 80vh; background: #fff; border-radius: 8px; box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2); display: flex; flex-direction: column; overflow: hidden; } .dsl-grid-modal-header { padding: 14px 18px; border-bottom: 1px solid #e5e7eb; font-weight: 600; } .dsl-grid-modal-body { padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; } .dsl-grid-kv-row { display: flex; gap: 0; align-items: stretch; } .dsl-grid-kv-row label { font-size: 12px; background-color: #f0f0f0; color: #333; flex: 0 0 var(--kv-label-width); padding: 4px; border: 1px solid #ddd; border-right: none; border-radius: 4px 0 0 4px; display: flex; align-items: center; justify-content: left; } .dsl-grid-kv-row input, .dsl-grid-kv-row textarea, .dsl-grid-kv-row select { flex: 1 1 auto; width: auto; min-width: 0; padding: 4px; border: 1px solid #ddd; border-radius: 0 4px 4px 0; font-family: inherit; } .dsl-grid-modal-footer { padding: 12px 18px; border-top: 1px solid #e5e7eb; display: flex; justify-content: flex-end; gap: 8px; } .dsl-grid-modal-footer button { appearance: none; border: 1px solid #0d6efd; background: #0d6efd; color: #fff; padding: 6px 12px; border-radius: 4px; font-size: 12px; cursor: pointer; } .dsl-grid-modal-footer button.secondary { background: #fff; color: #0d6efd; }.dsl-grid-kv-row.is-vertical-layout { flex-direction: column; align-items: stretch;}.dsl-grid-kv-row.is-vertical-layout label { flex: none; border-right: 1px solid #ddd; border-bottom: none; border-radius: 4px 4px 0 0; justify-content: flex-start;}.dsl-grid-kv-row.is-vertical-layout input,.dsl-grid-kv-row.is-vertical-layout textarea,.dsl-grid-kv-row.is-vertical-layout select { border-radius: 0 0 4px 4px;}/* Context Menu Styles */.dsl-grid-menu { position: fixed; min-width: 100px; background: #fff; border: 1px solid #ddd; border-radius: 6px; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.24); z-index: 3000; padding: 4px 0;}.dsl-grid-menu-list { list-style: none; margin: 0; padding: 0;}.dsl-grid-menu-list li { border-bottom: 1px solid #f2f2f2;}.dsl-grid-menu-list li:last-child { border-bottom: none;}.dsl-grid-menu li.has-sub { position: relative;}.dsl-grid-menu-sub { position: absolute; top: 0; left: 100%; margin-left: -1px; min-width: 100px; background: #fff; border: 1px solid #ddd; border-radius: 6px; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.24); list-style: none; padding: 0; z-index: 1; display: none;}.dsl-grid-menu .submenu-arrow { margin-left: auto; opacity: 0.6;}.dsl-grid-menu-list button { width: 100%; background: transparent; border: none; text-align: left; padding: 8px 14px; font: inherit; cursor: pointer; display: flex; align-items: center;}.dsl-grid-menu-list button:hover { background: #eaeaef;}.dsl-grid-menu-check { gap: 6px;}.dsl-grid-menu-check input[type="checkbox"] { margin: 0;}.dsl-grid-menu-check-label { flex: 1;}.dsl-grid-menu-input { gap: 8px;}.dsl-grid-menu-input-label { flex: 1; font-size: 12px; color: #475467;}.dsl-grid-menu-input-field { box-sizing: border-box; padding: 4px 6px; border: 1px solid #d0d5dd; border-radius: 4px; font: inherit;}');class DSLGrid{constructor(t,e){this.container=t,this.options=e||{},this.columns=(e.columns||[]).map((t=>({...t,editable:"boolean"==typeof t.editable?t.editable:!!t.edatable}))),this.data=Array.isArray(e.data)?e.data:[],this.onRowClick="function"==typeof e.onRowClick?e.onRowClick:()=>{},this.onRowContextMenu="function"==typeof e.onRowContextMenu?e.onRowContextMenu:null,this.onMenuSelect="function"==typeof e.onMenuSelect?e.onMenuSelect:null,this.editLeftWidth=Number.isFinite(e.editLeftWidth)?e.editLeftWidth:120;const{names:n,hints:i,longNames:o,jsonNames:s}=parseFieldDefinitions(e.fields);this.fieldHints=i;const r=[...o],l=[...s];this.longTextFields=new Set([...r].map(String)),this.jsonFields=new Set([...l].map(String)),this.staticFields=n,this._refreshKnownFields(),this.currentEdit=null,this.selectedRowIndex=null,this.menuItems=this._normalizeMenuItems(this.options.rmenu),this.contextMenuEl=null,this.menuHandlers=new Map,this._onMenuOutsideClick=this._onMenuOutsideClick.bind(this),this._onMenuKey=this._onMenuKey.bind(this),this._build(),this.render()}_build(){this.container.classList.add("dsl-grid-host"),this.root=document.createElement("div"),this.root.className="dsl-grid",this.tableWrapper=document.createElement("div"),this.tableWrapper.className="table-wrapper",this.table=document.createElement("table"),this.table.createTHead(),this.tbody=this.table.createTBody(),this.tableWrapper.append(this.table),this.root.append(this.tableWrapper),this.container.innerHTML="",this.container.appendChild(this.root),this.root.tabIndex=-1,this._bindTableEvents()}_bindTableEvents(){this.tbody.addEventListener("click",(t=>{const e=t.target.closest("td");if(!e)return;const n=e.parentElement,i=Array.from(this.tbody.rows).indexOf(n),o=e.dataset.colIndex?Number(e.dataset.colIndex):-1;if(i<0||o<0)return;this.selectRow(i);this.columns[o];const s=this.data[i];this.onRowClick(n,s,e)})),this.tbody.addEventListener("dblclick",(t=>{const e=t.target.closest("tr");if(!e)return;const n=Array.from(this.tbody.rows).indexOf(e);n<0||this.openPropertyEditor(n)})),this.tbody.addEventListener("contextmenu",(t=>{const e=t.target.closest("td");if(!e)return;const n=e.parentElement,i=Array.from(this.tbody.rows).indexOf(n),o=e.dataset.colIndex?Number(e.dataset.colIndex):-1;if(i<0)return;const s=this.data[i],r=o>=0?this.columns[o]:null;t.preventDefault(),this.selectRow(i),this.onRowClick(n,s,e),this._openContextMenu(t,s,n,r)||this.onRowContextMenu&&this.onRowContextMenu(s,n,t,r)})),this.tbody.addEventListener("dragstart",(t=>{const e=t.target.closest("tr");e&&(e.classList.add("dragging"),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("application/x-dslgrid-row",e.dataset.index))})),this.tbody.addEventListener("dragover",(t=>{t.preventDefault();const e=t.target.closest("tr");e&&e.classList.add("drag-over")})),this.tbody.addEventListener("dragleave",(t=>{const e=t.target.closest("tr");e&&e.classList.remove("drag-over")})),this.tbody.addEventListener("drop",(t=>{t.preventDefault();const e=Number(t.dataTransfer.getData("application/x-dslgrid-row")),n=t.target.closest("tr");if(!n)return;n.classList.remove("drag-over");const i=Number(n.dataset.index);Number.isNaN(e)||Number.isNaN(i)||e===i||this._moveRow(e,i)})),this.tbody.addEventListener("dragend",(t=>{const e=t.target.closest("tr");e&&e.classList.remove("dragging")})),this.root.addEventListener("keydown",(t=>{if("ArrowUp"===t.key||"ArrowDown"===t.key){t.preventDefault();let e=this.selectedRowIndex;if(null===e)return void(this.data.length>0&&this.selectRow(0));let n=e;if("ArrowUp"===t.key?n=Math.max(0,e-1):"ArrowDown"===t.key&&(n=Math.min(this.data.length-1,e+1)),n!==e){this.selectRow(n);const t=this.tbody.rows[n];t&&t.scrollIntoView({block:"nearest",behavior:"smooth"})}}else if(" "===t.key||"Enter"===t.key){t.preventDefault();let e=this.selectedRowIndex;if(null===e&&this.data.length>0){e=0,this.selectRow(e);const t=this.tbody.rows[e];t&&t.scrollIntoView({block:"nearest",behavior:"smooth"})}if(null!==e){const t=this.tbody.rows[e],n=this.data[e];if(t&&n){const e=t.cells[0]||null;this.onRowClick(t,n,e)}}}else if("PageUp"===t.key||"PageDown"===t.key){if(t.preventDefault(),0===this.data.length)return;let e=this.selectedRowIndex;if(null===e)return void this.selectRow(0);const n=10;let i=e;if(i="PageUp"===t.key?Math.max(0,e-n):Math.min(this.data.length-1,e+n),i!==e){this.selectRow(i);const t=this.tbody.rows[i];t&&t.scrollIntoView({block:"nearest",behavior:"smooth"})}}else if("Home"===t.key){if(t.preventDefault(),this.data.length>0){this.selectRow(0);const t=this.tbody.rows[0];t&&t.scrollIntoView({block:"start",behavior:"smooth"})}}else if("End"===t.key&&(t.preventDefault(),this.data.length>0)){const t=this.data.length-1;this.selectRow(t);const e=this.tbody.rows[t];e&&e.scrollIntoView({block:"end",behavior:"smooth"})}}))}_setupColumnPointerDrag(t){"onpointerdown"in t&&t.addEventListener("pointerdown",(e=>{const n=e.pointerType||(e.sourceCapabilities&&e.sourceCapabilities.firesTouchEvents?"touch":"mouse");if("touch"!==n&&"pen"!==n)return;const i=Number(t.dataset.colIndex);if(!Number.isFinite(i))return;"touch"===n&&e.preventDefault();const o=e.pointerId;let s=i,r=t,l=!1;const a=t.parentElement,d=n=>{!l&&Math.abs(n.clientX-e.clientX)>3&&(l=!0,t.classList.add("dragging")),l&&n.preventDefault();const i=document.elementFromPoint(n.clientX,n.clientY);if(!i)return;const o=i.closest("th");if(!o||o.parentElement!==a)return;r&&r!==o&&r.classList.remove("drag-over"),r=o,o.classList.add("drag-over");const d=Array.prototype.indexOf.call(a.children,o);d>=0&&(s=d)},c=e=>{if("function"==typeof t.releasePointerCapture&&"function"==typeof t.hasPointerCapture)try{t.hasPointerCapture(o)&&t.releasePointerCapture(o)}catch(t){}t.removeEventListener("pointermove",d),t.removeEventListener("pointerup",h),t.removeEventListener("pointercancel",u),r&&r.classList.remove("drag-over"),t.classList.remove("dragging"),e&&l&&s!==i&&this._moveColumn(i,s)},h=t=>{t.pointerId===o&&c(!0)},u=t=>{t.pointerId===o&&c(!1)};if("function"==typeof t.setPointerCapture)try{t.setPointerCapture(o)}catch(t){}t.addEventListener("pointermove",d),t.addEventListener("pointerup",h),t.addEventListener("pointercancel",u)}))}_setupRowPointerDrag(t){"onpointerdown"in t&&t.addEventListener("pointerdown",(e=>{const n=e.pointerType||(e.sourceCapabilities&&e.sourceCapabilities.firesTouchEvents?"touch":"mouse");if("touch"!==n&&"pen"!==n)return;if(e.target.closest("input, textarea, button, select"))return;const i=Number(t.dataset.index);if(!Number.isFinite(i))return;"touch"===n&&e.preventDefault();const o=e.pointerId,s=e.clientY;let r=!1,l=t,a=i;const d=()=>{Array.from(this.tbody.rows).forEach((t=>t.classList.remove("drag-over"))),t.classList.remove("dragging")},c=e=>{if(!r&&Math.abs(e.clientY-s)>4&&(r=!0,t.classList.add("dragging")),!r)return;e.preventDefault();const n=document.elementFromPoint(e.clientX,e.clientY);if(!n)return;const i=n.closest("tr");if(!i||i.parentElement!==this.tbody)return;l!==i&&Array.from(this.tbody.rows).forEach((t=>t.classList.remove("drag-over"))),l=i,l.classList.add("drag-over");const o=Array.prototype.indexOf.call(this.tbody.rows,i);o>=0&&(a=o)},h=e=>{if("function"==typeof t.releasePointerCapture&&"function"==typeof t.hasPointerCapture)try{t.hasPointerCapture(o)&&t.releasePointerCapture(o)}catch(t){}t.removeEventListener("pointermove",c),t.removeEventListener("pointerup",u),t.removeEventListener("pointercancel",p),d(),e&&r&&a!==i&&this._moveRow(i,a)},u=t=>{t.pointerId===o&&h(!0)},p=t=>{t.pointerId===o&&h(!1)};if("function"==typeof t.setPointerCapture)try{t.setPointerCapture(o)}catch(t){}t.addEventListener("pointermove",c),t.addEventListener("pointerup",u),t.addEventListener("pointercancel",p)}))}render(){this._refreshKnownFields(),this._renderHeader(),this._renderBody()}_renderHeader(){const t=this.table.tHead;t.innerHTML="";const e=t.insertRow();this.columns.forEach(((t,n)=>{const i=document.createElement("th");i.textContent=t.head||t.field,t.width&&(i.style.width="number"==typeof t.width?`${t.width}px`:t.width),i.draggable=!0,i.dataset.colIndex=String(n),i.addEventListener("dragstart",(t=>{t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("application/x-dslgrid-col",n.toString())})),i.addEventListener("dragover",(t=>{t.preventDefault(),i.classList.add("drag-over")})),i.addEventListener("dragleave",(()=>i.classList.remove("drag-over"))),i.addEventListener("drop",(t=>{t.preventDefault(),i.classList.remove("drag-over");const e=Number(t.dataTransfer.getData("application/x-dslgrid-col"));Number.isNaN(e)||e===n||this._moveColumn(e,n)})),this._setupColumnPointerDrag(i),e.appendChild(i)}))}_renderBody(){this.tbody.innerHTML="",this.data.forEach(((t,e)=>{const n=this.tbody.insertRow();n.dataset.index=String(e),n.draggable=!0,e===this.selectedRowIndex&&n.classList.add("selected"),this._setupRowPointerDrag(n),this.columns.forEach(((e,i)=>{const o=n.insertCell();o.dataset.colIndex=String(i),e.align&&(o.style.textAlign=e.align),e.width&&(o.style.width="number"==typeof e.width?`${e.width}px`:e.width),o.dataset.field=e.field||"",o.textContent=this._formatCellValue(t[e.field])}))}))}_formatCellValue(t){if(null==t)return"";if("object"==typeof t)try{return JSON.stringify(t)}catch(t){return"[object]"}return String(t)}_startCellEdit(t,e,n){this._cancelCurrentEdit();const i=this.data[e][n.field],o=document.createElement("textarea"),s=null!=i?this._formatCellValue(i):"";o.value=s,o.spellcheck=!1,t.classList.add("cell-editor"),t.innerHTML="",t.appendChild(o),o.focus();const r=t.getBoundingClientRect().height,l=Math.max(32,r-8);this._setupTextareaAutosize(o,l,200);const a=this.fieldHints.get(n.field),d=()=>this._commitEdit(t,e,n,o.value,i,a),c=()=>this._cancelCurrentEdit();o.addEventListener("keydown",(t=>{"Enter"!==t.key||t.shiftKey?"Escape"===t.key&&(t.preventDefault(),c()):(t.preventDefault(),d())})),o.addEventListener("blur",d),this.currentEdit={cell:t,rowIndex:e,column:n,input:o,originalValue:i}}_commitEdit(t,e,n,i,o,s){if(!this.currentEdit)return;const r=this._convertValueType(o,i,s);this.data[e][n.field]=r,this.currentEdit=null,t.classList.remove("cell-editor"),t.textContent=this._formatCellValue(r)}_cancelCurrentEdit(){if(!this.currentEdit)return;const{cell:t,originalValue:e}=this.currentEdit;t.classList.remove("cell-editor"),t.textContent=this._formatCellValue(e),this.currentEdit=null}_convertValueType(t,e,n){if(n){if("json"===n){if("string"!=typeof e)return e;const t=e.trim();if(!t)return{};try{return JSON.parse(t)}catch(e){return t}}if("int"===n){const n=parseInt(e,10);return Number.isNaN(n)?t??0:n}if("float"===n){const n=parseFloat(e);return Number.isNaN(n)?t??0:n}if("bool"===n){if("string"==typeof e){const t=e.toLowerCase();return!("false"===t||"0"===t||""===t)}return Boolean(e)}if("long"===n)return String(e??"")}if(null==t)return e;if("number"==typeof t){const t=Number(e);return Number.isNaN(t)?0:t}if("boolean"==typeof t){if("string"==typeof e){const t=e.toLowerCase();return!("false"===t||"0"===t||""===t)}return Boolean(e)}if("object"==typeof t){if("string"==typeof e)try{return JSON.parse(e)}catch(t){return e}return e}return e}_moveRow(t,e){if(t===e)return;const n=this.data.splice(t,1)[0];this.data.splice(e,0,n),this.render()}_moveColumn(t,e){const[n]=this.columns.splice(t,1);this.columns.splice(e,0,n),this.render()}selectRow(t){this.selectedRowIndex=t,Array.from(this.tbody.rows).forEach(((e,n)=>{n===t?e.classList.add("selected"):e.classList.remove("selected")}))}openPropertyEditor(t){const e=this.data[t];if(!e)return;this._refreshKnownFields(e),this.selectRow(t);const n=document.createElement("div");n.className="dsl-grid-overlay";const i=document.createElement("div");i.className="dsl-grid-modal",i.style.setProperty("--kv-label-width",`${this.editLeftWidth}px`);const o=document.createElement("div");o.className="dsl-grid-modal-header",o.textContent=`属性编辑 (#${e.id??t})`;const s=document.createElement("div");s.className="dsl-grid-modal-body";const r={},l=Array.from(this.knownFields),a=new Set,d=[];l.forEach((t=>{a.has(t)||(a.add(t),d.push(t))})),Object.keys(e).forEach((t=>{a.has(t)||(a.add(t),d.push(t))})),d.forEach((t=>{const n=Object.prototype.hasOwnProperty.call(e,t),i=n?e[t]:"",o=document.createElement("div");o.className="dsl-grid-kv-row";const l=document.createElement("label");l.textContent=t;const a=this.fieldHints.get(String(t)),d=this.jsonFields.has(String(t))||"json"===a,c=this.longTextFields.has(String(t))||"long"===a;let h;if("object"==typeof i||d||this._looksLikeJSON(i)||this._isLongText(i)||c)o.classList.add("is-vertical-layout"),h=document.createElement("textarea"),h.value="string"==typeof i?i:n?JSON.stringify(i,null,2):"";else if("bool"===a||"boolean"==typeof i){h=document.createElement("select");const t=document.createElement("option");t.value="true",t.textContent="true";const e=document.createElement("option");e.value="false",e.textContent="false",h.append(t,e),h.value=String(!0===i)}else"int"===a||"float"===a||"number"==typeof i?(h=document.createElement("input"),h.type="number","int"===a&&(h.step="1"),h.value=n&&"number"==typeof i?i:""):(h=document.createElement("input"),h.type="text",h.value=null!=i?i:"");if(r[t]=h,o.append(l,h),s.appendChild(o),"TEXTAREA"===h.tagName){const t=Math.min(400,.5*window.innerHeight);this._setupTextareaAutosize(h,120,t)}}));const c=document.createElement("div");c.className="dsl-grid-modal-footer";const h=document.createElement("button");h.textContent="删除",h.className="danger",h.style.marginRight="auto";const u=document.createElement("button");u.textContent="取消",u.className="secondary";const p=document.createElement("button");p.textContent="保存";const f=()=>{n.parentElement&&n.parentElement.removeChild(n)};h.addEventListener("click",(()=>{("function"!=typeof window.confirm||window.confirm("确认删除该行数据吗?"))&&(this.data.splice(t,1),this.onDelRow&&this.onDelRow(updatedRecord),f(),this.render(),this.selectRow(null))})),u.addEventListener("click",f),n.addEventListener("click",(t=>{t.target===n&&f()})),p.addEventListener("click",(()=>{const n={...e};for(const[t,i]of Object.entries(r)){const o=this.fieldHints.get(String(t)),s=this.jsonFields.has(String(t))||"json"===o;if("TEXTAREA"===i.tagName){const e=i.value.trim();if(s||this._looksLikeJSON(e))try{n[t]=JSON.parse(e||"{}")}catch(i){n[t]=e}else n[t]=e}else if("SELECT"===i.tagName)(o||"").startsWith("bool")||"boolean"==typeof e[t]?n[t]="true"===i.value:n[t]=i.value;else if("number"===i.type||"int"===o||"float"===o){const s="int"===o?parseInt(i.value,10):parseFloat(i.value);n[t]=Number.isNaN(s)?e[t]??0:s}else{const s=i.value;n[t]=this._convertValueType(e[t],s,o)}}this.data[t]=n,this.render(),this.onSaveRow&&this.onSaveRow(n),f()})),c.append(h,u,p),i.append(o,s,c),n.appendChild(i),document.body.appendChild(n)}_normalizeMenuItems(t){return Array.isArray(t)?t.map((t=>{if(Array.isArray(t)){const[e,n]=t;return e?{id:String(e),name:n??String(e)}:null}if(t&&"object"==typeof t){if(!t.id)return null;const e={id:String(t.id),name:t.name??String(t.id)};if("check"===t.type&&(e.type="check"),"boolean"==typeof t.checked&&(e.checked=Boolean(t.checked)),"input"===t.type){e.type="input";const n=Number(t.inputWidth??t.width);Number.isFinite(n)&&n>0&&(e.inputWidth=n),null!=t.value&&(e.value=String(t.value)),null!=t.placeholder&&(e.placeholder=String(t.placeholder))}return Array.isArray(t.children)&&t.children.length&&(e.children=this._normalizeMenuItems(t.children)),e}return"string"==typeof t?{id:t,name:t}:null})).filter(Boolean):[]}_openContextMenu(t,e,n,i){if(!this.menuItems.length)return!1;this._closeContextMenu();const o=document.createElement("div");o.className="dsl-grid-menu";const s=this._buildMenuList(this.menuItems,e,n,i,0);o.appendChild(s),document.body.appendChild(o);const r=o.getBoundingClientRect(),l=document.documentElement.clientWidth,a=document.documentElement.clientHeight;let d=t.clientX,c=t.clientY;return d+r.width>l-4&&(d=l-r.width-4),c+r.height>a-4&&(c=a-r.height-4),o.style.left=`${Math.max(4,d)}px`,o.style.top=`${Math.max(4,c)}px`,this.contextMenuEl=o,this.contextMenuData={record:e,row:n,column:i},document.addEventListener("mousedown",this._onMenuOutsideClick,!0),document.addEventListener("contextmenu",this._onMenuOutsideClick,!0),document.addEventListener("keydown",this._onMenuKey,!0),!0}_buildMenuList(t,e,n,i,o=0){const s=document.createElement("ul");return s.className=0===o?"dsl-grid-menu-list":"dsl-grid-menu-sub",t.forEach(((t,r)=>{const l=document.createElement("li"),a=Array.isArray(t.children)&&t.children.length>0,d=this._createMenuButton(t,e,n,i,a);if(l.appendChild(d),a){l.classList.add("has-sub");const s=this._buildMenuList(t.children,e,n,i,o+1);let r;l.appendChild(s);const a=()=>{const t=l.parentElement;Array.from(t.children).forEach((t=>{if(t!==l){const e=t.querySelector(".dsl-grid-menu-sub");e&&(e.style.display="none",e.style.maxHeight="",e.style.overflowY="")}})),s.style.display="block",s.style.left="",s.style.top="",s.style.bottom="",s.style.maxHeight="",s.style.overflowY="";const e=l.getBoundingClientRect(),n=s.getBoundingClientRect(),i=document.documentElement.clientWidth,o=document.documentElement.clientHeight,r=i-e.right,a=e.left;r>=n.width?s.style.left="100%":a>=n.width?s.style.left="-100%":s.style.left=r>a?"100%":"-100%";const d=o-e.top,c=e.bottom;d>=n.height?s.style.top="0":c>=n.height?(s.style.top="auto",s.style.bottom="0"):d>=c?(s.style.top="0",s.style.maxHeight=d-4+"px",s.style.overflowY="auto"):(s.style.top="auto",s.style.bottom="0",s.style.maxHeight=c-4+"px",s.style.overflowY="auto")},d=()=>{s.style.display="none"};l.addEventListener("mouseenter",(()=>{clearTimeout(r),a()})),l.addEventListener("mouseleave",(()=>{r=setTimeout(d,200)})),s.addEventListener("mouseenter",(()=>{clearTimeout(r)})),s.addEventListener("mouseleave",(()=>{r=setTimeout(d,200)}))}s.appendChild(l),0===r&&0===o&&d.focus()})),s}_createMenuButton(t,e,n,i,o){const s=document.createElement("button");s.type="button";const r=t.name??t.id;if("check"===t.type){s.className="dsl-grid-menu-button dsl-grid-menu-check";const e=document.createElement("input");e.type="checkbox",e.checked=Boolean(t.checked),e.addEventListener("click",(t=>{t.stopPropagation()})),e.addEventListener("change",(()=>{t.checked=e.checked}));const n=document.createElement("span");n.className="dsl-grid-menu-check-label",n.textContent=r,s.append(e,n)}else if("input"===t.type){s.className="dsl-grid-menu-button dsl-grid-menu-input";const e=document.createElement("input");e.type="text",e.className="dsl-grid-menu-input-field",e.value=t.value??"",Number.isFinite(t.inputWidth)&&t.inputWidth>0&&(e.style.width=`${t.inputWidth}px`),t.placeholder&&(e.placeholder=t.placeholder);const n=t=>t.stopPropagation();["mousedown","mouseup","click","dblclick"].forEach((t=>{e.addEventListener(t,n)})),e.addEventListener("input",(()=>{t.value=e.value}));const i=document.createElement("span");i.className="dsl-grid-menu-input-label",i.textContent=r,s.append(i,e)}else s.className="dsl-grid-menu-button",s.textContent=r;if(s.dataset.id=t.id,o){const t=document.createElement("span");t.className="submenu-arrow",t.textContent="▶",s.appendChild(t),s.addEventListener("click",(t=>{t.stopPropagation()}))}else s.addEventListener("click",(()=>{this._handleMenuSelection(t,e,n,i)}));return s}_handleMenuSelection(t,e,n,i){this._closeContextMenu();const o="check"===t.type,s="input"===t.type,r=this.menuHandlers.get(t.id);"function"!=typeof r?"function"==typeof this.options.onMenuSelect&&(o?this.options.onMenuSelect(t.id,e,n,i,Boolean(t.checked)):s?this.options.onMenuSelect(t.id,e,n,i,t.value??""):this.options.onMenuSelect(t.id,e,n,i)):o?r(Boolean(t.checked),e,n,i):s?r(t.value??"",e,n,i):r(e,n,i)}_closeContextMenu(){this.contextMenuEl&&(this.contextMenuEl.remove(),this.contextMenuEl=null,this.contextMenuData=null,document.removeEventListener("mousedown",this._onMenuOutsideClick,!0),document.removeEventListener("contextmenu",this._onMenuOutsideClick,!0),document.removeEventListener("keydown",this._onMenuKey,!0))}_onMenuOutsideClick(t){this.contextMenuEl&&(this.contextMenuEl.contains(t.target)||this._closeContextMenu())}_onMenuKey(t){"Escape"===t.key&&this._closeContextMenu()}_createMenuId(){return`menu_${Date.now()}_${Math.random().toString(16).slice(2)}`}_findMenuItemById(t,e=this.menuItems){for(const n of e)if(n){if(n.id===t)return n;if(n.children&&n.children.length){const e=this._findMenuItemById(t,n.children);if(e)return e}}return null}_appendMenuItem(t,e){if(e){const n=this._findMenuItemById(String(e));if(n)return n.children=n.children||[],void n.children.push(t)}this.menuItems.push(t)}addMenu(t,e,n){if(!t)return null;const i=this._createMenuId();return this._appendMenuItem({id:i,name:t},n),"function"==typeof e&&this.menuHandlers.set(i,e),i}addCheckMenu(t,e,n=!1,i){if(!t)return null;const o=this._createMenuId();return this._appendMenuItem({id:o,name:t,type:"check",checked:Boolean(n)},i),"function"==typeof e&&this.menuHandlers.set(o,e),o}addInputMenu(t,e,n={},i){if(!t)return null;let o=60,s="",r="";"number"==typeof n?o=Number.isFinite(n)&&n>0?n:o:n&&"object"==typeof n&&(Number.isFinite(n.width)&&n.width>0&&(o=n.width),null!=n.value&&(s=String(n.value)),null!=n.placeholder&&(r=String(n.placeholder)));const l=this._createMenuId();return this._appendMenuItem({id:l,name:t,type:"input",inputWidth:o,value:s,placeholder:r},i),"function"==typeof e&&this.menuHandlers.set(l,e),l}_setupTextareaAutosize(t,e,n){const i=Number.isFinite(e)?e:(()=>{const e=window.getComputedStyle(t).minHeight,n=Number.parseFloat(e);return Number.isFinite(n)&&n>0?n:60})();Number.isFinite(e)&&(t.style.minHeight=`${i}px`),Number.isFinite(n)&&(t.style.maxHeight=`${n}px`,t.style.overflowY="auto");const o=()=>{t.style.height=`${i}px`;const e=t.scrollHeight;e>i+1&&(t.style.height=`${e}px`)};t.addEventListener("input",o),t.style.height=`${i}px`,requestAnimationFrame(o)}_looksLikeJSON(t){if(null==t)return!1;if("object"==typeof t)return!0;if("string"!=typeof t)return!1;const e=t.trim();return e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]")}_isLongText(t){return null!=t&&("string"==typeof t&&t.length>120)}addRows(t=[]){if(!Array.isArray(t)||0===t.length)return[];const e=[];return t.forEach((t=>{const n=this.addRow(t);e.push(n)})),e}add(t){const e=t&&"object"==typeof t?{...t}:{};return this.addRow(e)}addRow(t={}){const e=this.data.reduce(((t,e)=>{const n="number"==typeof e.id?e.id:Number(e.id);return Number.isFinite(n)&&n>t?n:t}),0),n={...t},i=Number(n.id);return null==n.id||!Number.isFinite(i)||i<0?n.id=e+1:n.id=i,this.data.push(n),this._refreshKnownFields(n),this.render(),this.selectRow(this.data.length-1),n}_refreshKnownFields(t){const e=new Set(this.staticFields);this.columns.forEach((t=>{t.field&&e.add(String(t.field))})),this.data.forEach((t=>{Object.keys(t||{}).forEach((t=>e.add(String(t))))})),t&&Object.keys(t).forEach((t=>e.add(String(t)))),this.knownFields=Array.from(e)}replaceRow(t,e={}){const n=this.data.findIndex((e=>e&&e.id===t));if(-1===n)return null;const i=Object.assign({},this.data[n],e);return this.data[n]=i,this._refreshKnownFields(i),this.render(),this.selectRow(n),i}replaceRowAt(t,e={}){if(t<0||t>=this.data.length)return null;const n=this.data[t]||{},i=Object.assign({},n,e);return this.data[t]=i,this._refreshKnownFields(i),this.render(),this.selectRow(t),i}} class CanvasDrawer { constructor(targetElement, color = '#000', width = 1, opacity = 0.6) { const rect = targetElement.getBoundingClientRect(); // 主画布 this.canvas = document.createElement('canvas'); this.canvas.width = rect.width; this.canvas.height = rect.height; this.canvas.style.position = 'absolute'; this.canvas.style.left = `${targetElement.offsetLeft}px`; this.canvas.style.top = `${targetElement.offsetTop}px`; this.canvas.style.zIndex = 50; targetElement.parentNode.appendChild(this.canvas); this.ctx = this.canvas.getContext('2d'); // 附画布 this.overlayCanvas = document.createElement('canvas'); this.overlayCanvas.width = rect.width; this.overlayCanvas.height = rect.height; this.overlayCanvas.style.position = 'absolute'; this.overlayCanvas.style.left = `${targetElement.offsetLeft}px`; this.overlayCanvas.style.top = `${targetElement.offsetTop}px`; this.overlayCanvas.style.zIndex = 51; targetElement.parentNode.appendChild(this.overlayCanvas); this.overlayCtx = this.overlayCanvas.getContext('2d'); // 绘制属性 this.color = color; this.width = width; this.opacity = opacity; this.painting = false; this.activeTool = null; this.startX = 0; this.startY = 0; // 历史栈 this.undoStack = []; this.redoStack = []; // 保存初始状态 this.saveState(); this.initCanvasEvents(); } initCanvasEvents() { this.overlayCanvas.addEventListener('mousedown', (e) => this.startPosition(e)); this.overlayCanvas.addEventListener('mouseup', (e) => this.endPosition(e)); this.overlayCanvas.addEventListener('mousemove', (e) => this.mouseMove(e)); this.overlayCanvas.addEventListener('touchstart', (e) => this.startPosition(e)); this.overlayCanvas.addEventListener('touchend', (e) => this.endPosition(e)); this.overlayCanvas.addEventListener('touchmove', (e) => { e.preventDefault(); this.mouseMove(e); }); } setOpacity(opacity) { this.opacity = opacity; } getOpacity() { return this.opacity; } setFillColor(fillColor) { this.fillColor = fillColor; } // 保存当前状态到undoStack saveState() { this.undoStack.push(this.canvas.toDataURL()); this.redoStack = []; } // 恢复特定状态 restoreState(dataURL) { const img = new Image(); img.src = dataURL; img.onload = () => { this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); this.ctx.drawImage(img, 0, 0, this.canvas.width, this.canvas.height); }; } undo() { if (this.undoStack.length > 1) { // 确保至少有一个状态在栈中 // 将当前状态推入 redoStack this.redoStack.push(this.undoStack.pop()); // 恢复到上一个状态 const previousState = this.undoStack[this.undoStack.length - 1]; this.restoreState(previousState); } } redo() { if (this.redoStack.length > 0) { // 将当前状态推入 undoStack this.undoStack.push(this.redoStack.pop()); // 恢复 redoStack 中的状态 const nextState = this.undoStack[this.undoStack.length - 1]; this.restoreState(nextState); } } startPosition(e) { this.painting = true; const pos = this.getXY(e); this.startX = pos.x; this.startY = pos.y; // 清除附画布,准备新的绘制 this.overlayCtx.clearRect(0, 0, this.overlayCanvas.width, this.overlayCanvas.height); this.overlayCtx.globalAlpha = this.opacity; this.overlayCtx.lineWidth = this.width; this.overlayCtx.strokeStyle = this.color; this.overlayCtx.fillStyle = this.fillColor; if (this.activeTool === 'solidPen' || this.activeTool === 'brush') { this.overlayCtx.beginPath(); this.overlayCtx.moveTo(this.startX, this.startY); } } endPosition(e) { if (!this.painting) return; this.painting = false; // 将附画布内容合并到主画布 this.ctx.drawImage(this.overlayCanvas, 0, 0); // 保存主画布状态到历史栈 this.saveState(); // 清除附画布内容 this.overlayCtx.clearRect(0, 0, this.overlayCanvas.width, this.overlayCanvas.height); } mouseMove(e) { if (!this.painting) return; const pos = this.getXY(e); this.overlayCtx.clearRect(0, 0, this.overlayCanvas.width, this.overlayCanvas.height); if (this.activeTool === 'solidPen' || this.activeTool === 'brush') { this.draw(this.overlayCtx, pos.x, pos.y); } else if (this.activeTool === 'line') { this.drawLine(this.overlayCtx, this.startX, this.startY, pos.x, pos.y); } else if (this.activeTool === 'rect') { this.drawRect(this.overlayCtx, this.startX, this.startY, pos.x - this.startX, pos.y - this.startY); } else if (this.activeTool === 'ellipse') { this.drawEllipse(this.overlayCtx, this.startX, this.startY, pos.x, pos.y); } } draw(ctx, x, y) { // 设置通用绘制属性 ctx.globalAlpha = this.opacity; ctx.lineCap = 'round'; ctx.strokeStyle = this.color; // 根据不同工具类型设置特定属性 if (this.activeTool === 'solidPen') { ctx.lineWidth = this.width; ctx.shadowBlur = 0; // 无阴影 ctx.shadowColor = ''; // 无阴影颜色 } else if (this.activeTool === 'brush') { ctx.lineWidth = this.width * 3; // 更宽的线条 ctx.shadowBlur = 10; // 模糊阴影效果 ctx.shadowColor = this.color; // 阴影颜色与笔刷颜色一致 } // 执行绘制 ctx.lineTo(x, y); ctx.stroke(); } /* draw(ctx, x, y) { ctx.lineTo(x, y); ctx.stroke(); } */ drawLine(ctx, x1, y1, x2, y2) { ctx.beginPath(); ctx.moveTo(x1, y1); ctx.lineTo(x2, y2); ctx.stroke(); } drawRect(ctx, x, y, width, height) { ctx.beginPath(); ctx.rect(x, y, width, height); ctx.stroke(); if (this.fillColor) { ctx.fill(); } } drawEllipse(ctx, x1, y1, x2, y2) { const radiusX = Math.abs(x2 - x1) / 2; const radiusY = Math.abs(y2 - y1) / 2; const centerX = (x1 + x2) / 2; const centerY = (y1 + y2) / 2; ctx.beginPath(); ctx.ellipse(centerX, centerY, radiusX, radiusY, 0, 0, 2 * Math.PI); ctx.stroke(); if (this.fillColor) { ctx.fill(); } } setTool(tool) { this.activeTool = tool; } setColor(color) { this.color = color; } setWidth(width) { this.width = width; } clearCanvas() { this.saveState(); this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); } saveDrawing() { const dataURL = this.canvas.toDataURL('image/png'); const link = document.createElement('a'); link.href = dataURL; link.download = 'drawing.png'; link.click(); } getXY(e) { const rect = this.canvas.getBoundingClientRect(); if (e.touches && e.touches.length > 0) { return { x: e.touches[0].clientX - rect.left, y: e.touches[0].clientY - rect.top }; } else { return { x: e.clientX - rect.left, y: e.clientY - rect.top }; } } } /*===========
3071:CanvasDrawer
===================*/ HTMLElement.prototype.dsvgForm=function(svgCode,ecss){ var that=this; that.clc(); that.$={}; that._={}; ecss=OPlus({ //backgroundColor:'#transparent', //border:'1px solid rgb(0,0,0,0.1)', borderRadius:'4px', padding:4, fontSize:12, },ecss) Object.defineProperty(that, 'J', { get() { // 获取对象的所有属性名,包括不可枚举的属性 let obj = {}; let keys = Object.getOwnPropertyNames(that.$); //console.log(keys) keys.forEach(key => { // 使用getter获取属性值 obj[key] = that.$[key]; }); return obj; }, set(jsonString) { try { let data = JSON.parse(jsonString); for (let key in data) { if (Object.prototype.hasOwnProperty.call(data, key)) { that.$[key] = data[key]; } } } catch (e) { console.error('Invalid JSON string:', e); } }, configurable: true }); var svg=this.css({ //border:'0px solid #f00', display:'flex', justifyContent: 'center', }).son('div',{ flexShrink: 0, position:'relative', },{ innerHTML:svgCode, init:function(){ that.pan=this; } }).children[0]; var aShape=false; var aText=false; var rootG=true; function ssun(o){ var t=o; while (t.children[0]) t=t.children[0]; console.log(t) return t; } function scanSvg(o,r,cont){ //console.log(o.tagName) switch(o.tagName){ case 'text': break; case 'g': break; case 'path': //if(o.style.animation) {} var cc=robj(o,'pp').children.length; //console.log(); for(var i=1;i40) svg.setAttribute('height',cc); //console.log(cont.背板); } else if(o.getAttribute("fill")=='#123456') { //console.log(o) o.setAttribute('fill-opacity',0); tran(o,robj(o,'pp1000000'),cont) } else { //console.log(o.r('pp1000000').innerText) var ot=o.r('pp1000000'); if(ot&& ot.innerText&&ot.innerText.startsWith('^')){ ot.innerText=ot.innerText.substring(1); tran(o,ot,cont,'rect') } }; break; default: break; } }; function recurse(n) { scanSvg(n, false,that); for (var i = 0; i < n.childNodes.length; i++) { recurse(n.childNodes.item(i)); } }; //console.log(svg); var results = {_:{},__:{}}; recurse(svg); /* if(aShape) { tran(aShape,aText,that); }; */ function tran(o,ot,cont,sour){ var ttt=ot.innerText.split(':'); var pname=ttt[0]; var p=o.getBBox(); var dx=0;//cont.pan.offsetLeft+2; var dy=0; switch(ttt[1]){ case 'text': case 'password': case 'number': case 'date': case 'time': case 'email': case 'search': case 'color': case 'file': //console.log(cont.pan) cont._[pname]=cont.pan.son('input',OPlus({ position:'absolute', left:p.x+dx, top:p.y+dy, fontSize:12, width:p.width, height:p.height, //backgroundColor:'#FFF', border:"1px solid rgb(0,0,0,0.1)" },ecss),{ type:ttt[1], }); Object.defineProperty(cont.$, pname, { configurable: true, get() { return that._[pname].value; }, set(value) { cont._[pname].value=value; }, }); if(ttt[2]) cont._[pname].placeholder=ttt[2] break case 'select': cont._[pname]=cont.pan.son('select',Oplus({ position:'absolute', left:p.x+dx,//+cont.z.x, top:p.y+dy, width:p.width, height:p.height, fontSize:12, border:'1px solid rgb(0,0,0,0.1)', //borderRadius:'4px', backgroundColor:'#FFF', //opacity:o.previousElementSibling.tagName=='path'?0:0.9, },ecss),{ //type:'text', }) ; Object.defineProperty(cont.$, pname, { configurable: true, get() { return cont._[pname].value; }, set(value) { cont._[pname].value=value; }, }); if(ttt[2]) { //$clog(ttt[2]) cont._[pname].opts(ttt[2]); } break case 'mselect': cont._[pname]=cont.pan.son('button',Oplus({ position:'absolute', left:p.x+dx,//+cont.z.x, top:p.y+dy, width:p.width, textAlign:'left', height:p.height-3, fontSize:12, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', display:'inline-block', },ecss),{ invalue:[] //type:'text', }) ; Object.defineProperty(cont.$, pname, { configurable: true, get() { return cont._[pname].invalue; }, set(invalue,value) { cont._[pname].invalue=invalue; cont._[pname].value=value; }, }); /*if(ttt[2]) { //$clog(ttt[2]) cont._[pname].opts(ttt[2]); }*/ break case 'checkbox': case 'radio': //o.setAttribute('fill','transparent'); //o.previousElementSibling.setAttribute('fill','transparent'); cont._[pname]=cont.pan.son('div',{ position:'absolute', left:p.x+dx, top:p.y+dy, fontSize:12, width:p.width, height:p.height, backgroundColor:'#FFF', padding:4, },{}).son('input',{ width:20, height:20, },{ type:ttt[1], }) ; Object.defineProperty(cont.$, pname, { configurable: true, get() { return cont._[pname].checked; }, set(value) { cont._[pname].checked=value; }, }); break; case 'range': //o.setAttribute('fill','transparent'); //o.previousElementSibling.setAttribute('fill','transparent'); cont._[pname]=cont.pan.son('div',{ position:'absolute', left:p.x+dx,//+cont.z.x+1, top:p.y+dy, width:p.width, //padding:'5px 20px 5px 10px', //display:'flex', //alignItems: 'center', height:p.height, border:'1px solid rgb(0,0,0,0.1)', //borderRadius:'4px', backgroundColor:'#FFF', //opacity:o.previousElementSibling.tagName=='path'?0:0.9, },{}).son('input',{ border:'0px solid #0a0', height:15, width:p.width-25, backgroundColor:"#FFF", //margin:'auto 10px 0px 10px', left:10, borderRadius:'0px', position:'absolute', bottom:'5px', },{ type:'range', min:ttt[2]||0, max:ttt[3]||100, step:ttt[4]||1, }) Object.defineProperty(cont.$, pname, { configurable: true, get() { return cont._[pname].value; }, set(value) { cont._[pname].value=value; }, }); break; case 'textarea': cont._[pname]=cont.pan.son('textarea',Oplus({ position:'absolute', left:p.x+dx,//+cont.z.x+1, top:p.y+dy, width:p.width, height:p.height, },ecss),{ }); Object.defineProperty(cont.$, pname, { configurable: true, get() { return cont._[pname].value; }, set(value) { cont._[pname].value=value; }, }); if(ttt[2]) cont._[pname].placeholder=ttt[2] break case 'rg': var c=cont.pan.son('div:eediv',{ position:'absolute', left:p.x+dx,//+cont.z.x+1, top:p.y+dy, width:p.width, height:p.height, backgroundColor:'#FFF', border:'1px solid rgb(0,0,0,0.1)', borderRadius:'4px', //opacity:o.previousElementSibling.tagName=='path'?0:1, },{ }); cont._[pname]=new myRGroup(c,ttt[2]) Object.defineProperty(cont.$, pname, { configurable: true, get() { return cont._[pname].value; }, set(value) { cont._[pname].value=value; }, }); //if(ttt[2]) cont._[pname].placeholder=ttt[2] break case 'cg': var c=cont.pan.son('div:ediv',{ position:'absolute', left:p.x+dx,//+cont.z.x+1, top:p.y+dy, width:p.width, height:p.height, backgroundColor:'#FFF', //backgroundColor:'transparent', border:'1px solid rgb(0,0,0,0.1)', borderRadius:'4px', //opacity:o.previousElementSibling.tagName=='path'?0:1, },{ }); cont._[pname]=new myCGroup(c,ttt[2]) Object.defineProperty(cont.$, pname, { configurable: true, get() { return cont._[pname].value; }, set(value) { cont._[pname].value=value; }, }); //if(ttt[2]) cont._[pname].placeholder=ttt[2] break case 'img': var c=cont.pan.son('div',{ position:'absolute', left:p.x+dx-1,//+cont.z.x+1, top:p.y, width:p.width, height:p.height, backgroundColor:'tranaparent', border:'1px solid rgb(0,0,0,0.1)', borderRadius:'4px', //opacity:o.previousElementSibling.tagName=='path'?0:1, },{ onclick:function(){ if(cont['_'+pname]) { cont['_'+pname](this); } //$clog('缺少定义:_'+pname) } }); cont._[pname]=c.son('img:pp',{},{}) Object.defineProperty(cont.$, pname, { configurable: true, get() { return cont._[pname].src; }, set(value) { cont._[pname].src=value; }, }); //if(ttt[2]) cont._[pname].placeholder=ttt[2] break case 'B': var pathData=o.getAttribute('d'); /*cont._[pname]=*/cont.pan.son('div:hmask',{ position:'absolute', left:p.x+dx,//+cont.z.x+1, top:p.y, width:p.width, height:p.height, //backgroundColor:'rgb(255,0,200,0)', //border:'0px solid rgb(0,0,0,0.1)', borderRadius:'4px', //opacity:o.previousElementSibling.tagName=='path'?0:1, //clipPath:`path('${pathData}')`, //transform:`translate(${p.x}px,${p.y}px)`, },{ onclick:function(){ if(cont['_'+pname]) { cont['_'+pname](this); } else $clog('缺少定义:_'+pname) } }); //cont._[pname]=c.son('img:pp',{},{}) /* Object.defineProperty(cont.$, pname, { configurable: true, get() { return cont._[pname].vvv||1; }, set(value) { cont._[pname].vvv=value; }, }); */ //if(ttt[2]) cont._[pname].placeholder=ttt[2] break case 'button': cont._[pname]=cont.pan.son('button',{ position:'absolute', left:p.x+dx, top:p.y, width:p.width, height:p.height, fontSize:12, },{ innerText:ttt[2]||ttt[0], onclick:function(){ if(cont['_'+pname]) { cont['_'+pname](this); } else $clog('缺少定义:_'+pname) } }); break; case '_': //o.setAttribute('fill','transparent'); //o.previousElementSibling.setAttribute('fill','transparent'); cont._[pname]=cont.pan.son('div',{ position:'absolute', left:p.x+dx,//+cont.z.x+1, top:p.y, width:p.width, fontSize:ttt[2]||12, color:'#F00', height:p.height, backgroundColor:'transparent', //border:'1px solid rgb(0,0,0,0.1)', borderRadius:'4px', display:'flex', justifyContent: 'center', textAlign:'center', alignItems:'center', },{ innerText:'' }) Object.defineProperty(cont.$, pname, { configurable: true, get() { return cont._[pname].innerText; }, set(value) { cont._[pname].innerText=value; }, }); break; case '=': cont._[pname]=ot; console.log(ot); cont._[pname].innerText=ttt[2]||ttt[0] Object.defineProperty(cont.$, pname, { configurable: true, get() { return cont._[pname].innerText; }, set(value) { cont._[pname].innerText=value; }, }); break; defaule: break; } ot.innerText=''; //o.style.display='none'; if(o.getAttribute("fill")=='#123456') o.setAttribute("fill",'transparent') if(ttt[1]!='='){ //o.style.display='none'; } else { //o.style.backgroundColor='transparent'; //o.setAttribute('fill','transparent'); } }; function adjustPathData(pathData, dx, dy) { var commands = pathData.match(/[a-z][^a-z]*/ig); var adjustedCommands = commands.map(command => { var type = command[0]; var values = command.slice(1).trim().split(/[\s,]+/).map(parseFloat); for (var i = 0; i < values.length; i += 2) { values[i] += dx; if (values[i + 1] !== undefined) { values[i + 1] += dy; } } return type + values.join(' '); }); return adjustedCommands.join(' '); } } /*===========
8979:DRAWSVG
===================*/ HTMLElement.prototype.svgForm=function(svgCode,opt){ var that=this; that.clc(); that.$={}; that._={}; that.opt=OPlus({ },opt) Object.defineProperty(that, 'J', { get() { // 获取对象的所有属性名,包括不可枚举的属性 let obj = {}; let keys = Object.getOwnPropertyNames(that.$); //console.log(keys) keys.forEach(key => { // 使用getter获取属性值 obj[key] = that.$[key]; }); return obj; }, set(jsonString) { try { let data = JSON.parse(jsonString); for (let key in data) { if (Object.prototype.hasOwnProperty.call(data, key)) { that.$[key] = data[key]; } } } catch (e) { console.error('Invalid JSON string:', e); } }, configurable: true }); var svg=this.css({ //border:'0px solid #f00', display:'flex', justifyContent: 'center', }).son('div',{ flexShrink: 0, position:'relative', //border:'0px solid rgb(0,0,0,0.05)', //boxShadow:'inset 0px 0px 2px #888', //padding:0, //width:20,height:40 },{ innerHTML:svgCode, init:function(){ that.pan=this; this.setAttribute('dropbg',true) //$clog(this.offsetLeft); } }).children[0]; var aShape=false; var aText=false; var rootG=true; function scanSvg(o,r,cont){ //console.log(o); switch(o.tagName){ case 'text': //console.log(o.textContent) if(aShape){ aText+=o.textContent o.textContent='' //o.style.display='none' o.style.visibility='hidden' } break; case 'rect': if(aShape) { //console.log(aText) tran(aShape,aText,that); }; aShape=false; if(o.getAttribute("fill")=='#654321') { cont.背板=o; cont.背板.setAttribute('fill-opacity',0); var cc=cont.背板.getAttribute('width'); svg.setAttribute('width',cc); cc=cont.背板.getAttribute('height'); if (cc>40) svg.setAttribute('height',cc); //console.log(svg); //r.z=o.getBBox(); } else if(o.getAttribute("fill")=='#123456') { aShape=o; o.style.visibility='hidden' aText=''; }; break; case 'path': if(aShape) { //console.log(aText) tran(aShape,aText,that); }; aShape=false; if(o.getAttribute("fill")=='#654321') { cont.背板=o; cont.背板.setAttribute('fill-opacity',0); cc=cont.背板.getAttribute('width'); svg.setAttribute('width',cc); //r.z=o.getBBox(); } else if(o.getAttribute("fill")=='#123456') { aShape=o; o.style.visibility='hidden' aText=''; }; break; case 'g': if(rootG){rootG=false;o.setAttribute('transform','')}; if(aShape) { //console.log(aText) tran(aShape,aText,that); }; aShape=false; if(o.getAttribute("fill")=='#654321') { cont.背板=o; cont.背板.setAttribute('fill-opacity',0); cc=cont.背板.getAttribute('width'); svg.setAttribute('width',cc); //r.z=o.getBBox(); } else if(o.getAttribute("fill")=='#123456') { aShape=o; o.style.visibility='hidden' aText=''; }; break; default: break; } }; function recurse(n) { scanSvg(n, false,that); for (var i = 0; i < n.childNodes.length; i++) { recurse(n.childNodes.item(i)); } }; //console.log(svg); var results = {_:{},__:{}}; recurse(svg); if(aShape) { tran(aShape,aText,that); }; function tran(o,t,cont){ var ttt=t.split(':'); var pname=ttt[0]; var p=o.getBBox(); //console.log(p); var dx=0;//cont.pan.offsetLeft+2; //$clog([cont.z.x,cont.zz.x]) switch(ttt[1]){ case 'text': case 'password': case 'number': case 'date': case 'time': case 'email': case 'search': case 'color': //console.log(cont.pan) cont._[pname]=cont.pan.son('input',{ position:'absolute', left:p.x+dx, top:p.y, fontSize:12, width:p.width, height:p.height, backgroundColor:'#FFF', border:'1px solid rgb(0,0,0,0.1)', borderRadius:'4px', opacity:o.previousElementSibling.tagName=='path'?0:1, },{ type:ttt[1], }); Object.defineProperty(cont.$, pname, { configurable: true, get() { return that._[pname].value; }, set(value) { cont._[pname].value=value; }, }); if(ttt[2]) cont._[pname].placeholder=ttt[2] break case 'select': cont._[pname]=cont.pan.son('select',{ position:'absolute', left:p.x+dx,//+cont.z.x, top:p.y+1, width:p.width, height:p.height, fontSize:12, backgroundColor:'#FFF', border:'1px solid rgb(0,0,0,0.1)', borderRadius:'4px', opacity:o.previousElementSibling.tagName=='path'?0:0.9, },{ //type:'text', }) ; Object.defineProperty(cont.$, pname, { configurable: true, get() { return cont._[pname].value; }, set(value) { cont._[pname].value=value; }, }); if(ttt[2]) { //$clog(ttt[2]) cont._[pname].opts(ttt[2]); } break case 'check': //o.setAttribute('fill','transparent'); //o.previousElementSibling.setAttribute('fill','transparent'); cont._[pname]=cont.pan.son('div',{ position:'absolute', left:p.x+dx,//+cont.z.x+1, top:p.y+1, display:'flex', alignItems: 'center', width:p.width, height:p.height, backgroundColor:'#Fff', border:'1px solid rgb(0,0,0,0.1)', borderRadius:'4px', opacity:o.previousElementSibling.tagName=='path'?0:0.9, },{}).son('input',{ //position:'absolute', //left:5, //top:5, width:20, height:20, },{ type:'checkbox', }) Object.defineProperty(cont.$, pname, { configurable: true, get() { return cont._[pname].checked; }, set(value) { cont._[pname].checked=value; }, }); break; case 'range': //o.setAttribute('fill','transparent'); //o.previousElementSibling.setAttribute('fill','transparent'); cont._[pname]=cont.pan.son('div',{ position:'absolute', left:p.x+dx,//+cont.z.x+1, top:p.y+1, width:p.width, //padding:'5px 20px 5px 10px', //display:'flex', //alignItems: 'center', height:p.height, backgroundColor:'#FFF', border:'1px solid rgb(0,0,0,0.1)', borderRadius:'4px', opacity:o.previousElementSibling.tagName=='path'?0:0.9, },{}).son('input',{ border:'0px solid #0a0', height:15, width:p.width-25, //backgroundColor:"#ddd", //margin:'auto 10px 0px 10px', left:10, borderRadius:'0px', position:'absolute', bottom:'5px' },{ type:'range', min:ttt[2]||0, max:ttt[3]||100, step:ttt[4]||1, }) Object.defineProperty(cont.$, pname, { configurable: true, get() { return cont._[pname].value; }, set(value) { cont._[pname].value=value; }, }); break; case 'textarea': cont._[pname]=cont.pan.son('textarea',{ position:'absolute', left:p.x+dx,//+cont.z.x+1, top:p.y+1, width:p.width, height:p.height, backgroundColor:'#FFF', border:'1px solid rgb(0,0,0,0.1)', borderRadius:'4px', opacity:o.previousElementSibling.tagName=='path'?0:1, padding:5, fontSize:12, },{ }); Object.defineProperty(cont.$, pname, { configurable: true, get() { return cont._[pname].value; }, set(value) { cont._[pname].value=value; }, }); if(ttt[2]) cont._[pname].placeholder=ttt[2] break case 'rg': var c=cont.pan.son('div:eediv',{ position:'absolute', left:p.x+dx,//+cont.z.x+1, top:p.y+1, width:p.width, height:p.height, backgroundColor:'#FFF', border:'1px solid rgb(0,0,0,0.1)', borderRadius:'4px', opacity:o.previousElementSibling.tagName=='path'?0:1, },{ }); cont._[pname]=new myRGroup(c,ttt[2]) Object.defineProperty(cont.$, pname, { configurable: true, get() { return cont._[pname].value; }, set(value) { cont._[pname].value=value; }, }); //if(ttt[2]) cont._[pname].placeholder=ttt[2] break case 'cg': var c=cont.pan.son('div:ediv',{ position:'absolute', left:p.x+dx,//+cont.z.x+1, top:p.y+1, width:p.width, height:p.height, backgroundColor:'#FFF', border:'1px solid rgb(0,0,0,0.1)', borderRadius:'4px', opacity:o.previousElementSibling.tagName=='path'?0:1, },{ }); cont._[pname]=new myCGroup(c,ttt[2]) Object.defineProperty(cont.$, pname, { configurable: true, get() { return cont._[pname].value; }, set(value) { cont._[pname].value=value; }, }); //if(ttt[2]) cont._[pname].placeholder=ttt[2] break case 'img': var c=cont.pan.son('div',{ position:'absolute', left:p.x+dx-1,//+cont.z.x+1, top:p.y, width:p.width, height:p.height, backgroundColor:'tranaparent', border:'1px solid rgb(0,0,0,0.1)', borderRadius:'4px', opacity:o.previousElementSibling.tagName=='path'?0:1, },{ onclick:function(){ if(cont['_'+pname]) { cont['_'+pname](this); } //$clog('缺少定义:_'+pname) } }); cont._[pname]=c.son('img:pp',{},{}) Object.defineProperty(cont.$, pname, { configurable: true, get() { return cont._[pname].src; }, set(value) { cont._[pname].src=value; }, }); //if(ttt[2]) cont._[pname].placeholder=ttt[2] break case 'B': var pathData=o.getAttribute('d'); cont._[pname]=cont.pan.son('div:hmask',{ position:'absolute', left:p.x+dx-1,//+cont.z.x+1, top:p.y, width:p.width, height:p.height, //backgroundColor:'rgb(255,0,200,0)', border:'0px solid rgb(0,0,0,0.1)', borderRadius:'4px', //opacity:o.previousElementSibling.tagName=='path'?0:1, //clipPath:`path('${pathData}')`, //transform:`translate(${p.x}px,${p.y}px)`, },{ onclick:function(){ if(cont['_'+pname]) { cont['_'+pname](this); } else $clog('缺少定义:_'+pname) } }); //cont._[pname]=c.son('img:pp',{},{}) Object.defineProperty(cont.$, pname, { configurable: true, get() { return cont._[pname].src; }, set(value) { cont._[pname].src=value; }, }); //if(ttt[2]) cont._[pname].placeholder=ttt[2] break case 'button': cont._[pname]=cont.pan.son('button',{ position:'absolute', left:p.x+dx,//+cont.z.x+1, top:p.y+1, width:p.width, //padding:3, height:p.height, border:'1px solid rgb(0,0,0,0.1)', borderRadius:'4px', //opacity:o.previousElementSibling.tagName=='path'?0:0.9, },{ innerText:ttt[2]||ttt[0], onclick:function(){ if(cont['_'+pname]) { cont['_'+pname](this); } else $clog('缺少定义:_'+pname) } }); break; case '_': //o.setAttribute('fill','transparent'); //o.previousElementSibling.setAttribute('fill','transparent'); cont._[pname]=cont.pan.son('div',{ position:'absolute', left:p.x+dx,//+cont.z.x+1, top:p.y, //display:'flex', //alignItems: 'center', width:p.width, fontSize:ttt[2]||12, color:'#F00', height:p.height, backgroundColor:'transparent', //border:'1px solid rgb(0,0,0,0.1)', borderRadius:'4px', display:'flex', justifyContent: 'center', textAlign:'center', alignItems:'center', },{ innerText:'' }) Object.defineProperty(cont.$, pname, { configurable: true, get() { return cont._[pname].innerText; }, set(value) { cont._[pname].innerText=value; }, }); break; case '=': //o.setAttribute('fill','transparent'); //o.previousElementSibling.setAttribute('fill','transparent'); cont._[pname]=cont.pan.son('div:hmask',{ position:'absolute', left:p.x+dx,//+cont.z.x+1, top:p.y, display:'flex', alignItems: 'center', width:p.width, height:p.height, backgroundColor:'#F00', border:'1px solid rgb(0,0,0,0.1)', borderRadius:'4px', //opacity:o.previousElementSibling.tagName=='path'?0:0.9, },{}) Object.defineProperty(cont.$, pname, { configurable: true, get() { return cont._[pname].innerText; }, set(value) { cont._[pname].innerText=value; }, }); break; defaule: break; } o.textContent=''; }; function adjustPathData(pathData, dx, dy) { var commands = pathData.match(/[a-z][^a-z]*/ig); var adjustedCommands = commands.map(command => { var type = command[0]; var values = command.slice(1).trim().split(/[\s,]+/).map(parseFloat); for (var i = 0; i < values.length; i += 2) { values[i] += dx; if (values[i + 1] !== undefined) { values[i + 1] += dy; } } return type + values.join(' '); }); return adjustedCommands.join(' '); } } /*===========
8748:HTMLSVG
===================*/ function myList0(p){ function Text2P(t){ var r=""; t.split('\n').forEach(function(e){ r+='

'+e+'

'; }); return r; }; var imgsrcStack=[];//单线程顺序加载 var action=false; function act(){ if(action) return; action=true; if(imgsrcStack.length==0) {action=false;return}; var c=imgsrcStack.shift(); c[0].src=c[1]; c[0].onload=function(){ $clog("串行加载"); action=false; setTimeout(act,200) //act(); }; }; var observer; //懒加载 observer = new IntersectionObserver((entries, observer) => { entries.forEach(entry => { if (entry.isIntersecting) { //console.log(entry.target._src) const imgElement = entry.target; const src = imgElement._src; // 从 dataset.src 获取图片路径 $clog('惰性加载'); imgElement.src = src; // 设置图片 src,开始加载 observer.unobserve(imgElement); // 加载后取消观察该图片 } }); }); var r=p.son('div:ydiv',{ fontSize:16, border:'0px solid #FFF', },{}).son('table:eetb',{ //border:'3px solid #F00', tableLayout:'fixed' },{ addText(t,c,p2){ return this.addRow().addCell(-1,OPlus({ padding:10, textIndent:'1cm', textAlign:'justify', },c),{ innerHTML:p2?Text2P(t):t }) }, addMD(t,c){ return this.addRow().addCell(-1,OPlus({ padding:10, textIndent:'1cm', textAlign:'justify', },c),{ innerHTML:marked.parse(_tmd_(t)) }) }, addHTML:function(t,c){ return this.addRow().addCell(-1,OPlus({padding:10,},c),{ innerHTML:t }) }, addImg:function(src,c,t){ var cc=this.addRow().addCell(-1); cc.imgx=cc.son('img',OPlus({ width:'100%', minHeight:80, },c),{ src:src, title:t||'img', }); //imgsrcStack.push([imgx,src]); //act(); return cc; }, addOBImg:function(src,c,t){ var cx=this.addRow().addCell(-1); var imgx=cx.son('img',OPlus({ width:'100%' },c),{ _src:src, title:t //dataset:{src:src} }); observer.observe(imgx); return cx; }, addSTImg:function(src,c){ var imgx=this.addRow().addCell(-1).son('img',OPlus({ width:'100%' },c),{ //src:t title:t, }); imgsrcStack.push([imgx,src]); act(); return c; }, addCode:function(t){ return this.addRow().addCell(-1,{ padding:10, }).son('div',{ width:'100%', overflowX:'scroll', }).son('pre',{ width:'auto', //overflowX:'auto', whiteSpace:'pre', },{ innerText:t, }) }, addTitle:function(t,c){ return this.addRow().addCell(-1,OPlus({ backgroundColor:'#EEE', fongSize:20, padding:8, },c),{ innerText:t }) }, addVideo:function(src,f,poster,c){ var v=this.addRow().addCell().son('video',OPlus({ width:'100%',height:'auto' },c),{ src:src, controls:true, //preload:"metadata", //autoplay:true, onloadedmetadata:function(){ this.currentTime=f||0; v.style.height+=50 }, onclick:function(){ this.play(); }, poter:poster||false, }); v.addEventListener('play',function(){ //this.title&&$clog(this.title); if(aVideo&&aVideo!==this) aVideo.pause(); aVideo=this; }) //setVideoPlayWhenCenter(v); return v }, addRNote:function(t,c){ return this.addRow().addCell(-1,OPlus({ //backgroundColor:'#EEE', fontSize:12, fontStyle: 'italic', textAlign:'right', padding:4, backgroundColor:"#eee", borderBottom:'1px solid #aaa', color:'#008' },c),{ innerText:t }) }, add赞助商:function(logo,info){ var v=this.addRow().addCell(); v.myFrm('logo:120*info'); v.$.logo.son('img',{ width:'100%', height:'auto' },{ src:logo }); v.$.info.css({ //backgroundColor:'#F00', fontSize:18, padding:8 },{ innerText:info }) return v }, addUsermVideo(id,u){ var v=this.addRow().addCell().son('div',{position:'relative'}); v.son('img',{ width:'100%', height:'auto', //maskImage:'url(/svcn/1636)', //maskSize:'50px 50px', },{ src:u||`/svcn/gzh_cimgTi?${id}&jtxh`, ssrc:isNaN(id)?id:`/svcn/gzh_cmp4i?${id}&jtxh`, onclick:function(){ pMp4(this.ssrc) } }); v.son('div',{ width:60,height:60,right:10,bottom:10, position:'absolute', backgroundImage:'url(/svcn/8510)', backgroundRepeat:'no-repeat', backgroundPosition:'center center', backgroundSize:'100% 100%', pointerEvents: 'none', //zIndex:10, //opacity:0.5, //boxShadow:'0px 0px 5px #FFF', //backgroundColor:'#F00', }); //('/svcn/1636'); }, addIMGLabel(l,url){ var v=this.addRow().addCell(); return v.IMGLabel(l,url); }, addBiliButton(bvid,cap){ var w=this.offsetWidth-60; var v=this.addRow().addCell(-1,{ textAlign:'left' },{ innerHTML:`` .replace('__BVID__',bvid) .replace('__CAP__',cap) .replace('__WIDTH__',w) }); return v }, addMarq(t,speed,c){ var p=this.addRow().addCell(-1); var createMarquee = function(parent, text,speed,c) { var son = parent.css(OPlus({ whiteSpace: 'nowrap', overflow: 'hidden', display: 'inline-block', position: 'relative', width:'auto' },c),{ innerText: text }); let position = parent.offsetWidth; function animateMarquee() { position -= speed; if (position < -son.offsetWidth) { position = parent.offsetWidth; } son.style.left = `${position}px`; requestAnimationFrame(animateMarquee); } son.style.left = `${position}px`; animateMarquee(); return son; } return createMarquee(p,t,speed,c||{}); }, addApps:function(a,reload){ console.log(a) var apps=a; //if (Array.isArray(a)) { // apps=a.join(','); //}; var that=this; var ds=that.addRow().addCell(-1,{padding:10}); myGetS(2464,[apps],function(x){ x.forEach(function(e){ var dd=ds.son('div',{ width:60,height:80, float:'left', boxShadow:'0px 0px 4px #F00', backgroundImage:`url(/svcn/${e.icon})`, backgroundRepeat:'no-repeat', backgroundPosition:'center 5px', backgroundSize:'60% auto', margin:10, borderRadius:'8px', position:'relative', },{ _id:e.id, //innerText:e.cmdname, reload:reload, onclick:function(){ $clog(this._id) if(this.reload){ ___myFuns.funs[this._id]=false } _r.popFun(this._id) }, init:function(){ this.lb=this.son('span',{ position:'absolute', bottom:2, padding:2, width:'100%',textAlign:'center', fontSize:12, },{ innerText:e.cmdname, }) }, }) }) },true) }, addApp:function(a,b,onclick,reload){ var app=a; //if (Array.isArray(a)) { // apps=a.join(','); //}; var that=this; var ds=that.addRow().addCell(-1,{padding:10}); myGetS(8508,[app],function(x){ b.forEach(function(e){ var dd=ds.son('div',{ width:60,height:80, float:'left', boxShadow:'0px 0px 4px #F00', backgroundImage:`url(/svcn/${x[0].icon})`, backgroundRepeat:'no-repeat', backgroundPosition:'center 5px', backgroundSize:'60% auto', margin:10, borderRadius:'8px', position:'relative', },{ _id:x[0].id, _d:e, //innerText:e.cmdname, reload:reload, onclick:function(){ if(this.reload){ ___myFuns.funs[this._id]=false } //_r.popFun(this._id,e.par) onclick(this) }, init:function(){ this.lb=this.son('span',{ position:'absolute', bottom:2, padding:2, width:'100%',textAlign:'center', fontSize:12, },{ innerText:x[0].cmdname+'-'+e.name, }) }, }) }); },true) }, loadApps:function(a,b,tclick,reload){ var apps=a; if (Array.isArray(a)) { apps=a.join(','); }; var that=this; var ds=that.addRow().addCell(-1,{padding:10}); myGetS(9150,[apps],function(x){ x.forEach(function(e){ var dd=ds.son('div',{ width:60,height:80, float:'left', boxShadow:'0px 0px 4px #F00', backgroundImage:`url(/svcn/${e.icon})`, backgroundRepeat:'no-repeat', backgroundPosition:'center 5px', backgroundSize:'60% auto', margin:10, borderRadius:'8px', position:'relative', },{ _id:e.id, _d:b, //innerText:e.cmdname, reload:reload, onclick:function(){ if(this.reload){ ___myFuns.funs[this._id]=false } tclick(this); // _r.popFun(this._id) }, init:function(){ this.lb=this.son('span',{ position:'absolute', bottom:2, padding:2, width:'100%',textAlign:'center', fontSize:12, },{ innerText:e.cmdname, }) }, }) }) },true) }, load:function(idx){ }, clear:function(){ r.clc(); }, }); return r } /*===========
8449:myList0
===================*/