xframelib 0.7.9 → 0.8.1
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 +114 -17
- package/dist/controls/layoutcontainer/layout.vue.d.ts +22 -20
- package/dist/controls/routertransition/RouterTransition.vue.d.ts +1 -1
- package/dist/controls/routertransition/RouterTransitionAnimate.vue.d.ts +29 -0
- package/dist/controls/routertransition/SuspenseWithError.vue.d.ts +2 -2
- package/dist/controls/routertransition/index.d.ts +2 -1
- package/dist/controls/vuewindow/window/Button.vue.d.ts +7 -7
- package/dist/controls/vuewindow/window/index.vue.d.ts +12 -10
- package/dist/controls/xwindow/XWindow.vue.d.ts +6 -6
- package/dist/controls/xwindow/XWindowManager.d.ts +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.css +16 -1
- package/dist/index.js +5 -5
- package/dist/model/Layout.d.ts +14 -5
- package/package.json +19 -19
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{h as yn,openBlock as X,createElementBlock as pt,normalizeStyle as Xt,renderSlot as st,defineComponent as Mt,ref as K,withModifiers as er,getCurrentInstance as ws,computed as Vt,watch as Pt,onMounted as wn,onBeforeUnmount as bs,nextTick as nr,resolveComponent as bn,createBlock as at,Transition as _n,withCtx as It,withDirectives as or,createElementVNode as Y,Fragment as zt,createTextVNode as Sn,toDisplayString as Cn,createCommentVNode as mt,vShow as rr,markRaw as _s,onErrorCaptured as Ss,Suspense as Cs,createVNode as En,KeepAlive as Es,resolveDynamicComponent as Tt,reactive as xs,toRefs as ks,renderList as Gt,onUnmounted as Is,normalizeClass as Ts,unref as xn,pushScopeId as Rs,popScopeId as Ms}from"vue";import Ps from"axios";import zs from"qs";import{Client as Ls,ClientContext as kn}from"@hprose/rpc-core";import{ByteStream as _e,Writer as As,Reader as Ds}from"@hprose/io";import{HttpTransport as $s}from"@hprose/rpc-html5";var Ns={name:"splitpanes",props:{horizontal:{type:Boolean},pushOtherPanes:{type:Boolean,default:!0},dblClickSplitter:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean}},provide(){return{requestUpdate:this.requestUpdate,onPaneAdd:this.onPaneAdd,onPaneRemove:this.onPaneRemove,onPaneClick:this.onPaneClick}},data:()=>({container:null,ready:!1,panes:[],touch:{mouseDown:!1,dragging:!1,activeSplitter:null},splitterTaps:{splitter:null,timeoutId:null}}),computed:{panesCount(){return this.panes.length},indexedPanes(){return this.panes.reduce((e,t)=>(e[t.id]=t)&&e,{})}},methods:{updatePaneComponents(){this.panes.forEach(e=>{e.update&&e.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[e.id].size}%`})})},bindEvents(){document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),document.addEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.addEventListener("touchmove",this.onMouseMove,{passive:!1}),document.addEventListener("touchend",this.onMouseUp))},unbindEvents(){document.removeEventListener("mousemove",this.onMouseMove,{passive:!1}),document.removeEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.removeEventListener("touchmove",this.onMouseMove,{passive:!1}),document.removeEventListener("touchend",this.onMouseUp))},onMouseDown(e,t){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=t},onMouseMove(e){this.touch.mouseDown&&(e.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(e)),this.$emit("resize",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(e,t){"ontouchstart"in window&&(e.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===t?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(e,t),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=t,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[t])},onSplitterDblClick(e,t){let n=0;this.panes=this.panes.map((o,r)=>(o.size=r===t?o.max:o.min,r!==t&&(n+=o.min),o)),this.panes[t].size-=n,this.$emit("pane-maximize",this.panes[t])},onPaneClick(e,t){this.$emit("pane-click",this.indexedPanes[t])},getCurrentMouseDrag(e){const t=this.container.getBoundingClientRect(),{clientX:n,clientY:o}="ontouchstart"in window&&e.touches?e.touches[0]:e;return{x:n-t.left,y:o-t.top}},getCurrentDragPercentage(e){e=e[this.horizontal?"y":"x"];const t=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(e=t-e),100*e/t},calculatePanesSize(e){const t=this.touch.activeSplitter;let n={prevPanesSize:this.sumPrevPanesSize(t),nextPanesSize:this.sumNextPanesSize(t),prevReachedMinPanes:0,nextReachedMinPanes:0};const o=0+(this.pushOtherPanes?0:n.prevPanesSize),r=100-(this.pushOtherPanes?0:n.nextPanesSize),i=Math.max(Math.min(this.getCurrentDragPercentage(e),r),o);let s=[t,t+1],a=this.panes[s[0]]||null,l=this.panes[s[1]]||null;const d=a.max<100&&i>=a.max+n.prevPanesSize,w=l.max<100&&i<=100-(l.max+this.sumNextPanesSize(t+1));if(d||w)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(t+1),0),l.size=l.max);else{if(this.pushOtherPanes){const _=this.doPushOtherPanes(n,i);if(!_)return;({sums:n,panesToResize:s}=_),a=this.panes[s[0]]||null,l=this.panes[s[1]]||null}a!==null&&(a.size=Math.min(Math.max(i-n.prevPanesSize-n.prevReachedMinPanes,a.min),a.max)),l!==null&&(l.size=Math.min(Math.max(100-i-n.nextPanesSize-n.nextReachedMinPanes,l.min),l.max))}},doPushOtherPanes(e,t){const n=this.touch.activeSplitter,o=[n,n+1];return t<e.prevPanesSize+this.panes[o[0]].min&&(o[0]=this.findPrevExpandedPane(n).index,e.prevReachedMinPanes=0,o[0]<n&&this.panes.forEach((r,i)=>{i>o[0]&&i<=n&&(r.size=r.min,e.prevReachedMinPanes+=r.min)}),e.prevPanesSize=this.sumPrevPanesSize(o[0]),o[0]===void 0)?(e.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((r,i)=>{i>0&&i<=n&&(r.size=r.min,e.prevReachedMinPanes+=r.min)}),this.panes[o[1]].size=100-e.prevReachedMinPanes-this.panes[0].min-e.prevPanesSize-e.nextPanesSize,null):t>100-e.nextPanesSize-this.panes[o[1]].min&&(o[1]=this.findNextExpandedPane(n).index,e.nextReachedMinPanes=0,o[1]>n+1&&this.panes.forEach((r,i)=>{i>n&&i<o[1]&&(r.size=r.min,e.nextReachedMinPanes+=r.min)}),e.nextPanesSize=this.sumNextPanesSize(o[1]-1),o[1]===void 0)?(e.nextReachedMinPanes=0,this.panes[this.panesCount-1].size=this.panes[this.panesCount-1].min,this.panes.forEach((r,i)=>{i<this.panesCount-1&&i>=n+1&&(r.size=r.min,e.nextReachedMinPanes+=r.min)}),this.panes[o[0]].size=100-e.prevPanesSize-e.nextReachedMinPanes-this.panes[this.panesCount-1].min-e.nextPanesSize,null):{sums:e,panesToResize:o}},sumPrevPanesSize(e){return this.panes.reduce((t,n,o)=>t+(o<e?n.size:0),0)},sumNextPanesSize(e){return this.panes.reduce((t,n,o)=>t+(o>e+1?n.size:0),0)},findPrevExpandedPane(e){return[...this.panes].reverse().find(t=>t.index<e&&t.size>t.min)||{}},findNextExpandedPane(e){return this.panes.find(t=>t.index>e+1&&t.size>t.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(e=>{const t=e.classList.contains("splitpanes__pane"),n=e.classList.contains("splitpanes__splitter");if(!t&&!n)return e.parentNode.removeChild(e),void console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed.")})},addSplitter(e,t,n=!1){const o=e-1,r=document.createElement("div");r.classList.add("splitpanes__splitter"),n||(r.onmousedown=i=>this.onMouseDown(i,o),typeof window<"u"&&"ontouchstart"in window&&(r.ontouchstart=i=>this.onMouseDown(i,o)),r.onclick=i=>this.onSplitterClick(i,o+1)),this.dblClickSplitter&&(r.ondblclick=i=>this.onSplitterDblClick(i,o+1)),t.parentNode.insertBefore(r,t)},removeSplitter(e){e.onmousedown=void 0,e.onclick=void 0,e.ondblclick=void 0,e.parentNode.removeChild(e)},redoSplitters(){const e=Array.from(this.container.children);e.forEach(n=>{n.className.includes("splitpanes__splitter")&&this.removeSplitter(n)});let t=0;e.forEach(n=>{n.className.includes("splitpanes__pane")&&(!t&&this.firstSplitter?this.addSplitter(t,n,!0):t&&this.addSplitter(t,n),t++)})},requestUpdate({target:e,...t}){const n=this.indexedPanes[e._.uid];Object.entries(t).forEach(([o,r])=>n[o]=r)},onPaneAdd(e){let t=-1;Array.from(e.$el.parentNode.children).some(r=>(r.className.includes("splitpanes__pane")&&t++,r===e.$el));const n=parseFloat(e.minSize),o=parseFloat(e.maxSize);this.panes.splice(t,0,{id:e._.uid,index:t,min:isNaN(n)?0:n,max:isNaN(o)?100:o,size:e.size===null?null:parseFloat(e.size),givenSize:e.size,update:e.update}),this.panes.forEach((r,i)=>r.index=i),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[t]}),this.$emit("pane-add",{index:t,panes:this.panes.map(r=>({min:r.min,max:r.max,size:r.size}))})})},onPaneRemove(e){const t=this.panes.findIndex(o=>o.id===e._.uid),n=this.panes.splice(t,1)[0];this.panes.forEach((o,r)=>o.index=r),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...n,index:t}}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(o=>({min:o.min,max:o.max,size:o.size}))})})},resetPaneSizes(e={}){e.addedPane||e.removedPane?this.panes.some(t=>t.givenSize!==null||t.min||t.max<100)?this.equalizeAfterAddOrRemove(e):this.equalize():this.initialPanesSizing(),this.ready&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size})))},equalize(){const e=100/this.panesCount;let t=0;const n=[],o=[];this.panes.forEach(r=>{r.size=Math.max(Math.min(e,r.max),r.min),t-=r.size,r.size>=r.max&&n.push(r.id),r.size<=r.min&&o.push(r.id)}),t>.1&&this.readjustSizes(t,n,o)},initialPanesSizing(){let e=100;const t=[],n=[];let o=0;this.panes.forEach(i=>{e-=i.size,i.size!==null&&o++,i.size>=i.max&&t.push(i.id),i.size<=i.min&&n.push(i.id)});let r=100;e>.1&&(this.panes.forEach(i=>{i.size===null&&(i.size=Math.max(Math.min(e/(this.panesCount-o),i.max),i.min)),r-=i.size}),r>.1&&this.readjustSizes(e,t,n))},equalizeAfterAddOrRemove({addedPane:e}={}){let t=100/this.panesCount,n=0;const o=[],r=[];e&&e.givenSize!==null&&(t=(100-e.givenSize)/(this.panesCount-1)),this.panes.forEach(i=>{n-=i.size,i.size>=i.max&&o.push(i.id),i.size<=i.min&&r.push(i.id)}),!(Math.abs(n)<.1)&&(this.panes.forEach(i=>{e&&e.givenSize!==null&&e.id===i.id||(i.size=Math.max(Math.min(t,i.max),i.min)),n-=i.size,i.size>=i.max&&o.push(i.id),i.size<=i.min&&r.push(i.id)}),n>.1&&this.readjustSizes(n,o,r))},readjustSizes(e,t,n){let o;o=e>0?e/(this.panesCount-t.length):e/(this.panesCount-n.length),this.panes.forEach(r=>{if(e>0&&!t.includes(r.id)){const i=Math.max(Math.min(r.size+o,r.max),r.min),s=i-r.size;e-=s,r.size=i}else if(!n.includes(r.id)){const i=Math.max(Math.min(r.size+o,r.max),r.min),s=i-r.size;e-=s,r.size=i}r.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[r.id].size}%`})}),Math.abs(e)>.1&&this.$nextTick(()=>{this.ready&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})}},watch:{panes:{deep:!0,immediate:!1,handler(){this.updatePaneComponents()}},horizontal(){this.updatePaneComponents()},firstSplitter(){this.redoSplitters()},dblClickSplitter(e){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((t,n)=>{t.ondblclick=e?o=>this.onSplitterDblClick(o,n):void 0})}},beforeUnmount(){this.ready=!1},mounted(){this.container=this.$refs.container,this.checkSplitpanesNodes(),this.redoSplitters(),this.resetPaneSizes(),this.updatePaneComponents(),this.$emit("ready"),this.ready=!0},render(){return yn("div",{ref:"container",class:["splitpanes","splitpanes--"+(this.horizontal?"horizontal":"vertical"),{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())},__file:"src/controls/splitpanes/splitpanes.vue"},In={name:"pane",inject:["requestUpdate","onPaneAdd","onPaneRemove","onPaneClick"],props:{size:{type:[Number,String],default:10},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},data:()=>({style:{}}),mounted(){this.onPaneAdd(this)},beforeUnmount(){this.onPaneRemove(this)},methods:{update(e){this.style=e}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(e){this.requestUpdate({target:this,size:e})},minSizeNumber(e){this.requestUpdate({target:this,min:e})},maxSizeNumber(e){this.requestUpdate({target:this,max:e})}}};function Tn(e){return window.TouchEvent&&e instanceof TouchEvent}In.render=function(e,t,n,o,r,i){return X(),pt("div",{class:"splitpanes__pane",onClick:t[0]||(t[0]=s=>i.onPaneClick(s,e._.uid)),style:Xt(e.style)},[st(e.$slots,"default")],4)},In.__file="src/controls/splitpanes/pane.vue";class ft{e;constructor(t){this.e=t}stopPropagation(){this.e.stopPropagation()}preventDefault(){this.e.preventDefault()}get clientX(){return Tn(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return Tn(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new Lo(this.clientX,this.clientY)}static bindDown(t,n,o,r=!1){const i=a=>{n(new ft(a))},s=a=>{a.touches.length===1&&n(new ft(a)),a.touches.length>1&&o&&o(new ft(a))};return t.addEventListener("mousedown",i,r),t.addEventListener("touchstart",s,r),()=>{t.removeEventListener("mousedown",i,r),t.removeEventListener("touchstart",s,r)}}static bindMove(t,n,o=!1){const r=s=>{n(new ft(s))},i=s=>{s.touches.length===1&&n(new ft(s))};return t.addEventListener("mousemove",r,o),t.addEventListener("touchmove",i,o),()=>{t.removeEventListener("mousemove",r,o),t.removeEventListener("touchmove",i,o)}}static bindUp(t,n,o=!1){const r=s=>{n(new ft(s))},i=s=>{s.touches.length===0&&n(new ft(s))};return t.addEventListener("mouseup",r,o),t.addEventListener("touchend",i,o),()=>{t.removeEventListener("mouseup",r,o),t.removeEventListener("touchend",i,o)}}originalEvent({mouse:t,touch:n}){Tn(this.e)?n&&n(this.e):t&&t(this.e)}}class Lo{x;y;constructor(t,n){this.x=t,this.y=n}clone(){return new Lo(this.x,this.y)}}class Bs{handle;container;options;unbindDown;unbindMove;unbindUp;constructor(t,n,o={}){this.handle=t,this.container=n,this.options=o,t&&(this.unbindDown=ft.bindDown(t,this.mousedown),t.classList.add("draggable-handle"))}teardown(){this.handle?.classList.remove("draggable-handle"),this.unbindDown&&this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove()}offsetX;offsetY;mousedown=t=>{if(t.preventDefault(),this.handle){const{left:n,top:o}=this.handle.getBoundingClientRect();this.offsetX=t.clientX-n,this.offsetY=t.clientY-o}this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=ft.bindMove(document,this.mousemove),this.unbindUp=ft.bindUp(document,this.mouseup)};mousemove=t=>{this.container&&(this.container.style.left=t.clientX-this.offsetX+"px",this.container.style.top=t.clientY-this.offsetY+"px"),this.options.onMove&&this.options.onMove()};mouseup=t=>{this.options.onMoveEnd&&this.options.onMoveEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0}}class js{_group;onChange;zIndex;constructor(t,n){this._group=t,this.onChange=n,this.a(o=>o.push(this))}set group(t){this._group=t;const n=Ce(this._group),o=Ce(t);n.splice(n.indexOf(this),1),o.push(this),sr()}get group(){return this._group}unregister(){this.a(t=>t.splice(t.indexOf(this),1))}raise(){this.a(t=>{t.splice(t.indexOf(this),1),t.push(this)})}a(t){t(Ce(this._group)),sr()}}const Se=new Map;function Ce(e){return Se.has(e)||Se.set(e,[]),Se.get(e)}function ir(e,t){return e>t?-ir(t,e):e<0&&t>=0?1:e-t}function sr(){let e=0;for(const t of function(n){const o=[];return n.forEach((r,i)=>o.push(i)),o}(Se).sort(ir))for(const n of Ce(t))e!=n.zIndex&&(n.zIndex=e,n.onChange(e)),e++}function Rn(e){if(e){const{width:t,height:n}=e.style;e.style.width="auto",e.style.height="auto";const o=Ee(e);return e.style.width=t,e.style.height=n,o}return{width:0,height:0,top:0,left:0,bottom:0,right:0}}function Ee(e){const t=e.getBoundingClientRect(),n=t.width,o=t.height,r=t.top,i=t.left;return{width:n,height:o,top:r,left:i,bottom:r+o,right:i+n}}class Os{container;options;handles;constructor(t,n){if(this.container=t,this.options=n,t&&n){this.handles=ar.map(l=>new l(t,this));const{width:o,height:r}=Rn(t),i=n.maxWidth||window.innerWidth,s=n.maxHeight||window.innerHeight;let a=!1;(o<n.minWidth||o>i)&&(t.style.width=`${cr(o,n.minWidth,i)}px`,a=!0),(r<n.minHeight||r>s)&&(t.style.height=`${cr(r,n.minHeight,s)}px`,a=!0),a&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(t=>t.teardown())}}const ar=[];class Rt{container;helper;handle;handleSize=8;unbindDown;unbindMove;unbindUp;constructor(t,n){this.container=t,this.helper=n,this.handle=this.createHandleElement(),this.unbindDown=ft.bindDown(this.handle,this.mousedown)}teardown(){this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove(),this.handle.parentElement.removeChild(this.handle)}x0;y0;left0;top0;width0;height0;mousedown=t=>{t.preventDefault(),t.stopPropagation();const{left:n,top:o,width:r,height:i}=Ee(this.container);this.x0=t.clientX,this.y0=t.clientY,this.left0=n,this.top0=o,this.width0=r,this.height0=i,this.calcSafeBoundaries(),this.helper.options&&this.helper.options.onResizeStart&&this.helper.options.onResizeStart(),this.unbindMove=ft.bindMove(document,this.mousemove),this.unbindUp=ft.bindUp(document,this.mouseup)};minLeft;maxLeft;minRight;maxRight;minTop;maxTop;minBottom;maxBottom;calcSafeBoundaries(){if(!this.helper.options)return;const{left:t,top:n,right:o,bottom:r}=Ee(this.container),i=this.helper.options,s=i.maxWidth||window.innerWidth,a=i.maxHeight||window.innerHeight;this.minLeft=Math.max(o-s,0),this.maxLeft=o-i.minWidth,this.minRight=t+i.minWidth,this.maxRight=Math.min(t+s,window.innerWidth),this.minTop=Math.max(r-a,0),this.maxTop=r-i.minHeight,this.minBottom=n+i.minHeight,this.maxBottom=Math.min(n+a,window.innerHeight)}mousemove=t=>{t.preventDefault(),t.stopPropagation(),this.setPosition(t),this.fixPosition(),this.helper.options&&this.helper.options.onResize&&this.helper.options.onResize()};fixPosition(){const{width:t,height:n,left:o,top:r,right:i,bottom:s}=Ee(this.container),a=this.helper.options;a&&(o<this.minLeft?(this.container.style.width=t+o-this.minLeft+"px",this.container.style.left=`${this.minLeft}px`):o>this.maxLeft?(this.container.style.width=`${a.minWidth}px`,this.container.style.left=`${this.maxLeft}px`):i<this.minRight?this.container.style.width=`${a.minWidth}px`:i>this.maxRight&&(this.container.style.width=this.maxRight-o+"px"),r<this.minTop?(this.container.style.height=n+r-this.minTop+"px",this.container.style.top=`${this.minTop}px`):r>this.maxTop?(this.container.style.height=`${a.minHeight}px`,this.container.style.top=`${this.maxTop}px`):s<this.minBottom?this.container.style.height=`${a.minHeight}px`:s>this.maxBottom&&(this.container.style.height=this.maxBottom-r+"px"))}mouseup=t=>{t.preventDefault(),t.stopPropagation(),this.helper.options&&this.helper.options.onResizeEnd&&this.helper.options.onResizeEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0};createHandleElement(){const t=document.createElement("div"),n=t.style;return n.position="absolute",this.applyStyle(n),this.container.appendChild(t),t}}function cr(e,t,n){return e<t?t:e>n?n:e}ar.push(class extends Rt{setPosition(e){this.container.style.width=this.width0+e.clientX-this.x0+"px",this.container.style.height=this.height0+e.clientY-this.y0+"px"}applyStyle(e){e.width=2*this.handleSize+"px",e.height=2*this.handleSize+"px",e.right=-this.handleSize+"px",e.bottom=-this.handleSize+"px",e.cursor="nwse-resize"}},class extends Rt{setPosition(e){this.container.style.height=this.height0+e.clientY-this.y0+"px"}applyStyle(e){e.right=`${this.handleSize}px`,e.left=`${this.handleSize}px`,e.height=2*this.handleSize+"px",e.bottom=-this.handleSize+"px",e.cursor="ns-resize"}},class extends Rt{setPosition(e){this.container.style.left=this.left0+e.clientX-this.x0+"px",this.container.style.width=this.width0-(e.clientX-this.x0)+"px",this.container.style.height=this.height0+e.clientY-this.y0+"px"}applyStyle(e){e.left=-this.handleSize+"px",e.bottom=-this.handleSize+"px",e.width=2*this.handleSize+"px",e.height=2*this.handleSize+"px",e.cursor="nesw-resize"}},class extends Rt{setPosition(e){this.container.style.left=this.left0+e.clientX-this.x0+"px",this.container.style.width=this.width0-(e.clientX-this.x0)+"px"}applyStyle(e){e.left=-this.handleSize+"px",e.bottom=`${this.handleSize}px`,e.width=2*this.handleSize+"px",e.top=`${this.handleSize}px`,e.cursor="ew-resize"}},class extends Rt{setPosition(e){this.container.style.left=this.left0+e.clientX-this.x0+"px",this.container.style.width=this.width0-(e.clientX-this.x0)+"px",this.container.style.top=this.top0+e.clientY-this.y0+"px",this.container.style.height=this.height0-(e.clientY-this.y0)+"px"}applyStyle(e){e.left=-this.handleSize+"px",e.top=-this.handleSize+"px",e.width=2*this.handleSize+"px",e.height=2*this.handleSize+"px",e.cursor="nwse-resize"}},class extends Rt{setPosition(e){this.container.style.top=this.top0+e.clientY-this.y0+"px",this.container.style.height=this.height0-(e.clientY-this.y0)+"px"}applyStyle(e){e.left=`${this.handleSize}px`,e.right=`${this.handleSize}px`,e.height=2*this.handleSize+"px",e.top=-this.handleSize+"px",e.cursor="ns-resize"}},class extends Rt{setPosition(e){this.container.style.top=this.top0+e.clientY-this.y0+"px",this.container.style.height=this.height0-(e.clientY-this.y0)+"px",this.container.style.width=this.width0+e.clientX-this.x0+"px"}applyStyle(e){e.right=-this.handleSize+"px",e.top=-this.handleSize+"px",e.height=2*this.handleSize+"px",e.width=2*this.handleSize+"px",e.cursor="nesw-resize"}},class extends Rt{setPosition(e){this.container.style.width=this.width0+e.clientX-this.x0+"px"}applyStyle(e){e.right=-this.handleSize+"px",e.top=`${this.handleSize}px`,e.bottom=`${this.handleSize}px`,e.width=2*this.handleSize+"px",e.cursor="ew-resize"}});var xe=Mt({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(e){const t=K(!1),n=K(!1);return{hover:t,active:n,style:function(){let o=e.windowStyle.button;return t.value&&(o={...o,...this.windowStyle.buttonHover}),n.value&&(o={...o,...this.windowStyle.buttonActive}),o},mouseup:function(o){this.active&&this.$emit("click")},mousedown:function(o){o.preventDefault(),n.value=!0;const r=ft.bindUp(document,()=>{n.value=!1,r()})}}}});const Ws=["disabled"];xe.render=function(e,t,n,o,r,i){return X(),pt("div",{class:"btn",style:Xt(e.style()),onMouseenter:t[0]||(t[0]=s=>e.hover=!0),onMouseleave:t[1]||(t[1]=s=>e.hover=!1),onMousedown:t[2]||(t[2]=er((...s)=>e.mousedown&&e.mousedown(...s),["stop"])),onTouchstart:t[3]||(t[3]=er((...s)=>e.mousedown&&e.mousedown(...s),["stop"])),onMouseup:t[4]||(t[4]=(...s)=>e.mouseup&&e.mouseup(...s)),onTouchend:t[5]||(t[5]=(...s)=>e.mouseup&&e.mouseup(...s)),disabled:e.disabled},[st(e.$slots,"default")],44,Ws)},xe.__scopeId="data-v-71662210",xe.__file="src/controls/vuewindow/window/Button.vue";const Us=Object.prototype.toString;function ht(e,t){return Us.call(e)===`[object ${t}]`}function ke(e){return ht(e,"Function")}const lr=e=>typeof e<"u",Mn=e=>!lr(e);function Pn(e){return e===null}function Fs(e){return Mn(e)&&Pn(e)}function Hs(e){return Mn(e)||Pn(e)}const Lt=e=>e!=null&&e!==null&&ht(e,"Object");function qs(e){return ht(e,"Date")}function zn(e){return ht(e,"Number")}function Xs(e){return ht(e,"AsyncFunction")}function Vs(e){return ht(e,"Promise")&&Lt(e)&&ke(e.then)&&ke(e.catch)}function Ie(e){return ht(e,"String")}function Gs(e){return e===!0||e===!1||ht(e,"Boolean")}function Ln(e){return e&&Array.isArray(e)}const Ks=()=>typeof window<"u",Ys=e=>typeof window<"u"&&ht(e,"Window"),Js=e=>Lt(e)&&!!e.tagName,Zs=typeof window>"u";function Qs(e){return e&&["IMAGE","IMG"].includes(e.tagName)}function ta(e){return e==null||(Ie(e)||Ln(e)?e.length===0:!!Lt(e)&&JSON.stringify(e)==="{}")}function ea(e){return ht(e,"Error")}function na(e){return ht(e,"WeakSet")}function oa(e){return ht(e,"WeakMap")}function ra(e){return ht(e,"Symbol")}function ia(e){return ht(e,"Map")}const sa=e=>/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/.test(e);var At=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Te(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var aa={exports:{}},An=Te(aa.exports=function(e){var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(y,u){var p=y[0],v=y[1],h=y[2],f=y[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,y[0]=p+y[0]|0,y[1]=v+y[1]|0,y[2]=h+y[2]|0,y[3]=f+y[3]|0}function o(y){var u,p=[];for(u=0;u<64;u+=4)p[u>>2]=y.charCodeAt(u)+(y.charCodeAt(u+1)<<8)+(y.charCodeAt(u+2)<<16)+(y.charCodeAt(u+3)<<24);return p}function r(y){var u,p=[];for(u=0;u<64;u+=4)p[u>>2]=y[u]+(y[u+1]<<8)+(y[u+2]<<16)+(y[u+3]<<24);return p}function i(y){var u,p,v,h,f,L,A=y.length,D=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=A;u+=64)n(D,o(y.substring(u-64,u)));for(p=(y=y.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]|=y.charCodeAt(u)<<(u%4<<3);if(v[u>>2]|=128<<(u%4<<3),u>55)for(n(D,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),L=parseInt(h[1],16)||0,v[14]=f,v[15]=L,n(D,v),D}function s(y){var u,p,v,h,f,L,A=y.length,D=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=A;u+=64)n(D,r(y.subarray(u-64,u)));for(p=(y=u-64<A?y.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]|=y[u]<<(u%4<<3);if(v[u>>2]|=128<<(u%4<<3),u>55)for(n(D,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),L=parseInt(h[1],16)||0,v[14]=f,v[15]=L,n(D,v),D}function a(y){var u,p="";for(u=0;u<4;u+=1)p+=t[y>>8*u+4&15]+t[y>>8*u&15];return p}function l(y){var u;for(u=0;u<y.length;u+=1)y[u]=a(y[u]);return y.join("")}function d(y){return/[\u0080-\uFFFF]/.test(y)&&(y=unescape(encodeURIComponent(y))),y}function w(y,u){var p,v=y.length,h=new ArrayBuffer(v),f=new Uint8Array(h);for(p=0;p<v;p+=1)f[p]=y.charCodeAt(p);return u?f:h}function _(y){return String.fromCharCode.apply(null,new Uint8Array(y))}function x(y,u,p){var v=new Uint8Array(y.byteLength+u.byteLength);return v.set(new Uint8Array(y)),v.set(new Uint8Array(u),y.byteLength),p?v:v.buffer}function P(y){var u,p=[],v=y.length;for(u=0;u<v-1;u+=2)p.push(parseInt(y.substr(u,2),16));return String.fromCharCode.apply(String,p)}function I(){this.reset()}return l(i("hello")),typeof ArrayBuffer>"u"||ArrayBuffer.prototype.slice||function(){function y(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,L,A=this.byteLength,D=y(u,A),$=A;return p!==e&&($=y(p,A)),D>$?new ArrayBuffer(0):(v=$-D,h=new ArrayBuffer(v),f=new Uint8Array(h),L=new Uint8Array(this,D,v),f.set(L),h)}}(),I.prototype.append=function(y){return this.appendBinary(d(y)),this},I.prototype.appendBinary=function(y){this._buff+=y,this._length+=y.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},I.prototype.end=function(y){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),y&&(p=P(p)),this.reset(),p},I.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},I.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},I.prototype.setState=function(y){return this._buff=y.buff,this._length=y.length,this._hash=y.hash,this},I.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},I.prototype._finish=function(y,u){var p,v,h,f=u;if(y[f>>2]|=128<<(f%4<<3),f>55)for(n(this._hash,y),f=0;f<16;f+=1)y[f]=0;p=(p=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),v=parseInt(p[2],16),h=parseInt(p[1],16)||0,y[14]=v,y[15]=h,n(this._hash,y)},I.hash=function(y,u){return I.hashBinary(d(y),u)},I.hashBinary=function(y,u){var p=l(i(y));return u?P(p):p},I.ArrayBuffer=function(){this.reset()},I.ArrayBuffer.prototype.append=function(y){var u,p=x(this._buff.buffer,y,!0),v=p.length;for(this._length+=y.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},I.ArrayBuffer.prototype.end=function(y){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),y&&(p=P(p)),this.reset(),p},I.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},I.ArrayBuffer.prototype.getState=function(){var y=I.prototype.getState.call(this);return y.buff=_(y.buff),y},I.ArrayBuffer.prototype.setState=function(y){return y.buff=w(y.buff,!0),I.prototype.setState.call(this,y)},I.ArrayBuffer.prototype.destroy=I.prototype.destroy,I.ArrayBuffer.prototype._finish=I.prototype._finish,I.ArrayBuffer.hash=function(y,u){var p=l(s(new Uint8Array(y)));return u?P(p):p},I}());const Dn=[];class dt{static addHandler(t,n,o){t.addEventListener?t.addEventListener(n,o,!1):t.attachEvent?t.attachEvent("on"+n,o):t["on"+n]=o}static removeHandler(t,n,o){t.removeEventListener?t.removeEventListener(n,o,!1):t.detachEvent?t.detachEvent("on"+n,o):delete t["on"+n]}static windowResizeHandler(t){dt.addHandler(window,"resize",t)}static offWindowResizeHandler(t){dt.removeHandler(window,"resize",t)}static fullscreenEnabled(){const t=window.document;return document.fullscreenEnabled||window.fullScreen||t.mozFullscreenEnabled||t.webkitIsFullScreen}static fullScreen(t,n){if(n){const o=window.document;let r=window.document.exitFullscreen||o.msExitFullscreen||o.mozCancelFullScreen||o.webkitCancelFullScreen;typeof r<"u"&&r?r.call(window.document):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("WScript.Shell")?.SendKeys("{F11}")}else{let o=t;o||(o=window.document.documentElement);let r=o.requestFullScreen||o.webkitRequestFullScreen||o.mozRequestFullScreen||o.msRequestFullScreen;typeof r<"u"&&r?r.call(o):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("WScript.Shell")?.SendKeys("{F11}")}}static requestFullScreen(t=window.document.documentElement){let n=t;var o=n.requestFullScreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullScreen;if(o)o.call(n);else if(typeof window.ActiveXObject<"u"){var r=new window.ActiveXObject("WScript.Shell");r!==null&&r.SendKeys("{F11}")}}static exitFullScreen(){const t=window.document;var n=document.exitFullscreen||t.mozCancelFullScreen||t.webkitExitFullscreen||t.webkitExitFullscreen;if(n)n.call(document);else if(typeof window.ActiveXObject<"u"){var o=new window.ActiveXObject("WScript.Shell");o!==null&&o.SendKeys("{F11}")}}static fullScreenElement(){return window.document.fullscreenElement||window.document.webkitFullscreenElement||window.document.mozFullscreenElement||window.document.msFullscreenElement}static isFullScreen(){return!!dt.fullScreenElement()}static onFullScreenChanged(t){let n;"onfullscreenchange"in window.document?n="fullscreenchange":"onwebkitfullscreenchange"in window.document?n="webkitfullscreenchange":"onmozfullscreenchange"in window.document&&(n="mozfullscreenchange"),n?document.addEventListener(n,function(){const o=dt.isFullScreen();t(o)}):document.addEventListener("MSFullscreenChange",function(){const o=dt.isFullScreen();t(o)})}static stringifyCircularHandler(t,n){if(typeof n=="object"&&n!==null){if(Dn.indexOf(n)!==-1)return;Dn.push(n)}return n}static jsonStringify(t){if(!t)return"";const n=JSON.stringify(t,dt.stringifyCircularHandler);return Dn.length=0,n}static jsonParse(t){const n=dt.jsonStringify(t);if(n.length>1)return JSON.parse(n)}static getObjectURL(t){let n;const o=window;return o.createObjcectURL!=null?n=o.createOjcectURL(t):window.URL!=null?n=window.URL.createObjectURL(t):window.webkitURL!=null&&(n=window.webkitURL.createObjectURL(t)),n}static getFileShortMD5(t,n){const o=File.prototype,r=o.slice||o.mozSlice||o.webkitSlice,i=t,s=2097152,a=new An.ArrayBuffer,l=new FileReader;l.onload=function(d){a.append(d.target?.result);const w=a.end();n({isOK:!0,data:w})},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(t,n){const o=File.prototype,r=o.slice||o.mozSlice||o.webkitSlice,i=t,s=2097152,a=Math.ceil(i.size/s);let l=0;const d=new An.ArrayBuffer,w=new FileReader;function _(){const x=l*s,P=x+s>=i.size?i.size:x+s;w.readAsArrayBuffer(r.call(i,x,P))}w.onload=function(x){if(d.append(x.target?.result),l++,l<a)_();else{const P=d.end();n({isOK:!0,data:P})}},w.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})},_()}static MD5(t,n=!1){return An.hash(t,n)}static copyTextByCommand(t){return new Promise((n,o)=>{const r=document.createElement("input");r.value=t,document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove(),n(!0)})}static copyText=t=>navigator.clipboard?navigator.clipboard.writeText(t).then(function(){return!0},function(n){return!1}):dt.copyTextByCommand(t);static copyElementTextByCommand(t){const n=document.createRange();n.selectNode(document.getElementById(t));const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges(),o.addRange(n);try{return document.execCommand("copy"),o.removeRange(n),!0}catch(r){return o.removeRange(n),console.error("Command\u590D\u5236\u6587\u672C\u9519\u8BEF",r),!1}}static copyElementText(t){if(!navigator.clipboard)return dt.copyElementTextByCommand(t);const n=document.createRange();n.selectNode(document.getElementById(t));const o=window.getSelection();return o.rangeCount>0&&o.removeAllRanges(),o.addRange(n),navigator.clipboard.writeText(o).then(function(){return o.removeRange(n),!0},function(r){return o.removeRange(n),console.error("Clipboard\u590D\u5236\u6587\u672C\u9519\u8BEF",r),!1})}static setGrayMode(t){dt.toggleClass(t,"grayMode",document.documentElement)}static toggleClass(t,n,o){const r=o||document.body;let{className:i}=r;i=i.replace(n,""),r.className=t?`${i} ${n} `:i}static setCssVar(t,n,o=document.documentElement){o.style.setProperty(t,n)}static dispatchWindowResize(){const t=new Event("resize");window.dispatchEvent(t)}static dispatchElementEvent(t,n="click",o){let r;if(r=Ie(t)?document.getElementById(t):t,r){const i=new Event(n,{bubbles:!0,cancelable:!0});o&&r.addEventListener("ev",s=>{o(s)},!1),r.dispatchEvent(i)}}static getRandomNum(t,n){var o=n-t,r=Math.random();return t+Math.round(r*o)}static merge(t={},n={}){let o,r,i,s;for(t||(t={}),r=0,i=n.length;r<i;r++)for(o in s=n[r],s)t[o]=s[o];return t}static setOptions(t,n){t.hasOwnProperty("options")||(t.options=t.options?Object.create(t.options):{});for(let o in n)t.options[o]=n[o];return t.options}static formatNum(t,n){let o=Math.pow(10,n===void 0?6:n);return Math.round(t*o)/o}static trim(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}static splitWords(t){return this.trim(t).split(/\s+/)}static emptyImageUrl(){return"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="}static debounce(t,n){let o=null;return function(){o&&clearTimeout(o),o=setTimeout(t,n)}}static throttle(t,n){let o=!0;return function(){if(!o)return!1;o=!1,setTimeout(()=>{t(),o=!0},n)}}static dataURLtoBlob(t){let n=t.split(",");if(!n||n.length===0)return;let o=n[0].match(/:(.*?);/)[1],r=atob(n[1]),i=r.length,s=new Uint8Array(i);for(;i--;)s[i]=r.charCodeAt(i);return new Blob([s],{type:o})}static getElement(t){return typeof t=="string"?document.getElementById(t):t}static getStyle(t,n){let o=t.style[n]||t.currentStyle&&t.currentStyle[n];if((!o||o==="auto")&&document.defaultView){let r=document.defaultView.getComputedStyle(t,null);o=r?r[n]:null}return o==="auto"?null:o}static create(t,n,o){let r=document.createElement(t);return r.className=n||"",o&&o.appendChild(r),r}static removeElement(t){let n=t.parentNode;n&&n.removeChild(t)}static emptyElement(t){for(;t.firstChild;)t.removeChild(t.firstChild)}static hasClass(t,n){if(t.classList!==void 0)return t.classList.contains(n);let o=this.getClass(t);return o.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(o)}static addClass(t,n){if(t.classList!==void 0){let o=this.splitWords(n);for(let r=0,i=o.length;r<i;r++)t.classList.add(o[r])}else if(!this.hasClass(t,n)){let o=this.getClass(t);this.setClass(t,(o?o+" ":"")+n)}}static removeClass(t,n){t.classList!==void 0?t.classList.remove(n):this.setClass(t,this.trim((" "+this.getClass(t)+" ").replace(" "+n+" "," ")))}static setClass(t,n){t.className.baseVal===void 0?t.className=n:t.className.baseVal=n}static getClass(t){return t.correspondingElement&&(t=t.correspondingElement),t.className.baseVal===void 0?t.className:t.className.baseVal}static createSvgElement(t,n,o,r){let i=document.createElementNS("http://www.w3.org/2000/svg","svg:svg");i.setAttribute("class","svg-path"),i.setAttribute("width",t),i.setAttribute("height",n),i.setAttribute("viewBox",`0 0 ${t} ${n}`);let s=document.createElementNS("http://www.w3.org/2000/svg","path");return s.setAttribute("d",o),i.appendChild(s),r&&r.appendChild(i),i}static parseDom(t,n=!0,o=""){n=n??!1;let r=document.createElement("div");return r.className=o||"",r.innerHTML=t,n?r:r.childNodes}static createVideoHTML(t,n,o){let r=this.create("video",n,o),i=this.create("source","",r);i.setAttribute("src",t),i.setAttribute("type","video/map4");let s=this.create("source","",r);return s.setAttribute("src",t),s.setAttribute("type","video/quicktime"),r}}class Re{static isNullOrEmpty=t=>t===null||t===""||t===void 0||t.length===0;static isNotEmpty=t=>!(t===null||t===""||t===void 0||t.length===0);static toHump(t){return t.replace(/[\-\/\_](\w)/g,(n,o)=>o.toUpperCase()).replace("views","")}}class Me{prefixKey;storage;constructor(t="",n=localStorage){this.prefixKey=t,this.storage=n}getKey(t){return`${this.prefixKey}${t}`.toUpperCase()}set(t,n,o=604800){const r=JSON.stringify({value:n,expire:o!==null?new Date().getTime()+1e3*o:null});this.storage.setItem(this.getKey(t),r)}get(t,n=null){const o=this.storage.getItem(this.getKey(t));if(o)try{const r=JSON.parse(o),{value:i,expire:s}=r;if(s===null||s>=Date.now())return i;this.remove(this.getKey(t))}catch{return n}return n}getJsonObject(t){const n=this.storage.getItem(this.getKey(t));if(n)try{const o=JSON.parse(n);if(o.expire===null||o.expire>=Date.now())return o;this.remove(this.getKey(t))}catch{return}}remove(t){this.storage.removeItem(this.getKey(t))}clear(){this.storage.clear()}setCookie(t,n,o=604800){document.cookie=`${this.getKey(t)}=${n}; Max-Age=${o}`}getCookie(t){const n=document.cookie.split("; ");for(let o=0,r=n.length;o<r;o++){const i=n[o].split("=");if(i[0]===this.getKey(t))return i[1]}return""}removeCookie(t){this.setCookie(t,1,-1)}clearCookie(){const t=document.cookie.match(/[^ =;]+(?==)/g);if(t)for(let n=t.length;n--;)document.cookie=t[n]+"=0;expire="+new Date(0).toUTCString()}}const ca=new Me("",localStorage);function ur(){let e=[];const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(var n=0;n<36;n++){const r=Math.floor(16*Math.random());e[n]=t.substring(r,r+1)}e[14]="4";const o=3&Number(e[19])|8;return e[19]=t.substring(o,o+1),e[8]=e[13]=e[18]=e[23]="-",e.join("")}function la(){var e=new Date().getTime(),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var o=(e+16*Math.random())%16|0;return e=Math.floor(e/16),(n==="x"?o:3&o|8).toString(16)});return t}function ua(e){const t=e.toLowerCase().replace(/rgb?a?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),n=parseFloat(t[3]||"1"),o=Math.floor(n*parseInt(t[0])+255*(1-n)),r=Math.floor(n*parseInt(t[1])+255*(1-n)),i=Math.floor(n*parseInt(t[2])+255*(1-n));return"#"+("0"+o.toString(16)).slice(-2)+("0"+r.toString(16)).slice(-2)+("0"+i.toString(16)).slice(-2)}function ha(e){var t=e.toLowerCase();if(Pe(e)){if(t.length===4){for(var n="#",o=1;o<4;o+=1){const i=t.slice(o,o+1);n+=i.concat(i)}t=n}var r=[];for(o=1;o<7;o+=2)r.push(parseInt("0x"+t.slice(o,o+2)));return"rgb("+r.join(",")+")"}return t}function da(e){const t=e;if(t.length===4){let o="#";for(var n=1;n<4;n+=1){const r=t.slice(n,n+1);o+=r.concat(r)}return o}return t}var Dt;function fa(e){if(typeof e=="object"||!e)return;const t=e.toLowerCase().substring(0,1);return t==="#"?Dt.Hex:t==="r"||t==="("?Dt.RGBA:t==="h"?Dt.Hsla:Dt.RGBA}function pa(e){if(e){var t=e.toLowerCase().match(/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i);if(t){var n,o,r,i=(parseFloat(t[1])%360+360)%360/360,s=parseFloat(t[2])/(/%$/.test(t[2])?100:1),a=parseFloat(t[3])/(/%$/.test(t[3])?100:1);if(s===0)n=o=r=a;else{var l=a<=.5?a*(s+1):a+s-a*s,d=2*a-l;n=$n(d,l,i+1/3),o=$n(d,l,i),r=$n(d,l,i-1/3)}return`rgba(${n=Math.round(255*n)},${o=Math.round(255*o)},${r=Math.round(255*r)},${t[4]?parseFloat(t[4]):1})`}}}function $n(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Pe(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/.test(e)}function ga(e,t,n){const o=(e<<16|t<<8|n).toString(16);return"#"+new Array(Math.abs(o.length-7)).join("0")+o}function Nn(e){let t=e.toLowerCase();if(Pe(e)){if(t.length===4){let o="#";for(let r=1;r<4;r+=1)o+=t.slice(r,r+1).concat(t.slice(r,r+1));t=o}const n=[];for(let o=1;o<7;o+=2)n.push(parseInt("0x"+t.slice(o,o+2)));return"RGB("+n.join(",")+")"}return t}function ma(e){if(!Pe(e))return;const[t,n,o]=Nn(e).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(r=>Number(r));return .299*t+.578*n+.114*o<192}function va(e,t){return e=e.indexOf("#")>=0?e.substring(1,e.length):e,t=Math.trunc(255*t/100),`#${jn(e.substring(0,2),t)}${jn(e.substring(2,4),t)}${jn(e.substring(4,6),t)}`}function ya(e,t){return e=e.indexOf("#")>=0?e.substring(1,e.length):e,t=Math.trunc(255*t/100),`#${Bn(e.substring(0,2),t)}${Bn(e.substring(2,4),t)}${Bn(e.substring(4,6),t)}`}function Bn(e,t){const n=parseInt(e,16)+t,o=n>255?255:n;return o.toString(16).length>1?o.toString(16):`0${o.toString(16)}`}function hr(e,t,n){const o=[e,t,n].map(r=>(r/=255)<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4));return .2126*o[0]+.7152*o[1]+.0722*o[2]}function wa(e){return function(t,n){return(hr(~~t[0],~~t[1],~~t[2])+.05)/(hr(n[0],n[1],n[2])+.05)}(Nn(e.substring(1)).split(","),[0,0,0])>=12?"#000000":"#FFFFFF"}function jn(e,t){const n=parseInt(e,16)-t,o=n<0?0:n;return o.toString(16).length>1?o.toString(16):`0${o.toString(16)}`}function On(e){return{all:e=e||new Map,on(t,n){const o=e?.get(t);o&&o.push(n)||e?.set(t,[n])},off(t,n){const o=e?.get(t);o&&o.splice(o.indexOf(n)>>>0,1)},emit(t,n){(e?.get(t)||[]).slice().map(o=>{o(n)}),(e?.get("*")||[]).slice().map(o=>{o(t,n)})}}}(function(e){e[e.RGBA=0]="RGBA",e[e.Hex=1]="Hex",e[e.Hsla=2]="Hsla"})(Dt||(Dt={}));const $t=On(),ct={HproseServiceErrorEvent:"HproseServiceError",WebAPIErrorEvent:"WebAPIError",AlertInfoEvent:"AlertInfoEvent",CommonWarnEvent:"CommonWarnEvent",WidgetLoadedEvent:"WidgetLoaded",WidgetLoaded:"WidgetLoaded",WidgetUnLoadedEvent:"WidgetUnLoaded",WidgetLoadedErrorEvent:"WidgetLoadedError",WidgetVisibleChanged:"WidgetVisibleChanged",AxiosRequestErrorEvent:"AxiosRequestErrorEvent",LayoutContainerLoaded:"LayoutContainerLoaded"},ze=(e,t)=>{const n=document.createElement("a");n.download=t,n.style.display="none";const o=new Blob([e],{type:"application/octet-stream"});n.href=URL.createObjectURL(o),document.body.appendChild(n),n.click(),document.body.removeChild(n)};function ba(e,t){const n=window.URL||window.webkitURL||window,o=new Blob([e]),r=document.createElement("a");r.href=n.createObjectURL(o),r.download=t,r.click(),n.revokeObjectURL(r.href)}const dr=(e,t)=>{const n=JSON.stringify(e,null,2);t?ze(n,t+".json"):$t.emit(ct.CommonWarnEvent,"\u53C2\u6570JsonID\u4E0D\u80FD\u4E3A\u7A7A\uFF01")},_a=(e,t,n)=>{e.get(t,{responseType:"blob"}).then(function(o){ze(o.data,n)}).catch(o=>{console.warn(o),$t.emit(ct.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})};function fr(e){const t=e.lastIndexOf("/")+1;let n=e.substring(t);return n=decodeURI(n.split("?")[0]),n}function Sa({url:e,target:t="_blank",fileName:n}){const o=new URL(e).host==location.host;return new Promise((r,i)=>{if(o){const s=document.createElement("a");if(s.href=e,s.target=t,s.download!==void 0&&(s.download=n||fr(e)),document.createEvent){const a=document.createEvent("MouseEvents");return a.initEvent("click",!0,!0),s.dispatchEvent(a),r(!0)}return e.indexOf("?")===-1&&(e+="?download"),window.open(e,t),r(!0)}{const s=document.createElement("canvas"),a=document.createElement("img");a.setAttribute("crossOrigin","Anonymous"),a.src=e,a.onload=l=>{s.width=a.width,s.height=a.height,s.getContext("2d").drawImage(a,0,0,a.width,a.height),s.toBlob(d=>{if(d){const w=document.createElement("a");w.href=window.URL.createObjectURL(d),w.download=fr(e),w.click(),URL.revokeObjectURL(w.href),r(!0)}},"image/jpeg")},a.onerror=l=>i(l)}})}function Ca(e){const t=new Date().getTime();let n=new Date().getTime();for(;n-t<e;)n=new Date().getTime();console.log(`\u5F3A\u5236\u7B49\u5F85${pr}\u6BEB\u79D2`)}function pr(e){return new Promise(t=>setTimeout(t,e))}var gr,mr,Wn,vr={exports:{}};mr=At,Wn=function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),o=["trace","debug","info","warn","error"],r={},i=null;function s(I,y){var u=I[y];if(typeof u.bind=="function")return u.bind(I);try{return Function.prototype.bind.call(u,I)}catch{return function(){return Function.prototype.apply.apply(u,[I,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function l(I){return I==="debug"&&(I="log"),typeof console!==t&&(I==="trace"&&n?a:console[I]!==void 0?s(console,I):console.log!==void 0?s(console,"log"):e)}function d(){for(var I=this.getLevel(),y=0;y<o.length;y++){var u=o[y];this[u]=y<I?e:this.methodFactory(u,I,this.name)}if(this.log=this.debug,typeof console===t&&I<this.levels.SILENT)return"No console available for logging"}function w(I){return function(){typeof console!==t&&(d.call(this),this[I].apply(this,arguments))}}function _(I,y,u){return l(I)||w.apply(this,arguments)}function x(I,y){var u,p,v,h=this,f="loglevel";function L(){var $;if(typeof window!==t&&f){try{$=window.localStorage[f]}catch{}if(typeof $===t)try{var j=window.document.cookie,U=encodeURIComponent(f),T=j.indexOf(U+"=");T!==-1&&($=/^([^;]+)/.exec(j.slice(T+U.length+1))[1])}catch{}return h.levels[$]===void 0&&($=void 0),$}}function A($){var j=$;if(typeof j=="string"&&h.levels[j.toUpperCase()]!==void 0&&(j=h.levels[j.toUpperCase()]),typeof j=="number"&&j>=0&&j<=h.levels.SILENT)return j;throw new TypeError("log.setLevel() called with invalid level: "+$)}typeof I=="string"?f+=":"+I:typeof I=="symbol"&&(f=void 0),h.name=I,h.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},h.methodFactory=y||_,h.getLevel=function(){return v??p??u},h.setLevel=function($,j){return v=A($),j!==!1&&function(U){var T=(o[U]||"silent").toUpperCase();if(typeof window!==t&&f){try{return void(window.localStorage[f]=T)}catch{}try{window.document.cookie=encodeURIComponent(f)+"="+T+";"}catch{}}}(v),d.call(h)},h.setDefaultLevel=function($){p=A($),L()||h.setLevel($,!1)},h.resetLevel=function(){v=null,function(){if(typeof window!==t&&f){try{window.localStorage.removeItem(f)}catch{}try{window.document.cookie=encodeURIComponent(f)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}(),d.call(h)},h.enableAll=function($){h.setLevel(h.levels.TRACE,$)},h.disableAll=function($){h.setLevel(h.levels.SILENT,$)},h.rebuild=function(){if(i!==h&&(u=A(i.getLevel())),d.call(h),i===h)for(var $ in r)r[$].rebuild()},u=A(i?i.getLevel():"WARN");var D=L();D!=null&&(v=A(D)),d.call(h)}(i=new x).getLogger=function(I){if(typeof I!="symbol"&&typeof I!="string"||I==="")throw new TypeError("You must supply a name when creating a logger.");var y=r[I];return y||(y=r[I]=new x(I,i.methodFactory)),y};var P=typeof window!==t?window.log:void 0;return i.noConflict=function(){return typeof window!==t&&window.log===i&&(window.log=P),i},i.getLoggers=function(){return r},i.default=i,i},(gr=vr).exports?gr.exports=Wn():mr.log=Wn();var Un=vr.exports;class yr{message;eventBus;constructor(t,n){t&&(this.message=t),n&&(this.eventBus=n)}msg(t,n=3,o="success"){if(this.message)if(typeof this.message=="function")this.message({type:o,message:t,duration:n});else switch(o){case"info":this.message.info(t,n);break;case"success":this.message.success(t,n);break;case"warning":this.message.warn?this.message.warn(t,n):this.message.warning&&this.message.warning(t,n);break;case"error":this.message.error(t,n)}else{switch(o){case"info":case"success":console.log(t);break;case"warning":console.warn(t);break;case"error":o="dark",console.error(t)}this.eventBus&&this.eventBus.emit(ct.AlertInfoEvent,{type:o,info:t})}}info(t,n=3){this.msg(t,n,"info")}warn(t,n=3){this.msg(t,n,"warning")}err(t,n=3){this.msg(t,n,"error")}success(t,n=3){this.msg(t,n,"success")}}let wr=!1;const B={Config:SysConfig,EventBus:$t,DefaultProxyClient:null,Axios:Ps,Message:new yr(void 0,$t),LayoutMap:new Map,getLayoutManager:e=>{if(!B.WidgetConfigList||B.WidgetConfigList.length===0)return;const t=B.WidgetConfigList.find(n=>n.id===e);if(t){const n=t.layoutID;if(n&&B.LayoutMap.has(n))return B.LayoutMap.get(n)}},Logger:e=>{wr||(import.meta.env?.DEV||SysConfig.UI.ProductLog?Un.enableAll():Un.setDefaultLevel("warn"),wr=!0);const t=e||"default";return Un.getLogger(t)}},br="access_token",Ct=new Me("user",localStorage);function Nt(){return Ct.get(br)}function Fn(){Ct.remove(br)}function _r(){return Nt()?.refresh}function Hn(e,t,n,o="json",r){const i={baseURL:B.Config.ServiceURL.DefaultWebAPI,timeout:6e4,params:e,paramsSerializer:{serialize:function(s){return zs.stringify(s,{indices:!1,arrayFormat:"repeat"})}},headers:{"Content-Type":"application/json",Authorization:"bearer "+Nt()?.token},responseType:o,cancelToken:r};if(n)for(let s in n)i.headers[s]=n[s];return B.SystemID&&(i.headers.sysid=B.SystemID,B.SystemGroup&&(i.headers.sysgroup=B.SystemGroup)),t&&(i.baseURL=t),i}function Et(e,t,n,o,r="json",i,s){const a=Hn(n,t,o,r,i);return s&&s>=2e4&&(a.timeout=s),B.Axios?.get(e,a).catch(function(l){Le(l,t,e,"Get")})}function Le(e,t,n,o="Get"){const r=`${t}${n}`;if(e&&e.response){let i=!1;const s=e.response.status;switch(s){case 400:e.message="\u9519\u8BEF\u8BF7\u6C42";break;case 401:e.message="\u672A\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55";break;case 403:e.message="\u62D2\u7EDD\u8BBF\u95EE";break;case 404:e.message="\u8BF7\u6C42\u9519\u8BEF,\u672A\u627E\u5230\u8BE5\u8D44\u6E90";break;case 405:e.message="\u8BF7\u6C42\u65B9\u6CD5\u672A\u5141\u8BB8";break;case 408:e.message="\u8BF7\u6C42\u8D85\u65F6";break;case 500:const l=e.response.data;if(l){const d=l.indexOf(":"),w=l.indexOf(`
|
|
2
|
-
`);if(
|
|
3
|
-
`),r=0;r<o.length;r++){var i=o[r],s=i.indexOf(":"),a=Xn(i.slice(0,s)).toLowerCase(),l=Xn(i.slice(s+1));n[a]===void 0?n[a]=l:(t=n[a],Object.prototype.toString.call(t)==="[object Array]"?n[a].push(l):n[a]=[n[a],l])}return n},Aa=Ma;function kr(e,t,n){var o=e;return za(t)?(n=t,typeof e=="string"&&(o={uri:e})):o=Aa(t,{uri:e}),o.callback=n,o}function xt(e,t,n){return Ir(t=kr(e,t,n))}function Ir(e){if(e.callback===void 0)throw new Error("callback argument missing");var t=!1,n=function(p,v,h){t||(t=!0,e.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),y)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=e.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:_,headers:{},url:w,rawRequest:l},l.getAllResponseHeaders&&(v.headers=La(l.getAllResponseHeaders()))):h=new Error("Internal XMLHttpRequest Error"),n(h,v,v.body)}}var s,a,l=e.xhr||null;l||(l=e.cors||e.useXDR?new xt.XDomainRequest:new xt.XMLHttpRequest);var d,w=l.url=e.uri||e.url,_=l.method=e.method||"GET",x=e.body||e.data,P=l.headers=e.headers||{},I=!!e.sync,y=!1,u={body:void 0,headers:{},statusCode:0,method:_,url:w,rawRequest:l};if("json"in e&&e.json!==!1&&(y=!0,P.accept||P.Accept||(P.Accept="application/json"),_!=="GET"&&_!=="HEAD"&&(P["content-type"]||P["Content-Type"]||(P["Content-Type"]="application/json"),x=JSON.stringify(e.json===!0?x:e.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(_,w,!I,e.username,e.password),I||(l.withCredentials=!!e.withCredentials),!I&&e.timeout>0&&(d=setTimeout(function(){if(!a){a=!0,l.abort("timeout");var p=new Error("XMLHttpRequest timeout");p.code="ETIMEDOUT",r(p)}},e.timeout)),l.setRequestHeader)for(s in P)P.hasOwnProperty(s)&&l.setRequestHeader(s,P[s]);else if(e.headers&&!function(p){for(var v in p)if(p.hasOwnProperty(v))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(l.responseType=e.responseType),"beforeSend"in e&&typeof e.beforeSend=="function"&&e.beforeSend(l),l.send(x||null),l}qn.exports=xt,qn.exports.default=xt,xt.XMLHttpRequest=xr.XMLHttpRequest||function(){},xt.XDomainRequest="withCredentials"in new xt.XMLHttpRequest?xt.XMLHttpRequest:xr.XDomainRequest,function(e,t){for(var n=0;n<e.length;n++)t(e[n])}(["get","put","post","patch","head","delete"],function(e){xt[e==="delete"?"del":e]=function(t,n,o){return(n=kr(t,n,o)).method=e.toUpperCase(),Ir(n)}});var Da=Te(qn.exports);const $a=[200,201,202,204,308],Na=[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(t){this.endpoint=t.endpoint,this.file=t.file,this.fileName=encodeURI(this.file.name),this.headers=t.headers||{},this.method=t.method||"PUT",this.chunkSize=t.chunkSize||5120,this.attempts=t.attempts||5,this.delayBeforeAttempt=t.delayBeforeAttempt||1,this.md5=t.md5||"",this.maxFileBytes=1024*(t.maxFileSize||0),this.chunkCount=0,this.chunkByteSize=1024*this.chunkSize,this.totalChunks=Math.ceil(this.file.size/this.chunkByteSize),this.attemptCount=0,this.offline=!1,this.paused=!1,this.success=!1,this.reader=new FileReader,this.eventTarget=On(),this.validateOptions(),this.getEndpoint().then(()=>this.sendChunks()),typeof window<"u"&&(window.addEventListener("online",()=>{this.offline&&(this.offline=!1,this.dispatch("online"),this.sendChunks())}),window.addEventListener("offline",()=>{this.offline=!0,this.dispatch("offline")}))}on(t,n){this.eventTarget.on(t,n)}abort(){this.pause(),this.currentXhr?.abort()}pause(){this.paused=!0}resume(){this.paused&&(this.paused=!1,this.sendChunks())}dispatch(t,n){this.eventTarget.emit(t,n)}validateOptions(){if(!this.endpoint||typeof this.endpoint!="function"&&typeof this.endpoint!="string")throw new TypeError("endpoint\u5FC5\u987B\u4E3A\uFF1A\u6587\u4EF6\u4E0A\u4F20URL\u5B57\u7B26\u4E32\uFF0C\u6216\u8FD4\u56DE\u5730\u5740\u7684\u51FD\u6570\uFF01");if(!(this.file instanceof File))throw new TypeError("file\u5FC5\u987B\u4E3A\u6587\u4EF6\u5BF9\u8C61");if(this.headers&&typeof this.headers!="object")throw new TypeError("\u6587\u4EF6\u5934\u5FC5\u987B\u4E3A\u5BF9\u8C61\u6216\u7A7A\uFF01");if(this.chunkSize&&(typeof this.chunkSize!="number"||this.chunkSize<=0||this.chunkSize%256!=0))throw new TypeError("chunkSize\u5FC5\u987B\u5927\u4E8E0,\u5E76\u662F256\u7684\u6574\u6570\u500D");if(this.maxFileBytes>0&&this.maxFileBytes<this.file.size)throw new Error(`\u6587\u4EF6\u5927\u5C0F\u8D85\u8FC7\u6700\u5927\u5141\u8BB8\u503C\uFF1A(${this.file.size} > ${this.maxFileBytes})`);if(this.attempts&&(typeof this.attempts!="number"||this.attempts<=0))throw new TypeError("\u91CD\u8BD5\u6B21\u6570\u5FC5\u987B\u4E3A\u6B63\u6570\uFF01");if(this.delayBeforeAttempt&&(typeof this.delayBeforeAttempt!="number"||this.delayBeforeAttempt<0))throw new TypeError("\u5EF6\u65F6\u91CD\u8BD5\u65F6\u95F4\u5FC5\u987B\u4E3A\u6B63\u6570\uFF01\u9ED8\u8BA4\u4E3A1")}getEndpoint(){return typeof this.endpoint=="string"?(this.endpointValue=this.endpoint,Promise.resolve(this.endpoint)):this.endpoint(this.file).then(t=>(this.endpointValue=t,this.endpointValue))}getChunk(){return new Promise(t=>{const n=this.totalChunks===1?this.file.size:this.chunkByteSize,o=n*this.chunkCount;this.reader.onload=()=>{this.reader.result!==null&&(this.chunk=new Blob([this.reader.result],{type:"application/octet-stream"})),t(()=>{})},this.reader.readAsArrayBuffer(this.file.slice(o,o+n))})}xhrPromise(t){const n=o=>{o.upload.onprogress=r=>{const i=100/this.totalChunks,s=i*this.file.size,a=i*this.chunkCount,l=r.loaded/(r.total??s)*i;this.dispatch("progress",Math.min(a+l,100))}};return new Promise((o,r)=>{this.currentXhr=Da({...t,beforeSend:n},(i,s)=>(this.currentXhr=void 0,i?r(i):o(s)))})}sendChunk(){if(!this.chunk)return;const t=this.chunkCount*this.chunkByteSize,n=t+this.chunk.size-1,o={...this.headers,FileName:this.fileName,FileMD5:this.md5,"Content-Type":this.file.type,"Content-Range":`bytes ${t}-${n}/${this.file.size}`};if(this.dispatch("attempt",{chunkNumber:this.chunkCount,chunkSize:this.chunk.size}),this.endpointValue)return this.xhrPromise({headers:o,url:this.endpointValue,method:this.method,body:this.chunk});console.warn("\u6587\u4EF6\u4E0A\u4F20endpointValue\u4E0D\u80FD\u4E3A\u7A7A\uFF01"),this.dispatch("error",{message:"\u6587\u4EF6\u4E0A\u4F20endpointValue\u4E0D\u80FD\u4E3A\u7A7A\uFF01\u53D6\u6D88\u4E0A\u4F20\uFF01",chunk:this.chunkCount,attempts:this.attemptCount})}manageRetries(){if(this.attemptCount<this.attempts)return setTimeout(()=>this.sendChunks(),1e3*this.delayBeforeAttempt),void this.dispatch("attemptFailure",{message:`\u4E0A\u4F20\u5206\u7247\uFF1A${this.chunkCount}\u5931\u8D25\u3002\u8FD8\u4F1A\u518D\u5C1D\u8BD5 ${this.attempts-this.attemptCount}\u6B21\uFF01`,chunkNumber:this.chunkCount,attemptsLeft:this.attempts-this.attemptCount});this.dispatch("error",{message:`\u4E0A\u4F20\u5206\u7247\u9519\u8BEF\uFF1A ${this.chunkCount}\u3002\u505C\u6B62\u5C1D\u8BD5\uFF0C\u53D6\u6D88\u4E0A\u4F20\uFF01`,chunk:this.chunkCount,attempts:this.attemptCount})}sendChunks(){console.log(this.paused,this.offline,this.success,"sendChunks this.paused || this.offline || this.success"),!(this.paused||this.offline||this.success)&&this.getChunk().then(()=>this.sendChunk()).then(t=>{if(this.attemptCount=this.attemptCount+1,t!=null&&$a.includes(t.statusCode)){this.dispatch("chunkSuccess",{chunk:this.chunkCount,attempts:this.attemptCount,response:t}),this.attemptCount=0,this.chunkCount=this.chunkCount+1,this.chunkCount<this.totalChunks?this.sendChunks():(this.success=!0,this.dispatch("success"));const n=this.chunkCount/this.totalChunks*this.file.size*100/this.file.size;this.dispatch("progress",n)}else if(t!=null&&Na.includes(t.statusCode)){if(this.paused||this.offline)return;this.manageRetries()}else{if(this.paused||this.offline)return;console.log(`\u670D\u52A1\u5668\u9519\u8BEF:${t?.statusCode}\uFF0C\u505C\u6B62\u4E0A\u4F20\u3002`),this.dispatch("error",{message:`\u670D\u52A1\u5668\u9519\u8BEF:${t?.statusCode}\uFF0C\u505C\u6B62\u4E0A\u4F20\u3002`,chunkNumber:this.chunkCount,attempts:this.attemptCount})}}).catch(t=>{this.paused||this.offline||this.manageRetries()})}}const Ba=e=>new Tr(e),ja=new class{hasClass(e,t){return e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}addClass(e,t){this.hasClass(e,t)||(e.className+=" "+t)}removeClass(e,t){if(this.hasClass(e,t)){const n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ")}}toggleClass(e,t){this.hasClass(e,t)?this.removeClass(e,t):this.addClass(e,t)}setCSSProperty(e,t,n){e?.style.setProperty(t,n)}};class pe{hproseURL;client;hproseProxy;static httpTransport;constructor(t){if(t&&!Re.isNullOrEmpty(t)){if(pe.httpTransport||(pe.httpTransport=new $s),this.client=new Ls(t),!this.client)throw Error("Hprose Client\u521D\u59CB\u5316\u9519\u8BEF");this.hproseURL=t,this.init()}}init(){this.client&&this.client.useServiceAsync().then(t=>{this.hproseProxy=t}).catch(t=>{String(t).indexOf("find this method ~")>0?(this.hproseProxy=this.client?.useService(),console.warn("\u65E7\u7248\u672C\u4E0D\u652F\u6301useServiceAsync")):$t.emit(ct.HproseServiceErrorEvent,"\u521D\u59CB\u5316\u9ED8\u8BA4Hprose!"),console.warn(t)})}async getProxy(){if(!this.hproseProxy)try{this.client&&(this.hproseProxy=await this.client.useServiceAsync())}catch(t){console.warn(t),this.hproseProxy=this.client?.useService()}return this.hproseProxy}async invoke(t,n,o){if(this.client)return await this.client.invoke(t,n,o)}encode(t,n,o){if(this.client)return this.client.codec.encode(t,n,o)}decode(t,n){if(this.client)return this.client.codec.decode(t,n)}}class oe{hproseClient;hpProxyObj;defaultContext=new kn;constructor(t){this.hproseClient=new pe(t),this.hpProxyObj=null}getClientContext(t,n){const o={};n&&(o.requestHeaders=n);const r=Nt();o.httpRequestHeaders=t||{};const i=o.httpRequestHeaders;return r&&(i.token=r.token),B.SystemID&&(i.sysid=B.SystemID,B.SystemGroup&&(i.sysgroup=B.SystemGroup)),new kn(o)}async getHproseProxy(){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");if(!this.hpProxyObj){const t=await this.hproseClient.getProxy();this.hpProxyObj=t}return this.hpProxyObj||$t.emit(ct.HproseServiceErrorEvent,"HproseProxy\u5BF9\u8C61\u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5\uFF01"),this.hpProxyObj}async hproseInvoke(t,n,o){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");return await this.hproseClient.invoke(t,n,o)}async hproseInvokeContext(t,n,...o){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");const r=Nt();return console.log(r,"userToken3"),r&&(n||(n=new kn({httpRequestHeaders:{token:r.token}}))),await this.hproseClient.invoke(t,o,n)}async hproseInvokeEncode(t){const n=new _e(t).toBytes(),o=await this.hproseClient.client?.request(n,this.defaultContext);return o&&this.hproseClient.client?.codec.decode(o,this.defaultContext)}encodeRequest(t,...n){const o=this.hproseClient.client?.codec?.encode(t,n,this.defaultContext);return _e.toString(o)}}const Vn=new Map,Oa=function(e,t,n){!B.Config.DefaultHproseAPI&&B.Config.ServiceURL&&(B.Config.DefaultHproseAPI=B.Config.ServiceURL.DefaultHproseAPI),B.Config.DefaultHproseAPI&&Re.isNotEmpty(B.Config.DefaultHproseAPI)&&(B.DefaultProxyClient=new oe(B.Config.DefaultHproseAPI));const o=B.Config.UI.GrayMode;o&&dt.setGrayMode(o);const r=new yr(e,B.EventBus);B.Message=r,B.SystemID=t,B.SystemGroup=n,B.EventBus.on(ct.HproseServiceErrorEvent,i=>{const s=`\u5F53\u524D\u540E\u53F0\u4E1A\u52A1\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("Hprose\u8BF7\u6C42\u9519\u8BEF",s)}),B.EventBus.on(ct.WebAPIErrorEvent,i=>{const s=`WebAPI\u540E\u53F0\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("WebAPI\u8BF7\u6C42\u9519\u8BEF",s)}),B.EventBus.on(ct.AxiosRequestErrorEvent,i=>{const s=`Http\u8BF7\u6C42'${i.code}'\u9519\u8BEF: ${i.message}`;console.warn("Http\u8BF7\u6C42\u9519\u8BEF",s)}),B.EventBus.on(ct.CommonWarnEvent,i=>{r.warn(i)})};function Rr(e){if(e&&Re.isNotEmpty(e)){if(Vn.has(e))return Vn.get(e);{const t=new oe(e);return Vn.set(e,t),t}}}function Wa(e){const t=Rr(e);return t&&(B.DefaultProxyClient=t),t}const Gn="is_LockScreen",Mr=Ct.get(Gn,!1),re={isLock:Mr,lockTime:Mr=="true"?zr():0};function Pr(e){re.isLock=e,Ct.set(Gn,e,10),e&&(Fn(),console.log("\u9501\u5C4F\u4E86\u2026\u2026"))}function Ua(){return Ct.get(Gn,!1)}function zr(){let e=3600;return B.Config.UI?.LockTime&&B.Config.UI?.LockTime>=10&&(e=B.Config.UI.LockTime),e}let Kn;function Yn(){clearInterval(Kn),!(window.location.href.indexOf("/login")>0||re.isLock)&&(Pr(!1),re.lockTime=zr(),Kn=setInterval(()=>{if(re.lockTime--,re.lockTime<=0)return Pr(!0),clearInterval(Kn)},1e3))}function Fa(){Yn(),document.addEventListener("mousedown",Yn)}function Ha(){document.removeEventListener("mousedown",Yn)}function Jn(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var qa={exports:{}},Ae=Te(qa.exports=function e(t,n,o){function r(a,l){if(!n[a]){if(!t[a]){if(!l&&Jn)return Jn(a);if(i)return i(a,!0);var d=new Error("Cannot find module '"+a+"'");throw d.code="MODULE_NOT_FOUND",d}var w=n[a]={exports:{}};t[a][0].call(w.exports,function(_){var x=t[a][1][_];return r(x||_)},w,w.exports,e,t,n,o)}return n[a].exports}for(var i=Jn,s=0;s<o.length;s++)r(o[s]);return r}({1:[function(e,t,n){(function(o){var r,i,s=o.MutationObserver||o.WebKitMutationObserver;if(s){var a=0,l=new s(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 I=o.document.createElement("script");I.onreadystatechange=function(){x(),I.onreadystatechange=null,I.parentNode.removeChild(I),I=null},o.document.documentElement.appendChild(I)}:function(){setTimeout(x,0)};else{var w=new o.MessageChannel;w.port1.onmessage=x,r=function(){w.port2.postMessage(0)}}var _=[];function x(){var I,y;i=!0;for(var u=_.length;u;){for(y=_,_=[],I=-1;++I<u;)y[I]();u=_.length}i=!1}function P(I){_.push(I)!==1||i||r()}t.exports=P}).call(this,At!==void 0?At:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(e,t,n){var o=e(1);function r(){}var i={},s=["REJECTED"],a=["FULFILLED"],l=["PENDING"];function 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&&P(this,h)}function w(h,f,L){this.promise=h,typeof f=="function"&&(this.onFulfilled=f,this.callFulfilled=this.otherCallFulfilled),typeof L=="function"&&(this.onRejected=L,this.callRejected=this.otherCallRejected)}function _(h,f,L){o(function(){var A;try{A=f(L)}catch(D){return i.reject(h,D)}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 P(h,f){var L=!1;function A(U){L||(L=!0,i.reject(h,U))}function D(U){L||(L=!0,i.resolve(h,U))}function $(){f(D,A)}var j=I($);j.status==="error"&&A(j.value)}function I(h,f){var L={};try{L.value=h(f),L.status="success"}catch(A){L.status="error",L.value=A}return L}function y(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 L=h.length,A=!1;if(!L)return this.resolve([]);for(var D=new Array(L),$=0,j=-1,U=new this(r);++j<L;)T(h[j],j);return U;function T(O,q){function rt(Z){D[q]=Z,++$!==L||A||(A=!0,i.resolve(U,D))}f.resolve(O).then(rt,function(Z){A||(A=!0,i.reject(U,Z))})}}function v(h){var f=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var L=h.length,A=!1;if(!L)return this.resolve([]);for(var D=-1,$=new this(r);++D<L;)j(h[D]);return $;function j(U){f.resolve(U).then(function(T){A||(A=!0,i.resolve($,T))},function(T){A||(A=!0,i.reject($,T))})}}t.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 L=new this.constructor(r);return this.state!==l?_(L,this.state===a?h:f,this.outcome):this.queue.push(new w(L,h,f)),L},w.prototype.callFulfilled=function(h){i.resolve(this.promise,h)},w.prototype.otherCallFulfilled=function(h){_(this.promise,this.onFulfilled,h)},w.prototype.callRejected=function(h){i.reject(this.promise,h)},w.prototype.otherCallRejected=function(h){_(this.promise,this.onRejected,h)},i.resolve=function(h,f){var L=I(x,f);if(L.status==="error")return i.reject(h,L.value);var A=L.value;if(A)P(h,A);else{h.state=a,h.outcome=f;for(var D=-1,$=h.queue.length;++D<$;)h.queue[D].callFulfilled(f)}return h},i.reject=function(h,f){h.state=s,h.outcome=f;for(var L=-1,A=h.queue.length;++L<A;)h.queue[L].callRejected(f);return h},d.resolve=y,d.reject=u,d.all=p,d.race=v},{1:1}],3:[function(e,t,n){(function(o){typeof o.Promise!="function"&&(o.Promise=e(2))}).call(this,At!==void 0?At:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(e,t,n){var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c};function r(c,g){if(!(c instanceof g))throw new TypeError("Cannot call a class as a function")}function i(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var s=i();function a(){try{if(!s||!s.open)return!1;var c=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),g=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!c||g)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function l(c,g){c=c||[],g=g||{};try{return new Blob(c,g)}catch(b){if(b.name!=="TypeError")throw b;for(var m=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),S=0;S<c.length;S+=1)m.append(c[S]);return m.getBlob(g.type)}}typeof Promise>"u"&&e(3);var d=Promise;function w(c,g){g&&c.then(function(m){g(null,m)},function(m){g(m)})}function _(c,g,m){typeof g=="function"&&c.then(g),typeof m=="function"&&c.catch(m)}function x(c){return typeof c!="string"&&(console.warn(c+" used as a key, but it is not a string."),c=String(c)),c}function P(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var I="local-forage-detect-blob-support",y=void 0,u={},p=Object.prototype.toString,v="readonly",h="readwrite";function f(c){for(var g=c.length,m=new ArrayBuffer(g),S=new Uint8Array(m),b=0;b<g;b++)S[b]=c.charCodeAt(b);return m}function L(c){return new d(function(g){var m=c.transaction(I,h),S=l([""]);m.objectStore(I).put(S,"key"),m.onabort=function(b){b.preventDefault(),b.stopPropagation(),g(!1)},m.oncomplete=function(){var b=navigator.userAgent.match(/Chrome\/(\d+)/),C=navigator.userAgent.match(/Edge\//);g(C||!b||parseInt(b[1],10)>=43)}}).catch(function(){return!1})}function A(c){return typeof y=="boolean"?d.resolve(y):L(c).then(function(g){return y=g})}function D(c){var g=u[c.name],m={};m.promise=new d(function(S,b){m.resolve=S,m.reject=b}),g.deferredOperations.push(m),g.dbReady?g.dbReady=g.dbReady.then(function(){return m.promise}):g.dbReady=m.promise}function $(c){var g=u[c.name].deferredOperations.pop();if(g)return g.resolve(),g.promise}function j(c,g){var m=u[c.name].deferredOperations.pop();if(m)return m.reject(g),m.promise}function U(c,g){return new d(function(m,S){if(u[c.name]=u[c.name]||_t(),c.db){if(!g)return m(c.db);D(c),c.db.close()}var b=[c.name];g&&b.push(c.version);var C=s.open.apply(s,b);g&&(C.onupgradeneeded=function(E){var R=C.result;try{R.createObjectStore(c.storeName),E.oldVersion<=1&&R.createObjectStore(I)}catch(M){if(M.name!=="ConstraintError")throw M;console.warn('The database "'+c.name+'" has been upgraded from version '+E.oldVersion+" to version "+E.newVersion+', but the storage "'+c.storeName+'" already exists.')}}),C.onerror=function(E){E.preventDefault(),S(C.error)},C.onsuccess=function(){var E=C.result;E.onversionchange=function(R){R.target.close()},m(E),$(c)}})}function T(c){return U(c,!1)}function O(c){return U(c,!0)}function q(c,g){if(!c.db)return!0;var m=!c.db.objectStoreNames.contains(c.storeName),S=c.version<c.db.version,b=c.version>c.db.version;if(S&&(c.version!==g&&console.warn('The database "'+c.name+`" can't be downgraded from version `+c.db.version+" to version "+c.version+"."),c.version=c.db.version),b||m){if(m){var C=c.db.version+1;C>c.version&&(c.version=C)}return!0}return!1}function rt(c){return new d(function(g,m){var S=new FileReader;S.onerror=m,S.onloadend=function(b){var C=btoa(b.target.result||"");g({__local_forage_encoded_blob:!0,data:C,type:c.type})},S.readAsBinaryString(c)})}function Z(c){return l([f(atob(c.data))],{type:c.type})}function Q(c){return c&&c.__local_forage_encoded_blob}function bt(c){var g=this,m=g._initReady().then(function(){var S=u[g._dbInfo.name];if(S&&S.dbReady)return S.dbReady});return _(m,c,c),m}function Ht(c){D(c);for(var g=u[c.name],m=g.forages,S=0;S<m.length;S++){var b=m[S];b._dbInfo.db&&(b._dbInfo.db.close(),b._dbInfo.db=null)}return c.db=null,T(c).then(function(C){return c.db=C,q(c)?O(c):C}).then(function(C){c.db=g.db=C;for(var E=0;E<m.length;E++)m[E]._dbInfo.db=C}).catch(function(C){throw j(c,C),C})}function et(c,g,m,S){S===void 0&&(S=1);try{var b=c.db.transaction(c.storeName,g);m(null,b)}catch(C){if(S>0&&(!c.db||C.name==="InvalidStateError"||C.name==="NotFoundError"))return d.resolve().then(function(){if(!c.db||C.name==="NotFoundError"&&!c.db.objectStoreNames.contains(c.storeName)&&c.version<=c.db.version)return c.db&&(c.version=c.db.version+1),O(c)}).then(function(){return Ht(c).then(function(){et(c,g,m,S-1)})}).catch(m);m(C)}}function _t(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function sn(c){var g=this,m={db:null};if(c)for(var S in c)m[S]=c[S];var b=u[m.name];b||(b=_t(),u[m.name]=b),b.forages.push(g),g._initReady||(g._initReady=g.ready,g.ready=bt);var C=[];function E(){return d.resolve()}for(var R=0;R<b.forages.length;R++){var M=b.forages[R];M!==g&&C.push(M._initReady().catch(E))}var z=b.forages.slice(0);return d.all(C).then(function(){return m.db=b.db,T(m)}).then(function(N){return m.db=N,q(m,g._defaultConfig.version)?O(m):N}).then(function(N){m.db=b.db=N,g._dbInfo=m;for(var W=0;W<z.length;W++){var H=z[W];H!==g&&(H._dbInfo.db=m.db,H._dbInfo.version=m.version)}})}function an(c,g){var m=this;c=x(c);var S=new d(function(b,C){m.ready().then(function(){et(m._dbInfo,v,function(E,R){if(E)return C(E);try{var M=R.objectStore(m._dbInfo.storeName).get(c);M.onsuccess=function(){var z=M.result;z===void 0&&(z=null),Q(z)&&(z=Z(z)),b(z)},M.onerror=function(){C(M.error)}}catch(z){C(z)}})}).catch(C)});return w(S,g),S}function cn(c,g){var m=this,S=new d(function(b,C){m.ready().then(function(){et(m._dbInfo,v,function(E,R){if(E)return C(E);try{var M=R.objectStore(m._dbInfo.storeName).openCursor(),z=1;M.onsuccess=function(){var N=M.result;if(N){var W=N.value;Q(W)&&(W=Z(W));var H=c(W,N.key,z++);H!==void 0?b(H):N.continue()}else b()},M.onerror=function(){C(M.error)}}catch(N){C(N)}})}).catch(C)});return w(S,g),S}function ge(c,g,m){var S=this;c=x(c);var b=new d(function(C,E){var R;S.ready().then(function(){return R=S._dbInfo,p.call(g)==="[object Blob]"?A(R.db).then(function(M){return M?g:rt(g)}):g}).then(function(M){et(S._dbInfo,h,function(z,N){if(z)return E(z);try{var W=N.objectStore(S._dbInfo.storeName);M===null&&(M=void 0);var H=W.put(M,c);N.oncomplete=function(){M===void 0&&(M=null),C(M)},N.onabort=N.onerror=function(){var V=H.error?H.error:H.transaction.error;E(V)}}catch(V){E(V)}})}).catch(E)});return w(b,m),b}function Zt(c,g){var m=this;c=x(c);var S=new d(function(b,C){m.ready().then(function(){et(m._dbInfo,h,function(E,R){if(E)return C(E);try{var M=R.objectStore(m._dbInfo.storeName).delete(c);R.oncomplete=function(){b()},R.onerror=function(){C(M.error)},R.onabort=function(){var z=M.error?M.error:M.transaction.error;C(z)}}catch(z){C(z)}})}).catch(C)});return w(S,g),S}function Qt(c){var g=this,m=new d(function(S,b){g.ready().then(function(){et(g._dbInfo,h,function(C,E){if(C)return b(C);try{var R=E.objectStore(g._dbInfo.storeName).clear();E.oncomplete=function(){S()},E.onabort=E.onerror=function(){var M=R.error?R.error:R.transaction.error;b(M)}}catch(M){b(M)}})}).catch(b)});return w(m,c),m}function vt(c){var g=this,m=new d(function(S,b){g.ready().then(function(){et(g._dbInfo,v,function(C,E){if(C)return b(C);try{var R=E.objectStore(g._dbInfo.storeName).count();R.onsuccess=function(){S(R.result)},R.onerror=function(){b(R.error)}}catch(M){b(M)}})}).catch(b)});return w(m,c),m}function me(c,g){var m=this,S=new d(function(b,C){c<0?b(null):m.ready().then(function(){et(m._dbInfo,v,function(E,R){if(E)return C(E);try{var M=R.objectStore(m._dbInfo.storeName),z=!1,N=M.openKeyCursor();N.onsuccess=function(){var W=N.result;W?c===0||z?b(W.key):(z=!0,W.advance(c)):b(null)},N.onerror=function(){C(N.error)}}catch(W){C(W)}})}).catch(C)});return w(S,g),S}function ve(c){var g=this,m=new d(function(S,b){g.ready().then(function(){et(g._dbInfo,v,function(C,E){if(C)return b(C);try{var R=E.objectStore(g._dbInfo.storeName).openKeyCursor(),M=[];R.onsuccess=function(){var z=R.result;z?(M.push(z.key),z.continue()):S(M)},R.onerror=function(){b(R.error)}}catch(z){b(z)}})}).catch(b)});return w(m,c),m}function te(c,g){g=P.apply(this,arguments);var m=this.config();(c=typeof c!="function"&&c||{}).name||(c.name=c.name||m.name,c.storeName=c.storeName||m.storeName);var S,b=this;if(c.name){var C=c.name===m.name&&b._dbInfo.db?d.resolve(b._dbInfo.db):T(c).then(function(E){var R=u[c.name],M=R.forages;R.db=E;for(var z=0;z<M.length;z++)M[z]._dbInfo.db=E;return E});S=c.storeName?C.then(function(E){if(E.objectStoreNames.contains(c.storeName)){var R=E.version+1;D(c);var M=u[c.name],z=M.forages;E.close();for(var N=0;N<z.length;N++){var W=z[N];W._dbInfo.db=null,W._dbInfo.version=R}var H=new d(function(V,G){var it=s.open(c.name,R);it.onerror=function(St){it.result.close(),G(St)},it.onupgradeneeded=function(){it.result.deleteObjectStore(c.storeName)},it.onsuccess=function(){var St=it.result;St.close(),V(St)}});return H.then(function(V){M.db=V;for(var G=0;G<z.length;G++){var it=z[G];it._dbInfo.db=V,$(it._dbInfo)}}).catch(function(V){throw(j(c,V)||d.resolve()).catch(function(){}),V})}}):C.then(function(E){D(c);var R=u[c.name],M=R.forages;E.close();for(var z=0;z<M.length;z++)M[z]._dbInfo.db=null;var N=new d(function(W,H){var V=s.deleteDatabase(c.name);V.onerror=function(){var G=V.result;G&&G.close(),H(V.error)},V.onblocked=function(){console.warn('dropInstance blocked for database "'+c.name+'" until all open connections are closed')},V.onsuccess=function(){var G=V.result;G&&G.close(),W(G)}});return N.then(function(W){R.db=W;for(var H=0;H<M.length;H++)$(M[H]._dbInfo)}).catch(function(W){throw(j(c,W)||d.resolve()).catch(function(){}),W})})}else S=d.reject("Invalid arguments");return w(S,g),S}var ye={_driver:"asyncStorage",_initStorage:sn,_support:a(),iterate:cn,getItem:an,setItem:ge,removeItem:Zt,clear:Qt,length:vt,key:me,keys:ve,dropInstance:te};function ee(){return typeof openDatabase=="function"}var yt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Di="~~local_forage_type~",$o=/^~~local_forage_type~([^~]+)~/,we="__lfsc__:",ln=we.length,un="arbf",hn="blob",No="si08",Bo="ui08",jo="uic8",Oo="si16",Wo="si32",Uo="ur16",Fo="ui32",Ho="fl32",qo="fl64",Xo=ln+un.length,Vo=Object.prototype.toString;function Go(c){var g,m,S,b,C,E=.75*c.length,R=c.length,M=0;c[c.length-1]==="="&&(E--,c[c.length-2]==="="&&E--);var z=new ArrayBuffer(E),N=new Uint8Array(z);for(g=0;g<R;g+=4)m=yt.indexOf(c[g]),S=yt.indexOf(c[g+1]),b=yt.indexOf(c[g+2]),C=yt.indexOf(c[g+3]),N[M++]=m<<2|S>>4,N[M++]=(15&S)<<4|b>>2,N[M++]=(3&b)<<6|63&C;return z}function dn(c){var g,m=new Uint8Array(c),S="";for(g=0;g<m.length;g+=3)S+=yt[m[g]>>2],S+=yt[(3&m[g])<<4|m[g+1]>>4],S+=yt[(15&m[g+1])<<2|m[g+2]>>6],S+=yt[63&m[g+2]];return m.length%3==2?S=S.substring(0,S.length-1)+"=":m.length%3==1&&(S=S.substring(0,S.length-2)+"=="),S}function $i(c,g){var m="";if(c&&(m=Vo.call(c)),c&&(m==="[object ArrayBuffer]"||c.buffer&&Vo.call(c.buffer)==="[object ArrayBuffer]")){var S,b=we;c instanceof ArrayBuffer?(S=c,b+=un):(S=c.buffer,m==="[object Int8Array]"?b+=No:m==="[object Uint8Array]"?b+=Bo:m==="[object Uint8ClampedArray]"?b+=jo:m==="[object Int16Array]"?b+=Oo:m==="[object Uint16Array]"?b+=Uo:m==="[object Int32Array]"?b+=Wo:m==="[object Uint32Array]"?b+=Fo:m==="[object Float32Array]"?b+=Ho:m==="[object Float64Array]"?b+=qo:g(new Error("Failed to get type for BinaryArray"))),g(b+dn(S))}else if(m==="[object Blob]"){var C=new FileReader;C.onload=function(){var E=Di+c.type+"~"+dn(this.result);g(we+hn+E)},C.readAsArrayBuffer(c)}else try{g(JSON.stringify(c))}catch(E){console.error("Couldn't convert value into a JSON string: ",c),g(null,E)}}function Ni(c){if(c.substring(0,ln)!==we)return JSON.parse(c);var g,m=c.substring(Xo),S=c.substring(ln,Xo);if(S===hn&&$o.test(m)){var b=m.match($o);g=b[1],m=m.substring(b[0].length)}var C=Go(m);switch(S){case un:return C;case hn:return l([C],{type:g});case No:return new Int8Array(C);case Bo:return new Uint8Array(C);case jo:return new Uint8ClampedArray(C);case Oo:return new Int16Array(C);case Uo:return new Uint16Array(C);case Wo:return new Int32Array(C);case Fo:return new Uint32Array(C);case Ho:return new Float32Array(C);case qo:return new Float64Array(C);default:throw new Error("Unkown type: "+S)}}var fn={serialize:$i,deserialize:Ni,stringToBuffer:Go,bufferToString:dn};function Ko(c,g,m,S){c.executeSql("CREATE TABLE IF NOT EXISTS "+g.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],m,S)}function Bi(c){var g=this,m={db:null};if(c)for(var S in c)m[S]=typeof c[S]!="string"?c[S].toString():c[S];var b=new d(function(C,E){try{m.db=openDatabase(m.name,String(m.version),m.description,m.size)}catch(R){return E(R)}m.db.transaction(function(R){Ko(R,m,function(){g._dbInfo=m,C()},function(M,z){E(z)})},E)});return m.serializer=fn,b}function kt(c,g,m,S,b,C){c.executeSql(m,S,b,function(E,R){R.code===R.SYNTAX_ERR?E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[g.storeName],function(M,z){z.rows.length?C(M,R):Ko(M,g,function(){M.executeSql(m,S,b,C)},C)},C):C(E,R)},C)}function ji(c,g){var m=this;c=x(c);var S=new d(function(b,C){m.ready().then(function(){var E=m._dbInfo;E.db.transaction(function(R){kt(R,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[c],function(M,z){var N=z.rows.length?z.rows.item(0).value:null;N&&(N=E.serializer.deserialize(N)),b(N)},function(M,z){C(z)})})}).catch(C)});return w(S,g),S}function Oi(c,g){var m=this,S=new d(function(b,C){m.ready().then(function(){var E=m._dbInfo;E.db.transaction(function(R){kt(R,E,"SELECT * FROM "+E.storeName,[],function(M,z){for(var N=z.rows,W=N.length,H=0;H<W;H++){var V=N.item(H),G=V.value;if(G&&(G=E.serializer.deserialize(G)),(G=c(G,V.key,H+1))!==void 0)return void b(G)}b()},function(M,z){C(z)})})}).catch(C)});return w(S,g),S}function Yo(c,g,m,S){var b=this;c=x(c);var C=new d(function(E,R){b.ready().then(function(){g===void 0&&(g=null);var M=g,z=b._dbInfo;z.serializer.serialize(g,function(N,W){W?R(W):z.db.transaction(function(H){kt(H,z,"INSERT OR REPLACE INTO "+z.storeName+" (key, value) VALUES (?, ?)",[c,N],function(){E(M)},function(V,G){R(G)})},function(H){if(H.code===H.QUOTA_ERR){if(S>0)return void E(Yo.apply(b,[c,M,m,S-1]));R(H)}})})}).catch(R)});return w(C,m),C}function Wi(c,g,m){return Yo.apply(this,[c,g,m,1])}function Ui(c,g){var m=this;c=x(c);var S=new d(function(b,C){m.ready().then(function(){var E=m._dbInfo;E.db.transaction(function(R){kt(R,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[c],function(){b()},function(M,z){C(z)})})}).catch(C)});return w(S,g),S}function Fi(c){var g=this,m=new d(function(S,b){g.ready().then(function(){var C=g._dbInfo;C.db.transaction(function(E){kt(E,C,"DELETE FROM "+C.storeName,[],function(){S()},function(R,M){b(M)})})}).catch(b)});return w(m,c),m}function Hi(c){var g=this,m=new d(function(S,b){g.ready().then(function(){var C=g._dbInfo;C.db.transaction(function(E){kt(E,C,"SELECT COUNT(key) as c FROM "+C.storeName,[],function(R,M){var z=M.rows.item(0).c;S(z)},function(R,M){b(M)})})}).catch(b)});return w(m,c),m}function qi(c,g){var m=this,S=new d(function(b,C){m.ready().then(function(){var E=m._dbInfo;E.db.transaction(function(R){kt(R,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[c+1],function(M,z){var N=z.rows.length?z.rows.item(0).key:null;b(N)},function(M,z){C(z)})})}).catch(C)});return w(S,g),S}function Xi(c){var g=this,m=new d(function(S,b){g.ready().then(function(){var C=g._dbInfo;C.db.transaction(function(E){kt(E,C,"SELECT key FROM "+C.storeName,[],function(R,M){for(var z=[],N=0;N<M.rows.length;N++)z.push(M.rows.item(N).key);S(z)},function(R,M){b(M)})})}).catch(b)});return w(m,c),m}function Vi(c){return new d(function(g,m){c.transaction(function(S){S.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(b,C){for(var E=[],R=0;R<C.rows.length;R++)E.push(C.rows.item(R).name);g({db:c,storeNames:E})},function(b,C){m(C)})},function(S){m(S)})})}function Gi(c,g){g=P.apply(this,arguments);var m=this.config();(c=typeof c!="function"&&c||{}).name||(c.name=c.name||m.name,c.storeName=c.storeName||m.storeName);var S,b=this;return S=c.name?new d(function(C){var E;E=c.name===m.name?b._dbInfo.db:openDatabase(c.name,"","",0),c.storeName?C({db:E,storeNames:[c.storeName]}):C(Vi(E))}).then(function(C){return new d(function(E,R){C.db.transaction(function(M){function z(V){return new d(function(G,it){M.executeSql("DROP TABLE IF EXISTS "+V,[],function(){G()},function(St,mn){it(mn)})})}for(var N=[],W=0,H=C.storeNames.length;W<H;W++)N.push(z(C.storeNames[W]));d.all(N).then(function(){E()}).catch(function(V){R(V)})},function(M){R(M)})})}):d.reject("Invalid arguments"),w(S,g),S}var Ki={_driver:"webSQLStorage",_initStorage:Bi,_support:ee(),iterate:Oi,getItem:ji,setItem:Wi,removeItem:Ui,clear:Fi,length:Hi,key:qi,keys:Xi,dropInstance:Gi};function Yi(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Jo(c,g){var m=c.name+"/";return c.storeName!==g.storeName&&(m+=c.storeName+"/"),m}function Ji(){var c="_localforage_support_test";try{return localStorage.setItem(c,!0),localStorage.removeItem(c),!1}catch{return!0}}function Zi(){return!Ji()||localStorage.length>0}function Qi(c){var g=this,m={};if(c)for(var S in c)m[S]=c[S];return m.keyPrefix=Jo(c,g._defaultConfig),Zi()?(g._dbInfo=m,m.serializer=fn,d.resolve()):d.reject()}function ts(c){var g=this,m=g.ready().then(function(){for(var S=g._dbInfo.keyPrefix,b=localStorage.length-1;b>=0;b--){var C=localStorage.key(b);C.indexOf(S)===0&&localStorage.removeItem(C)}});return w(m,c),m}function es(c,g){var m=this;c=x(c);var S=m.ready().then(function(){var b=m._dbInfo,C=localStorage.getItem(b.keyPrefix+c);return C&&(C=b.serializer.deserialize(C)),C});return w(S,g),S}function ns(c,g){var m=this,S=m.ready().then(function(){for(var b=m._dbInfo,C=b.keyPrefix,E=C.length,R=localStorage.length,M=1,z=0;z<R;z++){var N=localStorage.key(z);if(N.indexOf(C)===0){var W=localStorage.getItem(N);if(W&&(W=b.serializer.deserialize(W)),(W=c(W,N.substring(E),M++))!==void 0)return W}}});return w(S,g),S}function os(c,g){var m=this,S=m.ready().then(function(){var b,C=m._dbInfo;try{b=localStorage.key(c)}catch{b=null}return b&&(b=b.substring(C.keyPrefix.length)),b});return w(S,g),S}function rs(c){var g=this,m=g.ready().then(function(){for(var S=g._dbInfo,b=localStorage.length,C=[],E=0;E<b;E++){var R=localStorage.key(E);R.indexOf(S.keyPrefix)===0&&C.push(R.substring(S.keyPrefix.length))}return C});return w(m,c),m}function is(c){var g=this.keys().then(function(m){return m.length});return w(g,c),g}function ss(c,g){var m=this;c=x(c);var S=m.ready().then(function(){var b=m._dbInfo;localStorage.removeItem(b.keyPrefix+c)});return w(S,g),S}function as(c,g,m){var S=this;c=x(c);var b=S.ready().then(function(){g===void 0&&(g=null);var C=g;return new d(function(E,R){var M=S._dbInfo;M.serializer.serialize(g,function(z,N){if(N)R(N);else try{localStorage.setItem(M.keyPrefix+c,z),E(C)}catch(W){W.name!=="QuotaExceededError"&&W.name!=="NS_ERROR_DOM_QUOTA_REACHED"||R(W),R(W)}})})});return w(b,m),b}function cs(c,g){if(g=P.apply(this,arguments),!(c=typeof c!="function"&&c||{}).name){var m=this.config();c.name=c.name||m.name,c.storeName=c.storeName||m.storeName}var S,b=this;return S=c.name?new d(function(C){c.storeName?C(Jo(c,b._defaultConfig)):C(c.name+"/")}).then(function(C){for(var E=localStorage.length-1;E>=0;E--){var R=localStorage.key(E);R.indexOf(C)===0&&localStorage.removeItem(R)}}):d.reject("Invalid arguments"),w(S,g),S}var ls={_driver:"localStorageWrapper",_initStorage:Qi,_support:Yi(),iterate:ns,getItem:es,setItem:as,removeItem:ss,clear:ts,length:is,key:os,keys:rs,dropInstance:cs},us=function(c,g){return c===g||typeof c=="number"&&typeof g=="number"&&isNaN(c)&&isNaN(g)},hs=function(c,g){for(var m=c.length,S=0;S<m;){if(us(c[S],g))return!0;S++}return!1},Zo=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"},ne={},Qo={},qt={INDEXEDDB:ye,WEBSQL:Ki,LOCALSTORAGE:ls},ds=[qt.INDEXEDDB._driver,qt.WEBSQL._driver,qt.LOCALSTORAGE._driver],be=["dropInstance"],pn=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(be),fs={description:"",driver:ds.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function ps(c,g){c[g]=function(){var m=arguments;return c.ready().then(function(){return c[g].apply(c,m)})}}function gn(){for(var c=1;c<arguments.length;c++){var g=arguments[c];if(g)for(var m in g)g.hasOwnProperty(m)&&(Zo(g[m])?arguments[0][m]=g[m].slice():arguments[0][m]=g[m])}return arguments[0]}var gs=function(){function c(g){for(var m in r(this,c),qt)if(qt.hasOwnProperty(m)){var S=qt[m],b=S._driver;this[m]=b,ne[b]||this.defineDriver(S)}this._defaultConfig=gn({},fs),this._config=gn({},this._defaultConfig,g),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return c.prototype.config=function(g){if((g===void 0?"undefined":o(g))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var m in g){if(m==="storeName"&&(g[m]=g[m].replace(/\W/g,"_")),m==="version"&&typeof g[m]!="number")return new Error("Database version must be a number.");this._config[m]=g[m]}return!("driver"in g)||!g.driver||this.setDriver(this._config.driver)}return typeof g=="string"?this._config[g]:this._config},c.prototype.defineDriver=function(g,m,S){var b=new d(function(C,E){try{var R=g._driver,M=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!g._driver)return void E(M);for(var z=pn.concat("_initStorage"),N=0,W=z.length;N<W;N++){var H=z[N];if((!hs(be,H)||g[H])&&typeof g[H]!="function")return void E(M)}var V=function(){for(var it=function(vs){return function(){var ys=new Error("Method "+vs+" is not implemented by the current driver"),tr=d.reject(ys);return w(tr,arguments[arguments.length-1]),tr}},St=0,mn=be.length;St<mn;St++){var vn=be[St];g[vn]||(g[vn]=it(vn))}};V();var G=function(it){ne[R]&&console.info("Redefining LocalForage driver: "+R),ne[R]=g,Qo[R]=it,C()};"_support"in g?g._support&&typeof g._support=="function"?g._support().then(G,E):G(!!g._support):G(!0)}catch(it){E(it)}});return _(b,m,S),b},c.prototype.driver=function(){return this._driver||null},c.prototype.getDriver=function(g,m,S){var b=ne[g]?d.resolve(ne[g]):d.reject(new Error("Driver not found."));return _(b,m,S),b},c.prototype.getSerializer=function(g){var m=d.resolve(fn);return _(m,g),m},c.prototype.ready=function(g){var m=this,S=m._driverSet.then(function(){return m._ready===null&&(m._ready=m._initDriver()),m._ready});return _(S,g,g),S},c.prototype.setDriver=function(g,m,S){var b=this;Zo(g)||(g=[g]);var C=this._getSupportedDrivers(g);function E(){b._config.driver=b.driver()}function R(N){return b._extend(N),E(),b._ready=b._initStorage(b._config),b._ready}function M(N){return function(){var W=0;function H(){for(;W<N.length;){var V=N[W];return W++,b._dbInfo=null,b._ready=null,b.getDriver(V).then(R).catch(H)}E();var G=new Error("No available storage method found.");return b._driverSet=d.reject(G),b._driverSet}return H()}}var z=this._driverSet!==null?this._driverSet.catch(function(){return d.resolve()}):d.resolve();return this._driverSet=z.then(function(){var N=C[0];return b._dbInfo=null,b._ready=null,b.getDriver(N).then(function(W){b._driver=W._driver,E(),b._wrapLibraryMethodsWithReady(),b._initDriver=M(C)})}).catch(function(){E();var N=new Error("No available storage method found.");return b._driverSet=d.reject(N),b._driverSet}),_(this._driverSet,m,S),this._driverSet},c.prototype.supports=function(g){return!!Qo[g]},c.prototype._extend=function(g){gn(this,g)},c.prototype._getSupportedDrivers=function(g){for(var m=[],S=0,b=g.length;S<b;S++){var C=g[S];this.supports(C)&&m.push(C)}return m},c.prototype._wrapLibraryMethodsWithReady=function(){for(var g=0,m=pn.length;g<m;g++)ps(this,pn[g])},c.prototype.createInstance=function(g){return new c(g)},c}(),ms=new gs;t.exports=ms},{3:3}]},{},[4])(4)),Lr={exports:{}};/*!
|
|
1
|
+
import{h as _n,openBlock as X,createElementBlock as gt,normalizeStyle as vt,renderSlot as ct,defineComponent as Rt,ref as K,withModifiers as or,getCurrentInstance as zs,computed as Xt,watch as Pt,onMounted as Sn,onBeforeUnmount as As,nextTick as rr,resolveComponent as Se,createBlock as nt,Transition as ir,withCtx as Ct,withDirectives as sr,createElementVNode as J,Fragment as zt,createTextVNode as Cn,toDisplayString as En,createCommentVNode as st,vShow as ar,markRaw as Ls,onErrorCaptured as Ds,Suspense as $s,createVNode as Ce,KeepAlive as cr,resolveDynamicComponent as Et,reactive as Ns,toRefs as Bs,renderList as Vt,normalizeClass as At,TransitionGroup as js,onUnmounted as Os,unref as xn}from"vue";import Ws from"axios";import Us from"qs";import{Client as Fs,ClientContext as kn}from"@hprose/rpc-core";import{ByteStream as Ee,Writer as Hs,Reader as qs}from"@hprose/io";import{HttpTransport as Xs}from"@hprose/rpc-html5";var Vs={name:"splitpanes",props:{horizontal:{type:Boolean},pushOtherPanes:{type:Boolean,default:!0},dblClickSplitter:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean}},provide(){return{requestUpdate:this.requestUpdate,onPaneAdd:this.onPaneAdd,onPaneRemove:this.onPaneRemove,onPaneClick:this.onPaneClick}},data:()=>({container:null,ready:!1,panes:[],touch:{mouseDown:!1,dragging:!1,activeSplitter:null},splitterTaps:{splitter:null,timeoutId:null}}),computed:{panesCount(){return this.panes.length},indexedPanes(){return this.panes.reduce((e,t)=>(e[t.id]=t)&&e,{})}},methods:{updatePaneComponents(){this.panes.forEach(e=>{e.update&&e.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[e.id].size}%`})})},bindEvents(){document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),document.addEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.addEventListener("touchmove",this.onMouseMove,{passive:!1}),document.addEventListener("touchend",this.onMouseUp))},unbindEvents(){document.removeEventListener("mousemove",this.onMouseMove,{passive:!1}),document.removeEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.removeEventListener("touchmove",this.onMouseMove,{passive:!1}),document.removeEventListener("touchend",this.onMouseUp))},onMouseDown(e,t){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=t},onMouseMove(e){this.touch.mouseDown&&(e.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(e)),this.$emit("resize",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(e,t){"ontouchstart"in window&&(e.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===t?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(e,t),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=t,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[t])},onSplitterDblClick(e,t){let n=0;this.panes=this.panes.map((o,r)=>(o.size=r===t?o.max:o.min,r!==t&&(n+=o.min),o)),this.panes[t].size-=n,this.$emit("pane-maximize",this.panes[t])},onPaneClick(e,t){this.$emit("pane-click",this.indexedPanes[t])},getCurrentMouseDrag(e){const t=this.container.getBoundingClientRect(),{clientX:n,clientY:o}="ontouchstart"in window&&e.touches?e.touches[0]:e;return{x:n-t.left,y:o-t.top}},getCurrentDragPercentage(e){e=e[this.horizontal?"y":"x"];const t=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(e=t-e),100*e/t},calculatePanesSize(e){const t=this.touch.activeSplitter;let n={prevPanesSize:this.sumPrevPanesSize(t),nextPanesSize:this.sumNextPanesSize(t),prevReachedMinPanes:0,nextReachedMinPanes:0};const o=0+(this.pushOtherPanes?0:n.prevPanesSize),r=100-(this.pushOtherPanes?0:n.nextPanesSize),i=Math.max(Math.min(this.getCurrentDragPercentage(e),r),o);let s=[t,t+1],a=this.panes[s[0]]||null,l=this.panes[s[1]]||null;const h=a.max<100&&i>=a.max+n.prevPanesSize,w=l.max<100&&i<=100-(l.max+this.sumNextPanesSize(t+1));if(h||w)h?(a.size=a.max,l.size=Math.max(100-a.max-n.prevPanesSize-n.nextPanesSize,0)):(a.size=Math.max(100-l.max-n.prevPanesSize-this.sumNextPanesSize(t+1),0),l.size=l.max);else{if(this.pushOtherPanes){const _=this.doPushOtherPanes(n,i);if(!_)return;({sums:n,panesToResize:s}=_),a=this.panes[s[0]]||null,l=this.panes[s[1]]||null}a!==null&&(a.size=Math.min(Math.max(i-n.prevPanesSize-n.prevReachedMinPanes,a.min),a.max)),l!==null&&(l.size=Math.min(Math.max(100-i-n.nextPanesSize-n.nextReachedMinPanes,l.min),l.max))}},doPushOtherPanes(e,t){const n=this.touch.activeSplitter,o=[n,n+1];return t<e.prevPanesSize+this.panes[o[0]].min&&(o[0]=this.findPrevExpandedPane(n).index,e.prevReachedMinPanes=0,o[0]<n&&this.panes.forEach((r,i)=>{i>o[0]&&i<=n&&(r.size=r.min,e.prevReachedMinPanes+=r.min)}),e.prevPanesSize=this.sumPrevPanesSize(o[0]),o[0]===void 0)?(e.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((r,i)=>{i>0&&i<=n&&(r.size=r.min,e.prevReachedMinPanes+=r.min)}),this.panes[o[1]].size=100-e.prevReachedMinPanes-this.panes[0].min-e.prevPanesSize-e.nextPanesSize,null):t>100-e.nextPanesSize-this.panes[o[1]].min&&(o[1]=this.findNextExpandedPane(n).index,e.nextReachedMinPanes=0,o[1]>n+1&&this.panes.forEach((r,i)=>{i>n&&i<o[1]&&(r.size=r.min,e.nextReachedMinPanes+=r.min)}),e.nextPanesSize=this.sumNextPanesSize(o[1]-1),o[1]===void 0)?(e.nextReachedMinPanes=0,this.panes[this.panesCount-1].size=this.panes[this.panesCount-1].min,this.panes.forEach((r,i)=>{i<this.panesCount-1&&i>=n+1&&(r.size=r.min,e.nextReachedMinPanes+=r.min)}),this.panes[o[0]].size=100-e.prevPanesSize-e.nextReachedMinPanes-this.panes[this.panesCount-1].min-e.nextPanesSize,null):{sums:e,panesToResize:o}},sumPrevPanesSize(e){return this.panes.reduce((t,n,o)=>t+(o<e?n.size:0),0)},sumNextPanesSize(e){return this.panes.reduce((t,n,o)=>t+(o>e+1?n.size:0),0)},findPrevExpandedPane(e){return[...this.panes].reverse().find(t=>t.index<e&&t.size>t.min)||{}},findNextExpandedPane(e){return this.panes.find(t=>t.index>e+1&&t.size>t.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(e=>{const t=e.classList.contains("splitpanes__pane"),n=e.classList.contains("splitpanes__splitter");if(!t&&!n)return e.parentNode.removeChild(e),void console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed.")})},addSplitter(e,t,n=!1){const o=e-1,r=document.createElement("div");r.classList.add("splitpanes__splitter"),n||(r.onmousedown=i=>this.onMouseDown(i,o),typeof window<"u"&&"ontouchstart"in window&&(r.ontouchstart=i=>this.onMouseDown(i,o)),r.onclick=i=>this.onSplitterClick(i,o+1)),this.dblClickSplitter&&(r.ondblclick=i=>this.onSplitterDblClick(i,o+1)),t.parentNode.insertBefore(r,t)},removeSplitter(e){e.onmousedown=void 0,e.onclick=void 0,e.ondblclick=void 0,e.parentNode.removeChild(e)},redoSplitters(){const e=Array.from(this.container.children);e.forEach(n=>{n.className.includes("splitpanes__splitter")&&this.removeSplitter(n)});let t=0;e.forEach(n=>{n.className.includes("splitpanes__pane")&&(!t&&this.firstSplitter?this.addSplitter(t,n,!0):t&&this.addSplitter(t,n),t++)})},requestUpdate({target:e,...t}){const n=this.indexedPanes[e._.uid];Object.entries(t).forEach(([o,r])=>n[o]=r)},onPaneAdd(e){let t=-1;Array.from(e.$el.parentNode.children).some(r=>(r.className.includes("splitpanes__pane")&&t++,r===e.$el));const n=parseFloat(e.minSize),o=parseFloat(e.maxSize);this.panes.splice(t,0,{id:e._.uid,index:t,min:isNaN(n)?0:n,max:isNaN(o)?100:o,size:e.size===null?null:parseFloat(e.size),givenSize:e.size,update:e.update}),this.panes.forEach((r,i)=>r.index=i),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[t]}),this.$emit("pane-add",{index:t,panes:this.panes.map(r=>({min:r.min,max:r.max,size:r.size}))})})},onPaneRemove(e){const t=this.panes.findIndex(o=>o.id===e._.uid),n=this.panes.splice(t,1)[0];this.panes.forEach((o,r)=>o.index=r),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...n,index:t}}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(o=>({min:o.min,max:o.max,size:o.size}))})})},resetPaneSizes(e={}){e.addedPane||e.removedPane?this.panes.some(t=>t.givenSize!==null||t.min||t.max<100)?this.equalizeAfterAddOrRemove(e):this.equalize():this.initialPanesSizing(),this.ready&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size})))},equalize(){const e=100/this.panesCount;let t=0;const n=[],o=[];this.panes.forEach(r=>{r.size=Math.max(Math.min(e,r.max),r.min),t-=r.size,r.size>=r.max&&n.push(r.id),r.size<=r.min&&o.push(r.id)}),t>.1&&this.readjustSizes(t,n,o)},initialPanesSizing(){let e=100;const t=[],n=[];let o=0;this.panes.forEach(i=>{e-=i.size,i.size!==null&&o++,i.size>=i.max&&t.push(i.id),i.size<=i.min&&n.push(i.id)});let r=100;e>.1&&(this.panes.forEach(i=>{i.size===null&&(i.size=Math.max(Math.min(e/(this.panesCount-o),i.max),i.min)),r-=i.size}),r>.1&&this.readjustSizes(e,t,n))},equalizeAfterAddOrRemove({addedPane:e}={}){let t=100/this.panesCount,n=0;const o=[],r=[];e&&e.givenSize!==null&&(t=(100-e.givenSize)/(this.panesCount-1)),this.panes.forEach(i=>{n-=i.size,i.size>=i.max&&o.push(i.id),i.size<=i.min&&r.push(i.id)}),!(Math.abs(n)<.1)&&(this.panes.forEach(i=>{e&&e.givenSize!==null&&e.id===i.id||(i.size=Math.max(Math.min(t,i.max),i.min)),n-=i.size,i.size>=i.max&&o.push(i.id),i.size<=i.min&&r.push(i.id)}),n>.1&&this.readjustSizes(n,o,r))},readjustSizes(e,t,n){let o;o=e>0?e/(this.panesCount-t.length):e/(this.panesCount-n.length),this.panes.forEach(r=>{if(e>0&&!t.includes(r.id)){const i=Math.max(Math.min(r.size+o,r.max),r.min),s=i-r.size;e-=s,r.size=i}else if(!n.includes(r.id)){const i=Math.max(Math.min(r.size+o,r.max),r.min),s=i-r.size;e-=s,r.size=i}r.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[r.id].size}%`})}),Math.abs(e)>.1&&this.$nextTick(()=>{this.ready&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})}},watch:{panes:{deep:!0,immediate:!1,handler(){this.updatePaneComponents()}},horizontal(){this.updatePaneComponents()},firstSplitter(){this.redoSplitters()},dblClickSplitter(e){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((t,n)=>{t.ondblclick=e?o=>this.onSplitterDblClick(o,n):void 0})}},beforeUnmount(){this.ready=!1},mounted(){this.container=this.$refs.container,this.checkSplitpanesNodes(),this.redoSplitters(),this.resetPaneSizes(),this.updatePaneComponents(),this.$emit("ready"),this.ready=!0},render(){return _n("div",{ref:"container",class:["splitpanes","splitpanes--"+(this.horizontal?"horizontal":"vertical"),{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())},__file:"src/controls/splitpanes/splitpanes.vue"},In={name:"pane",inject:["requestUpdate","onPaneAdd","onPaneRemove","onPaneClick"],props:{size:{type:[Number,String],default:10},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},data:()=>({style:{}}),mounted(){this.onPaneAdd(this)},beforeUnmount(){this.onPaneRemove(this)},methods:{update(e){this.style=e}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(e){this.requestUpdate({target:this,size:e})},minSizeNumber(e){this.requestUpdate({target:this,min:e})},maxSizeNumber(e){this.requestUpdate({target:this,max:e})}}};function Tn(e){return window.TouchEvent&&e instanceof TouchEvent}In.render=function(e,t,n,o,r,i){return X(),gt("div",{class:"splitpanes__pane",onClick:t[0]||(t[0]=s=>i.onPaneClick(s,e._.uid)),style:vt(e.style)},[ct(e.$slots,"default")],4)},In.__file="src/controls/splitpanes/pane.vue";class pt{e;constructor(t){this.e=t}stopPropagation(){this.e.stopPropagation()}preventDefault(){this.e.preventDefault()}get clientX(){return Tn(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return Tn(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new Do(this.clientX,this.clientY)}static bindDown(t,n,o,r=!1){const i=a=>{n(new pt(a))},s=a=>{a.touches.length===1&&n(new pt(a)),a.touches.length>1&&o&&o(new pt(a))};return t.addEventListener("mousedown",i,r),t.addEventListener("touchstart",s,r),()=>{t.removeEventListener("mousedown",i,r),t.removeEventListener("touchstart",s,r)}}static bindMove(t,n,o=!1){const r=s=>{n(new pt(s))},i=s=>{s.touches.length===1&&n(new pt(s))};return t.addEventListener("mousemove",r,o),t.addEventListener("touchmove",i,o),()=>{t.removeEventListener("mousemove",r,o),t.removeEventListener("touchmove",i,o)}}static bindUp(t,n,o=!1){const r=s=>{n(new pt(s))},i=s=>{s.touches.length===0&&n(new pt(s))};return t.addEventListener("mouseup",r,o),t.addEventListener("touchend",i,o),()=>{t.removeEventListener("mouseup",r,o),t.removeEventListener("touchend",i,o)}}originalEvent({mouse:t,touch:n}){Tn(this.e)?n&&n(this.e):t&&t(this.e)}}class Do{x;y;constructor(t,n){this.x=t,this.y=n}clone(){return new Do(this.x,this.y)}}class Gs{handle;container;options;unbindDown;unbindMove;unbindUp;constructor(t,n,o={}){this.handle=t,this.container=n,this.options=o,t&&(this.unbindDown=pt.bindDown(t,this.mousedown),t.classList.add("draggable-handle"))}teardown(){this.handle?.classList.remove("draggable-handle"),this.unbindDown&&this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove()}offsetX;offsetY;mousedown=t=>{if(t.preventDefault(),this.handle){const{left:n,top:o}=this.handle.getBoundingClientRect();this.offsetX=t.clientX-n,this.offsetY=t.clientY-o}this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=pt.bindMove(document,this.mousemove),this.unbindUp=pt.bindUp(document,this.mouseup)};mousemove=t=>{this.container&&(this.container.style.left=t.clientX-this.offsetX+"px",this.container.style.top=t.clientY-this.offsetY+"px"),this.options.onMove&&this.options.onMove()};mouseup=t=>{this.options.onMoveEnd&&this.options.onMoveEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0}}class Ks{_group;onChange;zIndex;constructor(t,n){this._group=t,this.onChange=n,this.a(o=>o.push(this))}set group(t){this._group=t;const n=ke(this._group),o=ke(t);n.splice(n.indexOf(this),1),o.push(this),ur()}get group(){return this._group}unregister(){this.a(t=>t.splice(t.indexOf(this),1))}raise(){this.a(t=>{t.splice(t.indexOf(this),1),t.push(this)})}a(t){t(ke(this._group)),ur()}}const xe=new Map;function ke(e){return xe.has(e)||xe.set(e,[]),xe.get(e)}function lr(e,t){return e>t?-lr(t,e):e<0&&t>=0?1:e-t}function ur(){let e=0;for(const t of function(n){const o=[];return n.forEach((r,i)=>o.push(i)),o}(xe).sort(lr))for(const n of ke(t))e!=n.zIndex&&(n.zIndex=e,n.onChange(e)),e++}function Rn(e){if(e){const{width:t,height:n}=e.style;e.style.width="auto",e.style.height="auto";const o=Ie(e);return e.style.width=t,e.style.height=n,o}return{width:0,height:0,top:0,left:0,bottom:0,right:0}}function Ie(e){const t=e.getBoundingClientRect(),n=t.width,o=t.height,r=t.top,i=t.left;return{width:n,height:o,top:r,left:i,bottom:r+o,right:i+n}}class Js{container;options;handles;constructor(t,n){if(this.container=t,this.options=n,t&&n){this.handles=hr.map(l=>new l(t,this));const{width:o,height:r}=Rn(t),i=n.maxWidth||window.innerWidth,s=n.maxHeight||window.innerHeight;let a=!1;(o<n.minWidth||o>i)&&(t.style.width=`${dr(o,n.minWidth,i)}px`,a=!0),(r<n.minHeight||r>s)&&(t.style.height=`${dr(r,n.minHeight,s)}px`,a=!0),a&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(t=>t.teardown())}}const hr=[];class Mt{container;helper;handle;handleSize=8;unbindDown;unbindMove;unbindUp;constructor(t,n){this.container=t,this.helper=n,this.handle=this.createHandleElement(),this.unbindDown=pt.bindDown(this.handle,this.mousedown)}teardown(){this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove(),this.handle.parentElement.removeChild(this.handle)}x0;y0;left0;top0;width0;height0;mousedown=t=>{t.preventDefault(),t.stopPropagation();const{left:n,top:o,width:r,height:i}=Ie(this.container);this.x0=t.clientX,this.y0=t.clientY,this.left0=n,this.top0=o,this.width0=r,this.height0=i,this.calcSafeBoundaries(),this.helper.options&&this.helper.options.onResizeStart&&this.helper.options.onResizeStart(),this.unbindMove=pt.bindMove(document,this.mousemove),this.unbindUp=pt.bindUp(document,this.mouseup)};minLeft;maxLeft;minRight;maxRight;minTop;maxTop;minBottom;maxBottom;calcSafeBoundaries(){if(!this.helper.options)return;const{left:t,top:n,right:o,bottom:r}=Ie(this.container),i=this.helper.options,s=i.maxWidth||window.innerWidth,a=i.maxHeight||window.innerHeight;this.minLeft=Math.max(o-s,0),this.maxLeft=o-i.minWidth,this.minRight=t+i.minWidth,this.maxRight=Math.min(t+s,window.innerWidth),this.minTop=Math.max(r-a,0),this.maxTop=r-i.minHeight,this.minBottom=n+i.minHeight,this.maxBottom=Math.min(n+a,window.innerHeight)}mousemove=t=>{t.preventDefault(),t.stopPropagation(),this.setPosition(t),this.fixPosition(),this.helper.options&&this.helper.options.onResize&&this.helper.options.onResize()};fixPosition(){const{width:t,height:n,left:o,top:r,right:i,bottom:s}=Ie(this.container),a=this.helper.options;a&&(o<this.minLeft?(this.container.style.width=t+o-this.minLeft+"px",this.container.style.left=`${this.minLeft}px`):o>this.maxLeft?(this.container.style.width=`${a.minWidth}px`,this.container.style.left=`${this.maxLeft}px`):i<this.minRight?this.container.style.width=`${a.minWidth}px`:i>this.maxRight&&(this.container.style.width=this.maxRight-o+"px"),r<this.minTop?(this.container.style.height=n+r-this.minTop+"px",this.container.style.top=`${this.minTop}px`):r>this.maxTop?(this.container.style.height=`${a.minHeight}px`,this.container.style.top=`${this.maxTop}px`):s<this.minBottom?this.container.style.height=`${a.minHeight}px`:s>this.maxBottom&&(this.container.style.height=this.maxBottom-r+"px"))}mouseup=t=>{t.preventDefault(),t.stopPropagation(),this.helper.options&&this.helper.options.onResizeEnd&&this.helper.options.onResizeEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0};createHandleElement(){const t=document.createElement("div"),n=t.style;return n.position="absolute",this.applyStyle(n),this.container.appendChild(t),t}}function dr(e,t,n){return e<t?t:e>n?n:e}hr.push(class extends Mt{setPosition(e){this.container.style.width=this.width0+e.clientX-this.x0+"px",this.container.style.height=this.height0+e.clientY-this.y0+"px"}applyStyle(e){e.width=2*this.handleSize+"px",e.height=2*this.handleSize+"px",e.right=-this.handleSize+"px",e.bottom=-this.handleSize+"px",e.cursor="nwse-resize"}},class extends Mt{setPosition(e){this.container.style.height=this.height0+e.clientY-this.y0+"px"}applyStyle(e){e.right=`${this.handleSize}px`,e.left=`${this.handleSize}px`,e.height=2*this.handleSize+"px",e.bottom=-this.handleSize+"px",e.cursor="ns-resize"}},class extends Mt{setPosition(e){this.container.style.left=this.left0+e.clientX-this.x0+"px",this.container.style.width=this.width0-(e.clientX-this.x0)+"px",this.container.style.height=this.height0+e.clientY-this.y0+"px"}applyStyle(e){e.left=-this.handleSize+"px",e.bottom=-this.handleSize+"px",e.width=2*this.handleSize+"px",e.height=2*this.handleSize+"px",e.cursor="nesw-resize"}},class extends Mt{setPosition(e){this.container.style.left=this.left0+e.clientX-this.x0+"px",this.container.style.width=this.width0-(e.clientX-this.x0)+"px"}applyStyle(e){e.left=-this.handleSize+"px",e.bottom=`${this.handleSize}px`,e.width=2*this.handleSize+"px",e.top=`${this.handleSize}px`,e.cursor="ew-resize"}},class extends Mt{setPosition(e){this.container.style.left=this.left0+e.clientX-this.x0+"px",this.container.style.width=this.width0-(e.clientX-this.x0)+"px",this.container.style.top=this.top0+e.clientY-this.y0+"px",this.container.style.height=this.height0-(e.clientY-this.y0)+"px"}applyStyle(e){e.left=-this.handleSize+"px",e.top=-this.handleSize+"px",e.width=2*this.handleSize+"px",e.height=2*this.handleSize+"px",e.cursor="nwse-resize"}},class extends Mt{setPosition(e){this.container.style.top=this.top0+e.clientY-this.y0+"px",this.container.style.height=this.height0-(e.clientY-this.y0)+"px"}applyStyle(e){e.left=`${this.handleSize}px`,e.right=`${this.handleSize}px`,e.height=2*this.handleSize+"px",e.top=-this.handleSize+"px",e.cursor="ns-resize"}},class extends Mt{setPosition(e){this.container.style.top=this.top0+e.clientY-this.y0+"px",this.container.style.height=this.height0-(e.clientY-this.y0)+"px",this.container.style.width=this.width0+e.clientX-this.x0+"px"}applyStyle(e){e.right=-this.handleSize+"px",e.top=-this.handleSize+"px",e.height=2*this.handleSize+"px",e.width=2*this.handleSize+"px",e.cursor="nesw-resize"}},class extends Mt{setPosition(e){this.container.style.width=this.width0+e.clientX-this.x0+"px"}applyStyle(e){e.right=-this.handleSize+"px",e.top=`${this.handleSize}px`,e.bottom=`${this.handleSize}px`,e.width=2*this.handleSize+"px",e.cursor="ew-resize"}});var Te=Rt({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(e){const t=K(!1),n=K(!1);return{hover:t,active:n,style:function(){let o=e.windowStyle.button;return t.value&&(o={...o,...this.windowStyle.buttonHover}),n.value&&(o={...o,...this.windowStyle.buttonActive}),o},mouseup:function(o){this.active&&this.$emit("click")},mousedown:function(o){o.preventDefault(),n.value=!0;const r=pt.bindUp(document,()=>{n.value=!1,r()})}}}});const Ys=["disabled"];Te.render=function(e,t,n,o,r,i){return X(),gt("div",{class:"btn",style:vt(e.style()),onMouseenter:t[0]||(t[0]=s=>e.hover=!0),onMouseleave:t[1]||(t[1]=s=>e.hover=!1),onMousedown:t[2]||(t[2]=or((...s)=>e.mousedown&&e.mousedown(...s),["stop"])),onTouchstart:t[3]||(t[3]=or((...s)=>e.mousedown&&e.mousedown(...s),["stop"])),onMouseup:t[4]||(t[4]=(...s)=>e.mouseup&&e.mouseup(...s)),onTouchend:t[5]||(t[5]=(...s)=>e.mouseup&&e.mouseup(...s)),disabled:e.disabled},[ct(e.$slots,"default")],44,Ys)},Te.__scopeId="data-v-71662210",Te.__file="src/controls/vuewindow/window/Button.vue";const Zs=Object.prototype.toString;function dt(e,t){return Zs.call(e)===`[object ${t}]`}function Re(e){return dt(e,"Function")}const fr=e=>typeof e<"u",Mn=e=>!fr(e);function Pn(e){return e===null}function Qs(e){return Mn(e)&&Pn(e)}function ta(e){return Mn(e)||Pn(e)}const Lt=e=>e!=null&&e!==null&&dt(e,"Object");function ea(e){return dt(e,"Date")}function zn(e){return dt(e,"Number")}function na(e){return dt(e,"AsyncFunction")}function oa(e){return dt(e,"Promise")&&Lt(e)&&Re(e.then)&&Re(e.catch)}function Me(e){return dt(e,"String")}function ra(e){return e===!0||e===!1||dt(e,"Boolean")}function An(e){return e&&Array.isArray(e)}const ia=()=>typeof window<"u",sa=e=>typeof window<"u"&&dt(e,"Window"),aa=e=>Lt(e)&&!!e.tagName,ca=typeof window>"u";function la(e){return e&&["IMAGE","IMG"].includes(e.tagName)}function ua(e){return e==null||(Me(e)||An(e)?e.length===0:!!Lt(e)&&JSON.stringify(e)==="{}")}function ha(e){return dt(e,"Error")}function da(e){return dt(e,"WeakSet")}function fa(e){return dt(e,"WeakMap")}function pa(e){return dt(e,"Symbol")}function ga(e){return dt(e,"Map")}const ma=e=>/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/.test(e);var Gt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pr,gr={exports:{}},va=pr?gr.exports:(pr=1,gr.exports=function(e){var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(p,u){var v=p[0],y=p[1],d=p[2],f=p[3];y=((y+=((d=((d+=((f=((f+=((v=((v+=(y&d|~y&f)+u[0]-680876936|0)<<7|v>>>25)+y|0)&y|~v&d)+u[1]-389564586|0)<<12|f>>>20)+v|0)&v|~f&y)+u[2]+606105819|0)<<17|d>>>15)+f|0)&f|~d&v)+u[3]-1044525330|0)<<22|y>>>10)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y&d|~y&f)+u[4]-176418897|0)<<7|v>>>25)+y|0)&y|~v&d)+u[5]+1200080426|0)<<12|f>>>20)+v|0)&v|~f&y)+u[6]-1473231341|0)<<17|d>>>15)+f|0)&f|~d&v)+u[7]-45705983|0)<<22|y>>>10)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y&d|~y&f)+u[8]+1770035416|0)<<7|v>>>25)+y|0)&y|~v&d)+u[9]-1958414417|0)<<12|f>>>20)+v|0)&v|~f&y)+u[10]-42063|0)<<17|d>>>15)+f|0)&f|~d&v)+u[11]-1990404162|0)<<22|y>>>10)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y&d|~y&f)+u[12]+1804603682|0)<<7|v>>>25)+y|0)&y|~v&d)+u[13]-40341101|0)<<12|f>>>20)+v|0)&v|~f&y)+u[14]-1502002290|0)<<17|d>>>15)+f|0)&f|~d&v)+u[15]+1236535329|0)<<22|y>>>10)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y&f|d&~f)+u[1]-165796510|0)<<5|v>>>27)+y|0)&d|y&~d)+u[6]-1069501632|0)<<9|f>>>23)+v|0)&y|v&~y)+u[11]+643717713|0)<<14|d>>>18)+f|0)&v|f&~v)+u[0]-373897302|0)<<20|y>>>12)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y&f|d&~f)+u[5]-701558691|0)<<5|v>>>27)+y|0)&d|y&~d)+u[10]+38016083|0)<<9|f>>>23)+v|0)&y|v&~y)+u[15]-660478335|0)<<14|d>>>18)+f|0)&v|f&~v)+u[4]-405537848|0)<<20|y>>>12)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y&f|d&~f)+u[9]+568446438|0)<<5|v>>>27)+y|0)&d|y&~d)+u[14]-1019803690|0)<<9|f>>>23)+v|0)&y|v&~y)+u[3]-187363961|0)<<14|d>>>18)+f|0)&v|f&~v)+u[8]+1163531501|0)<<20|y>>>12)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y&f|d&~f)+u[13]-1444681467|0)<<5|v>>>27)+y|0)&d|y&~d)+u[2]-51403784|0)<<9|f>>>23)+v|0)&y|v&~y)+u[7]+1735328473|0)<<14|d>>>18)+f|0)&v|f&~v)+u[12]-1926607734|0)<<20|y>>>12)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y^d^f)+u[5]-378558|0)<<4|v>>>28)+y|0)^y^d)+u[8]-2022574463|0)<<11|f>>>21)+v|0)^v^y)+u[11]+1839030562|0)<<16|d>>>16)+f|0)^f^v)+u[14]-35309556|0)<<23|y>>>9)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y^d^f)+u[1]-1530992060|0)<<4|v>>>28)+y|0)^y^d)+u[4]+1272893353|0)<<11|f>>>21)+v|0)^v^y)+u[7]-155497632|0)<<16|d>>>16)+f|0)^f^v)+u[10]-1094730640|0)<<23|y>>>9)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y^d^f)+u[13]+681279174|0)<<4|v>>>28)+y|0)^y^d)+u[0]-358537222|0)<<11|f>>>21)+v|0)^v^y)+u[3]-722521979|0)<<16|d>>>16)+f|0)^f^v)+u[6]+76029189|0)<<23|y>>>9)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y^d^f)+u[9]-640364487|0)<<4|v>>>28)+y|0)^y^d)+u[12]-421815835|0)<<11|f>>>21)+v|0)^v^y)+u[15]+530742520|0)<<16|d>>>16)+f|0)^f^v)+u[2]-995338651|0)<<23|y>>>9)+d|0,y=((y+=((f=((f+=(y^((v=((v+=(d^(y|~f))+u[0]-198630844|0)<<6|v>>>26)+y|0)|~d))+u[7]+1126891415|0)<<10|f>>>22)+v|0)^((d=((d+=(v^(f|~y))+u[14]-1416354905|0)<<15|d>>>17)+f|0)|~v))+u[5]-57434055|0)<<21|y>>>11)+d|0,y=((y+=((f=((f+=(y^((v=((v+=(d^(y|~f))+u[12]+1700485571|0)<<6|v>>>26)+y|0)|~d))+u[3]-1894986606|0)<<10|f>>>22)+v|0)^((d=((d+=(v^(f|~y))+u[10]-1051523|0)<<15|d>>>17)+f|0)|~v))+u[1]-2054922799|0)<<21|y>>>11)+d|0,y=((y+=((f=((f+=(y^((v=((v+=(d^(y|~f))+u[8]+1873313359|0)<<6|v>>>26)+y|0)|~d))+u[15]-30611744|0)<<10|f>>>22)+v|0)^((d=((d+=(v^(f|~y))+u[6]-1560198380|0)<<15|d>>>17)+f|0)|~v))+u[13]+1309151649|0)<<21|y>>>11)+d|0,y=((y+=((f=((f+=(y^((v=((v+=(d^(y|~f))+u[4]-145523070|0)<<6|v>>>26)+y|0)|~d))+u[11]-1120210379|0)<<10|f>>>22)+v|0)^((d=((d+=(v^(f|~y))+u[2]+718787259|0)<<15|d>>>17)+f|0)|~v))+u[9]-343485551|0)<<21|y>>>11)+d|0,p[0]=v+p[0]|0,p[1]=y+p[1]|0,p[2]=d+p[2]|0,p[3]=f+p[3]|0}function o(p){var u,v=[];for(u=0;u<64;u+=4)v[u>>2]=p.charCodeAt(u)+(p.charCodeAt(u+1)<<8)+(p.charCodeAt(u+2)<<16)+(p.charCodeAt(u+3)<<24);return v}function r(p){var u,v=[];for(u=0;u<64;u+=4)v[u>>2]=p[u]+(p[u+1]<<8)+(p[u+2]<<16)+(p[u+3]<<24);return v}function i(p){var u,v,y,d,f,z,L=p.length,D=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=L;u+=64)n(D,o(p.substring(u-64,u)));for(v=(p=p.substring(u-64)).length,y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<v;u+=1)y[u>>2]|=p.charCodeAt(u)<<(u%4<<3);if(y[u>>2]|=128<<(u%4<<3),u>55)for(n(D,y),u=0;u<16;u+=1)y[u]=0;return d=(d=8*L).toString(16).match(/(.*?)(.{0,8})$/),f=parseInt(d[2],16),z=parseInt(d[1],16)||0,y[14]=f,y[15]=z,n(D,y),D}function s(p){var u,v,y,d,f,z,L=p.length,D=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=L;u+=64)n(D,r(p.subarray(u-64,u)));for(v=(p=u-64<L?p.subarray(u-64):new Uint8Array(0)).length,y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<v;u+=1)y[u>>2]|=p[u]<<(u%4<<3);if(y[u>>2]|=128<<(u%4<<3),u>55)for(n(D,y),u=0;u<16;u+=1)y[u]=0;return d=(d=8*L).toString(16).match(/(.*?)(.{0,8})$/),f=parseInt(d[2],16),z=parseInt(d[1],16)||0,y[14]=f,y[15]=z,n(D,y),D}function a(p){var u,v="";for(u=0;u<4;u+=1)v+=t[p>>8*u+4&15]+t[p>>8*u&15];return v}function l(p){var u;for(u=0;u<p.length;u+=1)p[u]=a(p[u]);return p.join("")}function h(p){return/[\u0080-\uFFFF]/.test(p)&&(p=unescape(encodeURIComponent(p))),p}function w(p,u){var v,y=p.length,d=new ArrayBuffer(y),f=new Uint8Array(d);for(v=0;v<y;v+=1)f[v]=p.charCodeAt(v);return u?f:d}function _(p){return String.fromCharCode.apply(null,new Uint8Array(p))}function k(p,u,v){var y=new Uint8Array(p.byteLength+u.byteLength);return y.set(new Uint8Array(p)),y.set(new Uint8Array(u),p.byteLength),v?y:y.buffer}function $(p){var u,v=[],y=p.length;for(u=0;u<y-1;u+=2)v.push(parseInt(p.substr(u,2),16));return String.fromCharCode.apply(String,v)}function I(){this.reset()}return l(i("hello")),typeof ArrayBuffer>"u"||ArrayBuffer.prototype.slice||function(){function p(u,v){return(u=0|u||0)<0?Math.max(u+v,0):Math.min(u,v)}ArrayBuffer.prototype.slice=function(u,v){var y,d,f,z,L=this.byteLength,D=p(u,L),M=L;return v!==e&&(M=p(v,L)),D>M?new ArrayBuffer(0):(y=M-D,d=new ArrayBuffer(y),f=new Uint8Array(d),z=new Uint8Array(this,D,y),f.set(z),d)}}(),I.prototype.append=function(p){return this.appendBinary(h(p)),this},I.prototype.appendBinary=function(p){this._buff+=p,this._length+=p.length;var u,v=this._buff.length;for(u=64;u<=v;u+=64)n(this._hash,o(this._buff.substring(u-64,u)));return this._buff=this._buff.substring(u-64),this},I.prototype.end=function(p){var u,v,y=this._buff,d=y.length,f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<d;u+=1)f[u>>2]|=y.charCodeAt(u)<<(u%4<<3);return this._finish(f,d),v=l(this._hash),p&&(v=$(v)),this.reset(),v},I.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},I.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},I.prototype.setState=function(p){return this._buff=p.buff,this._length=p.length,this._hash=p.hash,this},I.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},I.prototype._finish=function(p,u){var v,y,d,f=u;if(p[f>>2]|=128<<(f%4<<3),f>55)for(n(this._hash,p),f=0;f<16;f+=1)p[f]=0;v=(v=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),y=parseInt(v[2],16),d=parseInt(v[1],16)||0,p[14]=y,p[15]=d,n(this._hash,p)},I.hash=function(p,u){return I.hashBinary(h(p),u)},I.hashBinary=function(p,u){var v=l(i(p));return u?$(v):v},I.ArrayBuffer=function(){this.reset()},I.ArrayBuffer.prototype.append=function(p){var u,v=k(this._buff.buffer,p,!0),y=v.length;for(this._length+=p.byteLength,u=64;u<=y;u+=64)n(this._hash,r(v.subarray(u-64,u)));return this._buff=u-64<y?new Uint8Array(v.buffer.slice(u-64)):new Uint8Array(0),this},I.ArrayBuffer.prototype.end=function(p){var u,v,y=this._buff,d=y.length,f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<d;u+=1)f[u>>2]|=y[u]<<(u%4<<3);return this._finish(f,d),v=l(this._hash),p&&(v=$(v)),this.reset(),v},I.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},I.ArrayBuffer.prototype.getState=function(){var p=I.prototype.getState.call(this);return p.buff=_(p.buff),p},I.ArrayBuffer.prototype.setState=function(p){return p.buff=w(p.buff,!0),I.prototype.setState.call(this,p)},I.ArrayBuffer.prototype.destroy=I.prototype.destroy,I.ArrayBuffer.prototype._finish=I.prototype._finish,I.ArrayBuffer.hash=function(p,u){var v=l(s(new Uint8Array(p)));return u?$(v):v},I}()),Ln=Pe(va);const Dn=[];class ft{static addHandler(t,n,o){t.addEventListener?t.addEventListener(n,o,!1):t.attachEvent?t.attachEvent("on"+n,o):t["on"+n]=o}static removeHandler(t,n,o){t.removeEventListener?t.removeEventListener(n,o,!1):t.detachEvent?t.detachEvent("on"+n,o):delete t["on"+n]}static windowResizeHandler(t){ft.addHandler(window,"resize",t)}static offWindowResizeHandler(t){ft.removeHandler(window,"resize",t)}static fullscreenEnabled(){const t=window.document;return document.fullscreenEnabled||window.fullScreen||t.mozFullscreenEnabled||t.webkitIsFullScreen}static fullScreen(t,n){if(n){const o=window.document;let r=window.document.exitFullscreen||o.msExitFullscreen||o.mozCancelFullScreen||o.webkitCancelFullScreen;typeof r<"u"&&r?r.call(window.document):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("WScript.Shell")?.SendKeys("{F11}")}else{let o=t;o||(o=window.document.documentElement);let r=o.requestFullScreen||o.webkitRequestFullScreen||o.mozRequestFullScreen||o.msRequestFullScreen;typeof r<"u"&&r?r.call(o):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("WScript.Shell")?.SendKeys("{F11}")}}static requestFullScreen(t=window.document.documentElement){let n=t;var o=n.requestFullScreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullScreen;if(o)o.call(n);else if(typeof window.ActiveXObject<"u"){var r=new window.ActiveXObject("WScript.Shell");r!==null&&r.SendKeys("{F11}")}}static exitFullScreen(){const t=window.document;var n=document.exitFullscreen||t.mozCancelFullScreen||t.webkitExitFullscreen||t.webkitExitFullscreen;if(n)n.call(document);else if(typeof window.ActiveXObject<"u"){var o=new window.ActiveXObject("WScript.Shell");o!==null&&o.SendKeys("{F11}")}}static fullScreenElement(){return window.document.fullscreenElement||window.document.webkitFullscreenElement||window.document.mozFullscreenElement||window.document.msFullscreenElement}static isFullScreen(){return!!ft.fullScreenElement()}static onFullScreenChanged(t){let n;"onfullscreenchange"in window.document?n="fullscreenchange":"onwebkitfullscreenchange"in window.document?n="webkitfullscreenchange":"onmozfullscreenchange"in window.document&&(n="mozfullscreenchange"),n?document.addEventListener(n,function(){const o=ft.isFullScreen();t(o)}):document.addEventListener("MSFullscreenChange",function(){const o=ft.isFullScreen();t(o)})}static stringifyCircularHandler(t,n){if(typeof n=="object"&&n!==null){if(Dn.indexOf(n)!==-1)return;Dn.push(n)}return n}static jsonStringify(t){if(!t)return"";const n=JSON.stringify(t,ft.stringifyCircularHandler);return Dn.length=0,n}static jsonParse(t){const n=ft.jsonStringify(t);if(n.length>1)return JSON.parse(n)}static getObjectURL(t){let n;const o=window;return o.createObjcectURL!=null?n=o.createOjcectURL(t):window.URL!=null?n=window.URL.createObjectURL(t):window.webkitURL!=null&&(n=window.webkitURL.createObjectURL(t)),n}static getFileShortMD5(t,n){const o=File.prototype,r=o.slice||o.mozSlice||o.webkitSlice,i=t,s=2097152,a=new Ln.ArrayBuffer,l=new FileReader;l.onload=function(h){a.append(h.target?.result);const w=a.end();n({isOK:!0,data:w})},l.onerror=function(){const h="\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01";console.warn(h),n({isOK:!1,data:h})},function(){const h=0+s>=i.size?i.size:0+s;l.readAsArrayBuffer(r.call(i,0,h))}()}static getFileMD5(t,n){const o=File.prototype,r=o.slice||o.mozSlice||o.webkitSlice,i=t,s=2097152,a=Math.ceil(i.size/s);let l=0;const h=new Ln.ArrayBuffer,w=new FileReader;function _(){const k=l*s,$=k+s>=i.size?i.size:k+s;w.readAsArrayBuffer(r.call(i,k,$))}w.onload=function(k){if(h.append(k.target?.result),l++,l<a)_();else{const $=h.end();n({isOK:!0,data:$})}},w.onerror=function(){const k=`${i.name}:\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01`;console.warn(k),n({isOK:!1,data:k})},_()}static MD5(t,n=!1){return Ln.hash(t,n)}static copyTextByCommand(t){return new Promise((n,o)=>{const r=document.createElement("input");r.value=t,document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove(),n(!0)})}static copyText=t=>navigator.clipboard?navigator.clipboard.writeText(t).then(function(){return!0},function(n){return!1}):ft.copyTextByCommand(t);static copyElementTextByCommand(t){const n=document.createRange();n.selectNode(document.getElementById(t));const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges(),o.addRange(n);try{return document.execCommand("copy"),o.removeRange(n),!0}catch(r){return o.removeRange(n),console.error("Command\u590D\u5236\u6587\u672C\u9519\u8BEF",r),!1}}static copyElementText(t){if(!navigator.clipboard)return ft.copyElementTextByCommand(t);const n=document.createRange();n.selectNode(document.getElementById(t));const o=window.getSelection();return o.rangeCount>0&&o.removeAllRanges(),o.addRange(n),navigator.clipboard.writeText(o).then(function(){return o.removeRange(n),!0},function(r){return o.removeRange(n),console.error("Clipboard\u590D\u5236\u6587\u672C\u9519\u8BEF",r),!1})}static setGrayMode(t){ft.toggleClass(t,"grayMode",document.documentElement)}static toggleClass(t,n,o){const r=o||document.body;let{className:i}=r;i=i.replace(n,""),r.className=t?`${i} ${n} `:i}static setCssVar(t,n,o=document.documentElement){o.style.setProperty(t,n)}static dispatchWindowResize(){const t=new Event("resize");window.dispatchEvent(t)}static dispatchElementEvent(t,n="click",o){let r;if(r=Me(t)?document.getElementById(t):t,r){const i=new Event(n,{bubbles:!0,cancelable:!0});o&&r.addEventListener("ev",s=>{o(s)},!1),r.dispatchEvent(i)}}static getRandomNum(t,n){var o=n-t,r=Math.random();return t+Math.round(r*o)}static merge(t={},n={}){let o,r,i,s;for(t||(t={}),r=0,i=n.length;r<i;r++)for(o in s=n[r],s)t[o]=s[o];return t}static setOptions(t,n){t.hasOwnProperty("options")||(t.options=t.options?Object.create(t.options):{});for(let o in n)t.options[o]=n[o];return t.options}static formatNum(t,n){let o=Math.pow(10,n===void 0?6:n);return Math.round(t*o)/o}static trim(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}static splitWords(t){return this.trim(t).split(/\s+/)}static emptyImageUrl(){return"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="}static debounce(t,n){let o=null;return function(){o&&clearTimeout(o),o=setTimeout(t,n)}}static throttle(t,n){let o=!0;return function(){if(!o)return!1;o=!1,setTimeout(()=>{t(),o=!0},n)}}static dataURLtoBlob(t){let n=t.split(",");if(!n||n.length===0)return;let o=n[0].match(/:(.*?);/)[1],r=atob(n[1]),i=r.length,s=new Uint8Array(i);for(;i--;)s[i]=r.charCodeAt(i);return new Blob([s],{type:o})}static getElement(t){return typeof t=="string"?document.getElementById(t):t}static getStyle(t,n){let o=t.style[n]||t.currentStyle&&t.currentStyle[n];if((!o||o==="auto")&&document.defaultView){let r=document.defaultView.getComputedStyle(t,null);o=r?r[n]:null}return o==="auto"?null:o}static create(t,n,o){let r=document.createElement(t);return r.className=n||"",o&&o.appendChild(r),r}static removeElement(t){let n=t.parentNode;n&&n.removeChild(t)}static emptyElement(t){for(;t.firstChild;)t.removeChild(t.firstChild)}static hasClass(t,n){if(t.classList!==void 0)return t.classList.contains(n);let o=this.getClass(t);return o.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(o)}static addClass(t,n){if(t.classList!==void 0){let o=this.splitWords(n);for(let r=0,i=o.length;r<i;r++)t.classList.add(o[r])}else if(!this.hasClass(t,n)){let o=this.getClass(t);this.setClass(t,(o?o+" ":"")+n)}}static removeClass(t,n){t.classList!==void 0?t.classList.remove(n):this.setClass(t,this.trim((" "+this.getClass(t)+" ").replace(" "+n+" "," ")))}static setClass(t,n){t.className.baseVal===void 0?t.className=n:t.className.baseVal=n}static getClass(t){return t.correspondingElement&&(t=t.correspondingElement),t.className.baseVal===void 0?t.className:t.className.baseVal}static createSvgElement(t,n,o,r){let i=document.createElementNS("http://www.w3.org/2000/svg","svg:svg");i.setAttribute("class","svg-path"),i.setAttribute("width",t),i.setAttribute("height",n),i.setAttribute("viewBox",`0 0 ${t} ${n}`);let s=document.createElementNS("http://www.w3.org/2000/svg","path");return s.setAttribute("d",o),i.appendChild(s),r&&r.appendChild(i),i}static parseDom(t,n=!0,o=""){n=n??!1;let r=document.createElement("div");return r.className=o||"",r.innerHTML=t,n?r:r.childNodes}static createVideoHTML(t,n,o){let r=this.create("video",n,o),i=this.create("source","",r);i.setAttribute("src",t),i.setAttribute("type","video/map4");let s=this.create("source","",r);return s.setAttribute("src",t),s.setAttribute("type","video/quicktime"),r}}class ze{static isNullOrEmpty=t=>t===null||t===""||t===void 0||t.length===0;static isNotEmpty=t=>!(t===null||t===""||t===void 0||t.length===0);static toHump(t){return t.replace(/[\-\/\_](\w)/g,(n,o)=>o.toUpperCase()).replace("views","")}}class Ae{prefixKey;storage;constructor(t="",n=localStorage){this.prefixKey=t,this.storage=n}getKey(t){return`${this.prefixKey}${t}`.toUpperCase()}set(t,n,o=604800){const r=JSON.stringify({value:n,expire:o!==null?new Date().getTime()+1e3*o:null});this.storage.setItem(this.getKey(t),r)}get(t,n=null){const o=this.storage.getItem(this.getKey(t));if(o)try{const r=JSON.parse(o),{value:i,expire:s}=r;if(s===null||s>=Date.now())return i;this.remove(this.getKey(t))}catch{return n}return n}getJsonObject(t){const n=this.storage.getItem(this.getKey(t));if(n)try{const o=JSON.parse(n);if(o.expire===null||o.expire>=Date.now())return o;this.remove(this.getKey(t))}catch{return}}remove(t){this.storage.removeItem(this.getKey(t))}clear(){this.storage.clear()}setCookie(t,n,o=604800){document.cookie=`${this.getKey(t)}=${n}; Max-Age=${o}`}getCookie(t){const n=document.cookie.split("; ");for(let o=0,r=n.length;o<r;o++){const i=n[o].split("=");if(i[0]===this.getKey(t))return i[1]}return""}removeCookie(t){this.setCookie(t,1,-1)}clearCookie(){const t=document.cookie.match(/[^ =;]+(?==)/g);if(t)for(let n=t.length;n--;)document.cookie=t[n]+"=0;expire="+new Date(0).toUTCString()}}const ya=new Ae("",localStorage);function mr(){let e=[];const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(var n=0;n<36;n++){const r=Math.floor(16*Math.random());e[n]=t.substring(r,r+1)}e[14]="4";const o=3&Number(e[19])|8;return e[19]=t.substring(o,o+1),e[8]=e[13]=e[18]=e[23]="-",e.join("")}function wa(){var e=new Date().getTime(),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var o=(e+16*Math.random())%16|0;return e=Math.floor(e/16),(n==="x"?o:3&o|8).toString(16)});return t}function ba(e){const t=e.toLowerCase().replace(/rgb?a?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),n=parseFloat(t[3]||"1"),o=Math.floor(n*parseInt(t[0])+255*(1-n)),r=Math.floor(n*parseInt(t[1])+255*(1-n)),i=Math.floor(n*parseInt(t[2])+255*(1-n));return"#"+("0"+o.toString(16)).slice(-2)+("0"+r.toString(16)).slice(-2)+("0"+i.toString(16)).slice(-2)}function _a(e){var t=e.toLowerCase();if(Le(e)){if(t.length===4){for(var n="#",o=1;o<4;o+=1){const i=t.slice(o,o+1);n+=i.concat(i)}t=n}var r=[];for(o=1;o<7;o+=2)r.push(parseInt("0x"+t.slice(o,o+2)));return"rgb("+r.join(",")+")"}return t}function Sa(e){const t=e;if(t.length===4){let o="#";for(var n=1;n<4;n+=1){const r=t.slice(n,n+1);o+=r.concat(r)}return o}return t}var Dt;function Ca(e){if(typeof e=="object"||!e)return;const t=e.toLowerCase().substring(0,1);return t==="#"?Dt.Hex:t==="r"||t==="("?Dt.RGBA:t==="h"?Dt.Hsla:Dt.RGBA}function Ea(e){if(e){var t=e.toLowerCase().match(/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i);if(t){var n,o,r,i=(parseFloat(t[1])%360+360)%360/360,s=parseFloat(t[2])/(/%$/.test(t[2])?100:1),a=parseFloat(t[3])/(/%$/.test(t[3])?100:1);if(s===0)n=o=r=a;else{var l=a<=.5?a*(s+1):a+s-a*s,h=2*a-l;n=$n(h,l,i+1/3),o=$n(h,l,i),r=$n(h,l,i-1/3)}return`rgba(${n=Math.round(255*n)},${o=Math.round(255*o)},${r=Math.round(255*r)},${t[4]?parseFloat(t[4]):1})`}}}function $n(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Le(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/.test(e)}function xa(e,t,n){const o=(e<<16|t<<8|n).toString(16);return"#"+new Array(Math.abs(o.length-7)).join("0")+o}function Nn(e){let t=e.toLowerCase();if(Le(e)){if(t.length===4){let o="#";for(let r=1;r<4;r+=1)o+=t.slice(r,r+1).concat(t.slice(r,r+1));t=o}const n=[];for(let o=1;o<7;o+=2)n.push(parseInt("0x"+t.slice(o,o+2)));return"RGB("+n.join(",")+")"}return t}function ka(e){if(!Le(e))return;const[t,n,o]=Nn(e).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(r=>Number(r));return .299*t+.578*n+.114*o<192}function Ia(e,t){return e=e.indexOf("#")>=0?e.substring(1,e.length):e,t=Math.trunc(255*t/100),`#${jn(e.substring(0,2),t)}${jn(e.substring(2,4),t)}${jn(e.substring(4,6),t)}`}function Ta(e,t){return e=e.indexOf("#")>=0?e.substring(1,e.length):e,t=Math.trunc(255*t/100),`#${Bn(e.substring(0,2),t)}${Bn(e.substring(2,4),t)}${Bn(e.substring(4,6),t)}`}function Bn(e,t){const n=parseInt(e,16)+t,o=n>255?255:n;return o.toString(16).length>1?o.toString(16):`0${o.toString(16)}`}function vr(e,t,n){const o=[e,t,n].map(r=>(r/=255)<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4));return .2126*o[0]+.7152*o[1]+.0722*o[2]}function Ra(e){return function(t,n){return(vr(~~t[0],~~t[1],~~t[2])+.05)/(vr(n[0],n[1],n[2])+.05)}(Nn(e.substring(1)).split(","),[0,0,0])>=12?"#000000":"#FFFFFF"}function jn(e,t){const n=parseInt(e,16)-t,o=n<0?0:n;return o.toString(16).length>1?o.toString(16):`0${o.toString(16)}`}function On(e){return{all:e=e||new Map,on(t,n){const o=e?.get(t);o&&o.push(n)||e?.set(t,[n])},off(t,n){const o=e?.get(t);o&&o.splice(o.indexOf(n)>>>0,1)},emit(t,n){(e?.get(t)||[]).slice().map(o=>{o(n)}),(e?.get("*")||[]).slice().map(o=>{o(t,n)})}}}(function(e){e[e.RGBA=0]="RGBA",e[e.Hex=1]="Hex",e[e.Hsla=2]="Hsla"})(Dt||(Dt={}));const $t=On(),lt={HproseServiceErrorEvent:"HproseServiceError",WebAPIErrorEvent:"WebAPIError",AlertInfoEvent:"AlertInfoEvent",CommonWarnEvent:"CommonWarnEvent",WidgetLoadedEvent:"WidgetLoaded",WidgetLoaded:"WidgetLoaded",WidgetUnLoadedEvent:"WidgetUnLoaded",WidgetLoadedErrorEvent:"WidgetLoadedError",WidgetVisibleChanged:"WidgetVisibleChanged",AxiosRequestErrorEvent:"AxiosRequestErrorEvent",LayoutContainerLoaded:"LayoutContainerLoaded"},De=(e,t)=>{const n=document.createElement("a");n.download=t,n.style.display="none";const o=new Blob([e],{type:"application/octet-stream"});n.href=URL.createObjectURL(o),document.body.appendChild(n),n.click(),document.body.removeChild(n)};function Ma(e,t){const n=window.URL||window.webkitURL||window,o=new Blob([e]),r=document.createElement("a");r.href=n.createObjectURL(o),r.download=t,r.click(),n.revokeObjectURL(r.href)}const yr=(e,t)=>{const n=JSON.stringify(e,null,2);t?De(n,t+".json"):$t.emit(lt.CommonWarnEvent,"\u53C2\u6570JsonID\u4E0D\u80FD\u4E3A\u7A7A\uFF01")},Pa=(e,t,n)=>{e.get(t,{responseType:"blob"}).then(function(o){De(o.data,n)}).catch(o=>{console.warn(o),$t.emit(lt.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})};function wr(e){const t=e.lastIndexOf("/")+1;let n=e.substring(t);return n=decodeURI(n.split("?")[0]),n}function za({url:e,target:t="_blank",fileName:n}){const o=new URL(e).host==location.host;return new Promise((r,i)=>{if(o){const s=document.createElement("a");if(s.href=e,s.target=t,s.download!==void 0&&(s.download=n||wr(e)),document.createEvent){const a=document.createEvent("MouseEvents");return a.initEvent("click",!0,!0),s.dispatchEvent(a),r(!0)}return e.indexOf("?")===-1&&(e+="?download"),window.open(e,t),r(!0)}{const s=document.createElement("canvas"),a=document.createElement("img");a.setAttribute("crossOrigin","Anonymous"),a.src=e,a.onload=l=>{s.width=a.width,s.height=a.height,s.getContext("2d").drawImage(a,0,0,a.width,a.height),s.toBlob(h=>{if(h){const w=document.createElement("a");w.href=window.URL.createObjectURL(h),w.download=wr(e),w.click(),URL.revokeObjectURL(w.href),r(!0)}},"image/jpeg")},a.onerror=l=>i(l)}})}function Aa(e){const t=new Date().getTime();let n=new Date().getTime();for(;n-t<e;)n=new Date().getTime();console.log(`\u5F3A\u5236\u7B49\u5F85${br}\u6BEB\u79D2`)}function br(e){return new Promise(t=>setTimeout(t,e))}var _r,Wn={exports:{}},Sr,Cr,Un,Fn=(_r||(_r=1,Cr=Wn.exports,Un=function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),o=["trace","debug","info","warn","error"],r={},i=null;function s(I,p){var u=I[p];if(typeof u.bind=="function")return u.bind(I);try{return Function.prototype.bind.call(u,I)}catch{return function(){return Function.prototype.apply.apply(u,[I,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function l(I){return I==="debug"&&(I="log"),typeof console!==t&&(I==="trace"&&n?a:console[I]!==void 0?s(console,I):console.log!==void 0?s(console,"log"):e)}function h(){for(var I=this.getLevel(),p=0;p<o.length;p++){var u=o[p];this[u]=p<I?e:this.methodFactory(u,I,this.name)}if(this.log=this.debug,typeof console===t&&I<this.levels.SILENT)return"No console available for logging"}function w(I){return function(){typeof console!==t&&(h.call(this),this[I].apply(this,arguments))}}function _(I,p,u){return l(I)||w.apply(this,arguments)}function k(I,p){var u,v,y,d=this,f="loglevel";function z(){var M;if(typeof window!==t&&f){try{M=window.localStorage[f]}catch{}if(typeof M===t)try{var N=window.document.cookie,O=encodeURIComponent(f),T=N.indexOf(O+"=");T!==-1&&(M=/^([^;]+)/.exec(N.slice(T+O.length+1))[1])}catch{}return d.levels[M]===void 0&&(M=void 0),M}}function L(M){var N=M;if(typeof N=="string"&&d.levels[N.toUpperCase()]!==void 0&&(N=d.levels[N.toUpperCase()]),typeof N=="number"&&N>=0&&N<=d.levels.SILENT)return N;throw new TypeError("log.setLevel() called with invalid level: "+M)}typeof I=="string"?f+=":"+I:typeof I=="symbol"&&(f=void 0),d.name=I,d.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},d.methodFactory=p||_,d.getLevel=function(){return y??v??u},d.setLevel=function(M,N){return y=L(M),N!==!1&&function(O){var T=(o[O]||"silent").toUpperCase();if(typeof window!==t&&f){try{return void(window.localStorage[f]=T)}catch{}try{window.document.cookie=encodeURIComponent(f)+"="+T+";"}catch{}}}(y),h.call(d)},d.setDefaultLevel=function(M){v=L(M),z()||d.setLevel(M,!1)},d.resetLevel=function(){y=null,function(){if(typeof window!==t&&f){try{window.localStorage.removeItem(f)}catch{}try{window.document.cookie=encodeURIComponent(f)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}(),h.call(d)},d.enableAll=function(M){d.setLevel(d.levels.TRACE,M)},d.disableAll=function(M){d.setLevel(d.levels.SILENT,M)},d.rebuild=function(){if(i!==d&&(u=L(i.getLevel())),h.call(d),i===d)for(var M in r)r[M].rebuild()},u=L(i?i.getLevel():"WARN");var D=z();D!=null&&(y=L(D)),h.call(d)}(i=new k).getLogger=function(I){if(typeof I!="symbol"&&typeof I!="string"||I==="")throw new TypeError("You must supply a name when creating a logger.");var p=r[I];return p||(p=r[I]=new k(I,i.methodFactory)),p};var $=typeof window!==t?window.log:void 0;return i.noConflict=function(){return typeof window!==t&&window.log===i&&(window.log=$),i},i.getLoggers=function(){return r},i.default=i,i},(Sr=Wn).exports?Sr.exports=Un():Cr.log=Un()),Wn.exports);class Er{message;eventBus;constructor(t,n){t&&(this.message=t),n&&(this.eventBus=n)}msg(t,n=3,o="success"){if(this.message)if(typeof this.message=="function")this.message({type:o,message:t,duration:n});else switch(o){case"info":this.message.info(t,n);break;case"success":this.message.success(t,n);break;case"warning":this.message.warn?this.message.warn(t,n):this.message.warning&&this.message.warning(t,n);break;case"error":this.message.error(t,n)}else{switch(o){case"info":case"success":console.log(t);break;case"warning":console.warn(t);break;case"error":o="dark",console.error(t)}this.eventBus&&this.eventBus.emit(lt.AlertInfoEvent,{type:o,info:t})}}info(t,n=3){this.msg(t,n,"info")}warn(t,n=3){this.msg(t,n,"warning")}err(t,n=3){this.msg(t,n,"error")}success(t,n=3){this.msg(t,n,"success")}}let xr=!1;const j={Config:SysConfig,EventBus:$t,DefaultProxyClient:null,Axios:Ws,Message:new Er(void 0,$t),LayoutMap:new Map,getLayoutManager:e=>{if(!j.WidgetConfigList||j.WidgetConfigList.length===0)return;const t=j.WidgetConfigList.find(n=>n.id===e);if(t){const n=t.layoutID;if(n&&j.LayoutMap.has(n))return j.LayoutMap.get(n)}},Logger:e=>{xr||(import.meta.env?.DEV||SysConfig.UI.ProductLog?Fn.enableAll():Fn.setDefaultLevel("warn"),xr=!0);const t=e||"default";return Fn.getLogger(t)}},kr="access_token",kt=new Ae("user",localStorage);function Nt(){return kt.get(kr)}function Hn(){kt.remove(kr)}function Ir(){return Nt()?.refresh}function qn(e,t,n,o="json",r){const i={baseURL:j.Config.ServiceURL.DefaultWebAPI,timeout:6e4,params:e,paramsSerializer:{serialize:function(s){return Us.stringify(s,{indices:!1,arrayFormat:"repeat"})}},headers:{"Content-Type":"application/json",Authorization:"bearer "+Nt()?.token},responseType:o,cancelToken:r};if(n)for(let s in n)i.headers[s]=n[s];return j.SystemID&&(i.headers.sysid=j.SystemID,j.SystemGroup&&(i.headers.sysgroup=j.SystemGroup)),t&&(i.baseURL=t),i}function It(e,t,n,o,r="json",i,s){const a=qn(n,t,o,r,i);return s&&s>=2e4&&(a.timeout=s),j.Axios?.get(e,a).catch(function(l){$e(l,t,e,"Get")})}function $e(e,t,n,o="Get"){const r=`${t}${n}`;if(e&&e.response){let i=!1;const s=e.response.status;switch(s){case 400:e.message="\u9519\u8BEF\u8BF7\u6C42";break;case 401:e.message="\u672A\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55";break;case 403:e.message="\u62D2\u7EDD\u8BBF\u95EE";break;case 404:e.message="\u8BF7\u6C42\u9519\u8BEF,\u672A\u627E\u5230\u8BE5\u8D44\u6E90";break;case 405:e.message="\u8BF7\u6C42\u65B9\u6CD5\u672A\u5141\u8BB8";break;case 408:e.message="\u8BF7\u6C42\u8D85\u65F6";break;case 500:const l=e.response.data;if(l){const h=l.indexOf(":"),w=l.indexOf(`
|
|
2
|
+
`);if(h>0&&w-h>2){const _=l.substring(h+2,w);_.indexOf("System.Exception")>0?e.message="\u540E\u53F0\u670D\u52A1\u5185\u90E8\u51FA\u9519\uFF01":(i=!0,e.message=_)}else i=!0,e.message=l}else e.message="\u670D\u52A1\u5668\u7AEF\u51FA\u9519";break;case 501:e.message="\u7F51\u7EDC\u672A\u5B9E\u73B0";break;case 502:e.message="\u7F51\u7EDC\u9519\u8BEF";break;case 503:e.message="\u670D\u52A1\u4E0D\u53EF\u7528";break;case 504:e.message="\u7F51\u7EDC\u8D85\u65F6";break;case 505:e.message="http\u7248\u672C\u4E0D\u652F\u6301\u8BE5\u8BF7\u6C42";break;default:e.message=`\u8FDE\u63A5\u9519\u8BEF${e.response.status}`}let a={address:r,code:s,isExceptionInfo:i,message:e.message,result:e.response.data};if(j.EventBus.emit(lt.AxiosRequestErrorEvent,a),i)throw new Error(e.message)}else{if(e?.message)throw new Error(e.message);console.error(e,"Http\u8BF7\u6C42\u9519\u8BEF!")}}function Tr(e,t,n,o,r,i="json",s){const a=qn(o,t,r,i);s&&s>=2e4&&(a.timeout=s),a.headers["Content-Type"]="multipart/form-data";const l=function(h){let w=new FormData;return h&&Object.keys(h).forEach(_=>{if(!h)return;let k=h[_];k!=null&&(An(k)?k.forEach($=>{w.append(_,Mr($))}):w.append(_,Mr(k)))}),w}(n);return j.Axios?.post(e,l,a).catch(function(h){$e(h,t,e,"Post")})}function Rr(e,t,n,o,r,i="json",s){const a=qn(o,t,r,i);return s&&s>=2e4&&(a.timeout=s),j.Axios?.post(e,n,a).catch(function(l){$e(l,t,e,"Post")})}function La(e,t){return It(e,void 0,t)}function Da(e,t){return Tr(e,void 0,t)}function $a(e,t){return j.Axios?.get(e,{params:t}).catch(function(n){$e(n,e,"","\u5916\u90E8Get")})}function Mr(e){return e instanceof Blob?e:e.toString()}var Pr,zr,Xn,Ar,Vn,Lr,Gn,Dr,$r,Ne={exports:{}};function Na(){return zr?Pr:(zr=1,e=typeof window<"u"?window:Gt!==void 0?Gt:typeof self<"u"?self:{},Pr=e);var e}function Ba(){if(Ar)return Xn;Ar=1,Xn=function(t){if(!t)return!1;var n=e.call(t);return n==="[object Function]"||typeof t=="function"&&n!=="[object RegExp]"||typeof window<"u"&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)};var e=Object.prototype.toString;return Xn}function ja(){if(Lr)return Vn;Lr=1;var e=function(t){return t.replace(/^\s+|\s+$/g,"")};return Vn=function(t){if(!t)return{};for(var n,o={},r=e(t).split(`
|
|
3
|
+
`),i=0;i<r.length;i++){var s=r[i],a=s.indexOf(":"),l=e(s.slice(0,a)).toLowerCase(),h=e(s.slice(a+1));o[l]===void 0?o[l]=h:(n=o[l],Object.prototype.toString.call(n)==="[object Array]"?o[l].push(h):o[l]=[o[l],h])}return o},Vn}var Oa=function(){if($r)return Ne.exports;$r=1;var e=Na(),t=Ba(),n=ja(),o=function(){if(Dr)return Gn;Dr=1,Gn=function(){for(var l={},h=0;h<arguments.length;h++){var w=arguments[h];for(var _ in w)a.call(w,_)&&(l[_]=w[_])}return l};var a=Object.prototype.hasOwnProperty;return Gn}();function r(a,l,h){var w=a;return t(l)?(h=l,typeof a=="string"&&(w={uri:a})):w=o(l,{uri:a}),w.callback=h,w}function i(a,l,h){return s(l=r(a,l,h))}function s(a){if(a.callback===void 0)throw new Error("callback argument missing");var l=!1,h=function(M,N,O){l||(l=!0,a.callback(M,N,O))};function w(){var M=void 0;if(M=p.response?p.response:p.responseText||function(N){try{if(N.responseType==="document")return N.responseXML;var O=N.responseXML&&N.responseXML.documentElement.nodeName==="parsererror";if(N.responseType===""&&!O)return N.responseXML}catch{}return null}(p),L)try{M=JSON.parse(M)}catch{}return M}function _(M){return clearTimeout(u),M instanceof Error||(M=new Error(""+(M||"Unknown XMLHttpRequest Error"))),M.statusCode=0,h(M,D)}function k(){if(!I){var M;clearTimeout(u),M=a.useXDR&&p.status===void 0?200:p.status===1223?204:p.status;var N=D,O=null;return M!==0?(N={body:w(),statusCode:M,method:y,headers:{},url:v,rawRequest:p},p.getAllResponseHeaders&&(N.headers=n(p.getAllResponseHeaders()))):O=new Error("Internal XMLHttpRequest Error"),h(O,N,N.body)}}var $,I,p=a.xhr||null;p||(p=a.cors||a.useXDR?new i.XDomainRequest:new i.XMLHttpRequest);var u,v=p.url=a.uri||a.url,y=p.method=a.method||"GET",d=a.body||a.data,f=p.headers=a.headers||{},z=!!a.sync,L=!1,D={body:void 0,headers:{},statusCode:0,method:y,url:v,rawRequest:p};if("json"in a&&a.json!==!1&&(L=!0,f.accept||f.Accept||(f.Accept="application/json"),y!=="GET"&&y!=="HEAD"&&(f["content-type"]||f["Content-Type"]||(f["Content-Type"]="application/json"),d=JSON.stringify(a.json===!0?d:a.json))),p.onreadystatechange=function(){p.readyState===4&&setTimeout(k,0)},p.onload=k,p.onerror=_,p.onprogress=function(){},p.onabort=function(){I=!0},p.ontimeout=_,p.open(y,v,!z,a.username,a.password),z||(p.withCredentials=!!a.withCredentials),!z&&a.timeout>0&&(u=setTimeout(function(){if(!I){I=!0,p.abort("timeout");var M=new Error("XMLHttpRequest timeout");M.code="ETIMEDOUT",_(M)}},a.timeout)),p.setRequestHeader)for($ in f)f.hasOwnProperty($)&&p.setRequestHeader($,f[$]);else if(a.headers&&!function(M){for(var N in M)if(M.hasOwnProperty(N))return!1;return!0}(a.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in a&&(p.responseType=a.responseType),"beforeSend"in a&&typeof a.beforeSend=="function"&&a.beforeSend(p),p.send(d||null),p}return Ne.exports=i,Ne.exports.default=i,i.XMLHttpRequest=e.XMLHttpRequest||function(){},i.XDomainRequest="withCredentials"in new i.XMLHttpRequest?i.XMLHttpRequest:e.XDomainRequest,function(a,l){for(var h=0;h<a.length;h++)l(a[h])}(["get","put","post","patch","head","delete"],function(a){i[a==="delete"?"del":a]=function(l,h,w){return(h=r(l,h,w)).method=a.toUpperCase(),s(h)}}),Ne.exports}(),Wa=Pe(Oa);const Ua=[200,201,202,204,308],Fa=[408,502,503,504];class Nr{endpoint;file;headers;method;chunkSize;attempts;delayBeforeAttempt;md5;chunk;chunkCount;chunkByteSize;maxFileBytes;endpointValue;totalChunks;attemptCount;offline;paused;success;currentXhr;reader;eventTarget;fileName;constructor(t){this.endpoint=t.endpoint,this.file=t.file,this.fileName=encodeURI(this.file.name),this.headers=t.headers||{},this.method=t.method||"PUT",this.chunkSize=t.chunkSize||5120,this.attempts=t.attempts||5,this.delayBeforeAttempt=t.delayBeforeAttempt||1,this.md5=t.md5||"",this.maxFileBytes=1024*(t.maxFileSize||0),this.chunkCount=0,this.chunkByteSize=1024*this.chunkSize,this.totalChunks=Math.ceil(this.file.size/this.chunkByteSize),this.attemptCount=0,this.offline=!1,this.paused=!1,this.success=!1,this.reader=new FileReader,this.eventTarget=On(),this.validateOptions(),this.getEndpoint().then(()=>this.sendChunks()),typeof window<"u"&&(window.addEventListener("online",()=>{this.offline&&(this.offline=!1,this.dispatch("online"),this.sendChunks())}),window.addEventListener("offline",()=>{this.offline=!0,this.dispatch("offline")}))}on(t,n){this.eventTarget.on(t,n)}abort(){this.pause(),this.currentXhr?.abort()}pause(){this.paused=!0}resume(){this.paused&&(this.paused=!1,this.sendChunks())}dispatch(t,n){this.eventTarget.emit(t,n)}validateOptions(){if(!this.endpoint||typeof this.endpoint!="function"&&typeof this.endpoint!="string")throw new TypeError("endpoint\u5FC5\u987B\u4E3A\uFF1A\u6587\u4EF6\u4E0A\u4F20URL\u5B57\u7B26\u4E32\uFF0C\u6216\u8FD4\u56DE\u5730\u5740\u7684\u51FD\u6570\uFF01");if(!(this.file instanceof File))throw new TypeError("file\u5FC5\u987B\u4E3A\u6587\u4EF6\u5BF9\u8C61");if(this.headers&&typeof this.headers!="object")throw new TypeError("\u6587\u4EF6\u5934\u5FC5\u987B\u4E3A\u5BF9\u8C61\u6216\u7A7A\uFF01");if(this.chunkSize&&(typeof this.chunkSize!="number"||this.chunkSize<=0||this.chunkSize%256!=0))throw new TypeError("chunkSize\u5FC5\u987B\u5927\u4E8E0,\u5E76\u662F256\u7684\u6574\u6570\u500D");if(this.maxFileBytes>0&&this.maxFileBytes<this.file.size)throw new Error(`\u6587\u4EF6\u5927\u5C0F\u8D85\u8FC7\u6700\u5927\u5141\u8BB8\u503C\uFF1A(${this.file.size} > ${this.maxFileBytes})`);if(this.attempts&&(typeof this.attempts!="number"||this.attempts<=0))throw new TypeError("\u91CD\u8BD5\u6B21\u6570\u5FC5\u987B\u4E3A\u6B63\u6570\uFF01");if(this.delayBeforeAttempt&&(typeof this.delayBeforeAttempt!="number"||this.delayBeforeAttempt<0))throw new TypeError("\u5EF6\u65F6\u91CD\u8BD5\u65F6\u95F4\u5FC5\u987B\u4E3A\u6B63\u6570\uFF01\u9ED8\u8BA4\u4E3A1")}getEndpoint(){return typeof this.endpoint=="string"?(this.endpointValue=this.endpoint,Promise.resolve(this.endpoint)):this.endpoint(this.file).then(t=>(this.endpointValue=t,this.endpointValue))}getChunk(){return new Promise(t=>{const n=this.totalChunks===1?this.file.size:this.chunkByteSize,o=n*this.chunkCount;this.reader.onload=()=>{this.reader.result!==null&&(this.chunk=new Blob([this.reader.result],{type:"application/octet-stream"})),t(()=>{})},this.reader.readAsArrayBuffer(this.file.slice(o,o+n))})}xhrPromise(t){const n=o=>{o.upload.onprogress=r=>{const i=100/this.totalChunks,s=i*this.file.size,a=i*this.chunkCount,l=r.loaded/(r.total??s)*i;this.dispatch("progress",Math.min(a+l,100))}};return new Promise((o,r)=>{this.currentXhr=Wa({...t,beforeSend:n},(i,s)=>(this.currentXhr=void 0,i?r(i):o(s)))})}sendChunk(){if(!this.chunk)return;const t=this.chunkCount*this.chunkByteSize,n=t+this.chunk.size-1,o={...this.headers,FileName:this.fileName,FileMD5:this.md5,"Content-Type":this.file.type,"Content-Range":`bytes ${t}-${n}/${this.file.size}`};if(this.dispatch("attempt",{chunkNumber:this.chunkCount,chunkSize:this.chunk.size}),this.endpointValue)return this.xhrPromise({headers:o,url:this.endpointValue,method:this.method,body:this.chunk});console.warn("\u6587\u4EF6\u4E0A\u4F20endpointValue\u4E0D\u80FD\u4E3A\u7A7A\uFF01"),this.dispatch("error",{message:"\u6587\u4EF6\u4E0A\u4F20endpointValue\u4E0D\u80FD\u4E3A\u7A7A\uFF01\u53D6\u6D88\u4E0A\u4F20\uFF01",chunk:this.chunkCount,attempts:this.attemptCount})}manageRetries(){if(this.attemptCount<this.attempts)return setTimeout(()=>this.sendChunks(),1e3*this.delayBeforeAttempt),void this.dispatch("attemptFailure",{message:`\u4E0A\u4F20\u5206\u7247\uFF1A${this.chunkCount}\u5931\u8D25\u3002\u8FD8\u4F1A\u518D\u5C1D\u8BD5 ${this.attempts-this.attemptCount}\u6B21\uFF01`,chunkNumber:this.chunkCount,attemptsLeft:this.attempts-this.attemptCount});this.dispatch("error",{message:`\u4E0A\u4F20\u5206\u7247\u9519\u8BEF\uFF1A ${this.chunkCount}\u3002\u505C\u6B62\u5C1D\u8BD5\uFF0C\u53D6\u6D88\u4E0A\u4F20\uFF01`,chunk:this.chunkCount,attempts:this.attemptCount})}sendChunks(){console.log(this.paused,this.offline,this.success,"sendChunks this.paused || this.offline || this.success"),!(this.paused||this.offline||this.success)&&this.getChunk().then(()=>this.sendChunk()).then(t=>{if(this.attemptCount=this.attemptCount+1,t!=null&&Ua.includes(t.statusCode)){this.dispatch("chunkSuccess",{chunk:this.chunkCount,attempts:this.attemptCount,response:t}),this.attemptCount=0,this.chunkCount=this.chunkCount+1,this.chunkCount<this.totalChunks?this.sendChunks():(this.success=!0,this.dispatch("success"));const n=this.chunkCount/this.totalChunks*this.file.size*100/this.file.size;this.dispatch("progress",n)}else if(t!=null&&Fa.includes(t.statusCode)){if(this.paused||this.offline)return;this.manageRetries()}else{if(this.paused||this.offline)return;console.log(`\u670D\u52A1\u5668\u9519\u8BEF:${t?.statusCode}\uFF0C\u505C\u6B62\u4E0A\u4F20\u3002`),this.dispatch("error",{message:`\u670D\u52A1\u5668\u9519\u8BEF:${t?.statusCode}\uFF0C\u505C\u6B62\u4E0A\u4F20\u3002`,chunkNumber:this.chunkCount,attempts:this.attemptCount})}}).catch(t=>{this.paused||this.offline||this.manageRetries()})}}const Ha=e=>new Nr(e),qa=new class{hasClass(e,t){return e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}addClass(e,t){this.hasClass(e,t)||(e.className+=" "+t)}removeClass(e,t){if(this.hasClass(e,t)){const n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ")}}toggleClass(e,t){this.hasClass(e,t)?this.removeClass(e,t):this.addClass(e,t)}setCSSProperty(e,t,n){e?.style.setProperty(t,n)}};class ge{hproseURL;client;hproseProxy;static httpTransport;constructor(t){if(t&&!ze.isNullOrEmpty(t)){if(ge.httpTransport||(ge.httpTransport=new Xs),this.client=new Fs(t),!this.client)throw Error("Hprose Client\u521D\u59CB\u5316\u9519\u8BEF");this.hproseURL=t,this.init()}}init(){this.client&&this.client.useServiceAsync().then(t=>{this.hproseProxy=t}).catch(t=>{String(t).indexOf("find this method ~")>0?(this.hproseProxy=this.client?.useService(),console.warn("\u65E7\u7248\u672C\u4E0D\u652F\u6301useServiceAsync")):$t.emit(lt.HproseServiceErrorEvent,"\u521D\u59CB\u5316\u9ED8\u8BA4Hprose!"),console.warn(t)})}async getProxy(){if(!this.hproseProxy)try{this.client&&(this.hproseProxy=await this.client.useServiceAsync())}catch(t){console.warn(t),this.hproseProxy=this.client?.useService()}return this.hproseProxy}async invoke(t,n,o){if(this.client)return await this.client.invoke(t,n,o)}encode(t,n,o){if(this.client)return this.client.codec.encode(t,n,o)}decode(t,n){if(this.client)return this.client.codec.decode(t,n)}}class oe{hproseClient;hpProxyObj;defaultContext=new kn;constructor(t){this.hproseClient=new ge(t),this.hpProxyObj=null}getClientContext(t,n){const o={};n&&(o.requestHeaders=n);const r=Nt();o.httpRequestHeaders=t||{};const i=o.httpRequestHeaders;return r&&(i.token=r.token),j.SystemID&&(i.sysid=j.SystemID,j.SystemGroup&&(i.sysgroup=j.SystemGroup)),new kn(o)}async getHproseProxy(){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");if(!this.hpProxyObj){const t=await this.hproseClient.getProxy();this.hpProxyObj=t}return this.hpProxyObj||$t.emit(lt.HproseServiceErrorEvent,"HproseProxy\u5BF9\u8C61\u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5\uFF01"),this.hpProxyObj}async hproseInvoke(t,n,o){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");return await this.hproseClient.invoke(t,n,o)}async hproseInvokeContext(t,n,...o){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");const r=Nt();return console.log(r,"userToken3"),r&&(n||(n=new kn({httpRequestHeaders:{token:r.token}}))),await this.hproseClient.invoke(t,o,n)}async hproseInvokeEncode(t){const n=new Ee(t).toBytes(),o=await this.hproseClient.client?.request(n,this.defaultContext);return o&&this.hproseClient.client?.codec.decode(o,this.defaultContext)}encodeRequest(t,...n){const o=this.hproseClient.client?.codec?.encode(t,n,this.defaultContext);return Ee.toString(o)}}const Kn=new Map,Xa=function(e,t,n){!j.Config.DefaultHproseAPI&&j.Config.ServiceURL&&(j.Config.DefaultHproseAPI=j.Config.ServiceURL.DefaultHproseAPI),j.Config.DefaultHproseAPI&&ze.isNotEmpty(j.Config.DefaultHproseAPI)&&(j.DefaultProxyClient=new oe(j.Config.DefaultHproseAPI));const o=j.Config.UI.GrayMode;o&&ft.setGrayMode(o);const r=new Er(e,j.EventBus);j.Message=r,j.SystemID=t,j.SystemGroup=n,j.EventBus.on(lt.HproseServiceErrorEvent,i=>{const s=`\u5F53\u524D\u540E\u53F0\u4E1A\u52A1\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("Hprose\u8BF7\u6C42\u9519\u8BEF",s)}),j.EventBus.on(lt.WebAPIErrorEvent,i=>{const s=`WebAPI\u540E\u53F0\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("WebAPI\u8BF7\u6C42\u9519\u8BEF",s)}),j.EventBus.on(lt.AxiosRequestErrorEvent,i=>{const s=`Http\u8BF7\u6C42'${i.code}'\u9519\u8BEF: ${i.message}`;console.warn("Http\u8BF7\u6C42\u9519\u8BEF",s)}),j.EventBus.on(lt.CommonWarnEvent,i=>{r.warn(i)})};function Br(e){if(e&&ze.isNotEmpty(e)){if(Kn.has(e))return Kn.get(e);{const t=new oe(e);return Kn.set(e,t),t}}}function Va(e){const t=Br(e);return t&&(j.DefaultProxyClient=t),t}const Jn="is_LockScreen",jr=kt.get(Jn,!1),re={isLock:jr,lockTime:jr=="true"?Wr():0};function Or(e){re.isLock=e,kt.set(Jn,e,10),e&&(Hn(),console.log("\u9501\u5C4F\u4E86\u2026\u2026"))}function Ga(){return kt.get(Jn,!1)}function Wr(){let e=3600;return j.Config.UI?.LockTime&&j.Config.UI?.LockTime>=10&&(e=j.Config.UI.LockTime),e}let Yn;function Zn(){clearInterval(Yn),!(window.location.href.indexOf("/login")>0||re.isLock)&&(Or(!1),re.lockTime=Wr(),Yn=setInterval(()=>{if(re.lockTime--,re.lockTime<=0)return Or(!0),clearInterval(Yn)},1e3))}function Ka(){Zn(),document.addEventListener("mousedown",Zn)}function Ja(){document.removeEventListener("mousedown",Zn)}function Qn(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ur,Fr={exports:{}};/*!
|
|
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(e){((t,n)=>{e.exports=n()})(0,()=>{const t=typeof window=="object"?window:this;t.HTMLElement||console.warn("streamsaver is meant to run on browsers main thread");let n=null,o=!1;const r=t.WebStreamsPolyfill||{},i=t.isSecureContext;let s=/constructor/i.test(t.HTMLElement)||!!t.safari||!!t.WebKitPoint;const a=i||"MozAppearance"in document.documentElement.style?"iframe":"navigate",l={createWriteStream:function(w,_,x){let P={size:null,pathname:null,writableStrategy:void 0,readableStrategy:void 0},I=0,y=null,u=null,p=null;if(Number.isFinite(_)?([x,_]=[_,x],console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),P.size=x,P.writableStrategy=_):_&&_.highWaterMark?(console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),P.size=x,P.writableStrategy=_):P=_||{},!s){n||(n=i?d(l.mitm):function(L){const A="width=200,height=100",D=document.createDocumentFragment(),$={frame:t.open(L,"popup",A),loaded:!1,isIframe:!1,isPopup:!0,remove(){$.frame.close()},addEventListener(...U){D.addEventListener(...U)},dispatchEvent(...U){D.dispatchEvent(...U)},removeEventListener(...U){D.removeEventListener(...U)},postMessage(...U){$.frame.postMessage(...U)}},j=U=>{U.source===$.frame&&($.loaded=!0,t.removeEventListener("message",j),$.dispatchEvent(new Event("load")))};return t.addEventListener("message",j),$}(l.mitm)),u=new MessageChannel,w=encodeURIComponent(w.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A");const h={transferringReadable:o,pathname:P.pathname||Math.random().toString().slice(-6)+"/"+w,headers:{"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+w}};P.size&&(h.headers["Content-Length"]=P.size);const f=[h,"*",[u.port2]];if(o){const L=a==="iframe"?void 0:{transform(D,$){if(!(D instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");I+=D.length,$.enqueue(D),y&&(location.href=y,y=null)},flush(){y&&(location.href=y)}};p=new l.TransformStream(L,P.writableStrategy,P.readableStrategy);const A=p.readable;u.port1.postMessage({readableStream:A},[A])}u.port1.onmessage=L=>{L.data.download?a==="navigate"?(n.remove(),n=null,I?location.href=L.data.download:y=L.data.download):(n.isPopup&&(n.remove(),n=null,a==="iframe"&&d(l.mitm)),d(L.data.download)):L.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),I+=h.length,y&&(location.href=y,y=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=w,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}},P.writableStrategy)},WritableStream:t.WritableStream||r.WritableStream,supported:!0,version:{full:"2.0.5",major:2,minor:0,dot:5},mitm:"https://jimmywarting.github.io/StreamSaver.js/mitm.html?version=2.0.0"};function d(w){if(!w)throw new Error("meh");const _=document.createElement("iframe");return _.hidden=!0,_.src=w,_.loaded=!1,_.name="iframe",_.isIframe=!0,_.postMessage=(...x)=>_.contentWindow.postMessage(...x),_.addEventListener("load",()=>{_.loaded=!0},{once:!0}),document.body.appendChild(_),_}try{new Response(new ReadableStream),i&&!("serviceWorker"in navigator)&&(s=!0)}catch{s=!0}return(w=>{try{w()}catch{}})(()=>{const{readable:w}=new TransformStream,_=new MessageChannel;_.port1.postMessage(w,[w]),_.port1.close(),_.port2.close(),o=!0,Object.defineProperty(l,"TransformStream",{configurable:!1,writable:!1,value:TransformStream})}),l})})(Lr);var Xa=Te(Lr.exports);class Va{fileID;downloadURL;ChunkUnitM=1048576;chunkByteSize;totalChunks=1;currentDB;keys;fileMetaData=null;finishNum=0;eventTarget;cancelSource;isStarting=!1;fileName;cacheSize=6;requestTimeout=6e4;constructor(t,n,o=3,r=6,i=6e4){this.fileID=t,this.downloadURL=n,this.chunkByteSize=o*this.ChunkUnitM,this.eventTarget=On(),this.initIndexDB(),r>=3&&(this.cacheSize=r),i>this.requestTimeout&&(this.requestTimeout=i)}on(t,n){this.eventTarget.on(t,n)}dispatch(t,n){this.eventTarget.emit(t,n)}dispatchError(t){this.eventTarget.emit("error",t)}dispatchInfo(t){this.eventTarget.emit("info",t)}async queryDownloadFileMeta(t,n="",o){this.dispatchInfo("\u5F00\u59CB\u83B7\u53D6\u6587\u4EF6\u4FE1\u606F");const r=await Et(n,t,o);let i=null;return r&&r.status===200&&(i=r.data),i}async getIFileMeta(){if(this.fileMetaData===null){const t=await this.currentDB?.getItem("fileinfo");this.fileMetaData=t||null}return this.fileMetaData}initIndexDB(){this.currentDB=Ae.createInstance({name:this.fileID,driver:Ae.INDEXEDDB})}async init(t){if(this.finishNum=0,t){const n="fileinfo";this.fileMetaData={id:t.id,name:t.name,length:t.length,downloadID:t.downloadID,chunkSize:this.chunkByteSize},this.fileName=t.name,this.currentDB?.setItem(n,this.fileMetaData)}if(this.fileMetaData!=null){const n=this.fileMetaData.chunkSize;n!=null&&n>0&&(this.chunkByteSize=n)}this.fileMetaData&&(this.totalChunks=Math.ceil(this.fileMetaData.length/this.chunkByteSize)),this.dispatchInfo("\u5B8C\u6210\u521D\u59CB\u5316\u6587\u4EF6\u4FE1\u606F\uFF0C\u603B\u5206\u7247\uFF1A"+this.totalChunks),this.currentDB&&(this.keys=await this.currentDB.keys())}getTotalChunks(){return this.totalChunks}pause(){this.cancelSource&&this.isStarting&&(this.cancelSource.cancel(),this.isStarting=!1),this.dispatchInfo("\u5DF2\u6682\u505C\u4E0B\u8F7D\u4EFB\u52A1")}restart(){this.dispatchInfo("\u6B63\u5728\u91CD\u542F\u4E0B\u8F7D\u4EFB\u52A1"),this.download()}delete(){this.cancelSource&&this.cancelSource.cancel(),Ae.dropInstance({name:this.fileID}),this.currentDB=void 0,this.keys&&(this.keys.length=0,this.keys=void 0),this.finishNum=0,this.downloadProgress(),this.outputProgress(0),this.dispatchInfo("\u5DF2\u5220\u9664\u4E0B\u8F7D\u4EFB\u52A1")}sleep(t){return new Promise(n=>setTimeout(n,t))}async download(t,n){let o=t;if(!o&&this.downloadURL&&(o=this.downloadURL),!o)throw Error("\u4E0B\u8F7DURL\u4E0D\u80FD\u4E3A\u7A7A!");this.currentDB||this.initIndexDB();const r=B.Axios.CancelToken;this.cancelSource=r.source(),this.isStarting=!0;const i={key:this.fileMetaData?.downloadID};let s=0;const a=this.cacheSize;let l=0;for(let d=0;d<this.totalChunks;d++){if(this.keys&&this.keys?.indexOf(d.toString())>=0){s++,s>this.finishNum&&(this.finishNum=s,this.downloadProgress());continue}const w=d*this.chunkByteSize;let _=w+this.chunkByteSize-1;this.fileMetaData&&_>this.fileMetaData.length&&(_=this.fileMetaData.length-1);const x={range:`bytes=${w}-${_}`};for(;l>=a;)await this.sleep(200);const P=d.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${d+1}/${this.totalChunks}`),l++,Et(o,n,i,x,"arraybuffer",this.cancelSource?.token,this.requestTimeout).then(async I=>{const y=I.data;l--,await this.currentDB?.setItem(P,y),s++,s>this.finishNum&&(this.finishNum=s,this.downloadProgress());const u=parseInt(P)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${u}/${this.totalChunks}`),this.savefile()}).catch(I=>{l--;const y=parseInt(P)+1;this.dispatchError(`\u4E0B\u8F7D\u7B2C${y}\uFF09\u4E2A\u5206\u7247\u5185\u5BB9\u5931\u8D25\uFF01`)})}this.finishNum===this.totalChunks&&this.savefile()}downloadProgress(){const t=100*this.finishNum/this.totalChunks;this.dispatch("downloadProgress",t)}outputProgress(t){const n=100*t/this.totalChunks;this.dispatch("saveProgress",n)}async savefile(){if(this.finishNum===this.totalChunks){if(!this.fileName)return void this.dispatchError("\u4E0B\u8F7D\u9519\u8BEF\uFF1A\u6587\u4EF6\u540D\u4E3A\u7A7A!");this.dispatchInfo("\u5F00\u59CB\u4FDD\u5B58\u4E0B\u8F7D\u6587\u4EF6:"+this.fileName);const t=Xa.createWriteStream(this.fileName).getWriter();let n=0;for(let o=0;o<this.totalChunks;o++){const r=o.toString();let i=await this.currentDB?.getItem(r);if(i||(i=await this.currentDB?.getItem(r)),!i)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${o+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);let s=new Response(i).body;if(s===null)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${o+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);const a=s.getReader();for(;;){const{done:l,value:d}=await a.read();if(l)break;await t.write(d)}n++,this.outputProgress(n),this.dispatchInfo(`\u5B8C\u6210\u7B2C${o+1}\u4E2A\u5206\u7247\u8F93\u51FA`)}t.close(),Ae.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}}function Ga(e,t){let n="",o="";for(const r in t)n+=r+"="+encodeURIComponent(t[r])+"&";return n=n.replace(/&$/,""),o=/\?$/.test(e)?e+n:e.replace(/\/?$/,"?")+n,o}function Ar(e={},t={}){let n;for(n in t)Lt(t[n])?e[n]=Ar(e[n],t[n]):e[n]=t[n];return e}function Ka(e,t){const n=`${e}_${t}`;return dt.MD5(n)}function Dr(e){const t=function(a){if(!a)return;const l=a,d=[];if(l)for(let w of l){const _=$r(w);_&&d.push(_)}return d}(e.bussinessRoutes),n=function(a){if(!a)return;const l=a;if(l&&l.length>0){const d=[];return l.forEach(w=>{const _=Nr(w);_&&d.push(_)}),d}}(e.widgetMenuConfig),o=function(a){if(a&&a.length>0){const l=[];return a.forEach(d=>{const w=function(_){return _?{id:_.id,label:_.label,container:_.container,preload:_.preload,afterid:_.afterid,bindid:_.bindid,group:_.group}:void 0}(d);w&&l.push(w)}),l}}(e.widgetConfig),r=function(a){if(a&&a.length>0)return a}(e.functionList),i=e.pkgObject.version,s=e.pkgObject.name;return{id:Ka(s,i),name:B.Config.UI.SiteTitle,group:B.Config.UI.Group,product:s,version:i,routes:t,widgetMenu:n,widgets:o,functions:r}}function $r(e){if(e){let t=0;e.meta?.hidden&&(t=1);let n={path:e.path,name:e.name,title:e.meta?.title,type:t,index:e.meta?.index};if(e.children){const o=[];for(let r of e.children){const i=$r(r);i&&o.push(i)}o.length>0&&(n.children=o)}return n}}function Nr(e){if(!e)return;const t={name:e.name,index:e.index,path:e.path,type:e.type};return e.children&&e.children.length>0&&(t.children=[],e.children.forEach(n=>{const o=Nr(n);o&&t.children?.push(o)})),t}function Ya(e,t="IconifyList.ts"){let n="",o=`const iconlist={
|
|
8
|
+
*/var Hr,Ya=Ur?Fr.exports:(Ur=1,Fr.exports=function e(t,n,o){function r(a,l){if(!n[a]){if(!t[a]){if(!l&&Qn)return Qn(a);if(i)return i(a,!0);var h=new Error("Cannot find module '"+a+"'");throw h.code="MODULE_NOT_FOUND",h}var w=n[a]={exports:{}};t[a][0].call(w.exports,function(_){var k=t[a][1][_];return r(k||_)},w,w.exports,e,t,n,o)}return n[a].exports}for(var i=Qn,s=0;s<o.length;s++)r(o[s]);return r}({1:[function(e,t,n){(function(o){var r,i,s=o.MutationObserver||o.WebKitMutationObserver;if(s){var a=0,l=new s(k),h=o.document.createTextNode("");l.observe(h,{characterData:!0}),r=function(){h.data=a=++a%2}}else if(o.setImmediate||o.MessageChannel===void 0)r="document"in o&&"onreadystatechange"in o.document.createElement("script")?function(){var I=o.document.createElement("script");I.onreadystatechange=function(){k(),I.onreadystatechange=null,I.parentNode.removeChild(I),I=null},o.document.documentElement.appendChild(I)}:function(){setTimeout(k,0)};else{var w=new o.MessageChannel;w.port1.onmessage=k,r=function(){w.port2.postMessage(0)}}var _=[];function k(){var I,p;i=!0;for(var u=_.length;u;){for(p=_,_=[],I=-1;++I<u;)p[I]();u=_.length}i=!1}function $(I){_.push(I)!==1||i||r()}t.exports=$}).call(this,Gt!==void 0?Gt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(e,t,n){var o=e(1);function r(){}var i={},s=["REJECTED"],a=["FULFILLED"],l=["PENDING"];function h(d){if(typeof d!="function")throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,d!==r&&$(this,d)}function w(d,f,z){this.promise=d,typeof f=="function"&&(this.onFulfilled=f,this.callFulfilled=this.otherCallFulfilled),typeof z=="function"&&(this.onRejected=z,this.callRejected=this.otherCallRejected)}function _(d,f,z){o(function(){var L;try{L=f(z)}catch(D){return i.reject(d,D)}L===d?i.reject(d,new TypeError("Cannot resolve promise with itself")):i.resolve(d,L)})}function k(d){var f=d&&d.then;if(d&&(typeof d=="object"||typeof d=="function")&&typeof f=="function")return function(){f.apply(d,arguments)}}function $(d,f){var z=!1;function L(O){z||(z=!0,i.reject(d,O))}function D(O){z||(z=!0,i.resolve(d,O))}function M(){f(D,L)}var N=I(M);N.status==="error"&&L(N.value)}function I(d,f){var z={};try{z.value=d(f),z.status="success"}catch(L){z.status="error",z.value=L}return z}function p(d){return d instanceof this?d:i.resolve(new this(r),d)}function u(d){var f=new this(r);return i.reject(f,d)}function v(d){var f=this;if(Object.prototype.toString.call(d)!=="[object Array]")return this.reject(new TypeError("must be an array"));var z=d.length,L=!1;if(!z)return this.resolve([]);for(var D=new Array(z),M=0,N=-1,O=new this(r);++N<z;)T(d[N],N);return O;function T(W,q){function it(Z){D[q]=Z,++M!==z||L||(L=!0,i.resolve(O,D))}f.resolve(W).then(it,function(Z){L||(L=!0,i.reject(O,Z))})}}function y(d){var f=this;if(Object.prototype.toString.call(d)!=="[object Array]")return this.reject(new TypeError("must be an array"));var z=d.length,L=!1;if(!z)return this.resolve([]);for(var D=-1,M=new this(r);++D<z;)N(d[D]);return M;function N(O){f.resolve(O).then(function(T){L||(L=!0,i.resolve(M,T))},function(T){L||(L=!0,i.reject(M,T))})}}t.exports=h,h.prototype.catch=function(d){return this.then(null,d)},h.prototype.then=function(d,f){if(typeof d!="function"&&this.state===a||typeof f!="function"&&this.state===s)return this;var z=new this.constructor(r);return this.state!==l?_(z,this.state===a?d:f,this.outcome):this.queue.push(new w(z,d,f)),z},w.prototype.callFulfilled=function(d){i.resolve(this.promise,d)},w.prototype.otherCallFulfilled=function(d){_(this.promise,this.onFulfilled,d)},w.prototype.callRejected=function(d){i.reject(this.promise,d)},w.prototype.otherCallRejected=function(d){_(this.promise,this.onRejected,d)},i.resolve=function(d,f){var z=I(k,f);if(z.status==="error")return i.reject(d,z.value);var L=z.value;if(L)$(d,L);else{d.state=a,d.outcome=f;for(var D=-1,M=d.queue.length;++D<M;)d.queue[D].callFulfilled(f)}return d},i.reject=function(d,f){d.state=s,d.outcome=f;for(var z=-1,L=d.queue.length;++z<L;)d.queue[z].callRejected(f);return d},h.resolve=p,h.reject=u,h.all=v,h.race=y},{1:1}],3:[function(e,t,n){(function(o){typeof o.Promise!="function"&&(o.Promise=e(2))}).call(this,Gt!==void 0?Gt:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(e,t,n){var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c};function r(c,g){if(!(c instanceof g))throw new TypeError("Cannot call a class as a function")}function i(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var s=i();function a(){try{if(!s||!s.open)return!1;var c=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),g=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!c||g)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function l(c,g){c=c||[],g=g||{};try{return new Blob(c,g)}catch(b){if(b.name!=="TypeError")throw b;for(var m=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),S=0;S<c.length;S+=1)m.append(c[S]);return m.getBlob(g.type)}}typeof Promise>"u"&&e(3);var h=Promise;function w(c,g){g&&c.then(function(m){g(null,m)},function(m){g(m)})}function _(c,g,m){typeof g=="function"&&c.then(g),typeof m=="function"&&c.catch(m)}function k(c){return typeof c!="string"&&(console.warn(c+" used as a key, but it is not a string."),c=String(c)),c}function $(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var I="local-forage-detect-blob-support",p=void 0,u={},v=Object.prototype.toString,y="readonly",d="readwrite";function f(c){for(var g=c.length,m=new ArrayBuffer(g),S=new Uint8Array(m),b=0;b<g;b++)S[b]=c.charCodeAt(b);return m}function z(c){return new h(function(g){var m=c.transaction(I,d),S=l([""]);m.objectStore(I).put(S,"key"),m.onabort=function(b){b.preventDefault(),b.stopPropagation(),g(!1)},m.oncomplete=function(){var b=navigator.userAgent.match(/Chrome\/(\d+)/),C=navigator.userAgent.match(/Edge\//);g(C||!b||parseInt(b[1],10)>=43)}}).catch(function(){return!1})}function L(c){return typeof p=="boolean"?h.resolve(p):z(c).then(function(g){return p=g})}function D(c){var g=u[c.name],m={};m.promise=new h(function(S,b){m.resolve=S,m.reject=b}),g.deferredOperations.push(m),g.dbReady?g.dbReady=g.dbReady.then(function(){return m.promise}):g.dbReady=m.promise}function M(c){var g=u[c.name].deferredOperations.pop();if(g)return g.resolve(),g.promise}function N(c,g){var m=u[c.name].deferredOperations.pop();if(m)return m.reject(g),m.promise}function O(c,g){return new h(function(m,S){if(u[c.name]=u[c.name]||St(),c.db){if(!g)return m(c.db);D(c),c.db.close()}var b=[c.name];g&&b.push(c.version);var C=s.open.apply(s,b);g&&(C.onupgradeneeded=function(E){var R=C.result;try{R.createObjectStore(c.storeName),E.oldVersion<=1&&R.createObjectStore(I)}catch(P){if(P.name!=="ConstraintError")throw P;console.warn('The database "'+c.name+'" has been upgraded from version '+E.oldVersion+" to version "+E.newVersion+', but the storage "'+c.storeName+'" already exists.')}}),C.onerror=function(E){E.preventDefault(),S(C.error)},C.onsuccess=function(){var E=C.result;E.onversionchange=function(R){R.target.close()},m(E),M(c)}})}function T(c){return O(c,!1)}function W(c){return O(c,!0)}function q(c,g){if(!c.db)return!0;var m=!c.db.objectStoreNames.contains(c.storeName),S=c.version<c.db.version,b=c.version>c.db.version;if(S&&(c.version!==g&&console.warn('The database "'+c.name+`" can't be downgraded from version `+c.db.version+" to version "+c.version+"."),c.version=c.db.version),b||m){if(m){var C=c.db.version+1;C>c.version&&(c.version=C)}return!0}return!1}function it(c){return new h(function(g,m){var S=new FileReader;S.onerror=m,S.onloadend=function(b){var C=btoa(b.target.result||"");g({__local_forage_encoded_blob:!0,data:C,type:c.type})},S.readAsBinaryString(c)})}function Z(c){return l([f(atob(c.data))],{type:c.type})}function Q(c){return c&&c.__local_forage_encoded_blob}function _t(c){var g=this,m=g._initReady().then(function(){var S=u[g._dbInfo.name];if(S&&S.dbReady)return S.dbReady});return _(m,c,c),m}function Ht(c){D(c);for(var g=u[c.name],m=g.forages,S=0;S<m.length;S++){var b=m[S];b._dbInfo.db&&(b._dbInfo.db.close(),b._dbInfo.db=null)}return c.db=null,T(c).then(function(C){return c.db=C,q(c)?W(c):C}).then(function(C){c.db=g.db=C;for(var E=0;E<m.length;E++)m[E]._dbInfo.db=C}).catch(function(C){throw N(c,C),C})}function et(c,g,m,S){S===void 0&&(S=1);try{var b=c.db.transaction(c.storeName,g);m(null,b)}catch(C){if(S>0&&(!c.db||C.name==="InvalidStateError"||C.name==="NotFoundError"))return h.resolve().then(function(){if(!c.db||C.name==="NotFoundError"&&!c.db.objectStoreNames.contains(c.storeName)&&c.version<=c.db.version)return c.db&&(c.version=c.db.version+1),W(c)}).then(function(){return Ht(c).then(function(){et(c,g,m,S-1)})}).catch(m);m(C)}}function St(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function ln(c){var g=this,m={db:null};if(c)for(var S in c)m[S]=c[S];var b=u[m.name];b||(b=St(),u[m.name]=b),b.forages.push(g),g._initReady||(g._initReady=g.ready,g.ready=_t);var C=[];function E(){return h.resolve()}for(var R=0;R<b.forages.length;R++){var P=b.forages[R];P!==g&&C.push(P._initReady().catch(E))}var A=b.forages.slice(0);return h.all(C).then(function(){return m.db=b.db,T(m)}).then(function(B){return m.db=B,q(m,g._defaultConfig.version)?W(m):B}).then(function(B){m.db=b.db=B,g._dbInfo=m;for(var U=0;U<A.length;U++){var H=A[U];H!==g&&(H._dbInfo.db=m.db,H._dbInfo.version=m.version)}})}function un(c,g){var m=this;c=k(c);var S=new h(function(b,C){m.ready().then(function(){et(m._dbInfo,y,function(E,R){if(E)return C(E);try{var P=R.objectStore(m._dbInfo.storeName).get(c);P.onsuccess=function(){var A=P.result;A===void 0&&(A=null),Q(A)&&(A=Z(A)),b(A)},P.onerror=function(){C(P.error)}}catch(A){C(A)}})}).catch(C)});return w(S,g),S}function hn(c,g){var m=this,S=new h(function(b,C){m.ready().then(function(){et(m._dbInfo,y,function(E,R){if(E)return C(E);try{var P=R.objectStore(m._dbInfo.storeName).openCursor(),A=1;P.onsuccess=function(){var B=P.result;if(B){var U=B.value;Q(U)&&(U=Z(U));var H=c(U,B.key,A++);H!==void 0?b(H):B.continue()}else b()},P.onerror=function(){C(P.error)}}catch(B){C(B)}})}).catch(C)});return w(S,g),S}function me(c,g,m){var S=this;c=k(c);var b=new h(function(C,E){var R;S.ready().then(function(){return R=S._dbInfo,v.call(g)==="[object Blob]"?L(R.db).then(function(P){return P?g:it(g)}):g}).then(function(P){et(S._dbInfo,d,function(A,B){if(A)return E(A);try{var U=B.objectStore(S._dbInfo.storeName);P===null&&(P=void 0);var H=U.put(P,c);B.oncomplete=function(){P===void 0&&(P=null),C(P)},B.onabort=B.onerror=function(){var V=H.error?H.error:H.transaction.error;E(V)}}catch(V){E(V)}})}).catch(E)});return w(b,m),b}function Zt(c,g){var m=this;c=k(c);var S=new h(function(b,C){m.ready().then(function(){et(m._dbInfo,d,function(E,R){if(E)return C(E);try{var P=R.objectStore(m._dbInfo.storeName).delete(c);R.oncomplete=function(){b()},R.onerror=function(){C(P.error)},R.onabort=function(){var A=P.error?P.error:P.transaction.error;C(A)}}catch(A){C(A)}})}).catch(C)});return w(S,g),S}function Qt(c){var g=this,m=new h(function(S,b){g.ready().then(function(){et(g._dbInfo,d,function(C,E){if(C)return b(C);try{var R=E.objectStore(g._dbInfo.storeName).clear();E.oncomplete=function(){S()},E.onabort=E.onerror=function(){var P=R.error?R.error:R.transaction.error;b(P)}}catch(P){b(P)}})}).catch(b)});return w(m,c),m}function yt(c){var g=this,m=new h(function(S,b){g.ready().then(function(){et(g._dbInfo,y,function(C,E){if(C)return b(C);try{var R=E.objectStore(g._dbInfo.storeName).count();R.onsuccess=function(){S(R.result)},R.onerror=function(){b(R.error)}}catch(P){b(P)}})}).catch(b)});return w(m,c),m}function ve(c,g){var m=this,S=new h(function(b,C){c<0?b(null):m.ready().then(function(){et(m._dbInfo,y,function(E,R){if(E)return C(E);try{var P=R.objectStore(m._dbInfo.storeName),A=!1,B=P.openKeyCursor();B.onsuccess=function(){var U=B.result;U?c===0||A?b(U.key):(A=!0,U.advance(c)):b(null)},B.onerror=function(){C(B.error)}}catch(U){C(U)}})}).catch(C)});return w(S,g),S}function ye(c){var g=this,m=new h(function(S,b){g.ready().then(function(){et(g._dbInfo,y,function(C,E){if(C)return b(C);try{var R=E.objectStore(g._dbInfo.storeName).openKeyCursor(),P=[];R.onsuccess=function(){var A=R.result;A?(P.push(A.key),A.continue()):S(P)},R.onerror=function(){b(R.error)}}catch(A){b(A)}})}).catch(b)});return w(m,c),m}function te(c,g){g=$.apply(this,arguments);var m=this.config();(c=typeof c!="function"&&c||{}).name||(c.name=c.name||m.name,c.storeName=c.storeName||m.storeName);var S,b=this;if(c.name){var C=c.name===m.name&&b._dbInfo.db?h.resolve(b._dbInfo.db):T(c).then(function(E){var R=u[c.name],P=R.forages;R.db=E;for(var A=0;A<P.length;A++)P[A]._dbInfo.db=E;return E});S=c.storeName?C.then(function(E){if(E.objectStoreNames.contains(c.storeName)){var R=E.version+1;D(c);var P=u[c.name],A=P.forages;E.close();for(var B=0;B<A.length;B++){var U=A[B];U._dbInfo.db=null,U._dbInfo.version=R}var H=new h(function(V,G){var at=s.open(c.name,R);at.onerror=function(xt){at.result.close(),G(xt)},at.onupgradeneeded=function(){at.result.deleteObjectStore(c.storeName)},at.onsuccess=function(){var xt=at.result;xt.close(),V(xt)}});return H.then(function(V){P.db=V;for(var G=0;G<A.length;G++){var at=A[G];at._dbInfo.db=V,M(at._dbInfo)}}).catch(function(V){throw(N(c,V)||h.resolve()).catch(function(){}),V})}}):C.then(function(E){D(c);var R=u[c.name],P=R.forages;E.close();for(var A=0;A<P.length;A++)P[A]._dbInfo.db=null;var B=new h(function(U,H){var V=s.deleteDatabase(c.name);V.onerror=function(){var G=V.result;G&&G.close(),H(V.error)},V.onblocked=function(){console.warn('dropInstance blocked for database "'+c.name+'" until all open connections are closed')},V.onsuccess=function(){var G=V.result;G&&G.close(),U(G)}});return B.then(function(U){R.db=U;for(var H=0;H<P.length;H++)M(P[H]._dbInfo)}).catch(function(U){throw(N(c,U)||h.resolve()).catch(function(){}),U})})}else S=h.reject("Invalid arguments");return w(S,g),S}var we={_driver:"asyncStorage",_initStorage:ln,_support:a(),iterate:hn,getItem:un,setItem:me,removeItem:Zt,clear:Qt,length:yt,key:ve,keys:ye,dropInstance:te};function ee(){return typeof openDatabase=="function"}var wt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Gi="~~local_forage_type~",Bo=/^~~local_forage_type~([^~]+)~/,be="__lfsc__:",dn=be.length,fn="arbf",pn="blob",jo="si08",Oo="ui08",Wo="uic8",Uo="si16",Fo="si32",Ho="ur16",qo="ui32",Xo="fl32",Vo="fl64",Go=dn+fn.length,Ko=Object.prototype.toString;function Jo(c){var g,m,S,b,C,E=.75*c.length,R=c.length,P=0;c[c.length-1]==="="&&(E--,c[c.length-2]==="="&&E--);var A=new ArrayBuffer(E),B=new Uint8Array(A);for(g=0;g<R;g+=4)m=wt.indexOf(c[g]),S=wt.indexOf(c[g+1]),b=wt.indexOf(c[g+2]),C=wt.indexOf(c[g+3]),B[P++]=m<<2|S>>4,B[P++]=(15&S)<<4|b>>2,B[P++]=(3&b)<<6|63&C;return A}function gn(c){var g,m=new Uint8Array(c),S="";for(g=0;g<m.length;g+=3)S+=wt[m[g]>>2],S+=wt[(3&m[g])<<4|m[g+1]>>4],S+=wt[(15&m[g+1])<<2|m[g+2]>>6],S+=wt[63&m[g+2]];return m.length%3==2?S=S.substring(0,S.length-1)+"=":m.length%3==1&&(S=S.substring(0,S.length-2)+"=="),S}function Ki(c,g){var m="";if(c&&(m=Ko.call(c)),c&&(m==="[object ArrayBuffer]"||c.buffer&&Ko.call(c.buffer)==="[object ArrayBuffer]")){var S,b=be;c instanceof ArrayBuffer?(S=c,b+=fn):(S=c.buffer,m==="[object Int8Array]"?b+=jo:m==="[object Uint8Array]"?b+=Oo:m==="[object Uint8ClampedArray]"?b+=Wo:m==="[object Int16Array]"?b+=Uo:m==="[object Uint16Array]"?b+=Ho:m==="[object Int32Array]"?b+=Fo:m==="[object Uint32Array]"?b+=qo:m==="[object Float32Array]"?b+=Xo:m==="[object Float64Array]"?b+=Vo:g(new Error("Failed to get type for BinaryArray"))),g(b+gn(S))}else if(m==="[object Blob]"){var C=new FileReader;C.onload=function(){var E=Gi+c.type+"~"+gn(this.result);g(be+pn+E)},C.readAsArrayBuffer(c)}else try{g(JSON.stringify(c))}catch(E){console.error("Couldn't convert value into a JSON string: ",c),g(null,E)}}function Ji(c){if(c.substring(0,dn)!==be)return JSON.parse(c);var g,m=c.substring(Go),S=c.substring(dn,Go);if(S===pn&&Bo.test(m)){var b=m.match(Bo);g=b[1],m=m.substring(b[0].length)}var C=Jo(m);switch(S){case fn:return C;case pn:return l([C],{type:g});case jo:return new Int8Array(C);case Oo:return new Uint8Array(C);case Wo:return new Uint8ClampedArray(C);case Uo:return new Int16Array(C);case Ho:return new Uint16Array(C);case Fo:return new Int32Array(C);case qo:return new Uint32Array(C);case Xo:return new Float32Array(C);case Vo:return new Float64Array(C);default:throw new Error("Unkown type: "+S)}}var mn={serialize:Ki,deserialize:Ji,stringToBuffer:Jo,bufferToString:gn};function Yo(c,g,m,S){c.executeSql("CREATE TABLE IF NOT EXISTS "+g.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],m,S)}function Yi(c){var g=this,m={db:null};if(c)for(var S in c)m[S]=typeof c[S]!="string"?c[S].toString():c[S];var b=new h(function(C,E){try{m.db=openDatabase(m.name,String(m.version),m.description,m.size)}catch(R){return E(R)}m.db.transaction(function(R){Yo(R,m,function(){g._dbInfo=m,C()},function(P,A){E(A)})},E)});return m.serializer=mn,b}function Tt(c,g,m,S,b,C){c.executeSql(m,S,b,function(E,R){R.code===R.SYNTAX_ERR?E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[g.storeName],function(P,A){A.rows.length?C(P,R):Yo(P,g,function(){P.executeSql(m,S,b,C)},C)},C):C(E,R)},C)}function Zi(c,g){var m=this;c=k(c);var S=new h(function(b,C){m.ready().then(function(){var E=m._dbInfo;E.db.transaction(function(R){Tt(R,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[c],function(P,A){var B=A.rows.length?A.rows.item(0).value:null;B&&(B=E.serializer.deserialize(B)),b(B)},function(P,A){C(A)})})}).catch(C)});return w(S,g),S}function Qi(c,g){var m=this,S=new h(function(b,C){m.ready().then(function(){var E=m._dbInfo;E.db.transaction(function(R){Tt(R,E,"SELECT * FROM "+E.storeName,[],function(P,A){for(var B=A.rows,U=B.length,H=0;H<U;H++){var V=B.item(H),G=V.value;if(G&&(G=E.serializer.deserialize(G)),(G=c(G,V.key,H+1))!==void 0)return void b(G)}b()},function(P,A){C(A)})})}).catch(C)});return w(S,g),S}function Zo(c,g,m,S){var b=this;c=k(c);var C=new h(function(E,R){b.ready().then(function(){g===void 0&&(g=null);var P=g,A=b._dbInfo;A.serializer.serialize(g,function(B,U){U?R(U):A.db.transaction(function(H){Tt(H,A,"INSERT OR REPLACE INTO "+A.storeName+" (key, value) VALUES (?, ?)",[c,B],function(){E(P)},function(V,G){R(G)})},function(H){if(H.code===H.QUOTA_ERR){if(S>0)return void E(Zo.apply(b,[c,P,m,S-1]));R(H)}})})}).catch(R)});return w(C,m),C}function ts(c,g,m){return Zo.apply(this,[c,g,m,1])}function es(c,g){var m=this;c=k(c);var S=new h(function(b,C){m.ready().then(function(){var E=m._dbInfo;E.db.transaction(function(R){Tt(R,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[c],function(){b()},function(P,A){C(A)})})}).catch(C)});return w(S,g),S}function ns(c){var g=this,m=new h(function(S,b){g.ready().then(function(){var C=g._dbInfo;C.db.transaction(function(E){Tt(E,C,"DELETE FROM "+C.storeName,[],function(){S()},function(R,P){b(P)})})}).catch(b)});return w(m,c),m}function os(c){var g=this,m=new h(function(S,b){g.ready().then(function(){var C=g._dbInfo;C.db.transaction(function(E){Tt(E,C,"SELECT COUNT(key) as c FROM "+C.storeName,[],function(R,P){var A=P.rows.item(0).c;S(A)},function(R,P){b(P)})})}).catch(b)});return w(m,c),m}function rs(c,g){var m=this,S=new h(function(b,C){m.ready().then(function(){var E=m._dbInfo;E.db.transaction(function(R){Tt(R,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[c+1],function(P,A){var B=A.rows.length?A.rows.item(0).key:null;b(B)},function(P,A){C(A)})})}).catch(C)});return w(S,g),S}function is(c){var g=this,m=new h(function(S,b){g.ready().then(function(){var C=g._dbInfo;C.db.transaction(function(E){Tt(E,C,"SELECT key FROM "+C.storeName,[],function(R,P){for(var A=[],B=0;B<P.rows.length;B++)A.push(P.rows.item(B).key);S(A)},function(R,P){b(P)})})}).catch(b)});return w(m,c),m}function ss(c){return new h(function(g,m){c.transaction(function(S){S.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(b,C){for(var E=[],R=0;R<C.rows.length;R++)E.push(C.rows.item(R).name);g({db:c,storeNames:E})},function(b,C){m(C)})},function(S){m(S)})})}function as(c,g){g=$.apply(this,arguments);var m=this.config();(c=typeof c!="function"&&c||{}).name||(c.name=c.name||m.name,c.storeName=c.storeName||m.storeName);var S,b=this;return S=c.name?new h(function(C){var E;E=c.name===m.name?b._dbInfo.db:openDatabase(c.name,"","",0),c.storeName?C({db:E,storeNames:[c.storeName]}):C(ss(E))}).then(function(C){return new h(function(E,R){C.db.transaction(function(P){function A(V){return new h(function(G,at){P.executeSql("DROP TABLE IF EXISTS "+V,[],function(){G()},function(xt,wn){at(wn)})})}for(var B=[],U=0,H=C.storeNames.length;U<H;U++)B.push(A(C.storeNames[U]));h.all(B).then(function(){E()}).catch(function(V){R(V)})},function(P){R(P)})})}):h.reject("Invalid arguments"),w(S,g),S}var cs={_driver:"webSQLStorage",_initStorage:Yi,_support:ee(),iterate:Qi,getItem:Zi,setItem:ts,removeItem:es,clear:ns,length:os,key:rs,keys:is,dropInstance:as};function ls(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Qo(c,g){var m=c.name+"/";return c.storeName!==g.storeName&&(m+=c.storeName+"/"),m}function us(){var c="_localforage_support_test";try{return localStorage.setItem(c,!0),localStorage.removeItem(c),!1}catch{return!0}}function hs(){return!us()||localStorage.length>0}function ds(c){var g=this,m={};if(c)for(var S in c)m[S]=c[S];return m.keyPrefix=Qo(c,g._defaultConfig),hs()?(g._dbInfo=m,m.serializer=mn,h.resolve()):h.reject()}function fs(c){var g=this,m=g.ready().then(function(){for(var S=g._dbInfo.keyPrefix,b=localStorage.length-1;b>=0;b--){var C=localStorage.key(b);C.indexOf(S)===0&&localStorage.removeItem(C)}});return w(m,c),m}function ps(c,g){var m=this;c=k(c);var S=m.ready().then(function(){var b=m._dbInfo,C=localStorage.getItem(b.keyPrefix+c);return C&&(C=b.serializer.deserialize(C)),C});return w(S,g),S}function gs(c,g){var m=this,S=m.ready().then(function(){for(var b=m._dbInfo,C=b.keyPrefix,E=C.length,R=localStorage.length,P=1,A=0;A<R;A++){var B=localStorage.key(A);if(B.indexOf(C)===0){var U=localStorage.getItem(B);if(U&&(U=b.serializer.deserialize(U)),(U=c(U,B.substring(E),P++))!==void 0)return U}}});return w(S,g),S}function ms(c,g){var m=this,S=m.ready().then(function(){var b,C=m._dbInfo;try{b=localStorage.key(c)}catch{b=null}return b&&(b=b.substring(C.keyPrefix.length)),b});return w(S,g),S}function vs(c){var g=this,m=g.ready().then(function(){for(var S=g._dbInfo,b=localStorage.length,C=[],E=0;E<b;E++){var R=localStorage.key(E);R.indexOf(S.keyPrefix)===0&&C.push(R.substring(S.keyPrefix.length))}return C});return w(m,c),m}function ys(c){var g=this.keys().then(function(m){return m.length});return w(g,c),g}function ws(c,g){var m=this;c=k(c);var S=m.ready().then(function(){var b=m._dbInfo;localStorage.removeItem(b.keyPrefix+c)});return w(S,g),S}function bs(c,g,m){var S=this;c=k(c);var b=S.ready().then(function(){g===void 0&&(g=null);var C=g;return new h(function(E,R){var P=S._dbInfo;P.serializer.serialize(g,function(A,B){if(B)R(B);else try{localStorage.setItem(P.keyPrefix+c,A),E(C)}catch(U){U.name!=="QuotaExceededError"&&U.name!=="NS_ERROR_DOM_QUOTA_REACHED"||R(U),R(U)}})})});return w(b,m),b}function _s(c,g){if(g=$.apply(this,arguments),!(c=typeof c!="function"&&c||{}).name){var m=this.config();c.name=c.name||m.name,c.storeName=c.storeName||m.storeName}var S,b=this;return S=c.name?new h(function(C){c.storeName?C(Qo(c,b._defaultConfig)):C(c.name+"/")}).then(function(C){for(var E=localStorage.length-1;E>=0;E--){var R=localStorage.key(E);R.indexOf(C)===0&&localStorage.removeItem(R)}}):h.reject("Invalid arguments"),w(S,g),S}var Ss={_driver:"localStorageWrapper",_initStorage:ds,_support:ls(),iterate:gs,getItem:ps,setItem:bs,removeItem:ws,clear:fs,length:ys,key:ms,keys:vs,dropInstance:_s},Cs=function(c,g){return c===g||typeof c=="number"&&typeof g=="number"&&isNaN(c)&&isNaN(g)},Es=function(c,g){for(var m=c.length,S=0;S<m;){if(Cs(c[S],g))return!0;S++}return!1},tr=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"},ne={},er={},qt={INDEXEDDB:we,WEBSQL:cs,LOCALSTORAGE:Ss},xs=[qt.INDEXEDDB._driver,qt.WEBSQL._driver,qt.LOCALSTORAGE._driver],_e=["dropInstance"],vn=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(_e),ks={description:"",driver:xs.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Is(c,g){c[g]=function(){var m=arguments;return c.ready().then(function(){return c[g].apply(c,m)})}}function yn(){for(var c=1;c<arguments.length;c++){var g=arguments[c];if(g)for(var m in g)g.hasOwnProperty(m)&&(tr(g[m])?arguments[0][m]=g[m].slice():arguments[0][m]=g[m])}return arguments[0]}var Ts=function(){function c(g){for(var m in r(this,c),qt)if(qt.hasOwnProperty(m)){var S=qt[m],b=S._driver;this[m]=b,ne[b]||this.defineDriver(S)}this._defaultConfig=yn({},ks),this._config=yn({},this._defaultConfig,g),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return c.prototype.config=function(g){if((g===void 0?"undefined":o(g))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var m in g){if(m==="storeName"&&(g[m]=g[m].replace(/\W/g,"_")),m==="version"&&typeof g[m]!="number")return new Error("Database version must be a number.");this._config[m]=g[m]}return!("driver"in g)||!g.driver||this.setDriver(this._config.driver)}return typeof g=="string"?this._config[g]:this._config},c.prototype.defineDriver=function(g,m,S){var b=new h(function(C,E){try{var R=g._driver,P=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!g._driver)return void E(P);for(var A=vn.concat("_initStorage"),B=0,U=A.length;B<U;B++){var H=A[B];if((!Es(_e,H)||g[H])&&typeof g[H]!="function")return void E(P)}var V=function(){for(var at=function(Ms){return function(){var Ps=new Error("Method "+Ms+" is not implemented by the current driver"),nr=h.reject(Ps);return w(nr,arguments[arguments.length-1]),nr}},xt=0,wn=_e.length;xt<wn;xt++){var bn=_e[xt];g[bn]||(g[bn]=at(bn))}};V();var G=function(at){ne[R]&&console.info("Redefining LocalForage driver: "+R),ne[R]=g,er[R]=at,C()};"_support"in g?g._support&&typeof g._support=="function"?g._support().then(G,E):G(!!g._support):G(!0)}catch(at){E(at)}});return _(b,m,S),b},c.prototype.driver=function(){return this._driver||null},c.prototype.getDriver=function(g,m,S){var b=ne[g]?h.resolve(ne[g]):h.reject(new Error("Driver not found."));return _(b,m,S),b},c.prototype.getSerializer=function(g){var m=h.resolve(mn);return _(m,g),m},c.prototype.ready=function(g){var m=this,S=m._driverSet.then(function(){return m._ready===null&&(m._ready=m._initDriver()),m._ready});return _(S,g,g),S},c.prototype.setDriver=function(g,m,S){var b=this;tr(g)||(g=[g]);var C=this._getSupportedDrivers(g);function E(){b._config.driver=b.driver()}function R(B){return b._extend(B),E(),b._ready=b._initStorage(b._config),b._ready}function P(B){return function(){var U=0;function H(){for(;U<B.length;){var V=B[U];return U++,b._dbInfo=null,b._ready=null,b.getDriver(V).then(R).catch(H)}E();var G=new Error("No available storage method found.");return b._driverSet=h.reject(G),b._driverSet}return H()}}var A=this._driverSet!==null?this._driverSet.catch(function(){return h.resolve()}):h.resolve();return this._driverSet=A.then(function(){var B=C[0];return b._dbInfo=null,b._ready=null,b.getDriver(B).then(function(U){b._driver=U._driver,E(),b._wrapLibraryMethodsWithReady(),b._initDriver=P(C)})}).catch(function(){E();var B=new Error("No available storage method found.");return b._driverSet=h.reject(B),b._driverSet}),_(this._driverSet,m,S),this._driverSet},c.prototype.supports=function(g){return!!er[g]},c.prototype._extend=function(g){yn(this,g)},c.prototype._getSupportedDrivers=function(g){for(var m=[],S=0,b=g.length;S<b;S++){var C=g[S];this.supports(C)&&m.push(C)}return m},c.prototype._wrapLibraryMethodsWithReady=function(){for(var g=0,m=vn.length;g<m;g++)Is(this,vn[g])},c.prototype.createInstance=function(g){return new c(g)},c}(),Rs=new Ts;t.exports=Rs},{3:3}]},{},[4])(4)),Be=Pe(Ya),qr={exports:{}},Za=(Hr||(Hr=1,function(e){((t,n)=>{e.exports=n()})(0,()=>{const t=typeof window=="object"?window:this;t.HTMLElement||console.warn("streamsaver is meant to run on browsers main thread");let n=null,o=!1;const r=t.WebStreamsPolyfill||{},i=t.isSecureContext;let s=/constructor/i.test(t.HTMLElement)||!!t.safari||!!t.WebKitPoint;const a=i||"MozAppearance"in document.documentElement.style?"iframe":"navigate",l={createWriteStream:function(w,_,k){let $={size:null,pathname:null,writableStrategy:void 0,readableStrategy:void 0},I=0,p=null,u=null,v=null;if(Number.isFinite(_)?([k,_]=[_,k],console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),$.size=k,$.writableStrategy=_):_&&_.highWaterMark?(console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),$.size=k,$.writableStrategy=_):$=_||{},!s){n||(n=i?h(l.mitm):function(z){const L="width=200,height=100",D=document.createDocumentFragment(),M={frame:t.open(z,"popup",L),loaded:!1,isIframe:!1,isPopup:!0,remove(){M.frame.close()},addEventListener(...O){D.addEventListener(...O)},dispatchEvent(...O){D.dispatchEvent(...O)},removeEventListener(...O){D.removeEventListener(...O)},postMessage(...O){M.frame.postMessage(...O)}},N=O=>{O.source===M.frame&&(M.loaded=!0,t.removeEventListener("message",N),M.dispatchEvent(new Event("load")))};return t.addEventListener("message",N),M}(l.mitm)),u=new MessageChannel,w=encodeURIComponent(w.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A");const d={transferringReadable:o,pathname:$.pathname||Math.random().toString().slice(-6)+"/"+w,headers:{"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+w}};$.size&&(d.headers["Content-Length"]=$.size);const f=[d,"*",[u.port2]];if(o){const z=a==="iframe"?void 0:{transform(D,M){if(!(D instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");I+=D.length,M.enqueue(D),p&&(location.href=p,p=null)},flush(){p&&(location.href=p)}};v=new l.TransformStream(z,$.writableStrategy,$.readableStrategy);const L=v.readable;u.port1.postMessage({readableStream:L},[L])}u.port1.onmessage=z=>{z.data.download?a==="navigate"?(n.remove(),n=null,I?location.href=z.data.download:p=z.data.download):(n.isPopup&&(n.remove(),n=null,a==="iframe"&&h(l.mitm)),h(z.data.download)):z.data.abort&&(y=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null)},n.loaded?n.postMessage(...f):n.addEventListener("load",()=>{n.postMessage(...f)},{once:!0})}let y=[];return!s&&v&&v.writable||new l.WritableStream({write(d){if(!(d instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");s?y.push(d):(u.port1.postMessage(d),I+=d.length,p&&(location.href=p,p=null))},close(){if(s){const d=new Blob(y,{type:"application/octet-stream; charset=utf-8"}),f=document.createElement("a");f.href=URL.createObjectURL(d),f.download=w,f.click()}else u.port1.postMessage("end")},abort(){y=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null}},$.writableStrategy)},WritableStream:t.WritableStream||r.WritableStream,supported:!0,version:{full:"2.0.5",major:2,minor:0,dot:5},mitm:"https://jimmywarting.github.io/StreamSaver.js/mitm.html?version=2.0.0"};function h(w){if(!w)throw new Error("meh");const _=document.createElement("iframe");return _.hidden=!0,_.src=w,_.loaded=!1,_.name="iframe",_.isIframe=!0,_.postMessage=(...k)=>_.contentWindow.postMessage(...k),_.addEventListener("load",()=>{_.loaded=!0},{once:!0}),document.body.appendChild(_),_}try{new Response(new ReadableStream),i&&!("serviceWorker"in navigator)&&(s=!0)}catch{s=!0}return(w=>{try{w()}catch{}})(()=>{const{readable:w}=new TransformStream,_=new MessageChannel;_.port1.postMessage(w,[w]),_.port1.close(),_.port2.close(),o=!0,Object.defineProperty(l,"TransformStream",{configurable:!1,writable:!1,value:TransformStream})}),l})}(qr)),qr.exports),Qa=Pe(Za);class tc{fileID;downloadURL;ChunkUnitM=1048576;chunkByteSize;totalChunks=1;currentDB;keys;fileMetaData=null;finishNum=0;eventTarget;cancelSource;isStarting=!1;fileName;cacheSize=6;requestTimeout=6e4;constructor(t,n,o=3,r=6,i=6e4){this.fileID=t,this.downloadURL=n,this.chunkByteSize=o*this.ChunkUnitM,this.eventTarget=On(),this.initIndexDB(),r>=3&&(this.cacheSize=r),i>this.requestTimeout&&(this.requestTimeout=i)}on(t,n){this.eventTarget.on(t,n)}dispatch(t,n){this.eventTarget.emit(t,n)}dispatchError(t){this.eventTarget.emit("error",t)}dispatchInfo(t){this.eventTarget.emit("info",t)}async queryDownloadFileMeta(t,n="",o){this.dispatchInfo("\u5F00\u59CB\u83B7\u53D6\u6587\u4EF6\u4FE1\u606F");const r=await It(n,t,o);let i=null;return r&&r.status===200&&(i=r.data),i}async getIFileMeta(){if(this.fileMetaData===null){const t=await this.currentDB?.getItem("fileinfo");this.fileMetaData=t||null}return this.fileMetaData}initIndexDB(){this.currentDB=Be.createInstance({name:this.fileID,driver:Be.INDEXEDDB})}async init(t){if(this.finishNum=0,t){const n="fileinfo";this.fileMetaData={id:t.id,name:t.name,length:t.length,downloadID:t.downloadID,chunkSize:this.chunkByteSize},this.fileName=t.name,this.currentDB?.setItem(n,this.fileMetaData)}if(this.fileMetaData!=null){const n=this.fileMetaData.chunkSize;n!=null&&n>0&&(this.chunkByteSize=n)}this.fileMetaData&&(this.totalChunks=Math.ceil(this.fileMetaData.length/this.chunkByteSize)),this.dispatchInfo("\u5B8C\u6210\u521D\u59CB\u5316\u6587\u4EF6\u4FE1\u606F\uFF0C\u603B\u5206\u7247\uFF1A"+this.totalChunks),this.currentDB&&(this.keys=await this.currentDB.keys())}getTotalChunks(){return this.totalChunks}pause(){this.cancelSource&&this.isStarting&&(this.cancelSource.cancel(),this.isStarting=!1),this.dispatchInfo("\u5DF2\u6682\u505C\u4E0B\u8F7D\u4EFB\u52A1")}restart(){this.dispatchInfo("\u6B63\u5728\u91CD\u542F\u4E0B\u8F7D\u4EFB\u52A1"),this.download()}delete(){this.cancelSource&&this.cancelSource.cancel(),Be.dropInstance({name:this.fileID}),this.currentDB=void 0,this.keys&&(this.keys.length=0,this.keys=void 0),this.finishNum=0,this.downloadProgress(),this.outputProgress(0),this.dispatchInfo("\u5DF2\u5220\u9664\u4E0B\u8F7D\u4EFB\u52A1")}sleep(t){return new Promise(n=>setTimeout(n,t))}async download(t,n){let o=t;if(!o&&this.downloadURL&&(o=this.downloadURL),!o)throw Error("\u4E0B\u8F7DURL\u4E0D\u80FD\u4E3A\u7A7A!");this.currentDB||this.initIndexDB();const r=j.Axios.CancelToken;this.cancelSource=r.source(),this.isStarting=!0;const i={key:this.fileMetaData?.downloadID};let s=0;const a=this.cacheSize;let l=0;for(let h=0;h<this.totalChunks;h++){if(this.keys&&this.keys?.indexOf(h.toString())>=0){s++,s>this.finishNum&&(this.finishNum=s,this.downloadProgress());continue}const w=h*this.chunkByteSize;let _=w+this.chunkByteSize-1;this.fileMetaData&&_>this.fileMetaData.length&&(_=this.fileMetaData.length-1);const k={range:`bytes=${w}-${_}`};for(;l>=a;)await this.sleep(200);const $=h.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${h+1}/${this.totalChunks}`),l++,It(o,n,i,k,"arraybuffer",this.cancelSource?.token,this.requestTimeout).then(async I=>{const p=I.data;l--,await this.currentDB?.setItem($,p),s++,s>this.finishNum&&(this.finishNum=s,this.downloadProgress());const u=parseInt($)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${u}/${this.totalChunks}`),this.savefile()}).catch(I=>{l--;const p=parseInt($)+1;this.dispatchError(`\u4E0B\u8F7D\u7B2C${p}\uFF09\u4E2A\u5206\u7247\u5185\u5BB9\u5931\u8D25\uFF01`)})}this.finishNum===this.totalChunks&&this.savefile()}downloadProgress(){const t=100*this.finishNum/this.totalChunks;this.dispatch("downloadProgress",t)}outputProgress(t){const n=100*t/this.totalChunks;this.dispatch("saveProgress",n)}async savefile(){if(this.finishNum===this.totalChunks){if(!this.fileName)return void this.dispatchError("\u4E0B\u8F7D\u9519\u8BEF\uFF1A\u6587\u4EF6\u540D\u4E3A\u7A7A!");this.dispatchInfo("\u5F00\u59CB\u4FDD\u5B58\u4E0B\u8F7D\u6587\u4EF6:"+this.fileName);const t=Qa.createWriteStream(this.fileName).getWriter();let n=0;for(let o=0;o<this.totalChunks;o++){const r=o.toString();let i=await this.currentDB?.getItem(r);if(i||(i=await this.currentDB?.getItem(r)),!i)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${o+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);let s=new Response(i).body;if(s===null)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${o+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);const a=s.getReader();for(;;){const{done:l,value:h}=await a.read();if(l)break;await t.write(h)}n++,this.outputProgress(n),this.dispatchInfo(`\u5B8C\u6210\u7B2C${o+1}\u4E2A\u5206\u7247\u8F93\u51FA`)}t.close(),Be.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}}function ec(e,t){let n="",o="";for(const r in t)n+=r+"="+encodeURIComponent(t[r])+"&";return n=n.replace(/&$/,""),o=/\?$/.test(e)?e+n:e.replace(/\/?$/,"?")+n,o}function Xr(e={},t={}){let n;for(n in t)Lt(t[n])?e[n]=Xr(e[n],t[n]):e[n]=t[n];return e}function nc(e,t){const n=`${e}_${t}`;return ft.MD5(n)}function Vr(e){const t=function(a){if(!a)return;const l=a,h=[];if(l)for(let w of l){const _=Gr(w);_&&h.push(_)}return h}(e.bussinessRoutes),n=function(a){if(!a)return;const l=a;if(l&&l.length>0){const h=[];return l.forEach(w=>{const _=Kr(w);_&&h.push(_)}),h}}(e.widgetMenuConfig),o=function(a){if(a&&a.length>0){const l=[];return a.forEach(h=>{const w=function(_){return _?{id:_.id,label:_.label,container:_.container,preload:_.preload,afterid:_.afterid,bindid:_.bindid,group:_.group}:void 0}(h);w&&l.push(w)}),l}}(e.widgetConfig),r=function(a){if(a&&a.length>0)return a}(e.functionList),i=e.pkgObject.version,s=e.pkgObject.name;return{id:nc(s,i),name:j.Config.UI.SiteTitle,group:j.Config.UI.Group,product:s,version:i,routes:t,widgetMenu:n,widgets:o,functions:r}}function Gr(e){if(e){let t=0;e.meta?.hidden&&(t=1);let n={path:e.path,name:e.name,title:e.meta?.title,type:t,index:e.meta?.index};if(e.children){const o=[];for(let r of e.children){const i=Gr(r);i&&o.push(i)}o.length>0&&(n.children=o)}return n}}function Kr(e){if(!e)return;const t={name:e.name,index:e.index,path:e.path,type:e.type};return e.children&&e.children.length>0&&(t.children=[],e.children.forEach(n=>{const o=Kr(n);o&&t.children?.push(o)})),t}function oc(e,t="IconifyList.ts"){let n="",o=`const iconlist={
|
|
9
9
|
`,r=0;e.forEach(i=>{const s=i.split(":");if(s&&s.length===2){const a="icon"+r;n+=`import ${a} from '~icons/${s[0]}/${s[1]}'
|
|
10
10
|
`,o+=` '${i}':${a},
|
|
11
11
|
`,r++}}),r>0&&(o+=`};
|
|
12
|
-
`,ze(n+o+"export default iconlist;","IconifyList.ts"))}function Ja(e,t){const n=Dr(e);dr(n,t),B.Message?.msg("\u5BFC\u51FA\u7CFB\u7EDF\u529F\u80FD\u6743\u9650\u6587\u4EF6\u6210\u529F\uFF01")}function Za(e){let t=e.replace(/(^\s*)|(\s*$)/g,"");return t=t.replace(/[^\d]/g,""),t=t.replace(/^0/g,""),t=t.replace(/^[1-9]\d\d{1,3}$/,"100"),t}function Qa(e){let t=Zn(e);return t=t.replace(/^[1-9]\d\d{1,3}$/,"100"),t=t.replace(/^100\.$/,"100"),t}function Zn(e){let t=e.replace(/(^\s*)|(\s*$)/g,"");return t=t.replace(/[^\d.]/g,""),t=t.replace(/^0{2}$/g,"0"),t=t.replace(/^\./g,""),t=t.replace(".","$#$").replace(/\./g,"").replace("$#$","."),t=t.replace(/^(\-)*(\d+)\.(\d\d).*$/,"$1$2.$3"),t}function tc(e){let t=e.replace(/(^\s*)|(\s*$)/g,"");return t=t.replace(/[\.]*/g,""),t=t.replace(/(^0[\d]*)$/g,"0"),t=t.replace(/^0\d$/g,"0"),t=t.replace(/[^\d]/g,""),t}function ec(e){let t=e.replace(/[\u4e00-\u9fa5\s]+/g,"");return t=t.replace(/(^\s*)|(\s*$)/g,""),t}function nc(e){let t=e.replace(/[a-zA-Z]+/g,"");return t=t.replace(/(^\s*)|(\s*$)/g,""),t}function oc(e){return e.replace(/(^\s*)|(\s*$)/g,"")}function rc(e){let t=Zn(e);return t=t.toString().split("."),t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t=t.join("."),t}function ic(e,t="",n="red"){return t.replace(new RegExp(e,"gi"),`<span style='color: ${n}'>${e}</span>`)}function sc(e,t="\u4EDF\u4F70\u62FE\u4EBF\u4EDF\u4F70\u62FE\u4E07\u4EDF\u4F70\u62FE\u5143\u89D2\u5206",n=""){let o=(e+="00").indexOf(".");o>=0&&(e=e.substring(0,o)+e.substr(o+1,2)),t=t.substr(t.length-e.length);for(let r=0;r<e.length;r++)n+="\u96F6\u58F9\u8D30\u53C1\u8086\u4F0D\u9646\u67D2\u634C\u7396".substr(e.substr(r,1),1)+t.substr(r,1);return n=n.replace(/零角零分$/,"\u6574").replace(/零[仟佰拾]/g,"\u96F6").replace(/零{2,}/g,"\u96F6").replace(/零([亿|万])/g,"$1").replace(/零+元/,"\u5143").replace(/亿零{0,3}万/,"\u4EBF").replace(/^元/,"\u96F6\u5143")}function ac(e){return!!/^((12[0-9])|(13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0|1,5-9]))\d{8}$/.test(e)}function cc(e){return!!/\d{3}-\d{8}|\d{4}-\d{7}/.test(e)}function lc(e){return!!/^[a-zA-Z][a-zA-Z0-9_]{4,15}$/.test(e)}function uc(e){return!!/^[a-zA-Z]\w{5,15}$/.test(e)}function hc(e){return!!/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(e)}function dc(e){let t="";return/^(?:\d+|[a-zA-Z]+|[!@#$%^&\.*]+){6,16}$/.test(e)&&(t="\u5F31"),/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(e)&&(t="\u4E2D"),/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(e)&&(t="\u5F3A"),t}function fc(e){return!!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(e)}function pc(e){return!!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}function gc(e){return!!/^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(e)}function mc(e){return!!/^[\u4e00-\u9fa5]{1,6}(·[\u4e00-\u9fa5]{1,6}){0,2}$/.test(e)}function vc(e){return!!/^[1-9][0-9]{5}$/.test(e)}function yc(e){return!!/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(e)}function wc(e){return!!/^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/.test(e)}let Br=!0;try{String.fromCharCode.apply(String,[1,2])}catch{Br=!1,Object.defineProperty(Array.prototype,"subarray",{value:Array.prototype.slice})}var Qn=2654435769;function jr(e,t){var n=e.length,o=n<<2;if(t){var r=e[n-1];if(r<(o-=4)-3||r>o)return null;o=r}for(var i=new Uint8Array(o),s=0;s<o;++s)i[s]=e[s>>2]>>((3&s)<<3);return i}function De(e,t){var n,o=e.length,r=o>>2;3&o&&++r,t?(n=new Uint32Array(r+1))[r]=o:n=new Uint32Array(r);for(var i=0;i<o;++i)n[i>>2]|=e[i]<<((3&i)<<3);return n}function Bt(e){return 4294967295&e}function $e(e,t,n,o,r,i){return(n>>>5^t<<2)+(t>>>3^n<<4)^(e^t)+(i[3&o^r]^n)}function Or(e){if(e.length<16){var t=new Uint8Array(16);t.set(e),e=t}return e}function Ne(e){for(var t=e.length,n=new Uint8Array(3*t),o=0,r=0;r<t;r++){var i=e.charCodeAt(r);if(i<128)n[o++]=i;else if(i<2048)n[o++]=192|i>>6,n[o++]=128|63&i;else{if(!(i<55296||i>57343)){if(r+1<t){var s=e.charCodeAt(r+1);if(i<56320&&56320<=s&&s<=57343){var a=65536+((1023&i)<<10|1023&s);n[o++]=240|a>>18,n[o++]=128|a>>12&63,n[o++]=128|a>>6&63,n[o++]=128|63&a,r++;continue}}throw new Error("Malformed string")}n[o++]=224|i>>12,n[o++]=128|i>>6&63,n[o++]=128|63&i}}return n.subarray(0,o)}function Wr(e){var t=e.length;return t===0?"":t<32767?function(n,o){for(var r=new Array(o),i=0,s=0,a=n.length;i<o&&s<a;i++){var l=n[s++];switch(l>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:r[i]=l;break;case 12:case 13:if(!(s<a))throw new Error("Unfinished UTF-8 octet sequence");r[i]=(31&l)<<6|63&n[s++];break;case 14:if(!(s+1<a))throw new Error("Unfinished UTF-8 octet sequence");r[i]=(15&l)<<12|(63&n[s++])<<6|63&n[s++];break;case 15:if(!(s+2<a))throw new Error("Unfinished UTF-8 octet sequence");var 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)}(e,t):function(n,o){for(var r=[],i=new Array(32768),s=0,a=0,l=n.length;s<o&&a<l;s++){var 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 w=((7&d)<<18|(63&n[a++])<<12|(63&n[a++])<<6|63&n[a++])-65536;if(!(0<=w&&w<=1048575))throw new Error("Character outside valid Unicode range: 0x"+w.toString(16));i[s++]=w>>10&1023|55296,i[s]=1023&w|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+d.toString(16))}if(s>=32766){var _=s+1;i.length=_,r.push(String.fromCharCode.apply(String,i)),o-=_,s=-1}}return s>0&&(i.length=s,r.push(String.fromCharCode.apply(String,i))),r.join("")}(e,t)}function bc(e){var t=e.length;if(t===0)return"";var n=Br?e:function(a){for(var l=a.length,d=new Array(a.length),w=0;w<l;++w)d[w]=a[w];return d}(e);if(t<65535)return String.fromCharCode.apply(String,n);for(var o=32767&t,r=t>>15,i=new Array(o?r+1:r),s=0;s<r;++s)i[s]=String.fromCharCode.apply(String,n.subarray(s<<15,s+1<<15));return o&&(i[r]=String.fromCharCode.apply(String,n.subarray(r<<15,t))),i.join("")}function Ur(e,t){return typeof e=="string"&&(e=Ne(e)),typeof t=="string"&&(t=Ne(t)),e==null||e.length===0?e:jr(function(n,o){var r,i,s,a,l,d,w=n.length,_=w-1;for(i=n[_],s=0,d=0|Math.floor(6+52/w);d>0;--d){for(a=(s=Bt(s+Qn))>>>2&3,l=0;l<_;++l)r=n[l+1],i=n[l]=Bt(n[l]+$e(s,r,i,l,a,o));r=n[0],i=n[_]=Bt(n[_]+$e(s,r,i,_,a,o))}return n}(De(e,!0),De(Or(t),!1)),!1)}function Fr(e,t){return typeof e=="string"&&(e=function(n){for(var o=window.atob(n),r=o.length,i=new Uint8Array(r),s=0;s<r;s++)i[s]=o.charCodeAt(s);return i}(e)),typeof t=="string"&&(t=Ne(t)),e==null||e.length===0?e:jr(function(n,o){var r,i,s,a,l,d=n.length,w=d-1;for(r=n[0],s=Bt(Math.floor(6+52/d)*Qn);s!==0;s=Bt(s-Qn)){for(a=s>>>2&3,l=w;l>0;--l)i=n[l-1],r=n[l]=Bt(n[l]-$e(s,r,i,l,a,o));i=n[w],r=n[0]=Bt(n[0]-$e(s,r,i,0,a,o))}return n}(De(e,!1),De(Or(t),!1)),!0)}const ie={toBytes:Ne,toString:Wr,encrypt:Ur,encryptToString:function(e,t){return window.btoa(bc(Ur(e,t)))},decrypt:Fr,decryptToString:function(e,t){return Wr(Fr(e,t))}},Hr=e=>{const t="1.23452384164.123412416";document.getElementById(t)!==null&&document.body.removeChild(document.getElementById(t));const n=document.createElement("canvas");n.width=200,n.height=130;const o=n.getContext("2d");o.rotate(-20*Math.PI/180),o.font="12px Vedana",o.fillStyle="rgba(200, 200, 200, 0.30)",o.textBaseline="middle",o.fillText(e,n.width/10,n.height/2);const r=document.createElement("div");return r.id=t,r.style.pointerEvents="none",r.style.top="0px",r.style.left="0px",r.style.position="fixed",r.style.zIndex="10000000",r.style.width=`${document.documentElement.clientWidth}px`,r.style.height=`${document.documentElement.clientHeight}px`,r.style.background=`url(${n.toDataURL("image/png")}) left top repeat`,document.body.appendChild(r),t},_c={set:e=>{let t=Hr(e);document.getElementById(t)===null&&(t=Hr(e))},del:()=>{let e="1.23452384164.123412416";document.getElementById(e)!==null&&document.body.removeChild(document.getElementById(e))}};class jt extends Error{constructor(t,n){const o=new.target.prototype;super(`${t}: Status code '${n}'`),this.statusCode=n,this.__proto__=o}}class to extends Error{constructor(t="A timeout occurred."){const n=new.target.prototype;super(t),this.__proto__=n}}class wt extends Error{constructor(t="An abort occurred."){const n=new.target.prototype;super(t),this.__proto__=n}}class Sc extends Error{constructor(t,n){const o=new.target.prototype;super(t),this.transport=n,this.errorType="UnsupportedTransportError",this.__proto__=o}}class Cc extends Error{constructor(t,n){const o=new.target.prototype;super(t),this.transport=n,this.errorType="DisabledTransportError",this.__proto__=o}}class Ec extends Error{constructor(t,n){const o=new.target.prototype;super(t),this.transport=n,this.errorType="FailedToStartTransportError",this.__proto__=o}}class qr extends Error{constructor(t){const n=new.target.prototype;super(t),this.errorType="FailedToNegotiateWithServerError",this.__proto__=n}}class xc extends Error{constructor(t,n){const o=new.target.prototype;super(t),this.innerErrors=n,this.__proto__=o}}class Xr{constructor(t,n,o){this.statusCode=t,this.statusText=n,this.content=o}}class Be{get(t,n){return this.send({...n,method:"GET",url:t})}post(t,n){return this.send({...n,method:"POST",url:t})}delete(t,n){return this.send({...n,method:"DELETE",url:t})}getCookieString(t){return""}}var k;(function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Information=2]="Information",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Critical=5]="Critical",e[e.None=6]="None"})(k||(k={}));class se{constructor(){}log(t,n){}}se.instance=new se;class nt{static isRequired(t,n){if(t==null)throw new Error(`The '${n}' argument is required.`)}static isNotEmpty(t,n){if(!t||t.match(/^\s*$/))throw new Error(`The '${n}' argument should not be empty.`)}static isIn(t,n,o){if(!(t in n))throw new Error(`Unknown ${o} value: ${t}.`)}}class tt{static get isBrowser(){return!tt.isNode&&typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return!tt.isNode&&typeof self=="object"&&"importScripts"in self}static get isReactNative(){return!tt.isNode&&typeof window=="object"&&window.document===void 0}static get isNode(){return typeof process<"u"&&process.release&&process.release.name==="node"}}function ae(e,t){let n="";return Ot(e)?(n=`Binary data of length ${e.byteLength}`,t&&(n+=`. Content: '${function(o){const r=new Uint8Array(o);let i="";return r.forEach(s=>{i+=`0x${s<16?"0":""}${s.toString(16)} `}),i.substr(0,i.length-1)}(e)}'`)):typeof e=="string"&&(n=`String data of length ${e.length}`,t&&(n+=`. Content: '${e}'`)),n}function Ot(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&e.constructor.name==="ArrayBuffer")}async function Vr(e,t,n,o,r,i){const s={},[a,l]=Kt();s[a]=l,e.log(k.Trace,`(${t} transport) sending data. ${ae(r,i.logMessageContent)}.`);const d=Ot(r)?"arraybuffer":"text",w=await n.post(o,{content:r,headers:{...s,...i.headers},responseType:d,timeout:i.timeout,withCredentials:i.withCredentials});e.log(k.Trace,`(${t} transport) request complete. Response status: ${w.statusCode}.`)}class kc{constructor(t,n){this._subject=t,this._observer=n}dispose(){const t=this._subject.observers.indexOf(this._observer);t>-1&&this._subject.observers.splice(t,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(n=>{})}}class je{constructor(t){this._minLevel=t,this.out=console}log(t,n){if(t>=this._minLevel){const o=`[${new Date().toISOString()}] ${k[t]}: ${n}`;switch(t){case k.Critical:case k.Error:this.out.error(o);break;case k.Warning:this.out.warn(o);break;case k.Information:this.out.info(o);break;default:this.out.log(o)}}}}function Kt(){let e="X-SignalR-User-Agent";return tt.isNode&&(e="User-Agent"),[e,Ic("8.0.7",Tc(),Mc(),Rc())]}function Ic(e,t,n,o){let r="Microsoft SignalR/";const i=e.split(".");return r+=`${i[0]}.${i[1]}`,r+=` (${e}; `,r+=t&&t!==""?`${t}; `:"Unknown OS; ",r+=`${n}`,r+=o?`; ${o}`:"; Unknown Runtime Version",r+=")",r}function Tc(){if(!tt.isNode)return"";switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}}function Rc(){if(tt.isNode)return process.versions.node}function Mc(){return tt.isNode?"NodeJS":"Browser"}function eo(e){return e.stack?e.stack:e.message?e.message:`${e}`}class Pc extends Be{constructor(t){if(super(),this._logger=t,typeof fetch>"u"||tt.isNode){const n=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._jar=new(n("tough-cookie")).CookieJar,typeof fetch>"u"?this._fetchType=n("node-fetch"):this._fetchType=fetch,this._fetchType=n("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("could not find global")}());if(typeof AbortController>"u"){const n=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._abortControllerType=n("abort-controller")}else this._abortControllerType=AbortController}async send(t){if(t.abortSignal&&t.abortSignal.aborted)throw new wt;if(!t.method)throw new Error("No method defined.");if(!t.url)throw new Error("No url defined.");const n=new this._abortControllerType;let o;t.abortSignal&&(t.abortSignal.onabort=()=>{n.abort(),o=new wt});let r,i=null;if(t.timeout){const l=t.timeout;i=setTimeout(()=>{n.abort(),this._logger.log(k.Warning,"Timeout from HTTP request."),o=new to},l)}t.content===""&&(t.content=void 0),t.content&&(t.headers=t.headers||{},Ot(t.content)?t.headers["Content-Type"]="application/octet-stream":t.headers["Content-Type"]="text/plain;charset=UTF-8");try{r=await this._fetchType(t.url,{body:t.content,cache:"no-cache",credentials:t.withCredentials===!0?"include":"same-origin",headers:{"X-Requested-With":"XMLHttpRequest",...t.headers},method:t.method,mode:"cors",redirect:"follow",signal:n.signal})}catch(l){throw o||(this._logger.log(k.Warning,`Error from HTTP request. ${l}.`),l)}finally{i&&clearTimeout(i),t.abortSignal&&(t.abortSignal.onabort=null)}if(!r.ok){const l=await Gr(r,"text");throw new jt(l||r.statusText,r.status)}const s=Gr(r,t.responseType),a=await s;return new Xr(r.status,r.statusText,a)}getCookieString(t){let n="";return tt.isNode&&this._jar&&this._jar.getCookies(t,(o,r)=>n=r.join("; ")),n}}function Gr(e,t){let n;switch(t){case"arraybuffer":n=e.arrayBuffer();break;case"text":default:n=e.text();break;case"blob":case"document":case"json":throw new Error(`${t} is not supported.`)}return n}class zc extends Be{constructor(t){super(),this._logger=t}send(t){return t.abortSignal&&t.abortSignal.aborted?Promise.reject(new wt):t.method?t.url?new Promise((n,o)=>{const r=new XMLHttpRequest;r.open(t.method,t.url,!0),r.withCredentials=t.withCredentials===void 0||t.withCredentials,r.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.content===""&&(t.content=void 0),t.content&&(Ot(t.content)?r.setRequestHeader("Content-Type","application/octet-stream"):r.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const i=t.headers;i&&Object.keys(i).forEach(s=>{r.setRequestHeader(s,i[s])}),t.responseType&&(r.responseType=t.responseType),t.abortSignal&&(t.abortSignal.onabort=()=>{r.abort(),o(new wt)}),t.timeout&&(r.timeout=t.timeout),r.onload=()=>{t.abortSignal&&(t.abortSignal.onabort=null),r.status>=200&&r.status<300?n(new Xr(r.status,r.statusText,r.response||r.responseText)):o(new jt(r.response||r.responseText||r.statusText,r.status))},r.onerror=()=>{this._logger.log(k.Warning,`Error from HTTP request. ${r.status}: ${r.statusText}.`),o(new jt(r.statusText,r.status))},r.ontimeout=()=>{this._logger.log(k.Warning,"Timeout from HTTP request."),o(new to)},r.send(t.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class Lc extends Be{constructor(t){if(super(),typeof fetch<"u"||tt.isNode)this._httpClient=new Pc(t);else{if(typeof XMLHttpRequest>"u")throw new Error("No usable HttpClient found.");this._httpClient=new zc(t)}}send(t){return t.abortSignal&&t.abortSignal.aborted?Promise.reject(new wt):t.method?t.url?this._httpClient.send(t):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(t){return this._httpClient.getCookieString(t)}}class gt{static write(t){return`${t}${gt.RecordSeparator}`}static parse(t){if(t[t.length-1]!==gt.RecordSeparator)throw new Error("Message is incomplete.");const n=t.split(gt.RecordSeparator);return n.pop(),n}}gt.RecordSeparatorCode=30,gt.RecordSeparator=String.fromCharCode(gt.RecordSeparatorCode);class Ac{writeHandshakeRequest(t){return gt.write(JSON.stringify(t))}parseHandshakeResponse(t){let n,o;if(Ot(t)){const s=new Uint8Array(t),a=s.indexOf(gt.RecordSeparatorCode);if(a===-1)throw new Error("Message is incomplete.");const l=a+1;n=String.fromCharCode.apply(null,Array.prototype.slice.call(s.slice(0,l))),o=s.byteLength>l?s.slice(l).buffer:null}else{const s=t,a=s.indexOf(gt.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=gt.parse(n),i=JSON.parse(r[0]);if(i.type)throw new Error("Expected a handshake response from the server.");return[o,i]}}var F;(function(e){e[e.Invocation=1]="Invocation",e[e.StreamItem=2]="StreamItem",e[e.Completion=3]="Completion",e[e.StreamInvocation=4]="StreamInvocation",e[e.CancelInvocation=5]="CancelInvocation",e[e.Ping=6]="Ping",e[e.Close=7]="Close",e[e.Ack=8]="Ack",e[e.Sequence=9]="Sequence"})(F||(F={}));class Dc{constructor(){this.observers=[]}next(t){for(const n of this.observers)n.next(t)}error(t){for(const n of this.observers)n.error&&n.error(t)}complete(){for(const t of this.observers)t.complete&&t.complete()}subscribe(t){return this.observers.push(t),new kc(this,t)}}class $c{constructor(t,n,o){this._bufferSize=1e5,this._messages=[],this._totalMessageCount=0,this._waitForSequenceMessage=!1,this._nextReceivingSequenceId=1,this._latestReceivedSequenceId=0,this._bufferedByteCount=0,this._reconnectInProgress=!1,this._protocol=t,this._connection=n,this._bufferSize=o}async _send(t){const n=this._protocol.writeMessage(t);let o=Promise.resolve();if(this._isInvocationMessage(t)){this._totalMessageCount++;let r=()=>{},i=()=>{};Ot(n)?this._bufferedByteCount+=n.byteLength:this._bufferedByteCount+=n.length,this._bufferedByteCount>=this._bufferSize&&(o=new Promise((s,a)=>{r=s,i=a})),this._messages.push(new Nc(n,this._totalMessageCount,r,i))}try{this._reconnectInProgress||await this._connection.send(n)}catch{this._disconnected()}await o}_ack(t){let n=-1;for(let o=0;o<this._messages.length;o++){const r=this._messages[o];if(r._id<=t.sequenceId)n=o,Ot(r._message)?this._bufferedByteCount-=r._message.byteLength:this._bufferedByteCount-=r._message.length,r._resolver();else{if(!(this._bufferedByteCount<this._bufferSize))break;r._resolver()}}n!==-1&&(this._messages=this._messages.slice(n+1))}_shouldProcessMessage(t){if(this._waitForSequenceMessage)return t.type===F.Sequence&&(this._waitForSequenceMessage=!1,!0);if(!this._isInvocationMessage(t))return!0;const n=this._nextReceivingSequenceId;return this._nextReceivingSequenceId++,n<=this._latestReceivedSequenceId?(n===this._latestReceivedSequenceId&&this._ackTimer(),!1):(this._latestReceivedSequenceId=n,this._ackTimer(),!0)}_resetSequence(t){t.sequenceId>this._nextReceivingSequenceId?this._connection.stop(new Error("Sequence ID greater than amount of messages we've received.")):this._nextReceivingSequenceId=t.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}async _resend(){const t=this._messages.length!==0?this._messages[0]._id:this._totalMessageCount+1;await this._connection.send(this._protocol.writeMessage({type:F.Sequence,sequenceId:t}));const n=this._messages;for(const o of n)await this._connection.send(o._message);this._reconnectInProgress=!1}_dispose(t){t!=null||(t=new Error("Unable to reconnect to server."));for(const n of this._messages)n._rejector(t)}_isInvocationMessage(t){switch(t.type){case F.Invocation:case F.StreamItem:case F.Completion:case F.StreamInvocation:case F.CancelInvocation:return!0;case F.Close:case F.Sequence:case F.Ping:case F.Ack:return!1}}_ackTimer(){this._ackTimerHandle===void 0&&(this._ackTimerHandle=setTimeout(async()=>{try{this._reconnectInProgress||await this._connection.send(this._protocol.writeMessage({type:F.Ack,sequenceId:this._latestReceivedSequenceId}))}catch{}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0},1e3))}}class Nc{constructor(t,n,o,r){this._message=t,this._id=n,this._resolver=o,this._rejector=r}}var J;(function(e){e.Disconnected="Disconnected",e.Connecting="Connecting",e.Connected="Connected",e.Disconnecting="Disconnecting",e.Reconnecting="Reconnecting"})(J||(J={}));class Ao{static create(t,n,o,r,i,s,a){return new Ao(t,n,o,r,i,s,a)}constructor(t,n,o,r,i,s,a){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(k.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},nt.isRequired(t,"connection"),nt.isRequired(n,"logger"),nt.isRequired(o,"protocol"),this.serverTimeoutInMilliseconds=i??3e4,this.keepAliveIntervalInMilliseconds=s??15e3,this._statefulReconnectBufferSize=a??1e5,this._logger=n,this._protocol=o,this.connection=t,this._reconnectPolicy=r,this._handshakeProtocol=new Ac,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=J.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:F.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(t){if(this._connectionState!==J.Disconnected&&this._connectionState!==J.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!t)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=t}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}async _startWithStateTransitions(){if(this._connectionState!==J.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=J.Connecting,this._logger.log(k.Debug,"Starting HubConnection.");try{await this._startInternal(),tt.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=J.Connected,this._connectionStarted=!0,this._logger.log(k.Debug,"HubConnection connected successfully.")}catch(t){return this._connectionState=J.Disconnected,this._logger.log(k.Debug,`HubConnection failed to start successfully because of error '${t}'.`),Promise.reject(t)}}async _startInternal(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;const t=new Promise((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(k.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(o)),this._logger.log(k.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await t,this._stopDuringStartError)throw this._stopDuringStartError;this.connection.features.reconnect&&(this._messageBuffer=new $c(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(k.Debug,`Hub handshake failed with error '${n}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(n),n}}async stop(){const t=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),await this._stopPromise;try{await t}catch{}}_stopInternal(t){if(this._connectionState===J.Disconnected)return this._logger.log(k.Debug,`Call to HubConnection.stop(${t}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===J.Disconnecting)return this._logger.log(k.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;const n=this._connectionState;return this._connectionState=J.Disconnecting,this._logger.log(k.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(k.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(n===J.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=t||new wt("The connection was stopped before the hub handshake could complete."),this.connection.stop(t))}async _sendCloseMessage(){try{await this._sendWithProtocol(this._createCloseMessage())}catch{}}stream(t,...n){const[o,r]=this._replaceStreamingParams(n),i=this._createStreamInvocation(t,n,r);let s;const a=new Dc;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===F.Completion?l.error?a.error(new Error(l.error)):a.complete():a.next(l.item))},s=this._sendWithProtocol(i).catch(l=>{a.error(l),delete this._callbacks[i.invocationId]}),this._launchStreams(o,s),a}_sendMessage(t){return this._resetKeepAliveInterval(),this.connection.send(t)}_sendWithProtocol(t){return this._messageBuffer?this._messageBuffer._send(t):this._sendMessage(this._protocol.writeMessage(t))}send(t,...n){const[o,r]=this._replaceStreamingParams(n),i=this._sendWithProtocol(this._createInvocation(t,n,!0,r));return this._launchStreams(o,i),i}invoke(t,...n){const[o,r]=this._replaceStreamingParams(n),i=this._createInvocation(t,n,!1,r);return new Promise((a,l)=>{this._callbacks[i.invocationId]=(w,_)=>{_?l(_):w&&(w.type===F.Completion?w.error?l(new Error(w.error)):a(w.result):l(new Error(`Unexpected message type: ${w.type}`)))};const d=this._sendWithProtocol(i).catch(w=>{l(w),delete this._callbacks[i.invocationId]});this._launchStreams(o,d)})}on(t,n){t&&n&&(t=t.toLowerCase(),this._methods[t]||(this._methods[t]=[]),this._methods[t].indexOf(n)===-1&&this._methods[t].push(n))}off(t,n){if(!t)return;t=t.toLowerCase();const o=this._methods[t];if(o)if(n){const r=o.indexOf(n);r!==-1&&(o.splice(r,1),o.length===0&&delete this._methods[t])}else delete this._methods[t]}onclose(t){t&&this._closedCallbacks.push(t)}onreconnecting(t){t&&this._reconnectingCallbacks.push(t)}onreconnected(t){t&&this._reconnectedCallbacks.push(t)}_processIncomingData(t){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(t=this._processHandshakeResponse(t),this._receivedHandshakeResponse=!0),t){const n=this._protocol.parseMessages(t,this._logger);for(const o of n)if(!this._messageBuffer||this._messageBuffer._shouldProcessMessage(o))switch(o.type){case F.Invocation:this._invokeClientMethod(o).catch(r=>{this._logger.log(k.Error,`Invoke client method threw error: ${eo(r)}`)});break;case F.StreamItem:case F.Completion:{const r=this._callbacks[o.invocationId];if(r){o.type===F.Completion&&delete this._callbacks[o.invocationId];try{r(o)}catch(i){this._logger.log(k.Error,`Stream callback threw error: ${eo(i)}`)}}break}case F.Ping:break;case F.Close:{this._logger.log(k.Information,"Close message received from server.");const r=o.error?new Error("Server returned an error on close: "+o.error):void 0;o.allowReconnect===!0?this.connection.stop(r):this._stopPromise=this._stopInternal(r);break}case F.Ack:this._messageBuffer&&this._messageBuffer._ack(o);break;case F.Sequence:this._messageBuffer&&this._messageBuffer._resetSequence(o);break;default:this._logger.log(k.Warning,`Invalid message type: ${o.type}.`)}}this._resetTimeoutPeriod()}_processHandshakeResponse(t){let n,o;try{[o,n]=this._handshakeProtocol.parseHandshakeResponse(t)}catch(r){const i="Error parsing handshake response: "+r;this._logger.log(k.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(k.Error,r);const i=new Error(r);throw this._handshakeRejecter(i),i}return this._logger.log(k.Debug,"Server handshake complete."),this._handshakeResolver(),o}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=new Date().getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if(!(this.connection.features&&this.connection.features.inherentKeepAlive||(this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds),this._pingServerHandle!==void 0))){let t=this._nextKeepAlive-new Date().getTime();t<0&&(t=0),this._pingServerHandle=setTimeout(async()=>{if(this._connectionState===J.Connected)try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}},t)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}async _invokeClientMethod(t){const n=t.target.toLowerCase(),o=this._methods[n];if(!o)return this._logger.log(k.Warning,`No client method with the name '${n}' found.`),void(t.invocationId&&(this._logger.log(k.Warning,`No result given for '${n}' method and invocation ID '${t.invocationId}'.`),await this._sendWithProtocol(this._createCompletionMessage(t.invocationId,"Client didn't provide a result.",null))));const r=o.slice(),i=!!t.invocationId;let s,a,l;for(const d of r)try{const w=s;s=await d.apply(this,t.arguments),i&&s&&w&&(this._logger.log(k.Error,`Multiple results provided for '${n}'. Sending error to server.`),l=this._createCompletionMessage(t.invocationId,"Client provided multiple results.",null)),a=void 0}catch(w){a=w,this._logger.log(k.Error,`A callback for the method '${n}' threw error '${w}'.`)}l?await this._sendWithProtocol(l):i?(a?l=this._createCompletionMessage(t.invocationId,`${a}`,null):s!==void 0?l=this._createCompletionMessage(t.invocationId,null,s):(this._logger.log(k.Warning,`No result given for '${n}' method and invocation ID '${t.invocationId}'.`),l=this._createCompletionMessage(t.invocationId,"Client didn't provide a result.",null)),await this._sendWithProtocol(l)):s&&this._logger.log(k.Error,`Result given for '${n}' method but server is not expecting a result.`)}_connectionClosed(t){this._logger.log(k.Debug,`HubConnection.connectionClosed(${t}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||t||new wt("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(t||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===J.Disconnecting?this._completeClose(t):this._connectionState===J.Connected&&this._reconnectPolicy?this._reconnect(t):this._connectionState===J.Connected&&this._completeClose(t)}_completeClose(t){if(this._connectionStarted){this._connectionState=J.Disconnected,this._connectionStarted=!1,this._messageBuffer&&(this._messageBuffer._dispose(t??new Error("Connection closed.")),this._messageBuffer=void 0),tt.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(n=>n.apply(this,[t]))}catch(n){this._logger.log(k.Error,`An onclose callback called with error '${t}' threw error '${n}'.`)}}}async _reconnect(t){const n=Date.now();let o=0,r=t!==void 0?t:new Error("Attempting to reconnect due to a unknown error."),i=this._getNextRetryDelay(o++,0,r);if(i===null)return this._logger.log(k.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(t);if(this._connectionState=J.Reconnecting,t?this._logger.log(k.Information,`Connection reconnecting because of error '${t}'.`):this._logger.log(k.Information,"Connection reconnecting."),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(s=>s.apply(this,[t]))}catch(s){this._logger.log(k.Error,`An onreconnecting callback called with error '${t}' threw error '${s}'.`)}if(this._connectionState!==J.Reconnecting)return void this._logger.log(k.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;i!==null;){if(this._logger.log(k.Information,`Reconnect attempt number ${o} will start in ${i} ms.`),await new Promise(s=>{this._reconnectDelayHandle=setTimeout(s,i)}),this._reconnectDelayHandle=void 0,this._connectionState!==J.Reconnecting)return void this._logger.log(k.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=J.Connected,this._logger.log(k.Information,"HubConnection reconnected successfully."),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(s=>s.apply(this,[this.connection.connectionId]))}catch(s){this._logger.log(k.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${s}'.`)}return}catch(s){if(this._logger.log(k.Information,`Reconnect attempt failed because of error '${s}'.`),this._connectionState!==J.Reconnecting)return this._logger.log(k.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this._connectionState===J.Disconnecting&&this._completeClose());r=s instanceof Error?s:new Error(s.toString()),i=this._getNextRetryDelay(o++,Date.now()-n,r)}}this._logger.log(k.Information,`Reconnect retries have been exhausted after ${Date.now()-n} ms and ${o} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(t,n,o){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:n,previousRetryCount:t,retryReason:o})}catch(r){return this._logger.log(k.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${t}, ${n}) threw error '${r}'.`),null}}_cancelCallbacksWithError(t){const n=this._callbacks;this._callbacks={},Object.keys(n).forEach(o=>{const r=n[o];try{r(null,t)}catch(i){this._logger.log(k.Error,`Stream 'error' callback called with '${t}' threw error: ${eo(i)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(t,n,o,r){if(o)return r.length!==0?{arguments:n,streamIds:r,target:t,type:F.Invocation}:{arguments:n,target:t,type:F.Invocation};{const i=this._invocationId;return this._invocationId++,r.length!==0?{arguments:n,invocationId:i.toString(),streamIds:r,target:t,type:F.Invocation}:{arguments:n,invocationId:i.toString(),target:t,type:F.Invocation}}}_launchStreams(t,n){if(t.length!==0){n||(n=Promise.resolve());for(const o in t)t[o].subscribe({complete:()=>{n=n.then(()=>this._sendWithProtocol(this._createCompletionMessage(o)))},error:r=>{let i;i=r instanceof Error?r.message:r&&r.toString?r.toString():"Unknown error",n=n.then(()=>this._sendWithProtocol(this._createCompletionMessage(o,i)))},next:r=>{n=n.then(()=>this._sendWithProtocol(this._createStreamItemMessage(o,r)))}})}}_replaceStreamingParams(t){const n=[],o=[];for(let r=0;r<t.length;r++){const i=t[r];if(this._isObservable(i)){const s=this._invocationId;this._invocationId++,n[s]=i,o.push(s.toString()),t.splice(r,1)}}return[n,o]}_isObservable(t){return t&&t.subscribe&&typeof t.subscribe=="function"}_createStreamInvocation(t,n,o){const r=this._invocationId;return this._invocationId++,o.length!==0?{arguments:n,invocationId:r.toString(),streamIds:o,target:t,type:F.StreamInvocation}:{arguments:n,invocationId:r.toString(),target:t,type:F.StreamInvocation}}_createCancelInvocation(t){return{invocationId:t,type:F.CancelInvocation}}_createStreamItemMessage(t,n){return{invocationId:t,item:n,type:F.StreamItem}}_createCompletionMessage(t,n,o){return n?{error:n,invocationId:t,type:F.Completion}:{invocationId:t,result:o,type:F.Completion}}_createCloseMessage(){return{type:F.Close}}}const Bc=[0,2e3,1e4,3e4,null];class Kr{constructor(t){this._retryDelays=t!==void 0?[...t,null]:Bc}nextRetryDelayInMilliseconds(t){return this._retryDelays[t.previousRetryCount]}}class Wt{}Wt.Authorization="Authorization",Wt.Cookie="Cookie";class jc extends Be{constructor(t,n){super(),this._innerClient=t,this._accessTokenFactory=n}async send(t){let n=!0;this._accessTokenFactory&&(!this._accessToken||t.url&&t.url.indexOf("/negotiate?")>0)&&(n=!1,this._accessToken=await this._accessTokenFactory()),this._setAuthorizationHeader(t);const o=await this._innerClient.send(t);return n&&o.statusCode===401&&this._accessTokenFactory?(this._accessToken=await this._accessTokenFactory(),this._setAuthorizationHeader(t),await this._innerClient.send(t)):o}_setAuthorizationHeader(t){t.headers||(t.headers={}),this._accessToken?t.headers[Wt.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&t.headers[Wt.Authorization]&&delete t.headers[Wt.Authorization]}getCookieString(t){return this._innerClient.getCookieString(t)}}var ot,lt;(function(e){e[e.None=0]="None",e[e.WebSockets=1]="WebSockets",e[e.ServerSentEvents=2]="ServerSentEvents",e[e.LongPolling=4]="LongPolling"})(ot||(ot={})),function(e){e[e.Text=1]="Text",e[e.Binary=2]="Binary"}(lt||(lt={}));class Oc{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 Yr{get pollAborted(){return this._pollAbort.aborted}constructor(t,n,o){this._httpClient=t,this._logger=n,this._pollAbort=new Oc,this._options=o,this._running=!1,this.onreceive=null,this.onclose=null}async connect(t,n){if(nt.isRequired(t,"url"),nt.isRequired(n,"transferFormat"),nt.isIn(n,lt,"transferFormat"),this._url=t,this._logger.log(k.Trace,"(LongPolling transport) Connecting."),n===lt.Binary&&typeof XMLHttpRequest<"u"&&typeof new XMLHttpRequest().responseType!="string")throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[o,r]=Kt(),i={[o]:r,...this._options.headers},s={abortSignal:this._pollAbort.signal,headers:i,timeout:1e5,withCredentials:this._options.withCredentials};n===lt.Binary&&(s.responseType="arraybuffer");const a=`${t}&_=${Date.now()}`;this._logger.log(k.Trace,`(LongPolling transport) polling: ${a}.`);const l=await this._httpClient.get(a,s);l.statusCode!==200?(this._logger.log(k.Error,`(LongPolling transport) Unexpected response code: ${l.statusCode}.`),this._closeError=new jt(l.statusText||"",l.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,s)}async _poll(t,n){try{for(;this._running;)try{const o=`${t}&_=${Date.now()}`;this._logger.log(k.Trace,`(LongPolling transport) polling: ${o}.`);const r=await this._httpClient.get(o,n);r.statusCode===204?(this._logger.log(k.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):r.statusCode!==200?(this._logger.log(k.Error,`(LongPolling transport) Unexpected response code: ${r.statusCode}.`),this._closeError=new jt(r.statusText||"",r.statusCode),this._running=!1):r.content?(this._logger.log(k.Trace,`(LongPolling transport) data received. ${ae(r.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(r.content)):this._logger.log(k.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(o){this._running?o instanceof to?this._logger.log(k.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=o,this._running=!1):this._logger.log(k.Trace,`(LongPolling transport) Poll errored after shutdown: ${o.message}`)}}finally{this._logger.log(k.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(t){return this._running?Vr(this._logger,"LongPolling",this._httpClient,this._url,t,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(k.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(k.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const t={},[n,o]=Kt();t[n]=o;const r={headers:{...t,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials};let i;try{await this._httpClient.delete(this._url,r)}catch(s){i=s}i?i instanceof jt&&(i.statusCode===404?this._logger.log(k.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this._logger.log(k.Trace,`(LongPolling transport) Error sending a DELETE request: ${i}`)):this._logger.log(k.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this._logger.log(k.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}}_raiseOnClose(){if(this.onclose){let t="(LongPolling transport) Firing onclose event.";this._closeError&&(t+=" Error: "+this._closeError),this._logger.log(k.Trace,t),this.onclose(this._closeError)}}}class Wc{constructor(t,n,o,r){this._httpClient=t,this._accessToken=n,this._logger=o,this._options=r,this.onreceive=null,this.onclose=null}async connect(t,n){return nt.isRequired(t,"url"),nt.isRequired(n,"transferFormat"),nt.isIn(n,lt,"transferFormat"),this._logger.log(k.Trace,"(SSE transport) Connecting."),this._url=t,this._accessToken&&(t+=(t.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise((o,r)=>{let i,s=!1;if(n===lt.Text){if(tt.isBrowser||tt.isWebWorker)i=new this._options.EventSource(t,{withCredentials:this._options.withCredentials});else{const a=this._httpClient.getCookieString(t),l={};l.Cookie=a;const[d,w]=Kt();l[d]=w,i=new this._options.EventSource(t,{withCredentials:this._options.withCredentials,headers:{...l,...this._options.headers}})}try{i.onmessage=a=>{if(this.onreceive)try{this._logger.log(k.Trace,`(SSE transport) data received. ${ae(a.data,this._options.logMessageContent)}.`),this.onreceive(a.data)}catch(l){return void this._close(l)}},i.onerror=a=>{s?this._close():r(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},i.onopen=()=>{this._logger.log(k.Information,`SSE connected to ${this._url}`),this._eventSource=i,s=!0,o()}}catch(a){return void r(a)}}else r(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))})}async send(t){return this._eventSource?Vr(this._logger,"SSE",this._httpClient,this._url,t,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this._close(),Promise.resolve()}_close(t){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(t))}}class Uc{constructor(t,n,o,r,i,s){this._logger=o,this._accessTokenFactory=n,this._logMessageContent=r,this._webSocketConstructor=i,this._httpClient=t,this.onreceive=null,this.onclose=null,this._headers=s}async connect(t,n){let o;return nt.isRequired(t,"url"),nt.isRequired(n,"transferFormat"),nt.isIn(n,lt,"transferFormat"),this._logger.log(k.Trace,"(WebSockets transport) Connecting."),this._accessTokenFactory&&(o=await this._accessTokenFactory()),new Promise((r,i)=>{let s;t=t.replace(/^http/,"ws");const a=this._httpClient.getCookieString(t);let l=!1;if(tt.isNode||tt.isReactNative){const d={},[w,_]=Kt();d[w]=_,o&&(d[Wt.Authorization]=`Bearer ${o}`),a&&(d[Wt.Cookie]=a),s=new this._webSocketConstructor(t,void 0,{headers:{...d,...this._headers}})}else o&&(t+=(t.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(o)}`);s||(s=new this._webSocketConstructor(t)),n===lt.Binary&&(s.binaryType="arraybuffer"),s.onopen=d=>{this._logger.log(k.Information,`WebSocket connected to ${t}.`),this._webSocket=s,l=!0,r()},s.onerror=d=>{let w=null;w=typeof ErrorEvent<"u"&&d instanceof ErrorEvent?d.error:"There was an error with the transport",this._logger.log(k.Information,`(WebSockets transport) ${w}.`)},s.onmessage=d=>{if(this._logger.log(k.Trace,`(WebSockets transport) data received. ${ae(d.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(d.data)}catch(w){return void this._close(w)}},s.onclose=d=>{if(l)this._close(d);else{let w=null;w=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(w))}}})}send(t){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(k.Trace,`(WebSockets transport) sending data. ${ae(t,this._logMessageContent)}.`),this._webSocket.send(t),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(t){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(k.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this._isCloseEvent(t)||t.wasClean!==!1&&t.code===1e3?t instanceof Error?this.onclose(t):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${t.code} (${t.reason||"no reason given"}).`)))}_isCloseEvent(t){return t&&typeof t.wasClean=="boolean"&&typeof t.code=="number"}}class Fc{constructor(t,n={}){var o;if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,nt.isRequired(t,"url"),this._logger=(o=n.logger)===void 0?new je(k.Information):o===null?se.instance:o.log!==void 0?o:new je(o),this.baseUrl=this._resolveUrl(t),(n=n||{}).logMessageContent=n.logMessageContent!==void 0&&n.logMessageContent,typeof n.withCredentials!="boolean"&&n.withCredentials!==void 0)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");n.withCredentials=n.withCredentials===void 0||n.withCredentials,n.timeout=n.timeout===void 0?1e5:n.timeout;let r=null,i=null;if(tt.isNode&&typeof require<"u"){const s=typeof __webpack_require__=="function"?__non_webpack_require__:require;r=s("ws"),i=s("eventsource")}tt.isNode||typeof WebSocket>"u"||n.WebSocket?tt.isNode&&!n.WebSocket&&r&&(n.WebSocket=r):n.WebSocket=WebSocket,tt.isNode||typeof EventSource>"u"||n.EventSource?tt.isNode&&!n.EventSource&&i!==void 0&&(n.EventSource=i):n.EventSource=EventSource,this._httpClient=new jc(n.httpClient||new Lc(this._logger),n.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=n,this.onreceive=null,this.onclose=null}async start(t){if(t=t||lt.Binary,nt.isIn(t,lt,"transferFormat"),this._logger.log(k.Debug,`Starting connection with transfer format '${lt[t]}'.`),this._connectionState!=="Disconnected")return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(t),await this._startInternalPromise,this._connectionState==="Disconnecting"){const n="Failed to start the HttpConnection before stop() was called.";return this._logger.log(k.Error,n),await this._stopPromise,Promise.reject(new wt(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(k.Error,n),Promise.reject(new wt(n))}this._connectionStarted=!0}send(t){return this._connectionState!=="Connected"?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new Do(this.transport)),this._sendQueue.send(t))}async stop(t){return this._connectionState==="Disconnected"?(this._logger.log(k.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):this._connectionState==="Disconnecting"?(this._logger.log(k.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState="Disconnecting",this._stopPromise=new Promise(n=>{this._stopPromiseResolver=n}),await this._stopInternal(t),void await this._stopPromise)}async _stopInternal(t){this._stopError=t;try{await this._startInternalPromise}catch{}if(this.transport){try{await this.transport.stop()}catch(n){this._logger.log(k.Error,`HttpConnection.transport.stop() threw error '${n}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(k.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(t){let n=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==ot.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(ot.WebSockets),await this._startTransport(n,t)}else{let o=null,r=0;do{if(o=await this._getNegotiationResponse(n),this._connectionState==="Disconnecting"||this._connectionState==="Disconnected")throw new wt("The connection was stopped during negotiation.");if(o.error)throw new Error(o.error);if(o.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(o.url&&(n=o.url),o.accessToken){const i=o.accessToken;this._accessTokenFactory=()=>i,this._httpClient._accessToken=i,this._httpClient._accessTokenFactory=void 0}r++}while(o.url&&r<100);if(r===100&&o.url)throw new Error("Negotiate redirection limit exceeded.");await this._createTransport(n,this._options.transport,o,t)}this.transport instanceof Yr&&(this.features.inherentKeepAlive=!0),this._connectionState==="Connecting"&&(this._logger.log(k.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(o){return this._logger.log(k.Error,"Failed to start the connection: "+o),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(o)}}async _getNegotiationResponse(t){const n={},[o,r]=Kt();n[o]=r;const i=this._resolveNegotiateUrl(t);this._logger.log(k.Debug,`Sending negotiation request: ${i}.`);try{const s=await this._httpClient.post(i,{content:"",headers:{...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 qr("Client didn't negotiate Stateful Reconnect but the server did.")):a}catch(s){let a="Failed to complete negotiation with the server: "+s;return s instanceof jt&&s.statusCode===404&&(a+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(k.Error,a),Promise.reject(new qr(a))}}_createConnectUrl(t,n){return n?t+(t.indexOf("?")===-1?"?":"&")+`id=${n}`:t}async _createTransport(t,n,o,r){let i=this._createConnectUrl(t,o.connectionToken);if(this._isITransport(n))return this._logger.log(k.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 w=this._resolveTransportOrError(d,n,r,l?.useStatefulReconnect===!0);if(w instanceof Error)s.push(`${d.transport} failed:`),s.push(w);else if(this._isITransport(w)){if(this.transport=w,!l){try{l=await this._getNegotiationResponse(t)}catch(_){return Promise.reject(_)}i=this._createConnectUrl(t,l.connectionToken)}try{return await this._startTransport(i,r),void(this.connectionId=l.connectionId)}catch(_){if(this._logger.log(k.Error,`Failed to start the transport '${d.transport}': ${_}`),l=void 0,s.push(new Ec(`${d.transport} failed: ${_}`,ot[d.transport])),this._connectionState!=="Connecting"){const x="Failed to select transport before stop() was called.";return this._logger.log(k.Debug,x),Promise.reject(new wt(x))}}}}return s.length>0?Promise.reject(new xc(`Unable to connect to the server with any of the available transports. ${s.join(" ")}`,s)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))}_constructTransport(t){switch(t){case ot.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new Uc(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case ot.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new Wc(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case ot.LongPolling:return new Yr(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${t}.`)}}_startTransport(t,n){return this.transport.onreceive=this.onreceive,this.features.reconnect?this.transport.onclose=async o=>{let r=!1;if(this.features.reconnect){try{this.features.disconnected(),await this.transport.connect(t,n),await this.features.resend()}catch{r=!0}r&&this._stopConnection(o)}else this._stopConnection(o)}:this.transport.onclose=o=>this._stopConnection(o),this.transport.connect(t,n)}_resolveTransportOrError(t,n,o,r){const i=ot[t.transport];if(i==null)return this._logger.log(k.Debug,`Skipping transport '${t.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${t.transport}' because it is not supported by this client.`);if(!function(s,a){return!s||(a&s)!=0}(n,i))return this._logger.log(k.Debug,`Skipping transport '${ot[i]}' because it was disabled by the client.`),new Cc(`'${ot[i]}' is disabled by the client.`,i);{if(!(t.transferFormats.map(a=>lt[a]).indexOf(o)>=0))return this._logger.log(k.Debug,`Skipping transport '${ot[i]}' because it does not support the requested transfer format '${lt[o]}'.`),new Error(`'${ot[i]}' does not support ${lt[o]}.`);if(i===ot.WebSockets&&!this._options.WebSocket||i===ot.ServerSentEvents&&!this._options.EventSource)return this._logger.log(k.Debug,`Skipping transport '${ot[i]}' because it is not supported in your environment.'`),new Sc(`'${ot[i]}' is not supported in your environment.`,i);this._logger.log(k.Debug,`Selecting transport '${ot[i]}'.`);try{return this.features.reconnect=i===ot.WebSockets?r:void 0,this._constructTransport(i)}catch(a){return a}}}_isITransport(t){return t&&typeof t=="object"&&"connect"in t}_stopConnection(t){if(this._logger.log(k.Debug,`HttpConnection.stopConnection(${t}) called while in state ${this._connectionState}.`),this.transport=void 0,t=this._stopError||t,this._stopError=void 0,this._connectionState!=="Disconnected"){if(this._connectionState==="Connecting")throw this._logger.log(k.Warning,`Call to HttpConnection.stopConnection(${t}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${t}) was called while the connection is still in the connecting state.`);if(this._connectionState==="Disconnecting"&&this._stopPromiseResolver(),t?this._logger.log(k.Error,`Connection disconnected with error '${t}'.`):this._logger.log(k.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(n=>{this._logger.log(k.Error,`TransportSendQueue.stop() threw error '${n}'.`)}),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(t)}catch(n){this._logger.log(k.Error,`HttpConnection.onclose(${t}) threw error '${n}'.`)}}}else this._logger.log(k.Debug,`Call to HttpConnection.stopConnection(${t}) was ignored because the connection is already in the disconnected state.`)}_resolveUrl(t){if(t.lastIndexOf("https://",0)===0||t.lastIndexOf("http://",0)===0)return t;if(!tt.isBrowser)throw new Error(`Cannot resolve '${t}'.`);const n=window.document.createElement("a");return n.href=t,this._logger.log(k.Information,`Normalizing '${t}' to '${n.href}'.`),n.href}_resolveNegotiateUrl(t){const n=new URL(t);n.pathname.endsWith("/")?n.pathname+="negotiate":n.pathname+="/negotiate";const o=new URLSearchParams(n.searchParams);return o.has("negotiateVersion")||o.append("negotiateVersion",this._negotiateVersion.toString()),o.has("useStatefulReconnect")?o.get("useStatefulReconnect")==="true"&&(this._options._useStatefulReconnect=!0):this._options._useStatefulReconnect===!0&&o.append("useStatefulReconnect","true"),n.search=o.toString(),n.toString()}}class Do{constructor(t){this._transport=t,this._buffer=[],this._executing=!0,this._sendBufferedData=new Oe,this._transportResult=new Oe,this._sendLoopPromise=this._sendLoop()}send(t){return this._bufferData(t),this._transportResult||(this._transportResult=new Oe),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(t){if(this._buffer.length&&typeof this._buffer[0]!=typeof t)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof t}`);this._buffer.push(t),this._sendBufferedData.resolve()}async _sendLoop(){for(;;){if(await this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new Oe;const t=this._transportResult;this._transportResult=void 0;const n=typeof this._buffer[0]=="string"?this._buffer.join(""):Do._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(n),t.resolve()}catch(o){t.reject(o)}}}static _concatBuffers(t){const n=t.map(i=>i.byteLength).reduce((i,s)=>i+s),o=new Uint8Array(n);let r=0;for(const i of t)o.set(new Uint8Array(i),r),r+=i.byteLength;return o.buffer}}class Oe{constructor(){this.promise=new Promise((t,n)=>[this._resolver,this._rejecter]=[t,n])}resolve(){this._resolver()}reject(t){this._rejecter(t)}}class Hc{constructor(){this.name="json",this.version=2,this.transferFormat=lt.Text}parseMessages(t,n){if(typeof t!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!t)return[];n===null&&(n=se.instance);const o=gt.parse(t),r=[];for(const i of o){const s=JSON.parse(i);if(typeof s.type!="number")throw new Error("Invalid payload.");switch(s.type){case F.Invocation:this._isInvocationMessage(s);break;case F.StreamItem:this._isStreamItemMessage(s);break;case F.Completion:this._isCompletionMessage(s);break;case F.Ping:case F.Close:break;case F.Ack:this._isAckMessage(s);break;case F.Sequence:this._isSequenceMessage(s);break;default:n.log(k.Information,"Unknown message type '"+s.type+"' ignored.");continue}r.push(s)}return r}writeMessage(t){return gt.write(JSON.stringify(t))}_isInvocationMessage(t){this._assertNotEmptyString(t.target,"Invalid payload for Invocation message."),t.invocationId!==void 0&&this._assertNotEmptyString(t.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(t){if(this._assertNotEmptyString(t.invocationId,"Invalid payload for StreamItem message."),t.item===void 0)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(t){if(t.result&&t.error)throw new Error("Invalid payload for Completion message.");!t.result&&t.error&&this._assertNotEmptyString(t.error,"Invalid payload for Completion message."),this._assertNotEmptyString(t.invocationId,"Invalid payload for Completion message.")}_isAckMessage(t){if(typeof t.sequenceId!="number")throw new Error("Invalid SequenceId for Ack message.")}_isSequenceMessage(t){if(typeof t.sequenceId!="number")throw new Error("Invalid SequenceId for Sequence message.")}_assertNotEmptyString(t,n){if(typeof t!="string"||t==="")throw new Error(n)}}const qc={trace:k.Trace,debug:k.Debug,info:k.Information,information:k.Information,warn:k.Warning,warning:k.Warning,error:k.Error,critical:k.Critical,none:k.None};class Xc{configureLogging(t){if(nt.isRequired(t,"logging"),t.log!==void 0)this.logger=t;else if(typeof t=="string"){const n=function(o){const r=qc[o.toLowerCase()];if(r!==void 0)return r;throw new Error(`Unknown log level: ${o}`)}(t);this.logger=new je(n)}else this.logger=new je(t);return this}withUrl(t,n){return nt.isRequired(t,"url"),nt.isNotEmpty(t,"url"),this.url=t,this.httpConnectionOptions=typeof n=="object"?{...this.httpConnectionOptions,...n}:{...this.httpConnectionOptions,transport:n},this}withHubProtocol(t){return nt.isRequired(t,"protocol"),this.protocol=t,this}withAutomaticReconnect(t){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return t?Array.isArray(t)?this.reconnectPolicy=new Kr(t):this.reconnectPolicy=t:this.reconnectPolicy=new Kr,this}withServerTimeout(t){return nt.isRequired(t,"milliseconds"),this._serverTimeoutInMilliseconds=t,this}withKeepAliveInterval(t){return nt.isRequired(t,"milliseconds"),this._keepAliveIntervalInMilliseconds=t,this}withStatefulReconnect(t){return this.httpConnectionOptions===void 0&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=t?.bufferSize,this}build(){const t=this.httpConnectionOptions||{};if(t.logger===void 0&&(t.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const n=new Fc(this.url,t);return Ao.create(n,this.logger||se.instance,this.protocol||new Hc,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}}let We;function Vc(e){if(!e){if(We)return We;throw new Error("\u9996\u6B21\u6784\u5EFA\uFF0CsignalrURL\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\uFF01")}const t=new Xc().configureLogging(k.Information).withUrl(e).withAutomaticReconnect({nextRetryDelayInMilliseconds:()=>5e3}).build();return t.keepAliveIntervalInMilliseconds=15e3,t.serverTimeoutInMilliseconds=18e5,t.start().then(()=>{B.Logger().info("\u542F\u52A8SignalR\u8FDE\u63A5\uFF01")}),t.onclose(async()=>{B.Logger().info("\u65AD\u5F00SignalR\u8FDE\u63A5!")}),t.onreconnecting(()=>{B.Logger().warn("SignalR\u670D\u52A1\u5DF2\u65AD\u7EBF\uFF0C\u91CD\u8FDE\u4E2D...\uFF01")}),t.onreconnected(()=>{B.Logger().warn("SignalR\u91CD\u8FDE\u6210\u529F!")}),We||(We=t),t}const no=new Set;function Jr(e){return e!==null?parseFloat(e):0}function Ue(e){const t=window.getComputedStyle(e),n=Math.ceil([t.paddingLeft,t.width,t.paddingRight].map(Jr).reduce((r,i)=>r+i)),o=Math.ceil([t.paddingTop,t.height,t.paddingBottom].map(Jr).reduce((r,i)=>r+i));return{width:n,height:o}}class Zr{width;height;constructor(t,n){this.width=t,this.height=n}}function Gc(e){const t=e.windowEl;if(t){const n=parseFloat(t.style.left||"NaN"),o=parseFloat(t.style.top||"NaN");if(!isNaN(n)&&!isNaN(o))return{left:n,top:o}}return null}function Kc(e,t,n,o){const r=e-n,i=t-o;return r*r+i*i}window.addEventListener("resize",e=>{no.forEach(t=>{t&&ke(t.fixPosition)&&t.fixPosition()})});const Fe=[];var He=Mt({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:xe},setup(e,{emit:t}){const n=ws();if(!n)return;const{proxy:o}=n;let r=0,i,s,a;const l=K(e.isOpen),d=()=>{Fe.push(o),a=new js(e.zGroup,w),e.isOpen&&function(A){A&&(nr(()=>{r++==0&&(v(o),function(){const D=_.value,{width:$,height:j}=Rn(D);let U,T;if(e.left!==void 0!=(e.top!==void 0))throw new Error("Either of left or top is specified. Both must be set or not set.");if(typeof e.left=="number")U=e.left,T=e.top;else{const O=e.positionHint||"auto";switch(O){case"auto":{let q=20,rt=50,Z=0;do{if(Fe.every(Q=>{if(!Q.isOpen||o==Q)return!0;const bt=Gc(Q);if(bt==null)return!0;const{left:Ht,top:et}=bt;return Kc(Ht,et,q,rt)>16}))break;q=(q+40)%(window.innerWidth-200),rt=(rt+40)%(window.innerHeight-200)}while(++Z<100);U=q,T=rt}break;case"center":U=(window.innerWidth-$)/2,T=(window.innerHeight-j)/2,console.log(U,T,window.innerWidth,window.innerHeight,"111111");break;default:try{const q=O.split("/").map(Number);if(q.length!=2)throw null;const[rt,Z]=q;if(!isFinite(rt)||!isFinite(Z))throw null;U=rt>=0?rt:window.innerWidth-$+rt,T=Z>=0?Z:window.innerHeight-j+Z}catch{throw new Error(`invalid position string: ${O}`)}}}D&&(D.style.left=`${U}px`,D.style.top=`${T}px`)}()),e.resizable&&h(),L(),i=new Bs(x.value,_.value,{onMove:()=>L(),onMoveStart:()=>t("move-start"),onMoveEnd:()=>t("move-end")}),e.resizable&&function(){const{height:D}=Rn(x.value);s=new Os(_.value,{onResize:()=>h(),onResizeStart:()=>t("resize-start"),onResizeEnd:()=>t("resize-end"),minWidth:e.minWidth,minHeight:e.minHeight+D,maxWidth:e.maxWidth,maxHeight:e.maxHeight?e.maxHeight+D:void 0})}()}),e.activateWhenOpen&&I())}(!0),no.add(o)};function w(A){y.value.zIndex=`${A}`}const _=K(null),x=K(null),P=K(null);function I(){a.raise(),t("activate")}const y=K({...e.windowStyle.window,zIndex:"auto",overflow:e.overflow}),u=Vt(()=>e.windowStyle.titlebar),p=Vt(()=>{const A={...e.windowStyle.content};return e.resizable?A.padding="0":e.padding!=null&&(A.padding=`${e.padding}px`),e.isScrollable&&(A.overflow="auto"),A});function v(A){const{width:D,height:$,top:j,left:U}=A,T=_;if(T&&D!=null&&(T.value.style.width=`${D}px`),$!=null){const O=x.value;if(O){const q=Ue(O).height;T.value.style.height=`${$+q}px`}}T&&U!=null&&(T.value.style.left=`${U}px`),T&&j!=null&&(T.value.style.top=`${j}px`)}function h(A=!0){const D=_.value,$=x.value,j=P.value;if(j&&D&&$){const{width:U,height:T}=Ue(j),{width:O,height:q}=Ue(D),rt=Ue($).height,Z=O-(j.offsetWidth-U),Q=q-rt-(j.offsetHeight-T);j.style.width=`${Z}px`,j.style.height=`${Q}px`,f(),t("resize",new Zr(Z,Q)),A&&(t("update:width",Z),t("update:height",Q))}}function f(){const A=_.value;if(A){const D=A.getBoundingClientRect();D.left<0&&(y.value.left="0px"),D.top<0&&(y.value.top="0px"),D.right>window.innerWidth&&(y.value.left=window.innerWidth-D.width+"px"),D.bottom>window.innerHeight&&(y.value.top=window.innerHeight-D.height+"px")}}function L(A=!0){f();const D=_.value;if(D){const{left:$,top:j}=D.getBoundingClientRect();A&&(t("update:left",$),t("update:top",j))}}return Pt(()=>e.isOpen,A=>{l.value=A}),Pt(()=>e.zGroup,A=>{a.group=A}),Pt(()=>e.width,A=>{v({width:A}),h(!1)}),Pt(()=>e.height,A=>{v({height:A}),h(!1)}),wn(()=>{d()}),bs(()=>{no.delete(this),a.unregister(),s&&s.teardown(),i&&i.teardown(),Fe.splice(Fe.indexOf(o),1)}),{isOpen:l,windowEl:_,titlebar:x,content:P,activate:I,styleWindow:y,styleTitlebar:u,styleContent:p,closeButtonClick:function(){l.value=!1,t("closebuttonclick")},fixPosition:f}}});const Yc={class:"title"};var Qr;He.render=function(e,t,n,o,r,i){const s=bn("myButton");return X(),at(_n,{name:"fade",onAfterLeave:t[2]||(t[2]=a=>e.$emit("close")),onAfterEnter:t[3]||(t[3]=a=>e.$emit("open")),persisted:""},{default:It(()=>[or(Y("div",{class:"window",style:Xt(e.styleWindow),ref:"windowEl",onMousedown:t[0]||(t[0]=(...a)=>e.activate&&e.activate(...a)),onTouchstart:t[1]||(t[1]=(...a)=>e.activate&&e.activate(...a))},[Y("div",{class:"titlebar",style:Xt(e.styleTitlebar),ref:"titlebar"},[Y("div",Yc,[e.$slots.title?st(e.$slots,"title",{key:0}):(X(),pt(zt,{key:1},[Sn(Cn(e.title),1)],64))]),e.closeButton?(X(),at(s,{key:0,windowStyle:e.windowStyle,onClick:e.closeButtonClick},{default:It(()=>[Sn("\xD7")]),_:1},8,["windowStyle","onClick"])):mt("v-if",!0)],4),Y("div",{class:"content",style:Xt(e.styleContent),ref:"content"},[st(e.$slots,"default")],4)],36),[[rr,e.isOpen]])]),_:3})},He.__file="src/controls/vuewindow/window/index.vue",function(e){e[e.StyleBlack=0]="StyleBlack",e[e.StyleWhite=1]="StyleWhite",e[e.StyleMetal=2]="StyleMetal",e[e.StyleGrayblue=3]="StyleGrayblue"}(Qr||(Qr={}));const Jc={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)"}},Zc={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)"}},Qc={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)"}},tl={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)"}},el=He;var ut;(function(e){e[e.top=0]="top",e[e.bottom=1]="bottom",e[e.centerBack=2]="centerBack",e[e.centerMain=3]="centerMain",e[e.centerFront=4]="centerFront",e[e.left=5]="left",e[e.right=6]="right"})(ut||(ut={}));class ti{layoutState;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;widgetConfig=new Array;_LayoutID;_mapItemRefs;constructor(t,n,o,r){this.layoutState=t,this._LayoutID=o,this._mapItemRefs=r,n.forEach(i=>{if(i.layoutID===o&&(this.widgetConfig.push(i),i.afterid))if(this.preConditionMap.has(i.afterid))this.preConditionMap.get(i.afterid)?.add(i);else{const s=new Set;s.add(i),this.preConditionMap.set(i.afterid,s)}})}getLayoutID(){return this._LayoutID}getWidgetConfig(){return this.widgetConfig}preloadWidgets(){this.widgetConfig.filter(t=>t.preload&&!t.afterid).forEach(t=>{this._loadWidget(t)})}async loadWidget(t){if(!t)return;let n;if(Lt(t)?n=t:Ie(t)&&(n=this.widgetConfig.find(o=>o.id===t)),n){if(n.afterid){if(this.isWidgetLoaded(n.afterid))return this._loadWidget(n);{let o=function(a){a.layoutID===r._LayoutID&&a.widgetID===i&&(r._loadWidget(s),B.EventBus.off(ct.WidgetLoadedEvent,o))};const r=this,i=n.afterid,s=n;return B.EventBus.on(ct.WidgetLoadedEvent,o),this.loadWidget(n.afterid)}}return this._loadWidget(n)}}loadOtherDependenceWidgets(t){this.preConditionMap.has(t)&&this.preConditionMap.get(t)?.forEach(n=>{n.preload&&this._loadWidget(n)})}_loadWidget(t){if(!this.widgetsLoadedSet.has(t.id))return t.component().then(n=>{if(n.default){const o=_s(n.default);this.getContainerComponents(t.container).value.set(t.id,o),this.widgetsLoadedSet.add(t.id),nr().then(()=>{B.EventBus.emit(ct.WidgetLoadedEvent,{layoutID:this._LayoutID,widgetID:t.id}),this.loadOtherDependenceWidgets(t.id)})}}).catch(n=>{B.Logger().error("\u52A0\u8F7DWidget\u5931\u8D25\uFF01",t),B.EventBus.emit(ct.WidgetLoadedErrorEvent,t)});this.changeWidgetVisible(t.id,!0)}hasDependentWidgets(t){let n=!1;if(this.preConditionMap.has(t)){const o=this.preConditionMap.get(t);if(o){for(const r of o)if(this.isWidgetLoaded(r.id)){n=!0;break}}}return n}unloadWidget(t){if(!t||!this.isWidgetLoaded(t))return;const n=this.widgetConfig.find(o=>o.id===t);if(n){if(this.preConditionMap.has(t)){const o=this.preConditionMap.get(t);if(o)for(const r of o)this.unloadWidget(r.id)}this.getContainerComponents(n.container).value.delete(t),this.widgetsLoadedSet.delete(t),this._mapItemRefs&&this._mapItemRefs.delete(t),B.EventBus.emit(ct.WidgetUnLoadedEvent,{layoutID:this._LayoutID,widgetID:t})}}isWidgetLoaded(t){return this.widgetsLoadedSet.has(t)}splitTwoContainer(t=!1){const n=this.layoutState.centerMainContainer,o=this.layoutState.centerBackContainer;t?(n&&(n.style.left="0",n.style.width="100%"),o&&(o.style.width="100%")):(n&&(n.style.left="50%",n.style.width="50%"),o&&(o.style.width="50%"))}getLayoutContainer(t){switch(t){case ut.top:return this.layoutState.topContainer;case ut.bottom:return this.layoutState.bottomContainer;case ut.left:return this.layoutState.leftContainer;case ut.right:return this.layoutState.rightContainer;case ut.centerBack:return this.layoutState.centerBackContainer;case ut.centerMain:return this.layoutState.centerMainContainer;case ut.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(t,n=!1){const o=this.getLayoutContainer(t);o&&(o.style.visibility=n?"visible":"hidden")}changeWidgetVisible(t,n=!1){const o=this.getWidgetComponent(t);o&&o.changeVisible&&o.changeVisible(n)}isWidgetVisible(t){const n=this.getWidgetComponent(t);return!!n&&(!n.isShow||n.isShow.value)}getWidgetComponent(t){if(this.widgetsLoadedSet.has(t)&&this._mapItemRefs)return this._mapItemRefs.get(t)}getWigetItem(t){return this.widgetConfig.find(n=>n.id===t)}getGroupWigetItems(t){return this.widgetConfig.filter(n=>n.group===t)}getContainerComponents(t){if(this.layoutMap.has(t))return this.layoutMap.get(t);{const n=K(new Map);return this.layoutMap.set(t,n),n}}getWidgetLoadedIDList(){const t=[];return this.widgetsLoadedSet.forEach(n=>{t.push(n)}),t}unloadAllWidgets(t){const n=[];this.widgetsLoadedSet.forEach(o=>{t&&t.length>0?t.findIndex(r=>r===o)<0&&n.push(o):n.push(o)}),n.forEach(o=>this.unloadWidget(o))}unloadWidgets(t){t&&t.length>0&&t.forEach(n=>{this.unloadWidget(n)})}static getLayoutManager(t,n){if(n){const o=n.find(r=>r.id===t);if(o&&o.layoutID)return B.LayoutMap.get(o.layoutID)}}}var qe=Mt({name:"SuspenseWithError",setup(){const e=K(null);return Ss(t=>(e.value="\u5F53\u524D\u9875\u9762\u5B58\u5728\u95EE\u9898\uFF0C\u65E0\u6CD5\u6E32\u67D3\u2026\u2026",console.error("onErrorCaptured",t),!0)),{error:e}}});qe.render=function(e,t,n,o,r,i){return e.error?st(e.$slots,"error",{key:0},()=>[Sn(Cn(e.error),1)]):(X(),at(Cs,{key:1},{default:It(()=>[st(e.$slots,"default")]),fallback:It(()=>[st(e.$slots,"fallback")]),_:3}))},qe.__file="src/controls/routertransition/SuspenseWithError.vue";var oo=Mt({name:"RouterTransition",__name:"RouterTransition",setup:e=>(t,n)=>{const o=bn("router-view");return X(),at(qe,null,{default:It(()=>[En(o,null,{default:It(({Component:r,route:i})=>[En(_n,null,{default:It(()=>[i.meta.keepAlive?(X(),at(Es,{key:0},[(X(),at(Tt(r),{key:i.name}))],1024)):(X(),at(Tt(r),{key:i.name}))]),_:2},1024)]),_:1})]),_:1})}});oo.__file="src/controls/routertransition/RouterTransition.vue";var Xe=Mt({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:oo},setup(e,{attrs:t,slots:n,emit:o}){const r=e.layoutID,i=K(e.enableRouterView);Pt(()=>e.enableRouterView,()=>{i.value=e.enableRouterView});const s=xs({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 ti(s,e.widgetConfig,r,a),d=y(ut.top),w=y(ut.centerBack),_=y(ut.centerFront),x=y(ut.left),P=y(ut.right),I=y(ut.bottom);function y(p){return l?.getContainerComponents(p)}const u=Vt(()=>e.layoutStyle);return wn(()=>{l&&(r?B.LayoutMap.set(r,l):(B.LayoutManager=l,B.LayoutMap.set("",l)),l.preloadWidgets(),o("containerLoaded",{layoutID:r,layoutManager:l}),B.EventBus.emit(ct.LayoutContainerLoaded,{layoutID:r,layoutManager:l}))}),{...ks(s),topContainerComponents:d,centerbackComponents:w,centerfrontComponents:_,leftContainerComponents:x,rightContainerComponents:P,bottomContainerComponents:I,containerStyle:u,isEnableRouterView:i,setItemRef:(p,v)=>{p&&a.set(v,p)}}}});const nl={ref:"topContainer",class:"topContainer"},ol={key:0,ref:"centerMainContainer",class:"centerdiv mainContainer"},rl={ref:"centerBackContainer",class:"centerdiv backContainer"},il={ref:"centerFrontContainer",class:"centerdiv centerFrontContainer"},sl={ref:"leftContainer",class:"leftContainer"},al={ref:"rightContainer",class:"rightContainer"},cl={ref:"bottomContainer",class:"bottomContainer"};Xe.render=function(e,t,n,o,r,i){const s=bn("router-transition");return X(),pt("div",{class:"layoutContainer",style:Xt(e.containerStyle)},[Y("div",nl,[st(e.$slots,"top"),(X(!0),pt(zt,null,Gt(e.topContainerComponents,([a,l])=>(X(),at(Tt(l),{ref_for:!0,ref:d=>e.setItemRef(d,a),key:a}))),128))],512),Y("div",null,[mt(" \u4E3B\u8981\u5BB9\u5668-\u5E95\u90E8 "),e.isEnableRouterView?(X(),pt("div",ol,[st(e.$slots,"main",{},()=>[En(s)])],512)):mt("v-if",!0),mt(" \u4E0A\u4E00\u5C42-\u4E3B\u5BB9\u5668 "),Y("div",rl,[st(e.$slots,"back"),(X(!0),pt(zt,null,Gt(e.centerbackComponents,([a,l])=>(X(),at(Tt(l),{ref_for:!0,ref:d=>e.setItemRef(d,a),key:a}))),128))],512),mt(" \u6700\u4E0A\u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),Y("div",il,[st(e.$slots,"front"),(X(!0),pt(zt,null,Gt(e.centerfrontComponents,([a,l])=>(X(),at(Tt(l),{ref_for:!0,ref:d=>e.setItemRef(d,a),key:a}))),128))],512),Y("div",sl,[st(e.$slots,"left"),(X(!0),pt(zt,null,Gt(e.leftContainerComponents,([a,l])=>(X(),at(Tt(l),{ref_for:!0,ref:d=>e.setItemRef(d,a),key:a}))),128))],512),Y("div",al,[st(e.$slots,"right"),(X(!0),pt(zt,null,Gt(e.rightContainerComponents,([a,l])=>(X(),at(Tt(l),{ref_for:!0,ref:d=>e.setItemRef(d,a),key:a}))),128))],512)]),Y("div",cl,[st(e.$slots,"bottom"),(X(!0),pt(zt,null,Gt(e.bottomContainerComponents,([a,l])=>(X(),at(Tt(l),{ref_for:!0,ref:d=>e.setItemRef(d,a),key:a}))),128))],512),mt(" \u589E\u52A0\u9ED8\u8BA4\u63D2\u69FD "),st(e.$slots,"default")],4)},Xe.__scopeId="data-v-4d081e5c",Xe.__file="src/controls/layoutcontainer/layout.vue";const ce=/^[a-z0-9]+(-[a-z0-9]+)*$/,Ve=(e,t,n,o="")=>{const r=e.split(":");if(e.slice(0,1)==="@"){if(r.length<2||r.length>3)return null;o=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){const a=r.pop(),l=r.pop(),d={provider:r.length>0?r[0]:o,prefix:l,name:a};return t&&!Ge(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 t&&!Ge(a)?null:a}if(n&&o===""){const a={provider:o,prefix:"",name:i};return t&&!Ge(a,n)?null:a}return null},Ge=(e,t)=>!!e&&!(e.provider!==""&&!e.provider.match(ce)||!(t&&e.prefix===""||e.prefix.match(ce))||!e.name.match(ce)),ei=Object.freeze({left:0,top:0,width:16,height:16}),Ke=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Ye=Object.freeze({...ei,...Ke}),ro=Object.freeze({...Ye,body:"",hidden:!1});function ni(e,t){const n=function(o,r){const i={};!o.hFlip!=!r.hFlip&&(i.hFlip=!0),!o.vFlip!=!r.vFlip&&(i.vFlip=!0);const s=((o.rotate||0)+(r.rotate||0))%4;return s&&(i.rotate=s),i}(e,t);for(const o in ro)o in Ke?o in e&&!(o in n)&&(n[o]=Ke[o]):o in t?n[o]=t[o]:o in e&&(n[o]=e[o]);return n}function ll(e,t,n){const o=e.icons,r=e.aliases||Object.create(null);let i={};function s(a){i=ni(o[a]||r[a],i)}return s(t),n.forEach(s),ni(e,i)}function oi(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(r=>{t(r,null),n.push(r)});const o=function(r,i){const s=r.icons,a=r.aliases||Object.create(null),l=Object.create(null);return(i||Object.keys(s).concat(Object.keys(a))).forEach(function d(w){if(s[w])return l[w]=[];if(!(w in l)){l[w]=null;const _=a[w]&&a[w].parent,x=_&&d(_);x&&(l[w]=[_].concat(x))}return l[w]}),l}(e);for(const r in o){const i=o[r];i&&(t(r,ll(e,r,i)),n.push(r))}return n}const ul={provider:"",aliases:{},not_found:{},...ei};function io(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function ri(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!io(e,ul))return null;const n=t.icons;for(const r in n){const i=n[r];if(!r.match(ce)||typeof i.body!="string"||!io(i,ro))return null}const o=t.aliases||Object.create(null);for(const r in o){const i=o[r],s=i.parent;if(!r.match(ce)||typeof s!="string"||!n[s]&&!o[s]||!io(i,ro))return null}return t}const ii=Object.create(null);function Ut(e,t){const n=ii[e]||(ii[e]=Object.create(null));return n[t]||(n[t]=function(o,r){return{provider:o,prefix:r,icons:Object.create(null),missing:new Set}}(e,t))}function so(e,t){return ri(t)?oi(t,(n,o)=>{o?e.icons[n]=o:e.missing.add(n)}):[]}let le=!1;function si(e){return typeof e=="boolean"&&(le=e),le}function hl(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),le&&!t&&!e.prefix){let o=!1;return ri(e)&&(e.prefix="",oi(e,(r,i)=>{i&&function(s,a){const l=Ve(s,!0,le);return!!l&&function(d,w,_){try{if(typeof _.body=="string")return d.icons[w]={..._},!0}catch{}return!1}(Ut(l.provider,l.prefix),l.name,a)}(r,i)&&(o=!0)})),o}const n=e.prefix;return Ge({provider:t,prefix:n,name:"a"})?!!so(Ut(t,n),e):!1}const ai=Object.freeze({width:null,height:null}),ci=Object.freeze({...ai,...Ke}),dl=/(-?[0-9.]*[0-9]+[0-9.]*)/g,fl=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function li(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const o=e.split(dl);if(o===null||!o.length)return e;const r=[];let i=o.shift(),s=fl.test(i);for(;;){if(s){const a=parseFloat(i);isNaN(a)?r.push(i):r.push(Math.ceil(a*t*n)/n)}else r.push(i);if(i=o.shift(),i===void 0)return r.join("");s=!s}}const pl=/\sid="(\S+)"/g,gl="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16);let ml=0;const ao=Object.create(null);function co(e){return ao[e]||ao[""]}function lo(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array&&t.length))return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const uo=Object.create(null),Je=["https://api.simplesvg.com","https://api.unisvg.com"],ho=[];for(;Je.length>0;)Je.length===1||Math.random()>.5?ho.push(Je.shift()):ho.push(Je.pop());function vl(e,t){const n=lo(t);return n!==null&&(uo[e]=n,!0)}function fo(e){return uo[e]}uo[""]=lo({resources:["https://api.iconify.design"].concat(ho)});let ui=(()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}})();const yl={prepare:(e,t,n)=>{const o=[],r=function(l,d){const w=fo(l);if(!w)return 0;let _;if(w.maxURL){let x=0;w.resources.forEach(I=>{x=Math.max(x,I.length)});const P=d+".json?icons=";_=w.maxURL-x-w.path.length-P.length}else _=0;return _}(e,t),i="icons";let s={type:i,provider:e,prefix:t,icons:[]},a=0;return n.forEach((l,d)=>{a+=l.length+1,a>=r&&d>0&&(o.push(s),s={type:i,provider:e,prefix:t,icons:[]},a=l.length),s.icons.push(l)}),o.push(s),o},send:(e,t,n)=>{if(!ui)return void n("abort",424);let o=function(i){if(typeof i=="string"){const s=fo(i);if(s)return s.path}return"/"}(t.provider);switch(t.type){case"icons":{const i=t.prefix,s=t.icons.join(",");o+=i+".json?"+new URLSearchParams({icons:s}).toString();break}case"custom":{const i=t.uri;o+=i.slice(0,1)==="/"?i.slice(1):i;break}default:return void n("abort",400)}let r=503;ui(e+o).then(i=>{const s=i.status;if(s===200)return r=501,i.json();setTimeout(()=>{n(function(a){return a===404}(s)?"abort":"next",s)})}).then(i=>{setTimeout(typeof i=="object"&&i!==null?()=>{n("success",i)}:()=>{i===404?n("abort",i):n("next",r)})}).catch(()=>{n("next",r)})}};function hi(e,t){e.forEach(n=>{const o=n.loaderCallbacks;o&&(n.loaderCallbacks=o.filter(r=>r.id!==t))})}let wl=0;var bl={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function _l(e,t,n,o){const r=e.resources.length,i=e.random?Math.floor(Math.random()*r):e.index;let s;if(e.random){let f=e.resources.slice(0);for(s=[];f.length>1;){const L=Math.floor(Math.random()*f.length);s.push(f[L]),f=f.slice(0,L).concat(f.slice(L+1))}s=s.concat(f)}else s=e.resources.slice(i).concat(e.resources.slice(0,i));const a=Date.now();let l,d="pending",w=0,_=null,x=[],P=[];function I(){_&&(clearTimeout(_),_=null)}function y(){d==="pending"&&(d="aborted"),I(),x.forEach(f=>{f.status==="pending"&&(f.status="aborted")}),x=[]}function u(f,L){L&&(P=[]),typeof f=="function"&&P.push(f)}function p(){d="failed",P.forEach(f=>{f(void 0,l)})}function v(){x.forEach(f=>{f.status==="pending"&&(f.status="aborted")}),x=[]}function h(){if(d!=="pending")return;I();const f=s.shift();if(f===void 0)return x.length?void(_=setTimeout(()=>{I(),d==="pending"&&(v(),p())},e.timeout)):void p();const L={status:"pending",resource:f,callback:(A,D)=>{(function($,j,U){const T=j!=="success";switch(x=x.filter(O=>O!==$),d){case"pending":break;case"failed":if(T||!e.dataAfterTimeout)return;break;default:return}if(j==="abort")return l=U,void p();if(T)return l=U,void(x.length||(s.length?h():p()));if(I(),v(),!e.random){const O=e.resources.indexOf($.resource);O!==-1&&O!==e.index&&(e.index=O)}d="completed",P.forEach(O=>{O(U)})})(L,A,D)}};x.push(L),w++,_=setTimeout(h,e.rotate),n(f,t,L.callback)}return typeof o=="function"&&P.push(o),setTimeout(h),function(){return{startTime:a,payload:t,status:d,queriesSent:w,queriesPending:x.length,subscribe:u,abort:y}}}function di(e){const t={...bl,...e};let n=[];function o(){n=n.filter(r=>r().status==="pending")}return{query:function(r,i,s){const a=_l(t,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=>{t.index=r},getIndex:()=>t.index,cleanup:o}}function fi(){}const po=Object.create(null);function Sl(e,t,n){let o,r;if(typeof e=="string"){const i=co(e);if(!i)return n(void 0,424),fi;r=i.send;const s=function(a){if(!po[a]){const l=fo(a);if(!l)return;const d={config:l,redundancy:di(l)};po[a]=d}return po[a]}(e);s&&(o=s.redundancy)}else{const i=lo(e);if(i){o=di(i);const s=co(e.resources?e.resources[0]:"");s&&(r=s.send)}}return o&&r?o.query(t,r,n)().abort:(n(void 0,424),fi)}function go(e,t){try{return e.getItem(t)}catch{}}function mo(e,t,n){try{return e.setItem(t,n),!0}catch{}}function pi(e,t){try{e.removeItem(t)}catch{}}function vo(e,t){return mo(e,"iconify-count",t.toString())}function yo(e){return parseInt(go(e,"iconify-count"))||0}const Ze={local:!0,session:!0},gi={local:new Set,session:new Set};let wo=!1,Qe=typeof window>"u"?{}:window;function mi(e){const t=e+"Storage";try{if(Qe&&Qe[t]&&typeof Qe[t].length=="number")return Qe[t]}catch{}Ze[e]=!1}function vi(e,t){const n=mi(e);if(!n)return;const o=go(n,"iconify-version");if(o!=="iconify2"){if(o){const a=yo(n);for(let l=0;l<a;l++)pi(n,"iconify"+l.toString())}return mo(n,"iconify-version","iconify2"),void vo(n,0)}const r=Math.floor(Date.now()/36e5)-168,i=a=>{const l="iconify"+a.toString(),d=go(n,l);if(typeof d=="string"){try{const w=JSON.parse(d);if(typeof w=="object"&&typeof w.cached=="number"&&w.cached>r&&typeof w.provider=="string"&&typeof w.data=="object"&&typeof w.data.prefix=="string"&&t(w,a))return!0}catch{}pi(n,l)}};let s=yo(n);for(let a=s-1;a>=0;a--)i(a)||(a===s-1?(s--,vo(n,s)):gi[e].add(a))}function yi(){if(!wo){wo=!0;for(const e in Ze)vi(e,t=>{const n=t.data,o=Ut(t.provider,n.prefix);if(!so(o,n).length)return!1;const r=n.lastModified||-1;return o.lastModifiedCached=o.lastModifiedCached?Math.min(o.lastModifiedCached,r):r,!0})}}function Cl(e,t){function n(o){let r;if(!Ze[o]||!(r=mi(o)))return;const i=gi[o];let s;if(i.size)i.delete(s=Array.from(i).shift());else if(s=yo(r),s>=50||!vo(r,s+1))return;const a={cached:Math.floor(Date.now()/36e5),provider:e.provider,data:t};return mo(r,"iconify"+s.toString(),JSON.stringify(a))}wo||yi(),t.lastModified&&!function(o,r){const i=o.lastModifiedCached;if(i&&i>=r)return i===r;if(o.lastModifiedCached=r,i)for(const s in Ze)vi(s,a=>{const l=a.data;return a.provider!==o.provider||l.prefix!==o.prefix||l.lastModified===r});return!0}(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&delete(t=Object.assign({},t)).not_found,n("local")||n("session"))}function wi(){}function El(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,function(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout(()=>{t.pendingCallbacksFlag=!1;const n=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!n.length)return;let o=!1;const r=t.provider,i=t.prefix;n.forEach(s=>{const a=s.icons,l=a.pending.length;a.pending=a.pending.filter(d=>{if(d.prefix!==i)return!0;const w=d.name;if(t.icons[w])a.loaded.push({provider:r,prefix:i,name:w});else{if(!t.missing.has(w))return o=!0,!0;a.missing.push({provider:r,prefix:i,name:w})}return!1}),a.pending.length!==l&&(o||hi([t],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}(e)}))}const xl=(e,t)=>{const n=function(l,d=!0,w=!1){const _=[];return l.forEach(x=>{const P=typeof x=="string"?Ve(x,d,w):x;P&&_.push(P)}),_}(e,!0,si()),o=function(l){const d={loaded:[],missing:[],pending:[]},w=Object.create(null);l.sort((x,P)=>x.provider!==P.provider?x.provider.localeCompare(P.provider):x.prefix!==P.prefix?x.prefix.localeCompare(P.prefix):x.name.localeCompare(P.name));let _={provider:"",prefix:"",name:""};return l.forEach(x=>{if(_.name===x.name&&_.prefix===x.prefix&&_.provider===x.provider)return;_=x;const P=x.provider,I=x.prefix,y=x.name,u=w[P]||(w[P]=Object.create(null)),p=u[I]||(u[I]=Ut(P,I));let v;v=y in p.icons?d.loaded:I===""||p.missing.has(y)?d.missing:d.pending;const h={provider:P,prefix:I,name:y};v.push(h)}),d}(n);if(!o.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(o.loaded,o.missing,o.pending,wi)}),()=>{l=!1}}const r=Object.create(null),i=[];let s,a;return o.pending.forEach(l=>{const{provider:d,prefix:w}=l;if(w===a&&d===s)return;s=d,a=w,i.push(Ut(d,w));const _=r[d]||(r[d]=Object.create(null));_[w]||(_[w]=[])}),o.pending.forEach(l=>{const{provider:d,prefix:w,name:_}=l,x=Ut(d,w),P=x.pendingIcons||(x.pendingIcons=new Set);P.has(_)||(P.add(_),r[d][w].push(_))}),i.forEach(l=>{const{provider:d,prefix:w}=l;r[d][w].length&&function(_,x){_.iconsToLoad?_.iconsToLoad=_.iconsToLoad.concat(x).sort():_.iconsToLoad=x,_.iconsQueueFlag||(_.iconsQueueFlag=!0,setTimeout(()=>{_.iconsQueueFlag=!1;const{provider:P,prefix:I}=_,y=_.iconsToLoad;let u;delete _.iconsToLoad,y&&(u=co(P))&&u.prepare(P,I,y).forEach(p=>{Sl(P,p,v=>{if(typeof v!="object")p.icons.forEach(h=>{_.missing.add(h)});else try{const h=so(_,v);if(!h.length)return;const f=_.pendingIcons;f&&h.forEach(L=>{f.delete(L)}),Cl(_,v)}catch(h){console.error(h)}El(_)})})}))}(l,r[d][w])}),t?function(l,d,w){const _=wl++,x=hi.bind(null,w,_);if(!d.pending.length)return x;const P={id:_,icons:d,callback:l,abort:x};return w.forEach(I=>{(I.loaderCallbacks||(I.loaderCallbacks=[])).push(P)}),x}(t,o,i):wi},kl=/[\s,]+/;function Il(e,t){t.split(kl).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0}})}function Tl(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function o(r){for(;r<0;)r+=4;return r%4}if(n===""){const r=parseInt(e);return isNaN(r)?0:o(r)}if(n!==e){let r=0;switch(n){case"%":r=25;break;case"deg":r=90}if(r){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=r,i%1==0?o(i):0)}}return t}const bi={...ci,inline:!1},Rl={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Ml={display:"inline-block"},bo={backgroundColor:"currentColor"},_i={backgroundColor:"transparent"},Si={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Ci={webkitMask:bo,mask:bo,background:_i};for(const e in Ci){const t=Ci[e];for(const n in Si)t[e+n]=Si[n]}const tn={};function Ei(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}["horizontal","vertical"].forEach(e=>{const t=e.slice(0,1)+"Flip";tn[e+"-flip"]=t,tn[e.slice(0,1)+"-flip"]=t,tn[e+"Flip"]=t});const xi=(e,t)=>{const n=function(u,p){const v={...u};for(const h in p){const f=p[h],L=typeof f;h in ai?(f===null||f&&(L==="string"||L==="number"))&&(v[h]=f):L===typeof v[h]&&(v[h]=h==="rotate"?f%4:f)}return v}(bi,t),o={...Rl},r=t.mode||"svg",i={},s=t.style,a=typeof s!="object"||s instanceof Array?{}:s;for(let u in t){const p=t[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"&&Il(n,p);break;case"color":i.color=p;break;case"rotate":typeof p=="string"?n[u]=Tl(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=tn[u];v?p!==!0&&p!=="true"&&p!==1||(n[v]=!0):bi[u]===void 0&&(o[u]=p)}}}const l=function(u,p){const v={...Ye,...u},h={...ci,...p},f={left:v.left,top:v.top,width:v.width,height:v.height};let L=v.body;[v,h].forEach(Z=>{const Q=[],bt=Z.hFlip,Ht=Z.vFlip;let et,_t=Z.rotate;switch(bt?Ht?_t+=2:(Q.push("translate("+(f.width+f.left).toString()+" "+(0-f.top).toString()+")"),Q.push("scale(-1 1)"),f.top=f.left=0):Ht&&(Q.push("translate("+(0-f.left).toString()+" "+(f.height+f.top).toString()+")"),Q.push("scale(1 -1)"),f.top=f.left=0),_t<0&&(_t-=4*Math.floor(_t/4)),_t%=4,_t){case 1:et=f.height/2+f.top,Q.unshift("rotate(90 "+et.toString()+" "+et.toString()+")");break;case 2:Q.unshift("rotate(180 "+(f.width/2+f.left).toString()+" "+(f.height/2+f.top).toString()+")");break;case 3:et=f.width/2+f.left,Q.unshift("rotate(-90 "+et.toString()+" "+et.toString()+")")}_t%2==1&&(f.left!==f.top&&(et=f.left,f.left=f.top,f.top=et),f.width!==f.height&&(et=f.width,f.width=f.height,f.height=et)),Q.length&&(L=function(sn,an,cn){const ge=function(vt,me="defs"){let ve="";const te=vt.indexOf("<"+me);for(;te>=0;){const ye=vt.indexOf(">",te),ee=vt.indexOf("</"+me);if(ye===-1||ee===-1)break;const yt=vt.indexOf(">",ee);if(yt===-1)break;ve+=vt.slice(ye+1,ee).trim(),vt=vt.slice(0,te).trim()+vt.slice(yt+1)}return{defs:ve,content:vt}}(sn);return Zt=ge.defs,Qt=an+ge.content+cn,Zt?"<defs>"+Zt+"</defs>"+Qt:Qt;var Zt,Qt}(L,'<g transform="'+Q.join(" ")+'">',"</g>"))});const A=h.width,D=h.height,$=f.width,j=f.height;let U,T;A===null?(T=D===null?"1em":D==="auto"?j:D,U=li(T,$/j)):(U=A==="auto"?$:A,T=D===null?li(U,j/$):D==="auto"?j:D);const O={},q=(Z,Q)=>{(bt=>bt==="unset"||bt==="undefined"||bt==="none")(Q)||(O[Z]=Q.toString())};q("width",U),q("height",T);const rt=[f.left,f.top,$,j];return O.viewBox=rt.join(" "),{attributes:O,viewBox:rt,body:L}}(e,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=t.id;return typeof p=="string"&&(p=p.replace(/-/g,"_")),o.innerHTML=function(v,h=gl){const f=[];let L;for(;L=pl.exec(v);)f.push(L[1]);if(!f.length)return v;const A="suffix"+(16777216*Math.random()|Date.now()).toString(16);return f.forEach(D=>{const $=typeof h=="function"?h(D):h+(ml++).toString(),j=D.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");v=v.replace(new RegExp('([#;"])('+j+')([")]|\\.[a-z])',"g"),"$1"+$+A+"$3")}),v=v.replace(new RegExp(A,"g"),"")}(l.body,p?()=>p+"ID"+u++:"iconifyVue"),yn("svg",o)}const{body:w,width:_,height:x}=e,P=r==="mask"||r!=="bg"&&w.indexOf("currentColor")!==-1,I=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>"}(w,{...d,width:_+"",height:x+""});var y;return o.style={...i,"--svg":(y=I,'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)}(y)+'")'),width:Ei(d.width),height:Ei(d.height),...Ml,...P?bo:_i,...a},yn("span",o)};var ki;if(si(!0),ki=yl,ao[""]=ki,typeof document<"u"&&typeof window<"u"){yi();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!hl(o))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const o="IconifyProviders["+n+"] is invalid.";try{const r=t[n];if(typeof r!="object"||!r||r.resources===void 0)continue;vl(n,r)||console.error(o)}catch{console.error(o)}}}}const Pl={...Ye,body:""},_o=Mt({inheritAttrs:!1,data:()=>({_name:"",_loadingIcon:null,iconMounted:!1,counter:0}),mounted(){this.iconMounted=!0},unmounted(){this.abortLoading()},methods:{abortLoading(){this._loadingIcon&&(this._loadingIcon.abort(),this._loadingIcon=null)},getIcon(e,t){if(typeof e=="object"&&e!==null&&typeof e.body=="string")return this._name="",this.abortLoading(),{data:e};let n;if(typeof e!="string"||(n=Ve(e,!1,!0))===null)return this.abortLoading(),null;const o=function(i){const s=typeof i=="string"?Ve(i,!0,le):i;if(s){const a=Ut(s.provider,s.prefix),l=s.name;return a.icons[l]||(a.missing.has(l)?null:void 0)}}(n);if(!o)return this._loadingIcon&&this._loadingIcon.name===e||(this.abortLoading(),this._name="",o!==null&&(this._loadingIcon={name:e,abort:xl([n],()=>{this.counter++})})),null;this.abortLoading(),this._name!==e&&(this._name=e,t&&t(e));const r=["iconify"];return n.prefix!==""&&r.push("iconify--"+n.prefix),n.provider!==""&&r.push("iconify--"+n.provider),{data:o,classes:r}}},render(){this.counter;const e=this.$attrs,t=this.iconMounted||e.ssr?this.getIcon(e.icon,e.onLoad):null;if(!t)return xi(Pl,e);let n=e;return t.classes&&(n={...e,class:(typeof e.class=="string"?e.class+" ":"")+t.classes.join(" ")}),xi({...Ye,...t.data},n)}}),Yt=new Map,ue=K(new Map);class he{static addWindowPanel(t){Yt.set(t.id,t)}static removeWindowPanel(t){Yt.has(t)&&(Yt.delete(t),ue.value.delete(t))}static minimizeWindowPanel(t){Yt.has(t)&&ue.value.set(t,-1)}static openWindowPanel(t){Yt.has(t)&&ue.value.set(t,1)}}const zl=["src"],Ll={key:1,class:"paneltitle"},Al={class:"dragPanelBar"},Dl={class:"dragPanelContent"},$l={class:"drag-pointer-group"},Nl=(e=>(Rs("data-v-39ea9741"),e=e(),Ms(),e))(()=>Y("span",{style:{"pointer-events":"all",visibility:"hidden"}},null,-1));var So=Mt({__name:"XWindow",props:{top:{type:[String,Number],default:0},left:{type:[String,Number],default:0},nWidth:{type:[String,Number],default:"300px"},nHeight:{type:[String,Number],default:"400px"},icon:{type:String,default:"img/logo.png"},title:{type:String,default:""},titleHeight:{type:[String,Number],default:"40px"},hasMin:{type:Boolean,default:!0},hasMax:{type:Boolean,default:!1},hasClose:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},pid:{type:String,default:""},tag:{type:[String,Array,Object,Number],default:""}},emits:["close","open","loaded","minimize"],setup(e,{expose:t,emit:n}){const o=ur(),r=e,i=n,s=K(),a=K(),l=Vt(()=>r.isDark),d=K({x:0,y:0}),w=250,_=100,x=K({width:0,height:0}),P=T=>{s.value&&(s.value.style.left=`${T.x}px`,s.value.style.top=`${T.y}px`)};Pt(()=>d.value,T=>{P(T)});const I=T=>{s.value&&(s.value.style.width=`${T.width}px`,s.value.style.height=`${T.height}px`)};Pt(()=>x.value,T=>{I(T)});const y={eventListenerController:null,startingEdges:null,newEdges:null,clickStart:null,mount:()=>{Object.entries(y.refs).forEach(([T,O])=>{O.value&&O.value.addEventListener("mousedown",q=>{y.mouseDown(q,T)})})},mouseDown:(T,O)=>{T.button==0&&(T.preventDefault(),y.startingEdges={left:d.value.x,top:d.value.y,right:d.value.x+x.value.width,bottom:d.value.y+x.value.height},y.newEdges={...y.startingEdges},y.clickStart={x:T.clientX,y:T.clientY},y.eventListenerController=new AbortController,document.addEventListener("mousemove",q=>{y.mouseMove(q,O)},{signal:y.eventListenerController.signal}),document.addEventListener("mouseup",q=>{y.mouseUp(q,O)},{signal:y.eventListenerController.signal}))},mouseMove:(T,O)=>{if(y.startingEdges!=null&&y.newEdges!=null&&y.clickStart!=null&&y.refs[O].value){if(T.preventDefault(),console.log("mouseMove",O),O.toLowerCase().includes("north")){y.newEdges.top=Math.max(y.startingEdges.top+T.clientY-y.clickStart.y,0);const q=y.newEdges.bottom-y.newEdges.top-_;q<0&&(y.newEdges.top+=q)}else O.toLowerCase().includes("south")&&(y.newEdges.bottom=Math.min(y.startingEdges.bottom+T.clientY-y.clickStart.y,document.body.clientHeight));if(O.toLowerCase().includes("west")){y.newEdges.left=Math.max(y.startingEdges.left+T.clientX-y.clickStart.x,0);const q=y.newEdges.right-y.newEdges.left-w;q<0&&(y.newEdges.left+=q)}else O.toLowerCase().includes("east")&&(y.newEdges.right=Math.min(y.startingEdges.right+T.clientX-y.clickStart.x,document.body.clientWidth));y.update()}},update:()=>{y.newEdges==null||y.startingEdges==null||(d.value={x:Math.max(y.newEdges.left,0),y:Math.max(y.newEdges.top,0)},x.value={width:Math.min(Math.max(y.newEdges.right-y.newEdges.left,w),document.body.clientWidth),height:Math.min(Math.max(y.newEdges.bottom-y.newEdges.top,_),document.body.clientHeight)})},mouseUp:(T,O)=>{T.button!=0||y.startingEdges==null||(console.log("mouseUp",O),T.preventDefault(),y.startingEdges=null,y.newEdges=null,y.clickStart=null,y.eventListenerController&&(y.eventListenerController.abort(),y.eventListenerController=null))},refs:{northWest:K(null),north:K(null),northEast:K(null),west:K(null),east:K(null),southWest:K(null),south:K(null),southEast:K(null)}},u={startingMouse:null,startingPosition:null,mouseDown:T=>{T.button==0&&(T.preventDefault(),console.log("mouseDown"),u.startingMouse={x:T.clientX,y:T.clientY},u.startingPosition=d.value,document.addEventListener("mousemove",u.mouseMove),document.addEventListener("mouseup",u.mouseUp))},mouseMove:T=>{!u.startingMouse||!u.startingPosition||(T.preventDefault(),d.value={x:Math.min(Math.max(u.startingPosition.x+T.clientX-u.startingMouse.x,0),document.body.clientWidth-x.value.width),y:Math.min(Math.max(u.startingPosition.y+T.clientY-u.startingMouse.y,0),document.body.clientHeight-x.value.height)})},mouseUp:T=>{T.button!=0||!u.startingMouse||!u.startingPosition||(T.preventDefault(),u.startingMouse=null,u.startingPosition=null,console.log("mouseUp"),document.removeEventListener("mousemove",u.mouseMove),document.removeEventListener("mouseup",u.mouseUp))}};function p(T){return{id:o,icon:r.icon,title:r.title,pid:r.pid,data:T??r.tag}}const v=Vt(()=>ue.value.get(o)!==-1),h=K(!1),f=K(!0);function L(){i("minimize",p()),he.minimizeWindowPanel(o)}function A(){h.value=!h.value}function D(){i("close",p(!1)),he.removeWindowPanel(o),f.value=!1}const $=Vt(()=>h.value?"heroicons-outline:square-2-stack":"ant-design:border-outlined"),j={id:o,isShow:v,close:D,open:function(){i("open",p(!0)),f.value=!0},showHidePanel:L};function U(T){if(zn(T))return T;{const O=Number(T);if(O==O)return O;if(T.endsWith("px")){const q=T.substring(0,T.length-2);return Number(q)}if(T.endsWith("%")){const q=T.substring(0,T.length-1);return Number(q)/100*document.body.clientWidth}return 300}}return t(j),wn(()=>{(function(){let T=90;if(r.hasMin||(T-=30),r.hasMax||(T-=30),r.hasClose||(T-=30),dt.setCssVar("--right-bar-width",T+"px",a.value),!a.value)return;const O=zn(r.titleHeight)?r.titleHeight+"px":r.titleHeight;a.value.style.height=O,a.value.style.lineHeight=O})(),function(){const T=p(j);he.addWindowPanel(T),i("loaded",T)}(),d.value.x=U(r.left),d.value.y=U(r.top),P(d.value),x.value={width:U(r.nWidth),height:U(r.nHeight)},I(x.value),y.mount()}),Is(()=>{he.removeWindowPanel(o)}),(T,O)=>(X(),at(_n,{appear:"","enter-active-class":"animated zoomIn","leave-active-class":"animated zoomOut"},{default:It(()=>[f.value?or((X(),pt("div",{key:0,ref_key:"dragPanelRef",ref:s,class:Ts(["dragWindowPanel",{maxPanel:h.value,dragWindowPanel_dark:l.value}])},[Y("div",{class:"dragPanelTitle",ref_key:"dragPanelTitleRef",ref:a,onMousedown:O[0]||(O[0]=(...q)=>u.mouseDown&&u.mouseDown(...q))},[st(T.$slots,"title",{},()=>[r.icon?(X(),pt("img",{key:0,src:r.icon,width:"24",height:"24"},null,8,zl)):mt("v-if",!0),r.title?(X(),pt("span",Ll,Cn(r.title),1)):mt("v-if",!0)]),Y("div",Al,[e.hasMin?(X(),at(xn(_o),{key:0,icon:"ant-design:minus-outlined",onClick:L})):mt("v-if",!0),e.hasMax?(X(),at(xn(_o),{key:1,icon:$.value,onClick:A},null,8,["icon"])):mt("v-if",!0),e.hasClose?(X(),at(xn(_o),{key:2,icon:"ant-design:close-outlined",onClick:D})):mt("v-if",!0)])],544),Y("div",Dl,[st(T.$slots,"default")]),Y("div",$l,[Y("div",{class:"cursor-nw-resize",ref:y.refs.northWest},null,512),Y("div",{class:"cursor-n-resize",ref:y.refs.north},null,512),Y("div",{class:"cursor-ne-resize",ref:y.refs.northEast},null,512),Y("div",{class:"cursor-w-resize",ref:y.refs.west},null,512),Nl,Y("div",{class:"cursor-e-resize",ref:y.refs.east},null,512),Y("div",{class:"cursor-sw-resize",ref:y.refs.southWest},null,512),Y("div",{class:"cursor-s-resize",ref:y.refs.south},null,512),Y("div",{class:"cursor-se-resize",ref:y.refs.southEast},null,512)])],2)),[[rr,v.value]]):mt("v-if",!0)]),_:3}))}});function Bl(e){const t=new As(new _e);return t.serialize(e),t.stream.toString()}function jl(e){return e==null||e===""?e:new Ds(new _e(e)).deserialize()}So.__scopeId="data-v-39ea9741",So.__file="src/controls/xwindow/XWindow.vue";const en=new Map,Co=new Map;let nn;const Ol={getDefaultClient(){if(nn||(nn=new oe(SysConfig.DefaultHproseAPI)),!nn)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return nn},registerHprose(e,t){const n=Co.get(e);if(!n){const o=new oe(t);en.set(e,o)}return n},getHprose:e=>Co?.get(e),getProxyHprose:e=>en.get(e),unregisterHprose(e){en.get(e)&&(Co.delete(e),en.delete(e))}},Wl=5e3,Ul=36e5,Ft={Login:"/api/User/Login",ChangeMyPwd:"/api/User/ChangeMyPwd",Logout:"/api/Check/ExitLogin",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken",GetSystemRights:"/api/System/GetSystem"},Eo="access_token",Fl=B.Config.ServiceURL.LoginAuthURL;function xo(){const e=_r();e&&Et(Ft.RefreshToken,Fl,{refreshToken:e}).then(t=>{ko(t.data)})}function Ii(){const e=Ct.getJsonObject(Eo);if(!e)return;const t=new Date().getTime(),n=new Date(e.expire).getTime()-t;n>0&&(n<=5e3?xo():setTimeout(xo,n-5e3))}function ko(e){const t=new Date().getTime();let n=new Date(e.accessToken.expires).getTime()-t;if(n>=36e5?(n=18e5,console.warn("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u8FC7\u53BB\u65F6\u95F4\uFF01")):n<-6e5&&(n=18e5,console.warn("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u672A\u6765\u65F6\u95F4\uFF01")),n>0){let o=Nt();o?(o.token=e.accessToken.tokenContent,o.expire=e.accessToken.expires,o.refresh=e.refreshToken.tokenContent):o={token:e.accessToken.tokenContent,expire:e.accessToken.expires,refresh:e.refreshToken.tokenContent},Ct.set(Eo,o,n/1e3),Ii()}else Ct.remove(Eo)}const on="Wm314243",rn=B.Config.ServiceURL.LoginAuthURL;async function Hl(e){const t={username:e.username,pwd:ie.encryptToString(e.pwd,on)},n=(await Et(Ft.Login,rn,t))?.data;return n&&ko(n.doubletoken),n}function ql(e){const t={oldpwd:ie.encryptToString(e.oldpwd,on),newpwd:ie.encryptToString(e.newpwd,on)};return Et(Ft.ChangeMyPwd,rn,t)}function Xl(e){return ie.encryptToString(e,on)}function Vl(){const e=Nt();e&&(Cr(Ft.Logout,rn,{token:e.token,reftoken:e.refresh}),Fn())}function Gl(e){return Et(Ft.CheckToken,rn,{token:e})}const Io="ROLE_SYSTEM_RIGHT",To=new Me("",sessionStorage);function Ti(){return To.get(Io)}function Ro(e){To.set(Io,e)}function Ri(){To.remove(Io)}function Jt(e){if(e)for(let t=0;t<e.length;t++){const n=e[t];n.children&&n.children.length>0?(Jt(n.children),n.children.length===0&&(e.splice(t,1),t--)):n.selected||(e.splice(t,1),t--)}}function Mi(e,t,n="name"){e&&t&&e.forEach(o=>{const r=t.find(i=>i[n]===o[n]);r&&(o.children?r.children&&Mi(o.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(o.selected=r.selected))})}function Pi(e,t,n="name"){e&&t&&e.forEach(o=>{const r=t.find(i=>i[n]===o[n]);r&&(o.children?r.children&&Pi(o.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(o.selected=r.selected))})}function de(e,t,n,o="name"){const r=e[n],i=t[n];r?i&&Pi(r,i,o):i&&(e[n]=i)}function zi(e){if(e&&e.length>0){const t=e.length;let n,o=!1;if(t>0){o=Lt(e[0]);const r=o?e[0]:JSON.parse(e[0]);if(t>1)for(let i=1;i<e.length;i++){const s=e[i],a=o?s:JSON.parse(s);de(r,a,"routes","name"),de(r,a,"widgetMenu","name"),de(r,a,"widgets","id"),de(r,a,"functions","id")}n=r}return n&&(Jt(n.routes),Jt(n.widgetMenu),Jt(n.widgets),Jt(n.functions)),n}}const Mo=[],Po=[],zo=[];function fe(){return Ti()}async function Kl(e,t=!1){Ri();const n=Ft.GetSystemRights,o=B.Config.ServiceURL.LoginAuthURL,r=await Et(n,o,{systemid:e});if(!r||!r.data)return void B.Message?.warn("\u65E0\u6CD5\u83B7\u53D6\u529F\u80FD\u6388\u6743\u5217\u8868\uFF01");const i=r.data;if(i&&i.length>0){if(t){const s=JSON.parse(i[0]);return Ro(s),s}{const s=zi(i);return Ro(s),s}}}function Li(e,t){const n={...e};return n.meta||(n.meta={}),t.index!=null&&(n.meta.index=t.index),t.title!=null&&(n.meta.title=t.title),e.children&&(n.children=[],t.children&&t.children.forEach(o=>{const r=e.children?.find(i=>i.path===o.path);if(r){const i=Li(r,o);i&&n.children?.push(i)}})),n}function Yl(e,t=2){if(t===0)return e;const n=fe();return n&&n.routes?(zo.length>0||e.forEach(o=>{const r=n.routes?.find(i=>i.name===o.name);if(r){const i=Li(o,r);i&&zo.push(i)}}),zo):void 0}function Ai(e,t){const n={...e};return t.index!=null&&(n.index=t.index),e.children&&(n.children=[],t.children&&t.children.forEach(o=>{const r=e.children?.find(i=>i.name===o.name);if(r){const i=Ai(r,o);i&&n.children?.push(i)}})),n}function Jl(e,t=2){if(t===0)return e;const n=fe();return n&&n.widgetMenu?(Po.length>0||e.forEach(o=>{const r=n.widgetMenu?.find(i=>i.name===o.name);if(r){const i=Ai(o,r);i&&Po.push(i)}}),Po):void 0}function Zl(e,t=2){if(t===0)return e;const n=fe();return n&&n.widgets?(Mo.length>0||e?.forEach(o=>{n.widgets?.find(r=>r.id===o.id)&&Mo.push(o)}),Mo):void 0}function Ql(e,t=2){if(t===0)return e;const n=fe();return n?n.functions:void 0}export{Va as BigFileDownload,ze as Download,Sa as DownloadByUrl,Dt as EnumColor,Tr as FileUpload,Vc as GetSignalRClient,B as Global,Ol as GlobalHprose,$t as GlobalMitt,dt as H5Tool,pe as HproseClient,_a as HttpDownload,dr as JsonDownload,Xe as LayoutContainer,ut as LayoutContainerEnum,ti as LayoutManager,ue as MinWindowMap,Ga as ObjToUrlParams,In as Pane,oe as ProxyClient,oo as RouterTransition,ba as SaveAs,Ns as Splitpanes,Me as Storage,Re as StringUtils,Jc as StyleBlack,tl as StyleGrayblue,Qc as StyleMetal,Zc as StyleWhite,qe as SuspenseWithError,ct as SysEvents,Wl as TOKEN_REFRESH_TIME,Ul as TOKEN_VALID_TIMESPAN,Ft as USER_TOKEN_API,He as VWindow,_c as WaterMark,Zr as WindowResizeEvent,el as WindowType,Yt as WindowsMap,So as XWindow,he as XWindowManager,ie as XXTEA,wa as calculateBestTextColor,ql as changeMyPWD,Ii as checkDoRefreshToken,Gl as checkToken,Fn as clearLocalToken,Ri as clearRight,ma as colorIsDark,Ba as createFileUpload,va as darken,Ar as deepMerge,pr as delay,jl as deserialize,xo as doRefreshToken,Dr as exportSystemRights,Ea as get,fe as getCurrentSystemRight,ka as getData,Xl as getEncryptPWD,Ql as getFunctions,ua as getHexColor,Nt as getLocalToken,Ua as getLockState,da as getLongHexColor,Rr as getProxyClient,ha as getRGBColor,pa as getRGBColorFromHSLA,_r as getRefreshToken,Ti as getRight,Yl as getRoutes,Kl as getSystemRoleRight,Zl as getWidgetConfig,Jl as getWidgetMenus,Jt as handleNodes,Nn as hexToRGB,Oa as init,Wa as initDefaultProxyClient,ht as is,Ln as isArray,Xs as isAsyncFunction,Gs as isBoolean,Ks as isClient,qs as isDate,lr as isDef,Js as isElement,ta as isEmpty,fa as isEnumColor,ea as isError,ke as isFunction,Pe as isHexColor,Qs as isImageDom,ia as isMap,Pn as isNull,Fs as isNullAndUnDef,Hs as isNullOrUnDef,zn as isNumber,Lt as isObjectX,Vs as isPromise,Zs as isServer,Ie as isString,ra as isSymbol,Mn as isUnDef,sa as isValidURL,oa as isWeakMap,na as isWeakSet,Ys as isWindow,ja as jquery,ya as lighten,Hl as login,Vl as logout,zi as mergeFilterRoleSysRight,Mi as mergeNodes,de as mergeNodesAll,la as newGuid,Fa as onLockListener,xa as post,Et as requestGet,Sr as requestPost,Cr as requestPostBody,ga as rgbToHex,Bl as serialize,ko as setLocalToken,Ro as setRight,Ca as sleep,ca as storage,Ct as storageHelper,Ha as unLockListener,ur as uuid,tc as verifiyNumberInteger,lc as verifyAccount,oc as verifyAndSpace,wc as verifyCarNum,ec as verifyCnAndSpace,pc as verifyEmail,nc as verifyEnAndSpace,mc as verifyFullName,fc as verifyIPAddress,gc as verifyIdCard,sc as verifyNumberCnUppercase,rc as verifyNumberComma,Zn as verifyNumberIntegerAndFloat,Za as verifyNumberPercentage,Qa as verifyNumberPercentageFloat,uc as verifyPassword,hc as verifyPasswordPowerful,dc as verifyPasswordStrength,ac as verifyPhone,vc as verifyPostalCode,cc as verifyTelPhone,ic as verifyTextColor,yc as verifyUrl,Ya as writeIconifyList,Ja as writeSysRoleRight};
|
|
12
|
+
`,De(n+o+"export default iconlist;","IconifyList.ts"))}function rc(e,t){const n=Vr(e);yr(n,t),j.Message?.msg("\u5BFC\u51FA\u7CFB\u7EDF\u529F\u80FD\u6743\u9650\u6587\u4EF6\u6210\u529F\uFF01")}function ic(e){let t=e.replace(/(^\s*)|(\s*$)/g,"");return t=t.replace(/[^\d]/g,""),t=t.replace(/^0/g,""),t=t.replace(/^[1-9]\d\d{1,3}$/,"100"),t}function sc(e){let t=to(e);return t=t.replace(/^[1-9]\d\d{1,3}$/,"100"),t=t.replace(/^100\.$/,"100"),t}function to(e){let t=e.replace(/(^\s*)|(\s*$)/g,"");return t=t.replace(/[^\d.]/g,""),t=t.replace(/^0{2}$/g,"0"),t=t.replace(/^\./g,""),t=t.replace(".","$#$").replace(/\./g,"").replace("$#$","."),t=t.replace(/^(\-)*(\d+)\.(\d\d).*$/,"$1$2.$3"),t}function ac(e){let t=e.replace(/(^\s*)|(\s*$)/g,"");return t=t.replace(/[\.]*/g,""),t=t.replace(/(^0[\d]*)$/g,"0"),t=t.replace(/^0\d$/g,"0"),t=t.replace(/[^\d]/g,""),t}function cc(e){let t=e.replace(/[\u4e00-\u9fa5\s]+/g,"");return t=t.replace(/(^\s*)|(\s*$)/g,""),t}function lc(e){let t=e.replace(/[a-zA-Z]+/g,"");return t=t.replace(/(^\s*)|(\s*$)/g,""),t}function uc(e){return e.replace(/(^\s*)|(\s*$)/g,"")}function hc(e){let t=to(e);return t=t.toString().split("."),t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t=t.join("."),t}function dc(e,t="",n="red"){return t.replace(new RegExp(e,"gi"),`<span style='color: ${n}'>${e}</span>`)}function fc(e,t="\u4EDF\u4F70\u62FE\u4EBF\u4EDF\u4F70\u62FE\u4E07\u4EDF\u4F70\u62FE\u5143\u89D2\u5206",n=""){let o=(e+="00").indexOf(".");o>=0&&(e=e.substring(0,o)+e.substr(o+1,2)),t=t.substr(t.length-e.length);for(let r=0;r<e.length;r++)n+="\u96F6\u58F9\u8D30\u53C1\u8086\u4F0D\u9646\u67D2\u634C\u7396".substr(e.substr(r,1),1)+t.substr(r,1);return n=n.replace(/零角零分$/,"\u6574").replace(/零[仟佰拾]/g,"\u96F6").replace(/零{2,}/g,"\u96F6").replace(/零([亿|万])/g,"$1").replace(/零+元/,"\u5143").replace(/亿零{0,3}万/,"\u4EBF").replace(/^元/,"\u96F6\u5143")}function pc(e){return!!/^((12[0-9])|(13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0|1,5-9]))\d{8}$/.test(e)}function gc(e){return!!/\d{3}-\d{8}|\d{4}-\d{7}/.test(e)}function mc(e){return!!/^[a-zA-Z][a-zA-Z0-9_]{4,15}$/.test(e)}function vc(e){return!!/^[a-zA-Z]\w{5,15}$/.test(e)}function yc(e){return!!/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(e)}function wc(e){let t="";return/^(?:\d+|[a-zA-Z]+|[!@#$%^&\.*]+){6,16}$/.test(e)&&(t="\u5F31"),/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(e)&&(t="\u4E2D"),/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(e)&&(t="\u5F3A"),t}function bc(e){return!!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(e)}function _c(e){return!!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}function Sc(e){return!!/^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(e)}function Cc(e){return!!/^[\u4e00-\u9fa5]{1,6}(·[\u4e00-\u9fa5]{1,6}){0,2}$/.test(e)}function Ec(e){return!!/^[1-9][0-9]{5}$/.test(e)}function xc(e){return!!/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(e)}function kc(e){return!!/^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/.test(e)}let Jr=!0;try{String.fromCharCode.apply(String,[1,2])}catch{Jr=!1,Object.defineProperty(Array.prototype,"subarray",{value:Array.prototype.slice})}var eo=2654435769;function Yr(e,t){var n=e.length,o=n<<2;if(t){var r=e[n-1];if(r<(o-=4)-3||r>o)return null;o=r}for(var i=new Uint8Array(o),s=0;s<o;++s)i[s]=e[s>>2]>>((3&s)<<3);return i}function je(e,t){var n,o=e.length,r=o>>2;3&o&&++r,t?(n=new Uint32Array(r+1))[r]=o:n=new Uint32Array(r);for(var i=0;i<o;++i)n[i>>2]|=e[i]<<((3&i)<<3);return n}function Bt(e){return 4294967295&e}function Oe(e,t,n,o,r,i){return(n>>>5^t<<2)+(t>>>3^n<<4)^(e^t)+(i[3&o^r]^n)}function Zr(e){if(e.length<16){var t=new Uint8Array(16);t.set(e),e=t}return e}function We(e){for(var t=e.length,n=new Uint8Array(3*t),o=0,r=0;r<t;r++){var i=e.charCodeAt(r);if(i<128)n[o++]=i;else if(i<2048)n[o++]=192|i>>6,n[o++]=128|63&i;else{if(!(i<55296||i>57343)){if(r+1<t){var s=e.charCodeAt(r+1);if(i<56320&&56320<=s&&s<=57343){var a=65536+((1023&i)<<10|1023&s);n[o++]=240|a>>18,n[o++]=128|a>>12&63,n[o++]=128|a>>6&63,n[o++]=128|63&a,r++;continue}}throw new Error("Malformed string")}n[o++]=224|i>>12,n[o++]=128|i>>6&63,n[o++]=128|63&i}}return n.subarray(0,o)}function Qr(e){var t=e.length;return t===0?"":t<32767?function(n,o){for(var r=new Array(o),i=0,s=0,a=n.length;i<o&&s<a;i++){var l=n[s++];switch(l>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:r[i]=l;break;case 12:case 13:if(!(s<a))throw new Error("Unfinished UTF-8 octet sequence");r[i]=(31&l)<<6|63&n[s++];break;case 14:if(!(s+1<a))throw new Error("Unfinished UTF-8 octet sequence");r[i]=(15&l)<<12|(63&n[s++])<<6|63&n[s++];break;case 15:if(!(s+2<a))throw new Error("Unfinished UTF-8 octet sequence");var h=((7&l)<<18|(63&n[s++])<<12|(63&n[s++])<<6|63&n[s++])-65536;if(!(0<=h&&h<=1048575))throw new Error("Character outside valid Unicode range: 0x"+h.toString(16));r[i++]=h>>10&1023|55296,r[i]=1023&h|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+l.toString(16))}}return i<o&&(r.length=i),String.fromCharCode.apply(String,r)}(e,t):function(n,o){for(var r=[],i=new Array(32768),s=0,a=0,l=n.length;s<o&&a<l;s++){var h=n[a++];switch(h>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:i[s]=h;break;case 12:case 13:if(!(a<l))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(31&h)<<6|63&n[a++];break;case 14:if(!(a+1<l))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(15&h)<<12|(63&n[a++])<<6|63&n[a++];break;case 15:if(!(a+2<l))throw new Error("Unfinished UTF-8 octet sequence");var w=((7&h)<<18|(63&n[a++])<<12|(63&n[a++])<<6|63&n[a++])-65536;if(!(0<=w&&w<=1048575))throw new Error("Character outside valid Unicode range: 0x"+w.toString(16));i[s++]=w>>10&1023|55296,i[s]=1023&w|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+h.toString(16))}if(s>=32766){var _=s+1;i.length=_,r.push(String.fromCharCode.apply(String,i)),o-=_,s=-1}}return s>0&&(i.length=s,r.push(String.fromCharCode.apply(String,i))),r.join("")}(e,t)}function Ic(e){var t=e.length;if(t===0)return"";var n=Jr?e:function(a){for(var l=a.length,h=new Array(a.length),w=0;w<l;++w)h[w]=a[w];return h}(e);if(t<65535)return String.fromCharCode.apply(String,n);for(var o=32767&t,r=t>>15,i=new Array(o?r+1:r),s=0;s<r;++s)i[s]=String.fromCharCode.apply(String,n.subarray(s<<15,s+1<<15));return o&&(i[r]=String.fromCharCode.apply(String,n.subarray(r<<15,t))),i.join("")}function ti(e,t){return typeof e=="string"&&(e=We(e)),typeof t=="string"&&(t=We(t)),e==null||e.length===0?e:Yr(function(n,o){var r,i,s,a,l,h,w=n.length,_=w-1;for(i=n[_],s=0,h=0|Math.floor(6+52/w);h>0;--h){for(a=(s=Bt(s+eo))>>>2&3,l=0;l<_;++l)r=n[l+1],i=n[l]=Bt(n[l]+Oe(s,r,i,l,a,o));r=n[0],i=n[_]=Bt(n[_]+Oe(s,r,i,_,a,o))}return n}(je(e,!0),je(Zr(t),!1)),!1)}function ei(e,t){return typeof e=="string"&&(e=function(n){for(var o=window.atob(n),r=o.length,i=new Uint8Array(r),s=0;s<r;s++)i[s]=o.charCodeAt(s);return i}(e)),typeof t=="string"&&(t=We(t)),e==null||e.length===0?e:Yr(function(n,o){var r,i,s,a,l,h=n.length,w=h-1;for(r=n[0],s=Bt(Math.floor(6+52/h)*eo);s!==0;s=Bt(s-eo)){for(a=s>>>2&3,l=w;l>0;--l)i=n[l-1],r=n[l]=Bt(n[l]-Oe(s,r,i,l,a,o));i=n[w],r=n[0]=Bt(n[0]-Oe(s,r,i,0,a,o))}return n}(je(e,!1),je(Zr(t),!1)),!0)}const ie={toBytes:We,toString:Qr,encrypt:ti,encryptToString:function(e,t){return window.btoa(Ic(ti(e,t)))},decrypt:ei,decryptToString:function(e,t){return Qr(ei(e,t))}},ni=e=>{const t="1.23452384164.123412416";document.getElementById(t)!==null&&document.body.removeChild(document.getElementById(t));const n=document.createElement("canvas");n.width=200,n.height=130;const o=n.getContext("2d");o.rotate(-20*Math.PI/180),o.font="12px Vedana",o.fillStyle="rgba(200, 200, 200, 0.30)",o.textBaseline="middle",o.fillText(e,n.width/10,n.height/2);const r=document.createElement("div");return r.id=t,r.style.pointerEvents="none",r.style.top="0px",r.style.left="0px",r.style.position="fixed",r.style.zIndex="10000000",r.style.width=`${document.documentElement.clientWidth}px`,r.style.height=`${document.documentElement.clientHeight}px`,r.style.background=`url(${n.toDataURL("image/png")}) left top repeat`,document.body.appendChild(r),t},Tc={set:e=>{let t=ni(e);document.getElementById(t)===null&&(t=ni(e))},del:()=>{let e="1.23452384164.123412416";document.getElementById(e)!==null&&document.body.removeChild(document.getElementById(e))}};class jt extends Error{constructor(t,n){const o=new.target.prototype;super(`${t}: Status code '${n}'`),this.statusCode=n,this.__proto__=o}}class no extends Error{constructor(t="A timeout occurred."){const n=new.target.prototype;super(t),this.__proto__=n}}class bt extends Error{constructor(t="An abort occurred."){const n=new.target.prototype;super(t),this.__proto__=n}}class Rc extends Error{constructor(t,n){const o=new.target.prototype;super(t),this.transport=n,this.errorType="UnsupportedTransportError",this.__proto__=o}}class Mc extends Error{constructor(t,n){const o=new.target.prototype;super(t),this.transport=n,this.errorType="DisabledTransportError",this.__proto__=o}}class Pc extends Error{constructor(t,n){const o=new.target.prototype;super(t),this.transport=n,this.errorType="FailedToStartTransportError",this.__proto__=o}}class oi extends Error{constructor(t){const n=new.target.prototype;super(t),this.errorType="FailedToNegotiateWithServerError",this.__proto__=n}}class zc extends Error{constructor(t,n){const o=new.target.prototype;super(t),this.innerErrors=n,this.__proto__=o}}class ri{constructor(t,n,o){this.statusCode=t,this.statusText=n,this.content=o}}class Ue{get(t,n){return this.send({...n,method:"GET",url:t})}post(t,n){return this.send({...n,method:"POST",url:t})}delete(t,n){return this.send({...n,method:"DELETE",url:t})}getCookieString(t){return""}}var x;(function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Information=2]="Information",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Critical=5]="Critical",e[e.None=6]="None"})(x||(x={}));class se{constructor(){}log(t,n){}}se.instance=new se;class ot{static isRequired(t,n){if(t==null)throw new Error(`The '${n}' argument is required.`)}static isNotEmpty(t,n){if(!t||t.match(/^\s*$/))throw new Error(`The '${n}' argument should not be empty.`)}static isIn(t,n,o){if(!(t in n))throw new Error(`Unknown ${o} value: ${t}.`)}}class tt{static get isBrowser(){return!tt.isNode&&typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return!tt.isNode&&typeof self=="object"&&"importScripts"in self}static get isReactNative(){return!tt.isNode&&typeof window=="object"&&window.document===void 0}static get isNode(){return typeof process<"u"&&process.release&&process.release.name==="node"}}function ae(e,t){let n="";return Ot(e)?(n=`Binary data of length ${e.byteLength}`,t&&(n+=`. Content: '${function(o){const r=new Uint8Array(o);let i="";return r.forEach(s=>{i+=`0x${s<16?"0":""}${s.toString(16)} `}),i.substr(0,i.length-1)}(e)}'`)):typeof e=="string"&&(n=`String data of length ${e.length}`,t&&(n+=`. Content: '${e}'`)),n}function Ot(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&e.constructor.name==="ArrayBuffer")}async function ii(e,t,n,o,r,i){const s={},[a,l]=Kt();s[a]=l,e.log(x.Trace,`(${t} transport) sending data. ${ae(r,i.logMessageContent)}.`);const h=Ot(r)?"arraybuffer":"text",w=await n.post(o,{content:r,headers:{...s,...i.headers},responseType:h,timeout:i.timeout,withCredentials:i.withCredentials});e.log(x.Trace,`(${t} transport) request complete. Response status: ${w.statusCode}.`)}class Ac{constructor(t,n){this._subject=t,this._observer=n}dispose(){const t=this._subject.observers.indexOf(this._observer);t>-1&&this._subject.observers.splice(t,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(n=>{})}}class Fe{constructor(t){this._minLevel=t,this.out=console}log(t,n){if(t>=this._minLevel){const o=`[${new Date().toISOString()}] ${x[t]}: ${n}`;switch(t){case x.Critical:case x.Error:this.out.error(o);break;case x.Warning:this.out.warn(o);break;case x.Information:this.out.info(o);break;default:this.out.log(o)}}}}function Kt(){let e="X-SignalR-User-Agent";return tt.isNode&&(e="User-Agent"),[e,Lc("8.0.7",Dc(),Nc(),$c())]}function Lc(e,t,n,o){let r="Microsoft SignalR/";const i=e.split(".");return r+=`${i[0]}.${i[1]}`,r+=` (${e}; `,r+=t&&t!==""?`${t}; `:"Unknown OS; ",r+=`${n}`,r+=o?`; ${o}`:"; Unknown Runtime Version",r+=")",r}function Dc(){if(!tt.isNode)return"";switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}}function $c(){if(tt.isNode)return process.versions.node}function Nc(){return tt.isNode?"NodeJS":"Browser"}function oo(e){return e.stack?e.stack:e.message?e.message:`${e}`}class Bc extends Ue{constructor(t){if(super(),this._logger=t,typeof fetch>"u"||tt.isNode){const n=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._jar=new(n("tough-cookie")).CookieJar,typeof fetch>"u"?this._fetchType=n("node-fetch"):this._fetchType=fetch,this._fetchType=n("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("could not find global")}());if(typeof AbortController>"u"){const n=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._abortControllerType=n("abort-controller")}else this._abortControllerType=AbortController}async send(t){if(t.abortSignal&&t.abortSignal.aborted)throw new bt;if(!t.method)throw new Error("No method defined.");if(!t.url)throw new Error("No url defined.");const n=new this._abortControllerType;let o;t.abortSignal&&(t.abortSignal.onabort=()=>{n.abort(),o=new bt});let r,i=null;if(t.timeout){const l=t.timeout;i=setTimeout(()=>{n.abort(),this._logger.log(x.Warning,"Timeout from HTTP request."),o=new no},l)}t.content===""&&(t.content=void 0),t.content&&(t.headers=t.headers||{},Ot(t.content)?t.headers["Content-Type"]="application/octet-stream":t.headers["Content-Type"]="text/plain;charset=UTF-8");try{r=await this._fetchType(t.url,{body:t.content,cache:"no-cache",credentials:t.withCredentials===!0?"include":"same-origin",headers:{"X-Requested-With":"XMLHttpRequest",...t.headers},method:t.method,mode:"cors",redirect:"follow",signal:n.signal})}catch(l){throw o||(this._logger.log(x.Warning,`Error from HTTP request. ${l}.`),l)}finally{i&&clearTimeout(i),t.abortSignal&&(t.abortSignal.onabort=null)}if(!r.ok){const l=await si(r,"text");throw new jt(l||r.statusText,r.status)}const s=si(r,t.responseType),a=await s;return new ri(r.status,r.statusText,a)}getCookieString(t){let n="";return tt.isNode&&this._jar&&this._jar.getCookies(t,(o,r)=>n=r.join("; ")),n}}function si(e,t){let n;switch(t){case"arraybuffer":n=e.arrayBuffer();break;case"text":default:n=e.text();break;case"blob":case"document":case"json":throw new Error(`${t} is not supported.`)}return n}class jc extends Ue{constructor(t){super(),this._logger=t}send(t){return t.abortSignal&&t.abortSignal.aborted?Promise.reject(new bt):t.method?t.url?new Promise((n,o)=>{const r=new XMLHttpRequest;r.open(t.method,t.url,!0),r.withCredentials=t.withCredentials===void 0||t.withCredentials,r.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.content===""&&(t.content=void 0),t.content&&(Ot(t.content)?r.setRequestHeader("Content-Type","application/octet-stream"):r.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const i=t.headers;i&&Object.keys(i).forEach(s=>{r.setRequestHeader(s,i[s])}),t.responseType&&(r.responseType=t.responseType),t.abortSignal&&(t.abortSignal.onabort=()=>{r.abort(),o(new bt)}),t.timeout&&(r.timeout=t.timeout),r.onload=()=>{t.abortSignal&&(t.abortSignal.onabort=null),r.status>=200&&r.status<300?n(new ri(r.status,r.statusText,r.response||r.responseText)):o(new jt(r.response||r.responseText||r.statusText,r.status))},r.onerror=()=>{this._logger.log(x.Warning,`Error from HTTP request. ${r.status}: ${r.statusText}.`),o(new jt(r.statusText,r.status))},r.ontimeout=()=>{this._logger.log(x.Warning,"Timeout from HTTP request."),o(new no)},r.send(t.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class Oc extends Ue{constructor(t){if(super(),typeof fetch<"u"||tt.isNode)this._httpClient=new Bc(t);else{if(typeof XMLHttpRequest>"u")throw new Error("No usable HttpClient found.");this._httpClient=new jc(t)}}send(t){return t.abortSignal&&t.abortSignal.aborted?Promise.reject(new bt):t.method?t.url?this._httpClient.send(t):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(t){return this._httpClient.getCookieString(t)}}class mt{static write(t){return`${t}${mt.RecordSeparator}`}static parse(t){if(t[t.length-1]!==mt.RecordSeparator)throw new Error("Message is incomplete.");const n=t.split(mt.RecordSeparator);return n.pop(),n}}mt.RecordSeparatorCode=30,mt.RecordSeparator=String.fromCharCode(mt.RecordSeparatorCode);class Wc{writeHandshakeRequest(t){return mt.write(JSON.stringify(t))}parseHandshakeResponse(t){let n,o;if(Ot(t)){const s=new Uint8Array(t),a=s.indexOf(mt.RecordSeparatorCode);if(a===-1)throw new Error("Message is incomplete.");const l=a+1;n=String.fromCharCode.apply(null,Array.prototype.slice.call(s.slice(0,l))),o=s.byteLength>l?s.slice(l).buffer:null}else{const s=t,a=s.indexOf(mt.RecordSeparator);if(a===-1)throw new Error("Message is incomplete.");const l=a+1;n=s.substring(0,l),o=s.length>l?s.substring(l):null}const r=mt.parse(n),i=JSON.parse(r[0]);if(i.type)throw new Error("Expected a handshake response from the server.");return[o,i]}}var F;(function(e){e[e.Invocation=1]="Invocation",e[e.StreamItem=2]="StreamItem",e[e.Completion=3]="Completion",e[e.StreamInvocation=4]="StreamInvocation",e[e.CancelInvocation=5]="CancelInvocation",e[e.Ping=6]="Ping",e[e.Close=7]="Close",e[e.Ack=8]="Ack",e[e.Sequence=9]="Sequence"})(F||(F={}));class Uc{constructor(){this.observers=[]}next(t){for(const n of this.observers)n.next(t)}error(t){for(const n of this.observers)n.error&&n.error(t)}complete(){for(const t of this.observers)t.complete&&t.complete()}subscribe(t){return this.observers.push(t),new Ac(this,t)}}class Fc{constructor(t,n,o){this._bufferSize=1e5,this._messages=[],this._totalMessageCount=0,this._waitForSequenceMessage=!1,this._nextReceivingSequenceId=1,this._latestReceivedSequenceId=0,this._bufferedByteCount=0,this._reconnectInProgress=!1,this._protocol=t,this._connection=n,this._bufferSize=o}async _send(t){const n=this._protocol.writeMessage(t);let o=Promise.resolve();if(this._isInvocationMessage(t)){this._totalMessageCount++;let r=()=>{},i=()=>{};Ot(n)?this._bufferedByteCount+=n.byteLength:this._bufferedByteCount+=n.length,this._bufferedByteCount>=this._bufferSize&&(o=new Promise((s,a)=>{r=s,i=a})),this._messages.push(new Hc(n,this._totalMessageCount,r,i))}try{this._reconnectInProgress||await this._connection.send(n)}catch{this._disconnected()}await o}_ack(t){let n=-1;for(let o=0;o<this._messages.length;o++){const r=this._messages[o];if(r._id<=t.sequenceId)n=o,Ot(r._message)?this._bufferedByteCount-=r._message.byteLength:this._bufferedByteCount-=r._message.length,r._resolver();else{if(!(this._bufferedByteCount<this._bufferSize))break;r._resolver()}}n!==-1&&(this._messages=this._messages.slice(n+1))}_shouldProcessMessage(t){if(this._waitForSequenceMessage)return t.type===F.Sequence&&(this._waitForSequenceMessage=!1,!0);if(!this._isInvocationMessage(t))return!0;const n=this._nextReceivingSequenceId;return this._nextReceivingSequenceId++,n<=this._latestReceivedSequenceId?(n===this._latestReceivedSequenceId&&this._ackTimer(),!1):(this._latestReceivedSequenceId=n,this._ackTimer(),!0)}_resetSequence(t){t.sequenceId>this._nextReceivingSequenceId?this._connection.stop(new Error("Sequence ID greater than amount of messages we've received.")):this._nextReceivingSequenceId=t.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}async _resend(){const t=this._messages.length!==0?this._messages[0]._id:this._totalMessageCount+1;await this._connection.send(this._protocol.writeMessage({type:F.Sequence,sequenceId:t}));const n=this._messages;for(const o of n)await this._connection.send(o._message);this._reconnectInProgress=!1}_dispose(t){t!=null||(t=new Error("Unable to reconnect to server."));for(const n of this._messages)n._rejector(t)}_isInvocationMessage(t){switch(t.type){case F.Invocation:case F.StreamItem:case F.Completion:case F.StreamInvocation:case F.CancelInvocation:return!0;case F.Close:case F.Sequence:case F.Ping:case F.Ack:return!1}}_ackTimer(){this._ackTimerHandle===void 0&&(this._ackTimerHandle=setTimeout(async()=>{try{this._reconnectInProgress||await this._connection.send(this._protocol.writeMessage({type:F.Ack,sequenceId:this._latestReceivedSequenceId}))}catch{}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0},1e3))}}class Hc{constructor(t,n,o,r){this._message=t,this._id=n,this._resolver=o,this._rejector=r}}var Y;(function(e){e.Disconnected="Disconnected",e.Connecting="Connecting",e.Connected="Connected",e.Disconnecting="Disconnecting",e.Reconnecting="Reconnecting"})(Y||(Y={}));class $o{static create(t,n,o,r,i,s,a){return new $o(t,n,o,r,i,s,a)}constructor(t,n,o,r,i,s,a){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(x.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},ot.isRequired(t,"connection"),ot.isRequired(n,"logger"),ot.isRequired(o,"protocol"),this.serverTimeoutInMilliseconds=i??3e4,this.keepAliveIntervalInMilliseconds=s??15e3,this._statefulReconnectBufferSize=a??1e5,this._logger=n,this._protocol=o,this.connection=t,this._reconnectPolicy=r,this._handshakeProtocol=new Wc,this.connection.onreceive=l=>this._processIncomingData(l),this.connection.onclose=l=>this._connectionClosed(l),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=Y.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:F.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(t){if(this._connectionState!==Y.Disconnected&&this._connectionState!==Y.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!t)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=t}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}async _startWithStateTransitions(){if(this._connectionState!==Y.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=Y.Connecting,this._logger.log(x.Debug,"Starting HubConnection.");try{await this._startInternal(),tt.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=Y.Connected,this._connectionStarted=!0,this._logger.log(x.Debug,"HubConnection connected successfully.")}catch(t){return this._connectionState=Y.Disconnected,this._logger.log(x.Debug,`HubConnection failed to start successfully because of error '${t}'.`),Promise.reject(t)}}async _startInternal(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;const t=new Promise((n,o)=>{this._handshakeResolver=n,this._handshakeRejecter=o});await this.connection.start(this._protocol.transferFormat);try{let n=this._protocol.version;this.connection.features.reconnect||(n=1);const o={protocol:this._protocol.name,version:n};if(this._logger.log(x.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(o)),this._logger.log(x.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await t,this._stopDuringStartError)throw this._stopDuringStartError;this.connection.features.reconnect&&(this._messageBuffer=new Fc(this._protocol,this.connection,this._statefulReconnectBufferSize),this.connection.features.disconnected=this._messageBuffer._disconnected.bind(this._messageBuffer),this.connection.features.resend=()=>{if(this._messageBuffer)return this._messageBuffer._resend()}),this.connection.features.inherentKeepAlive||await this._sendMessage(this._cachedPingMessage)}catch(n){throw this._logger.log(x.Debug,`Hub handshake failed with error '${n}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(n),n}}async stop(){const t=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),await this._stopPromise;try{await t}catch{}}_stopInternal(t){if(this._connectionState===Y.Disconnected)return this._logger.log(x.Debug,`Call to HubConnection.stop(${t}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===Y.Disconnecting)return this._logger.log(x.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;const n=this._connectionState;return this._connectionState=Y.Disconnecting,this._logger.log(x.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(x.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(n===Y.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=t||new bt("The connection was stopped before the hub handshake could complete."),this.connection.stop(t))}async _sendCloseMessage(){try{await this._sendWithProtocol(this._createCloseMessage())}catch{}}stream(t,...n){const[o,r]=this._replaceStreamingParams(n),i=this._createStreamInvocation(t,n,r);let s;const a=new Uc;return a.cancelCallback=()=>{const l=this._createCancelInvocation(i.invocationId);return delete this._callbacks[i.invocationId],s.then(()=>this._sendWithProtocol(l))},this._callbacks[i.invocationId]=(l,h)=>{h?a.error(h):l&&(l.type===F.Completion?l.error?a.error(new Error(l.error)):a.complete():a.next(l.item))},s=this._sendWithProtocol(i).catch(l=>{a.error(l),delete this._callbacks[i.invocationId]}),this._launchStreams(o,s),a}_sendMessage(t){return this._resetKeepAliveInterval(),this.connection.send(t)}_sendWithProtocol(t){return this._messageBuffer?this._messageBuffer._send(t):this._sendMessage(this._protocol.writeMessage(t))}send(t,...n){const[o,r]=this._replaceStreamingParams(n),i=this._sendWithProtocol(this._createInvocation(t,n,!0,r));return this._launchStreams(o,i),i}invoke(t,...n){const[o,r]=this._replaceStreamingParams(n),i=this._createInvocation(t,n,!1,r);return new Promise((a,l)=>{this._callbacks[i.invocationId]=(w,_)=>{_?l(_):w&&(w.type===F.Completion?w.error?l(new Error(w.error)):a(w.result):l(new Error(`Unexpected message type: ${w.type}`)))};const h=this._sendWithProtocol(i).catch(w=>{l(w),delete this._callbacks[i.invocationId]});this._launchStreams(o,h)})}on(t,n){t&&n&&(t=t.toLowerCase(),this._methods[t]||(this._methods[t]=[]),this._methods[t].indexOf(n)===-1&&this._methods[t].push(n))}off(t,n){if(!t)return;t=t.toLowerCase();const o=this._methods[t];if(o)if(n){const r=o.indexOf(n);r!==-1&&(o.splice(r,1),o.length===0&&delete this._methods[t])}else delete this._methods[t]}onclose(t){t&&this._closedCallbacks.push(t)}onreconnecting(t){t&&this._reconnectingCallbacks.push(t)}onreconnected(t){t&&this._reconnectedCallbacks.push(t)}_processIncomingData(t){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(t=this._processHandshakeResponse(t),this._receivedHandshakeResponse=!0),t){const n=this._protocol.parseMessages(t,this._logger);for(const o of n)if(!this._messageBuffer||this._messageBuffer._shouldProcessMessage(o))switch(o.type){case F.Invocation:this._invokeClientMethod(o).catch(r=>{this._logger.log(x.Error,`Invoke client method threw error: ${oo(r)}`)});break;case F.StreamItem:case F.Completion:{const r=this._callbacks[o.invocationId];if(r){o.type===F.Completion&&delete this._callbacks[o.invocationId];try{r(o)}catch(i){this._logger.log(x.Error,`Stream callback threw error: ${oo(i)}`)}}break}case F.Ping:break;case F.Close:{this._logger.log(x.Information,"Close message received from server.");const r=o.error?new Error("Server returned an error on close: "+o.error):void 0;o.allowReconnect===!0?this.connection.stop(r):this._stopPromise=this._stopInternal(r);break}case F.Ack:this._messageBuffer&&this._messageBuffer._ack(o);break;case F.Sequence:this._messageBuffer&&this._messageBuffer._resetSequence(o);break;default:this._logger.log(x.Warning,`Invalid message type: ${o.type}.`)}}this._resetTimeoutPeriod()}_processHandshakeResponse(t){let n,o;try{[o,n]=this._handshakeProtocol.parseHandshakeResponse(t)}catch(r){const i="Error parsing handshake response: "+r;this._logger.log(x.Error,i);const s=new Error(i);throw this._handshakeRejecter(s),s}if(n.error){const r="Server returned handshake error: "+n.error;this._logger.log(x.Error,r);const i=new Error(r);throw this._handshakeRejecter(i),i}return this._logger.log(x.Debug,"Server handshake complete."),this._handshakeResolver(),o}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=new Date().getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if(!(this.connection.features&&this.connection.features.inherentKeepAlive||(this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds),this._pingServerHandle!==void 0))){let t=this._nextKeepAlive-new Date().getTime();t<0&&(t=0),this._pingServerHandle=setTimeout(async()=>{if(this._connectionState===Y.Connected)try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}},t)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}async _invokeClientMethod(t){const n=t.target.toLowerCase(),o=this._methods[n];if(!o)return this._logger.log(x.Warning,`No client method with the name '${n}' found.`),void(t.invocationId&&(this._logger.log(x.Warning,`No result given for '${n}' method and invocation ID '${t.invocationId}'.`),await this._sendWithProtocol(this._createCompletionMessage(t.invocationId,"Client didn't provide a result.",null))));const r=o.slice(),i=!!t.invocationId;let s,a,l;for(const h of r)try{const w=s;s=await h.apply(this,t.arguments),i&&s&&w&&(this._logger.log(x.Error,`Multiple results provided for '${n}'. Sending error to server.`),l=this._createCompletionMessage(t.invocationId,"Client provided multiple results.",null)),a=void 0}catch(w){a=w,this._logger.log(x.Error,`A callback for the method '${n}' threw error '${w}'.`)}l?await this._sendWithProtocol(l):i?(a?l=this._createCompletionMessage(t.invocationId,`${a}`,null):s!==void 0?l=this._createCompletionMessage(t.invocationId,null,s):(this._logger.log(x.Warning,`No result given for '${n}' method and invocation ID '${t.invocationId}'.`),l=this._createCompletionMessage(t.invocationId,"Client didn't provide a result.",null)),await this._sendWithProtocol(l)):s&&this._logger.log(x.Error,`Result given for '${n}' method but server is not expecting a result.`)}_connectionClosed(t){this._logger.log(x.Debug,`HubConnection.connectionClosed(${t}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||t||new bt("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(t||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===Y.Disconnecting?this._completeClose(t):this._connectionState===Y.Connected&&this._reconnectPolicy?this._reconnect(t):this._connectionState===Y.Connected&&this._completeClose(t)}_completeClose(t){if(this._connectionStarted){this._connectionState=Y.Disconnected,this._connectionStarted=!1,this._messageBuffer&&(this._messageBuffer._dispose(t??new Error("Connection closed.")),this._messageBuffer=void 0),tt.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(n=>n.apply(this,[t]))}catch(n){this._logger.log(x.Error,`An onclose callback called with error '${t}' threw error '${n}'.`)}}}async _reconnect(t){const n=Date.now();let o=0,r=t!==void 0?t:new Error("Attempting to reconnect due to a unknown error."),i=this._getNextRetryDelay(o++,0,r);if(i===null)return this._logger.log(x.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(t);if(this._connectionState=Y.Reconnecting,t?this._logger.log(x.Information,`Connection reconnecting because of error '${t}'.`):this._logger.log(x.Information,"Connection reconnecting."),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(s=>s.apply(this,[t]))}catch(s){this._logger.log(x.Error,`An onreconnecting callback called with error '${t}' threw error '${s}'.`)}if(this._connectionState!==Y.Reconnecting)return void this._logger.log(x.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;i!==null;){if(this._logger.log(x.Information,`Reconnect attempt number ${o} will start in ${i} ms.`),await new Promise(s=>{this._reconnectDelayHandle=setTimeout(s,i)}),this._reconnectDelayHandle=void 0,this._connectionState!==Y.Reconnecting)return void this._logger.log(x.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=Y.Connected,this._logger.log(x.Information,"HubConnection reconnected successfully."),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(s=>s.apply(this,[this.connection.connectionId]))}catch(s){this._logger.log(x.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${s}'.`)}return}catch(s){if(this._logger.log(x.Information,`Reconnect attempt failed because of error '${s}'.`),this._connectionState!==Y.Reconnecting)return this._logger.log(x.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this._connectionState===Y.Disconnecting&&this._completeClose());r=s instanceof Error?s:new Error(s.toString()),i=this._getNextRetryDelay(o++,Date.now()-n,r)}}this._logger.log(x.Information,`Reconnect retries have been exhausted after ${Date.now()-n} ms and ${o} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(t,n,o){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:n,previousRetryCount:t,retryReason:o})}catch(r){return this._logger.log(x.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${t}, ${n}) threw error '${r}'.`),null}}_cancelCallbacksWithError(t){const n=this._callbacks;this._callbacks={},Object.keys(n).forEach(o=>{const r=n[o];try{r(null,t)}catch(i){this._logger.log(x.Error,`Stream 'error' callback called with '${t}' threw error: ${oo(i)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(t,n,o,r){if(o)return r.length!==0?{arguments:n,streamIds:r,target:t,type:F.Invocation}:{arguments:n,target:t,type:F.Invocation};{const i=this._invocationId;return this._invocationId++,r.length!==0?{arguments:n,invocationId:i.toString(),streamIds:r,target:t,type:F.Invocation}:{arguments:n,invocationId:i.toString(),target:t,type:F.Invocation}}}_launchStreams(t,n){if(t.length!==0){n||(n=Promise.resolve());for(const o in t)t[o].subscribe({complete:()=>{n=n.then(()=>this._sendWithProtocol(this._createCompletionMessage(o)))},error:r=>{let i;i=r instanceof Error?r.message:r&&r.toString?r.toString():"Unknown error",n=n.then(()=>this._sendWithProtocol(this._createCompletionMessage(o,i)))},next:r=>{n=n.then(()=>this._sendWithProtocol(this._createStreamItemMessage(o,r)))}})}}_replaceStreamingParams(t){const n=[],o=[];for(let r=0;r<t.length;r++){const i=t[r];if(this._isObservable(i)){const s=this._invocationId;this._invocationId++,n[s]=i,o.push(s.toString()),t.splice(r,1)}}return[n,o]}_isObservable(t){return t&&t.subscribe&&typeof t.subscribe=="function"}_createStreamInvocation(t,n,o){const r=this._invocationId;return this._invocationId++,o.length!==0?{arguments:n,invocationId:r.toString(),streamIds:o,target:t,type:F.StreamInvocation}:{arguments:n,invocationId:r.toString(),target:t,type:F.StreamInvocation}}_createCancelInvocation(t){return{invocationId:t,type:F.CancelInvocation}}_createStreamItemMessage(t,n){return{invocationId:t,item:n,type:F.StreamItem}}_createCompletionMessage(t,n,o){return n?{error:n,invocationId:t,type:F.Completion}:{invocationId:t,result:o,type:F.Completion}}_createCloseMessage(){return{type:F.Close}}}const qc=[0,2e3,1e4,3e4,null];class ai{constructor(t){this._retryDelays=t!==void 0?[...t,null]:qc}nextRetryDelayInMilliseconds(t){return this._retryDelays[t.previousRetryCount]}}class Wt{}Wt.Authorization="Authorization",Wt.Cookie="Cookie";class Xc extends Ue{constructor(t,n){super(),this._innerClient=t,this._accessTokenFactory=n}async send(t){let n=!0;this._accessTokenFactory&&(!this._accessToken||t.url&&t.url.indexOf("/negotiate?")>0)&&(n=!1,this._accessToken=await this._accessTokenFactory()),this._setAuthorizationHeader(t);const o=await this._innerClient.send(t);return n&&o.statusCode===401&&this._accessTokenFactory?(this._accessToken=await this._accessTokenFactory(),this._setAuthorizationHeader(t),await this._innerClient.send(t)):o}_setAuthorizationHeader(t){t.headers||(t.headers={}),this._accessToken?t.headers[Wt.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&t.headers[Wt.Authorization]&&delete t.headers[Wt.Authorization]}getCookieString(t){return this._innerClient.getCookieString(t)}}var rt,ut;(function(e){e[e.None=0]="None",e[e.WebSockets=1]="WebSockets",e[e.ServerSentEvents=2]="ServerSentEvents",e[e.LongPolling=4]="LongPolling"})(rt||(rt={})),function(e){e[e.Text=1]="Text",e[e.Binary=2]="Binary"}(ut||(ut={}));class Vc{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}}class ci{get pollAborted(){return this._pollAbort.aborted}constructor(t,n,o){this._httpClient=t,this._logger=n,this._pollAbort=new Vc,this._options=o,this._running=!1,this.onreceive=null,this.onclose=null}async connect(t,n){if(ot.isRequired(t,"url"),ot.isRequired(n,"transferFormat"),ot.isIn(n,ut,"transferFormat"),this._url=t,this._logger.log(x.Trace,"(LongPolling transport) Connecting."),n===ut.Binary&&typeof XMLHttpRequest<"u"&&typeof new XMLHttpRequest().responseType!="string")throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[o,r]=Kt(),i={[o]:r,...this._options.headers},s={abortSignal:this._pollAbort.signal,headers:i,timeout:1e5,withCredentials:this._options.withCredentials};n===ut.Binary&&(s.responseType="arraybuffer");const a=`${t}&_=${Date.now()}`;this._logger.log(x.Trace,`(LongPolling transport) polling: ${a}.`);const l=await this._httpClient.get(a,s);l.statusCode!==200?(this._logger.log(x.Error,`(LongPolling transport) Unexpected response code: ${l.statusCode}.`),this._closeError=new jt(l.statusText||"",l.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,s)}async _poll(t,n){try{for(;this._running;)try{const o=`${t}&_=${Date.now()}`;this._logger.log(x.Trace,`(LongPolling transport) polling: ${o}.`);const r=await this._httpClient.get(o,n);r.statusCode===204?(this._logger.log(x.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):r.statusCode!==200?(this._logger.log(x.Error,`(LongPolling transport) Unexpected response code: ${r.statusCode}.`),this._closeError=new jt(r.statusText||"",r.statusCode),this._running=!1):r.content?(this._logger.log(x.Trace,`(LongPolling transport) data received. ${ae(r.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(r.content)):this._logger.log(x.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(o){this._running?o instanceof no?this._logger.log(x.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=o,this._running=!1):this._logger.log(x.Trace,`(LongPolling transport) Poll errored after shutdown: ${o.message}`)}}finally{this._logger.log(x.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(t){return this._running?ii(this._logger,"LongPolling",this._httpClient,this._url,t,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(x.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(x.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const t={},[n,o]=Kt();t[n]=o;const r={headers:{...t,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials};let i;try{await this._httpClient.delete(this._url,r)}catch(s){i=s}i?i instanceof jt&&(i.statusCode===404?this._logger.log(x.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this._logger.log(x.Trace,`(LongPolling transport) Error sending a DELETE request: ${i}`)):this._logger.log(x.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this._logger.log(x.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}}_raiseOnClose(){if(this.onclose){let t="(LongPolling transport) Firing onclose event.";this._closeError&&(t+=" Error: "+this._closeError),this._logger.log(x.Trace,t),this.onclose(this._closeError)}}}class Gc{constructor(t,n,o,r){this._httpClient=t,this._accessToken=n,this._logger=o,this._options=r,this.onreceive=null,this.onclose=null}async connect(t,n){return ot.isRequired(t,"url"),ot.isRequired(n,"transferFormat"),ot.isIn(n,ut,"transferFormat"),this._logger.log(x.Trace,"(SSE transport) Connecting."),this._url=t,this._accessToken&&(t+=(t.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise((o,r)=>{let i,s=!1;if(n===ut.Text){if(tt.isBrowser||tt.isWebWorker)i=new this._options.EventSource(t,{withCredentials:this._options.withCredentials});else{const a=this._httpClient.getCookieString(t),l={};l.Cookie=a;const[h,w]=Kt();l[h]=w,i=new this._options.EventSource(t,{withCredentials:this._options.withCredentials,headers:{...l,...this._options.headers}})}try{i.onmessage=a=>{if(this.onreceive)try{this._logger.log(x.Trace,`(SSE transport) data received. ${ae(a.data,this._options.logMessageContent)}.`),this.onreceive(a.data)}catch(l){return void this._close(l)}},i.onerror=a=>{s?this._close():r(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},i.onopen=()=>{this._logger.log(x.Information,`SSE connected to ${this._url}`),this._eventSource=i,s=!0,o()}}catch(a){return void r(a)}}else r(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))})}async send(t){return this._eventSource?ii(this._logger,"SSE",this._httpClient,this._url,t,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this._close(),Promise.resolve()}_close(t){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(t))}}class Kc{constructor(t,n,o,r,i,s){this._logger=o,this._accessTokenFactory=n,this._logMessageContent=r,this._webSocketConstructor=i,this._httpClient=t,this.onreceive=null,this.onclose=null,this._headers=s}async connect(t,n){let o;return ot.isRequired(t,"url"),ot.isRequired(n,"transferFormat"),ot.isIn(n,ut,"transferFormat"),this._logger.log(x.Trace,"(WebSockets transport) Connecting."),this._accessTokenFactory&&(o=await this._accessTokenFactory()),new Promise((r,i)=>{let s;t=t.replace(/^http/,"ws");const a=this._httpClient.getCookieString(t);let l=!1;if(tt.isNode||tt.isReactNative){const h={},[w,_]=Kt();h[w]=_,o&&(h[Wt.Authorization]=`Bearer ${o}`),a&&(h[Wt.Cookie]=a),s=new this._webSocketConstructor(t,void 0,{headers:{...h,...this._headers}})}else o&&(t+=(t.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(o)}`);s||(s=new this._webSocketConstructor(t)),n===ut.Binary&&(s.binaryType="arraybuffer"),s.onopen=h=>{this._logger.log(x.Information,`WebSocket connected to ${t}.`),this._webSocket=s,l=!0,r()},s.onerror=h=>{let w=null;w=typeof ErrorEvent<"u"&&h instanceof ErrorEvent?h.error:"There was an error with the transport",this._logger.log(x.Information,`(WebSockets transport) ${w}.`)},s.onmessage=h=>{if(this._logger.log(x.Trace,`(WebSockets transport) data received. ${ae(h.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(h.data)}catch(w){return void this._close(w)}},s.onclose=h=>{if(l)this._close(h);else{let w=null;w=typeof ErrorEvent<"u"&&h instanceof ErrorEvent?h.error:"WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",i(new Error(w))}}})}send(t){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(x.Trace,`(WebSockets transport) sending data. ${ae(t,this._logMessageContent)}.`),this._webSocket.send(t),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(t){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(x.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this._isCloseEvent(t)||t.wasClean!==!1&&t.code===1e3?t instanceof Error?this.onclose(t):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${t.code} (${t.reason||"no reason given"}).`)))}_isCloseEvent(t){return t&&typeof t.wasClean=="boolean"&&typeof t.code=="number"}}class Jc{constructor(t,n={}){var o;if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,ot.isRequired(t,"url"),this._logger=(o=n.logger)===void 0?new Fe(x.Information):o===null?se.instance:o.log!==void 0?o:new Fe(o),this.baseUrl=this._resolveUrl(t),(n=n||{}).logMessageContent=n.logMessageContent!==void 0&&n.logMessageContent,typeof n.withCredentials!="boolean"&&n.withCredentials!==void 0)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");n.withCredentials=n.withCredentials===void 0||n.withCredentials,n.timeout=n.timeout===void 0?1e5:n.timeout;let r=null,i=null;if(tt.isNode&&typeof require<"u"){const s=typeof __webpack_require__=="function"?__non_webpack_require__:require;r=s("ws"),i=s("eventsource")}tt.isNode||typeof WebSocket>"u"||n.WebSocket?tt.isNode&&!n.WebSocket&&r&&(n.WebSocket=r):n.WebSocket=WebSocket,tt.isNode||typeof EventSource>"u"||n.EventSource?tt.isNode&&!n.EventSource&&i!==void 0&&(n.EventSource=i):n.EventSource=EventSource,this._httpClient=new Xc(n.httpClient||new Oc(this._logger),n.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=n,this.onreceive=null,this.onclose=null}async start(t){if(t=t||ut.Binary,ot.isIn(t,ut,"transferFormat"),this._logger.log(x.Debug,`Starting connection with transfer format '${ut[t]}'.`),this._connectionState!=="Disconnected")return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(t),await this._startInternalPromise,this._connectionState==="Disconnecting"){const n="Failed to start the HttpConnection before stop() was called.";return this._logger.log(x.Error,n),await this._stopPromise,Promise.reject(new bt(n))}if(this._connectionState!=="Connected"){const n="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(x.Error,n),Promise.reject(new bt(n))}this._connectionStarted=!0}send(t){return this._connectionState!=="Connected"?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new No(this.transport)),this._sendQueue.send(t))}async stop(t){return this._connectionState==="Disconnected"?(this._logger.log(x.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):this._connectionState==="Disconnecting"?(this._logger.log(x.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState="Disconnecting",this._stopPromise=new Promise(n=>{this._stopPromiseResolver=n}),await this._stopInternal(t),void await this._stopPromise)}async _stopInternal(t){this._stopError=t;try{await this._startInternalPromise}catch{}if(this.transport){try{await this.transport.stop()}catch(n){this._logger.log(x.Error,`HttpConnection.transport.stop() threw error '${n}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(x.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(t){let n=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==rt.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(rt.WebSockets),await this._startTransport(n,t)}else{let o=null,r=0;do{if(o=await this._getNegotiationResponse(n),this._connectionState==="Disconnecting"||this._connectionState==="Disconnected")throw new bt("The connection was stopped during negotiation.");if(o.error)throw new Error(o.error);if(o.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(o.url&&(n=o.url),o.accessToken){const i=o.accessToken;this._accessTokenFactory=()=>i,this._httpClient._accessToken=i,this._httpClient._accessTokenFactory=void 0}r++}while(o.url&&r<100);if(r===100&&o.url)throw new Error("Negotiate redirection limit exceeded.");await this._createTransport(n,this._options.transport,o,t)}this.transport instanceof ci&&(this.features.inherentKeepAlive=!0),this._connectionState==="Connecting"&&(this._logger.log(x.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(o){return this._logger.log(x.Error,"Failed to start the connection: "+o),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(o)}}async _getNegotiationResponse(t){const n={},[o,r]=Kt();n[o]=r;const i=this._resolveNegotiateUrl(t);this._logger.log(x.Debug,`Sending negotiation request: ${i}.`);try{const s=await this._httpClient.post(i,{content:"",headers:{...n,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(s.statusCode!==200)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${s.statusCode}'`));const a=JSON.parse(s.content);return(!a.negotiateVersion||a.negotiateVersion<1)&&(a.connectionToken=a.connectionId),a.useStatefulReconnect&&this._options._useStatefulReconnect!==!0?Promise.reject(new oi("Client didn't negotiate Stateful Reconnect but the server did.")):a}catch(s){let a="Failed to complete negotiation with the server: "+s;return s instanceof jt&&s.statusCode===404&&(a+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(x.Error,a),Promise.reject(new oi(a))}}_createConnectUrl(t,n){return n?t+(t.indexOf("?")===-1?"?":"&")+`id=${n}`:t}async _createTransport(t,n,o,r){let i=this._createConnectUrl(t,o.connectionToken);if(this._isITransport(n))return this._logger.log(x.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=n,await this._startTransport(i,r),void(this.connectionId=o.connectionId);const s=[],a=o.availableTransports||[];let l=o;for(const h of a){const w=this._resolveTransportOrError(h,n,r,l?.useStatefulReconnect===!0);if(w instanceof Error)s.push(`${h.transport} failed:`),s.push(w);else if(this._isITransport(w)){if(this.transport=w,!l){try{l=await this._getNegotiationResponse(t)}catch(_){return Promise.reject(_)}i=this._createConnectUrl(t,l.connectionToken)}try{return await this._startTransport(i,r),void(this.connectionId=l.connectionId)}catch(_){if(this._logger.log(x.Error,`Failed to start the transport '${h.transport}': ${_}`),l=void 0,s.push(new Pc(`${h.transport} failed: ${_}`,rt[h.transport])),this._connectionState!=="Connecting"){const k="Failed to select transport before stop() was called.";return this._logger.log(x.Debug,k),Promise.reject(new bt(k))}}}}return s.length>0?Promise.reject(new zc(`Unable to connect to the server with any of the available transports. ${s.join(" ")}`,s)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))}_constructTransport(t){switch(t){case rt.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new Kc(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case rt.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new Gc(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case rt.LongPolling:return new ci(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${t}.`)}}_startTransport(t,n){return this.transport.onreceive=this.onreceive,this.features.reconnect?this.transport.onclose=async o=>{let r=!1;if(this.features.reconnect){try{this.features.disconnected(),await this.transport.connect(t,n),await this.features.resend()}catch{r=!0}r&&this._stopConnection(o)}else this._stopConnection(o)}:this.transport.onclose=o=>this._stopConnection(o),this.transport.connect(t,n)}_resolveTransportOrError(t,n,o,r){const i=rt[t.transport];if(i==null)return this._logger.log(x.Debug,`Skipping transport '${t.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${t.transport}' because it is not supported by this client.`);if(!function(s,a){return!s||(a&s)!=0}(n,i))return this._logger.log(x.Debug,`Skipping transport '${rt[i]}' because it was disabled by the client.`),new Mc(`'${rt[i]}' is disabled by the client.`,i);{if(!(t.transferFormats.map(a=>ut[a]).indexOf(o)>=0))return this._logger.log(x.Debug,`Skipping transport '${rt[i]}' because it does not support the requested transfer format '${ut[o]}'.`),new Error(`'${rt[i]}' does not support ${ut[o]}.`);if(i===rt.WebSockets&&!this._options.WebSocket||i===rt.ServerSentEvents&&!this._options.EventSource)return this._logger.log(x.Debug,`Skipping transport '${rt[i]}' because it is not supported in your environment.'`),new Rc(`'${rt[i]}' is not supported in your environment.`,i);this._logger.log(x.Debug,`Selecting transport '${rt[i]}'.`);try{return this.features.reconnect=i===rt.WebSockets?r:void 0,this._constructTransport(i)}catch(a){return a}}}_isITransport(t){return t&&typeof t=="object"&&"connect"in t}_stopConnection(t){if(this._logger.log(x.Debug,`HttpConnection.stopConnection(${t}) called while in state ${this._connectionState}.`),this.transport=void 0,t=this._stopError||t,this._stopError=void 0,this._connectionState!=="Disconnected"){if(this._connectionState==="Connecting")throw this._logger.log(x.Warning,`Call to HttpConnection.stopConnection(${t}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${t}) was called while the connection is still in the connecting state.`);if(this._connectionState==="Disconnecting"&&this._stopPromiseResolver(),t?this._logger.log(x.Error,`Connection disconnected with error '${t}'.`):this._logger.log(x.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(n=>{this._logger.log(x.Error,`TransportSendQueue.stop() threw error '${n}'.`)}),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(t)}catch(n){this._logger.log(x.Error,`HttpConnection.onclose(${t}) threw error '${n}'.`)}}}else this._logger.log(x.Debug,`Call to HttpConnection.stopConnection(${t}) was ignored because the connection is already in the disconnected state.`)}_resolveUrl(t){if(t.lastIndexOf("https://",0)===0||t.lastIndexOf("http://",0)===0)return t;if(!tt.isBrowser)throw new Error(`Cannot resolve '${t}'.`);const n=window.document.createElement("a");return n.href=t,this._logger.log(x.Information,`Normalizing '${t}' to '${n.href}'.`),n.href}_resolveNegotiateUrl(t){const n=new URL(t);n.pathname.endsWith("/")?n.pathname+="negotiate":n.pathname+="/negotiate";const o=new URLSearchParams(n.searchParams);return o.has("negotiateVersion")||o.append("negotiateVersion",this._negotiateVersion.toString()),o.has("useStatefulReconnect")?o.get("useStatefulReconnect")==="true"&&(this._options._useStatefulReconnect=!0):this._options._useStatefulReconnect===!0&&o.append("useStatefulReconnect","true"),n.search=o.toString(),n.toString()}}class No{constructor(t){this._transport=t,this._buffer=[],this._executing=!0,this._sendBufferedData=new He,this._transportResult=new He,this._sendLoopPromise=this._sendLoop()}send(t){return this._bufferData(t),this._transportResult||(this._transportResult=new He),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(t){if(this._buffer.length&&typeof this._buffer[0]!=typeof t)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof t}`);this._buffer.push(t),this._sendBufferedData.resolve()}async _sendLoop(){for(;;){if(await this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new He;const t=this._transportResult;this._transportResult=void 0;const n=typeof this._buffer[0]=="string"?this._buffer.join(""):No._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(n),t.resolve()}catch(o){t.reject(o)}}}static _concatBuffers(t){const n=t.map(i=>i.byteLength).reduce((i,s)=>i+s),o=new Uint8Array(n);let r=0;for(const i of t)o.set(new Uint8Array(i),r),r+=i.byteLength;return o.buffer}}class He{constructor(){this.promise=new Promise((t,n)=>[this._resolver,this._rejecter]=[t,n])}resolve(){this._resolver()}reject(t){this._rejecter(t)}}class Yc{constructor(){this.name="json",this.version=2,this.transferFormat=ut.Text}parseMessages(t,n){if(typeof t!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!t)return[];n===null&&(n=se.instance);const o=mt.parse(t),r=[];for(const i of o){const s=JSON.parse(i);if(typeof s.type!="number")throw new Error("Invalid payload.");switch(s.type){case F.Invocation:this._isInvocationMessage(s);break;case F.StreamItem:this._isStreamItemMessage(s);break;case F.Completion:this._isCompletionMessage(s);break;case F.Ping:case F.Close:break;case F.Ack:this._isAckMessage(s);break;case F.Sequence:this._isSequenceMessage(s);break;default:n.log(x.Information,"Unknown message type '"+s.type+"' ignored.");continue}r.push(s)}return r}writeMessage(t){return mt.write(JSON.stringify(t))}_isInvocationMessage(t){this._assertNotEmptyString(t.target,"Invalid payload for Invocation message."),t.invocationId!==void 0&&this._assertNotEmptyString(t.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(t){if(this._assertNotEmptyString(t.invocationId,"Invalid payload for StreamItem message."),t.item===void 0)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(t){if(t.result&&t.error)throw new Error("Invalid payload for Completion message.");!t.result&&t.error&&this._assertNotEmptyString(t.error,"Invalid payload for Completion message."),this._assertNotEmptyString(t.invocationId,"Invalid payload for Completion message.")}_isAckMessage(t){if(typeof t.sequenceId!="number")throw new Error("Invalid SequenceId for Ack message.")}_isSequenceMessage(t){if(typeof t.sequenceId!="number")throw new Error("Invalid SequenceId for Sequence message.")}_assertNotEmptyString(t,n){if(typeof t!="string"||t==="")throw new Error(n)}}const Zc={trace:x.Trace,debug:x.Debug,info:x.Information,information:x.Information,warn:x.Warning,warning:x.Warning,error:x.Error,critical:x.Critical,none:x.None};class Qc{configureLogging(t){if(ot.isRequired(t,"logging"),t.log!==void 0)this.logger=t;else if(typeof t=="string"){const n=function(o){const r=Zc[o.toLowerCase()];if(r!==void 0)return r;throw new Error(`Unknown log level: ${o}`)}(t);this.logger=new Fe(n)}else this.logger=new Fe(t);return this}withUrl(t,n){return ot.isRequired(t,"url"),ot.isNotEmpty(t,"url"),this.url=t,this.httpConnectionOptions=typeof n=="object"?{...this.httpConnectionOptions,...n}:{...this.httpConnectionOptions,transport:n},this}withHubProtocol(t){return ot.isRequired(t,"protocol"),this.protocol=t,this}withAutomaticReconnect(t){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return t?Array.isArray(t)?this.reconnectPolicy=new ai(t):this.reconnectPolicy=t:this.reconnectPolicy=new ai,this}withServerTimeout(t){return ot.isRequired(t,"milliseconds"),this._serverTimeoutInMilliseconds=t,this}withKeepAliveInterval(t){return ot.isRequired(t,"milliseconds"),this._keepAliveIntervalInMilliseconds=t,this}withStatefulReconnect(t){return this.httpConnectionOptions===void 0&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=t?.bufferSize,this}build(){const t=this.httpConnectionOptions||{};if(t.logger===void 0&&(t.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const n=new Jc(this.url,t);return $o.create(n,this.logger||se.instance,this.protocol||new Yc,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}}let qe;function tl(e){if(!e){if(qe)return qe;throw new Error("\u9996\u6B21\u6784\u5EFA\uFF0CsignalrURL\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\uFF01")}const t=new Qc().configureLogging(x.Information).withUrl(e).withAutomaticReconnect({nextRetryDelayInMilliseconds:()=>5e3}).build();return t.keepAliveIntervalInMilliseconds=15e3,t.serverTimeoutInMilliseconds=18e5,t.start().then(()=>{j.Logger().info("\u542F\u52A8SignalR\u8FDE\u63A5\uFF01")}),t.onclose(async()=>{j.Logger().info("\u65AD\u5F00SignalR\u8FDE\u63A5!")}),t.onreconnecting(()=>{j.Logger().warn("SignalR\u670D\u52A1\u5DF2\u65AD\u7EBF\uFF0C\u91CD\u8FDE\u4E2D...\uFF01")}),t.onreconnected(()=>{j.Logger().warn("SignalR\u91CD\u8FDE\u6210\u529F!")}),qe||(qe=t),t}const ro=new Set;function li(e){return e!==null?parseFloat(e):0}function Xe(e){const t=window.getComputedStyle(e),n=Math.ceil([t.paddingLeft,t.width,t.paddingRight].map(li).reduce((r,i)=>r+i)),o=Math.ceil([t.paddingTop,t.height,t.paddingBottom].map(li).reduce((r,i)=>r+i));return{width:n,height:o}}class ui{width;height;constructor(t,n){this.width=t,this.height=n}}function el(e){const t=e.windowEl;if(t){const n=parseFloat(t.style.left||"NaN"),o=parseFloat(t.style.top||"NaN");if(!isNaN(n)&&!isNaN(o))return{left:n,top:o}}return null}function nl(e,t,n,o){const r=e-n,i=t-o;return r*r+i*i}window.addEventListener("resize",e=>{ro.forEach(t=>{t&&Re(t.fixPosition)&&t.fixPosition()})});const Ve=[];var Ge=Rt({name:"Window",props:{windowStyle:{type:Object,required:!0},isOpen:{type:Boolean,required:!1,default:!0},title:{type:String,required:!0,default:""},closeButton:{type:Boolean,required:!1,default:!0},resizable:{type:Boolean,required:!1,default:!1},isScrollable:{type:Boolean,required:!1,default:!1},padding:{type:Number,required:!1,default:8},activateWhenOpen:{type:Boolean,required:!1,default:!0},positionHint:{type:String,required:!1,default:""},zGroup:{type:Number,required:!1,default:1},overflow:{type:String,required:!1,default:"visible"},minWidth:{type:Number,required:!1,default:1},minHeight:{type:Number,required:!1,default:0},maxWidth:{type:Number,required:!1,default:0},maxHeight:{type:Number,required:!1,default:0},height:{type:Number,required:!1},width:{type:Number,required:!1},top:{type:Number,required:!1},left:{type:Number,required:!1}},components:{myButton:Te},setup(e,{emit:t}){const n=zs();if(!n)return;const{proxy:o}=n;let r=0,i,s,a;const l=K(e.isOpen),h=()=>{Ve.push(o),a=new Ks(e.zGroup,w),e.isOpen&&function(L){L&&(rr(()=>{r++==0&&(y(o),function(){const D=_.value,{width:M,height:N}=Rn(D);let O,T;if(e.left!==void 0!=(e.top!==void 0))throw new Error("Either of left or top is specified. Both must be set or not set.");if(typeof e.left=="number")O=e.left,T=e.top;else{const W=e.positionHint||"auto";switch(W){case"auto":{let q=20,it=50,Z=0;do{if(Ve.every(Q=>{if(!Q.isOpen||o==Q)return!0;const _t=el(Q);if(_t==null)return!0;const{left:Ht,top:et}=_t;return nl(Ht,et,q,it)>16}))break;q=(q+40)%(window.innerWidth-200),it=(it+40)%(window.innerHeight-200)}while(++Z<100);O=q,T=it}break;case"center":O=(window.innerWidth-M)/2,T=(window.innerHeight-N)/2,console.log(O,T,window.innerWidth,window.innerHeight,"111111");break;default:try{const q=W.split("/").map(Number);if(q.length!=2)throw null;const[it,Z]=q;if(!isFinite(it)||!isFinite(Z))throw null;O=it>=0?it:window.innerWidth-M+it,T=Z>=0?Z:window.innerHeight-N+Z}catch{throw new Error(`invalid position string: ${W}`)}}}D&&(D.style.left=`${O}px`,D.style.top=`${T}px`)}()),e.resizable&&d(),z(),i=new Gs(k.value,_.value,{onMove:()=>z(),onMoveStart:()=>t("move-start"),onMoveEnd:()=>t("move-end")}),e.resizable&&function(){const{height:D}=Rn(k.value);s=new Js(_.value,{onResize:()=>d(),onResizeStart:()=>t("resize-start"),onResizeEnd:()=>t("resize-end"),minWidth:e.minWidth,minHeight:e.minHeight+D,maxWidth:e.maxWidth,maxHeight:e.maxHeight?e.maxHeight+D:void 0})}()}),e.activateWhenOpen&&I())}(!0),ro.add(o)};function w(L){p.value.zIndex=`${L}`}const _=K(null),k=K(null),$=K(null);function I(){a.raise(),t("activate")}const p=K({...e.windowStyle.window,zIndex:"auto",overflow:e.overflow}),u=Xt(()=>e.windowStyle.titlebar),v=Xt(()=>{const L={...e.windowStyle.content};return e.resizable?L.padding="0":e.padding!=null&&(L.padding=`${e.padding}px`),e.isScrollable&&(L.overflow="auto"),L});function y(L){const{width:D,height:M,top:N,left:O}=L,T=_;if(T&&D!=null&&(T.value.style.width=`${D}px`),M!=null){const W=k.value;if(W){const q=Xe(W).height;T.value.style.height=`${M+q}px`}}T&&O!=null&&(T.value.style.left=`${O}px`),T&&N!=null&&(T.value.style.top=`${N}px`)}function d(L=!0){const D=_.value,M=k.value,N=$.value;if(N&&D&&M){const{width:O,height:T}=Xe(N),{width:W,height:q}=Xe(D),it=Xe(M).height,Z=W-(N.offsetWidth-O),Q=q-it-(N.offsetHeight-T);N.style.width=`${Z}px`,N.style.height=`${Q}px`,f(),t("resize",new ui(Z,Q)),L&&(t("update:width",Z),t("update:height",Q))}}function f(){const L=_.value;if(L){const D=L.getBoundingClientRect();D.left<0&&(p.value.left="0px"),D.top<0&&(p.value.top="0px"),D.right>window.innerWidth&&(p.value.left=window.innerWidth-D.width+"px"),D.bottom>window.innerHeight&&(p.value.top=window.innerHeight-D.height+"px")}}function z(L=!0){f();const D=_.value;if(D){const{left:M,top:N}=D.getBoundingClientRect();L&&(t("update:left",M),t("update:top",N))}}return Pt(()=>e.isOpen,L=>{l.value=L}),Pt(()=>e.zGroup,L=>{a.group=L}),Pt(()=>e.width,L=>{y({width:L}),d(!1)}),Pt(()=>e.height,L=>{y({height:L}),d(!1)}),Sn(()=>{h()}),As(()=>{ro.delete(this),a.unregister(),s&&s.teardown(),i&&i.teardown(),Ve.splice(Ve.indexOf(o),1)}),{isOpen:l,windowEl:_,titlebar:k,content:$,activate:I,styleWindow:p,styleTitlebar:u,styleContent:v,closeButtonClick:function(){l.value=!1,t("closebuttonclick")},fixPosition:f}}});const ol={class:"title"};var hi;Ge.render=function(e,t,n,o,r,i){const s=Se("myButton");return X(),nt(ir,{name:"fade",onAfterLeave:t[2]||(t[2]=a=>e.$emit("close")),onAfterEnter:t[3]||(t[3]=a=>e.$emit("open")),persisted:""},{default:Ct(()=>[sr(J("div",{class:"window",style:vt(e.styleWindow),ref:"windowEl",onMousedown:t[0]||(t[0]=(...a)=>e.activate&&e.activate(...a)),onTouchstart:t[1]||(t[1]=(...a)=>e.activate&&e.activate(...a))},[J("div",{class:"titlebar",style:vt(e.styleTitlebar),ref:"titlebar"},[J("div",ol,[e.$slots.title?ct(e.$slots,"title",{key:0}):(X(),gt(zt,{key:1},[Cn(En(e.title),1)],64))]),e.closeButton?(X(),nt(s,{key:0,windowStyle:e.windowStyle,onClick:e.closeButtonClick},{default:Ct(()=>t[4]||(t[4]=[Cn("\xD7")])),_:1},8,["windowStyle","onClick"])):st("v-if",!0)],4),J("div",{class:"content",style:vt(e.styleContent),ref:"content"},[ct(e.$slots,"default")],4)],36),[[ar,e.isOpen]])]),_:3})},Ge.__file="src/controls/vuewindow/window/index.vue",function(e){e[e.StyleBlack=0]="StyleBlack",e[e.StyleWhite=1]="StyleWhite",e[e.StyleMetal=2]="StyleMetal",e[e.StyleGrayblue=3]="StyleGrayblue"}(hi||(hi={}));const rl={window:{color:"#fff",boxShadow:"0 0 6pt rgba(255, 255, 255, 0.75)",backgroundColor:"rgba(31, 31, 31, 0.9)"},titlebar:{backgroundColor:"rgba(63, 63, 63, 0.9)"},content:{},button:{color:"white"},buttonHover:{backgroundColor:"rgba(255, 255, 255, 0.25)"},buttonActive:{color:"black",backgroundColor:"rgba(255, 255, 255, 0.5)"}},il={window:{color:"#000",boxShadow:"0 2pt 4pt rgba(0, 0, 0, 0.5)",backgroundColor:"rgba(239, 239, 239, 0.95)"},titlebar:{backgroundColor:"rgba(191, 191, 191, 0.9)"},content:{},button:{color:"#000"},buttonHover:{backgroundColor:"rgba(0, 0, 0, 0.25)"},buttonActive:{color:"#fff",backgroundColor:"rgba(0, 0, 0, 0.5)"}},sl={window:{color:"#000",boxShadow:"0 4pt 8pt rgba(0, 0, 0, 0.5)",background:"linear-gradient(to bottom, rgb(215, 215, 215), rgb(191, 191, 191))"},titlebar:{background:"linear-gradient(to bottom, rgb(215, 215, 215), rgb(191, 191, 191))"},content:{},button:{color:"#000"},buttonHover:{backgroundColor:"rgba(0, 0, 0, 0.25)"},buttonActive:{color:"#fff",backgroundColor:"rgba(0, 0, 0, 0.5)"}},al={window:{color:"#fff",fontSize:"14px",boxShadow:"0 0 3pt rgba(255, 255, 255, 0.75)",backgroundColor:"rgba(4,51,81,0.6)",borderRadius:"5px"},titlebar:{backgroundColor:"rgba(4,51,81,0.8)",border:"1px solid rgba(153, 153, 153, 0.5)",borderRadius:"5px",fontSize:"16px",fontWeight:400,color:"#fff"},content:{},button:{color:"white",fontSize:"18px"},buttonHover:{backgroundColor:"rgba(255, 255, 255, 0.25)"},buttonActive:{color:"black",backgroundColor:"rgba(255, 255, 255, 0.5)"}},cl=Ge;var ht;(function(e){e[e.top=0]="top",e[e.bottom=1]="bottom",e[e.centerBack=2]="centerBack",e[e.centerMain=3]="centerMain",e[e.centerFront=4]="centerFront",e[e.left=5]="left",e[e.right=6]="right"})(ht||(ht={}));class di{layoutState;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;widgetConfig=new Array;_LayoutID;_mapItemRefs;constructor(t,n,o,r){this.layoutState=t,this._LayoutID=o,this._mapItemRefs=r,n.forEach(i=>{if(i.layoutID===o&&(this.widgetConfig.push(i),i.afterid))if(this.preConditionMap.has(i.afterid))this.preConditionMap.get(i.afterid)?.add(i);else{const s=new Set;s.add(i),this.preConditionMap.set(i.afterid,s)}})}getLayoutID(){return this._LayoutID}getWidgetConfig(){return this.widgetConfig}preloadWidgets(){this.widgetConfig.filter(t=>t.preload&&!t.afterid).forEach(t=>{this._loadWidget(t)})}async loadWidget(t){if(!t)return;let n;if(Lt(t)?n=t:Me(t)&&(n=this.widgetConfig.find(o=>o.id===t)),n){if(n.afterid){if(this.isWidgetLoaded(n.afterid))return this._loadWidget(n);{let o=function(a){a.layoutID===r._LayoutID&&a.widgetID===i&&(r._loadWidget(s),j.EventBus.off(lt.WidgetLoadedEvent,o))};const r=this,i=n.afterid,s=n;return j.EventBus.on(lt.WidgetLoadedEvent,o),this.loadWidget(n.afterid)}}return this._loadWidget(n)}}loadOtherDependenceWidgets(t){this.preConditionMap.has(t)&&this.preConditionMap.get(t)?.forEach(n=>{n.preload&&this._loadWidget(n)})}_loadWidget(t){if(!this.widgetsLoadedSet.has(t.id))return t.component?t.component().then(n=>{if(n.default){const o=Ls(n.default);t.layout&&(o.style=t.layout),t.cssClass&&(o.cssClass=t.cssClass),this.getContainerComponents(t.container).value.set(t.id,o),this.widgetsLoadedSet.add(t.id),rr().then(()=>{j.EventBus.emit(lt.WidgetLoadedEvent,{layoutID:this._LayoutID,widgetID:t.id}),this.loadOtherDependenceWidgets(t.id)})}}).catch(n=>{j.Logger().error("\u52A0\u8F7DWidget\u5931\u8D25\uFF01",t),j.EventBus.emit(lt.WidgetLoadedErrorEvent,t)}):void 0;this.changeWidgetVisible(t.id,!0)}hasDependentWidgets(t){let n=!1;if(this.preConditionMap.has(t)){const o=this.preConditionMap.get(t);if(o){for(const r of o)if(this.isWidgetLoaded(r.id)){n=!0;break}}}return n}unloadWidget(t){if(!t||!this.isWidgetLoaded(t))return;const n=this.widgetConfig.find(o=>o.id===t);if(n){if(this.preConditionMap.has(t)){const o=this.preConditionMap.get(t);if(o)for(const r of o)this.unloadWidget(r.id)}this.getContainerComponents(n.container).value.delete(t),this.widgetsLoadedSet.delete(t),this._mapItemRefs&&this._mapItemRefs.delete(t),j.EventBus.emit(lt.WidgetUnLoadedEvent,{layoutID:this._LayoutID,widgetID:t})}}isWidgetLoaded(t){return this.widgetsLoadedSet.has(t)}splitTwoContainer(t=!1){const n=this.layoutState.centerMainContainer,o=this.layoutState.centerBackContainer;t?(n&&(n.style.left="0",n.style.width="100%"),o&&(o.style.width="100%")):(n&&(n.style.left="50%",n.style.width="50%"),o&&(o.style.width="50%"))}getLayoutContainer(t){switch(t){case ht.top:return this.layoutState.topContainer;case ht.bottom:return this.layoutState.bottomContainer;case ht.left:return this.layoutState.leftContainer;case ht.right:return this.layoutState.rightContainer;case ht.centerBack:return this.layoutState.centerBackContainer;case ht.centerMain:return this.layoutState.centerMainContainer;case ht.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(t,n=!1){const o=this.getLayoutContainer(t);o&&(o.style.visibility=n?"visible":"hidden")}changeWidgetVisible(t,n=!1){const o=this.getWidgetComponent(t);o&&o.changeVisible&&o.changeVisible(n)}isWidgetVisible(t){const n=this.getWidgetComponent(t);return!!n&&(!n.isShow||n.isShow.value)}getWidgetComponent(t){if(this.widgetsLoadedSet.has(t)&&this._mapItemRefs)return this._mapItemRefs.get(t)}getWigetItem(t){return this.widgetConfig.find(n=>n.id===t)}getGroupWigetItems(t){return this.widgetConfig.filter(n=>n.group===t)}getContainerComponents(t){if(this.layoutMap.has(t))return this.layoutMap.get(t);{const n=K(new Map);return this.layoutMap.set(t,n),n}}getWidgetLoadedIDList(){const t=[];return this.widgetsLoadedSet.forEach(n=>{t.push(n)}),t}unloadAllWidgets(t){const n=[];this.widgetsLoadedSet.forEach(o=>{t&&t.length>0?t.findIndex(r=>r===o)<0&&n.push(o):n.push(o)}),n.forEach(o=>this.unloadWidget(o))}unloadWidgets(t){t&&t.length>0&&t.forEach(n=>{this.unloadWidget(n)})}static getLayoutManager(t,n){if(n){const o=n.find(r=>r.id===t);if(o&&o.layoutID)return j.LayoutMap.get(o.layoutID)}}}var ce=Rt({name:"SuspenseWithError",setup(){const e=K(null);return Ds(t=>(e.value="\u5F53\u524D\u9875\u9762\u5B58\u5728\u95EE\u9898\uFF0C\u65E0\u6CD5\u6E32\u67D3\u2026\u2026",console.error("onErrorCaptured",t),!0)),{error:e}}});ce.render=function(e,t,n,o,r,i){return e.error?ct(e.$slots,"error",{key:0},()=>[Cn(En(e.error),1)]):(X(),nt($s,{key:1},{default:Ct(()=>[ct(e.$slots,"default")]),fallback:Ct(()=>[ct(e.$slots,"fallback")]),_:3}))},ce.__file="src/controls/routertransition/SuspenseWithError.vue";var io=Rt({name:"RouterTransition",__name:"RouterTransition",setup:e=>(t,n)=>{const o=Se("router-view");return X(),nt(ce,null,{default:Ct(()=>[Ce(o,null,{default:Ct(({Component:r,route:i})=>[st(" <transition> "),(X(),nt(cr,null,[i.meta.keepAlive?(X(),nt(Et(r),{key:i.name})):st("v-if",!0)],1024)),i.meta.keepAlive?st("v-if",!0):(X(),nt(Et(r),{key:i.name})),st(" </transition> ")]),_:1})]),_:1})}});io.__file="src/controls/routertransition/RouterTransition.vue";var Ke=Rt({name:"LayoutContainer",props:{widgetConfig:{type:Array,required:!0,default:()=>[]},layoutID:{type:String,default:void 0},layoutStyle:{type:Object},enableRouterView:{type:Boolean,default:!0}},emits:["containerLoaded"],components:{RouterTransition:io},setup(e,{attrs:t,slots:n,emit:o}){const r=e.layoutID,i=K(e.enableRouterView);Pt(()=>e.enableRouterView,()=>{i.value=e.enableRouterView});const s=Ns({topContainer:void 0,centerBackContainer:void 0,centerMainContainer:void 0,centerFrontContainer:void 0,bottomContainer:void 0,leftContainer:void 0,rightContainer:void 0}),a=new Map,l=new di(s,e.widgetConfig,r,a),h=p(ht.top),w=p(ht.centerBack),_=p(ht.centerFront),k=p(ht.left),$=p(ht.right),I=p(ht.bottom);function p(v){return l?.getContainerComponents(v)}const u=Xt(()=>e.layoutStyle);return Sn(()=>{l&&(r?j.LayoutMap.set(r,l):(j.LayoutManager=l,j.LayoutMap.set("",l)),l.preloadWidgets(),o("containerLoaded",{layoutID:r,layoutManager:l}),j.EventBus.emit(lt.LayoutContainerLoaded,{layoutID:r,layoutManager:l}))}),{...Bs(s),topContainerComponents:h,centerbackComponents:w,centerfrontComponents:_,leftContainerComponents:k,rightContainerComponents:$,bottomContainerComponents:I,containerStyle:u,isEnableRouterView:i,setItemRef:(v,y)=>{v&&a.set(y,v)}}}});const ll={ref:"topContainer",class:"topContainer"},ul={key:0,ref:"centerMainContainer",class:"centerdiv mainContainer"},hl={ref:"centerBackContainer",class:"centerdiv backContainer"},dl={ref:"centerFrontContainer",class:"centerdiv centerFrontContainer"},fl={ref:"leftContainer",class:"leftContainer"},pl={ref:"rightContainer",class:"rightContainer"},gl={ref:"bottomContainer",class:"bottomContainer"};Ke.render=function(e,t,n,o,r,i){const s=Se("router-transition");return X(),gt("div",{class:"layoutContainer",style:vt(e.containerStyle)},[J("div",ll,[ct(e.$slots,"top"),(X(!0),gt(zt,null,Vt(e.topContainerComponents,([a,l])=>(X(),nt(Et(l),{ref_for:!0,ref:h=>e.setItemRef(h,a),key:a,style:vt(l.style),class:At(l.cssClass)},null,8,["style","class"]))),128))],512),J("div",null,[st(" \u4E3B\u8981\u5BB9\u5668-\u5E95\u90E8 "),e.isEnableRouterView?(X(),gt("div",ul,[ct(e.$slots,"main",{},()=>[Ce(s)])],512)):st("v-if",!0),st(" \u4E0A\u4E00\u5C42-\u4E3B\u5BB9\u5668 "),J("div",hl,[ct(e.$slots,"back"),(X(!0),gt(zt,null,Vt(e.centerbackComponents,([a,l])=>(X(),nt(Et(l),{ref_for:!0,ref:h=>e.setItemRef(h,a),key:a,style:vt(l.style),class:At(l.cssClass)},null,8,["style","class"]))),128))],512),st(" \u6700\u4E0A\u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),J("div",dl,[ct(e.$slots,"front"),(X(!0),gt(zt,null,Vt(e.centerfrontComponents,([a,l])=>(X(),nt(Et(l),{ref_for:!0,ref:h=>e.setItemRef(h,a),key:a,style:vt(l.style),class:At(l.cssClass)},null,8,["style","class"]))),128))],512),J("div",fl,[ct(e.$slots,"left"),(X(!0),gt(zt,null,Vt(e.leftContainerComponents,([a,l])=>(X(),nt(Et(l),{ref_for:!0,ref:h=>e.setItemRef(h,a),key:a,style:vt(l.style),class:At(l.cssClass)},null,8,["style","class"]))),128))],512),J("div",pl,[ct(e.$slots,"right"),(X(!0),gt(zt,null,Vt(e.rightContainerComponents,([a,l])=>(X(),nt(Et(l),{ref_for:!0,ref:h=>e.setItemRef(h,a),key:a,style:vt(l.style),class:At(l.cssClass)},null,8,["style","class"]))),128))],512)]),J("div",gl,[ct(e.$slots,"bottom"),(X(!0),gt(zt,null,Vt(e.bottomContainerComponents,([a,l])=>(X(),nt(Et(l),{ref_for:!0,ref:h=>e.setItemRef(h,a),key:a,style:vt(l.style),class:At(l.cssClass)},null,8,["style","class"]))),128))],512),st(" \u589E\u52A0\u9ED8\u8BA4\u63D2\u69FD "),ct(e.$slots,"default")],4)},Ke.__scopeId="data-v-4d081e5c",Ke.__file="src/controls/layoutcontainer/layout.vue";var fi=Rt({name:"RouterTransition",__name:"RouterTransitionAnimate",props:{enterActive:{type:String,required:!1,default:"animated fadeIn"},leaveActive:{type:String,required:!1,default:"animated fadeOut"}},setup:e=>(t,n)=>{const o=Se("router-view");return X(),nt(ce,null,{default:Ct(()=>[Ce(o,null,{default:Ct(({Component:r,route:i})=>[Ce(js,{appear:"","enter-active-class":t.enterActive,"leave-active-class":t.leaveActive},{default:Ct(()=>[(X(),nt(cr,null,[i.meta.keepAlive?(X(),nt(Et(r),{key:i.name})):st("v-if",!0)],1024)),i.meta.keepAlive?st("v-if",!0):(X(),nt(Et(r),{key:i.name}))]),_:2},1032,["enter-active-class","leave-active-class"])]),_:1})]),_:1})}});fi.__file="src/controls/routertransition/RouterTransitionAnimate.vue";const le=/^[a-z0-9]+(-[a-z0-9]+)*$/,Je=(e,t,n,o="")=>{const r=e.split(":");if(e.slice(0,1)==="@"){if(r.length<2||r.length>3)return null;o=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){const a=r.pop(),l=r.pop(),h={provider:r.length>0?r[0]:o,prefix:l,name:a};return t&&!Ye(h)?null:h}const i=r[0],s=i.split("-");if(s.length>1){const a={provider:o,prefix:s.shift(),name:s.join("-")};return t&&!Ye(a)?null:a}if(n&&o===""){const a={provider:o,prefix:"",name:i};return t&&!Ye(a,n)?null:a}return null},Ye=(e,t)=>!!e&&!(e.provider!==""&&!e.provider.match(le)||!(t&&e.prefix===""||e.prefix.match(le))||!e.name.match(le)),pi=Object.freeze({left:0,top:0,width:16,height:16}),Ze=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Qe=Object.freeze({...pi,...Ze}),so=Object.freeze({...Qe,body:"",hidden:!1});function gi(e,t){const n=function(o,r){const i={};!o.hFlip!=!r.hFlip&&(i.hFlip=!0),!o.vFlip!=!r.vFlip&&(i.vFlip=!0);const s=((o.rotate||0)+(r.rotate||0))%4;return s&&(i.rotate=s),i}(e,t);for(const o in so)o in Ze?o in e&&!(o in n)&&(n[o]=Ze[o]):o in t?n[o]=t[o]:o in e&&(n[o]=e[o]);return n}function ml(e,t,n){const o=e.icons,r=e.aliases||Object.create(null);let i={};function s(a){i=gi(o[a]||r[a],i)}return s(t),n.forEach(s),gi(e,i)}function mi(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(r=>{t(r,null),n.push(r)});const o=function(r,i){const s=r.icons,a=r.aliases||Object.create(null),l=Object.create(null);return(i||Object.keys(s).concat(Object.keys(a))).forEach(function h(w){if(s[w])return l[w]=[];if(!(w in l)){l[w]=null;const _=a[w]&&a[w].parent,k=_&&h(_);k&&(l[w]=[_].concat(k))}return l[w]}),l}(e);for(const r in o){const i=o[r];i&&(t(r,ml(e,r,i)),n.push(r))}return n}const vl={provider:"",aliases:{},not_found:{},...pi};function ao(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function vi(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!ao(e,vl))return null;const n=t.icons;for(const r in n){const i=n[r];if(!r.match(le)||typeof i.body!="string"||!ao(i,so))return null}const o=t.aliases||Object.create(null);for(const r in o){const i=o[r],s=i.parent;if(!r.match(le)||typeof s!="string"||!n[s]&&!o[s]||!ao(i,so))return null}return t}const yi=Object.create(null);function Ut(e,t){const n=yi[e]||(yi[e]=Object.create(null));return n[t]||(n[t]=function(o,r){return{provider:o,prefix:r,icons:Object.create(null),missing:new Set}}(e,t))}function co(e,t){return vi(t)?mi(t,(n,o)=>{o?e.icons[n]=o:e.missing.add(n)}):[]}let ue=!1;function wi(e){return typeof e=="boolean"&&(ue=e),ue}function yl(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),ue&&!t&&!e.prefix){let o=!1;return vi(e)&&(e.prefix="",mi(e,(r,i)=>{i&&function(s,a){const l=Je(s,!0,ue);return!!l&&function(h,w,_){try{if(typeof _.body=="string")return h.icons[w]={..._},!0}catch{}return!1}(Ut(l.provider,l.prefix),l.name,a)}(r,i)&&(o=!0)})),o}const n=e.prefix;return Ye({provider:t,prefix:n,name:"a"})?!!co(Ut(t,n),e):!1}const bi=Object.freeze({width:null,height:null}),_i=Object.freeze({...bi,...Ze}),wl=/(-?[0-9.]*[0-9]+[0-9.]*)/g,bl=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Si(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const o=e.split(wl);if(o===null||!o.length)return e;const r=[];let i=o.shift(),s=bl.test(i);for(;;){if(s){const a=parseFloat(i);isNaN(a)?r.push(i):r.push(Math.ceil(a*t*n)/n)}else r.push(i);if(i=o.shift(),i===void 0)return r.join("");s=!s}}const _l=/\sid="(\S+)"/g,Sl="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16);let Cl=0;const lo=Object.create(null);function uo(e){return lo[e]||lo[""]}function ho(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array&&t.length))return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const fo=Object.create(null),tn=["https://api.simplesvg.com","https://api.unisvg.com"],po=[];for(;tn.length>0;)tn.length===1||Math.random()>.5?po.push(tn.shift()):po.push(tn.pop());function El(e,t){const n=ho(t);return n!==null&&(fo[e]=n,!0)}function go(e){return fo[e]}fo[""]=ho({resources:["https://api.iconify.design"].concat(po)});let Ci=(()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}})();const xl={prepare:(e,t,n)=>{const o=[],r=function(l,h){const w=go(l);if(!w)return 0;let _;if(w.maxURL){let k=0;w.resources.forEach(I=>{k=Math.max(k,I.length)});const $=h+".json?icons=";_=w.maxURL-k-w.path.length-$.length}else _=0;return _}(e,t),i="icons";let s={type:i,provider:e,prefix:t,icons:[]},a=0;return n.forEach((l,h)=>{a+=l.length+1,a>=r&&h>0&&(o.push(s),s={type:i,provider:e,prefix:t,icons:[]},a=l.length),s.icons.push(l)}),o.push(s),o},send:(e,t,n)=>{if(!Ci)return void n("abort",424);let o=function(i){if(typeof i=="string"){const s=go(i);if(s)return s.path}return"/"}(t.provider);switch(t.type){case"icons":{const i=t.prefix,s=t.icons.join(",");o+=i+".json?"+new URLSearchParams({icons:s}).toString();break}case"custom":{const i=t.uri;o+=i.slice(0,1)==="/"?i.slice(1):i;break}default:return void n("abort",400)}let r=503;Ci(e+o).then(i=>{const s=i.status;if(s===200)return r=501,i.json();setTimeout(()=>{n(function(a){return a===404}(s)?"abort":"next",s)})}).then(i=>{setTimeout(typeof i=="object"&&i!==null?()=>{n("success",i)}:()=>{i===404?n("abort",i):n("next",r)})}).catch(()=>{n("next",r)})}};function Ei(e,t){e.forEach(n=>{const o=n.loaderCallbacks;o&&(n.loaderCallbacks=o.filter(r=>r.id!==t))})}let kl=0;var Il={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Tl(e,t,n,o){const r=e.resources.length,i=e.random?Math.floor(Math.random()*r):e.index;let s;if(e.random){let f=e.resources.slice(0);for(s=[];f.length>1;){const z=Math.floor(Math.random()*f.length);s.push(f[z]),f=f.slice(0,z).concat(f.slice(z+1))}s=s.concat(f)}else s=e.resources.slice(i).concat(e.resources.slice(0,i));const a=Date.now();let l,h="pending",w=0,_=null,k=[],$=[];function I(){_&&(clearTimeout(_),_=null)}function p(){h==="pending"&&(h="aborted"),I(),k.forEach(f=>{f.status==="pending"&&(f.status="aborted")}),k=[]}function u(f,z){z&&($=[]),typeof f=="function"&&$.push(f)}function v(){h="failed",$.forEach(f=>{f(void 0,l)})}function y(){k.forEach(f=>{f.status==="pending"&&(f.status="aborted")}),k=[]}function d(){if(h!=="pending")return;I();const f=s.shift();if(f===void 0)return k.length?void(_=setTimeout(()=>{I(),h==="pending"&&(y(),v())},e.timeout)):void v();const z={status:"pending",resource:f,callback:(L,D)=>{(function(M,N,O){const T=N!=="success";switch(k=k.filter(W=>W!==M),h){case"pending":break;case"failed":if(T||!e.dataAfterTimeout)return;break;default:return}if(N==="abort")return l=O,void v();if(T)return l=O,void(k.length||(s.length?d():v()));if(I(),y(),!e.random){const W=e.resources.indexOf(M.resource);W!==-1&&W!==e.index&&(e.index=W)}h="completed",$.forEach(W=>{W(O)})})(z,L,D)}};k.push(z),w++,_=setTimeout(d,e.rotate),n(f,t,z.callback)}return typeof o=="function"&&$.push(o),setTimeout(d),function(){return{startTime:a,payload:t,status:h,queriesSent:w,queriesPending:k.length,subscribe:u,abort:p}}}function xi(e){const t={...Il,...e};let n=[];function o(){n=n.filter(r=>r().status==="pending")}return{query:function(r,i,s){const a=Tl(t,r,i,(l,h)=>{o(),s&&s(l,h)});return n.push(a),a},find:function(r){return n.find(i=>r(i))||null},setIndex:r=>{t.index=r},getIndex:()=>t.index,cleanup:o}}function ki(){}const mo=Object.create(null);function Rl(e,t,n){let o,r;if(typeof e=="string"){const i=uo(e);if(!i)return n(void 0,424),ki;r=i.send;const s=function(a){if(!mo[a]){const l=go(a);if(!l)return;const h={config:l,redundancy:xi(l)};mo[a]=h}return mo[a]}(e);s&&(o=s.redundancy)}else{const i=ho(e);if(i){o=xi(i);const s=uo(e.resources?e.resources[0]:"");s&&(r=s.send)}}return o&&r?o.query(t,r,n)().abort:(n(void 0,424),ki)}function vo(e,t){try{return e.getItem(t)}catch{}}function yo(e,t,n){try{return e.setItem(t,n),!0}catch{}}function Ii(e,t){try{e.removeItem(t)}catch{}}function wo(e,t){return yo(e,"iconify-count",t.toString())}function bo(e){return parseInt(vo(e,"iconify-count"))||0}const en={local:!0,session:!0},Ti={local:new Set,session:new Set};let _o=!1,nn=typeof window>"u"?{}:window;function Ri(e){const t=e+"Storage";try{if(nn&&nn[t]&&typeof nn[t].length=="number")return nn[t]}catch{}en[e]=!1}function Mi(e,t){const n=Ri(e);if(!n)return;const o=vo(n,"iconify-version");if(o!=="iconify2"){if(o){const a=bo(n);for(let l=0;l<a;l++)Ii(n,"iconify"+l.toString())}return yo(n,"iconify-version","iconify2"),void wo(n,0)}const r=Math.floor(Date.now()/36e5)-168,i=a=>{const l="iconify"+a.toString(),h=vo(n,l);if(typeof h=="string"){try{const w=JSON.parse(h);if(typeof w=="object"&&typeof w.cached=="number"&&w.cached>r&&typeof w.provider=="string"&&typeof w.data=="object"&&typeof w.data.prefix=="string"&&t(w,a))return!0}catch{}Ii(n,l)}};let s=bo(n);for(let a=s-1;a>=0;a--)i(a)||(a===s-1?(s--,wo(n,s)):Ti[e].add(a))}function Pi(){if(!_o){_o=!0;for(const e in en)Mi(e,t=>{const n=t.data,o=Ut(t.provider,n.prefix);if(!co(o,n).length)return!1;const r=n.lastModified||-1;return o.lastModifiedCached=o.lastModifiedCached?Math.min(o.lastModifiedCached,r):r,!0})}}function Ml(e,t){function n(o){let r;if(!en[o]||!(r=Ri(o)))return;const i=Ti[o];let s;if(i.size)i.delete(s=Array.from(i).shift());else if(s=bo(r),s>=50||!wo(r,s+1))return;const a={cached:Math.floor(Date.now()/36e5),provider:e.provider,data:t};return yo(r,"iconify"+s.toString(),JSON.stringify(a))}_o||Pi(),t.lastModified&&!function(o,r){const i=o.lastModifiedCached;if(i&&i>=r)return i===r;if(o.lastModifiedCached=r,i)for(const s in en)Mi(s,a=>{const l=a.data;return a.provider!==o.provider||l.prefix!==o.prefix||l.lastModified===r});return!0}(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&delete(t=Object.assign({},t)).not_found,n("local")||n("session"))}function zi(){}function Pl(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,function(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout(()=>{t.pendingCallbacksFlag=!1;const n=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!n.length)return;let o=!1;const r=t.provider,i=t.prefix;n.forEach(s=>{const a=s.icons,l=a.pending.length;a.pending=a.pending.filter(h=>{if(h.prefix!==i)return!0;const w=h.name;if(t.icons[w])a.loaded.push({provider:r,prefix:i,name:w});else{if(!t.missing.has(w))return o=!0,!0;a.missing.push({provider:r,prefix:i,name:w})}return!1}),a.pending.length!==l&&(o||Ei([t],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}(e)}))}const zl=(e,t)=>{const n=function(l,h=!0,w=!1){const _=[];return l.forEach(k=>{const $=typeof k=="string"?Je(k,h,w):k;$&&_.push($)}),_}(e,!0,wi()),o=function(l){const h={loaded:[],missing:[],pending:[]},w=Object.create(null);l.sort((k,$)=>k.provider!==$.provider?k.provider.localeCompare($.provider):k.prefix!==$.prefix?k.prefix.localeCompare($.prefix):k.name.localeCompare($.name));let _={provider:"",prefix:"",name:""};return l.forEach(k=>{if(_.name===k.name&&_.prefix===k.prefix&&_.provider===k.provider)return;_=k;const $=k.provider,I=k.prefix,p=k.name,u=w[$]||(w[$]=Object.create(null)),v=u[I]||(u[I]=Ut($,I));let y;y=p in v.icons?h.loaded:I===""||v.missing.has(p)?h.missing:h.pending;const d={provider:$,prefix:I,name:p};y.push(d)}),h}(n);if(!o.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(o.loaded,o.missing,o.pending,zi)}),()=>{l=!1}}const r=Object.create(null),i=[];let s,a;return o.pending.forEach(l=>{const{provider:h,prefix:w}=l;if(w===a&&h===s)return;s=h,a=w,i.push(Ut(h,w));const _=r[h]||(r[h]=Object.create(null));_[w]||(_[w]=[])}),o.pending.forEach(l=>{const{provider:h,prefix:w,name:_}=l,k=Ut(h,w),$=k.pendingIcons||(k.pendingIcons=new Set);$.has(_)||($.add(_),r[h][w].push(_))}),i.forEach(l=>{const{provider:h,prefix:w}=l;r[h][w].length&&function(_,k){_.iconsToLoad?_.iconsToLoad=_.iconsToLoad.concat(k).sort():_.iconsToLoad=k,_.iconsQueueFlag||(_.iconsQueueFlag=!0,setTimeout(()=>{_.iconsQueueFlag=!1;const{provider:$,prefix:I}=_,p=_.iconsToLoad;let u;delete _.iconsToLoad,p&&(u=uo($))&&u.prepare($,I,p).forEach(v=>{Rl($,v,y=>{if(typeof y!="object")v.icons.forEach(d=>{_.missing.add(d)});else try{const d=co(_,y);if(!d.length)return;const f=_.pendingIcons;f&&d.forEach(z=>{f.delete(z)}),Ml(_,y)}catch(d){console.error(d)}Pl(_)})})}))}(l,r[h][w])}),t?function(l,h,w){const _=kl++,k=Ei.bind(null,w,_);if(!h.pending.length)return k;const $={id:_,icons:h,callback:l,abort:k};return w.forEach(I=>{(I.loaderCallbacks||(I.loaderCallbacks=[])).push($)}),k}(t,o,i):zi},Al=/[\s,]+/;function Ll(e,t){t.split(Al).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0}})}function Dl(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function o(r){for(;r<0;)r+=4;return r%4}if(n===""){const r=parseInt(e);return isNaN(r)?0:o(r)}if(n!==e){let r=0;switch(n){case"%":r=25;break;case"deg":r=90}if(r){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=r,i%1==0?o(i):0)}}return t}const Ai={..._i,inline:!1},$l={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Nl={display:"inline-block"},So={backgroundColor:"currentColor"},Li={backgroundColor:"transparent"},Di={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},$i={webkitMask:So,mask:So,background:Li};for(const e in $i){const t=$i[e];for(const n in Di)t[e+n]=Di[n]}const on={};function Ni(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}["horizontal","vertical"].forEach(e=>{const t=e.slice(0,1)+"Flip";on[e+"-flip"]=t,on[e.slice(0,1)+"-flip"]=t,on[e+"Flip"]=t});const Bi=(e,t)=>{const n=function(u,v){const y={...u};for(const d in v){const f=v[d],z=typeof f;d in bi?(f===null||f&&(z==="string"||z==="number"))&&(y[d]=f):z===typeof y[d]&&(y[d]=d==="rotate"?f%4:f)}return y}(Ai,t),o={...$l},r=t.mode||"svg",i={},s=t.style,a=typeof s!="object"||s instanceof Array?{}:s;for(let u in t){const v=t[u];if(v!==void 0)switch(u){case"icon":case"style":case"onLoad":case"mode":break;case"inline":case"hFlip":case"vFlip":n[u]=v===!0||v==="true"||v===1;break;case"flip":typeof v=="string"&&Ll(n,v);break;case"color":i.color=v;break;case"rotate":typeof v=="string"?n[u]=Dl(v):typeof v=="number"&&(n[u]=v);break;case"ariaHidden":case"aria-hidden":v!==!0&&v!=="true"&&delete o["aria-hidden"];break;default:{const y=on[u];y?v!==!0&&v!=="true"&&v!==1||(n[y]=!0):Ai[u]===void 0&&(o[u]=v)}}}const l=function(u,v){const y={...Qe,...u},d={..._i,...v},f={left:y.left,top:y.top,width:y.width,height:y.height};let z=y.body;[y,d].forEach(Z=>{const Q=[],_t=Z.hFlip,Ht=Z.vFlip;let et,St=Z.rotate;switch(_t?Ht?St+=2:(Q.push("translate("+(f.width+f.left).toString()+" "+(0-f.top).toString()+")"),Q.push("scale(-1 1)"),f.top=f.left=0):Ht&&(Q.push("translate("+(0-f.left).toString()+" "+(f.height+f.top).toString()+")"),Q.push("scale(1 -1)"),f.top=f.left=0),St<0&&(St-=4*Math.floor(St/4)),St%=4,St){case 1:et=f.height/2+f.top,Q.unshift("rotate(90 "+et.toString()+" "+et.toString()+")");break;case 2:Q.unshift("rotate(180 "+(f.width/2+f.left).toString()+" "+(f.height/2+f.top).toString()+")");break;case 3:et=f.width/2+f.left,Q.unshift("rotate(-90 "+et.toString()+" "+et.toString()+")")}St%2==1&&(f.left!==f.top&&(et=f.left,f.left=f.top,f.top=et),f.width!==f.height&&(et=f.width,f.width=f.height,f.height=et)),Q.length&&(z=function(ln,un,hn){const me=function(yt,ve="defs"){let ye="";const te=yt.indexOf("<"+ve);for(;te>=0;){const we=yt.indexOf(">",te),ee=yt.indexOf("</"+ve);if(we===-1||ee===-1)break;const wt=yt.indexOf(">",ee);if(wt===-1)break;ye+=yt.slice(we+1,ee).trim(),yt=yt.slice(0,te).trim()+yt.slice(wt+1)}return{defs:ye,content:yt}}(ln);return Zt=me.defs,Qt=un+me.content+hn,Zt?"<defs>"+Zt+"</defs>"+Qt:Qt;var Zt,Qt}(z,'<g transform="'+Q.join(" ")+'">',"</g>"))});const L=d.width,D=d.height,M=f.width,N=f.height;let O,T;L===null?(T=D===null?"1em":D==="auto"?N:D,O=Si(T,M/N)):(O=L==="auto"?M:L,T=D===null?Si(O,N/M):D==="auto"?N:D);const W={},q=(Z,Q)=>{(_t=>_t==="unset"||_t==="undefined"||_t==="none")(Q)||(W[Z]=Q.toString())};q("width",O),q("height",T);const it=[f.left,f.top,M,N];return W.viewBox=it.join(" "),{attributes:W,viewBox:it,body:z}}(e,n),h=l.attributes;if(n.inline&&(i.verticalAlign="-0.125em"),r==="svg"){o.style={...i,...a},Object.assign(o,h);let u=0,v=t.id;return typeof v=="string"&&(v=v.replace(/-/g,"_")),o.innerHTML=function(y,d=Sl){const f=[];let z;for(;z=_l.exec(y);)f.push(z[1]);if(!f.length)return y;const L="suffix"+(16777216*Math.random()|Date.now()).toString(16);return f.forEach(D=>{const M=typeof d=="function"?d(D):d+(Cl++).toString(),N=D.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");y=y.replace(new RegExp('([#;"])('+N+')([")]|\\.[a-z])',"g"),"$1"+M+L+"$3")}),y=y.replace(new RegExp(L,"g"),"")}(l.body,v?()=>v+"ID"+u++:"iconifyVue"),_n("svg",o)}const{body:w,width:_,height:k}=e,$=r==="mask"||r!=="bg"&&w.indexOf("currentColor")!==-1,I=function(u,v){let y=u.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const d in v)y+=" "+d+'="'+v[d]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+y+">"+u+"</svg>"}(w,{...h,width:_+"",height:k+""});var p;return o.style={...i,"--svg":(p=I,'url("'+function(u){return"data:image/svg+xml,"+function(v){return v.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(u)}(p)+'")'),width:Ni(h.width),height:Ni(h.height),...Nl,...$?So:Li,...a},_n("span",o)};var ji;if(wi(!0),ji=xl,lo[""]=ji,typeof document<"u"&&typeof window<"u"){Pi();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!yl(o))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const o="IconifyProviders["+n+"] is invalid.";try{const r=t[n];if(typeof r!="object"||!r||r.resources===void 0)continue;El(n,r)||console.error(o)}catch{console.error(o)}}}}const Bl={...Qe,body:""},Co=Rt({inheritAttrs:!1,data:()=>({_name:"",_loadingIcon:null,iconMounted:!1,counter:0}),mounted(){this.iconMounted=!0},unmounted(){this.abortLoading()},methods:{abortLoading(){this._loadingIcon&&(this._loadingIcon.abort(),this._loadingIcon=null)},getIcon(e,t){if(typeof e=="object"&&e!==null&&typeof e.body=="string")return this._name="",this.abortLoading(),{data:e};let n;if(typeof e!="string"||(n=Je(e,!1,!0))===null)return this.abortLoading(),null;const o=function(i){const s=typeof i=="string"?Je(i,!0,ue):i;if(s){const a=Ut(s.provider,s.prefix),l=s.name;return a.icons[l]||(a.missing.has(l)?null:void 0)}}(n);if(!o)return this._loadingIcon&&this._loadingIcon.name===e||(this.abortLoading(),this._name="",o!==null&&(this._loadingIcon={name:e,abort:zl([n],()=>{this.counter++})})),null;this.abortLoading(),this._name!==e&&(this._name=e,t&&t(e));const r=["iconify"];return n.prefix!==""&&r.push("iconify--"+n.prefix),n.provider!==""&&r.push("iconify--"+n.provider),{data:o,classes:r}}},render(){this.counter;const e=this.$attrs,t=this.iconMounted||e.ssr?this.getIcon(e.icon,e.onLoad):null;if(!t)return Bi(Bl,e);let n=e;return t.classes&&(n={...e,class:(typeof e.class=="string"?e.class+" ":"")+t.classes.join(" ")}),Bi({...Qe,...t.data},n)}}),Jt=new Map,he=K(new Map);class de{static addWindowPanel(t){Jt.set(t.id,t)}static removeWindowPanel(t){Jt.has(t)&&(Jt.delete(t),he.value.delete(t))}static minimizeWindowPanel(t){Jt.has(t)&&he.value.set(t,-1)}static openWindowPanel(t){Jt.has(t)&&he.value.set(t,1)}}const jl=["src"],Ol={key:1,class:"paneltitle"},Wl={class:"dragPanelBar"},Ul={class:"dragPanelContent"},Fl={class:"drag-pointer-group"};var Eo=Rt({__name:"XWindow",props:{top:{type:[String,Number],default:0},left:{type:[String,Number],default:0},nWidth:{type:[String,Number],default:"300px"},nHeight:{type:[String,Number],default:"400px"},icon:{type:String,default:"img/logo.png"},title:{type:String,default:""},titleHeight:{type:[String,Number],default:"40px"},hasMin:{type:Boolean,default:!0},hasMax:{type:Boolean,default:!1},hasClose:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},pid:{type:String,default:""},tag:{type:[String,Array,Object,Number],default:""}},emits:["close","open","loaded","minimize"],setup(e,{expose:t,emit:n}){const o=mr(),r=e,i=n,s=K(),a=K(),l=Xt(()=>r.isDark),h=K({x:0,y:0}),w=250,_=100,k=K({width:0,height:0}),$=T=>{s.value&&(s.value.style.left=`${T.x}px`,s.value.style.top=`${T.y}px`)};Pt(()=>h.value,T=>{$(T)});const I=T=>{s.value&&(s.value.style.width=`${T.width}px`,s.value.style.height=`${T.height}px`)};Pt(()=>k.value,T=>{I(T)});const p={eventListenerController:null,startingEdges:null,newEdges:null,clickStart:null,mount:()=>{Object.entries(p.refs).forEach(([T,W])=>{W.value&&W.value.addEventListener("mousedown",q=>{p.mouseDown(q,T)})})},mouseDown:(T,W)=>{T.button==0&&(T.preventDefault(),p.startingEdges={left:h.value.x,top:h.value.y,right:h.value.x+k.value.width,bottom:h.value.y+k.value.height},p.newEdges={...p.startingEdges},p.clickStart={x:T.clientX,y:T.clientY},p.eventListenerController=new AbortController,document.addEventListener("mousemove",q=>{p.mouseMove(q,W)},{signal:p.eventListenerController.signal}),document.addEventListener("mouseup",q=>{p.mouseUp(q,W)},{signal:p.eventListenerController.signal}))},mouseMove:(T,W)=>{if(p.startingEdges!=null&&p.newEdges!=null&&p.clickStart!=null&&p.refs[W].value){if(T.preventDefault(),console.log("mouseMove",W),W.toLowerCase().includes("north")){p.newEdges.top=Math.max(p.startingEdges.top+T.clientY-p.clickStart.y,0);const q=p.newEdges.bottom-p.newEdges.top-_;q<0&&(p.newEdges.top+=q)}else W.toLowerCase().includes("south")&&(p.newEdges.bottom=Math.min(p.startingEdges.bottom+T.clientY-p.clickStart.y,document.body.clientHeight));if(W.toLowerCase().includes("west")){p.newEdges.left=Math.max(p.startingEdges.left+T.clientX-p.clickStart.x,0);const q=p.newEdges.right-p.newEdges.left-w;q<0&&(p.newEdges.left+=q)}else W.toLowerCase().includes("east")&&(p.newEdges.right=Math.min(p.startingEdges.right+T.clientX-p.clickStart.x,document.body.clientWidth));p.update()}},update:()=>{p.newEdges==null||p.startingEdges==null||(h.value={x:Math.max(p.newEdges.left,0),y:Math.max(p.newEdges.top,0)},k.value={width:Math.min(Math.max(p.newEdges.right-p.newEdges.left,w),document.body.clientWidth),height:Math.min(Math.max(p.newEdges.bottom-p.newEdges.top,_),document.body.clientHeight)})},mouseUp:(T,W)=>{T.button!=0||p.startingEdges==null||(console.log("mouseUp",W),T.preventDefault(),p.startingEdges=null,p.newEdges=null,p.clickStart=null,p.eventListenerController&&(p.eventListenerController.abort(),p.eventListenerController=null))},refs:{northWest:K(null),north:K(null),northEast:K(null),west:K(null),east:K(null),southWest:K(null),south:K(null),southEast:K(null)}},u={startingMouse:null,startingPosition:null,mouseDown:T=>{T.button==0&&(T.preventDefault(),console.log("mouseDown"),u.startingMouse={x:T.clientX,y:T.clientY},u.startingPosition=h.value,document.addEventListener("mousemove",u.mouseMove),document.addEventListener("mouseup",u.mouseUp))},mouseMove:T=>{!u.startingMouse||!u.startingPosition||(T.preventDefault(),h.value={x:Math.min(Math.max(u.startingPosition.x+T.clientX-u.startingMouse.x,0),document.body.clientWidth-k.value.width),y:Math.min(Math.max(u.startingPosition.y+T.clientY-u.startingMouse.y,0),document.body.clientHeight-k.value.height)})},mouseUp:T=>{T.button!=0||!u.startingMouse||!u.startingPosition||(T.preventDefault(),u.startingMouse=null,u.startingPosition=null,console.log("mouseUp"),document.removeEventListener("mousemove",u.mouseMove),document.removeEventListener("mouseup",u.mouseUp))}};function v(T){return{id:o,icon:r.icon,title:r.title,pid:r.pid,data:T??r.tag}}const y=Xt(()=>he.value.get(o)!==-1),d=K(!1),f=K(!0);function z(){i("minimize",v()),de.minimizeWindowPanel(o)}function L(){d.value=!d.value}function D(){i("close",v(!1)),de.removeWindowPanel(o),f.value=!1}const M=Xt(()=>d.value?"heroicons-outline:square-2-stack":"ant-design:border-outlined"),N={id:o,isShow:y,close:D,open:function(){i("open",v(!0)),f.value=!0},showHidePanel:z};function O(T){if(zn(T))return T;{const W=Number(T);if(W==W)return W;if(T.endsWith("px")){const q=T.substring(0,T.length-2);return Number(q)}if(T.endsWith("%")){const q=T.substring(0,T.length-1);return Number(q)/100*document.body.clientWidth}return 300}}return t(N),Sn(()=>{(function(){let T=90;if(r.hasMin||(T-=30),r.hasMax||(T-=30),r.hasClose||(T-=30),ft.setCssVar("--right-bar-width",T+"px",a.value),!a.value)return;const W=zn(r.titleHeight)?r.titleHeight+"px":r.titleHeight;a.value.style.height=W,a.value.style.lineHeight=W})(),function(){const T=v(N);de.addWindowPanel(T),i("loaded",T)}(),h.value.x=O(r.left),h.value.y=O(r.top),$(h.value),k.value={width:O(r.nWidth),height:O(r.nHeight)},I(k.value),p.mount()}),Os(()=>{de.removeWindowPanel(o)}),(T,W)=>(X(),nt(ir,{appear:"","enter-active-class":"animated zoomIn","leave-active-class":"animated zoomOut"},{default:Ct(()=>[f.value?sr((X(),gt("div",{key:0,ref_key:"dragPanelRef",ref:s,class:At(["dragWindowPanel",{maxPanel:d.value,dragWindowPanel_dark:l.value}])},[J("div",{class:"dragPanelTitle",ref_key:"dragPanelTitleRef",ref:a,onMousedown:W[0]||(W[0]=(...q)=>u.mouseDown&&u.mouseDown(...q))},[ct(T.$slots,"title",{},()=>[r.icon?(X(),gt("img",{key:0,src:r.icon,width:"24",height:"24"},null,8,jl)):st("v-if",!0),r.title?(X(),gt("span",Ol,En(r.title),1)):st("v-if",!0)]),J("div",Wl,[e.hasMin?(X(),nt(xn(Co),{key:0,icon:"ant-design:minus-outlined",onClick:z})):st("v-if",!0),e.hasMax?(X(),nt(xn(Co),{key:1,icon:M.value,onClick:L},null,8,["icon"])):st("v-if",!0),e.hasClose?(X(),nt(xn(Co),{key:2,icon:"ant-design:close-outlined",onClick:D})):st("v-if",!0)])],544),J("div",Ul,[ct(T.$slots,"default")]),J("div",Fl,[J("div",{class:"cursor-nw-resize",ref:p.refs.northWest},null,512),J("div",{class:"cursor-n-resize",ref:p.refs.north},null,512),J("div",{class:"cursor-ne-resize",ref:p.refs.northEast},null,512),J("div",{class:"cursor-w-resize",ref:p.refs.west},null,512),W[1]||(W[1]=J("span",{style:{"pointer-events":"all",visibility:"hidden"}},null,-1)),J("div",{class:"cursor-e-resize",ref:p.refs.east},null,512),J("div",{class:"cursor-sw-resize",ref:p.refs.southWest},null,512),J("div",{class:"cursor-s-resize",ref:p.refs.south},null,512),J("div",{class:"cursor-se-resize",ref:p.refs.southEast},null,512)])],2)),[[ar,y.value]]):st("v-if",!0)]),_:3}))}});function Hl(e){const t=new Hs(new Ee);return t.serialize(e),t.stream.toString()}function ql(e){return e==null||e===""?e:new qs(new Ee(e)).deserialize()}Eo.__scopeId="data-v-39ea9741",Eo.__file="src/controls/xwindow/XWindow.vue";const rn=new Map,xo=new Map;let sn;const Xl={getDefaultClient(){if(sn||(sn=new oe(SysConfig.DefaultHproseAPI)),!sn)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return sn},registerHprose(e,t){const n=xo.get(e);if(!n){const o=new oe(t);rn.set(e,o)}return n},getHprose:e=>xo?.get(e),getProxyHprose:e=>rn.get(e),unregisterHprose(e){rn.get(e)&&(xo.delete(e),rn.delete(e))}},Vl=5e3,Gl=36e5,Ft={Login:"/api/User/Login",ChangeMyPwd:"/api/User/ChangeMyPwd",Logout:"/api/Check/ExitLogin",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken",GetSystemRights:"/api/System/GetSystem"},ko="access_token",Kl=j.Config.ServiceURL.LoginAuthURL;function Io(){const e=Ir();e&&It(Ft.RefreshToken,Kl,{refreshToken:e}).then(t=>{To(t.data)})}function Oi(){const e=kt.getJsonObject(ko);if(!e)return;const t=new Date().getTime(),n=new Date(e.expire).getTime()-t;n>0&&(n<=5e3?Io():setTimeout(Io,n-5e3))}function To(e){const t=new Date().getTime();let n=new Date(e.accessToken.expires).getTime()-t;if(n>=36e5?(n=18e5,console.warn("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u8FC7\u53BB\u65F6\u95F4\uFF01")):n<-6e5&&(n=18e5,console.warn("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u672A\u6765\u65F6\u95F4\uFF01")),n>0){let o=Nt();o?(o.token=e.accessToken.tokenContent,o.expire=e.accessToken.expires,o.refresh=e.refreshToken.tokenContent):o={token:e.accessToken.tokenContent,expire:e.accessToken.expires,refresh:e.refreshToken.tokenContent},kt.set(ko,o,n/1e3),Oi()}else kt.remove(ko)}const an="Wm314243",cn=j.Config.ServiceURL.LoginAuthURL;async function Jl(e){const t={username:e.username,pwd:ie.encryptToString(e.pwd,an)},n=(await It(Ft.Login,cn,t))?.data;return n&&To(n.doubletoken),n}function Yl(e){const t={oldpwd:ie.encryptToString(e.oldpwd,an),newpwd:ie.encryptToString(e.newpwd,an)};return It(Ft.ChangeMyPwd,cn,t)}function Zl(e){return ie.encryptToString(e,an)}function Ql(){const e=Nt();e&&(Rr(Ft.Logout,cn,{token:e.token,reftoken:e.refresh}),Hn())}function tu(e){return It(Ft.CheckToken,cn,{token:e})}const Ro="ROLE_SYSTEM_RIGHT",Mo=new Ae("",sessionStorage);function Wi(){return Mo.get(Ro)}function Po(e){Mo.set(Ro,e)}function Ui(){Mo.remove(Ro)}function Yt(e){if(e)for(let t=0;t<e.length;t++){const n=e[t];n.children&&n.children.length>0?(Yt(n.children),n.children.length===0&&(e.splice(t,1),t--)):n.selected||(e.splice(t,1),t--)}}function Fi(e,t,n="name"){e&&t&&e.forEach(o=>{const r=t.find(i=>i[n]===o[n]);r&&(o.children?r.children&&Fi(o.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(o.selected=r.selected))})}function Hi(e,t,n="name"){e&&t&&e.forEach(o=>{const r=t.find(i=>i[n]===o[n]);r&&(o.children?r.children&&Hi(o.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(o.selected=r.selected))})}function fe(e,t,n,o="name"){const r=e[n],i=t[n];r?i&&Hi(r,i,o):i&&(e[n]=i)}function qi(e){if(e&&e.length>0){const t=e.length;let n,o=!1;if(t>0){o=Lt(e[0]);const r=o?e[0]:JSON.parse(e[0]);if(t>1)for(let i=1;i<e.length;i++){const s=e[i],a=o?s:JSON.parse(s);fe(r,a,"routes","name"),fe(r,a,"widgetMenu","name"),fe(r,a,"widgets","id"),fe(r,a,"functions","id")}n=r}return n&&(Yt(n.routes),Yt(n.widgetMenu),Yt(n.widgets),Yt(n.functions)),n}}const zo=[],Ao=[],Lo=[];function pe(){return Wi()}async function eu(e,t=!1){Ui();const n=Ft.GetSystemRights,o=j.Config.ServiceURL.LoginAuthURL,r=await It(n,o,{systemid:e});if(!r||!r.data)return void j.Message?.warn("\u65E0\u6CD5\u83B7\u53D6\u529F\u80FD\u6388\u6743\u5217\u8868\uFF01");const i=r.data;if(i&&i.length>0){if(t){const s=JSON.parse(i[0]);return Po(s),s}{const s=qi(i);return Po(s),s}}}function Xi(e,t){const n={...e};return n.meta||(n.meta={}),t.index!=null&&(n.meta.index=t.index),t.title!=null&&(n.meta.title=t.title),e.children&&(n.children=[],t.children&&t.children.forEach(o=>{const r=e.children?.find(i=>i.path===o.path);if(r){const i=Xi(r,o);i&&n.children?.push(i)}})),n}function nu(e,t=2){if(t===0)return e;const n=pe();return n&&n.routes?(Lo.length>0||e.forEach(o=>{const r=n.routes?.find(i=>i.name===o.name);if(r){const i=Xi(o,r);i&&Lo.push(i)}}),Lo):void 0}function Vi(e,t){const n={...e};return t.index!=null&&(n.index=t.index),e.children&&(n.children=[],t.children&&t.children.forEach(o=>{const r=e.children?.find(i=>i.name===o.name);if(r){const i=Vi(r,o);i&&n.children?.push(i)}})),n}function ou(e,t=2){if(t===0)return e;const n=pe();return n&&n.widgetMenu?(Ao.length>0||e.forEach(o=>{const r=n.widgetMenu?.find(i=>i.name===o.name);if(r){const i=Vi(o,r);i&&Ao.push(i)}}),Ao):void 0}function ru(e,t=2){if(t===0)return e;const n=pe();return n&&n.widgets?(zo.length>0||e?.forEach(o=>{n.widgets?.find(r=>r.id===o.id)&&zo.push(o)}),zo):void 0}function iu(e,t=2){if(t===0)return e;const n=pe();return n?n.functions:void 0}export{tc as BigFileDownload,De as Download,za as DownloadByUrl,Dt as EnumColor,Nr as FileUpload,tl as GetSignalRClient,j as Global,Xl as GlobalHprose,$t as GlobalMitt,ft as H5Tool,ge as HproseClient,Pa as HttpDownload,yr as JsonDownload,Ke as LayoutContainer,ht as LayoutContainerEnum,di as LayoutManager,he as MinWindowMap,ec as ObjToUrlParams,In as Pane,oe as ProxyClient,io as RouterTransition,fi as RouterTransitionAnimate,Ma as SaveAs,Vs as Splitpanes,Ae as Storage,ze as StringUtils,rl as StyleBlack,al as StyleGrayblue,sl as StyleMetal,il as StyleWhite,ce as SuspenseWithError,lt as SysEvents,Vl as TOKEN_REFRESH_TIME,Gl as TOKEN_VALID_TIMESPAN,Ft as USER_TOKEN_API,Ge as VWindow,Tc as WaterMark,ui as WindowResizeEvent,cl as WindowType,Jt as WindowsMap,Eo as XWindow,de as XWindowManager,ie as XXTEA,Ra as calculateBestTextColor,Yl as changeMyPWD,Oi as checkDoRefreshToken,tu as checkToken,Hn as clearLocalToken,Ui as clearRight,ka as colorIsDark,Ha as createFileUpload,Ia as darken,Xr as deepMerge,br as delay,ql as deserialize,Io as doRefreshToken,Vr as exportSystemRights,La as get,pe as getCurrentSystemRight,$a as getData,Zl as getEncryptPWD,iu as getFunctions,ba as getHexColor,Nt as getLocalToken,Ga as getLockState,Sa as getLongHexColor,Br as getProxyClient,_a as getRGBColor,Ea as getRGBColorFromHSLA,Ir as getRefreshToken,Wi as getRight,nu as getRoutes,eu as getSystemRoleRight,ru as getWidgetConfig,ou as getWidgetMenus,Yt as handleNodes,Nn as hexToRGB,Xa as init,Va as initDefaultProxyClient,dt as is,An as isArray,na as isAsyncFunction,ra as isBoolean,ia as isClient,ea as isDate,fr as isDef,aa as isElement,ua as isEmpty,Ca as isEnumColor,ha as isError,Re as isFunction,Le as isHexColor,la as isImageDom,ga as isMap,Pn as isNull,Qs as isNullAndUnDef,ta as isNullOrUnDef,zn as isNumber,Lt as isObjectX,oa as isPromise,ca as isServer,Me as isString,pa as isSymbol,Mn as isUnDef,ma as isValidURL,fa as isWeakMap,da as isWeakSet,sa as isWindow,qa as jquery,Ta as lighten,Jl as login,Ql as logout,qi as mergeFilterRoleSysRight,Fi as mergeNodes,fe as mergeNodesAll,wa as newGuid,Ka as onLockListener,Da as post,It as requestGet,Tr as requestPost,Rr as requestPostBody,xa as rgbToHex,Hl as serialize,To as setLocalToken,Po as setRight,Aa as sleep,ya as storage,kt as storageHelper,Ja as unLockListener,mr as uuid,ac as verifiyNumberInteger,mc as verifyAccount,uc as verifyAndSpace,kc as verifyCarNum,cc as verifyCnAndSpace,_c as verifyEmail,lc as verifyEnAndSpace,Cc as verifyFullName,bc as verifyIPAddress,Sc as verifyIdCard,fc as verifyNumberCnUppercase,hc as verifyNumberComma,to as verifyNumberIntegerAndFloat,ic as verifyNumberPercentage,sc as verifyNumberPercentageFloat,vc as verifyPassword,yc as verifyPasswordPowerful,wc as verifyPasswordStrength,pc as verifyPhone,Ec as verifyPostalCode,gc as verifyTelPhone,dc as verifyTextColor,xc as verifyUrl,oc as writeIconifyList,rc as writeSysRoleRight};
|