xframelib 0.7.8 → 0.8.0
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/README.md +4 -3
- package/dist/controls/layoutcontainer/LayoutManager.d.ts +1 -1
- package/dist/core/IModel.d.ts +4 -0
- package/dist/core/SysEvents.d.ts +8 -0
- package/dist/index.cjs +4 -4
- package/dist/index.css +16 -1
- package/dist/index.js +5 -5
- package/dist/utils/H5Tool.d.ts +150 -0
- package/package.json +13 -13
package/dist/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var y=require("vue"),Hi=require("axios"),qi=require("qs"),st=require("@hprose/rpc-core"),Le=require("@hprose/io"),Vi=require("@hprose/rpc-html5");function Po(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var Xi=Po(Hi),Gi=Po(qi),Ki={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((t,e)=>(t[e.id]=e)&&t,{})}},methods:{updatePaneComponents(){this.panes.forEach(t=>{t.update&&t.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[t.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(t,e){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=e},onMouseMove(t){this.touch.mouseDown&&(t.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(t)),this.$emit("resize",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(t,e){"ontouchstart"in window&&(t.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===e?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(t,e),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=e,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[e])},onSplitterDblClick(t,e){let n=0;this.panes=this.panes.map((o,r)=>(o.size=r===e?o.max:o.min,r!==e&&(n+=o.min),o)),this.panes[e].size-=n,this.$emit("pane-maximize",this.panes[e])},onPaneClick(t,e){this.$emit("pane-click",this.indexedPanes[e])},getCurrentMouseDrag(t){const e=this.container.getBoundingClientRect(),{clientX:n,clientY:o}="ontouchstart"in window&&t.touches?t.touches[0]:t;return{x:n-e.left,y:o-e.top}},getCurrentDragPercentage(t){t=t[this.horizontal?"y":"x"];const e=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(t=e-t),100*t/e},calculatePanesSize(t){const e=this.touch.activeSplitter;let n={prevPanesSize:this.sumPrevPanesSize(e),nextPanesSize:this.sumNextPanesSize(e),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(t),r),o);let s=[e,e+1],a=this.panes[s[0]]||null,l=this.panes[s[1]]||null;const d=a.max<100&&i>=a.max+n.prevPanesSize,b=l.max<100&&i<=100-(l.max+this.sumNextPanesSize(e+1));if(d||b)d?(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(e+1),0),l.size=l.max);else{if(this.pushOtherPanes){const S=this.doPushOtherPanes(n,i);if(!S)return;({sums:n,panesToResize:s}=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(t,e){const n=this.touch.activeSplitter,o=[n,n+1];return e<t.prevPanesSize+this.panes[o[0]].min&&(o[0]=this.findPrevExpandedPane(n).index,t.prevReachedMinPanes=0,o[0]<n&&this.panes.forEach((r,i)=>{i>o[0]&&i<=n&&(r.size=r.min,t.prevReachedMinPanes+=r.min)}),t.prevPanesSize=this.sumPrevPanesSize(o[0]),o[0]===void 0)?(t.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((r,i)=>{i>0&&i<=n&&(r.size=r.min,t.prevReachedMinPanes+=r.min)}),this.panes[o[1]].size=100-t.prevReachedMinPanes-this.panes[0].min-t.prevPanesSize-t.nextPanesSize,null):e>100-t.nextPanesSize-this.panes[o[1]].min&&(o[1]=this.findNextExpandedPane(n).index,t.nextReachedMinPanes=0,o[1]>n+1&&this.panes.forEach((r,i)=>{i>n&&i<o[1]&&(r.size=r.min,t.nextReachedMinPanes+=r.min)}),t.nextPanesSize=this.sumNextPanesSize(o[1]-1),o[1]===void 0)?(t.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,t.nextReachedMinPanes+=r.min)}),this.panes[o[0]].size=100-t.prevPanesSize-t.nextReachedMinPanes-this.panes[this.panesCount-1].min-t.nextPanesSize,null):{sums:t,panesToResize:o}},sumPrevPanesSize(t){return this.panes.reduce((e,n,o)=>e+(o<t?n.size:0),0)},sumNextPanesSize(t){return this.panes.reduce((e,n,o)=>e+(o>t+1?n.size:0),0)},findPrevExpandedPane(t){return[...this.panes].reverse().find(e=>e.index<t&&e.size>e.min)||{}},findNextExpandedPane(t){return this.panes.find(e=>e.index>t+1&&e.size>e.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(t=>{const e=t.classList.contains("splitpanes__pane"),n=t.classList.contains("splitpanes__splitter");if(!e&&!n)return t.parentNode.removeChild(t),void console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed.")})},addSplitter(t,e,n=!1){const o=t-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)),e.parentNode.insertBefore(r,e)},removeSplitter(t){t.onmousedown=void 0,t.onclick=void 0,t.ondblclick=void 0,t.parentNode.removeChild(t)},redoSplitters(){const t=Array.from(this.container.children);t.forEach(n=>{n.className.includes("splitpanes__splitter")&&this.removeSplitter(n)});let e=0;t.forEach(n=>{n.className.includes("splitpanes__pane")&&(!e&&this.firstSplitter?this.addSplitter(e,n,!0):e&&this.addSplitter(e,n),e++)})},requestUpdate({target:t,...e}){const n=this.indexedPanes[t._.uid];Object.entries(e).forEach(([o,r])=>n[o]=r)},onPaneAdd(t){let e=-1;Array.from(t.$el.parentNode.children).some(r=>(r.className.includes("splitpanes__pane")&&e++,r===t.$el));const n=parseFloat(t.minSize),o=parseFloat(t.maxSize);this.panes.splice(e,0,{id:t._.uid,index:e,min:isNaN(n)?0:n,max:isNaN(o)?100:o,size:t.size===null?null:parseFloat(t.size),givenSize:t.size,update:t.update}),this.panes.forEach((r,i)=>r.index=i),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[e]}),this.$emit("pane-add",{index:e,panes:this.panes.map(r=>({min:r.min,max:r.max,size:r.size}))})})},onPaneRemove(t){const e=this.panes.findIndex(o=>o.id===t._.uid),n=this.panes.splice(e,1)[0];this.panes.forEach((o,r)=>o.index=r),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...n,index:e}}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(o=>({min:o.min,max:o.max,size:o.size}))})})},resetPaneSizes(t={}){t.addedPane||t.removedPane?this.panes.some(e=>e.givenSize!==null||e.min||e.max<100)?this.equalizeAfterAddOrRemove(t):this.equalize():this.initialPanesSizing(),this.ready&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size})))},equalize(){const t=100/this.panesCount;let e=0;const n=[],o=[];this.panes.forEach(r=>{r.size=Math.max(Math.min(t,r.max),r.min),e-=r.size,r.size>=r.max&&n.push(r.id),r.size<=r.min&&o.push(r.id)}),e>.1&&this.readjustSizes(e,n,o)},initialPanesSizing(){let t=100;const e=[],n=[];let o=0;this.panes.forEach(i=>{t-=i.size,i.size!==null&&o++,i.size>=i.max&&e.push(i.id),i.size<=i.min&&n.push(i.id)});let r=100;t>.1&&(this.panes.forEach(i=>{i.size===null&&(i.size=Math.max(Math.min(t/(this.panesCount-o),i.max),i.min)),r-=i.size}),r>.1&&this.readjustSizes(t,e,n))},equalizeAfterAddOrRemove({addedPane:t}={}){let e=100/this.panesCount,n=0;const o=[],r=[];t&&t.givenSize!==null&&(e=(100-t.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=>{t&&t.givenSize!==null&&t.id===i.id||(i.size=Math.max(Math.min(e,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(t,e,n){let o;o=t>0?t/(this.panesCount-e.length):t/(this.panesCount-n.length),this.panes.forEach(r=>{if(t>0&&!e.includes(r.id)){const i=Math.max(Math.min(r.size+o,r.max),r.min),s=i-r.size;t-=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;t-=s,r.size=i}r.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[r.id].size}%`})}),Math.abs(t)>.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(t){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((e,n)=>{e.ondblclick=t?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 y.h("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(t){this.style=t}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(t){this.requestUpdate({target:this,size:t})},minSizeNumber(t){this.requestUpdate({target:this,min:t})},maxSizeNumber(t){this.requestUpdate({target:this,max:t})}}};function on(t){return window.TouchEvent&&t instanceof TouchEvent}nn.render=function(t,e,n,o,r,i){return y.openBlock(),y.createElementBlock("div",{class:"splitpanes__pane",onClick:e[0]||(e[0]=s=>i.onPaneClick(s,t._.uid)),style:y.normalizeStyle(t.style)},[y.renderSlot(t.$slots,"default")],4)},nn.__file="src/controls/splitpanes/pane.vue";class ae{e;constructor(e){this.e=e}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 co(this.clientX,this.clientY)}static bindDown(e,n,o,r=!1){const i=a=>{n(new ae(a))},s=a=>{a.touches.length===1&&n(new ae(a)),a.touches.length>1&&o&&o(new ae(a))};return e.addEventListener("mousedown",i,r),e.addEventListener("touchstart",s,r),()=>{e.removeEventListener("mousedown",i,r),e.removeEventListener("touchstart",s,r)}}static bindMove(e,n,o=!1){const r=s=>{n(new ae(s))},i=s=>{s.touches.length===1&&n(new ae(s))};return e.addEventListener("mousemove",r,o),e.addEventListener("touchmove",i,o),()=>{e.removeEventListener("mousemove",r,o),e.removeEventListener("touchmove",i,o)}}static bindUp(e,n,o=!1){const r=s=>{n(new ae(s))},i=s=>{s.touches.length===0&&n(new ae(s))};return e.addEventListener("mouseup",r,o),e.addEventListener("touchend",i,o),()=>{e.removeEventListener("mouseup",r,o),e.removeEventListener("touchend",i,o)}}originalEvent({mouse:e,touch:n}){on(this.e)?n&&n(this.e):e&&e(this.e)}}class co{x;y;constructor(e,n){this.x=e,this.y=n}clone(){return new co(this.x,this.y)}}class Ji{handle;container;options;unbindDown;unbindMove;unbindUp;constructor(e,n,o={}){this.handle=e,this.container=n,this.options=o,e&&(this.unbindDown=ae.bindDown(e,this.mousedown),e.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=e=>{if(e.preventDefault(),this.handle){const{left:n,top:o}=this.handle.getBoundingClientRect();this.offsetX=e.clientX-n,this.offsetY=e.clientY-o}this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=ae.bindMove(document,this.mousemove),this.unbindUp=ae.bindUp(document,this.mouseup)};mousemove=e=>{this.container&&(this.container.style.left=e.clientX-this.offsetX+"px",this.container.style.top=e.clientY-this.offsetY+"px"),this.options.onMove&&this.options.onMove()};mouseup=e=>{this.options.onMoveEnd&&this.options.onMoveEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0}}class Yi{_group;onChange;zIndex;constructor(e,n){this._group=e,this.onChange=n,this.a(o=>o.push(this))}set group(e){this._group=e;const n=ct(this._group),o=ct(e);n.splice(n.indexOf(this),1),o.push(this),Lo()}get group(){return this._group}unregister(){this.a(e=>e.splice(e.indexOf(this),1))}raise(){this.a(e=>{e.splice(e.indexOf(this),1),e.push(this)})}a(e){e(ct(this._group)),Lo()}}const at=new Map;function ct(t){return at.has(t)||at.set(t,[]),at.get(t)}function zo(t,e){return t>e?-zo(e,t):t<0&&e>=0?1:t-e}function Lo(){let t=0;for(const e of function(n){const o=[];return n.forEach((r,i)=>o.push(i)),o}(at).sort(zo))for(const n of ct(e))t!=n.zIndex&&(n.zIndex=t,n.onChange(t)),t++}function rn(t){if(t){const{width:e,height:n}=t.style;t.style.width="auto",t.style.height="auto";const o=lt(t);return t.style.width=e,t.style.height=n,o}return{width:0,height:0,top:0,left:0,bottom:0,right:0}}function lt(t){const e=t.getBoundingClientRect(),n=e.width,o=e.height,r=e.top,i=e.left;return{width:n,height:o,top:r,left:i,bottom:r+o,right:i+n}}class Zi{container;options;handles;constructor(e,n){if(this.container=e,this.options=n,e&&n){this.handles=Do.map(l=>new l(e,this));const{width:o,height:r}=rn(e),i=n.maxWidth||window.innerWidth,s=n.maxHeight||window.innerHeight;let a=!1;(o<n.minWidth||o>i)&&(e.style.width=`${$o(o,n.minWidth,i)}px`,a=!0),(r<n.minHeight||r>s)&&(e.style.height=`${$o(r,n.minHeight,s)}px`,a=!0),a&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(e=>e.teardown())}}const Do=[];class be{container;helper;handle;handleSize=8;unbindDown;unbindMove;unbindUp;constructor(e,n){this.container=e,this.helper=n,this.handle=this.createHandleElement(),this.unbindDown=ae.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=e=>{e.preventDefault(),e.stopPropagation();const{left:n,top:o,width:r,height:i}=lt(this.container);this.x0=e.clientX,this.y0=e.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=ae.bindMove(document,this.mousemove),this.unbindUp=ae.bindUp(document,this.mouseup)};minLeft;maxLeft;minRight;maxRight;minTop;maxTop;minBottom;maxBottom;calcSafeBoundaries(){if(!this.helper.options)return;const{left:e,top:n,right:o,bottom:r}=lt(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=e+i.minWidth,this.maxRight=Math.min(e+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=e=>{e.preventDefault(),e.stopPropagation(),this.setPosition(e),this.fixPosition(),this.helper.options&&this.helper.options.onResize&&this.helper.options.onResize()};fixPosition(){const{width:e,height:n,left:o,top:r,right:i,bottom:s}=lt(this.container),a=this.helper.options;a&&(o<this.minLeft?(this.container.style.width=e+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=e=>{e.preventDefault(),e.stopPropagation(),this.helper.options&&this.helper.options.onResizeEnd&&this.helper.options.onResizeEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0};createHandleElement(){const e=document.createElement("div"),n=e.style;return n.position="absolute",this.applyStyle(n),this.container.appendChild(e),e}}function $o(t,e,n){return t<e?e:t>n?n:t}Do.push(class extends be{setPosition(t){this.container.style.width=this.width0+t.clientX-this.x0+"px",this.container.style.height=this.height0+t.clientY-this.y0+"px"}applyStyle(t){t.width=2*this.handleSize+"px",t.height=2*this.handleSize+"px",t.right=-this.handleSize+"px",t.bottom=-this.handleSize+"px",t.cursor="nwse-resize"}},class extends be{setPosition(t){this.container.style.height=this.height0+t.clientY-this.y0+"px"}applyStyle(t){t.right=`${this.handleSize}px`,t.left=`${this.handleSize}px`,t.height=2*this.handleSize+"px",t.bottom=-this.handleSize+"px",t.cursor="ns-resize"}},class extends be{setPosition(t){this.container.style.left=this.left0+t.clientX-this.x0+"px",this.container.style.width=this.width0-(t.clientX-this.x0)+"px",this.container.style.height=this.height0+t.clientY-this.y0+"px"}applyStyle(t){t.left=-this.handleSize+"px",t.bottom=-this.handleSize+"px",t.width=2*this.handleSize+"px",t.height=2*this.handleSize+"px",t.cursor="nesw-resize"}},class extends be{setPosition(t){this.container.style.left=this.left0+t.clientX-this.x0+"px",this.container.style.width=this.width0-(t.clientX-this.x0)+"px"}applyStyle(t){t.left=-this.handleSize+"px",t.bottom=`${this.handleSize}px`,t.width=2*this.handleSize+"px",t.top=`${this.handleSize}px`,t.cursor="ew-resize"}},class extends be{setPosition(t){this.container.style.left=this.left0+t.clientX-this.x0+"px",this.container.style.width=this.width0-(t.clientX-this.x0)+"px",this.container.style.top=this.top0+t.clientY-this.y0+"px",this.container.style.height=this.height0-(t.clientY-this.y0)+"px"}applyStyle(t){t.left=-this.handleSize+"px",t.top=-this.handleSize+"px",t.width=2*this.handleSize+"px",t.height=2*this.handleSize+"px",t.cursor="nwse-resize"}},class extends be{setPosition(t){this.container.style.top=this.top0+t.clientY-this.y0+"px",this.container.style.height=this.height0-(t.clientY-this.y0)+"px"}applyStyle(t){t.left=`${this.handleSize}px`,t.right=`${this.handleSize}px`,t.height=2*this.handleSize+"px",t.top=-this.handleSize+"px",t.cursor="ns-resize"}},class extends be{setPosition(t){this.container.style.top=this.top0+t.clientY-this.y0+"px",this.container.style.height=this.height0-(t.clientY-this.y0)+"px",this.container.style.width=this.width0+t.clientX-this.x0+"px"}applyStyle(t){t.right=-this.handleSize+"px",t.top=-this.handleSize+"px",t.height=2*this.handleSize+"px",t.width=2*this.handleSize+"px",t.cursor="nesw-resize"}},class extends be{setPosition(t){this.container.style.width=this.width0+t.clientX-this.x0+"px"}applyStyle(t){t.right=-this.handleSize+"px",t.top=`${this.handleSize}px`,t.bottom=`${this.handleSize}px`,t.width=2*this.handleSize+"px",t.cursor="ew-resize"}});var ut=y.defineComponent({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(t){const e=y.ref(!1),n=y.ref(!1);return{hover:e,active:n,style:function(){let o=t.windowStyle.button;return e.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=ae.bindUp(document,()=>{n.value=!1,r()})}}}});const Qi=["disabled"];ut.render=function(t,e,n,o,r,i){return y.openBlock(),y.createElementBlock("div",{class:"btn",style:y.normalizeStyle(t.style()),onMouseenter:e[0]||(e[0]=s=>t.hover=!0),onMouseleave:e[1]||(e[1]=s=>t.hover=!1),onMousedown:e[2]||(e[2]=y.withModifiers((...s)=>t.mousedown&&t.mousedown(...s),["stop"])),onTouchstart:e[3]||(e[3]=y.withModifiers((...s)=>t.mousedown&&t.mousedown(...s),["stop"])),onMouseup:e[4]||(e[4]=(...s)=>t.mouseup&&t.mouseup(...s)),onTouchend:e[5]||(e[5]=(...s)=>t.mouseup&&t.mouseup(...s)),disabled:t.disabled},[y.renderSlot(t.$slots,"default")],44,Qi)},ut.__scopeId="data-v-71662210",ut.__file="src/controls/vuewindow/window/Button.vue";const es=Object.prototype.toString;function ie(t,e){return es.call(t)===`[object ${e}]`}function ht(t){return ie(t,"Function")}const Ao=t=>typeof t<"u",sn=t=>!Ao(t);function an(t){return t===null}const _e=t=>t!=null&&t!==null&&ie(t,"Object");function cn(t){return ie(t,"Number")}function dt(t){return ie(t,"String")}function ln(t){return t&&Array.isArray(t)}const ts=typeof window>"u";var Se=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ft(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ns={exports:{}},un=ft(ns.exports=function(t){var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(w,u){var p=w[0],v=w[1],h=w[2],f=w[3];v=((v+=((h=((h+=((f=((f+=((p=((p+=(v&h|~v&f)+u[0]-680876936|0)<<7|p>>>25)+v|0)&v|~p&h)+u[1]-389564586|0)<<12|f>>>20)+p|0)&p|~f&v)+u[2]+606105819|0)<<17|h>>>15)+f|0)&f|~h&p)+u[3]-1044525330|0)<<22|v>>>10)+h|0,v=((v+=((h=((h+=((f=((f+=((p=((p+=(v&h|~v&f)+u[4]-176418897|0)<<7|p>>>25)+v|0)&v|~p&h)+u[5]+1200080426|0)<<12|f>>>20)+p|0)&p|~f&v)+u[6]-1473231341|0)<<17|h>>>15)+f|0)&f|~h&p)+u[7]-45705983|0)<<22|v>>>10)+h|0,v=((v+=((h=((h+=((f=((f+=((p=((p+=(v&h|~v&f)+u[8]+1770035416|0)<<7|p>>>25)+v|0)&v|~p&h)+u[9]-1958414417|0)<<12|f>>>20)+p|0)&p|~f&v)+u[10]-42063|0)<<17|h>>>15)+f|0)&f|~h&p)+u[11]-1990404162|0)<<22|v>>>10)+h|0,v=((v+=((h=((h+=((f=((f+=((p=((p+=(v&h|~v&f)+u[12]+1804603682|0)<<7|p>>>25)+v|0)&v|~p&h)+u[13]-40341101|0)<<12|f>>>20)+p|0)&p|~f&v)+u[14]-1502002290|0)<<17|h>>>15)+f|0)&f|~h&p)+u[15]+1236535329|0)<<22|v>>>10)+h|0,v=((v+=((h=((h+=((f=((f+=((p=((p+=(v&f|h&~f)+u[1]-165796510|0)<<5|p>>>27)+v|0)&h|v&~h)+u[6]-1069501632|0)<<9|f>>>23)+p|0)&v|p&~v)+u[11]+643717713|0)<<14|h>>>18)+f|0)&p|f&~p)+u[0]-373897302|0)<<20|v>>>12)+h|0,v=((v+=((h=((h+=((f=((f+=((p=((p+=(v&f|h&~f)+u[5]-701558691|0)<<5|p>>>27)+v|0)&h|v&~h)+u[10]+38016083|0)<<9|f>>>23)+p|0)&v|p&~v)+u[15]-660478335|0)<<14|h>>>18)+f|0)&p|f&~p)+u[4]-405537848|0)<<20|v>>>12)+h|0,v=((v+=((h=((h+=((f=((f+=((p=((p+=(v&f|h&~f)+u[9]+568446438|0)<<5|p>>>27)+v|0)&h|v&~h)+u[14]-1019803690|0)<<9|f>>>23)+p|0)&v|p&~v)+u[3]-187363961|0)<<14|h>>>18)+f|0)&p|f&~p)+u[8]+1163531501|0)<<20|v>>>12)+h|0,v=((v+=((h=((h+=((f=((f+=((p=((p+=(v&f|h&~f)+u[13]-1444681467|0)<<5|p>>>27)+v|0)&h|v&~h)+u[2]-51403784|0)<<9|f>>>23)+p|0)&v|p&~v)+u[7]+1735328473|0)<<14|h>>>18)+f|0)&p|f&~p)+u[12]-1926607734|0)<<20|v>>>12)+h|0,v=((v+=((h=((h+=((f=((f+=((p=((p+=(v^h^f)+u[5]-378558|0)<<4|p>>>28)+v|0)^v^h)+u[8]-2022574463|0)<<11|f>>>21)+p|0)^p^v)+u[11]+1839030562|0)<<16|h>>>16)+f|0)^f^p)+u[14]-35309556|0)<<23|v>>>9)+h|0,v=((v+=((h=((h+=((f=((f+=((p=((p+=(v^h^f)+u[1]-1530992060|0)<<4|p>>>28)+v|0)^v^h)+u[4]+1272893353|0)<<11|f>>>21)+p|0)^p^v)+u[7]-155497632|0)<<16|h>>>16)+f|0)^f^p)+u[10]-1094730640|0)<<23|v>>>9)+h|0,v=((v+=((h=((h+=((f=((f+=((p=((p+=(v^h^f)+u[13]+681279174|0)<<4|p>>>28)+v|0)^v^h)+u[0]-358537222|0)<<11|f>>>21)+p|0)^p^v)+u[3]-722521979|0)<<16|h>>>16)+f|0)^f^p)+u[6]+76029189|0)<<23|v>>>9)+h|0,v=((v+=((h=((h+=((f=((f+=((p=((p+=(v^h^f)+u[9]-640364487|0)<<4|p>>>28)+v|0)^v^h)+u[12]-421815835|0)<<11|f>>>21)+p|0)^p^v)+u[15]+530742520|0)<<16|h>>>16)+f|0)^f^p)+u[2]-995338651|0)<<23|v>>>9)+h|0,v=((v+=((f=((f+=(v^((p=((p+=(h^(v|~f))+u[0]-198630844|0)<<6|p>>>26)+v|0)|~h))+u[7]+1126891415|0)<<10|f>>>22)+p|0)^((h=((h+=(p^(f|~v))+u[14]-1416354905|0)<<15|h>>>17)+f|0)|~p))+u[5]-57434055|0)<<21|v>>>11)+h|0,v=((v+=((f=((f+=(v^((p=((p+=(h^(v|~f))+u[12]+1700485571|0)<<6|p>>>26)+v|0)|~h))+u[3]-1894986606|0)<<10|f>>>22)+p|0)^((h=((h+=(p^(f|~v))+u[10]-1051523|0)<<15|h>>>17)+f|0)|~p))+u[1]-2054922799|0)<<21|v>>>11)+h|0,v=((v+=((f=((f+=(v^((p=((p+=(h^(v|~f))+u[8]+1873313359|0)<<6|p>>>26)+v|0)|~h))+u[15]-30611744|0)<<10|f>>>22)+p|0)^((h=((h+=(p^(f|~v))+u[6]-1560198380|0)<<15|h>>>17)+f|0)|~p))+u[13]+1309151649|0)<<21|v>>>11)+h|0,v=((v+=((f=((f+=(v^((p=((p+=(h^(v|~f))+u[4]-145523070|0)<<6|p>>>26)+v|0)|~h))+u[11]-1120210379|0)<<10|f>>>22)+p|0)^((h=((h+=(p^(f|~v))+u[2]+718787259|0)<<15|h>>>17)+f|0)|~p))+u[9]-343485551|0)<<21|v>>>11)+h|0,w[0]=p+w[0]|0,w[1]=v+w[1]|0,w[2]=h+w[2]|0,w[3]=f+w[3]|0}function o(w){var u,p=[];for(u=0;u<64;u+=4)p[u>>2]=w.charCodeAt(u)+(w.charCodeAt(u+1)<<8)+(w.charCodeAt(u+2)<<16)+(w.charCodeAt(u+3)<<24);return p}function r(w){var u,p=[];for(u=0;u<64;u+=4)p[u>>2]=w[u]+(w[u+1]<<8)+(w[u+2]<<16)+(w[u+3]<<24);return p}function i(w){var u,p,v,h,f,D,$=w.length,A=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=$;u+=64)n(A,o(w.substring(u-64,u)));for(p=(w=w.substring(u-64)).length,v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<p;u+=1)v[u>>2]|=w.charCodeAt(u)<<(u%4<<3);if(v[u>>2]|=128<<(u%4<<3),u>55)for(n(A,v),u=0;u<16;u+=1)v[u]=0;return h=(h=8*$).toString(16).match(/(.*?)(.{0,8})$/),f=parseInt(h[2],16),D=parseInt(h[1],16)||0,v[14]=f,v[15]=D,n(A,v),A}function s(w){var u,p,v,h,f,D,$=w.length,A=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=$;u+=64)n(A,r(w.subarray(u-64,u)));for(p=(w=u-64<$?w.subarray(u-64):new Uint8Array(0)).length,v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<p;u+=1)v[u>>2]|=w[u]<<(u%4<<3);if(v[u>>2]|=128<<(u%4<<3),u>55)for(n(A,v),u=0;u<16;u+=1)v[u]=0;return h=(h=8*$).toString(16).match(/(.*?)(.{0,8})$/),f=parseInt(h[2],16),D=parseInt(h[1],16)||0,v[14]=f,v[15]=D,n(A,v),A}function a(w){var u,p="";for(u=0;u<4;u+=1)p+=e[w>>8*u+4&15]+e[w>>8*u&15];return p}function l(w){var u;for(u=0;u<w.length;u+=1)w[u]=a(w[u]);return w.join("")}function d(w){return/[\u0080-\uFFFF]/.test(w)&&(w=unescape(encodeURIComponent(w))),w}function b(w,u){var p,v=w.length,h=new ArrayBuffer(v),f=new Uint8Array(h);for(p=0;p<v;p+=1)f[p]=w.charCodeAt(p);return u?f:h}function S(w){return String.fromCharCode.apply(null,new Uint8Array(w))}function x(w,u,p){var v=new Uint8Array(w.byteLength+u.byteLength);return v.set(new Uint8Array(w)),v.set(new Uint8Array(u),w.byteLength),p?v:v.buffer}function L(w){var u,p=[],v=w.length;for(u=0;u<v-1;u+=2)p.push(parseInt(w.substr(u,2),16));return String.fromCharCode.apply(String,p)}function T(){this.reset()}return l(i("hello")),typeof ArrayBuffer>"u"||ArrayBuffer.prototype.slice||function(){function w(u,p){return(u=0|u||0)<0?Math.max(u+p,0):Math.min(u,p)}ArrayBuffer.prototype.slice=function(u,p){var v,h,f,D,$=this.byteLength,A=w(u,$),B=$;return p!==t&&(B=w(p,$)),A>B?new ArrayBuffer(0):(v=B-A,h=new ArrayBuffer(v),f=new Uint8Array(h),D=new Uint8Array(this,A,v),f.set(D),h)}}(),T.prototype.append=function(w){return this.appendBinary(d(w)),this},T.prototype.appendBinary=function(w){this._buff+=w,this._length+=w.length;var u,p=this._buff.length;for(u=64;u<=p;u+=64)n(this._hash,o(this._buff.substring(u-64,u)));return this._buff=this._buff.substring(u-64),this},T.prototype.end=function(w){var u,p,v=this._buff,h=v.length,f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<h;u+=1)f[u>>2]|=v.charCodeAt(u)<<(u%4<<3);return this._finish(f,h),p=l(this._hash),w&&(p=L(p)),this.reset(),p},T.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},T.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},T.prototype.setState=function(w){return this._buff=w.buff,this._length=w.length,this._hash=w.hash,this},T.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},T.prototype._finish=function(w,u){var p,v,h,f=u;if(w[f>>2]|=128<<(f%4<<3),f>55)for(n(this._hash,w),f=0;f<16;f+=1)w[f]=0;p=(p=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),v=parseInt(p[2],16),h=parseInt(p[1],16)||0,w[14]=v,w[15]=h,n(this._hash,w)},T.hash=function(w,u){return T.hashBinary(d(w),u)},T.hashBinary=function(w,u){var p=l(i(w));return u?L(p):p},T.ArrayBuffer=function(){this.reset()},T.ArrayBuffer.prototype.append=function(w){var u,p=x(this._buff.buffer,w,!0),v=p.length;for(this._length+=w.byteLength,u=64;u<=v;u+=64)n(this._hash,r(p.subarray(u-64,u)));return this._buff=u-64<v?new Uint8Array(p.buffer.slice(u-64)):new Uint8Array(0),this},T.ArrayBuffer.prototype.end=function(w){var u,p,v=this._buff,h=v.length,f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<h;u+=1)f[u>>2]|=v[u]<<(u%4<<3);return this._finish(f,h),p=l(this._hash),w&&(p=L(p)),this.reset(),p},T.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},T.ArrayBuffer.prototype.getState=function(){var w=T.prototype.getState.call(this);return w.buff=S(w.buff),w},T.ArrayBuffer.prototype.setState=function(w){return w.buff=b(w.buff,!0),T.prototype.setState.call(this,w)},T.ArrayBuffer.prototype.destroy=T.prototype.destroy,T.ArrayBuffer.prototype._finish=T.prototype._finish,T.ArrayBuffer.hash=function(w,u){var p=l(s(new Uint8Array(w)));return u?L(p):p},T}());const hn=[];class se{static addHandler(e,n,o){e.addEventListener?e.addEventListener(n,o,!1):e.attachEvent?e.attachEvent("on"+n,o):e["on"+n]=o}static removeHandler(e,n,o){e.removeEventListener?e.removeEventListener(n,o,!1):e.detachEvent?e.detachEvent("on"+n,o):delete e["on"+n]}static windowResizeHandler(e){se.addHandler(window,"resize",e)}static offWindowResizeHandler(e){se.removeHandler(window,"resize",e)}static fullscreenEnabled(){const e=window.document;return document.fullscreenEnabled||window.fullScreen||e.mozFullscreenEnabled||e.webkitIsFullScreen}static fullScreen(e,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=e;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(e=window.document.documentElement){let n=e;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 e=window.document;var n=document.exitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen||e.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!!se.fullScreenElement()}static onFullScreenChanged(e){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=se.isFullScreen();e(o)}):document.addEventListener("MSFullscreenChange",function(){const o=se.isFullScreen();e(o)})}static stringifyCircularHandler(e,n){if(typeof n=="object"&&n!==null){if(hn.indexOf(n)!==-1)return;hn.push(n)}return n}static jsonStringify(e){if(!e)return"";const n=JSON.stringify(e,se.stringifyCircularHandler);return hn.length=0,n}static jsonParse(e){const n=se.jsonStringify(e);if(n.length>1)return JSON.parse(n)}static getObjectURL(e){let n;const o=window;return o.createObjcectURL!=null?n=o.createOjcectURL(e):window.URL!=null?n=window.URL.createObjectURL(e):window.webkitURL!=null&&(n=window.webkitURL.createObjectURL(e)),n}static getFileShortMD5(e,n){const o=File.prototype,r=o.slice||o.mozSlice||o.webkitSlice,i=e,s=2097152,a=new un.ArrayBuffer,l=new FileReader;l.onload=function(d){a.append(d.target?.result);const b=a.end();n({isOK:!0,data:b})},l.onerror=function(){const d="\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01";console.warn(d),n({isOK:!1,data:d})},function(){const d=0+s>=i.size?i.size:0+s;l.readAsArrayBuffer(r.call(i,0,d))}()}static getFileMD5(e,n){const o=File.prototype,r=o.slice||o.mozSlice||o.webkitSlice,i=e,s=2097152,a=Math.ceil(i.size/s);let l=0;const d=new un.ArrayBuffer,b=new FileReader;function S(){const x=l*s,L=x+s>=i.size?i.size:x+s;b.readAsArrayBuffer(r.call(i,x,L))}b.onload=function(x){if(d.append(x.target?.result),l++,l<a)S();else{const L=d.end();n({isOK:!0,data:L})}},b.onerror=function(){const x=`${i.name}:\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01`;console.warn(x),n({isOK:!1,data:x})},S()}static MD5(e,n=!1){return un.hash(e,n)}static copyTextByCommand(e){return new Promise((n,o)=>{const r=document.createElement("input");r.value=e,document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove(),n(!0)})}static copyText=e=>navigator.clipboard?navigator.clipboard.writeText(e).then(function(){return!0},function(n){return!1}):se.copyTextByCommand(e);static copyElementTextByCommand(e){const n=document.createRange();n.selectNode(document.getElementById(e));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(e){if(!navigator.clipboard)return se.copyElementTextByCommand(e);const n=document.createRange();n.selectNode(document.getElementById(e));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(e){se.toggleClass(e,"grayMode",document.documentElement)}static toggleClass(e,n,o){const r=o||document.body;let{className:i}=r;i=i.replace(n,""),r.className=e?`${i} ${n} `:i}static setCssVar(e,n,o=document.documentElement){o.style.setProperty(e,n)}static dispatchWindowResize(){const e=new Event("resize");window.dispatchEvent(e)}static dispatchElementEvent(e,n="click",o){let r;if(r=dt(e)?document.getElementById(e):e,r){const i=new Event(n,{bubbles:!0,cancelable:!0});o&&r.addEventListener("ev",s=>{o(s)},!1),r.dispatchEvent(i)}}}class pt{static isNullOrEmpty=e=>e===null||e===""||e===void 0||e.length===0;static isNotEmpty=e=>!(e===null||e===""||e===void 0||e.length===0);static toHump(e){return e.replace(/[\-\/\_](\w)/g,(n,o)=>o.toUpperCase()).replace("views","")}}class gt{prefixKey;storage;constructor(e="",n=localStorage){this.prefixKey=e,this.storage=n}getKey(e){return`${this.prefixKey}${e}`.toUpperCase()}set(e,n,o=604800){const r=JSON.stringify({value:n,expire:o!==null?new Date().getTime()+1e3*o:null});this.storage.setItem(this.getKey(e),r)}get(e,n=null){const o=this.storage.getItem(this.getKey(e));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(e))}catch{return n}return n}getJsonObject(e){const n=this.storage.getItem(this.getKey(e));if(n)try{const o=JSON.parse(n);if(o.expire===null||o.expire>=Date.now())return o;this.remove(this.getKey(e))}catch{return}}remove(e){this.storage.removeItem(this.getKey(e))}clear(){this.storage.clear()}setCookie(e,n,o=604800){document.cookie=`${this.getKey(e)}=${n}; Max-Age=${o}`}getCookie(e){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(e))return i[1]}return""}removeCookie(e){this.setCookie(e,1,-1)}clearCookie(){const e=document.cookie.match(/[^ =;]+(?==)/g);if(e)for(let n=e.length;n--;)document.cookie=e[n]+"=0;expire="+new Date(0).toUTCString()}}const os=new gt("",localStorage);function Bo(){let t=[];const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(var n=0;n<36;n++){const r=Math.floor(16*Math.random());t[n]=e.substring(r,r+1)}t[14]="4";const o=3&Number(t[19])|8;return t[19]=e.substring(o,o+1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}function dn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function mt(t){return/^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/.test(t)}function fn(t){let e=t.toLowerCase();if(mt(t)){if(e.length===4){let o="#";for(let r=1;r<4;r+=1)o+=e.slice(r,r+1).concat(e.slice(r,r+1));e=o}const n=[];for(let o=1;o<7;o+=2)n.push(parseInt("0x"+e.slice(o,o+2)));return"RGB("+n.join(",")+")"}return e}function pn(t,e){const n=parseInt(t,16)+e,o=n>255?255:n;return o.toString(16).length>1?o.toString(16):`0${o.toString(16)}`}function No(t,e,n){const o=[t,e,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 gn(t,e){const n=parseInt(t,16)-e,o=n<0?0:n;return o.toString(16).length>1?o.toString(16):`0${o.toString(16)}`}function mn(t){return{all:t=t||new Map,on(e,n){const o=t?.get(e);o&&o.push(n)||t?.set(e,[n])},off(e,n){const o=t?.get(e);o&&o.splice(o.indexOf(n)>>>0,1)},emit(e,n){(t?.get(e)||[]).slice().map(o=>{o(n)}),(t?.get("*")||[]).slice().map(o=>{o(e,n)})}}}exports.EnumColor=void 0,function(t){t[t.RGBA=0]="RGBA",t[t.Hex=1]="Hex",t[t.Hsla=2]="Hsla"}(exports.EnumColor||(exports.EnumColor={}));const Ce=mn(),ce={HproseServiceErrorEvent:"HproseServiceError",WebAPIErrorEvent:"WebAPIError",AlertInfoEvent:"AlertInfoEvent",CommonWarnEvent:"CommonWarnEvent",WidgetLoadedEvent:"WidgetLoaded",WidgetUnLoadedEvent:"WidgetUnLoaded",WidgetLoadedErrorEvent:"WidgetLoadedError",WidgetVisibleChanged:"WidgetVisibleChanged",AxiosRequestErrorEvent:"AxiosRequestErrorEvent"},vt=(t,e)=>{const n=document.createElement("a");n.download=e,n.style.display="none";const o=new Blob([t],{type:"application/octet-stream"});n.href=URL.createObjectURL(o),document.body.appendChild(n),n.click(),document.body.removeChild(n)},jo=(t,e)=>{const n=JSON.stringify(t,null,2);e?vt(n,e+".json"):Ce.emit(ce.CommonWarnEvent,"\u53C2\u6570JsonID\u4E0D\u80FD\u4E3A\u7A7A\uFF01")};function Oo(t){const e=t.lastIndexOf("/")+1;let n=t.substring(e);return n=decodeURI(n.split("?")[0]),n}function Wo(t){return new Promise(e=>setTimeout(e,t))}var Uo,Fo,vn,Ho={exports:{}};Fo=Se,vn=function(){var t=function(){},e="undefined",n=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),o=["trace","debug","info","warn","error"],r={},i=null;function s(T,w){var u=T[w];if(typeof u.bind=="function")return u.bind(T);try{return Function.prototype.bind.call(u,T)}catch{return function(){return Function.prototype.apply.apply(u,[T,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(T){return T==="debug"&&(T="log"),typeof console!==e&&(T==="trace"&&n?a:console[T]!==void 0?s(console,T):console.log!==void 0?s(console,"log"):t)}function d(){for(var T=this.getLevel(),w=0;w<o.length;w++){var u=o[w];this[u]=w<T?t:this.methodFactory(u,T,this.name)}if(this.log=this.debug,typeof console===e&&T<this.levels.SILENT)return"No console available for logging"}function b(T){return function(){typeof console!==e&&(d.call(this),this[T].apply(this,arguments))}}function S(T,w,u){return l(T)||b.apply(this,arguments)}function x(T,w){var u,p,v,h=this,f="loglevel";function D(){var B;if(typeof window!==e&&f){try{B=window.localStorage[f]}catch{}if(typeof B===e)try{var O=window.document.cookie,F=encodeURIComponent(f),R=O.indexOf(F+"=");R!==-1&&(B=/^([^;]+)/.exec(O.slice(R+F.length+1))[1])}catch{}return h.levels[B]===void 0&&(B=void 0),B}}function $(B){var O=B;if(typeof O=="string"&&h.levels[O.toUpperCase()]!==void 0&&(O=h.levels[O.toUpperCase()]),typeof O=="number"&&O>=0&&O<=h.levels.SILENT)return O;throw new TypeError("log.setLevel() called with invalid level: "+B)}typeof T=="string"?f+=":"+T:typeof T=="symbol"&&(f=void 0),h.name=T,h.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},h.methodFactory=w||S,h.getLevel=function(){return v??p??u},h.setLevel=function(B,O){return v=$(B),O!==!1&&function(F){var R=(o[F]||"silent").toUpperCase();if(typeof window!==e&&f){try{return void(window.localStorage[f]=R)}catch{}try{window.document.cookie=encodeURIComponent(f)+"="+R+";"}catch{}}}(v),d.call(h)},h.setDefaultLevel=function(B){p=$(B),D()||h.setLevel(B,!1)},h.resetLevel=function(){v=null,function(){if(typeof window!==e&&f){try{window.localStorage.removeItem(f)}catch{}try{window.document.cookie=encodeURIComponent(f)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}(),d.call(h)},h.enableAll=function(B){h.setLevel(h.levels.TRACE,B)},h.disableAll=function(B){h.setLevel(h.levels.SILENT,B)},h.rebuild=function(){if(i!==h&&(u=$(i.getLevel())),d.call(h),i===h)for(var B in r)r[B].rebuild()},u=$(i?i.getLevel():"WARN");var A=D();A!=null&&(v=$(A)),d.call(h)}(i=new x).getLogger=function(T){if(typeof T!="symbol"&&typeof T!="string"||T==="")throw new TypeError("You must supply a name when creating a logger.");var w=r[T];return w||(w=r[T]=new x(T,i.methodFactory)),w};var L=typeof window!==e?window.log:void 0;return i.noConflict=function(){return typeof window!==e&&window.log===i&&(window.log=L),i},i.getLoggers=function(){return r},i.default=i,i},(Uo=Ho).exports?Uo.exports=vn():Fo.log=vn();var yn=Ho.exports;class qo{message;eventBus;constructor(e,n){e&&(this.message=e),n&&(this.eventBus=n)}msg(e,n=3,o="success"){if(this.message)if(typeof this.message=="function")this.message({type:o,message:e,duration:n});else switch(o){case"info":this.message.info(e,n);break;case"success":this.message.success(e,n);break;case"warning":this.message.warn?this.message.warn(e,n):this.message.warning&&this.message.warning(e,n);break;case"error":this.message.error(e,n)}else{switch(o){case"info":case"success":console.log(e);break;case"warning":console.warn(e);break;case"error":o="dark",console.error(e)}this.eventBus&&this.eventBus.emit(ce.AlertInfoEvent,{type:o,info:e})}}info(e,n=3){this.msg(e,n,"info")}warn(e,n=3){this.msg(e,n,"warning")}err(e,n=3){this.msg(e,n,"error")}success(e,n=3){this.msg(e,n,"success")}}let Vo=!1;const j={Config:SysConfig,EventBus:Ce,DefaultProxyClient:null,Axios:Xi.default,Message:new qo(void 0,Ce),LayoutMap:new Map,getLayoutManager:t=>{if(!j.WidgetConfigList||j.WidgetConfigList.length===0)return;const e=j.WidgetConfigList.find(n=>n.id===t);if(e){const n=e.layoutID;if(n&&j.LayoutMap.has(n))return j.LayoutMap.get(n)}},Logger:t=>{Vo||(SysConfig.UI.ProductLog?yn.enableAll():yn.setDefaultLevel("warn"),Vo=!0);const e=t||"default";return yn.getLogger(e)}},Xo="access_token",me=new gt("user",localStorage);function Ee(){return me.get(Xo)}function wn(){me.remove(Xo)}function Go(){return Ee()?.refresh}function bn(t,e,n,o="json",r){const i={baseURL:j.Config.ServiceURL.DefaultWebAPI,timeout:6e4,params:t,paramsSerializer:{serialize:function(s){return Gi.default.stringify(s,{indices:!1,arrayFormat:"repeat"})}},headers:{"Content-Type":"application/json",Authorization:"bearer "+Ee()?.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)),e&&(i.baseURL=e),i}function ve(t,e,n,o,r="json",i,s){const a=bn(n,e,o,r,i);return s&&s>=2e4&&(a.timeout=s),j.Axios?.get(t,a).catch(function(l){yt(l,e,t,"Get")})}function yt(t,e,n,o="Get"){const r=`${e}${n}`;if(t&&t.response){let i=!1;const s=t.response.status;switch(s){case 400:t.message="\u9519\u8BEF\u8BF7\u6C42";break;case 401:t.message="\u672A\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55";break;case 403:t.message="\u62D2\u7EDD\u8BBF\u95EE";break;case 404:t.message="\u8BF7\u6C42\u9519\u8BEF,\u672A\u627E\u5230\u8BE5\u8D44\u6E90";break;case 405:t.message="\u8BF7\u6C42\u65B9\u6CD5\u672A\u5141\u8BB8";break;case 408:t.message="\u8BF7\u6C42\u8D85\u65F6";break;case 500:const l=t.response.data;if(l){const d=l.indexOf(":"),b=l.indexOf(`
|
|
2
|
-
`);if(d>0&&b-d>2){const S=l.substring(d+2,b);S.indexOf("System.Exception")>0?t.message="\u540E\u53F0\u670D\u52A1\u5185\u90E8\u51FA\u9519\uFF01":(i=!0,t.message=S)}else i=!0,t.message=l}else t.message="\u670D\u52A1\u5668\u7AEF\u51FA\u9519";break;case 501:t.message="\u7F51\u7EDC\u672A\u5B9E\u73B0";break;case 502:t.message="\u7F51\u7EDC\u9519\u8BEF";break;case 503:t.message="\u670D\u52A1\u4E0D\u53EF\u7528";break;case 504:t.message="\u7F51\u7EDC\u8D85\u65F6";break;case 505:t.message="http\u7248\u672C\u4E0D\u652F\u6301\u8BE5\u8BF7\u6C42";break;default:t.message=`\u8FDE\u63A5\u9519\u8BEF${t.response.status}`}let a={address:r,code:s,isExceptionInfo:i,message:t.message,result:t.response.data};if(j.EventBus.emit(
|
|
3
|
-
`),r=0;r<o.length;r++){var i=o[r],s=i.indexOf(":"),a=Sn(i.slice(0,s)).toLowerCase(),l=Sn(i.slice(s+1));n[a]===void 0?n[a]=l:(e=n[a],Object.prototype.toString.call(e)==="[object Array]"?n[a].push(l):n[a]=[n[a],l])}return n},hs=as;function Qo(t,e,n){var o=t;return ls(e)?(n=e,typeof t=="string"&&(o={uri:t})):o=hs(e,{uri:t}),o.callback=n,o}function ye(t,e,n){return er(e=Qo(t,e,n))}function er(t){if(t.callback===void 0)throw new Error("callback argument missing");var e=!1,n=function(p,v,h){e||(e=!0,t.callback(p,v,h))};function o(){var p=void 0;if(p=l.response?l.response:l.responseText||function(v){try{if(v.responseType==="document")return v.responseXML;var h=v.responseXML&&v.responseXML.documentElement.nodeName==="parsererror";if(v.responseType===""&&!h)return v.responseXML}catch{}return null}(l),w)try{p=JSON.parse(p)}catch{}return p}function r(p){return clearTimeout(d),p instanceof Error||(p=new Error(""+(p||"Unknown XMLHttpRequest Error"))),p.statusCode=0,n(p,u)}function i(){if(!a){var p;clearTimeout(d),p=t.useXDR&&l.status===void 0?200:l.status===1223?204:l.status;var v=u,h=null;return p!==0?(v={body:o(),statusCode:p,method:S,headers:{},url:b,rawRequest:l},l.getAllResponseHeaders&&(v.headers=us(l.getAllResponseHeaders()))):h=new Error("Internal XMLHttpRequest Error"),n(h,v,v.body)}}var s,a,l=t.xhr||null;l||(l=t.cors||t.useXDR?new ye.XDomainRequest:new ye.XMLHttpRequest);var d,b=l.url=t.uri||t.url,S=l.method=t.method||"GET",x=t.body||t.data,L=l.headers=t.headers||{},T=!!t.sync,w=!1,u={body:void 0,headers:{},statusCode:0,method:S,url:b,rawRequest:l};if("json"in t&&t.json!==!1&&(w=!0,L.accept||L.Accept||(L.Accept="application/json"),S!=="GET"&&S!=="HEAD"&&(L["content-type"]||L["Content-Type"]||(L["Content-Type"]="application/json"),x=JSON.stringify(t.json===!0?x:t.json))),l.onreadystatechange=function(){l.readyState===4&&setTimeout(i,0)},l.onload=i,l.onerror=r,l.onprogress=function(){},l.onabort=function(){a=!0},l.ontimeout=r,l.open(S,b,!T,t.username,t.password),T||(l.withCredentials=!!t.withCredentials),!T&&t.timeout>0&&(d=setTimeout(function(){if(!a){a=!0,l.abort("timeout");var p=new Error("XMLHttpRequest timeout");p.code="ETIMEDOUT",r(p)}},t.timeout)),l.setRequestHeader)for(s in L)L.hasOwnProperty(s)&&l.setRequestHeader(s,L[s]);else if(t.headers&&!function(p){for(var v in p)if(p.hasOwnProperty(v))return!1;return!0}(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(l.responseType=t.responseType),"beforeSend"in t&&typeof t.beforeSend=="function"&&t.beforeSend(l),l.send(x||null),l}_n.exports=ye,_n.exports.default=ye,ye.XMLHttpRequest=Zo.XMLHttpRequest||function(){},ye.XDomainRequest="withCredentials"in new ye.XMLHttpRequest?ye.XMLHttpRequest:Zo.XDomainRequest,function(t,e){for(var n=0;n<t.length;n++)e(t[n])}(["get","put","post","patch","head","delete"],function(t){ye[t==="delete"?"del":t]=function(e,n,o){return(n=Qo(e,n,o)).method=t.toUpperCase(),er(n)}});var ds=ft(_n.exports);const fs=[200,201,202,204,308],ps=[408,502,503,504];class tr{endpoint;file;headers;method;chunkSize;attempts;delayBeforeAttempt;md5;chunk;chunkCount;chunkByteSize;maxFileBytes;endpointValue;totalChunks;attemptCount;offline;paused;success;currentXhr;reader;eventTarget;fileName;constructor(e){this.endpoint=e.endpoint,this.file=e.file,this.fileName=encodeURI(this.file.name),this.headers=e.headers||{},this.method=e.method||"PUT",this.chunkSize=e.chunkSize||5120,this.attempts=e.attempts||5,this.delayBeforeAttempt=e.delayBeforeAttempt||1,this.md5=e.md5||"",this.maxFileBytes=1024*(e.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(e,n){this.eventTarget.on(e,n)}abort(){this.pause(),this.currentXhr?.abort()}pause(){this.paused=!0}resume(){this.paused&&(this.paused=!1,this.sendChunks())}dispatch(e,n){this.eventTarget.emit(e,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(e=>(this.endpointValue=e,this.endpointValue))}getChunk(){return new Promise(e=>{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"})),e(()=>{})},this.reader.readAsArrayBuffer(this.file.slice(o,o+n))})}xhrPromise(e){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=ds({...e,beforeSend:n},(i,s)=>(this.currentXhr=void 0,i?r(i):o(s)))})}sendChunk(){if(!this.chunk)return;const e=this.chunkCount*this.chunkByteSize,n=e+this.chunk.size-1,o={...this.headers,FileName:this.fileName,FileMD5:this.md5,"Content-Type":this.file.type,"Content-Range":`bytes ${e}-${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(e=>{if(this.attemptCount=this.attemptCount+1,e!=null&&fs.includes(e.statusCode)){this.dispatch("chunkSuccess",{chunk:this.chunkCount,attempts:this.attemptCount,response:e}),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(e!=null&&ps.includes(e.statusCode)){if(this.paused||this.offline)return;this.manageRetries()}else{if(this.paused||this.offline)return;console.log(`\u670D\u52A1\u5668\u9519\u8BEF:${e?.statusCode}\uFF0C\u505C\u6B62\u4E0A\u4F20\u3002`),this.dispatch("error",{message:`\u670D\u52A1\u5668\u9519\u8BEF:${e?.statusCode}\uFF0C\u505C\u6B62\u4E0A\u4F20\u3002`,chunkNumber:this.chunkCount,attempts:this.attemptCount})}}).catch(e=>{this.paused||this.offline||this.manageRetries()})}}const gs=new class{hasClass(t,e){return t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}addClass(t,e){this.hasClass(t,e)||(t.className+=" "+e)}removeClass(t,e){if(this.hasClass(t,e)){const n=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(n," ")}}toggleClass(t,e){this.hasClass(t,e)?this.removeClass(t,e):this.addClass(t,e)}setCSSProperty(t,e,n){t?.style.setProperty(e,n)}};class Qe{hproseURL;client;hproseProxy;static httpTransport;constructor(e){if(e&&!pt.isNullOrEmpty(e)){if(Qe.httpTransport||(Qe.httpTransport=new Vi.HttpTransport),this.client=new st.Client(e),!this.client)throw Error("Hprose Client\u521D\u59CB\u5316\u9519\u8BEF");this.hproseURL=e,this.init()}}init(){this.client&&this.client.useServiceAsync().then(e=>{this.hproseProxy=e}).catch(e=>{String(e).indexOf("find this method ~")>0?(this.hproseProxy=this.client?.useService(),console.warn("\u65E7\u7248\u672C\u4E0D\u652F\u6301useServiceAsync")):Ce.emit(ce.HproseServiceErrorEvent,"\u521D\u59CB\u5316\u9ED8\u8BA4Hprose!"),console.warn(e)})}async getProxy(){if(!this.hproseProxy)try{this.client&&(this.hproseProxy=await this.client.useServiceAsync())}catch(e){console.warn(e),this.hproseProxy=this.client?.useService()}return this.hproseProxy}async invoke(e,n,o){if(this.client)return await this.client.invoke(e,n,o)}encode(e,n,o){if(this.client)return this.client.codec.encode(e,n,o)}decode(e,n){if(this.client)return this.client.codec.decode(e,n)}}class Ue{hproseClient;hpProxyObj;defaultContext=new st.ClientContext;constructor(e){this.hproseClient=new Qe(e),this.hpProxyObj=null}getClientContext(e,n){const o={};n&&(o.requestHeaders=n);const r=Ee();o.httpRequestHeaders=e||{};const i=o.httpRequestHeaders;return r&&(i.token=r.token),j.SystemID&&(i.sysid=j.SystemID,j.SystemGroup&&(i.sysgroup=j.SystemGroup)),new st.ClientContext(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 e=await this.hproseClient.getProxy();this.hpProxyObj=e}return this.hpProxyObj||Ce.emit(ce.HproseServiceErrorEvent,"HproseProxy\u5BF9\u8C61\u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5\uFF01"),this.hpProxyObj}async hproseInvoke(e,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(e,n,o)}async hproseInvokeContext(e,n,...o){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");const r=Ee();return console.log(r,"userToken3"),r&&(n||(n=new st.ClientContext({httpRequestHeaders:{token:r.token}}))),await this.hproseClient.invoke(e,o,n)}async hproseInvokeEncode(e){const n=new Le.ByteStream(e).toBytes(),o=await this.hproseClient.client?.request(n,this.defaultContext);return o&&this.hproseClient.client?.codec.decode(o,this.defaultContext)}encodeRequest(e,...n){const o=this.hproseClient.client?.codec?.encode(e,n,this.defaultContext);return Le.ByteStream.toString(o)}}const Cn=new Map;function nr(t){if(t&&pt.isNotEmpty(t)){if(Cn.has(t))return Cn.get(t);{const e=new Ue(t);return Cn.set(t,e),e}}}const En="is_LockScreen",or=me.get(En,!1),Fe={isLock:or,lockTime:or=="true"?ir():0};function rr(t){Fe.isLock=t,me.set(En,t,10),t&&(wn(),console.log("\u9501\u5C4F\u4E86\u2026\u2026"))}function ir(){let t=3600;return j.Config.UI?.LockTime&&j.Config.UI?.LockTime>=10&&(t=j.Config.UI.LockTime),t}let kn;function xn(){clearInterval(kn),!(window.location.href.indexOf("/login")>0||Fe.isLock)&&(rr(!1),Fe.lockTime=ir(),kn=setInterval(()=>{if(Fe.lockTime--,Fe.lockTime<=0)return rr(!0),clearInterval(kn)},1e3))}function In(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ms={exports:{}},wt=ft(ms.exports=function t(e,n,o){function r(a,l){if(!n[a]){if(!e[a]){if(!l&&In)return In(a);if(i)return i(a,!0);var d=new Error("Cannot find module '"+a+"'");throw d.code="MODULE_NOT_FOUND",d}var b=n[a]={exports:{}};e[a][0].call(b.exports,function(S){var x=e[a][1][S];return r(x||S)},b,b.exports,t,e,n,o)}return n[a].exports}for(var i=In,s=0;s<o.length;s++)r(o[s]);return r}({1:[function(t,e,n){(function(o){var r,i,s=o.MutationObserver||o.WebKitMutationObserver;if(s){var a=0,l=new s(x),d=o.document.createTextNode("");l.observe(d,{characterData:!0}),r=function(){d.data=a=++a%2}}else if(o.setImmediate||o.MessageChannel===void 0)r="document"in o&&"onreadystatechange"in o.document.createElement("script")?function(){var T=o.document.createElement("script");T.onreadystatechange=function(){x(),T.onreadystatechange=null,T.parentNode.removeChild(T),T=null},o.document.documentElement.appendChild(T)}:function(){setTimeout(x,0)};else{var b=new o.MessageChannel;b.port1.onmessage=x,r=function(){b.port2.postMessage(0)}}var S=[];function x(){var T,w;i=!0;for(var u=S.length;u;){for(w=S,S=[],T=-1;++T<u;)w[T]();u=S.length}i=!1}function L(T){S.push(T)!==1||i||r()}e.exports=L}).call(this,Se!==void 0?Se:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(t,e,n){var o=t(1);function r(){}var i={},s=["REJECTED"],a=["FULFILLED"],l=["PENDING"];function d(h){if(typeof h!="function")throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,h!==r&&L(this,h)}function b(h,f,D){this.promise=h,typeof f=="function"&&(this.onFulfilled=f,this.callFulfilled=this.otherCallFulfilled),typeof D=="function"&&(this.onRejected=D,this.callRejected=this.otherCallRejected)}function S(h,f,D){o(function(){var $;try{$=f(D)}catch(A){return i.reject(h,A)}$===h?i.reject(h,new TypeError("Cannot resolve promise with itself")):i.resolve(h,$)})}function x(h){var f=h&&h.then;if(h&&(typeof h=="object"||typeof h=="function")&&typeof f=="function")return function(){f.apply(h,arguments)}}function L(h,f){var D=!1;function $(F){D||(D=!0,i.reject(h,F))}function A(F){D||(D=!0,i.resolve(h,F))}function B(){f(A,$)}var O=T(B);O.status==="error"&&$(O.value)}function T(h,f){var D={};try{D.value=h(f),D.status="success"}catch($){D.status="error",D.value=$}return D}function w(h){return h instanceof this?h:i.resolve(new this(r),h)}function u(h){var f=new this(r);return i.reject(f,h)}function p(h){var f=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var D=h.length,$=!1;if(!D)return this.resolve([]);for(var A=new Array(D),B=0,O=-1,F=new this(r);++O<D;)R(h[O],O);return F;function R(W,V){function ne(J){A[V]=J,++B!==D||$||($=!0,i.resolve(F,A))}f.resolve(W).then(ne,function(J){$||($=!0,i.reject(F,J))})}}function v(h){var f=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var D=h.length,$=!1;if(!D)return this.resolve([]);for(var A=-1,B=new this(r);++A<D;)O(h[A]);return B;function O(F){f.resolve(F).then(function(R){$||($=!0,i.resolve(B,R))},function(R){$||($=!0,i.reject(B,R))})}}e.exports=d,d.prototype.catch=function(h){return this.then(null,h)},d.prototype.then=function(h,f){if(typeof h!="function"&&this.state===a||typeof f!="function"&&this.state===s)return this;var D=new this.constructor(r);return this.state!==l?S(D,this.state===a?h:f,this.outcome):this.queue.push(new b(D,h,f)),D},b.prototype.callFulfilled=function(h){i.resolve(this.promise,h)},b.prototype.otherCallFulfilled=function(h){S(this.promise,this.onFulfilled,h)},b.prototype.callRejected=function(h){i.reject(this.promise,h)},b.prototype.otherCallRejected=function(h){S(this.promise,this.onRejected,h)},i.resolve=function(h,f){var D=T(x,f);if(D.status==="error")return i.reject(h,D.value);var $=D.value;if($)L(h,$);else{h.state=a,h.outcome=f;for(var A=-1,B=h.queue.length;++A<B;)h.queue[A].callFulfilled(f)}return h},i.reject=function(h,f){h.state=s,h.outcome=f;for(var D=-1,$=h.queue.length;++D<$;)h.queue[D].callRejected(f);return h},d.resolve=w,d.reject=u,d.all=p,d.race=v},{1:1}],3:[function(t,e,n){(function(o){typeof o.Promise!="function"&&(o.Promise=t(2))}).call(this,Se!==void 0?Se:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(t,e,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(_){if(_.name!=="TypeError")throw _;for(var m=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),C=0;C<c.length;C+=1)m.append(c[C]);return m.getBlob(g.type)}}typeof Promise>"u"&&t(3);var d=Promise;function b(c,g){g&&c.then(function(m){g(null,m)},function(m){g(m)})}function S(c,g,m){typeof g=="function"&&c.then(g),typeof m=="function"&&c.catch(m)}function x(c){return typeof c!="string"&&(console.warn(c+" used as a key, but it is not a string."),c=String(c)),c}function L(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var T="local-forage-detect-blob-support",w=void 0,u={},p=Object.prototype.toString,v="readonly",h="readwrite";function f(c){for(var g=c.length,m=new ArrayBuffer(g),C=new Uint8Array(m),_=0;_<g;_++)C[_]=c.charCodeAt(_);return m}function D(c){return new d(function(g){var m=c.transaction(T,h),C=l([""]);m.objectStore(T).put(C,"key"),m.onabort=function(_){_.preventDefault(),_.stopPropagation(),g(!1)},m.oncomplete=function(){var _=navigator.userAgent.match(/Chrome\/(\d+)/),E=navigator.userAgent.match(/Edge\//);g(E||!_||parseInt(_[1],10)>=43)}}).catch(function(){return!1})}function $(c){return typeof w=="boolean"?d.resolve(w):D(c).then(function(g){return w=g})}function A(c){var g=u[c.name],m={};m.promise=new d(function(C,_){m.resolve=C,m.reject=_}),g.deferredOperations.push(m),g.dbReady?g.dbReady=g.dbReady.then(function(){return m.promise}):g.dbReady=m.promise}function B(c){var g=u[c.name].deferredOperations.pop();if(g)return g.resolve(),g.promise}function O(c,g){var m=u[c.name].deferredOperations.pop();if(m)return m.reject(g),m.promise}function F(c,g){return new d(function(m,C){if(u[c.name]=u[c.name]||pe(),c.db){if(!g)return m(c.db);A(c),c.db.close()}var _=[c.name];g&&_.push(c.version);var E=s.open.apply(s,_);g&&(E.onupgradeneeded=function(k){var M=E.result;try{M.createObjectStore(c.storeName),k.oldVersion<=1&&M.createObjectStore(T)}catch(P){if(P.name!=="ConstraintError")throw P;console.warn('The database "'+c.name+'" has been upgraded from version '+k.oldVersion+" to version "+k.newVersion+', but the storage "'+c.storeName+'" already exists.')}}),E.onerror=function(k){k.preventDefault(),C(E.error)},E.onsuccess=function(){var k=E.result;k.onversionchange=function(M){M.target.close()},m(k),B(c)}})}function R(c){return F(c,!1)}function W(c){return F(c,!0)}function V(c,g){if(!c.db)return!0;var m=!c.db.objectStoreNames.contains(c.storeName),C=c.version<c.db.version,_=c.version>c.db.version;if(C&&(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),_||m){if(m){var E=c.db.version+1;E>c.version&&(c.version=E)}return!0}return!1}function ne(c){return new d(function(g,m){var C=new FileReader;C.onerror=m,C.onloadend=function(_){var E=btoa(_.target.result||"");g({__local_forage_encoded_blob:!0,data:E,type:c.type})},C.readAsBinaryString(c)})}function J(c){return l([f(atob(c.data))],{type:c.type})}function Y(c){return c&&c.__local_forage_encoded_blob}function fe(c){var g=this,m=g._initReady().then(function(){var C=u[g._dbInfo.name];if(C&&C.dbReady)return C.dbReady});return S(m,c,c),m}function Pe(c){A(c);for(var g=u[c.name],m=g.forages,C=0;C<m.length;C++){var _=m[C];_._dbInfo.db&&(_._dbInfo.db.close(),_._dbInfo.db=null)}return c.db=null,R(c).then(function(E){return c.db=E,V(c)?W(c):E}).then(function(E){c.db=g.db=E;for(var k=0;k<m.length;k++)m[k]._dbInfo.db=E}).catch(function(E){throw O(c,E),E})}function Q(c,g,m,C){C===void 0&&(C=1);try{var _=c.db.transaction(c.storeName,g);m(null,_)}catch(E){if(C>0&&(!c.db||E.name==="InvalidStateError"||E.name==="NotFoundError"))return d.resolve().then(function(){if(!c.db||E.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 Pe(c).then(function(){Q(c,g,m,C-1)})}).catch(m);m(E)}}function pe(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Ht(c){var g=this,m={db:null};if(c)for(var C in c)m[C]=c[C];var _=u[m.name];_||(_=pe(),u[m.name]=_),_.forages.push(g),g._initReady||(g._initReady=g.ready,g.ready=fe);var E=[];function k(){return d.resolve()}for(var M=0;M<_.forages.length;M++){var P=_.forages[M];P!==g&&E.push(P._initReady().catch(k))}var z=_.forages.slice(0);return d.all(E).then(function(){return m.db=_.db,R(m)}).then(function(N){return m.db=N,V(m,g._defaultConfig.version)?W(m):N}).then(function(N){m.db=_.db=N,g._dbInfo=m;for(var U=0;U<z.length;U++){var q=z[U];q!==g&&(q._dbInfo.db=m.db,q._dbInfo.version=m.version)}})}function qt(c,g){var m=this;c=x(c);var C=new d(function(_,E){m.ready().then(function(){Q(m._dbInfo,v,function(k,M){if(k)return E(k);try{var P=M.objectStore(m._dbInfo.storeName).get(c);P.onsuccess=function(){var z=P.result;z===void 0&&(z=null),Y(z)&&(z=J(z)),_(z)},P.onerror=function(){E(P.error)}}catch(z){E(z)}})}).catch(E)});return b(C,g),C}function Vt(c,g){var m=this,C=new d(function(_,E){m.ready().then(function(){Q(m._dbInfo,v,function(k,M){if(k)return E(k);try{var P=M.objectStore(m._dbInfo.storeName).openCursor(),z=1;P.onsuccess=function(){var N=P.result;if(N){var U=N.value;Y(U)&&(U=J(U));var q=c(U,N.key,z++);q!==void 0?_(q):N.continue()}else _()},P.onerror=function(){E(P.error)}}catch(N){E(N)}})}).catch(E)});return b(C,g),C}function et(c,g,m){var C=this;c=x(c);var _=new d(function(E,k){var M;C.ready().then(function(){return M=C._dbInfo,p.call(g)==="[object Blob]"?$(M.db).then(function(P){return P?g:ne(g)}):g}).then(function(P){Q(C._dbInfo,h,function(z,N){if(z)return k(z);try{var U=N.objectStore(C._dbInfo.storeName);P===null&&(P=void 0);var q=U.put(P,c);N.oncomplete=function(){P===void 0&&(P=null),E(P)},N.onabort=N.onerror=function(){var X=q.error?q.error:q.transaction.error;k(X)}}catch(X){k(X)}})}).catch(k)});return b(_,m),_}function Be(c,g){var m=this;c=x(c);var C=new d(function(_,E){m.ready().then(function(){Q(m._dbInfo,h,function(k,M){if(k)return E(k);try{var P=M.objectStore(m._dbInfo.storeName).delete(c);M.oncomplete=function(){_()},M.onerror=function(){E(P.error)},M.onabort=function(){var z=P.error?P.error:P.transaction.error;E(z)}}catch(z){E(z)}})}).catch(E)});return b(C,g),C}function Ne(c){var g=this,m=new d(function(C,_){g.ready().then(function(){Q(g._dbInfo,h,function(E,k){if(E)return _(E);try{var M=k.objectStore(g._dbInfo.storeName).clear();k.oncomplete=function(){C()},k.onabort=k.onerror=function(){var P=M.error?M.error:M.transaction.error;_(P)}}catch(P){_(P)}})}).catch(_)});return b(m,c),m}function ue(c){var g=this,m=new d(function(C,_){g.ready().then(function(){Q(g._dbInfo,v,function(E,k){if(E)return _(E);try{var M=k.objectStore(g._dbInfo.storeName).count();M.onsuccess=function(){C(M.result)},M.onerror=function(){_(M.error)}}catch(P){_(P)}})}).catch(_)});return b(m,c),m}function tt(c,g){var m=this,C=new d(function(_,E){c<0?_(null):m.ready().then(function(){Q(m._dbInfo,v,function(k,M){if(k)return E(k);try{var P=M.objectStore(m._dbInfo.storeName),z=!1,N=P.openKeyCursor();N.onsuccess=function(){var U=N.result;U?c===0||z?_(U.key):(z=!0,U.advance(c)):_(null)},N.onerror=function(){E(N.error)}}catch(U){E(U)}})}).catch(E)});return b(C,g),C}function nt(c){var g=this,m=new d(function(C,_){g.ready().then(function(){Q(g._dbInfo,v,function(E,k){if(E)return _(E);try{var M=k.objectStore(g._dbInfo.storeName).openKeyCursor(),P=[];M.onsuccess=function(){var z=M.result;z?(P.push(z.key),z.continue()):C(P)},M.onerror=function(){_(M.error)}}catch(z){_(z)}})}).catch(_)});return b(m,c),m}function je(c,g){g=L.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 C,_=this;if(c.name){var E=c.name===m.name&&_._dbInfo.db?d.resolve(_._dbInfo.db):R(c).then(function(k){var M=u[c.name],P=M.forages;M.db=k;for(var z=0;z<P.length;z++)P[z]._dbInfo.db=k;return k});C=c.storeName?E.then(function(k){if(k.objectStoreNames.contains(c.storeName)){var M=k.version+1;A(c);var P=u[c.name],z=P.forages;k.close();for(var N=0;N<z.length;N++){var U=z[N];U._dbInfo.db=null,U._dbInfo.version=M}var q=new d(function(X,G){var oe=s.open(c.name,M);oe.onerror=function(ge){oe.result.close(),G(ge)},oe.onupgradeneeded=function(){oe.result.deleteObjectStore(c.storeName)},oe.onsuccess=function(){var ge=oe.result;ge.close(),X(ge)}});return q.then(function(X){P.db=X;for(var G=0;G<z.length;G++){var oe=z[G];oe._dbInfo.db=X,B(oe._dbInfo)}}).catch(function(X){throw(O(c,X)||d.resolve()).catch(function(){}),X})}}):E.then(function(k){A(c);var M=u[c.name],P=M.forages;k.close();for(var z=0;z<P.length;z++)P[z]._dbInfo.db=null;var N=new d(function(U,q){var X=s.deleteDatabase(c.name);X.onerror=function(){var G=X.result;G&&G.close(),q(X.error)},X.onblocked=function(){console.warn('dropInstance blocked for database "'+c.name+'" until all open connections are closed')},X.onsuccess=function(){var G=X.result;G&&G.close(),U(G)}});return N.then(function(U){M.db=U;for(var q=0;q<P.length;q++)B(P[q]._dbInfo)}).catch(function(U){throw(O(c,U)||d.resolve()).catch(function(){}),U})})}else C=d.reject("Invalid arguments");return b(C,g),C}var ot={_driver:"asyncStorage",_initStorage:Ht,_support:a(),iterate:Vt,getItem:qt,setItem:et,removeItem:Be,clear:Ne,length:ue,key:tt,keys:nt,dropInstance:je};function Oe(){return typeof openDatabase=="function"}var he="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",si="~~local_forage_type~",ho=/^~~local_forage_type~([^~]+)~/,rt="__lfsc__:",Xt=rt.length,Gt="arbf",Kt="blob",fo="si08",po="ui08",go="uic8",mo="si16",vo="si32",yo="ur16",wo="ui32",bo="fl32",_o="fl64",So=Xt+Gt.length,Co=Object.prototype.toString;function Eo(c){var g,m,C,_,E,k=.75*c.length,M=c.length,P=0;c[c.length-1]==="="&&(k--,c[c.length-2]==="="&&k--);var z=new ArrayBuffer(k),N=new Uint8Array(z);for(g=0;g<M;g+=4)m=he.indexOf(c[g]),C=he.indexOf(c[g+1]),_=he.indexOf(c[g+2]),E=he.indexOf(c[g+3]),N[P++]=m<<2|C>>4,N[P++]=(15&C)<<4|_>>2,N[P++]=(3&_)<<6|63&E;return z}function Jt(c){var g,m=new Uint8Array(c),C="";for(g=0;g<m.length;g+=3)C+=he[m[g]>>2],C+=he[(3&m[g])<<4|m[g+1]>>4],C+=he[(15&m[g+1])<<2|m[g+2]>>6],C+=he[63&m[g+2]];return m.length%3==2?C=C.substring(0,C.length-1)+"=":m.length%3==1&&(C=C.substring(0,C.length-2)+"=="),C}function ai(c,g){var m="";if(c&&(m=Co.call(c)),c&&(m==="[object ArrayBuffer]"||c.buffer&&Co.call(c.buffer)==="[object ArrayBuffer]")){var C,_=rt;c instanceof ArrayBuffer?(C=c,_+=Gt):(C=c.buffer,m==="[object Int8Array]"?_+=fo:m==="[object Uint8Array]"?_+=po:m==="[object Uint8ClampedArray]"?_+=go:m==="[object Int16Array]"?_+=mo:m==="[object Uint16Array]"?_+=yo:m==="[object Int32Array]"?_+=vo:m==="[object Uint32Array]"?_+=wo:m==="[object Float32Array]"?_+=bo:m==="[object Float64Array]"?_+=_o:g(new Error("Failed to get type for BinaryArray"))),g(_+Jt(C))}else if(m==="[object Blob]"){var E=new FileReader;E.onload=function(){var k=si+c.type+"~"+Jt(this.result);g(rt+Kt+k)},E.readAsArrayBuffer(c)}else try{g(JSON.stringify(c))}catch(k){console.error("Couldn't convert value into a JSON string: ",c),g(null,k)}}function ci(c){if(c.substring(0,Xt)!==rt)return JSON.parse(c);var g,m=c.substring(So),C=c.substring(Xt,So);if(C===Kt&&ho.test(m)){var _=m.match(ho);g=_[1],m=m.substring(_[0].length)}var E=Eo(m);switch(C){case Gt:return E;case Kt:return l([E],{type:g});case fo:return new Int8Array(E);case po:return new Uint8Array(E);case go:return new Uint8ClampedArray(E);case mo:return new Int16Array(E);case yo:return new Uint16Array(E);case vo:return new Int32Array(E);case wo:return new Uint32Array(E);case bo:return new Float32Array(E);case _o:return new Float64Array(E);default:throw new Error("Unkown type: "+C)}}var Yt={serialize:ai,deserialize:ci,stringToBuffer:Eo,bufferToString:Jt};function ko(c,g,m,C){c.executeSql("CREATE TABLE IF NOT EXISTS "+g.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],m,C)}function li(c){var g=this,m={db:null};if(c)for(var C in c)m[C]=typeof c[C]!="string"?c[C].toString():c[C];var _=new d(function(E,k){try{m.db=openDatabase(m.name,String(m.version),m.description,m.size)}catch(M){return k(M)}m.db.transaction(function(M){ko(M,m,function(){g._dbInfo=m,E()},function(P,z){k(z)})},k)});return m.serializer=Yt,_}function we(c,g,m,C,_,E){c.executeSql(m,C,_,function(k,M){M.code===M.SYNTAX_ERR?k.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[g.storeName],function(P,z){z.rows.length?E(P,M):ko(P,g,function(){P.executeSql(m,C,_,E)},E)},E):E(k,M)},E)}function ui(c,g){var m=this;c=x(c);var C=new d(function(_,E){m.ready().then(function(){var k=m._dbInfo;k.db.transaction(function(M){we(M,k,"SELECT * FROM "+k.storeName+" WHERE key = ? LIMIT 1",[c],function(P,z){var N=z.rows.length?z.rows.item(0).value:null;N&&(N=k.serializer.deserialize(N)),_(N)},function(P,z){E(z)})})}).catch(E)});return b(C,g),C}function hi(c,g){var m=this,C=new d(function(_,E){m.ready().then(function(){var k=m._dbInfo;k.db.transaction(function(M){we(M,k,"SELECT * FROM "+k.storeName,[],function(P,z){for(var N=z.rows,U=N.length,q=0;q<U;q++){var X=N.item(q),G=X.value;if(G&&(G=k.serializer.deserialize(G)),(G=c(G,X.key,q+1))!==void 0)return void _(G)}_()},function(P,z){E(z)})})}).catch(E)});return b(C,g),C}function xo(c,g,m,C){var _=this;c=x(c);var E=new d(function(k,M){_.ready().then(function(){g===void 0&&(g=null);var P=g,z=_._dbInfo;z.serializer.serialize(g,function(N,U){U?M(U):z.db.transaction(function(q){we(q,z,"INSERT OR REPLACE INTO "+z.storeName+" (key, value) VALUES (?, ?)",[c,N],function(){k(P)},function(X,G){M(G)})},function(q){if(q.code===q.QUOTA_ERR){if(C>0)return void k(xo.apply(_,[c,P,m,C-1]));M(q)}})})}).catch(M)});return b(E,m),E}function di(c,g,m){return xo.apply(this,[c,g,m,1])}function fi(c,g){var m=this;c=x(c);var C=new d(function(_,E){m.ready().then(function(){var k=m._dbInfo;k.db.transaction(function(M){we(M,k,"DELETE FROM "+k.storeName+" WHERE key = ?",[c],function(){_()},function(P,z){E(z)})})}).catch(E)});return b(C,g),C}function pi(c){var g=this,m=new d(function(C,_){g.ready().then(function(){var E=g._dbInfo;E.db.transaction(function(k){we(k,E,"DELETE FROM "+E.storeName,[],function(){C()},function(M,P){_(P)})})}).catch(_)});return b(m,c),m}function gi(c){var g=this,m=new d(function(C,_){g.ready().then(function(){var E=g._dbInfo;E.db.transaction(function(k){we(k,E,"SELECT COUNT(key) as c FROM "+E.storeName,[],function(M,P){var z=P.rows.item(0).c;C(z)},function(M,P){_(P)})})}).catch(_)});return b(m,c),m}function mi(c,g){var m=this,C=new d(function(_,E){m.ready().then(function(){var k=m._dbInfo;k.db.transaction(function(M){we(M,k,"SELECT key FROM "+k.storeName+" WHERE id = ? LIMIT 1",[c+1],function(P,z){var N=z.rows.length?z.rows.item(0).key:null;_(N)},function(P,z){E(z)})})}).catch(E)});return b(C,g),C}function vi(c){var g=this,m=new d(function(C,_){g.ready().then(function(){var E=g._dbInfo;E.db.transaction(function(k){we(k,E,"SELECT key FROM "+E.storeName,[],function(M,P){for(var z=[],N=0;N<P.rows.length;N++)z.push(P.rows.item(N).key);C(z)},function(M,P){_(P)})})}).catch(_)});return b(m,c),m}function yi(c){return new d(function(g,m){c.transaction(function(C){C.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(_,E){for(var k=[],M=0;M<E.rows.length;M++)k.push(E.rows.item(M).name);g({db:c,storeNames:k})},function(_,E){m(E)})},function(C){m(C)})})}function wi(c,g){g=L.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 C,_=this;return C=c.name?new d(function(E){var k;k=c.name===m.name?_._dbInfo.db:openDatabase(c.name,"","",0),c.storeName?E({db:k,storeNames:[c.storeName]}):E(yi(k))}).then(function(E){return new d(function(k,M){E.db.transaction(function(P){function z(X){return new d(function(G,oe){P.executeSql("DROP TABLE IF EXISTS "+X,[],function(){G()},function(ge,en){oe(en)})})}for(var N=[],U=0,q=E.storeNames.length;U<q;U++)N.push(z(E.storeNames[U]));d.all(N).then(function(){k()}).catch(function(X){M(X)})},function(P){M(P)})})}):d.reject("Invalid arguments"),b(C,g),C}var bi={_driver:"webSQLStorage",_initStorage:li,_support:Oe(),iterate:hi,getItem:ui,setItem:di,removeItem:fi,clear:pi,length:gi,key:mi,keys:vi,dropInstance:wi};function _i(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Io(c,g){var m=c.name+"/";return c.storeName!==g.storeName&&(m+=c.storeName+"/"),m}function Si(){var c="_localforage_support_test";try{return localStorage.setItem(c,!0),localStorage.removeItem(c),!1}catch{return!0}}function Ci(){return!Si()||localStorage.length>0}function Ei(c){var g=this,m={};if(c)for(var C in c)m[C]=c[C];return m.keyPrefix=Io(c,g._defaultConfig),Ci()?(g._dbInfo=m,m.serializer=Yt,d.resolve()):d.reject()}function ki(c){var g=this,m=g.ready().then(function(){for(var C=g._dbInfo.keyPrefix,_=localStorage.length-1;_>=0;_--){var E=localStorage.key(_);E.indexOf(C)===0&&localStorage.removeItem(E)}});return b(m,c),m}function xi(c,g){var m=this;c=x(c);var C=m.ready().then(function(){var _=m._dbInfo,E=localStorage.getItem(_.keyPrefix+c);return E&&(E=_.serializer.deserialize(E)),E});return b(C,g),C}function Ii(c,g){var m=this,C=m.ready().then(function(){for(var _=m._dbInfo,E=_.keyPrefix,k=E.length,M=localStorage.length,P=1,z=0;z<M;z++){var N=localStorage.key(z);if(N.indexOf(E)===0){var U=localStorage.getItem(N);if(U&&(U=_.serializer.deserialize(U)),(U=c(U,N.substring(k),P++))!==void 0)return U}}});return b(C,g),C}function Ti(c,g){var m=this,C=m.ready().then(function(){var _,E=m._dbInfo;try{_=localStorage.key(c)}catch{_=null}return _&&(_=_.substring(E.keyPrefix.length)),_});return b(C,g),C}function Ri(c){var g=this,m=g.ready().then(function(){for(var C=g._dbInfo,_=localStorage.length,E=[],k=0;k<_;k++){var M=localStorage.key(k);M.indexOf(C.keyPrefix)===0&&E.push(M.substring(C.keyPrefix.length))}return E});return b(m,c),m}function Mi(c){var g=this.keys().then(function(m){return m.length});return b(g,c),g}function Pi(c,g){var m=this;c=x(c);var C=m.ready().then(function(){var _=m._dbInfo;localStorage.removeItem(_.keyPrefix+c)});return b(C,g),C}function zi(c,g,m){var C=this;c=x(c);var _=C.ready().then(function(){g===void 0&&(g=null);var E=g;return new d(function(k,M){var P=C._dbInfo;P.serializer.serialize(g,function(z,N){if(N)M(N);else try{localStorage.setItem(P.keyPrefix+c,z),k(E)}catch(U){U.name!=="QuotaExceededError"&&U.name!=="NS_ERROR_DOM_QUOTA_REACHED"||M(U),M(U)}})})});return b(_,m),_}function Li(c,g){if(g=L.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 C,_=this;return C=c.name?new d(function(E){c.storeName?E(Io(c,_._defaultConfig)):E(c.name+"/")}).then(function(E){for(var k=localStorage.length-1;k>=0;k--){var M=localStorage.key(k);M.indexOf(E)===0&&localStorage.removeItem(M)}}):d.reject("Invalid arguments"),b(C,g),C}var Di={_driver:"localStorageWrapper",_initStorage:Ei,_support:_i(),iterate:Ii,getItem:xi,setItem:zi,removeItem:Pi,clear:ki,length:Mi,key:Ti,keys:Ri,dropInstance:Li},$i=function(c,g){return c===g||typeof c=="number"&&typeof g=="number"&&isNaN(c)&&isNaN(g)},Ai=function(c,g){for(var m=c.length,C=0;C<m;){if($i(c[C],g))return!0;C++}return!1},To=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"},We={},Ro={},ze={INDEXEDDB:ot,WEBSQL:bi,LOCALSTORAGE:Di},Bi=[ze.INDEXEDDB._driver,ze.WEBSQL._driver,ze.LOCALSTORAGE._driver],it=["dropInstance"],Zt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(it),Ni={description:"",driver:Bi.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function ji(c,g){c[g]=function(){var m=arguments;return c.ready().then(function(){return c[g].apply(c,m)})}}function Qt(){for(var c=1;c<arguments.length;c++){var g=arguments[c];if(g)for(var m in g)g.hasOwnProperty(m)&&(To(g[m])?arguments[0][m]=g[m].slice():arguments[0][m]=g[m])}return arguments[0]}var Oi=function(){function c(g){for(var m in r(this,c),ze)if(ze.hasOwnProperty(m)){var C=ze[m],_=C._driver;this[m]=_,We[_]||this.defineDriver(C)}this._defaultConfig=Qt({},Ni),this._config=Qt({},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,C){var _=new d(function(E,k){try{var M=g._driver,P=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!g._driver)return void k(P);for(var z=Zt.concat("_initStorage"),N=0,U=z.length;N<U;N++){var q=z[N];if((!Ai(it,q)||g[q])&&typeof g[q]!="function")return void k(P)}var X=function(){for(var oe=function(Ui){return function(){var Fi=new Error("Method "+Ui+" is not implemented by the current driver"),Mo=d.reject(Fi);return b(Mo,arguments[arguments.length-1]),Mo}},ge=0,en=it.length;ge<en;ge++){var tn=it[ge];g[tn]||(g[tn]=oe(tn))}};X();var G=function(oe){We[M]&&console.info("Redefining LocalForage driver: "+M),We[M]=g,Ro[M]=oe,E()};"_support"in g?g._support&&typeof g._support=="function"?g._support().then(G,k):G(!!g._support):G(!0)}catch(oe){k(oe)}});return S(_,m,C),_},c.prototype.driver=function(){return this._driver||null},c.prototype.getDriver=function(g,m,C){var _=We[g]?d.resolve(We[g]):d.reject(new Error("Driver not found."));return S(_,m,C),_},c.prototype.getSerializer=function(g){var m=d.resolve(Yt);return S(m,g),m},c.prototype.ready=function(g){var m=this,C=m._driverSet.then(function(){return m._ready===null&&(m._ready=m._initDriver()),m._ready});return S(C,g,g),C},c.prototype.setDriver=function(g,m,C){var _=this;To(g)||(g=[g]);var E=this._getSupportedDrivers(g);function k(){_._config.driver=_.driver()}function M(N){return _._extend(N),k(),_._ready=_._initStorage(_._config),_._ready}function P(N){return function(){var U=0;function q(){for(;U<N.length;){var X=N[U];return U++,_._dbInfo=null,_._ready=null,_.getDriver(X).then(M).catch(q)}k();var G=new Error("No available storage method found.");return _._driverSet=d.reject(G),_._driverSet}return q()}}var z=this._driverSet!==null?this._driverSet.catch(function(){return d.resolve()}):d.resolve();return this._driverSet=z.then(function(){var N=E[0];return _._dbInfo=null,_._ready=null,_.getDriver(N).then(function(U){_._driver=U._driver,k(),_._wrapLibraryMethodsWithReady(),_._initDriver=P(E)})}).catch(function(){k();var N=new Error("No available storage method found.");return _._driverSet=d.reject(N),_._driverSet}),S(this._driverSet,m,C),this._driverSet},c.prototype.supports=function(g){return!!Ro[g]},c.prototype._extend=function(g){Qt(this,g)},c.prototype._getSupportedDrivers=function(g){for(var m=[],C=0,_=g.length;C<_;C++){var E=g[C];this.supports(E)&&m.push(E)}return m},c.prototype._wrapLibraryMethodsWithReady=function(){for(var g=0,m=Zt.length;g<m;g++)ji(this,Zt[g])},c.prototype.createInstance=function(g){return new c(g)},c}(),Wi=new Oi;e.exports=Wi},{3:3}]},{},[4])(4)),sr={exports:{}};/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var y=require("vue"),Hi=require("axios"),qi=require("qs"),st=require("@hprose/rpc-core"),ze=require("@hprose/io"),Vi=require("@hprose/rpc-html5");function Po(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var Xi=Po(Hi),Gi=Po(qi),Ki={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((t,e)=>(t[e.id]=e)&&t,{})}},methods:{updatePaneComponents(){this.panes.forEach(t=>{t.update&&t.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[t.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(t,e){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=e},onMouseMove(t){this.touch.mouseDown&&(t.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(t)),this.$emit("resize",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(t,e){"ontouchstart"in window&&(t.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===e?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(t,e),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=e,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[e])},onSplitterDblClick(t,e){let n=0;this.panes=this.panes.map((o,r)=>(o.size=r===e?o.max:o.min,r!==e&&(n+=o.min),o)),this.panes[e].size-=n,this.$emit("pane-maximize",this.panes[e])},onPaneClick(t,e){this.$emit("pane-click",this.indexedPanes[e])},getCurrentMouseDrag(t){const e=this.container.getBoundingClientRect(),{clientX:n,clientY:o}="ontouchstart"in window&&t.touches?t.touches[0]:t;return{x:n-e.left,y:o-e.top}},getCurrentDragPercentage(t){t=t[this.horizontal?"y":"x"];const e=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(t=e-t),100*t/e},calculatePanesSize(t){const e=this.touch.activeSplitter;let n={prevPanesSize:this.sumPrevPanesSize(e),nextPanesSize:this.sumNextPanesSize(e),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(t),r),o);let s=[e,e+1],a=this.panes[s[0]]||null,l=this.panes[s[1]]||null;const d=a.max<100&&i>=a.max+n.prevPanesSize,b=l.max<100&&i<=100-(l.max+this.sumNextPanesSize(e+1));if(d||b)d?(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(e+1),0),l.size=l.max);else{if(this.pushOtherPanes){const S=this.doPushOtherPanes(n,i);if(!S)return;({sums:n,panesToResize:s}=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(t,e){const n=this.touch.activeSplitter,o=[n,n+1];return e<t.prevPanesSize+this.panes[o[0]].min&&(o[0]=this.findPrevExpandedPane(n).index,t.prevReachedMinPanes=0,o[0]<n&&this.panes.forEach((r,i)=>{i>o[0]&&i<=n&&(r.size=r.min,t.prevReachedMinPanes+=r.min)}),t.prevPanesSize=this.sumPrevPanesSize(o[0]),o[0]===void 0)?(t.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((r,i)=>{i>0&&i<=n&&(r.size=r.min,t.prevReachedMinPanes+=r.min)}),this.panes[o[1]].size=100-t.prevReachedMinPanes-this.panes[0].min-t.prevPanesSize-t.nextPanesSize,null):e>100-t.nextPanesSize-this.panes[o[1]].min&&(o[1]=this.findNextExpandedPane(n).index,t.nextReachedMinPanes=0,o[1]>n+1&&this.panes.forEach((r,i)=>{i>n&&i<o[1]&&(r.size=r.min,t.nextReachedMinPanes+=r.min)}),t.nextPanesSize=this.sumNextPanesSize(o[1]-1),o[1]===void 0)?(t.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,t.nextReachedMinPanes+=r.min)}),this.panes[o[0]].size=100-t.prevPanesSize-t.nextReachedMinPanes-this.panes[this.panesCount-1].min-t.nextPanesSize,null):{sums:t,panesToResize:o}},sumPrevPanesSize(t){return this.panes.reduce((e,n,o)=>e+(o<t?n.size:0),0)},sumNextPanesSize(t){return this.panes.reduce((e,n,o)=>e+(o>t+1?n.size:0),0)},findPrevExpandedPane(t){return[...this.panes].reverse().find(e=>e.index<t&&e.size>e.min)||{}},findNextExpandedPane(t){return this.panes.find(e=>e.index>t+1&&e.size>e.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(t=>{const e=t.classList.contains("splitpanes__pane"),n=t.classList.contains("splitpanes__splitter");if(!e&&!n)return t.parentNode.removeChild(t),void console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed.")})},addSplitter(t,e,n=!1){const o=t-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)),e.parentNode.insertBefore(r,e)},removeSplitter(t){t.onmousedown=void 0,t.onclick=void 0,t.ondblclick=void 0,t.parentNode.removeChild(t)},redoSplitters(){const t=Array.from(this.container.children);t.forEach(n=>{n.className.includes("splitpanes__splitter")&&this.removeSplitter(n)});let e=0;t.forEach(n=>{n.className.includes("splitpanes__pane")&&(!e&&this.firstSplitter?this.addSplitter(e,n,!0):e&&this.addSplitter(e,n),e++)})},requestUpdate({target:t,...e}){const n=this.indexedPanes[t._.uid];Object.entries(e).forEach(([o,r])=>n[o]=r)},onPaneAdd(t){let e=-1;Array.from(t.$el.parentNode.children).some(r=>(r.className.includes("splitpanes__pane")&&e++,r===t.$el));const n=parseFloat(t.minSize),o=parseFloat(t.maxSize);this.panes.splice(e,0,{id:t._.uid,index:e,min:isNaN(n)?0:n,max:isNaN(o)?100:o,size:t.size===null?null:parseFloat(t.size),givenSize:t.size,update:t.update}),this.panes.forEach((r,i)=>r.index=i),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[e]}),this.$emit("pane-add",{index:e,panes:this.panes.map(r=>({min:r.min,max:r.max,size:r.size}))})})},onPaneRemove(t){const e=this.panes.findIndex(o=>o.id===t._.uid),n=this.panes.splice(e,1)[0];this.panes.forEach((o,r)=>o.index=r),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...n,index:e}}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(o=>({min:o.min,max:o.max,size:o.size}))})})},resetPaneSizes(t={}){t.addedPane||t.removedPane?this.panes.some(e=>e.givenSize!==null||e.min||e.max<100)?this.equalizeAfterAddOrRemove(t):this.equalize():this.initialPanesSizing(),this.ready&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size})))},equalize(){const t=100/this.panesCount;let e=0;const n=[],o=[];this.panes.forEach(r=>{r.size=Math.max(Math.min(t,r.max),r.min),e-=r.size,r.size>=r.max&&n.push(r.id),r.size<=r.min&&o.push(r.id)}),e>.1&&this.readjustSizes(e,n,o)},initialPanesSizing(){let t=100;const e=[],n=[];let o=0;this.panes.forEach(i=>{t-=i.size,i.size!==null&&o++,i.size>=i.max&&e.push(i.id),i.size<=i.min&&n.push(i.id)});let r=100;t>.1&&(this.panes.forEach(i=>{i.size===null&&(i.size=Math.max(Math.min(t/(this.panesCount-o),i.max),i.min)),r-=i.size}),r>.1&&this.readjustSizes(t,e,n))},equalizeAfterAddOrRemove({addedPane:t}={}){let e=100/this.panesCount,n=0;const o=[],r=[];t&&t.givenSize!==null&&(e=(100-t.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=>{t&&t.givenSize!==null&&t.id===i.id||(i.size=Math.max(Math.min(e,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(t,e,n){let o;o=t>0?t/(this.panesCount-e.length):t/(this.panesCount-n.length),this.panes.forEach(r=>{if(t>0&&!e.includes(r.id)){const i=Math.max(Math.min(r.size+o,r.max),r.min),s=i-r.size;t-=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;t-=s,r.size=i}r.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[r.id].size}%`})}),Math.abs(t)>.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(t){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((e,n)=>{e.ondblclick=t?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 y.h("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(t){this.style=t}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(t){this.requestUpdate({target:this,size:t})},minSizeNumber(t){this.requestUpdate({target:this,min:t})},maxSizeNumber(t){this.requestUpdate({target:this,max:t})}}};function on(t){return window.TouchEvent&&t instanceof TouchEvent}nn.render=function(t,e,n,o,r,i){return y.openBlock(),y.createElementBlock("div",{class:"splitpanes__pane",onClick:e[0]||(e[0]=s=>i.onPaneClick(s,t._.uid)),style:y.normalizeStyle(t.style)},[y.renderSlot(t.$slots,"default")],4)},nn.__file="src/controls/splitpanes/pane.vue";class ce{e;constructor(e){this.e=e}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 co(this.clientX,this.clientY)}static bindDown(e,n,o,r=!1){const i=a=>{n(new ce(a))},s=a=>{a.touches.length===1&&n(new ce(a)),a.touches.length>1&&o&&o(new ce(a))};return e.addEventListener("mousedown",i,r),e.addEventListener("touchstart",s,r),()=>{e.removeEventListener("mousedown",i,r),e.removeEventListener("touchstart",s,r)}}static bindMove(e,n,o=!1){const r=s=>{n(new ce(s))},i=s=>{s.touches.length===1&&n(new ce(s))};return e.addEventListener("mousemove",r,o),e.addEventListener("touchmove",i,o),()=>{e.removeEventListener("mousemove",r,o),e.removeEventListener("touchmove",i,o)}}static bindUp(e,n,o=!1){const r=s=>{n(new ce(s))},i=s=>{s.touches.length===0&&n(new ce(s))};return e.addEventListener("mouseup",r,o),e.addEventListener("touchend",i,o),()=>{e.removeEventListener("mouseup",r,o),e.removeEventListener("touchend",i,o)}}originalEvent({mouse:e,touch:n}){on(this.e)?n&&n(this.e):e&&e(this.e)}}class co{x;y;constructor(e,n){this.x=e,this.y=n}clone(){return new co(this.x,this.y)}}class Ji{handle;container;options;unbindDown;unbindMove;unbindUp;constructor(e,n,o={}){this.handle=e,this.container=n,this.options=o,e&&(this.unbindDown=ce.bindDown(e,this.mousedown),e.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=e=>{if(e.preventDefault(),this.handle){const{left:n,top:o}=this.handle.getBoundingClientRect();this.offsetX=e.clientX-n,this.offsetY=e.clientY-o}this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=ce.bindMove(document,this.mousemove),this.unbindUp=ce.bindUp(document,this.mouseup)};mousemove=e=>{this.container&&(this.container.style.left=e.clientX-this.offsetX+"px",this.container.style.top=e.clientY-this.offsetY+"px"),this.options.onMove&&this.options.onMove()};mouseup=e=>{this.options.onMoveEnd&&this.options.onMoveEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0}}class Yi{_group;onChange;zIndex;constructor(e,n){this._group=e,this.onChange=n,this.a(o=>o.push(this))}set group(e){this._group=e;const n=ct(this._group),o=ct(e);n.splice(n.indexOf(this),1),o.push(this),zo()}get group(){return this._group}unregister(){this.a(e=>e.splice(e.indexOf(this),1))}raise(){this.a(e=>{e.splice(e.indexOf(this),1),e.push(this)})}a(e){e(ct(this._group)),zo()}}const at=new Map;function ct(t){return at.has(t)||at.set(t,[]),at.get(t)}function Lo(t,e){return t>e?-Lo(e,t):t<0&&e>=0?1:t-e}function zo(){let t=0;for(const e of function(n){const o=[];return n.forEach((r,i)=>o.push(i)),o}(at).sort(Lo))for(const n of ct(e))t!=n.zIndex&&(n.zIndex=t,n.onChange(t)),t++}function rn(t){if(t){const{width:e,height:n}=t.style;t.style.width="auto",t.style.height="auto";const o=lt(t);return t.style.width=e,t.style.height=n,o}return{width:0,height:0,top:0,left:0,bottom:0,right:0}}function lt(t){const e=t.getBoundingClientRect(),n=e.width,o=e.height,r=e.top,i=e.left;return{width:n,height:o,top:r,left:i,bottom:r+o,right:i+n}}class Zi{container;options;handles;constructor(e,n){if(this.container=e,this.options=n,e&&n){this.handles=Do.map(l=>new l(e,this));const{width:o,height:r}=rn(e),i=n.maxWidth||window.innerWidth,s=n.maxHeight||window.innerHeight;let a=!1;(o<n.minWidth||o>i)&&(e.style.width=`${Ao(o,n.minWidth,i)}px`,a=!0),(r<n.minHeight||r>s)&&(e.style.height=`${Ao(r,n.minHeight,s)}px`,a=!0),a&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(e=>e.teardown())}}const Do=[];class be{container;helper;handle;handleSize=8;unbindDown;unbindMove;unbindUp;constructor(e,n){this.container=e,this.helper=n,this.handle=this.createHandleElement(),this.unbindDown=ce.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=e=>{e.preventDefault(),e.stopPropagation();const{left:n,top:o,width:r,height:i}=lt(this.container);this.x0=e.clientX,this.y0=e.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=ce.bindMove(document,this.mousemove),this.unbindUp=ce.bindUp(document,this.mouseup)};minLeft;maxLeft;minRight;maxRight;minTop;maxTop;minBottom;maxBottom;calcSafeBoundaries(){if(!this.helper.options)return;const{left:e,top:n,right:o,bottom:r}=lt(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=e+i.minWidth,this.maxRight=Math.min(e+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=e=>{e.preventDefault(),e.stopPropagation(),this.setPosition(e),this.fixPosition(),this.helper.options&&this.helper.options.onResize&&this.helper.options.onResize()};fixPosition(){const{width:e,height:n,left:o,top:r,right:i,bottom:s}=lt(this.container),a=this.helper.options;a&&(o<this.minLeft?(this.container.style.width=e+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=e=>{e.preventDefault(),e.stopPropagation(),this.helper.options&&this.helper.options.onResizeEnd&&this.helper.options.onResizeEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0};createHandleElement(){const e=document.createElement("div"),n=e.style;return n.position="absolute",this.applyStyle(n),this.container.appendChild(e),e}}function Ao(t,e,n){return t<e?e:t>n?n:t}Do.push(class extends be{setPosition(t){this.container.style.width=this.width0+t.clientX-this.x0+"px",this.container.style.height=this.height0+t.clientY-this.y0+"px"}applyStyle(t){t.width=2*this.handleSize+"px",t.height=2*this.handleSize+"px",t.right=-this.handleSize+"px",t.bottom=-this.handleSize+"px",t.cursor="nwse-resize"}},class extends be{setPosition(t){this.container.style.height=this.height0+t.clientY-this.y0+"px"}applyStyle(t){t.right=`${this.handleSize}px`,t.left=`${this.handleSize}px`,t.height=2*this.handleSize+"px",t.bottom=-this.handleSize+"px",t.cursor="ns-resize"}},class extends be{setPosition(t){this.container.style.left=this.left0+t.clientX-this.x0+"px",this.container.style.width=this.width0-(t.clientX-this.x0)+"px",this.container.style.height=this.height0+t.clientY-this.y0+"px"}applyStyle(t){t.left=-this.handleSize+"px",t.bottom=-this.handleSize+"px",t.width=2*this.handleSize+"px",t.height=2*this.handleSize+"px",t.cursor="nesw-resize"}},class extends be{setPosition(t){this.container.style.left=this.left0+t.clientX-this.x0+"px",this.container.style.width=this.width0-(t.clientX-this.x0)+"px"}applyStyle(t){t.left=-this.handleSize+"px",t.bottom=`${this.handleSize}px`,t.width=2*this.handleSize+"px",t.top=`${this.handleSize}px`,t.cursor="ew-resize"}},class extends be{setPosition(t){this.container.style.left=this.left0+t.clientX-this.x0+"px",this.container.style.width=this.width0-(t.clientX-this.x0)+"px",this.container.style.top=this.top0+t.clientY-this.y0+"px",this.container.style.height=this.height0-(t.clientY-this.y0)+"px"}applyStyle(t){t.left=-this.handleSize+"px",t.top=-this.handleSize+"px",t.width=2*this.handleSize+"px",t.height=2*this.handleSize+"px",t.cursor="nwse-resize"}},class extends be{setPosition(t){this.container.style.top=this.top0+t.clientY-this.y0+"px",this.container.style.height=this.height0-(t.clientY-this.y0)+"px"}applyStyle(t){t.left=`${this.handleSize}px`,t.right=`${this.handleSize}px`,t.height=2*this.handleSize+"px",t.top=-this.handleSize+"px",t.cursor="ns-resize"}},class extends be{setPosition(t){this.container.style.top=this.top0+t.clientY-this.y0+"px",this.container.style.height=this.height0-(t.clientY-this.y0)+"px",this.container.style.width=this.width0+t.clientX-this.x0+"px"}applyStyle(t){t.right=-this.handleSize+"px",t.top=-this.handleSize+"px",t.height=2*this.handleSize+"px",t.width=2*this.handleSize+"px",t.cursor="nesw-resize"}},class extends be{setPosition(t){this.container.style.width=this.width0+t.clientX-this.x0+"px"}applyStyle(t){t.right=-this.handleSize+"px",t.top=`${this.handleSize}px`,t.bottom=`${this.handleSize}px`,t.width=2*this.handleSize+"px",t.cursor="ew-resize"}});var ut=y.defineComponent({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(t){const e=y.ref(!1),n=y.ref(!1);return{hover:e,active:n,style:function(){let o=t.windowStyle.button;return e.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=ce.bindUp(document,()=>{n.value=!1,r()})}}}});const Qi=["disabled"];ut.render=function(t,e,n,o,r,i){return y.openBlock(),y.createElementBlock("div",{class:"btn",style:y.normalizeStyle(t.style()),onMouseenter:e[0]||(e[0]=s=>t.hover=!0),onMouseleave:e[1]||(e[1]=s=>t.hover=!1),onMousedown:e[2]||(e[2]=y.withModifiers((...s)=>t.mousedown&&t.mousedown(...s),["stop"])),onTouchstart:e[3]||(e[3]=y.withModifiers((...s)=>t.mousedown&&t.mousedown(...s),["stop"])),onMouseup:e[4]||(e[4]=(...s)=>t.mouseup&&t.mouseup(...s)),onTouchend:e[5]||(e[5]=(...s)=>t.mouseup&&t.mouseup(...s)),disabled:t.disabled},[y.renderSlot(t.$slots,"default")],44,Qi)},ut.__scopeId="data-v-71662210",ut.__file="src/controls/vuewindow/window/Button.vue";const es=Object.prototype.toString;function se(t,e){return es.call(t)===`[object ${e}]`}function ht(t){return se(t,"Function")}const $o=t=>typeof t<"u",sn=t=>!$o(t);function an(t){return t===null}const _e=t=>t!=null&&t!==null&&se(t,"Object");function cn(t){return se(t,"Number")}function dt(t){return se(t,"String")}function ln(t){return t&&Array.isArray(t)}const ts=typeof window>"u";var Se=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ft(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ns={exports:{}},un=ft(ns.exports=function(t){var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(w,u){var p=w[0],v=w[1],h=w[2],f=w[3];v=((v+=((h=((h+=((f=((f+=((p=((p+=(v&h|~v&f)+u[0]-680876936|0)<<7|p>>>25)+v|0)&v|~p&h)+u[1]-389564586|0)<<12|f>>>20)+p|0)&p|~f&v)+u[2]+606105819|0)<<17|h>>>15)+f|0)&f|~h&p)+u[3]-1044525330|0)<<22|v>>>10)+h|0,v=((v+=((h=((h+=((f=((f+=((p=((p+=(v&h|~v&f)+u[4]-176418897|0)<<7|p>>>25)+v|0)&v|~p&h)+u[5]+1200080426|0)<<12|f>>>20)+p|0)&p|~f&v)+u[6]-1473231341|0)<<17|h>>>15)+f|0)&f|~h&p)+u[7]-45705983|0)<<22|v>>>10)+h|0,v=((v+=((h=((h+=((f=((f+=((p=((p+=(v&h|~v&f)+u[8]+1770035416|0)<<7|p>>>25)+v|0)&v|~p&h)+u[9]-1958414417|0)<<12|f>>>20)+p|0)&p|~f&v)+u[10]-42063|0)<<17|h>>>15)+f|0)&f|~h&p)+u[11]-1990404162|0)<<22|v>>>10)+h|0,v=((v+=((h=((h+=((f=((f+=((p=((p+=(v&h|~v&f)+u[12]+1804603682|0)<<7|p>>>25)+v|0)&v|~p&h)+u[13]-40341101|0)<<12|f>>>20)+p|0)&p|~f&v)+u[14]-1502002290|0)<<17|h>>>15)+f|0)&f|~h&p)+u[15]+1236535329|0)<<22|v>>>10)+h|0,v=((v+=((h=((h+=((f=((f+=((p=((p+=(v&f|h&~f)+u[1]-165796510|0)<<5|p>>>27)+v|0)&h|v&~h)+u[6]-1069501632|0)<<9|f>>>23)+p|0)&v|p&~v)+u[11]+643717713|0)<<14|h>>>18)+f|0)&p|f&~p)+u[0]-373897302|0)<<20|v>>>12)+h|0,v=((v+=((h=((h+=((f=((f+=((p=((p+=(v&f|h&~f)+u[5]-701558691|0)<<5|p>>>27)+v|0)&h|v&~h)+u[10]+38016083|0)<<9|f>>>23)+p|0)&v|p&~v)+u[15]-660478335|0)<<14|h>>>18)+f|0)&p|f&~p)+u[4]-405537848|0)<<20|v>>>12)+h|0,v=((v+=((h=((h+=((f=((f+=((p=((p+=(v&f|h&~f)+u[9]+568446438|0)<<5|p>>>27)+v|0)&h|v&~h)+u[14]-1019803690|0)<<9|f>>>23)+p|0)&v|p&~v)+u[3]-187363961|0)<<14|h>>>18)+f|0)&p|f&~p)+u[8]+1163531501|0)<<20|v>>>12)+h|0,v=((v+=((h=((h+=((f=((f+=((p=((p+=(v&f|h&~f)+u[13]-1444681467|0)<<5|p>>>27)+v|0)&h|v&~h)+u[2]-51403784|0)<<9|f>>>23)+p|0)&v|p&~v)+u[7]+1735328473|0)<<14|h>>>18)+f|0)&p|f&~p)+u[12]-1926607734|0)<<20|v>>>12)+h|0,v=((v+=((h=((h+=((f=((f+=((p=((p+=(v^h^f)+u[5]-378558|0)<<4|p>>>28)+v|0)^v^h)+u[8]-2022574463|0)<<11|f>>>21)+p|0)^p^v)+u[11]+1839030562|0)<<16|h>>>16)+f|0)^f^p)+u[14]-35309556|0)<<23|v>>>9)+h|0,v=((v+=((h=((h+=((f=((f+=((p=((p+=(v^h^f)+u[1]-1530992060|0)<<4|p>>>28)+v|0)^v^h)+u[4]+1272893353|0)<<11|f>>>21)+p|0)^p^v)+u[7]-155497632|0)<<16|h>>>16)+f|0)^f^p)+u[10]-1094730640|0)<<23|v>>>9)+h|0,v=((v+=((h=((h+=((f=((f+=((p=((p+=(v^h^f)+u[13]+681279174|0)<<4|p>>>28)+v|0)^v^h)+u[0]-358537222|0)<<11|f>>>21)+p|0)^p^v)+u[3]-722521979|0)<<16|h>>>16)+f|0)^f^p)+u[6]+76029189|0)<<23|v>>>9)+h|0,v=((v+=((h=((h+=((f=((f+=((p=((p+=(v^h^f)+u[9]-640364487|0)<<4|p>>>28)+v|0)^v^h)+u[12]-421815835|0)<<11|f>>>21)+p|0)^p^v)+u[15]+530742520|0)<<16|h>>>16)+f|0)^f^p)+u[2]-995338651|0)<<23|v>>>9)+h|0,v=((v+=((f=((f+=(v^((p=((p+=(h^(v|~f))+u[0]-198630844|0)<<6|p>>>26)+v|0)|~h))+u[7]+1126891415|0)<<10|f>>>22)+p|0)^((h=((h+=(p^(f|~v))+u[14]-1416354905|0)<<15|h>>>17)+f|0)|~p))+u[5]-57434055|0)<<21|v>>>11)+h|0,v=((v+=((f=((f+=(v^((p=((p+=(h^(v|~f))+u[12]+1700485571|0)<<6|p>>>26)+v|0)|~h))+u[3]-1894986606|0)<<10|f>>>22)+p|0)^((h=((h+=(p^(f|~v))+u[10]-1051523|0)<<15|h>>>17)+f|0)|~p))+u[1]-2054922799|0)<<21|v>>>11)+h|0,v=((v+=((f=((f+=(v^((p=((p+=(h^(v|~f))+u[8]+1873313359|0)<<6|p>>>26)+v|0)|~h))+u[15]-30611744|0)<<10|f>>>22)+p|0)^((h=((h+=(p^(f|~v))+u[6]-1560198380|0)<<15|h>>>17)+f|0)|~p))+u[13]+1309151649|0)<<21|v>>>11)+h|0,v=((v+=((f=((f+=(v^((p=((p+=(h^(v|~f))+u[4]-145523070|0)<<6|p>>>26)+v|0)|~h))+u[11]-1120210379|0)<<10|f>>>22)+p|0)^((h=((h+=(p^(f|~v))+u[2]+718787259|0)<<15|h>>>17)+f|0)|~p))+u[9]-343485551|0)<<21|v>>>11)+h|0,w[0]=p+w[0]|0,w[1]=v+w[1]|0,w[2]=h+w[2]|0,w[3]=f+w[3]|0}function o(w){var u,p=[];for(u=0;u<64;u+=4)p[u>>2]=w.charCodeAt(u)+(w.charCodeAt(u+1)<<8)+(w.charCodeAt(u+2)<<16)+(w.charCodeAt(u+3)<<24);return p}function r(w){var u,p=[];for(u=0;u<64;u+=4)p[u>>2]=w[u]+(w[u+1]<<8)+(w[u+2]<<16)+(w[u+3]<<24);return p}function i(w){var u,p,v,h,f,D,A=w.length,$=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=A;u+=64)n($,o(w.substring(u-64,u)));for(p=(w=w.substring(u-64)).length,v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<p;u+=1)v[u>>2]|=w.charCodeAt(u)<<(u%4<<3);if(v[u>>2]|=128<<(u%4<<3),u>55)for(n($,v),u=0;u<16;u+=1)v[u]=0;return h=(h=8*A).toString(16).match(/(.*?)(.{0,8})$/),f=parseInt(h[2],16),D=parseInt(h[1],16)||0,v[14]=f,v[15]=D,n($,v),$}function s(w){var u,p,v,h,f,D,A=w.length,$=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=A;u+=64)n($,r(w.subarray(u-64,u)));for(p=(w=u-64<A?w.subarray(u-64):new Uint8Array(0)).length,v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<p;u+=1)v[u>>2]|=w[u]<<(u%4<<3);if(v[u>>2]|=128<<(u%4<<3),u>55)for(n($,v),u=0;u<16;u+=1)v[u]=0;return h=(h=8*A).toString(16).match(/(.*?)(.{0,8})$/),f=parseInt(h[2],16),D=parseInt(h[1],16)||0,v[14]=f,v[15]=D,n($,v),$}function a(w){var u,p="";for(u=0;u<4;u+=1)p+=e[w>>8*u+4&15]+e[w>>8*u&15];return p}function l(w){var u;for(u=0;u<w.length;u+=1)w[u]=a(w[u]);return w.join("")}function d(w){return/[\u0080-\uFFFF]/.test(w)&&(w=unescape(encodeURIComponent(w))),w}function b(w,u){var p,v=w.length,h=new ArrayBuffer(v),f=new Uint8Array(h);for(p=0;p<v;p+=1)f[p]=w.charCodeAt(p);return u?f:h}function S(w){return String.fromCharCode.apply(null,new Uint8Array(w))}function x(w,u,p){var v=new Uint8Array(w.byteLength+u.byteLength);return v.set(new Uint8Array(w)),v.set(new Uint8Array(u),w.byteLength),p?v:v.buffer}function z(w){var u,p=[],v=w.length;for(u=0;u<v-1;u+=2)p.push(parseInt(w.substr(u,2),16));return String.fromCharCode.apply(String,p)}function T(){this.reset()}return l(i("hello")),typeof ArrayBuffer>"u"||ArrayBuffer.prototype.slice||function(){function w(u,p){return(u=0|u||0)<0?Math.max(u+p,0):Math.min(u,p)}ArrayBuffer.prototype.slice=function(u,p){var v,h,f,D,A=this.byteLength,$=w(u,A),N=A;return p!==t&&(N=w(p,A)),$>N?new ArrayBuffer(0):(v=N-$,h=new ArrayBuffer(v),f=new Uint8Array(h),D=new Uint8Array(this,$,v),f.set(D),h)}}(),T.prototype.append=function(w){return this.appendBinary(d(w)),this},T.prototype.appendBinary=function(w){this._buff+=w,this._length+=w.length;var u,p=this._buff.length;for(u=64;u<=p;u+=64)n(this._hash,o(this._buff.substring(u-64,u)));return this._buff=this._buff.substring(u-64),this},T.prototype.end=function(w){var u,p,v=this._buff,h=v.length,f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<h;u+=1)f[u>>2]|=v.charCodeAt(u)<<(u%4<<3);return this._finish(f,h),p=l(this._hash),w&&(p=z(p)),this.reset(),p},T.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},T.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},T.prototype.setState=function(w){return this._buff=w.buff,this._length=w.length,this._hash=w.hash,this},T.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},T.prototype._finish=function(w,u){var p,v,h,f=u;if(w[f>>2]|=128<<(f%4<<3),f>55)for(n(this._hash,w),f=0;f<16;f+=1)w[f]=0;p=(p=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),v=parseInt(p[2],16),h=parseInt(p[1],16)||0,w[14]=v,w[15]=h,n(this._hash,w)},T.hash=function(w,u){return T.hashBinary(d(w),u)},T.hashBinary=function(w,u){var p=l(i(w));return u?z(p):p},T.ArrayBuffer=function(){this.reset()},T.ArrayBuffer.prototype.append=function(w){var u,p=x(this._buff.buffer,w,!0),v=p.length;for(this._length+=w.byteLength,u=64;u<=v;u+=64)n(this._hash,r(p.subarray(u-64,u)));return this._buff=u-64<v?new Uint8Array(p.buffer.slice(u-64)):new Uint8Array(0),this},T.ArrayBuffer.prototype.end=function(w){var u,p,v=this._buff,h=v.length,f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<h;u+=1)f[u>>2]|=v[u]<<(u%4<<3);return this._finish(f,h),p=l(this._hash),w&&(p=z(p)),this.reset(),p},T.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},T.ArrayBuffer.prototype.getState=function(){var w=T.prototype.getState.call(this);return w.buff=S(w.buff),w},T.ArrayBuffer.prototype.setState=function(w){return w.buff=b(w.buff,!0),T.prototype.setState.call(this,w)},T.ArrayBuffer.prototype.destroy=T.prototype.destroy,T.ArrayBuffer.prototype._finish=T.prototype._finish,T.ArrayBuffer.hash=function(w,u){var p=l(s(new Uint8Array(w)));return u?z(p):p},T}());const hn=[];class ae{static addHandler(e,n,o){e.addEventListener?e.addEventListener(n,o,!1):e.attachEvent?e.attachEvent("on"+n,o):e["on"+n]=o}static removeHandler(e,n,o){e.removeEventListener?e.removeEventListener(n,o,!1):e.detachEvent?e.detachEvent("on"+n,o):delete e["on"+n]}static windowResizeHandler(e){ae.addHandler(window,"resize",e)}static offWindowResizeHandler(e){ae.removeHandler(window,"resize",e)}static fullscreenEnabled(){const e=window.document;return document.fullscreenEnabled||window.fullScreen||e.mozFullscreenEnabled||e.webkitIsFullScreen}static fullScreen(e,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=e;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(e=window.document.documentElement){let n=e;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 e=window.document;var n=document.exitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen||e.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!!ae.fullScreenElement()}static onFullScreenChanged(e){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=ae.isFullScreen();e(o)}):document.addEventListener("MSFullscreenChange",function(){const o=ae.isFullScreen();e(o)})}static stringifyCircularHandler(e,n){if(typeof n=="object"&&n!==null){if(hn.indexOf(n)!==-1)return;hn.push(n)}return n}static jsonStringify(e){if(!e)return"";const n=JSON.stringify(e,ae.stringifyCircularHandler);return hn.length=0,n}static jsonParse(e){const n=ae.jsonStringify(e);if(n.length>1)return JSON.parse(n)}static getObjectURL(e){let n;const o=window;return o.createObjcectURL!=null?n=o.createOjcectURL(e):window.URL!=null?n=window.URL.createObjectURL(e):window.webkitURL!=null&&(n=window.webkitURL.createObjectURL(e)),n}static getFileShortMD5(e,n){const o=File.prototype,r=o.slice||o.mozSlice||o.webkitSlice,i=e,s=2097152,a=new un.ArrayBuffer,l=new FileReader;l.onload=function(d){a.append(d.target?.result);const b=a.end();n({isOK:!0,data:b})},l.onerror=function(){const d="\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01";console.warn(d),n({isOK:!1,data:d})},function(){const d=0+s>=i.size?i.size:0+s;l.readAsArrayBuffer(r.call(i,0,d))}()}static getFileMD5(e,n){const o=File.prototype,r=o.slice||o.mozSlice||o.webkitSlice,i=e,s=2097152,a=Math.ceil(i.size/s);let l=0;const d=new un.ArrayBuffer,b=new FileReader;function S(){const x=l*s,z=x+s>=i.size?i.size:x+s;b.readAsArrayBuffer(r.call(i,x,z))}b.onload=function(x){if(d.append(x.target?.result),l++,l<a)S();else{const z=d.end();n({isOK:!0,data:z})}},b.onerror=function(){const x=`${i.name}:\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01`;console.warn(x),n({isOK:!1,data:x})},S()}static MD5(e,n=!1){return un.hash(e,n)}static copyTextByCommand(e){return new Promise((n,o)=>{const r=document.createElement("input");r.value=e,document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove(),n(!0)})}static copyText=e=>navigator.clipboard?navigator.clipboard.writeText(e).then(function(){return!0},function(n){return!1}):ae.copyTextByCommand(e);static copyElementTextByCommand(e){const n=document.createRange();n.selectNode(document.getElementById(e));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(e){if(!navigator.clipboard)return ae.copyElementTextByCommand(e);const n=document.createRange();n.selectNode(document.getElementById(e));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(e){ae.toggleClass(e,"grayMode",document.documentElement)}static toggleClass(e,n,o){const r=o||document.body;let{className:i}=r;i=i.replace(n,""),r.className=e?`${i} ${n} `:i}static setCssVar(e,n,o=document.documentElement){o.style.setProperty(e,n)}static dispatchWindowResize(){const e=new Event("resize");window.dispatchEvent(e)}static dispatchElementEvent(e,n="click",o){let r;if(r=dt(e)?document.getElementById(e):e,r){const i=new Event(n,{bubbles:!0,cancelable:!0});o&&r.addEventListener("ev",s=>{o(s)},!1),r.dispatchEvent(i)}}static getRandomNum(e,n){var o=n-e,r=Math.random();return e+Math.round(r*o)}static merge(e={},n={}){let o,r,i,s;for(e||(e={}),r=0,i=n.length;r<i;r++)for(o in s=n[r],s)e[o]=s[o];return e}static setOptions(e,n){e.hasOwnProperty("options")||(e.options=e.options?Object.create(e.options):{});for(let o in n)e.options[o]=n[o];return e.options}static formatNum(e,n){let o=Math.pow(10,n===void 0?6:n);return Math.round(e*o)/o}static trim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}static splitWords(e){return this.trim(e).split(/\s+/)}static emptyImageUrl(){return"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="}static debounce(e,n){let o=null;return function(){o&&clearTimeout(o),o=setTimeout(e,n)}}static throttle(e,n){let o=!0;return function(){if(!o)return!1;o=!1,setTimeout(()=>{e(),o=!0},n)}}static dataURLtoBlob(e){let n=e.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(e){return typeof e=="string"?document.getElementById(e):e}static getStyle(e,n){let o=e.style[n]||e.currentStyle&&e.currentStyle[n];if((!o||o==="auto")&&document.defaultView){let r=document.defaultView.getComputedStyle(e,null);o=r?r[n]:null}return o==="auto"?null:o}static create(e,n,o){let r=document.createElement(e);return r.className=n||"",o&&o.appendChild(r),r}static removeElement(e){let n=e.parentNode;n&&n.removeChild(e)}static emptyElement(e){for(;e.firstChild;)e.removeChild(e.firstChild)}static hasClass(e,n){if(e.classList!==void 0)return e.classList.contains(n);let o=this.getClass(e);return o.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(o)}static addClass(e,n){if(e.classList!==void 0){let o=this.splitWords(n);for(let r=0,i=o.length;r<i;r++)e.classList.add(o[r])}else if(!this.hasClass(e,n)){let o=this.getClass(e);this.setClass(e,(o?o+" ":"")+n)}}static removeClass(e,n){e.classList!==void 0?e.classList.remove(n):this.setClass(e,this.trim((" "+this.getClass(e)+" ").replace(" "+n+" "," ")))}static setClass(e,n){e.className.baseVal===void 0?e.className=n:e.className.baseVal=n}static getClass(e){return e.correspondingElement&&(e=e.correspondingElement),e.className.baseVal===void 0?e.className:e.className.baseVal}static createSvgElement(e,n,o,r){let i=document.createElementNS("http://www.w3.org/2000/svg","svg:svg");i.setAttribute("class","svg-path"),i.setAttribute("width",e),i.setAttribute("height",n),i.setAttribute("viewBox",`0 0 ${e} ${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(e,n=!0,o=""){n=n??!1;let r=document.createElement("div");return r.className=o||"",r.innerHTML=e,n?r:r.childNodes}static createVideoHTML(e,n,o){let r=this.create("video",n,o),i=this.create("source","",r);i.setAttribute("src",e),i.setAttribute("type","video/map4");let s=this.create("source","",r);return s.setAttribute("src",e),s.setAttribute("type","video/quicktime"),r}}class pt{static isNullOrEmpty=e=>e===null||e===""||e===void 0||e.length===0;static isNotEmpty=e=>!(e===null||e===""||e===void 0||e.length===0);static toHump(e){return e.replace(/[\-\/\_](\w)/g,(n,o)=>o.toUpperCase()).replace("views","")}}class gt{prefixKey;storage;constructor(e="",n=localStorage){this.prefixKey=e,this.storage=n}getKey(e){return`${this.prefixKey}${e}`.toUpperCase()}set(e,n,o=604800){const r=JSON.stringify({value:n,expire:o!==null?new Date().getTime()+1e3*o:null});this.storage.setItem(this.getKey(e),r)}get(e,n=null){const o=this.storage.getItem(this.getKey(e));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(e))}catch{return n}return n}getJsonObject(e){const n=this.storage.getItem(this.getKey(e));if(n)try{const o=JSON.parse(n);if(o.expire===null||o.expire>=Date.now())return o;this.remove(this.getKey(e))}catch{return}}remove(e){this.storage.removeItem(this.getKey(e))}clear(){this.storage.clear()}setCookie(e,n,o=604800){document.cookie=`${this.getKey(e)}=${n}; Max-Age=${o}`}getCookie(e){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(e))return i[1]}return""}removeCookie(e){this.setCookie(e,1,-1)}clearCookie(){const e=document.cookie.match(/[^ =;]+(?==)/g);if(e)for(let n=e.length;n--;)document.cookie=e[n]+"=0;expire="+new Date(0).toUTCString()}}const os=new gt("",localStorage);function No(){let t=[];const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(var n=0;n<36;n++){const r=Math.floor(16*Math.random());t[n]=e.substring(r,r+1)}t[14]="4";const o=3&Number(t[19])|8;return t[19]=e.substring(o,o+1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}function dn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function mt(t){return/^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/.test(t)}function fn(t){let e=t.toLowerCase();if(mt(t)){if(e.length===4){let o="#";for(let r=1;r<4;r+=1)o+=e.slice(r,r+1).concat(e.slice(r,r+1));e=o}const n=[];for(let o=1;o<7;o+=2)n.push(parseInt("0x"+e.slice(o,o+2)));return"RGB("+n.join(",")+")"}return e}function pn(t,e){const n=parseInt(t,16)+e,o=n>255?255:n;return o.toString(16).length>1?o.toString(16):`0${o.toString(16)}`}function Bo(t,e,n){const o=[t,e,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 gn(t,e){const n=parseInt(t,16)-e,o=n<0?0:n;return o.toString(16).length>1?o.toString(16):`0${o.toString(16)}`}function mn(t){return{all:t=t||new Map,on(e,n){const o=t?.get(e);o&&o.push(n)||t?.set(e,[n])},off(e,n){const o=t?.get(e);o&&o.splice(o.indexOf(n)>>>0,1)},emit(e,n){(t?.get(e)||[]).slice().map(o=>{o(n)}),(t?.get("*")||[]).slice().map(o=>{o(e,n)})}}}exports.EnumColor=void 0,function(t){t[t.RGBA=0]="RGBA",t[t.Hex=1]="Hex",t[t.Hsla=2]="Hsla"}(exports.EnumColor||(exports.EnumColor={}));const Ce=mn(),re={HproseServiceErrorEvent:"HproseServiceError",WebAPIErrorEvent:"WebAPIError",AlertInfoEvent:"AlertInfoEvent",CommonWarnEvent:"CommonWarnEvent",WidgetLoadedEvent:"WidgetLoaded",WidgetLoaded:"WidgetLoaded",WidgetUnLoadedEvent:"WidgetUnLoaded",WidgetLoadedErrorEvent:"WidgetLoadedError",WidgetVisibleChanged:"WidgetVisibleChanged",AxiosRequestErrorEvent:"AxiosRequestErrorEvent",LayoutContainerLoaded:"LayoutContainerLoaded"},vt=(t,e)=>{const n=document.createElement("a");n.download=e,n.style.display="none";const o=new Blob([t],{type:"application/octet-stream"});n.href=URL.createObjectURL(o),document.body.appendChild(n),n.click(),document.body.removeChild(n)},jo=(t,e)=>{const n=JSON.stringify(t,null,2);e?vt(n,e+".json"):Ce.emit(re.CommonWarnEvent,"\u53C2\u6570JsonID\u4E0D\u80FD\u4E3A\u7A7A\uFF01")};function Oo(t){const e=t.lastIndexOf("/")+1;let n=t.substring(e);return n=decodeURI(n.split("?")[0]),n}function Wo(t){return new Promise(e=>setTimeout(e,t))}var Uo,Fo,vn,Ho={exports:{}};Fo=Se,vn=function(){var t=function(){},e="undefined",n=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),o=["trace","debug","info","warn","error"],r={},i=null;function s(T,w){var u=T[w];if(typeof u.bind=="function")return u.bind(T);try{return Function.prototype.bind.call(u,T)}catch{return function(){return Function.prototype.apply.apply(u,[T,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(T){return T==="debug"&&(T="log"),typeof console!==e&&(T==="trace"&&n?a:console[T]!==void 0?s(console,T):console.log!==void 0?s(console,"log"):t)}function d(){for(var T=this.getLevel(),w=0;w<o.length;w++){var u=o[w];this[u]=w<T?t:this.methodFactory(u,T,this.name)}if(this.log=this.debug,typeof console===e&&T<this.levels.SILENT)return"No console available for logging"}function b(T){return function(){typeof console!==e&&(d.call(this),this[T].apply(this,arguments))}}function S(T,w,u){return l(T)||b.apply(this,arguments)}function x(T,w){var u,p,v,h=this,f="loglevel";function D(){var N;if(typeof window!==e&&f){try{N=window.localStorage[f]}catch{}if(typeof N===e)try{var O=window.document.cookie,F=encodeURIComponent(f),M=O.indexOf(F+"=");M!==-1&&(N=/^([^;]+)/.exec(O.slice(M+F.length+1))[1])}catch{}return h.levels[N]===void 0&&(N=void 0),N}}function A(N){var O=N;if(typeof O=="string"&&h.levels[O.toUpperCase()]!==void 0&&(O=h.levels[O.toUpperCase()]),typeof O=="number"&&O>=0&&O<=h.levels.SILENT)return O;throw new TypeError("log.setLevel() called with invalid level: "+N)}typeof T=="string"?f+=":"+T:typeof T=="symbol"&&(f=void 0),h.name=T,h.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},h.methodFactory=w||S,h.getLevel=function(){return v??p??u},h.setLevel=function(N,O){return v=A(N),O!==!1&&function(F){var M=(o[F]||"silent").toUpperCase();if(typeof window!==e&&f){try{return void(window.localStorage[f]=M)}catch{}try{window.document.cookie=encodeURIComponent(f)+"="+M+";"}catch{}}}(v),d.call(h)},h.setDefaultLevel=function(N){p=A(N),D()||h.setLevel(N,!1)},h.resetLevel=function(){v=null,function(){if(typeof window!==e&&f){try{window.localStorage.removeItem(f)}catch{}try{window.document.cookie=encodeURIComponent(f)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}(),d.call(h)},h.enableAll=function(N){h.setLevel(h.levels.TRACE,N)},h.disableAll=function(N){h.setLevel(h.levels.SILENT,N)},h.rebuild=function(){if(i!==h&&(u=A(i.getLevel())),d.call(h),i===h)for(var N in r)r[N].rebuild()},u=A(i?i.getLevel():"WARN");var $=D();$!=null&&(v=A($)),d.call(h)}(i=new x).getLogger=function(T){if(typeof T!="symbol"&&typeof T!="string"||T==="")throw new TypeError("You must supply a name when creating a logger.");var w=r[T];return w||(w=r[T]=new x(T,i.methodFactory)),w};var z=typeof window!==e?window.log:void 0;return i.noConflict=function(){return typeof window!==e&&window.log===i&&(window.log=z),i},i.getLoggers=function(){return r},i.default=i,i},(Uo=Ho).exports?Uo.exports=vn():Fo.log=vn();var yn=Ho.exports;class qo{message;eventBus;constructor(e,n){e&&(this.message=e),n&&(this.eventBus=n)}msg(e,n=3,o="success"){if(this.message)if(typeof this.message=="function")this.message({type:o,message:e,duration:n});else switch(o){case"info":this.message.info(e,n);break;case"success":this.message.success(e,n);break;case"warning":this.message.warn?this.message.warn(e,n):this.message.warning&&this.message.warning(e,n);break;case"error":this.message.error(e,n)}else{switch(o){case"info":case"success":console.log(e);break;case"warning":console.warn(e);break;case"error":o="dark",console.error(e)}this.eventBus&&this.eventBus.emit(re.AlertInfoEvent,{type:o,info:e})}}info(e,n=3){this.msg(e,n,"info")}warn(e,n=3){this.msg(e,n,"warning")}err(e,n=3){this.msg(e,n,"error")}success(e,n=3){this.msg(e,n,"success")}}let Vo=!1;const j={Config:SysConfig,EventBus:Ce,DefaultProxyClient:null,Axios:Xi.default,Message:new qo(void 0,Ce),LayoutMap:new Map,getLayoutManager:t=>{if(!j.WidgetConfigList||j.WidgetConfigList.length===0)return;const e=j.WidgetConfigList.find(n=>n.id===t);if(e){const n=e.layoutID;if(n&&j.LayoutMap.has(n))return j.LayoutMap.get(n)}},Logger:t=>{Vo||(SysConfig.UI.ProductLog?yn.enableAll():yn.setDefaultLevel("warn"),Vo=!0);const e=t||"default";return yn.getLogger(e)}},Xo="access_token",me=new gt("user",localStorage);function Ee(){return me.get(Xo)}function wn(){me.remove(Xo)}function Go(){return Ee()?.refresh}function bn(t,e,n,o="json",r){const i={baseURL:j.Config.ServiceURL.DefaultWebAPI,timeout:6e4,params:t,paramsSerializer:{serialize:function(s){return Gi.default.stringify(s,{indices:!1,arrayFormat:"repeat"})}},headers:{"Content-Type":"application/json",Authorization:"bearer "+Ee()?.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)),e&&(i.baseURL=e),i}function ve(t,e,n,o,r="json",i,s){const a=bn(n,e,o,r,i);return s&&s>=2e4&&(a.timeout=s),j.Axios?.get(t,a).catch(function(l){yt(l,e,t,"Get")})}function yt(t,e,n,o="Get"){const r=`${e}${n}`;if(t&&t.response){let i=!1;const s=t.response.status;switch(s){case 400:t.message="\u9519\u8BEF\u8BF7\u6C42";break;case 401:t.message="\u672A\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55";break;case 403:t.message="\u62D2\u7EDD\u8BBF\u95EE";break;case 404:t.message="\u8BF7\u6C42\u9519\u8BEF,\u672A\u627E\u5230\u8BE5\u8D44\u6E90";break;case 405:t.message="\u8BF7\u6C42\u65B9\u6CD5\u672A\u5141\u8BB8";break;case 408:t.message="\u8BF7\u6C42\u8D85\u65F6";break;case 500:const l=t.response.data;if(l){const d=l.indexOf(":"),b=l.indexOf(`
|
|
2
|
+
`);if(d>0&&b-d>2){const S=l.substring(d+2,b);S.indexOf("System.Exception")>0?t.message="\u540E\u53F0\u670D\u52A1\u5185\u90E8\u51FA\u9519\uFF01":(i=!0,t.message=S)}else i=!0,t.message=l}else t.message="\u670D\u52A1\u5668\u7AEF\u51FA\u9519";break;case 501:t.message="\u7F51\u7EDC\u672A\u5B9E\u73B0";break;case 502:t.message="\u7F51\u7EDC\u9519\u8BEF";break;case 503:t.message="\u670D\u52A1\u4E0D\u53EF\u7528";break;case 504:t.message="\u7F51\u7EDC\u8D85\u65F6";break;case 505:t.message="http\u7248\u672C\u4E0D\u652F\u6301\u8BE5\u8BF7\u6C42";break;default:t.message=`\u8FDE\u63A5\u9519\u8BEF${t.response.status}`}let a={address:r,code:s,isExceptionInfo:i,message:t.message,result:t.response.data};if(j.EventBus.emit(re.AxiosRequestErrorEvent,a),i)throw new Error(t.message)}else{if(t?.message)throw new Error(t.message);console.error(t,"Http\u8BF7\u6C42\u9519\u8BEF!")}}function Ko(t,e,n,o,r,i="json",s){const a=bn(o,e,r,i);s&&s>=2e4&&(a.timeout=s),a.headers["Content-Type"]="multipart/form-data";const l=function(d){let b=new FormData;return d&&Object.keys(d).forEach(S=>{if(!d)return;let x=d[S];x!=null&&(ln(x)?x.forEach(z=>{b.append(S,Yo(z))}):b.append(S,Yo(x)))}),b}(n);return j.Axios?.post(t,l,a).catch(function(d){yt(d,e,t,"Post")})}function Jo(t,e,n,o,r,i="json",s){const a=bn(o,e,r,i);return s&&s>=2e4&&(a.timeout=s),j.Axios?.post(t,n,a).catch(function(l){yt(l,e,t,"Post")})}function Yo(t){return t instanceof Blob?t:t.toString()}var _n={exports:{}},rs=typeof window<"u"?window:Se!==void 0?Se:typeof self<"u"?self:{},is=function(t){if(!t)return!1;var e=ss.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)},ss=Object.prototype.toString,Sn=function(t){return t.replace(/^\s+|\s+$/g,"")},as=function(){for(var t={},e=0;e<arguments.length;e++){var n=arguments[e];for(var o in n)cs.call(n,o)&&(t[o]=n[o])}return t},cs=Object.prototype.hasOwnProperty,Zo=rs,ls=is,us=function(t){if(!t)return{};for(var e,n={},o=Sn(t).split(`
|
|
3
|
+
`),r=0;r<o.length;r++){var i=o[r],s=i.indexOf(":"),a=Sn(i.slice(0,s)).toLowerCase(),l=Sn(i.slice(s+1));n[a]===void 0?n[a]=l:(e=n[a],Object.prototype.toString.call(e)==="[object Array]"?n[a].push(l):n[a]=[n[a],l])}return n},hs=as;function Qo(t,e,n){var o=t;return ls(e)?(n=e,typeof t=="string"&&(o={uri:t})):o=hs(e,{uri:t}),o.callback=n,o}function ye(t,e,n){return er(e=Qo(t,e,n))}function er(t){if(t.callback===void 0)throw new Error("callback argument missing");var e=!1,n=function(p,v,h){e||(e=!0,t.callback(p,v,h))};function o(){var p=void 0;if(p=l.response?l.response:l.responseText||function(v){try{if(v.responseType==="document")return v.responseXML;var h=v.responseXML&&v.responseXML.documentElement.nodeName==="parsererror";if(v.responseType===""&&!h)return v.responseXML}catch{}return null}(l),w)try{p=JSON.parse(p)}catch{}return p}function r(p){return clearTimeout(d),p instanceof Error||(p=new Error(""+(p||"Unknown XMLHttpRequest Error"))),p.statusCode=0,n(p,u)}function i(){if(!a){var p;clearTimeout(d),p=t.useXDR&&l.status===void 0?200:l.status===1223?204:l.status;var v=u,h=null;return p!==0?(v={body:o(),statusCode:p,method:S,headers:{},url:b,rawRequest:l},l.getAllResponseHeaders&&(v.headers=us(l.getAllResponseHeaders()))):h=new Error("Internal XMLHttpRequest Error"),n(h,v,v.body)}}var s,a,l=t.xhr||null;l||(l=t.cors||t.useXDR?new ye.XDomainRequest:new ye.XMLHttpRequest);var d,b=l.url=t.uri||t.url,S=l.method=t.method||"GET",x=t.body||t.data,z=l.headers=t.headers||{},T=!!t.sync,w=!1,u={body:void 0,headers:{},statusCode:0,method:S,url:b,rawRequest:l};if("json"in t&&t.json!==!1&&(w=!0,z.accept||z.Accept||(z.Accept="application/json"),S!=="GET"&&S!=="HEAD"&&(z["content-type"]||z["Content-Type"]||(z["Content-Type"]="application/json"),x=JSON.stringify(t.json===!0?x:t.json))),l.onreadystatechange=function(){l.readyState===4&&setTimeout(i,0)},l.onload=i,l.onerror=r,l.onprogress=function(){},l.onabort=function(){a=!0},l.ontimeout=r,l.open(S,b,!T,t.username,t.password),T||(l.withCredentials=!!t.withCredentials),!T&&t.timeout>0&&(d=setTimeout(function(){if(!a){a=!0,l.abort("timeout");var p=new Error("XMLHttpRequest timeout");p.code="ETIMEDOUT",r(p)}},t.timeout)),l.setRequestHeader)for(s in z)z.hasOwnProperty(s)&&l.setRequestHeader(s,z[s]);else if(t.headers&&!function(p){for(var v in p)if(p.hasOwnProperty(v))return!1;return!0}(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(l.responseType=t.responseType),"beforeSend"in t&&typeof t.beforeSend=="function"&&t.beforeSend(l),l.send(x||null),l}_n.exports=ye,_n.exports.default=ye,ye.XMLHttpRequest=Zo.XMLHttpRequest||function(){},ye.XDomainRequest="withCredentials"in new ye.XMLHttpRequest?ye.XMLHttpRequest:Zo.XDomainRequest,function(t,e){for(var n=0;n<t.length;n++)e(t[n])}(["get","put","post","patch","head","delete"],function(t){ye[t==="delete"?"del":t]=function(e,n,o){return(n=Qo(e,n,o)).method=t.toUpperCase(),er(n)}});var ds=ft(_n.exports);const fs=[200,201,202,204,308],ps=[408,502,503,504];class tr{endpoint;file;headers;method;chunkSize;attempts;delayBeforeAttempt;md5;chunk;chunkCount;chunkByteSize;maxFileBytes;endpointValue;totalChunks;attemptCount;offline;paused;success;currentXhr;reader;eventTarget;fileName;constructor(e){this.endpoint=e.endpoint,this.file=e.file,this.fileName=encodeURI(this.file.name),this.headers=e.headers||{},this.method=e.method||"PUT",this.chunkSize=e.chunkSize||5120,this.attempts=e.attempts||5,this.delayBeforeAttempt=e.delayBeforeAttempt||1,this.md5=e.md5||"",this.maxFileBytes=1024*(e.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(e,n){this.eventTarget.on(e,n)}abort(){this.pause(),this.currentXhr?.abort()}pause(){this.paused=!0}resume(){this.paused&&(this.paused=!1,this.sendChunks())}dispatch(e,n){this.eventTarget.emit(e,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(e=>(this.endpointValue=e,this.endpointValue))}getChunk(){return new Promise(e=>{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"})),e(()=>{})},this.reader.readAsArrayBuffer(this.file.slice(o,o+n))})}xhrPromise(e){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=ds({...e,beforeSend:n},(i,s)=>(this.currentXhr=void 0,i?r(i):o(s)))})}sendChunk(){if(!this.chunk)return;const e=this.chunkCount*this.chunkByteSize,n=e+this.chunk.size-1,o={...this.headers,FileName:this.fileName,FileMD5:this.md5,"Content-Type":this.file.type,"Content-Range":`bytes ${e}-${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(e=>{if(this.attemptCount=this.attemptCount+1,e!=null&&fs.includes(e.statusCode)){this.dispatch("chunkSuccess",{chunk:this.chunkCount,attempts:this.attemptCount,response:e}),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(e!=null&&ps.includes(e.statusCode)){if(this.paused||this.offline)return;this.manageRetries()}else{if(this.paused||this.offline)return;console.log(`\u670D\u52A1\u5668\u9519\u8BEF:${e?.statusCode}\uFF0C\u505C\u6B62\u4E0A\u4F20\u3002`),this.dispatch("error",{message:`\u670D\u52A1\u5668\u9519\u8BEF:${e?.statusCode}\uFF0C\u505C\u6B62\u4E0A\u4F20\u3002`,chunkNumber:this.chunkCount,attempts:this.attemptCount})}}).catch(e=>{this.paused||this.offline||this.manageRetries()})}}const gs=new class{hasClass(t,e){return t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}addClass(t,e){this.hasClass(t,e)||(t.className+=" "+e)}removeClass(t,e){if(this.hasClass(t,e)){const n=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(n," ")}}toggleClass(t,e){this.hasClass(t,e)?this.removeClass(t,e):this.addClass(t,e)}setCSSProperty(t,e,n){t?.style.setProperty(e,n)}};class Qe{hproseURL;client;hproseProxy;static httpTransport;constructor(e){if(e&&!pt.isNullOrEmpty(e)){if(Qe.httpTransport||(Qe.httpTransport=new Vi.HttpTransport),this.client=new st.Client(e),!this.client)throw Error("Hprose Client\u521D\u59CB\u5316\u9519\u8BEF");this.hproseURL=e,this.init()}}init(){this.client&&this.client.useServiceAsync().then(e=>{this.hproseProxy=e}).catch(e=>{String(e).indexOf("find this method ~")>0?(this.hproseProxy=this.client?.useService(),console.warn("\u65E7\u7248\u672C\u4E0D\u652F\u6301useServiceAsync")):Ce.emit(re.HproseServiceErrorEvent,"\u521D\u59CB\u5316\u9ED8\u8BA4Hprose!"),console.warn(e)})}async getProxy(){if(!this.hproseProxy)try{this.client&&(this.hproseProxy=await this.client.useServiceAsync())}catch(e){console.warn(e),this.hproseProxy=this.client?.useService()}return this.hproseProxy}async invoke(e,n,o){if(this.client)return await this.client.invoke(e,n,o)}encode(e,n,o){if(this.client)return this.client.codec.encode(e,n,o)}decode(e,n){if(this.client)return this.client.codec.decode(e,n)}}class Ue{hproseClient;hpProxyObj;defaultContext=new st.ClientContext;constructor(e){this.hproseClient=new Qe(e),this.hpProxyObj=null}getClientContext(e,n){const o={};n&&(o.requestHeaders=n);const r=Ee();o.httpRequestHeaders=e||{};const i=o.httpRequestHeaders;return r&&(i.token=r.token),j.SystemID&&(i.sysid=j.SystemID,j.SystemGroup&&(i.sysgroup=j.SystemGroup)),new st.ClientContext(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 e=await this.hproseClient.getProxy();this.hpProxyObj=e}return this.hpProxyObj||Ce.emit(re.HproseServiceErrorEvent,"HproseProxy\u5BF9\u8C61\u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5\uFF01"),this.hpProxyObj}async hproseInvoke(e,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(e,n,o)}async hproseInvokeContext(e,n,...o){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");const r=Ee();return console.log(r,"userToken3"),r&&(n||(n=new st.ClientContext({httpRequestHeaders:{token:r.token}}))),await this.hproseClient.invoke(e,o,n)}async hproseInvokeEncode(e){const n=new ze.ByteStream(e).toBytes(),o=await this.hproseClient.client?.request(n,this.defaultContext);return o&&this.hproseClient.client?.codec.decode(o,this.defaultContext)}encodeRequest(e,...n){const o=this.hproseClient.client?.codec?.encode(e,n,this.defaultContext);return ze.ByteStream.toString(o)}}const Cn=new Map;function nr(t){if(t&&pt.isNotEmpty(t)){if(Cn.has(t))return Cn.get(t);{const e=new Ue(t);return Cn.set(t,e),e}}}const En="is_LockScreen",or=me.get(En,!1),Fe={isLock:or,lockTime:or=="true"?ir():0};function rr(t){Fe.isLock=t,me.set(En,t,10),t&&(wn(),console.log("\u9501\u5C4F\u4E86\u2026\u2026"))}function ir(){let t=3600;return j.Config.UI?.LockTime&&j.Config.UI?.LockTime>=10&&(t=j.Config.UI.LockTime),t}let kn;function xn(){clearInterval(kn),!(window.location.href.indexOf("/login")>0||Fe.isLock)&&(rr(!1),Fe.lockTime=ir(),kn=setInterval(()=>{if(Fe.lockTime--,Fe.lockTime<=0)return rr(!0),clearInterval(kn)},1e3))}function In(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ms={exports:{}},wt=ft(ms.exports=function t(e,n,o){function r(a,l){if(!n[a]){if(!e[a]){if(!l&&In)return In(a);if(i)return i(a,!0);var d=new Error("Cannot find module '"+a+"'");throw d.code="MODULE_NOT_FOUND",d}var b=n[a]={exports:{}};e[a][0].call(b.exports,function(S){var x=e[a][1][S];return r(x||S)},b,b.exports,t,e,n,o)}return n[a].exports}for(var i=In,s=0;s<o.length;s++)r(o[s]);return r}({1:[function(t,e,n){(function(o){var r,i,s=o.MutationObserver||o.WebKitMutationObserver;if(s){var a=0,l=new s(x),d=o.document.createTextNode("");l.observe(d,{characterData:!0}),r=function(){d.data=a=++a%2}}else if(o.setImmediate||o.MessageChannel===void 0)r="document"in o&&"onreadystatechange"in o.document.createElement("script")?function(){var T=o.document.createElement("script");T.onreadystatechange=function(){x(),T.onreadystatechange=null,T.parentNode.removeChild(T),T=null},o.document.documentElement.appendChild(T)}:function(){setTimeout(x,0)};else{var b=new o.MessageChannel;b.port1.onmessage=x,r=function(){b.port2.postMessage(0)}}var S=[];function x(){var T,w;i=!0;for(var u=S.length;u;){for(w=S,S=[],T=-1;++T<u;)w[T]();u=S.length}i=!1}function z(T){S.push(T)!==1||i||r()}e.exports=z}).call(this,Se!==void 0?Se:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(t,e,n){var o=t(1);function r(){}var i={},s=["REJECTED"],a=["FULFILLED"],l=["PENDING"];function d(h){if(typeof h!="function")throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,h!==r&&z(this,h)}function b(h,f,D){this.promise=h,typeof f=="function"&&(this.onFulfilled=f,this.callFulfilled=this.otherCallFulfilled),typeof D=="function"&&(this.onRejected=D,this.callRejected=this.otherCallRejected)}function S(h,f,D){o(function(){var A;try{A=f(D)}catch($){return i.reject(h,$)}A===h?i.reject(h,new TypeError("Cannot resolve promise with itself")):i.resolve(h,A)})}function x(h){var f=h&&h.then;if(h&&(typeof h=="object"||typeof h=="function")&&typeof f=="function")return function(){f.apply(h,arguments)}}function z(h,f){var D=!1;function A(F){D||(D=!0,i.reject(h,F))}function $(F){D||(D=!0,i.resolve(h,F))}function N(){f($,A)}var O=T(N);O.status==="error"&&A(O.value)}function T(h,f){var D={};try{D.value=h(f),D.status="success"}catch(A){D.status="error",D.value=A}return D}function w(h){return h instanceof this?h:i.resolve(new this(r),h)}function u(h){var f=new this(r);return i.reject(f,h)}function p(h){var f=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var D=h.length,A=!1;if(!D)return this.resolve([]);for(var $=new Array(D),N=0,O=-1,F=new this(r);++O<D;)M(h[O],O);return F;function M(W,V){function ne(J){$[V]=J,++N!==D||A||(A=!0,i.resolve(F,$))}f.resolve(W).then(ne,function(J){A||(A=!0,i.reject(F,J))})}}function v(h){var f=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var D=h.length,A=!1;if(!D)return this.resolve([]);for(var $=-1,N=new this(r);++$<D;)O(h[$]);return N;function O(F){f.resolve(F).then(function(M){A||(A=!0,i.resolve(N,M))},function(M){A||(A=!0,i.reject(N,M))})}}e.exports=d,d.prototype.catch=function(h){return this.then(null,h)},d.prototype.then=function(h,f){if(typeof h!="function"&&this.state===a||typeof f!="function"&&this.state===s)return this;var D=new this.constructor(r);return this.state!==l?S(D,this.state===a?h:f,this.outcome):this.queue.push(new b(D,h,f)),D},b.prototype.callFulfilled=function(h){i.resolve(this.promise,h)},b.prototype.otherCallFulfilled=function(h){S(this.promise,this.onFulfilled,h)},b.prototype.callRejected=function(h){i.reject(this.promise,h)},b.prototype.otherCallRejected=function(h){S(this.promise,this.onRejected,h)},i.resolve=function(h,f){var D=T(x,f);if(D.status==="error")return i.reject(h,D.value);var A=D.value;if(A)z(h,A);else{h.state=a,h.outcome=f;for(var $=-1,N=h.queue.length;++$<N;)h.queue[$].callFulfilled(f)}return h},i.reject=function(h,f){h.state=s,h.outcome=f;for(var D=-1,A=h.queue.length;++D<A;)h.queue[D].callRejected(f);return h},d.resolve=w,d.reject=u,d.all=p,d.race=v},{1:1}],3:[function(t,e,n){(function(o){typeof o.Promise!="function"&&(o.Promise=t(2))}).call(this,Se!==void 0?Se:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(t,e,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(_){if(_.name!=="TypeError")throw _;for(var m=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),C=0;C<c.length;C+=1)m.append(c[C]);return m.getBlob(g.type)}}typeof Promise>"u"&&t(3);var d=Promise;function b(c,g){g&&c.then(function(m){g(null,m)},function(m){g(m)})}function S(c,g,m){typeof g=="function"&&c.then(g),typeof m=="function"&&c.catch(m)}function x(c){return typeof c!="string"&&(console.warn(c+" used as a key, but it is not a string."),c=String(c)),c}function z(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var T="local-forage-detect-blob-support",w=void 0,u={},p=Object.prototype.toString,v="readonly",h="readwrite";function f(c){for(var g=c.length,m=new ArrayBuffer(g),C=new Uint8Array(m),_=0;_<g;_++)C[_]=c.charCodeAt(_);return m}function D(c){return new d(function(g){var m=c.transaction(T,h),C=l([""]);m.objectStore(T).put(C,"key"),m.onabort=function(_){_.preventDefault(),_.stopPropagation(),g(!1)},m.oncomplete=function(){var _=navigator.userAgent.match(/Chrome\/(\d+)/),E=navigator.userAgent.match(/Edge\//);g(E||!_||parseInt(_[1],10)>=43)}}).catch(function(){return!1})}function A(c){return typeof w=="boolean"?d.resolve(w):D(c).then(function(g){return w=g})}function $(c){var g=u[c.name],m={};m.promise=new d(function(C,_){m.resolve=C,m.reject=_}),g.deferredOperations.push(m),g.dbReady?g.dbReady=g.dbReady.then(function(){return m.promise}):g.dbReady=m.promise}function N(c){var g=u[c.name].deferredOperations.pop();if(g)return g.resolve(),g.promise}function O(c,g){var m=u[c.name].deferredOperations.pop();if(m)return m.reject(g),m.promise}function F(c,g){return new d(function(m,C){if(u[c.name]=u[c.name]||pe(),c.db){if(!g)return m(c.db);$(c),c.db.close()}var _=[c.name];g&&_.push(c.version);var E=s.open.apply(s,_);g&&(E.onupgradeneeded=function(k){var R=E.result;try{R.createObjectStore(c.storeName),k.oldVersion<=1&&R.createObjectStore(T)}catch(P){if(P.name!=="ConstraintError")throw P;console.warn('The database "'+c.name+'" has been upgraded from version '+k.oldVersion+" to version "+k.newVersion+', but the storage "'+c.storeName+'" already exists.')}}),E.onerror=function(k){k.preventDefault(),C(E.error)},E.onsuccess=function(){var k=E.result;k.onversionchange=function(R){R.target.close()},m(k),N(c)}})}function M(c){return F(c,!1)}function W(c){return F(c,!0)}function V(c,g){if(!c.db)return!0;var m=!c.db.objectStoreNames.contains(c.storeName),C=c.version<c.db.version,_=c.version>c.db.version;if(C&&(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),_||m){if(m){var E=c.db.version+1;E>c.version&&(c.version=E)}return!0}return!1}function ne(c){return new d(function(g,m){var C=new FileReader;C.onerror=m,C.onloadend=function(_){var E=btoa(_.target.result||"");g({__local_forage_encoded_blob:!0,data:E,type:c.type})},C.readAsBinaryString(c)})}function J(c){return l([f(atob(c.data))],{type:c.type})}function Y(c){return c&&c.__local_forage_encoded_blob}function fe(c){var g=this,m=g._initReady().then(function(){var C=u[g._dbInfo.name];if(C&&C.dbReady)return C.dbReady});return S(m,c,c),m}function Pe(c){$(c);for(var g=u[c.name],m=g.forages,C=0;C<m.length;C++){var _=m[C];_._dbInfo.db&&(_._dbInfo.db.close(),_._dbInfo.db=null)}return c.db=null,M(c).then(function(E){return c.db=E,V(c)?W(c):E}).then(function(E){c.db=g.db=E;for(var k=0;k<m.length;k++)m[k]._dbInfo.db=E}).catch(function(E){throw O(c,E),E})}function Q(c,g,m,C){C===void 0&&(C=1);try{var _=c.db.transaction(c.storeName,g);m(null,_)}catch(E){if(C>0&&(!c.db||E.name==="InvalidStateError"||E.name==="NotFoundError"))return d.resolve().then(function(){if(!c.db||E.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 Pe(c).then(function(){Q(c,g,m,C-1)})}).catch(m);m(E)}}function pe(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Ht(c){var g=this,m={db:null};if(c)for(var C in c)m[C]=c[C];var _=u[m.name];_||(_=pe(),u[m.name]=_),_.forages.push(g),g._initReady||(g._initReady=g.ready,g.ready=fe);var E=[];function k(){return d.resolve()}for(var R=0;R<_.forages.length;R++){var P=_.forages[R];P!==g&&E.push(P._initReady().catch(k))}var L=_.forages.slice(0);return d.all(E).then(function(){return m.db=_.db,M(m)}).then(function(B){return m.db=B,V(m,g._defaultConfig.version)?W(m):B}).then(function(B){m.db=_.db=B,g._dbInfo=m;for(var U=0;U<L.length;U++){var q=L[U];q!==g&&(q._dbInfo.db=m.db,q._dbInfo.version=m.version)}})}function qt(c,g){var m=this;c=x(c);var C=new d(function(_,E){m.ready().then(function(){Q(m._dbInfo,v,function(k,R){if(k)return E(k);try{var P=R.objectStore(m._dbInfo.storeName).get(c);P.onsuccess=function(){var L=P.result;L===void 0&&(L=null),Y(L)&&(L=J(L)),_(L)},P.onerror=function(){E(P.error)}}catch(L){E(L)}})}).catch(E)});return b(C,g),C}function Vt(c,g){var m=this,C=new d(function(_,E){m.ready().then(function(){Q(m._dbInfo,v,function(k,R){if(k)return E(k);try{var P=R.objectStore(m._dbInfo.storeName).openCursor(),L=1;P.onsuccess=function(){var B=P.result;if(B){var U=B.value;Y(U)&&(U=J(U));var q=c(U,B.key,L++);q!==void 0?_(q):B.continue()}else _()},P.onerror=function(){E(P.error)}}catch(B){E(B)}})}).catch(E)});return b(C,g),C}function et(c,g,m){var C=this;c=x(c);var _=new d(function(E,k){var R;C.ready().then(function(){return R=C._dbInfo,p.call(g)==="[object Blob]"?A(R.db).then(function(P){return P?g:ne(g)}):g}).then(function(P){Q(C._dbInfo,h,function(L,B){if(L)return k(L);try{var U=B.objectStore(C._dbInfo.storeName);P===null&&(P=void 0);var q=U.put(P,c);B.oncomplete=function(){P===void 0&&(P=null),E(P)},B.onabort=B.onerror=function(){var X=q.error?q.error:q.transaction.error;k(X)}}catch(X){k(X)}})}).catch(k)});return b(_,m),_}function Ne(c,g){var m=this;c=x(c);var C=new d(function(_,E){m.ready().then(function(){Q(m._dbInfo,h,function(k,R){if(k)return E(k);try{var P=R.objectStore(m._dbInfo.storeName).delete(c);R.oncomplete=function(){_()},R.onerror=function(){E(P.error)},R.onabort=function(){var L=P.error?P.error:P.transaction.error;E(L)}}catch(L){E(L)}})}).catch(E)});return b(C,g),C}function Be(c){var g=this,m=new d(function(C,_){g.ready().then(function(){Q(g._dbInfo,h,function(E,k){if(E)return _(E);try{var R=k.objectStore(g._dbInfo.storeName).clear();k.oncomplete=function(){C()},k.onabort=k.onerror=function(){var P=R.error?R.error:R.transaction.error;_(P)}}catch(P){_(P)}})}).catch(_)});return b(m,c),m}function ue(c){var g=this,m=new d(function(C,_){g.ready().then(function(){Q(g._dbInfo,v,function(E,k){if(E)return _(E);try{var R=k.objectStore(g._dbInfo.storeName).count();R.onsuccess=function(){C(R.result)},R.onerror=function(){_(R.error)}}catch(P){_(P)}})}).catch(_)});return b(m,c),m}function tt(c,g){var m=this,C=new d(function(_,E){c<0?_(null):m.ready().then(function(){Q(m._dbInfo,v,function(k,R){if(k)return E(k);try{var P=R.objectStore(m._dbInfo.storeName),L=!1,B=P.openKeyCursor();B.onsuccess=function(){var U=B.result;U?c===0||L?_(U.key):(L=!0,U.advance(c)):_(null)},B.onerror=function(){E(B.error)}}catch(U){E(U)}})}).catch(E)});return b(C,g),C}function nt(c){var g=this,m=new d(function(C,_){g.ready().then(function(){Q(g._dbInfo,v,function(E,k){if(E)return _(E);try{var R=k.objectStore(g._dbInfo.storeName).openKeyCursor(),P=[];R.onsuccess=function(){var L=R.result;L?(P.push(L.key),L.continue()):C(P)},R.onerror=function(){_(R.error)}}catch(L){_(L)}})}).catch(_)});return b(m,c),m}function je(c,g){g=z.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 C,_=this;if(c.name){var E=c.name===m.name&&_._dbInfo.db?d.resolve(_._dbInfo.db):M(c).then(function(k){var R=u[c.name],P=R.forages;R.db=k;for(var L=0;L<P.length;L++)P[L]._dbInfo.db=k;return k});C=c.storeName?E.then(function(k){if(k.objectStoreNames.contains(c.storeName)){var R=k.version+1;$(c);var P=u[c.name],L=P.forages;k.close();for(var B=0;B<L.length;B++){var U=L[B];U._dbInfo.db=null,U._dbInfo.version=R}var q=new d(function(X,G){var oe=s.open(c.name,R);oe.onerror=function(ge){oe.result.close(),G(ge)},oe.onupgradeneeded=function(){oe.result.deleteObjectStore(c.storeName)},oe.onsuccess=function(){var ge=oe.result;ge.close(),X(ge)}});return q.then(function(X){P.db=X;for(var G=0;G<L.length;G++){var oe=L[G];oe._dbInfo.db=X,N(oe._dbInfo)}}).catch(function(X){throw(O(c,X)||d.resolve()).catch(function(){}),X})}}):E.then(function(k){$(c);var R=u[c.name],P=R.forages;k.close();for(var L=0;L<P.length;L++)P[L]._dbInfo.db=null;var B=new d(function(U,q){var X=s.deleteDatabase(c.name);X.onerror=function(){var G=X.result;G&&G.close(),q(X.error)},X.onblocked=function(){console.warn('dropInstance blocked for database "'+c.name+'" until all open connections are closed')},X.onsuccess=function(){var G=X.result;G&&G.close(),U(G)}});return B.then(function(U){R.db=U;for(var q=0;q<P.length;q++)N(P[q]._dbInfo)}).catch(function(U){throw(O(c,U)||d.resolve()).catch(function(){}),U})})}else C=d.reject("Invalid arguments");return b(C,g),C}var ot={_driver:"asyncStorage",_initStorage:Ht,_support:a(),iterate:Vt,getItem:qt,setItem:et,removeItem:Ne,clear:Be,length:ue,key:tt,keys:nt,dropInstance:je};function Oe(){return typeof openDatabase=="function"}var he="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",si="~~local_forage_type~",ho=/^~~local_forage_type~([^~]+)~/,rt="__lfsc__:",Xt=rt.length,Gt="arbf",Kt="blob",fo="si08",po="ui08",go="uic8",mo="si16",vo="si32",yo="ur16",wo="ui32",bo="fl32",_o="fl64",So=Xt+Gt.length,Co=Object.prototype.toString;function Eo(c){var g,m,C,_,E,k=.75*c.length,R=c.length,P=0;c[c.length-1]==="="&&(k--,c[c.length-2]==="="&&k--);var L=new ArrayBuffer(k),B=new Uint8Array(L);for(g=0;g<R;g+=4)m=he.indexOf(c[g]),C=he.indexOf(c[g+1]),_=he.indexOf(c[g+2]),E=he.indexOf(c[g+3]),B[P++]=m<<2|C>>4,B[P++]=(15&C)<<4|_>>2,B[P++]=(3&_)<<6|63&E;return L}function Jt(c){var g,m=new Uint8Array(c),C="";for(g=0;g<m.length;g+=3)C+=he[m[g]>>2],C+=he[(3&m[g])<<4|m[g+1]>>4],C+=he[(15&m[g+1])<<2|m[g+2]>>6],C+=he[63&m[g+2]];return m.length%3==2?C=C.substring(0,C.length-1)+"=":m.length%3==1&&(C=C.substring(0,C.length-2)+"=="),C}function ai(c,g){var m="";if(c&&(m=Co.call(c)),c&&(m==="[object ArrayBuffer]"||c.buffer&&Co.call(c.buffer)==="[object ArrayBuffer]")){var C,_=rt;c instanceof ArrayBuffer?(C=c,_+=Gt):(C=c.buffer,m==="[object Int8Array]"?_+=fo:m==="[object Uint8Array]"?_+=po:m==="[object Uint8ClampedArray]"?_+=go:m==="[object Int16Array]"?_+=mo:m==="[object Uint16Array]"?_+=yo:m==="[object Int32Array]"?_+=vo:m==="[object Uint32Array]"?_+=wo:m==="[object Float32Array]"?_+=bo:m==="[object Float64Array]"?_+=_o:g(new Error("Failed to get type for BinaryArray"))),g(_+Jt(C))}else if(m==="[object Blob]"){var E=new FileReader;E.onload=function(){var k=si+c.type+"~"+Jt(this.result);g(rt+Kt+k)},E.readAsArrayBuffer(c)}else try{g(JSON.stringify(c))}catch(k){console.error("Couldn't convert value into a JSON string: ",c),g(null,k)}}function ci(c){if(c.substring(0,Xt)!==rt)return JSON.parse(c);var g,m=c.substring(So),C=c.substring(Xt,So);if(C===Kt&&ho.test(m)){var _=m.match(ho);g=_[1],m=m.substring(_[0].length)}var E=Eo(m);switch(C){case Gt:return E;case Kt:return l([E],{type:g});case fo:return new Int8Array(E);case po:return new Uint8Array(E);case go:return new Uint8ClampedArray(E);case mo:return new Int16Array(E);case yo:return new Uint16Array(E);case vo:return new Int32Array(E);case wo:return new Uint32Array(E);case bo:return new Float32Array(E);case _o:return new Float64Array(E);default:throw new Error("Unkown type: "+C)}}var Yt={serialize:ai,deserialize:ci,stringToBuffer:Eo,bufferToString:Jt};function ko(c,g,m,C){c.executeSql("CREATE TABLE IF NOT EXISTS "+g.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],m,C)}function li(c){var g=this,m={db:null};if(c)for(var C in c)m[C]=typeof c[C]!="string"?c[C].toString():c[C];var _=new d(function(E,k){try{m.db=openDatabase(m.name,String(m.version),m.description,m.size)}catch(R){return k(R)}m.db.transaction(function(R){ko(R,m,function(){g._dbInfo=m,E()},function(P,L){k(L)})},k)});return m.serializer=Yt,_}function we(c,g,m,C,_,E){c.executeSql(m,C,_,function(k,R){R.code===R.SYNTAX_ERR?k.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[g.storeName],function(P,L){L.rows.length?E(P,R):ko(P,g,function(){P.executeSql(m,C,_,E)},E)},E):E(k,R)},E)}function ui(c,g){var m=this;c=x(c);var C=new d(function(_,E){m.ready().then(function(){var k=m._dbInfo;k.db.transaction(function(R){we(R,k,"SELECT * FROM "+k.storeName+" WHERE key = ? LIMIT 1",[c],function(P,L){var B=L.rows.length?L.rows.item(0).value:null;B&&(B=k.serializer.deserialize(B)),_(B)},function(P,L){E(L)})})}).catch(E)});return b(C,g),C}function hi(c,g){var m=this,C=new d(function(_,E){m.ready().then(function(){var k=m._dbInfo;k.db.transaction(function(R){we(R,k,"SELECT * FROM "+k.storeName,[],function(P,L){for(var B=L.rows,U=B.length,q=0;q<U;q++){var X=B.item(q),G=X.value;if(G&&(G=k.serializer.deserialize(G)),(G=c(G,X.key,q+1))!==void 0)return void _(G)}_()},function(P,L){E(L)})})}).catch(E)});return b(C,g),C}function xo(c,g,m,C){var _=this;c=x(c);var E=new d(function(k,R){_.ready().then(function(){g===void 0&&(g=null);var P=g,L=_._dbInfo;L.serializer.serialize(g,function(B,U){U?R(U):L.db.transaction(function(q){we(q,L,"INSERT OR REPLACE INTO "+L.storeName+" (key, value) VALUES (?, ?)",[c,B],function(){k(P)},function(X,G){R(G)})},function(q){if(q.code===q.QUOTA_ERR){if(C>0)return void k(xo.apply(_,[c,P,m,C-1]));R(q)}})})}).catch(R)});return b(E,m),E}function di(c,g,m){return xo.apply(this,[c,g,m,1])}function fi(c,g){var m=this;c=x(c);var C=new d(function(_,E){m.ready().then(function(){var k=m._dbInfo;k.db.transaction(function(R){we(R,k,"DELETE FROM "+k.storeName+" WHERE key = ?",[c],function(){_()},function(P,L){E(L)})})}).catch(E)});return b(C,g),C}function pi(c){var g=this,m=new d(function(C,_){g.ready().then(function(){var E=g._dbInfo;E.db.transaction(function(k){we(k,E,"DELETE FROM "+E.storeName,[],function(){C()},function(R,P){_(P)})})}).catch(_)});return b(m,c),m}function gi(c){var g=this,m=new d(function(C,_){g.ready().then(function(){var E=g._dbInfo;E.db.transaction(function(k){we(k,E,"SELECT COUNT(key) as c FROM "+E.storeName,[],function(R,P){var L=P.rows.item(0).c;C(L)},function(R,P){_(P)})})}).catch(_)});return b(m,c),m}function mi(c,g){var m=this,C=new d(function(_,E){m.ready().then(function(){var k=m._dbInfo;k.db.transaction(function(R){we(R,k,"SELECT key FROM "+k.storeName+" WHERE id = ? LIMIT 1",[c+1],function(P,L){var B=L.rows.length?L.rows.item(0).key:null;_(B)},function(P,L){E(L)})})}).catch(E)});return b(C,g),C}function vi(c){var g=this,m=new d(function(C,_){g.ready().then(function(){var E=g._dbInfo;E.db.transaction(function(k){we(k,E,"SELECT key FROM "+E.storeName,[],function(R,P){for(var L=[],B=0;B<P.rows.length;B++)L.push(P.rows.item(B).key);C(L)},function(R,P){_(P)})})}).catch(_)});return b(m,c),m}function yi(c){return new d(function(g,m){c.transaction(function(C){C.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(_,E){for(var k=[],R=0;R<E.rows.length;R++)k.push(E.rows.item(R).name);g({db:c,storeNames:k})},function(_,E){m(E)})},function(C){m(C)})})}function wi(c,g){g=z.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 C,_=this;return C=c.name?new d(function(E){var k;k=c.name===m.name?_._dbInfo.db:openDatabase(c.name,"","",0),c.storeName?E({db:k,storeNames:[c.storeName]}):E(yi(k))}).then(function(E){return new d(function(k,R){E.db.transaction(function(P){function L(X){return new d(function(G,oe){P.executeSql("DROP TABLE IF EXISTS "+X,[],function(){G()},function(ge,en){oe(en)})})}for(var B=[],U=0,q=E.storeNames.length;U<q;U++)B.push(L(E.storeNames[U]));d.all(B).then(function(){k()}).catch(function(X){R(X)})},function(P){R(P)})})}):d.reject("Invalid arguments"),b(C,g),C}var bi={_driver:"webSQLStorage",_initStorage:li,_support:Oe(),iterate:hi,getItem:ui,setItem:di,removeItem:fi,clear:pi,length:gi,key:mi,keys:vi,dropInstance:wi};function _i(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Io(c,g){var m=c.name+"/";return c.storeName!==g.storeName&&(m+=c.storeName+"/"),m}function Si(){var c="_localforage_support_test";try{return localStorage.setItem(c,!0),localStorage.removeItem(c),!1}catch{return!0}}function Ci(){return!Si()||localStorage.length>0}function Ei(c){var g=this,m={};if(c)for(var C in c)m[C]=c[C];return m.keyPrefix=Io(c,g._defaultConfig),Ci()?(g._dbInfo=m,m.serializer=Yt,d.resolve()):d.reject()}function ki(c){var g=this,m=g.ready().then(function(){for(var C=g._dbInfo.keyPrefix,_=localStorage.length-1;_>=0;_--){var E=localStorage.key(_);E.indexOf(C)===0&&localStorage.removeItem(E)}});return b(m,c),m}function xi(c,g){var m=this;c=x(c);var C=m.ready().then(function(){var _=m._dbInfo,E=localStorage.getItem(_.keyPrefix+c);return E&&(E=_.serializer.deserialize(E)),E});return b(C,g),C}function Ii(c,g){var m=this,C=m.ready().then(function(){for(var _=m._dbInfo,E=_.keyPrefix,k=E.length,R=localStorage.length,P=1,L=0;L<R;L++){var B=localStorage.key(L);if(B.indexOf(E)===0){var U=localStorage.getItem(B);if(U&&(U=_.serializer.deserialize(U)),(U=c(U,B.substring(k),P++))!==void 0)return U}}});return b(C,g),C}function Ti(c,g){var m=this,C=m.ready().then(function(){var _,E=m._dbInfo;try{_=localStorage.key(c)}catch{_=null}return _&&(_=_.substring(E.keyPrefix.length)),_});return b(C,g),C}function Mi(c){var g=this,m=g.ready().then(function(){for(var C=g._dbInfo,_=localStorage.length,E=[],k=0;k<_;k++){var R=localStorage.key(k);R.indexOf(C.keyPrefix)===0&&E.push(R.substring(C.keyPrefix.length))}return E});return b(m,c),m}function Ri(c){var g=this.keys().then(function(m){return m.length});return b(g,c),g}function Pi(c,g){var m=this;c=x(c);var C=m.ready().then(function(){var _=m._dbInfo;localStorage.removeItem(_.keyPrefix+c)});return b(C,g),C}function Li(c,g,m){var C=this;c=x(c);var _=C.ready().then(function(){g===void 0&&(g=null);var E=g;return new d(function(k,R){var P=C._dbInfo;P.serializer.serialize(g,function(L,B){if(B)R(B);else try{localStorage.setItem(P.keyPrefix+c,L),k(E)}catch(U){U.name!=="QuotaExceededError"&&U.name!=="NS_ERROR_DOM_QUOTA_REACHED"||R(U),R(U)}})})});return b(_,m),_}function zi(c,g){if(g=z.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 C,_=this;return C=c.name?new d(function(E){c.storeName?E(Io(c,_._defaultConfig)):E(c.name+"/")}).then(function(E){for(var k=localStorage.length-1;k>=0;k--){var R=localStorage.key(k);R.indexOf(E)===0&&localStorage.removeItem(R)}}):d.reject("Invalid arguments"),b(C,g),C}var Di={_driver:"localStorageWrapper",_initStorage:Ei,_support:_i(),iterate:Ii,getItem:xi,setItem:Li,removeItem:Pi,clear:ki,length:Ri,key:Ti,keys:Mi,dropInstance:zi},Ai=function(c,g){return c===g||typeof c=="number"&&typeof g=="number"&&isNaN(c)&&isNaN(g)},$i=function(c,g){for(var m=c.length,C=0;C<m;){if(Ai(c[C],g))return!0;C++}return!1},To=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"},We={},Mo={},Le={INDEXEDDB:ot,WEBSQL:bi,LOCALSTORAGE:Di},Ni=[Le.INDEXEDDB._driver,Le.WEBSQL._driver,Le.LOCALSTORAGE._driver],it=["dropInstance"],Zt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(it),Bi={description:"",driver:Ni.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function ji(c,g){c[g]=function(){var m=arguments;return c.ready().then(function(){return c[g].apply(c,m)})}}function Qt(){for(var c=1;c<arguments.length;c++){var g=arguments[c];if(g)for(var m in g)g.hasOwnProperty(m)&&(To(g[m])?arguments[0][m]=g[m].slice():arguments[0][m]=g[m])}return arguments[0]}var Oi=function(){function c(g){for(var m in r(this,c),Le)if(Le.hasOwnProperty(m)){var C=Le[m],_=C._driver;this[m]=_,We[_]||this.defineDriver(C)}this._defaultConfig=Qt({},Bi),this._config=Qt({},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,C){var _=new d(function(E,k){try{var R=g._driver,P=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!g._driver)return void k(P);for(var L=Zt.concat("_initStorage"),B=0,U=L.length;B<U;B++){var q=L[B];if((!$i(it,q)||g[q])&&typeof g[q]!="function")return void k(P)}var X=function(){for(var oe=function(Ui){return function(){var Fi=new Error("Method "+Ui+" is not implemented by the current driver"),Ro=d.reject(Fi);return b(Ro,arguments[arguments.length-1]),Ro}},ge=0,en=it.length;ge<en;ge++){var tn=it[ge];g[tn]||(g[tn]=oe(tn))}};X();var G=function(oe){We[R]&&console.info("Redefining LocalForage driver: "+R),We[R]=g,Mo[R]=oe,E()};"_support"in g?g._support&&typeof g._support=="function"?g._support().then(G,k):G(!!g._support):G(!0)}catch(oe){k(oe)}});return S(_,m,C),_},c.prototype.driver=function(){return this._driver||null},c.prototype.getDriver=function(g,m,C){var _=We[g]?d.resolve(We[g]):d.reject(new Error("Driver not found."));return S(_,m,C),_},c.prototype.getSerializer=function(g){var m=d.resolve(Yt);return S(m,g),m},c.prototype.ready=function(g){var m=this,C=m._driverSet.then(function(){return m._ready===null&&(m._ready=m._initDriver()),m._ready});return S(C,g,g),C},c.prototype.setDriver=function(g,m,C){var _=this;To(g)||(g=[g]);var E=this._getSupportedDrivers(g);function k(){_._config.driver=_.driver()}function R(B){return _._extend(B),k(),_._ready=_._initStorage(_._config),_._ready}function P(B){return function(){var U=0;function q(){for(;U<B.length;){var X=B[U];return U++,_._dbInfo=null,_._ready=null,_.getDriver(X).then(R).catch(q)}k();var G=new Error("No available storage method found.");return _._driverSet=d.reject(G),_._driverSet}return q()}}var L=this._driverSet!==null?this._driverSet.catch(function(){return d.resolve()}):d.resolve();return this._driverSet=L.then(function(){var B=E[0];return _._dbInfo=null,_._ready=null,_.getDriver(B).then(function(U){_._driver=U._driver,k(),_._wrapLibraryMethodsWithReady(),_._initDriver=P(E)})}).catch(function(){k();var B=new Error("No available storage method found.");return _._driverSet=d.reject(B),_._driverSet}),S(this._driverSet,m,C),this._driverSet},c.prototype.supports=function(g){return!!Mo[g]},c.prototype._extend=function(g){Qt(this,g)},c.prototype._getSupportedDrivers=function(g){for(var m=[],C=0,_=g.length;C<_;C++){var E=g[C];this.supports(E)&&m.push(E)}return m},c.prototype._wrapLibraryMethodsWithReady=function(){for(var g=0,m=Zt.length;g<m;g++)ji(this,Zt[g])},c.prototype.createInstance=function(g){return new c(g)},c}(),Wi=new Oi;e.exports=Wi},{3:3}]},{},[4])(4)),sr={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
|
-
*/(function(t){((e,n)=>{t.exports=n()})(0,()=>{const e=typeof window=="object"?window:this;e.HTMLElement||console.warn("streamsaver is meant to run on browsers main thread");let n=null,o=!1;const r=e.WebStreamsPolyfill||{},i=e.isSecureContext;let s=/constructor/i.test(e.HTMLElement)||!!e.safari||!!e.WebKitPoint;const a=i||"MozAppearance"in document.documentElement.style?"iframe":"navigate",l={createWriteStream:function(b,S,x){let L={size:null,pathname:null,writableStrategy:void 0,readableStrategy:void 0},T=0,w=null,u=null,p=null;if(Number.isFinite(S)?([x,S]=[S,x],console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),L.size=x,L.writableStrategy=S):S&&S.highWaterMark?(console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),L.size=x,L.writableStrategy=S):L=S||{},!s){n||(n=i?d(l.mitm):function(D){const $="width=200,height=100",A=document.createDocumentFragment(),B={frame:e.open(D,"popup",$),loaded:!1,isIframe:!1,isPopup:!0,remove(){B.frame.close()},addEventListener(...F){A.addEventListener(...F)},dispatchEvent(...F){A.dispatchEvent(...F)},removeEventListener(...F){A.removeEventListener(...F)},postMessage(...F){B.frame.postMessage(...F)}},O=F=>{F.source===B.frame&&(B.loaded=!0,e.removeEventListener("message",O),B.dispatchEvent(new Event("load")))};return e.addEventListener("message",O),B}(l.mitm)),u=new MessageChannel,b=encodeURIComponent(b.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A");const h={transferringReadable:o,pathname:L.pathname||Math.random().toString().slice(-6)+"/"+b,headers:{"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+b}};L.size&&(h.headers["Content-Length"]=L.size);const f=[h,"*",[u.port2]];if(o){const D=a==="iframe"?void 0:{transform(A,B){if(!(A instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");T+=A.length,B.enqueue(A),w&&(location.href=w,w=null)},flush(){w&&(location.href=w)}};p=new l.TransformStream(D,L.writableStrategy,L.readableStrategy);const $=p.readable;u.port1.postMessage({readableStream:$},[$])}u.port1.onmessage=D=>{D.data.download?a==="navigate"?(n.remove(),n=null,T?location.href=D.data.download:w=D.data.download):(n.isPopup&&(n.remove(),n=null,a==="iframe"&&d(l.mitm)),d(D.data.download)):D.data.abort&&(v=[],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 v=[];return!s&&p&&p.writable||new l.WritableStream({write(h){if(!(h instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");s?v.push(h):(u.port1.postMessage(h),T+=h.length,w&&(location.href=w,w=null))},close(){if(s){const h=new Blob(v,{type:"application/octet-stream; charset=utf-8"}),f=document.createElement("a");f.href=URL.createObjectURL(h),f.download=b,f.click()}else u.port1.postMessage("end")},abort(){v=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null}},L.writableStrategy)},WritableStream:e.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 d(b){if(!b)throw new Error("meh");const S=document.createElement("iframe");return S.hidden=!0,S.src=b,S.loaded=!1,S.name="iframe",S.isIframe=!0,S.postMessage=(...x)=>S.contentWindow.postMessage(...x),S.addEventListener("load",()=>{S.loaded=!0},{once:!0}),document.body.appendChild(S),S}try{new Response(new ReadableStream),i&&!("serviceWorker"in navigator)&&(s=!0)}catch{s=!0}return(b=>{try{b()}catch{}})(()=>{const{readable:b}=new TransformStream,S=new MessageChannel;S.port1.postMessage(b,[b]),S.port1.close(),S.port2.close(),o=!0,Object.defineProperty(l,"TransformStream",{configurable:!1,writable:!1,value:TransformStream})}),l})})(sr);var vs=ft(sr.exports);function ys(t,e){const n=`${t}_${e}`;return se.MD5(n)}function ar(t){const e=function(a){if(!a)return;const l=a,d=[];if(l)for(let b of l){const S=cr(b);S&&d.push(S)}return d}(t.bussinessRoutes),n=function(a){if(!a)return;const l=a;if(l&&l.length>0){const d=[];return l.forEach(b=>{const S=lr(b);S&&d.push(S)}),d}}(t.widgetMenuConfig),o=function(a){if(a&&a.length>0){const l=[];return a.forEach(d=>{const b=function(S){return S?{id:S.id,label:S.label,container:S.container,preload:S.preload,afterid:S.afterid,bindid:S.bindid,group:S.group}:void 0}(d);b&&l.push(b)}),l}}(t.widgetConfig),r=function(a){if(a&&a.length>0)return a}(t.functionList),i=t.pkgObject.version,s=t.pkgObject.name;return{id:ys(s,i),name:j.Config.UI.SiteTitle,group:j.Config.UI.Group,product:s,version:i,routes:e,widgetMenu:n,widgets:o,functions:r}}function cr(t){if(t){let e=0;t.meta?.hidden&&(e=1);let n={path:t.path,name:t.name,title:t.meta?.title,type:e,index:t.meta?.index};if(t.children){const o=[];for(let r of t.children){const i=cr(r);i&&o.push(i)}o.length>0&&(n.children=o)}return n}}function lr(t){if(!t)return;const e={name:t.name,index:t.index,path:t.path,type:t.type};return t.children&&t.children.length>0&&(e.children=[],t.children.forEach(n=>{const o=lr(n);o&&e.children?.push(o)})),e}function Tn(t){let e=t.replace(/(^\s*)|(\s*$)/g,"");return e=e.replace(/[^\d.]/g,""),e=e.replace(/^0{2}$/g,"0"),e=e.replace(/^\./g,""),e=e.replace(".","$#$").replace(/\./g,"").replace("$#$","."),e=e.replace(/^(\-)*(\d+)\.(\d\d).*$/,"$1$2.$3"),e}let ur=!0;try{String.fromCharCode.apply(String,[1,2])}catch{ur=!1,Object.defineProperty(Array.prototype,"subarray",{value:Array.prototype.slice})}var Rn=2654435769;function hr(t,e){var n=t.length,o=n<<2;if(e){var r=t[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]=t[s>>2]>>((3&s)<<3);return i}function bt(t,e){var n,o=t.length,r=o>>2;3&o&&++r,e?(n=new Uint32Array(r+1))[r]=o:n=new Uint32Array(r);for(var i=0;i<o;++i)n[i>>2]|=t[i]<<((3&i)<<3);return n}function ke(t){return 4294967295&t}function _t(t,e,n,o,r,i){return(n>>>5^e<<2)+(e>>>3^n<<4)^(t^e)+(i[3&o^r]^n)}function dr(t){if(t.length<16){var e=new Uint8Array(16);e.set(t),t=e}return t}function St(t){for(var e=t.length,n=new Uint8Array(3*e),o=0,r=0;r<e;r++){var i=t.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<e){var s=t.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 fr(t){var e=t.length;return e===0?"":e<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 d=((7&l)<<18|(63&n[s++])<<12|(63&n[s++])<<6|63&n[s++])-65536;if(!(0<=d&&d<=1048575))throw new Error("Character outside valid Unicode range: 0x"+d.toString(16));r[i++]=d>>10&1023|55296,r[i]=1023&d|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)}(t,e):function(n,o){for(var r=[],i=new Array(32768),s=0,a=0,l=n.length;s<o&&a<l;s++){var d=n[a++];switch(d>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:i[s]=d;break;case 12:case 13:if(!(a<l))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(31&d)<<6|63&n[a++];break;case 14:if(!(a+1<l))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(15&d)<<12|(63&n[a++])<<6|63&n[a++];break;case 15:if(!(a+2<l))throw new Error("Unfinished UTF-8 octet sequence");var b=((7&d)<<18|(63&n[a++])<<12|(63&n[a++])<<6|63&n[a++])-65536;if(!(0<=b&&b<=1048575))throw new Error("Character outside valid Unicode range: 0x"+b.toString(16));i[s++]=b>>10&1023|55296,i[s]=1023&b|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+d.toString(16))}if(s>=32766){var S=s+1;i.length=S,r.push(String.fromCharCode.apply(String,i)),o-=S,s=-1}}return s>0&&(i.length=s,r.push(String.fromCharCode.apply(String,i))),r.join("")}(t,e)}function ws(t){var e=t.length;if(e===0)return"";var n=ur?t:function(a){for(var l=a.length,d=new Array(a.length),b=0;b<l;++b)d[b]=a[b];return d}(t);if(e<65535)return String.fromCharCode.apply(String,n);for(var o=32767&e,r=e>>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,e))),i.join("")}function pr(t,e){return typeof t=="string"&&(t=St(t)),typeof e=="string"&&(e=St(e)),t==null||t.length===0?t:hr(function(n,o){var r,i,s,a,l,d,b=n.length,S=b-1;for(i=n[S],s=0,d=0|Math.floor(6+52/b);d>0;--d){for(a=(s=ke(s+Rn))>>>2&3,l=0;l<S;++l)r=n[l+1],i=n[l]=ke(n[l]+_t(s,r,i,l,a,o));r=n[0],i=n[S]=ke(n[S]+_t(s,r,i,S,a,o))}return n}(bt(t,!0),bt(dr(e),!1)),!1)}function gr(t,e){return typeof t=="string"&&(t=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}(t)),typeof e=="string"&&(e=St(e)),t==null||t.length===0?t:hr(function(n,o){var r,i,s,a,l,d=n.length,b=d-1;for(r=n[0],s=ke(Math.floor(6+52/d)*Rn);s!==0;s=ke(s-Rn)){for(a=s>>>2&3,l=b;l>0;--l)i=n[l-1],r=n[l]=ke(n[l]-_t(s,r,i,l,a,o));i=n[b],r=n[0]=ke(n[0]-_t(s,r,i,0,a,o))}return n}(bt(t,!1),bt(dr(e),!1)),!0)}const He={toBytes:St,toString:fr,encrypt:pr,encryptToString:function(t,e){return window.btoa(ws(pr(t,e)))},decrypt:gr,decryptToString:function(t,e){return fr(gr(t,e))}},mr=t=>{const e="1.23452384164.123412416";document.getElementById(e)!==null&&document.body.removeChild(document.getElementById(e));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(t,n.width/10,n.height/2);const r=document.createElement("div");return r.id=e,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),e},bs={set:t=>{let e=mr(t);document.getElementById(e)===null&&(e=mr(t))},del:()=>{let t="1.23452384164.123412416";document.getElementById(t)!==null&&document.body.removeChild(document.getElementById(t))}};class xe extends Error{constructor(e,n){const o=new.target.prototype;super(`${e}: Status code '${n}'`),this.statusCode=n,this.__proto__=o}}class Mn extends Error{constructor(e="A timeout occurred."){const n=new.target.prototype;super(e),this.__proto__=n}}class de extends Error{constructor(e="An abort occurred."){const n=new.target.prototype;super(e),this.__proto__=n}}class _s extends Error{constructor(e,n){const o=new.target.prototype;super(e),this.transport=n,this.errorType="UnsupportedTransportError",this.__proto__=o}}class Ss extends Error{constructor(e,n){const o=new.target.prototype;super(e),this.transport=n,this.errorType="DisabledTransportError",this.__proto__=o}}class Cs extends Error{constructor(e,n){const o=new.target.prototype;super(e),this.transport=n,this.errorType="FailedToStartTransportError",this.__proto__=o}}class vr extends Error{constructor(e){const n=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=n}}class Es extends Error{constructor(e,n){const o=new.target.prototype;super(e),this.innerErrors=n,this.__proto__=o}}class yr{constructor(e,n,o){this.statusCode=e,this.statusText=n,this.content=o}}class Ct{get(e,n){return this.send({...n,method:"GET",url:e})}post(e,n){return this.send({...n,method:"POST",url:e})}delete(e,n){return this.send({...n,method:"DELETE",url:e})}getCookieString(e){return""}}var I;(function(t){t[t.Trace=0]="Trace",t[t.Debug=1]="Debug",t[t.Information=2]="Information",t[t.Warning=3]="Warning",t[t.Error=4]="Error",t[t.Critical=5]="Critical",t[t.None=6]="None"})(I||(I={}));class qe{constructor(){}log(e,n){}}qe.instance=new qe;class ee{static isRequired(e,n){if(e==null)throw new Error(`The '${n}' argument is required.`)}static isNotEmpty(e,n){if(!e||e.match(/^\s*$/))throw new Error(`The '${n}' argument should not be empty.`)}static isIn(e,n,o){if(!(e in n))throw new Error(`Unknown ${o} value: ${e}.`)}}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 Ve(t,e){let n="";return Ie(t)?(n=`Binary data of length ${t.byteLength}`,e&&(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)}(t)}'`)):typeof t=="string"&&(n=`String data of length ${t.length}`,e&&(n+=`. Content: '${t}'`)),n}function Ie(t){return t&&typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||t.constructor&&t.constructor.name==="ArrayBuffer")}async function wr(t,e,n,o,r,i){const s={},[a,l]=De();s[a]=l,t.log(I.Trace,`(${e} transport) sending data. ${Ve(r,i.logMessageContent)}.`);const d=Ie(r)?"arraybuffer":"text",b=await n.post(o,{content:r,headers:{...s,...i.headers},responseType:d,timeout:i.timeout,withCredentials:i.withCredentials});t.log(I.Trace,`(${e} transport) request complete. Response status: ${b.statusCode}.`)}class ks{constructor(e,n){this._subject=e,this._observer=n}dispose(){const e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(n=>{})}}class Et{constructor(e){this._minLevel=e,this.out=console}log(e,n){if(e>=this._minLevel){const o=`[${new Date().toISOString()}] ${I[e]}: ${n}`;switch(e){case I.Critical:case I.Error:this.out.error(o);break;case I.Warning:this.out.warn(o);break;case I.Information:this.out.info(o);break;default:this.out.log(o)}}}}function De(){let t="X-SignalR-User-Agent";return Z.isNode&&(t="User-Agent"),[t,xs("8.0.7",Is(),Rs(),Ts())]}function xs(t,e,n,o){let r="Microsoft SignalR/";const i=t.split(".");return r+=`${i[0]}.${i[1]}`,r+=` (${t}; `,r+=e&&e!==""?`${e}; `:"Unknown OS; ",r+=`${n}`,r+=o?`; ${o}`:"; Unknown Runtime Version",r+=")",r}function Is(){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 Ts(){if(Z.isNode)return process.versions.node}function Rs(){return Z.isNode?"NodeJS":"Browser"}function Pn(t){return t.stack?t.stack:t.message?t.message:`${t}`}class Ms extends Ct{constructor(e){if(super(),this._logger=e,typeof fetch>"u"||Z.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(e){if(e.abortSignal&&e.abortSignal.aborted)throw new de;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");const n=new this._abortControllerType;let o;e.abortSignal&&(e.abortSignal.onabort=()=>{n.abort(),o=new de});let r,i=null;if(e.timeout){const l=e.timeout;i=setTimeout(()=>{n.abort(),this._logger.log(I.Warning,"Timeout from HTTP request."),o=new Mn},l)}e.content===""&&(e.content=void 0),e.content&&(e.headers=e.headers||{},Ie(e.content)?e.headers["Content-Type"]="application/octet-stream":e.headers["Content-Type"]="text/plain;charset=UTF-8");try{r=await this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:e.withCredentials===!0?"include":"same-origin",headers:{"X-Requested-With":"XMLHttpRequest",...e.headers},method:e.method,mode:"cors",redirect:"follow",signal:n.signal})}catch(l){throw o||(this._logger.log(I.Warning,`Error from HTTP request. ${l}.`),l)}finally{i&&clearTimeout(i),e.abortSignal&&(e.abortSignal.onabort=null)}if(!r.ok){const l=await br(r,"text");throw new xe(l||r.statusText,r.status)}const s=br(r,e.responseType),a=await s;return new yr(r.status,r.statusText,a)}getCookieString(e){let n="";return Z.isNode&&this._jar&&this._jar.getCookies(e,(o,r)=>n=r.join("; ")),n}}function br(t,e){let n;switch(e){case"arraybuffer":n=t.arrayBuffer();break;case"text":default:n=t.text();break;case"blob":case"document":case"json":throw new Error(`${e} is not supported.`)}return n}class Ps extends Ct{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new de):e.method?e.url?new Promise((n,o)=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),r.withCredentials=e.withCredentials===void 0||e.withCredentials,r.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.content===""&&(e.content=void 0),e.content&&(Ie(e.content)?r.setRequestHeader("Content-Type","application/octet-stream"):r.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const i=e.headers;i&&Object.keys(i).forEach(s=>{r.setRequestHeader(s,i[s])}),e.responseType&&(r.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{r.abort(),o(new de)}),e.timeout&&(r.timeout=e.timeout),r.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),r.status>=200&&r.status<300?n(new yr(r.status,r.statusText,r.response||r.responseText)):o(new xe(r.response||r.responseText||r.statusText,r.status))},r.onerror=()=>{this._logger.log(I.Warning,`Error from HTTP request. ${r.status}: ${r.statusText}.`),o(new xe(r.statusText,r.status))},r.ontimeout=()=>{this._logger.log(I.Warning,"Timeout from HTTP request."),o(new Mn)},r.send(e.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class zs extends Ct{constructor(e){if(super(),typeof fetch<"u"||Z.isNode)this._httpClient=new Ms(e);else{if(typeof XMLHttpRequest>"u")throw new Error("No usable HttpClient found.");this._httpClient=new Ps(e)}}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new de):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}}class le{static write(e){return`${e}${le.RecordSeparator}`}static parse(e){if(e[e.length-1]!==le.RecordSeparator)throw new Error("Message is incomplete.");const n=e.split(le.RecordSeparator);return n.pop(),n}}le.RecordSeparatorCode=30,le.RecordSeparator=String.fromCharCode(le.RecordSeparatorCode);class Ls{writeHandshakeRequest(e){return le.write(JSON.stringify(e))}parseHandshakeResponse(e){let n,o;if(Ie(e)){const s=new Uint8Array(e),a=s.indexOf(le.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=e,a=s.indexOf(le.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=le.parse(n),i=JSON.parse(r[0]);if(i.type)throw new Error("Expected a handshake response from the server.");return[o,i]}}var H;(function(t){t[t.Invocation=1]="Invocation",t[t.StreamItem=2]="StreamItem",t[t.Completion=3]="Completion",t[t.StreamInvocation=4]="StreamInvocation",t[t.CancelInvocation=5]="CancelInvocation",t[t.Ping=6]="Ping",t[t.Close=7]="Close",t[t.Ack=8]="Ack",t[t.Sequence=9]="Sequence"})(H||(H={}));class Ds{constructor(){this.observers=[]}next(e){for(const n of this.observers)n.next(e)}error(e){for(const n of this.observers)n.error&&n.error(e)}complete(){for(const e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new ks(this,e)}}class $s{constructor(e,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=e,this._connection=n,this._bufferSize=o}async _send(e){const n=this._protocol.writeMessage(e);let o=Promise.resolve();if(this._isInvocationMessage(e)){this._totalMessageCount++;let r=()=>{},i=()=>{};Ie(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 As(n,this._totalMessageCount,r,i))}try{this._reconnectInProgress||await this._connection.send(n)}catch{this._disconnected()}await o}_ack(e){let n=-1;for(let o=0;o<this._messages.length;o++){const r=this._messages[o];if(r._id<=e.sequenceId)n=o,Ie(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(e){if(this._waitForSequenceMessage)return e.type===H.Sequence&&(this._waitForSequenceMessage=!1,!0);if(!this._isInvocationMessage(e))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(e){e.sequenceId>this._nextReceivingSequenceId?this._connection.stop(new Error("Sequence ID greater than amount of messages we've received.")):this._nextReceivingSequenceId=e.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}async _resend(){const e=this._messages.length!==0?this._messages[0]._id:this._totalMessageCount+1;await this._connection.send(this._protocol.writeMessage({type:H.Sequence,sequenceId:e}));const n=this._messages;for(const o of n)await this._connection.send(o._message);this._reconnectInProgress=!1}_dispose(e){e!=null||(e=new Error("Unable to reconnect to server."));for(const n of this._messages)n._rejector(e)}_isInvocationMessage(e){switch(e.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 As{constructor(e,n,o,r){this._message=e,this._id=n,this._resolver=o,this._rejector=r}}var K;(function(t){t.Disconnected="Disconnected",t.Connecting="Connecting",t.Connected="Connected",t.Disconnecting="Disconnecting",t.Reconnecting="Reconnecting"})(K||(K={}));class lo{static create(e,n,o,r,i,s,a){return new lo(e,n,o,r,i,s,a)}constructor(e,n,o,r,i,s,a){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(I.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")},ee.isRequired(e,"connection"),ee.isRequired(n,"logger"),ee.isRequired(o,"protocol"),this.serverTimeoutInMilliseconds=i??3e4,this.keepAliveIntervalInMilliseconds=s??15e3,this._statefulReconnectBufferSize=a??1e5,this._logger=n,this._protocol=o,this.connection=e,this._reconnectPolicy=r,this._handshakeProtocol=new Ls,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=K.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(e){if(this._connectionState!==K.Disconnected&&this._connectionState!==K.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}async _startWithStateTransitions(){if(this._connectionState!==K.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=K.Connecting,this._logger.log(I.Debug,"Starting HubConnection.");try{await this._startInternal(),Z.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=K.Connected,this._connectionStarted=!0,this._logger.log(I.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=K.Disconnected,this._logger.log(I.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}}async _startInternal(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;const e=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(I.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(o)),this._logger.log(I.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await e,this._stopDuringStartError)throw this._stopDuringStartError;this.connection.features.reconnect&&(this._messageBuffer=new $s(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(I.Debug,`Hub handshake failed with error '${n}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(n),n}}async stop(){const e=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),await this._stopPromise;try{await e}catch{}}_stopInternal(e){if(this._connectionState===K.Disconnected)return this._logger.log(I.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===K.Disconnecting)return this._logger.log(I.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;const n=this._connectionState;return this._connectionState=K.Disconnecting,this._logger.log(I.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(I.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(n===K.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new de("The connection was stopped before the hub handshake could complete."),this.connection.stop(e))}async _sendCloseMessage(){try{await this._sendWithProtocol(this._createCloseMessage())}catch{}}stream(e,...n){const[o,r]=this._replaceStreamingParams(n),i=this._createStreamInvocation(e,n,r);let s;const a=new Ds;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,d)=>{d?a.error(d):l&&(l.type===H.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(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._messageBuffer?this._messageBuffer._send(e):this._sendMessage(this._protocol.writeMessage(e))}send(e,...n){const[o,r]=this._replaceStreamingParams(n),i=this._sendWithProtocol(this._createInvocation(e,n,!0,r));return this._launchStreams(o,i),i}invoke(e,...n){const[o,r]=this._replaceStreamingParams(n),i=this._createInvocation(e,n,!1,r);return new Promise((a,l)=>{this._callbacks[i.invocationId]=(b,S)=>{S?l(S):b&&(b.type===H.Completion?b.error?l(new Error(b.error)):a(b.result):l(new Error(`Unexpected message type: ${b.type}`)))};const d=this._sendWithProtocol(i).catch(b=>{l(b),delete this._callbacks[i.invocationId]});this._launchStreams(o,d)})}on(e,n){e&&n&&(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),this._methods[e].indexOf(n)===-1&&this._methods[e].push(n))}off(e,n){if(!e)return;e=e.toLowerCase();const o=this._methods[e];if(o)if(n){const r=o.indexOf(n);r!==-1&&(o.splice(r,1),o.length===0&&delete this._methods[e])}else delete this._methods[e]}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e){const n=this._protocol.parseMessages(e,this._logger);for(const o of n)if(!this._messageBuffer||this._messageBuffer._shouldProcessMessage(o))switch(o.type){case H.Invocation:this._invokeClientMethod(o).catch(r=>{this._logger.log(I.Error,`Invoke client method threw error: ${Pn(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(I.Error,`Stream callback threw error: ${Pn(i)}`)}}break}case H.Ping:break;case H.Close:{this._logger.log(I.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(I.Warning,`Invalid message type: ${o.type}.`)}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let n,o;try{[o,n]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(r){const i="Error parsing handshake response: "+r;this._logger.log(I.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(I.Error,r);const i=new Error(r);throw this._handshakeRejecter(i),i}return this._logger.log(I.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 e=this._nextKeepAlive-new Date().getTime();e<0&&(e=0),this._pingServerHandle=setTimeout(async()=>{if(this._connectionState===K.Connected)try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}},e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}async _invokeClientMethod(e){const n=e.target.toLowerCase(),o=this._methods[n];if(!o)return this._logger.log(I.Warning,`No client method with the name '${n}' found.`),void(e.invocationId&&(this._logger.log(I.Warning,`No result given for '${n}' method and invocation ID '${e.invocationId}'.`),await this._sendWithProtocol(this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null))));const r=o.slice(),i=!!e.invocationId;let s,a,l;for(const d of r)try{const b=s;s=await d.apply(this,e.arguments),i&&s&&b&&(this._logger.log(I.Error,`Multiple results provided for '${n}'. Sending error to server.`),l=this._createCompletionMessage(e.invocationId,"Client provided multiple results.",null)),a=void 0}catch(b){a=b,this._logger.log(I.Error,`A callback for the method '${n}' threw error '${b}'.`)}l?await this._sendWithProtocol(l):i?(a?l=this._createCompletionMessage(e.invocationId,`${a}`,null):s!==void 0?l=this._createCompletionMessage(e.invocationId,null,s):(this._logger.log(I.Warning,`No result given for '${n}' method and invocation ID '${e.invocationId}'.`),l=this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)),await this._sendWithProtocol(l)):s&&this._logger.log(I.Error,`Result given for '${n}' method but server is not expecting a result.`)}_connectionClosed(e){this._logger.log(I.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new de("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===K.Disconnecting?this._completeClose(e):this._connectionState===K.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===K.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=K.Disconnected,this._connectionStarted=!1,this._messageBuffer&&(this._messageBuffer._dispose(e??new Error("Connection closed.")),this._messageBuffer=void 0),Z.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(n=>n.apply(this,[e]))}catch(n){this._logger.log(I.Error,`An onclose callback called with error '${e}' threw error '${n}'.`)}}}async _reconnect(e){const n=Date.now();let o=0,r=e!==void 0?e:new Error("Attempting to reconnect due to a unknown error."),i=this._getNextRetryDelay(o++,0,r);if(i===null)return this._logger.log(I.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(e);if(this._connectionState=K.Reconnecting,e?this._logger.log(I.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(I.Information,"Connection reconnecting."),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(s=>s.apply(this,[e]))}catch(s){this._logger.log(I.Error,`An onreconnecting callback called with error '${e}' threw error '${s}'.`)}if(this._connectionState!==K.Reconnecting)return void this._logger.log(I.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;i!==null;){if(this._logger.log(I.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!==K.Reconnecting)return void this._logger.log(I.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=K.Connected,this._logger.log(I.Information,"HubConnection reconnected successfully."),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(s=>s.apply(this,[this.connection.connectionId]))}catch(s){this._logger.log(I.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${s}'.`)}return}catch(s){if(this._logger.log(I.Information,`Reconnect attempt failed because of error '${s}'.`),this._connectionState!==K.Reconnecting)return this._logger.log(I.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this._connectionState===K.Disconnecting&&this._completeClose());r=s instanceof Error?s:new Error(s.toString()),i=this._getNextRetryDelay(o++,Date.now()-n,r)}}this._logger.log(I.Information,`Reconnect retries have been exhausted after ${Date.now()-n} ms and ${o} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(e,n,o){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:n,previousRetryCount:e,retryReason:o})}catch(r){return this._logger.log(I.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${n}) threw error '${r}'.`),null}}_cancelCallbacksWithError(e){const n=this._callbacks;this._callbacks={},Object.keys(n).forEach(o=>{const r=n[o];try{r(null,e)}catch(i){this._logger.log(I.Error,`Stream 'error' callback called with '${e}' threw error: ${Pn(i)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,n,o,r){if(o)return r.length!==0?{arguments:n,streamIds:r,target:e,type:H.Invocation}:{arguments:n,target:e,type:H.Invocation};{const i=this._invocationId;return this._invocationId++,r.length!==0?{arguments:n,invocationId:i.toString(),streamIds:r,target:e,type:H.Invocation}:{arguments:n,invocationId:i.toString(),target:e,type:H.Invocation}}}_launchStreams(e,n){if(e.length!==0){n||(n=Promise.resolve());for(const o in e)e[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(e){const n=[],o=[];for(let r=0;r<e.length;r++){const i=e[r];if(this._isObservable(i)){const s=this._invocationId;this._invocationId++,n[s]=i,o.push(s.toString()),e.splice(r,1)}}return[n,o]}_isObservable(e){return e&&e.subscribe&&typeof e.subscribe=="function"}_createStreamInvocation(e,n,o){const r=this._invocationId;return this._invocationId++,o.length!==0?{arguments:n,invocationId:r.toString(),streamIds:o,target:e,type:H.StreamInvocation}:{arguments:n,invocationId:r.toString(),target:e,type:H.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:H.CancelInvocation}}_createStreamItemMessage(e,n){return{invocationId:e,item:n,type:H.StreamItem}}_createCompletionMessage(e,n,o){return n?{error:n,invocationId:e,type:H.Completion}:{invocationId:e,result:o,type:H.Completion}}_createCloseMessage(){return{type:H.Close}}}const Bs=[0,2e3,1e4,3e4,null];class _r{constructor(e){this._retryDelays=e!==void 0?[...e,null]:Bs}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}}class Te{}Te.Authorization="Authorization",Te.Cookie="Cookie";class Ns extends Ct{constructor(e,n){super(),this._innerClient=e,this._accessTokenFactory=n}async send(e){let n=!0;this._accessTokenFactory&&(!this._accessToken||e.url&&e.url.indexOf("/negotiate?")>0)&&(n=!1,this._accessToken=await this._accessTokenFactory()),this._setAuthorizationHeader(e);const o=await this._innerClient.send(e);return n&&o.statusCode===401&&this._accessTokenFactory?(this._accessToken=await this._accessTokenFactory(),this._setAuthorizationHeader(e),await this._innerClient.send(e)):o}_setAuthorizationHeader(e){e.headers||(e.headers={}),this._accessToken?e.headers[Te.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[Te.Authorization]&&delete e.headers[Te.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}}var te,re;(function(t){t[t.None=0]="None",t[t.WebSockets=1]="WebSockets",t[t.ServerSentEvents=2]="ServerSentEvents",t[t.LongPolling=4]="LongPolling"})(te||(te={})),function(t){t[t.Text=1]="Text",t[t.Binary=2]="Binary"}(re||(re={}));class js{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(e,n,o){this._httpClient=e,this._logger=n,this._pollAbort=new js,this._options=o,this._running=!1,this.onreceive=null,this.onclose=null}async connect(e,n){if(ee.isRequired(e,"url"),ee.isRequired(n,"transferFormat"),ee.isIn(n,re,"transferFormat"),this._url=e,this._logger.log(I.Trace,"(LongPolling transport) Connecting."),n===re.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]=De(),i={[o]:r,...this._options.headers},s={abortSignal:this._pollAbort.signal,headers:i,timeout:1e5,withCredentials:this._options.withCredentials};n===re.Binary&&(s.responseType="arraybuffer");const a=`${e}&_=${Date.now()}`;this._logger.log(I.Trace,`(LongPolling transport) polling: ${a}.`);const l=await this._httpClient.get(a,s);l.statusCode!==200?(this._logger.log(I.Error,`(LongPolling transport) Unexpected response code: ${l.statusCode}.`),this._closeError=new xe(l.statusText||"",l.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,s)}async _poll(e,n){try{for(;this._running;)try{const o=`${e}&_=${Date.now()}`;this._logger.log(I.Trace,`(LongPolling transport) polling: ${o}.`);const r=await this._httpClient.get(o,n);r.statusCode===204?(this._logger.log(I.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):r.statusCode!==200?(this._logger.log(I.Error,`(LongPolling transport) Unexpected response code: ${r.statusCode}.`),this._closeError=new xe(r.statusText||"",r.statusCode),this._running=!1):r.content?(this._logger.log(I.Trace,`(LongPolling transport) data received. ${Ve(r.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(r.content)):this._logger.log(I.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(o){this._running?o instanceof Mn?this._logger.log(I.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=o,this._running=!1):this._logger.log(I.Trace,`(LongPolling transport) Poll errored after shutdown: ${o.message}`)}}finally{this._logger.log(I.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(e){return this._running?wr(this._logger,"LongPolling",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(I.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(I.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const e={},[n,o]=De();e[n]=o;const r={headers:{...e,...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 xe&&(i.statusCode===404?this._logger.log(I.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this._logger.log(I.Trace,`(LongPolling transport) Error sending a DELETE request: ${i}`)):this._logger.log(I.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this._logger.log(I.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(I.Trace,e),this.onclose(this._closeError)}}}class Os{constructor(e,n,o,r){this._httpClient=e,this._accessToken=n,this._logger=o,this._options=r,this.onreceive=null,this.onclose=null}async connect(e,n){return ee.isRequired(e,"url"),ee.isRequired(n,"transferFormat"),ee.isIn(n,re,"transferFormat"),this._logger.log(I.Trace,"(SSE transport) Connecting."),this._url=e,this._accessToken&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise((o,r)=>{let i,s=!1;if(n===re.Text){if(Z.isBrowser||Z.isWebWorker)i=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{const a=this._httpClient.getCookieString(e),l={};l.Cookie=a;const[d,b]=De();l[d]=b,i=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:{...l,...this._options.headers}})}try{i.onmessage=a=>{if(this.onreceive)try{this._logger.log(I.Trace,`(SSE transport) data received. ${Ve(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(I.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(e){return this._eventSource?wr(this._logger,"SSE",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}}class Ws{constructor(e,n,o,r,i,s){this._logger=o,this._accessTokenFactory=n,this._logMessageContent=r,this._webSocketConstructor=i,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=s}async connect(e,n){let o;return ee.isRequired(e,"url"),ee.isRequired(n,"transferFormat"),ee.isIn(n,re,"transferFormat"),this._logger.log(I.Trace,"(WebSockets transport) Connecting."),this._accessTokenFactory&&(o=await this._accessTokenFactory()),new Promise((r,i)=>{let s;e=e.replace(/^http/,"ws");const a=this._httpClient.getCookieString(e);let l=!1;if(Z.isNode||Z.isReactNative){const d={},[b,S]=De();d[b]=S,o&&(d[Te.Authorization]=`Bearer ${o}`),a&&(d[Te.Cookie]=a),s=new this._webSocketConstructor(e,void 0,{headers:{...d,...this._headers}})}else o&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(o)}`);s||(s=new this._webSocketConstructor(e)),n===re.Binary&&(s.binaryType="arraybuffer"),s.onopen=d=>{this._logger.log(I.Information,`WebSocket connected to ${e}.`),this._webSocket=s,l=!0,r()},s.onerror=d=>{let b=null;b=typeof ErrorEvent<"u"&&d instanceof ErrorEvent?d.error:"There was an error with the transport",this._logger.log(I.Information,`(WebSockets transport) ${b}.`)},s.onmessage=d=>{if(this._logger.log(I.Trace,`(WebSockets transport) data received. ${Ve(d.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(d.data)}catch(b){return void this._close(b)}},s.onclose=d=>{if(l)this._close(d);else{let b=null;b=typeof ErrorEvent<"u"&&d instanceof ErrorEvent?d.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(b))}}})}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(I.Trace,`(WebSockets transport) sending data. ${Ve(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(I.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this._isCloseEvent(e)||e.wasClean!==!1&&e.code===1e3?e instanceof Error?this.onclose(e):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)))}_isCloseEvent(e){return e&&typeof e.wasClean=="boolean"&&typeof e.code=="number"}}class Us{constructor(e,n={}){var o;if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,ee.isRequired(e,"url"),this._logger=(o=n.logger)===void 0?new Et(I.Information):o===null?qe.instance:o.log!==void 0?o:new Et(o),this.baseUrl=this._resolveUrl(e),(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(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"||n.WebSocket?Z.isNode&&!n.WebSocket&&r&&(n.WebSocket=r):n.WebSocket=WebSocket,Z.isNode||typeof EventSource>"u"||n.EventSource?Z.isNode&&!n.EventSource&&i!==void 0&&(n.EventSource=i):n.EventSource=EventSource,this._httpClient=new Ns(n.httpClient||new zs(this._logger),n.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=n,this.onreceive=null,this.onclose=null}async start(e){if(e=e||re.Binary,ee.isIn(e,re,"transferFormat"),this._logger.log(I.Debug,`Starting connection with transfer format '${re[e]}'.`),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(e),await this._startInternalPromise,this._connectionState==="Disconnecting"){const n="Failed to start the HttpConnection before stop() was called.";return this._logger.log(I.Error,n),await this._stopPromise,Promise.reject(new de(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(I.Error,n),Promise.reject(new de(n))}this._connectionStarted=!0}send(e){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 uo(this.transport)),this._sendQueue.send(e))}async stop(e){return this._connectionState==="Disconnected"?(this._logger.log(I.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):this._connectionState==="Disconnecting"?(this._logger.log(I.Debug,`Call to HttpConnection.stop(${e}) 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(e),void await this._stopPromise)}async _stopInternal(e){this._stopError=e;try{await this._startInternalPromise}catch{}if(this.transport){try{await this.transport.stop()}catch(n){this._logger.log(I.Error,`HttpConnection.transport.stop() threw error '${n}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(I.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(e){let n=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==te.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(te.WebSockets),await this._startTransport(n,e)}else{let o=null,r=0;do{if(o=await this._getNegotiationResponse(n),this._connectionState==="Disconnecting"||this._connectionState==="Disconnected")throw new de("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,e)}this.transport instanceof Sr&&(this.features.inherentKeepAlive=!0),this._connectionState==="Connecting"&&(this._logger.log(I.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(o){return this._logger.log(I.Error,"Failed to start the connection: "+o),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(o)}}async _getNegotiationResponse(e){const n={},[o,r]=De();n[o]=r;const i=this._resolveNegotiateUrl(e);this._logger.log(I.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 vr("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 xe&&s.statusCode===404&&(a+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(I.Error,a),Promise.reject(new vr(a))}}_createConnectUrl(e,n){return n?e+(e.indexOf("?")===-1?"?":"&")+`id=${n}`:e}async _createTransport(e,n,o,r){let i=this._createConnectUrl(e,o.connectionToken);if(this._isITransport(n))return this._logger.log(I.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 d of a){const b=this._resolveTransportOrError(d,n,r,l?.useStatefulReconnect===!0);if(b instanceof Error)s.push(`${d.transport} failed:`),s.push(b);else if(this._isITransport(b)){if(this.transport=b,!l){try{l=await this._getNegotiationResponse(e)}catch(S){return Promise.reject(S)}i=this._createConnectUrl(e,l.connectionToken)}try{return await this._startTransport(i,r),void(this.connectionId=l.connectionId)}catch(S){if(this._logger.log(I.Error,`Failed to start the transport '${d.transport}': ${S}`),l=void 0,s.push(new Cs(`${d.transport} failed: ${S}`,te[d.transport])),this._connectionState!=="Connecting"){const x="Failed to select transport before stop() was called.";return this._logger.log(I.Debug,x),Promise.reject(new de(x))}}}}return s.length>0?Promise.reject(new Es(`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(e){switch(e){case te.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new Ws(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case te.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new Os(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case te.LongPolling:return new Sr(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,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(e,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(e,n)}_resolveTransportOrError(e,n,o,r){const i=te[e.transport];if(i==null)return this._logger.log(I.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(!function(s,a){return!s||(a&s)!=0}(n,i))return this._logger.log(I.Debug,`Skipping transport '${te[i]}' because it was disabled by the client.`),new Ss(`'${te[i]}' is disabled by the client.`,i);{if(!(e.transferFormats.map(a=>re[a]).indexOf(o)>=0))return this._logger.log(I.Debug,`Skipping transport '${te[i]}' because it does not support the requested transfer format '${re[o]}'.`),new Error(`'${te[i]}' does not support ${re[o]}.`);if(i===te.WebSockets&&!this._options.WebSocket||i===te.ServerSentEvents&&!this._options.EventSource)return this._logger.log(I.Debug,`Skipping transport '${te[i]}' because it is not supported in your environment.'`),new _s(`'${te[i]}' is not supported in your environment.`,i);this._logger.log(I.Debug,`Selecting transport '${te[i]}'.`);try{return this.features.reconnect=i===te.WebSockets?r:void 0,this._constructTransport(i)}catch(a){return a}}}_isITransport(e){return e&&typeof e=="object"&&"connect"in e}_stopConnection(e){if(this._logger.log(I.Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,this._connectionState!=="Disconnected"){if(this._connectionState==="Connecting")throw this._logger.log(I.Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if(this._connectionState==="Disconnecting"&&this._stopPromiseResolver(),e?this._logger.log(I.Error,`Connection disconnected with error '${e}'.`):this._logger.log(I.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(n=>{this._logger.log(I.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(e)}catch(n){this._logger.log(I.Error,`HttpConnection.onclose(${e}) threw error '${n}'.`)}}}else this._logger.log(I.Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`)}_resolveUrl(e){if(e.lastIndexOf("https://",0)===0||e.lastIndexOf("http://",0)===0)return e;if(!Z.isBrowser)throw new Error(`Cannot resolve '${e}'.`);const n=window.document.createElement("a");return n.href=e,this._logger.log(I.Information,`Normalizing '${e}' to '${n.href}'.`),n.href}_resolveNegotiateUrl(e){const n=new URL(e);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 uo{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new kt,this._transportResult=new kt,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new kt),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}async _sendLoop(){for(;;){if(await this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new kt;const e=this._transportResult;this._transportResult=void 0;const n=typeof this._buffer[0]=="string"?this._buffer.join(""):uo._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(n),e.resolve()}catch(o){e.reject(o)}}}static _concatBuffers(e){const n=e.map(i=>i.byteLength).reduce((i,s)=>i+s),o=new Uint8Array(n);let r=0;for(const i of e)o.set(new Uint8Array(i),r),r+=i.byteLength;return o.buffer}}class kt{constructor(){this.promise=new Promise((e,n)=>[this._resolver,this._rejecter]=[e,n])}resolve(){this._resolver()}reject(e){this._rejecter(e)}}class Fs{constructor(){this.name="json",this.version=2,this.transferFormat=re.Text}parseMessages(e,n){if(typeof e!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];n===null&&(n=qe.instance);const o=le.parse(e),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:n.log(I.Information,"Unknown message type '"+s.type+"' ignored.");continue}r.push(s)}return r}writeMessage(e){return le.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,"Invalid payload for Invocation message."),e.invocationId!==void 0&&this._assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),e.item===void 0)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this._assertNotEmptyString(e.error,"Invalid payload for Completion message."),this._assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")}_isAckMessage(e){if(typeof e.sequenceId!="number")throw new Error("Invalid SequenceId for Ack message.")}_isSequenceMessage(e){if(typeof e.sequenceId!="number")throw new Error("Invalid SequenceId for Sequence message.")}_assertNotEmptyString(e,n){if(typeof e!="string"||e==="")throw new Error(n)}}const Hs={trace:I.Trace,debug:I.Debug,info:I.Information,information:I.Information,warn:I.Warning,warning:I.Warning,error:I.Error,critical:I.Critical,none:I.None};class qs{configureLogging(e){if(ee.isRequired(e,"logging"),e.log!==void 0)this.logger=e;else if(typeof e=="string"){const n=function(o){const r=Hs[o.toLowerCase()];if(r!==void 0)return r;throw new Error(`Unknown log level: ${o}`)}(e);this.logger=new Et(n)}else this.logger=new Et(e);return this}withUrl(e,n){return ee.isRequired(e,"url"),ee.isNotEmpty(e,"url"),this.url=e,this.httpConnectionOptions=typeof n=="object"?{...this.httpConnectionOptions,...n}:{...this.httpConnectionOptions,transport:n},this}withHubProtocol(e){return ee.isRequired(e,"protocol"),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new _r(e):this.reconnectPolicy=e:this.reconnectPolicy=new _r,this}withServerTimeout(e){return ee.isRequired(e,"milliseconds"),this._serverTimeoutInMilliseconds=e,this}withKeepAliveInterval(e){return ee.isRequired(e,"milliseconds"),this._keepAliveIntervalInMilliseconds=e,this}withStatefulReconnect(e){return this.httpConnectionOptions===void 0&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=e?.bufferSize,this}build(){const e=this.httpConnectionOptions||{};if(e.logger===void 0&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const n=new Us(this.url,e);return lo.create(n,this.logger||qe.instance,this.protocol||new Fs,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}}let xt;const zn=new Set;function Cr(t){return t!==null?parseFloat(t):0}function It(t){const e=window.getComputedStyle(t),n=Math.ceil([e.paddingLeft,e.width,e.paddingRight].map(Cr).reduce((r,i)=>r+i)),o=Math.ceil([e.paddingTop,e.height,e.paddingBottom].map(Cr).reduce((r,i)=>r+i));return{width:n,height:o}}class Er{width;height;constructor(e,n){this.width=e,this.height=n}}function Vs(t){const e=t.windowEl;if(e){const n=parseFloat(e.style.left||"NaN"),o=parseFloat(e.style.top||"NaN");if(!isNaN(n)&&!isNaN(o))return{left:n,top:o}}return null}function Xs(t,e,n,o){const r=t-n,i=e-o;return r*r+i*i}window.addEventListener("resize",t=>{zn.forEach(e=>{e&&ht(e.fixPosition)&&e.fixPosition()})});const Tt=[];var Rt=y.defineComponent({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:ut},setup(t,{emit:e}){const n=y.getCurrentInstance();if(!n)return;const{proxy:o}=n;let r=0,i,s,a;const l=y.ref(t.isOpen),d=()=>{Tt.push(o),a=new Yi(t.zGroup,b),t.isOpen&&function($){$&&(y.nextTick(()=>{r++==0&&(v(o),function(){const A=S.value,{width:B,height:O}=rn(A);let F,R;if(t.left!==void 0!=(t.top!==void 0))throw new Error("Either of left or top is specified. Both must be set or not set.");if(typeof t.left=="number")F=t.left,R=t.top;else{const W=t.positionHint||"auto";switch(W){case"auto":{let V=20,ne=50,J=0;do{if(Tt.every(Y=>{if(!Y.isOpen||o==Y)return!0;const fe=Vs(Y);if(fe==null)return!0;const{left:Pe,top:Q}=fe;return Xs(Pe,Q,V,ne)>16}))break;V=(V+40)%(window.innerWidth-200),ne=(ne+40)%(window.innerHeight-200)}while(++J<100);F=V,R=ne}break;case"center":F=(window.innerWidth-B)/2,R=(window.innerHeight-O)/2,console.log(F,R,window.innerWidth,window.innerHeight,"111111");break;default:try{const V=W.split("/").map(Number);if(V.length!=2)throw null;const[ne,J]=V;if(!isFinite(ne)||!isFinite(J))throw null;F=ne>=0?ne:window.innerWidth-B+ne,R=J>=0?J:window.innerHeight-O+J}catch{throw new Error(`invalid position string: ${W}`)}}}A&&(A.style.left=`${F}px`,A.style.top=`${R}px`)}()),t.resizable&&h(),D(),i=new Ji(x.value,S.value,{onMove:()=>D(),onMoveStart:()=>e("move-start"),onMoveEnd:()=>e("move-end")}),t.resizable&&function(){const{height:A}=rn(x.value);s=new Zi(S.value,{onResize:()=>h(),onResizeStart:()=>e("resize-start"),onResizeEnd:()=>e("resize-end"),minWidth:t.minWidth,minHeight:t.minHeight+A,maxWidth:t.maxWidth,maxHeight:t.maxHeight?t.maxHeight+A:void 0})}()}),t.activateWhenOpen&&T())}(!0),zn.add(o)};function b($){w.value.zIndex=`${$}`}const S=y.ref(null),x=y.ref(null),L=y.ref(null);function T(){a.raise(),e("activate")}const w=y.ref({...t.windowStyle.window,zIndex:"auto",overflow:t.overflow}),u=y.computed(()=>t.windowStyle.titlebar),p=y.computed(()=>{const $={...t.windowStyle.content};return t.resizable?$.padding="0":t.padding!=null&&($.padding=`${t.padding}px`),t.isScrollable&&($.overflow="auto"),$});function v($){const{width:A,height:B,top:O,left:F}=$,R=S;if(R&&A!=null&&(R.value.style.width=`${A}px`),B!=null){const W=x.value;if(W){const V=It(W).height;R.value.style.height=`${B+V}px`}}R&&F!=null&&(R.value.style.left=`${F}px`),R&&O!=null&&(R.value.style.top=`${O}px`)}function h($=!0){const A=S.value,B=x.value,O=L.value;if(O&&A&&B){const{width:F,height:R}=It(O),{width:W,height:V}=It(A),ne=It(B).height,J=W-(O.offsetWidth-F),Y=V-ne-(O.offsetHeight-R);O.style.width=`${J}px`,O.style.height=`${Y}px`,f(),e("resize",new Er(J,Y)),$&&(e("update:width",J),e("update:height",Y))}}function f(){const $=S.value;if($){const A=$.getBoundingClientRect();A.left<0&&(w.value.left="0px"),A.top<0&&(w.value.top="0px"),A.right>window.innerWidth&&(w.value.left=window.innerWidth-A.width+"px"),A.bottom>window.innerHeight&&(w.value.top=window.innerHeight-A.height+"px")}}function D($=!0){f();const A=S.value;if(A){const{left:B,top:O}=A.getBoundingClientRect();$&&(e("update:left",B),e("update:top",O))}}return y.watch(()=>t.isOpen,$=>{l.value=$}),y.watch(()=>t.zGroup,$=>{a.group=$}),y.watch(()=>t.width,$=>{v({width:$}),h(!1)}),y.watch(()=>t.height,$=>{v({height:$}),h(!1)}),y.onMounted(()=>{d()}),y.onBeforeUnmount(()=>{zn.delete(this),a.unregister(),s&&s.teardown(),i&&i.teardown(),Tt.splice(Tt.indexOf(o),1)}),{isOpen:l,windowEl:S,titlebar:x,content:L,activate:T,styleWindow:w,styleTitlebar:u,styleContent:p,closeButtonClick:function(){l.value=!1,e("closebuttonclick")},fixPosition:f}}});const Gs={class:"title"};var kr;Rt.render=function(t,e,n,o,r,i){const s=y.resolveComponent("myButton");return y.openBlock(),y.createBlock(y.Transition,{name:"fade",onAfterLeave:e[2]||(e[2]=a=>t.$emit("close")),onAfterEnter:e[3]||(e[3]=a=>t.$emit("open")),persisted:""},{default:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:"window",style:y.normalizeStyle(t.styleWindow),ref:"windowEl",onMousedown:e[0]||(e[0]=(...a)=>t.activate&&t.activate(...a)),onTouchstart:e[1]||(e[1]=(...a)=>t.activate&&t.activate(...a))},[y.createElementVNode("div",{class:"titlebar",style:y.normalizeStyle(t.styleTitlebar),ref:"titlebar"},[y.createElementVNode("div",Gs,[t.$slots.title?y.renderSlot(t.$slots,"title",{key:0}):(y.openBlock(),y.createElementBlock(y.Fragment,{key:1},[y.createTextVNode(y.toDisplayString(t.title),1)],64))]),t.closeButton?(y.openBlock(),y.createBlock(s,{key:0,windowStyle:t.windowStyle,onClick:t.closeButtonClick},{default:y.withCtx(()=>[y.createTextVNode("\xD7")]),_:1},8,["windowStyle","onClick"])):y.createCommentVNode("v-if",!0)],4),y.createElementVNode("div",{class:"content",style:y.normalizeStyle(t.styleContent),ref:"content"},[y.renderSlot(t.$slots,"default")],4)],36),[[y.vShow,t.isOpen]])]),_:3})},Rt.__file="src/controls/vuewindow/window/index.vue",function(t){t[t.StyleBlack=0]="StyleBlack",t[t.StyleWhite=1]="StyleWhite",t[t.StyleMetal=2]="StyleMetal",t[t.StyleGrayblue=3]="StyleGrayblue"}(kr||(kr={}));const Ks=Rt;exports.LayoutContainerEnum=void 0,function(t){t[t.top=0]="top",t[t.bottom=1]="bottom",t[t.centerBack=2]="centerBack",t[t.centerMain=3]="centerMain",t[t.centerFront=4]="centerFront",t[t.left=5]="left",t[t.right=6]="right"}(exports.LayoutContainerEnum||(exports.LayoutContainerEnum={}));class xr{layoutState;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;widgetConfig=new Array;_LayoutID;_mapItemRefs;constructor(e,n,o,r){this.layoutState=e,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(e=>e.preload&&!e.afterid).forEach(e=>{this._loadWidget(e)})}async loadWidget(e){if(!e)return;let n;return _e(e)?n=e:dt(e)&&(n=this.widgetConfig.find(o=>o.id===e)),n?n.afterid?(this.isWidgetLoaded(n.afterid)||await this.loadWidget(n.afterid),this._loadWidget(n)):this._loadWidget(n):void 0}loadOtherDependenceWidgets(e){this.preConditionMap.has(e)&&this.preConditionMap.get(e)?.forEach(n=>{n.preload&&this._loadWidget(n)})}_loadWidget(e){if(!this.widgetsLoadedSet.has(e.id))return e.component().then(n=>{if(n.default){const o=y.markRaw(n.default);this.getContainerComponents(e.container).value.set(e.id,o),this.widgetsLoadedSet.add(e.id),y.nextTick().then(()=>{j.EventBus.emit(ce.WidgetLoadedEvent,{layoutID:this._LayoutID,widgetID:e.id}),this.loadOtherDependenceWidgets(e.id)})}}).catch(n=>{j.Logger().error("\u52A0\u8F7DWidget\u5931\u8D25\uFF01",e),j.EventBus.emit(ce.WidgetLoadedErrorEvent,e)});this.changeWidgetVisible(e.id,!0)}hasDependentWidgets(e){let n=!1;if(this.preConditionMap.has(e)){const o=this.preConditionMap.get(e);if(o){for(const r of o)if(this.isWidgetLoaded(r.id)){n=!0;break}}}return n}unloadWidget(e){if(!e||!this.isWidgetLoaded(e))return;const n=this.widgetConfig.find(o=>o.id===e);if(n){if(this.preConditionMap.has(e)){const o=this.preConditionMap.get(e);if(o)for(const r of o)this.unloadWidget(r.id)}this.getContainerComponents(n.container).value.delete(e),this.widgetsLoadedSet.delete(e),this._mapItemRefs&&this._mapItemRefs.delete(e),j.EventBus.emit(ce.WidgetUnLoadedEvent,{layoutID:this._LayoutID,widgetID:e})}}isWidgetLoaded(e){return this.widgetsLoadedSet.has(e)}splitTwoContainer(e=!1){const n=this.layoutState.centerMainContainer,o=this.layoutState.centerBackContainer;e?(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(e){switch(e){case exports.LayoutContainerEnum.top:return this.layoutState.topContainer;case exports.LayoutContainerEnum.bottom:return this.layoutState.bottomContainer;case exports.LayoutContainerEnum.left:return this.layoutState.leftContainer;case exports.LayoutContainerEnum.right:return this.layoutState.rightContainer;case exports.LayoutContainerEnum.centerBack:return this.layoutState.centerBackContainer;case exports.LayoutContainerEnum.centerMain:return this.layoutState.centerMainContainer;case exports.LayoutContainerEnum.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(e,n=!1){const o=this.getLayoutContainer(e);o&&(o.style.visibility=n?"visible":"hidden")}changeWidgetVisible(e,n=!1){const o=this.getWidgetComponent(e);o&&o.changeVisible&&o.changeVisible(n)}isWidgetVisible(e){const n=this.getWidgetComponent(e);return!!n&&(!n.isShow||n.isShow.value)}getWidgetComponent(e){if(this.widgetsLoadedSet.has(e)&&this._mapItemRefs)return this._mapItemRefs.get(e)}getWigetItem(e){return this.widgetConfig.find(n=>n.id===e)}getGroupWigetItems(e){return this.widgetConfig.filter(n=>n.group===e)}getContainerComponents(e){if(this.layoutMap.has(e))return this.layoutMap.get(e);{const n=y.ref(new Map);return this.layoutMap.set(e,n),n}}getWidgetLoadedIDList(){const e=[];return this.widgetsLoadedSet.forEach(n=>{e.push(n)}),e}unloadAllWidgets(e){const n=[];this.widgetsLoadedSet.forEach(o=>{e&&e.length>0?e.findIndex(r=>r===o)<0&&n.push(o):n.push(o)}),n.forEach(o=>this.unloadWidget(o))}unloadWidgets(e){e&&e.length>0&&e.forEach(n=>{this.unloadWidget(n)})}static getLayoutManager(e,n){if(n){const o=n.find(r=>r.id===e);if(o&&o.layoutID)return j.LayoutMap.get(o.layoutID)}}}var Mt=y.defineComponent({name:"SuspenseWithError",setup(){const t=y.ref(null);return y.onErrorCaptured(e=>(t.value="\u5F53\u524D\u9875\u9762\u5B58\u5728\u95EE\u9898\uFF0C\u65E0\u6CD5\u6E32\u67D3\u2026\u2026",console.error("onErrorCaptured",e),!0)),{error:t}}});Mt.render=function(t,e,n,o,r,i){return t.error?y.renderSlot(t.$slots,"error",{key:0},()=>[y.createTextVNode(y.toDisplayString(t.error),1)]):(y.openBlock(),y.createBlock(y.Suspense,{key:1},{default:y.withCtx(()=>[y.renderSlot(t.$slots,"default")]),fallback:y.withCtx(()=>[y.renderSlot(t.$slots,"fallback")]),_:3}))},Mt.__file="src/controls/routertransition/SuspenseWithError.vue";var Ln=y.defineComponent({name:"RouterTransition",__name:"RouterTransition",setup:t=>(e,n)=>{const o=y.resolveComponent("router-view");return y.openBlock(),y.createBlock(Mt,null,{default:y.withCtx(()=>[y.createVNode(o,null,{default:y.withCtx(({Component:r,route:i})=>[y.createVNode(y.Transition,null,{default:y.withCtx(()=>[i.meta.keepAlive?(y.openBlock(),y.createBlock(y.KeepAlive,{key:0},[(y.openBlock(),y.createBlock(y.resolveDynamicComponent(r),{key:i.name}))],1024)):(y.openBlock(),y.createBlock(y.resolveDynamicComponent(r),{key:i.name}))]),_:2},1024)]),_:1})]),_:1})}});Ln.__file="src/controls/routertransition/RouterTransition.vue";var Pt=y.defineComponent({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(t,{attrs:e,slots:n,emit:o}){const r=t.layoutID,i=y.ref(t.enableRouterView);y.watch(()=>t.enableRouterView,()=>{i.value=t.enableRouterView});const s=y.reactive({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 xr(s,t.widgetConfig,r,a),d=w(exports.LayoutContainerEnum.top),b=w(exports.LayoutContainerEnum.centerBack),S=w(exports.LayoutContainerEnum.centerFront),x=w(exports.LayoutContainerEnum.left),L=w(exports.LayoutContainerEnum.right),T=w(exports.LayoutContainerEnum.bottom);function w(p){return l?.getContainerComponents(p)}const u=y.computed(()=>t.layoutStyle);return y.onMounted(()=>{l&&(l.preloadWidgets(),r===void 0&&(j.LayoutManager=l),o("containerLoaded",{layoutID:r,layoutManager:l}))}),{...y.toRefs(s),topContainerComponents:d,centerbackComponents:b,centerfrontComponents:S,leftContainerComponents:x,rightContainerComponents:L,bottomContainerComponents:T,containerStyle:u,isEnableRouterView:i,setItemRef:(p,v)=>{p&&a.set(v,p)}}}});const Js={ref:"topContainer",class:"topContainer"},Ys={key:0,ref:"centerMainContainer",class:"centerdiv mainContainer"},Zs={ref:"centerBackContainer",class:"centerdiv backContainer"},Qs={ref:"centerFrontContainer",class:"centerdiv centerFrontContainer"},ea={ref:"leftContainer",class:"leftContainer"},ta={ref:"rightContainer",class:"rightContainer"},na={ref:"bottomContainer",class:"bottomContainer"};Pt.render=function(t,e,n,o,r,i){const s=y.resolveComponent("router-transition");return y.openBlock(),y.createElementBlock("div",{class:"layoutContainer",style:y.normalizeStyle(t.containerStyle)},[y.createElementVNode("div",Js,[y.renderSlot(t.$slots,"top"),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.topContainerComponents,([a,l])=>(y.openBlock(),y.createBlock(y.resolveDynamicComponent(l),{ref_for:!0,ref:d=>t.setItemRef(d,a),key:a}))),128))],512),y.createElementVNode("div",null,[y.createCommentVNode(" \u4E3B\u8981\u5BB9\u5668-\u5E95\u90E8 "),t.isEnableRouterView?(y.openBlock(),y.createElementBlock("div",Ys,[y.renderSlot(t.$slots,"main",{},()=>[y.createVNode(s)])],512)):y.createCommentVNode("v-if",!0),y.createCommentVNode(" \u4E0A\u4E00\u5C42-\u4E3B\u5BB9\u5668 "),y.createElementVNode("div",Zs,[y.renderSlot(t.$slots,"back"),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.centerbackComponents,([a,l])=>(y.openBlock(),y.createBlock(y.resolveDynamicComponent(l),{ref_for:!0,ref:d=>t.setItemRef(d,a),key:a}))),128))],512),y.createCommentVNode(" \u6700\u4E0A\u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),y.createElementVNode("div",Qs,[y.renderSlot(t.$slots,"front"),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.centerfrontComponents,([a,l])=>(y.openBlock(),y.createBlock(y.resolveDynamicComponent(l),{ref_for:!0,ref:d=>t.setItemRef(d,a),key:a}))),128))],512),y.createElementVNode("div",ea,[y.renderSlot(t.$slots,"left"),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.leftContainerComponents,([a,l])=>(y.openBlock(),y.createBlock(y.resolveDynamicComponent(l),{ref_for:!0,ref:d=>t.setItemRef(d,a),key:a}))),128))],512),y.createElementVNode("div",ta,[y.renderSlot(t.$slots,"right"),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.rightContainerComponents,([a,l])=>(y.openBlock(),y.createBlock(y.resolveDynamicComponent(l),{ref_for:!0,ref:d=>t.setItemRef(d,a),key:a}))),128))],512)]),y.createElementVNode("div",na,[y.renderSlot(t.$slots,"bottom"),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.bottomContainerComponents,([a,l])=>(y.openBlock(),y.createBlock(y.resolveDynamicComponent(l),{ref_for:!0,ref:d=>t.setItemRef(d,a),key:a}))),128))],512),y.createCommentVNode(" \u589E\u52A0\u9ED8\u8BA4\u63D2\u69FD "),y.renderSlot(t.$slots,"default")],4)},Pt.__scopeId="data-v-4d081e5c",Pt.__file="src/controls/layoutcontainer/layout.vue";const Xe=/^[a-z0-9]+(-[a-z0-9]+)*$/,zt=(t,e,n,o="")=>{const r=t.split(":");if(t.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(),d={provider:r.length>0?r[0]:o,prefix:l,name:a};return e&&!Lt(d)?null:d}const i=r[0],s=i.split("-");if(s.length>1){const a={provider:o,prefix:s.shift(),name:s.join("-")};return e&&!Lt(a)?null:a}if(n&&o===""){const a={provider:o,prefix:"",name:i};return e&&!Lt(a,n)?null:a}return null},Lt=(t,e)=>!!t&&!(t.provider!==""&&!t.provider.match(Xe)||!(e&&t.prefix===""||t.prefix.match(Xe))||!t.name.match(Xe)),Ir=Object.freeze({left:0,top:0,width:16,height:16}),Dt=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),$t=Object.freeze({...Ir,...Dt}),Dn=Object.freeze({...$t,body:"",hidden:!1});function Tr(t,e){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}(t,e);for(const o in Dn)o in Dt?o in t&&!(o in n)&&(n[o]=Dt[o]):o in e?n[o]=e[o]:o in t&&(n[o]=t[o]);return n}function oa(t,e,n){const o=t.icons,r=t.aliases||Object.create(null);let i={};function s(a){i=Tr(o[a]||r[a],i)}return s(e),n.forEach(s),Tr(t,i)}function Rr(t,e){const n=[];if(typeof t!="object"||typeof t.icons!="object")return n;t.not_found instanceof Array&&t.not_found.forEach(r=>{e(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 d(b){if(s[b])return l[b]=[];if(!(b in l)){l[b]=null;const S=a[b]&&a[b].parent,x=S&&d(S);x&&(l[b]=[S].concat(x))}return l[b]}),l}(t);for(const r in o){const i=o[r];i&&(e(r,oa(t,r,i)),n.push(r))}return n}const ra={provider:"",aliases:{},not_found:{},...Ir};function $n(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function Mr(t){if(typeof t!="object"||t===null)return null;const e=t;if(typeof e.prefix!="string"||!t.icons||typeof t.icons!="object"||!$n(t,ra))return null;const n=e.icons;for(const r in n){const i=n[r];if(!r.match(Xe)||typeof i.body!="string"||!$n(i,Dn))return null}const o=e.aliases||Object.create(null);for(const r in o){const i=o[r],s=i.parent;if(!r.match(Xe)||typeof s!="string"||!n[s]&&!o[s]||!$n(i,Dn))return null}return e}const Pr=Object.create(null);function Re(t,e){const n=Pr[t]||(Pr[t]=Object.create(null));return n[e]||(n[e]=function(o,r){return{provider:o,prefix:r,icons:Object.create(null),missing:new Set}}(t,e))}function An(t,e){return Mr(e)?Rr(e,(n,o)=>{o?t.icons[n]=o:t.missing.add(n)}):[]}let Ge=!1;function zr(t){return typeof t=="boolean"&&(Ge=t),Ge}function ia(t,e){if(typeof t!="object")return!1;if(typeof e!="string"&&(e=t.provider||""),Ge&&!e&&!t.prefix){let o=!1;return Mr(t)&&(t.prefix="",Rr(t,(r,i)=>{i&&function(s,a){const l=zt(s,!0,Ge);return!!l&&function(d,b,S){try{if(typeof S.body=="string")return d.icons[b]={...S},!0}catch{}return!1}(Re(l.provider,l.prefix),l.name,a)}(r,i)&&(o=!0)})),o}const n=t.prefix;return Lt({provider:e,prefix:n,name:"a"})?!!An(Re(e,n),t):!1}const Lr=Object.freeze({width:null,height:null}),Dr=Object.freeze({...Lr,...Dt}),sa=/(-?[0-9.]*[0-9]+[0-9.]*)/g,aa=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function $r(t,e,n){if(e===1)return t;if(n=n||100,typeof t=="number")return Math.ceil(t*e*n)/n;if(typeof t!="string")return t;const o=t.split(sa);if(o===null||!o.length)return t;const r=[];let i=o.shift(),s=aa.test(i);for(;;){if(s){const a=parseFloat(i);isNaN(a)?r.push(i):r.push(Math.ceil(a*e*n)/n)}else r.push(i);if(i=o.shift(),i===void 0)return r.join("");s=!s}}const ca=/\sid="(\S+)"/g,la="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16);let ua=0;const Bn=Object.create(null);function Nn(t){return Bn[t]||Bn[""]}function jn(t){let e;if(typeof t.resources=="string")e=[t.resources];else if(e=t.resources,!(e instanceof Array&&e.length))return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:t.random===!0,index:t.index||0,dataAfterTimeout:t.dataAfterTimeout!==!1}}const On=Object.create(null),At=["https://api.simplesvg.com","https://api.unisvg.com"],Wn=[];for(;At.length>0;)At.length===1||Math.random()>.5?Wn.push(At.shift()):Wn.push(At.pop());function ha(t,e){const n=jn(e);return n!==null&&(On[t]=n,!0)}function Un(t){return On[t]}On[""]=jn({resources:["https://api.iconify.design"].concat(Wn)});let Ar=(()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}})();const da={prepare:(t,e,n)=>{const o=[],r=function(l,d){const b=Un(l);if(!b)return 0;let S;if(b.maxURL){let x=0;b.resources.forEach(T=>{x=Math.max(x,T.length)});const L=d+".json?icons=";S=b.maxURL-x-b.path.length-L.length}else S=0;return S}(t,e),i="icons";let s={type:i,provider:t,prefix:e,icons:[]},a=0;return n.forEach((l,d)=>{a+=l.length+1,a>=r&&d>0&&(o.push(s),s={type:i,provider:t,prefix:e,icons:[]},a=l.length),s.icons.push(l)}),o.push(s),o},send:(t,e,n)=>{if(!Ar)return void n("abort",424);let o=function(i){if(typeof i=="string"){const s=Un(i);if(s)return s.path}return"/"}(e.provider);switch(e.type){case"icons":{const i=e.prefix,s=e.icons.join(",");o+=i+".json?"+new URLSearchParams({icons:s}).toString();break}case"custom":{const i=e.uri;o+=i.slice(0,1)==="/"?i.slice(1):i;break}default:return void n("abort",400)}let r=503;Ar(t+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 Br(t,e){t.forEach(n=>{const o=n.loaderCallbacks;o&&(n.loaderCallbacks=o.filter(r=>r.id!==e))})}let fa=0;var pa={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function ga(t,e,n,o){const r=t.resources.length,i=t.random?Math.floor(Math.random()*r):t.index;let s;if(t.random){let f=t.resources.slice(0);for(s=[];f.length>1;){const D=Math.floor(Math.random()*f.length);s.push(f[D]),f=f.slice(0,D).concat(f.slice(D+1))}s=s.concat(f)}else s=t.resources.slice(i).concat(t.resources.slice(0,i));const a=Date.now();let l,d="pending",b=0,S=null,x=[],L=[];function T(){S&&(clearTimeout(S),S=null)}function w(){d==="pending"&&(d="aborted"),T(),x.forEach(f=>{f.status==="pending"&&(f.status="aborted")}),x=[]}function u(f,D){D&&(L=[]),typeof f=="function"&&L.push(f)}function p(){d="failed",L.forEach(f=>{f(void 0,l)})}function v(){x.forEach(f=>{f.status==="pending"&&(f.status="aborted")}),x=[]}function h(){if(d!=="pending")return;T();const f=s.shift();if(f===void 0)return x.length?void(S=setTimeout(()=>{T(),d==="pending"&&(v(),p())},t.timeout)):void p();const D={status:"pending",resource:f,callback:($,A)=>{(function(B,O,F){const R=O!=="success";switch(x=x.filter(W=>W!==B),d){case"pending":break;case"failed":if(R||!t.dataAfterTimeout)return;break;default:return}if(O==="abort")return l=F,void p();if(R)return l=F,void(x.length||(s.length?h():p()));if(T(),v(),!t.random){const W=t.resources.indexOf(B.resource);W!==-1&&W!==t.index&&(t.index=W)}d="completed",L.forEach(W=>{W(F)})})(D,$,A)}};x.push(D),b++,S=setTimeout(h,t.rotate),n(f,e,D.callback)}return typeof o=="function"&&L.push(o),setTimeout(h),function(){return{startTime:a,payload:e,status:d,queriesSent:b,queriesPending:x.length,subscribe:u,abort:w}}}function Nr(t){const e={...pa,...t};let n=[];function o(){n=n.filter(r=>r().status==="pending")}return{query:function(r,i,s){const a=ga(e,r,i,(l,d)=>{o(),s&&s(l,d)});return n.push(a),a},find:function(r){return n.find(i=>r(i))||null},setIndex:r=>{e.index=r},getIndex:()=>e.index,cleanup:o}}function jr(){}const Fn=Object.create(null);function ma(t,e,n){let o,r;if(typeof t=="string"){const i=Nn(t);if(!i)return n(void 0,424),jr;r=i.send;const s=function(a){if(!Fn[a]){const l=Un(a);if(!l)return;const d={config:l,redundancy:Nr(l)};Fn[a]=d}return Fn[a]}(t);s&&(o=s.redundancy)}else{const i=jn(t);if(i){o=Nr(i);const s=Nn(t.resources?t.resources[0]:"");s&&(r=s.send)}}return o&&r?o.query(e,r,n)().abort:(n(void 0,424),jr)}function Hn(t,e){try{return t.getItem(e)}catch{}}function qn(t,e,n){try{return t.setItem(e,n),!0}catch{}}function Or(t,e){try{t.removeItem(e)}catch{}}function Vn(t,e){return qn(t,"iconify-count",e.toString())}function Xn(t){return parseInt(Hn(t,"iconify-count"))||0}const Bt={local:!0,session:!0},Wr={local:new Set,session:new Set};let Gn=!1,Nt=typeof window>"u"?{}:window;function Ur(t){const e=t+"Storage";try{if(Nt&&Nt[e]&&typeof Nt[e].length=="number")return Nt[e]}catch{}Bt[t]=!1}function Fr(t,e){const n=Ur(t);if(!n)return;const o=Hn(n,"iconify-version");if(o!=="iconify2"){if(o){const a=Xn(n);for(let l=0;l<a;l++)Or(n,"iconify"+l.toString())}return qn(n,"iconify-version","iconify2"),void Vn(n,0)}const r=Math.floor(Date.now()/36e5)-168,i=a=>{const l="iconify"+a.toString(),d=Hn(n,l);if(typeof d=="string"){try{const b=JSON.parse(d);if(typeof b=="object"&&typeof b.cached=="number"&&b.cached>r&&typeof b.provider=="string"&&typeof b.data=="object"&&typeof b.data.prefix=="string"&&e(b,a))return!0}catch{}Or(n,l)}};let s=Xn(n);for(let a=s-1;a>=0;a--)i(a)||(a===s-1?(s--,Vn(n,s)):Wr[t].add(a))}function Hr(){if(!Gn){Gn=!0;for(const t in Bt)Fr(t,e=>{const n=e.data,o=Re(e.provider,n.prefix);if(!An(o,n).length)return!1;const r=n.lastModified||-1;return o.lastModifiedCached=o.lastModifiedCached?Math.min(o.lastModifiedCached,r):r,!0})}}function va(t,e){function n(o){let r;if(!Bt[o]||!(r=Ur(o)))return;const i=Wr[o];let s;if(i.size)i.delete(s=Array.from(i).shift());else if(s=Xn(r),s>=50||!Vn(r,s+1))return;const a={cached:Math.floor(Date.now()/36e5),provider:t.provider,data:e};return qn(r,"iconify"+s.toString(),JSON.stringify(a))}Gn||Hr(),e.lastModified&&!function(o,r){const i=o.lastModifiedCached;if(i&&i>=r)return i===r;if(o.lastModifiedCached=r,i)for(const s in Bt)Fr(s,a=>{const l=a.data;return a.provider!==o.provider||l.prefix!==o.prefix||l.lastModified===r});return!0}(t,e.lastModified)||Object.keys(e.icons).length&&(e.not_found&&delete(e=Object.assign({},e)).not_found,n("local")||n("session"))}function qr(){}function ya(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,function(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const n=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!n.length)return;let o=!1;const r=e.provider,i=e.prefix;n.forEach(s=>{const a=s.icons,l=a.pending.length;a.pending=a.pending.filter(d=>{if(d.prefix!==i)return!0;const b=d.name;if(e.icons[b])a.loaded.push({provider:r,prefix:i,name:b});else{if(!e.missing.has(b))return o=!0,!0;a.missing.push({provider:r,prefix:i,name:b})}return!1}),a.pending.length!==l&&(o||Br([e],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}(t)}))}const wa=(t,e)=>{const n=function(l,d=!0,b=!1){const S=[];return l.forEach(x=>{const L=typeof x=="string"?zt(x,d,b):x;L&&S.push(L)}),S}(t,!0,zr()),o=function(l){const d={loaded:[],missing:[],pending:[]},b=Object.create(null);l.sort((x,L)=>x.provider!==L.provider?x.provider.localeCompare(L.provider):x.prefix!==L.prefix?x.prefix.localeCompare(L.prefix):x.name.localeCompare(L.name));let S={provider:"",prefix:"",name:""};return l.forEach(x=>{if(S.name===x.name&&S.prefix===x.prefix&&S.provider===x.provider)return;S=x;const L=x.provider,T=x.prefix,w=x.name,u=b[L]||(b[L]=Object.create(null)),p=u[T]||(u[T]=Re(L,T));let v;v=w in p.icons?d.loaded:T===""||p.missing.has(w)?d.missing:d.pending;const h={provider:L,prefix:T,name:w};v.push(h)}),d}(n);if(!o.pending.length){let l=!0;return e&&setTimeout(()=>{l&&e(o.loaded,o.missing,o.pending,qr)}),()=>{l=!1}}const r=Object.create(null),i=[];let s,a;return o.pending.forEach(l=>{const{provider:d,prefix:b}=l;if(b===a&&d===s)return;s=d,a=b,i.push(Re(d,b));const S=r[d]||(r[d]=Object.create(null));S[b]||(S[b]=[])}),o.pending.forEach(l=>{const{provider:d,prefix:b,name:S}=l,x=Re(d,b),L=x.pendingIcons||(x.pendingIcons=new Set);L.has(S)||(L.add(S),r[d][b].push(S))}),i.forEach(l=>{const{provider:d,prefix:b}=l;r[d][b].length&&function(S,x){S.iconsToLoad?S.iconsToLoad=S.iconsToLoad.concat(x).sort():S.iconsToLoad=x,S.iconsQueueFlag||(S.iconsQueueFlag=!0,setTimeout(()=>{S.iconsQueueFlag=!1;const{provider:L,prefix:T}=S,w=S.iconsToLoad;let u;delete S.iconsToLoad,w&&(u=Nn(L))&&u.prepare(L,T,w).forEach(p=>{ma(L,p,v=>{if(typeof v!="object")p.icons.forEach(h=>{S.missing.add(h)});else try{const h=An(S,v);if(!h.length)return;const f=S.pendingIcons;f&&h.forEach(D=>{f.delete(D)}),va(S,v)}catch(h){console.error(h)}ya(S)})})}))}(l,r[d][b])}),e?function(l,d,b){const S=fa++,x=Br.bind(null,b,S);if(!d.pending.length)return x;const L={id:S,icons:d,callback:l,abort:x};return b.forEach(T=>{(T.loaderCallbacks||(T.loaderCallbacks=[])).push(L)}),x}(e,o,i):qr},ba=/[\s,]+/;function _a(t,e){e.split(ba).forEach(n=>{switch(n.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0}})}function Sa(t,e=0){const n=t.replace(/^-?[0-9.]*/,"");function o(r){for(;r<0;)r+=4;return r%4}if(n===""){const r=parseInt(t);return isNaN(r)?0:o(r)}if(n!==t){let r=0;switch(n){case"%":r=25;break;case"deg":r=90}if(r){let i=parseFloat(t.slice(0,t.length-n.length));return isNaN(i)?0:(i/=r,i%1==0?o(i):0)}}return e}const Vr={...Dr,inline:!1},Ca={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Ea={display:"inline-block"},Kn={backgroundColor:"currentColor"},Xr={backgroundColor:"transparent"},Gr={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Kr={webkitMask:Kn,mask:Kn,background:Xr};for(const t in Kr){const e=Kr[t];for(const n in Gr)e[t+n]=Gr[n]}const jt={};function Jr(t){return t+(t.match(/^[-0-9.]+$/)?"px":"")}["horizontal","vertical"].forEach(t=>{const e=t.slice(0,1)+"Flip";jt[t+"-flip"]=e,jt[t.slice(0,1)+"-flip"]=e,jt[t+"Flip"]=e});const Yr=(t,e)=>{const n=function(u,p){const v={...u};for(const h in p){const f=p[h],D=typeof f;h in Lr?(f===null||f&&(D==="string"||D==="number"))&&(v[h]=f):D===typeof v[h]&&(v[h]=h==="rotate"?f%4:f)}return v}(Vr,e),o={...Ca},r=e.mode||"svg",i={},s=e.style,a=typeof s!="object"||s instanceof Array?{}:s;for(let u in e){const p=e[u];if(p!==void 0)switch(u){case"icon":case"style":case"onLoad":case"mode":break;case"inline":case"hFlip":case"vFlip":n[u]=p===!0||p==="true"||p===1;break;case"flip":typeof p=="string"&&_a(n,p);break;case"color":i.color=p;break;case"rotate":typeof p=="string"?n[u]=Sa(p):typeof p=="number"&&(n[u]=p);break;case"ariaHidden":case"aria-hidden":p!==!0&&p!=="true"&&delete o["aria-hidden"];break;default:{const v=jt[u];v?p!==!0&&p!=="true"&&p!==1||(n[v]=!0):Vr[u]===void 0&&(o[u]=p)}}}const l=function(u,p){const v={...$t,...u},h={...Dr,...p},f={left:v.left,top:v.top,width:v.width,height:v.height};let D=v.body;[v,h].forEach(J=>{const Y=[],fe=J.hFlip,Pe=J.vFlip;let Q,pe=J.rotate;switch(fe?Pe?pe+=2:(Y.push("translate("+(f.width+f.left).toString()+" "+(0-f.top).toString()+")"),Y.push("scale(-1 1)"),f.top=f.left=0):Pe&&(Y.push("translate("+(0-f.left).toString()+" "+(f.height+f.top).toString()+")"),Y.push("scale(1 -1)"),f.top=f.left=0),pe<0&&(pe-=4*Math.floor(pe/4)),pe%=4,pe){case 1:Q=f.height/2+f.top,Y.unshift("rotate(90 "+Q.toString()+" "+Q.toString()+")");break;case 2:Y.unshift("rotate(180 "+(f.width/2+f.left).toString()+" "+(f.height/2+f.top).toString()+")");break;case 3:Q=f.width/2+f.left,Y.unshift("rotate(-90 "+Q.toString()+" "+Q.toString()+")")}pe%2==1&&(f.left!==f.top&&(Q=f.left,f.left=f.top,f.top=Q),f.width!==f.height&&(Q=f.width,f.width=f.height,f.height=Q)),Y.length&&(D=function(Ht,qt,Vt){const et=function(ue,tt="defs"){let nt="";const je=ue.indexOf("<"+tt);for(;je>=0;){const ot=ue.indexOf(">",je),Oe=ue.indexOf("</"+tt);if(ot===-1||Oe===-1)break;const he=ue.indexOf(">",Oe);if(he===-1)break;nt+=ue.slice(ot+1,Oe).trim(),ue=ue.slice(0,je).trim()+ue.slice(he+1)}return{defs:nt,content:ue}}(Ht);return Be=et.defs,Ne=qt+et.content+Vt,Be?"<defs>"+Be+"</defs>"+Ne:Ne;var Be,Ne}(D,'<g transform="'+Y.join(" ")+'">',"</g>"))});const $=h.width,A=h.height,B=f.width,O=f.height;let F,R;$===null?(R=A===null?"1em":A==="auto"?O:A,F=$r(R,B/O)):(F=$==="auto"?B:$,R=A===null?$r(F,O/B):A==="auto"?O:A);const W={},V=(J,Y)=>{(fe=>fe==="unset"||fe==="undefined"||fe==="none")(Y)||(W[J]=Y.toString())};V("width",F),V("height",R);const ne=[f.left,f.top,B,O];return W.viewBox=ne.join(" "),{attributes:W,viewBox:ne,body:D}}(t,n),d=l.attributes;if(n.inline&&(i.verticalAlign="-0.125em"),r==="svg"){o.style={...i,...a},Object.assign(o,d);let u=0,p=e.id;return typeof p=="string"&&(p=p.replace(/-/g,"_")),o.innerHTML=function(v,h=la){const f=[];let D;for(;D=ca.exec(v);)f.push(D[1]);if(!f.length)return v;const $="suffix"+(16777216*Math.random()|Date.now()).toString(16);return f.forEach(A=>{const B=typeof h=="function"?h(A):h+(ua++).toString(),O=A.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");v=v.replace(new RegExp('([#;"])('+O+')([")]|\\.[a-z])',"g"),"$1"+B+$+"$3")}),v=v.replace(new RegExp($,"g"),"")}(l.body,p?()=>p+"ID"+u++:"iconifyVue"),y.h("svg",o)}const{body:b,width:S,height:x}=t,L=r==="mask"||r!=="bg"&&b.indexOf("currentColor")!==-1,T=function(u,p){let v=u.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const h in p)v+=" "+h+'="'+p[h]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+v+">"+u+"</svg>"}(b,{...d,width:S+"",height:x+""});var w;return o.style={...i,"--svg":(w=T,'url("'+function(u){return"data:image/svg+xml,"+function(p){return p.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(u)}(w)+'")'),width:Jr(d.width),height:Jr(d.height),...Ea,...L?Kn:Xr,...a},y.h("span",o)};var Zr;if(zr(!0),Zr=da,Bn[""]=Zr,typeof document<"u"&&typeof window<"u"){Hr();const t=window;if(t.IconifyPreload!==void 0){const e=t.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!ia(o))&&console.error(n)}catch{console.error(n)}})}if(t.IconifyProviders!==void 0){const e=t.IconifyProviders;if(typeof e=="object"&&e!==null)for(let n in e){const o="IconifyProviders["+n+"] is invalid.";try{const r=e[n];if(typeof r!="object"||!r||r.resources===void 0)continue;ha(n,r)||console.error(o)}catch{console.error(o)}}}}const ka={...$t,body:""},Jn=y.defineComponent({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(t,e){if(typeof t=="object"&&t!==null&&typeof t.body=="string")return this._name="",this.abortLoading(),{data:t};let n;if(typeof t!="string"||(n=zt(t,!1,!0))===null)return this.abortLoading(),null;const o=function(i){const s=typeof i=="string"?zt(i,!0,Ge):i;if(s){const a=Re(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===t||(this.abortLoading(),this._name="",o!==null&&(this._loadingIcon={name:t,abort:wa([n],()=>{this.counter++})})),null;this.abortLoading(),this._name!==t&&(this._name=t,e&&e(t));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 t=this.$attrs,e=this.iconMounted||t.ssr?this.getIcon(t.icon,t.onLoad):null;if(!e)return Yr(ka,t);let n=t;return e.classes&&(n={...t,class:(typeof t.class=="string"?t.class+" ":"")+e.classes.join(" ")}),Yr({...$t,...e.data},n)}}),$e=new Map,Ke=y.ref(new Map);class Je{static addWindowPanel(e){$e.set(e.id,e)}static removeWindowPanel(e){$e.has(e)&&($e.delete(e),Ke.value.delete(e))}static minimizeWindowPanel(e){$e.has(e)&&Ke.value.set(e,-1)}static openWindowPanel(e){$e.has(e)&&Ke.value.set(e,1)}}const xa=["src"],Ia={key:1,class:"paneltitle"},Ta={class:"dragPanelBar"},Ra={class:"dragPanelContent"},Ma={class:"drag-pointer-group"},Pa=(t=>(y.pushScopeId("data-v-39ea9741"),t=t(),y.popScopeId(),t))(()=>y.createElementVNode("span",{style:{"pointer-events":"all",visibility:"hidden"}},null,-1));var Yn=y.defineComponent({__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(t,{expose:e,emit:n}){const o=Bo(),r=t,i=n,s=y.ref(),a=y.ref(),l=y.computed(()=>r.isDark),d=y.ref({x:0,y:0}),b=250,S=100,x=y.ref({width:0,height:0}),L=R=>{s.value&&(s.value.style.left=`${R.x}px`,s.value.style.top=`${R.y}px`)};y.watch(()=>d.value,R=>{L(R)});const T=R=>{s.value&&(s.value.style.width=`${R.width}px`,s.value.style.height=`${R.height}px`)};y.watch(()=>x.value,R=>{T(R)});const w={eventListenerController:null,startingEdges:null,newEdges:null,clickStart:null,mount:()=>{Object.entries(w.refs).forEach(([R,W])=>{W.value&&W.value.addEventListener("mousedown",V=>{w.mouseDown(V,R)})})},mouseDown:(R,W)=>{R.button==0&&(R.preventDefault(),w.startingEdges={left:d.value.x,top:d.value.y,right:d.value.x+x.value.width,bottom:d.value.y+x.value.height},w.newEdges={...w.startingEdges},w.clickStart={x:R.clientX,y:R.clientY},w.eventListenerController=new AbortController,document.addEventListener("mousemove",V=>{w.mouseMove(V,W)},{signal:w.eventListenerController.signal}),document.addEventListener("mouseup",V=>{w.mouseUp(V,W)},{signal:w.eventListenerController.signal}))},mouseMove:(R,W)=>{if(w.startingEdges!=null&&w.newEdges!=null&&w.clickStart!=null&&w.refs[W].value){if(R.preventDefault(),console.log("mouseMove",W),W.toLowerCase().includes("north")){w.newEdges.top=Math.max(w.startingEdges.top+R.clientY-w.clickStart.y,0);const V=w.newEdges.bottom-w.newEdges.top-S;V<0&&(w.newEdges.top+=V)}else W.toLowerCase().includes("south")&&(w.newEdges.bottom=Math.min(w.startingEdges.bottom+R.clientY-w.clickStart.y,document.body.clientHeight));if(W.toLowerCase().includes("west")){w.newEdges.left=Math.max(w.startingEdges.left+R.clientX-w.clickStart.x,0);const V=w.newEdges.right-w.newEdges.left-b;V<0&&(w.newEdges.left+=V)}else W.toLowerCase().includes("east")&&(w.newEdges.right=Math.min(w.startingEdges.right+R.clientX-w.clickStart.x,document.body.clientWidth));w.update()}},update:()=>{w.newEdges==null||w.startingEdges==null||(d.value={x:Math.max(w.newEdges.left,0),y:Math.max(w.newEdges.top,0)},x.value={width:Math.min(Math.max(w.newEdges.right-w.newEdges.left,b),document.body.clientWidth),height:Math.min(Math.max(w.newEdges.bottom-w.newEdges.top,S),document.body.clientHeight)})},mouseUp:(R,W)=>{R.button!=0||w.startingEdges==null||(console.log("mouseUp",W),R.preventDefault(),w.startingEdges=null,w.newEdges=null,w.clickStart=null,w.eventListenerController&&(w.eventListenerController.abort(),w.eventListenerController=null))},refs:{northWest:y.ref(null),north:y.ref(null),northEast:y.ref(null),west:y.ref(null),east:y.ref(null),southWest:y.ref(null),south:y.ref(null),southEast:y.ref(null)}},u={startingMouse:null,startingPosition:null,mouseDown:R=>{R.button==0&&(R.preventDefault(),console.log("mouseDown"),u.startingMouse={x:R.clientX,y:R.clientY},u.startingPosition=d.value,document.addEventListener("mousemove",u.mouseMove),document.addEventListener("mouseup",u.mouseUp))},mouseMove:R=>{!u.startingMouse||!u.startingPosition||(R.preventDefault(),d.value={x:Math.min(Math.max(u.startingPosition.x+R.clientX-u.startingMouse.x,0),document.body.clientWidth-x.value.width),y:Math.min(Math.max(u.startingPosition.y+R.clientY-u.startingMouse.y,0),document.body.clientHeight-x.value.height)})},mouseUp:R=>{R.button!=0||!u.startingMouse||!u.startingPosition||(R.preventDefault(),u.startingMouse=null,u.startingPosition=null,console.log("mouseUp"),document.removeEventListener("mousemove",u.mouseMove),document.removeEventListener("mouseup",u.mouseUp))}};function p(R){return{id:o,icon:r.icon,title:r.title,pid:r.pid,data:R??r.tag}}const v=y.computed(()=>Ke.value.get(o)!==-1),h=y.ref(!1),f=y.ref(!0);function D(){i("minimize",p()),Je.minimizeWindowPanel(o)}function $(){h.value=!h.value}function A(){i("close",p(!1)),Je.removeWindowPanel(o),f.value=!1}const B=y.computed(()=>h.value?"heroicons-outline:square-2-stack":"ant-design:border-outlined"),O={id:o,isShow:v,close:A,open:function(){i("open",p(!0)),f.value=!0},showHidePanel:D};function F(R){if(cn(R))return R;{const W=Number(R);if(W==W)return W;if(R.endsWith("px")){const V=R.substring(0,R.length-2);return Number(V)}if(R.endsWith("%")){const V=R.substring(0,R.length-1);return Number(V)/100*document.body.clientWidth}return 300}}return e(O),y.onMounted(()=>{(function(){let R=90;if(r.hasMin||(R-=30),r.hasMax||(R-=30),r.hasClose||(R-=30),se.setCssVar("--right-bar-width",R+"px",a.value),!a.value)return;const W=cn(r.titleHeight)?r.titleHeight+"px":r.titleHeight;a.value.style.height=W,a.value.style.lineHeight=W})(),function(){const R=p(O);Je.addWindowPanel(R),i("loaded",R)}(),d.value.x=F(r.left),d.value.y=F(r.top),L(d.value),x.value={width:F(r.nWidth),height:F(r.nHeight)},T(x.value),w.mount()}),y.onUnmounted(()=>{Je.removeWindowPanel(o)}),(R,W)=>(y.openBlock(),y.createBlock(y.Transition,{appear:"","enter-active-class":"animated zoomIn","leave-active-class":"animated zoomOut"},{default:y.withCtx(()=>[f.value?y.withDirectives((y.openBlock(),y.createElementBlock("div",{key:0,ref_key:"dragPanelRef",ref:s,class:y.normalizeClass(["dragWindowPanel",{maxPanel:h.value,dragWindowPanel_dark:l.value}])},[y.createElementVNode("div",{class:"dragPanelTitle",ref_key:"dragPanelTitleRef",ref:a,onMousedown:W[0]||(W[0]=(...V)=>u.mouseDown&&u.mouseDown(...V))},[y.renderSlot(R.$slots,"title",{},()=>[r.icon?(y.openBlock(),y.createElementBlock("img",{key:0,src:r.icon,width:"24",height:"24"},null,8,xa)):y.createCommentVNode("v-if",!0),r.title?(y.openBlock(),y.createElementBlock("span",Ia,y.toDisplayString(r.title),1)):y.createCommentVNode("v-if",!0)]),y.createElementVNode("div",Ta,[t.hasMin?(y.openBlock(),y.createBlock(y.unref(Jn),{key:0,icon:"ant-design:minus-outlined",onClick:D})):y.createCommentVNode("v-if",!0),t.hasMax?(y.openBlock(),y.createBlock(y.unref(Jn),{key:1,icon:B.value,onClick:$},null,8,["icon"])):y.createCommentVNode("v-if",!0),t.hasClose?(y.openBlock(),y.createBlock(y.unref(Jn),{key:2,icon:"ant-design:close-outlined",onClick:A})):y.createCommentVNode("v-if",!0)])],544),y.createElementVNode("div",Ra,[y.renderSlot(R.$slots,"default")]),y.createElementVNode("div",Ma,[y.createElementVNode("div",{class:"cursor-nw-resize",ref:w.refs.northWest},null,512),y.createElementVNode("div",{class:"cursor-n-resize",ref:w.refs.north},null,512),y.createElementVNode("div",{class:"cursor-ne-resize",ref:w.refs.northEast},null,512),y.createElementVNode("div",{class:"cursor-w-resize",ref:w.refs.west},null,512),Pa,y.createElementVNode("div",{class:"cursor-e-resize",ref:w.refs.east},null,512),y.createElementVNode("div",{class:"cursor-sw-resize",ref:w.refs.southWest},null,512),y.createElementVNode("div",{class:"cursor-s-resize",ref:w.refs.south},null,512),y.createElementVNode("div",{class:"cursor-se-resize",ref:w.refs.southEast},null,512)])],2)),[[y.vShow,v.value]]):y.createCommentVNode("v-if",!0)]),_:3}))}});Yn.__scopeId="data-v-39ea9741",Yn.__file="src/controls/xwindow/XWindow.vue";const Ot=new Map,Zn=new Map;let Wt;const za={getDefaultClient(){if(Wt||(Wt=new Ue(SysConfig.DefaultHproseAPI)),!Wt)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return Wt},registerHprose(t,e){const n=Zn.get(t);if(!n){const o=new Ue(e);Ot.set(t,o)}return n},getHprose:t=>Zn?.get(t),getProxyHprose:t=>Ot.get(t),unregisterHprose(t){Ot.get(t)&&(Zn.delete(t),Ot.delete(t))}},Me={Login:"/api/User/Login",ChangeMyPwd:"/api/User/ChangeMyPwd",Logout:"/api/Check/ExitLogin",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken",GetSystemRights:"/api/System/GetSystem"},Qn="access_token",La=j.Config.ServiceURL.LoginAuthURL;function eo(){const t=Go();t&&ve(Me.RefreshToken,La,{refreshToken:t}).then(e=>{to(e.data)})}function Qr(){const t=me.getJsonObject(Qn);if(!t)return;const e=new Date().getTime(),n=new Date(t.expire).getTime()-e;n>0&&(n<=5e3?eo():setTimeout(eo,n-5e3))}function to(t){const e=new Date().getTime();let n=new Date(t.accessToken.expires).getTime()-e;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=Ee();o?(o.token=t.accessToken.tokenContent,o.expire=t.accessToken.expires,o.refresh=t.refreshToken.tokenContent):o={token:t.accessToken.tokenContent,expire:t.accessToken.expires,refresh:t.refreshToken.tokenContent},me.set(Qn,o,n/1e3),Qr()}else me.remove(Qn)}const Ut="Wm314243",Ft=j.Config.ServiceURL.LoginAuthURL,no="ROLE_SYSTEM_RIGHT",oo=new gt("",sessionStorage);function ei(){return oo.get(no)}function ro(t){oo.set(no,t)}function ti(){oo.remove(no)}function Ae(t){if(t)for(let e=0;e<t.length;e++){const n=t[e];n.children&&n.children.length>0?(Ae(n.children),n.children.length===0&&(t.splice(e,1),e--)):n.selected||(t.splice(e,1),e--)}}function ni(t,e,n="name"){t&&e&&t.forEach(o=>{const r=e.find(i=>i[n]===o[n]);r&&(o.children?r.children&&ni(o.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(o.selected=r.selected))})}function Ye(t,e,n,o="name"){const r=t[n],i=e[n];r?i&&ni(r,i,o):i&&(t[n]=i)}function oi(t){if(t&&t.length>0){const e=t.length;let n,o=!1;if(e>0){o=_e(t[0]);const r=o?t[0]:JSON.parse(t[0]);if(e>1)for(let i=1;i<t.length;i++){const s=t[i],a=o?s:JSON.parse(s);Ye(r,a,"routes","name"),Ye(r,a,"widgetMenu","name"),Ye(r,a,"widgets","id"),Ye(r,a,"functions","id")}n=r}return n&&(Ae(n.routes),Ae(n.widgetMenu),Ae(n.widgets),Ae(n.functions)),n}}const io=[],so=[],ao=[];function Ze(){return ei()}function ri(t,e){const n={...t};return n.meta||(n.meta={}),e.index!=null&&(n.meta.index=e.index),e.title!=null&&(n.meta.title=e.title),t.children&&(n.children=[],e.children&&e.children.forEach(o=>{const r=t.children?.find(i=>i.path===o.path);if(r){const i=ri(r,o);i&&n.children?.push(i)}})),n}function ii(t,e){const n={...t};return e.index!=null&&(n.index=e.index),t.children&&(n.children=[],e.children&&e.children.forEach(o=>{const r=t.children?.find(i=>i.name===o.name);if(r){const i=ii(r,o);i&&n.children?.push(i)}})),n}exports.BigFileDownload=class{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,n=3,o=6,r=6e4){this.fileID=t,this.downloadURL=e,this.chunkByteSize=n*this.ChunkUnitM,this.eventTarget=mn(),this.initIndexDB(),o>=3&&(this.cacheSize=o),r>this.requestTimeout&&(this.requestTimeout=r)}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="",n){this.dispatchInfo("\u5F00\u59CB\u83B7\u53D6\u6587\u4EF6\u4FE1\u606F");const o=await ve(e,t,n);let r=null;return o&&o.status===200&&(r=o.data),r}async getIFileMeta(){if(this.fileMetaData===null){const t=await this.currentDB?.getItem("fileinfo");this.fileMetaData=t||null}return this.fileMetaData}initIndexDB(){this.currentDB=wt.createInstance({name:this.fileID,driver:wt.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(),wt.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 n=t;if(!n&&this.downloadURL&&(n=this.downloadURL),!n)throw Error("\u4E0B\u8F7DURL\u4E0D\u80FD\u4E3A\u7A7A!");this.currentDB||this.initIndexDB();const o=j.Axios.CancelToken;this.cancelSource=o.source(),this.isStarting=!0;const r={key:this.fileMetaData?.downloadID};let i=0;const s=this.cacheSize;let a=0;for(let l=0;l<this.totalChunks;l++){if(this.keys&&this.keys?.indexOf(l.toString())>=0){i++,i>this.finishNum&&(this.finishNum=i,this.downloadProgress());continue}const d=l*this.chunkByteSize;let b=d+this.chunkByteSize-1;this.fileMetaData&&b>this.fileMetaData.length&&(b=this.fileMetaData.length-1);const S={range:`bytes=${d}-${b}`};for(;a>=s;)await this.sleep(200);const x=l.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${l+1}/${this.totalChunks}`),a++,ve(n,e,r,S,"arraybuffer",this.cancelSource?.token,this.requestTimeout).then(async L=>{const T=L.data;a--,await this.currentDB?.setItem(x,T),i++,i>this.finishNum&&(this.finishNum=i,this.downloadProgress());const w=parseInt(x)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${w}/${this.totalChunks}`),this.savefile()}).catch(L=>{a--;const T=parseInt(x)+1;this.dispatchError(`\u4E0B\u8F7D\u7B2C${T}\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=vs.createWriteStream(this.fileName).getWriter();let e=0;for(let n=0;n<this.totalChunks;n++){const o=n.toString();let r=await this.currentDB?.getItem(o);if(r||(r=await this.currentDB?.getItem(o)),!r)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${n+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);let i=new Response(r).body;if(i===null)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${n+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);const s=i.getReader();for(;;){const{done:a,value:l}=await s.read();if(a)break;await t.write(l)}e++,this.outputProgress(e),this.dispatchInfo(`\u5B8C\u6210\u7B2C${n+1}\u4E2A\u5206\u7247\u8F93\u51FA`)}t.close(),wt.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}},exports.Download=vt,exports.DownloadByUrl=function({url:t,target:e="_blank",fileName:n}){const o=new URL(t).host==location.host;return new Promise((r,i)=>{if(o){const s=document.createElement("a");if(s.href=t,s.target=e,s.download!==void 0&&(s.download=n||Oo(t)),document.createEvent){const a=document.createEvent("MouseEvents");return a.initEvent("click",!0,!0),s.dispatchEvent(a),r(!0)}return t.indexOf("?")===-1&&(t+="?download"),window.open(t,e),r(!0)}{const s=document.createElement("canvas"),a=document.createElement("img");a.setAttribute("crossOrigin","Anonymous"),a.src=t,a.onload=l=>{s.width=a.width,s.height=a.height,s.getContext("2d").drawImage(a,0,0,a.width,a.height),s.toBlob(d=>{if(d){const b=document.createElement("a");b.href=window.URL.createObjectURL(d),b.download=Oo(t),b.click(),URL.revokeObjectURL(b.href),r(!0)}},"image/jpeg")},a.onerror=l=>i(l)}})},exports.FileUpload=tr,exports.GetSignalRClient=function(t){if(!t){if(xt)return xt;throw new Error("\u9996\u6B21\u6784\u5EFA\uFF0CsignalrURL\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\uFF01")}const e=new qs().configureLogging(I.Information).withUrl(t).withAutomaticReconnect({nextRetryDelayInMilliseconds:()=>5e3}).build();return e.keepAliveIntervalInMilliseconds=15e3,e.serverTimeoutInMilliseconds=18e5,e.start().then(()=>{j.Logger().info("\u542F\u52A8SignalR\u8FDE\u63A5\uFF01")}),e.onclose(async()=>{j.Logger().info("\u65AD\u5F00SignalR\u8FDE\u63A5!")}),e.onreconnecting(()=>{j.Logger().warn("SignalR\u670D\u52A1\u5DF2\u65AD\u7EBF\uFF0C\u91CD\u8FDE\u4E2D...\uFF01")}),e.onreconnected(()=>{j.Logger().warn("SignalR\u91CD\u8FDE\u6210\u529F!")}),xt||(xt=e),e},exports.Global=j,exports.GlobalHprose=za,exports.GlobalMitt=Ce,exports.H5Tool=se,exports.HproseClient=Qe,exports.HttpDownload=(t,e,n)=>{t.get(e,{responseType:"blob"}).then(function(o){vt(o.data,n)}).catch(o=>{console.warn(o),Ce.emit(ce.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})},exports.JsonDownload=jo,exports.LayoutContainer=Pt,exports.LayoutManager=xr,exports.MinWindowMap=Ke,exports.ObjToUrlParams=function(t,e){let n="",o="";for(const r in e)n+=r+"="+encodeURIComponent(e[r])+"&";return n=n.replace(/&$/,""),o=/\?$/.test(t)?t+n:t.replace(/\/?$/,"?")+n,o},exports.Pane=nn,exports.ProxyClient=Ue,exports.RouterTransition=Ln,exports.SaveAs=function(t,e){const n=window.URL||window.webkitURL||window,o=new Blob([t]),r=document.createElement("a");r.href=n.createObjectURL(o),r.download=e,r.click(),n.revokeObjectURL(r.href)},exports.Splitpanes=Ki,exports.Storage=gt,exports.StringUtils=pt,exports.StyleBlack={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)"}},exports.StyleGrayblue={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)"}},exports.StyleMetal={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)"}},exports.StyleWhite={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)"}},exports.SuspenseWithError=Mt,exports.SysEvents=ce,exports.TOKEN_REFRESH_TIME=5e3,exports.TOKEN_VALID_TIMESPAN=36e5,exports.USER_TOKEN_API=Me,exports.VWindow=Rt,exports.WaterMark=bs,exports.WindowResizeEvent=Er,exports.WindowType=Ks,exports.WindowsMap=$e,exports.XWindow=Yn,exports.XWindowManager=Je,exports.XXTEA=He,exports.calculateBestTextColor=function(t){return function(e,n){return(No(~~e[0],~~e[1],~~e[2])+.05)/(No(n[0],n[1],n[2])+.05)}(fn(t.substring(1)).split(","),[0,0,0])>=12?"#000000":"#FFFFFF"},exports.changeMyPWD=function(t){const e={oldpwd:He.encryptToString(t.oldpwd,Ut),newpwd:He.encryptToString(t.newpwd,Ut)};return ve(Me.ChangeMyPwd,Ft,e)},exports.checkDoRefreshToken=Qr,exports.checkToken=function(t){return ve(Me.CheckToken,Ft,{token:t})},exports.clearLocalToken=wn,exports.clearRight=ti,exports.colorIsDark=function(t){if(!mt(t))return;const[e,n,o]=fn(t).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(r=>Number(r));return .299*e+.578*n+.114*o<192},exports.createFileUpload=t=>new tr(t),exports.darken=function(t,e){return t=t.indexOf("#")>=0?t.substring(1,t.length):t,e=Math.trunc(255*e/100),`#${gn(t.substring(0,2),e)}${gn(t.substring(2,4),e)}${gn(t.substring(4,6),e)}`},exports.deepMerge=function t(e={},n={}){let o;for(o in n)_e(n[o])?e[o]=t(e[o],n[o]):e[o]=n[o];return e},exports.delay=Wo,exports.deserialize=function(t){return t==null||t===""?t:new Le.Reader(new Le.ByteStream(t)).deserialize()},exports.doRefreshToken=eo,exports.exportSystemRights=ar,exports.get=function(t,e){return ve(t,void 0,e)},exports.getCurrentSystemRight=Ze,exports.getData=function(t,e){return j.Axios?.get(t,{params:e}).catch(function(n){yt(n,t,"","\u5916\u90E8Get")})},exports.getEncryptPWD=function(t){return He.encryptToString(t,Ut)},exports.getFunctions=function(t,e=2){if(e===0)return t;const n=Ze();return n?n.functions:void 0},exports.getHexColor=function(t){const e=t.toLowerCase().replace(/rgb?a?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),n=parseFloat(e[3]||"1"),o=Math.floor(n*parseInt(e[0])+255*(1-n)),r=Math.floor(n*parseInt(e[1])+255*(1-n)),i=Math.floor(n*parseInt(e[2])+255*(1-n));return"#"+("0"+o.toString(16)).slice(-2)+("0"+r.toString(16)).slice(-2)+("0"+i.toString(16)).slice(-2)},exports.getLocalToken=Ee,exports.getLockState=function(){return me.get(En,!1)},exports.getLongHexColor=function(t){const e=t;if(e.length===4){let o="#";for(var n=1;n<4;n+=1){const r=e.slice(n,n+1);o+=r.concat(r)}return o}return e},exports.getProxyClient=nr,exports.getRGBColor=function(t){var e=t.toLowerCase();if(mt(t)){if(e.length===4){for(var n="#",o=1;o<4;o+=1){const i=e.slice(o,o+1);n+=i.concat(i)}e=n}var r=[];for(o=1;o<7;o+=2)r.push(parseInt("0x"+e.slice(o,o+2)));return"rgb("+r.join(",")+")"}return e},exports.getRGBColorFromHSLA=function(t){if(t){var e=t.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(e){var n,o,r,i=(parseFloat(e[1])%360+360)%360/360,s=parseFloat(e[2])/(/%$/.test(e[2])?100:1),a=parseFloat(e[3])/(/%$/.test(e[3])?100:1);if(s===0)n=o=r=a;else{var l=a<=.5?a*(s+1):a+s-a*s,d=2*a-l;n=dn(d,l,i+1/3),o=dn(d,l,i),r=dn(d,l,i-1/3)}return`rgba(${n=Math.round(255*n)},${o=Math.round(255*o)},${r=Math.round(255*r)},${e[4]?parseFloat(e[4]):1})`}}},exports.getRefreshToken=Go,exports.getRight=ei,exports.getRoutes=function(t,e=2){if(e===0)return t;const n=Ze();return n&&n.routes?(ao.length>0||t.forEach(o=>{const r=n.routes?.find(i=>i.name===o.name);if(r){const i=ri(o,r);i&&ao.push(i)}}),ao):void 0},exports.getSystemRoleRight=async function(t,e=!1){ti();const n=Me.GetSystemRights,o=j.Config.ServiceURL.LoginAuthURL,r=await ve(n,o,{systemid:t});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(e){const s=JSON.parse(i[0]);return ro(s),s}{const s=oi(i);return ro(s),s}}},exports.getWidgetConfig=function(t,e=2){if(e===0)return t;const n=Ze();return n&&n.widgets?(io.length>0||t?.forEach(o=>{n.widgets?.find(r=>r.id===o.id)&&io.push(o)}),io):void 0},exports.getWidgetMenus=function(t,e=2){if(e===0)return t;const n=Ze();return n&&n.widgetMenu?(so.length>0||t.forEach(o=>{const r=n.widgetMenu?.find(i=>i.name===o.name);if(r){const i=ii(o,r);i&&so.push(i)}}),so):void 0},exports.handleNodes=Ae,exports.hexToRGB=fn,exports.init=function(t,e,n){!j.Config.DefaultHproseAPI&&j.Config.ServiceURL&&(j.Config.DefaultHproseAPI=j.Config.ServiceURL.DefaultHproseAPI),j.Config.DefaultHproseAPI&&pt.isNotEmpty(j.Config.DefaultHproseAPI)&&(j.DefaultProxyClient=new Ue(j.Config.DefaultHproseAPI));const o=j.Config.UI.GrayMode;o&&se.setGrayMode(o);const r=new qo(t,j.EventBus);j.Message=r,j.SystemID=e,j.SystemGroup=n,j.EventBus.on(ce.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(ce.WebAPIErrorEvent,i=>{const s=`WebAPI\u540E\u53F0\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("WebAPI\u8BF7\u6C42\u9519\u8BEF",s)}),j.EventBus.on(ce.AxiosRequestErrorEvent,i=>{const s=`Http\u8BF7\u6C42'${i.code}'\u9519\u8BEF: ${i.message}`;console.warn("Http\u8BF7\u6C42\u9519\u8BEF",s)}),j.EventBus.on(ce.CommonWarnEvent,i=>{r.warn(i)})},exports.initDefaultProxyClient=function(t){const e=nr(t);return e&&(j.DefaultProxyClient=e),e},exports.is=ie,exports.isArray=ln,exports.isAsyncFunction=function(t){return ie(t,"AsyncFunction")},exports.isBoolean=function(t){return t===!0||t===!1||ie(t,"Boolean")},exports.isClient=()=>typeof window<"u",exports.isDate=function(t){return ie(t,"Date")},exports.isDef=Ao,exports.isElement=t=>_e(t)&&!!t.tagName,exports.isEmpty=function(t){return t==null||(dt(t)||ln(t)?t.length===0:!!_e(t)&&JSON.stringify(t)==="{}")},exports.isEnumColor=function(t){if(typeof t=="object"||!t)return;const e=t.toLowerCase().substring(0,1);return e==="#"?exports.EnumColor.Hex:e==="r"||e==="("?exports.EnumColor.RGBA:e==="h"?exports.EnumColor.Hsla:exports.EnumColor.RGBA},exports.isError=function(t){return ie(t,"Error")},exports.isFunction=ht,exports.isHexColor=mt,exports.isImageDom=function(t){return t&&["IMAGE","IMG"].includes(t.tagName)},exports.isMap=function(t){return ie(t,"Map")},exports.isNull=an,exports.isNullAndUnDef=function(t){return sn(t)&&an(t)},exports.isNullOrUnDef=function(t){return sn(t)||an(t)},exports.isNumber=cn,exports.isObjectX=_e,exports.isPromise=function(t){return ie(t,"Promise")&&_e(t)&&ht(t.then)&&ht(t.catch)},exports.isServer=ts,exports.isString=dt,exports.isSymbol=function(t){return ie(t,"Symbol")},exports.isUnDef=sn,exports.isValidURL=t=>/^(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(t),exports.isWeakMap=function(t){return ie(t,"WeakMap")},exports.isWeakSet=function(t){return ie(t,"WeakSet")},exports.isWindow=t=>typeof window<"u"&&ie(t,"Window"),exports.jquery=gs,exports.lighten=function(t,e){return t=t.indexOf("#")>=0?t.substring(1,t.length):t,e=Math.trunc(255*e/100),`#${pn(t.substring(0,2),e)}${pn(t.substring(2,4),e)}${pn(t.substring(4,6),e)}`},exports.login=async function(t){const e={username:t.username,pwd:He.encryptToString(t.pwd,Ut)},n=(await ve(Me.Login,Ft,e))?.data;return n&&to(n.doubletoken),n},exports.logout=function(){const t=Ee();t&&(Jo(Me.Logout,Ft,{token:t.token,reftoken:t.refresh}),wn())},exports.mergeFilterRoleSysRight=oi,exports.mergeNodes=function t(e,n,o="name"){e&&n&&e.forEach(r=>{const i=n.find(s=>s[o]===r[o]);i&&(r.children?i.children&&t(r.children,i.children,o):(!i.children||i.children.length===0)&&i.selected&&(r.selected=i.selected))})},exports.mergeNodesAll=Ye,exports.newGuid=function(){var t=new Date().getTime(),e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var o=(t+16*Math.random())%16|0;return t=Math.floor(t/16),(n==="x"?o:3&o|8).toString(16)});return e},exports.onLockListener=function(){xn(),document.addEventListener("mousedown",xn)},exports.post=function(t,e){return Ko(t,void 0,e)},exports.requestGet=ve,exports.requestPost=Ko,exports.requestPostBody=Jo,exports.rgbToHex=function(t,e,n){const o=(t<<16|e<<8|n).toString(16);return"#"+new Array(Math.abs(o.length-7)).join("0")+o},exports.serialize=function(t){const e=new Le.Writer(new Le.ByteStream);return e.serialize(t),e.stream.toString()},exports.setLocalToken=to,exports.setRight=ro,exports.sleep=function(t){const e=new Date().getTime();let n=new Date().getTime();for(;n-e<t;)n=new Date().getTime();console.log(`\u5F3A\u5236\u7B49\u5F85${Wo}\u6BEB\u79D2`)},exports.storage=os,exports.storageHelper=me,exports.unLockListener=function(){document.removeEventListener("mousedown",xn)},exports.uuid=Bo,exports.verifiyNumberInteger=function(t){let e=t.replace(/(^\s*)|(\s*$)/g,"");return e=e.replace(/[\.]*/g,""),e=e.replace(/(^0[\d]*)$/g,"0"),e=e.replace(/^0\d$/g,"0"),e=e.replace(/[^\d]/g,""),e},exports.verifyAccount=function(t){return!!/^[a-zA-Z][a-zA-Z0-9_]{4,15}$/.test(t)},exports.verifyAndSpace=function(t){return t.replace(/(^\s*)|(\s*$)/g,"")},exports.verifyCarNum=function(t){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(t)},exports.verifyCnAndSpace=function(t){let e=t.replace(/[\u4e00-\u9fa5\s]+/g,"");return e=e.replace(/(^\s*)|(\s*$)/g,""),e},exports.verifyEmail=function(t){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(t)},exports.verifyEnAndSpace=function(t){let e=t.replace(/[a-zA-Z]+/g,"");return e=e.replace(/(^\s*)|(\s*$)/g,""),e},exports.verifyFullName=function(t){return!!/^[\u4e00-\u9fa5]{1,6}(·[\u4e00-\u9fa5]{1,6}){0,2}$/.test(t)},exports.verifyIPAddress=function(t){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(t)},exports.verifyIdCard=function(t){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(t)},exports.verifyNumberCnUppercase=function(t,e="\u4EDF\u4F70\u62FE\u4EBF\u4EDF\u4F70\u62FE\u4E07\u4EDF\u4F70\u62FE\u5143\u89D2\u5206",n=""){let o=(t+="00").indexOf(".");o>=0&&(t=t.substring(0,o)+t.substr(o+1,2)),e=e.substr(e.length-t.length);for(let r=0;r<t.length;r++)n+="\u96F6\u58F9\u8D30\u53C1\u8086\u4F0D\u9646\u67D2\u634C\u7396".substr(t.substr(r,1),1)+e.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")},exports.verifyNumberComma=function(t){let e=Tn(t);return e=e.toString().split("."),e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e=e.join("."),e},exports.verifyNumberIntegerAndFloat=Tn,exports.verifyNumberPercentage=function(t){let e=t.replace(/(^\s*)|(\s*$)/g,"");return e=e.replace(/[^\d]/g,""),e=e.replace(/^0/g,""),e=e.replace(/^[1-9]\d\d{1,3}$/,"100"),e},exports.verifyNumberPercentageFloat=function(t){let e=Tn(t);return e=e.replace(/^[1-9]\d\d{1,3}$/,"100"),e=e.replace(/^100\.$/,"100"),e},exports.verifyPassword=function(t){return!!/^[a-zA-Z]\w{5,15}$/.test(t)},exports.verifyPasswordPowerful=function(t){return!!/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(t)},exports.verifyPasswordStrength=function(t){let e="";return/^(?:\d+|[a-zA-Z]+|[!@#$%^&\.*]+){6,16}$/.test(t)&&(e="\u5F31"),/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(t)&&(e="\u4E2D"),/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(t)&&(e="\u5F3A"),e},exports.verifyPhone=function(t){return!!/^((12[0-9])|(13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0|1,5-9]))\d{8}$/.test(t)},exports.verifyPostalCode=function(t){return!!/^[1-9][0-9]{5}$/.test(t)},exports.verifyTelPhone=function(t){return!!/\d{3}-\d{8}|\d{4}-\d{7}/.test(t)},exports.verifyTextColor=function(t,e="",n="red"){return e.replace(new RegExp(t,"gi"),`<span style='color: ${n}'>${t}</span>`)},exports.verifyUrl=function(t){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(t)},exports.writeIconifyList=function(t,e="IconifyList.ts"){let n="",o=`const iconlist={
|
|
8
|
+
*/(function(t){((e,n)=>{t.exports=n()})(0,()=>{const e=typeof window=="object"?window:this;e.HTMLElement||console.warn("streamsaver is meant to run on browsers main thread");let n=null,o=!1;const r=e.WebStreamsPolyfill||{},i=e.isSecureContext;let s=/constructor/i.test(e.HTMLElement)||!!e.safari||!!e.WebKitPoint;const a=i||"MozAppearance"in document.documentElement.style?"iframe":"navigate",l={createWriteStream:function(b,S,x){let z={size:null,pathname:null,writableStrategy:void 0,readableStrategy:void 0},T=0,w=null,u=null,p=null;if(Number.isFinite(S)?([x,S]=[S,x],console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),z.size=x,z.writableStrategy=S):S&&S.highWaterMark?(console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),z.size=x,z.writableStrategy=S):z=S||{},!s){n||(n=i?d(l.mitm):function(D){const A="width=200,height=100",$=document.createDocumentFragment(),N={frame:e.open(D,"popup",A),loaded:!1,isIframe:!1,isPopup:!0,remove(){N.frame.close()},addEventListener(...F){$.addEventListener(...F)},dispatchEvent(...F){$.dispatchEvent(...F)},removeEventListener(...F){$.removeEventListener(...F)},postMessage(...F){N.frame.postMessage(...F)}},O=F=>{F.source===N.frame&&(N.loaded=!0,e.removeEventListener("message",O),N.dispatchEvent(new Event("load")))};return e.addEventListener("message",O),N}(l.mitm)),u=new MessageChannel,b=encodeURIComponent(b.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A");const h={transferringReadable:o,pathname:z.pathname||Math.random().toString().slice(-6)+"/"+b,headers:{"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+b}};z.size&&(h.headers["Content-Length"]=z.size);const f=[h,"*",[u.port2]];if(o){const D=a==="iframe"?void 0:{transform($,N){if(!($ instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");T+=$.length,N.enqueue($),w&&(location.href=w,w=null)},flush(){w&&(location.href=w)}};p=new l.TransformStream(D,z.writableStrategy,z.readableStrategy);const A=p.readable;u.port1.postMessage({readableStream:A},[A])}u.port1.onmessage=D=>{D.data.download?a==="navigate"?(n.remove(),n=null,T?location.href=D.data.download:w=D.data.download):(n.isPopup&&(n.remove(),n=null,a==="iframe"&&d(l.mitm)),d(D.data.download)):D.data.abort&&(v=[],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 v=[];return!s&&p&&p.writable||new l.WritableStream({write(h){if(!(h instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");s?v.push(h):(u.port1.postMessage(h),T+=h.length,w&&(location.href=w,w=null))},close(){if(s){const h=new Blob(v,{type:"application/octet-stream; charset=utf-8"}),f=document.createElement("a");f.href=URL.createObjectURL(h),f.download=b,f.click()}else u.port1.postMessage("end")},abort(){v=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null}},z.writableStrategy)},WritableStream:e.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 d(b){if(!b)throw new Error("meh");const S=document.createElement("iframe");return S.hidden=!0,S.src=b,S.loaded=!1,S.name="iframe",S.isIframe=!0,S.postMessage=(...x)=>S.contentWindow.postMessage(...x),S.addEventListener("load",()=>{S.loaded=!0},{once:!0}),document.body.appendChild(S),S}try{new Response(new ReadableStream),i&&!("serviceWorker"in navigator)&&(s=!0)}catch{s=!0}return(b=>{try{b()}catch{}})(()=>{const{readable:b}=new TransformStream,S=new MessageChannel;S.port1.postMessage(b,[b]),S.port1.close(),S.port2.close(),o=!0,Object.defineProperty(l,"TransformStream",{configurable:!1,writable:!1,value:TransformStream})}),l})})(sr);var vs=ft(sr.exports);function ys(t,e){const n=`${t}_${e}`;return ae.MD5(n)}function ar(t){const e=function(a){if(!a)return;const l=a,d=[];if(l)for(let b of l){const S=cr(b);S&&d.push(S)}return d}(t.bussinessRoutes),n=function(a){if(!a)return;const l=a;if(l&&l.length>0){const d=[];return l.forEach(b=>{const S=lr(b);S&&d.push(S)}),d}}(t.widgetMenuConfig),o=function(a){if(a&&a.length>0){const l=[];return a.forEach(d=>{const b=function(S){return S?{id:S.id,label:S.label,container:S.container,preload:S.preload,afterid:S.afterid,bindid:S.bindid,group:S.group}:void 0}(d);b&&l.push(b)}),l}}(t.widgetConfig),r=function(a){if(a&&a.length>0)return a}(t.functionList),i=t.pkgObject.version,s=t.pkgObject.name;return{id:ys(s,i),name:j.Config.UI.SiteTitle,group:j.Config.UI.Group,product:s,version:i,routes:e,widgetMenu:n,widgets:o,functions:r}}function cr(t){if(t){let e=0;t.meta?.hidden&&(e=1);let n={path:t.path,name:t.name,title:t.meta?.title,type:e,index:t.meta?.index};if(t.children){const o=[];for(let r of t.children){const i=cr(r);i&&o.push(i)}o.length>0&&(n.children=o)}return n}}function lr(t){if(!t)return;const e={name:t.name,index:t.index,path:t.path,type:t.type};return t.children&&t.children.length>0&&(e.children=[],t.children.forEach(n=>{const o=lr(n);o&&e.children?.push(o)})),e}function Tn(t){let e=t.replace(/(^\s*)|(\s*$)/g,"");return e=e.replace(/[^\d.]/g,""),e=e.replace(/^0{2}$/g,"0"),e=e.replace(/^\./g,""),e=e.replace(".","$#$").replace(/\./g,"").replace("$#$","."),e=e.replace(/^(\-)*(\d+)\.(\d\d).*$/,"$1$2.$3"),e}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(t,e){var n=t.length,o=n<<2;if(e){var r=t[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]=t[s>>2]>>((3&s)<<3);return i}function bt(t,e){var n,o=t.length,r=o>>2;3&o&&++r,e?(n=new Uint32Array(r+1))[r]=o:n=new Uint32Array(r);for(var i=0;i<o;++i)n[i>>2]|=t[i]<<((3&i)<<3);return n}function ke(t){return 4294967295&t}function _t(t,e,n,o,r,i){return(n>>>5^e<<2)+(e>>>3^n<<4)^(t^e)+(i[3&o^r]^n)}function dr(t){if(t.length<16){var e=new Uint8Array(16);e.set(t),t=e}return t}function St(t){for(var e=t.length,n=new Uint8Array(3*e),o=0,r=0;r<e;r++){var i=t.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<e){var s=t.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 fr(t){var e=t.length;return e===0?"":e<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 d=((7&l)<<18|(63&n[s++])<<12|(63&n[s++])<<6|63&n[s++])-65536;if(!(0<=d&&d<=1048575))throw new Error("Character outside valid Unicode range: 0x"+d.toString(16));r[i++]=d>>10&1023|55296,r[i]=1023&d|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)}(t,e):function(n,o){for(var r=[],i=new Array(32768),s=0,a=0,l=n.length;s<o&&a<l;s++){var d=n[a++];switch(d>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:i[s]=d;break;case 12:case 13:if(!(a<l))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(31&d)<<6|63&n[a++];break;case 14:if(!(a+1<l))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(15&d)<<12|(63&n[a++])<<6|63&n[a++];break;case 15:if(!(a+2<l))throw new Error("Unfinished UTF-8 octet sequence");var b=((7&d)<<18|(63&n[a++])<<12|(63&n[a++])<<6|63&n[a++])-65536;if(!(0<=b&&b<=1048575))throw new Error("Character outside valid Unicode range: 0x"+b.toString(16));i[s++]=b>>10&1023|55296,i[s]=1023&b|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+d.toString(16))}if(s>=32766){var S=s+1;i.length=S,r.push(String.fromCharCode.apply(String,i)),o-=S,s=-1}}return s>0&&(i.length=s,r.push(String.fromCharCode.apply(String,i))),r.join("")}(t,e)}function ws(t){var e=t.length;if(e===0)return"";var n=ur?t:function(a){for(var l=a.length,d=new Array(a.length),b=0;b<l;++b)d[b]=a[b];return d}(t);if(e<65535)return String.fromCharCode.apply(String,n);for(var o=32767&e,r=e>>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,e))),i.join("")}function pr(t,e){return typeof t=="string"&&(t=St(t)),typeof e=="string"&&(e=St(e)),t==null||t.length===0?t:hr(function(n,o){var r,i,s,a,l,d,b=n.length,S=b-1;for(i=n[S],s=0,d=0|Math.floor(6+52/b);d>0;--d){for(a=(s=ke(s+Mn))>>>2&3,l=0;l<S;++l)r=n[l+1],i=n[l]=ke(n[l]+_t(s,r,i,l,a,o));r=n[0],i=n[S]=ke(n[S]+_t(s,r,i,S,a,o))}return n}(bt(t,!0),bt(dr(e),!1)),!1)}function gr(t,e){return typeof t=="string"&&(t=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}(t)),typeof e=="string"&&(e=St(e)),t==null||t.length===0?t:hr(function(n,o){var r,i,s,a,l,d=n.length,b=d-1;for(r=n[0],s=ke(Math.floor(6+52/d)*Mn);s!==0;s=ke(s-Mn)){for(a=s>>>2&3,l=b;l>0;--l)i=n[l-1],r=n[l]=ke(n[l]-_t(s,r,i,l,a,o));i=n[b],r=n[0]=ke(n[0]-_t(s,r,i,0,a,o))}return n}(bt(t,!1),bt(dr(e),!1)),!0)}const He={toBytes:St,toString:fr,encrypt:pr,encryptToString:function(t,e){return window.btoa(ws(pr(t,e)))},decrypt:gr,decryptToString:function(t,e){return fr(gr(t,e))}},mr=t=>{const e="1.23452384164.123412416";document.getElementById(e)!==null&&document.body.removeChild(document.getElementById(e));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(t,n.width/10,n.height/2);const r=document.createElement("div");return r.id=e,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),e},bs={set:t=>{let e=mr(t);document.getElementById(e)===null&&(e=mr(t))},del:()=>{let t="1.23452384164.123412416";document.getElementById(t)!==null&&document.body.removeChild(document.getElementById(t))}};class xe extends Error{constructor(e,n){const o=new.target.prototype;super(`${e}: Status code '${n}'`),this.statusCode=n,this.__proto__=o}}class Rn extends Error{constructor(e="A timeout occurred."){const n=new.target.prototype;super(e),this.__proto__=n}}class de extends Error{constructor(e="An abort occurred."){const n=new.target.prototype;super(e),this.__proto__=n}}class _s extends Error{constructor(e,n){const o=new.target.prototype;super(e),this.transport=n,this.errorType="UnsupportedTransportError",this.__proto__=o}}class Ss extends Error{constructor(e,n){const o=new.target.prototype;super(e),this.transport=n,this.errorType="DisabledTransportError",this.__proto__=o}}class Cs extends Error{constructor(e,n){const o=new.target.prototype;super(e),this.transport=n,this.errorType="FailedToStartTransportError",this.__proto__=o}}class vr extends Error{constructor(e){const n=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=n}}class Es extends Error{constructor(e,n){const o=new.target.prototype;super(e),this.innerErrors=n,this.__proto__=o}}class yr{constructor(e,n,o){this.statusCode=e,this.statusText=n,this.content=o}}class Ct{get(e,n){return this.send({...n,method:"GET",url:e})}post(e,n){return this.send({...n,method:"POST",url:e})}delete(e,n){return this.send({...n,method:"DELETE",url:e})}getCookieString(e){return""}}var I;(function(t){t[t.Trace=0]="Trace",t[t.Debug=1]="Debug",t[t.Information=2]="Information",t[t.Warning=3]="Warning",t[t.Error=4]="Error",t[t.Critical=5]="Critical",t[t.None=6]="None"})(I||(I={}));class qe{constructor(){}log(e,n){}}qe.instance=new qe;class ee{static isRequired(e,n){if(e==null)throw new Error(`The '${n}' argument is required.`)}static isNotEmpty(e,n){if(!e||e.match(/^\s*$/))throw new Error(`The '${n}' argument should not be empty.`)}static isIn(e,n,o){if(!(e in n))throw new Error(`Unknown ${o} value: ${e}.`)}}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 Ve(t,e){let n="";return Ie(t)?(n=`Binary data of length ${t.byteLength}`,e&&(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)}(t)}'`)):typeof t=="string"&&(n=`String data of length ${t.length}`,e&&(n+=`. Content: '${t}'`)),n}function Ie(t){return t&&typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||t.constructor&&t.constructor.name==="ArrayBuffer")}async function wr(t,e,n,o,r,i){const s={},[a,l]=De();s[a]=l,t.log(I.Trace,`(${e} transport) sending data. ${Ve(r,i.logMessageContent)}.`);const d=Ie(r)?"arraybuffer":"text",b=await n.post(o,{content:r,headers:{...s,...i.headers},responseType:d,timeout:i.timeout,withCredentials:i.withCredentials});t.log(I.Trace,`(${e} transport) request complete. Response status: ${b.statusCode}.`)}class ks{constructor(e,n){this._subject=e,this._observer=n}dispose(){const e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(n=>{})}}class Et{constructor(e){this._minLevel=e,this.out=console}log(e,n){if(e>=this._minLevel){const o=`[${new Date().toISOString()}] ${I[e]}: ${n}`;switch(e){case I.Critical:case I.Error:this.out.error(o);break;case I.Warning:this.out.warn(o);break;case I.Information:this.out.info(o);break;default:this.out.log(o)}}}}function De(){let t="X-SignalR-User-Agent";return Z.isNode&&(t="User-Agent"),[t,xs("8.0.7",Is(),Ms(),Ts())]}function xs(t,e,n,o){let r="Microsoft SignalR/";const i=t.split(".");return r+=`${i[0]}.${i[1]}`,r+=` (${t}; `,r+=e&&e!==""?`${e}; `:"Unknown OS; ",r+=`${n}`,r+=o?`; ${o}`:"; Unknown Runtime Version",r+=")",r}function Is(){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 Ts(){if(Z.isNode)return process.versions.node}function Ms(){return Z.isNode?"NodeJS":"Browser"}function Pn(t){return t.stack?t.stack:t.message?t.message:`${t}`}class Rs extends Ct{constructor(e){if(super(),this._logger=e,typeof fetch>"u"||Z.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(e){if(e.abortSignal&&e.abortSignal.aborted)throw new de;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");const n=new this._abortControllerType;let o;e.abortSignal&&(e.abortSignal.onabort=()=>{n.abort(),o=new de});let r,i=null;if(e.timeout){const l=e.timeout;i=setTimeout(()=>{n.abort(),this._logger.log(I.Warning,"Timeout from HTTP request."),o=new Rn},l)}e.content===""&&(e.content=void 0),e.content&&(e.headers=e.headers||{},Ie(e.content)?e.headers["Content-Type"]="application/octet-stream":e.headers["Content-Type"]="text/plain;charset=UTF-8");try{r=await this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:e.withCredentials===!0?"include":"same-origin",headers:{"X-Requested-With":"XMLHttpRequest",...e.headers},method:e.method,mode:"cors",redirect:"follow",signal:n.signal})}catch(l){throw o||(this._logger.log(I.Warning,`Error from HTTP request. ${l}.`),l)}finally{i&&clearTimeout(i),e.abortSignal&&(e.abortSignal.onabort=null)}if(!r.ok){const l=await br(r,"text");throw new xe(l||r.statusText,r.status)}const s=br(r,e.responseType),a=await s;return new yr(r.status,r.statusText,a)}getCookieString(e){let n="";return Z.isNode&&this._jar&&this._jar.getCookies(e,(o,r)=>n=r.join("; ")),n}}function br(t,e){let n;switch(e){case"arraybuffer":n=t.arrayBuffer();break;case"text":default:n=t.text();break;case"blob":case"document":case"json":throw new Error(`${e} is not supported.`)}return n}class Ps extends Ct{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new de):e.method?e.url?new Promise((n,o)=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),r.withCredentials=e.withCredentials===void 0||e.withCredentials,r.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.content===""&&(e.content=void 0),e.content&&(Ie(e.content)?r.setRequestHeader("Content-Type","application/octet-stream"):r.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const i=e.headers;i&&Object.keys(i).forEach(s=>{r.setRequestHeader(s,i[s])}),e.responseType&&(r.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{r.abort(),o(new de)}),e.timeout&&(r.timeout=e.timeout),r.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),r.status>=200&&r.status<300?n(new yr(r.status,r.statusText,r.response||r.responseText)):o(new xe(r.response||r.responseText||r.statusText,r.status))},r.onerror=()=>{this._logger.log(I.Warning,`Error from HTTP request. ${r.status}: ${r.statusText}.`),o(new xe(r.statusText,r.status))},r.ontimeout=()=>{this._logger.log(I.Warning,"Timeout from HTTP request."),o(new Rn)},r.send(e.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class Ls extends Ct{constructor(e){if(super(),typeof fetch<"u"||Z.isNode)this._httpClient=new Rs(e);else{if(typeof XMLHttpRequest>"u")throw new Error("No usable HttpClient found.");this._httpClient=new Ps(e)}}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new de):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}}class le{static write(e){return`${e}${le.RecordSeparator}`}static parse(e){if(e[e.length-1]!==le.RecordSeparator)throw new Error("Message is incomplete.");const n=e.split(le.RecordSeparator);return n.pop(),n}}le.RecordSeparatorCode=30,le.RecordSeparator=String.fromCharCode(le.RecordSeparatorCode);class zs{writeHandshakeRequest(e){return le.write(JSON.stringify(e))}parseHandshakeResponse(e){let n,o;if(Ie(e)){const s=new Uint8Array(e),a=s.indexOf(le.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=e,a=s.indexOf(le.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=le.parse(n),i=JSON.parse(r[0]);if(i.type)throw new Error("Expected a handshake response from the server.");return[o,i]}}var H;(function(t){t[t.Invocation=1]="Invocation",t[t.StreamItem=2]="StreamItem",t[t.Completion=3]="Completion",t[t.StreamInvocation=4]="StreamInvocation",t[t.CancelInvocation=5]="CancelInvocation",t[t.Ping=6]="Ping",t[t.Close=7]="Close",t[t.Ack=8]="Ack",t[t.Sequence=9]="Sequence"})(H||(H={}));class Ds{constructor(){this.observers=[]}next(e){for(const n of this.observers)n.next(e)}error(e){for(const n of this.observers)n.error&&n.error(e)}complete(){for(const e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new ks(this,e)}}class As{constructor(e,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=e,this._connection=n,this._bufferSize=o}async _send(e){const n=this._protocol.writeMessage(e);let o=Promise.resolve();if(this._isInvocationMessage(e)){this._totalMessageCount++;let r=()=>{},i=()=>{};Ie(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 $s(n,this._totalMessageCount,r,i))}try{this._reconnectInProgress||await this._connection.send(n)}catch{this._disconnected()}await o}_ack(e){let n=-1;for(let o=0;o<this._messages.length;o++){const r=this._messages[o];if(r._id<=e.sequenceId)n=o,Ie(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(e){if(this._waitForSequenceMessage)return e.type===H.Sequence&&(this._waitForSequenceMessage=!1,!0);if(!this._isInvocationMessage(e))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(e){e.sequenceId>this._nextReceivingSequenceId?this._connection.stop(new Error("Sequence ID greater than amount of messages we've received.")):this._nextReceivingSequenceId=e.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}async _resend(){const e=this._messages.length!==0?this._messages[0]._id:this._totalMessageCount+1;await this._connection.send(this._protocol.writeMessage({type:H.Sequence,sequenceId:e}));const n=this._messages;for(const o of n)await this._connection.send(o._message);this._reconnectInProgress=!1}_dispose(e){e!=null||(e=new Error("Unable to reconnect to server."));for(const n of this._messages)n._rejector(e)}_isInvocationMessage(e){switch(e.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 $s{constructor(e,n,o,r){this._message=e,this._id=n,this._resolver=o,this._rejector=r}}var K;(function(t){t.Disconnected="Disconnected",t.Connecting="Connecting",t.Connected="Connected",t.Disconnecting="Disconnecting",t.Reconnecting="Reconnecting"})(K||(K={}));class lo{static create(e,n,o,r,i,s,a){return new lo(e,n,o,r,i,s,a)}constructor(e,n,o,r,i,s,a){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(I.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")},ee.isRequired(e,"connection"),ee.isRequired(n,"logger"),ee.isRequired(o,"protocol"),this.serverTimeoutInMilliseconds=i??3e4,this.keepAliveIntervalInMilliseconds=s??15e3,this._statefulReconnectBufferSize=a??1e5,this._logger=n,this._protocol=o,this.connection=e,this._reconnectPolicy=r,this._handshakeProtocol=new zs,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=K.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(e){if(this._connectionState!==K.Disconnected&&this._connectionState!==K.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}async _startWithStateTransitions(){if(this._connectionState!==K.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=K.Connecting,this._logger.log(I.Debug,"Starting HubConnection.");try{await this._startInternal(),Z.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=K.Connected,this._connectionStarted=!0,this._logger.log(I.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=K.Disconnected,this._logger.log(I.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}}async _startInternal(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;const e=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(I.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(o)),this._logger.log(I.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await e,this._stopDuringStartError)throw this._stopDuringStartError;this.connection.features.reconnect&&(this._messageBuffer=new As(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(I.Debug,`Hub handshake failed with error '${n}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(n),n}}async stop(){const e=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),await this._stopPromise;try{await e}catch{}}_stopInternal(e){if(this._connectionState===K.Disconnected)return this._logger.log(I.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===K.Disconnecting)return this._logger.log(I.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;const n=this._connectionState;return this._connectionState=K.Disconnecting,this._logger.log(I.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(I.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(n===K.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new de("The connection was stopped before the hub handshake could complete."),this.connection.stop(e))}async _sendCloseMessage(){try{await this._sendWithProtocol(this._createCloseMessage())}catch{}}stream(e,...n){const[o,r]=this._replaceStreamingParams(n),i=this._createStreamInvocation(e,n,r);let s;const a=new Ds;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,d)=>{d?a.error(d):l&&(l.type===H.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(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._messageBuffer?this._messageBuffer._send(e):this._sendMessage(this._protocol.writeMessage(e))}send(e,...n){const[o,r]=this._replaceStreamingParams(n),i=this._sendWithProtocol(this._createInvocation(e,n,!0,r));return this._launchStreams(o,i),i}invoke(e,...n){const[o,r]=this._replaceStreamingParams(n),i=this._createInvocation(e,n,!1,r);return new Promise((a,l)=>{this._callbacks[i.invocationId]=(b,S)=>{S?l(S):b&&(b.type===H.Completion?b.error?l(new Error(b.error)):a(b.result):l(new Error(`Unexpected message type: ${b.type}`)))};const d=this._sendWithProtocol(i).catch(b=>{l(b),delete this._callbacks[i.invocationId]});this._launchStreams(o,d)})}on(e,n){e&&n&&(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),this._methods[e].indexOf(n)===-1&&this._methods[e].push(n))}off(e,n){if(!e)return;e=e.toLowerCase();const o=this._methods[e];if(o)if(n){const r=o.indexOf(n);r!==-1&&(o.splice(r,1),o.length===0&&delete this._methods[e])}else delete this._methods[e]}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e){const n=this._protocol.parseMessages(e,this._logger);for(const o of n)if(!this._messageBuffer||this._messageBuffer._shouldProcessMessage(o))switch(o.type){case H.Invocation:this._invokeClientMethod(o).catch(r=>{this._logger.log(I.Error,`Invoke client method threw error: ${Pn(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(I.Error,`Stream callback threw error: ${Pn(i)}`)}}break}case H.Ping:break;case H.Close:{this._logger.log(I.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(I.Warning,`Invalid message type: ${o.type}.`)}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let n,o;try{[o,n]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(r){const i="Error parsing handshake response: "+r;this._logger.log(I.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(I.Error,r);const i=new Error(r);throw this._handshakeRejecter(i),i}return this._logger.log(I.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 e=this._nextKeepAlive-new Date().getTime();e<0&&(e=0),this._pingServerHandle=setTimeout(async()=>{if(this._connectionState===K.Connected)try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}},e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}async _invokeClientMethod(e){const n=e.target.toLowerCase(),o=this._methods[n];if(!o)return this._logger.log(I.Warning,`No client method with the name '${n}' found.`),void(e.invocationId&&(this._logger.log(I.Warning,`No result given for '${n}' method and invocation ID '${e.invocationId}'.`),await this._sendWithProtocol(this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null))));const r=o.slice(),i=!!e.invocationId;let s,a,l;for(const d of r)try{const b=s;s=await d.apply(this,e.arguments),i&&s&&b&&(this._logger.log(I.Error,`Multiple results provided for '${n}'. Sending error to server.`),l=this._createCompletionMessage(e.invocationId,"Client provided multiple results.",null)),a=void 0}catch(b){a=b,this._logger.log(I.Error,`A callback for the method '${n}' threw error '${b}'.`)}l?await this._sendWithProtocol(l):i?(a?l=this._createCompletionMessage(e.invocationId,`${a}`,null):s!==void 0?l=this._createCompletionMessage(e.invocationId,null,s):(this._logger.log(I.Warning,`No result given for '${n}' method and invocation ID '${e.invocationId}'.`),l=this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)),await this._sendWithProtocol(l)):s&&this._logger.log(I.Error,`Result given for '${n}' method but server is not expecting a result.`)}_connectionClosed(e){this._logger.log(I.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new de("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===K.Disconnecting?this._completeClose(e):this._connectionState===K.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===K.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=K.Disconnected,this._connectionStarted=!1,this._messageBuffer&&(this._messageBuffer._dispose(e??new Error("Connection closed.")),this._messageBuffer=void 0),Z.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(n=>n.apply(this,[e]))}catch(n){this._logger.log(I.Error,`An onclose callback called with error '${e}' threw error '${n}'.`)}}}async _reconnect(e){const n=Date.now();let o=0,r=e!==void 0?e:new Error("Attempting to reconnect due to a unknown error."),i=this._getNextRetryDelay(o++,0,r);if(i===null)return this._logger.log(I.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(e);if(this._connectionState=K.Reconnecting,e?this._logger.log(I.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(I.Information,"Connection reconnecting."),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(s=>s.apply(this,[e]))}catch(s){this._logger.log(I.Error,`An onreconnecting callback called with error '${e}' threw error '${s}'.`)}if(this._connectionState!==K.Reconnecting)return void this._logger.log(I.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;i!==null;){if(this._logger.log(I.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!==K.Reconnecting)return void this._logger.log(I.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=K.Connected,this._logger.log(I.Information,"HubConnection reconnected successfully."),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(s=>s.apply(this,[this.connection.connectionId]))}catch(s){this._logger.log(I.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${s}'.`)}return}catch(s){if(this._logger.log(I.Information,`Reconnect attempt failed because of error '${s}'.`),this._connectionState!==K.Reconnecting)return this._logger.log(I.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this._connectionState===K.Disconnecting&&this._completeClose());r=s instanceof Error?s:new Error(s.toString()),i=this._getNextRetryDelay(o++,Date.now()-n,r)}}this._logger.log(I.Information,`Reconnect retries have been exhausted after ${Date.now()-n} ms and ${o} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(e,n,o){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:n,previousRetryCount:e,retryReason:o})}catch(r){return this._logger.log(I.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${n}) threw error '${r}'.`),null}}_cancelCallbacksWithError(e){const n=this._callbacks;this._callbacks={},Object.keys(n).forEach(o=>{const r=n[o];try{r(null,e)}catch(i){this._logger.log(I.Error,`Stream 'error' callback called with '${e}' threw error: ${Pn(i)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,n,o,r){if(o)return r.length!==0?{arguments:n,streamIds:r,target:e,type:H.Invocation}:{arguments:n,target:e,type:H.Invocation};{const i=this._invocationId;return this._invocationId++,r.length!==0?{arguments:n,invocationId:i.toString(),streamIds:r,target:e,type:H.Invocation}:{arguments:n,invocationId:i.toString(),target:e,type:H.Invocation}}}_launchStreams(e,n){if(e.length!==0){n||(n=Promise.resolve());for(const o in e)e[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(e){const n=[],o=[];for(let r=0;r<e.length;r++){const i=e[r];if(this._isObservable(i)){const s=this._invocationId;this._invocationId++,n[s]=i,o.push(s.toString()),e.splice(r,1)}}return[n,o]}_isObservable(e){return e&&e.subscribe&&typeof e.subscribe=="function"}_createStreamInvocation(e,n,o){const r=this._invocationId;return this._invocationId++,o.length!==0?{arguments:n,invocationId:r.toString(),streamIds:o,target:e,type:H.StreamInvocation}:{arguments:n,invocationId:r.toString(),target:e,type:H.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:H.CancelInvocation}}_createStreamItemMessage(e,n){return{invocationId:e,item:n,type:H.StreamItem}}_createCompletionMessage(e,n,o){return n?{error:n,invocationId:e,type:H.Completion}:{invocationId:e,result:o,type:H.Completion}}_createCloseMessage(){return{type:H.Close}}}const Ns=[0,2e3,1e4,3e4,null];class _r{constructor(e){this._retryDelays=e!==void 0?[...e,null]:Ns}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}}class Te{}Te.Authorization="Authorization",Te.Cookie="Cookie";class Bs extends Ct{constructor(e,n){super(),this._innerClient=e,this._accessTokenFactory=n}async send(e){let n=!0;this._accessTokenFactory&&(!this._accessToken||e.url&&e.url.indexOf("/negotiate?")>0)&&(n=!1,this._accessToken=await this._accessTokenFactory()),this._setAuthorizationHeader(e);const o=await this._innerClient.send(e);return n&&o.statusCode===401&&this._accessTokenFactory?(this._accessToken=await this._accessTokenFactory(),this._setAuthorizationHeader(e),await this._innerClient.send(e)):o}_setAuthorizationHeader(e){e.headers||(e.headers={}),this._accessToken?e.headers[Te.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[Te.Authorization]&&delete e.headers[Te.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}}var te,ie;(function(t){t[t.None=0]="None",t[t.WebSockets=1]="WebSockets",t[t.ServerSentEvents=2]="ServerSentEvents",t[t.LongPolling=4]="LongPolling"})(te||(te={})),function(t){t[t.Text=1]="Text",t[t.Binary=2]="Binary"}(ie||(ie={}));class js{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(e,n,o){this._httpClient=e,this._logger=n,this._pollAbort=new js,this._options=o,this._running=!1,this.onreceive=null,this.onclose=null}async connect(e,n){if(ee.isRequired(e,"url"),ee.isRequired(n,"transferFormat"),ee.isIn(n,ie,"transferFormat"),this._url=e,this._logger.log(I.Trace,"(LongPolling transport) Connecting."),n===ie.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]=De(),i={[o]:r,...this._options.headers},s={abortSignal:this._pollAbort.signal,headers:i,timeout:1e5,withCredentials:this._options.withCredentials};n===ie.Binary&&(s.responseType="arraybuffer");const a=`${e}&_=${Date.now()}`;this._logger.log(I.Trace,`(LongPolling transport) polling: ${a}.`);const l=await this._httpClient.get(a,s);l.statusCode!==200?(this._logger.log(I.Error,`(LongPolling transport) Unexpected response code: ${l.statusCode}.`),this._closeError=new xe(l.statusText||"",l.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,s)}async _poll(e,n){try{for(;this._running;)try{const o=`${e}&_=${Date.now()}`;this._logger.log(I.Trace,`(LongPolling transport) polling: ${o}.`);const r=await this._httpClient.get(o,n);r.statusCode===204?(this._logger.log(I.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):r.statusCode!==200?(this._logger.log(I.Error,`(LongPolling transport) Unexpected response code: ${r.statusCode}.`),this._closeError=new xe(r.statusText||"",r.statusCode),this._running=!1):r.content?(this._logger.log(I.Trace,`(LongPolling transport) data received. ${Ve(r.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(r.content)):this._logger.log(I.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(o){this._running?o instanceof Rn?this._logger.log(I.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=o,this._running=!1):this._logger.log(I.Trace,`(LongPolling transport) Poll errored after shutdown: ${o.message}`)}}finally{this._logger.log(I.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(e){return this._running?wr(this._logger,"LongPolling",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(I.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(I.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const e={},[n,o]=De();e[n]=o;const r={headers:{...e,...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 xe&&(i.statusCode===404?this._logger.log(I.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this._logger.log(I.Trace,`(LongPolling transport) Error sending a DELETE request: ${i}`)):this._logger.log(I.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this._logger.log(I.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(I.Trace,e),this.onclose(this._closeError)}}}class Os{constructor(e,n,o,r){this._httpClient=e,this._accessToken=n,this._logger=o,this._options=r,this.onreceive=null,this.onclose=null}async connect(e,n){return ee.isRequired(e,"url"),ee.isRequired(n,"transferFormat"),ee.isIn(n,ie,"transferFormat"),this._logger.log(I.Trace,"(SSE transport) Connecting."),this._url=e,this._accessToken&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise((o,r)=>{let i,s=!1;if(n===ie.Text){if(Z.isBrowser||Z.isWebWorker)i=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{const a=this._httpClient.getCookieString(e),l={};l.Cookie=a;const[d,b]=De();l[d]=b,i=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:{...l,...this._options.headers}})}try{i.onmessage=a=>{if(this.onreceive)try{this._logger.log(I.Trace,`(SSE transport) data received. ${Ve(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(I.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(e){return this._eventSource?wr(this._logger,"SSE",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}}class Ws{constructor(e,n,o,r,i,s){this._logger=o,this._accessTokenFactory=n,this._logMessageContent=r,this._webSocketConstructor=i,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=s}async connect(e,n){let o;return ee.isRequired(e,"url"),ee.isRequired(n,"transferFormat"),ee.isIn(n,ie,"transferFormat"),this._logger.log(I.Trace,"(WebSockets transport) Connecting."),this._accessTokenFactory&&(o=await this._accessTokenFactory()),new Promise((r,i)=>{let s;e=e.replace(/^http/,"ws");const a=this._httpClient.getCookieString(e);let l=!1;if(Z.isNode||Z.isReactNative){const d={},[b,S]=De();d[b]=S,o&&(d[Te.Authorization]=`Bearer ${o}`),a&&(d[Te.Cookie]=a),s=new this._webSocketConstructor(e,void 0,{headers:{...d,...this._headers}})}else o&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(o)}`);s||(s=new this._webSocketConstructor(e)),n===ie.Binary&&(s.binaryType="arraybuffer"),s.onopen=d=>{this._logger.log(I.Information,`WebSocket connected to ${e}.`),this._webSocket=s,l=!0,r()},s.onerror=d=>{let b=null;b=typeof ErrorEvent<"u"&&d instanceof ErrorEvent?d.error:"There was an error with the transport",this._logger.log(I.Information,`(WebSockets transport) ${b}.`)},s.onmessage=d=>{if(this._logger.log(I.Trace,`(WebSockets transport) data received. ${Ve(d.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(d.data)}catch(b){return void this._close(b)}},s.onclose=d=>{if(l)this._close(d);else{let b=null;b=typeof ErrorEvent<"u"&&d instanceof ErrorEvent?d.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(b))}}})}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(I.Trace,`(WebSockets transport) sending data. ${Ve(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(I.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this._isCloseEvent(e)||e.wasClean!==!1&&e.code===1e3?e instanceof Error?this.onclose(e):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)))}_isCloseEvent(e){return e&&typeof e.wasClean=="boolean"&&typeof e.code=="number"}}class Us{constructor(e,n={}){var o;if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,ee.isRequired(e,"url"),this._logger=(o=n.logger)===void 0?new Et(I.Information):o===null?qe.instance:o.log!==void 0?o:new Et(o),this.baseUrl=this._resolveUrl(e),(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(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"||n.WebSocket?Z.isNode&&!n.WebSocket&&r&&(n.WebSocket=r):n.WebSocket=WebSocket,Z.isNode||typeof EventSource>"u"||n.EventSource?Z.isNode&&!n.EventSource&&i!==void 0&&(n.EventSource=i):n.EventSource=EventSource,this._httpClient=new Bs(n.httpClient||new Ls(this._logger),n.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=n,this.onreceive=null,this.onclose=null}async start(e){if(e=e||ie.Binary,ee.isIn(e,ie,"transferFormat"),this._logger.log(I.Debug,`Starting connection with transfer format '${ie[e]}'.`),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(e),await this._startInternalPromise,this._connectionState==="Disconnecting"){const n="Failed to start the HttpConnection before stop() was called.";return this._logger.log(I.Error,n),await this._stopPromise,Promise.reject(new de(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(I.Error,n),Promise.reject(new de(n))}this._connectionStarted=!0}send(e){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 uo(this.transport)),this._sendQueue.send(e))}async stop(e){return this._connectionState==="Disconnected"?(this._logger.log(I.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):this._connectionState==="Disconnecting"?(this._logger.log(I.Debug,`Call to HttpConnection.stop(${e}) 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(e),void await this._stopPromise)}async _stopInternal(e){this._stopError=e;try{await this._startInternalPromise}catch{}if(this.transport){try{await this.transport.stop()}catch(n){this._logger.log(I.Error,`HttpConnection.transport.stop() threw error '${n}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(I.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(e){let n=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==te.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(te.WebSockets),await this._startTransport(n,e)}else{let o=null,r=0;do{if(o=await this._getNegotiationResponse(n),this._connectionState==="Disconnecting"||this._connectionState==="Disconnected")throw new de("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,e)}this.transport instanceof Sr&&(this.features.inherentKeepAlive=!0),this._connectionState==="Connecting"&&(this._logger.log(I.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(o){return this._logger.log(I.Error,"Failed to start the connection: "+o),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(o)}}async _getNegotiationResponse(e){const n={},[o,r]=De();n[o]=r;const i=this._resolveNegotiateUrl(e);this._logger.log(I.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 vr("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 xe&&s.statusCode===404&&(a+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(I.Error,a),Promise.reject(new vr(a))}}_createConnectUrl(e,n){return n?e+(e.indexOf("?")===-1?"?":"&")+`id=${n}`:e}async _createTransport(e,n,o,r){let i=this._createConnectUrl(e,o.connectionToken);if(this._isITransport(n))return this._logger.log(I.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 d of a){const b=this._resolveTransportOrError(d,n,r,l?.useStatefulReconnect===!0);if(b instanceof Error)s.push(`${d.transport} failed:`),s.push(b);else if(this._isITransport(b)){if(this.transport=b,!l){try{l=await this._getNegotiationResponse(e)}catch(S){return Promise.reject(S)}i=this._createConnectUrl(e,l.connectionToken)}try{return await this._startTransport(i,r),void(this.connectionId=l.connectionId)}catch(S){if(this._logger.log(I.Error,`Failed to start the transport '${d.transport}': ${S}`),l=void 0,s.push(new Cs(`${d.transport} failed: ${S}`,te[d.transport])),this._connectionState!=="Connecting"){const x="Failed to select transport before stop() was called.";return this._logger.log(I.Debug,x),Promise.reject(new de(x))}}}}return s.length>0?Promise.reject(new Es(`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(e){switch(e){case te.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new Ws(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case te.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new Os(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case te.LongPolling:return new Sr(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,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(e,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(e,n)}_resolveTransportOrError(e,n,o,r){const i=te[e.transport];if(i==null)return this._logger.log(I.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(!function(s,a){return!s||(a&s)!=0}(n,i))return this._logger.log(I.Debug,`Skipping transport '${te[i]}' because it was disabled by the client.`),new Ss(`'${te[i]}' is disabled by the client.`,i);{if(!(e.transferFormats.map(a=>ie[a]).indexOf(o)>=0))return this._logger.log(I.Debug,`Skipping transport '${te[i]}' because it does not support the requested transfer format '${ie[o]}'.`),new Error(`'${te[i]}' does not support ${ie[o]}.`);if(i===te.WebSockets&&!this._options.WebSocket||i===te.ServerSentEvents&&!this._options.EventSource)return this._logger.log(I.Debug,`Skipping transport '${te[i]}' because it is not supported in your environment.'`),new _s(`'${te[i]}' is not supported in your environment.`,i);this._logger.log(I.Debug,`Selecting transport '${te[i]}'.`);try{return this.features.reconnect=i===te.WebSockets?r:void 0,this._constructTransport(i)}catch(a){return a}}}_isITransport(e){return e&&typeof e=="object"&&"connect"in e}_stopConnection(e){if(this._logger.log(I.Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,this._connectionState!=="Disconnected"){if(this._connectionState==="Connecting")throw this._logger.log(I.Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if(this._connectionState==="Disconnecting"&&this._stopPromiseResolver(),e?this._logger.log(I.Error,`Connection disconnected with error '${e}'.`):this._logger.log(I.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(n=>{this._logger.log(I.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(e)}catch(n){this._logger.log(I.Error,`HttpConnection.onclose(${e}) threw error '${n}'.`)}}}else this._logger.log(I.Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`)}_resolveUrl(e){if(e.lastIndexOf("https://",0)===0||e.lastIndexOf("http://",0)===0)return e;if(!Z.isBrowser)throw new Error(`Cannot resolve '${e}'.`);const n=window.document.createElement("a");return n.href=e,this._logger.log(I.Information,`Normalizing '${e}' to '${n.href}'.`),n.href}_resolveNegotiateUrl(e){const n=new URL(e);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 uo{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new kt,this._transportResult=new kt,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new kt),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}async _sendLoop(){for(;;){if(await this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new kt;const e=this._transportResult;this._transportResult=void 0;const n=typeof this._buffer[0]=="string"?this._buffer.join(""):uo._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(n),e.resolve()}catch(o){e.reject(o)}}}static _concatBuffers(e){const n=e.map(i=>i.byteLength).reduce((i,s)=>i+s),o=new Uint8Array(n);let r=0;for(const i of e)o.set(new Uint8Array(i),r),r+=i.byteLength;return o.buffer}}class kt{constructor(){this.promise=new Promise((e,n)=>[this._resolver,this._rejecter]=[e,n])}resolve(){this._resolver()}reject(e){this._rejecter(e)}}class Fs{constructor(){this.name="json",this.version=2,this.transferFormat=ie.Text}parseMessages(e,n){if(typeof e!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];n===null&&(n=qe.instance);const o=le.parse(e),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:n.log(I.Information,"Unknown message type '"+s.type+"' ignored.");continue}r.push(s)}return r}writeMessage(e){return le.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,"Invalid payload for Invocation message."),e.invocationId!==void 0&&this._assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),e.item===void 0)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this._assertNotEmptyString(e.error,"Invalid payload for Completion message."),this._assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")}_isAckMessage(e){if(typeof e.sequenceId!="number")throw new Error("Invalid SequenceId for Ack message.")}_isSequenceMessage(e){if(typeof e.sequenceId!="number")throw new Error("Invalid SequenceId for Sequence message.")}_assertNotEmptyString(e,n){if(typeof e!="string"||e==="")throw new Error(n)}}const Hs={trace:I.Trace,debug:I.Debug,info:I.Information,information:I.Information,warn:I.Warning,warning:I.Warning,error:I.Error,critical:I.Critical,none:I.None};class qs{configureLogging(e){if(ee.isRequired(e,"logging"),e.log!==void 0)this.logger=e;else if(typeof e=="string"){const n=function(o){const r=Hs[o.toLowerCase()];if(r!==void 0)return r;throw new Error(`Unknown log level: ${o}`)}(e);this.logger=new Et(n)}else this.logger=new Et(e);return this}withUrl(e,n){return ee.isRequired(e,"url"),ee.isNotEmpty(e,"url"),this.url=e,this.httpConnectionOptions=typeof n=="object"?{...this.httpConnectionOptions,...n}:{...this.httpConnectionOptions,transport:n},this}withHubProtocol(e){return ee.isRequired(e,"protocol"),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new _r(e):this.reconnectPolicy=e:this.reconnectPolicy=new _r,this}withServerTimeout(e){return ee.isRequired(e,"milliseconds"),this._serverTimeoutInMilliseconds=e,this}withKeepAliveInterval(e){return ee.isRequired(e,"milliseconds"),this._keepAliveIntervalInMilliseconds=e,this}withStatefulReconnect(e){return this.httpConnectionOptions===void 0&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=e?.bufferSize,this}build(){const e=this.httpConnectionOptions||{};if(e.logger===void 0&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const n=new Us(this.url,e);return lo.create(n,this.logger||qe.instance,this.protocol||new Fs,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}}let xt;const Ln=new Set;function Cr(t){return t!==null?parseFloat(t):0}function It(t){const e=window.getComputedStyle(t),n=Math.ceil([e.paddingLeft,e.width,e.paddingRight].map(Cr).reduce((r,i)=>r+i)),o=Math.ceil([e.paddingTop,e.height,e.paddingBottom].map(Cr).reduce((r,i)=>r+i));return{width:n,height:o}}class Er{width;height;constructor(e,n){this.width=e,this.height=n}}function Vs(t){const e=t.windowEl;if(e){const n=parseFloat(e.style.left||"NaN"),o=parseFloat(e.style.top||"NaN");if(!isNaN(n)&&!isNaN(o))return{left:n,top:o}}return null}function Xs(t,e,n,o){const r=t-n,i=e-o;return r*r+i*i}window.addEventListener("resize",t=>{Ln.forEach(e=>{e&&ht(e.fixPosition)&&e.fixPosition()})});const Tt=[];var Mt=y.defineComponent({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:ut},setup(t,{emit:e}){const n=y.getCurrentInstance();if(!n)return;const{proxy:o}=n;let r=0,i,s,a;const l=y.ref(t.isOpen),d=()=>{Tt.push(o),a=new Yi(t.zGroup,b),t.isOpen&&function(A){A&&(y.nextTick(()=>{r++==0&&(v(o),function(){const $=S.value,{width:N,height:O}=rn($);let F,M;if(t.left!==void 0!=(t.top!==void 0))throw new Error("Either of left or top is specified. Both must be set or not set.");if(typeof t.left=="number")F=t.left,M=t.top;else{const W=t.positionHint||"auto";switch(W){case"auto":{let V=20,ne=50,J=0;do{if(Tt.every(Y=>{if(!Y.isOpen||o==Y)return!0;const fe=Vs(Y);if(fe==null)return!0;const{left:Pe,top:Q}=fe;return Xs(Pe,Q,V,ne)>16}))break;V=(V+40)%(window.innerWidth-200),ne=(ne+40)%(window.innerHeight-200)}while(++J<100);F=V,M=ne}break;case"center":F=(window.innerWidth-N)/2,M=(window.innerHeight-O)/2,console.log(F,M,window.innerWidth,window.innerHeight,"111111");break;default:try{const V=W.split("/").map(Number);if(V.length!=2)throw null;const[ne,J]=V;if(!isFinite(ne)||!isFinite(J))throw null;F=ne>=0?ne:window.innerWidth-N+ne,M=J>=0?J:window.innerHeight-O+J}catch{throw new Error(`invalid position string: ${W}`)}}}$&&($.style.left=`${F}px`,$.style.top=`${M}px`)}()),t.resizable&&h(),D(),i=new Ji(x.value,S.value,{onMove:()=>D(),onMoveStart:()=>e("move-start"),onMoveEnd:()=>e("move-end")}),t.resizable&&function(){const{height:$}=rn(x.value);s=new Zi(S.value,{onResize:()=>h(),onResizeStart:()=>e("resize-start"),onResizeEnd:()=>e("resize-end"),minWidth:t.minWidth,minHeight:t.minHeight+$,maxWidth:t.maxWidth,maxHeight:t.maxHeight?t.maxHeight+$:void 0})}()}),t.activateWhenOpen&&T())}(!0),Ln.add(o)};function b(A){w.value.zIndex=`${A}`}const S=y.ref(null),x=y.ref(null),z=y.ref(null);function T(){a.raise(),e("activate")}const w=y.ref({...t.windowStyle.window,zIndex:"auto",overflow:t.overflow}),u=y.computed(()=>t.windowStyle.titlebar),p=y.computed(()=>{const A={...t.windowStyle.content};return t.resizable?A.padding="0":t.padding!=null&&(A.padding=`${t.padding}px`),t.isScrollable&&(A.overflow="auto"),A});function v(A){const{width:$,height:N,top:O,left:F}=A,M=S;if(M&&$!=null&&(M.value.style.width=`${$}px`),N!=null){const W=x.value;if(W){const V=It(W).height;M.value.style.height=`${N+V}px`}}M&&F!=null&&(M.value.style.left=`${F}px`),M&&O!=null&&(M.value.style.top=`${O}px`)}function h(A=!0){const $=S.value,N=x.value,O=z.value;if(O&&$&&N){const{width:F,height:M}=It(O),{width:W,height:V}=It($),ne=It(N).height,J=W-(O.offsetWidth-F),Y=V-ne-(O.offsetHeight-M);O.style.width=`${J}px`,O.style.height=`${Y}px`,f(),e("resize",new Er(J,Y)),A&&(e("update:width",J),e("update:height",Y))}}function f(){const A=S.value;if(A){const $=A.getBoundingClientRect();$.left<0&&(w.value.left="0px"),$.top<0&&(w.value.top="0px"),$.right>window.innerWidth&&(w.value.left=window.innerWidth-$.width+"px"),$.bottom>window.innerHeight&&(w.value.top=window.innerHeight-$.height+"px")}}function D(A=!0){f();const $=S.value;if($){const{left:N,top:O}=$.getBoundingClientRect();A&&(e("update:left",N),e("update:top",O))}}return y.watch(()=>t.isOpen,A=>{l.value=A}),y.watch(()=>t.zGroup,A=>{a.group=A}),y.watch(()=>t.width,A=>{v({width:A}),h(!1)}),y.watch(()=>t.height,A=>{v({height:A}),h(!1)}),y.onMounted(()=>{d()}),y.onBeforeUnmount(()=>{Ln.delete(this),a.unregister(),s&&s.teardown(),i&&i.teardown(),Tt.splice(Tt.indexOf(o),1)}),{isOpen:l,windowEl:S,titlebar:x,content:z,activate:T,styleWindow:w,styleTitlebar:u,styleContent:p,closeButtonClick:function(){l.value=!1,e("closebuttonclick")},fixPosition:f}}});const Gs={class:"title"};var kr;Mt.render=function(t,e,n,o,r,i){const s=y.resolveComponent("myButton");return y.openBlock(),y.createBlock(y.Transition,{name:"fade",onAfterLeave:e[2]||(e[2]=a=>t.$emit("close")),onAfterEnter:e[3]||(e[3]=a=>t.$emit("open")),persisted:""},{default:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:"window",style:y.normalizeStyle(t.styleWindow),ref:"windowEl",onMousedown:e[0]||(e[0]=(...a)=>t.activate&&t.activate(...a)),onTouchstart:e[1]||(e[1]=(...a)=>t.activate&&t.activate(...a))},[y.createElementVNode("div",{class:"titlebar",style:y.normalizeStyle(t.styleTitlebar),ref:"titlebar"},[y.createElementVNode("div",Gs,[t.$slots.title?y.renderSlot(t.$slots,"title",{key:0}):(y.openBlock(),y.createElementBlock(y.Fragment,{key:1},[y.createTextVNode(y.toDisplayString(t.title),1)],64))]),t.closeButton?(y.openBlock(),y.createBlock(s,{key:0,windowStyle:t.windowStyle,onClick:t.closeButtonClick},{default:y.withCtx(()=>[y.createTextVNode("\xD7")]),_:1},8,["windowStyle","onClick"])):y.createCommentVNode("v-if",!0)],4),y.createElementVNode("div",{class:"content",style:y.normalizeStyle(t.styleContent),ref:"content"},[y.renderSlot(t.$slots,"default")],4)],36),[[y.vShow,t.isOpen]])]),_:3})},Mt.__file="src/controls/vuewindow/window/index.vue",function(t){t[t.StyleBlack=0]="StyleBlack",t[t.StyleWhite=1]="StyleWhite",t[t.StyleMetal=2]="StyleMetal",t[t.StyleGrayblue=3]="StyleGrayblue"}(kr||(kr={}));const Ks=Mt;exports.LayoutContainerEnum=void 0,function(t){t[t.top=0]="top",t[t.bottom=1]="bottom",t[t.centerBack=2]="centerBack",t[t.centerMain=3]="centerMain",t[t.centerFront=4]="centerFront",t[t.left=5]="left",t[t.right=6]="right"}(exports.LayoutContainerEnum||(exports.LayoutContainerEnum={}));class xr{layoutState;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;widgetConfig=new Array;_LayoutID;_mapItemRefs;constructor(e,n,o,r){this.layoutState=e,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(e=>e.preload&&!e.afterid).forEach(e=>{this._loadWidget(e)})}async loadWidget(e){if(!e)return;let n;if(_e(e)?n=e:dt(e)&&(n=this.widgetConfig.find(o=>o.id===e)),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(re.WidgetLoadedEvent,o))};const r=this,i=n.afterid,s=n;return j.EventBus.on(re.WidgetLoadedEvent,o),this.loadWidget(n.afterid)}}return this._loadWidget(n)}}loadOtherDependenceWidgets(e){this.preConditionMap.has(e)&&this.preConditionMap.get(e)?.forEach(n=>{n.preload&&this._loadWidget(n)})}_loadWidget(e){if(!this.widgetsLoadedSet.has(e.id))return e.component().then(n=>{if(n.default){const o=y.markRaw(n.default);this.getContainerComponents(e.container).value.set(e.id,o),this.widgetsLoadedSet.add(e.id),y.nextTick().then(()=>{j.EventBus.emit(re.WidgetLoadedEvent,{layoutID:this._LayoutID,widgetID:e.id}),this.loadOtherDependenceWidgets(e.id)})}}).catch(n=>{j.Logger().error("\u52A0\u8F7DWidget\u5931\u8D25\uFF01",e),j.EventBus.emit(re.WidgetLoadedErrorEvent,e)});this.changeWidgetVisible(e.id,!0)}hasDependentWidgets(e){let n=!1;if(this.preConditionMap.has(e)){const o=this.preConditionMap.get(e);if(o){for(const r of o)if(this.isWidgetLoaded(r.id)){n=!0;break}}}return n}unloadWidget(e){if(!e||!this.isWidgetLoaded(e))return;const n=this.widgetConfig.find(o=>o.id===e);if(n){if(this.preConditionMap.has(e)){const o=this.preConditionMap.get(e);if(o)for(const r of o)this.unloadWidget(r.id)}this.getContainerComponents(n.container).value.delete(e),this.widgetsLoadedSet.delete(e),this._mapItemRefs&&this._mapItemRefs.delete(e),j.EventBus.emit(re.WidgetUnLoadedEvent,{layoutID:this._LayoutID,widgetID:e})}}isWidgetLoaded(e){return this.widgetsLoadedSet.has(e)}splitTwoContainer(e=!1){const n=this.layoutState.centerMainContainer,o=this.layoutState.centerBackContainer;e?(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(e){switch(e){case exports.LayoutContainerEnum.top:return this.layoutState.topContainer;case exports.LayoutContainerEnum.bottom:return this.layoutState.bottomContainer;case exports.LayoutContainerEnum.left:return this.layoutState.leftContainer;case exports.LayoutContainerEnum.right:return this.layoutState.rightContainer;case exports.LayoutContainerEnum.centerBack:return this.layoutState.centerBackContainer;case exports.LayoutContainerEnum.centerMain:return this.layoutState.centerMainContainer;case exports.LayoutContainerEnum.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(e,n=!1){const o=this.getLayoutContainer(e);o&&(o.style.visibility=n?"visible":"hidden")}changeWidgetVisible(e,n=!1){const o=this.getWidgetComponent(e);o&&o.changeVisible&&o.changeVisible(n)}isWidgetVisible(e){const n=this.getWidgetComponent(e);return!!n&&(!n.isShow||n.isShow.value)}getWidgetComponent(e){if(this.widgetsLoadedSet.has(e)&&this._mapItemRefs)return this._mapItemRefs.get(e)}getWigetItem(e){return this.widgetConfig.find(n=>n.id===e)}getGroupWigetItems(e){return this.widgetConfig.filter(n=>n.group===e)}getContainerComponents(e){if(this.layoutMap.has(e))return this.layoutMap.get(e);{const n=y.ref(new Map);return this.layoutMap.set(e,n),n}}getWidgetLoadedIDList(){const e=[];return this.widgetsLoadedSet.forEach(n=>{e.push(n)}),e}unloadAllWidgets(e){const n=[];this.widgetsLoadedSet.forEach(o=>{e&&e.length>0?e.findIndex(r=>r===o)<0&&n.push(o):n.push(o)}),n.forEach(o=>this.unloadWidget(o))}unloadWidgets(e){e&&e.length>0&&e.forEach(n=>{this.unloadWidget(n)})}static getLayoutManager(e,n){if(n){const o=n.find(r=>r.id===e);if(o&&o.layoutID)return j.LayoutMap.get(o.layoutID)}}}var Rt=y.defineComponent({name:"SuspenseWithError",setup(){const t=y.ref(null);return y.onErrorCaptured(e=>(t.value="\u5F53\u524D\u9875\u9762\u5B58\u5728\u95EE\u9898\uFF0C\u65E0\u6CD5\u6E32\u67D3\u2026\u2026",console.error("onErrorCaptured",e),!0)),{error:t}}});Rt.render=function(t,e,n,o,r,i){return t.error?y.renderSlot(t.$slots,"error",{key:0},()=>[y.createTextVNode(y.toDisplayString(t.error),1)]):(y.openBlock(),y.createBlock(y.Suspense,{key:1},{default:y.withCtx(()=>[y.renderSlot(t.$slots,"default")]),fallback:y.withCtx(()=>[y.renderSlot(t.$slots,"fallback")]),_:3}))},Rt.__file="src/controls/routertransition/SuspenseWithError.vue";var zn=y.defineComponent({name:"RouterTransition",__name:"RouterTransition",setup:t=>(e,n)=>{const o=y.resolveComponent("router-view");return y.openBlock(),y.createBlock(Rt,null,{default:y.withCtx(()=>[y.createVNode(o,null,{default:y.withCtx(({Component:r,route:i})=>[y.createVNode(y.Transition,null,{default:y.withCtx(()=>[i.meta.keepAlive?(y.openBlock(),y.createBlock(y.KeepAlive,{key:0},[(y.openBlock(),y.createBlock(y.resolveDynamicComponent(r),{key:i.name}))],1024)):(y.openBlock(),y.createBlock(y.resolveDynamicComponent(r),{key:i.name}))]),_:2},1024)]),_:1})]),_:1})}});zn.__file="src/controls/routertransition/RouterTransition.vue";var Pt=y.defineComponent({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:zn},setup(t,{attrs:e,slots:n,emit:o}){const r=t.layoutID,i=y.ref(t.enableRouterView);y.watch(()=>t.enableRouterView,()=>{i.value=t.enableRouterView});const s=y.reactive({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 xr(s,t.widgetConfig,r,a),d=w(exports.LayoutContainerEnum.top),b=w(exports.LayoutContainerEnum.centerBack),S=w(exports.LayoutContainerEnum.centerFront),x=w(exports.LayoutContainerEnum.left),z=w(exports.LayoutContainerEnum.right),T=w(exports.LayoutContainerEnum.bottom);function w(p){return l?.getContainerComponents(p)}const u=y.computed(()=>t.layoutStyle);return y.onMounted(()=>{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(re.LayoutContainerLoaded,{layoutID:r,layoutManager:l}))}),{...y.toRefs(s),topContainerComponents:d,centerbackComponents:b,centerfrontComponents:S,leftContainerComponents:x,rightContainerComponents:z,bottomContainerComponents:T,containerStyle:u,isEnableRouterView:i,setItemRef:(p,v)=>{p&&a.set(v,p)}}}});const Js={ref:"topContainer",class:"topContainer"},Ys={key:0,ref:"centerMainContainer",class:"centerdiv mainContainer"},Zs={ref:"centerBackContainer",class:"centerdiv backContainer"},Qs={ref:"centerFrontContainer",class:"centerdiv centerFrontContainer"},ea={ref:"leftContainer",class:"leftContainer"},ta={ref:"rightContainer",class:"rightContainer"},na={ref:"bottomContainer",class:"bottomContainer"};Pt.render=function(t,e,n,o,r,i){const s=y.resolveComponent("router-transition");return y.openBlock(),y.createElementBlock("div",{class:"layoutContainer",style:y.normalizeStyle(t.containerStyle)},[y.createElementVNode("div",Js,[y.renderSlot(t.$slots,"top"),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.topContainerComponents,([a,l])=>(y.openBlock(),y.createBlock(y.resolveDynamicComponent(l),{ref_for:!0,ref:d=>t.setItemRef(d,a),key:a}))),128))],512),y.createElementVNode("div",null,[y.createCommentVNode(" \u4E3B\u8981\u5BB9\u5668-\u5E95\u90E8 "),t.isEnableRouterView?(y.openBlock(),y.createElementBlock("div",Ys,[y.renderSlot(t.$slots,"main",{},()=>[y.createVNode(s)])],512)):y.createCommentVNode("v-if",!0),y.createCommentVNode(" \u4E0A\u4E00\u5C42-\u4E3B\u5BB9\u5668 "),y.createElementVNode("div",Zs,[y.renderSlot(t.$slots,"back"),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.centerbackComponents,([a,l])=>(y.openBlock(),y.createBlock(y.resolveDynamicComponent(l),{ref_for:!0,ref:d=>t.setItemRef(d,a),key:a}))),128))],512),y.createCommentVNode(" \u6700\u4E0A\u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),y.createElementVNode("div",Qs,[y.renderSlot(t.$slots,"front"),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.centerfrontComponents,([a,l])=>(y.openBlock(),y.createBlock(y.resolveDynamicComponent(l),{ref_for:!0,ref:d=>t.setItemRef(d,a),key:a}))),128))],512),y.createElementVNode("div",ea,[y.renderSlot(t.$slots,"left"),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.leftContainerComponents,([a,l])=>(y.openBlock(),y.createBlock(y.resolveDynamicComponent(l),{ref_for:!0,ref:d=>t.setItemRef(d,a),key:a}))),128))],512),y.createElementVNode("div",ta,[y.renderSlot(t.$slots,"right"),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.rightContainerComponents,([a,l])=>(y.openBlock(),y.createBlock(y.resolveDynamicComponent(l),{ref_for:!0,ref:d=>t.setItemRef(d,a),key:a}))),128))],512)]),y.createElementVNode("div",na,[y.renderSlot(t.$slots,"bottom"),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.bottomContainerComponents,([a,l])=>(y.openBlock(),y.createBlock(y.resolveDynamicComponent(l),{ref_for:!0,ref:d=>t.setItemRef(d,a),key:a}))),128))],512),y.createCommentVNode(" \u589E\u52A0\u9ED8\u8BA4\u63D2\u69FD "),y.renderSlot(t.$slots,"default")],4)},Pt.__scopeId="data-v-4d081e5c",Pt.__file="src/controls/layoutcontainer/layout.vue";const Xe=/^[a-z0-9]+(-[a-z0-9]+)*$/,Lt=(t,e,n,o="")=>{const r=t.split(":");if(t.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(),d={provider:r.length>0?r[0]:o,prefix:l,name:a};return e&&!zt(d)?null:d}const i=r[0],s=i.split("-");if(s.length>1){const a={provider:o,prefix:s.shift(),name:s.join("-")};return e&&!zt(a)?null:a}if(n&&o===""){const a={provider:o,prefix:"",name:i};return e&&!zt(a,n)?null:a}return null},zt=(t,e)=>!!t&&!(t.provider!==""&&!t.provider.match(Xe)||!(e&&t.prefix===""||t.prefix.match(Xe))||!t.name.match(Xe)),Ir=Object.freeze({left:0,top:0,width:16,height:16}),Dt=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),At=Object.freeze({...Ir,...Dt}),Dn=Object.freeze({...At,body:"",hidden:!1});function Tr(t,e){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}(t,e);for(const o in Dn)o in Dt?o in t&&!(o in n)&&(n[o]=Dt[o]):o in e?n[o]=e[o]:o in t&&(n[o]=t[o]);return n}function oa(t,e,n){const o=t.icons,r=t.aliases||Object.create(null);let i={};function s(a){i=Tr(o[a]||r[a],i)}return s(e),n.forEach(s),Tr(t,i)}function Mr(t,e){const n=[];if(typeof t!="object"||typeof t.icons!="object")return n;t.not_found instanceof Array&&t.not_found.forEach(r=>{e(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 d(b){if(s[b])return l[b]=[];if(!(b in l)){l[b]=null;const S=a[b]&&a[b].parent,x=S&&d(S);x&&(l[b]=[S].concat(x))}return l[b]}),l}(t);for(const r in o){const i=o[r];i&&(e(r,oa(t,r,i)),n.push(r))}return n}const ra={provider:"",aliases:{},not_found:{},...Ir};function An(t,e){for(const n in e)if(n in t&&typeof t[n]!=typeof e[n])return!1;return!0}function Rr(t){if(typeof t!="object"||t===null)return null;const e=t;if(typeof e.prefix!="string"||!t.icons||typeof t.icons!="object"||!An(t,ra))return null;const n=e.icons;for(const r in n){const i=n[r];if(!r.match(Xe)||typeof i.body!="string"||!An(i,Dn))return null}const o=e.aliases||Object.create(null);for(const r in o){const i=o[r],s=i.parent;if(!r.match(Xe)||typeof s!="string"||!n[s]&&!o[s]||!An(i,Dn))return null}return e}const Pr=Object.create(null);function Me(t,e){const n=Pr[t]||(Pr[t]=Object.create(null));return n[e]||(n[e]=function(o,r){return{provider:o,prefix:r,icons:Object.create(null),missing:new Set}}(t,e))}function $n(t,e){return Rr(e)?Mr(e,(n,o)=>{o?t.icons[n]=o:t.missing.add(n)}):[]}let Ge=!1;function Lr(t){return typeof t=="boolean"&&(Ge=t),Ge}function ia(t,e){if(typeof t!="object")return!1;if(typeof e!="string"&&(e=t.provider||""),Ge&&!e&&!t.prefix){let o=!1;return Rr(t)&&(t.prefix="",Mr(t,(r,i)=>{i&&function(s,a){const l=Lt(s,!0,Ge);return!!l&&function(d,b,S){try{if(typeof S.body=="string")return d.icons[b]={...S},!0}catch{}return!1}(Me(l.provider,l.prefix),l.name,a)}(r,i)&&(o=!0)})),o}const n=t.prefix;return zt({provider:e,prefix:n,name:"a"})?!!$n(Me(e,n),t):!1}const zr=Object.freeze({width:null,height:null}),Dr=Object.freeze({...zr,...Dt}),sa=/(-?[0-9.]*[0-9]+[0-9.]*)/g,aa=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Ar(t,e,n){if(e===1)return t;if(n=n||100,typeof t=="number")return Math.ceil(t*e*n)/n;if(typeof t!="string")return t;const o=t.split(sa);if(o===null||!o.length)return t;const r=[];let i=o.shift(),s=aa.test(i);for(;;){if(s){const a=parseFloat(i);isNaN(a)?r.push(i):r.push(Math.ceil(a*e*n)/n)}else r.push(i);if(i=o.shift(),i===void 0)return r.join("");s=!s}}const ca=/\sid="(\S+)"/g,la="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16);let ua=0;const Nn=Object.create(null);function Bn(t){return Nn[t]||Nn[""]}function jn(t){let e;if(typeof t.resources=="string")e=[t.resources];else if(e=t.resources,!(e instanceof Array&&e.length))return null;return{resources:e,path:t.path||"/",maxURL:t.maxURL||500,rotate:t.rotate||750,timeout:t.timeout||5e3,random:t.random===!0,index:t.index||0,dataAfterTimeout:t.dataAfterTimeout!==!1}}const On=Object.create(null),$t=["https://api.simplesvg.com","https://api.unisvg.com"],Wn=[];for(;$t.length>0;)$t.length===1||Math.random()>.5?Wn.push($t.shift()):Wn.push($t.pop());function ha(t,e){const n=jn(e);return n!==null&&(On[t]=n,!0)}function Un(t){return On[t]}On[""]=jn({resources:["https://api.iconify.design"].concat(Wn)});let $r=(()=>{let t;try{if(t=fetch,typeof t=="function")return t}catch{}})();const da={prepare:(t,e,n)=>{const o=[],r=function(l,d){const b=Un(l);if(!b)return 0;let S;if(b.maxURL){let x=0;b.resources.forEach(T=>{x=Math.max(x,T.length)});const z=d+".json?icons=";S=b.maxURL-x-b.path.length-z.length}else S=0;return S}(t,e),i="icons";let s={type:i,provider:t,prefix:e,icons:[]},a=0;return n.forEach((l,d)=>{a+=l.length+1,a>=r&&d>0&&(o.push(s),s={type:i,provider:t,prefix:e,icons:[]},a=l.length),s.icons.push(l)}),o.push(s),o},send:(t,e,n)=>{if(!$r)return void n("abort",424);let o=function(i){if(typeof i=="string"){const s=Un(i);if(s)return s.path}return"/"}(e.provider);switch(e.type){case"icons":{const i=e.prefix,s=e.icons.join(",");o+=i+".json?"+new URLSearchParams({icons:s}).toString();break}case"custom":{const i=e.uri;o+=i.slice(0,1)==="/"?i.slice(1):i;break}default:return void n("abort",400)}let r=503;$r(t+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 Nr(t,e){t.forEach(n=>{const o=n.loaderCallbacks;o&&(n.loaderCallbacks=o.filter(r=>r.id!==e))})}let fa=0;var pa={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function ga(t,e,n,o){const r=t.resources.length,i=t.random?Math.floor(Math.random()*r):t.index;let s;if(t.random){let f=t.resources.slice(0);for(s=[];f.length>1;){const D=Math.floor(Math.random()*f.length);s.push(f[D]),f=f.slice(0,D).concat(f.slice(D+1))}s=s.concat(f)}else s=t.resources.slice(i).concat(t.resources.slice(0,i));const a=Date.now();let l,d="pending",b=0,S=null,x=[],z=[];function T(){S&&(clearTimeout(S),S=null)}function w(){d==="pending"&&(d="aborted"),T(),x.forEach(f=>{f.status==="pending"&&(f.status="aborted")}),x=[]}function u(f,D){D&&(z=[]),typeof f=="function"&&z.push(f)}function p(){d="failed",z.forEach(f=>{f(void 0,l)})}function v(){x.forEach(f=>{f.status==="pending"&&(f.status="aborted")}),x=[]}function h(){if(d!=="pending")return;T();const f=s.shift();if(f===void 0)return x.length?void(S=setTimeout(()=>{T(),d==="pending"&&(v(),p())},t.timeout)):void p();const D={status:"pending",resource:f,callback:(A,$)=>{(function(N,O,F){const M=O!=="success";switch(x=x.filter(W=>W!==N),d){case"pending":break;case"failed":if(M||!t.dataAfterTimeout)return;break;default:return}if(O==="abort")return l=F,void p();if(M)return l=F,void(x.length||(s.length?h():p()));if(T(),v(),!t.random){const W=t.resources.indexOf(N.resource);W!==-1&&W!==t.index&&(t.index=W)}d="completed",z.forEach(W=>{W(F)})})(D,A,$)}};x.push(D),b++,S=setTimeout(h,t.rotate),n(f,e,D.callback)}return typeof o=="function"&&z.push(o),setTimeout(h),function(){return{startTime:a,payload:e,status:d,queriesSent:b,queriesPending:x.length,subscribe:u,abort:w}}}function Br(t){const e={...pa,...t};let n=[];function o(){n=n.filter(r=>r().status==="pending")}return{query:function(r,i,s){const a=ga(e,r,i,(l,d)=>{o(),s&&s(l,d)});return n.push(a),a},find:function(r){return n.find(i=>r(i))||null},setIndex:r=>{e.index=r},getIndex:()=>e.index,cleanup:o}}function jr(){}const Fn=Object.create(null);function ma(t,e,n){let o,r;if(typeof t=="string"){const i=Bn(t);if(!i)return n(void 0,424),jr;r=i.send;const s=function(a){if(!Fn[a]){const l=Un(a);if(!l)return;const d={config:l,redundancy:Br(l)};Fn[a]=d}return Fn[a]}(t);s&&(o=s.redundancy)}else{const i=jn(t);if(i){o=Br(i);const s=Bn(t.resources?t.resources[0]:"");s&&(r=s.send)}}return o&&r?o.query(e,r,n)().abort:(n(void 0,424),jr)}function Hn(t,e){try{return t.getItem(e)}catch{}}function qn(t,e,n){try{return t.setItem(e,n),!0}catch{}}function Or(t,e){try{t.removeItem(e)}catch{}}function Vn(t,e){return qn(t,"iconify-count",e.toString())}function Xn(t){return parseInt(Hn(t,"iconify-count"))||0}const Nt={local:!0,session:!0},Wr={local:new Set,session:new Set};let Gn=!1,Bt=typeof window>"u"?{}:window;function Ur(t){const e=t+"Storage";try{if(Bt&&Bt[e]&&typeof Bt[e].length=="number")return Bt[e]}catch{}Nt[t]=!1}function Fr(t,e){const n=Ur(t);if(!n)return;const o=Hn(n,"iconify-version");if(o!=="iconify2"){if(o){const a=Xn(n);for(let l=0;l<a;l++)Or(n,"iconify"+l.toString())}return qn(n,"iconify-version","iconify2"),void Vn(n,0)}const r=Math.floor(Date.now()/36e5)-168,i=a=>{const l="iconify"+a.toString(),d=Hn(n,l);if(typeof d=="string"){try{const b=JSON.parse(d);if(typeof b=="object"&&typeof b.cached=="number"&&b.cached>r&&typeof b.provider=="string"&&typeof b.data=="object"&&typeof b.data.prefix=="string"&&e(b,a))return!0}catch{}Or(n,l)}};let s=Xn(n);for(let a=s-1;a>=0;a--)i(a)||(a===s-1?(s--,Vn(n,s)):Wr[t].add(a))}function Hr(){if(!Gn){Gn=!0;for(const t in Nt)Fr(t,e=>{const n=e.data,o=Me(e.provider,n.prefix);if(!$n(o,n).length)return!1;const r=n.lastModified||-1;return o.lastModifiedCached=o.lastModifiedCached?Math.min(o.lastModifiedCached,r):r,!0})}}function va(t,e){function n(o){let r;if(!Nt[o]||!(r=Ur(o)))return;const i=Wr[o];let s;if(i.size)i.delete(s=Array.from(i).shift());else if(s=Xn(r),s>=50||!Vn(r,s+1))return;const a={cached:Math.floor(Date.now()/36e5),provider:t.provider,data:e};return qn(r,"iconify"+s.toString(),JSON.stringify(a))}Gn||Hr(),e.lastModified&&!function(o,r){const i=o.lastModifiedCached;if(i&&i>=r)return i===r;if(o.lastModifiedCached=r,i)for(const s in Nt)Fr(s,a=>{const l=a.data;return a.provider!==o.provider||l.prefix!==o.prefix||l.lastModified===r});return!0}(t,e.lastModified)||Object.keys(e.icons).length&&(e.not_found&&delete(e=Object.assign({},e)).not_found,n("local")||n("session"))}function qr(){}function ya(t){t.iconsLoaderFlag||(t.iconsLoaderFlag=!0,setTimeout(()=>{t.iconsLoaderFlag=!1,function(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const n=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!n.length)return;let o=!1;const r=e.provider,i=e.prefix;n.forEach(s=>{const a=s.icons,l=a.pending.length;a.pending=a.pending.filter(d=>{if(d.prefix!==i)return!0;const b=d.name;if(e.icons[b])a.loaded.push({provider:r,prefix:i,name:b});else{if(!e.missing.has(b))return o=!0,!0;a.missing.push({provider:r,prefix:i,name:b})}return!1}),a.pending.length!==l&&(o||Nr([e],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}(t)}))}const wa=(t,e)=>{const n=function(l,d=!0,b=!1){const S=[];return l.forEach(x=>{const z=typeof x=="string"?Lt(x,d,b):x;z&&S.push(z)}),S}(t,!0,Lr()),o=function(l){const d={loaded:[],missing:[],pending:[]},b=Object.create(null);l.sort((x,z)=>x.provider!==z.provider?x.provider.localeCompare(z.provider):x.prefix!==z.prefix?x.prefix.localeCompare(z.prefix):x.name.localeCompare(z.name));let S={provider:"",prefix:"",name:""};return l.forEach(x=>{if(S.name===x.name&&S.prefix===x.prefix&&S.provider===x.provider)return;S=x;const z=x.provider,T=x.prefix,w=x.name,u=b[z]||(b[z]=Object.create(null)),p=u[T]||(u[T]=Me(z,T));let v;v=w in p.icons?d.loaded:T===""||p.missing.has(w)?d.missing:d.pending;const h={provider:z,prefix:T,name:w};v.push(h)}),d}(n);if(!o.pending.length){let l=!0;return e&&setTimeout(()=>{l&&e(o.loaded,o.missing,o.pending,qr)}),()=>{l=!1}}const r=Object.create(null),i=[];let s,a;return o.pending.forEach(l=>{const{provider:d,prefix:b}=l;if(b===a&&d===s)return;s=d,a=b,i.push(Me(d,b));const S=r[d]||(r[d]=Object.create(null));S[b]||(S[b]=[])}),o.pending.forEach(l=>{const{provider:d,prefix:b,name:S}=l,x=Me(d,b),z=x.pendingIcons||(x.pendingIcons=new Set);z.has(S)||(z.add(S),r[d][b].push(S))}),i.forEach(l=>{const{provider:d,prefix:b}=l;r[d][b].length&&function(S,x){S.iconsToLoad?S.iconsToLoad=S.iconsToLoad.concat(x).sort():S.iconsToLoad=x,S.iconsQueueFlag||(S.iconsQueueFlag=!0,setTimeout(()=>{S.iconsQueueFlag=!1;const{provider:z,prefix:T}=S,w=S.iconsToLoad;let u;delete S.iconsToLoad,w&&(u=Bn(z))&&u.prepare(z,T,w).forEach(p=>{ma(z,p,v=>{if(typeof v!="object")p.icons.forEach(h=>{S.missing.add(h)});else try{const h=$n(S,v);if(!h.length)return;const f=S.pendingIcons;f&&h.forEach(D=>{f.delete(D)}),va(S,v)}catch(h){console.error(h)}ya(S)})})}))}(l,r[d][b])}),e?function(l,d,b){const S=fa++,x=Nr.bind(null,b,S);if(!d.pending.length)return x;const z={id:S,icons:d,callback:l,abort:x};return b.forEach(T=>{(T.loaderCallbacks||(T.loaderCallbacks=[])).push(z)}),x}(e,o,i):qr},ba=/[\s,]+/;function _a(t,e){e.split(ba).forEach(n=>{switch(n.trim()){case"horizontal":t.hFlip=!0;break;case"vertical":t.vFlip=!0}})}function Sa(t,e=0){const n=t.replace(/^-?[0-9.]*/,"");function o(r){for(;r<0;)r+=4;return r%4}if(n===""){const r=parseInt(t);return isNaN(r)?0:o(r)}if(n!==t){let r=0;switch(n){case"%":r=25;break;case"deg":r=90}if(r){let i=parseFloat(t.slice(0,t.length-n.length));return isNaN(i)?0:(i/=r,i%1==0?o(i):0)}}return e}const Vr={...Dr,inline:!1},Ca={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Ea={display:"inline-block"},Kn={backgroundColor:"currentColor"},Xr={backgroundColor:"transparent"},Gr={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Kr={webkitMask:Kn,mask:Kn,background:Xr};for(const t in Kr){const e=Kr[t];for(const n in Gr)e[t+n]=Gr[n]}const jt={};function Jr(t){return t+(t.match(/^[-0-9.]+$/)?"px":"")}["horizontal","vertical"].forEach(t=>{const e=t.slice(0,1)+"Flip";jt[t+"-flip"]=e,jt[t.slice(0,1)+"-flip"]=e,jt[t+"Flip"]=e});const Yr=(t,e)=>{const n=function(u,p){const v={...u};for(const h in p){const f=p[h],D=typeof f;h in zr?(f===null||f&&(D==="string"||D==="number"))&&(v[h]=f):D===typeof v[h]&&(v[h]=h==="rotate"?f%4:f)}return v}(Vr,e),o={...Ca},r=e.mode||"svg",i={},s=e.style,a=typeof s!="object"||s instanceof Array?{}:s;for(let u in e){const p=e[u];if(p!==void 0)switch(u){case"icon":case"style":case"onLoad":case"mode":break;case"inline":case"hFlip":case"vFlip":n[u]=p===!0||p==="true"||p===1;break;case"flip":typeof p=="string"&&_a(n,p);break;case"color":i.color=p;break;case"rotate":typeof p=="string"?n[u]=Sa(p):typeof p=="number"&&(n[u]=p);break;case"ariaHidden":case"aria-hidden":p!==!0&&p!=="true"&&delete o["aria-hidden"];break;default:{const v=jt[u];v?p!==!0&&p!=="true"&&p!==1||(n[v]=!0):Vr[u]===void 0&&(o[u]=p)}}}const l=function(u,p){const v={...At,...u},h={...Dr,...p},f={left:v.left,top:v.top,width:v.width,height:v.height};let D=v.body;[v,h].forEach(J=>{const Y=[],fe=J.hFlip,Pe=J.vFlip;let Q,pe=J.rotate;switch(fe?Pe?pe+=2:(Y.push("translate("+(f.width+f.left).toString()+" "+(0-f.top).toString()+")"),Y.push("scale(-1 1)"),f.top=f.left=0):Pe&&(Y.push("translate("+(0-f.left).toString()+" "+(f.height+f.top).toString()+")"),Y.push("scale(1 -1)"),f.top=f.left=0),pe<0&&(pe-=4*Math.floor(pe/4)),pe%=4,pe){case 1:Q=f.height/2+f.top,Y.unshift("rotate(90 "+Q.toString()+" "+Q.toString()+")");break;case 2:Y.unshift("rotate(180 "+(f.width/2+f.left).toString()+" "+(f.height/2+f.top).toString()+")");break;case 3:Q=f.width/2+f.left,Y.unshift("rotate(-90 "+Q.toString()+" "+Q.toString()+")")}pe%2==1&&(f.left!==f.top&&(Q=f.left,f.left=f.top,f.top=Q),f.width!==f.height&&(Q=f.width,f.width=f.height,f.height=Q)),Y.length&&(D=function(Ht,qt,Vt){const et=function(ue,tt="defs"){let nt="";const je=ue.indexOf("<"+tt);for(;je>=0;){const ot=ue.indexOf(">",je),Oe=ue.indexOf("</"+tt);if(ot===-1||Oe===-1)break;const he=ue.indexOf(">",Oe);if(he===-1)break;nt+=ue.slice(ot+1,Oe).trim(),ue=ue.slice(0,je).trim()+ue.slice(he+1)}return{defs:nt,content:ue}}(Ht);return Ne=et.defs,Be=qt+et.content+Vt,Ne?"<defs>"+Ne+"</defs>"+Be:Be;var Ne,Be}(D,'<g transform="'+Y.join(" ")+'">',"</g>"))});const A=h.width,$=h.height,N=f.width,O=f.height;let F,M;A===null?(M=$===null?"1em":$==="auto"?O:$,F=Ar(M,N/O)):(F=A==="auto"?N:A,M=$===null?Ar(F,O/N):$==="auto"?O:$);const W={},V=(J,Y)=>{(fe=>fe==="unset"||fe==="undefined"||fe==="none")(Y)||(W[J]=Y.toString())};V("width",F),V("height",M);const ne=[f.left,f.top,N,O];return W.viewBox=ne.join(" "),{attributes:W,viewBox:ne,body:D}}(t,n),d=l.attributes;if(n.inline&&(i.verticalAlign="-0.125em"),r==="svg"){o.style={...i,...a},Object.assign(o,d);let u=0,p=e.id;return typeof p=="string"&&(p=p.replace(/-/g,"_")),o.innerHTML=function(v,h=la){const f=[];let D;for(;D=ca.exec(v);)f.push(D[1]);if(!f.length)return v;const A="suffix"+(16777216*Math.random()|Date.now()).toString(16);return f.forEach($=>{const N=typeof h=="function"?h($):h+(ua++).toString(),O=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");v=v.replace(new RegExp('([#;"])('+O+')([")]|\\.[a-z])',"g"),"$1"+N+A+"$3")}),v=v.replace(new RegExp(A,"g"),"")}(l.body,p?()=>p+"ID"+u++:"iconifyVue"),y.h("svg",o)}const{body:b,width:S,height:x}=t,z=r==="mask"||r!=="bg"&&b.indexOf("currentColor")!==-1,T=function(u,p){let v=u.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const h in p)v+=" "+h+'="'+p[h]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+v+">"+u+"</svg>"}(b,{...d,width:S+"",height:x+""});var w;return o.style={...i,"--svg":(w=T,'url("'+function(u){return"data:image/svg+xml,"+function(p){return p.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(u)}(w)+'")'),width:Jr(d.width),height:Jr(d.height),...Ea,...z?Kn:Xr,...a},y.h("span",o)};var Zr;if(Lr(!0),Zr=da,Nn[""]=Zr,typeof document<"u"&&typeof window<"u"){Hr();const t=window;if(t.IconifyPreload!==void 0){const e=t.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof e=="object"&&e!==null&&(e instanceof Array?e:[e]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!ia(o))&&console.error(n)}catch{console.error(n)}})}if(t.IconifyProviders!==void 0){const e=t.IconifyProviders;if(typeof e=="object"&&e!==null)for(let n in e){const o="IconifyProviders["+n+"] is invalid.";try{const r=e[n];if(typeof r!="object"||!r||r.resources===void 0)continue;ha(n,r)||console.error(o)}catch{console.error(o)}}}}const ka={...At,body:""},Jn=y.defineComponent({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(t,e){if(typeof t=="object"&&t!==null&&typeof t.body=="string")return this._name="",this.abortLoading(),{data:t};let n;if(typeof t!="string"||(n=Lt(t,!1,!0))===null)return this.abortLoading(),null;const o=function(i){const s=typeof i=="string"?Lt(i,!0,Ge):i;if(s){const a=Me(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===t||(this.abortLoading(),this._name="",o!==null&&(this._loadingIcon={name:t,abort:wa([n],()=>{this.counter++})})),null;this.abortLoading(),this._name!==t&&(this._name=t,e&&e(t));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 t=this.$attrs,e=this.iconMounted||t.ssr?this.getIcon(t.icon,t.onLoad):null;if(!e)return Yr(ka,t);let n=t;return e.classes&&(n={...t,class:(typeof t.class=="string"?t.class+" ":"")+e.classes.join(" ")}),Yr({...At,...e.data},n)}}),Ae=new Map,Ke=y.ref(new Map);class Je{static addWindowPanel(e){Ae.set(e.id,e)}static removeWindowPanel(e){Ae.has(e)&&(Ae.delete(e),Ke.value.delete(e))}static minimizeWindowPanel(e){Ae.has(e)&&Ke.value.set(e,-1)}static openWindowPanel(e){Ae.has(e)&&Ke.value.set(e,1)}}const xa=["src"],Ia={key:1,class:"paneltitle"},Ta={class:"dragPanelBar"},Ma={class:"dragPanelContent"},Ra={class:"drag-pointer-group"},Pa=(t=>(y.pushScopeId("data-v-39ea9741"),t=t(),y.popScopeId(),t))(()=>y.createElementVNode("span",{style:{"pointer-events":"all",visibility:"hidden"}},null,-1));var Yn=y.defineComponent({__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(t,{expose:e,emit:n}){const o=No(),r=t,i=n,s=y.ref(),a=y.ref(),l=y.computed(()=>r.isDark),d=y.ref({x:0,y:0}),b=250,S=100,x=y.ref({width:0,height:0}),z=M=>{s.value&&(s.value.style.left=`${M.x}px`,s.value.style.top=`${M.y}px`)};y.watch(()=>d.value,M=>{z(M)});const T=M=>{s.value&&(s.value.style.width=`${M.width}px`,s.value.style.height=`${M.height}px`)};y.watch(()=>x.value,M=>{T(M)});const w={eventListenerController:null,startingEdges:null,newEdges:null,clickStart:null,mount:()=>{Object.entries(w.refs).forEach(([M,W])=>{W.value&&W.value.addEventListener("mousedown",V=>{w.mouseDown(V,M)})})},mouseDown:(M,W)=>{M.button==0&&(M.preventDefault(),w.startingEdges={left:d.value.x,top:d.value.y,right:d.value.x+x.value.width,bottom:d.value.y+x.value.height},w.newEdges={...w.startingEdges},w.clickStart={x:M.clientX,y:M.clientY},w.eventListenerController=new AbortController,document.addEventListener("mousemove",V=>{w.mouseMove(V,W)},{signal:w.eventListenerController.signal}),document.addEventListener("mouseup",V=>{w.mouseUp(V,W)},{signal:w.eventListenerController.signal}))},mouseMove:(M,W)=>{if(w.startingEdges!=null&&w.newEdges!=null&&w.clickStart!=null&&w.refs[W].value){if(M.preventDefault(),console.log("mouseMove",W),W.toLowerCase().includes("north")){w.newEdges.top=Math.max(w.startingEdges.top+M.clientY-w.clickStart.y,0);const V=w.newEdges.bottom-w.newEdges.top-S;V<0&&(w.newEdges.top+=V)}else W.toLowerCase().includes("south")&&(w.newEdges.bottom=Math.min(w.startingEdges.bottom+M.clientY-w.clickStart.y,document.body.clientHeight));if(W.toLowerCase().includes("west")){w.newEdges.left=Math.max(w.startingEdges.left+M.clientX-w.clickStart.x,0);const V=w.newEdges.right-w.newEdges.left-b;V<0&&(w.newEdges.left+=V)}else W.toLowerCase().includes("east")&&(w.newEdges.right=Math.min(w.startingEdges.right+M.clientX-w.clickStart.x,document.body.clientWidth));w.update()}},update:()=>{w.newEdges==null||w.startingEdges==null||(d.value={x:Math.max(w.newEdges.left,0),y:Math.max(w.newEdges.top,0)},x.value={width:Math.min(Math.max(w.newEdges.right-w.newEdges.left,b),document.body.clientWidth),height:Math.min(Math.max(w.newEdges.bottom-w.newEdges.top,S),document.body.clientHeight)})},mouseUp:(M,W)=>{M.button!=0||w.startingEdges==null||(console.log("mouseUp",W),M.preventDefault(),w.startingEdges=null,w.newEdges=null,w.clickStart=null,w.eventListenerController&&(w.eventListenerController.abort(),w.eventListenerController=null))},refs:{northWest:y.ref(null),north:y.ref(null),northEast:y.ref(null),west:y.ref(null),east:y.ref(null),southWest:y.ref(null),south:y.ref(null),southEast:y.ref(null)}},u={startingMouse:null,startingPosition:null,mouseDown:M=>{M.button==0&&(M.preventDefault(),console.log("mouseDown"),u.startingMouse={x:M.clientX,y:M.clientY},u.startingPosition=d.value,document.addEventListener("mousemove",u.mouseMove),document.addEventListener("mouseup",u.mouseUp))},mouseMove:M=>{!u.startingMouse||!u.startingPosition||(M.preventDefault(),d.value={x:Math.min(Math.max(u.startingPosition.x+M.clientX-u.startingMouse.x,0),document.body.clientWidth-x.value.width),y:Math.min(Math.max(u.startingPosition.y+M.clientY-u.startingMouse.y,0),document.body.clientHeight-x.value.height)})},mouseUp:M=>{M.button!=0||!u.startingMouse||!u.startingPosition||(M.preventDefault(),u.startingMouse=null,u.startingPosition=null,console.log("mouseUp"),document.removeEventListener("mousemove",u.mouseMove),document.removeEventListener("mouseup",u.mouseUp))}};function p(M){return{id:o,icon:r.icon,title:r.title,pid:r.pid,data:M??r.tag}}const v=y.computed(()=>Ke.value.get(o)!==-1),h=y.ref(!1),f=y.ref(!0);function D(){i("minimize",p()),Je.minimizeWindowPanel(o)}function A(){h.value=!h.value}function $(){i("close",p(!1)),Je.removeWindowPanel(o),f.value=!1}const N=y.computed(()=>h.value?"heroicons-outline:square-2-stack":"ant-design:border-outlined"),O={id:o,isShow:v,close:$,open:function(){i("open",p(!0)),f.value=!0},showHidePanel:D};function F(M){if(cn(M))return M;{const W=Number(M);if(W==W)return W;if(M.endsWith("px")){const V=M.substring(0,M.length-2);return Number(V)}if(M.endsWith("%")){const V=M.substring(0,M.length-1);return Number(V)/100*document.body.clientWidth}return 300}}return e(O),y.onMounted(()=>{(function(){let M=90;if(r.hasMin||(M-=30),r.hasMax||(M-=30),r.hasClose||(M-=30),ae.setCssVar("--right-bar-width",M+"px",a.value),!a.value)return;const W=cn(r.titleHeight)?r.titleHeight+"px":r.titleHeight;a.value.style.height=W,a.value.style.lineHeight=W})(),function(){const M=p(O);Je.addWindowPanel(M),i("loaded",M)}(),d.value.x=F(r.left),d.value.y=F(r.top),z(d.value),x.value={width:F(r.nWidth),height:F(r.nHeight)},T(x.value),w.mount()}),y.onUnmounted(()=>{Je.removeWindowPanel(o)}),(M,W)=>(y.openBlock(),y.createBlock(y.Transition,{appear:"","enter-active-class":"animated zoomIn","leave-active-class":"animated zoomOut"},{default:y.withCtx(()=>[f.value?y.withDirectives((y.openBlock(),y.createElementBlock("div",{key:0,ref_key:"dragPanelRef",ref:s,class:y.normalizeClass(["dragWindowPanel",{maxPanel:h.value,dragWindowPanel_dark:l.value}])},[y.createElementVNode("div",{class:"dragPanelTitle",ref_key:"dragPanelTitleRef",ref:a,onMousedown:W[0]||(W[0]=(...V)=>u.mouseDown&&u.mouseDown(...V))},[y.renderSlot(M.$slots,"title",{},()=>[r.icon?(y.openBlock(),y.createElementBlock("img",{key:0,src:r.icon,width:"24",height:"24"},null,8,xa)):y.createCommentVNode("v-if",!0),r.title?(y.openBlock(),y.createElementBlock("span",Ia,y.toDisplayString(r.title),1)):y.createCommentVNode("v-if",!0)]),y.createElementVNode("div",Ta,[t.hasMin?(y.openBlock(),y.createBlock(y.unref(Jn),{key:0,icon:"ant-design:minus-outlined",onClick:D})):y.createCommentVNode("v-if",!0),t.hasMax?(y.openBlock(),y.createBlock(y.unref(Jn),{key:1,icon:N.value,onClick:A},null,8,["icon"])):y.createCommentVNode("v-if",!0),t.hasClose?(y.openBlock(),y.createBlock(y.unref(Jn),{key:2,icon:"ant-design:close-outlined",onClick:$})):y.createCommentVNode("v-if",!0)])],544),y.createElementVNode("div",Ma,[y.renderSlot(M.$slots,"default")]),y.createElementVNode("div",Ra,[y.createElementVNode("div",{class:"cursor-nw-resize",ref:w.refs.northWest},null,512),y.createElementVNode("div",{class:"cursor-n-resize",ref:w.refs.north},null,512),y.createElementVNode("div",{class:"cursor-ne-resize",ref:w.refs.northEast},null,512),y.createElementVNode("div",{class:"cursor-w-resize",ref:w.refs.west},null,512),Pa,y.createElementVNode("div",{class:"cursor-e-resize",ref:w.refs.east},null,512),y.createElementVNode("div",{class:"cursor-sw-resize",ref:w.refs.southWest},null,512),y.createElementVNode("div",{class:"cursor-s-resize",ref:w.refs.south},null,512),y.createElementVNode("div",{class:"cursor-se-resize",ref:w.refs.southEast},null,512)])],2)),[[y.vShow,v.value]]):y.createCommentVNode("v-if",!0)]),_:3}))}});Yn.__scopeId="data-v-39ea9741",Yn.__file="src/controls/xwindow/XWindow.vue";const Ot=new Map,Zn=new Map;let Wt;const La={getDefaultClient(){if(Wt||(Wt=new Ue(SysConfig.DefaultHproseAPI)),!Wt)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return Wt},registerHprose(t,e){const n=Zn.get(t);if(!n){const o=new Ue(e);Ot.set(t,o)}return n},getHprose:t=>Zn?.get(t),getProxyHprose:t=>Ot.get(t),unregisterHprose(t){Ot.get(t)&&(Zn.delete(t),Ot.delete(t))}},Re={Login:"/api/User/Login",ChangeMyPwd:"/api/User/ChangeMyPwd",Logout:"/api/Check/ExitLogin",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken",GetSystemRights:"/api/System/GetSystem"},Qn="access_token",za=j.Config.ServiceURL.LoginAuthURL;function eo(){const t=Go();t&&ve(Re.RefreshToken,za,{refreshToken:t}).then(e=>{to(e.data)})}function Qr(){const t=me.getJsonObject(Qn);if(!t)return;const e=new Date().getTime(),n=new Date(t.expire).getTime()-e;n>0&&(n<=5e3?eo():setTimeout(eo,n-5e3))}function to(t){const e=new Date().getTime();let n=new Date(t.accessToken.expires).getTime()-e;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=Ee();o?(o.token=t.accessToken.tokenContent,o.expire=t.accessToken.expires,o.refresh=t.refreshToken.tokenContent):o={token:t.accessToken.tokenContent,expire:t.accessToken.expires,refresh:t.refreshToken.tokenContent},me.set(Qn,o,n/1e3),Qr()}else me.remove(Qn)}const Ut="Wm314243",Ft=j.Config.ServiceURL.LoginAuthURL,no="ROLE_SYSTEM_RIGHT",oo=new gt("",sessionStorage);function ei(){return oo.get(no)}function ro(t){oo.set(no,t)}function ti(){oo.remove(no)}function $e(t){if(t)for(let e=0;e<t.length;e++){const n=t[e];n.children&&n.children.length>0?($e(n.children),n.children.length===0&&(t.splice(e,1),e--)):n.selected||(t.splice(e,1),e--)}}function ni(t,e,n="name"){t&&e&&t.forEach(o=>{const r=e.find(i=>i[n]===o[n]);r&&(o.children?r.children&&ni(o.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(o.selected=r.selected))})}function Ye(t,e,n,o="name"){const r=t[n],i=e[n];r?i&&ni(r,i,o):i&&(t[n]=i)}function oi(t){if(t&&t.length>0){const e=t.length;let n,o=!1;if(e>0){o=_e(t[0]);const r=o?t[0]:JSON.parse(t[0]);if(e>1)for(let i=1;i<t.length;i++){const s=t[i],a=o?s:JSON.parse(s);Ye(r,a,"routes","name"),Ye(r,a,"widgetMenu","name"),Ye(r,a,"widgets","id"),Ye(r,a,"functions","id")}n=r}return n&&($e(n.routes),$e(n.widgetMenu),$e(n.widgets),$e(n.functions)),n}}const io=[],so=[],ao=[];function Ze(){return ei()}function ri(t,e){const n={...t};return n.meta||(n.meta={}),e.index!=null&&(n.meta.index=e.index),e.title!=null&&(n.meta.title=e.title),t.children&&(n.children=[],e.children&&e.children.forEach(o=>{const r=t.children?.find(i=>i.path===o.path);if(r){const i=ri(r,o);i&&n.children?.push(i)}})),n}function ii(t,e){const n={...t};return e.index!=null&&(n.index=e.index),t.children&&(n.children=[],e.children&&e.children.forEach(o=>{const r=t.children?.find(i=>i.name===o.name);if(r){const i=ii(r,o);i&&n.children?.push(i)}})),n}exports.BigFileDownload=class{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,n=3,o=6,r=6e4){this.fileID=t,this.downloadURL=e,this.chunkByteSize=n*this.ChunkUnitM,this.eventTarget=mn(),this.initIndexDB(),o>=3&&(this.cacheSize=o),r>this.requestTimeout&&(this.requestTimeout=r)}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="",n){this.dispatchInfo("\u5F00\u59CB\u83B7\u53D6\u6587\u4EF6\u4FE1\u606F");const o=await ve(e,t,n);let r=null;return o&&o.status===200&&(r=o.data),r}async getIFileMeta(){if(this.fileMetaData===null){const t=await this.currentDB?.getItem("fileinfo");this.fileMetaData=t||null}return this.fileMetaData}initIndexDB(){this.currentDB=wt.createInstance({name:this.fileID,driver:wt.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(),wt.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 n=t;if(!n&&this.downloadURL&&(n=this.downloadURL),!n)throw Error("\u4E0B\u8F7DURL\u4E0D\u80FD\u4E3A\u7A7A!");this.currentDB||this.initIndexDB();const o=j.Axios.CancelToken;this.cancelSource=o.source(),this.isStarting=!0;const r={key:this.fileMetaData?.downloadID};let i=0;const s=this.cacheSize;let a=0;for(let l=0;l<this.totalChunks;l++){if(this.keys&&this.keys?.indexOf(l.toString())>=0){i++,i>this.finishNum&&(this.finishNum=i,this.downloadProgress());continue}const d=l*this.chunkByteSize;let b=d+this.chunkByteSize-1;this.fileMetaData&&b>this.fileMetaData.length&&(b=this.fileMetaData.length-1);const S={range:`bytes=${d}-${b}`};for(;a>=s;)await this.sleep(200);const x=l.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${l+1}/${this.totalChunks}`),a++,ve(n,e,r,S,"arraybuffer",this.cancelSource?.token,this.requestTimeout).then(async z=>{const T=z.data;a--,await this.currentDB?.setItem(x,T),i++,i>this.finishNum&&(this.finishNum=i,this.downloadProgress());const w=parseInt(x)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${w}/${this.totalChunks}`),this.savefile()}).catch(z=>{a--;const T=parseInt(x)+1;this.dispatchError(`\u4E0B\u8F7D\u7B2C${T}\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=vs.createWriteStream(this.fileName).getWriter();let e=0;for(let n=0;n<this.totalChunks;n++){const o=n.toString();let r=await this.currentDB?.getItem(o);if(r||(r=await this.currentDB?.getItem(o)),!r)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${n+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);let i=new Response(r).body;if(i===null)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${n+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);const s=i.getReader();for(;;){const{done:a,value:l}=await s.read();if(a)break;await t.write(l)}e++,this.outputProgress(e),this.dispatchInfo(`\u5B8C\u6210\u7B2C${n+1}\u4E2A\u5206\u7247\u8F93\u51FA`)}t.close(),wt.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}},exports.Download=vt,exports.DownloadByUrl=function({url:t,target:e="_blank",fileName:n}){const o=new URL(t).host==location.host;return new Promise((r,i)=>{if(o){const s=document.createElement("a");if(s.href=t,s.target=e,s.download!==void 0&&(s.download=n||Oo(t)),document.createEvent){const a=document.createEvent("MouseEvents");return a.initEvent("click",!0,!0),s.dispatchEvent(a),r(!0)}return t.indexOf("?")===-1&&(t+="?download"),window.open(t,e),r(!0)}{const s=document.createElement("canvas"),a=document.createElement("img");a.setAttribute("crossOrigin","Anonymous"),a.src=t,a.onload=l=>{s.width=a.width,s.height=a.height,s.getContext("2d").drawImage(a,0,0,a.width,a.height),s.toBlob(d=>{if(d){const b=document.createElement("a");b.href=window.URL.createObjectURL(d),b.download=Oo(t),b.click(),URL.revokeObjectURL(b.href),r(!0)}},"image/jpeg")},a.onerror=l=>i(l)}})},exports.FileUpload=tr,exports.GetSignalRClient=function(t){if(!t){if(xt)return xt;throw new Error("\u9996\u6B21\u6784\u5EFA\uFF0CsignalrURL\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\uFF01")}const e=new qs().configureLogging(I.Information).withUrl(t).withAutomaticReconnect({nextRetryDelayInMilliseconds:()=>5e3}).build();return e.keepAliveIntervalInMilliseconds=15e3,e.serverTimeoutInMilliseconds=18e5,e.start().then(()=>{j.Logger().info("\u542F\u52A8SignalR\u8FDE\u63A5\uFF01")}),e.onclose(async()=>{j.Logger().info("\u65AD\u5F00SignalR\u8FDE\u63A5!")}),e.onreconnecting(()=>{j.Logger().warn("SignalR\u670D\u52A1\u5DF2\u65AD\u7EBF\uFF0C\u91CD\u8FDE\u4E2D...\uFF01")}),e.onreconnected(()=>{j.Logger().warn("SignalR\u91CD\u8FDE\u6210\u529F!")}),xt||(xt=e),e},exports.Global=j,exports.GlobalHprose=La,exports.GlobalMitt=Ce,exports.H5Tool=ae,exports.HproseClient=Qe,exports.HttpDownload=(t,e,n)=>{t.get(e,{responseType:"blob"}).then(function(o){vt(o.data,n)}).catch(o=>{console.warn(o),Ce.emit(re.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})},exports.JsonDownload=jo,exports.LayoutContainer=Pt,exports.LayoutManager=xr,exports.MinWindowMap=Ke,exports.ObjToUrlParams=function(t,e){let n="",o="";for(const r in e)n+=r+"="+encodeURIComponent(e[r])+"&";return n=n.replace(/&$/,""),o=/\?$/.test(t)?t+n:t.replace(/\/?$/,"?")+n,o},exports.Pane=nn,exports.ProxyClient=Ue,exports.RouterTransition=zn,exports.SaveAs=function(t,e){const n=window.URL||window.webkitURL||window,o=new Blob([t]),r=document.createElement("a");r.href=n.createObjectURL(o),r.download=e,r.click(),n.revokeObjectURL(r.href)},exports.Splitpanes=Ki,exports.Storage=gt,exports.StringUtils=pt,exports.StyleBlack={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)"}},exports.StyleGrayblue={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)"}},exports.StyleMetal={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)"}},exports.StyleWhite={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)"}},exports.SuspenseWithError=Rt,exports.SysEvents=re,exports.TOKEN_REFRESH_TIME=5e3,exports.TOKEN_VALID_TIMESPAN=36e5,exports.USER_TOKEN_API=Re,exports.VWindow=Mt,exports.WaterMark=bs,exports.WindowResizeEvent=Er,exports.WindowType=Ks,exports.WindowsMap=Ae,exports.XWindow=Yn,exports.XWindowManager=Je,exports.XXTEA=He,exports.calculateBestTextColor=function(t){return function(e,n){return(Bo(~~e[0],~~e[1],~~e[2])+.05)/(Bo(n[0],n[1],n[2])+.05)}(fn(t.substring(1)).split(","),[0,0,0])>=12?"#000000":"#FFFFFF"},exports.changeMyPWD=function(t){const e={oldpwd:He.encryptToString(t.oldpwd,Ut),newpwd:He.encryptToString(t.newpwd,Ut)};return ve(Re.ChangeMyPwd,Ft,e)},exports.checkDoRefreshToken=Qr,exports.checkToken=function(t){return ve(Re.CheckToken,Ft,{token:t})},exports.clearLocalToken=wn,exports.clearRight=ti,exports.colorIsDark=function(t){if(!mt(t))return;const[e,n,o]=fn(t).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(r=>Number(r));return .299*e+.578*n+.114*o<192},exports.createFileUpload=t=>new tr(t),exports.darken=function(t,e){return t=t.indexOf("#")>=0?t.substring(1,t.length):t,e=Math.trunc(255*e/100),`#${gn(t.substring(0,2),e)}${gn(t.substring(2,4),e)}${gn(t.substring(4,6),e)}`},exports.deepMerge=function t(e={},n={}){let o;for(o in n)_e(n[o])?e[o]=t(e[o],n[o]):e[o]=n[o];return e},exports.delay=Wo,exports.deserialize=function(t){return t==null||t===""?t:new ze.Reader(new ze.ByteStream(t)).deserialize()},exports.doRefreshToken=eo,exports.exportSystemRights=ar,exports.get=function(t,e){return ve(t,void 0,e)},exports.getCurrentSystemRight=Ze,exports.getData=function(t,e){return j.Axios?.get(t,{params:e}).catch(function(n){yt(n,t,"","\u5916\u90E8Get")})},exports.getEncryptPWD=function(t){return He.encryptToString(t,Ut)},exports.getFunctions=function(t,e=2){if(e===0)return t;const n=Ze();return n?n.functions:void 0},exports.getHexColor=function(t){const e=t.toLowerCase().replace(/rgb?a?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),n=parseFloat(e[3]||"1"),o=Math.floor(n*parseInt(e[0])+255*(1-n)),r=Math.floor(n*parseInt(e[1])+255*(1-n)),i=Math.floor(n*parseInt(e[2])+255*(1-n));return"#"+("0"+o.toString(16)).slice(-2)+("0"+r.toString(16)).slice(-2)+("0"+i.toString(16)).slice(-2)},exports.getLocalToken=Ee,exports.getLockState=function(){return me.get(En,!1)},exports.getLongHexColor=function(t){const e=t;if(e.length===4){let o="#";for(var n=1;n<4;n+=1){const r=e.slice(n,n+1);o+=r.concat(r)}return o}return e},exports.getProxyClient=nr,exports.getRGBColor=function(t){var e=t.toLowerCase();if(mt(t)){if(e.length===4){for(var n="#",o=1;o<4;o+=1){const i=e.slice(o,o+1);n+=i.concat(i)}e=n}var r=[];for(o=1;o<7;o+=2)r.push(parseInt("0x"+e.slice(o,o+2)));return"rgb("+r.join(",")+")"}return e},exports.getRGBColorFromHSLA=function(t){if(t){var e=t.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(e){var n,o,r,i=(parseFloat(e[1])%360+360)%360/360,s=parseFloat(e[2])/(/%$/.test(e[2])?100:1),a=parseFloat(e[3])/(/%$/.test(e[3])?100:1);if(s===0)n=o=r=a;else{var l=a<=.5?a*(s+1):a+s-a*s,d=2*a-l;n=dn(d,l,i+1/3),o=dn(d,l,i),r=dn(d,l,i-1/3)}return`rgba(${n=Math.round(255*n)},${o=Math.round(255*o)},${r=Math.round(255*r)},${e[4]?parseFloat(e[4]):1})`}}},exports.getRefreshToken=Go,exports.getRight=ei,exports.getRoutes=function(t,e=2){if(e===0)return t;const n=Ze();return n&&n.routes?(ao.length>0||t.forEach(o=>{const r=n.routes?.find(i=>i.name===o.name);if(r){const i=ri(o,r);i&&ao.push(i)}}),ao):void 0},exports.getSystemRoleRight=async function(t,e=!1){ti();const n=Re.GetSystemRights,o=j.Config.ServiceURL.LoginAuthURL,r=await ve(n,o,{systemid:t});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(e){const s=JSON.parse(i[0]);return ro(s),s}{const s=oi(i);return ro(s),s}}},exports.getWidgetConfig=function(t,e=2){if(e===0)return t;const n=Ze();return n&&n.widgets?(io.length>0||t?.forEach(o=>{n.widgets?.find(r=>r.id===o.id)&&io.push(o)}),io):void 0},exports.getWidgetMenus=function(t,e=2){if(e===0)return t;const n=Ze();return n&&n.widgetMenu?(so.length>0||t.forEach(o=>{const r=n.widgetMenu?.find(i=>i.name===o.name);if(r){const i=ii(o,r);i&&so.push(i)}}),so):void 0},exports.handleNodes=$e,exports.hexToRGB=fn,exports.init=function(t,e,n){!j.Config.DefaultHproseAPI&&j.Config.ServiceURL&&(j.Config.DefaultHproseAPI=j.Config.ServiceURL.DefaultHproseAPI),j.Config.DefaultHproseAPI&&pt.isNotEmpty(j.Config.DefaultHproseAPI)&&(j.DefaultProxyClient=new Ue(j.Config.DefaultHproseAPI));const o=j.Config.UI.GrayMode;o&&ae.setGrayMode(o);const r=new qo(t,j.EventBus);j.Message=r,j.SystemID=e,j.SystemGroup=n,j.EventBus.on(re.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(re.WebAPIErrorEvent,i=>{const s=`WebAPI\u540E\u53F0\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("WebAPI\u8BF7\u6C42\u9519\u8BEF",s)}),j.EventBus.on(re.AxiosRequestErrorEvent,i=>{const s=`Http\u8BF7\u6C42'${i.code}'\u9519\u8BEF: ${i.message}`;console.warn("Http\u8BF7\u6C42\u9519\u8BEF",s)}),j.EventBus.on(re.CommonWarnEvent,i=>{r.warn(i)})},exports.initDefaultProxyClient=function(t){const e=nr(t);return e&&(j.DefaultProxyClient=e),e},exports.is=se,exports.isArray=ln,exports.isAsyncFunction=function(t){return se(t,"AsyncFunction")},exports.isBoolean=function(t){return t===!0||t===!1||se(t,"Boolean")},exports.isClient=()=>typeof window<"u",exports.isDate=function(t){return se(t,"Date")},exports.isDef=$o,exports.isElement=t=>_e(t)&&!!t.tagName,exports.isEmpty=function(t){return t==null||(dt(t)||ln(t)?t.length===0:!!_e(t)&&JSON.stringify(t)==="{}")},exports.isEnumColor=function(t){if(typeof t=="object"||!t)return;const e=t.toLowerCase().substring(0,1);return e==="#"?exports.EnumColor.Hex:e==="r"||e==="("?exports.EnumColor.RGBA:e==="h"?exports.EnumColor.Hsla:exports.EnumColor.RGBA},exports.isError=function(t){return se(t,"Error")},exports.isFunction=ht,exports.isHexColor=mt,exports.isImageDom=function(t){return t&&["IMAGE","IMG"].includes(t.tagName)},exports.isMap=function(t){return se(t,"Map")},exports.isNull=an,exports.isNullAndUnDef=function(t){return sn(t)&&an(t)},exports.isNullOrUnDef=function(t){return sn(t)||an(t)},exports.isNumber=cn,exports.isObjectX=_e,exports.isPromise=function(t){return se(t,"Promise")&&_e(t)&&ht(t.then)&&ht(t.catch)},exports.isServer=ts,exports.isString=dt,exports.isSymbol=function(t){return se(t,"Symbol")},exports.isUnDef=sn,exports.isValidURL=t=>/^(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(t),exports.isWeakMap=function(t){return se(t,"WeakMap")},exports.isWeakSet=function(t){return se(t,"WeakSet")},exports.isWindow=t=>typeof window<"u"&&se(t,"Window"),exports.jquery=gs,exports.lighten=function(t,e){return t=t.indexOf("#")>=0?t.substring(1,t.length):t,e=Math.trunc(255*e/100),`#${pn(t.substring(0,2),e)}${pn(t.substring(2,4),e)}${pn(t.substring(4,6),e)}`},exports.login=async function(t){const e={username:t.username,pwd:He.encryptToString(t.pwd,Ut)},n=(await ve(Re.Login,Ft,e))?.data;return n&&to(n.doubletoken),n},exports.logout=function(){const t=Ee();t&&(Jo(Re.Logout,Ft,{token:t.token,reftoken:t.refresh}),wn())},exports.mergeFilterRoleSysRight=oi,exports.mergeNodes=function t(e,n,o="name"){e&&n&&e.forEach(r=>{const i=n.find(s=>s[o]===r[o]);i&&(r.children?i.children&&t(r.children,i.children,o):(!i.children||i.children.length===0)&&i.selected&&(r.selected=i.selected))})},exports.mergeNodesAll=Ye,exports.newGuid=function(){var t=new Date().getTime(),e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var o=(t+16*Math.random())%16|0;return t=Math.floor(t/16),(n==="x"?o:3&o|8).toString(16)});return e},exports.onLockListener=function(){xn(),document.addEventListener("mousedown",xn)},exports.post=function(t,e){return Ko(t,void 0,e)},exports.requestGet=ve,exports.requestPost=Ko,exports.requestPostBody=Jo,exports.rgbToHex=function(t,e,n){const o=(t<<16|e<<8|n).toString(16);return"#"+new Array(Math.abs(o.length-7)).join("0")+o},exports.serialize=function(t){const e=new ze.Writer(new ze.ByteStream);return e.serialize(t),e.stream.toString()},exports.setLocalToken=to,exports.setRight=ro,exports.sleep=function(t){const e=new Date().getTime();let n=new Date().getTime();for(;n-e<t;)n=new Date().getTime();console.log(`\u5F3A\u5236\u7B49\u5F85${Wo}\u6BEB\u79D2`)},exports.storage=os,exports.storageHelper=me,exports.unLockListener=function(){document.removeEventListener("mousedown",xn)},exports.uuid=No,exports.verifiyNumberInteger=function(t){let e=t.replace(/(^\s*)|(\s*$)/g,"");return e=e.replace(/[\.]*/g,""),e=e.replace(/(^0[\d]*)$/g,"0"),e=e.replace(/^0\d$/g,"0"),e=e.replace(/[^\d]/g,""),e},exports.verifyAccount=function(t){return!!/^[a-zA-Z][a-zA-Z0-9_]{4,15}$/.test(t)},exports.verifyAndSpace=function(t){return t.replace(/(^\s*)|(\s*$)/g,"")},exports.verifyCarNum=function(t){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(t)},exports.verifyCnAndSpace=function(t){let e=t.replace(/[\u4e00-\u9fa5\s]+/g,"");return e=e.replace(/(^\s*)|(\s*$)/g,""),e},exports.verifyEmail=function(t){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(t)},exports.verifyEnAndSpace=function(t){let e=t.replace(/[a-zA-Z]+/g,"");return e=e.replace(/(^\s*)|(\s*$)/g,""),e},exports.verifyFullName=function(t){return!!/^[\u4e00-\u9fa5]{1,6}(·[\u4e00-\u9fa5]{1,6}){0,2}$/.test(t)},exports.verifyIPAddress=function(t){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(t)},exports.verifyIdCard=function(t){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(t)},exports.verifyNumberCnUppercase=function(t,e="\u4EDF\u4F70\u62FE\u4EBF\u4EDF\u4F70\u62FE\u4E07\u4EDF\u4F70\u62FE\u5143\u89D2\u5206",n=""){let o=(t+="00").indexOf(".");o>=0&&(t=t.substring(0,o)+t.substr(o+1,2)),e=e.substr(e.length-t.length);for(let r=0;r<t.length;r++)n+="\u96F6\u58F9\u8D30\u53C1\u8086\u4F0D\u9646\u67D2\u634C\u7396".substr(t.substr(r,1),1)+e.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")},exports.verifyNumberComma=function(t){let e=Tn(t);return e=e.toString().split("."),e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e=e.join("."),e},exports.verifyNumberIntegerAndFloat=Tn,exports.verifyNumberPercentage=function(t){let e=t.replace(/(^\s*)|(\s*$)/g,"");return e=e.replace(/[^\d]/g,""),e=e.replace(/^0/g,""),e=e.replace(/^[1-9]\d\d{1,3}$/,"100"),e},exports.verifyNumberPercentageFloat=function(t){let e=Tn(t);return e=e.replace(/^[1-9]\d\d{1,3}$/,"100"),e=e.replace(/^100\.$/,"100"),e},exports.verifyPassword=function(t){return!!/^[a-zA-Z]\w{5,15}$/.test(t)},exports.verifyPasswordPowerful=function(t){return!!/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(t)},exports.verifyPasswordStrength=function(t){let e="";return/^(?:\d+|[a-zA-Z]+|[!@#$%^&\.*]+){6,16}$/.test(t)&&(e="\u5F31"),/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(t)&&(e="\u4E2D"),/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(t)&&(e="\u5F3A"),e},exports.verifyPhone=function(t){return!!/^((12[0-9])|(13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0|1,5-9]))\d{8}$/.test(t)},exports.verifyPostalCode=function(t){return!!/^[1-9][0-9]{5}$/.test(t)},exports.verifyTelPhone=function(t){return!!/\d{3}-\d{8}|\d{4}-\d{7}/.test(t)},exports.verifyTextColor=function(t,e="",n="red"){return e.replace(new RegExp(t,"gi"),`<span style='color: ${n}'>${t}</span>`)},exports.verifyUrl=function(t){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(t)},exports.writeIconifyList=function(t,e="IconifyList.ts"){let n="",o=`const iconlist={
|
|
9
9
|
`,r=0;t.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
10
|
`,o+=` '${i}':${a},
|
|
11
11
|
`,r++}}),r>0&&(o+=`};
|