xframelib 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
- import{h as _n,openBlock as X,createElementBlock as gt,normalizeStyle as vt,renderSlot as ct,defineComponent as Rt,ref as K,withModifiers as or,getCurrentInstance as zs,computed as Xt,watch as Pt,onMounted as Sn,onBeforeUnmount as As,nextTick as rr,resolveComponent as Se,createBlock as nt,Transition as ir,withCtx as Ct,withDirectives as sr,createElementVNode as J,Fragment as zt,createTextVNode as Cn,toDisplayString as En,createCommentVNode as st,vShow as ar,markRaw as Ls,onErrorCaptured as Ds,Suspense as $s,createVNode as Ce,KeepAlive as cr,resolveDynamicComponent as Et,reactive as Ns,toRefs as Bs,renderList as Vt,normalizeClass as At,TransitionGroup as js,onUnmounted as Os,unref as xn}from"vue";import Ws from"axios";import Us from"qs";import{Client as Fs,ClientContext as kn}from"@hprose/rpc-core";import{ByteStream as Ee,Writer as Hs,Reader as qs}from"@hprose/io";import{HttpTransport as Xs}from"@hprose/rpc-html5";var Vs={name:"splitpanes",props:{horizontal:{type:Boolean},pushOtherPanes:{type:Boolean,default:!0},dblClickSplitter:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean}},provide(){return{requestUpdate:this.requestUpdate,onPaneAdd:this.onPaneAdd,onPaneRemove:this.onPaneRemove,onPaneClick:this.onPaneClick}},data:()=>({container:null,ready:!1,panes:[],touch:{mouseDown:!1,dragging:!1,activeSplitter:null},splitterTaps:{splitter:null,timeoutId:null}}),computed:{panesCount(){return this.panes.length},indexedPanes(){return this.panes.reduce((e,t)=>(e[t.id]=t)&&e,{})}},methods:{updatePaneComponents(){this.panes.forEach(e=>{e.update&&e.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[e.id].size}%`})})},bindEvents(){document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),document.addEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.addEventListener("touchmove",this.onMouseMove,{passive:!1}),document.addEventListener("touchend",this.onMouseUp))},unbindEvents(){document.removeEventListener("mousemove",this.onMouseMove,{passive:!1}),document.removeEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.removeEventListener("touchmove",this.onMouseMove,{passive:!1}),document.removeEventListener("touchend",this.onMouseUp))},onMouseDown(e,t){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=t},onMouseMove(e){this.touch.mouseDown&&(e.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(e)),this.$emit("resize",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(e,t){"ontouchstart"in window&&(e.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===t?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(e,t),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=t,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[t])},onSplitterDblClick(e,t){let n=0;this.panes=this.panes.map((o,r)=>(o.size=r===t?o.max:o.min,r!==t&&(n+=o.min),o)),this.panes[t].size-=n,this.$emit("pane-maximize",this.panes[t])},onPaneClick(e,t){this.$emit("pane-click",this.indexedPanes[t])},getCurrentMouseDrag(e){const t=this.container.getBoundingClientRect(),{clientX:n,clientY:o}="ontouchstart"in window&&e.touches?e.touches[0]:e;return{x:n-t.left,y:o-t.top}},getCurrentDragPercentage(e){e=e[this.horizontal?"y":"x"];const t=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(e=t-e),100*e/t},calculatePanesSize(e){const t=this.touch.activeSplitter;let n={prevPanesSize:this.sumPrevPanesSize(t),nextPanesSize:this.sumNextPanesSize(t),prevReachedMinPanes:0,nextReachedMinPanes:0};const o=0+(this.pushOtherPanes?0:n.prevPanesSize),r=100-(this.pushOtherPanes?0:n.nextPanesSize),i=Math.max(Math.min(this.getCurrentDragPercentage(e),r),o);let s=[t,t+1],a=this.panes[s[0]]||null,l=this.panes[s[1]]||null;const h=a.max<100&&i>=a.max+n.prevPanesSize,w=l.max<100&&i<=100-(l.max+this.sumNextPanesSize(t+1));if(h||w)h?(a.size=a.max,l.size=Math.max(100-a.max-n.prevPanesSize-n.nextPanesSize,0)):(a.size=Math.max(100-l.max-n.prevPanesSize-this.sumNextPanesSize(t+1),0),l.size=l.max);else{if(this.pushOtherPanes){const _=this.doPushOtherPanes(n,i);if(!_)return;({sums:n,panesToResize:s}=_),a=this.panes[s[0]]||null,l=this.panes[s[1]]||null}a!==null&&(a.size=Math.min(Math.max(i-n.prevPanesSize-n.prevReachedMinPanes,a.min),a.max)),l!==null&&(l.size=Math.min(Math.max(100-i-n.nextPanesSize-n.nextReachedMinPanes,l.min),l.max))}},doPushOtherPanes(e,t){const n=this.touch.activeSplitter,o=[n,n+1];return t<e.prevPanesSize+this.panes[o[0]].min&&(o[0]=this.findPrevExpandedPane(n).index,e.prevReachedMinPanes=0,o[0]<n&&this.panes.forEach((r,i)=>{i>o[0]&&i<=n&&(r.size=r.min,e.prevReachedMinPanes+=r.min)}),e.prevPanesSize=this.sumPrevPanesSize(o[0]),o[0]===void 0)?(e.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((r,i)=>{i>0&&i<=n&&(r.size=r.min,e.prevReachedMinPanes+=r.min)}),this.panes[o[1]].size=100-e.prevReachedMinPanes-this.panes[0].min-e.prevPanesSize-e.nextPanesSize,null):t>100-e.nextPanesSize-this.panes[o[1]].min&&(o[1]=this.findNextExpandedPane(n).index,e.nextReachedMinPanes=0,o[1]>n+1&&this.panes.forEach((r,i)=>{i>n&&i<o[1]&&(r.size=r.min,e.nextReachedMinPanes+=r.min)}),e.nextPanesSize=this.sumNextPanesSize(o[1]-1),o[1]===void 0)?(e.nextReachedMinPanes=0,this.panes[this.panesCount-1].size=this.panes[this.panesCount-1].min,this.panes.forEach((r,i)=>{i<this.panesCount-1&&i>=n+1&&(r.size=r.min,e.nextReachedMinPanes+=r.min)}),this.panes[o[0]].size=100-e.prevPanesSize-e.nextReachedMinPanes-this.panes[this.panesCount-1].min-e.nextPanesSize,null):{sums:e,panesToResize:o}},sumPrevPanesSize(e){return this.panes.reduce((t,n,o)=>t+(o<e?n.size:0),0)},sumNextPanesSize(e){return this.panes.reduce((t,n,o)=>t+(o>e+1?n.size:0),0)},findPrevExpandedPane(e){return[...this.panes].reverse().find(t=>t.index<e&&t.size>t.min)||{}},findNextExpandedPane(e){return this.panes.find(t=>t.index>e+1&&t.size>t.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(e=>{const t=e.classList.contains("splitpanes__pane"),n=e.classList.contains("splitpanes__splitter");if(!t&&!n)return e.parentNode.removeChild(e),void console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed.")})},addSplitter(e,t,n=!1){const o=e-1,r=document.createElement("div");r.classList.add("splitpanes__splitter"),n||(r.onmousedown=i=>this.onMouseDown(i,o),typeof window<"u"&&"ontouchstart"in window&&(r.ontouchstart=i=>this.onMouseDown(i,o)),r.onclick=i=>this.onSplitterClick(i,o+1)),this.dblClickSplitter&&(r.ondblclick=i=>this.onSplitterDblClick(i,o+1)),t.parentNode.insertBefore(r,t)},removeSplitter(e){e.onmousedown=void 0,e.onclick=void 0,e.ondblclick=void 0,e.parentNode.removeChild(e)},redoSplitters(){const e=Array.from(this.container.children);e.forEach(n=>{n.className.includes("splitpanes__splitter")&&this.removeSplitter(n)});let t=0;e.forEach(n=>{n.className.includes("splitpanes__pane")&&(!t&&this.firstSplitter?this.addSplitter(t,n,!0):t&&this.addSplitter(t,n),t++)})},requestUpdate({target:e,...t}){const n=this.indexedPanes[e._.uid];Object.entries(t).forEach(([o,r])=>n[o]=r)},onPaneAdd(e){let t=-1;Array.from(e.$el.parentNode.children).some(r=>(r.className.includes("splitpanes__pane")&&t++,r===e.$el));const n=parseFloat(e.minSize),o=parseFloat(e.maxSize);this.panes.splice(t,0,{id:e._.uid,index:t,min:isNaN(n)?0:n,max:isNaN(o)?100:o,size:e.size===null?null:parseFloat(e.size),givenSize:e.size,update:e.update}),this.panes.forEach((r,i)=>r.index=i),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[t]}),this.$emit("pane-add",{index:t,panes:this.panes.map(r=>({min:r.min,max:r.max,size:r.size}))})})},onPaneRemove(e){const t=this.panes.findIndex(o=>o.id===e._.uid),n=this.panes.splice(t,1)[0];this.panes.forEach((o,r)=>o.index=r),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...n,index:t}}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(o=>({min:o.min,max:o.max,size:o.size}))})})},resetPaneSizes(e={}){e.addedPane||e.removedPane?this.panes.some(t=>t.givenSize!==null||t.min||t.max<100)?this.equalizeAfterAddOrRemove(e):this.equalize():this.initialPanesSizing(),this.ready&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size})))},equalize(){const e=100/this.panesCount;let t=0;const n=[],o=[];this.panes.forEach(r=>{r.size=Math.max(Math.min(e,r.max),r.min),t-=r.size,r.size>=r.max&&n.push(r.id),r.size<=r.min&&o.push(r.id)}),t>.1&&this.readjustSizes(t,n,o)},initialPanesSizing(){let e=100;const t=[],n=[];let o=0;this.panes.forEach(i=>{e-=i.size,i.size!==null&&o++,i.size>=i.max&&t.push(i.id),i.size<=i.min&&n.push(i.id)});let r=100;e>.1&&(this.panes.forEach(i=>{i.size===null&&(i.size=Math.max(Math.min(e/(this.panesCount-o),i.max),i.min)),r-=i.size}),r>.1&&this.readjustSizes(e,t,n))},equalizeAfterAddOrRemove({addedPane:e}={}){let t=100/this.panesCount,n=0;const o=[],r=[];e&&e.givenSize!==null&&(t=(100-e.givenSize)/(this.panesCount-1)),this.panes.forEach(i=>{n-=i.size,i.size>=i.max&&o.push(i.id),i.size<=i.min&&r.push(i.id)}),!(Math.abs(n)<.1)&&(this.panes.forEach(i=>{e&&e.givenSize!==null&&e.id===i.id||(i.size=Math.max(Math.min(t,i.max),i.min)),n-=i.size,i.size>=i.max&&o.push(i.id),i.size<=i.min&&r.push(i.id)}),n>.1&&this.readjustSizes(n,o,r))},readjustSizes(e,t,n){let o;o=e>0?e/(this.panesCount-t.length):e/(this.panesCount-n.length),this.panes.forEach(r=>{if(e>0&&!t.includes(r.id)){const i=Math.max(Math.min(r.size+o,r.max),r.min),s=i-r.size;e-=s,r.size=i}else if(!n.includes(r.id)){const i=Math.max(Math.min(r.size+o,r.max),r.min),s=i-r.size;e-=s,r.size=i}r.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[r.id].size}%`})}),Math.abs(e)>.1&&this.$nextTick(()=>{this.ready&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})}},watch:{panes:{deep:!0,immediate:!1,handler(){this.updatePaneComponents()}},horizontal(){this.updatePaneComponents()},firstSplitter(){this.redoSplitters()},dblClickSplitter(e){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((t,n)=>{t.ondblclick=e?o=>this.onSplitterDblClick(o,n):void 0})}},beforeUnmount(){this.ready=!1},mounted(){this.container=this.$refs.container,this.checkSplitpanesNodes(),this.redoSplitters(),this.resetPaneSizes(),this.updatePaneComponents(),this.$emit("ready"),this.ready=!0},render(){return _n("div",{ref:"container",class:["splitpanes","splitpanes--"+(this.horizontal?"horizontal":"vertical"),{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())},__file:"src/controls/splitpanes/splitpanes.vue"},In={name:"pane",inject:["requestUpdate","onPaneAdd","onPaneRemove","onPaneClick"],props:{size:{type:[Number,String],default:10},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},data:()=>({style:{}}),mounted(){this.onPaneAdd(this)},beforeUnmount(){this.onPaneRemove(this)},methods:{update(e){this.style=e}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(e){this.requestUpdate({target:this,size:e})},minSizeNumber(e){this.requestUpdate({target:this,min:e})},maxSizeNumber(e){this.requestUpdate({target:this,max:e})}}};function Tn(e){return window.TouchEvent&&e instanceof TouchEvent}In.render=function(e,t,n,o,r,i){return X(),gt("div",{class:"splitpanes__pane",onClick:t[0]||(t[0]=s=>i.onPaneClick(s,e._.uid)),style:vt(e.style)},[ct(e.$slots,"default")],4)},In.__file="src/controls/splitpanes/pane.vue";class pt{e;constructor(t){this.e=t}stopPropagation(){this.e.stopPropagation()}preventDefault(){this.e.preventDefault()}get clientX(){return Tn(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return Tn(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new Do(this.clientX,this.clientY)}static bindDown(t,n,o,r=!1){const i=a=>{n(new pt(a))},s=a=>{a.touches.length===1&&n(new pt(a)),a.touches.length>1&&o&&o(new pt(a))};return t.addEventListener("mousedown",i,r),t.addEventListener("touchstart",s,r),()=>{t.removeEventListener("mousedown",i,r),t.removeEventListener("touchstart",s,r)}}static bindMove(t,n,o=!1){const r=s=>{n(new pt(s))},i=s=>{s.touches.length===1&&n(new pt(s))};return t.addEventListener("mousemove",r,o),t.addEventListener("touchmove",i,o),()=>{t.removeEventListener("mousemove",r,o),t.removeEventListener("touchmove",i,o)}}static bindUp(t,n,o=!1){const r=s=>{n(new pt(s))},i=s=>{s.touches.length===0&&n(new pt(s))};return t.addEventListener("mouseup",r,o),t.addEventListener("touchend",i,o),()=>{t.removeEventListener("mouseup",r,o),t.removeEventListener("touchend",i,o)}}originalEvent({mouse:t,touch:n}){Tn(this.e)?n&&n(this.e):t&&t(this.e)}}class Do{x;y;constructor(t,n){this.x=t,this.y=n}clone(){return new Do(this.x,this.y)}}class Gs{handle;container;options;unbindDown;unbindMove;unbindUp;constructor(t,n,o={}){this.handle=t,this.container=n,this.options=o,t&&(this.unbindDown=pt.bindDown(t,this.mousedown),t.classList.add("draggable-handle"))}teardown(){this.handle?.classList.remove("draggable-handle"),this.unbindDown&&this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove()}offsetX;offsetY;mousedown=t=>{if(t.preventDefault(),this.handle){const{left:n,top:o}=this.handle.getBoundingClientRect();this.offsetX=t.clientX-n,this.offsetY=t.clientY-o}this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=pt.bindMove(document,this.mousemove),this.unbindUp=pt.bindUp(document,this.mouseup)};mousemove=t=>{this.container&&(this.container.style.left=t.clientX-this.offsetX+"px",this.container.style.top=t.clientY-this.offsetY+"px"),this.options.onMove&&this.options.onMove()};mouseup=t=>{this.options.onMoveEnd&&this.options.onMoveEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0}}class Ks{_group;onChange;zIndex;constructor(t,n){this._group=t,this.onChange=n,this.a(o=>o.push(this))}set group(t){this._group=t;const n=ke(this._group),o=ke(t);n.splice(n.indexOf(this),1),o.push(this),ur()}get group(){return this._group}unregister(){this.a(t=>t.splice(t.indexOf(this),1))}raise(){this.a(t=>{t.splice(t.indexOf(this),1),t.push(this)})}a(t){t(ke(this._group)),ur()}}const xe=new Map;function ke(e){return xe.has(e)||xe.set(e,[]),xe.get(e)}function lr(e,t){return e>t?-lr(t,e):e<0&&t>=0?1:e-t}function ur(){let e=0;for(const t of function(n){const o=[];return n.forEach((r,i)=>o.push(i)),o}(xe).sort(lr))for(const n of ke(t))e!=n.zIndex&&(n.zIndex=e,n.onChange(e)),e++}function Rn(e){if(e){const{width:t,height:n}=e.style;e.style.width="auto",e.style.height="auto";const o=Ie(e);return e.style.width=t,e.style.height=n,o}return{width:0,height:0,top:0,left:0,bottom:0,right:0}}function Ie(e){const t=e.getBoundingClientRect(),n=t.width,o=t.height,r=t.top,i=t.left;return{width:n,height:o,top:r,left:i,bottom:r+o,right:i+n}}class Js{container;options;handles;constructor(t,n){if(this.container=t,this.options=n,t&&n){this.handles=hr.map(l=>new l(t,this));const{width:o,height:r}=Rn(t),i=n.maxWidth||window.innerWidth,s=n.maxHeight||window.innerHeight;let a=!1;(o<n.minWidth||o>i)&&(t.style.width=`${dr(o,n.minWidth,i)}px`,a=!0),(r<n.minHeight||r>s)&&(t.style.height=`${dr(r,n.minHeight,s)}px`,a=!0),a&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(t=>t.teardown())}}const hr=[];class Mt{container;helper;handle;handleSize=8;unbindDown;unbindMove;unbindUp;constructor(t,n){this.container=t,this.helper=n,this.handle=this.createHandleElement(),this.unbindDown=pt.bindDown(this.handle,this.mousedown)}teardown(){this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove(),this.handle.parentElement.removeChild(this.handle)}x0;y0;left0;top0;width0;height0;mousedown=t=>{t.preventDefault(),t.stopPropagation();const{left:n,top:o,width:r,height:i}=Ie(this.container);this.x0=t.clientX,this.y0=t.clientY,this.left0=n,this.top0=o,this.width0=r,this.height0=i,this.calcSafeBoundaries(),this.helper.options&&this.helper.options.onResizeStart&&this.helper.options.onResizeStart(),this.unbindMove=pt.bindMove(document,this.mousemove),this.unbindUp=pt.bindUp(document,this.mouseup)};minLeft;maxLeft;minRight;maxRight;minTop;maxTop;minBottom;maxBottom;calcSafeBoundaries(){if(!this.helper.options)return;const{left:t,top:n,right:o,bottom:r}=Ie(this.container),i=this.helper.options,s=i.maxWidth||window.innerWidth,a=i.maxHeight||window.innerHeight;this.minLeft=Math.max(o-s,0),this.maxLeft=o-i.minWidth,this.minRight=t+i.minWidth,this.maxRight=Math.min(t+s,window.innerWidth),this.minTop=Math.max(r-a,0),this.maxTop=r-i.minHeight,this.minBottom=n+i.minHeight,this.maxBottom=Math.min(n+a,window.innerHeight)}mousemove=t=>{t.preventDefault(),t.stopPropagation(),this.setPosition(t),this.fixPosition(),this.helper.options&&this.helper.options.onResize&&this.helper.options.onResize()};fixPosition(){const{width:t,height:n,left:o,top:r,right:i,bottom:s}=Ie(this.container),a=this.helper.options;a&&(o<this.minLeft?(this.container.style.width=t+o-this.minLeft+"px",this.container.style.left=`${this.minLeft}px`):o>this.maxLeft?(this.container.style.width=`${a.minWidth}px`,this.container.style.left=`${this.maxLeft}px`):i<this.minRight?this.container.style.width=`${a.minWidth}px`:i>this.maxRight&&(this.container.style.width=this.maxRight-o+"px"),r<this.minTop?(this.container.style.height=n+r-this.minTop+"px",this.container.style.top=`${this.minTop}px`):r>this.maxTop?(this.container.style.height=`${a.minHeight}px`,this.container.style.top=`${this.maxTop}px`):s<this.minBottom?this.container.style.height=`${a.minHeight}px`:s>this.maxBottom&&(this.container.style.height=this.maxBottom-r+"px"))}mouseup=t=>{t.preventDefault(),t.stopPropagation(),this.helper.options&&this.helper.options.onResizeEnd&&this.helper.options.onResizeEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0};createHandleElement(){const t=document.createElement("div"),n=t.style;return n.position="absolute",this.applyStyle(n),this.container.appendChild(t),t}}function dr(e,t,n){return e<t?t:e>n?n:e}hr.push(class extends Mt{setPosition(e){this.container.style.width=this.width0+e.clientX-this.x0+"px",this.container.style.height=this.height0+e.clientY-this.y0+"px"}applyStyle(e){e.width=2*this.handleSize+"px",e.height=2*this.handleSize+"px",e.right=-this.handleSize+"px",e.bottom=-this.handleSize+"px",e.cursor="nwse-resize"}},class extends Mt{setPosition(e){this.container.style.height=this.height0+e.clientY-this.y0+"px"}applyStyle(e){e.right=`${this.handleSize}px`,e.left=`${this.handleSize}px`,e.height=2*this.handleSize+"px",e.bottom=-this.handleSize+"px",e.cursor="ns-resize"}},class extends Mt{setPosition(e){this.container.style.left=this.left0+e.clientX-this.x0+"px",this.container.style.width=this.width0-(e.clientX-this.x0)+"px",this.container.style.height=this.height0+e.clientY-this.y0+"px"}applyStyle(e){e.left=-this.handleSize+"px",e.bottom=-this.handleSize+"px",e.width=2*this.handleSize+"px",e.height=2*this.handleSize+"px",e.cursor="nesw-resize"}},class extends Mt{setPosition(e){this.container.style.left=this.left0+e.clientX-this.x0+"px",this.container.style.width=this.width0-(e.clientX-this.x0)+"px"}applyStyle(e){e.left=-this.handleSize+"px",e.bottom=`${this.handleSize}px`,e.width=2*this.handleSize+"px",e.top=`${this.handleSize}px`,e.cursor="ew-resize"}},class extends Mt{setPosition(e){this.container.style.left=this.left0+e.clientX-this.x0+"px",this.container.style.width=this.width0-(e.clientX-this.x0)+"px",this.container.style.top=this.top0+e.clientY-this.y0+"px",this.container.style.height=this.height0-(e.clientY-this.y0)+"px"}applyStyle(e){e.left=-this.handleSize+"px",e.top=-this.handleSize+"px",e.width=2*this.handleSize+"px",e.height=2*this.handleSize+"px",e.cursor="nwse-resize"}},class extends Mt{setPosition(e){this.container.style.top=this.top0+e.clientY-this.y0+"px",this.container.style.height=this.height0-(e.clientY-this.y0)+"px"}applyStyle(e){e.left=`${this.handleSize}px`,e.right=`${this.handleSize}px`,e.height=2*this.handleSize+"px",e.top=-this.handleSize+"px",e.cursor="ns-resize"}},class extends Mt{setPosition(e){this.container.style.top=this.top0+e.clientY-this.y0+"px",this.container.style.height=this.height0-(e.clientY-this.y0)+"px",this.container.style.width=this.width0+e.clientX-this.x0+"px"}applyStyle(e){e.right=-this.handleSize+"px",e.top=-this.handleSize+"px",e.height=2*this.handleSize+"px",e.width=2*this.handleSize+"px",e.cursor="nesw-resize"}},class extends Mt{setPosition(e){this.container.style.width=this.width0+e.clientX-this.x0+"px"}applyStyle(e){e.right=-this.handleSize+"px",e.top=`${this.handleSize}px`,e.bottom=`${this.handleSize}px`,e.width=2*this.handleSize+"px",e.cursor="ew-resize"}});var Te=Rt({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(e){const t=K(!1),n=K(!1);return{hover:t,active:n,style:function(){let o=e.windowStyle.button;return t.value&&(o={...o,...this.windowStyle.buttonHover}),n.value&&(o={...o,...this.windowStyle.buttonActive}),o},mouseup:function(o){this.active&&this.$emit("click")},mousedown:function(o){o.preventDefault(),n.value=!0;const r=pt.bindUp(document,()=>{n.value=!1,r()})}}}});const Ys=["disabled"];Te.render=function(e,t,n,o,r,i){return X(),gt("div",{class:"btn",style:vt(e.style()),onMouseenter:t[0]||(t[0]=s=>e.hover=!0),onMouseleave:t[1]||(t[1]=s=>e.hover=!1),onMousedown:t[2]||(t[2]=or((...s)=>e.mousedown&&e.mousedown(...s),["stop"])),onTouchstart:t[3]||(t[3]=or((...s)=>e.mousedown&&e.mousedown(...s),["stop"])),onMouseup:t[4]||(t[4]=(...s)=>e.mouseup&&e.mouseup(...s)),onTouchend:t[5]||(t[5]=(...s)=>e.mouseup&&e.mouseup(...s)),disabled:e.disabled},[ct(e.$slots,"default")],44,Ys)},Te.__scopeId="data-v-71662210",Te.__file="src/controls/vuewindow/window/Button.vue";const Zs=Object.prototype.toString;function dt(e,t){return Zs.call(e)===`[object ${t}]`}function Re(e){return dt(e,"Function")}const fr=e=>typeof e<"u",Mn=e=>!fr(e);function Pn(e){return e===null}function Qs(e){return Mn(e)&&Pn(e)}function ta(e){return Mn(e)||Pn(e)}const Lt=e=>e!=null&&e!==null&&dt(e,"Object");function ea(e){return dt(e,"Date")}function zn(e){return dt(e,"Number")}function na(e){return dt(e,"AsyncFunction")}function oa(e){return dt(e,"Promise")&&Lt(e)&&Re(e.then)&&Re(e.catch)}function Me(e){return dt(e,"String")}function ra(e){return e===!0||e===!1||dt(e,"Boolean")}function An(e){return e&&Array.isArray(e)}const ia=()=>typeof window<"u",sa=e=>typeof window<"u"&&dt(e,"Window"),aa=e=>Lt(e)&&!!e.tagName,ca=typeof window>"u";function la(e){return e&&["IMAGE","IMG"].includes(e.tagName)}function ua(e){return e==null||(Me(e)||An(e)?e.length===0:!!Lt(e)&&JSON.stringify(e)==="{}")}function ha(e){return dt(e,"Error")}function da(e){return dt(e,"WeakSet")}function fa(e){return dt(e,"WeakMap")}function pa(e){return dt(e,"Symbol")}function ga(e){return dt(e,"Map")}const ma=e=>/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/.test(e);var Gt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pr,gr={exports:{}},va=pr?gr.exports:(pr=1,gr.exports=function(e){var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(p,u){var v=p[0],y=p[1],d=p[2],f=p[3];y=((y+=((d=((d+=((f=((f+=((v=((v+=(y&d|~y&f)+u[0]-680876936|0)<<7|v>>>25)+y|0)&y|~v&d)+u[1]-389564586|0)<<12|f>>>20)+v|0)&v|~f&y)+u[2]+606105819|0)<<17|d>>>15)+f|0)&f|~d&v)+u[3]-1044525330|0)<<22|y>>>10)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y&d|~y&f)+u[4]-176418897|0)<<7|v>>>25)+y|0)&y|~v&d)+u[5]+1200080426|0)<<12|f>>>20)+v|0)&v|~f&y)+u[6]-1473231341|0)<<17|d>>>15)+f|0)&f|~d&v)+u[7]-45705983|0)<<22|y>>>10)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y&d|~y&f)+u[8]+1770035416|0)<<7|v>>>25)+y|0)&y|~v&d)+u[9]-1958414417|0)<<12|f>>>20)+v|0)&v|~f&y)+u[10]-42063|0)<<17|d>>>15)+f|0)&f|~d&v)+u[11]-1990404162|0)<<22|y>>>10)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y&d|~y&f)+u[12]+1804603682|0)<<7|v>>>25)+y|0)&y|~v&d)+u[13]-40341101|0)<<12|f>>>20)+v|0)&v|~f&y)+u[14]-1502002290|0)<<17|d>>>15)+f|0)&f|~d&v)+u[15]+1236535329|0)<<22|y>>>10)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y&f|d&~f)+u[1]-165796510|0)<<5|v>>>27)+y|0)&d|y&~d)+u[6]-1069501632|0)<<9|f>>>23)+v|0)&y|v&~y)+u[11]+643717713|0)<<14|d>>>18)+f|0)&v|f&~v)+u[0]-373897302|0)<<20|y>>>12)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y&f|d&~f)+u[5]-701558691|0)<<5|v>>>27)+y|0)&d|y&~d)+u[10]+38016083|0)<<9|f>>>23)+v|0)&y|v&~y)+u[15]-660478335|0)<<14|d>>>18)+f|0)&v|f&~v)+u[4]-405537848|0)<<20|y>>>12)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y&f|d&~f)+u[9]+568446438|0)<<5|v>>>27)+y|0)&d|y&~d)+u[14]-1019803690|0)<<9|f>>>23)+v|0)&y|v&~y)+u[3]-187363961|0)<<14|d>>>18)+f|0)&v|f&~v)+u[8]+1163531501|0)<<20|y>>>12)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y&f|d&~f)+u[13]-1444681467|0)<<5|v>>>27)+y|0)&d|y&~d)+u[2]-51403784|0)<<9|f>>>23)+v|0)&y|v&~y)+u[7]+1735328473|0)<<14|d>>>18)+f|0)&v|f&~v)+u[12]-1926607734|0)<<20|y>>>12)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y^d^f)+u[5]-378558|0)<<4|v>>>28)+y|0)^y^d)+u[8]-2022574463|0)<<11|f>>>21)+v|0)^v^y)+u[11]+1839030562|0)<<16|d>>>16)+f|0)^f^v)+u[14]-35309556|0)<<23|y>>>9)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y^d^f)+u[1]-1530992060|0)<<4|v>>>28)+y|0)^y^d)+u[4]+1272893353|0)<<11|f>>>21)+v|0)^v^y)+u[7]-155497632|0)<<16|d>>>16)+f|0)^f^v)+u[10]-1094730640|0)<<23|y>>>9)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y^d^f)+u[13]+681279174|0)<<4|v>>>28)+y|0)^y^d)+u[0]-358537222|0)<<11|f>>>21)+v|0)^v^y)+u[3]-722521979|0)<<16|d>>>16)+f|0)^f^v)+u[6]+76029189|0)<<23|y>>>9)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y^d^f)+u[9]-640364487|0)<<4|v>>>28)+y|0)^y^d)+u[12]-421815835|0)<<11|f>>>21)+v|0)^v^y)+u[15]+530742520|0)<<16|d>>>16)+f|0)^f^v)+u[2]-995338651|0)<<23|y>>>9)+d|0,y=((y+=((f=((f+=(y^((v=((v+=(d^(y|~f))+u[0]-198630844|0)<<6|v>>>26)+y|0)|~d))+u[7]+1126891415|0)<<10|f>>>22)+v|0)^((d=((d+=(v^(f|~y))+u[14]-1416354905|0)<<15|d>>>17)+f|0)|~v))+u[5]-57434055|0)<<21|y>>>11)+d|0,y=((y+=((f=((f+=(y^((v=((v+=(d^(y|~f))+u[12]+1700485571|0)<<6|v>>>26)+y|0)|~d))+u[3]-1894986606|0)<<10|f>>>22)+v|0)^((d=((d+=(v^(f|~y))+u[10]-1051523|0)<<15|d>>>17)+f|0)|~v))+u[1]-2054922799|0)<<21|y>>>11)+d|0,y=((y+=((f=((f+=(y^((v=((v+=(d^(y|~f))+u[8]+1873313359|0)<<6|v>>>26)+y|0)|~d))+u[15]-30611744|0)<<10|f>>>22)+v|0)^((d=((d+=(v^(f|~y))+u[6]-1560198380|0)<<15|d>>>17)+f|0)|~v))+u[13]+1309151649|0)<<21|y>>>11)+d|0,y=((y+=((f=((f+=(y^((v=((v+=(d^(y|~f))+u[4]-145523070|0)<<6|v>>>26)+y|0)|~d))+u[11]-1120210379|0)<<10|f>>>22)+v|0)^((d=((d+=(v^(f|~y))+u[2]+718787259|0)<<15|d>>>17)+f|0)|~v))+u[9]-343485551|0)<<21|y>>>11)+d|0,p[0]=v+p[0]|0,p[1]=y+p[1]|0,p[2]=d+p[2]|0,p[3]=f+p[3]|0}function o(p){var u,v=[];for(u=0;u<64;u+=4)v[u>>2]=p.charCodeAt(u)+(p.charCodeAt(u+1)<<8)+(p.charCodeAt(u+2)<<16)+(p.charCodeAt(u+3)<<24);return v}function r(p){var u,v=[];for(u=0;u<64;u+=4)v[u>>2]=p[u]+(p[u+1]<<8)+(p[u+2]<<16)+(p[u+3]<<24);return v}function i(p){var u,v,y,d,f,z,L=p.length,D=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=L;u+=64)n(D,o(p.substring(u-64,u)));for(v=(p=p.substring(u-64)).length,y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<v;u+=1)y[u>>2]|=p.charCodeAt(u)<<(u%4<<3);if(y[u>>2]|=128<<(u%4<<3),u>55)for(n(D,y),u=0;u<16;u+=1)y[u]=0;return d=(d=8*L).toString(16).match(/(.*?)(.{0,8})$/),f=parseInt(d[2],16),z=parseInt(d[1],16)||0,y[14]=f,y[15]=z,n(D,y),D}function s(p){var u,v,y,d,f,z,L=p.length,D=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=L;u+=64)n(D,r(p.subarray(u-64,u)));for(v=(p=u-64<L?p.subarray(u-64):new Uint8Array(0)).length,y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<v;u+=1)y[u>>2]|=p[u]<<(u%4<<3);if(y[u>>2]|=128<<(u%4<<3),u>55)for(n(D,y),u=0;u<16;u+=1)y[u]=0;return d=(d=8*L).toString(16).match(/(.*?)(.{0,8})$/),f=parseInt(d[2],16),z=parseInt(d[1],16)||0,y[14]=f,y[15]=z,n(D,y),D}function a(p){var u,v="";for(u=0;u<4;u+=1)v+=t[p>>8*u+4&15]+t[p>>8*u&15];return v}function l(p){var u;for(u=0;u<p.length;u+=1)p[u]=a(p[u]);return p.join("")}function h(p){return/[\u0080-\uFFFF]/.test(p)&&(p=unescape(encodeURIComponent(p))),p}function w(p,u){var v,y=p.length,d=new ArrayBuffer(y),f=new Uint8Array(d);for(v=0;v<y;v+=1)f[v]=p.charCodeAt(v);return u?f:d}function _(p){return String.fromCharCode.apply(null,new Uint8Array(p))}function k(p,u,v){var y=new Uint8Array(p.byteLength+u.byteLength);return y.set(new Uint8Array(p)),y.set(new Uint8Array(u),p.byteLength),v?y:y.buffer}function $(p){var u,v=[],y=p.length;for(u=0;u<y-1;u+=2)v.push(parseInt(p.substr(u,2),16));return String.fromCharCode.apply(String,v)}function I(){this.reset()}return l(i("hello")),typeof ArrayBuffer>"u"||ArrayBuffer.prototype.slice||function(){function p(u,v){return(u=0|u||0)<0?Math.max(u+v,0):Math.min(u,v)}ArrayBuffer.prototype.slice=function(u,v){var y,d,f,z,L=this.byteLength,D=p(u,L),M=L;return v!==e&&(M=p(v,L)),D>M?new ArrayBuffer(0):(y=M-D,d=new ArrayBuffer(y),f=new Uint8Array(d),z=new Uint8Array(this,D,y),f.set(z),d)}}(),I.prototype.append=function(p){return this.appendBinary(h(p)),this},I.prototype.appendBinary=function(p){this._buff+=p,this._length+=p.length;var u,v=this._buff.length;for(u=64;u<=v;u+=64)n(this._hash,o(this._buff.substring(u-64,u)));return this._buff=this._buff.substring(u-64),this},I.prototype.end=function(p){var u,v,y=this._buff,d=y.length,f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<d;u+=1)f[u>>2]|=y.charCodeAt(u)<<(u%4<<3);return this._finish(f,d),v=l(this._hash),p&&(v=$(v)),this.reset(),v},I.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},I.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},I.prototype.setState=function(p){return this._buff=p.buff,this._length=p.length,this._hash=p.hash,this},I.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},I.prototype._finish=function(p,u){var v,y,d,f=u;if(p[f>>2]|=128<<(f%4<<3),f>55)for(n(this._hash,p),f=0;f<16;f+=1)p[f]=0;v=(v=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),y=parseInt(v[2],16),d=parseInt(v[1],16)||0,p[14]=y,p[15]=d,n(this._hash,p)},I.hash=function(p,u){return I.hashBinary(h(p),u)},I.hashBinary=function(p,u){var v=l(i(p));return u?$(v):v},I.ArrayBuffer=function(){this.reset()},I.ArrayBuffer.prototype.append=function(p){var u,v=k(this._buff.buffer,p,!0),y=v.length;for(this._length+=p.byteLength,u=64;u<=y;u+=64)n(this._hash,r(v.subarray(u-64,u)));return this._buff=u-64<y?new Uint8Array(v.buffer.slice(u-64)):new Uint8Array(0),this},I.ArrayBuffer.prototype.end=function(p){var u,v,y=this._buff,d=y.length,f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<d;u+=1)f[u>>2]|=y[u]<<(u%4<<3);return this._finish(f,d),v=l(this._hash),p&&(v=$(v)),this.reset(),v},I.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},I.ArrayBuffer.prototype.getState=function(){var p=I.prototype.getState.call(this);return p.buff=_(p.buff),p},I.ArrayBuffer.prototype.setState=function(p){return p.buff=w(p.buff,!0),I.prototype.setState.call(this,p)},I.ArrayBuffer.prototype.destroy=I.prototype.destroy,I.ArrayBuffer.prototype._finish=I.prototype._finish,I.ArrayBuffer.hash=function(p,u){var v=l(s(new Uint8Array(p)));return u?$(v):v},I}()),Ln=Pe(va);const Dn=[];class ft{static addHandler(t,n,o){t.addEventListener?t.addEventListener(n,o,!1):t.attachEvent?t.attachEvent("on"+n,o):t["on"+n]=o}static removeHandler(t,n,o){t.removeEventListener?t.removeEventListener(n,o,!1):t.detachEvent?t.detachEvent("on"+n,o):delete t["on"+n]}static windowResizeHandler(t){ft.addHandler(window,"resize",t)}static offWindowResizeHandler(t){ft.removeHandler(window,"resize",t)}static fullscreenEnabled(){const t=window.document;return document.fullscreenEnabled||window.fullScreen||t.mozFullscreenEnabled||t.webkitIsFullScreen}static fullScreen(t,n){if(n){const o=window.document;let r=window.document.exitFullscreen||o.msExitFullscreen||o.mozCancelFullScreen||o.webkitCancelFullScreen;typeof r<"u"&&r?r.call(window.document):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("WScript.Shell")?.SendKeys("{F11}")}else{let o=t;o||(o=window.document.documentElement);let r=o.requestFullScreen||o.webkitRequestFullScreen||o.mozRequestFullScreen||o.msRequestFullScreen;typeof r<"u"&&r?r.call(o):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("WScript.Shell")?.SendKeys("{F11}")}}static requestFullScreen(t=window.document.documentElement){let n=t;var o=n.requestFullScreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullScreen;if(o)o.call(n);else if(typeof window.ActiveXObject<"u"){var r=new window.ActiveXObject("WScript.Shell");r!==null&&r.SendKeys("{F11}")}}static exitFullScreen(){const t=window.document;var n=document.exitFullscreen||t.mozCancelFullScreen||t.webkitExitFullscreen||t.webkitExitFullscreen;if(n)n.call(document);else if(typeof window.ActiveXObject<"u"){var o=new window.ActiveXObject("WScript.Shell");o!==null&&o.SendKeys("{F11}")}}static fullScreenElement(){return window.document.fullscreenElement||window.document.webkitFullscreenElement||window.document.mozFullscreenElement||window.document.msFullscreenElement}static isFullScreen(){return!!ft.fullScreenElement()}static onFullScreenChanged(t){let n;"onfullscreenchange"in window.document?n="fullscreenchange":"onwebkitfullscreenchange"in window.document?n="webkitfullscreenchange":"onmozfullscreenchange"in window.document&&(n="mozfullscreenchange"),n?document.addEventListener(n,function(){const o=ft.isFullScreen();t(o)}):document.addEventListener("MSFullscreenChange",function(){const o=ft.isFullScreen();t(o)})}static stringifyCircularHandler(t,n){if(typeof n=="object"&&n!==null){if(Dn.indexOf(n)!==-1)return;Dn.push(n)}return n}static jsonStringify(t){if(!t)return"";const n=JSON.stringify(t,ft.stringifyCircularHandler);return Dn.length=0,n}static jsonParse(t){const n=ft.jsonStringify(t);if(n.length>1)return JSON.parse(n)}static getObjectURL(t){let n;const o=window;return o.createObjcectURL!=null?n=o.createOjcectURL(t):window.URL!=null?n=window.URL.createObjectURL(t):window.webkitURL!=null&&(n=window.webkitURL.createObjectURL(t)),n}static getFileShortMD5(t,n){const o=File.prototype,r=o.slice||o.mozSlice||o.webkitSlice,i=t,s=2097152,a=new Ln.ArrayBuffer,l=new FileReader;l.onload=function(h){a.append(h.target?.result);const w=a.end();n({isOK:!0,data:w})},l.onerror=function(){const h="\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01";console.warn(h),n({isOK:!1,data:h})},function(){const h=0+s>=i.size?i.size:0+s;l.readAsArrayBuffer(r.call(i,0,h))}()}static getFileMD5(t,n){const o=File.prototype,r=o.slice||o.mozSlice||o.webkitSlice,i=t,s=2097152,a=Math.ceil(i.size/s);let l=0;const h=new Ln.ArrayBuffer,w=new FileReader;function _(){const k=l*s,$=k+s>=i.size?i.size:k+s;w.readAsArrayBuffer(r.call(i,k,$))}w.onload=function(k){if(h.append(k.target?.result),l++,l<a)_();else{const $=h.end();n({isOK:!0,data:$})}},w.onerror=function(){const k=`${i.name}:\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01`;console.warn(k),n({isOK:!1,data:k})},_()}static MD5(t,n=!1){return Ln.hash(t,n)}static copyTextByCommand(t){return new Promise((n,o)=>{const r=document.createElement("input");r.value=t,document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove(),n(!0)})}static copyText=t=>navigator.clipboard?navigator.clipboard.writeText(t).then(function(){return!0},function(n){return!1}):ft.copyTextByCommand(t);static copyElementTextByCommand(t){const n=document.createRange();n.selectNode(document.getElementById(t));const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges(),o.addRange(n);try{return document.execCommand("copy"),o.removeRange(n),!0}catch(r){return o.removeRange(n),console.error("Command\u590D\u5236\u6587\u672C\u9519\u8BEF",r),!1}}static copyElementText(t){if(!navigator.clipboard)return ft.copyElementTextByCommand(t);const n=document.createRange();n.selectNode(document.getElementById(t));const o=window.getSelection();return o.rangeCount>0&&o.removeAllRanges(),o.addRange(n),navigator.clipboard.writeText(o).then(function(){return o.removeRange(n),!0},function(r){return o.removeRange(n),console.error("Clipboard\u590D\u5236\u6587\u672C\u9519\u8BEF",r),!1})}static setGrayMode(t){ft.toggleClass(t,"grayMode",document.documentElement)}static toggleClass(t,n,o){const r=o||document.body;let{className:i}=r;i=i.replace(n,""),r.className=t?`${i} ${n} `:i}static setCssVar(t,n,o=document.documentElement){o.style.setProperty(t,n)}static dispatchWindowResize(){const t=new Event("resize");window.dispatchEvent(t)}static dispatchElementEvent(t,n="click",o){let r;if(r=Me(t)?document.getElementById(t):t,r){const i=new Event(n,{bubbles:!0,cancelable:!0});o&&r.addEventListener("ev",s=>{o(s)},!1),r.dispatchEvent(i)}}static getRandomNum(t,n){var o=n-t,r=Math.random();return t+Math.round(r*o)}static merge(t={},n={}){let o,r,i,s;for(t||(t={}),r=0,i=n.length;r<i;r++)for(o in s=n[r],s)t[o]=s[o];return t}static setOptions(t,n){t.hasOwnProperty("options")||(t.options=t.options?Object.create(t.options):{});for(let o in n)t.options[o]=n[o];return t.options}static formatNum(t,n){let o=Math.pow(10,n===void 0?6:n);return Math.round(t*o)/o}static trim(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}static splitWords(t){return this.trim(t).split(/\s+/)}static emptyImageUrl(){return"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="}static debounce(t,n){let o=null;return function(){o&&clearTimeout(o),o=setTimeout(t,n)}}static throttle(t,n){let o=!0;return function(){if(!o)return!1;o=!1,setTimeout(()=>{t(),o=!0},n)}}static dataURLtoBlob(t){let n=t.split(",");if(!n||n.length===0)return;let o=n[0].match(/:(.*?);/)[1],r=atob(n[1]),i=r.length,s=new Uint8Array(i);for(;i--;)s[i]=r.charCodeAt(i);return new Blob([s],{type:o})}static getElement(t){return typeof t=="string"?document.getElementById(t):t}static getStyle(t,n){let o=t.style[n]||t.currentStyle&&t.currentStyle[n];if((!o||o==="auto")&&document.defaultView){let r=document.defaultView.getComputedStyle(t,null);o=r?r[n]:null}return o==="auto"?null:o}static create(t,n,o){let r=document.createElement(t);return r.className=n||"",o&&o.appendChild(r),r}static removeElement(t){let n=t.parentNode;n&&n.removeChild(t)}static emptyElement(t){for(;t.firstChild;)t.removeChild(t.firstChild)}static hasClass(t,n){if(t.classList!==void 0)return t.classList.contains(n);let o=this.getClass(t);return o.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(o)}static addClass(t,n){if(t.classList!==void 0){let o=this.splitWords(n);for(let r=0,i=o.length;r<i;r++)t.classList.add(o[r])}else if(!this.hasClass(t,n)){let o=this.getClass(t);this.setClass(t,(o?o+" ":"")+n)}}static removeClass(t,n){t.classList!==void 0?t.classList.remove(n):this.setClass(t,this.trim((" "+this.getClass(t)+" ").replace(" "+n+" "," ")))}static setClass(t,n){t.className.baseVal===void 0?t.className=n:t.className.baseVal=n}static getClass(t){return t.correspondingElement&&(t=t.correspondingElement),t.className.baseVal===void 0?t.className:t.className.baseVal}static createSvgElement(t,n,o,r){let i=document.createElementNS("http://www.w3.org/2000/svg","svg:svg");i.setAttribute("class","svg-path"),i.setAttribute("width",t),i.setAttribute("height",n),i.setAttribute("viewBox",`0 0 ${t} ${n}`);let s=document.createElementNS("http://www.w3.org/2000/svg","path");return s.setAttribute("d",o),i.appendChild(s),r&&r.appendChild(i),i}static parseDom(t,n=!0,o=""){n=n??!1;let r=document.createElement("div");return r.className=o||"",r.innerHTML=t,n?r:r.childNodes}static createVideoHTML(t,n,o){let r=this.create("video",n,o),i=this.create("source","",r);i.setAttribute("src",t),i.setAttribute("type","video/map4");let s=this.create("source","",r);return s.setAttribute("src",t),s.setAttribute("type","video/quicktime"),r}}class ze{static isNullOrEmpty=t=>t===null||t===""||t===void 0||t.length===0;static isNotEmpty=t=>!(t===null||t===""||t===void 0||t.length===0);static toHump(t){return t.replace(/[\-\/\_](\w)/g,(n,o)=>o.toUpperCase()).replace("views","")}}class Ae{prefixKey;storage;constructor(t="",n=localStorage){this.prefixKey=t,this.storage=n}getKey(t){return`${this.prefixKey}${t}`.toUpperCase()}set(t,n,o=604800){const r=JSON.stringify({value:n,expire:o!==null?new Date().getTime()+1e3*o:null});this.storage.setItem(this.getKey(t),r)}get(t,n=null){const o=this.storage.getItem(this.getKey(t));if(o)try{const r=JSON.parse(o),{value:i,expire:s}=r;if(s===null||s>=Date.now())return i;this.remove(this.getKey(t))}catch{return n}return n}getJsonObject(t){const n=this.storage.getItem(this.getKey(t));if(n)try{const o=JSON.parse(n);if(o.expire===null||o.expire>=Date.now())return o;this.remove(this.getKey(t))}catch{return}}remove(t){this.storage.removeItem(this.getKey(t))}clear(){this.storage.clear()}setCookie(t,n,o=604800){document.cookie=`${this.getKey(t)}=${n}; Max-Age=${o}`}getCookie(t){const n=document.cookie.split("; ");for(let o=0,r=n.length;o<r;o++){const i=n[o].split("=");if(i[0]===this.getKey(t))return i[1]}return""}removeCookie(t){this.setCookie(t,1,-1)}clearCookie(){const t=document.cookie.match(/[^ =;]+(?==)/g);if(t)for(let n=t.length;n--;)document.cookie=t[n]+"=0;expire="+new Date(0).toUTCString()}}const ya=new Ae("",localStorage);function mr(){let e=[];const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(var n=0;n<36;n++){const r=Math.floor(16*Math.random());e[n]=t.substring(r,r+1)}e[14]="4";const o=3&Number(e[19])|8;return e[19]=t.substring(o,o+1),e[8]=e[13]=e[18]=e[23]="-",e.join("")}function wa(){var e=new Date().getTime(),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var o=(e+16*Math.random())%16|0;return e=Math.floor(e/16),(n==="x"?o:3&o|8).toString(16)});return t}function ba(e){const t=e.toLowerCase().replace(/rgb?a?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),n=parseFloat(t[3]||"1"),o=Math.floor(n*parseInt(t[0])+255*(1-n)),r=Math.floor(n*parseInt(t[1])+255*(1-n)),i=Math.floor(n*parseInt(t[2])+255*(1-n));return"#"+("0"+o.toString(16)).slice(-2)+("0"+r.toString(16)).slice(-2)+("0"+i.toString(16)).slice(-2)}function _a(e){var t=e.toLowerCase();if(Le(e)){if(t.length===4){for(var n="#",o=1;o<4;o+=1){const i=t.slice(o,o+1);n+=i.concat(i)}t=n}var r=[];for(o=1;o<7;o+=2)r.push(parseInt("0x"+t.slice(o,o+2)));return"rgb("+r.join(",")+")"}return t}function Sa(e){const t=e;if(t.length===4){let o="#";for(var n=1;n<4;n+=1){const r=t.slice(n,n+1);o+=r.concat(r)}return o}return t}var Dt;function Ca(e){if(typeof e=="object"||!e)return;const t=e.toLowerCase().substring(0,1);return t==="#"?Dt.Hex:t==="r"||t==="("?Dt.RGBA:t==="h"?Dt.Hsla:Dt.RGBA}function Ea(e){if(e){var t=e.toLowerCase().match(/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i);if(t){var n,o,r,i=(parseFloat(t[1])%360+360)%360/360,s=parseFloat(t[2])/(/%$/.test(t[2])?100:1),a=parseFloat(t[3])/(/%$/.test(t[3])?100:1);if(s===0)n=o=r=a;else{var l=a<=.5?a*(s+1):a+s-a*s,h=2*a-l;n=$n(h,l,i+1/3),o=$n(h,l,i),r=$n(h,l,i-1/3)}return`rgba(${n=Math.round(255*n)},${o=Math.round(255*o)},${r=Math.round(255*r)},${t[4]?parseFloat(t[4]):1})`}}}function $n(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Le(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/.test(e)}function xa(e,t,n){const o=(e<<16|t<<8|n).toString(16);return"#"+new Array(Math.abs(o.length-7)).join("0")+o}function Nn(e){let t=e.toLowerCase();if(Le(e)){if(t.length===4){let o="#";for(let r=1;r<4;r+=1)o+=t.slice(r,r+1).concat(t.slice(r,r+1));t=o}const n=[];for(let o=1;o<7;o+=2)n.push(parseInt("0x"+t.slice(o,o+2)));return"RGB("+n.join(",")+")"}return t}function ka(e){if(!Le(e))return;const[t,n,o]=Nn(e).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(r=>Number(r));return .299*t+.578*n+.114*o<192}function Ia(e,t){return e=e.indexOf("#")>=0?e.substring(1,e.length):e,t=Math.trunc(255*t/100),`#${jn(e.substring(0,2),t)}${jn(e.substring(2,4),t)}${jn(e.substring(4,6),t)}`}function Ta(e,t){return e=e.indexOf("#")>=0?e.substring(1,e.length):e,t=Math.trunc(255*t/100),`#${Bn(e.substring(0,2),t)}${Bn(e.substring(2,4),t)}${Bn(e.substring(4,6),t)}`}function Bn(e,t){const n=parseInt(e,16)+t,o=n>255?255:n;return o.toString(16).length>1?o.toString(16):`0${o.toString(16)}`}function vr(e,t,n){const o=[e,t,n].map(r=>(r/=255)<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4));return .2126*o[0]+.7152*o[1]+.0722*o[2]}function Ra(e){return function(t,n){return(vr(~~t[0],~~t[1],~~t[2])+.05)/(vr(n[0],n[1],n[2])+.05)}(Nn(e.substring(1)).split(","),[0,0,0])>=12?"#000000":"#FFFFFF"}function jn(e,t){const n=parseInt(e,16)-t,o=n<0?0:n;return o.toString(16).length>1?o.toString(16):`0${o.toString(16)}`}function On(e){return{all:e=e||new Map,on(t,n){const o=e?.get(t);o&&o.push(n)||e?.set(t,[n])},off(t,n){const o=e?.get(t);o&&o.splice(o.indexOf(n)>>>0,1)},emit(t,n){(e?.get(t)||[]).slice().map(o=>{o(n)}),(e?.get("*")||[]).slice().map(o=>{o(t,n)})}}}(function(e){e[e.RGBA=0]="RGBA",e[e.Hex=1]="Hex",e[e.Hsla=2]="Hsla"})(Dt||(Dt={}));const $t=On(),lt={HproseServiceErrorEvent:"HproseServiceError",WebAPIErrorEvent:"WebAPIError",AlertInfoEvent:"AlertInfoEvent",CommonWarnEvent:"CommonWarnEvent",WidgetLoadedEvent:"WidgetLoaded",WidgetLoaded:"WidgetLoaded",WidgetUnLoadedEvent:"WidgetUnLoaded",WidgetLoadedErrorEvent:"WidgetLoadedError",WidgetVisibleChanged:"WidgetVisibleChanged",AxiosRequestErrorEvent:"AxiosRequestErrorEvent",LayoutContainerLoaded:"LayoutContainerLoaded"},De=(e,t)=>{const n=document.createElement("a");n.download=t,n.style.display="none";const o=new Blob([e],{type:"application/octet-stream"});n.href=URL.createObjectURL(o),document.body.appendChild(n),n.click(),document.body.removeChild(n)};function Ma(e,t){const n=window.URL||window.webkitURL||window,o=new Blob([e]),r=document.createElement("a");r.href=n.createObjectURL(o),r.download=t,r.click(),n.revokeObjectURL(r.href)}const yr=(e,t)=>{const n=JSON.stringify(e,null,2);t?De(n,t+".json"):$t.emit(lt.CommonWarnEvent,"\u53C2\u6570JsonID\u4E0D\u80FD\u4E3A\u7A7A\uFF01")},Pa=(e,t,n)=>{e.get(t,{responseType:"blob"}).then(function(o){De(o.data,n)}).catch(o=>{console.warn(o),$t.emit(lt.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})};function wr(e){const t=e.lastIndexOf("/")+1;let n=e.substring(t);return n=decodeURI(n.split("?")[0]),n}function za({url:e,target:t="_blank",fileName:n}){const o=new URL(e).host==location.host;return new Promise((r,i)=>{if(o){const s=document.createElement("a");if(s.href=e,s.target=t,s.download!==void 0&&(s.download=n||wr(e)),document.createEvent){const a=document.createEvent("MouseEvents");return a.initEvent("click",!0,!0),s.dispatchEvent(a),r(!0)}return e.indexOf("?")===-1&&(e+="?download"),window.open(e,t),r(!0)}{const s=document.createElement("canvas"),a=document.createElement("img");a.setAttribute("crossOrigin","Anonymous"),a.src=e,a.onload=l=>{s.width=a.width,s.height=a.height,s.getContext("2d").drawImage(a,0,0,a.width,a.height),s.toBlob(h=>{if(h){const w=document.createElement("a");w.href=window.URL.createObjectURL(h),w.download=wr(e),w.click(),URL.revokeObjectURL(w.href),r(!0)}},"image/jpeg")},a.onerror=l=>i(l)}})}function Aa(e){const t=new Date().getTime();let n=new Date().getTime();for(;n-t<e;)n=new Date().getTime();console.log(`\u5F3A\u5236\u7B49\u5F85${br}\u6BEB\u79D2`)}function br(e){return new Promise(t=>setTimeout(t,e))}var _r,Wn={exports:{}},Sr,Cr,Un,Fn=(_r||(_r=1,Cr=Wn.exports,Un=function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),o=["trace","debug","info","warn","error"],r={},i=null;function s(I,p){var u=I[p];if(typeof u.bind=="function")return u.bind(I);try{return Function.prototype.bind.call(u,I)}catch{return function(){return Function.prototype.apply.apply(u,[I,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function l(I){return I==="debug"&&(I="log"),typeof console!==t&&(I==="trace"&&n?a:console[I]!==void 0?s(console,I):console.log!==void 0?s(console,"log"):e)}function h(){for(var I=this.getLevel(),p=0;p<o.length;p++){var u=o[p];this[u]=p<I?e:this.methodFactory(u,I,this.name)}if(this.log=this.debug,typeof console===t&&I<this.levels.SILENT)return"No console available for logging"}function w(I){return function(){typeof console!==t&&(h.call(this),this[I].apply(this,arguments))}}function _(I,p,u){return l(I)||w.apply(this,arguments)}function k(I,p){var u,v,y,d=this,f="loglevel";function z(){var M;if(typeof window!==t&&f){try{M=window.localStorage[f]}catch{}if(typeof M===t)try{var N=window.document.cookie,O=encodeURIComponent(f),T=N.indexOf(O+"=");T!==-1&&(M=/^([^;]+)/.exec(N.slice(T+O.length+1))[1])}catch{}return d.levels[M]===void 0&&(M=void 0),M}}function L(M){var N=M;if(typeof N=="string"&&d.levels[N.toUpperCase()]!==void 0&&(N=d.levels[N.toUpperCase()]),typeof N=="number"&&N>=0&&N<=d.levels.SILENT)return N;throw new TypeError("log.setLevel() called with invalid level: "+M)}typeof I=="string"?f+=":"+I:typeof I=="symbol"&&(f=void 0),d.name=I,d.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},d.methodFactory=p||_,d.getLevel=function(){return y??v??u},d.setLevel=function(M,N){return y=L(M),N!==!1&&function(O){var T=(o[O]||"silent").toUpperCase();if(typeof window!==t&&f){try{return void(window.localStorage[f]=T)}catch{}try{window.document.cookie=encodeURIComponent(f)+"="+T+";"}catch{}}}(y),h.call(d)},d.setDefaultLevel=function(M){v=L(M),z()||d.setLevel(M,!1)},d.resetLevel=function(){y=null,function(){if(typeof window!==t&&f){try{window.localStorage.removeItem(f)}catch{}try{window.document.cookie=encodeURIComponent(f)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}(),h.call(d)},d.enableAll=function(M){d.setLevel(d.levels.TRACE,M)},d.disableAll=function(M){d.setLevel(d.levels.SILENT,M)},d.rebuild=function(){if(i!==d&&(u=L(i.getLevel())),h.call(d),i===d)for(var M in r)r[M].rebuild()},u=L(i?i.getLevel():"WARN");var D=z();D!=null&&(y=L(D)),h.call(d)}(i=new k).getLogger=function(I){if(typeof I!="symbol"&&typeof I!="string"||I==="")throw new TypeError("You must supply a name when creating a logger.");var p=r[I];return p||(p=r[I]=new k(I,i.methodFactory)),p};var $=typeof window!==t?window.log:void 0;return i.noConflict=function(){return typeof window!==t&&window.log===i&&(window.log=$),i},i.getLoggers=function(){return r},i.default=i,i},(Sr=Wn).exports?Sr.exports=Un():Cr.log=Un()),Wn.exports);class Er{message;eventBus;constructor(t,n){t&&(this.message=t),n&&(this.eventBus=n)}msg(t,n=3,o="success"){if(this.message)if(typeof this.message=="function")this.message({type:o,message:t,duration:n});else switch(o){case"info":this.message.info(t,n);break;case"success":this.message.success(t,n);break;case"warning":this.message.warn?this.message.warn(t,n):this.message.warning&&this.message.warning(t,n);break;case"error":this.message.error(t,n)}else{switch(o){case"info":case"success":console.log(t);break;case"warning":console.warn(t);break;case"error":o="dark",console.error(t)}this.eventBus&&this.eventBus.emit(lt.AlertInfoEvent,{type:o,info:t})}}info(t,n=3){this.msg(t,n,"info")}warn(t,n=3){this.msg(t,n,"warning")}err(t,n=3){this.msg(t,n,"error")}success(t,n=3){this.msg(t,n,"success")}}let xr=!1;const j={Config:SysConfig,EventBus:$t,DefaultProxyClient:null,Axios:Ws,Message:new Er(void 0,$t),LayoutMap:new Map,getLayoutManager:e=>{if(!j.WidgetConfigList||j.WidgetConfigList.length===0)return;const t=j.WidgetConfigList.find(n=>n.id===e);if(t){const n=t.layoutID;if(n&&j.LayoutMap.has(n))return j.LayoutMap.get(n)}},Logger:e=>{xr||(import.meta.env?.DEV||SysConfig.UI.ProductLog?Fn.enableAll():Fn.setDefaultLevel("warn"),xr=!0);const t=e||"default";return Fn.getLogger(t)}},kr="access_token",kt=new Ae("user",localStorage);function Nt(){return kt.get(kr)}function Hn(){kt.remove(kr)}function Ir(){return Nt()?.refresh}function qn(e,t,n,o="json",r){const i={baseURL:j.Config.ServiceURL.DefaultWebAPI,timeout:6e4,params:e,paramsSerializer:{serialize:function(s){return Us.stringify(s,{indices:!1,arrayFormat:"repeat"})}},headers:{"Content-Type":"application/json",Authorization:"bearer "+Nt()?.token},responseType:o,cancelToken:r};if(n)for(let s in n)i.headers[s]=n[s];return j.SystemID&&(i.headers.sysid=j.SystemID,j.SystemGroup&&(i.headers.sysgroup=j.SystemGroup)),t&&(i.baseURL=t),i}function It(e,t,n,o,r="json",i,s){const a=qn(n,t,o,r,i);return s&&s>=2e4&&(a.timeout=s),j.Axios?.get(e,a).catch(function(l){$e(l,t,e,"Get")})}function $e(e,t,n,o="Get"){const r=`${t}${n}`;if(e&&e.response){let i=!1;const s=e.response.status;switch(s){case 400:e.message="\u9519\u8BEF\u8BF7\u6C42";break;case 401:e.message="\u672A\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55";break;case 403:e.message="\u62D2\u7EDD\u8BBF\u95EE";break;case 404:e.message="\u8BF7\u6C42\u9519\u8BEF,\u672A\u627E\u5230\u8BE5\u8D44\u6E90";break;case 405:e.message="\u8BF7\u6C42\u65B9\u6CD5\u672A\u5141\u8BB8";break;case 408:e.message="\u8BF7\u6C42\u8D85\u65F6";break;case 500:const l=e.response.data;if(l){const h=l.indexOf(":"),w=l.indexOf(`
2
- `);if(h>0&&w-h>2){const _=l.substring(h+2,w);_.indexOf("System.Exception")>0?e.message="\u540E\u53F0\u670D\u52A1\u5185\u90E8\u51FA\u9519\uFF01":(i=!0,e.message=_)}else i=!0,e.message=l}else e.message="\u670D\u52A1\u5668\u7AEF\u51FA\u9519";break;case 501:e.message="\u7F51\u7EDC\u672A\u5B9E\u73B0";break;case 502:e.message="\u7F51\u7EDC\u9519\u8BEF";break;case 503:e.message="\u670D\u52A1\u4E0D\u53EF\u7528";break;case 504:e.message="\u7F51\u7EDC\u8D85\u65F6";break;case 505:e.message="http\u7248\u672C\u4E0D\u652F\u6301\u8BE5\u8BF7\u6C42";break;default:e.message=`\u8FDE\u63A5\u9519\u8BEF${e.response.status}`}let a={address:r,code:s,isExceptionInfo:i,message:e.message,result:e.response.data};if(j.EventBus.emit(lt.AxiosRequestErrorEvent,a),i)throw new Error(e.message)}else{if(e?.message)throw new Error(e.message);console.error(e,"Http\u8BF7\u6C42\u9519\u8BEF!")}}function Tr(e,t,n,o,r,i="json",s){const a=qn(o,t,r,i);s&&s>=2e4&&(a.timeout=s),a.headers["Content-Type"]="multipart/form-data";const l=function(h){let w=new FormData;return h&&Object.keys(h).forEach(_=>{if(!h)return;let k=h[_];k!=null&&(An(k)?k.forEach($=>{w.append(_,Mr($))}):w.append(_,Mr(k)))}),w}(n);return j.Axios?.post(e,l,a).catch(function(h){$e(h,t,e,"Post")})}function Rr(e,t,n,o,r,i="json",s){const a=qn(o,t,r,i);return s&&s>=2e4&&(a.timeout=s),j.Axios?.post(e,n,a).catch(function(l){$e(l,t,e,"Post")})}function La(e,t){return It(e,void 0,t)}function Da(e,t){return Tr(e,void 0,t)}function $a(e,t){return j.Axios?.get(e,{params:t}).catch(function(n){$e(n,e,"","\u5916\u90E8Get")})}function Mr(e){return e instanceof Blob?e:e.toString()}var Pr,zr,Xn,Ar,Vn,Lr,Gn,Dr,$r,Ne={exports:{}};function Na(){return zr?Pr:(zr=1,e=typeof window<"u"?window:Gt!==void 0?Gt:typeof self<"u"?self:{},Pr=e);var e}function Ba(){if(Ar)return Xn;Ar=1,Xn=function(t){if(!t)return!1;var n=e.call(t);return n==="[object Function]"||typeof t=="function"&&n!=="[object RegExp]"||typeof window<"u"&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)};var e=Object.prototype.toString;return Xn}function ja(){if(Lr)return Vn;Lr=1;var e=function(t){return t.replace(/^\s+|\s+$/g,"")};return Vn=function(t){if(!t)return{};for(var n,o={},r=e(t).split(`
3
- `),i=0;i<r.length;i++){var s=r[i],a=s.indexOf(":"),l=e(s.slice(0,a)).toLowerCase(),h=e(s.slice(a+1));o[l]===void 0?o[l]=h:(n=o[l],Object.prototype.toString.call(n)==="[object Array]"?o[l].push(h):o[l]=[o[l],h])}return o},Vn}var Oa=function(){if($r)return Ne.exports;$r=1;var e=Na(),t=Ba(),n=ja(),o=function(){if(Dr)return Gn;Dr=1,Gn=function(){for(var l={},h=0;h<arguments.length;h++){var w=arguments[h];for(var _ in w)a.call(w,_)&&(l[_]=w[_])}return l};var a=Object.prototype.hasOwnProperty;return Gn}();function r(a,l,h){var w=a;return t(l)?(h=l,typeof a=="string"&&(w={uri:a})):w=o(l,{uri:a}),w.callback=h,w}function i(a,l,h){return s(l=r(a,l,h))}function s(a){if(a.callback===void 0)throw new Error("callback argument missing");var l=!1,h=function(M,N,O){l||(l=!0,a.callback(M,N,O))};function w(){var M=void 0;if(M=p.response?p.response:p.responseText||function(N){try{if(N.responseType==="document")return N.responseXML;var O=N.responseXML&&N.responseXML.documentElement.nodeName==="parsererror";if(N.responseType===""&&!O)return N.responseXML}catch{}return null}(p),L)try{M=JSON.parse(M)}catch{}return M}function _(M){return clearTimeout(u),M instanceof Error||(M=new Error(""+(M||"Unknown XMLHttpRequest Error"))),M.statusCode=0,h(M,D)}function k(){if(!I){var M;clearTimeout(u),M=a.useXDR&&p.status===void 0?200:p.status===1223?204:p.status;var N=D,O=null;return M!==0?(N={body:w(),statusCode:M,method:y,headers:{},url:v,rawRequest:p},p.getAllResponseHeaders&&(N.headers=n(p.getAllResponseHeaders()))):O=new Error("Internal XMLHttpRequest Error"),h(O,N,N.body)}}var $,I,p=a.xhr||null;p||(p=a.cors||a.useXDR?new i.XDomainRequest:new i.XMLHttpRequest);var u,v=p.url=a.uri||a.url,y=p.method=a.method||"GET",d=a.body||a.data,f=p.headers=a.headers||{},z=!!a.sync,L=!1,D={body:void 0,headers:{},statusCode:0,method:y,url:v,rawRequest:p};if("json"in a&&a.json!==!1&&(L=!0,f.accept||f.Accept||(f.Accept="application/json"),y!=="GET"&&y!=="HEAD"&&(f["content-type"]||f["Content-Type"]||(f["Content-Type"]="application/json"),d=JSON.stringify(a.json===!0?d:a.json))),p.onreadystatechange=function(){p.readyState===4&&setTimeout(k,0)},p.onload=k,p.onerror=_,p.onprogress=function(){},p.onabort=function(){I=!0},p.ontimeout=_,p.open(y,v,!z,a.username,a.password),z||(p.withCredentials=!!a.withCredentials),!z&&a.timeout>0&&(u=setTimeout(function(){if(!I){I=!0,p.abort("timeout");var M=new Error("XMLHttpRequest timeout");M.code="ETIMEDOUT",_(M)}},a.timeout)),p.setRequestHeader)for($ in f)f.hasOwnProperty($)&&p.setRequestHeader($,f[$]);else if(a.headers&&!function(M){for(var N in M)if(M.hasOwnProperty(N))return!1;return!0}(a.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in a&&(p.responseType=a.responseType),"beforeSend"in a&&typeof a.beforeSend=="function"&&a.beforeSend(p),p.send(d||null),p}return Ne.exports=i,Ne.exports.default=i,i.XMLHttpRequest=e.XMLHttpRequest||function(){},i.XDomainRequest="withCredentials"in new i.XMLHttpRequest?i.XMLHttpRequest:e.XDomainRequest,function(a,l){for(var h=0;h<a.length;h++)l(a[h])}(["get","put","post","patch","head","delete"],function(a){i[a==="delete"?"del":a]=function(l,h,w){return(h=r(l,h,w)).method=a.toUpperCase(),s(h)}}),Ne.exports}(),Wa=Pe(Oa);const Ua=[200,201,202,204,308],Fa=[408,502,503,504];class Nr{endpoint;file;headers;method;chunkSize;attempts;delayBeforeAttempt;md5;chunk;chunkCount;chunkByteSize;maxFileBytes;endpointValue;totalChunks;attemptCount;offline;paused;success;currentXhr;reader;eventTarget;fileName;constructor(t){this.endpoint=t.endpoint,this.file=t.file,this.fileName=encodeURI(this.file.name),this.headers=t.headers||{},this.method=t.method||"PUT",this.chunkSize=t.chunkSize||5120,this.attempts=t.attempts||5,this.delayBeforeAttempt=t.delayBeforeAttempt||1,this.md5=t.md5||"",this.maxFileBytes=1024*(t.maxFileSize||0),this.chunkCount=0,this.chunkByteSize=1024*this.chunkSize,this.totalChunks=Math.ceil(this.file.size/this.chunkByteSize),this.attemptCount=0,this.offline=!1,this.paused=!1,this.success=!1,this.reader=new FileReader,this.eventTarget=On(),this.validateOptions(),this.getEndpoint().then(()=>this.sendChunks()),typeof window<"u"&&(window.addEventListener("online",()=>{this.offline&&(this.offline=!1,this.dispatch("online"),this.sendChunks())}),window.addEventListener("offline",()=>{this.offline=!0,this.dispatch("offline")}))}on(t,n){this.eventTarget.on(t,n)}abort(){this.pause(),this.currentXhr?.abort()}pause(){this.paused=!0}resume(){this.paused&&(this.paused=!1,this.sendChunks())}dispatch(t,n){this.eventTarget.emit(t,n)}validateOptions(){if(!this.endpoint||typeof this.endpoint!="function"&&typeof this.endpoint!="string")throw new TypeError("endpoint\u5FC5\u987B\u4E3A\uFF1A\u6587\u4EF6\u4E0A\u4F20URL\u5B57\u7B26\u4E32\uFF0C\u6216\u8FD4\u56DE\u5730\u5740\u7684\u51FD\u6570\uFF01");if(!(this.file instanceof File))throw new TypeError("file\u5FC5\u987B\u4E3A\u6587\u4EF6\u5BF9\u8C61");if(this.headers&&typeof this.headers!="object")throw new TypeError("\u6587\u4EF6\u5934\u5FC5\u987B\u4E3A\u5BF9\u8C61\u6216\u7A7A\uFF01");if(this.chunkSize&&(typeof this.chunkSize!="number"||this.chunkSize<=0||this.chunkSize%256!=0))throw new TypeError("chunkSize\u5FC5\u987B\u5927\u4E8E0,\u5E76\u662F256\u7684\u6574\u6570\u500D");if(this.maxFileBytes>0&&this.maxFileBytes<this.file.size)throw new Error(`\u6587\u4EF6\u5927\u5C0F\u8D85\u8FC7\u6700\u5927\u5141\u8BB8\u503C\uFF1A(${this.file.size} > ${this.maxFileBytes})`);if(this.attempts&&(typeof this.attempts!="number"||this.attempts<=0))throw new TypeError("\u91CD\u8BD5\u6B21\u6570\u5FC5\u987B\u4E3A\u6B63\u6570\uFF01");if(this.delayBeforeAttempt&&(typeof this.delayBeforeAttempt!="number"||this.delayBeforeAttempt<0))throw new TypeError("\u5EF6\u65F6\u91CD\u8BD5\u65F6\u95F4\u5FC5\u987B\u4E3A\u6B63\u6570\uFF01\u9ED8\u8BA4\u4E3A1")}getEndpoint(){return typeof this.endpoint=="string"?(this.endpointValue=this.endpoint,Promise.resolve(this.endpoint)):this.endpoint(this.file).then(t=>(this.endpointValue=t,this.endpointValue))}getChunk(){return new Promise(t=>{const n=this.totalChunks===1?this.file.size:this.chunkByteSize,o=n*this.chunkCount;this.reader.onload=()=>{this.reader.result!==null&&(this.chunk=new Blob([this.reader.result],{type:"application/octet-stream"})),t(()=>{})},this.reader.readAsArrayBuffer(this.file.slice(o,o+n))})}xhrPromise(t){const n=o=>{o.upload.onprogress=r=>{const i=100/this.totalChunks,s=i*this.file.size,a=i*this.chunkCount,l=r.loaded/(r.total??s)*i;this.dispatch("progress",Math.min(a+l,100))}};return new Promise((o,r)=>{this.currentXhr=Wa({...t,beforeSend:n},(i,s)=>(this.currentXhr=void 0,i?r(i):o(s)))})}sendChunk(){if(!this.chunk)return;const t=this.chunkCount*this.chunkByteSize,n=t+this.chunk.size-1,o={...this.headers,FileName:this.fileName,FileMD5:this.md5,"Content-Type":this.file.type,"Content-Range":`bytes ${t}-${n}/${this.file.size}`};if(this.dispatch("attempt",{chunkNumber:this.chunkCount,chunkSize:this.chunk.size}),this.endpointValue)return this.xhrPromise({headers:o,url:this.endpointValue,method:this.method,body:this.chunk});console.warn("\u6587\u4EF6\u4E0A\u4F20endpointValue\u4E0D\u80FD\u4E3A\u7A7A\uFF01"),this.dispatch("error",{message:"\u6587\u4EF6\u4E0A\u4F20endpointValue\u4E0D\u80FD\u4E3A\u7A7A\uFF01\u53D6\u6D88\u4E0A\u4F20\uFF01",chunk:this.chunkCount,attempts:this.attemptCount})}manageRetries(){if(this.attemptCount<this.attempts)return setTimeout(()=>this.sendChunks(),1e3*this.delayBeforeAttempt),void this.dispatch("attemptFailure",{message:`\u4E0A\u4F20\u5206\u7247\uFF1A${this.chunkCount}\u5931\u8D25\u3002\u8FD8\u4F1A\u518D\u5C1D\u8BD5 ${this.attempts-this.attemptCount}\u6B21\uFF01`,chunkNumber:this.chunkCount,attemptsLeft:this.attempts-this.attemptCount});this.dispatch("error",{message:`\u4E0A\u4F20\u5206\u7247\u9519\u8BEF\uFF1A ${this.chunkCount}\u3002\u505C\u6B62\u5C1D\u8BD5\uFF0C\u53D6\u6D88\u4E0A\u4F20\uFF01`,chunk:this.chunkCount,attempts:this.attemptCount})}sendChunks(){console.log(this.paused,this.offline,this.success,"sendChunks this.paused || this.offline || this.success"),!(this.paused||this.offline||this.success)&&this.getChunk().then(()=>this.sendChunk()).then(t=>{if(this.attemptCount=this.attemptCount+1,t!=null&&Ua.includes(t.statusCode)){this.dispatch("chunkSuccess",{chunk:this.chunkCount,attempts:this.attemptCount,response:t}),this.attemptCount=0,this.chunkCount=this.chunkCount+1,this.chunkCount<this.totalChunks?this.sendChunks():(this.success=!0,this.dispatch("success"));const n=this.chunkCount/this.totalChunks*this.file.size*100/this.file.size;this.dispatch("progress",n)}else if(t!=null&&Fa.includes(t.statusCode)){if(this.paused||this.offline)return;this.manageRetries()}else{if(this.paused||this.offline)return;console.log(`\u670D\u52A1\u5668\u9519\u8BEF:${t?.statusCode}\uFF0C\u505C\u6B62\u4E0A\u4F20\u3002`),this.dispatch("error",{message:`\u670D\u52A1\u5668\u9519\u8BEF:${t?.statusCode}\uFF0C\u505C\u6B62\u4E0A\u4F20\u3002`,chunkNumber:this.chunkCount,attempts:this.attemptCount})}}).catch(t=>{this.paused||this.offline||this.manageRetries()})}}const Ha=e=>new Nr(e),qa=new class{hasClass(e,t){return e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}addClass(e,t){this.hasClass(e,t)||(e.className+=" "+t)}removeClass(e,t){if(this.hasClass(e,t)){const n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ")}}toggleClass(e,t){this.hasClass(e,t)?this.removeClass(e,t):this.addClass(e,t)}setCSSProperty(e,t,n){e?.style.setProperty(t,n)}};class ge{hproseURL;client;hproseProxy;static httpTransport;constructor(t){if(t&&!ze.isNullOrEmpty(t)){if(ge.httpTransport||(ge.httpTransport=new Xs),this.client=new Fs(t),!this.client)throw Error("Hprose Client\u521D\u59CB\u5316\u9519\u8BEF");this.hproseURL=t,this.init()}}init(){this.client&&this.client.useServiceAsync().then(t=>{this.hproseProxy=t}).catch(t=>{String(t).indexOf("find this method ~")>0?(this.hproseProxy=this.client?.useService(),console.warn("\u65E7\u7248\u672C\u4E0D\u652F\u6301useServiceAsync")):$t.emit(lt.HproseServiceErrorEvent,"\u521D\u59CB\u5316\u9ED8\u8BA4Hprose!"),console.warn(t)})}async getProxy(){if(!this.hproseProxy)try{this.client&&(this.hproseProxy=await this.client.useServiceAsync())}catch(t){console.warn(t),this.hproseProxy=this.client?.useService()}return this.hproseProxy}async invoke(t,n,o){if(this.client)return await this.client.invoke(t,n,o)}encode(t,n,o){if(this.client)return this.client.codec.encode(t,n,o)}decode(t,n){if(this.client)return this.client.codec.decode(t,n)}}class oe{hproseClient;hpProxyObj;defaultContext=new kn;constructor(t){this.hproseClient=new ge(t),this.hpProxyObj=null}getClientContext(t,n){const o={};n&&(o.requestHeaders=n);const r=Nt();o.httpRequestHeaders=t||{};const i=o.httpRequestHeaders;return r&&(i.token=r.token),j.SystemID&&(i.sysid=j.SystemID,j.SystemGroup&&(i.sysgroup=j.SystemGroup)),new kn(o)}async getHproseProxy(){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");if(!this.hpProxyObj){const t=await this.hproseClient.getProxy();this.hpProxyObj=t}return this.hpProxyObj||$t.emit(lt.HproseServiceErrorEvent,"HproseProxy\u5BF9\u8C61\u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5\uFF01"),this.hpProxyObj}async hproseInvoke(t,n,o){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");return await this.hproseClient.invoke(t,n,o)}async hproseInvokeContext(t,n,...o){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");const r=Nt();return console.log(r,"userToken3"),r&&(n||(n=new kn({httpRequestHeaders:{token:r.token}}))),await this.hproseClient.invoke(t,o,n)}async hproseInvokeEncode(t){const n=new Ee(t).toBytes(),o=await this.hproseClient.client?.request(n,this.defaultContext);return o&&this.hproseClient.client?.codec.decode(o,this.defaultContext)}encodeRequest(t,...n){const o=this.hproseClient.client?.codec?.encode(t,n,this.defaultContext);return Ee.toString(o)}}const Kn=new Map,Xa=function(e,t,n){!j.Config.DefaultHproseAPI&&j.Config.ServiceURL&&(j.Config.DefaultHproseAPI=j.Config.ServiceURL.DefaultHproseAPI),j.Config.DefaultHproseAPI&&ze.isNotEmpty(j.Config.DefaultHproseAPI)&&(j.DefaultProxyClient=new oe(j.Config.DefaultHproseAPI));const o=j.Config.UI.GrayMode;o&&ft.setGrayMode(o);const r=new Er(e,j.EventBus);j.Message=r,j.SystemID=t,j.SystemGroup=n,j.EventBus.on(lt.HproseServiceErrorEvent,i=>{const s=`\u5F53\u524D\u540E\u53F0\u4E1A\u52A1\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("Hprose\u8BF7\u6C42\u9519\u8BEF",s)}),j.EventBus.on(lt.WebAPIErrorEvent,i=>{const s=`WebAPI\u540E\u53F0\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("WebAPI\u8BF7\u6C42\u9519\u8BEF",s)}),j.EventBus.on(lt.AxiosRequestErrorEvent,i=>{const s=`Http\u8BF7\u6C42'${i.code}'\u9519\u8BEF: ${i.message}`;console.warn("Http\u8BF7\u6C42\u9519\u8BEF",s)}),j.EventBus.on(lt.CommonWarnEvent,i=>{r.warn(i)})};function Br(e){if(e&&ze.isNotEmpty(e)){if(Kn.has(e))return Kn.get(e);{const t=new oe(e);return Kn.set(e,t),t}}}function Va(e){const t=Br(e);return t&&(j.DefaultProxyClient=t),t}const Jn="is_LockScreen",jr=kt.get(Jn,!1),re={isLock:jr,lockTime:jr=="true"?Wr():0};function Or(e){re.isLock=e,kt.set(Jn,e,10),e&&(Hn(),console.log("\u9501\u5C4F\u4E86\u2026\u2026"))}function Ga(){return kt.get(Jn,!1)}function Wr(){let e=3600;return j.Config.UI?.LockTime&&j.Config.UI?.LockTime>=10&&(e=j.Config.UI.LockTime),e}let Yn;function Zn(){clearInterval(Yn),!(window.location.href.indexOf("/login")>0||re.isLock)&&(Or(!1),re.lockTime=Wr(),Yn=setInterval(()=>{if(re.lockTime--,re.lockTime<=0)return Or(!0),clearInterval(Yn)},1e3))}function Ka(){Zn(),document.addEventListener("mousedown",Zn)}function Ja(){document.removeEventListener("mousedown",Zn)}function Qn(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ur,Fr={exports:{}};/*!
1
+ import{h as zi,openBlock as q,createElementBlock as ft,normalizeStyle as gt,renderSlot as it,defineComponent as It,ref as K,withModifiers as vo,getCurrentInstance as Ai,computed as Ot,watch as Tt,onMounted as Ye,onBeforeUnmount as Di,nextTick as yo,resolveComponent as ce,createBlock as Q,Transition as wo,withCtx as wt,withDirectives as bo,createElementVNode as Y,Fragment as Rt,createTextVNode as Je,toDisplayString as Ze,createCommentVNode as nt,vShow as _o,markRaw as Li,onErrorCaptured as $i,Suspense as Ni,createVNode as le,KeepAlive as So,resolveDynamicComponent as bt,reactive as Bi,toRefs as Wi,renderList as jt,normalizeClass as Pt,TransitionGroup as Ui,onUnmounted as Oi,unref as Qe}from"vue";import ji from"axios";import Hi from"qs";import{Client as Fi,ClientContext as tn}from"@hprose/rpc-core";import{ByteStream as ue,Writer as qi,Reader as Xi}from"@hprose/io";import{HttpTransport as Gi}from"@hprose/rpc-html5";import{Icon as en}from"@iconify/vue";var Vi={name:"splitpanes",props:{horizontal:{type:Boolean},pushOtherPanes:{type:Boolean,default:!0},dblClickSplitter:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean}},provide(){return{requestUpdate:this.requestUpdate,onPaneAdd:this.onPaneAdd,onPaneRemove:this.onPaneRemove,onPaneClick:this.onPaneClick}},data:()=>({container:null,ready:!1,panes:[],touch:{mouseDown:!1,dragging:!1,activeSplitter:null},splitterTaps:{splitter:null,timeoutId:null}}),computed:{panesCount(){return this.panes.length},indexedPanes(){return this.panes.reduce((n,t)=>(n[t.id]=t)&&n,{})}},methods:{updatePaneComponents(){this.panes.forEach(n=>{n.update&&n.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[n.id].size}%`})})},bindEvents(){document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),document.addEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.addEventListener("touchmove",this.onMouseMove,{passive:!1}),document.addEventListener("touchend",this.onMouseUp))},unbindEvents(){document.removeEventListener("mousemove",this.onMouseMove,{passive:!1}),document.removeEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.removeEventListener("touchmove",this.onMouseMove,{passive:!1}),document.removeEventListener("touchend",this.onMouseUp))},onMouseDown(n,t){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=t},onMouseMove(n){this.touch.mouseDown&&(n.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(n)),this.$emit("resize",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(n=>({min:n.min,max:n.max,size:n.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(n,t){"ontouchstart"in window&&(n.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===t?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(n,t),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=t,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[t])},onSplitterDblClick(n,t){let e=0;this.panes=this.panes.map((o,r)=>(o.size=r===t?o.max:o.min,r!==t&&(e+=o.min),o)),this.panes[t].size-=e,this.$emit("pane-maximize",this.panes[t])},onPaneClick(n,t){this.$emit("pane-click",this.indexedPanes[t])},getCurrentMouseDrag(n){const t=this.container.getBoundingClientRect(),{clientX:e,clientY:o}="ontouchstart"in window&&n.touches?n.touches[0]:n;return{x:e-t.left,y:o-t.top}},getCurrentDragPercentage(n){n=n[this.horizontal?"y":"x"];const t=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(n=t-n),100*n/t},calculatePanesSize(n){const t=this.touch.activeSplitter;let e={prevPanesSize:this.sumPrevPanesSize(t),nextPanesSize:this.sumNextPanesSize(t),prevReachedMinPanes:0,nextReachedMinPanes:0};const o=0+(this.pushOtherPanes?0:e.prevPanesSize),r=100-(this.pushOtherPanes?0:e.nextPanesSize),i=Math.max(Math.min(this.getCurrentDragPercentage(n),r),o);let s=[t,t+1],c=this.panes[s[0]]||null,f=this.panes[s[1]]||null;const g=c.max<100&&i>=c.max+e.prevPanesSize,S=f.max<100&&i<=100-(f.max+this.sumNextPanesSize(t+1));if(g||S)g?(c.size=c.max,f.size=Math.max(100-c.max-e.prevPanesSize-e.nextPanesSize,0)):(c.size=Math.max(100-f.max-e.prevPanesSize-this.sumNextPanesSize(t+1),0),f.size=f.max);else{if(this.pushOtherPanes){const E=this.doPushOtherPanes(e,i);if(!E)return;({sums:e,panesToResize:s}=E),c=this.panes[s[0]]||null,f=this.panes[s[1]]||null}c!==null&&(c.size=Math.min(Math.max(i-e.prevPanesSize-e.prevReachedMinPanes,c.min),c.max)),f!==null&&(f.size=Math.min(Math.max(100-i-e.nextPanesSize-e.nextReachedMinPanes,f.min),f.max))}},doPushOtherPanes(n,t){const e=this.touch.activeSplitter,o=[e,e+1];return t<n.prevPanesSize+this.panes[o[0]].min&&(o[0]=this.findPrevExpandedPane(e).index,n.prevReachedMinPanes=0,o[0]<e&&this.panes.forEach((r,i)=>{i>o[0]&&i<=e&&(r.size=r.min,n.prevReachedMinPanes+=r.min)}),n.prevPanesSize=this.sumPrevPanesSize(o[0]),o[0]===void 0)?(n.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((r,i)=>{i>0&&i<=e&&(r.size=r.min,n.prevReachedMinPanes+=r.min)}),this.panes[o[1]].size=100-n.prevReachedMinPanes-this.panes[0].min-n.prevPanesSize-n.nextPanesSize,null):t>100-n.nextPanesSize-this.panes[o[1]].min&&(o[1]=this.findNextExpandedPane(e).index,n.nextReachedMinPanes=0,o[1]>e+1&&this.panes.forEach((r,i)=>{i>e&&i<o[1]&&(r.size=r.min,n.nextReachedMinPanes+=r.min)}),n.nextPanesSize=this.sumNextPanesSize(o[1]-1),o[1]===void 0)?(n.nextReachedMinPanes=0,this.panes[this.panesCount-1].size=this.panes[this.panesCount-1].min,this.panes.forEach((r,i)=>{i<this.panesCount-1&&i>=e+1&&(r.size=r.min,n.nextReachedMinPanes+=r.min)}),this.panes[o[0]].size=100-n.prevPanesSize-n.nextReachedMinPanes-this.panes[this.panesCount-1].min-n.nextPanesSize,null):{sums:n,panesToResize:o}},sumPrevPanesSize(n){return this.panes.reduce((t,e,o)=>t+(o<n?e.size:0),0)},sumNextPanesSize(n){return this.panes.reduce((t,e,o)=>t+(o>n+1?e.size:0),0)},findPrevExpandedPane(n){return[...this.panes].reverse().find(t=>t.index<n&&t.size>t.min)||{}},findNextExpandedPane(n){return this.panes.find(t=>t.index>n+1&&t.size>t.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(n=>{const t=n.classList.contains("splitpanes__pane"),e=n.classList.contains("splitpanes__splitter");if(!t&&!e)return n.parentNode.removeChild(n),void console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed.")})},addSplitter(n,t,e=!1){const o=n-1,r=document.createElement("div");r.classList.add("splitpanes__splitter"),e||(r.onmousedown=i=>this.onMouseDown(i,o),typeof window<"u"&&"ontouchstart"in window&&(r.ontouchstart=i=>this.onMouseDown(i,o)),r.onclick=i=>this.onSplitterClick(i,o+1)),this.dblClickSplitter&&(r.ondblclick=i=>this.onSplitterDblClick(i,o+1)),t.parentNode.insertBefore(r,t)},removeSplitter(n){n.onmousedown=void 0,n.onclick=void 0,n.ondblclick=void 0,n.parentNode.removeChild(n)},redoSplitters(){const n=Array.from(this.container.children);n.forEach(e=>{e.className.includes("splitpanes__splitter")&&this.removeSplitter(e)});let t=0;n.forEach(e=>{e.className.includes("splitpanes__pane")&&(!t&&this.firstSplitter?this.addSplitter(t,e,!0):t&&this.addSplitter(t,e),t++)})},requestUpdate({target:n,...t}){const e=this.indexedPanes[n._.uid];Object.entries(t).forEach(([o,r])=>e[o]=r)},onPaneAdd(n){let t=-1;Array.from(n.$el.parentNode.children).some(r=>(r.className.includes("splitpanes__pane")&&t++,r===n.$el));const e=parseFloat(n.minSize),o=parseFloat(n.maxSize);this.panes.splice(t,0,{id:n._.uid,index:t,min:isNaN(e)?0:e,max:isNaN(o)?100:o,size:n.size===null?null:parseFloat(n.size),givenSize:n.size,update:n.update}),this.panes.forEach((r,i)=>r.index=i),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[t]}),this.$emit("pane-add",{index:t,panes:this.panes.map(r=>({min:r.min,max:r.max,size:r.size}))})})},onPaneRemove(n){const t=this.panes.findIndex(o=>o.id===n._.uid),e=this.panes.splice(t,1)[0];this.panes.forEach((o,r)=>o.index=r),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...e,index:t}}),this.$emit("pane-remove",{removed:e,panes:this.panes.map(o=>({min:o.min,max:o.max,size:o.size}))})})},resetPaneSizes(n={}){n.addedPane||n.removedPane?this.panes.some(t=>t.givenSize!==null||t.min||t.max<100)?this.equalizeAfterAddOrRemove(n):this.equalize():this.initialPanesSizing(),this.ready&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size})))},equalize(){const n=100/this.panesCount;let t=0;const e=[],o=[];this.panes.forEach(r=>{r.size=Math.max(Math.min(n,r.max),r.min),t-=r.size,r.size>=r.max&&e.push(r.id),r.size<=r.min&&o.push(r.id)}),t>.1&&this.readjustSizes(t,e,o)},initialPanesSizing(){let n=100;const t=[],e=[];let o=0;this.panes.forEach(i=>{n-=i.size,i.size!==null&&o++,i.size>=i.max&&t.push(i.id),i.size<=i.min&&e.push(i.id)});let r=100;n>.1&&(this.panes.forEach(i=>{i.size===null&&(i.size=Math.max(Math.min(n/(this.panesCount-o),i.max),i.min)),r-=i.size}),r>.1&&this.readjustSizes(n,t,e))},equalizeAfterAddOrRemove({addedPane:n}={}){let t=100/this.panesCount,e=0;const o=[],r=[];n&&n.givenSize!==null&&(t=(100-n.givenSize)/(this.panesCount-1)),this.panes.forEach(i=>{e-=i.size,i.size>=i.max&&o.push(i.id),i.size<=i.min&&r.push(i.id)}),!(Math.abs(e)<.1)&&(this.panes.forEach(i=>{n&&n.givenSize!==null&&n.id===i.id||(i.size=Math.max(Math.min(t,i.max),i.min)),e-=i.size,i.size>=i.max&&o.push(i.id),i.size<=i.min&&r.push(i.id)}),e>.1&&this.readjustSizes(e,o,r))},readjustSizes(n,t,e){let o;o=n>0?n/(this.panesCount-t.length):n/(this.panesCount-e.length),this.panes.forEach(r=>{if(n>0&&!t.includes(r.id)){const i=Math.max(Math.min(r.size+o,r.max),r.min),s=i-r.size;n-=s,r.size=i}else if(!e.includes(r.id)){const i=Math.max(Math.min(r.size+o,r.max),r.min),s=i-r.size;n-=s,r.size=i}r.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[r.id].size}%`})}),Math.abs(n)>.1&&this.$nextTick(()=>{this.ready&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})}},watch:{panes:{deep:!0,immediate:!1,handler(){this.updatePaneComponents()}},horizontal(){this.updatePaneComponents()},firstSplitter(){this.redoSplitters()},dblClickSplitter(n){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((t,e)=>{t.ondblclick=n?o=>this.onSplitterDblClick(o,e):void 0})}},beforeUnmount(){this.ready=!1},mounted(){this.container=this.$refs.container,this.checkSplitpanesNodes(),this.redoSplitters(),this.resetPaneSizes(),this.updatePaneComponents(),this.$emit("ready"),this.ready=!0},render(){return zi("div",{ref:"container",class:["splitpanes","splitpanes--"+(this.horizontal?"horizontal":"vertical"),{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())},__file:"src/controls/splitpanes/splitpanes.vue"},nn={name:"pane",inject:["requestUpdate","onPaneAdd","onPaneRemove","onPaneClick"],props:{size:{type:[Number,String],default:10},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},data:()=>({style:{}}),mounted(){this.onPaneAdd(this)},beforeUnmount(){this.onPaneRemove(this)},methods:{update(n){this.style=n}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(n){this.requestUpdate({target:this,size:n})},minSizeNumber(n){this.requestUpdate({target:this,min:n})},maxSizeNumber(n){this.requestUpdate({target:this,max:n})}}};function on(n){return window.TouchEvent&&n instanceof TouchEvent}nn.render=function(n,t,e,o,r,i){return q(),ft("div",{class:"splitpanes__pane",onClick:t[0]||(t[0]=s=>i.onPaneClick(s,n._.uid)),style:gt(n.style)},[it(n.$slots,"default")],4)},nn.__file="src/controls/splitpanes/pane.vue";class dt{e;constructor(t){this.e=t}stopPropagation(){this.e.stopPropagation()}preventDefault(){this.e.preventDefault()}get clientX(){return on(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return on(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new Gn(this.clientX,this.clientY)}static bindDown(t,e,o,r=!1){const i=c=>{e(new dt(c))},s=c=>{c.touches.length===1&&e(new dt(c)),c.touches.length>1&&o&&o(new dt(c))};return t.addEventListener("mousedown",i,r),t.addEventListener("touchstart",s,r),()=>{t.removeEventListener("mousedown",i,r),t.removeEventListener("touchstart",s,r)}}static bindMove(t,e,o=!1){const r=s=>{e(new dt(s))},i=s=>{s.touches.length===1&&e(new dt(s))};return t.addEventListener("mousemove",r,o),t.addEventListener("touchmove",i,o),()=>{t.removeEventListener("mousemove",r,o),t.removeEventListener("touchmove",i,o)}}static bindUp(t,e,o=!1){const r=s=>{e(new dt(s))},i=s=>{s.touches.length===0&&e(new dt(s))};return t.addEventListener("mouseup",r,o),t.addEventListener("touchend",i,o),()=>{t.removeEventListener("mouseup",r,o),t.removeEventListener("touchend",i,o)}}originalEvent({mouse:t,touch:e}){on(this.e)?e&&e(this.e):t&&t(this.e)}}class Gn{x;y;constructor(t,e){this.x=t,this.y=e}clone(){return new Gn(this.x,this.y)}}class Ki{handle;container;options;unbindDown;unbindMove;unbindUp;constructor(t,e,o={}){this.handle=t,this.container=e,this.options=o,t&&(this.unbindDown=dt.bindDown(t,this.mousedown),t.classList.add("draggable-handle"))}teardown(){this.handle?.classList.remove("draggable-handle"),this.unbindDown&&this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove()}offsetX;offsetY;mousedown=t=>{t.preventDefault(),this.handle&&(this.offsetX=t.clientX,this.offsetY=t.clientY),this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=dt.bindMove(document,this.mousemove),this.unbindUp=dt.bindUp(document,this.mouseup)};mousemove=t=>{this.container&&(this.container.style.left=`calc(${t.clientX-this.offsetX}px + ${this.container.style.left})`,this.container.style.top=`calc(${t.clientY-this.offsetY}px + ${this.container.style.top})`,this.offsetX=t.clientX,this.offsetY=t.clientY),this.options.onMove&&this.options.onMove()};mouseup=t=>{this.options.onMoveEnd&&this.options.onMoveEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0}}class Yi{_group;onChange;zIndex;constructor(t,e){this._group=t,this.onChange=e,this.a(o=>o.push(this))}set group(t){this._group=t;const e=de(this._group),o=de(t);e.splice(e.indexOf(this),1),o.push(this),Eo()}get group(){return this._group}unregister(){this.a(t=>t.splice(t.indexOf(this),1))}raise(){this.a(t=>{t.splice(t.indexOf(this),1),t.push(this)})}a(t){t(de(this._group)),Eo()}}const he=new Map;function de(n){return he.has(n)||he.set(n,[]),he.get(n)}function Co(n,t){return n>t?-Co(t,n):n<0&&t>=0?1:n-t}function Eo(){let n=0;for(const t of function(e){const o=[];return e.forEach((r,i)=>o.push(i)),o}(he).sort(Co))for(const e of de(t))n!=e.zIndex&&(e.zIndex=n,e.onChange(n)),n++}function rn(n){if(n){const{width:t,height:e}=n.style;n.style.width="auto",n.style.height="auto";const o=fe(n);return n.style.width=t,n.style.height=e,o}return{width:0,height:0,top:0,left:0,bottom:0,right:0}}function fe(n){const t=n.getBoundingClientRect(),e=t.width,o=t.height,r=t.top,i=t.left;return{width:e,height:o,top:r,left:i,bottom:r+o,right:i+e}}class Ji{container;options;handles;constructor(t,e){if(this.container=t,this.options=e,t&&e){this.handles=ko.map(f=>new f(t,this));const{width:o,height:r}=rn(t),i=e.maxWidth||window.innerWidth,s=e.maxHeight||window.innerHeight;let c=!1;(o<e.minWidth||o>i)&&(t.style.width=`${xo(o,e.minWidth,i)}px`,c=!0),(r<e.minHeight||r>s)&&(t.style.height=`${xo(r,e.minHeight,s)}px`,c=!0),c&&e.onResize&&e.onResize()}}teardown(){this.handles?.forEach(t=>t.teardown())}}const ko=[];class xt{container;helper;handle;handleSize=8;unbindDown;unbindMove;unbindUp;constructor(t,e){this.container=t,this.helper=e,this.handle=this.createHandleElement(),this.unbindDown=dt.bindDown(this.handle,this.mousedown)}teardown(){this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove(),this.handle.parentElement.removeChild(this.handle)}x0;y0;left0;top0;width0;height0;mousedown=t=>{t.preventDefault(),t.stopPropagation();const{left:e,top:o,width:r,height:i}=fe(this.container);this.x0=t.clientX,this.y0=t.clientY,this.left0=e,this.top0=o,this.width0=r,this.height0=i,this.calcSafeBoundaries(),this.helper.options&&this.helper.options.onResizeStart&&this.helper.options.onResizeStart(),this.unbindMove=dt.bindMove(document,this.mousemove),this.unbindUp=dt.bindUp(document,this.mouseup)};minLeft;maxLeft;minRight;maxRight;minTop;maxTop;minBottom;maxBottom;calcSafeBoundaries(){if(!this.helper.options)return;const{left:t,top:e,right:o,bottom:r}=fe(this.container),i=this.helper.options,s=i.maxWidth||window.innerWidth,c=i.maxHeight||window.innerHeight;this.minLeft=Math.max(o-s,0),this.maxLeft=o-i.minWidth,this.minRight=t+i.minWidth,this.maxRight=Math.min(t+s,window.innerWidth),this.minTop=Math.max(r-c,0),this.maxTop=r-i.minHeight,this.minBottom=e+i.minHeight,this.maxBottom=Math.min(e+c,window.innerHeight)}mousemove=t=>{t.preventDefault(),t.stopPropagation(),this.setPosition(t),this.fixPosition(),this.helper.options&&this.helper.options.onResize&&this.helper.options.onResize()};fixPosition(){const{width:t,height:e,left:o,top:r,right:i,bottom:s}=fe(this.container),c=this.helper.options;c&&(o<this.minLeft?(this.container.style.width=t+o-this.minLeft+"px",this.container.style.left=`${this.minLeft}px`):o>this.maxLeft?(this.container.style.width=`${c.minWidth}px`,this.container.style.left=`${this.maxLeft}px`):i<this.minRight?this.container.style.width=`${c.minWidth}px`:i>this.maxRight&&(this.container.style.width=this.maxRight-o+"px"),r<this.minTop?(this.container.style.height=e+r-this.minTop+"px",this.container.style.top=`${this.minTop}px`):r>this.maxTop?(this.container.style.height=`${c.minHeight}px`,this.container.style.top=`${this.maxTop}px`):s<this.minBottom?this.container.style.height=`${c.minHeight}px`:s>this.maxBottom&&(this.container.style.height=this.maxBottom-r+"px"))}mouseup=t=>{t.preventDefault(),t.stopPropagation(),this.helper.options&&this.helper.options.onResizeEnd&&this.helper.options.onResizeEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0};createHandleElement(){const t=document.createElement("div"),e=t.style;return e.position="absolute",this.applyStyle(e),this.container.appendChild(t),t}}function xo(n,t,e){return n<t?t:n>e?e:n}ko.push(class extends xt{setPosition(n){this.container.style.width=this.width0+n.clientX-this.x0+"px",this.container.style.height=this.height0+n.clientY-this.y0+"px"}applyStyle(n){n.width=2*this.handleSize+"px",n.height=2*this.handleSize+"px",n.right=-this.handleSize+"px",n.bottom=-this.handleSize+"px",n.cursor="nwse-resize"}},class extends xt{setPosition(n){this.container.style.height=this.height0+n.clientY-this.y0+"px"}applyStyle(n){n.right=`${this.handleSize}px`,n.left=`${this.handleSize}px`,n.height=2*this.handleSize+"px",n.bottom=-this.handleSize+"px",n.cursor="ns-resize"}},class extends xt{setPosition(n){this.container.style.left=this.left0+n.clientX-this.x0+"px",this.container.style.width=this.width0-(n.clientX-this.x0)+"px",this.container.style.height=this.height0+n.clientY-this.y0+"px"}applyStyle(n){n.left=-this.handleSize+"px",n.bottom=-this.handleSize+"px",n.width=2*this.handleSize+"px",n.height=2*this.handleSize+"px",n.cursor="nesw-resize"}},class extends xt{setPosition(n){this.container.style.left=this.left0+n.clientX-this.x0+"px",this.container.style.width=this.width0-(n.clientX-this.x0)+"px"}applyStyle(n){n.left=-this.handleSize+"px",n.bottom=`${this.handleSize}px`,n.width=2*this.handleSize+"px",n.top=`${this.handleSize}px`,n.cursor="ew-resize"}},class extends xt{setPosition(n){this.container.style.left=this.left0+n.clientX-this.x0+"px",this.container.style.width=this.width0-(n.clientX-this.x0)+"px",this.container.style.top=this.top0+n.clientY-this.y0+"px",this.container.style.height=this.height0-(n.clientY-this.y0)+"px"}applyStyle(n){n.left=-this.handleSize+"px",n.top=-this.handleSize+"px",n.width=2*this.handleSize+"px",n.height=2*this.handleSize+"px",n.cursor="nwse-resize"}},class extends xt{setPosition(n){this.container.style.top=this.top0+n.clientY-this.y0+"px",this.container.style.height=this.height0-(n.clientY-this.y0)+"px"}applyStyle(n){n.left=`${this.handleSize}px`,n.right=`${this.handleSize}px`,n.height=2*this.handleSize+"px",n.top=-this.handleSize+"px",n.cursor="ns-resize"}},class extends xt{setPosition(n){this.container.style.top=this.top0+n.clientY-this.y0+"px",this.container.style.height=this.height0-(n.clientY-this.y0)+"px",this.container.style.width=this.width0+n.clientX-this.x0+"px"}applyStyle(n){n.right=-this.handleSize+"px",n.top=-this.handleSize+"px",n.height=2*this.handleSize+"px",n.width=2*this.handleSize+"px",n.cursor="nesw-resize"}},class extends xt{setPosition(n){this.container.style.width=this.width0+n.clientX-this.x0+"px"}applyStyle(n){n.right=-this.handleSize+"px",n.top=`${this.handleSize}px`,n.bottom=`${this.handleSize}px`,n.width=2*this.handleSize+"px",n.cursor="ew-resize"}});var pe=It({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(n){const t=K(!1),e=K(!1);return{hover:t,active:e,style:function(){let o=n.windowStyle.button;return t.value&&(o={...o,...this.windowStyle.buttonHover}),e.value&&(o={...o,...this.windowStyle.buttonActive}),o},mouseup:function(o){this.active&&this.$emit("click")},mousedown:function(o){o.preventDefault(),e.value=!0;const r=dt.bindUp(document,()=>{e.value=!1,r()})}}}});const Zi=["disabled"];pe.render=function(n,t,e,o,r,i){return q(),ft("div",{class:"btn",style:gt(n.style()),onMouseenter:t[0]||(t[0]=s=>n.hover=!0),onMouseleave:t[1]||(t[1]=s=>n.hover=!1),onMousedown:t[2]||(t[2]=vo((...s)=>n.mousedown&&n.mousedown(...s),["stop"])),onTouchstart:t[3]||(t[3]=vo((...s)=>n.mousedown&&n.mousedown(...s),["stop"])),onMouseup:t[4]||(t[4]=(...s)=>n.mouseup&&n.mouseup(...s)),onTouchend:t[5]||(t[5]=(...s)=>n.mouseup&&n.mouseup(...s)),disabled:n.disabled},[it(n.$slots,"default")],44,Zi)},pe.__scopeId="data-v-71662210",pe.__file="src/controls/vuewindow/window/Button.vue";const Qi=Object.prototype.toString;function ut(n,t){return Qi.call(n)===`[object ${t}]`}function ge(n){return ut(n,"Function")}const Io=n=>typeof n<"u",sn=n=>!Io(n);function an(n){return n===null}function ts(n){return sn(n)&&an(n)}function es(n){return sn(n)||an(n)}const Mt=n=>n!=null&&n!==null&&ut(n,"Object");function ns(n){return ut(n,"Date")}function cn(n){return ut(n,"Number")}function os(n){return ut(n,"AsyncFunction")}function rs(n){return ut(n,"Promise")&&Mt(n)&&ge(n.then)&&ge(n.catch)}function me(n){return ut(n,"String")}function is(n){return n===!0||n===!1||ut(n,"Boolean")}function ln(n){return n&&Array.isArray(n)}const ss=()=>typeof window<"u",as=n=>typeof window<"u"&&ut(n,"Window"),cs=n=>Mt(n)&&!!n.tagName,ls=typeof window>"u";function us(n){return n&&["IMAGE","IMG"].includes(n.tagName)}function hs(n){return n==null||(me(n)||ln(n)?n.length===0:!!Mt(n)&&JSON.stringify(n)==="{}")}function ds(n){return ut(n,"Error")}function fs(n){return ut(n,"WeakSet")}function ps(n){return ut(n,"WeakMap")}function gs(n){return ut(n,"Symbol")}function ms(n){return ut(n,"Map")}const vs=n=>/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/.test(n);var Ht=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ve(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var To,Ro={exports:{}},ys=To?Ro.exports:(To=1,Ro.exports=function(n){var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function e(p,l){var y=p[0],m=p[1],h=p[2],v=p[3];m=((m+=((h=((h+=((v=((v+=((y=((y+=(m&h|~m&v)+l[0]-680876936|0)<<7|y>>>25)+m|0)&m|~y&h)+l[1]-389564586|0)<<12|v>>>20)+y|0)&y|~v&m)+l[2]+606105819|0)<<17|h>>>15)+v|0)&v|~h&y)+l[3]-1044525330|0)<<22|m>>>10)+h|0,m=((m+=((h=((h+=((v=((v+=((y=((y+=(m&h|~m&v)+l[4]-176418897|0)<<7|y>>>25)+m|0)&m|~y&h)+l[5]+1200080426|0)<<12|v>>>20)+y|0)&y|~v&m)+l[6]-1473231341|0)<<17|h>>>15)+v|0)&v|~h&y)+l[7]-45705983|0)<<22|m>>>10)+h|0,m=((m+=((h=((h+=((v=((v+=((y=((y+=(m&h|~m&v)+l[8]+1770035416|0)<<7|y>>>25)+m|0)&m|~y&h)+l[9]-1958414417|0)<<12|v>>>20)+y|0)&y|~v&m)+l[10]-42063|0)<<17|h>>>15)+v|0)&v|~h&y)+l[11]-1990404162|0)<<22|m>>>10)+h|0,m=((m+=((h=((h+=((v=((v+=((y=((y+=(m&h|~m&v)+l[12]+1804603682|0)<<7|y>>>25)+m|0)&m|~y&h)+l[13]-40341101|0)<<12|v>>>20)+y|0)&y|~v&m)+l[14]-1502002290|0)<<17|h>>>15)+v|0)&v|~h&y)+l[15]+1236535329|0)<<22|m>>>10)+h|0,m=((m+=((h=((h+=((v=((v+=((y=((y+=(m&v|h&~v)+l[1]-165796510|0)<<5|y>>>27)+m|0)&h|m&~h)+l[6]-1069501632|0)<<9|v>>>23)+y|0)&m|y&~m)+l[11]+643717713|0)<<14|h>>>18)+v|0)&y|v&~y)+l[0]-373897302|0)<<20|m>>>12)+h|0,m=((m+=((h=((h+=((v=((v+=((y=((y+=(m&v|h&~v)+l[5]-701558691|0)<<5|y>>>27)+m|0)&h|m&~h)+l[10]+38016083|0)<<9|v>>>23)+y|0)&m|y&~m)+l[15]-660478335|0)<<14|h>>>18)+v|0)&y|v&~y)+l[4]-405537848|0)<<20|m>>>12)+h|0,m=((m+=((h=((h+=((v=((v+=((y=((y+=(m&v|h&~v)+l[9]+568446438|0)<<5|y>>>27)+m|0)&h|m&~h)+l[14]-1019803690|0)<<9|v>>>23)+y|0)&m|y&~m)+l[3]-187363961|0)<<14|h>>>18)+v|0)&y|v&~y)+l[8]+1163531501|0)<<20|m>>>12)+h|0,m=((m+=((h=((h+=((v=((v+=((y=((y+=(m&v|h&~v)+l[13]-1444681467|0)<<5|y>>>27)+m|0)&h|m&~h)+l[2]-51403784|0)<<9|v>>>23)+y|0)&m|y&~m)+l[7]+1735328473|0)<<14|h>>>18)+v|0)&y|v&~y)+l[12]-1926607734|0)<<20|m>>>12)+h|0,m=((m+=((h=((h+=((v=((v+=((y=((y+=(m^h^v)+l[5]-378558|0)<<4|y>>>28)+m|0)^m^h)+l[8]-2022574463|0)<<11|v>>>21)+y|0)^y^m)+l[11]+1839030562|0)<<16|h>>>16)+v|0)^v^y)+l[14]-35309556|0)<<23|m>>>9)+h|0,m=((m+=((h=((h+=((v=((v+=((y=((y+=(m^h^v)+l[1]-1530992060|0)<<4|y>>>28)+m|0)^m^h)+l[4]+1272893353|0)<<11|v>>>21)+y|0)^y^m)+l[7]-155497632|0)<<16|h>>>16)+v|0)^v^y)+l[10]-1094730640|0)<<23|m>>>9)+h|0,m=((m+=((h=((h+=((v=((v+=((y=((y+=(m^h^v)+l[13]+681279174|0)<<4|y>>>28)+m|0)^m^h)+l[0]-358537222|0)<<11|v>>>21)+y|0)^y^m)+l[3]-722521979|0)<<16|h>>>16)+v|0)^v^y)+l[6]+76029189|0)<<23|m>>>9)+h|0,m=((m+=((h=((h+=((v=((v+=((y=((y+=(m^h^v)+l[9]-640364487|0)<<4|y>>>28)+m|0)^m^h)+l[12]-421815835|0)<<11|v>>>21)+y|0)^y^m)+l[15]+530742520|0)<<16|h>>>16)+v|0)^v^y)+l[2]-995338651|0)<<23|m>>>9)+h|0,m=((m+=((v=((v+=(m^((y=((y+=(h^(m|~v))+l[0]-198630844|0)<<6|y>>>26)+m|0)|~h))+l[7]+1126891415|0)<<10|v>>>22)+y|0)^((h=((h+=(y^(v|~m))+l[14]-1416354905|0)<<15|h>>>17)+v|0)|~y))+l[5]-57434055|0)<<21|m>>>11)+h|0,m=((m+=((v=((v+=(m^((y=((y+=(h^(m|~v))+l[12]+1700485571|0)<<6|y>>>26)+m|0)|~h))+l[3]-1894986606|0)<<10|v>>>22)+y|0)^((h=((h+=(y^(v|~m))+l[10]-1051523|0)<<15|h>>>17)+v|0)|~y))+l[1]-2054922799|0)<<21|m>>>11)+h|0,m=((m+=((v=((v+=(m^((y=((y+=(h^(m|~v))+l[8]+1873313359|0)<<6|y>>>26)+m|0)|~h))+l[15]-30611744|0)<<10|v>>>22)+y|0)^((h=((h+=(y^(v|~m))+l[6]-1560198380|0)<<15|h>>>17)+v|0)|~y))+l[13]+1309151649|0)<<21|m>>>11)+h|0,m=((m+=((v=((v+=(m^((y=((y+=(h^(m|~v))+l[4]-145523070|0)<<6|y>>>26)+m|0)|~h))+l[11]-1120210379|0)<<10|v>>>22)+y|0)^((h=((h+=(y^(v|~m))+l[2]+718787259|0)<<15|h>>>17)+v|0)|~y))+l[9]-343485551|0)<<21|m>>>11)+h|0,p[0]=y+p[0]|0,p[1]=m+p[1]|0,p[2]=h+p[2]|0,p[3]=v+p[3]|0}function o(p){var l,y=[];for(l=0;l<64;l+=4)y[l>>2]=p.charCodeAt(l)+(p.charCodeAt(l+1)<<8)+(p.charCodeAt(l+2)<<16)+(p.charCodeAt(l+3)<<24);return y}function r(p){var l,y=[];for(l=0;l<64;l+=4)y[l>>2]=p[l]+(p[l+1]<<8)+(p[l+2]<<16)+(p[l+3]<<24);return y}function i(p){var l,y,m,h,v,$,z=p.length,A=[1732584193,-271733879,-1732584194,271733878];for(l=64;l<=z;l+=64)e(A,o(p.substring(l-64,l)));for(y=(p=p.substring(l-64)).length,m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],l=0;l<y;l+=1)m[l>>2]|=p.charCodeAt(l)<<(l%4<<3);if(m[l>>2]|=128<<(l%4<<3),l>55)for(e(A,m),l=0;l<16;l+=1)m[l]=0;return h=(h=8*z).toString(16).match(/(.*?)(.{0,8})$/),v=parseInt(h[2],16),$=parseInt(h[1],16)||0,m[14]=v,m[15]=$,e(A,m),A}function s(p){var l,y,m,h,v,$,z=p.length,A=[1732584193,-271733879,-1732584194,271733878];for(l=64;l<=z;l+=64)e(A,r(p.subarray(l-64,l)));for(y=(p=l-64<z?p.subarray(l-64):new Uint8Array(0)).length,m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],l=0;l<y;l+=1)m[l>>2]|=p[l]<<(l%4<<3);if(m[l>>2]|=128<<(l%4<<3),l>55)for(e(A,m),l=0;l<16;l+=1)m[l]=0;return h=(h=8*z).toString(16).match(/(.*?)(.{0,8})$/),v=parseInt(h[2],16),$=parseInt(h[1],16)||0,m[14]=v,m[15]=$,e(A,m),A}function c(p){var l,y="";for(l=0;l<4;l+=1)y+=t[p>>8*l+4&15]+t[p>>8*l&15];return y}function f(p){var l;for(l=0;l<p.length;l+=1)p[l]=c(p[l]);return p.join("")}function g(p){return/[\u0080-\uFFFF]/.test(p)&&(p=unescape(encodeURIComponent(p))),p}function S(p,l){var y,m=p.length,h=new ArrayBuffer(m),v=new Uint8Array(h);for(y=0;y<m;y+=1)v[y]=p.charCodeAt(y);return l?v:h}function E(p){return String.fromCharCode.apply(null,new Uint8Array(p))}function L(p,l,y){var m=new Uint8Array(p.byteLength+l.byteLength);return m.set(new Uint8Array(p)),m.set(new Uint8Array(l),p.byteLength),y?m:m.buffer}function O(p){var l,y=[],m=p.length;for(l=0;l<m-1;l+=2)y.push(parseInt(p.substr(l,2),16));return String.fromCharCode.apply(String,y)}function I(){this.reset()}return f(i("hello")),typeof ArrayBuffer>"u"||ArrayBuffer.prototype.slice||function(){function p(l,y){return(l=0|l||0)<0?Math.max(l+y,0):Math.min(l,y)}ArrayBuffer.prototype.slice=function(l,y){var m,h,v,$,z=this.byteLength,A=p(l,z),M=z;return y!==n&&(M=p(y,z)),A>M?new ArrayBuffer(0):(m=M-A,h=new ArrayBuffer(m),v=new Uint8Array(h),$=new Uint8Array(this,A,m),v.set($),h)}}(),I.prototype.append=function(p){return this.appendBinary(g(p)),this},I.prototype.appendBinary=function(p){this._buff+=p,this._length+=p.length;var l,y=this._buff.length;for(l=64;l<=y;l+=64)e(this._hash,o(this._buff.substring(l-64,l)));return this._buff=this._buff.substring(l-64),this},I.prototype.end=function(p){var l,y,m=this._buff,h=m.length,v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(l=0;l<h;l+=1)v[l>>2]|=m.charCodeAt(l)<<(l%4<<3);return this._finish(v,h),y=f(this._hash),p&&(y=O(y)),this.reset(),y},I.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},I.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},I.prototype.setState=function(p){return this._buff=p.buff,this._length=p.length,this._hash=p.hash,this},I.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},I.prototype._finish=function(p,l){var y,m,h,v=l;if(p[v>>2]|=128<<(v%4<<3),v>55)for(e(this._hash,p),v=0;v<16;v+=1)p[v]=0;y=(y=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),m=parseInt(y[2],16),h=parseInt(y[1],16)||0,p[14]=m,p[15]=h,e(this._hash,p)},I.hash=function(p,l){return I.hashBinary(g(p),l)},I.hashBinary=function(p,l){var y=f(i(p));return l?O(y):y},I.ArrayBuffer=function(){this.reset()},I.ArrayBuffer.prototype.append=function(p){var l,y=L(this._buff.buffer,p,!0),m=y.length;for(this._length+=p.byteLength,l=64;l<=m;l+=64)e(this._hash,r(y.subarray(l-64,l)));return this._buff=l-64<m?new Uint8Array(y.buffer.slice(l-64)):new Uint8Array(0),this},I.ArrayBuffer.prototype.end=function(p){var l,y,m=this._buff,h=m.length,v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(l=0;l<h;l+=1)v[l>>2]|=m[l]<<(l%4<<3);return this._finish(v,h),y=f(this._hash),p&&(y=O(y)),this.reset(),y},I.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},I.ArrayBuffer.prototype.getState=function(){var p=I.prototype.getState.call(this);return p.buff=E(p.buff),p},I.ArrayBuffer.prototype.setState=function(p){return p.buff=S(p.buff,!0),I.prototype.setState.call(this,p)},I.ArrayBuffer.prototype.destroy=I.prototype.destroy,I.ArrayBuffer.prototype._finish=I.prototype._finish,I.ArrayBuffer.hash=function(p,l){var y=f(s(new Uint8Array(p)));return l?O(y):y},I}()),un=ve(ys);const hn=[];class ht{static addHandler(t,e,o){t.addEventListener?t.addEventListener(e,o,!1):t.attachEvent?t.attachEvent("on"+e,o):t["on"+e]=o}static removeHandler(t,e,o){t.removeEventListener?t.removeEventListener(e,o,!1):t.detachEvent?t.detachEvent("on"+e,o):delete t["on"+e]}static windowResizeHandler(t){ht.addHandler(window,"resize",t)}static offWindowResizeHandler(t){ht.removeHandler(window,"resize",t)}static fullscreenEnabled(){const t=window.document;return document.fullscreenEnabled||window.fullScreen||t.mozFullscreenEnabled||t.webkitIsFullScreen}static fullScreen(t,e){if(e){const o=window.document;let r=window.document.exitFullscreen||o.msExitFullscreen||o.mozCancelFullScreen||o.webkitCancelFullScreen;typeof r<"u"&&r?r.call(window.document):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("WScript.Shell")?.SendKeys("{F11}")}else{let o=t;o||(o=window.document.documentElement);let r=o.requestFullScreen||o.webkitRequestFullScreen||o.mozRequestFullScreen||o.msRequestFullScreen;typeof r<"u"&&r?r.call(o):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("WScript.Shell")?.SendKeys("{F11}")}}static requestFullScreen(t=window.document.documentElement){let e=t;var o=e.requestFullScreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||e.msRequestFullScreen;if(o)o.call(e);else if(typeof window.ActiveXObject<"u"){var r=new window.ActiveXObject("WScript.Shell");r!==null&&r.SendKeys("{F11}")}}static exitFullScreen(){const t=window.document;var e=document.exitFullscreen||t.mozCancelFullScreen||t.webkitExitFullscreen||t.webkitExitFullscreen;if(e)e.call(document);else if(typeof window.ActiveXObject<"u"){var o=new window.ActiveXObject("WScript.Shell");o!==null&&o.SendKeys("{F11}")}}static fullScreenElement(){return window.document.fullscreenElement||window.document.webkitFullscreenElement||window.document.mozFullscreenElement||window.document.msFullscreenElement}static isFullScreen(){return!!ht.fullScreenElement()}static onFullScreenChanged(t){let e;"onfullscreenchange"in window.document?e="fullscreenchange":"onwebkitfullscreenchange"in window.document?e="webkitfullscreenchange":"onmozfullscreenchange"in window.document&&(e="mozfullscreenchange"),e?document.addEventListener(e,function(){const o=ht.isFullScreen();t(o)}):document.addEventListener("MSFullscreenChange",function(){const o=ht.isFullScreen();t(o)})}static stringifyCircularHandler(t,e){if(typeof e=="object"&&e!==null){if(hn.indexOf(e)!==-1)return;hn.push(e)}return e}static jsonStringify(t){if(!t)return"";const e=JSON.stringify(t,ht.stringifyCircularHandler);return hn.length=0,e}static jsonParse(t){const e=ht.jsonStringify(t);if(e.length>1)return JSON.parse(e)}static getObjectURL(t){let e;const o=window;return o.createObjcectURL!=null?e=o.createOjcectURL(t):window.URL!=null?e=window.URL.createObjectURL(t):window.webkitURL!=null&&(e=window.webkitURL.createObjectURL(t)),e}static getFileShortMD5(t,e){const o=File.prototype,r=o.slice||o.mozSlice||o.webkitSlice,i=t,s=2097152,c=new un.ArrayBuffer,f=new FileReader;f.onload=function(g){c.append(g.target?.result);const S=c.end();e({isOK:!0,data:S})},f.onerror=function(){const g="\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01";console.warn(g),e({isOK:!1,data:g})},function(){const g=0+s>=i.size?i.size:0+s;f.readAsArrayBuffer(r.call(i,0,g))}()}static getFileMD5(t,e){const o=File.prototype,r=o.slice||o.mozSlice||o.webkitSlice,i=t,s=2097152,c=Math.ceil(i.size/s);let f=0;const g=new un.ArrayBuffer,S=new FileReader;function E(){const L=f*s,O=L+s>=i.size?i.size:L+s;S.readAsArrayBuffer(r.call(i,L,O))}S.onload=function(L){if(g.append(L.target?.result),f++,f<c)E();else{const O=g.end();e({isOK:!0,data:O})}},S.onerror=function(){const L=`${i.name}:\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01`;console.warn(L),e({isOK:!1,data:L})},E()}static MD5(t,e=!1){return un.hash(t,e)}static copyTextByCommand(t){return new Promise((e,o)=>{const r=document.createElement("input");r.value=t,document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove(),e(!0)})}static copyText=t=>navigator.clipboard?navigator.clipboard.writeText(t).then(function(){return!0},function(e){return!1}):ht.copyTextByCommand(t);static copyElementTextByCommand(t){const e=document.createRange();e.selectNode(document.getElementById(t));const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges(),o.addRange(e);try{return document.execCommand("copy"),o.removeRange(e),!0}catch(r){return o.removeRange(e),console.error("Command\u590D\u5236\u6587\u672C\u9519\u8BEF",r),!1}}static copyElementText(t){if(!navigator.clipboard)return ht.copyElementTextByCommand(t);const e=document.createRange();e.selectNode(document.getElementById(t));const o=window.getSelection();return o.rangeCount>0&&o.removeAllRanges(),o.addRange(e),navigator.clipboard.writeText(o).then(function(){return o.removeRange(e),!0},function(r){return o.removeRange(e),console.error("Clipboard\u590D\u5236\u6587\u672C\u9519\u8BEF",r),!1})}static setGrayMode(t){ht.toggleClass(t,"grayMode",document.documentElement)}static toggleClass(t,e,o){const r=o||document.body;let{className:i}=r;i=i.replace(e,""),r.className=t?`${i} ${e} `:i}static setCssVar(t,e,o=document.documentElement){o.style.setProperty(t,e)}static dispatchWindowResize(){const t=new Event("resize");window.dispatchEvent(t)}static dispatchElementEvent(t,e="click",o){let r;if(r=me(t)?document.getElementById(t):t,r){const i=new Event(e,{bubbles:!0,cancelable:!0});o&&r.addEventListener("ev",s=>{o(s)},!1),r.dispatchEvent(i)}}static getRandomNum(t,e){var o=e-t,r=Math.random();return t+Math.round(r*o)}static merge(t={},e={}){let o,r,i,s;for(t||(t={}),r=0,i=e.length;r<i;r++)for(o in s=e[r],s)t[o]=s[o];return t}static setOptions(t,e){t.hasOwnProperty("options")||(t.options=t.options?Object.create(t.options):{});for(let o in e)t.options[o]=e[o];return t.options}static formatNum(t,e){let o=Math.pow(10,e===void 0?6:e);return Math.round(t*o)/o}static trim(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}static splitWords(t){return this.trim(t).split(/\s+/)}static emptyImageUrl(){return"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="}static debounce(t,e){let o=null;return function(){o&&clearTimeout(o),o=setTimeout(t,e)}}static throttle(t,e){let o=!0;return function(){if(!o)return!1;o=!1,setTimeout(()=>{t(),o=!0},e)}}static dataURLtoBlob(t){let e=t.split(",");if(!e||e.length===0)return;let o=e[0].match(/:(.*?);/)[1],r=atob(e[1]),i=r.length,s=new Uint8Array(i);for(;i--;)s[i]=r.charCodeAt(i);return new Blob([s],{type:o})}static getElement(t){return typeof t=="string"?document.getElementById(t):t}static getStyle(t,e){let o=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!o||o==="auto")&&document.defaultView){let r=document.defaultView.getComputedStyle(t,null);o=r?r[e]:null}return o==="auto"?null:o}static create(t,e,o){let r=document.createElement(t);return r.className=e||"",o&&o.appendChild(r),r}static removeElement(t){let e=t.parentNode;e&&e.removeChild(t)}static emptyElement(t){for(;t.firstChild;)t.removeChild(t.firstChild)}static hasClass(t,e){if(t.classList!==void 0)return t.classList.contains(e);let o=this.getClass(t);return o.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(o)}static addClass(t,e){if(t.classList!==void 0){let o=this.splitWords(e);for(let r=0,i=o.length;r<i;r++)t.classList.add(o[r])}else if(!this.hasClass(t,e)){let o=this.getClass(t);this.setClass(t,(o?o+" ":"")+e)}}static removeClass(t,e){t.classList!==void 0?t.classList.remove(e):this.setClass(t,this.trim((" "+this.getClass(t)+" ").replace(" "+e+" "," ")))}static setClass(t,e){t.className.baseVal===void 0?t.className=e:t.className.baseVal=e}static getClass(t){return t.correspondingElement&&(t=t.correspondingElement),t.className.baseVal===void 0?t.className:t.className.baseVal}static createSvgElement(t,e,o,r){let i=document.createElementNS("http://www.w3.org/2000/svg","svg:svg");i.setAttribute("class","svg-path"),i.setAttribute("width",t),i.setAttribute("height",e),i.setAttribute("viewBox",`0 0 ${t} ${e}`);let s=document.createElementNS("http://www.w3.org/2000/svg","path");return s.setAttribute("d",o),i.appendChild(s),r&&r.appendChild(i),i}static parseDom(t,e=!0,o=""){e=e??!1;let r=document.createElement("div");return r.className=o||"",r.innerHTML=t,e?r:r.childNodes}static createVideoHTML(t,e,o){let r=this.create("video",e,o),i=this.create("source","",r);i.setAttribute("src",t),i.setAttribute("type","video/map4");let s=this.create("source","",r);return s.setAttribute("src",t),s.setAttribute("type","video/quicktime"),r}}class ye{static isNullOrEmpty=t=>t===null||t===""||t===void 0||t.length===0;static isNotEmpty=t=>!(t===null||t===""||t===void 0||t.length===0);static toHump(t){return t.replace(/[\-\/\_](\w)/g,(e,o)=>o.toUpperCase()).replace("views","")}}class we{prefixKey;storage;constructor(t="",e=localStorage){this.prefixKey=t,this.storage=e}getKey(t){return`${this.prefixKey}${t}`.toUpperCase()}set(t,e,o=604800){const r=JSON.stringify({value:e,expire:o!==null?new Date().getTime()+1e3*o:null});this.storage.setItem(this.getKey(t),r)}get(t,e=null){const o=this.storage.getItem(this.getKey(t));if(o)try{const r=JSON.parse(o),{value:i,expire:s}=r;if(s===null||s>=Date.now())return i;this.remove(this.getKey(t))}catch{return e}return e}getJsonObject(t){const e=this.storage.getItem(this.getKey(t));if(e)try{const o=JSON.parse(e);if(o.expire===null||o.expire>=Date.now())return o;this.remove(this.getKey(t))}catch{return}}remove(t){this.storage.removeItem(this.getKey(t))}clear(){this.storage.clear()}setCookie(t,e,o=604800){document.cookie=`${this.getKey(t)}=${e}; Max-Age=${o}`}getCookie(t){const e=document.cookie.split("; ");for(let o=0,r=e.length;o<r;o++){const i=e[o].split("=");if(i[0]===this.getKey(t))return i[1]}return""}removeCookie(t){this.setCookie(t,1,-1)}clearCookie(){const t=document.cookie.match(/[^ =;]+(?==)/g);if(t)for(let e=t.length;e--;)document.cookie=t[e]+"=0;expire="+new Date(0).toUTCString()}}const ws=new we("",localStorage);function Po(){let n=[];const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(var e=0;e<36;e++){const r=Math.floor(16*Math.random());n[e]=t.substring(r,r+1)}n[14]="4";const o=3&Number(n[19])|8;return n[19]=t.substring(o,o+1),n[8]=n[13]=n[18]=n[23]="-",n.join("")}function bs(){var n=new Date().getTime(),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var o=(n+16*Math.random())%16|0;return n=Math.floor(n/16),(e==="x"?o:3&o|8).toString(16)});return t}function _s(n){const t=n.toLowerCase().replace(/rgb?a?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),e=parseFloat(t[3]||"1"),o=Math.floor(e*parseInt(t[0])+255*(1-e)),r=Math.floor(e*parseInt(t[1])+255*(1-e)),i=Math.floor(e*parseInt(t[2])+255*(1-e));return"#"+("0"+o.toString(16)).slice(-2)+("0"+r.toString(16)).slice(-2)+("0"+i.toString(16)).slice(-2)}function Ss(n){var t=n.toLowerCase();if(be(n)){if(t.length===4){for(var e="#",o=1;o<4;o+=1){const i=t.slice(o,o+1);e+=i.concat(i)}t=e}var r=[];for(o=1;o<7;o+=2)r.push(parseInt("0x"+t.slice(o,o+2)));return"rgb("+r.join(",")+")"}return t}function Cs(n){const t=n;if(t.length===4){let o="#";for(var e=1;e<4;e+=1){const r=t.slice(e,e+1);o+=r.concat(r)}return o}return t}var zt;function Es(n){if(typeof n=="object"||!n)return;const t=n.toLowerCase().substring(0,1);return t==="#"?zt.Hex:t==="r"||t==="("?zt.RGBA:t==="h"?zt.Hsla:zt.RGBA}function ks(n){if(n){var t=n.toLowerCase().match(/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i);if(t){var e,o,r,i=(parseFloat(t[1])%360+360)%360/360,s=parseFloat(t[2])/(/%$/.test(t[2])?100:1),c=parseFloat(t[3])/(/%$/.test(t[3])?100:1);if(s===0)e=o=r=c;else{var f=c<=.5?c*(s+1):c+s-c*s,g=2*c-f;e=dn(g,f,i+1/3),o=dn(g,f,i),r=dn(g,f,i-1/3)}return`rgba(${e=Math.round(255*e)},${o=Math.round(255*o)},${r=Math.round(255*r)},${t[4]?parseFloat(t[4]):1})`}}}function dn(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+6*(t-n)*e:e<.5?t:e<2/3?n+(t-n)*(2/3-e)*6:n}function be(n){return/^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/.test(n)}function xs(n,t,e){const o=(n<<16|t<<8|e).toString(16);return"#"+new Array(Math.abs(o.length-7)).join("0")+o}function fn(n){let t=n.toLowerCase();if(be(n)){if(t.length===4){let o="#";for(let r=1;r<4;r+=1)o+=t.slice(r,r+1).concat(t.slice(r,r+1));t=o}const e=[];for(let o=1;o<7;o+=2)e.push(parseInt("0x"+t.slice(o,o+2)));return"RGB("+e.join(",")+")"}return t}function Is(n){if(!be(n))return;const[t,e,o]=fn(n).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(r=>Number(r));return .299*t+.578*e+.114*o<192}function Ts(n,t){return n=n.indexOf("#")>=0?n.substring(1,n.length):n,t=Math.trunc(255*t/100),`#${gn(n.substring(0,2),t)}${gn(n.substring(2,4),t)}${gn(n.substring(4,6),t)}`}function Rs(n,t){return n=n.indexOf("#")>=0?n.substring(1,n.length):n,t=Math.trunc(255*t/100),`#${pn(n.substring(0,2),t)}${pn(n.substring(2,4),t)}${pn(n.substring(4,6),t)}`}function pn(n,t){const e=parseInt(n,16)+t,o=e>255?255:e;return o.toString(16).length>1?o.toString(16):`0${o.toString(16)}`}function Mo(n,t,e){const o=[n,t,e].map(r=>(r/=255)<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4));return .2126*o[0]+.7152*o[1]+.0722*o[2]}function Ps(n){return function(t,e){return(Mo(~~t[0],~~t[1],~~t[2])+.05)/(Mo(e[0],e[1],e[2])+.05)}(fn(n.substring(1)).split(","),[0,0,0])>=12?"#000000":"#FFFFFF"}function gn(n,t){const e=parseInt(n,16)-t,o=e<0?0:e;return o.toString(16).length>1?o.toString(16):`0${o.toString(16)}`}function mn(n){return{all:n=n||new Map,on(t,e){const o=n?.get(t);o&&o.push(e)||n?.set(t,[e])},off(t,e){const o=n?.get(t);o&&o.splice(o.indexOf(e)>>>0,1)},emit(t,e){(n?.get(t)||[]).slice().map(o=>{o(e)}),(n?.get("*")||[]).slice().map(o=>{o(t,e)})}}}(function(n){n[n.RGBA=0]="RGBA",n[n.Hex=1]="Hex",n[n.Hsla=2]="Hsla"})(zt||(zt={}));const At=mn(),st={HproseServiceErrorEvent:"HproseServiceError",WebAPIErrorEvent:"WebAPIError",AlertInfoEvent:"AlertInfoEvent",CommonWarnEvent:"CommonWarnEvent",WidgetLoadedEvent:"WidgetLoaded",WidgetLoaded:"WidgetLoaded",WidgetUnLoadedEvent:"WidgetUnLoaded",WidgetLoadedErrorEvent:"WidgetLoadedError",WidgetVisibleChanged:"WidgetVisibleChanged",AxiosRequestErrorEvent:"AxiosRequestErrorEvent",LayoutContainerLoaded:"LayoutContainerLoaded"},_e=(n,t)=>{const e=document.createElement("a");e.download=t,e.style.display="none";const o=new Blob([n],{type:"application/octet-stream"});e.href=URL.createObjectURL(o),document.body.appendChild(e),e.click(),document.body.removeChild(e)};function Ms(n,t){const e=window.URL||window.webkitURL||window,o=new Blob([n]),r=document.createElement("a");r.href=e.createObjectURL(o),r.download=t,r.click(),e.revokeObjectURL(r.href)}const zo=(n,t)=>{const e=JSON.stringify(n,null,2);t?_e(e,t+".json"):At.emit(st.CommonWarnEvent,"\u53C2\u6570JsonID\u4E0D\u80FD\u4E3A\u7A7A\uFF01")},zs=(n,t,e)=>{n.get(t,{responseType:"blob"}).then(function(o){_e(o.data,e)}).catch(o=>{console.warn(o),At.emit(st.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})};function Ao(n){const t=n.lastIndexOf("/")+1;let e=n.substring(t);return e=decodeURI(e.split("?")[0]),e}function As({url:n,target:t="_blank",fileName:e}){const o=new URL(n).host==location.host;return new Promise((r,i)=>{if(o){const s=document.createElement("a");if(s.href=n,s.target=t,s.download!==void 0&&(s.download=e||Ao(n)),document.createEvent){const c=document.createEvent("MouseEvents");return c.initEvent("click",!0,!0),s.dispatchEvent(c),r(!0)}return n.indexOf("?")===-1&&(n+="?download"),window.open(n,t),r(!0)}{const s=document.createElement("canvas"),c=document.createElement("img");c.setAttribute("crossOrigin","Anonymous"),c.src=n,c.onload=f=>{s.width=c.width,s.height=c.height,s.getContext("2d").drawImage(c,0,0,c.width,c.height),s.toBlob(g=>{if(g){const S=document.createElement("a");S.href=window.URL.createObjectURL(g),S.download=e??Ao(n),S.click(),URL.revokeObjectURL(S.href),r(!0)}})},c.onerror=f=>i(f)}})}function Ds(n){const t=new Date().getTime();let e=new Date().getTime();for(;e-t<n;)e=new Date().getTime();console.log(`\u5F3A\u5236\u7B49\u5F85${Do}\u6BEB\u79D2`)}function Do(n){return new Promise(t=>setTimeout(t,n))}var Lo,vn={exports:{}},$o,No,yn,wn=(Lo||(Lo=1,No=vn.exports,yn=function(){var n=function(){},t="undefined",e=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),o=["trace","debug","info","warn","error"],r={},i=null;function s(I,p){var l=I[p];if(typeof l.bind=="function")return l.bind(I);try{return Function.prototype.bind.call(l,I)}catch{return function(){return Function.prototype.apply.apply(l,[I,arguments])}}}function c(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function f(I){return I==="debug"&&(I="log"),typeof console!==t&&(I==="trace"&&e?c:console[I]!==void 0?s(console,I):console.log!==void 0?s(console,"log"):n)}function g(){for(var I=this.getLevel(),p=0;p<o.length;p++){var l=o[p];this[l]=p<I?n:this.methodFactory(l,I,this.name)}if(this.log=this.debug,typeof console===t&&I<this.levels.SILENT)return"No console available for logging"}function S(I){return function(){typeof console!==t&&(g.call(this),this[I].apply(this,arguments))}}function E(I,p,l){return f(I)||S.apply(this,arguments)}function L(I,p){var l,y,m,h=this,v="loglevel";function $(){var M;if(typeof window!==t&&v){try{M=window.localStorage[v]}catch{}if(typeof M===t)try{var N=window.document.cookie,U=encodeURIComponent(v),R=N.indexOf(U+"=");R!==-1&&(M=/^([^;]+)/.exec(N.slice(R+U.length+1))[1])}catch{}return h.levels[M]===void 0&&(M=void 0),M}}function z(M){var N=M;if(typeof N=="string"&&h.levels[N.toUpperCase()]!==void 0&&(N=h.levels[N.toUpperCase()]),typeof N=="number"&&N>=0&&N<=h.levels.SILENT)return N;throw new TypeError("log.setLevel() called with invalid level: "+M)}typeof I=="string"?v+=":"+I:typeof I=="symbol"&&(v=void 0),h.name=I,h.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},h.methodFactory=p||E,h.getLevel=function(){return m??y??l},h.setLevel=function(M,N){return m=z(M),N!==!1&&function(U){var R=(o[U]||"silent").toUpperCase();if(typeof window!==t&&v){try{return void(window.localStorage[v]=R)}catch{}try{window.document.cookie=encodeURIComponent(v)+"="+R+";"}catch{}}}(m),g.call(h)},h.setDefaultLevel=function(M){y=z(M),$()||h.setLevel(M,!1)},h.resetLevel=function(){m=null,function(){if(typeof window!==t&&v){try{window.localStorage.removeItem(v)}catch{}try{window.document.cookie=encodeURIComponent(v)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}(),g.call(h)},h.enableAll=function(M){h.setLevel(h.levels.TRACE,M)},h.disableAll=function(M){h.setLevel(h.levels.SILENT,M)},h.rebuild=function(){if(i!==h&&(l=z(i.getLevel())),g.call(h),i===h)for(var M in r)r[M].rebuild()},l=z(i?i.getLevel():"WARN");var A=$();A!=null&&(m=z(A)),g.call(h)}(i=new L).getLogger=function(I){if(typeof I!="symbol"&&typeof I!="string"||I==="")throw new TypeError("You must supply a name when creating a logger.");var p=r[I];return p||(p=r[I]=new L(I,i.methodFactory)),p};var O=typeof window!==t?window.log:void 0;return i.noConflict=function(){return typeof window!==t&&window.log===i&&(window.log=O),i},i.getLoggers=function(){return r},i.default=i,i},($o=vn).exports?$o.exports=yn():No.log=yn()),vn.exports);class Bo{message;eventBus;constructor(t,e){t&&(this.message=t),e&&(this.eventBus=e)}msg(t,e=3,o="success"){if(this.message)if(typeof this.message=="function")this.message({type:o,message:t,duration:e});else switch(o){case"info":this.message.info(t,e);break;case"success":this.message.success(t,e);break;case"warning":this.message.warn?this.message.warn(t,e):this.message.warning&&this.message.warning(t,e);break;case"error":this.message.error(t,e)}else{switch(o){case"info":case"success":console.log(t);break;case"warning":console.warn(t);break;case"error":o="dark",console.error(t)}this.eventBus&&this.eventBus.emit(st.AlertInfoEvent,{type:o,info:t})}}info(t,e=3){this.msg(t,e,"info")}warn(t,e=3){this.msg(t,e,"warning")}err(t,e=3){this.msg(t,e,"error")}success(t,e=3){this.msg(t,e,"success")}}let Wo=!1;const B={Config:SysConfig,EventBus:At,DefaultProxyClient:null,Axios:ji,Message:new Bo(void 0,At),LayoutMap:new Map,getLayoutManager:n=>{if(!B.WidgetConfigList||B.WidgetConfigList.length===0)return;const t=B.WidgetConfigList.find(e=>e.id===n);if(t){const e=t.layoutID;if(e&&B.LayoutMap.has(e))return B.LayoutMap.get(e)}},Logger:n=>{Wo||(import.meta.env?.DEV||SysConfig.UI.ProductLog?wn.enableAll():wn.setDefaultLevel("warn"),Wo=!0);const t=n||"default";return wn.getLogger(t)}},Uo="access_token",St=new we("user",localStorage);function Dt(){return St.get(Uo)}function bn(){St.remove(Uo)}function Oo(){return Dt()?.refresh}function _n(n,t,e,o="json",r){const i={baseURL:B.Config.ServiceURL.DefaultWebAPI,timeout:6e4,params:n,paramsSerializer:{serialize:function(s){return Hi.stringify(s,{indices:!1,arrayFormat:"repeat"})}},headers:{"Content-Type":"application/json",Authorization:"bearer "+Dt()?.token},responseType:o,cancelToken:r};if(e)for(let s in e)i.headers[s]=e[s];return B.SystemID&&(i.headers.sysid=B.SystemID,B.SystemGroup&&(i.headers.sysgroup=B.SystemGroup)),t&&(i.baseURL=t),i}function Ct(n,t,e,o,r="json",i,s){const c=_n(e,t,o,r,i);return s&&s>=2e4&&(c.timeout=s),B.Axios?.get(n,c).catch(function(f){Se(f,t,n,"Get")})}function Se(n,t,e,o="Get"){const r=`${t}${e}`;if(n&&n.response){let i=!1;const s=n.response.status;switch(s){case 400:n.message="\u9519\u8BEF\u8BF7\u6C42";break;case 401:n.message="\u672A\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55";break;case 403:n.message="\u62D2\u7EDD\u8BBF\u95EE";break;case 404:n.message="\u8BF7\u6C42\u9519\u8BEF,\u672A\u627E\u5230\u8BE5\u8D44\u6E90";break;case 405:n.message="\u8BF7\u6C42\u65B9\u6CD5\u672A\u5141\u8BB8";break;case 408:n.message="\u8BF7\u6C42\u8D85\u65F6";break;case 500:const f=n.response.data;if(f){const g=f.indexOf(":"),S=f.indexOf(`
2
+ `);if(g>0&&S-g>2){const E=f.substring(g+2,S);E.indexOf("System.Exception")>0?n.message="\u540E\u53F0\u670D\u52A1\u5185\u90E8\u51FA\u9519\uFF01":(i=!0,n.message=E)}else i=!0,n.message=f}else n.message="\u670D\u52A1\u5668\u7AEF\u51FA\u9519";break;case 501:n.message="\u7F51\u7EDC\u672A\u5B9E\u73B0";break;case 502:n.message="\u7F51\u7EDC\u9519\u8BEF";break;case 503:n.message="\u670D\u52A1\u4E0D\u53EF\u7528";break;case 504:n.message="\u7F51\u7EDC\u8D85\u65F6";break;case 505:n.message="http\u7248\u672C\u4E0D\u652F\u6301\u8BE5\u8BF7\u6C42";break;default:n.message=`\u8FDE\u63A5\u9519\u8BEF${n.response.status}`}let c={address:r,code:s,isExceptionInfo:i,message:n.message,result:n.response.data};if(B.EventBus.emit(st.AxiosRequestErrorEvent,c),i)throw new Error(n.message)}else{if(n?.message)throw new Error(n.message);console.error(n,"Http\u8BF7\u6C42\u9519\u8BEF!")}}function jo(n,t,e,o,r,i="json",s){const c=_n(o,t,r,i);s&&s>=2e4&&(c.timeout=s),c.headers["Content-Type"]="multipart/form-data";const f=function(g){let S=new FormData;return g&&Object.keys(g).forEach(E=>{if(!g)return;let L=g[E];L!=null&&(ln(L)?L.forEach(O=>{S.append(E,Fo(O))}):S.append(E,Fo(L)))}),S}(e);return B.Axios?.post(n,f,c).catch(function(g){Se(g,t,n,"Post")})}function Ho(n,t,e,o,r,i="json",s){const c=_n(o,t,r,i);return s&&s>=2e4&&(c.timeout=s),B.Axios?.post(n,e,c).catch(function(f){Se(f,t,n,"Post")})}function Ls(n,t){return Ct(n,void 0,t)}function $s(n,t){return jo(n,void 0,t)}function Ns(n,t){return B.Axios?.get(n,{params:t}).catch(function(e){Se(e,n,"","\u5916\u90E8Get")})}function Fo(n){return n instanceof Blob?n:n.toString()}var qo,Xo,Sn,Go,Cn,Vo,En,Ko,Yo,Ce={exports:{}};function Bs(){return Xo?qo:(Xo=1,n=typeof window<"u"?window:Ht!==void 0?Ht:typeof self<"u"?self:{},qo=n);var n}function Ws(){if(Go)return Sn;Go=1,Sn=function(t){if(!t)return!1;var e=n.call(t);return e==="[object Function]"||typeof t=="function"&&e!=="[object RegExp]"||typeof window<"u"&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)};var n=Object.prototype.toString;return Sn}function Us(){if(Vo)return Cn;Vo=1;var n=function(t){return t.replace(/^\s+|\s+$/g,"")};return Cn=function(t){if(!t)return{};for(var e,o={},r=n(t).split(`
3
+ `),i=0;i<r.length;i++){var s=r[i],c=s.indexOf(":"),f=n(s.slice(0,c)).toLowerCase(),g=n(s.slice(c+1));o[f]===void 0?o[f]=g:(e=o[f],Object.prototype.toString.call(e)==="[object Array]"?o[f].push(g):o[f]=[o[f],g])}return o},Cn}var Os=function(){if(Yo)return Ce.exports;Yo=1;var n=Bs(),t=Ws(),e=Us(),o=function(){if(Ko)return En;Ko=1,En=function(){for(var f={},g=0;g<arguments.length;g++){var S=arguments[g];for(var E in S)c.call(S,E)&&(f[E]=S[E])}return f};var c=Object.prototype.hasOwnProperty;return En}();function r(c,f,g){var S=c;return t(f)?(g=f,typeof c=="string"&&(S={uri:c})):S=o(f,{uri:c}),S.callback=g,S}function i(c,f,g){return s(f=r(c,f,g))}function s(c){if(c.callback===void 0)throw new Error("callback argument missing");var f=!1,g=function(M,N,U){f||(f=!0,c.callback(M,N,U))};function S(){var M=void 0;if(M=p.response?p.response:p.responseText||function(N){try{if(N.responseType==="document")return N.responseXML;var U=N.responseXML&&N.responseXML.documentElement.nodeName==="parsererror";if(N.responseType===""&&!U)return N.responseXML}catch{}return null}(p),z)try{M=JSON.parse(M)}catch{}return M}function E(M){return clearTimeout(l),M instanceof Error||(M=new Error(""+(M||"Unknown XMLHttpRequest Error"))),M.statusCode=0,g(M,A)}function L(){if(!I){var M;clearTimeout(l),M=c.useXDR&&p.status===void 0?200:p.status===1223?204:p.status;var N=A,U=null;return M!==0?(N={body:S(),statusCode:M,method:m,headers:{},url:y,rawRequest:p},p.getAllResponseHeaders&&(N.headers=e(p.getAllResponseHeaders()))):U=new Error("Internal XMLHttpRequest Error"),g(U,N,N.body)}}var O,I,p=c.xhr||null;p||(p=c.cors||c.useXDR?new i.XDomainRequest:new i.XMLHttpRequest);var l,y=p.url=c.uri||c.url,m=p.method=c.method||"GET",h=c.body||c.data,v=p.headers=c.headers||{},$=!!c.sync,z=!1,A={body:void 0,headers:{},statusCode:0,method:m,url:y,rawRequest:p};if("json"in c&&c.json!==!1&&(z=!0,v.accept||v.Accept||(v.Accept="application/json"),m!=="GET"&&m!=="HEAD"&&(v["content-type"]||v["Content-Type"]||(v["Content-Type"]="application/json"),h=JSON.stringify(c.json===!0?h:c.json))),p.onreadystatechange=function(){p.readyState===4&&setTimeout(L,0)},p.onload=L,p.onerror=E,p.onprogress=function(){},p.onabort=function(){I=!0},p.ontimeout=E,p.open(m,y,!$,c.username,c.password),$||(p.withCredentials=!!c.withCredentials),!$&&c.timeout>0&&(l=setTimeout(function(){if(!I){I=!0,p.abort("timeout");var M=new Error("XMLHttpRequest timeout");M.code="ETIMEDOUT",E(M)}},c.timeout)),p.setRequestHeader)for(O in v)v.hasOwnProperty(O)&&p.setRequestHeader(O,v[O]);else if(c.headers&&!function(M){for(var N in M)if(M.hasOwnProperty(N))return!1;return!0}(c.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in c&&(p.responseType=c.responseType),"beforeSend"in c&&typeof c.beforeSend=="function"&&c.beforeSend(p),p.send(h||null),p}return Ce.exports=i,Ce.exports.default=i,i.XMLHttpRequest=n.XMLHttpRequest||function(){},i.XDomainRequest="withCredentials"in new i.XMLHttpRequest?i.XMLHttpRequest:n.XDomainRequest,function(c,f){for(var g=0;g<c.length;g++)f(c[g])}(["get","put","post","patch","head","delete"],function(c){i[c==="delete"?"del":c]=function(f,g,S){return(g=r(f,g,S)).method=c.toUpperCase(),s(g)}}),Ce.exports}(),js=ve(Os);const Hs=[200,201,202,204,308],Fs=[408,502,503,504];class Jo{endpoint;file;headers;method;chunkSize;attempts;delayBeforeAttempt;md5;chunk;chunkCount;chunkByteSize;maxFileBytes;endpointValue;totalChunks;attemptCount;offline;paused;success;currentXhr;reader;eventTarget;fileName;constructor(t){this.endpoint=t.endpoint,this.file=t.file,this.fileName=encodeURI(this.file.name),this.headers=t.headers||{},this.method=t.method||"PUT",this.chunkSize=t.chunkSize||5120,this.attempts=t.attempts||5,this.delayBeforeAttempt=t.delayBeforeAttempt||1,this.md5=t.md5||"",this.maxFileBytes=1024*(t.maxFileSize||0),this.chunkCount=0,this.chunkByteSize=1024*this.chunkSize,this.totalChunks=Math.ceil(this.file.size/this.chunkByteSize),this.attemptCount=0,this.offline=!1,this.paused=!1,this.success=!1,this.reader=new FileReader,this.eventTarget=mn(),this.validateOptions(),this.getEndpoint().then(()=>this.sendChunks()),typeof window<"u"&&(window.addEventListener("online",()=>{this.offline&&(this.offline=!1,this.dispatch("online"),this.sendChunks())}),window.addEventListener("offline",()=>{this.offline=!0,this.dispatch("offline")}))}on(t,e){this.eventTarget.on(t,e)}abort(){this.pause(),this.currentXhr?.abort()}pause(){this.paused=!0}resume(){this.paused&&(this.paused=!1,this.sendChunks())}dispatch(t,e){this.eventTarget.emit(t,e)}validateOptions(){if(!this.endpoint||typeof this.endpoint!="function"&&typeof this.endpoint!="string")throw new TypeError("endpoint\u5FC5\u987B\u4E3A\uFF1A\u6587\u4EF6\u4E0A\u4F20URL\u5B57\u7B26\u4E32\uFF0C\u6216\u8FD4\u56DE\u5730\u5740\u7684\u51FD\u6570\uFF01");if(!(this.file instanceof File))throw new TypeError("file\u5FC5\u987B\u4E3A\u6587\u4EF6\u5BF9\u8C61");if(this.headers&&typeof this.headers!="object")throw new TypeError("\u6587\u4EF6\u5934\u5FC5\u987B\u4E3A\u5BF9\u8C61\u6216\u7A7A\uFF01");if(this.chunkSize&&(typeof this.chunkSize!="number"||this.chunkSize<=0||this.chunkSize%256!=0))throw new TypeError("chunkSize\u5FC5\u987B\u5927\u4E8E0,\u5E76\u662F256\u7684\u6574\u6570\u500D");if(this.maxFileBytes>0&&this.maxFileBytes<this.file.size)throw new Error(`\u6587\u4EF6\u5927\u5C0F\u8D85\u8FC7\u6700\u5927\u5141\u8BB8\u503C\uFF1A(${this.file.size} > ${this.maxFileBytes})`);if(this.attempts&&(typeof this.attempts!="number"||this.attempts<=0))throw new TypeError("\u91CD\u8BD5\u6B21\u6570\u5FC5\u987B\u4E3A\u6B63\u6570\uFF01");if(this.delayBeforeAttempt&&(typeof this.delayBeforeAttempt!="number"||this.delayBeforeAttempt<0))throw new TypeError("\u5EF6\u65F6\u91CD\u8BD5\u65F6\u95F4\u5FC5\u987B\u4E3A\u6B63\u6570\uFF01\u9ED8\u8BA4\u4E3A1")}getEndpoint(){return typeof this.endpoint=="string"?(this.endpointValue=this.endpoint,Promise.resolve(this.endpoint)):this.endpoint(this.file).then(t=>(this.endpointValue=t,this.endpointValue))}getChunk(){return new Promise(t=>{const e=this.totalChunks===1?this.file.size:this.chunkByteSize,o=e*this.chunkCount;this.reader.onload=()=>{this.reader.result!==null&&(this.chunk=new Blob([this.reader.result],{type:"application/octet-stream"})),t(()=>{})},this.reader.readAsArrayBuffer(this.file.slice(o,o+e))})}xhrPromise(t){const e=o=>{o.upload.onprogress=r=>{const i=100/this.totalChunks,s=i*this.file.size,c=i*this.chunkCount,f=r.loaded/(r.total??s)*i;this.dispatch("progress",Math.min(c+f,100))}};return new Promise((o,r)=>{this.currentXhr=js({...t,beforeSend:e},(i,s)=>(this.currentXhr=void 0,i?r(i):o(s)))})}sendChunk(){if(!this.chunk)return;const t=this.chunkCount*this.chunkByteSize,e=t+this.chunk.size-1,o={...this.headers,FileName:this.fileName,FileMD5:this.md5,"Content-Type":this.file.type,"Content-Range":`bytes ${t}-${e}/${this.file.size}`};if(this.dispatch("attempt",{chunkNumber:this.chunkCount,chunkSize:this.chunk.size}),this.endpointValue)return this.xhrPromise({headers:o,url:this.endpointValue,method:this.method,body:this.chunk});console.warn("\u6587\u4EF6\u4E0A\u4F20endpointValue\u4E0D\u80FD\u4E3A\u7A7A\uFF01"),this.dispatch("error",{message:"\u6587\u4EF6\u4E0A\u4F20endpointValue\u4E0D\u80FD\u4E3A\u7A7A\uFF01\u53D6\u6D88\u4E0A\u4F20\uFF01",chunk:this.chunkCount,attempts:this.attemptCount})}manageRetries(){if(this.attemptCount<this.attempts)return setTimeout(()=>this.sendChunks(),1e3*this.delayBeforeAttempt),void this.dispatch("attemptFailure",{message:`\u4E0A\u4F20\u5206\u7247\uFF1A${this.chunkCount}\u5931\u8D25\u3002\u8FD8\u4F1A\u518D\u5C1D\u8BD5 ${this.attempts-this.attemptCount}\u6B21\uFF01`,chunkNumber:this.chunkCount,attemptsLeft:this.attempts-this.attemptCount});this.dispatch("error",{message:`\u4E0A\u4F20\u5206\u7247\u9519\u8BEF\uFF1A ${this.chunkCount}\u3002\u505C\u6B62\u5C1D\u8BD5\uFF0C\u53D6\u6D88\u4E0A\u4F20\uFF01`,chunk:this.chunkCount,attempts:this.attemptCount})}sendChunks(){console.log(this.paused,this.offline,this.success,"sendChunks this.paused || this.offline || this.success"),!(this.paused||this.offline||this.success)&&this.getChunk().then(()=>this.sendChunk()).then(t=>{if(this.attemptCount=this.attemptCount+1,t!=null&&Hs.includes(t.statusCode)){this.dispatch("chunkSuccess",{chunk:this.chunkCount,attempts:this.attemptCount,response:t}),this.attemptCount=0,this.chunkCount=this.chunkCount+1,this.chunkCount<this.totalChunks?this.sendChunks():(this.success=!0,this.dispatch("success"));const e=this.chunkCount/this.totalChunks*this.file.size*100/this.file.size;this.dispatch("progress",e)}else if(t!=null&&Fs.includes(t.statusCode)){if(this.paused||this.offline)return;this.manageRetries()}else{if(this.paused||this.offline)return;console.log(`\u670D\u52A1\u5668\u9519\u8BEF:${t?.statusCode}\uFF0C\u505C\u6B62\u4E0A\u4F20\u3002`),this.dispatch("error",{message:`\u670D\u52A1\u5668\u9519\u8BEF:${t?.statusCode}\uFF0C\u505C\u6B62\u4E0A\u4F20\u3002`,chunkNumber:this.chunkCount,attempts:this.attemptCount})}}).catch(t=>{this.paused||this.offline||this.manageRetries()})}}const qs=n=>new Jo(n),Xs=new class{hasClass(n,t){return n.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}addClass(n,t){this.hasClass(n,t)||(n.className+=" "+t)}removeClass(n,t){if(this.hasClass(n,t)){const e=new RegExp("(\\s|^)"+t+"(\\s|$)");n.className=n.className.replace(e," ")}}toggleClass(n,t){this.hasClass(n,t)?this.removeClass(n,t):this.addClass(n,t)}setCSSProperty(n,t,e){n?.style.setProperty(t,e)}};class re{hproseURL;client;hproseProxy;static httpTransport;constructor(t){if(t&&!ye.isNullOrEmpty(t)){if(re.httpTransport||(re.httpTransport=new Gi),this.client=new Fi(t),!this.client)throw Error("Hprose Client\u521D\u59CB\u5316\u9519\u8BEF");this.hproseURL=t,this.init()}}init(){this.client&&this.client.useServiceAsync().then(t=>{this.hproseProxy=t}).catch(t=>{String(t).indexOf("find this method ~")>0?(this.hproseProxy=this.client?.useService(),console.warn("\u65E7\u7248\u672C\u4E0D\u652F\u6301useServiceAsync")):At.emit(st.HproseServiceErrorEvent,"\u521D\u59CB\u5316\u9ED8\u8BA4Hprose!"),console.warn(t)})}async getProxy(){if(!this.hproseProxy)try{this.client&&(this.hproseProxy=await this.client.useServiceAsync())}catch(t){console.warn(t),this.hproseProxy=this.client?.useService()}return this.hproseProxy}async invoke(t,e,o){if(this.client)return await this.client.invoke(t,e,o)}encode(t,e,o){if(this.client)return this.client.codec.encode(t,e,o)}decode(t,e){if(this.client)return this.client.codec.decode(t,e)}}class Vt{hproseClient;hpProxyObj;defaultContext=new tn;constructor(t){this.hproseClient=new re(t),this.hpProxyObj=null}getClientContext(t,e){const o={};e&&(o.requestHeaders=e);const r=Dt();o.httpRequestHeaders=t||{};const i=o.httpRequestHeaders;return r&&(i.token=r.token),B.SystemID&&(i.sysid=B.SystemID,B.SystemGroup&&(i.sysgroup=B.SystemGroup)),new tn(o)}async getHproseProxy(){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");if(!this.hpProxyObj){const t=await this.hproseClient.getProxy();this.hpProxyObj=t}return this.hpProxyObj||At.emit(st.HproseServiceErrorEvent,"HproseProxy\u5BF9\u8C61\u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5\uFF01"),this.hpProxyObj}async hproseInvoke(t,e,o){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");return await this.hproseClient.invoke(t,e,o)}async hproseInvokeContext(t,e,...o){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");const r=Dt();return console.log(r,"userToken3"),r&&(e||(e=new tn({httpRequestHeaders:{token:r.token}}))),await this.hproseClient.invoke(t,o,e)}async hproseInvokeEncode(t){const e=new ue(t).toBytes(),o=await this.hproseClient.client?.request(e,this.defaultContext);return o&&this.hproseClient.client?.codec.decode(o,this.defaultContext)}encodeRequest(t,...e){const o=this.hproseClient.client?.codec?.encode(t,e,this.defaultContext);return ue.toString(o)}}const kn=new Map,Gs=function(n,t,e){!B.Config.DefaultHproseAPI&&B.Config.ServiceURL&&(B.Config.DefaultHproseAPI=B.Config.ServiceURL.DefaultHproseAPI),B.Config.DefaultHproseAPI&&ye.isNotEmpty(B.Config.DefaultHproseAPI)&&(B.DefaultProxyClient=new Vt(B.Config.DefaultHproseAPI));const o=B.Config.UI.GrayMode;o&&ht.setGrayMode(o);const r=new Bo(n,B.EventBus);B.Message=r,B.SystemID=t,B.SystemGroup=e,B.EventBus.on(st.HproseServiceErrorEvent,i=>{const s=`\u5F53\u524D\u540E\u53F0\u4E1A\u52A1\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("Hprose\u8BF7\u6C42\u9519\u8BEF",s)}),B.EventBus.on(st.WebAPIErrorEvent,i=>{const s=`WebAPI\u540E\u53F0\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("WebAPI\u8BF7\u6C42\u9519\u8BEF",s)}),B.EventBus.on(st.AxiosRequestErrorEvent,i=>{const s=`Http\u8BF7\u6C42'${i.code}'\u9519\u8BEF: ${i.message}`;console.warn("Http\u8BF7\u6C42\u9519\u8BEF",s)}),B.EventBus.on(st.CommonWarnEvent,i=>{r.warn(i)})};function Zo(n){if(n&&ye.isNotEmpty(n)){if(kn.has(n))return kn.get(n);{const t=new Vt(n);return kn.set(n,t),t}}}function Vs(n){const t=Zo(n);return t&&(B.DefaultProxyClient=t),t}const xn="is_LockScreen",Qo=St.get(xn,!1),Kt={isLock:Qo,lockTime:Qo=="true"?er():0};function tr(n){Kt.isLock=n,St.set(xn,n,10),n&&(bn(),console.log("\u9501\u5C4F\u4E86\u2026\u2026"))}function Ks(){return St.get(xn,!1)}function er(){let n=3600;return B.Config.UI?.LockTime&&B.Config.UI?.LockTime>=10&&(n=B.Config.UI.LockTime),n}let In;function Tn(){clearInterval(In),!(window.location.href.indexOf("/login")>0||Kt.isLock)&&(tr(!1),Kt.lockTime=er(),In=setInterval(()=>{if(Kt.lockTime--,Kt.lockTime<=0)return tr(!0),clearInterval(In)},1e3))}function Ys(){Tn(),document.addEventListener("mousedown",Tn)}function Js(){document.removeEventListener("mousedown",Tn)}function Rn(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var nr,or={exports:{}};/*!
4
4
  localForage -- Offline Storage, Improved
5
5
  Version 1.10.0
6
6
  https://localforage.github.io/localForage
7
7
  (c) 2013-2017 Mozilla, Apache License 2.0
8
- */var Hr,Ya=Ur?Fr.exports:(Ur=1,Fr.exports=function e(t,n,o){function r(a,l){if(!n[a]){if(!t[a]){if(!l&&Qn)return Qn(a);if(i)return i(a,!0);var h=new Error("Cannot find module '"+a+"'");throw h.code="MODULE_NOT_FOUND",h}var w=n[a]={exports:{}};t[a][0].call(w.exports,function(_){var k=t[a][1][_];return r(k||_)},w,w.exports,e,t,n,o)}return n[a].exports}for(var i=Qn,s=0;s<o.length;s++)r(o[s]);return r}({1:[function(e,t,n){(function(o){var r,i,s=o.MutationObserver||o.WebKitMutationObserver;if(s){var a=0,l=new s(k),h=o.document.createTextNode("");l.observe(h,{characterData:!0}),r=function(){h.data=a=++a%2}}else if(o.setImmediate||o.MessageChannel===void 0)r="document"in o&&"onreadystatechange"in o.document.createElement("script")?function(){var I=o.document.createElement("script");I.onreadystatechange=function(){k(),I.onreadystatechange=null,I.parentNode.removeChild(I),I=null},o.document.documentElement.appendChild(I)}:function(){setTimeout(k,0)};else{var w=new o.MessageChannel;w.port1.onmessage=k,r=function(){w.port2.postMessage(0)}}var _=[];function k(){var I,p;i=!0;for(var u=_.length;u;){for(p=_,_=[],I=-1;++I<u;)p[I]();u=_.length}i=!1}function $(I){_.push(I)!==1||i||r()}t.exports=$}).call(this,Gt!==void 0?Gt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(e,t,n){var o=e(1);function r(){}var i={},s=["REJECTED"],a=["FULFILLED"],l=["PENDING"];function h(d){if(typeof d!="function")throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,d!==r&&$(this,d)}function w(d,f,z){this.promise=d,typeof f=="function"&&(this.onFulfilled=f,this.callFulfilled=this.otherCallFulfilled),typeof z=="function"&&(this.onRejected=z,this.callRejected=this.otherCallRejected)}function _(d,f,z){o(function(){var L;try{L=f(z)}catch(D){return i.reject(d,D)}L===d?i.reject(d,new TypeError("Cannot resolve promise with itself")):i.resolve(d,L)})}function k(d){var f=d&&d.then;if(d&&(typeof d=="object"||typeof d=="function")&&typeof f=="function")return function(){f.apply(d,arguments)}}function $(d,f){var z=!1;function L(O){z||(z=!0,i.reject(d,O))}function D(O){z||(z=!0,i.resolve(d,O))}function M(){f(D,L)}var N=I(M);N.status==="error"&&L(N.value)}function I(d,f){var z={};try{z.value=d(f),z.status="success"}catch(L){z.status="error",z.value=L}return z}function p(d){return d instanceof this?d:i.resolve(new this(r),d)}function u(d){var f=new this(r);return i.reject(f,d)}function v(d){var f=this;if(Object.prototype.toString.call(d)!=="[object Array]")return this.reject(new TypeError("must be an array"));var z=d.length,L=!1;if(!z)return this.resolve([]);for(var D=new Array(z),M=0,N=-1,O=new this(r);++N<z;)T(d[N],N);return O;function T(W,q){function it(Z){D[q]=Z,++M!==z||L||(L=!0,i.resolve(O,D))}f.resolve(W).then(it,function(Z){L||(L=!0,i.reject(O,Z))})}}function y(d){var f=this;if(Object.prototype.toString.call(d)!=="[object Array]")return this.reject(new TypeError("must be an array"));var z=d.length,L=!1;if(!z)return this.resolve([]);for(var D=-1,M=new this(r);++D<z;)N(d[D]);return M;function N(O){f.resolve(O).then(function(T){L||(L=!0,i.resolve(M,T))},function(T){L||(L=!0,i.reject(M,T))})}}t.exports=h,h.prototype.catch=function(d){return this.then(null,d)},h.prototype.then=function(d,f){if(typeof d!="function"&&this.state===a||typeof f!="function"&&this.state===s)return this;var z=new this.constructor(r);return this.state!==l?_(z,this.state===a?d:f,this.outcome):this.queue.push(new w(z,d,f)),z},w.prototype.callFulfilled=function(d){i.resolve(this.promise,d)},w.prototype.otherCallFulfilled=function(d){_(this.promise,this.onFulfilled,d)},w.prototype.callRejected=function(d){i.reject(this.promise,d)},w.prototype.otherCallRejected=function(d){_(this.promise,this.onRejected,d)},i.resolve=function(d,f){var z=I(k,f);if(z.status==="error")return i.reject(d,z.value);var L=z.value;if(L)$(d,L);else{d.state=a,d.outcome=f;for(var D=-1,M=d.queue.length;++D<M;)d.queue[D].callFulfilled(f)}return d},i.reject=function(d,f){d.state=s,d.outcome=f;for(var z=-1,L=d.queue.length;++z<L;)d.queue[z].callRejected(f);return d},h.resolve=p,h.reject=u,h.all=v,h.race=y},{1:1}],3:[function(e,t,n){(function(o){typeof o.Promise!="function"&&(o.Promise=e(2))}).call(this,Gt!==void 0?Gt:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(e,t,n){var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c};function r(c,g){if(!(c instanceof g))throw new TypeError("Cannot call a class as a function")}function i(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var s=i();function a(){try{if(!s||!s.open)return!1;var c=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),g=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!c||g)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function l(c,g){c=c||[],g=g||{};try{return new Blob(c,g)}catch(b){if(b.name!=="TypeError")throw b;for(var m=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),S=0;S<c.length;S+=1)m.append(c[S]);return m.getBlob(g.type)}}typeof Promise>"u"&&e(3);var h=Promise;function w(c,g){g&&c.then(function(m){g(null,m)},function(m){g(m)})}function _(c,g,m){typeof g=="function"&&c.then(g),typeof m=="function"&&c.catch(m)}function k(c){return typeof c!="string"&&(console.warn(c+" used as a key, but it is not a string."),c=String(c)),c}function $(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var I="local-forage-detect-blob-support",p=void 0,u={},v=Object.prototype.toString,y="readonly",d="readwrite";function f(c){for(var g=c.length,m=new ArrayBuffer(g),S=new Uint8Array(m),b=0;b<g;b++)S[b]=c.charCodeAt(b);return m}function z(c){return new h(function(g){var m=c.transaction(I,d),S=l([""]);m.objectStore(I).put(S,"key"),m.onabort=function(b){b.preventDefault(),b.stopPropagation(),g(!1)},m.oncomplete=function(){var b=navigator.userAgent.match(/Chrome\/(\d+)/),C=navigator.userAgent.match(/Edge\//);g(C||!b||parseInt(b[1],10)>=43)}}).catch(function(){return!1})}function L(c){return typeof p=="boolean"?h.resolve(p):z(c).then(function(g){return p=g})}function D(c){var g=u[c.name],m={};m.promise=new h(function(S,b){m.resolve=S,m.reject=b}),g.deferredOperations.push(m),g.dbReady?g.dbReady=g.dbReady.then(function(){return m.promise}):g.dbReady=m.promise}function M(c){var g=u[c.name].deferredOperations.pop();if(g)return g.resolve(),g.promise}function N(c,g){var m=u[c.name].deferredOperations.pop();if(m)return m.reject(g),m.promise}function O(c,g){return new h(function(m,S){if(u[c.name]=u[c.name]||St(),c.db){if(!g)return m(c.db);D(c),c.db.close()}var b=[c.name];g&&b.push(c.version);var C=s.open.apply(s,b);g&&(C.onupgradeneeded=function(E){var R=C.result;try{R.createObjectStore(c.storeName),E.oldVersion<=1&&R.createObjectStore(I)}catch(P){if(P.name!=="ConstraintError")throw P;console.warn('The database "'+c.name+'" has been upgraded from version '+E.oldVersion+" to version "+E.newVersion+', but the storage "'+c.storeName+'" already exists.')}}),C.onerror=function(E){E.preventDefault(),S(C.error)},C.onsuccess=function(){var E=C.result;E.onversionchange=function(R){R.target.close()},m(E),M(c)}})}function T(c){return O(c,!1)}function W(c){return O(c,!0)}function q(c,g){if(!c.db)return!0;var m=!c.db.objectStoreNames.contains(c.storeName),S=c.version<c.db.version,b=c.version>c.db.version;if(S&&(c.version!==g&&console.warn('The database "'+c.name+`" can't be downgraded from version `+c.db.version+" to version "+c.version+"."),c.version=c.db.version),b||m){if(m){var C=c.db.version+1;C>c.version&&(c.version=C)}return!0}return!1}function it(c){return new h(function(g,m){var S=new FileReader;S.onerror=m,S.onloadend=function(b){var C=btoa(b.target.result||"");g({__local_forage_encoded_blob:!0,data:C,type:c.type})},S.readAsBinaryString(c)})}function Z(c){return l([f(atob(c.data))],{type:c.type})}function Q(c){return c&&c.__local_forage_encoded_blob}function _t(c){var g=this,m=g._initReady().then(function(){var S=u[g._dbInfo.name];if(S&&S.dbReady)return S.dbReady});return _(m,c,c),m}function Ht(c){D(c);for(var g=u[c.name],m=g.forages,S=0;S<m.length;S++){var b=m[S];b._dbInfo.db&&(b._dbInfo.db.close(),b._dbInfo.db=null)}return c.db=null,T(c).then(function(C){return c.db=C,q(c)?W(c):C}).then(function(C){c.db=g.db=C;for(var E=0;E<m.length;E++)m[E]._dbInfo.db=C}).catch(function(C){throw N(c,C),C})}function et(c,g,m,S){S===void 0&&(S=1);try{var b=c.db.transaction(c.storeName,g);m(null,b)}catch(C){if(S>0&&(!c.db||C.name==="InvalidStateError"||C.name==="NotFoundError"))return h.resolve().then(function(){if(!c.db||C.name==="NotFoundError"&&!c.db.objectStoreNames.contains(c.storeName)&&c.version<=c.db.version)return c.db&&(c.version=c.db.version+1),W(c)}).then(function(){return Ht(c).then(function(){et(c,g,m,S-1)})}).catch(m);m(C)}}function St(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function ln(c){var g=this,m={db:null};if(c)for(var S in c)m[S]=c[S];var b=u[m.name];b||(b=St(),u[m.name]=b),b.forages.push(g),g._initReady||(g._initReady=g.ready,g.ready=_t);var C=[];function E(){return h.resolve()}for(var R=0;R<b.forages.length;R++){var P=b.forages[R];P!==g&&C.push(P._initReady().catch(E))}var A=b.forages.slice(0);return h.all(C).then(function(){return m.db=b.db,T(m)}).then(function(B){return m.db=B,q(m,g._defaultConfig.version)?W(m):B}).then(function(B){m.db=b.db=B,g._dbInfo=m;for(var U=0;U<A.length;U++){var H=A[U];H!==g&&(H._dbInfo.db=m.db,H._dbInfo.version=m.version)}})}function un(c,g){var m=this;c=k(c);var S=new h(function(b,C){m.ready().then(function(){et(m._dbInfo,y,function(E,R){if(E)return C(E);try{var P=R.objectStore(m._dbInfo.storeName).get(c);P.onsuccess=function(){var A=P.result;A===void 0&&(A=null),Q(A)&&(A=Z(A)),b(A)},P.onerror=function(){C(P.error)}}catch(A){C(A)}})}).catch(C)});return w(S,g),S}function hn(c,g){var m=this,S=new h(function(b,C){m.ready().then(function(){et(m._dbInfo,y,function(E,R){if(E)return C(E);try{var P=R.objectStore(m._dbInfo.storeName).openCursor(),A=1;P.onsuccess=function(){var B=P.result;if(B){var U=B.value;Q(U)&&(U=Z(U));var H=c(U,B.key,A++);H!==void 0?b(H):B.continue()}else b()},P.onerror=function(){C(P.error)}}catch(B){C(B)}})}).catch(C)});return w(S,g),S}function me(c,g,m){var S=this;c=k(c);var b=new h(function(C,E){var R;S.ready().then(function(){return R=S._dbInfo,v.call(g)==="[object Blob]"?L(R.db).then(function(P){return P?g:it(g)}):g}).then(function(P){et(S._dbInfo,d,function(A,B){if(A)return E(A);try{var U=B.objectStore(S._dbInfo.storeName);P===null&&(P=void 0);var H=U.put(P,c);B.oncomplete=function(){P===void 0&&(P=null),C(P)},B.onabort=B.onerror=function(){var V=H.error?H.error:H.transaction.error;E(V)}}catch(V){E(V)}})}).catch(E)});return w(b,m),b}function Zt(c,g){var m=this;c=k(c);var S=new h(function(b,C){m.ready().then(function(){et(m._dbInfo,d,function(E,R){if(E)return C(E);try{var P=R.objectStore(m._dbInfo.storeName).delete(c);R.oncomplete=function(){b()},R.onerror=function(){C(P.error)},R.onabort=function(){var A=P.error?P.error:P.transaction.error;C(A)}}catch(A){C(A)}})}).catch(C)});return w(S,g),S}function Qt(c){var g=this,m=new h(function(S,b){g.ready().then(function(){et(g._dbInfo,d,function(C,E){if(C)return b(C);try{var R=E.objectStore(g._dbInfo.storeName).clear();E.oncomplete=function(){S()},E.onabort=E.onerror=function(){var P=R.error?R.error:R.transaction.error;b(P)}}catch(P){b(P)}})}).catch(b)});return w(m,c),m}function yt(c){var g=this,m=new h(function(S,b){g.ready().then(function(){et(g._dbInfo,y,function(C,E){if(C)return b(C);try{var R=E.objectStore(g._dbInfo.storeName).count();R.onsuccess=function(){S(R.result)},R.onerror=function(){b(R.error)}}catch(P){b(P)}})}).catch(b)});return w(m,c),m}function ve(c,g){var m=this,S=new h(function(b,C){c<0?b(null):m.ready().then(function(){et(m._dbInfo,y,function(E,R){if(E)return C(E);try{var P=R.objectStore(m._dbInfo.storeName),A=!1,B=P.openKeyCursor();B.onsuccess=function(){var U=B.result;U?c===0||A?b(U.key):(A=!0,U.advance(c)):b(null)},B.onerror=function(){C(B.error)}}catch(U){C(U)}})}).catch(C)});return w(S,g),S}function ye(c){var g=this,m=new h(function(S,b){g.ready().then(function(){et(g._dbInfo,y,function(C,E){if(C)return b(C);try{var R=E.objectStore(g._dbInfo.storeName).openKeyCursor(),P=[];R.onsuccess=function(){var A=R.result;A?(P.push(A.key),A.continue()):S(P)},R.onerror=function(){b(R.error)}}catch(A){b(A)}})}).catch(b)});return w(m,c),m}function te(c,g){g=$.apply(this,arguments);var m=this.config();(c=typeof c!="function"&&c||{}).name||(c.name=c.name||m.name,c.storeName=c.storeName||m.storeName);var S,b=this;if(c.name){var C=c.name===m.name&&b._dbInfo.db?h.resolve(b._dbInfo.db):T(c).then(function(E){var R=u[c.name],P=R.forages;R.db=E;for(var A=0;A<P.length;A++)P[A]._dbInfo.db=E;return E});S=c.storeName?C.then(function(E){if(E.objectStoreNames.contains(c.storeName)){var R=E.version+1;D(c);var P=u[c.name],A=P.forages;E.close();for(var B=0;B<A.length;B++){var U=A[B];U._dbInfo.db=null,U._dbInfo.version=R}var H=new h(function(V,G){var at=s.open(c.name,R);at.onerror=function(xt){at.result.close(),G(xt)},at.onupgradeneeded=function(){at.result.deleteObjectStore(c.storeName)},at.onsuccess=function(){var xt=at.result;xt.close(),V(xt)}});return H.then(function(V){P.db=V;for(var G=0;G<A.length;G++){var at=A[G];at._dbInfo.db=V,M(at._dbInfo)}}).catch(function(V){throw(N(c,V)||h.resolve()).catch(function(){}),V})}}):C.then(function(E){D(c);var R=u[c.name],P=R.forages;E.close();for(var A=0;A<P.length;A++)P[A]._dbInfo.db=null;var B=new h(function(U,H){var V=s.deleteDatabase(c.name);V.onerror=function(){var G=V.result;G&&G.close(),H(V.error)},V.onblocked=function(){console.warn('dropInstance blocked for database "'+c.name+'" until all open connections are closed')},V.onsuccess=function(){var G=V.result;G&&G.close(),U(G)}});return B.then(function(U){R.db=U;for(var H=0;H<P.length;H++)M(P[H]._dbInfo)}).catch(function(U){throw(N(c,U)||h.resolve()).catch(function(){}),U})})}else S=h.reject("Invalid arguments");return w(S,g),S}var we={_driver:"asyncStorage",_initStorage:ln,_support:a(),iterate:hn,getItem:un,setItem:me,removeItem:Zt,clear:Qt,length:yt,key:ve,keys:ye,dropInstance:te};function ee(){return typeof openDatabase=="function"}var wt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Gi="~~local_forage_type~",Bo=/^~~local_forage_type~([^~]+)~/,be="__lfsc__:",dn=be.length,fn="arbf",pn="blob",jo="si08",Oo="ui08",Wo="uic8",Uo="si16",Fo="si32",Ho="ur16",qo="ui32",Xo="fl32",Vo="fl64",Go=dn+fn.length,Ko=Object.prototype.toString;function Jo(c){var g,m,S,b,C,E=.75*c.length,R=c.length,P=0;c[c.length-1]==="="&&(E--,c[c.length-2]==="="&&E--);var A=new ArrayBuffer(E),B=new Uint8Array(A);for(g=0;g<R;g+=4)m=wt.indexOf(c[g]),S=wt.indexOf(c[g+1]),b=wt.indexOf(c[g+2]),C=wt.indexOf(c[g+3]),B[P++]=m<<2|S>>4,B[P++]=(15&S)<<4|b>>2,B[P++]=(3&b)<<6|63&C;return A}function gn(c){var g,m=new Uint8Array(c),S="";for(g=0;g<m.length;g+=3)S+=wt[m[g]>>2],S+=wt[(3&m[g])<<4|m[g+1]>>4],S+=wt[(15&m[g+1])<<2|m[g+2]>>6],S+=wt[63&m[g+2]];return m.length%3==2?S=S.substring(0,S.length-1)+"=":m.length%3==1&&(S=S.substring(0,S.length-2)+"=="),S}function Ki(c,g){var m="";if(c&&(m=Ko.call(c)),c&&(m==="[object ArrayBuffer]"||c.buffer&&Ko.call(c.buffer)==="[object ArrayBuffer]")){var S,b=be;c instanceof ArrayBuffer?(S=c,b+=fn):(S=c.buffer,m==="[object Int8Array]"?b+=jo:m==="[object Uint8Array]"?b+=Oo:m==="[object Uint8ClampedArray]"?b+=Wo:m==="[object Int16Array]"?b+=Uo:m==="[object Uint16Array]"?b+=Ho:m==="[object Int32Array]"?b+=Fo:m==="[object Uint32Array]"?b+=qo:m==="[object Float32Array]"?b+=Xo:m==="[object Float64Array]"?b+=Vo:g(new Error("Failed to get type for BinaryArray"))),g(b+gn(S))}else if(m==="[object Blob]"){var C=new FileReader;C.onload=function(){var E=Gi+c.type+"~"+gn(this.result);g(be+pn+E)},C.readAsArrayBuffer(c)}else try{g(JSON.stringify(c))}catch(E){console.error("Couldn't convert value into a JSON string: ",c),g(null,E)}}function Ji(c){if(c.substring(0,dn)!==be)return JSON.parse(c);var g,m=c.substring(Go),S=c.substring(dn,Go);if(S===pn&&Bo.test(m)){var b=m.match(Bo);g=b[1],m=m.substring(b[0].length)}var C=Jo(m);switch(S){case fn:return C;case pn:return l([C],{type:g});case jo:return new Int8Array(C);case Oo:return new Uint8Array(C);case Wo:return new Uint8ClampedArray(C);case Uo:return new Int16Array(C);case Ho:return new Uint16Array(C);case Fo:return new Int32Array(C);case qo:return new Uint32Array(C);case Xo:return new Float32Array(C);case Vo:return new Float64Array(C);default:throw new Error("Unkown type: "+S)}}var mn={serialize:Ki,deserialize:Ji,stringToBuffer:Jo,bufferToString:gn};function Yo(c,g,m,S){c.executeSql("CREATE TABLE IF NOT EXISTS "+g.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],m,S)}function Yi(c){var g=this,m={db:null};if(c)for(var S in c)m[S]=typeof c[S]!="string"?c[S].toString():c[S];var b=new h(function(C,E){try{m.db=openDatabase(m.name,String(m.version),m.description,m.size)}catch(R){return E(R)}m.db.transaction(function(R){Yo(R,m,function(){g._dbInfo=m,C()},function(P,A){E(A)})},E)});return m.serializer=mn,b}function Tt(c,g,m,S,b,C){c.executeSql(m,S,b,function(E,R){R.code===R.SYNTAX_ERR?E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[g.storeName],function(P,A){A.rows.length?C(P,R):Yo(P,g,function(){P.executeSql(m,S,b,C)},C)},C):C(E,R)},C)}function Zi(c,g){var m=this;c=k(c);var S=new h(function(b,C){m.ready().then(function(){var E=m._dbInfo;E.db.transaction(function(R){Tt(R,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[c],function(P,A){var B=A.rows.length?A.rows.item(0).value:null;B&&(B=E.serializer.deserialize(B)),b(B)},function(P,A){C(A)})})}).catch(C)});return w(S,g),S}function Qi(c,g){var m=this,S=new h(function(b,C){m.ready().then(function(){var E=m._dbInfo;E.db.transaction(function(R){Tt(R,E,"SELECT * FROM "+E.storeName,[],function(P,A){for(var B=A.rows,U=B.length,H=0;H<U;H++){var V=B.item(H),G=V.value;if(G&&(G=E.serializer.deserialize(G)),(G=c(G,V.key,H+1))!==void 0)return void b(G)}b()},function(P,A){C(A)})})}).catch(C)});return w(S,g),S}function Zo(c,g,m,S){var b=this;c=k(c);var C=new h(function(E,R){b.ready().then(function(){g===void 0&&(g=null);var P=g,A=b._dbInfo;A.serializer.serialize(g,function(B,U){U?R(U):A.db.transaction(function(H){Tt(H,A,"INSERT OR REPLACE INTO "+A.storeName+" (key, value) VALUES (?, ?)",[c,B],function(){E(P)},function(V,G){R(G)})},function(H){if(H.code===H.QUOTA_ERR){if(S>0)return void E(Zo.apply(b,[c,P,m,S-1]));R(H)}})})}).catch(R)});return w(C,m),C}function ts(c,g,m){return Zo.apply(this,[c,g,m,1])}function es(c,g){var m=this;c=k(c);var S=new h(function(b,C){m.ready().then(function(){var E=m._dbInfo;E.db.transaction(function(R){Tt(R,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[c],function(){b()},function(P,A){C(A)})})}).catch(C)});return w(S,g),S}function ns(c){var g=this,m=new h(function(S,b){g.ready().then(function(){var C=g._dbInfo;C.db.transaction(function(E){Tt(E,C,"DELETE FROM "+C.storeName,[],function(){S()},function(R,P){b(P)})})}).catch(b)});return w(m,c),m}function os(c){var g=this,m=new h(function(S,b){g.ready().then(function(){var C=g._dbInfo;C.db.transaction(function(E){Tt(E,C,"SELECT COUNT(key) as c FROM "+C.storeName,[],function(R,P){var A=P.rows.item(0).c;S(A)},function(R,P){b(P)})})}).catch(b)});return w(m,c),m}function rs(c,g){var m=this,S=new h(function(b,C){m.ready().then(function(){var E=m._dbInfo;E.db.transaction(function(R){Tt(R,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[c+1],function(P,A){var B=A.rows.length?A.rows.item(0).key:null;b(B)},function(P,A){C(A)})})}).catch(C)});return w(S,g),S}function is(c){var g=this,m=new h(function(S,b){g.ready().then(function(){var C=g._dbInfo;C.db.transaction(function(E){Tt(E,C,"SELECT key FROM "+C.storeName,[],function(R,P){for(var A=[],B=0;B<P.rows.length;B++)A.push(P.rows.item(B).key);S(A)},function(R,P){b(P)})})}).catch(b)});return w(m,c),m}function ss(c){return new h(function(g,m){c.transaction(function(S){S.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(b,C){for(var E=[],R=0;R<C.rows.length;R++)E.push(C.rows.item(R).name);g({db:c,storeNames:E})},function(b,C){m(C)})},function(S){m(S)})})}function as(c,g){g=$.apply(this,arguments);var m=this.config();(c=typeof c!="function"&&c||{}).name||(c.name=c.name||m.name,c.storeName=c.storeName||m.storeName);var S,b=this;return S=c.name?new h(function(C){var E;E=c.name===m.name?b._dbInfo.db:openDatabase(c.name,"","",0),c.storeName?C({db:E,storeNames:[c.storeName]}):C(ss(E))}).then(function(C){return new h(function(E,R){C.db.transaction(function(P){function A(V){return new h(function(G,at){P.executeSql("DROP TABLE IF EXISTS "+V,[],function(){G()},function(xt,wn){at(wn)})})}for(var B=[],U=0,H=C.storeNames.length;U<H;U++)B.push(A(C.storeNames[U]));h.all(B).then(function(){E()}).catch(function(V){R(V)})},function(P){R(P)})})}):h.reject("Invalid arguments"),w(S,g),S}var cs={_driver:"webSQLStorage",_initStorage:Yi,_support:ee(),iterate:Qi,getItem:Zi,setItem:ts,removeItem:es,clear:ns,length:os,key:rs,keys:is,dropInstance:as};function ls(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Qo(c,g){var m=c.name+"/";return c.storeName!==g.storeName&&(m+=c.storeName+"/"),m}function us(){var c="_localforage_support_test";try{return localStorage.setItem(c,!0),localStorage.removeItem(c),!1}catch{return!0}}function hs(){return!us()||localStorage.length>0}function ds(c){var g=this,m={};if(c)for(var S in c)m[S]=c[S];return m.keyPrefix=Qo(c,g._defaultConfig),hs()?(g._dbInfo=m,m.serializer=mn,h.resolve()):h.reject()}function fs(c){var g=this,m=g.ready().then(function(){for(var S=g._dbInfo.keyPrefix,b=localStorage.length-1;b>=0;b--){var C=localStorage.key(b);C.indexOf(S)===0&&localStorage.removeItem(C)}});return w(m,c),m}function ps(c,g){var m=this;c=k(c);var S=m.ready().then(function(){var b=m._dbInfo,C=localStorage.getItem(b.keyPrefix+c);return C&&(C=b.serializer.deserialize(C)),C});return w(S,g),S}function gs(c,g){var m=this,S=m.ready().then(function(){for(var b=m._dbInfo,C=b.keyPrefix,E=C.length,R=localStorage.length,P=1,A=0;A<R;A++){var B=localStorage.key(A);if(B.indexOf(C)===0){var U=localStorage.getItem(B);if(U&&(U=b.serializer.deserialize(U)),(U=c(U,B.substring(E),P++))!==void 0)return U}}});return w(S,g),S}function ms(c,g){var m=this,S=m.ready().then(function(){var b,C=m._dbInfo;try{b=localStorage.key(c)}catch{b=null}return b&&(b=b.substring(C.keyPrefix.length)),b});return w(S,g),S}function vs(c){var g=this,m=g.ready().then(function(){for(var S=g._dbInfo,b=localStorage.length,C=[],E=0;E<b;E++){var R=localStorage.key(E);R.indexOf(S.keyPrefix)===0&&C.push(R.substring(S.keyPrefix.length))}return C});return w(m,c),m}function ys(c){var g=this.keys().then(function(m){return m.length});return w(g,c),g}function ws(c,g){var m=this;c=k(c);var S=m.ready().then(function(){var b=m._dbInfo;localStorage.removeItem(b.keyPrefix+c)});return w(S,g),S}function bs(c,g,m){var S=this;c=k(c);var b=S.ready().then(function(){g===void 0&&(g=null);var C=g;return new h(function(E,R){var P=S._dbInfo;P.serializer.serialize(g,function(A,B){if(B)R(B);else try{localStorage.setItem(P.keyPrefix+c,A),E(C)}catch(U){U.name!=="QuotaExceededError"&&U.name!=="NS_ERROR_DOM_QUOTA_REACHED"||R(U),R(U)}})})});return w(b,m),b}function _s(c,g){if(g=$.apply(this,arguments),!(c=typeof c!="function"&&c||{}).name){var m=this.config();c.name=c.name||m.name,c.storeName=c.storeName||m.storeName}var S,b=this;return S=c.name?new h(function(C){c.storeName?C(Qo(c,b._defaultConfig)):C(c.name+"/")}).then(function(C){for(var E=localStorage.length-1;E>=0;E--){var R=localStorage.key(E);R.indexOf(C)===0&&localStorage.removeItem(R)}}):h.reject("Invalid arguments"),w(S,g),S}var Ss={_driver:"localStorageWrapper",_initStorage:ds,_support:ls(),iterate:gs,getItem:ps,setItem:bs,removeItem:ws,clear:fs,length:ys,key:ms,keys:vs,dropInstance:_s},Cs=function(c,g){return c===g||typeof c=="number"&&typeof g=="number"&&isNaN(c)&&isNaN(g)},Es=function(c,g){for(var m=c.length,S=0;S<m;){if(Cs(c[S],g))return!0;S++}return!1},tr=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"},ne={},er={},qt={INDEXEDDB:we,WEBSQL:cs,LOCALSTORAGE:Ss},xs=[qt.INDEXEDDB._driver,qt.WEBSQL._driver,qt.LOCALSTORAGE._driver],_e=["dropInstance"],vn=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(_e),ks={description:"",driver:xs.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Is(c,g){c[g]=function(){var m=arguments;return c.ready().then(function(){return c[g].apply(c,m)})}}function yn(){for(var c=1;c<arguments.length;c++){var g=arguments[c];if(g)for(var m in g)g.hasOwnProperty(m)&&(tr(g[m])?arguments[0][m]=g[m].slice():arguments[0][m]=g[m])}return arguments[0]}var Ts=function(){function c(g){for(var m in r(this,c),qt)if(qt.hasOwnProperty(m)){var S=qt[m],b=S._driver;this[m]=b,ne[b]||this.defineDriver(S)}this._defaultConfig=yn({},ks),this._config=yn({},this._defaultConfig,g),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return c.prototype.config=function(g){if((g===void 0?"undefined":o(g))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var m in g){if(m==="storeName"&&(g[m]=g[m].replace(/\W/g,"_")),m==="version"&&typeof g[m]!="number")return new Error("Database version must be a number.");this._config[m]=g[m]}return!("driver"in g)||!g.driver||this.setDriver(this._config.driver)}return typeof g=="string"?this._config[g]:this._config},c.prototype.defineDriver=function(g,m,S){var b=new h(function(C,E){try{var R=g._driver,P=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!g._driver)return void E(P);for(var A=vn.concat("_initStorage"),B=0,U=A.length;B<U;B++){var H=A[B];if((!Es(_e,H)||g[H])&&typeof g[H]!="function")return void E(P)}var V=function(){for(var at=function(Ms){return function(){var Ps=new Error("Method "+Ms+" is not implemented by the current driver"),nr=h.reject(Ps);return w(nr,arguments[arguments.length-1]),nr}},xt=0,wn=_e.length;xt<wn;xt++){var bn=_e[xt];g[bn]||(g[bn]=at(bn))}};V();var G=function(at){ne[R]&&console.info("Redefining LocalForage driver: "+R),ne[R]=g,er[R]=at,C()};"_support"in g?g._support&&typeof g._support=="function"?g._support().then(G,E):G(!!g._support):G(!0)}catch(at){E(at)}});return _(b,m,S),b},c.prototype.driver=function(){return this._driver||null},c.prototype.getDriver=function(g,m,S){var b=ne[g]?h.resolve(ne[g]):h.reject(new Error("Driver not found."));return _(b,m,S),b},c.prototype.getSerializer=function(g){var m=h.resolve(mn);return _(m,g),m},c.prototype.ready=function(g){var m=this,S=m._driverSet.then(function(){return m._ready===null&&(m._ready=m._initDriver()),m._ready});return _(S,g,g),S},c.prototype.setDriver=function(g,m,S){var b=this;tr(g)||(g=[g]);var C=this._getSupportedDrivers(g);function E(){b._config.driver=b.driver()}function R(B){return b._extend(B),E(),b._ready=b._initStorage(b._config),b._ready}function P(B){return function(){var U=0;function H(){for(;U<B.length;){var V=B[U];return U++,b._dbInfo=null,b._ready=null,b.getDriver(V).then(R).catch(H)}E();var G=new Error("No available storage method found.");return b._driverSet=h.reject(G),b._driverSet}return H()}}var A=this._driverSet!==null?this._driverSet.catch(function(){return h.resolve()}):h.resolve();return this._driverSet=A.then(function(){var B=C[0];return b._dbInfo=null,b._ready=null,b.getDriver(B).then(function(U){b._driver=U._driver,E(),b._wrapLibraryMethodsWithReady(),b._initDriver=P(C)})}).catch(function(){E();var B=new Error("No available storage method found.");return b._driverSet=h.reject(B),b._driverSet}),_(this._driverSet,m,S),this._driverSet},c.prototype.supports=function(g){return!!er[g]},c.prototype._extend=function(g){yn(this,g)},c.prototype._getSupportedDrivers=function(g){for(var m=[],S=0,b=g.length;S<b;S++){var C=g[S];this.supports(C)&&m.push(C)}return m},c.prototype._wrapLibraryMethodsWithReady=function(){for(var g=0,m=vn.length;g<m;g++)Is(this,vn[g])},c.prototype.createInstance=function(g){return new c(g)},c}(),Rs=new Ts;t.exports=Rs},{3:3}]},{},[4])(4)),Be=Pe(Ya),qr={exports:{}},Za=(Hr||(Hr=1,function(e){((t,n)=>{e.exports=n()})(0,()=>{const t=typeof window=="object"?window:this;t.HTMLElement||console.warn("streamsaver is meant to run on browsers main thread");let n=null,o=!1;const r=t.WebStreamsPolyfill||{},i=t.isSecureContext;let s=/constructor/i.test(t.HTMLElement)||!!t.safari||!!t.WebKitPoint;const a=i||"MozAppearance"in document.documentElement.style?"iframe":"navigate",l={createWriteStream:function(w,_,k){let $={size:null,pathname:null,writableStrategy:void 0,readableStrategy:void 0},I=0,p=null,u=null,v=null;if(Number.isFinite(_)?([k,_]=[_,k],console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),$.size=k,$.writableStrategy=_):_&&_.highWaterMark?(console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),$.size=k,$.writableStrategy=_):$=_||{},!s){n||(n=i?h(l.mitm):function(z){const L="width=200,height=100",D=document.createDocumentFragment(),M={frame:t.open(z,"popup",L),loaded:!1,isIframe:!1,isPopup:!0,remove(){M.frame.close()},addEventListener(...O){D.addEventListener(...O)},dispatchEvent(...O){D.dispatchEvent(...O)},removeEventListener(...O){D.removeEventListener(...O)},postMessage(...O){M.frame.postMessage(...O)}},N=O=>{O.source===M.frame&&(M.loaded=!0,t.removeEventListener("message",N),M.dispatchEvent(new Event("load")))};return t.addEventListener("message",N),M}(l.mitm)),u=new MessageChannel,w=encodeURIComponent(w.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A");const d={transferringReadable:o,pathname:$.pathname||Math.random().toString().slice(-6)+"/"+w,headers:{"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+w}};$.size&&(d.headers["Content-Length"]=$.size);const f=[d,"*",[u.port2]];if(o){const z=a==="iframe"?void 0:{transform(D,M){if(!(D instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");I+=D.length,M.enqueue(D),p&&(location.href=p,p=null)},flush(){p&&(location.href=p)}};v=new l.TransformStream(z,$.writableStrategy,$.readableStrategy);const L=v.readable;u.port1.postMessage({readableStream:L},[L])}u.port1.onmessage=z=>{z.data.download?a==="navigate"?(n.remove(),n=null,I?location.href=z.data.download:p=z.data.download):(n.isPopup&&(n.remove(),n=null,a==="iframe"&&h(l.mitm)),h(z.data.download)):z.data.abort&&(y=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null)},n.loaded?n.postMessage(...f):n.addEventListener("load",()=>{n.postMessage(...f)},{once:!0})}let y=[];return!s&&v&&v.writable||new l.WritableStream({write(d){if(!(d instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");s?y.push(d):(u.port1.postMessage(d),I+=d.length,p&&(location.href=p,p=null))},close(){if(s){const d=new Blob(y,{type:"application/octet-stream; charset=utf-8"}),f=document.createElement("a");f.href=URL.createObjectURL(d),f.download=w,f.click()}else u.port1.postMessage("end")},abort(){y=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null}},$.writableStrategy)},WritableStream:t.WritableStream||r.WritableStream,supported:!0,version:{full:"2.0.5",major:2,minor:0,dot:5},mitm:"https://jimmywarting.github.io/StreamSaver.js/mitm.html?version=2.0.0"};function h(w){if(!w)throw new Error("meh");const _=document.createElement("iframe");return _.hidden=!0,_.src=w,_.loaded=!1,_.name="iframe",_.isIframe=!0,_.postMessage=(...k)=>_.contentWindow.postMessage(...k),_.addEventListener("load",()=>{_.loaded=!0},{once:!0}),document.body.appendChild(_),_}try{new Response(new ReadableStream),i&&!("serviceWorker"in navigator)&&(s=!0)}catch{s=!0}return(w=>{try{w()}catch{}})(()=>{const{readable:w}=new TransformStream,_=new MessageChannel;_.port1.postMessage(w,[w]),_.port1.close(),_.port2.close(),o=!0,Object.defineProperty(l,"TransformStream",{configurable:!1,writable:!1,value:TransformStream})}),l})}(qr)),qr.exports),Qa=Pe(Za);class tc{fileID;downloadURL;ChunkUnitM=1048576;chunkByteSize;totalChunks=1;currentDB;keys;fileMetaData=null;finishNum=0;eventTarget;cancelSource;isStarting=!1;fileName;cacheSize=6;requestTimeout=6e4;constructor(t,n,o=3,r=6,i=6e4){this.fileID=t,this.downloadURL=n,this.chunkByteSize=o*this.ChunkUnitM,this.eventTarget=On(),this.initIndexDB(),r>=3&&(this.cacheSize=r),i>this.requestTimeout&&(this.requestTimeout=i)}on(t,n){this.eventTarget.on(t,n)}dispatch(t,n){this.eventTarget.emit(t,n)}dispatchError(t){this.eventTarget.emit("error",t)}dispatchInfo(t){this.eventTarget.emit("info",t)}async queryDownloadFileMeta(t,n="",o){this.dispatchInfo("\u5F00\u59CB\u83B7\u53D6\u6587\u4EF6\u4FE1\u606F");const r=await It(n,t,o);let i=null;return r&&r.status===200&&(i=r.data),i}async getIFileMeta(){if(this.fileMetaData===null){const t=await this.currentDB?.getItem("fileinfo");this.fileMetaData=t||null}return this.fileMetaData}initIndexDB(){this.currentDB=Be.createInstance({name:this.fileID,driver:Be.INDEXEDDB})}async init(t){if(this.finishNum=0,t){const n="fileinfo";this.fileMetaData={id:t.id,name:t.name,length:t.length,downloadID:t.downloadID,chunkSize:this.chunkByteSize},this.fileName=t.name,this.currentDB?.setItem(n,this.fileMetaData)}if(this.fileMetaData!=null){const n=this.fileMetaData.chunkSize;n!=null&&n>0&&(this.chunkByteSize=n)}this.fileMetaData&&(this.totalChunks=Math.ceil(this.fileMetaData.length/this.chunkByteSize)),this.dispatchInfo("\u5B8C\u6210\u521D\u59CB\u5316\u6587\u4EF6\u4FE1\u606F\uFF0C\u603B\u5206\u7247\uFF1A"+this.totalChunks),this.currentDB&&(this.keys=await this.currentDB.keys())}getTotalChunks(){return this.totalChunks}pause(){this.cancelSource&&this.isStarting&&(this.cancelSource.cancel(),this.isStarting=!1),this.dispatchInfo("\u5DF2\u6682\u505C\u4E0B\u8F7D\u4EFB\u52A1")}restart(){this.dispatchInfo("\u6B63\u5728\u91CD\u542F\u4E0B\u8F7D\u4EFB\u52A1"),this.download()}delete(){this.cancelSource&&this.cancelSource.cancel(),Be.dropInstance({name:this.fileID}),this.currentDB=void 0,this.keys&&(this.keys.length=0,this.keys=void 0),this.finishNum=0,this.downloadProgress(),this.outputProgress(0),this.dispatchInfo("\u5DF2\u5220\u9664\u4E0B\u8F7D\u4EFB\u52A1")}sleep(t){return new Promise(n=>setTimeout(n,t))}async download(t,n){let o=t;if(!o&&this.downloadURL&&(o=this.downloadURL),!o)throw Error("\u4E0B\u8F7DURL\u4E0D\u80FD\u4E3A\u7A7A!");this.currentDB||this.initIndexDB();const r=j.Axios.CancelToken;this.cancelSource=r.source(),this.isStarting=!0;const i={key:this.fileMetaData?.downloadID};let s=0;const a=this.cacheSize;let l=0;for(let h=0;h<this.totalChunks;h++){if(this.keys&&this.keys?.indexOf(h.toString())>=0){s++,s>this.finishNum&&(this.finishNum=s,this.downloadProgress());continue}const w=h*this.chunkByteSize;let _=w+this.chunkByteSize-1;this.fileMetaData&&_>this.fileMetaData.length&&(_=this.fileMetaData.length-1);const k={range:`bytes=${w}-${_}`};for(;l>=a;)await this.sleep(200);const $=h.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${h+1}/${this.totalChunks}`),l++,It(o,n,i,k,"arraybuffer",this.cancelSource?.token,this.requestTimeout).then(async I=>{const p=I.data;l--,await this.currentDB?.setItem($,p),s++,s>this.finishNum&&(this.finishNum=s,this.downloadProgress());const u=parseInt($)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${u}/${this.totalChunks}`),this.savefile()}).catch(I=>{l--;const p=parseInt($)+1;this.dispatchError(`\u4E0B\u8F7D\u7B2C${p}\uFF09\u4E2A\u5206\u7247\u5185\u5BB9\u5931\u8D25\uFF01`)})}this.finishNum===this.totalChunks&&this.savefile()}downloadProgress(){const t=100*this.finishNum/this.totalChunks;this.dispatch("downloadProgress",t)}outputProgress(t){const n=100*t/this.totalChunks;this.dispatch("saveProgress",n)}async savefile(){if(this.finishNum===this.totalChunks){if(!this.fileName)return void this.dispatchError("\u4E0B\u8F7D\u9519\u8BEF\uFF1A\u6587\u4EF6\u540D\u4E3A\u7A7A!");this.dispatchInfo("\u5F00\u59CB\u4FDD\u5B58\u4E0B\u8F7D\u6587\u4EF6:"+this.fileName);const t=Qa.createWriteStream(this.fileName).getWriter();let n=0;for(let o=0;o<this.totalChunks;o++){const r=o.toString();let i=await this.currentDB?.getItem(r);if(i||(i=await this.currentDB?.getItem(r)),!i)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${o+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);let s=new Response(i).body;if(s===null)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${o+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);const a=s.getReader();for(;;){const{done:l,value:h}=await a.read();if(l)break;await t.write(h)}n++,this.outputProgress(n),this.dispatchInfo(`\u5B8C\u6210\u7B2C${o+1}\u4E2A\u5206\u7247\u8F93\u51FA`)}t.close(),Be.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}}function ec(e,t){let n="",o="";for(const r in t)n+=r+"="+encodeURIComponent(t[r])+"&";return n=n.replace(/&$/,""),o=/\?$/.test(e)?e+n:e.replace(/\/?$/,"?")+n,o}function Xr(e={},t={}){let n;for(n in t)Lt(t[n])?e[n]=Xr(e[n],t[n]):e[n]=t[n];return e}function nc(e,t){const n=`${e}_${t}`;return ft.MD5(n)}function Vr(e){const t=function(a){if(!a)return;const l=a,h=[];if(l)for(let w of l){const _=Gr(w);_&&h.push(_)}return h}(e.bussinessRoutes),n=function(a){if(!a)return;const l=a;if(l&&l.length>0){const h=[];return l.forEach(w=>{const _=Kr(w);_&&h.push(_)}),h}}(e.widgetMenuConfig),o=function(a){if(a&&a.length>0){const l=[];return a.forEach(h=>{const w=function(_){return _?{id:_.id,label:_.label,container:_.container,preload:_.preload,afterid:_.afterid,bindid:_.bindid,group:_.group}:void 0}(h);w&&l.push(w)}),l}}(e.widgetConfig),r=function(a){if(a&&a.length>0)return a}(e.functionList),i=e.pkgObject.version,s=e.pkgObject.name;return{id:nc(s,i),name:j.Config.UI.SiteTitle,group:j.Config.UI.Group,product:s,version:i,routes:t,widgetMenu:n,widgets:o,functions:r}}function Gr(e){if(e){let t=0;e.meta?.hidden&&(t=1);let n={path:e.path,name:e.name,title:e.meta?.title,type:t,index:e.meta?.index};if(e.children){const o=[];for(let r of e.children){const i=Gr(r);i&&o.push(i)}o.length>0&&(n.children=o)}return n}}function Kr(e){if(!e)return;const t={name:e.name,index:e.index,path:e.path,type:e.type};return e.children&&e.children.length>0&&(t.children=[],e.children.forEach(n=>{const o=Kr(n);o&&t.children?.push(o)})),t}function oc(e,t="IconifyList.ts"){let n="",o=`const iconlist={
9
- `,r=0;e.forEach(i=>{const s=i.split(":");if(s&&s.length===2){const a="icon"+r;n+=`import ${a} from '~icons/${s[0]}/${s[1]}'
10
- `,o+=` '${i}':${a},
8
+ */var rr,Zs=nr?or.exports:(nr=1,or.exports=function n(t,e,o){function r(c,f){if(!e[c]){if(!t[c]){if(!f&&Rn)return Rn(c);if(i)return i(c,!0);var g=new Error("Cannot find module '"+c+"'");throw g.code="MODULE_NOT_FOUND",g}var S=e[c]={exports:{}};t[c][0].call(S.exports,function(E){var L=t[c][1][E];return r(L||E)},S,S.exports,n,t,e,o)}return e[c].exports}for(var i=Rn,s=0;s<o.length;s++)r(o[s]);return r}({1:[function(n,t,e){(function(o){var r,i,s=o.MutationObserver||o.WebKitMutationObserver;if(s){var c=0,f=new s(L),g=o.document.createTextNode("");f.observe(g,{characterData:!0}),r=function(){g.data=c=++c%2}}else if(o.setImmediate||o.MessageChannel===void 0)r="document"in o&&"onreadystatechange"in o.document.createElement("script")?function(){var I=o.document.createElement("script");I.onreadystatechange=function(){L(),I.onreadystatechange=null,I.parentNode.removeChild(I),I=null},o.document.documentElement.appendChild(I)}:function(){setTimeout(L,0)};else{var S=new o.MessageChannel;S.port1.onmessage=L,r=function(){S.port2.postMessage(0)}}var E=[];function L(){var I,p;i=!0;for(var l=E.length;l;){for(p=E,E=[],I=-1;++I<l;)p[I]();l=E.length}i=!1}function O(I){E.push(I)!==1||i||r()}t.exports=O}).call(this,Ht!==void 0?Ht:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(n,t,e){var o=n(1);function r(){}var i={},s=["REJECTED"],c=["FULFILLED"],f=["PENDING"];function g(h){if(typeof h!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,h!==r&&O(this,h)}function S(h,v,$){this.promise=h,typeof v=="function"&&(this.onFulfilled=v,this.callFulfilled=this.otherCallFulfilled),typeof $=="function"&&(this.onRejected=$,this.callRejected=this.otherCallRejected)}function E(h,v,$){o(function(){var z;try{z=v($)}catch(A){return i.reject(h,A)}z===h?i.reject(h,new TypeError("Cannot resolve promise with itself")):i.resolve(h,z)})}function L(h){var v=h&&h.then;if(h&&(typeof h=="object"||typeof h=="function")&&typeof v=="function")return function(){v.apply(h,arguments)}}function O(h,v){var $=!1;function z(U){$||($=!0,i.reject(h,U))}function A(U){$||($=!0,i.resolve(h,U))}function M(){v(A,z)}var N=I(M);N.status==="error"&&z(N.value)}function I(h,v){var $={};try{$.value=h(v),$.status="success"}catch(z){$.status="error",$.value=z}return $}function p(h){return h instanceof this?h:i.resolve(new this(r),h)}function l(h){var v=new this(r);return i.reject(v,h)}function y(h){var v=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var $=h.length,z=!1;if(!$)return this.resolve([]);for(var A=new Array($),M=0,N=-1,U=new this(r);++N<$;)R(h[N],N);return U;function R(j,X){function lt(ot){A[X]=ot,++M!==$||z||(z=!0,i.resolve(U,A))}v.resolve(j).then(lt,function(ot){z||(z=!0,i.reject(U,ot))})}}function m(h){var v=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var $=h.length,z=!1;if(!$)return this.resolve([]);for(var A=-1,M=new this(r);++A<$;)N(h[A]);return M;function N(U){v.resolve(U).then(function(R){z||(z=!0,i.resolve(M,R))},function(R){z||(z=!0,i.reject(M,R))})}}t.exports=g,g.prototype.catch=function(h){return this.then(null,h)},g.prototype.then=function(h,v){if(typeof h!="function"&&this.state===c||typeof v!="function"&&this.state===s)return this;var $=new this.constructor(r);return this.state!==f?E($,this.state===c?h:v,this.outcome):this.queue.push(new S($,h,v)),$},S.prototype.callFulfilled=function(h){i.resolve(this.promise,h)},S.prototype.otherCallFulfilled=function(h){E(this.promise,this.onFulfilled,h)},S.prototype.callRejected=function(h){i.reject(this.promise,h)},S.prototype.otherCallRejected=function(h){E(this.promise,this.onRejected,h)},i.resolve=function(h,v){var $=I(L,v);if($.status==="error")return i.reject(h,$.value);var z=$.value;if(z)O(h,z);else{h.state=c,h.outcome=v;for(var A=-1,M=h.queue.length;++A<M;)h.queue[A].callFulfilled(v)}return h},i.reject=function(h,v){h.state=s,h.outcome=v;for(var $=-1,z=h.queue.length;++$<z;)h.queue[$].callRejected(v);return h},g.resolve=p,g.reject=l,g.all=y,g.race=m},{1:1}],3:[function(n,t,e){(function(o){typeof o.Promise!="function"&&(o.Promise=n(2))}).call(this,Ht!==void 0?Ht:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(n,t,e){var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};function r(a,u){if(!(a instanceof u))throw new TypeError("Cannot call a class as a function")}function i(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var s=i();function c(){try{if(!s||!s.open)return!1;var a=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),u=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!a||u)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function f(a,u){a=a||[],u=u||{};try{return new Blob(a,u)}catch(w){if(w.name!=="TypeError")throw w;for(var d=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),b=0;b<a.length;b+=1)d.append(a[b]);return d.getBlob(u.type)}}typeof Promise>"u"&&n(3);var g=Promise;function S(a,u){u&&a.then(function(d){u(null,d)},function(d){u(d)})}function E(a,u,d){typeof u=="function"&&a.then(u),typeof d=="function"&&a.catch(d)}function L(a){return typeof a!="string"&&(console.warn(a+" used as a key, but it is not a string."),a=String(a)),a}function O(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var I="local-forage-detect-blob-support",p=void 0,l={},y=Object.prototype.toString,m="readonly",h="readwrite";function v(a){for(var u=a.length,d=new ArrayBuffer(u),b=new Uint8Array(d),w=0;w<u;w++)b[w]=a.charCodeAt(w);return d}function $(a){return new g(function(u){var d=a.transaction(I,h),b=f([""]);d.objectStore(I).put(b,"key"),d.onabort=function(w){w.preventDefault(),w.stopPropagation(),u(!1)},d.oncomplete=function(){var w=navigator.userAgent.match(/Chrome\/(\d+)/),_=navigator.userAgent.match(/Edge\//);u(_||!w||parseInt(w[1],10)>=43)}}).catch(function(){return!1})}function z(a){return typeof p=="boolean"?g.resolve(p):$(a).then(function(u){return p=u})}function A(a){var u=l[a.name],d={};d.promise=new g(function(b,w){d.resolve=b,d.reject=w}),u.deferredOperations.push(d),u.dbReady?u.dbReady=u.dbReady.then(function(){return d.promise}):u.dbReady=d.promise}function M(a){var u=l[a.name].deferredOperations.pop();if(u)return u.resolve(),u.promise}function N(a,u){var d=l[a.name].deferredOperations.pop();if(d)return d.reject(u),d.promise}function U(a,u){return new g(function(d,b){if(l[a.name]=l[a.name]||Yn(),a.db){if(!u)return d(a.db);A(a),a.db.close()}var w=[a.name];u&&w.push(a.version);var _=s.open.apply(s,w);u&&(_.onupgradeneeded=function(C){var x=_.result;try{x.createObjectStore(a.storeName),C.oldVersion<=1&&x.createObjectStore(I)}catch(T){if(T.name!=="ConstraintError")throw T;console.warn('The database "'+a.name+'" has been upgraded from version '+C.oldVersion+" to version "+C.newVersion+', but the storage "'+a.storeName+'" already exists.')}}),_.onerror=function(C){C.preventDefault(),b(_.error)},_.onsuccess=function(){var C=_.result;C.onversionchange=function(x){x.target.close()},d(C),M(a)}})}function R(a){return U(a,!1)}function j(a){return U(a,!0)}function X(a,u){if(!a.db)return!0;var d=!a.db.objectStoreNames.contains(a.storeName),b=a.version<a.db.version,w=a.version>a.db.version;if(b&&(a.version!==u&&console.warn('The database "'+a.name+`" can't be downgraded from version `+a.db.version+" to version "+a.version+"."),a.version=a.db.version),w||d){if(d){var _=a.db.version+1;_>a.version&&(a.version=_)}return!0}return!1}function lt(a){return new g(function(u,d){var b=new FileReader;b.onerror=d,b.onloadend=function(w){var _=btoa(w.target.result||"");u({__local_forage_encoded_blob:!0,data:_,type:a.type})},b.readAsBinaryString(a)})}function ot(a){return f([v(atob(a.data))],{type:a.type})}function yt(a){return a&&a.__local_forage_encoded_blob}function ie(a){var u=this,d=u._initReady().then(function(){var b=l[u._dbInfo.name];if(b&&b.dbReady)return b.dbReady});return E(d,a,a),d}function Ue(a){A(a);for(var u=l[a.name],d=u.forages,b=0;b<d.length;b++){var w=d[b];w._dbInfo.db&&(w._dbInfo.db.close(),w._dbInfo.db=null)}return a.db=null,R(a).then(function(_){return a.db=_,X(a)?j(a):_}).then(function(_){a.db=u.db=_;for(var C=0;C<d.length;C++)d[C]._dbInfo.db=_}).catch(function(_){throw N(a,_),_})}function mt(a,u,d,b){b===void 0&&(b=1);try{var w=a.db.transaction(a.storeName,u);d(null,w)}catch(_){if(b>0&&(!a.db||_.name==="InvalidStateError"||_.name==="NotFoundError"))return g.resolve().then(function(){if(!a.db||_.name==="NotFoundError"&&!a.db.objectStoreNames.contains(a.storeName)&&a.version<=a.db.version)return a.db&&(a.version=a.db.version+1),j(a)}).then(function(){return Ue(a).then(function(){mt(a,u,d,b-1)})}).catch(d);d(_)}}function Yn(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function $r(a){var u=this,d={db:null};if(a)for(var b in a)d[b]=a[b];var w=l[d.name];w||(w=Yn(),l[d.name]=w),w.forages.push(u),u._initReady||(u._initReady=u.ready,u.ready=ie);var _=[];function C(){return g.resolve()}for(var x=0;x<w.forages.length;x++){var T=w.forages[x];T!==u&&_.push(T._initReady().catch(C))}var P=w.forages.slice(0);return g.all(_).then(function(){return d.db=w.db,R(d)}).then(function(D){return d.db=D,X(d,u._defaultConfig.version)?j(d):D}).then(function(D){d.db=w.db=D,u._dbInfo=d;for(var W=0;W<P.length;W++){var F=P[W];F!==u&&(F._dbInfo.db=d.db,F._dbInfo.version=d.version)}})}function Nr(a,u){var d=this;a=L(a);var b=new g(function(w,_){d.ready().then(function(){mt(d._dbInfo,m,function(C,x){if(C)return _(C);try{var T=x.objectStore(d._dbInfo.storeName).get(a);T.onsuccess=function(){var P=T.result;P===void 0&&(P=null),yt(P)&&(P=ot(P)),w(P)},T.onerror=function(){_(T.error)}}catch(P){_(P)}})}).catch(_)});return S(b,u),b}function Br(a,u){var d=this,b=new g(function(w,_){d.ready().then(function(){mt(d._dbInfo,m,function(C,x){if(C)return _(C);try{var T=x.objectStore(d._dbInfo.storeName).openCursor(),P=1;T.onsuccess=function(){var D=T.result;if(D){var W=D.value;yt(W)&&(W=ot(W));var F=a(W,D.key,P++);F!==void 0?w(F):D.continue()}else w()},T.onerror=function(){_(T.error)}}catch(D){_(D)}})}).catch(_)});return S(b,u),b}function Wr(a,u,d){var b=this;a=L(a);var w=new g(function(_,C){var x;b.ready().then(function(){return x=b._dbInfo,y.call(u)==="[object Blob]"?z(x.db).then(function(T){return T?u:lt(u)}):u}).then(function(T){mt(b._dbInfo,h,function(P,D){if(P)return C(P);try{var W=D.objectStore(b._dbInfo.storeName);T===null&&(T=void 0);var F=W.put(T,a);D.oncomplete=function(){T===void 0&&(T=null),_(T)},D.onabort=D.onerror=function(){var G=F.error?F.error:F.transaction.error;C(G)}}catch(G){C(G)}})}).catch(C)});return S(w,d),w}function Ur(a,u){var d=this;a=L(a);var b=new g(function(w,_){d.ready().then(function(){mt(d._dbInfo,h,function(C,x){if(C)return _(C);try{var T=x.objectStore(d._dbInfo.storeName).delete(a);x.oncomplete=function(){w()},x.onerror=function(){_(T.error)},x.onabort=function(){var P=T.error?T.error:T.transaction.error;_(P)}}catch(P){_(P)}})}).catch(_)});return S(b,u),b}function Or(a){var u=this,d=new g(function(b,w){u.ready().then(function(){mt(u._dbInfo,h,function(_,C){if(_)return w(_);try{var x=C.objectStore(u._dbInfo.storeName).clear();C.oncomplete=function(){b()},C.onabort=C.onerror=function(){var T=x.error?x.error:x.transaction.error;w(T)}}catch(T){w(T)}})}).catch(w)});return S(d,a),d}function jr(a){var u=this,d=new g(function(b,w){u.ready().then(function(){mt(u._dbInfo,m,function(_,C){if(_)return w(_);try{var x=C.objectStore(u._dbInfo.storeName).count();x.onsuccess=function(){b(x.result)},x.onerror=function(){w(x.error)}}catch(T){w(T)}})}).catch(w)});return S(d,a),d}function Hr(a,u){var d=this,b=new g(function(w,_){a<0?w(null):d.ready().then(function(){mt(d._dbInfo,m,function(C,x){if(C)return _(C);try{var T=x.objectStore(d._dbInfo.storeName),P=!1,D=T.openKeyCursor();D.onsuccess=function(){var W=D.result;W?a===0||P?w(W.key):(P=!0,W.advance(a)):w(null)},D.onerror=function(){_(D.error)}}catch(W){_(W)}})}).catch(_)});return S(b,u),b}function Fr(a){var u=this,d=new g(function(b,w){u.ready().then(function(){mt(u._dbInfo,m,function(_,C){if(_)return w(_);try{var x=C.objectStore(u._dbInfo.storeName).openKeyCursor(),T=[];x.onsuccess=function(){var P=x.result;P?(T.push(P.key),P.continue()):b(T)},x.onerror=function(){w(x.error)}}catch(P){w(P)}})}).catch(w)});return S(d,a),d}function qr(a,u){u=O.apply(this,arguments);var d=this.config();(a=typeof a!="function"&&a||{}).name||(a.name=a.name||d.name,a.storeName=a.storeName||d.storeName);var b,w=this;if(a.name){var _=a.name===d.name&&w._dbInfo.db?g.resolve(w._dbInfo.db):R(a).then(function(C){var x=l[a.name],T=x.forages;x.db=C;for(var P=0;P<T.length;P++)T[P]._dbInfo.db=C;return C});b=a.storeName?_.then(function(C){if(C.objectStoreNames.contains(a.storeName)){var x=C.version+1;A(a);var T=l[a.name],P=T.forages;C.close();for(var D=0;D<P.length;D++){var W=P[D];W._dbInfo.db=null,W._dbInfo.version=x}var F=new g(function(G,V){var rt=s.open(a.name,x);rt.onerror=function(_t){rt.result.close(),V(_t)},rt.onupgradeneeded=function(){rt.result.deleteObjectStore(a.storeName)},rt.onsuccess=function(){var _t=rt.result;_t.close(),G(_t)}});return F.then(function(G){T.db=G;for(var V=0;V<P.length;V++){var rt=P[V];rt._dbInfo.db=G,M(rt._dbInfo)}}).catch(function(G){throw(N(a,G)||g.resolve()).catch(function(){}),G})}}):_.then(function(C){A(a);var x=l[a.name],T=x.forages;C.close();for(var P=0;P<T.length;P++)T[P]._dbInfo.db=null;var D=new g(function(W,F){var G=s.deleteDatabase(a.name);G.onerror=function(){var V=G.result;V&&V.close(),F(G.error)},G.onblocked=function(){console.warn('dropInstance blocked for database "'+a.name+'" until all open connections are closed')},G.onsuccess=function(){var V=G.result;V&&V.close(),W(V)}});return D.then(function(W){x.db=W;for(var F=0;F<T.length;F++)M(T[F]._dbInfo)}).catch(function(W){throw(N(a,W)||g.resolve()).catch(function(){}),W})})}else b=g.reject("Invalid arguments");return S(b,u),b}var Xr={_driver:"asyncStorage",_initStorage:$r,_support:c(),iterate:Br,getItem:Nr,setItem:Wr,removeItem:Ur,clear:Or,length:jr,key:Hr,keys:Fr,dropInstance:qr};function Gr(){return typeof openDatabase=="function"}var Et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Vr="~~local_forage_type~",Jn=/^~~local_forage_type~([^~]+)~/,se="__lfsc__:",Oe=se.length,je="arbf",He="blob",Zn="si08",Qn="ui08",to="uic8",eo="si16",no="si32",oo="ur16",ro="ui32",io="fl32",so="fl64",ao=Oe+je.length,co=Object.prototype.toString;function lo(a){var u,d,b,w,_,C=.75*a.length,x=a.length,T=0;a[a.length-1]==="="&&(C--,a[a.length-2]==="="&&C--);var P=new ArrayBuffer(C),D=new Uint8Array(P);for(u=0;u<x;u+=4)d=Et.indexOf(a[u]),b=Et.indexOf(a[u+1]),w=Et.indexOf(a[u+2]),_=Et.indexOf(a[u+3]),D[T++]=d<<2|b>>4,D[T++]=(15&b)<<4|w>>2,D[T++]=(3&w)<<6|63&_;return P}function Fe(a){var u,d=new Uint8Array(a),b="";for(u=0;u<d.length;u+=3)b+=Et[d[u]>>2],b+=Et[(3&d[u])<<4|d[u+1]>>4],b+=Et[(15&d[u+1])<<2|d[u+2]>>6],b+=Et[63&d[u+2]];return d.length%3==2?b=b.substring(0,b.length-1)+"=":d.length%3==1&&(b=b.substring(0,b.length-2)+"=="),b}function Kr(a,u){var d="";if(a&&(d=co.call(a)),a&&(d==="[object ArrayBuffer]"||a.buffer&&co.call(a.buffer)==="[object ArrayBuffer]")){var b,w=se;a instanceof ArrayBuffer?(b=a,w+=je):(b=a.buffer,d==="[object Int8Array]"?w+=Zn:d==="[object Uint8Array]"?w+=Qn:d==="[object Uint8ClampedArray]"?w+=to:d==="[object Int16Array]"?w+=eo:d==="[object Uint16Array]"?w+=oo:d==="[object Int32Array]"?w+=no:d==="[object Uint32Array]"?w+=ro:d==="[object Float32Array]"?w+=io:d==="[object Float64Array]"?w+=so:u(new Error("Failed to get type for BinaryArray"))),u(w+Fe(b))}else if(d==="[object Blob]"){var _=new FileReader;_.onload=function(){var C=Vr+a.type+"~"+Fe(this.result);u(se+He+C)},_.readAsArrayBuffer(a)}else try{u(JSON.stringify(a))}catch(C){console.error("Couldn't convert value into a JSON string: ",a),u(null,C)}}function Yr(a){if(a.substring(0,Oe)!==se)return JSON.parse(a);var u,d=a.substring(ao),b=a.substring(Oe,ao);if(b===He&&Jn.test(d)){var w=d.match(Jn);u=w[1],d=d.substring(w[0].length)}var _=lo(d);switch(b){case je:return _;case He:return f([_],{type:u});case Zn:return new Int8Array(_);case Qn:return new Uint8Array(_);case to:return new Uint8ClampedArray(_);case eo:return new Int16Array(_);case oo:return new Uint16Array(_);case no:return new Int32Array(_);case ro:return new Uint32Array(_);case io:return new Float32Array(_);case so:return new Float64Array(_);default:throw new Error("Unkown type: "+b)}}var qe={serialize:Kr,deserialize:Yr,stringToBuffer:lo,bufferToString:Fe};function uo(a,u,d,b){a.executeSql("CREATE TABLE IF NOT EXISTS "+u.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],d,b)}function Jr(a){var u=this,d={db:null};if(a)for(var b in a)d[b]=typeof a[b]!="string"?a[b].toString():a[b];var w=new g(function(_,C){try{d.db=openDatabase(d.name,String(d.version),d.description,d.size)}catch(x){return C(x)}d.db.transaction(function(x){uo(x,d,function(){u._dbInfo=d,_()},function(T,P){C(P)})},C)});return d.serializer=qe,w}function kt(a,u,d,b,w,_){a.executeSql(d,b,w,function(C,x){x.code===x.SYNTAX_ERR?C.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[u.storeName],function(T,P){P.rows.length?_(T,x):uo(T,u,function(){T.executeSql(d,b,w,_)},_)},_):_(C,x)},_)}function Zr(a,u){var d=this;a=L(a);var b=new g(function(w,_){d.ready().then(function(){var C=d._dbInfo;C.db.transaction(function(x){kt(x,C,"SELECT * FROM "+C.storeName+" WHERE key = ? LIMIT 1",[a],function(T,P){var D=P.rows.length?P.rows.item(0).value:null;D&&(D=C.serializer.deserialize(D)),w(D)},function(T,P){_(P)})})}).catch(_)});return S(b,u),b}function Qr(a,u){var d=this,b=new g(function(w,_){d.ready().then(function(){var C=d._dbInfo;C.db.transaction(function(x){kt(x,C,"SELECT * FROM "+C.storeName,[],function(T,P){for(var D=P.rows,W=D.length,F=0;F<W;F++){var G=D.item(F),V=G.value;if(V&&(V=C.serializer.deserialize(V)),(V=a(V,G.key,F+1))!==void 0)return void w(V)}w()},function(T,P){_(P)})})}).catch(_)});return S(b,u),b}function ho(a,u,d,b){var w=this;a=L(a);var _=new g(function(C,x){w.ready().then(function(){u===void 0&&(u=null);var T=u,P=w._dbInfo;P.serializer.serialize(u,function(D,W){W?x(W):P.db.transaction(function(F){kt(F,P,"INSERT OR REPLACE INTO "+P.storeName+" (key, value) VALUES (?, ?)",[a,D],function(){C(T)},function(G,V){x(V)})},function(F){if(F.code===F.QUOTA_ERR){if(b>0)return void C(ho.apply(w,[a,T,d,b-1]));x(F)}})})}).catch(x)});return S(_,d),_}function ti(a,u,d){return ho.apply(this,[a,u,d,1])}function ei(a,u){var d=this;a=L(a);var b=new g(function(w,_){d.ready().then(function(){var C=d._dbInfo;C.db.transaction(function(x){kt(x,C,"DELETE FROM "+C.storeName+" WHERE key = ?",[a],function(){w()},function(T,P){_(P)})})}).catch(_)});return S(b,u),b}function ni(a){var u=this,d=new g(function(b,w){u.ready().then(function(){var _=u._dbInfo;_.db.transaction(function(C){kt(C,_,"DELETE FROM "+_.storeName,[],function(){b()},function(x,T){w(T)})})}).catch(w)});return S(d,a),d}function oi(a){var u=this,d=new g(function(b,w){u.ready().then(function(){var _=u._dbInfo;_.db.transaction(function(C){kt(C,_,"SELECT COUNT(key) as c FROM "+_.storeName,[],function(x,T){var P=T.rows.item(0).c;b(P)},function(x,T){w(T)})})}).catch(w)});return S(d,a),d}function ri(a,u){var d=this,b=new g(function(w,_){d.ready().then(function(){var C=d._dbInfo;C.db.transaction(function(x){kt(x,C,"SELECT key FROM "+C.storeName+" WHERE id = ? LIMIT 1",[a+1],function(T,P){var D=P.rows.length?P.rows.item(0).key:null;w(D)},function(T,P){_(P)})})}).catch(_)});return S(b,u),b}function ii(a){var u=this,d=new g(function(b,w){u.ready().then(function(){var _=u._dbInfo;_.db.transaction(function(C){kt(C,_,"SELECT key FROM "+_.storeName,[],function(x,T){for(var P=[],D=0;D<T.rows.length;D++)P.push(T.rows.item(D).key);b(P)},function(x,T){w(T)})})}).catch(w)});return S(d,a),d}function si(a){return new g(function(u,d){a.transaction(function(b){b.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(w,_){for(var C=[],x=0;x<_.rows.length;x++)C.push(_.rows.item(x).name);u({db:a,storeNames:C})},function(w,_){d(_)})},function(b){d(b)})})}function ai(a,u){u=O.apply(this,arguments);var d=this.config();(a=typeof a!="function"&&a||{}).name||(a.name=a.name||d.name,a.storeName=a.storeName||d.storeName);var b,w=this;return b=a.name?new g(function(_){var C;C=a.name===d.name?w._dbInfo.db:openDatabase(a.name,"","",0),a.storeName?_({db:C,storeNames:[a.storeName]}):_(si(C))}).then(function(_){return new g(function(C,x){_.db.transaction(function(T){function P(G){return new g(function(V,rt){T.executeSql("DROP TABLE IF EXISTS "+G,[],function(){V()},function(_t,Ve){rt(Ve)})})}for(var D=[],W=0,F=_.storeNames.length;W<F;W++)D.push(P(_.storeNames[W]));g.all(D).then(function(){C()}).catch(function(G){x(G)})},function(T){x(T)})})}):g.reject("Invalid arguments"),S(b,u),b}var ci={_driver:"webSQLStorage",_initStorage:Jr,_support:Gr(),iterate:Qr,getItem:Zr,setItem:ti,removeItem:ei,clear:ni,length:oi,key:ri,keys:ii,dropInstance:ai};function li(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function fo(a,u){var d=a.name+"/";return a.storeName!==u.storeName&&(d+=a.storeName+"/"),d}function ui(){var a="_localforage_support_test";try{return localStorage.setItem(a,!0),localStorage.removeItem(a),!1}catch{return!0}}function hi(){return!ui()||localStorage.length>0}function di(a){var u=this,d={};if(a)for(var b in a)d[b]=a[b];return d.keyPrefix=fo(a,u._defaultConfig),hi()?(u._dbInfo=d,d.serializer=qe,g.resolve()):g.reject()}function fi(a){var u=this,d=u.ready().then(function(){for(var b=u._dbInfo.keyPrefix,w=localStorage.length-1;w>=0;w--){var _=localStorage.key(w);_.indexOf(b)===0&&localStorage.removeItem(_)}});return S(d,a),d}function pi(a,u){var d=this;a=L(a);var b=d.ready().then(function(){var w=d._dbInfo,_=localStorage.getItem(w.keyPrefix+a);return _&&(_=w.serializer.deserialize(_)),_});return S(b,u),b}function gi(a,u){var d=this,b=d.ready().then(function(){for(var w=d._dbInfo,_=w.keyPrefix,C=_.length,x=localStorage.length,T=1,P=0;P<x;P++){var D=localStorage.key(P);if(D.indexOf(_)===0){var W=localStorage.getItem(D);if(W&&(W=w.serializer.deserialize(W)),(W=a(W,D.substring(C),T++))!==void 0)return W}}});return S(b,u),b}function mi(a,u){var d=this,b=d.ready().then(function(){var w,_=d._dbInfo;try{w=localStorage.key(a)}catch{w=null}return w&&(w=w.substring(_.keyPrefix.length)),w});return S(b,u),b}function vi(a){var u=this,d=u.ready().then(function(){for(var b=u._dbInfo,w=localStorage.length,_=[],C=0;C<w;C++){var x=localStorage.key(C);x.indexOf(b.keyPrefix)===0&&_.push(x.substring(b.keyPrefix.length))}return _});return S(d,a),d}function yi(a){var u=this.keys().then(function(d){return d.length});return S(u,a),u}function wi(a,u){var d=this;a=L(a);var b=d.ready().then(function(){var w=d._dbInfo;localStorage.removeItem(w.keyPrefix+a)});return S(b,u),b}function bi(a,u,d){var b=this;a=L(a);var w=b.ready().then(function(){u===void 0&&(u=null);var _=u;return new g(function(C,x){var T=b._dbInfo;T.serializer.serialize(u,function(P,D){if(D)x(D);else try{localStorage.setItem(T.keyPrefix+a,P),C(_)}catch(W){W.name!=="QuotaExceededError"&&W.name!=="NS_ERROR_DOM_QUOTA_REACHED"||x(W),x(W)}})})});return S(w,d),w}function _i(a,u){if(u=O.apply(this,arguments),!(a=typeof a!="function"&&a||{}).name){var d=this.config();a.name=a.name||d.name,a.storeName=a.storeName||d.storeName}var b,w=this;return b=a.name?new g(function(_){a.storeName?_(fo(a,w._defaultConfig)):_(a.name+"/")}).then(function(_){for(var C=localStorage.length-1;C>=0;C--){var x=localStorage.key(C);x.indexOf(_)===0&&localStorage.removeItem(x)}}):g.reject("Invalid arguments"),S(b,u),b}var Si={_driver:"localStorageWrapper",_initStorage:di,_support:li(),iterate:gi,getItem:pi,setItem:bi,removeItem:wi,clear:fi,length:yi,key:mi,keys:vi,dropInstance:_i},Ci=function(a,u){return a===u||typeof a=="number"&&typeof u=="number"&&isNaN(a)&&isNaN(u)},Ei=function(a,u){for(var d=a.length,b=0;b<d;){if(Ci(a[b],u))return!0;b++}return!1},po=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"},Gt={},go={},Ut={INDEXEDDB:Xr,WEBSQL:ci,LOCALSTORAGE:Si},ki=[Ut.INDEXEDDB._driver,Ut.WEBSQL._driver,Ut.LOCALSTORAGE._driver],ae=["dropInstance"],Xe=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ae),xi={description:"",driver:ki.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Ii(a,u){a[u]=function(){var d=arguments;return a.ready().then(function(){return a[u].apply(a,d)})}}function Ge(){for(var a=1;a<arguments.length;a++){var u=arguments[a];if(u)for(var d in u)u.hasOwnProperty(d)&&(po(u[d])?arguments[0][d]=u[d].slice():arguments[0][d]=u[d])}return arguments[0]}var Ti=function(){function a(u){for(var d in r(this,a),Ut)if(Ut.hasOwnProperty(d)){var b=Ut[d],w=b._driver;this[d]=w,Gt[w]||this.defineDriver(b)}this._defaultConfig=Ge({},xi),this._config=Ge({},this._defaultConfig,u),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return a.prototype.config=function(u){if((u===void 0?"undefined":o(u))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var d in u){if(d==="storeName"&&(u[d]=u[d].replace(/\W/g,"_")),d==="version"&&typeof u[d]!="number")return new Error("Database version must be a number.");this._config[d]=u[d]}return!("driver"in u)||!u.driver||this.setDriver(this._config.driver)}return typeof u=="string"?this._config[u]:this._config},a.prototype.defineDriver=function(u,d,b){var w=new g(function(_,C){try{var x=u._driver,T=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!u._driver)return void C(T);for(var P=Xe.concat("_initStorage"),D=0,W=P.length;D<W;D++){var F=P[D];if((!Ei(ae,F)||u[F])&&typeof u[F]!="function")return void C(T)}var G=function(){for(var rt=function(Pi){return function(){var Mi=new Error("Method "+Pi+" is not implemented by the current driver"),mo=g.reject(Mi);return S(mo,arguments[arguments.length-1]),mo}},_t=0,Ve=ae.length;_t<Ve;_t++){var Ke=ae[_t];u[Ke]||(u[Ke]=rt(Ke))}};G();var V=function(rt){Gt[x]&&console.info("Redefining LocalForage driver: "+x),Gt[x]=u,go[x]=rt,_()};"_support"in u?u._support&&typeof u._support=="function"?u._support().then(V,C):V(!!u._support):V(!0)}catch(rt){C(rt)}});return E(w,d,b),w},a.prototype.driver=function(){return this._driver||null},a.prototype.getDriver=function(u,d,b){var w=Gt[u]?g.resolve(Gt[u]):g.reject(new Error("Driver not found."));return E(w,d,b),w},a.prototype.getSerializer=function(u){var d=g.resolve(qe);return E(d,u),d},a.prototype.ready=function(u){var d=this,b=d._driverSet.then(function(){return d._ready===null&&(d._ready=d._initDriver()),d._ready});return E(b,u,u),b},a.prototype.setDriver=function(u,d,b){var w=this;po(u)||(u=[u]);var _=this._getSupportedDrivers(u);function C(){w._config.driver=w.driver()}function x(D){return w._extend(D),C(),w._ready=w._initStorage(w._config),w._ready}function T(D){return function(){var W=0;function F(){for(;W<D.length;){var G=D[W];return W++,w._dbInfo=null,w._ready=null,w.getDriver(G).then(x).catch(F)}C();var V=new Error("No available storage method found.");return w._driverSet=g.reject(V),w._driverSet}return F()}}var P=this._driverSet!==null?this._driverSet.catch(function(){return g.resolve()}):g.resolve();return this._driverSet=P.then(function(){var D=_[0];return w._dbInfo=null,w._ready=null,w.getDriver(D).then(function(W){w._driver=W._driver,C(),w._wrapLibraryMethodsWithReady(),w._initDriver=T(_)})}).catch(function(){C();var D=new Error("No available storage method found.");return w._driverSet=g.reject(D),w._driverSet}),E(this._driverSet,d,b),this._driverSet},a.prototype.supports=function(u){return!!go[u]},a.prototype._extend=function(u){Ge(this,u)},a.prototype._getSupportedDrivers=function(u){for(var d=[],b=0,w=u.length;b<w;b++){var _=u[b];this.supports(_)&&d.push(_)}return d},a.prototype._wrapLibraryMethodsWithReady=function(){for(var u=0,d=Xe.length;u<d;u++)Ii(this,Xe[u])},a.prototype.createInstance=function(u){return new a(u)},a}(),Ri=new Ti;t.exports=Ri},{3:3}]},{},[4])(4)),Ee=ve(Zs),ir={exports:{}},Qs=(rr||(rr=1,function(n){((t,e)=>{n.exports=e()})(0,()=>{const t=typeof window=="object"?window:this;t.HTMLElement||console.warn("streamsaver is meant to run on browsers main thread");let e=null,o=!1;const r=t.WebStreamsPolyfill||{},i=t.isSecureContext;let s=/constructor/i.test(t.HTMLElement)||!!t.safari||!!t.WebKitPoint;const c=i||"MozAppearance"in document.documentElement.style?"iframe":"navigate",f={createWriteStream:function(S,E,L){let O={size:null,pathname:null,writableStrategy:void 0,readableStrategy:void 0},I=0,p=null,l=null,y=null;if(Number.isFinite(E)?([L,E]=[E,L],console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),O.size=L,O.writableStrategy=E):E&&E.highWaterMark?(console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),O.size=L,O.writableStrategy=E):O=E||{},!s){e||(e=i?g(f.mitm):function($){const z="width=200,height=100",A=document.createDocumentFragment(),M={frame:t.open($,"popup",z),loaded:!1,isIframe:!1,isPopup:!0,remove(){M.frame.close()},addEventListener(...U){A.addEventListener(...U)},dispatchEvent(...U){A.dispatchEvent(...U)},removeEventListener(...U){A.removeEventListener(...U)},postMessage(...U){M.frame.postMessage(...U)}},N=U=>{U.source===M.frame&&(M.loaded=!0,t.removeEventListener("message",N),M.dispatchEvent(new Event("load")))};return t.addEventListener("message",N),M}(f.mitm)),l=new MessageChannel,S=encodeURIComponent(S.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A");const h={transferringReadable:o,pathname:O.pathname||Math.random().toString().slice(-6)+"/"+S,headers:{"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+S}};O.size&&(h.headers["Content-Length"]=O.size);const v=[h,"*",[l.port2]];if(o){const $=c==="iframe"?void 0:{transform(A,M){if(!(A instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");I+=A.length,M.enqueue(A),p&&(location.href=p,p=null)},flush(){p&&(location.href=p)}};y=new f.TransformStream($,O.writableStrategy,O.readableStrategy);const z=y.readable;l.port1.postMessage({readableStream:z},[z])}l.port1.onmessage=$=>{$.data.download?c==="navigate"?(e.remove(),e=null,I?location.href=$.data.download:p=$.data.download):(e.isPopup&&(e.remove(),e=null,c==="iframe"&&g(f.mitm)),g($.data.download)):$.data.abort&&(m=[],l.port1.postMessage("abort"),l.port1.onmessage=null,l.port1.close(),l.port2.close(),l=null)},e.loaded?e.postMessage(...v):e.addEventListener("load",()=>{e.postMessage(...v)},{once:!0})}let m=[];return!s&&y&&y.writable||new f.WritableStream({write(h){if(!(h instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");s?m.push(h):(l.port1.postMessage(h),I+=h.length,p&&(location.href=p,p=null))},close(){if(s){const h=new Blob(m,{type:"application/octet-stream; charset=utf-8"}),v=document.createElement("a");v.href=URL.createObjectURL(h),v.download=S,v.click()}else l.port1.postMessage("end")},abort(){m=[],l.port1.postMessage("abort"),l.port1.onmessage=null,l.port1.close(),l.port2.close(),l=null}},O.writableStrategy)},WritableStream:t.WritableStream||r.WritableStream,supported:!0,version:{full:"2.0.5",major:2,minor:0,dot:5},mitm:"https://jimmywarting.github.io/StreamSaver.js/mitm.html?version=2.0.0"};function g(S){if(!S)throw new Error("meh");const E=document.createElement("iframe");return E.hidden=!0,E.src=S,E.loaded=!1,E.name="iframe",E.isIframe=!0,E.postMessage=(...L)=>E.contentWindow.postMessage(...L),E.addEventListener("load",()=>{E.loaded=!0},{once:!0}),document.body.appendChild(E),E}try{new Response(new ReadableStream),i&&!("serviceWorker"in navigator)&&(s=!0)}catch{s=!0}return(S=>{try{S()}catch{}})(()=>{const{readable:S}=new TransformStream,E=new MessageChannel;E.port1.postMessage(S,[S]),E.port1.close(),E.port2.close(),o=!0,Object.defineProperty(f,"TransformStream",{configurable:!1,writable:!1,value:TransformStream})}),f})}(ir)),ir.exports),ta=ve(Qs);class ea{fileID;downloadURL;ChunkUnitM=1048576;chunkByteSize;totalChunks=1;currentDB;keys;fileMetaData=null;finishNum=0;eventTarget;cancelSource;isStarting=!1;fileName;cacheSize=6;requestTimeout=6e4;constructor(t,e,o=3,r=6,i=6e4){this.fileID=t,this.downloadURL=e,this.chunkByteSize=o*this.ChunkUnitM,this.eventTarget=mn(),this.initIndexDB(),r>=3&&(this.cacheSize=r),i>this.requestTimeout&&(this.requestTimeout=i)}on(t,e){this.eventTarget.on(t,e)}dispatch(t,e){this.eventTarget.emit(t,e)}dispatchError(t){this.eventTarget.emit("error",t)}dispatchInfo(t){this.eventTarget.emit("info",t)}async queryDownloadFileMeta(t,e="",o){this.dispatchInfo("\u5F00\u59CB\u83B7\u53D6\u6587\u4EF6\u4FE1\u606F");const r=await Ct(e,t,o);let i=null;return r&&r.status===200&&(i=r.data),i}async getIFileMeta(){if(this.fileMetaData===null){const t=await this.currentDB?.getItem("fileinfo");this.fileMetaData=t||null}return this.fileMetaData}initIndexDB(){this.currentDB=Ee.createInstance({name:this.fileID,driver:Ee.INDEXEDDB})}async init(t){if(this.finishNum=0,t){const e="fileinfo";this.fileMetaData={id:t.id,name:t.name,length:t.length,downloadID:t.downloadID,chunkSize:this.chunkByteSize},this.fileName=t.name,this.currentDB?.setItem(e,this.fileMetaData)}if(this.fileMetaData!=null){const e=this.fileMetaData.chunkSize;e!=null&&e>0&&(this.chunkByteSize=e)}this.fileMetaData&&(this.totalChunks=Math.ceil(this.fileMetaData.length/this.chunkByteSize)),this.dispatchInfo("\u5B8C\u6210\u521D\u59CB\u5316\u6587\u4EF6\u4FE1\u606F\uFF0C\u603B\u5206\u7247\uFF1A"+this.totalChunks),this.currentDB&&(this.keys=await this.currentDB.keys())}getTotalChunks(){return this.totalChunks}pause(){this.cancelSource&&this.isStarting&&(this.cancelSource.cancel(),this.isStarting=!1),this.dispatchInfo("\u5DF2\u6682\u505C\u4E0B\u8F7D\u4EFB\u52A1")}restart(){this.dispatchInfo("\u6B63\u5728\u91CD\u542F\u4E0B\u8F7D\u4EFB\u52A1"),this.download()}delete(){this.cancelSource&&this.cancelSource.cancel(),Ee.dropInstance({name:this.fileID}),this.currentDB=void 0,this.keys&&(this.keys.length=0,this.keys=void 0),this.finishNum=0,this.downloadProgress(),this.outputProgress(0),this.dispatchInfo("\u5DF2\u5220\u9664\u4E0B\u8F7D\u4EFB\u52A1")}sleep(t){return new Promise(e=>setTimeout(e,t))}async download(t,e){let o=t;if(!o&&this.downloadURL&&(o=this.downloadURL),!o)throw Error("\u4E0B\u8F7DURL\u4E0D\u80FD\u4E3A\u7A7A!");this.currentDB||this.initIndexDB();const r=B.Axios.CancelToken;this.cancelSource=r.source(),this.isStarting=!0;const i={key:this.fileMetaData?.downloadID};let s=0;const c=this.cacheSize;let f=0;for(let g=0;g<this.totalChunks;g++){if(this.keys&&this.keys?.indexOf(g.toString())>=0){s++,s>this.finishNum&&(this.finishNum=s,this.downloadProgress());continue}const S=g*this.chunkByteSize;let E=S+this.chunkByteSize-1;this.fileMetaData&&E>this.fileMetaData.length&&(E=this.fileMetaData.length-1);const L={range:`bytes=${S}-${E}`};for(;f>=c;)await this.sleep(200);const O=g.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${g+1}/${this.totalChunks}`),f++,Ct(o,e,i,L,"arraybuffer",this.cancelSource?.token,this.requestTimeout).then(async I=>{const p=I.data;f--,await this.currentDB?.setItem(O,p),s++,s>this.finishNum&&(this.finishNum=s,this.downloadProgress());const l=parseInt(O)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${l}/${this.totalChunks}`),this.savefile()}).catch(I=>{f--;const p=parseInt(O)+1;this.dispatchError(`\u4E0B\u8F7D\u7B2C${p}\uFF09\u4E2A\u5206\u7247\u5185\u5BB9\u5931\u8D25\uFF01`)})}this.finishNum===this.totalChunks&&this.savefile()}downloadProgress(){const t=100*this.finishNum/this.totalChunks;this.dispatch("downloadProgress",t)}outputProgress(t){const e=100*t/this.totalChunks;this.dispatch("saveProgress",e)}async savefile(){if(this.finishNum===this.totalChunks){if(!this.fileName)return void this.dispatchError("\u4E0B\u8F7D\u9519\u8BEF\uFF1A\u6587\u4EF6\u540D\u4E3A\u7A7A!");this.dispatchInfo("\u5F00\u59CB\u4FDD\u5B58\u4E0B\u8F7D\u6587\u4EF6:"+this.fileName);const t=ta.createWriteStream(this.fileName).getWriter();let e=0;for(let o=0;o<this.totalChunks;o++){const r=o.toString();let i=await this.currentDB?.getItem(r);if(i||(i=await this.currentDB?.getItem(r)),!i)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${o+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);let s=new Response(i).body;if(s===null)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${o+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);const c=s.getReader();for(;;){const{done:f,value:g}=await c.read();if(f)break;await t.write(g)}e++,this.outputProgress(e),this.dispatchInfo(`\u5B8C\u6210\u7B2C${o+1}\u4E2A\u5206\u7247\u8F93\u51FA`)}t.close(),Ee.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}}function na(n,t){let e="",o="";for(const r in t)e+=r+"="+encodeURIComponent(t[r])+"&";return e=e.replace(/&$/,""),o=/\?$/.test(n)?n+e:n.replace(/\/?$/,"?")+e,o}function sr(n={},t={}){let e;for(e in t)Mt(t[e])?n[e]=sr(n[e],t[e]):n[e]=t[e];return n}function oa(n,t){const e=`${n}_${t}`;return ht.MD5(e)}function ar(n){const t=function(c){if(!c)return;const f=c,g=[];if(f)for(let S of f){const E=cr(S);E&&g.push(E)}return g}(n.bussinessRoutes),e=function(c){if(!c)return;const f=c;if(f&&f.length>0){const g=[];return f.forEach(S=>{const E=lr(S);E&&g.push(E)}),g}}(n.widgetMenuConfig),o=function(c){if(c&&c.length>0){const f=[];return c.forEach(g=>{const S=function(E){return E?{id:E.id,label:E.label,container:E.container,preload:E.preload,afterid:E.afterid,bindid:E.bindid,group:E.group}:void 0}(g);S&&f.push(S)}),f}}(n.widgetConfig),r=function(c){if(c&&c.length>0)return c}(n.functionList),i=n.pkgObject.version,s=n.pkgObject.name;return{id:oa(s,i),name:B.Config.UI.SiteTitle,group:B.Config.UI.Group,product:s,version:i,routes:t,widgetMenu:e,widgets:o,functions:r}}function cr(n){if(n){let t=0;n.meta?.hidden&&(t=1);let e={path:n.path,name:n.name,title:n.meta?.title,type:t,index:n.meta?.index};if(n.children){const o=[];for(let r of n.children){const i=cr(r);i&&o.push(i)}o.length>0&&(e.children=o)}return e}}function lr(n){if(!n)return;const t={name:n.name,index:n.index,path:n.path,type:n.type};return n.children&&n.children.length>0&&(t.children=[],n.children.forEach(e=>{const o=lr(e);o&&t.children?.push(o)})),t}function ra(n,t="IconifyList.ts"){let e="",o=`const iconlist={
9
+ `,r=0;n.forEach(i=>{const s=i.split(":");if(s&&s.length===2){const c="icon"+r;e+=`import ${c} from '~icons/${s[0]}/${s[1]}'
10
+ `,o+=` '${i}':${c},
11
11
  `,r++}}),r>0&&(o+=`};
12
- `,De(n+o+"export default iconlist;","IconifyList.ts"))}function rc(e,t){const n=Vr(e);yr(n,t),j.Message?.msg("\u5BFC\u51FA\u7CFB\u7EDF\u529F\u80FD\u6743\u9650\u6587\u4EF6\u6210\u529F\uFF01")}function ic(e){let t=e.replace(/(^\s*)|(\s*$)/g,"");return t=t.replace(/[^\d]/g,""),t=t.replace(/^0/g,""),t=t.replace(/^[1-9]\d\d{1,3}$/,"100"),t}function sc(e){let t=to(e);return t=t.replace(/^[1-9]\d\d{1,3}$/,"100"),t=t.replace(/^100\.$/,"100"),t}function to(e){let t=e.replace(/(^\s*)|(\s*$)/g,"");return t=t.replace(/[^\d.]/g,""),t=t.replace(/^0{2}$/g,"0"),t=t.replace(/^\./g,""),t=t.replace(".","$#$").replace(/\./g,"").replace("$#$","."),t=t.replace(/^(\-)*(\d+)\.(\d\d).*$/,"$1$2.$3"),t}function ac(e){let t=e.replace(/(^\s*)|(\s*$)/g,"");return t=t.replace(/[\.]*/g,""),t=t.replace(/(^0[\d]*)$/g,"0"),t=t.replace(/^0\d$/g,"0"),t=t.replace(/[^\d]/g,""),t}function cc(e){let t=e.replace(/[\u4e00-\u9fa5\s]+/g,"");return t=t.replace(/(^\s*)|(\s*$)/g,""),t}function lc(e){let t=e.replace(/[a-zA-Z]+/g,"");return t=t.replace(/(^\s*)|(\s*$)/g,""),t}function uc(e){return e.replace(/(^\s*)|(\s*$)/g,"")}function hc(e){let t=to(e);return t=t.toString().split("."),t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t=t.join("."),t}function dc(e,t="",n="red"){return t.replace(new RegExp(e,"gi"),`<span style='color: ${n}'>${e}</span>`)}function fc(e,t="\u4EDF\u4F70\u62FE\u4EBF\u4EDF\u4F70\u62FE\u4E07\u4EDF\u4F70\u62FE\u5143\u89D2\u5206",n=""){let o=(e+="00").indexOf(".");o>=0&&(e=e.substring(0,o)+e.substr(o+1,2)),t=t.substr(t.length-e.length);for(let r=0;r<e.length;r++)n+="\u96F6\u58F9\u8D30\u53C1\u8086\u4F0D\u9646\u67D2\u634C\u7396".substr(e.substr(r,1),1)+t.substr(r,1);return n=n.replace(/零角零分$/,"\u6574").replace(/零[仟佰拾]/g,"\u96F6").replace(/零{2,}/g,"\u96F6").replace(/零([亿|万])/g,"$1").replace(/零+元/,"\u5143").replace(/亿零{0,3}万/,"\u4EBF").replace(/^元/,"\u96F6\u5143")}function pc(e){return!!/^((12[0-9])|(13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0|1,5-9]))\d{8}$/.test(e)}function gc(e){return!!/\d{3}-\d{8}|\d{4}-\d{7}/.test(e)}function mc(e){return!!/^[a-zA-Z][a-zA-Z0-9_]{4,15}$/.test(e)}function vc(e){return!!/^[a-zA-Z]\w{5,15}$/.test(e)}function yc(e){return!!/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(e)}function wc(e){let t="";return/^(?:\d+|[a-zA-Z]+|[!@#$%^&\.*]+){6,16}$/.test(e)&&(t="\u5F31"),/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(e)&&(t="\u4E2D"),/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(e)&&(t="\u5F3A"),t}function bc(e){return!!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(e)}function _c(e){return!!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}function Sc(e){return!!/^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(e)}function Cc(e){return!!/^[\u4e00-\u9fa5]{1,6}(·[\u4e00-\u9fa5]{1,6}){0,2}$/.test(e)}function Ec(e){return!!/^[1-9][0-9]{5}$/.test(e)}function xc(e){return!!/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(e)}function kc(e){return!!/^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/.test(e)}let Jr=!0;try{String.fromCharCode.apply(String,[1,2])}catch{Jr=!1,Object.defineProperty(Array.prototype,"subarray",{value:Array.prototype.slice})}var eo=2654435769;function Yr(e,t){var n=e.length,o=n<<2;if(t){var r=e[n-1];if(r<(o-=4)-3||r>o)return null;o=r}for(var i=new Uint8Array(o),s=0;s<o;++s)i[s]=e[s>>2]>>((3&s)<<3);return i}function je(e,t){var n,o=e.length,r=o>>2;3&o&&++r,t?(n=new Uint32Array(r+1))[r]=o:n=new Uint32Array(r);for(var i=0;i<o;++i)n[i>>2]|=e[i]<<((3&i)<<3);return n}function Bt(e){return 4294967295&e}function Oe(e,t,n,o,r,i){return(n>>>5^t<<2)+(t>>>3^n<<4)^(e^t)+(i[3&o^r]^n)}function Zr(e){if(e.length<16){var t=new Uint8Array(16);t.set(e),e=t}return e}function We(e){for(var t=e.length,n=new Uint8Array(3*t),o=0,r=0;r<t;r++){var i=e.charCodeAt(r);if(i<128)n[o++]=i;else if(i<2048)n[o++]=192|i>>6,n[o++]=128|63&i;else{if(!(i<55296||i>57343)){if(r+1<t){var s=e.charCodeAt(r+1);if(i<56320&&56320<=s&&s<=57343){var a=65536+((1023&i)<<10|1023&s);n[o++]=240|a>>18,n[o++]=128|a>>12&63,n[o++]=128|a>>6&63,n[o++]=128|63&a,r++;continue}}throw new Error("Malformed string")}n[o++]=224|i>>12,n[o++]=128|i>>6&63,n[o++]=128|63&i}}return n.subarray(0,o)}function Qr(e){var t=e.length;return t===0?"":t<32767?function(n,o){for(var r=new Array(o),i=0,s=0,a=n.length;i<o&&s<a;i++){var l=n[s++];switch(l>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:r[i]=l;break;case 12:case 13:if(!(s<a))throw new Error("Unfinished UTF-8 octet sequence");r[i]=(31&l)<<6|63&n[s++];break;case 14:if(!(s+1<a))throw new Error("Unfinished UTF-8 octet sequence");r[i]=(15&l)<<12|(63&n[s++])<<6|63&n[s++];break;case 15:if(!(s+2<a))throw new Error("Unfinished UTF-8 octet sequence");var h=((7&l)<<18|(63&n[s++])<<12|(63&n[s++])<<6|63&n[s++])-65536;if(!(0<=h&&h<=1048575))throw new Error("Character outside valid Unicode range: 0x"+h.toString(16));r[i++]=h>>10&1023|55296,r[i]=1023&h|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+l.toString(16))}}return i<o&&(r.length=i),String.fromCharCode.apply(String,r)}(e,t):function(n,o){for(var r=[],i=new Array(32768),s=0,a=0,l=n.length;s<o&&a<l;s++){var h=n[a++];switch(h>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:i[s]=h;break;case 12:case 13:if(!(a<l))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(31&h)<<6|63&n[a++];break;case 14:if(!(a+1<l))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(15&h)<<12|(63&n[a++])<<6|63&n[a++];break;case 15:if(!(a+2<l))throw new Error("Unfinished UTF-8 octet sequence");var w=((7&h)<<18|(63&n[a++])<<12|(63&n[a++])<<6|63&n[a++])-65536;if(!(0<=w&&w<=1048575))throw new Error("Character outside valid Unicode range: 0x"+w.toString(16));i[s++]=w>>10&1023|55296,i[s]=1023&w|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+h.toString(16))}if(s>=32766){var _=s+1;i.length=_,r.push(String.fromCharCode.apply(String,i)),o-=_,s=-1}}return s>0&&(i.length=s,r.push(String.fromCharCode.apply(String,i))),r.join("")}(e,t)}function Ic(e){var t=e.length;if(t===0)return"";var n=Jr?e:function(a){for(var l=a.length,h=new Array(a.length),w=0;w<l;++w)h[w]=a[w];return h}(e);if(t<65535)return String.fromCharCode.apply(String,n);for(var o=32767&t,r=t>>15,i=new Array(o?r+1:r),s=0;s<r;++s)i[s]=String.fromCharCode.apply(String,n.subarray(s<<15,s+1<<15));return o&&(i[r]=String.fromCharCode.apply(String,n.subarray(r<<15,t))),i.join("")}function ti(e,t){return typeof e=="string"&&(e=We(e)),typeof t=="string"&&(t=We(t)),e==null||e.length===0?e:Yr(function(n,o){var r,i,s,a,l,h,w=n.length,_=w-1;for(i=n[_],s=0,h=0|Math.floor(6+52/w);h>0;--h){for(a=(s=Bt(s+eo))>>>2&3,l=0;l<_;++l)r=n[l+1],i=n[l]=Bt(n[l]+Oe(s,r,i,l,a,o));r=n[0],i=n[_]=Bt(n[_]+Oe(s,r,i,_,a,o))}return n}(je(e,!0),je(Zr(t),!1)),!1)}function ei(e,t){return typeof e=="string"&&(e=function(n){for(var o=window.atob(n),r=o.length,i=new Uint8Array(r),s=0;s<r;s++)i[s]=o.charCodeAt(s);return i}(e)),typeof t=="string"&&(t=We(t)),e==null||e.length===0?e:Yr(function(n,o){var r,i,s,a,l,h=n.length,w=h-1;for(r=n[0],s=Bt(Math.floor(6+52/h)*eo);s!==0;s=Bt(s-eo)){for(a=s>>>2&3,l=w;l>0;--l)i=n[l-1],r=n[l]=Bt(n[l]-Oe(s,r,i,l,a,o));i=n[w],r=n[0]=Bt(n[0]-Oe(s,r,i,0,a,o))}return n}(je(e,!1),je(Zr(t),!1)),!0)}const ie={toBytes:We,toString:Qr,encrypt:ti,encryptToString:function(e,t){return window.btoa(Ic(ti(e,t)))},decrypt:ei,decryptToString:function(e,t){return Qr(ei(e,t))}},ni=e=>{const t="1.23452384164.123412416";document.getElementById(t)!==null&&document.body.removeChild(document.getElementById(t));const n=document.createElement("canvas");n.width=200,n.height=130;const o=n.getContext("2d");o.rotate(-20*Math.PI/180),o.font="12px Vedana",o.fillStyle="rgba(200, 200, 200, 0.30)",o.textBaseline="middle",o.fillText(e,n.width/10,n.height/2);const r=document.createElement("div");return r.id=t,r.style.pointerEvents="none",r.style.top="0px",r.style.left="0px",r.style.position="fixed",r.style.zIndex="10000000",r.style.width=`${document.documentElement.clientWidth}px`,r.style.height=`${document.documentElement.clientHeight}px`,r.style.background=`url(${n.toDataURL("image/png")}) left top repeat`,document.body.appendChild(r),t},Tc={set:e=>{let t=ni(e);document.getElementById(t)===null&&(t=ni(e))},del:()=>{let e="1.23452384164.123412416";document.getElementById(e)!==null&&document.body.removeChild(document.getElementById(e))}};class jt extends Error{constructor(t,n){const o=new.target.prototype;super(`${t}: Status code '${n}'`),this.statusCode=n,this.__proto__=o}}class no extends Error{constructor(t="A timeout occurred."){const n=new.target.prototype;super(t),this.__proto__=n}}class bt extends Error{constructor(t="An abort occurred."){const n=new.target.prototype;super(t),this.__proto__=n}}class Rc extends Error{constructor(t,n){const o=new.target.prototype;super(t),this.transport=n,this.errorType="UnsupportedTransportError",this.__proto__=o}}class Mc extends Error{constructor(t,n){const o=new.target.prototype;super(t),this.transport=n,this.errorType="DisabledTransportError",this.__proto__=o}}class Pc extends Error{constructor(t,n){const o=new.target.prototype;super(t),this.transport=n,this.errorType="FailedToStartTransportError",this.__proto__=o}}class oi extends Error{constructor(t){const n=new.target.prototype;super(t),this.errorType="FailedToNegotiateWithServerError",this.__proto__=n}}class zc extends Error{constructor(t,n){const o=new.target.prototype;super(t),this.innerErrors=n,this.__proto__=o}}class ri{constructor(t,n,o){this.statusCode=t,this.statusText=n,this.content=o}}class Ue{get(t,n){return this.send({...n,method:"GET",url:t})}post(t,n){return this.send({...n,method:"POST",url:t})}delete(t,n){return this.send({...n,method:"DELETE",url:t})}getCookieString(t){return""}}var x;(function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Information=2]="Information",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Critical=5]="Critical",e[e.None=6]="None"})(x||(x={}));class se{constructor(){}log(t,n){}}se.instance=new se;class ot{static isRequired(t,n){if(t==null)throw new Error(`The '${n}' argument is required.`)}static isNotEmpty(t,n){if(!t||t.match(/^\s*$/))throw new Error(`The '${n}' argument should not be empty.`)}static isIn(t,n,o){if(!(t in n))throw new Error(`Unknown ${o} value: ${t}.`)}}class tt{static get isBrowser(){return!tt.isNode&&typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return!tt.isNode&&typeof self=="object"&&"importScripts"in self}static get isReactNative(){return!tt.isNode&&typeof window=="object"&&window.document===void 0}static get isNode(){return typeof process<"u"&&process.release&&process.release.name==="node"}}function ae(e,t){let n="";return Ot(e)?(n=`Binary data of length ${e.byteLength}`,t&&(n+=`. Content: '${function(o){const r=new Uint8Array(o);let i="";return r.forEach(s=>{i+=`0x${s<16?"0":""}${s.toString(16)} `}),i.substr(0,i.length-1)}(e)}'`)):typeof e=="string"&&(n=`String data of length ${e.length}`,t&&(n+=`. Content: '${e}'`)),n}function Ot(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&e.constructor.name==="ArrayBuffer")}async function ii(e,t,n,o,r,i){const s={},[a,l]=Kt();s[a]=l,e.log(x.Trace,`(${t} transport) sending data. ${ae(r,i.logMessageContent)}.`);const h=Ot(r)?"arraybuffer":"text",w=await n.post(o,{content:r,headers:{...s,...i.headers},responseType:h,timeout:i.timeout,withCredentials:i.withCredentials});e.log(x.Trace,`(${t} transport) request complete. Response status: ${w.statusCode}.`)}class Ac{constructor(t,n){this._subject=t,this._observer=n}dispose(){const t=this._subject.observers.indexOf(this._observer);t>-1&&this._subject.observers.splice(t,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(n=>{})}}class Fe{constructor(t){this._minLevel=t,this.out=console}log(t,n){if(t>=this._minLevel){const o=`[${new Date().toISOString()}] ${x[t]}: ${n}`;switch(t){case x.Critical:case x.Error:this.out.error(o);break;case x.Warning:this.out.warn(o);break;case x.Information:this.out.info(o);break;default:this.out.log(o)}}}}function Kt(){let e="X-SignalR-User-Agent";return tt.isNode&&(e="User-Agent"),[e,Lc("8.0.7",Dc(),Nc(),$c())]}function Lc(e,t,n,o){let r="Microsoft SignalR/";const i=e.split(".");return r+=`${i[0]}.${i[1]}`,r+=` (${e}; `,r+=t&&t!==""?`${t}; `:"Unknown OS; ",r+=`${n}`,r+=o?`; ${o}`:"; Unknown Runtime Version",r+=")",r}function Dc(){if(!tt.isNode)return"";switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}}function $c(){if(tt.isNode)return process.versions.node}function Nc(){return tt.isNode?"NodeJS":"Browser"}function oo(e){return e.stack?e.stack:e.message?e.message:`${e}`}class Bc extends Ue{constructor(t){if(super(),this._logger=t,typeof fetch>"u"||tt.isNode){const n=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._jar=new(n("tough-cookie")).CookieJar,typeof fetch>"u"?this._fetchType=n("node-fetch"):this._fetchType=fetch,this._fetchType=n("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("could not find global")}());if(typeof AbortController>"u"){const n=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._abortControllerType=n("abort-controller")}else this._abortControllerType=AbortController}async send(t){if(t.abortSignal&&t.abortSignal.aborted)throw new bt;if(!t.method)throw new Error("No method defined.");if(!t.url)throw new Error("No url defined.");const n=new this._abortControllerType;let o;t.abortSignal&&(t.abortSignal.onabort=()=>{n.abort(),o=new bt});let r,i=null;if(t.timeout){const l=t.timeout;i=setTimeout(()=>{n.abort(),this._logger.log(x.Warning,"Timeout from HTTP request."),o=new no},l)}t.content===""&&(t.content=void 0),t.content&&(t.headers=t.headers||{},Ot(t.content)?t.headers["Content-Type"]="application/octet-stream":t.headers["Content-Type"]="text/plain;charset=UTF-8");try{r=await this._fetchType(t.url,{body:t.content,cache:"no-cache",credentials:t.withCredentials===!0?"include":"same-origin",headers:{"X-Requested-With":"XMLHttpRequest",...t.headers},method:t.method,mode:"cors",redirect:"follow",signal:n.signal})}catch(l){throw o||(this._logger.log(x.Warning,`Error from HTTP request. ${l}.`),l)}finally{i&&clearTimeout(i),t.abortSignal&&(t.abortSignal.onabort=null)}if(!r.ok){const l=await si(r,"text");throw new jt(l||r.statusText,r.status)}const s=si(r,t.responseType),a=await s;return new ri(r.status,r.statusText,a)}getCookieString(t){let n="";return tt.isNode&&this._jar&&this._jar.getCookies(t,(o,r)=>n=r.join("; ")),n}}function si(e,t){let n;switch(t){case"arraybuffer":n=e.arrayBuffer();break;case"text":default:n=e.text();break;case"blob":case"document":case"json":throw new Error(`${t} is not supported.`)}return n}class jc extends Ue{constructor(t){super(),this._logger=t}send(t){return t.abortSignal&&t.abortSignal.aborted?Promise.reject(new bt):t.method?t.url?new Promise((n,o)=>{const r=new XMLHttpRequest;r.open(t.method,t.url,!0),r.withCredentials=t.withCredentials===void 0||t.withCredentials,r.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.content===""&&(t.content=void 0),t.content&&(Ot(t.content)?r.setRequestHeader("Content-Type","application/octet-stream"):r.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const i=t.headers;i&&Object.keys(i).forEach(s=>{r.setRequestHeader(s,i[s])}),t.responseType&&(r.responseType=t.responseType),t.abortSignal&&(t.abortSignal.onabort=()=>{r.abort(),o(new bt)}),t.timeout&&(r.timeout=t.timeout),r.onload=()=>{t.abortSignal&&(t.abortSignal.onabort=null),r.status>=200&&r.status<300?n(new ri(r.status,r.statusText,r.response||r.responseText)):o(new jt(r.response||r.responseText||r.statusText,r.status))},r.onerror=()=>{this._logger.log(x.Warning,`Error from HTTP request. ${r.status}: ${r.statusText}.`),o(new jt(r.statusText,r.status))},r.ontimeout=()=>{this._logger.log(x.Warning,"Timeout from HTTP request."),o(new no)},r.send(t.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class Oc extends Ue{constructor(t){if(super(),typeof fetch<"u"||tt.isNode)this._httpClient=new Bc(t);else{if(typeof XMLHttpRequest>"u")throw new Error("No usable HttpClient found.");this._httpClient=new jc(t)}}send(t){return t.abortSignal&&t.abortSignal.aborted?Promise.reject(new bt):t.method?t.url?this._httpClient.send(t):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(t){return this._httpClient.getCookieString(t)}}class mt{static write(t){return`${t}${mt.RecordSeparator}`}static parse(t){if(t[t.length-1]!==mt.RecordSeparator)throw new Error("Message is incomplete.");const n=t.split(mt.RecordSeparator);return n.pop(),n}}mt.RecordSeparatorCode=30,mt.RecordSeparator=String.fromCharCode(mt.RecordSeparatorCode);class Wc{writeHandshakeRequest(t){return mt.write(JSON.stringify(t))}parseHandshakeResponse(t){let n,o;if(Ot(t)){const s=new Uint8Array(t),a=s.indexOf(mt.RecordSeparatorCode);if(a===-1)throw new Error("Message is incomplete.");const l=a+1;n=String.fromCharCode.apply(null,Array.prototype.slice.call(s.slice(0,l))),o=s.byteLength>l?s.slice(l).buffer:null}else{const s=t,a=s.indexOf(mt.RecordSeparator);if(a===-1)throw new Error("Message is incomplete.");const l=a+1;n=s.substring(0,l),o=s.length>l?s.substring(l):null}const r=mt.parse(n),i=JSON.parse(r[0]);if(i.type)throw new Error("Expected a handshake response from the server.");return[o,i]}}var F;(function(e){e[e.Invocation=1]="Invocation",e[e.StreamItem=2]="StreamItem",e[e.Completion=3]="Completion",e[e.StreamInvocation=4]="StreamInvocation",e[e.CancelInvocation=5]="CancelInvocation",e[e.Ping=6]="Ping",e[e.Close=7]="Close",e[e.Ack=8]="Ack",e[e.Sequence=9]="Sequence"})(F||(F={}));class Uc{constructor(){this.observers=[]}next(t){for(const n of this.observers)n.next(t)}error(t){for(const n of this.observers)n.error&&n.error(t)}complete(){for(const t of this.observers)t.complete&&t.complete()}subscribe(t){return this.observers.push(t),new Ac(this,t)}}class Fc{constructor(t,n,o){this._bufferSize=1e5,this._messages=[],this._totalMessageCount=0,this._waitForSequenceMessage=!1,this._nextReceivingSequenceId=1,this._latestReceivedSequenceId=0,this._bufferedByteCount=0,this._reconnectInProgress=!1,this._protocol=t,this._connection=n,this._bufferSize=o}async _send(t){const n=this._protocol.writeMessage(t);let o=Promise.resolve();if(this._isInvocationMessage(t)){this._totalMessageCount++;let r=()=>{},i=()=>{};Ot(n)?this._bufferedByteCount+=n.byteLength:this._bufferedByteCount+=n.length,this._bufferedByteCount>=this._bufferSize&&(o=new Promise((s,a)=>{r=s,i=a})),this._messages.push(new Hc(n,this._totalMessageCount,r,i))}try{this._reconnectInProgress||await this._connection.send(n)}catch{this._disconnected()}await o}_ack(t){let n=-1;for(let o=0;o<this._messages.length;o++){const r=this._messages[o];if(r._id<=t.sequenceId)n=o,Ot(r._message)?this._bufferedByteCount-=r._message.byteLength:this._bufferedByteCount-=r._message.length,r._resolver();else{if(!(this._bufferedByteCount<this._bufferSize))break;r._resolver()}}n!==-1&&(this._messages=this._messages.slice(n+1))}_shouldProcessMessage(t){if(this._waitForSequenceMessage)return t.type===F.Sequence&&(this._waitForSequenceMessage=!1,!0);if(!this._isInvocationMessage(t))return!0;const n=this._nextReceivingSequenceId;return this._nextReceivingSequenceId++,n<=this._latestReceivedSequenceId?(n===this._latestReceivedSequenceId&&this._ackTimer(),!1):(this._latestReceivedSequenceId=n,this._ackTimer(),!0)}_resetSequence(t){t.sequenceId>this._nextReceivingSequenceId?this._connection.stop(new Error("Sequence ID greater than amount of messages we've received.")):this._nextReceivingSequenceId=t.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}async _resend(){const t=this._messages.length!==0?this._messages[0]._id:this._totalMessageCount+1;await this._connection.send(this._protocol.writeMessage({type:F.Sequence,sequenceId:t}));const n=this._messages;for(const o of n)await this._connection.send(o._message);this._reconnectInProgress=!1}_dispose(t){t!=null||(t=new Error("Unable to reconnect to server."));for(const n of this._messages)n._rejector(t)}_isInvocationMessage(t){switch(t.type){case F.Invocation:case F.StreamItem:case F.Completion:case F.StreamInvocation:case F.CancelInvocation:return!0;case F.Close:case F.Sequence:case F.Ping:case F.Ack:return!1}}_ackTimer(){this._ackTimerHandle===void 0&&(this._ackTimerHandle=setTimeout(async()=>{try{this._reconnectInProgress||await this._connection.send(this._protocol.writeMessage({type:F.Ack,sequenceId:this._latestReceivedSequenceId}))}catch{}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0},1e3))}}class Hc{constructor(t,n,o,r){this._message=t,this._id=n,this._resolver=o,this._rejector=r}}var Y;(function(e){e.Disconnected="Disconnected",e.Connecting="Connecting",e.Connected="Connected",e.Disconnecting="Disconnecting",e.Reconnecting="Reconnecting"})(Y||(Y={}));class $o{static create(t,n,o,r,i,s,a){return new $o(t,n,o,r,i,s,a)}constructor(t,n,o,r,i,s,a){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(x.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},ot.isRequired(t,"connection"),ot.isRequired(n,"logger"),ot.isRequired(o,"protocol"),this.serverTimeoutInMilliseconds=i??3e4,this.keepAliveIntervalInMilliseconds=s??15e3,this._statefulReconnectBufferSize=a??1e5,this._logger=n,this._protocol=o,this.connection=t,this._reconnectPolicy=r,this._handshakeProtocol=new Wc,this.connection.onreceive=l=>this._processIncomingData(l),this.connection.onclose=l=>this._connectionClosed(l),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=Y.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:F.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(t){if(this._connectionState!==Y.Disconnected&&this._connectionState!==Y.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!t)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=t}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}async _startWithStateTransitions(){if(this._connectionState!==Y.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=Y.Connecting,this._logger.log(x.Debug,"Starting HubConnection.");try{await this._startInternal(),tt.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=Y.Connected,this._connectionStarted=!0,this._logger.log(x.Debug,"HubConnection connected successfully.")}catch(t){return this._connectionState=Y.Disconnected,this._logger.log(x.Debug,`HubConnection failed to start successfully because of error '${t}'.`),Promise.reject(t)}}async _startInternal(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;const t=new Promise((n,o)=>{this._handshakeResolver=n,this._handshakeRejecter=o});await this.connection.start(this._protocol.transferFormat);try{let n=this._protocol.version;this.connection.features.reconnect||(n=1);const o={protocol:this._protocol.name,version:n};if(this._logger.log(x.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(o)),this._logger.log(x.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await t,this._stopDuringStartError)throw this._stopDuringStartError;this.connection.features.reconnect&&(this._messageBuffer=new Fc(this._protocol,this.connection,this._statefulReconnectBufferSize),this.connection.features.disconnected=this._messageBuffer._disconnected.bind(this._messageBuffer),this.connection.features.resend=()=>{if(this._messageBuffer)return this._messageBuffer._resend()}),this.connection.features.inherentKeepAlive||await this._sendMessage(this._cachedPingMessage)}catch(n){throw this._logger.log(x.Debug,`Hub handshake failed with error '${n}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(n),n}}async stop(){const t=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),await this._stopPromise;try{await t}catch{}}_stopInternal(t){if(this._connectionState===Y.Disconnected)return this._logger.log(x.Debug,`Call to HubConnection.stop(${t}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===Y.Disconnecting)return this._logger.log(x.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;const n=this._connectionState;return this._connectionState=Y.Disconnecting,this._logger.log(x.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(x.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(n===Y.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=t||new bt("The connection was stopped before the hub handshake could complete."),this.connection.stop(t))}async _sendCloseMessage(){try{await this._sendWithProtocol(this._createCloseMessage())}catch{}}stream(t,...n){const[o,r]=this._replaceStreamingParams(n),i=this._createStreamInvocation(t,n,r);let s;const a=new Uc;return a.cancelCallback=()=>{const l=this._createCancelInvocation(i.invocationId);return delete this._callbacks[i.invocationId],s.then(()=>this._sendWithProtocol(l))},this._callbacks[i.invocationId]=(l,h)=>{h?a.error(h):l&&(l.type===F.Completion?l.error?a.error(new Error(l.error)):a.complete():a.next(l.item))},s=this._sendWithProtocol(i).catch(l=>{a.error(l),delete this._callbacks[i.invocationId]}),this._launchStreams(o,s),a}_sendMessage(t){return this._resetKeepAliveInterval(),this.connection.send(t)}_sendWithProtocol(t){return this._messageBuffer?this._messageBuffer._send(t):this._sendMessage(this._protocol.writeMessage(t))}send(t,...n){const[o,r]=this._replaceStreamingParams(n),i=this._sendWithProtocol(this._createInvocation(t,n,!0,r));return this._launchStreams(o,i),i}invoke(t,...n){const[o,r]=this._replaceStreamingParams(n),i=this._createInvocation(t,n,!1,r);return new Promise((a,l)=>{this._callbacks[i.invocationId]=(w,_)=>{_?l(_):w&&(w.type===F.Completion?w.error?l(new Error(w.error)):a(w.result):l(new Error(`Unexpected message type: ${w.type}`)))};const h=this._sendWithProtocol(i).catch(w=>{l(w),delete this._callbacks[i.invocationId]});this._launchStreams(o,h)})}on(t,n){t&&n&&(t=t.toLowerCase(),this._methods[t]||(this._methods[t]=[]),this._methods[t].indexOf(n)===-1&&this._methods[t].push(n))}off(t,n){if(!t)return;t=t.toLowerCase();const o=this._methods[t];if(o)if(n){const r=o.indexOf(n);r!==-1&&(o.splice(r,1),o.length===0&&delete this._methods[t])}else delete this._methods[t]}onclose(t){t&&this._closedCallbacks.push(t)}onreconnecting(t){t&&this._reconnectingCallbacks.push(t)}onreconnected(t){t&&this._reconnectedCallbacks.push(t)}_processIncomingData(t){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(t=this._processHandshakeResponse(t),this._receivedHandshakeResponse=!0),t){const n=this._protocol.parseMessages(t,this._logger);for(const o of n)if(!this._messageBuffer||this._messageBuffer._shouldProcessMessage(o))switch(o.type){case F.Invocation:this._invokeClientMethod(o).catch(r=>{this._logger.log(x.Error,`Invoke client method threw error: ${oo(r)}`)});break;case F.StreamItem:case F.Completion:{const r=this._callbacks[o.invocationId];if(r){o.type===F.Completion&&delete this._callbacks[o.invocationId];try{r(o)}catch(i){this._logger.log(x.Error,`Stream callback threw error: ${oo(i)}`)}}break}case F.Ping:break;case F.Close:{this._logger.log(x.Information,"Close message received from server.");const r=o.error?new Error("Server returned an error on close: "+o.error):void 0;o.allowReconnect===!0?this.connection.stop(r):this._stopPromise=this._stopInternal(r);break}case F.Ack:this._messageBuffer&&this._messageBuffer._ack(o);break;case F.Sequence:this._messageBuffer&&this._messageBuffer._resetSequence(o);break;default:this._logger.log(x.Warning,`Invalid message type: ${o.type}.`)}}this._resetTimeoutPeriod()}_processHandshakeResponse(t){let n,o;try{[o,n]=this._handshakeProtocol.parseHandshakeResponse(t)}catch(r){const i="Error parsing handshake response: "+r;this._logger.log(x.Error,i);const s=new Error(i);throw this._handshakeRejecter(s),s}if(n.error){const r="Server returned handshake error: "+n.error;this._logger.log(x.Error,r);const i=new Error(r);throw this._handshakeRejecter(i),i}return this._logger.log(x.Debug,"Server handshake complete."),this._handshakeResolver(),o}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=new Date().getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if(!(this.connection.features&&this.connection.features.inherentKeepAlive||(this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds),this._pingServerHandle!==void 0))){let t=this._nextKeepAlive-new Date().getTime();t<0&&(t=0),this._pingServerHandle=setTimeout(async()=>{if(this._connectionState===Y.Connected)try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}},t)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}async _invokeClientMethod(t){const n=t.target.toLowerCase(),o=this._methods[n];if(!o)return this._logger.log(x.Warning,`No client method with the name '${n}' found.`),void(t.invocationId&&(this._logger.log(x.Warning,`No result given for '${n}' method and invocation ID '${t.invocationId}'.`),await this._sendWithProtocol(this._createCompletionMessage(t.invocationId,"Client didn't provide a result.",null))));const r=o.slice(),i=!!t.invocationId;let s,a,l;for(const h of r)try{const w=s;s=await h.apply(this,t.arguments),i&&s&&w&&(this._logger.log(x.Error,`Multiple results provided for '${n}'. Sending error to server.`),l=this._createCompletionMessage(t.invocationId,"Client provided multiple results.",null)),a=void 0}catch(w){a=w,this._logger.log(x.Error,`A callback for the method '${n}' threw error '${w}'.`)}l?await this._sendWithProtocol(l):i?(a?l=this._createCompletionMessage(t.invocationId,`${a}`,null):s!==void 0?l=this._createCompletionMessage(t.invocationId,null,s):(this._logger.log(x.Warning,`No result given for '${n}' method and invocation ID '${t.invocationId}'.`),l=this._createCompletionMessage(t.invocationId,"Client didn't provide a result.",null)),await this._sendWithProtocol(l)):s&&this._logger.log(x.Error,`Result given for '${n}' method but server is not expecting a result.`)}_connectionClosed(t){this._logger.log(x.Debug,`HubConnection.connectionClosed(${t}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||t||new bt("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(t||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===Y.Disconnecting?this._completeClose(t):this._connectionState===Y.Connected&&this._reconnectPolicy?this._reconnect(t):this._connectionState===Y.Connected&&this._completeClose(t)}_completeClose(t){if(this._connectionStarted){this._connectionState=Y.Disconnected,this._connectionStarted=!1,this._messageBuffer&&(this._messageBuffer._dispose(t??new Error("Connection closed.")),this._messageBuffer=void 0),tt.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(n=>n.apply(this,[t]))}catch(n){this._logger.log(x.Error,`An onclose callback called with error '${t}' threw error '${n}'.`)}}}async _reconnect(t){const n=Date.now();let o=0,r=t!==void 0?t:new Error("Attempting to reconnect due to a unknown error."),i=this._getNextRetryDelay(o++,0,r);if(i===null)return this._logger.log(x.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(t);if(this._connectionState=Y.Reconnecting,t?this._logger.log(x.Information,`Connection reconnecting because of error '${t}'.`):this._logger.log(x.Information,"Connection reconnecting."),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(s=>s.apply(this,[t]))}catch(s){this._logger.log(x.Error,`An onreconnecting callback called with error '${t}' threw error '${s}'.`)}if(this._connectionState!==Y.Reconnecting)return void this._logger.log(x.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;i!==null;){if(this._logger.log(x.Information,`Reconnect attempt number ${o} will start in ${i} ms.`),await new Promise(s=>{this._reconnectDelayHandle=setTimeout(s,i)}),this._reconnectDelayHandle=void 0,this._connectionState!==Y.Reconnecting)return void this._logger.log(x.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=Y.Connected,this._logger.log(x.Information,"HubConnection reconnected successfully."),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(s=>s.apply(this,[this.connection.connectionId]))}catch(s){this._logger.log(x.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${s}'.`)}return}catch(s){if(this._logger.log(x.Information,`Reconnect attempt failed because of error '${s}'.`),this._connectionState!==Y.Reconnecting)return this._logger.log(x.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this._connectionState===Y.Disconnecting&&this._completeClose());r=s instanceof Error?s:new Error(s.toString()),i=this._getNextRetryDelay(o++,Date.now()-n,r)}}this._logger.log(x.Information,`Reconnect retries have been exhausted after ${Date.now()-n} ms and ${o} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(t,n,o){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:n,previousRetryCount:t,retryReason:o})}catch(r){return this._logger.log(x.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${t}, ${n}) threw error '${r}'.`),null}}_cancelCallbacksWithError(t){const n=this._callbacks;this._callbacks={},Object.keys(n).forEach(o=>{const r=n[o];try{r(null,t)}catch(i){this._logger.log(x.Error,`Stream 'error' callback called with '${t}' threw error: ${oo(i)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(t,n,o,r){if(o)return r.length!==0?{arguments:n,streamIds:r,target:t,type:F.Invocation}:{arguments:n,target:t,type:F.Invocation};{const i=this._invocationId;return this._invocationId++,r.length!==0?{arguments:n,invocationId:i.toString(),streamIds:r,target:t,type:F.Invocation}:{arguments:n,invocationId:i.toString(),target:t,type:F.Invocation}}}_launchStreams(t,n){if(t.length!==0){n||(n=Promise.resolve());for(const o in t)t[o].subscribe({complete:()=>{n=n.then(()=>this._sendWithProtocol(this._createCompletionMessage(o)))},error:r=>{let i;i=r instanceof Error?r.message:r&&r.toString?r.toString():"Unknown error",n=n.then(()=>this._sendWithProtocol(this._createCompletionMessage(o,i)))},next:r=>{n=n.then(()=>this._sendWithProtocol(this._createStreamItemMessage(o,r)))}})}}_replaceStreamingParams(t){const n=[],o=[];for(let r=0;r<t.length;r++){const i=t[r];if(this._isObservable(i)){const s=this._invocationId;this._invocationId++,n[s]=i,o.push(s.toString()),t.splice(r,1)}}return[n,o]}_isObservable(t){return t&&t.subscribe&&typeof t.subscribe=="function"}_createStreamInvocation(t,n,o){const r=this._invocationId;return this._invocationId++,o.length!==0?{arguments:n,invocationId:r.toString(),streamIds:o,target:t,type:F.StreamInvocation}:{arguments:n,invocationId:r.toString(),target:t,type:F.StreamInvocation}}_createCancelInvocation(t){return{invocationId:t,type:F.CancelInvocation}}_createStreamItemMessage(t,n){return{invocationId:t,item:n,type:F.StreamItem}}_createCompletionMessage(t,n,o){return n?{error:n,invocationId:t,type:F.Completion}:{invocationId:t,result:o,type:F.Completion}}_createCloseMessage(){return{type:F.Close}}}const qc=[0,2e3,1e4,3e4,null];class ai{constructor(t){this._retryDelays=t!==void 0?[...t,null]:qc}nextRetryDelayInMilliseconds(t){return this._retryDelays[t.previousRetryCount]}}class Wt{}Wt.Authorization="Authorization",Wt.Cookie="Cookie";class Xc extends Ue{constructor(t,n){super(),this._innerClient=t,this._accessTokenFactory=n}async send(t){let n=!0;this._accessTokenFactory&&(!this._accessToken||t.url&&t.url.indexOf("/negotiate?")>0)&&(n=!1,this._accessToken=await this._accessTokenFactory()),this._setAuthorizationHeader(t);const o=await this._innerClient.send(t);return n&&o.statusCode===401&&this._accessTokenFactory?(this._accessToken=await this._accessTokenFactory(),this._setAuthorizationHeader(t),await this._innerClient.send(t)):o}_setAuthorizationHeader(t){t.headers||(t.headers={}),this._accessToken?t.headers[Wt.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&t.headers[Wt.Authorization]&&delete t.headers[Wt.Authorization]}getCookieString(t){return this._innerClient.getCookieString(t)}}var rt,ut;(function(e){e[e.None=0]="None",e[e.WebSockets=1]="WebSockets",e[e.ServerSentEvents=2]="ServerSentEvents",e[e.LongPolling=4]="LongPolling"})(rt||(rt={})),function(e){e[e.Text=1]="Text",e[e.Binary=2]="Binary"}(ut||(ut={}));class Vc{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}}class ci{get pollAborted(){return this._pollAbort.aborted}constructor(t,n,o){this._httpClient=t,this._logger=n,this._pollAbort=new Vc,this._options=o,this._running=!1,this.onreceive=null,this.onclose=null}async connect(t,n){if(ot.isRequired(t,"url"),ot.isRequired(n,"transferFormat"),ot.isIn(n,ut,"transferFormat"),this._url=t,this._logger.log(x.Trace,"(LongPolling transport) Connecting."),n===ut.Binary&&typeof XMLHttpRequest<"u"&&typeof new XMLHttpRequest().responseType!="string")throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[o,r]=Kt(),i={[o]:r,...this._options.headers},s={abortSignal:this._pollAbort.signal,headers:i,timeout:1e5,withCredentials:this._options.withCredentials};n===ut.Binary&&(s.responseType="arraybuffer");const a=`${t}&_=${Date.now()}`;this._logger.log(x.Trace,`(LongPolling transport) polling: ${a}.`);const l=await this._httpClient.get(a,s);l.statusCode!==200?(this._logger.log(x.Error,`(LongPolling transport) Unexpected response code: ${l.statusCode}.`),this._closeError=new jt(l.statusText||"",l.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,s)}async _poll(t,n){try{for(;this._running;)try{const o=`${t}&_=${Date.now()}`;this._logger.log(x.Trace,`(LongPolling transport) polling: ${o}.`);const r=await this._httpClient.get(o,n);r.statusCode===204?(this._logger.log(x.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):r.statusCode!==200?(this._logger.log(x.Error,`(LongPolling transport) Unexpected response code: ${r.statusCode}.`),this._closeError=new jt(r.statusText||"",r.statusCode),this._running=!1):r.content?(this._logger.log(x.Trace,`(LongPolling transport) data received. ${ae(r.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(r.content)):this._logger.log(x.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(o){this._running?o instanceof no?this._logger.log(x.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=o,this._running=!1):this._logger.log(x.Trace,`(LongPolling transport) Poll errored after shutdown: ${o.message}`)}}finally{this._logger.log(x.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(t){return this._running?ii(this._logger,"LongPolling",this._httpClient,this._url,t,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(x.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(x.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const t={},[n,o]=Kt();t[n]=o;const r={headers:{...t,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials};let i;try{await this._httpClient.delete(this._url,r)}catch(s){i=s}i?i instanceof jt&&(i.statusCode===404?this._logger.log(x.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this._logger.log(x.Trace,`(LongPolling transport) Error sending a DELETE request: ${i}`)):this._logger.log(x.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this._logger.log(x.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}}_raiseOnClose(){if(this.onclose){let t="(LongPolling transport) Firing onclose event.";this._closeError&&(t+=" Error: "+this._closeError),this._logger.log(x.Trace,t),this.onclose(this._closeError)}}}class Gc{constructor(t,n,o,r){this._httpClient=t,this._accessToken=n,this._logger=o,this._options=r,this.onreceive=null,this.onclose=null}async connect(t,n){return ot.isRequired(t,"url"),ot.isRequired(n,"transferFormat"),ot.isIn(n,ut,"transferFormat"),this._logger.log(x.Trace,"(SSE transport) Connecting."),this._url=t,this._accessToken&&(t+=(t.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise((o,r)=>{let i,s=!1;if(n===ut.Text){if(tt.isBrowser||tt.isWebWorker)i=new this._options.EventSource(t,{withCredentials:this._options.withCredentials});else{const a=this._httpClient.getCookieString(t),l={};l.Cookie=a;const[h,w]=Kt();l[h]=w,i=new this._options.EventSource(t,{withCredentials:this._options.withCredentials,headers:{...l,...this._options.headers}})}try{i.onmessage=a=>{if(this.onreceive)try{this._logger.log(x.Trace,`(SSE transport) data received. ${ae(a.data,this._options.logMessageContent)}.`),this.onreceive(a.data)}catch(l){return void this._close(l)}},i.onerror=a=>{s?this._close():r(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},i.onopen=()=>{this._logger.log(x.Information,`SSE connected to ${this._url}`),this._eventSource=i,s=!0,o()}}catch(a){return void r(a)}}else r(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))})}async send(t){return this._eventSource?ii(this._logger,"SSE",this._httpClient,this._url,t,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this._close(),Promise.resolve()}_close(t){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(t))}}class Kc{constructor(t,n,o,r,i,s){this._logger=o,this._accessTokenFactory=n,this._logMessageContent=r,this._webSocketConstructor=i,this._httpClient=t,this.onreceive=null,this.onclose=null,this._headers=s}async connect(t,n){let o;return ot.isRequired(t,"url"),ot.isRequired(n,"transferFormat"),ot.isIn(n,ut,"transferFormat"),this._logger.log(x.Trace,"(WebSockets transport) Connecting."),this._accessTokenFactory&&(o=await this._accessTokenFactory()),new Promise((r,i)=>{let s;t=t.replace(/^http/,"ws");const a=this._httpClient.getCookieString(t);let l=!1;if(tt.isNode||tt.isReactNative){const h={},[w,_]=Kt();h[w]=_,o&&(h[Wt.Authorization]=`Bearer ${o}`),a&&(h[Wt.Cookie]=a),s=new this._webSocketConstructor(t,void 0,{headers:{...h,...this._headers}})}else o&&(t+=(t.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(o)}`);s||(s=new this._webSocketConstructor(t)),n===ut.Binary&&(s.binaryType="arraybuffer"),s.onopen=h=>{this._logger.log(x.Information,`WebSocket connected to ${t}.`),this._webSocket=s,l=!0,r()},s.onerror=h=>{let w=null;w=typeof ErrorEvent<"u"&&h instanceof ErrorEvent?h.error:"There was an error with the transport",this._logger.log(x.Information,`(WebSockets transport) ${w}.`)},s.onmessage=h=>{if(this._logger.log(x.Trace,`(WebSockets transport) data received. ${ae(h.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(h.data)}catch(w){return void this._close(w)}},s.onclose=h=>{if(l)this._close(h);else{let w=null;w=typeof ErrorEvent<"u"&&h instanceof ErrorEvent?h.error:"WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",i(new Error(w))}}})}send(t){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(x.Trace,`(WebSockets transport) sending data. ${ae(t,this._logMessageContent)}.`),this._webSocket.send(t),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(t){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(x.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this._isCloseEvent(t)||t.wasClean!==!1&&t.code===1e3?t instanceof Error?this.onclose(t):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${t.code} (${t.reason||"no reason given"}).`)))}_isCloseEvent(t){return t&&typeof t.wasClean=="boolean"&&typeof t.code=="number"}}class Jc{constructor(t,n={}){var o;if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,ot.isRequired(t,"url"),this._logger=(o=n.logger)===void 0?new Fe(x.Information):o===null?se.instance:o.log!==void 0?o:new Fe(o),this.baseUrl=this._resolveUrl(t),(n=n||{}).logMessageContent=n.logMessageContent!==void 0&&n.logMessageContent,typeof n.withCredentials!="boolean"&&n.withCredentials!==void 0)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");n.withCredentials=n.withCredentials===void 0||n.withCredentials,n.timeout=n.timeout===void 0?1e5:n.timeout;let r=null,i=null;if(tt.isNode&&typeof require<"u"){const s=typeof __webpack_require__=="function"?__non_webpack_require__:require;r=s("ws"),i=s("eventsource")}tt.isNode||typeof WebSocket>"u"||n.WebSocket?tt.isNode&&!n.WebSocket&&r&&(n.WebSocket=r):n.WebSocket=WebSocket,tt.isNode||typeof EventSource>"u"||n.EventSource?tt.isNode&&!n.EventSource&&i!==void 0&&(n.EventSource=i):n.EventSource=EventSource,this._httpClient=new Xc(n.httpClient||new Oc(this._logger),n.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=n,this.onreceive=null,this.onclose=null}async start(t){if(t=t||ut.Binary,ot.isIn(t,ut,"transferFormat"),this._logger.log(x.Debug,`Starting connection with transfer format '${ut[t]}'.`),this._connectionState!=="Disconnected")return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(t),await this._startInternalPromise,this._connectionState==="Disconnecting"){const n="Failed to start the HttpConnection before stop() was called.";return this._logger.log(x.Error,n),await this._stopPromise,Promise.reject(new bt(n))}if(this._connectionState!=="Connected"){const n="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(x.Error,n),Promise.reject(new bt(n))}this._connectionStarted=!0}send(t){return this._connectionState!=="Connected"?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new No(this.transport)),this._sendQueue.send(t))}async stop(t){return this._connectionState==="Disconnected"?(this._logger.log(x.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):this._connectionState==="Disconnecting"?(this._logger.log(x.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState="Disconnecting",this._stopPromise=new Promise(n=>{this._stopPromiseResolver=n}),await this._stopInternal(t),void await this._stopPromise)}async _stopInternal(t){this._stopError=t;try{await this._startInternalPromise}catch{}if(this.transport){try{await this.transport.stop()}catch(n){this._logger.log(x.Error,`HttpConnection.transport.stop() threw error '${n}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(x.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(t){let n=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==rt.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(rt.WebSockets),await this._startTransport(n,t)}else{let o=null,r=0;do{if(o=await this._getNegotiationResponse(n),this._connectionState==="Disconnecting"||this._connectionState==="Disconnected")throw new bt("The connection was stopped during negotiation.");if(o.error)throw new Error(o.error);if(o.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(o.url&&(n=o.url),o.accessToken){const i=o.accessToken;this._accessTokenFactory=()=>i,this._httpClient._accessToken=i,this._httpClient._accessTokenFactory=void 0}r++}while(o.url&&r<100);if(r===100&&o.url)throw new Error("Negotiate redirection limit exceeded.");await this._createTransport(n,this._options.transport,o,t)}this.transport instanceof ci&&(this.features.inherentKeepAlive=!0),this._connectionState==="Connecting"&&(this._logger.log(x.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(o){return this._logger.log(x.Error,"Failed to start the connection: "+o),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(o)}}async _getNegotiationResponse(t){const n={},[o,r]=Kt();n[o]=r;const i=this._resolveNegotiateUrl(t);this._logger.log(x.Debug,`Sending negotiation request: ${i}.`);try{const s=await this._httpClient.post(i,{content:"",headers:{...n,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(s.statusCode!==200)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${s.statusCode}'`));const a=JSON.parse(s.content);return(!a.negotiateVersion||a.negotiateVersion<1)&&(a.connectionToken=a.connectionId),a.useStatefulReconnect&&this._options._useStatefulReconnect!==!0?Promise.reject(new oi("Client didn't negotiate Stateful Reconnect but the server did.")):a}catch(s){let a="Failed to complete negotiation with the server: "+s;return s instanceof jt&&s.statusCode===404&&(a+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(x.Error,a),Promise.reject(new oi(a))}}_createConnectUrl(t,n){return n?t+(t.indexOf("?")===-1?"?":"&")+`id=${n}`:t}async _createTransport(t,n,o,r){let i=this._createConnectUrl(t,o.connectionToken);if(this._isITransport(n))return this._logger.log(x.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=n,await this._startTransport(i,r),void(this.connectionId=o.connectionId);const s=[],a=o.availableTransports||[];let l=o;for(const h of a){const w=this._resolveTransportOrError(h,n,r,l?.useStatefulReconnect===!0);if(w instanceof Error)s.push(`${h.transport} failed:`),s.push(w);else if(this._isITransport(w)){if(this.transport=w,!l){try{l=await this._getNegotiationResponse(t)}catch(_){return Promise.reject(_)}i=this._createConnectUrl(t,l.connectionToken)}try{return await this._startTransport(i,r),void(this.connectionId=l.connectionId)}catch(_){if(this._logger.log(x.Error,`Failed to start the transport '${h.transport}': ${_}`),l=void 0,s.push(new Pc(`${h.transport} failed: ${_}`,rt[h.transport])),this._connectionState!=="Connecting"){const k="Failed to select transport before stop() was called.";return this._logger.log(x.Debug,k),Promise.reject(new bt(k))}}}}return s.length>0?Promise.reject(new zc(`Unable to connect to the server with any of the available transports. ${s.join(" ")}`,s)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))}_constructTransport(t){switch(t){case rt.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new Kc(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case rt.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new Gc(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case rt.LongPolling:return new ci(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${t}.`)}}_startTransport(t,n){return this.transport.onreceive=this.onreceive,this.features.reconnect?this.transport.onclose=async o=>{let r=!1;if(this.features.reconnect){try{this.features.disconnected(),await this.transport.connect(t,n),await this.features.resend()}catch{r=!0}r&&this._stopConnection(o)}else this._stopConnection(o)}:this.transport.onclose=o=>this._stopConnection(o),this.transport.connect(t,n)}_resolveTransportOrError(t,n,o,r){const i=rt[t.transport];if(i==null)return this._logger.log(x.Debug,`Skipping transport '${t.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${t.transport}' because it is not supported by this client.`);if(!function(s,a){return!s||(a&s)!=0}(n,i))return this._logger.log(x.Debug,`Skipping transport '${rt[i]}' because it was disabled by the client.`),new Mc(`'${rt[i]}' is disabled by the client.`,i);{if(!(t.transferFormats.map(a=>ut[a]).indexOf(o)>=0))return this._logger.log(x.Debug,`Skipping transport '${rt[i]}' because it does not support the requested transfer format '${ut[o]}'.`),new Error(`'${rt[i]}' does not support ${ut[o]}.`);if(i===rt.WebSockets&&!this._options.WebSocket||i===rt.ServerSentEvents&&!this._options.EventSource)return this._logger.log(x.Debug,`Skipping transport '${rt[i]}' because it is not supported in your environment.'`),new Rc(`'${rt[i]}' is not supported in your environment.`,i);this._logger.log(x.Debug,`Selecting transport '${rt[i]}'.`);try{return this.features.reconnect=i===rt.WebSockets?r:void 0,this._constructTransport(i)}catch(a){return a}}}_isITransport(t){return t&&typeof t=="object"&&"connect"in t}_stopConnection(t){if(this._logger.log(x.Debug,`HttpConnection.stopConnection(${t}) called while in state ${this._connectionState}.`),this.transport=void 0,t=this._stopError||t,this._stopError=void 0,this._connectionState!=="Disconnected"){if(this._connectionState==="Connecting")throw this._logger.log(x.Warning,`Call to HttpConnection.stopConnection(${t}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${t}) was called while the connection is still in the connecting state.`);if(this._connectionState==="Disconnecting"&&this._stopPromiseResolver(),t?this._logger.log(x.Error,`Connection disconnected with error '${t}'.`):this._logger.log(x.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(n=>{this._logger.log(x.Error,`TransportSendQueue.stop() threw error '${n}'.`)}),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(t)}catch(n){this._logger.log(x.Error,`HttpConnection.onclose(${t}) threw error '${n}'.`)}}}else this._logger.log(x.Debug,`Call to HttpConnection.stopConnection(${t}) was ignored because the connection is already in the disconnected state.`)}_resolveUrl(t){if(t.lastIndexOf("https://",0)===0||t.lastIndexOf("http://",0)===0)return t;if(!tt.isBrowser)throw new Error(`Cannot resolve '${t}'.`);const n=window.document.createElement("a");return n.href=t,this._logger.log(x.Information,`Normalizing '${t}' to '${n.href}'.`),n.href}_resolveNegotiateUrl(t){const n=new URL(t);n.pathname.endsWith("/")?n.pathname+="negotiate":n.pathname+="/negotiate";const o=new URLSearchParams(n.searchParams);return o.has("negotiateVersion")||o.append("negotiateVersion",this._negotiateVersion.toString()),o.has("useStatefulReconnect")?o.get("useStatefulReconnect")==="true"&&(this._options._useStatefulReconnect=!0):this._options._useStatefulReconnect===!0&&o.append("useStatefulReconnect","true"),n.search=o.toString(),n.toString()}}class No{constructor(t){this._transport=t,this._buffer=[],this._executing=!0,this._sendBufferedData=new He,this._transportResult=new He,this._sendLoopPromise=this._sendLoop()}send(t){return this._bufferData(t),this._transportResult||(this._transportResult=new He),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(t){if(this._buffer.length&&typeof this._buffer[0]!=typeof t)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof t}`);this._buffer.push(t),this._sendBufferedData.resolve()}async _sendLoop(){for(;;){if(await this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new He;const t=this._transportResult;this._transportResult=void 0;const n=typeof this._buffer[0]=="string"?this._buffer.join(""):No._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(n),t.resolve()}catch(o){t.reject(o)}}}static _concatBuffers(t){const n=t.map(i=>i.byteLength).reduce((i,s)=>i+s),o=new Uint8Array(n);let r=0;for(const i of t)o.set(new Uint8Array(i),r),r+=i.byteLength;return o.buffer}}class He{constructor(){this.promise=new Promise((t,n)=>[this._resolver,this._rejecter]=[t,n])}resolve(){this._resolver()}reject(t){this._rejecter(t)}}class Yc{constructor(){this.name="json",this.version=2,this.transferFormat=ut.Text}parseMessages(t,n){if(typeof t!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!t)return[];n===null&&(n=se.instance);const o=mt.parse(t),r=[];for(const i of o){const s=JSON.parse(i);if(typeof s.type!="number")throw new Error("Invalid payload.");switch(s.type){case F.Invocation:this._isInvocationMessage(s);break;case F.StreamItem:this._isStreamItemMessage(s);break;case F.Completion:this._isCompletionMessage(s);break;case F.Ping:case F.Close:break;case F.Ack:this._isAckMessage(s);break;case F.Sequence:this._isSequenceMessage(s);break;default:n.log(x.Information,"Unknown message type '"+s.type+"' ignored.");continue}r.push(s)}return r}writeMessage(t){return mt.write(JSON.stringify(t))}_isInvocationMessage(t){this._assertNotEmptyString(t.target,"Invalid payload for Invocation message."),t.invocationId!==void 0&&this._assertNotEmptyString(t.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(t){if(this._assertNotEmptyString(t.invocationId,"Invalid payload for StreamItem message."),t.item===void 0)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(t){if(t.result&&t.error)throw new Error("Invalid payload for Completion message.");!t.result&&t.error&&this._assertNotEmptyString(t.error,"Invalid payload for Completion message."),this._assertNotEmptyString(t.invocationId,"Invalid payload for Completion message.")}_isAckMessage(t){if(typeof t.sequenceId!="number")throw new Error("Invalid SequenceId for Ack message.")}_isSequenceMessage(t){if(typeof t.sequenceId!="number")throw new Error("Invalid SequenceId for Sequence message.")}_assertNotEmptyString(t,n){if(typeof t!="string"||t==="")throw new Error(n)}}const Zc={trace:x.Trace,debug:x.Debug,info:x.Information,information:x.Information,warn:x.Warning,warning:x.Warning,error:x.Error,critical:x.Critical,none:x.None};class Qc{configureLogging(t){if(ot.isRequired(t,"logging"),t.log!==void 0)this.logger=t;else if(typeof t=="string"){const n=function(o){const r=Zc[o.toLowerCase()];if(r!==void 0)return r;throw new Error(`Unknown log level: ${o}`)}(t);this.logger=new Fe(n)}else this.logger=new Fe(t);return this}withUrl(t,n){return ot.isRequired(t,"url"),ot.isNotEmpty(t,"url"),this.url=t,this.httpConnectionOptions=typeof n=="object"?{...this.httpConnectionOptions,...n}:{...this.httpConnectionOptions,transport:n},this}withHubProtocol(t){return ot.isRequired(t,"protocol"),this.protocol=t,this}withAutomaticReconnect(t){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return t?Array.isArray(t)?this.reconnectPolicy=new ai(t):this.reconnectPolicy=t:this.reconnectPolicy=new ai,this}withServerTimeout(t){return ot.isRequired(t,"milliseconds"),this._serverTimeoutInMilliseconds=t,this}withKeepAliveInterval(t){return ot.isRequired(t,"milliseconds"),this._keepAliveIntervalInMilliseconds=t,this}withStatefulReconnect(t){return this.httpConnectionOptions===void 0&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=t?.bufferSize,this}build(){const t=this.httpConnectionOptions||{};if(t.logger===void 0&&(t.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const n=new Jc(this.url,t);return $o.create(n,this.logger||se.instance,this.protocol||new Yc,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}}let qe;function tl(e){if(!e){if(qe)return qe;throw new Error("\u9996\u6B21\u6784\u5EFA\uFF0CsignalrURL\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\uFF01")}const t=new Qc().configureLogging(x.Information).withUrl(e).withAutomaticReconnect({nextRetryDelayInMilliseconds:()=>5e3}).build();return t.keepAliveIntervalInMilliseconds=15e3,t.serverTimeoutInMilliseconds=18e5,t.start().then(()=>{j.Logger().info("\u542F\u52A8SignalR\u8FDE\u63A5\uFF01")}),t.onclose(async()=>{j.Logger().info("\u65AD\u5F00SignalR\u8FDE\u63A5!")}),t.onreconnecting(()=>{j.Logger().warn("SignalR\u670D\u52A1\u5DF2\u65AD\u7EBF\uFF0C\u91CD\u8FDE\u4E2D...\uFF01")}),t.onreconnected(()=>{j.Logger().warn("SignalR\u91CD\u8FDE\u6210\u529F!")}),qe||(qe=t),t}const ro=new Set;function li(e){return e!==null?parseFloat(e):0}function Xe(e){const t=window.getComputedStyle(e),n=Math.ceil([t.paddingLeft,t.width,t.paddingRight].map(li).reduce((r,i)=>r+i)),o=Math.ceil([t.paddingTop,t.height,t.paddingBottom].map(li).reduce((r,i)=>r+i));return{width:n,height:o}}class ui{width;height;constructor(t,n){this.width=t,this.height=n}}function el(e){const t=e.windowEl;if(t){const n=parseFloat(t.style.left||"NaN"),o=parseFloat(t.style.top||"NaN");if(!isNaN(n)&&!isNaN(o))return{left:n,top:o}}return null}function nl(e,t,n,o){const r=e-n,i=t-o;return r*r+i*i}window.addEventListener("resize",e=>{ro.forEach(t=>{t&&Re(t.fixPosition)&&t.fixPosition()})});const Ve=[];var Ge=Rt({name:"Window",props:{windowStyle:{type:Object,required:!0},isOpen:{type:Boolean,required:!1,default:!0},title:{type:String,required:!0,default:""},closeButton:{type:Boolean,required:!1,default:!0},resizable:{type:Boolean,required:!1,default:!1},isScrollable:{type:Boolean,required:!1,default:!1},padding:{type:Number,required:!1,default:8},activateWhenOpen:{type:Boolean,required:!1,default:!0},positionHint:{type:String,required:!1,default:""},zGroup:{type:Number,required:!1,default:1},overflow:{type:String,required:!1,default:"visible"},minWidth:{type:Number,required:!1,default:1},minHeight:{type:Number,required:!1,default:0},maxWidth:{type:Number,required:!1,default:0},maxHeight:{type:Number,required:!1,default:0},height:{type:Number,required:!1},width:{type:Number,required:!1},top:{type:Number,required:!1},left:{type:Number,required:!1}},components:{myButton:Te},setup(e,{emit:t}){const n=zs();if(!n)return;const{proxy:o}=n;let r=0,i,s,a;const l=K(e.isOpen),h=()=>{Ve.push(o),a=new Ks(e.zGroup,w),e.isOpen&&function(L){L&&(rr(()=>{r++==0&&(y(o),function(){const D=_.value,{width:M,height:N}=Rn(D);let O,T;if(e.left!==void 0!=(e.top!==void 0))throw new Error("Either of left or top is specified. Both must be set or not set.");if(typeof e.left=="number")O=e.left,T=e.top;else{const W=e.positionHint||"auto";switch(W){case"auto":{let q=20,it=50,Z=0;do{if(Ve.every(Q=>{if(!Q.isOpen||o==Q)return!0;const _t=el(Q);if(_t==null)return!0;const{left:Ht,top:et}=_t;return nl(Ht,et,q,it)>16}))break;q=(q+40)%(window.innerWidth-200),it=(it+40)%(window.innerHeight-200)}while(++Z<100);O=q,T=it}break;case"center":O=(window.innerWidth-M)/2,T=(window.innerHeight-N)/2,console.log(O,T,window.innerWidth,window.innerHeight,"111111");break;default:try{const q=W.split("/").map(Number);if(q.length!=2)throw null;const[it,Z]=q;if(!isFinite(it)||!isFinite(Z))throw null;O=it>=0?it:window.innerWidth-M+it,T=Z>=0?Z:window.innerHeight-N+Z}catch{throw new Error(`invalid position string: ${W}`)}}}D&&(D.style.left=`${O}px`,D.style.top=`${T}px`)}()),e.resizable&&d(),z(),i=new Gs(k.value,_.value,{onMove:()=>z(),onMoveStart:()=>t("move-start"),onMoveEnd:()=>t("move-end")}),e.resizable&&function(){const{height:D}=Rn(k.value);s=new Js(_.value,{onResize:()=>d(),onResizeStart:()=>t("resize-start"),onResizeEnd:()=>t("resize-end"),minWidth:e.minWidth,minHeight:e.minHeight+D,maxWidth:e.maxWidth,maxHeight:e.maxHeight?e.maxHeight+D:void 0})}()}),e.activateWhenOpen&&I())}(!0),ro.add(o)};function w(L){p.value.zIndex=`${L}`}const _=K(null),k=K(null),$=K(null);function I(){a.raise(),t("activate")}const p=K({...e.windowStyle.window,zIndex:"auto",overflow:e.overflow}),u=Xt(()=>e.windowStyle.titlebar),v=Xt(()=>{const L={...e.windowStyle.content};return e.resizable?L.padding="0":e.padding!=null&&(L.padding=`${e.padding}px`),e.isScrollable&&(L.overflow="auto"),L});function y(L){const{width:D,height:M,top:N,left:O}=L,T=_;if(T&&D!=null&&(T.value.style.width=`${D}px`),M!=null){const W=k.value;if(W){const q=Xe(W).height;T.value.style.height=`${M+q}px`}}T&&O!=null&&(T.value.style.left=`${O}px`),T&&N!=null&&(T.value.style.top=`${N}px`)}function d(L=!0){const D=_.value,M=k.value,N=$.value;if(N&&D&&M){const{width:O,height:T}=Xe(N),{width:W,height:q}=Xe(D),it=Xe(M).height,Z=W-(N.offsetWidth-O),Q=q-it-(N.offsetHeight-T);N.style.width=`${Z}px`,N.style.height=`${Q}px`,f(),t("resize",new ui(Z,Q)),L&&(t("update:width",Z),t("update:height",Q))}}function f(){const L=_.value;if(L){const D=L.getBoundingClientRect();D.left<0&&(p.value.left="0px"),D.top<0&&(p.value.top="0px"),D.right>window.innerWidth&&(p.value.left=window.innerWidth-D.width+"px"),D.bottom>window.innerHeight&&(p.value.top=window.innerHeight-D.height+"px")}}function z(L=!0){f();const D=_.value;if(D){const{left:M,top:N}=D.getBoundingClientRect();L&&(t("update:left",M),t("update:top",N))}}return Pt(()=>e.isOpen,L=>{l.value=L}),Pt(()=>e.zGroup,L=>{a.group=L}),Pt(()=>e.width,L=>{y({width:L}),d(!1)}),Pt(()=>e.height,L=>{y({height:L}),d(!1)}),Sn(()=>{h()}),As(()=>{ro.delete(this),a.unregister(),s&&s.teardown(),i&&i.teardown(),Ve.splice(Ve.indexOf(o),1)}),{isOpen:l,windowEl:_,titlebar:k,content:$,activate:I,styleWindow:p,styleTitlebar:u,styleContent:v,closeButtonClick:function(){l.value=!1,t("closebuttonclick")},fixPosition:f}}});const ol={class:"title"};var hi;Ge.render=function(e,t,n,o,r,i){const s=Se("myButton");return X(),nt(ir,{name:"fade",onAfterLeave:t[2]||(t[2]=a=>e.$emit("close")),onAfterEnter:t[3]||(t[3]=a=>e.$emit("open")),persisted:""},{default:Ct(()=>[sr(J("div",{class:"window",style:vt(e.styleWindow),ref:"windowEl",onMousedown:t[0]||(t[0]=(...a)=>e.activate&&e.activate(...a)),onTouchstart:t[1]||(t[1]=(...a)=>e.activate&&e.activate(...a))},[J("div",{class:"titlebar",style:vt(e.styleTitlebar),ref:"titlebar"},[J("div",ol,[e.$slots.title?ct(e.$slots,"title",{key:0}):(X(),gt(zt,{key:1},[Cn(En(e.title),1)],64))]),e.closeButton?(X(),nt(s,{key:0,windowStyle:e.windowStyle,onClick:e.closeButtonClick},{default:Ct(()=>t[4]||(t[4]=[Cn("\xD7")])),_:1},8,["windowStyle","onClick"])):st("v-if",!0)],4),J("div",{class:"content",style:vt(e.styleContent),ref:"content"},[ct(e.$slots,"default")],4)],36),[[ar,e.isOpen]])]),_:3})},Ge.__file="src/controls/vuewindow/window/index.vue",function(e){e[e.StyleBlack=0]="StyleBlack",e[e.StyleWhite=1]="StyleWhite",e[e.StyleMetal=2]="StyleMetal",e[e.StyleGrayblue=3]="StyleGrayblue"}(hi||(hi={}));const rl={window:{color:"#fff",boxShadow:"0 0 6pt rgba(255, 255, 255, 0.75)",backgroundColor:"rgba(31, 31, 31, 0.9)"},titlebar:{backgroundColor:"rgba(63, 63, 63, 0.9)"},content:{},button:{color:"white"},buttonHover:{backgroundColor:"rgba(255, 255, 255, 0.25)"},buttonActive:{color:"black",backgroundColor:"rgba(255, 255, 255, 0.5)"}},il={window:{color:"#000",boxShadow:"0 2pt 4pt rgba(0, 0, 0, 0.5)",backgroundColor:"rgba(239, 239, 239, 0.95)"},titlebar:{backgroundColor:"rgba(191, 191, 191, 0.9)"},content:{},button:{color:"#000"},buttonHover:{backgroundColor:"rgba(0, 0, 0, 0.25)"},buttonActive:{color:"#fff",backgroundColor:"rgba(0, 0, 0, 0.5)"}},sl={window:{color:"#000",boxShadow:"0 4pt 8pt rgba(0, 0, 0, 0.5)",background:"linear-gradient(to bottom, rgb(215, 215, 215), rgb(191, 191, 191))"},titlebar:{background:"linear-gradient(to bottom, rgb(215, 215, 215), rgb(191, 191, 191))"},content:{},button:{color:"#000"},buttonHover:{backgroundColor:"rgba(0, 0, 0, 0.25)"},buttonActive:{color:"#fff",backgroundColor:"rgba(0, 0, 0, 0.5)"}},al={window:{color:"#fff",fontSize:"14px",boxShadow:"0 0 3pt rgba(255, 255, 255, 0.75)",backgroundColor:"rgba(4,51,81,0.6)",borderRadius:"5px"},titlebar:{backgroundColor:"rgba(4,51,81,0.8)",border:"1px solid rgba(153, 153, 153, 0.5)",borderRadius:"5px",fontSize:"16px",fontWeight:400,color:"#fff"},content:{},button:{color:"white",fontSize:"18px"},buttonHover:{backgroundColor:"rgba(255, 255, 255, 0.25)"},buttonActive:{color:"black",backgroundColor:"rgba(255, 255, 255, 0.5)"}},cl=Ge;var ht;(function(e){e[e.top=0]="top",e[e.bottom=1]="bottom",e[e.centerBack=2]="centerBack",e[e.centerMain=3]="centerMain",e[e.centerFront=4]="centerFront",e[e.left=5]="left",e[e.right=6]="right"})(ht||(ht={}));class di{layoutState;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;widgetConfig=new Array;_LayoutID;_mapItemRefs;constructor(t,n,o,r){this.layoutState=t,this._LayoutID=o,this._mapItemRefs=r,n.forEach(i=>{if(i.layoutID===o&&(this.widgetConfig.push(i),i.afterid))if(this.preConditionMap.has(i.afterid))this.preConditionMap.get(i.afterid)?.add(i);else{const s=new Set;s.add(i),this.preConditionMap.set(i.afterid,s)}})}getLayoutID(){return this._LayoutID}getWidgetConfig(){return this.widgetConfig}preloadWidgets(){this.widgetConfig.filter(t=>t.preload&&!t.afterid).forEach(t=>{this._loadWidget(t)})}async loadWidget(t){if(!t)return;let n;if(Lt(t)?n=t:Me(t)&&(n=this.widgetConfig.find(o=>o.id===t)),n){if(n.afterid){if(this.isWidgetLoaded(n.afterid))return this._loadWidget(n);{let o=function(a){a.layoutID===r._LayoutID&&a.widgetID===i&&(r._loadWidget(s),j.EventBus.off(lt.WidgetLoadedEvent,o))};const r=this,i=n.afterid,s=n;return j.EventBus.on(lt.WidgetLoadedEvent,o),this.loadWidget(n.afterid)}}return this._loadWidget(n)}}loadOtherDependenceWidgets(t){this.preConditionMap.has(t)&&this.preConditionMap.get(t)?.forEach(n=>{n.preload&&this._loadWidget(n)})}_loadWidget(t){if(!this.widgetsLoadedSet.has(t.id))return t.component?t.component().then(n=>{if(n.default){const o=Ls(n.default);t.layout&&(o.style=t.layout),t.cssClass&&(o.cssClass=t.cssClass),this.getContainerComponents(t.container).value.set(t.id,o),this.widgetsLoadedSet.add(t.id),rr().then(()=>{j.EventBus.emit(lt.WidgetLoadedEvent,{layoutID:this._LayoutID,widgetID:t.id}),this.loadOtherDependenceWidgets(t.id)})}}).catch(n=>{j.Logger().error("\u52A0\u8F7DWidget\u5931\u8D25\uFF01",t),j.EventBus.emit(lt.WidgetLoadedErrorEvent,t)}):void 0;this.changeWidgetVisible(t.id,!0)}hasDependentWidgets(t){let n=!1;if(this.preConditionMap.has(t)){const o=this.preConditionMap.get(t);if(o){for(const r of o)if(this.isWidgetLoaded(r.id)){n=!0;break}}}return n}unloadWidget(t){if(!t||!this.isWidgetLoaded(t))return;const n=this.widgetConfig.find(o=>o.id===t);if(n){if(this.preConditionMap.has(t)){const o=this.preConditionMap.get(t);if(o)for(const r of o)this.unloadWidget(r.id)}this.getContainerComponents(n.container).value.delete(t),this.widgetsLoadedSet.delete(t),this._mapItemRefs&&this._mapItemRefs.delete(t),j.EventBus.emit(lt.WidgetUnLoadedEvent,{layoutID:this._LayoutID,widgetID:t})}}isWidgetLoaded(t){return this.widgetsLoadedSet.has(t)}splitTwoContainer(t=!1){const n=this.layoutState.centerMainContainer,o=this.layoutState.centerBackContainer;t?(n&&(n.style.left="0",n.style.width="100%"),o&&(o.style.width="100%")):(n&&(n.style.left="50%",n.style.width="50%"),o&&(o.style.width="50%"))}getLayoutContainer(t){switch(t){case ht.top:return this.layoutState.topContainer;case ht.bottom:return this.layoutState.bottomContainer;case ht.left:return this.layoutState.leftContainer;case ht.right:return this.layoutState.rightContainer;case ht.centerBack:return this.layoutState.centerBackContainer;case ht.centerMain:return this.layoutState.centerMainContainer;case ht.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(t,n=!1){const o=this.getLayoutContainer(t);o&&(o.style.visibility=n?"visible":"hidden")}changeWidgetVisible(t,n=!1){const o=this.getWidgetComponent(t);o&&o.changeVisible&&o.changeVisible(n)}isWidgetVisible(t){const n=this.getWidgetComponent(t);return!!n&&(!n.isShow||n.isShow.value)}getWidgetComponent(t){if(this.widgetsLoadedSet.has(t)&&this._mapItemRefs)return this._mapItemRefs.get(t)}getWigetItem(t){return this.widgetConfig.find(n=>n.id===t)}getGroupWigetItems(t){return this.widgetConfig.filter(n=>n.group===t)}getContainerComponents(t){if(this.layoutMap.has(t))return this.layoutMap.get(t);{const n=K(new Map);return this.layoutMap.set(t,n),n}}getWidgetLoadedIDList(){const t=[];return this.widgetsLoadedSet.forEach(n=>{t.push(n)}),t}unloadAllWidgets(t){const n=[];this.widgetsLoadedSet.forEach(o=>{t&&t.length>0?t.findIndex(r=>r===o)<0&&n.push(o):n.push(o)}),n.forEach(o=>this.unloadWidget(o))}unloadWidgets(t){t&&t.length>0&&t.forEach(n=>{this.unloadWidget(n)})}static getLayoutManager(t,n){if(n){const o=n.find(r=>r.id===t);if(o&&o.layoutID)return j.LayoutMap.get(o.layoutID)}}}var ce=Rt({name:"SuspenseWithError",setup(){const e=K(null);return Ds(t=>(e.value="\u5F53\u524D\u9875\u9762\u5B58\u5728\u95EE\u9898\uFF0C\u65E0\u6CD5\u6E32\u67D3\u2026\u2026",console.error("onErrorCaptured",t),!0)),{error:e}}});ce.render=function(e,t,n,o,r,i){return e.error?ct(e.$slots,"error",{key:0},()=>[Cn(En(e.error),1)]):(X(),nt($s,{key:1},{default:Ct(()=>[ct(e.$slots,"default")]),fallback:Ct(()=>[ct(e.$slots,"fallback")]),_:3}))},ce.__file="src/controls/routertransition/SuspenseWithError.vue";var io=Rt({name:"RouterTransition",__name:"RouterTransition",setup:e=>(t,n)=>{const o=Se("router-view");return X(),nt(ce,null,{default:Ct(()=>[Ce(o,null,{default:Ct(({Component:r,route:i})=>[st(" <transition> "),(X(),nt(cr,null,[i.meta.keepAlive?(X(),nt(Et(r),{key:i.name})):st("v-if",!0)],1024)),i.meta.keepAlive?st("v-if",!0):(X(),nt(Et(r),{key:i.name})),st(" </transition> ")]),_:1})]),_:1})}});io.__file="src/controls/routertransition/RouterTransition.vue";var Ke=Rt({name:"LayoutContainer",props:{widgetConfig:{type:Array,required:!0,default:()=>[]},layoutID:{type:String,default:void 0},layoutStyle:{type:Object},enableRouterView:{type:Boolean,default:!0}},emits:["containerLoaded"],components:{RouterTransition:io},setup(e,{attrs:t,slots:n,emit:o}){const r=e.layoutID,i=K(e.enableRouterView);Pt(()=>e.enableRouterView,()=>{i.value=e.enableRouterView});const s=Ns({topContainer:void 0,centerBackContainer:void 0,centerMainContainer:void 0,centerFrontContainer:void 0,bottomContainer:void 0,leftContainer:void 0,rightContainer:void 0}),a=new Map,l=new di(s,e.widgetConfig,r,a),h=p(ht.top),w=p(ht.centerBack),_=p(ht.centerFront),k=p(ht.left),$=p(ht.right),I=p(ht.bottom);function p(v){return l?.getContainerComponents(v)}const u=Xt(()=>e.layoutStyle);return Sn(()=>{l&&(r?j.LayoutMap.set(r,l):(j.LayoutManager=l,j.LayoutMap.set("",l)),l.preloadWidgets(),o("containerLoaded",{layoutID:r,layoutManager:l}),j.EventBus.emit(lt.LayoutContainerLoaded,{layoutID:r,layoutManager:l}))}),{...Bs(s),topContainerComponents:h,centerbackComponents:w,centerfrontComponents:_,leftContainerComponents:k,rightContainerComponents:$,bottomContainerComponents:I,containerStyle:u,isEnableRouterView:i,setItemRef:(v,y)=>{v&&a.set(y,v)}}}});const ll={ref:"topContainer",class:"topContainer"},ul={key:0,ref:"centerMainContainer",class:"centerdiv mainContainer"},hl={ref:"centerBackContainer",class:"centerdiv backContainer"},dl={ref:"centerFrontContainer",class:"centerdiv centerFrontContainer"},fl={ref:"leftContainer",class:"leftContainer"},pl={ref:"rightContainer",class:"rightContainer"},gl={ref:"bottomContainer",class:"bottomContainer"};Ke.render=function(e,t,n,o,r,i){const s=Se("router-transition");return X(),gt("div",{class:"layoutContainer",style:vt(e.containerStyle)},[J("div",ll,[ct(e.$slots,"top"),(X(!0),gt(zt,null,Vt(e.topContainerComponents,([a,l])=>(X(),nt(Et(l),{ref_for:!0,ref:h=>e.setItemRef(h,a),key:a,style:vt(l.style),class:At(l.cssClass)},null,8,["style","class"]))),128))],512),J("div",null,[st(" \u4E3B\u8981\u5BB9\u5668-\u5E95\u90E8 "),e.isEnableRouterView?(X(),gt("div",ul,[ct(e.$slots,"main",{},()=>[Ce(s)])],512)):st("v-if",!0),st(" \u4E0A\u4E00\u5C42-\u4E3B\u5BB9\u5668 "),J("div",hl,[ct(e.$slots,"back"),(X(!0),gt(zt,null,Vt(e.centerbackComponents,([a,l])=>(X(),nt(Et(l),{ref_for:!0,ref:h=>e.setItemRef(h,a),key:a,style:vt(l.style),class:At(l.cssClass)},null,8,["style","class"]))),128))],512),st(" \u6700\u4E0A\u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),J("div",dl,[ct(e.$slots,"front"),(X(!0),gt(zt,null,Vt(e.centerfrontComponents,([a,l])=>(X(),nt(Et(l),{ref_for:!0,ref:h=>e.setItemRef(h,a),key:a,style:vt(l.style),class:At(l.cssClass)},null,8,["style","class"]))),128))],512),J("div",fl,[ct(e.$slots,"left"),(X(!0),gt(zt,null,Vt(e.leftContainerComponents,([a,l])=>(X(),nt(Et(l),{ref_for:!0,ref:h=>e.setItemRef(h,a),key:a,style:vt(l.style),class:At(l.cssClass)},null,8,["style","class"]))),128))],512),J("div",pl,[ct(e.$slots,"right"),(X(!0),gt(zt,null,Vt(e.rightContainerComponents,([a,l])=>(X(),nt(Et(l),{ref_for:!0,ref:h=>e.setItemRef(h,a),key:a,style:vt(l.style),class:At(l.cssClass)},null,8,["style","class"]))),128))],512)]),J("div",gl,[ct(e.$slots,"bottom"),(X(!0),gt(zt,null,Vt(e.bottomContainerComponents,([a,l])=>(X(),nt(Et(l),{ref_for:!0,ref:h=>e.setItemRef(h,a),key:a,style:vt(l.style),class:At(l.cssClass)},null,8,["style","class"]))),128))],512),st(" \u589E\u52A0\u9ED8\u8BA4\u63D2\u69FD "),ct(e.$slots,"default")],4)},Ke.__scopeId="data-v-4d081e5c",Ke.__file="src/controls/layoutcontainer/layout.vue";var fi=Rt({name:"RouterTransition",__name:"RouterTransitionAnimate",props:{enterActive:{type:String,required:!1,default:"animated fadeIn"},leaveActive:{type:String,required:!1,default:"animated fadeOut"}},setup:e=>(t,n)=>{const o=Se("router-view");return X(),nt(ce,null,{default:Ct(()=>[Ce(o,null,{default:Ct(({Component:r,route:i})=>[Ce(js,{appear:"","enter-active-class":t.enterActive,"leave-active-class":t.leaveActive},{default:Ct(()=>[(X(),nt(cr,null,[i.meta.keepAlive?(X(),nt(Et(r),{key:i.name})):st("v-if",!0)],1024)),i.meta.keepAlive?st("v-if",!0):(X(),nt(Et(r),{key:i.name}))]),_:2},1032,["enter-active-class","leave-active-class"])]),_:1})]),_:1})}});fi.__file="src/controls/routertransition/RouterTransitionAnimate.vue";const le=/^[a-z0-9]+(-[a-z0-9]+)*$/,Je=(e,t,n,o="")=>{const r=e.split(":");if(e.slice(0,1)==="@"){if(r.length<2||r.length>3)return null;o=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){const a=r.pop(),l=r.pop(),h={provider:r.length>0?r[0]:o,prefix:l,name:a};return t&&!Ye(h)?null:h}const i=r[0],s=i.split("-");if(s.length>1){const a={provider:o,prefix:s.shift(),name:s.join("-")};return t&&!Ye(a)?null:a}if(n&&o===""){const a={provider:o,prefix:"",name:i};return t&&!Ye(a,n)?null:a}return null},Ye=(e,t)=>!!e&&!(e.provider!==""&&!e.provider.match(le)||!(t&&e.prefix===""||e.prefix.match(le))||!e.name.match(le)),pi=Object.freeze({left:0,top:0,width:16,height:16}),Ze=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Qe=Object.freeze({...pi,...Ze}),so=Object.freeze({...Qe,body:"",hidden:!1});function gi(e,t){const n=function(o,r){const i={};!o.hFlip!=!r.hFlip&&(i.hFlip=!0),!o.vFlip!=!r.vFlip&&(i.vFlip=!0);const s=((o.rotate||0)+(r.rotate||0))%4;return s&&(i.rotate=s),i}(e,t);for(const o in so)o in Ze?o in e&&!(o in n)&&(n[o]=Ze[o]):o in t?n[o]=t[o]:o in e&&(n[o]=e[o]);return n}function ml(e,t,n){const o=e.icons,r=e.aliases||Object.create(null);let i={};function s(a){i=gi(o[a]||r[a],i)}return s(t),n.forEach(s),gi(e,i)}function mi(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(r=>{t(r,null),n.push(r)});const o=function(r,i){const s=r.icons,a=r.aliases||Object.create(null),l=Object.create(null);return(i||Object.keys(s).concat(Object.keys(a))).forEach(function h(w){if(s[w])return l[w]=[];if(!(w in l)){l[w]=null;const _=a[w]&&a[w].parent,k=_&&h(_);k&&(l[w]=[_].concat(k))}return l[w]}),l}(e);for(const r in o){const i=o[r];i&&(t(r,ml(e,r,i)),n.push(r))}return n}const vl={provider:"",aliases:{},not_found:{},...pi};function ao(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function vi(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!ao(e,vl))return null;const n=t.icons;for(const r in n){const i=n[r];if(!r.match(le)||typeof i.body!="string"||!ao(i,so))return null}const o=t.aliases||Object.create(null);for(const r in o){const i=o[r],s=i.parent;if(!r.match(le)||typeof s!="string"||!n[s]&&!o[s]||!ao(i,so))return null}return t}const yi=Object.create(null);function Ut(e,t){const n=yi[e]||(yi[e]=Object.create(null));return n[t]||(n[t]=function(o,r){return{provider:o,prefix:r,icons:Object.create(null),missing:new Set}}(e,t))}function co(e,t){return vi(t)?mi(t,(n,o)=>{o?e.icons[n]=o:e.missing.add(n)}):[]}let ue=!1;function wi(e){return typeof e=="boolean"&&(ue=e),ue}function yl(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),ue&&!t&&!e.prefix){let o=!1;return vi(e)&&(e.prefix="",mi(e,(r,i)=>{i&&function(s,a){const l=Je(s,!0,ue);return!!l&&function(h,w,_){try{if(typeof _.body=="string")return h.icons[w]={..._},!0}catch{}return!1}(Ut(l.provider,l.prefix),l.name,a)}(r,i)&&(o=!0)})),o}const n=e.prefix;return Ye({provider:t,prefix:n,name:"a"})?!!co(Ut(t,n),e):!1}const bi=Object.freeze({width:null,height:null}),_i=Object.freeze({...bi,...Ze}),wl=/(-?[0-9.]*[0-9]+[0-9.]*)/g,bl=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Si(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const o=e.split(wl);if(o===null||!o.length)return e;const r=[];let i=o.shift(),s=bl.test(i);for(;;){if(s){const a=parseFloat(i);isNaN(a)?r.push(i):r.push(Math.ceil(a*t*n)/n)}else r.push(i);if(i=o.shift(),i===void 0)return r.join("");s=!s}}const _l=/\sid="(\S+)"/g,Sl="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16);let Cl=0;const lo=Object.create(null);function uo(e){return lo[e]||lo[""]}function ho(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array&&t.length))return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const fo=Object.create(null),tn=["https://api.simplesvg.com","https://api.unisvg.com"],po=[];for(;tn.length>0;)tn.length===1||Math.random()>.5?po.push(tn.shift()):po.push(tn.pop());function El(e,t){const n=ho(t);return n!==null&&(fo[e]=n,!0)}function go(e){return fo[e]}fo[""]=ho({resources:["https://api.iconify.design"].concat(po)});let Ci=(()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}})();const xl={prepare:(e,t,n)=>{const o=[],r=function(l,h){const w=go(l);if(!w)return 0;let _;if(w.maxURL){let k=0;w.resources.forEach(I=>{k=Math.max(k,I.length)});const $=h+".json?icons=";_=w.maxURL-k-w.path.length-$.length}else _=0;return _}(e,t),i="icons";let s={type:i,provider:e,prefix:t,icons:[]},a=0;return n.forEach((l,h)=>{a+=l.length+1,a>=r&&h>0&&(o.push(s),s={type:i,provider:e,prefix:t,icons:[]},a=l.length),s.icons.push(l)}),o.push(s),o},send:(e,t,n)=>{if(!Ci)return void n("abort",424);let o=function(i){if(typeof i=="string"){const s=go(i);if(s)return s.path}return"/"}(t.provider);switch(t.type){case"icons":{const i=t.prefix,s=t.icons.join(",");o+=i+".json?"+new URLSearchParams({icons:s}).toString();break}case"custom":{const i=t.uri;o+=i.slice(0,1)==="/"?i.slice(1):i;break}default:return void n("abort",400)}let r=503;Ci(e+o).then(i=>{const s=i.status;if(s===200)return r=501,i.json();setTimeout(()=>{n(function(a){return a===404}(s)?"abort":"next",s)})}).then(i=>{setTimeout(typeof i=="object"&&i!==null?()=>{n("success",i)}:()=>{i===404?n("abort",i):n("next",r)})}).catch(()=>{n("next",r)})}};function Ei(e,t){e.forEach(n=>{const o=n.loaderCallbacks;o&&(n.loaderCallbacks=o.filter(r=>r.id!==t))})}let kl=0;var Il={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Tl(e,t,n,o){const r=e.resources.length,i=e.random?Math.floor(Math.random()*r):e.index;let s;if(e.random){let f=e.resources.slice(0);for(s=[];f.length>1;){const z=Math.floor(Math.random()*f.length);s.push(f[z]),f=f.slice(0,z).concat(f.slice(z+1))}s=s.concat(f)}else s=e.resources.slice(i).concat(e.resources.slice(0,i));const a=Date.now();let l,h="pending",w=0,_=null,k=[],$=[];function I(){_&&(clearTimeout(_),_=null)}function p(){h==="pending"&&(h="aborted"),I(),k.forEach(f=>{f.status==="pending"&&(f.status="aborted")}),k=[]}function u(f,z){z&&($=[]),typeof f=="function"&&$.push(f)}function v(){h="failed",$.forEach(f=>{f(void 0,l)})}function y(){k.forEach(f=>{f.status==="pending"&&(f.status="aborted")}),k=[]}function d(){if(h!=="pending")return;I();const f=s.shift();if(f===void 0)return k.length?void(_=setTimeout(()=>{I(),h==="pending"&&(y(),v())},e.timeout)):void v();const z={status:"pending",resource:f,callback:(L,D)=>{(function(M,N,O){const T=N!=="success";switch(k=k.filter(W=>W!==M),h){case"pending":break;case"failed":if(T||!e.dataAfterTimeout)return;break;default:return}if(N==="abort")return l=O,void v();if(T)return l=O,void(k.length||(s.length?d():v()));if(I(),y(),!e.random){const W=e.resources.indexOf(M.resource);W!==-1&&W!==e.index&&(e.index=W)}h="completed",$.forEach(W=>{W(O)})})(z,L,D)}};k.push(z),w++,_=setTimeout(d,e.rotate),n(f,t,z.callback)}return typeof o=="function"&&$.push(o),setTimeout(d),function(){return{startTime:a,payload:t,status:h,queriesSent:w,queriesPending:k.length,subscribe:u,abort:p}}}function xi(e){const t={...Il,...e};let n=[];function o(){n=n.filter(r=>r().status==="pending")}return{query:function(r,i,s){const a=Tl(t,r,i,(l,h)=>{o(),s&&s(l,h)});return n.push(a),a},find:function(r){return n.find(i=>r(i))||null},setIndex:r=>{t.index=r},getIndex:()=>t.index,cleanup:o}}function ki(){}const mo=Object.create(null);function Rl(e,t,n){let o,r;if(typeof e=="string"){const i=uo(e);if(!i)return n(void 0,424),ki;r=i.send;const s=function(a){if(!mo[a]){const l=go(a);if(!l)return;const h={config:l,redundancy:xi(l)};mo[a]=h}return mo[a]}(e);s&&(o=s.redundancy)}else{const i=ho(e);if(i){o=xi(i);const s=uo(e.resources?e.resources[0]:"");s&&(r=s.send)}}return o&&r?o.query(t,r,n)().abort:(n(void 0,424),ki)}function vo(e,t){try{return e.getItem(t)}catch{}}function yo(e,t,n){try{return e.setItem(t,n),!0}catch{}}function Ii(e,t){try{e.removeItem(t)}catch{}}function wo(e,t){return yo(e,"iconify-count",t.toString())}function bo(e){return parseInt(vo(e,"iconify-count"))||0}const en={local:!0,session:!0},Ti={local:new Set,session:new Set};let _o=!1,nn=typeof window>"u"?{}:window;function Ri(e){const t=e+"Storage";try{if(nn&&nn[t]&&typeof nn[t].length=="number")return nn[t]}catch{}en[e]=!1}function Mi(e,t){const n=Ri(e);if(!n)return;const o=vo(n,"iconify-version");if(o!=="iconify2"){if(o){const a=bo(n);for(let l=0;l<a;l++)Ii(n,"iconify"+l.toString())}return yo(n,"iconify-version","iconify2"),void wo(n,0)}const r=Math.floor(Date.now()/36e5)-168,i=a=>{const l="iconify"+a.toString(),h=vo(n,l);if(typeof h=="string"){try{const w=JSON.parse(h);if(typeof w=="object"&&typeof w.cached=="number"&&w.cached>r&&typeof w.provider=="string"&&typeof w.data=="object"&&typeof w.data.prefix=="string"&&t(w,a))return!0}catch{}Ii(n,l)}};let s=bo(n);for(let a=s-1;a>=0;a--)i(a)||(a===s-1?(s--,wo(n,s)):Ti[e].add(a))}function Pi(){if(!_o){_o=!0;for(const e in en)Mi(e,t=>{const n=t.data,o=Ut(t.provider,n.prefix);if(!co(o,n).length)return!1;const r=n.lastModified||-1;return o.lastModifiedCached=o.lastModifiedCached?Math.min(o.lastModifiedCached,r):r,!0})}}function Ml(e,t){function n(o){let r;if(!en[o]||!(r=Ri(o)))return;const i=Ti[o];let s;if(i.size)i.delete(s=Array.from(i).shift());else if(s=bo(r),s>=50||!wo(r,s+1))return;const a={cached:Math.floor(Date.now()/36e5),provider:e.provider,data:t};return yo(r,"iconify"+s.toString(),JSON.stringify(a))}_o||Pi(),t.lastModified&&!function(o,r){const i=o.lastModifiedCached;if(i&&i>=r)return i===r;if(o.lastModifiedCached=r,i)for(const s in en)Mi(s,a=>{const l=a.data;return a.provider!==o.provider||l.prefix!==o.prefix||l.lastModified===r});return!0}(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&delete(t=Object.assign({},t)).not_found,n("local")||n("session"))}function zi(){}function Pl(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,function(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout(()=>{t.pendingCallbacksFlag=!1;const n=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!n.length)return;let o=!1;const r=t.provider,i=t.prefix;n.forEach(s=>{const a=s.icons,l=a.pending.length;a.pending=a.pending.filter(h=>{if(h.prefix!==i)return!0;const w=h.name;if(t.icons[w])a.loaded.push({provider:r,prefix:i,name:w});else{if(!t.missing.has(w))return o=!0,!0;a.missing.push({provider:r,prefix:i,name:w})}return!1}),a.pending.length!==l&&(o||Ei([t],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}(e)}))}const zl=(e,t)=>{const n=function(l,h=!0,w=!1){const _=[];return l.forEach(k=>{const $=typeof k=="string"?Je(k,h,w):k;$&&_.push($)}),_}(e,!0,wi()),o=function(l){const h={loaded:[],missing:[],pending:[]},w=Object.create(null);l.sort((k,$)=>k.provider!==$.provider?k.provider.localeCompare($.provider):k.prefix!==$.prefix?k.prefix.localeCompare($.prefix):k.name.localeCompare($.name));let _={provider:"",prefix:"",name:""};return l.forEach(k=>{if(_.name===k.name&&_.prefix===k.prefix&&_.provider===k.provider)return;_=k;const $=k.provider,I=k.prefix,p=k.name,u=w[$]||(w[$]=Object.create(null)),v=u[I]||(u[I]=Ut($,I));let y;y=p in v.icons?h.loaded:I===""||v.missing.has(p)?h.missing:h.pending;const d={provider:$,prefix:I,name:p};y.push(d)}),h}(n);if(!o.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(o.loaded,o.missing,o.pending,zi)}),()=>{l=!1}}const r=Object.create(null),i=[];let s,a;return o.pending.forEach(l=>{const{provider:h,prefix:w}=l;if(w===a&&h===s)return;s=h,a=w,i.push(Ut(h,w));const _=r[h]||(r[h]=Object.create(null));_[w]||(_[w]=[])}),o.pending.forEach(l=>{const{provider:h,prefix:w,name:_}=l,k=Ut(h,w),$=k.pendingIcons||(k.pendingIcons=new Set);$.has(_)||($.add(_),r[h][w].push(_))}),i.forEach(l=>{const{provider:h,prefix:w}=l;r[h][w].length&&function(_,k){_.iconsToLoad?_.iconsToLoad=_.iconsToLoad.concat(k).sort():_.iconsToLoad=k,_.iconsQueueFlag||(_.iconsQueueFlag=!0,setTimeout(()=>{_.iconsQueueFlag=!1;const{provider:$,prefix:I}=_,p=_.iconsToLoad;let u;delete _.iconsToLoad,p&&(u=uo($))&&u.prepare($,I,p).forEach(v=>{Rl($,v,y=>{if(typeof y!="object")v.icons.forEach(d=>{_.missing.add(d)});else try{const d=co(_,y);if(!d.length)return;const f=_.pendingIcons;f&&d.forEach(z=>{f.delete(z)}),Ml(_,y)}catch(d){console.error(d)}Pl(_)})})}))}(l,r[h][w])}),t?function(l,h,w){const _=kl++,k=Ei.bind(null,w,_);if(!h.pending.length)return k;const $={id:_,icons:h,callback:l,abort:k};return w.forEach(I=>{(I.loaderCallbacks||(I.loaderCallbacks=[])).push($)}),k}(t,o,i):zi},Al=/[\s,]+/;function Ll(e,t){t.split(Al).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0}})}function Dl(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function o(r){for(;r<0;)r+=4;return r%4}if(n===""){const r=parseInt(e);return isNaN(r)?0:o(r)}if(n!==e){let r=0;switch(n){case"%":r=25;break;case"deg":r=90}if(r){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=r,i%1==0?o(i):0)}}return t}const Ai={..._i,inline:!1},$l={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Nl={display:"inline-block"},So={backgroundColor:"currentColor"},Li={backgroundColor:"transparent"},Di={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},$i={webkitMask:So,mask:So,background:Li};for(const e in $i){const t=$i[e];for(const n in Di)t[e+n]=Di[n]}const on={};function Ni(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}["horizontal","vertical"].forEach(e=>{const t=e.slice(0,1)+"Flip";on[e+"-flip"]=t,on[e.slice(0,1)+"-flip"]=t,on[e+"Flip"]=t});const Bi=(e,t)=>{const n=function(u,v){const y={...u};for(const d in v){const f=v[d],z=typeof f;d in bi?(f===null||f&&(z==="string"||z==="number"))&&(y[d]=f):z===typeof y[d]&&(y[d]=d==="rotate"?f%4:f)}return y}(Ai,t),o={...$l},r=t.mode||"svg",i={},s=t.style,a=typeof s!="object"||s instanceof Array?{}:s;for(let u in t){const v=t[u];if(v!==void 0)switch(u){case"icon":case"style":case"onLoad":case"mode":break;case"inline":case"hFlip":case"vFlip":n[u]=v===!0||v==="true"||v===1;break;case"flip":typeof v=="string"&&Ll(n,v);break;case"color":i.color=v;break;case"rotate":typeof v=="string"?n[u]=Dl(v):typeof v=="number"&&(n[u]=v);break;case"ariaHidden":case"aria-hidden":v!==!0&&v!=="true"&&delete o["aria-hidden"];break;default:{const y=on[u];y?v!==!0&&v!=="true"&&v!==1||(n[y]=!0):Ai[u]===void 0&&(o[u]=v)}}}const l=function(u,v){const y={...Qe,...u},d={..._i,...v},f={left:y.left,top:y.top,width:y.width,height:y.height};let z=y.body;[y,d].forEach(Z=>{const Q=[],_t=Z.hFlip,Ht=Z.vFlip;let et,St=Z.rotate;switch(_t?Ht?St+=2:(Q.push("translate("+(f.width+f.left).toString()+" "+(0-f.top).toString()+")"),Q.push("scale(-1 1)"),f.top=f.left=0):Ht&&(Q.push("translate("+(0-f.left).toString()+" "+(f.height+f.top).toString()+")"),Q.push("scale(1 -1)"),f.top=f.left=0),St<0&&(St-=4*Math.floor(St/4)),St%=4,St){case 1:et=f.height/2+f.top,Q.unshift("rotate(90 "+et.toString()+" "+et.toString()+")");break;case 2:Q.unshift("rotate(180 "+(f.width/2+f.left).toString()+" "+(f.height/2+f.top).toString()+")");break;case 3:et=f.width/2+f.left,Q.unshift("rotate(-90 "+et.toString()+" "+et.toString()+")")}St%2==1&&(f.left!==f.top&&(et=f.left,f.left=f.top,f.top=et),f.width!==f.height&&(et=f.width,f.width=f.height,f.height=et)),Q.length&&(z=function(ln,un,hn){const me=function(yt,ve="defs"){let ye="";const te=yt.indexOf("<"+ve);for(;te>=0;){const we=yt.indexOf(">",te),ee=yt.indexOf("</"+ve);if(we===-1||ee===-1)break;const wt=yt.indexOf(">",ee);if(wt===-1)break;ye+=yt.slice(we+1,ee).trim(),yt=yt.slice(0,te).trim()+yt.slice(wt+1)}return{defs:ye,content:yt}}(ln);return Zt=me.defs,Qt=un+me.content+hn,Zt?"<defs>"+Zt+"</defs>"+Qt:Qt;var Zt,Qt}(z,'<g transform="'+Q.join(" ")+'">',"</g>"))});const L=d.width,D=d.height,M=f.width,N=f.height;let O,T;L===null?(T=D===null?"1em":D==="auto"?N:D,O=Si(T,M/N)):(O=L==="auto"?M:L,T=D===null?Si(O,N/M):D==="auto"?N:D);const W={},q=(Z,Q)=>{(_t=>_t==="unset"||_t==="undefined"||_t==="none")(Q)||(W[Z]=Q.toString())};q("width",O),q("height",T);const it=[f.left,f.top,M,N];return W.viewBox=it.join(" "),{attributes:W,viewBox:it,body:z}}(e,n),h=l.attributes;if(n.inline&&(i.verticalAlign="-0.125em"),r==="svg"){o.style={...i,...a},Object.assign(o,h);let u=0,v=t.id;return typeof v=="string"&&(v=v.replace(/-/g,"_")),o.innerHTML=function(y,d=Sl){const f=[];let z;for(;z=_l.exec(y);)f.push(z[1]);if(!f.length)return y;const L="suffix"+(16777216*Math.random()|Date.now()).toString(16);return f.forEach(D=>{const M=typeof d=="function"?d(D):d+(Cl++).toString(),N=D.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");y=y.replace(new RegExp('([#;"])('+N+')([")]|\\.[a-z])',"g"),"$1"+M+L+"$3")}),y=y.replace(new RegExp(L,"g"),"")}(l.body,v?()=>v+"ID"+u++:"iconifyVue"),_n("svg",o)}const{body:w,width:_,height:k}=e,$=r==="mask"||r!=="bg"&&w.indexOf("currentColor")!==-1,I=function(u,v){let y=u.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const d in v)y+=" "+d+'="'+v[d]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+y+">"+u+"</svg>"}(w,{...h,width:_+"",height:k+""});var p;return o.style={...i,"--svg":(p=I,'url("'+function(u){return"data:image/svg+xml,"+function(v){return v.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(u)}(p)+'")'),width:Ni(h.width),height:Ni(h.height),...Nl,...$?So:Li,...a},_n("span",o)};var ji;if(wi(!0),ji=xl,lo[""]=ji,typeof document<"u"&&typeof window<"u"){Pi();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!yl(o))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const o="IconifyProviders["+n+"] is invalid.";try{const r=t[n];if(typeof r!="object"||!r||r.resources===void 0)continue;El(n,r)||console.error(o)}catch{console.error(o)}}}}const Bl={...Qe,body:""},Co=Rt({inheritAttrs:!1,data:()=>({_name:"",_loadingIcon:null,iconMounted:!1,counter:0}),mounted(){this.iconMounted=!0},unmounted(){this.abortLoading()},methods:{abortLoading(){this._loadingIcon&&(this._loadingIcon.abort(),this._loadingIcon=null)},getIcon(e,t){if(typeof e=="object"&&e!==null&&typeof e.body=="string")return this._name="",this.abortLoading(),{data:e};let n;if(typeof e!="string"||(n=Je(e,!1,!0))===null)return this.abortLoading(),null;const o=function(i){const s=typeof i=="string"?Je(i,!0,ue):i;if(s){const a=Ut(s.provider,s.prefix),l=s.name;return a.icons[l]||(a.missing.has(l)?null:void 0)}}(n);if(!o)return this._loadingIcon&&this._loadingIcon.name===e||(this.abortLoading(),this._name="",o!==null&&(this._loadingIcon={name:e,abort:zl([n],()=>{this.counter++})})),null;this.abortLoading(),this._name!==e&&(this._name=e,t&&t(e));const r=["iconify"];return n.prefix!==""&&r.push("iconify--"+n.prefix),n.provider!==""&&r.push("iconify--"+n.provider),{data:o,classes:r}}},render(){this.counter;const e=this.$attrs,t=this.iconMounted||e.ssr?this.getIcon(e.icon,e.onLoad):null;if(!t)return Bi(Bl,e);let n=e;return t.classes&&(n={...e,class:(typeof e.class=="string"?e.class+" ":"")+t.classes.join(" ")}),Bi({...Qe,...t.data},n)}}),Jt=new Map,he=K(new Map);class de{static addWindowPanel(t){Jt.set(t.id,t)}static removeWindowPanel(t){Jt.has(t)&&(Jt.delete(t),he.value.delete(t))}static minimizeWindowPanel(t){Jt.has(t)&&he.value.set(t,-1)}static openWindowPanel(t){Jt.has(t)&&he.value.set(t,1)}}const jl=["src"],Ol={key:1,class:"paneltitle"},Wl={class:"dragPanelBar"},Ul={class:"dragPanelContent"},Fl={class:"drag-pointer-group"};var Eo=Rt({__name:"XWindow",props:{top:{type:[String,Number],default:0},left:{type:[String,Number],default:0},nWidth:{type:[String,Number],default:"300px"},nHeight:{type:[String,Number],default:"400px"},icon:{type:String,default:"img/logo.png"},title:{type:String,default:""},titleHeight:{type:[String,Number],default:"40px"},hasMin:{type:Boolean,default:!0},hasMax:{type:Boolean,default:!1},hasClose:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},pid:{type:String,default:""},tag:{type:[String,Array,Object,Number],default:""}},emits:["close","open","loaded","minimize"],setup(e,{expose:t,emit:n}){const o=mr(),r=e,i=n,s=K(),a=K(),l=Xt(()=>r.isDark),h=K({x:0,y:0}),w=250,_=100,k=K({width:0,height:0}),$=T=>{s.value&&(s.value.style.left=`${T.x}px`,s.value.style.top=`${T.y}px`)};Pt(()=>h.value,T=>{$(T)});const I=T=>{s.value&&(s.value.style.width=`${T.width}px`,s.value.style.height=`${T.height}px`)};Pt(()=>k.value,T=>{I(T)});const p={eventListenerController:null,startingEdges:null,newEdges:null,clickStart:null,mount:()=>{Object.entries(p.refs).forEach(([T,W])=>{W.value&&W.value.addEventListener("mousedown",q=>{p.mouseDown(q,T)})})},mouseDown:(T,W)=>{T.button==0&&(T.preventDefault(),p.startingEdges={left:h.value.x,top:h.value.y,right:h.value.x+k.value.width,bottom:h.value.y+k.value.height},p.newEdges={...p.startingEdges},p.clickStart={x:T.clientX,y:T.clientY},p.eventListenerController=new AbortController,document.addEventListener("mousemove",q=>{p.mouseMove(q,W)},{signal:p.eventListenerController.signal}),document.addEventListener("mouseup",q=>{p.mouseUp(q,W)},{signal:p.eventListenerController.signal}))},mouseMove:(T,W)=>{if(p.startingEdges!=null&&p.newEdges!=null&&p.clickStart!=null&&p.refs[W].value){if(T.preventDefault(),console.log("mouseMove",W),W.toLowerCase().includes("north")){p.newEdges.top=Math.max(p.startingEdges.top+T.clientY-p.clickStart.y,0);const q=p.newEdges.bottom-p.newEdges.top-_;q<0&&(p.newEdges.top+=q)}else W.toLowerCase().includes("south")&&(p.newEdges.bottom=Math.min(p.startingEdges.bottom+T.clientY-p.clickStart.y,document.body.clientHeight));if(W.toLowerCase().includes("west")){p.newEdges.left=Math.max(p.startingEdges.left+T.clientX-p.clickStart.x,0);const q=p.newEdges.right-p.newEdges.left-w;q<0&&(p.newEdges.left+=q)}else W.toLowerCase().includes("east")&&(p.newEdges.right=Math.min(p.startingEdges.right+T.clientX-p.clickStart.x,document.body.clientWidth));p.update()}},update:()=>{p.newEdges==null||p.startingEdges==null||(h.value={x:Math.max(p.newEdges.left,0),y:Math.max(p.newEdges.top,0)},k.value={width:Math.min(Math.max(p.newEdges.right-p.newEdges.left,w),document.body.clientWidth),height:Math.min(Math.max(p.newEdges.bottom-p.newEdges.top,_),document.body.clientHeight)})},mouseUp:(T,W)=>{T.button!=0||p.startingEdges==null||(console.log("mouseUp",W),T.preventDefault(),p.startingEdges=null,p.newEdges=null,p.clickStart=null,p.eventListenerController&&(p.eventListenerController.abort(),p.eventListenerController=null))},refs:{northWest:K(null),north:K(null),northEast:K(null),west:K(null),east:K(null),southWest:K(null),south:K(null),southEast:K(null)}},u={startingMouse:null,startingPosition:null,mouseDown:T=>{T.button==0&&(T.preventDefault(),console.log("mouseDown"),u.startingMouse={x:T.clientX,y:T.clientY},u.startingPosition=h.value,document.addEventListener("mousemove",u.mouseMove),document.addEventListener("mouseup",u.mouseUp))},mouseMove:T=>{!u.startingMouse||!u.startingPosition||(T.preventDefault(),h.value={x:Math.min(Math.max(u.startingPosition.x+T.clientX-u.startingMouse.x,0),document.body.clientWidth-k.value.width),y:Math.min(Math.max(u.startingPosition.y+T.clientY-u.startingMouse.y,0),document.body.clientHeight-k.value.height)})},mouseUp:T=>{T.button!=0||!u.startingMouse||!u.startingPosition||(T.preventDefault(),u.startingMouse=null,u.startingPosition=null,console.log("mouseUp"),document.removeEventListener("mousemove",u.mouseMove),document.removeEventListener("mouseup",u.mouseUp))}};function v(T){return{id:o,icon:r.icon,title:r.title,pid:r.pid,data:T??r.tag}}const y=Xt(()=>he.value.get(o)!==-1),d=K(!1),f=K(!0);function z(){i("minimize",v()),de.minimizeWindowPanel(o)}function L(){d.value=!d.value}function D(){i("close",v(!1)),de.removeWindowPanel(o),f.value=!1}const M=Xt(()=>d.value?"heroicons-outline:square-2-stack":"ant-design:border-outlined"),N={id:o,isShow:y,close:D,open:function(){i("open",v(!0)),f.value=!0},showHidePanel:z};function O(T){if(zn(T))return T;{const W=Number(T);if(W==W)return W;if(T.endsWith("px")){const q=T.substring(0,T.length-2);return Number(q)}if(T.endsWith("%")){const q=T.substring(0,T.length-1);return Number(q)/100*document.body.clientWidth}return 300}}return t(N),Sn(()=>{(function(){let T=90;if(r.hasMin||(T-=30),r.hasMax||(T-=30),r.hasClose||(T-=30),ft.setCssVar("--right-bar-width",T+"px",a.value),!a.value)return;const W=zn(r.titleHeight)?r.titleHeight+"px":r.titleHeight;a.value.style.height=W,a.value.style.lineHeight=W})(),function(){const T=v(N);de.addWindowPanel(T),i("loaded",T)}(),h.value.x=O(r.left),h.value.y=O(r.top),$(h.value),k.value={width:O(r.nWidth),height:O(r.nHeight)},I(k.value),p.mount()}),Os(()=>{de.removeWindowPanel(o)}),(T,W)=>(X(),nt(ir,{appear:"","enter-active-class":"animated zoomIn","leave-active-class":"animated zoomOut"},{default:Ct(()=>[f.value?sr((X(),gt("div",{key:0,ref_key:"dragPanelRef",ref:s,class:At(["dragWindowPanel",{maxPanel:d.value,dragWindowPanel_dark:l.value}])},[J("div",{class:"dragPanelTitle",ref_key:"dragPanelTitleRef",ref:a,onMousedown:W[0]||(W[0]=(...q)=>u.mouseDown&&u.mouseDown(...q))},[ct(T.$slots,"title",{},()=>[r.icon?(X(),gt("img",{key:0,src:r.icon,width:"24",height:"24"},null,8,jl)):st("v-if",!0),r.title?(X(),gt("span",Ol,En(r.title),1)):st("v-if",!0)]),J("div",Wl,[e.hasMin?(X(),nt(xn(Co),{key:0,icon:"ant-design:minus-outlined",onClick:z})):st("v-if",!0),e.hasMax?(X(),nt(xn(Co),{key:1,icon:M.value,onClick:L},null,8,["icon"])):st("v-if",!0),e.hasClose?(X(),nt(xn(Co),{key:2,icon:"ant-design:close-outlined",onClick:D})):st("v-if",!0)])],544),J("div",Ul,[ct(T.$slots,"default")]),J("div",Fl,[J("div",{class:"cursor-nw-resize",ref:p.refs.northWest},null,512),J("div",{class:"cursor-n-resize",ref:p.refs.north},null,512),J("div",{class:"cursor-ne-resize",ref:p.refs.northEast},null,512),J("div",{class:"cursor-w-resize",ref:p.refs.west},null,512),W[1]||(W[1]=J("span",{style:{"pointer-events":"all",visibility:"hidden"}},null,-1)),J("div",{class:"cursor-e-resize",ref:p.refs.east},null,512),J("div",{class:"cursor-sw-resize",ref:p.refs.southWest},null,512),J("div",{class:"cursor-s-resize",ref:p.refs.south},null,512),J("div",{class:"cursor-se-resize",ref:p.refs.southEast},null,512)])],2)),[[ar,y.value]]):st("v-if",!0)]),_:3}))}});function Hl(e){const t=new Hs(new Ee);return t.serialize(e),t.stream.toString()}function ql(e){return e==null||e===""?e:new qs(new Ee(e)).deserialize()}Eo.__scopeId="data-v-39ea9741",Eo.__file="src/controls/xwindow/XWindow.vue";const rn=new Map,xo=new Map;let sn;const Xl={getDefaultClient(){if(sn||(sn=new oe(SysConfig.DefaultHproseAPI)),!sn)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return sn},registerHprose(e,t){const n=xo.get(e);if(!n){const o=new oe(t);rn.set(e,o)}return n},getHprose:e=>xo?.get(e),getProxyHprose:e=>rn.get(e),unregisterHprose(e){rn.get(e)&&(xo.delete(e),rn.delete(e))}},Vl=5e3,Gl=36e5,Ft={Login:"/api/User/Login",ChangeMyPwd:"/api/User/ChangeMyPwd",Logout:"/api/Check/ExitLogin",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken",GetSystemRights:"/api/System/GetSystem"},ko="access_token",Kl=j.Config.ServiceURL.LoginAuthURL;function Io(){const e=Ir();e&&It(Ft.RefreshToken,Kl,{refreshToken:e}).then(t=>{To(t.data)})}function Oi(){const e=kt.getJsonObject(ko);if(!e)return;const t=new Date().getTime(),n=new Date(e.expire).getTime()-t;n>0&&(n<=5e3?Io():setTimeout(Io,n-5e3))}function To(e){const t=new Date().getTime();let n=new Date(e.accessToken.expires).getTime()-t;if(n>=36e5?(n=18e5,console.warn("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u8FC7\u53BB\u65F6\u95F4\uFF01")):n<-6e5&&(n=18e5,console.warn("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u672A\u6765\u65F6\u95F4\uFF01")),n>0){let o=Nt();o?(o.token=e.accessToken.tokenContent,o.expire=e.accessToken.expires,o.refresh=e.refreshToken.tokenContent):o={token:e.accessToken.tokenContent,expire:e.accessToken.expires,refresh:e.refreshToken.tokenContent},kt.set(ko,o,n/1e3),Oi()}else kt.remove(ko)}const an="Wm314243",cn=j.Config.ServiceURL.LoginAuthURL;async function Jl(e){const t={username:e.username,pwd:ie.encryptToString(e.pwd,an)},n=(await It(Ft.Login,cn,t))?.data;return n&&To(n.doubletoken),n}function Yl(e){const t={oldpwd:ie.encryptToString(e.oldpwd,an),newpwd:ie.encryptToString(e.newpwd,an)};return It(Ft.ChangeMyPwd,cn,t)}function Zl(e){return ie.encryptToString(e,an)}function Ql(){const e=Nt();e&&(Rr(Ft.Logout,cn,{token:e.token,reftoken:e.refresh}),Hn())}function tu(e){return It(Ft.CheckToken,cn,{token:e})}const Ro="ROLE_SYSTEM_RIGHT",Mo=new Ae("",sessionStorage);function Wi(){return Mo.get(Ro)}function Po(e){Mo.set(Ro,e)}function Ui(){Mo.remove(Ro)}function Yt(e){if(e)for(let t=0;t<e.length;t++){const n=e[t];n.children&&n.children.length>0?(Yt(n.children),n.children.length===0&&(e.splice(t,1),t--)):n.selected||(e.splice(t,1),t--)}}function Fi(e,t,n="name"){e&&t&&e.forEach(o=>{const r=t.find(i=>i[n]===o[n]);r&&(o.children?r.children&&Fi(o.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(o.selected=r.selected))})}function Hi(e,t,n="name"){e&&t&&e.forEach(o=>{const r=t.find(i=>i[n]===o[n]);r&&(o.children?r.children&&Hi(o.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(o.selected=r.selected))})}function fe(e,t,n,o="name"){const r=e[n],i=t[n];r?i&&Hi(r,i,o):i&&(e[n]=i)}function qi(e){if(e&&e.length>0){const t=e.length;let n,o=!1;if(t>0){o=Lt(e[0]);const r=o?e[0]:JSON.parse(e[0]);if(t>1)for(let i=1;i<e.length;i++){const s=e[i],a=o?s:JSON.parse(s);fe(r,a,"routes","name"),fe(r,a,"widgetMenu","name"),fe(r,a,"widgets","id"),fe(r,a,"functions","id")}n=r}return n&&(Yt(n.routes),Yt(n.widgetMenu),Yt(n.widgets),Yt(n.functions)),n}}const zo=[],Ao=[],Lo=[];function pe(){return Wi()}async function eu(e,t=!1){Ui();const n=Ft.GetSystemRights,o=j.Config.ServiceURL.LoginAuthURL,r=await It(n,o,{systemid:e});if(!r||!r.data)return void j.Message?.warn("\u65E0\u6CD5\u83B7\u53D6\u529F\u80FD\u6388\u6743\u5217\u8868\uFF01");const i=r.data;if(i&&i.length>0){if(t){const s=JSON.parse(i[0]);return Po(s),s}{const s=qi(i);return Po(s),s}}}function Xi(e,t){const n={...e};return n.meta||(n.meta={}),t.index!=null&&(n.meta.index=t.index),t.title!=null&&(n.meta.title=t.title),e.children&&(n.children=[],t.children&&t.children.forEach(o=>{const r=e.children?.find(i=>i.path===o.path);if(r){const i=Xi(r,o);i&&n.children?.push(i)}})),n}function nu(e,t=2){if(t===0)return e;const n=pe();return n&&n.routes?(Lo.length>0||e.forEach(o=>{const r=n.routes?.find(i=>i.name===o.name);if(r){const i=Xi(o,r);i&&Lo.push(i)}}),Lo):void 0}function Vi(e,t){const n={...e};return t.index!=null&&(n.index=t.index),e.children&&(n.children=[],t.children&&t.children.forEach(o=>{const r=e.children?.find(i=>i.name===o.name);if(r){const i=Vi(r,o);i&&n.children?.push(i)}})),n}function ou(e,t=2){if(t===0)return e;const n=pe();return n&&n.widgetMenu?(Ao.length>0||e.forEach(o=>{const r=n.widgetMenu?.find(i=>i.name===o.name);if(r){const i=Vi(o,r);i&&Ao.push(i)}}),Ao):void 0}function ru(e,t=2){if(t===0)return e;const n=pe();return n&&n.widgets?(zo.length>0||e?.forEach(o=>{n.widgets?.find(r=>r.id===o.id)&&zo.push(o)}),zo):void 0}function iu(e,t=2){if(t===0)return e;const n=pe();return n?n.functions:void 0}export{tc as BigFileDownload,De as Download,za as DownloadByUrl,Dt as EnumColor,Nr as FileUpload,tl as GetSignalRClient,j as Global,Xl as GlobalHprose,$t as GlobalMitt,ft as H5Tool,ge as HproseClient,Pa as HttpDownload,yr as JsonDownload,Ke as LayoutContainer,ht as LayoutContainerEnum,di as LayoutManager,he as MinWindowMap,ec as ObjToUrlParams,In as Pane,oe as ProxyClient,io as RouterTransition,fi as RouterTransitionAnimate,Ma as SaveAs,Vs as Splitpanes,Ae as Storage,ze as StringUtils,rl as StyleBlack,al as StyleGrayblue,sl as StyleMetal,il as StyleWhite,ce as SuspenseWithError,lt as SysEvents,Vl as TOKEN_REFRESH_TIME,Gl as TOKEN_VALID_TIMESPAN,Ft as USER_TOKEN_API,Ge as VWindow,Tc as WaterMark,ui as WindowResizeEvent,cl as WindowType,Jt as WindowsMap,Eo as XWindow,de as XWindowManager,ie as XXTEA,Ra as calculateBestTextColor,Yl as changeMyPWD,Oi as checkDoRefreshToken,tu as checkToken,Hn as clearLocalToken,Ui as clearRight,ka as colorIsDark,Ha as createFileUpload,Ia as darken,Xr as deepMerge,br as delay,ql as deserialize,Io as doRefreshToken,Vr as exportSystemRights,La as get,pe as getCurrentSystemRight,$a as getData,Zl as getEncryptPWD,iu as getFunctions,ba as getHexColor,Nt as getLocalToken,Ga as getLockState,Sa as getLongHexColor,Br as getProxyClient,_a as getRGBColor,Ea as getRGBColorFromHSLA,Ir as getRefreshToken,Wi as getRight,nu as getRoutes,eu as getSystemRoleRight,ru as getWidgetConfig,ou as getWidgetMenus,Yt as handleNodes,Nn as hexToRGB,Xa as init,Va as initDefaultProxyClient,dt as is,An as isArray,na as isAsyncFunction,ra as isBoolean,ia as isClient,ea as isDate,fr as isDef,aa as isElement,ua as isEmpty,Ca as isEnumColor,ha as isError,Re as isFunction,Le as isHexColor,la as isImageDom,ga as isMap,Pn as isNull,Qs as isNullAndUnDef,ta as isNullOrUnDef,zn as isNumber,Lt as isObjectX,oa as isPromise,ca as isServer,Me as isString,pa as isSymbol,Mn as isUnDef,ma as isValidURL,fa as isWeakMap,da as isWeakSet,sa as isWindow,qa as jquery,Ta as lighten,Jl as login,Ql as logout,qi as mergeFilterRoleSysRight,Fi as mergeNodes,fe as mergeNodesAll,wa as newGuid,Ka as onLockListener,Da as post,It as requestGet,Tr as requestPost,Rr as requestPostBody,xa as rgbToHex,Hl as serialize,To as setLocalToken,Po as setRight,Aa as sleep,ya as storage,kt as storageHelper,Ja as unLockListener,mr as uuid,ac as verifiyNumberInteger,mc as verifyAccount,uc as verifyAndSpace,kc as verifyCarNum,cc as verifyCnAndSpace,_c as verifyEmail,lc as verifyEnAndSpace,Cc as verifyFullName,bc as verifyIPAddress,Sc as verifyIdCard,fc as verifyNumberCnUppercase,hc as verifyNumberComma,to as verifyNumberIntegerAndFloat,ic as verifyNumberPercentage,sc as verifyNumberPercentageFloat,vc as verifyPassword,yc as verifyPasswordPowerful,wc as verifyPasswordStrength,pc as verifyPhone,Ec as verifyPostalCode,gc as verifyTelPhone,dc as verifyTextColor,xc as verifyUrl,oc as writeIconifyList,rc as writeSysRoleRight};
12
+ `,_e(e+o+"export default iconlist;","IconifyList.ts"))}function ia(n,t){const e=ar(n);zo(e,t),B.Message?.msg("\u5BFC\u51FA\u7CFB\u7EDF\u529F\u80FD\u6743\u9650\u6587\u4EF6\u6210\u529F\uFF01")}function sa(n){let t=n.replace(/(^\s*)|(\s*$)/g,"");return t=t.replace(/[^\d]/g,""),t=t.replace(/^0/g,""),t=t.replace(/^[1-9]\d\d{1,3}$/,"100"),t}function aa(n){let t=Pn(n);return t=t.replace(/^[1-9]\d\d{1,3}$/,"100"),t=t.replace(/^100\.$/,"100"),t}function Pn(n){let t=n.replace(/(^\s*)|(\s*$)/g,"");return t=t.replace(/[^\d.]/g,""),t=t.replace(/^0{2}$/g,"0"),t=t.replace(/^\./g,""),t=t.replace(".","$#$").replace(/\./g,"").replace("$#$","."),t=t.replace(/^(\-)*(\d+)\.(\d\d).*$/,"$1$2.$3"),t}function ca(n){let t=n.replace(/(^\s*)|(\s*$)/g,"");return t=t.replace(/[\.]*/g,""),t=t.replace(/(^0[\d]*)$/g,"0"),t=t.replace(/^0\d$/g,"0"),t=t.replace(/[^\d]/g,""),t}function la(n){let t=n.replace(/[\u4e00-\u9fa5\s]+/g,"");return t=t.replace(/(^\s*)|(\s*$)/g,""),t}function ua(n){let t=n.replace(/[a-zA-Z]+/g,"");return t=t.replace(/(^\s*)|(\s*$)/g,""),t}function ha(n){return n.replace(/(^\s*)|(\s*$)/g,"")}function da(n){let t=Pn(n);return t=t.toString().split("."),t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t=t.join("."),t}function fa(n,t="",e="red"){return t.replace(new RegExp(n,"gi"),`<span style='color: ${e}'>${n}</span>`)}function pa(n,t="\u4EDF\u4F70\u62FE\u4EBF\u4EDF\u4F70\u62FE\u4E07\u4EDF\u4F70\u62FE\u5143\u89D2\u5206",e=""){let o=(n+="00").indexOf(".");o>=0&&(n=n.substring(0,o)+n.substr(o+1,2)),t=t.substr(t.length-n.length);for(let r=0;r<n.length;r++)e+="\u96F6\u58F9\u8D30\u53C1\u8086\u4F0D\u9646\u67D2\u634C\u7396".substr(n.substr(r,1),1)+t.substr(r,1);return e=e.replace(/零角零分$/,"\u6574").replace(/零[仟佰拾]/g,"\u96F6").replace(/零{2,}/g,"\u96F6").replace(/零([亿|万])/g,"$1").replace(/零+元/,"\u5143").replace(/亿零{0,3}万/,"\u4EBF").replace(/^元/,"\u96F6\u5143")}function ga(n){return!!/^((12[0-9])|(13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0|1,5-9]))\d{8}$/.test(n)}function ma(n){return!!/\d{3}-\d{8}|\d{4}-\d{7}/.test(n)}function va(n){return!!/^[a-zA-Z][a-zA-Z0-9_]{4,15}$/.test(n)}function ya(n){return!!/^[a-zA-Z]\w{5,15}$/.test(n)}function wa(n){return!!/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(n)}function ba(n){let t="";return/^(?:\d+|[a-zA-Z]+|[!@#$%^&\.*]+){6,16}$/.test(n)&&(t="\u5F31"),/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(n)&&(t="\u4E2D"),/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(n)&&(t="\u5F3A"),t}function _a(n){return!!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(n)}function Sa(n){return!!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n)}function Ca(n){return!!/^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(n)}function Ea(n){return!!/^[\u4e00-\u9fa5]{1,6}(·[\u4e00-\u9fa5]{1,6}){0,2}$/.test(n)}function ka(n){return!!/^[1-9][0-9]{5}$/.test(n)}function xa(n){return!!/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(n)}function Ia(n){return!!/^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/.test(n)}let ur=!0;try{String.fromCharCode.apply(String,[1,2])}catch{ur=!1,Object.defineProperty(Array.prototype,"subarray",{value:Array.prototype.slice})}var Mn=2654435769;function hr(n,t){var e=n.length,o=e<<2;if(t){var r=n[e-1];if(r<(o-=4)-3||r>o)return null;o=r}for(var i=new Uint8Array(o),s=0;s<o;++s)i[s]=n[s>>2]>>((3&s)<<3);return i}function ke(n,t){var e,o=n.length,r=o>>2;3&o&&++r,t?(e=new Uint32Array(r+1))[r]=o:e=new Uint32Array(r);for(var i=0;i<o;++i)e[i>>2]|=n[i]<<((3&i)<<3);return e}function Lt(n){return 4294967295&n}function xe(n,t,e,o,r,i){return(e>>>5^t<<2)+(t>>>3^e<<4)^(n^t)+(i[3&o^r]^e)}function dr(n){if(n.length<16){var t=new Uint8Array(16);t.set(n),n=t}return n}function Ie(n){for(var t=n.length,e=new Uint8Array(3*t),o=0,r=0;r<t;r++){var i=n.charCodeAt(r);if(i<128)e[o++]=i;else if(i<2048)e[o++]=192|i>>6,e[o++]=128|63&i;else{if(!(i<55296||i>57343)){if(r+1<t){var s=n.charCodeAt(r+1);if(i<56320&&56320<=s&&s<=57343){var c=65536+((1023&i)<<10|1023&s);e[o++]=240|c>>18,e[o++]=128|c>>12&63,e[o++]=128|c>>6&63,e[o++]=128|63&c,r++;continue}}throw new Error("Malformed string")}e[o++]=224|i>>12,e[o++]=128|i>>6&63,e[o++]=128|63&i}}return e.subarray(0,o)}function fr(n){var t=n.length;return t===0?"":t<32767?function(e,o){for(var r=new Array(o),i=0,s=0,c=e.length;i<o&&s<c;i++){var f=e[s++];switch(f>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:r[i]=f;break;case 12:case 13:if(!(s<c))throw new Error("Unfinished UTF-8 octet sequence");r[i]=(31&f)<<6|63&e[s++];break;case 14:if(!(s+1<c))throw new Error("Unfinished UTF-8 octet sequence");r[i]=(15&f)<<12|(63&e[s++])<<6|63&e[s++];break;case 15:if(!(s+2<c))throw new Error("Unfinished UTF-8 octet sequence");var g=((7&f)<<18|(63&e[s++])<<12|(63&e[s++])<<6|63&e[s++])-65536;if(!(0<=g&&g<=1048575))throw new Error("Character outside valid Unicode range: 0x"+g.toString(16));r[i++]=g>>10&1023|55296,r[i]=1023&g|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+f.toString(16))}}return i<o&&(r.length=i),String.fromCharCode.apply(String,r)}(n,t):function(e,o){for(var r=[],i=new Array(32768),s=0,c=0,f=e.length;s<o&&c<f;s++){var g=e[c++];switch(g>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:i[s]=g;break;case 12:case 13:if(!(c<f))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(31&g)<<6|63&e[c++];break;case 14:if(!(c+1<f))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(15&g)<<12|(63&e[c++])<<6|63&e[c++];break;case 15:if(!(c+2<f))throw new Error("Unfinished UTF-8 octet sequence");var S=((7&g)<<18|(63&e[c++])<<12|(63&e[c++])<<6|63&e[c++])-65536;if(!(0<=S&&S<=1048575))throw new Error("Character outside valid Unicode range: 0x"+S.toString(16));i[s++]=S>>10&1023|55296,i[s]=1023&S|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+g.toString(16))}if(s>=32766){var E=s+1;i.length=E,r.push(String.fromCharCode.apply(String,i)),o-=E,s=-1}}return s>0&&(i.length=s,r.push(String.fromCharCode.apply(String,i))),r.join("")}(n,t)}function Ta(n){var t=n.length;if(t===0)return"";var e=ur?n:function(c){for(var f=c.length,g=new Array(c.length),S=0;S<f;++S)g[S]=c[S];return g}(n);if(t<65535)return String.fromCharCode.apply(String,e);for(var o=32767&t,r=t>>15,i=new Array(o?r+1:r),s=0;s<r;++s)i[s]=String.fromCharCode.apply(String,e.subarray(s<<15,s+1<<15));return o&&(i[r]=String.fromCharCode.apply(String,e.subarray(r<<15,t))),i.join("")}function pr(n,t){return typeof n=="string"&&(n=Ie(n)),typeof t=="string"&&(t=Ie(t)),n==null||n.length===0?n:hr(function(e,o){var r,i,s,c,f,g,S=e.length,E=S-1;for(i=e[E],s=0,g=0|Math.floor(6+52/S);g>0;--g){for(c=(s=Lt(s+Mn))>>>2&3,f=0;f<E;++f)r=e[f+1],i=e[f]=Lt(e[f]+xe(s,r,i,f,c,o));r=e[0],i=e[E]=Lt(e[E]+xe(s,r,i,E,c,o))}return e}(ke(n,!0),ke(dr(t),!1)),!1)}function gr(n,t){return typeof n=="string"&&(n=function(e){for(var o=window.atob(e),r=o.length,i=new Uint8Array(r),s=0;s<r;s++)i[s]=o.charCodeAt(s);return i}(n)),typeof t=="string"&&(t=Ie(t)),n==null||n.length===0?n:hr(function(e,o){var r,i,s,c,f,g=e.length,S=g-1;for(r=e[0],s=Lt(Math.floor(6+52/g)*Mn);s!==0;s=Lt(s-Mn)){for(c=s>>>2&3,f=S;f>0;--f)i=e[f-1],r=e[f]=Lt(e[f]-xe(s,r,i,f,c,o));i=e[S],r=e[0]=Lt(e[0]-xe(s,r,i,0,c,o))}return e}(ke(n,!1),ke(dr(t),!1)),!0)}const Yt={toBytes:Ie,toString:fr,encrypt:pr,encryptToString:function(n,t){return window.btoa(Ta(pr(n,t)))},decrypt:gr,decryptToString:function(n,t){return fr(gr(n,t))}},mr=n=>{const t="1.23452384164.123412416";document.getElementById(t)!==null&&document.body.removeChild(document.getElementById(t));const e=document.createElement("canvas");e.width=200,e.height=130;const o=e.getContext("2d");o.rotate(-20*Math.PI/180),o.font="12px Vedana",o.fillStyle="rgba(200, 200, 200, 0.30)",o.textBaseline="middle",o.fillText(n,e.width/10,e.height/2);const r=document.createElement("div");return r.id=t,r.style.pointerEvents="none",r.style.top="0px",r.style.left="0px",r.style.position="fixed",r.style.zIndex="10000000",r.style.width=`${document.documentElement.clientWidth}px`,r.style.height=`${document.documentElement.clientHeight}px`,r.style.background=`url(${e.toDataURL("image/png")}) left top repeat`,document.body.appendChild(r),t},Ra={set:n=>{let t=mr(n);document.getElementById(t)===null&&(t=mr(n))},del:()=>{let n="1.23452384164.123412416";document.getElementById(n)!==null&&document.body.removeChild(document.getElementById(n))}};class $t extends Error{constructor(t,e){const o=new.target.prototype;super(`${t}: Status code '${e}'`),this.statusCode=e,this.__proto__=o}}class zn extends Error{constructor(t="A timeout occurred."){const e=new.target.prototype;super(t),this.__proto__=e}}class vt extends Error{constructor(t="An abort occurred."){const e=new.target.prototype;super(t),this.__proto__=e}}class Pa extends Error{constructor(t,e){const o=new.target.prototype;super(t),this.transport=e,this.errorType="UnsupportedTransportError",this.__proto__=o}}class Ma extends Error{constructor(t,e){const o=new.target.prototype;super(t),this.transport=e,this.errorType="DisabledTransportError",this.__proto__=o}}class za extends Error{constructor(t,e){const o=new.target.prototype;super(t),this.transport=e,this.errorType="FailedToStartTransportError",this.__proto__=o}}class vr extends Error{constructor(t){const e=new.target.prototype;super(t),this.errorType="FailedToNegotiateWithServerError",this.__proto__=e}}class Aa extends Error{constructor(t,e){const o=new.target.prototype;super(t),this.innerErrors=e,this.__proto__=o}}class yr{constructor(t,e,o){this.statusCode=t,this.statusText=e,this.content=o}}class Te{get(t,e){return this.send({...e,method:"GET",url:t})}post(t,e){return this.send({...e,method:"POST",url:t})}delete(t,e){return this.send({...e,method:"DELETE",url:t})}getCookieString(t){return""}}var k;(function(n){n[n.Trace=0]="Trace",n[n.Debug=1]="Debug",n[n.Information=2]="Information",n[n.Warning=3]="Warning",n[n.Error=4]="Error",n[n.Critical=5]="Critical",n[n.None=6]="None"})(k||(k={}));class Jt{constructor(){}log(t,e){}}Jt.instance=new Jt;class tt{static isRequired(t,e){if(t==null)throw new Error(`The '${e}' argument is required.`)}static isNotEmpty(t,e){if(!t||t.match(/^\s*$/))throw new Error(`The '${e}' argument should not be empty.`)}static isIn(t,e,o){if(!(t in e))throw new Error(`Unknown ${o} value: ${t}.`)}}class Z{static get isBrowser(){return!Z.isNode&&typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return!Z.isNode&&typeof self=="object"&&"importScripts"in self}static get isReactNative(){return!Z.isNode&&typeof window=="object"&&window.document===void 0}static get isNode(){return typeof process<"u"&&process.release&&process.release.name==="node"}}function Zt(n,t){let e="";return Nt(n)?(e=`Binary data of length ${n.byteLength}`,t&&(e+=`. Content: '${function(o){const r=new Uint8Array(o);let i="";return r.forEach(s=>{i+=`0x${s<16?"0":""}${s.toString(16)} `}),i.substr(0,i.length-1)}(n)}'`)):typeof n=="string"&&(e=`String data of length ${n.length}`,t&&(e+=`. Content: '${n}'`)),e}function Nt(n){return n&&typeof ArrayBuffer<"u"&&(n instanceof ArrayBuffer||n.constructor&&n.constructor.name==="ArrayBuffer")}async function wr(n,t,e,o,r,i){const s={},[c,f]=Ft();s[c]=f,n.log(k.Trace,`(${t} transport) sending data. ${Zt(r,i.logMessageContent)}.`);const g=Nt(r)?"arraybuffer":"text",S=await e.post(o,{content:r,headers:{...s,...i.headers},responseType:g,timeout:i.timeout,withCredentials:i.withCredentials});n.log(k.Trace,`(${t} transport) request complete. Response status: ${S.statusCode}.`)}class Da{constructor(t,e){this._subject=t,this._observer=e}dispose(){const t=this._subject.observers.indexOf(this._observer);t>-1&&this._subject.observers.splice(t,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(e=>{})}}class Re{constructor(t){this._minLevel=t,this.out=console}log(t,e){if(t>=this._minLevel){const o=`[${new Date().toISOString()}] ${k[t]}: ${e}`;switch(t){case k.Critical:case k.Error:this.out.error(o);break;case k.Warning:this.out.warn(o);break;case k.Information:this.out.info(o);break;default:this.out.log(o)}}}}function Ft(){let n="X-SignalR-User-Agent";return Z.isNode&&(n="User-Agent"),[n,La("8.0.7",$a(),Ba(),Na())]}function La(n,t,e,o){let r="Microsoft SignalR/";const i=n.split(".");return r+=`${i[0]}.${i[1]}`,r+=` (${n}; `,r+=t&&t!==""?`${t}; `:"Unknown OS; ",r+=`${e}`,r+=o?`; ${o}`:"; Unknown Runtime Version",r+=")",r}function $a(){if(!Z.isNode)return"";switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}}function Na(){if(Z.isNode)return process.versions.node}function Ba(){return Z.isNode?"NodeJS":"Browser"}function An(n){return n.stack?n.stack:n.message?n.message:`${n}`}class Wa extends Te{constructor(t){if(super(),this._logger=t,typeof fetch>"u"||Z.isNode){const e=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._jar=new(e("tough-cookie")).CookieJar,typeof fetch>"u"?this._fetchType=e("node-fetch"):this._fetchType=fetch,this._fetchType=e("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("could not find global")}());if(typeof AbortController>"u"){const e=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._abortControllerType=e("abort-controller")}else this._abortControllerType=AbortController}async send(t){if(t.abortSignal&&t.abortSignal.aborted)throw new vt;if(!t.method)throw new Error("No method defined.");if(!t.url)throw new Error("No url defined.");const e=new this._abortControllerType;let o;t.abortSignal&&(t.abortSignal.onabort=()=>{e.abort(),o=new vt});let r,i=null;if(t.timeout){const f=t.timeout;i=setTimeout(()=>{e.abort(),this._logger.log(k.Warning,"Timeout from HTTP request."),o=new zn},f)}t.content===""&&(t.content=void 0),t.content&&(t.headers=t.headers||{},Nt(t.content)?t.headers["Content-Type"]="application/octet-stream":t.headers["Content-Type"]="text/plain;charset=UTF-8");try{r=await this._fetchType(t.url,{body:t.content,cache:"no-cache",credentials:t.withCredentials===!0?"include":"same-origin",headers:{"X-Requested-With":"XMLHttpRequest",...t.headers},method:t.method,mode:"cors",redirect:"follow",signal:e.signal})}catch(f){throw o||(this._logger.log(k.Warning,`Error from HTTP request. ${f}.`),f)}finally{i&&clearTimeout(i),t.abortSignal&&(t.abortSignal.onabort=null)}if(!r.ok){const f=await br(r,"text");throw new $t(f||r.statusText,r.status)}const s=br(r,t.responseType),c=await s;return new yr(r.status,r.statusText,c)}getCookieString(t){let e="";return Z.isNode&&this._jar&&this._jar.getCookies(t,(o,r)=>e=r.join("; ")),e}}function br(n,t){let e;switch(t){case"arraybuffer":e=n.arrayBuffer();break;case"text":default:e=n.text();break;case"blob":case"document":case"json":throw new Error(`${t} is not supported.`)}return e}class Ua extends Te{constructor(t){super(),this._logger=t}send(t){return t.abortSignal&&t.abortSignal.aborted?Promise.reject(new vt):t.method?t.url?new Promise((e,o)=>{const r=new XMLHttpRequest;r.open(t.method,t.url,!0),r.withCredentials=t.withCredentials===void 0||t.withCredentials,r.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.content===""&&(t.content=void 0),t.content&&(Nt(t.content)?r.setRequestHeader("Content-Type","application/octet-stream"):r.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const i=t.headers;i&&Object.keys(i).forEach(s=>{r.setRequestHeader(s,i[s])}),t.responseType&&(r.responseType=t.responseType),t.abortSignal&&(t.abortSignal.onabort=()=>{r.abort(),o(new vt)}),t.timeout&&(r.timeout=t.timeout),r.onload=()=>{t.abortSignal&&(t.abortSignal.onabort=null),r.status>=200&&r.status<300?e(new yr(r.status,r.statusText,r.response||r.responseText)):o(new $t(r.response||r.responseText||r.statusText,r.status))},r.onerror=()=>{this._logger.log(k.Warning,`Error from HTTP request. ${r.status}: ${r.statusText}.`),o(new $t(r.statusText,r.status))},r.ontimeout=()=>{this._logger.log(k.Warning,"Timeout from HTTP request."),o(new zn)},r.send(t.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class Oa extends Te{constructor(t){if(super(),typeof fetch<"u"||Z.isNode)this._httpClient=new Wa(t);else{if(typeof XMLHttpRequest>"u")throw new Error("No usable HttpClient found.");this._httpClient=new Ua(t)}}send(t){return t.abortSignal&&t.abortSignal.aborted?Promise.reject(new vt):t.method?t.url?this._httpClient.send(t):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(t){return this._httpClient.getCookieString(t)}}class pt{static write(t){return`${t}${pt.RecordSeparator}`}static parse(t){if(t[t.length-1]!==pt.RecordSeparator)throw new Error("Message is incomplete.");const e=t.split(pt.RecordSeparator);return e.pop(),e}}pt.RecordSeparatorCode=30,pt.RecordSeparator=String.fromCharCode(pt.RecordSeparatorCode);class ja{writeHandshakeRequest(t){return pt.write(JSON.stringify(t))}parseHandshakeResponse(t){let e,o;if(Nt(t)){const s=new Uint8Array(t),c=s.indexOf(pt.RecordSeparatorCode);if(c===-1)throw new Error("Message is incomplete.");const f=c+1;e=String.fromCharCode.apply(null,Array.prototype.slice.call(s.slice(0,f))),o=s.byteLength>f?s.slice(f).buffer:null}else{const s=t,c=s.indexOf(pt.RecordSeparator);if(c===-1)throw new Error("Message is incomplete.");const f=c+1;e=s.substring(0,f),o=s.length>f?s.substring(f):null}const r=pt.parse(e),i=JSON.parse(r[0]);if(i.type)throw new Error("Expected a handshake response from the server.");return[o,i]}}var H;(function(n){n[n.Invocation=1]="Invocation",n[n.StreamItem=2]="StreamItem",n[n.Completion=3]="Completion",n[n.StreamInvocation=4]="StreamInvocation",n[n.CancelInvocation=5]="CancelInvocation",n[n.Ping=6]="Ping",n[n.Close=7]="Close",n[n.Ack=8]="Ack",n[n.Sequence=9]="Sequence"})(H||(H={}));class Ha{constructor(){this.observers=[]}next(t){for(const e of this.observers)e.next(t)}error(t){for(const e of this.observers)e.error&&e.error(t)}complete(){for(const t of this.observers)t.complete&&t.complete()}subscribe(t){return this.observers.push(t),new Da(this,t)}}class Fa{constructor(t,e,o){this._bufferSize=1e5,this._messages=[],this._totalMessageCount=0,this._waitForSequenceMessage=!1,this._nextReceivingSequenceId=1,this._latestReceivedSequenceId=0,this._bufferedByteCount=0,this._reconnectInProgress=!1,this._protocol=t,this._connection=e,this._bufferSize=o}async _send(t){const e=this._protocol.writeMessage(t);let o=Promise.resolve();if(this._isInvocationMessage(t)){this._totalMessageCount++;let r=()=>{},i=()=>{};Nt(e)?this._bufferedByteCount+=e.byteLength:this._bufferedByteCount+=e.length,this._bufferedByteCount>=this._bufferSize&&(o=new Promise((s,c)=>{r=s,i=c})),this._messages.push(new qa(e,this._totalMessageCount,r,i))}try{this._reconnectInProgress||await this._connection.send(e)}catch{this._disconnected()}await o}_ack(t){let e=-1;for(let o=0;o<this._messages.length;o++){const r=this._messages[o];if(r._id<=t.sequenceId)e=o,Nt(r._message)?this._bufferedByteCount-=r._message.byteLength:this._bufferedByteCount-=r._message.length,r._resolver();else{if(!(this._bufferedByteCount<this._bufferSize))break;r._resolver()}}e!==-1&&(this._messages=this._messages.slice(e+1))}_shouldProcessMessage(t){if(this._waitForSequenceMessage)return t.type===H.Sequence&&(this._waitForSequenceMessage=!1,!0);if(!this._isInvocationMessage(t))return!0;const e=this._nextReceivingSequenceId;return this._nextReceivingSequenceId++,e<=this._latestReceivedSequenceId?(e===this._latestReceivedSequenceId&&this._ackTimer(),!1):(this._latestReceivedSequenceId=e,this._ackTimer(),!0)}_resetSequence(t){t.sequenceId>this._nextReceivingSequenceId?this._connection.stop(new Error("Sequence ID greater than amount of messages we've received.")):this._nextReceivingSequenceId=t.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}async _resend(){const t=this._messages.length!==0?this._messages[0]._id:this._totalMessageCount+1;await this._connection.send(this._protocol.writeMessage({type:H.Sequence,sequenceId:t}));const e=this._messages;for(const o of e)await this._connection.send(o._message);this._reconnectInProgress=!1}_dispose(t){t!=null||(t=new Error("Unable to reconnect to server."));for(const e of this._messages)e._rejector(t)}_isInvocationMessage(t){switch(t.type){case H.Invocation:case H.StreamItem:case H.Completion:case H.StreamInvocation:case H.CancelInvocation:return!0;case H.Close:case H.Sequence:case H.Ping:case H.Ack:return!1}}_ackTimer(){this._ackTimerHandle===void 0&&(this._ackTimerHandle=setTimeout(async()=>{try{this._reconnectInProgress||await this._connection.send(this._protocol.writeMessage({type:H.Ack,sequenceId:this._latestReceivedSequenceId}))}catch{}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0},1e3))}}class qa{constructor(t,e,o,r){this._message=t,this._id=e,this._resolver=o,this._rejector=r}}var J;(function(n){n.Disconnected="Disconnected",n.Connecting="Connecting",n.Connected="Connected",n.Disconnecting="Disconnecting",n.Reconnecting="Reconnecting"})(J||(J={}));class Vn{static create(t,e,o,r,i,s,c){return new Vn(t,e,o,r,i,s,c)}constructor(t,e,o,r,i,s,c){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(k.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},tt.isRequired(t,"connection"),tt.isRequired(e,"logger"),tt.isRequired(o,"protocol"),this.serverTimeoutInMilliseconds=i??3e4,this.keepAliveIntervalInMilliseconds=s??15e3,this._statefulReconnectBufferSize=c??1e5,this._logger=e,this._protocol=o,this.connection=t,this._reconnectPolicy=r,this._handshakeProtocol=new ja,this.connection.onreceive=f=>this._processIncomingData(f),this.connection.onclose=f=>this._connectionClosed(f),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=J.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:H.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(t){if(this._connectionState!==J.Disconnected&&this._connectionState!==J.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!t)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=t}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}async _startWithStateTransitions(){if(this._connectionState!==J.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=J.Connecting,this._logger.log(k.Debug,"Starting HubConnection.");try{await this._startInternal(),Z.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=J.Connected,this._connectionStarted=!0,this._logger.log(k.Debug,"HubConnection connected successfully.")}catch(t){return this._connectionState=J.Disconnected,this._logger.log(k.Debug,`HubConnection failed to start successfully because of error '${t}'.`),Promise.reject(t)}}async _startInternal(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;const t=new Promise((e,o)=>{this._handshakeResolver=e,this._handshakeRejecter=o});await this.connection.start(this._protocol.transferFormat);try{let e=this._protocol.version;this.connection.features.reconnect||(e=1);const o={protocol:this._protocol.name,version:e};if(this._logger.log(k.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(o)),this._logger.log(k.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await t,this._stopDuringStartError)throw this._stopDuringStartError;this.connection.features.reconnect&&(this._messageBuffer=new Fa(this._protocol,this.connection,this._statefulReconnectBufferSize),this.connection.features.disconnected=this._messageBuffer._disconnected.bind(this._messageBuffer),this.connection.features.resend=()=>{if(this._messageBuffer)return this._messageBuffer._resend()}),this.connection.features.inherentKeepAlive||await this._sendMessage(this._cachedPingMessage)}catch(e){throw this._logger.log(k.Debug,`Hub handshake failed with error '${e}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(e),e}}async stop(){const t=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),await this._stopPromise;try{await t}catch{}}_stopInternal(t){if(this._connectionState===J.Disconnected)return this._logger.log(k.Debug,`Call to HubConnection.stop(${t}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===J.Disconnecting)return this._logger.log(k.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;const e=this._connectionState;return this._connectionState=J.Disconnecting,this._logger.log(k.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(k.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(e===J.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=t||new vt("The connection was stopped before the hub handshake could complete."),this.connection.stop(t))}async _sendCloseMessage(){try{await this._sendWithProtocol(this._createCloseMessage())}catch{}}stream(t,...e){const[o,r]=this._replaceStreamingParams(e),i=this._createStreamInvocation(t,e,r);let s;const c=new Ha;return c.cancelCallback=()=>{const f=this._createCancelInvocation(i.invocationId);return delete this._callbacks[i.invocationId],s.then(()=>this._sendWithProtocol(f))},this._callbacks[i.invocationId]=(f,g)=>{g?c.error(g):f&&(f.type===H.Completion?f.error?c.error(new Error(f.error)):c.complete():c.next(f.item))},s=this._sendWithProtocol(i).catch(f=>{c.error(f),delete this._callbacks[i.invocationId]}),this._launchStreams(o,s),c}_sendMessage(t){return this._resetKeepAliveInterval(),this.connection.send(t)}_sendWithProtocol(t){return this._messageBuffer?this._messageBuffer._send(t):this._sendMessage(this._protocol.writeMessage(t))}send(t,...e){const[o,r]=this._replaceStreamingParams(e),i=this._sendWithProtocol(this._createInvocation(t,e,!0,r));return this._launchStreams(o,i),i}invoke(t,...e){const[o,r]=this._replaceStreamingParams(e),i=this._createInvocation(t,e,!1,r);return new Promise((c,f)=>{this._callbacks[i.invocationId]=(S,E)=>{E?f(E):S&&(S.type===H.Completion?S.error?f(new Error(S.error)):c(S.result):f(new Error(`Unexpected message type: ${S.type}`)))};const g=this._sendWithProtocol(i).catch(S=>{f(S),delete this._callbacks[i.invocationId]});this._launchStreams(o,g)})}on(t,e){t&&e&&(t=t.toLowerCase(),this._methods[t]||(this._methods[t]=[]),this._methods[t].indexOf(e)===-1&&this._methods[t].push(e))}off(t,e){if(!t)return;t=t.toLowerCase();const o=this._methods[t];if(o)if(e){const r=o.indexOf(e);r!==-1&&(o.splice(r,1),o.length===0&&delete this._methods[t])}else delete this._methods[t]}onclose(t){t&&this._closedCallbacks.push(t)}onreconnecting(t){t&&this._reconnectingCallbacks.push(t)}onreconnected(t){t&&this._reconnectedCallbacks.push(t)}_processIncomingData(t){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(t=this._processHandshakeResponse(t),this._receivedHandshakeResponse=!0),t){const e=this._protocol.parseMessages(t,this._logger);for(const o of e)if(!this._messageBuffer||this._messageBuffer._shouldProcessMessage(o))switch(o.type){case H.Invocation:this._invokeClientMethod(o).catch(r=>{this._logger.log(k.Error,`Invoke client method threw error: ${An(r)}`)});break;case H.StreamItem:case H.Completion:{const r=this._callbacks[o.invocationId];if(r){o.type===H.Completion&&delete this._callbacks[o.invocationId];try{r(o)}catch(i){this._logger.log(k.Error,`Stream callback threw error: ${An(i)}`)}}break}case H.Ping:break;case H.Close:{this._logger.log(k.Information,"Close message received from server.");const r=o.error?new Error("Server returned an error on close: "+o.error):void 0;o.allowReconnect===!0?this.connection.stop(r):this._stopPromise=this._stopInternal(r);break}case H.Ack:this._messageBuffer&&this._messageBuffer._ack(o);break;case H.Sequence:this._messageBuffer&&this._messageBuffer._resetSequence(o);break;default:this._logger.log(k.Warning,`Invalid message type: ${o.type}.`)}}this._resetTimeoutPeriod()}_processHandshakeResponse(t){let e,o;try{[o,e]=this._handshakeProtocol.parseHandshakeResponse(t)}catch(r){const i="Error parsing handshake response: "+r;this._logger.log(k.Error,i);const s=new Error(i);throw this._handshakeRejecter(s),s}if(e.error){const r="Server returned handshake error: "+e.error;this._logger.log(k.Error,r);const i=new Error(r);throw this._handshakeRejecter(i),i}return this._logger.log(k.Debug,"Server handshake complete."),this._handshakeResolver(),o}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=new Date().getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if(!(this.connection.features&&this.connection.features.inherentKeepAlive||(this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds),this._pingServerHandle!==void 0))){let t=this._nextKeepAlive-new Date().getTime();t<0&&(t=0),this._pingServerHandle=setTimeout(async()=>{if(this._connectionState===J.Connected)try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}},t)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}async _invokeClientMethod(t){const e=t.target.toLowerCase(),o=this._methods[e];if(!o)return this._logger.log(k.Warning,`No client method with the name '${e}' found.`),void(t.invocationId&&(this._logger.log(k.Warning,`No result given for '${e}' method and invocation ID '${t.invocationId}'.`),await this._sendWithProtocol(this._createCompletionMessage(t.invocationId,"Client didn't provide a result.",null))));const r=o.slice(),i=!!t.invocationId;let s,c,f;for(const g of r)try{const S=s;s=await g.apply(this,t.arguments),i&&s&&S&&(this._logger.log(k.Error,`Multiple results provided for '${e}'. Sending error to server.`),f=this._createCompletionMessage(t.invocationId,"Client provided multiple results.",null)),c=void 0}catch(S){c=S,this._logger.log(k.Error,`A callback for the method '${e}' threw error '${S}'.`)}f?await this._sendWithProtocol(f):i?(c?f=this._createCompletionMessage(t.invocationId,`${c}`,null):s!==void 0?f=this._createCompletionMessage(t.invocationId,null,s):(this._logger.log(k.Warning,`No result given for '${e}' method and invocation ID '${t.invocationId}'.`),f=this._createCompletionMessage(t.invocationId,"Client didn't provide a result.",null)),await this._sendWithProtocol(f)):s&&this._logger.log(k.Error,`Result given for '${e}' method but server is not expecting a result.`)}_connectionClosed(t){this._logger.log(k.Debug,`HubConnection.connectionClosed(${t}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||t||new vt("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(t||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===J.Disconnecting?this._completeClose(t):this._connectionState===J.Connected&&this._reconnectPolicy?this._reconnect(t):this._connectionState===J.Connected&&this._completeClose(t)}_completeClose(t){if(this._connectionStarted){this._connectionState=J.Disconnected,this._connectionStarted=!1,this._messageBuffer&&(this._messageBuffer._dispose(t??new Error("Connection closed.")),this._messageBuffer=void 0),Z.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(e=>e.apply(this,[t]))}catch(e){this._logger.log(k.Error,`An onclose callback called with error '${t}' threw error '${e}'.`)}}}async _reconnect(t){const e=Date.now();let o=0,r=t!==void 0?t:new Error("Attempting to reconnect due to a unknown error."),i=this._getNextRetryDelay(o++,0,r);if(i===null)return this._logger.log(k.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(t);if(this._connectionState=J.Reconnecting,t?this._logger.log(k.Information,`Connection reconnecting because of error '${t}'.`):this._logger.log(k.Information,"Connection reconnecting."),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(s=>s.apply(this,[t]))}catch(s){this._logger.log(k.Error,`An onreconnecting callback called with error '${t}' threw error '${s}'.`)}if(this._connectionState!==J.Reconnecting)return void this._logger.log(k.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;i!==null;){if(this._logger.log(k.Information,`Reconnect attempt number ${o} will start in ${i} ms.`),await new Promise(s=>{this._reconnectDelayHandle=setTimeout(s,i)}),this._reconnectDelayHandle=void 0,this._connectionState!==J.Reconnecting)return void this._logger.log(k.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=J.Connected,this._logger.log(k.Information,"HubConnection reconnected successfully."),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(s=>s.apply(this,[this.connection.connectionId]))}catch(s){this._logger.log(k.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${s}'.`)}return}catch(s){if(this._logger.log(k.Information,`Reconnect attempt failed because of error '${s}'.`),this._connectionState!==J.Reconnecting)return this._logger.log(k.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this._connectionState===J.Disconnecting&&this._completeClose());r=s instanceof Error?s:new Error(s.toString()),i=this._getNextRetryDelay(o++,Date.now()-e,r)}}this._logger.log(k.Information,`Reconnect retries have been exhausted after ${Date.now()-e} ms and ${o} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(t,e,o){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:e,previousRetryCount:t,retryReason:o})}catch(r){return this._logger.log(k.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${t}, ${e}) threw error '${r}'.`),null}}_cancelCallbacksWithError(t){const e=this._callbacks;this._callbacks={},Object.keys(e).forEach(o=>{const r=e[o];try{r(null,t)}catch(i){this._logger.log(k.Error,`Stream 'error' callback called with '${t}' threw error: ${An(i)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(t,e,o,r){if(o)return r.length!==0?{arguments:e,streamIds:r,target:t,type:H.Invocation}:{arguments:e,target:t,type:H.Invocation};{const i=this._invocationId;return this._invocationId++,r.length!==0?{arguments:e,invocationId:i.toString(),streamIds:r,target:t,type:H.Invocation}:{arguments:e,invocationId:i.toString(),target:t,type:H.Invocation}}}_launchStreams(t,e){if(t.length!==0){e||(e=Promise.resolve());for(const o in t)t[o].subscribe({complete:()=>{e=e.then(()=>this._sendWithProtocol(this._createCompletionMessage(o)))},error:r=>{let i;i=r instanceof Error?r.message:r&&r.toString?r.toString():"Unknown error",e=e.then(()=>this._sendWithProtocol(this._createCompletionMessage(o,i)))},next:r=>{e=e.then(()=>this._sendWithProtocol(this._createStreamItemMessage(o,r)))}})}}_replaceStreamingParams(t){const e=[],o=[];for(let r=0;r<t.length;r++){const i=t[r];if(this._isObservable(i)){const s=this._invocationId;this._invocationId++,e[s]=i,o.push(s.toString()),t.splice(r,1)}}return[e,o]}_isObservable(t){return t&&t.subscribe&&typeof t.subscribe=="function"}_createStreamInvocation(t,e,o){const r=this._invocationId;return this._invocationId++,o.length!==0?{arguments:e,invocationId:r.toString(),streamIds:o,target:t,type:H.StreamInvocation}:{arguments:e,invocationId:r.toString(),target:t,type:H.StreamInvocation}}_createCancelInvocation(t){return{invocationId:t,type:H.CancelInvocation}}_createStreamItemMessage(t,e){return{invocationId:t,item:e,type:H.StreamItem}}_createCompletionMessage(t,e,o){return e?{error:e,invocationId:t,type:H.Completion}:{invocationId:t,result:o,type:H.Completion}}_createCloseMessage(){return{type:H.Close}}}const Xa=[0,2e3,1e4,3e4,null];class _r{constructor(t){this._retryDelays=t!==void 0?[...t,null]:Xa}nextRetryDelayInMilliseconds(t){return this._retryDelays[t.previousRetryCount]}}class Bt{}Bt.Authorization="Authorization",Bt.Cookie="Cookie";class Ga extends Te{constructor(t,e){super(),this._innerClient=t,this._accessTokenFactory=e}async send(t){let e=!0;this._accessTokenFactory&&(!this._accessToken||t.url&&t.url.indexOf("/negotiate?")>0)&&(e=!1,this._accessToken=await this._accessTokenFactory()),this._setAuthorizationHeader(t);const o=await this._innerClient.send(t);return e&&o.statusCode===401&&this._accessTokenFactory?(this._accessToken=await this._accessTokenFactory(),this._setAuthorizationHeader(t),await this._innerClient.send(t)):o}_setAuthorizationHeader(t){t.headers||(t.headers={}),this._accessToken?t.headers[Bt.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&t.headers[Bt.Authorization]&&delete t.headers[Bt.Authorization]}getCookieString(t){return this._innerClient.getCookieString(t)}}var et,at;(function(n){n[n.None=0]="None",n[n.WebSockets=1]="WebSockets",n[n.ServerSentEvents=2]="ServerSentEvents",n[n.LongPolling=4]="LongPolling"})(et||(et={})),function(n){n[n.Text=1]="Text",n[n.Binary=2]="Binary"}(at||(at={}));class Va{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}}class Sr{get pollAborted(){return this._pollAbort.aborted}constructor(t,e,o){this._httpClient=t,this._logger=e,this._pollAbort=new Va,this._options=o,this._running=!1,this.onreceive=null,this.onclose=null}async connect(t,e){if(tt.isRequired(t,"url"),tt.isRequired(e,"transferFormat"),tt.isIn(e,at,"transferFormat"),this._url=t,this._logger.log(k.Trace,"(LongPolling transport) Connecting."),e===at.Binary&&typeof XMLHttpRequest<"u"&&typeof new XMLHttpRequest().responseType!="string")throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[o,r]=Ft(),i={[o]:r,...this._options.headers},s={abortSignal:this._pollAbort.signal,headers:i,timeout:1e5,withCredentials:this._options.withCredentials};e===at.Binary&&(s.responseType="arraybuffer");const c=`${t}&_=${Date.now()}`;this._logger.log(k.Trace,`(LongPolling transport) polling: ${c}.`);const f=await this._httpClient.get(c,s);f.statusCode!==200?(this._logger.log(k.Error,`(LongPolling transport) Unexpected response code: ${f.statusCode}.`),this._closeError=new $t(f.statusText||"",f.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,s)}async _poll(t,e){try{for(;this._running;)try{const o=`${t}&_=${Date.now()}`;this._logger.log(k.Trace,`(LongPolling transport) polling: ${o}.`);const r=await this._httpClient.get(o,e);r.statusCode===204?(this._logger.log(k.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):r.statusCode!==200?(this._logger.log(k.Error,`(LongPolling transport) Unexpected response code: ${r.statusCode}.`),this._closeError=new $t(r.statusText||"",r.statusCode),this._running=!1):r.content?(this._logger.log(k.Trace,`(LongPolling transport) data received. ${Zt(r.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(r.content)):this._logger.log(k.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(o){this._running?o instanceof zn?this._logger.log(k.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=o,this._running=!1):this._logger.log(k.Trace,`(LongPolling transport) Poll errored after shutdown: ${o.message}`)}}finally{this._logger.log(k.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(t){return this._running?wr(this._logger,"LongPolling",this._httpClient,this._url,t,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(k.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(k.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const t={},[e,o]=Ft();t[e]=o;const r={headers:{...t,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials};let i;try{await this._httpClient.delete(this._url,r)}catch(s){i=s}i?i instanceof $t&&(i.statusCode===404?this._logger.log(k.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this._logger.log(k.Trace,`(LongPolling transport) Error sending a DELETE request: ${i}`)):this._logger.log(k.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this._logger.log(k.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}}_raiseOnClose(){if(this.onclose){let t="(LongPolling transport) Firing onclose event.";this._closeError&&(t+=" Error: "+this._closeError),this._logger.log(k.Trace,t),this.onclose(this._closeError)}}}class Ka{constructor(t,e,o,r){this._httpClient=t,this._accessToken=e,this._logger=o,this._options=r,this.onreceive=null,this.onclose=null}async connect(t,e){return tt.isRequired(t,"url"),tt.isRequired(e,"transferFormat"),tt.isIn(e,at,"transferFormat"),this._logger.log(k.Trace,"(SSE transport) Connecting."),this._url=t,this._accessToken&&(t+=(t.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise((o,r)=>{let i,s=!1;if(e===at.Text){if(Z.isBrowser||Z.isWebWorker)i=new this._options.EventSource(t,{withCredentials:this._options.withCredentials});else{const c=this._httpClient.getCookieString(t),f={};f.Cookie=c;const[g,S]=Ft();f[g]=S,i=new this._options.EventSource(t,{withCredentials:this._options.withCredentials,headers:{...f,...this._options.headers}})}try{i.onmessage=c=>{if(this.onreceive)try{this._logger.log(k.Trace,`(SSE transport) data received. ${Zt(c.data,this._options.logMessageContent)}.`),this.onreceive(c.data)}catch(f){return void this._close(f)}},i.onerror=c=>{s?this._close():r(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},i.onopen=()=>{this._logger.log(k.Information,`SSE connected to ${this._url}`),this._eventSource=i,s=!0,o()}}catch(c){return void r(c)}}else r(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))})}async send(t){return this._eventSource?wr(this._logger,"SSE",this._httpClient,this._url,t,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this._close(),Promise.resolve()}_close(t){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(t))}}class Ya{constructor(t,e,o,r,i,s){this._logger=o,this._accessTokenFactory=e,this._logMessageContent=r,this._webSocketConstructor=i,this._httpClient=t,this.onreceive=null,this.onclose=null,this._headers=s}async connect(t,e){let o;return tt.isRequired(t,"url"),tt.isRequired(e,"transferFormat"),tt.isIn(e,at,"transferFormat"),this._logger.log(k.Trace,"(WebSockets transport) Connecting."),this._accessTokenFactory&&(o=await this._accessTokenFactory()),new Promise((r,i)=>{let s;t=t.replace(/^http/,"ws");const c=this._httpClient.getCookieString(t);let f=!1;if(Z.isNode||Z.isReactNative){const g={},[S,E]=Ft();g[S]=E,o&&(g[Bt.Authorization]=`Bearer ${o}`),c&&(g[Bt.Cookie]=c),s=new this._webSocketConstructor(t,void 0,{headers:{...g,...this._headers}})}else o&&(t+=(t.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(o)}`);s||(s=new this._webSocketConstructor(t)),e===at.Binary&&(s.binaryType="arraybuffer"),s.onopen=g=>{this._logger.log(k.Information,`WebSocket connected to ${t}.`),this._webSocket=s,f=!0,r()},s.onerror=g=>{let S=null;S=typeof ErrorEvent<"u"&&g instanceof ErrorEvent?g.error:"There was an error with the transport",this._logger.log(k.Information,`(WebSockets transport) ${S}.`)},s.onmessage=g=>{if(this._logger.log(k.Trace,`(WebSockets transport) data received. ${Zt(g.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(g.data)}catch(S){return void this._close(S)}},s.onclose=g=>{if(f)this._close(g);else{let S=null;S=typeof ErrorEvent<"u"&&g instanceof ErrorEvent?g.error:"WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",i(new Error(S))}}})}send(t){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(k.Trace,`(WebSockets transport) sending data. ${Zt(t,this._logMessageContent)}.`),this._webSocket.send(t),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(t){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(k.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this._isCloseEvent(t)||t.wasClean!==!1&&t.code===1e3?t instanceof Error?this.onclose(t):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${t.code} (${t.reason||"no reason given"}).`)))}_isCloseEvent(t){return t&&typeof t.wasClean=="boolean"&&typeof t.code=="number"}}class Ja{constructor(t,e={}){var o;if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,tt.isRequired(t,"url"),this._logger=(o=e.logger)===void 0?new Re(k.Information):o===null?Jt.instance:o.log!==void 0?o:new Re(o),this.baseUrl=this._resolveUrl(t),(e=e||{}).logMessageContent=e.logMessageContent!==void 0&&e.logMessageContent,typeof e.withCredentials!="boolean"&&e.withCredentials!==void 0)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");e.withCredentials=e.withCredentials===void 0||e.withCredentials,e.timeout=e.timeout===void 0?1e5:e.timeout;let r=null,i=null;if(Z.isNode&&typeof require<"u"){const s=typeof __webpack_require__=="function"?__non_webpack_require__:require;r=s("ws"),i=s("eventsource")}Z.isNode||typeof WebSocket>"u"||e.WebSocket?Z.isNode&&!e.WebSocket&&r&&(e.WebSocket=r):e.WebSocket=WebSocket,Z.isNode||typeof EventSource>"u"||e.EventSource?Z.isNode&&!e.EventSource&&i!==void 0&&(e.EventSource=i):e.EventSource=EventSource,this._httpClient=new Ga(e.httpClient||new Oa(this._logger),e.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=e,this.onreceive=null,this.onclose=null}async start(t){if(t=t||at.Binary,tt.isIn(t,at,"transferFormat"),this._logger.log(k.Debug,`Starting connection with transfer format '${at[t]}'.`),this._connectionState!=="Disconnected")return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(t),await this._startInternalPromise,this._connectionState==="Disconnecting"){const e="Failed to start the HttpConnection before stop() was called.";return this._logger.log(k.Error,e),await this._stopPromise,Promise.reject(new vt(e))}if(this._connectionState!=="Connected"){const e="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(k.Error,e),Promise.reject(new vt(e))}this._connectionStarted=!0}send(t){return this._connectionState!=="Connected"?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new Kn(this.transport)),this._sendQueue.send(t))}async stop(t){return this._connectionState==="Disconnected"?(this._logger.log(k.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):this._connectionState==="Disconnecting"?(this._logger.log(k.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState="Disconnecting",this._stopPromise=new Promise(e=>{this._stopPromiseResolver=e}),await this._stopInternal(t),void await this._stopPromise)}async _stopInternal(t){this._stopError=t;try{await this._startInternalPromise}catch{}if(this.transport){try{await this.transport.stop()}catch(e){this._logger.log(k.Error,`HttpConnection.transport.stop() threw error '${e}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(k.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(t){let e=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==et.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(et.WebSockets),await this._startTransport(e,t)}else{let o=null,r=0;do{if(o=await this._getNegotiationResponse(e),this._connectionState==="Disconnecting"||this._connectionState==="Disconnected")throw new vt("The connection was stopped during negotiation.");if(o.error)throw new Error(o.error);if(o.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(o.url&&(e=o.url),o.accessToken){const i=o.accessToken;this._accessTokenFactory=()=>i,this._httpClient._accessToken=i,this._httpClient._accessTokenFactory=void 0}r++}while(o.url&&r<100);if(r===100&&o.url)throw new Error("Negotiate redirection limit exceeded.");await this._createTransport(e,this._options.transport,o,t)}this.transport instanceof Sr&&(this.features.inherentKeepAlive=!0),this._connectionState==="Connecting"&&(this._logger.log(k.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(o){return this._logger.log(k.Error,"Failed to start the connection: "+o),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(o)}}async _getNegotiationResponse(t){const e={},[o,r]=Ft();e[o]=r;const i=this._resolveNegotiateUrl(t);this._logger.log(k.Debug,`Sending negotiation request: ${i}.`);try{const s=await this._httpClient.post(i,{content:"",headers:{...e,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(s.statusCode!==200)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${s.statusCode}'`));const c=JSON.parse(s.content);return(!c.negotiateVersion||c.negotiateVersion<1)&&(c.connectionToken=c.connectionId),c.useStatefulReconnect&&this._options._useStatefulReconnect!==!0?Promise.reject(new vr("Client didn't negotiate Stateful Reconnect but the server did.")):c}catch(s){let c="Failed to complete negotiation with the server: "+s;return s instanceof $t&&s.statusCode===404&&(c+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(k.Error,c),Promise.reject(new vr(c))}}_createConnectUrl(t,e){return e?t+(t.indexOf("?")===-1?"?":"&")+`id=${e}`:t}async _createTransport(t,e,o,r){let i=this._createConnectUrl(t,o.connectionToken);if(this._isITransport(e))return this._logger.log(k.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=e,await this._startTransport(i,r),void(this.connectionId=o.connectionId);const s=[],c=o.availableTransports||[];let f=o;for(const g of c){const S=this._resolveTransportOrError(g,e,r,f?.useStatefulReconnect===!0);if(S instanceof Error)s.push(`${g.transport} failed:`),s.push(S);else if(this._isITransport(S)){if(this.transport=S,!f){try{f=await this._getNegotiationResponse(t)}catch(E){return Promise.reject(E)}i=this._createConnectUrl(t,f.connectionToken)}try{return await this._startTransport(i,r),void(this.connectionId=f.connectionId)}catch(E){if(this._logger.log(k.Error,`Failed to start the transport '${g.transport}': ${E}`),f=void 0,s.push(new za(`${g.transport} failed: ${E}`,et[g.transport])),this._connectionState!=="Connecting"){const L="Failed to select transport before stop() was called.";return this._logger.log(k.Debug,L),Promise.reject(new vt(L))}}}}return s.length>0?Promise.reject(new Aa(`Unable to connect to the server with any of the available transports. ${s.join(" ")}`,s)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))}_constructTransport(t){switch(t){case et.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new Ya(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case et.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new Ka(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case et.LongPolling:return new Sr(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${t}.`)}}_startTransport(t,e){return this.transport.onreceive=this.onreceive,this.features.reconnect?this.transport.onclose=async o=>{let r=!1;if(this.features.reconnect){try{this.features.disconnected(),await this.transport.connect(t,e),await this.features.resend()}catch{r=!0}r&&this._stopConnection(o)}else this._stopConnection(o)}:this.transport.onclose=o=>this._stopConnection(o),this.transport.connect(t,e)}_resolveTransportOrError(t,e,o,r){const i=et[t.transport];if(i==null)return this._logger.log(k.Debug,`Skipping transport '${t.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${t.transport}' because it is not supported by this client.`);if(!function(s,c){return!s||(c&s)!=0}(e,i))return this._logger.log(k.Debug,`Skipping transport '${et[i]}' because it was disabled by the client.`),new Ma(`'${et[i]}' is disabled by the client.`,i);{if(!(t.transferFormats.map(c=>at[c]).indexOf(o)>=0))return this._logger.log(k.Debug,`Skipping transport '${et[i]}' because it does not support the requested transfer format '${at[o]}'.`),new Error(`'${et[i]}' does not support ${at[o]}.`);if(i===et.WebSockets&&!this._options.WebSocket||i===et.ServerSentEvents&&!this._options.EventSource)return this._logger.log(k.Debug,`Skipping transport '${et[i]}' because it is not supported in your environment.'`),new Pa(`'${et[i]}' is not supported in your environment.`,i);this._logger.log(k.Debug,`Selecting transport '${et[i]}'.`);try{return this.features.reconnect=i===et.WebSockets?r:void 0,this._constructTransport(i)}catch(c){return c}}}_isITransport(t){return t&&typeof t=="object"&&"connect"in t}_stopConnection(t){if(this._logger.log(k.Debug,`HttpConnection.stopConnection(${t}) called while in state ${this._connectionState}.`),this.transport=void 0,t=this._stopError||t,this._stopError=void 0,this._connectionState!=="Disconnected"){if(this._connectionState==="Connecting")throw this._logger.log(k.Warning,`Call to HttpConnection.stopConnection(${t}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${t}) was called while the connection is still in the connecting state.`);if(this._connectionState==="Disconnecting"&&this._stopPromiseResolver(),t?this._logger.log(k.Error,`Connection disconnected with error '${t}'.`):this._logger.log(k.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(e=>{this._logger.log(k.Error,`TransportSendQueue.stop() threw error '${e}'.`)}),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(t)}catch(e){this._logger.log(k.Error,`HttpConnection.onclose(${t}) threw error '${e}'.`)}}}else this._logger.log(k.Debug,`Call to HttpConnection.stopConnection(${t}) was ignored because the connection is already in the disconnected state.`)}_resolveUrl(t){if(t.lastIndexOf("https://",0)===0||t.lastIndexOf("http://",0)===0)return t;if(!Z.isBrowser)throw new Error(`Cannot resolve '${t}'.`);const e=window.document.createElement("a");return e.href=t,this._logger.log(k.Information,`Normalizing '${t}' to '${e.href}'.`),e.href}_resolveNegotiateUrl(t){const e=new URL(t);e.pathname.endsWith("/")?e.pathname+="negotiate":e.pathname+="/negotiate";const o=new URLSearchParams(e.searchParams);return o.has("negotiateVersion")||o.append("negotiateVersion",this._negotiateVersion.toString()),o.has("useStatefulReconnect")?o.get("useStatefulReconnect")==="true"&&(this._options._useStatefulReconnect=!0):this._options._useStatefulReconnect===!0&&o.append("useStatefulReconnect","true"),e.search=o.toString(),e.toString()}}class Kn{constructor(t){this._transport=t,this._buffer=[],this._executing=!0,this._sendBufferedData=new Pe,this._transportResult=new Pe,this._sendLoopPromise=this._sendLoop()}send(t){return this._bufferData(t),this._transportResult||(this._transportResult=new Pe),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(t){if(this._buffer.length&&typeof this._buffer[0]!=typeof t)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof t}`);this._buffer.push(t),this._sendBufferedData.resolve()}async _sendLoop(){for(;;){if(await this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new Pe;const t=this._transportResult;this._transportResult=void 0;const e=typeof this._buffer[0]=="string"?this._buffer.join(""):Kn._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(e),t.resolve()}catch(o){t.reject(o)}}}static _concatBuffers(t){const e=t.map(i=>i.byteLength).reduce((i,s)=>i+s),o=new Uint8Array(e);let r=0;for(const i of t)o.set(new Uint8Array(i),r),r+=i.byteLength;return o.buffer}}class Pe{constructor(){this.promise=new Promise((t,e)=>[this._resolver,this._rejecter]=[t,e])}resolve(){this._resolver()}reject(t){this._rejecter(t)}}class Za{constructor(){this.name="json",this.version=2,this.transferFormat=at.Text}parseMessages(t,e){if(typeof t!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!t)return[];e===null&&(e=Jt.instance);const o=pt.parse(t),r=[];for(const i of o){const s=JSON.parse(i);if(typeof s.type!="number")throw new Error("Invalid payload.");switch(s.type){case H.Invocation:this._isInvocationMessage(s);break;case H.StreamItem:this._isStreamItemMessage(s);break;case H.Completion:this._isCompletionMessage(s);break;case H.Ping:case H.Close:break;case H.Ack:this._isAckMessage(s);break;case H.Sequence:this._isSequenceMessage(s);break;default:e.log(k.Information,"Unknown message type '"+s.type+"' ignored.");continue}r.push(s)}return r}writeMessage(t){return pt.write(JSON.stringify(t))}_isInvocationMessage(t){this._assertNotEmptyString(t.target,"Invalid payload for Invocation message."),t.invocationId!==void 0&&this._assertNotEmptyString(t.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(t){if(this._assertNotEmptyString(t.invocationId,"Invalid payload for StreamItem message."),t.item===void 0)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(t){if(t.result&&t.error)throw new Error("Invalid payload for Completion message.");!t.result&&t.error&&this._assertNotEmptyString(t.error,"Invalid payload for Completion message."),this._assertNotEmptyString(t.invocationId,"Invalid payload for Completion message.")}_isAckMessage(t){if(typeof t.sequenceId!="number")throw new Error("Invalid SequenceId for Ack message.")}_isSequenceMessage(t){if(typeof t.sequenceId!="number")throw new Error("Invalid SequenceId for Sequence message.")}_assertNotEmptyString(t,e){if(typeof t!="string"||t==="")throw new Error(e)}}const Qa={trace:k.Trace,debug:k.Debug,info:k.Information,information:k.Information,warn:k.Warning,warning:k.Warning,error:k.Error,critical:k.Critical,none:k.None};class tc{configureLogging(t){if(tt.isRequired(t,"logging"),t.log!==void 0)this.logger=t;else if(typeof t=="string"){const e=function(o){const r=Qa[o.toLowerCase()];if(r!==void 0)return r;throw new Error(`Unknown log level: ${o}`)}(t);this.logger=new Re(e)}else this.logger=new Re(t);return this}withUrl(t,e){return tt.isRequired(t,"url"),tt.isNotEmpty(t,"url"),this.url=t,this.httpConnectionOptions=typeof e=="object"?{...this.httpConnectionOptions,...e}:{...this.httpConnectionOptions,transport:e},this}withHubProtocol(t){return tt.isRequired(t,"protocol"),this.protocol=t,this}withAutomaticReconnect(t){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return t?Array.isArray(t)?this.reconnectPolicy=new _r(t):this.reconnectPolicy=t:this.reconnectPolicy=new _r,this}withServerTimeout(t){return tt.isRequired(t,"milliseconds"),this._serverTimeoutInMilliseconds=t,this}withKeepAliveInterval(t){return tt.isRequired(t,"milliseconds"),this._keepAliveIntervalInMilliseconds=t,this}withStatefulReconnect(t){return this.httpConnectionOptions===void 0&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=t?.bufferSize,this}build(){const t=this.httpConnectionOptions||{};if(t.logger===void 0&&(t.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const e=new Ja(this.url,t);return Vn.create(e,this.logger||Jt.instance,this.protocol||new Za,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}}let Me;function ec(n){if(!n){if(Me)return Me;throw new Error("\u9996\u6B21\u6784\u5EFA\uFF0CsignalrURL\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\uFF01")}const t=new tc().configureLogging(k.Information).withUrl(n).withAutomaticReconnect({nextRetryDelayInMilliseconds:()=>5e3}).build();return t.keepAliveIntervalInMilliseconds=15e3,t.serverTimeoutInMilliseconds=18e5,t.start().then(()=>{B.Logger().info("\u542F\u52A8SignalR\u8FDE\u63A5\uFF01")}),t.onclose(async()=>{B.Logger().info("\u65AD\u5F00SignalR\u8FDE\u63A5!")}),t.onreconnecting(()=>{B.Logger().warn("SignalR\u670D\u52A1\u5DF2\u65AD\u7EBF\uFF0C\u91CD\u8FDE\u4E2D...\uFF01")}),t.onreconnected(()=>{B.Logger().warn("SignalR\u91CD\u8FDE\u6210\u529F!")}),Me||(Me=t),t}const Dn=new Set;function Cr(n){return n!==null?parseFloat(n):0}function ze(n){const t=window.getComputedStyle(n),e=Math.ceil([t.paddingLeft,t.width,t.paddingRight].map(Cr).reduce((r,i)=>r+i)),o=Math.ceil([t.paddingTop,t.height,t.paddingBottom].map(Cr).reduce((r,i)=>r+i));return{width:e,height:o}}class Er{width;height;constructor(t,e){this.width=t,this.height=e}}function nc(n){const t=n.windowEl;if(t){const e=parseFloat(t.style.left||"NaN"),o=parseFloat(t.style.top||"NaN");if(!isNaN(e)&&!isNaN(o))return{left:e,top:o}}return null}function oc(n,t,e,o){const r=n-e,i=t-o;return r*r+i*i}window.addEventListener("resize",n=>{Dn.forEach(t=>{t&&ge(t.fixPosition)&&t.fixPosition()})});const Ae=[];var De=It({name:"VWindow",props:{windowStyle:{type:Object,required:!0},isOpen:{type:Boolean,required:!1,default:!0},title:{type:String,required:!0,default:""},closeButton:{type:Boolean,required:!1,default:!0},resizable:{type:Boolean,required:!1,default:!1},isScrollable:{type:Boolean,required:!1,default:!1},padding:{type:Number,required:!1,default:8},activateWhenOpen:{type:Boolean,required:!1,default:!0},positionHint:{type:String,required:!1,default:""},zGroup:{type:Number,required:!1,default:1},overflow:{type:String,required:!1,default:"visible"},minWidth:{type:Number,required:!1,default:1},minHeight:{type:Number,required:!1,default:0},maxWidth:{type:Number,required:!1,default:0},maxHeight:{type:Number,required:!1,default:0},height:{type:Number,required:!1},width:{type:Number,required:!1},top:{type:Number,required:!1},left:{type:Number,required:!1}},components:{myButton:pe},setup(n,{emit:t}){const e=Ai();if(!e)return;const{proxy:o}=e;let r=0,i,s,c;const f=K(n.isOpen),g=()=>{Ae.push(o),c=new Yi(n.zGroup,S),n.isOpen&&function(z){z&&(yo(()=>{r++==0&&(m(o),function(){const A=E.value,{width:M,height:N}=rn(A);let U,R;if(n.left!==void 0!=(n.top!==void 0))throw new Error("Either of left or top is specified. Both must be set or not set.");if(typeof n.left=="number")U=n.left,R=n.top;else{const j=n.positionHint||"auto";switch(j){case"auto":{let X=20,lt=50,ot=0;do{if(Ae.every(yt=>{if(!yt.isOpen||o==yt)return!0;const ie=nc(yt);if(ie==null)return!0;const{left:Ue,top:mt}=ie;return oc(Ue,mt,X,lt)>16}))break;X=(X+40)%(window.innerWidth-200),lt=(lt+40)%(window.innerHeight-200)}while(++ot<100);U=X,R=lt}break;case"center":U=(window.innerWidth-M)/2,R=(window.innerHeight-N)/2,console.log(U,R,window.innerWidth,window.innerHeight,"111111");break;default:try{const X=j.split("/").map(Number);if(X.length!=2)throw null;const[lt,ot]=X;if(!isFinite(lt)||!isFinite(ot))throw null;U=lt>=0?lt:window.innerWidth-M+lt,R=ot>=0?ot:window.innerHeight-N+ot}catch{throw new Error(`invalid position string: ${j}`)}}}A&&(A.style.left=`${U}px`,A.style.top=`${R}px`)}()),n.resizable&&h(),$(),i=new Ki(L.value,E.value,{onMove:()=>$(),onMoveStart:()=>t("move-start"),onMoveEnd:()=>t("move-end")}),n.resizable&&function(){const{height:A}=rn(L.value);s=new Ji(E.value,{onResize:()=>h(),onResizeStart:()=>t("resize-start"),onResizeEnd:()=>t("resize-end"),minWidth:n.minWidth,minHeight:n.minHeight+A,maxWidth:n.maxWidth,maxHeight:n.maxHeight?n.maxHeight+A:void 0})}()}),n.activateWhenOpen&&I())}(!0),Dn.add(o)};function S(z){p.value.zIndex=`${z}`}const E=K(null),L=K(null),O=K(null);function I(){c.raise(),t("activate")}const p=K({...n.windowStyle.window,zIndex:"auto",overflow:n.overflow}),l=Ot(()=>n.windowStyle.titlebar),y=Ot(()=>{const z={...n.windowStyle.content};return n.resizable?z.padding="0":n.padding!=null&&(z.padding=`${n.padding}px`),n.isScrollable&&(z.overflow="auto"),z});function m(z){const{width:A,height:M,top:N,left:U}=z,R=E;if(R&&A!=null&&(R.value.style.width=`${A}px`),M!=null){const j=L.value;if(j){const X=ze(j).height;R.value.style.height=`${M+X}px`}}R&&U!=null&&(R.value.style.left=`${U}px`),R&&N!=null&&(R.value.style.top=`${N}px`)}function h(z=!0){const A=E.value,M=L.value,N=O.value;if(N&&A&&M){const{width:U,height:R}=ze(N),{width:j,height:X}=ze(A),lt=ze(M).height,ot=j-(N.offsetWidth-U),yt=X-lt-(N.offsetHeight-R);N.style.width=`${ot}px`,N.style.height=`${yt}px`,v(),t("resize",new Er(ot,yt)),z&&(t("update:width",ot),t("update:height",yt))}}function v(){const z=E.value;if(z){const A=z.getBoundingClientRect();A.left<0&&(p.value.left="0px"),A.top<0&&(p.value.top="0px"),A.right>window.innerWidth&&(p.value.left=window.innerWidth-A.width+"px"),A.bottom>window.innerHeight&&(p.value.top=window.innerHeight-A.height+"px")}}function $(z=!0){v();const A=E.value;if(A){const{left:M,top:N}=A.getBoundingClientRect();z&&(t("update:left",M),t("update:top",N))}}return Tt(()=>n.isOpen,z=>{f.value=z}),Tt(()=>n.zGroup,z=>{c.group=z}),Tt(()=>n.width,z=>{m({width:z}),h(!1)}),Tt(()=>n.height,z=>{m({height:z}),h(!1)}),Ye(()=>{g()}),Di(()=>{Dn.delete(this),c.unregister(),s&&s.teardown(),i&&i.teardown(),Ae.splice(Ae.indexOf(o),1)}),{isOpen:f,windowEl:E,titlebar:L,content:O,activate:I,styleWindow:p,styleTitlebar:l,styleContent:y,closeButtonClick:function(){f.value=!1,t("closebuttonclick")},fixPosition:v}}});const rc={class:"title"};var kr;De.render=function(n,t,e,o,r,i){const s=ce("myButton");return q(),Q(wo,{name:"fade",onAfterLeave:t[2]||(t[2]=c=>n.$emit("close")),onAfterEnter:t[3]||(t[3]=c=>n.$emit("open")),persisted:""},{default:wt(()=>[bo(Y("div",{class:"window",style:gt(n.styleWindow),ref:"windowEl",onMousedown:t[0]||(t[0]=(...c)=>n.activate&&n.activate(...c)),onTouchstart:t[1]||(t[1]=(...c)=>n.activate&&n.activate(...c))},[Y("div",{class:"titlebar",style:gt(n.styleTitlebar),ref:"titlebar"},[Y("div",rc,[n.$slots.title?it(n.$slots,"title",{key:0}):(q(),ft(Rt,{key:1},[Je(Ze(n.title),1)],64))]),n.closeButton?(q(),Q(s,{key:0,windowStyle:n.windowStyle,onClick:n.closeButtonClick},{default:wt(()=>t[4]||(t[4]=[Je("\xD7")])),_:1},8,["windowStyle","onClick"])):nt("v-if",!0)],4),Y("div",{class:"content",style:gt(n.styleContent),ref:"content"},[it(n.$slots,"default")],4)],36),[[_o,n.isOpen]])]),_:3})},De.__file="src/controls/vuewindow/window/index.vue",function(n){n[n.StyleBlack=0]="StyleBlack",n[n.StyleWhite=1]="StyleWhite",n[n.StyleMetal=2]="StyleMetal",n[n.StyleGrayblue=3]="StyleGrayblue"}(kr||(kr={}));const ic={window:{color:"#fff",boxShadow:"0 0 6pt rgba(255, 255, 255, 0.75)",backgroundColor:"rgba(31, 31, 31, 0.9)"},titlebar:{backgroundColor:"rgba(63, 63, 63, 0.9)"},content:{},button:{color:"white"},buttonHover:{backgroundColor:"rgba(255, 255, 255, 0.25)"},buttonActive:{color:"black",backgroundColor:"rgba(255, 255, 255, 0.5)"}},sc={window:{color:"#000",boxShadow:"0 2pt 4pt rgba(0, 0, 0, 0.5)",backgroundColor:"rgba(239, 239, 239, 0.95)"},titlebar:{backgroundColor:"rgba(191, 191, 191, 0.9)"},content:{},button:{color:"#000"},buttonHover:{backgroundColor:"rgba(0, 0, 0, 0.25)"},buttonActive:{color:"#fff",backgroundColor:"rgba(0, 0, 0, 0.5)"}},ac={window:{color:"#000",boxShadow:"0 4pt 8pt rgba(0, 0, 0, 0.5)",background:"linear-gradient(to bottom, rgb(215, 215, 215), rgb(191, 191, 191))"},titlebar:{background:"linear-gradient(to bottom, rgb(215, 215, 215), rgb(191, 191, 191))"},content:{},button:{color:"#000"},buttonHover:{backgroundColor:"rgba(0, 0, 0, 0.25)"},buttonActive:{color:"#fff",backgroundColor:"rgba(0, 0, 0, 0.5)"}},cc={window:{color:"#fff",fontSize:"14px",boxShadow:"0 0 3pt rgba(255, 255, 255, 0.75)",backgroundColor:"rgba(4,51,81,0.6)",borderRadius:"5px"},titlebar:{backgroundColor:"rgba(4,51,81,0.8)",border:"1px solid rgba(153, 153, 153, 0.5)",borderRadius:"5px",fontSize:"16px",fontWeight:400,color:"#fff"},content:{},button:{color:"white",fontSize:"18px"},buttonHover:{backgroundColor:"rgba(255, 255, 255, 0.25)"},buttonActive:{color:"black",backgroundColor:"rgba(255, 255, 255, 0.5)"}},lc=De;var ct;(function(n){n[n.top=0]="top",n[n.bottom=1]="bottom",n[n.centerBack=2]="centerBack",n[n.centerMain=3]="centerMain",n[n.centerFront=4]="centerFront",n[n.left=5]="left",n[n.right=6]="right"})(ct||(ct={}));class xr{layoutState;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;widgetConfig=new Array;_LayoutID;_mapItemRefs;constructor(t,e,o,r){this.layoutState=t,this._LayoutID=o,this._mapItemRefs=r,e.forEach(i=>{if(i.layoutID===o&&(this.widgetConfig.push(i),i.afterid))if(this.preConditionMap.has(i.afterid))this.preConditionMap.get(i.afterid)?.add(i);else{const s=new Set;s.add(i),this.preConditionMap.set(i.afterid,s)}})}getLayoutID(){return this._LayoutID}getWidgetConfig(){return this.widgetConfig}preloadWidgets(){this.widgetConfig.filter(t=>t.preload&&!t.afterid).forEach(t=>{this._loadWidget(t)})}async loadWidget(t){if(!t)return;let e;if(Mt(t)?e=t:me(t)&&(e=this.widgetConfig.find(o=>o.id===t)),e){if(e.afterid){if(this.isWidgetLoaded(e.afterid))return this._loadWidget(e);{let o=function(c){c.layoutID===r._LayoutID&&c.widgetID===i&&(r._loadWidget(s),B.EventBus.off(st.WidgetLoadedEvent,o))};const r=this,i=e.afterid,s=e;return B.EventBus.on(st.WidgetLoadedEvent,o),this.loadWidget(e.afterid)}}return this._loadWidget(e)}}loadOtherDependenceWidgets(t){this.preConditionMap.has(t)&&this.preConditionMap.get(t)?.forEach(e=>{e.preload&&this._loadWidget(e)})}_loadWidget(t){if(!this.widgetsLoadedSet.has(t.id))return t.component?t.component().then(e=>{if(e.default){const o=Li(e.default);t.layout&&(o.style=t.layout),t.cssClass&&(o.cssClass=t.cssClass),this.getContainerComponents(t.container).value.set(t.id,o),this.widgetsLoadedSet.add(t.id),yo().then(()=>{B.EventBus.emit(st.WidgetLoadedEvent,{layoutID:this._LayoutID,widgetID:t.id}),this.loadOtherDependenceWidgets(t.id)})}}).catch(e=>{B.Logger().error("\u52A0\u8F7DWidget\u5931\u8D25\uFF01",t),B.EventBus.emit(st.WidgetLoadedErrorEvent,t)}):void 0;this.changeWidgetVisible(t.id,!0)}hasDependentWidgets(t){let e=!1;if(this.preConditionMap.has(t)){const o=this.preConditionMap.get(t);if(o){for(const r of o)if(this.isWidgetLoaded(r.id)){e=!0;break}}}return e}unloadWidget(t){if(!t||!this.isWidgetLoaded(t))return;const e=this.widgetConfig.find(o=>o.id===t);if(e){if(this.preConditionMap.has(t)){const o=this.preConditionMap.get(t);if(o)for(const r of o)this.unloadWidget(r.id)}this.getContainerComponents(e.container).value.delete(t),this.widgetsLoadedSet.delete(t),this._mapItemRefs&&this._mapItemRefs.delete(t),B.EventBus.emit(st.WidgetUnLoadedEvent,{layoutID:this._LayoutID,widgetID:t})}}isWidgetLoaded(t){return this.widgetsLoadedSet.has(t)}splitTwoContainer(t=!1){const e=this.layoutState.centerMainContainer,o=this.layoutState.centerBackContainer;t?(e&&(e.style.left="0",e.style.width="100%"),o&&(o.style.width="100%")):(e&&(e.style.left="50%",e.style.width="50%"),o&&(o.style.width="50%"))}getLayoutContainer(t){switch(t){case ct.top:return this.layoutState.topContainer;case ct.bottom:return this.layoutState.bottomContainer;case ct.left:return this.layoutState.leftContainer;case ct.right:return this.layoutState.rightContainer;case ct.centerBack:return this.layoutState.centerBackContainer;case ct.centerMain:return this.layoutState.centerMainContainer;case ct.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(t,e=!1){const o=this.getLayoutContainer(t);o&&(o.style.visibility=e?"visible":"hidden")}changeWidgetVisible(t,e=!1){const o=this.getWidgetComponent(t);o&&o.changeVisible&&o.changeVisible(e)}isWidgetVisible(t){const e=this.getWidgetComponent(t);return!!e&&(!e.isShow||e.isShow.value)}getWidgetComponent(t){if(this.widgetsLoadedSet.has(t)&&this._mapItemRefs)return this._mapItemRefs.get(t)}getWigetItem(t){return this.widgetConfig.find(e=>e.id===t)}getGroupWigetItems(t){return this.widgetConfig.filter(e=>e.group===t)}getContainerComponents(t){if(this.layoutMap.has(t))return this.layoutMap.get(t);{const e=K(new Map);return this.layoutMap.set(t,e),e}}getWidgetLoadedIDList(){const t=[];return this.widgetsLoadedSet.forEach(e=>{t.push(e)}),t}unloadAllWidgets(t){const e=[];this.widgetsLoadedSet.forEach(o=>{t&&t.length>0?t.findIndex(r=>r===o)<0&&e.push(o):e.push(o)}),e.forEach(o=>this.unloadWidget(o))}unloadWidgets(t){t&&t.length>0&&t.forEach(e=>{this.unloadWidget(e)})}static getLayoutManager(t,e){if(e){const o=e.find(r=>r.id===t);if(o&&o.layoutID)return B.LayoutMap.get(o.layoutID)}}}var Qt=It({name:"SuspenseWithError",setup(){const n=K(null);return $i(t=>(n.value="\u5F53\u524D\u9875\u9762\u5B58\u5728\u95EE\u9898\uFF0C\u65E0\u6CD5\u6E32\u67D3\u2026\u2026",console.error("onErrorCaptured",t),!0)),{error:n}}});Qt.render=function(n,t,e,o,r,i){return n.error?it(n.$slots,"error",{key:0},()=>[Je(Ze(n.error),1)]):(q(),Q(Ni,{key:1},{default:wt(()=>[it(n.$slots,"default")]),fallback:wt(()=>[it(n.$slots,"fallback")]),_:3}))},Qt.__file="src/controls/routertransition/SuspenseWithError.vue";var Ln=It({name:"RouterTransition",__name:"RouterTransition",setup:n=>(t,e)=>{const o=ce("router-view");return q(),Q(Qt,null,{default:wt(()=>[le(o,null,{default:wt(({Component:r,route:i})=>[nt(" <transition> "),(q(),Q(So,null,[i.meta.keepAlive?(q(),Q(bt(r),{key:i.name})):nt("v-if",!0)],1024)),i.meta.keepAlive?nt("v-if",!0):(q(),Q(bt(r),{key:i.name})),nt(" </transition> ")]),_:1})]),_:1})}});Ln.__file="src/controls/routertransition/RouterTransition.vue";var Le=It({name:"LayoutContainer",props:{widgetConfig:{type:Array,required:!0,default:()=>[]},layoutID:{type:String,default:void 0},layoutStyle:{type:Object},enableRouterView:{type:Boolean,default:!0}},emits:["containerLoaded"],components:{RouterTransition:Ln},setup(n,{attrs:t,slots:e,emit:o}){const r=n.layoutID,i=K(n.enableRouterView);Tt(()=>n.enableRouterView,()=>{i.value=n.enableRouterView});const s=Bi({topContainer:void 0,centerBackContainer:void 0,centerMainContainer:void 0,centerFrontContainer:void 0,bottomContainer:void 0,leftContainer:void 0,rightContainer:void 0}),c=new Map,f=new xr(s,n.widgetConfig,r,c),g=p(ct.top),S=p(ct.centerBack),E=p(ct.centerFront),L=p(ct.left),O=p(ct.right),I=p(ct.bottom);function p(y){return f?.getContainerComponents(y)}const l=Ot(()=>n.layoutStyle);return Ye(()=>{f&&(r?B.LayoutMap.set(r,f):(B.LayoutManager=f,B.LayoutMap.set("",f)),f.preloadWidgets(),o("containerLoaded",{layoutID:r,layoutManager:f}),B.EventBus.emit(st.LayoutContainerLoaded,{layoutID:r,layoutManager:f}))}),{...Wi(s),topContainerComponents:g,centerbackComponents:S,centerfrontComponents:E,leftContainerComponents:L,rightContainerComponents:O,bottomContainerComponents:I,containerStyle:l,isEnableRouterView:i,setItemRef:(y,m)=>{y&&c.set(m,y)}}}});const uc={ref:"topContainer",class:"topContainer"},hc={key:0,ref:"centerMainContainer",class:"centerdiv mainContainer"},dc={ref:"centerBackContainer",class:"centerdiv backContainer"},fc={ref:"centerFrontContainer",class:"centerdiv centerFrontContainer"},pc={ref:"leftContainer",class:"leftContainer"},gc={ref:"rightContainer",class:"rightContainer"},mc={ref:"bottomContainer",class:"bottomContainer"};Le.render=function(n,t,e,o,r,i){const s=ce("router-transition");return q(),ft("div",{class:"layoutContainer",style:gt(n.containerStyle)},[Y("div",uc,[it(n.$slots,"top"),(q(!0),ft(Rt,null,jt(n.topContainerComponents,([c,f])=>(q(),Q(bt(f),{ref_for:!0,ref:g=>n.setItemRef(g,c),key:c,style:gt(f.style),class:Pt(f.cssClass)},null,8,["style","class"]))),128))],512),Y("div",null,[nt(" \u4E3B\u8981\u5BB9\u5668-\u5E95\u90E8 "),n.isEnableRouterView?(q(),ft("div",hc,[it(n.$slots,"main",{},()=>[le(s)])],512)):nt("v-if",!0),nt(" \u4E0A\u4E00\u5C42-\u4E3B\u5BB9\u5668 "),Y("div",dc,[it(n.$slots,"back"),(q(!0),ft(Rt,null,jt(n.centerbackComponents,([c,f])=>(q(),Q(bt(f),{ref_for:!0,ref:g=>n.setItemRef(g,c),key:c,style:gt(f.style),class:Pt(f.cssClass)},null,8,["style","class"]))),128))],512),nt(" \u6700\u4E0A\u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),Y("div",fc,[it(n.$slots,"front"),(q(!0),ft(Rt,null,jt(n.centerfrontComponents,([c,f])=>(q(),Q(bt(f),{ref_for:!0,ref:g=>n.setItemRef(g,c),key:c,style:gt(f.style),class:Pt(f.cssClass)},null,8,["style","class"]))),128))],512),Y("div",pc,[it(n.$slots,"left"),(q(!0),ft(Rt,null,jt(n.leftContainerComponents,([c,f])=>(q(),Q(bt(f),{ref_for:!0,ref:g=>n.setItemRef(g,c),key:c,style:gt(f.style),class:Pt(f.cssClass)},null,8,["style","class"]))),128))],512),Y("div",gc,[it(n.$slots,"right"),(q(!0),ft(Rt,null,jt(n.rightContainerComponents,([c,f])=>(q(),Q(bt(f),{ref_for:!0,ref:g=>n.setItemRef(g,c),key:c,style:gt(f.style),class:Pt(f.cssClass)},null,8,["style","class"]))),128))],512)]),Y("div",mc,[it(n.$slots,"bottom"),(q(!0),ft(Rt,null,jt(n.bottomContainerComponents,([c,f])=>(q(),Q(bt(f),{ref_for:!0,ref:g=>n.setItemRef(g,c),key:c,style:gt(f.style),class:Pt(f.cssClass)},null,8,["style","class"]))),128))],512),nt(" \u589E\u52A0\u9ED8\u8BA4\u63D2\u69FD "),it(n.$slots,"default")],4)},Le.__scopeId="data-v-4d081e5c",Le.__file="src/controls/layoutcontainer/layout.vue";var Ir=It({name:"RouterTransition",__name:"RouterTransitionAnimate",props:{enterActive:{type:String,required:!1,default:"animated fadeIn"},leaveActive:{type:String,required:!1,default:"animated fadeOut"}},setup:n=>(t,e)=>{const o=ce("router-view");return q(),Q(Qt,null,{default:wt(()=>[le(o,null,{default:wt(({Component:r,route:i})=>[le(Ui,{appear:"","enter-active-class":t.enterActive,"leave-active-class":t.leaveActive},{default:wt(()=>[(q(),Q(So,null,[i.meta.keepAlive?(q(),Q(bt(r),{key:i.name})):nt("v-if",!0)],1024)),i.meta.keepAlive?nt("v-if",!0):(q(),Q(bt(r),{key:i.name}))]),_:2},1032,["enter-active-class","leave-active-class"])]),_:1})]),_:1})}});Ir.__file="src/controls/routertransition/RouterTransitionAnimate.vue";const qt=new Map,te=K(new Map);class ee{static addWindowPanel(t){qt.set(t.id,t)}static removeWindowPanel(t){qt.has(t)&&(qt.delete(t),te.value.delete(t))}static minimizeWindowPanel(t){qt.has(t)&&te.value.set(t,-1)}static openWindowPanel(t){qt.has(t)&&te.value.set(t,1)}}const vc=["src"],yc={key:1,class:"paneltitle"},wc={class:"dragPanelBar"},bc={class:"dragPanelContent"},_c={class:"drag-pointer-group"};var $n=It({__name:"XWindow",props:{top:{type:[String,Number],default:0},left:{type:[String,Number],default:0},nWidth:{type:[String,Number],default:"300px"},nHeight:{type:[String,Number],default:"400px"},icon:{type:String,default:"img/logo.png"},title:{type:String,default:""},titleHeight:{type:[String,Number],default:"40px"},hasMin:{type:Boolean,default:!0},hasMax:{type:Boolean,default:!1},hasClose:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},pid:{type:String,default:""},tag:{type:[String,Array,Object,Number],default:""}},emits:["close","open","loaded","minimize"],setup(n,{expose:t,emit:e}){const o=Po(),r=n,i=e,s=K(),c=K(),f=Ot(()=>r.isDark),g=K({x:0,y:0}),S=250,E=100,L=K({width:0,height:0}),O=R=>{s.value&&(s.value.style.left=`${R.x}px`,s.value.style.top=`${R.y}px`)};Tt(()=>g.value,R=>{O(R)});const I=R=>{s.value&&(s.value.style.width=`${R.width}px`,s.value.style.height=`${R.height}px`)};Tt(()=>L.value,R=>{I(R)});const p={eventListenerController:null,startingEdges:null,newEdges:null,clickStart:null,mount:()=>{Object.entries(p.refs).forEach(([R,j])=>{j.value&&j.value.addEventListener("mousedown",X=>{p.mouseDown(X,R)})})},mouseDown:(R,j)=>{R.button==0&&(R.preventDefault(),p.startingEdges={left:g.value.x,top:g.value.y,right:g.value.x+L.value.width,bottom:g.value.y+L.value.height},p.newEdges={...p.startingEdges},p.clickStart={x:R.clientX,y:R.clientY},p.eventListenerController=new AbortController,document.addEventListener("mousemove",X=>{p.mouseMove(X,j)},{signal:p.eventListenerController.signal}),document.addEventListener("mouseup",X=>{p.mouseUp(X,j)},{signal:p.eventListenerController.signal}))},mouseMove:(R,j)=>{if(p.startingEdges!=null&&p.newEdges!=null&&p.clickStart!=null&&p.refs[j].value){if(R.preventDefault(),console.log("mouseMove",j),j.toLowerCase().includes("north")){p.newEdges.top=Math.max(p.startingEdges.top+R.clientY-p.clickStart.y,0);const X=p.newEdges.bottom-p.newEdges.top-E;X<0&&(p.newEdges.top+=X)}else j.toLowerCase().includes("south")&&(p.newEdges.bottom=Math.min(p.startingEdges.bottom+R.clientY-p.clickStart.y,document.body.clientHeight));if(j.toLowerCase().includes("west")){p.newEdges.left=Math.max(p.startingEdges.left+R.clientX-p.clickStart.x,0);const X=p.newEdges.right-p.newEdges.left-S;X<0&&(p.newEdges.left+=X)}else j.toLowerCase().includes("east")&&(p.newEdges.right=Math.min(p.startingEdges.right+R.clientX-p.clickStart.x,document.body.clientWidth));p.update()}},update:()=>{p.newEdges==null||p.startingEdges==null||(g.value={x:Math.max(p.newEdges.left,0),y:Math.max(p.newEdges.top,0)},L.value={width:Math.min(Math.max(p.newEdges.right-p.newEdges.left,S),document.body.clientWidth),height:Math.min(Math.max(p.newEdges.bottom-p.newEdges.top,E),document.body.clientHeight)})},mouseUp:(R,j)=>{R.button!=0||p.startingEdges==null||(console.log("mouseUp",j),R.preventDefault(),p.startingEdges=null,p.newEdges=null,p.clickStart=null,p.eventListenerController&&(p.eventListenerController.abort(),p.eventListenerController=null))},refs:{northWest:K(null),north:K(null),northEast:K(null),west:K(null),east:K(null),southWest:K(null),south:K(null),southEast:K(null)}},l={startingMouse:null,startingPosition:null,mouseDown:R=>{R.button==0&&(R.preventDefault(),console.log("mouseDown"),l.startingMouse={x:R.clientX,y:R.clientY},l.startingPosition=g.value,document.addEventListener("mousemove",l.mouseMove),document.addEventListener("mouseup",l.mouseUp))},mouseMove:R=>{!l.startingMouse||!l.startingPosition||(R.preventDefault(),g.value={x:Math.min(Math.max(l.startingPosition.x+R.clientX-l.startingMouse.x,0),document.body.clientWidth-L.value.width),y:Math.min(Math.max(l.startingPosition.y+R.clientY-l.startingMouse.y,0),document.body.clientHeight-L.value.height)})},mouseUp:R=>{R.button!=0||!l.startingMouse||!l.startingPosition||(R.preventDefault(),l.startingMouse=null,l.startingPosition=null,console.log("mouseUp"),document.removeEventListener("mousemove",l.mouseMove),document.removeEventListener("mouseup",l.mouseUp))}};function y(R){return{id:o,icon:r.icon,title:r.title,pid:r.pid,data:R??r.tag}}const m=Ot(()=>te.value.get(o)!==-1),h=K(!1),v=K(!0);function $(){i("minimize",y()),ee.minimizeWindowPanel(o)}function z(){h.value=!h.value}function A(){i("close",y(!1)),ee.removeWindowPanel(o),v.value=!1}const M=Ot(()=>h.value?"heroicons-outline:square-2-stack":"ant-design:border-outlined"),N={id:o,isShow:m,close:A,open:function(){i("open",y(!0)),v.value=!0},showHidePanel:$};function U(R){if(cn(R))return R;{const j=Number(R);if(j==j)return j;if(R.endsWith("px")){const X=R.substring(0,R.length-2);return Number(X)}if(R.endsWith("%")){const X=R.substring(0,R.length-1);return Number(X)/100*document.body.clientWidth}return 300}}return t(N),Ye(()=>{(function(){let R=90;if(r.hasMin||(R-=30),r.hasMax||(R-=30),r.hasClose||(R-=30),ht.setCssVar("--right-bar-width",R+"px",c.value),!c.value)return;const j=cn(r.titleHeight)?r.titleHeight+"px":r.titleHeight;c.value.style.height=j,c.value.style.lineHeight=j})(),function(){const R=y(N);ee.addWindowPanel(R),i("loaded",R)}(),g.value.x=U(r.left),g.value.y=U(r.top),O(g.value),L.value={width:U(r.nWidth),height:U(r.nHeight)},I(L.value),p.mount()}),Oi(()=>{ee.removeWindowPanel(o)}),(R,j)=>(q(),Q(wo,{appear:"","enter-active-class":"animated zoomIn","leave-active-class":"animated zoomOut"},{default:wt(()=>[v.value?bo((q(),ft("div",{key:0,ref_key:"dragPanelRef",ref:s,class:Pt(["dragWindowPanel",{maxPanel:h.value,dragWindowPanel_dark:f.value}])},[Y("div",{class:"dragPanelTitle",ref_key:"dragPanelTitleRef",ref:c,onMousedown:j[0]||(j[0]=(...X)=>l.mouseDown&&l.mouseDown(...X))},[it(R.$slots,"title",{},()=>[r.icon?(q(),ft("img",{key:0,src:r.icon,width:"24",height:"24"},null,8,vc)):nt("v-if",!0),r.title?(q(),ft("span",yc,Ze(r.title),1)):nt("v-if",!0)]),Y("div",wc,[n.hasMin?(q(),Q(Qe(en),{key:0,icon:"ant-design:minus-outlined",onClick:$})):nt("v-if",!0),n.hasMax?(q(),Q(Qe(en),{key:1,icon:M.value,onClick:z},null,8,["icon"])):nt("v-if",!0),n.hasClose?(q(),Q(Qe(en),{key:2,icon:"ant-design:close-outlined",onClick:A})):nt("v-if",!0)])],544),Y("div",bc,[it(R.$slots,"default")]),Y("div",_c,[Y("div",{class:"cursor-nw-resize",ref:p.refs.northWest},null,512),Y("div",{class:"cursor-n-resize",ref:p.refs.north},null,512),Y("div",{class:"cursor-ne-resize",ref:p.refs.northEast},null,512),Y("div",{class:"cursor-w-resize",ref:p.refs.west},null,512),j[1]||(j[1]=Y("span",{style:{"pointer-events":"all",visibility:"hidden"}},null,-1)),Y("div",{class:"cursor-e-resize",ref:p.refs.east},null,512),Y("div",{class:"cursor-sw-resize",ref:p.refs.southWest},null,512),Y("div",{class:"cursor-s-resize",ref:p.refs.south},null,512),Y("div",{class:"cursor-se-resize",ref:p.refs.southEast},null,512)])],2)),[[_o,m.value]]):nt("v-if",!0)]),_:3}))}});function Sc(n){const t=new qi(new ue);return t.serialize(n),t.stream.toString()}function Cc(n){return n==null||n===""?n:new Xi(new ue(n)).deserialize()}$n.__scopeId="data-v-39ea9741",$n.__file="src/controls/xwindow/XWindow.vue";const $e=new Map,Nn=new Map;let Ne;const Ec={getDefaultClient(){if(Ne||(Ne=new Vt(SysConfig.DefaultHproseAPI)),!Ne)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return Ne},registerHprose(n,t){const e=Nn.get(n);if(!e){const o=new Vt(t);$e.set(n,o)}return e},getHprose:n=>Nn?.get(n),getProxyHprose:n=>$e.get(n),unregisterHprose(n){$e.get(n)&&(Nn.delete(n),$e.delete(n))}},kc=5e3,xc=36e5,Wt={Login:"/api/User/Login",ChangeMyPwd:"/api/User/ChangeMyPwd",Logout:"/api/Check/ExitLogin",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken",GetSystemRights:"/api/System/GetSystem"},Bn="access_token",Ic=B.Config.ServiceURL.LoginAuthURL;function Wn(){const n=Oo();n&&Ct(Wt.RefreshToken,Ic,{refreshToken:n}).then(t=>{Un(t.data)})}function Tr(){const n=St.getJsonObject(Bn);if(!n)return;const t=new Date().getTime(),e=new Date(n.expire).getTime()-t;e>0&&(e<=5e3?Wn():setTimeout(Wn,e-5e3))}function Un(n){const t=new Date().getTime();let e=new Date(n.accessToken.expires).getTime()-t;if(e>=36e5?(e=18e5,console.warn("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u8FC7\u53BB\u65F6\u95F4\uFF01")):e<-6e5&&(e=18e5,console.warn("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u672A\u6765\u65F6\u95F4\uFF01")),e>0){let o=Dt();o?(o.token=n.accessToken.tokenContent,o.expire=n.accessToken.expires,o.refresh=n.refreshToken.tokenContent):o={token:n.accessToken.tokenContent,expire:n.accessToken.expires,refresh:n.refreshToken.tokenContent},St.set(Bn,o,e/1e3),Tr()}else St.remove(Bn)}const Be="Wm314243",We=B.Config.ServiceURL.LoginAuthURL;async function Tc(n){const t={username:n.username,pwd:Yt.encryptToString(n.pwd,Be)},e=(await Ct(Wt.Login,We,t))?.data;return e&&Un(e.doubletoken),e}function Rc(n){const t={oldpwd:Yt.encryptToString(n.oldpwd,Be),newpwd:Yt.encryptToString(n.newpwd,Be)};return Ct(Wt.ChangeMyPwd,We,t)}function Pc(n){return Yt.encryptToString(n,Be)}function Mc(){const n=Dt();n&&(Ho(Wt.Logout,We,{token:n.token,reftoken:n.refresh}),bn())}function zc(n){return Ct(Wt.CheckToken,We,{token:n})}const On="ROLE_SYSTEM_RIGHT",jn=new we("",sessionStorage);function Rr(){return jn.get(On)}function Hn(n){jn.set(On,n)}function Pr(){jn.remove(On)}function Xt(n){if(n)for(let t=0;t<n.length;t++){const e=n[t];e.children&&e.children.length>0?(Xt(e.children),e.children.length===0&&(n.splice(t,1),t--)):e.selected||(n.splice(t,1),t--)}}function Mr(n,t,e="name"){n&&t&&n.forEach(o=>{const r=t.find(i=>i[e]===o[e]);r&&(o.children?r.children&&Mr(o.children,r.children,e):(!r.children||r.children.length===0)&&r.selected&&(o.selected=r.selected))})}function zr(n,t,e="name"){n&&t&&n.forEach(o=>{const r=t.find(i=>i[e]===o[e]);r&&(o.children?r.children&&zr(o.children,r.children,e):(!r.children||r.children.length===0)&&r.selected&&(o.selected=r.selected))})}function ne(n,t,e,o="name"){const r=n[e],i=t[e];r?i&&zr(r,i,o):i&&(n[e]=i)}function Ar(n){if(n&&n.length>0){const t=n.length;let e,o=!1;if(t>0){o=Mt(n[0]);const r=o?n[0]:JSON.parse(n[0]);if(t>1)for(let i=1;i<n.length;i++){const s=n[i],c=o?s:JSON.parse(s);ne(r,c,"routes","name"),ne(r,c,"widgetMenu","name"),ne(r,c,"widgets","id"),ne(r,c,"functions","id")}e=r}return e&&(Xt(e.routes),Xt(e.widgetMenu),Xt(e.widgets),Xt(e.functions)),e}}const Fn=[],qn=[],Xn=[];function oe(){return Rr()}async function Ac(n,t=!1){Pr();const e=Wt.GetSystemRights,o=B.Config.ServiceURL.LoginAuthURL,r=await Ct(e,o,{systemid:n});if(!r||!r.data)return void B.Message?.warn("\u65E0\u6CD5\u83B7\u53D6\u529F\u80FD\u6388\u6743\u5217\u8868\uFF01");const i=r.data;if(i&&i.length>0){if(t){const s=JSON.parse(i[0]);return Hn(s),s}{const s=Ar(i);return Hn(s),s}}}function Dr(n,t){const e={...n};return e.meta||(e.meta={}),t.index!=null&&(e.meta.index=t.index),t.title!=null&&(e.meta.title=t.title),n.children&&(e.children=[],t.children&&t.children.forEach(o=>{const r=n.children?.find(i=>i.path===o.path);if(r){const i=Dr(r,o);i&&e.children?.push(i)}})),e}function Dc(n,t=2){if(t===0)return n;const e=oe();return e&&e.routes?(Xn.length>0||n.forEach(o=>{const r=e.routes?.find(i=>i.name===o.name);if(r){const i=Dr(o,r);i&&Xn.push(i)}}),Xn):void 0}function Lr(n,t){const e={...n};return t.index!=null&&(e.index=t.index),n.children&&(e.children=[],t.children&&t.children.forEach(o=>{const r=n.children?.find(i=>i.name===o.name);if(r){const i=Lr(r,o);i&&e.children?.push(i)}})),e}function Lc(n,t=2){if(t===0)return n;const e=oe();return e&&e.widgetMenu?(qn.length>0||n.forEach(o=>{const r=e.widgetMenu?.find(i=>i.name===o.name);if(r){const i=Lr(o,r);i&&qn.push(i)}}),qn):void 0}function $c(n,t=2){if(t===0)return n;const e=oe();return e&&e.widgets?(Fn.length>0||n?.forEach(o=>{e.widgets?.find(r=>r.id===o.id)&&Fn.push(o)}),Fn):void 0}function Nc(n,t=2){if(t===0)return n;const e=oe();return e?e.functions:void 0}export{ea as BigFileDownload,_e as Download,As as DownloadByUrl,zt as EnumColor,Jo as FileUpload,ec as GetSignalRClient,B as Global,Ec as GlobalHprose,At as GlobalMitt,ht as H5Tool,re as HproseClient,zs as HttpDownload,zo as JsonDownload,Le as LayoutContainer,ct as LayoutContainerEnum,xr as LayoutManager,te as MinWindowMap,na as ObjToUrlParams,nn as Pane,Vt as ProxyClient,Ln as RouterTransition,Ir as RouterTransitionAnimate,Ms as SaveAs,Vi as Splitpanes,we as Storage,ye as StringUtils,ic as StyleBlack,cc as StyleGrayblue,ac as StyleMetal,sc as StyleWhite,Qt as SuspenseWithError,st as SysEvents,kc as TOKEN_REFRESH_TIME,xc as TOKEN_VALID_TIMESPAN,Wt as USER_TOKEN_API,De as VWindow,Ra as WaterMark,Er as WindowResizeEvent,lc as WindowType,qt as WindowsMap,$n as XWindow,ee as XWindowManager,Yt as XXTEA,Ps as calculateBestTextColor,Rc as changeMyPWD,Tr as checkDoRefreshToken,zc as checkToken,bn as clearLocalToken,Pr as clearRight,Is as colorIsDark,qs as createFileUpload,Ts as darken,sr as deepMerge,Do as delay,Cc as deserialize,Wn as doRefreshToken,ar as exportSystemRights,Ls as get,oe as getCurrentSystemRight,Ns as getData,Pc as getEncryptPWD,Nc as getFunctions,_s as getHexColor,Dt as getLocalToken,Ks as getLockState,Cs as getLongHexColor,Zo as getProxyClient,Ss as getRGBColor,ks as getRGBColorFromHSLA,Oo as getRefreshToken,Rr as getRight,Dc as getRoutes,Ac as getSystemRoleRight,$c as getWidgetConfig,Lc as getWidgetMenus,Xt as handleNodes,fn as hexToRGB,Gs as init,Vs as initDefaultProxyClient,ut as is,ln as isArray,os as isAsyncFunction,is as isBoolean,ss as isClient,ns as isDate,Io as isDef,cs as isElement,hs as isEmpty,Es as isEnumColor,ds as isError,ge as isFunction,be as isHexColor,us as isImageDom,ms as isMap,an as isNull,ts as isNullAndUnDef,es as isNullOrUnDef,cn as isNumber,Mt as isObjectX,rs as isPromise,ls as isServer,me as isString,gs as isSymbol,sn as isUnDef,vs as isValidURL,ps as isWeakMap,fs as isWeakSet,as as isWindow,Xs as jquery,Rs as lighten,Tc as login,Mc as logout,Ar as mergeFilterRoleSysRight,Mr as mergeNodes,ne as mergeNodesAll,bs as newGuid,Ys as onLockListener,$s as post,Ct as requestGet,jo as requestPost,Ho as requestPostBody,xs as rgbToHex,Sc as serialize,Un as setLocalToken,Hn as setRight,Ds as sleep,ws as storage,St as storageHelper,Js as unLockListener,Po as uuid,ca as verifiyNumberInteger,va as verifyAccount,ha as verifyAndSpace,Ia as verifyCarNum,la as verifyCnAndSpace,Sa as verifyEmail,ua as verifyEnAndSpace,Ea as verifyFullName,_a as verifyIPAddress,Ca as verifyIdCard,pa as verifyNumberCnUppercase,da as verifyNumberComma,Pn as verifyNumberIntegerAndFloat,sa as verifyNumberPercentage,aa as verifyNumberPercentageFloat,ya as verifyPassword,wa as verifyPasswordPowerful,ba as verifyPasswordStrength,ga as verifyPhone,ka as verifyPostalCode,ma as verifyTelPhone,fa as verifyTextColor,xa as verifyUrl,ra as writeIconifyList,ia as writeSysRoleRight};